summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore39
-rw-r--r--BUILD/FINISH.sh20
-rw-r--r--BUILD/Makefile.am83
-rwxr-xr-xBUILD/SETUP.sh31
-rwxr-xr-xBUILD/autorun.sh57
-rwxr-xr-xBUILD/build_mccge.sh313
-rwxr-xr-xBUILD/check-cpu16
-rwxr-xr-xBUILD/cleanup15
-rw-r--r--BUILD/cmake_configure.sh28
-rwxr-xr-xBUILD/compile-alpha15
-rwxr-xr-xBUILD/compile-alpha-debug15
-rwxr-xr-xBUILD/compile-amd64-debug-max16
-rwxr-xr-xBUILD/compile-amd64-debug-max-no-ndb18
-rwxr-xr-xBUILD/compile-amd64-gcov15
-rwxr-xr-xBUILD/compile-amd64-gprof15
-rwxr-xr-xBUILD/compile-amd64-max15
-rw-r--r--BUILD/compile-amd64-max-sci15
-rwxr-xr-xBUILD/compile-amd64-valgrind-max32
-rwxr-xr-xBUILD/compile-darwin-mwcc15
-rwxr-xr-xBUILD/compile-dist2
-rwxr-xr-xBUILD/compile-hpux11-parisc2-aCC15
-rwxr-xr-xBUILD/compile-ia64-debug-max17
-rwxr-xr-xBUILD/compile-irix-mips64-mipspro15
-rwxr-xr-xBUILD/compile-ndb-autotest15
-rwxr-xr-xBUILD/compile-pentium15
-rwxr-xr-xBUILD/compile-pentium-cybozu15
-rwxr-xr-xBUILD/compile-pentium-debug15
-rwxr-xr-xBUILD/compile-pentium-debug-max15
-rwxr-xr-xBUILD/compile-pentium-debug-max-no-embedded15
-rwxr-xr-xBUILD/compile-pentium-debug-max-no-ndb15
-rwxr-xr-xBUILD/compile-pentium-debug-openssl15
-rwxr-xr-xBUILD/compile-pentium-debug-yassl15
-rwxr-xr-xBUILD/compile-pentium-gcov15
-rwxr-xr-xBUILD/compile-pentium-gprof15
-rwxr-xr-xBUILD/compile-pentium-icc15
-rwxr-xr-xBUILD/compile-pentium-icc-valgrind-max15
-rw-r--r--BUILD/compile-pentium-icc-yassl15
-rwxr-xr-xBUILD/compile-pentium-max15
-rwxr-xr-xBUILD/compile-pentium-myodbc15
-rwxr-xr-xBUILD/compile-pentium-pgcc15
-rwxr-xr-xBUILD/compile-pentium-valgrind-max30
-rwxr-xr-xBUILD/compile-pentium-valgrind-max-no-ndb32
-rwxr-xr-xBUILD/compile-pentium6417
-rwxr-xr-xBUILD/compile-pentium64-debug15
-rwxr-xr-xBUILD/compile-pentium64-debug-max15
-rwxr-xr-xBUILD/compile-pentium64-gcov15
-rwxr-xr-xBUILD/compile-pentium64-gprof15
-rwxr-xr-xBUILD/compile-pentium64-max17
-rw-r--r--BUILD/compile-pentium64-max-sci15
-rwxr-xr-xBUILD/compile-pentium64-valgrind-max30
-rwxr-xr-xBUILD/compile-ppc15
-rwxr-xr-xBUILD/compile-ppc-debug15
-rwxr-xr-xBUILD/compile-ppc-debug-max15
-rwxr-xr-xBUILD/compile-ppc-debug-max-no-ndb15
-rwxr-xr-xBUILD/compile-ppc-max15
-rwxr-xr-xBUILD/compile-solaris-amd64-debug15
-rwxr-xr-xBUILD/compile-solaris-amd64-forte3
-rwxr-xr-xBUILD/compile-solaris-sparc15
-rwxr-xr-xBUILD/compile-solaris-sparc-debug15
-rwxr-xr-xBUILD/compile-solaris-sparc-forte15
-rwxr-xr-xBUILD/compile-solaris-sparc-purify15
-rw-r--r--CMakeLists.txt88
-rw-r--r--Docs/Makefile.am39
-rw-r--r--EXCEPTIONS-CLIENT119
-rw-r--r--Makefile.am347
-rw-r--r--README67
-rw-r--r--VERSION4
-rw-r--r--client/Makefile.am121
-rw-r--r--client/client_priv.h8
-rw-r--r--client/completion_hash.h4
-rw-r--r--client/my_readline.h4
-rw-r--r--client/mysql.cc60
-rw-r--r--client/mysql_upgrade.c18
-rw-r--r--client/mysqladmin.cc37
-rw-r--r--client/mysqlbinlog.cc56
-rw-r--r--client/mysqlcheck.c90
-rw-r--r--client/mysqldump.c47
-rw-r--r--client/mysqlimport.c22
-rw-r--r--client/mysqlshow.c20
-rw-r--r--client/mysqlslap.c57
-rw-r--r--client/mysqltest.cc453
-rw-r--r--client/readline.cc43
-rw-r--r--client/sql_string.h10
-rw-r--r--cmake/Makefile.am40
-rw-r--r--cmake/abi_check.cmake18
-rw-r--r--cmake/build_configurations/mysql_release.cmake63
-rw-r--r--cmake/character_sets.cmake14
-rw-r--r--cmake/cmake_parse_arguments.cmake2
-rw-r--r--cmake/configure.pl10
-rw-r--r--cmake/do_abi_check.cmake30
-rw-r--r--cmake/dtrace.cmake12
-rw-r--r--cmake/info_bin.cmake30
-rw-r--r--cmake/info_macros.cmake.in132
-rw-r--r--cmake/info_src.cmake31
-rw-r--r--cmake/install_layout.cmake29
-rw-r--r--cmake/install_macros.cmake19
-rw-r--r--cmake/libutils.cmake5
-rw-r--r--cmake/maintainer.cmake54
-rw-r--r--cmake/make_dist.cmake.in63
-rw-r--r--cmake/mysql_add_executable.cmake4
-rw-r--r--cmake/mysql_version.cmake115
-rw-r--r--cmake/os/Linux.cmake2
-rw-r--r--cmake/os/SunOS.cmake1
-rw-r--r--cmake/os/Windows.cmake13
-rw-r--r--cmake/os/WindowsCache.cmake10
-rw-r--r--cmake/plugin.cmake34
-rw-r--r--cmake/versioninfo.rc.in8
-rw-r--r--cmd-line-utils/Makefile.am21
-rw-r--r--cmd-line-utils/libedit/CMakeLists.txt15
-rw-r--r--cmd-line-utils/libedit/Makefile.am92
-rw-r--r--cmd-line-utils/libedit/common.c5
-rw-r--r--cmd-line-utils/libedit/el.c21
-rw-r--r--cmd-line-utils/libedit/readline.c23
-rw-r--r--cmd-line-utils/libedit/vi.c41
-rw-r--r--cmd-line-utils/readline/CMakeLists.txt2
-rw-r--r--cmd-line-utils/readline/Makefile.am34
-rw-r--r--cmd-line-utils/readline/bind.c2
-rw-r--r--cmd-line-utils/readline/complete.c7
-rw-r--r--cmd-line-utils/readline/histfile.c1
-rw-r--r--cmd-line-utils/readline/isearch.c8
-rw-r--r--cmd-line-utils/readline/parens.c4
-rw-r--r--cmd-line-utils/readline/readline.c3
-rw-r--r--cmd-line-utils/readline/terminal.c8
-rw-r--r--cmd-line-utils/readline/text.c3
-rw-r--r--config.h.cmake31
-rw-r--r--config/ac-macros/alloca.m468
-rw-r--r--config/ac-macros/character_sets.m4501
-rw-r--r--config/ac-macros/check_cpu.m447
-rw-r--r--config/ac-macros/compiler_flag.m462
-rw-r--r--config/ac-macros/dtrace.m438
-rw-r--r--config/ac-macros/ha_ndbcluster.m4343
-rw-r--r--config/ac-macros/large_file.m4142
-rw-r--r--config/ac-macros/libevent.m495
-rw-r--r--config/ac-macros/libevent_configure.m4324
-rw-r--r--config/ac-macros/maintainer.m464
-rw-r--r--config/ac-macros/misc.m4688
-rw-r--r--config/ac-macros/plugins.m4902
-rw-r--r--config/ac-macros/readline.m4143
-rw-r--r--config/ac-macros/ssl.m4219
-rw-r--r--config/ac-macros/zlib.m4132
-rw-r--r--configure.cmake103
-rw-r--r--configure.in3121
-rw-r--r--dbug/Makefile.am67
-rw-r--r--dbug/dbug.c303
-rwxr-xr-xdbug/dbug_add_tags.pl15
-rw-r--r--dbug/dbug_analyze.c610
-rw-r--r--dbug/my_main.c5
-rw-r--r--dbug/tests.c5
-rw-r--r--extra/Makefile.am57
-rw-r--r--extra/comp_err.c3
-rw-r--r--extra/my_print_defaults.c2
-rw-r--r--extra/perror.c34
-rw-r--r--extra/replace.c18
-rw-r--r--extra/yassl/Makefile.am2
-rw-r--r--extra/yassl/examples/client/client.cpp18
-rw-r--r--extra/yassl/examples/echoclient/echoclient.cpp18
-rw-r--r--extra/yassl/examples/echoserver/echoserver.cpp18
-rw-r--r--extra/yassl/examples/server/server.cpp18
-rw-r--r--extra/yassl/include/lock.hpp2
-rw-r--r--extra/yassl/include/openssl/crypto.h18
-rw-r--r--extra/yassl/include/openssl/des.h18
-rw-r--r--extra/yassl/include/openssl/des_old.h18
-rw-r--r--extra/yassl/include/openssl/engine.h18
-rw-r--r--extra/yassl/include/openssl/err.h18
-rw-r--r--extra/yassl/include/openssl/evp.h18
-rwxr-xr-xextra/yassl/include/openssl/generate_prefix_files.pl16
-rw-r--r--extra/yassl/include/openssl/hmac.h18
-rw-r--r--extra/yassl/include/openssl/lhash.h18
-rw-r--r--extra/yassl/include/openssl/md4.h18
-rw-r--r--extra/yassl/include/openssl/md5.h18
-rw-r--r--extra/yassl/include/openssl/objects.h18
-rw-r--r--extra/yassl/include/openssl/opensslv.h18
-rw-r--r--extra/yassl/include/openssl/pem.h18
-rw-r--r--extra/yassl/include/openssl/pkcs12.h18
-rw-r--r--extra/yassl/include/openssl/prefix_crypto.h18
-rw-r--r--extra/yassl/include/openssl/prefix_ssl.h18
-rw-r--r--extra/yassl/include/openssl/rand.h18
-rw-r--r--extra/yassl/include/openssl/rsa.h18
-rw-r--r--extra/yassl/include/openssl/sha.h18
-rw-r--r--extra/yassl/include/openssl/x509.h18
-rw-r--r--extra/yassl/include/openssl/x509v3.h18
-rw-r--r--extra/yassl/src/Makefile.am8
-rw-r--r--extra/yassl/src/lock.cpp2
-rw-r--r--extra/yassl/src/make.bat15
-rw-r--r--extra/yassl/src/yassl_int.cpp2
-rw-r--r--extra/yassl/taocrypt/Makefile.am2
-rw-r--r--extra/yassl/taocrypt/benchmark/Makefile.am6
-rw-r--r--extra/yassl/taocrypt/benchmark/benchmark.cpp18
-rw-r--r--extra/yassl/taocrypt/benchmark/make.bat15
-rw-r--r--extra/yassl/taocrypt/src/Makefile.am14
-rw-r--r--extra/yassl/taocrypt/src/make.bat15
-rw-r--r--extra/yassl/taocrypt/test/Makefile.am6
-rw-r--r--extra/yassl/taocrypt/test/make.bat15
-rw-r--r--extra/yassl/taocrypt/test/memory.cpp18
-rw-r--r--extra/yassl/taocrypt/test/test.cpp18
-rw-r--r--extra/yassl/testsuite/Makefile.am10
-rw-r--r--extra/yassl/testsuite/make.bat15
-rw-r--r--extra/yassl/testsuite/test.hpp18
-rw-r--r--extra/yassl/testsuite/testsuite.cpp18
-rw-r--r--include/CMakeLists.txt5
-rw-r--r--include/Makefile.am111
-rw-r--r--include/atomic/x86-gcc.h14
-rw-r--r--include/decimal.h22
-rw-r--r--include/heap.h12
-rw-r--r--include/m_ctype.h85
-rw-r--r--include/m_string.h19
-rw-r--r--include/my_base.h20
-rw-r--r--include/my_bit.h22
-rw-r--r--include/my_bitmap.h13
-rw-r--r--include/my_compare.h126
-rw-r--r--include/my_compiler.h26
-rw-r--r--include/my_dbug.h39
-rw-r--r--include/my_getopt.h15
-rw-r--r--include/my_global.h77
-rw-r--r--include/my_handler.h154
-rw-r--r--include/my_net.h34
-rw-r--r--include/my_no_pthread.h72
-rw-r--r--include/my_pthread.h206
-rw-r--r--include/my_stacktrace.h2
-rw-r--r--include/my_sys.h57
-rw-r--r--include/my_time.h13
-rw-r--r--include/my_valgrind.h37
-rw-r--r--include/myisam.h13
-rw-r--r--include/myisamchk.h2
-rw-r--r--include/mysql.h11
-rw-r--r--include/mysql.h.pp9
-rw-r--r--include/mysql/client_plugin.h30
-rw-r--r--include/mysql/client_plugin.h.pp8
-rw-r--r--include/mysql/innodb_priv.h1
-rw-r--r--include/mysql/plugin_audit.h59
-rw-r--r--include/mysql/plugin_audit.h.pp44
-rw-r--r--include/mysql/plugin_auth.h47
-rw-r--r--include/mysql/plugin_auth.h.pp53
-rw-r--r--include/mysql/plugin_auth_common.h1
-rw-r--r--include/mysql/plugin_ftparser.h.pp17
-rw-r--r--include/mysql/psi/mysql_file.h2
-rw-r--r--include/mysql/psi/mysql_thread.h88
-rw-r--r--include/mysql/service_thd_wait.h30
-rw-r--r--include/mysql/thread_pool_priv.h121
-rw-r--r--include/mysql_com.h12
-rw-r--r--include/mysql_embed.h2
-rw-r--r--include/mysys_err.h4
-rw-r--r--include/thr_alarm.h2
-rw-r--r--include/typelib.h18
-rw-r--r--include/violite.h10
-rw-r--r--include/welcome_copyright_notice.h30
-rw-r--r--libmysql/CMakeLists.txt19
-rw-r--r--libmysql/Makefile.am115
-rw-r--r--libmysql/Makefile.shared120
-rw-r--r--libmysql/acinclude.m491
-rw-r--r--libmysql/authentication_win/CMakeLists.txt33
-rw-r--r--libmysql/authentication_win/common.cc492
-rw-r--r--libmysql/authentication_win/common.h324
-rw-r--r--libmysql/authentication_win/handshake.cc289
-rw-r--r--libmysql/authentication_win/handshake.h181
-rw-r--r--libmysql/authentication_win/handshake_client.cc378
-rw-r--r--libmysql/authentication_win/log_client.cc55
-rw-r--r--libmysql/authentication_win/plugin_client.cc68
-rw-r--r--libmysql/client_settings.h15
-rw-r--r--libmysql/conf_to_src.c3
-rw-r--r--libmysql/errmsg.c5
-rw-r--r--libmysql/get_password.c3
-rw-r--r--libmysql/libmysql.c92
-rw-r--r--libmysql_r/Makefile.am45
-rw-r--r--libmysqld/CMakeLists.txt4
-rw-r--r--libmysqld/Makefile.am235
-rw-r--r--libmysqld/copyright14
-rw-r--r--libmysqld/examples/Makefile.am53
-rwxr-xr-xlibmysqld/examples/test-run15
-rw-r--r--libmysqld/lib_sql.cc45
-rw-r--r--libservices/CMakeLists.txt2
-rw-r--r--libservices/Makefile.am21
-rw-r--r--man/CMakeLists.txt6
-rw-r--r--man/Makefile.am26
-rw-r--r--mysql-test/CMakeLists.txt3
-rw-r--r--mysql-test/Makefile.am157
-rw-r--r--mysql-test/collections/README.experimental6
-rw-r--r--mysql-test/collections/default.daily20
-rw-r--r--mysql-test/collections/default.experimental99
-rw-r--r--mysql-test/collections/default.push2
-rw-r--r--mysql-test/collections/default.release11
-rwxr-xr-x[-rw-r--r--]mysql-test/collections/default.weekly8
-rw-r--r--mysql-test/collections/disabled-daily.list9
-rw-r--r--mysql-test/collections/disabled-weekly.list9
-rw-r--r--mysql-test/collections/mysql-next-mr.push5
-rw-r--r--mysql-test/collections/mysql-trunk.push5
-rw-r--r--mysql-test/collections/test-bt10
-rw-r--r--mysql-test/collections/test-bt-debug1
-rw-r--r--mysql-test/collections/test-bt-fast2
-rw-r--r--mysql-test/extra/binlog_tests/binlog.test54
-rw-r--r--mysql-test/extra/binlog_tests/binlog_cache_stat.test251
-rw-r--r--mysql-test/extra/binlog_tests/binlog_insert_delayed.test4
-rw-r--r--mysql-test/extra/binlog_tests/binlog_truncate.test6
-rw-r--r--mysql-test/extra/binlog_tests/blackhole.test2
-rw-r--r--mysql-test/extra/binlog_tests/database.test27
-rw-r--r--mysql-test/extra/binlog_tests/implicit.test4
-rw-r--r--mysql-test/extra/binlog_tests/innodb_stat.test41
-rw-r--r--mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test2
-rw-r--r--mysql-test/extra/rpl_tests/check_type.inc14
-rw-r--r--mysql-test/extra/rpl_tests/create_recursive_construct.inc39
-rw-r--r--mysql-test/extra/rpl_tests/rpl_EE_err.test9
-rw-r--r--mysql-test/extra/rpl_tests/rpl_auto_increment.test50
-rw-r--r--mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test9
-rw-r--r--mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test6
-rw-r--r--mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test223
-rw-r--r--mysql-test/extra/rpl_tests/rpl_charset.test6
-rw-r--r--mysql-test/extra/rpl_tests/rpl_commit_after_flush.test8
-rw-r--r--mysql-test/extra/rpl_tests/rpl_conflicts.test17
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ddl.test11
-rw-r--r--mysql-test/extra/rpl_tests/rpl_deadlock.test1
-rw-r--r--mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc24
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test1032
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test933
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extra_col_master.test1019
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extra_col_slave.test918
-rw-r--r--mysql-test/extra/rpl_tests/rpl_failed_optimize.test17
-rw-r--r--mysql-test/extra/rpl_tests/rpl_flsh_tbls.test3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_foreign_key.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test48
-rw-r--r--mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test127
-rw-r--r--mysql-test/extra/rpl_tests/rpl_innodb.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_delayed.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_duplicate.test59
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_id.test39
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_id_pk.test25
-rw-r--r--mysql-test/extra/rpl_tests/rpl_insert_ignore.test77
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata.test71
-rw-r--r--mysql-test/extra/rpl_tests/rpl_log.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_max_relay_size.test4
-rw-r--r--mysql-test/extra/rpl_tests/rpl_multi_query.test6
-rw-r--r--mysql-test/extra/rpl_tests/rpl_multi_update.test7
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_not_null.test28
-rw-r--r--mysql-test/extra/rpl_tests/rpl_record_compare.test35
-rw-r--r--mysql-test/extra/rpl_tests/rpl_reset_slave.test12
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_UUID.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_basic.test60
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test5
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp002.test57
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp003.test18
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp007.test25
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_tabledefs.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_set_null.test16
-rw-r--r--mysql-test/extra/rpl_tests/rpl_show_binlog_events.inc17
-rw-r--r--mysql-test/extra/rpl_tests/rpl_show_log_events_with_varying_options.inc11
-rw-r--r--mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc127
-rw-r--r--mysql-test/extra/rpl_tests/rpl_start_stop_slave.test56
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_000001.test131
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test6
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stm_create_if_not_exists.test268
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stop_middle_group.test11
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stop_slave.test60
-rw-r--r--mysql-test/extra/rpl_tests/rpl_sv_relay_space.test12
-rw-r--r--mysql-test/extra/rpl_tests/rpl_test_framework.inc86
-rw-r--r--mysql-test/extra/rpl_tests/rpl_truncate.test7
-rw-r--r--mysql-test/extra/rpl_tests/rpl_truncate_helper.test8
-rw-r--r--mysql-test/extra/rpl_tests/type_conversions.test4
-rw-r--r--mysql-test/include/analyze-sync_with_master.test13
-rw-r--r--mysql-test/include/assert.inc175
-rw-r--r--mysql-test/include/begin_include_file.inc83
-rw-r--r--mysql-test/include/check-testcase.test78
-rw-r--r--mysql-test/include/check_concurrent_insert.inc4
-rw-r--r--mysql-test/include/check_ftwrl_compatible.inc158
-rw-r--r--mysql-test/include/check_ftwrl_incompatible.inc155
-rw-r--r--mysql-test/include/check_no_concurrent_insert.inc4
-rw-r--r--mysql-test/include/check_slave_is_running.inc30
-rw-r--r--mysql-test/include/check_slave_no_error.inc22
-rw-r--r--mysql-test/include/check_slave_param.inc28
-rw-r--r--mysql-test/include/circular_rpl_for_4_hosts_init.inc130
-rw-r--r--mysql-test/include/circular_rpl_for_4_hosts_sync.inc23
-rw-r--r--mysql-test/include/cleanup_fake_relay_log.inc23
-rw-r--r--mysql-test/include/commit.inc8
-rw-r--r--mysql-test/include/ctype_8bit.inc46
-rw-r--r--mysql-test/include/ctype_czech.inc12
-rw-r--r--mysql-test/include/ctype_like_ignorable.inc11
-rw-r--r--mysql-test/include/ctype_numconv.inc67
-rw-r--r--mysql-test/include/diff_master_slave.inc21
-rw-r--r--mysql-test/include/diff_tables.inc208
-rw-r--r--mysql-test/include/end_include_file.inc79
-rw-r--r--mysql-test/include/file_does_not_exist.inc17
-rw-r--r--mysql-test/include/force_restart.inc17
-rw-r--r--mysql-test/include/force_restart_if_skipped.inc17
-rw-r--r--mysql-test/include/get_relay_log_pos.inc4
-rw-r--r--mysql-test/include/gis_keys.inc16
-rw-r--r--mysql-test/include/handler.inc27
-rw-r--r--mysql-test/include/have_archive_plugin.inc1
-rw-r--r--mysql-test/include/have_blackhole_plugin.inc1
-rw-r--r--mysql-test/include/have_dbi_dbd-mysql.inc78
-rw-r--r--mysql-test/include/have_example_plugin.inc5
-rw-r--r--mysql-test/include/have_innodb.inc7
-rw-r--r--mysql-test/include/have_plugin_auth.inc5
-rw-r--r--mysql-test/include/have_plugin_interface.inc5
-rw-r--r--mysql-test/include/have_plugin_server.inc5
-rw-r--r--mysql-test/include/have_semisync_plugin.inc2
-rw-r--r--mysql-test/include/have_simple_parser.inc5
-rw-r--r--mysql-test/include/have_udf.inc6
-rw-r--r--mysql-test/include/index_merge2.inc112
-rw-r--r--mysql-test/include/io_thd_fault_injection.inc21
-rw-r--r--mysql-test/include/kill_query.inc4
-rw-r--r--mysql-test/include/kill_query_and_diff_master_slave.inc16
-rw-r--r--mysql-test/include/master-slave-end.inc6
-rw-r--r--mysql-test/include/master-slave-reset.inc75
-rw-r--r--mysql-test/include/master-slave.inc72
-rw-r--r--mysql-test/include/mix1.inc4
-rw-r--r--mysql-test/include/mtr_check.sql10
-rw-r--r--mysql-test/include/mtr_warnings.sql66
-rw-r--r--mysql-test/include/mysql_upgrade_preparation.inc2
-rw-r--r--mysql-test/include/mysqld--help.inc16
-rw-r--r--mysql-test/include/mysqldump.inc3
-rw-r--r--mysql-test/include/mysqlhotcopy.inc16
-rw-r--r--mysql-test/include/ndb_master-slave.inc10
-rw-r--r--mysql-test/include/ndb_master-slave_2ch.inc165
-rw-r--r--mysql-test/include/ndb_not_readonly.inc6
-rw-r--r--mysql-test/include/no_valgrind_without_big.inc9
-rw-r--r--mysql-test/include/not_crashrep.inc24
-rw-r--r--mysql-test/include/not_parallel.inc2
-rw-r--r--mysql-test/include/not_threadpool.inc5
-rw-r--r--mysql-test/include/plugin.defs41
-rw-r--r--mysql-test/include/report-features.test2
-rw-r--r--mysql-test/include/reset_master_and_slave.inc8
-rw-r--r--mysql-test/include/restart_mysqld.inc18
-rw-r--r--mysql-test/include/restart_slave_sql.inc43
-rw-r--r--mysql-test/include/rpl_change_topology.inc247
-rw-r--r--mysql-test/include/rpl_connect.inc58
-rw-r--r--mysql-test/include/rpl_connection.inc47
-rw-r--r--mysql-test/include/rpl_connection_master.inc2
-rw-r--r--mysql-test/include/rpl_connection_slave.inc2
-rw-r--r--mysql-test/include/rpl_connection_slave1.inc2
-rw-r--r--mysql-test/include/rpl_diff.inc118
-rw-r--r--mysql-test/include/rpl_diff_tables.inc35
-rw-r--r--mysql-test/include/rpl_end.inc103
-rw-r--r--mysql-test/include/rpl_for_each_slave.inc39
-rw-r--r--mysql-test/include/rpl_generate_sync_chain.inc122
-rw-r--r--mysql-test/include/rpl_init.inc242
-rw-r--r--mysql-test/include/rpl_reconnect.inc132
-rw-r--r--mysql-test/include/rpl_reset.inc81
-rw-r--r--mysql-test/include/rpl_restart_server.inc39
-rw-r--r--mysql-test/include/rpl_start_server.inc54
-rw-r--r--mysql-test/include/rpl_start_slaves.inc32
-rw-r--r--mysql-test/include/rpl_stop_server.inc63
-rw-r--r--mysql-test/include/rpl_stop_slaves.inc33
-rw-r--r--mysql-test/include/rpl_sync.inc153
-rw-r--r--mysql-test/include/save_master_pos.inc33
-rw-r--r--mysql-test/include/setup_fake_relay_log.inc71
-rw-r--r--mysql-test/include/show_events.inc4
-rw-r--r--mysql-test/include/show_rpl_debug_info.inc136
-rw-r--r--mysql-test/include/show_slave_status.inc84
-rw-r--r--mysql-test/include/start_slave.inc32
-rw-r--r--mysql-test/include/stop_slave.inc89
-rw-r--r--mysql-test/include/stop_slave_io.inc43
-rw-r--r--mysql-test/include/stop_slave_sql.inc41
-rw-r--r--mysql-test/include/sync_io_with_master.inc46
-rw-r--r--mysql-test/include/sync_slave_io_with_master.inc50
-rw-r--r--mysql-test/include/sync_slave_sql_with_io.inc50
-rw-r--r--mysql-test/include/truncate_file.inc2
-rw-r--r--mysql-test/include/wait_for_binlog_event.inc2
-rw-r--r--mysql-test/include/wait_for_query_to_fail.inc25
-rw-r--r--mysql-test/include/wait_for_slave_io_error.inc88
-rw-r--r--mysql-test/include/wait_for_slave_io_to_start.inc39
-rw-r--r--mysql-test/include/wait_for_slave_io_to_stop.inc50
-rw-r--r--mysql-test/include/wait_for_slave_param.inc121
-rw-r--r--mysql-test/include/wait_for_slave_sql_error.inc66
-rw-r--r--mysql-test/include/wait_for_slave_sql_error_and_skip.inc64
-rw-r--r--mysql-test/include/wait_for_slave_sql_to_start.inc30
-rw-r--r--mysql-test/include/wait_for_slave_sql_to_stop.inc50
-rw-r--r--mysql-test/include/wait_for_slave_to_start.inc30
-rw-r--r--mysql-test/include/wait_for_slave_to_stop.inc46
-rw-r--r--mysql-test/include/wait_for_status_var.inc23
-rw-r--r--mysql-test/include/wait_show_condition.inc35
-rw-r--r--mysql-test/include/write_var_to_file.inc57
-rw-r--r--mysql-test/lib/My/ConfigFactory.pm22
-rw-r--r--mysql-test/lib/My/CoreDump.pm9
-rw-r--r--mysql-test/lib/My/File/Path.pm15
-rw-r--r--mysql-test/lib/My/Find.pm6
-rw-r--r--mysql-test/lib/My/Options.pm2
-rw-r--r--mysql-test/lib/My/Platform.pm2
-rw-r--r--mysql-test/lib/My/SafeProcess.pm21
-rw-r--r--mysql-test/lib/My/SafeProcess/Base.pm2
-rw-r--r--mysql-test/lib/My/SafeProcess/Makefile.am25
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_kill_win.cc2
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process.cc11
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process.pl4
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process_win.cc6
-rw-r--r--mysql-test/lib/My/SysInfo.pm2
-rw-r--r--mysql-test/lib/My/Test.pm34
-rw-r--r--mysql-test/lib/mtr_cases.pm40
-rw-r--r--mysql-test/lib/mtr_gcov.pl25
-rw-r--r--mysql-test/lib/mtr_gprof.pl2
-rw-r--r--mysql-test/lib/mtr_io.pl2
-rw-r--r--mysql-test/lib/mtr_match.pm2
-rw-r--r--mysql-test/lib/mtr_misc.pl145
-rw-r--r--mysql-test/lib/mtr_process.pl12
-rw-r--r--mysql-test/lib/mtr_report.pm39
-rw-r--r--mysql-test/lib/mtr_results.pm167
-rw-r--r--mysql-test/lib/mtr_stress.pl2
-rw-r--r--mysql-test/lib/mtr_unique.pm2
-rwxr-xr-xmysql-test/mysql-stress-test.pl17
-rwxr-xr-xmysql-test/mysql-test-run.pl869
-rw-r--r--mysql-test/purify.supp17
-rw-r--r--mysql-test/r/1st.result1
-rw-r--r--mysql-test/r/alter_table.result21
-rw-r--r--mysql-test/r/archive.result22
-rw-r--r--mysql-test/r/archive_debug.result12
-rw-r--r--mysql-test/r/archive_plugin.result3
-rw-r--r--mysql-test/r/auto_increment.result40
-rw-r--r--mysql-test/r/blackhole_plugin.result3
-rw-r--r--mysql-test/r/bootstrap.result12
-rw-r--r--mysql-test/r/bug58669.result17
-rw-r--r--mysql-test/r/cache_innodb.result11
-rw-r--r--mysql-test/r/cast.result17
-rw-r--r--mysql-test/r/check.result16
-rw-r--r--mysql-test/r/client_xml.result6
-rw-r--r--mysql-test/r/commit_1innodb.result8
-rw-r--r--mysql-test/r/connect.result3
-rw-r--r--mysql-test/r/csv_not_null.result3
-rw-r--r--mysql-test/r/ctype_binary.result91
-rw-r--r--mysql-test/r/ctype_cp1250_ch.result3
-rw-r--r--mysql-test/r/ctype_cp1251.result416
-rw-r--r--mysql-test/r/ctype_eucjpms.result2
-rw-r--r--mysql-test/r/ctype_latin1.result115
-rw-r--r--mysql-test/r/ctype_like_range.result2310
-rw-r--r--mysql-test/r/ctype_many.result37
-rw-r--r--mysql-test/r/ctype_sjis.result6
-rw-r--r--mysql-test/r/ctype_uca.result98
-rw-r--r--mysql-test/r/ctype_ucs.result109
-rw-r--r--mysql-test/r/ctype_ujis.result10
-rw-r--r--mysql-test/r/ctype_utf16.result27
-rw-r--r--mysql-test/r/ctype_utf16_uca.result46
-rw-r--r--mysql-test/r/ctype_utf32.result15
-rw-r--r--mysql-test/r/ctype_utf32_uca.result46
-rw-r--r--mysql-test/r/ctype_utf8.result162
-rw-r--r--mysql-test/r/ctype_utf8mb4_ndb.result1876
-rw-r--r--mysql-test/r/date_formats.result14
-rw-r--r--mysql-test/r/ddl_i18n_koi8r.result48
-rw-r--r--mysql-test/r/ddl_i18n_utf8.result48
-rw-r--r--mysql-test/r/delayed.result40
-rw-r--r--mysql-test/r/delete.result15
-rw-r--r--mysql-test/r/derived.result26
-rw-r--r--mysql-test/r/distinct.result11
-rw-r--r--mysql-test/r/errors.result12
-rw-r--r--mysql-test/r/events_1.result106
-rw-r--r--mysql-test/r/events_2.result46
-rw-r--r--mysql-test/r/events_bugs.result66
-rw-r--r--mysql-test/r/events_restart.result3
-rw-r--r--mysql-test/r/explain.result61
-rw-r--r--mysql-test/r/file_contents.result6
-rw-r--r--mysql-test/r/filesort_debug.result33
-rw-r--r--mysql-test/r/flush.result93
-rw-r--r--mysql-test/r/flush_read_lock.result1684
-rw-r--r--mysql-test/r/flush_read_lock_kill.result36
-rw-r--r--mysql-test/r/fulltext.result36
-rw-r--r--mysql-test/r/func_analyse.result26
-rw-r--r--mysql-test/r/func_encrypt_ucs2.result19
-rw-r--r--mysql-test/r/func_gconcat.result19
-rw-r--r--mysql-test/r/func_group.result58
-rw-r--r--mysql-test/r/func_group_innodb.result47
-rw-r--r--mysql-test/r/func_in.result6
-rw-r--r--mysql-test/r/func_like.result5
-rw-r--r--mysql-test/r/func_math.result99
-rw-r--r--mysql-test/r/func_misc.result44
-rw-r--r--mysql-test/r/func_set.result42
-rw-r--r--mysql-test/r/func_str.result28
-rw-r--r--mysql-test/r/func_time.result125
-rw-r--r--mysql-test/r/gis-rtree.result27
-rw-r--r--mysql-test/r/gis.result36
-rw-r--r--mysql-test/r/grant.result420
-rw-r--r--mysql-test/r/grant2.result4
-rw-r--r--mysql-test/r/grant3.result25
-rw-r--r--mysql-test/r/grant_cache_no_prot.result2
-rw-r--r--mysql-test/r/grant_cache_ps_prot.result2
-rw-r--r--mysql-test/r/group_by.result46
-rw-r--r--mysql-test/r/handler_innodb.result21
-rw-r--r--mysql-test/r/handler_myisam.result21
-rw-r--r--mysql-test/r/having.result22
-rw-r--r--mysql-test/r/implicit_char_to_num_conversion.result366
-rw-r--r--mysql-test/r/index_merge_myisam.result55
-rw-r--r--mysql-test/r/information_schema-big.result4
-rw-r--r--mysql-test/r/information_schema.result46
-rw-r--r--mysql-test/r/init_file.result1
-rw-r--r--mysql-test/r/innodb_mysql_lock.result24
-rw-r--r--mysql-test/r/innodb_mysql_sync.result120
-rw-r--r--mysql-test/r/insert_select.result2
-rw-r--r--mysql-test/r/ipv4_as_ipv6.result30
-rw-r--r--mysql-test/r/join_outer.result241
-rw-r--r--mysql-test/r/join_outer_innodb.result35
-rw-r--r--mysql-test/r/keywords.result224
-rw-r--r--mysql-test/r/kill.result274
-rw-r--r--mysql-test/r/loaddata.result16
-rw-r--r--mysql-test/r/lock_multi.result2
-rw-r--r--mysql-test/r/lock_sync.result69
-rw-r--r--mysql-test/r/log_tables.result10
-rw-r--r--mysql-test/r/log_tables_upgrade.result1
-rw-r--r--mysql-test/r/lowercase_fs_off.result8
-rw-r--r--mysql-test/r/lowercase_table2.result29
-rwxr-xr-xmysql-test/r/lowercase_table4.result115
-rw-r--r--mysql-test/r/mdl_sync.result61
-rw-r--r--mysql-test/r/merge.result104
-rw-r--r--mysql-test/r/metadata.result2
-rw-r--r--mysql-test/r/multi_update.result66
-rw-r--r--mysql-test/r/multi_update_innodb.result69
-rw-r--r--mysql-test/r/myisampack.result10
-rw-r--r--mysql-test/r/mysql.result69
-rw-r--r--mysql-test/r/mysql_embedded.result5
-rw-r--r--mysql-test/r/mysql_upgrade.result6
-rw-r--r--mysql-test/r/mysql_upgrade_ssl.result1
-rw-r--r--mysql-test/r/mysqladmin.result15
-rw-r--r--mysql-test/r/mysqlbinlog.result36
-rw-r--r--mysql-test/r/mysqlbinlog_base64.result10
-rw-r--r--mysql-test/r/mysqlbinlog_row_big.result8
-rw-r--r--mysql-test/r/mysqlcheck.result144
-rw-r--r--mysql-test/r/mysqld--defaults-file.result12
-rw-r--r--mysql-test/r/mysqld--help-notwin.result29
-rw-r--r--mysql-test/r/mysqld--help-win.result29
-rw-r--r--mysql-test/r/mysqldump.result106
-rw-r--r--mysql-test/r/mysqldump_restore.result10
-rw-r--r--mysql-test/r/mysqlslap.result22
-rw-r--r--mysql-test/r/mysqltest.result101
-rw-r--r--mysql-test/r/not_embedded_server.result45
-rw-r--r--mysql-test/r/openssl_1.result14
-rw-r--r--mysql-test/r/order_by.result29
-rw-r--r--mysql-test/r/packet.result1
-rw-r--r--mysql-test/r/partition.result172
-rw-r--r--mysql-test/r/partition_binlog.result49
-rw-r--r--mysql-test/r/partition_datatype.result1000
-rw-r--r--mysql-test/r/partition_debug_sync.result10
-rw-r--r--mysql-test/r/partition_error.result800
-rw-r--r--mysql-test/r/partition_innodb.result58
-rw-r--r--mysql-test/r/partition_innodb_plugin.result73
-rw-r--r--mysql-test/r/partition_myisam.result250
-rw-r--r--mysql-test/r/partition_not_embedded.result81
-rw-r--r--mysql-test/r/partition_range.result8
-rw-r--r--mysql-test/r/partition_symlink.result10
-rw-r--r--mysql-test/r/plugin_auth.result450
-rw-r--r--mysql-test/r/plugin_auth_qa.result327
-rw-r--r--mysql-test/r/plugin_auth_qa_1.result335
-rw-r--r--mysql-test/r/plugin_auth_qa_2.result150
-rw-r--r--mysql-test/r/plugin_auth_qa_3.result11
-rw-r--r--mysql-test/r/plugin_load_option.result7
-rw-r--r--mysql-test/r/plugin_not_embedded.result2
-rw-r--r--mysql-test/r/ps.result521
-rw-r--r--mysql-test/r/query_cache_28249.result6
-rw-r--r--mysql-test/r/query_cache_debug.result85
-rw-r--r--mysql-test/r/range.result101
-rw-r--r--mysql-test/r/rpl_mysqldump_slave.result9
-rw-r--r--mysql-test/r/select.result83
-rw-r--r--mysql-test/r/shm.result2
-rw-r--r--mysql-test/r/show_check.result38
-rw-r--r--mysql-test/r/signal.result7
-rw-r--r--mysql-test/r/signal_code.result16
-rw-r--r--mysql-test/r/sp-bugs.result36
-rw-r--r--mysql-test/r/sp-code.result4
-rw-r--r--mysql-test/r/sp-destruct.result19
-rw-r--r--mysql-test/r/sp-error.result91
-rw-r--r--mysql-test/r/sp-lock.result91
-rw-r--r--mysql-test/r/sp-security.result29
-rw-r--r--mysql-test/r/sp.result48
-rw-r--r--mysql-test/r/sp_notembedded.result27
-rw-r--r--mysql-test/r/sp_trans.result17
-rw-r--r--mysql-test/r/ssl_and_innodb.result8
-rw-r--r--mysql-test/r/ssl_cipher.result9
-rw-r--r--mysql-test/r/status.result6
-rw-r--r--mysql-test/r/status_bug17954.result13
-rw-r--r--mysql-test/r/subselect.result82
-rw-r--r--mysql-test/r/subselect4.result11
-rw-r--r--mysql-test/r/subselect_innodb.result9
-rw-r--r--mysql-test/r/symlink.result40
-rw-r--r--mysql-test/r/system_mysql_db.result5
-rw-r--r--mysql-test/r/tablespace.result112
-rw-r--r--mysql-test/r/trigger-compat.result95
-rw-r--r--mysql-test/r/trigger-trans.result5
-rw-r--r--mysql-test/r/trigger.result46
-rw-r--r--mysql-test/r/truncate_coverage.result27
-rw-r--r--mysql-test/r/type_blob.result10
-rw-r--r--mysql-test/r/type_date.result20
-rw-r--r--mysql-test/r/type_datetime.result69
-rw-r--r--mysql-test/r/type_newdecimal.result13
-rw-r--r--mysql-test/r/type_ranges.result2
-rw-r--r--mysql-test/r/type_timestamp.result92
-rw-r--r--mysql-test/r/type_year.result14
-rw-r--r--mysql-test/r/union.result125
-rw-r--r--mysql-test/r/user_var.result9
-rw-r--r--mysql-test/r/variables-big.result12
-rw-r--r--mysql-test/r/variables-notembedded.result24
-rw-r--r--mysql-test/r/variables.result77
-rw-r--r--mysql-test/r/variables_debug.result44
-rw-r--r--mysql-test/r/view.result24
-rw-r--r--mysql-test/r/view_grant.result126
-rw-r--r--mysql-test/r/warnings.result22
-rw-r--r--mysql-test/r/xa.result98
-rw-r--r--mysql-test/r/xml.result52
-rw-r--r--mysql-test/std_data/bug47205.frmbin0 -> 8554 bytes
-rw-r--r--mysql-test/std_data/bug57108.cnf95
-rw-r--r--mysql-test/std_data/checkDBI_DBD-mysql.pl97
-rw-r--r--mysql-test/std_data/cluster_7022_table.MYD (renamed from mysql-test/collections/test-bt-debug-fast)0
-rw-r--r--mysql-test/std_data/cluster_7022_table.MYIbin0 -> 1024 bytes
-rw-r--r--mysql-test/std_data/cluster_7022_table.frmbin0 -> 8794 bytes
-rw-r--r--mysql-test/std_data/parts/t1TIMESTAMP.frmbin0 -> 8554 bytes
-rw-r--r--mysql-test/suite/binlog/r/binlog_base64_flag.result3
-rw-r--r--mysql-test/suite/binlog/r/binlog_bug23533.result15
-rw-r--r--mysql-test/suite/binlog/r/binlog_bug36391.result10
-rw-r--r--mysql-test/suite/binlog/r/binlog_database.result66
-rw-r--r--mysql-test/suite/binlog/r/binlog_drop_if_exists.result (renamed from mysql-test/suite/rpl/r/rpl_drop_if_exists.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_index.result36
-rw-r--r--mysql-test/suite/binlog/r/binlog_innodb.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_innodb_row.result17
-rw-r--r--mysql-test/suite/binlog/r/binlog_max_extension.result3
-rw-r--r--mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result25
-rw-r--r--mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result66
-rw-r--r--mysql-test/suite/binlog/r/binlog_old_versions.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_query_filter_rules.result (renamed from mysql-test/suite/rpl/r/rpl_binlog_query_filter_rules.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_reset_master.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_binlog.result64
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_cache_stat.result66
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_innodb_stat.result25
-rw-r--r--mysql-test/suite/binlog/r/binlog_server_id.result (renamed from mysql-test/suite/rpl/r/rpl_server_id.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_sf.result (renamed from mysql-test/suite/rpl/r/rpl_sf.result)0
-rw-r--r--mysql-test/suite/binlog/r/binlog_sql_mode.result8
-rw-r--r--mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result10
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_binlog.result64
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_cache_stat.result66
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result25
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_unsafe.result2
-rw-r--r--mysql-test/suite/binlog/t/binlog_base64_flag.test3
-rw-r--r--mysql-test/suite/binlog/t/binlog_bug23533.test50
-rw-r--r--mysql-test/suite/binlog/t/binlog_bug36391-master.opt (renamed from mysql-test/suite/bugs/t/rpl_bug36391-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_bug36391.test30
-rw-r--r--mysql-test/suite/binlog/t/binlog_drop_if_exists.test (renamed from mysql-test/suite/rpl/t/rpl_drop_if_exists.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_index-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_index.test30
-rw-r--r--mysql-test/suite/binlog/t/binlog_innodb_row.test26
-rw-r--r--mysql-test/suite/binlog/t/binlog_max_extension.test19
-rw-r--r--mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test5
-rw-r--r--mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test5
-rw-r--r--mysql-test/suite/binlog/t/binlog_old_versions.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_query_filter_rules-master.opt (renamed from mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules-master.opt)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_query_filter_rules.test (renamed from mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_reset_master.test26
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_cache_stat.test5
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_innodb_stat.test5
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test6
-rw-r--r--mysql-test/suite/binlog/t/binlog_server_id.test (renamed from mysql-test/suite/rpl/t/rpl_server_id.test)0
-rw-r--r--mysql-test/suite/binlog/t/binlog_sf.test191
-rw-r--r--mysql-test/suite/binlog/t/binlog_sql_mode.test5
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_cache_stat.test5
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test5
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_unsafe.test34
-rw-r--r--mysql-test/suite/binlog/t/disabled.def5
-rw-r--r--mysql-test/suite/bugs/combinations8
-rw-r--r--mysql-test/suite/bugs/data/rpl_bug12691.dat3
-rw-r--r--mysql-test/suite/bugs/r/rpl_bug12691.result33
-rw-r--r--mysql-test/suite/bugs/r/rpl_bug23533.result23
-rw-r--r--mysql-test/suite/bugs/r/rpl_bug31582.result16
-rw-r--r--mysql-test/suite/bugs/r/rpl_bug31583.result16
-rw-r--r--mysql-test/suite/bugs/r/rpl_bug33029.result15
-rw-r--r--mysql-test/suite/bugs/r/rpl_bug36391.result18
-rw-r--r--mysql-test/suite/bugs/r/rpl_bug37426.result17
-rw-r--r--mysql-test/suite/bugs/r/rpl_bug38205.result56
-rw-r--r--mysql-test/suite/bugs/t/rpl_bug12691.test51
-rw-r--r--mysql-test/suite/bugs/t/rpl_bug23533.test43
-rw-r--r--mysql-test/suite/bugs/t/rpl_bug31582.test25
-rw-r--r--mysql-test/suite/bugs/t/rpl_bug31583.test25
-rw-r--r--mysql-test/suite/bugs/t/rpl_bug33029.test25
-rw-r--r--mysql-test/suite/bugs/t/rpl_bug36391.test30
-rw-r--r--mysql-test/suite/bugs/t/rpl_bug37426.test22
-rw-r--r--mysql-test/suite/bugs/t/rpl_bug38205.test166
-rw-r--r--mysql-test/suite/engines/funcs/r/in_multicolumn_string_pk_constraint_error.result6
-rw-r--r--mysql-test/suite/engines/funcs/r/in_multicolumn_string_pk_constraint_ignore.result6
-rw-r--r--mysql-test/suite/engines/funcs/r/in_multicolumn_string_unique_constraint_error.result6
-rw-r--r--mysql-test/suite/engines/funcs/r/in_string_pk_constraint_error.resultbin973 -> 1061 bytes
-rw-r--r--mysql-test/suite/engines/funcs/r/in_string_unique_constraint_error.resultbin922 -> 1005 bytes
-rw-r--r--mysql-test/suite/engines/funcs/r/ps_string_not_null.resultbin11681 -> 11681 bytes
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_000015.result151
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_change_master.result6
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result43
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result2
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_log_pos.result28
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result55
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_row_drop.result11
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result42
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result9
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_row_sp005.result2
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_row_trig003.result6
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_row_until.result196
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_server_id1.result4
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_server_id2.result3
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_slave_status.result41
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result4
-rw-r--r--mysql-test/suite/engines/funcs/r/sf_alter.result540
-rw-r--r--mysql-test/suite/engines/funcs/r/sf_cursor.result9
-rw-r--r--mysql-test/suite/engines/funcs/r/sp_alter.result120
-rw-r--r--mysql-test/suite/engines/funcs/r/sp_cursor.result2
-rw-r--r--mysql-test/suite/engines/funcs/t/disabled.def103
-rw-r--r--mysql-test/suite/engines/funcs/t/in_multicolumn_string_pk_constraint_error.test15
-rw-r--r--mysql-test/suite/engines/funcs/t/in_multicolumn_string_pk_constraint_ignore.test15
-rw-r--r--mysql-test/suite/engines/funcs/t/in_multicolumn_string_unique_constraint_error.test15
-rw-r--r--mysql-test/suite/engines/funcs/t/in_string_pk_constraint_error.test7
-rw-r--r--mysql-test/suite/engines/funcs/t/in_string_unique_constraint_error.test7
-rw-r--r--mysql-test/suite/engines/funcs/t/ps_string_not_null.test2
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl000013.test8
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_000015.test26
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_change_master.test25
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test2
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test7
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_get_lock.test2
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test4
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_loadfile.test2
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_log_pos.test47
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_misc_functions.test2
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test16
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_row_drop.test5
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test10
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_row_until.test49
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_server_id1.test9
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_server_id2.test3
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_slave_status.test12
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test8
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_temp_table.test10
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_temporary.test22
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_trigger.test2
-rw-r--r--mysql-test/suite/engines/iuds/r/insert_year.result4
-rw-r--r--mysql-test/suite/engines/iuds/r/update_delete_calendar.result3
-rw-r--r--mysql-test/suite/engines/iuds/r/update_delete_number.result10
-rw-r--r--mysql-test/suite/engines/iuds/t/disabled.def1
-rw-r--r--mysql-test/suite/engines/iuds/t/insert_number.test3
-rw-r--r--mysql-test/suite/engines/iuds/t/update_delete_calendar.test5
-rw-r--r--mysql-test/suite/federated/disabled.def1
-rw-r--r--mysql-test/suite/federated/federated_bug_25714.test2
-rw-r--r--mysql-test/suite/federated/federated_bug_35333.result67
-rw-r--r--mysql-test/suite/federated/federated_bug_35333.test74
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_06.result6
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03e.result1
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_08.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_cml_ndb.result98
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is_embedded.result339
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql.result20
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result30
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_ndb.result228
-rw-r--r--mysql-test/suite/funcs_1/r/is_engines_ndb.result8
-rw-r--r--mysql-test/suite/funcs_1/r/is_key_column_usage.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics_mysql.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result206
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints.result1
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result1
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql.result23
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result46
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_ndb.result167
-rw-r--r--mysql-test/suite/funcs_1/r/is_user_privileges.result1655
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_06.result6
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03e.result1
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_08.result4
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_06.result6
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03e.result1
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_08.result4
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_views-big.result (renamed from mysql-test/suite/funcs_1/r/myisam_views.result)0
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_bitdata.result3
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_cursors.result3
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_func_view.result5294
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_02.result1398
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_03.result496
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_06.result395
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_07.result178
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_08.result835
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_storedproc_10.result400
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_0102.result366
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_03.result675
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_03e.result1620
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_0407.result470
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_08.result527
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_09.result269
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result394
-rw-r--r--mysql-test/suite/funcs_1/r/ndb_views.result22914
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result1
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_ps.result1
-rw-r--r--mysql-test/suite/funcs_1/storedproc/storedproc_06.inc14
-rw-r--r--mysql-test/suite/funcs_1/t/disabled.def1
-rw-r--r--mysql-test/suite/funcs_1/t/is_cml_ndb.test42
-rw-r--r--mysql-test/suite/funcs_1/t/is_columns_ndb.test37
-rw-r--r--mysql-test/suite/funcs_1/t/is_engines_ndb.test15
-rw-r--r--mysql-test/suite/funcs_1/t/is_tables_ndb.test22
-rw-r--r--mysql-test/suite/funcs_1/t/is_user_privileges.test40
-rw-r--r--mysql-test/suite/funcs_1/t/myisam_views-big.test34
-rw-r--r--mysql-test/suite/funcs_1/t/myisam_views.test31
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_bitdata.test18
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_cursors.test19
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_func_view.test16
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_storedproc_02.test9
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_storedproc_03.test9
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_storedproc_06.test9
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_storedproc_07.test9
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_storedproc_08.test9
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_storedproc_10.test9
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_trig_0102.test10
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_trig_03.test10
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_trig_03e.test25
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_trig_0407.test10
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_trig_08.test10
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_trig_09.test10
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_trig_1011ext.test10
-rw-r--r--mysql-test/suite/funcs_1/t/ndb_views.test24
-rw-r--r--mysql-test/suite/funcs_2/r/ndb_charset.result119156
-rw-r--r--mysql-test/suite/funcs_2/t/disabled.def3
-rw-r--r--mysql-test/suite/funcs_2/t/ndb_charset.test14
-rw-r--r--mysql-test/suite/ibmdb2i/include/have_i54.inc20
-rw-r--r--mysql-test/suite/ibmdb2i/include/have_i61.inc20
-rw-r--r--mysql-test/suite/ibmdb2i/include/have_ibmdb2i.inc6
-rw-r--r--mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44020.result11
-rw-r--r--mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44025.result4
-rw-r--r--mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44232.result4
-rw-r--r--mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44610.result18
-rw-r--r--mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45196.result33
-rw-r--r--mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45793.result7
-rw-r--r--mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45983.result20
-rw-r--r--mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_49329.result9
-rw-r--r--mysql-test/suite/ibmdb2i/r/ibmdb2i_collations.result1204
-rw-r--r--mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44020.test9
-rw-r--r--mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44025.test9
-rw-r--r--mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44232.test8
-rw-r--r--mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test28
-rw-r--r--mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45196.test26
-rw-r--r--mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45793.test11
-rw-r--r--mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45983.test47
-rw-r--r--mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_49329.test10
-rw-r--r--mysql-test/suite/ibmdb2i/t/ibmdb2i_collations.test44
-rw-r--r--mysql-test/suite/innodb/r/innodb-autoinc-18274.result26
-rw-r--r--mysql-test/suite/innodb/r/innodb-autoinc-56228.result30
-rw-r--r--mysql-test/suite/innodb/r/innodb-autoinc.result18
-rw-r--r--mysql-test/suite/innodb/r/innodb-create-options.result854
-rw-r--r--mysql-test/suite/innodb/r/innodb-index.result98
-rw-r--r--mysql-test/suite/innodb/r/innodb-system-table-view.result110
-rw-r--r--mysql-test/suite/innodb/r/innodb-timeout.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb-truncate.result68
-rw-r--r--mysql-test/suite/innodb/r/innodb-zip.result24
-rw-r--r--mysql-test/suite/innodb/r/innodb.result20
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug30423.result95
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug52745.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug53046.result27
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug53591.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug53756.result118
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug54679.result88
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug56143.result556
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug56680.result109
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug56716.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug56947.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug57252.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug57904.result41
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug59307.result28
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug59410.result17
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug59641.result57
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug60049.result8
-rwxr-xr-xmysql-test/suite/innodb/r/innodb_bug60196.result117
-rw-r--r--mysql-test/suite/innodb/r/innodb_file_format.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb_gis.result12
-rw-r--r--mysql-test/suite/innodb/r/innodb_index_large_prefix.result185
-rw-r--r--mysql-test/suite/innodb/r/innodb_multi_update.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb_mysql.result92
-rw-r--r--mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result1354
-rw-r--r--mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result91
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc-18274.test26
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc-56228-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc-56228.test33
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc.test49
-rw-r--r--mysql-test/suite/innodb/t/innodb-create-options.test575
-rw-r--r--mysql-test/suite/innodb/t/innodb-index.test50
-rw-r--r--mysql-test/suite/innodb/t/innodb-system-table-view-master.opt3
-rw-r--r--mysql-test/suite/innodb/t/innodb-system-table-view.test93
-rw-r--r--mysql-test/suite/innodb/t/innodb-timeout.test69
-rw-r--r--mysql-test/suite/innodb/t/innodb-truncate.test65
-rw-r--r--mysql-test/suite/innodb/t/innodb-zip.test8
-rw-r--r--mysql-test/suite/innodb/t/innodb.test25
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug30423.test211
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug42419.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53046.test48
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53756-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53756.test187
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug54679.test100
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug56143.test586
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug56680.test142
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug56716.test9
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug56947.test16
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug57252.test46
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug57255.test2
-rwxr-xr-xmysql-test/suite/innodb/t/innodb_bug57904.test27
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug59307.test32
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug59410.test24
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug59641.test68
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug60049-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug60049.test39
-rwxr-xr-xmysql-test/suite/innodb/t/innodb_bug60196-master.opt1
-rwxr-xr-xmysql-test/suite/innodb/t/innodb_bug60196.test157
-rw-r--r--mysql-test/suite/innodb/t/innodb_index_large_prefix.test271
-rw-r--r--mysql-test/suite/innodb/t/innodb_information_schema.test28
-rw-r--r--mysql-test/suite/innodb/t/innodb_multi_update.test9
-rw-r--r--mysql-test/suite/innodb/t/innodb_mysql.test100
-rw-r--r--mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test1339
-rw-r--r--mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test127
-rw-r--r--mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result15
-rw-r--r--mysql-test/suite/large_tests/t/lock_tables_big.test14
-rw-r--r--mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test18
-rw-r--r--mysql-test/suite/manual/t/rpl_replication_delay.test12
-rw-r--r--mysql-test/suite/ndb/my.cnf22
-rw-r--r--mysql-test/suite/ndb/r/loaddata_autocom_ndb.result23
-rw-r--r--mysql-test/suite/ndb/r/ndb_alter_table.result437
-rw-r--r--mysql-test/suite/ndb/r/ndb_alter_table2.result41
-rw-r--r--mysql-test/suite/ndb/r/ndb_alter_table3.result35
-rw-r--r--mysql-test/suite/ndb/r/ndb_auto_increment.result445
-rw-r--r--mysql-test/suite/ndb/r/ndb_autoinc.result37
-rw-r--r--mysql-test/suite/ndb/r/ndb_basic.result930
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_basic.result48
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result196
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_discover.result17
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_format.result41
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result11
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_log_bin.result80
-rw-r--r--mysql-test/suite/ndb/r/ndb_binlog_multi.result80
-rw-r--r--mysql-test/suite/ndb/r/ndb_bitfield.result224
-rw-r--r--mysql-test/suite/ndb/r/ndb_blob.result591
-rw-r--r--mysql-test/suite/ndb/r/ndb_blob_partition.result104
-rw-r--r--mysql-test/suite/ndb/r/ndb_bug26793.result8
-rw-r--r--mysql-test/suite/ndb/r/ndb_bug31477.result98
-rw-r--r--mysql-test/suite/ndb/r/ndb_cache.result191
-rw-r--r--mysql-test/suite/ndb/r/ndb_cache2.result623
-rw-r--r--mysql-test/suite/ndb/r/ndb_cache_multi.result74
-rw-r--r--mysql-test/suite/ndb/r/ndb_cache_multi2.result75
-rw-r--r--mysql-test/suite/ndb/r/ndb_charset.result320
-rw-r--r--mysql-test/suite/ndb/r/ndb_condition_pushdown.result1920
-rw-r--r--mysql-test/suite/ndb/r/ndb_config.result14
-rw-r--r--mysql-test/suite/ndb/r/ndb_config2.result1
-rw-r--r--mysql-test/suite/ndb/r/ndb_cursor.result42
-rw-r--r--mysql-test/suite/ndb/r/ndb_database.result13
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_alter.result560
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_basic.result535
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_ddl.result315
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_disk2memory.result505
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_dump.result452
-rw-r--r--mysql-test/suite/ndb/r/ndb_dd_sql_features.result599
-rw-r--r--mysql-test/suite/ndb/r/ndb_gis.result1100
-rw-r--r--mysql-test/suite/ndb/r/ndb_grant.result444
-rw-r--r--mysql-test/suite/ndb/r/ndb_index.result154
-rw-r--r--mysql-test/suite/ndb/r/ndb_index_ordered.result839
-rw-r--r--mysql-test/suite/ndb/r/ndb_index_unique.result692
-rw-r--r--mysql-test/suite/ndb/r/ndb_insert.result659
-rw-r--r--mysql-test/suite/ndb/r/ndb_limit.result72
-rw-r--r--mysql-test/suite/ndb/r/ndb_load.result80
-rw-r--r--mysql-test/suite/ndb/r/ndb_loaddatalocal.result46
-rw-r--r--mysql-test/suite/ndb/r/ndb_lock.result200
-rw-r--r--mysql-test/suite/ndb/r/ndb_lock_table.result11
-rw-r--r--mysql-test/suite/ndb/r/ndb_minmax.result120
-rw-r--r--mysql-test/suite/ndb/r/ndb_multi.result145
-rw-r--r--mysql-test/suite/ndb/r/ndb_multi_row.result68
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_error.result47
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_error2.result3
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_key.result312
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_list.result51
-rw-r--r--mysql-test/suite/ndb/r/ndb_partition_range.result275
-rw-r--r--mysql-test/suite/ndb/r/ndb_read_multi_range.result494
-rw-r--r--mysql-test/suite/ndb/r/ndb_rename.result24
-rw-r--r--mysql-test/suite/ndb/r/ndb_replace.result99
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore.result501
-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.result460
-rw-r--r--mysql-test/suite/ndb/r/ndb_restore_print.result312
-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.result92
-rw-r--r--mysql-test/suite/ndb/r/ndb_temporary.result21
-rw-r--r--mysql-test/suite/ndb/r/ndb_tmp_table_and_DDL.result90
-rw-r--r--mysql-test/suite/ndb/r/ndb_transaction.result257
-rw-r--r--mysql-test/suite/ndb/r/ndb_trigger.result315
-rw-r--r--mysql-test/suite/ndb/r/ndb_truncate.result23
-rw-r--r--mysql-test/suite/ndb/r/ndb_types.result76
-rw-r--r--mysql-test/suite/ndb/r/ndb_update.result96
-rw-r--r--mysql-test/suite/ndb/r/ndb_update_no_read.result75
-rw-r--r--mysql-test/suite/ndb/r/ndb_view.result24
-rw-r--r--mysql-test/suite/ndb/r/ndbapi.result22
-rw-r--r--mysql-test/suite/ndb/r/ps_7ndb.result3122
-rw-r--r--mysql-test/suite/ndb/r/strict_autoinc_5ndb.result28
-rw-r--r--mysql-test/suite/ndb/t/disabled.def18
-rw-r--r--mysql-test/suite/ndb/t/loaddata_autocom_ndb.test4
-rw-r--r--mysql-test/suite/ndb/t/ndb_alter_table.test458
-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_auto_increment.test293
-rw-r--r--mysql-test/suite/ndb/t/ndb_autoinc.test45
-rw-r--r--mysql-test/suite/ndb/t/ndb_basic.test861
-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.test35
-rw-r--r--mysql-test/suite/ndb/t/ndb_binlog_ignore_db-master.opt1
-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.test124
-rw-r--r--mysql-test/suite/ndb/t/ndb_blob.test519
-rw-r--r--mysql-test/suite/ndb/t/ndb_blob_partition.test97
-rw-r--r--mysql-test/suite/ndb/t/ndb_bug26793.test35
-rw-r--r--mysql-test/suite/ndb/t/ndb_bug31477.test109
-rw-r--r--mysql-test/suite/ndb/t/ndb_cache.test122
-rw-r--r--mysql-test/suite/ndb/t/ndb_cache2.test361
-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.test2054
-rw-r--r--mysql-test/suite/ndb/t/ndb_config.test23
-rw-r--r--mysql-test/suite/ndb/t/ndb_config2.test7
-rw-r--r--mysql-test/suite/ndb/t/ndb_cursor.test47
-rw-r--r--mysql-test/suite/ndb/t/ndb_database.test24
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_alter.test274
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_basic.test485
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_ddl.test470
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_disk2memory.test292
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_dump.test289
-rw-r--r--mysql-test/suite/ndb/t/ndb_dd_sql_features.test551
-rw-r--r--mysql-test/suite/ndb/t/ndb_gis.test5
-rw-r--r--mysql-test/suite/ndb/t/ndb_grant.later385
-rw-r--r--mysql-test/suite/ndb/t/ndb_index.test131
-rw-r--r--mysql-test/suite/ndb/t/ndb_index_ordered.test488
-rw-r--r--mysql-test/suite/ndb/t/ndb_index_unique.test361
-rw-r--r--mysql-test/suite/ndb/t/ndb_insert.test641
-rw-r--r--mysql-test/suite/ndb/t/ndb_limit.test85
-rw-r--r--mysql-test/suite/ndb/t/ndb_load.test24
-rw-r--r--mysql-test/suite/ndb/t/ndb_loaddatalocal.test71
-rw-r--r--mysql-test/suite/ndb/t/ndb_lock.test269
-rw-r--r--mysql-test/suite/ndb/t/ndb_lock_table.test15
-rw-r--r--mysql-test/suite/ndb/t/ndb_minmax.test65
-rw-r--r--mysql-test/suite/ndb/t/ndb_multi.test154
-rw-r--r--mysql-test/suite/ndb/t/ndb_multi_row.test76
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_error.test74
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_error2-master.opt1
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_error2.test14
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_key.test244
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_list.test68
-rw-r--r--mysql-test/suite/ndb/t/ndb_partition_range.test269
-rw-r--r--mysql-test/suite/ndb/t/ndb_read_multi_range.test340
-rw-r--r--mysql-test/suite/ndb/t/ndb_rename.test36
-rw-r--r--mysql-test/suite/ndb/t/ndb_replace.test104
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore.test413
-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.opt1
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore_partition.test375
-rw-r--r--mysql-test/suite/ndb/t/ndb_restore_print.test193
-rw-r--r--mysql-test/suite/ndb/t/ndb_row_format.test86
-rw-r--r--mysql-test/suite/ndb/t/ndb_single_user.test174
-rw-r--r--mysql-test/suite/ndb/t/ndb_sp.test42
-rw-r--r--mysql-test/suite/ndb/t/ndb_subquery.test79
-rw-r--r--mysql-test/suite/ndb/t/ndb_temporary.test38
-rw-r--r--mysql-test/suite/ndb/t/ndb_tmp_table_and_DDL.test11
-rw-r--r--mysql-test/suite/ndb/t/ndb_transaction.test298
-rw-r--r--mysql-test/suite/ndb/t/ndb_trigger.test221
-rw-r--r--mysql-test/suite/ndb/t/ndb_truncate.test41
-rw-r--r--mysql-test/suite/ndb/t/ndb_types.test85
-rw-r--r--mysql-test/suite/ndb/t/ndb_update.test94
-rw-r--r--mysql-test/suite/ndb/t/ndb_update_no_read.test79
-rw-r--r--mysql-test/suite/ndb/t/ndb_view.test29
-rw-r--r--mysql-test/suite/ndb/t/ndbapi.test44
-rw-r--r--mysql-test/suite/ndb/t/ps_7ndb.test25
-rw-r--r--mysql-test/suite/ndb/t/strict_autoinc_5ndb.test10
-rw-r--r--mysql-test/suite/ndb_team/r/ndb_autodiscover.result397
-rw-r--r--mysql-test/suite/ndb_team/r/ndb_autodiscover2.result13
-rw-r--r--mysql-test/suite/ndb_team/r/ndb_autodiscover3.result53
-rw-r--r--mysql-test/suite/ndb_team/r/ndb_backup_print.result65
-rw-r--r--mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result512
-rw-r--r--mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result323
-rw-r--r--mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result1752
-rw-r--r--mysql-test/suite/ndb_team/r/rpl_ndb_mix_innodb.result143
-rw-r--r--mysql-test/suite/ndb_team/t/disabled.def20
-rw-r--r--mysql-test/suite/ndb_team/t/ndb_autodiscover.test555
-rw-r--r--mysql-test/suite/ndb_team/t/ndb_autodiscover2-master.opt1
-rw-r--r--mysql-test/suite/ndb_team/t/ndb_autodiscover2.test21
-rw-r--r--mysql-test/suite/ndb_team/t/ndb_autodiscover3.test104
-rw-r--r--mysql-test/suite/ndb_team/t/ndb_backup_print.test68
-rw-r--r--mysql-test/suite/ndb_team/t/ndb_dd_backuprestore.test349
-rw-r--r--mysql-test/suite/ndb_team/t/rpl_ndb_dd_advance.test410
-rw-r--r--mysql-test/suite/ndb_team/t/rpl_ndb_extraColMaster.test14
-rw-r--r--mysql-test/suite/ndb_team/t/rpl_ndb_mix_innodb-master.opt1
-rw-r--r--mysql-test/suite/ndb_team/t/rpl_ndb_mix_innodb.test36
-rw-r--r--mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc71
-rw-r--r--mysql-test/suite/parts/inc/partition_auto_increment.inc49
-rw-r--r--mysql-test/suite/parts/inc/partition_check.inc10
-rw-r--r--mysql-test/suite/parts/inc/partition_check_drop.inc11
-rw-r--r--mysql-test/suite/parts/inc/partition_crash.inc6
-rw-r--r--mysql-test/suite/parts/inc/partition_decimal.inc9
-rw-r--r--mysql-test/suite/parts/inc/partition_double.inc58
-rw-r--r--mysql-test/suite/parts/inc/partition_fail.inc24
-rw-r--r--mysql-test/suite/parts/inc/partition_float.inc58
-rw-r--r--mysql-test/suite/parts/inc/partition_layout.inc2
-rw-r--r--mysql-test/suite/parts/inc/partition_layout_check1.inc18
-rw-r--r--mysql-test/suite/parts/inc/partition_layout_check2.inc12
-rw-r--r--mysql-test/suite/parts/r/ndb_dd_backuprestore.result512
-rw-r--r--mysql-test/suite/parts/r/part_supported_sql_func_innodb.result2044
-rw-r--r--mysql-test/suite/parts/r/part_supported_sql_func_myisam.result2044
-rw-r--r--mysql-test/suite/parts/r/part_supported_sql_func_ndb.result9918
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_2_ndb.result27726
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_1_ndb.result24316
-rw-r--r--mysql-test/suite/parts/r/partition_alter1_2_ndb.result35540
-rw-r--r--mysql-test/suite/parts/r/partition_alter3_innodb.result94
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_blackhole.result32
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_innodb.result76
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_memory.result72
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_myisam.result72
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_ndb.result1047
-rw-r--r--mysql-test/suite/parts/r/partition_basic_innodb.result432
-rw-r--r--mysql-test/suite/parts/r/partition_debug_innodb.result1886
-rw-r--r--mysql-test/suite/parts/r/partition_debug_myisam.result2016
-rw-r--r--mysql-test/suite/parts/r/partition_decimal_innodb.result108
-rw-r--r--mysql-test/suite/parts/r/partition_decimal_myisam.result108
-rw-r--r--mysql-test/suite/parts/r/partition_engine_ndb.result5203
-rw-r--r--mysql-test/suite/parts/r/partition_int_ndb.result557
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result198
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result236
-rw-r--r--mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result236
-rw-r--r--mysql-test/suite/parts/r/partition_recover_myisam.result2
-rw-r--r--mysql-test/suite/parts/r/partition_special_innodb.result5
-rw-r--r--mysql-test/suite/parts/r/partition_special_myisam.result2
-rw-r--r--mysql-test/suite/parts/r/partition_syntax_ndb.result1820
-rw-r--r--mysql-test/suite/parts/r/partition_value_ndb.result189
-rw-r--r--mysql-test/suite/parts/r/rpl_partition.result21
-rw-r--r--mysql-test/suite/parts/t/disabled.def3
-rw-r--r--mysql-test/suite/parts/t/ndb_dd_backuprestore.test347
-rw-r--r--mysql-test/suite/parts/t/part_supported_sql_func_innodb.test3
-rw-r--r--mysql-test/suite/parts/t/part_supported_sql_func_ndb.test46
-rw-r--r--mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test3
-rw-r--r--mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test88
-rw-r--r--mysql-test/suite/parts/t/partition_alter1_1_ndb.test88
-rw-r--r--mysql-test/suite/parts/t/partition_alter1_2_innodb.test3
-rw-r--r--mysql-test/suite/parts/t/partition_alter1_2_ndb.test89
-rw-r--r--mysql-test/suite/parts/t/partition_alter2_1_1_innodb.test3
-rw-r--r--mysql-test/suite/parts/t/partition_alter2_1_2_innodb.test3
-rw-r--r--mysql-test/suite/parts/t/partition_alter2_2_2_innodb.test3
-rw-r--r--mysql-test/suite/parts/t/partition_alter4_innodb.test3
-rw-r--r--mysql-test/suite/parts/t/partition_auto_increment_ndb.test41
-rw-r--r--mysql-test/suite/parts/t/partition_basic_ndb.test92
-rw-r--r--mysql-test/suite/parts/t/partition_debug_sync_innodb.test2
-rw-r--r--mysql-test/suite/parts/t/partition_engine_ndb.test88
-rw-r--r--mysql-test/suite/parts/t/partition_int_ndb.test54
-rw-r--r--mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test49
-rw-r--r--mysql-test/suite/parts/t/partition_mgm_lc1_ndb-master.opt1
-rw-r--r--mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test46
-rw-r--r--mysql-test/suite/parts/t/partition_mgm_lc2_ndb-master.opt1
-rw-r--r--mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test45
-rw-r--r--mysql-test/suite/parts/t/partition_recover_myisam.test12
-rw-r--r--mysql-test/suite/parts/t/partition_special_innodb.test6
-rw-r--r--mysql-test/suite/parts/t/partition_special_myisam.test11
-rw-r--r--mysql-test/suite/parts/t/partition_syntax_ndb.test89
-rw-r--r--mysql-test/suite/parts/t/partition_value_ndb.test94
-rw-r--r--mysql-test/suite/parts/t/rpl_partition.test15
-rw-r--r--mysql-test/suite/perfschema/include/binlog_common.inc31
-rw-r--r--mysql-test/suite/perfschema/include/cleanup_helper.inc2
-rw-r--r--mysql-test/suite/perfschema/include/privilege.inc105
-rw-r--r--mysql-test/suite/perfschema/include/setup_helper.inc26
-rw-r--r--mysql-test/suite/perfschema/include/start_server_common.inc42
-rw-r--r--mysql-test/suite/perfschema/r/aggregate.result66
-rw-r--r--mysql-test/suite/perfschema/r/binlog_mix.result27
-rw-r--r--mysql-test/suite/perfschema/r/binlog_row.result27
-rw-r--r--mysql-test/suite/perfschema/r/binlog_stmt.result38
-rw-r--r--mysql-test/suite/perfschema/r/checksum.result68
-rw-r--r--mysql-test/suite/perfschema/r/column_privilege.result33
-rw-r--r--mysql-test/suite/perfschema/r/ddl_cond_instances.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_events_waits_current.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_events_waits_history.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_events_waits_history_long.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_ews_by_instance.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_ews_by_thread_by_event_name.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_ews_global_by_event_name.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_file_instances.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_fs_by_event_name.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_fs_by_instance.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_mutex_instances.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_performance_timers.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_rwlock_instances.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_setup_consumers.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_setup_instruments.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_setup_timers.result8
-rw-r--r--mysql-test/suite/perfschema/r/ddl_threads.result8
-rw-r--r--mysql-test/suite/perfschema/r/dml_cond_instances.result31
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_waits_current.result35
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_waits_history.result43
-rw-r--r--mysql-test/suite/perfschema/r/dml_events_waits_history_long.result43
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_by_instance.result51
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result35
-rw-r--r--mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result35
-rw-r--r--mysql-test/suite/perfschema/r/dml_file_instances.result31
-rw-r--r--mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result35
-rw-r--r--mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result35
-rw-r--r--mysql-test/suite/perfschema/r/dml_mutex_instances.result31
-rw-r--r--mysql-test/suite/perfschema/r/dml_performance_timers.result28
-rw-r--r--mysql-test/suite/perfschema/r/dml_rwlock_instances.result31
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_consumers.result28
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_instruments.result42
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_timers.result30
-rw-r--r--mysql-test/suite/perfschema/r/dml_threads.result37
-rw-r--r--mysql-test/suite/perfschema/r/func_file_io.result64
-rw-r--r--mysql-test/suite/perfschema/r/func_mutex.result49
-rw-r--r--mysql-test/suite/perfschema/r/global_read_lock.result27
-rw-r--r--mysql-test/suite/perfschema/r/information_schema.result342
-rw-r--r--mysql-test/suite/perfschema/r/misc.result14
-rw-r--r--mysql-test/suite/perfschema/r/myisam_file_io.result13
-rw-r--r--mysql-test/suite/perfschema/r/no_threads.result22
-rw-r--r--mysql-test/suite/perfschema/r/one_thread_per_con.result6
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade.result180
-rw-r--r--mysql-test/suite/perfschema/r/privilege.result579
-rw-r--r--mysql-test/suite/perfschema/r/query_cache.result8
-rw-r--r--mysql-test/suite/perfschema/r/read_only.result18
-rw-r--r--mysql-test/suite/perfschema/r/relaylog.result169
-rw-r--r--mysql-test/suite/perfschema/r/schema.result108
-rw-r--r--mysql-test/suite/perfschema/r/selects.result56
-rw-r--r--mysql-test/suite/perfschema/r/server_init.result112
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_class.result46
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_inst.result46
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_class.result46
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_inst.result46
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_class.result46
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result46
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result46
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result46
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_class.result46
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_inst.result44
-rw-r--r--mysql-test/suite/perfschema/r/start_server_off.result42
-rw-r--r--mysql-test/suite/perfschema/r/start_server_on.result42
-rw-r--r--mysql-test/suite/perfschema/r/tampered_perfschema_table1.result8
-rw-r--r--mysql-test/suite/perfschema/r/thread_cache.result5
-rw-r--r--mysql-test/suite/perfschema/t/aggregate.test96
-rw-r--r--mysql-test/suite/perfschema/t/binlog_mix.test9
-rw-r--r--mysql-test/suite/perfschema/t/binlog_row.test9
-rw-r--r--mysql-test/suite/perfschema/t/binlog_stmt.test6
-rw-r--r--mysql-test/suite/perfschema/t/checksum.test68
-rw-r--r--mysql-test/suite/perfschema/t/column_privilege.test28
-rw-r--r--mysql-test/suite/perfschema/t/ddl_cond_instances.test8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_events_waits_current.test8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_events_waits_history.test8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_events_waits_history_long.test8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_ews_by_instance.test8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_ews_by_thread_by_event_name.test8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_ews_global_by_event_name.test8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_file_instances.test8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_fs_by_instance.test8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_mutex_instances.test8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_performance_timers.test8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_rwlock_instances.test8
-rw-r--r--mysql-test/suite/perfschema/t/ddl_setup_consumers.test9
-rw-r--r--mysql-test/suite/perfschema/t/ddl_setup_instruments.test9
-rw-r--r--mysql-test/suite/perfschema/t/ddl_setup_timers.test9
-rw-r--r--mysql-test/suite/perfschema/t/ddl_threads.test8
-rw-r--r--mysql-test/suite/perfschema/t/dml_cond_instances.test25
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_waits_current.test28
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_waits_history.test34
-rw-r--r--mysql-test/suite/perfschema/t/dml_events_waits_history_long.test34
-rw-r--r--mysql-test/suite/perfschema/t/dml_ews_by_instance.test40
-rw-r--r--mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test28
-rw-r--r--mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test28
-rw-r--r--mysql-test/suite/perfschema/t/dml_file_instances.test25
-rw-r--r--mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test28
-rw-r--r--mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test28
-rw-r--r--mysql-test/suite/perfschema/t/dml_mutex_instances.test25
-rw-r--r--mysql-test/suite/perfschema/t/dml_performance_timers.test22
-rw-r--r--mysql-test/suite/perfschema/t/dml_rwlock_instances.test25
-rw-r--r--mysql-test/suite/perfschema/t/dml_setup_consumers.test26
-rw-r--r--mysql-test/suite/perfschema/t/dml_setup_instruments.test36
-rw-r--r--mysql-test/suite/perfschema/t/dml_setup_timers.test28
-rw-r--r--mysql-test/suite/perfschema/t/dml_threads.test36
-rw-r--r--mysql-test/suite/perfschema/t/func_file_io.test95
-rw-r--r--mysql-test/suite/perfschema/t/func_mutex.test50
-rw-r--r--mysql-test/suite/perfschema/t/global_read_lock.test32
-rw-r--r--mysql-test/suite/perfschema/t/information_schema.test22
-rw-r--r--mysql-test/suite/perfschema/t/misc.test14
-rw-r--r--mysql-test/suite/perfschema/t/myisam_file_io.test20
-rw-r--r--mysql-test/suite/perfschema/t/no_threads.test23
-rw-r--r--mysql-test/suite/perfschema/t/one_thread_per_con.test5
-rw-r--r--mysql-test/suite/perfschema/t/privilege.test160
-rw-r--r--mysql-test/suite/perfschema/t/query_cache.test8
-rw-r--r--mysql-test/suite/perfschema/t/read_only.test22
-rw-r--r--mysql-test/suite/perfschema/t/relaylog.test179
-rw-r--r--mysql-test/suite/perfschema/t/schema.test34
-rw-r--r--mysql-test/suite/perfschema/t/selects.test54
-rw-r--r--mysql-test/suite/perfschema/t/server_init.test116
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_cond_class.test4
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_cond_inst.test4
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_file_class.test4
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_file_inst.test4
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_mutex_class.test4
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_mutex_inst.test4
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_rwlock_class.test4
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_rwlock_inst.test4
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_thread_class.test4
-rw-r--r--mysql-test/suite/perfschema/t/start_server_no_thread_inst.test4
-rw-r--r--mysql-test/suite/perfschema/t/tampered_perfschema_table1.test10
-rw-r--r--mysql-test/suite/perfschema/t/thread_cache.test76
-rw-r--r--mysql-test/suite/perfschema_stress/t/modify.test2
-rw-r--r--mysql-test/suite/perfschema_stress/t/setup.test4
-rw-r--r--mysql-test/suite/perfschema_stress/t/work.test2
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_ddl.inc3
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_dml.inc3
-rw-r--r--mysql-test/suite/rpl/r/rpl000010.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl000011.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl000013.result28
-rw-r--r--mysql-test/suite/rpl/r/rpl000017.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_000010.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_000011.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_000013.result25
-rw-r--r--mysql-test/suite/rpl/r/rpl_000017.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_EE_err.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_LD_INFILE.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter_db.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment.result41
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment_11932.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result45
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result65
-rw-r--r--mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_auto_inc_bug33029.result37
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_corruption.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_errors.result278
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_grant.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_bit.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_bit_npk.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_blackhole.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug26395.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug31076.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug33931.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug37426.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug38694.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug41902.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_change_master.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_charset.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_charset_sjis.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result86
-rw-r--r--mysql-test/suite/rpl/r/rpl_colSize.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_commit_after_flush.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_concurrency_error.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_conditional_comments.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_database.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_if_not_exists.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_cross_version.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_current_user.result87
-rw-r--r--mysql-test/suite/rpl/r/rpl_deadlock_innodb.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_delete_no_where.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_do_grant.result64
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_db.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_temp.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_view.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_dual_pos_advance.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_empty_master_host.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_err_ignoredtable.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_events.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraCol_innodb.result606
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraCol_myisam.result606
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result878
-rw-r--r--mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result878
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result873
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result873
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result595
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result595
-rw-r--r--mysql-test/suite/rpl/r/rpl_failed_optimize.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result106
-rw-r--r--mysql-test/suite/rpl/r/rpl_flush_logs.result23
-rw-r--r--mysql-test/suite/rpl/r/rpl_flushlog_loop.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_free_items.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_geometry.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_get_lock.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result31
-rw-r--r--mysql-test/suite/rpl/r/rpl_grant.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result52
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_basic.result95
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_idempotency.result25
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_grant.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_revoke.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table_update.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_incident.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_init_slave.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_init_slave_errors.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug28430.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug30888.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_duplicate.result29
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_id.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_id_pk.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_ignore.result71
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_select.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_invoked_features.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_ip_mix.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_ip_mix2.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_ipv6.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_killed_ddl.result59
-rw-r--r--mysql-test/suite/rpl/r/rpl_known_bugs_detection.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata.result50
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_charset.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_fatal.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_m.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_map.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_s.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_simple.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_symlink.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddatalocal.result51
-rw-r--r--mysql-test/suite/rpl/r/rpl_loadfile.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_locale.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_log_pos.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_manual_change_index_file.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_many_optimize.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_master_pos_wait.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_misc_functions.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mix_found_rows.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result76
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_delete.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_delete2.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_engine.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update2.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update3.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update4.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mysql_upgrade.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_name_const.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_not_null_innodb.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_not_null_myisam.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_optimize.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_packet.result33
-rw-r--r--mysql-test/suite/rpl/r/rpl_plugin_load.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_ps.result38
-rw-r--r--mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_read_only.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_relay_space_innodb.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_relay_space_myisam.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_relayrotate.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_relayspace.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_do.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_report.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_rewrt_db.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_rotate_logs.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_001.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_4_bytes.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_NOW.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_USER.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_UUID.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result46
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result57
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result57
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_8partition.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result80
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_blob_innodb.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_blob_myisam.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_colSize.result50
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_conflicts.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_delayed_ins.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_drop.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_find_row.result25
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func001.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func002.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func003.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_idempotency.result23
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_insert_delayed.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result47
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log_innodb.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_max_relay_size.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mixing_engines.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result42
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result63
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_reset_slave.result35
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result205
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp001.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp003.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp005.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp008.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp009.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp010.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp011.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp012.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result33
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result33
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result288
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result38
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig001.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig002.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig003.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig004.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trunc_temp.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_until.result21
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_utf16.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_utf32.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_view01.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_wide_table.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_savepoint.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_event.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id1.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id2.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id_ignore.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_session_var.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_charset.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_null_innodb.result31
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_null_myisam.result31
-rw-r--r--mysql-test/suite/rpl/r/rpl_show_slave_hosts.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_show_slave_running.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_skip_error.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_grp_exec.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_load_in.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_skip.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_status.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_slow_query_log.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp004.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp_effects.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_spec_variables.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_sporadic_master.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl.result41
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl1.result60
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_000001.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_EE_err2.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result76
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_conflicts.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_found_rows.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_innodb.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result50
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_loadfile.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_log.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result188
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result31
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_multi_query.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_no_op.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_reset_slave.result35
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_sql_mode.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result42
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result25
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_until.result38
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_user_variables.result26
-rw-r--r--mysql-test/suite/rpl/r/rpl_stop_slave.result122
-rw-r--r--mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_sync.result25
-rw-r--r--mysql-test/suite/rpl/r/rpl_temp_table.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result66
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary_errors.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_test_framework.result170
-rw-r--r--mysql-test/suite/rpl/r/rpl_timezone.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_trigger.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_trunc_temp.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_2myisam.result29
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_3innodb.result29
-rw-r--r--mysql-test/suite/rpl/r/rpl_typeconv.result34
-rw-r--r--mysql-test/suite/rpl/r/rpl_typeconv_innodb.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_udf.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_user.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_user_variables.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables_stm.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_view.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_view_multi.result9
-rw-r--r--mysql-test/suite/rpl/t/disabled.def10
-rw-r--r--mysql-test/suite/rpl/t/rpl000010.test15
-rw-r--r--mysql-test/suite/rpl/t/rpl000011.test19
-rw-r--r--mysql-test/suite/rpl/t/rpl000013.test57
-rw-r--r--mysql-test/suite/rpl/t/rpl000017-slave.sh12
-rw-r--r--mysql-test/suite/rpl/t/rpl000017.test34
-rw-r--r--mysql-test/suite/rpl/t/rpl_000010-slave.opt (renamed from mysql-test/suite/rpl/t/rpl000010-slave.opt)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_000010.test16
-rw-r--r--mysql-test/suite/rpl/t/rpl_000011.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_000013.test55
-rw-r--r--mysql-test/suite/rpl/t/rpl_000017.test48
-rw-r--r--mysql-test/suite/rpl/t/rpl_EE_err.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_LD_INFILE.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter_db.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment_11932.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment_bug33029.test60
-rw-r--r--mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029.test42
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_corruption.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_errors-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_errors.test413
-rw-r--r--mysql-test/suite/rpl/t/rpl_binlog_grant.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_bit.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_bit_npk.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_blackhole.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug26395.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug31076.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug33931-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug33931.test25
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug37426.test22
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug38694.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug41902.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_change_master.test17
-rw-r--r--mysql-test/suite/rpl/t/rpl_charset.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_charset_sjis.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf11
-rw-r--r--mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test291
-rw-r--r--mysql-test/suite/rpl/t/rpl_colSize.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_commit_after_flush.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_concurrency_error.test27
-rw-r--r--mysql-test/suite/rpl/t/rpl_conditional_comments.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_database.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_if_not_exists.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_critical_errors.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_cross_version-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_cross_version.test21
-rw-r--r--mysql-test/suite/rpl/t/rpl_current_user-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_current_user.cnf7
-rw-r--r--mysql-test/suite/rpl/t/rpl_current_user.test141
-rw-r--r--mysql-test/suite/rpl/t/rpl_ddl.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_deadlock_innodb.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_delete_no_where.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_do_grant.test44
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_db.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_temp.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_view.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_dual_pos_advance.test41
-rw-r--r--mysql-test/suite/rpl/t/rpl_empty_master_host.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_err_ignoredtable.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_events.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_innodb.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraCol_myisam.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test11
-rw-r--r--mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_failed_optimize.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_flush_logs.test34
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh5
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh4
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop.test43
-rw-r--r--mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_free_items.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_geometry.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_get_lock.test11
-rw-r--r--mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test21
-rw-r--r--mysql-test/suite/rpl/t/rpl_grant.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf11
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test133
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_basic.test127
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_idempotency.test24
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_grant.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_revoke.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table_update.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_incident.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_init_slave_errors.test28
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug28430.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_bug30888.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_duplicate.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_id_pk.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_ignore.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_insert_select.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_invoked_features.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix2-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix2.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_ipv6.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_killed_ddl.test29
-rw-r--r--mysql-test/suite/rpl/t/rpl_known_bugs_detection.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_charset.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_fatal.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_m.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_map.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_s.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_simple.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_symlink.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddatalocal.test78
-rw-r--r--mysql-test/suite/rpl/t/rpl_loadfile.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_locale.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_log_pos.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_manual_change_index_file.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_many_optimize.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_master_pos_wait.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_misc_functions.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mix_found_rows.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_delete.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_delete2.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_engine.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update2.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update3.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_multi_update4.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_mysql_upgrade.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_name_const.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_not_null_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_not_null_myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_optimize.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet.test43
-rw-r--r--mysql-test/suite/rpl/t/rpl_plugin_load.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_ps.test41
-rw-r--r--mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_read_only.test24
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_innodb.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_relay_space_myisam.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayrotate.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_relayspace.test46
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_do.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_report.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_rewrt_db.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh2
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_001.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_4_bytes.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_NOW.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_USER.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_UUID.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test34
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_8partition.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_blob_myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_colSize.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_conflicts.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table.test38
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_delayed_ins.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_drop.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_find_row.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func001.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func002.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_func003.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_idempotency.test11
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_insert_delayed.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_log_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mixing_engines.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp001.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp003.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp005.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp008.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp009.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp010.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp011.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp012.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig001.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig002.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig003.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trig004.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_trunc_temp.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_until.test22
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_utf16.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_utf32.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_view01.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_wide_table.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_savepoint.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_event.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id1.test30
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id2.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_server_id_ignore.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_session_var.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_charset.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_null_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_null_myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_sf.test187
-rw-r--r--mysql-test/suite/rpl/t/rpl_show_slave_hosts.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_show_slave_running.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_error.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_grp_exec.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_load_in.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test42
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test26
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_status.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_slow_query_log.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp004.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_spec_variables.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_sporadic_master.test11
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl1.test15
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_000001.test130
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_conflicts.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_found_rows.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_innodb.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_loadfile.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_log.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_multi_query.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_no_op.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_sql_mode.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test17
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_until.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_user_variables.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_stop_slave.test119
-rw-r--r--mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync-slave.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_sync.test34
-rw-r--r--mysql-test/suite/rpl/t/rpl_temp_table.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test68
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary.test17
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt3
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary_errors.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_test_framework.cnf46
-rw-r--r--mysql-test/suite/rpl/t/rpl_test_framework.test143
-rw-r--r--mysql-test/suite/rpl/t/rpl_timezone.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_trigger.test31
-rw-r--r--mysql-test/suite/rpl/t/rpl_trunc_temp.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_2myisam.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_truncate_3innodb.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_typeconv-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_typeconv.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_typeconv_innodb.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_udf.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_user.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_user_variables.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_variables.test36
-rw-r--r--mysql-test/suite/rpl/t/rpl_variables_stm.test28
-rw-r--r--mysql-test/suite/rpl/t/rpl_view.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_view_multi.test1
-rw-r--r--mysql-test/suite/rpl_ndb/combinations5
-rw-r--r--mysql-test/suite/rpl_ndb/my.cnf70
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result928
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result928
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2ndb.result400
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result807
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result40
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result20
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result170
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result120
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result192
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result174
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result135
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result156
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result27
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_2ch.result64
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result29
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result13
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result27
-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.result790
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result1628
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result15
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result58
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result26
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result582
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result30
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result66
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result919
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result103
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result70
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result42
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result294
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result486
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_implicit_commit_binlog.result660
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result246
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result57
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result55
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result197
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result919
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result16
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result54
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result55
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_row_implicit_commit_binlog.result661
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_set_null.result35
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result49
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result46
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result144
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result91
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result30
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result8
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result636
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result89
-rw-r--r--mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result91
-rw-r--r--mysql-test/suite/rpl_ndb/t/disabled.def16
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test39
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test38
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test19
-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.test50
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test8
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status-master.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status.test26
-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.test264
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test262
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test144
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test15
-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_2ch.cnf22
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test172
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test82
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test14
-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.test46
-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.test11
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test59
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test48
-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.test16
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test109
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt1
-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.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test69
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test11
-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.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test13
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-master.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test476
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_implicit_commit_binlog.test9
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-master.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test374
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test73
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt1
-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.test11
-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.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test60
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test10
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_row_implicit_commit_binlog.test9
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_set_null.test6
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test13
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test13
-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-slave.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test40
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test101
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test17
-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.test66
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2-master.opt1
-rw-r--r--mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test11
-rw-r--r--mysql-test/suite/stress/r/ddl_ndb.result216
-rw-r--r--mysql-test/suite/stress/t/ddl_ndb.test58
-rw-r--r--mysql-test/suite/sys_vars/inc/autocommit_func2.inc29
-rw-r--r--mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc154
-rw-r--r--mysql-test/suite/sys_vars/r/all_vars.result1
-rw-r--r--mysql-test/suite/sys_vars/r/autocommit_func2.result46
-rw-r--r--mysql-test/suite/sys_vars/r/autocommit_func3.result42
-rw-r--r--mysql-test/suite/sys_vars/r/autocommit_func4.result46
-rw-r--r--mysql-test/suite/sys_vars/r/autocommit_func5.result42
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result108
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result108
-rw-r--r--mysql-test/suite/sys_vars/r/external_user_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/foreign_key_checks_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_format_basic.result14
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result8
-rw-r--r--mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result11
-rw-r--r--mysql-test/suite/sys_vars/r/max_allowed_packet_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result152
-rw-r--r--mysql-test/suite/sys_vars/r/max_long_data_size_basic.result14
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_switch_basic.result7
-rw-r--r--mysql-test/suite/sys_vars/r/proxy_user_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_init_slave_func.result11
-rw-r--r--mysql-test/suite/sys_vars/r/secure_file_priv2.result6
-rw-r--r--mysql-test/suite/sys_vars/r/shared_memory_base_name_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/t/all_vars.test4
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_func2-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_func2.test1
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_func3-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_func3.test1
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_func4-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_func4.test1
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_func5-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_func5.test1
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test7
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test7
-rw-r--r--mysql-test/suite/sys_vars/t/disabled.def13
-rw-r--r--mysql-test/suite/sys_vars/t/external_user_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/foreign_key_checks_func.test2
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test9
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test184
-rw-r--r--mysql-test/suite/sys_vars/t/max_long_data_size_basic.test17
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_switch_basic.test8
-rw-r--r--mysql-test/suite/sys_vars/t/proxy_user_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_init_slave_func.test1
-rw-r--r--mysql-test/suite/sys_vars/t/secure_file_priv2-master.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/secure_file_priv2.test23
-rw-r--r--mysql-test/suite/sys_vars/t/shared_memory_base_name_basic.test10
-rw-r--r--mysql-test/suite/sys_vars/t/slow_launch_time_func.test3
-rw-r--r--mysql-test/suite/sys_vars/t/thread_cache_size_func.test1
-rw-r--r--mysql-test/suite/sys_vars/t/wait_timeout_func.test1
-rw-r--r--mysql-test/t/alter_table.test32
-rw-r--r--mysql-test/t/archive.test23
-rw-r--r--mysql-test/t/archive_debug.test13
-rw-r--r--mysql-test/t/archive_plugin.test8
-rw-r--r--mysql-test/t/auto_increment.test38
-rw-r--r--mysql-test/t/blackhole_plugin.test8
-rw-r--r--mysql-test/t/bootstrap.test12
-rw-r--r--mysql-test/t/bug58669-master.opt1
-rw-r--r--mysql-test/t/bug58669.test22
-rw-r--r--mysql-test/t/cache_innodb.test15
-rw-r--r--mysql-test/t/cast.test14
-rw-r--r--mysql-test/t/change_user.test2
-rw-r--r--mysql-test/t/check.test24
-rw-r--r--mysql-test/t/crash_commit_before.test2
-rw-r--r--mysql-test/t/csv_not_null.test6
-rw-r--r--mysql-test/t/ctype_cp1250_ch.test10
-rw-r--r--mysql-test/t/ctype_cp1251.test30
-rw-r--r--mysql-test/t/ctype_eucjpms.test10
-rw-r--r--mysql-test/t/ctype_latin1.test23
-rw-r--r--mysql-test/t/ctype_like_range.test87
-rw-r--r--mysql-test/t/ctype_many.test35
-rw-r--r--mysql-test/t/ctype_sjis.test8
-rw-r--r--mysql-test/t/ctype_uca.test16
-rw-r--r--mysql-test/t/ctype_ucs.test6
-rw-r--r--mysql-test/t/ctype_ujis.test7
-rw-r--r--mysql-test/t/ctype_utf16.test9
-rw-r--r--mysql-test/t/ctype_utf16_uca.test7
-rw-r--r--mysql-test/t/ctype_utf32.test10
-rw-r--r--mysql-test/t/ctype_utf32_uca.test8
-rw-r--r--mysql-test/t/ctype_utf8.test51
-rw-r--r--mysql-test/t/ctype_utf8mb4_ndb.test7
-rw-r--r--mysql-test/t/date_formats.test16
-rw-r--r--mysql-test/t/delayed.test64
-rw-r--r--mysql-test/t/delete.test26
-rw-r--r--mysql-test/t/derived.test33
-rw-r--r--mysql-test/t/disabled.def16
-rw-r--r--mysql-test/t/distinct.test13
-rw-r--r--mysql-test/t/errors.test16
-rw-r--r--mysql-test/t/events_1.test109
-rw-r--r--mysql-test/t/events_2.test46
-rw-r--r--mysql-test/t/events_bugs.test82
-rw-r--r--mysql-test/t/events_restart.test2
-rw-r--r--mysql-test/t/execution_constants.test2
-rw-r--r--mysql-test/t/explain.test59
-rw-r--r--mysql-test/t/file_contents.test68
-rw-r--r--mysql-test/t/filesort_debug.test59
-rw-r--r--mysql-test/t/fix_priv_tables.test2
-rw-r--r--mysql-test/t/flush.test122
-rw-r--r--mysql-test/t/flush_block_commit.test2
-rw-r--r--mysql-test/t/flush_block_commit_notembedded.test2
-rw-r--r--mysql-test/t/flush_read_lock.test2192
-rw-r--r--mysql-test/t/flush_read_lock_kill-master.opt1
-rw-r--r--mysql-test/t/flush_read_lock_kill.test68
-rw-r--r--mysql-test/t/fulltext.test37
-rw-r--r--mysql-test/t/func_analyse.test24
-rw-r--r--mysql-test/t/func_encrypt_ucs2.test12
-rw-r--r--mysql-test/t/func_gconcat.test23
-rw-r--r--mysql-test/t/func_group.test65
-rw-r--r--mysql-test/t/func_group_innodb.test50
-rw-r--r--mysql-test/t/func_in.test6
-rw-r--r--mysql-test/t/func_like.test5
-rw-r--r--mysql-test/t/func_math.test78
-rw-r--r--mysql-test/t/func_misc.test53
-rw-r--r--mysql-test/t/func_set.test22
-rw-r--r--mysql-test/t/func_str.test18
-rw-r--r--mysql-test/t/func_time.test111
-rw-r--r--mysql-test/t/gis-rtree.test28
-rw-r--r--mysql-test/t/gis.test35
-rw-r--r--mysql-test/t/grant.test299
-rw-r--r--mysql-test/t/grant2.test4
-rw-r--r--mysql-test/t/grant3.test5
-rw-r--r--mysql-test/t/group_by.test48
-rw-r--r--mysql-test/t/having.test26
-rw-r--r--mysql-test/t/implicit_char_to_num_conversion.test174
-rw-r--r--mysql-test/t/information_schema.test56
-rw-r--r--mysql-test/t/information_schema_db.test3
-rw-r--r--mysql-test/t/init_file.test2
-rw-r--r--mysql-test/t/innodb_mysql_lock.test36
-rw-r--r--mysql-test/t/innodb_mysql_sync.test198
-rw-r--r--mysql-test/t/insert_select.test4
-rw-r--r--mysql-test/t/join_outer.test235
-rw-r--r--mysql-test/t/join_outer_innodb.test37
-rw-r--r--mysql-test/t/key_cache-master.opt1
-rw-r--r--mysql-test/t/keywords.test100
-rw-r--r--mysql-test/t/kill.test461
-rw-r--r--mysql-test/t/loaddata.test28
-rw-r--r--mysql-test/t/lock_multi.test58
-rw-r--r--mysql-test/t/lock_sync.test114
-rw-r--r--mysql-test/t/log_tables.test19
-rw-r--r--mysql-test/t/lowercase_fs_off.test11
-rw-r--r--mysql-test/t/lowercase_table2.test35
-rwxr-xr-xmysql-test/t/lowercase_table4-master.opt1
-rwxr-xr-xmysql-test/t/lowercase_table4.test108
-rw-r--r--mysql-test/t/mdl_sync.test92
-rw-r--r--mysql-test/t/merge.test139
-rw-r--r--mysql-test/t/multi_update.test79
-rw-r--r--mysql-test/t/multi_update_innodb.test77
-rw-r--r--mysql-test/t/myisam_crash_before_flush_keys.test2
-rw-r--r--mysql-test/t/mysql.test149
-rw-r--r--mysql-test/t/mysql_client_test-master.opt5
-rw-r--r--mysql-test/t/mysql_client_test.test4
-rw-r--r--mysql-test/t/mysql_embedded.test6
-rw-r--r--mysql-test/t/mysqladmin.test26
-rw-r--r--mysql-test/t/mysqlbinlog-master.opt1
-rw-r--r--mysql-test/t/mysqlbinlog.test60
-rw-r--r--mysql-test/t/mysqlbinlog_base64.test29
-rw-r--r--mysql-test/t/mysqlbinlog_row_big.test4
-rw-r--r--mysql-test/t/mysqlcheck.test137
-rw-r--r--mysql-test/t/mysqld--defaults-file.test47
-rw-r--r--mysql-test/t/mysqldump.test42
-rw-r--r--mysql-test/t/mysqlshow.test2
-rw-r--r--mysql-test/t/mysqlslap.test15
-rw-r--r--mysql-test/t/mysqltest.test279
-rw-r--r--mysql-test/t/named_pipe.test5
-rw-r--r--mysql-test/t/no-threads.test1
-rw-r--r--mysql-test/t/not_embedded_server.test112
-rw-r--r--mysql-test/t/order_by.test23
-rw-r--r--mysql-test/t/partition.test157
-rw-r--r--mysql-test/t/partition_binlog.test42
-rw-r--r--mysql-test/t/partition_datatype.test310
-rw-r--r--mysql-test/t/partition_debug_sync.test10
-rw-r--r--mysql-test/t/partition_error.test841
-rw-r--r--mysql-test/t/partition_innodb.test68
-rw-r--r--mysql-test/t/partition_innodb_plugin.test67
-rw-r--r--mysql-test/t/partition_myisam.test182
-rw-r--r--mysql-test/t/partition_not_embedded.test53
-rw-r--r--mysql-test/t/partition_range.test4
-rw-r--r--mysql-test/t/partition_symlink.test11
-rw-r--r--mysql-test/t/plugin_auth-master.opt2
-rw-r--r--mysql-test/t/plugin_auth.test515
-rw-r--r--mysql-test/t/plugin_auth_qa-master.opt2
-rw-r--r--mysql-test/t/plugin_auth_qa.test338
-rw-r--r--mysql-test/t/plugin_auth_qa_1-master.opt2
-rw-r--r--mysql-test/t/plugin_auth_qa_1.test340
-rw-r--r--mysql-test/t/plugin_auth_qa_2-master.opt2
-rw-r--r--mysql-test/t/plugin_auth_qa_2.test153
-rw-r--r--mysql-test/t/plugin_auth_qa_3-master.opt2
-rw-r--r--mysql-test/t/plugin_auth_qa_3.test25
-rw-r--r--mysql-test/t/plugin_load_option-master.opt3
-rw-r--r--mysql-test/t/plugin_load_option.test8
-rw-r--r--mysql-test/t/plugin_not_embedded.test12
-rw-r--r--mysql-test/t/ps.test23
-rw-r--r--mysql-test/t/query_cache_28249.test8
-rw-r--r--mysql-test/t/query_cache_debug.test146
-rw-r--r--mysql-test/t/range.test67
-rw-r--r--mysql-test/t/rpl_mysqldump_slave.test4
-rw-r--r--mysql-test/t/select.test89
-rw-r--r--mysql-test/t/shm.test5
-rw-r--r--mysql-test/t/show_check.test119
-rw-r--r--mysql-test/t/sp-bugs.test37
-rw-r--r--mysql-test/t/sp-destruct.test28
-rw-r--r--mysql-test/t/sp-error.test114
-rw-r--r--mysql-test/t/sp-lock.test165
-rw-r--r--mysql-test/t/sp-security.test37
-rw-r--r--mysql-test/t/sp.test65
-rw-r--r--mysql-test/t/sp_notembedded.test52
-rw-r--r--mysql-test/t/sp_trans.test24
-rw-r--r--mysql-test/t/ssl_and_innodb.test11
-rw-r--r--mysql-test/t/ssl_cipher-master.opt1
-rw-r--r--mysql-test/t/ssl_cipher.test23
-rw-r--r--mysql-test/t/status.test15
-rw-r--r--mysql-test/t/status_bug17954.test54
-rw-r--r--mysql-test/t/subselect.test87
-rw-r--r--mysql-test/t/subselect4.test10
-rw-r--r--mysql-test/t/subselect_innodb.test9
-rw-r--r--mysql-test/t/symlink.test40
-rw-r--r--mysql-test/t/system_mysql_db_fix40123.test4
-rw-r--r--mysql-test/t/system_mysql_db_fix50030.test4
-rw-r--r--mysql-test/t/system_mysql_db_fix50117.test4
-rw-r--r--mysql-test/t/tablespace.test122
-rw-r--r--mysql-test/t/trigger-compat.test180
-rw-r--r--mysql-test/t/trigger-trans.test5
-rw-r--r--mysql-test/t/trigger.test34
-rw-r--r--mysql-test/t/trigger_notembedded.test2
-rw-r--r--mysql-test/t/truncate_coverage.test54
-rw-r--r--mysql-test/t/type_blob.test13
-rw-r--r--mysql-test/t/type_date.test20
-rw-r--r--mysql-test/t/type_datetime.test51
-rw-r--r--mysql-test/t/type_newdecimal.test15
-rw-r--r--mysql-test/t/type_timestamp.test65
-rw-r--r--mysql-test/t/type_year.test10
-rw-r--r--mysql-test/t/union.test69
-rw-r--r--mysql-test/t/user_var.test19
-rw-r--r--mysql-test/t/variables-big.test13
-rw-r--r--mysql-test/t/variables-notembedded.test27
-rw-r--r--mysql-test/t/variables.test91
-rw-r--r--mysql-test/t/variables_debug.test75
-rw-r--r--mysql-test/t/view.test28
-rw-r--r--mysql-test/t/view_grant.test144
-rw-r--r--mysql-test/t/wait_timeout.test4
-rw-r--r--mysql-test/t/warnings.test40
-rw-r--r--mysql-test/t/wl4435_generated.inc588
-rw-r--r--mysql-test/t/xa.test153
-rw-r--r--mysql-test/t/xml.test49
-rw-r--r--mysql-test/valgrind.supp98
-rw-r--r--mysys/CMakeLists.txt9
-rw-r--r--mysys/Makefile.am170
-rw-r--r--mysys/charset.c20
-rw-r--r--mysys/default.c130
-rw-r--r--mysys/errors.c4
-rw-r--r--mysys/lf_alloc-pin.c48
-rw-r--r--mysys/mf_brkhant.c72
-rw-r--r--mysys/mf_format.c2
-rw-r--r--mysys/mf_iocache.c87
-rw-r--r--mysys/mf_iocache2.c5
-rw-r--r--mysys/mf_keycache.c99
-rw-r--r--mysys/mf_pack.c5
-rw-r--r--mysys/my_bitmap.c20
-rw-r--r--mysys/my_compare.c642
-rw-r--r--mysys/my_fopen.c136
-rw-r--r--mysys/my_fstream.c3
-rw-r--r--mysys/my_gethostbyname.c114
-rw-r--r--mysys/my_gethwaddr.c32
-rw-r--r--mysys/my_getopt.c58
-rw-r--r--mysys/my_handler.c681
-rw-r--r--mysys/my_handler_errors.h5
-rw-r--r--mysys/my_init.c271
-rw-r--r--mysys/my_lib.c15
-rw-r--r--mysys/my_open.c6
-rw-r--r--mysys/my_port.c40
-rw-r--r--mysys/my_pread.c8
-rw-r--r--mysys/my_pthread.c2
-rw-r--r--mysys/my_rdtsc.c10
-rw-r--r--mysys/my_read.c4
-rw-r--r--mysys/my_seek.c3
-rw-r--r--mysys/my_static.c4
-rw-r--r--mysys/my_symlink.c20
-rw-r--r--mysys/my_sync.c44
-rw-r--r--mysys/my_thr_init.c103
-rw-r--r--mysys/my_wincond.c232
-rw-r--r--mysys/my_winfile.c21
-rw-r--r--mysys/my_winthread.c15
-rw-r--r--mysys/my_write.c3
-rw-r--r--mysys/mysys_priv.h12
-rw-r--r--mysys/ptr_cmp.c19
-rw-r--r--mysys/stacktrace.c114
-rw-r--r--mysys/thr_alarm.c15
-rw-r--r--mysys/thr_lock.c13
-rw-r--r--mysys/thr_mutex.c7
-rw-r--r--mysys/thr_rwlock.c299
-rw-r--r--mysys/typelib.c49
-rw-r--r--packaging/Makefile.am14
-rw-r--r--packaging/WiX/CMakeLists.txt7
-rw-r--r--packaging/WiX/ca/CMakeLists.txt42
-rw-r--r--packaging/WiX/ca/CustomAction.rc18
-rw-r--r--packaging/WiX/create_msi.cmake.in97
-rw-r--r--packaging/WiX/custom_ui.wxs28
-rw-r--r--packaging/WiX/mysql_server.wxs.in16
-rw-r--r--plugin/Makefile.am26
-rw-r--r--plugin/audit_null/Makefile.am32
-rw-r--r--plugin/audit_null/audit_null.c5
-rw-r--r--plugin/audit_null/plug.in4
-rw-r--r--plugin/auth/CMakeLists.txt30
-rw-r--r--plugin/auth/Makefile.am15
-rw-r--r--plugin/auth/auth_socket.c36
-rw-r--r--plugin/auth/dialog.c132
-rw-r--r--plugin/auth/plug.in15
-rw-r--r--plugin/auth/qa_auth_client.c127
-rw-r--r--plugin/auth/qa_auth_interface.c262
-rw-r--r--plugin/auth/qa_auth_server.c87
-rw-r--r--plugin/auth/test_plugin.c240
-rw-r--r--plugin/daemon_example/Makefile.am37
-rw-r--r--plugin/daemon_example/configure.in9
-rw-r--r--plugin/daemon_example/plug.in3
-rw-r--r--plugin/fulltext/Makefile.am25
-rw-r--r--plugin/fulltext/configure.in9
-rw-r--r--plugin/fulltext/plug.in3
-rw-r--r--plugin/fulltext/plugin_example.c4
-rw-r--r--plugin/semisync/Makefile.am38
-rw-r--r--plugin/semisync/configure.in9
-rw-r--r--plugin/semisync/plug.in3
-rw-r--r--plugin/semisync/semisync_slave_plugin.cc4
-rw-r--r--pstack/Makefile.am29
-rw-r--r--pstack/aout/Makefile.am1
-rw-r--r--pstack/aout/aout64.h475
-rw-r--r--pstack/aout/stab.def264
-rw-r--r--pstack/aout/stab_gnu.h37
-rw-r--r--pstack/bucomm.c238
-rw-r--r--pstack/bucomm.h91
-rw-r--r--pstack/budbg.h64
-rw-r--r--pstack/debug.c3509
-rw-r--r--pstack/debug.h798
-rw-r--r--pstack/demangle.h90
-rw-r--r--pstack/filemode.c266
-rw-r--r--pstack/ieee.c7602
-rw-r--r--pstack/ieee.h138
-rw-r--r--pstack/libiberty.h180
-rw-r--r--pstack/linuxthreads.c90
-rw-r--r--pstack/linuxthreads.h28
-rw-r--r--pstack/pstack.c2746
-rw-r--r--pstack/pstack.h22
-rw-r--r--pstack/pstacktrace.h24
-rw-r--r--pstack/rddbg.c462
-rw-r--r--pstack/stabs.c5082
-rw-r--r--regex/Makefile.am33
-rw-r--r--regex/main.c6
-rw-r--r--regex/my_regex.h4
-rw-r--r--regex/regcomp.c15
-rw-r--r--regex/regexec.c5
-rw-r--r--regex/reginit.c6
-rw-r--r--scripts/CMakeLists.txt9
-rw-r--r--scripts/Makefile.am196
-rw-r--r--scripts/fill_help_tables.sql1
-rw-r--r--scripts/make_binary_distribution.sh6
-rw-r--r--scripts/make_sharedlib_distribution.sh136
-rwxr-xr-xscripts/make_win_bin_dist7
-rw-r--r--scripts/mysql_config.sh6
-rw-r--r--scripts/mysql_fix_extensions.sh18
-rw-r--r--scripts/mysql_setpermission.sh18
-rw-r--r--scripts/mysql_system_tables.sql44
-rw-r--r--scripts/mysql_system_tables_data.sql21
-rw-r--r--scripts/mysql_system_tables_fix.sql15
-rw-r--r--scripts/mysql_test_data_timezone.sql15
-rw-r--r--scripts/mysqlaccess.sh18
-rw-r--r--scripts/mysqld_multi.sh17
-rw-r--r--scripts/mysqldumpslow.sh18
-rw-r--r--scripts/mysqlhotcopy.sh17
-rw-r--r--sql-bench/CMakeLists.txt10
-rw-r--r--sql-bench/Makefile.am83
-rw-r--r--sql-common/Makefile.am17
-rw-r--r--sql-common/client.c314
-rw-r--r--sql-common/client_plugin.c67
-rw-r--r--sql-common/my_time.c12
-rw-r--r--sql/CMakeLists.txt11
-rw-r--r--sql/Makefile.am287
-rw-r--r--sql/client_settings.h3
-rw-r--r--sql/debug_sync.cc34
-rw-r--r--sql/debug_sync.h2
-rw-r--r--sql/derror.cc21
-rw-r--r--sql/event_data_objects.cc47
-rw-r--r--sql/event_data_objects.h7
-rw-r--r--sql/event_db_repository.cc110
-rw-r--r--sql/event_db_repository.h5
-rw-r--r--sql/event_parse_data.cc11
-rw-r--r--sql/event_parse_data.h1
-rw-r--r--sql/event_queue.cc32
-rw-r--r--sql/events.cc102
-rw-r--r--sql/events.h17
-rw-r--r--sql/field.cc92
-rw-r--r--sql/field.h128
-rw-r--r--sql/field_conv.cc7
-rw-r--r--sql/filesort.cc33
-rw-r--r--sql/gen_lex_hash.cc4
-rw-r--r--sql/ha_ndbcluster.cc69
-rw-r--r--sql/ha_ndbcluster_binlog.cc15
-rw-r--r--sql/ha_ndbcluster_cond.cc2
-rw-r--r--sql/ha_partition.cc824
-rw-r--r--sql/ha_partition.h49
-rw-r--r--sql/handler.cc156
-rw-r--r--sql/handler.h192
-rw-r--r--sql/hostname.cc50
-rw-r--r--sql/item.cc317
-rw-r--r--sql/item.h56
-rw-r--r--sql/item_cmpfunc.cc119
-rw-r--r--sql/item_cmpfunc.h2
-rw-r--r--sql/item_create.cc70
-rw-r--r--sql/item_func.cc209
-rw-r--r--sql/item_func.h71
-rw-r--r--sql/item_geofunc.h3
-rw-r--r--sql/item_row.cc10
-rw-r--r--sql/item_strfunc.cc242
-rw-r--r--sql/item_strfunc.h69
-rw-r--r--sql/item_subselect.cc51
-rw-r--r--sql/item_subselect.h1
-rw-r--r--sql/item_sum.cc163
-rw-r--r--sql/item_sum.h59
-rw-r--r--sql/item_timefunc.cc171
-rw-r--r--sql/item_timefunc.h143
-rw-r--r--sql/item_xmlfunc.cc4
-rw-r--r--sql/key.cc6
-rw-r--r--sql/lex.h5
-rw-r--r--sql/lock.cc363
-rw-r--r--sql/lock.h6
-rw-r--r--sql/log.cc721
-rw-r--r--sql/log.h79
-rw-r--r--sql/log_event.cc156
-rw-r--r--sql/log_event.h17
-rw-r--r--sql/mdl.cc603
-rw-r--r--sql/mdl.h218
-rw-r--r--sql/message.h14
-rw-r--r--sql/my_decimal.cc12
-rw-r--r--sql/my_decimal.h69
-rw-r--r--sql/mysqld.cc382
-rw-r--r--sql/mysqld.h63
-rw-r--r--sql/net_serv.cc14
-rw-r--r--sql/opt_range.cc11
-rw-r--r--sql/opt_range.h58
-rw-r--r--sql/opt_subselect.cc2
-rw-r--r--sql/opt_sum.cc45
-rw-r--r--sql/partition_info.cc65
-rw-r--r--sql/partition_info.h11
-rw-r--r--sql/password.c32
-rw-r--r--sql/protocol.cc21
-rw-r--r--sql/records.cc9
-rw-r--r--sql/repl_failsafe.cc370
-rw-r--r--sql/repl_failsafe.h11
-rw-r--r--sql/rpl_handler.cc21
-rw-r--r--sql/rpl_handler.h3
-rw-r--r--sql/rpl_injector.cc6
-rw-r--r--sql/rpl_record.cc63
-rw-r--r--sql/rpl_record.h7
-rw-r--r--sql/rpl_rli.cc26
-rw-r--r--sql/rpl_rli.h10
-rw-r--r--sql/scheduler.cc31
-rw-r--r--sql/scheduler.h24
-rw-r--r--sql/set_var.cc17
-rw-r--r--sql/set_var.h2
-rw-r--r--sql/share/Makefile.am60
-rw-r--r--sql/share/charsets/cp1251.xml2
-rw-r--r--sql/share/charsets/languages.html16
-rw-r--r--sql/share/errmsg-utf8.txt79
-rw-r--r--sql/slave.cc194
-rw-r--r--sql/slave.h2
-rw-r--r--sql/sp.cc157
-rw-r--r--sql/sp.h15
-rw-r--r--sql/sp_head.cc117
-rw-r--r--sql/sp_head.h5
-rw-r--r--sql/sp_rcontext.h1
-rw-r--r--sql/sql_acl.cc1427
-rw-r--r--sql/sql_acl.h12
-rw-r--r--sql/sql_admin.cc91
-rw-r--r--sql/sql_alter.cc13
-rw-r--r--sql/sql_analyse.cc9
-rw-r--r--sql/sql_audit.cc55
-rw-r--r--sql/sql_audit.h62
-rw-r--r--sql/sql_base.cc437
-rw-r--r--sql/sql_base.h64
-rw-r--r--sql/sql_binlog.cc12
-rw-r--r--sql/sql_cache.cc125
-rw-r--r--sql/sql_class.cc443
-rw-r--r--sql/sql_class.h213
-rw-r--r--sql/sql_connect.cc87
-rw-r--r--sql/sql_connect.h6
-rw-r--r--sql/sql_cursor.cc74
-rw-r--r--sql/sql_cursor.h2
-rw-r--r--sql/sql_db.cc288
-rw-r--r--sql/sql_delete.cc4
-rw-r--r--sql/sql_derived.cc21
-rw-r--r--sql/sql_derived.h12
-rw-r--r--sql/sql_error.cc26
-rw-r--r--sql/sql_error.h43
-rw-r--r--sql/sql_handler.cc40
-rw-r--r--sql/sql_handler.h2
-rw-r--r--sql/sql_help.cc14
-rw-r--r--sql/sql_insert.cc278
-rw-r--r--sql/sql_lex.cc8
-rw-r--r--sql/sql_lex.h82
-rw-r--r--sql/sql_load.cc110
-rw-r--r--sql/sql_parse.cc569
-rw-r--r--sql/sql_parse.h9
-rw-r--r--sql/sql_partition.cc480
-rw-r--r--sql/sql_partition.h8
-rw-r--r--sql/sql_partition_admin.cc99
-rw-r--r--sql/sql_partition_admin.h6
-rw-r--r--sql/sql_plist.h16
-rw-r--r--sql/sql_plugin.cc89
-rw-r--r--sql/sql_plugin.h10
-rw-r--r--sql/sql_prepare.cc102
-rw-r--r--sql/sql_priv.h39
-rw-r--r--sql/sql_reload.cc85
-rw-r--r--sql/sql_reload.h2
-rw-r--r--sql/sql_rename.cc14
-rw-r--r--sql/sql_repl.cc55
-rw-r--r--sql/sql_repl.h2
-rw-r--r--sql/sql_select.cc604
-rw-r--r--sql/sql_select.h5
-rw-r--r--sql/sql_show.cc692
-rw-r--r--sql/sql_show.h1
-rw-r--r--sql/sql_string.cc45
-rw-r--r--sql/sql_string.h31
-rw-r--r--sql/sql_table.cc549
-rw-r--r--sql/sql_table.h11
-rw-r--r--sql/sql_trigger.cc208
-rw-r--r--sql/sql_trigger.h39
-rw-r--r--sql/sql_truncate.cc495
-rw-r--r--sql/sql_truncate.h23
-rw-r--r--sql/sql_udf.cc12
-rw-r--r--sql/sql_union.cc10
-rw-r--r--sql/sql_update.cc235
-rw-r--r--sql/sql_update.h3
-rw-r--r--sql/sql_view.cc59
-rw-r--r--sql/sql_yacc.yy166
-rw-r--r--sql/strfunc.cc4
-rw-r--r--sql/sys_vars.cc130
-rw-r--r--sql/sys_vars.h67
-rw-r--r--sql/table.cc208
-rw-r--r--sql/table.h26
-rw-r--r--sql/transaction.cc88
-rw-r--r--sql/unireg.cc18
-rw-r--r--sql/unireg.h4
-rw-r--r--storage/Makefile.am22
-rw-r--r--storage/archive/Makefile.am104
-rw-r--r--storage/archive/azio.c9
-rw-r--r--storage/archive/ha_archive.cc38
-rw-r--r--storage/archive/ha_archive.h4
-rw-r--r--storage/archive/plug.in4
-rw-r--r--storage/blackhole/Makefile.am83
-rw-r--r--storage/blackhole/ha_blackhole.cc10
-rw-r--r--storage/blackhole/ha_blackhole.h1
-rw-r--r--storage/blackhole/plug.in6
-rw-r--r--storage/csv/Makefile.am64
-rw-r--r--storage/csv/ha_tina.h3
-rw-r--r--storage/csv/plug.in5
-rw-r--r--storage/example/Makefile.am82
-rw-r--r--storage/example/ha_example.cc95
-rw-r--r--storage/example/ha_example.h1
-rw-r--r--storage/example/plug.in3
-rw-r--r--storage/federated/Makefile.am84
-rw-r--r--storage/federated/ha_federated.cc10
-rw-r--r--storage/federated/ha_federated.h4
-rw-r--r--storage/federated/plug.in5
-rw-r--r--storage/federatedx/plug.in5
-rw-r--r--storage/heap/Makefile.am73
-rw-r--r--storage/heap/ha_heap.cc11
-rw-r--r--storage/heap/ha_heap.h3
-rw-r--r--storage/heap/heapdef.h7
-rw-r--r--storage/heap/hp_block.c2
-rw-r--r--storage/heap/hp_create.c4
-rw-r--r--storage/heap/hp_delete.c2
-rw-r--r--storage/heap/hp_open.c2
-rw-r--r--storage/heap/hp_static.c4
-rw-r--r--storage/heap/hp_test2.c8
-rw-r--r--storage/heap/plug.in7
-rw-r--r--storage/ibmdb2i/CMakeLists.txt39
-rw-r--r--storage/ibmdb2i/Makefile.am52
-rw-r--r--storage/ibmdb2i/db2i_blobCollection.cc107
-rw-r--r--storage/ibmdb2i/db2i_blobCollection.h151
-rw-r--r--storage/ibmdb2i/db2i_charsetSupport.cc826
-rw-r--r--storage/ibmdb2i/db2i_charsetSupport.h65
-rw-r--r--storage/ibmdb2i/db2i_collationSupport.cc355
-rw-r--r--storage/ibmdb2i/db2i_collationSupport.h48
-rw-r--r--storage/ibmdb2i/db2i_constraints.cc672
-rw-r--r--storage/ibmdb2i/db2i_conversion.cc1459
-rw-r--r--storage/ibmdb2i/db2i_errors.cc297
-rw-r--r--storage/ibmdb2i/db2i_errors.h93
-rw-r--r--storage/ibmdb2i/db2i_file.cc553
-rw-r--r--storage/ibmdb2i/db2i_file.h446
-rw-r--r--storage/ibmdb2i/db2i_global.h138
-rw-r--r--storage/ibmdb2i/db2i_iconv.h51
-rw-r--r--storage/ibmdb2i/db2i_ileBridge.cc1342
-rw-r--r--storage/ibmdb2i/db2i_ileBridge.h499
-rw-r--r--storage/ibmdb2i/db2i_ioBuffers.cc332
-rw-r--r--storage/ibmdb2i/db2i_ioBuffers.h416
-rw-r--r--storage/ibmdb2i/db2i_misc.h129
-rw-r--r--storage/ibmdb2i/db2i_myconv.cc1498
-rw-r--r--storage/ibmdb2i/db2i_myconv.h3201
-rw-r--r--storage/ibmdb2i/db2i_rir.cc686
-rw-r--r--storage/ibmdb2i/db2i_safeString.h98
-rw-r--r--storage/ibmdb2i/db2i_sqlStatementStream.cc86
-rw-r--r--storage/ibmdb2i/db2i_sqlStatementStream.h151
-rw-r--r--storage/ibmdb2i/db2i_validatedPointer.h162
-rw-r--r--storage/ibmdb2i/ha_ibmdb2i.cc3374
-rw-r--r--storage/ibmdb2i/ha_ibmdb2i.h822
-rw-r--r--storage/ibmdb2i/plug.in12
-rw-r--r--storage/innobase/CMakeLists.txt60
-rw-r--r--storage/innobase/COPYING351
-rw-r--r--storage/innobase/COPYING.Sun_Microsystems31
-rw-r--r--storage/innobase/Doxyfile2
-rw-r--r--storage/innobase/Makefile.am339
-rw-r--r--storage/innobase/btr/btr0btr.c578
-rw-r--r--storage/innobase/btr/btr0cur.c645
-rw-r--r--storage/innobase/btr/btr0sea.c6
-rw-r--r--storage/innobase/buf/buf0buddy.c4
-rw-r--r--storage/innobase/buf/buf0buf.c598
-rw-r--r--storage/innobase/buf/buf0flu.c135
-rw-r--r--storage/innobase/buf/buf0lru.c157
-rw-r--r--storage/innobase/buf/buf0rea.c21
-rwxr-xr-xstorage/innobase/compile-innodb2
-rw-r--r--storage/innobase/data/data0data.c8
-rw-r--r--storage/innobase/dict/dict0crea.c17
-rw-r--r--storage/innobase/dict/dict0dict.c369
-rw-r--r--storage/innobase/dict/dict0load.c162
-rw-r--r--storage/innobase/dict/dict0mem.c65
-rw-r--r--storage/innobase/fil/fil0fil.c135
-rw-r--r--storage/innobase/fsp/fsp0fsp.c60
-rw-r--r--storage/innobase/handler/ha_innodb.cc1533
-rw-r--r--storage/innobase/handler/ha_innodb.h23
-rw-r--r--storage/innobase/handler/handler0alter.cc362
-rw-r--r--storage/innobase/handler/i_s.cc1655
-rw-r--r--storage/innobase/handler/i_s.h9
-rw-r--r--storage/innobase/handler/mysql_addons.cc42
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.c979
-rw-r--r--storage/innobase/include/btr0btr.h134
-rw-r--r--storage/innobase/include/btr0btr.ic38
-rw-r--r--storage/innobase/include/btr0cur.h107
-rw-r--r--storage/innobase/include/btr0pcur.h40
-rw-r--r--storage/innobase/include/btr0pcur.ic45
-rw-r--r--storage/innobase/include/btr0types.h125
-rw-r--r--storage/innobase/include/buf0buddy.h2
-rw-r--r--storage/innobase/include/buf0buddy.ic4
-rw-r--r--storage/innobase/include/buf0buf.h161
-rw-r--r--storage/innobase/include/buf0buf.ic77
-rw-r--r--storage/innobase/include/buf0flu.h32
-rw-r--r--storage/innobase/include/buf0lru.h12
-rw-r--r--storage/innobase/include/buf0rea.h8
-rw-r--r--storage/innobase/include/data0data.h11
-rw-r--r--storage/innobase/include/data0data.ic22
-rw-r--r--storage/innobase/include/data0type.h9
-rw-r--r--storage/innobase/include/db0err.h14
-rw-r--r--storage/innobase/include/dict0dict.h68
-rw-r--r--storage/innobase/include/dict0dict.ic56
-rw-r--r--storage/innobase/include/dict0load.h12
-rw-r--r--storage/innobase/include/dict0mem.h91
-rw-r--r--storage/innobase/include/dict0types.h19
-rw-r--r--storage/innobase/include/fil0fil.h8
-rw-r--r--storage/innobase/include/ha_prototypes.h20
-rw-r--r--storage/innobase/include/ibuf0ibuf.h78
-rw-r--r--storage/innobase/include/ibuf0ibuf.ic40
-rw-r--r--storage/innobase/include/lock0lock.h7
-rw-r--r--storage/innobase/include/lock0lock.ic6
-rw-r--r--storage/innobase/include/log0log.ic2
-rw-r--r--storage/innobase/include/mem0mem.ic12
-rw-r--r--storage/innobase/include/mtr0mtr.h14
-rw-r--r--storage/innobase/include/mtr0mtr.ic15
-rw-r--r--storage/innobase/include/mysql_addons.h33
-rw-r--r--storage/innobase/include/os0file.h2
-rw-r--r--storage/innobase/include/os0sync.h27
-rw-r--r--storage/innobase/include/os0thread.h33
-rw-r--r--storage/innobase/include/page0page.h27
-rw-r--r--storage/innobase/include/page0page.ic23
-rw-r--r--storage/innobase/include/page0zip.h2
-rw-r--r--storage/innobase/include/rem0cmp.h4
-rw-r--r--storage/innobase/include/rem0cmp.ic2
-rw-r--r--storage/innobase/include/rem0rec.h31
-rw-r--r--storage/innobase/include/rem0rec.ic51
-rw-r--r--storage/innobase/include/rem0types.h20
-rw-r--r--storage/innobase/include/row0ext.h13
-rw-r--r--storage/innobase/include/row0ext.ic9
-rw-r--r--storage/innobase/include/row0ins.h5
-rw-r--r--storage/innobase/include/row0mysql.h4
-rw-r--r--storage/innobase/include/row0row.h32
-rw-r--r--storage/innobase/include/row0row.ic36
-rw-r--r--storage/innobase/include/row0upd.h45
-rw-r--r--storage/innobase/include/srv0srv.h65
-rw-r--r--storage/innobase/include/sync0arr.h7
-rw-r--r--storage/innobase/include/sync0rw.h4
-rw-r--r--storage/innobase/include/sync0sync.h43
-rw-r--r--storage/innobase/include/thr0loc.h90
-rw-r--r--storage/innobase/include/thr0loc.ic24
-rw-r--r--storage/innobase/include/trx0i_s.h3
-rw-r--r--storage/innobase/include/trx0purge.h22
-rw-r--r--storage/innobase/include/trx0rseg.h16
-rw-r--r--storage/innobase/include/trx0sys.h10
-rw-r--r--storage/innobase/include/trx0sys.ic12
-rw-r--r--storage/innobase/include/trx0trx.h37
-rw-r--r--storage/innobase/include/trx0undo.h11
-rw-r--r--storage/innobase/include/univ.i77
-rw-r--r--storage/innobase/include/ut0auxconf.h14
-rw-r--r--storage/innobase/include/ut0bh.h152
-rw-r--r--storage/innobase/include/ut0bh.ic125
-rw-r--r--storage/innobase/include/ut0dbg.h7
-rw-r--r--storage/innobase/include/ut0rbt.h2
-rw-r--r--storage/innobase/include/ut0ut.h29
-rw-r--r--storage/innobase/include/ut0vec.h19
-rw-r--r--storage/innobase/include/ut0vec.ic29
-rw-r--r--storage/innobase/lock/lock0lock.c233
-rw-r--r--storage/innobase/log/log0log.c107
-rw-r--r--storage/innobase/log/log0recv.c6
-rw-r--r--storage/innobase/mem/mem0dbg.c15
-rw-r--r--storage/innobase/mem/mem0mem.c2
-rw-r--r--storage/innobase/mtr/mtr0log.c2
-rw-r--r--storage/innobase/mtr/mtr0mtr.c14
-rw-r--r--storage/innobase/mysql-test/patches/README30
-rw-r--r--storage/innobase/mysql-test/patches/index_merge_innodb-explain.diff31
-rw-r--r--storage/innobase/mysql-test/patches/information_schema.diff124
-rw-r--r--storage/innobase/mysql-test/patches/innodb_change_buffering_basic.diff60
-rw-r--r--storage/innobase/mysql-test/patches/innodb_file_per_table.diff47
-rw-r--r--storage/innobase/mysql-test/patches/innodb_lock_wait_timeout.diff55
-rw-r--r--storage/innobase/mysql-test/patches/innodb_thread_concurrency_basic.diff31
-rw-r--r--storage/innobase/mysql-test/patches/partition_innodb.diff59
-rw-r--r--storage/innobase/os/os0file.c295
-rw-r--r--storage/innobase/os/os0sync.c211
-rw-r--r--storage/innobase/os/os0thread.c93
-rw-r--r--storage/innobase/page/page0cur.c10
-rw-r--r--storage/innobase/page/page0page.c131
-rw-r--r--storage/innobase/page/page0zip.c26
-rw-r--r--storage/innobase/plug.in233
-rw-r--r--storage/innobase/rem/rem0cmp.c14
-rw-r--r--storage/innobase/rem/rem0rec.c8
-rw-r--r--storage/innobase/row/row0ext.c19
-rw-r--r--storage/innobase/row/row0ins.c13
-rw-r--r--storage/innobase/row/row0merge.c76
-rw-r--r--storage/innobase/row/row0mysql.c85
-rw-r--r--storage/innobase/row/row0purge.c68
-rw-r--r--storage/innobase/row/row0row.c48
-rw-r--r--storage/innobase/row/row0sel.c148
-rw-r--r--storage/innobase/row/row0umod.c44
-rw-r--r--storage/innobase/row/row0upd.c403
-rw-r--r--storage/innobase/row/row0vers.c28
-rw-r--r--storage/innobase/srv/srv0srv.c408
-rw-r--r--storage/innobase/srv/srv0start.c475
-rw-r--r--storage/innobase/sync/sync0arr.c73
-rw-r--r--storage/innobase/sync/sync0rw.c35
-rw-r--r--storage/innobase/sync/sync0sync.c450
-rw-r--r--storage/innobase/thr/thr0loc.c285
-rw-r--r--storage/innobase/trx/trx0i_s.c61
-rw-r--r--storage/innobase/trx/trx0purge.c399
-rw-r--r--storage/innobase/trx/trx0rec.c64
-rw-r--r--storage/innobase/trx/trx0roll.c8
-rw-r--r--storage/innobase/trx/trx0rseg.c52
-rw-r--r--storage/innobase/trx/trx0sys.c57
-rw-r--r--storage/innobase/trx/trx0trx.c366
-rw-r--r--storage/innobase/trx/trx0undo.c43
-rw-r--r--storage/innobase/ut/ut0auxconf_atomic_pthread_t_gcc.c43
-rw-r--r--storage/innobase/ut/ut0auxconf_atomic_pthread_t_solaris.c54
-rw-r--r--storage/innobase/ut/ut0auxconf_have_gcc_atomics.c61
-rw-r--r--storage/innobase/ut/ut0auxconf_have_solaris_atomics.c39
-rw-r--r--storage/innobase/ut/ut0auxconf_pause.c32
-rw-r--r--storage/innobase/ut/ut0auxconf_sizeof_pthread_t.c35
-rw-r--r--storage/innobase/ut/ut0bh.c164
-rw-r--r--storage/innobase/ut/ut0dbg.c11
-rw-r--r--storage/innobase/ut/ut0ut.c17
-rw-r--r--storage/myisam/Makefile.am169
-rw-r--r--storage/myisam/ft_boolean_search.c2
-rw-r--r--storage/myisam/ft_stopwords.c4
-rwxr-xr-xstorage/myisam/ftbench/Ecompare.pl15
-rwxr-xr-xstorage/myisam/ftbench/Ecreate.pl15
-rwxr-xr-xstorage/myisam/ftbench/Ereport.pl15
-rwxr-xr-xstorage/myisam/ftbench/ft-test-run.sh17
-rw-r--r--storage/myisam/ha_myisam.cc35
-rw-r--r--storage/myisam/ha_myisam.h3
-rw-r--r--storage/myisam/mi_check.c11
-rw-r--r--storage/myisam/mi_close.c2
-rw-r--r--storage/myisam/mi_create.c2
-rw-r--r--storage/myisam/mi_delete.c3
-rw-r--r--storage/myisam/mi_delete_all.c2
-rw-r--r--storage/myisam/mi_dynrec.c5
-rw-r--r--storage/myisam/mi_log.c4
-rw-r--r--storage/myisam/mi_open.c6
-rw-r--r--storage/myisam/mi_static.c2
-rw-r--r--storage/myisam/mi_statrec.c3
-rwxr-xr-xstorage/myisam/mi_test_all.sh18
-rw-r--r--storage/myisam/mi_update.c11
-rw-r--r--storage/myisam/mi_write.c6
-rw-r--r--storage/myisam/myisamchk.c8
-rw-r--r--storage/myisam/myisamdef.h14
-rw-r--r--storage/myisam/myisampack.c2
-rw-r--r--storage/myisam/plug.in7
-rw-r--r--storage/myisam/rt_index.c2
-rw-r--r--storage/myisam/sort.c2
-rw-r--r--storage/myisammrg/Makefile.am62
-rw-r--r--storage/myisammrg/ha_myisammrg.cc47
-rw-r--r--storage/myisammrg/ha_myisammrg.h3
-rw-r--r--storage/myisammrg/myrg_def.h2
-rw-r--r--storage/myisammrg/myrg_open.c8
-rw-r--r--storage/myisammrg/plug.in6
-rw-r--r--storage/ndb/Makefile.am2
-rwxr-xr-xstorage/ndb/config/make-win-dsw.sh14
-rwxr-xr-xstorage/ndb/config/win-includes15
-rwxr-xr-xstorage/ndb/config/win-libraries15
-rwxr-xr-xstorage/ndb/config/win-name15
-rwxr-xr-xstorage/ndb/config/win-sources15
-rw-r--r--storage/ndb/docs/Makefile.am2
-rw-r--r--storage/ndb/docs/doxygen/Doxyfile.mgmapi17
-rw-r--r--storage/ndb/docs/doxygen/Doxyfile.ndb15
-rw-r--r--storage/ndb/docs/doxygen/Doxyfile.ndbapi17
-rw-r--r--storage/ndb/docs/doxygen/Doxyfile.odbc15
-rw-r--r--storage/ndb/docs/doxygen/header.mgmapi.tex44
-rw-r--r--storage/ndb/docs/doxygen/header.ndbapi.tex44
-rwxr-xr-xstorage/ndb/docs/doxygen/postdoxy.pl15
-rwxr-xr-xstorage/ndb/docs/doxygen/predoxy.pl15
-rw-r--r--storage/ndb/ndb_configure.m4349
-rw-r--r--storage/ndb/plug.in2
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/CPC_Form.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/Computer.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/ComputerAddDialog.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/ComputerRemoveDialog.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/Database.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/PanelWizard.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/Process.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/ProcessDefineDialog.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/fileaccess/FileMgmt.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/simpleparser/SimpleCPCParser.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/socketcomm/SocketComm.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/socketcomm/myTcpClient.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/startDatabaseDlg.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/csharp/telnetclient/telnetClient.cs15
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Computer.cls20
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Database.cls18
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Icon 110.icobin766 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Icon 231.icobin766 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Icon 237.icobin766 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Icon 241.icobin766 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Icon 242.icobin766 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Icon 270.icobin766 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Icon 271.icobin766 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Icon 273.icobin766 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Icon 31.icobin766 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Icon 337.icobin766 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Icon 338.icobin766 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Icon 339.icobin766 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/MSSCCPRJ.SCC5
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Module1.bas233
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/NdbCPC.vbp49
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/NdbCPC.vbw13
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/Process.cls22
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/closed folder.icobin10134 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/computer.icobin10134 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/frmAbout.frm245
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/frmLogin.frm119
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/frmMain.frm1207
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/frmNewComputer.frm124
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/frmNewComputer.frxbin4 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase.frxbin12 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase1.frm187
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase2.frm136
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase2.log1
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase3.frm88
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/frmOptions.frm231
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/frmSplash.frxbin70450 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/networking.icobin10134 -> 0 bytes
-rw-r--r--storage/ndb/src/cw/cpcc-win32/vb6/open folder.icobin10134 -> 0 bytes
-rw-r--r--storage/ndb/src/kernel/blocks/lgman.cpp16
-rw-r--r--storage/ndb/src/libndb.ver.in15
-rw-r--r--storage/ndb/src/mgmsrv/InitConfigFileParser.cpp2
-rw-r--r--storage/ndb/test/ndbapi/slow_select.cpp14
-rw-r--r--storage/ndb/test/ndbapi/testBitfield.cpp14
-rw-r--r--storage/ndb/test/ndbapi/testLcp.cpp14
-rw-r--r--storage/ndb/test/ndbnet/test.run15
-rw-r--r--storage/ndb/test/ndbnet/testError.run17
-rw-r--r--storage/ndb/test/ndbnet/testMNF.run17
-rw-r--r--storage/ndb/test/ndbnet/testNR.run15
-rw-r--r--storage/ndb/test/ndbnet/testNR1.run17
-rw-r--r--storage/ndb/test/ndbnet/testNR4.run17
-rw-r--r--storage/ndb/test/ndbnet/testSRhang.run15
-rw-r--r--storage/ndb/test/ndbnet/testTR295.run17
-rw-r--r--storage/ndb/test/run-test/16node-tests.txt15
-rwxr-xr-xstorage/ndb/test/run-test/atrt-analyze-result.sh17
-rwxr-xr-xstorage/ndb/test/run-test/atrt-clear-result.sh17
-rwxr-xr-xstorage/ndb/test/run-test/atrt-gather-result.sh17
-rwxr-xr-xstorage/ndb/test/run-test/atrt-mysql-test-run17
-rwxr-xr-xstorage/ndb/test/run-test/atrt-setup.sh17
-rwxr-xr-xstorage/ndb/test/run-test/atrt-testBackup17
-rw-r--r--storage/ndb/test/run-test/basic.txt15
-rw-r--r--storage/ndb/test/run-test/daily-basic-tests.txt15
-rw-r--r--storage/ndb/test/run-test/daily-devel-tests.txt15
-rwxr-xr-xstorage/ndb/test/run-test/make-config.sh17
-rwxr-xr-xstorage/ndb/test/run-test/make-html-reports.sh17
-rwxr-xr-xstorage/ndb/test/run-test/make-index.sh18
-rwxr-xr-xstorage/ndb/test/run-test/ndb-autotest.sh18
-rw-r--r--storage/ndb/test/run-test/setup.cpp4
-rw-r--r--storage/ndb/test/sql/test_create_drop.pl17
-rw-r--r--storage/ndb/test/sql/test_range_bounds.pl17
-rwxr-xr-xstorage/ndb/tools/clean-links.sh15
-rw-r--r--storage/ndb/tools/make-errors.pl15
-rwxr-xr-xstorage/ndb/tools/make-links.sh15
-rw-r--r--storage/ndb/tools/ndb_error_reporter15
-rwxr-xr-xstorage/ndb/tools/rgrep15
-rw-r--r--storage/perfschema/Makefile.am76
-rw-r--r--storage/perfschema/ha_perfschema.cc40
-rw-r--r--storage/perfschema/ha_perfschema.h7
-rw-r--r--storage/perfschema/pfs_engine_table.cc111
-rw-r--r--storage/perfschema/pfs_global.h16
-rw-r--r--storage/perfschema/pfs_instr.cc25
-rw-r--r--storage/perfschema/pfs_instr.h1
-rw-r--r--storage/perfschema/pfs_instr_class.cc70
-rw-r--r--storage/perfschema/pfs_instr_class.h2
-rw-r--r--storage/perfschema/pfs_lock.h20
-rw-r--r--storage/perfschema/plug.in26
-rw-r--r--storage/perfschema/table_events_waits.cc27
-rw-r--r--storage/perfschema/table_events_waits_summary.cc4
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.cc2
-rw-r--r--storage/perfschema/table_file_instances.cc2
-rw-r--r--storage/perfschema/table_file_summary.cc4
-rw-r--r--storage/perfschema/table_performance_timers.cc2
-rw-r--r--storage/perfschema/table_setup_consumers.cc3
-rw-r--r--storage/perfschema/table_setup_instruments.cc3
-rw-r--r--storage/perfschema/table_setup_timers.cc3
-rw-r--r--storage/perfschema/table_sync_instances.cc6
-rw-r--r--storage/perfschema/table_threads.cc13
-rw-r--r--storage/perfschema/table_threads.h4
-rw-r--r--storage/perfschema/unittest/Makefile.am58
-rw-r--r--storage/perfschema/unittest/pfs-t.cc3
-rw-r--r--storage/perfschema/unittest/pfs_instr-oom-t.cc5
-rw-r--r--storage/perfschema/unittest/pfs_instr-t.cc6
-rw-r--r--storage/perfschema/unittest/pfs_instr_class-oom-t.cc5
-rw-r--r--storage/perfschema/unittest/pfs_instr_class-t.cc6
-rw-r--r--storage/perfschema/unittest/pfs_timer-t.cc4
-rw-r--r--storage/perfschema/unittest/stub_server_misc.h21
-rw-r--r--strings/CHARSET_INFO.txt11
-rw-r--r--strings/Makefile.am80
-rw-r--r--strings/bchange.c2
-rw-r--r--strings/bfill.c41
-rw-r--r--strings/bmove.c48
-rw-r--r--strings/bmove_upp.c2
-rw-r--r--strings/conf_to_src.c4
-rw-r--r--strings/ctype-big5.c2
-rw-r--r--strings/ctype-bin.c2
-rw-r--r--strings/ctype-cp932.c3
-rw-r--r--strings/ctype-czech.c2
-rw-r--r--strings/ctype-euc_kr.c2
-rw-r--r--strings/ctype-eucjpms.c2
-rw-r--r--strings/ctype-extra.c12
-rw-r--r--strings/ctype-gb2312.c2
-rw-r--r--strings/ctype-gbk.c2
-rw-r--r--strings/ctype-latin1.c2
-rw-r--r--strings/ctype-mb.c199
-rw-r--r--strings/ctype-simple.c2
-rw-r--r--strings/ctype-sjis.c2
-rw-r--r--strings/ctype-tis620.c2
-rw-r--r--strings/ctype-uca.c210
-rw-r--r--strings/ctype-ucs2.c368
-rw-r--r--strings/ctype-ujis.c2
-rw-r--r--strings/ctype-utf8.c13
-rw-r--r--strings/ctype-win1250ch.c2
-rw-r--r--strings/ctype.c2
-rw-r--r--strings/decimal.c49
-rw-r--r--strings/do_ctype.c2
-rw-r--r--strings/dtoa.c2
-rw-r--r--strings/dump_map.c2
-rw-r--r--strings/int2str.c2
-rw-r--r--strings/is_prefix.c2
-rw-r--r--strings/llstr.c2
-rw-r--r--strings/longlong2str-x86.s216
-rw-r--r--strings/longlong2str.c2
-rw-r--r--strings/longlong2str_asm.c33
-rw-r--r--strings/my_strchr.c69
-rw-r--r--strings/my_strtoll10-x86.s418
-rw-r--r--strings/my_strtoll10.c2
-rw-r--r--strings/my_vsnprintf.c4
-rw-r--r--strings/str2int.c2
-rw-r--r--strings/str_alloc.c2
-rw-r--r--strings/str_test.c275
-rw-r--r--strings/strappend.c2
-rw-r--r--strings/strcend.c2
-rw-r--r--strings/strcont.c2
-rw-r--r--strings/strend.c2
-rw-r--r--strings/strfill.c2
-rw-r--r--strings/strings-x86.s393
-rw-r--r--strings/strmake.c2
-rw-r--r--strings/strmov.c2
-rw-r--r--strings/strnlen.c2
-rw-r--r--strings/strnmov.c2
-rw-r--r--strings/strstr.c52
-rw-r--r--strings/strto.c209
-rw-r--r--strings/strtol.c28
-rw-r--r--strings/strtoll.c33
-rw-r--r--strings/strtoul.c29
-rw-r--r--strings/strtoull.c34
-rw-r--r--strings/strxmov.c2
-rw-r--r--strings/strxnmov.c2
-rw-r--r--strings/uca-dump.c2
-rw-r--r--strings/uctypedump.c2
-rw-r--r--strings/utr11-dump.c2
-rw-r--r--strings/xml.c32
-rw-r--r--support-files/CMakeLists.txt22
-rw-r--r--support-files/MacOSX/Description.plist.sh16
-rw-r--r--support-files/MacOSX/Info.plist.sh16
-rw-r--r--support-files/MacOSX/Makefile.am54
-rwxr-xr-xsupport-files/MacOSX/MySQLCOM16
-rw-r--r--support-files/MacOSX/StartupItem.Description.plist16
-rw-r--r--support-files/MacOSX/StartupItem.Info.plist16
-rwxr-xr-xsupport-files/MacOSX/StartupItem.postinstall16
-rw-r--r--support-files/MacOSX/StartupParameters.plist.sh16
-rwxr-xr-xsupport-files/MacOSX/mwar-wrapper15
-rwxr-xr-xsupport-files/MacOSX/mwcc-wrapper15
-rw-r--r--support-files/MacOSX/postflight.sh18
-rw-r--r--support-files/MacOSX/preflight.sh18
-rw-r--r--support-files/Makefile.am133
-rw-r--r--support-files/MySQL-shared-compat.spec.sh2
-rw-r--r--support-files/RHEL4-SElinux/Makefile.am20
-rw-r--r--support-files/RHEL4-SElinux/mysql.fc15
-rw-r--r--support-files/RHEL4-SElinux/mysql.te14
-rwxr-xr-xsupport-files/SCO/INSTALL.sh29
-rw-r--r--support-files/SCO/compile.sh102
-rw-r--r--support-files/SCO/doc.sh17
-rw-r--r--support-files/SCO/mkpkg.sh47
-rw-r--r--support-files/SCO/patch96
-rw-r--r--support-files/SCO/pkginfo.ini8
-rw-r--r--support-files/SCO/postinstall30
-rw-r--r--support-files/SCO/preinstall21
-rw-r--r--support-files/SCO/preremove25
-rw-r--r--support-files/SCO/prototype.ini4
-rw-r--r--support-files/SCO/version1
-rw-r--r--support-files/compiler_warnings.supp15
-rw-r--r--support-files/my-huge.cnf.sh18
-rw-r--r--support-files/my-innodb-heavy-4G.cnf.sh18
-rw-r--r--support-files/my-large.cnf.sh18
-rw-r--r--support-files/my-medium.cnf.sh18
-rw-r--r--support-files/my-small.cnf.sh14
-rw-r--r--support-files/mysql.spec.sh112
-rw-r--r--tests/Makefile.am62
-rwxr-xr-xtests/big_record.pl15
-rwxr-xr-xtests/drop_test.pl16
-rwxr-xr-xtests/export.pl15
-rwxr-xr-xtests/fork2_test.pl15
-rwxr-xr-xtests/fork_big.pl16
-rw-r--r--tests/fork_big2.pl16
-rwxr-xr-xtests/grant.pl16
-rwxr-xr-xtests/index_corrupt.pl16
-rwxr-xr-xtests/insert_and_repair.pl16
-rwxr-xr-xtests/lock_test.pl15
-rw-r--r--tests/mysql_client_test.c572
-rwxr-xr-xtests/pmail.pl16
-rwxr-xr-xtests/rename_test.pl16
-rwxr-xr-xtests/table_types.pl16
-rwxr-xr-xtests/test_delayed_insert.pl15
-rw-r--r--tests/thread_test.c10
-rwxr-xr-xtests/truncate.pl16
-rw-r--r--unittest/Makefile.am27
-rw-r--r--unittest/examples/Makefile.am24
-rw-r--r--unittest/examples/skip-t.c8
-rw-r--r--unittest/examples/skip_all-t.c8
-rw-r--r--unittest/examples/todo-t.c8
-rw-r--r--unittest/mysys/CMakeLists.txt2
-rw-r--r--unittest/mysys/Makefile.am37
-rw-r--r--unittest/mysys/bitmap-t.c175
-rw-r--r--unittest/mysys/lf-t.c37
-rw-r--r--unittest/mysys/my_vsnprintf-t.c5
-rw-r--r--unittest/mytap/Makefile.am25
-rw-r--r--unittest/mytap/t/Makefile.am22
-rw-r--r--unittest/mytap/t/basic-t.c2
-rw-r--r--unittest/mytap/tap.c17
-rw-r--r--unittest/mytap/tap.h15
-rw-r--r--unittest/strings/Makefile.am27
-rw-r--r--unittest/unit.pl32
-rw-r--r--vio/Makefile.am25
-rw-r--r--vio/test-ssl.c9
-rw-r--r--vio/test-sslclient.c8
-rw-r--r--vio/test-sslserver.c3
-rw-r--r--vio/viosocket.c66
-rw-r--r--vio/viossl.c27
-rw-r--r--vio/viosslfactories.c7
-rw-r--r--vio/viotest-ssl.c9
-rw-r--r--win/Makefile.am19
-rw-r--r--win/README102
-rw-r--r--win/build-nmake-x64.bat21
-rw-r--r--win/build-nmake.bat21
-rwxr-xr-xwin/build-vs71.bat22
-rwxr-xr-xwin/build-vs8.bat21
-rwxr-xr-xwin/build-vs8_x64.bat21
-rw-r--r--win/build-vs9.bat18
-rw-r--r--win/build-vs9_x64.bat18
-rw-r--r--win/configure.js346
-rwxr-xr-xwin/create_manifest.js96
-rw-r--r--win/mysql_manifest.cmake21
-rw-r--r--zlib/Makefile.am35
3248 files changed, 101047 insertions, 428609 deletions
diff --git a/.bzrignore b/.bzrignore
index 2d456674c00..adee0206a43 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -11,6 +11,7 @@
*.dir/
*.dll
*.dsp
+*.dylib
*.exe
*.exp
*.gcda
@@ -22,6 +23,7 @@
*.lai
*.lib
*.lo
+*.manifest
*.map
*.o
*.obj
@@ -32,6 +34,7 @@
*.Po
*.reject
*.res
+*.rule
*.sbr
*.so
*.so.*
@@ -40,7 +43,12 @@
*.user
*.vcproj
*.vcproj.cmake
-*/*_pure_*warnings
+*.vcxproj
+*.vcxproj.filters
+Debug
+MySql.sdf
+Win32
+RelWithDebInfo
*~
.*.swp
./CMakeCache.txt
@@ -55,23 +63,16 @@
.defs.mk
.depend
.depend.mk
-.deps
.DS_Store
.gdb_history
.gdbinit
-.libs
.o
.out
.snprj/*
.vimrc
ac_available_languages_fragment
-acinclude.m4
-aclocal.m4
-autom4te-2.53.cache/*
-autom4te.cache/*
BitKeeper/
client/*.ds?
-client/.libs -prune
client/completion_hash.cpp
client/decimal.c
client/dtoa.c
@@ -137,16 +138,7 @@ comments
comon.h
comp_err/*.ds?
compile
-config.cache
-config.guess
config.h
-config.h.in
-config.log
-config.status
-config.sub
-configure
-configure.am
-configure.lineno
contrib/*.ds?
COPYING
COPYING.LIB
@@ -216,7 +208,9 @@ include/mysql_h.ic
include/mysql_version.h
include/mysqld_ername.h
include/mysqld_error.h
+include/mysqld_error.h.rule
include/openssl
+include/probes_mysql_dtrace.h
include/readline
include/readline/*.h
include/readline/readline.h
@@ -246,7 +240,6 @@ libmysql/release/libmysql.exp
libmysql/vio_priv.h
libmysql/viosocket.o.6WmSJk
libmysql_r/*.c
-libmysql_r/acconfig.h
libmysql_r/client_settings.h
libmysql_r/conf_to_src
libmysql_r/link_sources
@@ -557,7 +550,9 @@ scripts/mysql_find_rows
scripts/mysql_fix_extensions
scripts/mysql_fix_privilege_tables
scripts/mysql_fix_privilege_tables.sql
+scripts/mysql_fix_privilege_tables.sql.rule
scripts/mysql_fix_privilege_tables_sql.c
+scripts/mysql_fix_privilege_tables_sql.c.rule
scripts/mysql_install_db
scripts/mysql_secure_installation
scripts/mysql_setpermission
@@ -609,6 +604,7 @@ sql/client_plugin.c
sql/Doxyfile
sql/gen_lex_hash
sql/lex_hash.h
+sql/lex_hash.h.rule
sql/link_sources
sql/message.h
sql/message.mc
@@ -630,6 +626,7 @@ sql/share/*/*.sys
sql/sql_builtin.cc
sql/sql_yacc.cc
sql/sql_yacc.h
+sql/sql_yacc.h.rule
sql/sql_yacc.output
sql_error.cc
sql_prepare.cc
@@ -812,7 +809,6 @@ storage/ndb/bin/testTimeout
storage/ndb/bin/testTransactions
storage/ndb/bin/verify_index
storage/ndb/bin/waiter
-storage/ndb/config/autom4te.cache/*
storage/ndb/config/config.mk
storage/ndb/examples/ndbapi_example1/ndbapi_example1
storage/ndb/examples/ndbapi_example2/ndbapi_example2
@@ -932,8 +928,6 @@ storage/ndb/tools/ndb_show_tables
storage/ndb/tools/ndb_test_platform
storage/ndb/tools/ndb_waiter
storage/pbxt/bin/xtstat
-storage/xtradb/autom4te-2.53.cache/*
-storage/xtradb/autom4te.cache/*
storage/xtradb/configure.lineno
storage/xtradb/conftest.s1
storage/xtradb/conftest.subs
@@ -1028,7 +1022,6 @@ test1/*
test?.MA?
test_xml
tests/*.ds?
-tests/.libs -prune
tests/bug25714
tests/client_test
tests/connect_test
@@ -1038,7 +1031,6 @@ thr_test/*
thread_test
tmp
tmp/*
-tools/.libs -prune
tools/my_vsnprintf.c
tools/mysqlmanager
tools/mysqlmngd
@@ -1072,5 +1064,6 @@ vio/viotest.cpp
win/configure.data
win/vs71cache.txt
win/vs8cache.txt
+win/nmake_cache.txt
ylwrap
zlib/*.ds?
diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh
index 32c9f82beb4..3c30485ec5e 100644
--- a/BUILD/FINISH.sh
+++ b/BUILD/FINISH.sh
@@ -1,11 +1,27 @@
+# Copyright (C) 2000, 2005 MySQL AB, 2008 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
cflags="$c_warnings $extra_flags $EXTRA_FLAGS $EXTRA_CFLAGS"
cxxflags="$cxx_warnings $base_cxxflags $extra_flags $EXTRA_FLAGS $EXTRA_CXXFLAGS"
extra_configs="$extra_configs $local_infile_configs $EXTRA_CONFIGS"
configure="./configure $base_configs $extra_configs"
commands="\
-$make -k maintainer-clean || true
-/bin/rm -rf */.deps/*.P configure config.cache storage/*/configure storage/*/config.cache autom4te.cache storage/*/autom4te.cache;
+/bin/rm -rf configure;
/bin/rm -rf CMakeCache.txt CMakeFiles/
path=`dirname $0`
diff --git a/BUILD/Makefile.am b/BUILD/Makefile.am
deleted file mode 100644
index 0fa49e2862f..00000000000
--- a/BUILD/Makefile.am
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright (C) 2002, 2004-2005 MySQL AB
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-## Process this file with automake to create Makefile.in
-
-EXTRA_DIST = FINISH.sh \
- SETUP.sh \
- autorun.sh \
- cmake_configure.sh \
- build_mccge.sh \
- check-cpu \
- cleanup \
- compile-alpha \
- compile-alpha-debug \
- compile-amd64-debug-max \
- compile-amd64-debug-max-no-ndb \
- compile-amd64-gcov \
- compile-amd64-gprof \
- compile-amd64-max \
- compile-amd64-max-sci \
- compile-amd64-valgrind-max \
- compile-bintar \
- compile-darwin-mwcc \
- compile-dist \
- compile-hpux11-parisc2-aCC \
- compile-ia64-debug-max \
- compile-irix-mips64-mipspro \
- compile-pentium \
- compile-pentium-debug \
- compile-pentium-debug-max \
- compile-pentium-debug-max-no-embedded \
- compile-pentium-debug-max-no-ndb \
- compile-pentium-debug-openssl \
- compile-pentium-debug-yassl \
- compile-pentium-gcov \
- compile-pentium-gprof \
- compile-pentium-icc \
- compile-pentium-icc-valgrind-max \
- compile-pentium-icc-yassl \
- compile-pentium-max \
- compile-pentium-myodbc \
- compile-pentium-pgcc \
- compile-pentium-valgrind-max \
- compile-pentium64 \
- compile-pentium64-debug \
- compile-pentium64-debug-max \
- compile-pentium64-gcov \
- compile-pentium64-gprof \
- compile-pentium64-max \
- compile-pentium64-max-sci \
- compile-pentium64-valgrind-max \
- compile-ppc \
- compile-ppc-debug \
- compile-ppc-debug-max \
- compile-ppc-debug-max-no-ndb \
- compile-ppc-max \
- compile-solaris-amd64 \
- compile-solaris-amd64-debug \
- compile-solaris-amd64-debug-forte \
- compile-solaris-amd64-forte \
- compile-solaris-sparc \
- compile-solaris-sparc-debug \
- compile-solaris-sparc-forte \
- compile-solaris-sparc-purify \
- compile-solaris-x86-32 \
- compile-solaris-x86-32-debug \
- compile-solaris-x86-32-debug-forte \
- compile-solaris-x86-forte-32 \
- util.sh
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 2744545e138..e0d8dad060f 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -1,5 +1,22 @@
#!/bin/sh
+# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
########################################################################
get_key_value()
@@ -14,6 +31,7 @@ Usage: $0 [-h|-n] [configure-options]
-h, --help Show this help message.
-n, --just-print Don't actually run any commands; just print them.
-c, --just-configure Stop after running configure.
+ --with-debug=full Build with full debug(no optimizations, keep call stack).
--warning-mode=[old|pedantic|maintainer]
Influences the debug flags. Old is default.
--prefix=path Build with prefix 'path'.
@@ -29,6 +47,8 @@ parse_options()
case "$1" in
--prefix=*)
prefix=`get_key_value "$1"`;;
+ --with-debug=full)
+ full_debug="=full";;
--warning-mode=*)
warning_mode=`get_key_value "$1"`;;
--extra-flags=*)
@@ -67,6 +87,7 @@ just_print=
just_configure=
warning_mode=
maintainer_mode=
+full_debug=
parse_options "$@"
@@ -119,7 +140,7 @@ else
# C++ warnings
cxx_warnings="$warnings -Wno-unused-parameter"
# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo"
- cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
+ cxx_warnings="$cxx_warnings -Wnon-virtual-dtor"
debug_extra_cflags="-O0 -g3 -gdwarf-2"
fi
@@ -145,7 +166,11 @@ base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
fast_cflags="-O3 -fno-omit-frame-pointer"
debug_configs="--with-debug"
-debug_cflags="$debug_cflags $debug_extra_cflags"
+if [ -z "$full_debug" ]
+then
+ debug_cflags="$debug_cflags $debug_extra_cflags"
+fi
+
static_link="--with-mysqld-ldflags=-all-static "
static_link="$static_link --with-client-ldflags=-all-static"
@@ -237,7 +262,7 @@ gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov"
gcov_link_flags="-fprofile-arcs -ftest-coverage"
-gcov_configs="--disable-shared"
+gcov_configs="--with-gcov"
# gprof
diff --git a/BUILD/autorun.sh b/BUILD/autorun.sh
index f4508ab12b6..e9d92c4ebae 100755
--- a/BUILD/autorun.sh
+++ b/BUILD/autorun.sh
@@ -1,38 +1,27 @@
#!/bin/sh
-# Create MySQL autotools infrastructure
-die() { echo "$@"; exit 1; }
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
+# Create MySQL cmake configure wrapper
-# Handle "glibtoolize" (e.g., for native OS X autotools) as another
-# name for "libtoolize". Use the first one, either name, found in PATH.
-LIBTOOLIZE=libtoolize # Default
-IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
-for dir in $PATH
-do
- if test -x $dir/glibtoolize
- then
- LIBTOOLIZE=glibtoolize
- break
- elif test -x $dir/libtoolize
- then
- break
- fi
-done
-IFS="$save_ifs"
+die() { echo "$@"; exit 1; }
-rm -rf configure
-aclocal || die "Can't execute aclocal"
-autoheader || die "Can't execute autoheader"
-# --force means overwrite ltmain.sh script if it already exists
-$LIBTOOLIZE --automake --force --copy || die "Can't execute libtoolize"
-
-# --add-missing instructs automake to install missing auxiliary files
-# and --force to overwrite them if they already exist
-automake --add-missing --force --copy || die "Can't execute automake"
-autoconf || die "Can't execute autoconf"
-# Do not use autotools generated configure directly. Instead, use a script
-# that will either call CMake or original configure shell script at build
-# time (CMake is preferred if installed).
-mv configure configure.am
-cp BUILD/cmake_configure.sh configure
-chmod a+x configure
+# Use a configure script that will call CMake.
+path=`dirname $0`
+cp $path/cmake_configure.sh $path/../configure
+chmod +x $path/../configure
diff --git a/BUILD/build_mccge.sh b/BUILD/build_mccge.sh
index f29a2f1db34..9791ac04f22 100755
--- a/BUILD/build_mccge.sh
+++ b/BUILD/build_mccge.sh
@@ -1,5 +1,22 @@
#!/bin/sh
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
die()
{
echo "ERROR: $@"; exit 1;
@@ -42,9 +59,7 @@ cat <<EOF
Options used with this script always override any default behaviour.
The default package is MySQL Cluster Carrier Grade (standard) Edition.
For developers, the default package is MySQL Cluster Carrier Grade
- Extended Edition, and the default build behaviour is to build with
- autotools. If you want to skip autotools and start from a source code
- release you can use the --no-autotools flag.
+ Extended Edition.
More information for developers can be found in --help,
--sysadmin-help, and --extended-help.
@@ -102,7 +117,8 @@ cat <<EOF
If your building on a Solaris SPARC machine and you want to compile
using SunStudio you must set
--compiler=forte; if you want to build using the Intel compiler on
- Linux, you need to set --compiler=icc.
+ Linux, you need to set --compiler=icc. If you want to use the AMD
+ compiler Open64 set --compiler=open64.
A synonym for forte is SunStudio, so one can also use
--compiler=SunStudio.
@@ -150,14 +166,32 @@ Usage: $0 [options]
--without-debug Build non-debug version
--use-comment Set the comment in the build
--with-fast-mutexes Use try/retry method of acquiring mutex
+ --without-fast-mutexes Don't use try/retry method of acquiring mutex
+ --without-perfschema Don't build with performance schema
+ --generate-feedback path Compile with feedback using the specified directory
+ to store the feedback files
+ --use-feedback path Compile using feedback information from the specified
+ directory
--with-debug Build debug version
+ --extra-debug-flag flag Add -Dflag to compiler flags
+ InnoDB supports the following debug flags,
+ UNIV_DEBUG, UNIV_SYNC_DEBUG, UNIV_MEM_DEBUG,
+ UNIV_DEBUG_THREAD_CREATION, UNIV_DEBUG_LOCK_VALIDATE,
+ UNIV_DEBUG_PRINT, UNIV_DEBUG_FILE_ACCESS,
+ UNIV_LIGHT_MEM_DEBUG, UNIV_LOG_DEBUG,
+ UNIV_IBUF_COUNT_DEBUG, UNIV_SEARCH_DEBUG,
+ UNIV_LOG_LSN_DEBUG, UNIV_ZIP_DEBUG, UNIV_AHI_DEBUG,
+ UNIV_DEBUG_VALGRIND, UNIV_SQL_DEBUG, UNIV_AIO_DEBUG,
+ UNIV_BTR_DEBUG, UNIV_LRU_DEBUG, UNIV_BUF_DEBUG,
+ UNIV_HASH_DEBUG, UNIV_LIST_DEBUG, UNIV_IBUF_DEBUG
--with-link-time-optimizer
Link time optimizations enabled (Requires GCC 4.5
if GCC used), available for icc as well. This flag
is only considered if also fast is set.
+ --with-mso Special flag used by Open64 compiler (requres at
+ least version 4.2.3) that enables optimisations
+ for multi-core scalability.
--configure-only Stop after running configure.
- --use-autotools Start by running autoconf, automake,.. tools
- --no-autotools Start from configure
--print-only Print commands that the script will execute,
but do not actually execute
--prefix=path Build with prefix 'path'
@@ -170,7 +204,7 @@ Usage: $0 [options]
MySQL use
--commercial Use commercial libraries
--gpl Use gpl libraries
- --compiler=[gcc|icc|forte|SunStudio] Select compiler
+ --compiler=[gcc|icc|forte|SunStudio|open64] Select compiler
--cpu=[x86|x86_64|sparc|itanium] Select CPU type
x86 => x86 and 32-bit binary
x86_64 => x86 and 64 bit binary
@@ -259,7 +293,8 @@ extended_usage()
version string suffix: [none]
All packages except Classic include support for user-defined
- partitioning.
+ partitioning. All packages include support for Performance
+ Schema.
If --with-debug is used, an additional "-debug" is appended to the
version string.
@@ -389,7 +424,8 @@ extended_usage()
platforms supported by this script.
The --fast option adds -mtune=cpu_arg to the C/C++ flags (provides
- support for Nocona, K8, and other processors).
+ support for Nocona, K8, and other processors), this option is valid
+ when gcc is the compiler.
Use of the --debug option adds -g to the C/C++ flags.
@@ -397,10 +433,35 @@ extended_usage()
by calling the script as follows:
CC="/usr/local/bin/gcc" CXX="/usr/local/bin/gcc" BUILD/build_mccge.sh
- FreeBSD/x86/gcc
- ---------------
- No flags are used. Instead, configure determines the proper flags to
- use.
+ Feedback profiler on gcc
+ ------------------------
+ Using gcc --generate-feedback=path causes the following flags to be added
+ to the compiler flags.
+
+ --fprofile-generate
+ --fprofile-dir=path
+
+ Using gcc with --use-feedback=path causes the following flags to be added
+ to the compiler flags. --fprofile-correction indicates MySQL is a multi-
+ threaded application and thus counters can be inconsistent with each other
+ and the compiler should take this into account.
+
+ --fprofile-use
+ --fprofile-dir=path
+ --fprofile-correction
+
+ Feedback compilation using Open64
+ ---------------------------------
+
+ Using Open64 with --generate-feedback=path causes the following flags to
+ be added to the compiler flags.
+
+ -fb-create path/feedback
+
+ Using Open64 with --use-feedback=path causes the following flags to be
+ added to the compiler flags.
+
+ --fb-opt path/feedback
Linux/x86+Itanium/gcc
-------------
@@ -410,6 +471,9 @@ extended_usage()
added to the C/C++ flags. (To build a 32-bit binary on a 64-bit CPU,
use the --32 option as described previously.)
+ When gcc 4.5 is used and the user set --with-link-time-optimizer then
+ also --flto is added to compiler flags and linker flags.
+
Linux/x86+Itanium/icc
-------------
Flags used:
@@ -433,6 +497,19 @@ extended_usage()
added to the C/C++ flags; this provides optimisations specific to Core
2 Duo. This is added only when the --fast flag is set.
+ Linux/x86/Open64
+ ----------------
+ For normal builds use -O3, when fast flag is set one also adds
+ --march=auto to generate optimized builds for the CPU used. If
+ --with-link-time-optimizer is set also -ipa is set. There is also
+ a special flag --with-mso which can be set to get --mso set which
+ activates optimisation for multi-core scalability.
+
+ FreeBSD/x86/gcc
+ ---------------
+ No flags are used. Instead, configure determines the proper flags to
+ use.
+
Solaris/x86/gcc
---------------
All builds on Solaris are by default 64-bit, so -m64 is always used in
@@ -653,6 +730,9 @@ parse_compiler()
forte | SunStudio | sunstudio )
compiler="forte"
;;
+ open64 | Open64 )
+ compiler="open64"
+ ;;
*)
echo "Unknown compiler '$compiler'"
exit 1
@@ -686,6 +766,15 @@ parse_options()
--with-fast-mutexes)
with_fast_mutexes="yes"
;;
+ --without-fast-mutexes)
+ with_fast_mutexes="no"
+ ;;
+ --without-perfschema)
+ with_perfschema="no"
+ ;;
+ --with-mso)
+ with_mso="yes"
+ ;;
--use-tcmalloc)
use_tcmalloc="yes"
;;
@@ -693,6 +782,10 @@ parse_options()
with_debug_flag="yes"
fast_flag="no"
;;
+ --extra-debug-flag)
+ shift
+ extra_debug_flags="$extra_debug_flags -D$1"
+ ;;
--debug)
compile_debug_flag="yes"
;;
@@ -712,6 +805,14 @@ parse_options()
compiler=`get_key_value "$1"`
parse_compiler
;;
+ --generate-feedback)
+ shift
+ GENERATE_FEEDBACK_PATH="$1"
+ ;;
+ --use-feedback)
+ shift
+ USE_FEEDBACK_PATH="$1"
+ ;;
--cpu=*)
cpu_type=`get_key_value "$1"`
parse_cpu_type
@@ -746,12 +847,6 @@ parse_options()
--parallelism=*)
parallelism=`get_key_value "$1"`
;;
- --use-autotools)
- use_autotools="yes"
- ;;
- --no-autotools)
- use_autotools="no"
- ;;
--configure-only)
just_configure="yes"
;;
@@ -896,6 +991,9 @@ set_cpu_base()
#
init_configure_commands()
{
+ path=`dirname $0`
+ cp $path/cmake_configure.sh $path/../configure
+ chmod +x $path/../configure
cflags="$c_warnings $base_cflags $compiler_flags"
cxxflags="$cxx_warnings $base_cxxflags $compiler_flags"
configure="./configure $base_configs $with_flags"
@@ -1084,6 +1182,7 @@ set_with_debug_flags()
loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
compiler_flags="$compiler_flags $loc_debug_flags"
fi
+ compiler_flags="$compiler_flags $extra_debug_flags"
fi
}
@@ -1105,7 +1204,7 @@ set_no_omit_frame_pointer_for_developers()
#
set_debug_flag()
{
- if test "x$compile_debug_flags" = "xyes" ; then
+ if test "x$compile_debug_flag" = "xyes" ; then
compiler_flags="$compiler_flags -g"
fi
}
@@ -1152,7 +1251,9 @@ set_base_configs()
fi
base_configs="$base_configs --with-pic"
base_configs="$base_configs --with-csv-storage-engine"
- base_configs="$base_configs --with-perfschema"
+ if test "x$with_perfschema" != "xno" ; then
+ base_configs="$base_configs --with-perfschema"
+ fi
}
#
@@ -1251,6 +1352,19 @@ set_gcc_special_options()
fi
}
+#
+# If we discover a Core 2 Duo architecture and we have enabled the fast
+# flag, we enable a compile especially optimised for Core 2 Duo. This
+# feature is currently available on Intel's icc compiler only.
+#
+set_icc_special_options()
+{
+ if test "x$fast_flag" = "xyes" && test "x$cpu_arg" = "xcore2" && \
+ test "x$compiler" = "xicc" ; then
+ compiler_flags="$compiler_flags -xT"
+ fi
+}
+
set_cc_and_cxx_for_gcc()
{
if test "x$CC" = "x" ; then
@@ -1271,26 +1385,23 @@ set_cc_and_cxx_for_icc()
fi
}
-set_cc_and_cxx_for_forte()
+set_cc_and_cxx_for_open64()
{
if test "x$CC" = "x" ; then
- CC="cc"
+ CC="opencc -static-libgcc -fno-exceptions"
fi
if test "x$CXX" = "x" ; then
- CXX="CC"
+ CXX="openCC -static-libgcc -fno-exceptions"
fi
}
-#
-# If we discover a Core 2 Duo architecture and we have enabled the fast
-# flag, we enable a compile especially optimised for Core 2 Duo. This
-# feature is currently available on Intel's icc compiler only.
-#
-set_icc_special_options()
+set_cc_and_cxx_for_forte()
{
- if test "x$fast_flag" = "xyes" && test "x$cpu_arg" = "xcore2" && \
- test "x$compiler" = "xicc" ; then
- compiler_flags="$compiler_flags -xT"
+ if test "x$CC" = "x" ; then
+ CC="cc"
+ fi
+ if test "x$CXX" = "x" ; then
+ CXX="CC"
fi
}
@@ -1358,11 +1469,44 @@ get_gcc_version()
}
#
+# Link time optimizer (interprocedural optimizations) for Open64
+#
+check_for_open64_link_time_optimizer()
+{
+ if test "x$with_link_time_optimizer" = "xyes" ; then
+ compiler_flags="$compiler_flags -ipa"
+ LDFLAGS="$LDFLAGS -ipa"
+ fi
+}
+
+#
+# Link time optimizer (interprocedural optimizations) for icc
+#
+check_for_icc_link_time_optimizer()
+{
+ if test "x$with_link_time_optimizer" = "xyes" ; then
+ compiler_flags="$compiler_flags -ipo"
+ LDFLAGS="$LDFLAGS -ipo"
+ fi
+}
+
+#
+# Link time optimizer (interprocedural optimizations) for forte
+#
+check_for_forte_link_time_optimizer()
+{
+ if test "x$with_link_time_optimizer" = "xyes" ; then
+ compiler_flags="$compiler_flags -ipo"
+ LDFLAGS="$LDFLAGS -ipo"
+ fi
+}
+
+#
# Link Time Optimizer in GCC (LTO) uses a parameter -flto
# which was added to GCC 4.5, if --with-link-time-optimizer
# is set then use this feature
#
-check_for_link_time_optimizer()
+check_for_gcc_link_time_optimizer()
{
get_gcc_version
if test "$gcc_version" -ge 405 && \
@@ -1371,11 +1515,37 @@ check_for_link_time_optimizer()
LDFLAGS="$LDFLAGS -flto"
fi
}
+
+set_feedback_for_gcc()
+{
+ if test "x$GENERATE_FEEDBACK_PATH" != "x" ; then
+ compiler_flags="$compiler_flags -fprofile-generate"
+ compiler_flags="$compiler_flags -fprofile-dir=$GENERATE_FEEDBACK_PATH"
+ elif test "x$USE_FEEDBACK_PATH" != "x" ; then
+ compiler_flags="$compiler_flags -fprofile-use"
+ compiler_flags="$compiler_flags -fprofile-correction"
+ compiler_flags="$compiler_flags -fprofile-dir=$USE_FEEDBACK_PATH"
+ fi
+}
+
+set_feedback_for_open64()
+{
+ if test "x$GENERATE_FEEDBACK_PATH" != "x" ; then
+ compiler_flags="$compiler_flags --fb-create=$GENERATE_FEEDBACK_PATH/feedback"
+ elif test "x$USE_FEEDBACK_PATH" != "x" ; then
+ compiler_flags="$compiler_flags --fb-opt=$USE_FEEDBACK_PATH/feedback"
+ fi
+}
+
#
# Linux Section
#
set_linux_configs()
{
+# Default to use --with-fast-mutexes on Linux
+ if test "x$with_fast_mutexes" = "x" ; then
+ base_configs="$base_configs --with-fast-mutexes"
+ fi
if test "x$cpu_base_type" != "xx86" && \
test "x$cpu_base_type" != "xitanium" ; then
usage "Only x86 and Itanium CPUs supported for Linux"
@@ -1392,19 +1562,14 @@ set_linux_configs()
if test "x$fast_flag" != "xno" ; then
if test "x$fast_flag" = "xyes" ; then
compiler_flags="$compiler_flags -O3"
- check_for_link_time_optimizer
+ check_for_gcc_link_time_optimizer
else
- compiler_flags="$compiler_flags -O2"
+ compiler_flags="$compiler_flags -O3"
fi
else
compiler_flags="$compiler_flags -O0"
fi
- check_64_bits
- if test "x$m64" = "xyes" ; then
- compiler_flags="$compiler_flags -m64"
- else
- compiler_flags="$compiler_flags -m32"
- fi
+ set_feedback_for_gcc
# configure will set proper compiler flags for gcc on Linux
elif test "x$compiler" = "xicc" ; then
compiler_flags="$compiler_flags -mp -restrict"
@@ -1414,16 +1579,36 @@ set_linux_configs()
fi
if test "x$fast_flag" != "xno" ; then
compiler_flags="$compiler_flags -O3 -unroll2 -ip"
- if test "x$fast_flag" = "xyes" && \
- test "x$with_link_time_optimizer" = "xyes" ; then
- compiler_flags="$compiler_flags -ipo"
- LDFLAGS="$LDFLAGS -ipo"
+ if test "x$fast_flag" = "xyes" ; then
+ check_for_icc_link_time_optimizer
+ fi
+ fi
+ elif test "x$compiler" = "xopen64" ; then
+ set_cc_and_cxx_for_open64
+ if test "x$fast_flag" != "xno" ; then
+ if test "x$fast_flag" = "xyes" ; then
+ compiler_flags="$compiler_flags -O3"
+# Generate code specific for the machine you run on
+ compiler_flags="$compiler_flags -march=auto"
+ check_for_open64_link_time_optimizer
+ if test "x$with_mso" = "xyes" ; then
+ compiler_flags="$compiler_flags -mso"
+ fi
+ else
+ compiler_flags="$compiler_flags -O3"
fi
fi
+ set_feedback_for_open64
else
- usage "Only gcc and icc compilers supported for Linux"
+ usage "Only gcc,icc and Open64 compilers supported for Linux"
exit 1
fi
+ check_64_bits
+ if test "x$m64" = "xyes" ; then
+ compiler_flags="$compiler_flags -m64"
+ else
+ compiler_flags="$compiler_flags -m32"
+ fi
}
#
@@ -1475,7 +1660,7 @@ set_solaris_configs()
if test "x$fast_flag" = "xyes" ; then
LDFLAGS="$LDFLAGS -O3"
compiler_flags="$compiler_flags -O3"
- check_for_link_time_optimizer
+ check_for_gcc_link_time_optimizer
else
if test "x$fast_flag" = "xgeneric" ; then
LDFLAGS="$LDFLAGS -O2"
@@ -1498,10 +1683,7 @@ set_solaris_configs()
if test "x$fast_flag" = "xyes" ; then
compiler_flags="$compiler_flags -xtarget=native"
compiler_flags="$compiler_flags -xunroll=3"
- if test "x$with_link_time_optimizer" = "xyes" ; then
- compiler_flags="$compiler_flags -xipo"
- LDFLAGS="$LDFLAGS -xipo"
- fi
+ check_for_forte_link_time_optimizer
else
compiler_flags="$compiler_flags -xtarget=generic"
fi
@@ -1612,17 +1794,6 @@ set_default_package()
fi
}
-set_autotool_flags()
-{
- if test "x$use_autotools" = "x" ; then
- if test "x$developer_flag" = "xno" ; then
- use_autotools="no"
- else
- use_autotools="yes"
- fi
- fi
-}
-
set_defaults_based_on_environment()
{
if test ! -z "$MYSQL_DEVELOPER" ; then
@@ -1674,25 +1845,28 @@ base_cxxflags=
base_configs=
debug_flags=
cxxflags=
+extra_debug_flags=
m64=
explicit_size_set=
datadir=
commands=
-use_autotools=
engine_configs=
ASFLAGS=
LDFLAGS=
use_tcmalloc=
without_comment="yes"
with_fast_mutexes=
+with_perfschema="yes"
with_link_time_optimizer=
+with_mso=
gcc_version="0"
+generate_feedback_path=
+use_feedback_path=
set_defaults_based_on_environment
parse_options "$@"
-set_autotool_flags
set_default_package
set -e
@@ -1793,9 +1967,6 @@ set_ccache_usage
# Set up commands variable from variables prepared for base
# configurations, compiler flags, and warnings flags.
#
-if test "x$use_autotools" = "xyes" ; then
- init_auto_commands
-fi
init_configure_commands
if test "x$just_configure" != "xyes" ; then
@@ -1806,8 +1977,8 @@ fi
# The commands variable now contains the entire command to be run for
# the build; we either execute it, or merely print it out.
#
-if test "x$just_print" = "xyes" ; then
- echo "$commands"
-else
+echo "Running command:"
+echo "$commands"
+if test "x$just_print" != "xyes" ; then
eval "set -x; $commands"
fi
diff --git a/BUILD/check-cpu b/BUILD/check-cpu
index 070e7de0125..deae27656a4 100755
--- a/BUILD/check-cpu
+++ b/BUILD/check-cpu
@@ -1,4 +1,20 @@
#!/bin/sh
+
+# Copyright (C) 2005, 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# 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
+
#
# Check cpu of current machine and find the
# best compiler optimization flags for gcc
diff --git a/BUILD/cleanup b/BUILD/cleanup
index 518c5722d87..1ae29368fa7 100755
--- a/BUILD/cleanup
+++ b/BUILD/cleanup
@@ -1,5 +1,20 @@
#! /bin/sh
+# 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/cmake_configure.sh b/BUILD/cmake_configure.sh
index 80423205274..887408f9bfa 100644
--- a/BUILD/cmake_configure.sh
+++ b/BUILD/cmake_configure.sh
@@ -1,14 +1,34 @@
#!/bin/sh
-# Choose whether to use autoconf created configure
-# of perl script that calls cmake.
+
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
# Ensure cmake and perl are there
cmake -P cmake/check_minimal_version.cmake >/dev/null 2>&1 || HAVE_CMAKE=no
-perl --version >/dev/null 2>&1 || HAVE_CMAKE=no
+perl --version >/dev/null 2>&1 || HAVE_PERL=no
scriptdir=`dirname $0`
if test "$HAVE_CMAKE" = "no"
then
- sh $scriptdir/configure.am "$@"
+ echo "CMake is required to build MySQL."
+ exit 1
+elif test "$HAVE_PERL" = "no"
+then
+ echo "Perl is required to build MySQL using the configure to CMake translator."
+ exit 1
else
perl $scriptdir/cmake/configure.pl "$@"
fi
diff --git a/BUILD/compile-alpha b/BUILD/compile-alpha
index ce5050fee72..a0b98ecb2a5 100755
--- a/BUILD/compile-alpha
+++ b/BUILD/compile-alpha
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2000, 2002 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-alpha-debug b/BUILD/compile-alpha-debug
index 94fe8a2b414..51895d3c230 100755
--- a/BUILD/compile-alpha-debug
+++ b/BUILD/compile-alpha-debug
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2000, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
/bin/rm -f */.deps/*.P */*.o
make -k maintainer-clean
/bin/rm -f */.deps/*.P */*.o
diff --git a/BUILD/compile-amd64-debug-max b/BUILD/compile-amd64-debug-max
index f08e068135a..273942df5f8 100755
--- a/BUILD/compile-amd64-debug-max
+++ b/BUILD/compile-amd64-debug-max
@@ -1,4 +1,20 @@
#! /bin/sh
+
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags $debug_cflags"
diff --git a/BUILD/compile-amd64-debug-max-no-ndb b/BUILD/compile-amd64-debug-max-no-ndb
index 8babab44481..0eaabe99108 100755
--- a/BUILD/compile-amd64-debug-max-no-ndb
+++ b/BUILD/compile-amd64-debug-max-no-ndb
@@ -1,4 +1,22 @@
#! /bin/sh
+
+# Copyright (C) 2005, 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags $debug_cflags"
diff --git a/BUILD/compile-amd64-gcov b/BUILD/compile-amd64-gcov
index 239a4aed0fb..2b33b5c81ab 100755
--- a/BUILD/compile-amd64-gcov
+++ b/BUILD/compile-amd64-gcov
@@ -1,5 +1,20 @@
#! /bin/sh
+# 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-amd64-gprof b/BUILD/compile-amd64-gprof
index 6cfb8a4302c..6545013771b 100755
--- a/BUILD/compile-amd64-gprof
+++ b/BUILD/compile-amd64-gprof
@@ -1,5 +1,20 @@
#! /bin/sh
+# 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-amd64-max b/BUILD/compile-amd64-max
index 30db275c7ae..c14f0d7104c 100755
--- a/BUILD/compile-amd64-max
+++ b/BUILD/compile-amd64-max
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags $fast_cflags -g"
diff --git a/BUILD/compile-amd64-max-sci b/BUILD/compile-amd64-max-sci
index 4afa9004742..dcb6967850b 100644
--- a/BUILD/compile-amd64-max-sci
+++ b/BUILD/compile-amd64-max-sci
@@ -1,5 +1,20 @@
#! /bin/sh
+# 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
+
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags $fast_cflags -g"
diff --git a/BUILD/compile-amd64-valgrind-max b/BUILD/compile-amd64-valgrind-max
index fb8dce38df3..5b5c6bfda92 100755
--- a/BUILD/compile-amd64-valgrind-max
+++ b/BUILD/compile-amd64-valgrind-max
@@ -1,5 +1,22 @@
#! /bin/sh
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
path=`dirname $0`
. "$path/SETUP.sh"
@@ -7,18 +24,3 @@ extra_flags="$amd64_cflags $debug_cflags $valgrind_flags"
extra_configs="$amd64_configs $debug_configs $valgrind_configs $max_configs"
. "$path/FINISH.sh"
-
-if test -z "$just_print"
-then
- set +v +x
- echo "\
-******************************************************************************
-Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with
---enable-assembler. When Valgrind detects an error involving an assembly
-function (for example an uninitialized value used as an argument of an
-assembly function), Valgrind will not print the stacktrace and 'valgrind
---gdb-attach=yes' will not work either. If you need a stacktrace in those
-cases, you have to run BUILD/compile-pentium-valgrind-max with the
---disable-assembler argument.
-******************************************************************************"
-fi
diff --git a/BUILD/compile-darwin-mwcc b/BUILD/compile-darwin-mwcc
index 9ad8d5d40b5..88747de77af 100755
--- a/BUILD/compile-darwin-mwcc
+++ b/BUILD/compile-darwin-mwcc
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-dist b/BUILD/compile-dist
index cabe094cfc0..5583f2b81c9 100755
--- a/BUILD/compile-dist
+++ b/BUILD/compile-dist
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (C) 2004, 2006 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/BUILD/compile-hpux11-parisc2-aCC b/BUILD/compile-hpux11-parisc2-aCC
index 0e825715663..5d0df465bc9 100755
--- a/BUILD/compile-hpux11-parisc2-aCC
+++ b/BUILD/compile-hpux11-parisc2-aCC
@@ -1,5 +1,20 @@
#!/bin/sh
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
if [ ! -f "sql/mysqld.cc" ]; then
echo "You must run this script from the MySQL top-level directory."
exit 1
diff --git a/BUILD/compile-ia64-debug-max b/BUILD/compile-ia64-debug-max
index e9b534c302e..85807e3752e 100755
--- a/BUILD/compile-ia64-debug-max
+++ b/BUILD/compile-ia64-debug-max
@@ -1,3 +1,20 @@
+#! /bin/sh
+
+# Copyright (C) 2001, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
gmake -k maintainer-clean || true
/bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache
diff --git a/BUILD/compile-irix-mips64-mipspro b/BUILD/compile-irix-mips64-mipspro
index 5e34df20c28..a8433c715ab 100755
--- a/BUILD/compile-irix-mips64-mipspro
+++ b/BUILD/compile-irix-mips64-mipspro
@@ -1,5 +1,20 @@
#!/bin/sh
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
if [ ! -f "sql/mysqld.cc" ]; then
echo "You must run this script from the MySQL top-level directory."
exit 1
diff --git a/BUILD/compile-ndb-autotest b/BUILD/compile-ndb-autotest
index 6f86eeb7464..e14855f1489 100755
--- a/BUILD/compile-ndb-autotest
+++ b/BUILD/compile-ndb-autotest
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium b/BUILD/compile-pentium
index cdbc7e773eb..1da117541a4 100755
--- a/BUILD/compile-pentium
+++ b/BUILD/compile-pentium
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2000, 2002 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-cybozu b/BUILD/compile-pentium-cybozu
index 841635985a1..86445715fba 100755
--- a/BUILD/compile-pentium-cybozu
+++ b/BUILD/compile-pentium-cybozu
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-debug b/BUILD/compile-pentium-debug
index 37381cc47df..83de3c68152 100755
--- a/BUILD/compile-pentium-debug
+++ b/BUILD/compile-pentium-debug
@@ -1,5 +1,20 @@
#! /bin/sh
+# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max
index 5c56ceb37ba..37e4a30337b 100755
--- a/BUILD/compile-pentium-debug-max
+++ b/BUILD/compile-pentium-debug-max
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2001, 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-debug-max-no-embedded b/BUILD/compile-pentium-debug-max-no-embedded
index 2cae5eff694..55aede7536f 100755
--- a/BUILD/compile-pentium-debug-max-no-embedded
+++ b/BUILD/compile-pentium-debug-max-no-embedded
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-debug-max-no-ndb b/BUILD/compile-pentium-debug-max-no-ndb
index f1e14b73ecd..cb8dbc7e364 100755
--- a/BUILD/compile-pentium-debug-max-no-ndb
+++ b/BUILD/compile-pentium-debug-max-no-ndb
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2005, 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-debug-openssl b/BUILD/compile-pentium-debug-openssl
index 7026e0fde05..67e2327cb08 100755
--- a/BUILD/compile-pentium-debug-openssl
+++ b/BUILD/compile-pentium-debug-openssl
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2001, 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-debug-yassl b/BUILD/compile-pentium-debug-yassl
index 3f9a36ce5a1..29242a6853b 100755
--- a/BUILD/compile-pentium-debug-yassl
+++ b/BUILD/compile-pentium-debug-yassl
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-gcov b/BUILD/compile-pentium-gcov
index 42666b2632c..26dc85382bf 100755
--- a/BUILD/compile-pentium-gcov
+++ b/BUILD/compile-pentium-gcov
@@ -1,5 +1,20 @@
#! /bin/sh
+# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
# Need to disable ccache, or we loose the gcov-needed compiler output files.
USING_GCOV=1
diff --git a/BUILD/compile-pentium-gprof b/BUILD/compile-pentium-gprof
index 4aebc1d2e02..f04d7154888 100755
--- a/BUILD/compile-pentium-gprof
+++ b/BUILD/compile-pentium-gprof
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2001, 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-icc b/BUILD/compile-pentium-icc
index bf550a4b574..0c41b6045af 100755
--- a/BUILD/compile-pentium-icc
+++ b/BUILD/compile-pentium-icc
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-icc-valgrind-max b/BUILD/compile-pentium-icc-valgrind-max
index 0babf9ee881..ebefb1b3fd0 100755
--- a/BUILD/compile-pentium-icc-valgrind-max
+++ b/BUILD/compile-pentium-icc-valgrind-max
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-icc-yassl b/BUILD/compile-pentium-icc-yassl
index 53b191e4db3..78a547d91e0 100644
--- a/BUILD/compile-pentium-icc-yassl
+++ b/BUILD/compile-pentium-icc-yassl
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-max b/BUILD/compile-pentium-max
index 8272e3406d3..7bd063cd24a 100755
--- a/BUILD/compile-pentium-max
+++ b/BUILD/compile-pentium-max
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2001, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-myodbc b/BUILD/compile-pentium-myodbc
index 4fcfc7e49dc..2d5a06f5f78 100755
--- a/BUILD/compile-pentium-myodbc
+++ b/BUILD/compile-pentium-myodbc
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2000 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium-pgcc b/BUILD/compile-pentium-pgcc
index c13a6ff14f7..383cd288bf1 100755
--- a/BUILD/compile-pentium-pgcc
+++ b/BUILD/compile-pentium-pgcc
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2000, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
AM_MAKEFLAGS="-j 2"
gmake -k maintainer-clean || true
/bin/rm -f */.deps/*.P config.cache
diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max
index 8ef47bfbc17..ef4d7267e5f 100755
--- a/BUILD/compile-pentium-valgrind-max
+++ b/BUILD/compile-pentium-valgrind-max
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2002, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
@@ -7,18 +22,3 @@ extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
. "$path/FINISH.sh"
-
-if test -z "$just_print"
-then
- set +v +x
- echo "\
-******************************************************************************
-Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with
---enable-assembler. When Valgrind detects an error involving an assembly
-function (for example an uninitialized value used as an argument of an
-assembly function), Valgrind will not print the stacktrace and 'valgrind
---gdb-attach=yes' will not work either. If you need a stacktrace in those
-cases, you have to run BUILD/compile-pentium-valgrind-max with the
---disable-assembler argument.
-******************************************************************************"
-fi
diff --git a/BUILD/compile-pentium-valgrind-max-no-ndb b/BUILD/compile-pentium-valgrind-max-no-ndb
index f480f83ebf7..b5573bc6d29 100755
--- a/BUILD/compile-pentium-valgrind-max-no-ndb
+++ b/BUILD/compile-pentium-valgrind-max-no-ndb
@@ -1,5 +1,22 @@
#! /bin/sh
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
path=`dirname $0`
. "$path/SETUP.sh"
@@ -7,18 +24,3 @@ extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_no_ndb_configs"
. "$path/FINISH.sh"
-
-if test -z "$just_print"
-then
- set +v +x
- echo "\
-******************************************************************************
-Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with
---enable-assembler. When Valgrind detects an error involving an assembly
-function (for example an uninitialized value used as an argument of an
-assembly function), Valgrind will not print the stacktrace and 'valgrind
---gdb-attach=yes' will not work either. If you need a stacktrace in those
-cases, you have to run BUILD/compile-pentium-valgrind-max with the
---disable-assembler argument.
-******************************************************************************"
-fi
diff --git a/BUILD/compile-pentium64 b/BUILD/compile-pentium64
index 3a8fad51fea..6d24f681d73 100755
--- a/BUILD/compile-pentium64
+++ b/BUILD/compile-pentium64
@@ -1,5 +1,22 @@
#! /bin/sh
+# Copyright (C) 2006, 2007 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium64-debug b/BUILD/compile-pentium64-debug
index 7d11ee9df76..01c15836a54 100755
--- a/BUILD/compile-pentium64-debug
+++ b/BUILD/compile-pentium64-debug
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2005, 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium64-debug-max b/BUILD/compile-pentium64-debug-max
index 322b232a20c..375f15e9908 100755
--- a/BUILD/compile-pentium64-debug-max
+++ b/BUILD/compile-pentium64-debug-max
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2005, 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium64-gcov b/BUILD/compile-pentium64-gcov
index 0334f0e28f4..67dbad8b072 100755
--- a/BUILD/compile-pentium64-gcov
+++ b/BUILD/compile-pentium64-gcov
@@ -1,5 +1,20 @@
#! /bin/sh
+# 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium64-gprof b/BUILD/compile-pentium64-gprof
index 662396f04ed..e50d384ec79 100755
--- a/BUILD/compile-pentium64-gprof
+++ b/BUILD/compile-pentium64-gprof
@@ -1,5 +1,20 @@
#! /bin/sh
+# 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium64-max b/BUILD/compile-pentium64-max
index e6695f292e4..3f93599c288 100755
--- a/BUILD/compile-pentium64-max
+++ b/BUILD/compile-pentium64-max
@@ -1,5 +1,22 @@
#! /bin/sh
+# Copyright (C) 2007 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium64-max-sci b/BUILD/compile-pentium64-max-sci
index 9ebb1988475..e6b7e3b02df 100644
--- a/BUILD/compile-pentium64-max-sci
+++ b/BUILD/compile-pentium64-max-sci
@@ -1,5 +1,20 @@
#! /bin/sh
+# 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
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-pentium64-valgrind-max b/BUILD/compile-pentium64-valgrind-max
index eb3d20c874d..e29fa64d261 100755
--- a/BUILD/compile-pentium64-valgrind-max
+++ b/BUILD/compile-pentium64-valgrind-max
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
@@ -7,18 +22,3 @@ extra_flags="$pentium64_cflags $debug_cflags $valgrind_flags"
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
. "$path/FINISH.sh"
-
-if test -z "$just_print"
-then
- set +v +x
- echo "\
-******************************************************************************
-Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with
---enable-assembler. When Valgrind detects an error involving an assembly
-function (for example an uninitialized value used as an argument of an
-assembly function), Valgrind will not print the stacktrace and 'valgrind
---gdb-attach=yes' will not work either. If you need a stacktrace in those
-cases, you have to run BUILD/compile-pentium-valgrind-max with the
---disable-assembler argument.
-******************************************************************************"
-fi
diff --git a/BUILD/compile-ppc b/BUILD/compile-ppc
index d248ecf2677..d0845b3ddd2 100755
--- a/BUILD/compile-ppc
+++ b/BUILD/compile-ppc
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-ppc-debug b/BUILD/compile-ppc-debug
index 99e9364a5e2..76b6bf65ce4 100755
--- a/BUILD/compile-ppc-debug
+++ b/BUILD/compile-ppc-debug
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-ppc-debug-max b/BUILD/compile-ppc-debug-max
index 7c1a593869f..b2c7ec18b3e 100755
--- a/BUILD/compile-ppc-debug-max
+++ b/BUILD/compile-ppc-debug-max
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-ppc-debug-max-no-ndb b/BUILD/compile-ppc-debug-max-no-ndb
index 7b39aa25dff..e77c517b302 100755
--- a/BUILD/compile-ppc-debug-max-no-ndb
+++ b/BUILD/compile-ppc-debug-max-no-ndb
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-ppc-max b/BUILD/compile-ppc-max
index c2eb95dffea..cd2ada87dd8 100755
--- a/BUILD/compile-ppc-max
+++ b/BUILD/compile-ppc-max
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-solaris-amd64-debug b/BUILD/compile-solaris-amd64-debug
index 38e910ae7c9..4d6d3f6fce4 100755
--- a/BUILD/compile-solaris-amd64-debug
+++ b/BUILD/compile-solaris-amd64-debug
@@ -1,5 +1,20 @@
#!/bin/sh
+# 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
+
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags -D__sun -m64 -mtune=athlon64 $debug_cflags"
diff --git a/BUILD/compile-solaris-amd64-forte b/BUILD/compile-solaris-amd64-forte
index c89b3129a1b..a7d9e37b76b 100755
--- a/BUILD/compile-solaris-amd64-forte
+++ b/BUILD/compile-solaris-amd64-forte
@@ -10,6 +10,9 @@
# After installing, add /opt/SUNWspro/bin to your $PATH
+gmake -k maintainer-clean || true
+/bin/rm -f */.deps/*.P config.cache
+
path=`dirname $0`
. "$path/SETUP.sh"
diff --git a/BUILD/compile-solaris-sparc b/BUILD/compile-solaris-sparc
index bc74d7275f3..783167bebcf 100755
--- a/BUILD/compile-solaris-sparc
+++ b/BUILD/compile-solaris-sparc
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2000, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
make -k clean || true
/bin/rm -f */.deps/*.P config.cache
diff --git a/BUILD/compile-solaris-sparc-debug b/BUILD/compile-solaris-sparc-debug
index 43cabd644fa..8e4a4672f2e 100755
--- a/BUILD/compile-solaris-sparc-debug
+++ b/BUILD/compile-solaris-sparc-debug
@@ -1,5 +1,20 @@
#!/bin/sh
+# Copyright (C) 2001, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
make -k clean || true
/bin/rm -f */.deps/*.P config.cache
diff --git a/BUILD/compile-solaris-sparc-forte b/BUILD/compile-solaris-sparc-forte
index f4bf86517d1..087fe22a591 100755
--- a/BUILD/compile-solaris-sparc-forte
+++ b/BUILD/compile-solaris-sparc-forte
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2001, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
# Assume Forte is installed in /opt/SUNWSpro and ld is installed in
# /usr/ccs/bin
diff --git a/BUILD/compile-solaris-sparc-purify b/BUILD/compile-solaris-sparc-purify
index 989587fbe99..428ef8a5dca 100755
--- a/BUILD/compile-solaris-sparc-purify
+++ b/BUILD/compile-solaris-sparc-purify
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2000, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
mode=""
cxxfilt=""
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5eddad4ad15..6766f76c665 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -61,6 +61,13 @@ SET(BUILDTYPE_DOCSTRING
IF(WITH_DEBUG)
SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING ${BUILDTYPE_DOCSTRING} FORCE)
+ SET(MYSQL_MAINTAINER_MODE ON CACHE BOOL
+ "MySQL maintainer-specific development environment")
+ IF(UNIX AND NOT APPLE)
+ # Compiling with PIC speeds up embedded build, on PIC sensitive systems
+ # Predefine it to ON, in case user chooses to build embedded.
+ SET(WITH_PIC ON CACHE BOOL "Compile with PIC")
+ ENDIF()
SET(OLD_WITH_DEBUG 1 CACHE INTERNAL "" FORCE)
ELSEIF(NOT HAVE_CMAKE_BUILD_TYPE OR OLD_WITH_DEBUG)
IF(CUSTOM_C_FLAGS)
@@ -72,12 +79,12 @@ ELSEIF(NOT HAVE_CMAKE_BUILD_TYPE OR OLD_WITH_DEBUG)
SET(OLD_WITH_DEBUG 0 CACHE INTERNAL "" FORCE)
ENDIF()
-IF(BUILD_CONFIG)
- SET(CMAKE_USER_MAKE_RULES_OVERRIDE
- ${CMAKE_SOURCE_DIR}/cmake/build_configurations/${BUILD_CONFIG}.cmake)
-ENDIF()
PROJECT(MySQL)
+IF(BUILD_CONFIG)
+ INCLUDE(
+ ${CMAKE_SOURCE_DIR}/cmake/build_configurations/${BUILD_CONFIG}.cmake)
+ENDIF()
# Include the platform-specific file. To allow exceptions, this code
# looks for files in order of how specific they are. If there is, for
@@ -108,21 +115,24 @@ ENDIF()
# Control aspects of the development environment which are
# specific to MySQL maintainers and developers.
#
-OPTION(MYSQL_MAINTAINER_MODE "MySQL maintainer-specific development environment" OFF)
-# Whether the maintainer mode should be enabled.
+INCLUDE(maintainer)
+
+OPTION(MYSQL_MAINTAINER_MODE
+ "MySQL maintainer-specific development environment" OFF)
+
+# Whether the maintainer mode compiler options should be enabled.
IF(MYSQL_MAINTAINER_MODE)
- IF(CMAKE_COMPILER_IS_GNUCC)
- SET(MY_MAINTAINER_C_WARNINGS
- "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror"
- CACHE STRING "C warning options used in maintainer builds.")
+ IF(CMAKE_C_COMPILER_ID MATCHES "GNU")
+ SET_MYSQL_MAINTAINER_GNU_C_OPTIONS()
ENDIF()
- IF(CMAKE_COMPILER_IS_GNUCXX)
- SET(MY_MAINTAINER_CXX_WARNINGS "${MY_MAINTAINER_C_WARNINGS} -Wno-unused-parameter"
- CACHE STRING "C++ warning options used in maintainer builds.")
+ IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ SET_MYSQL_MAINTAINER_GNU_CXX_OPTIONS()
ENDIF()
- # Do not make warnings in checks into errors.
- IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX)
- SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Wno-error")
+ IF(CMAKE_C_COMPILER_ID MATCHES "Intel")
+ SET_MYSQL_MAINTAINER_INTEL_C_OPTIONS()
+ ENDIF()
+ IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+ SET_MYSQL_MAINTAINER_INTEL_CXX_OPTIONS()
ENDIF()
ENDIF()
@@ -162,6 +172,13 @@ IF(ENABLE_DEBUG_SYNC)
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
ENDIF()
+OPTION(ENABLE_GCOV "Enable gcov (debug, Linux builds only)" OFF)
+IF (ENABLE_GCOV AND NOT WIN32 AND NOT APPLE)
+ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage")
+ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage")
+ SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage -lgcov")
+ENDIF()
+
OPTION(ENABLED_LOCAL_INFILE
"If we should should enable LOAD DATA LOCAL by default" ${IF_WIN})
MARK_AS_ADVANCED(ENABLED_LOCAL_INFILE)
@@ -307,6 +324,24 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
${CMAKE_BINARY_DIR}/include/mysql_version.h )
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc)
+CONFIGURE_FILE(
+ ${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in ${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY)
+
+# Handle the "INFO_*" files.
+INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
+# Source: This can be done during the cmake phase, all information is
+# available, but should be repeated on each "make" just in case someone
+# does "cmake ; make ; bzr pull ; make".
+CREATE_INFO_SRC(${CMAKE_BINARY_DIR}/Docs)
+ADD_CUSTOM_TARGET(INFO_SRC ALL
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/info_src.cmake
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+)
+# Build flags: This must be postponed to the make phase.
+ADD_CUSTOM_TARGET(INFO_BIN ALL
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/info_bin.cmake
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+)
# Packaging
IF(WIN32)
@@ -315,23 +350,34 @@ ELSE()
SET(CPACK_GENERATOR "TGZ")
ENDIF()
ADD_SUBDIRECTORY(packaging/WiX)
+
+# Create a single package with "make package"
+# (see http://public.kitware.com/Bug/view.php?id=11452)
+SET(CPACK_MONOLITHIC_INSTALL 1 CACHE INTERNAL "")
+
INCLUDE(CPack)
IF(UNIX)
- INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL)
+ INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL COMPONENT Info)
ENDIF()
#
# RPM installs documentation directly from the source tree
#
IF(NOT INSTALL_LAYOUT MATCHES "RPM")
- INSTALL(FILES COPYING EXCEPTIONS-CLIENT LICENSE.mysql DESTINATION ${INSTALL_DOCREADMEDIR} OPTIONAL)
- INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR})
+ INSTALL(FILES COPYING LICENSE.mysql
+ DESTINATION ${INSTALL_DOCREADMEDIR}
+ COMPONENT Readme
+ OPTIONAL
+ )
+ INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme)
+ INSTALL(FILES ${CMAKE_BINARY_DIR}/Docs/INFO_SRC ${CMAKE_BINARY_DIR}/Docs/INFO_BIN DESTINATION ${INSTALL_DOCDIR})
IF(UNIX)
- INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR})
+ INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme)
ENDIF()
# MYSQL_DOCS_LOCATON is used in "make dist", points to the documentation directory
SET(MYSQL_DOCS_LOCATION "" CACHE PATH "Location from where documentation is copied")
MARK_AS_ADVANCED(MYSQL_DOCS_LOCATION)
INSTALL(DIRECTORY Docs/ DESTINATION ${INSTALL_DOCDIR}
+ COMPONENT Documentation
PATTERN "INSTALL-BINARY" EXCLUDE
PATTERN "Makefile.*" EXCLUDE
PATTERN "glibc*" EXCLUDE
diff --git a/Docs/Makefile.am b/Docs/Makefile.am
deleted file mode 100644
index 48030153a4e..00000000000
--- a/Docs/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2000-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-EXTRA_DIST = mysql.info INSTALL-BINARY @extra_docs@
-
-# make sure that "make install" installs the info page, too
-# automake only seems to take care of this automatically,
-# if we're building the info page from texi directly.
-install-data-hook: $(srcdir)/mysql.info
- if test `basename $(prefix)` = "mysql" ; then \
- $(mkinstalldirs) $(DESTDIR)$(prefix)/docs ; \
- $(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(prefix)/docs ; \
- test ! -f $(top_srcdir)/ChangeLog || $(INSTALL_DATA) $(top_srcdir)/ChangeLog $(DESTDIR)$(prefix)/docs ; \
- else \
- $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(pkgdatadir) ; \
- $(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(infodir) ; \
- test ! -f $(top_srcdir)/ChangeLog || $(INSTALL_DATA) $(top_srcdir)/ChangeLog $(DESTDIR)$(pkgdatadir) ; \
- fi
-
-uninstall-local:
- if test `basename $(prefix)` = "mysql" ; then \
- @RM@ -f $(DESTDIR)$(prefix)/docs/mysql.info ; \
- @RM@ -f $(DESTDIR)$(prefix)/docs/ChangeLog ; \
- else \
- @RM@ -f $(DESTDIR)$(infodir)/mysql.info ; \
- @RM@ -f $(DESTDIR)$(pkgdatadir)/ChangeLog ; \
- fi
diff --git a/EXCEPTIONS-CLIENT b/EXCEPTIONS-CLIENT
deleted file mode 100644
index c570ff7ba24..00000000000
--- a/EXCEPTIONS-CLIENT
+++ /dev/null
@@ -1,119 +0,0 @@
-MySQL FLOSS License Exception
-
-The MySQL AB Exception for Free/Libre and Open Source
-Software-only Applications Using MySQL Client Libraries (the
-"FLOSS Exception").
-
-Version 0.6, 7 March 2007
-
-Exception Intent
-
-We want specified Free/Libre and Open Source Software (``FLOSS'')
-applications to be able to use specified GPL-licensed MySQL client
-libraries (the ``Program'') despite the fact that not all FLOSS
-licenses are compatible with version 2 of the GNU General Public
-License (the ``GPL'').
-
-Legal Terms and Conditions
-
-As a special exception to the terms and conditions of version 2.0
-of the GPL:
-
- 1. You are free to distribute a Derivative Work that is formed
- entirely from the Program and one or more works (each, a
- "FLOSS Work") licensed under one or more of the licenses
- listed below in section 1, as long as:
- a. You obey the GPL in all respects for the Program and the
- Derivative Work, except for identifiable sections of the
- Derivative Work which are not derived from the Program,
- and which can reasonably be considered independent and
- separate works in themselves,
- b. all identifiable sections of the Derivative Work which
- are not derived from the Program, and which can
- reasonably be considered independent and separate works
- in themselves,
- i. are distributed subject to one of the FLOSS licenses
- listed below, and
- ii. the object code or executable form of those sections
- are accompanied by the complete corresponding
- machine-readable source code for those sections on
- the same medium and under the same FLOSS license as
- the corresponding object code or executable forms of
- those sections, and
- c. any works which are aggregated with the Program or with a
- Derivative Work on a volume of a storage or distribution
- medium in accordance with the GPL, can reasonably be
- considered independent and separate works in themselves
- which are not derivatives of either the Program, a
- Derivative Work or a FLOSS Work.
- If the above conditions are not met, then the Program may only
- be copied, modified, distributed or used under the terms and
- conditions of the GPL or another valid licensing option from
- MySQL AB.
-
- 2. FLOSS License List
-
-License name Version(s)/Copyright Date
-Academic Free License 2.0
-Apache Software License 1.0/1.1/2.0
-Apple Public Source License 2.0
-Artistic license From Perl 5.8.0
-BSD license "July 22 1999"
-Common Development and Distribution License (CDDL) 1.0
-Common Public License 1.0
-Eclipse Public License 1.0
-GNU Library or "Lesser" General Public License (LGPL) 2.0/2.1
-Jabber Open Source License 1.0
-MIT license (As listed in file MIT-License.txt) ---
-Mozilla Public License (MPL) 1.0/1.1
-Open Software License 2.0
-OpenSSL license (with original SSLeay license) "2003" ("1998")
-PHP License 3.0
-Python license (CNRI Python License) ---
-Python Software Foundation License 2.1.1
-Sleepycat License "1999"
-University of Illinois/NCSA Open Source License ---
-W3C License "2001"
-X11 License "2001"
-Zlib/libpng License ---
-Zope Public License 2.0
-
- Due to the many variants of some of the above licenses, we
- require that any version follow the 2003 version of the Free
- Software Foundation's Free Software Definition
- (http://www.gnu.org/philosophy/free-sw.html) or version 1.9 of
- the Open Source Definition by the Open Source Initiative
- (http://www.opensource.org/docs/definition.php).
-
- 3. Definitions
-
- a. Terms used, but not defined, herein shall have the
- meaning provided in the GPL.
- b. Derivative Work means a derivative work under copyright
- law.
-
- 4. Applicability: This FLOSS Exception applies to all Programs
- that contain a notice placed by MySQL AB saying that the
- Program may be distributed under the terms of this FLOSS
- Exception. If you create or distribute a work which is a
- Derivative Work of both the Program and any other work
- licensed under the GPL, then this FLOSS Exception is not
- available for that work; thus, you must remove the FLOSS
- Exception notice from that work and comply with the GPL in all
- respects, including by retaining all GPL notices. You may
- choose to redistribute a copy of the Program exclusively under
- the terms of the GPL by removing the FLOSS Exception notice
- from that copy of the Program, provided that the copy has
- never been modified by you or any third party.
-
-Appendix A. Qualified Libraries and Packages
-
-The following is a non-exhaustive list of libraries and packages
-which are covered by the FLOSS License Exception. Please note that
-this appendix is provided merely as an additional service to
-specific FLOSS projects wishing to simplify licensing information
-for their users. Compliance with one of the licenses noted under
-the "FLOSS license list" section remains a prerequisite.
-
-Package Name Qualifying License and Version
-Apache Portable Runtime (APR) Apache Software License 2.0
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index a1b4a170ddf..00000000000
--- a/Makefile.am
+++ /dev/null
@@ -1,347 +0,0 @@
-# Copyright 2000-2008 MySQL AB, 2009 Sun Microsystems, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# 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
-
-# Process this file with automake to create Makefile.in
-
-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 configure.cmake config.h.cmake BUILD-CMAKE
-
-SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
- @readline_topdir@ sql-common scripts \
- @pstack_dir@ libservices \
- @sql_union_dirs@ unittest \
- @sql_server@ @man_dirs@ tests \
- @libmysqld_dirs@ \
- mysql-test support-files sql-bench \
- win \
- packaging \
- cmake
-DIST_SUBDIRS = . include Docs zlib \
- cmd-line-utils sql-common scripts \
- pstack libservices \
- strings mysys dbug extra regex libmysql libmysql_r client unittest storage plugin \
- vio sql man tests \
- libmysqld \
- mysql-test support-files sql-bench \
- win \
- cmake \
- packaging \
- BUILD
-DISTCLEANFILES = ac_available_languages_fragment
-
-# Create permission databases
-init-db: all
- $(top_builddir)/scripts/mysql_install_db
-
-bin-dist: all
- $(top_builddir)/scripts/make_binary_distribution @MAKE_BINARY_DISTRIBUTION_OPTIONS@
-
-# Remove BK's "SCCS" subdirectories from source distribution
-# Create initial database files for Windows installations and check them.
-dist-hook:
- mkdir -p $(distdir)/win
- scripts/mysql_install_db --no-defaults --cross-bootstrap \
- --builddir=$(top_builddir) \
- --datadir=$(distdir)/win/data \
- --srcdir=$(top_srcdir)
- storage/myisam/myisamchk --silent --fast $(distdir)/win/data/mysql/*.MYI
- test ! -f $(top_srcdir)/configure.am || \
- $(INSTALL_DATA) $(top_srcdir)/configure.am $(distdir)
-
-# Simple target to allow scripts etc. to get the name of the source
-# tarball easily.
-show-dist-name:
- @echo "$(PACKAGE)-$(VERSION)"
-
-all-local: @ABI_CHECK@
-
-tags:
- support-files/build-tags
-
-.PHONY: init-db bin-dist \
- 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-unit-big test-ps test-nr test-pr test-ns test-binlog-statement \
- test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp \
- test-ext-stress test-ext test-embedded test-reprepare \
- test-fast test-fast-cursor test-fast-view test-fast-prepare \
- test-full-qa
-
-# Target 'test' will run the regression test suite using the built server.
-#
-# If you are running in a shared environment, users can avoid clashing
-# port numbers by setting individual small numbers 1-100 to the
-# environment variable MTR_BUILD_THREAD. The script "mysql-test-run"
-# will then calculate the various port numbers it needs from this,
-# making sure each user use different ports.
-#
-# Set MTR_EXTRA_OPTIONS to add custom options for mysql-test-run,
-# like MTR_EXTRA_OPTIONS"--parallel=3 --mem".
-
-test-unit:
- cd unittest; $(MAKE) test
-
-test-unit-big:
- cd unittest; MYTAP_CONFIG=big $(MAKE) test
-
-test-ps:
- cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) --ps-protocol --mysqld=--binlog-format=mixed
-
-test-nr:
- cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) --mysqld=--binlog-format=row
-
-test-pr:
- cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) $(mem) --ps-protocol --mysqld=--binlog-format=row #@libevent_test_option@
-
-test-ns:
- cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) $(mem) --mysqld=--binlog-format=mixed ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) $(mem) --suite=funcs_1
-
-test-binlog-statement:
- cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) --mysqld=--binlog-format=statement
-
-# This code is duplicated in "test-bt", see the Changeset comment of 2007-Dec-07
-test-embedded:
- if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \
- cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=embedded --force --timer \
- --embedded-server --skip-rpl --skip-ndbcluster ; \
- else \
- echo "no program found for 'embedded' tests - skipped testing" ; \
- fi
-
-test-reprepare:
- cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) $(mem) --ps-protocol \
- --mysqld=--debug=+d,reprepare_each_statement
-
-test: test-ns test-pr
-
-smoke:
- cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --do-test=s
-
-test-full: test test-nr test-ps
-
-test-force:
- $(MAKE) -k force=--force test
-
-test-force-full:
- $(MAKE) -k force=--force test-full
-
-#used by autopush.pl to run memory based tests
-test-force-mem:
- $(MAKE) -k force=--force mem=--mem test
-
-EXP = --experimental=collections/default.experimental
-
-test-bt:
- -cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=normal --force --timer \
- --skip-ndbcluster --report-features $(EXP)
- -cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ps --force --timer \
- --skip-ndbcluster --ps-protocol $(EXP)
- -cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=PBXT --mysqld=--default-storage-engine=pbxt --suite=pbxt $(EXP)
- -if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
- cd mysql-test ; \
- MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb+ps --force --timer \
- --ps-protocol --mysqld=--binlog-format=row --suite=ndb $(EXP) ; \
- MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb --force --timer \
- --with-ndbcluster-only $(EXP) ; \
- else \
- echo "no program found for 'ndbcluster' tests - skipped testing" ; \
- fi
- -cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=funcs1+ps --ps-protocol --reorder --suite=funcs_1 $(EXP)
- -cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=funcs2 --suite=funcs_2 $(EXP)
- -cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=partitions --suite=parts $(EXP)
- -cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=stress --suite=stress $(EXP)
- -cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=jp --suite=jp $(EXP)
- -if [ -d mysql-test/suite/nist ] ; then \
- cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=nist --force --suite=nist $(EXP) ; \
- fi
- -if [ -d mysql-test/suite/nist ] ; then \
- cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=nist+ps --force --suite=nist --ps-protocol $(EXP) ; \
- fi
- -if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \
- cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=embedded --force --timer \
- --embedded-server --skip-rpl --skip-ndbcluster $(EXP) ; \
- else \
- echo "no program found for 'embedded' tests - skipped testing" ; \
- fi
-
-test-bt-fast:
- -cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl --comment=ps --force --timer \
- --skip-ndbcluster --ps-protocol --report-features $(EXP)
- -if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
- cd mysql-test ; \
- MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb --force --timer \
- --with-ndbcluster-only $(EXP) ; \
- else \
- echo "no program found for 'ndbcluster' tests - skipped testing" ; \
- fi
- -cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=stress --suite=stress $(EXP)
-
-test-bt-debug:
- -cd mysql-test ; MTR_BUILD_THREAD=auto \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=debug --force --timer \
- --skip-ndbcluster --skip-rpl --report-features $(EXP)
-
-# Keep these for a while
-test-pl: test
-test-full-pl: test-full
-test-force-pl: test-force
-test-force-pl-mem: test-force-mem
-test-force-full-pl: test-force-full
-
-test-ext-funcs:
- cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --reorder --suite=funcs_1 ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --suite=funcs_2
-
-test-ext-rpl:
- cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --suite=rpl
-
-test-ext-partitions:
- cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --suite=parts
-
-test-ext-jp:
- cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --suite=jp
-
-test-ext-stress:
- cd mysql-test ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --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 $(MTR_EXTRA_OPTIONS) $(subset) --force --skip-ndb --skip-innodb --skip-im --skip-rpl ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(subset) --force --suite=funcs_1 --do-test=myisam ; \
- @PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(subset) --force --suite=stress --do-test=ddl_myisam
-
-test-fast-view:
- $(MAKE) subset=--view-protocol test-fast
-
-test-fast-cursor:
- $(MAKE) subset=--cursor-protocol test-fast
-
-test-fast-prepare:
- $(MAKE) subset=--ps-protocol test-fast
-
-test-full-qa:
- $(MAKE) -k force=--force test-pr \
- test-binlog-statement test-ext test-fast-view \
- test-fast-cursor test-unit
-
-#
-# Headers which need to be checked for abi/api compatibility.
-#
-
-API_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin_audit.h \
- $(top_srcdir)/include/mysql/plugin_ftparser.h \
- $(top_srcdir)/include/mysql/plugin_auth.h \
- $(top_srcdir)/include/mysql/client_plugin.h \
- $(top_srcdir)/include/mysql.h \
- $(top_srcdir)/include/mysql/psi/psi_abi_v1.h \
- $(top_srcdir)/include/mysql/psi/psi_abi_v2.h
-
-#
-# Rules for checking that the abi/api has not changed.
-#
-# The following steps are followed in the do_abi_check rule below
-#
-# 1) Generate preprocessor output for the files that need to
-# be tested for abi/api changes. use -nostdinc to prevent
-# generation of preprocessor output for system headers. This
-# results in messages in stderr saying that these headers
-# were not found. Redirect the stderr output to /dev/null
-# to prevent seeing these messages.
-# 2) sed the output to
-# 2.1) remove blank lines and lines that begin with "# "
-# 2.2) When gcc -E is run on the Mac OS and solaris sparc platforms it
-# introduces a line of output that shows up as a difference between
-# the .pp and .out files. Remove these OS specific preprocessor text
-# inserted by the preprocessor.
-# 3) diff the generated file and the canons (.pp files already in
-# the repository).
-# 4) delete the .out file that is generated.
-#
-# If the diff fails, the generated file is not removed. This will
-# be useful for analysis of ABI differences (e.g. using a visual
-# diff tool).
-#
-# A ABI change that causes a build to fail will always be accompanied
-# by new canons (.out files). The .out files that are not removed will
-# be replaced as the new .pp files.
-#
-# e.g. If include/mysql/plugin.h has an ABI change then this rule would
-# leave a <build directory>/abi_check.out file.
-#
-# A developer with a justified API change will then do a
-# mv <build directory>/abi_check.out include/mysql/plugin.pp
-# to replace the old canons with the new ones.
-#
-
-abi_check: $(API_PREPROCESSOR_HEADER)
- $(MAKE) abi_headers="$^" do_abi_check
-
-abi_check_all: abi_check
-
-do_abi_check:
- set -ex; \
- for file in $(abi_headers); do \
- @CC@ -E -nostdinc -dI -DMYSQL_ABI_CHECK \
- -I$(top_srcdir)/include \
- -I$(top_srcdir)/include/mysql \
- -I$(top_srcdir)/sql \
- -I$(top_builddir)/include \
- -I$(top_builddir)/include/mysql \
- -I$(top_builddir)/sql \
- $$file 2>/dev/null | \
- @SED@ -e '/^# /d' \
- -e '/^[ ]*$$/d' \
- -e '/^#pragma GCC set_debug_pwd/d' \
- -e '/^#ident/d' > \
- $(top_builddir)/abi_check.out; \
- @DIFF@ -w $$file.pp $(top_builddir)/abi_check.out; \
- @RM@ $(top_builddir)/abi_check.out; \
- done
diff --git a/README b/README
index af84e8d33ab..78364770999 100644
--- a/README
+++ b/README
@@ -251,22 +251,19 @@ cmake-2.4.8/Utilities/cmzlib/zlib.h:
----------------------------------------------
- This source code was modified by Martin Hedenfalk
- for
- use in Curl. His latest changes were done 2000-09-18.
-
- It has since been patched away like a madman by Daniel Stenberg
- to make it better applied to curl conditions, and to make
- it not use globals, pollute name space and more. This source code awaits a
- rewrite to work around the paragraph 2 in the BSD licenses as explained
- below.
-
- Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Hgskolan
- It has since been patched and modified a lot by Daniel Stenberg
- to make it better applied to curl conditions, and to make
- it not use globals, pollute name space and more. This source code awaits a
- rewrite to work around the paragraph 2 in the BSD licenses as explained
- below.
+ This source code was modified by Martin Hedenfalk for use in Curl. His latest
+ changes were done 2000-09-18.
+
+ It has since been patched away like a madman by Daniel Stenberg to make it
+ better applied to curl conditions, and to make it not use globals, pollute
+ name space and more. This source code awaits a rewrite to work around the
+ paragraph 2 in the BSD licenses as explained below.
+
+ Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Hgskolan It has
+ since been patched and modified a lot by Daniel Stenberg to make it better
+ applied to curl conditions, and to make it not use globals, pollute name space
+ and more. This source code awaits a rewrite to work around the paragraph 2 in
+ the BSD licenses as explained below.
Copyright (c) 1998, 1999 Kungliga Tekniska Hgskolan
(Royal Institute of Technology, Stockholm, Sweden).
@@ -2202,3 +2199,41 @@ Use of any of this software is governed by the terms of the license below:
*/
***************************************************************************
+MySQL Server 5.5
+
+This is a release of MySQL, a dual-license SQL database server.
+For the avoidance of doubt, this particular copy of the software
+is released under the version 2 of the GNU General Public License.
+MySQL is brought to you by Oracle.
+
+Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+
+License information can be found in the COPYING file.
+
+MySQL FOSS License Exception
+We want free and open source software applications under certain
+licenses to be able to use specified GPL-licensed MySQL client
+libraries despite the fact that not all such FOSS licenses are
+compatible with version 2 of the GNU General Public License.
+Therefore there are special exceptions to the terms and conditions
+of the GPLv2 as applied to these client libraries, which are
+identified and described in more detail in the FOSS License
+Exception at
+<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
+
+This distribution may include materials developed by third
+parties. For license and attribution notices for these
+materials, please refer to the documentation that accompanies
+this distribution (see the "Licenses for Third-Party Components"
+appendix) or view the online documentation at
+<http://dev.mysql.com/doc/>.
+
+GPLv2 Disclaimer
+For the avoidance of doubt, except that if any license choice
+other than GPL or LGPL is available it will apply instead,
+Oracle elects to use only the General Public License version 2
+(GPLv2) at this time for any software where a choice of GPL
+license versions is made available with the language indicating
+that GPLv2 or any later version may be used, or where a choice
+of which version of the GPL is applied is otherwise unspecified.
+
diff --git a/VERSION b/VERSION
new file mode 100644
index 00000000000..796544a7013
--- /dev/null
+++ b/VERSION
@@ -0,0 +1,4 @@
+MYSQL_VERSION_MAJOR=5
+MYSQL_VERSION_MINOR=5
+MYSQL_VERSION_PATCH=15
+MYSQL_VERSION_EXTRA=
diff --git a/client/Makefile.am b/client/Makefile.am
deleted file mode 100644
index 97ced5fbfb7..00000000000
--- a/client/Makefile.am
+++ /dev/null
@@ -1,121 +0,0 @@
-# Copyright (C) 2000-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-# This file is public domain and comes with NO WARRANTY of any kind
-
-if THREAD_SAFE_CLIENT
-LIBMYSQLCLIENT_LA = $(top_builddir)/libmysql_r/libmysqlclient_r.la
-else
-LIBMYSQLCLIENT_LA = $(top_builddir)/libmysql/libmysqlclient.la
-endif
-
-INCLUDES = -I$(top_builddir)/include \
- -I$(top_srcdir)/include \
- -I$(top_srcdir)/regex \
- $(openssl_includes)
-
-LIBS = @CLIENT_LIBS@
-
-LDADD= @CLIENT_EXTRA_LDFLAGS@ $(CLIENT_THREAD_LIBS) \
- $(top_builddir)/libmysql/libmysqlclient.la
-
-noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
- client_priv.h
-
-EXTRA_DIST = get_password.c CMakeLists.txt echo.c
-
-BUILT_SOURCES = link_sources
-
-CLEANFILES = $(BUILT_SOURCES)
-
-bin_PROGRAMS = mysql \
- mysqladmin \
- mysqlbinlog \
- mysqlcheck \
- mysqldump \
- mysqlimport \
- mysqlshow \
- mysqlslap \
- mysqltest \
- mysql_upgrade
-
-mysql_SOURCES = mysql.cc readline.cc sql_string.cc \
- completion_hash.cc
-mysql_LDADD = @readline_link@ @TERMCAP_LIB@ \
- $(LDADD) $(CXXLDFLAGS)
-mysqladmin_SOURCES = mysqladmin.cc
-
-mysqlbinlog_SOURCES = mysqlbinlog.cc \
- $(top_srcdir)/mysys/mf_tempdir.c \
- $(top_srcdir)/mysys/my_new.cc \
- $(top_srcdir)/mysys/my_bit.c \
- $(top_srcdir)/mysys/my_bitmap.c \
- $(top_srcdir)/mysys/base64.c
-mysqlbinlog_CXXFLAGS= -I$(top_srcdir)/sql
-mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
-
-mysqldump_SOURCES= mysqldump.c \
- my_user.c \
- $(top_srcdir)/mysys/mf_getdate.c
-
-mysqlimport_SOURCES= mysqlimport.c
-mysqlimport_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
-mysqlimport_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
- @CLIENT_EXTRA_LDFLAGS@ \
- $(LIBMYSQLCLIENT_LA) \
- $(top_builddir)/mysys/libmysys.a
-
-mysqlshow_SOURCES= mysqlshow.c
-
-mysqlslap_SOURCES= mysqlslap.c
-mysqlslap_CFLAGS= -DTHREAD -UMYSQL_CLIENT_NO_THREADS
-mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
- @CLIENT_EXTRA_LDFLAGS@ \
- $(LIBMYSQLCLIENT_LA) \
- $(top_builddir)/mysys/libmysys.a
-
-mysqltest_SOURCES= mysqltest.cc
-mysqltest_CXXFLAGS= -DTHREAD -UMYSQL_CLIENT_NO_THREADS
-mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
- @CLIENT_EXTRA_LDFLAGS@ \
- $(LIBMYSQLCLIENT_LA) \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/regex/libregex.a \
- $(CLIENT_THREAD_LIBS)
-
-mysql_upgrade_SOURCES= mysql_upgrade.c \
- $(top_srcdir)/mysys/my_getpagesize.c
-
-# Fix for mit-threads
-DEFS = -DMYSQL_CLIENT_NO_THREADS \
- -DDEFAULT_MYSQL_HOME='"$(prefix)"' \
- -DMYSQL_DATADIR='"$(localstatedir)"'
-
-sql_src=rpl_tblmap.cc log_event.cc my_decimal.cc log_event_old.cc \
- rpl_record_old.cc rpl_utility.cc sql_list.cc rpl_filter.cc
-strings_src=decimal.c dtoa.c
-
-link_sources:
- for f in $(sql_src) ; do \
- rm -f $$f; \
- @LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
- done; \
- for f in $(strings_src) ; do \
- rm -f $(srcdir)/$$f; \
- @LN_CP_F@ $(top_srcdir)/strings/$$f $$f; \
- done; \
- rm -f $(srcdir)/my_user.c; \
- @LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c;
- echo timestamp > link_sources;
diff --git a/client/client_priv.h b/client/client_priv.h
index c543dd4efa2..0eed5262260 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -50,9 +50,6 @@ enum options_client
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_SERVER_ARG,
OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME,
OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY, OPT_COUNT,
-#ifdef HAVE_NDBCLUSTER_DB
- OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING,
-#endif
OPT_TRIGGERS,
OPT_MYSQL_ONLY_PRINT,
OPT_MYSQL_LOCK_DIRECTORY,
@@ -78,16 +75,17 @@ enum options_client
OPT_SLAP_POST_SYSTEM,
OPT_SLAP_COMMIT,
OPT_SLAP_DETACH,
+ OPT_SLAP_NO_DROP,
OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT_MODE, OPT_SERVER_ID,
OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT,
OPT_AUTO_VERTICAL_OUTPUT,
OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE,
OPT_WRITE_BINLOG, OPT_DUMP_DATE,
OPT_INIT_COMMAND,
+ OPT_PLUGIN_DIR,
+ OPT_DEFAULT_AUTH,
OPT_ABORT_SOURCE_ON_ERROR,
OPT_REWRITE_DB,
- OPT_PLUGIN_DIR,
- OPT_DEFAULT_PLUGIN,
OPT_MAX_CLIENT_OPTION /* should be always the last */
};
diff --git a/client/completion_hash.h b/client/completion_hash.h
index b91d6e4d187..8e1b2d6e453 100644
--- a/client/completion_hash.h
+++ b/client/completion_hash.h
@@ -1,11 +1,11 @@
/* Copyright (C) 2000-2002 MySQL AB
- This library is free software; you can redistribute it and/or
+ This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; version 2
of the License.
- This library is distributed in the hope that it will be useful,
+ 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
Library General Public License for more details.
diff --git a/client/my_readline.h b/client/my_readline.h
index 08cff565819..276e279f43d 100644
--- a/client/my_readline.h
+++ b/client/my_readline.h
@@ -28,11 +28,13 @@ typedef struct st_line_buffer
uint eof;
ulong max_size;
ulong read_length; /* Length of last read string */
+ int error;
+ bool truncated;
} LINE_BUFFER;
extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, char * str);
-extern char *batch_readline(LINE_BUFFER *buffer, bool *truncated);
+extern char *batch_readline(LINE_BUFFER *buffer);
extern void batch_readline_end(LINE_BUFFER *buffer);
#endif /* CLIENT_MY_READLINE_INCLUDED */
diff --git a/client/mysql.cc b/client/mysql.cc
index d0c35e63536..d87ca257b11 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -15,10 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#define COPYRIGHT_NOTICE "\
-This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
-and you are welcome to modify and redistribute it under the GPL v2 license\n"
-
/* mysql command tool
* Commands compatible with mSQL by David J. Hughes
*
@@ -111,6 +107,7 @@ extern "C" {
#endif
#include "completion_hash.h"
+#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
#define PROMPT_CHAR '\\'
#define DEFAULT_DELIMITER ";"
@@ -169,7 +166,7 @@ static int wait_time = 5;
static STATUS status;
static ulong select_limit,max_join_size,opt_connect_timeout=0;
static char mysql_charsets_dir[FN_REFLEN+1];
-static char *opt_plugin_dir= 0, *opt_default_auth;
+static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static const char *xmlmeta[] = {
"&", "&amp;",
"<", "&lt;",
@@ -1135,6 +1132,8 @@ int main(int argc,char *argv[])
if (status.batch && !status.line_buff &&
!(status.line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, stdin)))
{
+ put_info("Can't initialize batch_readline - may be the input source is "
+ "a directory or a block device.", INFO_ERROR, 0);
free_defaults(defaults_argv);
my_end(0);
exit(1);
@@ -1182,7 +1181,7 @@ int main(int argc,char *argv[])
mysql_thread_id(&mysql), server_version_string(&mysql));
put_info((char*) glob_buffer.ptr(),INFO_INFO);
- put_info(COPYRIGHT_NOTICE, INFO_INFO);
+ put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"), INFO_INFO);
#ifdef HAVE_READLINE
initialize_readline((char*) my_progname);
@@ -1474,8 +1473,8 @@ static struct my_option my_long_options[] =
&opt_sigint_ignore, &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.",
+ "Ignore statements except those that occur while the default "
+ "database is the one named at the command line.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef USE_POPEN
{"pager", OPT_PAGER,
@@ -1580,11 +1579,11 @@ static struct my_option my_long_options[] =
&show_warnings, &show_warnings, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
- (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
+ &opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"default_auth", OPT_PLUGIN_DIR,
+ {"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
- (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
+ &opt_default_auth, &opt_default_auth, 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}
};
@@ -1609,7 +1608,7 @@ static void usage(int version)
if (version)
return;
- printf("%s", COPYRIGHT_NOTICE);
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
printf("Usage: %s [OPTIONS] [database]\n", my_progname);
my_print_help(my_long_options);
print_defaults("my", load_default_groups);
@@ -1860,14 +1859,13 @@ static int read_and_execute(bool interactive)
ulong line_number=0;
bool ml_comment= 0;
COMMANDS *com;
- bool truncated= 0;
status.exit_status=1;
while (!aborted)
{
if (!interactive)
{
- line=batch_readline(status.line_buff, &truncated);
+ line=batch_readline(status.line_buff);
/*
Skip UTF8 Byte Order Marker (BOM) 0xEFBBBF.
Editors like "notepad" put this marker in
@@ -1930,9 +1928,13 @@ static int read_and_execute(bool interactive)
if (opt_outfile && line)
fprintf(OUTFILE, "%s\n", line);
}
- if (!line) // End of file
+ // End of file or system error
+ if (!line)
{
- status.exit_status=0;
+ if (status.line_buff && status.line_buff->error)
+ status.exit_status= 1;
+ else
+ status.exit_status= 0;
break;
}
@@ -1953,7 +1955,8 @@ static int read_and_execute(bool interactive)
#endif
continue;
}
- if (add_line(glob_buffer,line,&in_string,&ml_comment, truncated))
+ if (add_line(glob_buffer, line, &in_string, &ml_comment,
+ status.line_buff ? status.line_buff->truncated : 0))
break;
}
/* if in batch mode, send last query even if it doesn't end with \g or go */
@@ -2718,6 +2721,10 @@ static void get_current_db()
{
MYSQL_RES *res;
+ /* If one_database is set, current_db is not supposed to change. */
+ if (one_database)
+ return;
+
my_free(current_db);
current_db= NULL;
/* In case of error below current_db will be NULL */
@@ -3760,7 +3767,8 @@ print_tab_data(MYSQL_RES *result)
}
static int
-com_tee(String *buffer, char *line __attribute__((unused)))
+com_tee(String *buffer __attribute__((unused)),
+ char *line __attribute__((unused)))
{
char file_name[FN_REFLEN], *end, *param;
@@ -3819,7 +3827,8 @@ com_notee(String *buffer __attribute__((unused)),
#ifdef USE_POPEN
static int
-com_pager(String *buffer, char *line __attribute__((unused)))
+com_pager(String *buffer __attribute__((unused)),
+ char *line __attribute__((unused)))
{
char pager_name[FN_REFLEN], *end, *param;
@@ -3949,7 +3958,8 @@ com_rehash(String *buffer __attribute__((unused)),
#ifdef USE_POPEN
static int
-com_shell(String *buffer, char *line __attribute__((unused)))
+com_shell(String *buffer __attribute__((unused)),
+ char *line __attribute__((unused)))
{
char *shell_cmd;
@@ -4041,7 +4051,8 @@ com_connect(String *buffer, char *line)
}
-static int com_source(String *buffer, char *line)
+static int com_source(String *buffer __attribute__((unused)),
+ char *line)
{
char source_name[FN_REFLEN], *end, *param;
LINE_BUFFER *line_buff;
@@ -4395,8 +4406,8 @@ sql_real_connect(char *host,char *database,char *user,char *password,
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
if (!mysql_real_connect(&mysql, host, user, password,
- database, opt_mysql_port, opt_mysql_unix_port,
- connect_flag | CLIENT_MULTI_STATEMENTS))
+ database, opt_mysql_port, opt_mysql_unix_port,
+ connect_flag | CLIENT_MULTI_STATEMENTS))
{
if (!silent ||
(mysql_errno(&mysql) != CR_CONN_HOST_ERROR &&
@@ -5032,7 +5043,8 @@ static void init_username()
}
}
-static int com_prompt(String *buffer, char *line)
+static int com_prompt(String *buffer __attribute__((unused)),
+ char *line)
{
char *ptr=strchr(line, ' ');
prompt_counter = 0;
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 5045ee0f8cb..936968cbcae 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Copyright (C) 2010 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@@ -18,6 +18,8 @@
#include <sslopt-vars.h>
#include "../scripts/mysql_fix_privilege_tables_sql.c"
+#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
+
#define VER "1.2"
#ifdef HAVE_SYS_WAIT_H
@@ -45,6 +47,8 @@ static DYNAMIC_STRING ds_args;
static DYNAMIC_STRING conn_args;
static char *opt_password= 0;
+static char *opt_plugin_dir= 0, *opt_default_auth= 0;
+
static my_bool tty_password= 0;
static char opt_tmpdir[FN_REFLEN] = "";
@@ -92,6 +96,10 @@ static struct my_option my_long_options[]=
{"default-character-set", OPT_DEFAULT_CHARSET,
"Not used by mysql_upgrade. Only for backward compatibility.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"default_auth", OPT_DEFAULT_AUTH,
+ "Default authentication client-side plugin to use.",
+ &opt_default_auth, &opt_default_auth, 0,
+ GET_STR, REQUIRED_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.",
&opt_force, &opt_force, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -105,6 +113,9 @@ 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
+ {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
+ &opt_plugin_dir, &opt_plugin_dir, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@@ -238,7 +249,8 @@ get_one_option(int optid, const struct my_option *opt,
case '?':
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");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
+ puts("MariaDB utility for upgrading databases to new MariaDB versions.\n");
my_print_help(my_long_options);
exit(0);
break;
@@ -301,6 +313,8 @@ get_one_option(int optid, const struct my_option *opt,
case 'S': /* --socket */
case OPT_MYSQL_PROTOCOL: /* --protocol */
case OPT_SHARED_MEMORY_BASE_NAME: /* --shared-memory-base-name */
+ case OPT_PLUGIN_DIR: /* --plugin-dir */
+ case OPT_DEFAULT_AUTH: /* --default-auth */
add_one_option(&conn_args, opt, argument);
break;
}
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index 83b034a61b5..b0765f90f5a 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -17,12 +17,11 @@
#include "client_priv.h"
#include <signal.h>
-#ifdef THREAD
#include <my_pthread.h> /* because of signal() */
-#endif
#include <sys/stat.h>
#include <mysql.h>
#include <sql_common.h>
+#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
#define ADMIN_VERSION "9.0"
#define MAX_MYSQL_VAR 512
@@ -43,6 +42,7 @@ 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 char * unix_port=0;
+static char *opt_plugin_dir= 0, *opt_default_auth= 0;
#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
@@ -211,6 +211,13 @@ static struct my_option my_long_options[] =
{"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", &opt_shutdown_timeout,
&opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
+ {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
+ &opt_plugin_dir, &opt_plugin_dir, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"default_auth", OPT_DEFAULT_AUTH,
+ "Default authentication client-side plugin to use.",
+ &opt_default_auth, &opt_default_auth, 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}
};
@@ -347,6 +354,12 @@ int main(int argc,char *argv[])
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
error_flags= (myf)(opt_nobeep ? 0 : ME_BELL);
+ if (opt_plugin_dir && *opt_plugin_dir)
+ mysql_options(&mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
+
+ if (opt_default_auth && *opt_default_auth)
+ mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
+
if (sql_connect(&mysql, option_wait))
{
/*
@@ -362,7 +375,8 @@ int main(int argc,char *argv[])
/* Return 0 if all commands are PING */
for (; argc > 0; argv++, argc--)
{
- if (find_type(argv[0], &command_typelib, 2) != ADMIN_PING)
+ if (find_type(argv[0], &command_typelib, FIND_TYPE_BASIC) !=
+ ADMIN_PING)
{
error= 1;
break;
@@ -406,6 +420,9 @@ int main(int argc,char *argv[])
if (interval) /* --sleep=interval given */
{
+ if (opt_count_iterations && --nr_iterations == 0)
+ break;
+
/*
If connection was dropped (unintentionally, or due to SHUTDOWN),
re-establish it if --wait ("retry-connect") was given and user
@@ -583,7 +600,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
for (; argc > 0 ; argv++,argc--)
{
int command;
- switch ((command= find_type(argv[0],&command_typelib,2))) {
+ switch ((command= find_type(argv[0],&command_typelib,FIND_TYPE_BASIC))) {
case ADMIN_CREATE:
{
char buff[FN_REFLEN+20];
@@ -681,9 +698,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
case ADMIN_VER:
new_line=1;
print_version();
- puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc,\n"
- "2009 Monty Program Ab");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
printf("Server version\t\t%s\n", mysql_get_server_info(mysql));
printf("Protocol version\t%d\n", mysql_get_proto_info(mysql));
printf("Connection\t\t%s\n",mysql_get_host_info(mysql));
@@ -1001,7 +1016,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
if (typed_password[0])
{
- bool old= (find_type(argv[0], &command_typelib, 2) ==
+ bool old= (find_type(argv[0], &command_typelib, FIND_TYPE_BASIC) ==
ADMIN_OLD_PASSWORD);
#ifdef __WIN__
size_t pw_len= strlen(typed_password);
@@ -1155,9 +1170,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc,\n"
- "2009 Monty Program Ab");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
puts("Administration program for the mysqld daemon.");
printf("Usage: %s [OPTIONS] command command....\n", my_progname);
my_print_help(my_long_options);
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 4b62bd12ceb..0cfb70ed028 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2004 MySQL AB
+/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,6 +35,7 @@
#include "sql_priv.h"
#include "log_event.h"
#include "sql_common.h"
+#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
/* Needed for Rpl_filter */
CHARSET_INFO* system_charset_info= &my_charset_utf8_general_ci;
@@ -88,6 +89,8 @@ static char* host = 0;
static int port= 0;
static uint my_end_arg;
static const char* sock= 0;
+static char *opt_plugin_dir= 0, *opt_default_auth= 0;
+
#ifdef HAVE_SMEM
static char *shared_memory_base_name= 0;
#endif
@@ -757,10 +760,18 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
*/
start_datetime= 0;
offset= 0; // print everything and protect against cycling rec_count
+ /*
+ Skip events according to the --server-id flag. However, don't
+ skip format_description or rotate events, because they they
+ are really "global" events that are relevant for the entire
+ binlog, even if they have a server_id. Also, we have to read
+ the format_description event so that we can parse subsequent
+ events.
+ */
+ if (ev_type != ROTATE_EVENT &&
+ server_id && (server_id != ev->server_id))
+ goto end;
}
- if (server_id && (server_id != ev->server_id))
- /* skip just this event, continue processing the log. */
- goto end;
if (((my_time_t)(ev->when) >= stop_datetime)
|| (pos >= stop_position_mot))
{
@@ -1012,7 +1023,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
passed --short-form, because --short-form disables printing
row events.
*/
- if (!print_event_info->printed_fd_event && !short_form)
+ if (!print_event_info->printed_fd_event && !short_form &&
+ opt_base64_output_mode != BASE64_OUTPUT_DECODE_ROWS)
{
const char* type_str= ev->get_type_str();
if (opt_base64_output_mode == BASE64_OUTPUT_NEVER)
@@ -1068,10 +1080,11 @@ static struct my_option my_long_options[] =
"row-based events; 'decode-rows' decodes row events into commented SQL "
"statements if the --verbose option is also given; 'auto' prints base64 "
"only when necessary (i.e., for row-based events and format description "
- "events); 'always' prints base64 whenever possible. 'always' is for "
- "debugging only and should not be used in a production system. If this "
- "argument is not given, the default is 'auto'; if it is given with no "
- "argument, 'always' is used.",
+ "events); 'always' prints base64 whenever possible. 'always' is "
+ "deprecated, will be removed in a future version, and should not be used "
+ "in a production system. --base64-output with no 'name' argument is "
+ "equivalent to --base64-output=always and is also deprecated. If no "
+ "--base64-output[=name] option is given at all, the default is 'auto'.",
&opt_base64_output_mode_str, &opt_base64_output_mode_str,
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
/*
@@ -1096,6 +1109,10 @@ static struct my_option my_long_options[] =
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
&debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"default_auth", OPT_DEFAULT_AUTH,
+ "Default authentication client-side plugin to use.",
+ &opt_default_auth, &opt_default_auth, 0,
+ GET_STR, REQUIRED_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 "
@@ -1121,6 +1138,9 @@ static struct my_option my_long_options[] =
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},
+ {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
+ &opt_plugin_dir, &opt_plugin_dir, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@@ -1302,10 +1322,7 @@ static void print_version()
static void usage()
{
print_version();
- puts("By Monty and Sasha, for your professional use\n\
-This software comes with NO WARRANTY: This is free software,\n\
-and you are welcome to modify and redistribute it under the GPL license.\n");
-
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2001, 2010"));
printf("\
Dumps a MySQL binary log in a format usable for viewing or for piping to\n\
the mysql command line client.\n\n");
@@ -1496,6 +1513,12 @@ static Exit_status safe_connect()
return ERROR_STOP;
}
+ if (opt_plugin_dir && *opt_plugin_dir)
+ mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
+
+ if (opt_default_auth && *opt_default_auth)
+ mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
+
if (opt_protocol)
mysql_options(mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
#ifdef HAVE_SMEM
@@ -2150,6 +2173,13 @@ int main(int argc, char** argv)
if (opt_base64_output_mode == BASE64_OUTPUT_UNSPEC)
opt_base64_output_mode= BASE64_OUTPUT_AUTO;
+ if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
+ warning("The --base64-output=always flag and the --base64-output flag "
+ "(with '=MODE' omitted), are deprecated. "
+ "The output generated when these flags are used cannot be "
+ "parsed by mysql 5.6.0 and later. "
+ "The flags will be removed in a future version. "
+ "Please use --base64-output=auto instead.");
my_set_max_open_files(open_files_limit);
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index f5a2c4600f8..c4242e1331e 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -1,6 +1,5 @@
-/* Copyright (C) 2000 MySQL AB & Jani Tolonen
- Copyright (C) 2009 Sun Microsystems, Inc
- Copyright (C) 2010 Monty Program Ab
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (C) 2010-2011 Monty Program 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
@@ -24,6 +23,7 @@
#include <mysql_version.h>
#include <mysqld_error.h>
#include <sslopt-vars.h>
+#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
/* Exit codes */
@@ -43,14 +43,15 @@ static int my_end_arg;
static char * opt_mysql_unix_port = 0;
static char *opt_password = 0, *current_user = 0,
*default_charset= 0, *current_host= 0;
+static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static int first_error = 0;
-DYNAMIC_ARRAY tables4repair;
+DYNAMIC_ARRAY tables4repair, tables4rebuild;
#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
#endif
static uint opt_protocol=0;
-enum operations { DO_CHECK, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE };
+enum operations { DO_CHECK=1, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE };
static struct my_option my_long_options[] =
{
@@ -102,6 +103,10 @@ static struct my_option my_long_options[] =
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", &default_charset,
&default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"default_auth", OPT_DEFAULT_AUTH,
+ "Default authentication client-side plugin to use.",
+ &opt_default_auth, &opt_default_auth, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fast",'F', "Check only tables that haven't been closed properly.",
&opt_fast, &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
@@ -139,6 +144,9 @@ 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
+ {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
+ &opt_plugin_dir, &opt_plugin_dir, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@@ -217,9 +225,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts("By Jani Tolonen, 2001-04-20, MySQL Development Team.\n");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
- puts("and you are welcome to modify and redistribute it under the GPL license.\n");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
printf("Usage: %s [OPTIONS] database [tables]\n", my_progname);
printf("OR %s [OPTIONS] --databases DB1 [DB2 DB3...]\n",
my_progname);
@@ -248,6 +254,8 @@ static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
+ int orig_what_to_do= what_to_do;
+
switch(optid) {
case 'a':
what_to_do = DO_ANALYZE;
@@ -322,6 +330,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt->name);
break;
}
+
+ if (orig_what_to_do && (what_to_do != orig_what_to_do))
+ {
+ fprintf(stderr, "Error: %s doesn't support multiple contradicting commands.\n",
+ my_progname);
+ return 1;
+ }
return 0;
}
@@ -628,6 +643,27 @@ static int fix_database_storage_name(const char *name)
return rc;
}
+static int rebuild_table(char *name)
+{
+ char *query, *ptr;
+ int rc= 0;
+ query= (char*)my_malloc(sizeof(char) * (12 + fixed_name_length(name) + 6 + 1),
+ MYF(MY_WME));
+ if (!query)
+ return 1;
+ ptr= strmov(query, "ALTER TABLE ");
+ ptr= fix_table_name(ptr, name);
+ ptr= strxmov(ptr, " FORCE", NullS);
+ if (mysql_real_query(sock, query, (uint)(ptr - query)))
+ {
+ fprintf(stderr, "Failed to %s\n", query);
+ fprintf(stderr, "Error: %s\n", mysql_error(sock));
+ rc= 1;
+ }
+ my_free(query);
+ return rc;
+}
+
static int process_one_db(char *database)
{
if (verbose)
@@ -744,7 +780,7 @@ static void print_result()
MYSQL_ROW row;
char prev[(NAME_LEN+9)*2+2];
uint i;
- my_bool found_error=0;
+ my_bool found_error=0, table_rebuild=0;
res = mysql_use_result(sock);
@@ -763,8 +799,14 @@ static void print_result()
*/
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
strcmp(row[3],"OK"))
- insert_dynamic(&tables4repair, (uchar*) prev);
+ {
+ if (table_rebuild)
+ insert_dynamic(&tables4rebuild, (uchar*) prev);
+ else
+ insert_dynamic(&tables4repair, (uchar*) prev);
+ }
found_error=0;
+ table_rebuild=0;
if (opt_silent)
continue;
}
@@ -782,7 +824,11 @@ static void print_result()
else
printf("%s\n%-9s: %s", row[0], row[2], row[3]);
if (strcmp(row[2],"note"))
+ {
found_error=1;
+ if (opt_auto_repair && strstr(row[3], "ALTER TABLE") != NULL)
+ table_rebuild=1;
+ }
}
else
printf("%-9s: %s", row[2], row[3]);
@@ -791,7 +837,12 @@ 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, (uchar*) prev);
+ {
+ if (table_rebuild)
+ insert_dynamic(&tables4rebuild, (uchar*) prev);
+ else
+ insert_dynamic(&tables4repair, (uchar*) prev);
+ }
mysql_free_result(res);
}
@@ -817,6 +868,13 @@ static int dbConnect(char *host, char *user, char *passwd)
if (shared_memory_base_name)
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
+
+ if (opt_plugin_dir && *opt_plugin_dir)
+ mysql_options(&mysql_connection, MYSQL_PLUGIN_DIR, opt_plugin_dir);
+
+ if (opt_default_auth && *opt_default_auth)
+ mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth);
+
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd,
NULL, opt_mysql_port, opt_mysql_unix_port, 0)))
@@ -883,7 +941,8 @@ int main(int argc, char **argv)
}
if (opt_auto_repair &&
- my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64))
+ (my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64) ||
+ my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,64)))
{
first_error = 1;
goto end;
@@ -901,7 +960,7 @@ int main(int argc, char **argv)
{
uint i;
- if (!opt_silent && tables4repair.elements)
+ if (!opt_silent && (tables4repair.elements || tables4rebuild.elements))
puts("\nRepairing tables");
what_to_do = DO_REPAIR;
for (i = 0; i < tables4repair.elements ; i++)
@@ -909,11 +968,16 @@ int main(int argc, char **argv)
char *name= (char*) dynamic_array_ptr(&tables4repair, i);
handle_request_for_tables(name, fixed_name_length(name));
}
+ for (i = 0; i < tables4rebuild.elements ; i++)
+ rebuild_table((char*) dynamic_array_ptr(&tables4rebuild, i));
}
end:
dbDisconnect(current_host);
if (opt_auto_repair)
+ {
delete_dynamic(&tables4repair);
+ delete_dynamic(&tables4rebuild);
+ }
my_free(opt_password);
#ifdef HAVE_SMEM
my_free(shared_memory_base_name);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 34055f3db67..a8b8c0964fe 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -51,6 +51,8 @@
#include "mysql_version.h"
#include "mysqld_error.h"
+#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
+
/* Exit codes */
#define EX_USAGE 1
@@ -135,6 +137,7 @@ FILE *stderror_file=0;
static char *shared_memory_base_name=0;
#endif
static uint opt_protocol= 0;
+static char *opt_plugin_dir= 0, *opt_default_auth= 0;
/*
Dynamic_string wrapper functions. In this file use these
@@ -497,6 +500,13 @@ static struct my_option my_long_options[] =
&where, &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},
+ {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
+ &opt_plugin_dir, &opt_plugin_dir, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"default_auth", OPT_DEFAULT_AUTH,
+ "Default authentication client-side plugin to use.",
+ &opt_default_auth, &opt_default_auth, 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}
};
@@ -584,8 +594,7 @@ static void short_usage_sub(void)
static void usage(void)
{
print_version();
- puts("By Igor Romanenko, Monty, Jani & Sinisa.");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
puts("Dumping structure and contents of MySQL databases and tables.");
short_usage_sub();
print_defaults("my",load_default_groups);
@@ -1144,6 +1153,9 @@ static int switch_db_collation(FILE *sql_file,
{
if (strcmp(current_db_cl_name, required_db_cl_name) != 0)
{
+ char quoted_db_buf[NAME_LEN * 2 + 3];
+ char *quoted_db_name= quote_name(db_name, quoted_db_buf, FALSE);
+
CHARSET_INFO *db_cl= get_charset_by_name(required_db_cl_name, MYF(0));
if (!db_cl)
@@ -1151,7 +1163,7 @@ static int switch_db_collation(FILE *sql_file,
fprintf(sql_file,
"ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s\n",
- (const char *) db_name,
+ (const char *) quoted_db_name,
(const char *) db_cl->csname,
(const char *) db_cl->name,
(const char *) delimiter);
@@ -1172,6 +1184,9 @@ static int restore_db_collation(FILE *sql_file,
const char *delimiter,
const char *db_cl_name)
{
+ char quoted_db_buf[NAME_LEN * 2 + 3];
+ char *quoted_db_name= quote_name(db_name, quoted_db_buf, FALSE);
+
CHARSET_INFO *db_cl= get_charset_by_name(db_cl_name, MYF(0));
if (!db_cl)
@@ -1179,7 +1194,7 @@ static int restore_db_collation(FILE *sql_file,
fprintf(sql_file,
"ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s\n",
- (const char *) db_name,
+ (const char *) quoted_db_name,
(const char *) db_cl->csname,
(const char *) db_cl->name,
(const char *) delimiter);
@@ -1452,6 +1467,13 @@ static int connect_to_db(char *host, char *user,char *passwd)
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
+
+ if (opt_plugin_dir && *opt_plugin_dir)
+ mysql_options(&mysql_connection, MYSQL_PLUGIN_DIR, opt_plugin_dir);
+
+ if (opt_default_auth && *opt_default_auth)
+ mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth);
+
if (!(mysql= mysql_real_connect(&mysql_connection,host,user,passwd,
NULL,opt_mysql_port,opt_mysql_unix_port,
0)))
@@ -2222,6 +2244,15 @@ static uint get_table_structure(char *table, char *db, char *table_type,
const char *insert_option;
char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3];
char table_buff2[NAME_LEN*2+3], query_buff[QUERY_LENGTH];
+ const char *show_fields_stmt= "SELECT `COLUMN_NAME` AS `Field`, "
+ "`COLUMN_TYPE` AS `Type`, "
+ "`IS_NULLABLE` AS `Null`, "
+ "`COLUMN_KEY` AS `Key`, "
+ "`COLUMN_DEFAULT` AS `Default`, "
+ "`EXTRA` AS `Extra`, "
+ "`COLUMN_COMMENT` AS `Comment` "
+ "FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE "
+ "TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'";
FILE *sql_file= md_result_file;
int len;
MYSQL_RES *result;
@@ -2489,8 +2520,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
verbose_msg("%s: Warning: Can't set SQL_QUOTE_SHOW_CREATE option (%s)\n",
my_progname, mysql_error(mysql));
- my_snprintf(query_buff, sizeof(query_buff), "show fields from %s",
- result_table);
+ my_snprintf(query_buff, sizeof(query_buff), show_fields_stmt, db, table);
+
if (mysql_query_with_error_report(mysql, &result, query_buff))
DBUG_RETURN(0);
@@ -4620,7 +4651,7 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length,
for (; pos != end && *pos != ','; pos++) ;
var_len= (uint) (pos - start);
strmake(buff, start, min(sizeof(buff) - 1, var_len));
- find= find_type(buff, lib, var_len);
+ find= find_type(buff, lib, FIND_TYPE_BASIC);
if (!find)
{
*err_pos= (char*) start;
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 593d43c0c80..e15bbdddfb9 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,6 +32,8 @@
#include <my_pthread.h>
#endif
+#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
+
/* Global Thread counter */
uint counter;
@@ -58,6 +60,7 @@ static char *opt_password=0, *current_user=0,
*default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
static uint opt_mysql_port= 0, opt_protocol= 0;
static char * opt_mysql_unix_port=0;
+static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static longlong opt_ignore_lines= -1;
#include <sslopt-vars.h>
@@ -88,6 +91,10 @@ static struct my_option my_long_options[] =
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
&debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"default_auth", OPT_DEFAULT_AUTH,
+ "Default authentication client-side plugin to use.",
+ &opt_default_auth, &opt_default_auth, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delete", 'd', "First delete all rows from table.", &opt_delete,
&opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"fields-terminated-by", OPT_FTB,
@@ -137,6 +144,9 @@ 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
+ {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
+ &opt_plugin_dir, &opt_plugin_dir, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@@ -191,8 +201,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
printf("\
Loads tables from text files in various formats. The base name of the\n\
text file must be the name of the table that should be used.\n\
@@ -428,6 +437,13 @@ static MYSQL *db_connect(char *host, char *database,
if (shared_memory_base_name)
mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
+
+ if (opt_plugin_dir && *opt_plugin_dir)
+ mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
+
+ if (opt_default_auth && *opt_default_auth)
+ mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
+
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(mysql_real_connect(mysql,host,user,passwd,
database,opt_mysql_port,opt_mysql_unix_port,
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 3cc551d2092..255ea3c38bb 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
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
@@ -25,6 +25,7 @@
#include <signal.h>
#include <stdarg.h>
#include <sslopt-vars.h>
+#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
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;
@@ -33,6 +34,7 @@ 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_AUTODETECT_CHARSET_NAME;
+static char *opt_plugin_dir= 0, *opt_default_auth= 0;
#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
@@ -123,6 +125,12 @@ int main(int argc, char **argv)
#endif
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
+ if (opt_plugin_dir && *opt_plugin_dir)
+ mysql_options(&mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
+
+ if (opt_default_auth && *opt_default_auth)
+ mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
+
if (!(mysql_real_connect(&mysql,host,user,opt_password,
(first_argument_uses_wildcards) ? "" :
argv[0],opt_mysql_port,opt_mysql_unix_port,
@@ -181,6 +189,10 @@ static struct my_option my_long_options[] =
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
&debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"default_auth", OPT_DEFAULT_AUTH,
+ "Default authentication client-side plugin to use.",
+ &opt_default_auth, &opt_default_auth, 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.", &host, &host, 0, GET_STR,
@@ -194,6 +206,9 @@ static struct my_option my_long_options[] =
"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},
+ {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
+ &opt_plugin_dir, &opt_plugin_dir, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@@ -247,8 +262,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010)"));
puts("Shows the structure of a MySQL database (databases, tables, and columns).\n");
printf("Usage: %s [OPTIONS] [database [table [column]]]\n",my_progname);
puts("\n\
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 6d93bd73efe..00f9420159e 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,12 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- original idea: Brian Aker via playing with ab for too many years
- coded by: Patrick Galbraith
-*/
-
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
MySQL Slap
@@ -94,6 +89,7 @@ TODO:
#include <sys/wait.h>
#endif
#include <ctype.h>
+#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
#ifdef __WIN__
#define srandom srand
@@ -126,12 +122,13 @@ static char *host= NULL, *opt_password= NULL, *user= NULL,
*pre_system= NULL,
*post_system= NULL,
*opt_mysql_unix_port= NULL;
+static char *opt_plugin_dir= 0, *opt_default_auth= 0;
const char *delimiter= "\n";
const char *create_schema_string= "mysqlslap";
-static my_bool opt_preserve= TRUE;
+static my_bool opt_preserve= TRUE, opt_no_drop= FALSE;
static my_bool debug_info_flag= 0, debug_check_flag= 0;
static my_bool opt_only_print= FALSE;
static my_bool opt_compress= FALSE, tty_password= FALSE,
@@ -348,6 +345,12 @@ int main(int argc, char **argv)
mysql_init(&mysql);
set_mysql_connect_options(&mysql);
+ if (opt_plugin_dir && *opt_plugin_dir)
+ mysql_options(&mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
+
+ if (opt_default_auth && *opt_default_auth)
+ mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
+
if (!opt_only_print)
{
if (!(mysql_real_connect(&mysql, host, user, opt_password,
@@ -599,6 +602,10 @@ static struct my_option my_long_options[] =
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
&debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"default_auth", OPT_DEFAULT_AUTH,
+ "Default authentication client-side plugin to use.",
+ &opt_default_auth, &opt_default_auth, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delimiter", 'F',
"Delimiter to use in SQL statements supplied in file or command line.",
(char**) &delimiter, (char**) &delimiter, 0, GET_STR, REQUIRED_ARG,
@@ -617,6 +624,8 @@ static struct my_option my_long_options[] =
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"iterations", 'i', "Number of times to run the tests.", &iterations,
&iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
+ {"no-drop", OPT_SLAP_NO_DROP, "Do not drop the schema after the test.",
+ &opt_no_drop, &opt_no_drop, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"number-char-cols", 'x',
"Number of VARCHAR columns to create in table if specifying --auto-generate-sql.",
(char**) &num_char_cols_opt, (char**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
@@ -641,6 +650,9 @@ 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
+ {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
+ &opt_plugin_dir, &opt_plugin_dir, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection.", &opt_mysql_port,
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
0},
@@ -703,8 +715,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
- puts("Copyright (C) 2005 MySQL AB");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2005, 2010"));
puts("Run a query multiple times against the server.\n");
printf("Usage: %s [OPTIONS]\n",my_progname);
print_defaults("my",load_default_groups);
@@ -1159,8 +1170,11 @@ get_options(int *argc,char ***argv)
if (!user)
user= (char *)"root";
- /* If something is created we clean it up, otherwise we leave schemas alone */
- if (create_string || auto_generate_sql)
+ /*
+ If something is created and --no-drop is not specified, we drop the
+ schema.
+ */
+ if (!opt_no_drop && (create_string || auto_generate_sql))
opt_preserve= FALSE;
if (auto_generate_sql && (create_string || user_supplied_query))
@@ -1533,7 +1547,12 @@ generate_primary_key_list(MYSQL *mysql, option_string *engine_stmt)
exit(1);
}
- result= mysql_store_result(mysql);
+ if (!(result= mysql_store_result(mysql)))
+ {
+ fprintf(stderr, "%s: Error when storing result: %d %s\n",
+ my_progname, mysql_errno(mysql), mysql_error(mysql));
+ exit(1);
+ }
primary_keys_number_of= mysql_num_rows(result);
/* So why check this? Blackhole :) */
@@ -1907,17 +1926,15 @@ limit_not_met:
{
if (mysql_field_count(mysql))
{
- if ((result= mysql_store_result(mysql)))
+ if (!(result= mysql_store_result(mysql)))
+ fprintf(stderr, "%s: Error when storing result: %d %s\n",
+ my_progname, mysql_errno(mysql), mysql_error(mysql));
+ else
{
- while ((row = mysql_fetch_row(result)))
+ while ((row= mysql_fetch_row(result)))
counter++;
mysql_free_result(result);
}
- else
- {
- fprintf(stderr,"%s: Error in mysql_store_result(): %d %s\n",
- my_progname, mysql_errno(mysql), mysql_error(mysql));
- }
}
} while(mysql_next_result(mysql) == 0);
queries++;
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 802e94b8d7c..f6aa3ee8e8b 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
mysqltest
@@ -52,6 +52,8 @@
#include <signal.h>
#include <my_stacktrace.h>
+#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
+
#ifdef __WIN__
#include <crtdbg.h>
#define SIGNAL_FMT "exception 0x%x"
@@ -197,6 +199,8 @@ static ulonglong timer_now(void);
static ulong connection_retry_sleep= 100000; /* Microseconds */
+static char *opt_plugin_dir= 0;
+
/* Precompiled re's */
static my_regex_t ps_re; /* the query can be run using PS protocol */
static my_regex_t sp_re; /* the query can be run as a SP */
@@ -238,8 +242,9 @@ typedef struct
int str_val_len;
int int_val;
int alloced_len;
- int int_dirty; /* do not update string if int is updated until first read */
- int alloced;
+ bool int_dirty; /* do not update string if int is updated until first read */
+ bool is_int;
+ bool alloced;
} VAR;
/*Perl/shell-like variable registers */
@@ -465,7 +470,7 @@ struct st_command
char *query, *query_buf,*first_argument,*last_argument,*end;
DYNAMIC_STRING content;
int first_word_len, query_len;
- my_bool abort_on_error;
+ my_bool abort_on_error, used_replace;
struct st_expected_errors expected_errors;
char require_file[FN_REFLEN];
enum enum_commands type;
@@ -475,6 +480,8 @@ TYPELIB command_typelib= {array_elements(command_names),"",
command_names, 0};
DYNAMIC_STRING ds_res;
+/* Points to ds_warning in run_query, so it can be freed */
+DYNAMIC_STRING *ds_warn= 0;
char builtin_echo[FN_REFLEN];
@@ -494,7 +501,8 @@ VAR* var_init(VAR* v, const char *name, int name_len, const char *val,
int val_len);
VAR* var_get(const char *var_name, const char** var_name_end,
my_bool raw, my_bool ignore_not_existing);
-void eval_expr(VAR* v, const char *p, const char** p_end);
+void eval_expr(VAR* v, const char *p, const char** p_end,
+ bool open_end=false, bool do_eval=true);
my_bool match_delimiter(int c, const char *delim, uint length);
void dump_result_to_reject_file(char *buf, int size);
void dump_warning_messages();
@@ -788,7 +796,7 @@ end_thread:
static void wait_query_thread_done(struct st_connection *con)
{
- DBUG_ASSERT(con->tid);
+ DBUG_ASSERT(con->has_thread);
if (!con->query_done)
{
pthread_mutex_lock(&con->result_mutex);
@@ -801,7 +809,7 @@ static void wait_query_thread_done(struct st_connection *con)
static void signal_connection_thd(struct st_connection *cn, int command)
{
- DBUG_ASSERT(cn->tid);
+ DBUG_ASSERT(cn->has_thread);
cn->query_done= 0;
cn->command= command;
pthread_mutex_lock(&cn->query_mutex);
@@ -813,13 +821,13 @@ static void signal_connection_thd(struct st_connection *cn, int command)
/*
Sometimes we try to execute queries when the connection is closed.
It's done to make sure it was closed completely.
- So that if our connection is closed (cn->tid == 0), we just return
+ So that if our connection is closed (cn->has_thread == 0), we just return
the mysql_send_query() result which is an error in this case.
*/
static int do_send_query(struct st_connection *cn, const char *q, int q_len)
{
- if (!cn->tid)
+ if (!cn->has_thread)
return mysql_send_query(&cn->mysql, q, q_len);
cn->cur_query= q;
cn->cur_query_len= q_len;
@@ -829,7 +837,7 @@ static int do_send_query(struct st_connection *cn, const char *q, int q_len)
static int do_read_query_result(struct st_connection *cn)
{
- DBUG_ASSERT(cn->tid);
+ DBUG_ASSERT(cn->has_thread);
wait_query_thread_done(cn);
signal_connection_thd(cn, EMB_READ_QUERY_RESULT);
wait_query_thread_done(cn);
@@ -840,12 +848,12 @@ static int do_read_query_result(struct st_connection *cn)
static void emb_close_connection(struct st_connection *cn)
{
- if (!cn->tid)
+ if (!cn->has_thread)
return;
wait_query_thread_done(cn);
signal_connection_thd(cn, EMB_END_CONNECTION);
pthread_join(cn->tid, NULL);
- cn->tid= 0;
+ cn->has_thread= FALSE;
pthread_mutex_destroy(&cn->query_mutex);
pthread_cond_destroy(&cn->query_cond);
pthread_mutex_destroy(&cn->result_mutex);
@@ -863,6 +871,7 @@ static void init_connection_thd(struct st_connection *cn)
pthread_cond_init(&cn->result_cond, NULL) ||
pthread_create(&cn->tid, &cn_thd_attrib, connection_thread, (void*)cn))
die("Error in the thread library");
+ cn->has_thread=TRUE;
}
#else /*EMBEDDED_LIBRARY*/
@@ -1180,8 +1189,8 @@ void handle_command_error(struct st_command *command, uint error,
int i;
if (command->abort_on_error)
- die("command \"%.*s\" failed with error %d",
- command->first_word_len, command->query, error);
+ die("command \"%.*s\" failed with error %d. my_errno=%d",
+ command->first_word_len, command->query, error, my_errno);
i= match_expected_error(command, error, NULL);
@@ -1287,6 +1296,8 @@ void free_used_memory()
my_free(embedded_server_args[--embedded_server_arg_count]);
delete_dynamic(&q_lines);
dynstr_free(&ds_res);
+ if (ds_warn)
+ dynstr_free(ds_warn);
free_all_replace();
my_free(opt_pass);
free_defaults(default_argv);
@@ -1330,6 +1341,17 @@ static void cleanup_and_exit(int exit_code)
exit(exit_code);
}
+void print_file_stack()
+{
+ for (struct st_test_file* err_file= cur_file;
+ err_file != file_stack;
+ err_file--)
+ {
+ fprintf(stderr, "included from %s at line %d:\n",
+ err_file->file_name, err_file->lineno);
+ }
+}
+
void die(const char *fmt, ...)
{
static int dying= 0;
@@ -1340,8 +1362,12 @@ void die(const char *fmt, ...)
/* Print the error message */
fprintf(stderr, "mysqltest: ");
if (cur_file && cur_file != file_stack)
- fprintf(stderr, "In included file \"%s\": ",
+ {
+ fprintf(stderr, "In included file \"%s\": \n",
cur_file->file_name);
+ print_file_stack();
+ }
+
if (start_lineno > 0)
fprintf(stderr, "At line %u: ", start_lineno);
if (fmt)
@@ -1380,7 +1406,6 @@ void die(const char *fmt, ...)
void abort_not_supported_test(const char *fmt, ...)
{
va_list args;
- struct st_test_file* err_file= cur_file;
DBUG_ENTER("abort_not_supported_test");
/* Print include filestack */
@@ -1388,13 +1413,8 @@ void abort_not_supported_test(const char *fmt, ...)
fprintf(stderr, "The test '%s' is not supported by this installation\n",
file_stack->file_name);
fprintf(stderr, "Detected in file %s at line %d\n",
- err_file->file_name, err_file->lineno);
- while (err_file != file_stack)
- {
- err_file--;
- fprintf(stderr, "included from %s at line %d\n",
- err_file->file_name, err_file->lineno);
- }
+ cur_file->file_name, cur_file->lineno);
+ print_file_stack();
/* Print error message */
va_start(args, fmt);
@@ -2079,6 +2099,23 @@ static void var_free(void *v)
C_MODE_END
+void var_check_int(VAR *v)
+{
+ char *endptr;
+ char *str= v->str_val;
+
+ /* Initially assume not a number */
+ v->int_val= 0;
+ v->is_int= false;
+ v->int_dirty= false;
+ if (!str) return;
+
+ v->int_val = (int) strtol(str, &endptr, 10);
+ /* It is an int if strtol consumed something up to end/space/tab */
+ if (endptr > str && (!*endptr || *endptr == ' ' || *endptr == '\t'))
+ v->is_int= true;
+}
+
VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
int val_len)
@@ -2089,9 +2126,11 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
name_len = strlen(name);
if (!val_len && val)
val_len = strlen(val) ;
+ if (!val)
+ val_len= 0;
val_alloc_len = val_len + 16; /* room to grow */
if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(sizeof(*tmp_var)
- + name_len+1, MYF(MY_WME))))
+ + name_len+2, MYF(MY_WME))))
die("Out of memory");
if (name != NULL)
@@ -2109,15 +2148,13 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
die("Out of memory");
if (val)
- {
memcpy(tmp_var->str_val, val, val_len);
- tmp_var->str_val[val_len]= 0;
- }
+ tmp_var->str_val[val_len]= 0;
+
+ var_check_int(tmp_var);
tmp_var->name_len = name_len;
tmp_var->str_val_len = val_len;
tmp_var->alloced_len = val_alloc_len;
- tmp_var->int_val = (val) ? atoi(val) : 0;
- tmp_var->int_dirty = 0;
return tmp_var;
}
@@ -2178,7 +2215,7 @@ VAR* var_get(const char *var_name, const char **var_name_end, my_bool raw,
if (!raw && v->int_dirty)
{
sprintf(v->str_val, "%d", v->int_val);
- v->int_dirty = 0;
+ v->int_dirty= false;
v->str_val_len = strlen(v->str_val);
}
if (var_name_end)
@@ -2240,7 +2277,7 @@ void var_set(const char *var_name, const char *var_name_end,
if (v->int_dirty)
{
sprintf(v->str_val, "%d", v->int_val);
- v->int_dirty= 0;
+ v->int_dirty=false;
v->str_val_len= strlen(v->str_val);
}
/* setenv() expects \0-terminated strings */
@@ -2355,7 +2392,8 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
dynstr_append_mem(&result, "\t", 1);
}
end= result.str + result.length-1;
- eval_expr(var, result.str, (const char**) &end);
+ /* Evaluation should not recurse via backtick */
+ eval_expr(var, result.str, (const char**) &end, false, false);
dynstr_free(&result);
}
else
@@ -2534,7 +2572,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
break;
}
}
- eval_expr(var, value, 0);
+ eval_expr(var, value, 0, false, false);
}
dynstr_free(&ds_query);
mysql_free_result(res);
@@ -2546,6 +2584,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
void var_copy(VAR *dest, VAR *src)
{
dest->int_val= src->int_val;
+ dest->is_int= src->is_int;
dest->int_dirty= src->int_dirty;
/* Alloc/realloc data for str_val in dest */
@@ -2564,12 +2603,17 @@ void var_copy(VAR *dest, VAR *src)
}
-void eval_expr(VAR *v, const char *p, const char **p_end)
+void eval_expr(VAR *v, const char *p, const char **p_end,
+ bool open_end, bool do_eval)
{
DBUG_ENTER("eval_expr");
DBUG_PRINT("enter", ("p: '%s'", p));
+ /* Skip to treat as pure string if no evaluation */
+ if (! do_eval)
+ goto NO_EVAL;
+
if (*p == '$')
{
VAR *vp;
@@ -2582,7 +2626,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
/* Make sure there was just a $variable and nothing else */
const char* end= *p_end + 1;
- if (end < expected_end)
+ if (end < expected_end && !open_end)
die("Found junk '%.*s' after $variable in expression",
(int)(expected_end - end - 1), end);
@@ -2612,6 +2656,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
}
}
+ NO_EVAL:
{
int new_val_len = (p_end && *p_end) ?
(int) (*p_end - p) : (int) strlen(p);
@@ -2629,9 +2674,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
v->str_val_len = new_val_len;
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;
+ var_check_int(v);
}
DBUG_VOID_RETURN;
}
@@ -2978,6 +3021,8 @@ int do_modify_var(struct st_command *command,
die("The argument to %.*s must be a variable (start with $)",
command->first_word_len, command->query);
v= var_get(p, &p, 1, 0);
+ if (! v->is_int)
+ die("Cannot perform inc/dec on a non-numeric value");
switch (op) {
case DO_DEC:
v->int_val--;
@@ -2989,7 +3034,7 @@ int do_modify_var(struct st_command *command,
die("Invalid operator to do_modify_var");
break;
}
- v->int_dirty= 1;
+ v->int_dirty= true;
command->last_argument= (char*)++p;
return 0;
}
@@ -3465,7 +3510,7 @@ static int get_list_files(DYNAMIC_STRING *ds, const DYNAMIC_STRING *ds_dirname,
if (ds_wild && ds_wild->length &&
wild_compare(file->name, ds_wild->str, 0))
continue;
- dynstr_append(ds, file->name);
+ replace_dynstr_append(ds, file->name);
dynstr_append(ds, "\n");
}
set_wild_chars(0);
@@ -3495,6 +3540,7 @@ static void do_list_files(struct st_command *command)
{"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"}
};
DBUG_ENTER("do_list_files");
+ command->used_replace= 1;
check_command_args(command, command->first_argument,
list_files_args,
@@ -3536,6 +3582,7 @@ static void do_list_files_write_file_command(struct st_command *command,
{"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"}
};
DBUG_ENTER("do_list_files_write_file");
+ command->used_replace= 1;
check_command_args(command, command->first_argument,
list_files_args,
@@ -4260,7 +4307,7 @@ int do_save_master_pos()
const char latest_applied_binlog_epoch_str[]=
"latest_applied_binlog_epoch=";
if (count)
- sleep(1);
+ my_sleep(100*1000); /* 100ms */
if (mysql_query(mysql, query= "show engine ndb status"))
die("failed in '%s': %d %s", query,
mysql_errno(mysql), mysql_error(mysql));
@@ -4349,7 +4396,7 @@ int do_save_master_pos()
count++;
if (latest_handled_binlog_epoch >= start_epoch)
do_continue= 0;
- else if (count > 30)
+ else if (count > 300) /* 30s */
{
break;
}
@@ -4594,13 +4641,14 @@ static int my_kill(int pid, int sig)
command called command
DESCRIPTION
- shutdown [<timeout>]
+ shutdown_server [<timeout>]
*/
void do_shutdown_server(struct st_command *command)
{
- int timeout=60, pid;
+ long timeout=60;
+ int pid;
DYNAMIC_STRING ds_pidfile_name;
MYSQL* mysql = &cur_con->mysql;
static DYNAMIC_STRING ds_timeout;
@@ -4615,8 +4663,9 @@ void do_shutdown_server(struct st_command *command)
if (ds_timeout.length)
{
- timeout= atoi(ds_timeout.str);
- if (timeout == 0)
+ char* endptr;
+ timeout= strtol(ds_timeout.str, &endptr, 10);
+ if (*endptr != '\0')
die("Illegal argument for timeout: '%s'", ds_timeout.str);
}
dynstr_free(&ds_timeout);
@@ -4658,7 +4707,7 @@ void do_shutdown_server(struct st_command *command)
DBUG_PRINT("info", ("Process %d does not exist anymore", pid));
DBUG_VOID_RETURN;
}
- DBUG_PRINT("info", ("Sleeping, timeout: %d", timeout));
+ DBUG_PRINT("info", ("Sleeping, timeout: %ld", timeout));
my_sleep(1000000L);
}
@@ -5300,6 +5349,7 @@ void do_connect(struct st_command *command)
static DYNAMIC_STRING ds_port;
static DYNAMIC_STRING ds_sock;
static DYNAMIC_STRING ds_options;
+ static DYNAMIC_STRING ds_default_auth;
#ifdef HAVE_SMEM
static DYNAMIC_STRING ds_shm;
#endif
@@ -5311,7 +5361,8 @@ void do_connect(struct st_command *command)
{ "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" }
+ { "options", ARG_STRING, FALSE, &ds_options, "Options to use while connecting" },
+ { "default_auth", ARG_STRING, FALSE, &ds_default_auth, "Default authentication to use" }
};
DBUG_ENTER("do_connect");
@@ -5419,8 +5470,13 @@ void do_connect(struct st_command *command)
opt_charsets_dir);
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
- if (opt_use_ssl || con_ssl)
+ if (opt_use_ssl)
+ con_ssl= 1;
+#endif
+
+ if (con_ssl)
{
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
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
@@ -5429,15 +5485,15 @@ void do_connect(struct st_command *command)
mysql_options(&con_slot->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&opt_ssl_verify_server_cert);
#endif
- }
#endif
+ }
-#ifdef __WIN__
if (con_pipe)
{
+#ifdef __WIN__
opt_protocol= MYSQL_PROTOCOL_PIPE;
- }
#endif
+ }
if (opt_protocol)
mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
@@ -5462,6 +5518,12 @@ void do_connect(struct st_command *command)
if (ds_database.length == 0)
dynstr_set(&ds_database, opt_db);
+ if (opt_plugin_dir && *opt_plugin_dir)
+ mysql_options(&con_slot->mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
+
+ if (ds_default_auth.length)
+ mysql_options(&con_slot->mysql, MYSQL_DEFAULT_AUTH, ds_default_auth.str);
+
/* Special database to allow one to connect without a database name */
if (ds_database.length && !strcmp(ds_database.str,"*NO-ONE*"))
dynstr_set(&ds_database, "");
@@ -5490,6 +5552,7 @@ void do_connect(struct st_command *command)
dynstr_free(&ds_port);
dynstr_free(&ds_sock);
dynstr_free(&ds_options);
+ dynstr_free(&ds_default_auth);
#ifdef HAVE_SMEM
dynstr_free(&ds_shm);
#endif
@@ -5529,6 +5592,40 @@ int do_done(struct st_command *command)
return 0;
}
+/* Operands available in if or while conditions */
+
+enum block_op {
+ EQ_OP,
+ NE_OP,
+ GT_OP,
+ GE_OP,
+ LT_OP,
+ LE_OP,
+ ILLEG_OP
+};
+
+
+enum block_op find_operand(const char *start)
+{
+ char first= *start;
+ char next= *(start+1);
+
+ if (first == '=' && next == '=')
+ return EQ_OP;
+ if (first == '!' && next == '=')
+ return NE_OP;
+ if (first == '>' && next == '=')
+ return GE_OP;
+ if (first == '>')
+ return GT_OP;
+ if (first == '<' && next == '=')
+ return LE_OP;
+ if (first == '<')
+ return LT_OP;
+
+ return ILLEG_OP;
+}
+
/*
Process start of a "if" or "while" statement
@@ -5554,6 +5651,13 @@ int do_done(struct st_command *command)
A '!' can be used before the <expr> to indicate it should
be executed if it evaluates to zero.
+ <expr> can also be a simple comparison condition:
+
+ <variable> <op> <expr>
+
+ The left hand side must be a variable, the right hand side can be a
+ variable, number, string or `query`. Operands are ==, !=, <, <=, >, >=.
+ == and != can be used for strings, all can be used for numerical values.
*/
void do_block(enum block_cmd cmd, struct st_command* command)
@@ -5589,11 +5693,16 @@ void do_block(enum block_cmd cmd, struct st_command* command)
if (!expr_start++)
die("missing '(' in %s", cmd_name);
+ while (my_isspace(charset_info, *expr_start))
+ expr_start++;
+
/* Check for !<expr> */
if (*expr_start == '!')
{
not_expr= TRUE;
- expr_start++; /* Step past the '!' */
+ expr_start++; /* Step past the '!', then any whitespace */
+ while (*expr_start && my_isspace(charset_info, *expr_start))
+ expr_start++;
}
/* Find ending ')' */
expr_end= strrchr(expr_start, ')');
@@ -5607,14 +5716,110 @@ void do_block(enum block_cmd cmd, struct st_command* command)
die("Missing '{' after %s. Found \"%s\"", cmd_name, p);
var_init(&v,0,0,0,0);
- eval_expr(&v, expr_start, &expr_end);
+ /* If expression starts with a variable, it may be a compare condition */
+
+ if (*expr_start == '$')
+ {
+ const char *curr_ptr= expr_end;
+ eval_expr(&v, expr_start, &curr_ptr, true);
+ while (my_isspace(charset_info, *++curr_ptr))
+ {}
+ /* If there was nothing past the variable, skip condition part */
+ if (curr_ptr == expr_end)
+ goto NO_COMPARE;
+
+ enum block_op operand= find_operand(curr_ptr);
+ if (operand == ILLEG_OP)
+ die("Found junk '%.*s' after $variable in condition",
+ (int)(expr_end - curr_ptr), curr_ptr);
+
+ /* We could silently allow this, but may be confusing */
+ if (not_expr)
+ die("Negation and comparison should not be combined, please rewrite");
+
+ /* Skip the 1 or 2 chars of the operand, then white space */
+ if (operand == LT_OP || operand == GT_OP)
+ {
+ curr_ptr++;
+ }
+ else
+ {
+ curr_ptr+= 2;
+ }
+ while (my_isspace(charset_info, *curr_ptr))
+ curr_ptr++;
+ if (curr_ptr == expr_end)
+ die("Missing right operand in comparison");
+
+ /* Strip off trailing white space */
+ while (my_isspace(charset_info, expr_end[-1]))
+ expr_end--;
+ /* strip off ' or " around the string */
+ if (*curr_ptr == '\'' || *curr_ptr == '"')
+ {
+ if (expr_end[-1] != *curr_ptr)
+ die("Unterminated string value");
+ curr_ptr++;
+ expr_end--;
+ }
+ VAR v2;
+ var_init(&v2,0,0,0,0);
+ eval_expr(&v2, curr_ptr, &expr_end);
+
+ if ((operand!=EQ_OP && operand!=NE_OP) && ! (v.is_int && v2.is_int))
+ die ("Only == and != are supported for string values");
+
+ /* Now we overwrite the first variable with 0 or 1 (for false or true) */
+
+ switch (operand)
+ {
+ case EQ_OP:
+ if (v.is_int)
+ v.int_val= (v2.is_int && v2.int_val == v.int_val);
+ else
+ v.int_val= !strcmp (v.str_val, v2.str_val);
+ break;
+
+ case NE_OP:
+ if (v.is_int)
+ v.int_val= ! (v2.is_int && v2.int_val == v.int_val);
+ else
+ v.int_val= (strcmp (v.str_val, v2.str_val) != 0);
+ break;
+
+ case LT_OP:
+ v.int_val= (v.int_val < v2.int_val);
+ break;
+ case LE_OP:
+ v.int_val= (v.int_val <= v2.int_val);
+ break;
+ case GT_OP:
+ v.int_val= (v.int_val > v2.int_val);
+ break;
+ case GE_OP:
+ v.int_val= (v.int_val >= v2.int_val);
+ break;
+ case ILLEG_OP:
+ die("Impossible operator, this cannot happen");
+ }
+
+ v.is_int= TRUE;
+ var_free(&v2);
+ } else
+ {
+ if (*expr_start != '`' && ! my_isdigit(charset_info, *expr_start))
+ die("Expression in if/while must beging with $, ` or a number");
+ eval_expr(&v, expr_start, &expr_end);
+ }
+
+ NO_COMPARE:
/* Define inner block */
cur_block++;
cur_block->cmd= cmd;
- if (v.int_val)
+ if (v.is_int)
{
- cur_block->ok= TRUE;
+ cur_block->ok= (v.int_val != 0);
} else
/* Any non-empty string which does not begin with 0 is also TRUE */
{
@@ -5891,7 +6096,7 @@ int read_line(char *buf, int size)
/* Could be a multibyte character */
/* This code is based on the code in "sql_load.cc" */
#ifdef USE_MB
- int charlen = my_mbcharlen(charset_info, c);
+ int charlen = my_mbcharlen(charset_info, (unsigned char) c);
/* We give up if multibyte character is started but not */
/* completed before we pass buf_end */
if ((charlen > 1) && (p + charlen) <= buf_end)
@@ -5903,16 +6108,16 @@ int read_line(char *buf, int size)
for (i= 1; i < charlen; i++)
{
+ c= my_getc(cur_file->file);
if (feof(cur_file->file))
goto found_eof;
- c= my_getc(cur_file->file);
*p++ = c;
}
if (! my_ismbchar(charset_info, mb_start, p))
{
/* It was not a multiline char, push back the characters */
/* We leave first 'c', i.e. pretend it was a normal char */
- while (p > mb_start)
+ while (p-1 > mb_start)
my_ungetc(*--p);
}
}
@@ -6260,6 +6465,9 @@ static struct my_option my_long_options[] =
"Number of seconds before connection timeout.",
&opt_connect_timeout, &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
120, 0, 3600 * 12, 0, 0, 0},
+ {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
+ &opt_plugin_dir, &opt_plugin_dir, 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}
};
@@ -6273,8 +6481,7 @@ void print_version(void)
void usage()
{
print_version();
- printf("MySQL AB, by Sasha, Matt, Monty & Jani\n");
- printf("This software comes with ABSOLUTELY NO WARRANTY\n\n");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
printf("Runs a test against the mysql server and compares output with a results file.\n\n");
printf("Usage: %s [OPTIONS] [database] < test_file\n", my_progname);
my_print_help(my_long_options);
@@ -7551,6 +7758,8 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
die ("Cannot reap on a connection without pending send");
init_dynamic_string(&ds_warnings, NULL, 0, 256);
+ ds_warn= &ds_warnings;
+
/*
Evaluate query if this is an eval command
*/
@@ -7707,7 +7916,8 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
ds, &ds_warnings);
dynstr_free(&ds_warnings);
- if (command->type == Q_EVAL)
+ ds_warn= 0;
+ if (command->type == Q_EVAL || command->type == Q_SEND_EVAL)
dynstr_free(&eval_query);
if (display_result_sorted)
@@ -7813,6 +8023,16 @@ void init_re(void)
int match_re(my_regex_t *re, char *str)
{
+ while (my_isspace(charset_info, *str))
+ str++;
+ if (str[0] == '/' && str[1] == '*')
+ {
+ char *comm_end= strstr (str, "*/");
+ if (! comm_end)
+ die("Statement is unterminated comment");
+ str= comm_end + 2;
+ }
+
int err= my_regexec(re, str, (size_t)0, NULL, 0);
if (err == 0)
@@ -7853,7 +8073,7 @@ void get_command_type(struct st_command* command)
save= command->query[command->first_word_len];
command->query[command->first_word_len]= 0;
- type= find_type(command->query, &command_typelib, 1+2);
+ type= find_type(command->query, &command_typelib, FIND_TYPE_NO_PREFIX);
command->query[command->first_word_len]= save;
if (type > 0)
{
@@ -7951,13 +8171,16 @@ static void dump_backtrace(void)
{
struct st_connection *conn= cur_con;
- my_safe_print_str("read_command_buf", read_command_buf,
- sizeof(read_command_buf));
+ fprintf(stderr, "read_command_buf (%p): ", read_command_buf);
+ my_safe_print_str(read_command_buf, sizeof(read_command_buf));
+
if (conn)
{
- my_safe_print_str("conn->name", conn->name, conn->name_len);
+ fprintf(stderr, "conn->name (%p): ", conn->name);
+ my_safe_print_str(conn->name, conn->name_len);
#ifdef EMBEDDED_LIBRARY
- my_safe_print_str("conn->cur_query", conn->cur_query, conn->cur_query_len);
+ fprintf(stderr, "conn->cur_query (%p): ", conn->cur_query);
+ my_safe_print_str(conn->cur_query, conn->cur_query_len);
#endif
}
fputs("Attempting backtrace...\n", stderr);
@@ -8142,6 +8365,14 @@ int main(int argc, char **argv)
var_set_int("$VIEW_PROTOCOL", view_protocol);
var_set_int("$CURSOR_PROTOCOL", cursor_protocol);
+ var_set_int("$ENABLED_QUERY_LOG", 1);
+ var_set_int("$ENABLED_ABORT_ON_ERROR", 1);
+ var_set_int("$ENABLED_RESULT_LOG", 1);
+ var_set_int("$ENABLED_CONNECT_LOG", 0);
+ var_set_int("$ENABLED_WARNINGS", 1);
+ var_set_int("$ENABLED_INFO", 0);
+ var_set_int("$ENABLED_METADATA", 0);
+
DBUG_PRINT("info",("result_file: '%s'",
result_file_name ? result_file_name : ""));
verbose_msg("Results saved in '%s'.",
@@ -8159,13 +8390,15 @@ int main(int argc, char **argv)
}
var_set_string("MYSQLTEST_FILE", cur_file->file_name);
init_re();
+
+ /* Cursor protcol implies ps protocol */
+ if (cursor_protocol)
+ ps_protocol= 1;
+
ps_protocol_enabled= ps_protocol;
sp_protocol_enabled= sp_protocol;
view_protocol_enabled= view_protocol;
cursor_protocol_enabled= cursor_protocol;
- /* Cursor protcol implies ps protocol */
- if (cursor_protocol_enabled)
- ps_protocol_enabled= 1;
st_connection *con= connections;
#ifdef EMBEDDED_LIBRARY
@@ -8289,22 +8522,64 @@ int main(int argc, char **argv)
case Q_DISCONNECT:
case Q_DIRTY_CLOSE:
do_close_connection(command); break;
- case Q_ENABLE_QUERY_LOG: disable_query_log=0; break;
- case Q_DISABLE_QUERY_LOG: disable_query_log=1; break;
- case Q_ENABLE_ABORT_ON_ERROR: abort_on_error=1; break;
- case Q_DISABLE_ABORT_ON_ERROR: abort_on_error=0; break;
- case Q_ENABLE_RESULT_LOG: disable_result_log=0; break;
- case Q_DISABLE_RESULT_LOG: disable_result_log=1; break;
- case Q_ENABLE_CONNECT_LOG: disable_connect_log=0; break;
- case Q_DISABLE_CONNECT_LOG: disable_connect_log=1; break;
- case Q_ENABLE_WARNINGS: disable_warnings=0; break;
- case Q_DISABLE_WARNINGS: disable_warnings=1; break;
case Q_ENABLE_PREPARE_WARNINGS: prepare_warnings_enabled=1; break;
case Q_DISABLE_PREPARE_WARNINGS: prepare_warnings_enabled=0; break;
- case Q_ENABLE_INFO: disable_info=0; break;
- case Q_DISABLE_INFO: disable_info=1; break;
- case Q_ENABLE_METADATA: display_metadata=1; break;
- case Q_DISABLE_METADATA: display_metadata=0; break;
+ case Q_ENABLE_QUERY_LOG:
+ disable_query_log= 0;
+ var_set_int("$ENABLED_QUERY_LOG", 1);
+ break;
+ case Q_DISABLE_QUERY_LOG:
+ disable_query_log= 1;
+ var_set_int("$ENABLED_QUERY_LOG", 0);
+ break;
+ case Q_ENABLE_ABORT_ON_ERROR:
+ abort_on_error= 1;
+ var_set_int("$ENABLED_ABORT_ON_ERROR", 1);
+ break;
+ case Q_DISABLE_ABORT_ON_ERROR:
+ abort_on_error= 0;
+ var_set_int("$ENABLED_ABORT_ON_ERROR", 0);
+ break;
+ case Q_ENABLE_RESULT_LOG:
+ disable_result_log= 0;
+ var_set_int("$ENABLED_RESULT_LOG", 1);
+ break;
+ case Q_DISABLE_RESULT_LOG:
+ disable_result_log=1;
+ var_set_int("$ENABLED_RESULT_LOG", 0);
+ break;
+ case Q_ENABLE_CONNECT_LOG:
+ disable_connect_log=0;
+ var_set_int("$ENABLED_CONNECT_LOG", 1);
+ break;
+ case Q_DISABLE_CONNECT_LOG:
+ disable_connect_log=1;
+ var_set_int("$ENABLED_CONNECT_LOG", 0);
+ break;
+ case Q_ENABLE_WARNINGS:
+ disable_warnings= 0;
+ var_set_int("$ENABLED_WARNINGS", 1);
+ break;
+ case Q_DISABLE_WARNINGS:
+ disable_warnings= 1;
+ var_set_int("$ENABLED_WARNINGS", 0);
+ break;
+ case Q_ENABLE_INFO:
+ disable_info= 0;
+ var_set_int("$ENABLED_INFO", 1);
+ break;
+ case Q_DISABLE_INFO:
+ disable_info= 1;
+ var_set_int("$ENABLED_INFO", 0);
+ break;
+ case Q_ENABLE_METADATA:
+ display_metadata= 1;
+ var_set_int("$ENABLED_METADATA", 1);
+ break;
+ case Q_DISABLE_METADATA:
+ display_metadata= 0;
+ var_set_int("$ENABLED_METADATA", 0);
+ break;
case Q_SOURCE: do_source(command); break;
case Q_SLEEP: do_sleep(command, 0); break;
case Q_REAL_SLEEP: do_sleep(command, 1); break;
@@ -8598,7 +8873,7 @@ int main(int argc, char **argv)
memset(&saved_expected_errors, 0, sizeof(saved_expected_errors));
}
- if (command_executed != last_command_executed)
+ if (command_executed != last_command_executed || command->used_replace)
{
/*
As soon as any command has been executed,
@@ -9854,7 +10129,7 @@ int find_set(REP_SETS *sets,REP_SET *find)
return i;
}
}
- return i; /* return new postion */
+ return i; /* return new position */
}
/* find if there is a found_set with same table_offset & found_offset
@@ -9874,7 +10149,7 @@ int find_found(FOUND_SET *found_set,uint table_offset, int found_offset)
found_set[i].table_offset=table_offset;
found_set[i].found_offset=found_offset;
found_sets++;
- return -i-2; /* return new postion */
+ return -i-2; /* return new position */
}
/* Return 1 if regexp starts with \b or ends with \b*/
@@ -9990,6 +10265,7 @@ void free_pointer_array(POINTER_ARRAY *pa)
void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
const char *val, int len)
{
+ char lower[512];
#ifdef __WIN__
fix_win_paths(val, len);
#endif
@@ -9997,7 +10273,6 @@ void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
if (display_result_lower)
{
/* Convert to lower case, and do this first */
- char lower[512];
char *c= lower;
for (const char *v= val; *v; v++)
*c++= my_tolower(charset_info, *v);
diff --git a/client/readline.cc b/client/readline.cc
index 5c1a9951d9b..f6d3d1295f1 100644
--- a/client/readline.cc
+++ b/client/readline.cc
@@ -18,18 +18,28 @@
#include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
+#include <my_dir.h>
#include "my_readline.h"
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,char * str);
static size_t fill_buffer(LINE_BUFFER *buffer);
-static char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length, bool *truncated);
+static char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length);
LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
{
LINE_BUFFER *line_buff;
+ MY_STAT input_file_stat;
+
+#ifndef __WIN__
+ if (my_fstat(fileno(file), &input_file_stat, MYF(MY_WME)) ||
+ MY_S_ISDIR(input_file_stat.st_mode) ||
+ MY_S_ISBLK(input_file_stat.st_mode))
+ return 0;
+#endif
+
if (!(line_buff=(LINE_BUFFER*)
my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL))))
return 0;
@@ -42,13 +52,12 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
}
-char *batch_readline(LINE_BUFFER *line_buff, bool *truncated)
+char *batch_readline(LINE_BUFFER *line_buff)
{
char *pos;
ulong out_length;
- DBUG_ASSERT(truncated != NULL);
- if (!(pos=intern_read_line(line_buff,&out_length, truncated)))
+ if (!(pos=intern_read_line(line_buff, &out_length)))
return 0;
if (out_length && pos[out_length-1] == '\n')
if (--out_length && pos[out_length-1] == '\r') /* Remove '\n' */
@@ -162,7 +171,10 @@ static size_t fill_buffer(LINE_BUFFER *buffer)
if (!(buffer->buffer = (char*) my_realloc(buffer->buffer,
buffer->bufread+1,
MYF(MY_WME | MY_FAE))))
- return (uint) -1;
+ {
+ buffer->error= my_errno;
+ return (size_t) -1;
+ }
buffer->start_of_line=buffer->buffer+start_offset;
buffer->end=buffer->buffer+bufbytes;
}
@@ -177,7 +189,10 @@ static size_t fill_buffer(LINE_BUFFER *buffer)
/* Read in new stuff. */
if ((read_count= my_read(buffer->file, (uchar*) buffer->end, read_count,
MYF(MY_WME))) == MY_FILE_ERROR)
+ {
+ buffer->error= my_errno;
return (size_t) -1;
+ }
DBUG_PRINT("fill_buff", ("Got %lu bytes", (ulong) read_count));
@@ -198,8 +213,7 @@ static size_t fill_buffer(LINE_BUFFER *buffer)
}
-
-char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length, bool *truncated)
+char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length)
{
char *pos;
size_t length;
@@ -214,22 +228,25 @@ char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length, bool *truncated)
if (pos == buffer->end)
{
/*
- fill_buffer() can return 0 either on EOF in which case we abort
- or when the internal buffer has hit the size limit. In the latter case
- return what we have read so far and signal string truncation.
+ fill_buffer() can return NULL on EOF (in which case we abort),
+ on error, or when the internal buffer has hit the size limit.
+ In the latter case return what we have read so far and signal
+ string truncation.
*/
- if (!(length=fill_buffer(buffer)) || length == (uint) -1)
+ if (!(length= fill_buffer(buffer)))
{
if (buffer->eof)
DBUG_RETURN(0);
}
+ else if (length == (size_t) -1)
+ DBUG_RETURN(NULL);
else
continue;
pos--; /* break line here */
- *truncated= 1;
+ buffer->truncated= 1;
}
else
- *truncated= 0;
+ buffer->truncated= 0;
buffer->end_of_line=pos+1;
*out_length=(ulong) (pos + 1 - buffer->eof - buffer->start_of_line);
DBUG_RETURN(buffer->start_of_line);
diff --git a/client/sql_string.h b/client/sql_string.h
index bafc287c73e..f406da28995 100644
--- a/client/sql_string.h
+++ b/client/sql_string.h
@@ -69,9 +69,13 @@ public:
}
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); }
- static void operator delete(void *ptr_arg, MEM_ROOT *mem_root)
+ static void operator delete(void *ptr_arg, size_t size)
+ {
+ (void) ptr_arg;
+ (void) size;
+ TRASH(ptr_arg, size);
+ }
+ static void operator delete(void *, MEM_ROOT *)
{ /* never called */ }
~String() { free(); }
diff --git a/cmake/Makefile.am b/cmake/Makefile.am
deleted file mode 100644
index af3ec4f980d..00000000000
--- a/cmake/Makefile.am
+++ /dev/null
@@ -1,40 +0,0 @@
-EXTRA_DIST = \
- cmake_parse_arguments.cmake \
- cpack_source_ignore_files.cmake \
- package_name.cmake \
- configurable_file_content.in \
- check_minimal_version.cmake \
- create_initial_db.cmake.in \
- make_dist.cmake.in \
- dtrace.cmake \
- abi_check.cmake \
- bison.cmake \
- configure.pl \
- character_sets.cmake \
- libutils.cmake \
- readline.cmake \
- mysql_version.cmake \
- install_macros.cmake \
- ssl.cmake \
- plugin.cmake \
- zlib.cmake \
- stack_direction.c \
- do_abi_check.cmake \
- merge_archives_unix.cmake.in \
- dtrace_prelink.cmake \
- versioninfo.rc.in \
- mysql_add_executable.cmake \
- tags.cmake \
- install_layout.cmake \
- build_configurations/mysql_release.cmake \
- os/Windows.cmake \
- os/WindowsCache.cmake \
- os/Linux.cmake \
- os/SunOS.cmake \
- os/Darwin.cmake \
- os/HP-UX.cmake \
- os/AIX.cmake \
- os/OS400.cmake \
- os/Cygwin.cmake
-
-
diff --git a/cmake/abi_check.cmake b/cmake/abi_check.cmake
index b9ff9f7af73..a671aeff342 100644
--- a/cmake/abi_check.cmake
+++ b/cmake/abi_check.cmake
@@ -19,20 +19,30 @@
# plugin_audit.h and plugin_ftparser.h.
#
# We use gcc specific preprocessing command and sed/diff, so it will
-# only be run on Unix and only if gcc is used.
-IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_SYSTEM_NAME MATCHES "Linux")
+# only be run on Unix and only if gcc is used. On some Unixes,
+# (Solaris) sed or diff might act differently from GNU, so we run only
+# on systems we can trust.
+IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Linux")
+ SET(RUN_ABI_CHECK 1)
+ELSE()
+ SET(RUN_ABI_CHECK 0)
+ENDIF()
+
+IF(CMAKE_COMPILER_IS_GNUCC AND RUN_ABI_CHECK)
IF(CMAKE_C_COMPILER MATCHES "ccache$")
SET(COMPILER ${CMAKE_C_COMPILER_ARG1})
STRING(REGEX REPLACE "^ " "" COMPILER ${COMPILER})
ELSE()
SET(COMPILER ${CMAKE_C_COMPILER})
ENDIF()
- SET(API_PREPROCESSOR_HEADER
+ SET(API_PREPROCESSOR_HEADER
${CMAKE_SOURCE_DIR}/include/mysql/plugin_audit.h
${CMAKE_SOURCE_DIR}/include/mysql/plugin_ftparser.h
${CMAKE_SOURCE_DIR}/include/mysql.h
- ${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_v1.h
+ ${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_v1.h
${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_v2.h
+ ${CMAKE_SOURCE_DIR}/include/mysql/client_plugin.h
+ ${CMAKE_SOURCE_DIR}/include/mysql/plugin_auth.h
)
ADD_CUSTOM_TARGET(abi_check ALL
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake
index 9d010ef7f2a..91d598db465 100644
--- a/cmake/build_configurations/mysql_release.cmake
+++ b/cmake/build_configurations/mysql_release.cmake
@@ -101,8 +101,10 @@ IF(NOT COMPILATION_COMMENT)
ENDIF()
IF(WIN32)
- # Sign executables with authenticode certificate
- SET(SIGNCODE 1 CACHE BOOL "")
+ IF(NOT CMAKE_USING_VC_FREE_TOOLS)
+ # Sign executables with authenticode certificate
+ SET(SIGNCODE 1 CACHE BOOL "")
+ ENDIF()
ENDIF()
IF(UNIX)
@@ -115,13 +117,26 @@ IF(UNIX)
OPTION(WITH_PIC "" ON) # Why?
- # Ensure aio is available on Linux (required by InnoDB)
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
- CHECK_INCLUDE_FILES(libaio.h HAVE_LIBAIO_H)
- CHECK_LIBRARY_EXISTS(aio io_queue_init "" HAVE_LIBAIO)
- IF(NOT HAVE_LIBAIO_H OR NOT HAVE_LIBAIO)
- MESSAGE(FATAL_ERROR "aio is required on Linux")
+ IF(NOT IGNORE_AIO_CHECK)
+ # Ensure aio is available on Linux (required by InnoDB)
+ CHECK_INCLUDE_FILES(libaio.h HAVE_LIBAIO_H)
+ CHECK_LIBRARY_EXISTS(aio io_queue_init "" HAVE_LIBAIO)
+ IF(NOT HAVE_LIBAIO_H OR NOT HAVE_LIBAIO)
+ MESSAGE(FATAL_ERROR "
+ aio is required on Linux, you need to install the required library:
+
+ Debian/Ubuntu: apt-get install libaio-dev
+ RedHat/Fedora/Oracle Linux: yum install libaio-devel
+ SuSE: zypper install libaio-devel
+
+ If you really do not want it, pass -DIGNORE_AIO_CHECK to cmake.
+ ")
+ ENDIF()
ENDIF()
+
+ # Enable fast mutexes on Linux
+ OPTION(WITH_FAST_MUTEXES "" ON)
ENDIF()
ENDIF()
@@ -131,16 +146,16 @@ IF(UNIX)
# Default GCC flags
IF(CMAKE_COMPILER_IS_GNUCC)
- SET(COMMON_C_FLAGS "-g -static-libgcc -fno-omit-frame-pointer")
+ SET(COMMON_C_FLAGS "-g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing")
SET(CMAKE_C_FLAGS_DEBUG "-O ${COMMON_C_FLAGS}")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX)
- SET(COMMON_CXX_FLAGS "-g -static-libgcc -fno-omit-frame-pointer")
+ SET(COMMON_CXX_FLAGS "-g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing")
SET(CMAKE_CXX_FLAGS_DEBUG "-O ${COMMON_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}")
ENDIF()
-
+
# HPUX flags
IF(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
IF(CMAKE_C_COMPILER_ID MATCHES "HP")
@@ -156,7 +171,7 @@ IF(UNIX)
ENDIF()
SET(WITH_SSL no)
ENDIF()
-
+
# Linux flags
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
IF(CMAKE_C_COMPILER_ID MATCHES "Intel")
@@ -173,18 +188,18 @@ IF(UNIX)
SET(WITH_SSL no)
ENDIF()
ENDIF()
-
+
# OSX flags
IF(APPLE)
- SET(COMMON_C_FLAGS "-g -fno-common")
+ SET(COMMON_C_FLAGS "-g -fno-common -fno-strict-aliasing")
# XXX: why are we using -felide-constructors on OSX?
- SET(COMMON_CXX_FLAGS "-g -fno-common -felide-constructors")
+ SET(COMMON_CXX_FLAGS "-g -fno-common -felide-constructors -fno-strict-aliasing")
SET(CMAKE_C_FLAGS_DEBUG "-O ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "-O ${COMMON_CXX_FLAGS}")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Os ${COMMON_CXX_FLAGS}")
ENDIF()
-
+
# Solaris flags
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
IF(CMAKE_SYSTEM_VERSION VERSION_GREATER "5.9")
@@ -219,22 +234,4 @@ IF(UNIX)
ENDIF()
ENDIF()
ENDIF()
-
- IF(CMAKE_C_FLAGS_DEBUG)
- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}"
- CACHE STRING "Debug C compile flags")
- ENDIF()
- IF(CMAKE_CXX_FLAGS_DEBUG)
- SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}"
- CACHE STRING "Debug C++ compile flags")
- ENDIF()
- IF(CMAKE_C_FLAGS_RELWITHDEBINFO)
- SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}"
- CACHE STRING "RelWithDebInfo C compile flags")
- ENDIF()
- IF(CMAKE_CXX_FLAGS_RELWITHDEBINFO)
- SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}"
- CACHE STRING "RelWithDebInfo C++ compile flags")
- ENDIF()
-
ENDIF()
diff --git a/cmake/character_sets.cmake b/cmake/character_sets.cmake
index d51444ec433..1cf63ed1462 100644
--- a/cmake/character_sets.cmake
+++ b/cmake/character_sets.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,17 +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
-#Charsets and collations
+# Charsets and collations
IF(NOT DEFAULT_CHARSET)
-SET(DEFAULT_CHARSET "latin1")
+ SET(DEFAULT_CHARSET "latin1")
ENDIF()
-IF(NOT DEFAULT_COLLATIONS)
-SET(DEFAULT_COLLATION "latin1_swedish_ci")
+IF(NOT DEFAULT_COLLATION)
+ SET(DEFAULT_COLLATION "latin1_swedish_ci")
ENDIF()
SET(CHARSETS ${DEFAULT_CHARSET} latin1 utf8 utf8mb4)
-SET(CHARSETS_COMPLEX big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32)
+SET(CHARSETS_COMPLEX
+ big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2
+ sjis tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32)
SET(CHARSETS_AVAILABLE
binary armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257
diff --git a/cmake/cmake_parse_arguments.cmake b/cmake/cmake_parse_arguments.cmake
index ea601f916a8..db540ae9020 100644
--- a/cmake/cmake_parse_arguments.cmake
+++ b/cmake/cmake_parse_arguments.cmake
@@ -15,7 +15,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Handy macro to parse macro arguments
-MACRO(CMAKE_PARSE_ARGUMENTS prefix arg_names option_names)
+MACRO(MYSQL_PARSE_ARGUMENTS prefix arg_names option_names)
SET(DEFAULT_ARGS)
FOREACH(arg_name ${arg_names})
SET(${prefix}_${arg_name})
diff --git a/cmake/configure.pl b/cmake/configure.pl
index 1dc8080810c..bf872264953 100644
--- a/cmake/configure.pl
+++ b/cmake/configure.pl
@@ -185,6 +185,16 @@ foreach my $option (@ARGV)
($option =~ /enable/ ? "1" : "0");
next;
}
+ if ($option =~ /with-comment=/)
+ {
+ $cmakeargs = $cmakeargs." \"-DWITH_COMMENT=".substr($option,13)."\"";
+ next;
+ }
+ if ($option =~ /with-gcov/)
+ {
+ $cmakeargs = $cmakeargs." -DENABLE_GCOV=ON";
+ next;
+ }
$option = uc($option);
$option =~ s/-/_/g;
diff --git a/cmake/do_abi_check.cmake b/cmake/do_abi_check.cmake
index 78006bd018c..96943e1a4c4 100644
--- a/cmake/do_abi_check.cmake
+++ b/cmake/do_abi_check.cmake
@@ -53,23 +53,27 @@
SET(abi_check_out ${BINARY_DIR}/abi_check.out)
FOREACH(file ${ABI_HEADERS})
- SET(tmpfile ${file}.pp.tmp)
- EXECUTE_PROCESS(
- COMMAND ${COMPILER}
- -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
- -I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql
- ${file}
- ERROR_QUIET OUTPUT_FILE ${tmpfile})
- EXECUTE_PROCESS(
- COMMAND sed -e
- "/^# /d" -e "/^[ ]*$/d" -e "/^#pragma GCC set_debug_pwd/d" -e "/^#ident/d"
- RESULT_VARIABLE result OUTPUT_FILE ${abi_check_out} INPUT_FILE ${tmpfile})
+ GET_FILENAME_COMPONENT(header_basename ${file} NAME)
+ SET(tmpfile ${BINARY_DIR}/${header_basename}.pp.tmp)
+
+ EXECUTE_PROCESS(
+ COMMAND ${COMPILER}
+ -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
+ -I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql
+ ${file}
+ ERROR_QUIET OUTPUT_FILE ${tmpfile})
+ EXECUTE_PROCESS(
+ COMMAND sed -e "/^# /d"
+ -e "/^[ ]*$/d"
+ -e "/^#pragma GCC set_debug_pwd/d"
+ -e "/^#ident/d"
+ RESULT_VARIABLE result OUTPUT_FILE ${abi_check_out} INPUT_FILE ${tmpfile})
IF(NOT ${result} EQUAL 0)
MESSAGE(FATAL_ERROR "sed returned error ${result}")
ENDIF()
FILE(REMOVE ${tmpfile})
- EXECUTE_PROCESS(COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE
- result)
+ EXECUTE_PROCESS(
+ COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE result)
IF(NOT ${result} EQUAL 0)
MESSAGE(FATAL_ERROR
"ABI check found difference between ${file}.pp and ${abi_check_out}")
diff --git a/cmake/dtrace.cmake b/cmake/dtrace.cmake
index c12a74cba31..5beb45ca524 100644
--- a/cmake/dtrace.cmake
+++ b/cmake/dtrace.cmake
@@ -153,13 +153,23 @@ ENDFUNCTION()
# to mysqld.
MACRO (DTRACE_INSTRUMENT_STATIC_LIBS target libs)
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND ENABLE_DTRACE)
+ # Filter out non-static libraries in the list, if any
+ SET(static_libs)
FOREACH(lib ${libs})
+ GET_TARGET_PROPERTY(libtype ${lib} TYPE)
+ IF(libtype MATCHES STATIC_LIBRARY)
+ SET(static_libs ${static_lics} ${lib})
+ ENDIF()
+ ENDFOREACH()
+
+ FOREACH(lib ${static_libs})
SET(dirs ${dirs} ${TARGET_OBJECT_DIRECTORY_${lib}})
ENDFOREACH()
+
SET (obj ${CMAKE_CURRENT_BINARY_DIR}/${target}_dtrace_all.o)
ADD_CUSTOM_COMMAND(
OUTPUT ${obj}
- DEPENDS ${libs}
+ DEPENDS ${static_libs}
COMMAND ${CMAKE_COMMAND}
-DDTRACE=${DTRACE}
-DOUTFILE=${obj}
diff --git a/cmake/info_bin.cmake b/cmake/info_bin.cmake
new file mode 100644
index 00000000000..9cec3de0e0f
--- /dev/null
+++ b/cmake/info_bin.cmake
@@ -0,0 +1,30 @@
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# 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
+
+
+# The sole purpose of this cmake control file is to create the "INFO_BIN" file.
+
+# By having a separate cmake file for this, it is ensured this happens
+# only in the build (Unix: "make") phase, not when cmake runs.
+# This, in turn, avoids creating stuff in the source directory -
+# it should get into the binary directory only.
+
+
+# Get the macros which the "INFO_*" files.
+INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
+
+# Here is where the action is.
+CREATE_INFO_BIN()
+
diff --git a/cmake/info_macros.cmake.in b/cmake/info_macros.cmake.in
new file mode 100644
index 00000000000..9e08cffb2bf
--- /dev/null
+++ b/cmake/info_macros.cmake.in
@@ -0,0 +1,132 @@
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# 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
+
+
+# Handle/create the "INFO_*" files describing a MySQL (server) binary.
+# This is part of the fix for bug#42969.
+
+
+# Several of cmake's variables need to be translated from '@' notation
+# to '${}', this is done by the "configure" call in top level "CMakeLists.txt".
+# If further variables are used in this file, add them to this list.
+
+SET(VERSION "@VERSION@")
+SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@")
+SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
+SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
+SET(CMAKE_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@")
+SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@")
+SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
+SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
+SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
+SET(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
+SET(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
+
+
+# Create an "INFO_SRC" file with information about the source (only).
+# We use "bzr version-info", if possible, and the "VERSION" contents.
+#
+# Outside development (BZR tree), the "INFO_SRC" file will not be modified
+# provided it exists (from "make dist" or a source tarball creation).
+
+MACRO(CREATE_INFO_SRC target_dir)
+ SET(INFO_SRC "${target_dir}/INFO_SRC")
+
+ IF(EXISTS ${CMAKE_SOURCE_DIR}/.bzr)
+ # Sources are in a BZR repository: Always update.
+ EXECUTE_PROCESS(
+ COMMAND ${BZR_EXECUTABLE} version-info ${CMAKE_SOURCE_DIR}
+ OUTPUT_VARIABLE VERSION_INFO
+ RESULT_VARIABLE RESULT
+ )
+ FILE(WRITE ${INFO_SRC} "${VERSION_INFO}\n")
+ # to debug, add: FILE(APPEND ${INFO_SRC} "\nResult ${RESULT}\n")
+ # For better readability ...
+ FILE(APPEND ${INFO_SRC} "\nMySQL source ${VERSION}\n")
+ ELSEIF(EXISTS ${INFO_SRC})
+ # Outside a BZR tree, there is no need to change an existing "INFO_SRC",
+ # it cannot be improved.
+ ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/Docs/INFO_SRC)
+ # If we are building from a source distribution, it also contains "INFO_SRC".
+ # Similar, the export used for a release build already has the file.
+ FILE(READ ${CMAKE_SOURCE_DIR}/Docs/INFO_SRC SOURCE_INFO)
+ FILE(WRITE ${INFO_SRC} "${SOURCE_INFO}\n")
+ ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/INFO_SRC)
+ # This is not the proper location, but who knows ...
+ FILE(READ ${CMAKE_SOURCE_DIR}/INFO_SRC SOURCE_INFO)
+ FILE(WRITE ${INFO_SRC} "${SOURCE_INFO}\n")
+ ELSE()
+ # This is a fall-back.
+ FILE(WRITE ${INFO_SRC} "\nMySQL source ${VERSION}\n")
+ ENDIF()
+ENDMACRO(CREATE_INFO_SRC)
+
+
+# This is for the "real" build, must be run again with each cmake run
+# to make sure we report the current flags (not those of some previous run).
+
+MACRO(CREATE_INFO_BIN)
+ SET(INFO_BIN "Docs/INFO_BIN")
+
+ FILE(WRITE ${INFO_BIN} "===== Information about the build process: =====\n")
+ IF (WIN32)
+ EXECUTE_PROCESS(COMMAND cmd /c date /T OUTPUT_VARIABLE TMP_DATE)
+ ELSEIF(UNIX)
+ EXECUTE_PROCESS(COMMAND date "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE TMP_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
+ ELSE()
+ SET(TMP_DATE "(no date command known for this platform)")
+ ENDIF()
+ SITE_NAME(HOSTNAME)
+ FILE(APPEND ${INFO_BIN} "Build was run at ${TMP_DATE} on host '${HOSTNAME}'\n\n")
+
+ # According to the cmake docs, these variables should always be set.
+ # However, they are empty in my tests, using cmake 2.6.4 on Linux, various Unix, and Windows.
+ # Still, include this code, so we will profit if a build environment does provide that info.
+ IF(CMAKE_HOST_SYSTEM)
+ FILE(APPEND ${INFO_BIN} "Build was done on ${CMAKE_HOST_SYSTEM} using ${CMAKE_HOST_SYSTEM_PROCESSOR}\n")
+ ENDIF()
+ IF(CMAKE_CROSSCOMPILING)
+ FILE(APPEND ${INFO_BIN} "Build was done for ${CMAKE_SYSTEM} using ${CMAKE_SYSTEM_PROCESSOR}\n")
+ ENDIF()
+
+ # ${CMAKE_VERSION} doesn't work in 2.6.0, use the separate components.
+ FILE(APPEND ${INFO_BIN} "Build was done using cmake ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} \n\n")
+
+ IF (WIN32)
+ FILE(APPEND ${INFO_BIN} "===== Compiler / generator used: =====\n")
+ FILE(APPEND ${INFO_BIN} ${CMAKE_GENERATOR} "\n\n")
+ ELSEIF(UNIX)
+ FILE(APPEND ${INFO_BIN} "===== Compiler flags used (from the 'sql/' subdirectory): =====\n")
+ IF(EXISTS sql/CMakeFiles/sql.dir/flags.make)
+ EXECUTE_PROCESS(COMMAND egrep "^# compile|^C_|^CXX_" sql/CMakeFiles/sql.dir/flags.make OUTPUT_VARIABLE COMPILE_FLAGS)
+ FILE(APPEND ${INFO_BIN} ${COMPILE_FLAGS} "\n")
+ ELSE()
+ FILE(APPEND ${INFO_BIN} "File 'sql/CMakeFiles/sql.dir/flags.make' is not yet found.\n\n")
+ ENDIF()
+ ENDIF()
+ FILE(APPEND ${INFO_BIN} "Pointer size: ${CMAKE_SIZEOF_VOID_P}\n\n")
+
+ FILE(APPEND ${INFO_BIN} "===== Feature flags used: =====\n")
+ IF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
+ # Attention: "-N" prevents cmake from entering a recursion, and it must be a separate flag from "-L".
+ EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -N -L ${CMAKE_BINARY_DIR} OUTPUT_VARIABLE FEATURE_FLAGS)
+ FILE(APPEND ${INFO_BIN} ${FEATURE_FLAGS} "\n")
+ ELSE()
+ FILE(APPEND ${INFO_BIN} "File 'CMakeCache.txt' is not yet found.\n\n")
+ ENDIF()
+
+ FILE(APPEND ${INFO_BIN} "===== EOF =====\n")
+ENDMACRO(CREATE_INFO_BIN)
+
diff --git a/cmake/info_src.cmake b/cmake/info_src.cmake
new file mode 100644
index 00000000000..97776b70901
--- /dev/null
+++ b/cmake/info_src.cmake
@@ -0,0 +1,31 @@
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# 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
+
+
+# The sole purpose of this cmake control file is to create the "INFO_SRC" file.
+
+# As long as and "bzr pull" (or "bzr commit") is followed by a "cmake",
+# the call in top level "CMakeLists.txt" is sufficient.
+# This file is to provide a separate target for the "make" phase,
+# to ensure the BZR revision-id is correct even after a sequence
+# cmake ; make ; bzr pull ; make
+
+
+# Get the macros which handle the "INFO_*" files.
+INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
+
+# Here is where the action is.
+CREATE_INFO_SRC(${CMAKE_BINARY_DIR}/Docs)
+
diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake
index ade6cdb747f..bbf29c2e46c 100644
--- a/cmake/install_layout.cmake
+++ b/cmake/install_layout.cmake
@@ -26,7 +26,7 @@
# Build as per default RPM layout, with prefix=/usr
#
# DEB
-# Build as per STANDALONE, prefix=/opt/mysql-$major.$minor
+# Build as per STANDALONE, prefix=/opt/mysql/server-$major.$minor
#
# SVR4
# Solaris package layout suitable for pkg* tools, prefix=/opt/mysql/mysql
@@ -59,19 +59,22 @@
# - INSTALL_SUPPORTFILESDIR (various extra support files)
#
# - INSTALL_MYSQLDATADIR (data directory)
+#
+# When changing this page, _please_ do not forget to update public Wiki
+# http://forge.mysql.com/wiki/CMake#Fine-tuning_installation_paths
IF(NOT INSTALL_LAYOUT)
SET(DEFAULT_INSTALL_LAYOUT "STANDALONE")
ENDIF()
SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}"
-CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer) or UNIX")
+CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer), RPM, DEB, SVR4")
IF(UNIX)
IF(INSTALL_LAYOUT MATCHES "RPM")
SET(default_prefix "/usr")
ELSEIF(INSTALL_LAYOUT MATCHES "DEB")
- SET(default_prefix "/opt/${MYSQL_BASE_VERSION}")
+ SET(default_prefix "/opt/mysql/server-${MYSQL_BASE_VERSION}")
# This is required to avoid "cpack -GDEB" default of prefix=/usr
SET(CPACK_SET_DESTDIR ON)
ELSEIF(INSTALL_LAYOUT MATCHES "SVR4")
@@ -83,12 +86,26 @@ IF(UNIX)
SET(CMAKE_INSTALL_PREFIX ${default_prefix}
CACHE PATH "install prefix" FORCE)
ENDIF()
+ SET(VALID_INSTALL_LAYOUTS "RPM" "STANDALONE" "DEB" "SVR4")
+ LIST(FIND VALID_INSTALL_LAYOUTS "${INSTALL_LAYOUT}" ind)
+ IF(ind EQUAL -1)
+ MESSAGE(FATAL_ERROR "Invalid INSTALL_LAYOUT parameter:${INSTALL_LAYOUT}."
+ " Choose between ${VALID_INSTALL_LAYOUTS}" )
+ ENDIF()
+
SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc"
CACHE PATH "config directory (for my.cnf)")
MARK_AS_ADVANCED(SYSCONFDIR)
ENDIF()
#
+# plugin_tests's value should not be used by imported plugins,
+# just use if(INSTALL_PLUGINTESTDIR).
+# The plugin must set its own install path for tests
+#
+FILE(GLOB plugin_tests ${CMAKE_SOURCE_DIR}/plugin/*/tests)
+
+#
# STANDALONE layout
#
SET(INSTALL_BINDIR_STANDALONE "bin")
@@ -112,6 +129,7 @@ SET(INSTALL_SQLBENCHDIR_STANDALONE ".")
SET(INSTALL_SUPPORTFILESDIR_STANDALONE "support-files")
#
SET(INSTALL_MYSQLDATADIR_STANDALONE "data")
+SET(INSTALL_PLUGINTESTDIR_STANDALONE ${plugin_tests})
#
# RPM layout
@@ -142,6 +160,7 @@ SET(INSTALL_SQLBENCHDIR_RPM "")
SET(INSTALL_SUPPORTFILESDIR_RPM "share/mysql")
#
SET(INSTALL_MYSQLDATADIR_RPM "/var/lib/mysql")
+SET(INSTALL_PLUGINTESTDIR_RPM ${plugin_tests})
#
# DEB layout
@@ -167,6 +186,7 @@ SET(INSTALL_SQLBENCHDIR_DEB ".")
SET(INSTALL_SUPPORTFILESDIR_DEB "support-files")
#
SET(INSTALL_MYSQLDATADIR_DEB "data")
+SET(INSTALL_PLUGINTESTDIR_DEB ${plugin_tests})
#
# SVR4 layout
@@ -192,6 +212,7 @@ SET(INSTALL_SQLBENCHDIR_SVR4 ".")
SET(INSTALL_SUPPORTFILESDIR_SVR4 "support-files")
#
SET(INSTALL_MYSQLDATADIR_SVR4 "/var/lib/mysql")
+SET(INSTALL_PLUGINTESTDIR_SVR4 ${plugin_tests})
# Clear cached variables if install layout was changed
@@ -206,7 +227,7 @@ SET(OLD_INSTALL_LAYOUT ${INSTALL_LAYOUT} CACHE INTERNAL "")
# will be defined as ${INSTALL_BINDIR_STANDALONE} by default if STANDALONE
# layout is chosen)
FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN
- INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA)
+ INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA PLUGINTEST)
SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
CACHE STRING "${var} installation directory" ${FORCE})
MARK_AS_ADVANCED(INSTALL_${var}DIR)
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
index 56a540fde89..e244e4262e0 100644
--- a/cmake/install_macros.cmake
+++ b/cmake/install_macros.cmake
@@ -78,12 +78,14 @@ FUNCTION(INSTALL_MANPAGE file)
ELSE()
SET(SECTION man8)
ENDIF()
- INSTALL(FILES "${MANPAGE}" DESTINATION "${INSTALL_MANDIR}/${SECTION}")
+ MESSAGE("huj!")
+ INSTALL(FILES "${MANPAGE}" DESTINATION "${INSTALL_MANDIR}/${SECTION}"
+ COMPONENT ManPages)
ENDIF()
ENDFUNCTION()
FUNCTION(INSTALL_SCRIPT)
- CMAKE_PARSE_ARGUMENTS(ARG
+ MYSQL_PARSE_ARGUMENTS(ARG
"DESTINATION;COMPONENT"
""
${ARGN}
@@ -137,12 +139,7 @@ IF(UNIX)
STRING(REPLACE "${CMAKE_CFG_INTDIR}"
"\${CMAKE_INSTALL_CONFIG_NAME}" output ${output})
ENDIF()
- IF(component)
- SET(COMP COMPONENT ${component})
- ELSE()
- SET(COMP)
- ENDIF()
- INSTALL(FILES ${output} DESTINATION ${destination} ${COMP})
+ INSTALL(FILES ${output} DESTINATION ${destination} COMPONENT ${component})
ENDIF()
ENDMACRO()
@@ -205,7 +202,7 @@ ENDMACRO()
#
FUNCTION(MYSQL_INSTALL_TARGETS)
- CMAKE_PARSE_ARGUMENTS(ARG
+ MYSQL_PARSE_ARGUMENTS(ARG
"DESTINATION;COMPONENT"
""
${ARGN}
@@ -224,8 +221,6 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
IF(SIGNCODE AND SIGNCODE_ENABLED)
SIGN_TARGET(${target})
ENDIF()
- # For Windows, add version info to executables
- ADD_VERSION_INFO(${target})
# Install man pages on Unix
IF(UNIX)
GET_TARGET_PROPERTY(target_location ${target} LOCATION)
@@ -249,7 +244,7 @@ SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug
FUNCTION(INSTALL_DEBUG_TARGET target)
- CMAKE_PARSE_ARGUMENTS(ARG
+ MYSQL_PARSE_ARGUMENTS(ARG
"DESTINATION;RENAME;PDB_DESTINATION;COMPONENT"
""
${ARGN}
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake
index ba63df71428..89eb5a74d80 100644
--- a/cmake/libutils.cmake
+++ b/cmake/libutils.cmake
@@ -213,7 +213,7 @@ ENDMACRO()
# [OUTPUT_NAME output_name]
#)
MACRO(MERGE_LIBRARIES)
- CMAKE_PARSE_ARGUMENTS(ARG
+ MYSQL_PARSE_ARGUMENTS(ARG
"EXPORTS;OUTPUT_NAME;COMPONENT"
"STATIC;SHARED;MODULE;NOINSTALL"
${ARGN}
@@ -250,6 +250,9 @@ MACRO(MERGE_LIBRARIES)
ENDFOREACH()
ENDIF()
CREATE_EXPORT_FILE(SRC ${TARGET} "${ARG_EXPORTS}")
+ IF(NOT ARG_NOINSTALL)
+ ADD_VERSION_INFO(${TARGET} SHARED SRC)
+ ENDIF()
ADD_LIBRARY(${TARGET} ${LIBTYPE} ${SRC})
TARGET_LINK_LIBRARIES(${TARGET} ${LIBS})
IF(ARG_OUTPUT_NAME)
diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake
new file mode 100644
index 00000000000..d24211a6ff8
--- /dev/null
+++ b/cmake/maintainer.cmake
@@ -0,0 +1,54 @@
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# 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(CheckCCompilerFlag)
+
+# Setup GCC (GNU C compiler) warning options.
+MACRO(SET_MYSQL_MAINTAINER_GNU_C_OPTIONS)
+ SET(MY_MAINTAINER_WARNINGS
+ "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror")
+ CHECK_C_COMPILER_FLAG("-Wdeclaration-after-statement"
+ HAVE_DECLARATION_AFTER_STATEMENT)
+ IF(HAVE_DECLARATION_AFTER_STATEMENT)
+ SET(MY_MAINTAINER_DECLARATION_AFTER_STATEMENT
+ "-Wdeclaration-after-statement")
+ ENDIF()
+ SET(MY_MAINTAINER_C_WARNINGS
+ "${MY_MAINTAINER_WARNINGS} ${MY_MAINTAINER_DECLARATION_AFTER_STATEMENT}"
+ CACHE STRING "C warning options used in maintainer builds.")
+ # Do not make warnings in checks into errors.
+ SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Wno-error")
+ENDMACRO()
+
+# Setup G++ (GNU C++ compiler) warning options.
+MACRO(SET_MYSQL_MAINTAINER_GNU_CXX_OPTIONS)
+ SET(MY_MAINTAINER_CXX_WARNINGS
+ "${MY_MAINTAINER_WARNINGS} -Wno-unused-parameter -Woverloaded-virtual"
+ CACHE STRING "C++ warning options used in maintainer builds.")
+ENDMACRO()
+
+# Setup ICC (Intel C Compiler) warning options.
+MACRO(SET_MYSQL_MAINTAINER_INTEL_C_OPTIONS)
+ SET(MY_MAINTAINER_WARNINGS "-Wcheck")
+ SET(MY_MAINTAINER_C_WARNINGS "${MY_MAINTAINER_WARNINGS}"
+ CACHE STRING "C warning options used in maintainer builds.")
+ENDMACRO()
+
+# Setup ICPC (Intel C++ Compiler) warning options.
+MACRO(SET_MYSQL_MAINTAINER_INTEL_CXX_OPTIONS)
+ SET(MY_MAINTAINER_CXX_WARNINGS "${MY_MAINTAINER_WARNINGS}"
+ CACHE STRING "C++ warning options used in maintainer builds.")
+ENDMACRO()
+
diff --git a/cmake/make_dist.cmake.in b/cmake/make_dist.cmake.in
index 13950e08553..5aa1fc8fd0e 100644
--- a/cmake/make_dist.cmake.in
+++ b/cmake/make_dist.cmake.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,19 +14,12 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Make source distribution
-# If bzr is present, run bzr export, add output of BUILD/autorun.sh
-# if autotools are present, also pack bison output into it.
+# If bzr is present, run bzr export.
# Otherwise, just run cpack with source configuration.
SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@")
SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "@CPACK_SOURCE_PACKAGE_FILE_NAME@")
-SET(GLIBTOOLIZE_EXECUTABLE "@GLIBTOOLIZE_EXECUTABLE@")
-SET(LIBTOOLIZE_EXECUTABLE "@LIBTOOLIZE_EXECUTABLE@")
-SET(ACLOCAL_EXECUTABLE "@ACLOCAL_EXECUTABLE@")
-SET(AUTOCONF_EXECUTABLE "@AUTOCONF_EXECUTABLE@")
-SET(AUTOHEADER_EXECUTABLE "@AUTOHEADER_EXECUTABLE@")
-SET(AUTOMAKE_EXECUTABLE "@AUTOMAKE_EXECUTABLE@")
SET(CMAKE_CPACK_COMMAND "@CMAKE_CPACK_COMMAND@")
SET(CMAKE_COMMAND "@CMAKE_COMMAND@")
SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@")
@@ -35,6 +28,9 @@ SET(TAR_EXECUTABLE "@TAR_EXECUTABLE@")
SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
SET(CMAKE_MAKE_PROGRAM "@CMAKE_MAKE_PROGRAM@")
SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
+SET(PLUGIN_REPOS "@PLUGIN_REPOS@")
+
+SET(VERSION "@VERSION@")
SET(MYSQL_DOCS_LOCATION "@MYSQL_DOCS_LOCATION@")
@@ -58,6 +54,22 @@ IF(BZR_EXECUTABLE)
ENDIF()
ENDIF()
+IF(BZR_EXECUTABLE)
+ FOREACH(REPO ${PLUGIN_REPOS})
+ GET_FILENAME_COMPONENT(PLUGIN_NAME ${REPO} NAME)
+ SET(DEST ${PACKAGE_DIR}/plugin/${PLUGIN_NAME})
+ MESSAGE(STATUS "Running bzr export for plugin/${PLUGIN_NAME}")
+ EXECUTE_PROCESS(
+ COMMAND "${BZR_EXECUTABLE}" export ${DEST}
+ WORKING_DIRECTORY ${REPO}
+ RESULT_VARIABLE RESULT
+ )
+ IF(NOT RESULT EQUAL 0)
+ MESSAGE(STATUS "bzr export failed")
+ ENDIF()
+ ENDFOREACH()
+ENDIF()
+
IF(NOT BZR_EXECUTABLE)
MESSAGE(STATUS "bzr not found or source dir is not a repo, use CPack")
@@ -101,44 +113,31 @@ IF(NOT BZR_EXECUTABLE)
)
ENDIF()
-# Try to pack output of BUILD/autorun, if autotools are present
-IF(GLIBTOOLIZE_EXECUTABLE OR LIBTOOLIZE_EXECUTABLE)
- IF(ACLOCAL_EXECUTABLE AND AUTOMAKE_EXECUTABLE AND AUTOCONF_EXECUTABLE
- AND AUTOHEADER_EXECUTABLE)
- SET(HAVE_AUTOTOOLS 1)
- ENDIF()
-ENDIF()
-
-IF(HAVE_AUTOTOOLS)
- EXECUTE_PROCESS(COMMAND BUILD/autorun.sh
- WORKING_DIRECTORY ${PACKAGE_DIR})
-ELSE()
- MESSAGE( "Autotools not found, resulting source package can only be built"
- " with cmake")
- CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/configure.pl
- ${PACKAGE_DIR}/configure
- COPYONLY)
- IF(UNIX)
- EXECUTE_PROCESS(COMMAND chmod +x ${PACKAGE_DIR}/configure)
- ENDIF()
-ENDIF()
-
# Copy bison output
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.h
${PACKAGE_DIR}/sql/sql_yacc.h COPYONLY)
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.cc
${PACKAGE_DIR}/sql/sql_yacc.cc COPYONLY)
+# Copy spec files
+CONFIGURE_FILE(${CMAKE_BINARY_DIR}/support-files/mysql.${VERSION}.spec
+ ${PACKAGE_DIR}/support-files/mysql.${VERSION}.spec COPYONLY)
+
# Add documentation, if user has specified where to find them
IF(MYSQL_DOCS_LOCATION)
MESSAGE("Copying documentation files from " ${MYSQL_DOCS_LOCATION})
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_directory "${MYSQL_DOCS_LOCATION}" "${PACKAGE_DIR}")
ENDIF()
+# Ensure there is an "INFO_SRC" file.
+INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
+IF(NOT EXISTS ${PACKAGE_DIR}/Docs/INFO_SRC)
+ CREATE_INFO_SRC(${PACKAGE_DIR}/Docs)
+ENDIF()
+
# In case we used CPack, it could have copied some
# extra files that are not usable on different machines.
FILE(REMOVE ${PACKAGE_DIR}/CMakeCache.txt)
-FILE(REMOVE_RECURSE ${PACKAGE_DIR}/autom4te.cache)
# When packing source, prefer gnu tar to "cmake -P tar"
# cmake does not preserve timestamps.gnuwin32 tar is broken, cygwin is ok
diff --git a/cmake/mysql_add_executable.cmake b/cmake/mysql_add_executable.cmake
index 86301c2eec8..ac812fbcdfd 100644
--- a/cmake/mysql_add_executable.cmake
+++ b/cmake/mysql_add_executable.cmake
@@ -28,7 +28,7 @@ INCLUDE(cmake_parse_arguments)
FUNCTION (MYSQL_ADD_EXECUTABLE)
# Pass-through arguments for ADD_EXECUTABLE
- CMAKE_PARSE_ARGUMENTS(ARG
+ MYSQL_PARSE_ARGUMENTS(ARG
"WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT"
""
${ARGN}
@@ -37,7 +37,7 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
LIST(REMOVE_AT ARG_DEFAULT_ARGS 0)
SET(sources ${ARG_DEFAULT_ARGS})
-
+ ADD_VERSION_INFO(${target} EXECUTABLE sources)
ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources})
# tell CPack where to install
IF(NOT ARG_EXCLUDE_FROM_ALL)
diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake
index 6adca2ccc2f..5aca3c825a6 100644
--- a/cmake/mysql_version.cmake
+++ b/cmake/mysql_version.cmake
@@ -13,17 +13,29 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-# Read value for a variable from configure.in
+#
+# Global constants, only to be changed between major releases.
+#
+
+SET(SHARED_LIB_MAJOR_VERSION "18")
+SET(PROTOCOL_VERSION "10")
+SET(DOT_FRM_VERSION "6")
+
+# Generate "something" to trigger cmake rerun when VERSION changes
+CONFIGURE_FILE(
+ ${CMAKE_SOURCE_DIR}/VERSION
+ ${CMAKE_BINARY_DIR}/VERSION.dep
+)
+
+# Read value for a variable from VERSION.
MACRO(MYSQL_GET_CONFIG_VALUE keyword var)
IF(NOT ${var})
- IF (EXISTS ${CMAKE_SOURCE_DIR}/configure.in)
- FILE (STRINGS ${CMAKE_SOURCE_DIR}/configure.in str REGEX "^[ ]*${keyword}=")
- IF(str)
- STRING(REPLACE "${keyword}=" "" str ${str})
- STRING(REGEX REPLACE "[ ].*" "" str ${str})
- SET(${var} ${str} CACHE INTERNAL "Config variable")
- ENDIF()
+ FILE (STRINGS ${CMAKE_SOURCE_DIR}/VERSION str REGEX "^[ ]*${keyword}=")
+ IF(str)
+ STRING(REPLACE "${keyword}=" "" str ${str})
+ STRING(REGEX REPLACE "[ ].*" "" str "${str}")
+ SET(${var} ${str})
ENDIF()
ENDIF()
ENDMACRO()
@@ -32,57 +44,32 @@ ENDMACRO()
# Read mysql version for configure script
MACRO(GET_MYSQL_VERSION)
+ MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MAJOR" MAJOR_VERSION)
+ MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MINOR" MINOR_VERSION)
+ MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_PATCH" PATCH_VERSION)
+ MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_EXTRA" EXTRA_VERSION)
- IF(NOT VERSION_STRING)
- IF(EXISTS ${CMAKE_SOURCE_DIR}/configure.in)
- FILE(STRINGS ${CMAKE_SOURCE_DIR}/configure.in str REGEX "AM_INIT_AUTOMAKE")
- STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+[-][^ \\)]+" VERSION_STRING "${str}")
- IF(NOT VERSION_STRING)
- STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION_STRING "${str}")
- IF(NOT VERSION_STRING)
- FILE(STRINGS configure.in str REGEX "AC_INIT\\(")
- STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+[-][a-zAZ0-9]+" VERSION_STRING "${str}")
- ENDIF()
- ENDIF()
- ENDIF()
+ IF(NOT MAJOR_VERSION OR NOT MINOR_VERSION OR NOT PATCH_VERSION)
+ MESSAGE(FATAL_ERROR "VERSION file cannot be parsed.")
ENDIF()
-
- IF(NOT VERSION_STRING)
- MESSAGE(FATAL_ERROR
- "VERSION_STRING cannot be parsed, please specify -DVERSION_STRING=major.minor.patch-extra"
- "when calling cmake")
- ENDIF()
-
- SET(VERSION ${VERSION_STRING})
- STRING(REPLACE "-" "_" MYSQL_U_SCORE_VERSION "${VERSION_STRING}")
-
- # Remove trailing (non-numeric) part of the version string
- STRING(REGEX REPLACE "[^\\.0-9].*" "" VERSION_STRING ${VERSION_STRING})
-
- STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" MAJOR_VERSION "${VERSION_STRING}")
- STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" MINOR_VERSION "${VERSION_STRING}")
- STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" PATCH "${VERSION_STRING}")
+ SET(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${EXTRA_VERSION}")
+ MESSAGE("-- MySQL ${VERSION}")
SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version")
- SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH}")
- MATH(EXPR MYSQL_VERSION_ID "10000*${MAJOR_VERSION} + 100*${MINOR_VERSION} + ${PATCH}")
+ SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
+ STRING(REPLACE "-" "_" MYSQL_RPM_VERSION "${VERSION}")
+ MATH(EXPR MYSQL_VERSION_ID "10000*${MAJOR_VERSION} + 100*${MINOR_VERSION} + ${PATCH_VERSION}")
MARK_AS_ADVANCED(VERSION MYSQL_VERSION_ID MYSQL_BASE_VERSION)
SET(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION})
SET(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION})
- SET(CPACK_PACKAGE_VERSION_PATCH ${PATCH})
+ SET(CPACK_PACKAGE_VERSION_PATCH ${PATCH_VERSION})
ENDMACRO()
# Get mysql version and other interesting variables
GET_MYSQL_VERSION()
-MYSQL_GET_CONFIG_VALUE("PROTOCOL_VERSION" PROTOCOL_VERSION)
-MYSQL_GET_CONFIG_VALUE("DOT_FRM_VERSION" DOT_FRM_VERSION)
-MYSQL_GET_CONFIG_VALUE("MYSQL_TCP_PORT_DEFAULT" MYSQL_TCP_PORT_DEFAULT)
-MYSQL_GET_CONFIG_VALUE("MYSQL_UNIX_ADDR_DEFAULT" MYSQL_UNIX_ADDR_DEFAULT)
-MYSQL_GET_CONFIG_VALUE("SHARED_LIB_MAJOR_VERSION" SHARED_LIB_MAJOR_VERSION)
-IF(NOT MYSQL_TCP_PORT_DEFAULT)
- SET(MYSQL_TCP_PORT_DEFAULT "3306")
-ENDIF()
+SET(MYSQL_TCP_PORT_DEFAULT "3306")
+
IF(NOT MYSQL_TCP_PORT)
SET(MYSQL_TCP_PORT ${MYSQL_TCP_PORT_DEFAULT})
SET(MYSQL_TCP_PORT_DEFAULT "0")
@@ -130,9 +117,8 @@ ENDIF()
# Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx
# for more info.
IF(MSVC)
- GET_TARGET_PROPERTY(location gen_versioninfo LOCATION)
- IF(NOT location)
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+
SET(FILETYPE VFT_APP)
CONFIGURE_FILE(${MYSQL_CMAKE_SCRIPT_DIR}/versioninfo.rc.in
${CMAKE_BINARY_DIR}/versioninfo_exe.rc)
@@ -140,31 +126,14 @@ IF(MSVC)
SET(FILETYPE VFT_DLL)
CONFIGURE_FILE(${MYSQL_CMAKE_SCRIPT_DIR}/versioninfo.rc.in
${CMAKE_BINARY_DIR}/versioninfo_dll.rc)
-
- ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_BINARY_DIR}/versioninfo_exe.res
- ${CMAKE_BINARY_DIR}/versioninfo_dll.res
- COMMAND ${CMAKE_RC_COMPILER} versioninfo_exe.rc
- COMMAND ${CMAKE_RC_COMPILER} versioninfo_dll.rc
- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
- )
- ADD_CUSTOM_TARGET(gen_versioninfo
- DEPENDS
- ${CMAKE_BINARY_DIR}/versioninfo_exe.res
- ${CMAKE_BINARY_DIR}/versioninfo_dll.res
- )
- ENDIF()
-
- FUNCTION(ADD_VERSION_INFO target)
- GET_TARGET_PROPERTY(target_type ${target} TYPE)
- ADD_DEPENDENCIES(${target} gen_versioninfo)
- IF(target_type MATCHES "SHARED" OR target_type MATCHES "MODULE")
- SET_PROPERTY(TARGET ${target} APPEND PROPERTY LINK_FLAGS
- "\"${CMAKE_BINARY_DIR}/versioninfo_dll.res\"")
- ELSEIF(target_type MATCHES "EXE")
- SET_PROPERTY(TARGET ${target} APPEND PROPERTY LINK_FLAGS
- "${target_link_flags} \"${CMAKE_BINARY_DIR}/versioninfo_exe.res\"")
+
+ FUNCTION(ADD_VERSION_INFO target target_type sources_var)
+ IF("${target_type}" MATCHES "SHARED" OR "${target_type}" MATCHES "MODULE")
+ SET(rcfile ${CMAKE_BINARY_DIR}/versioninfo_dll.rc)
+ ELSEIF("${target_type}" MATCHES "EXE")
+ SET(rcfile ${CMAKE_BINARY_DIR}/versioninfo_exe.rc)
ENDIF()
+ SET(${sources_var} ${${sources_var}} ${rcfile} PARENT_SCOPE)
ENDFUNCTION()
ELSE()
FUNCTION(ADD_VERSION_INFO)
diff --git a/cmake/os/Linux.cmake b/cmake/os/Linux.cmake
index 946e020d6f4..10d3a719609 100644
--- a/cmake/os/Linux.cmake
+++ b/cmake/os/Linux.cmake
@@ -33,7 +33,7 @@ ENDFOREACH()
# Ensure we have clean build for shared libraries
# without unresolved symbols
-SET(LINK_FLAG_NO_UNDEFINED "--Wl,--no-undefined")
+SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined")
# 64 bit file offset support flag
SET(_FILE_OFFSET_BITS 64)
diff --git a/cmake/os/SunOS.cmake b/cmake/os/SunOS.cmake
index e932e6c2b74..9e8ca0ef11f 100644
--- a/cmake/os/SunOS.cmake
+++ b/cmake/os/SunOS.cmake
@@ -17,7 +17,6 @@ INCLUDE(CheckSymbolExists)
INCLUDE(CheckCSourceRuns)
INCLUDE(CheckCSourceCompiles)
-SET(TARGET_OS_SOLARIS 1)
# Enable 64 bit file offsets
SET(_FILE_OFFSET_BITS 64)
diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake
index aac7e484f26..b51f3a2dc52 100644
--- a/cmake/os/Windows.cmake
+++ b/cmake/os/Windows.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Sun Microsystems, Inc
+# Copyright (C) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -91,7 +91,6 @@ IF(MSVC)
STRING(REGEX REPLACE "/INCREMENTAL:([^ ]+)" "" CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO}")
ENDFOREACH()
- ADD_DEFINITIONS(-DPTHREAD_STACK_MIN=1048576)
# Mark 32 bit executables large address aware so they can
# use > 2GB address space
IF(CMAKE_SIZEOF_VOID_P MATCHES 4)
@@ -105,14 +104,9 @@ IF(MSVC)
ENDIF()
#TODO: update the code and remove the disabled warnings
- ADD_DEFINITIONS(/wd4800 /wd4805)
- IF (MSVC_VERSION GREATER 1310)
- ADD_DEFINITIONS(/wd4996)
- ENDIF()
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /we4099")
- # Make class/struct definition mismatch an error (overseen too often,
- # adds tons of new warnings)
- ADD_DEFINITIONS(/we4099)
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
# _WIN64 is defined by the compiler itself.
@@ -198,3 +192,4 @@ IF(NOT HAVE_SIZE_OF_SSIZE_T)
ENDIF()
SET(FN_NO_CASE_SENSE 1)
+SET(USE_SYMDIR 1)
diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake
index 732f5d74181..68bbb337e15 100644
--- a/cmake/os/WindowsCache.cmake
+++ b/cmake/os/WindowsCache.cmake
@@ -57,6 +57,7 @@ SET(HAVE_FCNTL_H 1 CACHE INTERNAL "")
SET(HAVE_FCNTL_NONBLOCK CACHE INTERNAL "")
SET(HAVE_FCONVERT CACHE INTERNAL "")
SET(HAVE_FDATASYNC CACHE INTERNAL "")
+SET(HAVE_DECL_FDATASYNC CACHE INTERNAL "")
SET(HAVE_FENV_H CACHE INTERNAL "")
SET(HAVE_FESETROUND CACHE INTERNAL "")
SET(HAVE_FGETLN CACHE INTERNAL "")
@@ -75,9 +76,6 @@ SET(HAVE_FTRUNCATE CACHE INTERNAL "")
SET(HAVE_GETADDRINFO 1 CACHE INTERNAL "")
SET(HAVE_GETCWD 1 CACHE INTERNAL "")
SET(HAVE_GETHOSTBYADDR_R CACHE INTERNAL "")
-SET(HAVE_GETHOSTBYNAME_R CACHE INTERNAL "")
-SET(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE CACHE INTERNAL "")
-SET(HAVE_GETHOSTBYNAME_R_RETURN_INT CACHE INTERNAL "")
SET(HAVE_GETHRTIME CACHE INTERNAL "")
SET(HAVE_GETLINE CACHE INTERNAL "")
SET(HAVE_GETNAMEINFO CACHE INTERNAL "")
@@ -103,6 +101,10 @@ SET(HAVE_IPV6_V6ONLY 1 CACHE INTERNAL "")
SET(HAVE_ISINF CACHE INTERNAL "")
SET(HAVE_ISNAN CACHE INTERNAL "")
SET(HAVE_ISSETUGID CACHE INTERNAL "")
+SET(HAVE_GETUID CACHE INTERNAL "")
+SET(HAVE_GETEUID CACHE INTERNAL "")
+SET(HAVE_GETGID CACHE INTERNAL "")
+SET(HAVE_GETEGID CACHE INTERNAL "")
SET(HAVE_LANGINFO_H CACHE INTERNAL "")
SET(HAVE_LDIV 1 CACHE INTERNAL "")
SET(HAVE_LIMITS_H 1 CACHE INTERNAL "")
@@ -131,6 +133,7 @@ SET(HAVE_PASE_ENVIRONMENT CACHE INTERNAL "")
SET(HAVE_PATHS_H CACHE INTERNAL "")
SET(HAVE_PCLOSE CACHE INTERNAL "")
SET(HAVE_PERROR 1 CACHE INTERNAL "")
+SET(HAVE_PEERCRED CACHE INTERNAL "")
SET(HAVE_POLL_H CACHE INTERNAL "")
SET(HAVE_POPEN CACHE INTERNAL "")
SET(HAVE_POLL CACHE INTERNAL "")
@@ -338,6 +341,7 @@ SET(SIGNAL_RETURN_TYPE_IS_VOID 1 CACHE INTERNAL "")
SET(C_HAS_inline CACHE INTERNAL "")
SET(C_HAS___inline 1 CACHE INTERNAL "")
SET(FIONREAD_IN_SYS_IOCTL CACHE INTERNAL "")
+SET(FIONREAD_IN_SYS_FILIO CACHE INTERNAL "")
SET(GWINSZ_IN_SYS_IOCTL CACHE INTERNAL "")
SET(HAVE_CXXABI_H CACHE INTERNAL "")
SET(HAVE_NDIR_H CACHE INTERNAL "")
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 31e1fceec23..615b1d7a717 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -27,8 +27,24 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
# [LINK_LIBRARIES lib1...libN]
# [DEPENDENCIES target1...targetN]
+# Append collections files for the plugin to the common files
+# Make sure we don't copy twice if running cmake again
+
+MACRO(PLUGIN_APPEND_COLLECTIONS plugin)
+ SET(fcopied "${CMAKE_CURRENT_SOURCE_DIR}/tests/collections/FilesCopied")
+ IF(NOT EXISTS ${fcopied})
+ FILE(GLOB collections ${CMAKE_CURRENT_SOURCE_DIR}/tests/collections/*)
+ FOREACH(cfile ${collections})
+ FILE(READ ${cfile} contents)
+ GET_FILENAME_COMPONENT(fname ${cfile} NAME)
+ FILE(APPEND ${CMAKE_SOURCE_DIR}/mysql-test/collections/${fname} "${contents}")
+ FILE(APPEND ${fcopied} "${fname}\n")
+ ENDFOREACH()
+ ENDIF()
+ENDMACRO()
+
MACRO(MYSQL_ADD_PLUGIN)
- CMAKE_PARSE_ARGUMENTS(ARG
+ MYSQL_PARSE_ARGUMENTS(ARG
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME"
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED"
${ARGN}
@@ -123,7 +139,7 @@ MACRO(MYSQL_ADD_PLUGIN)
# Update mysqld dependencies
SET (MYSQLD_STATIC_PLUGIN_LIBS ${MYSQLD_STATIC_PLUGIN_LIBS}
- ${target} CACHE INTERNAL "" FORCE)
+ ${target} ${ARG_LINK_LIBRARIES} CACHE INTERNAL "" FORCE)
IF(ARG_MANDATORY)
SET(${with_var} ON CACHE INTERNAL "Link ${plugin} statically to the server"
@@ -151,6 +167,7 @@ MACRO(MYSQL_ADD_PLUGIN)
ENDIF()
ENDIF()
+ ADD_VERSION_INFO(${target} MODULE SOURCES)
ADD_LIBRARY(${target} MODULE ${SOURCES})
DTRACE_INSTRUMENT(${target})
SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX ""
@@ -179,6 +196,10 @@ MACRO(MYSQL_ADD_PLUGIN)
# Install dynamic library
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Server)
INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug)
+ # For internal testing in PB2, append collections files
+ IF(DEFINED ENV{PB2WORKDIR})
+ PLUGIN_APPEND_COLLECTIONS(${plugin})
+ ENDIF()
ELSE()
IF(WITHOUT_${plugin})
# Update cache variable
@@ -206,4 +227,11 @@ MACRO(CONFIGURE_PLUGINS)
ADD_SUBDIRECTORY(${dir})
ENDIF()
ENDFOREACH()
+ FOREACH(dir ${dirs_plugin})
+ IF (EXISTS ${dir}/.bzr)
+ MESSAGE(STATUS "Found repo ${dir}/.bzr")
+ LIST(APPEND PLUGIN_BZR_REPOS "${dir}")
+ ENDIF()
+ ENDFOREACH()
+ SET(PLUGIN_REPOS "${PLUGIN_BZR_REPOS}" CACHE INTERNAL "")
ENDMACRO()
diff --git a/cmake/versioninfo.rc.in b/cmake/versioninfo.rc.in
index 97c45ec86c0..c625ce8c7f4 100644
--- a/cmake/versioninfo.rc.in
+++ b/cmake/versioninfo.rc.in
@@ -1,7 +1,7 @@
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
-FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH@,0
-PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH@,0
+FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0
+PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS__WINDOWS32
@@ -12,8 +12,8 @@ BEGIN
BEGIN
BLOCK "040904E4"
BEGIN
- VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@.0\0"
- VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@.0\0"
+ VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0"
+ VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0"
END
END
BLOCK "VarFileInfo"
diff --git a/cmd-line-utils/Makefile.am b/cmd-line-utils/Makefile.am
deleted file mode 100644
index 622aa72fd43..00000000000
--- a/cmd-line-utils/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright (C) 2004 MySQL AB
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-## Process this file with automake to create Makefile.in
-
-SUBDIRS= @readline_basedir@
-DIST_SUBDIRS= libedit readline
diff --git a/cmd-line-utils/libedit/CMakeLists.txt b/cmd-line-utils/libedit/CMakeLists.txt
index b0e375dfcbd..76fcfc3204e 100644
--- a/cmd-line-utils/libedit/CMakeLists.txt
+++ b/cmd-line-utils/libedit/CMakeLists.txt
@@ -26,6 +26,21 @@ int main()
tgoto(0,0,0);
return 0;
}" HAVE_DECL_TGOTO)
+IF(NOT HAVE_DECL_TGOTO)
+ # On Solaris 11, term.h is broken, curses.h is also required.
+ CHECK_CXX_SOURCE_COMPILES("
+ #include <curses.h>
+ #include <term.h>
+ int main()
+ {
+ tgoto(0,0,0);
+ return 0;
+ }" HAVE_DECL_TGOTO2)
+ IF(HAVE_DECL_TGOTO2)
+ SET(HAVE_DECL_TGOTO 1 CACHE INTERNAL "" FORCE)
+ ENDIF()
+ENDIF()
+
SET(CMAKE_REQUIRED_LIBRARIES)
diff --git a/cmd-line-utils/libedit/Makefile.am b/cmd-line-utils/libedit/Makefile.am
deleted file mode 100644
index 88ea97afffd..00000000000
--- a/cmd-line-utils/libedit/Makefile.am
+++ /dev/null
@@ -1,92 +0,0 @@
-## Process this file with automake to create Makefile.in
-
-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
-
-noinst_LIBRARIES = libedit.a
-
-libedit_a_SOURCES = chared.c el.c history.c map.c prompt.c readline.c \
- search.c tokenizer.c vi.c common.c emacs.c \
- hist.c key.c parse.c read.c refresh.c sig.c term.c \
- tty.c help.c fcns.c filecomplete.c \
- np/unvis.c np/strlcpy.c np/vis.c np/strlcat.c \
- np/fgetln.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 \
- sys.h config.h hist.h map.h prompt.h read.h \
- search.h tty.h filecomplete.h np/vis.h
-
-EXTRA_DIST = makelist.sh CMakeLists.txt
-
-CLEANFILES = makelist common.h emacs.h vi.h fcns.h help.h fcns.c help.c
-
-SUFFIXES = .sh
-
-.sh:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''AWK''@!@AWK@!' \
- $< > $@-t
- @MV@ $@-t $@
-
-vi.h: $(srcdir)/vi.c makelist
- sh ./makelist -h $(srcdir)/vi.c > $@.tmp && \
- mv $@.tmp $@
-
-emacs.h: $(srcdir)/emacs.c makelist
- sh ./makelist -h $(srcdir)/emacs.c > $@.tmp && \
- mv $@.tmp $@
-
-common.h: $(srcdir)/common.c makelist
- sh ./makelist -h $(srcdir)/common.c > $@.tmp && \
- mv $@.tmp $@
-
-help.c: ${ASRC} makelist
- sh ./makelist -bc ${ASRC} > $@.tmp && \
- mv $@.tmp $@
-
-help.h: ${ASRC} makelist
- sh ./makelist -bh ${ASRC} > $@.tmp && \
- mv $@.tmp $@
-
-fcns.h: ${AHDR} makelist
- sh ./makelist -fh ${AHDR} > $@.tmp && \
- mv $@.tmp $@
-
-fcns.c: ${AHDR} fcns.h makelist
- sh ./makelist -fc ${AHDR} > $@.tmp && \
- mv $@.tmp $@
-
-#%.o: vi.h emacs.h common.h help.h fcns.h
-#objects := $(patsubst %.c,%.o,$(wildcard *.c))
-#$(objects): vi.h emacs.h
-
-chared.o: vi.h emacs.h common.h help.h fcns.h
-el.o: vi.h emacs.h common.h help.h fcns.h
-history.o: vi.h emacs.h common.h help.h fcns.h
-map.o: vi.h emacs.h common.h help.h fcns.h
-prompt.o: vi.h emacs.h common.h help.h fcns.h
-readline.o: vi.h emacs.h common.h help.h fcns.h
-search.o: vi.h emacs.h common.h help.h fcns.h
-tokenizer.o: vi.h emacs.h common.h help.h fcns.h
-vi.o: vi.h emacs.h common.h help.h fcns.h
-common.o: vi.h emacs.h common.h help.h fcns.h
-emacs.o: vi.h emacs.h common.h help.h fcns.h
-hist.o: vi.h emacs.h common.h help.h fcns.h
-key.o: vi.h emacs.h common.h help.h fcns.h
-parse.o: vi.h emacs.h common.h help.h fcns.h
-read.o: vi.h emacs.h common.h help.h fcns.h
-refresh.o: vi.h emacs.h common.h help.h fcns.h
-sig.o: vi.h emacs.h common.h help.h fcns.h
-term.o: vi.h emacs.h common.h help.h fcns.h
-tty.o: vi.h emacs.h common.h help.h fcns.h
-help.o: vi.h emacs.h common.h help.h fcns.h
-fcns.o: vi.h emacs.h common.h help.h fcns.h
-filecomplete.o: vi.h emacs.h common.h help.h fcns.h
diff --git a/cmd-line-utils/libedit/common.c b/cmd-line-utils/libedit/common.c
index d4d024eae10..ba5890fa606 100644
--- a/cmd-line-utils/libedit/common.c
+++ b/cmd-line-utils/libedit/common.c
@@ -136,7 +136,7 @@ ed_delete_prev_word(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-ed_delete_next_char(EditLine *el, int c)
+ed_delete_next_char(EditLine *el, int c __attribute__((__unused__)))
{
#ifdef notdef /* XXX */
#define EL el->el_line
@@ -431,7 +431,8 @@ ed_argument_digit(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-ed_unassigned(EditLine *el, int c __attribute__((__unused__)))
+ed_unassigned(EditLine *el __attribute__((__unused__)),
+ int c __attribute__((__unused__)))
{
return (CC_ERROR);
diff --git a/cmd-line-utils/libedit/el.c b/cmd-line-utils/libedit/el.c
index d99946eb68f..c7f8386773d 100644
--- a/cmd-line-utils/libedit/el.c
+++ b/cmd-line-utils/libedit/el.c
@@ -478,7 +478,13 @@ el_source(EditLine *el, const char *fname)
fp = NULL;
if (fname == NULL) {
-#ifdef HAVE_ISSETUGID
+/* XXXMYSQL: Bug#49967 */
+#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) && \
+ defined(HAVE_GETGID) && defined(HAVE_GETEGID)
+#define HAVE_IDENTITY_FUNCS 1
+#endif
+
+#if (defined(HAVE_ISSETUGID) || defined(HAVE_IDENTITY_FUNCS))
static const char elpath[] = "/.editrc";
/* XXXMYSQL: Portability fix (for which platforms?) */
#ifdef MAXPATHLEN
@@ -486,9 +492,13 @@ el_source(EditLine *el, const char *fname)
#else
char path[4096];
#endif
-
+#ifdef HAVE_ISSETUGID
if (issetugid())
return (-1);
+#elif defined(HAVE_IDENTITY_FUNCS)
+ if (getuid() != geteuid() || getgid() != getegid())
+ return (-1);
+#endif
if ((ptr = getenv("HOME")) == NULL)
return (-1);
if (strlcpy(path, ptr, sizeof(path)) >= sizeof(path))
@@ -498,9 +508,10 @@ el_source(EditLine *el, const char *fname)
fname = path;
#else
/*
- * If issetugid() is missing, always return an error, in order
- * to keep from inadvertently opening up the user to a security
- * hole.
+ * If issetugid() or the above mentioned get[e][u|g]id()
+ * functions are missing, always return an error, in order
+ * to keep from inadvertently opening up the user to a
+ * security hole.
*/
return (-1);
#endif
diff --git a/cmd-line-utils/libedit/readline.c b/cmd-line-utils/libedit/readline.c
index 1f1b18c97d8..0318ab409b3 100644
--- a/cmd-line-utils/libedit/readline.c
+++ b/cmd-line-utils/libedit/readline.c
@@ -202,7 +202,7 @@ _move_history(int op)
*/
static int
/*ARGSUSED*/
-_getc_function(EditLine *el, char *c)
+_getc_function(EditLine *el __attribute__((__unused__)), char *c)
{
int i;
@@ -1613,7 +1613,8 @@ rl_insert(int count, int c)
/*ARGSUSED*/
int
-rl_newline(int count, int c)
+rl_newline(int count __attribute__((__unused__)),
+ int c __attribute__((__unused__)))
{
/*
* Readline-4.0 appears to ignore the args.
@@ -1623,7 +1624,7 @@ rl_newline(int count, int c)
/*ARGSUSED*/
static unsigned char
-rl_bind_wrapper(EditLine *el, unsigned char c)
+rl_bind_wrapper(EditLine *el __attribute__((__unused__)), unsigned char c)
{
if (map[c] == NULL)
return CC_ERROR;
@@ -1718,7 +1719,7 @@ rl_get_previous_history(int count, int key)
void
/*ARGSUSED*/
-rl_prep_terminal(int meta_flag)
+rl_prep_terminal(int meta_flag __attribute__((__unused__)))
{
el_set(e, EL_PREP_TERM, 1);
}
@@ -1922,7 +1923,8 @@ _rl_qsort_string_compare(char **s1, char **s2)
int
/*ARGSUSED*/
-rl_kill_text(int from, int to)
+rl_kill_text(int from __attribute__((__unused__)),
+ int to __attribute__((__unused__)))
{
return 0;
}
@@ -1941,20 +1943,25 @@ rl_get_keymap(void)
void
/*ARGSUSED*/
-rl_set_keymap(Keymap k)
+rl_set_keymap(Keymap k __attribute__((__unused__)))
{
}
int
/*ARGSUSED*/
-rl_generic_bind(int type, const char * keyseq, const char * data, Keymap k)
+rl_generic_bind(int type __attribute__((__unused__)),
+ const char * keyseq __attribute__((__unused__)),
+ const char * data __attribute__((__unused__)),
+ Keymap k __attribute__((__unused__)))
{
return 0;
}
int
/*ARGSUSED*/
-rl_bind_key_in_map(int key, Function *fun, Keymap k)
+rl_bind_key_in_map(int key __attribute__((__unused__)),
+ Function *fun __attribute__((__unused__)),
+ Keymap k __attribute__((__unused__)))
{
return 0;
}
diff --git a/cmd-line-utils/libedit/vi.c b/cmd-line-utils/libedit/vi.c
index 00a9f493a9b..beffc7b40b5 100644
--- a/cmd-line-utils/libedit/vi.c
+++ b/cmd-line-utils/libedit/vi.c
@@ -145,7 +145,7 @@ vi_paste_prev(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_prev_big_word(EditLine *el, int c)
+vi_prev_big_word(EditLine *el, int c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.buffer)
@@ -195,7 +195,7 @@ vi_prev_word(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_next_big_word(EditLine *el, int c)
+vi_next_big_word(EditLine *el, int c __attribute__((__unused__)))
{
if (el->el_line.cursor >= el->el_line.lastchar - 1)
@@ -462,7 +462,7 @@ vi_delete_meta(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_end_big_word(EditLine *el, int c)
+vi_end_big_word(EditLine *el, int c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.lastchar)
@@ -797,7 +797,7 @@ vi_repeat_prev_char(EditLine *el, int c __attribute__((__unused__)))
*/
protected el_action_t
/*ARGSUSED*/
-vi_match(EditLine *el, int c)
+vi_match(EditLine *el, int c __attribute__((__unused__)))
{
const char match_chars[] = "()[]{}";
char *cp;
@@ -844,7 +844,7 @@ vi_match(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_undo_line(EditLine *el, int c)
+vi_undo_line(EditLine *el, int c __attribute__((__unused__)))
{
cv_undo(el);
@@ -858,7 +858,7 @@ vi_undo_line(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_column(EditLine *el, int c)
+vi_to_column(EditLine *el, int c __attribute__((__unused__)))
{
el->el_line.cursor = el->el_line.buffer;
@@ -872,7 +872,7 @@ vi_to_column(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_yank_end(EditLine *el, int c)
+vi_yank_end(EditLine *el, int c __attribute__((__unused__)))
{
cv_yank(el, el->el_line.cursor,
@@ -886,7 +886,7 @@ vi_yank_end(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_yank(EditLine *el, int c)
+vi_yank(EditLine *el, int c __attribute__((__unused__)))
{
return cv_action(el, YANK);
@@ -898,7 +898,7 @@ vi_yank(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_comment_out(EditLine *el, int c)
+vi_comment_out(EditLine *el, int c __attribute__((__unused__)))
{
el->el_line.cursor = el->el_line.buffer;
@@ -919,7 +919,8 @@ extern char *get_alias_text(const char *) __weak_reference(get_alias_text);
#endif
protected el_action_t
/*ARGSUSED*/
-vi_alias(EditLine *el, int c)
+vi_alias(EditLine *el __attribute__((__unused__)),
+ int c __attribute__((__unused__)))
{
#if defined(__weak_reference) && !defined(__FreeBSD__)
char alias_name[3];
@@ -949,7 +950,7 @@ vi_alias(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_history_line(EditLine *el, int c)
+vi_to_history_line(EditLine *el, int c __attribute__((__unused__)))
{
int sv_event_no = el->el_history.eventno;
el_action_t rval;
@@ -994,7 +995,7 @@ vi_to_history_line(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_histedit(EditLine *el, int c)
+vi_histedit(EditLine *el, int c __attribute__((__unused__)))
{
int fd;
pid_t pid;
@@ -1011,8 +1012,10 @@ vi_histedit(EditLine *el, int c)
if (fd < 0)
return CC_ERROR;
cp = el->el_line.buffer;
- write(fd, cp, el->el_line.lastchar - cp +0u);
- write(fd, "\n", 1);
+ if (write(fd, cp, el->el_line.lastchar - cp +0u) == -1)
+ goto error;
+ if (write(fd, "\n", 1) == -1)
+ goto error;
pid = fork();
switch (pid) {
case -1:
@@ -1040,6 +1043,12 @@ vi_histedit(EditLine *el, int c)
unlink(tempfile);
/* return CC_REFRESH; */
return ed_newline(el, 0);
+
+/* XXXMYSQL: Avoid compiler warnings. */
+error:
+ close(fd);
+ unlink(tempfile);
+ return CC_ERROR;
}
/* vi_history_word():
@@ -1050,7 +1059,7 @@ vi_histedit(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_history_word(EditLine *el, int c)
+vi_history_word(EditLine *el, int c __attribute__((__unused__)))
{
const char *wp = HIST_FIRST(el);
const char *wep, *wsp;
@@ -1099,7 +1108,7 @@ vi_history_word(EditLine *el, int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_redo(EditLine *el, int c)
+vi_redo(EditLine *el, int c __attribute__((__unused__)))
{
c_redo_t *r = &el->el_chared.c_redo;
diff --git a/cmd-line-utils/readline/CMakeLists.txt b/cmd-line-utils/readline/CMakeLists.txt
index ed6a6b902ea..be84f22f210 100644
--- a/cmd-line-utils/readline/CMakeLists.txt
+++ b/cmd-line-utils/readline/CMakeLists.txt
@@ -16,7 +16,7 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/cmd-line-utils)
-ADD_DEFINITIONS(-DHAVE_CONFIG_H -DNO_KILL_INTR -DMYSQL_CLIENT_NO_THREADS)
+ADD_DEFINITIONS(-DHAVE_CONFIG_H -DNO_KILL_INTR)
INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH})
diff --git a/cmd-line-utils/readline/Makefile.am b/cmd-line-utils/readline/Makefile.am
deleted file mode 100644
index 48d3af34412..00000000000
--- a/cmd-line-utils/readline/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-## Process this file with automake to create Makefile.in
-# Makefile for the GNU readline library.
-# Copyright (C) 1994,1996,1997 Free Software Foundation, Inc.
-
-# Last -I$(top_srcdir) needed for RedHat!
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
- -I$(top_srcdir)
-
-noinst_LIBRARIES = libreadline.a
-
-libreadline_a_SOURCES = readline.c funmap.c keymaps.c \
- vi_mode.c parens.c rltty.c \
- complete.c bind.c isearch.c \
- display.c signals.c \
- util.c kill.c \
- undo.c macro.c input.c \
- callback.c terminal.c xmalloc.c \
- history.c histsearch.c histexpand.c \
- histfile.c nls.c search.c \
- shell.c tilde.c misc.c text.c mbutil.c \
- compat.c savestring.c
-
-noinst_HEADERS = readline.h chardefs.h keymaps.h \
- history.h tilde.h rlmbutil.h rltypedefs.h rlprivate.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
-
-EXTRA_DIST= emacs_keymap.c vi_keymap.c CMakeLists.txt
-
-DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR -D_GNU_SOURCE=1
diff --git a/cmd-line-utils/readline/bind.c b/cmd-line-utils/readline/bind.c
index cea1d0d81f6..7f733abe80c 100644
--- a/cmd-line-utils/readline/bind.c
+++ b/cmd-line-utils/readline/bind.c
@@ -855,7 +855,7 @@ _rl_read_init_file (filename, include_level)
{
register int i;
char *buffer, *openname, *line, *end;
- size_t file_size;
+ size_t file_size = 0;
current_readline_init_file = filename;
current_readline_init_include_level = include_level;
diff --git a/cmd-line-utils/readline/complete.c b/cmd-line-utils/readline/complete.c
index 2745e4e4801..d11ea2493a6 100644
--- a/cmd-line-utils/readline/complete.c
+++ b/cmd-line-utils/readline/complete.c
@@ -1839,8 +1839,11 @@ rl_username_completion_function (text, state)
#else /* !__WIN32__ && !__OPENNT) */
static char *username = (char *)NULL;
static struct passwd *entry;
- static int namelen, first_char, first_char_loc;
+ static int first_char, first_char_loc;
char *value;
+#if defined (HAVE_GETPWENT)
+ static int namelen;
+#endif
if (state == 0)
{
@@ -1850,7 +1853,9 @@ rl_username_completion_function (text, state)
first_char_loc = first_char == '~';
username = savestring (&text[first_char_loc]);
+#if defined (HAVE_GETPWENT)
namelen = strlen (username);
+#endif
setpwent ();
}
diff --git a/cmd-line-utils/readline/histfile.c b/cmd-line-utils/readline/histfile.c
index cbd367542ce..1a6d69b6684 100644
--- a/cmd-line-utils/readline/histfile.c
+++ b/cmd-line-utils/readline/histfile.c
@@ -402,6 +402,7 @@ history_truncate_file (fname, lines)
if (bp > buffer && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1))
{
bytes_written= write (file, bp, chars_read - (bp - buffer));
+ (void) bytes_written;
#if defined (__BEOS__)
/* BeOS ignores O_TRUNC. */
diff --git a/cmd-line-utils/readline/isearch.c b/cmd-line-utils/readline/isearch.c
index 305c847d8da..977e08eb9ba 100644
--- a/cmd-line-utils/readline/isearch.c
+++ b/cmd-line-utils/readline/isearch.c
@@ -617,7 +617,7 @@ rl_search_history (direction, invoking_key)
int direction, invoking_key __attribute__((unused));
{
_rl_search_cxt *cxt; /* local for now, but saved globally */
- int c, r;
+ int r;
RL_SETSTATE(RL_STATE_ISEARCH);
cxt = _rl_isearch_init (direction);
@@ -632,7 +632,7 @@ rl_search_history (direction, invoking_key)
r = -1;
for (;;)
{
- c = _rl_search_getchar (cxt);
+ _rl_search_getchar (cxt);
/* We might want to handle EOF here (c == 0) */
r = _rl_isearch_dispatch (cxt, cxt->lastc);
if (r <= 0)
@@ -655,9 +655,9 @@ int
_rl_isearch_callback (cxt)
_rl_search_cxt *cxt;
{
- int c, r;
+ int r;
- c = _rl_search_getchar (cxt);
+ _rl_search_getchar (cxt);
/* We might want to handle EOF here */
r = _rl_isearch_dispatch (cxt, cxt->lastc);
diff --git a/cmd-line-utils/readline/parens.c b/cmd-line-utils/readline/parens.c
index fe1578ed3e2..58f22291172 100644
--- a/cmd-line-utils/readline/parens.c
+++ b/cmd-line-utils/readline/parens.c
@@ -115,7 +115,7 @@ rl_insert_close (count, invoking_key)
else
{
#if defined (HAVE_SELECT)
- int orig_point, match_point, ready;
+ int orig_point, match_point;
struct timeval timer;
fd_set readfds;
@@ -136,7 +136,7 @@ rl_insert_close (count, invoking_key)
orig_point = rl_point;
rl_point = match_point;
(*rl_redisplay_function) ();
- ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
+ select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
rl_point = orig_point;
#else /* !HAVE_SELECT */
_rl_insert_char (count, invoking_key);
diff --git a/cmd-line-utils/readline/readline.c b/cmd-line-utils/readline/readline.c
index 3a0f533fcd6..d98d7880005 100644
--- a/cmd-line-utils/readline/readline.c
+++ b/cmd-line-utils/readline/readline.c
@@ -446,11 +446,10 @@ readline_internal_char ()
readline_internal_charloop ()
#endif
{
- static int lastc, eof_found;
+ static int lastc;
int c, code, lk;
lastc = -1;
- eof_found = 0;
#if !defined (READLINE_CALLBACKS)
while (rl_done == 0)
diff --git a/cmd-line-utils/readline/terminal.c b/cmd-line-utils/readline/terminal.c
index 3f92821f9dd..e2785908160 100644
--- a/cmd-line-utils/readline/terminal.c
+++ b/cmd-line-utils/readline/terminal.c
@@ -268,7 +268,7 @@ _rl_get_screen_size (tty, ignore_env)
#if !defined (__DJGPP__)
if (_rl_screenwidth <= 0 && term_string_buffer)
- _rl_screenwidth = tgetnum ("co");
+ _rl_screenwidth = tgetnum ((char *)"co");
#endif
}
@@ -284,7 +284,7 @@ _rl_get_screen_size (tty, ignore_env)
#if !defined (__DJGPP__)
if (_rl_screenheight <= 0 && term_string_buffer)
- _rl_screenheight = tgetnum ("li");
+ _rl_screenheight = tgetnum ((char *)"li");
#endif
}
@@ -516,7 +516,7 @@ _rl_init_terminal_io (terminal_name)
if (!_rl_term_cr)
_rl_term_cr = "\r";
- _rl_term_autowrap = tgetflag ("am") && tgetflag ("xn");
+ _rl_term_autowrap = tgetflag ((char *)"am") && tgetflag ((char *)"xn");
/* Allow calling application to set default height and width, using
rl_set_screen_size */
@@ -531,7 +531,7 @@ _rl_init_terminal_io (terminal_name)
/* Check to see if this terminal has a meta key and clear the capability
variables if there is none. */
- term_has_meta = (tgetflag ("km") || tgetflag ("MT"));
+ term_has_meta = (tgetflag ((char *)"km") || tgetflag ((char *)"MT"));
if (!term_has_meta)
_rl_term_mm = _rl_term_mo = (char *)NULL;
diff --git a/cmd-line-utils/readline/text.c b/cmd-line-utils/readline/text.c
index 774ba1eb2c0..75ffd0e482a 100644
--- a/cmd-line-utils/readline/text.c
+++ b/cmd-line-utils/readline/text.c
@@ -811,11 +811,10 @@ _rl_overwrite_char (count, c)
int i;
#if defined (HANDLE_MULTIBYTE)
char mbkey[MB_LEN_MAX];
- int k;
/* Read an entire multibyte character sequence to insert COUNT times. */
if (count > 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0)
- k = _rl_read_mbstring (c, mbkey, MB_LEN_MAX);
+ _rl_read_mbstring (c, mbkey, MB_LEN_MAX);
#endif
rl_begin_undo_group ();
diff --git a/config.h.cmake b/config.h.cmake
index e96b003fcff..6de3d997a55 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009 Sun Microsystems, Inc
+/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -125,6 +125,7 @@
#cmakedefine FIONREAD_IN_SYS_IOCTL 1
#cmakedefine GWINSZ_IN_SYS_IOCTL 1
#cmakedefine TIOCSTAT_IN_SYS_IOCTL 1
+#cmakedefine FIONREAD_IN_SYS_FILIO 1
/* Functions we may want to use. */
#cmakedefine HAVE_AIOWAIT 1
@@ -157,7 +158,6 @@
#cmakedefine HAVE_GETADDRINFO 1
#cmakedefine HAVE_GETCWD 1
#cmakedefine HAVE_GETHOSTBYADDR_R 1
-#cmakedefine HAVE_GETHOSTBYNAME_R 1
#cmakedefine HAVE_GETHRTIME 1
#cmakedefine HAVE_GETLINE 1
#cmakedefine HAVE_GETNAMEINFO 1
@@ -174,6 +174,10 @@
#cmakedefine gmtime_r @gmtime_r@
#cmakedefine HAVE_INITGROUPS 1
#cmakedefine HAVE_ISSETUGID 1
+#cmakedefine HAVE_GETUID 1
+#cmakedefine HAVE_GETEUID 1
+#cmakedefine HAVE_GETGID 1
+#cmakedefine HAVE_GETEGID 1
#cmakedefine HAVE_ISNAN 1
#cmakedefine HAVE_ISINF 1
#cmakedefine HAVE_LARGE_PAGE_OPTION 1
@@ -220,13 +224,13 @@
#cmakedefine HAVE_PTHREAD_KEY_DELETE 1
#cmakedefine HAVE_PTHREAD_KILL 1
#cmakedefine HAVE_PTHREAD_RWLOCK_RDLOCK 1
-#cmakedefine HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP 1
#cmakedefine HAVE_PTHREAD_SETPRIO_NP 1
#cmakedefine HAVE_PTHREAD_SETSCHEDPARAM 1
#cmakedefine HAVE_PTHREAD_SIGMASK 1
#cmakedefine HAVE_PTHREAD_THREADMASK 1
#cmakedefine HAVE_PTHREAD_YIELD_NP 1
#cmakedefine HAVE_PTHREAD_YIELD_ZERO_ARG 1
+#cmakedefine PTHREAD_ONCE_INITIALIZER @PTHREAD_ONCE_INITIALIZER@
#cmakedefine HAVE_PUTENV 1
#cmakedefine HAVE_RE_COMP 1
#cmakedefine HAVE_REGCOMP 1
@@ -407,7 +411,6 @@
#cmakedefine TARGET_OS_LINUX 1
-#cmakedefine TARGET_OS_SOLARIS 1
#cmakedefine HAVE_WCTYPE_H 1
#cmakedefine HAVE_WCHAR_H 1
@@ -449,8 +452,6 @@
#cmakedefine HAVE_SOLARIS_STYLE_GETHOST 1
-#cmakedefine HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE 1
-#cmakedefine HAVE_GETHOSTBYNAME_R_RETURN_INT 1
#cmakedefine MY_ATOMIC_MODE_DUMMY 1
#cmakedefine MY_ATOMIC_MODE_RWLOCKS 1
@@ -471,9 +472,6 @@
#cmakedefine STACK_DIRECTION @STACK_DIRECTION@
-#define THREAD 1
-#define THREAD_SAFE_CLIENT 1
-
#define SYSTEM_TYPE "@SYSTEM_TYPE@"
#define MACHINE_TYPE "@CMAKE_SYSTEM_PROCESSOR@"
#cmakedefine HAVE_DTRACE 1
@@ -517,10 +515,11 @@
#cmakedefine EXTRA_DEBUG 1
#cmakedefine BACKUP_TEST 1
#cmakedefine CYBOZU 1
+#cmakedefine USE_SYMDIR 1
/* Character sets and collations */
-#cmakedefine MYSQL_DEFAULT_CHARSET_NAME "latin1"
-#cmakedefine MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
+#cmakedefine MYSQL_DEFAULT_CHARSET_NAME "@MYSQL_DEFAULT_CHARSET_NAME@"
+#cmakedefine MYSQL_DEFAULT_COLLATION_NAME "@MYSQL_DEFAULT_COLLATION_NAME@"
#cmakedefine USE_MB 1
#cmakedefine USE_MB_IDENT 1
@@ -605,6 +604,11 @@
#cmakedefine PLUGINDIR "@PLUGINDIR@"
#cmakedefine DEFAULT_SYSCONFDIR "@DEFAULT_SYSCONFDIR@"
+#cmakedefine SO_EXT "@CMAKE_SHARED_MODULE_SUFFIX@"
+
+#define MYSQL_MAJOR_VERSION @MAJOR_VERSION@
+#define MYSQL_MINOR_VERSION @MINOR_VERSION@
+
#define PACKAGE "mysql"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME "MySQL Server"
@@ -615,4 +619,9 @@
#define PROTOCOL_VERSION 10
+/* time_t related defines */
+
+#cmakedefine SIZEOF_TIME_T @SIZEOF_TIME_T@
+#cmakedefine TIME_T_UNSIGNED @TIME_T_UNSIGNED@
+
#endif
diff --git a/config/ac-macros/alloca.m4 b/config/ac-macros/alloca.m4
deleted file mode 100644
index 8c730dd671f..00000000000
--- a/config/ac-macros/alloca.m4
+++ /dev/null
@@ -1,68 +0,0 @@
-AC_DEFUN([MYSQL_FUNC_ALLOCA],
-[
-# Since we have heard that alloca fails on IRIX never define it on a
-# SGI machine
-if test ! "$host_vendor" = "sgi"
-then
- AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally.
- # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
- # for constant arguments. Useless!
- AC_CACHE_CHECK([for working alloca.h], ac_cv_header_alloca_h,
- [AC_TRY_LINK([#include <alloca.h>], [char *p = alloca(2 * sizeof(int));],
- ac_cv_header_alloca_h=yes, ac_cv_header_alloca_h=no)])
- if test "$ac_cv_header_alloca_h" = "yes"
- then
- AC_DEFINE(HAVE_ALLOCA, 1)
- fi
-
- AC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works,
- [AC_TRY_LINK([
- #ifdef __GNUC__
- # define alloca __builtin_alloca
- #else
- # if HAVE_ALLOCA_H
- # include <alloca.h>
- # else
- # ifdef _AIX
- #pragma alloca
- # else
- # ifndef alloca /* predefined by HP cc +Olibcalls */
- char *alloca ();
- # endif
- # endif
- # endif
- #endif
- ], [char *p = (char *) alloca(1);],
- ac_cv_func_alloca_works=yes, ac_cv_func_alloca_works=no)])
- if test "$ac_cv_func_alloca_works" = "yes"; then
- AC_DEFINE([HAVE_ALLOCA], [1], [If we have a working alloca() implementation])
- fi
-
- if test "$ac_cv_func_alloca_works" = "no"; then
- # The SVR3 libPW and SVR4 libucb both contain incompatible functions
- # that cause trouble. Some versions do not even contain alloca or
- # contain a buggy version. If you still want to use their alloca,
- # use ar to extract alloca.o from them instead of compiling alloca.c.
- ALLOCA=alloca.o
- AC_DEFINE(C_ALLOCA, 1)
-
- AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray,
- [AC_EGREP_CPP(webecray,
- [#if defined(CRAY) && ! defined(CRAY2)
- webecray
- #else
- wenotbecray
- #endif
- ], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
- if test "$ac_cv_os_cray" = "yes"; then
- for ac_func in _getb67 GETB67 getb67; do
- AC_CHECK_FUNC($ac_func, [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func)
- break])
- done
- fi
- fi
- AC_SUBST(ALLOCA)dnl
-else
- AC_MSG_RESULT("Skipped alloca tests")
-fi
-])
diff --git a/config/ac-macros/character_sets.m4 b/config/ac-macros/character_sets.m4
deleted file mode 100644
index c49e4f89316..00000000000
--- a/config/ac-macros/character_sets.m4
+++ /dev/null
@@ -1,501 +0,0 @@
-dnl In order to add new charset, you must add charset name to
-dnl this CHARSETS_AVAILABLE list and sql/share/charsets/Index.xml.
-dnl If the character set uses strcoll or other special handling,
-dnl you must also create strings/ctype-$charset_name.c
-
-AC_DIVERT_PUSH(0)
-
-define(CHARSETS_AVAILABLE0,binary)
-define(CHARSETS_AVAILABLE1,armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257)
-define(CHARSETS_AVAILABLE2,cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8)
-define(CHARSETS_AVAILABLE3,greek hebrew hp8 keybcs2 koi8r koi8u)
-define(CHARSETS_AVAILABLE4,latin1 latin2 latin5 latin7 macce macroman)
-define(CHARSETS_AVAILABLE5,sjis swe7 tis620 ucs2 ujis utf8mb4 utf8 utf16 utf32)
-
-DEFAULT_CHARSET=latin1
-CHARSETS_AVAILABLE="CHARSETS_AVAILABLE0 CHARSETS_AVAILABLE1 CHARSETS_AVAILABLE2 CHARSETS_AVAILABLE3 CHARSETS_AVAILABLE4 CHARSETS_AVAILABLE5"
-CHARSETS_COMPLEX="big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8mb4 utf8 utf16 utf32"
-
-AC_DIVERT_POP
-
-AC_ARG_WITH(charset,
- [ --with-charset=CHARSET
- Default character set, use one of:
- CHARSETS_AVAILABLE0
- CHARSETS_AVAILABLE1
- CHARSETS_AVAILABLE2
- CHARSETS_AVAILABLE3
- CHARSETS_AVAILABLE4
- CHARSETS_AVAILABLE5],
- [default_charset="$withval"],
- [default_charset="$DEFAULT_CHARSET"])
-
-AC_ARG_WITH(collation,
- [ --with-collation=COLLATION
- Default collation],
- [default_collation="$withval"],
- [default_collation="default"])
-
-
-AC_ARG_WITH(extra-charsets,
- [ --with-extra-charsets=CHARSET[,CHARSET,...]
- Use charsets in addition to default (none, complex,
- all, or a list selected from the above sets)],
- [extra_charsets="$withval"],
- [extra_charsets="none"])
-
-
-AC_MSG_CHECKING("character sets")
-
-CHARSETS="$default_charset latin1 utf8mb4 utf8"
-
-if test "$extra_charsets" = no; then
- CHARSETS="$CHARSETS"
-elif test "$extra_charsets" = none; then
- CHARSETS="$CHARSETS"
-elif test "$extra_charsets" = complex; then
- CHARSETS="$CHARSETS $CHARSETS_COMPLEX"
- AC_DEFINE([DEFINE_ALL_CHARACTER_SETS],1,[all charsets are available])
-elif test "$extra_charsets" = all; then
- CHARSETS="$CHARSETS $CHARSETS_AVAILABLE"
- AC_DEFINE([DEFINE_ALL_CHARACTER_SETS],1,[all charsets are available])
-else
- EXTRA_CHARSETS=`echo $extra_charsets | sed -e 's/,/ /g'`
- CHARSETS="$CHARSETS $EXTRA_CHARSETS"
-fi
-
-for cs in $CHARSETS
-do
- case $cs in
- armscii8)
- AC_DEFINE(HAVE_CHARSET_armscii8, 1,
- [Define to enable charset armscii8])
- ;;
- ascii)
- AC_DEFINE(HAVE_CHARSET_ascii, 1,
- [Define to enable ascii character set])
- ;;
- big5)
- AC_DEFINE(HAVE_CHARSET_big5, 1, [Define to enable charset big5])
- AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
- AC_DEFINE(USE_MB_IDENT, [1], [ ])
- ;;
- binary)
- ;;
- cp1250)
- AC_DEFINE(HAVE_CHARSET_cp1250, 1, [Define to enable cp1250])
- ;;
- cp1251)
- AC_DEFINE(HAVE_CHARSET_cp1251, 1, [Define to enable charset cp1251])
- ;;
- cp1256)
- AC_DEFINE(HAVE_CHARSET_cp1256, 1, [Define to enable charset cp1256])
- ;;
- cp1257)
- AC_DEFINE(HAVE_CHARSET_cp1257, 1, [Define to enable charset cp1257])
- ;;
- cp850)
- AC_DEFINE(HAVE_CHARSET_cp850, 1, [Define to enable charset cp850])
- ;;
- cp852)
- AC_DEFINE(HAVE_CHARSET_cp852, 1, [Define to enable charset cp852])
- ;;
- cp866)
- AC_DEFINE(HAVE_CHARSET_cp866, 1, [Define to enable charset cp866])
- ;;
- cp932)
- AC_DEFINE(HAVE_CHARSET_cp932, 1, [Define to enable charset cp932])
- AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
- AC_DEFINE(USE_MB_IDENT, 1)
- ;;
- dec8)
- AC_DEFINE(HAVE_CHARSET_dec8, 1, [Define to enable charset dec8])
- ;;
- eucjpms)
- AC_DEFINE(HAVE_CHARSET_eucjpms, 1, [Define to enable charset eucjpms])
- AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
- AC_DEFINE(USE_MB_IDENT, 1)
- ;;
- euckr)
- AC_DEFINE(HAVE_CHARSET_euckr, 1, [Define to enable charset euckr])
- AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
- AC_DEFINE(USE_MB_IDENT, 1)
- ;;
- gb2312)
- AC_DEFINE(HAVE_CHARSET_gb2312, 1, [Define to enable charset gb2312])
- AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
- AC_DEFINE(USE_MB_IDENT, 1)
- ;;
- gbk)
- AC_DEFINE(HAVE_CHARSET_gbk, 1, [Define to enable charset gbk])
- AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
- AC_DEFINE(USE_MB_IDENT, 1)
- ;;
- geostd8)
- AC_DEFINE(HAVE_CHARSET_geostd8, 1, [Define to enable charset geostd8])
- ;;
- greek)
- AC_DEFINE(HAVE_CHARSET_greek, 1, [Define to enable charset greek])
- ;;
- hebrew)
- AC_DEFINE(HAVE_CHARSET_hebrew, 1, [Define to enable charset hebrew])
- ;;
- hp8)
- AC_DEFINE(HAVE_CHARSET_hp8, 1, [Define to enable charset hp8])
- ;;
- keybcs2)
- AC_DEFINE(HAVE_CHARSET_keybcs2, 1, [Define to enable charset keybcs2])
- ;;
- koi8r)
- AC_DEFINE(HAVE_CHARSET_koi8r, 1, [Define to enable charset koi8r])
- ;;
- koi8u)
- AC_DEFINE(HAVE_CHARSET_koi8u, 1, [Define to enable charset koi8u])
- ;;
- latin1)
- AC_DEFINE(HAVE_CHARSET_latin1, 1, [Define to enable charset latin1])
- ;;
- latin2)
- AC_DEFINE(HAVE_CHARSET_latin2, 1, [Define to enable charset latin2])
- ;;
- latin5)
- AC_DEFINE(HAVE_CHARSET_latin5, 1, [Define to enable charset latin5])
- ;;
- latin7)
- AC_DEFINE(HAVE_CHARSET_latin7, 1, [Define to enable charset latin7])
- ;;
- macce)
- AC_DEFINE(HAVE_CHARSET_macce, 1, [Define to enable charset macce])
- ;;
- macroman)
- AC_DEFINE(HAVE_CHARSET_macroman, 1,
- [Define to enable charset macroman])
- ;;
- sjis)
- AC_DEFINE(HAVE_CHARSET_sjis, 1, [Define to enable charset sjis])
- AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
- AC_DEFINE(USE_MB_IDENT, 1)
- ;;
- swe7)
- AC_DEFINE(HAVE_CHARSET_swe7, 1, [Define to enable charset swe7])
- ;;
- tis620)
- AC_DEFINE(HAVE_CHARSET_tis620, 1, [Define to enable charset tis620])
- ;;
- ucs2)
- AC_DEFINE(HAVE_CHARSET_ucs2, 1, [Define to enable charset ucs2])
- AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
- AC_DEFINE(USE_MB_IDENT, 1)
- ;;
- ujis)
- AC_DEFINE(HAVE_CHARSET_ujis, 1, [Define to enable charset ujis])
- AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
- AC_DEFINE(USE_MB_IDENT, 1)
- ;;
- utf8mb4)
- AC_DEFINE(HAVE_CHARSET_utf8mb4, 1, [Define to enable utf8mb4])
- AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
- AC_DEFINE(USE_MB_IDENT, 1)
- ;;
- utf8)
- AC_DEFINE(HAVE_CHARSET_utf8, 1, [Define to enable utf8])
- AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
- AC_DEFINE(USE_MB_IDENT, 1)
- ;;
- utf16)
- AC_DEFINE(HAVE_CHARSET_utf16, 1, [Define to enable utf16])
- AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
- AC_DEFINE(USE_MB_IDENT, 1)
- ;;
- utf32)
- AC_DEFINE(HAVE_CHARSET_utf32, 1, [Define to enable utf32])
- AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
- AC_DEFINE(USE_MB_IDENT, 1)
- ;;
- *)
- AC_MSG_ERROR([Charset '$cs' not available. (Available are: $CHARSETS_AVAILABLE).
- See the Installation chapter in the Reference Manual.])
- esac
-done
-
-
- default_charset_collations=""
-
-case $default_charset in
- armscii8)
- default_charset_default_collation="armscii8_general_ci"
- default_charset_collations="armscii8_general_ci armscii8_bin"
- ;;
- ascii)
- default_charset_default_collation="ascii_general_ci"
- default_charset_collations="ascii_general_ci ascii_bin"
- ;;
- big5)
- default_charset_default_collation="big5_chinese_ci"
- default_charset_collations="big5_chinese_ci big5_bin"
- ;;
- binary)
- default_charset_default_collation="binary"
- default_charset_collations="binary"
- ;;
- cp1250)
- default_charset_default_collation="cp1250_general_ci"
- default_charset_collations="cp1250_general_ci cp1250_czech_cs cp1250_bin"
- ;;
- cp1251)
- default_charset_default_collation="cp1251_general_ci"
- default_charset_collations="cp1251_general_ci cp1251_general_cs cp1251_bin cp1251_bulgarian_ci cp1251_ukrainian_ci"
- ;;
- cp1256)
- default_charset_default_collation="cp1256_general_ci"
- default_charset_collations="cp1256_general_ci cp1256_bin"
- ;;
- cp1257)
- default_charset_default_collation="cp1257_general_ci"
- default_charset_collations="cp1257_general_ci cp1257_lithuanian_ci cp1257_bin"
- ;;
- cp850)
- default_charset_default_collation="cp850_general_ci"
- default_charset_collations="cp850_general_ci cp850_bin"
- ;;
- cp852)
- default_charset_default_collation="cp852_general_ci"
- default_charset_collations="cp852_general_ci cp852_bin"
- ;;
- cp866)
- default_charset_default_collation="cp866_general_ci"
- default_charset_collations="cp866_general_ci cp866_bin"
- ;;
- cp932)
- default_charset_default_collation="cp932_japanese_ci"
- default_charset_collations="cp932_japanese_ci cp932_bin"
- ;;
- dec8)
- default_charset_default_collation="dec8_swedish_ci"
- default_charset_collations="dec8_swedish_ci dec8_bin"
- ;;
- eucjpms)
- default_charset_default_collation="eucjpms_japanese_ci"
- default_charset_collations="eucjpms_japanese_ci ujis_bin"
- ;;
- euckr)
- default_charset_default_collation="euckr_korean_ci"
- default_charset_collations="euckr_korean_ci euckr_bin"
- ;;
- gb2312)
- default_charset_default_collation="gb2312_chinese_ci"
- default_charset_collations="gb2312_chinese_ci gb2312_bin"
- ;;
- gbk)
- default_charset_default_collation="gbk_chinese_ci"
- default_charset_collations="gbk_chinese_ci gbk_bin"
- ;;
- geostd8)
- default_charset_default_collation="geostd8_general_ci"
- default_charset_collations="geostd8_general_ci geostd8_bin"
- ;;
- greek)
- default_charset_default_collation="greek_general_ci"
- default_charset_collations="greek_general_ci greek_bin"
- ;;
- hebrew)
- default_charset_default_collation="hebrew_general_ci"
- default_charset_collations="hebrew_general_ci hebrew_bin"
- ;;
- hp8)
- default_charset_default_collation="hp8_english_ci"
- default_charset_collations="hp8_english_ci hp8_bin"
- ;;
- keybcs2)
- default_charset_default_collation="keybcs2_general_ci"
- default_charset_collations="keybcs2_general_ci keybcs2_bin"
- ;;
- koi8r)
- default_charset_default_collation="koi8r_general_ci"
- default_charset_collations="koi8r_general_ci koi8r_bin"
- ;;
- koi8u)
- default_charset_default_collation="koi8u_general_ci"
- default_charset_collations="koi8u_general_ci koi8u_bin"
- ;;
- latin1)
- default_charset_default_collation="latin1_swedish_ci"
- default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_spanish_ci latin1_swedish_ci"
- ;;
- latin2)
- default_charset_default_collation="latin2_general_ci"
- default_charset_collations="latin2_general_ci latin2_bin latin2_czech_cs latin2_hungarian_ci latin2_croatian_ci"
- ;;
- latin5)
- default_charset_default_collation="latin5_turkish_ci"
- default_charset_collations="latin5_turkish_ci latin5_bin"
- ;;
- latin7)
- default_charset_default_collation="latin7_general_ci"
- default_charset_collations="latin7_general_ci latin7_general_cs latin7_bin latin7_estonian_cs"
- ;;
- macce)
- default_charset_default_collation="macce_general_ci"
- default_charset_collations="macce_general_ci macce_bin"
- ;;
- macroman)
- default_charset_default_collation="macroman_general_ci"
- default_charset_collations="macroman_general_ci macroman_bin"
- ;;
- sjis)
- default_charset_default_collation="sjis_japanese_ci"
- default_charset_collations="sjis_japanese_ci sjis_bin"
- ;;
- swe7)
- default_charset_default_collation="swe7_swedish_ci"
- default_charset_collations="swe7_swedish_ci swe7_bin"
- ;;
- tis620)
- default_charset_default_collation="tis620_thai_ci"
- default_charset_collations="tis620_thai_ci tis620_bin"
- ;;
- ucs2)
- default_charset_default_collation="ucs2_general_ci"
- define(UCSC1, ucs2_general_ci ucs2_bin)
- define(UCSC2, ucs2_czech_ci ucs2_danish_ci)
- define(UCSC3, ucs2_esperanto_ci ucs2_estonian_ci ucs2_hungarian_ci)
- define(UCSC4, ucs2_icelandic_ci ucs2_latvian_ci ucs2_lithuanian_ci)
- define(UCSC5, ucs2_persian_ci ucs2_polish_ci ucs2_romanian_ci)
- define(UCSC6, ucs2_slovak_ci ucs2_slovenian_ci)
- define(UCSC7, ucs2_spanish2_ci ucs2_spanish_ci)
- define(UCSC8, ucs2_swedish_ci ucs2_turkish_ci)
- define(UCSC9, ucs2_unicode_ci)
- UCSC="UCSC1 UCSC2 UCSC3 UCSC4 UCSC5 UCSC6 UCSC7 UCSC8 UCSC9"
- default_charset_collations="$UCSC"
- ;;
- ujis)
- default_charset_default_collation="ujis_japanese_ci"
- default_charset_collations="ujis_japanese_ci ujis_bin"
- ;;
- utf8)
- default_charset_default_collation="utf8_general_ci"
- if test "$default_collation" = "utf8_general_cs"; then
- # For those who explicitly desire "utf8_general_cs", support it,
- # and then also set the CPP switch enabling that code.
- UTFC="utf8_general_cs"
- AC_DEFINE([HAVE_UTF8_GENERAL_CS], [1], [certain Japanese customer])
- else
- define(UTFC1, utf8_general_ci utf8_bin)
- define(UTFC2, utf8_czech_ci utf8_danish_ci)
- define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_hungarian_ci)
- define(UTFC4, utf8_icelandic_ci utf8_latvian_ci utf8_lithuanian_ci)
- define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci)
- define(UTFC6, utf8_slovak_ci utf8_slovenian_ci)
- define(UTFC7, utf8_spanish2_ci utf8_spanish_ci)
- define(UTFC8, utf8_swedish_ci utf8_turkish_ci)
- define(UTFC9, utf8_unicode_ci)
- UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
- fi
- default_charset_collations="$UTFC"
- ;;
- utf8mb4)
- default_charset_default_collation="utf8mb4_general_ci"
- define(UTFC1, utf8mb4_general_ci utf8mb4_bin)
- define(UTFC2, utf8mb4_czech_ci utf8mb4_danish_ci)
- define(UTFC3, utf8mb4_esperanto_ci utf8mb4_estonian_ci utf8mb4_hungarian_ci)
- define(UTFC4, utf8mb4_icelandic_ci utf8mb4_latvian_ci utf8mb4_lithuanian_ci)
- define(UTFC5, utf8mb4_persian_ci utf8mb4_polish_ci utf8mb4_romanian_ci)
- define(UTFC6, utf8mb4_sinhala_ci utf8mb4_slovak_ci utf8mb4_slovenian_ci)
- define(UTFC7, utf8mb4_spanish2_ci utf8mb4_spanish_ci)
- define(UTFC8, utf8mb4_swedish_ci utf8mb4_turkish_ci)
- define(UTFC9, utf8mb4_unicode_ci)
- UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
- default_charset_collations="$UTFC"
- ;;
- utf16)
- default_charset_default_collation="utf16_general_ci"
- define(UTFC1, utf16_general_ci utf16_bin)
- define(UTFC2, utf16_czech_ci utf16_danish_ci)
- define(UTFC3, utf16_esperanto_ci utf16_estonian_ci utf16_hungarian_ci)
- define(UTFC4, utf16_icelandic_ci utf16_latvian_ci utf16_lithuanian_ci)
- define(UTFC5, utf16_persian_ci utf16_polish_ci utf16_romanian_ci)
- define(UTFC6, utf16_sinhala_ci utf16_slovak_ci utf16_slovenian_ci)
- define(UTFC7, utf16_spanish2_ci utf16_spanish_ci)
- define(UTFC8, utf16_swedish_ci utf16_turkish_ci)
- define(UTFC9, utf16_unicode_ci)
- UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
- default_charset_collations="$UTFC"
- ;;
- utf32)
- default_charset_default_collation="utf32_general_ci"
- define(UTFC1, utf32_general_ci utf32_bin)
- define(UTFC2, utf32_czech_ci utf32_danish_ci)
- define(UTFC3, utf32_esperanto_ci utf32_estonian_ci utf32_hungarian_ci)
- define(UTFC4, utf32_icelandic_ci utf32_latvian_ci utf32_lithuanian_ci)
- define(UTFC5, utf32_persian_ci utf32_polish_ci utf32_romanian_ci)
- define(UTFC6, utf32_sinhala_ci utf32_slovak_ci utf32_slovenian_ci)
- define(UTFC7, utf32_spanish2_ci utf32_spanish_ci)
- define(UTFC8, utf32_swedish_ci utf32_turkish_ci)
- define(UTFC9, utf32_unicode_ci)
- UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
- default_charset_collations="$UTFC"
- ;;
- *)
- AC_MSG_ERROR([Charset $cs not available. (Available are: $CHARSETS_AVAILABLE).
- See the Installation chapter in the Reference Manual.])
-esac
-
-if test "$default_collation" = default; then
- default_collation=$default_charset_default_collation
-fi
-
-valid_default_collation=no
-for cl in $default_charset_collations
-do
- if test x"$cl" = x"$default_collation"
- then
- valid_default_collation=yes
- break
- fi
-done
-
-if test x$valid_default_collation = xyes
-then
- AC_MSG_RESULT([default: $default_charset, collation: $default_collation; compiled in: $CHARSETS])
-else
- AC_MSG_ERROR([
- Collation $default_collation is not valid for character set $default_charset.
- Valid collations are: $default_charset_collations.
- See the Installation chapter in the Reference Manual.
- ])
-fi
-
-AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_CHARSET_NAME], ["$default_charset"],
- [Define the default charset name])
-AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_COLLATION_NAME], ["$default_collation"],
- [Define the default charset name])
-
-# Shall we build the UCA-based Unicode collations
-AC_ARG_WITH(uca,
- [ --without-uca Skip building of the national Unicode collations.],
- [with_uca=$withval],
- [with_uca=yes]
-)
-
-AC_MSG_CHECKING([whether to compile national Unicode collations])
-
-if test "$with_uca" = "yes"
-then
- AC_MSG_RESULT(yes)
- AC_DEFINE([HAVE_UCA_COLLATIONS], [1], [national Unicode collations])
-else
- AC_MSG_RESULT(no)
-fi
-
-
-# Shall we build experimental collations
-AC_ARG_WITH(experimental-collations,
- [],
- [with_exp_coll=$withval],
- [with_exp_coll=no]
-)
-
-if test "$with_exp_coll" = "yes"
-then
- AC_DEFINE([HAVE_UTF8_GENERAL_CS], [1], [certain Japanese customer])
-fi
diff --git a/config/ac-macros/check_cpu.m4 b/config/ac-macros/check_cpu.m4
deleted file mode 100644
index d551f47769e..00000000000
--- a/config/ac-macros/check_cpu.m4
+++ /dev/null
@@ -1,47 +0,0 @@
-AC_DEFUN([MYSQL_CHECK_CPU],
-[AC_CACHE_CHECK([if compiler supports optimizations for current cpu],
-mysql_cv_cpu,[
-
-ac_save_CFLAGS="$CFLAGS"
-if test -r /proc/cpuinfo ; then
- cpuinfo="cat /proc/cpuinfo"
- cpu_family=`$cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
- cpu_vendor=`$cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
-fi
-if test "$cpu_vendor" = "AuthenticAMD"; then
- if test $cpu_family -ge 6; then
- cpu_set="athlon pentiumpro k5 pentium i486 i386";
- elif test $cpu_family -eq 5; then
- cpu_set="k5 pentium i486 i386";
- elif test $cpu_family -eq 4; then
- cpu_set="i486 i386"
- else
- cpu_set="i386"
- fi
-elif test "$cpu_vendor" = "GenuineIntel"; then
- if test $cpu_family -ge 6; then
- cpu_set="pentiumpro pentium i486 i386";
- elif test $cpu_family -eq 5; then
- cpu_set="pentium i486 i386";
- elif test $cpu_family -eq 4; then
- cpu_set="i486 i386"
- else
- cpu_set="i386"
- fi
-fi
-
-for ac_arg in $cpu_set;
-do
- CFLAGS="$ac_save_CFLAGS -mcpu=$ac_arg -march=$ac_arg -DCPU=$ac_arg"
- AC_TRY_COMPILE([],[int i],mysql_cv_cpu=$ac_arg; break;, mysql_cv_cpu="unknown")
-done
-
-if test "$mysql_cv_cpu" = "unknown"
-then
- CFLAGS="$ac_save_CFLAGS"
- AC_MSG_RESULT(none)
-else
- AC_MSG_RESULT($mysql_cv_cpu)
-fi
-])])
-
diff --git a/config/ac-macros/compiler_flag.m4 b/config/ac-macros/compiler_flag.m4
deleted file mode 100644
index ce2ce6cbdfa..00000000000
--- a/config/ac-macros/compiler_flag.m4
+++ /dev/null
@@ -1,62 +0,0 @@
-# option, cache_name, variable,
-# code to execute if yes, code to exectute if fail
-AC_DEFUN([AC_SYS_COMPILER_FLAG],
-[
- AC_MSG_CHECKING($1)
- OLD_CFLAGS="[$]CFLAGS"
- AC_CACHE_VAL(mysql_cv_option_$2,
- [
- CFLAGS="[$]OLD_CFLAGS $1"
- 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"
-
- if test x"[$]mysql_cv_option_$2" = "xyes" ; then
- $3="[$]$3 $1"
- AC_MSG_RESULT(yes)
- $5
- else
- AC_MSG_RESULT(no)
- $4
- fi
-])
-
-# arch, option, cache_name, variable
-AC_DEFUN([AC_SYS_CPU_COMPILER_FLAG],
-[
- if test "`uname -m 2>/dev/null`" = "$1" ; then
- AC_SYS_COMPILER_FLAG($2,$3,$4)
- fi
-])
-
-# os, option, cache_name, variable
-AC_DEFUN([AC_SYS_OS_COMPILER_FLAG],
-[
- if test "x$mysql_cv_sys_os" = "x$1" ; then
- AC_SYS_COMPILER_FLAG($2,$3,$4)
- fi
-])
-
-AC_DEFUN([AC_CHECK_NOEXECSTACK],
-[
- AC_CACHE_CHECK(whether --noexecstack is desirable for .S files,
- mysql_cv_as_noexecstack, [dnl
- cat > conftest.c <<EOF
-void foo (void) { }
-EOF
- if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS
- -S -o conftest.s conftest.c 1>&AS_MESSAGE_LOG_FD]) \
- && grep .note.GNU-stack conftest.s >/dev/null \
- && AC_TRY_COMMAND([${CC-cc} $CCASFLAGS $CPPFLAGS -Wa,--noexecstack
- -c -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD])
- then
- mysql_cv_as_noexecstack=yes
- else
- mysql_cv_as_noexecstack=no
- fi
- rm -f conftest*])
- if test $mysql_cv_as_noexecstack = yes; then
- CCASFLAGS="$CCASFLAGS -Wa,--noexecstack"
- fi
-])
diff --git a/config/ac-macros/dtrace.m4 b/config/ac-macros/dtrace.m4
deleted file mode 100644
index a42d78d97fe..00000000000
--- a/config/ac-macros/dtrace.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-dnl ---------------------------------------------------------------------------
-dnl Macro: DTRACE_TEST
-dnl ---------------------------------------------------------------------------
-AC_ARG_ENABLE(dtrace,
- AC_HELP_STRING([--enable-dtrace],[Build with support for the DTRACE.]),
- [
- ENABLE_DTRACE="$enable_dtrace"
- ],
- [
- ENABLE_DTRACE="yes"
- ]
-)
-DTRACEFLAGS=""
-HAVE_DTRACE=""
-HAVE_DTRACE_DASH_G=""
-if test "$ENABLE_DTRACE" = "yes"; then
- AC_PATH_PROGS(DTRACE, dtrace, [not found], [$PATH:/usr/sbin])
- if test "$DTRACE" = "not found"; then
- ENABLE_DTRACE="no"
- else
- AC_DEFINE([HAVE_DTRACE], [1], [Defined to 1 if DTrace support is enabled])
- case "$target_os" in
- *solaris*)
- HAVE_DTRACE_DASH_G="yes"
- ;;
- *)
- HAVE_DTRACE_DASH_G="no"
- ;;
- esac
- fi
-fi
-AC_SUBST(DTRACEFLAGS)
-AC_SUBST(HAVE_DTRACE)
-AM_CONDITIONAL([HAVE_DTRACE], [ test "$ENABLE_DTRACE" = "yes" ])
-AM_CONDITIONAL([HAVE_DTRACE_DASH_G], [ test "$HAVE_DTRACE_DASH_G" = "yes" ])
-dnl ---------------------------------------------------------------------------
-dnl End Macro: DTRACE_TEST
-dnl ---------------------------------------------------------------------------
diff --git a/config/ac-macros/ha_ndbcluster.m4 b/config/ac-macros/ha_ndbcluster.m4
deleted file mode 100644
index 533dba09feb..00000000000
--- a/config/ac-macros/ha_ndbcluster.m4
+++ /dev/null
@@ -1,343 +0,0 @@
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_CHECK_NDBCLUSTER
-dnl ---------------------------------------------------------------------------
-
-NDB_VERSION_MAJOR=`echo $MYSQL_NUMERIC_VERSION | cut -d. -f1`
-NDB_VERSION_MINOR=`echo $MYSQL_NUMERIC_VERSION | cut -d. -f2`
-NDB_VERSION_BUILD=`echo $MYSQL_NUMERIC_VERSION | cut -d. -f3`
-NDB_VERSION_STATUS=`echo $VERSION | sed 's/^[[-.0-9]]*//'`
-TEST_NDBCLUSTER=""
-
-dnl for build ndb docs
-
-AC_PATH_PROG(DOXYGEN, doxygen, no)
-AC_PATH_PROG(PDFLATEX, pdflatex, no)
-AC_PATH_PROG(MAKEINDEX, makeindex, no)
-
-AC_SUBST(DOXYGEN)
-AC_SUBST(PDFLATEX)
-AC_SUBST(MAKEINDEX)
-
-
-AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
- AC_ARG_WITH([ndb-sci],
- AC_HELP_STRING([--with-ndb-sci=DIR],
- [Provide MySQL with a custom location of
- sci library. Given DIR, sci library is
- assumed to be in $DIR/lib and header files
- in $DIR/include.]),
- [mysql_sci_dir=${withval}],
- [mysql_sci_dir=""])
-
- case "$mysql_sci_dir" in
- "no" )
- have_ndb_sci=no
- AC_MSG_RESULT([-- not including sci transporter])
- ;;
- * )
- 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="$mysql_sci_dir/lib/libsisci.a"
- AC_MSG_RESULT([-- including sci transporter])
- AC_DEFINE([NDB_SCI_TRANSPORTER], [1],
- [Including Ndb Cluster DB sci transporter])
- AC_SUBST(NDB_SCI_INCLUDES)
- AC_SUBST(NDB_SCI_LIBS)
- have_ndb_sci="yes"
- AC_MSG_RESULT([found sci transporter in $mysql_sci_dir/{include, lib}])
- else
- AC_MSG_RESULT([could not find sci transporter in $mysql_sci_dir/{include, lib}])
- fi
- ;;
- esac
-
- AC_ARG_WITH([ndb-test],
- [
- --with-ndb-test Include the NDB Cluster ndbapi test programs],
- [ndb_test="$withval"],
- [ndb_test=no])
- AC_ARG_WITH([ndb-docs],
- [
- --with-ndb-docs Include the NDB Cluster ndbapi and mgmapi documentation],
- [ndb_docs="$withval"],
- [ndb_docs=no])
- AC_ARG_WITH([ndb-port],
- [
- --with-ndb-port Port for NDB Cluster management server],
- [ndb_port="$withval"],
- [ndb_port="default"])
- AC_ARG_WITH([ndb-port-base],
- [
- --with-ndb-port-base Base port for NDB Cluster transporters],
- [ndb_port_base="$withval"],
- [ndb_port_base="default"])
- AC_ARG_WITH([ndb-debug],
- [
- --without-ndb-debug Disable special ndb debug features],
- [ndb_debug="$withval"],
- [ndb_debug="default"])
- AC_ARG_WITH([ndb-ccflags],
- AC_HELP_STRING([--with-ndb-ccflags=CFLAGS],
- [Extra CFLAGS for ndb compile]),
- [ndb_ccflags=${withval}],
- [ndb_ccflags=""])
- AC_ARG_WITH([ndb-binlog],
- [
- --without-ndb-binlog Disable ndb binlog],
- [ndb_binlog="$withval"],
- [ndb_binlog="default"])
-
- case "$ndb_ccflags" in
- "yes")
- AC_MSG_RESULT([The --ndb-ccflags option requires a parameter (passed to CC for ndb compilation)])
- ;;
- *)
- ndb_cxxflags_fix="$ndb_cxxflags_fix $ndb_ccflags"
- ;;
- esac
-
- AC_MSG_CHECKING([for NDB Cluster options])
- AC_MSG_RESULT([])
-
- have_ndb_test=no
- case "$ndb_test" in
- yes )
- AC_MSG_RESULT([-- including ndbapi test programs])
- have_ndb_test="yes"
- ;;
- * )
- AC_MSG_RESULT([-- not including ndbapi test programs])
- ;;
- esac
-
- have_ndb_docs=no
- case "$ndb_docs" in
- yes )
- AC_MSG_RESULT([-- including ndbapi and mgmapi documentation])
- have_ndb_docs="yes"
- ;;
- * )
- AC_MSG_RESULT([-- not including ndbapi and mgmapi documentation])
- ;;
- esac
-
- case "$ndb_debug" in
- yes )
- AC_MSG_RESULT([-- including ndb extra debug options])
- have_ndb_debug="yes"
- ;;
- full )
- AC_MSG_RESULT([-- including ndb extra extra debug options])
- have_ndb_debug="full"
- ;;
- no )
- AC_MSG_RESULT([-- not including ndb extra debug options])
- have_ndb_debug="no"
- ;;
- * )
- have_ndb_debug="default"
- ;;
- esac
-
- AC_MSG_RESULT([done.])
-])
-
-AC_DEFUN([NDBCLUSTER_WORKAROUNDS], [
-
- #workaround for Sun Forte/x86 see BUG#4681
- case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc in
- *solaris*-i?86-no)
- CFLAGS="$CFLAGS -DBIG_TABLES"
- CXXFLAGS="$CXXFLAGS -DBIG_TABLES"
- ;;
- *)
- ;;
- esac
-
- # workaround for Sun Forte compile problem for ndb
- case $SYSTEM_TYPE-$ac_cv_prog_gcc in
- *solaris*-no)
- ndb_cxxflags_fix="$ndb_cxxflags_fix -instances=static"
- ;;
- *)
- ;;
- esac
-
- # ndb fail for whatever strange reason to link Sun Forte/x86
- # unless using incremental linker
- case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc-$have_ndbcluster in
- *solaris*-i?86-no-yes)
- CXXFLAGS="$CXXFLAGS -xildon"
- ;;
- *)
- ;;
- esac
-])
-
-AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
-
- AC_MSG_RESULT([Using NDB Cluster])
- with_partition="yes"
- ndb_cxxflags_fix=""
- TEST_NDBCLUSTER="--ndbcluster"
-
- ndbcluster_includes="-I\$(top_builddir)/storage/ndb/include -I\$(top_srcdir)/storage/ndb/include -I\$(top_srcdir)/storage/ndb/include/ndbapi -I\$(top_srcdir)/storage/ndb/include/mgmapi"
- ndbcluster_libs="\$(top_builddir)/storage/ndb/src/.libs/libndbclient.a"
- ndbcluster_system_libs=""
- ndb_mgmclient_libs="\$(top_builddir)/storage/ndb/src/mgmclient/libndbmgmclient.la"
-
- MYSQL_CHECK_NDB_OPTIONS
- NDBCLUSTER_WORKAROUNDS
-
- MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"
-
- if test "$have_ndb_debug" = "default"
- then
- have_ndb_debug=$with_debug
- fi
-
- if test "$have_ndb_debug" = "yes"
- then
- # Medium debug.
- NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
- elif test "$have_ndb_debug" = "full"
- then
- NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
- else
- # no extra ndb debug but still do asserts if debug version
- if test "$with_debug" = "yes"
- then
- NDB_DEFS=""
- else
- NDB_DEFS="-DNDEBUG"
- fi
- fi
-
- if test X"$ndb_port" = Xdefault
- then
- ndb_port="1186"
- fi
-
- have_ndb_binlog="no"
- if test X"$ndb_binlog" = Xdefault ||
- test X"$ndb_binlog" = Xyes
- then
- have_ndb_binlog="yes"
- fi
-
- if test X"$have_ndb_binlog" = Xyes
- then
- AC_DEFINE([WITH_NDB_BINLOG], [1],
- [Including Ndb Cluster Binlog])
- AC_MSG_RESULT([Including Ndb Cluster Binlog])
- else
- AC_MSG_RESULT([Not including Ndb Cluster Binlog])
- fi
-
- ndb_transporter_opt_objs=""
- if test "$ac_cv_func_shmget" = "yes" &&
- test "$ac_cv_func_shmat" = "yes" &&
- test "$ac_cv_func_shmdt" = "yes" &&
- test "$ac_cv_func_shmctl" = "yes" &&
- test "$ac_cv_func_sigaction" = "yes" &&
- test "$ac_cv_func_sigemptyset" = "yes" &&
- test "$ac_cv_func_sigaddset" = "yes" &&
- test "$ac_cv_func_pthread_sigmask" = "yes"
- then
- AC_DEFINE([NDB_SHM_TRANSPORTER], [1],
- [Including Ndb Cluster DB shared memory transporter])
- AC_MSG_RESULT([Including ndb shared memory transporter])
- ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo"
- else
- AC_MSG_RESULT([Not including ndb shared memory transporter])
- fi
-
- if test X"$have_ndb_sci" = Xyes
- then
- ndb_transporter_opt_objs="$ndb_transporter_opt_objs SCI_Transporter.lo"
- fi
-
- ndb_opt_subdirs=
- ndb_bin_am_ldflags="-static"
- if test X"$have_ndb_test" = Xyes
- then
- ndb_opt_subdirs="test"
- ndb_bin_am_ldflags=""
- fi
-
- if test X"$have_ndb_docs" = Xyes
- then
- ndb_opt_subdirs="$ndb_opt_subdirs docs"
- 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 GNU >/dev/null 2>&1 ; then
- NDB_LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/storage/ndb/src/libndb.ver"
- AC_CONFIG_FILES(storage/ndb/src/libndb.ver)
- fi
- AC_SUBST(NDB_LD_VERSION_SCRIPT)
-
- AC_SUBST(NDB_SHARED_LIB_MAJOR_VERSION)
- AC_SUBST(NDB_SHARED_LIB_VERSION)
-
-
- AC_SUBST(NDB_VERSION_MAJOR)
- AC_SUBST(NDB_VERSION_MINOR)
- AC_SUBST(NDB_VERSION_BUILD)
- AC_SUBST(NDB_VERSION_STATUS)
- AC_DEFINE_UNQUOTED([NDB_VERSION_MAJOR], [$NDB_VERSION_MAJOR],
- [NDB major version])
- AC_DEFINE_UNQUOTED([NDB_VERSION_MINOR], [$NDB_VERSION_MINOR],
- [NDB minor version])
- AC_DEFINE_UNQUOTED([NDB_VERSION_BUILD], [$NDB_VERSION_BUILD],
- [NDB build version])
- AC_DEFINE_UNQUOTED([NDB_VERSION_STATUS], ["$NDB_VERSION_STATUS"],
- [NDB status version])
-
- AC_SUBST(ndbcluster_includes)
- AC_SUBST(ndbcluster_libs)
- AC_SUBST(ndbcluster_system_libs)
- AC_SUBST(ndb_mgmclient_libs)
- AC_SUBST(NDB_SCI_LIBS)
-
- AC_SUBST(ndb_transporter_opt_objs)
- AC_SUBST(ndb_port)
- AC_SUBST(ndb_bin_am_ldflags)
- AC_SUBST(ndb_opt_subdirs)
-
- AC_SUBST(NDB_DEFS)
- AC_SUBST(ndb_cxxflags_fix)
-
- NDB_SIZEOF_CHARP="$ac_cv_sizeof_charp"
- NDB_SIZEOF_CHAR="$ac_cv_sizeof_char"
- NDB_SIZEOF_SHORT="$ac_cv_sizeof_short"
- NDB_SIZEOF_INT="$ac_cv_sizeof_int"
- NDB_SIZEOF_LONG="$ac_cv_sizeof_long"
- NDB_SIZEOF_LONG_LONG="$ac_cv_sizeof_long_long"
- AC_SUBST([NDB_SIZEOF_CHARP])
- AC_SUBST([NDB_SIZEOF_CHAR])
- AC_SUBST([NDB_SIZEOF_SHORT])
- AC_SUBST([NDB_SIZEOF_INT])
- AC_SUBST([NDB_SIZEOF_LONG])
- AC_SUBST([NDB_SIZEOF_LONG_LONG])
-
- AC_CONFIG_FILES([
- storage/ndb/include/ndb_version.h
- storage/ndb/include/ndb_global.h
- storage/ndb/include/ndb_types.h
- ])
-])
-
-AC_SUBST(TEST_NDBCLUSTER)
-dnl ---------------------------------------------------------------------------
-dnl END OF MYSQL_CHECK_NDBCLUSTER SECTION
-dnl ---------------------------------------------------------------------------
diff --git a/config/ac-macros/large_file.m4 b/config/ac-macros/large_file.m4
deleted file mode 100644
index 279ce6d60f1..00000000000
--- a/config/ac-macros/large_file.m4
+++ /dev/null
@@ -1,142 +0,0 @@
-
-dnl By default, many hosts won't let programs access large files;
-dnl one must use special compiler options to get large-file access to work.
-dnl For more details about this brain damage please see:
-dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
-
-dnl Written by Paul Eggert <eggert@twinsun.com>.
-
-dnl Internal subroutine of AC_SYS_LARGEFILE.
-dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
-AC_DEFUN([AC_SYS_LARGEFILE_FLAGS],
- [AC_CACHE_CHECK([for $1 value to request large file support],
- ac_cv_sys_largefile_$1,
- [if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2
- then
- ac_cv_sys_largefile_$1=`cat conftest.1`
- else
- ac_cv_sys_largefile_$1=no
- ifelse($1, CFLAGS,
- [case "$host_os" in
- # HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1.
-changequote(, )dnl
- hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
-changequote([, ])dnl
- if test "$GCC" = yes; then
- case `$CC --version 2>/dev/null` in
- 2.95.*) ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__ ;;
- esac
- fi
- ;;
- # IRIX 6.2 and later require cc -n32.
-changequote(, )dnl
- irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
-changequote([, ])dnl
- if test "$GCC" != yes; then
- ac_cv_sys_largefile_CFLAGS=-n32
- fi
- esac
- if test "$ac_cv_sys_largefile_CFLAGS" != no; then
- ac_save_CC="$CC"
- CC="$CC $ac_cv_sys_largefile_CFLAGS"
- AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
- CC="$ac_save_CC"
- fi])
- fi
- rm -f conftest*])])
-
-dnl Internal subroutine of AC_SYS_LARGEFILE.
-dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
-AC_DEFUN([AC_SYS_LARGEFILE_SPACE_APPEND],
- [case $2 in
- no) ;;
- ?*)
- case "[$]$1" in
- '') $1=$2 ;;
- *) $1=[$]$1' '$2 ;;
- esac ;;
- esac])
-
-dnl Internal subroutine of AC_SYS_LARGEFILE.
-dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
-AC_DEFUN([AC_SYS_LARGEFILE_MACRO_VALUE],
- [AC_CACHE_CHECK([for $1], $2,
- [$2=no
-changequote(, )dnl
- for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
- case "$ac_flag" in
- -D$1)
- $2=1 ;;
- -D$1=*)
- $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
- esac
- done
- $4
-changequote([, ])dnl
- ])
- if test "[$]$2" != no; then
- AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
- fi])
-
-AC_DEFUN([MYSQL_SYS_LARGEFILE],
- [AC_REQUIRE([AC_CANONICAL_HOST])
- AC_ARG_ENABLE(largefile,
- [ --disable-largefile Omit support for large files])
- if test "$enable_largefile" != no; then
- AC_CHECK_TOOL(GETCONF, getconf)
- AC_SYS_LARGEFILE_FLAGS(CFLAGS)
- AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
- AC_SYS_LARGEFILE_FLAGS(LIBS)
-
- for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
- case "$ac_flag" in
- no) ;;
- -D_FILE_OFFSET_BITS=*) ;;
- -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
- -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
- -D?* | -I?*)
- AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
- *)
- AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
- esac
- done
- AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS")
- AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS")
-
- AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
- ac_cv_sys_file_offset_bits,
- [Number of bits in a file offset, on hosts where this is settable.],
- [case "$host_os" in
- # HP-UX 10.20 and later
- hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
- ac_cv_sys_file_offset_bits=64 ;;
- # We can't declare _FILE_OFFSET_BITS here as this will cause
- # compile errors as AC_PROG_CC adds include files in confdefs.h
- # We solve this (until autoconf is fixed) by instead declaring it
- # as define instead
- solaris2.[8,9])
- CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
- CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64"
- ac_cv_sys_file_offset_bits=no ;;
- esac])
- AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
- ac_cv_sys_largefile_source,
- [makes fseeko etc. visible, on some hosts.],
- [case "$host_os" in
- # HP-UX 10.20 and later
- 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
- # Large file support on AIX is available starting from version 4.2
- # Tested only on 5.2 and up
- aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
- ac_cv_sys_large_files=1 ;;
- esac])
- fi
- ])
-
diff --git a/config/ac-macros/libevent.m4 b/config/ac-macros/libevent.m4
deleted file mode 100644
index 90ac89cc74c..00000000000
--- a/config/ac-macros/libevent.m4
+++ /dev/null
@@ -1,95 +0,0 @@
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_USE_BUNDLED_LIBEVENT
-dnl
-dnl SYNOPSIS
-dnl MYSQL_USE_BUNDLED_LIBEVENT()
-dnl
-dnl DESCRIPTION
-dnl Add defines so libevent is built and linked with
-dnl ---------------------------------------------------------------------------
-AC_DEFUN([MYSQL_USE_BUNDLED_LIBEVENT], [
-
- libevent_dir="libevent"
- AC_SUBST([libevent_dir])
-
- libevent_libs="\$(top_builddir)/extra/libevent/libevent.a"
- libevent_includes="-I\$(top_srcdir)/extra/libevent"
-
- dnl Get the upstream file with the original libevent configure macros.
- dnl Use builtin include for this, to work around path problems in old versions of aclocal.
- builtin([include],[config/ac-macros/libevent_configure.m4])
-])
-
-
-dnl ------------------------------------------------------------------------
-dnl Macro: MYSQL_CHECK_LIBEVENT
-dnl
-dnl SYNOPSIS
-dnl MYSQL_CHECK_LIBEVENT
-dnl
-dnl ------------------------------------------------------------------------
-AC_DEFUN([MYSQL_CHECK_LIBEVENT], [
-
- AC_CONFIG_FILES(extra/libevent/Makefile)
-
- AC_MSG_NOTICE([checking what libevent library to use])
-
- AC_ARG_WITH([libevent],
- AC_HELP_STRING([--with-libevent=yes|no|bundled|DIR],
- [Use libevent and have connection pooling.
- A location of libevent library can be specified.
- Given DIR, libevent library is
- assumed to be in $DIR/lib and header files
- in $DIR/include.]),
- [with_libevent=${withval}],
- [with_libevent=no])
-
- case "$with_libevent" in
- "no")
- with_libevent=disabled
- ;;
- "bundled")
- MYSQL_USE_BUNDLED_LIBEVENT
- ;;
- "" | "yes")
- libevent_includes=""
- libevent_libs="-levent"
- AC_CHECK_LIB(event, evutil_socketpair,[with_libevent=system],
- [with_libevent=bundled])
- AC_CHECK_HEADER(evutil.h,,[with_libevent=bundled])
- if test "$with_libevent" = "bundled"; then
- MYSQL_USE_BUNDLED_LIBEVENT
- fi
- ;;
- *)
- # Test for libevent using all known library file endings
- if test \( -f "$with_libevent/lib/libevent.a" -o \
- -f "$with_libevent/lib/libevent.so" -o \
- -f "$with_libevent/lib/libevent.sl" -o \
- -f "$with_libevent/lib/libevent.dylib" \) \
- -a -f "$with_libevent/include/evutil.h"; then
- libevent_includes="-I$with_libevent/include"
- libevent_libs="-L$with_libevent/lib -levent"
- AC_CHECK_LIB(event, evutil_socketpair,[with_libevent=$with_libevent],
- [with_libevent=no], [$libevent_libs])
- else
- with_libevent=no
- fi
- if test "$with_libevent" = "no"; then
- AC_MSG_ERROR([libevent headers or binaries were not found])
- fi
- ;;
- esac
- AC_MSG_CHECKING(for libevent)
- AC_MSG_RESULT([$with_libevent])
-
- if test "$with_libevent" != "disabled"; then
- libevent_test_option="--mysqld=--thread-handling=pool-of-threads"
- AC_SUBST(libevent_libs)
- AC_SUBST(libevent_includes)
- AC_SUBST(libevent_test_option)
- dnl AC_DEFINE([HAVE_LIBEVENT], [1], [If we want to use libevent and have connection pooling])
- fi
- AM_CONDITIONAL([HAVE_LIBEVENT], [ test "$with_libevent" != "disabled" ])
-])
-
diff --git a/config/ac-macros/libevent_configure.m4 b/config/ac-macros/libevent_configure.m4
deleted file mode 100644
index ed6de3dcf95..00000000000
--- a/config/ac-macros/libevent_configure.m4
+++ /dev/null
@@ -1,324 +0,0 @@
-dnl Checks for libraries.
-AC_CHECK_LIB(socket, socket)
-AC_CHECK_LIB(resolv, inet_aton)
-AC_CHECK_LIB(rt, clock_gettime)
-AC_CHECK_LIB(nsl, inet_ntoa)
-
-dnl Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h stdarg.h inttypes.h stdint.h poll.h signal.h unistd.h sys/epoll.h sys/time.h sys/queue.h sys/event.h sys/param.h sys/ioctl.h sys/select.h sys/devpoll.h port.h netinet/in6.h sys/socket.h)
-if test "x$ac_cv_header_sys_queue_h" = "xyes"; then
- AC_MSG_CHECKING(for TAILQ_FOREACH in sys/queue.h)
- AC_EGREP_CPP(yes,
-[
-#include <sys/queue.h>
-#ifdef TAILQ_FOREACH
- yes
-#endif
-], [AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_TAILQFOREACH, 1,
- [Define if TAILQ_FOREACH is defined in <sys/queue.h>])],
- [AC_MSG_RESULT(no)]
- )
-fi
-
-if test "x$ac_cv_header_sys_time_h" = "xyes"; then
- AC_MSG_CHECKING(for timeradd in sys/time.h)
- AC_EGREP_CPP(yes,
-[
-#include <sys/time.h>
-#ifdef timeradd
- yes
-#endif
-], [ AC_DEFINE(HAVE_TIMERADD, 1,
- [Define if timeradd is defined in <sys/time.h>])
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)]
-)
-fi
-
-if test "x$ac_cv_header_sys_time_h" = "xyes"; then
- AC_MSG_CHECKING(for timercmp in sys/time.h)
- AC_EGREP_CPP(yes,
-[
-#include <sys/time.h>
-#ifdef timercmp
- yes
-#endif
-], [ AC_DEFINE(HAVE_TIMERCMP, 1,
- [Define if timercmp is defined in <sys/time.h>])
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)]
-)
-fi
-
-if test "x$ac_cv_header_sys_time_h" = "xyes"; then
- AC_MSG_CHECKING(for timerclear in sys/time.h)
- AC_EGREP_CPP(yes,
-[
-#include <sys/time.h>
-#ifdef timerclear
- yes
-#endif
-], [ AC_DEFINE(HAVE_TIMERCLEAR, 1,
- [Define if timerclear is defined in <sys/time.h>])
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)]
-)
-fi
-
-if test "x$ac_cv_header_sys_time_h" = "xyes"; then
- AC_MSG_CHECKING(for timerisset in sys/time.h)
- AC_EGREP_CPP(yes,
-[
-#include <sys/time.h>
-#ifdef timerisset
- yes
-#endif
-], [ AC_DEFINE(HAVE_TIMERISSET, 1,
- [Define if timerisset is defined in <sys/time.h>])
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)]
-)
-fi
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_C_INLINE
-AC_HEADER_TIME
-
-dnl Checks for library functions.
-AC_CHECK_FUNCS(gettimeofday vasprintf fcntl clock_gettime strtok_r strsep getaddrinfo getnameinfo strlcpy inet_ntop signal sigaction strtoll)
-
-AC_CHECK_SIZEOF(long)
-
-if test "x$ac_cv_func_clock_gettime" = "xyes"; then
- AC_DEFINE(DNS_USE_CPU_CLOCK_FOR_ID, 1, [Define if clock_gettime is available in libc])
-else
- AC_DEFINE(DNS_USE_GETTIMEOFDAY_FOR_ID, 1, [Define is no secure id variant is available])
-fi
-
-AC_MSG_CHECKING(for F_SETFD in fcntl.h)
-AC_EGREP_CPP(yes,
-[
-#define _GNU_SOURCE
-#include <fcntl.h>
-#ifdef F_SETFD
-yes
-#endif
-], [ AC_DEFINE(HAVE_SETFD, 1,
- [Define if F_SETFD is defined in <fcntl.h>])
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)]
- )
-
-needsignal=no
-haveselect=no
-AC_CHECK_FUNCS(select, [haveselect=yes])
-if test "x$haveselect" = "xyes" ; then
- AC_LIBOBJ(select)
- needsignal=yes
-fi
-
-havepoll=no
-AC_CHECK_FUNCS(poll, [havepoll=yes])
-if test "x$havepoll" = "xyes" ; then
- AC_LIBOBJ(poll)
- needsignal=yes
-fi
-
-haveepoll=no
-AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes])
-if test "x$haveepoll" = "xyes" ; then
- AC_DEFINE(HAVE_EPOLL, 1,
- [Define if your system supports the epoll system calls])
- AC_LIBOBJ(epoll)
- needsignal=yes
-fi
-
-havedevpoll=no
-if test "x$ac_cv_header_sys_devpoll_h" = "xyes"; then
- AC_DEFINE(HAVE_DEVPOLL, 1,
- [Define if /dev/poll is available])
- AC_LIBOBJ(devpoll)
-fi
-
-havekqueue=no
-if test "x$ac_cv_header_sys_event_h" = "xyes"; then
- AC_CHECK_FUNCS(kqueue, [havekqueue=yes])
- if test "x$havekqueue" = "xyes" ; then
- AC_MSG_CHECKING(for working kqueue)
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/event.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
- ]],
- [[
- int kq;
- int n;
- int fd[2];
- struct kevent ev;
- struct timespec ts;
- char buf[8000];
-
- if (pipe(fd) == -1)
- exit(1);
- if (fcntl(fd[1], F_SETFL, O_NONBLOCK) == -1)
- exit(1);
-
- while ((n = write(fd[1], buf, sizeof(buf))) == sizeof(buf))
- ;
-
- if ((kq = kqueue()) == -1)
- exit(1);
-
- ev.ident = fd[1];
- ev.filter = EVFILT_WRITE;
- ev.flags = EV_ADD | EV_ENABLE;
- n = kevent(kq, &ev, 1, NULL, 0, NULL);
- if (n == -1)
- exit(1);
-
- read(fd[0], buf, sizeof(buf));
-
- ts.tv_sec = 0;
- ts.tv_nsec = 0;
- n = kevent(kq, NULL, 0, &ev, 1, &ts);
- if (n == -1 || n == 0)
- exit(1);
-
- exit(0);
- ]]
- )],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_WORKING_KQUEUE, 1,
- [Define if kqueue works correctly with pipes])
- AC_LIBOBJ(kqueue)],
- [AC_MSG_RESULT(no)],
- [AC_MSG_RESULT(no)]
- )
- fi
-fi
-
-haveepollsyscall=no
-if test "x$ac_cv_header_sys_epoll_h" = "xyes"; then
- if test "x$haveepoll" = "xno" ; then
- AC_MSG_CHECKING(for epoll system call)
- AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#include <stdint.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <sys/epoll.h>
-#include <unistd.h>
-
-int
-epoll_create(int size)
-{
- return (syscall(__NR_epoll_create, size));
-}
- ]],
- [[
- int epfd;
-
- epfd = epoll_create(256);
- exit (epfd == -1 ? 1 : 0);
- ]]
- )],
- [AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_EPOLL, 1,
- [Define if your system supports the epoll system calls])
- needsignal=yes
- AC_LIBOBJ(epoll_sub)
- AC_LIBOBJ(epoll)],
- [AC_MSG_RESULT(no)],
- [AC_MSG_RESULT(no)]
- )
- fi
-fi
-
-haveeventports=no
-AC_CHECK_FUNCS(port_create, [haveeventports=yes])
-if test "x$haveeventports" = "xyes" ; then
- AC_DEFINE(HAVE_EVENT_PORTS, 1,
- [Define if your system supports event ports])
- AC_LIBOBJ(evport)
- needsignal=yes
-fi
-if test "x$bwin32" = "xtrue"; then
- needsignal=yes
-fi
-if test "x$bwin32" = "xtrue"; then
- needsignal=yes
-fi
-if test "x$needsignal" = "xyes" ; then
- AC_LIBOBJ(signal)
-fi
-
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-AC_CHECK_TYPES([uint64_t, uint32_t, uint16_t, uint8_t],[],[],
-[[#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#elif defined(HAVE_INTTYPES_H)
-#include <inttypes.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif]])
-AC_CHECK_SIZEOF(long long)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(short)
-AC_CHECK_TYPES([struct in6_addr],[],[],
-[[#ifdef WIN32
-#include <winsock2.h>
-#else
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETINET_IN6_H
-#include <netinet/in6.h>
-#endif]])
-
-AC_MSG_CHECKING([for socklen_t])
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
- #include <sys/types.h>
- #include <sys/socket.h>
- ]],
- [[
- socklen_t x;
- ]]
- )],
- [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- AC_DEFINE(socklen_t, unsigned int,
- [Define to unsigned int if you dont have it])]
-)
-
-AC_MSG_CHECKING([whether our compiler supports __func__])
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([],[[const char *cp = __func__;]])],
- [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([],[[const char *cp = __FUNCTION__;]])],
- [AC_MSG_RESULT([yes])
- AC_DEFINE(__func__, __FUNCTION__,
- [Define to appropriate substitue if compiler doesnt have __func__])],
- [AC_MSG_RESULT([no])
- AC_DEFINE(__func__, __FILE__,
- [Define to appropriate substitue if compiler doesnt have __func__])]
- )]
-)
diff --git a/config/ac-macros/maintainer.m4 b/config/ac-macros/maintainer.m4
deleted file mode 100644
index 24be31395f2..00000000000
--- a/config/ac-macros/maintainer.m4
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# Control aspects of the development environment which are
-# specific to MySQL maintainers and developers.
-#
-AC_DEFUN([MY_MAINTAINER_MODE], [
- AC_MSG_CHECKING([whether to enable the maintainer-specific development environment])
- AC_ARG_ENABLE([mysql-maintainer-mode],
- [AS_HELP_STRING([--enable-mysql-maintainer-mode],
- [Enable a MySQL maintainer-specific development environment])],
- [USE_MYSQL_MAINTAINER_MODE=$enableval],
- [USE_MYSQL_MAINTAINER_MODE=no])
- AC_MSG_RESULT([$USE_MYSQL_MAINTAINER_MODE])
-])
-
-# Set warning options required under maintainer mode.
-AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [
- # Setup GCC warning options.
- AS_IF([test "$GCC" = "yes"], [
- C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror"
- CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter"
- ])
-
- # Test whether the warning options work.
- # Test C options
- AS_IF([test -n "$C_WARNINGS"], [
- save_CFLAGS="$CFLAGS"
- AC_MSG_CHECKING([whether to use C warning options ${C_WARNINGS}])
- AC_LANG_PUSH(C)
- CFLAGS="$CFLAGS ${C_WARNINGS}"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_c_warning_flags=yes],
- [myac_c_warning_flags=no])
- AC_LANG_POP()
- AC_MSG_RESULT([$myac_c_warning_flags])
- CFLAGS="$save_CFLAGS"
- ])
-
- # Test C++ options
- AS_IF([test -n "$CXX_WARNINGS"], [
- save_CXXFLAGS="$CXXFLAGS"
- AC_MSG_CHECKING([whether to use C++ warning options ${CXX_WARNINGS}])
- AC_LANG_PUSH(C++)
- CXXFLAGS="$CXXFLAGS ${CXX_WARNINGS}"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_cxx_warning_flags=yes],
- [myac_cxx_warning_flags=no])
- AC_LANG_POP()
- AC_MSG_RESULT([$myac_cxx_warning_flags])
- CXXFLAGS="$save_CXXFLAGS"
- ])
-
- # Set compile flag variables.
- AS_IF([test "$myac_c_warning_flags" = "yes"], [
- AM_CFLAGS="${AM_CFLAGS} ${C_WARNINGS}"
- AC_SUBST([AM_CFLAGS])])
- AS_IF([test "$myac_cxx_warning_flags" = "yes"], [
- AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS}"
- AC_SUBST([AM_CXXFLAGS])])
-])
-
-
-# Set compiler flags required under maintainer mode.
-AC_DEFUN([MY_MAINTAINER_MODE_SETUP], [
- AS_IF([test "$USE_MYSQL_MAINTAINER_MODE" = "yes"],
- [MY_MAINTAINER_MODE_WARNINGS])
-])
diff --git a/config/ac-macros/misc.m4 b/config/ac-macros/misc.m4
deleted file mode 100644
index 89de1e5f8fa..00000000000
--- a/config/ac-macros/misc.m4
+++ /dev/null
@@ -1,688 +0,0 @@
-# Local macros for automake & autoconf
-
-#---START: Used in for client configure
-AC_DEFUN([MYSQL_TYPE_ACCEPT],
-[ac_save_CXXFLAGS="$CXXFLAGS"
-AC_CACHE_CHECK([base type of last arg to accept], mysql_cv_btype_last_arg_accept,
-AC_LANG_PUSH(C++)
-if test "$ac_cv_prog_gxx" = "yes"
-then
- # Add -Werror, remove -fbranch-probabilities (Bug #268)
- CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
-fi
-mysql_cv_btype_last_arg_accept=none
-[AC_TRY_COMPILE([#if defined(inline)
-#undef inline
-#endif
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-],
-[int a = accept(1, (struct sockaddr *) 0, (socklen_t *) 0); return (a != 0);],
-mysql_cv_btype_last_arg_accept=socklen_t)]
-if test "$mysql_cv_btype_last_arg_accept" = "none"; then
-[AC_TRY_COMPILE([#if defined(inline)
-#undef inline
-#endif
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-],
-[int a = accept(1, (struct sockaddr *) 0, (size_t *) 0); return (a != 0);],
-mysql_cv_btype_last_arg_accept=size_t)]
-fi
-if test "$mysql_cv_btype_last_arg_accept" = "none"; then
-mysql_cv_btype_last_arg_accept=int
-fi)
-AC_LANG_POP(C++)
-AC_DEFINE_UNQUOTED([SOCKET_SIZE_TYPE], [$mysql_cv_btype_last_arg_accept],
- [The base type of the last arg to accept])
-CXXFLAGS="$ac_save_CXXFLAGS"
-])
-#---END:
-
-dnl Find type of qsort
-AC_DEFUN([MYSQL_TYPE_QSORT],
-[AC_CACHE_CHECK([return type of qsort], mysql_cv_type_qsort,
-[AC_TRY_COMPILE([#include <stdlib.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-void qsort(void *base, size_t nel, size_t width,
- int (*compar) (const void *, const void *));
-],
-[int i;], mysql_cv_type_qsort=void, mysql_cv_type_qsort=int)])
-AC_DEFINE_UNQUOTED([RETQSORTTYPE], [$mysql_cv_type_qsort],
- [The return type of qsort (int or void).])
-if test "$mysql_cv_type_qsort" = "void"
-then
- AC_DEFINE_UNQUOTED([QSORT_TYPE_IS_VOID], [1], [qsort returns void])
-fi
-])
-
-#---START: Figure out whether to use 'struct rlimit' or 'struct rlimit64'
-AC_DEFUN([MYSQL_TYPE_STRUCT_RLIMIT],
-[ac_save_CXXFLAGS="$CXXFLAGS"
-AC_CACHE_CHECK([struct type to use with setrlimit], mysql_cv_btype_struct_rlimit,
-AC_LANG_PUSH(C++)
-if test "$ac_cv_prog_gxx" = "yes"
-then
- # Add -Werror, remove -fbranch-probabilities (Bug #268)
- CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
-fi
-mysql_cv_btype_struct_rlimit=none
-[AC_TRY_COMPILE([#if defined(inline)
-#undef inline
-#endif
-#include <stdlib.h>
-#include <sys/resource.h>
-],
-[struct rlimit64 rl; setrlimit(RLIMIT_CORE, &rl);],
-mysql_cv_btype_struct_rlimit="struct rlimit64")]
-if test "$mysql_cv_btype_struct_rlimit" = "none"; then
-mysql_cv_btype_struct_rlimit="struct rlimit"
-fi)
-AC_LANG_POP(C++)
-AC_DEFINE_UNQUOTED([STRUCT_RLIMIT], [$mysql_cv_btype_struct_rlimit],
- [The struct rlimit type to use with setrlimit])
-CXXFLAGS="$ac_save_CXXFLAGS"
-])
-#---END:
-
-AC_DEFUN([MYSQL_TIMESPEC_TS],
-[AC_CACHE_CHECK([if struct timespec has a ts_sec member], mysql_cv_timespec_ts,
-[AC_TRY_COMPILE([#include <pthread.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-],
-[struct timespec abstime;
-
-abstime.ts_sec = time(NULL)+1;
-abstime.ts_nsec = 0;
-], mysql_cv_timespec_ts=yes, mysql_cv_timespec_ts=no)])
-if test "$mysql_cv_timespec_ts" = "yes"
-then
- AC_DEFINE([HAVE_TIMESPEC_TS_SEC], [1],
- [Timespec has a ts_sec instead of tv_sev])
-fi
-])
-
-AC_DEFUN([MYSQL_TZNAME],
-[AC_CACHE_CHECK([if we have tzname variable], mysql_cv_tzname,
-[AC_TRY_COMPILE([#include <time.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-],
-[ tzset();
- return tzname[0] != 0;
-], mysql_cv_tzname=yes, mysql_cv_tzname=no)])
-if test "$mysql_cv_tzname" = "yes"
-then
- AC_DEFINE([HAVE_TZNAME], [1], [Have the tzname variable])
-fi
-])
-
-
-AC_DEFUN([MYSQL_PTHREAD_YIELD],
-[AC_CACHE_CHECK([if pthread_yield takes zero arguments], ac_cv_pthread_yield_zero_arg,
-[AC_TRY_LINK([#define _GNU_SOURCE
-#include <pthread.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-],
-[
- pthread_yield();
-], ac_cv_pthread_yield_zero_arg=yes, ac_cv_pthread_yield_zero_arg=yeso)])
-if test "$ac_cv_pthread_yield_zero_arg" = "yes"
-then
- AC_DEFINE([HAVE_PTHREAD_YIELD_ZERO_ARG], [1],
- [pthread_yield that doesn't take any arguments])
-fi
-]
-[AC_CACHE_CHECK([if pthread_yield takes 1 argument], ac_cv_pthread_yield_one_arg,
-[AC_TRY_LINK([#define _GNU_SOURCE
-#include <pthread.h>
-#ifdef __cplusplus
-extern "C"
-#endif
-],
-[
- pthread_yield(0);
-], ac_cv_pthread_yield_one_arg=yes, ac_cv_pthread_yield_one_arg=no)])
-if test "$ac_cv_pthread_yield_one_arg" = "yes"
-then
- AC_DEFINE([HAVE_PTHREAD_YIELD_ONE_ARG], [1],
- [pthread_yield function with one argument])
-fi
-]
-)
-
-
-
-#---END:
-
-# From fileutils-3.14/aclocal.m4
-
-# @defmac AC_PROG_CC_STDC
-# @maindex PROG_CC_STDC
-# @ovindex CC
-# If the C compiler in not in ANSI C mode by default, try to add an option
-# to output variable @code{CC} to make it so. This macro tries various
-# options that select ANSI C on some system or another. It considers the
-# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
-# handles function prototypes correctly.
-#
-# Patched by monty to only check if __STDC__ is defined. With the original
-# check it's impossible to get things to work with the Sunpro compiler from
-# Workshop 4.2
-#
-# If you use this macro, you should check after calling it whether the C
-# compiler has been set to accept ANSI C; if not, the shell variable
-# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
-# code in ANSI C, you can make an un-ANSIfied copy of it by using the
-# program @code{ansi2knr}, which comes with Ghostscript.
-# @end defmac
-
-AC_DEFUN([AM_PROG_CC_STDC],
-[AC_REQUIRE([AC_PROG_CC])
-AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
-AC_CACHE_VAL(am_cv_prog_cc_stdc,
-[am_cv_prog_cc_stdc=no
-ac_save_CC="$CC"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-# removed "-Xc -D__EXTENSIONS__" beacause sun c++ does not like it.
-for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE"
-do
- CC="$ac_save_CC $ac_arg"
- AC_TRY_COMPILE(
-[#if !defined(__STDC__)
-choke me
-#endif
-/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/stat.h>
-#endif
-], [
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};],
-[am_cv_prog_cc_stdc="$ac_arg"; break])
-done
-CC="$ac_save_CC"
-])
-AC_MSG_RESULT($am_cv_prog_cc_stdc)
-case "x$am_cv_prog_cc_stdc" in
- x|xno) ;;
- *) CC="$CC $am_cv_prog_cc_stdc" ;;
-esac
-])
-
-# Orginal from bash-2.0 aclocal.m4, Changed to use termcap last by monty.
-
-AC_DEFUN([MYSQL_CHECK_LIB_TERMCAP],
-[
-AC_CACHE_VAL(mysql_cv_termcap_lib,
- [AC_CHECK_LIB(ncursesw, tgetent, mysql_cv_termcap_lib=libncursesw,
- [AC_CHECK_LIB(ncurses, tgetent, mysql_cv_termcap_lib=libncurses,
- [AC_CHECK_LIB(curses, tgetent, mysql_cv_termcap_lib=libcurses,
- [AC_CHECK_LIB(termcap, tgetent, mysql_cv_termcap_lib=libtermcap,
- [AC_CHECK_LIB(tinfo, tgetent, mysql_cv_termcap_lib=libtinfo,
- mysql_cv_termcap_lib=NOT_FOUND)])])])])])
-AC_MSG_CHECKING(for termcap functions library)
-if test "$mysql_cv_termcap_lib" = "NOT_FOUND"; then
-AC_MSG_ERROR([No curses/termcap library found])
-elif test "$mysql_cv_termcap_lib" = "libtermcap"; then
-TERMCAP_LIB=-ltermcap
-elif test "$mysql_cv_termcap_lib" = "libncursesw"; then
-TERMCAP_LIB=-lncursesw
-elif test "$mysql_cv_termcap_lib" = "libncurses"; then
-TERMCAP_LIB=-lncurses
-elif test "$mysql_cv_termcap_lib" = "libtinfo"; then
-TERMCAP_LIB=-ltinfo
-else
-TERMCAP_LIB=-lcurses
-fi
-AC_MSG_RESULT($TERMCAP_LIB)
-])
-
-dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
-AC_DEFUN([MYSQL_SIGNAL_CHECK],
-[AC_REQUIRE([AC_TYPE_SIGNAL])
-AC_MSG_CHECKING(for type of signal functions)
-AC_CACHE_VAL(mysql_cv_signal_vintage,
-[
- AC_TRY_LINK([#include <signal.h>],[
- sigset_t ss;
- struct sigaction sa;
- sigemptyset(&ss); sigsuspend(&ss);
- sigaction(SIGINT, &sa, (struct sigaction *) 0);
- sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
- ], mysql_cv_signal_vintage=posix,
- [
- AC_TRY_LINK([#include <signal.h>], [
- int mask = sigmask(SIGINT);
- sigsetmask(mask); sigblock(mask); sigpause(mask);
- ], mysql_cv_signal_vintage=4.2bsd,
- [
- AC_TRY_LINK([
- #include <signal.h>
- RETSIGTYPE foo() { }], [
- int mask = sigmask(SIGINT);
- sigset(SIGINT, foo); sigrelse(SIGINT);
- sighold(SIGINT); sigpause(SIGINT);
- ], mysql_cv_signal_vintage=svr3, mysql_cv_signal_vintage=v7
- )]
- )]
-)
-])
-AC_MSG_RESULT($mysql_cv_signal_vintage)
-if test "$mysql_cv_signal_vintage" = posix; then
-AC_DEFINE(HAVE_POSIX_SIGNALS, [1],
- [Signal handling is POSIX (sigset/sighold, etc)])
-elif test "$mysql_cv_signal_vintage" = "4.2bsd"; then
-AC_DEFINE([HAVE_BSD_SIGNALS], [1], [BSD style signals])
-elif test "$mysql_cv_signal_vintage" = svr3; then
-AC_DEFINE(HAVE_USG_SIGHOLD, [1], [sighold() is present and usable])
-fi
-])
-
-AC_DEFUN([MYSQL_CHECK_GETPW_FUNCS],
-[AC_MSG_CHECKING(whether programs are able to redeclare getpw functions)
-AC_CACHE_VAL(mysql_cv_can_redecl_getpw,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <pwd.h>
-extern struct passwd *getpwent();], [struct passwd *z; z = getpwent();],
- mysql_cv_can_redecl_getpw=yes,mysql_cv_can_redecl_getpw=no)])
-AC_MSG_RESULT($mysql_cv_can_redecl_getpw)
-if test "$mysql_cv_can_redecl_getpw" = "no"; then
-AC_DEFINE(HAVE_GETPW_DECLS, [1], [getpwent() declaration present])
-fi
-])
-
-AC_DEFUN([MYSQL_HAVE_TIOCGWINSZ],
-[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h)
-AC_CACHE_VAL(mysql_cv_tiocgwinsz_in_ioctl,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/ioctl.h>], [int x = TIOCGWINSZ;],
- mysql_cv_tiocgwinsz_in_ioctl=yes,mysql_cv_tiocgwinsz_in_ioctl=no)])
-AC_MSG_RESULT($mysql_cv_tiocgwinsz_in_ioctl)
-if test "$mysql_cv_tiocgwinsz_in_ioctl" = "yes"; then
-AC_DEFINE([GWINSZ_IN_SYS_IOCTL], [1],
- [READLINE: your system defines TIOCGWINSZ in sys/ioctl.h.])
-fi
-])
-
-AC_DEFUN([MYSQL_HAVE_FIONREAD],
-[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h)
-AC_CACHE_VAL(mysql_cv_fionread_in_ioctl,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/ioctl.h>], [int x = FIONREAD;],
- mysql_cv_fionread_in_ioctl=yes,mysql_cv_fionread_in_ioctl=no)])
-AC_MSG_RESULT($mysql_cv_fionread_in_ioctl)
-if test "$mysql_cv_fionread_in_ioctl" = "yes"; then
-AC_DEFINE([FIONREAD_IN_SYS_IOCTL], [1], [Do we have FIONREAD])
-fi
-])
-
-AC_DEFUN([MYSQL_HAVE_TIOCSTAT],
-[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h)
-AC_CACHE_VAL(mysql_cv_tiocstat_in_ioctl,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/ioctl.h>], [int x = TIOCSTAT;],
- mysql_cv_tiocstat_in_ioctl=yes,mysql_cv_tiocstat_in_ioctl=no)])
-AC_MSG_RESULT($mysql_cv_tiocstat_in_ioctl)
-if test "$mysql_cv_tiocstat_in_ioctl" = "yes"; then
-AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL, [1],
- [declaration of TIOCSTAT in sys/ioctl.h])
-fi
-])
-
-AC_DEFUN([MYSQL_STRUCT_DIRENT_D_INO],
-[AC_REQUIRE([AC_HEADER_DIRENT])
-AC_MSG_CHECKING(if struct dirent has a d_ino member)
-AC_CACHE_VAL(mysql_cv_dirent_has_dino,
-[AC_TRY_COMPILE([
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-#if defined(HAVE_DIRENT_H)
-# include <dirent.h>
-#else
-# define dirent direct
-# ifdef HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif /* SYSNDIR */
-# ifdef HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif /* SYSDIR */
-# ifdef HAVE_NDIR_H
-# include <ndir.h>
-# endif
-#endif /* HAVE_DIRENT_H */
-],[
-struct dirent d; int z; z = d.d_ino;
-], mysql_cv_dirent_has_dino=yes, mysql_cv_dirent_has_dino=no)])
-AC_MSG_RESULT($mysql_cv_dirent_has_dino)
-if test "$mysql_cv_dirent_has_dino" = "yes"; then
-AC_DEFINE(STRUCT_DIRENT_HAS_D_INO, [1],
- [d_ino member present in struct dirent])
-fi
-])
-
-AC_DEFUN([MYSQL_STRUCT_DIRENT_D_NAMLEN],
-[AC_REQUIRE([AC_HEADER_DIRENT])
-AC_MSG_CHECKING(if struct dirent has a d_namlen member)
-AC_CACHE_VAL(mysql_cv_dirent_has_dnamlen,
-[AC_TRY_COMPILE([
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-#if defined(HAVE_DIRENT_H)
-# include <dirent.h>
-#else
-# define dirent direct
-# ifdef HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif /* SYSNDIR */
-# ifdef HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif /* SYSDIR */
-# ifdef HAVE_NDIR_H
-# include <ndir.h>
-# endif
-#endif /* HAVE_DIRENT_H */
-],[
-struct dirent d; int z; z = (int)d.d_namlen;
-], mysql_cv_dirent_has_dnamlen=yes, mysql_cv_dirent_has_dnamlen=no)])
-AC_MSG_RESULT($mysql_cv_dirent_has_dnamlen)
-if test "$mysql_cv_dirent_has_dnamlen" = "yes"; then
-AC_DEFINE(STRUCT_DIRENT_HAS_D_NAMLEN, [1],
- [d_namlen member present in struct dirent])
-fi
-])
-
-
-AC_DEFUN([MYSQL_TYPE_SIGHANDLER],
-[AC_MSG_CHECKING([whether signal handlers are of type void])
-AC_CACHE_VAL(mysql_cv_void_sighandler,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-#ifdef __cplusplus
-extern "C"
-#endif
-void (*signal ()) ();],
-[int i;], mysql_cv_void_sighandler=yes, mysql_cv_void_sighandler=no)])dnl
-AC_MSG_RESULT($mysql_cv_void_sighandler)
-if test "$mysql_cv_void_sighandler" = "yes"; then
-AC_DEFINE(VOID_SIGHANDLER, [1], [sighandler type is void (*signal ()) ();])
-fi
-])
-
-AC_DEFUN([MYSQL_CXX_BOOL],
-[
-AC_REQUIRE([AC_PROG_CXX])
-AC_MSG_CHECKING(if ${CXX} supports bool types)
-AC_CACHE_VAL(mysql_cv_have_bool,
-[
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-AC_TRY_COMPILE(,[bool b = true;],
-mysql_cv_have_bool=yes,
-mysql_cv_have_bool=no)
-AC_LANG_RESTORE
-])
-AC_MSG_RESULT($mysql_cv_have_bool)
-if test "$mysql_cv_have_bool" = yes; then
-AC_DEFINE([HAVE_BOOL], [1], [bool is not defined by all C++ compilators])
-fi
-])dnl
-
-AC_DEFUN([MYSQL_STACK_DIRECTION],
- [AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
- [AC_TRY_RUN([#include <stdlib.h>
- /* Prevent compiler optimization by HP's compiler, see bug#42213 */
-#if defined(__HP_cc) || defined (__HP_aCC) || defined (__hpux)
-#pragma noinline
-#endif
- int find_stack_direction ()
- {
- static char *addr = 0;
- auto char dummy;
- if (addr == 0)
- {
- addr = &dummy;
- return find_stack_direction ();
- }
- else
- return (&dummy > addr) ? 1 : -1;
- }
- int main ()
- {
- exit (find_stack_direction() < 0);
- }], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
- ac_cv_c_stack_direction=)])
- AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
-])dnl
-
-AC_DEFUN([MYSQL_CHECK_LONGLONG_TO_FLOAT],
-[
-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;
-int main()
-{
- longlong ll=1;
- float f;
- FILE *file=fopen("conftestval", "w");
- f = (float) ll;
- fprintf(file,"%g\n",f);
- fclose(file);
- 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
-else
- ac_cv_conv_longlong_to_float=no
-fi
-AC_MSG_RESULT($ac_cv_conv_longlong_to_float)
-])
-
-AC_DEFUN([MYSQL_CHECK_VIO], [
-dnl
-dnl we always use vio: no need for special defines
-dnl
- AC_DEFINE([HAVE_VIO_READ_BUFF], [1],
- [Define to enable buffered read. This works only if syscalls
- read/recv return as soon as there is some data in the kernel
- buffer, no matter how big the given buffer is.])
-])
-
-# Local version of _AC_PROG_CXX_EXIT_DECLARATION that does not
-# include #stdlib.h as default as this breaks things on Solaris
-# (Conflicts with pthreads and big file handling)
-
-m4_define([_AC_PROG_CXX_EXIT_DECLARATION],
-[for ac_declaration in \
- ''\
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);' \
- '#include <stdlib.h>'
-do
- _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration
-@%:@include <stdlib.h>],
- [exit (42);])],
- [],
- [continue])
- _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration],
- [exit (42);])],
- [break])
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-])# _AC_PROG_CXX_EXIT_DECLARATION
-
-dnl ---------------------------------------------------------------------------
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_CHECK_BIG_TABLES
-dnl Sets BIG_TABLES if --with-big-tables is used
-dnl ---------------------------------------------------------------------------
-AC_DEFUN([MYSQL_CHECK_BIG_TABLES], [
- AC_ARG_WITH([big-tables],
- AS_HELP_STRING([--with-big-tables],
- [Support tables with more than 4 G rows even on 32 bit platforms]),
- [bigtables="$withval"],
- [bigtables=no])
- AC_MSG_CHECKING([for big tables support])
-
- case "$bigtables" in
- yes )
- AC_DEFINE([BIG_TABLES], [1], [Support big tables])
- AC_MSG_RESULT([yes])
- ;;
- * )
- AC_MSG_RESULT([no])
- ;;
- esac
-
-])
-dnl ---------------------------------------------------------------------------
-dnl END OF MYSQL_CHECK_BIG_TABLES SECTION
-dnl ---------------------------------------------------------------------------
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_CHECK_MAX_INDEXES
-dnl Sets MAX_INDEXES
-dnl ---------------------------------------------------------------------------
-AC_DEFUN([MYSQL_CHECK_MAX_INDEXES], [
- AC_ARG_WITH([max-indexes],
- AS_HELP_STRING([--with-max-indexes=N],
- [Sets the maximum number of indexes per table, default 64]),
- [max_indexes="$withval"],
- [max_indexes=64])
- AC_MSG_CHECKING([max indexes per table])
- AC_DEFINE_UNQUOTED([MAX_INDEXES], [$max_indexes],
- [Maximum number of indexes per table])
- AC_MSG_RESULT([$max_indexes])
-])
-dnl ---------------------------------------------------------------------------
-dnl END OF MYSQL_CHECK_MAX_INDEXES SECTION
-dnl ---------------------------------------------------------------------------
-
-
-dnl MYSQL_NEEDS_MYSYS_NEW
-AC_DEFUN([MYSQL_NEEDS_MYSYS_NEW],
-[AC_CACHE_CHECK([needs mysys_new helpers], mysql_cv_use_mysys_new,
-[
-AC_LANG_PUSH(C++)
-AC_TRY_LINK([], [
-class A { public: int b; }; A *a=new A; a->b=10; delete a;
-], mysql_cv_use_mysys_new=no, mysql_cv_use_mysys_new=yes)
-AC_LANG_POP(C++)
-])
-if test "$mysql_cv_use_mysys_new" = "yes"
-then
- AC_DEFINE([USE_MYSYS_NEW], [1], [Needs to use mysys_new helpers])
-fi
-])
-
-
-AC_DEFUN([MYSQL_CHECK_CXX_VERSION], [
-CXX_VERSION=`$CXX --version | sed 1q`
-if test $? -ne "0" -o -z "$CXX_VERSION"
-then
- CXX_VERSION=`$CXX -V 2>&1|sed 1q` # trying harder for Sun and SGI
-fi
-if test $? -ne "0" -o -z "$CXX_VERSION"
-then
- CXX_VERSION=`$CXX -v 2>&1|sed 1q` # even harder for Alpha
-fi
-if test $? -ne "0" -o -z "$CXX_VERSION"
-then
- CXX_VERSION=""
-fi
-if test "$CXX_VERSION"
-then
- AC_MSG_CHECKING("C++ compiler version")
- AC_MSG_RESULT("$CXX $CXX_VERSION")
-fi
-AC_SUBST(CXX_VERSION)
-])
-
-AC_DEFUN([MYSQL_PROG_AR], [
-case $CXX_VERSION in
- MIPSpro*)
- AR=$CXX
- ARFLAGS="-ar -o"
- ;;
- *Forte*)
- AR=$CXX
- ARFLAGS="-xar -o"
- ;;
- *)
- 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
- if test -z "$ARFLAGS"
- then
- ARFLAGS="cru"
- fi
-esac
-AC_SUBST(AR)
-AC_SUBST(ARFLAGS)
-])
-
-dnl
-dnl Macro to check time_t range: according to C standard
-dnl array index must be greater than 0 => if time_t is signed,
-dnl the code in the macros below won't compile.
-dnl
-
-AC_DEFUN([MYSQL_CHECK_TIME_T],[
- AC_MSG_CHECKING(if time_t is unsigned)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
- [[
-#include <time.h>
- ]],
- [[
- int array[(((time_t)-1) > 0) ? 1 : -1];
- ]] )
- ], [
- AC_DEFINE([TIME_T_UNSIGNED], 1, [Define to 1 if time_t is unsigned])
- AC_MSG_RESULT(yes)
- ],
- [AC_MSG_RESULT(no)]
- )
-])
-
diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4
deleted file mode 100644
index c191c2e0b15..00000000000
--- a/config/ac-macros/plugins.m4
+++ /dev/null
@@ -1,902 +0,0 @@
-dnl ===========================================================================
-dnl Support for mysql server plugins
-dnl ===========================================================================
-dnl
-dnl WorkLog#3201
-dnl
-dnl Framework for pluggable static and dynamic plugins for mysql
-dnl
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_PLUGIN
-dnl
-dnl SYNOPSIS
-dnl MYSQL_PLUGIN([name],[Plugin name],
-dnl [Plugin description],
-dnl [group,group...])
-dnl
-dnl DESCRIPTION
-dnl First declaration for a plugin (mandatory).
-dnl Adds plugin as member to configuration groups (if specified)
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_PLUGIN],[
- _MYSQL_PLUGIN(
- [$1],
- [__MYSQL_PLUGIN_]AS_TR_CPP([$1])[__],
- m4_default([$2], [$1 plugin]),
- m4_default([$3], [plugin for $1]),
- m4_default([[$4]], []),
- )
-])
-
-AC_DEFUN([_MYSQL_PLUGIN],[
- m4_ifdef([$2], [
- AC_FATAL([Duplicate MYSQL_PLUGIN declaration for $3])
- ],[
- m4_define([$2], [$1])
- _MYSQL_PLUGAPPEND([__mysql_plugin_list__],[$1])
- m4_define([MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]), [$3])
- m4_define([MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]), [$4])
- m4_ifdef([_AC_ENABLE_IF], [_AC_ENABLE_IF([with],[plugin-$1])])
- _MYSQL_PLUGAPPEND_META([$1], $5)
- ifelse(m4_bregexp(__mysql_include__,[/plug\.in$]),-1,[],[
- MYSQL_PLUGIN_DIRECTORY([$1],
- m4_bregexp(__mysql_include__,[^\(.*\)/plug\.in$],[\1]))
- ])
- ])
-])
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_STORAGE_ENGINE
-dnl
-dnl SYNOPSIS
-dnl MYSQL_STORAGE_ENGINE([name],[legacy-option],[Storage engine name],
-dnl [Storage engine description],[group,group...])
-dnl
-dnl DESCRIPTION
-dnl Short cut for storage engine declarations
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_STORAGE_ENGINE],[
- MYSQL_PLUGIN([$1], [$3], [$4], [$5])
- MYSQL_PLUGIN_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE])
- ifelse([$2],[no],[],[
- _MYSQL_LEGACY_STORAGE_ENGINE(
- m4_bpatsubst([$1], -, _),
- m4_bpatsubst(m4_default([$2], [$1-storage-engine]), -, _))
- ])
-])
-
-AC_DEFUN([_MYSQL_LEGACY_STORAGE_ENGINE],[
-if test "[${with_]$2[+set}]" = set; then
- [with_plugin_]$1="[$with_]$2"
-fi
-])
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_PLUGIN_DEFINE
-dnl
-dnl SYNOPSIS
-dnl MYSQL_PLUGIN_DEFINE([name],[MYSQL_CPP_DEFINE])
-dnl
-dnl DESCRIPTION
-dnl When a plugin is to be statically linked, define the C macro
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_PLUGIN_DEFINE],[
- MYSQL_REQUIRE_PLUGIN([$1])
- m4_define([MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]), [$2])
-])
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_PLUGIN_DIRECTORY
-dnl
-dnl SYNOPSIS
-dnl MYSQL_PLUGIN_DIRECTORY([name],[plugin/dir])
-dnl
-dnl DESCRIPTION
-dnl Adds a directory to the build process
-dnl if it contains 'configure' it will be picked up automatically
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_PLUGIN_DIRECTORY],[
- MYSQL_REQUIRE_PLUGIN([$1])
- m4_define([MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]), [$2])
-])
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_PLUGIN_STATIC
-dnl
-dnl SYNOPSIS
-dnl MYSQL_PLUGIN_STATIC([name],[libmyplugin.a])
-dnl
-dnl DESCRIPTION
-dnl Declare the name for the static library
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_PLUGIN_STATIC],[
- MYSQL_REQUIRE_PLUGIN([$1])
- m4_define([MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]), [$2])
-])
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_PLUGIN_DYNAMIC
-dnl
-dnl SYNOPSIS
-dnl MYSQL_PLUGIN_DYNAMIC([name],[myplugin.la])
-dnl
-dnl DESCRIPTION
-dnl Declare the name for the shared library
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_PLUGIN_DYNAMIC],[
- MYSQL_REQUIRE_PLUGIN([$1])
- m4_define([MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]), [$2])
-])
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_PLUGIN_MANDATORY
-dnl
-dnl SYNOPSIS
-dnl MYSQL_PLUGIN_MANDATORY([name])
-dnl
-dnl DESCRIPTION
-dnl Marks the specified plugin as a mandatory plugin
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_PLUGIN_MANDATORY],[
- MYSQL_REQUIRE_PLUGIN([$1])
- _MYSQL_PLUGIN_MANDATORY([$1],
- [MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1])
- )
-])
-
-AC_DEFUN([_MYSQL_PLUGIN_MANDATORY],[
- m4_define([$2], [yes])
- m4_ifdef([$3], [
- AC_FATAL([mandatory plugin $1 has been disabled])
- m4_undefine([$2])
- ])
-])
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_PLUGIN_DISABLED
-dnl
-dnl SYNOPSIS
-dnl MYSQL_PLUGIN_DISABLED([name])
-dnl
-dnl DESCRIPTION
-dnl Marks the specified plugin as a disabled plugin
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_PLUGIN_DISABLED],[
- MYSQL_REQUIRE_PLUGIN([$1])
- _MYSQL_PLUGIN_DISABLED([$1],
- [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1])
- )
-])
-
-AC_DEFUN([_MYSQL_PLUGIN_DISABLED],[
- m4_define([$2], [yes])
- m4_ifdef([$3], [
- AC_FATAL([attempt to disable mandatory plugin $1])
- m4_undefine([$2])
- ])
-])
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_PLUGIN_WITHOUT
-dnl
-dnl SYNOPSIS
-dnl MYSQL_PLUGIN_WITHOUT([name])
-dnl
-dnl DESCRIPTION
-dnl Exclude the plugin from being built, as if --without-plugin-name
-dnl was specified.
-dnl If the plugin was selected manually by --with-plugin-name,
-dnl excluding it here will abort the configure script with an error,
-dnl otherwise plugin will be silently disabled.
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_PLUGIN_WITHOUT],[
- MYSQL_REQUIRE_PLUGIN([$1])
- if test "X[$with_plugin_]$1" = Xyes; then
- AC_MSG_ERROR([Plugin $1 cannot be built])
- else
- [with_plugin_]$1=no
- fi
-])
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_PLUGIN_DEPENDS
-dnl
-dnl SYNOPSIS
-dnl MYSQL_PLUGIN_DEPENDS([name],[prereq,prereq...])
-dnl
-dnl DESCRIPTION
-dnl Enables other plugins neccessary for the named plugin
-dnl Dependency checking is not recursive so if any
-dnl required plugin requires further plugins, list them
-dnl here too!
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_PLUGIN_DEPENDS],[
- MYSQL_REQUIRE_PLUGIN([$1])
- ifelse($#, 2, [
- _MYSQL_PLUGIN_DEPEND([$1], $2)
- ], [
- AC_FATAL([bad number of arguments])
- ])
-])
-
-AC_DEFUN([_MYSQL_PLUGIN_DEPEND],[
- ifelse($#, 1, [], [$#:$2], [2:], [], [
- MYSQL_REQUIRE_PLUGIN([$2])
- _MYSQL_PLUGAPPEND([__mysql_plugdepends_$1__],[$2])
- _MYSQL_PLUGIN_DEPEND([$1], m4_shift(m4_shift($@)))
- ])
-])
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_PLUGIN_ACTIONS
-dnl
-dnl SYNOPSIS
-dnl MYSQL_PLUGIN_ACTIONS([name],[PLUGIN_CONFIGURE_STUFF])
-dnl
-dnl DESCRIPTION
-dnl Declares additional autoconf actions required to configure the plugin
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_PLUGIN_ACTIONS],[
- MYSQL_REQUIRE_PLUGIN([$1])
- m4_ifdef([$2],[
- m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),m4_defn([$2]))
- ],[
- m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), [$2])
- ])
-])
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS
-dnl
-dnl SYNOPSIS
-dnl MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS([name],[file name])
-dnl
-dnl DESCRIPTION
-dnl Some modules in plugins keep dependance on structures
-dnl declared in sql/ (THD class usually)
-dnl That has to be fixed in the future, but until then
-dnl we have to recompile these modules when we want to
-dnl to compile server parts with the different #defines
-dnl Normally it happens when we compile the embedded server
-dnl Thus one should mark such files in his handler using this macro
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS],[
- MYSQL_REQUIRE_PLUGIN([$1])
- m4_define([MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS_]AS_TR_CPP([$1]), [$2])
-])
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_CONFIGURE_PLUGINS
-dnl
-dnl SYNOPSIS
-dnl MYSQL_CONFIGURE_PLUGINS([name,name...])
-dnl
-dnl DESCRIPTION
-dnl Used last, emits all required shell code to configure the plugins
-dnl Argument is a list of default plugins or meta-plugin
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[
- m4_ifdef([__mysql_plugin_configured__],[
- AC_FATAL([cannot use [MYSQL_CONFIGURE_PLUGINS] multiple times])
- ],[
- m4_define([__mysql_plugin_configured__],[done])
- _MYSQL_INCLUDE_LIST(
- m4_bpatsubst(m4_esyscmd([ls plugin/*/plug.in storage/*/plug.in 2>/dev/null]),
-[[
-]],[,]))
- m4_ifdef([__mysql_plugin_list__],[
- _MYSQL_CHECK_PLUGIN_ARGS([$1])
- _MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
- _MYSQL_EMIT_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
- AC_SUBST([mysql_se_dirs])
- AC_SUBST([mysql_se_distdirs])
- AC_SUBST([mysql_pg_dirs])
- AC_SUBST([mysql_pg_distdirs])
- AC_SUBST([mysql_se_unittest_dirs])
- AC_SUBST([mysql_pg_unittest_dirs])
- AC_SUBST([condition_dependent_plugin_modules])
- AC_SUBST([condition_dependent_plugin_objects])
- AC_SUBST([condition_dependent_plugin_links])
- AC_SUBST([condition_dependent_plugin_includes])
- ])
- ])
-])
-
-AC_DEFUN([_MYSQL_CONFIGURE_PLUGINS],[
- ifelse($#, 0, [], $#, 1, [
- _MYSQL_EMIT_CHECK_PLUGIN([$1])
- ],[
- _MYSQL_EMIT_CHECK_PLUGIN([$1])
- _MYSQL_CONFIGURE_PLUGINS(m4_shift($@))
- ])
-])
-
-AC_DEFUN([_MYSQL_EMIT_CHECK_PLUGIN],[
- __MYSQL_EMIT_CHECK_PLUGIN(
- [$1],
- m4_bpatsubst([$1], -, _),
- [MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1])
- )
-])
-
-AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
- m4_ifdef([$5],[
- AH_TEMPLATE($5, [Include ]$3[ into mysqld])
- ])
- AC_MSG_CHECKING([whether to use ]$3)
- mysql_use_plugin_dir=""
- m4_ifdef([$10],[
- if test "X[$mysql_plugin_]$2" = Xyes -a \
- "X[$with_plugin_]$2" != Xno -o \
- "X[$with_plugin_]$2" = Xyes; then
- __MYSQL_EMIT_CHECK_RESULT($3,[error])
- AC_MSG_ERROR([disabled])
- fi
- __MYSQL_EMIT_CHECK_RESULT($3,[no])
- ],[
-
- # Plugin is not disabled, determine if it should be built,
- # or only distributed
-
- m4_ifdef([$6], [
- if test ! -d "$srcdir/$6"; then
- # Plugin directory was removed after autoconf was run; treat
- # this as a disabled plugin
- if test "X[$with_plugin_]$2" = Xyes; then
- __MYSQL_EMIT_CHECK_RESULT($3,[error])
- AC_MSG_ERROR([disabled])
- fi
-
- # The result message will be printed below
- [with_plugin_]$2=no
- fi
- ])
-
- m4_ifdef([$9],[
- if test "X[$with_plugin_]$2" = Xno; then
- __MYSQL_EMIT_CHECK_RESULT($3,[error])
- AC_MSG_ERROR([cannot disable mandatory plugin])
- fi
- [mysql_plugin_]$2=yes
- ],[
- case "$with_mysqld_ldflags " in
- *"-all-static "*)
- # No need to build shared plugins when mysqld is linked with
- # -all-static as it won't be able to load them.
- if test "X[$mysql_plugin_]$2" != Xyes -a \
- "X[$with_plugin_]$2" != Xyes; then
- [with_plugin_]$2=no
- fi
- ;;
- esac
- # Similarly, disable shared plugins when configured with --disable-shared
- # as libtool will not be able to produce them
- if test "X[$enable_shared]" = Xno; then
- if test "X[$mysql_plugin_]$2" != Xyes -a \
- "X[$with_plugin_]$2" != Xyes; then
- [with_plugin_]$2=no
- fi
- fi
- ])
-
-
- if test "X[$with_plugin_]$2" = Xno; then
- __MYSQL_EMIT_CHECK_RESULT($3,[no])
- else
- m4_ifdef([$8],m4_ifdef([$7],[],[[with_plugin_]$2='']))
- if test "X[$mysql_plugin_]$2" != Xyes -a \
- "X[$with_plugin_]$2" != Xyes; then
- m4_ifdef([$8],[
- m4_ifdef([$6],[
- if test -d "$srcdir/$6" ; then
- mysql_use_plugin_dir="$6"
- ])
- AC_SUBST([plugin_]$2[_shared_target], "$8")
- AC_SUBST([plugin_]$2[_static_target], [""])
- [with_plugin_]$2=yes
- __MYSQL_EMIT_CHECK_RESULT($3,[plugin])
- m4_ifdef([$6],[
- else
- [mysql_plugin_]$2=no
- __MYSQL_EMIT_CHECK_RESULT($3,[no])
- fi
- ])
- ],[
- [with_plugin_]$2=no
- __MYSQL_EMIT_CHECK_RESULT($3,[no])
- ])
- else
- m4_ifdef([$7],[
- ifelse(m4_bregexp($7, [^lib[^.]+\.a$]), -2, [
-dnl change above "-2" to "0" to enable this section
-dnl Although this is "pretty", it breaks libmysqld build
- m4_ifdef([$6],[
- mysql_use_plugin_dir="$6"
- mysql_plugin_libs="$mysql_plugin_libs -L[\$(top_builddir)]/$6"
- ])
- mysql_plugin_libs="$mysql_plugin_libs dnl
-[-l]m4_bregexp($7, [^lib\([^.]+\)], [\1])"
- ], m4_bregexp($7, [^\\\$]), 0, [
- m4_ifdef([$6],[
- mysql_use_plugin_dir="$6"
- ])
- mysql_plugin_libs="$mysql_plugin_libs $7"
- ], [
- m4_ifdef([$6],[
- mysql_use_plugin_dir="$6"
- mysql_plugin_libs="$mysql_plugin_libs \$(top_builddir)/$6/$7"
- ],[
- mysql_plugin_libs="$mysql_plugin_libs $7"
- ])
- ])
- m4_ifdef([$5],[
- AC_DEFINE($5)
- ])
- AC_SUBST([plugin_]$2[_static_target], "$7")
- AC_SUBST([plugin_]$2[_shared_target], [""])
- ],[
- m4_ifdef([$6],[
- __MYSQL_EMIT_CHECK_RESULT($3,[error])
- AC_MSG_ERROR([Plugin $1 does not support static linking])
- ],[
- m4_ifdef([$5],[
- AC_DEFINE($5)
- AC_SUBST([plugin_]$2[_static_target], ["yes"])
- AC_SUBST([plugin_]$2[_shared_target], [""])
- ])
- ])
- ])
- m4_ifdef([$9],[
- mysql_mandatory_plugins="$mysql_mandatory_plugins [builtin_maria_]$2[_plugin],"
- ],[
- mysql_optional_plugins="$mysql_optional_plugins [builtin_maria_]$2[_plugin],"
- ])
- [with_plugin_]$2=yes
- __MYSQL_EMIT_CHECK_RESULT($3,[yes])
- m4_ifdef([$11], [
- m4_foreach([plugin], [$11], [
- condition_dependent_plugin_modules="$condition_dependent_plugin_modules m4_bregexp(plugin, [[^/]+$], [\&])"
- condition_dependent_plugin_objects="$condition_dependent_plugin_objects m4_bregexp(plugin, [[^/]+\.], [\&o])"
- condition_dependent_plugin_links="$condition_dependent_plugin_links $6/plugin"
- condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp(plugin, [^.+[/$]], [\&])"
- ])
- ])
- fi
- fi
-
- m4_ifdef([$6], [
- if test -d "$srcdir/$6"; then
- # Even if we don't build a plugin, we bundle its source into the dist
- # file. So its Makefile (and Makefiles for any subdirs) must be
- # generated for 'make dist' to work.
- m4_syscmd([test -f "]$6[/configure"])
- ifelse(m4_sysval, 0,
- [AC_CONFIG_SUBDIRS($6)],
- [
- # autoconf doesn't provide an automatic way to configure DIST_SUBDIRS of
- # a subdir; for our purposes, it's enough to just check for existing
- # Makefile.am files and add them in here
-dnl
-dnl Warning, don't try to quote the m4_esyscmd() macro, it doesn't
-dnl work. Quoting here is tricky.
-dnl
-dnl The $FIND or $SED variable can be set by the user when calling autoconf itself
-dnl to if they need to pass a specific path. This is *NOT* used when calling
-dnl running configure!
-dnl
- AC_CONFIG_FILES(m4_esyscmd([${FIND-find} "]$6[" -name Makefile.am -print | ${SED-sed} 's,\.am$,,']))
- ]
- )
-
- ifelse(
- m4_substr($6, 0, 8), [storage/], [
- mysql_se_distdirs="$mysql_se_distdirs m4_substr($6, 8)"
- if test -n "$mysql_use_plugin_dir" ; then
- mysql_se_dirs="$mysql_se_dirs m4_substr($6, 8)"
- mysql_se_unittest_dirs="$mysql_se_unittest_dirs ../$6"
- fi],
-
- m4_substr($6, 0, 7), [plugin/], [
- mysql_pg_distdirs="$mysql_pg_distdirs m4_substr($6, 7)"
- if test -n "$mysql_use_plugin_dir" ; then
- mysql_pg_dirs="$mysql_pg_dirs m4_substr($6, 7)"
- mysql_pg_unittest_dirs="$mysql_pg_unittest_dirs ../$6"
- fi],
- [AC_FATAL([don't know how to handle plugin dir ]$6)])
- fi
- ])
- ])
-])
-
-AC_DEFUN([__MYSQL_EMIT_CHECK_RESULT],[
- AC_MSG_RESULT($2)
- plugin_report="[$plugin_report]
-m4_format([ * %-32s $2],$1:)"
-])
-
-AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTIONS],[
- ifelse($#, 0, [], $#, 1, [
- _MYSQL_EMIT_PLUGIN_ACTION([$1])
- ],[
- _MYSQL_EMIT_PLUGIN_ACTION([$1])
- _MYSQL_EMIT_PLUGIN_ACTIONS(m4_shift($@))
- ])
-])
-
-AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTION],[
- __MYSQL_EMIT_PLUGIN_ACTION(
- [$1],
- m4_bpatsubst([$1], -, _),
- [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1])
- )
-])
-
-
-AC_DEFUN([__MYSQL_EMIT_PLUGIN_ACTION],[
- m4_ifdef([$3], [], [
- if test "X[$with_plugin_]$2" = Xyes; then
- if test "X[$plugin_]$2[_static_target]" = X -a \
- "X[$plugin_]$2[_shared_target]" = X; then
- AC_MSG_ERROR([that's strange, $1 failed sanity check])
- fi
- $4
- fi
- ])
-])
-
-
-
-dnl ===========================================================================
-dnl Private helper macros
-dnl ===========================================================================
-
-
-dnl SYNOPSIS
-dnl MYSQL_REQUIRE_PLUGIN([name])
-dnl
-dnl DESCRIPTION
-dnl Checks that the specified plugin does exist
-
-AC_DEFUN([MYSQL_REQUIRE_PLUGIN],[
- _MYSQL_REQUIRE_PLUGIN([$1], [__MYSQL_PLUGIN_]AS_TR_CPP([$1])[__])
-])
-
-define([_MYSQL_REQUIRE_PLUGIN],[
- ifdef([$2],[
- ifelse($2, [$1], [], [
- AC_FATAL([Misspelt MYSQL_PLUGIN declaration for $1])
- ])
- ],[
- AC_FATAL([Missing MYSQL_PLUGIN declaration for $1])
- ])
-])
-
-
-dnl ---------------------------------------------------------------------------
-
-
-dnl SYNOPSIS
-dnl _MYSQL_EMIT_METAPLUGINS([name,name...])
-dnl
-dnl DESCRIPTION
-dnl Emits shell code for metaplugins
-
-AC_DEFUN([_MYSQL_EMIT_METAPLUGINS], [ifelse($#, 0, [], $#, 1,
-[_MYSQL_EMIT_METAPLUGIN([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__])
-],
-[_MYSQL_EMIT_METAPLUGIN([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__])
-_MYSQL_EMIT_METAPLUGINS(m4_shift($@))])
-])
-
-AC_DEFUN([_MYSQL_EMIT_METAPLUGIN], [
- [$1] )
-m4_ifdef([$2], [
- mysql_plugins='m4_bpatsubst($2, :, [ ])'
-],[
- mysql_plugins=''
-])
- ;;
-])
-
-
-dnl ---------------------------------------------------------------------------
-
-
-dnl SYNOPSIS
-dnl _MYSQL_PLUGAPPEND([name],[to-append])
-dnl
-dnl DESCRIPTION
-dnl Helper macro for appending to colon-delimited lists
-dnl Optinal 3rd argument is for actions only required when defining
-dnl macro named for the first time.
-
-AC_DEFUN([_MYSQL_PLUGAPPEND],[
- m4_ifdef([$1],[
- m4_define([__plugin_append_tmp__], m4_defn([$1]))
- m4_undefine([$1])
- m4_define([$1], __plugin_append_tmp__[:$2])
- m4_undefine([__plugin_append_tmp__])
- ],[
- m4_define([$1], [$2])
- $3
- ])
-])
-
-
-dnl SYNOPSIS
-dnl _MYSQL_PLUGAPPEND_META([name],[meta,meta...])
-dnl
-dnl DESCRIPTION
-dnl Helper macro for adding plugins to meta plugins
-
-AC_DEFUN([_MYSQL_PLUGAPPEND_META],[
- ifelse($#, 1, [], [$#:$2], [2:], [], [$2], [all], [
- AC_FATAL([protected plugin group: all])
- ], [$2], [none], [
- AC_FATAL([protected plugin group: none])
- ],[
- _MYSQL_PLUGAPPEND([__mysql_$1_configs__],[$2])
- _MYSQL_PLUGAPPEND([__mysql_]m4_bpatsubst($2, -, _)[_plugins__],[$1], [
- _MYSQL_PLUGAPPEND([__mysql_metaplugin_list__],[$2])
- ])
- _MYSQL_PLUGAPPEND_META([$1], m4_shift(m4_shift($@)))
- ])
-])
-
-
-dnl ---------------------------------------------------------------------------
-
-
-dnl SYNOPSIS
-dnl MYSQL_LIST_PLUGINS
-dnl
-dnl DESCRIPTION
-dnl Emits formatted list of declared plugins
-
-AC_DEFUN([MYSQL_LIST_PLUGINS],[dnl
- m4_ifdef([__mysql_plugin_list__],[dnl
- _MYSQL_LIST_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))dnl
- ])dnl
-])
-
-AC_DEFUN([_MYSQL_LIST_PLUGINS],[dnl
- ifelse($#, 0, [], $#, 1, [dnl
- MYSQL_SHOW_PLUGIN([$1])dnl
- ],[dnl
- MYSQL_SHOW_PLUGIN([$1])dnl
- _MYSQL_LIST_PLUGINS(m4_shift($@))dnl
- ])dnl
-])
-
-AC_DEFUN([MYSQL_SHOW_PLUGIN],[
- _MYSQL_SHOW_PLUGIN(
- [$1],
- [$1-plugin],
- [MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),
- __mysql_[$1]_configs__,
- )
-])
-
-AC_DEFUN([_MYSQL_SHOW_PLUGIN],[dnl
- === $3 ===
- Plugin Name: [$1]
- Description: $4
- Supports build: _PLUGIN_BUILD_TYPE([$7],[$8])[]dnl
-m4_ifdef([$12],[
- Configurations: m4_bpatsubst($12, :, [, ])])[]dnl
-m4_ifdef([$10],[
- Status: disabled])[]dnl
-m4_ifdef([$9],[
- Status: mandatory])[]dnl
-])
-
-AC_DEFUN([_PLUGIN_BUILD_TYPE],
-[m4_ifdef([$1],[static ]m4_ifdef([$2],[and dnl
-]))[]m4_ifdef([$2],[dynamic],[m4_ifdef([$1],[],[static])])])
-
-
-dnl ---------------------------------------------------------------------------
-
-
-AC_DEFUN([_MYSQL_EMIT_PLUGINS],[
- ifelse($#, 0, [], [$#:$1], [1:], [], [
- m4_ifdef([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), [], [
- m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),[ ])
- ])
- [$1] )
- m4_ifdef([MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),[
- AC_MSG_ERROR([plugin $1 is disabled])
- ],[
- _MYSQL_EMIT_PLUGIN_ENABLE([$1], m4_bpatsubst([$1], -, _),
- [MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]),
- [MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]))
- ])
- ;;
- _MYSQL_EMIT_PLUGINS(m4_shift($@))
- ])
-])
-
-AC_DEFUN([_MYSQL_EMIT_PLUGIN_ENABLE],[
- m4_ifdef([$5],m4_ifdef([$4],[
- [mysql_plugin_]$2=yes
- ],[
- AC_MSG_WARN([$3 can only be built as a plugin])
- ]),[
- [mysql_plugin_]$2=yes
- ])
-])
-
-AC_DEFUN([_MYSQL_EMIT_PLUGIN_DEPENDS], [
- ifelse($#, 0, [], [$#:$1], [1:], [], [
- _MYSQL_EMIT_CHECK_DEPENDS(m4_bpatsubst([$1], -, _),
- [__mysql_plugdepends_$1__])
- _MYSQL_EMIT_PLUGIN_DEPENDS(m4_shift($@))
- ])
-])
-
-AC_DEFUN([_MYSQL_EMIT_CHECK_DEPENDS], [
- m4_ifdef([$2], [
- if test "X[$mysql_plugin_]$1" = Xyes -a \
- "X[$with_plugin_]$1" != Xno -o \
- "X[$with_plugin_]$1" = Xyes; then
- _MYSQL_EMIT_PLUGIN_DEPENDENCIES(m4_bpatsubst($2, :, [,]))
- fi
- ])
-])
-
-AC_DEFUN([_MYSQL_EMIT_PLUGIN_DEPENDENCIES], [
- ifelse([$1], [], [], [
- m4_ifdef([MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),[
- AC_MSG_ERROR([depends upon disabled plugin $1])
- ],[
- [mysql_plugin_]m4_bpatsubst([$1], -, _)=yes
- if test "X[$with_plugin_]m4_bpatsubst([$1], -, _)" = Xno; then
- AC_MSG_ERROR([depends upon disabled plugin $1])
- fi
- ])
- _MYSQL_EMIT_PLUGIN_DEPENDENCIES(m4_shift($@))
- ])
-])
-
-dnl SYNOPSIS
-dnl _MYSQL_CHECK_PLUGIN_ARGS([plugin],[plugin]...)
-dnl
-dnl DESCRIPTION
-dnl Emits shell script for checking configure arguments
-dnl Arguments to this macro is default value for selected plugins
-
-AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARGS],[
- __MYSQL_CHECK_PLUGIN_ARGS(m4_default([$1], [default]))
-])
-
-AC_DEFUN([__MYSQL_CHECK_PLUGIN_ARGS],[
- AC_ARG_WITH([plugins],
-AS_HELP_STRING([--with-plugins=PLUGIN[[[[[,PLUGIN..]]]]]],
- [Plugins to include in mysqld. Must be a
- configuration name or a comma separated list of plugins.])
-AS_HELP_STRING([],
- [Available configurations are:] dnl
-m4_bpatsubst([none:]m4_ifdef([__mysql_metaplugin_list__],
- __mysql_metaplugin_list__:)[all], :, [ ])[.])
-AS_HELP_STRING([],
- [Available plugins are:] dnl
-m4_bpatsubst(__mysql_plugin_list__, :, [ ])[.])
-AS_HELP_STRING([--without-plugin-PLUGIN],
- [Disable the named plugin from being built. Otherwise, for
- plugins which are not selected for inclusion in mysqld will be
- built dynamically (if supported)])
-AS_HELP_STRING([--with-plugin-PLUGIN],
- [Forces the named plugin to be linked into mysqld statically.]),
- [mysql_plugins="`echo $withval | tr ',.:;*[]' ' '`"],
- [mysql_plugins=['$1']])
-
-m4_divert_once([HELP_VAR_END],[
-Description of plugins:
-MYSQL_LIST_PLUGINS])
-
- case "$mysql_plugins" in
- all )
- mysql_plugins='m4_bpatsubst(__mysql_plugin_list__, :, [ ])'
- ;;
- none )
- mysql_plugins=''
- ;;
-m4_ifdef([__mysql_metaplugin_list__],[
-_MYSQL_EMIT_METAPLUGINS(m4_bpatsubst(__mysql_metaplugin_list__, :, [,]))
-])
- esac
-
- for plugin in $mysql_plugins; do
- case "$plugin" in
- all | none )
- AC_MSG_ERROR([bad plugin name: $plugin])
- ;;
-_MYSQL_EMIT_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
- * )
- AC_MSG_ERROR([unknown plugin: $plugin])
- ;;
- esac
- done
-
- _MYSQL_EMIT_PLUGIN_DEPENDS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
-])
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: _MYSQL_INCLUDE_LIST
-dnl
-dnl SYNOPSIS
-dnl _MYSQL_INCLUDE_LIST([filename,filename...])
-dnl
-dnl DESCRIPTION
-dnl includes all files from the list
-dnl
-dnl ---------------------------------------------------------------------------
-AC_DEFUN([_MYSQL_INCLUDE_LIST],[
- ifelse([$1], [], [], [
- m4_define([__mysql_include__],[$1])
- dnl We have to use builtin(), because sinclude would generate an error
- dnl "file $1 does not exists" in aclocal-1.8 - which is a bug, clearly
- dnl violating m4 specs, and which is fixed in aclocal-1.9
- builtin([include],$1)
- m4_undefine([__mysql_include__])
- _MYSQL_INCLUDE_LIST(m4_shift($@))
- ])
-])
-
-dnl ===========================================================================
diff --git a/config/ac-macros/readline.m4 b/config/ac-macros/readline.m4
deleted file mode 100644
index e1ed8420bfb..00000000000
--- a/config/ac-macros/readline.m4
+++ /dev/null
@@ -1,143 +0,0 @@
-AC_DEFUN([MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY], [
- AC_CACHE_CHECK([HIST_ENTRY is declared in readline/readline.h], mysql_cv_hist_entry_declared,
- AC_TRY_COMPILE(
- [
- #include "stdio.h"
- #include "readline/readline.h"
- ],
- [
- HIST_ENTRY entry;
- ],
- [
- mysql_cv_hist_entry_declared=yes
- AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, [1],
- [HIST_ENTRY is defined in the outer libeditreadline])
- ],
- [mysql_cv_libedit_interface=no]
- )
- )
-])
-
-AC_DEFUN([MYSQL_CHECK_LIBEDIT_INTERFACE], [
- AC_CACHE_CHECK([libedit variant of rl_completion_entry_function], mysql_cv_libedit_interface,
- AC_TRY_COMPILE(
- [
- #include "stdio.h"
- #include "readline/readline.h"
- ],
- [
- char res= *(*rl_completion_entry_function)(0,0);
- completion_matches(0,0);
- ],
- [
- mysql_cv_libedit_interface=yes
- AC_DEFINE_UNQUOTED([USE_LIBEDIT_INTERFACE], [1],
- [used libedit interface (can we dereference result of rl_completion_entry_function)])
- ],
- [mysql_cv_libedit_interface=no]
- )
- )
-])
-
-AC_DEFUN([MYSQL_CHECK_NEW_RL_INTERFACE], [
- AC_CACHE_CHECK([defined rl_compentry_func_t and rl_completion_func_t], mysql_cv_new_rl_interface,
- AC_TRY_COMPILE(
- [
- #include "stdio.h"
- #include "readline/readline.h"
- ],
- [
- rl_completion_func_t *func1= (rl_completion_func_t*)0;
- rl_compentry_func_t *func2= (rl_compentry_func_t*)0;
- ],
- [
- mysql_cv_new_rl_interface=yes
- AC_DEFINE_UNQUOTED([USE_NEW_READLINE_INTERFACE], [1],
- [used new readline interface (are rl_completion_func_t and rl_compentry_func_t defined)])
- ],
- [mysql_cv_new_rl_interface=no]
- )
- )
-])
-
-dnl
-dnl check for availability of multibyte characters and functions
-dnl (Based on BASH_CHECK_MULTIBYTE in aclocal.m4 of readline-5.0)
-dnl
-AC_DEFUN([MYSQL_CHECK_MULTIBYTE],
-[
-AC_CHECK_HEADERS(wctype.h)
-AC_CHECK_HEADERS(wchar.h)
-AC_CHECK_HEADERS(langinfo.h)
-
-AC_CHECK_FUNC(mbrlen, AC_DEFINE(HAVE_MBRLEN,[],[Define if you have mbrlen]))
-AC_CHECK_FUNC(mbscmp, AC_DEFINE(HAVE_MBSCMP,[],[Define if you have mbscmp]))
-AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS,[],[Define if you have mbsrtowcs]))
-
-AC_CHECK_FUNC(wcrtomb, AC_DEFINE(HAVE_WCRTOMB,[],[Define if you have wcrtomb]))
-AC_CHECK_FUNC(mbrtowc, AC_DEFINE(HAVE_MBRTOWC,[],[Define if you have mbrtowc]))
-AC_CHECK_FUNC(wcscoll, AC_DEFINE(HAVE_WCSCOLL,[],[Define if you have wcscoll]))
-AC_CHECK_FUNC(wcsdup, AC_DEFINE(HAVE_WCSDUP,[],[Define if you have wcsdup]))
-AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH,[],[Define if you have wcwidth]))
-AC_CHECK_FUNC(wctype, AC_DEFINE(HAVE_WCTYPE,[],[Define if you have wctype]))
-
-AC_CACHE_CHECK([for mbstate_t], mysql_cv_have_mbstate_t,
-[AC_TRY_COMPILE([
-#include <wchar.h>], [
- mbstate_t ps;
- mbstate_t *psp;
- psp = (mbstate_t *)0;
-], mysql_cv_have_mbstate_t=yes, mysql_cv_have_mbstate_t=no)])
-if test $mysql_cv_have_mbstate_t = yes; then
- AC_DEFINE([HAVE_MBSTATE_T],[],[Define if mysql_cv_have_mbstate_t=yes])
-fi
-
-AC_CHECK_FUNCS(iswlower iswupper towlower towupper iswctype)
-
-AC_CACHE_CHECK([for nl_langinfo and CODESET], mysql_cv_langinfo_codeset,
-[AC_TRY_LINK(
-[#include <langinfo.h>],
-[char* cs = nl_langinfo(CODESET);],
-mysql_cv_langinfo_codeset=yes, mysql_cv_langinfo_codeset=no)])
-if test $mysql_cv_langinfo_codeset = yes; then
- AC_DEFINE([HAVE_LANGINFO_CODESET],[],[Define if mysql_cv_langinfo_codeset=yes])
-fi
-
-dnl check for wchar_t in <wchar.h>
-AC_CACHE_CHECK([for wchar_t in wchar.h], bash_cv_type_wchar_t,
-[AC_TRY_COMPILE(
-[#include <wchar.h>
-],
-[
- wchar_t foo;
- foo = 0;
-], bash_cv_type_wchar_t=yes, bash_cv_type_wchar_t=no)])
-if test $bash_cv_type_wchar_t = yes; then
- AC_DEFINE(HAVE_WCHAR_T, 1, [systems should define this type here])
-fi
-
-dnl check for wctype_t in <wctype.h>
-AC_CACHE_CHECK([for wctype_t in wctype.h], bash_cv_type_wctype_t,
-[AC_TRY_COMPILE(
-[#include <wctype.h>],
-[
- wctype_t foo;
- foo = 0;
-], bash_cv_type_wctype_t=yes, bash_cv_type_wctype_t=no)])
-if test $bash_cv_type_wctype_t = yes; then
- AC_DEFINE(HAVE_WCTYPE_T, 1, [systems should define this type here])
-fi
-
-dnl check for wint_t in <wctype.h>
-AC_CACHE_CHECK([for wint_t in wctype.h], bash_cv_type_wint_t,
-[AC_TRY_COMPILE(
-[#include <wctype.h>],
-[
- wint_t foo;
- foo = 0;
-], bash_cv_type_wint_t=yes, bash_cv_type_wint_t=no)])
-if test $bash_cv_type_wint_t = yes; then
- AC_DEFINE(HAVE_WINT_T, 1, [systems should define this type here])
-fi
-
-])
diff --git a/config/ac-macros/ssl.m4 b/config/ac-macros/ssl.m4
deleted file mode 100644
index fc55f93d8d6..00000000000
--- a/config/ac-macros/ssl.m4
+++ /dev/null
@@ -1,219 +0,0 @@
-dnl ===========================================================================
-dnl Support for SSL
-dnl ===========================================================================
-dnl
-dnl
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_USE_BUNDLED_YASSL
-dnl
-dnl SYNOPSIS
-dnl MYSQL_USE_BUNDLED_YASSL()
-dnl
-dnl DESCRIPTION
-dnl Add defines so yassl is built and linked with
-dnl ---------------------------------------------------------------------------
-AC_DEFUN([MYSQL_USE_BUNDLED_YASSL], [
-
- with_bundled_yassl="yes"
-
- yassl_dir="yassl"
- AC_SUBST([yassl_dir])
-
- yassl_libs="\$(top_builddir)/extra/yassl/src/libyassl.la \
- \$(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la"
- AC_SUBST(yassl_libs)
-
- AC_DEFINE([HAVE_OPENSSL], [1], [Defined by configure. Using yaSSL for SSL.])
- AC_DEFINE([HAVE_YASSL], [1], [Defined by configure. Using yaSSL for SSL.])
-
- # System specific checks
- yassl_integer_extra_cxxflags=""
- case $host_cpu--$CXX_VERSION in
- sparc*--*Sun*C++*5.6*)
- # Disable inlining when compiling taocrypt/src/
- yassl_taocrypt_extra_cxxflags="+d"
- AC_MSG_NOTICE([disabling inlining for yassl/taocrypt/src/])
- ;;
- esac
- AC_SUBST([yassl_taocrypt_extra_cxxflags])
-
- # Thread safe check
- yassl_thread_cxxflags=""
- yassl_thread_safe=""
- if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"; then
- yassl_thread_cxxflags="-DYASSL_THREAD_SAFE"
- yassl_thread_safe="(thread-safe)"
- fi
- AC_SUBST([yassl_thread_cxxflags])
-
- # Link extra/yassl/include/openssl subdir to include/
- yassl_h_ln_cmd="\$(LN) -s \$(top_srcdir)/extra/yassl/include/openssl openssl"
- AC_SUBST(yassl_h_ln_cmd)
-
- AC_MSG_RESULT([using bundled yaSSL $yassl_thread_safe])
-])
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_CHECK_SSL_DIR
-dnl
-dnl SYNOPSIS
-dnl MYSQL_CHECK_SSL_DIR(includes, libs)
-dnl
-dnl DESCRIPTION
-dnl Auxiliary macro to check for ssl at given path
-dnl
-dnl ---------------------------------------------------------------------------
-
-AC_DEFUN([MYSQL_CHECK_SSL_DIR], [
-ssl_incs="$1"
-ssl_libs="$2"
-save_CPPFLAGS="$CPPFLAGS"
-save_LIBS="$LIBS"
-CPPFLAGS="$ssl_incs $CPPFLAGS"
-LIBS="$LIBS $ssl_libs"
-AC_TRY_LINK([#include <openssl/ssl.h>],
- [return SSL_library_init();],
- [mysql_ssl_found="yes"],
- [mysql_ssl_found="no"])
-CPPFLAGS="$save_CPPFLAGS"
-LIBS="$save_LIBS"
-])
-
-
-dnl ---------------------------------------------------------------------------
-dnl Macro: MYSQL_FIND_OPENSSL
-dnl
-dnl SYNOPSIS
-dnl MYSQL_FIND_OPENSSL(location)
-dnl
-dnl DESCRIPTION
-dnl Search the location for OpenSSL support
-dnl
-dnl ---------------------------------------------------------------------------
-AC_DEFUN([MYSQL_FIND_OPENSSL], [
- location="$1"
-
- #
- # Set include paths
- #
- openssl_include="$location/include"
- openssl_includes=""
-
- # Don't set ssl_includes to /usr/include as this gives us a lot of
- # compiler warnings when using gcc 3.x
- if test "$openssl_include" != "/usr/include"
- then
- openssl_includes="-I$openssl_include"
- fi
-
- #
- # Try to link with openSSL libs in <location>
- #
- openssl_libs="-L$location/lib/ -lssl -lcrypto"
- MYSQL_CHECK_SSL_DIR([$openssl_includes], [$openssl_libs])
-
- if test "$mysql_ssl_found" == "no"
- then
- #
- # BUG 764: Compile failure with OpenSSL on Red Hat Linux (krb5.h missing)
- # Try to link with include paths to kerberos set
- #
- openssl_includes="$openssl_includes -I/usr/kerberos/include"
- MYSQL_CHECK_SSL_DIR([$openssl_includes], [$openssl_libs])
- fi
-
- if test "$mysql_ssl_found" == "no"
- then
- AC_MSG_ERROR([Could not link with SSL libs at $location])
- fi
-
- # openssl-devel-0.9.6 requires dlopen() and we can't link staticly
- # on many platforms (We should actually test this here, but it's quite
- # hard to do as we are doing libtool for linking.)
- case "$CLIENT_EXTRA_LDFLAGS $MYSQLD_EXTRA_LDFLAGS" in
- *-all-static*)
- AC_MSG_ERROR([You can't use the --all-static link option when using openssl.])
- ;;
- esac
-
- AC_SUBST(openssl_includes)
- AC_SUBST(openssl_libs)
-
- NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS $openssl_libs"
-
- AC_DEFINE([HAVE_OPENSSL], [1], [OpenSSL])
- AC_MSG_RESULT([using openSSL from $location])
-])
-
-
-
-dnl ------------------------------------------------------------------------
-dnl Macro: MYSQL_CHECK_SSL
-dnl
-dnl SYNOPSIS
-dnl MYSQL_CHECK_SSL
-dnl
-dnl Provides the following configure options:
-dnl --with-ssl=DIR
-dnl Possible DIR values are:
-dnl - no - the macro will disable use of ssl
-dnl - bundled, empty or not specified - means use ssl lib
-dnl bundled along with MySQL sources
-dnl - ssl location prefix - given location prefix, the macro expects
-dnl to find the header files in $prefix/include/, and libraries in
-dnl $prefix/lib. If headers or libraries weren't found at $prefix, the
-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],
- [mysql_ssl_dir="$withval"],
- [mysql_ssl_dir=no])
-
- if test "$with_yassl"
- then
- AC_MSG_ERROR([The flag --with-yassl is deprecated, use --with-ssl])
- fi
-
- if test "$with_openssl"
- then
- AC_MSG_ERROR([The flag --with-openssl is deprecated, use --with-ssl])
- fi
-
- case "$mysql_ssl_dir" in
- "no")
- #
- # Don't include SSL support
- #
- AC_MSG_RESULT([disabled])
- ;;
-
- "bundled"|"yes")
- #
- # Use the bundled SSL implementation (yaSSL)
- #
- MYSQL_USE_BUNDLED_YASSL
- ;;
-
- *)
- #
- # A location where to search for OpenSSL was specified
- #
- MYSQL_FIND_OPENSSL([$mysql_ssl_dir])
- ;;
- esac
- AM_CONDITIONAL([HAVE_YASSL], [ test "$with_bundled_yassl" = "yes" ])
-])
diff --git a/config/ac-macros/zlib.m4 b/config/ac-macros/zlib.m4
deleted file mode 100644
index f62bb056249..00000000000
--- a/config/ac-macros/zlib.m4
+++ /dev/null
@@ -1,132 +0,0 @@
-dnl Define zlib paths to point at bundled zlib
-
-AC_DEFUN([MYSQL_USE_BUNDLED_ZLIB], [
-ZLIB_INCLUDES="-I\$(top_srcdir)/zlib"
-ZLIB_LIBS="\$(top_builddir)/zlib/libzlt.la"
-dnl Omit -L$pkglibdir as it's always in the list of mysql_config deps.
-ZLIB_DEPS="-lz"
-zlib_dir="zlib"
-AC_SUBST([zlib_dir])
-mysql_cv_compress="yes"
-])
-
-dnl Auxiliary macro to check for zlib at given path.
-dnl We are strict with the server, as "archive" engine
-dnl needs zlibCompileFlags(), but for client only we
-dnl are less strict, and take the zlib we find.
-
-AC_DEFUN([MYSQL_CHECK_ZLIB_DIR], [
-save_CPPFLAGS="$CPPFLAGS"
-save_LIBS="$LIBS"
-CPPFLAGS="$ZLIB_INCLUDES $CPPFLAGS"
-LIBS="$LIBS $ZLIB_LIBS"
-if test X"$with_server" = Xno
-then
- zlibsym=zlibVersion
-else
- zlibsym=zlibCompileFlags
-fi
-AC_CACHE_VAL([mysql_cv_compress],
- [AC_TRY_LINK([#include <zlib.h>],
- [return $zlibsym();],
- [mysql_cv_compress="yes"
- AC_MSG_RESULT([ok])],
- [mysql_cv_compress="no"])
- ])
-CPPFLAGS="$save_CPPFLAGS"
-LIBS="$save_LIBS"
-])
-
-dnl MYSQL_CHECK_ZLIB_WITH_COMPRESS
-dnl ------------------------------------------------------------------------
-dnl @synopsis MYSQL_CHECK_ZLIB_WITH_COMPRESS
-dnl
-dnl Provides the following configure options:
-dnl --with-zlib-dir=DIR
-dnl Possible DIR values are:
-dnl - "no" - the macro will disable use of compression functions
-dnl - "bundled" - means use zlib bundled along with MySQL sources
-dnl - empty, or not specified - the macro will try default system
-dnl library (if present), and in case of error will fall back to
-dnl bundled zlib
-dnl - zlib location prefix - given location prefix, the macro expects
-dnl to find the library headers in $prefix/include, and binaries in
-dnl $prefix/lib. If zlib headers or binaries weren't found at $prefix, the
-dnl macro bails out with error.
-dnl
-dnl If the library was found, this function #defines HAVE_COMPRESS
-dnl and configure variables ZLIB_INCLUDES (i.e. -I/path/to/zlib/include),
-dnl ZLIB_LIBS (i. e. -L/path/to/zlib/lib -lz) and ZLIB_DEPS which is
-dnl used in mysql_config and is always the same as ZLIB_LIBS except to
-dnl when we use the bundled zlib. In the latter case ZLIB_LIBS points to the
-dnl build dir ($top_builddir/zlib), while mysql_config must point to the
-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*)
- AC_MSG_RESULT(ok)
- AC_DEFINE([HAVE_COMPRESS], [1], [Define to enable compression support])
- ;;
- *)
- AC_ARG_WITH([zlib-dir],
- AC_HELP_STRING([--with-zlib-dir=no|bundled|DIR],
- [Provide MySQL with a custom location of
- compression library. Given DIR, zlib binary is
- assumed to be in $DIR/lib and header files
- in $DIR/include.]),
- [mysql_zlib_dir=${withval}],
- [mysql_zlib_dir=""])
- case "$mysql_zlib_dir" in
- "no")
- mysql_cv_compress="no"
- AC_MSG_RESULT([disabled])
- ;;
- "bundled")
- MYSQL_USE_BUNDLED_ZLIB
- AC_MSG_RESULT([using bundled zlib])
- ;;
- "")
- ZLIB_INCLUDES=""
- ZLIB_LIBS="-lz"
- MYSQL_CHECK_ZLIB_DIR
- if test "$mysql_cv_compress" = "no"; then
- MYSQL_USE_BUNDLED_ZLIB
- AC_MSG_RESULT([system-wide zlib not found, using one bundled with MySQL])
- fi
- ;;
- *)
- # Test for libz using all known library file endings
- if test \( -f "$mysql_zlib_dir/lib/libz.a" -o \
- -f "$mysql_zlib_dir/lib/libz.so" -o \
- -f "$mysql_zlib_dir/lib/libz.sl" -o \
- -f "$mysql_zlib_dir/lib/libz.dylib" \) \
- -a -f "$mysql_zlib_dir/include/zlib.h"; then
- ZLIB_INCLUDES="-I$mysql_zlib_dir/include"
- ZLIB_LIBS="-L$mysql_zlib_dir/lib -lz"
- MYSQL_CHECK_ZLIB_DIR
- fi
- if test "x$mysql_cv_compress" != "xyes"; then
- AC_MSG_ERROR([headers or binaries were not found in $mysql_zlib_dir/{include,lib}])
- fi
- ;;
- esac
- if test "$mysql_cv_compress" = "yes"; then
- if test "x$ZLIB_DEPS" = "x"; then
- ZLIB_DEPS="$ZLIB_LIBS"
- fi
- AC_SUBST([ZLIB_LIBS])
- AC_SUBST([ZLIB_DEPS])
- AC_SUBST([ZLIB_INCLUDES])
- AC_DEFINE([HAVE_COMPRESS], [1], [Define to enable compression support])
- fi
- ;;
-esac
-])
-
-dnl ------------------------------------------------------------------------
diff --git a/configure.cmake b/configure.cmake
index c2e1dc4647b..0014c1d7b49 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -269,6 +269,49 @@ ENDIF()
#
FIND_PACKAGE (Threads)
+FUNCTION(MY_CHECK_PTHREAD_ONCE_INIT)
+ CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR_FLAG)
+ IF(NOT HAVE_WERROR_FLAG)
+ RETURN()
+ ENDIF()
+ SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror")
+ CHECK_C_SOURCE_COMPILES("
+ #include <pthread.h>
+ void foo(void) {}
+ int main()
+ {
+ pthread_once_t once_control = PTHREAD_ONCE_INIT;
+ pthread_once(&once_control, foo);
+ return 0;
+ }"
+ HAVE_PTHREAD_ONCE_INIT
+ )
+ # http://bugs.opensolaris.org/bugdatabase/printableBug.do?bug_id=6611808
+ IF(NOT HAVE_PTHREAD_ONCE_INIT)
+ CHECK_C_SOURCE_COMPILES("
+ #include <pthread.h>
+ void foo(void) {}
+ int main()
+ {
+ pthread_once_t once_control = { PTHREAD_ONCE_INIT };
+ pthread_once(&once_control, foo);
+ return 0;
+ }"
+ HAVE_ARRAY_PTHREAD_ONCE_INIT
+ )
+ ENDIF()
+ IF(HAVE_PTHREAD_ONCE_INIT)
+ SET(PTHREAD_ONCE_INITIALIZER "PTHREAD_ONCE_INIT" PARENT_SCOPE)
+ ENDIF()
+ IF(HAVE_ARRAY_PTHREAD_ONCE_INIT)
+ SET(PTHREAD_ONCE_INITIALIZER "{ PTHREAD_ONCE_INIT }" PARENT_SCOPE)
+ ENDIF()
+ENDFUNCTION()
+
+IF(CMAKE_USE_PTHREADS_INIT)
+ MY_CHECK_PTHREAD_ONCE_INIT()
+ENDIF()
+
#
# Tests for functions
#
@@ -299,14 +342,15 @@ CHECK_FUNCTION_EXISTS (dlopen HAVE_DLOPEN)
CHECK_FUNCTION_EXISTS (fchmod HAVE_FCHMOD)
CHECK_FUNCTION_EXISTS (fcntl HAVE_FCNTL)
CHECK_FUNCTION_EXISTS (fconvert HAVE_FCONVERT)
-CHECK_SYMBOL_EXISTS(fdatasync "unistd.h" HAVE_FDATASYNC)
+CHECK_FUNCTION_EXISTS (fdatasync HAVE_FDATASYNC)
+CHECK_SYMBOL_EXISTS(fdatasync "unistd.h" HAVE_DECL_FDATASYNC)
CHECK_FUNCTION_EXISTS (fesetround HAVE_FESETROUND)
+CHECK_FUNCTION_EXISTS (fedisableexcept HAVE_FEDISABLEEXCEPT)
CHECK_FUNCTION_EXISTS (fpsetmask HAVE_FPSETMASK)
CHECK_FUNCTION_EXISTS (fseeko HAVE_FSEEKO)
CHECK_FUNCTION_EXISTS (fsync HAVE_FSYNC)
CHECK_FUNCTION_EXISTS (getcwd HAVE_GETCWD)
CHECK_FUNCTION_EXISTS (gethostbyaddr_r HAVE_GETHOSTBYADDR_R)
-CHECK_FUNCTION_EXISTS (gethostbyname_r HAVE_GETHOSTBYNAME_R)
CHECK_FUNCTION_EXISTS (gethrtime HAVE_GETHRTIME)
CHECK_FUNCTION_EXISTS (getnameinfo HAVE_GETNAMEINFO)
CHECK_FUNCTION_EXISTS (getpass HAVE_GETPASS)
@@ -319,6 +363,10 @@ CHECK_FUNCTION_EXISTS (getwd HAVE_GETWD)
CHECK_FUNCTION_EXISTS (gmtime_r HAVE_GMTIME_R)
CHECK_FUNCTION_EXISTS (initgroups HAVE_INITGROUPS)
CHECK_FUNCTION_EXISTS (issetugid HAVE_ISSETUGID)
+CHECK_FUNCTION_EXISTS (getuid HAVE_GETUID)
+CHECK_FUNCTION_EXISTS (geteuid HAVE_GETEUID)
+CHECK_FUNCTION_EXISTS (getgid HAVE_GETGID)
+CHECK_FUNCTION_EXISTS (getegid HAVE_GETEGID)
CHECK_FUNCTION_EXISTS (ldiv HAVE_LDIV)
CHECK_FUNCTION_EXISTS (localtime_r HAVE_LOCALTIME_R)
CHECK_FUNCTION_EXISTS (longjmp HAVE_LONGJMP)
@@ -346,7 +394,6 @@ CHECK_FUNCTION_EXISTS (pthread_condattr_setclock HAVE_PTHREAD_CONDATTR_SETCLOCK)
CHECK_FUNCTION_EXISTS (pthread_init HAVE_PTHREAD_INIT)
CHECK_FUNCTION_EXISTS (pthread_key_delete HAVE_PTHREAD_KEY_DELETE)
CHECK_FUNCTION_EXISTS (pthread_rwlock_rdlock HAVE_PTHREAD_RWLOCK_RDLOCK)
-CHECK_FUNCTION_EXISTS (pthread_rwlockattr_setkind_np HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP)
CHECK_FUNCTION_EXISTS (pthread_sigmask HAVE_PTHREAD_SIGMASK)
CHECK_FUNCTION_EXISTS (pthread_threadmask HAVE_PTHREAD_THREADMASK)
CHECK_FUNCTION_EXISTS (pthread_yield_np HAVE_PTHREAD_YIELD_NP)
@@ -445,6 +492,7 @@ CHECK_SYMBOL_EXISTS(getpagesize "unistd.h" HAVE_GETPAGESIZE)
CHECK_SYMBOL_EXISTS(TIOCGWINSZ "sys/ioctl.h" GWINSZ_IN_SYS_IOCTL)
CHECK_SYMBOL_EXISTS(FIONREAD "sys/ioctl.h" FIONREAD_IN_SYS_IOCTL)
CHECK_SYMBOL_EXISTS(TIOCSTAT "sys/ioctl.h" TIOCSTAT_IN_SYS_IOCTL)
+CHECK_SYMBOL_EXISTS(FIONREAD "sys/filio.h" FIONREAD_IN_SYS_FILIO)
CHECK_SYMBOL_EXISTS(gettimeofday "sys/time.h" HAVE_GETTIMEOFDAY)
CHECK_SYMBOL_EXISTS(finite "math.h" HAVE_FINITE_IN_MATH_H)
@@ -531,6 +579,7 @@ MY_CHECK_TYPE_SIZE(uint32 UINT32)
MY_CHECK_TYPE_SIZE(u_int32_t U_INT32_T)
MY_CHECK_TYPE_SIZE(int64 INT64)
MY_CHECK_TYPE_SIZE(uint64 UINT64)
+MY_CHECK_TYPE_SIZE(time_t TIME_T)
SET (CMAKE_EXTRA_INCLUDE_FILES sys/types.h)
MY_CHECK_TYPE_SIZE(bool BOOL)
SET(CMAKE_EXTRA_INCLUDE_FILES)
@@ -550,6 +599,16 @@ ENDIF()
# Code tests
#
+# check whether time_t is unsigned
+CHECK_C_SOURCE_COMPILES("
+int main()
+{
+ int array[(((time_t)-1) > 0) ? 1 : -1];
+ return 0;
+}"
+TIME_T_UNSIGNED)
+
+
CHECK_C_SOURCE_COMPILES("
#ifdef _WIN32
#include <winsock2.h>
@@ -867,44 +926,6 @@ CHECK_CXX_SOURCE_COMPILES("
"
HAVE_SOLARIS_STYLE_GETHOST)
-CHECK_CXX_SOURCE_COMPILES("
- #undef inline
- #if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
- #define _REENTRANT
- #endif
- #include <pthread.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <netdb.h>
- int main()
- {
- int ret = gethostbyname_r((const char *) 0,
- (struct hostent*) 0, (char*) 0, 0, (struct hostent **) 0, (int *) 0);
- return 0;
- }"
- HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
-
-CHECK_CXX_SOURCE_COMPILES("
- #undef inline
- #if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
- #define _REENTRANT
- #endif
- #include <pthread.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <netdb.h>
- int main()
- {
- int ret = gethostbyname_r((const char *) 0, (struct hostent*) 0, (struct hostent_data*) 0);
- return 0;
- }"
- HAVE_GETHOSTBYNAME_R_RETURN_INT)
-
-
# Use of ALARMs to wakeup on timeout on sockets
#
# This feature makes use of a mutex and is a scalability hog we
diff --git a/configure.in b/configure.in
deleted file mode 100644
index 934f5f9e92b..00000000000
--- a/configure.in
+++ /dev/null
@@ -1,3121 +0,0 @@
-dnl -*- ksh -*-
-dnl Process this file with autoconf to produce a configure script.
-
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# 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
-
-# Minimum Autoconf version required.
-AC_PREREQ(2.59)
-
-dnl Various people throughout the community may parse configure.in to
-dnl get the MySQL version from the source branch. If the formatting
-dnl of this line is going to be changed, please announce the change to
-dnl internals@lists.mysql.com in advance of pushing the change.
-dnl
-dnl When changing the major version number please also check the switch
-dnl statement in mysqlbinlog::check_master_version(). You may also need
-dnl to update version.c in ndb.
-dnl
-dnl When merging new MySQL releases, update the version number to match the
-dnl MySQL version number.
-dnl
-dnl Note: the following line must be parseable by win/configure.js:GetVersion()
-AC_INIT([MariaDB Server], [5.5.7-MariaDB-alpha], [], [mysql])
-
-AC_CONFIG_SRCDIR([sql/mysqld.cc])
-AC_CANONICAL_SYSTEM
-# USTAR format gives us the possibility to store longer path names in
-# TAR files, the path name is split into two parts, a 155 chacater
-# first part and a 100 character second part.
-AM_INIT_AUTOMAKE([1.9 tar-ustar])
-
-AM_CONFIG_HEADER([include/config.h])
-
-# Request support for automake silent-rules if available.
-# Default to verbose output. One can use the configure-time
-# option --enable-silent-rules or make V=0 to activate
-# silent rules.
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([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=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
-
-# Set all version vars based on $VERSION. How do we do this more elegant ?
-# Remember that regexps needs to quote [ and ] since this is run through m4
-# We take some made up examples
-#
-# VERSION 5.1.40sp1-alpha 5.0.34a 5.5.1-m2
-# MYSQL_U_SCORE_VERSION 5.1.40sp1_alpha 5.0.34a 5.5.1_m2
-# MYSQL_NO_DASH_VERSION 5.1.40sp1 5.0.34a 5.5.1
-# MYSQL_NUMERIC_VERSION 5.1.40 5.0.34 5.5.1
-# MYSQL_BASE_VERSION 5.1 5.0 5.5
-# MYSQL_VERSION_ID 50140 50034 50501
-#
-MYSQL_U_SCORE_VERSION=`echo $VERSION | sed -e "s|-|_|"`
-MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
-MYSQL_NUMERIC_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
-MYSQL_BASE_VERSION=`echo $MYSQL_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
-MYSQL_VERSION_ID=`echo $MYSQL_NUMERIC_VERSION | \
- awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
-MYSQL_COPYRIGHT_YEAR=`date '+%Y'`
-
-# Add previous major version for debian package upgrade path
-MYSQL_PREVIOUS_BASE_VERSION=5.0
-
-# The port should be constant for a LONG time
-MYSQL_TCP_PORT_DEFAULT=3306
-MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock"
-
-dnl Include m4
-sinclude(config/ac-macros/maintainer.m4)
-sinclude(config/ac-macros/alloca.m4)
-sinclude(config/ac-macros/check_cpu.m4)
-sinclude(config/ac-macros/character_sets.m4)
-sinclude(config/ac-macros/compiler_flag.m4)
-sinclude(config/ac-macros/plugins.m4)
-sinclude(config/ac-macros/dtrace.m4)
-sinclude(config/ac-macros/ha_ndbcluster.m4)
-sinclude(config/ac-macros/large_file.m4)
-sinclude(config/ac-macros/misc.m4)
-sinclude(config/ac-macros/readline.m4)
-sinclude(config/ac-macros/ssl.m4)
-sinclude(config/ac-macros/libevent.m4)
-sinclude(config/ac-macros/zlib.m4)
-
-# Remember to add a directory sql/share/LANGUAGE
-AVAILABLE_LANGUAGES="\
-czech danish dutch english estonian french german greek hungarian \
-italian japanese korean norwegian norwegian-ny polish portuguese \
-romanian russian serbian slovak spanish swedish ukrainian"
-
-#####
-#####
-
-AC_SUBST(MYSQL_U_SCORE_VERSION)
-AC_SUBST(MYSQL_NO_DASH_VERSION)
-AC_SUBST(MYSQL_BASE_VERSION)
-AC_SUBST(MYSQL_VERSION_ID)
-AC_SUBST(MYSQL_PREVIOUS_BASE_VERSION)
-AC_SUBST(MYSQL_COPYRIGHT_YEAR)
-AC_SUBST(PROTOCOL_VERSION)
-AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
- [mysql client protocol version])
-AC_SUBST(DOT_FRM_VERSION)
-AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION],
- [Version of .frm files])
-AC_SUBST(SHARED_LIB_MAJOR_VERSION)
-AC_SUBST(SHARED_LIB_VERSION)
-AC_SUBST(AVAILABLE_LANGUAGES)
-
-# Whether the maintainer mode should be enabled.
-MY_MAINTAINER_MODE
-
-# Canonicalize the configuration name.
-
-# 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 sun-solaris])
-AC_SUBST(MACHINE_TYPE)
-AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
- [Machine type name, eg sparc])
-
-# Detect intel x86 like processor
-BASE_MACHINE_TYPE=$MACHINE_TYPE
-case $MACHINE_TYPE in
- i?86) BASE_MACHINE_TYPE=i386 ;;
-esac
-
-# Save some variables and the command line options for mysqlbug
-SAVE_CC="$CC"
-SAVE_CXX="$CXX"
-SAVE_ASFLAGS="$ASFLAGS"
-SAVE_CFLAGS="$CFLAGS"
-SAVE_CXXFLAGS="$CXXFLAGS"
-SAVE_LDFLAGS="$LDFLAGS"
-SAVE_CXXLDFLAGS="$CXXLDFLAGS"
-CONF_COMMAND="$0 $ac_configure_args"
-AC_SUBST(CONF_COMMAND)
-AC_SUBST(SAVE_CC)
-AC_SUBST(SAVE_CXX)
-AC_SUBST(SAVE_ASFLAGS)
-AC_SUBST(SAVE_CFLAGS)
-AC_SUBST(SAVE_CXXFLAGS)
-AC_SUBST(SAVE_LDFLAGS)
-AC_SUBST(SAVE_CXXLDFLAGS)
-AC_SUBST(CXXLDFLAGS)
-
-#AC_ARG_PROGRAM # Automaticly invoked by AM_INIT_AUTOMAKE
-
-AM_SANITY_CHECK
-# This is needed is SUBDIRS is set
-AC_PROG_MAKE_SET
-
-##############################################################################
-# The below section needs to be done before AC_PROG_CC
-##############################################################################
-
-# Hack for OS X/Darwin and Metrowerks CodeWarrior
-AC_ARG_WITH(darwin-mwcc,
-[ --with-darwin-mwcc Use Metrowerks CodeWarrior wrappers on OS X/Darwin],[
- if [ "with_darwin_mwcc" = yes ] ; then
- builddir=`pwd`
- ccwrapper="$builddir/support-files/MacOSX/mwcc-wrapper"
- arwrapper="$builddir/support-files/MacOSX/mwar-wrapper"
- CC="$ccwrapper"
- CXX="$ccwrapper"
- LD="$ccwrapper"
- AR="$arwrapper"
- RANLIB=:
- export CC CXX LD AR RANLIB
- AC_SUBST(AR)
- AC_SUBST(RANLIB)
- fi
-])
-
-AM_CONDITIONAL(DARWIN_MWCC, test x$with_darwin_mwcc = xyes)
-
-if test "x${CFLAGS-}" = x ; then
- cflags_is_set=no
-else
- cflags_is_set=yes
-fi
-
-if test "x${CPPFLAGS-}" = x ; then
- cppflags_is_set=no
-else
- cppflags_is_set=yes
-fi
-
-if test "x${LDFLAGS-}" = x ; then
- ldflags_is_set=no
-else
- ldflags_is_set=yes
-fi
-
-################ End of section to be done before AC_PROG_CC #################
-
-# The following hack should ensure that configure doesn't add optimizing
-# or debugging flags to CFLAGS or CXXFLAGS
-# C_EXTRA_FLAGS are flags that are automaticly added to both
-# CFLAGS and CXXFLAGS
-CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
-CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
-
-dnl Checks for programs.
-AC_PROG_LIBTOOL
-AC_PROG_AWK
-AC_PROG_CC
-AC_PROG_CXX
-AC_PROG_CPP
-
-# Print version of CC and CXX compiler (if they support --version)
-CC_VERSION=`$CC --version | sed 1q`
-if test $? -eq "0"
-then
- AC_MSG_CHECKING("C Compiler version")
- AC_MSG_RESULT("$CC $CC_VERSION")
-else
-CC_VERSION=""
-fi
-AC_SUBST(CC_VERSION)
-MYSQL_CHECK_CXX_VERSION
-
-# Fix for sgi gcc / sgiCC which tries to emulate gcc
-if test "$CC" = "sgicc"
-then
- ac_cv_prog_gcc="no"
-fi
-if test "$CXX" = "sgi++"
-then
- GXX="no"
-fi
-
-# Still need ranlib for readline; local static use only so no libtool.
-AC_PROG_RANLIB
-# We use libtool
-#AC_LIBTOOL_WIN32_DLL
-AC_PROG_LIBTOOL
-
-# Ensure that we have --preserve-dup-deps defines, otherwise we get link
-# problems of 'mysql' with CXX=g++
-LIBTOOL="$LIBTOOL --preserve-dup-deps"
-AC_SUBST(LIBTOOL)dnl
-
-AC_SUBST(NM)dnl
-
-# NM= "$NM -X64"
-#archive_expsym_cmds= `echo "$archive_expsym_cmds" | sed -e '/"$(CC)"//'`
-#archive_expsym_cmds= "$CC -q64 $archive_expsym_cmds"
-# CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
-
-#AC_LIBTOOL_DLOPEN AC_LIBTOOL_WIN32_DLL AC_DISABLE_FAST_INSTALL AC_DISABLE_SHARED AC_DISABLE_STATIC
-
-# AC_PROG_INSTALL
-AC_PROG_INSTALL
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
-# Not critical since the generated file is distributed
-AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
-
-#check the return type of sprintf
-AC_MSG_CHECKING("return type of sprintf")
-AC_TRY_RUN([
- int main()
- {
- char* s = "hello";
- char buf[6];
- if((int)sprintf(buf, s) == strlen(s))
- return 0;
-
- return -1;
- }
- ],
- [AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
- AC_MSG_RESULT("int")],
- [AC_TRY_RUN([
- int main()
- {
- char* s = "hello";
- char buf[6];
- if((char*)sprintf(buf,s) == buf + strlen(s))
- return 0;
- return -1;
- } ],
- [AC_DEFINE(SPRINTF_RETURNS_PTR, [1], [Broken sprintf])
- AC_MSG_RESULT("ptr")],
- [AC_DEFINE(SPRINTF_RETURNS_GARBAGE, [1], [Broken sprintf])
- 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)
-
-# We should go through this and put all the explictly system dependent
-# stuff in one place
-AC_MSG_CHECKING(operating system)
-AC_CACHE_VAL(mysql_cv_sys_os,
-[
-if test "$uname_prog" != "no"; then
- mysql_cv_sys_os="`uname`"
-else
- mysql_cv_sys_os="Not Solaris"
-fi
-])
-AC_MSG_RESULT($mysql_cv_sys_os)
-
-# This should be rewritten to use $target_os
-case "$target_os" in
- sco3.2v5*)
- CFLAGS="$CFLAGS -DSCO"
- CXXFLAGS="$CXXFLAGS -DSCO"
- LD='$(CC) $(CFLAGS)'
- case "$CFLAGS" in
- *-belf*)
- AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[
- case "$LDFLAGS" in
- *-belf*) ;;
- *) AC_MSG_WARN([Adding -belf option to ldflags.])
- LDFLAGS="$LDFLAGS -belf"
- ;;
- esac
- ])
- ;;
- *)
- AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[
- case "$LDFLAGS" in
- *-belf*) ;;
- *)
- AC_MSG_WARN([Adding -belf option to ldflags.])
- LDFLAGS="$LDFLAGS -belf"
- ;;
- esac
- ])
- ;;
- esac
- ;;
- sysv5UnixWare* | sysv5OpenUNIX8*)
- if test "$GCC" != "yes"; then
- # Use the built-in alloca()
- CFLAGS="$CFLAGS -Kalloca"
- fi
- CXXFLAGS="$CXXFLAGS -DNO_CPLUSPLUS_ALLOCA"
- ;;
- sysv5SCO_SV6.0.0*)
- if test "$GCC" != "yes"; then
- # Use the built-in alloca()
- CFLAGS="$CFLAGS -Kalloca"
- CXXFLAGS="$CFLAGS -Kalloca"
- # Use no_implicit for templates
- CXXFLAGS="$CXXFLAGS -Tno_implicit"
- AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
- [1], [Defined by configure. Use explicit template instantiation.])
- fi
- ;;
-esac
-
-# The following is required for portable results of floating point calculations
-# on PowerPC. The same must also be done for IA-64, but this options is missing
-# in the IA-64 gcc backend.
-
-if test "$GCC" = "yes"
-then
- case "$host_cpu" in
- *ppc* | *powerpc*)
- CFLAGS="$CFLAGS -mno-fused-madd"
- CXXFLAGS="$CXXFLAGS -mno-fused-madd"
- ;;
- esac
-fi
-
-AC_SUBST(CC)
-AC_SUBST(CFLAGS)
-AC_SUBST(CXX)
-AC_SUBST(CXXFLAGS)
-AC_SUBST(ASFLAGS)
-AC_SUBST(LD)
-AC_SUBST(INSTALL_SCRIPT)
-
-export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS
-
-if test "$GCC" = "yes"
-then
- # mysqld requires -fno-implicit-templates.
- # Disable exceptions as they seem to create problems with gcc and threads.
- # mysqld doesn't use run-time-type-checking, so we disable it.
- # We should use -Wno-invalid-offsetof flag to disable some warnings from gcc
- # regarding offset() usage in C++ which are done in a safe manner in the
- # server
- CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
- AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
- [1], [Defined by configure. Use explicit template instantiation.])
-fi
-
-MYSQL_PROG_AR
-
-# libmysqlclient versioning when linked with GNU ld.
-if $LD --version 2>/dev/null| grep GNU >/dev/null 2>&1; then
- LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libmysql/libmysql.ver"
- AC_CONFIG_FILES(libmysql/libmysql.ver)
-fi
-AC_SUBST(LD_VERSION_SCRIPT)
-
-
-# Avoid bug in fcntl on some versions of linux
-AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os])
-# Any variation of Linux
-if expr "$target_os" : "[[Ll]]inux.*" > /dev/null
-then
- MYSQLD_DEFAULT_SWITCHES="--skip-external-locking"
- TARGET_LINUX="true"
- AC_MSG_RESULT([yes])
- AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
-else
- MYSQLD_DEFAULT_SWITCHES=""
- TARGET_LINUX="false"
- AC_MSG_RESULT([no])
-fi
-AC_SUBST(MYSQLD_DEFAULT_SWITCHES)
-AC_SUBST(TARGET_LINUX)
-
-dnl Find paths to some shell programs
-AC_PATH_PROG(LN, ln, ln)
-# This must be able to take a -f flag like normal unix ln.
-AC_PATH_PROG(LN_CP_F, ln, ln)
-# If ln -f does not exists use -s (AFS systems)
-if test -n "$LN_CP_F"; then
- LN_CP_F="$LN_CP_F -s"
-fi
-
-AC_PATH_PROG(MV, mv, mv)
-AC_PATH_PROG(RM, rm, rm)
-AC_PATH_PROG(CP, cp, cp)
-AC_PATH_PROG(SED, sed, sed)
-AC_PATH_PROG(CMP, cmp, cmp)
-AC_PATH_PROG(CHMOD, chmod, chmod)
-AC_PATH_PROG(HOSTNAME, hostname, hostname)
-AC_PATH_PROG(DIFF, diff, diff)
-# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
-# fall back to 'tar' otherwise and hope that it's a GNU tar as well
-AC_CHECK_PROGS(TAR, gnutar gtar tar)
-
-dnl We use a path for perl so the script startup works
-dnl We make sure to use perl, not perl5, in hopes that the RPMs will
-dnl not depend on the perl5 binary being installed (probably a bug in RPM)
-AC_PATH_PROG(PERL, perl, no)
-if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1
-then
- PERL5=$PERL
-else
- AC_PATH_PROG(PERL5, perl5, no)
- if test "$PERL5" != no
- then
- PERL=$PERL5
- ac_cv_path_PERL=$ac_cv_path_PERL5
- fi
-fi
-
-AC_SUBST(HOSTNAME)
-AC_SUBST(PERL)
-AC_SUBST(PERL5)
-
-# Enable the abi_check rule only if gcc is available
-
-if test "$GCC" != "yes" || expr "$CC" : ".*icc.*"
-then
- ABI_CHECK=""
-else
- ABI_CHECK="abi_check"
-fi
-
-AC_SUBST(ABI_CHECK)
-
-# Look for PS usage. We use double dollar-signs in FIND_PROC because this
-# value is written to a makefile, which interprets away one level of
-# dollar-signs. So, interpretation stages are m4 and then shell in autoconf,
-# then Make, then shell. The autoconf substitution uses single quotes, so
-# no unprotected single quotes should appear in the expression.
-AC_PATH_PROG(PS, ps, ps)
-AC_MSG_CHECKING("how to check if pid exists")
-PS=$ac_cv_path_PS
-# Linux style
-if $PS wwwp $$ 2> /dev/null | grep -- "$0" > /dev/null
-then
- FIND_PROC="$PS wwwp \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
-# Solaris
-elif $PS -fp $$ 2> /dev/null | grep -- $0 > /dev/null
-then
- FIND_PROC="$PS -p \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
-# BSD style
-elif $PS -uaxww 2> /dev/null | grep -- $0 > /dev/null
-then
- FIND_PROC="$PS -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
-# SysV style
-elif $PS -ef 2> /dev/null | grep -- $0 > /dev/null
-then
- FIND_PROC="$PS -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
-# Do anybody use this?
-elif $PS $$ 2> /dev/null | grep -- $0 > /dev/null
-then
- FIND_PROC="$PS \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
-else
- case $SYSTEM_TYPE in
- *freebsd*|*dragonfly*)
- FIND_PROC="$PS p \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
- ;;
- *darwin*)
- FIND_PROC="$PS -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
- ;;
- *cygwin*)
- FIND_PROC="$PS -e | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
- ;;
- *)
- AC_MSG_ERROR([Could not find the right ps and/or grep switches. Which OS is this? See the Installation chapter in the Reference Manual.])
- esac
-fi
-AC_SUBST(FIND_PROC)
-AC_MSG_RESULT("$FIND_PROC")
-
-# Check if a pid is valid
-AC_PATH_PROG(KILL, kill, kill)
-AC_MSG_CHECKING("for kill switches")
-if $ac_cv_path_KILL -0 $$
-then
- CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
-elif kill -s 0 $$
-then
- CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
-else
- AC_MSG_WARN([kill -0 to check for pid seems to fail])
- CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
-fi
-AC_SUBST(CHECK_PID)
-AC_MSG_RESULT("$CHECK_PID")
-
-# We need an ANSI C compiler
-AM_PROG_CC_STDC
-
-# We need an assembler, too
-AM_PROG_AS
-CCASFLAGS="$CCASFLAGS $ASFLAGS"
-
-# Check if we need noexec stack for assembler
-AC_CHECK_NOEXECSTACK
-
-if test "$am_cv_prog_cc_stdc" = "no"
-then
- AC_MSG_ERROR([MySQL requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
-fi
-
-NOINST_LDFLAGS="-static"
-
-static_nss=""
-STATIC_NSS_FLAGS=""
-OTHER_LIBC_LIB=""
-AC_ARG_WITH(other-libc,
- [ --with-other-libc=DIR Link against libc and other standard libraries
- installed in the specified non-standard location
- overriding default. Originally added to be able to
- link against glibc 2.2 without making the user
- upgrade the standard libc installation.],
- [
- other_libc_include="$withval/include"
- other_libc_lib="$withval/lib"
- with_other_libc="yes"
- enable_shared="no"
- all_is_static="yes"
- CFLAGS="$CFLAGS -I$other_libc_include"
- # There seems to be a feature in gcc that treats system and libc headers
- # silently when they violatate ANSI C++ standard, but it is strict otherwise
- # since gcc cannot now recognize that our headers are libc, we work around
- # by telling it to be permissive. Note that this option only works with
- # new versions of gcc (2.95.x and above)
- CXXFLAGS="$CXXFLAGS -fpermissive -I$other_libc_include"
- if test -f "$other_libc_lib/libnss_files.a"
- then
- # libc has been compiled with --enable-static-nss
- # we need special flags, but we will have to add those later
- STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv"
- STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS"
- OTHER_LIBC_LIB="-static -L$other_libc_lib"
- static_nss=1
- else
- # this is a dirty hack. We if we detect static nss glibc in the special
- # location, we do not re-direct the linker to get libraries from there
- # during check. The reason is that if we did, we would have to find a
- # way to append the special static nss flags to LIBS every time we do
- # any check - this is definitely feasible, but not worthwhile the risk
- # of breaking other things. So for our purposes it would be sufficient
- # to assume that whoever is using static NSS knows what he is doing and
- # has sensible libraries in the regular location
- LDFLAGS="$LDFLAGS -static -L$other_libc_lib "
- fi
-
- # When linking against custom libc installed separately, we want to force
- # all binary builds to be static, including the build done by configure
- # itself to test for system features.
- with_mysqld_ldflags="-all-static"
- with_client_ldflags="-all-static"
- NOINST_LDFLAGS="-all-static"
- ],
- [
- other_libc_include=
- other_libc_lib=
- with_other_libc="no"
- ]
-)
-AC_SUBST(NOINST_LDFLAGS)
-
-#
-# Check if we are using Linux and a glibc compiled with static nss
-# (this is true on the MySQL build machines to avoid NSS problems)
-#
-AC_CHECK_TOOL([NM], [nm])
-
-if test "$TARGET_LINUX" = "true" -a "$static_nss" = ""
-then
- tmp=`$NM ${other_libc_lib:-/usr/lib*}/libc.a 2>&1 | grep _nss_files_getaliasent_r1`
- if test -n "$tmp"
- then
- STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv"
- STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS"
- static_nss=1
- fi
-fi
-
-AC_ARG_WITH(server-suffix,
- [ --with-server-suffix Append value to the version string.],
- [ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
- [ MYSQL_SERVER_SUFFIX= ]
- )
-AC_SUBST(MYSQL_SERVER_SUFFIX)
-
-# Set flags if we want to force to use pthreads
-AC_ARG_WITH(pthread,
- [ --with-pthread Force use of pthread library.],
- [ with_pthread=$withval ],
- [ with_pthread=no ]
- )
-
-# Force use of thread libs LIBS
-AC_ARG_WITH(named-thread-libs,
- [ --with-named-thread-libs=ARG
- Use specified thread libraries instead of
- those automatically found by configure.],
- [ with_named_thread=$withval ],
- [ with_named_thread=no ]
- )
-
-# Force use of a curses libs
-AC_ARG_WITH(named-curses-libs,
- [ --with-named-curses-libs=ARG
- Use specified curses libraries instead of
- those automatically found by configure.],
- [ with_named_curses=$withval ],
- [ with_named_curses=no ]
- )
-
-# Make thread safe client
-AC_ARG_ENABLE(thread-safe-client,
- [ --disable-thread-safe-client
- Compile the client without threads.],
- [ THREAD_SAFE_CLIENT=$enableval ],
- [ THREAD_SAFE_CLIENT=yes ]
- )
-
-# compile with strings functions in assembler
-AC_ARG_ENABLE(assembler,
- [ --enable-assembler Use assembler versions of some string
- functions if available.],
- [ ENABLE_ASSEMBLER=$enableval ],
- [ ENABLE_ASSEMBLER=no ]
- )
-
-AC_MSG_CHECKING(if we should use assembler functions)
-# For now we only support assembler on i386 and sparc systems
-AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $CCAS $CCASFLAGS -c strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
-AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "")
-
-if test "$ASSEMBLER_TRUE" = ""
-then
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-
-# Add query profiler
-AC_MSG_CHECKING(if SHOW PROFILE should be enabled.)
-AC_ARG_ENABLE(profiling,
- AS_HELP_STRING([--enable-profiling], [Enable profiling of query lifetime.]),
- [ ENABLED_PROFILING=$enableval ],
- [ ENABLED_PROFILING=no ])
-
-AC_DEFINE([ENABLED_PROFILING], [1], [If SHOW PROFILE should be enabled])
-if test "$ENABLED_PROFILING" = "yes"
-then
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-
-# Use this to set the place used for unix socket used to local communication.
-AC_ARG_WITH(unix-socket-path,
- [ --with-unix-socket-path=SOCKET
- Where to put the unix-domain socket. SOCKET must be
- an absolute file name.],
- [ MYSQL_UNIX_ADDR=$withval ],
- [ MYSQL_UNIX_ADDR=$MYSQL_UNIX_ADDR_DEFAULT ]
- )
-AC_SUBST(MYSQL_UNIX_ADDR)
-
-AC_ARG_WITH(tcp-port,
- [ --with-tcp-port=port-number
- Which port to use for MySQL services (default 3306)],
- [ MYSQL_TCP_PORT=$withval ],
- [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT
- # if we actually defaulted (as opposed to the pathological case of
- # --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
- # happen if whole batch of servers was built from a script), set
- # the default to zero to indicate that; we don't lose information
- # that way, because 0 obviously indicates that we can get the
- # default value from MYSQL_TCP_PORT. this seems really evil, but
- # testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
- # a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
- # intend it to mean "use the default, in fact, look up a good default
- # from /etc/services if you can", but really, really meant 3306 when
- # they passed in 3306. When they pass in a specific value, let them
- # have it; don't second guess user and think we know better, this will
- # just make people cross. this makes the the logic work like this
- # (which is complicated enough):
- #
- # - if a port was set during build, use that as a default.
- #
- # - otherwise, try to look up a port in /etc/services; if that fails,
- # use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306)
- #
- # - allow the MYSQL_TCP_PORT environment variable to override that.
- #
- # - allow command-line parameters to override all of the above.
- #
- # the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js,
- # so don't mess with that.
- MYSQL_TCP_PORT_DEFAULT=0 ]
- )
-AC_SUBST(MYSQL_TCP_PORT)
-# We might want to document the assigned port in the manual.
-AC_SUBST(MYSQL_TCP_PORT_DEFAULT)
-
-# Use this to set the place used for unix socket used to local communication.
-AC_ARG_WITH(mysqld-user,
- [ --with-mysqld-user=username
- What user the mysqld daemon shall be run as.],
- [ MYSQLD_USER=$withval ],
- [ MYSQLD_USER=mysql ]
- )
-AC_SUBST(MYSQLD_USER)
-
-# If we should allow LOAD DATA LOCAL
-AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default)
-AC_ARG_ENABLE(local-infile,
- [ --enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled)],
- [ ENABLED_LOCAL_INFILE=$enableval ],
- [ ENABLED_LOCAL_INFILE=no ]
- )
-if test "$ENABLED_LOCAL_INFILE" = "yes"
-then
- AC_MSG_RESULT([yes])
- AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
- [If LOAD DATA LOCAL INFILE should be enabled by default])
-else
- AC_MSG_RESULT([no])
-fi
-
-# If we should allow init-file, skip-grant-table and bootstrap options
-AC_MSG_CHECKING(If we should should enable init-file, skip-grant-table options and bootstrap)
-AC_ARG_ENABLE(grant-options,
- [ --disable-grant-options Disables the use of --init-file, --skip-grant-tables and --bootstrap options],
- [ mysql_grant_options_enabled=$enableval ],
- [ mysql_grant_options_enabled=yes ]
- )
-if test "$mysql_grant_options_enabled" = "yes"
-then
- AC_MSG_RESULT([yes])
-else
- AC_DEFINE([DISABLE_GRANT_OPTIONS], [1],
- [Disables the use of --init-file, --skip-grant-tables and --bootstrap options])
- AC_MSG_RESULT([no])
-fi
-
-MYSQL_SYS_LARGEFILE
-
-# Types that must be checked AFTER large file support is checked
-AC_TYPE_SIZE_T
-
-#--------------------------------------------------------------------
-# Check for system header files
-#--------------------------------------------------------------------
-
-AC_HEADER_DIRENT
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h fpu_control.h \
- ieeefp.h limits.h memory.h pwd.h select.h poll.h fnmatch.h \
- stdlib.h stddef.h sys/stat.h \
- strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.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/prctl.h sys/resource.h sys/param.h port.h ieeefp.h linux/unistd.h \
- execinfo.h)
-
-AC_CHECK_HEADERS([xfs/xfs.h])
-
-#--------------------------------------------------------------------
-# Check for system libraries. Adds the library to $LIBS
-# and defines HAVE_LIBM etc
-#--------------------------------------------------------------------
-
-AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
-AC_CHECK_FUNCS(log2)
-
-AC_CHECK_LIB(nsl_r, gethostbyname_r, [],
- AC_CHECK_LIB(nsl, gethostbyname_r))
-AC_CHECK_FUNC(gethostbyname_r)
-
-AC_SEARCH_LIBS(setsockopt, socket)
-# This may get things to compile even if bind-8 is installed
-AC_SEARCH_LIBS(bind, bind)
-# Check if crypt() exists in libc or libcrypt, sets LIBS if needed
-AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
-# See if we need a library for address lookup.
-AC_SEARCH_LIBS(inet_aton, [socket nsl resolv])
-
-# For the sched_yield() function on Solaris
-AC_SEARCH_LIBS(sched_yield, posix4,
- AC_DEFINE(HAVE_SCHED_YIELD, 1, [sched_yield]))
-
-MYSQL_CHECK_ZLIB_WITH_COMPRESS
-
-# For large pages support
-if test "$TARGET_LINUX" = "true"
-then
- # For SHM_HUGETLB on Linux
- AC_CHECK_DECLS(SHM_HUGETLB,
- AC_DEFINE([HAVE_LARGE_PAGES], [1],
- [Define if you have large pages support])
- AC_DEFINE([HAVE_LARGE_PAGE_OPTION], [1],
- [Define if you have large page option])
- AC_DEFINE([HUGETLB_USE_PROC_MEMINFO], [1],
- [Define if /proc/meminfo shows the huge page size (Linux only)])
- , ,
- [
-#include <sys/shm.h>
- ]
- )
-else
-# For large pages support on Solaris
-AC_CHECK_DECLS(MHA_MAPSIZE_VA,
- AC_DEFINE([HAVE_SOLARIS_LARGE_PAGES], [1],
- [Define to 1 if you have large pages support])
- AC_DEFINE([HAVE_LARGE_PAGE_OPTION], [1],
- [Define if you have large page option])
- , ,
- [
-#include <sys/mman.h>
- ]
-)
-fi
-
-dnl Use of ALARMs to wakeup on timeout on sockets
-dnl
-dnl This feature makes use of a mutex and is a scalability hog we
-dnl try to avoid using. However we need support for SO_SNDTIMEO and
-dnl SO_RCVTIMEO socket options for this to work. So we will check
-dnl if this feature is supported by a simple AC_RUN_IFELSE macro. However
-dnl on some OS's there is support for setting those variables but
-dnl they are silently ignored. For those OS's we will not attempt
-dnl o use SO_SNDTIMEO and SO_RCVTIMEO even if it is said to work.
-dnl See Bug#29093 for the problem with SO_SND/RCVTIMEO on HP/UX.
-dnl To use alarm is simple, simply avoid setting anything.
-
-
-AC_CACHE_CHECK([whether SO_SNDTIMEO and SO_RCVTIMEO work],
- [mysql_cv_socket_timeout],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM([[
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/time.h>
- ]],[[
- int fd = socket(AF_INET, SOCK_STREAM, 0);
- struct timeval tv;
- int ret= 0;
- tv.tv_sec= 2;
- tv.tv_usec= 0;
- ret|= setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
- ret|= setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
- return !!ret;
- ]])],
- [mysql_cv_socket_timeout=yes],
- [mysql_cv_socket_timeout=no],
- [mysql_cv_socket_timeout=no
- AC_MSG_WARN([Socket timeout options disabled due to cross-compiling])])
- ])
-
-use_alarm=yes
-
-if test "$mysql_cv_socket_timeout" = yes; then
- case $SYSTEM_TYPE in
- dnl We trust the result from the following systems
- *solaris*) use_alarm=no ;;
- *freebsd*) use_alarm=no ;;
- *darwin*) use_alarm=no ;;
- *)
- dnl We trust the result from Linux also
- if test "$TARGET_LINUX" = "true"; then
- use_alarm=no
- fi
- dnl We trust no one else for the moment
- dnl (Windows is hardcoded to not use alarms)
- ;;
- esac
-fi
-
-AC_ARG_WITH(alarm,
- AS_HELP_STRING([--with-alarm], [Use alarm to implement socket timeout.]),
- [use_alarm=$withval], [])
-
-AC_MSG_CHECKING(whether to use alarms to implement socket timeout)
-if test "$use_alarm" = no ; then
- AC_DEFINE([NO_ALARM], [1], [No need to use alarm for socket timeout])
- AC_DEFINE([SIGNAL_WITH_VIO_CLOSE], [1], [Need to use vio close for kill connection])
-fi
-AC_MSG_RESULT($use_alarm)
-
-#--------------------------------------------------------------------
-# Check for IPv6 support
-#--------------------------------------------------------------------
-
-AC_CHECK_HEADERS(netinet/in6.h)
-
-AC_CHECK_TYPES([struct sockaddr_in6, struct in6_addr],
- [have_in6_types=yes],
- [have_in6_types=no],
- [[
- #ifdef WIN32
- #include <winsock2.h>
- #else
- #include <sys/types.h>
- #include <netinet/in.h>
- #include <sys/socket.h>
- #endif
-
- #ifdef HAVE_NETINET_IN6_H
- #include <netinet/in6.h>
- #endif
- ]])
-
-AC_MSG_CHECKING([for IPv6 support])
-
-AC_ARG_ENABLE(ipv6,
- AS_HELP_STRING([--disable-ipv6], [Disable support for IPv6 networking]),
- [disable_ipv6=yes], [disable_ipv6=no])
-
-if test x"$disable_ipv6" = xyes -o x"$have_in6_types" = xno; then
- AC_MSG_RESULT([no])
-else
- AC_DEFINE([HAVE_IPV6], [1], [Define if IPv6 networking support is present])
- AC_MSG_RESULT([yes])
-fi
-
-#--------------------------------------------------------------------------
-# Check if struct sockaddr_in::sin_len is available
-#--------------------------------------------------------------------------
-
-AC_CACHE_CHECK(
- [if sockaddr_in::sin_len is available],
- mysql_cv_have_sockaddr_in_sin_len,
- AC_TRY_COMPILE(
- [
- #ifdef WIN32
- #include <winsock2.h>
- #else
- #include <sys/types.h>
- #include <netinet/in.h>
- #include <sys/socket.h>
- #endif
- ],
- [unsigned int i = sizeof(((struct sockaddr_in *) 0)->sin_len)],
- mysql_cv_have_sockaddr_in_sin_len=yes,
- mysql_cv_have_sockaddr_in_sin_len=no))
-
-if test "$mysql_cv_have_sockaddr_in_sin_len" = "yes"; then
- AC_DEFINE(
- [HAVE_SOCKADDR_IN_SIN_LEN],
- [1],
- [If sockaddr_in::sin_len is available])
-fi
-
-#--------------------------------------------------------------------------
-# Check if struct sockaddr_in6::sin6_len is available
-#--------------------------------------------------------------------------
-
-AC_CACHE_CHECK(
- [if sockaddr_in6::sin6_len is available],
- mysql_cv_have_sockaddr_in6_sin6_len,
- AC_TRY_COMPILE(
- [
- #ifdef WIN32
- #include <winsock2.h>
- #else
- #include <sys/types.h>
- #include <netinet/in.h>
- #include <sys/socket.h>
- #endif
-
- #ifdef HAVE_NETINET_IN6_H
- #include <netinet/in6.h>
- #endif
- ],
- [unsigned int i = sizeof(((struct sockaddr_in6 *) 0)->sin6_len)],
- mysql_cv_have_sockaddr_in6_sin6_len=yes,
- mysql_cv_have_sockaddr_in6_sin6_len=no))
-
-if test "$mysql_cv_have_sockaddr_in_sin6_len" = "yes"; then
- AC_DEFINE(
- [HAVE_SOCKADDR_IN6_SIN6_LEN],
- [1],
- [If sockaddr_in6::sin6_len is available])
-fi
-
-#--------------------------------------------------------------------
-# Check for TCP wrapper support
-#--------------------------------------------------------------------
-
-AC_ARG_WITH(libwrap,
-[ --with-libwrap[=DIR] Compile in libwrap (tcp_wrappers) support],[
- case "$with_libwrap" in
- no) : ;;
- yes|*)
- _cppflags=${CPPFLAGS}
- _ldflags=${LDFLAGS}
-
- if test "$with_libwrap" != "yes"; then
- CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include"
- LDFLAGS="${LDFLAGS} -L$with_libwrap/lib"
- fi
-
- _libs=${LIBS}
- AC_CHECK_HEADER(tcpd.h,
- LIBS="-lwrap $LIBS"
- AC_MSG_CHECKING(for TCP wrappers library -lwrap)
- AC_TRY_LINK([#include <tcpd.h>
-int allow_severity = 0;
-int deny_severity = 0;
-
-struct request_info *req;
-],[hosts_access (req)],
- AC_MSG_RESULT(yes)
- AC_DEFINE([LIBWRAP], [1], [Define if you have -lwrap])
- AC_DEFINE([HAVE_LIBWRAP], [1], [Define if have -lwrap])
- if test "$with_libwrap" != "yes"; then
- WRAPLIBS="-L${with_libwrap}/lib"
- fi
- WRAPLIBS="${WRAPLIBS} -lwrap",
- AC_MSG_RESULT(no)
- CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
- CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
- LDFLAGS=${_ldflags} LIBS=${_libs}
- ;;
- esac
-])
-AC_SUBST(WRAPLIBS)
-
-if test "$TARGET_LINUX" = "true"; then
- AC_ARG_WITH(pstack,
- [ --with-pstack Use the pstack backtrace library],
- [ USE_PSTACK=$withval ],
- [ USE_PSTACK=no ])
- pstack_libs=
- pstack_dir=
- if test "$USE_PSTACK" = yes -a "$TARGET_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386"
- then
- have_libiberty= have_libbfd=
- my_save_LIBS="$LIBS"
-dnl I have no idea if this is a good test - can not find docs for libiberty
- AC_CHECK_LIB([iberty], [fdmatch],
- [have_libiberty=yes
- AC_CHECK_LIB([bfd], [bfd_openr], [have_libbfd=yes], , [-liberty])])
- LIBS="$my_save_LIBS"
-
- if test x"$have_libiberty" = xyes -a x"$have_libbfd" = xyes
- then
- 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_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....
-dnl AC_CHECK_HEADER(libiberty.h,
-dnl have_libiberty_h=yes,
-dnl have_libiberty_h=no)
- else
- USE_PSTACK="no"
- fi
- else
- USE_PSTACK="no"
- fi
-fi
-AC_MSG_CHECKING([if we should use pstack])
-AC_MSG_RESULT([$USE_PSTACK])
-
-# Check for gtty if termio.h doesn't exists
-if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
-then
- AC_SEARCH_LIBS(gtty, compat)
-fi
-
-# We make a special variable for non-threaded version of LIBS to avoid
-# including thread libs into non-threaded version of MySQL client library.
-# Later in this script LIBS will be augmented with a threads library.
-NON_THREADED_LIBS="$LIBS"
-
-AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
- uchar, uint, ulong],[],[], [
-#include <sys/types.h>
-])
-AC_CHECK_TYPES([fp_except], [], [], [
-#include <sys/types.h>
-#include <ieeefp.h>
-])
-
-#
-# Some system specific hacks
-#
-
-MAX_C_OPTIMIZE="-O3"
-MAX_CXX_OPTIMIZE="-O3"
-
-case $SYSTEM_TYPE in
- *solaris2.7*)
- # Solaris 2.7 has a broken /usr/include/widec.h
- # Make a fixed copy in ./include
- AC_MSG_WARN([Fixing broken include files for $SYSTEM_TYPE])
- echo " - Creating local copy of widec.h"
- if test ! -d include
- then
- mkdir ./include
- fi
- builddir=`pwd`
- sed -e "s|^#if[ ]*!defined(lint) && !defined(__lint)|#if !defined\(lint\) \&\& !defined\(__lint\) \&\& !defined\(getwc\)|" < /usr/include/widec.h > include/widec.h
- CFLAGS="$CFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
- CXXFLAGS="$CXXFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
- ;;
- *solaris2.8*)
- # Solaris 2.8 has a broken /usr/include/widec.h
- # Make a fixed copy in ./include
- AC_MSG_WARN([Fixing broken include files for $SYSTEM_TYPE])
- echo " - Creating local copy of widec.h"
- if test ! -d include
- then
- mkdir ./include
- fi
- builddir=`pwd`
- sed -e "s|^#if[ ]*!defined(__lint)|#if !defined\(__lint\) \&\& !defined\(getwc\)|" < /usr/include/widec.h > include/widec.h
- CFLAGS="$CFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
- CXXFLAGS="$CXXFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
- ;;
- *solaris2.5.1*)
- AC_MSG_WARN([Enabling getpass() workaround for Solaris 2.5.1])
- CFLAGS="$CFLAGS -DHAVE_BROKEN_GETPASS -DSOLARIS -DHAVE_RWLOCK_T";
- CXXFLAGS="$CXXFLAGS -DHAVE_RWLOCK_T -DSOLARIS"
- ;;
- *solaris*)
- CFLAGS="$CFLAGS -DHAVE_RWLOCK_T"
- CXXFLAGS="$CXXFLAGS -DHAVE_RWLOCK_T"
- ;;
- *SunOS*)
- AC_MSG_WARN([Enabling getpass() workaround for SunOS])
- CFLAGS="$CFLAGS -DHAVE_BROKEN_GETPASS -DSOLARIS";
- ;;
- *hpux10.20*)
- AC_MSG_WARN([Enabling workarounds for hpux 10.20])
- CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX10 -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX"
- CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX10 -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX"
- if test "$with_named_thread" = "no"
- then
- AC_MSG_WARN([Using --with-named-thread=-lpthread])
- with_named_thread="-lcma"
- fi
- ;;
- *hpux11.*)
- AC_MSG_WARN([Enabling workarounds for hpux 11])
- CFLAGS="$CFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
- CXXFLAGS="$CXXFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT"
- if test "$with_named_thread" = "no"
- then
- AC_MSG_WARN([Using --with-named-thread=-lpthread])
- with_named_thread="-lpthread"
- fi
- # Fixes for HPUX 11.0 compiler
- if test "$ac_cv_prog_gcc" = "no"
- then
-# set working flags first in line, letting override it (i. e. for debug):
- CXXFLAGS="+O2 $CXXFLAGS"
- MAX_C_OPTIMIZE=""
- MAX_CXX_OPTIMIZE=""
- ndb_cxxflags_fix="$ndb_cxxflags_fix -Aa"
- fi
- ;;
- *rhapsody*)
- if test "$ac_cv_prog_gcc" = "yes"
- then
- CPPFLAGS="$CPPFLAGS -traditional-cpp "
- CFLAGS="-DHAVE_CTHREADS_WRAPPER -DDO_NOT_REMOVE_THREAD_WRAPPERS"
- CXXFLAGS="-DHAVE_CTHREADS_WRAPPER"
- if test $with_named_curses = "no"
- then
- with_named_curses=""
- fi
- fi
- ;;
- *darwin5*)
- if test "$ac_cv_prog_gcc" = "yes"
- then
- FLAGS="-traditional-cpp -DHAVE_DARWIN5_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
- CFLAGS="$CFLAGS $FLAGS"
- CXXFLAGS="$CXXFLAGS $FLAGS"
- MAX_C_OPTIMIZE="-O"
- with_named_curses=""
- fi
- ;;
- *darwin6*)
- if test "$ac_cv_prog_gcc" = "yes"
- then
- FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH -DDONT_DECLARE_CXA_PURE_VIRTUAL "
- CFLAGS="$CFLAGS $FLAGS"
- CXXFLAGS="$CXXFLAGS $FLAGS"
- MAX_C_OPTIMIZE="-O"
- fi
- ;;
- *darwin*)
- if test "$ac_cv_prog_gcc" = "yes"
- then
- FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL"
- CFLAGS="$CFLAGS $FLAGS"
- CXXFLAGS="$CXXFLAGS $FLAGS"
- MAX_C_OPTIMIZE="-O"
- fi
- ;;
- *freebsd*|*dragonfly*)
- dnl These dependencies have not really been checked for some time
- OSVERSION=`sysctl -a | grep osreldate | awk '{ print $2 }'`
- if test "$OSVERSION" -gt "600000"
- then
- # Post user-level threads, MYSQLD_NET_RETRY_COUNT is not needed any more
- :
- elif test "$OSVERSION" -gt "480100" && \
- test "$OSVERSION" -lt "500000" || \
- test "$OSVERSION" -gt "500109"
- then
- AC_MSG_WARN([Adding fix for interrupted reads])
- CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000"
- else
- AC_MSG_WARN([Adding fix for interrupted reads and broken realpath])
- CFLAGS="$CFLAGS -DHAVE_BROKEN_REALPATH"
- CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000 -DHAVE_BROKEN_REALPATH"
- fi
- ;;
- *netbsd*)
- AC_MSG_WARN([Adding flag -Dunix])
- CFLAGS="$CFLAGS -Dunix"
- CXXFLAGS="$CXXFLAGS -Dunix"
- OVERRIDE_MT_LD_ADD="\$(top_srcdir)/mit-pthreads/obj/libpthread.a"
- ;;
- *bsdi*)
- AC_MSG_WARN([Adding fix for BSDI])
- CFLAGS="$CFLAGS -D__BSD__ -DHAVE_BROKEN_REALPATH"
- AC_DEFINE_UNQUOTED([SOCKOPT_OPTLEN_TYPE], [size_t],
- [Last argument to get/setsockopt])
- ;;
- *sgi-irix6*)
- if test "$with_named_thread" = "no"
- then
- AC_MSG_WARN([Using --with-named-thread=-lpthread])
- with_named_thread="-lpthread"
- fi
- CXXFLAGS="$CXXFLAGS -D_BOOL"
- ;;
- *aix4.3*)
- AC_MSG_WARN([Adding defines for AIX])
- CFLAGS="$CFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS -DSIGNALS_DONT_BREAK_READ"
- CXXFLAGS="$CXXFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS -DSIGNALS_DONT_BREAK_READ"
- ;;
-dnl Is this the right match for DEC OSF on alpha?
- *dec-osf*)
- if test "$ac_cv_prog_gcc" = "yes" && test "$host_cpu" = "alpha"
- then
- AC_MSG_WARN([Adding defines for DEC OSF on alpha])
- CFLAGS="$CFLAGS -mieee"
- CXXFLAGS="$CXXFLAGS -mieee"
- fi
- AC_MSG_WARN([Adding defines for OSF1])
- # gethostbyname_r is deprecated and doesn't work ok on OSF1
- CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC"
- CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC"
- # fix to handle include of <stdint.h> correctly on OSF1 with cxx compiler
- CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk"
- ;;
-esac
-
-
-#---START: Used in for client configure
-# Check if we threads are in libc or if we should use
-# -lpthread, -lpthreads or mit-pthreads
-# We have to check libc last because else it fails on Solaris 2.6
-
-with_posix_threads="no"
-# Search thread lib on Linux
-if test "$with_named_thread" = "no"
-then
- AC_MSG_CHECKING("Linux threads")
- if test "$TARGET_LINUX" = "true"
- then
- AC_MSG_RESULT("starting")
- # use getconf to check glibc contents
- AC_MSG_CHECKING("getconf GNU_LIBPTHREAD_VERSION")
- case `getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` in
- NPTL* )
- AC_MSG_RESULT("NPTL")
- AC_DEFINE([HAVE_NPTL], [1], [NPTL threads implementation])
- with_named_thread="-lpthread"
- ;;
- LINUXTHREADS* )
- AC_MSG_RESULT("Linuxthreads")
- AC_DEFINE([HAVE_LINUXTHREADS], [1],
- [Whether we are using Xavier Leroy's LinuxThreads])
- with_named_thread="-lpthread"
- ;;
- * )
- AC_MSG_RESULT("unknown")
- ;;
- esac
- if test "$with_named_thread" = "no"
- then
- # old method, check headers
- # Look for LinuxThreads.
- AC_MSG_CHECKING("LinuxThreads in header file comment")
- res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
- if test "$res" -gt 0
- then
- AC_MSG_RESULT("Found")
- AC_DEFINE([HAVE_LINUXTHREADS], [1],
- [Whether we are using Xavier Leroy's LinuxThreads])
- # Linux 2.0 sanity check
- AC_TRY_COMPILE([#include <sched.h>], [int a = sched_get_priority_min(1);], ,
- AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual]))
- # RedHat 5.0 does not work with dynamic linking of this. -static also
- # gives a speed increase in linux so it does not hurt on other systems.
- with_named_thread="-lpthread"
- else
- AC_MSG_RESULT("Not found")
- # If this is a linux machine we should barf
- AC_MSG_ERROR([This is a Linux system without a working getconf,
-and Linuxthreads was not found. Please install it (or a new glibc) and try again.
-See the Installation chapter in the Reference Manual for more information.])
- fi
- else
- AC_MSG_RESULT("no need to check headers")
- fi
-
- AC_MSG_CHECKING("for pthread_create in -lpthread")
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS -lpthread"
- AC_TRY_LINK( [#include <pthread.h>],
- [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
- AC_MSG_RESULT("yes"),
- [ AC_MSG_RESULT("no")
- AC_MSG_ERROR([
-This is a Linux system claiming to support threads, either Linuxthreads or NPTL, but linking a test program failed.
-Please install one of these (or a new glibc) and try again.
-See the Installation chapter in the Reference Manual for more information.]) ]
- )
- LIBS="$ac_save_LIBS"
- else
- AC_MSG_RESULT("no")
- fi # "$TARGET_LINUX"
-fi # "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
-
-
-# Hack for DEC-UNIX (OSF1 -> Tru64)
-if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
-then
- AC_MSG_CHECKING("DEC threads post OSF/1 3.2")
- if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
- then
- with_named_thread="-lpthread -lmach -lexc"
- CFLAGS="$CFLAGS -D_REENTRANT"
- CXXFLAGS="$CXXFLAGS -D_REENTRANT"
- AC_DEFINE(HAVE_DEC_THREADS, [1], [Whether we are using DEC threads])
- AC_MSG_RESULT("yes")
- else
- AC_MSG_RESULT("no")
- fi # DEC threads
-fi # "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
-
-
-dnl This is needed because -lsocket has to come after the thread
-dnl library on SCO.
-AC_DEFUN([MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK], [
- LIBS=`echo " $LIBS " | sed -e 's/ -lsocket / /g'`
-])
-# Hack for SCO UNIX
-if test "$with_named_thread" = "no"
-then
- AC_MSG_CHECKING("SCO threads")
- if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null
- then
- if test -f /usr/lib/libgthreads.a -o -f /usr/lib/libgthreads.so
- then
- MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
- with_named_thread="-lgthreads -lsocket -lgthreads"
- # sched.h conflicts with fsu-threads
- touch ./include/sched.h
- touch ./include/semaphore.h
-
- # We must have gcc
- if expr "$CC" : ".*gcc.*"
- then
- AC_MSG_RESULT("yes")
- else
- AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.])
- fi
- AC_MSG_RESULT("yes")
- elif test -f /usr/local/lib/libpthread.a -o -f /usr/local/lib/libpthread.so
- then
- MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
- with_named_thread="-lpthread -lsocket"
- # sched.h conflicts with fsu-threads
- # touch ./include/sched.h
-
- AC_MSG_CHECKING("for gcc")
- # We must have gcc
- if expr "$CC" : ".*gcc.*"
- then
- AC_MSG_RESULT("yes")
- else
- AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.])
- fi
- AC_MSG_RESULT("yes")
- # Hack for SCO UnixWare 7.1.x
- #
- elif test "$with_named_thread" = "no"
- then
- AC_MSG_RESULT("no")
- AC_MSG_CHECKING("SCO UnixWare 7.1.x native threads")
- if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null
- then
- if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so
- then
- MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
- if expr "$CC" : ".*gcc.*"
- then
- with_named_thread="-pthread -lsocket -lnsl"
- else
- with_named_thread="-Kthread -lsocket -lnsl"
- fi
- if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
- then
- AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1])
- fi
- AC_MSG_RESULT("yes")
- # We must have cc
- AC_MSG_CHECKING("for gcc")
- if expr "$CC" : ".*gcc.*"
- then
- CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
- CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
- else
- CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
- CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
- fi
- else
- AC_MSG_ERROR([configure: error: Can't find thread libs on SCO UnixWare7. See the Installation chapter in the Reference Manual.])
- fi
- else
- AC_MSG_RESULT("no")
- fi
- else
- AC_MSG_ERROR([On SCO UNIX MySQL requires that the FSUThreads package is installed. See the Installation chapter in the Reference Manual.])
- fi
- else
- AC_MSG_RESULT("no")
- fi
-fi
-
-#
-# Check for SCO threading libraries
-#
-if test "$with_named_thread" = "no"
-then
- AC_MSG_CHECKING([SCO OpenServer 6, UnixWare 7 or OpenUNIX 8 native threads])
- if expr "$SYSTEM_TYPE" : ".*UnixWare.*" > /dev/null || \
- expr "$SYSTEM_TYPE" : ".*SCO_SV6.*" > /dev/null || \
- expr "$SYSTEM_TYPE" : ".*OpenUNIX.*" > /dev/null
- then
- if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so
- then
- MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
- if expr "$CC" : ".*gcc.*" > /dev/null
- then
- with_named_thread="-pthread -lsocket -lnsl"
- CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- else
- with_named_thread="-Kthread -lsocket -lnsl"
- CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
- fi
- if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
- then
- AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1], [Have UnixWare 7 (or similar) almost-POSIX threading library])
- fi
- AC_MSG_RESULT(yes)
- else
- AC_MSG_ERROR([configure: error: Can't find thread library on SCO/Caldera system. See the Installation chapter in the Reference Manual.])
- fi
- else
- AC_MSG_RESULT(no)
- fi
-fi
-
-# Hack for Siemens UNIX
-if test "$with_named_thread" = "no"
-then
- AC_MSG_CHECKING("Siemens threads")
- if test -f /usr/lib/libxnet.so -a "$SYSTEM_TYPE" = "sni-sysv4"
- then
- LIBS="-lxnet $LIBS"
- NON_THREADED_LIBS="-lxnet $NON_THREADED_LIBS"
- with_named_thread="-Kthread $LDFLAGS -lxnet"
- LD_FLAGS=""
- CFLAGS="-Kthread $CFLAGS"
- CXXFLAGS="-Kthread $CXXFLAGS"
- AC_MSG_RESULT("yes")
- else
- AC_MSG_RESULT("no")
- fi
-fi
-
-# Use library named -lpthread
-if test "$with_named_thread" = "no" -a "$with_pthread" = "yes"
-then
- with_named_thread="-lpthread"
-fi
-
-#---END:
-
-# Hack for Solaris >= 2.5
-# We want both the new and the old interface
-
-if test "$with_named_thread" = "no"
-then
- AC_MSG_CHECKING("Solaris threads")
- if test -f /usr/lib/libpthread.so -a -f /usr/lib/libthread.so
- then
- with_named_thread="-lpthread -lthread"
- AC_MSG_RESULT("yes")
- else
- AC_MSG_RESULT("no")
- fi
-fi
-
-# Should we use named pthread library ?
-AC_MSG_CHECKING("named thread libs:")
-if test "$with_named_thread" != "no"
-then
- LIBS="$with_named_thread $LIBS $with_named_thread"
- CLIENT_THREAD_LIBS="$with_named_thread"
- with_posix_threads="yes"
- AC_MSG_RESULT("$with_named_thread")
-else
- AC_MSG_RESULT("no")
- # pthread_create is in standard libraries (As in BSDI 3.0)
- AC_MSG_CHECKING("for pthread_create in -libc");
- AC_TRY_LINK(
- [#include <pthread.h>],
- [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
- with_posix_threads=yes, with_posix_threads=no)
- AC_MSG_RESULT("$with_posix_threads")
- if test "$with_posix_threads" = "no"
- then
- AC_MSG_CHECKING("for pthread_create in -lpthread")
- ac_save_LIBS="$LIBS"
- LIBS="$LIBS -lpthread"
- CLIENT_THREAD_LIBS="-lpthread"
- AC_TRY_LINK(
- [#include <pthread.h>],
- [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
- with_posix_threads=yes, with_posix_threads=no)
- AC_MSG_RESULT("$with_posix_threads")
- if test "$with_posix_threads" = "no"
- then
- LIBS=" $ac_save_LIBS -lpthreads"
- CLIENT_THREAD_LIBS="-lpthreads"
- AC_MSG_CHECKING("for pthread_create in -lpthreads")
- AC_TRY_LINK(
- [#include <pthread.h>],
- [ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
- with_posix_threads=yes, with_posix_threads=no)
- AC_MSG_RESULT("$with_posix_threads")
- if test "$with_posix_threads" = "no"
- then
- # This is for FreeBSD
- LIBS="$ac_save_LIBS -pthread"
- CLIENT_THREAD_LIBS="-pthread"
- AC_MSG_CHECKING("for pthread_create in -pthread")
- AC_TRY_LINK(
- [#include <pthread.h>],
- [ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
- with_posix_threads=yes, with_posix_threads=no)
- AC_MSG_RESULT("$with_posix_threads")
- fi
- fi
- fi
-fi
-
-#---START: Used in for client configure
-# Must be checked after, because strtok_r may be in -lpthread
-# On AIX strtok_r is in libc_r
-
-my_save_LIBS="$LIBS"
-AC_CHECK_LIB(pthread,strtok_r)
-LIBS="$my_save_LIBS"
-if test "$ac_cv_lib_pthread_strtok_r" = "no"
-then
- AC_CHECK_LIB(c_r,strtok_r)
- case "$with_osf32_threads---$target_os" in
- # Don't keep -lc_r in LIBS; -pthread handles it magically
- yes---* | *---freebsd* | *---hpux*) LIBS="$my_save_LIBS" ;;
-
- esac
- AC_CHECK_FUNCS(strtok_r pthread_init)
-else
- AC_CHECK_FUNCS(strtok_r)
-fi
-#---END:
-
-# dlopen, dlerror
-case "$with_mysqld_ldflags " in
-
- *"-all-static "*)
- # No need to check for dlopen when mysqld is linked with
- # -all-static as it won't be able to load any functions.
- # NOTE! It would be better if it was possible to test if dlopen
- # can be used, but a good way to test it couldn't be found
-
- ;;
-
- *)
- # Check for dlopen, needed for user definable functions and plugins
- # This must be checked after threads on AIX
-
- my_save_LIBS="$LIBS"
- LIBS=""
- AC_CHECK_LIB(dl,dlopen)
- LIBDL=$LIBS
- LIBS="$my_save_LIBS"
- AC_SUBST(LIBDL)
-
- my_save_LIBS="$LIBS"
- LIBS="$LIBS $LIBDL"
- AC_CHECK_FUNCS(dlopen dlerror)
- LIBS="$my_save_LIBS"
-
- ;;
-esac
-
-
-# System characteristics
-AC_SYS_RESTARTABLE_SYSCALLS
-
-# Build optimized or debug version ?
-# First check for gcc and g++
-if test "$GCC" = "yes"
-then
- DEBUG_CFLAGS="-ggdb3"
- DEBUG_OPTIMIZE_CC=""
- OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE"
-else
- DEBUG_CFLAGS="-g"
- DEBUG_OPTIMIZE_CC=""
- case $SYSTEM_TYPE in
- *solaris*)
- OPTIMIZE_CFLAGS="-O1"
- ;;
- *)
- OPTIMIZE_CFLAGS="-O"
- ;;
- esac
-fi
-if test "$GXX" = "yes"
-then
- DEBUG_CXXFLAGS="-ggdb3"
- DEBUG_OPTIMIZE_CXX=""
- OPTIMIZE_CXXFLAGS="$MAX_CXX_OPTIMIZE"
-else
- DEBUG_OPTIMIZE_CXX=""
- case $SYSTEM_TYPE in
- *solaris*)
- DEBUG_CXXFLAGS="-g0"
- OPTIMIZE_CXXFLAGS="-O1"
- ;;
- *)
- DEBUG_CXXFLAGS="-g"
- OPTIMIZE_CXXFLAGS="-O"
- ;;
- esac
-fi
-
-# If the user specified CFLAGS, we won't add any optimizations
-if test -n "$SAVE_CFLAGS"
-then
- OPTIMIZE_CFLAGS=""
- DEBUG_OPTIMIZE_CC=""
-fi
-# Ditto for CXXFLAGS
-if test -n "$SAVE_CXXFLAGS"
-then
- OPTIMIZE_CXXFLAGS=""
- DEBUG_OPTIMIZE_CXX=""
-fi
-
-AC_ARG_WITH(debug,
- [AS_HELP_STRING([--with-debug], [Add debug code @<:@default=no@:>@])],
- [with_debug=$withval],
- [with_debug=no])
-if test "$with_debug" != "no"
-then
- AC_DEFINE([DBUG_ON], [1], [Use libdbug])
- AC_DEFINE([SAFE_MUTEX], [1], [Use safe mutexes])
- CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $CFLAGS"
- CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $CXXFLAGS"
-else
- # Optimized version. No debug
- AC_DEFINE([DBUG_OFF], [1], [Don't use libdbug])
- CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS"
- CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
-fi
-
-AC_ARG_WITH([valgrind],
- [AS_HELP_STRING([--with-valgrind],
- [Valgrind instrumentation @<:@default=no@:>@])],
- [], [with_valgrind=no])
-
-if test "$with_valgrind" != "no"
-then
- AC_CHECK_HEADERS([valgrind/valgrind.h valgrind/memcheck.h],
- [AC_DEFINE([HAVE_VALGRIND], [1], [Define for Valgrind support])])
-fi
-
-# Debug Sync Facility. NOTE: depends on 'with_debug'. Must be behind it.
-AC_MSG_CHECKING(if Debug Sync Facility should be enabled.)
-AC_ARG_ENABLE(debug_sync,
- AS_HELP_STRING([--enable-debug-sync],
- [Build a version with Debug Sync Facility]),
- [ enable_debug_sync=$enableval ],
- [ enable_debug_sync=$with_debug ])
-
-if test "$enable_debug_sync" != "no"
-then
- AC_DEFINE([ENABLED_DEBUG_SYNC], [1],
- [If Debug Sync Facility should be enabled])
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-
-AC_ARG_WITH([fast-mutexes],
- AC_HELP_STRING([--with-fast-mutexes],
- [Compile with fast mutexes (default is disabled)]),
- [with_fast_mutexes=$withval], [with_fast_mutexes=no])
-
-if test "$with_fast_mutexes" != "no"
-then
- if test "$with_debug" != "no"
- then
- AC_MSG_WARN(['--with-fast-mutexes' ignored when '--with-debug' is given])
- else
- AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1],
- [Define to 1 if you want to use fast mutexes])
- fi
-fi
-
-AC_CACHE_CHECK([whether the compiler provides atomic builtins],
- [mysql_cv_gcc_atomic_builtins],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [
- ],
- [[
- int foo= -10; int bar= 10;
- long long int foo64= -10; long long int bar64= 10;
- if (!__sync_fetch_and_add(&foo, bar) || foo)
- return -1;
- bar= __sync_lock_test_and_set(&foo, bar);
- if (bar || foo != 10)
- return -1;
- bar= __sync_val_compare_and_swap(&bar, foo, 15);
- if (bar)
- return -1;
- if (!__sync_fetch_and_add(&foo64, bar64) || foo64)
- return -1;
- bar64= __sync_lock_test_and_set(&foo64, bar64);
- if (bar64 || foo64 != 10)
- return -1;
- bar64= __sync_val_compare_and_swap(&bar64, foo, 15);
- if (bar64)
- return -1;
- return 0;
- ]]
- )],
- [mysql_cv_gcc_atomic_builtins=yes],
- [mysql_cv_gcc_atomic_builtins=no],
- [mysql_cv_gcc_atomic_builtins=no]
-)])
-if test "x$mysql_cv_gcc_atomic_builtins" = xyes; then
- AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1,
- [Define to 1 if compiler provides atomic builtins.])
-fi
-
-AC_CACHE_CHECK([whether the OS provides atomic_* functions like Solaris],
- [mysql_cv_solaris_atomic],
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[
- #include <atomic.h>
- ]],
- [[
- int foo = -10; int bar = 10;
- int64_t foo64 = -10; int64_t bar64 = 10;
- if (atomic_add_int_nv((uint_t *)&foo, bar) || foo)
- return -1;
- bar = atomic_swap_uint((uint_t *)&foo, (uint_t)bar);
- if (bar || foo != 10)
- return -1;
- bar = atomic_cas_uint((uint_t *)&bar, (uint_t)foo, 15);
- if (bar)
- return -1;
- if (atomic_add_64_nv((volatile uint64_t *)&foo64, bar64) || foo64)
- return -1;
- bar64 = atomic_swap_64((volatile uint64_t *)&foo64, (uint64_t)bar64);
- if (bar64 || foo64 != 10)
- return -1;
- bar64 = atomic_cas_64((volatile uint64_t *)&bar64, (uint_t)foo64, 15);
- if (bar64)
- return -1;
- atomic_or_64((volatile uint64_t *)&bar64, 0);
- return 0;
- ]]
- )],
- [mysql_cv_solaris_atomic=yes],
- [mysql_cv_solaris_atomic=no],
- [mysql_cv_solaris_atomic=no]
-)])
-if test "x$mysql_cv_solaris_atomic" = xyes; then
- AC_DEFINE(HAVE_SOLARIS_ATOMIC, 1,
- [Define to 1 if OS provides atomic_* functions like Solaris.])
-fi
-AC_ARG_WITH([atomic-ops],
- AC_HELP_STRING([--with-atomic-ops=rwlocks|smp|up],
- [Implement atomic operations using pthread rwlocks or atomic CPU
- instructions for multi-processor or uniprocessor
- configuration. By default gcc built-in sync functions are used,
- if available and 'smp' configuration otherwise.]))
-case "$with_atomic_ops" in
- "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1],
- [Assume single-CPU mode, no concurrency]) ;;
- "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1],
- [Use pthread rwlocks for atomic ops]) ;;
- "smp") ;;
- "")
- if test "x$mysql_cv_gcc_atomic_builtins" = xyes_but_disabled; then
- AC_DEFINE([MY_ATOMIC_MODE_GCC_BUILTINS], [1],
- [Use GCC atomic builtins for atomic ops])
- fi
- ;;
- *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;;
-esac
-
-# Force static compilation to avoid linking problems/get more speed
-AC_ARG_WITH(mysqld-ldflags,
- [ --with-mysqld-ldflags Extra linking arguments for mysqld],
- [MYSQLD_EXTRA_LDFLAGS=$withval],
- [MYSQLD_EXTRA_LDFLAGS=])
-AC_SUBST(MYSQLD_EXTRA_LDFLAGS)
-
-AC_ARG_WITH(client-ldflags,
- [ --with-client-ldflags Extra linking arguments for clients],
- [CLIENT_EXTRA_LDFLAGS=$withval],
- [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],
- [LIB_EXTRA_CCFLAGS=])
-AC_SUBST(LIB_EXTRA_CCFLAGS)
-
-# Avoid stupid bug on some OS
-AC_ARG_WITH(low-memory,
- [ --with-low-memory Try to use less memory to compile to avoid
- memory limitations.],
- [with_lowmem=$withval],
- [with_lowmem=no])
-if test "$with_lowmem" = "yes"
-then
- if test "$ac_cv_prog_gcc" = "yes"
- then
- LM_CFLAGS="-fno-inline"
- else
- LM_CFLAGS="-O0"
- fi
-else
- LM_CFLAGS=""
-fi
-AC_SUBST(LM_CFLAGS)
-
-AC_ARG_WITH(comment,
- [ --with-comment Comment about compilation environment.],
- [with_comment=$withval],
- [with_comment=no])
-if test "$with_comment" != "no"
-then
- COMPILATION_COMMENT=$with_comment
-else
- COMPILATION_COMMENT="Source distribution"
-fi
-AC_SUBST(COMPILATION_COMMENT)
-
-AC_MSG_CHECKING("need of special linking flags")
-if test "$TARGET_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes"
-then
- LDFLAGS="$LDFLAGS -rdynamic"
- AC_MSG_RESULT("-rdynamic")
-else
- case "$SYSTEM_TYPE$with_mysqld_ldflags " in
- *freebsd*"-all-static "*|*dragonfly*"-all-static "*)
- AC_MSG_RESULT("none")
- ;;
- *freebsd*|*dragonfly*)
- MYSQLD_EXTRA_LDFLAGS="$MYSQLD_EXTRA_LDFLAGS -export-dynamic"
- AC_MSG_RESULT("-export-dynamic")
- ;;
- *)
- AC_MSG_RESULT("none")
- ;;
- esac
-fi
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_C_INLINE
-AS_IF([test "x$ac_cv_c_inline" = "xno"],
- [AC_MSG_WARN([The C compiler does not support inline. Beware that unused
- functions might not be eliminated the object files.])])
-AC_TYPE_OFF_T
-AC_STRUCT_ST_RDEV
-AC_HEADER_TIME
-AC_STRUCT_TM
-MYSQL_NEEDS_MYSYS_NEW
-# AC_CHECK_SIZEOF return 0 when it does not find the size of a
-# type. We want a error instead.
-AC_CHECK_SIZEOF(char, 1)
-if test "$ac_cv_sizeof_char" -eq 0
-then
- AC_MSG_ERROR([No size for char type.
-A likely cause for this could be that there isn't any
-static libraries installed. You can verify this by checking if you have libm.a
-in /lib, /usr/lib or some other standard place. If this is the problem,
-install the static libraries and try again. If this isn't the problem,
-examine config.log for possible errors. If you want to report this, use
-'scripts/mysqlbug' and include at least the last 20 rows from config.log!])
-fi
-AC_CHECK_SIZEOF(char*, 4)
-AC_CHECK_SIZEOF(short, 2)
-AC_CHECK_SIZEOF(int, 4)
-if test "$ac_cv_sizeof_int" -eq 0
-then
- AC_MSG_ERROR("No size for int type.")
-fi
-AC_CHECK_SIZEOF(long, 4)
-if test "$ac_cv_sizeof_long" -eq 0
-then
- AC_MSG_ERROR("No size for long type.")
-fi
-AC_CHECK_SIZEOF(long long, 8)
-if test "$ac_cv_sizeof_long_long" -eq 0
-then
- AC_MSG_ERROR("MySQL needs a long long type.")
-fi
-# off_t is not a builtin type
-AC_CHECK_SIZEOF(off_t, 4)
-if test "$ac_cv_sizeof_off_t" -eq 0
-then
- AC_MSG_ERROR("MySQL needs a off_t type.")
-fi
-
-dnl
-dnl check if time_t is unsigned
-dnl
-
-MYSQL_CHECK_TIME_T
-
-
-# do we need #pragma interface/#pragma implementation ?
-# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
-AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
-# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
-# follow any standard), we'll use well-defined preprocessor macros:
-AC_TRY_CPP([
-#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
-#error USE_PRAGMA_IMPLEMENTATION
-#endif
-],AC_MSG_RESULT(no) ,AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION")
-
-# This always gives a warning. Ignore it unless you are cross compiling
-AC_C_BIGENDIAN
-#---START: Used in for client configure
-# Check base type of last arg to accept
-MYSQL_TYPE_ACCEPT
-#---END:
-# Figure out what type of struct rlimit to use with setrlimit
-MYSQL_TYPE_STRUCT_RLIMIT
-# Find where the stack goes
-MYSQL_STACK_DIRECTION
-# We want to skip alloca on irix unconditionally. It may work on some version..
-MYSQL_FUNC_ALLOCA
-# Do struct timespec have members tv_sec or ts_sec
-MYSQL_TIMESPEC_TS
-# Do we have the tzname variable
-MYSQL_TZNAME
-# Do the c++ compiler have a bool type
-MYSQL_CXX_BOOL
-# Check some common bugs with gcc 2.8.# on sparc
-MYSQL_CHECK_LONGLONG_TO_FLOAT
-if test "$ac_cv_conv_longlong_to_float" != "yes"
-then
- AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
- If you are using gcc 2.8.# you should upgrade to egcs 1.0.3
- or newer and try again])
-fi
-AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
-AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
-AC_CHECK_TYPES([u_int32_t])
-
-MYSQL_PTHREAD_YIELD
-
-######################################################################
-# For readline/libedit (We simply move the mimimum amount of stuff from
-# the readline/libedit configure.in here)
-
-dnl Checks for header files.
-AC_CHECK_HEADERS(malloc.h sys/cdefs.h)
-
-dnl Checks for library functions.
-AC_FUNC_ALLOCA
-AC_PROG_GCC_TRADITIONAL
-AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(re_comp regcomp strdup)
-
-dnl Sun compilers have their own vis.h that is about something
-dnl totally different. So, not to change the libedit source, we
-dnl do some additional checks before we define HAVE_VIS_H.
-AC_CHECK_HEADER(vis.h,
- [AC_CHECK_FUNC(strvis,
- [AC_DEFINE([HAVE_VIS_H], [1],[Found vis.h and the strvis() function])])])
-
-AC_CHECK_FUNCS(strlcat strlcpy)
-AC_CHECK_FUNCS(issetugid)
-AC_CHECK_FUNCS(fgetln)
-AC_CHECK_FUNCS(getline flockfile)
-
-# from old readline settting:
-
-MAKE_SHELL=/bin/sh
-AC_SUBST(MAKE_SHELL)
-
-# Already-done: stdlib.h string.h unistd.h termios.h
-AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \
- sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \
- sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \
-paths.h semaphore.h langinfo.h)
-
-# Already-done: strcasecmp
-AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr)
-AC_CHECK_FUNCS(nl_langinfo)
-
-AC_STAT_MACROS_BROKEN
-MYSQL_SIGNAL_CHECK
-MYSQL_CHECK_GETPW_FUNCS
-MYSQL_HAVE_TIOCGWINSZ
-MYSQL_HAVE_FIONREAD
-MYSQL_HAVE_TIOCSTAT
-MYSQL_STRUCT_DIRENT_D_INO
-MYSQL_STRUCT_DIRENT_D_NAMLEN
-MYSQL_TYPE_SIGHANDLER
-MYSQL_CHECK_MULTIBYTE
-if test "$with_named_curses" = "no"
-then
- MYSQL_CHECK_LIB_TERMCAP
-else
- TERMCAP_LIB="$with_named_curses"
-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"])
-AC_CHECK_FUNC(strlcpy, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS strlcpy.o"])
-AC_CHECK_FUNC(strlcat, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS strlcat.o"])
-AC_CHECK_FUNC(fgetln, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS fgetln.o"])
-AC_SUBST(LIBEDIT_LOBJECTS)
-enable_readline="yes"
-
-# End of readline/libedit stuff
-#########################################################################
-
-dnl Checks for library functions.
-
-#
-# The following code disables intrinsic function support while we test for
-# library functions. This is to avoid configure problems with Intel ecc
-# compiler
-
-ORG_CFLAGS="$CFLAGS"
-if test "$GCC" != "yes"; then
- AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[])
-fi
-
-#AC_FUNC_MMAP
-AC_TYPE_SIGNAL
-MYSQL_TYPE_QSORT
-AC_FUNC_UTIME_NULL
-AC_FUNC_VPRINTF
-
-AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
- chsize cuserid fchmod fcntl \
- fdatasync fesetround finite fpresetsticky fpsetmask fsync ftruncate \
- getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
- 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_setstacksize pthread_condattr_create \
- pthread_getsequence_np pthread_key_delete pthread_rwlock_rdlock \
- pthread_rwlockattr_setkind_np pthread_sigmask \
- readlink realpath rename rint rwlock_init setupterm \
- shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
- sighold sigset sigthreadmask port_create sleep thr_yield \
- snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \
- strtol strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \
- posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd printstack)
-
-#
-#
-#
-case "$target" in
- *-*-aix4* | *-*-sco*)
- # (grr) aix 4.3 has a stub for clock_gettime, (returning ENOSYS)
- # and using AC_TRY_RUN is hard when cross-compiling
- # We also disable for SCO for the time being, the headers for the
- # thread library we use conflicts with other headers.
- ;;
-*)
- # most systems require the program be linked with librt library to use
- # the function clock_gettime
- my_save_LIBS="$LIBS"
- LIBS=""
- AC_CHECK_LIB(rt,clock_gettime)
- LIBRT=$LIBS
- LIBS="$my_save_LIBS"
- AC_SUBST(LIBRT)
-
- LIBS="$LIBS $LIBRT"
- AC_CHECK_FUNCS(clock_gettime)
- ;;
-esac
-
-case "$mysql_cv_sys_os" in
- OS400) # i5/OS (OS/400) emits a SIGILL (Function not implemented) when
- # unsupported priority values are passed to pthread_setschedprio.
- # Since the only supported value is 1, treat it as inexistent.
- ;;
- SunOS) # Bug#42599 error: `pthread_setschedprio' was not declared in this scope
- # In some installations, the pthread.h header used by GCC does not
- # declare the pthread_setscheprio prototype, but the function is
- # implemented. Since the function is used in C++ code, ensure that
- # the function prototype is present.
- AC_MSG_CHECKING([whether pthread_setschedprio is declared])
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([#include <pthread.h>],
- [(void)(pthread_setschedprio);])],
- [ac_cv_func_pthread_setschedprio=yes],
- [ac_cv_func_pthread_setschedprio=no])
- AC_LANG_POP([C++])
- AC_MSG_RESULT([$ac_cv_func_pthread_setschedprio])
- if test "$ac_cv_func_pthread_setschedprio" = yes; then
- AC_DEFINE(HAVE_PTHREAD_SETSCHEDPRIO, 1,
- [Define to 1 if you have the `pthread_setschedprio' function.])
- fi
- ;;
- *) AC_CHECK_FUNCS(pthread_setschedprio)
- ;;
-esac
-
-# 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_MSG_CHECKING(whether isinf() is safe to use in C code)
- AC_TRY_RUN([
-#include <math.h>
-int main()
-{
- double a= 10.0;
- double b= 1e308;
-
- return !isinf(a * b);
-}
-],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
- AC_DEFINE([HAVE_BROKEN_ISINF], [1],
- [Define to 1 if isinf() uses 80-bit register for intermediate values])
- ],
- [
-# Let's be optimistic when cross-compiling, since the only compiler known
-# to be affected by this isinf() bug is GCC 4.3 on 32-bit x86.
- AC_MSG_RESULT([[cross-compiling, assuming '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"
-
-# Sanity check: We chould not have any fseeko symbol unless
-# large_file_support=yes
-AC_CHECK_FUNC(fseeko,
-[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true";
-then
- AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!")
-fi]
-)
-
-# Check definition of gethostbyaddr_r (glibc2 defines this with 8 arguments)
-ac_save_CXXFLAGS="$CXXFLAGS"
-AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style,
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-
-# Test whether madvise() is declared in C++ code -- it is not on some
-# systems, such as Solaris
-AC_CHECK_DECLS(madvise, [], [], [#if HAVE_SYS_MMAN_H
-#include <sys/types.h>
-#include <sys/mman.h>
-#endif])
-
-# Do not treat warnings as errors if we are linking against other libc
-# this is to work around gcc not being permissive on non-system includes
-# with respect to ANSI C++
-# We also remove the -fbranch-probabilities option as this will give warnings
-# about not profiled code, which confuses configure
-# We also must remove -W and -Wcheck which on icc produces warnings that
-# we don't want to catch with -Werror
-
-if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
-then
- CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
-fi
-
-AC_TRY_COMPILE(
-[#undef inline
-#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
-#define _REENTRANT
-#endif
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>],
-[int skr;
- struct hostent *foo = gethostbyaddr_r((const char *) 0,
- 0, 0, (struct hostent *) 0, (char *) NULL, 0, &skr); return (foo == 0);],
-mysql_cv_gethost_style=solaris, mysql_cv_gethost_style=other))
-AC_LANG_RESTORE
-CXXFLAGS="$ac_save_CXXFLAGS"
-if test "$mysql_cv_gethost_style" = "solaris"
-then
- AC_DEFINE([HAVE_SOLARIS_STYLE_GETHOST], [1],
- [Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines this with 8 arguments])
-fi
-
-#---START: Used in for client configure
-
-# Check definition of gethostbyname_r (glibc2.0.100 is different from Solaris)
-ac_save_CXXFLAGS="$CXXFLAGS"
-AC_CACHE_CHECK([style of gethostbyname_r routines], mysql_cv_gethostbyname_style,
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
-then
- CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
-fi
-AC_TRY_COMPILE(
-[#undef inline
-#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
-#define _REENTRANT
-#endif
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>],
-[int skr;
-
- skr = gethostbyname_r((const char *) 0,
- (struct hostent*) 0, (char*) 0, 0, (struct hostent **) 0, &skr);],
-mysql_cv_gethostbyname_style=glibc2, mysql_cv_gethostbyname_style=other))
-AC_LANG_RESTORE
-CXXFLAGS="$ac_save_CXXFLAGS"
-if test "$mysql_cv_gethostbyname_style" = "glibc2"
-then
- AC_DEFINE([HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE], [1],
- [Solaris define gethostbyname_r with 5 arguments. glibc2 defines this with 6 arguments])
-fi
-
-# Check 3rd argument of getthostbyname_r
-ac_save_CXXFLAGS="$CXXFLAGS"
-AC_CACHE_CHECK([3 argument to gethostbyname_r routines], mysql_cv_gethostbyname_arg,
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
-then
- CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
-fi
-AC_TRY_COMPILE(
-[#undef inline
-#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
-#define _REENTRANT
-#endif
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>],
-[int skr;
-
- skr = gethostbyname_r((const char *) 0, (struct hostent*) 0, (struct hostent_data*) 0);],
-mysql_cv_gethostbyname_arg=hostent_data, mysql_cv_gethostbyname_arg=char))
-AC_LANG_RESTORE
-CXXFLAGS="$ac_save_CXXFLAGS"
-if test "$mysql_cv_gethostbyname_arg" = "hostent_data"
-then
- AC_DEFINE([HAVE_GETHOSTBYNAME_R_RETURN_INT], [1],
- [In OSF 4.0f the 3'd argument to gethostbyname_r is hostent_data *])
-fi
-
-
-# Check definition of pthread_getspecific
-AC_CACHE_CHECK("args to pthread_getspecific", mysql_cv_getspecific_args,
-AC_TRY_COMPILE(
-[#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
-#define _REENTRANT
-#endif
-#define _POSIX_PTHREAD_SEMANTICS
-#include <pthread.h> ],
-[ void *pthread_getspecific(pthread_key_t key);
-pthread_getspecific((pthread_key_t) NULL); ],
-mysql_cv_getspecific_args=POSIX, mysql_cv_getspecific_args=other))
- if test "$mysql_cv_getspecific_args" = "other"
- then
- AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
- [For some non posix threads])
- fi
-
- # Check definition of pthread_mutex_init
- AC_CACHE_CHECK("args to pthread_mutex_init", mysql_cv_mutex_init_args,
- AC_TRY_COMPILE(
-[#if !defined(SCO) && !defined(__osf__)
-#define _REENTRANT
-#endif
-#define _POSIX_PTHREAD_SEMANTICS
-#include <pthread.h> ],
-[
- pthread_mutexattr_t attr;
- pthread_mutex_t mp;
- pthread_mutex_init(&mp,&attr); ],
-mysql_cv_mutex_init_args=POSIX, mysql_cv_mutex_init_args=other))
- if test "$mysql_cv_mutex_init_args" = "other"
- then
- AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
- [For some non posix threads])
- fi
-#---END:
-
-#---START: Used in for client configure
-# Check definition of readdir_r
-AC_CACHE_CHECK("args to readdir_r", mysql_cv_readdir_r,
-AC_TRY_LINK(
-[#if !defined(SCO) && !defined(__osf__)
-#define _REENTRANT
-#endif
-#define _POSIX_PTHREAD_SEMANTICS
-#include <pthread.h>
-#include <dirent.h>],
-[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
-readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ],
-mysql_cv_readdir_r=POSIX, mysql_cv_readdir_r=other))
-if test "$mysql_cv_readdir_r" = "POSIX"
-then
- AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
-fi
-
-# Check definition of posix sigwait()
-AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
-AC_TRY_LINK(
-[#if !defined(SCO) && !defined(__osf__)
-#define _REENTRANT
-#endif
-#define _POSIX_PTHREAD_SEMANTICS
-#include <pthread.h>
-#include <signal.h>],
-[#ifndef _AIX
-sigset_t set;
-int sig;
-sigwait(&set,&sig);
-#endif],
-mysql_cv_sigwait=POSIX, mysql_cv_sigwait=other))
-if test "$mysql_cv_sigwait" = "POSIX"
-then
- AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
-fi
-
-if test "$mysql_cv_sigwait" != "POSIX"
-then
-unset mysql_cv_sigwait
-# Check definition of posix sigwait()
-AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait,
-AC_TRY_LINK(
-[#if !defined(SCO) && !defined(__osf__)
-#define _REENTRANT
-#endif
-#define _POSIX_PTHREAD_SEMANTICS
-#include <pthread.h>
-#include <signal.h>],
-[sigset_t set;
-int sig;
-sigwait(&set);],
-mysql_cv_sigwait=NONPOSIX, mysql_cv_sigwait=other))
-if test "$mysql_cv_sigwait" = "NONPOSIX"
-then
- AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
-fi
-fi
-#---END:
-
-#Check for x86 PAUSE instruction
-AC_MSG_CHECKING("for x86 PAUSE instruction")
-# We have to actually try running the test program, because of a bug
-# in Solaris on x86_64, where it wrongly reports that PAUSE is not
-# supported when trying to run an application. See
-# http://bugs.opensolaris.org/bugdatabase/printableBug.do?bug_id=6478684
-AC_TRY_RUN([
- int main() {
- __asm__ __volatile__ ("pause");
- return 0;
- }
- ],
- [x86_pause_exists=yes],
- [x86_pause_exists=no],
- [x86_pause_exists=no] # Cross-compile, assume no PAUSE instruction
-)
-AC_TRY_RUN([
- int main() {
- __asm__ __volatile__ ("rep; nop");
- return 0;
- }
- ],
- [x86_fake_pause_exists=yes],
- [x86_fake_pause_exists=no],
- [x86_fake_pause_exists=no] # Cross-compile, assume no x86 NOP instruction
-)
-if test "$x86_pause_exists" = "yes"
-then
- AC_DEFINE([HAVE_PAUSE_INSTRUCTION], [1], [Does x86 PAUSE instruction exist])
-else
- if test "$x86_fake_pause_exists" = "yes"
- then
- AC_DEFINE([HAVE_FAKE_PAUSE_INSTRUCTION], [1], [Does x86 NOP instruction exist])
- fi
-fi
-
-# Check if pthread_attr_setscope() exists
-AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope,
-AC_TRY_LINK(
-[#if !defined(SCO) && !defined(__osf__)
-#define _REENTRANT
-#endif
-#define _POSIX_PTHREAD_SEMANTICS
-#include <pthread.h>],
-[pthread_attr_t thr_attr;
-pthread_attr_setscope(&thr_attr,0);],
-mysql_cv_pthread_attr_setscope=yes, mysql_cv_pthread_attr_setscope=no))
-if test "$mysql_cv_pthread_attr_setscope" = "yes"
-then
- AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
-fi
-
-# Check for bad includes
-AC_MSG_CHECKING("can netinet files be included")
-AC_TRY_COMPILE(
-[#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in_systm.h>
-#include <netinet/in.h>
-#include <netinet/ip.h>
-#include <netinet/tcp.h>],
-[ printf("1\n"); ],
-netinet_inc=yes, netinet_inc=no)
-if test "$netinet_inc" = "no"
-then
- AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included])
-fi
-AC_MSG_RESULT("$netinet_inc")
-
-AC_CACHE_CHECK([support for weak symbols], mysql_cv_weak_symbol,
-[AC_TRY_LINK([],[
- extern void __attribute__((weak)) foo(void);
-], [mysql_cv_weak_symbol=yes], [mysql_cv_weak_symbol=no])])
-
-if test "x$mysql_cv_weak_symbol" = xyes; then
- AC_DEFINE(HAVE_WEAK_SYMBOL, 1,
- [Define to 1 if compiler supports weak symbol attribute.])
-fi
-
-AC_CACHE_CHECK([whether __bss_start is defined], mysql_cv_bss_start,
-[AC_TRY_LINK([],[
- extern char *__bss_start;
- return __bss_start ? 1 : 0;
-], [mysql_cv_bss_start=yes], [mysql_cv_bss_start=no])])
-
-if test "x$mysql_cv_bss_start" = xyes; then
- AC_DEFINE(HAVE_BSS_START, 1,
- [Define to 1 if compiler defines __bss_start.])
-fi
-
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-AC_CHECK_HEADERS(cxxabi.h)
-AC_CACHE_CHECK([for abi::__cxa_demangle], mysql_cv_cxa_demangle,
-[AC_TRY_LINK([#include <cxxabi.h>], [
- char *foo= 0; int bar= 0;
- foo= abi::__cxa_demangle(foo, foo, 0, &bar);
-], [mysql_cv_cxa_demangle=yes], [mysql_cv_cxa_demangle=no])])
-AC_LANG_RESTORE
-
-if test "x$mysql_cv_cxa_demangle" = xyes; then
- AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
- [Define to 1 if you have the `abi::__cxa_demangle' function.])
-fi
-
-#--------------------------------------------------------------------
-# Check for requested features
-#--------------------------------------------------------------------
-
-MYSQL_CHECK_BIG_TABLES
-MYSQL_CHECK_MAX_INDEXES
-MYSQL_CHECK_VIO
-MYSQL_CHECK_SSL
-MYSQL_CHECK_LIBEVENT
-
-#--------------------------------------------------------------------
-# Declare our plugin modules
-# Has to be done late, as the plugin may need to check for existence of
-# functions tested above
-#--------------------------------------------------------------------
-
-# MyISAM is declared here,not in storage/myisam/plug.in
-# because we want it to be the first in the list of plugins,
-# Maria needs it. When it'll be fixed the declaration below can
-# be removed and restored (uncommented) in storage/myisam/plug.in
-MYSQL_STORAGE_ENGINE(myisam,no, [MyISAM Storage Engine],
- [Traditional non-transactional MySQL tables])
-MYSQL_PLUGIN_DIRECTORY(myisam, [storage/myisam])
-MYSQL_PLUGIN_STATIC(myisam, [libmyisam.a])
-MYSQL_PLUGIN_MANDATORY(myisam) dnl Default
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(myisam, [ha_myisam.cc])
-
-MYSQL_STORAGE_ENGINE(partition, partition, [Partition Support],
- [MySQL Partitioning Support], [max,max-no-ndb])
-
-dnl -- ndbcluster requires partition to be enabled
-
-MYSQL_CONFIGURE_PLUGINS([default])
-
-# Only build client code?
-AC_ARG_WITH(server,
- [ --without-server Only build the client.],
- [with_server=$withval],
- [with_server=yes]
-)
-
-AC_ARG_WITH(embedded-server,
- [ --with-embedded-server Build the embedded server (libmysqld).],
- [with_embedded_server=$withval],
- [with_embedded_server=no]
-)
-
-AC_ARG_WITH(query_cache,
- [ --without-query-cache Do not build query cache.],
- [with_query_cache=$withval],
- [with_query_cache=yes]
-)
-
-if test "$with_query_cache" = "yes"
-then
- AC_DEFINE([HAVE_QUERY_CACHE], [1], [If we want to have query cache])
-fi
-
-AC_ARG_WITH(geometry,
- [ --without-geometry Do not build geometry-related parts.],
- [with_geometry=$withval],
- [with_geometry=yes]
-)
-
-if test "$with_geometry" = "yes"
-then
- AC_DEFINE([HAVE_SPATIAL], [1], [Spatial extentions])
- AC_DEFINE([HAVE_RTREE_KEYS], [1], [RTree keys])
-fi
-
-AC_ARG_WITH(embedded_privilege_control,
- [ --with-embedded-privilege-control
- Build parts to check user's privileges.
- Only affects embedded library.],
- [with_embedded_privilege_control=$withval],
- [with_embedded_privilege_control=no]
-)
-
-if test "$with_embedded_privilege_control" = "yes"
-then
- AC_DEFINE([HAVE_EMBEDDED_PRIVILEGE_CONTROL], [1],
- [Access checks in embedded library])
-fi
-
-#MYSQL_CHECK_CPU
-
-libmysqld_dirs=
-if test "$with_embedded_server" = "yes"
-then
- libmysqld_dirs=libmysqld
-
- # We can't build embedded library without building the server, because
- # we depend on libmysys, libmystrings, libmyisam, etc.
- with_server=yes
-fi
-# XXX: We need to add @libmysqld_extra_libs@ (or whatever) so that
-# mysql_config --libmysqld-libs will print out something like
-# -L/path/to/lib/mysql -lmysqld -lmyisam -lmysys -lmystrings -ldbug ...
-AC_SUBST([libmysqld_dirs])
-
-# Shall we build the docs?
-AC_ARG_WITH(docs,
- [ --without-docs Skip building of the documentation.],
- [with_docs=$withval],
- [with_docs=yes]
-)
-
-if test "$with_docs" = "yes"
-then
- docs_dirs="Docs"
- if test -f "$srcdir/Docs/manual.chm" ; then
- extra_docs="manual.chm"
- fi
-else
- docs_dirs=""
- extra_docs=""
-fi
-AC_SUBST(docs_dirs)
-AC_SUBST(extra_docs)
-
-# Shall we build the man pages?
-AC_ARG_WITH(man,
- [ --without-man Skip building of the man pages.],
- [with_man=$withval],
- [with_man=yes]
-)
-
-# Don't build readline, i have it already
-AC_ARG_WITH(readline,
- [ --without-readline Use system readline instead of bundled copy.],
- [ with_readline=$withval ],
- [ with_readline=undefined ]
- )
-
-AC_ARG_WITH(libedit,
- [ --without-libedit Use system libedit instead of bundled copy.],
- [ with_libedit=$withval ],
- [ with_libedit=undefined ]
- )
-
-if test "$with_readline/$with_libedit" = "undefined/undefined" -a ! -e "$srcdir/cmd-line-utils"
-then
- with_readline=no
- with_libedit=no
-fi
-
-#
-# We support next variants of compilation:
-# --with-readline
-# | yes | no | undefined
-# --with-libedit | | |
-# ---------------+----------------+------+----------------------------------
-# yes | ERROR! | use libedit from mysql sources
-# ---------------+----------------+------+----------------------------------
-# no | use readline | use system readline or external libedit
-# | from mysql | according to results of m4 tests
-# ---------------+ sources (if it + +----------------------------------
-# undefined | is presented) | | use libedit from mysql sources
-
-
-compile_readline="no"
-compile_libedit="no"
-
-if [test "$with_libedit" = "yes"] && [test "$with_readline" = "yes"]
-then
- AC_MSG_ERROR([You can not use --with-readline and --with-libedit at the same time, please choose one of it])
-fi
-
-readline_topdir=""
-readline_basedir=""
-readline_dir=""
-readline_h_ln_cmd=""
-readline_link=""
-want_to_use_readline="no"
-
-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 "$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
-
-# if there is no readline, but we want to build with readline, we fail
-if [test "$want_to_use_readline" = "yes"] && [test ! -d "$srcdir/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
-
-AC_SUBST(readline_dir)
-AC_SUBST(readline_topdir)
-AC_SUBST(readline_basedir)
-AC_SUBST(readline_link)
-AC_SUBST(readline_h_ln_cmd)
-
-# Include man pages, if desired, adapted to the configured parts.
-if test X"$with_man" = Xyes
-then
- # First, create the list of all man pages present.
- MANLISTFIL=manlist.$$
- TMPLISTFIL=`echo $MANLISTFIL | sed -e 's/manlist/tmplist/'`
- if test -f $MANLISTFIL -o -f $TMPLISTFIL
- then
- echo "Temp file '$MANLISTFIL' or '$TMPLISTFIL' already exists in '`pwd`' - aborting"
- exit 1
- fi
- touch $MANLISTFIL $TMPLISTFIL
-
- ls $srcdir/man/*.[[18]] > $MANLISTFIL
-
- # Then, remove all those pages from the list which are specific to parts
- # (table handlers, features, ...) which are not configured in this run.
- AC_MSG_CHECKING("for man pages to remove")
- MAN_DROP="dropping"
- if test X"$with_plugin_ndbcluster" != Xyes
- then
- MAN_DROP="$MAN_DROP ndbcluster"
- grep -v '/ndb' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
- fi
- if test X"$with_embedded_server" != Xyes
- then
- MAN_DROP="$MAN_DROP embedded"
- grep -v 'embedded' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
- fi
- if test X"$with_plugin_innobase" != Xyes
- then
- MAN_DROP="$MAN_DROP innodb"
- grep -v 'inno' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL
- fi
- AC_MSG_RESULT([$MAN_DROP])
-
- # Finally, split the man pages into sections 1 and 8.
- # Get rid of line breaks.
- man1_files=`sed -n -e '/\.1$/s/^.*man\///p' <$MANLISTFIL`
- man8_files=`sed -n -e '/\.8$/s/^.*man\///p' <$MANLISTFIL`
-
- man_dirs="man"
- man1_files=`echo $man1_files`
- man8_files=`echo $man8_files`
- rm -f $MANLISTFIL $TMPLISTFIL
-else
- man_dirs=""
- man1_files=""
- man8_files=""
-fi
-AC_SUBST(man_dirs)
-AC_SUBST(man1_files)
-AC_SUBST(man8_files)
-
-# If we have threads generate some library functions and test programs
-sql_server_dirs=
-sql_server=
-server_scripts=
-
-dnl This probably should be cleaned up more - for now the threaded
-dnl client is just using plain-old libs.
-sql_client_dirs="strings mysys dbug extra regex libmysql unittest"
-
-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_DEFINE([THREAD_SAFE_CLIENT], [1], [Should the client be thread safe])
-fi
-sql_client_dirs="$sql_client_dirs client"
-
-CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS $LIBRT"
-
-AC_SUBST(CLIENT_LIBS)
-AC_SUBST(CLIENT_THREAD_LIBS)
-AC_SUBST(NON_THREADED_LIBS)
-AC_SUBST(STATIC_NSS_FLAGS)
-AC_SUBST(sql_client_dirs)
-
-if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"
-then
- AC_DEFINE([THREAD], [1],
- [Define if you want to have threaded code. This may be undef on client code])
- # Avoid _PROGRAMS names
- THREAD_LOBJECTS="thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_pthread.o my_thr_init.o mf_keycache.o mf_keycaches.o waiting_threads.o"
- AC_SUBST(THREAD_LOBJECTS)
-fi
-AM_CONDITIONAL(NEED_THREAD, test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no")
-
-if test "$with_server" != "no"
-then
- server_scripts="mysqld_safe mysql_install_db"
- sql_server_dirs="strings mysys dbug extra regex storage plugin"
-
- sql_server="vio sql"
-fi
-AM_CONDITIONAL(THREAD, test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no")
-
-# "innochecksum" is not in the "innobase/" subdirectory, but should be switched
-AM_CONDITIONAL([BUILD_INNODB_TOOLS], [test X"$with_plugin_innobase" = Xyes])
-
-# IMPORTANT - do not modify LIBS past this line - this hack is the only way
-# I know to add the static NSS magic if we have static NSS libraries with
-# glibc - Sasha
-
-LDFLAGS="$LDFLAGS $OTHER_LIBC_LIB"
-LIBS="$LIBS $STATIC_NSS_FLAGS"
-
-AC_SUBST(sql_server_dirs)
-AC_SUBST(sql_server)
-AC_SUBST(server_scripts)
-
-AC_SUBST(mysql_plugin_dirs)
-AC_SUBST(mysql_plugin_libs)
-AC_SUBST(mysql_optional_plugins)
-AC_SUBST(mysql_mandatory_plugins)
-
-# Now that sql_client_dirs and sql_server_dirs are stable, determine the union.
-# We support client-only builds by "--without-server", but not vice versa,
-# so we start with the client list, then add each server item not yet present.
-sql_union_dirs=" $sql_client_dirs "
-for DIR in $sql_server_dirs
-do
- if echo " $sql_union_dirs " | grep " $DIR " >/dev/null
- then
- : # already present, skip
- else
- sql_union_dirs="$sql_union_dirs $DIR "
- fi
-done
-AC_SUBST(sql_union_dirs)
-
-#
-# Setup maintainer mode options by the end to not disturb
-# system and other checks.
-#
-MY_MAINTAINER_MODE_SETUP
-
-# Some usefull subst
-AC_SUBST(CC)
-AC_SUBST(GXX)
-
-# Set configuration options for make_binary_distribution
-AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
-
-#--------------------------------------------------------------------
-# Support for WL#2373 (Use cycle counter for timing)
-#--------------------------------------------------------------------
-
-AC_CHECK_HEADERS(time.h)
-AC_CHECK_HEADERS(sys/time.h)
-AC_CHECK_HEADERS(sys/times.h)
-AC_CHECK_HEADERS(asm/msr.h)
-#msr.h has rdtscll()
-
-AC_CHECK_HEADERS(ia64intrin.h)
-
-AC_CHECK_FUNCS(times)
-AC_CHECK_FUNCS(gettimeofday)
-AC_CHECK_FUNCS(read_real_time)
-# This should work on AIX.
-
-AC_CHECK_FUNCS(ftime)
-# This is still a normal call for milliseconds.
-
-AC_CHECK_FUNCS(time)
-# We can use time() on Macintosh if there is no ftime().
-
-AC_CHECK_FUNCS(rdtscll)
-# I doubt that we'll ever reach the check for this.
-
-# When compiling with Sun Studio C / C++ we need to include
-# my_timer_cycles.il, an "inline templates" separate file,
-# on the command line. It has assembly code, "rd %tick" for
-# SPARC or "rdtsc" for x86.
-RDTSC_SPARC_ASSEMBLY=""
-case $CC_VERSION in
- *Sun*C*)
- RDTSC_SPARC_ASSEMBLY="my_timer_cycles.il"
- ;;
-esac
-case $CXX_VERSION in
- *Sun*C++*)
- RDTSC_SPARC_ASSEMBLY="my_timer_cycles.il"
- ;;
-esac
-
-AC_SUBST([RDTSC_SPARC_ASSEMBLY])
-
-
-#--------------------------------------------------------------------
-# 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/strings/Makefile dnl
- unittest/examples/Makefile dnl
- strings/Makefile regex/Makefile storage/Makefile dnl
- man/Makefile BUILD/Makefile vio/Makefile dnl
- libmysql/Makefile libmysql_r/Makefile client/Makefile dnl
- sql/Makefile sql/share/Makefile dnl
- sql/sql_builtin.cc sql-common/Makefile libservices/Makefile dnl
- dbug/Makefile scripts/Makefile include/Makefile dnl
- tests/Makefile Docs/Makefile support-files/Makefile dnl
- support-files/MacOSX/Makefile support-files/RHEL4-SElinux/Makefile dnl
- cmd-line-utils/Makefile cmd-line-utils/libedit/Makefile dnl
- libmysqld/Makefile libmysqld/examples/Makefile dnl
- mysql-test/Makefile mysql-test/lib/My/SafeProcess/Makefile dnl
- sql-bench/Makefile include/mysql_version.h plugin/Makefile win/Makefile dnl
- cmake/Makefile packaging/Makefile
- )
-
-AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
-AC_CONFIG_COMMANDS([my_config.h], cp include/config.h include/my_config.h)
-
-# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS
-AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'")
-
-AC_OUTPUT
-
-echo "---"
-echo "Configuration summary for $PACKAGE_NAME version $VERSION"
-echo "$plugin_report" | sort
-echo ""
-echo " * Installation prefix: $prefix"
-echo " * System type: $SYSTEM_TYPE"
-echo " * Host CPU: $host_cpu"
-echo " * C Compiler: $CC_VERSION"
-echo " * C++ Compiler: $CXX_VERSION"
-echo " * Debug enabled: $with_debug"
-echo " * Community Features: $ENABLE_COMMUNITY_FEATURES"
-echo ""
-echo "---"
-echo ""
-echo "You can find information about MariaDB at"
-echo "http://kb.askmonty.org/"
-echo ""
-echo "Remember to check the platform specific part of the reference manual for"
-echo "hints about installing MariaDB on your platform. Also have a look at the"
-echo "files in the Docs directory."
-
-# The first line "Thank you ..." is checked in ./Do-compile to verify that configure
-# ended sucessfully - don't remove it.
-echo ""
-echo "Thank you for choosing MariaDB!"
-echo ""
diff --git a/dbug/Makefile.am b/dbug/Makefile.am
deleted file mode 100644
index 499ab1a35e6..00000000000
--- a/dbug/Makefile.am
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright (C) 2000, 2002, 2004-2006 MySQL AB
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
-LDADD = libdbug.a ../mysys/libmysys.a ../strings/libmystrings.a
-pkglib_LIBRARIES = libdbug.a
-noinst_HEADERS = dbug_long.h
-libdbug_a_SOURCES = dbug.c
-EXTRA_DIST = CMakeLists.txt example1.c example2.c example3.c \
- user.r monty.doc dbug_add_tags.pl \
- my_main.c main.c factorial.c dbug_analyze.c \
- CMakeLists.txt tests.c tests-t.pl
-NROFF_INC = example1.r example2.r example3.r main.r \
- factorial.r output1.r output2.r output3.r \
- output4.r output5.r
-CLEANFILES = $(NROFF_INC) user.t user.ps tests-t
-
-
-# Must be linked with libs that are not compiled yet
-noinst_PROGRAMS = factorial dbug_analyze tests
-factorial_SOURCES = my_main.c factorial.c
-tests_SOURCES = tests.c
-dbug_analyze_SOURCES = dbug_analyze.c
-
-all: user.t user.ps tests-t
-
-user.t: user.r $(NROFF_INC)
- -nroff -mm user.r > $@
-
-user.ps: user.r $(NROFF_INC)
- -groff -mm user.r > $@
-
-output1.r: factorial
- ./factorial 1 2 3 4 5 | cat > $@
-
-output2.r: factorial
- ./factorial -\#t:o 2 3 | cat >$@
-
-output3.r: factorial
- ./factorial -\#d:t:o 3 | cat >$@
-
-output4.r: factorial
- ./factorial -\#d,result:o 4 | cat >$@
-
-output5.r: factorial
- ./factorial -\#d:f,factorial:F:L:o 3 | cat >$@
-.c.r:
- @RM@ -f $@
- @SED@ -e 's!\\!\\\\!g' $< > $@
-
-# a hack to have executable in builddir, not in srcdir
-tests-t: tests-t.pl
- cp -f $(srcdir)/tests-t.pl ./tests-t
diff --git a/dbug/dbug.c b/dbug/dbug.c
index b85004822bb..da8733c803f 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -53,9 +53,6 @@
* Enhanced Software Technologies, Tempe, AZ
* asuvax!mcdphx!estinc!fnf
*
- * Binayak Banerjee (profiling enhancements)
- * seismo!bpa!sjuvax!bbanerje
- *
* Michael Widenius:
* DBUG_DUMP - To dump a block of memory.
* PUSH_FLAG "O" - To be used insted of "o" if we
@@ -125,7 +122,6 @@
#define DEPTH_ON (1 << 4) /* Function nest level print enabled */
#define PROCESS_ON (1 << 5) /* Process name print enabled */
#define NUMBER_ON (1 << 6) /* Number each line of output */
-#define PROFILE_ON (1 << 7) /* Print out profiling code */
#define PID_ON (1 << 8) /* Identify each line with process id */
#define TIMESTAMP_ON (1 << 9) /* timestamp every line of output */
#define FLUSH_ON_WRITE (1 << 10) /* Flush on every write */
@@ -134,7 +130,6 @@
#define TRACING (cs->stack->flags & TRACE_ON)
#define DEBUGGING (cs->stack->flags & DEBUG_ON)
-#define PROFILING (cs->stack->flags & PROFILE_ON)
/*
* Typedefs to make things more obvious.
@@ -151,24 +146,6 @@
#define AUTO auto /* Names to be allocated on stack */
#define REGISTER register /* Names to be placed in registers */
-/*
- * The default file for profiling. Could also add another flag
- * (G?) which allowed the user to specify this.
- *
- * If the automatic variables get allocated on the stack in
- * reverse order from their declarations, then define AUTOS_REVERSE to 1.
- * This is used by the code that keeps track of stack usage. For
- * forward allocation, the difference in the dbug frame pointers
- * represents stack used by the callee function. For reverse allocation,
- * the difference represents stack used by the caller function.
- *
- */
-
-#define PROF_FILE "dbugmon.out"
-#define PROF_EFMT "E\t%ld\t%s\n"
-#define PROF_SFMT "S\t%lx\t%lx\t%s\n"
-#define PROF_XFMT "X\t%ld\t%s\n"
-
#ifdef M_I386 /* predefined by xenix 386 compiler */
#define AUTOS_REVERSE 1
#else
@@ -219,10 +196,8 @@ struct settings {
uint delay; /* Delay after each output line */
uint sub_level; /* Sub this from code_state->level */
FILE *out_file; /* Current output stream */
- FILE *prof_file; /* Current profiling stream */
char name[FN_REFLEN]; /* Name of output file */
struct link *functions; /* List of functions */
- struct link *p_functions; /* List of profiled functions */
struct link *keywords; /* List of debug keywords */
struct link *processes; /* List of process names */
struct settings *next; /* Next settings in the list */
@@ -319,15 +294,6 @@ static void DbugExit(const char *why);
static const char *DbugStrTok(const char *s);
static void DbugVfprintf(FILE *stream, const char* format, va_list args);
-#ifndef THREAD
- /* Open profile output stream */
-static FILE *OpenProfile(CODE_STATE *cs, const char *name);
- /* Profile if asked for it */
-static BOOLEAN DoProfile(CODE_STATE *);
- /* Return current user time (ms) */
-static unsigned long Clock(void);
-#endif
-
/*
* Miscellaneous printf format strings.
*/
@@ -355,7 +321,6 @@ static unsigned long Clock(void);
** Macros to allow dbugging with threads
*/
-#ifdef THREAD
#include <my_pthread.h>
static pthread_mutex_t THR_LOCK_dbug;
@@ -394,30 +359,6 @@ static CODE_STATE *code_state(void)
return cs;
}
-#else /* !THREAD */
-
-static CODE_STATE static_code_state=
-{
- "dbug", "?func", "?file", NULL, &init_settings,
- NullS, NullS, 0,0,0,0,0,NullS
-};
-
-static CODE_STATE *code_state(void)
-{
- if (!init_done)
- {
- bzero(&init_settings, sizeof(init_settings));
- init_settings.out_file=stderr;
- init_settings.flags=OPEN_APPEND;
- init_done=TRUE;
- }
- return &static_code_state;
-}
-
-#define pthread_mutex_lock(A) {}
-#define pthread_mutex_unlock(A) {}
-#endif
-
/*
* Translate some calls among different systems.
*/
@@ -509,9 +450,7 @@ int DbugParse(CODE_STATE *cs, const char *control)
stack->maxdepth= 0;
stack->sub_level= 0;
stack->out_file= stderr;
- stack->prof_file= NULL;
stack->functions= NULL;
- stack->p_functions= NULL;
stack->keywords= NULL;
stack->processes= NULL;
}
@@ -522,20 +461,23 @@ int DbugParse(CODE_STATE *cs, const char *control)
stack->maxdepth= stack->next->maxdepth;
stack->sub_level= stack->next->sub_level;
strcpy(stack->name, stack->next->name);
- stack->out_file= stack->next->out_file;
- stack->prof_file= stack->next->prof_file;
if (stack->next == &init_settings)
{
- /* never share with the global parent - it can change under your feet */
+ /*
+ Never share with the global parent - it can change under your feet.
+
+ Reset out_file to stderr to prevent sharing of trace files between
+ global and session settings.
+ */
+ stack->out_file= stderr;
stack->functions= ListCopy(init_settings.functions);
- stack->p_functions= ListCopy(init_settings.p_functions);
stack->keywords= ListCopy(init_settings.keywords);
stack->processes= ListCopy(init_settings.processes);
}
else
{
+ stack->out_file= stack->next->out_file;
stack->functions= stack->next->functions;
- stack->p_functions= stack->next->p_functions;
stack->keywords= stack->next->keywords;
stack->processes= stack->next->processes;
}
@@ -602,15 +544,6 @@ int DbugParse(CODE_STATE *cs, const char *control)
else
stack->flags |= PID_ON;
break;
-#ifndef THREAD
- case 'g':
- if (OpenProfile(cs, PROF_FILE))
- {
- stack->flags |= PROFILE_ON;
- stack->p_functions= ListAdd(stack->p_functions, control, end);
- }
- break;
-#endif
case 'L':
if (sign < 0)
stack->flags &= ~LINE_ON;
@@ -911,6 +844,7 @@ void _db_set_init_(const char *control)
CODE_STATE tmp_cs;
bzero((uchar*) &tmp_cs, sizeof(tmp_cs));
tmp_cs.stack= &init_settings;
+ tmp_cs.process= db_process ? db_process : "dbug";
DbugParse(&tmp_cs, control);
}
@@ -1052,7 +986,6 @@ int _db_explain_ (CODE_STATE *cs, char *buf, size_t len)
op_list_to_buf('f', cs->stack->functions, cs->stack->functions);
op_bool_to_buf('F', cs->stack->flags & FILE_ON);
op_bool_to_buf('i', cs->stack->flags & PID_ON);
- op_list_to_buf('g', cs->stack->p_functions, PROFILING);
op_bool_to_buf('L', cs->stack->flags & LINE_ON);
op_bool_to_buf('n', cs->stack->flags & DEPTH_ON);
op_bool_to_buf('N', cs->stack->flags & NUMBER_ON);
@@ -1159,23 +1092,7 @@ void _db_enter_(const char *_func_, const char *_file_,
_stack_frame_->prev= cs->framep;
_stack_frame_->level= ++cs->level | framep_trace_flag(cs, cs->framep);
cs->framep= _stack_frame_;
-#ifndef THREAD
- if (DoProfile(cs))
- {
- long stackused;
- if (cs->framep->prev == NULL)
- stackused= 0;
- else
- {
- stackused= (char*)(cs->framep->prev) - (char*)(cs->framep);
- stackused= stackused > 0 ? stackused : -stackused;
- }
- (void) fprintf(cs->stack->prof_file, PROF_EFMT , Clock(), cs->func);
- (void) fprintf(cs->stack->prof_file, PROF_SFMT, (ulong) cs->framep, stackused,
- AUTOS_REVERSE ? _stack_frame_->func : cs->func);
- (void) fflush(cs->stack->prof_file);
- }
-#endif
+
switch (DoTrace(cs)) {
case ENABLE_TRACE:
cs->framep->level|= TRACE_ON;
@@ -1234,10 +1151,7 @@ void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_)
my_snprintf(buf, sizeof(buf), ERR_MISSING_RETURN, cs->func);
DbugExit(buf);
}
-#ifndef THREAD
- if (DoProfile(cs))
- (void) fprintf(cs->stack->prof_file, PROF_XFMT, Clock(), cs->func);
-#endif
+
if (DoTrace(cs) & DO_TRACE)
{
if (TRACING)
@@ -1650,19 +1564,12 @@ static void FreeState(CODE_STATE *cs, struct settings *state, int free_state)
FreeList(state->functions);
if (!is_shared(state, processes))
FreeList(state->processes);
- if (!is_shared(state, p_functions))
- FreeList(state->p_functions);
if (!is_shared(state, out_file))
DBUGCloseFile(cs, state->out_file);
else
(void) fflush(state->out_file);
- if (!is_shared(state, prof_file))
- DBUGCloseFile(cs, state->prof_file);
- else
- (void) fflush(state->prof_file);
-
if (free_state)
free((void*) state);
}
@@ -1710,12 +1617,10 @@ void _db_end_()
pthread_mutex_lock(&THR_LOCK_dbug);
init_settings.flags= OPEN_APPEND;
init_settings.out_file= stderr;
- init_settings.prof_file= stderr;
init_settings.maxdepth= 0;
init_settings.delay= 0;
init_settings.sub_level= 0;
init_settings.functions= 0;
- init_settings.p_functions= 0;
init_settings.keywords= 0;
init_settings.processes= 0;
pthread_mutex_unlock(&THR_LOCK_dbug);
@@ -1754,36 +1659,6 @@ static int DoTrace(CODE_STATE *cs)
return DONT_TRACE;
}
-
-/*
- * FUNCTION
- *
- * DoProfile check to see if profiling is current enabled
- *
- * SYNOPSIS
- *
- * static BOOLEAN DoProfile()
- *
- * DESCRIPTION
- *
- * Checks to see if profiling is enabled based on whether the
- * user has specified profiling, the maximum trace depth has
- * not yet been reached, the current function is selected,
- * and the current process is selected. Returns TRUE if
- * profiling is enabled, FALSE otherwise.
- *
- */
-
-#ifndef THREAD
-static BOOLEAN DoProfile(CODE_STATE *cs)
-{
- return (PROFILING &&
- cs->level <= cs->stack->maxdepth &&
- InList(cs->stack->p_functions, cs->func, 0) & (INCLUDE|MATCHED) &&
- InList(cs->stack->processes, cs->process, 0) & (INCLUDE|MATCHED));
-}
-#endif
-
FILE *_db_fp_(void)
{
CODE_STATE *cs;
@@ -1910,11 +1785,7 @@ static void DoPrefix(CODE_STATE *cs, uint _line_)
cs->lineno++;
if (cs->stack->flags & PID_ON)
{
-#ifdef THREAD
(void) fprintf(cs->stack->out_file, "%-7s: ", my_thread_name());
-#else
- (void) fprintf(cs->stack->out_file, "%5d: ", (int) getpid());
-#endif
}
if (cs->stack->flags & NUMBER_ON)
(void) fprintf(cs->stack->out_file, "%5d: ", cs->lineno);
@@ -2024,63 +1895,6 @@ static void DBUGOpenFile(CODE_STATE *cs,
}
}
-
-/*
- * FUNCTION
- *
- * OpenProfile open new output stream for profiler output
- *
- * SYNOPSIS
- *
- * static FILE *OpenProfile(name)
- * char *name;
- *
- * DESCRIPTION
- *
- * Given name of a new file, opens the file
- * and sets the profiler output stream to the new file.
- *
- * It is currently unclear whether the prefered behavior is
- * to truncate any existing file, or simply append to it.
- * The latter behavior would be desirable for collecting
- * accumulated runtime history over a number of separate
- * runs. It might take some changes to the analyzer program
- * though, and the notes that Binayak sent with the profiling
- * diffs indicated that append was the normal mode, but this
- * does not appear to agree with the actual code. I haven't
- * investigated at this time [fnf; 24-Jul-87].
- */
-
-#ifndef THREAD
-static FILE *OpenProfile(CODE_STATE *cs, const char *name)
-{
- REGISTER FILE *fp;
- REGISTER BOOLEAN newfile;
-
- fp=0;
- if (!Writable(name))
- {
- (void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name);
- perror("");
- (void) Delay(cs->stack->delay);
- }
- else
- {
- newfile= !EXISTS(name);
- if (!(fp= fopen(name, "w")))
- {
- (void) fprintf(cs->stack->out_file, ERR_OPEN, cs->process, name);
- perror("");
- }
- else
- {
- cs->stack->prof_file= fp;
- }
- }
- return fp;
-}
-#endif
-
/*
* FUNCTION
*
@@ -2382,12 +2196,31 @@ static void DbugFlush(CODE_STATE *cs)
void _db_flush_()
{
- CODE_STATE *cs;
+ CODE_STATE *cs= NULL;
get_code_state_or_return;
(void) fflush(cs->stack->out_file);
}
+#ifndef __WIN__
+void _db_suicide_()
+{
+ int retval;
+ sigset_t new_mask;
+ sigfillset(&new_mask);
+
+ fprintf(stderr, "SIGKILL myself\n");
+ fflush(stderr);
+
+ retval= kill(getpid(), SIGKILL);
+ assert(retval == 0);
+ retval= sigsuspend(&new_mask);
+ fprintf(stderr, "sigsuspend returned %d errno %d \n", retval, errno);
+ assert(FALSE); /* With full signal mask, we should never return here. */
+}
+#endif /* ! __WIN__ */
+
+
void _db_lock_file_()
{
CODE_STATE *cs;
@@ -2411,80 +2244,6 @@ const char* _db_get_func_(void)
return cs->func;
}
-/*
- * Here we need the definitions of the clock routine. Add your
- * own for whatever system that you have.
- */
-
-#ifndef THREAD
-#if defined(HAVE_GETRUSAGE)
-
-#include <sys/param.h>
-#include <sys/resource.h>
-
-/* extern int getrusage(int, struct rusage *); */
-
-/*
- * Returns the user time in milliseconds used by this process so
- * far.
- */
-
-static unsigned long Clock()
-{
- struct rusage ru;
-
- (void) getrusage(RUSAGE_SELF, &ru);
- return ru.ru_utime.tv_sec*1000 + ru.ru_utime.tv_usec/1000;
-}
-
-#elif defined(__WIN__)
-
-static ulong Clock()
-{
- return clock()*(1000/CLOCKS_PER_SEC);
-}
-#elif defined(amiga)
-
-struct DateStamp { /* Yes, this is a hack, but doing it right */
- long ds_Days; /* is incredibly ugly without splitting this */
- long ds_Minute; /* off into a separate file */
- long ds_Tick;
-};
-
-static int first_clock= TRUE;
-static struct DateStamp begin;
-static struct DateStamp elapsed;
-
-static unsigned long Clock()
-{
- register struct DateStamp *now;
- register unsigned long millisec= 0;
- extern VOID *AllocMem();
-
- now= (struct DateStamp *) AllocMem((long) sizeof(struct DateStamp), 0L);
- if (now != NULL)
- {
- if (first_clock == TRUE)
- {
- first_clock= FALSE;
- (void) DateStamp(now);
- begin= *now;
- }
- (void) DateStamp(now);
- millisec= 24 * 3600 * (1000 / HZ) * (now->ds_Days - begin.ds_Days);
- millisec += 60 * (1000 / HZ) * (now->ds_Minute - begin.ds_Minute);
- millisec += (1000 / HZ) * (now->ds_Tick - begin.ds_Tick);
- (void) FreeMem(now, (long) sizeof(struct DateStamp));
- }
- return millisec;
-}
-#else
-static unsigned long Clock()
-{
- return 0;
-}
-#endif /* RUSAGE */
-#endif /* THREADS */
#else
diff --git a/dbug/dbug_add_tags.pl b/dbug/dbug_add_tags.pl
index 3e51a54c707..e6daa352823 100755
--- a/dbug/dbug_add_tags.pl
+++ b/dbug/dbug_add_tags.pl
@@ -1,5 +1,20 @@
#!/usr/bin/perl
+# Copyright (C) 2002 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
+
die "No files specified\n" unless $ARGV[0];
$ctags="exctags -x -f - --c-types=f -u";
diff --git a/dbug/dbug_analyze.c b/dbug/dbug_analyze.c
deleted file mode 100644
index 1ebe8bfd77e..00000000000
--- a/dbug/dbug_analyze.c
+++ /dev/null
@@ -1,610 +0,0 @@
-/*
- * Analyze the profile file (cmon.out) written out by the dbug
- * routines with profiling enabled.
- *
- * Copyright June 1987, Binayak Banerjee
- * All rights reserved.
- *
- * This program may be freely distributed under the same terms and
- * conditions as Fred Fish's Dbug package.
- *
- * Compile with -- cc -O -s -o %s analyze.c
- *
- * Analyze will read an trace file created by the dbug package
- * (when run with traceing enabled). It will then produce a
- * summary on standard output listing the name of each traced
- * function, the number of times it was called, the percentage
- * of total calls, the time spent executing the function, the
- * proportion of the total time and the 'importance'. The last
- * is a metric which is obtained by multiplying the proportions
- * of calls and the proportions of time for each function. The
- * greater the importance, the more likely it is that a speedup
- * could be obtained by reducing the time taken by that function.
- *
- * Note that the timing values that you obtain are only rough
- * measures. The overhead of the dbug package is included
- * within. However, there is no need to link in special profiled
- * libraries and the like.
- *
- * CHANGES:
- *
- * 2-Mar-89: fnf
- * Changes to support tracking of stack usage. This required
- * reordering the fields in the profile log file to make
- * parsing of different record types easier. Corresponding
- * changes made in dbug runtime library. Also used this
- * opportunity to reformat the code more to my liking (my
- * apologies to Binayak Banerjee for "uglifying" his code).
- *
- * 24-Jul-87: fnf
- * Because I tend to use functions names like
- * "ExternalFunctionDoingSomething", I've rearranged the
- * printout to put the function name last in each line, so
- * long names don't screw up the formatting unless they are
- * *very* long and wrap around the screen width...
- *
- * 24-Jul-87: fnf
- * Modified to put out table very similar to Unix profiler
- * by default, but also puts out original verbose table
- * if invoked with -v flag.
- */
-
-#include <my_global.h>
-#include <m_string.h>
-#include <my_pthread.h>
-
-static char *my_name;
-static int verbose;
-
-/*
- * Structure of the stack.
- */
-
-#define PRO_FILE "dbugmon.out" /* Default output file name */
-#define STACKSIZ 100 /* Maximum function nesting */
-#define MAXPROCS 10000 /* Maximum number of function calls */
-
-# ifdef BSD
-# include <sysexits.h>
-# else
-# define EX_SOFTWARE 1
-# define EX_DATAERR 1
-# define EX_USAGE 1
-# define EX_OSERR 1
-# define EX_IOERR 1
-#ifndef EX_OK
-# define EX_OK 0
-#endif
-# endif
-
-#define __MERF_OO_ "%s: Malloc Failed in %s: %d\n"
-
-#define MALLOC(Ptr,Num,Typ) do /* Malloc w/error checking & exit */ \
- if (!(Ptr = (Typ *)malloc((Num)*(sizeof(Typ))))) \
- {fprintf(stderr,__MERF_OO_,my_name,__FILE__,__LINE__);\
- exit(EX_OSERR);} while(0)
-
-#define Malloc(Ptr,Num,Typ) do /* Weaker version of above */\
- if (!(Ptr = (Typ *)malloc((Num)*(sizeof(Typ))))) \
- fprintf(stderr,__MERF_OO_,my_name,__FILE__,__LINE__);\
- while(0)
-
-#define FILEOPEN(Fp,Fn,Mod) do /* File open with error exit */ \
- if (!(Fp = fopen(Fn,Mod)))\
- {fprintf(stderr,"%s: Couldn't open %s\n",my_name,Fn);\
- exit(EX_IOERR);} while(0)
-
-#define Fileopen(Fp,Fn,Mod) do /* Weaker version of above */ \
- if(!(Fp = fopen(Fn,Mod))) \
- fprintf(stderr,"%s: Couldn't open %s\n",my_name,Fn);\
- while(0)
-
-
-struct stack_t {
- unsigned int pos; /* which function? */
- unsigned long time; /* Time that this was entered */
- unsigned long children; /* Time spent in called funcs */
-};
-
-static struct stack_t fn_stack[STACKSIZ+1];
-
-static unsigned int stacktop = 0; /* Lowest stack position is a dummy */
-
-static unsigned long tot_time = 0;
-static unsigned long tot_calls = 0;
-static unsigned long highstack = 0;
-static unsigned long lowstack = (ulong) ~0;
-
-/*
- * top() returns a pointer to the top item on the stack.
- * (was a function, now a macro)
- */
-
-#define top() &fn_stack[stacktop]
-
-/*
- * Push - Push the given record on the stack.
- */
-
-void push (name_pos, time_entered)
-register unsigned int name_pos;
-register unsigned long time_entered;
-{
- register struct stack_t *t;
-
- DBUG_ENTER("push");
- if (++stacktop > STACKSIZ) {
- fprintf (DBUG_FILE,"%s: stack overflow (%s:%d)\n",
- my_name, __FILE__, __LINE__);
- exit (EX_SOFTWARE);
- }
- DBUG_PRINT ("push", ("%d %ld",name_pos,time_entered));
- t = &fn_stack[stacktop];
- t -> pos = name_pos;
- t -> time = time_entered;
- t -> children = 0;
- DBUG_VOID_RETURN;
-}
-
-/*
- * Pop - pop the top item off the stack, assigning the field values
- * to the arguments. Returns 0 on stack underflow, or on popping first
- * item off stack.
- */
-
-unsigned int pop (name_pos, time_entered, child_time)
-register unsigned int *name_pos;
-register unsigned long *time_entered;
-register unsigned long *child_time;
-{
- register struct stack_t *temp;
- register unsigned int rtnval;
-
- DBUG_ENTER ("pop");
-
- if (stacktop < 1) {
- rtnval = 0;
- } else {
- temp = &fn_stack[stacktop];
- *name_pos = temp->pos;
- *time_entered = temp->time;
- *child_time = temp->children;
- DBUG_PRINT ("pop", ("%d %lu %lu",*name_pos,*time_entered,*child_time));
- rtnval = stacktop--;
- }
- DBUG_RETURN (rtnval);
-}
-
-/*
- * We keep the function info in another array (serves as a simple
- * symbol table)
- */
-
-struct module_t {
- char *name;
- unsigned long m_time;
- unsigned long m_calls;
- unsigned long m_stkuse;
-};
-
-static struct module_t modules[MAXPROCS];
-
-/*
- * We keep a binary search tree in order to look up function names
- * quickly (and sort them at the end.
- */
-
-struct bnode {
- unsigned int lchild; /* Index of left subtree */
- unsigned int rchild; /* Index of right subtree */
- unsigned int pos; /* Index of module_name entry */
-};
-
-static struct bnode s_table[MAXPROCS];
-
-static unsigned int n_items = 0; /* No. of items in the array so far */
-
-/*
- * Need a function to allocate space for a string and squirrel it away.
- */
-
-char *strsave (s)
-char *s;
-{
- register char *retval;
- register unsigned int len;
-
- DBUG_ENTER ("strsave");
- DBUG_PRINT ("strsave", ("%s",s));
- if (!s || (len = strlen (s)) == 0) {
- DBUG_RETURN (0);
- }
- MALLOC (retval, ++len, char);
- strcpy (retval, s);
- DBUG_RETURN (retval);
-}
-
-/*
- * add() - adds m_name to the table (if not already there), and returns
- * the index of its location in the table. Checks s_table (which is a
- * binary search tree) to see whether or not it should be added.
- */
-
-unsigned int add (m_name)
-char *m_name;
-{
- register unsigned int ind = 0;
- register int cmp;
-
- DBUG_ENTER ("add");
- if (n_items == 0) { /* First item to be added */
- s_table[0].pos = ind;
- s_table[0].lchild = s_table[0].rchild = MAXPROCS;
- addit:
- modules[n_items].name = strsave (m_name);
- modules[n_items].m_time = 0;
- modules[n_items].m_calls = 0;
- modules[n_items].m_stkuse = 0;
- DBUG_RETURN (n_items++);
- }
- while ((cmp = strcmp (m_name,modules[ind].name))) {
- if (cmp < 0) { /* In left subtree */
- if (s_table[ind].lchild == MAXPROCS) {
- /* Add as left child */
- if (n_items >= MAXPROCS) {
- fprintf (DBUG_FILE,
- "%s: Too many functions being profiled\n",
- my_name);
- exit (EX_SOFTWARE);
- }
- s_table[n_items].pos = s_table[ind].lchild = n_items;
- s_table[n_items].lchild = s_table[n_items].rchild = MAXPROCS;
-#ifdef notdef
- modules[n_items].name = strsave (m_name);
- modules[n_items].m_time = modules[n_items].m_calls = 0;
- DBUG_RETURN (n_items++);
-#else
- goto addit;
-#endif
-
- }
- ind = s_table[ind].lchild; /* else traverse l-tree */
- } else {
- if (s_table[ind].rchild == MAXPROCS) {
- /* Add as right child */
- if (n_items >= MAXPROCS) {
- fprintf (DBUG_FILE,
- "%s: Too many functions being profiled\n",
- my_name);
- exit (EX_SOFTWARE);
- }
- s_table[n_items].pos = s_table[ind].rchild = n_items;
- s_table[n_items].lchild = s_table[n_items].rchild = MAXPROCS;
-#ifdef notdef
- modules[n_items].name = strsave (m_name);
- modules[n_items].m_time = modules[n_items].m_calls = 0;
- DBUG_RETURN (n_items++);
-#else
- goto addit;
-#endif
-
- }
- ind = s_table[ind].rchild; /* else traverse r-tree */
- }
- }
- DBUG_RETURN (ind);
-}
-
-/*
- * process() - process the input file, filling in the modules table.
- */
-
-void process (inf)
-FILE *inf;
-{
- char buf[BUFSIZ];
- char fn_name[64]; /* Max length of fn_name */
- unsigned long fn_time;
- unsigned long fn_sbot;
- unsigned long fn_ssz;
- unsigned long lastuse;
- unsigned int pos;
- unsigned long local_time;
- unsigned int oldpos;
- unsigned long oldtime;
- unsigned long oldchild;
- struct stack_t *t;
-
- DBUG_ENTER ("process");
- while (fgets (buf,BUFSIZ,inf) != NULL) {
- switch (buf[0]) {
- case 'E':
- sscanf (buf+2, "%ld %64s", &fn_time, fn_name);
- DBUG_PRINT ("erec", ("%ld %s", fn_time, fn_name));
- pos = add (fn_name);
- push (pos, fn_time);
- break;
- case 'X':
- sscanf (buf+2, "%ld %64s", &fn_time, fn_name);
- DBUG_PRINT ("xrec", ("%ld %s", fn_time, fn_name));
- pos = add (fn_name);
- /*
- * An exited function implies that all stacked
- * functions are also exited, until the matching
- * function is found on the stack.
- */
- while (pop (&oldpos, &oldtime, &oldchild)) {
- DBUG_PRINT ("popped", ("%lu %lu", oldtime, oldchild));
- local_time = fn_time - oldtime;
- t = top ();
- t -> children += local_time;
- DBUG_PRINT ("update", ("%s", modules[t -> pos].name));
- DBUG_PRINT ("update", ("%lu", t -> children));
- local_time -= oldchild;
- modules[oldpos].m_time += local_time;
- modules[oldpos].m_calls++;
- tot_time += local_time;
- tot_calls++;
- if (pos == oldpos) {
- goto next_line; /* Should be a break2 */
- }
- }
- /*
- * Assume that item seen started at time 0.
- * (True for function main). But initialize
- * it so that it works the next time too.
- */
- t = top ();
- local_time = fn_time - t -> time - t -> children;
- t -> time = fn_time; t -> children = 0;
- modules[pos].m_time += local_time;
- modules[pos].m_calls++;
- tot_time += local_time;
- tot_calls++;
- break;
- case 'S':
- sscanf (buf+2, "%lx %lx %64s", &fn_sbot, &fn_ssz, fn_name);
- DBUG_PRINT ("srec", ("%lx %lx %s", fn_sbot, fn_ssz, fn_name));
- pos = add (fn_name);
- lastuse = modules[pos].m_stkuse;
-#if 0
- /*
- * Needs further thought. Stack use is determined by
- * difference in stack between two functions with DBUG_ENTER
- * macros. If A calls B calls C, where A and C have the
- * macros, and B doesn't, then B's stack use will be lumped
- * in with either A's or C's. If somewhere else A calls
- * C directly, the stack use will seem to change. Just
- * take the biggest for now...
- */
- if (lastuse > 0 && lastuse != fn_ssz) {
- fprintf (stderr,
- "warning - %s stack use changed (%lx to %lx)\n",
- fn_name, lastuse, fn_ssz);
- }
-#endif
- if (fn_ssz > lastuse) {
- modules[pos].m_stkuse = fn_ssz;
- }
- if (fn_sbot > highstack) {
- highstack = fn_sbot;
- } else if (fn_sbot < lowstack) {
- lowstack = fn_sbot;
- }
- break;
- default:
- fprintf (stderr, "unknown record type '%c'\n", buf[0]);
- break;
- }
- next_line:;
- }
-
- /*
- * Now, we've hit eof. If we still have stuff stacked, then we
- * assume that the user called exit, so give everything the exited
- * time of fn_time.
- */
- while (pop (&oldpos,&oldtime,&oldchild)) {
- local_time = fn_time - oldtime;
- t = top ();
- t -> children += local_time;
- local_time -= oldchild;
- modules[oldpos].m_time += local_time;
- modules[oldpos].m_calls++;
- tot_time += local_time;
- tot_calls++;
- }
- DBUG_VOID_RETURN;
-}
-
-/*
- * out_header () -- print out the header of the report.
- */
-
-void out_header (outf)
-FILE *outf;
-{
- DBUG_ENTER ("out_header");
- if (verbose) {
- fprintf (outf, "Profile of Execution\n");
- fprintf (outf, "Execution times are in milliseconds\n\n");
- fprintf (outf, " Calls\t\t\t Time\n");
- fprintf (outf, " -----\t\t\t ----\n");
- fprintf (outf, "Times\tPercentage\tTime Spent\tPercentage\n");
- fprintf (outf, "Called\tof total\tin Function\tof total Importance\tFunction\n");
- fprintf (outf, "======\t==========\t===========\t========== ==========\t========\t\n");
- } else {
- fprintf (outf, "%ld bytes of stack used, from %lx down to %lx\n\n",
- highstack - lowstack, highstack, lowstack);
- fprintf (outf,
- " %%time sec #call ms/call %%calls weight stack name\n");
- }
- DBUG_VOID_RETURN;
-}
-
-/*
- * out_trailer () - writes out the summary line of the report.
- */
-
-void out_trailer (outf,sum_calls,sum_time)
-FILE *outf;
-unsigned long int sum_calls, sum_time;
-{
- DBUG_ENTER ("out_trailer");
- if (verbose)
- {
- fprintf(outf, "======\t==========\t===========\t==========\t========\n");
- fprintf(outf, "%6ld\t%10.2f\t%11ld\t%10.2f\t\t%-15s\n",
- sum_calls, 100.0, sum_time, 100.0, "Totals");
- }
- DBUG_VOID_RETURN;
-}
-
-/*
- * out_item () - prints out the output line for a single entry,
- * and sets the calls and time fields appropriately.
- */
-
-void out_item (outf, m,called,timed)
-FILE *outf;
-register struct module_t *m;
-unsigned long int *called, *timed;
-{
- char *name = m -> name;
- register unsigned int calls = m -> m_calls;
- register unsigned long local_time = m -> m_time;
- register unsigned long stkuse = m -> m_stkuse;
- unsigned int import;
- double per_time = 0.0;
- double per_calls = 0.0;
- double ms_per_call, local_ftime;
-
- DBUG_ENTER ("out_item");
-
- if (tot_time > 0) {
- per_time = (double) (local_time * 100) / (double) tot_time;
- }
- if (tot_calls > 0) {
- per_calls = (double) (calls * 100) / (double) tot_calls;
- }
- import = (unsigned int) (per_time * per_calls);
-
- if (verbose) {
- fprintf (outf, "%6d\t%10.2f\t%11ld\t%10.2f %10d\t%-15s\n",
- calls, per_calls, local_time, per_time, import, name);
- } else {
- ms_per_call = local_time;
- ms_per_call /= calls;
- local_ftime = local_time;
- local_ftime /= 1000;
- fprintf(outf, "%8.2f%8.3f%8u%8.3f%8.2f%8u%8lu %-s\n",
- per_time, local_ftime, calls, ms_per_call, per_calls, import,
- stkuse, name);
- }
- *called = calls;
- *timed = local_time;
- DBUG_VOID_RETURN;
-}
-
-/*
- * out_body (outf, root,s_calls,s_time) -- Performs an inorder traversal
- * on the binary search tree (root). Calls out_item to actually print
- * the item out.
- */
-
-void out_body (outf, root,s_calls,s_time)
-FILE *outf;
-register unsigned int root;
-register unsigned long int *s_calls, *s_time;
-{
- unsigned long int calls, local_time;
-
- DBUG_ENTER ("out_body");
- DBUG_PRINT ("out_body", ("%lu,%lu",*s_calls,*s_time));
- if (root == MAXPROCS) {
- DBUG_PRINT ("out_body", ("%lu,%lu",*s_calls,*s_time));
- } else {
- while (root != MAXPROCS) {
- out_body (outf, s_table[root].lchild,s_calls,s_time);
- out_item (outf, &modules[s_table[root].pos],&calls,&local_time);
- DBUG_PRINT ("out_body", ("-- %lu -- %lu --", calls, local_time));
- *s_calls += calls;
- *s_time += local_time;
- root = s_table[root].rchild;
- }
- DBUG_PRINT ("out_body", ("%lu,%lu", *s_calls, *s_time));
- }
- DBUG_VOID_RETURN;
-}
-
-/*
- * output () - print out a nice sorted output report on outf.
- */
-
-void output (outf)
-FILE *outf;
-{
- unsigned long int sum_calls = 0;
- unsigned long int sum_time = 0;
-
- DBUG_ENTER ("output");
- if (n_items == 0) {
- fprintf (outf, "%s: No functions to trace\n", my_name);
- exit (EX_DATAERR);
- }
- out_header (outf);
- out_body (outf, 0,&sum_calls,&sum_time);
- out_trailer (outf, sum_calls,sum_time);
- DBUG_VOID_RETURN;
-}
-
-
-#define usage() fprintf (DBUG_FILE,"Usage: %s [-v] [prof-file]\n",my_name)
-
-extern int optind;
-extern char *optarg;
-
-int main (int argc, char **argv)
-{
- register int c;
- int badflg = 0;
- FILE *infile;
- FILE *outfile = {stdout};
-
-#ifdef THREAD
-#if defined(HAVE_PTHREAD_INIT)
- pthread_init(); /* Must be called before DBUG_ENTER */
-#endif
- my_thread_global_init();
-#endif /* THREAD */
- {
- DBUG_ENTER ("main");
- DBUG_PROCESS (argv[0]);
- my_name = argv[0];
- while ((c = getopt (argc,argv,"#:v")) != EOF) {
- switch (c) {
- case '#': /* Debugging Macro enable */
- DBUG_PUSH (optarg);
- break;
- case 'v': /* Verbose mode */
- verbose++;
- break;
- default:
- badflg++;
- break;
- }
- }
- if (badflg) {
- usage ();
- DBUG_RETURN (EX_USAGE);
- }
- if (optind < argc) {
- FILEOPEN (infile, argv[optind], "r");
- } else {
- FILEOPEN (infile, PRO_FILE, "r");
- }
- process (infile);
- output (outfile);
- DBUG_RETURN (EX_OK);
- }
-}
diff --git a/dbug/my_main.c b/dbug/my_main.c
index 31c15aa67aa..48d092ca10a 100644
--- a/dbug/my_main.c
+++ b/dbug/my_main.c
@@ -16,12 +16,11 @@ char *argv[];
{
register int result, ix;
extern int factorial(int);
-#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
+#if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */
#endif
-#ifdef THREAD
my_thread_global_init();
-#endif
+
{
DBUG_ENTER ("main");
DBUG_PROCESS (argv[0]);
diff --git a/dbug/tests.c b/dbug/tests.c
index d76266d34a3..837a477aef3 100644
--- a/dbug/tests.c
+++ b/dbug/tests.c
@@ -44,12 +44,11 @@ int main (int argc, char *argv[])
if (argc == 1)
return 0;
-#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
+#if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */
#endif
-#ifdef THREAD
my_thread_global_init();
-#endif
+
dup2(1, 2);
for (i = 1; i < argc; i++)
{
diff --git a/extra/Makefile.am b/extra/Makefile.am
deleted file mode 100644
index 0b829f6ad33..00000000000
--- a/extra/Makefile.am
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright (C) 2000-2006 MySQL AB, 2009 Monty Program AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
- -I$(top_srcdir)/sql
-LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \
- ../dbug/libdbug.a ../strings/libmystrings.a \
- $(ZLIB_LIBS)
-BUILT_SOURCES= $(top_builddir)/include/mysqld_error.h \
- $(top_builddir)/include/sql_state.h \
- $(top_builddir)/include/mysqld_ername.h
-pkginclude_HEADERS= $(BUILT_SOURCES)
-EXTRA_PROGRAMS = comp_err
-DISTCLEANFILES = $(BUILT_SOURCES) $(EXTRA_PROGRAMS)
-SUBDIRS = @yassl_dir@ @libevent_dir@
-DIST_SUBDIRS = yassl libevent
-
-# This will build mysqld_error.h, mysqld_ername.h and sql_state.h
-# NOTE Built files should depend on their sources to avoid
-# the built files being rebuilt in source dist
-$(top_builddir)/include/mysqld_error.h: comp_err.c \
- $(top_srcdir)/sql/share/errmsg-utf8.txt
- $(MAKE) $(AM_MAKEFLAGS) comp_err$(EXEEXT)
- $(top_builddir)/extra/comp_err$(EXEEXT) \
- --charset=$(top_srcdir)/sql/share/charsets \
- --out-dir=$(top_builddir)/sql/share/ \
- --header_file=$(top_builddir)/include/mysqld_error.h \
- --name_file=$(top_builddir)/include/mysqld_ername.h \
- --state_file=$(top_builddir)/include/sql_state.h \
- --in_file=$(top_srcdir)/sql/share/errmsg-utf8.txt
-$(top_builddir)/include/mysqld_ername.h: $(top_builddir)/include/mysqld_error.h
-$(top_builddir)/include/sql_state.h: $(top_builddir)/include/mysqld_error.h
-
-bin_PROGRAMS = replace perror resolveip my_print_defaults \
- resolve_stack_dump mysql_waitpid
-# "innochecksum" should be switched
-if BUILD_INNODB_TOOLS
-bin_PROGRAMS += innochecksum
-endif
-
-noinst_PROGRAMS = charset2html
-EXTRA_DIST = CMakeLists.txt
-
-perror.o: perror.c
- $(COMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
diff --git a/extra/comp_err.c b/extra/comp_err.c
index 50dbba97c1b..c3d8f8ac01b 100644
--- a/extra/comp_err.c
+++ b/extra/comp_err.c
@@ -220,14 +220,13 @@ static void print_escaped_string(FILE *f, const char *str)
static int create_header_files(struct errors *error_head)
{
- uint er_last;
+ uint er_last= 0;
FILE *er_definef, *sql_statef, *er_namef;
struct errors *tmp_error;
struct message *er_msg;
const char *er_text;
DBUG_ENTER("create_header_files");
- LINT_INIT(er_last);
if (!(er_definef= my_fopen(HEADERFILE, O_WRONLY, MYF(MY_WME))))
{
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index fb4e60cdfb4..6b86503b29e 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -193,7 +193,7 @@ int main(int argc, char **argv)
}
for (argument= arguments+1 ; *argument ; argument++)
- if (*argument != args_separator) /* skip arguments separator */
+ if (!my_getopt_is_args_separator(*argument)) /* skip arguments separator */
puts(*argument);
my_free(load_default_groups);
free_defaults(arguments);
diff --git a/extra/perror.c b/extra/perror.c
index 382805c5dfd..3c00b9b11d7 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -32,7 +32,7 @@ static my_bool verbose, print_all_codes;
#include "../include/my_base.h"
#include "../mysys/my_handler_errors.h"
-#include "../include/my_handler.h"
+// #include "../include/my_compare.h"
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
static my_bool ndb_code;
@@ -240,7 +240,39 @@ static my_bool print_win_error_msg(DWORD error, my_bool verbose)
}
#endif
+/*
+ Register handler error messages for usage with my_error()
+ NOTES
+ This is safe to call multiple times as my_error_register()
+ will ignore calls to register already registered error numbers.
+*/
+
+static const char **get_handler_error_messages()
+{
+ return handler_error_messages;
+}
+
+void my_handler_error_register(void)
+{
+ /*
+ If you got compilation error here about compile_time_assert array, check
+ that every HA_ERR_xxx constant has a corresponding error message in
+ handler_error_messages[] list (check mysys/ma_handler_errors.h and
+ include/my_base.h).
+ */
+ compile_time_assert(HA_ERR_FIRST + array_elements(handler_error_messages) ==
+ HA_ERR_LAST + 1);
+ my_error_register(get_handler_error_messages, HA_ERR_FIRST,
+ HA_ERR_FIRST+ array_elements(handler_error_messages)-1);
+}
+
+
+void my_handler_error_unregister(void)
+{
+ my_error_unregister(HA_ERR_FIRST,
+ HA_ERR_FIRST+ array_elements(handler_error_messages)-1);
+}
int main(int argc,char *argv[])
{
diff --git a/extra/replace.c b/extra/replace.c
index c1f27eab695..595594e75be 100644
--- a/extra/replace.c
+++ b/extra/replace.c
@@ -1,17 +1,19 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
- 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 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
+ 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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA */
/*
Replace strings in textfile
@@ -819,7 +821,7 @@ static short find_set(REP_SETS *sets,REP_SET *find)
return (short) i;
}
}
- return (short) i; /* return new postion */
+ return (short) i; /* return new position */
}
@@ -842,7 +844,7 @@ static short find_found(FOUND_SET *found_set,uint table_offset,
found_set[i].table_offset=table_offset;
found_set[i].found_offset=found_offset;
found_sets++;
- return (short) (-i-2); /* return new postion */
+ return (short) (-i-2); /* return new position */
}
/* Return 1 if regexp starts with \b or ends with \b*/
diff --git a/extra/yassl/Makefile.am b/extra/yassl/Makefile.am
deleted file mode 100644
index 43cae0514f9..00000000000
--- a/extra/yassl/Makefile.am
+++ /dev/null
@@ -1,2 +0,0 @@
-SUBDIRS = taocrypt src testsuite
-EXTRA_DIST = CMakeLists.txt
diff --git a/extra/yassl/examples/client/client.cpp b/extra/yassl/examples/client/client.cpp
index 6c3cdf04dc1..a80a8c2f1a2 100644
--- a/extra/yassl/examples/client/client.cpp
+++ b/extra/yassl/examples/client/client.cpp
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* client.cpp */
#include "../../testsuite/test.hpp"
diff --git a/extra/yassl/examples/echoclient/echoclient.cpp b/extra/yassl/examples/echoclient/echoclient.cpp
index e2c33c7cda2..787e554f8bf 100644
--- a/extra/yassl/examples/echoclient/echoclient.cpp
+++ b/extra/yassl/examples/echoclient/echoclient.cpp
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* echoclient.cpp */
#include "../../testsuite/test.hpp"
diff --git a/extra/yassl/examples/echoserver/echoserver.cpp b/extra/yassl/examples/echoserver/echoserver.cpp
index 92613744ba0..a3ba8c12c60 100644
--- a/extra/yassl/examples/echoserver/echoserver.cpp
+++ b/extra/yassl/examples/echoserver/echoserver.cpp
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* echoserver.cpp */
#include "../../testsuite/test.hpp"
diff --git a/extra/yassl/examples/server/server.cpp b/extra/yassl/examples/server/server.cpp
index 75ce4224770..8b8066eace5 100644
--- a/extra/yassl/examples/server/server.cpp
+++ b/extra/yassl/examples/server/server.cpp
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* server.cpp */
diff --git a/extra/yassl/include/lock.hpp b/extra/yassl/include/lock.hpp
index 99829b0b6de..ae875001633 100644
--- a/extra/yassl/include/lock.hpp
+++ b/extra/yassl/include/lock.hpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/include/openssl/crypto.h b/extra/yassl/include/openssl/crypto.h
index f53e5231027..22bbbbf594e 100644
--- a/extra/yassl/include/openssl/crypto.h
+++ b/extra/yassl/include/openssl/crypto.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2005, 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* crypto.h for openSSL */
#ifndef ysSSL_crypto_h__
diff --git a/extra/yassl/include/openssl/des.h b/extra/yassl/include/openssl/des.h
index 67be7eecfb9..6e2ebbd83f5 100644
--- a/extra/yassl/include/openssl/des.h
+++ b/extra/yassl/include/openssl/des.h
@@ -1 +1,19 @@
+/*
+ Copyright (C) 2005 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* des.h for openssl */
diff --git a/extra/yassl/include/openssl/des_old.h b/extra/yassl/include/openssl/des_old.h
index 40e8fbc02af..1223a38056c 100644
--- a/extra/yassl/include/openssl/des_old.h
+++ b/extra/yassl/include/openssl/des_old.h
@@ -1 +1,19 @@
+/*
+ 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* des_old.h for openvn */
diff --git a/extra/yassl/include/openssl/engine.h b/extra/yassl/include/openssl/engine.h
index 39952fcae84..cadb05a92b4 100644
--- a/extra/yassl/include/openssl/engine.h
+++ b/extra/yassl/include/openssl/engine.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* engine.h for libcurl */
#undef HAVE_OPENSSL_ENGINE_H
diff --git a/extra/yassl/include/openssl/err.h b/extra/yassl/include/openssl/err.h
index 45ac1ca2469..23f2f1393ab 100644
--- a/extra/yassl/include/openssl/err.h
+++ b/extra/yassl/include/openssl/err.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2005, 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* err.h for openssl */
#ifndef yaSSL_err_h__
diff --git a/extra/yassl/include/openssl/evp.h b/extra/yassl/include/openssl/evp.h
index 1d66b08df46..eccdcdffda6 100644
--- a/extra/yassl/include/openssl/evp.h
+++ b/extra/yassl/include/openssl/evp.h
@@ -1,3 +1,21 @@
+/*
+ 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* evp.h for openSSL */
#ifndef SSLEAY_NUMBER_DEFINED
diff --git a/extra/yassl/include/openssl/generate_prefix_files.pl b/extra/yassl/include/openssl/generate_prefix_files.pl
index da591b31332..f74d79c8143 100755
--- a/extra/yassl/include/openssl/generate_prefix_files.pl
+++ b/extra/yassl/include/openssl/generate_prefix_files.pl
@@ -1,4 +1,20 @@
#!/usr/bin/perl
+
+# Copyright (C) 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
#
# This script generates defines for all functions
# in yassl/include/openssl/ so they are renamed to
diff --git a/extra/yassl/include/openssl/hmac.h b/extra/yassl/include/openssl/hmac.h
index a2eae4c08c1..478d92e087d 100644
--- a/extra/yassl/include/openssl/hmac.h
+++ b/extra/yassl/include/openssl/hmac.h
@@ -1 +1,19 @@
+/*
+ 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* hmac.h for openvpn */
diff --git a/extra/yassl/include/openssl/lhash.h b/extra/yassl/include/openssl/lhash.h
index 01f8535f869..34bc34c3f11 100644
--- a/extra/yassl/include/openssl/lhash.h
+++ b/extra/yassl/include/openssl/lhash.h
@@ -1,2 +1,20 @@
+/*
+ Copyright (C) 2005 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* lhash.h for openSSL */
diff --git a/extra/yassl/include/openssl/md4.h b/extra/yassl/include/openssl/md4.h
index 2e99f977fca..2718d170fcf 100644
--- a/extra/yassl/include/openssl/md4.h
+++ b/extra/yassl/include/openssl/md4.h
@@ -1 +1,19 @@
+/*
+ Copyright (C) 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* md4.h for libcurl */
diff --git a/extra/yassl/include/openssl/md5.h b/extra/yassl/include/openssl/md5.h
index dfaf9799c44..9400649ebd8 100644
--- a/extra/yassl/include/openssl/md5.h
+++ b/extra/yassl/include/openssl/md5.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2005, 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* md5.h for openssl */
#include "ssl.h" /* in there for now */
diff --git a/extra/yassl/include/openssl/objects.h b/extra/yassl/include/openssl/objects.h
index 99f2326e51b..ec00e04e213 100644
--- a/extra/yassl/include/openssl/objects.h
+++ b/extra/yassl/include/openssl/objects.h
@@ -1 +1,19 @@
+/*
+ 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* objects.h for openvpn */
diff --git a/extra/yassl/include/openssl/opensslv.h b/extra/yassl/include/openssl/opensslv.h
index d932130684f..bafcfaec8a3 100644
--- a/extra/yassl/include/openssl/opensslv.h
+++ b/extra/yassl/include/openssl/opensslv.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2005 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* opensslv.h compatibility */
#ifndef yaSSL_opensslv_h__
diff --git a/extra/yassl/include/openssl/pem.h b/extra/yassl/include/openssl/pem.h
index b4c63d56a4d..3762b9597a4 100644
--- a/extra/yassl/include/openssl/pem.h
+++ b/extra/yassl/include/openssl/pem.h
@@ -1 +1,19 @@
+/*
+ Copyright (C) 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* pem.h for libcurl */
diff --git a/extra/yassl/include/openssl/pkcs12.h b/extra/yassl/include/openssl/pkcs12.h
index e452fc879c4..71ba287ede0 100644
--- a/extra/yassl/include/openssl/pkcs12.h
+++ b/extra/yassl/include/openssl/pkcs12.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* pkcs12.h for libcurl */
diff --git a/extra/yassl/include/openssl/prefix_crypto.h b/extra/yassl/include/openssl/prefix_crypto.h
index 3fa5f32c627..ff3aea14b0e 100644
--- a/extra/yassl/include/openssl/prefix_crypto.h
+++ b/extra/yassl/include/openssl/prefix_crypto.h
@@ -1 +1,19 @@
+/*
+ Copyright (C) 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
#define SSLeay_version yaSSLeay_version
diff --git a/extra/yassl/include/openssl/prefix_ssl.h b/extra/yassl/include/openssl/prefix_ssl.h
index 138d9fb8821..fcd91cd5b9a 100644
--- a/extra/yassl/include/openssl/prefix_ssl.h
+++ b/extra/yassl/include/openssl/prefix_ssl.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2006, 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
#define Copyright yaCopyright
#define yaSSL_CleanUp yayaSSL_CleanUp
#define BN_bin2bn yaBN_bin2bn
diff --git a/extra/yassl/include/openssl/rand.h b/extra/yassl/include/openssl/rand.h
index df9c9020346..136a01459e2 100644
--- a/extra/yassl/include/openssl/rand.h
+++ b/extra/yassl/include/openssl/rand.h
@@ -1,2 +1,20 @@
+/*
+ Copyright (C) 2005 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* rand.h for openSSL */
diff --git a/extra/yassl/include/openssl/rsa.h b/extra/yassl/include/openssl/rsa.h
index fe64e655bdc..b20da32be24 100644
--- a/extra/yassl/include/openssl/rsa.h
+++ b/extra/yassl/include/openssl/rsa.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2005, 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* rsa.h for openSSL */
diff --git a/extra/yassl/include/openssl/sha.h b/extra/yassl/include/openssl/sha.h
index bb487c05c2e..79b46ec83ce 100644
--- a/extra/yassl/include/openssl/sha.h
+++ b/extra/yassl/include/openssl/sha.h
@@ -1 +1,19 @@
+/*
+ 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* sha.h for openvpn */
diff --git a/extra/yassl/include/openssl/x509.h b/extra/yassl/include/openssl/x509.h
index dcd847c0337..eb60bcbc0a6 100644
--- a/extra/yassl/include/openssl/x509.h
+++ b/extra/yassl/include/openssl/x509.h
@@ -1 +1,19 @@
+/*
+ Copyright (C) 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* x509.h for libcurl */
diff --git a/extra/yassl/include/openssl/x509v3.h b/extra/yassl/include/openssl/x509v3.h
index adf94af8f48..1215826f53f 100644
--- a/extra/yassl/include/openssl/x509v3.h
+++ b/extra/yassl/include/openssl/x509v3.h
@@ -1 +1,19 @@
+/*
+ Copyright (C) 2006 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
/* x509v3.h for libcurl */
diff --git a/extra/yassl/src/Makefile.am b/extra/yassl/src/Makefile.am
deleted file mode 100644
index 300cdcd096f..00000000000
--- a/extra/yassl/src/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../taocrypt/include -I$(srcdir)/../taocrypt/mySTL
-
-noinst_LTLIBRARIES = libyassl.la
-libyassl_la_SOURCES = buffer.cpp cert_wrapper.cpp crypto_wrapper.cpp \
- handshake.cpp lock.cpp log.cpp socket_wrapper.cpp ssl.cpp \
- template_instnt.cpp timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp
-EXTRA_DIST = $(wildcard ../include/*.hpp) $(wildcard ../include/openssl/*.h)
-AM_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX @yassl_thread_cxxflags@
diff --git a/extra/yassl/src/lock.cpp b/extra/yassl/src/lock.cpp
index 6e85fefa14d..9eb41408ff7 100644
--- a/extra/yassl/src/lock.cpp
+++ b/extra/yassl/src/lock.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2000-2007 MySQL AB
+ Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/extra/yassl/src/make.bat b/extra/yassl/src/make.bat
index dde305721a7..cccd11dbd17 100644
--- a/extra/yassl/src/make.bat
+++ b/extra/yassl/src/make.bat
@@ -1,3 +1,18 @@
+REM Copyright (C) 2006, 2007 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
REM quick and dirty build file for testing different MSDEVs
setlocal
diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp
index 8e4a9aa95ec..5af2f180bb1 100644
--- a/extra/yassl/src/yassl_int.cpp
+++ b/extra/yassl/src/yassl_int.cpp
@@ -308,7 +308,7 @@ SSL::SSL(SSL_CTX* ctx)
SetError(YasslError(err));
return;
}
- else if (serverSide) {
+ else if (serverSide && !(ctx->GetCiphers().setSuites_)) {
// remove RSA or DSA suites depending on cert key type
ProtocolVersion pv = secure_.get_connection().version_;
diff --git a/extra/yassl/taocrypt/Makefile.am b/extra/yassl/taocrypt/Makefile.am
deleted file mode 100644
index deab5227f7f..00000000000
--- a/extra/yassl/taocrypt/Makefile.am
+++ /dev/null
@@ -1,2 +0,0 @@
-SUBDIRS = src test benchmark
-EXTRA_DIST = CMakeLists.txt $(wildcard mySTL/*.hpp)
diff --git a/extra/yassl/taocrypt/benchmark/Makefile.am b/extra/yassl/taocrypt/benchmark/Makefile.am
deleted file mode 100644
index 0171c7366bb..00000000000
--- a/extra/yassl/taocrypt/benchmark/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL
-noinst_PROGRAMS = benchmark
-benchmark_SOURCES = benchmark.cpp
-benchmark_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
-benchmark_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@
-EXTRA_DIST = benchmark.dsp rsa1024.der dh1024.der dsa1024.der make.bat
diff --git a/extra/yassl/taocrypt/benchmark/benchmark.cpp b/extra/yassl/taocrypt/benchmark/benchmark.cpp
index bb725a90187..55e94275b20 100644
--- a/extra/yassl/taocrypt/benchmark/benchmark.cpp
+++ b/extra/yassl/taocrypt/benchmark/benchmark.cpp
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2006, 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
// benchmark.cpp
// TaoCrypt benchmark
diff --git a/extra/yassl/taocrypt/benchmark/make.bat b/extra/yassl/taocrypt/benchmark/make.bat
index bf1383f5e97..1457521bce9 100644
--- a/extra/yassl/taocrypt/benchmark/make.bat
+++ b/extra/yassl/taocrypt/benchmark/make.bat
@@ -1,3 +1,18 @@
+REM Copyright (C) 2006, 2007 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
REM quick and dirty build file for testing different MSDEVs
setlocal
diff --git a/extra/yassl/taocrypt/src/Makefile.am b/extra/yassl/taocrypt/src/Makefile.am
deleted file mode 100644
index a8d08b6e9d5..00000000000
--- a/extra/yassl/taocrypt/src/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL
-
-noinst_LTLIBRARIES = libtaocrypt.la
-
-libtaocrypt_la_SOURCES = aes.cpp aestables.cpp algebra.cpp arc4.cpp \
- asn.cpp bftables.cpp blowfish.cpp coding.cpp des.cpp dh.cpp \
- dsa.cpp file.cpp hash.cpp integer.cpp md2.cpp md4.cpp md5.cpp misc.cpp \
- random.cpp ripemd.cpp rsa.cpp sha.cpp template_instnt.cpp \
- tftables.cpp twofish.cpp
-
-libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C \
- @yassl_thread_cxxflags@
-
-EXTRA_DIST = $(wildcard ../include/*.hpp)
diff --git a/extra/yassl/taocrypt/src/make.bat b/extra/yassl/taocrypt/src/make.bat
index 0aa1350f7d8..ecd3023f5ab 100644
--- a/extra/yassl/taocrypt/src/make.bat
+++ b/extra/yassl/taocrypt/src/make.bat
@@ -1,3 +1,18 @@
+REM Copyright (C) 2006, 2007 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
REM quick and dirty build file for testing different MSDEVs
setlocal
diff --git a/extra/yassl/taocrypt/test/Makefile.am b/extra/yassl/taocrypt/test/Makefile.am
deleted file mode 100644
index 38f04f1387f..00000000000
--- a/extra/yassl/taocrypt/test/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL
-noinst_PROGRAMS = test
-test_SOURCES = test.cpp
-test_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
-test_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@
-EXTRA_DIST = make.bat
diff --git a/extra/yassl/taocrypt/test/make.bat b/extra/yassl/taocrypt/test/make.bat
index 7b53e9abc90..d6d62b984a8 100644
--- a/extra/yassl/taocrypt/test/make.bat
+++ b/extra/yassl/taocrypt/test/make.bat
@@ -1,3 +1,18 @@
+REM Copyright (C) 2006, 2007 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
REM quick and dirty build file for testing different MSDEVs
setlocal
diff --git a/extra/yassl/taocrypt/test/memory.cpp b/extra/yassl/taocrypt/test/memory.cpp
index a879a497800..bac8f9c2e97 100644
--- a/extra/yassl/taocrypt/test/memory.cpp
+++ b/extra/yassl/taocrypt/test/memory.cpp
@@ -1,3 +1,21 @@
+/*
+ Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+
+ 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
// memory.cpp
#include "../../include/lock.hpp" // locking
#include <new> // std::bad_alloc
diff --git a/extra/yassl/taocrypt/test/test.cpp b/extra/yassl/taocrypt/test/test.cpp
index 0af278404ab..f8177b31e2f 100644
--- a/extra/yassl/taocrypt/test/test.cpp
+++ b/extra/yassl/taocrypt/test/test.cpp
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2006, 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
// test.cpp
// test taocrypt functionality
diff --git a/extra/yassl/testsuite/Makefile.am b/extra/yassl/testsuite/Makefile.am
deleted file mode 100644
index d74c972a084..00000000000
--- a/extra/yassl/testsuite/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../taocrypt/include -I$(srcdir)/../taocrypt/mySTL
-noinst_PROGRAMS = testsuite
-testsuite_SOURCES = testsuite.cpp ../taocrypt/test/test.cpp \
- ../examples/client/client.cpp ../examples/server/server.cpp \
- ../examples/echoclient/echoclient.cpp \
- ../examples/echoserver/echoserver.cpp
-testsuite_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX -DNO_MAIN_DRIVER @yassl_thread_cxxflags@
-testsuite_LDADD = $(top_builddir)/extra/yassl/src/libyassl.la \
- $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
-EXTRA_DIST = testsuite.dsp test.hpp input quit make.bat
diff --git a/extra/yassl/testsuite/make.bat b/extra/yassl/testsuite/make.bat
index ea2677db481..941e499d7e6 100644
--- a/extra/yassl/testsuite/make.bat
+++ b/extra/yassl/testsuite/make.bat
@@ -1,3 +1,18 @@
+REM Copyright (C) 2006, 2007 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
REM quick and dirty build file for testing different MSDEVs
setlocal
diff --git a/extra/yassl/testsuite/test.hpp b/extra/yassl/testsuite/test.hpp
index 283c929a2e1..e7de3268ec4 100644
--- a/extra/yassl/testsuite/test.hpp
+++ b/extra/yassl/testsuite/test.hpp
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2006, 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
// test.hpp
#ifndef yaSSL_TEST_HPP
diff --git a/extra/yassl/testsuite/testsuite.cpp b/extra/yassl/testsuite/testsuite.cpp
index 3cd832ebb03..5ddb9bb4dab 100644
--- a/extra/yassl/testsuite/testsuite.cpp
+++ b/extra/yassl/testsuite/testsuite.cpp
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2006, 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; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
+*/
+
// testsuite.cpp
#include "test.hpp"
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 5334fc0f5ae..d8bac7532cc 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -40,7 +40,6 @@ SET(HEADERS
my_xml.h
mysql_embed.h
my_pthread.h
- my_no_pthread.h
decimal.h
errmsg.h
my_global.h
@@ -59,6 +58,4 @@ SET(HEADERS
)
INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development)
-INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development FILES_MATCHING PATTERN "*.h" )
-
-
+INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR}/mysql COMPONENT Development FILES_MATCHING PATTERN "*.h")
diff --git a/include/Makefile.am b/include/Makefile.am
deleted file mode 100644
index 4282acb0c99..00000000000
--- a/include/Makefile.am
+++ /dev/null
@@ -1,111 +0,0 @@
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-pkgpsiincludedir = $(pkgincludedir)/psi
-
-BUILT_SOURCES = $(HEADERS_GEN_MAKE) link_sources probes_mysql_nodtrace.h
-HEADERS_GEN_CONFIGURE = mysql_version.h
-HEADERS_GEN_MAKE = my_config.h
-HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \
- my_list.h my_alloc.h typelib.h mysql/plugin.h \
- mysql/plugin_audit.h mysql/plugin_ftparser.h
-pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
- my_xml.h mysql_embed.h mysql/services.h \
- mysql/service_my_snprintf.h mysql/service_thd_alloc.h \
- mysql/service_thread_scheduler.h \
- mysql/service_thd_wait.h \
- my_pthread.h my_no_pthread.h \
- mysql/plugin_auth.h mysql/client_plugin.h \
- mysql/plugin_auth_common.h \
- decimal.h errmsg.h my_global.h my_valgrind.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 my_attribute.h my_compiler.h \
- $(HEADERS_GEN_CONFIGURE) $(HEADERS_GEN_MAKE) \
- probes_mysql.h probes_mysql_nodtrace.h
-
-noinst_HEADERS = lf.h my_bit.h password.h \
- heap.h maria.h myisamchk.h my_bitmap.h my_uctype.h \
- myisam.h myisampack.h myisammrg.h ft_global.h\
- mysys_err.h my_base.h \
- my_nosys.h my_alarm.h queues.h rijndael.h sha1.h sha2.h \
- my_aes.h my_tree.h hash.h thr_alarm.h \
- thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
- my_handler.h my_time.h service_versions.h \
- my_rdtsc.h mysql/psi/psi_abi_v1.h mysql/psi/psi_abi_v2.h \
- my_user.h my_atomic.h atomic/nolock.h \
- atomic/rwlock.h atomic/x86-gcc.h atomic/generic-msvc.h \
- atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h \
- atomic/solaris.h mysql/innodb_priv.h \
- wqueue.h waiting_threads.h
-
-EXTRA_DIST = mysql.h.pp probes_mysql.d.base \
- CMakeLists.txt \
- mysql/plugin_auth.h.pp mysql/client_plugin.h.pp \
- mysql/plugin_audit.h.pp mysql/plugin_ftparser.h.pp \
- mysql/psi/psi_abi_v1.h.pp \
- mysql/psi/psi_abi_v2.h.pp
-
-pkgpsiinclude_HEADERS = mysql/psi/psi.h mysql/psi/mysql_thread.h \
- mysql/psi/mysql_file.h
-
-# Remove built files and the symlinked directories
-CLEANFILES = $(BUILT_SOURCES) readline openssl probes_mysql.d probes_mysql_nodtrace.h
-
-
-# Some include files that may be moved and patched by configure
-DISTCLEANFILES = sched.h $(CLEANFILES) $(HEADERS_GEN_CONFIGURE)
-
-link_sources:
- -$(RM) -f readline openssl
- @readline_h_ln_cmd@
- @yassl_h_ln_cmd@
- echo timestamp > link_sources
-
-# 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".
-# Normally this is generated by configure; This rule is left here in case
-# someone deletes my_config.h and expect it to be generated by make
-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
-dist-hook:
- $(RM) -f $(distdir)/mysql_version.h $(distdir)/my_config.h
-
-probes_mysql.d:
- if ! test -f probes_mysql.d ; then \
- $(CP) -f $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d; \
- fi
-
-DTRACEPROVIDER = probes_mysql.d
-if HAVE_DTRACE
-BUILT_SOURCES += probes_mysql_dtrace.h
-CLEANFILES += $(DTRACEPROVIDER)
-
-# Fake for creating the probes file. If we are building a separate directory
-# then we copy the probes from the source location and use that
-# If we are building in the same directory as the source, we do not copy
-
-probes_mysql_dtrace.h: $(DTRACEPROVIDER)
- $(DTRACE) $(DTRACEFLAGS) -h -s $(DTRACEPROVIDER) -o $@
-endif
-
-probes_mysql_nodtrace.h: $(DTRACEPROVIDER)
- @PERL@ $(top_srcdir)/scripts/dheadgen.pl -f $(DTRACEPROVIDER) > $@
diff --git a/include/atomic/x86-gcc.h b/include/atomic/x86-gcc.h
index 90602ef900c..ea3202aa9c9 100644
--- a/include/atomic/x86-gcc.h
+++ b/include/atomic/x86-gcc.h
@@ -78,15 +78,15 @@
: "memory")
/*
- Actually 32-bit reads/writes are always atomic on x86
- But we add LOCK_prefix here anyway to force memory barriers
+ Actually 32/64-bit reads/writes are always atomic on x86_64,
+ nonetheless issue memory barriers as appropriate.
*/
#define make_atomic_load_body(S) \
- ret=0; \
- asm volatile (LOCK_prefix "; cmpxchg %2, %0" \
- : "=m" (*a), "=a" (ret) \
- : "r" (ret), "m" (*a) \
- : "memory")
+ /* Serialize prior load and store operations. */ \
+ asm volatile ("mfence" ::: "memory"); \
+ ret= *a; \
+ /* Prevent compiler from reordering instructions. */ \
+ asm volatile ("" ::: "memory")
#define make_atomic_store_body(S) \
asm volatile ("; xchg %0, %1;" \
: "=m" (*a), "+r" (v) \
diff --git a/include/decimal.h b/include/decimal.h
index 530ed9e1757..90946f65ac6 100644
--- a/include/decimal.h
+++ b/include/decimal.h
@@ -29,14 +29,14 @@ typedef struct st_decimal_t {
int internal_str2dec(const char *from, decimal_t *to, char **end,
my_bool fixed);
-int decimal2string(decimal_t *from, char *to, int *to_len,
+int decimal2string(const decimal_t *from, char *to, int *to_len,
int fixed_precision, int fixed_decimals,
char filler);
int decimal2ulonglong(decimal_t *from, ulonglong *to);
int ulonglong2decimal(ulonglong from, decimal_t *to);
int decimal2longlong(decimal_t *from, longlong *to);
int longlong2decimal(longlong from, decimal_t *to);
-int decimal2double(decimal_t *from, double *to);
+int decimal2double(const decimal_t *from, double *to);
int double2decimal(double from, decimal_t *to);
int decimal_actual_fraction(decimal_t *from);
int decimal2bin(decimal_t *from, uchar *to, int precision, int scale);
@@ -47,17 +47,17 @@ int decimal_bin_size(int precision, int scale);
int decimal_result_size(decimal_t *from1, decimal_t *from2, char op,
int param);
-int decimal_intg(decimal_t *from);
-int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to);
-int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to);
-int decimal_cmp(decimal_t *from1, decimal_t *from2);
-int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to);
-int decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to,
+int decimal_intg(const decimal_t *from);
+int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
+int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
+int decimal_cmp(const decimal_t *from1, const decimal_t *from2);
+int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
+int decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to,
int scale_incr);
-int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to);
-int decimal_round(decimal_t *from, decimal_t *to, int new_scale,
+int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
+int decimal_round(const decimal_t *from, decimal_t *to, int new_scale,
decimal_round_mode mode);
-int decimal_is_zero(decimal_t *from);
+int decimal_is_zero(const decimal_t *from);
void max_decimal(int precision, int frac, decimal_t *to);
#define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0)
diff --git a/include/heap.h b/include/heap.h
index a585371e18f..74851c7b454 100644
--- a/include/heap.h
+++ b/include/heap.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2004 MySQL AB, 2009 Sun Microsystems, Inc
+/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights
+ reserved
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
@@ -25,12 +26,11 @@ extern "C" {
#ifndef _my_base_h
#include <my_base.h>
#endif
-#ifdef THREAD
+
#include <my_pthread.h>
#include <thr_lock.h>
-#endif
-#include "my_handler.h"
+#include "my_compare.h"
#include "my_tree.h"
/* defines used by heap-funktions */
@@ -146,10 +146,8 @@ typedef struct st_heap_share
uint open_count;
uchar *del_link; /* Link to next block with del. rec */
char * name; /* Name of "memory-file" */
-#ifdef THREAD
THR_LOCK lock;
mysql_mutex_t intern_lock; /* Locking for use with _locking */
-#endif
my_bool delete_on_close;
LIST open_list;
uint auto_key;
@@ -175,9 +173,7 @@ typedef struct st_heap_info
TREE_ELEMENT **last_pos;
uint lastkey_len;
my_bool implicit_emptied;
-#ifdef THREAD
THR_LOCK_DATA lock;
-#endif
LIST open_list;
} HP_INFO;
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 6332962f000..009db46bcd2 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -71,23 +71,6 @@ struct unicase_info_st
extern MY_UNICASE_INFO *const my_unicase_default[256];
extern MY_UNICASE_INFO *const my_unicase_turkish[256];
-#define MY_UCA_MAX_CONTRACTION 4
-#define MY_UCA_MAX_WEIGHT_SIZE 8
-
-typedef struct my_contraction_t
-{
- my_wc_t ch[MY_UCA_MAX_CONTRACTION]; /* Character sequence */
- uint16 weight[MY_UCA_MAX_WEIGHT_SIZE];/* Its weight string, 0-terminated */
-} MY_CONTRACTION;
-
-
-typedef struct my_contraction_list_t
-{
- size_t nitems; /* Number of items in the list */
- MY_CONTRACTION *item; /* List of contractions */
- char *flags; /* Character flags, e.g. "is contraction head") */
-} MY_CONTRACTIONS;
-
struct uni_ctype_st
{
uchar pctype;
@@ -300,7 +283,7 @@ struct charset_info_st
const uchar *to_lower;
const uchar *to_upper;
const uchar *sort_order;
- const MY_CONTRACTIONS *contractions;
+ uint16 *contractions;
const uint16 *const *sort_order_big;
const uint16 *tab_to_uni;
MY_UNI_IDX *tab_from_uni;
@@ -326,6 +309,7 @@ struct charset_info_st
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_bin;
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_latin1;
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_filename;
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8_general_ci;
extern struct charset_info_st my_charset_big5_bin;
extern struct charset_info_st my_charset_big5_chinese_ci;
@@ -359,14 +343,40 @@ extern struct charset_info_st my_charset_utf32_bin;
extern struct charset_info_st my_charset_utf32_general_ci;
extern struct charset_info_st my_charset_utf32_unicode_ci;
extern struct charset_info_st my_charset_utf8_bin;
-extern struct charset_info_st my_charset_utf8_general_ci;
extern struct charset_info_st my_charset_utf8_unicode_ci;
extern struct charset_info_st my_charset_utf8mb4_bin;
extern struct charset_info_st my_charset_utf8mb4_general_ci;
extern struct charset_info_st my_charset_utf8mb4_unicode_ci;
+
#define MY_UTF8MB3 "utf8"
#define MY_UTF8MB4 "utf8mb4"
+/* Helper functions to handle contraction */
+static inline my_bool
+my_cs_have_contractions(CHARSET_INFO *cs)
+{
+ return cs->contractions != NULL;
+}
+
+static inline my_bool
+my_cs_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc)
+{
+ return ((const char *)cs->contractions)[0x40*0x40 + (wc & 0xFF)];
+}
+
+static inline my_bool
+my_cs_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc)
+{
+ return ((const char *)cs->contractions)[0x40*0x40 + (wc & 0xFF)];
+}
+
+static inline uint16*
+my_cs_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2)
+{
+ return &cs->contractions[(wc1 - 0x40) * 0x40 + wc2 - 0x40];
+}
+
+
/* declarations for simple charsets */
extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t,
const uchar *, size_t);
@@ -441,6 +451,7 @@ ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs,
void my_fill_8bit(CHARSET_INFO *cs, char* to, size_t l, int fill);
+/* For 8-bit character set */
my_bool my_like_range_simple(CHARSET_INFO *cs,
const char *ptr, size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
@@ -448,6 +459,7 @@ my_bool my_like_range_simple(CHARSET_INFO *cs,
char *min_str, char *max_str,
size_t *min_length, size_t *max_length);
+/* For ASCII-based multi-byte character sets with mbminlen=1 */
my_bool my_like_range_mb(CHARSET_INFO *cs,
const char *ptr, size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
@@ -455,26 +467,13 @@ my_bool my_like_range_mb(CHARSET_INFO *cs,
char *min_str, char *max_str,
size_t *min_length, size_t *max_length);
-my_bool my_like_range_ucs2(CHARSET_INFO *cs,
- 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);
-
-my_bool my_like_range_utf16(CHARSET_INFO *cs,
- 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);
-
-my_bool my_like_range_utf32(CHARSET_INFO *cs,
- 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);
+/* For other character sets, with arbitrary mbminlen and mbmaxlen numbers */
+my_bool my_like_range_generic(CHARSET_INFO *cs,
+ 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);
int my_wildcmp_8bit(CHARSET_INFO *,
const char *str,const char *str_end,
@@ -565,6 +564,8 @@ extern my_bool my_parse_charset_xml(const char *bug, size_t len,
int (*add)(struct charset_info_st *cs));
extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
pchar c);
+extern size_t my_strcspn(CHARSET_INFO *cs, const char *str, const char *end,
+ const char *accept);
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);
@@ -577,12 +578,6 @@ uint my_charset_repertoire(CHARSET_INFO *cs);
my_bool my_charset_is_ascii_compatible(CHARSET_INFO *cs);
-my_bool my_uca_have_contractions(CHARSET_INFO *cs);
-my_bool my_uca_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc);
-my_bool my_uca_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc);
-const uint16 *my_uca_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1,
- my_wc_t wc2);
-
extern size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
const char* fmt, va_list ap);
diff --git a/include/m_string.h b/include/m_string.h
index e2d649d0bcd..9eb0e1e13ff 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -52,8 +52,6 @@
# define memmove(d, s, n) bmove ((d), (s), (n))
#elif defined(HAVE_MEMMOVE)
# define bmove(d, s, n) memmove((d), (s), (n))
-#else
-# define memmove(d, s, n) bmove((d), (s), (n)) /* our bmove */
#endif
/* Unixware 7 */
@@ -80,7 +78,9 @@ extern "C" {
extern void *(*my_str_malloc)(size_t);
extern void (*my_str_free)(void *);
-#if defined(HAVE_STPCPY)
+#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER)
+#define strmov(A,B) __builtin_stpcpy((A),(B))
+#elif defined(HAVE_STPCPY)
#define strmov(A,B) stpcpy((A),(B))
#endif
@@ -92,14 +92,6 @@ extern char *strmov_overlapp(char *dest, const char *src);
/* Prototypes for string functions */
-#if !defined(bfill) && !defined(HAVE_BFILL)
-extern void bfill(uchar *dst,size_t len,pchar fill);
-#endif
-
-#if !defined(HAVE_BMOVE) && !defined(bmove)
-extern void bmove(uuchar *dst, const uchar *src,size_t len);
-#endif
-
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);
@@ -122,11 +114,6 @@ extern char *strxnmov(char *dst, size_t len, const char *src, ...);
extern size_t strnlen(const char *s, size_t n);
#endif
-#if !defined(__cplusplus)
-#ifndef HAVE_STRSTR
-extern char *strstr(const char *, const char *);
-#endif
-#endif
extern int is_prefix(const char *, const char *);
/* Conversion routines */
diff --git a/include/my_base.h b/include/my_base.h
index 75deb89a08d..408a57a7d70 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights
+ reserved
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
@@ -30,9 +31,6 @@
#define EOVERFLOW 84
#endif
-#if !defined(USE_MY_FUNC) && !defined(THREAD)
-#include <my_nosys.h> /* For faster code, after test */
-#endif /* USE_MY_FUNC */
#endif /* stdin */
#include <my_list.h>
@@ -365,7 +363,7 @@ enum ha_base_keytype {
/*
update the 'variable' part of the info:
handler::records, deleted, data_file_length, index_file_length,
- delete_length, check_time, mean_rec_length
+ check_time, mean_rec_length
*/
#define HA_STATUS_VARIABLE 16
/*
@@ -378,6 +376,11 @@ enum ha_base_keytype {
update handler::auto_increment_value
*/
#define HA_STATUS_AUTO 64
+/*
+ Get also delete_length when HA_STATUS_VARIABLE is called. It's ok to set it also
+ when only HA_STATUS_VARIABLE but it won't be used.
+*/
+#define HA_STATUS_VARIABLE_EXTRA 128
/*
Errorcodes given by handler functions
@@ -455,9 +458,10 @@ enum ha_base_keytype {
#define HA_ERR_INITIALIZATION 174 /* Error during initialization */
#define HA_ERR_FILE_TOO_SHORT 175 /* File too short */
#define HA_ERR_WRONG_CRC 176 /* Wrong CRC on page */
-#define HA_ERR_ROW_NOT_VISIBLE 177
-#define HA_ERR_TOO_MANY_CONCURRENT_TRXS 178 /*Too many active concurrent transactions */
-#define HA_ERR_LAST 178 /* Copy of last error nr */
+#define HA_ERR_TOO_MANY_CONCURRENT_TRXS 177 /*Too many active concurrent transactions */
+#define HA_ERR_INDEX_COL_TOO_LONG 178 /* Index column length exceeds limit */
+#define HA_ERR_ROW_NOT_VISIBLE 179
+#define HA_ERR_LAST 179 /* Copy of last error nr */
/* Number of different errors */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
diff --git a/include/my_bit.h b/include/my_bit.h
index 7e733d9d581..50dd7eb438a 100644
--- a/include/my_bit.h
+++ b/include/my_bit.h
@@ -1,3 +1,18 @@
+/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
#ifndef MY_BIT_INCLUDED
#define MY_BIT_INCLUDED
@@ -46,9 +61,12 @@ static inline uint my_count_bits(ulonglong v)
#endif
}
-static inline uint my_count_bits_ushort(ushort v)
+static inline uint my_count_bits_uint32(uint32 v)
{
- return _my_bits_nbits[v];
+ return (uint) (uchar) (_my_bits_nbits[(uchar) v] +
+ _my_bits_nbits[(uchar) (v >> 8)] +
+ _my_bits_nbits[(uchar) (v >> 16)] +
+ _my_bits_nbits[(uchar) (v >> 24)]);
}
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index c92f28630e2..2b173e7627c 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,9 +19,7 @@
#define MY_BIT_NONE (~(uint) 0)
#include <m_string.h>
-#ifdef THREAD
#include <my_pthread.h>
-#endif
typedef uint32 my_bitmap_map;
@@ -34,9 +32,7 @@ typedef struct st_bitmap
thread_safe flag in bitmap_init was set. Otherwise, we optimize by not
acquiring the mutex
*/
-#ifdef THREAD
mysql_mutex_t *mutex;
-#endif
my_bitmap_map last_word_mask;
uint32 n_bits; /* number of bits occupied by the above */
} MY_BITMAP;
@@ -132,9 +128,10 @@ bitmap_is_set(const MY_BITMAP *map,uint bit)
static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
{
- *(map1)->last_word_ptr|= (map1)->last_word_mask;
- *(map2)->last_word_ptr|= (map2)->last_word_mask;
- return memcmp((map1)->bitmap, (map2)->bitmap, 4*no_words_in_map((map1)))==0;
+ if (memcmp(map1->bitmap, map2->bitmap, 4*(no_words_in_map(map1)-1)) != 0)
+ return FALSE;
+ return ((*map1->last_word_ptr | map1->last_word_mask) ==
+ (*map2->last_word_ptr | map2->last_word_mask));
}
#define bitmap_clear_all(MAP) \
diff --git a/include/my_compare.h b/include/my_compare.h
new file mode 100644
index 00000000000..363d46b8162
--- /dev/null
+++ b/include/my_compare.h
@@ -0,0 +1,126 @@
+/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ 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 _my_compare_h
+#define _my_compare_h
+
+#include "myisampack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "m_ctype.h" /* CHARSET_INFO */
+
+/*
+ There is a hard limit for the maximum number of keys as there are only
+ 8 bits in the index file header for the number of keys in a table.
+ This means that 0..255 keys can exist for a table. The idea of
+ HA_MAX_POSSIBLE_KEY is to ensure that one can use myisamchk & tools on
+ a MyISAM table for which one has more keys than MyISAM is normally
+ compiled for. If you don't have this, you will get a core dump when
+ running myisamchk compiled for 128 keys on a table with 255 keys.
+*/
+
+#define HA_MAX_POSSIBLE_KEY 255 /* For myisamchk */
+/*
+ The following defines can be increased if necessary.
+ But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and HA_MAX_KEY_LENGTH.
+*/
+
+#define HA_MAX_KEY_LENGTH 1000 /* Max length in bytes */
+#define HA_MAX_KEY_SEG 16 /* Max segments for key */
+
+#define HA_MAX_POSSIBLE_KEY_BUFF (HA_MAX_KEY_LENGTH + 24+ 6+6)
+#define HA_MAX_KEY_BUFF (HA_MAX_KEY_LENGTH+HA_MAX_KEY_SEG*6+8+8)
+
+typedef struct st_HA_KEYSEG /* Key-portion */
+{
+ CHARSET_INFO *charset;
+ uint32 start; /* Start of key in record */
+ uint32 null_pos; /* position to NULL indicator */
+ uint16 bit_pos; /* Position to bit part */
+ uint16 flag;
+ uint16 length; /* Keylength */
+ uint16 language;
+ uint8 type; /* Type of key (for sort) */
+ uint8 null_bit; /* bitmask to test for NULL */
+ uint8 bit_start,bit_end; /* if bit field */
+ uint8 bit_length; /* Length of bit part */
+} HA_KEYSEG;
+
+#define get_key_length(length,key) \
+{ if (*(uchar*) (key) != 255) \
+ length= (uint) *(uchar*) ((key)++); \
+ else \
+ { length= mi_uint2korr((key)+1); (key)+=3; } \
+}
+
+#define get_key_length_rdonly(length,key) \
+{ if (*(uchar*) (key) != 255) \
+ length= ((uint) *(uchar*) ((key))); \
+ else \
+ { length= mi_uint2korr((key)+1); } \
+}
+
+#define get_key_pack_length(length,length_pack,key) \
+{ if (*(uchar*) (key) != 255) \
+ { length= (uint) *(uchar*) ((key)++); length_pack= 1; }\
+ else \
+ { length=mi_uint2korr((key)+1); (key)+= 3; length_pack= 3; } \
+}
+
+#define store_key_length_inc(key,length) \
+{ if ((length) < 255) \
+ { *(key)++= (length); } \
+ else \
+ { *(key)=255; mi_int2store((key)+1,(length)); (key)+=3; } \
+}
+
+#define size_to_store_key_length(length) ((length) < 255 ? 1 : 3)
+
+#define get_rec_bits(bit_ptr, bit_ofs, bit_len) \
+ (((((uint16) (bit_ptr)[1] << 8) | (uint16) (bit_ptr)[0]) >> (bit_ofs)) & \
+ ((1 << (bit_len)) - 1))
+
+#define set_rec_bits(bits, bit_ptr, bit_ofs, bit_len) \
+{ \
+ (bit_ptr)[0]= ((bit_ptr)[0] & ~(((1 << (bit_len)) - 1) << (bit_ofs))) | \
+ ((bits) << (bit_ofs)); \
+ if ((bit_ofs) + (bit_len) > 8) \
+ (bit_ptr)[1]= ((bit_ptr)[1] & ~((1 << ((bit_len) - 8 + (bit_ofs))) - 1)) | \
+ ((bits) >> (8 - (bit_ofs))); \
+}
+
+#define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \
+ set_rec_bits(0, bit_ptr, bit_ofs, bit_len)
+
+extern int ha_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint ,
+ my_bool, my_bool);
+extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
+ register uchar *b, uint key_length, uint nextflag,
+ uint *diff_pos);
+extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, const uchar *a);
+
+/*
+ Inside an in-memory data record, memory pointers to pieces of the
+ record (like BLOBs) are stored in their native byte order and in
+ this amount of bytes.
+*/
+#define portable_sizeof_char_ptr 8
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _my_compare_h */
diff --git a/include/my_compiler.h b/include/my_compiler.h
index 1cd46ff4260..e3ff80fad40 100644
--- a/include/my_compiler.h
+++ b/include/my_compiler.h
@@ -32,8 +32,15 @@
/* GNU C/C++ */
#if defined __GNUC__
+/* Convenience macro to test the minimum required GCC version. */
+# define MY_GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
/* Any after 2.95... */
# define MY_ALIGN_EXT
+/* Comunicate to the compiler the unreachability of the code. */
+# if MY_GNUC_PREREQ(4,5)
+# define MY_ASSERT_UNREACHABLE() __builtin_unreachable()
+# endif
/* Microsoft Visual C++ */
#elif defined _MSC_VER
@@ -67,8 +74,13 @@
#endif
/**
- Generic compiler-dependent features.
+ Generic (compiler-independent) features.
*/
+
+#ifndef MY_GNUC_PREREQ
+# define MY_GNUC_PREREQ(maj, min) (0)
+#endif
+
#ifndef MY_ALIGNOF
# ifdef __cplusplus
template<typename type> struct my_alignof_helper { char m1; type m2; };
@@ -79,6 +91,10 @@
# endif
#endif
+#ifndef MY_ASSERT_UNREACHABLE
+# define MY_ASSERT_UNREACHABLE() do { assert(0); } while (0)
+#endif
+
/**
C++ Type Traits
*/
@@ -124,6 +140,14 @@ struct my_aligned_storage
#endif /* __cplusplus */
+# ifndef MY_ALIGNED
+/*
+ Make sure MY_ALIGNED can be used also on platforms where we don't
+ have a way of aligning data structures.
+*/
+#define MY_ALIGNED(size)
+#endif
+
#include <my_attribute.h>
#endif /* MY_COMPILER_INCLUDED */
diff --git a/include/my_dbug.h b/include/my_dbug.h
index ab02433ec4e..c397fbcf959 100644
--- a/include/my_dbug.h
+++ b/include/my_dbug.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB & 2009 Monty Program Ab
+/* Copyright (c) 2000 MySQL AB & 2009 Monty Program Ab
+ Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,8 +14,18 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifndef _dbug_h
-#define _dbug_h
+#ifndef MY_DBUG_INCLUDED
+#define MY_DBUG_INCLUDED
+
+#ifndef __WIN__
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <signal.h>
+#endif /* not __WIN__ */
#ifdef __cplusplus
extern "C" {
@@ -111,6 +122,22 @@ extern const char* _db_get_func_(void);
DBUG_CHECK_CRASH(_db_get_func_(), "_crash_return")
#define DBUG_CRASH_VOID_RETURN \
DBUG_CHECK_CRASH (_db_get_func_(), "_crash_return")
+
+/*
+ Make the program fail, without creating a core file.
+ abort() will send SIGABRT which (most likely) generates core.
+ Use SIGKILL instead, which cannot be caught.
+ We also pause the current thread, until the signal is actually delivered.
+ An alternative would be to use _exit(EXIT_FAILURE),
+ but then valgrind would report lots of memory leaks.
+ */
+#ifdef __WIN__
+#define DBUG_SUICIDE() DBUG_ABORT()
+#else
+extern void _db_suicide_();
+#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_())
+#endif
+
#else /* No debugger */
#define DBUG_ENTER(a1)
@@ -140,10 +167,11 @@ extern const char* _db_get_func_(void);
#define DBUG_EXPLAIN_INITIAL(buf,len)
#define DEBUGGER_OFF do { } while(0)
#define DEBUGGER_ON do { } while(0)
-#define DBUG_ABORT() abort()
+#define DBUG_ABORT() do { } while(0)
#define DBUG_CRASH_ENTER(func)
#define DBUG_CRASH_RETURN(val) do { return(val); } while(0)
#define DBUG_CRASH_VOID_RETURN do { return; } while(0)
+#define DBUG_SUICIDE() do { } while(0)
#endif
@@ -165,4 +193,5 @@ void debug_sync_point(const char* lock_name, uint lock_timeout);
#ifdef __cplusplus
}
#endif
-#endif
+
+#endif /* MY_DBUG_INCLUDED */
diff --git a/include/my_getopt.h b/include/my_getopt.h
index 5eb0004e9c3..6c1db277db8 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004 MySQL AB
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef _my_getopt_h
#define _my_getopt_h
@@ -39,6 +39,13 @@ C_MODE_START
#define GET_ASK_ADDR 128
#define GET_TYPE_MASK 127
+/**
+ Enumeration of the my_option::arg_type attributes.
+ It should be noted that for historical reasons variables with the combination
+ arg_type=NO_ARG, my_option::var_type=GET_BOOL still accepts
+ arguments. This is someone counter intuitive and care should be taken
+ if the code is refactored.
+*/
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
struct st_typelib;
@@ -79,7 +86,9 @@ struct my_option
typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *);
-typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...);
+typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...)
+ ATTRIBUTE_FORMAT_FPTR(printf, 2, 3);
+
/**
Used to retrieve a reference to the object (variable) that holds the value
for the given option. For example, if var_type is GET_UINT, the function
diff --git a/include/my_global.h b/include/my_global.h
index 5d874d9f5f8..4a7535e1c4d 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -232,13 +232,6 @@
#include <sys/types.h>
#endif
-/* The client defines this to avoid all thread code */
-#if defined(MYSQL_CLIENT_NO_THREADS) || defined(UNDEF_THREADS_HACK)
-#undef THREAD
-#undef HAVE_LINUXTHREADS
-#undef HAVE_NPTL
-#endif
-
#ifdef HAVE_THREADS_WITHOUT_SOCKETS
/* MIT pthreads does not work with unix sockets */
#undef HAVE_SYS_UN_H
@@ -281,7 +274,7 @@
#endif
#endif
-#if defined(THREAD) && !defined(__WIN__)
+#if !defined(__WIN__)
#ifndef _POSIX_PTHREAD_SEMANTICS
#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
#endif
@@ -302,7 +295,7 @@ C_MODE_END
#if !defined(SCO) && !defined(_REENTRANT)
#define _REENTRANT 1 /* Threads requires reentrant code */
#endif
-#endif /* THREAD */
+#endif /* !defined(__WIN__) */
/* Go around some bugs in different OS and compilers */
#ifdef _AIX /* By soren@t.dk */
@@ -312,7 +305,7 @@ C_MODE_END
#define ulonglong2double(A) my_ulonglong2double(A)
#define my_off_t2double(A) my_ulonglong2double(A)
C_MODE_START
-double my_ulonglong2double(unsigned long long A);
+inline double my_ulonglong2double(unsigned long long A) { return (double A); }
C_MODE_END
#endif /* _AIX */
@@ -328,9 +321,6 @@ C_MODE_END
#undef HAVE_PWRITE
#endif
-#ifdef UNDEF_HAVE_GETHOSTBYNAME_R /* For OSF4.x */
-#undef HAVE_GETHOSTBYNAME_R
-#endif
#ifdef UNDEF_HAVE_INITGROUPS /* For AIX 4.3 */
#undef HAVE_INITGROUPS
#endif
@@ -438,7 +428,7 @@ C_MODE_END
#include <sys/stream.h> /* HPUX 10.20 defines ulong here. UGLY !!! */
#define HAVE_ULONG
#endif
-#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD)
+#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE)
/* Fix bug in setrlimit */
#undef setrlimit
#define setrlimit cma_setrlimit64
@@ -475,6 +465,7 @@ extern "C" int madvise(void *addr, size_t len, int behav);
#define LINT_INIT(var)
#endif
+#ifndef SO_EXT
#ifdef _WIN32
#define SO_EXT ".dll"
#elif defined(__APPLE__)
@@ -482,6 +473,7 @@ extern "C" int madvise(void *addr, size_t len, int behav);
#else
#define SO_EXT ".so"
#endif
+#endif
/*
Suppress uninitialized variable warning without generating code.
@@ -633,6 +625,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#ifdef _WIN32
#define FN_LIBCHAR '\\'
#define FN_LIBCHAR2 '/'
+#define FN_DIRSEP "/\\" /* Valid directory separators */
#define FN_ROOTDIR "\\"
#define FN_DEVCHAR ':'
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
@@ -640,6 +633,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#else
#define FN_LIBCHAR '/'
#define FN_LIBCHAR2 '/'
+#define FN_DIRSEP "/" /* Valid directory separators */
#define FN_ROOTDIR "/"
#endif
@@ -1377,28 +1371,6 @@ do { doubleget_union _tmp; \
#endif /* WORDS_BIGENDIAN */
-/* sprintf does not always return the number of bytes :- */
-#ifdef SPRINTF_RETURNS_INT
-#define my_sprintf(buff,args) sprintf args
-#else
-#ifdef SPRINTF_RETURNS_PTR
-#define my_sprintf(buff,args) ((int)(sprintf args - buff))
-#else
-#define my_sprintf(buff,args) ((ulong) sprintf args, (ulong) strlen(buff))
-#endif
-#endif
-
-#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
#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8"
#else
@@ -1413,21 +1385,28 @@ do { doubleget_union _tmp; \
#define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name)
#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
#define dlclose(lib) FreeLibrary((HMODULE)lib)
+#ifndef HAVE_DLOPEN
#define HAVE_DLOPEN
#endif
+#endif
-#ifdef HAVE_DLOPEN
-# if defined(HAVE_DLFCN_H)
-# include <dlfcn.h>
-# endif
-# ifndef HAVE_DLERROR
-# define dlerror() ""
-# endif
+#if defined(HAVE_DLFCN_H)
+#include <dlfcn.h>
+#endif
+
+#ifndef HAVE_DLERROR
+#ifdef _WIN32
+static inline char *dlerror(void)
+{
+ static char win_errormsg[2048];
+ if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
+ 0, GetLastError(), 0, win_errormsg, 2048, NULL))
+ return win_errormsg;
+ return "";
+}
#else
-# define dlerror() "No support for dynamic loading (static build?)"
-# define dlopen(A,B) 0
-# define dlsym(A,B) 0
-# define dlclose(A) 0
+#define dlerror() "No support for dynamic loading (static build?)"
+#endif
#endif
/*
@@ -1546,10 +1525,8 @@ static inline double rint(double x)
/* Things we don't need in the embedded version of MySQL */
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
-#undef HAVE_PSTACK /* No stacktrace */
#undef HAVE_OPENSSL
#undef HAVE_SMEM /* No shared memory */
-#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
#endif /* EMBEDDED_LIBRARY */
diff --git a/include/my_handler.h b/include/my_handler.h
deleted file mode 100644
index 970e74d2ace..00000000000
--- a/include/my_handler.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/* Copyright (C) 2002-2006 MySQL AB
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; version 2
- of the License.
-
- This library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA */
-
-#ifndef _my_handler_h
-#define _my_handler_h
-
-#include "myisampack.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "m_ctype.h" /* CHARSET_INFO */
-
-/*
- There is a hard limit for the maximum number of keys as there are only
- 8 bits in the index file header for the number of keys in a table.
- This means that 0..255 keys can exist for a table. The idea of
- HA_MAX_POSSIBLE_KEY is to ensure that one can use myisamchk & tools on
- a MyISAM table for which one has more keys than MyISAM is normally
- compiled for. If you don't have this, you will get a core dump when
- running myisamchk compiled for 128 keys on a table with 255 keys.
-*/
-
-#define HA_MAX_POSSIBLE_KEY 255 /* For myisamchk */
-/*
- The following defines can be increased if necessary.
- But beware the dependency of HA_MAX_POSSIBLE_KEY_BUFF and HA_MAX_KEY_LENGTH.
-*/
-
-#define HA_MAX_KEY_LENGTH 1000 /* Max length in bytes */
-#define HA_MAX_KEY_SEG 32 /* Max segments for key */
-
-#define HA_MAX_POSSIBLE_KEY_BUFF (HA_MAX_KEY_LENGTH + 24+ 6+6)
-#define HA_MAX_KEY_BUFF (HA_MAX_KEY_LENGTH+HA_MAX_KEY_SEG*6+8+8)
-#define HA_MAX_MSG_BUF 1024 /* used in CHECK TABLE, REPAIR TABLE */
-
-typedef struct st_HA_KEYSEG /* Key-portion */
-{
- CHARSET_INFO *charset;
- uint32 start; /* Start of key in record */
- uint32 null_pos; /* position to NULL indicator */
- uint16 bit_pos; /* Position to bit part */
- uint16 flag;
- uint16 length; /* Keylength */
- uint16 language;
- uint8 type; /* Type of key (for sort) */
- uint8 null_bit; /* bitmask to test for NULL */
- uint8 bit_start,bit_end; /* if bit field */
- uint8 bit_length; /* Length of bit part */
-} HA_KEYSEG;
-
-#define get_key_length(length,key) \
-{ if (*(const uchar*) (key) != 255) \
- length= (uint) *(const uchar*) ((key)++); \
- else \
- { length= mi_uint2korr((key)+1); (key)+=3; } \
-}
-
-#define get_key_length_rdonly(length,key) \
-{ if (*(const uchar*) (key) != 255) \
- length= ((uint) *(const uchar*) ((key))); \
- else \
- { length= mi_uint2korr((key)+1); } \
-}
-
-#define get_key_pack_length(length,length_pack,key) \
-{ if (*(const uchar*) (key) != 255) \
- { length= (uint) *(const uchar*) ((key)++); length_pack= 1; }\
- else \
- { length=mi_uint2korr((key)+1); (key)+= 3; length_pack= 3; } \
-}
-
-#define store_key_length_inc(key,length) \
-{ if ((length) < 255) \
- { *(key)++= (length); } \
- else \
- { *(key)=255; mi_int2store((key)+1,(length)); (key)+=3; } \
-}
-
-#define size_to_store_key_length(length) ((length) < 255 ? 1 : 3)
-
-#define get_rec_bits(bit_ptr, bit_ofs, bit_len) \
- (((((uint16) (bit_ptr)[1] << 8) | (uint16) (bit_ptr)[0]) >> (bit_ofs)) & \
- ((1 << (bit_len)) - 1))
-
-#define set_rec_bits(bits, bit_ptr, bit_ofs, bit_len) \
-{ \
- (bit_ptr)[0]= ((bit_ptr)[0] & ~(((1 << (bit_len)) - 1) << (bit_ofs))) | \
- ((bits) << (bit_ofs)); \
- if ((bit_ofs) + (bit_len) > 8) \
- (bit_ptr)[1]= ((bit_ptr)[1] & ~((1 << ((bit_len) - 8 + (bit_ofs))) - 1)) | \
- ((bits) >> (8 - (bit_ofs))); \
-}
-
-#define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \
- set_rec_bits(0, bit_ptr, bit_ofs, bit_len)
-
-extern int ha_compare_text(CHARSET_INFO *, const uchar *, uint,
- const uchar *, uint , my_bool, my_bool);
-extern int ha_key_cmp(register HA_KEYSEG *keyseg, register const uchar *a,
- register const uchar *b, uint key_length,
- uint32 nextflag, uint *diff_pos);
-
-extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, const uchar *a);
-extern void my_handler_error_register(void);
-extern void my_handler_error_unregister(void);
-/*
- Inside an in-memory data record, memory pointers to pieces of the
- record (like BLOBs) are stored in their native byte order and in
- this amount of bytes.
-*/
-#define portable_sizeof_char_ptr 8
-
-/**
- Return values of index_cond_func_xxx functions.
-
- 0=ICP_NO_MATCH - index tuple doesn't satisfy the pushed index condition (the
- engine should discard the tuple and go to the next one)
- 1=ICP_MATCH - index tuple satisfies the pushed index condition (the engine
- should fetch and return the record)
- 2=ICP_OUT_OF_RANGE - index tuple is out range that we're scanning, e.g. this
- if we're scanning "t.key BETWEEN 10 AND 20" and got a
- "t.key=21" tuple (the engine should stop scanning and return
- HA_ERR_END_OF_FILE right away).
-*/
-
-typedef enum icp_result {
- ICP_ERROR=-1,
- ICP_NO_MATCH=0,
- ICP_MATCH=1,
- ICP_OUT_OF_RANGE=2
-} ICP_RESULT;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _my_handler_h */
diff --git a/include/my_net.h b/include/my_net.h
index 5762f5da06e..ce2ee6ce8ca 100644
--- a/include/my_net.h
+++ b/include/my_net.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -73,38 +73,6 @@ C_MODE_START
#define in_addr_t uint32
#endif
-/*
- Handling of gethostbyname_r()
-*/
-
-#if !defined(HAVE_GETHOSTBYNAME_R)
-struct hostent *my_gethostbyname_r(const char *name,
- struct hostent *result, char *buffer,
- int buflen, int *h_errnop);
-void my_gethostbyname_r_free();
-#elif defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
-struct hostent *my_gethostbyname_r(const char *name,
- struct hostent *result, char *buffer,
- int buflen, int *h_errnop);
-#define my_gethostbyname_r_free()
-#if !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) && !defined(HPUX10)
-#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
-#endif /* !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */
-
-#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT)
-#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data)
-struct hostent *my_gethostbyname_r(const char *name,
- struct hostent *result, char *buffer,
- int buflen, int *h_errnop);
-#define my_gethostbyname_r_free()
-#else
-#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E))
-#define my_gethostbyname_r_free()
-#endif /* !defined(HAVE_GETHOSTBYNAME_R) */
-
-#ifndef GETHOSTBYNAME_BUFF_SIZE
-#define GETHOSTBYNAME_BUFF_SIZE 2048
-#endif
C_MODE_END
#endif
diff --git a/include/my_no_pthread.h b/include/my_no_pthread.h
deleted file mode 100644
index 633a5b94a6c..00000000000
--- a/include/my_no_pthread.h
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef MY_NO_PTHREAD_INCLUDED
-#define MY_NO_PTHREAD_INCLUDED
-
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- 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 THREAD
-
-/*
- This block is to access some thread-related type definitions
- even in builds which do not need thread functions,
- as some variables (based on these types) are declared
- even in non-threaded builds.
- Case in point: 'mf_keycache.c'
-*/
-#if defined(__WIN__)
-#else /* Normal threads */
-#include <pthread.h>
-
-#endif /* defined(__WIN__) */
-
-
-/*
- This undefs some pthread mutex locks when one isn't using threads
- to make thread safe code, that should also work in single thread
- environment, easier to use.
-*/
-#define pthread_mutex_init(A,B)
-#define pthread_mutex_lock(A)
-#define pthread_mutex_unlock(A)
-#define pthread_mutex_destroy(A)
-#define my_rwlock_init(A,B)
-#define rw_rdlock(A)
-#define rw_wrlock(A)
-#define rw_unlock(A)
-#define rwlock_destroy(A)
-#define safe_mutex_assert_owner(mp)
-
-#define mysql_mutex_init(A, B, C) do {} while (0)
-#define mysql_mutex_lock(A) do {} while (0)
-#define mysql_mutex_unlock(A) do {} while (0)
-#define mysql_mutex_destroy(A) do {} while (0)
-
-#define mysql_rwlock_init(A, B, C) do {} while (0)
-#define mysql_rwlock_rdlock(A) do {} while (0)
-#define mysql_rwlock_wrlock(A) do {} while (0)
-#define mysql_rwlock_unlock(A) do {} while (0)
-#define mysql_rwlock_destroy(A) do {} while (0)
-
-typedef int my_pthread_once_t;
-#define MY_PTHREAD_ONCE_INIT 0
-#define MY_PTHREAD_ONCE_DONE 1
-
-#define my_pthread_once(C,F) do { \
- if (*(C) != MY_PTHREAD_ONCE_DONE) { F(); *(C)= MY_PTHREAD_ONCE_DONE; } \
- } while(0)
-
-#endif
-#endif /* MY_NO_PTHREAD_INCLUDED */
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 8a7976bb334..c0321cde6ed 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -48,19 +48,30 @@ typedef struct st_pthread_link {
struct st_pthread_link *next;
} pthread_link;
-typedef struct {
- uint32 waiting;
- CRITICAL_SECTION lock_waiting;
-
- enum {
- SIGNAL= 0,
- BROADCAST= 1,
- MAX_EVENTS= 2
- } EVENTS;
-
- HANDLE events[MAX_EVENTS];
- HANDLE broadcast_block_event;
-
+/**
+ Implementation of Windows condition variables.
+ We use native conditions on Vista and later, and fallback to own
+ implementation on earlier OS version.
+*/
+typedef union
+{
+ /* Native condition (used on Vista and later) */
+ CONDITION_VARIABLE native_cond;
+
+ /* Own implementation (used on XP) */
+ struct
+ {
+ uint32 waiting;
+ CRITICAL_SECTION lock_waiting;
+ enum
+ {
+ SIGNAL= 0,
+ BROADCAST= 1,
+ MAX_EVENTS= 2
+ } EVENTS;
+ HANDLE events[MAX_EVENTS];
+ HANDLE broadcast_block_event;
+ };
} pthread_cond_t;
@@ -206,7 +217,11 @@ int pthread_cancel(pthread_t thread);
typedef void *(* pthread_handler)(void *);
#define my_pthread_once_t pthread_once_t
+#if defined(PTHREAD_ONCE_INITIALIZER)
+#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INITIALIZER
+#else
#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
+#endif
#define my_pthread_once(C,F) pthread_once(C,F)
/* Test first for RTS or FSU threads */
@@ -488,7 +503,8 @@ int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line);
int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file,
uint line);
int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
- struct timespec *abstime, const char *file, uint line);
+ const struct timespec *abstime,
+ const char *file, uint line);
void safe_mutex_global_init(void);
void safe_mutex_end(FILE *file);
void safe_mutex_free_deadlock_data(safe_mutex_t *mp);
@@ -598,7 +614,7 @@ int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp);
/* Use our own version of read/write locks */
#define NEED_MY_RW_LOCK 1
#define rw_lock_t my_rw_lock_t
-#define my_rwlock_init(A,B) my_rw_init((A), 0)
+#define my_rwlock_init(A,B) my_rw_init((A))
#define rw_rdlock(A) my_rw_rdlock((A))
#define rw_wrlock(A) my_rw_wrlock((A))
#define rw_tryrdlock(A) my_rw_tryrdlock((A))
@@ -610,49 +626,123 @@ int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp);
#endif /* USE_MUTEX_INSTEAD_OF_RW_LOCKS */
-/*
- Portable read-write locks which prefer readers.
-
- Required by some algorithms in order to provide correctness.
+/**
+ Portable implementation of special type of read-write locks.
+
+ These locks have two properties which are unusual for rwlocks:
+ 1) They "prefer readers" in the sense that they do not allow
+ situations in which rwlock is rd-locked and there is a
+ pending rd-lock which is blocked (e.g. due to pending
+ request for wr-lock).
+ This is a stronger guarantee than one which is provided for
+ PTHREAD_RWLOCK_PREFER_READER_NP rwlocks in Linux.
+ MDL subsystem deadlock detector relies on this property for
+ its correctness.
+ 2) They are optimized for uncontended wr-lock/unlock case.
+ This is scenario in which they are most oftenly used
+ within MDL subsystem. Optimizing for it gives significant
+ performance improvements in some of tests involving many
+ connections.
+
+ Another important requirement imposed on this type of rwlock
+ by the MDL subsystem is that it should be OK to destroy rwlock
+ object which is in unlocked state even though some threads might
+ have not yet fully left unlock operation for it (of course there
+ is an external guarantee that no thread will try to lock rwlock
+ which is destroyed).
+ Putting it another way the unlock operation should not access
+ rwlock data after changing its state to unlocked.
+
+ TODO/FIXME: We should consider alleviating this requirement as
+ it blocks us from doing certain performance optimizations.
*/
-#if defined(HAVE_PTHREAD_RWLOCK_RDLOCK) && defined(HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP)
-/*
- On systems which have a way to specify that readers should
- be preferred through attribute mechanism (e.g. Linux) we use
- system implementation of read/write locks.
-*/
-#define rw_pr_lock_t pthread_rwlock_t
+typedef struct st_rw_pr_lock_t {
+ /**
+ Lock which protects the structure.
+ Also held for the duration of wr-lock.
+ */
+ pthread_mutex_t lock;
+ /**
+ Condition variable which is used to wake-up
+ writers waiting for readers to go away.
+ */
+ pthread_cond_t no_active_readers;
+ /** Number of active readers. */
+ uint active_readers;
+ /** Number of writers waiting for readers to go away. */
+ uint writers_waiting_readers;
+ /** Indicates whether there is an active writer. */
+ my_bool active_writer;
+#ifdef SAFE_MUTEX
+ /** Thread holding wr-lock (for debug purposes only). */
+ pthread_t writer_thread;
+#endif
+} rw_pr_lock_t;
+
extern int rw_pr_init(rw_pr_lock_t *);
-#define rw_pr_rdlock(A) pthread_rwlock_rdlock(A)
-#define rw_pr_wrlock(A) pthread_rwlock_wrlock(A)
-#define rw_pr_tryrdlock(A) pthread_rwlock_tryrdlock(A)
-#define rw_pr_trywrlock(A) pthread_rwlock_trywrlock(A)
-#define rw_pr_unlock(A) pthread_rwlock_unlock(A)
-#define rw_pr_destroy(A) pthread_rwlock_destroy(A)
+extern int rw_pr_rdlock(rw_pr_lock_t *);
+extern int rw_pr_wrlock(rw_pr_lock_t *);
+extern int rw_pr_unlock(rw_pr_lock_t *);
+extern int rw_pr_destroy(rw_pr_lock_t *);
+#ifdef SAFE_MUTEX
+#define rw_pr_lock_assert_write_owner(A) \
+ DBUG_ASSERT((A)->active_writer && pthread_equal(pthread_self(), \
+ (A)->writer_thread))
+#define rw_pr_lock_assert_not_write_owner(A) \
+ DBUG_ASSERT(! (A)->active_writer || ! pthread_equal(pthread_self(), \
+ (A)->writer_thread))
+#else
#define rw_pr_lock_assert_write_owner(A)
#define rw_pr_lock_assert_not_write_owner(A)
-#else
-/* Otherwise we have to use our own implementation of read/write locks. */
-#define NEED_MY_RW_LOCK 1
-struct st_my_rw_lock_t;
-#define rw_pr_lock_t my_rw_lock_t
-extern int rw_pr_init(struct st_my_rw_lock_t *);
-#define rw_pr_rdlock(A) my_rw_rdlock((A))
-#define rw_pr_wrlock(A) my_rw_wrlock((A))
-#define rw_pr_tryrdlock(A) my_rw_tryrdlock((A))
-#define rw_pr_trywrlock(A) my_rw_trywrlock((A))
-#define rw_pr_unlock(A) my_rw_unlock((A))
-#define rw_pr_destroy(A) my_rw_destroy((A))
-#define rw_pr_lock_assert_write_owner(A) my_rw_lock_assert_write_owner((A))
-#define rw_pr_lock_assert_not_write_owner(A) my_rw_lock_assert_not_write_owner((A))
-#endif /* defined(HAVE_PTHREAD_RWLOCK_RDLOCK) && defined(HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP) */
+#endif /* SAFE_MUTEX */
#ifdef NEED_MY_RW_LOCK
+
+#ifdef _WIN32
+
+/**
+ Implementation of Windows rwlock.
+
+ We use native (slim) rwlocks on Win7 and later, and fallback to portable
+ implementation on earlier Windows.
+
+ slim rwlock are also available on Vista/WS2008, but we do not use it
+ ("trylock" APIs are missing on Vista)
+*/
+typedef union
+{
+ /* Native rwlock (is_srwlock == TRUE) */
+ struct
+ {
+ SRWLOCK srwlock; /* native reader writer lock */
+ BOOL have_exclusive_srwlock; /* used for unlock */
+ };
+
+ /*
+ Portable implementation (is_srwlock == FALSE)
+ Fields are identical with Unix my_rw_lock_t fields.
+ */
+ struct
+ {
+ pthread_mutex_t lock; /* lock for structure */
+ pthread_cond_t readers; /* waiting readers */
+ pthread_cond_t writers; /* waiting writers */
+ int state; /* -1:writer,0:free,>0:readers */
+ int waiters; /* number of waiting writers */
+#ifdef SAFE_MUTEX
+ pthread_t write_thread;
+#endif
+ };
+} my_rw_lock_t;
+
+
+#else /* _WIN32 */
+
/*
- On systems which don't support native read/write locks, or don't support
- read/write locks which prefer readers we have to use own implementation.
+ On systems which don't support native read/write locks we have
+ to use own implementation.
*/
typedef struct st_my_rw_lock_t {
pthread_mutex_t lock; /* lock for structure */
@@ -660,13 +750,14 @@ typedef struct st_my_rw_lock_t {
pthread_cond_t writers; /* waiting writers */
int state; /* -1:writer,0:free,>0:readers */
int waiters; /* number of waiting writers */
- my_bool prefer_readers;
#ifdef SAFE_MUTEX
pthread_t write_thread;
#endif
} my_rw_lock_t;
-extern int my_rw_init(my_rw_lock_t *, my_bool *);
+#endif /*! _WIN32 */
+
+extern int my_rw_init(my_rw_lock_t *);
extern int my_rw_destroy(my_rw_lock_t *);
extern int my_rw_rdlock(my_rw_lock_t *);
extern int my_rw_wrlock(my_rw_lock_t *);
@@ -720,8 +811,7 @@ typedef ulong my_thread_id;
extern void my_threadattr_global_init(void);
extern my_bool my_thread_global_init(void);
-extern my_bool my_thread_basic_global_init(void);
-extern void my_thread_basic_global_reinit(void);
+extern void my_thread_global_reinit(void);
extern void my_thread_global_end(void);
extern my_bool my_thread_init(void);
extern void my_thread_end(void);
@@ -800,12 +890,6 @@ extern uint thd_lib_detected;
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
-*/
-#ifdef THREAD
#ifndef thread_safe_increment
#ifdef _WIN32
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
@@ -829,7 +913,7 @@ extern uint thd_lib_detected;
(mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L)))
#endif
#endif
-#endif
+
/*
statistics_xxx functions are for non critical statistic,
diff --git a/include/my_stacktrace.h b/include/my_stacktrace.h
index 78e3dbca577..8c2c97c68e5 100644
--- a/include/my_stacktrace.h
+++ b/include/my_stacktrace.h
@@ -45,7 +45,7 @@ C_MODE_START
#if defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE)
void my_init_stacktrace();
void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack);
-void my_safe_print_str(const char* name, const char* val, int max_len);
+void my_safe_print_str(const char* val, int max_len);
void my_write_core(int sig);
#if BACKTRACE_DEMANGLE
char *my_demangle(const char *mangled_name, int *status);
diff --git a/include/my_sys.h b/include/my_sys.h
index ecb478818ac..4dfe425dc30 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -29,12 +29,27 @@ typedef struct my_aio_result {
} my_aio_result;
#endif
-#ifndef THREAD
-extern int my_errno; /* Last error in mysys */
+#ifdef HAVE_valgrind
+#define IF_VALGRIND(A,B) A
#else
-#include <my_pthread.h>
+#define IF_VALGRIND(A,B) B
#endif
+#if defined(HAVE_valgrind)&& defined(HAVE_VALGRIND_MEMCHECK_H)
+# include <valgrind/memcheck.h>
+# define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len)
+# define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len)
+# define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len)
+# define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len)
+#else /* HAVE_VALGRIND */
+# define MEM_UNDEFINED(a,len) bfill(a, len, 0x8F)
+# define MEM_NOACCESS(a,len) ((void) 0)
+# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
+# define MEM_CHECK_DEFINED(a,len) ((void) 0)
+#endif /* HAVE_VALGRIND */
+
+#include <my_pthread.h>
+
#include <m_ctype.h> /* for CHARSET_INFO */
#include <stdarg.h>
#include <typelib.h>
@@ -98,7 +113,7 @@ extern int my_errno; /* Last error in mysys */
#define ME_HOLDTANG 8 /* Don't delete last keys */
#define ME_WAITTOT 16 /* Wait for errtime secs of for a action */
#define ME_WAITTANG 32 /* Wait for a user action */
-#define ME_NOREFRESH 64 /* Dont refresh screen */
+#define ME_NOREFRESH 64 /* Write the error message to error log */
#define ME_NOINPUT 128 /* Dont use the input libary */
#define ME_COLOUR1 ((1 << ME_HIGHBYTE)) /* Possibly error-colours */
#define ME_COLOUR2 ((2 << ME_HIGHBYTE))
@@ -254,7 +269,7 @@ extern my_bool my_disable_sync;
extern char wild_many,wild_one,wild_prefix;
extern const char *charsets_dir;
/* from default.c */
-extern char *my_defaults_extra_file;
+extern const char *my_defaults_extra_file;
extern const char *my_defaults_group_suffix;
extern const char *my_defaults_file;
@@ -318,7 +333,7 @@ struct st_my_file_info
int oflag; /* open flags, e.g O_APPEND */
#endif
enum file_type type;
-#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
+#if !defined(HAVE_PREAD) && !defined(_WIN32)
mysql_mutex_t mutex;
#endif
};
@@ -338,9 +353,7 @@ typedef struct st_my_tmpdir
DYNAMIC_ARRAY full_list;
char **list;
uint cur, max;
-#ifdef THREAD
mysql_mutex_t mutex;
-#endif
} MY_TMPDIR;
typedef struct st_dynamic_string
@@ -352,7 +365,6 @@ typedef struct st_dynamic_string
struct st_io_cache;
typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*);
-#ifdef THREAD
typedef struct st_io_cache_share
{
mysql_mutex_t mutex; /* To sync on reads into buffer. */
@@ -372,7 +384,6 @@ typedef struct st_io_cache_share
my_bool alloced;
#endif
} IO_CACHE_SHARE;
-#endif
typedef struct st_io_cache /* Used when cacheing files */
{
@@ -413,7 +424,7 @@ typedef struct st_io_cache /* Used when cacheing files */
WRITE_CACHE, and &read_pos and &read_end respectively otherwise
*/
uchar **current_pos, **current_end;
-#ifdef THREAD
+
/*
The lock is for append buffer used in SEQ_READ_APPEND cache
need mutex copying from append buffer to read buffer.
@@ -427,7 +438,7 @@ typedef struct st_io_cache /* Used when cacheing files */
READ_CACHE mode is supported.
*/
IO_CACHE_SHARE *share;
-#endif
+
/*
A caller will use my_b_read() macro to read from the cache
if the data is already in cache, it will be simply copied with
@@ -460,7 +471,8 @@ typedef struct st_io_cache /* Used when cacheing files */
IO_CACHE_CALLBACK pre_close;
/*
Counts the number of times, when we were forced to use disk. We use it to
- increase the binlog_cache_disk_use status variable.
+ increase the binlog_cache_disk_use and binlog_stmt_cache_disk_use status
+ variables.
*/
ulong disk_writes;
void* arg; /* for use by pre/post_read */
@@ -635,10 +647,13 @@ extern const char** get_global_errmsgs();
extern void wait_for_free_space(const char *filename, int errors);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
+extern FILE *my_freopen(const char *path, const char *mode, FILE *stream);
extern int my_fclose(FILE *fd,myf MyFlags);
extern File my_fileno(FILE *fd);
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
extern int my_chmod(const char *name, mode_t mode, myf my_flags);
+extern void thr_set_sync_wait_callback(void (*before_sync)(void),
+ void (*after_sync)(void));
extern int my_sync(File fd, myf my_flags);
extern int my_sync_dir(const char *dir_name, myf my_flags);
extern int my_sync_dir_by_file(const char *file_name, myf my_flags);
@@ -653,21 +668,12 @@ extern int my_error_register(const char** (*get_errmsgs) (),
extern const char **my_error_unregister(int first, int last);
extern void my_message(uint my_err, const char *str,myf MyFlags);
extern void my_message_stderr(uint my_err, const char *str, myf MyFlags);
-extern my_bool my_basic_init(void);
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 char * my_filename(File fd);
-#ifndef THREAD
-extern void dont_break(void);
-extern void allow_break(void);
-#else
-#define dont_break()
-#define allow_break()
-#endif
-
#ifdef EXTRA_DEBUG
void my_print_open_files(void);
#else
@@ -740,12 +746,10 @@ extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
pbool clear_cache);
extern void setup_io_cache(IO_CACHE* info);
extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count);
-#ifdef THREAD
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,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);
@@ -839,7 +843,8 @@ extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len);
extern int get_defaults_options(int argc, char **argv,
char **defaults, char **extra_defaults,
char **group_suffix);
-extern const char *args_separator;
+extern my_bool my_getopt_use_args_separator;
+extern my_bool my_getopt_is_args_separator(const char* arg);
extern int my_load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv, const char ***);
extern int load_defaults(const char *conf_file, const char **groups,
diff --git a/include/my_time.h b/include/my_time.h
index fdfe130c45f..68f9c2e739f 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -50,6 +50,19 @@ typedef long my_time_t;
/* two-digit years < this are 20..; >= this are 19.. */
#define YY_PART_YEAR 70
+/*
+ check for valid times only if the range of time_t is greater than
+ the range of my_time_t
+*/
+#if SIZEOF_TIME_T > 4 || defined(TIME_T_UNSIGNED)
+# define IS_TIME_T_VALID_FOR_TIMESTAMP(x) \
+ ((x) <= TIMESTAMP_MAX_VALUE && \
+ (x) >= TIMESTAMP_MIN_VALUE)
+#else
+# define IS_TIME_T_VALID_FOR_TIMESTAMP(x) \
+ ((x) >= TIMESTAMP_MIN_VALUE)
+#endif
+
/* Flags to str_to_datetime */
#define TIME_FUZZY_DATE 1
#define TIME_DATETIME_ONLY 2
diff --git a/include/my_valgrind.h b/include/my_valgrind.h
deleted file mode 100644
index dd8f4b22e21..00000000000
--- a/include/my_valgrind.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 2010 Monty Program 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 */
-
-
-/* Some defines to make it easier to use valgrind */
-
-#ifdef HAVE_valgrind
-#define IF_VALGRIND(A,B) (A)
-#else
-#define IF_VALGRIND(A,B) (B)
-#endif
-
-#if defined(HAVE_valgrind)&& defined(HAVE_VALGRIND_MEMCHECK_H)
-#include <valgrind/memcheck.h>
-#define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len)
-#define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len)
-#define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len)
-#define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len)
-#else /* HAVE_VALGRIND */
-# define MEM_UNDEFINED(a,len) bfill(a, len, 0x8F)
-# define MEM_NOACCESS(a,len) ((void) 0)
-# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
-# define MEM_CHECK_DEFINED(a,len) ((void) 0)
-#endif /* HAVE_VALGRIND */
-
diff --git a/include/myisam.h b/include/myisam.h
index b54950fa1cc..fb4f2e260e6 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights
+ reserved
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
@@ -21,16 +22,10 @@
extern "C" {
#endif
-#ifndef _my_base_h
#include <my_base.h>
-#endif
-#ifndef _m_ctype_h
#include <m_ctype.h>
-#endif
-#ifndef _keycache_h
#include "keycache.h"
-#endif
-#include "my_handler.h"
+#include "my_compare.h"
#include <myisamchk.h>
#include <mysql/plugin.h>
@@ -315,11 +310,9 @@ typedef struct st_mi_bit_buff
typedef struct st_sort_info
{
-#ifdef THREAD
/* sync things */
mysql_mutex_t mutex;
mysql_cond_t cond;
-#endif
MI_INFO *info;
HA_CHECK *param;
uchar *buff;
diff --git a/include/myisamchk.h b/include/myisamchk.h
index ca81c689f3d..57a015238e0 100644
--- a/include/myisamchk.h
+++ b/include/myisamchk.h
@@ -154,10 +154,8 @@ typedef struct st_handler_check_param
char temp_filename[FN_REFLEN];
IO_CACHE read_cache;
enum_handler_stats_method stats_method;
-#ifdef THREAD
mysql_mutex_t print_msg_mutex;
my_bool need_print_msg_lock;
-#endif
} HA_CHECK;
diff --git a/include/mysql.h b/include/mysql.h
index cfaf1c7881b..28def52e422 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -17,11 +17,10 @@
This file defines the client API to MySQL and also the ABI of the
dynamically linked libmysqlclient.
- The ABI should never be changed in a released product of MySQL
+ The ABI should never be changed in a released product of MySQL,
thus you need to take great care when changing the file. In case
- the file is changed so the ABI is broken, you must also
- update the SHAREDLIB_MAJOR_VERSION in configure.in .
-
+ the file is changed so the ABI is broken, you must also update
+ the SHARED_LIB_MAJOR_VERSION in cmake/mysql_version.cmake
*/
#ifndef _mysql_h
@@ -576,6 +575,8 @@ typedef struct st_mysql_bind
} MYSQL_BIND;
+struct st_mysql_stmt_extension;
+
/* statement handler */
typedef struct st_mysql_stmt
{
@@ -621,7 +622,7 @@ typedef struct st_mysql_stmt
metadata fields when doing mysql_stmt_store_result.
*/
my_bool update_max_length;
- void *extension;
+ struct st_mysql_stmt_extension *extension;
} MYSQL_STMT;
enum enum_stmt_attr_type
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index 31c4f5e5781..821e7b26454 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -224,9 +224,9 @@ typedef struct st_typelib {
extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position);
extern int find_type_with_warning(const char *x, TYPELIB *typelib,
const char *option);
-extern uint 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);
+extern int find_type_or_exit(const char *x, TYPELIB *typelib,
+ const char *option);
+extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags);
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
extern const char *get_type(TYPELIB *typelib,unsigned int nr);
extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from);
@@ -513,6 +513,7 @@ typedef struct st_mysql_bind
my_bool is_null_value;
void *extension;
} MYSQL_BIND;
+struct st_mysql_stmt_extension;
typedef struct st_mysql_stmt
{
MEM_ROOT mem_root;
@@ -542,7 +543,7 @@ typedef struct st_mysql_stmt
unsigned char bind_result_done;
my_bool unbuffered_fetch_cancelled;
my_bool update_max_length;
- void *extension;
+ struct st_mysql_stmt_extension *extension;
} MYSQL_STMT;
enum enum_stmt_attr_type
{
diff --git a/include/mysql/client_plugin.h b/include/mysql/client_plugin.h
index 9c7b1aee9f9..6af0d226ea2 100644
--- a/include/mysql/client_plugin.h
+++ b/include/mysql/client_plugin.h
@@ -38,7 +38,7 @@
#define MYSQL_CLIENT_MAX_PLUGINS 3
#define mysql_declare_client_plugin(X) \
- struct st_mysql_client_plugin_ ## X \
+ MYSQL_PLUGIN_EXPORT struct st_mysql_client_plugin_ ## X \
_mysql_client_plugin_declaration_ = { \
MYSQL_CLIENT_ ## X ## _PLUGIN, \
MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION,
@@ -52,8 +52,11 @@
const char *author; \
const char *desc; \
unsigned int version[3]; \
+ const char *license; \
+ void *mysql_api; \
int (*init)(char *, size_t, int, va_list); \
- int (*deinit)();
+ int (*deinit)(); \
+ int (*options)(const char *option, const void *);
struct st_mysql_client_plugin
{
@@ -94,8 +97,7 @@ typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql,
/**
loads a plugin and initializes it
- @param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used,
- and last_errno/last_error, for error reporting
+ @param mysql MYSQL structure.
@param name a name of the plugin to load
@param type type of plugin that should be loaded, -1 to disable type check
@param argc number of arguments to pass to the plugin initialization
@@ -115,8 +117,7 @@ mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
This is the same as mysql_load_plugin, but take va_list instead of
a list of arguments.
- @param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used,
- and last_errno/last_error, for error reporting
+ @param mysql MYSQL structure.
@param name a name of the plugin to load
@param type type of plugin that should be loaded, -1 to disable type check
@param argc number of arguments to pass to the plugin initialization
@@ -133,8 +134,7 @@ mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
/**
finds an already loaded plugin by name, or loads it, if necessary
- @param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used,
- and last_errno/last_error, for error reporting
+ @param mysql MYSQL structure.
@param name a name of the plugin to load
@param type type of plugin that should be loaded
@@ -162,5 +162,19 @@ struct st_mysql_client_plugin *
mysql_client_register_plugin(struct st_mysql *mysql,
struct st_mysql_client_plugin *plugin);
+/**
+ set plugin options
+
+ Can be used to set extra options and affect behavior for a plugin.
+ This function may be called multiple times to set several options
+
+ @param plugin an st_mysql_client_plugin structure
+ @param option a string which specifies the option to set
+ @param value value for the option.
+
+ @retval 0 on success, 1 in case of failure
+**/
+int mysql_plugin_options(struct st_mysql_client_plugin *plugin,
+ const char *option, const void *value);
#endif
diff --git a/include/mysql/client_plugin.h.pp b/include/mysql/client_plugin.h.pp
index ca477d83bb2..93eaff7501e 100644
--- a/include/mysql/client_plugin.h.pp
+++ b/include/mysql/client_plugin.h.pp
@@ -1,6 +1,6 @@
struct st_mysql_client_plugin
{
- int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; int (*init)(char *, size_t, int, va_list); int (*deinit)();
+ int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *);
};
struct st_mysql;
#include <mysql/plugin_auth_common.h>
@@ -21,11 +21,9 @@ typedef struct st_plugin_vio
} MYSQL_PLUGIN_VIO;
struct st_mysql_client_plugin_AUTHENTICATION
{
- int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; int (*init)(char *, size_t, int, va_list); int (*deinit)();
+ int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *);
int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql);
};
-typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql,
- int type, const char *prompt, char *buf, int buf_len);
struct st_mysql_client_plugin *
mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
int argc, ...);
@@ -37,3 +35,5 @@ mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);
struct st_mysql_client_plugin *
mysql_client_register_plugin(struct st_mysql *mysql,
struct st_mysql_client_plugin *plugin);
+int mysql_plugin_options(struct st_mysql_client_plugin *plugin,
+ const char *option, const void *value);
diff --git a/include/mysql/innodb_priv.h b/include/mysql/innodb_priv.h
index 993dad7cf99..5406c292b18 100644
--- a/include/mysql/innodb_priv.h
+++ b/include/mysql/innodb_priv.h
@@ -22,7 +22,6 @@
class THD;
-uint filename_to_tablename(const char *from, char *to, uint to_length);
int get_quote_char_for_identifier(THD *thd, const char *name, uint length);
bool schema_table_store_record(THD *thd, TABLE *table);
void localtime_to_TIME(MYSQL_TIME *to, struct tm *from);
diff --git a/include/mysql/plugin_audit.h b/include/mysql/plugin_audit.h
index 41505da64af..5072ad2b44c 100644
--- a/include/mysql/plugin_audit.h
+++ b/include/mysql/plugin_audit.h
@@ -24,16 +24,7 @@
#define MYSQL_AUDIT_CLASS_MASK_SIZE 1
-#define MYSQL_AUDIT_INTERFACE_VERSION 0x0200
-
-/*
- The first word in every event class struct indicates the specific
- class of the event.
-*/
-struct mysql_event
-{
- unsigned int event_class;
-};
+#define MYSQL_AUDIT_INTERFACE_VERSION 0x0300
/*************************************************************************
@@ -42,6 +33,8 @@ struct mysql_event
LOG events occurs before emitting to the general query log.
ERROR events occur before transmitting errors to the user.
RESULT events occur after transmitting a resultset to the user.
+ STATUS events occur after transmitting a resultset or errors
+ to the user.
*/
#define MYSQL_AUDIT_GENERAL_CLASS 0
@@ -49,10 +42,10 @@ struct mysql_event
#define MYSQL_AUDIT_GENERAL_LOG 0
#define MYSQL_AUDIT_GENERAL_ERROR 1
#define MYSQL_AUDIT_GENERAL_RESULT 2
+#define MYSQL_AUDIT_GENERAL_STATUS 3
struct mysql_event_general
{
- unsigned int event_class;
unsigned int event_subclass;
int general_error_code;
unsigned long general_thread_id;
@@ -68,6 +61,42 @@ struct mysql_event_general
};
+/*
+ AUDIT CLASS : CONNECTION
+
+ CONNECT occurs after authentication phase is completed.
+ DISCONNECT occurs after connection is terminated.
+ CHANGE_USER occurs after COM_CHANGE_USER RPC is completed.
+*/
+
+#define MYSQL_AUDIT_CONNECTION_CLASS 1
+#define MYSQL_AUDIT_CONNECTION_CLASSMASK (1 << MYSQL_AUDIT_CONNECTION_CLASS)
+#define MYSQL_AUDIT_CONNECTION_CONNECT 0
+#define MYSQL_AUDIT_CONNECTION_DISCONNECT 1
+#define MYSQL_AUDIT_CONNECTION_CHANGE_USER 2
+
+struct mysql_event_connection
+{
+ unsigned int event_subclass;
+ int status;
+ unsigned long thread_id;
+ const char *user;
+ unsigned int user_length;
+ const char *priv_user;
+ unsigned int priv_user_length;
+ const char *external_user;
+ unsigned int external_user_length;
+ const char *proxy_user;
+ unsigned int proxy_user_length;
+ const char *host;
+ unsigned int host_length;
+ const char *ip;
+ unsigned int ip_length;
+ const char *database;
+ unsigned int database_length;
+};
+
+
/*************************************************************************
Here we define the descriptor structure, that is referred from
st_mysql_plugin.
@@ -78,9 +107,9 @@ struct mysql_event_general
waiting for the next query from the client.
event_notify() is invoked whenever an event occurs which is of any
- class for which the plugin has interest. The first word of the
- mysql_event argument indicates the specific event class and the
- remainder of the structure is as required for that class.
+ class for which the plugin has interest. The second argument
+ indicates the specific event class and the third argument is data
+ as required for that class.
class_mask is an array of bits used to indicate what event classes
that this plugin wants to receive.
@@ -90,7 +119,7 @@ struct st_mysql_audit
{
int interface_version;
void (*release_thd)(MYSQL_THD);
- void (*event_notify)(MYSQL_THD, const struct mysql_event *);
+ void (*event_notify)(MYSQL_THD, unsigned int, const void *);
unsigned long class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE];
};
diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp
index ad8ca389d34..42d44b9dae0 100644
--- a/include/mysql/plugin_audit.h.pp
+++ b/include/mysql/plugin_audit.h.pp
@@ -33,16 +33,23 @@ MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
int allocate_lex_string);
#include <mysql/service_thd_wait.h>
typedef enum _thd_wait_type_e {
- THD_WAIT_MUTEX= 1,
+ THD_WAIT_SLEEP= 1,
THD_WAIT_DISKIO= 2,
- THD_WAIT_ROW_TABLE_LOCK= 3,
- THD_WAIT_GLOBAL_LOCK= 4
+ THD_WAIT_ROW_LOCK= 3,
+ THD_WAIT_GLOBAL_LOCK= 4,
+ THD_WAIT_META_DATA_LOCK= 5,
+ THD_WAIT_TABLE_LOCK= 6,
+ THD_WAIT_USER_LOCK= 7,
+ THD_WAIT_BINLOG= 8,
+ THD_WAIT_GROUP_COMMIT= 9,
+ THD_WAIT_SYNC= 10,
+ THD_WAIT_LAST= 11
} thd_wait_type;
extern struct thd_wait_service_st {
- void (*thd_wait_begin_func)(void*, thd_wait_type);
+ void (*thd_wait_begin_func)(void*, int);
void (*thd_wait_end_func)(void*);
} *thd_wait_service;
-void thd_wait_begin(void* thd, thd_wait_type wait_type);
+void thd_wait_begin(void* thd, int wait_type);
void thd_wait_end(void* thd);
#include <mysql/service_thread_scheduler.h>
struct scheduler_functions;
@@ -205,13 +212,8 @@ void mysql_query_cache_invalidate4(void* thd,
void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
void thd_set_ha_data(void* thd, const struct handlerton *hton,
const void *ha_data);
-struct mysql_event
-{
- unsigned int event_class;
-};
struct mysql_event_general
{
- unsigned int event_class;
unsigned int event_subclass;
int general_error_code;
unsigned long general_thread_id;
@@ -225,10 +227,30 @@ struct mysql_event_general
unsigned long long general_time;
unsigned long long general_rows;
};
+struct mysql_event_connection
+{
+ unsigned int event_subclass;
+ int status;
+ unsigned long thread_id;
+ const char *user;
+ unsigned int user_length;
+ const char *priv_user;
+ unsigned int priv_user_length;
+ const char *external_user;
+ unsigned int external_user_length;
+ const char *proxy_user;
+ unsigned int proxy_user_length;
+ const char *host;
+ unsigned int host_length;
+ const char *ip;
+ unsigned int ip_length;
+ const char *database;
+ unsigned int database_length;
+};
struct st_mysql_audit
{
int interface_version;
void (*release_thd)(void*);
- void (*event_notify)(void*, const struct mysql_event *);
+ void (*event_notify)(void*, unsigned int, const void *);
unsigned long class_mask[1];
};
diff --git a/include/mysql/plugin_auth.h b/include/mysql/plugin_auth.h
index 2b84a6c73af..fcfd1bc6f0b 100644
--- a/include/mysql/plugin_auth.h
+++ b/include/mysql/plugin_auth.h
@@ -1,5 +1,6 @@
#ifndef MYSQL_PLUGIN_AUTH_INCLUDED
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
+ Copyright (C) 2010 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,6 +31,13 @@
#include <mysql/plugin_auth_common.h>
+/* defines for MYSQL_SERVER_AUTH_INFO.password_used */
+
+#define PASSWORD_USED_NO 0
+#define PASSWORD_USED_YES 1
+#define PASSWORD_USED_NO_MENTION 2
+
+
/**
Provides server plugin access to authentication information
*/
@@ -39,7 +47,13 @@ typedef struct st_mysql_server_auth_info
User name as sent by the client and shown in USER().
NULL if the client packet with the user name was not received yet.
*/
- const char *user_name;
+ char *user_name;
+
+ /**
+ Length of user_name
+ */
+ unsigned int user_name_length;
+
/**
A corresponding column value from the mysql.user table for the
matching account name
@@ -47,17 +61,46 @@ typedef struct st_mysql_server_auth_info
const char *auth_string;
/**
+ Length of auth_string
+ */
+ unsigned long auth_string_length;
+
+ /**
Matching account name as found in the mysql.user table.
A plugin can override it with another name that will be
used by MySQL for authorization, and shown in CURRENT_USER()
*/
char authenticated_as[MYSQL_USERNAME_LENGTH+1];
+
+
+ /**
+ The unique user name that was used by the plugin to authenticate.
+ Not used by the server.
+ Available through the @@EXTERNAL_USER variable.
+ */
+ char external_user[512];
+
/**
This only affects the "Authentication failed. Password used: %s"
- error message. If set, %s will be YES, otherwise - NO.
+ error message. has the following values :
+ 0 : %s will be NO.
+ 1 : %s will be YES.
+ 2 : there will be no %s.
Set it as appropriate or ignore at will.
*/
int password_used;
+
+ /**
+ Set to the name of the connected client host, if it can be resolved,
+ or to its IP address otherwise.
+ */
+ const char *host_or_ip;
+
+ /**
+ Length of host_or_ip
+ */
+ unsigned int host_or_ip_length;
+
} MYSQL_SERVER_AUTH_INFO;
/**
diff --git a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp
index bbd91a84f33..e65278c518e 100644
--- a/include/mysql/plugin_auth.h.pp
+++ b/include/mysql/plugin_auth.h.pp
@@ -33,16 +33,23 @@ MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
int allocate_lex_string);
#include <mysql/service_thd_wait.h>
typedef enum _thd_wait_type_e {
- THD_WAIT_MUTEX= 1,
+ THD_WAIT_SLEEP= 1,
THD_WAIT_DISKIO= 2,
- THD_WAIT_ROW_TABLE_LOCK= 3,
- THD_WAIT_GLOBAL_LOCK= 4
+ THD_WAIT_ROW_LOCK= 3,
+ THD_WAIT_GLOBAL_LOCK= 4,
+ THD_WAIT_META_DATA_LOCK= 5,
+ THD_WAIT_TABLE_LOCK= 6,
+ THD_WAIT_USER_LOCK= 7,
+ THD_WAIT_BINLOG= 8,
+ THD_WAIT_GROUP_COMMIT= 9,
+ THD_WAIT_SYNC= 10,
+ THD_WAIT_LAST= 11
} thd_wait_type;
extern struct thd_wait_service_st {
- void (*thd_wait_begin_func)(void*, thd_wait_type);
+ void (*thd_wait_begin_func)(void*, int);
void (*thd_wait_end_func)(void*);
} *thd_wait_service;
-void thd_wait_begin(void* thd, thd_wait_type wait_type);
+void thd_wait_begin(void* thd, int wait_type);
void thd_wait_end(void* thd);
#include <mysql/service_thread_scheduler.h>
struct scheduler_functions;
@@ -95,22 +102,6 @@ struct st_mysql_plugin
struct st_mysql_sys_var **system_vars;
void * __reserved1;
};
-struct st_maria_plugin
-{
- int type;
- void *info;
- const char *name;
- const char *author;
- const char *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;
- const char *version_info;
- unsigned int maturity;
-};
#include "plugin_ftparser.h"
#include "plugin.h"
enum enum_ftparser_mode
@@ -140,16 +131,16 @@ typedef struct st_mysql_ftparser_boolean_info
typedef struct st_mysql_ftparser_param
{
int (*mysql_parse)(struct st_mysql_ftparser_param *,
- const char *doc, int doc_len);
+ char *doc, int doc_len);
int (*mysql_add_word)(struct st_mysql_ftparser_param *,
- const char *word, int word_len,
+ char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
void *ftparser_state;
void *mysql_ftparam;
- const struct charset_info_st *cs;
- const char *doc;
+ struct charset_info_st *cs;
+ char *doc;
int length;
- unsigned int flags;
+ int flags;
enum enum_ftparser_mode mode;
} MYSQL_FTPARSER_PARAM;
struct st_mysql_ftparser
@@ -187,14 +178,13 @@ int thd_in_lock_tables(const void* thd);
int thd_tablespace_op(const void* thd);
long long thd_test_options(const void* thd, long long test_options);
int thd_sql_command(const void* thd);
+const char *thd_proc_info(void* thd, const char *info);
void **thd_ha_data(const void* thd, const struct handlerton *hton);
void thd_storage_lock_wait(void* thd, long long value);
int thd_tx_isolation(const void* thd);
char *thd_security_context(void* thd, char *buffer, unsigned int length,
unsigned int max_query_len);
void thd_inc_row_count(void* thd);
-const char *set_thd_proc_info(void*, const char * info, const char *func,
- const char *file, const unsigned int line);
int mysql_tmpfile(const char *prefix);
int thd_killed(const void* thd);
unsigned long thd_get_thread_id(const void* thd);
@@ -223,10 +213,15 @@ typedef struct st_plugin_vio
} MYSQL_PLUGIN_VIO;
typedef struct st_mysql_server_auth_info
{
- const char *user_name;
+ char *user_name;
+ unsigned int user_name_length;
const char *auth_string;
+ unsigned long auth_string_length;
char authenticated_as[48 +1];
+ char external_user[512];
int password_used;
+ const char *host_or_ip;
+ unsigned int host_or_ip_length;
} MYSQL_SERVER_AUTH_INFO;
struct st_mysql_auth
{
diff --git a/include/mysql/plugin_auth_common.h b/include/mysql/plugin_auth_common.h
index b71591d6eb6..3c87fe7e094 100644
--- a/include/mysql/plugin_auth_common.h
+++ b/include/mysql/plugin_auth_common.h
@@ -1,5 +1,6 @@
#ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
+ Copyright (C) 2010 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/include/mysql/plugin_ftparser.h.pp b/include/mysql/plugin_ftparser.h.pp
index 0d6a70ec19c..0067732d4fc 100644
--- a/include/mysql/plugin_ftparser.h.pp
+++ b/include/mysql/plugin_ftparser.h.pp
@@ -33,16 +33,23 @@ MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str,
int allocate_lex_string);
#include <mysql/service_thd_wait.h>
typedef enum _thd_wait_type_e {
- THD_WAIT_MUTEX= 1,
+ THD_WAIT_SLEEP= 1,
THD_WAIT_DISKIO= 2,
- THD_WAIT_ROW_TABLE_LOCK= 3,
- THD_WAIT_GLOBAL_LOCK= 4
+ THD_WAIT_ROW_LOCK= 3,
+ THD_WAIT_GLOBAL_LOCK= 4,
+ THD_WAIT_META_DATA_LOCK= 5,
+ THD_WAIT_TABLE_LOCK= 6,
+ THD_WAIT_USER_LOCK= 7,
+ THD_WAIT_BINLOG= 8,
+ THD_WAIT_GROUP_COMMIT= 9,
+ THD_WAIT_SYNC= 10,
+ THD_WAIT_LAST= 11
} thd_wait_type;
extern struct thd_wait_service_st {
- void (*thd_wait_begin_func)(void*, thd_wait_type);
+ void (*thd_wait_begin_func)(void*, int);
void (*thd_wait_end_func)(void*);
} *thd_wait_service;
-void thd_wait_begin(void* thd, thd_wait_type wait_type);
+void thd_wait_begin(void* thd, int wait_type);
void thd_wait_end(void* thd);
#include <mysql/service_thread_scheduler.h>
struct scheduler_functions;
diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h
index de145f642e1..6fc6689c47d 100644
--- a/include/mysql/psi/mysql_file.h
+++ b/include/mysql/psi/mysql_file.h
@@ -16,6 +16,8 @@
#ifndef MYSQL_FILE_H
#define MYSQL_FILE_H
+#include <my_global.h>
+
/* For strlen() */
#include <string.h>
/* For MY_STAT */
diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h
index 389c73d09e9..d20e89a26fd 100644
--- a/include/mysql/psi/mysql_thread.h
+++ b/include/mysql/psi/mysql_thread.h
@@ -141,9 +141,7 @@ typedef struct st_mysql_rwlock mysql_rwlock_t;
@c mysql_prlock_t is a drop-in replacement for @c rw_pr_lock_t.
@sa mysql_prlock_init
@sa mysql_prlock_rdlock
- @sa mysql_prlock_tryrdlock
@sa mysql_prlock_wrlock
- @sa mysql_prlock_trywrlock
@sa mysql_prlock_unlock
@sa mysql_prlock_destroy
*/
@@ -421,20 +419,6 @@ typedef struct st_mysql_cond mysql_cond_t;
#endif
/**
- @def mysql_prlock_tryrdlock(RW)
- Instrumented rw_pr_tryrdlock.
- @c mysql_prlock_tryrdlock is a drop-in replacement
- for @c rw_pr_tryrdlock.
-*/
-#ifdef HAVE_PSI_INTERFACE
- #define mysql_prlock_tryrdlock(RW) \
- inline_mysql_prlock_tryrdlock(RW, __FILE__, __LINE__)
-#else
- #define mysql_prlock_tryrdlock(RW) \
- inline_mysql_prlock_tryrdlock(RW)
-#endif
-
-/**
@def mysql_rwlock_trywrlock(RW)
Instrumented rwlock_trywrlock.
@c mysql_rwlock_trywrlock is a drop-in replacement
@@ -449,20 +433,6 @@ typedef struct st_mysql_cond mysql_cond_t;
#endif
/**
- @def mysql_prlock_trywrlock(RW)
- Instrumented rw_pr_trywrlock.
- @c mysql_prlock_trywrlock is a drop-in replacement
- for @c rw_pr_trywrlock.
-*/
-#ifdef HAVE_PSI_INTERFACE
- #define mysql_prlock_trywrlock(RW) \
- inline_mysql_prlock_trywrlock(RW, __FILE__, __LINE__)
-#else
- #define mysql_prlock_trywrlock(RW) \
- inline_mysql_prlock_trywrlock(RW)
-#endif
-
-/**
@def mysql_rwlock_unlock(RW)
Instrumented rwlock_unlock.
@c mysql_rwlock_unlock is a drop-in replacement
@@ -905,35 +875,6 @@ static inline int inline_mysql_rwlock_tryrdlock(
return result;
}
-#ifndef DISABLE_MYSQL_PRLOCK_H
-static inline int inline_mysql_prlock_tryrdlock(
- mysql_prlock_t *that
-#ifdef HAVE_PSI_INTERFACE
- , const char *src_file, uint src_line
-#endif
- )
-{
- int result;
-#ifdef HAVE_PSI_INTERFACE
- struct PSI_rwlock_locker *locker= NULL;
- PSI_rwlock_locker_state state;
- if (likely(PSI_server && that->m_psi))
- {
- locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
- PSI_RWLOCK_TRYREADLOCK);
- if (likely(locker != NULL))
- PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
- }
-#endif
- result= rw_pr_tryrdlock(&that->m_prlock);
-#ifdef HAVE_PSI_INTERFACE
- if (likely(locker != NULL))
- PSI_server->end_rwlock_rdwait(locker, result);
-#endif
- return result;
-}
-#endif
-
static inline int inline_mysql_rwlock_trywrlock(
mysql_rwlock_t *that
#ifdef HAVE_PSI_INTERFACE
@@ -961,35 +902,6 @@ static inline int inline_mysql_rwlock_trywrlock(
return result;
}
-#ifndef DISABLE_MYSQL_PRLOCK_H
-static inline int inline_mysql_prlock_trywrlock(
- mysql_prlock_t *that
-#ifdef HAVE_PSI_INTERFACE
- , const char *src_file, uint src_line
-#endif
- )
-{
- int result;
-#ifdef HAVE_PSI_INTERFACE
- struct PSI_rwlock_locker *locker= NULL;
- PSI_rwlock_locker_state state;
- if (likely(PSI_server && that->m_psi))
- {
- locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
- PSI_RWLOCK_TRYWRITELOCK);
- if (likely(locker != NULL))
- PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
- }
-#endif
- result= rw_pr_trywrlock(&that->m_prlock);
-#ifdef HAVE_PSI_INTERFACE
- if (likely(locker != NULL))
- PSI_server->end_rwlock_wrwait(locker, result);
-#endif
- return result;
-}
-#endif
-
static inline int inline_mysql_rwlock_unlock(
mysql_rwlock_t *that)
{
diff --git a/include/mysql/service_thd_wait.h b/include/mysql/service_thd_wait.h
index 2a8f5e610a3..f5d2a75f5fc 100644
--- a/include/mysql/service_thd_wait.h
+++ b/include/mysql/service_thd_wait.h
@@ -50,15 +50,35 @@
extern "C" {
#endif
+/*
+ One should only report wait events that could potentially block for a
+ long time. A mutex wait is too short of an event to report. The reason
+ is that an event which is reported leads to a new thread starts
+ executing a query and this has a negative impact of usage of CPU caches
+ and thus the expected gain of starting a new thread must be higher than
+ the expected cost of lost performance due to starting a new thread.
+
+ Good examples of events that should be reported are waiting for row locks
+ that could easily be for many milliseconds or even seconds and the same
+ holds true for global read locks, table locks and other meta data locks.
+ Another event of interest is going to sleep for an extended time.
+*/
typedef enum _thd_wait_type_e {
- THD_WAIT_MUTEX= 1,
+ THD_WAIT_SLEEP= 1,
THD_WAIT_DISKIO= 2,
- THD_WAIT_ROW_TABLE_LOCK= 3,
- THD_WAIT_GLOBAL_LOCK= 4
+ THD_WAIT_ROW_LOCK= 3,
+ THD_WAIT_GLOBAL_LOCK= 4,
+ THD_WAIT_META_DATA_LOCK= 5,
+ THD_WAIT_TABLE_LOCK= 6,
+ THD_WAIT_USER_LOCK= 7,
+ THD_WAIT_BINLOG= 8,
+ THD_WAIT_GROUP_COMMIT= 9,
+ THD_WAIT_SYNC= 10,
+ THD_WAIT_LAST= 11
} thd_wait_type;
extern struct thd_wait_service_st {
- void (*thd_wait_begin_func)(MYSQL_THD, thd_wait_type);
+ void (*thd_wait_begin_func)(MYSQL_THD, int);
void (*thd_wait_end_func)(MYSQL_THD);
} *thd_wait_service;
@@ -70,7 +90,7 @@ extern struct thd_wait_service_st {
#else
-void thd_wait_begin(MYSQL_THD thd, thd_wait_type wait_type);
+void thd_wait_begin(MYSQL_THD thd, int wait_type);
void thd_wait_end(MYSQL_THD thd);
#endif
diff --git a/include/mysql/thread_pool_priv.h b/include/mysql/thread_pool_priv.h
new file mode 100644
index 00000000000..fc9a2bc6424
--- /dev/null
+++ b/include/mysql/thread_pool_priv.h
@@ -0,0 +1,121 @@
+/*
+ Copyright (C) 2010, 2011 Oracle and/or its affiliates. All rights reserved.
+
+ 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 THREAD_POOL_PRIV_INCLUDED
+#define THREAD_POOL_PRIV_INCLUDED
+
+/*
+ The thread pool requires access to some MySQL server error codes, this is
+ accessed from mysqld_error.h.
+ We need access to the struct that defines the thread pool plugin interface
+ which is accessed through scheduler.h.
+ All accesses to THD variables and functions are defined in this header file.
+ A thread pool can also use DEBUG_SYNC and must thus include
+ debug_sync.h
+ To handle definitions of Information Schema plugins it is also required
+ to include sql_profile.h and table.h.
+*/
+#include <mysqld_error.h> /* To get ER_ERROR_ON_READ */
+#define MYSQL_SERVER 1
+#include <scheduler.h>
+#include <debug_sync.h>
+#include <sql_profile.h>
+#include <table.h>
+
+/* Needed to get access to scheduler variables */
+void* thd_get_scheduler_data(THD *thd);
+void thd_set_scheduler_data(THD *thd, void *data);
+PSI_thread* thd_get_psi(THD *thd);
+void thd_set_psi(THD *thd, PSI_thread *psi);
+
+/* Interface to THD variables and functions */
+void thd_set_killed(THD *thd);
+void thd_clear_errors(THD *thd);
+void thd_set_thread_stack(THD *thd, char *stack_start);
+void thd_lock_thread_count(THD *thd);
+void thd_unlock_thread_count(THD *thd);
+void thd_close_connection(THD *thd);
+THD *thd_get_current_thd();
+void thd_new_connection_setup(THD *thd, char *stack_start);
+void thd_lock_data(THD *thd);
+void thd_unlock_data(THD *thd);
+bool thd_is_transaction_active(THD *thd);
+int thd_connection_has_data(THD *thd);
+void thd_set_net_read_write(THD *thd, uint val);
+void thd_set_mysys_var(THD *thd, st_my_thread_var *mysys_var);
+my_socket thd_get_fd(THD *thd);
+
+/* Print to the MySQL error log */
+void sql_print_error(const char *format, ...);
+
+/* Store a table record */
+bool schema_table_store_record(THD *thd, TABLE *table);
+
+/*
+ The thread pool must be able to execute statements using the connection
+ state in THD object. This is the main objective of the thread pool to
+ schedule the start of these commands.
+*/
+bool do_command(THD *thd);
+
+/*
+ The thread pool requires an interface to the connection logic in the
+ MySQL Server since the thread pool will maintain the event logic on
+ the TCP connection of the MySQL Server. Thus new connections, dropped
+ connections will be discovered by the thread pool and it needs to
+ ensure that the proper MySQL Server logic attached to these events is
+ executed.
+*/
+/* Initialise a new connection handler thread */
+bool init_new_connection_handler_thread();
+/* Set up connection thread before use as execution thread */
+bool setup_connection_thread_globals(THD *thd);
+/* Prepare connection as part of connection set-up */
+bool thd_prepare_connection(THD *thd);
+/* Release auditing before executing statement */
+void mysql_audit_release(THD *thd);
+/* Check if connection is still alive */
+bool thd_is_connection_alive(THD *thd);
+/* Close connection with possible error code */
+void close_connection(THD *thd, uint errcode);
+/* End the connection before closing it */
+void end_connection(THD *thd);
+/* Cleanup the THD object */
+void thd_cleanup(THD *thd);
+/* Decrement connection counter */
+void dec_connection_count();
+/* Destroy THD object */
+void delete_thd(THD *thd);
+
+/*
+ thread_created is maintained by thread pool when activated since
+ user threads are created by the thread pool (and also special
+ threads to maintain the thread pool). This is done through
+ inc_thread_created.
+
+ max_connections is needed to calculate the maximum number of threads
+ that is allowed to be started by the thread pool. The method
+ get_max_connections() gets reference to this variable.
+
+ connection_attrib is the thread attributes for connection threads,
+ the method get_connection_attrib provides a reference to these
+ attributes.
+*/
+void inc_thread_created(void);
+ulong get_max_connections(void);
+pthread_attr_t *get_connection_attrib(void);
+#endif
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 4154b620208..7f2b4d53ec0 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
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
@@ -120,6 +120,10 @@ enum enum_server_command
#define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */
#define FIELD_IN_ADD_INDEX (1<< 20) /* Intern: Field used in ADD INDEX */
#define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed */
+#define FIELD_FLAGS_STORAGE_MEDIA 22 /* Field storage media, bit 22-23,
+ reserved by MySQL Cluster */
+#define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25,
+ reserved by MySQL Cluster */
#define REFRESH_GRANT 1 /* Refresh grant tables */
#define REFRESH_LOG 2 /* Start on new log file */
@@ -267,7 +271,11 @@ enum enum_server_command
#define SERVER_STATUS_CLEAR_SET (SERVER_QUERY_NO_GOOD_INDEX_USED| \
SERVER_QUERY_NO_INDEX_USED|\
SERVER_MORE_RESULTS_EXISTS|\
- SERVER_STATUS_METADATA_CHANGED)
+ SERVER_STATUS_METADATA_CHANGED |\
+ SERVER_QUERY_WAS_SLOW |\
+ SERVER_STATUS_DB_DROPPED |\
+ SERVER_STATUS_CURSOR_EXISTS|\
+ SERVER_STATUS_LAST_ROW_SENT)
#define MYSQL_ERRMSG_SIZE 512
#define NET_READ_TIMEOUT 30 /* Timeout on read */
diff --git a/include/mysql_embed.h b/include/mysql_embed.h
index ae70b9723f8..3b6f851bd6f 100644
--- a/include/mysql_embed.h
+++ b/include/mysql_embed.h
@@ -23,10 +23,8 @@
/* Things we don't need in the embedded version of MySQL */
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
-#undef HAVE_PSTACK /* No stacktrace */
#undef HAVE_DLOPEN /* No udf functions */
#undef HAVE_SMEM /* No shared memory */
-#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_EMBED_INCLUDED */
diff --git a/include/mysys_err.h b/include/mysys_err.h
index 8b6a12ba36e..620b43bb317 100644
--- a/include/mysys_err.h
+++ b/include/mysys_err.h
@@ -65,8 +65,8 @@ extern const char *globerrs[]; /* my_error_messages is here */
#define EE_FILE_NOT_CLOSED 30
#define EE_CHANGE_OWNERSHIP 31
#define EE_CHANGE_PERMISSIONS 32
-#define EE_CANT_CHMOD 33
-#define EE_CANT_SEEK 34
+#define EE_CANT_SEEK 33
+#define EE_CANT_CHMOD 34
#define EE_CANT_COPY_OWNERSHIP 35
#define EE_ERROR_LAST 35 /* Copy last error nr */
/* Add error numbers before EE_ERROR_LAST and change it accordingly. */
diff --git a/include/thr_alarm.h b/include/thr_alarm.h
index 2ff975607cd..351041ac042 100644
--- a/include/thr_alarm.h
+++ b/include/thr_alarm.h
@@ -41,7 +41,7 @@ typedef struct st_alarm_info
void thr_alarm_info(ALARM_INFO *info);
-#if defined(DONT_USE_THR_ALARM) || !defined(THREAD)
+#if defined(DONT_USE_THR_ALARM)
#define USE_ALARM_THREAD
#undef USE_ONE_SIGNAL_HAND
diff --git a/include/typelib.h b/include/typelib.h
index 2879c745a3f..2cfe5e6c0da 100644
--- a/include/typelib.h
+++ b/include/typelib.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -29,9 +29,19 @@ typedef struct st_typelib { /* Different types saved here */
extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position);
extern int find_type_with_warning(const char *x, TYPELIB *typelib,
const char *option);
-extern uint 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);
+extern int find_type_or_exit(const char *x, TYPELIB *typelib,
+ const char *option);
+#define FIND_TYPE_BASIC 0
+/** makes @c find_type() require the whole name, no prefix */
+#define FIND_TYPE_NO_PREFIX (1 << 0)
+/** always implicitely on, so unused, but old code may pass it */
+#define FIND_TYPE_NO_OVERWRITE (1 << 1)
+/** makes @c find_type() accept a number */
+#define FIND_TYPE_ALLOW_NUMBER (1 << 2)
+/** makes @c find_type() treat ',' as terminator */
+#define FIND_TYPE_COMMA_TERM (1 << 3)
+
+extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags);
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
extern const char *get_type(TYPELIB *typelib,unsigned int nr);
extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from);
diff --git a/include/violite.h b/include/violite.h
index 896b024c8b7..ba057028ed2 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -93,6 +93,8 @@ ssize_t vio_pending(Vio *vio);
my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, int addr_length,
char *ip_string, size_t ip_string_size);
+my_bool vio_is_no_name_error(int err_code);
+
int vio_getnameinfo(const struct sockaddr *sa,
char *hostname, size_t hostname_size,
char *port, size_t port_size,
@@ -132,13 +134,13 @@ struct st_VioSSLFd
SSL_CTX *ssl_context;
};
-int sslaccept(struct st_VioSSLFd*, Vio *, long timeout, char *error_string);
-int sslconnect(struct st_VioSSLFd*, Vio *, long timeout, char *error_string);
+int sslaccept(struct st_VioSSLFd*, Vio *, long timeout, unsigned long *errptr);
+int sslconnect(struct st_VioSSLFd*, Vio *, long timeout, unsigned long *errptr);
struct st_VioSSLFd
*new_VioSSLConnectorFd(const char *key_file, const char *cert_file,
const char *ca_file, const char *ca_path,
- const char *cipher);
+ const char *cipher, enum enum_ssl_init_error* error);
struct st_VioSSLFd
*new_VioSSLAcceptorFd(const char *key_file, const char *cert_file,
const char *ca_file,const char *ca_path,
diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h
new file mode 100644
index 00000000000..b4a2828f4a8
--- /dev/null
+++ b/include/welcome_copyright_notice.h
@@ -0,0 +1,30 @@
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+
+ 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 _welcome_copyright_notice_h_
+#define _welcome_copyright_notice_h_
+
+/*
+ This define specifies copyright notice which is displayed by every MySQL
+ program on start, or on help screen.
+*/
+#define ORACLE_WELCOME_COPYRIGHT_NOTICE(years) \
+ "Copyright (c) " years ", Oracle and/or its affiliates. All rights reserved.\n" \
+ "2009-2011 Monty Program Ab\n" \
+ "\n" \
+ "This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n" \
+ "and you are welcome to modify and redistribute it under the GPL license\n"
+
+#endif /* _welcome_copyright_notice_h_ */
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index 84dd3fa4b43..816977d9b8e 100644
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -134,12 +134,19 @@ CACHE INTERNAL "Functions exported by client API"
)
+IF(WIN32)
+ ADD_SUBDIRECTORY(authentication_win)
+ SET(WITH_AUTHENTICATION_WIN 1)
+ ADD_DEFINITIONS(-DAUTHENTICATION_WIN)
+ENDIF(WIN32)
+
SET(CLIENT_SOURCES
get_password.c
libmysql.c
errmsg.c
../sql-common/client.c
../sql-common/my_time.c
+ ../sql-common/client_plugin.c
../sql/net_serv.cc
../sql-common/client_plugin.c
../sql-common/pack.c
@@ -151,6 +158,10 @@ ADD_DEPENDENCIES(clientlib GenError)
SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES} ${LIBDL})
+IF(WITH_AUTHENTICATION_WIN)
+ LIST(APPEND LIBS auth_win_client)
+ENDIF(WITH_AUTHENTICATION_WIN)
+
# Merge several convenience libraries into one big mysqlclient
# and link them together into shared library.
MERGE_LIBRARIES(mysqlclient STATIC ${LIBS} COMPONENT Development)
@@ -172,7 +183,7 @@ IF(UNIX)
SET(${OUTNAME} ${LIBNAME}${EXTENSION}${DOT_VERSION})
ENDIF()
ENDMACRO()
- INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR} COMPONENT SharedLibraries)
+ INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR} Development)
ENDIF()
IF(NOT DISABLE_SHARED)
@@ -210,7 +221,7 @@ IF(NOT DISABLE_SHARED)
"${CMAKE_SHARED_LIBRARY_SUFFIX}"
""
linkname)
- INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} COMPONENT SharedLibraries)
+ INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries)
SET(OS_SHARED_LIB_SYMLINKS "${SHARED_LIB_MAJOR_VERSION}" "${OS_SHARED_LIB_VERSION}")
LIST(REMOVE_DUPLICATES OS_SHARED_LIB_SYMLINKS)
FOREACH(ver ${OS_SHARED_LIB_SYMLINKS})
@@ -219,7 +230,7 @@ IF(NOT DISABLE_SHARED)
"${CMAKE_SHARED_LIBRARY_SUFFIX}"
"${ver}"
linkname)
- INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} COMPONENT SharedLibraries)
+ INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries)
ENDFOREACH()
ENDIF()
ENDIF()
diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am
deleted file mode 100644
index 07f66c28ddb..00000000000
--- a/libmysql/Makefile.am
+++ /dev/null
@@ -1,115 +0,0 @@
-# Copyright (C) 2000-2004 MySQL AB, 2008-2009 Sun Microsystems, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of version 2 GNU General Public License as
-# published by the Free Software Foundation.
-#
-# There are special exceptions to the terms and conditions of the GPL as it
-# is applied to this software. View the full text of the exception in file
-# EXCEPTIONS-CLIENT in the directory of this software distribution.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-#
-# This file is public domain and comes with NO WARRANTY of any kind
-
-target = libmysqlclient.la
-target_defs = -DMYSQL_CLIENT_NO_THREADS -DDISABLE_MYSQL_THREAD_H \
- @LIB_EXTRA_CCFLAGS@
-
-LIBS = @CLIENT_LIBS@
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
- $(openssl_includes) @ZLIB_INCLUDES@
-
-include $(srcdir)/Makefile.shared
-
-libmysqlclient_la_SOURCES = $(target_sources)
-libmysqlclient_la_LIBADD = $(target_libadd) $(yassl_las)
-libmysqlclient_la_LDFLAGS = $(target_ldflags)
-EXTRA_DIST = Makefile.shared libmysql.def CMakeLists.txt
-noinst_HEADERS = client_settings.h
-
-link_sources:
- set -x; \
- ss=`echo $(mystringsobjects) | sed "s;\.lo;.c;g"`; \
- ds=`echo $(dbugobjects) | sed "s;\.lo;.c;g"`; \
- ms=`echo $(mysysobjects) | sed "s;\.lo;.c;g"`; \
- vs=`echo $(vio_objects) | sed "s;\.lo;.c;g"`; \
- scs=`echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"`; \
- for f in $$ss; do \
- rm -f $$f; \
- @LN_CP_F@ $(top_srcdir)/strings/$$f $$f; \
- done; \
- for f in $$vs $(vioheaders); do \
- rm -f $$f; \
- @LN_CP_F@ $(top_srcdir)/vio/$$f $$f; \
- done; \
- for f in $$scs; do \
- rm -f $$f; \
- @LN_CP_F@ $(top_srcdir)/sql-common/$$f $$f; \
- done; \
- for f in $(mystringsextra); do \
- rm -f $$f; \
- @LN_CP_F@ $(top_srcdir)/strings/$$f $$f; \
- done; \
- for f in $$ds; do \
- rm -f $$f; \
- @LN_CP_F@ $(top_srcdir)/dbug/$$f $$f; \
- done; \
- for f in $$ms $(mysysheaders); do \
- rm -f $$f; \
- @LN_CP_F@ $(top_srcdir)/mysys/$$f $$f; \
- done; \
- rm -f net.c; \
- @LN_CP_F@ $(top_srcdir)/sql/net_serv.cc net.c ; \
- rm -f password.c; \
- @LN_CP_F@ $(top_srcdir)/sql/password.c password.c
- echo timestamp > link_sources
-
-# This part requires GNUmake
-#
-# This makes a distribution file with only the files needed to compile
-# a minimal MySQL client library
-#
-# For a really minimal distribution (without debugging code) we could
-# keep only the stubs for debug.c
-#
-# A list of needed headers collected from the deps information 000213
-nh = my_global.h dbug.h errmsg.h \
- m_ctype.h m_string.h password.h \
- my_alarm.h my_config.h my_dir.h my_list.h my_net.h my_sys.h \
- mysql.h mysql_com.h mysql_version.h mysqld_error.h \
- mysys_err.h my_pthread.h thr_alarm.h violite.h hash.h \
- sql_common.h ../libmysql/client_settings.h
-# Get a list of the needed objects
-lobjs = $(mysysobjects1) $(dbugobjects) $(mystringsobjects) $(sqlobjects)
-
-do-lib-dist:
- dir=libmysql-$(MYSQL_NO_DASH_VERSION); \
- srcs1=`echo $(lobjs) | sed "s;\.lo;.c;g"`; \
- srcs2=$(target_sources); \
- srcs="$$srcs1 $$srcs2"; \
- objs1=`echo $(lobjs) | sed "s;\.lo;.o;g"`; \
- objs2=`echo $(target_sources) | sed "s;\.c;.o;g"`; \
- objs="$$objs1 $$objs2"; \
- rm -rf $$dir; \
- mkdir $$dir; \
- $(INSTALL_DATA) $$srcs $(mysysheaders) $$dir; \
- for i in $(nh); do $(INSTALL_DATA) ../include/$$i $$dir; done; \
- echo "# A very minimal Makefile to compile" > $$dir/Makefile; \
- echo "# the minimized libmysql library" >> $$dir/Makefile; \
- echo "# This file is autogenerated from Makefile.am" >> $$dir/Makefile; \
- echo 'CFLAGS= -I. -DMYSQL_CLIENT_NO_THREADS' >>$$dir/Makefile; \
- echo "obj=$$objs" >>$$dir/Makefile; \
- echo 'all: libmysql.a' >>$$dir/Makefile; \
- echo 'libmysql.a: $$(obj)' >>$$dir/Makefile; \
- echo ' $$(AR) r $$@ $$?' >>$$dir/Makefile; \
- gtar cvzf $$dir.tar.gz $$dir; \
- cd $$dir; gmake
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
deleted file mode 100644
index 09f597444f4..00000000000
--- a/libmysql/Makefile.shared
+++ /dev/null
@@ -1,120 +0,0 @@
-# Copyright (C) 2000-2004 MySQL AB, 2008-2009 Sun Microsystems, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of version 2 GNU General Public License as
-# published by the Free Software Foundation.
-#
-# There are special exceptions to the terms and conditions of the GPL as it
-# is applied to this software. View the full text of the exception in file
-# EXCEPTIONS-CLIENT in the directory of this software distribution.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-#
-# This file is public domain and comes with NO WARRANTY of any kind
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-pkgplugindir = $(pkglibdir)/plugin
-## We'll use CLIENT_EXTRA_LDFLAGS for threaded and non-threaded
-## until someone complains that they need separate options.
-LDADD = @CLIENT_EXTRA_LDFLAGS@ $(target)
-pkglib_LTLIBRARIES = $(target)
-
-noinst_PROGRAMS = conf_to_src
-
-
-target_sources = libmysql.c password.c \
- get_password.c errmsg.c
-
-mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
- strmake.lo strend.lo \
- strnlen.lo strfill.lo is_prefix.lo \
- int2str.lo str2int.lo strcont.lo \
- strcend.lo ctype-latin1.lo \
- bchange.lo bmove.lo bmove_upp.lo longlong2str.lo \
- strtoull.lo strtoll.lo llstr.lo my_vsnprintf.lo \
- ctype.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo \
- ctype-big5.lo ctype-czech.lo ctype-cp932.lo ctype-eucjpms.lo ctype-euc_kr.lo \
- ctype-win1250ch.lo ctype-utf8.lo ctype-extra.lo \
- ctype-ucs2.lo ctype-gb2312.lo ctype-gbk.lo \
- ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo \
- ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo dtoa.lo \
- strmov_overlapp.lo
-
-mystringsextra= strto.c
-dbugobjects = dbug.lo
-mysysheaders = mysys_priv.h my_static.h
-vioheaders = vio_priv.h
-mysysobjects1 = my_init.lo my_static.lo my_malloc.lo \
- my_create.lo my_delete.lo mf_tempfile.lo my_open.lo \
- my_file.lo my_read.lo my_write.lo errors.lo \
- my_error.lo my_getwd.lo my_div.lo \
- mf_pack.lo my_mess.lo mf_dirname.lo mf_fn_ext.lo\
- mf_wcomp.lo typelib.lo my_alloc.lo \
- mf_format.lo mf_path.lo mf_unixpath.lo my_fopen.lo \
- my_symlink.lo my_fstream.lo mf_arr_appstr.lo \
- mf_loadpath.lo my_pthread.lo my_thr_init.lo \
- thr_mutex.lo mulalloc.lo string.lo default.lo \
- my_compress.lo array.lo my_once.lo list.lo \
- charset.lo charset-def.lo hash.lo mf_iocache.lo \
- mf_iocache2.lo my_seek.lo my_sleep.lo \
- my_pread.lo mf_cache.lo md5.lo sha1.lo my_rnd.lo \
- my_getopt.lo my_gethostbyname.lo my_port.lo \
- my_rename.lo my_chsize.lo my_sync.lo \
- my_getsystime.lo my_symlink2.lo mf_same.lo
-sqlobjects = net.lo
-sql_cmn_objects = pack.lo client.lo my_time.lo client_plugin.lo
-
-# Not needed in the minimum library
-mysysobjects2 = my_lib.lo mf_qsort.lo
-mysysobjects = $(mysysobjects1) $(mysysobjects2)
-target_libadd = $(mysysobjects) $(mystringsobjects) $(dbugobjects) \
- $(sql_cmn_objects) $(vio_objects) $(sqlobjects)
-target_ldflags = -version-info @SHARED_LIB_VERSION@ @LD_VERSION_SCRIPT@ @LIBDL@
-vio_objects= vio.lo viosocket.lo viossl.lo viosslfactories.lo
-
-BUILT_SOURCES = link_sources
-
-CLEANFILES = $(target_libadd) $(SHLIBOBJS) \
- $(target) $(BUILT_SOURCES)
-DEFS = -DDEFAULT_CHARSET_HOME='"$(MYSQLBASEdir)"' \
- -DMYSQL_DATADIR='"$(MYSQLDATAdir)"' \
- -DDEFAULT_HOME_ENV=MYSQL_HOME \
- -DPLUGINDIR='"$(pkgplugindir)"' \
- -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \
- -DDEFAULT_SYSCONFDIR='"$(sysconfdir)"' \
- -DSHAREDIR='"$(MYSQLSHAREdir)"' -DDISABLE_DTRACE \
- $(target_defs)
-
-if HAVE_YASSL
-yassl_las = $(top_builddir)/extra/yassl/src/libyassl.la \
- $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
-endif
-
-# The automatic dependencies miss this
-#bmove_upp.lo: $(LTCHARSET_OBJS)
-
-clean-local:
- rm -f `echo $(mystringsobjects) | sed "s;\.lo;.c;g"` \
- `echo $(dbugobjects) | sed "s;\.lo;.c;g"` \
- `echo $(mysysobjects) | sed "s;\.lo;.c;g"` \
- `echo $(vio_objects) | sed "s;\.lo;.c;g"` \
- `echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"` \
- $(CHARSET_SRCS) $(CHARSET_OBJS) \
- $(mystringsextra) $(mysysheaders) $(vioheaders) \
- net.c
-
-conf_to_src_SOURCES = conf_to_src.c
-conf_to_src_LDADD=
-#force static linking of conf_to_src - essential when linking against
-#custom installation of libc
-conf_to_src_LDFLAGS=@NOINST_LDFLAGS@
diff --git a/libmysql/acinclude.m4 b/libmysql/acinclude.m4
deleted file mode 100644
index c0211f3759f..00000000000
--- a/libmysql/acinclude.m4
+++ /dev/null
@@ -1,91 +0,0 @@
-# Local macros for automake & autoconf
-
-AC_DEFUN(MYSQL_TYPE_ACCEPT,
-[ac_save_CXXFLAGS="$CXXFLAGS"
-AC_CACHE_CHECK([base type of last arg to accept], mysql_cv_btype_last_arg_accept,
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-if test "$ac_cv_prog_gxx" = "yes"
-then
- CXXFLAGS="$CXXFLAGS -Werror"
-fi
-mysql_cv_btype_last_arg_accept=none
-[AC_TRY_COMPILE([#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-],
-[int a = accept(1, (struct sockaddr *) 0, (socklen_t *) 0);],
-mysql_cv_btype_last_arg_accept=socklen_t)]
-if test $mysql_cv_btype_last_arg_accept = none; then
-[AC_TRY_COMPILE([#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-],
-[int a = accept(1, (struct sockaddr *) 0, (size_t *) 0);],
-mysql_cv_btype_last_arg_accept=size_t)]
-fi
-if test $mysql_cv_btype_last_arg_accept = none; then
-mysql_cv_btype_last_arg_accept=int
-fi)
-AC_LANG_RESTORE
-AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $mysql_cv_btype_last_arg_accept)
-CXXFLAGS="$ac_save_CXXFLAGS"
-])
-
-
-#---START: Used in for client configure
-AC_DEFUN(MYSQL_CHECK_ULONG,
-[AC_MSG_CHECKING(for type ulong)
-AC_CACHE_VAL(ac_cv_ulong,
-[AC_TRY_RUN([#include <stdio.h>
-#include <sys/types.h>
-main()
-{
- ulong foo;
- foo++;
- exit(0);
-}], ac_cv_ulong=yes, ac_cv_ulong=no, ac_cv_ulong=no)])
-AC_MSG_RESULT($ac_cv_ulong)
-if test "$ac_cv_ulong" = "yes"
-then
- AC_DEFINE(HAVE_ULONG)
-fi
-])
-
-AC_DEFUN(MYSQL_CHECK_UCHAR,
-[AC_MSG_CHECKING(for type uchar)
-AC_CACHE_VAL(ac_cv_uchar,
-[AC_TRY_RUN([#include <stdio.h>
-#include <sys/types.h>
-main()
-{
- uchar foo;
- foo++;
- exit(0);
-}], ac_cv_uchar=yes, ac_cv_uchar=no, ac_cv_uchar=no)])
-AC_MSG_RESULT($ac_cv_uchar)
-if test "$ac_cv_uchar" = "yes"
-then
- AC_DEFINE(HAVE_UCHAR)
-fi
-])
-
-AC_DEFUN(MYSQL_CHECK_UINT,
-[AC_MSG_CHECKING(for type uint)
-AC_CACHE_VAL(ac_cv_uint,
-[AC_TRY_RUN([#include <stdio.h>
-#include <sys/types.h>
-main()
-{
- uint foo;
- foo++;
- exit(0);
-}], ac_cv_uint=yes, ac_cv_uint=no, ac_cv_uint=no)])
-AC_MSG_RESULT($ac_cv_uint)
-if test "$ac_cv_uint" = "yes"
-then
- AC_DEFINE(HAVE_UINT)
-fi
-])
-
-#---END:
diff --git a/libmysql/authentication_win/CMakeLists.txt b/libmysql/authentication_win/CMakeLists.txt
new file mode 100644
index 00000000000..80cd14780e6
--- /dev/null
+++ b/libmysql/authentication_win/CMakeLists.txt
@@ -0,0 +1,33 @@
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# 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
+
+#
+# Configuration for building Windows Authentication Plugin (client-side)
+#
+
+ADD_DEFINITIONS(-DSECURITY_WIN32)
+ADD_DEFINITIONS(-DDEBUG_ERRROR_LOG) # no error logging in production builds
+ADD_DEFINITIONS(-DWINAUTH_USE_DBUG_LIB) # it is OK to use dbug library in statically
+ # linked plugin
+
+SET(HEADERS common.h handshake.h)
+SET(PLUGIN_SOURCES plugin_client.cc handshake_client.cc log_client.cc common.cc handshake.cc)
+
+ADD_CONVENIENCE_LIBRARY(auth_win_client ${PLUGIN_SOURCES} ${HEADERS})
+TARGET_LINK_LIBRARIES(auth_win_client Secur32)
+
+# In IDE, group headers in a separate folder.
+
+SOURCE_GROUP(Headers REGULAR_EXPRESSION ".*h$")
diff --git a/libmysql/authentication_win/common.cc b/libmysql/authentication_win/common.cc
new file mode 100644
index 00000000000..1d1f2938969
--- /dev/null
+++ b/libmysql/authentication_win/common.cc
@@ -0,0 +1,492 @@
+/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ 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 "common.h"
+#include <sddl.h> // for ConvertSidToStringSid()
+#include <secext.h> // for GetUserNameEx()
+
+
+template <> void error_log_print<error_log_level::INFO>(const char *fmt, ...);
+template <> void error_log_print<error_log_level::WARNING>(const char *fmt, ...);
+template <> void error_log_print<error_log_level::ERROR>(const char *fmt, ...);
+
+
+/** Connection class **************************************************/
+
+/**
+ Create connection out of an active MYSQL_PLUGIN_VIO object.
+
+ @param[in] vio pointer to a @c MYSQL_PLUGIN_VIO object used for
+ connection - it can not be NULL
+*/
+
+Connection::Connection(MYSQL_PLUGIN_VIO *vio): m_vio(vio), m_error(0)
+{
+ DBUG_ASSERT(vio);
+}
+
+
+/**
+ Write data to the connection.
+
+ @param[in] blob data to be written
+
+ @return 0 on success, VIO error code on failure.
+
+ @note In case of error, VIO error code is stored in the connection object
+ and can be obtained with @c error() method.
+*/
+
+int Connection::write(const Blob &blob)
+{
+ m_error= m_vio->write_packet(m_vio, blob.ptr(), blob.len());
+
+#ifndef DBUG_OFF
+ if (m_error)
+ DBUG_PRINT("error", ("vio write error %d", m_error));
+#endif
+
+ return m_error;
+}
+
+
+/**
+ Read data from connection.
+
+ @return A Blob containing read packet or null Blob in case of error.
+
+ @note In case of error, VIO error code is stored in the connection object
+ and can be obtained with @c error() method.
+*/
+
+Blob Connection::read()
+{
+ unsigned char *ptr;
+ int len= m_vio->read_packet(m_vio, &ptr);
+
+ if (len < 0)
+ {
+ m_error= true;
+ return Blob();
+ }
+
+ return Blob(ptr, len);
+}
+
+
+/** Sid class *****************************************************/
+
+
+/**
+ Create Sid object corresponding to a given account name.
+
+ @param[in] account_name name of a Windows account
+
+ The account name can be in any form accepted by @c LookupAccountName()
+ function.
+
+ @note In case of errors created object is invalid and its @c is_valid()
+ method returns @c false.
+*/
+
+Sid::Sid(const wchar_t *account_name): m_data(NULL)
+#ifndef DBUG_OFF
+, m_as_string(NULL)
+#endif
+{
+ DWORD sid_size= 0, domain_size= 0;
+ bool success;
+
+ // Determine required buffer sizes
+
+ success= LookupAccountNameW(NULL, account_name, NULL, &sid_size,
+ NULL, &domain_size, &m_type);
+
+ if (!success && GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+ {
+#ifndef DBUG_OFF
+ Error_message_buf error_buf;
+ DBUG_PRINT("error", ("Could not determine SID buffer size, "
+ "LookupAccountName() failed with error %X (%s)",
+ GetLastError(), get_last_error_message(error_buf)));
+#endif
+ return;
+ }
+
+ // Query for SID (domain is ignored)
+
+ wchar_t *domain= new wchar_t[domain_size];
+ m_data= (TOKEN_USER*) new BYTE[sid_size + sizeof(TOKEN_USER)];
+ m_data->User.Sid= (BYTE*)m_data + sizeof(TOKEN_USER);
+
+ success= LookupAccountNameW(NULL, account_name,
+ m_data->User.Sid, &sid_size,
+ domain, &domain_size,
+ &m_type);
+
+ if (!success || !is_valid())
+ {
+#ifndef DBUG_OFF
+ Error_message_buf error_buf;
+ DBUG_PRINT("error", ("Could not determine SID of '%S', "
+ "LookupAccountName() failed with error %X (%s)",
+ account_name, GetLastError(),
+ get_last_error_message(error_buf)));
+#endif
+ goto fail;
+ }
+
+ goto end;
+
+fail:
+ if (m_data)
+ delete [] m_data;
+ m_data= NULL;
+
+end:
+ if (domain)
+ delete [] domain;
+}
+
+
+/**
+ Create Sid object corresponding to a given security token.
+
+ @param[in] token security token of a Windows account
+
+ @note In case of errors created object is invalid and its @c is_valid()
+ method returns @c false.
+*/
+
+Sid::Sid(HANDLE token): m_data(NULL)
+#ifndef DBUG_OFF
+, m_as_string(NULL)
+#endif
+{
+ DWORD req_size= 0;
+ bool success;
+
+ // Determine required buffer size
+
+ success= GetTokenInformation(token, TokenUser, NULL, 0, &req_size);
+ if (!success && GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+ {
+#ifndef DBUG_OFF
+ Error_message_buf error_buf;
+ DBUG_PRINT("error", ("Could not determine SID buffer size, "
+ "GetTokenInformation() failed with error %X (%s)",
+ GetLastError(), get_last_error_message(error_buf)));
+#endif
+ return;
+ }
+
+ m_data= (TOKEN_USER*) new BYTE[req_size];
+ success= GetTokenInformation(token, TokenUser, m_data, req_size, &req_size);
+
+ if (!success || !is_valid())
+ {
+ delete [] m_data;
+ m_data= NULL;
+#ifndef DBUG_OFF
+ if (!success)
+ {
+ Error_message_buf error_buf;
+ DBUG_PRINT("error", ("Could not read SID from security token, "
+ "GetTokenInformation() failed with error %X (%s)",
+ GetLastError(), get_last_error_message(error_buf)));
+ }
+#endif
+ }
+}
+
+
+Sid::~Sid()
+{
+ if (m_data)
+ delete [] m_data;
+#ifndef DBUG_OFF
+ if (m_as_string)
+ LocalFree(m_as_string);
+#endif
+}
+
+/// Check if Sid object is valid.
+bool Sid::is_valid(void) const
+{
+ return m_data && m_data->User.Sid && IsValidSid(m_data->User.Sid);
+}
+
+
+#ifndef DBUG_OFF
+
+/**
+ Produces string representation of the SID.
+
+ @return String representation of the SID or NULL in case of errors.
+
+ @note Memory allocated for the string is automatically freed in Sid's
+ destructor.
+*/
+
+const char* Sid::as_string()
+{
+ if (!m_data)
+ return NULL;
+
+ if (!m_as_string)
+ {
+ bool success= ConvertSidToStringSid(m_data->User.Sid, &m_as_string);
+
+ if (!success)
+ {
+#ifndef DBUG_OFF
+ Error_message_buf error_buf;
+ DBUG_PRINT("error", ("Could not get textual representation of a SID, "
+ "ConvertSidToStringSid() failed with error %X (%s)",
+ GetLastError(), get_last_error_message(error_buf)));
+#endif
+ m_as_string= NULL;
+ return NULL;
+ }
+ }
+
+ return m_as_string;
+}
+
+#endif
+
+
+bool Sid::operator ==(const Sid &other)
+{
+ if (!is_valid() || !other.is_valid())
+ return false;
+
+ return EqualSid(m_data->User.Sid, other.m_data->User.Sid);
+}
+
+
+/** Generating User Principal Name *************************/
+
+/**
+ Call Windows API functions to get UPN of the current user and store it
+ in internal buffer.
+*/
+
+UPN::UPN(): m_buf(NULL)
+{
+ wchar_t buf1[MAX_SERVICE_NAME_LENGTH];
+
+ // First we try to use GetUserNameEx.
+
+ m_len= sizeof(buf1)/sizeof(wchar_t);
+
+ if (!GetUserNameExW(NameUserPrincipal, buf1, (PULONG)&m_len))
+ {
+ if (GetLastError())
+ {
+#ifndef DBUG_OFF
+ Error_message_buf error_buf;
+ DBUG_PRINT("note", ("When determining UPN"
+ ", GetUserNameEx() failed with error %X (%s)",
+ GetLastError(), get_last_error_message(error_buf)));
+#endif
+ if (ERROR_MORE_DATA == GetLastError())
+ ERROR_LOG(INFO, ("Buffer overrun when determining UPN:"
+ " need %ul characters but have %ul",
+ m_len, sizeof(buf1)/sizeof(WCHAR)));
+ }
+
+ m_len= 0; // m_len == 0 indicates invalid UPN
+ return;
+ }
+
+ /*
+ UPN is stored in buf1 in wide-char format - convert it to utf8
+ for sending over network.
+ */
+
+ m_buf= wchar_to_utf8(buf1, &m_len);
+
+ if(!m_buf)
+ ERROR_LOG(ERROR, ("Failed to convert UPN to utf8"));
+
+ // Note: possible error would be indicated by the fact that m_buf is NULL.
+ return;
+}
+
+
+UPN::~UPN()
+{
+ if (m_buf)
+ free(m_buf);
+}
+
+
+/**
+ Convert a wide-char string to utf8 representation.
+
+ @param[in] string null-terminated wide-char string to be converted
+ @param[in,out] len length of the string to be converted or 0; on
+ return length (in bytes, excluding terminating
+ null character) of the converted string
+
+ If len is 0 then the length of the string will be computed by this function.
+
+ @return Pointer to a buffer containing utf8 representation or NULL in
+ case of error.
+
+ @note The returned buffer must be freed with @c free() call.
+*/
+
+char* wchar_to_utf8(const wchar_t *string, size_t *len)
+{
+ char *buf= NULL;
+ size_t str_len= len && *len ? *len : wcslen(string);
+
+ /*
+ A conversion from utf8 to wchar_t will never take more than 3 bytes per
+ character, so a buffer of length 3 * str_len schould be sufficient.
+ We check that assumption with an assertion later.
+ */
+
+ size_t buf_len= 3 * str_len;
+
+ buf= (char*)malloc(buf_len + 1);
+ if (!buf)
+ {
+ DBUG_PRINT("error",("Out of memory when converting string '%S' to utf8",
+ string));
+ return NULL;
+ }
+
+ int res= WideCharToMultiByte(CP_UTF8, // convert to UTF-8
+ 0, // conversion flags
+ string, // input buffer
+ str_len, // its length
+ buf, buf_len, // output buffer and its size
+ NULL, NULL); // default character (not used)
+
+ if (res)
+ {
+ buf[res]= '\0';
+ if (len)
+ *len= res;
+ return buf;
+ }
+
+ // res is 0 which indicates error
+
+#ifndef DBUG_OFF
+ Error_message_buf error_buf;
+ DBUG_PRINT("error", ("Could not convert string '%S' to utf8"
+ ", WideCharToMultiByte() failed with error %X (%s)",
+ string, GetLastError(),
+ get_last_error_message(error_buf)));
+#endif
+
+ // Let's check our assumption about sufficient buffer size
+ DBUG_ASSERT(ERROR_INSUFFICIENT_BUFFER != GetLastError());
+
+ return NULL;
+}
+
+
+/**
+ Convert an utf8 string to a wide-char string.
+
+ @param[in] string null-terminated utf8 string to be converted
+ @param[in,out] len length of the string to be converted or 0; on
+ return length (in chars) of the converted string
+
+ If len is 0 then the length of the string will be computed by this function.
+
+ @return Pointer to a buffer containing wide-char representation or NULL in
+ case of error.
+
+ @note The returned buffer must be freed with @c free() call.
+*/
+
+wchar_t* utf8_to_wchar(const char *string, size_t *len)
+{
+ size_t buf_len;
+
+ /*
+ Note: length (in bytes) of an utf8 string is always bigger than the
+ number of characters in this string. Hence a buffer of size len will
+ be sufficient. We add 1 for the terminating null character.
+ */
+
+ buf_len= len && *len ? *len : strlen(string);
+ wchar_t *buf= (wchar_t*)malloc((buf_len+1)*sizeof(wchar_t));
+
+ if (!buf)
+ {
+ DBUG_PRINT("error",("Out of memory when converting utf8 string '%s'"
+ " to wide-char representation", string));
+ return NULL;
+ }
+
+ size_t res;
+ res= MultiByteToWideChar(CP_UTF8, // convert from UTF-8
+ 0, // conversion flags
+ string, // input buffer
+ buf_len, // its size
+ buf, buf_len); // output buffer and its size
+ if (res)
+ {
+ buf[res]= '\0';
+ if (len)
+ *len= res;
+ return buf;
+ }
+
+ // error in MultiByteToWideChar()
+
+#ifndef DBUG_OFF
+ Error_message_buf error_buf;
+ DBUG_PRINT("error", ("Could not convert UPN from UTF-8"
+ ", MultiByteToWideChar() failed with error %X (%s)",
+ GetLastError(), get_last_error_message(error_buf)));
+#endif
+
+ // Let's check our assumption about sufficient buffer size
+ DBUG_ASSERT(ERROR_INSUFFICIENT_BUFFER != GetLastError());
+
+ return NULL;
+}
+
+
+/** Error handling ****************************************************/
+
+
+/**
+ Returns error message corresponding to the last Windows error given
+ by GetLastError().
+
+ @note Error message is overwritten by next call to
+ @c get_last_error_message().
+*/
+
+const char* get_last_error_message(Error_message_buf buf)
+{
+ int error= GetLastError();
+
+ buf[0]= '\0';
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR)buf, sizeof(buf), NULL );
+
+ return buf;
+}
diff --git a/libmysql/authentication_win/common.h b/libmysql/authentication_win/common.h
new file mode 100644
index 00000000000..ff0f7153664
--- /dev/null
+++ b/libmysql/authentication_win/common.h
@@ -0,0 +1,324 @@
+/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ 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 COMMON_H
+#define COMMON_H
+
+#include <my_global.h>
+#include <windows.h>
+#include <sspi.h> // for CtxtHandle
+#include <mysql/plugin_auth.h> // for MYSQL_PLUGIN_VIO
+
+/// Maximum length of the target service name.
+#define MAX_SERVICE_NAME_LENGTH 1024
+
+
+/** Debugging and error reporting infrastructure ***************************/
+
+/*
+ Note: We use plugin local logging and error reporting mechanisms until
+ WL#2940 (plugin service: error reporting) is available.
+*/
+
+#undef INFO
+#undef WARNING
+#undef ERROR
+
+struct error_log_level
+{
+ typedef enum {INFO, WARNING, ERROR} type;
+};
+
+
+/*
+ If DEBUG_ERROR_LOG is defined then error logging happens only
+ in debug-copiled code. Otherwise ERROR_LOG() expands to
+ error_log_print() even in production code. Note that in client
+ plugin, error_log_print() will print nothing if opt_auth_win_clinet_log
+ is 0.
+
+ Note: Macro ERROR_LOG() can use printf-like format string like this:
+
+ ERROR_LOG(Level, ("format string", args));
+
+ The implementation should handle it correctly. Currently it is passed
+ to fprintf() (see error_log_vprint() function).
+*/
+
+extern "C" int opt_auth_win_client_log;
+
+#if defined(DEBUG_ERROR_LOG) && defined(DBUG_OFF)
+#define ERROR_LOG(Level, Msg) do {} while (0)
+#else
+#define ERROR_LOG(Level, Msg) error_log_print< error_log_level::Level > Msg
+#endif
+
+
+void error_log_vprint(error_log_level::type level,
+ const char *fmt, va_list args);
+
+template <error_log_level::type Level>
+void error_log_print(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ error_log_vprint(Level, fmt, args);
+ va_end(args);
+}
+
+typedef char Error_message_buf[1024];
+const char* get_last_error_message(Error_message_buf);
+
+
+/*
+ Internal implementation of debug message printing which does not use
+ dbug library. This is invoked via macro:
+
+ DBUG_PRINT_DO(Keyword, ("format string", args));
+
+ This is supposed to be used as an implementation of DBUG_PRINT() macro,
+ unless the dbug library implementation is used or debug messages are disabled.
+*/
+
+#ifndef DBUG_OFF
+
+#define DBUG_PRINT_DO(Keyword, Msg) \
+ do { \
+ if (2 > opt_auth_win_client_log) break; \
+ fprintf(stderr, "winauth: %s: ", Keyword); \
+ debug_msg Msg; \
+ } while (0)
+
+inline
+void debug_msg(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ fputc('\n', stderr);
+ fflush(stderr);
+ va_end(args);
+}
+
+#else
+#define DBUG_PRINT_DO(K, M) do {} while (0)
+#endif
+
+
+#ifndef WINAUTH_USE_DBUG_LIB
+
+#undef DBUG_PRINT
+#define DBUG_PRINT(Keyword, Msg) DBUG_PRINT_DO(Keyword, Msg)
+
+/*
+ Redefine few more debug macros to make sure that no symbols from
+ dbug library are used.
+*/
+
+#undef DBUG_ENTER
+#define DBUG_ENTER(X) do {} while (0)
+
+#undef DBUG_RETURN
+#define DBUG_RETURN(X) return (X)
+
+#undef DBUG_ASSERT
+#ifndef DBUG_OFF
+#define DBUG_ASSERT(X) assert (X)
+#else
+#define DBUG_ASSERT(X) do {} while (0)
+#endif
+
+#undef DBUG_DUMP
+#define DBUG_DUMP(A,B,C) do {} while (0)
+
+#endif
+
+
+/** Blob class *************************************************************/
+
+typedef unsigned char byte;
+
+/**
+ Class representing a region of memory (e.g., a string or binary buffer).
+
+ @note This class does not allocate memory. It merely describes a region
+ of memory which must be allocated externally (if it is dynamic memory).
+*/
+
+class Blob
+{
+ byte *m_ptr; ///< Pointer to the first byte of the memory region.
+ size_t m_len; ///< Length of the memory region.
+
+public:
+
+ Blob(): m_ptr(NULL), m_len(0)
+ {}
+
+ Blob(const byte *ptr, const size_t len)
+ : m_ptr(const_cast<byte*>(ptr)), m_len(len)
+ {}
+
+ Blob(const char *str): m_ptr((byte*)str)
+ {
+ m_len= strlen(str);
+ }
+
+ byte* ptr() const
+ {
+ return m_ptr;
+ }
+
+ size_t len() const
+ {
+ return m_len;
+ }
+
+ byte& operator[](unsigned pos) const
+ {
+ static byte out_of_range= 0; // alas, no exceptions...
+ return pos < len() ? m_ptr[pos] : out_of_range;
+ }
+
+ bool is_null() const
+ {
+ return m_ptr == NULL;
+ }
+
+ void trim(size_t l)
+ {
+ m_len= l;
+ }
+};
+
+
+/** Connection class *******************************************************/
+
+/**
+ Convenience wrapper around MYSQL_PLUGIN_VIO object providing basic
+ read/write operations.
+*/
+
+class Connection
+{
+ MYSQL_PLUGIN_VIO *m_vio; ///< Pointer to @c MYSQL_PLUGIN_VIO structure.
+
+ /**
+ If non-zero, indicates that connection is broken. If this has happened
+ because of failed operation, stores non-zero error code from that failure.
+ */
+ int m_error;
+
+public:
+
+ Connection(MYSQL_PLUGIN_VIO *vio);
+ int write(const Blob&);
+ Blob read();
+
+ int error() const
+ {
+ return m_error;
+ }
+};
+
+
+/** Sid class **************************************************************/
+
+/**
+ Class for storing and manipulating Windows security identifiers (SIDs).
+*/
+
+class Sid
+{
+ TOKEN_USER *m_data; ///< Pointer to structure holding identifier's data.
+ SID_NAME_USE m_type; ///< Type of identified entity.
+
+public:
+
+ Sid(const wchar_t*);
+ Sid(HANDLE sec_token);
+ ~Sid();
+
+ bool is_valid(void) const;
+
+ bool is_group(void) const
+ {
+ return m_type == SidTypeGroup
+ || m_type == SidTypeWellKnownGroup
+ || m_type == SidTypeAlias;
+ }
+
+ bool is_user(void) const
+ {
+ return m_type == SidTypeUser;
+ }
+
+ bool operator==(const Sid&);
+
+ operator PSID() const
+ {
+ return (PSID)m_data->User.Sid;
+ }
+
+#ifndef DBUG_OFF
+
+private:
+ char *m_as_string; ///< Cached string representation of the SID.
+public:
+ const char* as_string();
+
+#endif
+};
+
+
+/** UPN class **************************************************************/
+
+/**
+ An object of this class obtains and stores User Principal Name of the
+ account under which current process is running.
+*/
+
+class UPN
+{
+ char *m_buf; ///< Pointer to UPN in utf8 representation.
+ size_t m_len; ///< Length of the name.
+
+public:
+
+ UPN();
+ ~UPN();
+
+ bool is_valid() const
+ {
+ return m_len > 0;
+ }
+
+ const Blob as_blob() const
+ {
+ return m_len ? Blob((byte*)m_buf, m_len) : Blob();
+ }
+
+ const char* as_string() const
+ {
+ return (const char*)m_buf;
+ }
+
+};
+
+
+char* wchar_to_utf8(const wchar_t*, size_t*);
+wchar_t* utf8_to_wchar(const char*, size_t*);
+
+#endif
diff --git a/libmysql/authentication_win/handshake.cc b/libmysql/authentication_win/handshake.cc
new file mode 100644
index 00000000000..ec665af9ef9
--- /dev/null
+++ b/libmysql/authentication_win/handshake.cc
@@ -0,0 +1,289 @@
+/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ 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 "handshake.h"
+
+
+/** Handshake class implementation **********************************/
+
+/**
+ Create common part of handshake context.
+
+ @param[in] ssp name of the SSP (Security Service Provider) to
+ be used for authentication
+ @param[in] side is this handshake object used for server- or
+ client-side handshake
+
+ Prepare for handshake using the @c ssp security module. We use
+ "Negotiate" which picks best available module. Parameter @c side
+ tells if this is preparing for server or client side authentication
+ and is used to prepare appropriate credentials.
+*/
+
+Handshake::Handshake(const char *ssp, side_t side)
+: m_atts(0L), m_error(0), m_complete(FALSE),
+ m_have_credentials(false), m_have_sec_context(false)
+#ifndef DBUG_OFF
+ , m_ssp_info(NULL)
+#endif
+{
+ SECURITY_STATUS ret;
+
+ // Obtain credentials for the authentication handshake.
+
+ ret= AcquireCredentialsHandle(NULL, (SEC_CHAR*)ssp,
+ side == SERVER ? SECPKG_CRED_INBOUND : SECPKG_CRED_OUTBOUND,
+ NULL, NULL, NULL, NULL, &m_cred, &m_expire);
+
+ if (ret != SEC_E_OK)
+ {
+ DBUG_PRINT("error", ("AcqireCredentialsHandle() failed"
+ " with error %X", ret));
+ ERROR_LOG(ERROR, ("Could not obtain local credentials"
+ " required for authentication"));
+ m_error= ret;
+ }
+
+ m_have_credentials= true;
+}
+
+
+Handshake::~Handshake()
+{
+ if (m_have_credentials)
+ FreeCredentialsHandle(&m_cred);
+ if (m_have_sec_context)
+ DeleteSecurityContext(&m_sctx);
+ m_output.free();
+
+#ifndef DBUG_OFF
+ if (m_ssp_info)
+ FreeContextBuffer(m_ssp_info);
+#endif
+}
+
+
+/**
+ Read and process data packets from the other end of a connection.
+
+ @param[IN] con a connection to read packets from
+
+ Packets are read and processed until authentication handshake is
+ complete. It is assumed that the peer will send at least one packet.
+ Packets are processed with @c process_data() method. If new data is
+ generated during packet processing, this data is sent to the peer and
+ another round of packet exchange starts.
+
+ @return 0 on success.
+
+ @note In case of error, appropriate error message is logged.
+*/
+int Handshake::packet_processing_loop()
+{
+ m_round= 0;
+
+ do {
+ ++m_round;
+ // Read packet send by the peer
+
+ DBUG_PRINT("info", ("Waiting for packet"));
+ Blob packet= read_packet();
+ if (error())
+ {
+ ERROR_LOG(ERROR, ("Error reading packet in round %d", m_round));
+ return 1;
+ }
+ DBUG_PRINT("info", ("Got packet of length %d", packet.len()));
+
+ /*
+ Process received data, possibly generating new data to be sent.
+ */
+
+ Blob new_data= process_data(packet);
+
+ if (error())
+ {
+ ERROR_LOG(ERROR, ("Error processing packet in round %d", m_round));
+ return 1;
+ }
+
+ /*
+ If new data has been generated, send it to the peer. Otherwise
+ handshake must be completed.
+ */
+
+ if (!new_data.is_null())
+ {
+ DBUG_PRINT("info", ("Round %d started", m_round));
+
+ DBUG_PRINT("info", ("Sending packet of length %d", new_data.len()));
+ int ret= write_packet(new_data);
+ if (ret)
+ {
+ ERROR_LOG(ERROR, ("Error writing packet in round %d", m_round));
+ return 1;
+ }
+ DBUG_PRINT("info", ("Data sent"));
+ }
+ else if (!is_complete())
+ {
+ ERROR_LOG(ERROR, ("No data to send in round %d"
+ " but handshake is not complete", m_round));
+ return 1;
+ }
+
+ /*
+ To protect against malicious clients, break handshake exchange if
+ too many rounds.
+ */
+
+ if (m_round > MAX_HANDSHAKE_ROUNDS)
+ {
+ ERROR_LOG(ERROR, ("Authentication handshake could not be completed"
+ " after %d rounds", m_round));
+ return 1;
+ }
+
+ } while(!is_complete());
+
+ ERROR_LOG(INFO, ("Handshake completed after %d rounds", m_round));
+ return 0;
+}
+
+
+#ifndef DBUG_OFF
+
+/**
+ Get name of the security package which was used in authentication.
+
+ This method should be called only after handshake was completed. It is
+ available only in debug builds.
+
+ @return Name of security package or NULL if it can not be obtained.
+*/
+
+const char* Handshake::ssp_name()
+{
+ if (!m_ssp_info && m_complete)
+ {
+ SecPkgContext_PackageInfo pinfo;
+
+ int ret= QueryContextAttributes(&m_sctx, SECPKG_ATTR_PACKAGE_INFO, &pinfo);
+
+ if (SEC_E_OK == ret)
+ {
+ m_ssp_info= pinfo.PackageInfo;
+ }
+ else
+ DBUG_PRINT("error",
+ ("Could not obtain SSP info from authentication context"
+ ", QueryContextAttributes() failed with error %X", ret));
+ }
+
+ return m_ssp_info ? m_ssp_info->Name : NULL;
+}
+
+#endif
+
+
+/**
+ Process result of @c {Initialize,Accept}SecurityContext() function.
+
+ @param[in] ret return code from @c {Initialize,Accept}SecurityContext()
+ function
+
+ This function analyses return value of Windows
+ @c {Initialize,Accept}SecurityContext() function. A call to
+ @c CompleteAuthToken() is done if requested. If authentication is complete,
+ this fact is marked in the internal state of the Handshake object.
+ If errors are detected the object is moved to error state.
+
+ @return True if error has been detected.
+*/
+
+bool Handshake::process_result(int ret)
+{
+ /*
+ First check for errors and set the m_complete flag if the result
+ indicates that handshake is complete.
+ */
+
+ switch (ret)
+ {
+ case SEC_E_OK:
+ case SEC_I_COMPLETE_NEEDED:
+ // Handshake completed
+ m_complete= true;
+ break;
+
+ case SEC_I_CONTINUE_NEEDED:
+ case SEC_I_COMPLETE_AND_CONTINUE:
+ break;
+
+ default:
+ m_error= ret;
+ return true;
+ }
+
+ m_have_sec_context= true;
+
+ /*
+ If the result indicates a need for this, complete the authentication
+ token.
+ */
+
+ switch (ret)
+ {
+ case SEC_I_COMPLETE_NEEDED:
+ case SEC_I_COMPLETE_AND_CONTINUE:
+ ret= CompleteAuthToken(&m_sctx, &m_output);
+ if (ret != 0)
+ {
+ DBUG_PRINT("error", ("CompleteAuthToken() failed with error %X", ret));
+ m_error= ret;
+ return true;
+ }
+ default:
+ break;
+ }
+
+ return false;
+}
+
+
+/** Security_buffer class implementation **********************************/
+
+
+Security_buffer::Security_buffer(const Blob &blob): m_allocated(false)
+{
+ init(blob.ptr(), blob.len());
+}
+
+
+Security_buffer::Security_buffer(): m_allocated(true)
+{
+ init(NULL, 0);
+}
+
+
+void Security_buffer::free(void)
+{
+ if (!m_allocated)
+ return;
+ if (!ptr())
+ return;
+ FreeContextBuffer(ptr());
+ m_allocated= false;
+}
diff --git a/libmysql/authentication_win/handshake.h b/libmysql/authentication_win/handshake.h
new file mode 100644
index 00000000000..5292948b583
--- /dev/null
+++ b/libmysql/authentication_win/handshake.h
@@ -0,0 +1,181 @@
+/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ 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 HANDSHAKE_H
+#define HANDSHAKE_H
+
+#include "common.h"
+
+/**
+ Name of the SSP (Security Support Provider) to be used for authentication.
+
+ We use "Negotiate" which will find the most secure SSP which can be used
+ and redirect to that SSP.
+*/
+#define SSP_NAME "Negotiate"
+
+/**
+ Maximal number of rounds in authentication handshake.
+
+ Server will interrupt authentication handshake with error if client's
+ identity can not be determined within this many rounds.
+*/
+#define MAX_HANDSHAKE_ROUNDS 50
+
+
+/// Convenience wrapper around @c SecBufferDesc.
+
+class Security_buffer: public SecBufferDesc
+{
+ SecBuffer m_buf; ///< A @c SecBuffer instance.
+
+ void init(byte *ptr, size_t len)
+ {
+ ulVersion= 0;
+ cBuffers= 1;
+ pBuffers= &m_buf;
+
+ m_buf.BufferType= SECBUFFER_TOKEN;
+ m_buf.pvBuffer= ptr;
+ m_buf.cbBuffer= len;
+ }
+
+ /// If @c false, no deallocation will be done in the destructor.
+ bool m_allocated;
+
+ public:
+
+ Security_buffer(const Blob&);
+ Security_buffer();
+
+ ~Security_buffer()
+ {
+ free();
+ }
+
+ byte* ptr() const
+ {
+ return (byte*)m_buf.pvBuffer;
+ }
+
+ size_t len() const
+ {
+ return m_buf.cbBuffer;
+ }
+
+ bool is_valid() const
+ {
+ return ptr() != NULL;
+ }
+
+ const Blob as_blob() const
+ {
+ return Blob(ptr(), len());
+ }
+
+ void free(void);
+};
+
+
+/// Common base for Handshake_{server,client}.
+
+class Handshake
+{
+public:
+
+ typedef enum {CLIENT, SERVER} side_t;
+
+ Handshake(const char *ssp, side_t side);
+ virtual ~Handshake();
+
+ int Handshake::packet_processing_loop();
+
+ bool virtual is_complete() const
+ {
+ return m_complete;
+ }
+
+ int error() const
+ {
+ return m_error;
+ }
+
+protected:
+
+ /// Security context object created during the handshake.
+ CtxtHandle m_sctx;
+
+ /// Credentials of the principal performing this handshake.
+ CredHandle m_cred;
+
+ /// Stores expiry date of the created security context.
+ TimeStamp m_expire;
+
+ /// Stores attributes of the created security context.
+ ULONG m_atts;
+
+ /**
+ Round of the handshake (starting from round 1). One round
+ consist of reading packet from the other side, processing it and
+ optionally sending a reply (see @c packet_processing_loop()).
+ */
+ unsigned int m_round;
+
+ /// If non-zero, stores error code of the last failed operation.
+ int m_error;
+
+ /// @c true when handshake is complete.
+ bool m_complete;
+
+ /// @c true when the principal credentials has been determined.
+ bool m_have_credentials;
+
+ /// @c true when the security context has been created.
+ bool m_have_sec_context;
+
+ /// Buffer for data to be send to the other side.
+ Security_buffer m_output;
+
+ bool process_result(int);
+
+ /**
+ This method is used inside @c packet_processing_loop to process
+ data packets received from the other end.
+
+ @param[IN] data data to be processed
+
+ @return A blob with data to be sent to the other end or null blob if
+ no more data needs to be exchanged.
+ */
+ virtual Blob process_data(const Blob &data) =0;
+
+ /// Read packet from the other end.
+ virtual Blob read_packet() =0;
+
+ /// Write packet to the other end.
+ virtual int write_packet(Blob &data) =0;
+
+#ifndef DBUG_OFF
+
+private:
+ SecPkgInfo *m_ssp_info;
+public:
+ const char* ssp_name();
+
+#endif
+};
+
+
+#endif
diff --git a/libmysql/authentication_win/handshake_client.cc b/libmysql/authentication_win/handshake_client.cc
new file mode 100644
index 00000000000..7e89fc92ae7
--- /dev/null
+++ b/libmysql/authentication_win/handshake_client.cc
@@ -0,0 +1,378 @@
+/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ 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 "handshake.h"
+
+#include <mysql.h> // for MYSQL structure
+
+
+/// Client-side context for authentication handshake
+
+class Handshake_client: public Handshake
+{
+ /**
+ Name of the server's service for which we authenticate.
+
+ The service name is sent by server in the initial packet. If no
+ service name is used, this member is @c NULL.
+ */
+ SEC_WCHAR *m_service_name;
+
+ /// Buffer for storing service name obtained from server.
+ SEC_WCHAR m_service_name_buf[MAX_SERVICE_NAME_LENGTH];
+
+ Connection &m_con;
+
+public:
+
+ Handshake_client(Connection &con, const char *target, size_t len);
+ ~Handshake_client();
+
+ Blob first_packet();
+ Blob process_data(const Blob&);
+
+ Blob read_packet();
+ int write_packet(Blob &data);
+};
+
+
+/**
+ Create authentication handshake context for client.
+
+ @param con connection for communication with the peer
+ @param target name of the target service with which we will authenticate
+ (can be NULL if not used)
+
+ Some security packages (like Kerberos) require providing explicit name
+ of the service with which a client wants to authenticate. The server-side
+ authentication plugin sends this name in the greeting packet
+ (see @c win_auth_handshake_{server,client}() functions).
+*/
+
+Handshake_client::Handshake_client(Connection &con,
+ const char *target, size_t len)
+: Handshake(SSP_NAME, CLIENT), m_service_name(NULL), m_con(con)
+{
+ if (!target || 0 == len)
+ return;
+
+ // Convert received UPN to internal WCHAR representation.
+
+ m_service_name= utf8_to_wchar(target, &len);
+
+ if (m_service_name)
+ DBUG_PRINT("info", ("Using target service: %S\n", m_service_name));
+ else
+ {
+ /*
+ Note: we ignore errors here - m_target will be NULL, the target name
+ will not be used and system will fall-back to NTLM authentication. But
+ we leave trace in error log.
+ */
+ ERROR_LOG(WARNING, ("Could not decode UPN sent by the server"
+ "; target service name will not be used"
+ " and Kerberos authentication will not work"));
+ }
+}
+
+
+Handshake_client::~Handshake_client()
+{
+ if (m_service_name)
+ free(m_service_name);
+}
+
+
+Blob Handshake_client::read_packet()
+{
+ /*
+ We do a fake read in the first round because first
+ packet from the server containing UPN must be read
+ before the handshake context is created and the packet
+ processing loop starts. We return an empty blob here
+ and process_data() function will ignore it.
+ */
+ if (m_round == 1)
+ return Blob();
+
+ // Otherwise we read packet from the connection.
+
+ Blob packet= m_con.read();
+ m_error= m_con.error();
+ if (!m_error && packet.is_null())
+ m_error= true; // (no specific error code assigned)
+
+ if (m_error)
+ return Blob();
+
+ DBUG_PRINT("dump", ("Got the following bytes"));
+ DBUG_DUMP("dump", packet.ptr(), packet.len());
+ return packet;
+}
+
+
+
+int Handshake_client::write_packet(Blob &data)
+{
+ /*
+ Length of the first data payload send by client authentication plugin is
+ limited to 255 bytes (because it is wrapped inside client authentication
+ packet and is length-encoded with 1 byte for the length).
+
+ If the data payload is longer than 254 bytes, then it is sent in two parts:
+ first part of length 255 will be embedded in the authentication packet,
+ second part will be sent in the following packet. Byte 255 of the first
+ part contains information about the total length of the payload. It is a
+ number of blocks of size 512 bytes which is sufficient to store the
+ combined packets.
+
+ Server's logic for reading first client's payload is as follows
+ (see Handshake_server::read_packet()):
+ 1. Read data from the authentication packet, if it is shorter than 255 bytes
+ then that is all data sent by client.
+ 2. If there is 255 bytes of data in the authentication packet, read another
+ packet and append it to the data, skipping byte 255 of the first packet
+ which can be used to allocate buffer of appropriate size.
+ */
+
+ size_t len2= 0; // length of the second part of first data payload
+ byte saved_byte; // for saving byte 255 in which data length is stored
+
+ if (m_round == 1 && data.len() > 254)
+ {
+ len2= data.len() - 254;
+ DBUG_PRINT("info", ("Splitting first packet of length %lu"
+ ", %lu bytes will be sent in a second part",
+ data.len(), len2));
+ /*
+ Store in byte 255 the number of 512b blocks that are needed to
+ keep all the data.
+ */
+ unsigned block_count= data.len()/512 + ((data.len() % 512) ? 1 : 0);
+ DBUG_ASSERT(block_count < (unsigned)0x100);
+ saved_byte= data[254];
+ data[254] = block_count;
+
+ data.trim(255);
+ }
+
+ DBUG_PRINT("dump", ("Sending the following data"));
+ DBUG_DUMP("dump", data.ptr(), data.len());
+ int ret= m_con.write(data);
+
+ if (ret)
+ return ret;
+
+ // Write second part if it is present.
+ if (len2)
+ {
+ data[254]= saved_byte;
+ Blob data2(data.ptr() + 254, len2);
+ DBUG_PRINT("info", ("Sending second part of data"));
+ DBUG_DUMP("info", data2.ptr(), data2.len());
+ ret= m_con.write(data2);
+ }
+
+ return ret;
+}
+
+
+/**
+ Process data sent by server.
+
+ @param[in] data blob with data from server
+
+ This method analyses data sent by server during authentication handshake.
+ If client should continue packet exchange, this method returns data to
+ be sent to the server next. If no more data needs to be exchanged, an
+ empty blob is returned and @c is_complete() is @c true. In case of error
+ an empty blob is returned and @c error() gives non-zero error code.
+
+ When invoked for the first time (in the first round of the handshake)
+ there is no data from the server (data blob is null) and the intial
+ packet is generated without an input.
+
+ @return Data to be sent to the server next or null blob if no more data
+ needs to be exchanged or in case of error.
+*/
+
+Blob Handshake_client::process_data(const Blob &data)
+{
+#if !defined(DBUG_OFF) && defined(WINAUTH_USE_DBUG_LIB)
+ /*
+ Code for testing the logic for sending the first client payload.
+
+ A fake data of length given by environment variable TEST_PACKET_LENGTH
+ (or default 255 bytes) is sent to the server. First 2 bytes of the
+ payload contain its total length (LSB first). The length of test data
+ is limited to 2048 bytes.
+
+ Upon receiving test data, server will check that data is correct and
+ refuse connection. If server detects data errors it will crash on
+ assertion.
+
+ This code is executed if debug flag "winauth_first_packet_test" is
+ set, e.g. using client option:
+
+ --debug="d,winauth_first_packet_test"
+
+ The same debug flag must be enabled in the server, e.g. using
+ statement:
+
+ SET GLOBAL debug= '+d,winauth_first_packet_test';
+ */
+
+ static byte test_buf[2048];
+
+ if (m_round == 1
+ && DBUG_EVALUATE_IF("winauth_first_packet_test", true, false))
+ {
+ const char *env= getenv("TEST_PACKET_LENGTH");
+ size_t len= env ? atoi(env) : 0;
+ if (!len)
+ len= 255;
+ if (len > sizeof(test_buf))
+ len= sizeof(test_buf);
+
+ // Store data length in first 2 bytes.
+ byte *ptr= test_buf;
+ *ptr++= len & 0xFF;
+ *ptr++= len >> 8;
+
+ // Fill remaining bytes with known values.
+ for (byte b= 0; ptr < test_buf + len; ++ptr, ++b)
+ *ptr= b;
+
+ return Blob(test_buf, len);
+ };
+
+#endif
+
+ Security_buffer input(data);
+ SECURITY_STATUS ret;
+
+ m_output.free();
+
+ ret= InitializeSecurityContextW(
+ &m_cred,
+ m_round == 1 ? NULL : &m_sctx, // partial context
+ m_service_name, // service name
+ ASC_REQ_ALLOCATE_MEMORY, // requested attributes
+ 0, // reserved
+ SECURITY_NETWORK_DREP, // data representation
+ m_round == 1 ? NULL : &input, // input data
+ 0, // reserved
+ &m_sctx, // context
+ &m_output, // output data
+ &m_atts, // attributes
+ &m_expire); // expire date
+
+ if (process_result(ret))
+ {
+ DBUG_PRINT("error",
+ ("InitializeSecurityContext() failed with error %X", ret));
+ return Blob();
+ }
+
+ return m_output.as_blob();
+}
+
+
+/**********************************************************************/
+
+
+/**
+ Perform authentication handshake from client side.
+
+ @param[in] vio pointer to @c MYSQL_PLUGIN_VIO instance to be used
+ for communication with the server
+ @param[in] mysql pointer to a MySQL connection for which we authenticate
+
+ After reading the initial packet from server, containing its UPN to be
+ used as service name, client starts packet exchange by sending the first
+ packet in this exchange. While handshake is not yet completed, client
+ reads packets sent by the server and process them, possibly generating new
+ data to be sent to the server.
+
+ This function reports errors.
+
+ @return 0 on success.
+*/
+
+int win_auth_handshake_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
+{
+ DBUG_ENTER("win_auth_handshake_client");
+
+ /*
+ Check if we should enable logging.
+ */
+ {
+ const char *opt= getenv("AUTHENTICATION_WIN_LOG");
+ int opt_val= opt ? atoi(opt) : 0;
+ if (opt && !opt_val)
+ {
+ if (!strncasecmp("on", opt, 2)) opt_val= 1;
+ if (!strncasecmp("yes", opt, 3)) opt_val= 1;
+ if (!strncasecmp("true", opt, 4)) opt_val= 1;
+ if (!strncasecmp("debug", opt, 5)) opt_val= 2;
+ if (!strncasecmp("dbug", opt, 4)) opt_val= 2;
+ }
+ opt_auth_win_client_log= opt_val;
+ }
+
+ ERROR_LOG(INFO, ("Authentication handshake for account %s", mysql->user));
+
+ // Create connection object.
+
+ Connection con(vio);
+ DBUG_ASSERT(!con.error());
+
+ // Read initial packet from server containing service name.
+
+ Blob service_name= con.read();
+
+ if (con.error() || service_name.is_null())
+ {
+ ERROR_LOG(ERROR, ("Error reading initial packet"));
+ DBUG_RETURN(CR_ERROR);
+ }
+ DBUG_PRINT("info", ("Got initial packet of length %d", service_name.len()));
+
+ // Create authentication handshake context using the given service name.
+
+ Handshake_client hndshk(con,
+ service_name[0] ? (char *)service_name.ptr() : NULL,
+ service_name.len());
+ if (hndshk.error())
+ {
+ ERROR_LOG(ERROR, ("Could not create authentication handshake context"));
+ DBUG_RETURN(CR_ERROR);
+ }
+
+ DBUG_ASSERT(!hndshk.error());
+
+ /*
+ Read and process packets from server until handshake is complete.
+ Note that the first read from server is dummy
+ (see Handshake_client::read_packet()) as we already have read the
+ first packet to establish service name.
+ */
+ if (hndshk.packet_processing_loop())
+ DBUG_RETURN(CR_ERROR);
+
+ DBUG_ASSERT(!hndshk.error() && hndshk.is_complete());
+
+ DBUG_RETURN(CR_OK);
+}
diff --git a/libmysql/authentication_win/log_client.cc b/libmysql/authentication_win/log_client.cc
new file mode 100644
index 00000000000..df4ce4f9c2a
--- /dev/null
+++ b/libmysql/authentication_win/log_client.cc
@@ -0,0 +1,55 @@
+/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ 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 "common.h"
+
+/**
+ This option is set in win_auth_handshake_client() function
+ in handshake_client.cc.
+
+ Values:
+ 0 - no logging
+ 1 - log error/warning/info messages
+ 2 - also log debug messages
+
+ Note: No error or debug messages are logged in production code
+ (see logging macros in common.h).
+*/
+int opt_auth_win_client_log= 0;
+
+
+// Client-side logging function
+
+void error_log_vprint(error_log_level::type level,
+ const char *fmt, va_list args)
+{
+ if (0 == opt_auth_win_client_log)
+ return;
+
+ const char *level_string= "";
+
+ switch (level)
+ {
+ case error_log_level::INFO: level_string= "Note"; break;
+ case error_log_level::WARNING: level_string= "Warning"; break;
+ case error_log_level::ERROR: level_string= "ERROR"; break;
+ }
+
+ fprintf(stderr, "Windows Authentication Plugin %s: ", level_string);
+ vfprintf(stderr, fmt, args);
+ fputc('\n', stderr);
+ fflush(stderr);
+}
diff --git a/libmysql/authentication_win/plugin_client.cc b/libmysql/authentication_win/plugin_client.cc
new file mode 100644
index 00000000000..30dc5b1493d
--- /dev/null
+++ b/libmysql/authentication_win/plugin_client.cc
@@ -0,0 +1,68 @@
+/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ 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 <mysql.h>
+#include <mysql/plugin_auth.h>
+#include <mysql/client_plugin.h>
+
+#include "common.h"
+
+/*
+ The following MS C++ specific pragma embeds a comment in the resulting
+ object file. A "lib" comment tells the linker to use the specified
+ library, thus the dependency is handled automagically.
+*/
+
+#ifdef _MSC_VER
+#pragma comment(lib, "Secur32")
+#endif
+
+static int win_auth_client_plugin_init(char*, size_t, int, va_list)
+{
+ return 0;
+}
+
+
+static int win_auth_client_plugin_deinit()
+{
+ return 0;
+}
+
+
+int win_auth_handshake_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql);
+
+
+/*
+ Client plugin declaration. This is added to mysql_client_builtins[]
+ in sql-common/client.c
+*/
+
+extern "C"
+st_mysql_client_plugin_AUTHENTICATION win_auth_client_plugin=
+{
+ MYSQL_CLIENT_AUTHENTICATION_PLUGIN,
+ MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION,
+ "authentication_windows_client",
+ "Rafal Somla",
+ "Windows Authentication Plugin - client side",
+ {0,1,0},
+ "GPL",
+ NULL,
+ win_auth_client_plugin_init,
+ win_auth_client_plugin_deinit,
+ NULL, // option handling
+ win_auth_handshake_client
+};
diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h
index 5204d03e5af..c5a08ce1fcc 100644
--- a/libmysql/client_settings.h
+++ b/libmysql/client_settings.h
@@ -35,21 +35,6 @@ sig_handler my_pipe_sig_handler(int sig);
void read_user_name(char *name);
my_bool handle_local_infile(MYSQL *mysql, const char *net_filename);
-/*
- Let the user specify that we don't want SIGPIPE; This doesn't however work
- with threaded applications as we can have multiple read in progress.
-*/
-
-#if !defined(__WIN__) && defined(SIGPIPE) && !defined(THREAD)
-#define init_sigpipe_variables sig_return old_signal_handler=(sig_return) 0;
-#define set_sigpipe(mysql) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) old_signal_handler=signal(SIGPIPE, my_pipe_sig_handler)
-#define reset_sigpipe(mysql) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) signal(SIGPIPE,old_signal_handler);
-#else
-#define init_sigpipe_variables
-#define set_sigpipe(mysql)
-#define reset_sigpipe(mysql)
-#endif
-
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);
diff --git a/libmysql/conf_to_src.c b/libmysql/conf_to_src.c
index 785e3cad4c1..f39a2e1856f 100644
--- a/libmysql/conf_to_src.c
+++ b/libmysql/conf_to_src.c
@@ -5,8 +5,7 @@
the Free Software Foundation.
There are special exceptions to the terms and conditions of the GPL as it
- is applied to this software. View the full text of the exception in file
- EXCEPTIONS-CLIENT in the directory of this software distribution.
+ is applied to this software.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c
index 823f83026c9..a2d066b1eba 100644
--- a/libmysql/errmsg.c
+++ b/libmysql/errmsg.c
@@ -5,8 +5,7 @@
the Free Software Foundation.
There are special exceptions to the terms and conditions of the GPL as it
- is applied to this software. View the full text of the exception in file
- EXCEPTIONS-CLIENT in the directory of this software distribution.
+ is applied to this software.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -52,7 +51,7 @@ const char *client_errors[]=
"Error on SHOW SLAVE HOSTS:",
"Error connecting to slave:",
"Error connecting to master:",
- "SSL connection error",
+ "SSL connection error: %-.100s",
"Malformed packet",
"This client library is licensed only for use with MySQL servers having '%s' license",
"Invalid use of null pointer",
diff --git a/libmysql/get_password.c b/libmysql/get_password.c
index 56514a8d864..455b4b3c8f1 100644
--- a/libmysql/get_password.c
+++ b/libmysql/get_password.c
@@ -5,8 +5,7 @@
the Free Software Foundation.
There are special exceptions to the terms and conditions of the GPL as it
- is applied to this software. View the full text of the exception in file
- EXCEPTIONS-CLIENT in the directory of this software distribution.
+ is applied to this software.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index f5286b8fa50..1af15c75d7f 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -5,8 +5,7 @@
the Free Software Foundation.
There are special exceptions to the terms and conditions of the GPL as it
- is applied to this software. View the full text of the exception in file
- EXCEPTIONS-CLIENT in the directory of this software distribution.
+ is applied to this software.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -52,7 +51,7 @@
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
-#if defined(THREAD) && !defined(__WIN__)
+#if !defined(__WIN__)
#include <my_pthread.h> /* because of signal() */
#endif
#ifndef INADDR_NONE
@@ -95,6 +94,11 @@ sig_handler my_pipe_sig_handler(int sig);
static my_bool mysql_client_init= 0;
static my_bool org_my_init_done= 0;
+typedef struct st_mysql_stmt_extension
+{
+ MEM_ROOT fields_mem_root;
+} MYSQL_STMT_EXT;
+
/*
Initialize the MySQL client library
@@ -173,10 +177,8 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
result= init_embedded_server(argc, argv, groups);
#endif
}
-#ifdef THREAD
else
result= (int)my_thread_init(); /* Init if new thread */
-#endif
return result;
}
@@ -230,18 +232,12 @@ MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void)
my_bool STDCALL mysql_thread_init()
{
-#ifdef THREAD
return my_thread_init();
-#else
- return 0;
-#endif
}
void STDCALL mysql_thread_end()
{
-#ifdef THREAD
my_thread_end();
-#endif
}
@@ -1106,11 +1102,7 @@ void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo)
uint STDCALL mysql_thread_safe(void)
{
-#ifdef THREAD
return 1;
-#else
- return 0;
-#endif
}
@@ -1506,11 +1498,16 @@ mysql_stmt_init(MYSQL *mysql)
MYSQL_STMT *stmt;
DBUG_ENTER("mysql_stmt_init");
- if (!(stmt= (MYSQL_STMT *) my_malloc(sizeof(MYSQL_STMT),
+ if (!(stmt=
+ (MYSQL_STMT *) my_malloc(sizeof (MYSQL_STMT),
+ MYF(MY_WME | MY_ZEROFILL))) ||
+ !(stmt->extension=
+ (MYSQL_STMT_EXT *) my_malloc(sizeof (MYSQL_STMT_EXT),
MYF(MY_WME | MY_ZEROFILL))))
{
set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate);
- DBUG_RETURN(0);
+ my_free(stmt);
+ DBUG_RETURN(NULL);
}
init_alloc_root(&stmt->mem_root, 2048, 2048);
@@ -1525,6 +1522,8 @@ mysql_stmt_init(MYSQL *mysql)
strmov(stmt->sqlstate, not_error_sqlstate);
/* The rest of statement members was bzeroed inside malloc */
+ init_alloc_root(&stmt->extension->fields_mem_root, 2048, 0);
+
DBUG_RETURN(stmt);
}
@@ -1597,6 +1596,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
stmt->bind_param_done= stmt->bind_result_done= FALSE;
stmt->param_count= stmt->field_count= 0;
free_root(&stmt->mem_root, MYF(MY_KEEP_PREALLOC));
+ free_root(&stmt->extension->fields_mem_root, MYF(0));
int4store(buff, stmt->stmt_id);
@@ -1657,21 +1657,21 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
static void alloc_stmt_fields(MYSQL_STMT *stmt)
{
MYSQL_FIELD *fields, *field, *end;
- MEM_ROOT *alloc= &stmt->mem_root;
+ MEM_ROOT *fields_mem_root= &stmt->extension->fields_mem_root;
MYSQL *mysql= stmt->mysql;
- DBUG_ASSERT(mysql->field_count);
+ DBUG_ASSERT(stmt->field_count);
- stmt->field_count= mysql->field_count;
+ free_root(fields_mem_root, MYF(0));
/*
Get the field information for non-select statements
like SHOW and DESCRIBE commands
*/
- if (!(stmt->fields= (MYSQL_FIELD *) alloc_root(alloc,
+ if (!(stmt->fields= (MYSQL_FIELD *) alloc_root(fields_mem_root,
sizeof(MYSQL_FIELD) *
stmt->field_count)) ||
- !(stmt->bind= (MYSQL_BIND *) alloc_root(alloc,
+ !(stmt->bind= (MYSQL_BIND *) alloc_root(fields_mem_root,
sizeof(MYSQL_BIND) *
stmt->field_count)))
{
@@ -1684,18 +1684,36 @@ static void alloc_stmt_fields(MYSQL_STMT *stmt)
field && fields < end; fields++, field++)
{
*field= *fields; /* To copy all numeric parts. */
- field->catalog= strmake_root(alloc, fields->catalog,
+ field->catalog= strmake_root(fields_mem_root,
+ fields->catalog,
fields->catalog_length);
- field->db= strmake_root(alloc, fields->db, fields->db_length);
- field->table= strmake_root(alloc, fields->table, fields->table_length);
- field->org_table= strmake_root(alloc, fields->org_table,
+ field->db= strmake_root(fields_mem_root,
+ fields->db,
+ fields->db_length);
+ field->table= strmake_root(fields_mem_root,
+ fields->table,
+ fields->table_length);
+ field->org_table= strmake_root(fields_mem_root,
+ fields->org_table,
fields->org_table_length);
- field->name= strmake_root(alloc, fields->name, fields->name_length);
- field->org_name= strmake_root(alloc, fields->org_name,
+ field->name= strmake_root(fields_mem_root,
+ fields->name,
+ fields->name_length);
+ field->org_name= strmake_root(fields_mem_root,
+ fields->org_name,
fields->org_name_length);
- field->def= fields->def ? strmake_root(alloc, fields->def,
- fields->def_length) : 0;
- field->def_length= field->def ? fields->def_length : 0;
+ if (fields->def)
+ {
+ field->def= strmake_root(fields_mem_root,
+ fields->def,
+ fields->def_length);
+ field->def_length= fields->def_length;
+ }
+ else
+ {
+ field->def= NULL;
+ field->def_length= 0;
+ }
field->extension= 0; /* Avoid dangling links. */
field->max_length= 0; /* max_length is set in mysql_stmt_store_result() */
}
@@ -2413,6 +2431,9 @@ static void reinit_result_set_metadata(MYSQL_STMT *stmt)
prepared statements can't send result set metadata for these queries
on prepare stage. Read it now.
*/
+
+ stmt->field_count= stmt->mysql->field_count;
+
alloc_stmt_fields(stmt);
}
else
@@ -2430,7 +2451,7 @@ static void reinit_result_set_metadata(MYSQL_STMT *stmt)
previous branch always works.
TODO: send metadata only when it's really necessary and add a warning
'Metadata changed' when it's sent twice.
- */
+ */
update_stmt_fields(stmt);
}
}
@@ -4631,6 +4652,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
free_root(&stmt->result.alloc, MYF(0));
free_root(&stmt->mem_root, MYF(0));
+ free_root(&stmt->extension->fields_mem_root, MYF(0));
if (mysql)
{
@@ -4665,6 +4687,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
}
}
+ my_free(stmt->extension);
my_free(stmt);
DBUG_RETURN(test(rc));
@@ -4831,16 +4854,13 @@ int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt)
stmt->state= MYSQL_STMT_EXECUTE_DONE;
stmt->bind_result_done= FALSE;
+ stmt->field_count= mysql->field_count;
if (mysql->field_count)
{
alloc_stmt_fields(stmt);
prepare_to_fetch_result(stmt);
}
- else
- {
- stmt->field_count= mysql->field_count;
- }
DBUG_RETURN(0);
}
diff --git a/libmysql_r/Makefile.am b/libmysql_r/Makefile.am
deleted file mode 100644
index 30aa2467dab..00000000000
--- a/libmysql_r/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright (C) 2000-2004 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of version 2 GNU General Public License as
-# published by the Free Software Foundation.
-#
-# There are special exceptions to the terms and conditions of the GPL as it
-# is applied to this software. View the full text of the exception in file
-# EXCEPTIONS-CLIENT in the directory of this software distribution.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-#
-# This file is public domain and comes with NO WARRANTY of any kind
-
-target = libmysqlclient_r.la
-target_defs = -DDISABLE_MYSQL_PRLOCK_H -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
-
-LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
- $(openssl_includes) @ZLIB_INCLUDES@
-## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include
-include $(top_srcdir)/libmysql/Makefile.shared
-
-nodist_libmysqlclient_r_la_SOURCES = $(target_sources)
-libmysqlclient_r_la_LIBADD = $(target_libadd) $(yassl_las)
-libmysqlclient_r_la_LDFLAGS = $(target_ldflags)
-
-link_sources:
- set -x; \
- for d in $(top_srcdir)/libmysql $(top_builddir)/libmysql; do \
- for f in `cd $$d && echo *.[ch]`; do \
- rm -f $$f; \
- @LN_CP_F@ $$d/$$f $$f; \
- done; \
- done
- echo timestamp > link_sources
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index 4d9785a4f35..d83c91c5ec3 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -26,7 +26,6 @@ ${CMAKE_SOURCE_DIR}/regex
${ZLIB_INCLUDE_DIR}
${SSL_INCLUDE_DIRS}
${SSL_INTERNAL_INCLUDE_DIRS}
-${NDB_CLUSTER_INCLUDES}
${CMAKE_SOURCE_DIR}/sql/backup
)
@@ -42,6 +41,7 @@ SET(SQL_EMBEDDED_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-common/client_plugin.c
../sql/password.c ../sql/discover.cc ../sql/derror.cc
../sql/field.cc ../sql/field_conv.cc
../sql/filesort.cc ../sql/gstream.cc
@@ -115,7 +115,7 @@ SET(LIBS
dbug strings regex mysys vio
${ZLIB_LIBRARY} ${SSL_LIBRARIES}
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
- ${MYSQLD_STATIC_PLUGIN_LIBS} ${NDB_CLIENT_LIBS}
+ ${MYSQLD_STATIC_PLUGIN_LIBS}
sql_embedded
)
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
deleted file mode 100644
index 98674552812..00000000000
--- a/libmysqld/Makefile.am
+++ /dev/null
@@ -1,235 +0,0 @@
-# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# 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
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(libdir)
-pkgplugindir = $(pkglibdir)/plugin
-
-EXTRA_DIST = libmysqld.def CMakeLists.txt
-DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
- -DDEFAULT_MYSQL_HOME='"$(MYSQLBASEdir)"' \
- -DMYSQL_DATADIR='"$(MYSQLDATAdir)"' \
- -DSHAREDIR='"$(MYSQLSHAREdir)"' \
- -DPLUGINDIR='"$(pkgplugindir)"'
- -DDISABLE_DTRACE \
- @DEFS@
-INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include \
- -I$(top_builddir)/sql -I$(top_srcdir)/sql \
- -I$(top_srcdir)/sql/examples \
- -I$(top_srcdir)/regex \
- $(openssl_includes) @ZLIB_INCLUDES@ \
- @condition_dependent_plugin_includes@
-
-noinst_LIBRARIES = libmysqld_int.a
-pkglib_LIBRARIES = libmysqld.a
-SUBDIRS = . examples
-libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc
-libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
- my_time.c client_plugin.c
-
-noinst_HEADERS = embedded_priv.h emb_qcache.h
-
-sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
- ha_ndbcluster.cc ha_ndbcluster_cond.cc \
- ha_ndbcluster_binlog.cc ha_partition.cc \
- handler.cc sql_handler.cc \
- hostname.cc init.cc password.c \
- item.cc item_buff.cc item_cmpfunc.cc item_create.cc \
- item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \
- item_geofunc.cc item_subselect.cc item_row.cc\
- item_xmlfunc.cc \
- sha2.cc des_key_file.cc \
- key.cc lock.cc log.cc sql_state.c \
- log_event.cc rpl_record.cc rpl_utility.cc \
- log_event_old.cc rpl_record_old.cc \
- protocol.cc net_serv.cc opt_range.cc \
- opt_subselect.cc \
- opt_sum.cc procedure.cc records.cc sql_acl.cc \
- sql_load.cc discover.cc sql_locale.cc \
- sql_profile.cc sql_admin.cc sql_truncate.cc datadict.cc \
- sql_reload.cc \
- sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \
- sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \
- sql_lex.cc sql_list.cc sql_manager.cc \
- sql_join_cache.cc \
- scheduler.cc sql_connect.cc sql_parse.cc \
- sql_prepare.cc sql_derived.cc sql_rename.cc \
- sql_select.cc sql_do.cc sql_show.cc set_var.cc sys_vars.cc \
- sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
- sql_update.cc sql_yacc.cc table.cc thr_malloc.cc sql_time.cc \
- unireg.cc uniques.cc sql_union.cc hash_filo.cc \
- spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
- sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
- parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
- rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
- debug_sync.cc sql_tablespace.cc transaction.cc \
- rpl_injector.cc my_user.c partition_info.cc sql_alter.cc \
- sql_servers.cc event_parse_data.cc sql_signal.cc \
- rpl_handler.cc mdl.cc keycaches.cc sql_audit.cc \
- sql_partition_admin.cc \
- create_options.cc opt_table_elimination.cc \
- multi_range_read.cc opt_index_cond_pushdown.cc \
- sql_expression_cache.cc
-
-libmysqld_int_a_SOURCES= $(libmysqld_sources)
-nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
-libmysqld_a_SOURCES=
-
-sqlstoragesources = $(EXTRA_libmysqld_a_SOURCES)
-storagesources = @condition_dependent_plugin_modules@
-storageobjects = @condition_dependent_plugin_objects@
-storagesourceslinks = @condition_dependent_plugin_links@
-
-# automake misses these
-sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy
-
-# The following libraries should be included in libmysqld.a
-INC_LIB= $(top_builddir)/regex/libregex.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/strings/libmystrings.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/vio/libvio.a \
- @NDB_SCI_LIBS@ \
- @mysql_plugin_libs@ \
- $(libevent_inc_libs) \
- $(yassl_inc_libs)
-
-if HAVE_YASSL
-yassl_inc_libs= $(top_builddir)/extra/yassl/src/.libs/libyassl.a \
- $(top_builddir)/extra/yassl/taocrypt/src/.libs/libtaocrypt.a
-endif
-
-# Storage engine specific compilation options
-ha_ndbcluster.o:ha_ndbcluster.cc
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-ha_ndbcluster_cond.o:ha_ndbcluster_cond.cc
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-ha_ndbcluster_binlog.o: ha_ndbcluster_binlog.cc
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-# Until we can remove dependency on ha_ndbcluster.h
-handler.o: handler.cc
- $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
-
-# We need rules to compile these as no good way
-# found to append fileslists that collected by configure
-# to the sources list
-
-ha_federatedx.o:ha_federatedx.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_heap.o:ha_heap.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_innodb.o:ha_innodb.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_myisam.o:ha_myisam.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-ha_myisammrg.o:ha_myisammrg.cc
- $(CXXCOMPILE) $(LM_CFLAGS) -c $<
-
-#
-# To make it easy for the end user to use the embedded library we
-# generate a total libmysqld.a from all library files,
-
-# note - InnoDB libraries have circular dependencies, so in INC_LIB
-# few libraries are present two times. Metrowerks linker doesn't like
-# it at all. Traditional ar has no problems with it, but still there's no
-# need to add the same file twice to the library, so 'sort -u' save us
-# some time and spares unnecessary work.
-
-libmysqld.a: libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES) $(storageobjects)
-if DARWIN_MWCC
- mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects)
-else
- -rm -f libmysqld.a
- current_dir=`pwd`; \
- rm -rf tmp; mkdir tmp; \
- (for arc in $(INC_LIB) ./libmysqld_int.a; do \
- arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \
- artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \
- for F in `$(AR) t $$arc | grep -v SYMDEF`; do \
- if test -e "$$arpath/$$F" ; then echo "$$arpath/$$F"; else \
- mkdir $$artmp; cd $$artmp > /dev/null; \
- $(AR) x ../../$$arc; \
- cd $$current_dir > /dev/null; \
- ls $$artmp/* | grep -v SYMDEF; \
- continue 2; fi; done; \
- done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a; \
- $(AR) r libmysqld.a $(storageobjects); \
- $(RANLIB) libmysqld.a ; \
- rm -rf tmp
-endif
-
-## XXX: any time the client interface changes, we'll need to bump
-## the version info for libmysqld; however, it's possible for the
-## libmysqld interface to change without affecting the standard
-## libmysqlclient interface. Should we make a separate version
-## string for the two?
-#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
-#CLEANFILES = $(libmysqld_la_LIBADD) libmysqld.la
-
-BUILT_SOURCES = link_sources
-
-CLEANFILES = $(BUILT_SOURCES)
-
-link_sources:
- for f in $(sqlsources); do \
- rm -f $$f; \
- if test -e $(top_srcdir)/sql/$$f ; \
- then \
- @LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
- else \
- @LN_CP_F@ $(top_builddir)/sql/$$f $$f; \
- fi ; \
- done; \
- for f in $(libmysqlsources); do \
- rm -f $$f; \
- if test -e $(top_srcdir)/libmysql/$$f ; \
- then \
- @LN_CP_F@ $(top_srcdir)/libmysql/$$f $$f; \
- else \
- @LN_CP_F@ $(top_builddir)/libmysql/$$f $$f; \
- fi ; \
- done; \
- if test -n "$(sqlstoragesources)" ; \
- then \
- for f in "$(sqlstoragesources)"; do \
- rm -f "$$f"; \
- @LN_CP_F@ `find $(srcdir)/../sql -name "$$f"` "$$f"; \
- done; \
- fi; \
- if test -n "$(storagesources)" ; \
- then \
- rm -f $(storagesources); \
- for f in $(storagesourceslinks); do \
- @LN_CP_F@ $(top_srcdir)/$$f . ; \
- done; \
- fi; \
- rm -f client_settings.h; \
- @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h \
- client_settings.h; \
- echo timestamp > link_sources
-
-
-clean-local:
- rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlstoragesources) $(storagesources) | sed "s;\.lo;.c;g"`; \
- rm -f client_settings.h
diff --git a/libmysqld/copyright b/libmysqld/copyright
deleted file mode 100644
index 0b4dd1725a2..00000000000
--- a/libmysqld/copyright
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright (c) 2000
- * SWsoft company
- *
- * This material is provided "as is", with absolutely no warranty expressed
- * or implied. Any use is at your own risk.
- *
- * Permission to use or copy this software for any purpose is hereby granted
- * without fee, provided the above notices are retained on all copies.
- * Permission to modify the code and to distribute modified code is granted,
- * provided the above notices are retained, and a notice that the code was
- * modified is included with the above copyright notice.
- *
- */
diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am
deleted file mode 100644
index 66c40d88e29..00000000000
--- a/libmysqld/examples/Makefile.am
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright (C) 2000 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
-
-noinst_PROGRAMS = mysql
-bin_PROGRAMS = mysqltest_embedded mysql_client_test_embedded
-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 \
- rm -f $$f; \
- @LN_CP_F@ $(top_srcdir)/client/$$f $$f; \
- done; \
- for f in $(tests_sources); do \
- rm -f $$f; \
- @LN_CP_F@ $(top_srcdir)/tests/$$f $$f; \
- done
- echo timestamp > link_sources
-
-DEFS = -DEMBEDDED_LIBRARY @DEFS@
-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) \
- @NDB_SCI_LIBS@
-
-mysqltest_embedded_LINK = $(CXXLINK)
-nodist_mysqltest_embedded_SOURCES = mysqltest.cc
-mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a \
- @MYSQLD_EXTRA_LDFLAGS@
-
-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)
-nodist_mysql_client_test_embedded_SOURCES = mysql_client_test.c
diff --git a/libmysqld/examples/test-run b/libmysqld/examples/test-run
index aea5b13eaba..1667280a986 100755
--- a/libmysqld/examples/test-run
+++ b/libmysqld/examples/test-run
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2001, 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
# This is slapped together as a quick way to run the tests and
# is not meant for prime time. Please hack at it and submit
# changes, though, so we can gradually turn it into something
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 847b1fd7ad9..2f34ea8c224 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -50,6 +50,23 @@ extern "C" void unireg_clear(int exit_code)
DBUG_VOID_RETURN;
}
+/*
+ Wrapper error handler for embedded server to call client/server error
+ handler based on whether thread is in client/server context
+*/
+
+static void embedded_error_handler(uint error, const char *str, myf MyFlags)
+{
+ DBUG_ENTER("embedded_error_handler");
+
+ /*
+ If current_thd is NULL, it means restore_global has been called and
+ thread is in client context, then call client error handler else call
+ server error handler.
+ */
+ DBUG_RETURN(current_thd ? my_message_sql(error, str, MyFlags):
+ my_message_stderr(error, str, MyFlags));
+}
/*
Reads error information from the MYSQL_DATA and puts
@@ -106,7 +123,8 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
if (mysql->status != MYSQL_STATUS_READY)
{
set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate);
- return 1;
+ result= 1;
+ goto end;
}
/* Clear result variables */
@@ -147,6 +165,9 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
#if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query();
#endif
+
+end:
+ thd->restore_globals();
return result;
}
@@ -506,11 +527,12 @@ int init_embedded_server(int argc, char **argv, char **groups)
orig_argc= *argcp;
orig_argv= *argvp;
- load_defaults("my", (const char **)groups, argcp, argvp);
+ if (load_defaults("my", (const char **)groups, argcp, argvp))
+ return 1;
defaults_argc= *argcp;
defaults_argv= *argvp;
- remaining_argc= argc;
- remaining_argv= argv;
+ remaining_argc= *argcp;
+ remaining_argv= *argvp;
/* Must be initialized early for comparison of options name */
system_charset_info= &my_charset_utf8_general_ci;
@@ -544,7 +566,10 @@ int init_embedded_server(int argc, char **argv, char **groups)
return 1;
}
- error_handler_hook = my_message_sql;
+ /*
+ set error_handler_hook to embedded_error_handler wrapper.
+ */
+ error_handler_hook= embedded_error_handler;
acl_error= 0;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -604,7 +629,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag)
thd->mysql= mysql;
mysql->server_version= server_version;
mysql->client_flag= client_flag;
- mysql->server_capabilities= client_flag;
+ //mysql->server_capabilities= client_flag;
init_alloc_root(&mysql->field_alloc, 8192, 0);
}
@@ -677,6 +702,7 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
strmake(sctx->priv_host, (char*) my_localhost, MAX_HOSTNAME-1);
strmake(sctx->priv_user, mysql->user, USERNAME_LENGTH-1);
sctx->user= my_strdup(mysql->user, MYF(0));
+ sctx->proxy_user[0]= 0;
sctx->master_access= GLOBAL_ACLS; // Full rights
/* Change database if necessary */
if (!(result= (db && db[0] && mysql_change_db(thd, &db_str, FALSE))))
@@ -715,7 +741,7 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
memset(thd->scramble, 55, SCRAMBLE_LENGTH); // dummy scramble
thd->scramble[SCRAMBLE_LENGTH]= 0;
- strcpy(mysql->scramble, thd->scramble);
+ //strcpy(mysql->scramble, thd->scramble);
if (mysql->passwd && mysql->passwd[0])
{
@@ -742,8 +768,9 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
return 0;
err:
- strmake(net->last_error, thd->stmt_da->message(), sizeof(net->last_error)-1);
- memcpy(net->sqlstate, mysql_errno_to_sqlstate(thd->stmt_da->sql_errno()),
+ strmake(net->last_error, thd->main_da.message(), sizeof(net->last_error)-1);
+ memcpy(net->sqlstate,
+ mysql_errno_to_sqlstate(thd->main_da.sql_errno()),
sizeof(net->sqlstate)-1);
return 1;
}
diff --git a/libservices/CMakeLists.txt b/libservices/CMakeLists.txt
index d4a2a9a71fb..d7897316e55 100644
--- a/libservices/CMakeLists.txt
+++ b/libservices/CMakeLists.txt
@@ -22,4 +22,4 @@ SET(MYSQLSERVICES_SOURCES
my_thread_scheduler_service.c)
ADD_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
-INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR})
+INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development)
diff --git a/libservices/Makefile.am b/libservices/Makefile.am
deleted file mode 100644
index d25c5c9680c..00000000000
--- a/libservices/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2009 Sun Microsystems, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-AM_CPPFLAGS = -I$(top_srcdir)/include
-pkglib_LIBRARIES = libmysqlservices.a
-libmysqlservices_a_SOURCES = my_snprintf_service.c thd_alloc_service.c \
- thd_wait_service.c \
- my_thread_scheduler_service.c
-EXTRA_DIST = CMakeLists.txt
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
index 7c96deada08..135d66634e4 100644
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -21,8 +21,10 @@ IF(MAN1_FILES)
IF(MAN1_EXCLUDE)
LIST(REMOVE_ITEM MAN1_FILES ${MAN1_EXCLUDE})
ENDIF()
- INSTALL(FILES ${MAN1_FILES} DESTINATION ${INSTALL_MANDIR}/man1)
+ INSTALL(FILES ${MAN1_FILES} DESTINATION ${INSTALL_MANDIR}/man1
+ COMPONENT ManPages)
ENDIF()
IF(MAN8_FILES)
- INSTALL(FILES ${MAN8_FILES} DESTINATION ${INSTALL_MANDIR}/man8)
+ INSTALL(FILES ${MAN8_FILES} DESTINATION ${INSTALL_MANDIR}/man8
+ COMPONENT ManPages)
ENDIF()
diff --git a/man/Makefile.am b/man/Makefile.am
deleted file mode 100644
index 027edccc249..00000000000
--- a/man/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2000-2001, 2003-2006 MySQL AB
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-## Process this file with automake to create Makefile.in
-
-man1_MANS = @man1_files@
-man8_MANS = @man8_files@
-EXTRA_DIST = $(man1_MANS) $(man8_MANS) CMakeLists.txt
-
-# "make_win_*" are not needed in Unix binary packages,
-install-data-hook:
- rm -f $(DESTDIR)$(mandir)/man1/make_win_*
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt
index 3c38e5772d0..f18b2ae341c 100644
--- a/mysql-test/CMakeLists.txt
+++ b/mysql-test/CMakeLists.txt
@@ -53,7 +53,8 @@ IF(UNIX)
IF(INSTALL_MYSQLTESTDIR)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mtr
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run
- DESTINATION ${INSTALL_MYSQLTESTDIR})
+ DESTINATION ${INSTALL_MYSQLTESTDIR}
+ COMPONENT Test)
ENDIF()
ENDIF()
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
deleted file mode 100644
index 76fb4515865..00000000000
--- a/mysql-test/Makefile.am
+++ /dev/null
@@ -1,157 +0,0 @@
-# Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-## Process this file with automake to create Makefile.in
-
-testroot = $(prefix)
-testdir = $(testroot)/mysql-test
-
-test_SCRIPTS = mtr \
- mysql-test-run \
- mysql-test-run.pl \
- mysql-stress-test.pl
-
-nobase_test_DATA = \
- valgrind.supp \
- lib/v1/mysql-test-run.pl \
- lib/v1/mtr_cases.pl \
- lib/v1/mtr_io.pl \
- lib/v1/mtr_report.pl \
- lib/v1/My/Config.pm \
- lib/v1/mtr_gcov.pl \
- lib/v1/mtr_match.pl \
- lib/v1/mtr_stress.pl \
- lib/v1/ndb_config_1_node.ini \
- lib/v1/ndb_config_2_node.ini \
- lib/v1/mtr_gprof.pl \
- lib/v1/mtr_misc.pl \
- lib/v1/mtr_timer.pl \
- lib/v1/mtr_im.pl \
- lib/v1/mtr_process.pl \
- lib/v1/mtr_unique.pl \
- lib/mtr_cases.pm \
- lib/mtr_gcov.pl \
- lib/mtr_gprof.pl \
- lib/mtr_io.pl \
- lib/mtr_match.pm \
- lib/mtr_misc.pl \
- lib/mtr_process.pl \
- lib/mtr_report.pm \
- lib/mtr_stress.pl \
- lib/mtr_unique.pm \
- lib/My/ConfigFactory.pm \
- lib/My/Config.pm \
- lib/My/Find.pm \
- lib/My/Handles.pm \
- lib/My/Options.pm \
- lib/My/Test.pm \
- lib/My/Platform.pm \
- lib/My/SafeProcess.pm \
- lib/My/File/Path.pm \
- lib/My/SysInfo.pm \
- lib/My/Suite.pm \
- lib/My/CoreDump.pm \
- lib/My/SafeProcess/Base.pm \
- lib/My/SafeProcess/safe_process.pl
-
-SUBDIRS = lib/My/SafeProcess
-
-EXTRA_DIST = README README.suites \
- $(test_SCRIPTS) \
- $(nobase_test_DATA) \
- CMakeLists.txt \
- mtr.out-of-source
-
-
-# List of directories containing test + result files and the
-# related test data files that should be copied
-# If you want to add a new suite, please check DEFAULT_SUITES in
-# mysql-test-run.pl.
-TEST_DIRS = t r include std_data std_data/parts collections \
- std_data/ndb_backup50 std_data/ndb_backup51 \
- std_data/ndb_backup51_data_be std_data/ndb_backup51_data_le \
- std_data/funcs_1 \
- extra/binlog_tests/ extra/rpl_tests \
- suite/binlog suite/binlog/t suite/binlog/r suite/binlog/std_data \
- suite/bugs suite/bugs/data suite/bugs/t suite/bugs/r \
- suite/federated \
- suite/pbxt/t suite/pbxt/r suite/pbxt \
- suite/vcol suite/vcol/t suite/vcol/r suite/vcol/inc \
- suite/oqgraph suite/oqgraph/t suite/oqgraph/r suite/oqgraph/include \
- suite/percona suite/sphinx \
- suite/funcs_1 suite/funcs_1/bitdata \
- suite/funcs_1/include suite/funcs_1/lib suite/funcs_1/r \
- suite/funcs_1/t suite/funcs_1/views suite/funcs_1/cursors \
- suite/funcs_1/datadict suite/funcs_1/storedproc suite/funcs_1/triggers \
- suite/funcs_2 suite/funcs_2/charset suite/funcs_2/data \
- suite/funcs_2/include suite/funcs_2/lib suite/funcs_2/r \
- suite/funcs_2/t \
- suite/jp suite/jp/t suite/jp/r suite/jp/std_data suite/jp/include \
- suite/manual/t suite/manual/r \
- suite/ndb_team suite/ndb_team/t suite/ndb_team/r \
- suite/rpl suite/rpl/include suite/rpl/r \
- suite/rpl/t suite/maria/t suite/maria/r \
- suite/rpl suite/rpl/include suite/rpl/r \
- suite/rpl/t \
- suite/stress/include suite/stress/t suite/stress/r \
- suite/ndb suite/ndb/t suite/ndb/r \
- suite/rpl_ndb suite/rpl_ndb/t suite/rpl_ndb/r \
- suite/parts suite/parts/t suite/parts/r suite/parts/inc \
- suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \
- suite/engines suite/engines/funcs suite/engines/iuds suite/engines/rr_trx \
- suite/engines/funcs/r suite/engines/funcs/t suite/engines/iuds/r \
- suite/engines/iuds/t suite/engines/rr_trx/include suite/engines/rr_trx/r \
- suite/engines/rr_trx/t \
- suite/sys_vars suite/sys_vars/t suite/sys_vars/inc suite/sys_vars/r \
- suite/perfschema suite/perfschema/t suite/perfschema/r \
- suite/perfschema/include
-
-# Used by dist-hook and install-data-local to copy all
-# test files into either dist or install directory
-install_test_files:
- @if test -z "$(INSTALL_TO_DIR)"; then \
- echo "Set INSTALL_TO_DIR!" && exit 1; \
- fi
- @for dir in $(TEST_DIRS); do \
- from_dir="$(srcdir)/$$dir"; \
- to_dir="$(INSTALL_TO_DIR)/$$dir"; \
- $(mkinstalldirs) "$$to_dir"; \
- for f in `(cd $$from_dir && ls)`; do \
- if test -f "$$from_dir/$$f"; then \
- $(INSTALL_DATA) "$$from_dir/$$f" "$$to_dir/$$f" ; \
- fi; \
- done \
- done
-
-dist-hook:
- $(MAKE) INSTALL_TO_DIR="$(distdir)" install_test_files
-
-install-data-local:
- $(MAKE) INSTALL_TO_DIR="$(DESTDIR)$(testdir)" install_test_files
-
-uninstall-local:
- @RM@ -f -r $(DESTDIR)$(testdir)
-
-# mtr - a shortcut for executing mysql-test-run.pl
-mtr:
- $(RM) -f mtr
- $(LN_S) mysql-test-run.pl mtr
-
-# mysql-test-run - a shortcut for executing mysql-test-run.pl
-mysql-test-run:
- $(RM) -f mysql-test-run
- $(LN_S) mysql-test-run.pl mysql-test-run
diff --git a/mysql-test/collections/README.experimental b/mysql-test/collections/README.experimental
index 2f5ee7b00ab..924e062b76a 100644
--- a/mysql-test/collections/README.experimental
+++ b/mysql-test/collections/README.experimental
@@ -15,9 +15,13 @@ The syntax is as follows:
and any subsequent characters are ignored.
4) The full test case name including the suite and execution mode
- must be specified, for example:
+ may be specified, for example:
main.alias 'row' # bug#00000
+4b) Now, combinations will also be covered if only the test name is
+ specified, for example:
+ rpl.rpl_ps # Covers 'row', 'mix' and 'stmt'
+
5) As an exception to item 4, the last character of the test case
specification may be an asterisk (*). In that case, all test cases that
start with the same characters up to the last letter before the asterisk
diff --git a/mysql-test/collections/default.daily b/mysql-test/collections/default.daily
index 81dffff91ce..e8b15acb34d 100644
--- a/mysql-test/collections/default.daily
+++ b/mysql-test/collections/default.daily
@@ -1,5 +1,15 @@
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog --skip-ndb
+
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features --skip-test-list=collections/disabled-daily.list --unit-tests
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-daily.list
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=row --vardir=var-row --mysqld=--binlog-format=row --skip-test-list=collections/disabled-daily.list
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --mysqld=--binlog-format=row --ps-protocol --skip-test-list=collections/disabled-daily.list
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded --skip-test-list=collections/disabled-daily.list
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --ps-protocol --skip-test-list=collections/disabled-daily.list
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --skip-test-list=collections/disabled-daily.list
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_funcs1 --vardir=var-ps_funcs_1 --suite=funcs_1 --ps-protocol --skip-test-list=collections/disabled-daily.list
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2 --skip-test-list=collections/disabled-daily.list
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts --skip-test-list=collections/disabled-daily.list
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress --skip-test-list=collections/disabled-daily.list
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp --skip-test-list=collections/disabled-daily.list
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist --skip-test-list=collections/disabled-daily.list
+perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist+ps --vardir=var-ps_nist --suite=nist --ps-protocol
diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental
index 059d9c7c3c2..6ef1a377b6c 100644
--- a/mysql-test/collections/default.experimental
+++ b/mysql-test/collections/default.experimental
@@ -4,94 +4,25 @@
binlog.binlog_multi_engine # joro : NDB tests marked as experimental as agreed with bochklin
funcs_1.charset_collation_1 # depends on compile-time decisions
-funcs_1.myisam_views @solaris # Bug#50595 2010-03-05 alik funcs_1.myisam_views takes longer time on 6.0 branch than 5.1 branch
-innodb.innodb_information_schema # Bug#48883 2010-05-11 alik Test "innodb_information_schema" takes fewer locks than expected
+main.func_math @freebsd # Bug#11751977 2010-05-04 alik main.func_math fails on FreeBSD in PB2
+main.lock_multi_bug38499 # Bug#11755645 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
+main.outfile_loaddata @solaris # Bug#11755168 2010-01-20 alik Test "outfile_loaddata" fails (reproducible)
+main.signal_demo3 @solaris # Bug#11755949 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
+main.sp @solaris # Bug#11755949 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
+main.wait_timeout @solaris # Bug#11758972 2010-04-26 alik wait_timeout fails on OpenSolaris
-main.func_math @freebsd # Bug#43020 2010-05-04 alik main.func_math fails on FreeBSD in PB2
-main.gis-rtree @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server
-main.information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically
-main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically
-main.lock_multi_bug38691 @solaris # Bug#47792 2009-10-02 alik main.lock_multi_bug38691 times out sporadically on Solaris 10
-main.log_tables # Bug#47924 2009-10-08 alik main.log_tables times out sporadically
-main.lowercase_table2 @darwin # Bug#55509 2010-07-26 alik main.lowercase_table2 fails on Mac OSX (again)
-main.mysqlbinlog_row @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max
-main.mysqlbinlog_row_innodb @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max
-main.mysqlbinlog_row_myisam @solaris # Bug#52202 2010-03-22 alik mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64 debug_max
-main.outfile_loaddata @solaris # Bug#46895 2010-01-20 alik Test "outfile_loaddata" fails (reproducible)
-main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
-main.sp @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
-main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server
-main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeout fails on OpenSolaris
+rpl.rpl_innodb_bug28430 # Bug#11754425
+rpl.rpl_bug37426 # WL#5867: skozlov: test case moved from unused bugs suite
+rpl.rpl_heartbeat_basic # BUG#12403008 2011-04-27 sven fails sporadically
+rpl.rpl_show_slave_hosts # BUG#12416700 2011-05-02 sven fails sporadically
-parts.partition_alter4_innodb # Bug#45299 2010-06-28 alik Test "partition_alter4_innodb" is taking too long, timeout
-
-rpl.rpl_heartbeat_basic # BUG#54820 2010-06-26 alik rpl.rpl_heartbeat_basic fails sporadically again
-rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically
-rpl.rpl_innodb_bug28430* # Bug#46029
-rpl.rpl_innodb_bug30888* @solaris # Bug#47646 2009-09-25 alik rpl.rpl_innodb_bug30888 fails sporadically on Solaris
-rpl.rpl_killed_ddl @windows # Bug#47638 2010-01-20 alik The rpl_killed_ddl test fails on Windows
-rpl.rpl_row_sp011* @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
-
-sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
-sys_vars.slow_query_log_func @solaris # Bug#54819 2010-06-26 alik sys_vars.slow_query_log_func fails sporadically on Solaris 10
-sys_vars.wait_timeout_func # Bug#41255 2010-04-26 alik wait_timeout_func fails
-
-# Declare all NDB-tests in ndb and rpl_ndb test suites experimental.
-# Usually the test cases from ndb and rpl_ndb test suites are not run in PB,
-# but they run by gcov.
-#
-
-ndb.*
-rpl_ndb.*
-rpl_ndb.rpl_ndb_log # Bug#38998
-
-# Declare all NDB-tests in other test suites experimental.
-
-stress.ddl_ndb
+sys_vars.max_sp_recursion_depth_func @solaris # Bug#11755949 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
+sys_vars.wait_timeout_func # Bug#11750645 2010-04-26 alik wait_timeout_func fails
+# BUG #59055 : All ndb tests should be removed from the repository
+# Leaving the sys_vars tests for now. sys_vars.all_vars.test fails on removing ndb tests
sys_vars.ndb_log_update_as_write_basic
sys_vars.have_ndbcluster_basic
sys_vars.ndb_log_updated_only_basic
-
-funcs_1.ndb_storedproc_10
-funcs_1.ndb_bitdata
-funcs_1.ndb_trig_03
-funcs_1.ndb_trig_0102
-funcs_1.is_tables_ndb
-funcs_1.is_columns_ndb
-funcs_1.ndb_trig_0407
-funcs_1.ndb_trig_1011ext
-funcs_1.ndb_storedproc_06
-funcs_1.ndb_views
-funcs_1.is_cml_ndb
-funcs_1.ndb_storedproc_02
-funcs_1.ndb_storedproc_03
-funcs_1.ndb_trig_03e
-funcs_1.is_engines_ndb
-funcs_1.ndb_trig_08
-funcs_1.ndb_storedproc_07
-funcs_1.ndb_storedproc_08
-funcs_1.ndb_func_view
-funcs_1.ndb_trig_09
-funcs_1.ndb_cursors
-
-funcs_2.ndb_charset
-
-parts.ndb_dd_backuprestore # joro : NDB tests marked as experimental as agreed with bochklin
-parts.part_supported_sql_func_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-parts.partition_alter1_1_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-parts.partition_alter1_1_2_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-parts.partition_alter1_2_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-parts.partition_auto_increment_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-parts.partition_basic_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-parts.partition_engine_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-parts.partition_int_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-parts.partition_mgm_lc0_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-parts.partition_mgm_lc1_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-parts.partition_mgm_lc2_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-parts.partition_syntax_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-parts.partition_value_ndb # joro : NDB tests marked as experimental as agreed with bochklin
-main.mysqlhotcopy_myisam # horst: due to bug#54129
-main.mysqlhotcopy_archive # horst: due to bug#54129
-main.type_newdecimal # svoj: due to BUG#38965
+sys_vars.rpl_init_slave_func # Bug#12535301 2011-05-09 andrei sys_vars.rpl_init_slave_func mismatches in daily-5.5
diff --git a/mysql-test/collections/default.push b/mysql-test/collections/default.push
index a213706498e..c8402aecd75 100644
--- a/mysql-test/collections/default.push
+++ b/mysql-test/collections/default.push
@@ -1,4 +1,4 @@
-perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list
+perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list --unit-tests
perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list
perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental --skip-ndb
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list
diff --git a/mysql-test/collections/default.release b/mysql-test/collections/default.release
new file mode 100644
index 00000000000..108e1032ca2
--- /dev/null
+++ b/mysql-test/collections/default.release
@@ -0,0 +1,11 @@
+perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=debug --vardir=var-debug --skip-ndbcluster --skip-rpl --report-features --debug-server
+perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --skip-ndbcluster --report-features
+perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --skip-ndbcluster --ps-protocol
+perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs1+ps --vardir=var-funcs_1_ps --suite=funcs_1 --ps-protocol
+perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2
+perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts
+perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress
+perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp
+perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded-server --skip-rpl --skip-ndbcluster
+perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist
+perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist+ps --vardir=var-nist_ps --suite=nist --ps-protocol
diff --git a/mysql-test/collections/default.weekly b/mysql-test/collections/default.weekly
index 452a79eacbd..40f0548f374 100644..100755
--- a/mysql-test/collections/default.weekly
+++ b/mysql-test/collections/default.weekly
@@ -1 +1,7 @@
-perl mysql-test-run.pl --timer --force --comment=1st --experimental=collections/default.experimental 1st
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_2_innodb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb funcs_1.myisam_views-big --skip-test-list=collections/disabled-weekly.list
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --skip-test-list=collections/disabled-weekly.list
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row --skip-test-list=collections/disabled-weekly.list
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-weekly.list
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --skip-test-list=collections/disabled-weekly.list
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row --skip-test-list=collections/disabled-weekly.list
+perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-weekly.list
diff --git a/mysql-test/collections/disabled-daily.list b/mysql-test/collections/disabled-daily.list
new file mode 100644
index 00000000000..6edb3d1d0b3
--- /dev/null
+++ b/mysql-test/collections/disabled-daily.list
@@ -0,0 +1,9 @@
+rpl.rpl_semi_sync_event : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+rpl.rpl_semi_sync : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.rpl_semi_sync_master_enabled_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.rpl_semi_sync_master_timeout_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.rpl_semi_sync_master_trace_level_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.rpl_semi_sync_master_wait_no_slave_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.rpl_semi_sync_slave_enabled_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.rpl_semi_sync_slave_trace_level_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.all_vars : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
diff --git a/mysql-test/collections/disabled-weekly.list b/mysql-test/collections/disabled-weekly.list
new file mode 100644
index 00000000000..6edb3d1d0b3
--- /dev/null
+++ b/mysql-test/collections/disabled-weekly.list
@@ -0,0 +1,9 @@
+rpl.rpl_semi_sync_event : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+rpl.rpl_semi_sync : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.rpl_semi_sync_master_enabled_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.rpl_semi_sync_master_timeout_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.rpl_semi_sync_master_trace_level_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.rpl_semi_sync_master_wait_no_slave_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.rpl_semi_sync_slave_enabled_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.rpl_semi_sync_slave_trace_level_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
+sys_vars.all_vars : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed.
diff --git a/mysql-test/collections/mysql-next-mr.push b/mysql-test/collections/mysql-next-mr.push
deleted file mode 100644
index b87cc4b801f..00000000000
--- a/mysql-test/collections/mysql-next-mr.push
+++ /dev/null
@@ -1,5 +0,0 @@
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema --skip-test-list=collections/disabled-per-push.list
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema --skip-test-list=collections/disabled-per-push.list
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog --skip-test-list=collections/disabled-per-push.list
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1
diff --git a/mysql-test/collections/mysql-trunk.push b/mysql-test/collections/mysql-trunk.push
deleted file mode 100644
index b87cc4b801f..00000000000
--- a/mysql-test/collections/mysql-trunk.push
+++ /dev/null
@@ -1,5 +0,0 @@
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema --skip-test-list=collections/disabled-per-push.list
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema --skip-test-list=collections/disabled-per-push.list
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog --skip-test-list=collections/disabled-per-push.list
-perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1
diff --git a/mysql-test/collections/test-bt b/mysql-test/collections/test-bt
deleted file mode 100644
index 3127e2aecb9..00000000000
--- a/mysql-test/collections/test-bt
+++ /dev/null
@@ -1,10 +0,0 @@
-perl mysql-test-run.pl --force --timer --comment=normal --skip-ndbcluster --report-features --experimental=collections/default.experimental
-perl mysql-test-run.pl --force --timer --comment=ps --skip-ndbcluster --ps-protocol --experimental=collections/default.experimental
-perl mysql-test-run.pl --force --timer --comment=funcs1+ps --suite=funcs_1 --ps-protocol --experimental=collections/default.experimental
-perl mysql-test-run.pl --force --timer --comment=funcs2 --suite=funcs_2 --experimental=collections/default.experimental
-perl mysql-test-run.pl --force --timer --comment=partitions --suite=parts --experimental=collections/default.experimental
-perl mysql-test-run.pl --force --timer --comment=stress --suite=stress --experimental=collections/default.experimental
-perl mysql-test-run.pl --force --timer --comment=jp --suite=jp --experimental=collections/default.experimental
-perl mysql-test-run.pl --force --timer --comment=embedded --embedded-server --skip-rpl --skip-ndbcluster --experimental=collections/default.experimental
-perl mysql-test-run.pl --force --timer --comment=nist --suite=nist --experimental=collections/default.experimental
-perl mysql-test-run.pl --force --timer --comment=nist+ps --suite=nist --ps-protocol --experimental=collections/default.experimental
diff --git a/mysql-test/collections/test-bt-debug b/mysql-test/collections/test-bt-debug
deleted file mode 100644
index aec3d9fbef5..00000000000
--- a/mysql-test/collections/test-bt-debug
+++ /dev/null
@@ -1 +0,0 @@
-perl mysql-test-run.pl --force --timer --comment=debug --skip-ndbcluster --skip-rpl --report-features --experimental=collections/default.experimental
diff --git a/mysql-test/collections/test-bt-fast b/mysql-test/collections/test-bt-fast
deleted file mode 100644
index c3ded443518..00000000000
--- a/mysql-test/collections/test-bt-fast
+++ /dev/null
@@ -1,2 +0,0 @@
-perl mysql-test-run.pl --force --timer --comment=ps --skip-ndbcluster --ps-protocol --report-features --experimental=collections/default.experimental
-perl mysql-test-run.pl --force --timer --comment=stress --suite=stress --experimental=collections/default.experimental
diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test
index 900e46ff90a..c0a8c3f6120 100644
--- a/mysql-test/extra/binlog_tests/binlog.test
+++ b/mysql-test/extra/binlog_tests/binlog.test
@@ -304,5 +304,59 @@ BINLOG '
SHOW BINLOG EVENTS;
DROP TABLE t1;
+
+--echo
+--echo # BUG#54903 BINLOG statement toggles session variables
+--echo # ----------------------------------------------------------------------
+--echo # This test verify that BINLOG statement doesn't change current session's
+--echo # variables foreign_key_checks and unique_checks.
+--echo
+CREATE TABLE t1 (c1 INT KEY);
+
+SET @@SESSION.foreign_key_checks= ON;
+SET @@SESSION.unique_checks= ON;
+
+--echo # INSERT INTO t1 VALUES (1)
+--echo # foreign_key_checks=0 and unique_checks=0
+BINLOG '
+dfLtTBMBAAAAKQAAANcAAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA==
+';
+
+SELECT * FROM t1;
+--echo # Their values should be ON
+SHOW SESSION VARIABLES LIKE "%_checks";
+
+--echo
+SET @@SESSION.foreign_key_checks= OFF;
+SET @@SESSION.unique_checks= OFF;
+
+--echo # INSERT INTO t1 VALUES(2)
+--echo # foreign_key_checks=1 and unique_checks=1
+BINLOG '
+dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
+';
+
+SELECT * FROM t1;
+--echo # Their values should be OFF
+SHOW SESSION VARIABLES LIKE "%_checks";
+
+--echo # INSERT INTO t1 VALUES(2)
+--echo # foreign_key_checks=1 and unique_checks=1
+--echo # It should not change current session's variables, even error happens
+call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062");
+--error 1062
+BINLOG '
+dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
+';
+
+SELECT * FROM t1;
+--echo # Their values should be OFF
+SHOW SESSION VARIABLES LIKE "%_checks";
+
+DROP TABLE t1;
+
disconnect fresh;
diff --git a/mysql-test/extra/binlog_tests/binlog_cache_stat.test b/mysql-test/extra/binlog_tests/binlog_cache_stat.test
new file mode 100644
index 00000000000..a602b098201
--- /dev/null
+++ b/mysql-test/extra/binlog_tests/binlog_cache_stat.test
@@ -0,0 +1,251 @@
+# Embedded server doesn't support binlog
+-- source include/not_embedded.inc
+-- source include/have_innodb.inc
+
+# Creating tables
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+
+#
+# This test checks binlog_cache_use and binlog_cache_disk_use when
+# transactions are committed and after when they are aborted.
+#
+
+#
+# Checking commit.
+#
+--echo **** Preparing the enviroment to check commit and its effect on status variables.
+--echo **** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+let $exp_cache= 0;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 0;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 0;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Transactional changes which are long enough so they will be flushed to disk...
+--echo **** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+let $1=2000;
+disable_query_log;
+begin;
+while ($1)
+{
+ eval insert into t1 values( $1 );
+ dec $1;
+}
+commit;
+enable_query_log;
+let $exp_cache= 1;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 0;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Transactional changes which should not be flushed to disk and so should not
+--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+commit;
+let $exp_cache= 2;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 0;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Non-Transactional changes which should not be flushed to disk and so should not
+--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+commit;
+let $exp_cache= 2;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 1;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Mixed changes which should not be flushed to disk and so should not
+--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+--echo **** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+commit;
+let $exp_cache= 3;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 2;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+#
+# Checking abort.
+#
+--echo **** Preparing the enviroment to check abort and its effect on the status variables.
+--echo **** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+let $exp_cache= 0;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 0;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 0;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Transactional changes which are long enough so they will be flushed to disk...
+--echo **** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+let $1=2000;
+disable_query_log;
+begin;
+while ($1)
+{
+ eval insert into t1 values( $1 );
+ dec $1;
+}
+rollback;
+enable_query_log;
+let $exp_cache= 1;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 0;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Transactional changes which should not be flushed to disk and so should not
+--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+rollback;
+let $exp_cache= 2;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 0;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Non-Transactional changes which should not be flushed to disk and so should not
+--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+--echo **** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+rollback;
+let $exp_cache= 2;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 1;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+
+--echo **** Mixed changes which should not be flushed to disk and so should not
+--echo **** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+--echo **** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+--echo **** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+rollback;
+let $exp_cache= 3;
+let $got_cache= query_get_value(show status like "binlog_cache_use", Value, 1);
+let $exp_disk= 1;
+let $got_disk= query_get_value(show status like "binlog_cache_disk_use", Value, 1);
+let $exp_stmt_cache= 2;
+let $got_stmt_cache= query_get_value(show status like "binlog_stmt_cache_use", Value, 1);
+let $exp_stmt_disk= 0;
+let $got_stmt_disk= query_get_value(show status like "binlog_stmt_cache_disk_use", Value, 1);
+if (`SELECT $got_cache <> $exp_cache || $got_disk <> $exp_disk || $got_stmt_cache <> $exp_stmt_cache || $got_stmt_disk <> $exp_stmt_disk`)
+{
+ -- echo "Expected: binlog_cache_use = $exp_cache, binlog_cache_disk_use = $exp_disk but got binlog_cache_use = $got_cache, binlog_cache_disk_use = $got_disk"
+ -- echo "Expected: binlog_stmt_cache_use = $exp_stmt_cache, binlog_stmt_cache_disk_use = $exp_stmt_disk but got binlog_stmt_cache_use = $got_stmt_cache, binlog_stmt_cache_disk_use = $got_stmt_disk"
+ -- die
+}
+drop table t1, t2;
diff --git a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test
index 2526b2dd149..7b31a3ebf17 100644
--- a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test
+++ b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test
@@ -34,11 +34,11 @@ create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
let $table=t1;
let $count=0;
-insert delayed into t1 values (207);
+insert /* before delayed */ delayed /* after delayed */ into t1 values (207);
inc $count;
--source include/wait_until_rows_count.inc
-insert delayed into t1 values (null);
+insert /*! delayed */ into t1 values (null);
inc $count;
--source include/wait_until_rows_count.inc
diff --git a/mysql-test/extra/binlog_tests/binlog_truncate.test b/mysql-test/extra/binlog_tests/binlog_truncate.test
index 24cf363f780..d434f792db0 100644
--- a/mysql-test/extra/binlog_tests/binlog_truncate.test
+++ b/mysql-test/extra/binlog_tests/binlog_truncate.test
@@ -12,13 +12,13 @@ eval CREATE TABLE t1 (a INT) ENGINE=$engine;
eval CREATE TABLE t2 (a INT) ENGINE=$engine;
INSERT INTO t2 VALUES (1),(2),(3);
let $binlog_start = query_get_value("SHOW MASTER STATUS", Position, 1);
-if (`select length('$before_truncate') > 0`) {
+if ($before_truncate) {
eval $before_truncate;
}
--echo **** Truncate of empty table shall be logged
TRUNCATE TABLE t1;
-if (`select length('$before_truncate') > 0`) {
+if ($before_truncate) {
eval $before_truncate;
}
TRUNCATE TABLE t2;
@@ -35,7 +35,7 @@ eval CREATE TABLE t2 (a INT) ENGINE=$engine;
INSERT INTO t1 VALUES (1),(2);
let $binlog_start = query_get_value("SHOW MASTER STATUS", Position, 1);
-if (`select length('$before_truncate') > 0`) {
+if ($before_truncate) {
eval $before_truncate;
}
diff --git a/mysql-test/extra/binlog_tests/blackhole.test b/mysql-test/extra/binlog_tests/blackhole.test
index c694c34622f..90146d41471 100644
--- a/mysql-test/extra/binlog_tests/blackhole.test
+++ b/mysql-test/extra/binlog_tests/blackhole.test
@@ -173,7 +173,7 @@ insert into t1 values(2);
rollback;
let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1);
-if (`SELECT $master_log_pos_2 <> $master_log_pos_1`)
+if ($master_log_pos_2 != $master_log_pos_1)
{
echo $master_log_pos_1 $master_log_pos_2;
die Rollbacked transaction has been binlogged;
diff --git a/mysql-test/extra/binlog_tests/database.test b/mysql-test/extra/binlog_tests/database.test
index 326ecedb60e..d071415bf65 100644
--- a/mysql-test/extra/binlog_tests/database.test
+++ b/mysql-test/extra/binlog_tests/database.test
@@ -30,3 +30,30 @@ drop table tt1, t1;
source include/show_binlog_events.inc;
FLUSH STATUS;
+
+
+--echo #
+--echo # Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT
+--echo # BASED REPLICATION
+--echo #
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+DROP TABLE IF EXISTS t3;
+--enable_warnings
+
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (a INT);
+CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb;
+CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b))
+ engine=innodb;
+RESET MASTER;
+
+--error ER_ROW_IS_REFERENCED
+DROP DATABASE db1; # Fails because of the fk
+SHOW TABLES FROM db1; # t1 was dropped, t2 remains
+--source include/show_binlog_events.inc # Check that the binlog drops t1
+
+# Cleanup
+DROP TABLE t3;
+DROP DATABASE db1;
diff --git a/mysql-test/extra/binlog_tests/implicit.test b/mysql-test/extra/binlog_tests/implicit.test
index 84d80288d36..de906fc0605 100644
--- a/mysql-test/extra/binlog_tests/implicit.test
+++ b/mysql-test/extra/binlog_tests/implicit.test
@@ -6,7 +6,7 @@ INSERT INTO t1 VALUES (1);
source include/show_binlog_events.inc;
eval $statement;
source include/show_binlog_events.inc;
-if (`select '$cleanup' != ''`) {
+if ($cleanup) {
eval $cleanup;
}
@@ -22,7 +22,7 @@ INSERT INTO t1 VALUES (3);
source include/show_binlog_events.inc;
COMMIT;
source include/show_binlog_events.inc;
-if (`select '$cleanup' != ''`) {
+if ($cleanup) {
eval $cleanup;
}
diff --git a/mysql-test/extra/binlog_tests/innodb_stat.test b/mysql-test/extra/binlog_tests/innodb_stat.test
deleted file mode 100644
index b31e99dfe71..00000000000
--- a/mysql-test/extra/binlog_tests/innodb_stat.test
+++ /dev/null
@@ -1,41 +0,0 @@
-# Embedded server doesn't support binlog
--- source include/not_embedded.inc
--- source include/have_innodb.inc
-
-#
-# 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";
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-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;
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 6bf9a27afaf..040da1959dc 100644
--- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
+++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test
@@ -319,7 +319,7 @@ if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
{
--let $binlog_rollback= query_get_value(SHOW BINLOG EVENTS, Pos, 7)
--let $binlog_query= query_get_value(SHOW BINLOG EVENTS, Info, 7)
- if (`SELECT 'ROLLBACK' != '$binlog_query'`) {
+ if ($binlog_query != ROLLBACK) {
--echo Wrong query from SHOW BINLOG EVENTS. Expected ROLLBACK, got '$binlog_query'
--source include/show_rpl_debug_info.inc
--die Wrong value for slave parameter
diff --git a/mysql-test/extra/rpl_tests/check_type.inc b/mysql-test/extra/rpl_tests/check_type.inc
index 63491d81da4..97300753d38 100644
--- a/mysql-test/extra/rpl_tests/check_type.inc
+++ b/mysql-test/extra/rpl_tests/check_type.inc
@@ -11,18 +11,28 @@
# on the slave)
# $can_convert True if conversion shall work, false if it
# shall generate an error
+# $engine_type The storage engine to be used for storing table
+# on both master and slave
+if (!$engine_type)
+{
+ # Use the default storage engine
+ let $engine_type=`SELECT @@storage_engine`;
+}
connection master;
disable_warnings;
DROP TABLE IF EXISTS t1;
enable_warnings;
-eval CREATE TABLE t1 (a $source_type);
+eval CREATE TABLE t1(
+ pk INT NOT NULL PRIMARY KEY,
+ a $source_type
+) ENGINE=$engine_type;
sync_slave_with_master;
eval ALTER TABLE t1 MODIFY a $target_type;
connection master;
-eval INSERT INTO t1 VALUES($source_value);
+eval INSERT INTO t1 VALUES(1, $source_value);
if ($can_convert) {
sync_slave_with_master;
eval SELECT a = $target_value into @compare FROM t1;
diff --git a/mysql-test/extra/rpl_tests/create_recursive_construct.inc b/mysql-test/extra/rpl_tests/create_recursive_construct.inc
index ac10ab8ddb2..6e130a8154f 100644
--- a/mysql-test/extra/rpl_tests/create_recursive_construct.inc
+++ b/mysql-test/extra/rpl_tests/create_recursive_construct.inc
@@ -167,7 +167,9 @@
--let $CRC_create=
######## func_retval ########
-if (`SELECT $CRC_ARG_type = 0 AND '$CRC_ARG_value' != ''`) {
+# if inside if in lieu of AND operand
+if ($CRC_ARG_type == 0) {
+ if ($CRC_ARG_value) {
# It will be safe to call this function and discard the return
# value, but it will be unsafe to use return value (e.g., in
# INSERT...SELECT).
@@ -180,10 +182,11 @@ if (`SELECT $CRC_ARG_type = 0 AND '$CRC_ARG_value' != ''`) {
--let $CRC_RET_drop= DROP FUNCTION $CRC_name
--let $CRC_RET_is_toplevel= 0
--let $CRC_RET_desc= function $CRC_name returning value from $CRC_ARG_desc
+ }
}
######## func_sidef ########
-if (`SELECT $CRC_ARG_type = 1`) {
+if ($CRC_ARG_type == 1) {
# It will be unsafe to call func even if you discard return value.
--let $CRC_name= func_sidef_$CRC_ARG_level
--let $CRC_create= CREATE FUNCTION $CRC_name() RETURNS VARCHAR(100) BEGIN INSERT INTO ta$CRC_ARG_level VALUES (47); $CRC_ARG_stmt_sidef; RETURN 0; END
@@ -197,7 +200,7 @@ if (`SELECT $CRC_ARG_type = 1`) {
}
######## proc ########
-if (`SELECT $CRC_ARG_type = 2`) {
+if ($CRC_ARG_type == 2) {
# It will be unsafe to call this procedure.
--let $CRC_name= proc_$CRC_ARG_level
--let $CRC_create= CREATE PROCEDURE $CRC_name() BEGIN $CRC_ARG_stmt_sidef; INSERT INTO ta$CRC_ARG_level VALUES (47); END
@@ -211,7 +214,7 @@ if (`SELECT $CRC_ARG_type = 2`) {
}
######## trig ########
-if (`SELECT $CRC_ARG_type = 3`) {
+if ($CRC_ARG_type == 3) {
# It will be unsafe to invoke this trigger.
--let $CRC_name= trig_$CRC_ARG_level
--let $CRC_create= CREATE TRIGGER $CRC_name BEFORE INSERT ON trigger_table_$CRC_ARG_level FOR EACH ROW BEGIN INSERT INTO ta$CRC_ARG_level VALUES (47); $CRC_ARG_stmt_sidef; END
@@ -225,7 +228,8 @@ if (`SELECT $CRC_ARG_type = 3`) {
}
######## view_retval ########
-if (`SELECT $CRC_ARG_type = 4 AND '$CRC_ARG_sel_retval' != ''`) {
+if ($CRC_ARG_type == 4) {
+ if ($CRC_ARG_sel_retval) {
# It will be safe to select from this view if you discard the result
# set, but unsafe to use result set (e.g., in INSERT..SELECT).
--let $CRC_name= view_retval_$CRC_ARG_level
@@ -237,10 +241,12 @@ if (`SELECT $CRC_ARG_type = 4 AND '$CRC_ARG_sel_retval' != ''`) {
--let $CRC_RET_drop= DROP VIEW $CRC_name
--let $CRC_RET_is_toplevel= 0
--let $CRC_RET_desc= view $CRC_name returning value from $CRC_ARG_desc
+ }
}
######## view_sidef ########
-if (`SELECT $CRC_ARG_type = 5 AND '$CRC_ARG_sel_sidef' != ''`) {
+if ($CRC_ARG_type == 5) {
+ if ($CRC_ARG_sel_sidef) {
# It will be unsafe to select from this view, even if you discard
# the return value.
--let $CRC_name= view_sidef_$CRC_ARG_level
@@ -252,10 +258,11 @@ if (`SELECT $CRC_ARG_type = 5 AND '$CRC_ARG_sel_sidef' != ''`) {
--let $CRC_RET_drop= DROP VIEW $CRC_name
--let $CRC_RET_is_toplevel= 0
--let $CRC_RET_desc= view $CRC_name invoking $CRC_ARG_desc
+ }
}
######## prep ########
-if (`SELECT $CRC_ARG_type = 6`) {
+if ($CRC_ARG_type == 6) {
# It will be unsafe to execute this prepared statement
--let $CRC_name= prep_$CRC_ARG_level
--let $CRC_create= PREPARE $CRC_name FROM "$CRC_ARG_stmt_sidef"
@@ -269,7 +276,7 @@ if (`SELECT $CRC_ARG_type = 6`) {
}
######## no recursive construct: just return the given statement ########
-if (`SELECT $CRC_ARG_type = 7`) {
+if ($CRC_ARG_type == 7) {
# CRC_ARG_type=7 is a special case. We just set $CRC_RET_x =
# $CRC_ARG_x. This way, the $CRC_ARG_stmt gets executed directly
# (below). In binlog_unsafe.test, it is used to invoke the unsafe
@@ -285,17 +292,17 @@ if (`SELECT $CRC_ARG_type = 7`) {
}
######## execute! ########
-if (`SELECT '$CRC_RET_stmt_sidef' != ''`) {
+if ($CRC_RET_stmt_sidef) {
--echo
--echo Invoking $CRC_RET_desc.
- if (`SELECT '$CRC_create' != ''`) {
+ if ($CRC_create) {
--eval $CRC_create
}
--echo * binlog_format = STATEMENT: expect $CRC_ARG_expected_number_of_warnings warnings.
--eval $CRC_RET_stmt_sidef
--let $n_warnings= `SHOW COUNT(*) WARNINGS`
- if (`SELECT '$n_warnings' != '$CRC_ARG_expected_number_of_warnings'`) {
+ if ($n_warnings != $CRC_ARG_expected_number_of_warnings) {
--echo ******** Failure! Expected $CRC_ARG_expected_number_of_warnings warnings, got $n_warnings warnings. ********
SHOW WARNINGS;
SHOW BINLOG EVENTS;
@@ -312,14 +319,14 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) {
RESET MASTER;
--eval $CRC_RET_stmt_sidef
--let $n_warnings= `SHOW COUNT(*) WARNINGS`
- if (`SELECT '$n_warnings' != '0'`) {
+ if ($n_warnings) {
--echo ******** Failure! Expected 0 warnings, got $n_warnings warnings. ********
SHOW WARNINGS;
SHOW BINLOG EVENTS;
--die Wrong number of warnings.
}
--let $binlog_event= query_get_value(SHOW BINLOG EVENTS, Event_type, 2)
- if (`SELECT '$binlog_event' != 'No such row'`) {
+ if ($binlog_event != No such row) {
--enable_query_log
--echo ******** Failure! Something was written to the binlog despite SQL_LOG_BIN=0 ********
SHOW BINLOG EVENTS;
@@ -332,7 +339,7 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) {
RESET MASTER;
--eval $CRC_RET_stmt_sidef
--let $n_warnings= `SHOW COUNT(*) WARNINGS`
- if (`SELECT '$n_warnings' != '0'`) {
+ if ($n_warnings) {
--echo ******** Failure! Expected 0 warnings, got $n_warnings warnings. ********
SHOW WARNINGS;
SHOW BINLOG EVENTS;
@@ -365,7 +372,7 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) {
# Invoke created object, discarding the return value. This should not
# give any warning.
-if (`SELECT '$CRC_RET_sel_retval' != ''`) {
+if ($CRC_RET_sel_retval) {
--echo * Invoke statement so that return value is dicarded: expect no warning.
--disable_result_log
--eval $CRC_RET_sel_retval
@@ -375,7 +382,7 @@ if (`SELECT '$CRC_RET_sel_retval' != ''`) {
# fail. When the bug is fixed, we should execute the following.
#--let $n_warnings= `SHOW COUNT(*) WARNINGS`
- #if (`SELECT '$n_warnings' != '0'`) {
+ #if ($n_warnings) {
# --enable_query_log
# --echo Failure! Expected 0 warnings, got $n_warnings warnings.
# SHOW WARNINGS;
diff --git a/mysql-test/extra/rpl_tests/rpl_EE_err.test b/mysql-test/extra/rpl_tests/rpl_EE_err.test
index 205bbe79dac..0b3fec1f605 100644
--- a/mysql-test/extra/rpl_tests/rpl_EE_err.test
+++ b/mysql-test/extra/rpl_tests/rpl_EE_err.test
@@ -9,10 +9,6 @@
# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986).
####################################
-# Change Author: JBM
-# Change Date: 2006-01-11
-# Change: Split test per lars review
-####################################
#"REQUIREMENT: A master DROP TABLE on a table with non-existing MYI
# file must be correctly replicated to the slave"
####################################
@@ -23,8 +19,5 @@ flush tables;
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/t1.MYI ;
drop table if exists t1;
-save_master_pos;
-connection slave;
-sync_with_master;
-# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment.test b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
index 86885a14f94..24bcb5dbb77 100644
--- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test
@@ -1,14 +1,6 @@
#
# Test of auto_increment with offset
#
-#####################################
-# By: JBM
-# Date: 2006-02-10
-# Change: NDB does not support auto inc
-# in this usage. Currently there is no
-# plan to implment. Skipping test when
-# NDB is default engine.
-#####################################
-- source include/not_ndb_default.inc
-- source include/master-slave.inc
@@ -169,7 +161,7 @@ drop table t1;
# auto_increment fields if the values of them are 0. There is an inconsistency
# between slave and master. When MODE_NO_AUTO_VALUE_ON_ZERO are masters treat
#
-source include/master-slave-reset.inc;
+source include/rpl_reset.inc;
connection master;
--disable_warnings
@@ -210,12 +202,10 @@ INSERT INTO t2 VALUES(4);
FLUSH LOGS;
sync_slave_with_master;
-let $diff_table_1= master:test.t1;
-let $diff_table_2= slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
-let $diff_table_1= master:test.t2;
-let $diff_table_2= slave:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
connection master;
@@ -228,16 +218,42 @@ let $MYSQLD_DATADIR= `SELECT @@DATADIR`;
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL test
sync_slave_with_master;
-let $diff_table_1= master:test.t1;
-let $diff_table_2= slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
-let $diff_table_1= master:test.t2;
-let $diff_table_2= slave:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
# End cleanup
+--connection master
DROP TABLE t1;
DROP TABLE t2;
SET SQL_MODE='';
sync_slave_with_master;
+
+#
+# BUG#56662
+# The test verifies if the assertion of "next_insert_id == 0"
+# will fail in ha_external_lock() function.
+#
+connection master;
+CREATE TABLE t1 (id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, data INT) ENGINE=innodb;
+
+BEGIN;
+--echo # Set sql_mode with NO_AUTO_VALUE_ON_ZERO for allowing
+--echo # zero to fill the auto_increment field.
+SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
+INSERT INTO t1(id,data) VALUES(0,2);
+--echo # Resetting sql_mode without NO_AUTO_VALUE_ON_ZERO to
+--echo # affect the execution of the transaction on slave.
+SET SQL_MODE=0;
+COMMIT;
+SELECT * FROM t1;
+sync_slave_with_master;
+SELECT * FROM t1;
+
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test b/mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test
index 0bfa46de113..30b25955ecb 100644
--- a/mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment_insert_view.test
@@ -29,8 +29,7 @@ commit;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
-let $diff_table_1=master:test.t3;
-let $diff_table_2=slave:test.t3;
+let $diff_tables= master:t3, slave:t3;
source include/diff_tables.inc;
connection master;
diff --git a/mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test b/mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test
index 614d79d9c2d..f93d435349f 100644
--- a/mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment_invoke_trigger.test
@@ -60,14 +60,11 @@ connection master;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'INVOKES A TRIGGER with $trigger_action action'
-let $diff_table_1=master:test.t2;
-let $diff_table_2=slave:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
-let $diff_table_1=master:test.t4;
-let $diff_table_2=slave:test.t4;
+let $diff_tables= master:t4, slave:t4;
source include/diff_tables.inc;
-let $diff_table_1=master:test.t6;
-let $diff_table_2=slave:test.t6;
+let $diff_tables= master:t6, slave:t6;
source include/diff_tables.inc;
connection master;
diff --git a/mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test b/mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test
index fece19b397d..d7c26ea42f1 100644
--- a/mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test
+++ b/mysql-test/extra/rpl_tests/rpl_autoinc_func_invokes_trigger.test
@@ -41,11 +41,9 @@ connection master;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'CALLS A FUNCTION which INVOKES A TRIGGER with $insert_action action'
-let $diff_table_1=master:test.t2;
-let $diff_table_2=slave:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
-let $diff_table_1=master:test.t3;
-let $diff_table_2=slave:test.t3;
+let $diff_tables= master:t3, slave:t3;
source include/diff_tables.inc;
connection master;
diff --git a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test
index 1fb6b3dcb8a..54b5c95080e 100644
--- a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test
+++ b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test
@@ -21,9 +21,20 @@
# and slave are diverging.
#
########################################################################################
-
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1);
+let $old_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_cache_size", Value, 1);
+let $old_max_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_stmt_cache_size", Value, 1);
+let $old_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_stmt_cache_size", Value, 1);
+
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
+disconnect master;
+connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
+
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
@@ -38,25 +49,22 @@ connection master;
--echo *** Single statement on transactional table ***
--disable_query_log
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
eval INSERT INTO t1 (a, data) VALUES (1,
CONCAT($data, $data, $data, $data, $data));
--enable_query_log
--echo *** Single statement on non-transactional table ***
--disable_query_log
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
eval INSERT INTO t2 (a, data) VALUES (2,
CONCAT($data, $data, $data, $data, $data, $data));
--enable_query_log
-connection slave;
---source include/wait_for_slave_sql_to_stop.inc
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
---source include/wait_for_slave_sql_to_start.inc
-
-connection master;
+# Incident event
+# 1590=ER_SLAVE_INCIDENT
+--let $slave_sql_errno= 1590
+--source include/wait_for_slave_sql_error_and_skip.inc
--disable_query_log
eval INSERT INTO t1 (a, data) VALUES (3, $data);
@@ -69,28 +77,18 @@ eval INSERT INTO t2 (a, data) VALUES (5, $data);
--echo *** Single statement on both transactional and non-transactional tables. ***
--disable_query_log
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
eval UPDATE t2, t1 SET t2.data = CONCAT($data, $data, $data, $data),
t1.data = CONCAT($data, $data, $data, $data);
--enable_query_log
-connection slave;
---source include/wait_for_slave_sql_to_stop.inc
-
-if (`SELECT @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
-{
- SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-}
-if (`SELECT @@binlog_format = 'ROW'`)
-{
- SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 2;
-}
-START SLAVE SQL_THREAD;
---source include/wait_for_slave_sql_to_start.inc
-connection master;
+# 1590=ER_SLAVE_INCIDENT
+--let $slave_sql_errno= 1590
+--let $slave_skip_counter= `SELECT IF(@@binlog_format = 'ROW', 2, 1)`
+--source include/wait_for_slave_sql_error_and_skip.inc
-let $diff_statement= SELECT * FROM t1;
---source include/diff_master_slave.inc
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
--echo ########################################################################################
--echo # 2 - BEGIN - IMPLICIT COMMIT by DDL
@@ -106,11 +104,11 @@ BEGIN;
--eval INSERT INTO t1 (a, data) VALUES (1, $data);
--eval INSERT INTO t1 (a, data) VALUES (2, $data);
--eval INSERT INTO t1 (a, data) VALUES (3, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (4, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (5, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (6, $data);
--eval INSERT INTO t1 (a, data) VALUES (7, 's');
--eval INSERT INTO t2 (a, data) VALUES (8, 's');
@@ -133,9 +131,9 @@ BEGIN;
--eval INSERT INTO t1 (a, data) VALUES (14, $data);
--eval INSERT INTO t1 (a, data) VALUES (15, $data);
--eval INSERT INTO t1 (a, data) VALUES (16, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (17, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (18, $data);
--eval INSERT INTO t1 (a, data) VALUES (19, 's');
--eval INSERT INTO t2 (a, data) VALUES (20, 's');
@@ -151,7 +149,7 @@ if (`SELECT @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
if (`SELECT @@binlog_format = 'ROW'`)
{
--disable_query_log
- --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+ --error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
CREATE TABLE t4 SELECT * FROM t1;
--enable_query_log
}
@@ -165,9 +163,9 @@ BEGIN;
--eval INSERT INTO t1 (a, data) VALUES (22, $data);
--eval INSERT INTO t1 (a, data) VALUES (23, $data);
--eval INSERT INTO t1 (a, data) VALUES (24, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (25, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (26, $data);
--eval INSERT INTO t1 (a, data) VALUES (27, 's');
--eval INSERT INTO t2 (a, data) VALUES (28, 's');
@@ -178,19 +176,9 @@ BEGIN;
CREATE TABLE t5 (a int);
--enable_query_log
-if (`SELECT @@binlog_format = 'ROW'`)
-{
- connection slave;
- --source include/wait_for_slave_sql_to_stop.inc
-
- SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
- START SLAVE SQL_THREAD;
- --source include/wait_for_slave_sql_to_start.inc
- connection master;
-}
-
-let $diff_statement= SELECT * FROM t1;
---source include/diff_master_slave.inc
+--sync_slave_with_master
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
--echo ########################################################################################
--echo # 3 - BEGIN - COMMIT
@@ -206,11 +194,11 @@ BEGIN;
--eval INSERT INTO t1 (a, data) VALUES (1, $data);
--eval INSERT INTO t1 (a, data) VALUES (2, $data);
--eval INSERT INTO t1 (a, data) VALUES (3, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (4, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (5, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (6, $data);
--eval INSERT INTO t1 (a, data) VALUES (7, 's');
--eval INSERT INTO t2 (a, data) VALUES (8, 's');
@@ -218,8 +206,9 @@ BEGIN;
--enable_query_log
COMMIT;
-let $diff_statement= SELECT * FROM t1;
---source include/diff_master_slave.inc
+--sync_slave_with_master
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
--echo ########################################################################################
--echo # 4 - BEGIN - ROLLBACK
@@ -235,11 +224,11 @@ BEGIN;
--eval INSERT INTO t1 (a, data) VALUES (1, $data);
--eval INSERT INTO t1 (a, data) VALUES (2, $data);
--eval INSERT INTO t1 (a, data) VALUES (3, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (4, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (5, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (6, $data);
--eval INSERT INTO t1 (a, data) VALUES (7, 's');
--eval INSERT INTO t2 (a, data) VALUES (8, 's');
@@ -247,8 +236,9 @@ BEGIN;
--enable_query_log
ROLLBACK;
-let $diff_statement= SELECT * FROM t1;
---source include/diff_master_slave.inc
+--sync_slave_with_master
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
--echo ########################################################################################
--echo # 5 - PROCEDURE
@@ -282,7 +272,7 @@ TRUNCATE TABLE t1;
BEGIN;
--disable_query_log
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
eval CALL p1($data);
--enable_query_log
COMMIT;
@@ -291,13 +281,14 @@ TRUNCATE TABLE t1;
BEGIN;
--disable_query_log
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
eval CALL p1($data);
--enable_query_log
ROLLBACK;
-let $diff_statement= SELECT * FROM t1;
---source include/diff_master_slave.inc
+--sync_slave_with_master
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
--echo ########################################################################################
--echo # 6 - XID
@@ -313,12 +304,12 @@ BEGIN;
--eval INSERT INTO t1 (a, data) VALUES (1, $data);
--eval INSERT INTO t1 (a, data) VALUES (2, $data);
--eval INSERT INTO t1 (a, data) VALUES (3, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (4, $data);
SAVEPOINT sv;
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (5, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (6, $data);
--eval INSERT INTO t1 (a, data) VALUES (7, 's');
--eval INSERT INTO t2 (a, data) VALUES (8, 's');
@@ -327,8 +318,9 @@ SAVEPOINT sv;
ROLLBACK TO sv;
COMMIT;
-let $diff_statement= SELECT * FROM t1;
---source include/diff_master_slave.inc
+--sync_slave_with_master
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
--echo ########################################################################################
--echo # 7 - NON-TRANS TABLE
@@ -345,11 +337,11 @@ BEGIN;
--eval INSERT INTO t1 (a, data) VALUES (2, $data);
--eval INSERT INTO t2 (a, data) VALUES (3, $data);
--eval INSERT INTO t1 (a, data) VALUES (4, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (5, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (6, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (7, $data);
--eval UPDATE t2 SET data= CONCAT($data, $data);
--eval INSERT INTO t1 (a, data) VALUES (8, 's');
@@ -365,13 +357,90 @@ BEGIN;
--eval INSERT INTO t1 (a, data) VALUES (16, $data);
--eval INSERT INTO t2 (a, data) VALUES (17, $data);
--eval INSERT INTO t1 (a, data) VALUES (18, $data);
---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
+--error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (19, $data);
--enable_query_log
COMMIT;
-let $diff_statement= SELECT * FROM t1;
---source include/diff_master_slave.inc
+--sync_slave_with_master
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
+
+--echo ########################################################################
+--echo # 8 - Bug#55375(Regression Bug) Transaction bigger than
+--echo # max_binlog_cache_size crashes slave
+--echo ########################################################################
+
+--echo # [ On Slave ]
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
+
+source include/stop_slave.inc;
+source include/start_slave.inc;
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
+
+connection master;
+TRUNCATE t1;
+
+sync_slave_with_master;
+--let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1)
+--let binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+
+connection master;
+--replace_result $old_max_binlog_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL max_binlog_cache_size= $old_max_binlog_cache_size
+--replace_result $old_binlog_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL binlog_cache_size= $old_binlog_cache_size
+--replace_result $old_max_binlog_stmt_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL max_binlog_stmt_cache_size= $old_max_binlog_stmt_cache_size
+--replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size
+disconnect master;
+connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
+
+--let $n=128
+BEGIN;
+--disable_query_log
+--echo Repeat statement 'INSERT INTO t1 VALUES(\$n, repeat("a", 32))' $n times
+while ($n)
+{
+ --eval INSERT INTO t1 VALUES ($n, repeat("a", 32))
+ --dec $n
+}
+--enable_query_log
+COMMIT;
+
+--connection slave
+--let $slave_sql_errno= 1197
+if (`SELECT @@binlog_format = 'ROW'`)
+{
+ --let $slave_sql_errno= 1534
+}
+source include/wait_for_slave_sql_error.inc;
+
+SELECT count(*) FROM t1;
+source include/show_binlog_events.inc;
+
+--replace_result $old_max_binlog_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL max_binlog_cache_size= $old_max_binlog_cache_size
+--replace_result $old_binlog_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL binlog_cache_size= $old_binlog_cache_size
+--replace_result $old_max_binlog_stmt_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL max_binlog_stmt_cache_size= $old_max_binlog_stmt_cache_size
+--replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE
+--eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size
+
+source include/stop_slave.inc;
+source include/start_slave.inc;
+
+connection master;
+sync_slave_with_master;
+SELECT count(*) FROM t1;
--echo ########################################################################################
--echo # CLEAN
@@ -381,8 +450,10 @@ connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+# t4 exists only if binlog_format!=row, so so a warning is generated
+# if binog_format=row
+--disable_warnings
DROP TABLE IF EXISTS t4;
-DROP TABLE IF EXISTS t5;
-DROP TABLE IF EXISTS t6;
+--enable_warnings
+DROP TABLE t5;
DROP PROCEDURE p1;
-sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_charset.test b/mysql-test/extra/rpl_tests/rpl_charset.test
index d884bd1178c..fa83b06597d 100644
--- a/mysql-test/extra/rpl_tests/rpl_charset.test
+++ b/mysql-test/extra/rpl_tests/rpl_charset.test
@@ -2,11 +2,7 @@
# This test will fail if the server/client does not support enough charsets.
source include/master-slave.inc;
---disable_warnings
set timestamp=1000000000;
-drop database if exists mysqltest2;
-drop database if exists mysqltest3;
---enable_warnings
create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
@@ -149,6 +145,6 @@ eval create table `t1` (
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
-sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
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 98638b0b1f6..7de4f421c35 100644
--- a/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test
+++ b/mysql-test/extra/rpl_tests/rpl_commit_after_flush.test
@@ -1,16 +1,10 @@
-#################################
-# Test updated to use a wrapper #
-#################################
-
eval CREATE TABLE t1 (a INT) ENGINE=$engine_type;
begin;
insert into t1 values(1);
flush tables with read lock;
commit;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
# cleanup
connection master;
unlock tables;
diff --git a/mysql-test/extra/rpl_tests/rpl_conflicts.test b/mysql-test/extra/rpl_tests/rpl_conflicts.test
index b20bbb15a1a..2fbf3dba5dc 100644
--- a/mysql-test/extra/rpl_tests/rpl_conflicts.test
+++ b/mysql-test/extra/rpl_tests/rpl_conflicts.test
@@ -91,11 +91,14 @@ if (`SELECT @@global.binlog_format != 'ROW' OR @@global.slave_exec_mode = 'STRIC
# key error, and stops the SQL thread.
let $slave_sql_errno= 1062; # ER_DUP_ENTRY
source include/wait_for_slave_sql_error.inc;
- let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+
+ --let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1)
--replace_regex /end_log_pos [0-9]+/end_log_pos END_LOG_POS/
--disable_query_log
--eval SELECT "$err" as 'Last_SQL_Error (expected "duplicate key" error)'
--enable_query_log
+ call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
+
SELECT * FROM t1;
--echo ---- Resolve the conflict on the slave and restart SQL thread ----
@@ -140,10 +143,16 @@ connection slave;
# replication continues.
if (`SELECT @@global.binlog_format = 'ROW' AND @@global.slave_exec_mode = 'STRICT'`) {
--echo ---- Wait until slave stops with an error ----
+ call mtr.add_suppression("Slave SQL.*Can.t find record in .t1., Error_code: 1032");
let $slave_sql_errno= 1032; # ER_KEY_NOT_FOUND
source include/wait_for_slave_sql_error.inc;
- let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
- --echo Last_SQL_Error = $err (expected "can't find record" error)
+
+ --let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1)
+ --replace_regex /end_log_pos [0-9]+/end_log_pos END_LOG_POS/
+ --disable_query_log
+ --eval SELECT "$err" as 'Last_SQL_Error (expected "duplicate key" error)'
+ --enable_query_log
+
SELECT * FROM t1;
--echo ---- Resolve the conflict on the slave and restart SQL thread ----
@@ -168,4 +177,4 @@ connection master;
DROP TABLE t1;
--echo [on slave]
-sync_slave_with_master;
+--sync_slave_with_master
diff --git a/mysql-test/extra/rpl_tests/rpl_ddl.test b/mysql-test/extra/rpl_tests/rpl_ddl.test
index f1064dc268f..3b0348cc29f 100644
--- a/mysql-test/extra/rpl_tests/rpl_ddl.test
+++ b/mysql-test/extra/rpl_tests/rpl_ddl.test
@@ -136,14 +136,6 @@ sync_slave_with_master;
connection master;
SET AUTOCOMMIT = 1;
#
-# 1. DROP all objects, which probably already exist, but must be created here
-#
---disable_warnings
-DROP DATABASE IF EXISTS mysqltest1;
-DROP DATABASE IF EXISTS mysqltest2;
-DROP DATABASE IF EXISTS mysqltest3;
---enable_warnings
-#
# 2. CREATE all objects needed
# working database is mysqltest1
# working table (transactional!) is mysqltest1.t1
@@ -619,6 +611,3 @@ connection master;
DROP DATABASE mysqltest1;
# mysqltest2 was alreday DROPPED some tests before.
DROP DATABASE mysqltest3;
---enable_warnings
-
--- source include/master-slave-end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_deadlock.test b/mysql-test/extra/rpl_tests/rpl_deadlock.test
index 607348ae97b..bd446c86943 100644
--- a/mysql-test/extra/rpl_tests/rpl_deadlock.test
+++ b/mysql-test/extra/rpl_tests/rpl_deadlock.test
@@ -131,3 +131,4 @@ sync_slave_with_master;
SET global max_relay_log_size= @my_max_relay_log_size;
--echo End of 5.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc
index 8e89cde004d..094e84537db 100644
--- a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc
+++ b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc
@@ -35,7 +35,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`)
# when a command ends.
#
--let $n= $tot_table
- while (`SELECT $n != 0`)
+ while ($n)
{
--eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n
--eval CREATE TEMPORARY TABLE nt_tmp_$n ( id INT ) ENGINE = MyIsam
@@ -62,7 +62,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`)
# when a command ends.
#
--let $n= $tot_table
- while (`SELECT $n != 0`)
+ while ($n)
{
--eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n
--eval CREATE TEMPORARY TABLE tt_tmp_$n ( id INT ) ENGINE = Innodb
@@ -89,7 +89,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`)
# when a command ends.
#
--let $n= $tot_table
- while (`SELECT $n != 0`)
+ while ($n)
{
--eval DROP TABLE IF EXISTS nt_$n
--eval CREATE TABLE nt_$n ( id INT ) ENGINE = MyIsam
@@ -116,7 +116,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`)
# when a command ends.
#
--let $n= $tot_table
- while (`SELECT $n != 0`)
+ while ($n)
{
--eval DROP TABLE IF EXISTS tt_$n
--eval CREATE TABLE tt_$n ( id INT ) ENGINE = Innodb
@@ -163,14 +163,14 @@ if (`SELECT HEX(@commands) = HEX('clean')`)
DROP TABLE IF EXISTS nt_xx_1;
--let $n= $tot_table
- while (`SELECT $n != 0`)
+ while ($n)
{
--eval DROP TABLE IF EXISTS nt_$n
--dec $n
}
--let $n= $tot_table
- while (`SELECT $n != 0`)
+ while ($n)
{
--eval DROP TABLE IF EXISTS tt_$n
--dec $n
@@ -634,11 +634,11 @@ while (`SELECT HEX(@commands) != HEX('')`)
{
--let $dropped_temp= $table
}
- if (`SELECT $n = 1`)
+ if ($n == 1)
{
--let $table_1= $table
}
- if (`SELECT $n = 2`)
+ if ($n == 2)
{
--let $table_2= $table
}
@@ -886,7 +886,7 @@ while (`SELECT HEX(@commands) != HEX('')`)
--let $available_n_temp=
--let $dropped_n_temp=
--let $n= $tot_table
- while (`SELECT $n != 0`)
+ while ($n)
{
--eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n
--eval CREATE TEMPORARY TABLE nt_tmp_$n ( id INT ) ENGINE = MyIsam
@@ -905,7 +905,7 @@ while (`SELECT HEX(@commands) != HEX('')`)
--let $available_t_temp=
--let $dropped_t_temp=
--let $n= $tot_table
- while (`SELECT $n != 0`)
+ while ($n)
{
--eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n
--eval CREATE TEMPORARY TABLE tt_tmp_$n ( id INT ) ENGINE = Innodb
@@ -924,7 +924,7 @@ while (`SELECT HEX(@commands) != HEX('')`)
--let $available_t=
--let $dropped_t=
--let $n= $tot_table
- while (`SELECT $n != 0`)
+ while ($n)
{
--eval DROP TABLE IF EXISTS tt_$n
--eval CREATE TABLE tt_$n ( id INT ) ENGINE = Innodb
@@ -943,7 +943,7 @@ while (`SELECT HEX(@commands) != HEX('')`)
--let $available_n=
--let $dropped_n=
--let $n= $tot_table
- while (`SELECT $n != 0`)
+ while ($n)
{
--eval DROP TABLE IF EXISTS nt_$n
--eval CREATE TABLE nt_$n ( id INT ) ENGINE = MyIsam
diff --git a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
deleted file mode 100644
index d4310f50909..00000000000
--- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
+++ /dev/null
@@ -1,1032 +0,0 @@
-#############################################################
-# Author: Chuck
-#############################################################
-# Purpose: To test having extra columns on the master WL#3915
-# engine inspecific sourced part
-#############################################################
-# Change Author: Jeb
-# Change: Cleanup and extend testing
-#############################################################
-# TODO: partition specific
-# -- source include/have_partition.inc
-# Note: Will be done in different test due to NDB using this
-# test case.
-############################################################
-
-########### Clean up ################
---disable_warnings
---disable_query_log
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t10,t11,t12,t13,t14,t15,t16,t17,t18,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)
-#
-
-let $binformat = `SHOW VARIABLES LIKE '%binlog_format%'`;
---echo
---echo ***********************************************************
---echo ***********************************************************
---echo ***************** Start of Testing ************************
---echo ***********************************************************
---echo ***********************************************************
---echo * This test format == $binformat and engine == $engine_type
---echo ***********************************************************
---echo ***********************************************************
---echo
---echo ***** Testing more columns on the Master *****
---echo
-connection master;
-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;
---echo
---echo * Alter Table on Slave and drop columns f5 through f11 *
---echo
-sync_slave_with_master;
-alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-
---echo
---echo * Insert data in Master then update and delete some rows*
---echo
-connection master;
-let $j= 50;
---disable_query_log
-while ($j)
-{
- eval INSERT INTO t1 VALUES ($j, $j, $j, 'second', 2.0, 'kaks', 2,
- 'got stolen from the paradise',
- 'very fat blob', b'01010101010101',
- 0x123456);
- dec $j;
-}
-let $j= 30;
-while ($j)
-{
- eval update t1 set f4= 'next' where f1=$j;
- dec $j;
- dec $j;
- eval delete from t1 where f1=$j;
- dec $j;
-}
---enable_query_log
-
---echo * Select count and 20 rows from Master *
---echo
-SELECT COUNT(*) FROM t1;
---echo
-SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
- hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
-
-#connection slave;
-sync_slave_with_master;
---echo
---echo * Select count and 20 rows from Slave *
---echo
-SELECT COUNT(*) FROM t1;
---echo
-SELECT * FROM t1 ORDER BY f3 LIMIT 20;
-
---source include/check_slave_is_running.inc
-
-### Altering table def scenario
---echo
---echo ***** Testing Altering table def scenario *****
---echo
-
-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;
---echo
- 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;
-
---echo
-# 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;
-
---echo
- 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;
---echo
---echo ** Alter tables on slave and drop columns **
---echo
-#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;
-
---echo
---echo ** Insert Data into Master **
-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
- );
---echo
---echo ** Sync slave with master **
---echo ** Do selects from tables **
---echo
-#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 f3;
-
-connection master;
---echo
---echo ** Do updates master **
---echo
- 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;
-
---echo
---echo ** Delete from Master **
---echo
-
- delete from t1;
- delete from t2;
- delete from t3;
- delete from t4;
- delete from t31;
-
-#connection slave;
- sync_slave_with_master;
- select * from t31;
-
---echo
---echo ** Check slave status **
---echo
---source include/check_slave_is_running.inc
-
-#### 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
---echo
---echo ****************************************
---echo * columns in master at middle of table *
---echo * Expect: Proper error message *
---echo ****************************************
---echo
---echo ** Stop and Reset Slave **
---echo
-STOP SLAVE;
-RESET SLAVE;
---echo
---echo ** create table slave side **
-eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
- ) ENGINE=$engine_type;
-
---echo
---echo ** Connect to master and create table **
---echo
---connection master
-eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
- c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type;
-RESET MASTER;
-
---echo
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo
---echo *** Master Data Insert ***
-connection master;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
- (2,@b1,DEFAULT,'JOE',DEFAULT),
- (3,@b1,DEFAULT,'QA',DEFAULT);
-
---echo
---echo ********************************************
---echo *** Expect slave to fail with Error 1677 ***
---echo ********************************************
---echo
-connection slave;
-# 1677 = ER_SLAVE_CONVERSION_FAILED
---let $slave_sql_errno= 1677
---let $slave_skip_counter= 2
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error_and_skip.inc
-
---echo
---echo *** Drop t10 ***
-connection master;
-DROP TABLE t10;
-sync_slave_with_master;
-
-############################################
-############## Continued ###################
-############################################
---echo
---echo *********************************************
---echo * More columns in master at middle of table *
---echo * Expect: Proper error message *
---echo *********************************************
---echo
---echo *** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-
-eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
- ) ENGINE=$engine_type;
-
---echo
---echo *** Create t11 on Master ***
-connection master;
-eval CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
- c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
-
-RESET MASTER;
-
---echo
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo
---echo *** Master Data Insert ***
-connection master;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
- (2,@b1,'Testing is cool','JOE',DEFAULT),
- (3,@b1,DEFAULT,'QA',DEFAULT);
-
---echo
---echo ********************************************
---echo *** Expect slave to fail with Error 1677 ***
---echo ********************************************
---echo
-connection slave;
-# 1677 = ER_SLAVE_CONVERSION_FAILED
---let $slave_sql_errno= 1677
---let $slave_skip_counter= 2
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error_and_skip.inc
-
---echo
---echo *** Drop t11 ***
-connection master;
-DROP TABLE t11;
-sync_slave_with_master;
-
-############################################
-############## Continued ###################
-############################################
---echo
---echo *********************************************
---echo * More columns in master at middle of table *
---echo * Expect: This one should pass blob-text *
---echo *********************************************
---echo
---echo *** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
- ) ENGINE=$engine_type;
-
---echo
---echo *** Create t12 on Master ***
-connection master;
-eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
- c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
-
-RESET MASTER;
-
---echo
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo
---echo *** Master Data Insert ***
-connection master;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
- (2,@b1,'JOE',DEFAULT,DEFAULT),
- (3,@b1,'QA',DEFAULT,DEFAULT);
---echo
-SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
-
---echo
---echo *** Select on Slave ***
-sync_slave_with_master;
-SELECT a,hex(b),c FROM t12 ORDER BY a;
-
---echo
---echo *** Drop t12 ***
-connection master;
-DROP TABLE t12;
-sync_slave_with_master;
-
-############################################
-############## Continued ###################
-############################################
---echo
---echo ****************************************************
---echo * - Alter Master adding columns at middle of table *
---echo * Expect: columns added *
---echo ****************************************************
---echo
---echo
---echo *** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
- ) ENGINE=$engine_type;
-
---echo
---echo *** Create t14 on Master ***
-connection master;
-eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
- c6 INT DEFAULT '1',
- c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
- )ENGINE=$engine_type;
-
-RESET MASTER;
-
---echo
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo
---echo *** Master Data Insert ***
-connection master;
-ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
-ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
---echo
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
- (2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
- (3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
---echo
---replace_column 7 CURRENT_TIMESTAMP
-SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
-
---echo
---echo *** Select on Slave ****
-sync_slave_with_master;
-SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
-
-####################################################
---echo
---echo ****************************************************
---echo * - Alter Master Dropping columns from the middle. *
---echo * Expect: columns dropped *
---echo ****************************************************
---echo
---echo *** connect to master and drop columns ***
-connection master;
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c7;
---echo
---echo *** Select from Master ***
-SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
---echo
-
---echo ************
---echo * Bug30415 *
---echo ************
-# Uncomment below once fixed
-
-#--echo *** Select from Slave ***
-#sync_slave_with_master;
-#SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
-
-# Bug30415
-# Remove below once fixed
-#***************************
-connection slave;
-# 1091 = ER_CANT_DROP_FIELD_OR_KEY
---let $slave_sql_errno= 1091
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error.inc
-#***************************
-
-STOP SLAVE;
-RESET SLAVE;
-
---echo
---echo *** Drop t14 ***
-DROP TABLE t14;
-
-connection master;
-DROP TABLE t14;
-RESET MASTER;
-
-connection slave;
-START SLAVE;
-
-#################################################
---echo
---echo *************************************************
---echo * - Alter Master adding columns at end of table *
---echo * Expect: Error 1054 *
---echo *************************************************
---echo
---echo *** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
- ) ENGINE=$engine_type;
-
---echo
---echo *** Create t15 on Master ***
-connection master;
-eval CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
- c6 INT DEFAULT '1',
- c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
- )ENGINE=$engine_type;
-
-RESET MASTER;
-
---echo
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo
---echo *** Master Data Insert ***
-connection master;
-ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
- (2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
- (3,@b1,'QA',DEFAULT,DEFAULT,3.00);
---replace_column 5 CURRENT_TIMESTAMP
-SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
-
---echo
---echo ********************************************
---echo *** Expect slave to fail with Error 1054 ***
---echo ********************************************
---echo
-connection slave;
-# 1054 = ER_BAD_FIELD_ERROR
---let $slave_sql_errno= 1054
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error.inc
-STOP SLAVE;
-RESET SLAVE;
-
---echo
---echo *** Drop t15 ***
-DROP TABLE t15;
-
-connection master;
-DROP TABLE t15;
-RESET MASTER;
-
-connection slave;
-START SLAVE;
-
-####################################################
---echo
---echo ************************************************
---echo * - Create index on Master column not on slave *
---echo * Expect:Warning *
---echo ************************************************
---echo
---echo *** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
- ) ENGINE=$engine_type;
-
---echo
---echo *** Create t16 on Master ***
-connection master;
-eval CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
- c6 INT DEFAULT '1',
- c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
- )ENGINE=$engine_type;
-
-RESET MASTER;
-
---echo
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo
---echo *** Master Create Index and Data Insert ***
-connection master;
-CREATE INDEX part_of_c6 ON t16 (c6);
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
- (2,@b1,'JOE',2,DEFAULT),
- (3,@b1,'QA',3,DEFAULT);
---replace_column 5 CURRENT_TIMESTAMP
-SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
-
-# Uncomment the below when bug 30434 is patched
-
-#--echo *** Select on Slave ****
-#sync_slave_with_master;
-#SELECT c1,hex(c4),c5 FROM t16 ORDER BY c1;
-#
-#--echo *** Drop t16 ***
-#connection master;
-#DROP TABLE t16;
-#sync_slave_with_master;
-
-# Remove the below when bug 30434 is patched
-#*******************************************
---echo
---echo *****************
---echo *** BUG 30434 ***
---echo *****************
---echo
-connection slave;
-# 1072 = ER_KEY_COLUMN_DOES_NOT_EXITS
---let $slave_sql_errno= 1072
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error.inc
-STOP SLAVE;
-RESET SLAVE;
-
---echo
---echo *** Drop t16 ***
-DROP TABLE t16;
-
-connection master;
-DROP TABLE t16;
-RESET MASTER;
-
-connection slave;
-START SLAVE;
-#*******************************************
-
-####################################################
---echo
---echo *****************************************************
---echo * - Delete rows using column on Master not on slave *
---echo * Expect: Rows Deleted *
---echo *****************************************************
---echo
---echo *** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
- ) ENGINE=$engine_type;
-
---echo
---echo *** Create t17 on Master ***
-connection master;
-eval CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
- c6 INT DEFAULT '1',
- c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
- )ENGINE=$engine_type;
-
-RESET MASTER;
-
---echo
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo
---echo *** Master Data Insert ***
-connection master;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
- (2,@b1,'JOE',2,DEFAULT),
- (3,@b1,'QA',3,DEFAULT);
---replace_column 5 CURRENT_TIMESTAMP
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-
---echo
---echo ** Select * from Slave **
-sync_slave_with_master;
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-
---echo
---echo ** Delete from master **
-connection master;
-DELETE FROM t17 WHERE c6 = 3;
---replace_column 5 CURRENT_TIMESTAMP
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-
---echo
---echo ** Check slave **
-sync_slave_with_master;
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-
-
-connection master;
-DROP TABLE t17;
-sync_slave_with_master;
---echo
-
-####################################################
---echo
---echo *****************************************************
---echo * - Update row using column on Master not on slave *
---echo * Expect: Rows updated *
---echo *****************************************************
---echo
---echo ** Bug30674 **
---echo
---echo *** Create t18 on slave ***
---echo
-
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
- ) ENGINE=$engine_type;
-
---echo
---echo *** Create t18 on Master ***
-connection master;
-eval CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
- c6 INT DEFAULT '1',
- c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
- )ENGINE=$engine_type;
-
-RESET MASTER;
-
---echo
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo
---echo *** Master Data Insert ***
-connection master;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-
-INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
- (2,@b1,'JOE',2,DEFAULT),
- (3,@b1,'QA',3,DEFAULT);
---replace_column 5 CURRENT_TIMESTAMP
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-
---echo
---echo ** Select * from Slave **
-sync_slave_with_master;
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-
---echo
---echo ** update from master **
-connection master;
-UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
-
---replace_column 5 CURRENT_TIMESTAMP
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-
---echo
---echo ** Check slave **
-sync_slave_with_master;
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-
-connection master;
-DROP TABLE t18;
-sync_slave_with_master;
---echo
-
-####################################################
---echo
---echo *****************************************************
---echo * - Insert UUID column on Master not on slave *
---echo * Expect: Rows inserted *
---echo *****************************************************
---echo
---echo *** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
- ) ENGINE=$engine_type;
-
---echo
---echo *** Create t5 on Master ***
-connection master;
-eval CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
- c6 LONG,
- c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
- )ENGINE=$engine_type;
-
-RESET MASTER;
-
---echo
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo
---echo *** Master Data Insert ***
-connection master;
-set @b1 = 'b1b1b1b1';
-INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
- (2,@b1,'JOE',UUID(),DEFAULT),
- (3,@b1,'QA',UUID(),DEFAULT);
---replace_column 4 UUID 5 TIME
-SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
-
---echo
---echo ** Select * from Slave **
-sync_slave_with_master;
-SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
-
-connection master;
-DROP TABLE t5;
-sync_slave_with_master;
---echo
-
-# END of 5.1 tests case
-
-
diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
deleted file mode 100644
index 568cf802763..00000000000
--- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
+++ /dev/null
@@ -1,933 +0,0 @@
-#################################################
-# Author: Jeb
-# Date: 2006-09-07
-# Purpose: To test having extra columns on the slave.
-##################################################
-
-# Some tests in here requre partitioning
--- source include/have_partition.inc
-
-########### Clean up ################
---disable_warnings
---disable_query_log
-DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t14a,t15,t16,t17;
---enable_query_log
---enable_warnings
-
-#################################################
-############ Different Table Def Test ###########
-#################################################
-# Purpose: To have different table def on the #
-# master and slave. Most of these tests#
-# should stop the slave. #
-#################################################
-
-call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
-
---echo **** Diff Table Def Start ****
-
-##############################################
-### Try to replicate w/ PK on diff columns ###
-### Should Stop Slave ###
-##############################################
-
---echo *** On Slave ***
-sync_slave_with_master;
-STOP SLAVE;
-RESET SLAVE;
-
-SET @saved_slave_type_conversions = @@slave_type_conversions;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
-
-eval CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
- d FLOAT DEFAULT '2.00',
- e CHAR(4) DEFAULT 'TEST')
- ENGINE=$engine_type;
-
---echo *** Create t1 on Master ***
-connection master;
-eval CREATE TABLE t1 (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 t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
-SELECT * FROM t1 ORDER BY a;
-
---echo *** Select from slave ***
-sync_slave_with_master;
-SELECT * FROM t1 ORDER BY a;
-
-SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
-
---echo *** Drop t1 ***
-connection master;
-DROP TABLE t1;
-sync_slave_with_master;
-
-############################################
-### Try to replicate CHAR(10) to CHAR(5) ###
-### Should Stop Slave or truncate value ###
-############################################
-
-## 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 *** 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;
---let $slave_sql_errno= 1677
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error.inc
-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 ###
-### Should Stop Slave ###
-####################################
---echo *** Create t3 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
- d FLOAT DEFAULT '2.00',
- e CHAR(5) DEFAULT 'TEST2')
- ENGINE=$engine_type;
-
---echo *** Create t3 on Master ***
-connection master;
-eval CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
- ) ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-
-set @b1 = 'b1';
-set @b1 = concat(@b1,@b1);
-
-INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
-
---echo ********************************************
---echo *** Expect slave to fail with Error 1677 ***
---echo ********************************************
-connection slave;
---let $slave_sql_errno= 1677
---let $slave_skip_counter= 2
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error_and_skip.inc
-
---echo *** Drop t3 ***
-connection master;
-DROP TABLE t3;
-sync_slave_with_master;
-
-#####################################################
-# Columns with different types, more columns at end #
-# Expect: proper error message (wrong types) #
-#####################################################
-
---echo *** Create t4 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
- d FLOAT DEFAULT '2.00',
- e CHAR(5) DEFAULT 'TEST2')
- ENGINE=$engine_type;
-
---echo *** Create t4 on Master ***
-connection master;
-eval CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
- ) ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-
-INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
- (30000.22,4,'QA TESTING');
-
---echo ********************************************
---echo *** Expect slave to fail with Error 1677 ***
---echo ********************************************
-connection slave;
---let $slave_sql_errno= 1677
---let $slave_skip_counter= 2
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error_and_skip.inc
-
---echo *** Drop t4 ***
-connection master;
-DROP TABLE t4;
-sync_slave_with_master;
-
-#######################################################
-# Columns with different types, same number of colums #
-# Expect: Proper error message #
-#######################################################
-
---echo *** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
- c FLOAT, d INT, e DOUBLE,
- f DECIMAL(8,2))ENGINE=$engine_type;
-
---echo *** Create t5 on Master ***
-connection master;
-eval CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
- c DECIMAL(8,2), d BIT, e BLOB,
- f FLOAT) ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-
-INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
- (2,'JOE',300.01,0,'b2b2',1.0000009);
-
---echo ********************************************
---echo *** Expect slave to fail with Error 1677 ***
---echo ********************************************
-connection slave;
---let $slave_sql_errno= 1677
---let $slave_skip_counter= 2
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error_and_skip.inc
-
---echo *** Drop t5 ***
-connection master;
-DROP TABLE t5;
-sync_slave_with_master;
-
-#######################################################
-################## Continued ##########################
-#######################################################
-# Columns with different types, same number of colums #
-# Expect: Proper error message #
-#######################################################
-
---echo *** Create t6 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
- c FLOAT, d INT)ENGINE=$engine_type;
-
---echo *** Create t6 on Master ***
-connection master;
-eval CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
- c DECIMAL(8,2), d BIT
- ) ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-
-INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
- (2,'JOE',300.01,0);
-
---echo ********************************************
---echo *** Expect slave to fail with Error 1677 ***
---echo ********************************************
-connection slave;
---let $slave_sql_errno= 1677
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error.inc
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
-#START SLAVE;
-
---echo *** Drop t6 ***
-connection master;
-DROP TABLE t6;
-connection slave;
-DROP TABLE t6;
-START SLAVE;
-#sync_slave_with_master;
-
-
---echo **** Diff Table Def End ****
-
-#######################################
-#### Extra Column on Slave Testing ####
-#######################################
-# Purpose: To test extra colums on the#
-# Slave #
-#######################################
-
---echo **** Extra Colums Start ****
-
-##########################################
-# More columns in slave at end of table, #
-# added columns have default values #
-# Expect: it should work, default values #
-# should be used #
-##########################################
-
---echo *** Create t7 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval 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=$engine_type;
-
---echo *** Create t7 on Master ***
-connection master;
-eval CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
- ) ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-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;
-
---echo *** Select from slave ***
-sync_slave_with_master;
-SELECT * FROM t7 ORDER BY a;
-
---echo *** Drop t7 ***
-connection master;
-DROP TABLE t7;
-sync_slave_with_master;
-
-###########################################
-# More columns in slave at end of table, #
-# added columns do not have default values#
-# Expect: Proper error message #
-###########################################
-# NOTE: This should fail but currently #
-# works. BUG#22101 #
-###########################################
---echo *** Create t8 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
- d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
- e INT)ENGINE=$engine_type;
-
---echo *** Create t8 on Master ***
-connection master;
-eval CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
- ) ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-
-### Uncomment once bug is fixed
-
-#connection slave;
-#--let $slave_sql_errno= SOMETHING
-#--let $slave_skip_counter= 2
-#--let $show_slave_sql_error= 1
-#--source include/wait_for_slave_sql_error_and_skip.inc
-
---echo *** Drop t8 ***
-connection master;
-DROP TABLE t8;
-sync_slave_with_master;
-
-###########################################
-############# Continued ###################
-# More columns in slave at end of table, #
-# added columns do not have default values#
-# Expect: Proper error message #
-###########################################
-# Bug#22234, Bug#23907 Extra Slave Col is not
-# erroring on extra col with no default values.
-###############################################################
-# Error reaction is up to sql_mode of the slave sql (bug#38173)
-#--echo *** Create t9 on slave ***
-# Please, check BUG#47741 to see why you are not testing NDB.
-if (`SELECT $engine_type != 'NDB'`)
-{
- STOP SLAVE;
- RESET SLAVE;
- eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
- d TIMESTAMP,
- e INT NOT NULL,
- f text not null,
- g text,
- h blob not null,
- i blob) ENGINE=$engine_type;
-
- --echo *** Create t9 on Master ***
- connection master;
- eval CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
- ) ENGINE=$engine_type;
- RESET MASTER;
-
- --echo *** Start Slave ***
- connection slave;
- START SLAVE;
-
- --echo *** Master Data Insert ***
- connection master;
- set @b1 = 'b1b1b1b1';
-
- set @b1 = concat(@b1,@b1);
- INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-
- # the test would stop slave if @@sql_mode for the sql thread
- # was set to strict. Otherwise, as with this tests setup,
- # the implicit defaults will be inserted into fields even though
- # they are declared without DEFAULT clause.
-
- sync_slave_with_master;
- select * from t9;
-
- # todo: fix Bug #43992 slave sql thread can't tune own sql_mode ...
- # and add/restore waiting for stop test
-
- #--let $slave_sql_errno= SOMETHING
- #--let $slave_skip_counter= 2
- #--let $show_slave_sql_error= 1
- #--source include/wait_for_slave_sql_error_and_skip.inc
-}
-
-#--echo *** Drop t9 ***
-#connection master;
-#DROP TABLE t9;
-#sync_slave_with_master;
-
-############################################
-# More columns in slave at middle of table #
-# Expect: Proper error message #
-############################################
---echo *** Create t10 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
- c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type;
-
---echo *** Create t10 on Master ***
-connection master;
-eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
- ) ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-
---echo ********************************************
---echo *** Expect slave to fail with Error 1677 ***
---echo ********************************************
-connection slave;
---let $slave_sql_errno= 1677
---let $slave_skip_counter= 2
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error_and_skip.inc
-
---echo *** Drop t10 ***
-connection master;
-DROP TABLE t10;
-sync_slave_with_master;
-
-############################################
-############## Continued ###################
-############################################
-# More columns in slave at middle of table #
-# Expect: Proper error message #
-############################################
---echo *** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
- c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
-
---echo *** Create t11 on Master ***
-connection master;
-eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
- ) ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-
---echo ********************************************
---echo *** Expect slave to fail with Error 1677 ***
---echo ********************************************
-connection slave;
---let $slave_sql_errno= 1677
---let $slave_skip_counter= 2
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error_and_skip.inc
-
---echo *** Drop t11 ***
-connection master;
-DROP TABLE t11;
-sync_slave_with_master;
-
-############################################
-############## Continued ###################
-############################################
-# More columns in slave at middle of table #
-# Expect: This one should pass blob-text #
-############################################
---echo *** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
- c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
-
---echo *** Create t12 on Master ***
-connection master;
-eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
- ) ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-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;
-
---echo *** Select on Slave ***
-sync_slave_with_master;
-SELECT * FROM t12 ORDER BY a;
-
---echo *** Drop t12 ***
-connection master;
-DROP TABLE t12;
-sync_slave_with_master;
-
---echo **** Extra Colums End ****
-
-###############################
-# BUG#22177 CURRENT_TIMESTAMP #
-# Sould work with ^ #
-###############################
---echo *** BUG 22177 Start ***
---echo *** Create t13 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
- d INT DEFAULT '1',
- e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
- )ENGINE=$engine_type;
-
---echo *** Create t13 on Master ***
-connection master;
-eval CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
- ) ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-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;
-
---echo *** Select on Slave ****
-sync_slave_with_master;
---replace_column 5 CURRENT_TIMESTAMP
-SELECT * FROM t13 ORDER BY a;
-
---echo *** Drop t13 ***
-connection master;
-DROP TABLE t13;
-sync_slave_with_master;
-
---echo *** 22117 END ***
-
-##############################
-# ALTER MASTER TABLE TESTING #
-##############################
-
---echo *** Alter Master Table Testing Start ***
-
-####################################################
-# - Alter Master adding columns at middle of table #
-# Expect: columns added #
-####################################################
-
---echo *** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
- c6 INT DEFAULT '1',
- c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
- )ENGINE=$engine_type;
-
---echo *** Create t14 on Master ***
-connection master;
-eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
- ) ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-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;
-
-
---echo *** Select on Slave ****
-sync_slave_with_master;
---replace_column 7 CURRENT_TIMESTAMP
-SELECT * FROM t14 ORDER BY c1;
-
-####################################################
-# - Alter Master drop column at end of table #
-# Expect: column dropped #
-####################################################
-
---echo *** Create t14a on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5),
- c6 INT DEFAULT '1',
- c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
- )ENGINE=$engine_type;
-
---echo *** Create t14a on Master ***
-connection master;
-eval CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
- ) ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14a () VALUES(1,@b1,'Kyle'),
- (2,@b1,'JOE'),
- (3,@b1,'QA');
-
-SELECT * FROM t14a ORDER BY c1;
---echo *** Select on Slave ****
-sync_slave_with_master;
---replace_column 5 CURRENT_TIMESTAMP
-SELECT * FROM t14a ORDER BY c1;
-STOP SLAVE;
-RESET SLAVE;
-
---echo *** Master Drop c5 ***
-connection master;
-ALTER TABLE t14a DROP COLUMN c5;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-
-INSERT INTO t14a () VALUES(4,@b1),
- (5,@b1),
- (6,@b1);
-SELECT * FROM t14a ORDER BY c1;
-
---echo *** Select on Slave ****
-sync_slave_with_master;
---replace_column 5 CURRENT_TIMESTAMP
-SELECT * FROM t14a ORDER BY c1;
-
-####################################################
-# - Alter Master Dropping columns from the middle. #
-# Expect: columns dropped #
-####################################################
-
---echo *** connect to master and drop columns ***
-connection master;
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c4;
---echo *** Select from Master ***
-SELECT * FROM t14 ORDER BY c1;
-
---echo *** Select from Slave ***
-sync_slave_with_master;
---replace_column 5 CURRENT_TIMESTAMP
-SELECT * FROM t14 ORDER BY c1;
-
---echo *** Drop t14 ***
-connection master;
-DROP TABLE t14;
-sync_slave_with_master;
-
-##############################################################
-# - Alter Master adding columns that already exist on slave. #
-# Expect: proper error message #
-##############################################################
-
---echo *** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval 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=$engine_type;
-
---echo *** Create t15 on Master ***
-connection master;
-eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
- c4 BLOB, c5 CHAR(5)) ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-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;
-
-
---echo *** Select on Slave ****
-sync_slave_with_master;
---replace_column 7 CURRENT_TIMESTAMP
-SELECT * FROM t15 ORDER BY c1;
-
---echo *** Add column on master that is a Extra on Slave ***
-connection master;
-ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
-
---echo ********************************************
---echo *** Expect slave to fail with Error 1060 ***
---echo ********************************************
-connection slave;
---let $slave_sql_errno= 1060
---let $slave_skip_counter= 1
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error_and_skip.inc
-
---echo *** Try to insert in master ****
-connection master;
-INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
-SELECT * FROM t15 ORDER BY c1;
-
-#SHOW BINLOG EVENTS;
-
---echo *** Try to select from slave ****
-sync_slave_with_master;
---replace_column 7 CURRENT_TIMESTAMP
-SELECT * FROM t15 ORDER BY c1;
-
---echo *** DROP TABLE t15 ***
-connection master;
-DROP TABLE t15;
-sync_slave_with_master;
-
-####################################
-# - Alter Master and ADD PARTITION #
-# Expect:? #
-####################################
-
---echo *** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval 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=$engine_type;
-
---echo *** Create t16 on Master ***
-connection master;
-eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
- c4 BLOB, c5 CHAR(5))ENGINE=$engine_type;
-RESET MASTER;
-
---echo *** Start Slave ***
-connection slave;
-START SLAVE;
-
---echo *** Master Data Insert ***
-connection master;
-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;
-
---echo *** Select on Slave ****
-sync_slave_with_master;
---replace_column 7 CURRENT_TIMESTAMP
-SELECT * FROM t16 ORDER BY c1;
-
---echo *** Add Partition on master ***
-connection 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;
-
---echo *** Show table on Slave ****
-sync_slave_with_master;
-SHOW CREATE TABLE t16;
-
---echo *** DROP TABLE t16 ***
-connection master;
-DROP TABLE t16;
-sync_slave_with_master;
-
---echo *** Alter Master End ***
-
-############################################
-### Try to replicate BIGINT to SMALLINT ###
-### Should Stop Slave ###
-############################################
-
---echo *** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-eval CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
- d FLOAT DEFAULT '2.00',
- e CHAR(5) DEFAULT 'TEST2')
- ENGINE=$engine_type;
-
---echo *** Create t17 on Master ***
-connection master;
-eval CREATE TABLE t17 (a BIGINT 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 t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
-
---echo ********************************************
---echo *** Expect slave to fail with Error 1677 ***
---echo ********************************************
-connection slave;
---let $slave_sql_errno= 1677
---let $slave_skip_counter= 2
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error_and_skip.inc
-
---echo ** DROP table t17 ***
-connection master;
-DROP TABLE t17;
-sync_slave_with_master;
-
-#### Clean Up ####
---disable_warnings
---disable_query_log
-connection master;
-DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t14a,t15,t16,t17;
-sync_slave_with_master;
-connection master;
---enable_query_log
---enable_warnings
-
-# END 5.1 Test Case
-
-
diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test
new file mode 100644
index 00000000000..513bc949c5d
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test
@@ -0,0 +1,1019 @@
+#############################################################
+# Purpose: To test having extra columns on the master WL#3915
+# engine inspecific sourced part
+#############################################################
+
+#
+# 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)
+#
+
+let $binformat = `SHOW VARIABLES LIKE '%binlog_format%'`;
+--echo
+--echo ***********************************************************
+--echo ***********************************************************
+--echo ***************** Start of Testing ************************
+--echo ***********************************************************
+--echo ***********************************************************
+--echo * This test format == $binformat and engine == $engine_type
+--echo ***********************************************************
+--echo ***********************************************************
+--echo
+--echo ***** Testing more columns on the Master *****
+--echo
+connection master;
+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;
+--echo
+--echo * Alter Table on Slave and drop columns f5 through f11 *
+--echo
+sync_slave_with_master;
+alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
+
+--echo
+--echo * Insert data in Master then update and delete some rows*
+--echo
+connection master;
+let $j= 50;
+--disable_query_log
+while ($j)
+{
+ eval INSERT INTO t1 VALUES ($j, $j, $j, 'second', 2.0, 'kaks', 2,
+ 'got stolen from the paradise',
+ 'very fat blob', b'01010101010101',
+ 0x123456);
+ dec $j;
+}
+let $j= 30;
+while ($j)
+{
+ eval update t1 set f4= 'next' where f1=$j;
+ dec $j;
+ dec $j;
+ eval delete from t1 where f1=$j;
+ dec $j;
+}
+--enable_query_log
+
+--echo * Select count and 20 rows from Master *
+--echo
+SELECT COUNT(*) FROM t1;
+--echo
+SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
+ hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
+
+#connection slave;
+
+--disable_query_log
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535");
+call mtr.add_suppression("Slave.*Can.t DROP .c7.; check that column.key exists.* Error_code: 1091");
+call mtr.add_suppression("Slave.*Unknown column .c7. in .t15.* Error_code: 1054");
+call mtr.add_suppression("Slave.*Key column .c6. doesn.t exist in table.* Error_code: 1072");
+call mtr.add_suppression("Slave SQL.*Column 2 of table .test.t1.. cannot be converted from type.* Error_code: 1677");
+--enable_query_log
+
+sync_slave_with_master;
+--echo
+--echo * Select count and 20 rows from Slave *
+--echo
+SELECT COUNT(*) FROM t1;
+--echo
+SELECT * FROM t1 ORDER BY f3 LIMIT 20;
+
+--source include/check_slave_is_running.inc
+
+### Altering table def scenario
+--echo
+--echo ***** Testing Altering table def scenario *****
+--echo
+
+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;
+--echo
+ 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;
+
+--echo
+# 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;
+
+--echo
+ 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;
+--echo
+--echo ** Alter tables on slave and drop columns **
+--echo
+#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;
+
+--echo
+--echo ** Insert Data into Master **
+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
+ );
+--echo
+--echo ** Sync slave with master **
+--echo ** Do selects from tables **
+--echo
+#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 f3;
+
+connection master;
+--echo
+--echo ** Do updates master **
+--echo
+ 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;
+
+--echo
+--echo ** Delete from Master **
+--echo
+
+ delete from t1;
+ delete from t2;
+ delete from t3;
+ delete from t4;
+ delete from t31;
+
+#connection slave;
+ sync_slave_with_master;
+ select * from t31;
+
+--echo
+--echo ** Check slave status **
+--echo
+--source include/check_slave_is_running.inc
+
+#### 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
+--echo
+--echo ****************************************
+--echo * columns in master at middle of table *
+--echo * Expect: Proper error message *
+--echo ****************************************
+--echo
+--echo ** Stop and Reset Slave **
+--echo
+STOP SLAVE;
+RESET SLAVE;
+--echo
+--echo ** create table slave side **
+eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo ** Connect to master and create table **
+--echo
+--connection master
+eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+ c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type;
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
+ (2,@b1,DEFAULT,'JOE',DEFAULT),
+ (3,@b1,DEFAULT,'QA',DEFAULT);
+
+--echo
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+--echo
+connection slave;
+# 1677 = ER_SLAVE_CONVERSION_FAILED
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo
+--echo *** Drop t10 ***
+connection master;
+DROP TABLE t10;
+sync_slave_with_master;
+
+############################################
+############## Continued ###################
+############################################
+--echo
+--echo *********************************************
+--echo * More columns in master at middle of table *
+--echo * Expect: Proper error message *
+--echo *********************************************
+--echo
+--echo *** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+
+eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t11 on Master ***
+connection master;
+eval CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
+ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
+ (2,@b1,'Testing is cool','JOE',DEFAULT),
+ (3,@b1,DEFAULT,'QA',DEFAULT);
+
+--echo
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+--echo
+connection slave;
+# 1677 = ER_SLAVE_CONVERSION_FAILED
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo
+--echo *** Drop t11 ***
+connection master;
+DROP TABLE t11;
+sync_slave_with_master;
+
+############################################
+############## Continued ###################
+############################################
+--echo
+--echo *********************************************
+--echo * More columns in master at middle of table *
+--echo * Expect: This one should pass blob-text *
+--echo *********************************************
+--echo
+--echo *** Create t12 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t12 on Master ***
+connection master;
+eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+ (2,@b1,'JOE',DEFAULT,DEFAULT),
+ (3,@b1,'QA',DEFAULT,DEFAULT);
+--echo
+SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
+
+--echo
+--echo *** Select on Slave ***
+sync_slave_with_master;
+SELECT a,hex(b),c FROM t12 ORDER BY a;
+
+--echo
+--echo *** Drop t12 ***
+connection master;
+DROP TABLE t12;
+sync_slave_with_master;
+
+############################################
+############## Continued ###################
+############################################
+--echo
+--echo ****************************************************
+--echo * - Alter Master adding columns at middle of table *
+--echo * Expect: columns added *
+--echo ****************************************************
+--echo
+--echo
+--echo *** Create t14 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t14 on Master ***
+connection master;
+eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
+ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
+--echo
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
+ (2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
+ (3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
+--echo
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
+
+--echo
+--echo *** Select on Slave ****
+sync_slave_with_master;
+SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
+
+####################################################
+--echo
+--echo ****************************************************
+--echo * - Alter Master Dropping columns from the middle. *
+--echo * Expect: columns dropped *
+--echo ****************************************************
+--echo
+--echo *** connect to master and drop columns ***
+connection master;
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c7;
+--echo
+--echo *** Select from Master ***
+SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
+--echo
+
+--echo ************
+--echo * Bug30415 *
+--echo ************
+# Uncomment below once fixed
+
+#--echo *** Select from Slave ***
+#sync_slave_with_master;
+#SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
+
+# Bug30415
+# Remove below once fixed
+#***************************
+connection slave;
+# 1091 = ER_CANT_DROP_FIELD_OR_KEY
+--let $slave_sql_errno= 1091
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+#***************************
+
+STOP SLAVE;
+RESET SLAVE;
+
+--echo
+--echo *** Drop t14 ***
+DROP TABLE t14;
+
+connection master;
+DROP TABLE t14;
+RESET MASTER;
+
+connection slave;
+START SLAVE;
+
+#################################################
+--echo
+--echo *************************************************
+--echo * - Alter Master adding columns at end of table *
+--echo * Expect: Error 1054 *
+--echo *************************************************
+--echo
+--echo *** Create t15 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t15 on Master ***
+connection master;
+eval CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
+ (2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
+ (3,@b1,'QA',DEFAULT,DEFAULT,3.00);
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
+
+--echo
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1054 ***
+--echo ********************************************
+--echo
+connection slave;
+# 1054 = ER_BAD_FIELD_ERROR
+--let $slave_sql_errno= 1054
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE;
+RESET SLAVE;
+
+--echo
+--echo *** Drop t15 ***
+DROP TABLE t15;
+
+connection master;
+DROP TABLE t15;
+RESET MASTER;
+
+connection slave;
+START SLAVE;
+
+####################################################
+--echo
+--echo ************************************************
+--echo * - Create index on Master column not on slave *
+--echo * Expect:Warning *
+--echo ************************************************
+--echo
+--echo *** Create t16 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t16 on Master ***
+connection master;
+eval CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Create Index and Data Insert ***
+connection master;
+CREATE INDEX part_of_c6 ON t16 (c6);
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+ (2,@b1,'JOE',2,DEFAULT),
+ (3,@b1,'QA',3,DEFAULT);
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
+
+# Uncomment the below when bug 30434 is patched
+
+#--echo *** Select on Slave ****
+#sync_slave_with_master;
+#SELECT c1,hex(c4),c5 FROM t16 ORDER BY c1;
+#
+#--echo *** Drop t16 ***
+#connection master;
+#DROP TABLE t16;
+#sync_slave_with_master;
+
+# Remove the below when bug 30434 is patched
+#*******************************************
+--echo
+--echo *****************
+--echo *** BUG 30434 ***
+--echo *****************
+--echo
+connection slave;
+# 1072 = ER_KEY_COLUMN_DOES_NOT_EXITS
+--let $slave_sql_errno= 1072
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+STOP SLAVE;
+RESET SLAVE;
+
+--echo
+--echo *** Drop t16 ***
+DROP TABLE t16;
+
+connection master;
+DROP TABLE t16;
+RESET MASTER;
+
+connection slave;
+START SLAVE;
+#*******************************************
+
+####################################################
+--echo
+--echo *****************************************************
+--echo * - Delete rows using column on Master not on slave *
+--echo * Expect: Rows Deleted *
+--echo *****************************************************
+--echo
+--echo *** Create t17 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t17 on Master ***
+connection master;
+eval CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+ (2,@b1,'JOE',2,DEFAULT),
+ (3,@b1,'QA',3,DEFAULT);
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
+
+--echo
+--echo ** Select * from Slave **
+sync_slave_with_master;
+SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
+
+--echo
+--echo ** Delete from master **
+connection master;
+DELETE FROM t17 WHERE c6 = 3;
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
+
+--echo
+--echo ** Check slave **
+sync_slave_with_master;
+SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
+
+
+connection master;
+DROP TABLE t17;
+sync_slave_with_master;
+--echo
+
+####################################################
+--echo
+--echo *****************************************************
+--echo * - Update row using column on Master not on slave *
+--echo * Expect: Rows updated *
+--echo *****************************************************
+--echo
+--echo ** Bug30674 **
+--echo
+--echo *** Create t18 on slave ***
+--echo
+
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t18 on Master ***
+connection master;
+eval CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+
+INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+ (2,@b1,'JOE',2,DEFAULT),
+ (3,@b1,'QA',3,DEFAULT);
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
+
+--echo
+--echo ** Select * from Slave **
+sync_slave_with_master;
+SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
+
+--echo
+--echo ** update from master **
+connection master;
+UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
+
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
+
+--echo
+--echo ** Check slave **
+sync_slave_with_master;
+SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
+
+connection master;
+DROP TABLE t18;
+sync_slave_with_master;
+--echo
+
+####################################################
+--echo
+--echo *****************************************************
+--echo * - Insert UUID column on Master not on slave *
+--echo * Expect: Rows inserted *
+--echo *****************************************************
+--echo
+--echo *** Create t5 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+
+--echo
+--echo *** Create t5 on Master ***
+connection master;
+eval CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 LONG,
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+RESET MASTER;
+
+--echo
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
+ (2,@b1,'JOE',UUID(),DEFAULT),
+ (3,@b1,'QA',UUID(),DEFAULT);
+--replace_column 4 UUID 5 TIME
+SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
+
+--echo
+--echo ** Select * from Slave **
+sync_slave_with_master;
+SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
+
+connection master;
+DROP TABLE t5;
+sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test
new file mode 100644
index 00000000000..119e081878c
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test
@@ -0,0 +1,918 @@
+#################################################
+# Purpose: To test having extra columns on the slave.
+##################################################
+
+# Some tests in here requre partitioning
+-- source include/have_partition.inc
+
+#################################################
+############ Different Table Def Test ###########
+#################################################
+# Purpose: To have different table def on the #
+# master and slave. Most of these tests#
+# should stop the slave. #
+#################################################
+
+call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* Error_code: 1677");
+
+--echo **** Diff Table Def Start ****
+
+##############################################
+### Try to replicate w/ PK on diff columns ###
+### Should Stop Slave ###
+##############################################
+
+--echo *** On Slave ***
+sync_slave_with_master;
+STOP SLAVE;
+RESET SLAVE;
+
+SET @saved_slave_type_conversions = @@slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
+
+eval CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(4) DEFAULT 'TEST')
+ ENGINE=$engine_type;
+
+--echo *** Create t1 on Master ***
+connection master;
+eval CREATE TABLE t1 (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 t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
+SELECT * FROM t1 ORDER BY a;
+
+--echo *** Select from slave ***
+sync_slave_with_master;
+SELECT * FROM t1 ORDER BY a;
+
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+
+--echo *** Drop t1 ***
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+
+############################################
+### Try to replicate CHAR(10) to CHAR(5) ###
+### Should Stop Slave or truncate value ###
+############################################
+
+## 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 *** 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;
+--let $slave_sql_errno= 1677
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+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 ###
+### Should Stop Slave ###
+####################################
+--echo *** Create t3 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t3 (a INT, b INT PRIMARY KEY, c CHAR(20),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(5) DEFAULT 'TEST2')
+ ENGINE=$engine_type;
+
+--echo *** Create t3 on Master ***
+connection master;
+eval CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+set @b1 = 'b1';
+set @b1 = concat(@b1,@b1);
+
+INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Drop t3 ***
+connection master;
+DROP TABLE t3;
+sync_slave_with_master;
+
+#####################################################
+# Columns with different types, more columns at end #
+# Expect: proper error message (wrong types) #
+#####################################################
+
+--echo *** Create t4 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t4 (a INT, b INT PRIMARY KEY, c CHAR(20),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(5) DEFAULT 'TEST2')
+ ENGINE=$engine_type;
+
+--echo *** Create t4 on Master ***
+connection master;
+eval CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
+ (30000.22,4,'QA TESTING');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Drop t4 ***
+connection master;
+DROP TABLE t4;
+sync_slave_with_master;
+
+#######################################################
+# Columns with different types, same number of colums #
+# Expect: Proper error message #
+#######################################################
+
+--echo *** Create t5 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
+ c FLOAT, d INT, e DOUBLE,
+ f DECIMAL(8,2))ENGINE=$engine_type;
+
+--echo *** Create t5 on Master ***
+connection master;
+eval CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
+ c DECIMAL(8,2), d BIT, e BLOB,
+ f FLOAT) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
+ (2,'JOE',300.01,0,'b2b2',1.0000009);
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Drop t5 ***
+connection master;
+DROP TABLE t5;
+sync_slave_with_master;
+
+#######################################################
+################## Continued ##########################
+#######################################################
+# Columns with different types, same number of colums #
+# Expect: Proper error message #
+#######################################################
+
+--echo *** Create t6 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
+ c FLOAT, d INT)ENGINE=$engine_type;
+
+--echo *** Create t6 on Master ***
+connection master;
+eval CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
+ c DECIMAL(8,2), d BIT
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+
+INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
+ (2,'JOE',300.01,0);
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
+
+--echo *** Drop t6 ***
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
+
+connection master;
+DROP TABLE t6;
+--sync_slave_with_master
+
+
+--echo **** Diff Table Def End ****
+
+#######################################
+#### Extra Column on Slave Testing ####
+#######################################
+# Purpose: To test extra colums on the#
+# Slave #
+#######################################
+
+--echo **** Extra Colums Start ****
+
+##########################################
+# More columns in slave at end of table, #
+# added columns have default values #
+# Expect: it should work, default values #
+# should be used #
+##########################################
+
+--echo *** Create t7 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval 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=$engine_type;
+
+--echo *** Create t7 on Master ***
+connection master;
+eval CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+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;
+
+--echo *** Select from slave ***
+sync_slave_with_master;
+SELECT * FROM t7 ORDER BY a;
+
+--echo *** Drop t7 ***
+connection master;
+DROP TABLE t7;
+sync_slave_with_master;
+
+###########################################
+# More columns in slave at end of table, #
+# added columns do not have default values#
+# Expect: Proper error message #
+###########################################
+# NOTE: This should fail but currently #
+# works. BUG#22101 #
+###########################################
+--echo *** Create t8 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
+ d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
+ e INT)ENGINE=$engine_type;
+
+--echo *** Create t8 on Master ***
+connection master;
+eval CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+
+### Uncomment once bug is fixed
+
+#connection slave;
+#--let $slave_sql_errno= SOMETHING
+#--let $slave_skip_counter= 2
+#--let $show_slave_sql_error= 1
+#--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Drop t8 ***
+connection master;
+DROP TABLE t8;
+sync_slave_with_master;
+
+###########################################
+############# Continued ###################
+# More columns in slave at end of table, #
+# added columns do not have default values#
+# Expect: Proper error message #
+###########################################
+# Bug#22234, Bug#23907 Extra Slave Col is not
+# erroring on extra col with no default values.
+###############################################################
+# Error reaction is up to sql_mode of the slave sql (bug#38173)
+#--echo *** Create t9 on slave ***
+# Please, check BUG#47741 to see why you are not testing NDB.
+if (`SELECT UPPER(LEFT($engine_type, 3)) != 'NDB'`)
+{
+ STOP SLAVE;
+ RESET SLAVE;
+ eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
+ d TIMESTAMP,
+ e INT NOT NULL,
+ f text not null,
+ g text,
+ h blob not null,
+ i blob) ENGINE=$engine_type;
+
+ --echo *** Create t9 on Master ***
+ connection master;
+ eval CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+ RESET MASTER;
+
+ --echo *** Start Slave ***
+ connection slave;
+ START SLAVE;
+
+ --echo *** Master Data Insert ***
+ connection master;
+ set @b1 = 'b1b1b1b1';
+
+ set @b1 = concat(@b1,@b1);
+ INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+
+ # the test would stop slave if @@sql_mode for the sql thread
+ # was set to strict. Otherwise, as with this tests setup,
+ # the implicit defaults will be inserted into fields even though
+ # they are declared without DEFAULT clause.
+
+ sync_slave_with_master;
+ select * from t9;
+
+ # todo: fix Bug #43992 slave sql thread can't tune own sql_mode ...
+ # and add/restore waiting for stop test
+
+ #--let $slave_sql_errno= SOMETHING
+ #--let $slave_skip_counter= 2
+ #--let $show_slave_sql_error= 1
+ #--source include/wait_for_slave_sql_error_and_skip.inc
+
+ #--echo *** Drop t9 ***
+ connection master;
+ DROP TABLE t9;
+ sync_slave_with_master;
+
+}
+
+############################################
+# More columns in slave at middle of table #
+# Expect: Proper error message #
+############################################
+--echo *** Create t10 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+ c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type;
+
+--echo *** Create t10 on Master ***
+connection master;
+eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Drop t10 ***
+connection master;
+DROP TABLE t10;
+sync_slave_with_master;
+
+############################################
+############## Continued ###################
+############################################
+# More columns in slave at middle of table #
+# Expect: Proper error message #
+############################################
+--echo *** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
+ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
+
+--echo *** Create t11 on Master ***
+connection master;
+eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Drop t11 ***
+connection master;
+DROP TABLE t11;
+sync_slave_with_master;
+
+############################################
+############## Continued ###################
+############################################
+# More columns in slave at middle of table #
+# Expect: This one should pass blob-text #
+############################################
+--echo *** Create t12 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+ c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type;
+
+--echo *** Create t12 on Master ***
+connection master;
+eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+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;
+
+--echo *** Select on Slave ***
+sync_slave_with_master;
+SELECT * FROM t12 ORDER BY a;
+
+--echo *** Drop t12 ***
+connection master;
+DROP TABLE t12;
+sync_slave_with_master;
+
+--echo **** Extra Colums End ****
+
+###############################
+# BUG#22177 CURRENT_TIMESTAMP #
+# Sould work with ^ #
+###############################
+--echo *** BUG 22177 Start ***
+--echo *** Create t13 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t13 (a INT KEY, b BLOB, c CHAR(5),
+ d INT DEFAULT '1',
+ e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+--echo *** Create t13 on Master ***
+connection master;
+eval CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+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;
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT * FROM t13 ORDER BY a;
+
+--echo *** Drop t13 ***
+connection master;
+DROP TABLE t13;
+sync_slave_with_master;
+
+--echo *** 22117 END ***
+
+##############################
+# ALTER MASTER TABLE TESTING #
+##############################
+
+--echo *** Alter Master Table Testing Start ***
+
+####################################################
+# - Alter Master adding columns at middle of table #
+# Expect: columns added #
+####################################################
+
+--echo *** Create t14 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+--echo *** Create t14 on Master ***
+connection master;
+eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+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;
+
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT * FROM t14 ORDER BY c1;
+
+####################################################
+# - Alter Master drop column at end of table #
+# Expect: column dropped #
+####################################################
+
+--echo *** Create t14a on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+ c6 INT DEFAULT '1',
+ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+ )ENGINE=$engine_type;
+
+--echo *** Create t14a on Master ***
+connection master;
+eval CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+ ) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14a () VALUES(1,@b1,'Kyle'),
+ (2,@b1,'JOE'),
+ (3,@b1,'QA');
+
+SELECT * FROM t14a ORDER BY c1;
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT * FROM t14a ORDER BY c1;
+STOP SLAVE;
+RESET SLAVE;
+
+--echo *** Master Drop c5 ***
+connection master;
+ALTER TABLE t14a DROP COLUMN c5;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+
+INSERT INTO t14a () VALUES(4,@b1),
+ (5,@b1),
+ (6,@b1);
+SELECT * FROM t14a ORDER BY c1;
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT * FROM t14a ORDER BY c1;
+
+--connection master
+DROP TABLE t14a;
+--sync_slave_with_master
+
+####################################################
+# - Alter Master Dropping columns from the middle. #
+# Expect: columns dropped #
+####################################################
+
+--echo *** connect to master and drop columns ***
+connection master;
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c4;
+--echo *** Select from Master ***
+SELECT * FROM t14 ORDER BY c1;
+
+--echo *** Select from Slave ***
+sync_slave_with_master;
+--replace_column 5 CURRENT_TIMESTAMP
+SELECT * FROM t14 ORDER BY c1;
+
+--echo *** Drop t14 ***
+connection master;
+DROP TABLE t14;
+sync_slave_with_master;
+
+##############################################################
+# - Alter Master adding columns that already exist on slave. #
+# Expect: proper error message #
+##############################################################
+
+--echo *** Create t15 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval 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=$engine_type;
+
+--echo *** Create t15 on Master ***
+connection master;
+eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+ c4 BLOB, c5 CHAR(5)) ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+call mtr.add_suppression("Error .Unknown table .t6.. on query.* Error_code: 1051");
+call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* Error_code: 1060");
+call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535");
+
+--echo *** Master Data Insert ***
+connection master;
+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;
+
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT * FROM t15 ORDER BY c1;
+
+--echo *** Add column on master that is a Extra on Slave ***
+connection master;
+ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1060 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1060
+--let $slave_skip_counter= 1
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo *** Try to insert in master ****
+connection master;
+INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
+SELECT * FROM t15 ORDER BY c1;
+
+#SHOW BINLOG EVENTS;
+
+--echo *** Try to select from slave ****
+sync_slave_with_master;
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT * FROM t15 ORDER BY c1;
+
+--echo *** DROP TABLE t15 ***
+connection master;
+DROP TABLE t15;
+sync_slave_with_master;
+
+####################################
+# - Alter Master and ADD PARTITION #
+# Expect:? #
+####################################
+
+--echo *** Create t16 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval 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=$engine_type;
+
+--echo *** Create t16 on Master ***
+connection master;
+eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
+ c4 BLOB, c5 CHAR(5))ENGINE=$engine_type;
+RESET MASTER;
+
+--echo *** Start Slave ***
+connection slave;
+START SLAVE;
+
+--echo *** Master Data Insert ***
+connection master;
+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;
+
+--echo *** Select on Slave ****
+sync_slave_with_master;
+--replace_column 7 CURRENT_TIMESTAMP
+SELECT * FROM t16 ORDER BY c1;
+
+--echo *** Add Partition on master ***
+connection 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;
+
+--echo *** Show table on Slave ****
+sync_slave_with_master;
+SHOW CREATE TABLE t16;
+
+--echo *** DROP TABLE t16 ***
+connection master;
+DROP TABLE t16;
+sync_slave_with_master;
+
+--echo *** Alter Master End ***
+
+############################################
+### Try to replicate BIGINT to SMALLINT ###
+### Should Stop Slave ###
+############################################
+
+--echo *** Create t17 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+eval CREATE TABLE t17 (a SMALLINT, b INT PRIMARY KEY, c CHAR(5),
+ d FLOAT DEFAULT '2.00',
+ e CHAR(5) DEFAULT 'TEST2')
+ ENGINE=$engine_type;
+
+--echo *** Create t17 on Master ***
+connection master;
+eval CREATE TABLE t17 (a BIGINT 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 t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
+
+--echo ********************************************
+--echo *** Expect slave to fail with Error 1677 ***
+--echo ********************************************
+connection slave;
+--let $slave_sql_errno= 1677
+--let $slave_skip_counter= 2
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+--echo ** DROP table t17 ***
+connection master;
+DROP TABLE t17;
+sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_failed_optimize.test b/mysql-test/extra/rpl_tests/rpl_failed_optimize.test
index cd81f2497b8..af048aeb92a 100644
--- a/mysql-test/extra/rpl_tests/rpl_failed_optimize.test
+++ b/mysql-test/extra/rpl_tests/rpl_failed_optimize.test
@@ -2,24 +2,27 @@
#
# BUG#5551 "Failed OPTIMIZE TABLE is logged to binary log"
-# Replication should work when OPTIMIZE TABLE timeouts, and
-# when OPTIMIZE TABLE is executed on a non-existing table
+# Replication should work when when OPTIMIZE TABLE is
+# executed on a non-existing table.
#
+# Due to patch for BUG#989, checking that an OPTIMIZE
+# that fails due to a lock wait timeout on an InnoDB table
+# is not valid anymore, as an mdl lock is hit before,
+# thence no timeout occurs, but instead a deadlock.
+#
+
eval CREATE TABLE t1 ( a int ) ENGINE=$engine_type;
BEGIN;
INSERT INTO t1 VALUES (1);
connection master1;
-OPTIMIZE TABLE t1;
-
OPTIMIZE TABLE non_existing;
sync_slave_with_master;
-# End of 4.1 tests
-
connection master;
select * from t1;
commit;
drop table t1;
--- sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
index fd51601176e..06253c5defb 100644
--- a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
+++ b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test
@@ -54,7 +54,6 @@ unlock tables;
connection master;
drop table t3, t4, t5;
-sync_slave_with_master;
-
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_foreign_key.test b/mysql-test/extra/rpl_tests/rpl_foreign_key.test
index ea16237435c..db646a736f9 100644
--- a/mysql-test/extra/rpl_tests/rpl_foreign_key.test
+++ b/mysql-test/extra/rpl_tests/rpl_foreign_key.test
@@ -59,6 +59,4 @@ select count(*) from t1 /* must be zero */;
connection master;
drop table t2,t1;
-sync_slave_with_master;
-
-
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test
index 66bd61a8ea9..01036f72785 100644
--- a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test
+++ b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test
@@ -34,34 +34,22 @@
#
connection slave;
-if (`SELECT $debug_sync_action = ''`)
+if (!$debug_sync_action)
{
--die Cannot continue. Please set value for debug_sync_action.
}
# Restart slave
---disable_warnings
-stop slave;
-source include/wait_for_slave_to_stop.inc;
+--source include/stop_slave.inc
eval SET @@global.debug= "+d,$dbug_sync_point";
-start slave;
-source include/wait_for_slave_to_start.inc;
+--source include/start_slave.inc
--echo slave is going to hang in get_master_version_and_clock
-connection master;
-# Write file to make mysql-test-run.pl expect the "crash", but don't start
-# it until it's told to
---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait
-EOF
+--let $rpl_server_number= 1
+--source include/rpl_stop_server.inc
-# Send shutdown to the connected server and give
-# it 10 seconds to die before zapping it
-shutdown_server 10;
-
-connection slave;
--echo slave is unblocked
eval SET DEBUG_SYNC=$debug_sync_action;
@@ -76,6 +64,7 @@ connection slave;
# '1040' ER_CON_COUNT_ERROR
# '1053' ER_SERVER_SHUTDOWN
let $slave_io_errno= 1040, 1053, 2002, 2003, 2006, 2013;
+--let $slave_io_error_is_nonfatal= 1
source include/wait_for_slave_io_error.inc;
# deactivate the sync point of get_master_version_and_clock()
@@ -84,21 +73,12 @@ source include/wait_for_slave_io_error.inc;
# unset.
eval set @@global.debug = "-d,$dbug_sync_point";
-# Write file to make mysql-test-run.pl start up the server again
---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart
-EOF
-
-connection master;
-# Turn on reconnect
---enable_reconnect
-
-# Call script that will poll the server waiting for it to be back online again
---source include/wait_until_connected_again.inc
-
-# Turn off reconnect again
---disable_reconnect
-
-connection slave;
-source include/wait_for_slave_to_start.inc;
+--let $rpl_server_number= 1
+--source include/rpl_start_server.inc
+# We don't source include/wait_for_slave_io_to_start.inc, because the
+# IO thread has an error and wait_for_slave_io_to_start.inc fails if
+# the IO thread has an error.
+--let $slave_param= Slave_IO_Running
+--let $slave_param_value= Yes
+--source include/wait_for_slave_param.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test
index 14368ba4321..549d184185d 100644
--- a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test
+++ b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test
@@ -33,11 +33,11 @@ INSERT INTO tt_2(ddl_case) VALUES(0);
--echo #########################################################################
SET AUTOCOMMIT= 0;
let $ddl_cases= 41;
-while (`SELECT $ddl_cases >= 1`)
+while ($ddl_cases >= 1)
{
--echo -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
- let $in_temporary= "no";
- let $ok= "yes";
+ let $in_temporary= no;
+ let $ok= yes;
#
# In SBR and MIXED modes, the commit event is usually the third event in the
# binary log:
@@ -76,7 +76,7 @@ while (`SELECT $ddl_cases >= 1`)
# 6: ROW EVENT
# 7: COMMIT
#
- if (`select '$engine' = 'NDB'`)
+ if ($engine == NDB)
{
let $commit_event_row_number= 7;
}
@@ -84,18 +84,18 @@ while (`SELECT $ddl_cases >= 1`)
let $first_binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1);
--enable_query_log
eval INSERT INTO tt_1(ddl_case) VALUES ($ddl_cases);
- if (`SELECT $ddl_cases = 41`)
+ if ($ddl_cases == 41)
{
let $cmd= LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES;
- if (`SELECT '$engine' = 'NDB'`)
+ if ($engine == NDB)
{
# This seems to be related to epochs.
# We need to check this against an updated version or avoid it.
- let $ok= "no";
+ let $ok= no;
let $commit_event_row_number= 6;
}
}
- if (`SELECT $ddl_cases = 40`)
+ if ($ddl_cases == 40)
{
let $cmd= LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES;
#
@@ -109,16 +109,16 @@ while (`SELECT $ddl_cases >= 1`)
# 5: ROW EVENT
# 6: COMMIT
#
- if (`SELECT '$engine' = 'NDB'`)
+ if ($engine == NDB)
{
let $commit_event_row_number= 6;
}
}
- if (`SELECT $ddl_cases = 39`)
+ if ($ddl_cases == 39)
{
let $cmd= ANALYZE TABLE nt_1;
}
- if (`SELECT $ddl_cases = 38`)
+ if ($ddl_cases == 38)
{
let $cmd= CHECK TABLE nt_1;
#
@@ -132,20 +132,20 @@ while (`SELECT $ddl_cases >= 1`)
# 5: ROW EVENT
# 6: COMMIT
#
- if (`SELECT '$engine' = 'NDB'`)
+ if ($engine == NDB)
{
let $commit_event_row_number= 6;
}
}
- if (`SELECT $ddl_cases = 37`)
+ if ($ddl_cases == 37)
{
let $cmd= OPTIMIZE TABLE nt_1;
}
- if (`SELECT $ddl_cases = 36`)
+ if ($ddl_cases == 36)
{
let $cmd= REPAIR TABLE nt_1;
}
- if (`SELECT $ddl_cases = 35`)
+ if ($ddl_cases == 35)
{
let $cmd= LOCK TABLES tt_1 WRITE;
#
@@ -159,12 +159,12 @@ while (`SELECT $ddl_cases >= 1`)
# 5: ROW EVENT
# 6: COMMIT
#
- if (`SELECT '$engine' = 'NDB'`)
+ if ($engine == NDB)
{
let $commit_event_row_number= 6;
}
}
- if (`SELECT $ddl_cases = 34`)
+ if ($ddl_cases == 34)
{
let $cmd= UNLOCK TABLES;
#
@@ -178,20 +178,20 @@ while (`SELECT $ddl_cases >= 1`)
# 5: ROW EVENT
# 6: COMMIT
#
- if (`SELECT '$engine' = 'NDB'`)
+ if ($engine == NDB)
{
let $commit_event_row_number= 6;
}
}
- if (`SELECT $ddl_cases = 33`)
+ if ($ddl_cases == 33)
{
let $cmd= CREATE USER 'user'@'localhost';
}
- if (`SELECT $ddl_cases = 32`)
+ if ($ddl_cases == 32)
{
let $cmd= GRANT ALL ON *.* TO 'user'@'localhost';
}
- if (`SELECT $ddl_cases = 31`)
+ if ($ddl_cases == 31)
{
let $cmd= SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass');
#
@@ -231,35 +231,35 @@ while (`SELECT $ddl_cases >= 1`)
let $commit_event_row_number= 7;
}
}
- if (`SELECT $ddl_cases = 30`)
+ if ($ddl_cases == 30)
{
let $cmd= REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost';
}
- if (`SELECT $ddl_cases = 29`)
+ if ($ddl_cases == 29)
{
let $cmd= RENAME USER 'user'@'localhost' TO 'user_new'@'localhost';
}
- if (`SELECT $ddl_cases = 28`)
+ if ($ddl_cases == 28)
{
let $cmd= DROP USER 'user_new'@'localhost';
}
- if (`SELECT $ddl_cases = 27`)
+ if ($ddl_cases == 27)
{
let $cmd= CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1;
}
- if (`SELECT $ddl_cases = 26`)
+ if ($ddl_cases == 26)
{
let $cmd= ALTER EVENT evt COMMENT 'evt';
}
- if (`SELECT $ddl_cases = 25`)
+ if ($ddl_cases == 25)
{
let $cmd= DROP EVENT evt;
}
- if (`SELECT $ddl_cases = 24`)
+ if ($ddl_cases == 24)
{
let $cmd= CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
}
- if (`SELECT $ddl_cases = 23`)
+ if ($ddl_cases == 23)
{
let $cmd= DROP TRIGGER tr;
#
@@ -277,43 +277,43 @@ while (`SELECT $ddl_cases >= 1`)
let $commit_event_row_number= 5;
}
}
- if (`SELECT $ddl_cases = 22`)
+ if ($ddl_cases == 22)
{
let $cmd= CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc";
}
- if (`SELECT $ddl_cases = 21`)
+ if ($ddl_cases == 21)
{
let $cmd= ALTER FUNCTION fc COMMENT 'fc';
}
- if (`SELECT $ddl_cases = 20`)
+ if ($ddl_cases == 20)
{
let $cmd= DROP FUNCTION fc;
}
- if (`SELECT $ddl_cases = 19`)
+ if ($ddl_cases == 19)
{
let $cmd= CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
}
- if (`SELECT $ddl_cases = 18`)
+ if ($ddl_cases == 18)
{
let $cmd= ALTER PROCEDURE pc COMMENT 'pc';
}
- if (`SELECT $ddl_cases = 17`)
+ if ($ddl_cases == 17)
{
let $cmd= DROP PROCEDURE pc;
}
- if (`SELECT $ddl_cases = 16`)
+ if ($ddl_cases == 16)
{
let $cmd= CREATE VIEW v AS SELECT * FROM tt_1;
}
- if (`SELECT $ddl_cases = 15`)
+ if ($ddl_cases == 15)
{
let $cmd= ALTER VIEW v AS SELECT * FROM tt_1;
}
- if (`SELECT $ddl_cases = 14`)
+ if ($ddl_cases == 14)
{
let $cmd= DROP VIEW v;
}
- if (`SELECT $ddl_cases = 13`)
+ if ($ddl_cases == 13)
{
let $cmd= CREATE INDEX ix ON tt_1(ddl_case);
#
@@ -328,12 +328,12 @@ while (`SELECT $ddl_cases >= 1`)
# 6: COMMIT
# 7: DDL EVENT which triggered the previous commmit.
#
- if (`SELECT '$engine' = 'NDB'`)
+ if ($engine == NDB)
{
let $commit_event_row_number= 6;
}
}
- if (`SELECT $ddl_cases = 12`)
+ if ($ddl_cases == 12)
{
let $cmd= DROP INDEX ix ON tt_1;
#
@@ -348,15 +348,15 @@ while (`SELECT $ddl_cases >= 1`)
# 6: COMMIT
# 7: DDL EVENT which triggered the previous commmit.
#
- if (`SELECT '$engine' = 'NDB'`)
+ if ($engine == NDB)
{
let $commit_event_row_number= 6;
}
}
- if (`SELECT $ddl_cases = 11`)
+ if ($ddl_cases == 11)
{
let $cmd= CREATE TEMPORARY TABLE tt_xx (a int);
- let $in_temporary= "yes";
+ let $in_temporary= yes;
# In SBR and MIXED modes, the DDL statement is written to the binary log but
# does not commit the current transaction.
#
@@ -411,7 +411,7 @@ while (`SELECT $ddl_cases >= 1`)
let $commit_event_row_number= 9;
}
}
- if (`SELECT $ddl_cases = 10`)
+ if ($ddl_cases == 10)
{
let $cmd= ALTER TABLE tt_xx ADD COLUMN (b int);
#
@@ -438,12 +438,12 @@ while (`SELECT $ddl_cases >= 1`)
# 5: ROW EVENT
# 6: COMMIT
#
- if (`SELECT '$engine' = 'NDB'`)
+ if ($engine == NDB)
{
let $commit_event_row_number= 6;
}
}
- if (`SELECT $ddl_cases = 9`)
+ if ($ddl_cases == 9)
{
let $cmd= ALTER TABLE tt_xx RENAME new_tt_xx;
#
@@ -470,15 +470,15 @@ while (`SELECT $ddl_cases >= 1`)
# 5: ROW EVENT
# 6: COMMIT
#
- if (`SELECT '$engine' = 'NDB'`)
+ if ($engine == NDB)
{
let $commit_event_row_number= 6;
}
}
- if (`SELECT $ddl_cases = 8`)
+ if ($ddl_cases == 8)
{
let $cmd= DROP TEMPORARY TABLE IF EXISTS new_tt_xx;
- let $in_temporary= "yes";
+ let $in_temporary= yes;
#
# In SBR and MIXED modes, the DDL statement is written to the binary log
# but does not commit the current transaction:
@@ -528,7 +528,7 @@ while (`SELECT $ddl_cases >= 1`)
# 8: ROW EVENT
# 9: COMMIT
#
- if (`SELECT '$engine' = 'NDB'`)
+ if ($engine == NDB)
{
let $commit_event_row_number= 9;
}
@@ -551,27 +551,27 @@ while (`SELECT $ddl_cases >= 1`)
let $commit_event_row_number= 9;
}
}
- if (`SELECT $ddl_cases = 7`)
+ if ($ddl_cases == 7)
{
let $cmd= CREATE TABLE tt_xx (a int);
}
- if (`SELECT $ddl_cases = 6`)
+ if ($ddl_cases == 6)
{
let $cmd= ALTER TABLE tt_xx ADD COLUMN (b int);
}
- if (`SELECT $ddl_cases = 5`)
+ if ($ddl_cases == 5)
{
let $cmd= RENAME TABLE tt_xx TO new_tt_xx;
}
- if (`SELECT $ddl_cases = 4`)
+ if ($ddl_cases == 4)
{
let $cmd= TRUNCATE TABLE new_tt_xx;
}
- if (`SELECT $ddl_cases = 3`)
+ if ($ddl_cases == 3)
{
let $cmd= DROP TABLE IF EXISTS tt_xx, new_tt_xx;
}
- if (`SELECT $ddl_cases = 2`)
+ if ($ddl_cases == 2)
{
let $cmd= CREATE DATABASE db;
#
@@ -586,12 +586,12 @@ while (`SELECT $ddl_cases >= 1`)
# 6: COMMIT
# 7: DDL EVENT which triggered the previous commmit.
#
- if (`SELECT '$engine' = 'NDB'`)
+ if ($engine == NDB)
{
let $commit_event_row_number= 6;
}
}
- if (`SELECT $ddl_cases = 1`)
+ if ($ddl_cases == 1)
{
let $cmd= DROP DATABASE IF EXISTS db;
#
@@ -606,7 +606,7 @@ while (`SELECT $ddl_cases >= 1`)
# 6: COMMIT
# 7: DDL EVENT which triggered the previous commmit.
#
- if (`SELECT '$engine' = 'NDB'`)
+ if ($engine == NDB)
{
let $commit_event_row_number= 6;
}
@@ -618,14 +618,14 @@ while (`SELECT $ddl_cases >= 1`)
# commit. The flag in_temporary is used to avoid aborting the test in such
# cases. Thus we force the commit.
#
- if (`SELECT $in_temporary = "yes"`)
+ if ($in_temporary == yes)
{
--eval COMMIT
}
let $event_commit= query_get_value("SHOW BINLOG EVENTS FROM $first_binlog_position", Info, $commit_event_row_number);
if (`SELECT SUBSTRING("$event_commit",1,6) != "COMMIT"`)
{
- if (`SELECT $ok = "yes"`)
+ if ($ok == yes)
{
--echo it *does not* commit the current transaction.
--echo $cmd
@@ -649,8 +649,7 @@ SET AUTOCOMMIT= 1;
--echo ###################################################################################
--sync_slave_with_master
---let $diff_table_1= master:test.tt_1
---let $diff_table_2= slave:test.tt_1
+--let $diff_tables= master:tt_1,slave:tt_1
--source include/diff_tables.inc
--echo ###################################################################################
diff --git a/mysql-test/extra/rpl_tests/rpl_innodb.test b/mysql-test/extra/rpl_tests/rpl_innodb.test
index 2eee3402da9..c0ec5299cfd 100644
--- a/mysql-test/extra/rpl_tests/rpl_innodb.test
+++ b/mysql-test/extra/rpl_tests/rpl_innodb.test
@@ -181,5 +181,3 @@ DROP TABLE t1;
DROP TABLE t3;
--echo End of 6.0 tests
-
---source include/master-slave-end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test
index 46c1df0c88b..5b0b52c3106 100644
--- a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test
+++ b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test
@@ -121,7 +121,7 @@ if (`SELECT @@global.binlog_format = 'STATEMENT'`)
# The second INSERT DELAYED statement is the 5 item if two INSERT DELAYED are
# handled separately
- if (`SELECT '$stmt' = 'COMMIT'`)
+ if ($stmt == COMMIT)
{
--let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 5)
}
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_duplicate.test b/mysql-test/extra/rpl_tests/rpl_insert_duplicate.test
new file mode 100644
index 00000000000..a81eeba3231
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_insert_duplicate.test
@@ -0,0 +1,59 @@
+# BUG#59338 Inconsistency in binlog for statements that don't change any rows STATEMENT SBR
+# In SBR, if a statement does not fail, it is always written to the binary log,
+# regardless if rows are changed or not. If there is a failure, a statement is
+# only written to the binary log if a non-transactional (.e.g. MyIsam) engine
+# is updated. INSERT ON DUPLICATE KEY UPDATE was not following the rule above
+# and was not written to the binary log, if then engine was Innodb.
+#
+# In this test case, we check if INSERT ON DUPLICATE KEY UPDATE that does not
+# change anything is still written to the binary log.
+
+# Prepare environment
+--connection master
+
+eval CREATE TABLE t1 (
+ a INT UNSIGNED NOT NULL PRIMARY KEY
+) ENGINE=$engine_type;
+
+eval CREATE TABLE t2 (
+ a INT UNSIGNED
+) ENGINE=$engine_type;
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+# An insert duplicate that does not update anything must be written to the binary
+# log in SBR and MIXED modes. We check this property by summing a before and after
+# the update and comparing the binlog positions. The sum should be the same at both
+# points and the statement should be in the binary log.
+--let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
+--let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1)
+--let $statement_file=INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a
+--eval $statement_file
+
+--let $assert_cond= SUM(a) = 1 FROM t1
+--let $assert_text= Sum of elements in t1 should be 1.
+--source include/assert.inc
+
+if (`SELECT @@BINLOG_FORMAT = 'ROW'`)
+{
+ --let $binlog_position_cmp= =
+ --let $assert_cond= [SHOW MASTER STATUS, Position, 1] $binlog_position_cmp $binlog_start
+ --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
+}
+if (`SELECT @@BINLOG_FORMAT != 'ROW'`)
+{
+ --let $assert_cond= \'[\'SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_start LIMIT 1, 1\', Info, 1]\' LIKE \'%$statement_file\'
+ --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
+}
+--source include/assert.inc
+
+# Compare master and slave
+--sync_slave_with_master
+--let $diff_tables= master:test.t1 , slave:test.t1
+--source include/diff_tables.inc
+
+# Clean up
+--connection master
+drop table t1, t2;
+--sync_slave_with_master
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id.test b/mysql-test/extra/rpl_tests/rpl_insert_id.test
index b542ff27231..565ab4a67ad 100644
--- a/mysql-test/extra/rpl_tests/rpl_insert_id.test
+++ b/mysql-test/extra/rpl_tests/rpl_insert_id.test
@@ -1,6 +1,4 @@
###########################################################
-# 2006-02-01: By JBM: Added 1022, ORDER BY
-###########################################################
# See if queries that use both auto_increment and LAST_INSERT_ID()
# are replicated well
############################################################
@@ -9,17 +7,10 @@
# column and index but without primary key.
##############################################################
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-
--echo #
--echo # Setup
--echo #
-use test;
---disable_warnings
-drop table if exists t1, t2, t3;
---enable_warnings
-
--echo #
--echo # See if queries that use both auto_increment and LAST_INSERT_ID()
--echo # are replicated well
@@ -30,6 +21,13 @@ drop table if exists t1, t2, t3;
-- source include/master-slave.inc
#should work for both SBR and RBR
+--disable_query_log
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--connection slave
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--enable_query_log
+
+
# If concurrent inserts are on, it is not guaranteed that the rows
# inserted by INSERT are immediately accessible by SELECT in another
# thread. This would cause problems near the line 'connection master1'
@@ -44,9 +42,7 @@ eval create table t2(b int auto_increment, c int, key(b)) engine=$engine_type;
insert into t1 values (1),(2),(3);
insert into t1 values (null);
insert into t2 values (null,last_insert_id());
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
@@ -65,9 +61,7 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 values (null,last_insert_id());
SET FOREIGN_KEY_CHECKS=1;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
@@ -85,17 +79,13 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 (c) select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
drop table t1;
drop table t2;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
--echo #
--echo # Bug#8412: Error codes reported in binary log for CHARACTER SET,
@@ -215,9 +205,7 @@ call foo();
select * from t1;
select * from t2;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
@@ -562,4 +550,5 @@ drop table t1, t2;
drop procedure foo;
SET @@global.concurrent_insert= @old_concurrent_insert;
set @@session.sql_auto_is_null=default;
-sync_slave_with_master;
+
+--source include/rpl_end.inc
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 0be33a46c04..c3ecd9381c9 100644
--- a/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test
+++ b/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test
@@ -1,6 +1,4 @@
###########################################################
-# 2006-02-08: By JBM:
-###########################################################
# See if queries that use both auto_increment and LAST_INSERT_ID()
# are replicated well
############################################################
@@ -14,15 +12,12 @@
-- source include/master-slave.inc
#should work for both SBR and RBR
-connection master;
create table t1(a int auto_increment, primary key(a));
create table t2(b int auto_increment, c int, primary key(b));
insert into t1 values (1),(2),(3);
insert into t1 values (null);
insert into t2 values (null,last_insert_id());
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
@@ -41,9 +36,7 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 values (null,last_insert_id());
SET FOREIGN_KEY_CHECKS=1;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
@@ -59,17 +52,13 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 (c) select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
drop table t1;
drop table t2;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
#
# Bug#8412: Error codes reported in binary log for CHARACTER SET,
@@ -82,6 +71,10 @@ SET FOREIGN_KEY_CHECKS=0;
# Duplicate Key Errors codes
--error 1022, ER_DUP_ENTRY
INSERT INTO t1 VALUES (1),(1);
-drop table t1;
sync_slave_with_master;
+connection master;
+drop table t1;
+
# End of 4.1 tests
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_insert_ignore.test b/mysql-test/extra/rpl_tests/rpl_insert_ignore.test
index ee09c316354..270dde7675c 100644
--- a/mysql-test/extra/rpl_tests/rpl_insert_ignore.test
+++ b/mysql-test/extra/rpl_tests/rpl_insert_ignore.test
@@ -5,6 +5,7 @@
# Slave needs to be started with --innodb to store table in InnoDB.
# Same test for MyISAM (which had no bug).
+--connection master
eval CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned,
@@ -32,40 +33,44 @@ INSERT INTO t2 VALUES (5, 4);
INSERT INTO t2 VALUES (6, 6);
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
-
-# Compare results
-
-SELECT * FROM t1 ORDER BY a;
-
-sync_slave_with_master;
-SELECT * FROM t1 ORDER BY a;
-
-# Now do the same for MyISAM
-
-connection master;
-drop table t1;
-eval CREATE TABLE t1 (
- a int unsigned not null auto_increment primary key,
- b int unsigned,
- unique (b)
-) ENGINE=$engine_type2;
-
-INSERT INTO t1 VALUES (1, 1);
-INSERT INTO t1 VALUES (2, 2);
-INSERT INTO t1 VALUES (3, 3);
-INSERT INTO t1 VALUES (4, 4);
-
---disable_warnings
-INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
---enable_warnings
-
-SELECT * FROM t1 ORDER BY a;
-
-sync_slave_with_master;
-SELECT * FROM t1 ORDER BY a;
-
-connection master;
+--let $assert_cond= COUNT(*) = 6 FROM t1
+--let $assert_text= Count of elements in t1 should be 6.
+--source include/assert.inc
+
+# Compare master and slave
+--sync_slave_with_master
+--let $diff_tables= master:test.t1 , slave:test.t1
+--source include/diff_tables.inc
+
+# BUG#59338 Inconsistency in binlog for statements that don't change any rows STATEMENT SBR
+# An insert ignore that does not update anything must be written to the binary log in SBR
+# and MIXED modes. We check this property by counting occurrences in t1 before and after
+# the insert and comparing the binlog positions. The count should be the same in both points
+# and the statement should be in the binary log.
+--connection master
+--let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
+--let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1)
+--let $statement_file=INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a
+--eval $statement_file
+
+--let $assert_cond= COUNT(*) = 6 FROM t1
+--let $assert_text= Count of elements in t1 should be 6.
+--source include/assert.inc
+
+if (`SELECT @@BINLOG_FORMAT = 'ROW'`)
+{
+ --let $binlog_position_cmp= =
+ --let $assert_cond= [SHOW MASTER STATUS, Position, 1] $binlog_position_cmp $binlog_start
+ --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
+}
+if (`SELECT @@BINLOG_FORMAT != 'ROW'`)
+{
+ --let $assert_cond= \'[\'SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_start LIMIT 2, 1\', Info, 1]\' LIKE \'%$statement_file\'
+ --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
+}
+--source include/assert.inc
+
+# Clean up
+--connection master
drop table t1, t2;
-sync_slave_with_master;
-
-# End of 4.1 tests
+--sync_slave_with_master
diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test
index ed89bd66531..0b3fcc25b33 100644
--- a/mysql-test/extra/rpl_tests/rpl_loaddata.test
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test
@@ -11,13 +11,10 @@
# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986)
+-- source include/have_binlog_format_statement.inc
-- source include/master-slave.inc
source include/have_innodb.inc;
-connection slave;
-reset master;
-connection master;
-
--disable_query_log
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--enable_query_log
@@ -25,7 +22,7 @@ CALL mtr.add_suppression("Unsafe statement written to the binary log using state
# MTR is not case-sensitive.
let $lower_stmt_head= load data;
let $UPPER_STMT_HEAD= LOAD DATA;
-if (`SELECT '$lock_option' <> ''`)
+if ($lock_option)
{
#if $lock_option is null, an extra blank is added into the statement,
#this will change the result of rpl_loaddata test case. so $lock_option
@@ -48,9 +45,7 @@ create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60))
insert into t3 select * from t2;
--enable_warnings
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from t1;
select * from t3;
@@ -62,9 +57,7 @@ drop table t2;
drop table t3;
create table t1(a int, b int, unique(b));
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
# See if slave stops when there's a duplicate entry for key error in LOAD DATA
@@ -75,21 +68,18 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
-# The SQL slave thread should be stopped now.
---source include/wait_for_slave_sql_to_stop.inc
+# 1062 = ER_DUP_ENTRY
+call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062");
+call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0");
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error_and_skip.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
# takes us directly to the end of the relay log).
-set global sql_slave_skip_counter=1;
-start slave;
sync_with_master;
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
-echo Last_SQL_Errno=$last_error;
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
-echo Last_SQL_Error;
-echo $last_error;
+--source include/check_slave_no_error.inc
# Trigger error again to test CHANGE MASTER
@@ -103,17 +93,15 @@ 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.
---source include/wait_for_slave_sql_to_stop.inc
+# 1062 = ER_DUP_ENTRY
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
# CHANGE MASTER and see if error is cleared in SHOW SLAVE STATUS.
-stop slave;
+--source include/stop_slave_io.inc
change master to master_user='test';
change master to master_user='root';
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
-echo Last_SQL_Errno=$last_error;
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
-echo Last_SQL_Error;
-echo $last_error;
+--source include/check_slave_no_error.inc
# Trigger error again to test RESET SLAVE
@@ -128,16 +116,14 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
---source include/wait_for_slave_sql_to_stop.inc
+# 1062 = ER_DUP_ENTRY
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
# RESET SLAVE and see if error is cleared in SHOW SLAVE STATUS.
stop slave;
reset slave;
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
-echo Last_SQL_Errno=$last_error;
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
-echo Last_SQL_Error;
-echo $last_error;
+--source include/check_slave_no_error.inc
# Finally, see if logging is done ok on master for a failing LOAD DATA INFILE
@@ -166,9 +152,13 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fi
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines;
connection slave;
+
if (`SELECT @@global.binlog_format != 'ROW'`)
{
- --source include/wait_for_slave_sql_to_stop.inc
+ # Query causes error on master but not on slave. This causes the slave to
+ # stop with error code 0 (which is wrong: see BUG#57287)
+ --let $slave_sql_errno= 0
+ --source include/wait_for_slave_sql_error.inc
drop table t1, t2;
}
connection master;
@@ -180,11 +170,12 @@ CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
--error ER_DUP_ENTRY
eval $UPPER_STMT_HEAD INFILE "../../std_data/words.dat" INTO TABLE t1;
-DROP TABLE IF EXISTS t1;
+DROP TABLE t1;
# BUG#48297: Schema name is ignored when LOAD DATA is written into binlog,
# replication aborts
--- source include/master-slave-reset.inc
+-- let $rpl_only_running_threads= 1
+-- source include/rpl_reset.inc
-- let $db1= b48297_db1
-- let $db2= b42897_db2
@@ -245,8 +236,7 @@ connect (conn2,localhost,root,,*NO-ONE*);
-- sync_slave_with_master
-- eval use $db1
-let $diff_table_1=master:$db1.t1;
-let $diff_table_2=slave:$db1.t1;
+let $diff_tables= master:$db1.t1, slave:$db1.t1;
source include/diff_tables.inc;
-- connection master
@@ -257,7 +247,7 @@ source include/diff_tables.inc;
-- sync_slave_with_master
# BUG#49479: LOAD DATA INFILE is binlogged without escaping field names
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
@@ -268,6 +258,5 @@ SELECT * FROM t1;
-- sync_slave_with_master
-- connection master
DROP TABLE t1;
--- sync_slave_with_master
-# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test
index da251068ba1..892d926a156 100644
--- a/mysql-test/extra/rpl_tests/rpl_log.test
+++ b/mysql-test/extra/rpl_tests/rpl_log.test
@@ -126,7 +126,7 @@ DROP TABLE t3;
# Reset binlog so that show binlog events will not show the tests
# above.
-source include/master-slave-reset.inc;
+source include/rpl_reset.inc;
connection master;
create table t1(a int auto_increment primary key, b int);
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 8415522ec92..d8cd4f2d284 100644
--- a/mysql-test/extra/rpl_tests/rpl_max_relay_size.test
+++ b/mysql-test/extra/rpl_tests/rpl_max_relay_size.test
@@ -6,9 +6,6 @@
# Requires statement logging
-- 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.
-sync_slave_with_master;
connection slave;
stop slave;
connection master;
@@ -117,3 +114,4 @@ set global max_binlog_size= @my_max_binlog_size;
--echo #
--echo # End of 4.1 tests
--echo #
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_multi_query.test b/mysql-test/extra/rpl_tests/rpl_multi_query.test
index 2438556450d..ae2a3aa45d2 100644
--- a/mysql-test/extra/rpl_tests/rpl_multi_query.test
+++ b/mysql-test/extra/rpl_tests/rpl_multi_query.test
@@ -7,9 +7,6 @@
# PS doesn't support multi-statements
--disable_ps_protocol
-- source include/master-slave.inc
---disable_warnings
-drop database if exists mysqltest;
---enable_warnings
create database mysqltest;
delimiter /;
@@ -25,4 +22,5 @@ select * from mysqltest.t1;
connection master;
source include/show_binlog_events.inc;
drop database mysqltest;
-sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_multi_update.test b/mysql-test/extra/rpl_tests/rpl_multi_update.test
index 121ae18daa8..bf7707f9d6d 100644
--- a/mysql-test/extra/rpl_tests/rpl_multi_update.test
+++ b/mysql-test/extra/rpl_tests/rpl_multi_update.test
@@ -19,12 +19,11 @@ SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
# End of 4.1 tests
connection master;
drop table t1, t2;
-sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test b/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test
index 40439d59dee..bba860ab9aa 100644
--- a/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test
+++ b/mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test
@@ -230,7 +230,7 @@ connection master;
# Reset both slave and master
# This should reset binlog to #1
---source include/master-slave-reset.inc
+--source include/rpl_reset.inc
--echo
diff --git a/mysql-test/extra/rpl_tests/rpl_not_null.test b/mysql-test/extra/rpl_tests/rpl_not_null.test
index 58dbd9ce29f..cbb6b787f11 100644
--- a/mysql-test/extra/rpl_tests/rpl_not_null.test
+++ b/mysql-test/extra/rpl_tests/rpl_not_null.test
@@ -71,12 +71,10 @@ INSERT INTO t4(a) VALUES (5);
sync_slave_with_master;
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
-let $diff_table_1=master:test.t2;
-let $diff_table_2=slave:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
--echo TABLES t2 and t3 must be different.
@@ -101,8 +99,7 @@ REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
sync_slave_with_master;
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
--echo ************* CLEANING *************
@@ -154,8 +151,7 @@ REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
--echo ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;
@@ -177,7 +173,7 @@ sync_slave_with_master;
#--source include/wait_for_slave_to_start.inc
#
#let $y=0;
-#while (`select $y < 6`)
+#while ($y < 6)
#{
# connection master;
#
@@ -202,21 +198,21 @@ sync_slave_with_master;
# `c` INT DEFAULT 500,
# PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1;
#
-# if (`select $y=0`)
+# if ($y==0)
# {
# --echo ************* EXECUTION WITH INSERTS *************
# connection master;
# INSERT INTO t1(a) VALUES (1);
# }
#
-# if (`select $y=1`)
+# if ($y==1)
# {
# --echo ************* EXECUTION WITH INSERTS *************
# connection master;
# INSERT INTO t1(a, b) VALUES (1, NULL);
# }
#
-# if (`select $y=2`)
+# if ($y==2)
# {
# --echo ************* EXECUTION WITH UPDATES *************
# connection master;
@@ -225,14 +221,14 @@ sync_slave_with_master;
# UPDATE t3 SET b = NULL where a= 1;
# }
#
-# if (`select $y=3`)
+# if ($y==3)
# {
# --echo ************* EXECUTION WITH INSERTS/REPLACES *************
# connection master;
# REPLACE INTO t3(a, b) VALUES (1, null);
# }
#
-# if (`select $y=4`)
+# if ($y==4)
# {
# --echo ************* EXECUTION WITH UPDATES/REPLACES *************
# connection master;
@@ -240,7 +236,7 @@ sync_slave_with_master;
# REPLACE INTO t3(a, b) VALUES (1, null);
# }
#
-# if (`select $y=5`)
+# if ($y==5)
# {
# --echo ************* EXECUTION WITH MULTI-ROW INSERTS *************
# connection master;
@@ -273,7 +269,7 @@ sync_slave_with_master;
# SELECT * FROM t3 ORDER BY a;
# connection slave;
# SELECT * FROM t3 ORDER BY a;
-# --source include/reset_master_and_slave.inc
+# --source include/rpl_reset.inc
#
# connection master;
#
diff --git a/mysql-test/extra/rpl_tests/rpl_record_compare.test b/mysql-test/extra/rpl_tests/rpl_record_compare.test
index dc27dcb1f9d..210aee025d0 100644
--- a/mysql-test/extra/rpl_tests/rpl_record_compare.test
+++ b/mysql-test/extra/rpl_tests/rpl_record_compare.test
@@ -4,7 +4,7 @@
#
-- echo ## case #1 - last_null_bit_pos==0 in record_compare without X bit
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1
@@ -16,8 +16,7 @@ UPDATE t1 SET c5 = 'a';
-- enable_warnings
-- sync_slave_with_master
--- let $diff_table_1= master:test.t1
--- let $diff_table_2= slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
--connection master
@@ -26,7 +25,7 @@ DROP TABLE t1;
-- echo ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
-- echo ## (1 column less and no varchar)
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1
@@ -38,8 +37,7 @@ UPDATE t1 SET c5 = 'a';
-- enable_warnings
-- sync_slave_with_master
--- let $diff_table_1= master:test.t1
--- let $diff_table_2= slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
--connection master
@@ -48,7 +46,7 @@ DROP TABLE t1;
-- echo ## case #2 - X bit is wrongly set.
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=$engine DEFAULT CHARSET= latin1
@@ -57,12 +55,31 @@ INSERT INTO t1(c1) VALUES (NULL);
UPDATE t1 SET c1= 0;
-- sync_slave_with_master
--- let $diff_table_1= master:test.t1
--- let $diff_table_2= slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
DROP TABLE t1;
-- sync_slave_with_master
+#
+# BUG#11766865: 60091: RBR + NO PK + UPDATE NULL VALUE --> SLAVE BREAK WITH ERROR HA_ERR_END_OF_
+#
+
+--connection master
+--source include/rpl_reset.inc
+--connection master
+
+--eval CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=$engine DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (1,2,NULL);
+UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3);
+
+--sync_slave_with_master
+
+--let $diff_tables=master:test.t1, slave:test.t1
+--source include/diff_tables.inc
+
+--connection master
+DROP TABLE t1;
+--sync_slave_with_master
diff --git a/mysql-test/extra/rpl_tests/rpl_reset_slave.test b/mysql-test/extra/rpl_tests/rpl_reset_slave.test
index e76cf1530ee..14b457f601e 100644
--- a/mysql-test/extra/rpl_tests/rpl_reset_slave.test
+++ b/mysql-test/extra/rpl_tests/rpl_reset_slave.test
@@ -55,9 +55,9 @@ source include/check_slave_no_error.inc;
change master to master_user='impossible_user_name';
start slave;
let $slave_io_errno= 1045;
-source include/wait_for_slave_io_error.inc;
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
-stop slave;
change master to master_user='root';
source include/start_slave.inc;
source include/check_slave_no_error.inc;
@@ -70,8 +70,12 @@ stop slave;
change master to master_user='impossible_user_name';
start slave;
let $slave_io_errno= 1045;
-source include/wait_for_slave_io_error.inc;
+--source include/wait_for_slave_io_error.inc
+--source include/stop_slave_sql.inc
-stop slave;
reset slave;
source include/check_slave_no_error.inc;
+change master to master_user='root';
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_row_UUID.test b/mysql-test/extra/rpl_tests/rpl_row_UUID.test
index 9f2dbb4ce4b..368596d4fbc 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_UUID.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_UUID.test
@@ -75,5 +75,3 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_master.sql $MYSQLTEST_VARDIR/tmp/r
# this cleanup as no other test will use these files and they'll
# be removed at next testsuite run.
-# End of 5.0 test case
--- source include/master-slave-end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test
index 72d4a8ac759..fee0cace294 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_basic.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test
@@ -158,8 +158,8 @@ SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5
#
if (`select char_length('$bit_field_special') > 0`) {
- SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
connection slave;
+ SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
eval SET GLOBAL SLAVE_TYPE_CONVERSIONS = '$bit_field_special';
}
@@ -252,7 +252,7 @@ DELETE FROM t1;
sync_slave_with_master;
# Just to get a clean binary log
-source include/reset_master_and_slave.inc;
+--source include/rpl_reset.inc
--echo **** On Master ****
connection master;
@@ -368,8 +368,7 @@ INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
--echo [expecting slave to replicate correctly]
@@ -378,20 +377,17 @@ INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
sync_slave_with_master;
-let $diff_table_1=master:test.t2;
-let $diff_table_2=slave:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032");
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, Error_code: 1677");
-connection master;
-RESET MASTER;
-connection slave;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
--echo [expecting slave to replicate correctly]
connection master;
@@ -399,8 +395,7 @@ INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
sync_slave_with_master;
-let $diff_table_1=master:test.t4;
-let $diff_table_2=slave:test.t4;
+let $diff_tables= master:t4, slave:t4;
source include/diff_tables.inc;
--echo [expecting slave to stop]
@@ -413,13 +408,8 @@ connection slave;
--let $slave_sql_errno= 1677
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
-connection master;
-RESET MASTER;
-connection slave;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+
+--source include/rpl_reset.inc
--echo [expecting slave to stop]
connection master;
@@ -431,13 +421,8 @@ connection slave;
--let $slave_sql_errno= 1677
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
-connection master;
-RESET MASTER;
-connection slave;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+
+--source include/rpl_reset.inc
--echo [expecting slave to replicate correctly]
connection master;
@@ -445,8 +430,7 @@ INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
sync_slave_with_master;
-let $diff_table_1=master:test.t7;
-let $diff_table_2=slave:test.t7;
+let $diff_tables= master:t7, slave:t7;
source include/diff_tables.inc;
connection master;
@@ -466,8 +450,7 @@ UPDATE t1 SET a = 10;
INSERT INTO t1 VALUES (4);
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;
@@ -545,8 +528,7 @@ UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
--sync_slave_with_master
--echo *** results: t2 must be consistent ****
-let $diff_table_1=master:test.t2;
-let $diff_table_2=master:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
--connection master
@@ -584,8 +566,7 @@ UPDATE t1 SET a = 8 WHERE a < 5;
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;
@@ -604,8 +585,8 @@ connection master;
# Since t1 contain a bit field, we have to do this trick to handle InnoDB
if (`select char_length('$bit_field_special') > 0`) {
- SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
connection slave;
+ SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
eval SET GLOBAL SLAVE_TYPE_CONVERSIONS = '$bit_field_special';
}
@@ -659,8 +640,7 @@ if (`select char_length('$bit_field_special') > 0`) {
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
}
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test b/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test
index 214027160a9..bad308ff814 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test
@@ -14,9 +14,8 @@ flush tables;
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
-connection master;
-sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
connection master;
drop table t1;
-sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp002.test b/mysql-test/extra/rpl_tests/rpl_row_sp002.test
index 5a2ab1912b8..90c273eb026 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_sp002.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp002.test
@@ -1,9 +1,6 @@
#############################################################################
# This test is being created to test out the non deterministic items with #
# row based replication. #
-# Original Author: JBM #
-# Original Date: Aug/09/2005 #
-# Updated: Aug/29/2005 #
#############################################################################
# Test: Contains two stored procedures test one that insert data into tables#
# and use the LAST_INSERTED_ID() on tables with FOREIGN KEY(a) #
@@ -13,9 +10,6 @@
# the table depending on the CASE outcome. The test uses this SP in a#
# transaction first rolling back and then commiting, #
#############################################################################
-# Mod Date: 08/22/2005 #
-# TEST: Added test to include UPDATE CASCADE on table with FK per Trudy #
-#############################################################################
@@ -23,19 +17,6 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
-
-# Begin clean up test section
-connection master;
---disable_warnings
-DROP PROCEDURE IF EXISTS test.p1;
-DROP PROCEDURE IF EXISTS test.p2;
-DROP PROCEDURE IF EXISTS test.p3;
-DROP TABLE IF EXISTS test.t3;
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
---enable_warnings
-# End of cleanup
-
# Begin test section 1
eval CREATE TABLE test.t1 (a INT AUTO_INCREMENT KEY, t CHAR(6)) ENGINE=$engine_type;
@@ -71,9 +52,7 @@ SELECT * FROM test.t2;
let $message=< -- test 1 select slave after p1 -- >;
--source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@@ -86,9 +65,7 @@ SELECT * FROM test.t2;
let $message=< -- test 1 select slave after p2 -- >;
--source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@@ -136,9 +113,7 @@ SELECT * FROM test.t2;
let $message=< -- test 2 select Slave after p1 -- >;
--source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@@ -153,9 +128,7 @@ SELECT * FROM test.t2;
let $message=< -- test 1 select Slave after p2 -- >;
--source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@@ -195,9 +168,7 @@ while ($n)
ROLLBACK;
select * from test.t3;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from test.t3;
connection master;
@@ -216,9 +187,7 @@ while ($n)
COMMIT;
select * from test.t3;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select * from test.t3;
connection master;
@@ -228,12 +197,12 @@ connection master;
# First lets cleanup
SET AUTOCOMMIT=1;
SET FOREIGN_KEY_CHECKS=0;
-DROP PROCEDURE IF EXISTS test.p3;
-DROP PROCEDURE IF EXISTS test.p1;
-DROP PROCEDURE IF EXISTS test.p2;
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
-DROP TABLE IF EXISTS test.t3;
-sync_slave_with_master;
+DROP PROCEDURE test.p3;
+DROP PROCEDURE test.p1;
+DROP PROCEDURE test.p2;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp003.test b/mysql-test/extra/rpl_tests/rpl_row_sp003.test
index 7bc326a3791..d2c2ea0caf3 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_sp003.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp003.test
@@ -35,10 +35,23 @@ connection master1;
send CALL test.p1();
connection master;
-# To make sure tha the call on master1 arrived at the get_lock
-sleep 1;
+# Make sure that the call on master1 arrived at the get_lock.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = 'User lock' and
+ info = 'SELECT get_lock("test", 100)';
+--source include/wait_condition.inc
CALL test.p2();
SELECT release_lock("test");
+
+connection master1;
+# Reap CALL test.p1() to ensure that it has fully completed
+# before doing any selects on test.t1.
+--reap
+# Release lock acquired by it.
+SELECT release_lock("test");
+
+connection master;
SELECT * FROM test.t1;
#show binlog events;
--source include/wait_for_ndb_to_binlog.inc
@@ -51,6 +64,7 @@ DROP TABLE IF EXISTS test.t1;
eval CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=$engine_type;
CALL test.p2();
CALL test.p1();
+SELECT release_lock("test");
SELECT * FROM test.t1;
sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp007.test b/mysql-test/extra/rpl_tests/rpl_row_sp007.test
index 8f2b72e4d32..492cd2d88f1 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_sp007.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp007.test
@@ -1,8 +1,4 @@
#############################################################################
-# Original Author: JBM #
-# Original Date: Aug/15/2005 #
-# Updated: 08/29/2005 Remove sleeps #
-#############################################################################
# TEST: SP that creates table, starts tranaction inserts. Save point, insert#
# rollback to save point and then commits. #
#############################################################################
@@ -10,14 +6,6 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
-# Begin clean up test section
-connection master;
---disable_warnings
-DROP PROCEDURE IF EXISTS test.p1;
-DROP TABLE IF EXISTS test.t1;
---enable_warnings
-# End of cleanup
-
# Begin test section 1
delimiter |;
eval CREATE PROCEDURE test.p1(IN i INT)
@@ -42,9 +30,7 @@ SELECT * FROM test.t1;
let $message=< ---- Slave selects-- >;
--source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
SELECT * FROM test.t1;
let $message=< ---- Master selects-- >;
@@ -55,16 +41,15 @@ SELECT * FROM test.t1;
let $message=< ---- Slave selects-- >;
--source include/show_msg.inc
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
SELECT * FROM test.t1;
connection master;
#show binlog events;
-DROP PROCEDURE IF EXISTS test.p1;
-DROP TABLE IF EXISTS test.t1;
+DROP PROCEDURE test.p1;
+DROP TABLE test.t1;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
index 9e752e4b69f..76432febd5e 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
@@ -147,6 +147,8 @@ sync_slave_with_master;
connection master;
INSERT INTO t4 VALUES (4);
connection slave;
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* Error_code: 1677");
--let $slave_skip_counter= 2
--let $slave_sql_errno= 1677
--let $show_slave_sql_error= 1
diff --git a/mysql-test/extra/rpl_tests/rpl_set_null.test b/mysql-test/extra/rpl_tests/rpl_set_null.test
index f2aba089279..3755c8bbfa5 100644
--- a/mysql-test/extra/rpl_tests/rpl_set_null.test
+++ b/mysql-test/extra/rpl_tests/rpl_set_null.test
@@ -29,7 +29,7 @@
# BUG#49481: RBR: MyISAM and bit fields may cause slave to stop on
# delete cant find record
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 BIT, c2 INT) Engine=$engine
@@ -37,8 +37,7 @@ INSERT INTO `t1` VALUES ( 1, 1 );
UPDATE t1 SET c1=NULL where c2=1;
-- sync_slave_with_master
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
@@ -46,15 +45,14 @@ UPDATE t1 SET c1=NULL where c2=1;
DELETE FROM t1 WHERE c2=1 LIMIT 1;
-- sync_slave_with_master
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
DROP TABLE t1;
-- sync_slave_with_master
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
@@ -68,8 +66,7 @@ SELECT * FROM t1;
UPDATE t1 SET c1=NULL WHERE c1='w';
-- sync_slave_with_master
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
@@ -77,8 +74,7 @@ UPDATE t1 SET c1=NULL WHERE c1='w';
DELETE FROM t1 LIMIT 2;
-- sync_slave_with_master
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
diff --git a/mysql-test/extra/rpl_tests/rpl_show_binlog_events.inc b/mysql-test/extra/rpl_tests/rpl_show_binlog_events.inc
new file mode 100644
index 00000000000..4530f8c639a
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_show_binlog_events.inc
@@ -0,0 +1,17 @@
+# Include file for rpl_show_relaylog_events.inc
+
+--let $log_type= BINLOG
+if ($is_relay_log) {
+ --let $log_type= RELAYLOG
+}
+--let $args=
+if ($binlog_file != '') {
+ --let $args= IN <FILE>
+}
+if ($binlog_limit) {
+ --let $args= $args LIMIT $binlog_limit
+}
+--echo ******** [$CURRENT_CONNECTION] SHOW $log_type EVENTS $args ********
+--source include/show_events.inc
+
+
diff --git a/mysql-test/extra/rpl_tests/rpl_show_log_events_with_varying_options.inc b/mysql-test/extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
new file mode 100644
index 00000000000..411f388aaf3
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
@@ -0,0 +1,11 @@
+# Include file for rpl_show_log_events.inc
+
+--let $binlog_limit=
+--source extra/rpl_tests/rpl_show_binlog_events.inc
+--let $binlog_limit= 1
+--source extra/rpl_tests/rpl_show_binlog_events.inc
+--let $binlog_limit= 1,3
+--source extra/rpl_tests/rpl_show_binlog_events.inc
+--let $binlog_limit=
+--let $binlog_file=
+--source extra/rpl_tests/rpl_show_binlog_events.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc b/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc
index d32dd485e19..a56e08ece42 100644
--- a/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc
+++ b/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc
@@ -1,103 +1,62 @@
-- connection master
+-- source include/rpl_reset.inc
+
+-- connection master
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
-INSERT INTO t1 VALUES (4);
-INSERT INTO t1 VALUES (5);
-INSERT INTO t1 VALUES (6);
-
--- echo [MASTER] ********* SOW BINLOG EVENTS IN ... *********
--- source include/show_binlog_events.inc
-
--- echo [MASTER] ********* SOW BINLOG EVENTS *********
-let $binlog_file= ;
--- source include/show_binlog_events.inc
-
--- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows *********
-let $binlog_limit= 3;
--- source include/show_binlog_events.inc
-
--- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
-let $binlog_limit= 1,4;
--- source include/show_binlog_events.inc
-
-# clear show_binlog_event/show_relaylog_events parameters
-let $binlog_limit= ;
-
--- sync_slave_with_master
-
--- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... *********
--- source include/show_binlog_events.inc
-
--- echo [SLAVE] ********* SOW BINLOG EVENTS *********
-let $binlog_file= ;
--- source include/show_binlog_events.inc
-
--- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows *********
-let $binlog_limit= 3;
--- source include/show_binlog_events.inc
-
--- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
-let $binlog_limit= 1,4;
--- source include/show_binlog_events.inc
-
-# clear show_binlog_event/show_relaylog_events parameters
-let $binlog_limit= ;
-
--- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
-let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
--- source include/show_relaylog_events.inc
-
--- echo [SLAVE] ********* SOW RELAYLOG EVENTS *********
-let $binlog_file= ;
--- source include/show_relaylog_events.inc
--- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows *********
-let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
-let $binlog_limit= 3;
--- source include/show_relaylog_events.inc
-
--- echo [MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows *********
-let $binlog_limit= 1,3;
--- source include/show_relaylog_events.inc
+# PART I
+#
+# SHOWs contents of binary logs on the master and both, binary and
+# relay logs, on the slave.
+#
+
+--let $is_relay_log= 0
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
+
+--sync_slave_with_master
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
+
+--let $is_relay_log= 1
+--let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
+--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
+
+#
+# PART II
+#
+# Although this second part of the test may seem redudant it is
+# actually needed to assert that SHOW RELAYLOG EVENTS works properly
+# with respect to the ordering of the relay log in relay-log.index.
+#
+# If no file is specified with "IN" then first relay log file in
+# relay-log.index (ie, the oldest one) should be picked and its
+# contents displayed. The same happens for SHOW BINLOG EVENTS, so we
+# show them both. All in all, this is the reason for re-assert after
+# MASTER and SLAVE's FLUSH LOGS operations.
+#
FLUSH LOGS;
-let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
-
-- connection master
FLUSH LOGS;
DROP TABLE t1;
-# clear show_binlog_event/show_relaylog_events parameters
-let $binlog_file= ;
-let $binlog_limit= ;
-
--- echo [MASTER] ********* SOW BINLOG EVENTS IN ... *********
-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
--- source include/show_binlog_events.inc
-
--- echo [MASTER] ********* SOW BINLOG EVENTS *********
-let $binlog_file= ;
--- source include/show_binlog_events.inc
+--let $is_relay_log= 0
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
--- sync_slave_with_master
+--sync_slave_with_master
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
--- echo [SLAVE] ********* SOW BINLOG EVENTS IN ... *********
-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
--- source include/show_binlog_events.inc
+--let $is_relay_log= 1
+--let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
+--source extra/rpl_tests/rpl_show_log_events_with_varying_options.inc
--- echo [SLAVE] ********* SOW BINLOG EVENTS *********
-let $binlog_file= ;
--- source include/show_binlog_events.inc
-
--- echo [SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
--- source include/show_relaylog_events.inc
-
--- echo [SLAVE] ********* SOW RELAYLOG EVENTS *********
-let $binlog_file= ;
--- source include/show_relaylog_events.inc
# clear show_binlog_event/show_relaylog_events parameters
let $binlog_file= ;
diff --git a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test
index f7e4f204afa..e42affebaed 100644
--- a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test
+++ b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test
@@ -125,4 +125,58 @@ drop table t1i, t2m;
sync_slave_with_master;
-# End of tests
+--echo #
+--echo # Bug#56096 STOP SLAVE hangs if executed in parallel with user sleep
+--echo #
+
+--connection master
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT );
+
+sync_slave_with_master;
+
+--connection slave1
+--echo # Slave1: lock table for synchronization
+LOCK TABLES t1 WRITE;
+
+--connection master
+--echo # Master: insert into the table
+INSERT INTO t1 SELECT SLEEP(4);
+
+--connection slave
+--echo # Slave: wait for the insert
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+ WHERE STATE = "Waiting for table metadata lock"
+ AND INFO = "INSERT INTO t1 SELECT SLEEP(4)";
+--source include/wait_condition.inc
+
+--echo # Slave: send slave stop
+--send STOP SLAVE
+
+--connection slave1
+--echo # Slave1: wait for stop slave
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+ WHERE INFO = "STOP SLAVE";
+--source include/wait_condition.inc
+
+--echo # Slave1: unlock the table
+UNLOCK TABLES;
+
+--connection slave
+--echo # Slave: wait for the slave to stop
+--reap
+--source include/wait_for_slave_to_stop.inc
+
+--echo # Start slave again
+--source include/start_slave.inc
+
+--echo # Clean up
+--connection master
+DROP TABLE t1;
+sync_slave_with_master;
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_000001.test b/mysql-test/extra/rpl_tests/rpl_stm_000001.test
deleted file mode 100644
index 175d80aa183..00000000000
--- a/mysql-test/extra/rpl_tests/rpl_stm_000001.test
+++ /dev/null
@@ -1,131 +0,0 @@
-# Requires binlog_format=statement format since query involving
-# get_lock() is logged in row format if binlog_format=mixed or row.
--- source include/have_binlog_format_statement.inc
--- source include/master-slave.inc
-
-CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-
-# Load some data into t1
-create table t1 (word char(20) not null);
-load data infile '../../std_data/words.dat' into table t1;
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
-select * from t1 limit 10;
-
-#
-# Test slave with wrong password
-#
-sync_slave_with_master;
-stop slave;
-connection master;
-set password for root@"localhost" = password('foo');
-connection slave;
-start slave;
-connection master;
-#
-# Give slave time to do at last one failed connect retry
-# This one must be short so that the slave will not stop retrying
-real_sleep 2;
-set password for root@"localhost" = password('');
-# Give slave time to connect (will retry every second)
-sleep 2;
-
-create table t3(n int);
-insert into t3 values(1),(2);
-sync_slave_with_master;
-select * from t3;
-select sum(length(word)) from t1;
-connection master;
-drop table t1,t3;
-sync_slave_with_master;
-
-# Test if the slave SQL thread can be more than 16K behind the slave
-# I/O thread (> IO_SIZE)
-
-connection master;
-# we'll use table-level locking to delay slave SQL thread
-eval create table t1 (n int) engine=$engine_type;
-sync_slave_with_master;
-connection master;
-reset master;
-connection slave;
-stop slave;
-reset slave;
-
-connection master;
-let $1=5000;
-# Generate 16K of relay log
-disable_query_log;
-while ($1)
-{
- eval insert into t1 values($1);
- dec $1;
-}
-enable_query_log;
-
-# Try to cause a large relay log lag on the slave by locking t1
-connection slave;
-lock tables t1 read;
-start slave;
-connection master;
---source include/sync_slave_io_with_master.inc
-unlock tables;
-
-#test handling of aborted connection in the middle of update
-
-connection master;
-create table t2(id int);
-insert into t2 values(connection_id());
-
-connection master1;
-# Avoid generating result
-create temporary table t3(n int);
---disable_warnings
-insert into t3 select get_lock('crash_lock%20C', 1) from t2;
---enable_warnings
-
-connection master;
-send update t1 set n = n + get_lock('crash_lock%20C', 2);
-connection master1;
-sleep 3;
-select (@id := id) - id from t2;
-kill @id;
-# We don't drop t3 as this is a temporary table
-drop table t2;
-connection master;
-# The get_lock function causes warning for unsafe statement.
---disable_warnings
---error 1317,2013
-reap;
---enable_warnings
-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).
---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
-# --replace_result $MASTER_MYPORT MASTER_PORT
-# show slave status;
-
-set global sql_slave_skip_counter=1;
-start slave;
-select count(*) from t1;
-connection master1;
-drop table t1;
-create table t1 (n int);
-insert into t1 values(3456);
-insert into mysql.user (Host, User, Password)
- VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
-select select_priv,user from mysql.user where user = _binary'blafasel2';
-update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
-select select_priv,user from mysql.user where user = _binary'blafasel2';
-sync_slave_with_master;
-select n from t1;
-select select_priv,user from mysql.user where user = _binary'blafasel2';
-connection master1;
-drop table t1;
-delete from mysql.user where user="blafasel2";
-sync_slave_with_master;
-
-# End of 4.1 tests
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 2c396c9a209..cc69c08fe7c 100644
--- a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
+++ b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
@@ -25,11 +25,17 @@ drop table t1;
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
+call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* Error_code: 0");
let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
--echo Error: "$error" (expected different error codes on master and slave)
--echo Errno: "$errno" (expected 0)
drop table t1;
+--source include/stop_slave.inc
+# Clear error messages.
+RESET SLAVE;
# End of 4.1 tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_stm_create_if_not_exists.test b/mysql-test/extra/rpl_tests/rpl_stm_create_if_not_exists.test
new file mode 100644
index 00000000000..cecbd45c02a
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_stm_create_if_not_exists.test
@@ -0,0 +1,268 @@
+--echo
+--echo
+connection master;
+
+if ($is_temporary)
+{
+ --let $_temporary=TEMPORARY
+}
+
+CREATE TABLE t2(c1 INT, c2 char(10));
+INSERT INTO t2 VALUES(1, 'abc'), (2, 'abc');
+
+--echo
+--echo # The original query should be binlogged if the table does not exist.
+--echo # ------------------------------------------------------------------
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1 (c1 INT , c2 INT, c3 char(10), c4 INT KEY)
+ SELECT 'abc' AS c3, 1 AS c4;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+--echo
+--echo # The statement should be binlogged as two events. one is
+--echo # 'CREATE $_temporary TABLE IF NOT EXISTS ..', another one is
+--echo # 'INSERT ... SELECT'.
+--echo # ------------------------------------------------------------------
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ SELECT 'abc', 2;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+--echo
+--echo # Verify if it can be binlogged with right database name when the table
+--echo # is not in the default database
+--echo
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+--enable_warnings
+CREATE DATABASE db1;
+USE db1;
+
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+eval CREATE $_temporary TABLE IF NOT EXISTS test.t1
+ SELECT 'abc', 20;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:test.t1,slave:test.t1
+ --source include/diff_tables.inc
+}
+USE test;
+DROP DATABASE db1;
+
+--echo
+--echo # It should be binlogged as 'REPLACE ... SELECT'
+--echo # if the original statement has option REPLACE
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ REPLACE SELECT '123', 2;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+--echo
+--echo # It should be binlogged as 'INSERT IGNORE... SELECT'
+--echo # if the original statement has option IGNORE
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ IGNORE SELECT '123', 2;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+--echo
+--echo # Nothing should be binlogged if error happens and no any row is inserted
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+--error ER_DUP_ENTRY
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ SELECT '123', 2;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+--echo
+--echo # Verify it can binlog well when there are some braces('(')
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ (SELECT '123', 3) UNION (SELECT '123', 4);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ REPLACE (SELECT 'abc', 3) UNION (SELECT 'abc', 4);
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ IGNORE (SELECT '123', 3) UNION (SELECT '123', 4);
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+if (!$is_temporary)
+{
+ --echo
+ --echo # Throw a warning that table already exists and don't insert anything
+ --echo
+ CREATE VIEW t3 AS SELECT * FROM t2;
+ let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+ CREATE TABLE IF NOT EXISTS t3
+ SELECT '123', 2;
+ source include/show_binlog_events.inc;
+ DROP VIEW t3;
+}
+
+--echo
+--echo # The statement can be binlogged correctly when it is in a SP/EVENT/TRIGGER
+--echo
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+eval CREATE PROCEDURE p1(IN a INT)
+ CREATE $_temporary TABLE IF NOT EXISTS t1 SELECT '123', a;
+
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+call p1(500);
+call p1(600);
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+DROP PROCEDURE p1;
+
+--echo
+--echo # The statement can be binlogged correctly when it is in a prepared statement
+--echo
+eval PREPARE stm FROM "CREATE $_temporary TABLE IF NOT EXISTS t1 SELECT '123', ?";
+
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+SET @a= 700;
+EXECUTE stm USING @a;
+SET @a= 800;
+EXECUTE stm USING @a;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+--echo
+--echo # The statement can be binlogged correctly when it is in a conditional comment
+--echo
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo # The whole statement in a conditional comment
+eval /*!CREATE $_temporary TABLE IF NOT EXISTS t1
+ SELECT 'abc', 900*/;
+source include/show_binlog_events.inc;
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # There is an long comment before SELECT
+eval /*!CREATE $_temporary /*blabla*/ TABLE IF NOT EXISTS t1
+ SELECT 'abc', 901*/;
+source include/show_binlog_events.inc;
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # Conditional comment starts just from SELECT
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ /*!SELECT 'abc',*/ 902;
+source include/show_binlog_events.inc;
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # Only SELECT keyword is in the conditional comment
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ /*!SELECT*/ /*!'abc',*/ 904;
+source include/show_binlog_events.inc;
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # Conditional comment is after SELECT keyword
+eval CREATE $_temporary TABLE IF NOT EXISTS t1
+ SELECT /*!'abc',*/ 903;
+source include/show_binlog_events.inc;
+let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # Conditional comment ends just before SELECT keyword
+eval /*!CREATE $_temporary TABLE IF NOT EXISTS t1
+ */SELECT 'abc', 905;
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+--connection master
+
+if (!$is_temporary)
+{
+ --let $diff_tables= master:t1,slave:t1
+ --source include/diff_tables.inc
+}
+
+DROP TABLE t2;
+eval DROP $_temporary TABLE t1;
+
diff --git a/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test b/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test
index d0f19e6d913..977d93ec36d 100644
--- a/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test
+++ b/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test
@@ -23,6 +23,8 @@ insert into tm set a=null; # to simulate killed status on the slave
commit;
connection slave;
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+call mtr.add_suppression("Slave SQL.*Slave SQL Thread stopped with incomplete event group having non-transactional changes");
# slave will catch the killed status but won't shut down immediately
# only after the whole group has done (commit)
@@ -139,9 +141,10 @@ set @@global.debug="-d";
# clean-up
#
-connection master;
-drop table tm, ti;
+# the sql thread has an error, so reset replication state
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
-connection slave; # slave SQL thread is stopped
-source include/stop_slave.inc;
+connection master;
drop table tm, ti;
+--sync_slave_with_master
diff --git a/mysql-test/extra/rpl_tests/rpl_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_stop_slave.test
new file mode 100644
index 00000000000..64e69cebc32
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_stop_slave.test
@@ -0,0 +1,60 @@
+#
+# Auxiliary file which is used to test BUG#56118
+#
+# Slave should apply all statements in the transaction before stop if any
+# temporary table is created or dropped.
+#
+# USEAGE:
+# --let $tmp_table_stm= a SQL statement
+# --source extra/rpl_tests/rpl_stop_slave.test
+#
+
+if (!$tmp_table_stm)
+{
+ --echo \$tmp_table_stm is NULL
+ --die $tmp_table_stm is NULL
+}
+
+--echo
+--echo [ On Master ]
+connection master;
+BEGIN;
+DELETE FROM t1;
+eval $tmp_table_stm;
+INSERT INTO t1 VALUES (1);
+DROP TEMPORARY TABLE tt1;
+COMMIT;
+
+--echo
+--echo [ On Slave ]
+connection slave;
+
+# To check if slave SQL thread is applying INSERT statement
+let $show_statement= SHOW PROCESSLIST;
+let $field= Info;
+let $condition= LIKE 'INSERT%';
+source include/wait_show_condition.inc;
+
+send STOP SLAVE SQL_THREAD;
+
+--echo
+--echo [ On Slave1 ]
+connection slave1;
+--echo # To resume slave SQL thread
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'RESET';
+
+--echo
+--echo [ On Slave ]
+connection slave;
+reap;
+source include/wait_for_slave_sql_to_stop.inc;
+
+--echo # Slave should stop after the transaction has committed.
+--echo # So t1 on master is same to t1 on slave.
+--let $diff_tables= master:t1, slave:t1
+--source include/diff_tables.inc
+
+connection slave;
+START SLAVE SQL_THREAD;
+source include/wait_for_slave_sql_to_start.inc;
diff --git a/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test b/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test
index 3b6fe7a0ef4..1687a233914 100644
--- a/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test
+++ b/mysql-test/extra/rpl_tests/rpl_sv_relay_space.test
@@ -1,12 +1,3 @@
-####################
-# Change Author: JBM
-# Change Date: 2006-01-17
-# Change: Added order by in select
-####################
-# Change Date: 2006-02-02
-# Change: renamed to make bettre sense,
-# and wrapped per Engine test
-############################
source include/master-slave.inc;
#
@@ -30,6 +21,5 @@ sync_slave_with_master;
SELECT * FROM t1 ORDER BY id;
connection master;
DROP TABLE t1;
-sync_slave_with_master;
-# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_test_framework.inc b/mysql-test/extra/rpl_tests/rpl_test_framework.inc
new file mode 100644
index 00000000000..fb42d2efb9a
--- /dev/null
+++ b/mysql-test/extra/rpl_tests/rpl_test_framework.inc
@@ -0,0 +1,86 @@
+# ==== Purpose ====
+#
+# Auxiliary file used by suite/rpl/t/rpl_test_framework.test
+#
+# The purpose is to check that the sync chain generated in
+# rpl_change_topology.inc (invoked from rpl_init.inc) is correct. This
+# is done in two ways:
+# (1) Print the sync chain.
+# (2) Execute a statement and verify that it replicates to all slaves.
+#
+#
+# ==== Implementation ====
+#
+# Does this:
+# (1) Set up a given replication topology (rpl_init.inc)
+# (2) Print $rpl_sync_chain
+# (3) Execute "DELETE FROM t1" and then "INSERT INTO t1" on the master
+# (4) Sync and compare all servers.
+# (5) Clean up the replication topology (rpl_end.inc)
+#
+# (Technical detail: Since DELETE FROM t1 is not executed at the end,
+# some servers may have rows left in t1 from a previous invocation of
+# rpl_test_framework.inc. Therefore, this file will only work in
+# statement mode where "DELETE FROM t1" removes rows that exist on
+# slave but not on master.)
+#
+#
+# ==== Usage ====
+#
+# --let $rpl_server_count= <number>
+# --let $rpl_topology= <topology specification>
+# --let $masters= <list of masters>
+# [--let $rpl_diff_servers= <list of servers>]
+# --source extra/rpl_tests/rpl_test_framework.inc
+#
+# Parameters:
+# $next_number
+# The INSERT statement will insert $next_number into t1, and
+# $next_number will increase by 1.
+#
+# $rpl_server_count, $rpl_topology:
+# See include/rpl_init.inc
+#
+# $masters
+# This should be a list of numbers, each identifying a server.
+# The DELETE and INSERT statements will be executed on all servers
+# in the list.
+#
+# $rpl_diff_servers
+# See include/rpl_diff.inc
+
+--source include/rpl_init.inc
+--source include/rpl_generate_sync_chain.inc
+--echo rpl_sync_chain= '$rpl_sync_chain'
+
+--inc $next_number
+
+# Iterate over masters
+while ($masters)
+{
+ --let $master_i= `SELECT SUBSTRING_INDEX('$masters', ',', 1)`
+ --let $masters= `SELECT SUBSTRING('$masters', LENGTH('$master_i') + 2)`
+
+ # Connect to master and execute statement
+ --let $rpl_connection_name= server_$master_i
+ --source include/rpl_connection.inc
+ DELETE FROM t1;
+ --eval INSERT INTO t1 VALUES ($next_number)
+}
+
+--source include/rpl_sync.inc
+
+# Compare all servers.
+--let $diff_tables= server_$rpl_server_count:t1
+--let $server_i= $rpl_server_count
+--dec $server_i
+while ($server_i)
+{
+ --let $diff_tables= server_$server_i:t1,$diff_tables
+ --dec $server_i
+}
+--source include/diff_tables.inc
+
+--let $diff_servers=
+--let $masters=
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_truncate.test b/mysql-test/extra/rpl_tests/rpl_truncate.test
index 7036ab126e1..c1d70b4dab2 100644
--- a/mysql-test/extra/rpl_tests/rpl_truncate.test
+++ b/mysql-test/extra/rpl_tests/rpl_truncate.test
@@ -1,11 +1,6 @@
-#
-# Copyright 2006 MySQL. All rights reserved.
-#
# Test to check for the different version of truncating a table.
# The statements are "TRUNCATE tbl" and "DELETE FROM tbl". We check
# the behaviour of each possible value for BINLOG_FORMAT.
-#
-# Author(s): Mats Kindahl
--source include/master-slave.inc
@@ -14,3 +9,5 @@ let $trunc_stmt = TRUNCATE TABLE;
let $trunc_stmt = DELETE FROM;
--source extra/rpl_tests/rpl_truncate_helper.test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_truncate_helper.test b/mysql-test/extra/rpl_tests/rpl_truncate_helper.test
index cd1ce93177a..d1d0e06e32f 100644
--- a/mysql-test/extra/rpl_tests/rpl_truncate_helper.test
+++ b/mysql-test/extra/rpl_tests/rpl_truncate_helper.test
@@ -1,4 +1,4 @@
-source include/reset_master_and_slave.inc;
+--source include/rpl_reset.inc
--echo **** On Master ****
connection master;
@@ -10,8 +10,7 @@ connection master;
eval $trunc_stmt t1;
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
--echo ==== Test using a table with delete triggers ====
@@ -26,8 +25,7 @@ connection master;
eval $trunc_stmt t1;
sync_slave_with_master;
-let $diff_table_1=master:test.t2;
-let $diff_table_2=slave:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
connection master;
diff --git a/mysql-test/extra/rpl_tests/type_conversions.test b/mysql-test/extra/rpl_tests/type_conversions.test
index 731eef8f41e..0096fda3174 100644
--- a/mysql-test/extra/rpl_tests/type_conversions.test
+++ b/mysql-test/extra/rpl_tests/type_conversions.test
@@ -876,7 +876,5 @@ let $can_convert = $if_is_lossy;
source extra/rpl_tests/check_type.inc;
-disable_warnings;
-source include/reset_master_and_slave.inc;
-enable_warnings;
+--source include/rpl_reset.inc
enable_query_log;
diff --git a/mysql-test/include/analyze-sync_with_master.test b/mysql-test/include/analyze-sync_with_master.test
index 684c0dbbab7..27b5a56c6b1 100644
--- a/mysql-test/include/analyze-sync_with_master.test
+++ b/mysql-test/include/analyze-sync_with_master.test
@@ -1,6 +1,9 @@
-SHOW PROCESSLIST;
+# ==== Purpose ====
+#
+# This is an auxiliary file that mysqltest executes when
+# sync_slave_with_master or sync_with_master fails. The purpose is to
+# print debug information.
-let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
-eval SHOW BINLOG EVENTS IN '$binlog_name';
-
-exit; \ No newline at end of file
+--let $rpl_server_count= 0
+--let $rpl_only_current_connection= 1
+--source include/show_rpl_debug_info.inc
diff --git a/mysql-test/include/assert.inc b/mysql-test/include/assert.inc
new file mode 100644
index 00000000000..34cc71e7c25
--- /dev/null
+++ b/mysql-test/include/assert.inc
@@ -0,0 +1,175 @@
+# ==== Purpose ====
+#
+# Check if a condition holds, fail with debug info if not.
+#
+# The condition is parsed before executed. The following constructs
+# are supported:
+#
+# [SQL_STATEMENT, COLUMN, ROW]
+# The square bracket is replaced by the result from SQL_STATEMENT,
+# in the given COLUMN and ROW.
+#
+# Optionally, SQL_STATEMENT may have the form:
+# connection:SQL_STATEMENT
+# In this case, SQL_STATEMENT is executed on the named connection.
+# All other queries executed by this script will be executed on
+# the connection that was in use when this script was started.
+# The current connection will also be restored at the end of this
+# script.
+#
+# Nested sub-statements on this form are not allowed.
+#
+# <1>
+# This is a shorthand for the result of the first executed square
+# bracket. <2> is a shorthand for the second executed square
+# bracket, and so on.
+#
+# ==== Usage ====
+#
+# --let $assert_text= Relay_Log_Pos must be between min_pos and max_pos
+# --let $assert_cond= [SHOW SLAVE STATUS, Relay_Log_Pos, 1] >= $min_pos AND <1> <= $max_pos
+# [--let $assert_quiet= 1]
+# [--let $rpl_debug= 1]
+# --source include/assert.inc
+#
+# Parameters:
+#
+# $assert_text
+# Text that describes what is being checked. This text is written to
+# the query log so it should not contain non-deterministic elements.
+#
+# $assert_cond
+# Condition to check. See above for details about the format. The
+# condition will be executed as `SELECT $assert_cond`.
+#
+# Both $assert_cond and the result from any substatement on the
+# form [SQL_STATEMENT, COLUMN, ROW] will be used in SQL statements,
+# inside single quotes (as in '$assert_text'). So any single quotes
+# in these texts must be escaped or replaced by double quotes.
+#
+# $rpl_debug
+# Print extra debug info.
+
+
+--let $include_filename= assert.inc [$assert_text]
+--source include/begin_include_file.inc
+
+if ($rpl_debug)
+{
+ --echo # debug: assert_text='$assert_text' assert_cond='$assert_cond'
+}
+
+# Sanity-check input
+if (!$assert_text)
+{
+ --die ERROR IN TEST: the mysqltest variable rpl_test must be set
+}
+
+--let $_assert_old_connection= $CURRENT_CONNECTION
+
+# Evaluate square brackets in cond.
+--let $_assert_substmt_number= 1
+--let $_assert_cond_interp= '$assert_cond'
+--let $_assert_lbracket= `SELECT LOCATE('[', $_assert_cond_interp)`
+while ($_assert_lbracket)
+{
+ # Get position of right bracket
+ --let $_assert_rbracket= `SELECT LOCATE(']', $_assert_cond_interp)`
+ if (!$_assert_rbracket)
+ {
+ --echo BUG IN TEST: Mismatching square brackets in assert_cond.
+ --echo Original assert_cond='$assert_cond'
+ --echo Interpolated assert_cond=$_assert_cond_interp
+ --die BUG IN TEST: Mismatching square brackets in $assert_cond
+ }
+
+ # Get sub-statement from statement. Preserve escapes for single quotes.
+ --let $_assert_full_substmt= `SELECT QUOTE(SUBSTRING($_assert_cond_interp, $_assert_lbracket + 1, $_assert_rbracket - $_assert_lbracket - 1))`
+
+ # Get connection from sub-statement
+ --let $_assert_colon= `SELECT IF($_assert_full_substmt REGEXP '^[a-zA-Z_][a-zA-Z_0-9]*:', LOCATE(':', $_assert_full_substmt), 0)`
+ --let $_assert_connection=
+ --let $_assert_substmt= $_assert_full_substmt
+ if ($_assert_colon)
+ {
+ --let $_assert_connection= `SELECT SUBSTRING($_assert_substmt, 1, $_assert_colon - 1)`
+ # Preserve escapes for single quotes.
+ --let $_assert_substmt= `SELECT QUOTE(SUBSTRING($_assert_substmt, $_assert_colon + 1))`
+ }
+
+ # Interpolate escapes before using condition outside string context.
+ --let $_assert_substmt_interp= `SELECT $_assert_substmt`
+
+ # Execute and get result from sub-statement
+ if ($_assert_connection)
+ {
+ if ($rpl_debug)
+ {
+ --echo # debug: connection='$_assert_connection' sub-statement=$_assert_substmt
+ }
+ --let $rpl_connection_name= $_assert_connection
+ --source include/rpl_connection.inc
+ --let $_assert_substmt_result= query_get_value($_assert_substmt_interp)
+ --let $rpl_connection_name= $_assert_old_connection
+ --source include/rpl_connection.inc
+ }
+ if (!$_assert_connection)
+ {
+ if ($rpl_debug)
+ {
+ --echo # debug: old connection, sub-statement=$_assert_substmt
+ }
+ --let $_assert_substmt_result= query_get_value($_assert_substmt_interp)
+ }
+ if ($rpl_debug)
+ {
+ --echo # debug: result of sub-statement='$_assert_substmt_result'
+ }
+
+ # Replace sub-statement by its result
+ --let $_assert_cond_interp= `SELECT QUOTE(REPLACE($_assert_cond_interp, CONCAT('[', $_assert_full_substmt, ']'), '$_assert_substmt_result'))`
+ # Replace result references by result
+ --let $_assert_cond_interp= `SELECT QUOTE(REPLACE($_assert_cond_interp, '<$_assert_substmt_number>', '$_assert_substmt_result'))`
+
+ --let $_assert_lbracket= `SELECT LOCATE('[', $_assert_cond_interp)`
+
+ --inc $_assert_substmt_number
+}
+
+# Interpolate escapes before using condition outside string context.
+--let $_assert_cond_interp= `SELECT $_assert_cond_interp`
+
+if ($rpl_debug)
+{
+ --echo # debug: interpolated_cond='$_assert_cond_interp'
+}
+
+# Execute.
+--let $_assert_result= `SELECT $_assert_cond_interp`
+
+if ($rpl_debug)
+{
+ --echo # debug: result='$_assert_result'
+}
+
+# Check.
+if (!$_assert_result)
+{
+ --echo ######## Test assertion failed: $assert_text ########
+ --echo Dumping debug info:
+ if ($rpl_inited)
+ {
+ --source include/show_rpl_debug_info.inc
+ }
+ --echo Assertion text: '$assert_text'
+ --echo Assertion condition: '$assert_cond'
+ --echo Assertion condition, interpolated: '$_assert_cond_interp'
+ --echo Assertion result: '$_assert_result'
+ --die Test assertion failed in assertion.inc
+}
+
+--let $include_filename= assert.inc [$assert_text]
+--source include/end_include_file.inc
+
+--let $assert_text=
+--let $assert_cond=
diff --git a/mysql-test/include/begin_include_file.inc b/mysql-test/include/begin_include_file.inc
new file mode 100644
index 00000000000..1b69fb0e52d
--- /dev/null
+++ b/mysql-test/include/begin_include_file.inc
@@ -0,0 +1,83 @@
+# ==== Purpose ====
+#
+# This is an auxiliary file that facilitates writing include/*.inc
+# files. It has three purposes:
+#
+# 1. Store mtr's state at the beginning of the .inc file and restore
+# the state at the end. The following status is restored:
+#
+# disable_warnings
+# disable_query_log
+# disable_result_log
+# disable_abort_on_errors
+# Current connection
+#
+# 2. This file also prints the name of the .inc file that sources
+# it. Only the name of the top-level .inc file is printed: if
+# file_1.inc sources file_2.inc, then this file only prints
+# file_1.inc.
+#
+# 3. If the mysqltest variable $rpl_debug is set, then
+# this file will print:
+#
+# ==== BEGIN include/<filename> ====
+#
+# and end_include_file.inc will print
+#
+# ==== END include/<filename> ====
+#
+# These printouts are indented to make it easier to read the
+# result log.
+#
+#
+# ==== Usage ====
+#
+# # At the beginning of include/my_file.inc:
+# --let $include_filename= my_file.inc
+# [--let $rpl_debug= 1]
+# --source include/begin_include_file.inc
+#
+# # At the end of include/my_file.inc:
+# --let $include_filename= my_file.inc
+# --source include/end_include_file.inc
+#
+# Parameters:
+# $include_filename
+# The basename of the file: a file named /path/to/my_file.inc
+# should set $include_filename=my_file.inc. This parameter
+# must be provided both for begin_include_file.inc and
+# end_include_file.inc.
+#
+# $rpl_debug
+# If set, this script will print the following text:
+# ==== BEGIN include/$include_filename.inc ====
+
+
+# Print 'include/$include_filename', but only when invoked from
+# the top-level. We don't want to print
+# 'include/$include_filename' from all files included
+# recursively.
+if (!$_include_file_depth)
+{
+ --echo include/$include_filename
+ --let $_include_file_depth= 0
+}
+--inc $_include_file_depth
+if ($rpl_debug)
+{
+ --echo $_include_file_indent==== BEGIN include/$include_filename ====
+}
+
+--let $_include_file_enabled_warnings= $ENABLED_WARNINGS$_include_file_enabled_warnings
+--let $_include_file_enabled_query_log= $ENABLED_QUERY_LOG$_include_file_enabled_query_log
+--let $_include_file_enabled_result_log= $ENABLED_RESULT_LOG$_include_file_enabled_result_log
+--let $_include_file_enabled_abort_on_error= $ENABLED_ABORT_ON_ERROR$_include_file_enabled_abort_on_error
+--let $_include_file_connection= $CURRENT_CONNECTION,$_include_file_connection
+
+if ($rpl_debug)
+{
+ --echo $_include_file_indent con='$CURRENT_CONNECTION' warn='$ENABLED_WARNINGS' qlog='$ENABLED_QUERY_LOG' rlog='$ENABLED_RESULT_LOG' aborterr='$ENABLED_ABORT_ON_ERROR'
+}
+
+--let $include_filename=
+--let $_include_file_indent= .$_include_file_indent
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index 6dcb01c13cf..858a89f706c 100644
--- a/mysql-test/include/check-testcase.test
+++ b/mysql-test/include/check-testcase.test
@@ -1,15 +1,73 @@
-
-#
-# This test is executed twice for each test case if mysql-test-run is passed
-# the flag --check-testcase. Before every testcase it is run with mysqltest
-# in record mode and will thus produce an output file that can be compared
-# to output from after the tescase.
-# In that way its possible to check that a testcase does not have
-# any unwanted side affects.
+# ==== Purpose ====
#
+# This test is executed twice for each test case. Before every
+# testcase it is run with mysqltest in record mode and will thus
+# produce an output file that can be compared to output from after the
+# tescase. In that way, it is possible to check that a testcase does
+# not have any unwanted side affects.
+
--disable_query_log
-call mtr.check_testcase();
---enable_query_log
+# We want to ensure all slave configuration is restored. But SHOW
+# SLAVE STATUS returns nothing for servers not configured as slaves,
+# and (after BUG#28796 was fixed) there is no way to de-configure a
+# slave. Hence, it's impossible to clean up the replication state at
+# the end. But we want to check that the slave is stopped, there is
+# no error, and a few other invariants. So we issue SHOW SLAVE
+# STATUS, and if it returns no rows we fake the result.
+--let $tmp= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1)
+--let $tmp= `SELECT '$tmp' = 'No such row'`
+if ($tmp)
+{
+ # Note: after WL#5177, fields 13-18 shall not be filtered-out.
+ --echo Slave_IO_State
+ --echo Master_Host 127.0.0.1
+ --echo Master_User root
+ --echo Master_Port #
+ --echo Connect_Retry #
+ --echo Master_Log_File #
+ --echo Read_Master_Log_Pos #
+ --echo Relay_Log_File #
+ --echo Relay_Log_Pos #
+ --echo Relay_Master_Log_File #
+ --echo Slave_IO_Running No
+ --echo Slave_SQL_Running No
+ --echo Replicate_Do_DB #
+ --echo Replicate_Ignore_DB #
+ --echo Replicate_Do_Table #
+ --echo Replicate_Ignore_Table #
+ --echo Replicate_Wild_Do_Table #
+ --echo Replicate_Wild_Ignore_Table #
+ --echo Last_Errno 0
+ --echo Last_Error
+ --echo Skip_Counter 0
+ --echo Exec_Master_Log_Pos #
+ --echo Relay_Log_Space #
+ --echo Until_Condition #
+ --echo Until_Log_File #
+ --echo Until_Log_Pos #
+ --echo Master_SSL_Allowed No
+ --echo Master_SSL_CA_File
+ --echo Master_SSL_CA_Path
+ --echo Master_SSL_Cert
+ --echo Master_SSL_Cipher
+ --echo Master_SSL_Key
+ --echo Seconds_Behind_Master NULL
+ --echo Master_SSL_Verify_Server_Cert No
+ --echo Last_IO_Errno 0
+ --echo Last_IO_Error
+ --echo Last_SQL_Errno 0
+ --echo Last_SQL_Error
+ --echo Replicate_Ignore_Server_Ids
+ --echo Master_Server_Id #
+}
+if (!$tmp) {
+ # Note: after WL#5177, fields 13-18 shall not be filtered-out.
+ --replace_column 4 # 5 # 6 # 7 # 8 # 9 # 10 # 13 # 14 # 15 # 16 # 17 # 18 # 22 # 23 # 24 # 25 # 26 # 40 #
+ query_vertical
+ SHOW SLAVE STATUS;
+}
+call mtr.check_testcase();
+--enable_query_log
diff --git a/mysql-test/include/check_concurrent_insert.inc b/mysql-test/include/check_concurrent_insert.inc
index f4bec3c9cdb..62de485d8f1 100644
--- a/mysql-test/include/check_concurrent_insert.inc
+++ b/mysql-test/include/check_concurrent_insert.inc
@@ -23,7 +23,7 @@
# Reset DEBUG_SYNC facility for safety.
set debug_sync= "RESET";
-if (`SELECT '$restore_table' <> ''`)
+if ($restore_table)
{
--eval create temporary table t_backup select * from $restore_table;
}
@@ -82,7 +82,7 @@ connection default;
--eval delete from $table where i = 0;
-if (`SELECT '$restore_table' <> ''`)
+if ($restore_table)
{
--eval truncate table $restore_table;
--eval insert into $restore_table select * from t_backup;
diff --git a/mysql-test/include/check_ftwrl_compatible.inc b/mysql-test/include/check_ftwrl_compatible.inc
new file mode 100644
index 00000000000..200f8cd3d8a
--- /dev/null
+++ b/mysql-test/include/check_ftwrl_compatible.inc
@@ -0,0 +1,158 @@
+#
+# SUMMARY
+# Check that a statement is compatible with FLUSH TABLES WITH READ LOCK.
+#
+# PARAMETERS
+# $con_aux1 Name of the 1st aux connection to be used by this script.
+# $con_aux2 Name of the 2nd aux connection to be used by this script.
+# $statement The statement to be checked.
+# $cleanup_stmt The statement to be run in order to revert effects of
+# the statement to be checked.
+# $skip_3rd_chk Skip the 3rd stage of checking. The purpose of the third
+# stage is to check that metadata locks taken by this
+# statement are compatible with metadata locks taken
+# by FTWRL.
+#
+# EXAMPLE
+# flush_read_lock.test
+#
+--disable_result_log
+--disable_query_log
+
+# Reset DEBUG_SYNC facility for safety.
+set debug_sync= "RESET";
+
+#
+# First, check that the statement can be run under FTWRL.
+#
+flush tables with read lock;
+--disable_abort_on_error
+--eval $statement
+--enable_abort_on_error
+let $err= $mysql_errno;
+if (!$err)
+{
+--echo Success: Was able to run '$statement' under FTWRL.
+unlock tables;
+if ($cleanup_stmt)
+{
+--eval $cleanup_stmt;
+}
+}
+if ($err)
+{
+--echo Error: Wasn't able to run '$statement' under FTWRL!
+unlock tables;
+}
+
+#
+# Then check that this statement won't be blocked by FTWRL
+# that is active in another connection.
+#
+connection $con_aux1;
+flush tables with read lock;
+
+connection default;
+--send_eval $statement;
+
+connection $con_aux1;
+
+--enable_result_log
+--enable_query_log
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where info = "$statement";
+--source include/wait_condition.inc
+--disable_result_log
+--disable_query_log
+
+if ($success)
+{
+--echo Success: Was able to run '$statement' with FTWRL active in another connection.
+
+connection default;
+# Apparently statement was successfully executed and so
+# was not blocked by FTWRL.
+# To be safe against wait_condition.inc succeeding due to
+# races let us first reap the statement being checked to
+# ensure that it has been successfully executed.
+--reap
+
+connection $con_aux1;
+unlock tables;
+
+connection default;
+}
+if (!$success)
+{
+--echo Error: Wasn't able to run '$statement' with FTWRL active in another connection!
+unlock tables;
+connection default;
+--reap
+}
+
+if ($cleanup_stmt)
+{
+--eval $cleanup_stmt;
+}
+
+if (!$skip_3rd_check)
+{
+#
+# Finally, let us check that FTWRL will succeed if this statement
+# is active but has already closed its tables.
+#
+connection default;
+set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+--send_eval $statement;
+
+connection $con_aux1;
+set debug_sync="now WAIT_FOR parked";
+--send flush tables with read lock
+
+connection $con_aux2;
+--enable_result_log
+--enable_query_log
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where info = "flush tables with read lock";
+--source include/wait_condition.inc
+--disable_result_log
+--disable_query_log
+
+if ($success)
+{
+--echo Success: Was able to run FTWRL while '$statement' was active in another connection.
+connection $con_aux1;
+# Apparently FTWRL was successfully executed and so was not blocked by
+# the statement being checked. To be safe against wait_condition.inc
+# succeeding due to races let us first reap the FTWRL to ensure that it
+# has been successfully executed.
+--reap
+unlock tables;
+set debug_sync="now SIGNAL go";
+connection default;
+--reap
+}
+if (!$success)
+{
+--echo Error: Wasn't able to run FTWRL while '$statement' was active in another connection!
+set debug_sync="now SIGNAL go";
+connection default;
+--reap
+connection $con_aux1;
+--reap
+unlock tables;
+connection default;
+}
+
+set debug_sync= "RESET";
+if ($cleanup_stmt)
+{
+--eval $cleanup_stmt;
+}
+
+}
+
+--enable_result_log
+--enable_query_log
diff --git a/mysql-test/include/check_ftwrl_incompatible.inc b/mysql-test/include/check_ftwrl_incompatible.inc
new file mode 100644
index 00000000000..4787a69ea9c
--- /dev/null
+++ b/mysql-test/include/check_ftwrl_incompatible.inc
@@ -0,0 +1,155 @@
+#
+# SUMMARY
+# Check that a statement is incompatible with FLUSH TABLES WITH READ LOCK.
+#
+# PARAMETERS
+# $con_aux1 Name of the 1st aux connection to be used by this script.
+# $con_aux2 Name of the 2nd aux connection to be used by this script.
+# $statement The statement to be checked.
+# $cleanup_stmt1 The 1st statement to be run in order to revert effects
+# of statement to be checked.
+# $cleanup_stmt2 The 2nd statement to be run in order to revert effects
+# of statement to be checked.
+# $skip_3rd_chk Skip the 3rd stage of checking. The purpose of the third
+# stage is to check that metadata locks taken by this
+# statement are incompatible with metadata locks taken
+# by FTWRL.
+#
+# EXAMPLE
+# flush_read_lock.test
+#
+--disable_result_log
+--disable_query_log
+
+# Reset DEBUG_SYNC facility for safety.
+set debug_sync= "RESET";
+
+#
+# First, check that the statement cannot be run under FTWRL.
+#
+flush tables with read lock;
+--disable_abort_on_error
+--eval $statement
+--enable_abort_on_error
+let $err= $mysql_errno;
+if ($err)
+{
+--echo Success: Was not able to run '$statement' under FTWRL.
+unlock tables;
+}
+if (!$err)
+{
+--echo Error: Was able to run '$statement' under FTWRL!
+unlock tables;
+if ($cleanup_stmt1)
+{
+--eval $cleanup_stmt1;
+}
+if ($cleanup_stmt2)
+{
+--eval $cleanup_stmt2;
+}
+}
+
+
+#
+# Then check that this statement is blocked by FTWRL
+# that is active in another connection.
+#
+connection $con_aux1;
+flush tables with read lock;
+
+connection default;
+--send_eval $statement;
+
+connection $con_aux1;
+
+--enable_result_log
+--enable_query_log
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where (state = "Waiting for global read lock" or
+ state = "Waiting for commit lock") and
+ info = "$statement";
+--source include/wait_condition.inc
+--disable_result_log
+--disable_query_log
+
+if ($success)
+{
+--echo Success: '$statement' is blocked by FTWRL active in another connection.
+}
+if (!$success)
+{
+--echo Error: '$statement' wasn't blocked by FTWRL active in another connection!
+}
+unlock tables;
+
+connection default;
+--reap
+
+if ($cleanup_stmt1)
+{
+--eval $cleanup_stmt1;
+}
+if ($cleanup_stmt2)
+{
+--eval $cleanup_stmt2;
+}
+
+if (!$skip_3rd_check)
+{
+#
+# Finally, let us check that FTWRL will not succeed if this
+# statement is active but has already closed its tables.
+#
+connection default;
+--eval set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+--send_eval $statement;
+
+connection $con_aux1;
+set debug_sync="now WAIT_FOR parked";
+--send flush tables with read lock
+
+connection $con_aux2;
+--enable_result_log
+--enable_query_log
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where (state = "Waiting for global read lock" or
+ state = "Waiting for commit lock") and
+ info = "flush tables with read lock";
+--source include/wait_condition.inc
+--disable_result_log
+--disable_query_log
+
+if ($success)
+{
+--echo Success: FTWRL is blocked when '$statement' is active in another connection.
+}
+if (!$success)
+{
+--echo Error: FTWRL isn't blocked when '$statement' is active in another connection!
+}
+set debug_sync="now SIGNAL go";
+connection default;
+--reap
+connection $con_aux1;
+--reap
+unlock tables;
+connection default;
+
+set debug_sync= "RESET";
+
+if ($cleanup_stmt1)
+{
+--eval $cleanup_stmt1;
+}
+if ($cleanup_stmt2)
+{
+--eval $cleanup_stmt2;
+}
+}
+
+--enable_result_log
+--enable_query_log
diff --git a/mysql-test/include/check_no_concurrent_insert.inc b/mysql-test/include/check_no_concurrent_insert.inc
index c615ebd02cd..ea3187d9b41 100644
--- a/mysql-test/include/check_no_concurrent_insert.inc
+++ b/mysql-test/include/check_no_concurrent_insert.inc
@@ -23,7 +23,7 @@
# Reset DEBUG_SYNC facility for safety.
set debug_sync= "RESET";
-if (`SELECT '$restore_table' <> ''`)
+if ($restore_table)
{
--eval create temporary table t_backup select * from $restore_table;
}
@@ -68,7 +68,7 @@ if (!$success)
--eval delete from $table where i = 0;
-if (`SELECT '$restore_table' <> ''`)
+if ($restore_table)
{
--eval truncate table $restore_table;
--eval insert into $restore_table select * from t_backup;
diff --git a/mysql-test/include/check_slave_is_running.inc b/mysql-test/include/check_slave_is_running.inc
index 5fbbe0d684c..88664da7fa7 100644
--- a/mysql-test/include/check_slave_is_running.inc
+++ b/mysql-test/include/check_slave_is_running.inc
@@ -2,17 +2,29 @@
#
# Assert that the slave threads are running and don't have any errors.
#
+#
# ==== Usage ====
#
-# --source include/check_slave_running.inc
+# [--let $rpl_debug= 1]
+# --source include/check_slave_is_running.inc
+#
+# Parameters:
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= check_slave_is_running.inc
+--source include/begin_include_file.inc
+
+
+--let $slave_param= Slave_IO_Running
+--let $slave_param_value= Yes
+--source include/check_slave_param.inc
---echo Checking that both slave threads are running.
+--let $slave_param= Slave_SQL_Running
+--let $slave_param_value= Yes
+--source include/check_slave_param.inc
---let $slave_sql_running = query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1)
---let $slave_io_running = query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1)
-if (`SELECT '$slave_sql_running' != 'Yes' OR '$slave_io_running' != 'Yes'`) {
- --echo Slave not running: Slave_SQL_Running = $slave_sql_running Slave_IO_Running = $slave_io_running
- --source include/show_rpl_debug_info.inc
- --die Expected slave to be running, but it was not running.
-}
+--let $include_filename= check_slave_is_running.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/check_slave_no_error.inc b/mysql-test/include/check_slave_no_error.inc
index 371db5ed6a0..9922b426ed6 100644
--- a/mysql-test/include/check_slave_no_error.inc
+++ b/mysql-test/include/check_slave_no_error.inc
@@ -1,12 +1,22 @@
# ==== Purpose ====
#
-# Assert that Slave_SQL_Error and Slave_IO_Error are empty.
+# Assert that Slave_SQL_Errno = Slave_IO_Errno = 0 in the output from
+# SHOW SLAVE STATUS.
+#
#
# ==== Usage ====
#
-# --let $slave_param= Exec_Master_Log_Pos
-# --let $slave_param_value= 4711
-# --source include/check_slave_running.inc
+# [--let $rpl_debug= 1]
+# --source include/check_slave_no_error.inc
+#
+# Parameters:
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= check_slave_no_error.inc
+--source include/begin_include_file.inc
+
--let $slave_param= Last_SQL_Errno
--let $slave_param_value= 0
@@ -15,3 +25,7 @@
--let $slave_param= Last_IO_Errno
--let $slave_param_value= 0
--source include/check_slave_param.inc
+
+
+--let $include_filename= check_slave_no_error.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/check_slave_param.inc b/mysql-test/include/check_slave_param.inc
index d82c26851ea..243e87a9b65 100644
--- a/mysql-test/include/check_slave_param.inc
+++ b/mysql-test/include/check_slave_param.inc
@@ -4,13 +4,33 @@
#
# ==== Usage ====
#
-# --let $slave_param= Exec_Master_Log_Pos
-# --let $slave_param_value= 4711
+# --let $slave_param= COLUMN_NAME
+# --let $slave_param_value= VALUE
+# [--let $rpl_debug= 1]
# --source include/check_slave_param.inc
+#
+# Parameters:
+# $slave_param, $slave_param_value
+# Column name in output of SHOW SLAVE STATUS that should be checked,
+# and the expected value. Example:
+# --let $slave_param= Exec_Master_Log_Pos
+# --let $slave_param_value= 4711
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= check_slave_param.inc [$slave_param]
+--source include/begin_include_file.inc
+
--let $_param_value= query_get_value(SHOW SLAVE STATUS, $slave_param, 1)
-if (`SELECT '$_param_value' != '$slave_param_value'`) {
- --echo Wrong value for $slave_param. Expected '$slave_param_value', got '$_param_value'
+if ($_param_value != $slave_param_value) {
--source include/show_rpl_debug_info.inc
+ --echo Wrong value for $slave_param. Expected '$slave_param_value', got '$_param_value'
--die Wrong value for slave parameter
}
+
+
+--let $include_filename= check_slave_param.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/circular_rpl_for_4_hosts_init.inc b/mysql-test/include/circular_rpl_for_4_hosts_init.inc
deleted file mode 100644
index ac6654777db..00000000000
--- a/mysql-test/include/circular_rpl_for_4_hosts_init.inc
+++ /dev/null
@@ -1,130 +0,0 @@
-#############################################################
-#
-# Author: Serge Kozlov <skozlov@mysql.com>
-# Date: 03/11/2008
-# Purpose: Set up circular replication based on schema
-# A->B->C->D->A
-#
-# Notes:
-# 1. --slave-num=3 must be added to *-master.opt file
-# 2. Even the test uses new names for servers but file names
-# of log files are still old:
-# master_a -> master.[log|err]
-# master_b -> slave.[log|err]
-# master_c -> slave1.[log|err]
-# master_d -> slave2.[log|err]
-#
-#############################################################
---source include/master-slave.inc
-
-#
-# Set up circular ring by schema A->B->C->D->A
-#
-
---connection slave
-STOP SLAVE;
-RESET SLAVE;
-
-# master a
---connection master
---disconnect master
-connect (master_a,127.0.0.1,root,,test,$MASTER_MYPORT,);
-RESET MASTER;
---disable_warnings
-STOP SLAVE;
---enable_warnings
-RESET SLAVE;
-SET auto_increment_increment = 4;
-SET auto_increment_offset = 1;
-let $_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-
-# master b
---connection slave
---disconnect slave
-connect (master_b,127.0.0.1,root,,test,$SLAVE_MYPORT,);
-RESET MASTER;
-RESET SLAVE;
---replace_result $MASTER_MYPORT MASTER_A_PORT $_binlog_file MASTER_A_LOG_FILE
---eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root',MASTER_LOG_FILE='$_binlog_file'
-SET auto_increment_increment = 4;
-SET auto_increment_offset = 2;
-let $_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-
-# master c
---connection slave1
---disconnect slave1
-connect (master_c,127.0.0.1,root,,test,$SLAVE_MYPORT1,);
-RESET MASTER;
---disable_warnings
-STOP SLAVE;
---enable_warnings
-RESET SLAVE;
---replace_result $SLAVE_MYPORT MASTER_B_PORT $_binlog_file MASTER_B_LOG_FILE
---eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT,master_user='root',MASTER_LOG_FILE='$_binlog_file'
-SET auto_increment_increment = 4;
-SET auto_increment_offset = 3;
-let $_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-
-# master d
-connect (master_d,127.0.0.1,root,,test,$SLAVE_MYPORT2,);
-RESET MASTER;
---disable_warnings
-STOP SLAVE;
---enable_warnings
-RESET SLAVE;
---replace_result $SLAVE_MYPORT1 MASTER_C_PORT $_binlog_file MASTER_C_LOG_FILE
---eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT1,master_user='root',MASTER_LOG_FILE='$_binlog_file'
-SET auto_increment_increment = 4;
-SET auto_increment_offset = 4;
-let $_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
-
-# master a
---connection master_a
---replace_result $SLAVE_MYPORT2 MASTER_D_PORT $_binlog_file MASTER_D_LOG_FILE
---eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT2,master_user='root',MASTER_LOG_FILE='$_binlog_file'
-
-
-
-# Check server_ids: they should be different
---connection master_a
-let $_id_a= query_get_value(SHOW VARIABLES LIKE 'server_id', Value, 1);
-SHOW VARIABLES LIKE 'auto_increment_%';
---connection master_b
-let $_id_b= query_get_value(SHOW VARIABLES LIKE 'server_id', Value, 1);
-SHOW VARIABLES LIKE 'auto_increment_%';
---connection master_c
-let $_id_c= query_get_value(SHOW VARIABLES LIKE 'server_id', Value, 1);
-SHOW VARIABLES LIKE 'auto_increment_%';
---connection master_d
-let $_id_d= query_get_value(SHOW VARIABLES LIKE 'server_id', Value, 1);
-SHOW VARIABLES LIKE 'auto_increment_%';
---connection master_a
-let $_compared_ids= (($_id_a <> $_id_b) AND ($_id_a <> $_id_c) AND ($_id_a <> $_id_d) AND ($_id_b <> $_id_c) AND ($_id_b <> $_id_d) AND ($_id_c <> $_id_d)) AS a;
-let $_compared_ids_result= query_get_value(SELECT $_compared_ids, a, 1);
---echo $_compared_ids_result
-
-# Start ring
---connection master_a
-connect(slave,127.0.0.1,root,,test,$MASTER_MYPORT);
-START SLAVE;
---source include/wait_for_slave_to_start.inc
---disconnect slave
-
---connection master_b
-connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT1);
-START SLAVE;
---source include/wait_for_slave_to_start.inc
---disconnect slave
-
---connection master_c
-connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
-START SLAVE;
---source include/wait_for_slave_to_start.inc
---disconnect slave
-
---connection master_d
-connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
-START SLAVE;
---source include/wait_for_slave_to_start.inc
---disconnect slave
-
diff --git a/mysql-test/include/circular_rpl_for_4_hosts_sync.inc b/mysql-test/include/circular_rpl_for_4_hosts_sync.inc
deleted file mode 100644
index 68aede76913..00000000000
--- a/mysql-test/include/circular_rpl_for_4_hosts_sync.inc
+++ /dev/null
@@ -1,23 +0,0 @@
-#############################################################
-#
-# Author: Serge Kozlov <skozlov@mysql.com>
-# Date: 03/11/2008
-# Purpose: Sync all hosts for circular replication based on
-# schema A->B->C->D->A
-#
-# Notes: see include/circular_rpl_for_4_hosts_init.inc
-#
-#############################################################
-
-# Make the full loop of sync
---connection master_a
---disable_query_log
---sync_slave_with_master master_b
---sync_slave_with_master master_c
---sync_slave_with_master master_d
---sync_slave_with_master master_a
---sync_slave_with_master master_b
---sync_slave_with_master master_c
---save_master_pos
---connection master_a
---enable_query_log
diff --git a/mysql-test/include/cleanup_fake_relay_log.inc b/mysql-test/include/cleanup_fake_relay_log.inc
index 269cd04ca34..921484ec695 100644
--- a/mysql-test/include/cleanup_fake_relay_log.inc
+++ b/mysql-test/include/cleanup_fake_relay_log.inc
@@ -1,17 +1,28 @@
# ==== Purpose ====
#
-# Clean up files create by setup_fake_relay_log.inc.
+# Clean up files created by setup_fake_relay_log.inc.
#
# ==== Usage ====
#
# See setup_fake_relay_log.inc
---echo Cleaning up after setup_fake_relay_log.inc
+--let $include_filename= cleanup_fake_relay_log.inc
+--source include/begin_include_file.inc
+
--disable_query_log
---disable_warnings
-STOP SLAVE SQL_THREAD;
RESET SLAVE;
+
+# Assert that the fake relay log files are gone (RESET SLAVE should
+# have removed them).
+--let $file_does_not_exist= $_fake_relay_log
+--source include/file_does_not_exist.inc
+
+# Revert variables.
eval SET @@global.relay_log_purge= $_fake_relay_log_purge;
---enable_warnings
---enable_query_log
+
+eval CHANGE MASTER TO MASTER_HOST = '$_fake_old_master_host';
+
+
+--let $include_filename= cleanup_fake_relay_log.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc
index 81fbdb03bca..9df1571a849 100644
--- a/mysql-test/include/commit.inc
+++ b/mysql-test/include/commit.inc
@@ -502,16 +502,16 @@ call p_verify_status_increment(2, 2, 2, 2);
--echo # 12. Read-write statement: IODKU, change 0 rows.
--echo #
insert t1 set a=2 on duplicate key update a=2;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(2, 2, 1, 0);
commit;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(2, 2, 1, 0);
--echo # 13. Read-write statement: INSERT IGNORE, change 0 rows.
--echo #
insert ignore t1 set a=2;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(2, 2, 1, 0);
commit;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(2, 2, 1, 0);
--echo # 14. Read-write statement: INSERT IGNORE, change 1 row.
--echo #
diff --git a/mysql-test/include/ctype_8bit.inc b/mysql-test/include/ctype_8bit.inc
new file mode 100644
index 00000000000..7259db54d05
--- /dev/null
+++ b/mysql-test/include/ctype_8bit.inc
@@ -0,0 +1,46 @@
+#
+# Test Unicode conversion, upper, lower
+#
+SELECT @@collation_connection;
+CREATE TABLE t1 AS SELECT ' ' AS a LIMIT 0;
+INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07);
+INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17);
+INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27);
+INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37);
+INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47);
+INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57);
+INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67);
+INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77);
+INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87);
+INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F);
+INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97);
+INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F);
+INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7);
+INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF);
+INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7);
+INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF);
+INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7);
+INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF);
+INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7);
+INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF);
+INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7);
+INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF);
+INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7);
+INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF);
+SELECT
+ HEX(a) AS chr,
+ HEX(LOWER(a)) AS upper,
+ HEX(LOWER(a)) AS lower,
+ HEX(@utf8:=CONVERT(a USING utf8)) AS utf8,
+ HEX(@roundtrip:=CAST(@utf8 AS CHAR)) AS roundtrip,
+ if(a=BINARY @roundtrip,'','Round trip unsafe') AS issafe
+FROM t1 ORDER BY chr;
+DROP TABLE t1;
diff --git a/mysql-test/include/ctype_czech.inc b/mysql-test/include/ctype_czech.inc
new file mode 100644
index 00000000000..bc83d462a22
--- /dev/null
+++ b/mysql-test/include/ctype_czech.inc
@@ -0,0 +1,12 @@
+SELECT @@collation_connection;
+--echo #
+--echo # Bug#57737 Character sets: search fails with like, contraction, index
+--echo #
+CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0;
+INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch');
+SELECT * FROM t1 WHERE s1 LIKE 'c%';
+ALTER TABLE t1 ADD KEY s1 (s1);
+SELECT * FROM t1 WHERE s1 LIKE 'c%';
+ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1));
+SELECT * FROM t1 WHERE s1 LIKE 'ch';
+DROP TABLE t1;
diff --git a/mysql-test/include/ctype_like_ignorable.inc b/mysql-test/include/ctype_like_ignorable.inc
new file mode 100644
index 00000000000..9f2fa7ae741
--- /dev/null
+++ b/mysql-test/include/ctype_like_ignorable.inc
@@ -0,0 +1,11 @@
+SELECT @@collation_connection;
+--echo #
+--echo # Bug#57737 Character sets: search fails with like, contraction, index
+--echo # Part#2 - ignorable characters
+--echo #
+CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0;
+INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e');
+SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%';
+ALTER TABLE t1 ADD KEY s1 (s1);
+SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%';
+DROP TABLE t1;
diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc
index e32ed4103b5..1329bebb31f 100644
--- a/mysql-test/include/ctype_numconv.inc
+++ b/mysql-test/include/ctype_numconv.inc
@@ -1637,12 +1637,7 @@ CREATE TABLE t1 (a MEDIUMINT NULL) ENGINE=MYISAM;
INSERT INTO t1 VALUES (1234567);
SELECT GROUP_CONCAT(IFNULL(a,'')) FROM t1;
SELECT GROUP_CONCAT(IF(a,a,'')) FROM t1;
-if (`SELECT @@character_set_connection != 'ucs2'`)
-{
- # Temporarily disable for ucs2
- # For details, see Bug#55744 GROUP_CONCAT + CASE + ucs return garbage
- SELECT GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) FROM t1;
-}
+SELECT GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) FROM t1;
--enable_metadata
SELECT COALESCE(a,'') FROM t1 GROUP BY 1;
--disable_metadata
@@ -1730,6 +1725,66 @@ DROP TABLE t1;
--echo #
+--echo # Bug#58190 BETWEEN no longer uses indexes for date or datetime fields
+--echo #
+SELECT @@collation_connection;
+CREATE TABLE t1 (
+ id INT(11) DEFAULT NULL,
+ date_column DATE DEFAULT NULL,
+ KEY(date_column));
+INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
+EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
+ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
+EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
+DROP TABLE t1;
+
+
+--echo #
+--echo # Bug #31384 DATE_ADD() and DATE_SUB() return binary data
+--echo #
+SELECT @@collation_connection, @@character_set_results;
+CREATE TABLE t1 AS
+SELECT
+ DATE_SUB('2007-08-03', INTERVAL 1 MINUTE) AS field_str1,
+ DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS field1_str2,
+ DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY) AS field_date,
+ DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE) AS field_datetime;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+--enable_metadata
+# PS protocol gives different "Max length" value for DATETIME.
+--disable_ps_protocol
+SELECT
+ DATE_SUB('2007-08-03', INTERVAL 1 DAY) AS field_str1,
+ DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS field1_str2,
+ DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY) AS field_date,
+ DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE) AS field_datetime;
+--disable_metadata
+--enable_ps_protocol
+SELECT
+ HEX(DATE_SUB('2007-08-03', INTERVAL 1 MINUTE)) AS field_str1,
+ HEX(DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE)) AS field1_str2,
+ HEX(DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY)) AS field_date,
+ HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS field_datetime;
+
+--echo #
+--echo # Bug#11926811 / Bug#60625 Illegal mix of collations
+--echo #
+SELECT @@collation_connection;
+DELIMITER //;
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE v_LastPaymentDate DATETIME DEFAULT NULL;
+ SELECT v_LastPaymentDate < NOW();
+ EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW();
+ SHOW WARNINGS;
+ EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW());
+END//
+DELIMITER ;//
+CALL p1;
+DROP PROCEDURE p1;
+
+--echo #
--echo # Bug#52159 returning time type from function and empty left join causes debug assertion
--echo #
CREATE FUNCTION f1() RETURNS TIME RETURN 1;
diff --git a/mysql-test/include/diff_master_slave.inc b/mysql-test/include/diff_master_slave.inc
deleted file mode 100644
index b6d79190671..00000000000
--- a/mysql-test/include/diff_master_slave.inc
+++ /dev/null
@@ -1,21 +0,0 @@
-# ==== Purpose ====
-#
-# Diff the output of a statement on master and slave
-#
-# ==== Usage =====
-#
-# let $diff_statement= SELECT * FROM t1 WHERE a < 100;
-# source include/diff_master_slave.inc;
-
---echo source include/diff_master_slave.inc;
-disable_query_log;
-disable_result_log;
-
-exec $MYSQL test -e "$diff_statement" > $MYSQLTEST_VARDIR/tmp/diff_master.out;
-sync_slave_with_master;
-exec $MYSQL_SLAVE test -e "$diff_statement" > $MYSQLTEST_VARDIR/tmp/diff_slave.out;
-
-diff_files $MYSQLTEST_VARDIR/tmp/diff_master.out $MYSQLTEST_VARDIR/tmp/diff_slave.out;
-
-enable_result_log;
-enable_query_log;
diff --git a/mysql-test/include/diff_tables.inc b/mysql-test/include/diff_tables.inc
index 28ed6a1d137..5f88d8d3073 100644
--- a/mysql-test/include/diff_tables.inc
+++ b/mysql-test/include/diff_tables.inc
@@ -1,35 +1,41 @@
# ==== Purpose ====
#
-# Check if the two given tables (possibly residing on different
-# master/slave servers) are equal.
+# Check if all tables in the given list are equal. The tables may have
+# different names, exist in different connections, and/or reside in
+# different databases.
+#
#
# ==== Usage ====
#
-# The tables to check are given by the test language variables
-# $diff_table_1 and $diff_table_2. They must be of the
-# following form:
+# --let $diff_tables= [con1:][db1.]t1, [con2:][db2.]t2, ... , [conN:][dbN.]tN
+# [--let $rpl_debug= 1]
+# --source include/diff_tables.inc
+#
+# Parameters:
+# $diff_tables
+# Comma-separated list of tables to compare. Each table has the form
+#
+# [CONNECTION:][DATABASE.]table
#
-# [master:|slave:]database.table
+# If CONNECTION is given, then that connection is used. If
+# CONNECTION is not given, then the connection of the previous
+# table is used (or the current connection, if this is the first
+# table). If DATABASE is given, the table is read in that
+# database. If DATABASE is not given, the table is read in the
+# connection's current database.
+#
+# $rpl_debug
+# See include/rpl_init.inc
#
-# I.e., both database and table must be speicified. Optionally, you
-# can prefix the name with 'master:' (to read the table on master) or
-# with 'slave:' (to read the table on slave). If no prefix is given,
-# reads the table from the current connection. If one of these
-# variables has a prefix, both should have a prefix.
#
# ==== Side effects ====
#
-# - Prints "Comparing tables $diff_table_1 and $diff_tables_2".
+# - Prints "include/diff_tables.inc [$diff_tables]".
#
# - If the tables are different, prints the difference in a
# system-specific format (unified diff if supported) and generates
# an error.
#
-# - If $diff_table_1 or $diff_table_2 begins with 'master:' or
-# 'slave:', it will stay connected to one of those hosts after
-# execution. The host is only guaranteed to remain unchanged if
-# none of $diff_table_1 or $diff_table_2 begins with 'master:' or
-# 'slave:'.
#
# ==== Bugs ====
#
@@ -50,69 +56,135 @@
# by character case.
+--let $include_filename= diff_tables.inc [$diff_tables]
+--source include/begin_include_file.inc
+
+
+if (!$rpl_debug)
+{
+ --disable_query_log
+}
+
+
+# Check sanity
+if (`SELECT LOCATE(',', '$diff_tables') = 0`)
+{
+ --die ERROR IN TEST: $diff_tables must contain at least two tables (separated by comma)
+}
+
+
# ==== Save both tables to file ====
---echo Comparing tables $diff_table_1 and $diff_table_2
-disable_query_log;
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/diff_table_1
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/diff_table_2
-
-
-let $_diff_table=$diff_table_2;
-let $_diff_i=2;
-while ($_diff_i) {
-
- # Parse out any leading "master:" or "slave:" from the table specification
-# and connect the appropriate server.
- let $_pos= `SELECT LOCATE(':', '$_diff_table')`;
- let $_diff_conn=`SELECT SUBSTR('$_diff_table', 1, $_pos-1)`;
- if (`SELECT 'XX$_diff_conn' <> 'XX'`) {
- let $_diff_table=`SELECT SUBSTR('$_diff_table', $_pos+1)`;
- connection $_diff_conn;
+# Trim off whitespace
+--let $_dt_tables= `SELECT REPLACE('$diff_tables', ' ', '')`
+
+# Iterate over all tables
+--let $_dt_outfile=
+--let $_dt_prev_outfile=
+while ($_dt_tables)
+{
+ --let $_dt_table= `SELECT SUBSTRING_INDEX('$_dt_tables', ',', 1)`
+ --let $_dt_tables= `SELECT SUBSTRING('$_dt_tables', LENGTH('$_dt_table') + 2)`
+
+ # Parse connection, if any
+ --let $_dt_colon_index= `SELECT LOCATE(':', '$_dt_table')`
+ if ($_dt_colon_index)
+ {
+ --let $_dt_connection= `SELECT SUBSTRING('$_dt_table', 1, $_dt_colon_index - 1)`
+ --let $_dt_table= `SELECT SUBSTRING('$_dt_table', $_dt_colon_index + 1)`
+ --let $rpl_connection_name= $_dt_connection
+ --source include/rpl_connection.inc
+ }
+
+ # Parse database name, if any
+ --let $_dt_database_index= `SELECT LOCATE('.', '$_dt_table')`
+ if ($_dt_database_index)
+ {
+ --let $_dt_database= `SELECT SUBSTRING('$_dt_table', 1, $_dt_database_index - 1)`
+ --let $_dt_table= `SELECT SUBSTRING('$_dt_table', $_dt_database_index + 1)`
+ }
+ if (!$_dt_database_index)
+ {
+ --let $_dt_database= `SELECT DATABASE()`
}
- # Sanity-check the input.
- let $_diff_error= `SELECT '$_diff_table' NOT LIKE '_%._%'`;
- if ($_diff_error) {
- --echo !!!ERROR IN TEST: \$diff_table_$_diff_i='$_diff_table' is not in the form database.table
- exit;
+ if ($rpl_debug)
+ {
+ --echo con='$_dt_connection' db='$_dt_database' table='$_dt_table'
+ --echo rest of tables='$_dt_tables'
}
- # We need the output files to be sorted (so that diff_files does not
- # think the files are different just because they are differently
- # ordered). To this end, we first generate a query that sorts the
- # table by all columns. Since ORDER BY accept column indices, we
- # just generate a comma-separated list of all numbers from 1 to the
- # number of columns in the table.
- let $_diff_column_index=`SELECT MAX(ordinal_position)
- FROM information_schema.columns
- WHERE CONCAT(table_schema, '.', table_name) =
- '$_diff_table'`;
- let $_diff_column_list=$_diff_column_index;
- dec $_diff_column_index;
- while ($_diff_column_index) {
- let $_diff_column_list=$_diff_column_index, $_diff_column_list;
- dec $_diff_column_index;
+ # We need to sort the output files so that diff_files does not think
+ # the tables are different just because the rows are differently
+ # ordered. To this end, we first generate a string containing a
+ # comma-separated list of all column names. This is used in the
+ # ORDER BY clause of the following SELECT statement. We get the
+ # column names from INFORMATION_SCHEMA.COLUMNS, and we concatenate
+ # them with GROUP_CONCAT. Since GROUP_CONCAT is limited by the
+ # @@SESSION.group_concat_max_len, which is only 1024 by default, we
+ # first compute the total size of all columns and then increase this
+ # limit if needed. We restore the limit afterwards so as not to
+ # interfere with the test case.
+
+ # Compute length of ORDER BY clause.
+ let $_dt_order_by_length=
+ `SELECT SUM(LENGTH(column_name) + 3) FROM information_schema.columns
+ WHERE table_schema = '$_dt_database' AND table_name = '$_dt_table'`;
+ if (!$_dt_order_by_length)
+ {
+ --echo ERROR IN TEST: table $_dt_database.$_dt_table not found in INFORMATION_SCHEMA.COLUMNS. Did you misspell it?
+ --die ERROR IN TEST: table not found in INFORMATION_SCHEMA. Did you misspell it?
+ }
+ --let $_dt_old_group_concat_max_len=
+ # Increase group_concat_max_len if needed.
+ if (`SELECT $_dt_order_by_length > @@SESSION.group_concat_max_len`)
+ {
+ --let $_dt_old_group_concat_max_len= `SELECT @@SESSION.group_concat_max_len`
+ --eval SET SESSION group_concat_max_len = $_dt_order_by_length;
+ if ($rpl_debug)
+ {
+ --echo # increasing group_concat_max_len from $_dt_old_group_concat_max_len to $_dt_order_by_length
+ }
+ }
+ # Generate ORDER BY clause.
+ # It would be better to do GROUP_CONCAT(CONCAT('`', column_name, '`')) but
+ # BUG#58087 prevents us from returning strings that begin with backticks.
+ let $_dt_column_list=
+ `SELECT GROUP_CONCAT(column_name ORDER BY ORDINAL_POSITION SEPARATOR '`,`')
+ FROM information_schema.columns
+ WHERE table_schema = '$_dt_database' AND table_name = '$_dt_table'`;
+ # Restore group_concat_max_len.
+ if ($_dt_old_group_concat_max_len)
+ {
+ --let $_dt_dummy= `SET SESSION group_concat_max_len = $_dt_old_group_concat_max_len
+ }
+ if ($rpl_debug)
+ {
+ --echo using ORDER BY clause '`$_dt_column_list`'
}
# Now that we have the comma-separated list of columns, we can write
# the table to a file.
- eval SELECT * FROM $_diff_table ORDER BY $_diff_column_list
- INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/diff_table_$_diff_i';
+ --let $_dt_outfile= `SELECT @@datadir`
+ --let $_dt_outfile= $_dt_outfile/diff_table-$_dt_connection-$_dt_database-$_dt_table
+ eval SELECT * FROM $_dt_database.$_dt_table ORDER BY `$_dt_column_list` INTO OUTFILE '$_dt_outfile';
- # Do the same for $diff_table_1.
- dec $_diff_i;
- let $_diff_table=$diff_table_1;
+ # Compare files.
+ if ($_dt_prev_outfile)
+ {
+ if ($rpl_debug)
+ {
+ --echo # diffing $_dt_prev_outfile vs $_dt_outfile
+ }
+ --diff_files $_dt_prev_outfile $_dt_outfile
+ # Remove previous outfile. Keep current file for comparison with next table.
+ --remove_file $_dt_prev_outfile
+ }
+ --let $_dt_prev_outfile= $_dt_outfile
}
+--remove_file $_dt_prev_outfile
-# ==== Compare the generated files ====
-
-diff_files $MYSQLTEST_VARDIR/tmp/diff_table_1 $MYSQLTEST_VARDIR/tmp/diff_table_2;
-
---remove_file $MYSQLTEST_VARDIR/tmp/diff_table_1
---remove_file $MYSQLTEST_VARDIR/tmp/diff_table_2
-enable_query_log;
+--let $include_filename= diff_tables.inc [$diff_tables]
+--source include/end_include_file.inc
diff --git a/mysql-test/include/end_include_file.inc b/mysql-test/include/end_include_file.inc
new file mode 100644
index 00000000000..1e546c1215b
--- /dev/null
+++ b/mysql-test/include/end_include_file.inc
@@ -0,0 +1,79 @@
+# ==== Purpose ====
+#
+# See include/begin_include_file.inc
+#
+#
+# ==== Usage ====
+#
+# # At the end of include/my_file.inc:
+# --let $include_filename= my_file.inc
+# [--let $skip_restore_connection= 1]
+# [--let $rpl_debug= 1]
+# --source include/begin_include_file.inc
+#
+# Parameters:
+# $include_filename
+# Name of file that sources this file.
+#
+# $skip_restore_connection
+# By default, this script restores the connection that was active
+# when begin_include_file.inc was sourced. If
+# $skip_restore_connection is set, then this step is skipped and
+# end_include_file.inc leaves the connection as it was before
+# end_include_file.inc was sourced.
+
+--let $_tmp= `SELECT SUBSTRING('$_include_file_enabled_warnings', 1, 1)`
+--let $_include_file_enabled_warnings= `SELECT SUBSTRING('$_include_file_enabled_warnings', 2)`
+if ($_tmp) {
+ --enable_warnings
+}
+if (!$_tmp) {
+ --disable_warnings
+}
+
+--let $_tmp= `SELECT SUBSTRING('$_include_file_enabled_query_log', 1, 1)`
+--let $_include_file_enabled_query_log= `SELECT SUBSTRING('$_include_file_enabled_query_log', 2)`
+if ($_tmp) {
+ --enable_query_log
+}
+if (!$_tmp) {
+ --disable_query_log
+}
+
+--let $_tmp= `SELECT SUBSTRING('$_include_file_enabled_result_log', 1, 1)`
+--let $_include_file_enabled_result_log= `SELECT SUBSTRING('$_include_file_enabled_result_log', 2)`
+if ($_tmp) {
+ --enable_result_log
+}
+if (!$_tmp) {
+ --disable_result_log
+}
+
+--let $_tmp= `SELECT SUBSTRING('$_include_file_enabled_abort_on_error', 1, 1)`
+--let $_include_file_enabled_abort_on_error= `SELECT SUBSTRING('$_include_file_enabled_abort_on_error', 2)`
+if ($_tmp) {
+ --enable_abort_on_error
+}
+if (!$_tmp) {
+ --disable_abort_on_error
+}
+
+--let $_include_file_rpl_connection_name= `SELECT SUBSTRING_INDEX('$_include_file_connection', ',', 1)`
+--let $_include_file_connection= `SELECT SUBSTRING('$_include_file_connection', LENGTH('$_include_file_rpl_connection_name') + 2)`
+if (!$skip_restore_connection)
+{
+ --let $rpl_connection_name= $_include_file_rpl_connection_name
+ --source include/rpl_connection.inc
+}
+--let $skip_restore_connection= 0
+
+
+--dec $_include_file_depth
+--let $_include_file_indent= `SELECT REPEAT('.', $_include_file_depth)`
+
+if ($rpl_debug)
+{
+ --echo $_include_file_indent==== END include/$include_filename ====
+ --echo $_include_file_indent con='$CURRENT_CONNECTION' warn='$ENABLED_WARNINGS' qlog='$ENABLED_QUERY_LOG' rlog='$ENABLED_RESULT_LOG' aborterr='$ENABLED_ABORT_ON_ERROR'
+}
+--let $include_filename=
diff --git a/mysql-test/include/file_does_not_exist.inc b/mysql-test/include/file_does_not_exist.inc
new file mode 100644
index 00000000000..0b02c63a0a9
--- /dev/null
+++ b/mysql-test/include/file_does_not_exist.inc
@@ -0,0 +1,17 @@
+# ==== Purpose ====
+#
+# Checks that a given file does not exist. If the file exists, the
+# test fails.
+#
+# ==== Usage ====
+#
+# --let $file_does_not_exist= /path/to/file
+# --source include/file_does_not_exist.inc
+
+# Will fail if file exists.
+--write_file $file_does_not_exist
+tmp
+EOF
+
+# Remove file again.
+--remove_file $file_does_not_exist
diff --git a/mysql-test/include/force_restart.inc b/mysql-test/include/force_restart.inc
new file mode 100644
index 00000000000..d058e85df45
--- /dev/null
+++ b/mysql-test/include/force_restart.inc
@@ -0,0 +1,17 @@
+# ==== Purpose ====
+#
+# Tell mtr that all servers must be restarted after the test has
+# finished.
+#
+# ==== Usage ====
+#
+# --source include/force_restart.inc
+#
+# ==== See also ====
+#
+# include/force_restart_if_skipped.inc
+
+--let $_force_restart_datadir= `SELECT @@datadir`
+--append_file $_force_restart_datadir/mtr/force_restart
+1
+EOF
diff --git a/mysql-test/include/force_restart_if_skipped.inc b/mysql-test/include/force_restart_if_skipped.inc
new file mode 100644
index 00000000000..228e094e932
--- /dev/null
+++ b/mysql-test/include/force_restart_if_skipped.inc
@@ -0,0 +1,17 @@
+# ==== Purpose ====
+#
+# Tell mtr that all servers must be restarted in case the test is
+# skipped.
+#
+# ==== Usage ====
+#
+# --source include/force_restart_if_skipped.inc
+#
+# ==== See also ====
+#
+# include/force_restart.inc
+
+--let $_force_restart_datadir= `SELECT @@datadir`
+--append_file $_force_restart_datadir/mtr/force_restart_if_skipped
+1
+EOF
diff --git a/mysql-test/include/get_relay_log_pos.inc b/mysql-test/include/get_relay_log_pos.inc
index 7ce36fd3c50..61ee07fc655 100644
--- a/mysql-test/include/get_relay_log_pos.inc
+++ b/mysql-test/include/get_relay_log_pos.inc
@@ -10,12 +10,12 @@
# # at this point, get_relay_log_pos.inc sets $relay_log_pos. echo position
# # in $relay_log_file: $relay_log_pos.
-if (`SELECT '$relay_log_file' = ''`)
+if (!$relay_log_file)
{
--die 'variable $relay_log_file is null'
}
-if (`SELECT '$master_log_pos' = ''`)
+if (!$master_log_pos)
{
--die 'variable $master_log_pos is null'
}
diff --git a/mysql-test/include/gis_keys.inc b/mysql-test/include/gis_keys.inc
index c75311f062a..ad00c7e1ef9 100644
--- a/mysql-test/include/gis_keys.inc
+++ b/mysql-test/include/gis_keys.inc
@@ -44,3 +44,19 @@ SELECT COUNT(*) FROM t2 IGNORE INDEX(p) WHERE p=POINTFROMTEXT('POINT(1 2)');
DROP TABLE t1, t2;
--echo End of 5.0 tests
+
+
+--echo #
+--echo # Test for bug #58650 "Failing assertion: primary_key_no == -1 ||
+--echo # primary_key_no == 0".
+--echo #
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+--echo # The minimal test case.
+create table t1 (a int not null, b linestring not null, unique key b (b(12)), unique key a (a));
+drop table t1;
+--echo # The original test case.
+create table t1 (a int not null, b linestring not null, unique key b (b(12)));
+create unique index a on t1(a);
+drop table t1;
diff --git a/mysql-test/include/handler.inc b/mysql-test/include/handler.inc
index 65e9e61d077..57d368960bf 100644
--- a/mysql-test/include/handler.inc
+++ b/mysql-test/include/handler.inc
@@ -1545,8 +1545,6 @@ lock table not_exists_write read;
--echo # We still have the read lock.
--error ER_CANT_UPDATE_WITH_READLOCK
drop table t1;
-handler t1 read next;
-handler t1 close;
handler t1 open;
select a from t2;
handler t1 read next;
@@ -1809,9 +1807,32 @@ CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1);
HANDLER t1 OPEN;
# This used to cause the assert
---error ER_NO_SUCH_TABLE
+--error ER_NOT_SUPPORTED_YET
HANDLER t1 READ FIRST WHERE f1() = 1;
HANDLER t1 CLOSE;
DROP FUNCTION f1;
DROP TABLE t1;
+
+
+--echo #
+--echo # Bug#54920 Stored functions are allowed in HANDLER statements,
+--echo # but broken.
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+HANDLER t1 OPEN;
+
+--error ER_NOT_SUPPORTED_YET
+HANDLER t1 READ FIRST WHERE f1() = 1;
+
+HANDLER t1 CLOSE;
+DROP FUNCTION f1;
+DROP TABLE t1;
diff --git a/mysql-test/include/have_archive_plugin.inc b/mysql-test/include/have_archive_plugin.inc
index 98e146ca20b..566e2c49211 100644
--- a/mysql-test/include/have_archive_plugin.inc
+++ b/mysql-test/include/have_archive_plugin.inc
@@ -2,4 +2,3 @@ if (`select plugin_library IS NULL from information_schema.plugins where plugin_
{
--skip archive plugin not available
}
-
diff --git a/mysql-test/include/have_blackhole_plugin.inc b/mysql-test/include/have_blackhole_plugin.inc
index 749efd343d6..b5a3aa2c342 100644
--- a/mysql-test/include/have_blackhole_plugin.inc
+++ b/mysql-test/include/have_blackhole_plugin.inc
@@ -2,4 +2,3 @@ if (`select plugin_library IS NULL from information_schema.plugins where plugin_
{
--skip blackhole plugin not available;
}
-
diff --git a/mysql-test/include/have_dbi_dbd-mysql.inc b/mysql-test/include/have_dbi_dbd-mysql.inc
new file mode 100644
index 00000000000..212e36ac353
--- /dev/null
+++ b/mysql-test/include/have_dbi_dbd-mysql.inc
@@ -0,0 +1,78 @@
+#
+# Originally created by John Embretsen, 2011-01-26.
+#
+# Checks for the existence of Perl modules DBI and DBD::mysql as seen from the
+# perl installation used by "external" executable perl scripts, i.e. scripts
+# that are executed as standalone scripts interpreted by the perl installation
+# specified by the "shebang" line in the top of these scripts.
+#
+# If either module is not found, the test will be skipped.
+#
+# For use in tests that call perl scripts that require these modules.
+#
+# This file is intended to work on Unix. Windows may need different treatment.
+# Reasoning:
+# - "shebangs" are not relevant on Windows, but need to be handled here.
+# - Perl scripts cannot be made executable on Windows, interpreter must be
+# specified.
+#
+# Note that if there are multiple perl installations and not all have the
+# required modules, this check may fail even if the perl in path does have
+# the modules available. This may happen if the perl specified by the script's
+# shebang (e.g. #!/usr/bin/perl) does not have these modules, and script is
+# called without specifying the perl interpreter. However, this will be
+# a correct result in cases where a test calls a script with a similar shebang.
+#
+################################################################################
+
+--source include/not_windows.inc
+
+# We jump through some hoops since there is no direct way to check if an
+# external command went OK or not from a mysql-test file:
+#
+# - In theory, we could do as simple as "exec perl -MDBI -MDBD::mysql -e 1",
+# however we cannot check the result (exit code) from within a test script.
+# Also, this may not yield the same result as other uses of perl due to the
+# shebang issue mentioned above.
+# - Instead we use a separate helper perl script that checks for the modules.
+# - If the modules are found, the perl script leaves a file which sets a
+# variable that can be read by this file.
+# If the modules are not found, the perl script does not set this variable,
+# but leaves an empty file instead.
+#
+# This is done because there is apparently no direct way to transfer
+# information from perl to the test script itself.
+
+--disable_query_log
+--disable_result_log
+--disable_warnings
+
+# We do not use embedded perl in this script because that would not have yielded
+# correct results for a situation where an external Perl script is called like
+# "scriptname" instead of "perl scriptname" and the shebang in the script points
+# to a specific perl that may be different than the perl in PATH.
+#
+# Instead, we call a separate helper script which checks for the modules in its
+# own environment. We call it without "perl" in front.
+
+--let $perlChecker= $MYSQLTEST_VARDIR/std_data/checkDBI_DBD-mysql.pl
+--let $resultFile= $MYSQL_TMP_DIR/dbidbd-mysql.txt
+
+# Make the script executable and execute it.
+--chmod 0755 $perlChecker
+--exec $perlChecker
+
+# Source the resulting temporary file and look for a variable being set.
+--source $resultFile
+
+if (!$dbidbd) {
+ --skip Test needs Perl modules DBI and DBD::mysql
+}
+
+# Clean up
+--remove_file $resultFile
+
+--enable_query_log
+--enable_result_log
+--enable_warnings
+
diff --git a/mysql-test/include/have_example_plugin.inc b/mysql-test/include/have_example_plugin.inc
index bb84313eb4d..5571c345850 100644
--- a/mysql-test/include/have_example_plugin.inc
+++ b/mysql-test/include/have_example_plugin.inc
@@ -6,8 +6,9 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) {
}
#
-# Check if the variable HA_EXAMPLE_SO is set
+# Check if the variable EXAMPLE_PLUGIN is set
#
-if (`SELECT LENGTH('$HA_EXAMPLE_SO') = 0`) {
+if (!$HA_EXAMPLE_SO) {
--skip Need example plugin
}
+
diff --git a/mysql-test/include/have_innodb.inc b/mysql-test/include/have_innodb.inc
index c3c8b5cc4f2..fa3e586834c 100644
--- a/mysql-test/include/have_innodb.inc
+++ b/mysql-test/include/have_innodb.inc
@@ -1,5 +1,4 @@
-if (!`SELECT count(*) FROM information_schema.engines WHERE
- (support = 'YES' OR support = 'DEFAULT') AND
- engine = 'innodb'`){
- skip Needs innodb engine;
+if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb' AND support IN ('YES', 'DEFAULT', 'ENABLED')`)
+{
+ --skip Test requires InnoDB.
}
diff --git a/mysql-test/include/have_plugin_auth.inc b/mysql-test/include/have_plugin_auth.inc
new file mode 100644
index 00000000000..44ff4c2520d
--- /dev/null
+++ b/mysql-test/include/have_plugin_auth.inc
@@ -0,0 +1,5 @@
+disable_query_log;
+--require r/true.require
+select (PLUGIN_LIBRARY LIKE 'auth_test_plugin%') as `TRUE` FROM INFORMATION_SCHEMA.PLUGINS
+ WHERE PLUGIN_NAME='test_plugin_server';
+enable_query_log;
diff --git a/mysql-test/include/have_plugin_interface.inc b/mysql-test/include/have_plugin_interface.inc
new file mode 100644
index 00000000000..afe8ffad40d
--- /dev/null
+++ b/mysql-test/include/have_plugin_interface.inc
@@ -0,0 +1,5 @@
+--disable_query_log
+--require r/true.require
+select (PLUGIN_LIBRARY LIKE 'qa_auth_interface%') as `TRUE` FROM INFORMATION_SCHEMA.PLUGINS
+ WHERE PLUGIN_NAME='qa_auth_interface';
+--enable_query_log
diff --git a/mysql-test/include/have_plugin_server.inc b/mysql-test/include/have_plugin_server.inc
new file mode 100644
index 00000000000..aad1f026b44
--- /dev/null
+++ b/mysql-test/include/have_plugin_server.inc
@@ -0,0 +1,5 @@
+--disable_query_log
+--require r/true.require
+select (PLUGIN_LIBRARY LIKE 'qa_auth_server%') as `TRUE` FROM INFORMATION_SCHEMA.PLUGINS
+ WHERE PLUGIN_NAME='qa_auth_server';
+--enable_query_log
diff --git a/mysql-test/include/have_semisync_plugin.inc b/mysql-test/include/have_semisync_plugin.inc
index 62dbf878825..8a1679de636 100644
--- a/mysql-test/include/have_semisync_plugin.inc
+++ b/mysql-test/include/have_semisync_plugin.inc
@@ -8,7 +8,7 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) {
#
# Check if the variable SEMISYNC_MASTER_SO is set
#
-if (`select LENGTH('$SEMISYNC_MASTER_SO') = 0`)
+if (!$SEMISYNC_MASTER_SO)
{
skip Need semisync plugins;
}
diff --git a/mysql-test/include/have_simple_parser.inc b/mysql-test/include/have_simple_parser.inc
index 100c8fc7a5a..0c20c43eb3e 100644
--- a/mysql-test/include/have_simple_parser.inc
+++ b/mysql-test/include/have_simple_parser.inc
@@ -6,8 +6,9 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) {
}
#
-# Check if the variable MYPLUGLIB_SO is set
+# Check if the variable SIMPLE_PARSER is set
#
-if (`SELECT LENGTH('$MYPLUGLIB_SO') = 0`) {
+if (!$MYPLUGLIB_SO) {
--skip simple parser is not built (no mypluglib.so)
}
+
diff --git a/mysql-test/include/have_udf.inc b/mysql-test/include/have_udf.inc
index 1953cb4b303..be7390f854a 100644
--- a/mysql-test/include/have_udf.inc
+++ b/mysql-test/include/have_udf.inc
@@ -6,9 +6,9 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) {
}
#
-# Check if the variable UDF_EXAMPLE_SO is set
+# Check if the variable UDF_EXAMPLE_LIB is set
#
-#
-if (`SELECT LENGTH('$UDF_EXAMPLE_SO') = 0`) {
+if (!$UDF_EXAMPLE_SO) {
--skip Need udf example
}
+
diff --git a/mysql-test/include/index_merge2.inc b/mysql-test/include/index_merge2.inc
index 9b98eb3ebf2..23c8c6466c7 100644
--- a/mysql-test/include/index_merge2.inc
+++ b/mysql-test/include/index_merge2.inc
@@ -351,3 +351,115 @@ explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 4
select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
drop table t1;
+--echo #
+--echo # Bug#56423: Different count with SELECT and CREATE SELECT queries
+--echo #
+
+CREATE TABLE t1 (
+ a INT,
+ b INT,
+ c INT,
+ d INT,
+ PRIMARY KEY (a),
+ KEY (c),
+ KEY bd (b,d)
+);
+
+INSERT INTO t1 VALUES
+(1, 0, 1, 0),
+(2, 1, 1, 1),
+(3, 1, 1, 1),
+(4, 0, 1, 1);
+
+EXPLAIN
+SELECT a
+FROM t1
+WHERE c = 1 AND b = 1 AND d = 1;
+
+CREATE TABLE t2 ( a INT )
+SELECT a
+FROM t1
+WHERE c = 1 AND b = 1 AND d = 1;
+
+SELECT * FROM t2;
+
+DROP TABLE t1, t2;
+
+CREATE TABLE t1( a INT, b INT, KEY(a), KEY(b) );
+INSERT INTO t1 VALUES (1, 2), (1, 2), (1, 2), (1, 2);
+SELECT * FROM t1 FORCE INDEX(a, b) WHERE a = 1 AND b = 2;
+
+DROP TABLE t1;
+
+--echo # Code coverage of fix.
+CREATE TABLE t1 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b INT);
+INSERT INTO t1 (b) VALUES (1);
+UPDATE t1 SET b = 2 WHERE a = 1;
+SELECT * FROM t1;
+
+CREATE TABLE t2 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(1) );
+INSERT INTO t2 (b) VALUES ('a');
+UPDATE t2 SET b = 'b' WHERE a = 1;
+SELECT * FROM t2;
+
+DROP TABLE t1, t2;
+
+# The test was inactive for InnoDB at the time of pushing. The following is
+# expected result for the Bug#56423 test. It can be uncommented and pasted
+# into result file when reactivating the test.
+
+##
+## Bug#56423: Different count with SELECT and CREATE SELECT queries
+##
+#CREATE TABLE t1 (
+#a INT,
+#b INT,
+#c INT,
+#d INT,
+#PRIMARY KEY (a),
+#KEY (c),
+#KEY bd (b,d)
+#);
+#INSERT INTO t1 VALUES
+#(1, 0, 1, 0),
+#(2, 1, 1, 1),
+#(3, 1, 1, 1),
+#(4, 0, 1, 1);
+#EXPLAIN
+#SELECT a
+#FROM t1
+#WHERE c = 1 AND b = 1 AND d = 1;
+#id select_type table type possible_keys key key_len ref rows Extra
+#1 SIMPLE t1 ref c,bd bd 10 const,const 2 Using where
+#CREATE TABLE t2 ( a INT )
+#SELECT a
+#FROM t1
+#WHERE c = 1 AND b = 1 AND d = 1;
+#SELECT * FROM t2;
+#a
+#2
+#3
+#DROP TABLE t1, t2;
+#CREATE TABLE t1( a INT, b INT, KEY(a), KEY(b) );
+#INSERT INTO t1 VALUES (1, 2), (1, 2), (1, 2), (1, 2);
+#SELECT * FROM t1 FORCE INDEX(a, b) WHERE a = 1 AND b = 2;
+#a b
+#1 2
+#1 2
+#1 2
+#1 2
+#DROP TABLE t1;
+## Code coverage of fix.
+#CREATE TABLE t1 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b INT);
+#INSERT INTO t1 (b) VALUES (1);
+#UPDATE t1 SET b = 2 WHERE a = 1;
+#SELECT * FROM t1;
+#a b
+#1 2
+#CREATE TABLE t2 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(1) );
+#INSERT INTO t2 (b) VALUES ('a');
+#UPDATE t2 SET b = 'b' WHERE a = 1;
+#SELECT * FROM t2;
+#a b
+#1 b
+#DROP TABLE t1, t2;
diff --git a/mysql-test/include/io_thd_fault_injection.inc b/mysql-test/include/io_thd_fault_injection.inc
new file mode 100644
index 00000000000..7cbe055dbf6
--- /dev/null
+++ b/mysql-test/include/io_thd_fault_injection.inc
@@ -0,0 +1,21 @@
+#
+# Takes the flag as an argument:
+# -- let $io_thd_injection_fault_flag=+d,fault_injection_new_file_rotate_event
+# -- source include/io_thd_fault_injection.inc
+#
+
+SET @old_debug=@@global.debug;
+-- disable_warnings
+-- source include/stop_slave.inc
+-- enable_warnings
+-- eval SET GLOBAL debug="+d,$io_thd_injection_fault_flag"
+
+START SLAVE io_thread;
+-- source include/wait_for_slave_io_error.inc
+
+-- eval SET GLOBAL debug="-d,$io_thd_injection_fault_flag"
+SET GLOBAL debug=@old_debug;
+
+# restart because slave is in bad shape
+--let $rpl_server_number= 2
+--source include/rpl_restart_server.inc
diff --git a/mysql-test/include/kill_query.inc b/mysql-test/include/kill_query.inc
index b303ed0ec39..1c949d3cbad 100644
--- a/mysql-test/include/kill_query.inc
+++ b/mysql-test/include/kill_query.inc
@@ -44,7 +44,7 @@ connection master;
# kill the query that is waiting
eval kill query $connection_id;
-if (`SELECT '$debug_lock' != ''`)
+if ($debug_lock)
{
# release the lock to allow binlog continue
eval SELECT RELEASE_LOCK($debug_lock);
@@ -57,7 +57,7 @@ reap;
connection master;
-if (`SELECT '$debug_lock' != ''`)
+if ($debug_lock)
{
# get lock again to make the next query wait
eval SELECT GET_LOCK($debug_lock, 10);
diff --git a/mysql-test/include/kill_query_and_diff_master_slave.inc b/mysql-test/include/kill_query_and_diff_master_slave.inc
index 611d6929c99..59588551af5 100644
--- a/mysql-test/include/kill_query_and_diff_master_slave.inc
+++ b/mysql-test/include/kill_query_and_diff_master_slave.inc
@@ -9,35 +9,35 @@
# connection <CONNECTION>;
# let $connection_name=<CONNECTION>
# let $connection_id=`SELECT CONNECTION_ID()`;
-# let $diff_statement=<SQL COMMAND>;
+# let $rpl_diff_statement=<SQL COMMAND>;
# send <SQL COMMAND>;
# source include/kill_query_and_diff_master_slave.inc;
#
# Note: <CONNECTION> must not be 'master'.
#
-# See also kill_query.inc and diff_master_slave.inc for more
+# See also kill_query.inc and rpl_diff.inc for more
# information
source include/kill_query.inc;
# Release the debug lock if used, so that the statements in
-# diff_master_slave.inc will not be blocked.
+# rpl_diff.inc will not be blocked.
connection master;
disable_query_log;
disable_result_log;
-if (`SELECT '$debug_lock' != ''`)
+if ($debug_lock)
{
eval SELECT RELEASE_LOCK($debug_lock);
}
enable_result_log;
enable_query_log;
-source include/diff_master_slave.inc;
+--source include/rpl_diff.inc
# Acquire the debug lock again if used
connection master;
-disable_query_log; disable_result_log; if (`SELECT '$debug_lock' !=
-''`) { eval SELECT GET_LOCK($debug_lock, 10); } enable_result_log;
-enable_query_log;
+disable_query_log; disable_result_log;
+if ($debug_lock) { eval SELECT GET_LOCK($debug_lock, 10); }
+enable_result_log; enable_query_log;
connection $connection_name;
diff --git a/mysql-test/include/master-slave-end.inc b/mysql-test/include/master-slave-end.inc
deleted file mode 100644
index 74e4c7b608a..00000000000
--- a/mysql-test/include/master-slave-end.inc
+++ /dev/null
@@ -1,6 +0,0 @@
---connection master
---sync_slave_with_master
---connection slave
---disable_query_log
-STOP SLAVE;
---enable_query_log
diff --git a/mysql-test/include/master-slave-reset.inc b/mysql-test/include/master-slave-reset.inc
deleted file mode 100644
index f54f5b83eb5..00000000000
--- a/mysql-test/include/master-slave-reset.inc
+++ /dev/null
@@ -1,75 +0,0 @@
-# Reset the master and the slave to start fresh.
-#
-# It is necessary to execute RESET MASTER and RESET SLAVE on both
-# master and slave since the replication setup might be circular.
-#
-# Since we expect STOP SLAVE to produce a warning as the slave is
-# stopped (the server was started with skip-slave-start), we disable
-# warnings when doing STOP SLAVE.
-#
-# $no_change_master If true, no change master will be done nor any reset slave.
-# This is to avoid touching the relay-log.info file allowing
-# the test to create one itself.
-# $skip_slave_start If true, the slave will not be started
-
-connection slave;
-
-#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;
---disable_query_log
-if (!$no_change_master) {
- eval CHANGE MASTER TO MASTER_USER='root',
- MASTER_CONNECT_RETRY=1,
- MASTER_HOST='127.0.0.1',
- MASTER_PORT=$MASTER_MYPORT;
-}
---enable_query_log
-source include/wait_for_slave_to_stop.inc;
---enable_warnings
-
-connection master;
---disable_warnings
---disable_query_log
-use test;
---enable_query_log
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
---enable_warnings
-reset master;
-
---disable_query_log
-if (!$no_change_master) {
- reset slave;
-}
---enable_query_log
-connection slave;
-
---disable_warnings
-# the first RESET SLAVE may produce a warning about non-existent
-# 'ndb_apply_status' table, because this table is created
-# asynchronously at the server startup and may not exist yet
-# if RESET SLAVE comes too soon after the server startup
-if (!$no_change_master) {
- reset slave;
-}
---enable_warnings
-
-# Clean up old test tables
---disable_warnings
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
---enable_warnings
-
---disable_query_log
-#eval CHANGE MASTER TO MASTER_USER='root',
-# MASTER_CONNECT_RETRY=1,
-# MASTER_HOST='127.0.0.1',
-# MASTER_PORT=$MASTER_MYPORT;
-reset master;
---enable_query_log
-
-if (!$skip_slave_start) {
- start slave;
- source include/wait_for_slave_to_start.inc;
-}
-
diff --git a/mysql-test/include/master-slave.inc b/mysql-test/include/master-slave.inc
index 134bb61ddab..9ed206b2c22 100644
--- a/mysql-test/include/master-slave.inc
+++ b/mysql-test/include/master-slave.inc
@@ -1,19 +1,63 @@
-# Replication tests need binlog
+# ==== Purpose ====
#
-# $skip_slave_start If true, the slave will not be started
-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,);
+# Configure two servers to be replication master and slave.
+#
+# ==== Usage ====
+#
+# [--let $rpl_server_count= N]
+# [--let $rpl_check_server_ids= 1]
+# [--let $rpl_skip_reset_master_and_slave= 1]
+# [--let $rpl_skip_change_master= 1]
+# [--let $rpl_skip_start_slave= 1]
+# [--let $rpl_debug= 1]
+# [--let $slave_timeout= NUMBER]
+# --source include/master-slave.inc
+#
+# Parameters:
+# $rpl_check_server_ids, $rpl_skip_reset_master_and_slave,
+# $rpl_skip_change_master, $rpl_skip_start_slave, $rpl_debug,
+# $slave_timeout
+# See include/rpl_init.inc
+#
+# $rpl_server_count
+# By default, two servers are configured. You can configure more
+# servers (servers 3, 4, etc are neither masters nor slaves) by
+# setting this variable. See also include/rpl_init.inc
--- source include/master-slave-reset.inc
-if (!$skip_slave_start) {
- connection master;
- sync_slave_with_master;
+--let $include_filename= master-slave.inc
+if ($rpl_server_count)
+{
+ --let $include_filename= master-slave.inc [rpl_server_count=$rpl_server_count]
}
+--source include/begin_include_file.inc
+
+
+--let $rpl_topology= 1->2
+--source include/rpl_init.inc
+
+--let $rpl_connection_name= master
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= master1
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= slave
+--let $rpl_server_number= 2
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= slave1
+--let $rpl_server_number= 2
+--source include/rpl_connect.inc
+
+
+--let $include_filename= master-slave.inc
+--source include/end_include_file.inc
+
-# Set the default connection to 'master'
-connection master;
+# Set the default connection to 'master'. Do this after
+# end_include_file.inc, so that it gets printed to the query log.
+--let $rpl_connection_name= master
+--source include/rpl_connection.inc
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index 0449bae2790..c5995987914 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -634,6 +634,10 @@ drop table t1;
drop table bug29807;
create table bug29807 (a int);
drop table bug29807;
+--disable_query_log
+call mtr.add_suppression("InnoDB: Error: table .test...bug29807. does not exist in the InnoDB internal");
+call mtr.add_suppression("Cannot find or open table test\/bug29807 from");
+--enable_query_log
#
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql
index 798b0774849..a5654d3596c 100644
--- a/mysql-test/include/mtr_check.sql
+++ b/mysql-test/include/mtr_check.sql
@@ -59,13 +59,3 @@ BEGIN
mysql.user;
END||
-
---
--- Procedure used by test case used to force all
--- servers to restart after testcase and thus skipping
--- check test case after test
---
-CREATE DEFINER=root@localhost PROCEDURE force_restart()
-BEGIN
- SELECT 1 INTO OUTFILE 'force_restart';
-END||
diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql
index 0a43d11f327..7446504424b 100644
--- a/mysql-test/include/mtr_warnings.sql
+++ b/mysql-test/include/mtr_warnings.sql
@@ -16,6 +16,12 @@ CREATE TABLE test_suppressions (
-- no invalid patterns can be inserted
-- into test_suppressions
--
+SET @character_set_client_saved = @@character_set_client||
+SET @character_set_results_saved = @@character_set_results||
+SET @collation_connection_saved = @@collation_connection||
+SET @@character_set_client = latin1||
+SET @@character_set_results = latin1||
+SET @@collation_connection = latin1_swedish_ci||
/*!50002
CREATE DEFINER=root@localhost TRIGGER ts_insert
BEFORE INSERT ON test_suppressions
@@ -24,6 +30,9 @@ FOR EACH ROW BEGIN
SELECT "" REGEXP NEW.pattern INTO dummy;
END
*/||
+SET @@character_set_client = @character_set_client_saved||
+SET @@character_set_results = @character_set_results_saved||
+SET @@collation_connection = @collation_connection_saved||
--
@@ -38,6 +47,12 @@ CREATE TABLE global_suppressions (
-- no invalid patterns can be inserted
-- into global_suppressions
--
+SET @character_set_client_saved = @@character_set_client||
+SET @character_set_results_saved = @@character_set_results||
+SET @collation_connection_saved = @@collation_connection||
+SET @@character_set_client = latin1||
+SET @@character_set_results = latin1||
+SET @@collation_connection = latin1_swedish_ci||
/*!50002
CREATE DEFINER=root@localhost TRIGGER gs_insert
BEFORE INSERT ON global_suppressions
@@ -46,6 +61,9 @@ FOR EACH ROW BEGIN
SELECT "" REGEXP NEW.pattern INTO dummy;
END
*/||
+SET @@character_set_client = @character_set_client_saved||
+SET @@character_set_results = @character_set_results_saved||
+SET @@collation_connection = @collation_connection_saved||
@@ -53,7 +71,7 @@ END
-- Insert patterns that should always be suppressed
--
INSERT INTO global_suppressions VALUES
- ("'SELECT UNIX_TIMESTAMP\\(\\)' failed on master"),
+ (".SELECT UNIX_TIMESTAMP... failed on master"),
("Aborted connection"),
("Client requested master to start replication from impossible position"),
("Could not find first log file name in binary log"),
@@ -107,11 +125,9 @@ INSERT INTO global_suppressions VALUES
("Slave: The incident LOST_EVENTS occured on the master"),
("Slave: Unknown error.* 1105"),
("Slave: Can't drop database.* database doesn't exist"),
- ("Slave SQL:.*(Error_code: \[\[:digit:\]\]+|Query:.*)"),
("Sort aborted"),
("Time-out in NDB"),
("Warning:\s+One can only use the --user.*root"),
- ("Warning:\s+Setting lower_case_table_names=2"),
("Warning:\s+Table:.* on (delete|rename)"),
("You have an error in your SQL syntax"),
("deprecated"),
@@ -124,56 +140,20 @@ INSERT INTO global_suppressions VALUES
("slave SQL thread aborted"),
("Slave: .*Duplicate entry"),
- /*
- Special case, made as specific as possible, for:
- Bug #28436: Incorrect position in SHOW BINLOG EVENTS causes
- server coredump
- */
-
- ("Error in Log_event::read_log_event\\\(\\\): 'Sanity check failed', data_len: 258, event_type: 49"),
-
("Statement may not be safe to log in statement format"),
- /* test case for Bug#bug29807 copies a stray frm into database */
- ("InnoDB: Error: table `test`.`bug29807` does not exist in the InnoDB internal"),
- ("Cannot find or open table test\/bug29807 from"),
-
/* innodb foreign key tests that fail in ALTER or RENAME produce this */
("InnoDB: Error: in ALTER TABLE `test`.`t[123]`"),
("InnoDB: Error: in RENAME TABLE table `test`.`t1`"),
("InnoDB: Error: table `test`.`t[123]` does not exist in the InnoDB internal"),
- /* Test case for Bug#14233 produces the following warnings: */
- ("Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc"),
- ("Stored routine 'test'.'bug14233_2': invalid value in column mysql.proc"),
- ("Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc"),
-
/*
BUG#32080 - Excessive warnings on Solaris: setrlimit could not
change the size of core files
*/
("setrlimit could not change the size of core files to 'infinity'"),
- /*
- rpl_extrColmaster_*.test, the slave thread produces warnings
- when it get updates to a table that has more columns on the
- master
- */
- ("Slave: Unknown column 'c7' in 't15' Error_code: 1054"),
- ("Slave: Can't DROP 'c7'.* 1091"),
- ("Slave: Key column 'c6'.* 1072"),
("The slave I.O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master."),
- (".SELECT UNIX_TIMESTAMP... failed on master, do not trust column Seconds_Behind_Master of SHOW SLAVE STATUS"),
-
- /* Test case for Bug#31590 in order_by.test produces the following error */
- ("Out of sort memory; increase server sort buffer size"),
-
- /* Special case for Bug #26402 in show_check.test
- - Question marks are not valid file name parts on Windows. Ignore
- this error message.
- */
- ("Can't find file: '.\\\\test\\\\\\?{8}.frm'"),
- ("Slave: Unknown table 't1' Error_code: 1051"),
/* Added 2009-08-XX after fixing Bug #42408 */
@@ -213,14 +193,6 @@ INSERT INTO global_suppressions VALUES
("==[0-9]*== Warning: invalid file descriptor -1 in syscall read()"),
/*
- Transient network failures that cause warnings on reconnect.
- BUG#47743 and BUG#47983.
- */
- ("Slave I/O: Get master SERVER_ID failed with error:.*"),
- ("Slave I/O: Get master clock failed with error:.*"),
- ("Slave I/O: Get master COLLATION_SERVER failed with error:.*"),
- ("Slave I/O: Get master TIME_ZONE failed with error:.*"),
- /*
BUG#42147 - Concurrent DML and LOCK TABLE ... READ for InnoDB
table cause warnings in errlog
Note: This is a temporary suppression until Bug#42147 can be
diff --git a/mysql-test/include/mysql_upgrade_preparation.inc b/mysql-test/include/mysql_upgrade_preparation.inc
index 5de8a79d6e0..a3c81c4c1e7 100644
--- a/mysql-test/include/mysql_upgrade_preparation.inc
+++ b/mysql-test/include/mysql_upgrade_preparation.inc
@@ -17,7 +17,7 @@ select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
# Therefore, truncate the log table in advance and issue a statement
# that should be logged.
#
-if (`SELECT $VALGRIND_TEST`)
+if ($VALGRIND_TEST)
{
--disable_query_log
--disable_result_log
diff --git a/mysql-test/include/mysqld--help.inc b/mysql-test/include/mysqld--help.inc
index 36e9af6d429..a39615d6011 100644
--- a/mysql-test/include/mysqld--help.inc
+++ b/mysql-test/include/mysqld--help.inc
@@ -7,15 +7,27 @@
# force lower-case-table-names=1 (linux/macosx have different defaults)
# force symbolic-links=0 (valgrind build has a different default)
#
+
exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --lower-case-table-names=1 --help --verbose > $MYSQL_TMP_DIR/mysqld--help.txt 2>&1;
+# The inline perl code below will copy $MYSQL_TMP_DIR/mysqld--help.txt
+# to output, but filter away some variable stuff (e.g. paths).
+
perl;
+ # Variables which we don't want to display in the result file since
+ # their paths may vary:
@skipvars=qw/basedir open-files-limit general-log-file log plugin-dir
log-slow-queries pid-file slow-query-log-file
- datadir slave-load-tmpdir tmpdir/;
+ datadir slave-load-tmpdir tmpdir socket/;
+
+ # Plugins which may or may not be there:
@plugins=qw/innodb ndb archive blackhole federated partition ndbcluster debug temp-pool ssl des-key-file
thread-concurrency super-large-pages mutex-deadlock-detector null-audit maria aria pbxt oqgraph sphinx/;
- @env=qw/MYSQLTEST_VARDIR MYSQL_TEST_DIR MYSQL_LIBDIR MYSQL_CHARSETSDIR MYSQL_SHAREDIR /;
+
+ # And substitute the content some environment variables with their
+ # names:
+ @env=qw/MYSQLTEST_VARDIR MYSQL_TEST_DIR MYSQL_LIBDIR MYSQL_CHARSETSDIR MYSQL_SHAREDIR/;
+
$re1=join('|', @skipvars, @plugins);
$re2=join('|', @plugins);
$skip=0;
diff --git a/mysql-test/include/mysqldump.inc b/mysql-test/include/mysqldump.inc
index 6227138b012..3a53bf8e3bd 100644
--- a/mysql-test/include/mysqldump.inc
+++ b/mysql-test/include/mysqldump.inc
@@ -41,8 +41,7 @@ eval ALTER TABLE $table_name RENAME to $orig_table_name;
--echo # Compare original and recreated tables
--echo # Recreated table: $table_name
--echo # Original table: $orig_table_name
-let $diff_table_1 = $table_name;
-let $diff_table_2 = $orig_table_name;
+let $diff_tables = $table_name, $orig_table_name;
--source include/diff_tables.inc
--echo # Cleanup
--remove_file $mysqldumpfile
diff --git a/mysql-test/include/mysqlhotcopy.inc b/mysql-test/include/mysqlhotcopy.inc
index 2ea017fe8da..779ed7f36e0 100644
--- a/mysql-test/include/mysqlhotcopy.inc
+++ b/mysql-test/include/mysqlhotcopy.inc
@@ -4,12 +4,26 @@
--source include/not_windows.inc
--source include/not_embedded.inc
+--source include/have_dbi_dbd-mysql.inc
if (!$MYSQLHOTCOPY)
{
+ # Fail the test if the mysqlhotcopy script is missing.
+ # If the tool's location changes, mysql-test-run.pl must be updated to
+ # reflect this (look for "MYSQLHOTCOPY").
die due to missing mysqlhotcopy tool;
}
+# NOTE (johnemb, 2011-01-26):
+# In this test mysqlhotcopy (a perl script) is executed as a standalone
+# executable, i.e. not necessarily using the perl interpreter in PATH,
+# because that is how the documentation demonstrates it.
+#
+# We include have_dbi_dbd-mysql.inc above so that the test will
+# be skipped if Perl modules required by the mysqlhotcopy tool are not
+# found when the script is run this way.
+
+
let $MYSQLD_DATADIR= `SELECT @@datadir`;
--disable_warnings
DROP DATABASE IF EXISTS hotcopy_test;
@@ -95,7 +109,7 @@ DROP DATABASE hotcopy_save;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--list_files $MYSQLD_DATADIR/hotcopy_save
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
---error 9,2304
+--error 9,11,2304
--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
--exec $MYSQLHOTCOPY --quiet --allowold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
diff --git a/mysql-test/include/ndb_master-slave.inc b/mysql-test/include/ndb_master-slave.inc
index 0bf4b701f0c..8305a310953 100644
--- a/mysql-test/include/ndb_master-slave.inc
+++ b/mysql-test/include/ndb_master-slave.inc
@@ -1,10 +1,4 @@
-# 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,);
+--source include/master-slave.inc
connection slave;
# Check that server is compiled and started with support for NDB
@@ -14,7 +8,5 @@ select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schem
--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_master-slave_2ch.inc b/mysql-test/include/ndb_master-slave_2ch.inc
index 52a06c01d86..17017d2b801 100644
--- a/mysql-test/include/ndb_master-slave_2ch.inc
+++ b/mysql-test/include/ndb_master-slave_2ch.inc
@@ -1,7 +1,6 @@
-#############################################################
-# Author: Serge Kozlov <skozlov@mysql.com>
-# Date: 03/17/2008
-# Purpose: Set up circular cluster replication where each
+# ==== Purpose ====
+#
+# Set up circular cluster replication where each
# cluster has two mysqlds and replication directions are
# following:
# master ---> slave
@@ -9,128 +8,60 @@
# cluster A cluster B
# \ /
# master1 <--- slave1
-#############################################################
-
---source include/have_log_bin.inc
+#
+# ==== Usage ====
+#
+# [--let $rpl_server_count= N]
+# [--let $rpl_skip_check_server_ids= 1]
+# [--let $rpl_skip_reset_master_and_slave= 1]
+# [--let $rpl_skip_change_master= 1]
+# [--let $rpl_skip_start_slave= 1]
+# [--let $rpl_debug= 1]
+# [--let $slave_timeout= NUMBER]
+# --source include/ndb_master-slave_2ch.inc
+#
+# Parameters:
+# $rpl_server_count, $rpl_skip_check_server_ids,
+# $rpl_skip_reset_master_and_slave, $rpl_skip_change_master,
+# $rpl_skip_start_slave, $rpl_debug, $slave_timeout
+# See include/master-slave.inc
+
+--let $rpl_topology= 1->2,4->3
+--let $rpl_skip_check_server_ids= 1
+--source include/rpl_init.inc
# Make connections to mysqlds
-connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
-connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT1,);
-connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
-connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT1,);
-
-# Check that all mysqld compiled with ndb support
-
---connection master
---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
-
---connection master1
---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
-
---connection slave
---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
-
---connection slave1
---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
-
-# Stop slaves
-
---connection master
---disable_warnings
-STOP SLAVE;
---wait_for_slave_to_stop
---enable_warnings
+--let $rpl_connection_name= master
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
---connection master1
---disable_warnings
-STOP SLAVE;
---wait_for_slave_to_stop
---enable_warnings
+--let $rpl_connection_name= master1
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
---connection slave
---disable_warnings
-STOP SLAVE;
---wait_for_slave_to_stop
---enable_warnings
+--let $rpl_connection_name= slave
+--let $rpl_server_number= 2
+--source include/rpl_connect.inc
---connection slave1
---disable_warnings
-STOP SLAVE;
---wait_for_slave_to_stop
---enable_warnings
+--let $rpl_connection_name= slave1
+--let $rpl_server_number= 2
+--source include/rpl_connect.inc
-# Reset masters
---connection master
---disable_warnings
---disable_query_log
-USE test;
---enable_query_log
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
---enable_warnings
-RESET MASTER;
-
---connection master1
---disable_warnings
---disable_query_log
-USE test;
---enable_query_log
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
---enable_warnings
-RESET MASTER;
-
---connection slave
---disable_warnings
---disable_query_log
-USE test;
---enable_query_log
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
---enable_warnings
-RESET MASTER;
-
---connection slave1
---disable_warnings
---disable_query_log
-USE test;
---enable_query_log
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
---enable_warnings
-RESET MASTER;
-
-# Start slaves
-
---connection slave
-RESET SLAVE;
---replace_result $MASTER_MYPORT MASTER_MYPORT
---eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root'
-START SLAVE;
---source include/wait_for_slave_to_start.inc
-
---connection master1
-RESET SLAVE;
---replace_result $SLAVE_MYPORT1 SLAVE_MYPORT1
---eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT1,master_user='root'
-START SLAVE;
---source include/wait_for_slave_to_start.inc
+# Check that all mysqld are compiled with ndb support
+--let $_rpl_server= 4
+while ($_rpl_server)
+{
+ --connection server_$_rpl_server
+ if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'ndbcluster' AND (support = 'YES' OR support = 'DEFAULT')`)
+ {
+ --skip Test requires NDB.
+ }
+ --source include/ndb_not_readonly.inc
+ --dec $_rpl_server
+}
# Set the default connection to 'master' (cluster A)
connection master;
-
diff --git a/mysql-test/include/ndb_not_readonly.inc b/mysql-test/include/ndb_not_readonly.inc
index f50ca0cab66..ebb343bb18d 100644
--- a/mysql-test/include/ndb_not_readonly.inc
+++ b/mysql-test/include/ndb_not_readonly.inc
@@ -2,6 +2,9 @@
#
# wait for server to connect properly to cluster
#
+
+--disable_query_log
+
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
@@ -25,6 +28,9 @@ while ($mysql_errno)
}
delete from mysql.ndb_apply_status where server_id=0;
set sql_log_bin = @saved_log;
+
+--enable_query_log
+
#
# connected
#
diff --git a/mysql-test/include/no_valgrind_without_big.inc b/mysql-test/include/no_valgrind_without_big.inc
index 743e974daec..ea1f2ac91ab 100644
--- a/mysql-test/include/no_valgrind_without_big.inc
+++ b/mysql-test/include/no_valgrind_without_big.inc
@@ -5,8 +5,9 @@
# Therefore we require that the option "--big-test" is also set.
#
-if (`SELECT $VALGRIND_TEST <> 0 AND '$BIG_TEST' = ''`)
-{
- --skip Need "--big-test" when running with Valgrind
+if ($VALGRIND_TEST) {
+ if (!$BIG_TEST)
+ {
+ --skip Need "--big-test" when running with Valgrind
+ }
}
-
diff --git a/mysql-test/include/not_crashrep.inc b/mysql-test/include/not_crashrep.inc
new file mode 100644
index 00000000000..e126f339a5f
--- /dev/null
+++ b/mysql-test/include/not_crashrep.inc
@@ -0,0 +1,24 @@
+# Check if CrashReporter is enabled and would open a window
+
+perl;
+sub skip_test {
+ # Only relevant on Mac OS X
+ return 0 unless $^O eq 'darwin';
+ my $crep= `defaults read com.apple.CrashReporter DialogType`;
+ return 0 if $?;
+ chomp ($crep);
+ $crep= lc $crep;
+ return ($crep eq 'basic' || $crep eq 'developer');
+}
+my $skip= skip_test();
+open (F, ">" . $ENV{'MYSQL_TMP_DIR'} . "/crashrep.inc");
+print F "let \$crashrep= $skip;\n";
+close F;
+EOF
+
+--source $MYSQL_TMP_DIR/crashrep.inc
+--remove_file $MYSQL_TMP_DIR/crashrep.inc
+
+if ($crashrep) {
+ --skip CrashReporter would popup a window
+}
diff --git a/mysql-test/include/not_parallel.inc b/mysql-test/include/not_parallel.inc
index 39432c59813..615bdf68453 100644
--- a/mysql-test/include/not_parallel.inc
+++ b/mysql-test/include/not_parallel.inc
@@ -1,3 +1,3 @@
-if (`SELECT '$MTR_PARALLEL' > 1`) {
+if ($MTR_PARALLEL > 1) {
--skip test requires --parallel=1
}
diff --git a/mysql-test/include/not_threadpool.inc b/mysql-test/include/not_threadpool.inc
new file mode 100644
index 00000000000..a49c8cfcc32
--- /dev/null
+++ b/mysql-test/include/not_threadpool.inc
@@ -0,0 +1,5 @@
+if (`SELECT count(*) FROM information_schema.GLOBAL_VARIABLES WHERE
+ VARIABLE_NAME = 'THREAD_HANDLING' AND
+ VARIABLE_VALUE = 'loaded-dynamically'`){
+ skip Test requires: 'not_threadpool';
+}
diff --git a/mysql-test/include/plugin.defs b/mysql-test/include/plugin.defs
new file mode 100644
index 00000000000..e07c603c8e5
--- /dev/null
+++ b/mysql-test/include/plugin.defs
@@ -0,0 +1,41 @@
+# Definition file for plugins.
+#
+# <lib name> <directory> <variable> [<plugin name>,...]
+#
+# The following variables will be set for a plugin, where PLUGVAR
+# represents the variable name given as the 3rd item
+#
+# PLUGVAR: name of plugin file including extension .so or .dll
+# PLUGVAR_DIR: name of directory where plugin was found
+# PLUGVAR_OPT: mysqld option --plugin_dir=....
+# PLUGVAR_LOAD: option --plugin_load=.... if the 4th element is present
+#
+# If a listed plugin is not found, the corresponding variables will be
+# set to empty, they will not be unset.
+#
+# The PLUGVAR variable is not quoted, so you must remember to quote it
+# when using it in an INSTALL PLUGIN command.
+#
+# The envorinment variables can be used in tests. If adding a new plugin,
+# you are free to pick your variable name, but please keep it upper
+# case for consistency.
+#
+# The _LOAD variable will have a form
+#
+# --plugin_load=<name1>=<lib_name>;<name2>=<lib_name>.....
+#
+# with name1, name2 etc from the comma separated list of plugin names
+# in the optional 4th argument.
+
+auth_test_plugin plugin/auth PLUGIN_AUTH test_plugin_server,cleartext_plugin_server
+qa_auth_interface plugin/auth PLUGIN_AUTH_INTERFACE qa_auth_interface
+qa_auth_server plugin/auth PLUGIN_AUTH_SERVER qa_auth_server
+qa_auth_client plugin/auth PLUGIN_AUTH_CLIENT qa_auth_client
+udf_example sql UDF_EXAMPLE_LIB
+ha_example storage/example EXAMPLE_PLUGIN EXAMPLE
+semisync_master plugin/semisync SEMISYNC_MASTER_PLUGIN
+semisync_slave plugin/semisync SEMISYNC_SLAVE_PLUGIN
+ha_archive storage/archive ARCHIVE_PLUGIN
+ha_blackhole storage/blackhole BLACKHOLE_PLUGIN
+ha_federated storage/federated FEDERATED_PLUGIN
+mypluglib plugin/fulltext SIMPLE_PARSER
diff --git a/mysql-test/include/report-features.test b/mysql-test/include/report-features.test
index 1e4ab232490..75879f67165 100644
--- a/mysql-test/include/report-features.test
+++ b/mysql-test/include/report-features.test
@@ -9,4 +9,4 @@ show engines;
show variables;
--echo ===== STOP =====
--enable_query_log
-exit; \ No newline at end of file
+exit;
diff --git a/mysql-test/include/reset_master_and_slave.inc b/mysql-test/include/reset_master_and_slave.inc
deleted file mode 100644
index 30ba1f07a40..00000000000
--- a/mysql-test/include/reset_master_and_slave.inc
+++ /dev/null
@@ -1,8 +0,0 @@
---echo **** Resetting master and slave ****
-connection slave;
-source include/stop_slave.inc;
-RESET SLAVE;
-connection master;
-RESET MASTER;
-connection slave;
-source include/start_slave.inc;
diff --git a/mysql-test/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc
index 0f363ff1ee3..7cb9c7994d8 100644
--- a/mysql-test/include/restart_mysqld.inc
+++ b/mysql-test/include/restart_mysqld.inc
@@ -1,18 +1,24 @@
+if ($rpl_inited)
+{
+ if (!$allow_rpl_inited)
+ {
+ --die ERROR IN TEST: When using the replication test framework (master-slave.inc, rpl_init.inc etc), use rpl_restart_server.inc instead of restart_mysqld.inc. If you know what you are doing and you really have to use restart_mysqld.inc, set allow_rpl_inited=1 before you source restart_mysqld.inc
+ }
+}
+
# Write file to make mysql-test-run.pl expect the "crash", but don't start
# it until it's told to
---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait
-EOF
+--let $_server_id= `SELECT @@server_id`
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
+--exec echo "wait" > $_expect_file_name
# Send shutdown to the connected server and give
# it 10 seconds to die before zapping it
shutdown_server 10;
# Write file to make mysql-test-run.pl start up the server again
---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart
-EOF
+--exec echo "restart" > $_expect_file_name
# Turn on reconnect
--enable_reconnect
diff --git a/mysql-test/include/restart_slave_sql.inc b/mysql-test/include/restart_slave_sql.inc
new file mode 100644
index 00000000000..ee6c6d7ced6
--- /dev/null
+++ b/mysql-test/include/restart_slave_sql.inc
@@ -0,0 +1,43 @@
+# ==== Purpose ====
+#
+# Provide a earier way to restart SQL thread when you want to stop sql thread
+# and then start it immediately.
+#
+# Sources stop_slave_sql.inc to stop SQL thread on the current connection.
+# Then issues START SLAVE SQL_THREAD and then waits until
+# the SQL threads have started, or until a timeout is reached.
+#
+# Please use this instead of 'STOP|START SLAVE SQL_THREAD', to reduce the risk of
+# test case bugs.
+#
+#
+# ==== Usage ====
+#
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/restart_slave_sql.inc
+#
+# Parameters:
+# $slave_timeout
+# See include/wait_for_slave_param.inc
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= restart_slave.inc
+--source include/begin_include_file.inc
+
+
+if (!$rpl_debug)
+{
+ --disable_query_log
+}
+
+source include/stop_slave_sql.inc;
+START SLAVE SQL_THREAD;
+source include/wait_for_slave_sql_to_start.inc;
+
+
+--let $include_filename= restart_slave.inc
+--source include/end_include_file.inc \ No newline at end of file
diff --git a/mysql-test/include/rpl_change_topology.inc b/mysql-test/include/rpl_change_topology.inc
new file mode 100644
index 00000000000..799262986e6
--- /dev/null
+++ b/mysql-test/include/rpl_change_topology.inc
@@ -0,0 +1,247 @@
+# ==== Purpose ====
+#
+# Changes replication topology. This file is normally sourced from
+# include/rpl_init.inc, but test cases can also source it if they
+# need to change topology after they have sourced include/rpl_init.inc
+#
+# This file sets up variables needed by include/rpl_sync.inc and many
+# other replication scripts in the include/ directory. It also issues
+# CHANGE MASTER on all servers where the configuration changes from
+# what it was before. It does not issue START SLAVE (use
+# include/rpl_start_slaves.inc for that).
+#
+# Note: it is not currently possible to change the number of servers
+# after the rpl_init.inc, without first calling rpl_end.inc. So the
+# test has to set $rpl_server_count to the total number of servers
+# that the test uses, before it sources include/rpl_init.inc. After
+# that, $rpl_server_count must not change until after next time the
+# test sources include/rpl_end.inc.
+#
+# Note: Since this script issues CHANGE MASTER, the test case must
+# ensure that all slaves where the configuration changes have stopped
+# both the IO thread and the SQL thread before this script is sourced.
+#
+#
+# ==== Usage ====
+#
+# [--let $rpl_server_count= 7]
+# --let $rpl_topology= 1->2->3->1->4, 2->5, 6->7
+# [--let $rpl_skip_change_master= 1]
+# [--let $rpl_master_log_file= 1:master-bin.000001,3:master-bin.000003]
+# [--let $rpl_master_log_pos= 1:4711,3:107]
+# [--let $rpl_debug= 1]
+# --source include/rpl_change_topology.inc
+#
+# Parameters:
+# $rpl_master_log_file
+# By default, CHANGE MASTER is executed with MASTER_LOG_FILE set
+# to the name of the last binlog file on the master (retrieved by
+# executing SHOW MASTER STATUS). This variable can be set to
+# specify another filename. This variable should be a
+# comma-separated list of the following form:
+#
+# SERVER_NUMBER_1:FILE_NAME_1,SERVER_NUMBER_2:FILE_NAME_2,...
+#
+# Before CHANGE MASTER is executed on server N, this script checks
+# if $rpl_master_log_file contains the text N:FILE_NAME. If it
+# does, then MASTER_LOG_FILE is set to FILE_NAME. Otherwise,
+# MASTER_LOG_FILE is set to the last binlog on the master. For
+# example, to specify that server_1 should start replicate from
+# master-bin.000007 and server_5 should start replicate from
+# master-bin.012345, do:
+# --let $rpl_master_log_file= 1:master-bin.000007,5:master-bin.012345
+#
+# $rpl_master_log_pos
+# By default, CHANGE MASTER is executed without specifying the
+# MASTER_LOG_POS parameter. This variable can be set to set a
+# specific position. It has the same form as $rpl_master_log_file
+# (see above). For example, to specify that server_3 should start
+# replicate from position 4711 of its master, do:
+# --let $rpl_master_log_pos= 3:4711
+#
+# $rpl_server_count, $rpl_topology, $rpl_debug, $rpl_skip_change_master
+# See include/rpl_init.inc
+#
+#
+# ==== Internal variables configured by this file ====
+#
+# This file sets up the following variables, which are used by other
+# low-level replication files such as:
+# include/rpl_sync.inc
+# include/rpl_start_slaves.inc
+# include/rpl_stop_slaves.inc
+# include/rpl_end.inc
+#
+# $rpl_server_count_length:
+# Set to LENGTH($rpl_server_count). So if $rpl_server_count < 10,
+# then $rpl_server_count_length = 1; if 10 <= $rpl_server_count <
+# 100, then $rpl_server_count_length = 2, etc.
+#
+# $rpl_master_list
+# Set to a string consisting of $rpl_server_count numbers, each one
+# whitespace-padded to $rpl_server_count_length characters. If
+# server N is a slave, then the N'th number is the master of server
+# N. If server N is not a slave, then the N'th number is just spaces
+# (so in fact it is not a number). For example, if $rpl_topology is
+# '1->2,2->3,3->1,2->4,5->6', then $rpl_master_list is '3122 6'.
+#
+# $rpl_sync_chain_dirty
+# This variable is set to 1. This tells include/rpl_sync.inc to
+# compute a new value for $rpl_sync_chain next time that
+# include/rpl_sync.inc is sourced. See
+# include/rpl_generate_sync_chain.inc and include/rpl_sync.inc for
+# details.
+
+
+# Remove whitespace from $rpl_topology
+--let $rpl_topology= `SELECT REPLACE('$rpl_topology', ' ', '')`
+
+--let $include_filename= rpl_change_topology.inc [new topology=$rpl_topology]
+--source include/begin_include_file.inc
+
+
+if ($rpl_debug)
+{
+ --echo ---- Check input ----
+}
+
+
+if (`SELECT '$rpl_topology' = '' OR '$rpl_server_count' = ''`)
+{
+ --die You must set $rpl_topology and $rpl_server_count before you source rpl_change_topology.inc. If you really want to change to the empty topology, set $rpl_topology= none
+}
+--let $_rpl_topology= $rpl_topology
+if ($_rpl_topology == 'none')
+{
+ --let $_rpl_topology=
+}
+if ($rpl_master_list == '')
+{
+ --die You must source include/rpl_init.inc before you source include/rpl_change_topology.inc
+}
+--let $_rpl_old_master_list= $rpl_master_list
+
+if ($rpl_debug)
+{
+ --echo \$rpl_server_count='$rpl_server_count'
+ --echo \$rpl_server_count_length='$rpl_server_count_length'
+ --echo new \$rpl_topology='$_rpl_topology'
+ --echo old \$rpl_master_list='$rpl_master_list'
+ --echo old \$rpl_sync_chain='$rpl_sync_chain'
+}
+
+
+if ($rpl_debug)
+{
+ --echo ---- Generate \$rpl_server_count_length and \$rpl_master_list ----
+}
+
+--let $rpl_server_count_length= `SELECT LENGTH('$rpl_server_count')`
+--let $rpl_master_list=
+--let $_rpl_no_server= `SELECT REPEAT(' ', $rpl_server_count_length)`
+--let $rpl_master_list= `SELECT REPEAT('$_rpl_no_server', $rpl_server_count)`
+while ($_rpl_topology)
+{
+ # Get 's1->s2' from 's1->s2->s3->...' or from 's1->s2,s3->s4,...'
+ --let $_rpl_master_slave= `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX('$_rpl_topology', ',', 1), '->', 2)`
+ # Modify $_rpl_topology as follows:
+ # - If it starts with 's1->s2,', remove 's1->s2,'
+ # - If it starts with 's1->s2->', remove 's1->'
+ # - If it is equal to 's1->s2', remove 's1->s2'
+ --let $_rpl_topology= `SELECT SUBSTR('$_rpl_topology', IF(SUBSTR('$_rpl_topology', LENGTH('$_rpl_master_slave') + 1, 2) != '->', LENGTH('$_rpl_master_slave'), LOCATE('->', '$_rpl_master_slave')) + 2)`
+ # Get 's1' from 's1->s2'
+ --let $_rpl_master= `SELECT SUBSTRING_INDEX('$_rpl_master_slave', '->', 1)`
+ # Get 's2' from 's1->s2'
+ --let $_rpl_slave= `SELECT SUBSTRING('$_rpl_master_slave', LENGTH('$_rpl_master') + 3)`
+ # Check that s2 does not have another master.
+ if (`SELECT SUBSTR('$rpl_master_list', 1 + ($_rpl_slave - 1) * $rpl_server_count_length, $rpl_server_count_length) != '$_rpl_no_server'`)
+ {
+ --echo ERROR IN TEST: Server '$_rpl_slave' has more than one master in topology '$rpl_topology'
+ --die ERROR IN TEST: found a server with more than one master in the $rpl_topology variable
+ }
+ # Save 's1' at position 's2' in $rpl_master_list
+ --let $rpl_master_list= `SELECT INSERT('$rpl_master_list', 1 + ($_rpl_slave - 1) * $rpl_server_count_length, $rpl_server_count_length, RPAD('$_rpl_master', $rpl_server_count_length, ' '))`
+}
+
+if ($rpl_debug)
+{
+ --echo new \$rpl_server_count_length = '$rpl_server_count_length'
+ --echo new \$rpl_master_list = '$rpl_master_list'
+}
+
+if (!$rpl_skip_change_master)
+{
+ if ($rpl_debug)
+ {
+ --echo ---- Execute CHANGE MASTER on all servers ----
+ }
+
+ if (!$rpl_debug)
+ {
+ --disable_query_log
+ }
+
+ --let $_rpl_server= $rpl_server_count
+ while ($_rpl_server)
+ {
+ # The following statement evaluates to:
+ # 0, if server_$_rpl_server has the same master as before.
+ # The master's server, if server_$_rpl_server is a slave.
+ # The empty string, if server_$_rpl_server is not a slave.
+ --let $_rpl_master= `SELECT TRIM(IFNULL(NULLIF(SUBSTRING('$rpl_master_list', 1 + ($_rpl_server - 1) * $rpl_server_count_length, $rpl_server_count_length), SUBSTRING('$_rpl_old_master_list', 1 + ($_rpl_server - 1) * $rpl_server_count_length, $rpl_server_count_length)), 0))`
+ if ($rpl_debug)
+ {
+ --echo \$_rpl_server='$_rpl_server' \$_rpl_master='$_rpl_master'
+ }
+ if ($_rpl_master)
+ {
+ # Get port number
+ --let $_rpl_port= \$SERVER_MYPORT_$_rpl_master
+ # Get MASTER_LOG_FILE
+ --let $_rpl_master_log_file_index= `SELECT LOCATE('$_rpl_server:', '$rpl_master_log_file')`
+ if ($_rpl_master_log_file_index)
+ {
+ # Get text from after ':' and before ',', starting at
+ # $_rpl_master_log_file
+ --let $_rpl_master_log_file= `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING('$rpl_master_log_file', $_rpl_master_log_file_index), ',', 1), ':', -1)`
+ }
+ if (!$_rpl_master_log_file_index)
+ {
+ --let $rpl_connection_name= server_$_rpl_master
+ --source include/rpl_connection.inc
+ --let $_rpl_master_log_file= query_get_value(SHOW MASTER STATUS, File, 1)
+ }
+ # Change connection.
+ --let $rpl_connection_name= server_$_rpl_server
+ --source include/rpl_connection.inc
+ # Get MASTER_LOG_POS
+ --let $_rpl_master_log_pos_index= `SELECT LOCATE('$_rpl_server:', '$rpl_master_log_pos')`
+ if ($_rpl_master_log_pos_index)
+ {
+ --let $_rpl_master_log_pos= `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING('$rpl_master_log_pos', $_rpl_master_log_pos_index), ',', 1), ':', -1)`
+ --let $_rpl_master_log_pos= , MASTER_LOG_POS = $_rpl_master_log_pos
+ }
+ if (!$_rpl_master_log_pos_index)
+ {
+ --let $_rpl_master_log_pos=
+ }
+ eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1', MASTER_PORT = $_rpl_port, MASTER_USER = 'root', MASTER_LOG_FILE = '$_rpl_master_log_file'$_rpl_master_log_pos, MASTER_CONNECT_RETRY = 1;
+ }
+ if ($_rpl_master == '')
+ {
+ # This un-configures the server so that it's not a slave.
+ # After BUG#28796, such configuration is not possible any more.
+ #--let $rpl_connection_name= server_$_rpl_server
+ #--source include/rpl_connection.inc
+ #CHANGE MASTER TO MASTER_HOST = '';
+ }
+ --dec $_rpl_server
+ }
+}
+
+
+--let $rpl_sync_chain_dirty= 1
+
+
+--let $include_filename= rpl_change_topology.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_connect.inc b/mysql-test/include/rpl_connect.inc
new file mode 100644
index 00000000000..95912d57469
--- /dev/null
+++ b/mysql-test/include/rpl_connect.inc
@@ -0,0 +1,58 @@
+# ==== Purpose ====
+#
+# Create a connection to a given numbered server.
+#
+# This script is normally used internally by rpl_init.inc and
+# master-slave.inc, but it can also be used in test cases that need to
+# create more connections or re-create connections after disconnect.
+#
+#
+# ==== Usage ====
+#
+# --let $rpl_connection_name= <connection_name>
+# --let $rpl_server_number= <server_number>
+# [--let $rpl_debug= 1]
+# --source include/rpl_connect.inc
+#
+# Parameters:
+# $rpl_connection_name
+# The name of the connection to create.
+#
+# $rpl_server_number
+# The number of the server to connect to.
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= rpl_connect.inc [creating $rpl_connection_name]
+--source include/begin_include_file.inc
+
+
+if (!$rpl_server_number)
+{
+ --die ERROR IN TEST: You must set $rpl_server_number before sourcing include/rpl_connect.inc
+}
+if (!$rpl_connection_name)
+{
+ --die ERROR IN TEST: You must set $rpl_connection_name before sourcing include/rpl_connect.inc
+}
+
+# Get port number
+--let $_rpl_port= \$SERVER_MYPORT_$rpl_server_number
+if (!$_rpl_port)
+{
+ --echo Bug in test case: '\$SERVER_MYPORT_$rpl_server_number' not initialized. Check the test's .cfg file.
+ --die Not all SERVER_MYPORT_* environment variables are setup correctly.
+}
+
+# Create connection.
+if ($rpl_debug)
+{
+ --echo connect ($rpl_connection_name,127.0.0.1,root,,test,$_rpl_port,)
+}
+--connect ($rpl_connection_name,127.0.0.1,root,,test,$_rpl_port,)
+
+
+--let $include_filename= rpl_connect.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_connection.inc b/mysql-test/include/rpl_connection.inc
new file mode 100644
index 00000000000..1988568a4d2
--- /dev/null
+++ b/mysql-test/include/rpl_connection.inc
@@ -0,0 +1,47 @@
+# ==== Purpose ====
+#
+# The same as 'connection $rpl_connection_name', but it can also
+# prints the connection name. The connection is printed if $rpl_debug
+# is set, or if rpl_connection.inc is not called between two
+# invocations of begin_include_file.inc/end_include_file.inc.
+# Otherwise the connection name is not printed.
+#
+#
+# ==== Usage ====
+#
+# --let $rpl_connection_name= master
+# [--let $rpl_debug= 1]
+# --source include/rpl_connection.inc
+#
+# Parameters:
+# $rpl_connection_name
+# Name of the connection to connect to.
+#
+# $rpl_debug
+# By default, the connection name is printed only when this file
+# is sourced from a top-level test script. If $rpl_debug is set,
+# the connection name is also printed whenever auxiliary files
+# like rpl_init.inc change connection.
+
+
+if (!$rpl_connection_name)
+{
+ --die ERROR IN TEST: you must set $rpl_connection_name before sourcing rpl_connection.inc
+}
+
+# This is the same as "if (!$_rpl_include_file_depth || $rpl_debug)",
+# but the mysqltest language doesn't have boolean operations.
+
+if (!$_include_file_depth)
+{
+ --echo [connection $rpl_connection_name]
+}
+if ($_include_file_depth)
+{
+ if ($rpl_debug)
+ {
+ --echo [connection $rpl_connection_name]
+ }
+}
+--connection $rpl_connection_name
+--let $rpl_connection_name=
diff --git a/mysql-test/include/rpl_connection_master.inc b/mysql-test/include/rpl_connection_master.inc
new file mode 100644
index 00000000000..e54e34071c8
--- /dev/null
+++ b/mysql-test/include/rpl_connection_master.inc
@@ -0,0 +1,2 @@
+let $rpl_connection_name= master;
+source include/rpl_connection.inc; \ No newline at end of file
diff --git a/mysql-test/include/rpl_connection_slave.inc b/mysql-test/include/rpl_connection_slave.inc
new file mode 100644
index 00000000000..ef3876394d6
--- /dev/null
+++ b/mysql-test/include/rpl_connection_slave.inc
@@ -0,0 +1,2 @@
+let $rpl_connection_name= slave;
+source include/rpl_connection.inc; \ No newline at end of file
diff --git a/mysql-test/include/rpl_connection_slave1.inc b/mysql-test/include/rpl_connection_slave1.inc
new file mode 100644
index 00000000000..8aee6defbdd
--- /dev/null
+++ b/mysql-test/include/rpl_connection_slave1.inc
@@ -0,0 +1,2 @@
+let $rpl_connection_name= slave1;
+source include/rpl_connection.inc; \ No newline at end of file
diff --git a/mysql-test/include/rpl_diff.inc b/mysql-test/include/rpl_diff.inc
new file mode 100644
index 00000000000..72da06cc533
--- /dev/null
+++ b/mysql-test/include/rpl_diff.inc
@@ -0,0 +1,118 @@
+# ==== Purpose ====
+#
+# Diff the output of a statement on all configured servers (usually
+# master and slave).
+#
+#
+# ==== Usage =====
+#
+# --let $rpl_diff_statement= SELECT * FROM t1 WHERE a < 100
+# [--let $rpl_diff_servers= <server1>,<server2>,...<serverN>]
+# --source include/rpl_diff.inc
+#
+# Parameters:
+# $rpl_diff_statement
+# Statement to check. For each compared server, this script will
+# start a new client and pass this statement to the client.
+# Note: This string will be evaluated as a single-quote-escaped
+# SQL string and hence must be quoted as such. In particular, any
+# single quotes in this string must be escaped.
+#
+# $rpl_diff_servers
+# By default, this file compares all servers configured by
+# rpl_init.inc. You can set $diff_servers to a comma-separated
+# list of numbers: only the servers identified by these numbers
+# will be compared.
+#
+# $rpl_diff_database
+# By default, the statement will be executed on the database
+# 'test'. If $rpl_diff_database is set, the statement will be
+# executed on the database named $rpl_diff_database instead.
+
+
+--let $include_filename= rpl_diff.inc
+--source include/begin_include_file.inc
+
+
+if (!$rpl_diff_statement)
+{
+ --die ERROR IN TEST: you must set $rpl_diff_statement before you source include/rpl_diff.inc
+}
+
+
+# Sync.
+--source include/rpl_sync.inc
+
+
+# Get database name.
+--let $_rpl_diff_database= $rpl_diff_database
+if (!$_rpl_diff_database)
+{
+ --let $_rpl_diff_database= test
+}
+
+
+# Generate list of servers.
+--let $_rpl_diff_servers= $rpl_diff_servers
+if (!$_rpl_diff_servers)
+{
+ --let $_rpl_server_i= $rpl_server_count
+ --let $_rpl_diff_servers=
+ while ($_rpl_server_i)
+ {
+ --let $_rpl_diff_servers= $_rpl_server_i,$_rpl_diff_servers
+ --dec $_rpl_server_i
+ }
+}
+if ($rpl_debug)
+{
+ --echo \$rpl_diff_servers= '$_rpl_diff_servers'
+}
+
+
+if (!$rpl_debug)
+{
+ --disable_query_log
+}
+
+
+# Generate file containing $rpl_diff_statement. We don't pass the
+# statement on the command line, because it would be subject to shell
+# substitutions.
+--let $write_to_file= GENERATE
+--let $write_var= $rpl_diff_statement
+--source include/write_var_to_file.inc
+--let $_rpl_diff_statement_file= $write_to_file
+
+
+# Compare all servers.
+--let $_rpl_diff_first= 1
+while ($_rpl_diff_servers)
+{
+ # Set $_rpl_diff_server_i to the first number in the list
+ --let $_rpl_diff_server_i= `SELECT SUBSTRING_INDEX('$_rpl_diff_servers', ',', 1)`
+ # Remove $_rpl_diff_server_i from the list
+ --let $_rpl_diff_servers= `SELECT SUBSTRING('$_rpl_diff_servers', LENGTH('$_rpl_diff_server_i') + 2)`
+
+ # Execute statement
+ --let $_rpl_diff_file= $MYSQLTEST_VARDIR/tmp/_rpl_diff_server-$_rpl_diff_server_i.tmp
+ --exec $MYSQL --defaults-group-suffix=.$_rpl_diff_server_i $_rpl_diff_database < $_rpl_diff_statement_file > $_rpl_diff_file
+
+ # Compare
+ if (!$_rpl_diff_first)
+ {
+ if ($rpl_debug)
+ {
+ --echo diffing $_rpl_diff_file and $_rpl_diff_prev_file
+ }
+ --diff_files $_rpl_diff_file $_rpl_diff_prev_file
+ --remove_file $_rpl_diff_prev_file
+ }
+ --let $_rpl_diff_prev_file= $_rpl_diff_file
+ --let $_rpl_diff_first= 0
+}
+--remove_file $_rpl_diff_prev_file
+
+
+--let $include_filename= rpl_diff.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_diff_tables.inc b/mysql-test/include/rpl_diff_tables.inc
deleted file mode 100644
index c3a45578a79..00000000000
--- a/mysql-test/include/rpl_diff_tables.inc
+++ /dev/null
@@ -1,35 +0,0 @@
-# #############################################################################
-# Check whether the given table is consistent between different master and
-# slaves
-#
-# Usage:
-# --let $diff_table= test.t1
-# --let $diff_server_list= master, slave, slave2
-# --source include/rpl_diff_tables.inc
-# #############################################################################
-
-if (`SELECT "XX$diff_table" = "XX"`)
-{
- --die diff_table is null.
-}
-
---let $_servers= master, slave
-if (`SELECT "XX$diff_server_list" <> "XX"`)
-{
- --let $_servers= $diff_server_list
-}
-
---let $_master= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)`
---let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_master') + 2))`
-connection $_master;
-while (`SELECT "XX$_servers" <> "XX"`)
-{
- --let $_slave= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)`
- --let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_slave') + 2))`
-
- --sync_slave_with_master $_slave
- --let $diff_table_1= $_master:$diff_table
- --let $diff_table_2= $_slave:$diff_table
- --source include/diff_tables.inc
- connection $_slave;
-}
diff --git a/mysql-test/include/rpl_end.inc b/mysql-test/include/rpl_end.inc
new file mode 100644
index 00000000000..f671c442153
--- /dev/null
+++ b/mysql-test/include/rpl_end.inc
@@ -0,0 +1,103 @@
+# ==== Purpose ====
+#
+# Shut down replication initialized by include/rpl_init.inc.
+#
+# This syncs all servers, executes STOP SLAVE on all servers, executes
+# CHANGE MASTER on all servers, and disconnects all connections
+# configured by rpl_init.inc.
+#
+# It does not execute RESET MASTER or RESET SLAVE, because that would
+# remove binlogs which are possibly useful debug information in case
+# the test case later fails with a result mismatch. If you need that,
+# source include/rpl_reset.inc before you source this file.
+#
+#
+# ==== Usage ====
+#
+# [--let $rpl_only_running_threads= 1]
+# [--let $rpl_debug= 1]
+# --source include/rpl_end.inc
+#
+# Parameters:
+# $rpl_only_running_threads
+# If one or both of the IO and SQL threads is stopped, sync and
+# stop only the threads that are running. See
+# include/rpl_sync.inc and include/stop_slave.inc for details.
+#
+# $rpl_debug
+# See include/rpl_init.inc
+#
+# Note:
+# This script will fail if Last_SQL_Error or Last_IO_Error is
+# nonempty. If you expect an error in the SQL thread, you should
+# normally call this script as follows:
+#
+# --source include/wait_for_slave_sql_error.inc
+# --source include/stop_slave_io.inc
+# RESET SLAVE;
+# --let $rpl_only_running_threads= 1
+# --source include/rpl_end.inc
+#
+#
+# ==== Side effects ====
+#
+# Changes the current connection to 'default'.
+
+
+--let $include_filename= rpl_end.inc
+--source include/begin_include_file.inc
+
+
+if (!$rpl_inited)
+{
+ --die ERROR IN TEST: rpl_end.inc was sourced when replication was not configured. Most likely, rpl_end.inc was sourced twice or rpl_init.inc has not been sourced.
+}
+
+
+if ($rpl_debug)
+{
+ --echo ---- Check that no slave thread has an error ----
+}
+
+--let $_rpl_server= $rpl_server_count
+while ($_rpl_server)
+{
+ --let $rpl_connection_name= server_$_rpl_server
+ --source include/rpl_connection.inc
+
+ # Only check slave threads for error on hosts that were at some
+ # point configured as slave.
+ --let $_tmp= query_get_value(SHOW SLAVE STATUS, Master_Host, 1)
+ if ($_tmp != 'No such row')
+ {
+ --source include/check_slave_no_error.inc
+ }
+
+ --dec $_rpl_server
+}
+
+--source include/rpl_sync.inc
+--source include/rpl_stop_slaves.inc
+
+# mtr configures server 2 to be a slave before it runs the test. We
+# have to restore that state now, so we change topology to 1->2.
+--let $rpl_topology= none
+--source include/rpl_change_topology.inc
+
+
+--connection default
+--let $_rpl_server= $rpl_server_count
+--let $_rpl_one= _1
+while ($_rpl_server)
+{
+ --disconnect server_$_rpl_server
+ --disconnect server_$_rpl_server$_rpl_one
+ --dec $_rpl_server
+}
+
+--let $rpl_inited= 0
+
+# Do not restore connection, because we have disconnected it.
+--let $skip_restore_connection= 1
+--let $include_filename= rpl_end.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_for_each_slave.inc b/mysql-test/include/rpl_for_each_slave.inc
new file mode 100644
index 00000000000..65d242cf894
--- /dev/null
+++ b/mysql-test/include/rpl_for_each_slave.inc
@@ -0,0 +1,39 @@
+# ==== Purpose ====
+#
+# Execute a .inc file once for each server that was configured as a
+# slave by rpl_init.inc
+#
+#
+# ==== Usage ====
+#
+# --let $rpl_source_file
+# [--let $rpl_debug= 1]
+# --source include/rpl_for_each_slave.inc
+#
+# Parameters:
+# $rpl_source_file
+# The file that will be sourced.
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= rpl_for_each_file.inc [$rpl_source_file]
+--source include/begin_include_file.inc
+
+--let $_rpl_server= $rpl_server_count
+while ($_rpl_server)
+{
+ --let $_rpl_has_master= `SELECT SUBSTRING('$rpl_master_list', 1 + ($_rpl_server - 1) * $rpl_server_count_length, $rpl_server_count_length) != ''`
+ if ($_rpl_has_master)
+ {
+ --let $rpl_connection_name= server_$_rpl_server
+ --source include/rpl_connection.inc
+ --source $rpl_source_file
+ }
+ --dec $_rpl_server
+}
+
+
+--let $include_filename= rpl_for_each_file.inc [$rpl_source_file]
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_generate_sync_chain.inc b/mysql-test/include/rpl_generate_sync_chain.inc
new file mode 100644
index 00000000000..9104c21c3b8
--- /dev/null
+++ b/mysql-test/include/rpl_generate_sync_chain.inc
@@ -0,0 +1,122 @@
+# ==== Purpose ====
+#
+# Setup $rpl_sync_chain, which is used by rpl_sync.inc. You normally
+# don't need to source this file, it should only be sourced by
+# rpl_sync.inc.
+#
+# $rpl_sync_chain is set to a string that specifies in what order
+# servers should be synchronized in include/rpl_sync.inc. This has the
+# form of a sequence of "chains" (with no separator between two
+# chains). Each chain begins with $rpl_server_count_length space
+# characters, followed by a sequence of numbers, each number
+# whitespace-padded to $rpl_server_count_length characters. Each
+# number in the sequence denotes a server, and the N'th server is a
+# master of the (N+1)'th server. For example, if $rpl_topology is
+# '1->2,2->3,3->1,2->4,5->6', then $rpl_sync_chain is ' 56 123124'.
+#
+#
+# ==== Usage ====
+#
+# [--let $rpl_debug= 1]
+# --source include/rpl_generate_sync_chain.inc
+#
+# Parameters:
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= rpl_generate_sync_chain.inc
+--source include/begin_include_file.inc
+
+
+# Algorithm:
+# 0. Mark all servers as unseen and unsynced.
+# 1. Let S be a server that is marked unseen.
+# 2. Append S to the list of seen servers.
+# 3. Check how S is marked:
+# 3.1. If S has no master: append the list of seen servers (in
+# order from grand-master to grand-slave) to the end of
+# $rpl_sync_chain. Go to 3.
+# 3.2. Elseif S is marked as synced: append the list of seen
+# servers (in order from grand-master to grand-slave) to the
+# end of $rpl_sync_chain. Go to 3.
+# 3.3. Elseif S is marked as unsynced but seen: This means that the
+# graph of visited servers has a "6-shape": it is a loop with
+# a tail, such as 1->2->3->1->4->5. We should first sync the
+# loop, and then the tail. To ensure all servers in the loop
+# are synced, we must sync the loop two turns minus two
+# servers. For example, the loop 1->2->3->4->5->1 is fully
+# synced by this sequence of 1-step synchronizations:
+# 1->2->3->4->5->1->2->3->4. Hence we do this: in the list of
+# traversed servers (in order from grand-master to
+# grand-slave), find the first occurrence of S. Take the
+# sub-list starting at the 3rd server and ending at the first
+# occurrence of S. Append this sub-list it to the end of
+# $rpl_sync_chain. Then append the entire list of traversed
+# servers (in order from grand-master to grand-slave) to
+# $rpl_sync_chain. Go to 3.
+# 3.4. Else (i.e., S has a master and is not marked as seen or
+# synced): Mark S as seen. Set S=master(S) and go back to 2.
+# 4. For each server that is marked as seen, mark it as synced.
+# 5. If there are unseen servers, go back to 1.
+
+# $_rpl_server_marks holds the marks of all servers. The i'th character
+# corresponds to the mark of server i:
+# '0' = unseen & unmarked, '1' = seen & unsynced, '2' = seen & synced.
+--let $_rpl_server_marks= `SELECT REPEAT('0', $rpl_server_count)`
+--let $_rpl_start_server= $rpl_server_count
+--let $rpl_sync_chain=
+while ($_rpl_start_server)
+{
+ --let $_rpl_server= `SELECT RPAD('$_rpl_start_server', $rpl_server_count_length, ' ')`
+ --let $_rpl_seen_list=
+ --let $_rpl_continue_loop= 1
+ while ($_rpl_continue_loop)
+ {
+ --let $_rpl_master= `SELECT SUBSTRING('$rpl_master_list', 1 + ($_rpl_server - 1) * $rpl_server_count_length, $rpl_server_count_length)`
+ # We need to delimit elements of $_rpl_seen_list with commas, so
+ # that LOCATE() below will not find spurious matches that begin in
+ # the middle of one element and end in the middle of next element.
+ --let $_rpl_seen_list= $_rpl_server,$_rpl_seen_list
+ # If server is marked seen or synced, or has no master
+ if (`SELECT SUBSTRING('$_rpl_server_marks', $_rpl_server, 1) != 0 OR '$_rpl_master' = ''`)
+ {
+ # If server is marked seen but not synced.
+ if (`SELECT SUBSTRING('$_rpl_server_marks', $_rpl_server, 1) = 1`)
+ {
+ # Get sub-list of servers to prepend to server list.
+ # E.g., if topology is 1->2->3->4->1->5, then at this point
+ # $_rpl_seen_list='1,2,3,4,1,5,' and we have to prepend '4,3,'
+ # to it. Hence, the sub-list starts at position
+ # 1+2*($rpl_server_count_length+1) and ends at the first
+ # occurrence of ',1,' in the list.
+ --let $_rpl_extra_list= `SELECT SUBSTRING('$_rpl_seen_list', 1 + 2 * ($rpl_server_count_length + 1), LOCATE(',$_rpl_server,', '$_rpl_seen_list') - 2 * ($rpl_server_count_length + 1))`
+ --let $_rpl_seen_list= $_rpl_extra_list$_rpl_seen_list
+ }
+ # Append the seen servers. Only need to append if the list
+ # contains at least two elements.
+ if (`SELECT LENGTH('$_rpl_seen_list') > $rpl_server_count_length + 1`)
+ {
+ --let $rpl_sync_chain= $rpl_sync_chain$_rpl_no_server$_rpl_seen_list
+ }
+ --let $_rpl_continue_loop= 0
+ }
+ --let $_rpl_server_marks= `SELECT INSERT('$_rpl_server_marks', $_rpl_server, 1, '1')`
+ --let $_rpl_server= $_rpl_master
+ }
+ # Mark seen servers as synced
+ --let $_rpl_server_marks= `SELECT REPLACE('$_rpl_server_marks', '1', '2')`
+ # Get highest-numbered unmarked server.
+ --let $_rpl_start_server= `SELECT IFNULL(NULLIF($rpl_server_count + 1 - LOCATE('0', REVERSE('$_rpl_server_marks')), $rpl_server_count + 1), 0)`
+}
+# Strip commas: they were only needed temporarily.
+--let $rpl_sync_chain= `SELECT REPLACE('$rpl_sync_chain', ',', '')`
+
+if ($rpl_debug)
+{
+ --echo Generated \$rpl_sync_chain = '$rpl_sync_chain'
+}
+
+
+--let $include_filename= rpl_generate_sync_chain.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_init.inc b/mysql-test/include/rpl_init.inc
new file mode 100644
index 00000000000..6419682e650
--- /dev/null
+++ b/mysql-test/include/rpl_init.inc
@@ -0,0 +1,242 @@
+# ==== Purpose ====
+#
+# Set up replication on several servers in a specified topology.
+#
+# By default, this script does the following:
+# - Creates the connections server_1, server_2, ..., server_N, as
+# well as extra connections server_1_1, server_2_1, ...,
+# server_N_1. server_I and server_I_1 are connections to the same
+# server.
+# - Sets up @@auto_increment_increment and @@auto_increment_increment.
+# - Verifies that @@server_id of all servers are different.
+# - Calls RESET MASTER, RESET SLAVE, USE test, CHANGE MASTER, START SLAVE.
+# - Sets the connection to server_1 before exiting.
+#
+# ==== Usage ====
+#
+# 1. If you are going to use more than two servers, create
+# rpl_test.cfg with the following contents:
+#
+# !include ../my.cnf
+# [mysqld.1]
+# log-slave-updates
+# [mysqld.2]
+# log-slave-updates
+# ...
+# [mysqld.N]
+# log-slave-updates
+#
+# [ENV]
+# SERVER_MYPORT_3= @mysqld.3.port
+# SERVER_MYPORT_4= @mysqld.4.port
+# SERVER_MYPORT_5= @mysqld.5.port
+# ...
+# SERVER_MYPORT_N= @mysqld.N.port
+#
+# (It is allowed, but not required, to configure SERVER_MYPORT_1
+# and SERVER_MYPORT_2 too. If these variables are not set, the
+# variables MASTER_MYPORT and SLAVE_MYPORT, configured in the
+# default my.cnf used by the rpl and rpl_ndb suites, are used
+# instead. In addition, in the rpl_ndb suite, SERVER_MYPORT_3 is
+# not needed since MASTER_MYPORT1 can be used instead.)
+#
+# 2. Execute the following near the top of the test:
+#
+# [--let $rpl_server_count= 7]
+# --let $rpl_topology= 1->2->3->1->4, 2->5, 6->7
+# [--let $rpl_check_server_ids= 1]
+# [--let $rpl_skip_change_master= 1]
+# [--let $rpl_skip_start_slave= 1]
+# [--let $rpl_skip_reset_master_and_slave= 1]
+# [--let $rpl_debug= 1]
+# [--let $slave_timeout= NUMBER]
+# --source include/rpl_init.inc
+#
+# Parameters:
+#
+# $rpl_server_count
+# The number of servers to configure. If this is not set, the largest
+# number in $rpl_topology will be used.
+#
+# $rpl_topology
+# A comma-separated list of replication chain
+# specifications. Each replication chain specification has the
+# form S1->S2->...->Sn, where 1 <= S1,...Sn <= $rpl_server_count.
+# This file will configure S(i+1) to be a slave of S(i). If you
+# want to specify the empty topology (no server replicates at
+# all), you have to set $rpl_topology=none.
+#
+# $rpl_check_server_ids
+# If $rpl_check_server_ids is set, this script checks that the
+# @@server_id of all servers are different. This is normally
+# guaranteed by mtr, so it is only useful for debugging.
+#
+# $rpl_skip_reset_master_and_slave
+# By default, this script issues RESET MASTER and RESET SLAVE
+# before CHANGE MASTER and START SLAVE. RESET MASTER and RESET
+# SLAVE are suppressed if $rpl_skip_reset_master_and_slave is
+# set.
+#
+# $rpl_skip_change_master
+# By default, this script issues CHANGE MASTER so that all slaves
+# are ready to run as specified by $rpl_topology. CHANGE MASTER
+# is suppressed if $rpl_skip_change_master is set.
+#
+# $rpl_skip_start_slave
+# By default, this script issues START SLAVE on all slaves
+# specified by $rpl_topology. START SLAVE is suppressed if
+# $rpl_skip_change_master is set.
+#
+# $rpl_debug
+# By default, this script only outputs a static text that says
+# that rpl_init.inc was invoked. If $rpl_debug is set, additional
+# debug info is printed. The debug info may be nondeterministic,
+# so no test case should be checked in with $rpl_debug set.
+#
+# $slave_timeout
+# Timeout used when waiting for the slave threads to start.
+# See include/wait_for_slave_param.inc
+#
+#
+# ==== Side effects ====
+#
+# Changes current connection to server_1.
+
+--source include/have_log_bin.inc
+
+
+--let $include_filename= rpl_init.inc [topology=$rpl_topology]
+--source include/begin_include_file.inc
+
+
+if ($rpl_debug)
+{
+ --echo ---- Check input ----
+ --echo MASTER_MYPORT='$MASTER_MYPORT' SLAVE_MYPORT='$SLAVE_MYPORT' MASTER_MYPORT1='$MASTER_MYPORT1' SLAVE_MYPORT1='$SLAVE_MYPORT1'
+}
+
+# Allow $MASTER_MYPORT as alias for $SERVER_MYPORT_1
+if (!$SERVER_MYPORT_1)
+{
+ --let SERVER_MYPORT_1= $MASTER_MYPORT
+}
+# Allow $SLAVE_MYPORT as alias for $SERVER_MYPORT_2
+if (!$SERVER_MYPORT_2)
+{
+ --let SERVER_MYPORT_2= $SLAVE_MYPORT
+}
+# Allow $MASTER_MYPORT1 as alias for $SERVER_MYPORT_3
+# (this alias is used by rpl_ndb tests)
+if (!$SERVER_MYPORT_3)
+{
+ --let SERVER_MYPORT_3= $MASTER_MYPORT1
+}
+# Allow $SLAVE_MYPORT1 as alias for $SERVER_MYPORT_4
+# (this alias is used by rpl_ndb tests)
+if (!$SERVER_MYPORT_4)
+{
+ --let SERVER_MYPORT_4= $SLAVE_MYPORT1
+}
+# Check that $rpl_server_count is set
+if (!$rpl_server_count)
+{
+ --let $_compute_rpl_server_count= `SELECT REPLACE('$rpl_topology', '->', ',')`
+ --let $rpl_server_count= `SELECT GREATEST($_compute_rpl_server_count)`
+}
+
+
+if ($rpl_debug)
+{
+ --echo ---- Setup connections and reset each server ----
+}
+
+
+if (!$rpl_debug)
+{
+ --disable_query_log
+}
+
+
+# Create two connections to each server; reset master/slave, select
+# database, set autoinc variables.
+--let $_rpl_server= $rpl_server_count
+--let $_rpl_one= _1
+while ($_rpl_server)
+{
+ # Connect.
+ --let $rpl_server_number= $_rpl_server
+ --let $rpl_connection_name= server_$_rpl_server
+ --source include/rpl_connect.inc
+ --let $rpl_connection_name= server_$_rpl_server$_rpl_one
+ --source include/rpl_connect.inc
+
+ # Configure server.
+ --let $rpl_connection_name= server_$_rpl_server
+ --source include/rpl_connection.inc
+ USE test;
+ if (!$rpl_skip_reset_master_and_slave)
+ {
+ RESET MASTER;
+ RESET SLAVE;
+ }
+ eval SET auto_increment_increment= $rpl_server_count;
+ eval SET auto_increment_offset= $_rpl_server;
+
+ --dec $_rpl_server
+}
+
+
+# Signal that initialization is done and all connections created.
+--let $rpl_inited= 1
+
+# Signal that the server is in a dirty state and needs to be restarted
+# if the test is skipped. If the test is not skipped, it will continue
+# to the end and execute its cleanup section (and check-testcase will
+# report if you forget to clean up).
+--source include/force_restart_if_skipped.inc
+
+
+# Assert that all hosts have different server_ids
+if ($rpl_check_server_ids)
+{
+ if ($rpl_debug)
+ {
+ --echo ---- Check that @@server_id is distinct for all servers ----
+ }
+
+ --let $_rpl_server= $rpl_server_count
+ while ($_rpl_server)
+ {
+ --let $_rpl_server2= $_rpl_server
+ --dec $_rpl_server2
+ while ($_rpl_server2)
+ {
+ --let $assert_text= Servers $_rpl_server and $_rpl_server2 should have different @@server_id
+ --let $assert_condition= [$_rpl_server:SELECT @@server_id AS i, i, 1] != [$_rpl_server2:SELECT @@server_id AS i, i, 1]
+
+ --source include/assert.inc
+ --dec $_rpl_server2
+ }
+ --dec $_rpl_server
+ }
+}
+
+# $rpl_master_list must be set so that include/rpl_change_topology.inc
+# knows which servers are initialized and not.
+--let $rpl_master_list= `SELECT REPEAT('x', $rpl_server_count * LENGTH($rpl_server_count))`
+--source include/rpl_change_topology.inc
+
+
+if (!$rpl_skip_start_slave)
+{
+ --source include/rpl_start_slaves.inc
+}
+
+
+--let $rpl_connection_name= server_1
+--source include/rpl_connection.inc
+
+
+--let $skip_restore_connection= 1
+--let $include_filename= rpl_init.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_reconnect.inc b/mysql-test/include/rpl_reconnect.inc
new file mode 100644
index 00000000000..cdbbd0a1bf1
--- /dev/null
+++ b/mysql-test/include/rpl_reconnect.inc
@@ -0,0 +1,132 @@
+# ==== Purpose ====
+#
+# After a server has restarted, this waits for all clients configured
+# by rpl_init.inc and/or master-slave.inc to reconnect again.
+#
+# For each connection, it issues this:
+# --enable_reconnect
+# --source include/wait_until_connected_again.inc
+# --disable_reconnect
+#
+#
+# ==== Usage ====
+#
+# --let $rpl_server_number= N
+# [--let $rpl_debug= 1]
+# --source include/rpl_reconnect.inc
+#
+# Parameters:
+# $rpl_server_number
+# Number to identify the server that needs to reconnect. 1 is the
+# master server, 2 the slave server, 3 the 3rd server, and so on.
+# Cf. include/rpl_init.inc
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+--let $include_filename= rpl_reconnect.inc
+--source include/begin_include_file.inc
+
+if (!$rpl_server_number)
+{
+ --die ERROR IN TEST: you must set $rpl_server_number before you source rpl_connect.inc
+}
+
+
+if ($rpl_debug)
+{
+ --echo ---- Enable reconnect ----
+}
+
+--let $_rpl_server_number= $rpl_server_number
+
+--dec $_rpl_server_number
+if (!$_rpl_server_number)
+{
+ --let $rpl_connection_name= default
+ --source include/rpl_connection.inc
+ --enable_reconnect
+
+ --let $rpl_connection_name= master
+ --source include/rpl_connection.inc
+ --enable_reconnect
+
+ --let $rpl_connection_name= master1
+ --source include/rpl_connection.inc
+ --enable_reconnect
+}
+
+--dec $_rpl_server_number
+if (!$_rpl_server_number)
+{
+ --let $rpl_connection_name= slave
+ --source include/rpl_connection.inc
+ --enable_reconnect
+
+ --let $rpl_connection_name= slave1
+ --source include/rpl_connection.inc
+ --enable_reconnect
+}
+
+--let $rpl_connection_name= server_$rpl_server_number
+--source include/rpl_connection.inc
+--enable_reconnect
+
+--let $_rpl_one= _1
+--let $rpl_connection_name= server_$rpl_server_number$_rpl_one
+--source include/rpl_connection.inc
+--enable_reconnect
+
+if ($rpl_debug)
+{
+ --echo ---- Wait for reconnect and disable reconnect on all connections ----
+}
+
+--let $_rpl_server_number= $rpl_server_number
+
+--dec $_rpl_server_number
+if (!$_rpl_server_number)
+{
+ --let $rpl_connection_name= default
+ --source include/rpl_connection.inc
+ --source include/wait_until_connected_again.inc
+ --disable_reconnect
+
+ --let $rpl_connection_name= master
+ --source include/rpl_connection.inc
+ --source include/wait_until_connected_again.inc
+ --disable_reconnect
+
+ --let $rpl_connection_name= master1
+ --source include/rpl_connection.inc
+ --source include/wait_until_connected_again.inc
+ --disable_reconnect
+}
+
+--dec $_rpl_server_number
+if (!$_rpl_server_number)
+{
+ --let $rpl_connection_name= slave
+ --source include/rpl_connection.inc
+ --source include/wait_until_connected_again.inc
+ --disable_reconnect
+
+ --let $rpl_connection_name= slave1
+ --source include/rpl_connection.inc
+ --source include/wait_until_connected_again.inc
+ --disable_reconnect
+}
+
+--let $rpl_connection_name= server_$rpl_server_number
+--source include/rpl_connection.inc
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+
+--let $rpl_connection_name= server_$rpl_server_number$_rpl_one
+--source include/rpl_connection.inc
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+
+
+--let $include_filename= rpl_reconnect.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_reset.inc b/mysql-test/include/rpl_reset.inc
new file mode 100644
index 00000000000..a94371c38fc
--- /dev/null
+++ b/mysql-test/include/rpl_reset.inc
@@ -0,0 +1,81 @@
+# ==== Purpose ====
+#
+# Reset all replication servers to a clean state:
+#
+# - sync all slaves,
+# - stop all slaves (STOP SLAVE),
+# - remove all binlogs and relay logs (RESET MASTER and RESET SLAVE),
+# - start all slaves again (START SLAVE).
+#
+# It does not execute CHANGE MASTER, so the replication topology is
+# kept intact.
+#
+#
+# ==== Usage ====
+#
+# [--let $rpl_only_running_threads= 1]
+# [--let $rpl_debug= 1]
+# [--let $slave_timeout= NUMBER]
+# --source include/rpl_end.inc
+#
+# Parameters:
+# $rpl_only_running_threads
+# If one or both of the IO and SQL threads is stopped, sync and
+# stop only the threads that are running. See
+# include/rpl_sync.inc and include/stop_slave.inc for details.
+#
+# $rpl_debug
+# See include/rpl_init.inc
+#
+# $slave_timeout
+# Set the timeout when waiting for slave threads to stop and
+# start, respectively. See include/wait_for_slave_param.inc
+#
+# Note:
+# This script will fail if Last_SQL_Error or Last_IO_Error is
+# nonempty. If you expect an error in the SQL thread, you should
+# normally do this before you source include/rpl_reset.inc:
+#
+# --source include/wait_for_slave_sql_error.inc
+# --source include/stop_slave_io.inc
+# RESET SLAVE;
+
+--let $include_filename= rpl_reset.inc
+--source include/begin_include_file.inc
+
+
+if (!$rpl_debug)
+{
+ --disable_query_log
+}
+
+
+--source include/rpl_sync.inc
+
+
+if ($rpl_debug)
+{
+ --echo ---- Stop and reset all servers ----
+}
+--let $_rpl_server= $rpl_server_count
+while ($_rpl_server)
+{
+ --let $rpl_connection_name= server_$_rpl_server
+ --source include/rpl_connection.inc
+
+ # Check if this server is configured to have a master
+ if (`SELECT SUBSTRING('$rpl_master_list', 1 + ($_rpl_server - 1) * $rpl_server_count_length, $rpl_server_count_length) != ''`)
+ {
+ --source include/stop_slave.inc
+ RESET SLAVE;
+ }
+ RESET MASTER;
+ --dec $_rpl_server
+}
+
+
+--source include/rpl_start_slaves.inc
+
+
+--let $include_filename= rpl_reset.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_restart_server.inc b/mysql-test/include/rpl_restart_server.inc
new file mode 100644
index 00000000000..5df2c67d3da
--- /dev/null
+++ b/mysql-test/include/rpl_restart_server.inc
@@ -0,0 +1,39 @@
+# ==== Purpose ====
+#
+# Shut down and shut up the server given by $rpl_server_number. This
+# is equivalent to rpl_stop_server.inc followed by rpl_start_server.inc
+#
+# ==== Usage ====
+#
+# --let $rpl_server_number= N
+# [--let $rpl_server_parameters= --flag1 --flag2 ...]
+# [--let $rpl_debug= 1]
+# --source include/rpl_restart_server.inc
+#
+# Parameters:
+#
+# $rpl_server_number, $rpl_server_parameters
+# See include/rpl_start_server.inc
+#
+# $rpl_debug
+# See include/rpl_init.inc
+#
+# ==== See also ====
+#
+# rpl_start_server.inc
+# rpl_stop_server.inc
+
+
+--let $_rpl_restart_server_args= [server_number=$rpl_server_number]
+if ($rpl_server_parameters)
+{
+ --let $_rpl_restart_server_args= [server_number=$rpl_server_number parameters: $rpl_server_parameters]
+}
+--let $include_filename= rpl_restart_server.inc $_rpl_restart_server_args
+--source include/begin_include_file.inc
+
+--source include/rpl_stop_server.inc
+--source include/rpl_start_server.inc
+
+--let $include_filename= rpl_restart_server.inc $_rpl_restart_server_args
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_start_server.inc b/mysql-test/include/rpl_start_server.inc
new file mode 100644
index 00000000000..c59c7759910
--- /dev/null
+++ b/mysql-test/include/rpl_start_server.inc
@@ -0,0 +1,54 @@
+# ==== Purpose ====
+#
+# Start the server given by $rpl_server_number. This should normally
+# be invoked after rpl_stop_server.inc.
+#
+# ==== Usage ====
+#
+# --let $rpl_server_number= N
+# [--let $rpl_server_parameters= --flag1 --flag2 ...]
+# [--let $rpl_debug= 1]
+# --source include/rpl_start_server.inc
+#
+# Parameters:
+#
+# $rpl_server_number
+# Number to identify the server that needs to reconnect. 1 is the
+# master server, 2 the slave server, 3 the 3rd server, and so on.
+# Cf. include/rpl_init.inc
+#
+# $rpl_server_parameters
+# If set, extra parameters given by this variable are passed to
+# mysqld.
+#
+# $rpl_debug
+# See include/rpl_init.inc
+#
+# ==== See also ====
+#
+# rpl_stop_server.inc
+# rpl_restart_server.inc
+
+
+--let $_rpl_start_server_command= restart
+--let $_rpl_start_server_args= [server_number=$rpl_server_number]
+if ($rpl_server_parameters)
+{
+ --let $_rpl_start_server_command= restart:$rpl_server_parameters
+ --let $_rpl_start_server_args= [server_number=$rpl_server_number parameters: $rpl_server_parameters]
+}
+
+--let $include_filename= rpl_start_server.inc $_rpl_start_server_args
+--source include/begin_include_file.inc
+
+--let $rpl_connection_name= server_$rpl_server_number
+--source include/rpl_connection.inc
+
+# Write file to make mysql-test-run.pl start up the server again
+--exec echo "$_rpl_start_server_command" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
+
+--source include/rpl_reconnect.inc
+
+
+--let $include_filename= rpl_start_server.inc $_rpl_start_server_args
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_start_slaves.inc b/mysql-test/include/rpl_start_slaves.inc
new file mode 100644
index 00000000000..fdd90eb12c5
--- /dev/null
+++ b/mysql-test/include/rpl_start_slaves.inc
@@ -0,0 +1,32 @@
+# ==== Purpose ====
+#
+# Start all slaves configured by rpl_init.inc and wait for the slave
+# threads to start.
+#
+# Note that rpl_init.inc calls this file automatically, so you only
+# need to source this file if the slaves have stopped after that.
+#
+#
+# ==== Usage ====
+#
+# [--let $rpl_debug= 1]
+# [--let $slave_timeout= NUMBER]
+# --source include/rpl_start_slaves.inc
+#
+# Parameters:
+# $rpl_debug
+# See include/rpl_init.inc
+#
+# $slave_timeout
+# Set the timeout when waiting for slave threads to stop and
+# start, respectively. See include/wait_for_slave_param.inc
+
+
+--let $include_filename= rpl_start_slaves.inc
+--source include/begin_include_file.inc
+
+--let $rpl_source_file= include/start_slave.inc
+--source include/rpl_for_each_slave.inc
+
+--let $include_filename= rpl_start_slaves.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_stop_server.inc b/mysql-test/include/rpl_stop_server.inc
new file mode 100644
index 00000000000..e1f8839dd69
--- /dev/null
+++ b/mysql-test/include/rpl_stop_server.inc
@@ -0,0 +1,63 @@
+# ==== Purpose ====
+#
+# Stop the server given by $rpl_server_number.
+#
+# ==== Usage ====
+#
+# --let $rpl_server_number= N
+# [--let $rpl_debug= 1]
+# --source include/rpl_stop_server.inc
+#
+# Parameters:
+#
+# $rpl_server_number
+# Number to identify the server that needs to reconnect. 1 is the
+# master server, 2 the slave server, 3 the 3rd server, and so on.
+# Cf. include/rpl_init.inc
+#
+# $rpl_debug
+# See include/rpl_init.inc
+#
+# ==== See also ====
+#
+# rpl_start_server.inc
+# rpl_restart_server.inc
+
+
+# Can't use begin_include_file / end_include_file because they require
+# executing on a server and the server will go down after this script.
+if (!$_include_file_depth)
+{
+ --echo include/rpl_stop_server.inc [server_number=$rpl_server_number]
+}
+--inc $_include_file_depth
+--let $_rpl_stop_server_old_connection= $CURRENT_CONNECTION
+if ($rpl_debug)
+{
+ --echo $_include_file_indent con='$CURRENT_CONNECTION' warn='$ENABLED_WARNINGS' qlog='$ENABLED_QUERY_LOG' rlog='$ENABLED_RESULT_LOG' aborterr='$ENABLED_ABORT_ON_ERROR'
+ --echo $_include_file_indent==== BEGIN include/$include_filename ====
+}
+
+
+--let $rpl_connection_name= server_$rpl_server_number
+--source include/rpl_connection.inc
+
+# Write file to make mysql-test-run.pl expect the "crash", but don't start
+# it until it's told to
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect
+
+# Send shutdown to the connected server and give
+# it 10 seconds to die before zapping it
+shutdown_server 10;
+
+--source include/wait_until_disconnected.inc
+
+
+--let $rpl_connection_name= $_rpl_stop_server_old_connection
+--source include/rpl_connection.inc
+--dec $_include_file_depth
+if ($rpl_debug)
+{
+ --echo $_include_file_indent==== END include/rpl_stop_server.inc [server_number=$rpl_server_number] ====
+ --echo $_include_file_indent con='$CURRENT_CONNECTION' warn='$ENABLED_WARNINGS' qlog='$ENABLED_QUERY_LOG' rlog='$ENABLED_RESULT_LOG' aborterr='$ENABLED_ABORT_ON_ERROR'
+}
diff --git a/mysql-test/include/rpl_stop_slaves.inc b/mysql-test/include/rpl_stop_slaves.inc
new file mode 100644
index 00000000000..2b9199739dd
--- /dev/null
+++ b/mysql-test/include/rpl_stop_slaves.inc
@@ -0,0 +1,33 @@
+# ==== Purpose ====
+#
+# Stop all slaves configured by rpl_init.inc and waits for the slave
+# threads to stop.
+#
+#
+# ==== Usage ====
+#
+# [--let $rpl_only_running_threads= 1]
+# [--let $rpl_debug= 1]
+# [--let $rpl_timeout= NUMBER]
+# --source include/rpl_stop_slaves.inc
+#
+# Parameters:
+# $rpl_only_running_threads
+# See include/stop_slave.inc
+#
+# $slave_timeout
+# Set the timeout when waiting for slave threads to stop. See
+# include/wait_for_slave_param.inc
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= rpl_stop_slaves.inc
+--source include/begin_include_file.inc
+
+--let $rpl_source_file= include/stop_slave.inc
+--source include/rpl_for_each_slave.inc
+
+--let $include_filename= rpl_stop_slaves.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/rpl_sync.inc b/mysql-test/include/rpl_sync.inc
new file mode 100644
index 00000000000..be2904528ff
--- /dev/null
+++ b/mysql-test/include/rpl_sync.inc
@@ -0,0 +1,153 @@
+# ==== Purpose ====
+#
+# Sync all servers in an arbitrary replication topology. This works
+# only if the servers have been configured with rpl_init.inc (and
+# possibly rpl_change_topology.inc).
+#
+#
+# ==== Usage ====
+#
+# [--let $rpl_only_running_threads= 1]
+# [--let $rpl_debug= 1]
+# [--let $slave_timeout= NUMBER]
+# --source include/rpl_sync.inc
+#
+# Parameters:
+# $rpl_only_running_threads
+# By default, this script assumes that both the IO thread and the
+# SQL thread are running and fails if one of them is stopped. If
+# $rpl_only_running_threads is set, this script first checks
+# which slave threads are running:
+# - If both threads are running, sync both threads with master.
+# - If only IO thread is running, sync IO thread with master.
+# - If only SQL thread is running, sync SQL thread with IO thread.
+# - If no thread is running, don't sync.
+#
+# $slave_timeout
+# Set the timeout when waiting for threads to sync. See
+# include/wait_for_slave_param.inc
+#
+# $rpl_debug
+# See include/rpl_init.inc
+#
+#
+# ==== Side effects ====
+#
+# Does not change the current connection (note that this is different
+# from mysqltest's built-in sync_slave_with_master command).
+
+
+--let $include_filename= rpl_sync.inc
+--source include/begin_include_file.inc
+
+
+# Compute $rpl_sync_chain if needed. We could have done this in
+# rpl_change_topology.inc, but instead we do it here because that
+# means we only compute $rpl_sync_chain when it is needed.
+if ($rpl_sync_chain_dirty)
+{
+ --source include/rpl_generate_sync_chain.inc
+ --let $rpl_sync_chain_dirty= 0
+}
+
+
+if ($rpl_debug)
+{
+ --echo \$rpl_sync_chain = '$rpl_sync_chain' \$rpl_only_running_threads= $rpl_only_running_threads
+}
+
+if (!$rpl_server_count_length)
+{
+ --die \$rpl_server_count_length is not set. Did you call rpl_init.inc?
+}
+
+
+--let $_rpl_i= 1
+--let $_rpl_connect= 0
+while ($_rpl_i) {
+ # $rpl_sync_chain consists of a sequence of sync chains. Each sync
+ # chain has the form:
+ #
+ # <space><server1_1><server1_2>...<server1_N>
+ #
+ # So the space character indicates that a new sync chain starts.
+ --let $_rpl_server= `SELECT TRIM(SUBSTR('$rpl_sync_chain', 1 + ($_rpl_i - 1) * $rpl_server_count_length, $rpl_server_count_length))`
+
+ if ($_rpl_server)
+ {
+ if ($rpl_debug)
+ {
+ --echo [sync server_$_rpl_prev_server -> server_$_rpl_server]
+ }
+ if ($rpl_only_running_threads)
+ {
+ --connection server_$_rpl_server
+ --let $_rpl_slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1)
+ --let $_rpl_slave_sql_running= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1)
+ if ($rpl_debug)
+ {
+ --echo Sync IO: $_rpl_slave_io_running; Sync SQL: $_rpl_slave_sql_running
+ }
+ --let $_rpl_slave_io_running= `SELECT IF('$_rpl_slave_io_running' != 'No', 1, '')`
+ --let $_rpl_slave_sql_running= `SELECT IF('$_rpl_slave_sql_running' = 'Yes', 1, '')`
+ if ($_rpl_slave_io_running)
+ {
+ --connection server_$_rpl_prev_server
+ if ($_rpl_slave_sql_running)
+ {
+ if ($rpl_debug)
+ {
+ --let $_rpl_master_file= query_get_value("SHOW MASTER STATUS", File, 1)
+ --let $_rpl_master_pos= query_get_value("SHOW MASTER STATUS", Position, 1)
+ --echo syncing master_file='$_rpl_master_file' master_pos='$_rpl_master_pos'
+ }
+ --sync_slave_with_master server_$_rpl_server
+ }
+ if (!$_rpl_slave_sql_running)
+ {
+ --let $sync_slave_connection= server_$_rpl_server
+ --source include/sync_slave_io_with_master.inc
+ }
+ }
+ if (!$_rpl_slave_io_running)
+ {
+ if ($_rpl_slave_sql_running)
+ {
+ --source include/sync_slave_sql_with_io.inc
+ }
+ }
+ }
+ if (!$rpl_only_running_threads)
+ {
+ --connection server_$_rpl_prev_server
+ if ($rpl_debug)
+ {
+ --let $_rpl_master_file= query_get_value("SHOW MASTER STATUS", File, 1)
+ --let $_rpl_master_pos= query_get_value("SHOW MASTER STATUS", Position, 1)
+ --echo syncing master_file='$_rpl_master_file' master_pos='$_rpl_master_pos'
+ }
+ --sync_slave_with_master server_$_rpl_server
+ }
+ }
+
+ # This happens at the beginning of a new sync subchain and at the
+ # end of the full sync chain.
+ if (!$_rpl_server)
+ {
+ --inc $_rpl_i
+ --let $_rpl_server= `SELECT TRIM(SUBSTR('$rpl_sync_chain', 1 + ($_rpl_i - 1) * $rpl_server_count_length, $rpl_server_count_length))`
+
+ if (!$_rpl_server)
+ {
+ # terminate loop
+ --let $_rpl_i= -1
+ }
+ }
+
+ --let $_rpl_prev_server= $_rpl_server
+ --inc $_rpl_i
+}
+
+
+--let $include_filename= rpl_sync.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/save_master_pos.inc b/mysql-test/include/save_master_pos.inc
new file mode 100644
index 00000000000..2c176d160cc
--- /dev/null
+++ b/mysql-test/include/save_master_pos.inc
@@ -0,0 +1,33 @@
+# ==== Purpose ====
+#
+# Save the current binlog position on the master, just like the
+# built-in mysqltest command save_master_pos. The advantage of this
+# script is that the saved position is available to the test script.
+#
+#
+# ==== Usage ====
+#
+# [--let $rpl_debug= 1]
+# --source include/save_master_pos.inc
+#
+# Typically, you would use this script together with
+# include/sync_io_with_master.inc
+#
+# Parameters:
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= save_master_pos.inc
+--source include/begin_include_file.inc
+
+let $_master_file= query_get_value("SHOW MASTER STATUS", File, 1);
+let $_master_pos= query_get_value("SHOW MASTER STATUS", Position, 1);
+
+if ($rpl_debug)
+{
+ --echo save_master_pos saved file='$_master_file', pos='$_master_pos'
+}
+
+--let $include_filename= save_master_pos.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc
index 86a5da328af..4f1d4f6f162 100644
--- a/mysql-test/include/setup_fake_relay_log.inc
+++ b/mysql-test/include/setup_fake_relay_log.inc
@@ -29,52 +29,55 @@
# Creates a binlog file and a binlog index file, and sets
# @@global.relay_log_purge=1. All this is restored when you call
# cleanup_fake_relay_log.inc.
-#
-# Enables the query log.
---disable_query_log
+--let $include_filename= setup_fake_relay_log.inc
+--source include/begin_include_file.inc
+
+if (!$rpl_debug)
+{
+ --disable_query_log
+}
# Print message.
let $_fake_relay_log_printable= `SELECT REPLACE('$fake_relay_log', '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')`;
--echo Setting up fake replication from $_fake_relay_log_printable
# Sanity check.
+let $running= 0;
let $_sql_running= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
let $_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
-if (`SELECT "$_sql_running" = "Yes" OR "$_io_running" = "Yes"`) {
+if ($_sql_running == Yes) {
+ let $running= 1;
+}
+if ($_io_running == Yes) {
+ let $running= 1;
+}
+if ($running) {
--echo Error: Slave was running when test case sourced
--echo include/setup_fake_replication.inc
--echo Slave_IO_Running = $_io_running; Slave_SQL_Running = $_sql_running
- --echo Printing some debug info:
- SHOW SLAVE STATUS;
- SHOW MASTER STATUS;
- SHOW BINLOG EVENTS;
- SHOW PROCESSLIST;
+ --source include/show_rpl_debug_info.inc
+ --die
}
# Read server variables.
-let $MYSQLD_DATADIR= `SELECT @@datadir`;
+let $_fake_datadir= `SELECT @@datadir`;
let $_fake_filename= query_get_value(SHOW VARIABLES LIKE 'relay_log', Value, 1);
-if (`SELECT '$_fake_filename' = ''`) {
- --echo Badly written test case: relay_log variable is empty. Please use the
- --echo server option --relay-log=FILE.
+if (!$_fake_filename) {
+ --die ERROR IN TEST: relay_log variable is empty. Please use the server option --relay-log=FILE.
}
-let $_fake_relay_log= $MYSQLD_DATADIR/$_fake_filename-fake.000001;
-let $_fake_relay_index= $MYSQLD_DATADIR/$_fake_filename.index;
+let $_fake_relay_log= $_fake_datadir/$_fake_filename-fake.000001;
+let $_fake_relay_index= $_fake_datadir/$_fake_filename.index;
# Need to restore relay_log_purge in cleanup_fake_relay_log.inc, since
# CHANGE MASTER modifies it (see the manual for CHANGE MASTER).
let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`;
-# Reset slave and remove relay log and index files if they exist
RESET SLAVE;
-error 0,1;
-remove_file $MYSQLD_DATADIR/$_fake_filename.000001;
-error 0,1;
-remove_file $MYSQLD_DATADIR/$_fake_filename.index;
+let $_orphan_relay_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
# Create relay log file.
-copy_file $fake_relay_log $_fake_relay_log;
+--copy_file $fake_relay_log $_fake_relay_log
# Create relay log index.
@@ -83,17 +86,25 @@ copy_file $fake_relay_log $_fake_relay_log;
# relay log before comparison, thus we need to added the directory
# part (./ on unix .\ on windows) when faking the relay-log-bin.index.
-if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`)
-{
- eval select './$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index';
-}
+# mysqltest currently parses backslash escapes wrong, so any sequence
+# of N backslashes is collapsed to just one backslash. So we use the
+# SQL function CHAR() to generate a backslash character instead. Since
+# the string is interpreted in SQL context, we to escape it, so we use
+# two backslashes.
-if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") != 0`)
-{
- eval select '.\\\\$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index';
-}
+--let $_fake_dir= `select IF(convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows"), CONCAT('.', CHAR(92), CHAR(92)), './')`
+--let $write_var= $_fake_dir$_fake_filename-fake.000001\n
+--let $write_to_file= $_fake_relay_index
+--source include/write_var_to_file.inc
+
+# Remember old settings.
+--let $_fake_old_master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1)
# Setup replication from existing relay log.
eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_filename-fake.000001', RELAY_LOG_POS=4;
---enable_query_log
+# remove the orphan log file (became spurious)
+-- remove_file $_fake_datadir/$_orphan_relay_file
+
+--let $include_filename= setup_fake_relay_log.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/show_events.inc b/mysql-test/include/show_events.inc
index 2fd0bc6dbd8..ff5a7105c24 100644
--- a/mysql-test/include/show_events.inc
+++ b/mysql-test/include/show_events.inc
@@ -18,13 +18,15 @@ if ($is_relay_log)
--let $_statement=show relaylog events
}
-if (`SELECT '$binlog_file' <> ''`)
+if ($binlog_file)
{
--let $_statement= $_statement in '$binlog_file'
}
--let $_statement= $_statement from $binlog_start
+# Cannot use if($binlog_limit) since the variable may begin with a 0
+
if (`SELECT '$binlog_limit' <> ''`)
{
--let $_statement= $_statement limit $binlog_limit
diff --git a/mysql-test/include/show_rpl_debug_info.inc b/mysql-test/include/show_rpl_debug_info.inc
index 148d11f3b02..1b2b7360970 100644
--- a/mysql-test/include/show_rpl_debug_info.inc
+++ b/mysql-test/include/show_rpl_debug_info.inc
@@ -3,87 +3,109 @@
# Print status information for replication, typically used to debug
# test failures.
#
-# First, the following is printed on slave:
+# The following is printed on the current connection:
#
+# SELECT NOW()
# SHOW SLAVE STATUS
+# SHOW MASTER STATUS
# SHOW PROCESSLIST
# SHOW BINLOG EVENTS IN <binlog_name>
#
# Where <binlog_name> is the currently active binlog.
#
-# Then, the following is printed on master:
-#
-# SHOW MASTER STATUS
-# SHOW PROCESSLIST
-# SHOW BINLOG EVENTS IN <sql_binlog_name>
-# SHOW BINLOG EVENTS IN <io_binlog_name>
+# Then, the same is printed from all connections configured by
+# rpl_init.inc - i.e., on connection server_N, where
+# 1 <= N <= $rpl_server_count
#
-# Where <sql_binlog_name> is the binlog name that the slave sql thread
-# is currently reading from and <io_binlog_name> is the binlog that
-# the slave IO thread is currently reading from.
#
# ==== Usage ====
#
-# [let $master_connection= <connection>;]
-# source include/show_rpl_debug_info.inc;
+# [--let $rpl_only_current_connection= 1]
+# --source include/show_rpl_debug_info.inc
+#
+# Parameters:
+# $rpl_only_current_connection
+# By default, debug info is printed from all connections, starting
+# with the current connection. If this variable is set, debug
+# info is printed only for the current connection.
+#
+#
+# ==== Side effects ====
+#
+# Turns on enable_query_log, enable_result_log, enable_warnings,
+# horizontal_results, and enable_abort_on_error.
#
-# If $master_connection is set, debug info will be retrieved from the
-# connection named $master_connection. Otherwise, it will be
-# retrieved from the 'master' connection if the current connection is
-# 'slave'.
+# Prints non-deterministic output to the query log. This file should
+# never be called in a test that does not fail.
-let $_con= $CURRENT_CONNECTION;
---echo
---echo [on $_con]
---echo
-SELECT NOW();
---echo **** SHOW SLAVE STATUS on $_con ****
-query_vertical SHOW SLAVE STATUS;
---echo
---echo **** SHOW PROCESSLIST on $_con ****
-SHOW PROCESSLIST;
---echo
---echo **** SHOW BINLOG EVENTS on $_con ****
-let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
-eval SHOW BINLOG EVENTS IN '$binlog_name';
-let $_master_con= $master_connection;
-if (`SELECT '$_master_con' = ''`)
+--enable_query_log
+--enable_result_log
+--enable_warnings
+--disable_abort_on_error
+--horizontal_results
+
+
+--let $_rpl_old_con= $CURRENT_CONNECTION
+--let $_rpl_is_first_server= 1
+--let $_rpl_server= $rpl_server_count
+--inc $_rpl_server
+
+
+while ($_rpl_server)
{
- if (`SELECT '$_con' = 'slave'`)
- {
- let $_master_con= master;
- }
- if (`SELECT '$_master_con' = ''`)
+ if (!$_rpl_is_first_server)
{
- --echo Unable to determine master connection. No debug info printed for master.
- --echo Please fix the test case by setting $master_connection before sourcing
- --echo show_rpl_debug_info.inc.
+ --connection server_$_rpl_server
}
-}
-
-if (`SELECT '$_master_con' != ''`)
-{
- let $master_binlog_name_io= query_get_value("SHOW SLAVE STATUS", Master_Log_File, 1);
- let $master_binlog_name_sql= query_get_value("SHOW SLAVE STATUS", Relay_Master_Log_File, 1);
--echo
- --echo [on $_master_con]
- connection $_master_con;
+ --echo ############################## $CURRENT_CONNECTION ##############################
+ --echo
+ --echo **** SHOW WARNINGS on $CURRENT_CONNECTION ****
+ SHOW WARNINGS;
--echo
- SELECT NOW();
- --echo **** SHOW MASTER STATUS on $_master_con ****
+ --echo **** SELECT replication-related variables on $CURRENT_CONNECTION ****
+ SELECT NOW(), @@SERVER_ID;
+ --echo
+ --echo **** SHOW SLAVE STATUS on $CURRENT_CONNECTION ****
+ query_vertical SHOW SLAVE STATUS;
+ --echo
+ --echo **** SHOW MASTER STATUS on $CURRENT_CONNECTION ****
query_vertical SHOW MASTER STATUS;
--echo
- --echo **** SHOW PROCESSLIST on $_master_con ****
+ --echo **** SHOW SLAVE HOSTS on $CURRENT_CONNECTION ****
+ query_vertical SHOW SLAVE HOSTS;
+ --echo
+ --echo **** SHOW PROCESSLIST on $CURRENT_CONNECTION ****
SHOW PROCESSLIST;
--echo
- --echo **** SHOW BINLOG EVENTS on $_master_con ****
- eval SHOW BINLOG EVENTS IN '$master_binlog_name_sql';
- if (`SELECT '$master_binlog_name_io' != '$master_binlog_name_sql'`)
+ --echo **** SHOW BINARY LOGS on $CURRENT_CONNECTION ****
+ SHOW BINARY LOGS;
+ --echo
+ --echo **** SHOW BINLOG EVENTS on $CURRENT_CONNECTION ****
+ let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
+ --echo binlog_name = '$binlog_name'
+ eval SHOW BINLOG EVENTS IN '$binlog_name';
+ --echo
+ --echo **** SHOW RELAYLOG EVENTS on $CURRENT_CONNECTION ****
+ let $relaylog_name= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
+ --echo relaylog_name = '$relaylog_name'
+ eval SHOW RELAYLOG EVENTS IN '$relaylog_name';
+
+
+ --let $_rpl_is_first_server= 0
+ --dec $_rpl_server
+ # Don't use same connection twice.
+ if (`SELECT 'server_$_rpl_server' = '$_rpl_old_con'`)
{
- eval SHOW BINLOG EVENTS IN '$master_binlog_name_io';
+ --dec $_rpl_server
+ if ($rpl_only_current_connection)
+ {
+ --let $_rpl_server= 0
+ }
}
-
- connection $_con;
}
+
+--connection $_rpl_old_con
+--enable_abort_on_error
diff --git a/mysql-test/include/show_slave_status.inc b/mysql-test/include/show_slave_status.inc
index d66c068e19b..67b1c987954 100644
--- a/mysql-test/include/show_slave_status.inc
+++ b/mysql-test/include/show_slave_status.inc
@@ -1,25 +1,75 @@
-# Include file to show the slave status, masking out some information
-# that varies depending on where the test is executed.
+# ==== Purpose ====
+#
+# Show selected columns of output from SHOW SLAVE STATUS.
+#
+# Note: test cases should never call SHOW SLAVE STATUS directly,
+# because that outputs more information to the query log than what is
+# needed for the property that is being tested. That would cause
+# maintenance problems, because (1) it is hard for a human to
+# understand what property is being tested; (2) the output of many of
+# the fields is non-deterministic (e.g., Slave_IO_State) or changes
+# frequently (e.g., binlog positions).
+#
+# Instead, what you want most of the time is to source one of the
+# following scripts:
+#
+# include/check_slave_no_error.inc
+# Assert that Slave_SQL_Errno = Slave_IO_Errno = 0.
+#
+# include/check_slave_is_running.inc
+# Assert that Slave_IO_Running = Slave_SQL_Running = 'Yes'.
+#
+# include/wait_for_slave_sql_error.inc
+# Wait for the SQL thread to get a given error (and assert that
+# it has this error).
+#
+# include/wait_for_slave_io_error.inc
+# Wait for the IO thread to get a given error (and assert that
+# it has this error).
+#
+# include/wait_for_slave_sql_to_stop.inc
+# include/wait_for_slave_io_to_stop.inc
+# include/wait_for_slave_to_stop.inc
+# Wait for the SQL thread, the IO thread, or both to stop (and
+# assert they stop).
+#
+# When none of the above applies, you may use this script instead.
+# However, take care so that the test never contains explicit binlog
+# coordinates. Usually you can read the binlog coordinates into a
+# variable and compare it to some other coordinates.
+#
+#
+# ==== Usage ====
+#
+# --let $status_items= Column_Name[, Column_Name[, ...]]
+# --source include/show_slave_status.inc
+#
+# Parameters:
+# $status_items
+# Set to the name of the column in the output of SHOW SLAVE STATUS
+# that you want to display. Example:
+#
+# --let $status_items= Master_SSL_Allowed
+#
+# You can show multiple columns by setting $status_items to a
+# comma-separated list. Example:
+#
+# --let $status_items= Master_Log_File, Relay_Master_Log_File
---let $_items=$status_items
-if (`SELECT "XX$status_items" = "XX"`)
+
+--let $_show_slave_status_items=$status_items
+if (!$status_items)
{
- --die 'Variable status_items is NULL'
+ --die Bug in test case: The mysqltest variable $status_items is not set.
}
---disable_query_log
---vertical_results
-while (`SELECT "XX$_items" <> "XX"`)
+while ($_show_slave_status_items)
{
- --let $_name= `SELECT SUBSTRING_INDEX('$_items', ',', 1)`
- --let $_items= `SELECT LTRIM(SUBSTRING('$_items', LENGTH('$_name') + 2))`
-
- --let $_value= query_get_value(SHOW SLAVE STATUS, $_name, 1)
+ --let $_show_slave_status_name= `SELECT SUBSTRING_INDEX('$_show_slave_status_items', ',', 1)`
+ --let $_show_slave_status_items= `SELECT LTRIM(SUBSTRING('$_show_slave_status_items', LENGTH('$_show_slave_status_name') + 2))`
- --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
- --eval SELECT "$_value" AS $_name
+ --let $_show_slave_status_value= query_get_value(SHOW SLAVE STATUS, $_show_slave_status_name, 1)
+ --let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')`
+ --echo $_show_slave_status_name = '$_show_slave_status_value'
}
-
---horizontal_results
---enable_query_log
diff --git a/mysql-test/include/start_slave.inc b/mysql-test/include/start_slave.inc
index 78a02736de8..d01978037b4 100644
--- a/mysql-test/include/start_slave.inc
+++ b/mysql-test/include/start_slave.inc
@@ -6,16 +6,34 @@
# Please use this instead of 'START SLAVE', to reduce the risk of test
# case bugs.
#
+#
# ==== Usage ====
#
-# source include/wait_for_slave_to_start.inc;
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/start_slave.inc
+#
+# Parameters:
+# $slave_timeout
+# See include/wait_for_slave_param.inc
#
-# Parameters to this macro are $slave_timeout and
-# $master_connection. See wait_for_slave_param.inc for
-# descriptions.
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= start_slave.inc
+--source include/begin_include_file.inc
+
+
+if (!$rpl_debug)
+{
+ --disable_query_log
+}
+
---disable_query_log
START SLAVE;
---enable_query_log
---echo include/start_slave.inc
source include/wait_for_slave_to_start.inc;
+
+
+--let $include_filename= start_slave.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/stop_slave.inc b/mysql-test/include/stop_slave.inc
index 7161e6fe739..64cc0d5b322 100644
--- a/mysql-test/include/stop_slave.inc
+++ b/mysql-test/include/stop_slave.inc
@@ -3,19 +3,86 @@
# Issues STOP SLAVE on the current connection. Then waits until both
# the IO and SQL threads have stopped, or until a timeout is reached.
#
-# Please use this instead of 'STOP SLAVE', to reduce the risk of test
-# case bugs.
+# Please use this instead of 'STOP SLAVE', to reduce the risk of races
+# in test cases.
+#
+# This will fail if the slave IO or SQL thread has an error. If you
+# expect an error in the IO thread, use
+# include/wait_for_slave_io_error.inc and include/stop_slave_sql.inc.
+#
#
# ==== Usage ====
#
-# source include/wait_for_slave_to_start.inc;
+# [--let $rpl_only_running_threads= 1]
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/stop_slave.inc
+#
+# Parameters:
+# $rpl_only_running_threads
+# By default, this script executes STOP SLAVE unconditionally.
+# This generates a warnings if one or both slave threads are
+# already stopped. If $rpl_only_running_threads is set, this
+# script checks which slave threads are running, and issues either
+# STOP SLAVE, STOP SLAVE SQL_THREAD, STOP SLAVE IO_THREAD, or
+# nothing.
#
-# Parameters to this macro are $slave_timeout and
-# $master_connection. See wait_for_slave_param.inc for
-# descriptions.
+# $slave_timeout
+# See include/wait_for_slave_param.inc
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= stop_slave.inc
+--source include/begin_include_file.inc
+
+
+if (!$rpl_debug)
+{
+ --disable_query_log
+}
+
+
+if ($rpl_only_running_threads)
+{
+ --let $_slave_sql_running= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1)
+ --let $_slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1)
+ if ($rpl_debug)
+ {
+ --echo Stop SQL: $_slave_sql_running; Stop IO: $_slave_io_running
+ }
+
+ --let $_slave_running_bits= `SELECT IF('$_slave_io_running' = 'Yes', 1, 0) + IF('$_slave_sql_running' = 'Yes', 2, 0)`
+ if ($_slave_running_bits)
+ {
+ --dec $_slave_running_bits
+ # $_slave_running_bits=1: io thread running
+ if (!$_slave_running_bits)
+ {
+ --source include/stop_slave_io.inc
+ }
+ --dec $_slave_running_bits
+ # $_slave_running_bits=2: sql thread running
+ if (!$_slave_running_bits)
+ {
+ --source include/stop_slave_sql.inc
+ }
+ --dec $_slave_running_bits
+ # $_slave_running_bits=2: both threads running
+ if (!$_slave_running_bits)
+ {
+ STOP SLAVE;
+ --source include/wait_for_slave_to_stop.inc
+ }
+ }
+}
+if (!$rpl_only_running_threads)
+{
+ STOP SLAVE;
+ --source include/wait_for_slave_to_stop.inc
+}
+
---disable_query_log
-STOP SLAVE;
---enable_query_log
---echo include/stop_slave.inc
-source include/wait_for_slave_to_stop.inc;
+--let $include_filename= stop_slave.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/stop_slave_io.inc b/mysql-test/include/stop_slave_io.inc
new file mode 100644
index 00000000000..ddc83782311
--- /dev/null
+++ b/mysql-test/include/stop_slave_io.inc
@@ -0,0 +1,43 @@
+# ==== Purpose ====
+#
+# Issues STOP SLAVE IO_THREAD on the current connection. Then waits
+# until the IO thread has stopped, or until a timeout is reached.
+#
+# This will fail if the slave IO thread has an error. If you expect an
+# error in the IO thread, use include/wait_for_slave_io_error.inc
+# instead.
+#
+# Please use this instead of 'STOP SLAVE IO_THREAD', to reduce the
+# risk of races in test cases.
+#
+#
+# ==== Usage ====
+#
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/stop_slave_io.inc
+#
+# Parameters:
+# $slave_timeout
+# See include/wait_for_slave_param.inc
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= stop_slave_io.inc
+--source include/begin_include_file.inc
+
+
+if (!$rpl_debug)
+{
+ --disable_query_log
+}
+
+
+STOP SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_stop.inc
+
+
+--let $include_filename= stop_slave_io.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/stop_slave_sql.inc b/mysql-test/include/stop_slave_sql.inc
new file mode 100644
index 00000000000..f5075b32fda
--- /dev/null
+++ b/mysql-test/include/stop_slave_sql.inc
@@ -0,0 +1,41 @@
+# ==== Purpose ====
+#
+# Issues STOP SLAVE SQL_THREAD on the current connection. Then waits
+# until the SQL thread has stopped, or until a timeout is reached.
+#
+# Please use this instead of 'STOP SLAVE SQL_THREAD', to reduce the
+# risk of races in test cases.
+#
+# This will fail if the SQL thread has an error.
+#
+#
+# ==== Usage ====
+#
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/stop_slave_sql.inc
+#
+# Parameters:
+# $slave_timeout
+# See include/wait_for_slave_param.inc
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= stop_slave_sql.inc
+--source include/begin_include_file.inc
+
+
+if (!$rpl_debug)
+{
+ --disable_query_log
+}
+
+
+STOP SLAVE SQL_THREAD;
+--source include/wait_for_slave_sql_to_stop.inc
+
+
+--let $include_filename= stop_slave_sql.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/sync_io_with_master.inc b/mysql-test/include/sync_io_with_master.inc
new file mode 100644
index 00000000000..34906c416f5
--- /dev/null
+++ b/mysql-test/include/sync_io_with_master.inc
@@ -0,0 +1,46 @@
+# ==== Purpose ====
+#
+# Waits until the slave IO thread on the current connection has been
+# synced up to the point saved by the last call to
+# include/save_master_pos.inc (i.e., until the IO thead has copied up
+# to the saved position). Does not wait for the SQL thread.
+#
+#
+# ==== Usage ====
+#
+# On master:
+# --source include/save_master_pos.inc
+#
+# On slave:
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/sync_slave_io_with_master.inc
+#
+# Parameters:
+# $slave_timeout
+# See include/wait_for_slave_param.inc
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= sync_io_with_master.inc
+--source include/begin_include_file.inc
+
+
+--let $_old_slave_error_param= $slave_error_param
+--let $slave_error_param= Last_IO_Errno
+
+--let $slave_param= Master_Log_File
+--let $slave_param_value= $_master_file
+source include/wait_for_slave_param.inc;
+
+let $slave_param= Read_Master_Log_Pos;
+let $slave_param_value= $_master_pos;
+source include/wait_for_slave_param.inc;
+
+--let $slave_error_param= $_old_slave_error_param
+
+
+--let $include_filename= sync_io_with_master.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/sync_slave_io_with_master.inc b/mysql-test/include/sync_slave_io_with_master.inc
index f7dd563039c..d0fcef90cae 100644
--- a/mysql-test/include/sync_slave_io_with_master.inc
+++ b/mysql-test/include/sync_slave_io_with_master.inc
@@ -2,35 +2,49 @@
#
# Waits until the slave IO thread has been synced, i.e., all events
# have been copied over to slave. Does not care if the SQL thread is
-# in sync.
+# in sync (or even running).
#
#
# ==== Usage ====
#
-# source include/sync_slave_io_with_master.inc;
+# [--let $sync_slave_connection= <connection_name>]
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/sync_slave_io_with_master.inc
#
-# Syncs to the current position on master, as found by SHOW MASTER
-# STATUS.
+# Syncs slave to the current position on master, as found by SHOW
+# MASTER STATUS.
#
# Must be called on the master. Will change connection to the slave.
#
-# Parameters to this macro are $slave_timeout and
-# $master_connection. See wait_for_slave_param.inc for
-# descriptions.
+# Parameters:
+# $sync_slave_connection
+# By default, this script switches connection to 'slave'. If
+# $sync_slave_connection is set, then '$sync_slave_connection' is
+# used instead of 'slave'.
+#
+# $slave_timeout
+# See include/wait_for_slave_param.inc.
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+--let $include_filename= sync_slave_io_with_master.inc
+--source include/begin_include_file.inc
-let $_master_file= query_get_value("SHOW MASTER STATUS", File, 1);
-let $_master_pos= query_get_value("SHOW MASTER STATUS", Position, 1);
-connection slave;
+--source include/save_master_pos.inc
-let $slave_error_message= Failed while waiting for slave IO thread to sync;
+--let $rpl_connection_name= slave
+if ($sync_slave_connection)
+{
+ --let $rpl_connection_name= $sync_slave_connection
+}
+--source include/rpl_connection.inc
-let $slave_param= Master_Log_File;
-let $slave_param_value= $_master_file;
-source include/wait_for_slave_param.inc;
+--source include/sync_io_with_master.inc
-let $slave_param= Read_Master_Log_Pos;
-let $slave_param_value= $_master_pos;
-source include/wait_for_slave_param.inc;
-let $slave_error_message= ;
+--let $include_filename= sync_slave_io_with_master.inc
+--let $skip_restore_connection= 1
+--source include/end_include_file.inc
diff --git a/mysql-test/include/sync_slave_sql_with_io.inc b/mysql-test/include/sync_slave_sql_with_io.inc
new file mode 100644
index 00000000000..8048f7a177c
--- /dev/null
+++ b/mysql-test/include/sync_slave_sql_with_io.inc
@@ -0,0 +1,50 @@
+# ==== Purpose ====
+#
+# Sync the slave SQL thread with the IO thread.
+#
+# ==== Usage ====
+#
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/sync_slave_sql_with_io.inc
+#
+# Parameters:
+# $slave_timeout
+# By default, the synchronization timeouts after 300 seconds. If
+# $slave_timeout is set, the synchronization timeouts after
+# $slave_timeout seconds.
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= sync_slave_sql_with_io.inc
+--source include/begin_include_file.inc
+
+
+let $_slave_timeout= $slave_timeout;
+if (!$_slave_timeout)
+{
+ let $_slave_timeout= 300;
+}
+
+--let $_master_log_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1)
+--let $_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1)
+
+if ($rpl_debug)
+{
+ --echo Master_Log_File='$_master_log_file' Read_Master_Log_Pos='$_master_log_pos' \$slave_timeout='$_slave_timeout'
+}
+
+--let $_sync_slave_sql_with_io_errno= `SELECT MASTER_POS_WAIT('$_master_log_file', $_master_log_pos, $_slave_timeout)`
+if (`SELECT IFNULL($_sync_slave_sql_with_io_errno, -1) < 0`)
+{
+ --echo #### Failed to sync slave SQL thread with slave IO thread. ####
+ --echo MASTER_POS_WAIT('$_master_log_file', $_master_log_pos, $_slave_timeout) returned $_sync_slave_sql_with_io_errno
+ --source include/show_rpl_debug_info.inc
+ --die Failed to sync slave SQL thread with slave IO thread.
+}
+
+
+--let $include_filename= sync_slave_sql_with_io.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/truncate_file.inc b/mysql-test/include/truncate_file.inc
index c82108681bd..2326d6c0b94 100644
--- a/mysql-test/include/truncate_file.inc
+++ b/mysql-test/include/truncate_file.inc
@@ -1,6 +1,6 @@
# truncate a giving file, all contents of the file are be cleared
-if (`SELECT 'x$file' = 'x'`)
+if (!$file)
{
--echo Please assign a file name to $file!!
exit;
diff --git a/mysql-test/include/wait_for_binlog_event.inc b/mysql-test/include/wait_for_binlog_event.inc
index 7a55c8c2182..b251ae226d3 100644
--- a/mysql-test/include/wait_for_binlog_event.inc
+++ b/mysql-test/include/wait_for_binlog_event.inc
@@ -24,7 +24,7 @@ while (`SELECT INSTR("$_last_event","$wait_binlog_event") = 0`)
real_sleep 0.1;
let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos);
let $_last_event= $_event;
- while (`SELECT "$_event" != "No such row"`)
+ while ($_event != "No such row")
{
inc $_event_pos;
let $_last_event= $_event;
diff --git a/mysql-test/include/wait_for_query_to_fail.inc b/mysql-test/include/wait_for_query_to_fail.inc
new file mode 100644
index 00000000000..471813026ee
--- /dev/null
+++ b/mysql-test/include/wait_for_query_to_fail.inc
@@ -0,0 +1,25 @@
+#
+# Run a query over and over until it fails or timeout occurs
+#
+
+
+let $counter= 100;
+
+disable_abort_on_error;
+disable_query_log;
+disable_result_log;
+eval $query;
+while (!$mysql_errno)
+{
+ eval $query;
+ sleep 0.1;
+ dec $counter;
+
+ if (!$counter)
+ {
+ --die "Waited too long for query to fail";
+ }
+}
+enable_abort_on_error;
+enable_query_log;
+enable_result_log;
diff --git a/mysql-test/include/wait_for_slave_io_error.inc b/mysql-test/include/wait_for_slave_io_error.inc
index 34cbf20a73b..e1609113b8f 100644
--- a/mysql-test/include/wait_for_slave_io_error.inc
+++ b/mysql-test/include/wait_for_slave_io_error.inc
@@ -4,56 +4,86 @@
# error, or until a timeout is reached. Also waits until the IO
# thread has completely stopped.
#
-# ==== Usage ====
#
-# # Wait several errors.
-# let $slave_io_errno= 1, 2, 3;
-# source include/wait_for_slave_io_error.inc;
+# ==== Usage ====
#
-# # Print error message
-# let $slave_io_errno= 1;
-# let $show_slave_io_error= 1;
-# source include/wait_for_slave_io_error.inc;
+# --let $slave_io_errno= NUMBER [, NUMBER ...]
+# [--let $show_slave_io_error= 1]
+# [--let $slave_io_error_is_nonfatal= 1]
+# [--let $rpl_debug= 1]
+# [--let $slave_timeout= NUMBER]
+# --source include/wait_for_slave_io_error.inc
#
# Parameters:
+# $slave_io_errno
+# The expected IO error numbers. This can be either a single
+# number, or a comma-separated list of numbers. Examples:
+# --let $slave_io_errno= 1040, 1053, 2002, 2003, 2006, 2013
+# --let $slave_io_errno= 1045
+# (After BUG#41956 has been fixed, this will be required to be
+# symbolic names instead of numbers.)
#
-# $slave_io_errno
-# The expected IO error numbers. This is required.
-# (After BUG#41956 has been fixed, this will be required to be a
-# symbolic name instead of a numbers.)
+# $show_slave_io_error
+# If set, will print the error to the query log.
#
-# $show_slave_io_error
-# If set, will print the error to the query log.
+# $slave_io_error_is_nonfatal
+# By default, we wait for the slave IO thread to stop completely
+# (i.e., until Slave_IO_State is empty). If this variable is set,
+# then we don't wait. This is useful if the error is non-fatal
+# (e.g., temporary connection error) and does not cause the slave
+# IO thread to stop.
#
-# $slave_timeout
-# See wait_for_slave_param.inc for description.
+# $slave_timeout
+# See include/wait_for_slave_param.inc
#
-# $master_connection
-# See wait_for_slave_param.inc for description.
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= wait_for_slave_io_error.inc [errno=$slave_io_errno]
+--source include/begin_include_file.inc
-if (`SELECT '$slave_io_errno' = ''`) {
- --die !!!ERROR IN TEST: you must set \$slave_io_errno before sourcing wait_for_slave_io_error.inc
-}
let $old_slave_param_comparison= $slave_param_comparison;
let $slave_param= Last_IO_Errno;
let $slave_param_comparison= !=;
let $slave_param_value= 0;
-let $slave_error_message= Failed while waiting for slave to produce an error in its sql thread;
source include/wait_for_slave_param.inc;
-let $slave_error_message= ;
let $slave_param_comparison= $old_slave_param_comparison;
-let $_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
-if (`SELECT $_error NOT IN ($slave_io_errno)`) {
- --echo **** Slave stopped with wrong error code: $_error (expected $slave_io_errno) ****
+let $_wfsie_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
+
+if ($slave_io_errno == '') {
+ --echo !!!ERROR IN TEST: you must set \$slave_io_errno before you source
+ --echo !!!wait_for_slave_sql_error.inc. The error we got this time was '$_wfsie_errno',
+ --echo !!!so you probably want to add the following line to your test case:
+ --echo !!! --let \$slave_io_errno= $_wfsie_errno
+ --die !!!ERROR IN TEST: you must set \$slave_io_errno before sourcing wait_for_slave_io_error.inc
+}
+
+if (`SELECT $_wfsie_errno NOT IN ($slave_io_errno)`) {
+ --echo **** Slave stopped with wrong error code: $_wfsie_errno (expected $slave_io_errno) ****
source include/show_rpl_debug_info.inc;
- --echo **** Slave stopped with wrong error code: $_error (expected $slave_io_errno) ****
+ --echo **** Slave stopped with wrong error code: $_wfsie_errno (expected $slave_io_errno) ****
--die Slave stopped with wrong error code
}
if ($show_slave_io_error)
{
- let $error= query_get_value("SHOW SLAVE STATUS", Last_IO_Error, 1);
- echo Last_IO_Error = $error;
+ --let $_wait_for_slave_io_error_old_status_items= $status_items
+ --let $status_items= Last_IO_Error
+ --source include/show_slave_status.inc
+ --let $status_items= $_wait_for_slave_io_error_old_status_items
}
+
+if (!$slave_io_error_is_nonfatal)
+{
+ --let $slave_param= Slave_IO_State
+ --let $slave_param_value=
+ --source include/wait_for_slave_param.inc
+}
+--let $slave_io_error_is_nonfatal= 0
+
+
+--let $include_filename= wait_for_slave_io_error.inc [errno=$slave_io_errno]
+--source include/end_include_file.inc
diff --git a/mysql-test/include/wait_for_slave_io_to_start.inc b/mysql-test/include/wait_for_slave_io_to_start.inc
index abdc8339290..cd8e5d374a4 100644
--- a/mysql-test/include/wait_for_slave_io_to_start.inc
+++ b/mysql-test/include/wait_for_slave_io_to_start.inc
@@ -4,16 +4,43 @@
# connected to the master (i.e., until SHOW SLAVE STATUS returns Yes
# in the Slave_IO_Running field), or until a timeout is reached.
#
+#
# ==== Usage ====
#
-# source include/wait_for_slave_io_to_start.inc;
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# [--let $rpl_allow_error= 1]
+# --source include/wait_for_slave_io_to_start.inc
+#
+# Parameters:
+# $slave_timeout
+# See include/wait_for_slave_param.inc
#
-# Parameters to this macro are $slave_timeout and
-# $master_connection. See wait_for_slave_param.inc for
-# descriptions.
+# $rpl_allow_error
+# By default, this file fails if there is an error in the IO
+# thread. However, the IO thread can recover and reconnect after
+# certain errors. If such an error is expected, can set
+# $rpl_allow_error=1. This will prevent this file from failing if
+# there is an error in the IO thread.
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= wait_for_slave_io_to_start.inc
+--source include/begin_include_file.inc
+
let $slave_param= Slave_IO_Running;
let $slave_param_value= Yes;
-let $slave_error_message= Failed while waiting for slave IO thread to start;
+if (!$rpl_allow_error)
+{
+ --let $slave_error_param= Last_IO_Errno
+}
source include/wait_for_slave_param.inc;
-let $slave_error_message= ;
+--let $slave_error_param=
+--let $rpl_allow_error= 0
+
+
+--let $include_filename= wait_for_slave_io_to_start.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/wait_for_slave_io_to_stop.inc b/mysql-test/include/wait_for_slave_io_to_stop.inc
index f61b0db1ed7..d25c2ac071d 100644
--- a/mysql-test/include/wait_for_slave_io_to_stop.inc
+++ b/mysql-test/include/wait_for_slave_io_to_stop.inc
@@ -1,24 +1,40 @@
# ==== Purpose ====
#
-# Waits until the IO thread of the current connection has stopped, or
-# until a timeout is reached.
+# Waits until the IO thread of the current connection has stopped
+# gracefully.
+#
+# Note: this script will fail if the IO thread stops with an error.
+# If you expect an error in the IO thread, use
+# include/wait_for_slave_io_error.inc instead.
+#
+# This script also fails if a timeout is reached (default 300
+# seconds).
+#
#
# ==== Usage ====
#
-# source include/wait_for_slave_io_to_stop.inc;
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/wait_for_slave_io_to_stop.inc
#
-# Parameters to this macro are $slave_timeout and
-# $master_connection. See wait_for_slave_param.inc for
-# descriptions.
+# Parameters:
+# $slave_timeout
+# See include/wait_for_slave_param.inc.
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= wait_for_slave_io_to_stop.inc
+--source include/begin_include_file.inc
+
+
+--let $slave_param= Slave_IO_Running
+--let $slave_param_value= No
+--let $slave_error_param= Last_IO_Errno
+--source include/wait_for_slave_param.inc
+--let $slave_error_param=
+
-# if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE
-# STATUS will return an empty set.
-let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
-if (`SELECT '$_slave_io_running' != 'No such row'`)
-{
- let $slave_param= Slave_IO_Running;
- let $slave_param_value= No;
- let $slave_error_message= Failed while waiting for slave IO thread to stop;
- source include/wait_for_slave_param.inc;
- let $slave_error_message= ;
-}
+--let $include_filename= wait_for_slave_io_to_stop.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/wait_for_slave_param.inc b/mysql-test/include/wait_for_slave_param.inc
index b0989c3264e..131d91a8440 100644
--- a/mysql-test/include/wait_for_slave_param.inc
+++ b/mysql-test/include/wait_for_slave_param.inc
@@ -3,11 +3,16 @@
# Waits until SHOW SLAVE STATUS has returned a specified value, or
# until a timeout is reached.
#
+#
# ==== Usage ====
#
-# let $slave_param= Slave_SQL_Running;
-# let $slave_param_value= No;
-# source include/slave_wait_param.inc;
+# --let $slave_param= Slave_SQL_Running
+# --let $slave_param_value= No
+# [--let $slave_param_comparison= [ < | <= | >= | > | = | != ]]
+# [--let $slave_timeout= NUMBER]
+# [--let $slave_error_param= [Slave_SQL_Errno | Slave_IO_Errno]]
+# [--let $rpl_debug= 1]
+# --source include/slave_wait_param.inc
#
# Parameters:
#
@@ -21,64 +26,94 @@
# $slave_param_value. If you want to wait until $slave_param
# becomes *unequal* to $slave_param_value, set this parameter to the
# string '!=', like this:
-# let $slave_param_comparison= !=;
+# --let $slave_param_comparison= !=
#
# $slave_timeout
# The default timeout is 5 minutes. You can change the timeout by
-# setting $slave_timeout. The unit is tenths of seconds.
+# setting $slave_timeout. The unit is seconds.
#
-# $master_connection
-# If the timeout is reached, debug info is given by calling SHOW
-# SLAVE STATUS, SHOW PROCESSLIST, and SHOW BINLOG EVENTS. Then, a
-# 'connection master' is then issued, and more debug info is given
-# by calling SHOW MASTER STATUS, SHOW PROCESSLIST, and SHOW BINLOG
-# EVENTS. If $master_connection is set, the latter three commands
-# will be issued on $master_connection instead of on the host named
-# 'master'. See also show_rpl_debug_info.inc
+# $slave_error_param
+# If set, this script will check if the column of the output from
+# SHOW SLAVE STATUS named $slave_error_param is nonzero. If it is,
+# this script will faile immediately. Typically, this should be set
+# to Last_IO_Errno or Last_SQL_Errno.
#
-# $slave_error_message
-# If set, this is printed when a timeout occurs. This is primarily
-# intended to be used by other wait_for_slave_* macros, to indicate
-# what the purpose of the wait was. (A very similar error message is
-# given by default, but the wait_for_slave_* macros use this to give
-# an error message identical to that in previous versions, so that
-# errors are easier searchable in the pushbuild history.)
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= wait_for_slave_param.inc [$slave_param]
+--source include/begin_include_file.inc
+
+
+let $_slave_timeout= $slave_timeout;
+if (!$_slave_timeout)
+{
+ let $_slave_timeout= 300;
+}
-let $_slave_timeout_counter= $slave_timeout;
-if (!$_slave_timeout_counter)
+if ($slave_error_param == '')
{
- let $_slave_timeout_counter= 3000;
+ --let $slave_error_param= 1
}
-# Save resulting counter for later use.
-let $slave_tcnt= $_slave_timeout_counter;
let $_slave_param_comparison= $slave_param_comparison;
-if (`SELECT '$_slave_param_comparison' = ''`)
+if (!$_slave_param_comparison)
{
let $_slave_param_comparison= =;
}
-let $_show_slave_status_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
-while (`SELECT NOT('$_show_slave_status_value' $_slave_param_comparison '$slave_param_value') AND $_slave_timeout_counter > 0`)
+if ($rpl_debug)
{
- dec $_slave_timeout_counter;
- if ($_slave_timeout_counter)
- {
- sleep 0.1;
- let $_show_slave_status_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
- }
+ --echo Waiting until '$slave_param' $_slave_param_comparison '$slave_param_value' [timeout='$_slave_timeout', \$slave_error_param='$slave_error_param']
+}
+
+--let $_slave_check_configured= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1)
+
+if ($_slave_check_configured == 'No such row')
+{
+ --echo **** ERROR: SHOW SLAVE STATUS returned empty result set. Slave not configured. ****
+ --source include/show_rpl_debug_info.inc
+ --die SHOW SLAVE STATUS returned empty result set. Slave not configured.
}
-# This has to be outside the loop until BUG#41913 has been fixed
-if (!$_slave_timeout_counter)
+# mysqltest doesn't provide any better way to multiply by 10
+--let $_wait_for_slave_param_zero= 0
+--let $_slave_timeout_counter= $_slave_timeout$zero
+--let $_slave_continue= 1
+while ($_slave_continue)
{
- --echo **** ERROR: timeout after $slave_tcnt deci-seconds while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value ****
- if (`SELECT '$slave_error_message' != ''`)
+ --let $_show_slave_status_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1)
+
+ # Check if an error condition is reached.
+ if (!$slave_error_param)
+ {
+ --let $_show_slave_status_error_value= query_get_value("SHOW SLAVE STATUS", $slave_error_param, 1)
+ if ($_show_slave_status_error_value)
+ {
+ --echo **** ERROR: $slave_error_param = '$_show_slave_status_error_value' while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value ****
+ --source include/show_rpl_debug_info.inc
+ --die Error condition reached in include/wait_for_slave_param.inc
+ }
+ }
+
+ # Check if the termination condition is reached.
+ --let $_slave_continue= `SELECT NOT('$_show_slave_status_value' $_slave_param_comparison '$slave_param_value')`
+
+ # Decrease timer, and check if the timeout is reached.
+ if ($_slave_continue)
{
- --echo Message: $slave_error_message
+ --dec $_slave_timeout_counter
+ if (!$_slave_timeout_counter)
+ {
+ --echo **** ERROR: timeout after $_slave_timeout seconds while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value ****
+ --source include/show_rpl_debug_info.inc
+ --die Timeout in include/wait_for_slave_param.inc
+ }
+ --sleep 0.1
}
- --echo Current connection is '$CURRENT_CONNECTION'
- echo Note: the following output may have changed since the failure was detected;
- source include/show_rpl_debug_info.inc;
- die;
}
+
+
+--let $include_filename= wait_for_slave_param.inc [$slave_param]
+--source include/end_include_file.inc
diff --git a/mysql-test/include/wait_for_slave_sql_error.inc b/mysql-test/include/wait_for_slave_sql_error.inc
index aab04036eea..4ecc8f2a5ec 100644
--- a/mysql-test/include/wait_for_slave_sql_error.inc
+++ b/mysql-test/include/wait_for_slave_sql_error.inc
@@ -6,43 +6,65 @@
#
# ==== Usage ====
#
-# source include/wait_for_slave_sql_error.inc;
+# --let $slave_sql_errno= NUMBER
+# [--let $show_slave_sql_error= 1]
+# [--let $rpl_debug= 1]
+# [--let $slave_timeout= NUMBER]
+# --source include/wait_for_slave_sql_error.inc
#
# Parameters:
+# $slave_sql_errno
+# The expected SQL error number. This is required.
+# (After BUG#41956 has been fixed, this will be required to be a
+# symbolic name instead of a number.)
#
-# $slave_sql_errno
-# The expected SQL error number. This is required.
-# (After BUG#41956 has been fixed, this will be required to be a
-# symbolic name instead of a number.)
-#
-# $show_slave_sql_error
-# If set, will print the error to the query log.
+# $show_slave_sql_error
+# If set, will print the error to the query log.
#
-# $slave_timeout
-# See wait_for_slave_param.inc for description.
+# $slave_timeout
+# See include/wait_for_slave_param.inc
#
-# $master_connection
-# See wait_for_slave_param.inc for description.
+# $rpl_debug
+# See include/rpl_init.inc
-if (`SELECT '$slave_sql_errno' = ''`) {
- --die !!!ERROR IN TEST: you must set \$slave_sql_errno before sourcing wait_for_slave_sql_error.inc
-}
+--let $include_filename= wait_for_slave_sql_error.inc [errno=$slave_sql_errno]
+--source include/begin_include_file.inc
+
+
+# Note: here, we should not wait for Slave_SQL_Errno!=0.
+# Slave_SQL_Errno and Slave_SQL_Running are not set atomically.
+# Slave_SQL_Errno is set first, then Slave_SQL_Running. So we wait
+# until Slave_SQL_Running=No to be sure that both conditions hold.
let $slave_param= Slave_SQL_Running;
let $slave_param_value= No;
-let $slave_error_message= Failed while waiting for slave to stop the SQL thread (expecting error in the SQL thread);
source include/wait_for_slave_param.inc;
-let $_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
-if (`SELECT '$_error' != '$slave_sql_errno'`) {
- --echo **** Slave stopped with wrong error code: $_error (expected $slave_sql_errno) ****
+let $_wfsse_errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
+
+if ($slave_sql_errno == '') {
+ --echo !!!ERROR IN TEST: you must set \$slave_sql_errno before you source
+ --echo !!!wait_for_slave_sql_error.inc. The error we got this time was '$_wfsse_errno',
+ --echo !!!so you probably want to add the following line to your test case:
+ --echo !!! --let \$slave_sql_errno= $_wfsse_errno
+ --die !!!ERROR IN TEST: you must set \$slave_sql_errno before sourcing wait_for_slave_sql_error.inc
+}
+
+if (`SELECT $_wfsse_errno NOT IN ($slave_sql_errno)`) {
+ --echo **** Slave stopped with wrong error code: $_wfsse_errno (expected $slave_sql_errno) ****
source include/show_rpl_debug_info.inc;
- --echo **** Slave stopped with wrong error code: $_error (expected $slave_sql_errno) ****
+ --echo **** Slave stopped with wrong error code: $_wfsse_errno (expected $slave_sql_errno) ****
--die Slave stopped with wrong error code
}
if ($show_slave_sql_error)
{
- let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
- echo Last_SQL_Error = $error;
+ --let $_wait_for_slave_sql_error_old_status_items= $status_items
+ --let $status_items= Last_SQL_Error
+ --source include/show_slave_status.inc
+ --let $status_items= $_wait_for_slave_sql_error_old_status_items
}
+
+
+--let $include_filename= wait_for_slave_sql_error.inc [errno=$slave_sql_errno]
+--source include/end_include_file.inc
diff --git a/mysql-test/include/wait_for_slave_sql_error_and_skip.inc b/mysql-test/include/wait_for_slave_sql_error_and_skip.inc
index 11c02c0b490..9246c1839af 100644
--- a/mysql-test/include/wait_for_slave_sql_error_and_skip.inc
+++ b/mysql-test/include/wait_for_slave_sql_error_and_skip.inc
@@ -5,38 +5,58 @@
#
# ==== Usage ====
#
-# let $slave_sql_error= <ERRNO>;
-# source include/wait_for_slave_sql_error_and_skip.inc;
+# --let $slave_sql_error= NUMBER
+# [--let $show_sql_error= 1]
+# [--let $slave_skip_counter= 1]
+# [--let $not_switch_connection= 1]
+# [--let $rpl_debug= 1]
+# [--let $slave_timeout= NUMBER]
+# --source include/wait_for_slave_sql_error_and_skip.inc
#
# Parameters:
#
-# $slave_sql_errno
-# The error number to wait for. This is required. (See
-# wait_for_slave_sql_error.inc)
+# $slave_sql_errno
+# The error number to wait for. This is required. (See
+# wait_for_slave_sql_error.inc)
#
-# $show_sql_error
-# If set, will print the error to the query log.
-#
-# $slave_timeout
-# See wait_for_slave_param.inc for description.
+# $show_sql_error
+# If set, will print the error to the query log.
#
-# $master_connection
-# See wait_for_slave_param.inc for description.
+# $slave_skip_counter
+# If set, skip this number of events. If not set, skip one event.
#
-# $slave_skip_counter
-# If set, skip this number of events. If not set, skip one event.
+# $not_switch_connection
+# By default, this script executes on the connection 'slave'. If
+# $not_switch_connection is set, this script executes on the current
+# connection. In any case, the original connection is restored.
#
-# $not_switch_connection If set, don't switch to slave and don't switch back
-# master.
+# $slave_timeout
+# See include/wait_for_slave_param.inc
#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= wait_for_slave_sql_error_and_skip.inc [errno=$slave_sql_errno]
+--source include/begin_include_file.inc
+
+
+if (!$rpl_debug)
+{
+ --disable_query_log
+}
+
-echo --source include/wait_for_slave_sql_error_and_skip.inc;
if (!$not_switch_connection)
{
- connection slave;
+ --let $rpl_connection_name= slave
+ --source include/rpl_connection.inc
}
+
+
source include/wait_for_slave_sql_error.inc;
+
# skip the erroneous statement
if ($slave_skip_counter) {
eval SET GLOBAL SQL_SLAVE_SKIP_COUNTER= $slave_skip_counter;
@@ -45,7 +65,7 @@ if (!$slave_skip_counter) {
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
}
source include/start_slave.inc;
-if (!$not_switch_connection)
-{
- connection master;
-}
+
+
+--let $include_filename= wait_for_slave_sql_error_and_skip.inc [errno=$slave_sql_errno]
+--source include/end_include_file.inc
diff --git a/mysql-test/include/wait_for_slave_sql_to_start.inc b/mysql-test/include/wait_for_slave_sql_to_start.inc
index 48744f5dd13..4aea9fba569 100644
--- a/mysql-test/include/wait_for_slave_sql_to_start.inc
+++ b/mysql-test/include/wait_for_slave_sql_to_start.inc
@@ -5,13 +5,33 @@
#
# ==== Usage ====
#
-# source include/wait_for_slave_sql_to_start.inc;
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/wait_for_slave_sql_to_start.inc
#
-# Parameters to this macro are $slave_timeout and
-# $master_connection. See wait_for_slave_param.inc for
-# descriptions.
+# Parameters:
+# $slave_timeout
+# See include/wait_for_slave_param.inc
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= wait_for_slave_sql_to_start.inc
+--source include/begin_include_file.inc
+
let $slave_param= Slave_SQL_Running;
let $slave_param_value= Yes;
-let $slave_error_message= Failed while waiting for slave SQL to start;
+
+# Unfortunately, the slave sql thread sets Slave_SQL_Running=Yes
+# *before* it clears Last_SQL_Errno. So we have to allow errors in
+# the SQL thread here.
+
+#--let $slave_error_param= Last_SQL_Errno
source include/wait_for_slave_param.inc;
+#--let $slave_error_param=
+
+
+--let $include_filename= wait_for_slave_sql_to_start.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/wait_for_slave_sql_to_stop.inc b/mysql-test/include/wait_for_slave_sql_to_stop.inc
index 6992613b646..492b3237be5 100644
--- a/mysql-test/include/wait_for_slave_sql_to_stop.inc
+++ b/mysql-test/include/wait_for_slave_sql_to_stop.inc
@@ -1,24 +1,40 @@
# ==== Purpose ====
#
-# Waits the SQL thread of the current connection has stopped, or until
-# a timeout is reached.
+# Waits until the SQL thread of the current connection has stopped
+# gracefully.
+#
+# Note: this script will fail if the SQL thread stops with an error.
+# If you expect an error in the SQL thread, use
+# include/wait_for_slave_io_error.inc instead.
+#
+# This script also fails if a timeout is reached (default 300
+# seconds).
+#
#
# ==== Usage ====
#
-# source include/wait_for_slave_sql_to_stop.inc;
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/wait_for_slave_sql_to_stop.inc
#
-# Parameters to this macro are $slave_timeout and
-# $master_connection. See wait_for_slave_param.inc for
-# descriptions.
+# Parameters:
+# $slave_timeout
+# See include/wait_for_slave_param.inc
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= wait_for_slave_sql_to_stop.inc
+--source include/begin_include_file.inc
+
+
+--let $slave_param= Slave_SQL_Running
+--let $slave_param_value= No
+--let $slave_error_param= Last_SQL_Errno
+--source include/wait_for_slave_param.inc
+--let $slave_error_param=
+
-# if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE
-# STATUS will return an empty set.
-let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
-if (`SELECT '$_slave_io_running' != 'No such row'`)
-{
- let $slave_param= Slave_SQL_Running;
- let $slave_param_value= No;
- let $slave_error_message= Failed while waiting for slave SQL thread to stop;
- source include/wait_for_slave_param.inc;
- let $slave_error_message= ;
-}
+--let $include_filename= wait_for_slave_sql_to_stop.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/wait_for_slave_to_start.inc b/mysql-test/include/wait_for_slave_to_start.inc
index 567950cc6d7..a916e2ea615 100644
--- a/mysql-test/include/wait_for_slave_to_start.inc
+++ b/mysql-test/include/wait_for_slave_to_start.inc
@@ -3,22 +3,28 @@
# Waits until both the IO and SQL threads of the current connection
# have started, or until a timeout is reached.
#
+#
# ==== Usage ====
#
-# source include/wait_for_slave_to_start.inc;
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/wait_for_slave_to_start.inc
+#
+# Parameters:
+# $slave_timeout
+# See include/wait_for_slave_param.inc
#
-# Parameters to this macro are $slave_timeout and
-# $master_connection. See wait_for_slave_param.inc for
-# descriptions.
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= wait_for_slave_to_start.inc
+--source include/begin_include_file.inc
-let $slave_error_message= Failed while waiting for slave to start;
-let $slave_param= Slave_IO_Running;
-let $slave_param_value= Yes;
-source include/wait_for_slave_param.inc;
+--source include/wait_for_slave_io_to_start.inc
+--source include/wait_for_slave_sql_to_start.inc
-let $slave_param= Slave_SQL_Running;
-let $slave_param_value= Yes;
-source include/wait_for_slave_param.inc;
-let $slave_error_message= ;
+--let $include_filename= wait_for_slave_to_start.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/wait_for_slave_to_stop.inc b/mysql-test/include/wait_for_slave_to_stop.inc
index 56d0e7b0c91..1bfd16067c5 100644
--- a/mysql-test/include/wait_for_slave_to_stop.inc
+++ b/mysql-test/include/wait_for_slave_to_stop.inc
@@ -1,30 +1,38 @@
# ==== Purpose ====
#
# Waits until both the IO and SQL threads of the current connection
-# have stopped, or until a timeout is reached.
+# have stopped gracefully.
+#
+# Note: this script will fail if one of the threads stops with an
+# error. If you expect an error in one of the threads, use
+# include/wait_for_slave_io_error.inc or
+# include/wait_for_slave_sql_error.inc instead.
+#
+# This script also fails if a timeout is reached (default 300
+# seconds).
+#
#
# ==== Usage ====
#
-# source include/wait_for_slave_to_stop.inc;
+# [--let $slave_timeout= NUMBER]
+# [--let $rpl_debug= 1]
+# --source include/wait_for_slave_to_stop.inc
#
-# Parameters to this macro are $slave_timeout and
-# $master_connection. See wait_for_slave_param.inc for
-# descriptions.
+# Parameters:
+# $slave_timeout
+# See include/wait_for_slave_param.inc
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+
+--let $include_filename= wait_for_slave_to_stop.inc
+--source include/begin_include_file.inc
-# if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE
-# STATUS will return an empty set.
-let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
-if (`SELECT '$_slave_io_running' != 'No such row'`)
-{
- let $slave_error_message= Failed while waiting for slave to stop;
- let $slave_param= Slave_IO_Running;
- let $slave_param_value= No;
- source include/wait_for_slave_param.inc;
+--source include/wait_for_slave_sql_to_stop.inc
+--source include/wait_for_slave_io_to_stop.inc
- let $slave_param= Slave_SQL_Running;
- let $slave_param_value= No;
- source include/wait_for_slave_param.inc;
- let $slave_error_message= ;
-}
+--let $include_filename= wait_for_slave_to_stop.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/include/wait_for_status_var.inc b/mysql-test/include/wait_for_status_var.inc
index b8b4fa20b86..33338c588c1 100644
--- a/mysql-test/include/wait_for_status_var.inc
+++ b/mysql-test/include/wait_for_status_var.inc
@@ -45,14 +45,28 @@ if (!$_status_timeout_counter)
}
let $_status_var_comparsion= $status_var_comparsion;
-if (`SELECT '$_status_var_comparsion' = ''`)
+if (!$_status_var_comparsion)
{
let $_status_var_comparsion= =;
}
+# Get type of variable
+let $_is_number= 0;
+if (`SELECT '$status_var_value' REGEXP '^[\+\-]*[0-9]+(\.[0-9]+)*\$'`)
+{
+ let $_is_number= 1;
+}
+
let $_show_status_value= query_get_value("SHOW $status_type STATUS LIKE '$status_var'", Value, 1);
-while (`SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_value')`)
+# Set way of comparing
+let $_query= SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_value');
+if ($_is_number)
+{
+ let $_query= SELECT NOT($_show_status_value $_status_var_comparsion $status_var_value);
+}
+
+while (`$_query`)
{
if (!$_status_timeout_counter)
{
@@ -66,4 +80,9 @@ while (`SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_va
dec $_status_timeout_counter;
sleep 0.1;
let $_show_status_value= query_get_value("SHOW $status_type STATUS LIKE '$status_var'", Value, 1);
+ let $_query= SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_value');
+ if ($_is_number)
+ {
+ let $_query= SELECT NOT($_show_status_value $_status_var_comparsion $status_var_value);
+ }
}
diff --git a/mysql-test/include/wait_show_condition.inc b/mysql-test/include/wait_show_condition.inc
index f683ca7b47b..ae1600a7e30 100644
--- a/mysql-test/include/wait_show_condition.inc
+++ b/mysql-test/include/wait_show_condition.inc
@@ -31,6 +31,21 @@
# Created: 2009-02-18 mleich
#
+if (!$condition)
+{
+ --die ERROR IN TEST: the "condition" variable must be set
+}
+
+if (!$field)
+{
+ --die ERROR IN TEST: the "field" variable must be set
+}
+
+if (!$show_statement)
+{
+ --die ERROR IN TEST: the "show_statement" variable must be set
+}
+
let $max_run_time= 30;
if ($wait_timeout)
{
@@ -50,7 +65,7 @@ inc $max_run_time;
let $found= 0;
let $max_end_time= `SELECT UNIX_TIMESTAMP() + $max_run_time`;
-if (`SELECT '$wait_for_all' != '1'`)
+if ($wait_for_all != 1)
{
while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`)
{
@@ -58,24 +73,27 @@ if (`SELECT '$wait_for_all' != '1'`)
real_sleep 0.2;
let $rowno= 1;
let $process_result= 1;
- while (`SELECT $process_result = 1 AND $found = 0`)
+ let $do_loop= 1;
+ while ($do_loop)
{
let $field_value= query_get_value($show_statement, $field, $rowno);
if (`SELECT '$field_value' $condition`)
{
let $found= 1;
+ let $do_loop= 0;
}
- if (`SELECT '$field_value' = 'No such row'`)
+ if ($field_value == No such row)
{
# We are behind the last row of the result set.
let $process_result= 0;
+ let $do_loop= 0;
}
inc $rowno;
}
}
}
-if (`SELECT '$wait_for_all' = '1'`)
+if ($wait_for_all == 1)
{
while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`)
{
@@ -83,16 +101,19 @@ if (`SELECT '$wait_for_all' = '1'`)
real_sleep 0.2;
let $rowno= 1;
let $process_result= 1;
- while (`SELECT $process_result = 1 AND $found = 0`)
+ let $do_loop= 1;
+ while ($do_loop)
{
let $field_value= query_get_value($show_statement, $field, $rowno);
- if (`SELECT '$field_value' = 'No such row'`)
+ if ($field_value == No such row)
{
let $found= 1;
+ let $do_loop= 0;
}
if (`SELECT $found = 0 AND NOT '$field_value' $condition`)
{
let process_result= 0;
+ let $do_loop= 0;
}
inc $rowno;
}
@@ -101,7 +122,7 @@ if (`SELECT '$wait_for_all' = '1'`)
if (!$found)
{
- echo # Timeout in include/wait_show_condition.inc for $wait_condition;
+ echo # Timeout in include/wait_show_condition.inc for $condition;
echo # show_statement : $show_statement;
echo # field : $field;
echo # condition : $condition;
diff --git a/mysql-test/include/write_var_to_file.inc b/mysql-test/include/write_var_to_file.inc
new file mode 100644
index 00000000000..08de195ccbb
--- /dev/null
+++ b/mysql-test/include/write_var_to_file.inc
@@ -0,0 +1,57 @@
+# ==== Purpose ====
+#
+# Write the contents of $write_var to file $write_to_file.
+#
+#
+# ==== Usage ====
+#
+# --let $write_var = <value>
+# --let $write_to_file = [<file>|GENERATE]
+# --source include/write_var_to_file.inc
+#
+# $write_var is evaluated in sql 'string' context, so escapes like \n
+# are interpolated.
+#
+# $write_to_file can be either a filename, or the special string
+# GENERATE. If it is GENERATE, a unique filename is generated (based
+# on UUID()). The filename is saved in $write_to_file so that it can
+# be retrieved later.
+#
+#
+# ==== Implementation ====
+#
+# We can't use mysqltest's write_file because it does not evaluate
+# variables. We can't use '--exec echo $write_var > $write_file'
+# because it will use \n\r line terminator under windows. So the only
+# working way is mysql's SELECT INTO DUMPFILE, which is subject to
+# @@secure_file_priv. That makes this more complex than you might
+# expect.
+
+if (!$write_to_file)
+{
+ --die You must set the mysqltest variable \$write_to_file before you source include/write_var_to_file.inc
+}
+
+if ($write_to_file == 'GENERATE')
+{
+ --let $_wvtf_suffix= `SELECT UUID()`
+ --let $write_to_file= $MYSQLTEST_VARDIR/tmp/_var_file_$_wvtf_suffix.inc
+}
+
+--error 0,1
+--remove_file $write_to_file
+
+if (`SELECT LENGTH(@@secure_file_priv) > 0`)
+{
+ --let $_wvtf_secure_file_priv= `SELECT @@secure_file_priv`
+ --let $_wvtf_suffix= `SELECT UUID()`
+ --let $_wvtf_tmp_file= $_wvtf_secure_file_priv/_wvtf_$_wvtf_suffix
+
+ --eval SELECT '$write_var' INTO DUMPFILE '$_wvtf_tmp_file'
+ --copy_file $_wvtf_tmp_file $write_to_file
+ --remove_file $_wvtf_tmp_file
+}
+if (`SELECT LENGTH(@@secure_file_priv) = 0`)
+{
+ --eval SELECT '$write_var' INTO DUMPFILE '$write_to_file'
+}
diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm
index 8fb0e27eb77..e672b094405 100644
--- a/mysql-test/lib/My/ConfigFactory.pm
+++ b/mysql-test/lib/My/ConfigFactory.pm
@@ -1,4 +1,20 @@
# -*- cperl -*-
+# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library 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
+
package My::ConfigFactory;
use strict;
@@ -130,7 +146,11 @@ sub fix_tmpdir {
sub fix_log_error {
my ($self, $config, $group_name, $group)= @_;
my $dir= $self->{ARGS}->{vardir};
- return "$dir/log/$group_name.err";
+ if ( $::opt_valgrind and $::opt_debug ) {
+ return "$dir/log/$group_name.trace";
+ } else {
+ return "$dir/log/$group_name.err";
+ }
}
sub fix_log {
diff --git a/mysql-test/lib/My/CoreDump.pm b/mysql-test/lib/My/CoreDump.pm
index 3ac9e385070..b0c4a1337d8 100644
--- a/mysql-test/lib/My/CoreDump.pm
+++ b/mysql-test/lib/My/CoreDump.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -21,6 +21,7 @@ use Carp;
use My::Platform;
use File::Temp qw/ tempfile tempdir /;
+use mtr_results;
my $hint_mysqld; # Last resort guess for executable path
@@ -80,7 +81,7 @@ sub _gdb {
return if $? >> 8;
return unless $gdb_output;
- print <<EOF, $gdb_output, "\n";
+ resfile_print <<EOF, $gdb_output, "\n";
Output from gdb follows. The first stack trace is from the failing thread.
The following stack traces are from all threads (so the failing one is
duplicated).
@@ -124,7 +125,7 @@ sub _dbx {
return if $? >> 8;
return unless $dbx_output;
- print <<EOF, $dbx_output, "\n";
+ resfile_print <<EOF . $dbx_output . "\n";
Output from dbx follows. Stack trace is printed for all threads in order,
above this you should see info about which thread was the failing one.
----------------------------
@@ -244,7 +245,7 @@ sub _cdb {
$cdb_output=~ s/^Child\-SP RetAddr Call Site//gm;
$cdb_output=~ s/\+0x([0-9a-fA-F]+)//gm;
- print <<EOF, $cdb_output, "\n";
+ resfile_print <<EOF, $cdb_output, "\n";
Output from cdb follows. Faulting thread is printed twice,with and without function parameters
Search for STACK_TEXT to see the stack trace of
the faulting thread. Callstacks of other threads are printed after it.
diff --git a/mysql-test/lib/My/File/Path.pm b/mysql-test/lib/My/File/Path.pm
index 6e6d23ad9f0..14fb43e8d98 100644
--- a/mysql-test/lib/My/File/Path.pm
+++ b/mysql-test/lib/My/File/Path.pm
@@ -1,4 +1,19 @@
# -*- cperl -*-
+# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# 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
+
package My::File::Path;
use strict;
diff --git a/mysql-test/lib/My/Find.pm b/mysql-test/lib/My/Find.pm
index b2fec0d77b8..9d1d2915012 100644
--- a/mysql-test/lib/My/Find.pm
+++ b/mysql-test/lib/My/Find.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -28,8 +28,6 @@ use My::Platform;
use base qw(Exporter);
our @EXPORT= qw(my_find_bin my_find_dir my_find_file NOT_REQUIRED);
-our $vs_config_dir;
-
my $bin_extension= ".exe" if IS_WINDOWS;
# Helper function to be used for fourth parameter to find functions
@@ -158,7 +156,7 @@ sub my_find_paths {
# User can select to look in a special build dir
# which is a subdirectory of any of the paths
my @extra_dirs;
- my $build_dir= $vs_config_dir || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR};
+ my $build_dir= $::opt_vs_config || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR};
push(@extra_dirs, $build_dir) if defined $build_dir;
if (defined $extension){
diff --git a/mysql-test/lib/My/Options.pm b/mysql-test/lib/My/Options.pm
index 3bfbe1fc90e..dcd934084e2 100644
--- a/mysql-test/lib/My/Options.pm
+++ b/mysql-test/lib/My/Options.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (C) 2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/My/Platform.pm b/mysql-test/lib/My/Platform.pm
index 371120ab644..cbe8f929d71 100644
--- a/mysql-test/lib/My/Platform.pm
+++ b/mysql-test/lib/My/Platform.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm
index 59186f50703..45a37c35ded 100644
--- a/mysql-test/lib/My/SafeProcess.pm
+++ b/mysql-test/lib/My/SafeProcess.pm
@@ -1,14 +1,15 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
#
-# 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 free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library 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
@@ -138,6 +139,7 @@ sub new {
my $host = delete($opts{'host'});
my $shutdown = delete($opts{'shutdown'});
my $user_data= delete($opts{'user_data'});
+ my $envs = delete($opts{'envs'});
# if (defined $host) {
# $safe_script= "lib/My/SafeProcess/safe_process_cpcd.pl";
@@ -160,6 +162,13 @@ sub new {
# Point the safe_process at the right parent if running on cygwin
push(@safe_args, "--parent-pid=".Cygwin::pid_to_winpid($$)) if IS_CYGWIN;
+ foreach my $env_var (@$envs) {
+ croak("Missing = in env string") unless $env_var =~ /=/;
+ croak("Env string $env_var seen, probably missing value for --mysqld-env")
+ if $env_var =~ /^--/;
+ push @safe_args, "--env $env_var";
+ }
+
push(@safe_args, "--");
push(@safe_args, $path); # The program safe_process should execute
diff --git a/mysql-test/lib/My/SafeProcess/Base.pm b/mysql-test/lib/My/SafeProcess/Base.pm
index 9a6871264b8..c0c70e48082 100644
--- a/mysql-test/lib/My/SafeProcess/Base.pm
+++ b/mysql-test/lib/My/SafeProcess/Base.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/My/SafeProcess/Makefile.am b/mysql-test/lib/My/SafeProcess/Makefile.am
deleted file mode 100644
index 33cab066611..00000000000
--- a/mysql-test/lib/My/SafeProcess/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2000-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-testroot = $(prefix)
-safedir = $(testroot)/mysql-test/lib/My/SafeProcess
-#nobase_bin_PROGRAMS = ...
-safe_PROGRAMS = my_safe_process
-
-my_safe_process_SOURCES = safe_process.cc
-
-EXTRA_DIST = safe_kill_win.cc \
- safe_process_win.cc \
- CMakeLists.txt
diff --git a/mysql-test/lib/My/SafeProcess/safe_kill_win.cc b/mysql-test/lib/My/SafeProcess/safe_kill_win.cc
index f72b851d0b6..72fe874e621 100644
--- a/mysql-test/lib/My/SafeProcess/safe_kill_win.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_kill_win.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc
index 12b335ec444..2f90b65f62e 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_process.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 MySQL AB
+/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -176,7 +176,7 @@ int main(int argc, char* const argv[] )
} else {
if ( strcmp(arg, "--verbose") == 0 )
verbose++;
- else if ( strncmp(arg, "--parent-pid", 10) == 0 )
+ else if ( strncmp(arg, "--parent-pid", 12) == 0 )
{
/* Override parent_pid with a value provided by user */
const char* start;
@@ -185,10 +185,15 @@ int main(int argc, char* const argv[] )
start++; /* Step past = */
if ((parent_pid= atoi(start)) == 0)
die("Invalid value '%s' passed to --parent-id", start);
- } else if ( strcmp(arg, "--nocore") == 0 )
+ }
+ else if ( strcmp(arg, "--nocore") == 0 )
{
nocore = true; // Don't allow the process to dump core
}
+ else if ( strncmp (arg, "--env ", 6) == 0 )
+ {
+ putenv(strdup(arg+6));
+ }
else
die("Unknown option: %s", arg);
}
diff --git a/mysql-test/lib/My/SafeProcess/safe_process.pl b/mysql-test/lib/My/SafeProcess/safe_process.pl
index e3114a749d3..54b0073f8df 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process.pl
+++ b/mysql-test/lib/My/SafeProcess/safe_process.pl
@@ -94,7 +94,7 @@ eval {
local $SIG{INT}= \&handle_signal;
local $SIG{CHLD}= sub {
message("Got signal @_");
- kill(9, -$child_pid);
+ kill('KILL', -$child_pid);
my $ret= waitpid($child_pid, 0);
if ($? & 127){
exit(65); # Killed by signal
@@ -134,7 +134,7 @@ if ( $@ ) {
# Use negative pid in order to kill the whole
# process group
#
-my $ret= kill(9, -$child_pid);
+my $ret= kill('KILL', -$child_pid);
message("Killed child: $child_pid, ret: $ret");
if ($ret > 0) {
message("Killed child: $child_pid");
diff --git a/mysql-test/lib/My/SafeProcess/safe_process_win.cc b/mysql-test/lib/My/SafeProcess/safe_process_win.cc
index 8fffede0b62..7e0ae68b4de 100644
--- a/mysql-test/lib/My/SafeProcess/safe_process_win.cc
+++ b/mysql-test/lib/My/SafeProcess/safe_process_win.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -220,6 +220,10 @@ int main(int argc, const char** argv )
{
nocore= TRUE;
}
+ else if ( strncmp (arg, "--env ", 6) == 0 )
+ {
+ putenv(strdup(arg+6));
+ }
else
die("Unknown option: %s", arg);
}
diff --git a/mysql-test/lib/My/SysInfo.pm b/mysql-test/lib/My/SysInfo.pm
index f1ba5fb610f..b8569e415e8 100644
--- a/mysql-test/lib/My/SysInfo.pm
+++ b/mysql-test/lib/My/SysInfo.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (C) 2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/My/Test.pm b/mysql-test/lib/My/Test.pm
index c8bfbd34521..f9eed945e41 100644
--- a/mysql-test/lib/My/Test.pm
+++ b/mysql-test/lib/My/Test.pm
@@ -1,4 +1,18 @@
# -*- cperl -*-
+# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# 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
#
@@ -10,6 +24,7 @@ use strict;
use warnings;
use Carp;
use Storable();
+use mtr_results;
sub new {
@@ -47,9 +62,26 @@ sub is_failed {
}
+my %result_names= (
+ 'MTR_RES_PASSED' => 'pass',
+ 'MTR_RES_FAILED' => 'fail',
+ 'MTR_RES_SKIPPED' => 'skipped',
+ );
+
sub write_test {
my ($test, $sock, $header)= @_;
+ if ($::opt_resfile && defined $test->{'result'}) {
+ resfile_test_info("result", $result_names{$test->{'result'}});
+ if ($test->{'timeout'}) {
+ resfile_test_info("comment", "Timeout");
+ } elsif (defined $test->{'comment'}) {
+ resfile_test_info("comment", $test->{'comment'});
+ }
+ resfile_test_info("result", "warning") if defined $test->{'check'};
+ resfile_to_test($test);
+ }
+
# Give the test a unique key before serializing it
$test->{key}= "$test" unless defined $test->{key};
@@ -67,8 +99,8 @@ sub read_test {
my $test= Storable::thaw($serialized);
die "wrong class (hack attempt?)"
unless ref($test) eq 'My::Test';
+ resfile_from_test($test) if $::opt_resfile;
return $test;
}
-
1;
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index 631a5d8c348..5b091193bff 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -1,6 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2005-2006 MySQL AB
-#
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+#
# 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.
@@ -130,7 +130,7 @@ sub collect_test_cases ($$$$) {
{
last unless $opt_reorder;
# test->{name} is always in suite.name format
- if ( $test->{name} =~ /.*\.$tname/ )
+ if ( $test->{name} =~ /^$sname.*\.$tname$/ )
{
$found= 1;
last;
@@ -157,8 +157,6 @@ sub collect_test_cases ($$$$) {
if ( $opt_reorder && !$quick_collect)
{
# 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, etc.
@@ -170,24 +168,31 @@ sub collect_test_cases ($$$$) {
# Append the criteria for sorting, in order of importance.
#
push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "A" : "B"));
+ push(@criteria, $tinfo->{template_path});
# Group test with equal options together.
# Ending with "~" makes empty sort later than filled
my $opts= $tinfo->{'master_opt'} ? $tinfo->{'master_opt'} : [];
push(@criteria, join("!", sort @{$opts}) . "~");
+ # Add slave opts if any
+ if ($tinfo->{'slave_opt'})
+ {
+ push(@criteria, join("!", sort @{$tinfo->{'slave_opt'}}));
+ }
+ # This sorts tests with force-restart *before* identical tests
+ push(@criteria, $tinfo->{force_restart} ? "force-restart" : "no-restart");
- $sort_criteria{$tinfo->fullname()} = join(" ", @criteria);
+ $tinfo->{criteria}= join(" ", @criteria);
}
- @$cases = sort {
- $sort_criteria{$a->fullname()} . $a->fullname() cmp
- $sort_criteria{$b->fullname()} . $b->fullname() } @$cases;
+ @$cases = sort {$a->{criteria} cmp $b->{criteria}; } @$cases;
# For debugging the sort-order
# foreach my $tinfo (@$cases)
# {
- # print $sort_criteria{$tinfo->fullname()}," -> \t",$tinfo->fullname(),"\n";
+ # my $tname= $tinfo->{name} . ' ' . $tinfo->{combination};
+ # my $crit= $tinfo->{criteria};
+ # print("$tname\n\t$crit\n");
# }
-
}
if (defined $print_testcases){
@@ -204,8 +209,11 @@ sub collect_test_cases ($$$$) {
sub split_testname {
my ($test_name)= @_;
- # Get rid of directory part and split name on .'s
- my @parts= split(/\./, basename($test_name));
+ # If .test file name is used, get rid of directory part
+ $test_name= basename($test_name) if $test_name =~ /\.test$/;
+
+ # Now split name on .'s
+ my @parts= split(/\./, $test_name);
if (@parts == 1){
# Only testname given, ex: alias
@@ -259,9 +267,11 @@ sub collect_one_suite
"mysql-test/suite",
"mysql-test",
# Look in storage engine specific suite dirs
- "storage/*/mysql-test-suites"
+ "storage/*/mtr",
+ # Look in plugin specific suite dir
+ "plugin/$suite/tests",
],
- [$suite]);
+ [$suite, "mtr"]);
}
mtr_verbose("suitedir: $suitedir");
}
diff --git a/mysql-test/lib/mtr_gcov.pl b/mysql-test/lib/mtr_gcov.pl
index 2f211b7566d..a6e1f8efd5f 100644
--- a/mysql-test/lib/mtr_gcov.pl
+++ b/mysql-test/lib/mtr_gcov.pl
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004, 2006 MySQL AB
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -33,7 +33,7 @@ sub gcov_prepare ($) {
#
# Collect gcov statistics.
# Arguments:
-# $dir basedir, normally source directory
+# $dir basedir, normally build directory
# $gcov gcov utility program [path] name
# $gcov_msg message file name
# $gcov_err error file name
@@ -45,31 +45,26 @@ sub gcov_collect ($$$) {
my $start_dir= cwd();
print "Collecting source coverage info using '$gcov'...$basedir\n";
- -f "$start_dir/$gcov_msg" and unlink("$start_dir/$gcov_msg");
- -f "$start_dir/$gcov_err" and unlink("$start_dir/$gcov_err");
+ -f "$dir/$gcov_msg" and unlink("$dir/$gcov_msg");
+ -f "$dir/$gcov_err" and unlink("$dir/$gcov_err");
my @dirs= `find "$dir" -type d -print | sort`;
#print "List of directories:\n@dirs\n";
foreach my $d ( @dirs ) {
- my $dir_reported= 0;
chomp($d);
chdir($d) or next;
- foreach my $f ( (glob("*.h"), glob("*.cc"), glob("*.c")) ) {
- $f =~ /(.*)\.[ch]c?/;
- -f "$1.gcno" or next;
- if (!$dir_reported) {
- print "Collecting in '$d'...\n";
- $dir_reported= 1;
- }
- system("$gcov $f 2>>$start_dir/$gcov_err >>$start_dir/$gcov_msg");
- system("perl", "$basedir/mysql-test/lib/process-purecov-annotations.pl", "$f.gcov");
+ my @flist= glob("*.*.gcno");
+ print ("Collecting in '$d'...\n") if @flist;
+ foreach my $f (@flist) {
+ system("$gcov $f 2>>$dir/$gcov_err >>$dir/$gcov_msg");
+ system("perl", "$basedir/mysql-test/lib/process-purecov-annotations.pl", "$f.gcov");
}
chdir($start_dir);
}
- print "gcov info in $gcov_msg, errors in $gcov_err\n";
+ print "gcov info in $dir/$gcov_msg, errors in $dir/$gcov_err\n";
}
diff --git a/mysql-test/lib/mtr_gprof.pl b/mysql-test/lib/mtr_gprof.pl
index 5820a4007b8..a5e05b28723 100644
--- a/mysql-test/lib/mtr_gprof.pl
+++ b/mysql-test/lib/mtr_gprof.pl
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004 MySQL AB
+# Copyright (C) 2004 MySQL AB, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/mtr_io.pl b/mysql-test/lib/mtr_io.pl
index 21581798ddc..6a6b3a3d028 100644
--- a/mysql-test/lib/mtr_io.pl
+++ b/mysql-test/lib/mtr_io.pl
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (C) 2004-2007 MySQL AB, 2008 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/mtr_match.pm b/mysql-test/lib/mtr_match.pm
index 40afd4e0336..6fc9832ac43 100644
--- a/mysql-test/lib/mtr_match.pm
+++ b/mysql-test/lib/mtr_match.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (C) 2004-2008 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl
index 388d252502a..83b02525ad1 100644
--- a/mysql-test/lib/mtr_misc.pl
+++ b/mysql-test/lib/mtr_misc.pl
@@ -1,15 +1,16 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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.
-#
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library 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
@@ -30,9 +31,18 @@ sub mtr_script_exists(@);
sub mtr_file_exists(@);
sub mtr_exe_exists(@);
sub mtr_exe_maybe_exists(@);
+sub mtr_compress_file($);
sub mtr_milli_sleep($);
sub start_timer($);
sub has_expired($);
+sub init_timers();
+sub mark_time_used($);
+sub mark_time_idle();
+sub add_total_times($);
+sub print_times_used($$);
+sub print_total_times($);
+
+our $opt_report_times;
##############################################################################
#
@@ -190,6 +200,40 @@ sub mtr_exe_exists (@) {
}
}
+#
+# Try to compress file using tools that might be available.
+# If zip/gzip is not available, just silently ignore.
+#
+
+sub mtr_compress_file ($) {
+ my ($filename)= @_;
+
+ mtr_error ("File to compress not found: $filename") unless -f $filename;
+
+ my $did_compress= 0;
+
+ if (IS_WINDOWS)
+ {
+ # Capture stderr
+ my $ziperr= `zip $filename.zip $filename 2>&1`;
+ if ($?) {
+ print "$ziperr\n" if $ziperr !~ /recognized as an internal or external/;
+ } else {
+ unlink($filename);
+ $did_compress=1;
+ }
+ }
+ else
+ {
+ my $gzres= system("gzip $filename");
+ $did_compress= ! $gzres;
+ if ($gzres && $gzres != -1) {
+ mtr_error ("Error: have gzip but it fails to compress core file");
+ }
+ }
+ mtr_print("Compressed file $filename") if $did_compress;
+}
+
sub mtr_milli_sleep ($) {
die "usage: mtr_milli_sleep(milliseconds)" unless @_ == 1;
@@ -225,4 +269,87 @@ sub start_timer ($) { return time + $_[0]; }
sub has_expired ($) { return $_[0] && time gt $_[0]; }
+# Below code is for time usage reporting
+
+use Time::HiRes qw(gettimeofday);
+
+my %time_used= (
+ 'collect' => 0,
+ 'restart' => 0,
+ 'check' => 0,
+ 'ch-warn' => 0,
+ 'test' => 0,
+ 'init' => 0,
+ 'admin' => 0,
+);
+
+my %time_text= (
+ 'collect' => "Collecting test cases",
+ 'restart' => "Server stop/start",
+ 'check' => "Check-testcase",
+ 'ch-warn' => "Check for warnings",
+ 'test' => "Test execution",
+ 'init' => "Initialization/cleanup",
+ 'admin' => "Test administration",
+);
+
+# Counts number of reports from workers
+
+my $time_totals= 0;
+
+my $last_timer_set;
+
+sub init_timers() {
+ $last_timer_set= gettimeofday();
+}
+
+sub mark_time_used($) {
+ my ($name)= @_;
+ return unless $opt_report_times;
+ die "Unknown timer $name" unless exists $time_used{$name};
+
+ my $curr_time= gettimeofday();
+ $time_used{$name}+= int (($curr_time - $last_timer_set) * 1000 + .5);
+ $last_timer_set= $curr_time;
+}
+
+sub mark_time_idle() {
+ $last_timer_set= gettimeofday() if $opt_report_times;
+}
+
+sub add_total_times($) {
+ my ($dummy, $num, @line)= split (" ", $_[0]);
+
+ $time_totals++;
+ foreach my $elem (@line) {
+ my ($name, $spent)= split (":", $elem);
+ $time_used{$name}+= $spent;
+ }
+}
+
+sub print_times_used($$) {
+ my ($server, $num)= @_;
+ return unless $opt_report_times;
+
+ my $output= "SPENT $num";
+ foreach my $name (keys %time_used) {
+ my $spent= $time_used{$name};
+ $output.= " $name:$spent";
+ }
+ print $server $output . "\n";
+}
+
+sub print_total_times($) {
+ # Don't print if we haven't received all worker data
+ return if $time_totals != $_[0];
+
+ foreach my $name (keys %time_used)
+ {
+ my $spent= $time_used{$name}/1000;
+ my $text= $time_text{$name};
+ print ("Spent $spent seconds on $text\n");
+ }
+}
+
+
1;
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index a42627c93cd..88e714f6f8d 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2004-2006 MySQL AB
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -116,18 +116,20 @@ sub sleep_until_file_created ($$$) {
return 1;
}
+ my $seconds= ($loop * $sleeptime) / 1000;
+
# Check if it died after the fork() was successful
if ( defined $proc and ! $proc->wait_one(0) )
{
- mtr_warning("Process $proc died");
+ mtr_warning("Process $proc died after mysql-test-run waited $seconds " .
+ "seconds for $pidfile to be created.");
return 0;
}
mtr_debug("Sleep $sleeptime milliseconds waiting for $pidfile");
# Print extra message every 60 seconds
- my $seconds= ($loop * $sleeptime) / 1000;
- if ( $seconds > 1 and int($seconds * 10) % 600 == 0 )
+ if ( $seconds > 1 && int($seconds * 10) % 600 == 0 && $seconds < $timeout )
{
my $left= $timeout - $seconds;
mtr_warning("Waited $seconds seconds for $pidfile to be created, " .
@@ -138,6 +140,8 @@ sub sleep_until_file_created ($$$) {
}
+ mtr_warning("Timeout after mysql-test-run waited $timeout seconds " .
+ "for the process $proc to create a pid file.");
return 0;
}
diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm
index a90c367178d..189ed19d801 100644
--- a/mysql-test/lib/mtr_report.pm
+++ b/mysql-test/lib/mtr_report.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -32,7 +32,9 @@ our @EXPORT= qw(report_option mtr_print_line mtr_print_thick_line
use mtr_match;
use My::Platform;
use POSIX qw[ _exit ];
+use IO::Handle qw[ flush ];
require "mtr_io.pl";
+use mtr_results;
my $tot_real_time= 0;
@@ -68,7 +70,7 @@ sub _mtr_report_test_name ($) {
print _name(). _timestamp();
printf "%-40s ", $tname;
my $worker = $tinfo->{worker};
- printf "w$worker " if $worker;
+ print "w$worker " if defined $worker;
return $tname;
}
@@ -91,6 +93,7 @@ sub mtr_report_test_passed ($) {
{
$timer_str= mtr_fromfile("$::opt_vardir/log/timer");
$tinfo->{timer}= $timer_str;
+ resfile_test_info('duration', $timer_str) if $::opt_resfile;
}
# Big warning if status already set
@@ -125,7 +128,8 @@ sub mtr_report_test ($) {
# Find out if this test case is an experimental one, so we can treat
# the failure as an expected failure instead of a regression.
for my $exp ( @$::experimental_test_cases ) {
- if ( $exp ne $test_name ) {
+ # Include pattern match for combinations
+ if ( $exp ne $test_name && $test_name !~ /^$exp / ) {
# if the expression is not the name of this test case, but has
# an asterisk at the end, determine if the characters up to
# but excluding the asterisk are the same
@@ -228,7 +232,8 @@ sub mtr_report_stats ($$$$) {
# Find out how we where doing
# ----------------------------------------------------------------------
- my $tot_skiped= 0;
+ my $tot_skipped= 0;
+ my $tot_skipdetect= 0;
my $tot_passed= 0;
my $tot_failed= 0;
my $tot_tests= 0;
@@ -245,8 +250,9 @@ sub mtr_report_stats ($$$$) {
}
elsif ( $tinfo->{'result'} eq 'MTR_RES_SKIPPED' )
{
- # Test was skipped
- $tot_skiped++;
+ # Test was skipped (disabled not counted)
+ $tot_skipped++ unless $tinfo->{'disable'};
+ $tot_skipdetect++ if $tinfo->{'skip_detected_by_test'};
}
elsif ( $tinfo->{'result'} eq 'MTR_RES_PASSED' )
{
@@ -296,6 +302,8 @@ sub mtr_report_stats ($$$$) {
time - $BASETIME, "seconds executing testcases");
}
+ resfile_global("duration", time - $BASETIME) if $::opt_resfile;
+
my $warnlog= "$::opt_vardir/log/warnings";
if ( ! $::glob_use_running_server && !$::opt_extern && -f $warnlog)
{
@@ -382,6 +390,9 @@ MSG
print " $_\n" for @$extra_warnings;
}
+ print "$tot_skipped tests were skipped, ".
+ "$tot_skipdetect by the test itself.\n\n" if $tot_skipped;
+
if ( $tot_failed != 0 || $found_problems)
{
mtr_error("there were failing test cases");
@@ -404,7 +415,7 @@ MSG
##############################################################################
sub mtr_print_line () {
- print '-' x 60 . "\n";
+ print '-' x 74 . "\n";
}
@@ -414,13 +425,18 @@ sub mtr_print_thick_line {
}
-sub mtr_print_header () {
+sub mtr_print_header ($) {
+ my ($wid) = @_;
print "\n";
printf "TEST";
- print " " x 38;
+ if ($wid) {
+ print " " x 34 . "WORKER ";
+ } else {
+ print " " x 38;
+ }
print "RESULT ";
- print "TIME (ms)" if $timer;
- print "\n";
+ print "TIME (ms) or " if $timer;
+ print "COMMENT\n";
mtr_print_line();
print "\n";
}
@@ -490,6 +506,7 @@ sub mtr_warning (@) {
# Print error to screen and then exit
sub mtr_error (@) {
+ IO::Handle::flush(\*STDOUT) if IS_WINDOWS;
print STDERR _name(). _timestamp().
"mysql-test-run: *** ERROR: ". join(" ", @_). "\n";
if (IS_WINDOWS)
diff --git a/mysql-test/lib/mtr_results.pm b/mysql-test/lib/mtr_results.pm
new file mode 100644
index 00000000000..92b03756c04
--- /dev/null
+++ b/mysql-test/lib/mtr_results.pm
@@ -0,0 +1,167 @@
+# -*- cperl -*-
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# 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
+
+package mtr_results;
+use strict;
+use IO::Handle qw[ flush ];
+
+use base qw(Exporter);
+our @EXPORT= qw(resfile_init resfile_global resfile_new_test resfile_test_info
+ resfile_output resfile_output_file resfile_print
+ resfile_print_test resfile_to_test resfile_from_test );
+
+my %curr_result; # Result for current test
+my $curr_output; # Output for current test
+my $do_resfile;
+
+END {
+ close RESF if $do_resfile;
+}
+
+sub resfile_init($)
+{
+ my $fname= shift;
+ open (RESF, " > $fname") or die ("Could not open result file $fname");
+ %curr_result= ();
+ $curr_output= "";
+ $do_resfile= 1;
+}
+
+# Strings need to be quoted if they start with white space or ",
+# or if they contain newlines. Pass a reference to the string.
+# If the string is quoted, " must be escaped, thus \ also must be escaped
+
+sub quote_value($)
+{
+ my $stref= shift;
+
+ for ($$stref) {
+ return unless /^[\s"]/ or /\n/;
+ s/\\/\\\\/g;
+ s/"/\\"/g;
+ $_= '"' . $_ . '"';
+ }
+}
+
+# Output global variable setting to result file.
+
+sub resfile_global($$)
+{
+ return unless $do_resfile;
+ my ($tag, $val) = @_;
+ $val= join (' ', @$val) if ref($val) eq 'ARRAY';
+ quote_value(\$val);
+ print RESF "$tag : $val\n";
+}
+
+# Prepare to add results for new test
+
+sub resfile_new_test()
+{
+ %curr_result= ();
+ $curr_output= "";
+}
+
+# Add (or change) one variable setting for current test
+
+sub resfile_test_info($$)
+{
+ my ($tag, $val) = @_;
+ return unless $do_resfile;
+ quote_value(\$val);
+ $curr_result{$tag} = $val;
+}
+
+# Add to output value for current test.
+# Will be quoted if necessary, truncated if length over 5000.
+
+sub resfile_output($)
+{
+ return unless $do_resfile;
+
+ for (shift) {
+ my $len= length;
+ if ($len > 5000) {
+ my $trlen= $len - 5000;
+ $_= substr($_, 0, 5000) . "\n[TRUNCATED $trlen chars removed]\n";
+ }
+ s/\\/\\\\/g;
+ s/"/\\"/g;
+ $curr_output .= $_;
+ }
+}
+
+# Add to output, read from named file
+
+sub resfile_output_file($)
+{
+ resfile_output(::mtr_grab_file(shift)) if $do_resfile;
+}
+
+# Print text, and also append to current output if we're collecting results
+
+sub resfile_print($)
+{
+ my $txt= shift;
+ print($txt);
+ resfile_output($txt) if $do_resfile;
+}
+
+# Print results for current test, then reset
+# (So calling a second time without having generated new results
+# will have no effect)
+
+sub resfile_print_test()
+{
+ return unless %curr_result;
+
+ print RESF "{\n";
+ while (my ($t, $v) = each %curr_result) {
+ print RESF "$t : $v\n";
+ }
+ if ($curr_output) {
+ chomp($curr_output);
+ print RESF " output : " . $curr_output . "\"\n";
+ }
+ print RESF "}\n";
+ IO::Handle::flush(\*RESF);
+ resfile_new_test();
+}
+
+# Add current test results to test object (to send from worker)
+
+sub resfile_to_test($)
+{
+ return unless $do_resfile;
+ my $tinfo= shift;
+ my @res_array= %curr_result;
+ $tinfo->{'resfile'}= \@res_array;
+ $tinfo->{'output'}= $curr_output if $curr_output;
+}
+
+# Get test results (from worker) from test object
+
+sub resfile_from_test($)
+{
+ return unless $do_resfile;
+ my $tinfo= shift;
+ my $res_array= $tinfo->{'resfile'};
+ return unless $res_array;
+ %curr_result= @$res_array;
+ $curr_output= $tinfo->{'output'} if defined $tinfo->{'output'};
+}
+
+1;
diff --git a/mysql-test/lib/mtr_stress.pl b/mysql-test/lib/mtr_stress.pl
index 702bc178ae5..ab4214791d0 100644
--- a/mysql-test/lib/mtr_stress.pl
+++ b/mysql-test/lib/mtr_stress.pl
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2006 MySQL AB
+# Copyright (C) 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/lib/mtr_unique.pm b/mysql-test/lib/mtr_unique.pm
index 6b60157422d..506af448266 100644
--- a/mysql-test/lib/mtr_unique.pm
+++ b/mysql-test/lib/mtr_unique.pm
@@ -1,5 +1,5 @@
# -*- cperl -*-
-# Copyright (C) 2006 MySQL AB
+# Copyright (C) 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysql-test/mysql-stress-test.pl b/mysql-test/mysql-stress-test.pl
index a1d9669a58b..4661780b91a 100755
--- a/mysql-test/mysql-stress-test.pl
+++ b/mysql-test/mysql-stress-test.pl
@@ -1,4 +1,21 @@
#!/usr/bin/perl
+
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library 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
+
# ======================================================================
# MySQL server stress test system
# ======================================================================
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 04833d58fd3..459c070385b 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl
# -*- cperl -*-
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
##############################################################################
@@ -96,6 +96,7 @@ use mtr_cases;
use mtr_report;
use mtr_match;
use mtr_unique;
+use mtr_results;
use IO::Socket::INET;
use IO::Select;
@@ -108,6 +109,7 @@ require "lib/mtr_misc.pl";
$SIG{INT}= sub { mtr_error("Got ^C signal"); };
our $mysql_version_id;
+my $mysql_version_extra;
our $glob_mysql_test_dir;
our $basedir;
our $bindir;
@@ -160,7 +162,7 @@ our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
# If you add a new suite, please check TEST_DIRS in Makefile.am.
#
-my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,maria,parts,innodb,percona,ndb,vcol,oqgraph,sphinx,perfschema";
+my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,innodb,perfschema,maria,parts,percona,vcol,oqgraph,sphinx";
my $opt_suites;
our $opt_verbose= 0; # Verbose output, enable with --verbose
@@ -175,7 +177,7 @@ our $opt_staging_run= 0;
our @opt_combinations;
our @opt_extra_mysqld_opt;
-our @opt_extra_mysqltest_opt;
+our @opt_mysqld_envs;
my $opt_compress;
my $opt_ssl;
@@ -189,8 +191,15 @@ my $opt_cursor_protocol;
my $opt_view_protocol;
our $opt_debug;
+my $debug_d= "d";
+my $opt_debug_common;
+our $opt_debug_server;
our @opt_cases; # The test cases names in argv
our $opt_embedded_server;
+# -1 indicates use default, override with env.var.
+my $opt_ctest= env_or_val(MTR_UNIT_TESTS => -1);
+# Unit test report stored here for delayed printing
+my $ctest_report;
# Options used when connecting to an already running server
my %opts_extern;
@@ -199,12 +208,13 @@ sub using_extern { return (keys %opts_extern > 0);};
our $opt_fast= 0;
our $opt_force;
our $opt_mem= $ENV{'MTR_MEM'};
+our $opt_clean_vardir= $ENV{'MTR_CLEAN_VARDIR'};
our $opt_gcov;
our $opt_gcov_src_dir;
our $opt_gcov_exe= "gcov";
-our $opt_gcov_err= "mysql-test-gcov.msg";
-our $opt_gcov_msg= "mysql-test-gcov.err";
+our $opt_gcov_err= "mysql-test-gcov.err";
+our $opt_gcov_msg= "mysql-test-gcov.msg";
our $opt_gprof;
our %gprof_dirs;
@@ -212,9 +222,12 @@ our %gprof_dirs;
our $glob_debugger= 0;
our $opt_gdb;
our $opt_client_gdb;
+our $opt_dbx;
+our $opt_client_dbx;
our $opt_ddd;
our $opt_client_ddd;
our $opt_manual_gdb;
+our $opt_manual_dbx;
our $opt_manual_ddd;
our $opt_manual_debug;
our $opt_debugger;
@@ -235,11 +248,14 @@ my $build_thread= 0;
my $opt_record;
my $opt_report_features;
+our $opt_resfile= $ENV{'MTR_RESULT_FILE'} || 0;
+
my $opt_skip_core;
our $opt_check_testcases= 1;
my $opt_mark_progress;
my $opt_max_connections;
+our $opt_report_times= 0;
my $opt_sleep;
@@ -249,7 +265,6 @@ my $opt_shutdown_timeout= $ENV{MTR_SHUTDOWN_TIMEOUT} || 10; # seconds
my $opt_start_timeout = $ENV{MTR_START_TIMEOUT} || 180; # seconds
sub suite_timeout { return $opt_suite_timeout * 60; };
-sub check_timeout { return $opt_testcase_timeout * 6; };
my $opt_wait_all;
my $opt_user_args;
@@ -259,18 +274,20 @@ my $opt_retry_failure= env_or_val(MTR_RETRY_FAILURE => 2);
my $opt_reorder= 1;
my $opt_force_restart= 0;
-my $opt_strace_client;
-
our $opt_user = "root";
-my $opt_valgrind= 0;
+our $opt_valgrind= 0;
+my $opt_valgrind_mysqld= 0;
+my $opt_valgrind_mysqltest= 0;
my @default_valgrind_args= ("--show-reachable=yes");
my @valgrind_args;
our $opt_valgrind_mysqld= 0;
my $opt_valgrind_mysqltest= 0;
my $opt_strace= 0;
+my $opt_strace_client;
my @strace_args;
my $opt_valgrind_path;
+my $valgrind_reports= 0;
my $opt_callgrind;
my %mysqld_logs;
my $opt_debug_sync_timeout= 300; # Default timeout for WAIT_FOR actions.
@@ -286,14 +303,18 @@ sub testcase_timeout ($) {
return $opt_testcase_timeout * 60;
}
+sub check_timeout ($) { return testcase_timeout($_[0]) / 10; }
+
our $opt_warnings= 1;
our $opt_include_ndbcluster= 0;
our $opt_skip_ndbcluster= 1;
my $exe_ndbd;
+my $exe_ndbmtd;
my $exe_ndb_mgmd;
my $exe_ndb_waiter;
+my $exe_ndb_mgm;
our $debug_compiled_binaries;
@@ -317,6 +338,14 @@ my $opt_stop_keep_alive= $ENV{MTR_STOP_KEEP_ALIVE};
select(STDOUT);
$| = 1; # Automatically flush STDOUT
+# Used by --result-file for for formatting times
+
+sub isotime($) {
+ my ($sec,$min,$hr,$day,$mon,$yr)= gmtime($_[0]);
+ return sprintf "%d-%02d-%02dT%02d:%02d:%02dZ",
+ $yr+1900, $mon+1, $day, $hr, $min, $sec;
+}
+
main();
@@ -364,8 +393,13 @@ sub main {
print "vardir: $opt_vardir\n";
initialize_servers();
+ init_timers();
mtr_report("Checking supported features...");
+
+ # --debug[-common] implies we run debug server
+ $opt_debug_server= 1 if $opt_debug || $opt_debug_common;
+
if (using_extern())
{
# Connect to the running mysqld and find out what it supports
@@ -385,6 +419,7 @@ sub main {
mtr_report("Collecting tests...");
my $tests= collect_test_cases($opt_reorder, $opt_suites, \@opt_cases, \@opt_skip_test_list);
+ mark_time_used('collect');
if ( $opt_report_features ) {
# Put "report features" as the first test to run
@@ -436,6 +471,24 @@ sub main {
my $server_port = $server->sockport();
mtr_report("Using server port $server_port");
+ if ($opt_resfile) {
+ resfile_init("$opt_vardir/mtr-results.txt");
+ print_global_resfile();
+ }
+
+ # --------------------------------------------------------------------------
+ # Read definitions from include/plugin.defs
+ #
+ read_plugin_defs("include/plugin.defs");
+
+ # Also read from any plugin local plugin.defs
+ for (glob "$basedir/plugin/*/tests/mtr/plugin.defs") {
+ read_plugin_defs($_);
+ }
+
+ # Simplify reference to semisync plugins
+ $ENV{'SEMISYNC_PLUGIN_OPT'}= $ENV{'SEMISYNC_MASTER_PLUGIN_OPT'};
+
# Create child processes
my %children;
for my $child_num (1..$opt_parallel){
@@ -450,6 +503,7 @@ sub main {
$opt_tmpdir= "$opt_tmpdir/$child_num";
}
+ init_timers();
run_worker($server_port, $child_num);
exit(1);
}
@@ -460,7 +514,9 @@ sub main {
mtr_report();
mtr_print_thick_line();
- mtr_print_header();
+ mtr_print_header($opt_parallel > 1);
+
+ mark_time_used('init');
my ($prefix, $fail, $completed, $extra_warnings)=
run_test_server($server, $tests, $opt_parallel);
@@ -500,6 +556,29 @@ sub main {
mtr_report("Only ", int(@$completed), " of $num_tests completed.");
}
+ mark_time_used('init');
+
+ push @$completed, run_ctest() if $opt_ctest;
+
+ if ($opt_valgrind) {
+ # Create minimalistic "test" for the reporting
+ my $tinfo = My::Test->new
+ (
+ name => 'valgrind_report',
+ );
+ # Set dummy worker id to align report with normal tests
+ $tinfo->{worker} = 0 if $opt_parallel > 1;
+ if ($valgrind_reports) {
+ $tinfo->{result}= 'MTR_RES_FAILED';
+ $tinfo->{comment}= "Valgrind reported failures at shutdown, see above";
+ $tinfo->{failures}= 1;
+ } else {
+ $tinfo->{result}= 'MTR_RES_PASSED';
+ }
+ mtr_report_test($tinfo);
+ push @$completed, $tinfo;
+ }
+
mtr_print_line();
if ( $opt_gcov ) {
@@ -509,10 +588,22 @@ sub main {
mtr_report_stats($prefix, $fail, $completed, $extra_warnings);
+ if ($ctest_report) {
+ print "$ctest_report\n";
+ mtr_print_line();
+ }
+
+ print_total_times($opt_parallel) if $opt_report_times;
+
+ mtr_report_stats("Completed", $completed);
+
if ( @$completed != $num_tests)
{
mtr_error("Not all tests completed");
}
+
+ remove_vardir_subs() if $opt_clean_vardir;
+
exit(0);
}
@@ -527,8 +618,8 @@ sub run_test_server ($$$) {
my $extra_warnings= []; # Warnings found during server shutdowns
# Scheduler variables
- my $max_ndb= $childs / 2;
- $max_ndb = 4 if $max_ndb > 4;
+ my $max_ndb= $ENV{MTR_MAX_NDB} || $childs / 2;
+ $max_ndb = $childs if $max_ndb > $childs;
$max_ndb = 1 if $max_ndb < 1;
my $num_ndb_tests= 0;
@@ -550,7 +641,10 @@ sub run_test_server ($$$) {
my $suite_timeout= start_timer(suite_timeout());
}
}
+
+ mark_time_used('admin');
my @ready = $s->can_read(1); # Wake up once every second
+ mark_time_idle();
foreach my $sock (@ready) {
if ($sock == $server) {
# New client connected
@@ -620,6 +714,8 @@ sub run_test_server ($$$) {
mtr_report(" - deleting it, already saved",
"$opt_max_save_core");
unlink("$core_file");
+ } else {
+ mtr_compress_file($core_file) unless @opt_cases;
}
++$num_saved_cores;
}
@@ -628,6 +724,7 @@ sub run_test_server ($$$) {
$savedir);
}
}
+ resfile_print_test();
$num_saved_datadir++;
$num_failed_test++ unless ($result->{retries} ||
$result->{exp_fail});
@@ -636,7 +733,11 @@ sub run_test_server ($$$) {
if ( !$opt_force ) {
# Test has failed, force is off
push(@$completed, $result);
- return ("Failure", 1, $completed, $extra_warnings);
+ return ("Failure", 1, $completed, $extra_warnings)
+ unless $result->{'dont_kill_server'};
+ # Prevent kill of server, to get valgrind report
+ print $sock "BYE\n";
+ next;
}
elsif ($opt_max_test_fail > 0 and
$num_failed_test >= $opt_max_test_fail) {
@@ -647,19 +748,22 @@ sub run_test_server ($$$) {
}
}
+ resfile_print_test();
# Retry test run after test failure
my $retries= $result->{retries} || 2;
my $test_has_failed= $result->{failures} || 0;
if ($test_has_failed and $retries <= $opt_retry){
# Test should be run one more time unless it has failed
# too many times already
+ my $tname= $result->{name};
my $failures= $result->{failures};
if ($opt_retry > 1 and $failures >= $opt_retry_failure){
- mtr_report("\nTest has failed $failures times,",
+ mtr_report("\nTest $tname has failed $failures times,",
"no more retries!\n");
}
else {
- mtr_report("\nRetrying test, attempt($retries/$opt_retry)...\n");
+ mtr_report("\nRetrying test $tname, ".
+ "attempt($retries/$opt_retry)...\n");
delete($result->{result});
$result->{retries}= $retries+1;
$result->write_test($sock, 'TESTCASE');
@@ -707,7 +811,13 @@ sub run_test_server ($$$) {
# Test failure due to warnings, force is off
return ("Warnings in log", 1, $completed, $extra_warnings);
}
- } else {
+ elsif ($line =~ /^SPENT/) {
+ add_total_times($line);
+ }
+ elsif ($line eq 'VALGREP' && $opt_valgrind) {
+ $valgrind_reports= 1;
+ }
+ else {
mtr_error("Unknown response: '$line' from client");
}
@@ -739,22 +849,40 @@ sub run_test_server ($$$) {
next;
}
- # Prefer same configuration, or just use next if --noreorder
- if (!$opt_reorder or (defined $result and
- $result->{template_path} eq $t->{template_path}))
- {
- #mtr_report("Test uses same config => good match");
- # Test uses same config => good match
- $next= splice(@$tests, $i, 1);
- last;
- }
-
# Second best choice is the first that does not fulfill
# any of the above conditions
if (!defined $second_best){
#mtr_report("Setting second_best to $i");
$second_best= $i;
}
+
+ # Smart allocation of next test within this thread.
+
+ if ($opt_reorder and $opt_parallel > 1 and defined $result)
+ {
+ my $wid= $result->{worker};
+ # Reserved for other thread, try next
+ next if (defined $t->{reserved} and $t->{reserved} != $wid);
+ if (! defined $t->{reserved})
+ {
+ # Force-restart not relevant when comparing *next* test
+ $t->{criteria} =~ s/force-restart$/no-restart/;
+ my $criteria= $t->{criteria};
+ # Reserve similar tests for this worker, but not too many
+ my $maxres= (@$tests - $i) / $opt_parallel + 1;
+ for (my $j= $i+1; $j <= $i + $maxres; $j++)
+ {
+ my $tt= $tests->[$j];
+ last unless defined $tt;
+ last if $tt->{criteria} ne $criteria;
+ $tt->{reserved}= $wid;
+ }
+ }
+ }
+
+ # At this point we have found next suitable test
+ $next= splice(@$tests, $i, 1);
+ last;
}
# Use second best choice if no other test has been found
@@ -763,12 +891,14 @@ sub run_test_server ($$$) {
mtr_error("Internal error, second best too large($second_best)")
if $second_best > $#$tests;
$next= splice(@$tests, $second_best, 1);
+ delete $next->{reserved};
}
xterm_stat(scalar(@$tests));
if ($next) {
- #$next->print_test();
+ # We don't need this any more
+ delete $next->{criteria};
$next->write_test($sock, 'TESTCASE');
$running{$next->key()}= $next;
$num_ndb_tests++ if ($next->{ndb_test});
@@ -839,7 +969,9 @@ sub run_worker ($) {
# Ask server for first test
print $server "START\n";
- while(my $line= <$server>){
+ mark_time_used('init');
+
+ while (my $line= <$server>){
chomp($line);
if ($line eq 'TESTCASE'){
my $test= My::Test::read_test($server);
@@ -850,6 +982,11 @@ sub run_worker ($) {
delete($test->{'comment'});
delete($test->{'logfile'});
+ # A sanity check. Should this happen often we need to look at it.
+ if (defined $test->{reserved} && $test->{reserved} != $thread_num) {
+ my $tres= $test->{reserved};
+ mtr_warning("Test reserved for w$tres picked up by w$thread_num");
+ }
$test->{worker} = $thread_num if $opt_parallel > 1;
run_testcase($test, $server);
@@ -857,6 +994,7 @@ sub run_worker ($) {
# Send it back, now with results set
#$test->print_test();
$test->write_test($server, 'TESTRESULT');
+ mark_time_used('restart');
}
elsif ($line eq 'BYE'){
mtr_report("Server said BYE");
@@ -872,10 +1010,18 @@ sub run_worker ($) {
else {
stop_all_servers($opt_shutdown_timeout);
}
+ mark_time_used('restart');
+ my $valgrind_reports= 0;
+ if ($opt_valgrind_mysqld) {
+ $valgrind_reports= valgrind_exit_reports();
+ print $server "VALGREP\n" if $valgrind_reports;
+ }
if ( $opt_gprof ) {
gprof_collect (find_mysqld($basedir), keys %gprof_dirs);
}
- exit(0);
+ mark_time_used('admin');
+ print_times_used($server, $thread_num);
+ exit($valgrind_reports);
}
else {
mtr_error("Could not understand server, '$line'");
@@ -914,13 +1060,56 @@ sub set_vardir {
}
+sub print_global_resfile {
+ resfile_global("start_time", isotime $^T);
+ resfile_global("user_id", $<);
+ resfile_global("embedded-server", $opt_embedded_server ? 1 : 0);
+ resfile_global("ps-protocol", $opt_ps_protocol ? 1 : 0);
+ resfile_global("sp-protocol", $opt_sp_protocol ? 1 : 0);
+ resfile_global("view-protocol", $opt_view_protocol ? 1 : 0);
+ resfile_global("cursor-protocol", $opt_cursor_protocol ? 1 : 0);
+ resfile_global("ssl", $opt_ssl ? 1 : 0);
+ resfile_global("compress", $opt_compress ? 1 : 0);
+ resfile_global("parallel", $opt_parallel);
+ resfile_global("check-testcases", $opt_check_testcases ? 1 : 0);
+ resfile_global("mysqld", \@opt_extra_mysqld_opt);
+ resfile_global("debug", $opt_debug ? 1 : 0);
+ resfile_global("gcov", $opt_gcov ? 1 : 0);
+ resfile_global("gprof", $opt_gprof ? 1 : 0);
+ resfile_global("valgrind", $opt_valgrind ? 1 : 0);
+ resfile_global("callgrind", $opt_callgrind ? 1 : 0);
+ resfile_global("mem", $opt_mem ? 1 : 0);
+ resfile_global("tmpdir", $opt_tmpdir);
+ resfile_global("vardir", $opt_vardir);
+ resfile_global("fast", $opt_fast ? 1 : 0);
+ resfile_global("force-restart", $opt_force_restart ? 1 : 0);
+ resfile_global("reorder", $opt_reorder ? 1 : 0);
+ resfile_global("sleep", $opt_sleep);
+ resfile_global("repeat", $opt_repeat);
+ resfile_global("user", $opt_user);
+ resfile_global("testcase-timeout", $opt_testcase_timeout);
+ resfile_global("suite-timeout", $opt_suite_timeout);
+ resfile_global("shutdown-timeout", $opt_shutdown_timeout ? 1 : 0);
+ resfile_global("warnings", $opt_warnings ? 1 : 0);
+ resfile_global("max-connections", $opt_max_connections);
+# resfile_global("default-myisam", $opt_default_myisam ? 1 : 0);
+ resfile_global("product", "MySQL");
+ # Somewhat hacky code to convert numeric version back to dot notation
+ my $v1= int($mysql_version_id / 10000);
+ my $v2= int(($mysql_version_id % 10000)/100);
+ my $v3= $mysql_version_id % 100;
+ resfile_global("version", "$v1.$v2.$v3");
+}
+
+
+
sub command_line_setup {
my $opt_comment;
my $opt_usage;
my $opt_list_options;
# Read the command line options
- # Note: Keep list, and the order, in sync with usage at end of this file
+ # Note: Keep list in sync with usage at end of this file
Getopt::Long::Configure("pass_through");
my %options=(
# Control what engine/variation to run
@@ -956,6 +1145,7 @@ sub command_line_setup {
'combination=s' => \@opt_combinations,
'skip-combinations' => \&collect_option,
'experimental=s' => \@opt_experimentals,
+ # skip-im is deprecated and silently ignored
'skip-im' => \&ignore_option,
'staging-run' => \$opt_staging_run,
@@ -970,15 +1160,15 @@ sub command_line_setup {
# Extra options used when starting mysqld
'mysqld=s' => \@opt_extra_mysqld_opt,
-
- # Extra options used when starting mysqltest
- 'mysqltest=s' => \@opt_extra_mysqltest_opt,
+ 'mysqld-env=s' => \@opt_mysqld_envs,
# Run test on running server
'extern=s' => \%opts_extern, # Append to hash
# Debugging
'debug' => \$opt_debug,
+ 'debug-common' => \$opt_debug_common,
+ 'debug-server' => \$opt_debug_server,
'gdb' => \$opt_gdb,
'client-gdb' => \$opt_client_gdb,
'manual-gdb' => \$opt_manual_gdb,
@@ -986,6 +1176,9 @@ sub command_line_setup {
'ddd' => \$opt_ddd,
'client-ddd' => \$opt_client_ddd,
'manual-ddd' => \$opt_manual_ddd,
+ 'dbx' => \$opt_dbx,
+ 'client-dbx' => \$opt_client_dbx,
+ 'manual-dbx' => \$opt_manual_dbx,
'debugger=s' => \$opt_debugger,
'client-debugger=s' => \$opt_client_debugger,
'strace' => \$opt_strace,
@@ -1022,6 +1215,7 @@ sub command_line_setup {
'tmpdir=s' => \$opt_tmpdir,
'vardir=s' => \$opt_vardir,
'mem' => \$opt_mem,
+ 'clean-vardir' => \$opt_clean_vardir,
'client-bindir=s' => \$path_client_bindir,
'client-libdir=s' => \$path_client_libdir,
@@ -1056,9 +1250,13 @@ sub command_line_setup {
'stop-keep-alive=i' => \$opt_stop_keep_alive,
'max-connections=i' => \$opt_max_connections,
'default-myisam!' => \&collect_option,
+ 'report-times' => \$opt_report_times,
+ 'result-file' => \$opt_resfile,
+ 'unit-tests!' => \$opt_ctest,
'help|h' => \$opt_usage,
- 'list-options' => \$opt_list_options,
+ # list-options is internal, not listed in help
+ 'list-options' => \$opt_list_options,
'skip-test-list=s' => \@opt_skip_test_list
);
@@ -1169,7 +1367,7 @@ sub command_line_setup {
chomp;
# remove comments (# foo) at the beginning of the line, or after a
# blank at the end of the line
- s/( +|^)#.*$//;
+ s/(\s+|^)#.*$//;
# If @ platform specifier given, use this entry only if it contains
# @<platform> or @!<xxx> where xxx != platform
if (/\@.*/)
@@ -1180,8 +1378,8 @@ sub command_line_setup {
s/\@.*$//;
}
# remove whitespace
- s/^ +//;
- s/ +$//;
+ s/^\s+//;
+ s/\s+$//;
# if nothing left, don't need to remember this line
if ( $_ eq "" ) {
next;
@@ -1409,6 +1607,12 @@ sub command_line_setup {
$opt_ddd= undef;
}
+ if ($opt_dbx) {
+ mtr_warning("Silently converting --dbx to --client-dbx in embedded mode");
+ $opt_client_dbx= $opt_dbx;
+ $opt_dbx= undef;
+ }
+
if ($opt_debugger)
{
$opt_client_debugger= $opt_debugger;
@@ -1416,7 +1620,7 @@ sub command_line_setup {
}
if ( $opt_gdb || $opt_ddd || $opt_manual_gdb || $opt_manual_ddd ||
- $opt_manual_debug || $opt_debugger )
+ $opt_manual_debug || $opt_debugger || $opt_dbx || $opt_manual_dbx)
{
mtr_error("You need to use the client debug options for the",
"embedded server. Ex: --client-gdb");
@@ -1445,6 +1649,7 @@ sub command_line_setup {
# --------------------------------------------------------------------------
if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd ||
$opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug ||
+ $opt_dbx || $opt_client_dbx || $opt_manual_dbx ||
$opt_debugger || $opt_client_debugger )
{
# Indicate that we are using debugger
@@ -1494,6 +1699,14 @@ sub command_line_setup {
}
# --------------------------------------------------------------------------
+ # Don't run ctest if tests or suites named
+ # --------------------------------------------------------------------------
+
+ $opt_ctest= 0 if $opt_ctest == -1 && ($opt_suites || @opt_cases);
+ # Override: disable if running in the PB test environment
+ $opt_ctest= 0 if $opt_ctest == -1 && defined $ENV{PB2WORKDIR};
+
+ # --------------------------------------------------------------------------
# Check use of wait-all
# --------------------------------------------------------------------------
@@ -1580,6 +1793,12 @@ sub command_line_setup {
{
push(@opt_extra_mysqld_opt, "--loose-skip-innodb-use-sys-malloc");
}
+
+ if ($opt_debug_common)
+ {
+ $opt_debug= 1;
+ $debug_d= "d,query,info,error,enter,exit";
+ }
}
@@ -1692,12 +1911,13 @@ sub collect_mysqld_features {
# Look for version
my $exe_name= basename($exe_mysqld);
mtr_verbose("exe_name: $exe_name");
- if ( $line =~ /^\S*$exe_name\s\sVer\s([0-9]*)\.([0-9]*)\.([0-9]*)/ )
+ if ( $line =~ /^\S*$exe_name\s\sVer\s([0-9]*)\.([0-9]*)\.([0-9]*)([^\s]*)/ )
{
#print "Major: $1 Minor: $2 Build: $3\n";
$mysql_version_id= $1*10000 + $2*100 + $3;
#print "mysql_version_id: $mysql_version_id\n";
mtr_report("MariaDB Version $1.$2.$3");
+ $mysql_version_extra= $4;
}
}
else
@@ -1781,12 +2001,13 @@ sub collect_mysqld_features_from_running_server ()
# Parse version
my $version_str= $mysqld_variables{'version'};
- if ( $version_str =~ /^([0-9]*)\.([0-9]*)\.([0-9]*)/ )
+ if ( $version_str =~ /^([0-9]*)\.([0-9]*)\.([0-9]*)([^\s]*)/ )
{
#print "Major: $1 Minor: $2 Build: $3\n";
$mysql_version_id= $1*10000 + $2*100 + $3;
#print "mysql_version_id: $mysql_version_id\n";
mtr_report("MySQL Version $1.$2.$3");
+ $mysql_version_extra= $4;
}
mtr_error("Could not find version of MySQL") unless $mysql_version_id;
}
@@ -1798,7 +2019,7 @@ sub find_mysqld {
my @mysqld_names= ("mysqld", "mysqld-max-nt", "mysqld-max",
"mysqld-nt");
- if ( $opt_debug ){
+ if ( $opt_debug_server ){
# Put mysqld-debug first in the list of binaries to look for
mtr_verbose("Adding mysqld-debug first in list of binaries to look for");
unshift(@mysqld_names, "mysqld-debug");
@@ -1833,18 +2054,44 @@ sub executable_setup () {
if ( ! $opt_skip_ndbcluster )
{
+ # Look for single threaded NDB
$exe_ndbd=
- my_find_bin($basedir,
+ my_find_bin($bindir,
["storage/ndb/src/kernel", "libexec", "sbin", "bin"],
"ndbd");
+ # Look for multi threaded NDB
+ $exe_ndbmtd=
+ my_find_bin($bindir,
+ ["storage/ndb/src/kernel", "libexec", "sbin", "bin"],
+ "ndbmtd", NOT_REQUIRED);
+ if ($exe_ndbmtd)
+ {
+ my $mtr_ndbmtd = $ENV{MTR_NDBMTD};
+ if ($mtr_ndbmtd)
+ {
+ mtr_report(" - multi threaded ndbd found, will be used always");
+ $exe_ndbd = $exe_ndbmtd;
+ }
+ else
+ {
+ mtr_report(" - multi threaded ndbd found, will be ".
+ "used \"round robin\"");
+ }
+ }
+
$exe_ndb_mgmd=
- my_find_bin($basedir,
+ my_find_bin($bindir,
["storage/ndb/src/mgmsrv", "libexec", "sbin", "bin"],
"ndb_mgmd");
+ $exe_ndb_mgm=
+ my_find_bin($bindir,
+ ["storage/ndb/src/mgmclient", "bin"],
+ "ndb_mgm");
+
$exe_ndb_waiter=
- my_find_bin($basedir,
+ my_find_bin($bindir,
["storage/ndb/tools/", "bin"],
"ndb_waiter");
@@ -1868,9 +2115,12 @@ sub executable_setup () {
sub client_debug_arg($$) {
my ($args, $client_name)= @_;
+ # Workaround for Bug #50627: drop any debug opt
+ return if $client_name =~ /^mysqlbinlog/;
+
if ( $opt_debug ) {
mtr_add_arg($args,
- "--debug=d:t:A,%s/log/%s.trace",
+ "--loose-debug=$debug_d:t:A,%s/log/%s.trace",
$path_vardir_trace, $client_name)
}
}
@@ -2006,7 +2256,7 @@ sub find_plugin($$)
{
my ($plugin, $location) = @_;
my $plugin_filename;
-
+
if (IS_WINDOWS)
{
$plugin_filename = $plugin.".dll";
@@ -2016,13 +2266,69 @@ sub find_plugin($$)
$plugin_filename = $plugin.".so";
}
- my $lib_example_plugin=
+ my $lib_plugin=
mtr_file_exists(vs_config_dirs($location,$plugin_filename),
"$basedir/lib/plugin/".$plugin_filename,
"$basedir/$location/.libs/".$plugin_filename,
"$basedir/lib/mysql/plugin/".$plugin_filename,
);
- return $lib_example_plugin;
+ return $lib_plugin;
+}
+
+#
+# Read plugin defintions file
+#
+
+sub read_plugin_defs($)
+{
+ my ($defs_file)= @_;
+ my $running_debug= 0;
+
+ open(PLUGDEF, '<', $defs_file)
+ or mtr_error("Can't read plugin defintions file $defs_file");
+
+ # Need to check if we will be running mysqld-debug
+ if ($opt_debug_server) {
+ $running_debug= 1 if find_mysqld($basedir) =~ /mysqld-debug/;
+ }
+
+ while (<PLUGDEF>) {
+ next if /^#/;
+ my ($plug_file, $plug_loc, $plug_var, $plug_names)= split;
+ # Allow empty lines
+ next unless $plug_file;
+ mtr_error("Lines in $defs_file must have 3 or 4 items") unless $plug_var;
+
+ # If running debug server, plugins will be in 'debug' subdirectory
+ $plug_file= "debug/$plug_file" if $running_debug;
+
+ my ($plugin)= find_plugin($plug_file, $plug_loc);
+
+ # Set env. variables that tests may use, set to empty if plugin
+ # listed in def. file but not found.
+
+ if ($plugin) {
+ $ENV{$plug_var}= basename($plugin);
+ $ENV{$plug_var.'_DIR'}= dirname($plugin);
+ $ENV{$plug_var.'_OPT'}= "--plugin-dir=".dirname($plugin);
+ if ($plug_names) {
+ my $lib_name= basename($plugin);
+ my $load_var= "--plugin_load=";
+ my $semi= '';
+ foreach my $plug_name (split (',', $plug_names)) {
+ $load_var .= $semi . "$plug_name=$lib_name";
+ $semi= ';';
+ }
+ $ENV{$plug_var.'_LOAD'}= $load_var;
+ }
+ } else {
+ $ENV{$plug_var}= "";
+ $ENV{$plug_var.'_DIR'}= "";
+ $ENV{$plug_var.'_OPT'}= "";
+ $ENV{$plug_var.'_LOAD'}= "" if $plug_names;
+ }
+ }
+ close PLUGDEF;
}
sub environment_setup {
@@ -2123,9 +2429,25 @@ sub environment_setup {
$ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'port'};
$ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir;
$ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
+ # Used for guessing default plugin dir, we can't really know for sure
$ENV{'MYSQL_LIBDIR'}= "$basedir/lib";
+ # Override if this does not exist, but lib64 does (best effort)
+ if (! -d "$basedir/lib" && -d "$basedir/lib64") {
+ $ENV{'MYSQL_LIBDIR'}= "$basedir/lib64";
+ }
+ $ENV{'MYSQL_BINDIR'}= "$bindir";
$ENV{'MYSQL_SHAREDIR'}= $path_language;
$ENV{'MYSQL_CHARSETSDIR'}= $path_charsetsdir;
+
+ if (IS_WINDOWS)
+ {
+ $ENV{'SECURE_LOAD_PATH'}= $glob_mysql_test_dir."\\std_data";
+ }
+ else
+ {
+ $ENV{'SECURE_LOAD_PATH'}= $glob_mysql_test_dir."/std_data";
+ }
+
#
# Some stupid^H^H^H^H^H^Hignorant network providers set up "wildcard DNS"
@@ -2142,12 +2464,12 @@ sub environment_setup {
if ( ! $opt_skip_ndbcluster )
{
$ENV{'NDB_MGM'}=
- my_find_bin($basedir,
+ my_find_bin($bindir,
["storage/ndb/src/mgmclient", "bin"],
"ndb_mgm");
$ENV{'NDB_TOOLS_DIR'}=
- my_find_dir($basedir,
+ my_find_dir($bindir,
["storage/ndb/tools", "bin"]);
$ENV{'NDB_EXAMPLES_DIR'}=
@@ -2155,7 +2477,7 @@ sub environment_setup {
["storage/ndb/ndbapi-examples", "bin"]);
$ENV{'NDB_EXAMPLES_BINARY'}=
- my_find_bin($basedir,
+ my_find_bin($bindir,
["storage/ndb/ndbapi-examples/ndbapi_simple", "bin"],
"ndbapi_simple", NOT_REQUIRED);
@@ -2254,6 +2576,12 @@ sub environment_setup {
}
+sub remove_vardir_subs() {
+ foreach my $sdir ( glob("$opt_vardir/*") ) {
+ mtr_verbose("Removing subdir $sdir");
+ rmtree($sdir);
+ }
+}
#
# Remove var and any directories in var/ created by previous
@@ -2298,11 +2626,7 @@ sub remove_stale_vardir () {
mtr_error("The destination for symlink $opt_vardir does not exist")
if ! -d readlink($opt_vardir);
- foreach my $bin ( glob("$opt_vardir/*") )
- {
- mtr_verbose("Removing bin $bin");
- rmtree($bin);
- }
+ remove_vardir_subs();
}
}
else
@@ -2533,9 +2857,9 @@ sub check_debug_support ($) {
#mtr_report(" - binaries are not debug compiled");
$debug_compiled_binaries= 0;
- if ( $opt_debug )
+ if ( $opt_debug_server )
{
- mtr_error("Can't use --debug, binaries does not support it");
+ mtr_error("Can't use --debug[-server], binary does not support it");
}
return;
}
@@ -2581,6 +2905,17 @@ sub fix_vs_config_dir () {
sub check_ndbcluster_support ($) {
my $mysqld_variables= shift;
+ # Check if this is MySQL Cluster, ie. mysql version string ends
+ # with -ndb-Y.Y.Y[-status]
+ if ( defined $mysql_version_extra &&
+ $mysql_version_extra =~ /^-ndb-/ )
+ {
+ mtr_report(" - MySQL Cluster");
+ # Enable ndb engine and add more test suites
+ $opt_include_ndbcluster = 1;
+ $DEFAULT_SUITES.=",ndb";
+ }
+
if ($opt_include_ndbcluster)
{
$opt_skip_ndbcluster= 0;
@@ -2693,6 +3028,27 @@ sub ndb_mgmd_wait_started($) {
return 1;
}
+sub ndb_mgmd_stop{
+ my $ndb_mgmd= shift or die "usage: ndb_mgmd_stop(<ndb_mgmd>)";
+
+ my $host=$ndb_mgmd->value('HostName');
+ my $port=$ndb_mgmd->value('PortNumber');
+ mtr_verbose("Stopping cluster '$host:$port'");
+
+ my $args;
+ mtr_init_args(\$args);
+ mtr_add_arg($args, "--ndb-connectstring=%s:%s", $host,$port);
+ mtr_add_arg($args, "-e");
+ mtr_add_arg($args, "shutdown");
+
+ My::SafeProcess->run
+ (
+ name => "ndb_mgm shutdown $host:$port",
+ path => $exe_ndb_mgm,
+ args => \$args,
+ output => "/dev/null",
+ );
+}
sub ndb_mgmd_start ($$) {
my ($cluster, $ndb_mgmd)= @_;
@@ -2720,6 +3076,7 @@ sub ndb_mgmd_start ($$) {
error => $path_ndb_mgmd_log,
append => 1,
verbose => $opt_verbose,
+ shutdown => sub { ndb_mgmd_stop($ndb_mgmd) },
);
mtr_verbose("Started $ndb_mgmd->{proc}");
@@ -2735,6 +3092,12 @@ sub ndb_mgmd_start ($$) {
return 0;
}
+sub ndbd_stop {
+ # Intentionally left empty, ndbd nodes will be shutdown
+ # by sending "shutdown" to ndb_mgmd
+}
+
+my $exe_ndbmtd_counter= 0;
sub ndbd_start {
my ($cluster, $ndbd)= @_;
@@ -2752,17 +3115,24 @@ sub ndbd_start {
# > 5.0 { 'character-sets-dir' => \&fix_charset_dir },
+ my $exe= $exe_ndbd;
+ if ($exe_ndbmtd and ($exe_ndbmtd_counter++ % 2) == 0)
+ {
+ # Use ndbmtd every other time
+ $exe= $exe_ndbmtd;
+ }
my $path_ndbd_log= "$dir/ndbd.log";
my $proc= My::SafeProcess->new
(
name => $ndbd->after('cluster_config.'),
- path => $exe_ndbd,
+ path => $exe,
args => \$args,
output => $path_ndbd_log,
error => $path_ndbd_log,
append => 1,
verbose => $opt_verbose,
+ shutdown => sub { ndbd_stop($ndbd) },
);
mtr_verbose("Started $proc");
@@ -3131,13 +3501,19 @@ sub mysql_install_db {
if ( $opt_debug )
{
- mtr_add_arg($args, "--debug=d:t:i:A,%s/log/bootstrap.trace",
+ mtr_add_arg($args, "--debug=$debug_d:t:i:A,%s/log/bootstrap.trace",
$path_vardir_trace);
}
mtr_add_arg($args, "--lc-messages-dir=%s", $install_lang);
mtr_add_arg($args, "--character-sets-dir=%s", $install_chsdir);
+ # On some old linux kernels, aio on tmpfs is not supported
+ # Remove this if/when Bug #58421 fixes this in the server
+ if ($^O eq "linux" && $opt_mem) {
+ mtr_add_arg($args, "--loose-skip-innodb-use-native-aio");
+ }
+
# InnoDB arguments that affect file location and sizes may
# need to be given to the bootstrap process as well as the
# server process.
@@ -3384,7 +3760,7 @@ sub check_testcase($$)
# Return immediately if no check proceess was started
return 0 unless ( keys %started );
- my $timeout= start_timer(check_timeout());
+ my $timeout= start_timer(check_timeout($tinfo));
while (1){
my $result;
@@ -3412,6 +3788,7 @@ sub check_testcase($$)
if ( keys(%started) == 0){
# All checks completed
+ mark_time_used('check');
return 0;
}
# Wait for next process to exit
@@ -3427,7 +3804,8 @@ sub check_testcase($$)
"\nMTR's internal check of the test case '$tname' failed.
This means that the test case does not preserve the state that existed
before the test case was executed. Most likely the test case did not
-do a proper clean-up.
+do a proper clean-up. It could also be caused by the previous test run
+by this thread, if the server wasn't restarted.
This is the diff of the states of the servers before and after the
test case was executed:\n";
$tinfo->{check}.= $report;
@@ -3458,7 +3836,7 @@ test case was executed:\n";
}
elsif ( $proc->{timeout} ) {
$tinfo->{comment}.= "Timeout for 'check-testcase' expired after "
- .check_timeout()." seconds";
+ .check_timeout($tinfo)." seconds";
$result= 4;
}
else {
@@ -3473,6 +3851,11 @@ test case was executed:\n";
# Kill any check processes still running
map($_->kill(), values(%started));
+ mtr_warning("Check-testcase failed, this could also be caused by the" .
+ " previous test run by this worker thread")
+ if $result > 1 && $mode eq "before";
+ mark_time_used('check');
+
return $result;
}
@@ -3543,7 +3926,7 @@ sub run_on_all($$)
# Return immediately if no check proceess was started
return 0 unless ( keys %started );
- my $timeout= start_timer(check_timeout());
+ my $timeout= start_timer(check_timeout($tinfo));
while (1){
my $result;
@@ -3574,7 +3957,7 @@ sub run_on_all($$)
}
elsif ($proc->{timeout}) {
$tinfo->{comment}.= "Timeout for '$run' expired after "
- .check_timeout()." seconds";
+ .check_timeout($tinfo)." seconds";
}
else {
# Unknown process returned, most likley a crash, abort everything
@@ -3652,13 +4035,14 @@ sub find_analyze_request
# The test can leave a file in var/tmp/ to signal
# that all servers should be restarted
-sub restart_forced_by_test
+sub restart_forced_by_test($)
{
+ my $file = shift;
my $restart = 0;
foreach my $mysqld ( mysqlds() )
{
my $datadir = $mysqld->value('datadir');
- my $force_restart_file = "$datadir/mtr/force_restart";
+ my $force_restart_file = "$datadir/mtr/$file";
if ( -f $force_restart_file )
{
mtr_verbose("Restart of servers forced by test");
@@ -3754,6 +4138,18 @@ sub all_servers {
# Storage for changed environment variables
my %old_env;
+sub resfile_report_test ($) {
+ my $tinfo= shift;
+
+ resfile_new_test();
+
+ resfile_test_info("name", $tinfo->{name});
+ resfile_test_info("variation", $tinfo->{combination})
+ if $tinfo->{combination};
+ resfile_test_info("start_time", isotime time);
+}
+
+
#
# Run a single test case
#
@@ -3766,6 +4162,7 @@ sub run_testcase ($$) {
my ($tinfo, $server_socket)= @_;
mtr_verbose("Running test:", $tinfo->{name});
+ resfile_report_test($tinfo) if $opt_resfile;
# Allow only alpanumerics pluss _ - + . in combination names,
# or anything beginning with -- (the latter comes from --combination)
@@ -3878,6 +4275,7 @@ sub run_testcase ($$) {
return 1;
}
}
+ mark_time_used('restart');
# --------------------------------------------------------------------
# If --start or --start-dirty given, stop here to let user manually
@@ -3930,6 +4328,8 @@ sub run_testcase ($$) {
do_before_run_mysqltest($tinfo);
+ mark_time_used('admin');
+
if ( $opt_check_testcases and check_testcase($tinfo, "before") ){
# Failed to record state of server or server crashed
report_failure_and_restart($tinfo);
@@ -3976,6 +4376,7 @@ sub run_testcase ($$) {
}
mtr_verbose("Got $proc");
+ mark_time_used('test');
# ----------------------------------------------------
# Was it the test program that exited
# ----------------------------------------------------
@@ -3988,12 +4389,13 @@ sub run_testcase ($$) {
# Test case suceeded, but it has produced unexpected
# warnings, continue in $res == 1
$res= 1;
+ resfile_output($tinfo->{'warnings'}) if $opt_resfile;
}
if ( $res == 0 )
{
my $check_res;
- if ( restart_forced_by_test() )
+ if ( restart_forced_by_test('force_restart') )
{
stop_all_servers($opt_shutdown_timeout);
}
@@ -4015,6 +4417,7 @@ sub run_testcase ($$) {
stop_all_servers($opt_shutdown_timeout);
}
mtr_report("Resuming tests...\n");
+ resfile_output($tinfo->{'check'}) if $opt_resfile;
}
else {
# Test case check failed fatally, probably a server crashed
@@ -4032,8 +4435,11 @@ sub run_testcase ($$) {
find_testcase_skipped_reason($tinfo);
mtr_report_test_skipped($tinfo);
# Restart if skipped due to missing perl, it may have had side effects
- stop_all_servers($opt_shutdown_timeout)
- if ($tinfo->{'comment'} =~ /^perl not found/);
+ if ( restart_forced_by_test('force_restart_if_skipped') ||
+ $tinfo->{'comment'} =~ /^perl not found/ )
+ {
+ stop_all_servers($opt_shutdown_timeout);
+ }
}
elsif ( $res == 65 )
{
@@ -4073,6 +4479,9 @@ sub run_testcase ($$) {
# Save info from this testcase run to mysqltest.log
if( -f $path_current_testlog)
{
+ if ($opt_resfile && $res && $res != 62) {
+ resfile_output_file($path_current_testlog);
+ }
mtr_appendfile_to_file($path_current_testlog, $path_testlog);
unlink($path_current_testlog);
}
@@ -4084,7 +4493,6 @@ sub run_testcase ($$) {
# ----------------------------------------------------
# Check if it was an expected crash
# ----------------------------------------------------
- SRVDIED:
my $check_crash = check_expected_crash_and_restart($proc);
if ($check_crash)
{
@@ -4094,6 +4502,7 @@ sub run_testcase ($$) {
next;
}
+ SRVDIED:
# ----------------------------------------------------
# Stop the test case timer
# ----------------------------------------------------
@@ -4274,7 +4683,9 @@ sub get_log_from_proc ($$) {
foreach my $mysqld (all_servers()) {
if ($mysqld->{proc} eq $proc) {
my @srv_lines= extract_server_log($mysqld->if_exist('#log-error'), $name);
- $srv_log= "\nServer log from this test:\n" . join ("", @srv_lines);
+ $srv_log= "\nServer log from this test:\n" .
+ "----------SERVER LOG START-----------\n". join ("", @srv_lines) .
+ "----------SERVER LOG END-------------\n";
last;
}
}
@@ -4503,7 +4914,7 @@ sub check_warnings ($) {
# Return immediately if no check proceess was started
return 0 unless ( keys %started );
- my $timeout= start_timer(check_timeout());
+ my $timeout= start_timer(check_timeout($tinfo));
while (1){
my $result= 0;
@@ -4536,6 +4947,7 @@ sub check_warnings ($) {
if ( keys(%started) == 0){
# All checks completed
+ mark_time_used('ch-warn');
return $result;
}
# Wait for next process to exit
@@ -4555,7 +4967,7 @@ sub check_warnings ($) {
}
elsif ( $proc->{timeout} ) {
$tinfo->{comment}.= "Timeout for 'check warnings' expired after "
- .check_timeout()." seconds";
+ .check_timeout($tinfo)." seconds";
$result= 4;
}
else {
@@ -4569,6 +4981,7 @@ sub check_warnings ($) {
# Kill any check processes still running
map($_->kill(), values(%started));
+ mark_time_used('ch-warn');
return $result;
}
@@ -4617,8 +5030,10 @@ sub check_expected_crash_and_restart {
{
mtr_verbose("Crash was expected, file '$expect_file' exists");
- for (my $waits = 0; $waits < 50; $waits++)
+ for (my $waits = 0; $waits < 50; mtr_milli_sleep(100), $waits++)
{
+ # Race condition seen on Windows: try again until file not empty
+ next if -z $expect_file;
# If last line in expect file starts with "wait"
# sleep a little and try again, thus allowing the
# test script to control when the server should start
@@ -4627,10 +5042,11 @@ sub check_expected_crash_and_restart {
if ($last_line =~ /^wait/ )
{
mtr_verbose("Test says wait before restart") if $waits == 0;
- mtr_milli_sleep(100);
next;
}
+ # Ignore any partial or unknown command
+ next unless $last_line =~ /^restart/;
# If last line begins "restart:", the rest of the line is read as
# extra command line options to add to the restarted mysqld.
# Anything other than 'wait' or 'restart:' (with a colon) will
@@ -4755,7 +5171,12 @@ sub after_failure ($) {
sub report_failure_and_restart ($) {
my $tinfo= shift;
- stop_all_servers();
+ if ($opt_valgrind_mysqld && ($tinfo->{'warnings'} || $tinfo->{'timeout'})) {
+ # In these cases we may want valgrind report from normal termination
+ $tinfo->{'dont_kill_server'}= 1;
+ }
+ # Shotdown properly if not to be killed (for valgrind)
+ stop_all_servers($tinfo->{'dont_kill_server'} ? $opt_shutdown_timeout : 0);
$tinfo->{'result'}= 'MTR_RES_FAILED';
@@ -4857,7 +5278,13 @@ sub mysqld_arguments ($$$) {
my $mysqld= shift;
my $extra_opts= shift;
- mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ my @defaults = grep(/^--defaults-file=/, @$extra_opts);
+ if (@defaults > 0) {
+ mtr_add_arg($args, pop(@defaults))
+ }
+ else {
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+ }
# When mysqld is run by a root user(euid is 0), it will fail
# to start unless we specify what user to run as, see BUG#30630
@@ -4877,6 +5304,13 @@ sub mysqld_arguments ($$$) {
mtr_add_arg($args, "%s--disable-sync-frm");
+ # On some old linux kernels, aio on tmpfs is not supported
+ # Remove this if/when Bug #58421 fixes this in the server
+ if ($^O eq "linux" && $opt_mem)
+ {
+ mtr_add_arg($args, "--loose-skip-innodb-use-native-aio");
+ }
+
if (!using_extern() and $mysql_version_id >= 50106 && !$opt_user_args)
{
# Turn on logging to file
@@ -4895,6 +5329,9 @@ sub mysqld_arguments ($$$) {
my $found_skip_core= 0;
foreach my $arg ( @$extra_opts )
{
+ # Skip --defaults-file option since it's handled above.
+ next if $arg =~ /^--defaults-file/;
+
# Allow --skip-core-file to be set in <testname>-[master|slave].opt file
if ($arg eq "--skip-core-file")
{
@@ -4965,12 +5402,14 @@ sub mysqld_start ($$) {
my @all_opts= @$extra_opts;
if (exists $mysqld->{'restart_opts'}) {
push (@all_opts, @{$mysqld->{'restart_opts'}});
+ mtr_verbose(My::Options::toStr("mysqld_start restart",
+ @{$mysqld->{'restart_opts'}}));
}
mysqld_arguments($args,$mysqld,\@all_opts);
if ( $opt_debug )
{
- mtr_add_arg($args, "--debug=d:t:i:A,%s/log/%s.trace",
+ mtr_add_arg($args, "--debug=$debug_d:t:i:A,%s/log/%s.trace",
$path_vardir_trace, $mysqld->name());
}
@@ -4990,6 +5429,9 @@ sub mysqld_start ($$) {
{
ddd_arguments(\$args, \$exe, $mysqld->name());
}
+ if ( $opt_dbx || $opt_manual_dbx ) {
+ dbx_arguments(\$args, \$exe, $mysqld->name());
+ }
elsif ( $opt_debugger )
{
debugger_arguments(\$args, \$exe, $mysqld->name());
@@ -5015,6 +5457,7 @@ sub mysqld_start ($$) {
unlink($mysqld->value('pid-file'));
my $output= $mysqld->value('#log-error');
+
if ( $opt_valgrind and $opt_debug )
{
# When both --valgrind and --debug is selected, send
@@ -5052,6 +5495,7 @@ sub mysqld_start ($$) {
nocore => $opt_skip_core,
host => undef,
shutdown => sub { mysqld_stop($mysqld) },
+ envs => \@opt_mysqld_envs,
);
mtr_verbose("Started $mysqld->{proc}");
}
@@ -5145,17 +5589,6 @@ sub server_need_restart {
}
}
- # Temporary re-enable the "always restart slave" hack
- # this should be removed asap, but will require that each rpl
- # testcase cleanup better after itself - ie. stop and reset
- # replication
- # Use the "#!use-slave-opt" marker to detect that this is a "slave"
- # server
- if ( $server->option("#!use-slave-opt") ){
- mtr_verbose_restart($server, "Always restart slave(s)");
- return 1;
- }
-
if ($server->name() =~ /^mysqld\./)
{
@@ -5363,6 +5796,8 @@ sub start_mysqltest ($) {
my $exe= $exe_mysqltest;
my $args;
+ mark_time_used('admin');
+
mtr_init_args(\$args);
mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
@@ -5423,10 +5858,6 @@ sub start_mysqltest ($) {
mtr_add_arg($args, "--ssl");
}
- foreach my $arg ( @opt_extra_mysqltest_opt )
- {
- mtr_add_arg($args, "%s", $arg);
- }
if ( $opt_max_connections ) {
mtr_add_arg($args, "--max-connections=%d", $opt_max_connections);
}
@@ -5456,11 +5887,6 @@ sub start_mysqltest ($) {
}
}
- foreach my $arg ( @opt_extra_mysqltest_opt )
- {
- mtr_add_arg($args, "%s", $arg);
- }
-
# ----------------------------------------------------------------------
# export MYSQL_TEST variable containing <path>/mysqltest <args>
# ----------------------------------------------------------------------
@@ -5510,6 +5936,9 @@ sub start_mysqltest ($) {
{
ddd_arguments(\$args, \$exe, "client");
}
+ if ( $opt_client_dbx ) {
+ dbx_arguments(\$args, \$exe, "client");
+ }
elsif ( $opt_client_debugger )
{
debugger_arguments(\$args, \$exe, "client");
@@ -5544,16 +5973,8 @@ sub gdb_arguments {
# Remove the old gdbinit file
unlink($gdb_init_file);
- if ( $type eq "client" )
- {
- # write init file for client
- mtr_tofile($gdb_init_file, "set args $str\n");
- }
- else
- {
- # write init file for mysqld
- mtr_tofile($gdb_init_file, "set args $str\n");
- }
+ # write init file for mysqld or client
+ mtr_tofile($gdb_init_file, "set args $str\n");
if ( $opt_manual_gdb )
{
@@ -5600,16 +6021,8 @@ sub ddd_arguments {
# Remove the old gdbinit file
unlink($gdb_init_file);
- if ( $type eq "client" )
- {
- # write init file for client
- mtr_tofile($gdb_init_file, "set args $str\n");
- }
- else
- {
- # write init file for mysqld
- mtr_tofile($gdb_init_file, "file $$exe\nset args $str\n");
- }
+ # write init file for mysqld or client
+ mtr_tofile($gdb_init_file, "file $$exe\nset args $str\n");
if ( $opt_manual_ddd )
{
@@ -5639,6 +6052,46 @@ sub ddd_arguments {
#
+# Modify the exe and args so that program is run in dbx in xterm
+#
+sub dbx_arguments {
+ my $args= shift;
+ my $exe= shift;
+ my $type= shift;
+
+ # Put $args into a single string
+ my $str= join " ", @$$args;
+
+ if ( $opt_manual_dbx ) {
+ print "\nTo start dbx for $type, type in another window:\n";
+ print "cd $glob_mysql_test_dir; dbx -c \"stop in main; " .
+ "run $str\" $$exe\n";
+
+ # Indicate the exe should not be started
+ $$exe= undef;
+ return;
+ }
+
+ $$args= [];
+ mtr_add_arg($$args, "-title");
+ mtr_add_arg($$args, "$type");
+ mtr_add_arg($$args, "-e");
+
+ if ( $exe_libtool ) {
+ mtr_add_arg($$args, $exe_libtool);
+ mtr_add_arg($$args, "--mode=execute");
+ }
+
+ mtr_add_arg($$args, "dbx");
+ mtr_add_arg($$args, "-c");
+ mtr_add_arg($$args, "stop in main; run $str");
+ mtr_add_arg($$args, "$$exe");
+
+ $$exe= "xterm";
+}
+
+
+#
# Modify the exe and args so that program is run in the selected debugger
#
sub debugger_arguments {
@@ -5669,18 +6122,6 @@ sub debugger_arguments {
$$exe= $debugger;
}
- elsif ( $debugger eq "dbx" )
- {
- # xterm -e dbx -r exe arg1 .. argn
-
- unshift(@$$args, $$exe);
- unshift(@$$args, "-r");
- unshift(@$$args, $debugger);
- unshift(@$$args, "-e");
-
- $$exe= "xterm";
-
- }
else
{
mtr_error("Unknown argument \"$debugger\" passed to --debugger");
@@ -5752,6 +6193,141 @@ sub strace_arguments {
}
}
+sub valgrind_exit_reports() {
+ my $found_err= 0;
+
+ foreach my $log_file (keys %mysqld_logs)
+ {
+ my @culprits= ();
+ my $valgrind_rep= "";
+ my $found_report= 0;
+ my $err_in_report= 0;
+
+ my $LOGF = IO::File->new($log_file)
+ or mtr_error("Could not open file '$log_file' for reading: $!");
+
+ while ( my $line = <$LOGF> )
+ {
+ if ($line =~ /^CURRENT_TEST: (.+)$/)
+ {
+ my $testname= $1;
+ # If we have a report, report it if needed and start new list of tests
+ if ($found_report)
+ {
+ if ($err_in_report)
+ {
+ mtr_print ("Valgrind report from $log_file after tests:\n",
+ @culprits);
+ mtr_print_line();
+ print ("$valgrind_rep\n");
+ $found_err= 1;
+ $err_in_report= 0;
+ }
+ # Make ready to collect new report
+ @culprits= ();
+ $found_report= 0;
+ $valgrind_rep= "";
+ }
+ push (@culprits, $testname);
+ next;
+ }
+ # This line marks the start of a valgrind report
+ $found_report= 1 if $line =~ /^==\d+== .* SUMMARY:/;
+
+ if ($found_report) {
+ $line=~ s/^==\d+== //;
+ $valgrind_rep .= $line;
+ $err_in_report= 1 if $line =~ /ERROR SUMMARY: [1-9]/;
+ $err_in_report= 1 if $line =~ /definitely lost: [1-9]/;
+ $err_in_report= 1 if $line =~ /possibly lost: [1-9]/;
+ }
+ }
+
+ $LOGF= undef;
+
+ if ($err_in_report) {
+ mtr_print ("Valgrind report from $log_file after tests:\n", @culprits);
+ mtr_print_line();
+ print ("$valgrind_rep\n");
+ $found_err= 1;
+ }
+ }
+
+ return $found_err;
+}
+
+sub run_ctest() {
+ my $olddir= getcwd();
+ chdir ($bindir) or die ("Could not chdir to $bindir");
+ my $tinfo;
+ my $no_ctest= (IS_WINDOWS) ? 256 : -1;
+ my $ctest_vs= "";
+
+ # Just ignore if not configured/built to run ctest
+ if (! -f "CTestTestfile.cmake") {
+ chdir($olddir);
+ return;
+ }
+
+ # Add vs-config option if needed
+ $ctest_vs= "-C $opt_vs_config" if $opt_vs_config;
+
+ # Also silently ignore if we don't have ctest and didn't insist
+ # Special override: also ignore in Pushbuild, some platforms may not have it
+ # Now, run ctest and collect output
+ my $ctest_out= `ctest $ctest_vs 2>&1`;
+ if ($? == $no_ctest && $opt_ctest == -1 && ! defined $ENV{PB2WORKDIR}) {
+ chdir($olddir);
+ return;
+ }
+
+ # Create minimalistic "test" for the reporting
+ $tinfo = My::Test->new
+ (
+ name => 'unit_tests',
+ );
+ # Set dummy worker id to align report with normal tests
+ $tinfo->{worker} = 0 if $opt_parallel > 1;
+
+ my $ctfail= 0; # Did ctest fail?
+ if ($?) {
+ $ctfail= 1;
+ $tinfo->{result}= 'MTR_RES_FAILED';
+ $tinfo->{comment}= "ctest failed with exit code $?, see result below";
+ $ctest_out= "" unless $ctest_out;
+ }
+ my $ctfile= "$opt_vardir/ctest.log";
+ my $ctres= 0; # Did ctest produce report summary?
+
+ open (CTEST, " > $ctfile") or die ("Could not open output file $ctfile");
+
+ # Put ctest output in log file, while analyzing results
+ for (split ('\n', $ctest_out)) {
+ print CTEST "$_\n";
+ if (/tests passed/) {
+ $ctres= 1;
+ $ctest_report .= "\nUnit tests: $_\n";
+ }
+ if ( /FAILED/ or /\(Failed\)/ ) {
+ $ctfail= 1;
+ $ctest_report .= " $_\n";
+ }
+ }
+ close CTEST;
+
+ # Set needed 'attributes' for test reporting
+ $tinfo->{comment}.= "\nctest did not pruduce report summary" if ! $ctres;
+ $tinfo->{result}= ($ctres && !$ctfail)
+ ? 'MTR_RES_PASSED' : 'MTR_RES_FAILED';
+ $ctest_report .= "Report from unit tests in $ctfile";
+ $tinfo->{failures}= ($tinfo->{result} eq 'MTR_RES_FAILED');
+
+ mark_time_used('test');
+ mtr_report_test($tinfo);
+ chdir($olddir);
+ return $tinfo;
+}
+
#
# Usage
@@ -5786,7 +6362,7 @@ Options to control what engine/variation to run
parallel=# How many parallell test should be run
defaults-file=<config template> Use fixed config template for all
tests
- defaults_extra_file=<config template> Extra config template to add to
+ defaults-extra-file=<config template> Extra config template to add to
all generated configs
combination=<opt> Use at least twice to run tests with specified
options to mysqld
@@ -5804,6 +6380,8 @@ Options to control directories to use
for tmpfs (/dev/shm)
The option can also be set using environment
variable MTR_MEM=[DIR]
+ clean-vardir Clean vardir if tests were successful and if
+ running in "memory". Otherwise this option is ignored
client-bindir=PATH Path to the directory where client binaries are located
client-libdir=PATH Path to the directory where client libraries are located
@@ -5855,10 +6433,10 @@ Options for test case authoring
check-testcases Check testcases for sideeffects
mark-progress Log line number and elapsed time to <testname>.progress
-Options that pass on options
+Options that pass on options (these may be repeated)
mysqld=ARGS Specify additional arguments to "mysqld"
- mysqltest=ARGS Specify additional arguments to "mysqltest"
+ mysqld-env=VAR=VAL Specify additional environment settings for "mysqld"
Options to run test on running server
@@ -5873,16 +6451,24 @@ Options for debugging the product
client-ddd Start mysqltest client in ddd
client-debugger=NAME Start mysqltest in the selected debugger
client-gdb Start mysqltest client in gdb
+ client-dbx Start mysqltest client in dbx
ddd Start mysqld in ddd
debug Dump trace output for all servers and client programs
+ debug-common Same as debug, but sets 'd' debug flags to
+ "query,info,error,enter,exit"
+ debug-server Use debug version of server, but without turning on
+ tracing
debugger=NAME Start mysqld in the selected debugger
gdb Start the mysqld(s) in gdb
+ dbx Start the mysqld(s) in dbx
manual-debug Let user manually start mysqld in debugger, before
running test(s)
manual-gdb Let user manually start mysqld in gdb, before running
test(s)
manual-ddd Let user manually start mysqld in ddd, before running
test(s)
+ manual-dbx Let user manually start mysqld in dbx, before running
+ test(s)
max-save-core Limit the number of core files saved (to avoid filling
up disks for heavily crashing server). Defaults to
$opt_max_save_core, set to 0 for no limit. Set
@@ -5922,7 +6508,7 @@ Options for strace
Misc options
user=USER User for connecting to mysqld(default: $opt_user)
comment=STR Write STR to the output
- notimer Don't show test case execution time
+ timer Show test case execution time.
verbose More verbose output(use multiple times for even more)
verbose-restart Write when and why servers are restarted
start Only initialize and start the servers, using the
@@ -5976,6 +6562,7 @@ Misc options
gcov-src-dir=subdir Colllect coverage only within the given subdirectory.
For example, if you're only developing the SQL layer,
it makes sense to use --gcov-src-dir=sql
+ gprof Collect profiling information using gprof.
experimental=<file> Refer to list of tests considered experimental;
failures will be marked exp-fail instead of fail.
report-features First run a "test" that reports mysql features
@@ -5986,6 +6573,16 @@ Misc options
default-myisam Set default storage engine to MyISAM for non-innodb
tests. This is needed after switching default storage
engine to InnoDB.
+ report-times Report how much time has been spent on different
+ phases of test execution.
+ nounit-tests Do not run unit tests. Normally run if configured
+ and if not running named tests/suites
+ unit-tests Run unit tests even if they would otherwise not be run
+
+Some options that control enabling a feature for normal test runs,
+can be turned off by prepending 'no' to the option, e.g. --notimer.
+This applies to reorder, timer, check-testcases and warnings.
+
HERE
exit(1);
diff --git a/mysql-test/purify.supp b/mysql-test/purify.supp
index 58553130c51..74ed8c42181 100644
--- a/mysql-test/purify.supp
+++ b/mysql-test/purify.supp
@@ -1,3 +1,20 @@
+# Copyright (C) 2005, 2007 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
suppress UMR rw_read_held; mi_open; ha_myisam::open64; handler::ha_open; openfrm
suppress UMR my_end; main
suppress UMR _doprnt; fprintf; my_end; main
diff --git a/mysql-test/r/1st.result b/mysql-test/r/1st.result
index ae9989ce563..792d9eaf2f1 100644
--- a/mysql-test/r/1st.result
+++ b/mysql-test/r/1st.result
@@ -21,6 +21,7 @@ ndb_binlog_index
plugin
proc
procs_priv
+proxies_priv
servers
slow_log
tables_priv
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 8ee24a86f10..723855867f3 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -1290,3 +1290,24 @@ ALTER TABLE t1 CHANGE a id INT;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
DROP TABLE t1;
+#
+# Bug#11754461 CANNOT ALTER TABLE WHEN KEY PREFIX TOO LONG
+#
+DROP DATABASE IF EXISTS db1;
+CREATE DATABASE db1 CHARACTER SET utf8;
+CREATE TABLE db1.t1 (bar TINYTEXT, KEY (bar(100)));
+ALTER TABLE db1.t1 ADD baz INT;
+DROP DATABASE db1;
+#
+# Bug#11938039 RE-EXECUTION OF FRM-ONLY ALTER TABLE WITH RENAME
+# CLAUSE FAILS OR ABORTS SERVER.
+#
+drop table if exists t1;
+create table t1 (a int);
+prepare stmt1 from 'alter table t1 alter column a set default 1, rename to t2';
+execute stmt1;
+rename table t2 to t1;
+# The below statement should succeed and not emit error or abort server.
+execute stmt1;
+deallocate prepare stmt1;
+drop table t2;
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index 0983e9fa8cf..a297622155b 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -12801,3 +12801,25 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
DROP TABLE t1;
+#
+# BUG#58205 - Valgrind failure in fn_format when called from
+# archive_discover
+#
+CREATE TABLE `a/../`(a INT) ENGINE=ARCHIVE;
+DROP TABLE `a/../`;
+#
+# BUG#57162 - valgrind errors, random data when returning
+# ordered data from archive tables
+#
+SET sort_buffer_size=32804;
+CREATE TABLE t1(a INT, b CHAR(255), c CHAR(255), d CHAR(255),
+e CHAR(255), f INT) ENGINE=ARCHIVE DEFAULT CHARSET utf8;
+INSERT INTO t1 VALUES(-1,'b','c','d','e',1);
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT t1.* FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6;
+SELECT * FROM t1 ORDER BY f LIMIT 1;
+a b c d e f
+-1 b c d e 1
+DROP TABLE t1;
+SET sort_buffer_size=DEFAULT;
diff --git a/mysql-test/r/archive_debug.result b/mysql-test/r/archive_debug.result
new file mode 100644
index 00000000000..cc5a3761a99
--- /dev/null
+++ b/mysql-test/r/archive_debug.result
@@ -0,0 +1,12 @@
+#
+# BUG#12402794 - 60976: CRASH, VALGRIND WARNING AND MEMORY LEAK
+# WITH PARTITIONED ARCHIVE TABLES
+#
+CREATE TABLE t1(a INT) ENGINE=ARCHIVE;
+INSERT INTO t1 VALUES(1);
+SET SESSION debug='d,simulate_archive_open_failure';
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check error Corrupt
+SET SESSION debug=DEFAULT;
+DROP TABLE t1;
diff --git a/mysql-test/r/archive_plugin.result b/mysql-test/r/archive_plugin.result
index 221b343cca5..90c1f10bf19 100644
--- a/mysql-test/r/archive_plugin.result
+++ b/mysql-test/r/archive_plugin.result
@@ -10,6 +10,9 @@ UNINSTALL PLUGIN archive;
INSTALL PLUGIN archive SONAME 'ha_archive.so';
CREATE TABLE t1(a int) ENGINE=ARCHIVE;
DROP TABLE t1;
+SELECT 1;
+1
+1
UNINSTALL PLUGIN archive;
UNINSTALL PLUGIN archive;
ERROR 42000: PLUGIN archive does not exist
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result
index dbeedb481cd..d21e78428c5 100644
--- a/mysql-test/r/auto_increment.result
+++ b/mysql-test/r/auto_increment.result
@@ -476,3 +476,43 @@ SELECT a FROM t2;
a
2
DROP TABLE t1, t2;
+#
+# Bug#39828 autoinc wraps around when offset and increment > 1
+#
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) engine=MyISAM;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES (18446744073709551601);
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=10;
+SELECT @@SESSION.AUTO_INCREMENT_OFFSET;
+@@SESSION.AUTO_INCREMENT_OFFSET
+1
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+ERROR 22003: Out of range value for column 't1' at row 167
+SELECT * FROM t1;
+c1
+1
+18446744073709551601
+18446744073709551611
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=default;
+SET @@SESSION.AUTO_INCREMENT_OFFSET=default;
+DROP TABLE t1;
+End of 5.1 tests
+#
+# Bug#50619 assert in handler::update_auto_increment
+#
+CREATE TABLE t1 (pk INT AUTO_INCREMENT, PRIMARY KEY (pk));
+INSERT INTO t1 VALUES (NULL), (-1), (NULL);
+SELECT * FROM t1;
+pk
+-1
+1
+2
+DROP TABLE t1;
+CREATE TABLE t1 (pk BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY (pk));
+INSERT INTO t1 VALUES (NULL), (18446744073709551615-1), (NULL);
+ERROR HY000: Failed to read auto-increment value from storage engine
+SELECT * FROM t1;
+pk
+1
+18446744073709551614
+DROP TABLE t1;
diff --git a/mysql-test/r/blackhole_plugin.result b/mysql-test/r/blackhole_plugin.result
index 9fc0cacd9cc..4ef9fa0fa47 100644
--- a/mysql-test/r/blackhole_plugin.result
+++ b/mysql-test/r/blackhole_plugin.result
@@ -10,6 +10,9 @@ UNINSTALL PLUGIN blackhole;
INSTALL PLUGIN blackhole SONAME 'ha_blackhole.so';
CREATE TABLE t1(a int) ENGINE=BLACKHOLE;
DROP TABLE t1;
+SELECT 1;
+1
+1
UNINSTALL PLUGIN blackhole;
UNINSTALL PLUGIN blackhole;
ERROR 42000: PLUGIN blackhole does not exist
diff --git a/mysql-test/r/bootstrap.result b/mysql-test/r/bootstrap.result
index 3301ca74324..484724373d2 100644
--- a/mysql-test/r/bootstrap.result
+++ b/mysql-test/r/bootstrap.result
@@ -6,3 +6,15 @@ set @my_max_allowed_packet= @@max_allowed_packet;
set global max_allowed_packet=100*@@max_allowed_packet;
set global max_allowed_packet=@my_max_allowed_packet;
drop table t1;
+End of 5.1 tests
+#
+# Bug #11766306: 59393: HAVE_INNODB=YES WHEN MYSQLD
+# STARTED WITH --SKIP-INNODB
+#
+SHOW VARIABLES LIKE 'have_innodb';
+Variable_name Value
+have_innodb DISABLED
+SELECT SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb';
+SUPPORT
+NO
+End of 5.5 tests
diff --git a/mysql-test/r/bug58669.result b/mysql-test/r/bug58669.result
new file mode 100644
index 00000000000..5504c5908be
--- /dev/null
+++ b/mysql-test/r/bug58669.result
@@ -0,0 +1,17 @@
+#
+# Bug#58669: read_only not enforced on 5.5.x
+#
+CREATE USER user1@localhost;
+CREATE DATABASE db1;
+GRANT ALL PRIVILEGES ON db1.* TO user1@localhost;
+CREATE TABLE db1.t1(a INT);
+SELECT CURRENT_USER();
+CURRENT_USER()
+user1@localhost
+SHOW VARIABLES LIKE "%read_only%";
+Variable_name Value
+read_only ON
+INSERT INTO db1.t1 VALUES (1);
+ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
+DROP DATABASE db1;
+DROP USER user1@localhost;
diff --git a/mysql-test/r/cache_innodb.result b/mysql-test/r/cache_innodb.result
index 600ed84c3c9..293d7a3f412 100644
--- a/mysql-test/r/cache_innodb.result
+++ b/mysql-test/r/cache_innodb.result
@@ -220,3 +220,14 @@ Variable_name Value
Qcache_hits 1
set GLOBAL query_cache_size=1048576;
drop table t2;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 VALUES(1);
+ROLLBACK WORK AND CHAIN NO RELEASE;
+SELECT a FROM t1;
+a
+ROLLBACK WORK AND CHAIN NO RELEASE;
+SELECT a FROM t1;
+a
+ROLLBACK;
+DROP TABLE t1;
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index 3e1ea824db5..89cbda9847c 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -451,4 +451,21 @@ SELECT CONVERT(t2.a USING UTF8) FROM t1, t1 t2 LIMIT 1
1
1
DROP TABLE t1;
+#
+# Bug #11765023: 57934: DOS POSSIBLE SINCE BINARY CASTING
+# DOESN'T ADHERE TO MAX_ALLOWED_PACKET
+SET @@GLOBAL.max_allowed_packet=2048;
+Warnings:
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
+SELECT CONVERT('a', BINARY(2049));
+CONVERT('a', BINARY(2049))
+NULL
+Warnings:
+Warning 1301 Result of cast_as_binary() was larger than max_allowed_packet (2048) - truncated
+SELECT CONVERT('a', CHAR(2049));
+CONVERT('a', CHAR(2049))
+NULL
+Warnings:
+Warning 1301 Result of cast_as_char() was larger than max_allowed_packet (2048) - truncated
+SET @@GLOBAL.max_allowed_packet=default;
End of 5.1 tests
diff --git a/mysql-test/r/check.result b/mysql-test/r/check.result
index 0bff34dba20..ac9c7bca9d7 100644
--- a/mysql-test/r/check.result
+++ b/mysql-test/r/check.result
@@ -23,3 +23,19 @@ REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
DROP TABLE t1;
+#
+# Bug#56422 CHECK TABLE run when the table is locked reports corruption
+# along with timeout
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a INT);
+LOCK TABLE t1 WRITE;
+# Connection con1
+SET lock_wait_timeout= 1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check Error Lock wait timeout exceeded; try restarting transaction
+test.t1 check status Operation failed
+# Connection default
+UNLOCK TABLES;
+DROP TABLE t1;
diff --git a/mysql-test/r/client_xml.result b/mysql-test/r/client_xml.result
index aa4bdb2bd61..7f74a092af7 100644
--- a/mysql-test/r/client_xml.result
+++ b/mysql-test/r/client_xml.result
@@ -21,9 +21,9 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
- <field Field="a&amp;b" Type="int(11)" Null="YES" Key="" Extra="" />
- <field Field="a&lt;b" Type="int(11)" Null="YES" Key="" Extra="" />
- <field Field="a&gt;b" Type="text" Null="YES" Key="" Extra="" />
+ <field Field="a&amp;b" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <field Field="a&lt;b" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <field Field="a&gt;b" Type="text" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_data name="t1">
<row>
diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result
index 993d33d7a38..fb1552b6c28 100644
--- a/mysql-test/r/commit_1innodb.result
+++ b/mysql-test/r/commit_1innodb.result
@@ -519,21 +519,21 @@ SUCCESS
# 12. Read-write statement: IODKU, change 0 rows.
#
insert t1 set a=2 on duplicate key update a=2;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(2, 2, 1, 0);
SUCCESS
commit;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(2, 2, 1, 0);
SUCCESS
# 13. Read-write statement: INSERT IGNORE, change 0 rows.
#
insert ignore t1 set a=2;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(2, 2, 1, 0);
SUCCESS
commit;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(2, 2, 1, 0);
SUCCESS
# 14. Read-write statement: INSERT IGNORE, change 1 row.
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result
index 690a6fb3bc3..cff54ebef4e 100644
--- a/mysql-test/r/connect.result
+++ b/mysql-test/r/connect.result
@@ -15,6 +15,7 @@ ndb_binlog_index
plugin
proc
procs_priv
+proxies_priv
servers
slow_log
tables_priv
@@ -48,6 +49,7 @@ ndb_binlog_index
plugin
proc
procs_priv
+proxies_priv
servers
slow_log
tables_priv
@@ -89,6 +91,7 @@ ndb_binlog_index
plugin
proc
procs_priv
+proxies_priv
servers
slow_log
tables_priv
diff --git a/mysql-test/r/csv_not_null.result b/mysql-test/r/csv_not_null.result
index af583a36837..aed9bcb1587 100644
--- a/mysql-test/r/csv_not_null.result
+++ b/mysql-test/r/csv_not_null.result
@@ -19,13 +19,16 @@ INSERT INTO t1 VALUES();
SELECT * FROM t1;
a b c d e f
0 foo 0000-00-00
+INSERT INTO t1 VALUES(default,default,default,default,default,default);
SELECT * FROM t1;
a b c d e f
0 foo 0000-00-00
+0 foo 0000-00-00
INSERT INTO t1 VALUES(0,'abc','def','ghi','bar','1999-12-31');
SELECT * FROM t1;
a b c d e f
0 foo 0000-00-00
+0 foo 0000-00-00
0 abc def ghi bar 1999-12-31
# === insert failures ===
INSERT INTO t1 VALUES(NULL,'ab','a','b','foo','2007-01-01');
diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result
index 4eab57e4d81..a9977311640 100644
--- a/mysql-test/r/ctype_binary.result
+++ b/mysql-test/r/ctype_binary.result
@@ -1426,7 +1426,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(10) NOT NULL DEFAULT ''
+ `c1` varbinary(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(extract(year from 20090702)));
@@ -2047,7 +2047,7 @@ create table t2 as select concat(a) from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `concat(a)` varbinary(2) DEFAULT NULL
+ `concat(a)` varbinary(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
create table t1 (a year);
@@ -2356,7 +2356,7 @@ insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;
Field Type Null Key Default Extra
-a varbinary(2) YES NULL
+a varbinary(4) YES NULL
select hex(a) from v1;
hex(a)
3031
@@ -2749,6 +2749,91 @@ DROP TABLE t1;
# End of Bug#54916
#
#
+# Bug#58190 BETWEEN no longer uses indexes for date or datetime fields
+#
+SELECT @@collation_connection;
+@@collation_connection
+binary
+CREATE TABLE t1 (
+id INT(11) DEFAULT NULL,
+date_column DATE DEFAULT NULL,
+KEY(date_column));
+INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
+EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range date_column date_column 4 NULL 1 Using where
+ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
+EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range date_column date_column 9 NULL 1 Using where
+DROP TABLE t1;
+#
+# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
+#
+SELECT @@collation_connection, @@character_set_results;
+@@collation_connection @@character_set_results
+binary binary
+CREATE TABLE t1 AS
+SELECT
+DATE_SUB('2007-08-03', INTERVAL 1 MINUTE) AS field_str1,
+DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS field1_str2,
+DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY) AS field_date,
+DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE) AS field_datetime;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `field_str1` varbinary(29) DEFAULT NULL,
+ `field1_str2` varbinary(29) DEFAULT NULL,
+ `field_date` date DEFAULT NULL,
+ `field_datetime` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+SELECT
+DATE_SUB('2007-08-03', INTERVAL 1 DAY) AS field_str1,
+DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS field1_str2,
+DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY) AS field_date,
+DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE) AS field_datetime;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def field_str1 254 29 10 Y 128 31 63
+def field1_str2 254 29 19 Y 128 31 63
+def field_date 10 29 10 Y 128 31 63
+def field_datetime 12 29 19 Y 128 31 63
+field_str1 field1_str2 field_date field_datetime
+2007-08-02 2007-08-03 17:32:00 2007-08-02 2007-08-03 17:32:00
+SELECT
+HEX(DATE_SUB('2007-08-03', INTERVAL 1 MINUTE)) AS field_str1,
+HEX(DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE)) AS field1_str2,
+HEX(DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY)) AS field_date,
+HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS field_datetime;
+field_str1 field1_str2 field_date field_datetime
+323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030
+#
+# Bug#11926811 / Bug#60625 Illegal mix of collations
+#
+SELECT @@collation_connection;
+@@collation_connection
+binary
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE v_LastPaymentDate DATETIME DEFAULT NULL;
+SELECT v_LastPaymentDate < NOW();
+EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW();
+SHOW WARNINGS;
+EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW());
+END//
+CALL p1;
+v_LastPaymentDate < NOW()
+NULL
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Level Code Message
+Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
+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 concat(v_LastPaymentDate@0,now()) AS `CONCAT(v_LastPaymentDate, NOW())`
+DROP PROCEDURE p1;
+#
# Bug#52159 returning time type from function and empty left join causes debug assertion
#
CREATE FUNCTION f1() RETURNS TIME RETURN 1;
diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result
index 7f0cdf3f17b..231755a3f69 100644
--- a/mysql-test/r/ctype_cp1250_ch.result
+++ b/mysql-test/r/ctype_cp1250_ch.result
@@ -238,3 +238,6 @@ select a from t1 where a like "abcdefghá";
a
abcdefghá
drop table t1;
+set global LC_MESSAGES=convert((@@global.log_bin_trust_function_creators)
+using cp1250);
+ERROR HY000: Unknown locale: '1'
diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result
index a9ced3e89bf..53b45d60c0b 100644
--- a/mysql-test/r/ctype_cp1251.result
+++ b/mysql-test/r/ctype_cp1251.result
@@ -82,6 +82,316 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=cp1251
DROP TABLE t1;
#
+# Start of 5.1 tests
+#
+SELECT @@collation_connection;
+@@collation_connection
+cp1251_general_ci
+CREATE TABLE t1 AS SELECT ' ' AS a LIMIT 0;
+INSERT INTO t1 VALUES (0x00),(0x01),(0x02),(0x03),(0x04),(0x05),(0x06),(0x07);
+INSERT INTO t1 VALUES (0x08),(0x09),(0x0A),(0x0B),(0x0C),(0x0D),(0x0E),(0x0F);
+INSERT INTO t1 VALUES (0x10),(0x11),(0x12),(0x13),(0x14),(0x15),(0x16),(0x17);
+INSERT INTO t1 VALUES (0x18),(0x19),(0x1A),(0x1B),(0x1C),(0x1D),(0x1E),(0x1F);
+INSERT INTO t1 VALUES (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27);
+INSERT INTO t1 VALUES (0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F);
+INSERT INTO t1 VALUES (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37);
+INSERT INTO t1 VALUES (0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F);
+INSERT INTO t1 VALUES (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47);
+INSERT INTO t1 VALUES (0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F);
+INSERT INTO t1 VALUES (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57);
+INSERT INTO t1 VALUES (0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F);
+INSERT INTO t1 VALUES (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67);
+INSERT INTO t1 VALUES (0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F);
+INSERT INTO t1 VALUES (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77);
+INSERT INTO t1 VALUES (0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F);
+INSERT INTO t1 VALUES (0x80),(0x81),(0x82),(0x83),(0x84),(0x85),(0x86),(0x87);
+INSERT INTO t1 VALUES (0x88),(0x89),(0x8A),(0x8B),(0x8C),(0x8D),(0x8E),(0x8F);
+INSERT INTO t1 VALUES (0x90),(0x91),(0x92),(0x93),(0x94),(0x95),(0x96),(0x97);
+INSERT INTO t1 VALUES (0x98),(0x99),(0x9A),(0x9B),(0x9C),(0x9D),(0x9E),(0x9F);
+INSERT INTO t1 VALUES (0xA0),(0xA1),(0xA2),(0xA3),(0xA4),(0xA5),(0xA6),(0xA7);
+INSERT INTO t1 VALUES (0xA8),(0xA9),(0xAA),(0xAB),(0xAC),(0xAD),(0xAE),(0xAF);
+INSERT INTO t1 VALUES (0xB0),(0xB1),(0xB2),(0xB3),(0xB4),(0xB5),(0xB6),(0xB7);
+INSERT INTO t1 VALUES (0xB8),(0xB9),(0xBA),(0xBB),(0xBC),(0xBD),(0xBE),(0xBF);
+INSERT INTO t1 VALUES (0xC0),(0xC1),(0xC2),(0xC3),(0xC4),(0xC5),(0xC6),(0xC7);
+INSERT INTO t1 VALUES (0xC8),(0xC9),(0xCA),(0xCB),(0xCC),(0xCD),(0xCE),(0xCF);
+INSERT INTO t1 VALUES (0xD0),(0xD1),(0xD2),(0xD3),(0xD4),(0xD5),(0xD6),(0xD7);
+INSERT INTO t1 VALUES (0xD8),(0xD9),(0xDA),(0xDB),(0xDC),(0xDD),(0xDE),(0xDF);
+INSERT INTO t1 VALUES (0xE0),(0xE1),(0xE2),(0xE3),(0xE4),(0xE5),(0xE6),(0xE7);
+INSERT INTO t1 VALUES (0xE8),(0xE9),(0xEA),(0xEB),(0xEC),(0xED),(0xEE),(0xEF);
+INSERT INTO t1 VALUES (0xF0),(0xF1),(0xF2),(0xF3),(0xF4),(0xF5),(0xF6),(0xF7);
+INSERT INTO t1 VALUES (0xF8),(0xF9),(0xFA),(0xFB),(0xFC),(0xFD),(0xFE),(0xFF);
+SELECT
+HEX(a) AS chr,
+HEX(LOWER(a)) AS upper,
+HEX(LOWER(a)) AS lower,
+HEX(@utf8:=CONVERT(a USING utf8)) AS utf8,
+HEX(@roundtrip:=CAST(@utf8 AS CHAR)) AS roundtrip,
+if(a=BINARY @roundtrip,'','Round trip unsafe') AS issafe
+FROM t1 ORDER BY chr;
+chr upper lower utf8 roundtrip issafe
+00 00 00 00 00
+01 01 01 01 01
+02 02 02 02 02
+03 03 03 03 03
+04 04 04 04 04
+05 05 05 05 05
+06 06 06 06 06
+07 07 07 07 07
+08 08 08 08 08
+09 09 09 09 09
+0A 0A 0A 0A 0A
+0B 0B 0B 0B 0B
+0C 0C 0C 0C 0C
+0D 0D 0D 0D 0D
+0E 0E 0E 0E 0E
+0F 0F 0F 0F 0F
+10 10 10 10 10
+11 11 11 11 11
+12 12 12 12 12
+13 13 13 13 13
+14 14 14 14 14
+15 15 15 15 15
+16 16 16 16 16
+17 17 17 17 17
+18 18 18 18 18
+19 19 19 19 19
+1A 1A 1A 1A 1A
+1B 1B 1B 1B 1B
+1C 1C 1C 1C 1C
+1D 1D 1D 1D 1D
+1E 1E 1E 1E 1E
+1F 1F 1F 1F 1F
+20 20 20 20 20
+21 21 21 21 21
+22 22 22 22 22
+23 23 23 23 23
+24 24 24 24 24
+25 25 25 25 25
+26 26 26 26 26
+27 27 27 27 27
+28 28 28 28 28
+29 29 29 29 29
+2A 2A 2A 2A 2A
+2B 2B 2B 2B 2B
+2C 2C 2C 2C 2C
+2D 2D 2D 2D 2D
+2E 2E 2E 2E 2E
+2F 2F 2F 2F 2F
+30 30 30 30 30
+31 31 31 31 31
+32 32 32 32 32
+33 33 33 33 33
+34 34 34 34 34
+35 35 35 35 35
+36 36 36 36 36
+37 37 37 37 37
+38 38 38 38 38
+39 39 39 39 39
+3A 3A 3A 3A 3A
+3B 3B 3B 3B 3B
+3C 3C 3C 3C 3C
+3D 3D 3D 3D 3D
+3E 3E 3E 3E 3E
+3F 3F 3F 3F 3F
+40 40 40 40 40
+41 61 61 41 41
+42 62 62 42 42
+43 63 63 43 43
+44 64 64 44 44
+45 65 65 45 45
+46 66 66 46 46
+47 67 67 47 47
+48 68 68 48 48
+49 69 69 49 49
+4A 6A 6A 4A 4A
+4B 6B 6B 4B 4B
+4C 6C 6C 4C 4C
+4D 6D 6D 4D 4D
+4E 6E 6E 4E 4E
+4F 6F 6F 4F 4F
+50 70 70 50 50
+51 71 71 51 51
+52 72 72 52 52
+53 73 73 53 53
+54 74 74 54 54
+55 75 75 55 55
+56 76 76 56 56
+57 77 77 57 57
+58 78 78 58 58
+59 79 79 59 59
+5A 7A 7A 5A 5A
+5B 5B 5B 5B 5B
+5C 5C 5C 5C 5C
+5D 5D 5D 5D 5D
+5E 5E 5E 5E 5E
+5F 5F 5F 5F 5F
+60 60 60 60 60
+61 61 61 61 61
+62 62 62 62 62
+63 63 63 63 63
+64 64 64 64 64
+65 65 65 65 65
+66 66 66 66 66
+67 67 67 67 67
+68 68 68 68 68
+69 69 69 69 69
+6A 6A 6A 6A 6A
+6B 6B 6B 6B 6B
+6C 6C 6C 6C 6C
+6D 6D 6D 6D 6D
+6E 6E 6E 6E 6E
+6F 6F 6F 6F 6F
+70 70 70 70 70
+71 71 71 71 71
+72 72 72 72 72
+73 73 73 73 73
+74 74 74 74 74
+75 75 75 75 75
+76 76 76 76 76
+77 77 77 77 77
+78 78 78 78 78
+79 79 79 79 79
+7A 7A 7A 7A 7A
+7B 7B 7B 7B 7B
+7C 7C 7C 7C 7C
+7D 7D 7D 7D 7D
+7E 7E 7E 7E 7E
+7F 7F 7F 7F 7F
+80 90 90 D082 80
+81 83 83 D083 81
+82 82 82 E2809A 82
+83 83 83 D193 83
+84 84 84 E2809E 84
+85 85 85 E280A6 85
+86 86 86 E280A0 86
+87 87 87 E280A1 87
+88 88 88 E282AC 88
+89 89 89 E280B0 89
+8A 9A 9A D089 8A
+8B 8B 8B E280B9 8B
+8C 9C 9C D08A 8C
+8D 9D 9D D08C 8D
+8E 9E 9E D08B 8E
+8F 9F 9F D08F 8F
+90 90 90 D192 90
+91 91 91 E28098 91
+92 92 92 E28099 92
+93 93 93 E2809C 93
+94 94 94 E2809D 94
+95 95 95 E280A2 95
+96 96 96 E28093 96
+97 97 97 E28094 97
+98 98 98 3F 3F Round trip unsafe
+99 99 99 E284A2 99
+9A 9A 9A D199 9A
+9B 9B 9B E280BA 9B
+9C 9C 9C D19A 9C
+9D 9D 9D D19C 9D
+9E 9E 9E D19B 9E
+9F 9F 9F D19F 9F
+A0 A0 A0 C2A0 A0
+A1 A2 A2 D08E A1
+A2 A2 A2 D19E A2
+A3 BC BC D088 A3
+A4 A4 A4 C2A4 A4
+A5 B4 B4 D290 A5
+A6 A6 A6 C2A6 A6
+A7 A7 A7 C2A7 A7
+A8 B8 B8 D081 A8
+A9 A9 A9 C2A9 A9
+AA BA BA D084 AA
+AB AB AB C2AB AB
+AC AC AC C2AC AC
+AD AD AD C2AD AD
+AE AE AE C2AE AE
+AF BF BF D087 AF
+B0 B0 B0 C2B0 B0
+B1 B1 B1 C2B1 B1
+B2 B3 B3 D086 B2
+B3 B3 B3 D196 B3
+B4 B4 B4 D291 B4
+B5 B5 B5 C2B5 B5
+B6 B6 B6 C2B6 B6
+B7 B7 B7 C2B7 B7
+B8 B8 B8 D191 B8
+B9 B9 B9 E28496 B9
+BA BA BA D194 BA
+BB BB BB C2BB BB
+BC BC BC D198 BC
+BD BE BE D085 BD
+BE BE BE D195 BE
+BF BF BF D197 BF
+C0 E0 E0 D090 C0
+C1 E1 E1 D091 C1
+C2 E2 E2 D092 C2
+C3 E3 E3 D093 C3
+C4 E4 E4 D094 C4
+C5 E5 E5 D095 C5
+C6 E6 E6 D096 C6
+C7 E7 E7 D097 C7
+C8 E8 E8 D098 C8
+C9 E9 E9 D099 C9
+CA EA EA D09A CA
+CB EB EB D09B CB
+CC EC EC D09C CC
+CD ED ED D09D CD
+CE EE EE D09E CE
+CF EF EF D09F CF
+D0 F0 F0 D0A0 D0
+D1 F1 F1 D0A1 D1
+D2 F2 F2 D0A2 D2
+D3 F3 F3 D0A3 D3
+D4 F4 F4 D0A4 D4
+D5 F5 F5 D0A5 D5
+D6 F6 F6 D0A6 D6
+D7 F7 F7 D0A7 D7
+D8 F8 F8 D0A8 D8
+D9 F9 F9 D0A9 D9
+DA FA FA D0AA DA
+DB FB FB D0AB DB
+DC FC FC D0AC DC
+DD FD FD D0AD DD
+DE FE FE D0AE DE
+DF FF FF D0AF DF
+E0 E0 E0 D0B0 E0
+E1 E1 E1 D0B1 E1
+E2 E2 E2 D0B2 E2
+E3 E3 E3 D0B3 E3
+E4 E4 E4 D0B4 E4
+E5 E5 E5 D0B5 E5
+E6 E6 E6 D0B6 E6
+E7 E7 E7 D0B7 E7
+E8 E8 E8 D0B8 E8
+E9 E9 E9 D0B9 E9
+EA EA EA D0BA EA
+EB EB EB D0BB EB
+EC EC EC D0BC EC
+ED ED ED D0BD ED
+EE EE EE D0BE EE
+EF EF EF D0BF EF
+F0 F0 F0 D180 F0
+F1 F1 F1 D181 F1
+F2 F2 F2 D182 F2
+F3 F3 F3 D183 F3
+F4 F4 F4 D184 F4
+F5 F5 F5 D185 F5
+F6 F6 F6 D186 F6
+F7 F7 F7 D187 F7
+F8 F8 F8 D188 F8
+F9 F9 F9 D189 F9
+FA FA FA D18A FA
+FB FB FB D18B FB
+FC FC FC D18C FC
+FD FD FD D18D FD
+FE FE FE D18E FE
+FF FF FF D18F FF
+DROP TABLE t1;
+set global LC_TIME_NAMES=convert((-8388608) using cp1251);
+ERROR HY000: Unknown locale: '-8388608'
+#
+# End of 5.1 tests
+#
+#
# Start of 5.5 tests
#
SET TIME_ZONE = _latin1 '+03:00';
@@ -1508,7 +1818,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(extract(year from 20090702)));
@@ -2129,7 +2439,7 @@ create table t2 as select concat(a) from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `concat(a)` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
+ `concat(a)` varchar(4) CHARACTER SET cp1251 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
create table t1 (a year);
@@ -2438,7 +2748,7 @@ insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;
Field Type Null Key Default Extra
-a varchar(2) YES NULL
+a varchar(4) YES NULL
select hex(a) from v1;
hex(a)
3031
@@ -2831,6 +3141,91 @@ DROP TABLE t1;
# End of Bug#54916
#
#
+# Bug#58190 BETWEEN no longer uses indexes for date or datetime fields
+#
+SELECT @@collation_connection;
+@@collation_connection
+cp1251_general_ci
+CREATE TABLE t1 (
+id INT(11) DEFAULT NULL,
+date_column DATE DEFAULT NULL,
+KEY(date_column));
+INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
+EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range date_column date_column 4 NULL 1 Using where
+ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
+EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range date_column date_column 9 NULL 1 Using where
+DROP TABLE t1;
+#
+# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
+#
+SELECT @@collation_connection, @@character_set_results;
+@@collation_connection @@character_set_results
+cp1251_general_ci cp1251
+CREATE TABLE t1 AS
+SELECT
+DATE_SUB('2007-08-03', INTERVAL 1 MINUTE) AS field_str1,
+DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS field1_str2,
+DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY) AS field_date,
+DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE) AS field_datetime;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `field_str1` varchar(29) CHARACTER SET cp1251 DEFAULT NULL,
+ `field1_str2` varchar(29) CHARACTER SET cp1251 DEFAULT NULL,
+ `field_date` date DEFAULT NULL,
+ `field_datetime` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+SELECT
+DATE_SUB('2007-08-03', INTERVAL 1 DAY) AS field_str1,
+DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS field1_str2,
+DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY) AS field_date,
+DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE) AS field_datetime;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def field_str1 254 29 10 Y 0 31 51
+def field1_str2 254 29 19 Y 0 31 51
+def field_date 10 29 10 Y 128 31 63
+def field_datetime 12 29 19 Y 128 31 63
+field_str1 field1_str2 field_date field_datetime
+2007-08-02 2007-08-03 17:32:00 2007-08-02 2007-08-03 17:32:00
+SELECT
+HEX(DATE_SUB('2007-08-03', INTERVAL 1 MINUTE)) AS field_str1,
+HEX(DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE)) AS field1_str2,
+HEX(DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY)) AS field_date,
+HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS field_datetime;
+field_str1 field1_str2 field_date field_datetime
+323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030
+#
+# Bug#11926811 / Bug#60625 Illegal mix of collations
+#
+SELECT @@collation_connection;
+@@collation_connection
+cp1251_general_ci
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE v_LastPaymentDate DATETIME DEFAULT NULL;
+SELECT v_LastPaymentDate < NOW();
+EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW();
+SHOW WARNINGS;
+EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW());
+END//
+CALL p1;
+v_LastPaymentDate < NOW()
+NULL
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Level Code Message
+Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
+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 concat(convert(v_LastPaymentDate@0 using cp1251),now()) AS `CONCAT(v_LastPaymentDate, NOW())`
+DROP PROCEDURE p1;
+#
# Bug#52159 returning time type from function and empty left join causes debug assertion
#
CREATE FUNCTION f1() RETURNS TIME RETURN 1;
@@ -2851,5 +3246,20 @@ maketime(`a`,`a`,`a`)
DROP TABLE t1;
SET sql_mode=default;
#
+# Bug#60101 COALESCE with cp1251 tables causes [Err] 1267 - Illegal mix of collations
+#
+CREATE TABLE t1 (test1 INT, test2 VARCHAR(255));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `test1` int(11) DEFAULT NULL,
+ `test2` varchar(255) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT COALESCE(IF(test1=1, 1, NULL), test2) FROM t1;
+COALESCE(IF(test1=1, 1, NULL), test2)
+SELECT COALESCE(IF(test1=1, NULL, 1), test2) FROM t1;
+COALESCE(IF(test1=1, NULL, 1), test2)
+DROP TABLE t1;
+#
# End of 5.5 tests
#
diff --git a/mysql-test/r/ctype_eucjpms.result b/mysql-test/r/ctype_eucjpms.result
index bd25b1beed4..5a402d57e65 100644
--- a/mysql-test/r/ctype_eucjpms.result
+++ b/mysql-test/r/ctype_eucjpms.result
@@ -9859,6 +9859,8 @@ hex(convert(_eucjpms 0xA5FE41 using ucs2))
select hex(convert(_eucjpms 0x8FABF841 using ucs2));
hex(convert(_eucjpms 0x8FABF841 using ucs2))
003F0041
+set global LC_TIME_NAMES=convert((convert((0x63) using eucjpms)) using utf8);
+ERROR HY000: Unknown locale: 'c'
#
# Start of 5.5 tests
#
diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result
index b97e6e695af..61560bd25e6 100644
--- a/mysql-test/r/ctype_latin1.result
+++ b/mysql-test/r/ctype_latin1.result
@@ -410,6 +410,15 @@ hex(cast(_ascii 0x7f as char(1) character set latin1))
7F
End of 5.0 tests
#
+# Bug#58022 ... like ... escape export_set ( ... ) crashes when export_set returns warnings
+#
+SELECT '' LIKE '' ESCAPE EXPORT_SET(1, 1, 1, 1, '');
+'' LIKE '' ESCAPE EXPORT_SET(1, 1, 1, 1, '')
+1
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: ''
+End of 5.1 tests
+#
# Start of 5.5 tests
#
SET TIME_ZONE = _latin1 '+03:00';
@@ -1836,7 +1845,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) NOT NULL DEFAULT ''
+ `c1` varchar(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(extract(year from 20090702)));
@@ -2457,7 +2466,7 @@ create table t2 as select concat(a) from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `concat(a)` varchar(2) DEFAULT NULL
+ `concat(a)` varchar(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
create table t1 (a year);
@@ -2766,7 +2775,7 @@ insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;
Field Type Null Key Default Extra
-a varchar(2) YES NULL
+a varchar(4) YES NULL
select hex(a) from v1;
hex(a)
3031
@@ -3159,6 +3168,91 @@ DROP TABLE t1;
# End of Bug#54916
#
#
+# Bug#58190 BETWEEN no longer uses indexes for date or datetime fields
+#
+SELECT @@collation_connection;
+@@collation_connection
+latin1_swedish_ci
+CREATE TABLE t1 (
+id INT(11) DEFAULT NULL,
+date_column DATE DEFAULT NULL,
+KEY(date_column));
+INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
+EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range date_column date_column 4 NULL 1 Using where
+ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
+EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range date_column date_column 9 NULL 1 Using where
+DROP TABLE t1;
+#
+# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
+#
+SELECT @@collation_connection, @@character_set_results;
+@@collation_connection @@character_set_results
+latin1_swedish_ci latin1
+CREATE TABLE t1 AS
+SELECT
+DATE_SUB('2007-08-03', INTERVAL 1 MINUTE) AS field_str1,
+DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS field1_str2,
+DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY) AS field_date,
+DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE) AS field_datetime;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `field_str1` varchar(29) DEFAULT NULL,
+ `field1_str2` varchar(29) DEFAULT NULL,
+ `field_date` date DEFAULT NULL,
+ `field_datetime` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+SELECT
+DATE_SUB('2007-08-03', INTERVAL 1 DAY) AS field_str1,
+DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS field1_str2,
+DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY) AS field_date,
+DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE) AS field_datetime;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def field_str1 254 29 10 Y 0 31 8
+def field1_str2 254 29 19 Y 0 31 8
+def field_date 10 29 10 Y 128 31 63
+def field_datetime 12 29 19 Y 128 31 63
+field_str1 field1_str2 field_date field_datetime
+2007-08-02 2007-08-03 17:32:00 2007-08-02 2007-08-03 17:32:00
+SELECT
+HEX(DATE_SUB('2007-08-03', INTERVAL 1 MINUTE)) AS field_str1,
+HEX(DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE)) AS field1_str2,
+HEX(DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY)) AS field_date,
+HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS field_datetime;
+field_str1 field1_str2 field_date field_datetime
+323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030
+#
+# Bug#11926811 / Bug#60625 Illegal mix of collations
+#
+SELECT @@collation_connection;
+@@collation_connection
+latin1_swedish_ci
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE v_LastPaymentDate DATETIME DEFAULT NULL;
+SELECT v_LastPaymentDate < NOW();
+EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW();
+SHOW WARNINGS;
+EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW());
+END//
+CALL p1;
+v_LastPaymentDate < NOW()
+NULL
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Level Code Message
+Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
+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 concat(v_LastPaymentDate@0,now()) AS `CONCAT(v_LastPaymentDate, NOW())`
+DROP PROCEDURE p1;
+#
# Bug#52159 returning time type from function and empty left join causes debug assertion
#
CREATE FUNCTION f1() RETURNS TIME RETURN 1;
@@ -3179,5 +3273,20 @@ maketime(`a`,`a`,`a`)
DROP TABLE t1;
SET sql_mode=default;
#
+# Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters
+#
+SET NAMES utf8;
+EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó';
+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 'abcdó' AS `abcdó`,_latin1'abcd\xC3\xB3' AS `abcdó`,_utf8'abcd\xC3\xB3' AS `abcdó`
+SET NAMES latin1;
+EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó';
+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 'abcdó' AS `abcdó`,_latin1'abcd\xC3\xB3' AS `abcdó`,_utf8'abcd\xC3\xB3' AS `abcdó`
+#
# End of 5.5 tests
#
diff --git a/mysql-test/r/ctype_like_range.result b/mysql-test/r/ctype_like_range.result
new file mode 100644
index 00000000000..a06c6ad9ed8
--- /dev/null
+++ b/mysql-test/r/ctype_like_range.result
@@ -0,0 +1,2310 @@
+DROP TABLE IF EXISTS t1;
+DROP VIEW IF EXISTS v1;
+CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a VARBINARY(32));
+INSERT INTO t1 (a) VALUES (''),('_'),('%'),('\_'),('\%'),('\\');
+INSERT INTO t1 (a) VALUES ('a'),('c');
+INSERT INTO t1 (a) VALUES ('a_'),('c_');
+INSERT INTO t1 (a) VALUES ('a%'),('c%');
+INSERT INTO t1 (a) VALUES ('aa'),('cc'),('ch');
+INSERT INTO t1 (a) VALUES ('aa_'),('cc_'),('ch_');
+INSERT INTO t1 (a) VALUES ('aa%'),('cc%'),('ch%');
+INSERT INTO t1 (a) VALUES ('aaa'),('ccc'),('cch');
+INSERT INTO t1 (a) VALUES ('aaa_'),('ccc_'),('cch_');
+INSERT INTO t1 (a) VALUES ('aaa%'),('ccc%'),('cch%');
+INSERT INTO t1 (a) VALUES ('aaaaaaaaaaaaaaaaaaaa');
+CREATE VIEW v1 AS
+SELECT id, 'a' AS name, a AS val FROM t1
+UNION
+SELECT id, 'mn', HEX(LIKE_RANGE_MIN(a, 16)) AS min FROM t1
+UNION
+SELECT id, 'mx', HEX(LIKE_RANGE_MAX(a, 16)) AS max FROM t1
+UNION
+SELECT id, 'sp', REPEAT('-', 32) AS sep FROM t1
+ORDER BY id, name;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 00
+2 mx FF
+2 sp --------------------------------
+3 a %
+3 mn
+3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+3 sp --------------------------------
+4 a \_
+4 mn 5F
+4 mx 5F
+4 sp --------------------------------
+5 a \%
+5 mn 25
+5 mx 25
+5 sp --------------------------------
+6 a \
+6 mn 5C
+6 mx 5C
+6 sp --------------------------------
+7 a a
+7 mn 61
+7 mx 61
+7 sp --------------------------------
+8 a c
+8 mn 63
+8 mx 63
+8 sp --------------------------------
+9 a a_
+9 mn 6100
+9 mx 61FF
+9 sp --------------------------------
+10 a c_
+10 mn 6300
+10 mx 63FF
+10 sp --------------------------------
+11 a a%
+11 mn 61
+11 mx 61FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+11 sp --------------------------------
+12 a c%
+12 mn 63
+12 mx 63FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+12 sp --------------------------------
+13 a aa
+13 mn 6161
+13 mx 6161
+13 sp --------------------------------
+14 a cc
+14 mn 6363
+14 mx 6363
+14 sp --------------------------------
+15 a ch
+15 mn 6368
+15 mx 6368
+15 sp --------------------------------
+16 a aa_
+16 mn 616100
+16 mx 6161FF
+16 sp --------------------------------
+17 a cc_
+17 mn 636300
+17 mx 6363FF
+17 sp --------------------------------
+18 a ch_
+18 mn 636800
+18 mx 6368FF
+18 sp --------------------------------
+19 a aa%
+19 mn 6161
+19 mx 6161FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 6363
+20 mx 6363FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 6368
+21 mx 6368FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 616161
+22 mx 616161
+22 sp --------------------------------
+23 a ccc
+23 mn 636363
+23 mx 636363
+23 sp --------------------------------
+24 a cch
+24 mn 636368
+24 mx 636368
+24 sp --------------------------------
+25 a aaa_
+25 mn 61616100
+25 mx 616161FF
+25 sp --------------------------------
+26 a ccc_
+26 mn 63636300
+26 mx 636363FF
+26 sp --------------------------------
+27 a cch_
+27 mn 63636800
+27 mx 636368FF
+27 sp --------------------------------
+28 a aaa%
+28 mn 616161
+28 mx 616161FFFFFFFFFFFFFFFFFFFFFFFFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 636363
+29 mx 636363FFFFFFFFFFFFFFFFFFFFFFFFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 636368
+30 mx 636368FFFFFFFFFFFFFFFFFFFFFFFFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 61616161616161616161616161616161
+31 mx 61616161616161616161616161616161
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET latin1;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 00
+2 mx FF
+2 sp --------------------------------
+3 a %
+3 mn 00000000000000000000000000000000
+3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+3 sp --------------------------------
+4 a \_
+4 mn 5F
+4 mx 5F
+4 sp --------------------------------
+5 a \%
+5 mn 25
+5 mx 25
+5 sp --------------------------------
+6 a \
+6 mn 5C
+6 mx 5C
+6 sp --------------------------------
+7 a a
+7 mn 61
+7 mx 61
+7 sp --------------------------------
+8 a c
+8 mn 63
+8 mx 63
+8 sp --------------------------------
+9 a a_
+9 mn 6100
+9 mx 61FF
+9 sp --------------------------------
+10 a c_
+10 mn 6300
+10 mx 63FF
+10 sp --------------------------------
+11 a a%
+11 mn 61000000000000000000000000000000
+11 mx 61FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+11 sp --------------------------------
+12 a c%
+12 mn 63000000000000000000000000000000
+12 mx 63FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+12 sp --------------------------------
+13 a aa
+13 mn 6161
+13 mx 6161
+13 sp --------------------------------
+14 a cc
+14 mn 6363
+14 mx 6363
+14 sp --------------------------------
+15 a ch
+15 mn 6368
+15 mx 6368
+15 sp --------------------------------
+16 a aa_
+16 mn 616100
+16 mx 6161FF
+16 sp --------------------------------
+17 a cc_
+17 mn 636300
+17 mx 6363FF
+17 sp --------------------------------
+18 a ch_
+18 mn 636800
+18 mx 6368FF
+18 sp --------------------------------
+19 a aa%
+19 mn 61610000000000000000000000000000
+19 mx 6161FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 63630000000000000000000000000000
+20 mx 6363FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 63680000000000000000000000000000
+21 mx 6368FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 616161
+22 mx 616161
+22 sp --------------------------------
+23 a ccc
+23 mn 636363
+23 mx 636363
+23 sp --------------------------------
+24 a cch
+24 mn 636368
+24 mx 636368
+24 sp --------------------------------
+25 a aaa_
+25 mn 61616100
+25 mx 616161FF
+25 sp --------------------------------
+26 a ccc_
+26 mn 63636300
+26 mx 636363FF
+26 sp --------------------------------
+27 a cch_
+27 mn 63636800
+27 mx 636368FF
+27 sp --------------------------------
+28 a aaa%
+28 mn 61616100000000000000000000000000
+28 mx 616161FFFFFFFFFFFFFFFFFFFFFFFFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 63636300000000000000000000000000
+29 mx 636363FFFFFFFFFFFFFFFFFFFFFFFFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 63636800000000000000000000000000
+30 mx 636368FFFFFFFFFFFFFFFFFFFFFFFFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 61616161616161616161616161616161
+31 mx 61616161616161616161616161616161
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 00000000000000000000000000000000
+2 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+2 sp --------------------------------
+3 a %
+3 mn 00000000000000000000000000000000
+3 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+3 sp --------------------------------
+4 a \_
+4 mn 5F
+4 mx 5F
+4 sp --------------------------------
+5 a \%
+5 mn 25
+5 mx 25
+5 sp --------------------------------
+6 a \
+6 mn 5C
+6 mx 5C
+6 sp --------------------------------
+7 a a
+7 mn 61
+7 mx 61
+7 sp --------------------------------
+8 a c
+8 mn 63
+8 mx 63
+8 sp --------------------------------
+9 a a_
+9 mn 61000000000000000000000000000000
+9 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+9 sp --------------------------------
+10 a c_
+10 mn 63000000000000000000000000000000
+10 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+10 sp --------------------------------
+11 a a%
+11 mn 61000000000000000000000000000000
+11 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+11 sp --------------------------------
+12 a c%
+12 mn 63000000000000000000000000000000
+12 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+12 sp --------------------------------
+13 a aa
+13 mn 6161
+13 mx 6161
+13 sp --------------------------------
+14 a cc
+14 mn 6363
+14 mx 6363
+14 sp --------------------------------
+15 a ch
+15 mn 6368
+15 mx 6368
+15 sp --------------------------------
+16 a aa_
+16 mn 61610000000000000000000000000000
+16 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
+16 sp --------------------------------
+17 a cc_
+17 mn 63630000000000000000000000000000
+17 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020
+17 sp --------------------------------
+18 a ch_
+18 mn 63680000000000000000000000000000
+18 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020
+18 sp --------------------------------
+19 a aa%
+19 mn 61610000000000000000000000000000
+19 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
+19 sp --------------------------------
+20 a cc%
+20 mn 63630000000000000000000000000000
+20 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020
+20 sp --------------------------------
+21 a ch%
+21 mn 63680000000000000000000000000000
+21 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020
+21 sp --------------------------------
+22 a aaa
+22 mn 616161
+22 mx 616161
+22 sp --------------------------------
+23 a ccc
+23 mn 636363
+23 mx 636363
+23 sp --------------------------------
+24 a cch
+24 mn 636368
+24 mx 636368
+24 sp --------------------------------
+25 a aaa_
+25 mn 61616100000000000000000000000000
+25 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20
+25 sp --------------------------------
+26 a ccc_
+26 mn 63636300000000000000000000000000
+26 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20
+26 sp --------------------------------
+27 a cch_
+27 mn 63636800000000000000000000000000
+27 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20
+27 sp --------------------------------
+28 a aaa%
+28 mn 61616100000000000000000000000000
+28 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20
+28 sp --------------------------------
+29 a ccc%
+29 mn 63636300000000000000000000000000
+29 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20
+29 sp --------------------------------
+30 a cch%
+30 mn 63636800000000000000000000000000
+30 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 6161616161
+31 mx 6161616161
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 09090909090909090909090909090909
+2 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+2 sp --------------------------------
+3 a %
+3 mn 09090909090909090909090909090909
+3 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+3 sp --------------------------------
+4 a \_
+4 mn 5F
+4 mx 5F
+4 sp --------------------------------
+5 a \%
+5 mn 25
+5 mx 25
+5 sp --------------------------------
+6 a \
+6 mn 5C
+6 mx 5C
+6 sp --------------------------------
+7 a a
+7 mn 61
+7 mx 61
+7 sp --------------------------------
+8 a c
+8 mn 63
+8 mx 63
+8 sp --------------------------------
+9 a a_
+9 mn 61090909090909090909090909090909
+9 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+9 sp --------------------------------
+10 a c_
+10 mn 63090909090909090909090909090909
+10 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+10 sp --------------------------------
+11 a a%
+11 mn 61090909090909090909090909090909
+11 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+11 sp --------------------------------
+12 a c%
+12 mn 63090909090909090909090909090909
+12 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+12 sp --------------------------------
+13 a aa
+13 mn 6161
+13 mx 6161
+13 sp --------------------------------
+14 a cc
+14 mn 6363
+14 mx 6363
+14 sp --------------------------------
+15 a ch
+15 mn 6368
+15 mx 6368
+15 sp --------------------------------
+16 a aa_
+16 mn 61610909090909090909090909090909
+16 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
+16 sp --------------------------------
+17 a cc_
+17 mn 63630909090909090909090909090909
+17 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020
+17 sp --------------------------------
+18 a ch_
+18 mn 63680909090909090909090909090909
+18 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020
+18 sp --------------------------------
+19 a aa%
+19 mn 61610909090909090909090909090909
+19 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
+19 sp --------------------------------
+20 a cc%
+20 mn 63630909090909090909090909090909
+20 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020
+20 sp --------------------------------
+21 a ch%
+21 mn 63680909090909090909090909090909
+21 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020
+21 sp --------------------------------
+22 a aaa
+22 mn 616161
+22 mx 616161
+22 sp --------------------------------
+23 a ccc
+23 mn 636363
+23 mx 636363
+23 sp --------------------------------
+24 a cch
+24 mn 636368
+24 mx 636368
+24 sp --------------------------------
+25 a aaa_
+25 mn 61616109090909090909090909090909
+25 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20
+25 sp --------------------------------
+26 a ccc_
+26 mn 63636309090909090909090909090909
+26 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20
+26 sp --------------------------------
+27 a cch_
+27 mn 63636809090909090909090909090909
+27 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20
+27 sp --------------------------------
+28 a aaa%
+28 mn 61616109090909090909090909090909
+28 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20
+28 sp --------------------------------
+29 a ccc%
+29 mn 63636309090909090909090909090909
+29 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20
+29 sp --------------------------------
+30 a cch%
+30 mn 63636809090909090909090909090909
+30 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 6161616161
+31 mx 6161616161
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_czech_ci;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 09090909090909090909090909090909
+2 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+2 sp --------------------------------
+3 a %
+3 mn 09090909090909090909090909090909
+3 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+3 sp --------------------------------
+4 a \_
+4 mn 5F
+4 mx 5F
+4 sp --------------------------------
+5 a \%
+5 mn 25
+5 mx 25
+5 sp --------------------------------
+6 a \
+6 mn 5C
+6 mx 5C
+6 sp --------------------------------
+7 a a
+7 mn 61
+7 mx 61
+7 sp --------------------------------
+8 a c
+8 mn 63
+8 mx 63
+8 sp --------------------------------
+9 a a_
+9 mn 61090909090909090909090909090909
+9 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+9 sp --------------------------------
+10 a c_
+10 mn 09090909090909090909090909090909
+10 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+10 sp --------------------------------
+11 a a%
+11 mn 61090909090909090909090909090909
+11 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+11 sp --------------------------------
+12 a c%
+12 mn 09090909090909090909090909090909
+12 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+12 sp --------------------------------
+13 a aa
+13 mn 6161
+13 mx 6161
+13 sp --------------------------------
+14 a cc
+14 mn 6363
+14 mx 6363
+14 sp --------------------------------
+15 a ch
+15 mn 6368
+15 mx 6368
+15 sp --------------------------------
+16 a aa_
+16 mn 61610909090909090909090909090909
+16 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
+16 sp --------------------------------
+17 a cc_
+17 mn 63090909090909090909090909090909
+17 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+17 sp --------------------------------
+18 a ch_
+18 mn 63680909090909090909090909090909
+18 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020
+18 sp --------------------------------
+19 a aa%
+19 mn 61610909090909090909090909090909
+19 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
+19 sp --------------------------------
+20 a cc%
+20 mn 63090909090909090909090909090909
+20 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+20 sp --------------------------------
+21 a ch%
+21 mn 63680909090909090909090909090909
+21 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020
+21 sp --------------------------------
+22 a aaa
+22 mn 616161
+22 mx 616161
+22 sp --------------------------------
+23 a ccc
+23 mn 636363
+23 mx 636363
+23 sp --------------------------------
+24 a cch
+24 mn 636368
+24 mx 636368
+24 sp --------------------------------
+25 a aaa_
+25 mn 61616109090909090909090909090909
+25 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20
+25 sp --------------------------------
+26 a ccc_
+26 mn 63630909090909090909090909090909
+26 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020
+26 sp --------------------------------
+27 a cch_
+27 mn 63636809090909090909090909090909
+27 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20
+27 sp --------------------------------
+28 a aaa%
+28 mn 61616109090909090909090909090909
+28 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20
+28 sp --------------------------------
+29 a ccc%
+29 mn 63630909090909090909090909090909
+29 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020
+29 sp --------------------------------
+30 a cch%
+30 mn 63636809090909090909090909090909
+30 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 6161616161
+31 mx 6161616161
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_danish_ci;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 09090909090909090909090909090909
+2 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+2 sp --------------------------------
+3 a %
+3 mn 09090909090909090909090909090909
+3 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+3 sp --------------------------------
+4 a \_
+4 mn 5F
+4 mx 5F
+4 sp --------------------------------
+5 a \%
+5 mn 25
+5 mx 25
+5 sp --------------------------------
+6 a \
+6 mn 5C
+6 mx 5C
+6 sp --------------------------------
+7 a a
+7 mn 61
+7 mx 61
+7 sp --------------------------------
+8 a c
+8 mn 63
+8 mx 63
+8 sp --------------------------------
+9 a a_
+9 mn 09090909090909090909090909090909
+9 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+9 sp --------------------------------
+10 a c_
+10 mn 63090909090909090909090909090909
+10 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+10 sp --------------------------------
+11 a a%
+11 mn 09090909090909090909090909090909
+11 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
+11 sp --------------------------------
+12 a c%
+12 mn 63090909090909090909090909090909
+12 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
+12 sp --------------------------------
+13 a aa
+13 mn 6161
+13 mx 6161
+13 sp --------------------------------
+14 a cc
+14 mn 6363
+14 mx 6363
+14 sp --------------------------------
+15 a ch
+15 mn 6368
+15 mx 6368
+15 sp --------------------------------
+16 a aa_
+16 mn 61610909090909090909090909090909
+16 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
+16 sp --------------------------------
+17 a cc_
+17 mn 63630909090909090909090909090909
+17 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020
+17 sp --------------------------------
+18 a ch_
+18 mn 63680909090909090909090909090909
+18 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020
+18 sp --------------------------------
+19 a aa%
+19 mn 61610909090909090909090909090909
+19 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
+19 sp --------------------------------
+20 a cc%
+20 mn 63630909090909090909090909090909
+20 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020
+20 sp --------------------------------
+21 a ch%
+21 mn 63680909090909090909090909090909
+21 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020
+21 sp --------------------------------
+22 a aaa
+22 mn 616161
+22 mx 616161
+22 sp --------------------------------
+23 a ccc
+23 mn 636363
+23 mx 636363
+23 sp --------------------------------
+24 a cch
+24 mn 636368
+24 mx 636368
+24 sp --------------------------------
+25 a aaa_
+25 mn 61610909090909090909090909090909
+25 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
+25 sp --------------------------------
+26 a ccc_
+26 mn 63636309090909090909090909090909
+26 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20
+26 sp --------------------------------
+27 a cch_
+27 mn 63636809090909090909090909090909
+27 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20
+27 sp --------------------------------
+28 a aaa%
+28 mn 61610909090909090909090909090909
+28 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
+28 sp --------------------------------
+29 a ccc%
+29 mn 63636309090909090909090909090909
+29 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20
+29 sp --------------------------------
+30 a cch%
+30 mn 63636809090909090909090909090909
+30 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 61616161090909090909090909090909
+31 mx 61616161EFBFBFEFBFBFEFBFBFEFBFBF
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 0000
+2 mx FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00000000000000000000000000000000
+3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+3 sp --------------------------------
+4 a \_
+4 mn 005F
+4 mx 005F
+4 sp --------------------------------
+5 a \%
+5 mn 0025
+5 mx 0025
+5 sp --------------------------------
+6 a \
+6 mn 005C
+6 mx 005C
+6 sp --------------------------------
+7 a a
+7 mn 0061
+7 mx 0061
+7 sp --------------------------------
+8 a c
+8 mn 0063
+8 mx 0063
+8 sp --------------------------------
+9 a a_
+9 mn 00610000
+9 mx 0061FFFF
+9 sp --------------------------------
+10 a c_
+10 mn 00630000
+10 mx 0063FFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00610000000000000000000000000000
+11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00630000000000000000000000000000
+12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+12 sp --------------------------------
+13 a aa
+13 mn 00610061
+13 mx 00610061
+13 sp --------------------------------
+14 a cc
+14 mn 00630063
+14 mx 00630063
+14 sp --------------------------------
+15 a ch
+15 mn 00630068
+15 mx 00630068
+15 sp --------------------------------
+16 a aa_
+16 mn 006100610000
+16 mx 00610061FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 006300630000
+17 mx 00630063FFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 006300680000
+18 mx 00630068FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00610061000000000000000000000000
+19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00630063000000000000000000000000
+20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00630068000000000000000000000000
+21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 006100610061
+22 mx 006100610061
+22 sp --------------------------------
+23 a ccc
+23 mn 006300630063
+23 mx 006300630063
+23 sp --------------------------------
+24 a cch
+24 mn 006300630068
+24 mx 006300630068
+24 sp --------------------------------
+25 a aaa_
+25 mn 0061006100610000
+25 mx 006100610061FFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 0063006300630000
+26 mx 006300630063FFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 0063006300680000
+27 mx 006300630068FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00610061006100000000000000000000
+28 mx 006100610061FFFFFFFFFFFFFFFFFFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00630063006300000000000000000000
+29 mx 006300630063FFFFFFFFFFFFFFFFFFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00630063006800000000000000000000
+30 mx 006300630068FFFFFFFFFFFFFFFFFFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 00610061006100610061006100610061
+31 mx 00610061006100610061006100610061
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 0009
+2 mx FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00090009000900090009000900090009
+3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+3 sp --------------------------------
+4 a \_
+4 mn 005F
+4 mx 005F
+4 sp --------------------------------
+5 a \%
+5 mn 0025
+5 mx 0025
+5 sp --------------------------------
+6 a \
+6 mn 005C
+6 mx 005C
+6 sp --------------------------------
+7 a a
+7 mn 0061
+7 mx 0061
+7 sp --------------------------------
+8 a c
+8 mn 0063
+8 mx 0063
+8 sp --------------------------------
+9 a a_
+9 mn 00610009
+9 mx 0061FFFF
+9 sp --------------------------------
+10 a c_
+10 mn 00630009
+10 mx 0063FFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00610009000900090009000900090009
+11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00630009000900090009000900090009
+12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+12 sp --------------------------------
+13 a aa
+13 mn 00610061
+13 mx 00610061
+13 sp --------------------------------
+14 a cc
+14 mn 00630063
+14 mx 00630063
+14 sp --------------------------------
+15 a ch
+15 mn 00630068
+15 mx 00630068
+15 sp --------------------------------
+16 a aa_
+16 mn 006100610009
+16 mx 00610061FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 006300630009
+17 mx 00630063FFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 006300680009
+18 mx 00630068FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00610061000900090009000900090009
+19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00630063000900090009000900090009
+20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00630068000900090009000900090009
+21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 006100610061
+22 mx 006100610061
+22 sp --------------------------------
+23 a ccc
+23 mn 006300630063
+23 mx 006300630063
+23 sp --------------------------------
+24 a cch
+24 mn 006300630068
+24 mx 006300630068
+24 sp --------------------------------
+25 a aaa_
+25 mn 0061006100610009
+25 mx 006100610061FFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 0063006300630009
+26 mx 006300630063FFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 0063006300680009
+27 mx 006300630068FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00610061006100090009000900090009
+28 mx 006100610061FFFFFFFFFFFFFFFFFFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00630063006300090009000900090009
+29 mx 006300630063FFFFFFFFFFFFFFFFFFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00630063006800090009000900090009
+30 mx 006300630068FFFFFFFFFFFFFFFFFFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 00610061006100610061006100610061
+31 mx 00610061006100610061006100610061
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_czech_ci;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 0009
+2 mx FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00090009000900090009000900090009
+3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+3 sp --------------------------------
+4 a \_
+4 mn 005F
+4 mx 005F
+4 sp --------------------------------
+5 a \%
+5 mn 0025
+5 mx 0025
+5 sp --------------------------------
+6 a \
+6 mn 005C
+6 mx 005C
+6 sp --------------------------------
+7 a a
+7 mn 0061
+7 mx 0061
+7 sp --------------------------------
+8 a c
+8 mn 0063
+8 mx 0063
+8 sp --------------------------------
+9 a a_
+9 mn 00610009
+9 mx 0061FFFF
+9 sp --------------------------------
+10 a c_
+10 mn 00090009000900090009000900090009
+10 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00610009000900090009000900090009
+11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00090009000900090009000900090009
+12 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+12 sp --------------------------------
+13 a aa
+13 mn 00610061
+13 mx 00610061
+13 sp --------------------------------
+14 a cc
+14 mn 00630063
+14 mx 00630063
+14 sp --------------------------------
+15 a ch
+15 mn 00630068
+15 mx 00630068
+15 sp --------------------------------
+16 a aa_
+16 mn 006100610009
+16 mx 00610061FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 00630009000900090009000900090009
+17 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 006300680009
+18 mx 00630068FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00610061000900090009000900090009
+19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00630009000900090009000900090009
+20 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00630068000900090009000900090009
+21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 006100610061
+22 mx 006100610061
+22 sp --------------------------------
+23 a ccc
+23 mn 006300630063
+23 mx 006300630063
+23 sp --------------------------------
+24 a cch
+24 mn 006300630068
+24 mx 006300630068
+24 sp --------------------------------
+25 a aaa_
+25 mn 0061006100610009
+25 mx 006100610061FFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 00630063000900090009000900090009
+26 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 0063006300680009
+27 mx 006300630068FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00610061006100090009000900090009
+28 mx 006100610061FFFFFFFFFFFFFFFFFFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00630063000900090009000900090009
+29 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00630063006800090009000900090009
+30 mx 006300630068FFFFFFFFFFFFFFFFFFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 00610061006100610061006100610061
+31 mx 00610061006100610061006100610061
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_danish_ci;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 0009
+2 mx FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00090009000900090009000900090009
+3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+3 sp --------------------------------
+4 a \_
+4 mn 005F
+4 mx 005F
+4 sp --------------------------------
+5 a \%
+5 mn 0025
+5 mx 0025
+5 sp --------------------------------
+6 a \
+6 mn 005C
+6 mx 005C
+6 sp --------------------------------
+7 a a
+7 mn 0061
+7 mx 0061
+7 sp --------------------------------
+8 a c
+8 mn 0063
+8 mx 0063
+8 sp --------------------------------
+9 a a_
+9 mn 00090009000900090009000900090009
+9 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+9 sp --------------------------------
+10 a c_
+10 mn 00630009
+10 mx 0063FFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00090009000900090009000900090009
+11 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00630009000900090009000900090009
+12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+12 sp --------------------------------
+13 a aa
+13 mn 00610061
+13 mx 00610061
+13 sp --------------------------------
+14 a cc
+14 mn 00630063
+14 mx 00630063
+14 sp --------------------------------
+15 a ch
+15 mn 00630068
+15 mx 00630068
+15 sp --------------------------------
+16 a aa_
+16 mn 006100610009
+16 mx 00610061FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 006300630009
+17 mx 00630063FFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 006300680009
+18 mx 00630068FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00610061000900090009000900090009
+19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00630063000900090009000900090009
+20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00630068000900090009000900090009
+21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 006100610061
+22 mx 006100610061
+22 sp --------------------------------
+23 a ccc
+23 mn 006300630063
+23 mx 006300630063
+23 sp --------------------------------
+24 a cch
+24 mn 006300630068
+24 mx 006300630068
+24 sp --------------------------------
+25 a aaa_
+25 mn 00610061000900090009000900090009
+25 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 0063006300630009
+26 mx 006300630063FFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 0063006300680009
+27 mx 006300630068FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00610061000900090009000900090009
+28 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00630063006300090009000900090009
+29 mx 006300630063FFFFFFFFFFFFFFFFFFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00630063006800090009000900090009
+30 mx 006300630068FFFFFFFFFFFFFFFFFFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 00610061006100610061006100610061
+31 mx 00610061006100610061006100610061
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 0000
+2 mx FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00000000000000000000000000000000
+3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+3 sp --------------------------------
+4 a \_
+4 mn 005F
+4 mx 005F
+4 sp --------------------------------
+5 a \%
+5 mn 0025
+5 mx 0025
+5 sp --------------------------------
+6 a \
+6 mn 005C
+6 mx 005C
+6 sp --------------------------------
+7 a a
+7 mn 0061
+7 mx 0061
+7 sp --------------------------------
+8 a c
+8 mn 0063
+8 mx 0063
+8 sp --------------------------------
+9 a a_
+9 mn 00610000
+9 mx 0061FFFF
+9 sp --------------------------------
+10 a c_
+10 mn 00630000
+10 mx 0063FFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00610000000000000000000000000000
+11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00630000000000000000000000000000
+12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+12 sp --------------------------------
+13 a aa
+13 mn 00610061
+13 mx 00610061
+13 sp --------------------------------
+14 a cc
+14 mn 00630063
+14 mx 00630063
+14 sp --------------------------------
+15 a ch
+15 mn 00630068
+15 mx 00630068
+15 sp --------------------------------
+16 a aa_
+16 mn 006100610000
+16 mx 00610061FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 006300630000
+17 mx 00630063FFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 006300680000
+18 mx 00630068FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00610061000000000000000000000000
+19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00630063000000000000000000000000
+20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00630068000000000000000000000000
+21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 006100610061
+22 mx 006100610061
+22 sp --------------------------------
+23 a ccc
+23 mn 006300630063
+23 mx 006300630063
+23 sp --------------------------------
+24 a cch
+24 mn 006300630068
+24 mx 006300630068
+24 sp --------------------------------
+25 a aaa_
+25 mn 0061006100610000
+25 mx 006100610061FFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 0063006300630000
+26 mx 006300630063FFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 0063006300680000
+27 mx 006300630068FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00610061006100000000000000000000
+28 mx 006100610061FFFFFFFFFFFFFFFFFFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00630063006300000000000000000000
+29 mx 006300630063FFFFFFFFFFFFFFFFFFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00630063006800000000000000000000
+30 mx 006300630068FFFFFFFFFFFFFFFFFFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 0061006100610061
+31 mx 0061006100610061
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_ci;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 0009
+2 mx FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00090009000900090009000900090009
+3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+3 sp --------------------------------
+4 a \_
+4 mn 005F
+4 mx 005F
+4 sp --------------------------------
+5 a \%
+5 mn 0025
+5 mx 0025
+5 sp --------------------------------
+6 a \
+6 mn 005C
+6 mx 005C
+6 sp --------------------------------
+7 a a
+7 mn 0061
+7 mx 0061
+7 sp --------------------------------
+8 a c
+8 mn 0063
+8 mx 0063
+8 sp --------------------------------
+9 a a_
+9 mn 00610009
+9 mx 0061FFFF
+9 sp --------------------------------
+10 a c_
+10 mn 00630009
+10 mx 0063FFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00610009000900090009000900090009
+11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00630009000900090009000900090009
+12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+12 sp --------------------------------
+13 a aa
+13 mn 00610061
+13 mx 00610061
+13 sp --------------------------------
+14 a cc
+14 mn 00630063
+14 mx 00630063
+14 sp --------------------------------
+15 a ch
+15 mn 00630068
+15 mx 00630068
+15 sp --------------------------------
+16 a aa_
+16 mn 006100610009
+16 mx 00610061FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 006300630009
+17 mx 00630063FFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 006300680009
+18 mx 00630068FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00610061000900090009000900090009
+19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00630063000900090009000900090009
+20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00630068000900090009000900090009
+21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 006100610061
+22 mx 006100610061
+22 sp --------------------------------
+23 a ccc
+23 mn 006300630063
+23 mx 006300630063
+23 sp --------------------------------
+24 a cch
+24 mn 006300630068
+24 mx 006300630068
+24 sp --------------------------------
+25 a aaa_
+25 mn 0061006100610009
+25 mx 006100610061FFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 0063006300630009
+26 mx 006300630063FFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 0063006300680009
+27 mx 006300630068FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00610061006100090009000900090009
+28 mx 006100610061FFFFFFFFFFFFFFFFFFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00630063006300090009000900090009
+29 mx 006300630063FFFFFFFFFFFFFFFFFFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00630063006800090009000900090009
+30 mx 006300630068FFFFFFFFFFFFFFFFFFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 0061006100610061
+31 mx 0061006100610061
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_czech_ci;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 0009
+2 mx FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00090009000900090009000900090009
+3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+3 sp --------------------------------
+4 a \_
+4 mn 005F
+4 mx 005F
+4 sp --------------------------------
+5 a \%
+5 mn 0025
+5 mx 0025
+5 sp --------------------------------
+6 a \
+6 mn 005C
+6 mx 005C
+6 sp --------------------------------
+7 a a
+7 mn 0061
+7 mx 0061
+7 sp --------------------------------
+8 a c
+8 mn 0063
+8 mx 0063
+8 sp --------------------------------
+9 a a_
+9 mn 00610009
+9 mx 0061FFFF
+9 sp --------------------------------
+10 a c_
+10 mn 00090009000900090009000900090009
+10 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00610009000900090009000900090009
+11 mx 0061FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00090009000900090009000900090009
+12 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+12 sp --------------------------------
+13 a aa
+13 mn 00610061
+13 mx 00610061
+13 sp --------------------------------
+14 a cc
+14 mn 00630063
+14 mx 00630063
+14 sp --------------------------------
+15 a ch
+15 mn 00630068
+15 mx 00630068
+15 sp --------------------------------
+16 a aa_
+16 mn 006100610009
+16 mx 00610061FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 00630009000900090009000900090009
+17 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 006300680009
+18 mx 00630068FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00610061000900090009000900090009
+19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00630009000900090009000900090009
+20 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00630068000900090009000900090009
+21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 006100610061
+22 mx 006100610061
+22 sp --------------------------------
+23 a ccc
+23 mn 006300630063
+23 mx 006300630063
+23 sp --------------------------------
+24 a cch
+24 mn 006300630068
+24 mx 006300630068
+24 sp --------------------------------
+25 a aaa_
+25 mn 0061006100610009
+25 mx 006100610061FFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 00630063000900090009000900090009
+26 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 0063006300680009
+27 mx 006300630068FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00610061006100090009000900090009
+28 mx 006100610061FFFFFFFFFFFFFFFFFFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00630063000900090009000900090009
+29 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00630063006800090009000900090009
+30 mx 006300630068FFFFFFFFFFFFFFFFFFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 0061006100610061
+31 mx 0061006100610061
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_danish_ci;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 0009
+2 mx FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00090009000900090009000900090009
+3 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+3 sp --------------------------------
+4 a \_
+4 mn 005F
+4 mx 005F
+4 sp --------------------------------
+5 a \%
+5 mn 0025
+5 mx 0025
+5 sp --------------------------------
+6 a \
+6 mn 005C
+6 mx 005C
+6 sp --------------------------------
+7 a a
+7 mn 0061
+7 mx 0061
+7 sp --------------------------------
+8 a c
+8 mn 0063
+8 mx 0063
+8 sp --------------------------------
+9 a a_
+9 mn 00090009000900090009000900090009
+9 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+9 sp --------------------------------
+10 a c_
+10 mn 00630009
+10 mx 0063FFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00090009000900090009000900090009
+11 mx FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00630009000900090009000900090009
+12 mx 0063FFFFFFFFFFFFFFFFFFFFFFFFFFFF
+12 sp --------------------------------
+13 a aa
+13 mn 00610061
+13 mx 00610061
+13 sp --------------------------------
+14 a cc
+14 mn 00630063
+14 mx 00630063
+14 sp --------------------------------
+15 a ch
+15 mn 00630068
+15 mx 00630068
+15 sp --------------------------------
+16 a aa_
+16 mn 006100610009
+16 mx 00610061FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 006300630009
+17 mx 00630063FFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 006300680009
+18 mx 00630068FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00610061000900090009000900090009
+19 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00630063000900090009000900090009
+20 mx 00630063FFFFFFFFFFFFFFFFFFFFFFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00630068000900090009000900090009
+21 mx 00630068FFFFFFFFFFFFFFFFFFFFFFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 006100610061
+22 mx 006100610061
+22 sp --------------------------------
+23 a ccc
+23 mn 006300630063
+23 mx 006300630063
+23 sp --------------------------------
+24 a cch
+24 mn 006300630068
+24 mx 006300630068
+24 sp --------------------------------
+25 a aaa_
+25 mn 00610061000900090009000900090009
+25 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 0063006300630009
+26 mx 006300630063FFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 0063006300680009
+27 mx 006300630068FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00610061000900090009000900090009
+28 mx 00610061FFFFFFFFFFFFFFFFFFFFFFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00630063006300090009000900090009
+29 mx 006300630063FFFFFFFFFFFFFFFFFFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00630063006800090009000900090009
+30 mx 006300630068FFFFFFFFFFFFFFFFFFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 0061006100610061
+31 mx 0061006100610061
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 00000000
+2 mx 0000FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00000000000000000000000000000000
+3 mx 0000FFFF0000FFFF0000FFFF0000FFFF
+3 sp --------------------------------
+4 a \_
+4 mn 0000005F
+4 mx 0000005F
+4 sp --------------------------------
+5 a \%
+5 mn 00000025
+5 mx 00000025
+5 sp --------------------------------
+6 a \
+6 mn 0000005C
+6 mx 0000005C
+6 sp --------------------------------
+7 a a
+7 mn 00000061
+7 mx 00000061
+7 sp --------------------------------
+8 a c
+8 mn 00000063
+8 mx 00000063
+8 sp --------------------------------
+9 a a_
+9 mn 0000006100000000
+9 mx 000000610000FFFF
+9 sp --------------------------------
+10 a c_
+10 mn 0000006300000000
+10 mx 000000630000FFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00000061000000000000000000000000
+11 mx 000000610000FFFF0000FFFF0000FFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00000063000000000000000000000000
+12 mx 000000630000FFFF0000FFFF0000FFFF
+12 sp --------------------------------
+13 a aa
+13 mn 0000006100000061
+13 mx 0000006100000061
+13 sp --------------------------------
+14 a cc
+14 mn 0000006300000063
+14 mx 0000006300000063
+14 sp --------------------------------
+15 a ch
+15 mn 0000006300000068
+15 mx 0000006300000068
+15 sp --------------------------------
+16 a aa_
+16 mn 000000610000006100000000
+16 mx 00000061000000610000FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 000000630000006300000000
+17 mx 00000063000000630000FFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 000000630000006800000000
+18 mx 00000063000000680000FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00000061000000610000000000000000
+19 mx 00000061000000610000FFFF0000FFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00000063000000630000000000000000
+20 mx 00000063000000630000FFFF0000FFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00000063000000680000000000000000
+21 mx 00000063000000680000FFFF0000FFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 000000610000006100000061
+22 mx 000000610000006100000061
+22 sp --------------------------------
+23 a ccc
+23 mn 000000630000006300000063
+23 mx 000000630000006300000063
+23 sp --------------------------------
+24 a cch
+24 mn 000000630000006300000068
+24 mx 000000630000006300000068
+24 sp --------------------------------
+25 a aaa_
+25 mn 00000061000000610000006100000000
+25 mx 0000006100000061000000610000FFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 00000063000000630000006300000000
+26 mx 0000006300000063000000630000FFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 00000063000000630000006800000000
+27 mx 0000006300000063000000680000FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00000061000000610000006100000000
+28 mx 0000006100000061000000610000FFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00000063000000630000006300000000
+29 mx 0000006300000063000000630000FFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00000063000000630000006800000000
+30 mx 0000006300000063000000680000FFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 00000061000000610000006100000061
+31 mx 00000061000000610000006100000061
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_ci;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 00000009
+2 mx 0000FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00000009000000090000000900000009
+3 mx 0000FFFF0000FFFF0000FFFF0000FFFF
+3 sp --------------------------------
+4 a \_
+4 mn 0000005F
+4 mx 0000005F
+4 sp --------------------------------
+5 a \%
+5 mn 00000025
+5 mx 00000025
+5 sp --------------------------------
+6 a \
+6 mn 0000005C
+6 mx 0000005C
+6 sp --------------------------------
+7 a a
+7 mn 00000061
+7 mx 00000061
+7 sp --------------------------------
+8 a c
+8 mn 00000063
+8 mx 00000063
+8 sp --------------------------------
+9 a a_
+9 mn 0000006100000009
+9 mx 000000610000FFFF
+9 sp --------------------------------
+10 a c_
+10 mn 0000006300000009
+10 mx 000000630000FFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00000061000000090000000900000009
+11 mx 000000610000FFFF0000FFFF0000FFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00000063000000090000000900000009
+12 mx 000000630000FFFF0000FFFF0000FFFF
+12 sp --------------------------------
+13 a aa
+13 mn 0000006100000061
+13 mx 0000006100000061
+13 sp --------------------------------
+14 a cc
+14 mn 0000006300000063
+14 mx 0000006300000063
+14 sp --------------------------------
+15 a ch
+15 mn 0000006300000068
+15 mx 0000006300000068
+15 sp --------------------------------
+16 a aa_
+16 mn 000000610000006100000009
+16 mx 00000061000000610000FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 000000630000006300000009
+17 mx 00000063000000630000FFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 000000630000006800000009
+18 mx 00000063000000680000FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00000061000000610000000900000009
+19 mx 00000061000000610000FFFF0000FFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00000063000000630000000900000009
+20 mx 00000063000000630000FFFF0000FFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00000063000000680000000900000009
+21 mx 00000063000000680000FFFF0000FFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 000000610000006100000061
+22 mx 000000610000006100000061
+22 sp --------------------------------
+23 a ccc
+23 mn 000000630000006300000063
+23 mx 000000630000006300000063
+23 sp --------------------------------
+24 a cch
+24 mn 000000630000006300000068
+24 mx 000000630000006300000068
+24 sp --------------------------------
+25 a aaa_
+25 mn 00000061000000610000006100000009
+25 mx 0000006100000061000000610000FFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 00000063000000630000006300000009
+26 mx 0000006300000063000000630000FFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 00000063000000630000006800000009
+27 mx 0000006300000063000000680000FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00000061000000610000006100000009
+28 mx 0000006100000061000000610000FFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00000063000000630000006300000009
+29 mx 0000006300000063000000630000FFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00000063000000630000006800000009
+30 mx 0000006300000063000000680000FFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 00000061000000610000006100000061
+31 mx 00000061000000610000006100000061
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_czech_ci;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 00000009
+2 mx 0000FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00000009000000090000000900000009
+3 mx 0000FFFF0000FFFF0000FFFF0000FFFF
+3 sp --------------------------------
+4 a \_
+4 mn 0000005F
+4 mx 0000005F
+4 sp --------------------------------
+5 a \%
+5 mn 00000025
+5 mx 00000025
+5 sp --------------------------------
+6 a \
+6 mn 0000005C
+6 mx 0000005C
+6 sp --------------------------------
+7 a a
+7 mn 00000061
+7 mx 00000061
+7 sp --------------------------------
+8 a c
+8 mn 00000063
+8 mx 00000063
+8 sp --------------------------------
+9 a a_
+9 mn 0000006100000009
+9 mx 000000610000FFFF
+9 sp --------------------------------
+10 a c_
+10 mn 00000009000000090000000900000009
+10 mx 0000FFFF0000FFFF0000FFFF0000FFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00000061000000090000000900000009
+11 mx 000000610000FFFF0000FFFF0000FFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00000009000000090000000900000009
+12 mx 0000FFFF0000FFFF0000FFFF0000FFFF
+12 sp --------------------------------
+13 a aa
+13 mn 0000006100000061
+13 mx 0000006100000061
+13 sp --------------------------------
+14 a cc
+14 mn 0000006300000063
+14 mx 0000006300000063
+14 sp --------------------------------
+15 a ch
+15 mn 0000006300000068
+15 mx 0000006300000068
+15 sp --------------------------------
+16 a aa_
+16 mn 000000610000006100000009
+16 mx 00000061000000610000FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 00000063000000090000000900000009
+17 mx 000000630000FFFF0000FFFF0000FFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 000000630000006800000009
+18 mx 00000063000000680000FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00000061000000610000000900000009
+19 mx 00000061000000610000FFFF0000FFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00000063000000090000000900000009
+20 mx 000000630000FFFF0000FFFF0000FFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00000063000000680000000900000009
+21 mx 00000063000000680000FFFF0000FFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 000000610000006100000061
+22 mx 000000610000006100000061
+22 sp --------------------------------
+23 a ccc
+23 mn 000000630000006300000063
+23 mx 000000630000006300000063
+23 sp --------------------------------
+24 a cch
+24 mn 000000630000006300000068
+24 mx 000000630000006300000068
+24 sp --------------------------------
+25 a aaa_
+25 mn 00000061000000610000006100000009
+25 mx 0000006100000061000000610000FFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 00000063000000630000000900000009
+26 mx 00000063000000630000FFFF0000FFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 00000063000000630000006800000009
+27 mx 0000006300000063000000680000FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00000061000000610000006100000009
+28 mx 0000006100000061000000610000FFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00000063000000630000000900000009
+29 mx 00000063000000630000FFFF0000FFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00000063000000630000006800000009
+30 mx 0000006300000063000000680000FFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 00000061000000610000006100000061
+31 mx 00000061000000610000006100000061
+31 sp --------------------------------
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_danish_ci;
+SELECT * FROM v1;
+id name val
+1 a
+1 mn
+1 mx
+1 sp --------------------------------
+2 a _
+2 mn 00000009
+2 mx 0000FFFF
+2 sp --------------------------------
+3 a %
+3 mn 00000009000000090000000900000009
+3 mx 0000FFFF0000FFFF0000FFFF0000FFFF
+3 sp --------------------------------
+4 a \_
+4 mn 0000005F
+4 mx 0000005F
+4 sp --------------------------------
+5 a \%
+5 mn 00000025
+5 mx 00000025
+5 sp --------------------------------
+6 a \
+6 mn 0000005C
+6 mx 0000005C
+6 sp --------------------------------
+7 a a
+7 mn 00000061
+7 mx 00000061
+7 sp --------------------------------
+8 a c
+8 mn 00000063
+8 mx 00000063
+8 sp --------------------------------
+9 a a_
+9 mn 00000009000000090000000900000009
+9 mx 0000FFFF0000FFFF0000FFFF0000FFFF
+9 sp --------------------------------
+10 a c_
+10 mn 0000006300000009
+10 mx 000000630000FFFF
+10 sp --------------------------------
+11 a a%
+11 mn 00000009000000090000000900000009
+11 mx 0000FFFF0000FFFF0000FFFF0000FFFF
+11 sp --------------------------------
+12 a c%
+12 mn 00000063000000090000000900000009
+12 mx 000000630000FFFF0000FFFF0000FFFF
+12 sp --------------------------------
+13 a aa
+13 mn 0000006100000061
+13 mx 0000006100000061
+13 sp --------------------------------
+14 a cc
+14 mn 0000006300000063
+14 mx 0000006300000063
+14 sp --------------------------------
+15 a ch
+15 mn 0000006300000068
+15 mx 0000006300000068
+15 sp --------------------------------
+16 a aa_
+16 mn 000000610000006100000009
+16 mx 00000061000000610000FFFF
+16 sp --------------------------------
+17 a cc_
+17 mn 000000630000006300000009
+17 mx 00000063000000630000FFFF
+17 sp --------------------------------
+18 a ch_
+18 mn 000000630000006800000009
+18 mx 00000063000000680000FFFF
+18 sp --------------------------------
+19 a aa%
+19 mn 00000061000000610000000900000009
+19 mx 00000061000000610000FFFF0000FFFF
+19 sp --------------------------------
+20 a cc%
+20 mn 00000063000000630000000900000009
+20 mx 00000063000000630000FFFF0000FFFF
+20 sp --------------------------------
+21 a ch%
+21 mn 00000063000000680000000900000009
+21 mx 00000063000000680000FFFF0000FFFF
+21 sp --------------------------------
+22 a aaa
+22 mn 000000610000006100000061
+22 mx 000000610000006100000061
+22 sp --------------------------------
+23 a ccc
+23 mn 000000630000006300000063
+23 mx 000000630000006300000063
+23 sp --------------------------------
+24 a cch
+24 mn 000000630000006300000068
+24 mx 000000630000006300000068
+24 sp --------------------------------
+25 a aaa_
+25 mn 00000061000000610000000900000009
+25 mx 00000061000000610000FFFF0000FFFF
+25 sp --------------------------------
+26 a ccc_
+26 mn 00000063000000630000006300000009
+26 mx 0000006300000063000000630000FFFF
+26 sp --------------------------------
+27 a cch_
+27 mn 00000063000000630000006800000009
+27 mx 0000006300000063000000680000FFFF
+27 sp --------------------------------
+28 a aaa%
+28 mn 00000061000000610000000900000009
+28 mx 00000061000000610000FFFF0000FFFF
+28 sp --------------------------------
+29 a ccc%
+29 mn 00000063000000630000006300000009
+29 mx 0000006300000063000000630000FFFF
+29 sp --------------------------------
+30 a cch%
+30 mn 00000063000000630000006800000009
+30 mx 0000006300000063000000680000FFFF
+30 sp --------------------------------
+31 a aaaaaaaaaaaaaaaaaaaa
+31 mn 00000061000000610000006100000061
+31 mx 00000061000000610000006100000061
+31 sp --------------------------------
+DROP VIEW v1;
+DROP TABLE t1;
diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result
index 4730b4df668..4ea5efab159 100644
--- a/mysql-test/r/ctype_many.result
+++ b/mysql-test/r/ctype_many.result
@@ -1684,6 +1684,24 @@ ARMENIAN CAPIT ECH 2
ARMENIAN CAPIT ZA 2
DROP TABLE t1;
#
+# Start of 5.1 tests
+#
+#
+# Bug#58371 Assertion failed: !s.uses_buffer_owned_by(this) with format string function
+#
+SET NAMES latin1;
+DO CONVERT(CAST(SUBSTRING_INDEX(FORMAT(1,'1111'), FORMAT('','Zpq'),1)
+AS BINARY(0)) USING utf8);
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'Zpq'
+Warning 1292 Truncated incorrect BINARY(0) value: '1.'
+#
+# End of 5.1 tests
+#
+#
+# Start of 5.5 tests
+#
+#
# WL#1213 Implement 4-byte UTF8, UTF16 and UTF32
# Testing that only utf8mb4 is superset for utf8
# No other Unicode character set pairs have superset/subset relations
@@ -1739,3 +1757,22 @@ ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf8mb4_
SELECT CHARSET(CONCAT(utf32, utf16)) FROM t1;
ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat'
DROP TABLE t1;
+#
+# Bug#58321 No warning when characters outside BMP0 is converted to UCS2
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32);
+CREATE TABLE t2 (a VARCHAR(10) CHARACTER SET ucs2);
+INSERT INTO t1 VALUES (0x10082), (0x12345);
+INSERT INTO t2 SELECT * FROM t1;
+Warnings:
+Warning 1366 Incorrect string value: '\x00\x01\x00\x82' for column 'a' at row 1
+Warning 1366 Incorrect string value: '\x00\x01\x23\x45' for column 'a' at row 2
+SELECT HEX(a) FROM t2;
+HEX(a)
+003F
+003F
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result
index 78827b5b907..abeb19c0c8f 100644
--- a/mysql-test/r/ctype_sjis.result
+++ b/mysql-test/r/ctype_sjis.result
@@ -218,6 +218,12 @@ hex(a) hex(lower(a)) hex(upper(a))
8352835E 8352835E 8352835E
8372835E 8372835E 8372835E
DROP TABLE t1;
+#
+# Bug#11766519 - Bug#59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED.
+#
+SELECT QUOTE('ƒ\');
+QUOTE('ƒ\')
+'ƒ\'
# End of 5.1 tests
#
# Start of 5.5 tests
diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result
index d51cd2b1d06..7afcc0ef049 100644
--- a/mysql-test/r/ctype_uca.result
+++ b/mysql-test/r/ctype_uca.result
@@ -3007,3 +3007,101 @@ a hex(b) c
DROP TABLE t1;
set names utf8;
End for 5.0 tests
+#
+# Start of 5.5 tests
+#
+SET collation_connection=utf8_czech_ci;
+SELECT @@collation_connection;
+@@collation_connection
+utf8_czech_ci
+#
+# Bug#57737 Character sets: search fails with like, contraction, index
+#
+CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0;
+INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch');
+SELECT * FROM t1 WHERE s1 LIKE 'c%';
+s1
+c
+ce
+cé
+ch
+ALTER TABLE t1 ADD KEY s1 (s1);
+SELECT * FROM t1 WHERE s1 LIKE 'c%';
+s1
+c
+ce
+cé
+ch
+ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1));
+SELECT * FROM t1 WHERE s1 LIKE 'ch';
+s1
+ch
+DROP TABLE t1;
+SELECT @@collation_connection;
+@@collation_connection
+utf8_czech_ci
+#
+# Bug#57737 Character sets: search fails with like, contraction, index
+# Part#2 - ignorable characters
+#
+CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0;
+INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e');
+SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%';
+HEX(s1)
+61000000000009
+61
+ALTER TABLE t1 ADD KEY s1 (s1);
+SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%';
+HEX(s1)
+61000000000009
+61
+DROP TABLE t1;
+SET collation_connection=ucs2_czech_ci;
+SELECT @@collation_connection;
+@@collation_connection
+ucs2_czech_ci
+#
+# Bug#57737 Character sets: search fails with like, contraction, index
+#
+CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0;
+INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch');
+SELECT * FROM t1 WHERE s1 LIKE 'c%';
+s1
+c
+ce
+cé
+ch
+ALTER TABLE t1 ADD KEY s1 (s1);
+SELECT * FROM t1 WHERE s1 LIKE 'c%';
+s1
+c
+ce
+cé
+ch
+ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1));
+SELECT * FROM t1 WHERE s1 LIKE 'ch';
+s1
+ch
+DROP TABLE t1;
+SELECT @@collation_connection;
+@@collation_connection
+ucs2_czech_ci
+#
+# Bug#57737 Character sets: search fails with like, contraction, index
+# Part#2 - ignorable characters
+#
+CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0;
+INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e');
+SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%';
+HEX(s1)
+0061000000000000000000000009
+0061
+ALTER TABLE t1 ADD KEY s1 (s1);
+SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%';
+HEX(s1)
+0061000000000000000000000009
+0061
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index 8d35cf445e8..2dad45e5639 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -990,8 +990,8 @@ old_password(name)
14e500b131773991
select quote(name) from bug20536;
quote(name)
-????????
-????????????????
+'test1'
+'\'test\\_2\''
drop table bug20536;
set names ucs2;
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2'
@@ -1238,6 +1238,17 @@ CREATE VIEW v1 AS SELECT 1 from t1
WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1'));
DROP VIEW v1;
DROP TABLE t1;
+#
+# Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
+#
+SELECT HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850));
+HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850))
+00
+SELECT CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED);
+CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED)
+0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: ''
End of 5.0 tests
#
# Start of 5.1 tests
@@ -2717,7 +2728,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(extract(year from 20090702)));
@@ -3338,7 +3349,7 @@ create table t2 as select concat(a) from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `concat(a)` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
+ `concat(a)` varchar(4) CHARACTER SET ucs2 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
create table t1 (a year);
@@ -3647,7 +3658,7 @@ insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;
Field Type Null Key Default Extra
-a varchar(2) YES NULL
+a varchar(4) YES NULL
select hex(a) from v1;
hex(a)
00300031
@@ -3903,6 +3914,9 @@ GROUP_CONCAT(IFNULL(a,''))
SELECT GROUP_CONCAT(IF(a,a,'')) FROM t1;
GROUP_CONCAT(IF(a,a,''))
1234567
+SELECT GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END) FROM t1;
+GROUP_CONCAT(CASE WHEN a THEN a ELSE '' END)
+1234567
SELECT COALESCE(a,'') FROM t1 GROUP BY 1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def COALESCE(a,'') 253 9 7 Y 0 31 8
@@ -4037,6 +4051,91 @@ DROP TABLE t1;
# End of Bug#54916
#
#
+# Bug#58190 BETWEEN no longer uses indexes for date or datetime fields
+#
+SELECT @@collation_connection;
+@@collation_connection
+ucs2_general_ci
+CREATE TABLE t1 (
+id INT(11) DEFAULT NULL,
+date_column DATE DEFAULT NULL,
+KEY(date_column));
+INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
+EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
+ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
+EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
+DROP TABLE t1;
+#
+# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
+#
+SELECT @@collation_connection, @@character_set_results;
+@@collation_connection @@character_set_results
+ucs2_general_ci latin1
+CREATE TABLE t1 AS
+SELECT
+DATE_SUB('2007-08-03', INTERVAL 1 MINUTE) AS field_str1,
+DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS field1_str2,
+DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY) AS field_date,
+DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE) AS field_datetime;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `field_str1` varchar(29) CHARACTER SET ucs2 DEFAULT NULL,
+ `field1_str2` varchar(29) CHARACTER SET ucs2 DEFAULT NULL,
+ `field_date` date DEFAULT NULL,
+ `field_datetime` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+SELECT
+DATE_SUB('2007-08-03', INTERVAL 1 DAY) AS field_str1,
+DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS field1_str2,
+DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY) AS field_date,
+DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE) AS field_datetime;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def field_str1 254 29 10 Y 0 31 8
+def field1_str2 254 29 19 Y 0 31 8
+def field_date 10 29 10 Y 128 31 63
+def field_datetime 12 29 19 Y 128 31 63
+field_str1 field1_str2 field_date field_datetime
+2007-08-02 2007-08-03 17:32:00 2007-08-02 2007-08-03 17:32:00
+SELECT
+HEX(DATE_SUB('2007-08-03', INTERVAL 1 MINUTE)) AS field_str1,
+HEX(DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE)) AS field1_str2,
+HEX(DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY)) AS field_date,
+HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS field_datetime;
+field_str1 field1_str2 field_date field_datetime
+0032003000300037002D00300038002D00300032002000320033003A00350039003A00300030 0032003000300037002D00300038002D00300033002000310037003A00330032003A00300030 323030372D30382D3032 323030372D30382D30332031373A33323A3030
+#
+# Bug#11926811 / Bug#60625 Illegal mix of collations
+#
+SELECT @@collation_connection;
+@@collation_connection
+ucs2_general_ci
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE v_LastPaymentDate DATETIME DEFAULT NULL;
+SELECT v_LastPaymentDate < NOW();
+EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW();
+SHOW WARNINGS;
+EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW());
+END//
+CALL p1;
+v_LastPaymentDate < NOW()
+NULL
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Level Code Message
+Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
+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 concat(convert(v_LastPaymentDate@0 using ucs2),convert(now() using ucs2)) AS `CONCAT(v_LastPaymentDate, NOW())`
+DROP PROCEDURE p1;
+#
# Bug#52159 returning time type from function and empty left join causes debug assertion
#
CREATE FUNCTION f1() RETURNS TIME RETURN 1;
diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result
index 946aa1c780e..b801a7f45a4 100644
--- a/mysql-test/r/ctype_ujis.result
+++ b/mysql-test/r/ctype_ujis.result
@@ -2374,6 +2374,16 @@ hex(convert(_latin1 0xA4A2 using ujis)) hex(c2)
DROP PROCEDURE sp1;
DROP TABLE t1;
DROP TABLE t2;
+#
+# Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
+#
+SET NAMES utf8;
+SELECT CONVERT(REPLACE(EXPORT_SET('a','a','a','','a'),'00','') USING ujis);
+CONVERT(REPLACE(EXPORT_SET('a','a','a','','a'),'00','') USING ujis)
+
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'a'
+Warning 1292 Truncated incorrect INTEGER value: 'a'
set names default;
set character_set_database=default;
set character_set_server=default;
diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result
index 0d5280950df..07308c8e0e0 100644
--- a/mysql-test/r/ctype_utf16.result
+++ b/mysql-test/r/ctype_utf16.result
@@ -31,13 +31,13 @@ binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a'
1 1 1
select hex(_utf16 0x44);
hex(_utf16 0x44)
-00000044
+0044
select hex(_utf16 0x3344);
hex(_utf16 0x3344)
3344
select hex(_utf16 0x113344);
hex(_utf16 0x113344)
-000000113344
+00113344
CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf16;
INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004');
SELECT hex(word) FROM t1 ORDER BY word;
@@ -435,10 +435,10 @@ aardvarz
DROP TABLE t1;
SELECT hex(cast(0xAA as char character set utf16));
hex(cast(0xAA as char character set utf16))
-000000AA
+00AA
SELECT hex(convert(0xAA using utf16));
hex(convert(0xAA using utf16))
-000000AA
+00AA
CREATE TABLE t1 (a char(10) character set utf16);
INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111);
SELECT HEX(a) FROM t1;
@@ -626,16 +626,16 @@ INSERT INTO t1 VALUES (_utf8mb4 0xCE85),(_utf8mb4 0xF4808080);
SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a;
HEX(a) HEX(CONVERT(a USING utf8mb4))
0385 CE85
+FF9D EFBE9D
D800DF84 F0908E84
DBC0DC00 F4808080
-FF9D EFBE9D
ALTER TABLE t1 ADD KEY(a);
SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a;
HEX(a) HEX(CONVERT(a USING utf8mb4))
0385 CE85
+FF9D EFBE9D
D800DF84 F0908E84
DBC0DC00 F4808080
-FF9D EFBE9D
DROP TABLE IF EXISTS t1;
select @@collation_connection;
@@collation_connection
@@ -1103,5 +1103,20 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
#
+# Bug#11753363 (Bug#44793) Character sets: case clause, ucs2 or utf32, failure
+#
+SELECT CASE _latin1'a' WHEN _utf16'a' THEN 'A' END;
+CASE _latin1'a' WHEN _utf16'a' THEN 'A' END
+A
+SELECT CASE _utf16'a' WHEN _latin1'a' THEN 'A' END;
+CASE _utf16'a' WHEN _latin1'a' THEN 'A' END
+A
+CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf16);
+INSERT INTO t1 VALUES ('a');
+SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1;
+CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END
+b
+DROP TABLE t1;
+#
# End of 5.5 tests
#
diff --git a/mysql-test/r/ctype_utf16_uca.result b/mysql-test/r/ctype_utf16_uca.result
index d83ef2af09e..18adaf2f79c 100644
--- a/mysql-test/r/ctype_utf16_uca.result
+++ b/mysql-test/r/ctype_utf16_uca.result
@@ -2368,6 +2368,52 @@ NULL
NULL
NULL
drop table t1;
+SET collation_connection=utf16_czech_ci;
+SELECT @@collation_connection;
+@@collation_connection
+utf16_czech_ci
+#
+# Bug#57737 Character sets: search fails with like, contraction, index
+#
+CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0;
+INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch');
+SELECT * FROM t1 WHERE s1 LIKE 'c%';
+s1
+c
+ce
+cé
+ch
+ALTER TABLE t1 ADD KEY s1 (s1);
+SELECT * FROM t1 WHERE s1 LIKE 'c%';
+s1
+c
+ce
+cé
+ch
+ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1));
+SELECT * FROM t1 WHERE s1 LIKE 'ch';
+s1
+ch
+DROP TABLE t1;
+SELECT @@collation_connection;
+@@collation_connection
+utf16_czech_ci
+#
+# Bug#57737 Character sets: search fails with like, contraction, index
+# Part#2 - ignorable characters
+#
+CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0;
+INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e');
+SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%';
+HEX(s1)
+0061000000000000000000000009
+0061
+ALTER TABLE t1 ADD KEY s1 (s1);
+SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%';
+HEX(s1)
+0061000000000000000000000009
+0061
+DROP TABLE t1;
#
# End of 5.5 tests
#
diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result
index cca4efd1571..7d9db0cc41e 100644
--- a/mysql-test/r/ctype_utf32.result
+++ b/mysql-test/r/ctype_utf32.result
@@ -1153,5 +1153,20 @@ d
f
DROP TABLE t1;
#
+# Bug#11753363 (Bug#44793) Character sets: case clause, ucs2 or utf32, failure
+#
+SELECT CASE _latin1'a' WHEN _utf32'a' THEN 'A' END;
+CASE _latin1'a' WHEN _utf32'a' THEN 'A' END
+A
+SELECT CASE _utf32'a' WHEN _latin1'a' THEN 'A' END;
+CASE _utf32'a' WHEN _latin1'a' THEN 'A' END
+A
+CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf32);
+INSERT INTO t1 VALUES ('a');
+SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1;
+CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END
+b
+DROP TABLE t1;
+#
# End of 5.5 tests
#
diff --git a/mysql-test/r/ctype_utf32_uca.result b/mysql-test/r/ctype_utf32_uca.result
index 5006009fc9c..fd5a4199217 100644
--- a/mysql-test/r/ctype_utf32_uca.result
+++ b/mysql-test/r/ctype_utf32_uca.result
@@ -2368,6 +2368,52 @@ NULL
NULL
NULL
drop table t1;
+SET collation_connection=utf32_czech_ci;
+SELECT @@collation_connection;
+@@collation_connection
+utf32_czech_ci
+#
+# Bug#57737 Character sets: search fails with like, contraction, index
+#
+CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0;
+INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch');
+SELECT * FROM t1 WHERE s1 LIKE 'c%';
+s1
+c
+ce
+cé
+ch
+ALTER TABLE t1 ADD KEY s1 (s1);
+SELECT * FROM t1 WHERE s1 LIKE 'c%';
+s1
+c
+ce
+cé
+ch
+ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1));
+SELECT * FROM t1 WHERE s1 LIKE 'ch';
+s1
+ch
+DROP TABLE t1;
+SELECT @@collation_connection;
+@@collation_connection
+utf32_czech_ci
+#
+# Bug#57737 Character sets: search fails with like, contraction, index
+# Part#2 - ignorable characters
+#
+CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0;
+INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e');
+SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%';
+HEX(s1)
+00000061000000000000000000000000000000000000000000000009
+00000061
+ALTER TABLE t1 ADD KEY s1 (s1);
+SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%';
+HEX(s1)
+00000061000000000000000000000000000000000000000000000009
+00000061
+DROP TABLE t1;
#
# End of 5.5 tests
#
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 4c3b661ce90..930917b3268 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1901,6 +1901,37 @@ CONVERT(a, CHAR) CONVERT(b, CHAR)
70000 1092
DROP TABLE t1;
End of 5.0 tests
+SELECT LENGTH(RPAD(0.0115E88, 61297, _utf8'ÑÑÑŽÑ'));
+LENGTH(RPAD(0.0115E88, 61297, _utf8'ÑÑÑŽÑ'))
+122587
+SELECT LENGTH(RPAD(0.0115E88, 61297, _utf8'йцуÑ'));
+LENGTH(RPAD(0.0115E88, 61297, _utf8'йцуÑ'))
+122587
+SELECT HEX(RPAD(0x20, 2, _utf8 0xD18F));
+HEX(RPAD(0x20, 2, _utf8 0xD18F))
+20D1
+SELECT HEX(RPAD(0x20, 4, _utf8 0xD18F));
+HEX(RPAD(0x20, 4, _utf8 0xD18F))
+20D18FD1
+SELECT HEX(LPAD(0x20, 2, _utf8 0xD18F));
+HEX(LPAD(0x20, 2, _utf8 0xD18F))
+D120
+SELECT HEX(LPAD(0x20, 4, _utf8 0xD18F));
+HEX(LPAD(0x20, 4, _utf8 0xD18F))
+D18FD120
+SELECT HEX(RPAD(_utf8 0xD18F, 3, 0x20));
+HEX(RPAD(_utf8 0xD18F, 3, 0x20))
+D18F20
+SELECT HEX(LPAD(_utf8 0xD18F, 3, 0x20));
+HEX(LPAD(_utf8 0xD18F, 3, 0x20))
+20D18F
+SELECT HEX(INSERT(_utf8 0xD18F, 2, 1, 0x20));
+HEX(INSERT(_utf8 0xD18F, 2, 1, 0x20))
+D120
+SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20));
+HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20))
+D120D18E
+End of 5.1 tests
Start of 5.4 tests
SET NAMES utf8mb3;
SHOW VARIABLES LIKE 'character_set_results%';
@@ -2043,6 +2074,20 @@ predicted_order hex(utf8_encoding)
100 E0B78AE2808DE0B6BA
101 E0B78AE2808DE0B6BB
DROP TABLE t1;
+SET NAMES utf8 COLLATE utf8_sinhala_ci;
+CREATE TABLE t1 (s1 VARCHAR(10) COLLATE utf8_sinhala_ci);
+INSERT INTO t1 VALUES ('a'),('ae'),('af');
+SELECT s1,hex(s1) FROM t1 ORDER BY s1;
+s1 hex(s1)
+a 61
+ae 6165
+af 6166
+SELECT * FROM t1 ORDER BY s1;
+s1
+a
+ae
+af
+DROP TABLE t1;
End of 5.4 tests
#
# Start of 5.5 tests
@@ -3515,7 +3560,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
+ `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(extract(year from 20090702)));
@@ -4136,7 +4181,7 @@ create table t2 as select concat(a) from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `concat(a)` varchar(2) CHARACTER SET utf8 DEFAULT NULL
+ `concat(a)` varchar(4) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2;
create table t1 (a year);
@@ -4445,7 +4490,7 @@ insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;
Field Type Null Key Default Extra
-a varchar(2) YES NULL
+a varchar(4) YES NULL
select hex(a) from v1;
hex(a)
3031
@@ -4838,6 +4883,91 @@ DROP TABLE t1;
# End of Bug#54916
#
#
+# Bug#58190 BETWEEN no longer uses indexes for date or datetime fields
+#
+SELECT @@collation_connection;
+@@collation_connection
+utf8_general_ci
+CREATE TABLE t1 (
+id INT(11) DEFAULT NULL,
+date_column DATE DEFAULT NULL,
+KEY(date_column));
+INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
+EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range date_column date_column 4 NULL 1 Using where
+ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
+EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range date_column date_column 9 NULL 1 Using where
+DROP TABLE t1;
+#
+# Bug #31384 DATE_ADD() and DATE_SUB() return binary data
+#
+SELECT @@collation_connection, @@character_set_results;
+@@collation_connection @@character_set_results
+utf8_general_ci utf8
+CREATE TABLE t1 AS
+SELECT
+DATE_SUB('2007-08-03', INTERVAL 1 MINUTE) AS field_str1,
+DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS field1_str2,
+DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY) AS field_date,
+DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE) AS field_datetime;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `field_str1` varchar(29) CHARACTER SET utf8 DEFAULT NULL,
+ `field1_str2` varchar(29) CHARACTER SET utf8 DEFAULT NULL,
+ `field_date` date DEFAULT NULL,
+ `field_datetime` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+SELECT
+DATE_SUB('2007-08-03', INTERVAL 1 DAY) AS field_str1,
+DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE) AS field1_str2,
+DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY) AS field_date,
+DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE) AS field_datetime;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def field_str1 254 87 10 Y 0 31 33
+def field1_str2 254 87 19 Y 0 31 33
+def field_date 10 29 10 Y 128 31 63
+def field_datetime 12 29 19 Y 128 31 63
+field_str1 field1_str2 field_date field_datetime
+2007-08-02 2007-08-03 17:32:00 2007-08-02 2007-08-03 17:32:00
+SELECT
+HEX(DATE_SUB('2007-08-03', INTERVAL 1 MINUTE)) AS field_str1,
+HEX(DATE_SUB('2007-08-03 17:33:00', INTERVAL 1 MINUTE)) AS field1_str2,
+HEX(DATE_SUB(DATE('2007-08-03'), INTERVAL 1 DAY)) AS field_date,
+HEX(DATE_SUB(CAST('2007-08-03 17:33:00' AS DATETIME), INTERVAL 1 MINUTE)) AS field_datetime;
+field_str1 field1_str2 field_date field_datetime
+323030372D30382D30322032333A35393A3030 323030372D30382D30332031373A33323A3030 323030372D30382D3032 323030372D30382D30332031373A33323A3030
+#
+# Bug#11926811 / Bug#60625 Illegal mix of collations
+#
+SELECT @@collation_connection;
+@@collation_connection
+utf8_general_ci
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE v_LastPaymentDate DATETIME DEFAULT NULL;
+SELECT v_LastPaymentDate < NOW();
+EXPLAIN EXTENDED SELECT v_LastPaymentDate < NOW();
+SHOW WARNINGS;
+EXPLAIN EXTENDED SELECT CONCAT(v_LastPaymentDate, NOW());
+END//
+CALL p1;
+v_LastPaymentDate < NOW()
+NULL
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Level Code Message
+Note 1003 select (v_LastPaymentDate@0 < now()) AS `v_LastPaymentDate < NOW()`
+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 concat(convert(v_LastPaymentDate@0 using utf8),now()) AS `CONCAT(v_LastPaymentDate, NOW())`
+DROP PROCEDURE p1;
+#
# Bug#52159 returning time type from function and empty left join causes debug assertion
#
CREATE FUNCTION f1() RETURNS TIME RETURN 1;
@@ -4858,5 +4988,31 @@ maketime(`a`,`a`,`a`)
DROP TABLE t1;
SET sql_mode=default;
#
+# Bug#57687 crash when reporting duplicate group_key error and utf8
+# Make sure to modify this when Bug#58081 is fixed.
+#
+SET NAMES utf8;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (0), (0), (1), (0), (0);
+SELECT COUNT(*) FROM t1, t1 t2
+GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size));
+ERROR 23000: Duplicate entry '107374182410737418241' for key 'group_key'
+DROP TABLE t1;
+#
+# Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters
+#
+SET NAMES latin1;
+EXPLAIN EXTENDED SELECT 'abcdÃÂÃÄÅ', _latin1'abcdÃÂÃÄÅ', _utf8'abcdÃÂÃÄÅ' AS u;
+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 'abcdÃÂÃÄÅ' AS `abcdÃÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÃÂÃÄÅ`,_utf8'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `u`
+SET NAMES utf8;
+EXPLAIN EXTENDED SELECT 'abcdÃÂÃÄÅ', _latin1'abcdÃÂÃÄÅ', _utf8'abcdÃÂÃÄÅ';
+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 'abcdÃÂÃÄÅ' AS `abcdÃÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÃÂÂÃÄÅ`,_utf8'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÃÂÃÄÅ`
+#
# End of 5.5 tests
#
diff --git a/mysql-test/r/ctype_utf8mb4_ndb.result b/mysql-test/r/ctype_utf8mb4_ndb.result
deleted file mode 100644
index 2a11c13ce57..00000000000
--- a/mysql-test/r/ctype_utf8mb4_ndb.result
+++ /dev/null
@@ -1,1876 +0,0 @@
-drop table if exists t1,t2;
-#
-# Start of 5.5 tests
-#
-set names utf8mb4;
-select left(_utf8mb4 0xD0B0D0B1D0B2,1);
-left(_utf8mb4 0xD0B0D0B1D0B2,1)
-а
-select right(_utf8mb4 0xD0B0D0B2D0B2,1);
-right(_utf8mb4 0xD0B0D0B2D0B2,1)
-в
-select locate('he','hello');
-locate('he','hello')
-1
-select locate('he','hello',2);
-locate('he','hello',2)
-0
-select locate('lo','hello',2);
-locate('lo','hello',2)
-4
-select locate('HE','hello');
-locate('HE','hello')
-1
-select locate('HE','hello',2);
-locate('HE','hello',2)
-0
-select locate('LO','hello',2);
-locate('LO','hello',2)
-4
-select locate('HE','hello' collate utf8mb4_bin);
-locate('HE','hello' collate utf8mb4_bin)
-0
-select locate('HE','hello' collate utf8mb4_bin,2);
-locate('HE','hello' collate utf8mb4_bin,2)
-0
-select locate('LO','hello' collate utf8mb4_bin,2);
-locate('LO','hello' collate utf8mb4_bin,2)
-0
-select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D0B1D0B2);
-locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D0B1D0B2)
-2
-select locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2);
-locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2)
-2
-select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2);
-locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2)
-2
-select locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2 collate utf8mb4_bin);
-locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2 collate utf8mb4_bin)
-0
-select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2 collate utf8mb4_bin);
-locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2 collate utf8mb4_bin)
-0
-select length(_utf8mb4 0xD0B1), bit_length(_utf8mb4 0xD0B1), char_length(_utf8mb4 0xD0B1);
-length(_utf8mb4 0xD0B1) bit_length(_utf8mb4 0xD0B1) char_length(_utf8mb4 0xD0B1)
-2 16 1
-select 'a' like 'a';
-'a' like 'a'
-1
-select 'A' like 'a';
-'A' like 'a'
-1
-select 'A' like 'a' collate utf8mb4_bin;
-'A' like 'a' collate utf8mb4_bin
-0
-select _utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%');
-_utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%')
-1
-select convert(_latin1'Günter André' using utf8mb4) like CONVERT(_latin1'GÜNTER%' USING utf8mb4);
-convert(_latin1'G?nter Andr?' using utf8mb4) like CONVERT(_latin1'G?NTER%' USING utf8mb4)
-1
-select CONVERT(_koi8r'×ÁÓÑ' USING utf8mb4) LIKE CONVERT(_koi8r'÷áóñ' USING utf8mb4);
-CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4)
-1
-select CONVERT(_koi8r'÷áóñ' USING utf8mb4) LIKE CONVERT(_koi8r'×ÁÓÑ' USING utf8mb4);
-CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4)
-1
-SELECT 'a' = 'a ';
-'a' = 'a '
-1
-SELECT 'a\0' < 'a';
-'a\0' < 'a'
-1
-SELECT 'a\0' < 'a ';
-'a\0' < 'a '
-1
-SELECT 'a\t' < 'a';
-'a\t' < 'a'
-1
-SELECT 'a\t' < 'a ';
-'a\t' < 'a '
-1
-SELECT 'a' = 'a ' collate utf8mb4_bin;
-'a' = 'a ' collate utf8mb4_bin
-1
-SELECT 'a\0' < 'a' collate utf8mb4_bin;
-'a\0' < 'a' collate utf8mb4_bin
-1
-SELECT 'a\0' < 'a ' collate utf8mb4_bin;
-'a\0' < 'a ' collate utf8mb4_bin
-1
-SELECT 'a\t' < 'a' collate utf8mb4_bin;
-'a\t' < 'a' collate utf8mb4_bin
-1
-SELECT 'a\t' < 'a ' collate utf8mb4_bin;
-'a\t' < 'a ' collate utf8mb4_bin
-1
-CREATE TABLE t1 (a char(10) character set utf8mb4 not null) ENGINE ndb;
-INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
-SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
-hex(a) STRCMP(a,'a') STRCMP(a,'a ')
-61 0 0
-61 0 0
-6100 -1 -1
-6109 -1 -1
-DROP TABLE t1;
-select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
-insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
-this is a test
-select insert("aa",100,1,"b"),insert("aa",1,3,"b");
-insert("aa",100,1,"b") insert("aa",1,3,"b")
-aa b
-select char_length(left(@a:='теÑÑ‚',5)), length(@a), @a;
-char_length(left(@a:='теÑÑ‚',5)) length(@a) @a
-4 8 теÑÑ‚
-create table t1 ENGINE ndb select date_format("2004-01-19 10:10:10", "%Y-%m-%d");
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varchar(10) CHARACTER SET utf8mb4 DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-select * from t1;
-date_format("2004-01-19 10:10:10", "%Y-%m-%d")
-2004-01-19
-drop table t1;
-set names utf8mb4;
-set LC_TIME_NAMES='fr_FR';
-create table t1 (s1 char(20) character set latin1) engine ndb;
-insert into t1 values (date_format('2004-02-02','%M'));
-select hex(s1) from t1;
-hex(s1)
-66E97672696572
-drop table t1;
-create table t1 (s1 char(20) character set koi8r) engine ndb;
-set LC_TIME_NAMES='ru_RU';
-insert into t1 values (date_format('2004-02-02','%M'));
-insert into t1 values (date_format('2004-02-02','%b'));
-insert into t1 values (date_format('2004-02-02','%W'));
-insert into t1 values (date_format('2004-02-02','%a'));
-select hex(s1), s1 from t1;
-hex(s1) s1
-E6C5D7 Фев
-E6C5D7D2C1CCD1 ФевралÑ
-F0CEC4 Пнд
-F0CFCEC5C4C5CCD8CEC9CB Понедельник
-drop table t1;
-set LC_TIME_NAMES='en_US';
-set names koi8r;
-create table t1 (s1 char(1) character set utf8mb4) engine ndb;
-insert into t1 values (_koi8r'ÁÂ');
-Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
-select s1,hex(s1),char_length(s1),octet_length(s1) from t1;
-s1 hex(s1) char_length(s1) octet_length(s1)
-Á D0B0 1 2
-drop table t1;
-create table t1 (s1 tinytext character set utf8mb4) engine ndb;
-Warnings:
-Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
-insert into t1 select repeat('a',300);
-Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
-insert into t1 select repeat('Ñ',300);
-Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
-insert into t1 select repeat('aÑ',300);
-Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
-insert into t1 select repeat('Ña',300);
-Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
-insert into t1 select repeat('ÑÑ',300);
-Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
-select hex(s1) from t1;
-hex(s1)
-616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161
-61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F
-D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61
-D18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18F
-D18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18F
-select length(s1),char_length(s1) from t1;
-length(s1) char_length(s1)
-254 127
-254 127
-255 170
-255 170
-255 255
-drop table t1;
-create table t1 (s1 text character set utf8mb4) engine ndb;
-Warnings:
-Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
-insert into t1 select repeat('a',66000);
-Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
-insert into t1 select repeat('Ñ',66000);
-Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
-insert into t1 select repeat('aÑ',66000);
-Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
-insert into t1 select repeat('Ña',66000);
-Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
-insert into t1 select repeat('ÑÑ',66000);
-Warnings:
-Warning 1265 Data truncated for column 's1' at row 1
-select length(s1),char_length(s1) from t1;
-length(s1) char_length(s1)
-65534 32767
-65534 32767
-65535 43690
-65535 43690
-65535 65535
-drop table t1;
-create table t1 (s1 char(10) character set utf8mb4) engine ndb;
-insert into t1 values (0x41FF);
-Warnings:
-Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
-select hex(s1) from t1;
-hex(s1)
-41
-drop table t1;
-create table t1 (s1 varchar(10) character set utf8mb4) engine ndb;
-insert into t1 values (0x41FF);
-Warnings:
-Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
-select hex(s1) from t1;
-hex(s1)
-41
-drop table t1;
-create table t1 (s1 text character set utf8mb4) engine ndb;
-Warnings:
-Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
-insert into t1 values (0x41FF);
-Warnings:
-Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
-select hex(s1) from t1;
-hex(s1)
-41
-drop table t1;
-create table t1 (a text character set utf8mb4, primary key(a(371))) engine ndb;
-ERROR 42000: BLOB column 'a' can't be used in key specification with the used table type
-CREATE TABLE t1 ( a varchar(10) ) CHARACTER SET utf8mb4 ENGINE ndb;
-INSERT INTO t1 VALUES ( 'test' );
-SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a;
-a a
-test test
-SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = 'test' and b.a = 'test';
-a a
-test test
-SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a and a.a = 'test';
-a a
-test test
-DROP TABLE t1;
-create table t1 (a char(255) character set utf8mb4) engine ndb;
-insert into t1 values('b'),('b');
-select * from t1 where a = 'b';
-a
-b
-b
-select * from t1 where a = 'b' and a = 'b';
-a
-b
-b
-select * from t1 where a = 'b' and a != 'b';
-a
-drop table t1;
-set collation_connection=utf8mb4_general_ci;
-drop table if exists t1;
-create table t1 as
-select repeat(' ', 64) as s1, repeat(' ',64) as s2
-union
-select null, null;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `s1` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL,
- `s2` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-delete from t1;
-insert into t1 values('aaa','aaa');
-insert into t1 values('aaa|qqq','qqq');
-insert into t1 values('gheis','^[^a-dXYZ]+$');
-insert into t1 values('aab','^aa?b');
-insert into t1 values('Baaan','^Ba*n');
-insert into t1 values('aaa','qqq|aaa');
-insert into t1 values('qqq','qqq|aaa');
-insert into t1 values('bbb','qqq|aaa');
-insert into t1 values('bbb','qqq');
-insert into t1 values('aaa','aba');
-insert into t1 values(null,'abc');
-insert into t1 values('def',null);
-insert into t1 values(null,null);
-insert into t1 values('ghi','ghi[');
-select HIGH_PRIORITY s1 regexp s2 from t1;
-s1 regexp s2
-1
-1
-1
-1
-1
-1
-1
-0
-0
-0
-NULL
-NULL
-NULL
-NULL
-drop table t1;
-set names utf8mb4;
-set names utf8mb4;
-select 'ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]';
-'ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'
-1
-select 'ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]';
-'ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]'
-1
-select ' ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]';
-' ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'
-1
-select ' ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]';
-' ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]'
-1
-select 'ваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]';
-'ваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]'
-0
-select 'zваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]';
-'zваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'
-0
-select 'zваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]';
-'zваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]'
-0
-CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8mb4_unicode_ci) ENGINE ndb;
-ALTER TABLE t1 ADD COLUMN b CHAR(20);
-DROP TABLE t1;
-set names utf8mb4;
-create table t1 (a enum('aaaa','проба') character set utf8mb4) engine ndb;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` enum('aaaa','проба') CHARACTER SET utf8mb4 DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-insert into t1 values ('проба');
-select * from t1;
-a
-проба
-create table t2 engine ndb select ifnull(a,a) from t1;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `ifnull(a,a)` varchar(5) CHARACTER SET utf8mb4 DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-select * from t2;
-ifnull(a,a)
-проба
-drop table t1;
-drop table t2;
-create table t1 (
-str varchar(255) character set utf8mb4 not null,
-key str (str(2))
-) engine=ndb;
-INSERT INTO t1 VALUES ('str');
-INSERT INTO t1 VALUES ('str2');
-select * from t1 where str='str';
-str
-str
-drop table t1;
-create table t1 (
-str varchar(255) character set utf8mb4 not null,
-key str (str(2))
-) engine=ndb;
-INSERT INTO t1 VALUES ('str');
-INSERT INTO t1 VALUES ('str2');
-select * from t1 where str='str';
-str
-str
-drop table t1;
-create table t1 (
-str varchar(255) character set utf8mb4 not null,
-key str using btree (str(2))
-) engine=ndb;
-INSERT INTO t1 VALUES ('str');
-INSERT INTO t1 VALUES ('str2');
-select * from t1 where str='str';
-str
-str
-drop table t1;
-CREATE TABLE t1 (a varchar(32) BINARY) CHARACTER SET utf8mb4 ENGINE ndb;
-INSERT INTO t1 VALUES ('test');
-SELECT a FROM t1 WHERE a LIKE '%te';
-a
-DROP TABLE t1;
-SET NAMES utf8mb4;
-CREATE TABLE t1 (
-subject varchar(255) character set utf8mb4 collate utf8mb4_unicode_ci,
-p varchar(15) character set utf8mb4
-) ENGINE= ndb DEFAULT CHARSET=latin1;
-INSERT INTO t1 VALUES ('è°·å·ä¿ŠäºŒã¨ç”³ã—ã¾ã™ãŒã€ã‚¤ãƒ³ã‚¿ãƒ¼ãƒãƒƒãƒˆäºˆç´„ã®ä¼šå“¡ç™»éŒ²ã‚’ã—ã¾ã—ãŸã¨ã“ã‚ã€ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’é–“é•ãˆã¦ã—ã¾ã„会員IDãŒå—ã‘å–ã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“ã§ã—ãŸã€‚é–“é•ãˆã‚¢ãƒ‰ãƒ¬ã‚¹ã¯tani-shun@n.vodafone.ne.jpを書ãè¾¼ã¿ã¾ã—ãŸã€‚ã©ã†ã™ã‚Œã°ã‚ˆã„ã§ã™ã‹ï¼Ÿ ãã®ä»–ã€ä½æ‰€ç­‰ã¯é–“é•ãˆã‚ã‚Šã¾ã›ã‚“。連絡ãã ã•ã„。よã‚ã—ããŠé¡˜ã„ã—ã¾ã™ã€‚m(__)m','040312-000057');
-INSERT INTO t1 VALUES ('aaa','bbb');
-SELECT length(subject) FROM t1;
-length(subject)
-3
-432
-SELECT length(subject) FROM t1 ORDER BY 1;
-length(subject)
-3
-432
-DROP TABLE t1;
-set names utf8mb4;
-create table t1 (
-a int primary key,
-b varchar(6),
-index b3(b(3))
-) engine=ndb character set=utf8mb4;
-insert into t1 values(1,'foo'),(2,'foobar');
-select * from t1 where b like 'foob%';
-a b
-2 foobar
-alter table t1 engine=innodb;
-select * from t1 where b like 'foob%';
-a b
-2 foobar
-drop table t1;
-create table t1 (
-a enum('петÑ','ваÑÑ','анюта') character set utf8mb4 not null default 'анюта',
-b set('петÑ','ваÑÑ','анюта') character set utf8mb4 not null default 'анюта'
-) engine ndb;
-create table t2 engine ndb select concat(a,_utf8mb4'') as a, concat(b,_utf8mb4'')as b from t1;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` varchar(5) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
- `b` varchar(15) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-drop table t2;
-drop table t1;
-select 'c' like '\_' as want0;
-want0
-0
-SELECT SUBSTR('ваÑÑ',-2);
-SUBSTR('ваÑÑ',-2)
-ÑÑ
-create table t1 (id integer, a varchar(100) character set utf8mb4 collate utf8mb4_unicode_ci) engine ndb;
-insert into t1 values (1, 'Test');
-select * from t1 where soundex(a) = soundex('Test');
-id a
-1 Test
-select * from t1 where soundex(a) = soundex('TEST');
-id a
-1 Test
-select * from t1 where soundex(a) = soundex('test');
-id a
-1 Test
-drop table t1;
-select soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB);
-soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB)
-阅000
-select hex(soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB));
-hex(soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB))
-E99885303030
-select soundex(_utf8mb4 0xD091D092D093);
-soundex(_utf8mb4 0xD091D092D093)
-Б000
-select hex(soundex(_utf8mb4 0xD091D092D093));
-hex(soundex(_utf8mb4 0xD091D092D093))
-D091303030
-SET collation_connection='utf8mb4_general_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)
-utf8mb4_general_ci 6109
-utf8mb4_general_ci 61
-utf8mb4_general_ci 6120
-drop table t1;
-select @@collation_connection;
-@@collation_connection
-utf8mb4_general_ci
-create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
-insert into t1 values('abcdef');
-insert into t1 values('_bcdef');
-insert into t1 values('a_cdef');
-insert into t1 values('ab_def');
-insert into t1 values('abc_ef');
-insert into t1 values('abcd_f');
-insert into t1 values('abcde_');
-select c1 as c1u from t1 where c1 like 'ab\_def';
-c1u
-ab_def
-select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
-c2h
-ab_def
-drop table t1;
-drop table if exists t1;
-create table t1 as select repeat(' ', 64) as s1;
-select collation(s1) from t1;
-collation(s1)
-utf8mb4_general_ci
-delete from t1;
-insert into t1 values ('a'),('ae'),(_latin1 0xE4);
-insert into t1 values ('o'),('oe'),(_latin1 0xF6);
-insert into t1 values ('s'),('ss'),(_latin1 0xDF);
-insert into t1 values ('u'),('ue'),(_latin1 0xFC);
-select s1, hex(s1) from t1 order by s1, binary s1;
-s1 hex(s1)
-a 61
-ä C3A4
-ae 6165
-o 6F
-ö C3B6
-oe 6F65
-s 73
-ß C39F
-ss 7373
-u 75
-ü C3BC
-ue 7565
-select group_concat(s1 order by binary s1) from t1 group by s1;
-group_concat(s1 order by binary s1)
-a,ä
-ae
-o,ö
-oe
-s,ß
-ss
-u,ü
-ue
-drop table t1;
-SET collation_connection='utf8mb4_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)
-utf8mb4_bin 6109
-utf8mb4_bin 61
-utf8mb4_bin 6120
-drop table t1;
-select @@collation_connection;
-@@collation_connection
-utf8mb4_bin
-create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
-insert into t1 values('abcdef');
-insert into t1 values('_bcdef');
-insert into t1 values('a_cdef');
-insert into t1 values('ab_def');
-insert into t1 values('abc_ef');
-insert into t1 values('abcd_f');
-insert into t1 values('abcde_');
-select c1 as c1u from t1 where c1 like 'ab\_def';
-c1u
-ab_def
-select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
-c2h
-ab_def
-drop table t1;
-CREATE TABLE t1 (
-user varchar(255) NOT NULL default ''
-) ENGINE=ndb DEFAULT CHARSET=latin1;
-INSERT INTO t1 VALUES ('one'),('two');
-SELECT CHARSET('a');
-CHARSET('a')
-utf8mb4
-SELECT user, CONCAT('<', user, '>') AS c FROM t1;
-user c
-one <one>
-two <two>
-DROP TABLE t1;
-create table t1 (f1 varchar(1) not null) default charset utf8mb4 engine ndb;
-insert into t1 values (''), ('');
-select concat(concat(_latin1'->',f1),_latin1'<-') from t1;
-concat(concat(_latin1'->',f1),_latin1'<-')
--><-
--><-
-drop table t1;
-select convert(_koi8r'É' using utf8mb4) < convert(_koi8r'Ê' using utf8mb4);
-convert(_koi8r'?' using utf8mb4) < convert(_koi8r'?' using utf8mb4)
-1
-set names latin1;
-create table t1 (a varchar(10)) character set utf8mb4 engine ndb;
-insert into t1 values ('test');
-select ifnull(a,'') from t1;
-ifnull(a,'')
-test
-drop table t1;
-select repeat(_utf8mb4'+',3) as h union select NULL;
-h
-+++
-NULL
-select ifnull(NULL, _utf8mb4'string');
-ifnull(NULL, _utf8mb4'string')
-string
-set names utf8mb4;
-create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_lithuanian_ci) engine ndb;
-insert into t1 values ('I'),('K'),('Y');
-select * from t1 where s1 < 'K' and s1 = 'Y';
-s1
-I
-Y
-select * from t1 where 'K' > s1 and s1 = 'Y';
-s1
-I
-Y
-drop table t1;
-create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_czech_ci) engine ndb;
-insert into t1 values ('c'),('d'),('h'),('ch'),('CH'),('cH'),('Ch'),('i');
-select * from t1 where s1 > 'd' and s1 = 'CH';
-s1
-CH
-Ch
-ch
-select * from t1 where 'd' < s1 and s1 = 'CH';
-s1
-CH
-Ch
-ch
-select * from t1 where s1 = 'cH' and s1 <> 'ch';
-s1
-cH
-select * from t1 where 'cH' = s1 and s1 <> 'ch';
-s1
-cH
-drop table t1;
-create table t1 (a varchar(255)) default character set utf8mb4 engine ndb;
-insert into t1 values (1.0);
-drop table t1;
-create table t1 (
-id int not null,
-city varchar(20) not null,
-key (city(7),id)
-) character set=utf8mb4 engine ndb;
-insert into t1 values (1,'Durban North');
-insert into t1 values (2,'Durban');
-select * from t1 where city = 'Durban';
-id city
-2 Durban
-select * from t1 where city = 'Durban ';
-id city
-2 Durban
-drop table t1;
-create table t1 (x set('A', 'B') default 0) character set utf8mb4 engine ndb;
-ERROR 42000: Invalid default value for 'x'
-create table t1 (x enum('A', 'B') default 0) character set utf8mb4 engine ndb;
-ERROR 42000: Invalid default value for 'x'
-SET NAMES UTF8;
-CREATE TABLE t1 (
-`id` int(20) NOT NULL auto_increment,
-`country` varchar(100) NOT NULL default '',
-`shortcode` varchar(100) NOT NULL default '',
-`operator` varchar(100) NOT NULL default '',
-`momid` varchar(30) NOT NULL default '',
-`keyword` varchar(160) NOT NULL default '',
-`content` varchar(160) NOT NULL default '',
-`second_token` varchar(160) default NULL,
-`gateway_id` int(11) NOT NULL default '0',
-`created` datetime NOT NULL default '0000-00-00 00:00:00',
-`msisdn` varchar(15) NOT NULL default '',
-PRIMARY KEY (`id`),
-UNIQUE KEY `MSCCSPK_20030521130957121` (`momid`),
-KEY `IX_mobile_originated_message_keyword` (`keyword`),
-KEY `IX_mobile_originated_message_created` (`created`),
-KEY `IX_mobile_originated_message_support` (`msisdn`,`momid`,`keyword`,`gateway_id`,`created`)
-) ENGINE=ndb DEFAULT CHARSET=utf8mb4;
-INSERT INTO t1 VALUES
-(1,'blah','464','aaa','fkc1c9ilc20x0hgae7lx6j09','ERR','ERR Имри.Ðфимим.Ðеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ðд.Д имдимримрад.Ðдимримримрмдиримримримр м.Дадимфшьмримд им.Ðдимимрн имадми','ИМРИ.ÐФИМИМ.ÐЕИМИМРИМДМРИМРМРИРОР',3,'2005-06-01 17:30:43','1234567890'),
-(2,'blah','464','aaa','haxpl2ilc20x00bj4tt2m5ti','11','11 g','G',3,'2005-06-02 22:43:10','1234567890');
-CREATE TABLE t2 (
-`msisdn` varchar(15) NOT NULL default '',
-`operator_id` int(11) NOT NULL default '0',
-`created` datetime NOT NULL default '0000-00-00 00:00:00',
-UNIQUE KEY `PK_user` (`msisdn`)
-) ENGINE=ndb DEFAULT CHARSET=utf8mb4;
-INSERT INTO t2 VALUES ('1234567890',2,'2005-05-24 13:53:25');
-SELECT content, t2.msisdn FROM t1, t2 WHERE t1.msisdn = '1234567890';
-content msisdn
-ERR Имри.Ðфимим.Ðеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ðд.Д имдимримрад.Ðдимримримрмдиримримримр м.Дадимфшьмримд им.Ðдимимрн имадми 1234567890
-11 g 1234567890
-DROP TABLE t1,t2;
-create table t1 (a char(20) character set utf8mb4) engine ndb;
-insert into t1 values ('123456'),('андрей');
-alter table t1 modify a char(2) character set utf8mb4;
-Warnings:
-Warning 1265 Data truncated for column 'a' at row 1
-Warning 1265 Data truncated for column 'a' at row 2
-select char_length(a), length(a), a from t1 order by a;
-char_length(a) length(a) a
-2 2 12
-2 4 ан
-drop table t1;
-set names utf8mb4;
-select 'andre%' like 'andreñ%' escape 'ñ';
-'andre%' like 'andreñ%' escape 'ñ'
-1
-set names utf8mb4;
-select 'a\\' like 'a\\';
-'a\\' like 'a\\'
-1
-select 'aa\\' like 'a%\\';
-'aa\\' like 'a%\\'
-1
-create table t1 (a char(10), key(a)) character set utf8mb4 engine ndb;
-insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
-select * from t1 where a like "abc%";
-a
-abc
-abcd
-select * from t1 where a like concat("abc","%");
-a
-abc
-abcd
-select * from t1 where a like "ABC%";
-a
-abc
-abcd
-select * from t1 where a like "test%";
-a
-test
-select * from t1 where a like "te_t";
-a
-test
-select * from t1 where a like "%a%";
-a
-a
-abc
-abcd
-select * from t1 where a like "%abcd%";
-a
-abcd
-select * from t1 where a like "%abc\d%";
-a
-abcd
-drop table t1;
-CREATE TABLE t1 (
-a varchar(255) NOT NULL default '',
-KEY a (a)
-) ENGINE=ndb DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
-insert into t1 values (_utf8mb4 0xe880bd);
-insert into t1 values (_utf8mb4 0x5b);
-select hex(a) from t1;
-hex(a)
-5B
-E880BD
-drop table t1;
-set names 'latin1';
-create table t1 (a varchar(255)) default charset=utf8mb4 engine ndb;
-select * from t1 where find_in_set('-1', a);
-a
-drop table t1;
-create table t1 (a int) engine ndb;
-insert into t1 values (48),(49),(50);
-set names utf8mb4;
-select distinct char(a) from t1;
-char(a)
-0
-1
-2
-drop table t1;
-CREATE TABLE t1 (t TINYTEXT CHARACTER SET utf8mb4) ENGINE ndb;
-Warnings:
-Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
-INSERT INTO t1 VALUES(REPEAT('a', 100));
-CREATE TABLE t2 ENGINE ndb SELECT COALESCE(t) AS bug FROM t1;
-Warnings:
-Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
-SELECT LENGTH(bug) FROM t2;
-LENGTH(bug)
-100
-DROP TABLE t2;
-DROP TABLE t1;
-CREATE TABLE t1 (item varchar(255)) default character set utf8mb4 ENGINE ndb;
-INSERT INTO t1 VALUES (N'\\');
-INSERT INTO t1 VALUES (_utf8mb4'\\');
-INSERT INTO t1 VALUES (N'Cote d\'Ivoire');
-INSERT INTO t1 VALUES (_utf8mb4'Cote d\'Ivoire');
-SELECT item FROM t1 ORDER BY item;
-item
-Cote d'Ivoire
-Cote d'Ivoire
-\
-\
-DROP TABLE t1;
-SET NAMES utf8mb4;
-DROP TABLE IF EXISTS t1;
-Warnings:
-Note 1051 Unknown table 't1'
-CREATE TABLE t1(a VARCHAR(255), KEY(a)) ENGINE=ndb DEFAULT CHARSET=utf8mb4;
-INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
-INSERT INTO t1 VALUES('uu');
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-INSERT INTO t1 VALUES('uU');
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-INSERT INTO t1 VALUES('uu');
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-INSERT INTO t1 VALUES('uuABC');
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-INSERT INTO t1 VALUES('UuABC');
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-INSERT INTO t1 VALUES('uuABC');
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-alter table t1 add b int;
-INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',1);
-INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',2);
-delete from t1 where b=1;
-INSERT INTO t1 VALUES('UUABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',1);
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',3);
-INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',4);
-delete from t1 where b=3;
-INSERT INTO t1 VALUES('uUABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',3);
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-drop table t1;
-set names utf8mb4;
-create table t1 (s1 char(5) character set utf8mb4) engine ndb;
-insert into t1 values
-('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
-create index it1 on t1 (s1);
-select s1 as before_delete_general_ci from t1 where s1 like 'ペテ%';
-before_delete_general_ci
-ペテルグル
-delete from t1 where s1 = 'Y';
-select s1 as after_delete_general_ci from t1 where s1 like 'ペテ%';
-after_delete_general_ci
-ペテルグル
-drop table t1;
-set names utf8mb4;
-create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_unicode_ci) engine ndb;
-insert into t1 values
-('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
-create index it1 on t1 (s1);
-select s1 as before_delete_unicode_ci from t1 where s1 like 'ペテ%';
-before_delete_unicode_ci
-ペテルグル
-delete from t1 where s1 = 'Y';
-select s1 as after_delete_unicode_ci from t1 where s1 like 'ペテ%';
-after_delete_unicode_ci
-ペテルグル
-drop table t1;
-set names utf8mb4;
-create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_bin) engine ndb;
-insert into t1 values
-('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
-create index it1 on t1 (s1);
-select s1 as before_delete_bin from t1 where s1 like 'ペテ%';
-before_delete_bin
-ペテルグル
-delete from t1 where s1 = 'Y';
-select s1 as after_delete_bin from t1 where s1 like 'ペテ%';
-after_delete_bin
-ペテルグル
-drop table t1;
-set names utf8mb4;
-create table t1 (a varchar(30) not null primary key)
-engine=ndb default character set utf8mb4 collate utf8mb4_general_ci;
-insert into t1 values ('ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã›ã');
-insert into t1 values ('ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ');
-select a as gci1 from t1 where a like 'ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ%';
-gci1
-ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ
-select a as gci2 from t1 where a like 'ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã›ã';
-gci2
-ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã›ã
-drop table t1;
-set names utf8mb4;
-create table t1 (a varchar(30) not null primary key)
-engine=ndb default character set utf8mb4 collate utf8mb4_unicode_ci;
-insert into t1 values ('ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã›ã');
-insert into t1 values ('ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ');
-select a as uci1 from t1 where a like 'ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ%';
-uci1
-ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ
-select a as uci2 from t1 where a like 'ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã›ã';
-uci2
-ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã›ã
-drop table t1;
-set names utf8mb4;
-create table t1 (a varchar(30) not null primary key)
-engine=ndb default character set utf8mb4 collate utf8mb4_bin;
-insert into t1 values ('ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã›ã');
-insert into t1 values ('ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ');
-select a as bin1 from t1 where a like 'ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ%';
-bin1
-ã•ã—ã™ã›ãã‹ããã‘ã“ã‚ã„ã†ãˆãŠ
-select a as bin2 from t1 where a like 'ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã›ã';
-bin2
-ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã›ã
-drop table t1;
-SET NAMES utf8mb4;
-CREATE TABLE t1 (id int PRIMARY KEY,
-a varchar(16) collate utf8mb4_unicode_ci NOT NULL default '',
-b int,
-f varchar(128) default 'XXX',
-INDEX (a(4))
-) ENGINE=ndb DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-INSERT INTO t1(id, a, b) VALUES
-(1, 'cccc', 50), (2, 'cccc', 70), (3, 'cccc', 30),
-(4, 'cccc', 30), (5, 'cccc', 20), (6, 'bbbbbb', 40),
-(7, 'dddd', 30), (8, 'aaaa', 10), (9, 'aaaa', 50),
-(10, 'eeeee', 40), (11, 'bbbbbb', 60);
-SELECT id, a, b FROM t1;
-id a b
-1 cccc 50
-10 eeeee 40
-11 bbbbbb 60
-2 cccc 70
-3 cccc 30
-4 cccc 30
-5 cccc 20
-6 bbbbbb 40
-7 dddd 30
-8 aaaa 10
-9 aaaa 50
-SELECT id, a, b FROM t1 WHERE a BETWEEN 'aaaa' AND 'bbbbbb';
-id a b
-11 bbbbbb 60
-6 bbbbbb 40
-8 aaaa 10
-9 aaaa 50
-SELECT id, a FROM t1 WHERE a='bbbbbb';
-id a
-11 bbbbbb
-6 bbbbbb
-SELECT id, a FROM t1 WHERE a='bbbbbb' ORDER BY b;
-id a
-6 bbbbbb
-11 bbbbbb
-DROP TABLE t1;
-SET NAMES utf8mb4;
-CREATE TABLE t1 (
-a CHAR(13) DEFAULT '',
-INDEX(a)
-) ENGINE=ndb DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-INSERT INTO t1 VALUES
-('Käli Käli 2-4'), ('Käli Käli 2-4'),
-('Käli Käli 2+4'), ('Käli Käli 2+4'),
-('Käli Käli 2-6'), ('Käli Käli 2-6');
-INSERT INTO t1 SELECT * FROM t1;
-CREATE TABLE t2 (
-a CHAR(13) DEFAULT '',
-INDEX(a)
-) ENGINE=ndb DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
-INSERT INTO t2 VALUES
-('Kali Kali 2-4'), ('Kali Kali 2-4'),
-('Kali Kali 2+4'), ('Kali Kali 2+4'),
-('Kali Kali 2-6'), ('Kali Kali 2-6');
-INSERT INTO t2 SELECT * FROM t2;
-SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4';
-a
-Käli Käli 2+4
-Käli Käli 2+4
-Käli Käli 2+4
-Käli Käli 2+4
-SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4';
-a
-Kali Kali 2+4
-Kali Kali 2+4
-Kali Kali 2+4
-Kali Kali 2+4
-EXPLAIN SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 53 NULL 10 Using where with pushed condition
-EXPLAIN SELECT a FROM t1 WHERE a = 'Käli Käli 2+4';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref a a 53 const 10 Using where with pushed condition
-EXPLAIN SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range a a 14 NULL 10 Using where with pushed condition
-EXPLAIN SELECT a FROM t2 WHERE a = 'Kali Kali 2+4';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref a a 14 const 10 Using where with pushed condition
-DROP TABLE t1,t2;
-CREATE TABLE t1 (
-a char(255) DEFAULT '',
-KEY(a(10))
-) ENGINE=ndb DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-INSERT INTO t1 VALUES ('Käli Käli 2-4');
-SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%';
-a
-Käli Käli 2-4
-INSERT INTO t1 VALUES ('Käli Käli 2-4');
-SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%';
-a
-Käli Käli 2-4
-Käli Käli 2-4
-DROP TABLE t1;
-CREATE TABLE t1 (
-a char(255) DEFAULT ''
-) ENGINE=ndb DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-INSERT INTO t1 VALUES ('Käli Käli 2-4');
-INSERT INTO t1 VALUES ('Käli Käli 2-4');
-SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%';
-a
-Käli Käli 2-4
-Käli Käli 2-4
-ALTER TABLE t1 ADD KEY (a(10));
-SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%';
-a
-Käli Käli 2-4
-Käli Käli 2-4
-DROP TABLE t1;
-SET NAMES latin2;
-create table t1(a char(200) collate utf8mb4_unicode_ci NOT NULL default '')
-default charset=utf8mb4 collate=utf8mb4_unicode_ci engine ndb;
-insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65'));
-explain select distinct a from t1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary
-SELECT COUNT(*) FROM (SELECT DISTINCT a FROM t1) AS t2;
-COUNT(*)
-1
-explain select a from t1 group by a;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary; Using filesort
-SELECT COUNT(*) FROM (SELECT a FROM t1 GROUP BY a) AS t2;
-COUNT(*)
-1
-drop table t1;
-create table t1(a char(10)) default charset utf8mb4 engine ndb;
-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
-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
-6 456
-drop table t1;
-SET CHARACTER SET utf8mb4;
-SHOW VARIABLES LIKE 'character\_set\_%';
-Variable_name Value
-character_set_client utf8mb4
-character_set_connection latin1
-character_set_database latin1
-character_set_filesystem binary
-character_set_results utf8mb4
-character_set_server latin1
-character_set_system utf8
-CREATE DATABASE crashtest DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
-USE crashtest;
-CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4 ENGINE ndb;
-INSERT INTO crashtest VALUES ('35'), ('36'), ('37');
-SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
-crash
-35
-36
-37
-INSERT INTO crashtest VALUES ('-1000');
-EXPLAIN SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE crashtest ALL NULL NULL NULL NULL 4 Using filesort
-SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
-crash
--1000
-35
-36
-37
-Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FFFFFC'
-DROP TABLE crashtest;
-DROP DATABASE crashtest;
-USE test;
-SET CHARACTER SET default;
-CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8mb4 ENGINE ndb;
-INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa');
-SELECT id FROM t1;
-id
-aa
-aa
-xxx
-yyy
-SELECT DISTINCT id FROM t1;
-id
-aa
-xxx
-yyy
-SELECT DISTINCT id FROM t1 ORDER BY id;
-id
-aa
-xxx
-yyy
-DROP TABLE t1;
-create table t1 (
-a varchar(26) not null
-) default character set utf8mb4 ENGINE ndb;
-insert into t1 (a) values ('abcdefghijklmnopqrstuvwxyz');
-select * from t1;
-a
-abcdefghijklmnopqrstuvwxyz
-alter table t1 change a a varchar(20) character set utf8mb4 not null;
-Warnings:
-Warning 1265 Data truncated for column 'a' at row 1
-select * from t1;
-a
-abcdefghijklmnopqrst
-alter table t1 change a a char(15) character set utf8mb4 not null;
-Warnings:
-Warning 1265 Data truncated for column 'a' at row 1
-select * from t1;
-a
-abcdefghijklmno
-alter table t1 change a a char(10) character set utf8mb4 not null;
-Warnings:
-Warning 1265 Data truncated for column 'a' at row 1
-select * from t1;
-a
-abcdefghij
-alter table t1 change a a varchar(5) character set utf8mb4 not null;
-Warnings:
-Warning 1265 Data truncated for column 'a' at row 1
-select * from t1;
-a
-abcde
-drop table t1;
-set names utf8mb4;
-select hex(char(1 using utf8mb4));
-hex(char(1 using utf8mb4))
-01
-select char(0xd1,0x8f using utf8mb4);
-char(0xd1,0x8f using utf8mb4)
-select char(0xd18f using utf8mb4);
-char(0xd18f using utf8mb4)
-select char(53647 using utf8mb4);
-char(53647 using utf8mb4)
-select char(0xff,0x8f using utf8mb4);
-char(0xff,0x8f using utf8mb4)
-
-Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF8F'
-select convert(char(0xff,0x8f) using utf8mb4);
-convert(char(0xff,0x8f) using utf8mb4)
-
-Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF8F'
-set sql_mode=traditional;
-select char(0xff,0x8f using utf8mb4);
-char(0xff,0x8f using utf8mb4)
-NULL
-Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF8F'
-select char(195 using utf8mb4);
-char(195 using utf8mb4)
-NULL
-Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'C3'
-select char(196 using utf8mb4);
-char(196 using utf8mb4)
-NULL
-Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'C4'
-select char(2557 using utf8mb4);
-char(2557 using utf8mb4)
-NULL
-Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FD'
-select convert(char(0xff,0x8f) using utf8mb4);
-convert(char(0xff,0x8f) using utf8mb4)
-NULL
-Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF8F'
-select hex(convert(char(2557 using latin1) using utf8mb4));
-hex(convert(char(2557 using latin1) using utf8mb4))
-09C3BD
-select hex(char(195));
-hex(char(195))
-C3
-select hex(char(196));
-hex(char(196))
-C4
-select hex(char(2557));
-hex(char(2557))
-09FD
-set names utf8mb4;
-create table t1 (a char(1)) default character set utf8mb4 engine ndb;
-create table t2 (a char(1)) default character set utf8mb4 engine ndb;
-insert into t1 values('a'),('a'),(0xE38182),(0xE38182);
-insert into t1 values('i'),('i'),(0xE38184),(0xE38184);
-select * from t1 union distinct select * from t2;
-a
-a
-i
-ã‚
-ã„
-drop table t1,t2;
-set names utf8mb4;
-create table t1 (a char(10), b varchar(10)) engine ndb;
-insert into t1 values ('bar','kostja');
-insert into t1 values ('kostja','bar');
-prepare my_stmt from "select * from t1 where a=?";
-set @a:='bar';
-execute my_stmt using @a;
-a b
-bar kostja
-set @a:='kostja';
-execute my_stmt using @a;
-a b
-kostja bar
-set @a:=null;
-execute my_stmt using @a;
-a b
-drop table if exists t1;
-drop table if exists t1;
-drop view if exists v1, v2;
-set names utf8mb4;
-create table t1(col1 varchar(12) character set utf8mb4 collate utf8mb4_unicode_ci) engine ndb;
-insert into t1 values('t1_val');
-create view v1 as select 'v1_val' as col1;
-select coercibility(col1), collation(col1) from v1;
-coercibility(col1) collation(col1)
-4 utf8mb4_general_ci
-create view v2 as select col1 from v1 union select col1 from t1;
-select coercibility(col1), collation(col1)from v2;
-coercibility(col1) collation(col1)
-2 utf8mb4_unicode_ci
-2 utf8mb4_unicode_ci
-drop view v1, v2;
-create view v1 as select 'v1_val' collate utf8mb4_swedish_ci as col1;
-select coercibility(col1), collation(col1) from v1;
-coercibility(col1) collation(col1)
-0 utf8mb4_swedish_ci
-create view v2 as select col1 from v1 union select col1 from t1;
-select coercibility(col1), collation(col1) from v2;
-coercibility(col1) collation(col1)
-0 utf8mb4_swedish_ci
-0 utf8mb4_swedish_ci
-drop view v1, v2;
-drop table t1;
-set names utf8mb4;
-create table t1 (a varchar(10) character set latin1, b int) engine ndb;
-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 utf8mb4;
-create table t1 (a varchar(10) character set latin1, b int) engine ndb;
-insert into t1 values ('a',1);
-select concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y')) from t1;
-concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y'))
-ay
-select concat(a, if(b>10, _utf8mb4'æ', _utf8mb4'ß')) from t1;
-ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
-drop table t1;
-set names utf8mb4;
-create table t1 (a varchar(10) character set latin1, b int) engine ndb;
-insert into t1 values ('a',1);
-select concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79)) from t1;
-concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79))
-ay
-select concat(a, if(b>10, _utf8mb4 0xC3A6, _utf8mb4 0xC3AF)) from t1;
-ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
-drop table t1;
-set names utf8mb4;
-create table t1 (a varchar(10) character set latin1, b int) engine ndb;
-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 (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
-drop table t1;
-CREATE TABLE t1 (
-colA int(11) NOT NULL,
-colB varchar(255) character set utf8mb4 NOT NULL,
-PRIMARY KEY (colA)
-) ENGINE=ndb DEFAULT CHARSET=latin1;
-INSERT INTO t1 (colA, colB) VALUES (1, 'foo'), (2, 'foo bar');
-CREATE TABLE t2 (
-colA int(11) NOT NULL,
-colB varchar(255) character set utf8mb4 NOT NULL,
-KEY bad (colA,colB(3))
-) ENGINE=ndb DEFAULT CHARSET=latin1;
-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;
-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 utf8mb4 ENGINE ndb;
-CREATE TABLE t2 (b CHAR(1) CHARACTER SET binary, i INT) ENGINE ndb;
-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;
-set sql_mode=traditional;
-select hex(char(0xFF using utf8mb4));
-hex(char(0xFF using utf8mb4))
-NULL
-Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF'
-select hex(convert(0xFF using utf8mb4));
-hex(convert(0xFF using utf8mb4))
-NULL
-Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF'
-select hex(_utf8mb4 0x616263FF);
-ERROR HY000: Invalid utf8mb4 character string: 'FF'
-select hex(_utf8mb4 X'616263FF');
-ERROR HY000: Invalid utf8mb4 character string: 'FF'
-select hex(_utf8mb4 B'001111111111');
-ERROR HY000: Invalid utf8mb4 character string: 'FF'
-select (_utf8mb4 X'616263FF');
-ERROR HY000: Invalid utf8mb4 character string: 'FF'
-set sql_mode=default;
-select hex(char(0xFF using utf8mb4));
-hex(char(0xFF using utf8mb4))
-
-Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF'
-select hex(convert(0xFF using utf8mb4));
-hex(convert(0xFF using utf8mb4))
-
-Warnings:
-Warning 1300 Invalid utf8mb4 character string: 'FF'
-select hex(_utf8mb4 0x616263FF);
-ERROR HY000: Invalid utf8mb4 character string: 'FF'
-select hex(_utf8mb4 X'616263FF');
-ERROR HY000: Invalid utf8mb4 character string: 'FF'
-select hex(_utf8mb4 B'001111111111');
-ERROR HY000: Invalid utf8mb4 character string: 'FF'
-select (_utf8mb4 X'616263FF');
-ERROR HY000: Invalid utf8mb4 character string: 'FF'
-CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL) ENGINE ndb;
-INSERT INTO t1 VALUES (70000, 1092), (70001, 1085), (70002, 1065);
-SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
-CONVERT(a, CHAR) CONVERT(b, CHAR)
-70000 1092
-70001 1085
-70002 1065
-SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1;
-CONVERT(a, CHAR) CONVERT(b, CHAR)
-70000 1092
-70001 1085
-70002 1065
-ALTER TABLE t1 ADD UNIQUE (b);
-SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
-CONVERT(a, CHAR) CONVERT(b, CHAR)
-70000 1092
-70001 1085
-70002 1065
-DROP INDEX b ON t1;
-SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
-CONVERT(a, CHAR) CONVERT(b, CHAR)
-70000 1092
-70001 1085
-70002 1065
-ALTER TABLE t1 ADD INDEX (b);
-SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) from t1 GROUP BY b;
-CONVERT(a, CHAR) CONVERT(b, CHAR)
-70000 1092
-70001 1085
-70002 1065
-DROP TABLE t1;
-#
-# Bug#26474: Add Sinhala script (Sri Lanka) collation to MySQL
-#
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-predicted_order int NOT NULL,
-utf8mb4_encoding VARCHAR(10) NOT NULL
-) CHARACTER SET utf8mb4 ENGINE ndb;
-INSERT INTO t1 VALUES (19, x'E0B696'), (30, x'E0B69AE0B798'), (61, x'E0B6AF'), (93, x'E0B799'), (52, x'E0B6A6'), (73, x'E0B6BBE0B78AE2808D'), (3, x'E0B686'), (56, x'E0B6AA'), (55, x'E0B6A9'), (70, x'E0B6B9'), (94, x'E0B79A'), (80, x'E0B785'), (25, x'E0B69AE0B791'), (48, x'E0B6A2'), (13, x'E0B690'), (86, x'E0B793'), (91, x'E0B79F'), (81, x'E0B786'), (79, x'E0B784'), (14, x'E0B691'), (99, x'E0B78A'), (8, x'E0B68B'), (68, x'E0B6B7'), (22, x'E0B69A'), (16, x'E0B693'), (33, x'E0B69AE0B7B3'), (38, x'E0B69AE0B79D'), (21, x'E0B683'), (11, x'E0B68E'), (77, x'E0B782'), (40, x'E0B69AE0B78A'), (101, x'E0B78AE2808DE0B6BB'), (35, x'E0B69AE0B79A'), (1, x'E0B7B4'), (9, x'E0B68C'), (96, x'E0B79C'), (6, x'E0B689'), (95, x'E0B79B'), (88, x'E0B796'), (64, x'E0B6B3'), (26, x'E0B69AE0B792'), (82, x'E0B78F'), (28, x'E0B69AE0B794'), (39, x'E0B69AE0B79E'), (97, x'E0B79D'), (2, x'E0B685'), (75, x'E0B780'), (34, x'E0B69AE0B799'), (69, x'E0B6B8'), (83, x'E0B790'), (18, x'E0B695'), (90, x'E0B7B2'), (17, x'E0B694'), (72, x'E0B6BB'), (66, x'E0B6B5'), (59, x'E0B6AD'), (44, x'E0B69E'), (15, x'E0B692'), (23, x'E0B69AE0B78F'), (65, x'E0B6B4'), (42, x'E0B69C'), (63, x'E0B6B1'), (85, x'E0B792'), (47, x'E0B6A1'), (49, x'E0B6A3'), (92, x'E0B7B3'), (78, x'E0B783'), (36, x'E0B69AE0B79B'), (4, x'E0B687'), (24, x'E0B69AE0B790'), (87, x'E0B794'), (37, x'E0B69AE0B79C'), (32, x'E0B69AE0B79F'), (29, x'E0B69AE0B796'), (43, x'E0B69D'), (62, x'E0B6B0'), (100, x'E0B78AE2808DE0B6BA'), (60, x'E0B6AE'), (45, x'E0B69F'), (12, x'E0B68F'), (46, x'E0B6A0'), (50, x'E0B6A5'), (51, x'E0B6A4'), (5, x'E0B688'), (76, x'E0B781'), (89, x'E0B798'), (74, x'E0B6BD'), (10, x'E0B68D'), (57, x'E0B6AB'), (71, x'E0B6BA'), (58, x'E0B6AC'), (27, x'E0B69AE0B793'), (54, x'E0B6A8'), (84, x'E0B791'), (31, x'E0B69AE0B7B2'), (98, x'E0B79E'), (53, x'E0B6A7'), (41, x'E0B69B'), (67, x'E0B6B6'), (7, x'E0B68A'), (20, x'E0B682');
-SELECT predicted_order, hex(utf8mb4_encoding) FROM t1 ORDER BY utf8mb4_encoding COLLATE utf8mb4_sinhala_ci;
-predicted_order hex(utf8mb4_encoding)
-1 E0B7B4
-2 E0B685
-3 E0B686
-4 E0B687
-5 E0B688
-6 E0B689
-7 E0B68A
-8 E0B68B
-9 E0B68C
-10 E0B68D
-11 E0B68E
-12 E0B68F
-13 E0B690
-14 E0B691
-15 E0B692
-16 E0B693
-17 E0B694
-18 E0B695
-19 E0B696
-20 E0B682
-21 E0B683
-22 E0B69A
-23 E0B69AE0B78F
-24 E0B69AE0B790
-25 E0B69AE0B791
-26 E0B69AE0B792
-27 E0B69AE0B793
-28 E0B69AE0B794
-29 E0B69AE0B796
-30 E0B69AE0B798
-31 E0B69AE0B7B2
-32 E0B69AE0B79F
-33 E0B69AE0B7B3
-34 E0B69AE0B799
-35 E0B69AE0B79A
-36 E0B69AE0B79B
-37 E0B69AE0B79C
-38 E0B69AE0B79D
-39 E0B69AE0B79E
-40 E0B69AE0B78A
-41 E0B69B
-42 E0B69C
-43 E0B69D
-44 E0B69E
-45 E0B69F
-46 E0B6A0
-47 E0B6A1
-48 E0B6A2
-49 E0B6A3
-50 E0B6A5
-51 E0B6A4
-52 E0B6A6
-53 E0B6A7
-54 E0B6A8
-55 E0B6A9
-56 E0B6AA
-57 E0B6AB
-58 E0B6AC
-59 E0B6AD
-60 E0B6AE
-61 E0B6AF
-62 E0B6B0
-63 E0B6B1
-64 E0B6B3
-65 E0B6B4
-66 E0B6B5
-67 E0B6B6
-68 E0B6B7
-69 E0B6B8
-70 E0B6B9
-71 E0B6BA
-72 E0B6BB
-73 E0B6BBE0B78AE2808D
-74 E0B6BD
-75 E0B780
-76 E0B781
-77 E0B782
-78 E0B783
-79 E0B784
-80 E0B785
-81 E0B786
-82 E0B78F
-83 E0B790
-84 E0B791
-85 E0B792
-86 E0B793
-87 E0B794
-88 E0B796
-89 E0B798
-90 E0B7B2
-91 E0B79F
-92 E0B7B3
-93 E0B799
-94 E0B79A
-95 E0B79B
-96 E0B79C
-97 E0B79D
-98 E0B79E
-99 E0B78A
-100 E0B78AE2808DE0B6BA
-101 E0B78AE2808DE0B6BB
-DROP TABLE t1;
-#
-# Bug#32914 Character sets: illegal characters in utf8mb4 and utf32 columns
-#
-create table t1 (utf8mb4 char(1) character set utf8mb4) engine ndb;
-Testing [F0][90..BF][80..BF][80..BF]
-insert into t1 values (0xF0908080);
-insert into t1 values (0xF0BFBFBF);
-insert into t1 values (0xF08F8080);
-Warnings:
-Warning 1366 Incorrect string value: '\xF0\x8F\x80\x80' for column 'utf8mb4' at row 1
-select hex(utf8mb4) from t1;
-hex(utf8mb4)
-
-F0908080
-F0BFBFBF
-delete from t1;
-Testing [F2..F3][80..BF][80..BF][80..BF]
-insert into t1 values (0xF2808080);
-insert into t1 values (0xF2BFBFBF);
-select hex(utf8mb4) from t1;
-hex(utf8mb4)
-F2808080
-F2BFBFBF
-delete from t1;
-Testing [F4][80..8F][80..BF][80..BF]
-insert into t1 values (0xF4808080);
-insert into t1 values (0xF48F8080);
-insert into t1 values (0xF4908080);
-Warnings:
-Warning 1366 Incorrect string value: '\xF4\x90\x80\x80' for column 'utf8mb4' at row 1
-select hex(utf8mb4) from t1;
-hex(utf8mb4)
-
-F4808080
-F48F8080
-drop table t1;
-#
-# Check strnxfrm() with odd length
-#
-set max_sort_length=5;
-select @@max_sort_length;
-@@max_sort_length
-5
-create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci) engine ndb;
-insert into t1 values ('a'),('b'),('c');
-select * from t1 order by a;
-a
-a
-b
-c
-alter table t1 modify a varchar(128) character set utf8mb4 collate utf8mb4_bin;
-select * from t1 order by a;
-a
-a
-b
-c
-drop table t1;
-set max_sort_length=default;
-#
-# Bug#26180: Can't add columns to tables created with utf8mb4 text indexes
-#
-#
-# Testing 4-byte values.
-#
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-u_decimal int NOT NULL,
-utf8mb4_encoding VARCHAR(10) NOT NULL
-) CHARACTER SET utf8mb4 ENGINE ndb;
-INSERT INTO t1 VALUES (119040, x'f09d8480'),
-# G CLEF
-(119070, x'f09d849e'),
-# HALF NOTE
-(119134, x'f09d859e'),
-# MUSICAL SYMBOL CROIX
-(119247, x'f09d878f'),
-# MATHEMATICAL BOLD ITALIC CAPITAL DELTA
-(120607, x'f09d9c9f'),
-# SANS-SERIF BOLD ITALIC CAPITAL PI
-(120735, x'f09d9e9f'),
-# <Plane 16 Private Use, Last> (last 4 byte character)
-(1114111, x'f48fbfbf'),
-# VARIATION SELECTOR-256
-(917999, x'f3a087af');
-INSERT INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859ff09d859ff09d85a0f09d85a0f09d8480');
-INSERT INTO t1 VALUES (65131, x'efb9abf09d849ef09d859ef09d859ef09d8480f09d859fefb9abefb9abf09d85a0efb9ab');
-INSERT INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859ff09d859ff09d85a0f09d85a0f09d8480f09d85a0');
-Warnings:
-Warning 1265 Data truncated for column 'utf8mb4_encoding' at row 1
-SELECT u_decimal, hex(utf8mb4_encoding) FROM t1 ORDER BY utf8mb4_encoding COLLATE utf8mb4_general_ci, BINARY utf8mb4_encoding;
-u_decimal hex(utf8mb4_encoding)
-1114111 F48FBFBF
-119040 F09D8480
-119070 F09D849E
-119070 F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
-119070 F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
-119134 F09D859E
-119247 F09D878F
-120607 F09D9C9F
-120735 F09D9E9F
-65131 EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9AB
-917999 F3A087AF
-INSERT INTO t1 VALUES (1114111, x'f5808080');
-Warnings:
-Warning 1366 Incorrect string value: '\xF5\x80\x80\x80' for column 'utf8mb4_encoding' at row 1
-SELECT character_maximum_length, character_octet_length FROM information_schema.columns WHERE
-table_name= 't1' AND column_name= 'utf8mb4_encoding';
-character_maximum_length character_octet_length
-10 40
-DROP TABLE IF EXISTS t2;
-CREATE TABLE t2 (
-u_decimal int NOT NULL,
-utf8mb3_encoding VARCHAR(10) NOT NULL
-) CHARACTER SET utf8mb3 ENGINE ndb;
-INSERT INTO t2 VALUES (42856, x'ea9da8');
-INSERT INTO t2 VALUES (65131, x'efb9ab');
-INSERT INTO t2 VALUES (1114111, x'f48fbfbf');
-Warnings:
-Warning 1366 Incorrect string value: '\xF4\x8F\xBF\xBF' for column 'utf8mb3_encoding' at row 1
-SELECT character_maximum_length, character_octet_length FROM information_schema.columns WHERE
-table_name= 't2' AND column_name= 'utf8mb3_encoding';
-character_maximum_length character_octet_length
-10 30
-UPDATE t2 SET utf8mb3_encoding= x'f48fbfbd' where u_decimal= 42856;
-Warnings:
-Warning 1366 Incorrect string value: '\xF4\x8F\xBF\xBD' for column 'utf8mb3_encoding' at row 1
-UPDATE t2 SET utf8mb3_encoding= _utf8mb4 x'ea9da8' where u_decimal= 42856;
-SELECT HEX(CONCAT(utf8mb4_encoding, _utf8 x'ea9da8')) FROM t1;
-HEX(CONCAT(utf8mb4_encoding, _utf8 x'ea9da8'))
-EA9DA8
-EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEA9DA8
-F09D8480EA9DA8
-F09D849EEA9DA8
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
-F09D859EEA9DA8
-F09D878FEA9DA8
-F09D9C9FEA9DA8
-F09D9E9FEA9DA8
-F3A087AFEA9DA8
-F48FBFBFEA9DA8
-SELECT HEX(CONCAT(utf8mb4_encoding, utf8mb3_encoding)) FROM t1,t2;
-HEX(CONCAT(utf8mb4_encoding, utf8mb3_encoding))
-
-EA9DA8
-EFB9AB
-EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9AB
-EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEA9DA8
-EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEFB9AB
-F09D8480
-F09D8480EA9DA8
-F09D8480EFB9AB
-F09D849E
-F09D849EEA9DA8
-F09D849EEFB9AB
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EFB9AB
-F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EFB9AB
-F09D859E
-F09D859EEA9DA8
-F09D859EEFB9AB
-F09D878F
-F09D878FEA9DA8
-F09D878FEFB9AB
-F09D9C9F
-F09D9C9FEA9DA8
-F09D9C9FEFB9AB
-F09D9E9F
-F09D9E9FEA9DA8
-F09D9E9FEFB9AB
-F3A087AF
-F3A087AFEA9DA8
-F3A087AFEFB9AB
-F48FBFBF
-F48FBFBFEA9DA8
-F48FBFBFEFB9AB
-SELECT count(*) FROM t1, t2
-WHERE t1.utf8mb4_encoding > t2.utf8mb3_encoding;
-count(*)
-33
-ALTER TABLE t1 CONVERT TO CHARACTER SET utf8;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `u_decimal` int(11) NOT NULL,
- `utf8mb4_encoding` varchar(10) NOT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=utf8
-SELECT u_decimal,hex(utf8mb4_encoding),utf8mb4_encoding FROM t1;
-u_decimal hex(utf8mb4_encoding) utf8mb4_encoding
-1114111
-1114111 3F ?
-119040 3F ?
-119070 3F ?
-119070 3F3F3F3F3F3F3F3F3F3F ??????????
-119070 3F3F3F3F3F3F3F3F3F3F ??????????
-119134 3F ?
-119247 3F ?
-120607 3F ?
-120735 3F ?
-65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB ﹫?????﹫﹫?﹫
-917999 3F ?
-ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb4;
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `u_decimal` int(11) NOT NULL,
- `utf8mb3_encoding` varchar(10) NOT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4
-SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
-u_decimal hex(utf8mb3_encoding)
-1114111
-42856 EA9DA8
-65131 EFB9AB
-ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3;
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `u_decimal` int(11) NOT NULL,
- `utf8mb3_encoding` varchar(10) NOT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=utf8
-SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
-u_decimal hex(utf8mb3_encoding)
-1114111
-42856 EA9DA8
-65131 EFB9AB
-ALTER TABLE t1 MODIFY utf8mb4_encoding VARCHAR(10) CHARACTER SET utf8mb3;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `u_decimal` int(11) NOT NULL,
- `utf8mb4_encoding` varchar(10) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=utf8
-SELECT u_decimal,hex(utf8mb4_encoding) FROM t1;
-u_decimal hex(utf8mb4_encoding)
-1114111
-1114111 3F
-119040 3F
-119070 3F
-119070 3F3F3F3F3F3F3F3F3F3F
-119070 3F3F3F3F3F3F3F3F3F3F
-119134 3F
-119247 3F
-120607 3F
-120735 3F
-65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB
-917999 3F
-ALTER TABLE t1 MODIFY utf8mb4_encoding VARCHAR(10) CHARACTER SET utf8mb4;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `u_decimal` int(11) NOT NULL,
- `utf8mb4_encoding` varchar(10) CHARACTER SET utf8mb4 DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=utf8
-SELECT u_decimal,hex(utf8mb4_encoding) FROM t1;
-u_decimal hex(utf8mb4_encoding)
-1114111
-1114111 3F
-119040 3F
-119070 3F
-119070 3F3F3F3F3F3F3F3F3F3F
-119070 3F3F3F3F3F3F3F3F3F3F
-119134 3F
-119247 3F
-120607 3F
-120735 3F
-65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB
-917999 3F
-ALTER TABLE t2 MODIFY utf8mb3_encoding VARCHAR(10) CHARACTER SET utf8mb4;
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `u_decimal` int(11) NOT NULL,
- `utf8mb3_encoding` varchar(10) CHARACTER SET utf8mb4 DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=utf8
-SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
-u_decimal hex(utf8mb3_encoding)
-1114111
-42856 EA9DA8
-65131 EFB9AB
-DROP TABLE IF EXISTS t3;
-CREATE TABLE t3 (
-u_decimal int NOT NULL,
-utf8mb3_encoding VARCHAR(10) NOT NULL
-) CHARACTER SET utf8 ENGINE ndb;
-INSERT INTO t3 SELECT * FROM t1;
-DROP TABLE IF EXISTS t4;
-CREATE TABLE t4 (
-u_decimal int NOT NULL,
-utf8mb4_encoding VARCHAR(10) NOT NULL
-) CHARACTER SET utf8mb4 ENGINE ndb;
-INSERT INTO t3 SELECT * FROM t2;
-DROP TABLE t1;
-DROP TABLE t2;
-DROP TABLE t3;
-DROP TABLE t4;
-#
-# Testing that mixing utf8 and utf8mb4 collations returns utf8mb4
-#
-SELECT CHARSET(CONCAT(_utf8mb4'a',_utf8'b'));
-CHARSET(CONCAT(_utf8mb4'a',_utf8'b'))
-utf8mb4
-CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 NOT NULL) ENGINE ndb;
-INSERT INTO t1 VALUES (x'ea9da8'),(x'f48fbfbf');
-SELECT CONCAT(utf8mb4, _utf8 x'ea9da8') FROM t1 LIMIT 0;
-CONCAT(utf8mb4, _utf8 x'ea9da8')
-CREATE TABLE t2 (utf8mb3 VARCHAR(10) CHARACTER SET utf8mb3 NOT NULL) ENGINE ndb;
-INSERT INTO t2 VALUES (x'ea9da8');
-SELECT HEX(CONCAT(utf8mb4, utf8mb3)) FROM t1,t2 ORDER BY 1;
-HEX(CONCAT(utf8mb4, utf8mb3))
-EA9DA8EA9DA8
-F48FBFBFEA9DA8
-SELECT CHARSET(CONCAT(utf8mb4, utf8mb3)) FROM t1, t2 LIMIT 1;
-CHARSET(CONCAT(utf8mb4, utf8mb3))
-utf8mb4
-SELECT * FROM t1, t2 WHERE t1.utf8mb4 > t2.utf8mb3;
-utf8mb4 utf8mb3
-ô¿¿ ê¨
-SELECT * FROM t1, t2 WHERE t1.utf8mb4 = t2.utf8mb3;
-utf8mb4 utf8mb3
-ê¨ ê¨
-SELECT * FROM t1, t2 WHERE t1.utf8mb4 < t2.utf8mb3;
-utf8mb4 utf8mb3
-DROP TABLE t1;
-DROP TABLE t2;
-#
-# Check that mixing utf8mb4 with an invalid utf8 constant returns error
-#
-CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4) ENGINE ndb;
-INSERT INTO t1 VALUES (x'f48fbfbf');
-SELECT CONCAT(utf8mb4, _utf8 '¿') FROM t1;
-ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'concat'
-SELECT CONCAT('a', _utf8 '¿') FROM t1;
-ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (utf8_general_ci,COERCIBLE) for operation 'concat'
-DROP TABLE t1;
-#
-# End of 5.5 tests
-#
-#
-# End of tests
-#
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index 432b9b14a85..b6081d34f37 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -544,3 +544,17 @@ SELECT DATE_FORMAT("2009-01-01",'%W %d %M %Y') as valid_date;
valid_date
Thursday 01 January 2009
"End of 5.0 tests"
+#
+# Start of 5.1 tests
+#
+#
+# Bug#58005 utf8 + get_format causes failed assertion: !str || str != Ptr'
+#
+SET NAMES utf8;
+SELECT LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535)));
+LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535)))
+%
+SET NAMES latin1;
+#
+# End of 5.1 tests
+#
diff --git a/mysql-test/r/ddl_i18n_koi8r.result b/mysql-test/r/ddl_i18n_koi8r.result
index 2282f65c456..352f421eda7 100644
--- a/mysql-test/r/ddl_i18n_koi8r.result
+++ b/mysql-test/r/ddl_i18n_koi8r.result
@@ -724,7 +724,7 @@ utf8_general_ci utf8_general_ci
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */;
USE `mysqltest1`;
-ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;
@@ -757,8 +757,8 @@ DELIMITER ;
/*!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 ;
+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 */ ;
@@ -791,7 +791,7 @@ DELIMITER ;
/*!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 cp866 COLLATE cp866_general_ci ;
---> Dumping mysqltest1 to ddl_i18n_koi8r.sp.mysqltest1.sql
@@ -800,7 +800,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */;
USE `mysqltest2`;
-ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;
@@ -833,8 +833,8 @@ DELIMITER ;
/*!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 ;
+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 */ ;
@@ -867,7 +867,7 @@ DELIMITER ;
/*!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 cp866 COLLATE cp866_general_ci ;
---> Dumping mysqltest2 to ddl_i18n_koi8r.sp.mysqltest2.sql
@@ -1742,7 +1742,7 @@ CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
INSERT INTO `t1` VALUES (1),(0),(1);
-ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;
@@ -1770,8 +1770,8 @@ DELIMITER ;
/*!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 ;
+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 */ ;
@@ -1799,7 +1799,7 @@ DELIMITER ;
/*!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 cp866 COLLATE cp866_general_ci ;
---> Dumping mysqltest1 to ddl_i18n_koi8r.triggers.mysqltest1.sql
@@ -1821,7 +1821,7 @@ CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
INSERT INTO `t1` VALUES (1),(0),(1);
-ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;
@@ -1849,8 +1849,8 @@ DELIMITER ;
/*!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 ;
+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 */ ;
@@ -1878,7 +1878,7 @@ DELIMITER ;
/*!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 cp866 COLLATE cp866_general_ci ;
---> Dumping mysqltest2 to ddl_i18n_koi8r.triggers.mysqltest2.sql
@@ -2486,7 +2486,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER
USE `mysqltest1`;
/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;
DELIMITER ;;
-ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;;
@@ -2512,9 +2512,9 @@ END */ ;;
/*!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 cp866 COLLATE cp866_general_ci ;;
DELIMITER ;;
-ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;;
@@ -2540,7 +2540,7 @@ END */ ;;
/*!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 cp866 COLLATE cp866_general_ci ;;
DELIMITER ;
/*!50106 SET TIME_ZONE= @save_time_zone */ ;
@@ -2553,7 +2553,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER
USE `mysqltest2`;
/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;
DELIMITER ;;
-ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;;
@@ -2579,9 +2579,9 @@ END */ ;;
/*!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 cp866 COLLATE cp866_general_ci ;;
DELIMITER ;;
-ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;;
@@ -2607,7 +2607,7 @@ END */ ;;
/*!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 cp866 COLLATE cp866_general_ci ;;
DELIMITER ;
/*!50106 SET TIME_ZONE= @save_time_zone */ ;
diff --git a/mysql-test/r/ddl_i18n_utf8.result b/mysql-test/r/ddl_i18n_utf8.result
index 9d27fdb22bb..1385612fc32 100644
--- a/mysql-test/r/ddl_i18n_utf8.result
+++ b/mysql-test/r/ddl_i18n_utf8.result
@@ -724,7 +724,7 @@ utf8_general_ci utf8_general_ci
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */;
USE `mysqltest1`;
-ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;
@@ -757,8 +757,8 @@ DELIMITER ;
/*!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 ;
+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 */ ;
@@ -791,7 +791,7 @@ DELIMITER ;
/*!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 cp866 COLLATE cp866_general_ci ;
---> Dumping mysqltest1 to ddl_i18n_utf8sp.mysqltest1.sql
@@ -800,7 +800,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */;
USE `mysqltest2`;
-ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;
@@ -833,8 +833,8 @@ DELIMITER ;
/*!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 ;
+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 */ ;
@@ -867,7 +867,7 @@ DELIMITER ;
/*!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 cp866 COLLATE cp866_general_ci ;
---> Dumping mysqltest2 to ddl_i18n_utf8sp.mysqltest2.sql
@@ -1742,7 +1742,7 @@ CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
INSERT INTO `t1` VALUES (1),(0),(1);
-ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;
@@ -1770,8 +1770,8 @@ DELIMITER ;
/*!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 ;
+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 */ ;
@@ -1799,7 +1799,7 @@ DELIMITER ;
/*!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 cp866 COLLATE cp866_general_ci ;
---> Dumping mysqltest1 to ddl_i18n_utf8triggers.mysqltest1.sql
@@ -1821,7 +1821,7 @@ CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
INSERT INTO `t1` VALUES (1),(0),(1);
-ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;
@@ -1849,8 +1849,8 @@ DELIMITER ;
/*!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 ;
+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 */ ;
@@ -1878,7 +1878,7 @@ DELIMITER ;
/*!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 cp866 COLLATE cp866_general_ci ;
---> Dumping mysqltest2 to ddl_i18n_utf8triggers.mysqltest2.sql
@@ -2486,7 +2486,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER
USE `mysqltest1`;
/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;
DELIMITER ;;
-ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;;
@@ -2512,9 +2512,9 @@ END */ ;;
/*!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 cp866 COLLATE cp866_general_ci ;;
DELIMITER ;;
-ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;;
@@ -2540,7 +2540,7 @@ END */ ;;
/*!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 cp866 COLLATE cp866_general_ci ;;
DELIMITER ;
/*!50106 SET TIME_ZONE= @save_time_zone */ ;
@@ -2553,7 +2553,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER
USE `mysqltest2`;
/*!50106 SET @save_time_zone= @@TIME_ZONE */ ;
DELIMITER ;;
-ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;;
@@ -2579,9 +2579,9 @@ END */ ;;
/*!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 cp866 COLLATE cp866_general_ci ;;
DELIMITER ;;
-ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_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 */ ;;
@@ -2607,7 +2607,7 @@ END */ ;;
/*!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 cp866 COLLATE cp866_general_ci ;;
DELIMITER ;
/*!50106 SET TIME_ZONE= @save_time_zone */ ;
diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result
index 8c071cca396..0eb0661b0e2 100644
--- a/mysql-test/r/delayed.result
+++ b/mysql-test/r/delayed.result
@@ -422,7 +422,47 @@ COMMIT;
UNLOCK TABLES;
# Connection con1
# Reaping: INSERT DELAYED INTO t1 VALUES (5)
+# Connection default
+# Test 5: LOCK TABLES + INSERT DELAYED in one connection.
+# This test has triggered some asserts in metadata locking
+# subsystem at some point in time..
+LOCK TABLE t1 WRITE;
+INSERT DELAYED INTO t2 VALUES (7);
+UNLOCK TABLES;
+SET AUTOCOMMIT= 0;
+LOCK TABLE t1 WRITE;
+INSERT DELAYED INTO t2 VALUES (8);
+UNLOCK TABLES;
+SET AUTOCOMMIT= 1;
# Connection con2
# Connection con1
# Connection default
DROP TABLE t1, t2, t3;
+#
+# Test for bug #56251 "Deadlock with INSERT DELAYED and MERGE tables".
+#
+drop table if exists t1, t2, tm;
+create table t1(a int);
+create table t2(a int);
+create table tm(a int) engine=merge union=(t1, t2);
+begin;
+select * from t1;
+a
+# Connection 'con1'.
+# Sending:
+alter table t1 comment 'test';
+# Connection 'default'.
+# Wait until ALTER TABLE blocks and starts waiting
+# for connection 'default'. It should wait with a
+# pending SNW lock on 't1'.
+# Attempt to perform delayed insert into 'tm' should not lead
+# to a deadlock. Instead error ER_DELAYED_NOT_SUPPORTED should
+# be emitted.
+insert delayed into tm values (1);
+ERROR HY000: DELAYED option not supported for table 'tm'
+# Unblock ALTER TABLE.
+commit;
+# Connection 'con1'.
+# Reaping ALTER TABLE:
+# Connection 'default'.
+drop tables tm, t1, t2;
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index 702b9348b7d..5e4adbbd6dc 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -509,3 +509,18 @@ CREATE TABLE t3 LIKE t1;
DELETE FROM t1.*, test.t2.*, a.* USING t1, t2, t3 AS a;
DROP TABLE t1, t2, t3;
End of 5.1 tests
+#
+# Bug#51099 Assertion in mysql_multi_delete_prepare()
+#
+DROP TABLE IF EXISTS t1, t2;
+DROP VIEW IF EXISTS v1, v2;
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(b INT);
+CREATE VIEW v1 AS SELECT a, b FROM t1, t2;
+CREATE VIEW v2 AS SELECT a FROM v1;
+DELETE FROM v2;
+ERROR HY000: Can not delete from join view 'test.v2'
+DELETE v2 FROM v2;
+ERROR HY000: Can not delete from join view 'test.v2'
+DROP VIEW v2, v1;
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 53cd89c13c1..a86eabc3192 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -400,4 +400,30 @@ SELECT 0 FROM
(SELECT 0) t61;
0
0
+#
+# A nested materialized derived table is used before being populated.
+# (addon for bug#19077)
+#
+CREATE TABLE t1 (i INT, j BIGINT);
+INSERT INTO t1 VALUES (1, 2), (2, 2), (3, 2);
+SELECT * FROM (SELECT MIN(i) FROM t1
+WHERE j = SUBSTRING('12', (SELECT * FROM (SELECT MIN(j) FROM t1) t2))) t3;
+MIN(i)
+1
+DROP TABLE t1;
# End of 5.0 tests
+#
+# Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table,
+# temptable views
+#
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT, KEY (b));
+INSERT INTO t1 VALUES (1),(1);
+INSERT INTO t2 VALUES (1),(1);
+CREATE algorithm=temptable VIEW v1 AS
+SELECT 1 FROM t1 LEFT JOIN t1 t3 ON 1 > (SELECT 1 FROM t1);
+CREATE algorithm=temptable VIEW v2 AS SELECT 1 FROM t2;
+EXPLAIN SELECT 1 FROM t1 JOIN v1 ON 1 > (SELECT 1 FROM v2);
+ERROR 21000: Subquery returns more than 1 row
+DROP TABLE t1, t2;
+DROP VIEW v1, v2;
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result
index ee8f9f897ad..041ee3e72cd 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -794,3 +794,14 @@ DROP TABLE t1;
SET @@sort_buffer_size = @old_sort_buffer_size;
SET @@max_heap_table_size = @old_max_heap_table_size;
End of 5.1 tests
+#
+# Bug #11744875: 4082: integer lengths cause truncation with distinct concat and innodb
+#
+CREATE TABLE t1 (a INT(1), b INT(1));
+INSERT INTO t1 VALUES (1111, 2222), (3333, 4444);
+SELECT DISTINCT CONCAT(a,b) AS c FROM t1 ORDER BY 1;
+c
+11112222
+33334444
+DROP TABLE t1;
+End of 5.5 tests
diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result
index 3d247a242a3..e6a1b492b39 100644
--- a/mysql-test/r/errors.result
+++ b/mysql-test/r/errors.result
@@ -134,3 +134,15 @@ INSERT INTO t1 VALUES ('abc\0\0');
INSERT INTO t1 VALUES ('abc\0\0');
ERROR 23000: Duplicate entry 'abc\x00\x00' for key 'PRIMARY'
DROP TABLE t1;
+#
+# Bug#57882: Item_func_conv_charset::val_str(String*):
+# Assertion `fixed == 1' failed
+#
+SELECT (CONVERT('0' USING latin1) IN (CHAR(COT('v') USING utf8),''));
+ERROR 22003: DOUBLE value is out of range in 'cot('v')'
+SET NAMES utf8 COLLATE utf8_latvian_ci ;
+SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null);
+ERROR 22003: BIGINT value is out of range in '(-(73) * -(2465717823867977728))'
+#
+# End Bug#57882
+#
diff --git a/mysql-test/r/events_1.result b/mysql-test/r/events_1.result
index e068158e6ce..29e81975c87 100644
--- a/mysql-test/r/events_1.result
+++ b/mysql-test/r/events_1.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
drop database if exists events_test;
drop database if exists db_x;
drop database if exists mysqltest_db2;
@@ -259,33 +260,36 @@ events_test intact_check root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLE
Try to alter mysql.event: the server should fail to load
event information after mysql.event was tampered with.
-First, let's add a column to the end and make sure everything
-works as before
+First, let's add a column to the end and check the error is emitted.
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 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
+ERROR HY000: Failed to open mysql.event
SELECT event_name FROM INFORMATION_SCHEMA.events;
-event_name
-intact_check
+ERROR HY000: Failed to open mysql.event
SHOW CREATE EVENT intact_check;
-Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-intact_check SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `intact_check` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT "nothing" latin1 latin1_swedish_ci latin1_swedish_ci
+ERROR HY000: Failed to open mysql.event
DROP EVENT no_such_event;
-ERROR HY000: Unknown event 'no_such_event'
+ERROR HY000: Failed to open mysql.event
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
+ERROR HY000: Failed to open mysql.event
ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
+ERROR HY000: Failed to open mysql.event
ALTER EVENT intact_check_1 RENAME TO intact_check_2;
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check_1;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check_2;
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check;
+ERROR HY000: Failed to open mysql.event
DROP DATABASE IF EXISTS mysqltest_no_such_database;
Warnings:
Note 1008 Can't drop database 'mysqltest_no_such_database'; database doesn't exist
CREATE DATABASE mysqltest_db2;
DROP DATABASE mysqltest_db2;
+Warnings:
+Error 1545 Failed to open mysql.event
SELECT @@event_scheduler;
@@event_scheduler
OFF
@@ -294,6 +298,7 @@ Variable_name Value
event_scheduler OFF
SET GLOBAL event_scheduler=OFF;
ALTER TABLE mysql.event DROP dummy;
+DROP EVENT intact_check;
CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing";
Now let's add a column to the first position: the server
@@ -301,30 +306,32 @@ expects to see event schema name there
ALTER TABLE mysql.event ADD dummy INT FIRST;
SHOW EVENTS;
-ERROR HY000: Cannot load from mysql.event. The table is probably corrupted
+ERROR HY000: Failed to open mysql.event
SELECT event_name FROM INFORMATION_SCHEMA.events;
-ERROR HY000: Cannot load from mysql.event. The table is probably corrupted
+ERROR HY000: Failed to open mysql.event
SHOW CREATE EVENT intact_check;
-ERROR HY000: Unknown event 'intact_check'
+ERROR HY000: Failed to open mysql.event
DROP EVENT no_such_event;
-ERROR HY000: Unknown event 'no_such_event'
+ERROR HY000: Failed to open mysql.event
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
-ERROR HY000: Failed to store event name. Error code 2 from storage engine.
+ERROR HY000: Failed to open mysql.event
ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
ALTER EVENT intact_check_1 RENAME TO intact_check_2;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check_1;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check_2;
-ERROR HY000: Unknown event 'intact_check_2'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check;
-ERROR HY000: Unknown event 'intact_check'
+ERROR HY000: Failed to open mysql.event
DROP DATABASE IF EXISTS mysqltest_no_such_database;
Warnings:
Note 1008 Can't drop database 'mysqltest_no_such_database'; database doesn't exist
CREATE DATABASE mysqltest_db2;
DROP DATABASE mysqltest_db2;
+Warnings:
+Error 1545 Failed to open mysql.event
SELECT @@event_scheduler;
@@event_scheduler
OFF
@@ -345,29 +352,32 @@ Drop some columns and try more checks.
ALTER TABLE mysql.event DROP comment, DROP starts;
SHOW EVENTS;
-ERROR HY000: Cannot load from mysql.event. The table is probably corrupted
+ERROR HY000: Failed to open mysql.event
SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
-ERROR HY000: Cannot load from mysql.event. The table is probably corrupted
+ERROR HY000: Failed to open mysql.event
SHOW CREATE EVENT intact_check;
-ERROR HY000: Cannot load from mysql.event. The table is probably corrupted
+ERROR HY000: Failed to open mysql.event
DROP EVENT no_such_event;
-ERROR HY000: Unknown event 'no_such_event'
+ERROR HY000: Failed to open mysql.event
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
-ERROR HY000: Column count of mysql.event is wrong. Expected 22, found 20. The table is probably corrupted
+ERROR HY000: Failed to open mysql.event
ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
ALTER EVENT intact_check_1 RENAME TO intact_check_2;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check_1;
-ERROR HY000: Unknown event 'intact_check_1'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check_2;
-ERROR HY000: Unknown event 'intact_check_2'
+ERROR HY000: Failed to open mysql.event
DROP EVENT intact_check;
+ERROR HY000: Failed to open mysql.event
DROP DATABASE IF EXISTS mysqltest_no_such_database;
Warnings:
Note 1008 Can't drop database 'mysqltest_no_such_database'; database doesn't exist
CREATE DATABASE mysqltest_db2;
DROP DATABASE mysqltest_db2;
+Warnings:
+Error 1545 Failed to open mysql.event
SELECT @@event_scheduler;
@@event_scheduler
OFF
@@ -425,4 +435,42 @@ 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 character_set_client collation_connection Database Collation
+
+#
+# Bug#12394306: the sever may crash if mysql.event is corrupted
+#
+
+CREATE EVENT ev1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
+ALTER EVENT ev1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
+
+CREATE TABLE event_original LIKE mysql.event;
+INSERT INTO event_original SELECT * FROM mysql.event;
+
+ALTER TABLE mysql.event MODIFY modified CHAR(1);
+Warnings:
+Warning 1265 Data truncated for column 'modified' at row 1
+
+SHOW EVENTS;
+ERROR HY000: Failed to open mysql.event
+
+SELECT event_name, created, last_altered FROM information_schema.events;
+ERROR HY000: Failed to open mysql.event
+
+CREATE EVENT ev2 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
+ERROR HY000: Failed to open mysql.event
+
+ALTER EVENT ev1 ON SCHEDULE EVERY 9 HOUR DO SELECT 9;
+ERROR HY000: Failed to open mysql.event
+
+DROP TABLE mysql.event;
+RENAME TABLE event_original TO mysql.event;
+
+DROP EVENT ev1;
+
+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 tests
+#
drop database events_test;
diff --git a/mysql-test/r/events_2.result b/mysql-test/r/events_2.result
index 530d8559f11..66ec00d7357 100644
--- a/mysql-test/r/events_2.result
+++ b/mysql-test/r/events_2.result
@@ -133,15 +133,15 @@ select event_name from information_schema.events;
event_name
e1
create event e2 on schedule every 10 hour do select 1;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 disable;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 rename to e3;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e2;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e1;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;
lock table t1 write;
show create event e1;
@@ -151,15 +151,15 @@ select event_name from information_schema.events;
event_name
e1
create event e2 on schedule every 10 hour do select 1;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 disable;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 rename to e3;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e2;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e1;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;
lock table t1 read, mysql.event read;
show create event e1;
@@ -169,15 +169,15 @@ select event_name from information_schema.events;
event_name
e1
create event e2 on schedule every 10 hour do select 1;
-ERROR HY000: Table 'event' was locked with a READ lock and can't be updated
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 disable;
-ERROR HY000: Table 'event' was locked with a READ lock and can't be updated
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 rename to e3;
-ERROR HY000: Table 'event' was locked with a READ lock and can't be updated
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e2;
-ERROR HY000: Table 'event' was locked with a READ lock and can't be updated
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e1;
-ERROR HY000: Table 'event' was locked with a READ lock and can't be updated
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;
lock table t1 write, mysql.event read;
show create event e1;
@@ -187,15 +187,15 @@ select event_name from information_schema.events;
event_name
e1
create event e2 on schedule every 10 hour do select 1;
-ERROR HY000: Table 'event' was locked with a READ lock and can't be updated
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 disable;
-ERROR HY000: Table 'event' was locked with a READ lock and can't be updated
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 rename to e3;
-ERROR HY000: Table 'event' was locked with a READ lock and can't be updated
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e2;
-ERROR HY000: Table 'event' was locked with a READ lock and can't be updated
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e1;
-ERROR HY000: Table 'event' was locked with a READ lock and can't be updated
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;
lock table t1 read, mysql.event write;
ERROR HY000: You can't combine write-locking of system tables with other tables or lock types
@@ -209,11 +209,17 @@ select event_name from information_schema.events;
event_name
e1
create event e2 on schedule every 10 hour do select 1;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 disable;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
alter event e2 rename to e3;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e3;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
drop event e1;
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;
+drop event e1;
Make sure we have left no events
select event_name from information_schema.events;
event_name
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index 7b5b53210ea..b98d1674a3c 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -419,7 +419,7 @@ 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 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
+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
DROP EVENT e1;
SET TIME_ZONE='+05:00';
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO
@@ -535,6 +535,7 @@ DROP EVENT e3;
DROP EVENT e2;
DROP EVENT e1;
SET TIME_ZONE=@save_time_zone;
+SET TIMESTAMP=DEFAULT;
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
@@ -568,6 +569,7 @@ USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
SET GLOBAL event_scheduler = ON;
CREATE TABLE events_test.event_log
(id int KEY AUTO_INCREMENT, ev_nm char(40), ev_cnt int, ev_tm timestamp)
@@ -745,6 +747,68 @@ event_name originator
ev1 4294967295
DROP EVENT ev1;
SET GLOBAL server_id = @old_server_id;
+CREATE DATABASE event_test12;
+USE event_test12;
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
+CREATE DATABASE event_test1;
+USE event_test1;
+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
+DROP DATABASE event_test1;
+DROP DATABASE event_test12;
+#
+# Bug#12546938 (formerly known as bug#61005):
+# CREATE IF NOT EXIST EVENT WILL CREATE MULTIPLE RUNNING EVENTS
+#
+USE events_test;
+SET GLOBAL event_scheduler = ON;
+DROP TABLE IF EXISTS table_bug12546938;
+DROP EVENT IF EXISTS event_Bug12546938;
+CREATE TABLE table_bug12546938 (i INT);
+# Create an event which will be executed with a small delay
+# and won't be automatically dropped after that.
+CREATE EVENT event_Bug12546938
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
+ENABLE DO
+BEGIN
+INSERT INTO table_bug12546938 VALUES(1);
+END
+|
+# Now try to create the same event using CREATE EVENT IF NOT EXISTS.
+# A warning should be emitted. A new event should not be created nor
+# the old event should be re-executed.
+CREATE EVENT IF NOT EXISTS event_bug12546938
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
+ENABLE DO
+BEGIN
+INSERT INTO table_bug12546938 VALUES (1);
+END
+|
+Warnings:
+Note 1537 Event 'event_bug12546938' already exists
+# Wait until at least one instance of event is executed.
+# Check that only one instance of our event was executed.
+SELECT COUNT(*) FROM table_bug12546938;
+COUNT(*)
+1
+# Clean-up.
+DROP EVENT IF EXISTS event_Bug12546938;
+DROP TABLE table_bug12546938;
+SET GLOBAL EVENT_SCHEDULER = OFF;
+DROP DATABASE IF EXISTS event_test11764334;
+CREATE DATABASE event_test11764334;
+USE event_test11764334;
+CREATE EVENT ev1 ON SCHEDULE EVERY 3 SECOND DISABLE DO SELECT 1;
+SHOW EVENTS IN event_test11764334 WHERE NAME='ev1';
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+event_test11764334 ev1 root@localhost SYSTEM RECURRING NULL 3 SECOND # # DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+ALTER EVENT ev1 ON SCHEDULE EVERY 4 SECOND;
+SHOW EVENTS IN event_test11764334 WHERE NAME='ev1';
+Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+event_test11764334 ev1 root@localhost SYSTEM RECURRING NULL 4 SECOND # # DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+DROP EVENT ev1;
+DROP DATABASE event_test11764334;
+USE test;
DROP DATABASE events_test;
SET GLOBAL event_scheduler= 'ON';
SET @@global.concurrent_insert= @concurrent_insert;
diff --git a/mysql-test/r/events_restart.result b/mysql-test/r/events_restart.result
index 4db61d357ce..6a751fa29f8 100644
--- a/mysql-test/r/events_restart.result
+++ b/mysql-test/r/events_restart.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
set global event_scheduler=off;
drop database if exists events_test;
create database events_test;
@@ -52,6 +53,8 @@ Warnings:
Note 1008 Can't drop database 'mysqltest_database_not_exists'; database doesn't exist
create database mysqltest_db1;
drop database mysqltest_db1;
+Warnings:
+Error 1545 Failed to open mysql.event
Restore the original mysql.event table
drop table mysql.event;
rename table event_like to mysql.event;
diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result
index fc8c2ffcaf7..81072bde24c 100644
--- a/mysql-test/r/explain.result
+++ b/mysql-test/r/explain.result
@@ -180,7 +180,6 @@ ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP col
SHOW WARNINGS;
Level Code Message
Error 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
-Note 1003 select 1 AS `1` from `test`.`t1` where <not>(<exists>(...))
SET SESSION sql_mode=@old_sql_mode;
DROP TABLE t1;
End of 5.0 tests.
@@ -271,4 +270,64 @@ EXPLAIN SELECT c1 FROM t1 WHERE c2 = 1 AND c4 = 1 AND c5 = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref c2,c2_2 c2 10 const,const 3 Using where
DROP TABLE t1;
+#
+# Bug#56814 Explain + subselect + fulltext crashes server
+#
+CREATE TABLE t1(f1 VARCHAR(6) NOT NULL,
+FULLTEXT KEY(f1),UNIQUE(f1));
+INSERT INTO t1 VALUES ('test');
+EXPLAIN SELECT 1 FROM t1
+WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a ON (MATCH(t1.f1) AGAINST (""))
+WHERE t1.f1 GROUP BY t1.f1));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1
+2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort
+2 SUBQUERY t1 fulltext f1 f1 0 1 Using where
+PREPARE stmt FROM
+'EXPLAIN SELECT 1 FROM t1
+ WHERE 1 > ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a
+ ON (MATCH(t1.f1) AGAINST (""))
+ WHERE t1.f1 GROUP BY t1.f1))';
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1
+2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort
+2 SUBQUERY t1 fulltext f1 f1 0 1 Using where
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1
+2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort
+2 SUBQUERY t1 fulltext f1 f1 0 1 Using where
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM
+'EXPLAIN SELECT 1 FROM t1
+ WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a
+ ON (MATCH(t1.f1) AGAINST (""))
+ WHERE t1.f1 GROUP BY t1.f1))';
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1
+2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort
+2 SUBQUERY t1 fulltext f1 f1 0 1 Using where
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1
+2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort
+2 SUBQUERY t1 fulltext f1 f1 0 1 Using where
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
End of 5.1 tests.
+#
+# Bug#11829785 EXPLAIN EXTENDED CRASH WITH RIGHT OUTER JOIN, SUBQUERIES
+#
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0), (0);
+PREPARE s FROM
+'EXPLAIN EXTENDED
+SELECT SUBSTRING(1, (SELECT 1 FROM t1 a1 RIGHT OUTER JOIN t1 ON 0)) AS d
+FROM t1 WHERE 0 > ANY (SELECT @a FROM t1)';
+EXECUTE s;
+ERROR 21000: Subquery returns more than 1 row
+DEALLOCATE PREPARE s;
+DROP TABLE t1;
+#
diff --git a/mysql-test/r/file_contents.result b/mysql-test/r/file_contents.result
new file mode 100644
index 00000000000..110769e12f8
--- /dev/null
+++ b/mysql-test/r/file_contents.result
@@ -0,0 +1,6 @@
+
+Checking 'INFO_SRC' and 'INFO_BIN'
+INFO_SRC: Found MySQL version number / Found BZR revision id
+INFO_BIN: Found 'Compiler ... used' line / Found 'Feature flags' line
+
+End of tests
diff --git a/mysql-test/r/filesort_debug.result b/mysql-test/r/filesort_debug.result
new file mode 100644
index 00000000000..c35a6753353
--- /dev/null
+++ b/mysql-test/r/filesort_debug.result
@@ -0,0 +1,33 @@
+SET @old_debug= @@session.debug;
+#
+# Bug#36022 please log more information about "Sort aborted" queries
+#
+CREATE TABLE t1(f0 int auto_increment primary key, f1 int);
+INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);
+SET session debug= '+d,make_char_array_fail';
+CALL mtr.add_suppression("Out of sort memory");
+SELECT * FROM t1 ORDER BY f1 ASC, f0;
+ERROR HY001: Out of sort memory, consider increasing server sort buffer size
+SET session debug= @old_debug;
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
+ERROR 42000: Incorrect number of arguments for FUNCTION test.f1; expected 0, got 1
+DROP TABLE t1;
+DROP FUNCTION f1;
+#
+# Bug #11747102
+# 30771: LOG MORE INFO ABOUT THREADS KILL'D AND SORT ABORTED MESSAGES
+#
+# connection 1
+CREATE TABLE t1(f0 int auto_increment primary key, f1 int);
+INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);
+SET DEBUG_SYNC='filesort_start SIGNAL filesort_started WAIT_FOR filesort_killed';
+# Sending: (not reaped since connection is killed later)
+SELECT * FROM t1 ORDER BY f1 ASC, f0;
+# connection 2
+SET DEBUG_SYNC='now WAIT_FOR filesort_started';
+KILL @id;
+SET DEBUG_SYNC='now SIGNAL filesort_killed';
+# connection default
+SET DEBUG_SYNC= "RESET";
+DROP TABLE t1;
diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result
index aee18d91edf..bbfea2dade8 100644
--- a/mysql-test/r/flush.result
+++ b/mysql-test/r/flush.result
@@ -373,3 +373,96 @@ commit;
# --> connection con2
# --> connection default
drop table t1;
+#
+# Test for bug #55273 "FLUSH TABLE tm WITH READ LOCK for Merge table
+# causes assert failure".
+#
+drop table if exists t1, t2, tm;
+create table t1 (i int);
+create table t2 (i int);
+create table tm (i int) engine=merge union=(t1, t2);
+insert into t1 values (1), (2);
+insert into t2 values (3), (4);
+# The below statement should succeed and lock merge
+# table for read. Only merge table gets flushed and
+# not underlying tables.
+flush tables tm with read lock;
+select * from tm;
+i
+1
+2
+3
+4
+# Check that underlying tables are locked.
+select * from t1;
+i
+1
+2
+select * from t2;
+i
+3
+4
+unlock tables;
+# This statement should succeed as well and flush
+# all tables in the list.
+flush tables tm, t1, t2 with read lock;
+select * from tm;
+i
+1
+2
+3
+4
+# Naturally, underlying tables should be locked in this case too.
+select * from t1;
+i
+1
+2
+select * from t2;
+i
+3
+4
+unlock tables;
+drop tables tm, t1, t2;
+#
+# Test for bug #57006 "Deadlock between HANDLER and
+# FLUSH TABLES WITH READ LOCK".
+#
+drop table if exists t1, t2;
+create table t1 (i int);
+create table t2 (i int);
+handler t1 open;
+# Switching to connection 'con1'.
+# Sending:
+flush tables with read lock;
+# Switching to connection 'con2'.
+# Wait until FTWRL starts waiting for 't1' to be closed.
+# Switching to connection 'default'.
+# The below statement should not cause deadlock.
+# Sending:
+insert into t2 values (1);
+# Switching to connection 'con2'.
+# Wait until INSERT starts to wait for FTWRL to go away.
+# Switching to connection 'con1'.
+# FTWRL should be able to continue now.
+# Reap FTWRL.
+unlock tables;
+# Switching to connection 'default'.
+# Reap INSERT.
+handler t1 close;
+# Cleanup.
+drop tables t1, t2;
+#
+# Bug#57649 FLUSH TABLES under FLUSH TABLES <list> WITH READ LOCK leads
+# to assert failure.
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT);
+FLUSH TABLES t1 WITH READ LOCK;
+FLUSH TABLES;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a= 1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+ALTER TABLE t1 COMMENT 'test';
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+UNLOCK TABLES;
+DROP TABLE t1;
diff --git a/mysql-test/r/flush_read_lock.result b/mysql-test/r/flush_read_lock.result
new file mode 100644
index 00000000000..cd7083405bf
--- /dev/null
+++ b/mysql-test/r/flush_read_lock.result
@@ -0,0 +1,1684 @@
+# FTWRL takes two global metadata locks -- a global shared
+# metadata lock and the commit blocker lock.
+# The first lock prevents DDL from taking place.
+# Let's say that all DDL statements that take metadata
+# locks form class #1 -- incompatible with FTWRL because
+# take incompatible MDL table locks.
+# The first global lock doesn't, however, prevent standalone
+# COMMITs (or implicit COMMITs) from taking place, since a
+# COMMIT doesn't take table locks. It doesn't prevent
+# DDL on temporary tables either, since they don't
+# take any table locks either.
+# Most DDL statements do not perform an implicit commit
+# if operate on a temporary table. Examples are CREATE
+# TEMPORARY TABLE and DROP TEMPORARY TABLE.
+# Thus, these DDL statements can go through in presence
+# of FTWRL. This is class #2 -- compatible because
+# do not take incompatible MDL locks and do not issue
+# implicit commit..
+# (Although these operations do not commit, their effects
+# cannot be rolled back either.)
+# ALTER TABLE, ANALYZE, OPTIMIZE and some others always
+# issue an implicit commit, even if its argument is a
+# temporary table.
+# *Howewer* an implicit commit is a no-op if all engines
+# used since the start of transactiona are non-
+# transactional. Thus, for non-transactional engines,
+# these operations are not blocked by FTWRL.
+# This is class #3 -- compatible because do not take
+# MDL table locks and are non-transactional.
+# On the contrary, for transactional engines, there
+# is always a commit, regardless of whether a table
+# is temporary or not. Thus, for example, ALTER TABLE
+# for a transactional engine will wait for FTWRL,
+# even if the subject table is temporary.
+# Thus ALTER TABLE <temporary> is incompatible
+# with FTWRL. This is class #4 -- incompatible
+# becuase issue implicit COMMIT which is not a no-op.
+# Finally, there are administrative statements (such as
+# RESET SLAVE) that do not take any locks and do not
+# issue COMMIT.
+# This is class #5.
+# The goal of this coverage is to test statements
+# of all classes.
+# @todo: documents the effects of @@autocommit,
+# DML and temporary transactional tables.
+# Use MyISAM engine for the most of the tables
+# used in this test in order to be able to
+# check that DDL statements on temporary tables
+# are compatible with FTRWL.
+drop tables if exists t1_base, t2_base, t3_trans;
+drop tables if exists tm_base, tm_base_temp;
+drop database if exists mysqltest1;
+# We're going to test ALTER DATABASE UPGRADE
+drop database if exists `#mysql50#mysqltest-2`;
+drop procedure if exists p1;
+drop function if exists f1;
+drop view if exists v1;
+drop procedure if exists p2;
+drop function if exists f2_base;
+drop function if exists f2_temp;
+drop event if exists e1;
+drop event if exists e2;
+create table t1_base(i int) engine=myisam;
+create table t2_base(j int) engine=myisam;
+create table t3_trans(i int) engine=innodb;
+create temporary table t1_temp(i int) engine=myisam;
+create temporary table t2_temp(j int) engine=myisam;
+create temporary table t3_temp_trans(i int) engine=innodb;
+create database mysqltest1;
+create database `#mysql50#mysqltest-2`;
+create procedure p1() begin end;
+create function f1() returns int return 0;
+create view v1 as select 1 as i;
+create procedure p2(i int) begin end;
+create function f2_base() returns int
+begin
+insert into t1_base values (1);
+return 0;
+end|
+create function f2_temp() returns int
+begin
+insert into t1_temp values (1);
+return 0;
+end|
+create event e1 on schedule every 1 minute do begin end;
+#
+# Test compatibility of FLUSH TABLES WITH READ LOCK
+# with various statements.
+#
+# These tests don't cover some classes of statements:
+# - Replication-related - CHANGE MASTER TO, START/STOP SLAVE and etc
+# (all compatible with FTWRL).
+# - Plugin-related - INSTALL/UNINSTALL (incompatible with FTWRL,
+# require plugin support).
+#
+# 1) ALTER variants.
+#
+# 1.1) ALTER TABLE
+#
+# 1.1.a) For base table should be incompatible with FTWRL.
+#
+Success: Was not able to run 'alter table t1_base add column c1 int' under FTWRL.
+Success: 'alter table t1_base add column c1 int' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'alter table t1_base add column c1 int' is active in another connection.
+#
+# 1.1.b) For a temporary table should be compatible with FTWRL.
+#
+Success: Was able to run 'alter table t1_temp add column c1 int' under FTWRL.
+Success: Was able to run 'alter table t1_temp add column c1 int' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'alter table t1_temp add column c1 int' was active in another connection.
+#
+# 1.2) ALTER DATABASE should be incompatible with FTWRL.
+#
+Success: Was not able to run 'alter database mysqltest1 default character set utf8' under FTWRL.
+Success: 'alter database mysqltest1 default character set utf8' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'alter database mysqltest1 default character set utf8' is active in another connection.
+#
+# 1.3) ALTER DATABASE UPGRADE DATA DIRECTORY NAME should be
+# incompatible with FTWRL.
+#
+Success: Was not able to run 'alter database `#mysql50#mysqltest-2` upgrade data directory name' under FTWRL.
+Success: 'alter database `#mysql50#mysqltest-2` upgrade data directory name' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'alter database `#mysql50#mysqltest-2` upgrade data directory name' is active in another connection.
+#
+# 1.4) ALTER PROCEDURE should be incompatible with FTWRL.
+#
+Success: Was not able to run 'alter procedure p1 comment 'a'' under FTWRL.
+Success: 'alter procedure p1 comment 'a'' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'alter procedure p1 comment 'a'' is active in another connection.
+#
+# 1.5) ALTER FUNCTION should be incompatible with FTWRL.
+#
+Success: Was not able to run 'alter function f1 comment 'a'' under FTWRL.
+Success: 'alter function f1 comment 'a'' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'alter function f1 comment 'a'' is active in another connection.
+#
+# 1.6) ALTER VIEW should be incompatible with FTWRL.
+#
+Success: Was not able to run 'alter view v1 as select 2 as j' under FTWRL.
+Success: 'alter view v1 as select 2 as j' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'alter view v1 as select 2 as j' is active in another connection.
+#
+# 1.7) ALTER EVENT should be incompatible with FTWRL.
+#
+Success: Was not able to run 'alter event e1 comment 'test'' under FTWRL.
+Success: 'alter event e1 comment 'test'' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'alter event e1 comment 'test'' is active in another connection.
+#
+# 1.x) The rest of ALTER statements (ALTER TABLESPACE,
+# ALTER LOGFILE GROUP and ALTER SERVER) are too
+# special to be tested here.
+#
+#
+# 2) ANALYZE TABLE statement is compatible with FTWRL.
+# See Bug#43336 ANALYZE and OPTIMIZE do not honour
+# --read-only for a discussion why.
+#
+Success: Was able to run 'analyze table t1_base' under FTWRL.
+Success: Was able to run 'analyze table t1_base' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'analyze table t1_base' was active in another connection.
+#
+# 3) BEGIN, ROLLBACK and COMMIT statements.
+# BEGIN and ROLLBACK are compatible with FTWRL.
+# COMMIT is not.
+#
+# We need a special test for these statements as
+# FTWRL commits a transaction and because COMMIT
+# is handled in a special way.
+flush tables with read lock;
+begin;
+# ROLLBACK is allowed under FTWRL although there
+# no much sense in it. FTWRL commits any previous
+# changes and doesn't allows any DML after it.
+# So such a ROLLBACK is always a no-op.
+rollback;
+# Although COMMIT is incompatible with FTWRL in
+# other senses it is still allowed under FTWRL.
+# This fact relied upon by some versions of
+# innobackup tool.
+# Similarly to ROLLBACK it is a no-op in this situation.
+commit;
+unlock tables;
+# Check that BEGIN/ROLLBACK are not blocked and
+# COMMIT is blocked by active FTWRL in another
+# connection.
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+begin;
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+# Do some work so ROLLBACK is not a no-op.
+insert into t3_trans values (1);
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+rollback;
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+begin;
+# Do some work so COMMIT is not a no-op.
+insert into t3_trans values (1);
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+# Send:
+commit;
+# Switching to connection 'con1'.
+# Wait until COMMIT is blocked.
+unlock tables;
+# Switching to connection 'default'.
+# Reap COMMIT.
+delete from t3_trans;
+#
+# Check that COMMIT blocks FTWRL in another connection.
+begin;
+insert into t3_trans values (1);
+set debug_sync='RESET';
+set debug_sync='ha_commit_trans_after_acquire_commit_lock SIGNAL parked WAIT_FOR go';
+commit;
+# Switching to connection 'con1'.
+set debug_sync='now WAIT_FOR parked';
+flush tables with read lock;
+# Switching to connection 'con2'.
+# Wait until FTWRL is blocked.
+set debug_sync='now SIGNAL go';
+# Switching to connection 'default'.
+# Reap COMMIT.
+# Switching to connection 'con1'.
+# Reap FTWRL.
+unlock tables;
+# Switching to connection 'default'.
+delete from t3_trans;
+set debug_sync= "RESET";
+# We don't run similar test for BEGIN and ROLLBACK as
+# they release metadata locks in non-standard place.
+#
+# 4) BINLOG statement should be incompatible with FTWRL.
+#
+#
+# Provide format description BINLOG statement first.
+BINLOG '
+MfmqTA8BAAAAZwAAAGsAAAABAAQANS41LjctbTMtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAx+apMEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
+';
+# Now test compatibility for BINLOG statement which is
+# equivalent to INSERT INTO t1_base VALUES (1).
+# Skip last part of compatibility testing as this statement
+# releases metadata locks in non-standard place.
+Success: Was not able to run 'BINLOG '
+MfmqTBMBAAAALgAAAN0AAAAAACgAAAAAAAEABHRlc3QAB3QxX2Jhc2UAAQMAAQ==
+MfmqTBcBAAAAIgAAAP8AAAAAACgAAAAAAAEAAf/+AQAAAA==
+'' under FTWRL.
+Success: 'BINLOG '
+MfmqTBMBAAAALgAAAN0AAAAAACgAAAAAAAEABHRlc3QAB3QxX2Jhc2UAAQMAAQ==
+MfmqTBcBAAAAIgAAAP8AAAAAACgAAAAAAAEAAf/+AQAAAA==
+'' is blocked by FTWRL active in another connection.
+#
+# 5) CALL statement. This statement uses resources in two
+# ways: through expressions used as parameters and through
+# sub-statements. This test covers only usage through
+# parameters as sub-statements do locking individually.
+#
+# 5.a) In simple cases a parameter expression should be
+# compatible with FTWRL.
+# Skip last part of compatibility testing as this statement
+# releases metadata locks in non-standard place.
+Success: Was able to run 'call p2((select count(*) from t1_base))' under FTWRL.
+Success: Was able to run 'call p2((select count(*) from t1_base))' with FTWRL active in another connection.
+#
+# 5.b) In case when an expression uses function which updates
+# base tables CALL should be incompatible with FTWRL.
+#
+# Skip last part of compatibility testing as this statement
+# releases metadata locks in non-standard place.
+Success: Was not able to run 'call p2(f2_base())' under FTWRL.
+Success: 'call p2(f2_base())' is blocked by FTWRL active in another connection.
+#
+# 5.c) If function used as argument updates temporary tables
+# CALL statement should be compatible with FTWRL.
+#
+# Skip last part of compatibility testing as this statement
+# releases metadata locks in non-standard place.
+Success: Was able to run 'call p2(f2_temp())' under FTWRL.
+Success: Was able to run 'call p2(f2_temp())' with FTWRL active in another connection.
+#
+# 6) CHECK TABLE statement is compatible with FTWRL.
+#
+Success: Was able to run 'check table t1_base' under FTWRL.
+Success: Was able to run 'check table t1_base' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'check table t1_base' was active in another connection.
+#
+# 7) CHECKSUM TABLE statement is compatible with FTWRL.
+#
+Success: Was able to run 'checksum table t1_base' under FTWRL.
+Success: Was able to run 'checksum table t1_base' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'checksum table t1_base' was active in another connection.
+#
+# 8) CREATE variants.
+#
+# 8.1) CREATE TABLE statement.
+#
+# 8.1.a) CREATE TABLE is incompatible with FTWRL when
+# base table is created.
+Success: Was not able to run 'create table t3_base(i int)' under FTWRL.
+Success: 'create table t3_base(i int)' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'create table t3_base(i int)' is active in another connection.
+# 8.1.b) CREATE TABLE is compatible with FTWRL when
+# temporary table is created.
+Success: Was able to run 'create temporary table t3_temp(i int)' under FTWRL.
+Success: Was able to run 'create temporary table t3_temp(i int)' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'create temporary table t3_temp(i int)' was active in another connection.
+# 8.1.c) CREATE TABLE LIKE is incompatible with FTWRL when
+# base table is created.
+Success: Was not able to run 'create table t3_base like t1_temp' under FTWRL.
+Success: 'create table t3_base like t1_temp' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'create table t3_base like t1_temp' is active in another connection.
+# 8.1.d) CREATE TABLE LIKE is compatible with FTWRL when
+# temporary table is created.
+Success: Was able to run 'create temporary table t3_temp like t1_base' under FTWRL.
+Success: Was able to run 'create temporary table t3_temp like t1_base' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'create temporary table t3_temp like t1_base' was active in another connection.
+# 8.1.e) CREATE TABLE SELECT is incompatible with FTWRL when
+# base table is created.
+Success: Was not able to run 'create table t3_base select 1 as i' under FTWRL.
+Success: 'create table t3_base select 1 as i' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'create table t3_base select 1 as i' is active in another connection.
+# 8.1.f) CREATE TABLE SELECT is compatible with FTWRL when
+# temporary table is created.
+Success: Was able to run 'create temporary table t3_temp select 1 as i' under FTWRL.
+Success: Was able to run 'create temporary table t3_temp select 1 as i' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'create temporary table t3_temp select 1 as i' was active in another connection.
+# 8.2) CREATE INDEX statement.
+#
+# 8.2.a) CREATE INDEX is incompatible with FTWRL when
+# applied to base table.
+Success: Was not able to run 'create index i on t1_base (i)' under FTWRL.
+Success: 'create index i on t1_base (i)' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'create index i on t1_base (i)' is active in another connection.
+# 8.2.b) CREATE INDEX is compatible with FTWRL when
+# applied to temporary table.
+Success: Was able to run 'create index i on t1_temp (i)' under FTWRL.
+Success: Was able to run 'create index i on t1_temp (i)' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'create index i on t1_temp (i)' was active in another connection.
+#
+# 8.3) CREATE DATABASE is incompatible with FTWRL.
+#
+Success: Was not able to run 'create database mysqltest2' under FTWRL.
+Success: 'create database mysqltest2' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'create database mysqltest2' is active in another connection.
+#
+# 8.4) CREATE VIEW is incompatible with FTWRL.
+#
+Success: Was not able to run 'create view v2 as select 1 as j' under FTWRL.
+Success: 'create view v2 as select 1 as j' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'create view v2 as select 1 as j' is active in another connection.
+#
+# 8.5) CREATE TRIGGER is incompatible with FTWRL.
+#
+Success: Was not able to run 'create trigger t1_bi before insert on t1_base for each row begin end' under FTWRL.
+Success: 'create trigger t1_bi before insert on t1_base for each row begin end' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'create trigger t1_bi before insert on t1_base for each row begin end' is active in another connection.
+#
+# 8.6) CREATE FUNCTION is incompatible with FTWRL.
+#
+Success: Was not able to run 'create function f2() returns int return 0' under FTWRL.
+Success: 'create function f2() returns int return 0' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'create function f2() returns int return 0' is active in another connection.
+#
+# 8.7) CREATE PROCEDURE is incompatible with FTWRL.
+#
+Success: Was not able to run 'create procedure p3() begin end' under FTWRL.
+Success: 'create procedure p3() begin end' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'create procedure p3() begin end' is active in another connection.
+#
+# 8.8) CREATE EVENT should be incompatible with FTWRL.
+#
+Success: Was not able to run 'create event e2 on schedule every 1 minute do begin end' under FTWRL.
+Success: 'create event e2 on schedule every 1 minute do begin end' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'create event e2 on schedule every 1 minute do begin end' is active in another connection.
+#
+# 8.9) CREATE USER should be incompatible with FTWRL.
+#
+Success: Was not able to run 'create user mysqltest_u1' under FTWRL.
+Success: 'create user mysqltest_u1' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'create user mysqltest_u1' is active in another connection.
+#
+# 8.x) The rest of CREATE variants (CREATE LOGFILE GROUP,
+# CREATE TABLESPACE and CREATE SERVER) are too special
+# to test here.
+#
+#
+# 9) PREPARE, EXECUTE and DEALLOCATE PREPARE statements.
+#
+# 9.1) PREPARE statement is compatible with FTWRL as it
+# doesn't change any data.
+#
+# 9.1.a) Prepare of simple INSERT statement.
+#
+# Skip last part of compatibility testing as this statement
+# releases metadata locks in non-standard place.
+Success: Was able to run 'prepare stmt1 from 'insert into t1_base values (1)'' under FTWRL.
+Success: Was able to run 'prepare stmt1 from 'insert into t1_base values (1)'' with FTWRL active in another connection.
+#
+# 9.1.b) Prepare of multi-UPDATE. At some point such statements
+# tried to acquire thr_lock.c locks during prepare phase.
+# This no longer happens and thus it is compatible with
+# FTWRL.
+# Skip last part of compatibility testing as this statement
+# releases metadata locks in non-standard place.
+Success: Was able to run 'prepare stmt1 from 'update t1_base, t2_base set t1_base.i= 1 where t1_base.i = t2_base.j'' under FTWRL.
+Success: Was able to run 'prepare stmt1 from 'update t1_base, t2_base set t1_base.i= 1 where t1_base.i = t2_base.j'' with FTWRL active in another connection.
+#
+# 9.1.c) Prepare of multi-DELETE. Again PREPARE of such
+# statement should be compatible with FTWRL.
+# Skip last part of compatibility testing as this statement
+# releases metadata locks in non-standard place.
+Success: Was able to run 'prepare stmt1 from 'delete t1_base from t1_base, t2_base where t1_base.i = t2_base.j'' under FTWRL.
+Success: Was able to run 'prepare stmt1 from 'delete t1_base from t1_base, t2_base where t1_base.i = t2_base.j'' with FTWRL active in another connection.
+#
+# 9.2) Compatibility of EXECUTE statement depends on statement
+# to be executed.
+#
+# 9.2.a) EXECUTE for statement which is itself compatible with
+# FTWRL should be compatible.
+prepare stmt1 from 'select * from t1_base';
+Success: Was able to run 'execute stmt1' under FTWRL.
+Success: Was able to run 'execute stmt1' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'execute stmt1' was active in another connection.
+deallocate prepare stmt1;
+call mtr.add_suppression("Slave SQL.*Can.t execute the query because you have a conflicting read lock., Error_code: 1223");
+#
+# 9.2.b) EXECUTE for statement which is incompatible with FTWRL
+# should be also incompatible.
+#
+# Check that EXECUTE is not allowed under FTWRL.
+prepare stmt1 from 'insert into t1_base values (1)';
+flush tables with read lock;
+execute stmt1;
+ERROR HY000: Can't execute the query because you have a conflicting read lock
+unlock tables;
+# Check that active FTWRL in another connection
+# blocks EXECUTE which changes data.
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+execute stmt1 ;
+# Switching to connection 'con1'.
+# Check that EXECUTE is blocked.
+unlock tables;
+# Switching to connection 'default'.
+# Reap EXECUTE.
+set debug_sync='RESET';
+set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+execute stmt1; ;
+# Switching to connection 'con1'.
+set debug_sync='now WAIT_FOR parked';
+flush tables with read lock;
+# Switching to connection 'con2'.
+# Wait until FTWRL is blocked.
+set debug_sync='now SIGNAL go';
+# Switching to connection 'default'.
+# Reap EXECUTE.
+# Switching to connection 'con1'.
+# Reap FTWRL.
+unlock tables;
+# Switching to connection 'default'.
+set debug_sync= "RESET";
+delete from t1_base;
+deallocate prepare stmt1;
+#
+# 9.3) DEALLOCATE PREPARE is compatible with FTWRL.
+#
+prepare stmt1 from 'insert into t1_base values (1)';
+Success: Was able to run 'deallocate prepare stmt1' under FTWRL.
+Success: Was able to run 'deallocate prepare stmt1' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'deallocate prepare stmt1' was active in another connection.
+deallocate prepare stmt1;
+#
+# 10) DELETE variations.
+#
+# 10.1) Simple DELETE.
+#
+# 10.1.a) Simple DELETE on base table is incompatible with FTWRL.
+Success: Was not able to run 'delete from t1_base' under FTWRL.
+Success: 'delete from t1_base' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'delete from t1_base' is active in another connection.
+#
+# 10.1.b) Simple DELETE on temporary table is compatible with FTWRL.
+Success: Was able to run 'delete from t1_temp' under FTWRL.
+Success: Was able to run 'delete from t1_temp' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'delete from t1_temp' was active in another connection.
+#
+# 10.2) Multi DELETE.
+#
+# 10.2.a) Multi DELETE on base tables is incompatible with FTWRL.
+Success: Was not able to run 'delete t1_base from t1_base, t2_base where t1_base.i = t2_base.j' under FTWRL.
+Success: 'delete t1_base from t1_base, t2_base where t1_base.i = t2_base.j' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'delete t1_base from t1_base, t2_base where t1_base.i = t2_base.j' is active in another connection.
+#
+# 10.2.b) Multi DELETE on temporary tables is compatible with FTWRL.
+Success: Was able to run 'delete t1_temp from t1_temp, t2_temp where t1_temp.i = t2_temp.j' under FTWRL.
+Success: Was able to run 'delete t1_temp from t1_temp, t2_temp where t1_temp.i = t2_temp.j' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'delete t1_temp from t1_temp, t2_temp where t1_temp.i = t2_temp.j' was active in another connection.
+#
+# 11) DESCRIBE should be compatible with FTWRL.
+#
+Success: Was able to run 'describe t1_base' under FTWRL.
+Success: Was able to run 'describe t1_base' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'describe t1_base' was active in another connection.
+#
+# 12) Compatibility of DO statement with FTWRL depends on its
+# expression.
+#
+# 12.a) DO with expression which does not change base table
+# should be compatible with FTWRL.
+Success: Was able to run 'do (select count(*) from t1_base)' under FTWRL.
+Success: Was able to run 'do (select count(*) from t1_base)' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'do (select count(*) from t1_base)' was active in another connection.
+#
+# 12.b) DO which calls SF updating base table should be
+# incompatible with FTWRL.
+Success: Was not able to run 'do f2_base()' under FTWRL.
+Success: 'do f2_base()' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'do f2_base()' is active in another connection.
+#
+# 12.c) DO which calls SF updating temporary table should be
+# compatible with FTWRL.
+Success: Was able to run 'do f2_temp()' under FTWRL.
+Success: Was able to run 'do f2_temp()' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'do f2_temp()' was active in another connection.
+#
+# 13) DROP variants.
+#
+# 13.1) DROP TABLES.
+#
+# 13.1.a) DROP TABLES which affects base tables is incompatible
+# with FTWRL.
+Success: Was not able to run 'drop table t2_base' under FTWRL.
+Success: 'drop table t2_base' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'drop table t2_base' is active in another connection.
+# 13.1.b) DROP TABLES which affects only temporary tables
+# in theory can be compatible with FTWRL.
+# In practice it is not yet.
+Success: Was not able to run 'drop table t2_temp' under FTWRL.
+Success: 'drop table t2_temp' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'drop table t2_temp' is active in another connection.
+#
+# 13.1.c) DROP TEMPORARY TABLES should be compatible with FTWRL.
+Success: Was able to run 'drop temporary table t2_temp' under FTWRL.
+Success: Was able to run 'drop temporary table t2_temp' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'drop temporary table t2_temp' was active in another connection.
+#
+# 13.2) DROP INDEX.
+#
+# 13.2.a) DROP INDEX on a base table is incompatible with FTWRL.
+create index i on t1_base (i);
+Success: Was not able to run 'drop index i on t1_base' under FTWRL.
+Success: 'drop index i on t1_base' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'drop index i on t1_base' is active in another connection.
+drop index i on t1_base;
+#
+# 13.2.b) DROP INDEX on a temporary table is compatible with FTWRL.
+create index i on t1_temp (i);
+Success: Was able to run 'drop index i on t1_temp' under FTWRL.
+Success: Was able to run 'drop index i on t1_temp' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'drop index i on t1_temp' was active in another connection.
+drop index i on t1_temp;
+#
+# 13.3) DROP DATABASE is incompatible with FTWRL
+#
+Success: Was not able to run 'drop database mysqltest1' under FTWRL.
+Success: 'drop database mysqltest1' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'drop database mysqltest1' is active in another connection.
+#
+# 13.4) DROP FUNCTION is incompatible with FTWRL.
+#
+Success: Was not able to run 'drop function f1' under FTWRL.
+Success: 'drop function f1' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'drop function f1' is active in another connection.
+#
+# 13.5) DROP PROCEDURE is incompatible with FTWRL.
+#
+Success: Was not able to run 'drop procedure p1' under FTWRL.
+Success: 'drop procedure p1' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'drop procedure p1' is active in another connection.
+#
+# 13.6) DROP USER should be incompatible with FTWRL.
+#
+create user mysqltest_u1;
+Success: Was not able to run 'drop user mysqltest_u1' under FTWRL.
+Success: 'drop user mysqltest_u1' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'drop user mysqltest_u1' is active in another connection.
+drop user mysqltest_u1;
+#
+# 13.7) DROP VIEW should be incompatible with FTWRL.
+#
+Success: Was not able to run 'drop view v1' under FTWRL.
+Success: 'drop view v1' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'drop view v1' is active in another connection.
+#
+# 13.8) DROP EVENT should be incompatible with FTWRL.
+#
+Success: Was not able to run 'drop event e1' under FTWRL.
+Success: 'drop event e1' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'drop event e1' is active in another connection.
+#
+# 13.9) DROP TRIGGER is incompatible with FTWRL.
+#
+create trigger t1_bi before insert on t1_base for each row begin end;
+Success: Was not able to run 'drop trigger t1_bi' under FTWRL.
+Success: 'drop trigger t1_bi' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'drop trigger t1_bi' is active in another connection.
+drop trigger t1_bi;
+#
+# 13.x) The rest of DROP variants (DROP TABLESPACE, DROP LOGFILE
+# GROUP and DROP SERVER) are too special to test here.
+#
+#
+# 14) FLUSH variants.
+#
+# Test compatibility of _some_ important FLUSH variants with FTWRL.
+#
+# 14.1) FLUSH TABLES WITH READ LOCK is compatible with itself.
+#
+# Check that FTWRL statements can be run while FTWRL
+# is active in another connection.
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# The second FTWRL in a row is allowed at the moment.
+# It does not make much sense as it does only flush.
+flush tables with read lock;
+unlock tables;
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+flush tables with read lock;
+unlock tables;
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+#
+# 14.2) FLUSH TABLES <list> WITH READ LOCK is not blocked by
+# active FTWRL. But since the latter keeps tables open
+# FTWRL is blocked by FLUSH TABLES <list> WITH READ LOCK.
+flush tables with read lock;
+# FT <list> WRL is allowed under FTWRL at the moment.
+# It does not make much sense though.
+flush tables t1_base, t2_base with read lock;
+unlock tables;
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+flush tables t1_base, t2_base with read lock;
+unlock tables;
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+flush tables t1_base, t2_base with read lock;
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'con2'.
+# Wait until FTWRL is blocked.
+# Switching to connection 'default'.
+unlock tables;
+# Switching to connection 'con1'.
+# Reap FTWRL.
+unlock tables;
+# Switching to connection 'default'.
+#
+# 14.3) FLUSH TABLES is compatible with FTWRL.
+Success: Was able to run 'flush tables' under FTWRL.
+Success: Was able to run 'flush tables' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'flush tables' was active in another connection.
+#
+# 14.4) FLUSH TABLES <list> is compatible with FTWRL.
+Success: Was able to run 'flush table t1_base, t2_base' under FTWRL.
+Success: Was able to run 'flush table t1_base, t2_base' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'flush table t1_base, t2_base' was active in another connection.
+#
+# 14.5) FLUSH PRIVILEGES is compatible with FTWRL.
+Success: Was able to run 'flush privileges' under FTWRL.
+Success: Was able to run 'flush privileges' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'flush privileges' was active in another connection.
+#
+# 15) GRANT statement should be incompatible with FTWRL.
+#
+Success: Was not able to run 'grant all privileges on t1_base to mysqltest_u1' under FTWRL.
+Success: 'grant all privileges on t1_base to mysqltest_u1' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'grant all privileges on t1_base to mysqltest_u1' is active in another connection.
+drop user mysqltest_u1;
+#
+# 16) All HANDLER variants are half-compatible with FTWRL.
+# I.e. they are not blocked by active FTWRL. But since open
+# HANDLER means open table instance FTWRL is blocked while
+# HANDLER is not closed.
+#
+# Check that HANDLER statements succeed under FTWRL.
+flush tables with read lock;
+handler t1_base open;
+handler t1_base read first;
+i
+handler t1_base close;
+unlock tables;
+# Check that HANDLER statements can be run while FTWRL
+# is active in another connection.
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+handler t1_base open;
+handler t1_base read first;
+i
+handler t1_base close;
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+#
+# 17) HELP statement is compatible with FTWRL.
+#
+Success: Was able to run 'help no_such_topic' under FTWRL.
+Success: Was able to run 'help no_such_topic' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'help no_such_topic' was active in another connection.
+#
+# 18) INSERT statement.
+#
+# 18.a) Ordinary INSERT into base table is incompatible with FTWRL.
+Success: Was not able to run 'insert into t1_base values (1)' under FTWRL.
+Success: 'insert into t1_base values (1)' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'insert into t1_base values (1)' is active in another connection.
+#
+# 18.b) Ordinary INSERT into temp table is compatible with FTWRL.
+Success: Was able to run 'insert into t1_temp values (1)' under FTWRL.
+Success: Was able to run 'insert into t1_temp values (1)' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'insert into t1_temp values (1)' was active in another connection.
+#
+# 18.c) INSERT DELAYED is incompatible with FTWRL.
+Success: Was not able to run 'insert delayed into t1_base values (1)' under FTWRL.
+Success: 'insert delayed into t1_base values (1)' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'insert delayed into t1_base values (1)' is active in another connection.
+delete from t1_base;
+#
+# 18.d) INSERT SELECT into base table is incompatible with FTWRL.
+Success: Was not able to run 'insert into t1_base select * from t1_temp' under FTWRL.
+Success: 'insert into t1_base select * from t1_temp' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'insert into t1_base select * from t1_temp' is active in another connection.
+#
+# 18.e) INSERT SELECT into temp table is compatible with FTWRL.
+Success: Was able to run 'insert into t1_temp select * from t1_base' under FTWRL.
+Success: Was able to run 'insert into t1_temp select * from t1_base' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'insert into t1_temp select * from t1_base' was active in another connection.
+#
+# 19) KILL statement is compatible with FTWRL.
+#
+# Check that KILL can be run under FTWRL.
+flush tables with read lock;
+set @id:= connection_id();
+kill query @id;
+ERROR 70100: Query execution was interrupted
+unlock tables;
+# Check that KILL statements can be run while FTWRL
+# is active in another connection.
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+kill query @id;
+ERROR 70100: Query execution was interrupted
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+# Finally check that KILL doesn't block FTWRL
+set debug_sync='RESET';
+set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+kill query @id;
+# Switching to connection 'con1'.
+set debug_sync='now WAIT_FOR parked';
+flush tables with read lock;
+unlock tables;
+set debug_sync='now SIGNAL go';
+# Switching to connection 'default'.
+# Reap KILL.
+ERROR 70100: Query execution was interrupted
+set debug_sync='RESET';
+#
+# 20) LOAD DATA statement.
+#
+# 20.a) LOAD DATA into base table is incompatible with FTWRL.
+Success: Was not able to run 'load data infile '../../std_data/rpl_loaddata.dat' into table t1_base (@dummy, i)' under FTWRL.
+Success: 'load data infile '../../std_data/rpl_loaddata.dat' into table t1_base (@dummy, i)' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'load data infile '../../std_data/rpl_loaddata.dat' into table t1_base (@dummy, i)' is active in another connection.
+#
+# 20.b) LOAD DATA into temporary table is compatible with FTWRL.
+Success: Was able to run 'load data infile '../../std_data/rpl_loaddata.dat' into table t1_temp (@dummy, i)' under FTWRL.
+Success: Was able to run 'load data infile '../../std_data/rpl_loaddata.dat' into table t1_temp (@dummy, i)' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'load data infile '../../std_data/rpl_loaddata.dat' into table t1_temp (@dummy, i)' was active in another connection.
+#
+# 21) LOCK/UNLOCK TABLES statements.
+#
+# LOCK TABLES statement always (almost) blocks FTWRL as it
+# keeps tables open until UNLOCK TABLES.
+# Active FTWRL on the other hand blocks only those
+# LOCK TABLES which allow updating of base tables.
+#
+# 21.a) LOCK TABLES READ is allowed under FTWRL and
+# is not blocked by active FTWRL.
+flush tables with read lock;
+lock tables t1_base read;
+unlock tables;
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+lock tables t1_base read;
+unlock tables;
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+#
+# 21.b) LOCK TABLES WRITE on a base table is disallowed
+# under FTWRL and should be blocked by active FTWRL.
+flush tables with read lock;
+lock tables t1_base write;
+ERROR HY000: Can't execute the query because you have a conflicting read lock
+unlock tables;
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+lock tables t1_base write ;
+# Switching to connection 'con1'.
+# Check that LOCK TABLES WRITE is blocked.
+unlock tables;
+# Switching to connection 'default'.
+# Reap LOCK TABLES WRITE
+unlock tables;
+#
+# 21.c) LOCK TABLES WRITE on temporary table doesn't
+# make much sense but is allowed under FTWRL
+# and should not be blocked by active FTWRL.
+flush tables with read lock;
+lock tables t1_temp write;
+unlock tables;
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+lock tables t1_temp write;
+unlock tables;
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+#
+# 22) OPTIMIZE TABLE statement.
+#
+# 22.a) OPTIMIZE TABLE of base table is incompatible with FTWRL.
+flush tables with read lock;
+# OPTIMIZE statement returns errors as part of result-set.
+optimize table t1_base;
+Table Op Msg_type Msg_text
+test.t1_base optimize Error Can't execute the query because you have a conflicting read lock
+test.t1_base optimize error Corrupt
+unlock tables;
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+optimize table t1_base;
+# Switching to connection 'con1'.
+# Check that OPTIMIZE TABLE is blocked.
+unlock tables;
+# Switching to connection 'default'.
+# Reap OPTIMIZE TABLE
+Table Op Msg_type Msg_text
+test.t1_base optimize status OK
+# We don't check that active OPTIMIZE TABLE blocks
+# FTWRL as this one of statements releasing metadata
+# locks in non-standard place.
+#
+# 22.b) OPTIMIZE TABLE of temporary table is compatible with FTWRL.
+# Skip last part of compatibility testing as this statement
+# releases metadata locks in non-standard place.
+Success: Was able to run 'optimize table t1_temp' under FTWRL.
+Success: Was able to run 'optimize table t1_temp' with FTWRL active in another connection.
+#
+# 23) CACHE statement is compatible with FTWRL.
+#
+# Skip last part of compatibility testing as this statement
+# releases metadata locks in non-standard place.
+Success: Was able to run 'cache index t1_base in default' under FTWRL.
+Success: Was able to run 'cache index t1_base in default' with FTWRL active in another connection.
+#
+# 24) LOAD INDEX statement is compatible with FTWRL.
+#
+# Skip last part of compatibility testing as this statement
+# releases metadata locks in non-standard place.
+Success: Was able to run 'load index into cache t1_base' under FTWRL.
+Success: Was able to run 'load index into cache t1_base' with FTWRL active in another connection.
+#
+# 25) SAVEPOINT/RELEASE SAVEPOINT/ROLLBACK TO SAVEPOINT are
+# compatible with FTWRL.
+#
+# Since manipulations on savepoint have to be done
+# inside transaction and FTWRL commits transaction we
+# need a special test for these statements.
+flush tables with read lock;
+begin;
+savepoint sv1;
+rollback to savepoint sv1;
+release savepoint sv1;
+unlock tables;
+commit;
+# Check that these statements are not blocked by
+# active FTWRL in another connection.
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+begin;
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+# Do some changes to avoid SAVEPOINT and friends
+# being almost no-ops.
+insert into t3_trans values (1);
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+savepoint sv1;
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+insert into t3_trans values (2);
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+rollback to savepoint sv1;
+release savepoint sv1;
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+rollback;
+# Check that these statements don't block FTWRL in
+# another connection.
+begin;
+# Do some changes to avoid SAVEPOINT and friends
+# being almost no-ops.
+insert into t3_trans values (1);
+set debug_sync='RESET';
+set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+savepoint sv1;
+# Switching to connection 'con1'.
+set debug_sync='now WAIT_FOR parked';
+flush tables with read lock;
+unlock tables;
+set debug_sync='now SIGNAL go';
+# Switching to connection 'default'.
+# Reap SAVEPOINT
+insert into t3_trans values (2);
+set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+rollback to savepoint sv1;
+# Switching to connection 'con1'.
+set debug_sync='now WAIT_FOR parked';
+flush tables with read lock;
+unlock tables;
+set debug_sync='now SIGNAL go';
+# Switching to connection 'default'.
+# Reap ROLLBACK TO SAVEPOINT
+set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+release savepoint sv1;
+# Switching to connection 'con1'.
+set debug_sync='now WAIT_FOR parked';
+flush tables with read lock;
+unlock tables;
+set debug_sync='now SIGNAL go';
+# Switching to connection 'default'.
+# Reap RELEASE SAVEPOINT
+rollback;
+set debug_sync= "RESET";
+#
+# 26) RENAME variants.
+#
+# 26.1) RENAME TABLES is incompatible with FTWRL.
+Success: Was not able to run 'rename table t1_base to t3_base' under FTWRL.
+Success: 'rename table t1_base to t3_base' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'rename table t1_base to t3_base' is active in another connection.
+#
+# 26.2) RENAME USER is incompatible with FTWRL.
+create user mysqltest_u1;
+Success: Was not able to run 'rename user mysqltest_u1 to mysqltest_u2' under FTWRL.
+Success: 'rename user mysqltest_u1 to mysqltest_u2' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'rename user mysqltest_u1 to mysqltest_u2' is active in another connection.
+drop user mysqltest_u1;
+#
+# 27) REPAIR TABLE statement.
+#
+# 27.a) REPAIR TABLE of base table is incompatible with FTWRL.
+flush tables with read lock;
+# REPAIR statement returns errors as part of result-set.
+repair table t1_base;
+Table Op Msg_type Msg_text
+test.t1_base repair Error Can't execute the query because you have a conflicting read lock
+test.t1_base repair error Corrupt
+unlock tables;
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+repair table t1_base;
+# Switching to connection 'con1'.
+# Check that REPAIR TABLE is blocked.
+unlock tables;
+# Switching to connection 'default'.
+# Reap REPAIR TABLE
+Table Op Msg_type Msg_text
+test.t1_base repair status OK
+# We don't check that active REPAIR TABLE blocks
+# FTWRL as this one of statements releasing metadata
+# locks in non-standard place.
+#
+# 27.b) REPAIR TABLE of temporary table is compatible with FTWRL.
+# Skip last part of compatibility testing as this statement
+# releases metadata locks in non-standard place.
+Success: Was able to run 'repair table t1_temp' under FTWRL.
+Success: Was able to run 'repair table t1_temp' with FTWRL active in another connection.
+#
+# 28) REPLACE statement.
+#
+# 28.a) Ordinary REPLACE into base table is incompatible with FTWRL.
+Success: Was not able to run 'replace into t1_base values (1)' under FTWRL.
+Success: 'replace into t1_base values (1)' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'replace into t1_base values (1)' is active in another connection.
+#
+# 28.b) Ordinary REPLACE into temp table is compatible with FTWRL.
+Success: Was able to run 'replace into t1_temp values (1)' under FTWRL.
+Success: Was able to run 'replace into t1_temp values (1)' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'replace into t1_temp values (1)' was active in another connection.
+#
+# 28.c) REPLACE SELECT into base table is incompatible with FTWRL.
+Success: Was not able to run 'replace into t1_base select * from t1_temp' under FTWRL.
+Success: 'replace into t1_base select * from t1_temp' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'replace into t1_base select * from t1_temp' is active in another connection.
+#
+# 28.d) REPLACE SELECT into temp table is compatible with FTWRL.
+Success: Was able to run 'replace into t1_temp select * from t1_base' under FTWRL.
+Success: Was able to run 'replace into t1_temp select * from t1_base' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'replace into t1_temp select * from t1_base' was active in another connection.
+#
+# 29) REVOKE variants.
+#
+# 29.1) REVOKE privileges is incompatible with FTWRL.
+grant all privileges on t1_base to mysqltest_u1;
+Success: Was not able to run 'revoke all privileges on t1_base from mysqltest_u1' under FTWRL.
+Success: 'revoke all privileges on t1_base from mysqltest_u1' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'revoke all privileges on t1_base from mysqltest_u1' is active in another connection.
+#
+# 29.2) REVOKE ALL PRIVILEGES, GRANT OPTION is incompatible with FTWRL.
+Success: Was not able to run 'revoke all privileges, grant option from mysqltest_u1' under FTWRL.
+Success: 'revoke all privileges, grant option from mysqltest_u1' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'revoke all privileges, grant option from mysqltest_u1' is active in another connection.
+drop user mysqltest_u1;
+#
+# 30) Compatibility of SELECT statement with FTWRL depends on
+# locking mode used and on functions being invoked by it.
+#
+# 30.a) Simple SELECT which does not change tables should be
+# compatible with FTWRL.
+Success: Was able to run 'select count(*) from t1_base' under FTWRL.
+Success: Was able to run 'select count(*) from t1_base' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'select count(*) from t1_base' was active in another connection.
+# 30.b) SELECT ... FOR UPDATE is incompatible with FTWRL.
+Success: Was not able to run 'select count(*) from t1_base for update' under FTWRL.
+Success: 'select count(*) from t1_base for update' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'select count(*) from t1_base for update' is active in another connection.
+# 30.c) SELECT ... LOCK IN SHARE MODE is compatible with FTWRL.
+Success: Was able to run 'select count(*) from t1_base lock in share mode' under FTWRL.
+Success: Was able to run 'select count(*) from t1_base lock in share mode' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'select count(*) from t1_base lock in share mode' was active in another connection.
+#
+# 30.d) SELECT which calls SF updating base table should be
+# incompatible with FTWRL.
+Success: Was not able to run 'select f2_base()' under FTWRL.
+Success: 'select f2_base()' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'select f2_base()' is active in another connection.
+#
+# 30.e) SELECT which calls SF updating temporary table should be
+# compatible with FTWRL.
+Success: Was able to run 'select f2_temp()' under FTWRL.
+Success: Was able to run 'select f2_temp()' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'select f2_temp()' was active in another connection.
+#
+# 31) Compatibility of SET statement with FTWRL depends on its
+# expression and on whether it is a special SET statement.
+#
+# 31.a) Ordinary SET with expression which does not
+# changes base table should be compatible with FTWRL.
+# Skip last part of compatibility testing as our helper debug
+# sync-point doesn't work for SET statements.
+Success: Was able to run 'set @a:= (select count(*) from t1_base)' under FTWRL.
+Success: Was able to run 'set @a:= (select count(*) from t1_base)' with FTWRL active in another connection.
+#
+# 31.b) Ordinary SET which calls SF updating base table should
+# be incompatible with FTWRL.
+# Skip last part of compatibility testing as our helper debug
+# sync-point doesn't work for SET statements.
+Success: Was not able to run 'set @a:= f2_base()' under FTWRL.
+Success: 'set @a:= f2_base()' is blocked by FTWRL active in another connection.
+#
+# 31.c) Ordinary SET which calls SF updating temporary table
+# should be compatible with FTWRL.
+# Skip last part of compatibility testing as our helper debug
+# sync-point doesn't work for SET statements.
+Success: Was able to run 'set @a:= f2_temp()' under FTWRL.
+Success: Was able to run 'set @a:= f2_temp()' with FTWRL active in another connection.
+#
+# 31.d) Special SET variants have different compatibility with FTWRL.
+#
+# 31.d.I) SET PASSWORD is incompatible with FTWRL as it changes data.
+create user mysqltest_u1;
+# Skip last part of compatibility testing as our helper debug
+# sync-point doesn't work for SET statements.
+Success: Was not able to run 'set password for 'mysqltest_u1' = password('')' under FTWRL.
+Success: 'set password for 'mysqltest_u1' = password('')' is blocked by FTWRL active in another connection.
+drop user mysqltest_u1;
+#
+# 31.d.II) SET READ_ONLY is compatible with FTWRL (but has no
+# effect when executed under it).
+# Skip last part of compatibility testing as our helper debug
+# sync-point doesn't work for SET statements.
+Success: Was able to run 'set global read_only= 1' under FTWRL.
+Success: Was able to run 'set global read_only= 1' with FTWRL active in another connection.
+#
+# 31.d.III) Situation with SET AUTOCOMMIT is complex.
+# Turning auto-commit off is always compatible with FTWRL.
+# Turning auto-commit on causes implicit commit and so
+# is incompatible with FTWRL if there are changes to be
+# committed.
+flush tables with read lock;
+set autocommit= 0;
+# Turning auto-commit on causes implicit commit so can
+# be incompatible with FTWRL if there is something to
+# commit. But since even in this case we allow commits
+# under active FTWRL such statement should always succeed.
+insert into t3_temp_trans values (1);
+set autocommit= 1;
+unlock tables;
+delete from t3_temp_trans;
+# Check that SET AUTOCOMMIT=0 is not blocked and
+# SET AUTOCOMMIT=1 is blocked by active FTWRL in
+# another connection.
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+set autocommit= 0;
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+# Do some work so implicit commit in SET AUTOCOMMIT=1
+# is not a no-op.
+insert into t3_trans values (1);
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+# Send:
+set autocommit= 1;
+# Switching to connection 'con1'.
+# Wait until SET AUTOCOMMIT=1 is blocked.
+unlock tables;
+# Switching to connection 'default'.
+# Reap SET AUTOCOMMIT=1.
+delete from t3_trans;
+#
+# Check that SET AUTOCOMMIT=1 blocks FTWRL in another connection.
+set autocommit= 0;
+insert into t3_trans values (1);
+set debug_sync='RESET';
+set debug_sync='ha_commit_trans_after_acquire_commit_lock SIGNAL parked WAIT_FOR go';
+set autocommit= 1;
+# Switching to connection 'con1'.
+set debug_sync='now WAIT_FOR parked';
+flush tables with read lock;
+# Switching to connection 'con2'.
+# Wait until FTWRL is blocked.
+set debug_sync='now SIGNAL go';
+# Switching to connection 'default'.
+# Reap SET AUTOCOMMIT=1.
+# Switching to connection 'con1'.
+# Reap FTWRL.
+unlock tables;
+# Switching to connection 'default'.
+delete from t3_trans;
+set debug_sync= "RESET";
+#
+# 32) SHOW statements are compatible with FTWRL.
+# Let us test _some_ of them.
+#
+# 32.1) SHOW TABLES.
+Success: Was able to run 'show tables from test' under FTWRL.
+Success: Was able to run 'show tables from test' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'show tables from test' was active in another connection.
+#
+# 32.1) SHOW TABLES.
+Success: Was able to run 'show tables from test' under FTWRL.
+Success: Was able to run 'show tables from test' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'show tables from test' was active in another connection.
+#
+# 32.2) SHOW EVENTS.
+Success: Was able to run 'show events from test' under FTWRL.
+Success: Was able to run 'show events from test' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'show events from test' was active in another connection.
+#
+# 32.3) SHOW GRANTS.
+create user mysqltest_u1;
+Success: Was able to run 'show grants for mysqltest_u1' under FTWRL.
+Success: Was able to run 'show grants for mysqltest_u1' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'show grants for mysqltest_u1' was active in another connection.
+drop user mysqltest_u1;
+#
+# 32.4) SHOW CREATE TABLE.
+Success: Was able to run 'show create table t1_base' under FTWRL.
+Success: Was able to run 'show create table t1_base' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'show create table t1_base' was active in another connection.
+#
+# 32.5) SHOW CREATE FUNCTION.
+Success: Was able to run 'show create function f1' under FTWRL.
+Success: Was able to run 'show create function f1' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'show create function f1' was active in another connection.
+#
+# 33) SIGNAL statement is compatible with FTWRL.
+#
+# Note that we don't cover RESIGNAL as it requires
+# active handler context.
+Success: Was able to run 'signal sqlstate '01000'' under FTWRL.
+Success: Was able to run 'signal sqlstate '01000'' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'signal sqlstate '01000'' was active in another connection.
+#
+# 34) TRUNCATE TABLE statement.
+#
+# 34.a) TRUNCATE of base table is incompatible with FTWRL.
+Success: Was not able to run 'truncate table t1_base' under FTWRL.
+Success: 'truncate table t1_base' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'truncate table t1_base' is active in another connection.
+#
+# 34.b) TRUNCATE of temporary table is compatible with FTWRL.
+Success: Was able to run 'truncate table t1_temp' under FTWRL.
+Success: Was able to run 'truncate table t1_temp' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'truncate table t1_temp' was active in another connection.
+#
+# 35) UPDATE variants.
+#
+# 35.1) Simple UPDATE.
+#
+# 35.1.a) Simple UPDATE on base table is incompatible with FTWRL.
+Success: Was not able to run 'update t1_base set i= 1 where i = 0' under FTWRL.
+Success: 'update t1_base set i= 1 where i = 0' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'update t1_base set i= 1 where i = 0' is active in another connection.
+#
+# 35.1.b) Simple UPDATE on temporary table is compatible with FTWRL.
+Success: Was able to run 'update t1_temp set i= 1 where i = 0' under FTWRL.
+Success: Was able to run 'update t1_temp set i= 1 where i = 0' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'update t1_temp set i= 1 where i = 0' was active in another connection.
+#
+# 35.2) Multi UPDATE.
+#
+# 35.2.a) Multi UPDATE on base tables is incompatible with FTWRL.
+Success: Was not able to run 'update t1_base, t2_base set t1_base.i= 1 where t1_base.i = t2_base.j' under FTWRL.
+Success: 'update t1_base, t2_base set t1_base.i= 1 where t1_base.i = t2_base.j' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'update t1_base, t2_base set t1_base.i= 1 where t1_base.i = t2_base.j' is active in another connection.
+#
+# 35.2.b) Multi UPDATE on temporary tables is compatible with FTWRL.
+Success: Was able to run 'update t1_temp, t2_temp set t1_temp.i= 1 where t1_temp.i = t2_temp.j' under FTWRL.
+Success: Was able to run 'update t1_temp, t2_temp set t1_temp.i= 1 where t1_temp.i = t2_temp.j' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'update t1_temp, t2_temp set t1_temp.i= 1 where t1_temp.i = t2_temp.j' was active in another connection.
+#
+# 36) USE statement is compatible with FTWRL.
+#
+Success: Was able to run 'use mysqltest1' under FTWRL.
+Success: Was able to run 'use mysqltest1' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'use mysqltest1' was active in another connection.
+#
+# 37) XA statements.
+#
+# XA statements are similar to BEGIN/COMMIT/ROLLBACK.
+#
+# XA BEGIN, END, PREPARE, ROLLBACK and RECOVER are compatible
+# with FTWRL. XA COMMIT is not.
+flush tables with read lock;
+# Although all below statements are allowed under FTWRL they
+# are almost no-ops as FTWRL does commit and does not allows
+# any non-temporary DML under it.
+xa start 'test1';
+xa end 'test1';
+xa prepare 'test1';
+xa rollback 'test1';
+xa start 'test1';
+xa end 'test1';
+xa prepare 'test1';
+xa commit 'test1';
+xa recover;
+unlock tables;
+# Check that XA non-COMMIT statements are not and COMMIT is
+# blocked by active FTWRL in another connection
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+xa start 'test1';
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+insert into t3_trans values (1);
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+xa end 'test1';
+xa prepare 'test1';
+xa rollback 'test1';
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+xa start 'test1';
+insert into t3_trans values (1);
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+xa end 'test1';
+xa prepare 'test1';
+# Send:
+xa commit 'test1';;
+# Switching to connection 'con1'.
+# Wait until XA COMMIT is blocked.
+unlock tables;
+# Switching to connection 'default'.
+# Reap XA COMMIT.
+delete from t3_trans;
+#
+# Check that XA COMMIT blocks FTWRL in another connection.
+xa start 'test1';
+insert into t3_trans values (1);
+xa end 'test1';
+xa prepare 'test1';
+set debug_sync='RESET';
+set debug_sync='trans_xa_commit_after_acquire_commit_lock SIGNAL parked WAIT_FOR go';
+xa commit 'test1';
+# Switching to connection 'con1'.
+set debug_sync='now WAIT_FOR parked';
+flush tables with read lock;
+# Switching to connection 'con2'.
+# Wait until FTWRL is blocked.
+set debug_sync='now SIGNAL go';
+# Switching to connection 'default'.
+# Reap XA COMMIT.
+# Switching to connection 'con1'.
+# Reap FTWRL.
+unlock tables;
+# Switching to connection 'default'.
+delete from t3_trans;
+set debug_sync= "RESET";
+#
+# 38) Test effect of auto-commit mode for DML on transactional
+# temporary tables.
+#
+# 38.1) When auto-commit is on each such a statement ends with commit
+# of changes to temporary tables. But since transactions doing
+# such changes are considered read only [sic!/QQ] this commit
+# is compatible with FTWRL.
+#
+# Let us demostrate this fact for some common DML statements.
+Success: Was able to run 'delete from t3_temp_trans' under FTWRL.
+Success: Was able to run 'delete from t3_temp_trans' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'delete from t3_temp_trans' was active in another connection.
+Success: Was able to run 'insert into t3_temp_trans values (1)' under FTWRL.
+Success: Was able to run 'insert into t3_temp_trans values (1)' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'insert into t3_temp_trans values (1)' was active in another connection.
+Success: Was able to run 'update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j' under FTWRL.
+Success: Was able to run 'update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j' was active in another connection.
+#
+# 38.2) When auto-commit is off DML on transaction temporary tables
+# is compatible with FTWRL.
+#
+set autocommit= 0;
+Success: Was able to run 'delete from t3_temp_trans' under FTWRL.
+Success: Was able to run 'delete from t3_temp_trans' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'delete from t3_temp_trans' was active in another connection.
+Success: Was able to run 'insert into t3_temp_trans values (1)' under FTWRL.
+Success: Was able to run 'insert into t3_temp_trans values (1)' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'insert into t3_temp_trans values (1)' was active in another connection.
+Success: Was able to run 'update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j' under FTWRL.
+Success: Was able to run 'update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j' was active in another connection.
+set autocommit= 1;
+#
+# 39) Test effect of DDL on transactional tables.
+#
+# 39.1) Due to implicit commit at the end of statement some of DDL
+# statements which are compatible with FTWRL in non-transactional
+# case are not compatible in case of transactional tables.
+#
+# 39.1.a) ANALYZE TABLE for transactional table is incompatible with
+# FTWRL.
+flush tables with read lock;
+# Implicit commits are allowed under FTWRL.
+analyze table t3_trans;
+Table Op Msg_type Msg_text
+test.t3_trans analyze status OK
+unlock tables;
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+analyze table t3_trans;
+# Switching to connection 'con1'.
+# Check that ANALYZE TABLE is blocked.
+unlock tables;
+# Switching to connection 'default'.
+# Reap ANALYZE TABLE
+Table Op Msg_type Msg_text
+test.t3_trans analyze status OK
+#
+# 39.1.b) CHECK TABLE for transactional table is compatible with FTWRL.
+# Although it does implicit commit at the end of statement it
+# is considered to be read-only operation.
+# Skip last part of compatibility testing as this statement
+# releases metadata locks in non-standard place.
+Success: Was able to run 'check table t3_trans' under FTWRL.
+Success: Was able to run 'check table t3_trans' with FTWRL active in another connection.
+#
+# 39.2) Situation with DDL on temporary transactional tables is
+# complex.
+#
+# 39.2.a) Some statements compatible with FTWRL since they don't
+# do implicit commit.
+#
+# For example, CREATE TEMPORARY TABLE:
+Success: Was able to run 'create temporary table t4_temp_trans(i int) engine=innodb' under FTWRL.
+Success: Was able to run 'create temporary table t4_temp_trans(i int) engine=innodb' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'create temporary table t4_temp_trans(i int) engine=innodb' was active in another connection.
+#
+# Or DROP TEMPORARY TABLE:
+Success: Was able to run 'drop temporary tables t3_temp_trans' under FTWRL.
+Success: Was able to run 'drop temporary tables t3_temp_trans' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'drop temporary tables t3_temp_trans' was active in another connection.
+#
+# 39.2.b) Some statements do implicit commit but are considered
+# read-only and so are compatible with FTWRL.
+#
+# For example, REPAIR TABLE:
+Success: Was able to run 'repair table t3_temp_trans' under FTWRL.
+Success: Was able to run 'repair table t3_temp_trans' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'repair table t3_temp_trans' was active in another connection.
+#
+# And ANALYZE TABLE:
+Success: Was able to run 'analyze table t3_temp_trans' under FTWRL.
+Success: Was able to run 'analyze table t3_temp_trans' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'analyze table t3_temp_trans' was active in another connection.
+#
+# 39.2.c) Some statements do implicit commit and not
+# considered read-only. As result they are
+# not compatible with FTWRL.
+#
+flush tables with read lock;
+# Implicit commits are allowed under FTWRL.
+alter table t3_temp_trans add column c1 int;
+unlock tables;
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+alter table t3_temp_trans drop column c1;
+# Switching to connection 'con1'.
+# Check that ALTER TABLE is blocked.
+unlock tables;
+# Switching to connection 'default'.
+# Reap ALTER TABLE
+#
+# 40) Test effect of implicit commit for DDL which is otherwise
+# compatible with FTWRL. Implicit commit at the start of DDL
+# statement can make it incompatible with FTWRL if there are
+# some changes to be commited even in case when DDL statement
+# itself is compatible with FTWRL.
+#
+# For example CHECK TABLE for base non-transactional tables and
+# ALTER TABLE for temporary non-transactional tables are affected.
+begin;
+insert into t3_trans values (1);
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+check table t1_base;
+# Switching to connection 'con1'.
+# Check that CHECK TABLE is blocked.
+unlock tables;
+# Switching to connection 'default'.
+# Reap CHECK TABLE
+Table Op Msg_type Msg_text
+test.t1_base check status OK
+begin;
+delete from t3_trans;
+#
+# Switching to connection 'con1'.
+flush tables with read lock;
+# Switching to connection 'default'.
+alter table t1_temp add column c1 int;
+# Switching to connection 'con1'.
+# Check that ALTER TABLE is blocked.
+unlock tables;
+# Switching to connection 'default'.
+# Reap ALTER TABLE
+alter table t1_temp drop column c1;
+#
+# Check that FLUSH TABLES WITH READ LOCK is blocked by individual
+# statements and is not blocked in the presence of transaction which
+# has done some changes earlier but is idle now (or does only reads).
+# This allows to use this statement even on systems which has long
+# running transactions.
+#
+begin;
+insert into t1_base values (1);
+insert into t3_trans values (1);
+# Switching to connection 'con1'.
+# The below FTWRL should not be blocked by transaction in 'default'.
+flush tables with read lock;
+# Switching to connection 'default'.
+# Transaction still is able to read even with FTWRL active in another
+# connection.
+select * from t1_base;
+i
+1
+select * from t2_base;
+j
+select * from t3_trans;
+i
+1
+# Switching to connection 'con1'.
+unlock tables;
+# Switching to connection 'default'.
+commit;
+delete from t1_base;
+delete from t3_trans;
+#
+# Check that impending FTWRL blocks new DML statements and
+# so can't be starved by a constant flow of DML.
+# (a.k.a. test for bug #54673 "It takes too long to get
+# readlock for 'FLUSH TABLES WITH READ LOCK'").
+#
+set debug_sync='RESET';
+set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+insert into t1_base values (1);
+# Switching to connection 'con1'.
+set debug_sync='now WAIT_FOR parked';
+flush tables with read lock;
+# Switching to connection 'con2'.
+# Wait until FTWRL is blocked.
+# Try to run another INSERT and see that it is blocked.
+insert into t2_base values (1);;
+# Switching to connection 'con3'.
+# Wait until new INSERT is blocked.
+# Unblock INSERT in the first connection.
+set debug_sync='now SIGNAL go';
+# Switching to connection 'default'.
+# Reap first INSERT.
+# Switching to connection 'con1'.
+# Reap FTWRL.
+unlock tables;
+# Switching to connection 'con2'.
+# Reap second INSERT.
+# Switching to connection 'default'.
+set debug_sync= "RESET";
+delete from t1_base;
+delete from t2_base;
+
+# Check that COMMIT thas is issued after
+# FLUSH TABLES WITH READ LOCK is not blocked by
+# FLUSH TABLES WITH READ LOCK from another connection.
+# This scenario is used in innobackup.pl. The COMMIT goes
+# through because the transaction started by FTWRL does
+# not modify any tables, and the commit blocker lock is
+# only taken when there were such modifications.
+
+flush tables with read lock;
+# Switching to connection 'con1'.
+# The below FTWRL should not be blocked by transaction in 'default'.
+flush tables with read lock;
+# Switching to connection 'default'.
+select * from t1_base;
+i
+select * from t3_trans;
+i
+commit;
+# Switching to connection 'con1'.
+select * from t1_base;
+i
+select * from t3_trans;
+i
+commit;
+unlock tables;
+# Switching to connection 'default'.
+unlock tables;
+#
+# Check how FLUSH TABLE WITH READ LOCK is handled for MERGE tables.
+# As usual there are tricky cases related to this type of tables.
+#
+#
+# 1) Most typical case - base MERGE table with base underlying tables.
+#
+# 1.a) DML statements which change data should be incompatible with FTWRL.
+create table tm_base (i int) engine=merge union=(t1_base) insert_method=last;
+Success: Was not able to run 'insert into tm_base values (1)' under FTWRL.
+Success: 'insert into tm_base values (1)' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'insert into tm_base values (1)' is active in another connection.
+#
+# 1.b) DDL statement on such table should be incompatible with FTWRL as well.
+Success: Was not able to run 'alter table tm_base insert_method=first' under FTWRL.
+Success: 'alter table tm_base insert_method=first' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'alter table tm_base insert_method=first' is active in another connection.
+drop table tm_base;
+#
+# 2) Temporary MERGE table with base underlying tables.
+#
+# 2.a) DML statements which change data should be incompatible with FTWRL
+# as they affect base tables.
+create temporary table tm_temp_base (i int) engine=merge union=(t1_base) insert_method=last;
+Success: Was not able to run 'insert into tm_temp_base values (1)' under FTWRL.
+Success: 'insert into tm_temp_base values (1)' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'insert into tm_temp_base values (1)' is active in another connection.
+#
+# 2.b) Some of DDL statements on such table can be compatible with FTWRL
+# as they don't affect base tables.
+Success: Was able to run 'drop temporary tables tm_temp_base' under FTWRL.
+Success: Was able to run 'drop temporary tables tm_temp_base' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'drop temporary tables tm_temp_base' was active in another connection.
+#
+# 2.c) ALTER statement is incompatible with FTWRL. Even though it does
+# not change data in base table it still acquires strong metadata
+# locks on them.
+Success: Was not able to run 'alter table tm_temp_base insert_method=first' under FTWRL.
+Success: 'alter table tm_temp_base insert_method=first' is blocked by FTWRL active in another connection.
+Success: FTWRL is blocked when 'alter table tm_temp_base insert_method=first' is active in another connection.
+drop table tm_temp_base;
+#
+# 3) Temporary MERGE table with temporary underlying tables.
+#
+# 3.a) DML statements should be compatible with FTWRL as
+# no base table is going to be affected.
+create temporary table tm_temp_temp (i int) engine=merge union=(t1_temp) insert_method=last;
+Success: Was able to run 'insert into tm_temp_temp values (1)' under FTWRL.
+Success: Was able to run 'insert into tm_temp_temp values (1)' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'insert into tm_temp_temp values (1)' was active in another connection.
+#
+# 3.b) DDL statements should be compatible with FTWRL as well
+# as no base table is going to be affected too.
+Success: Was able to run 'alter table tm_temp_temp union=(t1_temp) insert_method=first' under FTWRL.
+Success: Was able to run 'alter table tm_temp_temp union=(t1_temp) insert_method=first' with FTWRL active in another connection.
+Success: Was able to run FTWRL while 'alter table tm_temp_temp union=(t1_temp) insert_method=first' was active in another connection.
+drop table tm_temp_temp;
+#
+# 4) For the sake of completeness let us check that base MERGE tables
+# with temporary underlying tables are not functional.
+create table tm_base_temp (i int) engine=merge union=(t1_temp) insert_method=last;
+select * from tm_base_temp;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+drop table tm_base_temp;
+#
+# Clean-up.
+#
+drop event e1;
+drop function f2_temp;
+drop function f2_base;
+drop procedure p2;
+drop view v1;
+drop function f1;
+drop procedure p1;
+drop database `#mysql50#mysqltest-2`;
+drop database mysqltest1;
+drop temporary tables t1_temp, t2_temp;
+drop tables t1_base, t2_base, t3_trans;
diff --git a/mysql-test/r/flush_read_lock_kill.result b/mysql-test/r/flush_read_lock_kill.result
index b16a8b114b3..8453d26cbea 100644
--- a/mysql-test/r/flush_read_lock_kill.result
+++ b/mysql-test/r/flush_read_lock_kill.result
@@ -1,12 +1,38 @@
-SET @old_concurrent_insert= @@global.concurrent_insert;
-SET @@global.concurrent_insert= 0;
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (kill_id INT);
+SET DEBUG_SYNC= 'RESET';
+CREATE TABLE t1 (kill_id INT) engine = InnoDB;
INSERT INTO t1 VALUES(connection_id());
+# Switching to connection 'default'.
+# Start transaction.
+BEGIN;
+INSERT INTO t1 VALUES(connection_id());
+# Ensure that COMMIT will pause once it acquires protection
+# against its global read lock.
+SET DEBUG_SYNC='ha_commit_trans_after_acquire_commit_lock SIGNAL acquired WAIT_FOR go';
+# Sending:
+COMMIT;
+# Switching to 'con1'.
+# Wait till COMMIT acquires protection against global read
+# lock and pauses.
+SET DEBUG_SYNC='now WAIT_FOR acquired';
+# Sending:
FLUSH TABLES WITH READ LOCK;
-SELECT ((@id := kill_id) - kill_id) FROM t1;
+# Switching to 'con2'.
+SELECT ((@id := kill_id) - kill_id) FROM t1 LIMIT 1;
((@id := kill_id) - kill_id)
0
+# Wait till FLUSH TABLES WITH READ LOCK blocks due
+# to active COMMIT
+# Kill connection 'con1'.
KILL CONNECTION @id;
+# Switching to 'con1'.
+# Try to reap FLUSH TABLES WITH READ LOCK,
+# it fail due to killed statement and connection.
+Got one of the listed errors
+# Switching to 'con2'.
+# Resume COMMIT.
+SET DEBUG_SYNC='now SIGNAL go';
+# Switching to 'default'.
+# Reaping COMMIT.
DROP TABLE t1;
-SET @@global.concurrent_insert= @old_concurrent_insert;
+SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 893c650dad4..a76abaa4544 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -660,4 +660,40 @@ Table Op Msg_type Msg_text
test.t1 repair status OK
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
DROP TABLE t1;
+#
+# Bug#54484 explain + prepared statement: crash and Got error -1 from storage engine
+#
+CREATE TABLE t1(f1 VARCHAR(6) NOT NULL, FULLTEXT KEY(f1), UNIQUE(f1));
+INSERT INTO t1 VALUES ('test');
+SELECT 1 FROM t1 WHERE 1 >
+ALL((SELECT 1 FROM t1 JOIN t1 a
+ON (MATCH(t1.f1) against (""))
+WHERE t1.f1 GROUP BY t1.f1)) xor f1;
+1
+1
+PREPARE stmt FROM
+'SELECT 1 FROM t1 WHERE 1 >
+ ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a
+ ON (MATCH(t1.f1) against (""))
+ WHERE t1.f1 GROUP BY t1.f1)) xor f1';
+EXECUTE stmt;
+1
+1
+EXECUTE stmt;
+1
+1
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM
+'SELECT 1 FROM t1 WHERE 1 >
+ ALL((SELECT 1 FROM t1 JOIN t1 a
+ ON (MATCH(t1.f1) against (""))
+ WHERE t1.f1 GROUP BY t1.f1))';
+EXECUTE stmt;
+1
+1
+EXECUTE stmt;
+1
+1
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/func_analyse.result b/mysql-test/r/func_analyse.result
index 1820782d2f8..f82439090f6 100644
--- a/mysql-test/r/func_analyse.result
+++ b/mysql-test/r/func_analyse.result
@@ -123,3 +123,29 @@ CREATE TABLE t2 SELECT 1 FROM t1, t1 t3 GROUP BY t3.a PROCEDURE ANALYSE();
ERROR HY000: Incorrect usage of PROCEDURE and non-SELECT
DROP TABLE t1;
End of 5.0 tests
+#
+# Bug#11765202: Dbug_violation_helper::~Dbug_violation_helper(): Assertion `!_entered' failed.
+#
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (a VARCHAR(2) CHARSET UTF8 NOT NULL);
+INSERT INTO t1 VALUES ('e'),('e'),('e-');
+SELECT * FROM t1 PROCEDURE ANALYSE();
+Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
+test.t1.a e e- 1 2 0 0 1.3333 NULL ENUM('e','e-') NOT NULL
+DROP TABLE t1;
+#
+# Bug#11756242 48137: PROCEDURE ANALYSE() LEAKS MEMORY WHEN RETURNING NULL
+#
+CREATE TABLE t1(f1 INT) ENGINE=MYISAM;
+CREATE TABLE t2(f2 INT) ENGINE=INNODB;
+INSERT INTO t2 VALUES (1);
+SELECT DISTINCTROW f1 FROM t1 NATURAL RIGHT OUTER JOIN t2 PROCEDURE ANALYSE();
+Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
+test.t1.f1 NULL NULL 0 0 0 1 0.0 0.0 CHAR(0)
+SELECT * FROM t2 LIMIT 1 PROCEDURE ANALYSE();
+Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
+test.t2.f2 1 1 1 1 0 0 1.0000 0.0000 ENUM('1') NOT NULL
+DROP TABLE t1, t2;
+End of 5.1 tests
diff --git a/mysql-test/r/func_encrypt_ucs2.result b/mysql-test/r/func_encrypt_ucs2.result
new file mode 100644
index 00000000000..2ca40434cae
--- /dev/null
+++ b/mysql-test/r/func_encrypt_ucs2.result
@@ -0,0 +1,19 @@
+#
+# Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
+#
+SELECT CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2)));
+CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2)))
+9
+SELECT CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED);
+CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED)
+0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: ''
+SELECT CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2)));
+CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2)))
+4
+SELECT CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED);
+CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED)
+0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'test'
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 302de9de9f7..6c400a8ddcc 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -1038,6 +1038,25 @@ GROUP_CONCAT(t1.a ORDER BY t1.a)
1,1,2,2
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+#
+# Bug#57194 group_concat cause crash and/or invalid memory reads with type errors
+#
+CREATE TABLE t1(f1 int);
+INSERT INTO t1 values (0),(0);
+SELECT POLYGON((SELECT 1 FROM (SELECT 1 IN (GROUP_CONCAT(t1.f1)) FROM t1, t1 t GROUP BY t.f1 ) d));
+ERROR 22007: Illegal non geometric '(select 1 from (select (1 = group_concat(`test`.`t1`.`f1` separator ',')) AS `1 IN (GROUP_CONCAT(t1.f1))` from `test`.`t1` join `test`.`t1` `t` group by `t`.`f1`) `d`)' value found during parsing
+DROP TABLE t1;
+#
+# Bug#58396 group_concat and explain extended are still crashy
+#
+CREATE TABLE t1(a INT);
+EXPLAIN EXTENDED SELECT UPDATEXML('1', a, '1')
+FROM t1 ORDER BY (SELECT GROUP_CONCAT(1) FROM t1);
+ERROR HY000: Only constant XPATH queries are supported
+SHOW WARNINGS;
+Level Code Message
+Error 1105 Only constant XPATH queries are supported
+DROP TABLE t1;
End of 5.1 tests
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a VARCHAR(6), b INT);
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 5e03f93e425..4f493ccd928 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -1724,8 +1724,51 @@ m
1
DROP TABLE t1;
#
+# Bug#58030 crash in Item_func_geometry_from_text::val_str
+#
+SELECT MAX(TIMESTAMP(RAND(0)));
+SELECT MIN(TIMESTAMP(RAND(0)));
+#
+# Bug#58177 crash and valgrind warnings in decimal and protocol sending functions...
+#
+SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND()));
+SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND()));
+SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND()));
+SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND()));
+SELECT RELEASE_LOCK('aaaaaaaaaaaaaaaaa');
+#
+# Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS
+#
+CREATE TABLE t1 (a BIGINT UNSIGNED);
+INSERT INTO t1 VALUES (18446668621106209655);
+SELECT MAX(LENGTH(a)), LENGTH(MAX(a)), MIN(a), MAX(a), CONCAT(MIN(a)), CONCAT(MAX(a)) FROM t1;
+MAX(LENGTH(a)) LENGTH(MAX(a)) MIN(a) MAX(a) CONCAT(MIN(a)) CONCAT(MAX(a))
+20 20 18446668621106209655 18446668621106209655 18446668621106209655 18446668621106209655
+DROP TABLE t1;
+#
+# Bug #11766270 59343: YEAR(4): INCORRECT RESULT AND VALGRIND WARNINGS WITH MIN/MAX, UNION
+#
+CREATE TABLE t1(f1 YEAR(4));
+INSERT INTO t1 VALUES (0000),(2001);
+(SELECT MAX(f1) FROM t1) UNION (SELECT MAX(f1) FROM t1);
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def MAX(f1) MAX(f1) 13 4 4 Y 32864 0 63
+MAX(f1)
+2001
+DROP TABLE t1;
+#
End of 5.1 tests
#
+# Bug#52123 Assertion failed: aggregator == aggr->Aggrtype(),
+# file .\item_sum.cc, line 587
+#
+CREATE TABLE t1(a int, KEY(a));
+INSERT INTO t1 VALUES (1), (2);
+SELECT 1 FROM t1 ORDER BY AVG(DISTINCT a);
+1
+1
+DROP TABLE t1;
+#
# Bug#55648: Server crash on MIN/MAX on maximum time value
#
CREATE TABLE t1(c1 TIME NOT NULL);
@@ -1746,3 +1789,18 @@ MAX(c1) MIN(c1)
-00:00:01 -00:00:01
DROP TABLE t1;
# End of the bug#56120
+#
+# Bug#57932 "query with AVG(DISTINCT) returns NULL if last
+# aggregated value was NULL"
+#
+CREATE TABLE t1 (col_int_nokey int(11));
+INSERT INTO t1 VALUES (7),(8),(NULL);
+SELECT AVG(DISTINCT col_int_nokey) FROM t1;
+AVG(DISTINCT col_int_nokey)
+7.5000
+SELECT AVG(DISTINCT outr.col_int_nokey) FROM t1 AS outr LEFT JOIN t1 AS outr2 ON
+outr.col_int_nokey = outr2.col_int_nokey;
+AVG(DISTINCT outr.col_int_nokey)
+7.5000
+DROP TABLE t1;
+# End of the bug#57932
diff --git a/mysql-test/r/func_group_innodb.result b/mysql-test/r/func_group_innodb.result
index 908e85c1652..8412317c91d 100644
--- a/mysql-test/r/func_group_innodb.result
+++ b/mysql-test/r/func_group_innodb.result
@@ -145,3 +145,50 @@ select count(*), min(7), max(7) from t2m, t1i;
count(*) min(7) max(7)
0 NULL NULL
drop table t1m, t1i, t2m, t2i;
+#
+# Bug #57954: BIT_AND function returns incorrect results when
+# semijoin=on
+CREATE TABLE c (
+pk INT,
+col_varchar_key VARCHAR(1),
+PRIMARY KEY (pk),
+KEY col_varchar_key (col_varchar_key)
+) ENGINE=InnoDB;
+INSERT INTO c VALUES (11,NULL);
+INSERT INTO c VALUES (16,'c');
+CREATE TABLE bb (
+pk INT,
+col_varchar_key VARCHAR(1),
+PRIMARY KEY (pk),
+KEY col_varchar_key (col_varchar_key)
+) ENGINE=InnoDB;
+INSERT INTO bb VALUES (10,NULL);
+SELECT straight_join BIT_AND(c.pk)
+FROM
+bb, c
+WHERE c.col_varchar_key='ABC'
+ORDER BY c.pk;
+BIT_AND(c.pk)
+18446744073709551615
+DROP TABLE c,bb;
+#
+# Bug #58050: BIT_OR and BIT_XOR return incorrect results when
+# semijoin=on
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY, b INT, c INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, 1, 1);
+CREATE TABLE t2 (pk INT PRIMARY KEY, b INT, c INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1, 1, NULL);
+SELECT t1.* FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+pk b c
+SELECT BIT_OR(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+BIT_OR(t1.b)
+0
+SELECT BIT_AND(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+BIT_AND(t1.b)
+18446744073709551615
+SELECT BIT_XOR(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+BIT_XOR(t1.b)
+0
+DROP TABLE t1, t2;
+End of 5.5 tests
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index 3ca4d9c2da5..ed835aea611 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -770,4 +770,10 @@ CASE a WHEN a THEN a END
NULL
DROP TABLE t1;
#
+# Bug #11766212 59270: NOT IN (YEAR( ... ), ... ) PRODUCES MANY VALGRIND WARNINGS
+#
+SELECT 1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1);
+1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1)
+1
+#
End of 5.1 tests
diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result
index 552ff564a89..39590eb1c99 100644
--- a/mysql-test/r/func_like.result
+++ b/mysql-test/r/func_like.result
@@ -182,4 +182,9 @@ INSERT INTO t2 VALUES (1), (2), (3);
SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a;
1
DROP TABLE t1, t2;
+#
+# Bug#59149 valgrind warnings with "like .. escape .." function
+#
+SELECT '' LIKE '1' ESCAPE COUNT(1);
+ERROR HY000: Incorrect arguments to ESCAPE
End of 5.1 tests
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index ffd6d2fc5b2..cce6a4cbb3e 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -481,6 +481,18 @@ RAND(i)
0.15522042769493574
DROP TABLE t1;
#
+# Bug#57477 SIGFPE when dividing a huge number a negative number
+#
+SELECT -9999999999999999991 DIV -1;
+ERROR 22003: BIGINT value is out of range in '(-(9999999999999999991) DIV -(1))'
+SELECT -9223372036854775808 DIV -1;
+ERROR 22003: BIGINT value is out of range in '(-(9223372036854775808) DIV -(1))'
+SELECT -9223372036854775808 MOD -1;
+-9223372036854775808 MOD -1
+0
+SELECT -9223372036854775808999 MOD -1;
+-9223372036854775808999 MOD -1
+0
select 123456789012345678901234567890.123456789012345678901234567890 div 1 as x;
ERROR 22003: BIGINT value is out of range in '(123456789012345678901234567890.123456789012345678901234567890 DIV 1)'
select "123456789012345678901234567890.123456789012345678901234567890" div 1 as x;
@@ -489,6 +501,54 @@ SHOW WARNINGS;
Level Code Message
Warning 1292 Truncated incorrect DECIMAL value: ''
Error 1690 BIGINT value is out of range in '('123456789012345678901234567890.123456789012345678901234567890' DIV 1)'
+#
+# Bug#57810 case/when/then : Assertion failed: length || !scale
+#
+SELECT CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END;
+CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END
+NULL
+CREATE TABLE t1 SELECT CAST((CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END) AS CHAR) as C;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `C` varchar(23) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
+# Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION > 0 && SCALE <= PR
+#
+CREATE TABLE t1 SELECT CEIL(LINESTRINGFROMWKB(1) DIV NULL);
+DROP TABLE t1;
+CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL);
+DROP TABLE t1;
+#
+# Bug#11765923 58937: MANY VALGRIND ERRORS AFTER GROUPING BY RESULT OF DECIMAL COLUMN FUNCTION
+#
+CREATE TABLE t1(f1 DECIMAL(22,1));
+INSERT INTO t1 VALUES (0),(1);
+SELECT ROUND(f1, f1) FROM t1;
+ROUND(f1, f1)
+0.0
+1.0
+SELECT ROUND(f1, f1) FROM t1 GROUP BY 1;
+ROUND(f1, f1)
+0.0
+1.0
+DROP TABLE t1;
+#
+# Bug#11764671 57533: UNINITIALISED VALUES IN COPY_AND_CONVERT (SQL_STRING.CC) WITH CERTAIN CHA
+#
+SELECT ROUND(LEAST(15, -4939092, 0.2704), STDDEV('a'));
+ROUND(LEAST(15, -4939092, 0.2704), STDDEV('a'))
+-4939092.0000
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+#
+# Bug#12392636 ASSERTION FAILED: SCALE >= 0 && PRECISION > 0 && SCALE <= PRECISION
+#
+SELECT SUM(DISTINCT (TRUNCATE((.1), NULL)));
+SUM(DISTINCT (TRUNCATE((.1), NULL)))
+NULL
End of 5.1 tests
#
# Bug #8433: Overflow must be an error
@@ -600,3 +660,42 @@ NULL
SELECT -9223372036854775808 MOD -1;
-9223372036854775808 MOD -1
0
+#
+# Bug #57209 valgrind + Assertion failed: dst > buf
+#
+SELECT floor(log10(format(concat_ws(5445796E25, 5306463, 30837), -358821)))
+as foo;
+foo
+2
+#
+# Bug #58137 char(0) column cause:
+# my_gcvt: Assertion `width > 0 && to != ((void *)0)' failed
+#
+CREATE TABLE t1(a char(0));
+INSERT INTO t1 (SELECT -pi());
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+DROP TABLE t1;
+#
+# Bug #59241 invalid memory read
+# in do_div_mod with doubly assigned variables
+#
+SELECT ((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa')));
+((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa')))
+NULL
+Warnings:
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+#
+# Bug #59498 div function broken in mysql-trunk
+#
+SELECT 1 div null;
+1 div null
+NULL
+#
+# Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS
+#
+select (1.175494351E-37 div 1.7976931348623157E+308);
+(1.175494351E-37 div 1.7976931348623157E+308)
+0
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: ''
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index 7e4f9b7a2e7..514994ed27c 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -258,6 +258,12 @@ GREATEST(a, (SELECT b FROM t1 LIMIT 1))
3
1
DROP TABLE t1;
+SELECT INET_NTOA(0);
+INET_NTOA(0)
+0.0.0.0
+SELECT '1' IN ('1', INET_NTOA(0));
+'1' IN ('1', INET_NTOA(0))
+1
#
# Bug #52165: Assertion failed: file .\dtoa.c, line 465
#
@@ -267,4 +273,40 @@ SELECT COALESCE(a) = COALESCE(b) FROM t1;
COALESCE(a) = COALESCE(b)
1
DROP TABLE t1;
-End of tests
+#
+# Bug #54461: crash with longblob and union or update with subquery
+#
+CREATE TABLE t1 (a INT, b LONGBLOB);
+INSERT INTO t1 VALUES (1, '2'), (2, '3'), (3, '2');
+SELECT DISTINCT LEAST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1;
+LEAST(a, (SELECT b FROM t1 LIMIT 1))
+1
+2
+SELECT DISTINCT GREATEST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1;
+GREATEST(a, (SELECT b FROM t1 LIMIT 1))
+2
+3
+1
+DROP TABLE t1;
+SELECT INET_NTOA(0);
+INET_NTOA(0)
+0.0.0.0
+SELECT '1' IN ('1', INET_NTOA(0));
+'1' IN ('1', INET_NTOA(0))
+1
+#
+# End of 5.1 tests
+#
+#
+# Bug #58199: name_const in the having clause crashes
+#
+CREATE TABLE t1 (a INT);
+SELECT 1 from t1 HAVING NAME_CONST('', a);
+ERROR HY000: Incorrect arguments to NAME_CONST
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
+#
+# End of tests
+#
diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result
index 14ebc8203ec..ba9500bff46 100644
--- a/mysql-test/r/func_set.result
+++ b/mysql-test/r/func_set.result
@@ -159,3 +159,45 @@ SELECT CONVERT( a USING latin1 ) FROM t2;
CONVERT( a USING latin1 )
DROP TABLE t1, t2;
+#
+# BUG#59405: FIND_IN_SET won't work normaly after upgrade from 5.1 to 5.5
+#
+CREATE TABLE t1(days set('1','2','3','4','5','6','7'));
+INSERT INTO t1 VALUES('1,2,3,4,5,6,7'), (NULL), ('1,2,3,4,5,6,7');
+
+SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days);
+days
+1,2,3,4,5,6,7
+1,2,3,4,5,6,7
+SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days) IS UNKNOWN;
+days
+NULL
+SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL);
+days
+SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL) IS UNKNOWN;
+days
+1,2,3,4,5,6,7
+NULL
+1,2,3,4,5,6,7
+SELECT * FROM t1 WHERE FIND_IN_SET(7, days);
+days
+1,2,3,4,5,6,7
+1,2,3,4,5,6,7
+SELECT * FROM t1 WHERE FIND_IN_SET(8, days);
+days
+SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days);
+days
+SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days) IS UNKNOWN;
+days
+1,2,3,4,5,6,7
+NULL
+1,2,3,4,5,6,7
+SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL);
+days
+SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL) IS UNKNOWN;
+days
+1,2,3,4,5,6,7
+NULL
+1,2,3,4,5,6,7
+
+DROP TABLE t1;
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index f01d46a9f41..81fe2413725 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -2603,6 +2603,34 @@ ORDER BY QUOTE(t1.a);
1
1
DROP TABLE t1;
+#
+# Bug#57913 large negative number to string conversion functions crash
+# Bug#57810 case/when/then : Assertion failed: length || !scale
+#
+SELECT '1' IN ('1', SUBSTRING(-9223372036854775809, 1));
+'1' IN ('1', SUBSTRING(-9223372036854775809, 1))
+1
+SELECT CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3));
+CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3))
+1
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: ''
+#
+# Bug#58165: "my_empty_string" gets modified and causes LOAD DATA to fail
+# and other crashes
+#
+CREATE TABLE t1 ( a TEXT );
+SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'bug58165.txt';
+SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' );
+insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' )
+x
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'b'
+LOAD DATA INFILE 'bug58165.txt' INTO TABLE t1;
+SELECT * FROM t1;
+a
+aaaaaaaaaaaaaa
+DROP TABLE t1;
End of 5.1 tests
Start of 5.4 tests
SELECT format(12345678901234567890.123, 3);
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index e52c17b9648..fb647723756 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -136,7 +136,7 @@ dayname("1962-03-03") dayname("1962-03-03")+0
Saturday 5
select monthname("1972-03-04"),monthname("1972-03-04")+0;
monthname("1972-03-04") monthname("1972-03-04")+0
-March 3
+March 0
select time_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T');
time_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T')
00|12|0|12|00|AM|12:00:00 AM|00|00:00:00
@@ -1273,6 +1273,24 @@ date_add('1000-01-01 00:00:00', interval '1.03:02:01.05' day_microsecond)
select date_add('1000-01-01 00:00:00', interval '1.02' day_microsecond);
date_add('1000-01-01 00:00:00', interval '1.02' day_microsecond)
1000-01-01 00:00:01.020000
+#
+# Bug #52315 part 2 : utc_date() crashes when system time > year 2037
+#
+SET TIMESTAMP=-147490000;
+SELECT UTC_TIMESTAMP();
+SET TIMESTAMP=2147483648;
+SELECT UTC_TIMESTAMP();
+SET TIMESTAMP=2147483646;
+SELECT UTC_TIMESTAMP();
+SET TIMESTAMP=2147483647;
+SELECT UTC_TIMESTAMP();
+SET TIMESTAMP=0;
+SELECT UTC_TIMESTAMP();
+SET TIMESTAMP=-1;
+SELECT UTC_TIMESTAMP();
+SET TIMESTAMP=1;
+SELECT UTC_TIMESTAMP();
+SET TIMESTAMP=0;
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)
@@ -1315,4 +1333,109 @@ SELECT 1 FROM t1 ORDER BY @x:=makedate(a,a);
1
1
DROP TABLE t1;
+#
+# Bug #52160: crash and inconsistent results when grouping
+# by a function and column
+#
+CREATE TABLE t1(a CHAR(10) NOT NULL);
+INSERT INTO t1 VALUES (''),('');
+SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a);
+COUNT(*)
+2
+Warnings:
+Warning 1292 Truncated incorrect time value: ''
+Warning 1292 Truncated incorrect time value: ''
+Warning 1292 Truncated incorrect time value: ''
+DROP TABLE t1;
+#
+# Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH STR_TO_DATE(SPACE(..) ...
+#
+SELECT STR_TO_DATE(SPACE(2),'1');
+STR_TO_DATE(SPACE(2),'1')
+0000-00-00
+#
+# Bug#11765216 58154: UNINITIALIZED VARIABLE FORMAT IN STR_TO_DATE FUNCTION
+#
+SET GLOBAL SQL_MODE='';
+DO STR_TO_DATE((''), FROM_DAYS(@@GLOBAL.SQL_MODE));
+SET GLOBAL SQL_MODE=DEFAULT;
+#
+# Bug#11766087 59125: VALGRIND UNINITIALISED VALUE WARNING IN ULL2DEC, LONGLONG2DECIMAL
+#
+SELECT FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1);
+FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1)
+NULL
+#
+# Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING
+#
+SELECT CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025));
+CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025))
+NULL
+#
+# Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME
+#
+SELECT ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR);
+ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR)
+NULL
+#
+# Bug#11889186 60503: CRASH IN MAKE_DATE_TIME WITH DATE_FORMAT / STR_TO_DATE COMBINATION
+#
+SELECT DATE_FORMAT('0000-00-11', '%W');
+DATE_FORMAT('0000-00-11', '%W')
+NULL
+SELECT DATE_FORMAT('0000-00-11', '%a');
+DATE_FORMAT('0000-00-11', '%a')
+NULL
+SELECT DATE_FORMAT('0000-00-11', '%w');
+DATE_FORMAT('0000-00-11', '%w')
+NULL
+#
+# Bug#12403504 AFTER FIX FOR #11889186 : ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0
+#
+SELECT MAKEDATE(11111111,1);
+MAKEDATE(11111111,1)
+NULL
+SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1);
+WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1)
+NULL
End of 5.1 tests
+#
+# Bug#57039: constant subtime expression returns incorrect result.
+#
+CREATE TABLE t1 (`date_date` datetime NOT NULL);
+INSERT INTO t1 VALUES ('2008-01-03 00:00:00'), ('2008-01-03 00:00:00');
+SELECT * FROM t1 WHERE date_date >= subtime(now(), "00:30:00");
+date_date
+SELECT * FROM t1 WHERE date_date <= addtime(date_add("2000-1-1", INTERVAL "1:1:1" HOUR_SECOND), "00:20:00");
+date_date
+DROP TABLE t1;
+#
+# Bug#57512 str_to_date crash...
+#
+SELECT WEEK(STR_TO_DATE(NULL,0));
+WEEK(STR_TO_DATE(NULL,0))
+NULL
+SELECT SUBDATE(STR_TO_DATE(NULL,0), INTERVAL 1 HOUR);
+SUBDATE(STR_TO_DATE(NULL,0), INTERVAL 1 HOUR)
+NULL
+#
+# BUG#59895 - setting storage engine to null segfaults mysqld
+#
+SELECT MONTHNAME(0), MONTHNAME(0) IS NULL, MONTHNAME(0) + 1;
+MONTHNAME(0) MONTHNAME(0) IS NULL MONTHNAME(0) + 1
+NULL 1 NULL
+SET storage_engine=NULL;
+ERROR 42000: Variable 'storage_engine' can't be set to the value of 'NULL'
+#
+# Bug #59686 crash in String::copy() with time data type
+#
+SELECT min(timestampadd(month, 1>'', from_days('%Z')));
+min(timestampadd(month, 1>'', from_days('%Z')))
+NULL
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '%Z'
+create table t1(a time);
+insert into t1 values ('00:00:00'),('00:01:00');
+select 1 from t1 where 1 < some (select cast(a as datetime) from t1);
+1
+drop table t1;
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result
index a28f537b2de..6db63a6ada0 100644
--- a/mysql-test/r/gis-rtree.result
+++ b/mysql-test/r/gis-rtree.result
@@ -1099,3 +1099,30 @@ HANDLER t1 READ a NEXT;
HANDLER t1 CLOSE;
DROP TABLE t1;
End of 5.0 tests.
+#
+# Bug #57323/11764487: myisam corruption with insert ignore
+# and invalid spatial data
+#
+CREATE TABLE t1(a LINESTRING NOT NULL, b GEOMETRY NOT NULL,
+SPATIAL KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(GEOMFROMTEXT("point (0 0)"), GEOMFROMTEXT("point (1 1)"));
+INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=GEOMFROMTEXT("error");
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=NULL;
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+SELECT ASTEXT(a), ASTEXT(b) FROM t1;
+ASTEXT(a) ASTEXT(b)
+POINT(0 0) POINT(1 1)
+DROP TABLE t1;
+CREATE TABLE t1(a INT NOT NULL, b GEOMETRY NOT NULL,
+KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(0, GEOMFROMTEXT("point (1 1)"));
+INSERT IGNORE INTO t1 SET a=0, b=GEOMFROMTEXT("error");
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+INSERT IGNORE INTO t1 SET a=1, b=NULL;
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+SELECT a, ASTEXT(b) FROM t1;
+a ASTEXT(b)
+0 POINT(1 1)
+DROP TABLE t1;
+End of 5.1 tests
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 5663f167d00..bfd0ddccb90 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -960,6 +960,18 @@ COUNT(*)
2
DROP TABLE t1, t2;
End of 5.0 tests
+#
+# Test for bug #58650 "Failing assertion: primary_key_no == -1 ||
+# primary_key_no == 0".
+#
+drop table if exists t1;
+# The minimal test case.
+create table t1 (a int not null, b linestring not null, unique key b (b(12)), unique key a (a));
+drop table t1;
+# The original test case.
+create table t1 (a int not null, b linestring not null, unique key b (b(12)));
+create unique index a on t1(a);
+drop table t1;
create table `t1` (`col002` point)engine=myisam;
insert into t1 values (),(),();
select min(`col002`) from t1 union select `col002` from t1;
@@ -1014,7 +1026,27 @@ SET @a=0x00000000030000000100000000000000000000000000144000000000000014400000000
SET @a=POLYFROMWKB(@a);
SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440;
SET @a=POLYFROMWKB(@a);
+create table t1(a polygon NOT NULL)engine=myisam;
+insert into t1 values (geomfromtext("point(0 1)"));
+insert into t1 values (geomfromtext("point(1 0)"));
+select * from (select polygon(t1.a) as p from t1 order by t1.a) d;
+p
+NULL
+NULL
+drop table t1;
+#
+# Test for bug #59888 "debug assertion when attempt to create spatial index
+# on char > 31 bytes".
+#
+create table t1(a char(32) not null) engine=myisam;
+create spatial index i on t1 (a);
+ERROR 42000: A SPATIAL index may only contain a geometrical type column
+drop table t1;
End of 5.1 tests
+CREATE TABLE t0 (a BINARY(32) NOT NULL);
+CREATE SPATIAL INDEX i on t0 (a);
+ERROR 42000: A SPATIAL index may only contain a geometrical type column
+INSERT INTO t0 VALUES (1);
CREATE TABLE t1(
col0 BINARY NOT NULL,
col2 TIMESTAMP,
@@ -1043,5 +1075,5 @@ col2 LINESTRING,
SPATIAL INDEX i1 (col1, col2)
);
ERROR HY000: Incorrect arguments to SPATIAL INDEX
-DROP TABLE t1;
-DROP TABLE t2;
+DROP TABLE t0, t1, t2;
+End of 5.5 tests
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index e80dcd9793f..a02c15c03fb 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -13,8 +13,48 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
grant delete on mysqltest.* to mysqltest_1@localhost;
select * from mysql.user where user="mysqltest_1";
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin auth_string
-localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0
+Host localhost
+User mysqltest_1
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type SPECIFIED
+ssl_cipher EDH-RSA-DES-CBC3-SHA
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
@@ -44,15 +84,95 @@ delete from mysql.user where user='mysqltest_1';
flush privileges;
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10;
select * from mysql.user where user="mysqltest_1";
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin auth_string
-localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 0 0 0
+Host localhost
+User mysqltest_1
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 10
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30;
select * from mysql.user where user="mysqltest_1";
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin auth_string
-localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 20 30 0
+Host localhost
+User mysqltest_1
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 10
+max_updates 20
+max_connections 30
+max_user_connections 0
+plugin
+authentication_string NULL
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30
@@ -474,6 +594,7 @@ Index Tables To create or drop indexes
Insert Tables To insert data into tables
Lock tables Databases To use LOCK TABLES (together with SELECT privilege)
Process Server Admin To view the plain text of currently executing queries
+Proxy Server Admin To make proxy user possible
References Databases,Tables To have references on tables
Reload Server Admin To reload or refresh tables, logs and privileges
Replication client Server Admin To ask where the slave or master servers are
@@ -626,16 +747,19 @@ show grants for root@localhost;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT SELECT ON `ÂÄ`.* TO 'root'@'localhost'
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
flush privileges;
show grants for root@localhost;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT SELECT ON `ÂÄ`.* TO 'root'@'localhost'
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
drop database ÂÄ;
revoke all privileges on ÂÄ.* from root@localhost;
show grants for root@localhost;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
set names latin1;
create user mysqltest_7@;
set password for mysqltest_7@ = password('systpass');
@@ -1254,6 +1378,273 @@ CURRENT_USER()
root@localhost
SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
+
+# Bug#57952
+
+DROP DATABASE IF EXISTS mysqltest1;
+DROP DATABASE IF EXISTS mysqltest2;
+CREATE DATABASE mysqltest1;
+CREATE DATABASE mysqltest2;
+use mysqltest1;
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 1);
+CREATE TABLE t2(a INT);
+INSERT INTO t2 VALUES (2);
+CREATE TABLE mysqltest2.t3(a INT);
+INSERT INTO mysqltest2.t3 VALUES (4);
+CREATE USER testuser@localhost;
+GRANT CREATE ROUTINE, EXECUTE ON mysqltest1.* TO testuser@localhost;
+GRANT SELECT(b) ON t1 TO testuser@localhost;
+GRANT SELECT ON t2 TO testuser@localhost;
+GRANT SELECT ON mysqltest2.* TO testuser@localhost;
+
+# Connection: bug57952_con1 (testuser@localhost, db: mysqltest1)
+PREPARE s1 FROM 'SELECT b FROM t1';
+PREPARE s2 FROM 'SELECT a FROM t2';
+PREPARE s3 FROM 'SHOW TABLES FROM mysqltest2';
+CREATE PROCEDURE p1() SELECT b FROM t1;
+CREATE PROCEDURE p2() SELECT a FROM t2;
+CREATE PROCEDURE p3() SHOW TABLES FROM mysqltest2;
+CALL p1;
+b
+1
+CALL p2;
+a
+2
+CALL p3;
+Tables_in_mysqltest2
+t3
+
+# Connection: default
+REVOKE SELECT ON t1 FROM testuser@localhost;
+GRANT SELECT(a) ON t1 TO testuser@localhost;
+REVOKE SELECT ON t2 FROM testuser@localhost;
+REVOKE SELECT ON mysqltest2.* FROM testuser@localhost;
+
+# Connection: bug57952_con1 (testuser@localhost, db: mysqltest1)
+# - Check column-level privileges...
+EXECUTE s1;
+ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for column 'b' in table 't1'
+SELECT b FROM t1;
+ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for column 'b' in table 't1'
+EXECUTE s1;
+ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for column 'b' in table 't1'
+CALL p1;
+ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for column 'b' in table 't1'
+# - Check table-level privileges...
+SELECT a FROM t2;
+ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for table 't2'
+EXECUTE s2;
+ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for table 't2'
+CALL p2;
+ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for table 't2'
+# - Check database-level privileges...
+SHOW TABLES FROM mysqltest2;
+ERROR 42000: Access denied for user 'testuser'@'localhost' to database 'mysqltest2'
+EXECUTE s3;
+ERROR 42000: Access denied for user 'testuser'@'localhost' to database 'mysqltest2'
+CALL p3;
+ERROR 42000: Access denied for user 'testuser'@'localhost' to database 'mysqltest2'
+
+# Connection: default
+DROP DATABASE mysqltest1;
+DROP DATABASE mysqltest2;
+DROP USER testuser@localhost;
+use test;
+
+#
+# Test for bug #36544 "DROP USER does not remove stored function
+# privileges".
+#
+create database mysqltest1;
+create function mysqltest1.f1() returns int return 0;
+create procedure mysqltest1.p1() begin end;
+#
+# 1) Check that DROP USER properly removes privileges on both
+# stored procedures and functions.
+#
+create user mysqluser1@localhost;
+grant execute on function mysqltest1.f1 to mysqluser1@localhost;
+grant execute on procedure mysqltest1.p1 to mysqluser1@localhost;
+# Quick test that granted privileges are properly reflected
+# in privilege tables and in in-memory structures.
+show grants for mysqluser1@localhost;
+Grants for mysqluser1@localhost
+GRANT USAGE ON *.* TO 'mysqluser1'@'localhost'
+GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser1'@'localhost'
+GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser1'@'localhost'
+select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
+db routine_name routine_type proc_priv
+mysqltest1 f1 FUNCTION Execute
+mysqltest1 p1 PROCEDURE Execute
+#
+# Create connection 'bug_36544_con1' as 'mysqluser1@localhost'.
+call mysqltest1.p1();
+select mysqltest1.f1();
+mysqltest1.f1()
+0
+#
+# Switch to connection 'default'.
+drop user mysqluser1@localhost;
+#
+# Test that dropping of user is properly reflected in
+# both privilege tables and in in-memory structures.
+#
+# Switch to connection 'bug36544_con1'.
+# The connection cold be alive but should not be able to
+# access to any of the stored routines.
+call mysqltest1.p1();
+ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1'
+select mysqltest1.f1();
+ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1'
+#
+# Switch to connection 'default'.
+#
+# Now create user with the same name and check that he
+# has not inherited privileges.
+create user mysqluser1@localhost;
+show grants for mysqluser1@localhost;
+Grants for mysqluser1@localhost
+GRANT USAGE ON *.* TO 'mysqluser1'@'localhost'
+select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
+db routine_name routine_type proc_priv
+#
+# Create connection 'bug_36544_con2' as 'mysqluser1@localhost'.
+# Newly created user should not be able to access any of the routines.
+call mysqltest1.p1();
+ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1'
+select mysqltest1.f1();
+ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1'
+#
+# Switch to connection 'default'.
+#
+# 2) Check that RENAME USER properly updates privileges on both
+# stored procedures and functions.
+#
+grant execute on function mysqltest1.f1 to mysqluser1@localhost;
+grant execute on procedure mysqltest1.p1 to mysqluser1@localhost;
+#
+# Create one more user to make in-memory hashes non-trivial.
+# User names 'mysqluser11' and 'mysqluser10' were selected
+# to trigger bug discovered during code inspection.
+create user mysqluser11@localhost;
+grant execute on function mysqltest1.f1 to mysqluser11@localhost;
+grant execute on procedure mysqltest1.p1 to mysqluser11@localhost;
+# Also create a couple of tables to test for another bug
+# discovered during code inspection (again table names were
+# chosen especially to trigger the bug).
+create table mysqltest1.t11 (i int);
+create table mysqltest1.t22 (i int);
+grant select on mysqltest1.t22 to mysqluser1@localhost;
+grant select on mysqltest1.t11 to mysqluser1@localhost;
+# Quick test that granted privileges are properly reflected
+# in privilege tables and in in-memory structures.
+show grants for mysqluser1@localhost;
+Grants for mysqluser1@localhost
+GRANT USAGE ON *.* TO 'mysqluser1'@'localhost'
+GRANT SELECT ON `mysqltest1`.`t11` TO 'mysqluser1'@'localhost'
+GRANT SELECT ON `mysqltest1`.`t22` TO 'mysqluser1'@'localhost'
+GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser1'@'localhost'
+GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser1'@'localhost'
+select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
+db routine_name routine_type proc_priv
+mysqltest1 f1 FUNCTION Execute
+mysqltest1 p1 PROCEDURE Execute
+select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost';
+db table_name table_priv
+mysqltest1 t11 Select
+mysqltest1 t22 Select
+#
+# Switch to connection 'bug36544_con2'.
+call mysqltest1.p1();
+select mysqltest1.f1();
+mysqltest1.f1()
+0
+select * from mysqltest1.t11;
+i
+select * from mysqltest1.t22;
+i
+#
+# Switch to connection 'default'.
+rename user mysqluser1@localhost to mysqluser10@localhost;
+#
+# Test that there are no privileges left for mysqluser1.
+#
+# Switch to connection 'bug36544_con2'.
+# The connection cold be alive but should not be able to
+# access to any of the stored routines or tables.
+call mysqltest1.p1();
+ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1'
+select mysqltest1.f1();
+ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1'
+select * from mysqltest1.t11;
+ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't11'
+select * from mysqltest1.t22;
+ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't22'
+#
+# Switch to connection 'default'.
+#
+# Now create user with the old name and check that he
+# has not inherited privileges.
+create user mysqluser1@localhost;
+show grants for mysqluser1@localhost;
+Grants for mysqluser1@localhost
+GRANT USAGE ON *.* TO 'mysqluser1'@'localhost'
+select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
+db routine_name routine_type proc_priv
+select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost';
+db table_name table_priv
+#
+# Create connection 'bug_36544_con3' as 'mysqluser1@localhost'.
+# Newly created user should not be able to access to any of the
+# stored routines or tables.
+call mysqltest1.p1();
+ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1'
+select mysqltest1.f1();
+ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1'
+select * from mysqltest1.t11;
+ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't11'
+select * from mysqltest1.t22;
+ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't22'
+#
+# Switch to connection 'default'.
+#
+# Now check that privileges became associated with a new user
+# name - mysqluser10.
+#
+show grants for mysqluser10@localhost;
+Grants for mysqluser10@localhost
+GRANT USAGE ON *.* TO 'mysqluser10'@'localhost'
+GRANT SELECT ON `mysqltest1`.`t22` TO 'mysqluser10'@'localhost'
+GRANT SELECT ON `mysqltest1`.`t11` TO 'mysqluser10'@'localhost'
+GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser10'@'localhost'
+GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser10'@'localhost'
+select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser10' and host='localhost';
+db routine_name routine_type proc_priv
+mysqltest1 f1 FUNCTION Execute
+mysqltest1 p1 PROCEDURE Execute
+select db, table_name, table_priv from mysql.tables_priv where user='mysqluser10' and host='localhost';
+db table_name table_priv
+mysqltest1 t11 Select
+mysqltest1 t22 Select
+#
+# Create connection 'bug_36544_con4' as 'mysqluser10@localhost'.
+call mysqltest1.p1();
+select mysqltest1.f1();
+mysqltest1.f1()
+0
+select * from mysqltest1.t11;
+i
+select * from mysqltest1.t22;
+i
+#
+# Switch to connection 'default'.
+#
+# Clean-up.
+drop user mysqluser1@localhost;
+drop user mysqluser10@localhost;
+drop user mysqluser11@localhost;
+drop database mysqltest1;
End of 5.0 tests
set names utf8;
grant select on test.* to юзер_юзер@localhost;
@@ -1325,8 +1716,6 @@ CREATE USER 'userbug33464'@'localhost';
GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost';
userbug33464@localhost dbbug33464
-DROP PROCEDURE IF EXISTS sp3;
-DROP FUNCTION IF EXISTS fn1;
CREATE PROCEDURE sp3(v1 char(20))
BEGIN
SELECT * from dbbug33464.t6 where t6.f2= 'xyz';
@@ -1350,11 +1739,7 @@ fn2()
2
DROP USER 'userbug33464'@'localhost';
DROP FUNCTION fn1;
-Warnings:
-Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn1'
DROP FUNCTION fn2;
-Warnings:
-Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn2'
DROP PROCEDURE sp3;
DROP USER 'userbug33464'@'localhost';
USE test;
@@ -1454,6 +1839,17 @@ DROP USER 'testbug'@localhost;
DROP TABLE db2.t1;
DROP DATABASE db1;
DROP DATABASE db2;
+#
+# Bug #36742
+#
+grant usage on Foo.* to myuser@Localhost identified by 'foo';
+grant select on Foo.* to myuser@localhost;
+select host,user from mysql.user where User='myuser';
+host user
+localhost myuser
+revoke select on Foo.* from myuser@localhost;
+delete from mysql.user where User='myuser';
+flush privileges;
#########################################################################
#
# Bug#38347: ALTER ROUTINE privilege allows SHOW CREATE TABLE.
diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result
index 4758e2c9b22..a3323d51efb 100644
--- a/mysql-test/r/grant2.result
+++ b/mysql-test/r/grant2.result
@@ -11,7 +11,7 @@ grant create user on *.* to mysqltest_1@localhost;
create user mysqltest_2@localhost;
grant select on `my\_1`.* to mysqltest_2@localhost;
grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass';
-ERROR 42000: You must have privileges to update tables in the mysql database to be able to change passwords for others
+ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql'
grant update on mysql.* to mysqltest_1@localhost;
grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass';
grant select on `my\_1`.* to mysqltest_3@localhost;
@@ -335,7 +335,7 @@ delete from mysql.user where user like 'mysqltest\_1';
flush privileges;
drop database mysqltest_1;
set password = password("changed");
-ERROR 42000: Access denied for user ''@'localhost' to database 'mysql'
+ERROR 42000: Can't find any matching row in the user table
lock table mysql.user write;
flush privileges;
grant all on *.* to 'mysqltest_1'@'localhost';
diff --git a/mysql-test/r/grant3.result b/mysql-test/r/grant3.result
index 59c64ee84ae..fd51a83d4b2 100644
--- a/mysql-test/r/grant3.result
+++ b/mysql-test/r/grant3.result
@@ -21,123 +21,108 @@ grant select on test.* to CUser@LOCALHOST;
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
user host db select_priv
-CUser LOCALHOST test Y
CUser localhost test Y
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
user host db select_priv
-CUser localhost test Y
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
user host db select_priv
DROP USER CUser@localhost;
DROP USER CUser@LOCALHOST;
+ERROR HY000: Operation DROP USER failed for 'CUser'@'localhost'
create table t1 (a int);
grant select on test.t1 to CUser@localhost;
grant select on test.t1 to CUser@LOCALHOST;
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
user host db Table_name Table_priv Column_priv
-CUser LOCALHOST test t1 Select
CUser localhost test t1 Select
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
user host db Table_name Table_priv Column_priv
-CUser localhost test t1 Select
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
user host db Table_name Table_priv Column_priv
DROP USER CUser@localhost;
DROP USER CUser@LOCALHOST;
+ERROR HY000: Operation DROP USER failed for 'CUser'@'localhost'
grant select(a) on test.t1 to CUser@localhost;
grant select(a) on test.t1 to CUser@LOCALHOST;
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
user host db Table_name Table_priv Column_priv
-CUser LOCALHOST test t1 Select
CUser localhost test t1 Select
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
user host db Table_name Table_priv Column_priv
-CUser localhost test t1 Select
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
user host
-CUser LOCALHOST
CUser localhost
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
user host db Table_name Table_priv Column_priv
DROP USER CUser@localhost;
DROP USER CUser@LOCALHOST;
+ERROR HY000: Operation DROP USER failed for 'CUser'@'localhost'
drop table t1;
grant select on test.* to CUser2@localhost;
grant select on test.* to CUser2@LOCALHOST;
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
user host
-CUser2 LOCALHOST
CUser2 localhost
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
user host db select_priv
-CUser2 LOCALHOST test Y
CUser2 localhost test Y
REVOKE SELECT ON test.* FROM 'CUser2'@'LOCALHOST';
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
user host
-CUser2 LOCALHOST
CUser2 localhost
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
user host db select_priv
-CUser2 localhost test Y
REVOKE SELECT ON test.* FROM 'CUser2'@'localhost';
+ERROR 42000: There is no such grant defined for user 'CUser2' on host 'localhost'
flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
user host
-CUser2 LOCALHOST
CUser2 localhost
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
user host db select_priv
DROP USER CUser2@localhost;
DROP USER CUser2@LOCALHOST;
+ERROR HY000: Operation DROP USER failed for 'CUser2'@'localhost'
CREATE DATABASE mysqltest_1;
CREATE TABLE mysqltest_1.t1 (a INT);
CREATE USER 'mysqltest1'@'%';
diff --git a/mysql-test/r/grant_cache_no_prot.result b/mysql-test/r/grant_cache_no_prot.result
index 32bb9cce90e..019edb72086 100644
--- a/mysql-test/r/grant_cache_no_prot.result
+++ b/mysql-test/r/grant_cache_no_prot.result
@@ -7,9 +7,11 @@ flush status;
show grants for current_user;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY 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);
diff --git a/mysql-test/r/grant_cache_ps_prot.result b/mysql-test/r/grant_cache_ps_prot.result
index 281468ee2e1..e95a858fd9a 100644
--- a/mysql-test/r/grant_cache_ps_prot.result
+++ b/mysql-test/r/grant_cache_ps_prot.result
@@ -7,9 +7,11 @@ flush status;
show grants for current_user;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY 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);
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index c1c14452bc2..12080ddf5a8 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1863,6 +1863,52 @@ SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a;
SUBSTRING(a,1,10) LENGTH(a)
1111111111 1300
DROP TABLE t1;
+#
+# Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field
+#
+CREATE TABLE t1(f1 INT NOT NULL);
+INSERT INTO t1 VALUES (16777214),(0);
+SELECT COUNT(*) FROM t1 LEFT JOIN t1 t2
+ON 1 WHERE t2.f1 > 1 GROUP BY t2.f1;
+COUNT(*)
+2
+DROP TABLE t1;
+#
+# Bug#59839: Aggregation followed by subquery yields wrong result
+#
+CREATE TABLE t1 (
+a INT,
+b INT,
+c INT,
+KEY (a, b)
+);
+INSERT INTO t1 VALUES
+( 1, 1, 1 ),
+( 1, 2, 2 ),
+( 1, 3, 3 ),
+( 1, 4, 6 ),
+( 1, 5, 5 ),
+( 1, 9, 13 ),
+( 2, 1, 6 ),
+( 2, 2, 7 ),
+( 2, 3, 8 );
+EXPLAIN
+SELECT a, AVG(t1.b),
+(SELECT t11.c FROM t1 t11 WHERE t11.a = t1.a AND t11.b = AVG(t1.b)) AS t11c,
+(SELECT t12.c FROM t1 t12 WHERE t12.a = t1.a AND t12.b = AVG(t1.b)) AS t12c
+FROM t1 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 index NULL a 10 NULL 9 Using index
+3 DEPENDENT SUBQUERY t12 ref a a 10 func,func 2 Using where
+2 DEPENDENT SUBQUERY t11 ref a a 10 func,func 2 Using where
+SELECT a, AVG(t1.b),
+(SELECT t11.c FROM t1 t11 WHERE t11.a = t1.a AND t11.b = AVG(t1.b)) AS t11c,
+(SELECT t12.c FROM t1 t12 WHERE t12.a = t1.a AND t12.b = AVG(t1.b)) AS t12c
+FROM t1 GROUP BY a;
+a AVG(t1.b) t11c t12c
+1 4.0000 6 6
+2 2.0000 7 7
+DROP TABLE t1;
# End of 5.1 tests
#
# Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00
diff --git a/mysql-test/r/handler_innodb.result b/mysql-test/r/handler_innodb.result
index 121cfa89f1c..dd4cac669c8 100644
--- a/mysql-test/r/handler_innodb.result
+++ b/mysql-test/r/handler_innodb.result
@@ -1485,10 +1485,6 @@ ERROR 42S02: Table 'test.not_exists_write' doesn't exist
# We still have the read lock.
drop table t1;
ERROR HY000: Can't execute the query because you have a conflicting read lock
-handler t1 read next;
-a b
-1 1
-handler t1 close;
handler t1 open;
select a from t2;
a
@@ -1726,7 +1722,22 @@ CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1);
HANDLER t1 OPEN;
HANDLER t1 READ FIRST WHERE f1() = 1;
-ERROR 42S02: Table 'test.t2' doesn't exist
+ERROR 42000: This version of MySQL doesn't yet support 'stored functions in HANDLER ... READ'
+HANDLER t1 CLOSE;
+DROP FUNCTION f1;
+DROP TABLE t1;
+#
+# Bug#54920 Stored functions are allowed in HANDLER statements,
+# but broken.
+#
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS f1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST WHERE f1() = 1;
+ERROR 42000: This version of MySQL doesn't yet support 'stored functions in HANDLER ... READ'
HANDLER t1 CLOSE;
DROP FUNCTION f1;
DROP TABLE t1;
diff --git a/mysql-test/r/handler_myisam.result b/mysql-test/r/handler_myisam.result
index fd08fd12f15..69d791b8263 100644
--- a/mysql-test/r/handler_myisam.result
+++ b/mysql-test/r/handler_myisam.result
@@ -1481,10 +1481,6 @@ ERROR 42S02: Table 'test.not_exists_write' doesn't exist
# We still have the read lock.
drop table t1;
ERROR HY000: Can't execute the query because you have a conflicting read lock
-handler t1 read next;
-a b
-1 1
-handler t1 close;
handler t1 open;
select a from t2;
a
@@ -1722,7 +1718,22 @@ CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1);
HANDLER t1 OPEN;
HANDLER t1 READ FIRST WHERE f1() = 1;
-ERROR 42S02: Table 'test.t2' doesn't exist
+ERROR 42000: This version of MySQL doesn't yet support 'stored functions in HANDLER ... READ'
+HANDLER t1 CLOSE;
+DROP FUNCTION f1;
+DROP TABLE t1;
+#
+# Bug#54920 Stored functions are allowed in HANDLER statements,
+# but broken.
+#
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS f1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+HANDLER t1 OPEN;
+HANDLER t1 READ FIRST WHERE f1() = 1;
+ERROR 42000: This version of MySQL doesn't yet support 'stored functions in HANDLER ... READ'
HANDLER t1 CLOSE;
DROP FUNCTION f1;
DROP TABLE t1;
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index 2f223f081c2..5838d3f01c2 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -549,4 +549,26 @@ FROM t1 JOIN t2 ON t2.f2 LIKE 'x'
HAVING field1 < 7;
field1
DROP TABLE t1,t2;
+#
+# Bug#48916 Server incorrectly processing HAVING clauses with an ORDER BY clause
+#
+CREATE TABLE t1 (f1 INT, f2 INT);
+INSERT INTO t1 VALUES (1, 0), (2, 1), (3, 2);
+CREATE TABLE t2 (f1 INT, f2 INT);
+SELECT t1.f1
+FROM t1
+HAVING (3, 2) IN (SELECT f1, f2 FROM t2) AND t1.f1 >= 0
+ORDER BY t1.f1;
+f1
+SELECT t1.f1
+FROM t1
+HAVING (3, 2) IN (SELECT 4, 2) AND t1.f1 >= 0
+ORDER BY t1.f1;
+f1
+SELECT t1.f1
+FROM t1
+HAVING 2 IN (SELECT f2 FROM t2) AND t1.f1 >= 0
+ORDER BY t1.f1;
+f1
+DROP TABLE t1,t2;
End of 5.1 tests
diff --git a/mysql-test/r/implicit_char_to_num_conversion.result b/mysql-test/r/implicit_char_to_num_conversion.result
new file mode 100644
index 00000000000..8f24a6b293c
--- /dev/null
+++ b/mysql-test/r/implicit_char_to_num_conversion.result
@@ -0,0 +1,366 @@
+DROP TABLE IF EXISTS t5;
+CREATE TABLE t5(c1 BIT(2) PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (0), (1), (2);
+SELECT HEX(c1) FROM t5 ORDER BY c1;
+HEX(c1)
+0
+1
+2
+SELECT HEX(c1) FROM t5 WHERE c1 = b'1' ORDER BY c1;
+HEX(c1)
+1
+SELECT HEX(c1) FROM t5 WHERE c1 <=> b'1' ORDER BY c1;
+HEX(c1)
+1
+SELECT HEX(c1) FROM t5 WHERE c1 != b'1' ORDER BY c1;
+HEX(c1)
+0
+2
+SELECT HEX(c1) FROM t5 WHERE c1 >= '1' ORDER BY c1;
+HEX(c1)
+1
+2
+SELECT HEX(c1) FROM t5 WHERE c1 <= '1' ORDER BY c1;
+HEX(c1)
+0
+1
+SELECT HEX(c1) FROM t5 WHERE c1 < '1' ORDER BY c1;
+HEX(c1)
+0
+SELECT HEX(c1) FROM t5 WHERE c1 > '0' ORDER BY c1;
+HEX(c1)
+1
+2
+DROP TABLE t5;
+CREATE TABLE t5(c1 FLOAT(5,2) PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (95.95), (-10.10), (1), (0);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-10.10
+0.00
+1.00
+95.95
+SELECT c1 FROM t5 WHERE c1 >= '95' ORDER BY c1;
+c1
+95.95
+SELECT c1 FROM t5 WHERE c1 <= '10.10' ORDER BY c1;
+c1
+-10.10
+0.00
+1.00
+SELECT c1 FROM t5 WHERE c1 != '1' ORDER BY c1;
+c1
+-10.10
+0.00
+95.95
+SELECT c1 FROM t5 WHERE c1 < '1' ORDER BY c1;
+c1
+-10.10
+0.00
+SELECT c1 FROM t5 WHERE c1 > '0' ORDER BY c1;
+c1
+1.00
+95.95
+DROP TABLE t5;
+CREATE TABLE t5(c1 TINYINT PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (95), (10),(11),(-8);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-8
+10
+11
+95
+SELECT c1 FROM t5 WHERE c1 = '10' ORDER BY c1;
+c1
+10
+SELECT c1 FROM t5 WHERE c1 <=> '10' ORDER BY c1;
+c1
+10
+SELECT c1 FROM t5 WHERE c1 >= '95' ORDER BY c1;
+c1
+95
+SELECT c1 FROM t5 WHERE c1 <= '11' ORDER BY c1;
+c1
+-8
+10
+11
+SELECT c1 FROM t5 WHERE c1 != '-8' ORDER BY c1;
+c1
+10
+11
+95
+SELECT c1 FROM t5 WHERE c1 < '11' ORDER BY c1;
+c1
+-8
+10
+SELECT c1 FROM t5 WHERE c1 > '10' ORDER BY c1;
+c1
+11
+95
+DROP TABLE t5;
+CREATE TABLE t5(c1 SMALLINT PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (395), (-200), (100), (111);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-200
+100
+111
+395
+SELECT c1 FROM t5 WHERE c1 = '100' ORDER BY c1;
+c1
+100
+SELECT c1 FROM t5 WHERE c1 <=> '100' ORDER BY c1;
+c1
+100
+SELECT c1 FROM t5 WHERE c1 >= '395' ORDER BY c1;
+c1
+395
+SELECT c1 FROM t5 WHERE c1 <= '-200' ORDER BY c1;
+c1
+-200
+SELECT c1 FROM t5 WHERE c1 != '100' ORDER BY c1;
+c1
+-200
+111
+395
+SELECT c1 FROM t5 WHERE c1 < '111' ORDER BY c1;
+c1
+-200
+100
+SELECT c1 FROM t5 WHERE c1 > '111' ORDER BY c1;
+c1
+395
+DROP TABLE t5;
+CREATE TABLE t5(c1 MEDIUMINT PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (-8388607), (311),(215),(88608);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-8388607
+215
+311
+88608
+SELECT c1 FROM t5 WHERE c1 = '311' ORDER BY c1;
+c1
+311
+SELECT c1 FROM t5 WHERE c1 <=> '311' ORDER BY c1;
+c1
+311
+SELECT c1 FROM t5 WHERE c1 >= '215' ORDER BY c1;
+c1
+215
+311
+88608
+SELECT c1 FROM t5 WHERE c1 <= '88608' ORDER BY c1;
+c1
+-8388607
+215
+311
+88608
+SELECT c1 FROM t5 WHERE c1 != '-8388607' ORDER BY c1;
+c1
+215
+311
+88608
+SELECT c1 FROM t5 WHERE c1 < '215' ORDER BY c1;
+c1
+-8388607
+SELECT c1 FROM t5 WHERE c1 > '215' ORDER BY c1;
+c1
+311
+88608
+DROP TABLE t5;
+CREATE TABLE t5(c1 INT PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (-2147483647), (1011),(15),(9388607);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-2147483647
+15
+1011
+9388607
+SELECT c1 FROM t5 WHERE c1 = '9388607' ORDER BY c1;
+c1
+9388607
+SELECT c1 FROM t5 WHERE c1 <=> '9388607' ORDER BY c1;
+c1
+9388607
+SELECT c1 FROM t5 WHERE c1 >= '15' ORDER BY c1;
+c1
+15
+1011
+9388607
+SELECT c1 FROM t5 WHERE c1 <= '1011' ORDER BY c1;
+c1
+-2147483647
+15
+1011
+SELECT c1 FROM t5 WHERE c1 != '-2147483647' ORDER BY c1;
+c1
+15
+1011
+9388607
+SELECT c1 FROM t5 WHERE c1 < '15' ORDER BY c1;
+c1
+-2147483647
+SELECT c1 FROM t5 WHERE c1 > '15' ORDER BY c1;
+c1
+1011
+9388607
+DROP TABLE t5;
+CREATE TABLE t5(c1 BIGINT PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (-9223372036854775807), (12011),(500),(3372036854775808);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-9223372036854775807
+500
+12011
+3372036854775808
+SELECT c1 FROM t5 WHERE c1 = '-9223372036854775807' ORDER BY c1;
+c1
+-9223372036854775807
+SELECT c1 FROM t5 WHERE c1 <=> '-9223372036854775807' ORDER BY c1;
+c1
+-9223372036854775807
+SELECT c1 FROM t5 WHERE c1 >= '12011' ORDER BY c1;
+c1
+12011
+3372036854775808
+SELECT c1 FROM t5 WHERE c1 <= '500' ORDER BY c1;
+c1
+-9223372036854775807
+500
+SELECT c1 FROM t5 WHERE c1 != '3372036854775808' ORDER BY c1;
+c1
+-9223372036854775807
+500
+12011
+SELECT c1 FROM t5 WHERE c1 < '12011' ORDER BY c1;
+c1
+-9223372036854775807
+500
+SELECT c1 FROM t5 WHERE c1 > '12011' ORDER BY c1;
+c1
+3372036854775808
+DROP TABLE t5;
+CREATE TABLE t5(c1 DOUBLE(5,2) PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
+c1
+11.11
+SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
+c1
+11.11
+SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+DROP TABLE t5;
+CREATE TABLE t5(c1 NUMERIC(5,2) PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
+c1
+11.11
+SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
+c1
+11.11
+SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+DROP TABLE t5;
+CREATE TABLE t5(c1 DECIMAL(5,2) PRIMARY KEY) ENGINE = <default_engine>;
+INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
+SELECT c1 FROM t5 ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
+c1
+11.11
+SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
+c1
+11.11
+SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
+c1
+-908.92
+5.00
+11.11
+SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
+c1
+5.00
+11.11
+95.95
+DROP TABLE t5;
diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
index 0040221884e..1caf9be8ac2 100644
--- a/mysql-test/r/index_merge_myisam.result
+++ b/mysql-test/r/index_merge_myisam.result
@@ -1156,6 +1156,61 @@ key1 key2 key3
38 38 38
39 39 39
drop table t1;
+#
+# Bug#56423: Different count with SELECT and CREATE SELECT queries
+#
+CREATE TABLE t1 (
+a INT,
+b INT,
+c INT,
+d INT,
+PRIMARY KEY (a),
+KEY (c),
+KEY bd (b,d)
+);
+INSERT INTO t1 VALUES
+(1, 0, 1, 0),
+(2, 1, 1, 1),
+(3, 1, 1, 1),
+(4, 0, 1, 1);
+EXPLAIN
+SELECT a
+FROM t1
+WHERE c = 1 AND b = 1 AND d = 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref c,bd bd 10 const,const 2 Using where
+CREATE TABLE t2 ( a INT )
+SELECT a
+FROM t1
+WHERE c = 1 AND b = 1 AND d = 1;
+SELECT * FROM t2;
+a
+2
+3
+DROP TABLE t1, t2;
+CREATE TABLE t1( a INT, b INT, KEY(a), KEY(b) );
+INSERT INTO t1 VALUES (1, 2), (1, 2), (1, 2), (1, 2);
+SELECT * FROM t1 FORCE INDEX(a, b) WHERE a = 1 AND b = 2;
+a b
+1 2
+1 2
+1 2
+1 2
+DROP TABLE t1;
+# Code coverage of fix.
+CREATE TABLE t1 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b INT);
+INSERT INTO t1 (b) VALUES (1);
+UPDATE t1 SET b = 2 WHERE a = 1;
+SELECT * FROM t1;
+a b
+1 2
+CREATE TABLE t2 ( a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, b VARCHAR(1) );
+INSERT INTO t2 (b) VALUES ('a');
+UPDATE t2 SET b = 'b' WHERE a = 1;
+SELECT * FROM t2;
+a b
+1 b
+DROP TABLE t1, t2;
#---------------- 2-sweeps read Index merge test 2 -------------------------------
SET SESSION STORAGE_ENGINE = MyISAM;
drop table if exists t1;
diff --git a/mysql-test/r/information_schema-big.result b/mysql-test/r/information_schema-big.result
index 248b8d606dc..92408c439a5 100644
--- a/mysql-test/r/information_schema-big.result
+++ b/mysql-test/r/information_schema-big.result
@@ -30,6 +30,7 @@ FILES TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
+PARAMETERS SPECIFIC_SCHEMA
PARTITIONS TABLE_SCHEMA
PLUGINS PLUGIN_NAME
PROCESSLIST ID
@@ -42,6 +43,7 @@ SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
STATISTICS TABLE_SCHEMA
TABLES TABLE_SCHEMA
+TABLESPACES TABLESPACE_NAME
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
TABLE_PRIVILEGES TABLE_SCHEMA
TRIGGERS TRIGGER_SCHEMA
@@ -74,6 +76,7 @@ FILES TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
+PARAMETERS SPECIFIC_SCHEMA
PARTITIONS TABLE_SCHEMA
PLUGINS PLUGIN_NAME
PROCESSLIST ID
@@ -86,6 +89,7 @@ SESSION_STATUS VARIABLE_NAME
SESSION_VARIABLES VARIABLE_NAME
STATISTICS TABLE_SCHEMA
TABLES TABLE_SCHEMA
+TABLESPACES TABLESPACE_NAME
TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
TABLE_PRIVILEGES TABLE_SCHEMA
TRIGGERS TRIGGER_SCHEMA
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 9ed397bbe1e..c9bac8be27f 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -94,6 +94,7 @@ host
plugin
proc
procs_priv
+proxies_priv
servers
slow_log
t1
@@ -696,6 +697,7 @@ Alter_routine_priv select,insert,update,references
max_questions select,insert,update,references
max_connections select,insert,update,references
max_user_connections select,insert,update,references
+authentication_string select,insert,update,references
use test;
create function sub1(i int) returns int
return i+1;
@@ -1770,3 +1772,47 @@ USING (TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME)
WHERE COLUMNS.TABLE_SCHEMA = 'test'
AND COLUMNS.TABLE_NAME = 't1';
TABLE_SCHEMA TABLE_NAME COLUMN_NAME CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME TABLE_CATALOG ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
+#
+# A test case for Bug#56540 "Exception (crash) in sql_show.cc
+# during rqg_info_schema test on Windows"
+# Ensure that we never access memory of a closed table,
+# in particular, never access table->field[] array.
+# Before the fix, the below test case, produced
+# valgrind errors.
+#
+drop table if exists t1;
+drop view if exists v1;
+create table t1 (a int, b int);
+create view v1 as select t1.a, t1.b from t1;
+alter table t1 change b c int;
+lock table t1 read;
+# --> connection con1
+flush tables;
+# --> connection default
+select * from information_schema.views;
+TABLE_CATALOG def
+TABLE_SCHEMA test
+TABLE_NAME v1
+VIEW_DEFINITION select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`
+CHECK_OPTION NONE
+IS_UPDATABLE
+DEFINER root@localhost
+SECURITY_TYPE DEFINER
+CHARACTER_SET_CLIENT latin1
+COLLATION_CONNECTION latin1_swedish_ci
+Warnings:
+Level Warning
+Code 1356
+Message View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+unlock tables;
+#
+# Cleanup.
+#
+# --> connection con1
+# Reaping 'flush tables'
+# --> connection default
+drop table t1;
+drop view v1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/init_file.result b/mysql-test/r/init_file.result
index 43ed908ad01..6394014f3e5 100644
--- a/mysql-test/r/init_file.result
+++ b/mysql-test/r/init_file.result
@@ -21,4 +21,3 @@ y
11
13
drop table t1, t2;
-call mtr.force_restart();
diff --git a/mysql-test/r/innodb_mysql_lock.result b/mysql-test/r/innodb_mysql_lock.result
index bf1c3a89f40..4c7e7f11987 100644
--- a/mysql-test/r/innodb_mysql_lock.result
+++ b/mysql-test/r/innodb_mysql_lock.result
@@ -148,3 +148,27 @@ COMMIT;
# Connection default
DROP TABLE t1, t2;
DROP VIEW v1;
+#
+# Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY
+# KEY NO 0 FOR TABLE IN ERROR LOG
+#
+DROP TABLE IF EXISTS t1;
+# Connection default
+CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1, 12345);
+START TRANSACTION;
+SELECT * FROM t1;
+id value
+1 12345
+# Connection con1
+SET lock_wait_timeout=1;
+ALTER TABLE t1 ADD INDEX idx(value);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ALTER TABLE t1 ADD INDEX idx(value);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+# Connection default
+SELECT * FROM t1;
+id value
+1 12345
+COMMIT;
+DROP TABLE t1;
diff --git a/mysql-test/r/innodb_mysql_sync.result b/mysql-test/r/innodb_mysql_sync.result
index 43a98829d4e..605aaf4df5a 100644
--- a/mysql-test/r/innodb_mysql_sync.result
+++ b/mysql-test/r/innodb_mysql_sync.result
@@ -66,3 +66,123 @@ SELECT ((@id := id) - id) FROM t2;
KILL @id;
SET DEBUG_SYNC= "now SIGNAL killed";
DROP TABLE t1, t2;
+SET DEBUG_SYNC= "RESET";
+#
+# Bug#58933 Assertion `thd- >is_error()' fails on shutdown with ongoing
+# OPTIMIZE TABLE
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1), (2);
+# Connection con1
+SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL waiting WAIT_FOR killed';
+# Sending:
+OPTIMIZE TABLE t1;
+# Connection default
+SET DEBUG_SYNC= 'now WAIT_FOR waiting';
+KILL QUERY ID;
+SET DEBUG_SYNC= 'now SIGNAL killed';
+# Connection con1
+# Reaping: OPTIMIZE TABLE t1
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status Operation failed
+# Connection default
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+#
+# Bug#42230 during add index, cannot do queries on storage engines
+# that implement add_index
+#
+DROP DATABASE IF EXISTS db1;
+DROP TABLE IF EXISTS t1;
+# Test 1: Secondary index, should not block reads (original test case).
+# Connection default
+CREATE DATABASE db1;
+CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb;
+INSERT INTO db1.t1(value) VALUES (1), (2);
+SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
+# Sending:
+ALTER TABLE db1.t1 ADD INDEX(value);
+# Connection con1
+SET DEBUG_SYNC= "now WAIT_FOR manage";
+USE db1;
+SELECT * FROM t1;
+id value
+1 1
+2 2
+SET DEBUG_SYNC= "now SIGNAL query";
+# Connection default
+# Reaping: ALTER TABLE db1.t1 ADD INDEX(value)
+DROP DATABASE db1;
+# Test 2: Primary index (implicit), should block reads.
+CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
+SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
+# Sending:
+ALTER TABLE t1 ADD UNIQUE INDEX(a);
+# Connection con1
+SET DEBUG_SYNC= "now WAIT_FOR manage";
+USE test;
+# Sending:
+SELECT * FROM t1;
+# Connection con2
+# Waiting for SELECT to be blocked by the metadata lock on t1
+SET DEBUG_SYNC= "now SIGNAL query";
+# Connection default
+# Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a)
+# Connection con1
+# Reaping: SELECT * FROM t1
+a b
+# Test 3: Primary index (explicit), should block reads.
+# Connection default
+ALTER TABLE t1 DROP INDEX a;
+SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
+# Sending:
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+# Connection con1
+SET DEBUG_SYNC= "now WAIT_FOR manage";
+# Sending:
+SELECT * FROM t1;
+# Connection con2
+# Waiting for SELECT to be blocked by the metadata lock on t1
+SET DEBUG_SYNC= "now SIGNAL query";
+# Connection default
+# Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a)
+# Connection con1
+# Reaping: SELECT * FROM t1
+a b
+# Test 4: Secondary unique index, should not block reads.
+# Connection default
+SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
+# Sending:
+ALTER TABLE t1 ADD UNIQUE (b);
+# Connection con1
+SET DEBUG_SYNC= "now WAIT_FOR manage";
+SELECT * FROM t1;
+a b
+SET DEBUG_SYNC= "now SIGNAL query";
+# Connection default
+# Reaping: ALTER TABLE t1 ADD UNIQUE (b)
+SET DEBUG_SYNC= "RESET";
+DROP TABLE t1;
+#
+# Bug#11853126 RE-ENABLE CONCURRENT READS WHILE CREATING SECONDARY INDEX
+# IN INNODB
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
+INSERT INTO t1 VALUES (1, 12345), (2, 23456);
+# Connection con1
+SET SESSION debug= "+d,alter_table_rollback_new_index";
+ALTER TABLE t1 ADD PRIMARY KEY(a);
+ERROR HY000: Unknown error
+SELECT * FROM t1;
+a b
+1 12345
+2 23456
+# Connection default
+SELECT * FROM t1;
+a b
+1 12345
+2 23456
+DROP TABLE t1;
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index e6655e155db..538d6ddd0fd 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -843,7 +843,7 @@ SET max_heap_table_size = 16384;
SET @old_myisam_data_pointer_size = @@myisam_data_pointer_size;
SET GLOBAL myisam_data_pointer_size = 2;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
-call mtr.add_suppression("mysqld: The table '.*#sql.*' is full");
+call mtr.add_suppression("mysqld.*: The table '.*#sql.*' is full");
INSERT IGNORE INTO t1 SELECT t1.a FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6,t1 t7;
SET GLOBAL myisam_data_pointer_size = @old_myisam_data_pointer_size;
DROP TABLE t1;
diff --git a/mysql-test/r/ipv4_as_ipv6.result b/mysql-test/r/ipv4_as_ipv6.result
index 8523dc82f02..82bca393d71 100644
--- a/mysql-test/r/ipv4_as_ipv6.result
+++ b/mysql-test/r/ipv4_as_ipv6.result
@@ -32,9 +32,9 @@ mysqld is alive
CREATE USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0:0:0:0:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0:0:0:0:0:FFFF:127.0.0.1';
-Grants for testuser@0:0:0:0:0:FFFF:127.0.0.1
-GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1'
+Grants for testuser@0:0:0:0:0:ffff:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:ffff:127.0.0.1'
SET @nip= inet_aton('0:0:0:0:0:FFFF:127.0.0.1');
SELECT @nip;
@nip
@@ -61,9 +61,9 @@ mysqld is alive
CREATE USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
-Grants for testuser@0000:0000:0000:0000:0000:FFFF:127.0.0.1
-GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1'
+Grants for testuser@0000:0000:0000:0000:0000:ffff:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:ffff:127.0.0.1'
SET @nip= inet_aton('0000:0000:0000:0000:0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
@@ -90,9 +90,9 @@ mysqld is alive
CREATE USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
-Grants for testuser@0:0000:0000:0:0000:FFFF:127.0.0.1
-GRANT USAGE ON *.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1'
+Grants for testuser@0:0000:0000:0:0000:ffff:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'0:0000:0000:0:0000:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0000:0000:0:0000:ffff:127.0.0.1'
SET @nip= inet_aton('0:0000:0000:0:0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
@@ -119,9 +119,9 @@ mysqld is alive
CREATE USER testuser@'0::0000:FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'0::0000:FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'0::0000:FFFF:127.0.0.1';
-Grants for testuser@0::0000:FFFF:127.0.0.1
-GRANT USAGE ON *.* TO 'testuser'@'0::0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0::0000:FFFF:127.0.0.1'
+Grants for testuser@0::0000:ffff:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'0::0000:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0::0000:ffff:127.0.0.1'
SET @nip= inet_aton('0::0000:FFFF:127.0.0.1');
SELECT @nip;
@nip
@@ -149,9 +149,9 @@ mysqld is alive
CREATE USER testuser@'::FFFF:127.0.0.1' identified by '1234';
GRANT ALL ON test.* TO testuser@'::FFFF:127.0.0.1';
SHOW GRANTS FOR testuser@'::FFFF:127.0.0.1';
-Grants for testuser@::FFFF:127.0.0.1
-GRANT USAGE ON *.* TO 'testuser'@'::FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
-GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::FFFF:127.0.0.1'
+Grants for testuser@::ffff:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'::ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::ffff:127.0.0.1'
SET @nip= inet_aton('::FFFF:127.0.0.1');
SELECT @nip;
@nip
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index 5e896dc93ed..98735e9b05a 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -1403,6 +1403,247 @@ Warnings:
Note 1003 select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on((`test`.`jt6`.`f1` and 1)) left join `test`.`t1` `jt1` on(1) where 1
DROP TABLE t1;
#
+# Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field
+#
+CREATE TABLE t1 (f1 INT NOT NULL, PRIMARY KEY (f1));
+CREATE TABLE t2 (f1 INT NOT NULL, f2 INT NOT NULL, PRIMARY KEY (f1, f2));
+INSERT INTO t1 VALUES (4);
+INSERT INTO t2 VALUES (3, 3);
+INSERT INTO t2 VALUES (7, 7);
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4
+GROUP BY t2.f1, t2.f2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 Using temporary; Using filesort
+1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using index
+SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4
+GROUP BY t2.f1, t2.f2;
+f1 f1 f2
+4 NULL NULL
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
+GROUP BY t2.f1, t2.f2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 Using filesort
+1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using where; Using index
+SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
+GROUP BY t2.f1, t2.f2;
+f1 f1 f2
+DROP TABLE t1,t2;
+#
+# Bug#57034 incorrect OUTER JOIN result when joined on unique key
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY,
+col_int INT,
+col_int_unique INT UNIQUE KEY);
+INSERT INTO t1 VALUES (1,NULL,2), (2,0,0);
+CREATE TABLE t2 (pk INT PRIMARY KEY,
+col_int INT,
+col_int_unique INT UNIQUE KEY);
+INSERT INTO t2 VALUES (1,0,1), (2,0,2);
+EXPLAIN
+SELECT * FROM t1 LEFT JOIN t2
+ON t1.col_int_unique = t2.col_int_unique AND t1.col_int = t2.col_int
+WHERE t1.pk=1;
+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 const col_int_unique col_int_unique 5 const 1
+SELECT * FROM t1 LEFT JOIN t2
+ON t1.col_int_unique = t2.col_int_unique AND t1.col_int = t2.col_int
+WHERE t1.pk=1;
+pk col_int col_int_unique pk col_int col_int_unique
+1 NULL 2 NULL NULL NULL
+DROP TABLE t1,t2;
+#
+# Bug#48046 Server incorrectly processing JOINs on NULL values
+#
+CREATE TABLE `BB` (
+`pk` int(11) NOT NULL AUTO_INCREMENT,
+`time_key` time DEFAULT NULL,
+`varchar_key` varchar(1) DEFAULT NULL,
+`varchar_nokey` varchar(1) DEFAULT NULL,
+PRIMARY KEY (`pk`),
+KEY `time_key` (`time_key`),
+KEY `varchar_key` (`varchar_key`)
+) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
+INSERT INTO `BB` VALUES (10,'18:27:58',NULL,NULL);
+SELECT table1.time_key AS field1, table2.pk
+FROM BB table1 LEFT JOIN BB table2
+ON table2.varchar_nokey = table1.varchar_key
+HAVING field1;
+field1 pk
+18:27:58 NULL
+DROP TABLE BB;
+#
+# Bug#49600 Server incorrectly processing RIGHT JOIN with
+# constant WHERE clause and no index
+#
+CREATE TABLE `BB` (
+`col_datetime_key` datetime DEFAULT NULL,
+`col_varchar_key` varchar(1) DEFAULT NULL,
+`col_varchar_nokey` varchar(1) DEFAULT NULL,
+KEY `col_datetime_key` (`col_datetime_key`),
+KEY `col_varchar_key` (`col_varchar_key`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO `BB` VALUES ('1900-01-01 00:00:00',NULL,NULL);
+SELECT table1.col_datetime_key
+FROM BB table1 RIGHT JOIN BB table2
+ON table2 .col_varchar_nokey = table1.col_varchar_key
+WHERE 7;
+col_datetime_key
+NULL
+ALTER TABLE BB DISABLE KEYS;
+SELECT table1.col_datetime_key
+FROM BB table1 RIGHT JOIN BB table2
+ON table2 .col_varchar_nokey = table1.col_varchar_key
+WHERE 7;
+col_datetime_key
+NULL
+DROP TABLE BB;
+#
+# Bug#58490: Incorrect result in multi level OUTER JOIN
+# in combination with IS NULL
+#
+CREATE TABLE t1 (i INT NOT NULL);
+INSERT INTO t1 VALUES (0), (2),(3),(4);
+CREATE TABLE t2 (i INT NOT NULL);
+INSERT INTO t2 VALUES (0),(1), (3),(4);
+CREATE TABLE t3 (i INT NOT NULL);
+INSERT INTO t3 VALUES (0),(1),(2), (4);
+CREATE TABLE t4 (i INT NOT NULL);
+INSERT INTO t4 VALUES (0),(1),(2),(3) ;
+SELECT * FROM
+t1 LEFT JOIN
+( t2 LEFT JOIN
+( t3 LEFT JOIN
+t4
+ON t4.i = t3.i
+)
+ON t3.i = t2.i
+)
+ON t2.i = t1.i
+;
+i i i i
+0 0 0 0
+2 NULL NULL NULL
+3 3 NULL NULL
+4 4 4 NULL
+SELECT * FROM
+t1 LEFT JOIN
+( t2 LEFT JOIN
+( t3 LEFT JOIN
+t4
+ON t4.i = t3.i
+)
+ON t3.i = t2.i
+)
+ON t2.i = t1.i
+WHERE t4.i IS NULL;
+i i i i
+2 NULL NULL NULL
+3 3 NULL NULL
+4 4 4 NULL
+SELECT * FROM
+t1 LEFT JOIN
+( ( t2 LEFT JOIN
+t3
+ON t3.i = t2.i
+)
+)
+ON t2.i = t1.i
+WHERE t3.i IS NULL;
+i i i
+2 NULL NULL
+3 3 NULL
+SELECT * FROM
+t1 LEFT JOIN
+( ( t2 LEFT JOIN
+t3
+ON t3.i = t2.i
+)
+JOIN t4
+ON t4.i=t2.i
+)
+ON t2.i = t1.i
+WHERE t3.i IS NULL;
+i i i i
+2 NULL NULL NULL
+3 3 NULL 3
+4 NULL NULL NULL
+SELECT * FROM
+t1 LEFT JOIN
+( ( t2 LEFT JOIN
+t3
+ON t3.i = t2.i
+)
+JOIN (t4 AS t4a JOIN t4 AS t4b ON t4a.i=t4b.i)
+ON t4a.i=t2.i
+)
+ON t2.i = t1.i
+WHERE t3.i IS NULL;
+i i i i i
+2 NULL NULL NULL NULL
+3 3 NULL 3 3
+4 NULL NULL NULL NULL
+SELECT * FROM
+t1 LEFT JOIN
+( ( t2 LEFT JOIN
+t3
+ON t3.i = t2.i
+)
+JOIN (t4 AS t4a, t4 AS t4b)
+ON t4a.i=t2.i
+)
+ON t2.i = t1.i
+WHERE t3.i IS NULL;
+i i i i i
+2 NULL NULL NULL NULL
+3 3 NULL 3 0
+3 3 NULL 3 1
+3 3 NULL 3 2
+3 3 NULL 3 3
+4 NULL NULL NULL NULL
+DROP TABLE t1,t2,t3,t4;
+#
+# Bug#49322(Duplicate): Server is adding extra NULL row
+# on processing a WHERE clause
+#
+CREATE TABLE h (pk INT NOT NULL, col_int_key INT);
+INSERT INTO h VALUES (1,NULL),(4,2),(5,2),(3,4),(2,8);
+CREATE TABLE m (pk INT NOT NULL, col_int_key INT);
+INSERT INTO m VALUES (1,2),(2,7),(3,5),(4,7),(5,5),(6,NULL),(7,NULL),(8,9);
+CREATE TABLE k (pk INT NOT NULL, col_int_key INT);
+INSERT INTO k VALUES (1,9),(2,2),(3,5),(4,2),(5,7),(6,0),(7,5);
+SELECT TABLE1.pk FROM k TABLE1
+RIGHT JOIN h TABLE2 ON TABLE1.col_int_key=TABLE2.col_int_key
+RIGHT JOIN m TABLE4 ON TABLE2.col_int_key=TABLE4.col_int_key;
+pk
+2
+4
+2
+4
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+SELECT TABLE1.pk FROM k TABLE1
+RIGHT JOIN h TABLE2 ON TABLE1.col_int_key=TABLE2.col_int_key
+RIGHT JOIN m TABLE4 ON TABLE2.col_int_key=TABLE4.col_int_key
+WHERE TABLE1.pk IS NULL;
+pk
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+NULL
+DROP TABLE h,m,k;
# Bug#49600: outer join of two single-row tables with joining attributes
# evaluated to nulls
create table t1 (a int, b int);
diff --git a/mysql-test/r/join_outer_innodb.result b/mysql-test/r/join_outer_innodb.result
index 56e557ec881..e27139e83e7 100644
--- a/mysql-test/r/join_outer_innodb.result
+++ b/mysql-test/r/join_outer_innodb.result
@@ -17,3 +17,38 @@ 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;
+#
+# BUG#58456: Assertion 0 in QUICK_INDEX_MERGE_SELECT::need_sorted_output
+# in opt_range.h
+#
+CREATE TABLE t1 (
+col_int INT,
+col_int_key INT,
+pk INT NOT NULL,
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL,1,1), (6,2,2), (5,3,3), (NULL,4,4);
+INSERT INTO t1 VALUES (1,NULL,6), (8,5,7), (NULL,8,8), (8,NULL,5);
+CREATE TABLE t2 (
+pk INT PRIMARY KEY
+) ENGINE=InnoDB;
+
+EXPLAIN SELECT t1.pk
+FROM t2 LEFT JOIN t1 ON t2.pk = t1.col_int
+WHERE t1.col_int_key BETWEEN 5 AND 6
+AND t1.pk IS NULL OR t1.pk IN (5)
+ORDER BY pk;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY,col_int_key PRIMARY 4 const 2 Using where
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.col_int 1 Using index
+
+SELECT t1.pk
+FROM t2 LEFT JOIN t1 ON t2.pk = t1.col_int
+WHERE t1.col_int_key BETWEEN 5 AND 6
+AND t1.pk IS NULL OR t1.pk IN (5)
+ORDER BY pk;
+pk
+
+DROP TABLE t1,t2;
+# End BUG#58456
diff --git a/mysql-test/r/keywords.result b/mysql-test/r/keywords.result
index 5f338ad6a62..58cb7430563 100644
--- a/mysql-test/r/keywords.result
+++ b/mysql-test/r/keywords.result
@@ -45,3 +45,227 @@ p1
max=1
drop procedure p1;
drop table t1;
+CREATE TABLE slow (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
+INSERT INTO slow(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
+INSERT INTO slow(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
+INSERT INTO slow(slow, general) VALUES (1,2), (5,6);
+INSERT INTO slow(slow) VALUES (1), (5);
+SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM slow ORDER BY slow;
+slow general master_heartbeat_period ignore_server_ids
+1 2 3 4
+1 2 3 NULL
+1 2 NULL NULL
+1 NULL NULL NULL
+5 6 7 8
+5 6 7 NULL
+5 6 NULL NULL
+5 NULL NULL NULL
+SELECT slow, general, master_heartbeat_period FROM slow ORDER BY slow;
+slow general master_heartbeat_period
+1 2 3
+1 2 3
+1 2 NULL
+1 NULL NULL
+5 6 7
+5 6 7
+5 6 NULL
+5 NULL NULL
+SELECT slow, master_heartbeat_period FROM slow ORDER BY slow;
+slow master_heartbeat_period
+1 3
+1 3
+1 NULL
+1 NULL
+5 7
+5 7
+5 NULL
+5 NULL
+SELECT slow FROM slow ORDER BY slow;
+slow
+1
+1
+1
+1
+5
+5
+5
+5
+DROP TABLE slow;
+CREATE TABLE general (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
+INSERT INTO general(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
+INSERT INTO general(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
+INSERT INTO general(slow, general) VALUES (1,2), (5,6);
+INSERT INTO general(slow) VALUES (1), (5);
+SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM general ORDER BY slow;
+slow general master_heartbeat_period ignore_server_ids
+1 2 3 4
+1 2 3 NULL
+1 2 NULL NULL
+1 NULL NULL NULL
+5 6 7 8
+5 6 7 NULL
+5 6 NULL NULL
+5 NULL NULL NULL
+SELECT slow, general, master_heartbeat_period FROM general ORDER BY slow;
+slow general master_heartbeat_period
+1 2 3
+1 2 3
+1 2 NULL
+1 NULL NULL
+5 6 7
+5 6 7
+5 6 NULL
+5 NULL NULL
+SELECT slow, master_heartbeat_period FROM general ORDER BY slow;
+slow master_heartbeat_period
+1 3
+1 3
+1 NULL
+1 NULL
+5 7
+5 7
+5 NULL
+5 NULL
+SELECT slow FROM general ORDER BY slow;
+slow
+1
+1
+1
+1
+5
+5
+5
+5
+DROP TABLE general;
+CREATE TABLE master_heartbeat_period (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
+INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
+INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
+INSERT INTO master_heartbeat_period(slow, general) VALUES (1,2), (5,6);
+INSERT INTO master_heartbeat_period(slow) VALUES (1), (5);
+SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM master_heartbeat_period ORDER BY slow;
+slow general master_heartbeat_period ignore_server_ids
+1 2 3 4
+1 2 3 NULL
+1 2 NULL NULL
+1 NULL NULL NULL
+5 6 7 8
+5 6 7 NULL
+5 6 NULL NULL
+5 NULL NULL NULL
+SELECT slow, general, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow;
+slow general master_heartbeat_period
+1 2 3
+1 2 3
+1 2 NULL
+1 NULL NULL
+5 6 7
+5 6 7
+5 6 NULL
+5 NULL NULL
+SELECT slow, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow;
+slow master_heartbeat_period
+1 3
+1 3
+1 NULL
+1 NULL
+5 7
+5 7
+5 NULL
+5 NULL
+SELECT slow FROM master_heartbeat_period ORDER BY slow;
+slow
+1
+1
+1
+1
+5
+5
+5
+5
+DROP TABLE master_heartbeat_period;
+CREATE TABLE ignore_server_ids (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
+INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
+INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
+INSERT INTO ignore_server_ids(slow, general) VALUES (1,2), (5,6);
+INSERT INTO ignore_server_ids(slow) VALUES (1), (5);
+SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM ignore_server_ids ORDER BY slow;
+slow general master_heartbeat_period ignore_server_ids
+1 2 3 4
+1 2 3 NULL
+1 2 NULL NULL
+1 NULL NULL NULL
+5 6 7 8
+5 6 7 NULL
+5 6 NULL NULL
+5 NULL NULL NULL
+SELECT slow, general, master_heartbeat_period FROM ignore_server_ids ORDER BY slow;
+slow general master_heartbeat_period
+1 2 3
+1 2 3
+1 2 NULL
+1 NULL NULL
+5 6 7
+5 6 7
+5 6 NULL
+5 NULL NULL
+SELECT slow, master_heartbeat_period FROM ignore_server_ids ORDER BY slow;
+slow master_heartbeat_period
+1 3
+1 3
+1 NULL
+1 NULL
+5 7
+5 7
+5 NULL
+5 NULL
+SELECT slow FROM ignore_server_ids ORDER BY slow;
+slow
+1
+1
+1
+1
+5
+5
+5
+5
+DROP TABLE ignore_server_ids;
+CREATE TABLE t1 (slow INT, general INT, ignore_server_ids INT, master_heartbeat_period INT);
+INSERT INTO t1 VALUES (1,2,3,4);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE slow INT;
+DECLARE general INT;
+DECLARE ignore_server_ids INT;
+DECLARE master_heartbeat_period INT;
+SELECT max(t1.slow) INTO slow FROM t1;
+SELECT max(t1.general) INTO general FROM t1;
+SELECT max(t1.ignore_server_ids) INTO ignore_server_ids FROM t1;
+SELECT max(t1.master_heartbeat_period) INTO master_heartbeat_period FROM t1;
+SELECT slow, general, ignore_server_ids, master_heartbeat_period;
+END|
+CREATE PROCEDURE p2()
+BEGIN
+DECLARE n INT DEFAULT 2;
+general: WHILE n > 0 DO
+SET n = n -1;
+END WHILE general;
+SET n = 2;
+slow: WHILE n > 0 DO
+SET n = n -1;
+END WHILE slow;
+SET n = 2;
+ignore_server_ids: WHILE n > 0 DO
+SET n = n -1;
+END WHILE ignore_server_ids;
+SET n = 2;
+master_heartbeat_period: WHILE n > 0 DO
+SET n = n -1;
+END WHILE master_heartbeat_period;
+END|
+CALL p1();
+slow general ignore_server_ids master_heartbeat_period
+1 2 3 4
+call p2();
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TABLE t1;
diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result
index 1f4f4bb32eb..964f2947f6a 100644
--- a/mysql-test/r/kill.result
+++ b/mysql-test/r/kill.result
@@ -1,143 +1,178 @@
-set @old_concurrent_insert= @@global.concurrent_insert;
-set @@global.concurrent_insert= 0;
-drop table if exists t1, t2, t3;
-create table t1 (kill_id int);
-insert into t1 values(connection_id());
-select ((@id := kill_id) - kill_id) from t1;
-((@id := kill_id) - kill_id)
-0
-kill @id;
-select ((@id := kill_id) - kill_id) from t1;
-((@id := kill_id) - kill_id)
-0
-select @id != connection_id();
-@id != connection_id()
+SET DEBUG_SYNC = 'RESET';
+DROP TABLE IF EXISTS t1, t2, t3;
+DROP FUNCTION IF EXISTS MY_KILL;
+CREATE FUNCTION MY_KILL(tid INT) RETURNS INT
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+KILL tid;
+RETURN (SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = tid);
+END|
+SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
+SET DEBUG_SYNC= 'before_do_command_net_read SIGNAL con1_read';
+SET DEBUG_SYNC='now WAIT_FOR con1_read';
+SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
+SET DEBUG_SYNC = 'RESET';
+SELECT 1;
+Got one of the listed errors
+SELECT 1;
+1
1
-select 4;
+SELECT @id != CONNECTION_ID();
+@id != CONNECTION_ID()
+1
+SELECT 4;
4
4
-drop table t1;
-kill (select count(*) from mysql.user);
+KILL (SELECT COUNT(*) FROM mysql.user);
ERROR 42000: This version of MySQL doesn't yet support 'Usage of subqueries or stored function calls as part of this statement'
-create table t1 (id int primary key);
-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 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
-kill @id;
+SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
+SET DEBUG_SYNC= 'before_do_command_net_read SIGNAL con1_read WAIT_FOR kill';
+SET DEBUG_SYNC= 'now WAIT_FOR con1_read';
+SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
+SET DEBUG_SYNC = 'RESET';
+SELECT 1;
Got one of the listed errors
-drop table t1, t2, t3;
-select get_lock("a", 10);
-get_lock("a", 10)
-1
-select get_lock("a", 10);
-get_lock("a", 10)
-NULL
-select 1;
-1
-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;
+SELECT 1;
+1
+1
+SELECT @id != CONNECTION_ID();
+@id != CONNECTION_ID()
+1
+SELECT 4;
+4
+4
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT);
+CREATE TABLE t2 (id INT UNSIGNED NOT NULL);
+INSERT INTO t1 VALUES
+(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0),
+(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0),
+(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0),
+(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0);
+INSERT t1 SELECT 0 FROM t1 AS a1, t1 AS a2 LIMIT 4032;
+INSERT INTO t2 SELECT id FROM t1;
+SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
+SET DEBUG_SYNC= 'before_acos_function SIGNAL in_sync';
+SELECT id FROM t1 WHERE id IN
+(SELECT DISTINCT a.id FROM t2 a, t2 b, t2 c, t2 d
+GROUP BY ACOS(1/a.id), b.id, c.id, d.id
+HAVING a.id BETWEEN 10 AND 20);
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL @id;
+SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
+Got one of the listed errors
+SELECT 1;
+1
+1
+SET DEBUG_SYNC = 'RESET';
+DROP TABLE t1, t2;
+SET DEBUG_SYNC= 'before_acos_function SIGNAL in_sync WAIT_FOR kill';
+SELECT ACOS(0);
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
+ACOS(0)
+1.5707963267948966
+SELECT 1;
+1
+1
+SELECT @id = CONNECTION_ID();
+@id = CONNECTION_ID()
+1
+SET DEBUG_SYNC = 'RESET';
+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 DEBUG_SYNC= 'now SIGNAL in_sync WAIT_FOR kill';
+RETURN 1;
+END|
+INSERT INTO t1 VALUES (bug27563());
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
+ERROR 70100: Query execution was interrupted
+SELECT * FROM t1;
f1
-insert into t1 values(0);
-update t1 set f1= bug27563();
+SET DEBUG_SYNC = 'RESET';
+INSERT INTO t1 VALUES(0);
+UPDATE t1 SET f1= bug27563();
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
ERROR 70100: Query execution was interrupted
-select @a;
-@a
-NULL
-select * from t1;
+SELECT * FROM t1;
f1
0
-insert into t1 values(1);
-delete from t1 where bug27563() is null;
+SET DEBUG_SYNC = 'RESET';
+INSERT INTO t1 VALUES(1);
+DELETE FROM t1 WHERE bug27563() IS NULL;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
ERROR 70100: Query execution was interrupted
-select @a;
-@a
-NULL
-select * from t1;
+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;
+SET DEBUG_SYNC = 'RESET';
+SELECT * FROM t1 WHERE f1= bug27563();
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
+ERROR 70100: Query execution was interrupted
+SELECT * FROM t1;
f1
0
1
-select * from t2;
-f2
-select release_lock("lock27563");
-release_lock("lock27563")
+SET DEBUG_SYNC = 'RESET';
+DROP FUNCTION bug27563;
+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';
+INSERT INTO t2 VALUES(0);
+SET DEBUG_SYNC= 'now SIGNAL in_sync WAIT_FOR kill';
+INSERT INTO t2 VALUES(1);
+END|
+INSERT INTO t1 VALUES(2),(3);
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
+ERROR 70100: Query execution was interrupted
+SELECT * FROM t1;
+f1
+0
1
-drop table t1, t2;
-drop function bug27563;
-drop procedure proc27563;
+SELECT * FROM t2;
+f2
+0
+SET DEBUG_SYNC = 'RESET';
+DROP TABLE t1, t2;
+SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync';
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;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
+ERROR 70100: Query execution was interrupted
+SET DEBUG_SYNC = 'RESET';
#
# Bug#19723: kill of active connection yields different error code
# depending on platform.
#
-# Connection: con2.
-KILL CONNECTION_ID();
-# CR_SERVER_LOST, CR_SERVER_GONE_ERROR, depending on the timing
-# of close of the connection socket
+# Connection: con1.
+SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
+KILL @id;
+ERROR 70100: Query execution was interrupted
+SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
+# ER_SERVER_SHUTDOWN, CR_SERVER_GONE_ERROR, CR_SERVER_LOST,
+# depending on the timing of close of the connection socket
SELECT 1;
Got one of the listed errors
+SELECT 1;
+1
+1
+SELECT @id != CONNECTION_ID();
+@id != CONNECTION_ID()
+1
+SET DEBUG_SYNC = 'RESET';
#
# Additional test for WL#3726 "DDL locking for all metadata objects"
# Check that DDL and DML statements waiting for metadata locks can
@@ -208,13 +243,11 @@ ERROR 70100: Query execution was interrupted
# Test for DML waiting for meta-data lock
# Switching to connection 'blocker'
unlock tables;
-drop table t2;
-create table t2 (k int);
lock tables t1 read;
# Switching to connection 'ddl'
-rename tables t1 to t3, t2 to t1;
+truncate table t1;
# Switching to connection 'dml'
-insert into t2 values (1);
+insert into t1 values (1);
# Switching to connection 'default'
kill query ID2;
# Switching to connection 'dml'
@@ -239,6 +272,7 @@ unlock tables;
# Switching to connection 'ddl'
# Cleanup.
# Switching to connection 'default'
-drop table t3;
drop table t1;
-set @@global.concurrent_insert= @old_concurrent_insert;
+drop table t2;
+SET DEBUG_SYNC = 'RESET';
+DROP FUNCTION MY_KILL;
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 1c59f41cfc0..c4c8216c14a 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -532,4 +532,20 @@ a
0
1
DROP TABLE t1;
+#
+# Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
+#
+CREATE TABLE t1(f1 INT);
+SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
+LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
+DROP TABLE t1;
+#
+# Bug#11765141 - 58072: LOAD DATA INFILE: LEAKS IO CACHE MEMORY
+# WHEN ERROR OCCURS
+#
+SELECT '1\n' INTO DUMPFILE 'MYSQLTEST_VARDIR/tmp/bug11735141.txt';
+create table t1(a point);
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug11735141.txt' INTO TABLE t1;
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
End of 5.1 tests
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index 99e1f54e762..1a8ef2deefd 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -430,6 +430,8 @@ SELECT table_name, table_comment FROM information_schema.tables
WHERE table_schema= 'test' AND table_name= 't1';
table_name table_comment
t1 Lock wait timeout exceeded; try restarting transaction
+Warnings:
+Warning 1205 Lock wait timeout exceeded; try restarting transaction
# Connection default
UNLOCK TABLES;
# Connection con3
diff --git a/mysql-test/r/lock_sync.result b/mysql-test/r/lock_sync.result
index 3682f0df26a..8fe94679e70 100644
--- a/mysql-test/r/lock_sync.result
+++ b/mysql-test/r/lock_sync.result
@@ -704,3 +704,72 @@ SET DEBUG_SYNC="now SIGNAL query";
# Connection default
DROP EVENT e2;
SET DEBUG_SYNC="RESET";
+#
+# Bug#55930 Assertion `thd->transaction.stmt.is_empty() ||
+# thd->in_sub_stmt || (thd->state..
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a INT) engine=InnoDB;
+INSERT INTO t1 VALUES (1), (2);
+# Connection con1
+SET SESSION lock_wait_timeout= 1;
+SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL opti_recreate WAIT_FOR opti_analyze';
+# Sending:
+OPTIMIZE TABLE t1;
+# Connection con2
+SET DEBUG_SYNC= 'now WAIT_FOR opti_recreate';
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL thrlock WAIT_FOR release_thrlock';
+# Sending:
+INSERT INTO t1 VALUES (3);
+# Connection default
+SET DEBUG_SYNC= 'now WAIT_FOR thrlock';
+SET DEBUG_SYNC= 'now SIGNAL opti_analyze';
+# Connection con1
+# Reaping: OPTIMIZE TABLE t1
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+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
+SET DEBUG_SYNC= 'now SIGNAL release_thrlock';
+# Connection con2
+# Reaping: INSERT INTO t1 VALUES (3)
+# Connection default
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+#
+# Bug#57130 crash in Item_field::print during SHOW CREATE TABLE or VIEW
+#
+DROP TABLE IF EXISTS t1;
+DROP VIEW IF EXISTS v1;
+DROP FUNCTION IF EXISTS f1;
+CREATE TABLE t1(a INT);
+CREATE FUNCTION f1() RETURNS INTEGER RETURN 1;
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE f1() = 1;
+DROP FUNCTION f1;
+# Connection con1
+SET DEBUG_SYNC= 'open_tables_after_open_and_process_table SIGNAL opened WAIT_FOR dropped EXECUTE 2';
+# Sending:
+SHOW CREATE VIEW v1;
+# Connection con2
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+SET DEBUG_SYNC= 'now SIGNAL dropped';
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+# Sending:
+FLUSH TABLES;
+# Connection default
+# Waiting for FLUSH TABLES to be blocked.
+SET DEBUG_SYNC= 'now SIGNAL dropped';
+# Connection con1
+# Reaping: 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 `t1`.`a` AS `a` from `t1` where (`f1`() = 1) latin1 latin1_swedish_ci
+Warnings:
+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
+# Connection con2
+# Reaping: FLUSH TABLES
+# Connection default
+SET DEBUG_SYNC= 'RESET';
+DROP VIEW v1;
+DROP TABLE t1;
diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result
index 1666d5e0297..f64894c9f10 100644
--- a/mysql-test/r/log_tables.result
+++ b/mysql-test/r/log_tables.result
@@ -896,6 +896,16 @@ TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - KEY', f1,f2,f3,SLEEP(1.1) FROM t1
TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - PK', f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f1=2
DROP TABLE t1;
TRUNCATE TABLE mysql.slow_log;
+use mysql;
+drop table if exists renamed_general_log;
+drop table if exists renamed_slow_log;
+RENAME TABLE general_log TO renamed_general_log;
+ERROR HY000: Cannot rename 'general_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'general_log'
+RENAME TABLE slow_log TO renamed_slow_log;
+ERROR HY000: Cannot rename 'slow_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'slow_log'
+use test;
+flush tables with read lock;
+unlock tables;
SET @@session.long_query_time= @old_long_query_time;
SET @@global.log_output= @old_log_output;
SET @@global.slow_query_log= @old_slow_query_log;
diff --git a/mysql-test/r/log_tables_upgrade.result b/mysql-test/r/log_tables_upgrade.result
index 850bdf5c2bd..5ed59eecc31 100644
--- a/mysql-test/r/log_tables_upgrade.result
+++ b/mysql-test/r/log_tables_upgrade.result
@@ -32,6 +32,7 @@ mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
+mysql.proxies_priv OK
mysql.renamed_general_log OK
mysql.servers OK
mysql.tables_priv OK
diff --git a/mysql-test/r/lowercase_fs_off.result b/mysql-test/r/lowercase_fs_off.result
index 30f835a8ea3..c3284b225dd 100644
--- a/mysql-test/r/lowercase_fs_off.result
+++ b/mysql-test/r/lowercase_fs_off.result
@@ -55,3 +55,11 @@ DROP USER user_1@localhost;
DROP USER USER_1@localhost;
DROP DATABASE db1;
use test;
+#
+# Extra test coverage for Bug#56595 RENAME TABLE causes assert on OS X
+#
+CREATE TABLE t1(a INT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a= 1;
+RENAME TABLE t1 TO T1;
+ALTER TABLE T1 RENAME t1;
+DROP TABLE t1;
diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result
index caee7a7662b..abd16641b56 100644
--- a/mysql-test/r/lowercase_table2.result
+++ b/mysql-test/r/lowercase_table2.result
@@ -175,6 +175,35 @@ TABLE_SCHEMA TABLE_NAME
mysqltest_lc2 myUC
use test;
drop database mysqltest_LC2;
+#
+# Bug #11758687: 50924: object names not resolved correctly
+# on lctn2 systems
+#
+CREATE DATABASE BUP_XPFM_COMPAT_DB2;
+CREATE TABLE BUP_XPFM_COMPAT_DB2.TABLE2 (c13 INT) DEFAULT CHARSET latin1;
+CREATE TABLE BUP_XPFM_COMPAT_DB2.table1 (c13 INT) DEFAULT CHARSET latin1;
+CREATE TABLE bup_xpfm_compat_db2.table3 (c13 INT) DEFAULT CHARSET latin1;
+CREATE TRIGGER BUP_XPFM_COMPAT_DB2.trigger1 AFTER INSERT
+ON BUP_XPFM_COMPAT_DB2.table1 FOR EACH ROW
+update BUP_XPFM_COMPAT_DB2.table1 set c13=12;
+|
+CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TRIGGER2 AFTER INSERT
+ON BUP_XPFM_COMPAT_DB2.TABLE2 FOR EACH ROW
+update BUP_XPFM_COMPAT_DB2.table1 set c13=12;
+|
+CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TrigGer3 AFTER INSERT
+ON BUP_XPFM_COMPAT_DB2.TaBle3 FOR EACH ROW
+update BUP_XPFM_COMPAT_DB2.table1 set c13=12;
+|
+SELECT trigger_schema, trigger_name, event_object_table FROM
+INFORMATION_SCHEMA.TRIGGERS
+WHERE trigger_schema COLLATE utf8_bin = 'BUP_XPFM_COMPAT_DB2'
+ ORDER BY trigger_schema, trigger_name;
+trigger_schema trigger_name event_object_table
+BUP_XPFM_COMPAT_DB2 trigger1 table1
+BUP_XPFM_COMPAT_DB2 TRIGGER2 TABLE2
+BUP_XPFM_COMPAT_DB2 TrigGer3 table3
+DROP DATABASE BUP_XPFM_COMPAT_DB2;
# End of 5.1 tests
#
# Test for bug #44738 "fill_schema_table_from_frm() opens tables without
diff --git a/mysql-test/r/lowercase_table4.result b/mysql-test/r/lowercase_table4.result
new file mode 100755
index 00000000000..f896b9008e3
--- /dev/null
+++ b/mysql-test/r/lowercase_table4.result
@@ -0,0 +1,115 @@
+#
+# Bug#46941 crash with lower_case_table_names=2 and
+# foreign data dictionary confusion
+#
+CREATE DATABASE XY;
+USE XY;
+DROP DATABASE XY;
+USE TEST;
+#
+# Bug55222 Mysqldump table names case bug in REFERENCES clause
+# InnoDB did not handle lower_case_table_names=2 for
+# foreign_table_names and referenced_table_names.
+#
+SHOW VARIABLES LIKE 'lower_case_table_names';
+Variable_name Value
+lower_case_table_names 2
+DROP TABLE IF EXISTS `Table2`;
+DROP TABLE IF EXISTS `Table1`;
+CREATE TABLE `Table1`(c1 INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE `Table2`(c1 INT PRIMARY KEY, c2 INT) ENGINE=InnoDB;
+ALTER TABLE `Table2` ADD CONSTRAINT fk1 FOREIGN KEY(c2) REFERENCES `Table1`(c1);
+SHOW CREATE TABLE `Table2`;
+Table Table2
+Create Table CREATE TABLE `Table2` (
+ `c1` int(11) NOT NULL,
+ `c2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`c1`),
+ KEY `fk1` (`c2`),
+ CONSTRAINT `fk1` FOREIGN KEY (`c2`) REFERENCES `Table1` (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
+CONSTRAINT_CATALOG def
+CONSTRAINT_SCHEMA test
+CONSTRAINT_NAME fk1
+UNIQUE_CONSTRAINT_CATALOG def
+UNIQUE_CONSTRAINT_SCHEMA test
+UNIQUE_CONSTRAINT_NAME PRIMARY
+MATCH_OPTION NONE
+UPDATE_RULE RESTRICT
+DELETE_RULE RESTRICT
+TABLE_NAME Table2
+REFERENCED_TABLE_NAME Table1
+DROP TABLE `Table2`;
+DROP TABLE `Table1`;
+DROP TABLE IF EXISTS Product_Order;
+DROP TABLE IF EXISTS Product;
+DROP TABLE IF EXISTS Customer;
+CREATE TABLE Product (Category INT NOT NULL, Id INT NOT NULL,
+Price DECIMAL, PRIMARY KEY(Category, Id)) ENGINE=InnoDB;
+CREATE TABLE Customer (Id INT NOT NULL, PRIMARY KEY (Id)) ENGINE=InnoDB;
+CREATE TABLE Product_Order (No INT NOT NULL AUTO_INCREMENT,
+Product_Category INT NOT NULL,
+Product_Id INT NOT NULL,
+Customer_Id INT NOT NULL,
+PRIMARY KEY(No),
+INDEX (Product_Category, Product_Id),
+FOREIGN KEY (Product_Category, Product_Id)
+REFERENCES Product(Category, Id) ON UPDATE CASCADE ON DELETE RESTRICT,
+INDEX (Customer_Id),
+FOREIGN KEY (Customer_Id)
+REFERENCES Customer(Id)
+) ENGINE=INNODB;
+SHOW CREATE TABLE Product_Order;
+Table Product_Order
+Create Table CREATE TABLE `Product_Order` (
+ `No` int(11) NOT NULL AUTO_INCREMENT,
+ `Product_Category` int(11) NOT NULL,
+ `Product_Id` int(11) NOT NULL,
+ `Customer_Id` int(11) NOT NULL,
+ PRIMARY KEY (`No`),
+ KEY `Product_Category` (`Product_Category`,`Product_Id`),
+ KEY `Customer_Id` (`Customer_Id`),
+ CONSTRAINT `product_order_ibfk_1` FOREIGN KEY (`Product_Category`, `Product_Id`) REFERENCES `Product` (`Category`, `Id`) ON UPDATE CASCADE,
+ CONSTRAINT `product_order_ibfk_2` FOREIGN KEY (`Customer_Id`) REFERENCES `Customer` (`Id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE Product;
+Table Product
+Create Table CREATE TABLE `Product` (
+ `Category` int(11) NOT NULL,
+ `Id` int(11) NOT NULL,
+ `Price` decimal(10,0) DEFAULT NULL,
+ PRIMARY KEY (`Category`,`Id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW CREATE TABLE Customer;
+Table Customer
+Create Table CREATE TABLE `Customer` (
+ `Id` int(11) NOT NULL,
+ PRIMARY KEY (`Id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
+CONSTRAINT_CATALOG def
+CONSTRAINT_SCHEMA test
+CONSTRAINT_NAME product_order_ibfk_1
+UNIQUE_CONSTRAINT_CATALOG def
+UNIQUE_CONSTRAINT_SCHEMA test
+UNIQUE_CONSTRAINT_NAME PRIMARY
+MATCH_OPTION NONE
+UPDATE_RULE CASCADE
+DELETE_RULE RESTRICT
+TABLE_NAME Product_Order
+REFERENCED_TABLE_NAME Product
+CONSTRAINT_CATALOG def
+CONSTRAINT_SCHEMA test
+CONSTRAINT_NAME product_order_ibfk_2
+UNIQUE_CONSTRAINT_CATALOG def
+UNIQUE_CONSTRAINT_SCHEMA test
+UNIQUE_CONSTRAINT_NAME PRIMARY
+MATCH_OPTION NONE
+UPDATE_RULE RESTRICT
+DELETE_RULE RESTRICT
+TABLE_NAME Product_Order
+REFERENCED_TABLE_NAME Customer
+DROP TABLE Product_Order;
+DROP TABLE Product;
+DROP TABLE Customer;
diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result
index d484ab77701..b2e71faf741 100644
--- a/mysql-test/r/mdl_sync.result
+++ b/mysql-test/r/mdl_sync.result
@@ -2322,6 +2322,8 @@ select table_name, table_type, auto_increment, table_comment
from information_schema.tables where table_schema='test' and table_name='t2';
table_name table_type auto_increment table_comment
t2 BASE TABLE NULL Table 'test'.'t2' was skipped since its definition is being modified by concurrent DDL statement
+Warnings:
+Warning 1684 Table 'test'.'t2' was skipped since its definition is being modified by concurrent DDL statement
# Switching to connection 'default'.
unlock tables;
# Switching to connection 'con46044'.
@@ -2471,7 +2473,7 @@ CREATE PROCEDURE p1() SELECT 1;
SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
# Check that FLUSH must wait to get the GRL
# and let CREATE PROCEDURE continue
-SET DEBUG_SYNC= 'wait_lock_global_read_lock SIGNAL grlwait';
+SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait';
FLUSH TABLES WITH READ LOCK;
# Connection 1
# Connection 2
@@ -2486,10 +2488,17 @@ DROP PROCEDURE p1;
SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
# Check that FLUSH must wait to get the GRL
# and let DROP PROCEDURE continue
-SET DEBUG_SYNC= 'wait_lock_global_read_lock SIGNAL grlwait';
+SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait';
FLUSH TABLES WITH READ LOCK;
# Connection 1
+# Once FLUSH TABLES WITH READ LOCK starts waiting
+# DROP PROCEDURE will be waked up and will drop
+# procedure. Global read lock will be granted after
+# this statement ends.
+#
+# Reaping DROP PROCEDURE.
# Connection 2
+# Reaping FTWRL.
UNLOCK TABLES;
# Connection 1
SET DEBUG_SYNC= 'RESET';
@@ -2632,7 +2641,8 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2),(3);
# Connection: con1
-SET debug_sync='lock_table_for_truncate SIGNAL parked_truncate WAIT_FOR go_truncate';
+LOCK TABLES t1 WRITE;
+SET debug_sync='upgrade_lock_for_truncate SIGNAL parked_truncate WAIT_FOR go_truncate';
TRUNCATE TABLE t1;
# Connection: default
SET debug_sync='now WAIT_FOR parked_truncate';
@@ -2647,10 +2657,11 @@ FLUSH TABLES t1;
# Connection: default
SET debug_sync='now WAIT_FOR parked_flush';
SET debug_sync='now SIGNAL go_truncate';
-# Connection: con1
-# Reaping...
-# Connection: default
+# Ensure that truncate waits for a exclusive lock
SET debug_sync= 'now SIGNAL go_show';
+# Connection: con1 (TRUNCATE)
+# Reaping...
+UNLOCK TABLES;
# Connection: con2 (SHOW FIELDS FROM t1)
# Reaping...
Field Type Null Key Default Extra
@@ -2913,3 +2924,41 @@ UNLOCK TABLES;
# Connection default
UNLOCK TABLES;
DROP DATABASE db1;
+#
+# Bug#56292 Deadlock with ALTER TABLE and MERGE tables
+#
+DROP TABLE IF EXISTS t1, t2, m1;
+CREATE TABLE t1(a INT) engine=MyISAM;
+CREATE TABLE t2(a INT) engine=MyISAM;
+CREATE TABLE m1(a INT) engine=MERGE UNION=(t1, t2);
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (3), (4);
+# Connection con1
+SET DEBUG_SYNC= 'mdl_upgrade_shared_lock_to_exclusive SIGNAL upgrade WAIT_FOR continue';
+# Sending:
+ALTER TABLE m1 engine=MERGE UNION=(t2, t1);
+# Connection con2
+# Waiting for ALTER TABLE to try lock upgrade
+SET DEBUG_SYNC= 'now WAIT_FOR upgrade';
+# Sending:
+DELETE FROM t2 WHERE a = 3;
+# Connection default
+# Check that DELETE is waiting on a metadata lock and not a table lock.
+# Now that DELETE blocks on a metadata lock, we should be able to do
+# SELECT * FROM m1 here. SELECT used to be blocked by a DELETE table
+# lock request.
+SELECT * FROM m1;
+a
+1
+2
+3
+4
+# Resuming ALTER TABLE
+SET DEBUG_SYNC= 'now SIGNAL continue';
+# Connection con1
+# Reaping: ALTER TABLE m1 engine=MERGE UNION=(t2, t1)
+# Connection con2
+# Reaping: DELETE FROM t2 WHERE a = 3
+# Connection default
+DROP TABLE m1, t1, t2;
+SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index b6ebf5c8c9e..3219f81b125 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -2080,6 +2080,8 @@ SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE
TABLE_SCHEMA = 'test' and TABLE_NAME='tm1';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
def test tm1 BASE TABLE NULL NULL NULL # # # # # # # # # # NULL # # Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+Warnings:
+Warning 1168 Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP TABLE tm1;
CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t2(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
@@ -2354,6 +2356,48 @@ t2 WHERE b SOUNDS LIKE e AND d = 1;
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 t2, t1;
+#
+# Bug#46339 - crash on REPAIR TABLE merge table USE_FRM
+#
+DROP TABLE IF EXISTS m1, t1;
+CREATE TABLE t1 (c1 INT) ENGINE=MYISAM;
+CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1) INSERT_METHOD=LAST;
+LOCK TABLE m1 READ;
+REPAIR TABLE m1 USE_FRM;
+Table Op Msg_type Msg_text
+test.m1 repair Error Table 'm1' was locked with a READ lock and can't be updated
+test.m1 repair status Operation failed
+UNLOCK TABLES;
+REPAIR TABLE m1 USE_FRM;
+Table Op Msg_type Msg_text
+test.m1 repair note The storage engine for the table doesn't support repair
+DROP TABLE m1,t1;
+CREATE TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
+REPAIR TABLE m1 USE_FRM;
+Table Op Msg_type Msg_text
+test.m1 repair Warning Can't open table
+test.m1 repair error Corrupt
+CREATE TABLE t1 (f1 BIGINT) ENGINE = MyISAM;
+REPAIR TABLE m1 USE_FRM;
+Table Op Msg_type Msg_text
+test.m1 repair note The storage engine for the table doesn't support repair
+REPAIR TABLE m1;
+Table Op Msg_type Msg_text
+test.m1 repair note The storage engine for the table doesn't support repair
+DROP TABLE m1, t1;
+CREATE TEMPORARY TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
+REPAIR TABLE m1 USE_FRM;
+Table Op Msg_type Msg_text
+test.m1 repair Error Table 'test.m1' doesn't exist
+test.m1 repair error Corrupt
+CREATE TEMPORARY TABLE t1 (f1 BIGINT) ENGINE=MyISAM;
+REPAIR TABLE m1 USE_FRM;
+Table Op Msg_type Msg_text
+m1 repair error Cannot repair temporary table from .frm file
+REPAIR TABLE m1;
+Table Op Msg_type Msg_text
+test.m1 repair note The storage engine for the table doesn't support repair
+DROP TABLE m1, t1;
End of 5.1 tests
#
# An additional test case for Bug#27430 Crash in subquery code
@@ -2673,7 +2717,7 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize Error Table 'test.t_not_exists' doesn't exist
test.t1 optimize Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
-test.t1 optimize note The storage engine for the table doesn't support optimize
+test.t1 optimize error Corrupt
DROP TABLE t1;
#
# Bug#36171 - CREATE TEMPORARY TABLE and MERGE engine
@@ -3440,7 +3484,7 @@ ALTER TABLE m1 ADD INDEX (c1);
UNLOCK TABLES;
DROP TABLE m1, t1;
#
-# If children are to be altered, they need an explicit lock.
+# Locking the merge table won't implicitly lock children.
#
CREATE TABLE t1 (c1 INT);
CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1);
@@ -3572,4 +3616,60 @@ ERROR HY000: The definition of table 'v1' prevents operation DELETE on table 'm1
drop view v1;
drop temporary table tmp;
drop table t1, t2, t3, m1, m2;
+#
+# Bug#56494 Segfault in upgrade_shared_lock_to_exclusive() for
+# REPAIR of merge table
+#
+DROP TABLE IF EXISTS t1, t2, t_not_exists;
+CREATE TABLE t1(a INT);
+ALTER TABLE t1 engine= MERGE UNION (t_not_exists);
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze Error Table 'test.t_not_exists' doesn't exist
+test.t1 analyze Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+test.t1 analyze error Corrupt
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check Error Table 'test.t_not_exists' doesn't exist
+test.t1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+test.t1 check error Corrupt
+CHECKSUM TABLE t1;
+Table Checksum
+test.t1 NULL
+Warnings:
+Error 1146 Table 'test.t_not_exists' doesn't exist
+Error 1168 Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize Error Table 'test.t_not_exists' doesn't exist
+test.t1 optimize Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+test.t1 optimize error Corrupt
+REPAIR TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 repair Error Table 'test.t_not_exists' doesn't exist
+test.t1 repair Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+test.t1 repair error Corrupt
+REPAIR TABLE t1 USE_FRM;
+Table Op Msg_type Msg_text
+test.t1 repair Warning Can't open table
+test.t1 repair error Corrupt
+DROP TABLE t1;
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT) engine= MERGE UNION (t1);
+REPAIR TABLE t2 USE_FRM;
+Table Op Msg_type Msg_text
+test.t2 repair note The storage engine for the table doesn't support repair
+DROP TABLE t1, t2;
+#
+# Bug#57002 Assert in upgrade_shared_lock_to_exclusive()
+# for ALTER TABLE + MERGE tables
+#
+DROP TABLE IF EXISTS t1, m1;
+CREATE TABLE t1(a INT) engine=myisam;
+CREATE TABLE m1(a INT) engine=merge UNION(t1);
+LOCK TABLES t1 READ, m1 WRITE;
+ALTER TABLE t1 engine=myisam;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+UNLOCK TABLES;
+DROP TABLE m1, t1;
End of 6.0 tests
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result
index 480cec792c0..3418348854f 100644
--- a/mysql-test/r/metadata.result
+++ b/mysql-test/r/metadata.result
@@ -126,7 +126,7 @@ renamed
1
select * from v3 where renamed=1 group by renamed;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def v3 v3 renamed renamed 8 11 0 Y 32896 0 63
+def v3 v3 renamed renamed 8 12 0 Y 32896 0 63
renamed
drop table t1;
drop view v1,v2,v3;
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index 07a92e2abf0..c6ee170eef7 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -669,4 +669,68 @@ Error 1242 Subquery returns more than 1 row
Error 1242 Subquery returns more than 1 row
DROP TABLE t1, t2, t3;
SET SESSION sql_safe_updates = DEFAULT;
-end of tests
+#
+# Bug#52157 various crashes and assertions with multi-table update, stored function
+#
+CREATE FUNCTION f1 () RETURNS BLOB RETURN 1;
+CREATE TABLE t1 (f1 DATE);
+INSERT INTO t1 VALUES('2001-01-01');
+UPDATE (SELECT 1 FROM t1 WHERE f1 = (SELECT f1() FROM t1)) x, t1 SET f1 = 1;
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '1'
+DROP FUNCTION f1;
+DROP TABLE t1;
+#
+# BUG#57373: Multi update+InnoDB reports ER_KEY_NOT_FOUND if a
+# table is updated twice
+#
+CREATE TABLE t1(
+pk INT,
+a INT,
+PRIMARY KEY (pk)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (0,0);
+UPDATE t1 AS A, t1 AS B SET A.pk = 1, B.a = 2;
+
+# Should be (1,2)
+SELECT * FROM t1;
+pk a
+1 2
+DROP TABLE t1;
+#
+# BUG#11882110: UPDATE REPORTS ER_KEY_NOT_FOUND IF TABLE IS
+# UPDATED TWICE
+#
+CREATE TABLE t1 (
+col_int_key int,
+pk int,
+col_int int,
+key(col_int_key),
+primary key (pk)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,2,3);
+
+CREATE TABLE t2 (
+col_int_key int,
+pk_1 int,
+pk_2 int,
+col_int int,
+key(col_int_key),
+primary key (pk_1,pk_2)
+) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,2,3,4);
+
+UPDATE t1 AS A NATURAL JOIN t1 B SET A.pk=5,B.pk=7;
+
+SELECT * FROM t1;
+col_int_key pk col_int
+1 7 3
+
+UPDATE t2 AS A NATURAL JOIN t2 B SET A.pk_1=5,B.pk_1=7;
+
+UPDATE t2 AS A NATURAL JOIN t2 B SET A.pk_2=10,B.pk_2=11;
+
+SELECT * FROM t2;
+col_int_key pk_1 pk_2 col_int
+1 7 11 4
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/multi_update_innodb.result b/mysql-test/r/multi_update_innodb.result
new file mode 100644
index 00000000000..643287c3a93
--- /dev/null
+++ b/mysql-test/r/multi_update_innodb.result
@@ -0,0 +1,69 @@
+#
+# BUG#57373: Multi update+InnoDB reports ER_KEY_NOT_FOUND if a
+# table is updated twice
+#
+CREATE TABLE t1(
+pk INT,
+a INT,
+b INT,
+PRIMARY KEY (pk)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (0,0,0);
+UPDATE t1 AS A, t1 AS B SET A.pk = 1, B.a = 2;
+ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'.
+SELECT * FROM t1;
+pk a b
+0 0 0
+CREATE VIEW v1 AS SELECT * FROM t1;
+UPDATE v1 AS A, t1 AS B SET A.pk = 1, B.a = 2;
+ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'.
+SELECT * FROM t1;
+pk a b
+0 0 0
+UPDATE t1 AS A, t1 AS B SET A.a = 1, B.b = 2;
+# Should be (0,1,2)
+SELECT * FROM t1;
+pk a b
+0 1 2
+DROP VIEW v1;
+DROP TABLE t1;
+#
+# BUG#11882110: UPDATE REPORTS ER_KEY_NOT_FOUND IF TABLE IS
+# UPDATED TWICE
+#
+CREATE TABLE t1 (
+col_int_key int,
+pk int,
+col_int int,
+key(col_int_key),
+primary key (pk)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,2,3);
+
+CREATE TABLE t2 (
+col_int_key int,
+pk_1 int,
+pk_2 int,
+col_int int,
+key(col_int_key),
+primary key (pk_1,pk_2)
+) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1,2,3,4);
+
+UPDATE t1 AS A NATURAL JOIN t1 B SET A.pk=5,B.pk=7;
+ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'.
+
+SELECT * FROM t1;
+col_int_key pk col_int
+1 2 3
+
+UPDATE t2 AS A NATURAL JOIN t2 B SET A.pk_1=5,B.pk_1=7;
+ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'.
+
+UPDATE t2 AS A NATURAL JOIN t2 B SET A.pk_2=10,B.pk_2=11;
+ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'.
+
+SELECT * FROM t2;
+col_int_key pk_1 pk_2 col_int
+1 2 3 4
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/myisampack.result b/mysql-test/r/myisampack.result
index dd14c31f32e..91700701139 100644
--- a/mysql-test/r/myisampack.result
+++ b/mysql-test/r/myisampack.result
@@ -46,14 +46,12 @@ insert into t1 select * from t1;
flush tables;
optimize table t1;
Table Op Msg_type Msg_text
-test.t1 optimize error Table 'test.t1' is read only
-Warnings:
-Error 1036 Table 't1' is read only
+test.t1 optimize Error Table 't1' is read only
+test.t1 optimize status Operation failed
repair table t1;
Table Op Msg_type Msg_text
-test.t1 repair error Table 'test.t1' is read only
-Warnings:
-Error 1036 Table 't1' is read only
+test.t1 repair Error Table 't1' is read only
+test.t1 repair status Operation failed
drop table t1;
#
# BUG#41541 - Valgrind warnings on packed MyISAM table
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index 3c53faff526..9923ba03b3d 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -433,4 +433,73 @@ Bug #47147: mysql client option --skip-column-names does not apply to vertical o
*************************** 1. row ***************************
1
+#
+# Bug #54899: --one-database option cannot handle DROP/CREATE DATABASE
+# commands.
+#
+CREATE DATABASE connected_db;
+USE connected_db;
+SHOW TABLES;
+Tables_in_connected_db
+table_in_connected_db
+DROP DATABASE connected_db;
+
+#
+# Testing --one-database option
+#
+CREATE DATABASE connected_db;
+SHOW TABLES IN connected_db;
+Tables_in_connected_db
+t1
+SHOW TABLES IN test;
+Tables_in_test
+t1
+USE test;
+DROP TABLE t1;
+DROP DATABASE connected_db;
+
+SHOW TABLES IN test;
+Tables_in_test
+SHOW TABLES IN test1;
+Tables_in_test1
+DROP DATABASE test1;
+
+#
+# Checking --one-database option followed by the execution of
+# connect command.
+#
+CREATE DATABASE connected_db;
+SHOW TABLES IN connected_db;
+Tables_in_connected_db
+t1
+t2
+SHOW TABLES IN test;
+Tables_in_test
+t1
+t2
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP DATABASE connected_db;
+
+#
+# Checking --one-database option with no database specified
+# at command-line.
+#
+SHOW TABLES IN test;
+Tables_in_test
+
+#
+# Checking --one-database option with non_existent_db
+# specified with USE command
+#
+CREATE DATABASE connected_db;
+SHOW TABLES IN connected_db;
+Tables_in_connected_db
+table_in_connected_db
+
+SHOW TABLES IN connected_db;
+Tables_in_connected_db
+table_in_connected_db
+DROP DATABASE connected_db;
+
End of tests
diff --git a/mysql-test/r/mysql_embedded.result b/mysql-test/r/mysql_embedded.result
new file mode 100644
index 00000000000..3ba79a01e44
--- /dev/null
+++ b/mysql-test/r/mysql_embedded.result
@@ -0,0 +1,5 @@
+#
+# Bug#12561297 : LIBMYSQLD/EXAMPLE/MYSQL_EMBEDDED IS ABORTING.
+#
+1
+1
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index 7737dab49b2..cc4c7a1dad9 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -20,6 +20,7 @@ mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
+mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
@@ -56,6 +57,7 @@ mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
+mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
@@ -92,6 +94,7 @@ mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
+mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
@@ -131,6 +134,7 @@ mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
+mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
@@ -173,6 +177,7 @@ mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
+mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
@@ -218,6 +223,7 @@ mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
+mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
diff --git a/mysql-test/r/mysql_upgrade_ssl.result b/mysql-test/r/mysql_upgrade_ssl.result
index 23ad09dbd9c..a08e7c115cc 100644
--- a/mysql-test/r/mysql_upgrade_ssl.result
+++ b/mysql-test/r/mysql_upgrade_ssl.result
@@ -22,6 +22,7 @@ mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
+mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
diff --git a/mysql-test/r/mysqladmin.result b/mysql-test/r/mysqladmin.result
index 57927f8aa67..8a9b009946b 100644
--- a/mysql-test/r/mysqladmin.result
+++ b/mysql-test/r/mysqladmin.result
@@ -2,3 +2,18 @@ mysqld is alive
mysqladmin: unknown variable 'database=db1'
Warning: mysqladmin: unknown variable 'loose-database=db2'
mysqld is alive
+#
+# Bug#58221 : mysqladmin --sleep=x --count=x keeps looping
+#
+# Executing mysqladmin with --sleep=1 and --count=2.
+# Done.
+# Displaying the output :
+mysqld is alive
+mysqld is alive
+#
+# BUG#11766184 - 59234: cmdline clients crash --defaults-extra-file
+# with no .cnf or .ini extension.
+#
+# Creating an empty file 'cnf_file'
+# Using --defaults-extra-file option with 'cnf_file'.
+mysqld is alive
diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result
index 51fad679909..5a47b6700c0 100644
--- a/mysql-test/r/mysqlbinlog.result
+++ b/mysql-test/r/mysqlbinlog.result
@@ -879,3 +879,39 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
End of 5.0 tests
End of 5.1 tests
+# Expect deprecation warning.
+WARNING: The --base64-output=always flag and the --base64-output flag (with '=MODE' omitted), are deprecated. The output generated when these flags are used cannot be parsed by mysql 5.6.0 and later. The flags will be removed in a future version. Please use --base64-output=auto instead.
+# Expect deprecation warning again.
+WARNING: The --base64-output=always flag and the --base64-output flag (with '=MODE' omitted), are deprecated. The output generated when these flags are used cannot be parsed by mysql 5.6.0 and later. The flags will be removed in a future version. Please use --base64-output=auto instead.
+RESET MASTER;
+CREATE DATABASE test1;
+USE test1;
+CREATE TABLE t1(id int);
+DROP DATABASE test1;
+CREATE DATABASE test1;
+USE test1;
+CREATE TABLE t1(id int);
+DROP TABLE t1;
+DROP DATABASE test1;
+FLUSH LOGS;
+show binlog events in 'master-bin.000002' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query # # CREATE DATABASE test1
+master-bin.000002 # Query # # use `test1`; CREATE TABLE t1(id int)
+master-bin.000002 # Query # # DROP DATABASE test1
+master-bin.000002 # Query # # CREATE DATABASE test1
+master-bin.000002 # Query # # use `test1`; CREATE TABLE t1(id int)
+master-bin.000002 # Query # # use `test1`; DROP TABLE `t1` /* generated by server */
+master-bin.000002 # Query # # DROP DATABASE test1
+RESET MASTER;
+USE test;
+CREATE TABLE t1 (a INT);
+SET GLOBAL SERVER_ID = 2;
+DROP TABLE t1;
+FLUSH LOGS;
+SHOW TABLES IN test;
+Tables_in_test
+t1
+SHOW TABLES IN test;
+Tables_in_test
+SET GLOBAL SERVER_ID = 1;
diff --git a/mysql-test/r/mysqlbinlog_base64.result b/mysql-test/r/mysqlbinlog_base64.result
index c5e1e2f8ca1..72d49c16cc8 100644
--- a/mysql-test/r/mysqlbinlog_base64.result
+++ b/mysql-test/r/mysqlbinlog_base64.result
@@ -109,3 +109,13 @@ count(*)
35840
drop table t1;
drop table t2;
+RESET MASTER;
+USE test;
+SET @old_binlog_format= @@binlog_format;
+SET SESSION binlog_format=ROW;
+CREATE TABLE t1(c1 INT);
+INSERT INTO t1 VALUES (1);
+FLUSH LOGS;
+DROP TABLE t1;
+SET SESSION binlog_format= @old_binlog_format;
+RESET MASTER;
diff --git a/mysql-test/r/mysqlbinlog_row_big.result b/mysql-test/r/mysqlbinlog_row_big.result
index 46fa0dc79cd..0bdbfdcee3a 100644
--- a/mysql-test/r/mysqlbinlog_row_big.result
+++ b/mysql-test/r/mysqlbinlog_row_big.result
@@ -36,8 +36,8 @@ c1 LONGTEXT
#
# Insert some big rows.
#
-256MB
-INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 16777216));
+64MB
+INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 4194304));
affected rows: 1
32MB
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 2097152));
@@ -53,7 +53,7 @@ affected rows: 1
# Do not display the column value itself, just its length.
#
SELECT LENGTH(c1) FROM t1;
-LENGTH(c1) 268435456
+LENGTH(c1) 67108864
LENGTH(c1) 33554432
LENGTH(c1) 4194304
LENGTH(c1) 524288
@@ -69,7 +69,7 @@ info: Rows matched: 4 Changed: 4 Warnings: 0
# Do not display the column value itself, just its length.
#
SELECT LENGTH(c1) FROM t1;
-LENGTH(c1) 536870912
+LENGTH(c1) 134217728
LENGTH(c1) 1048576
LENGTH(c1) 67108864
LENGTH(c1) 8388608
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index 6217f4e48ee..f59942d609c 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -16,6 +16,7 @@ mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
+mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
@@ -24,6 +25,8 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
+mtr.global_suppressions Table is already up to date
+mtr.test_suppressions Table is already up to date
mysql.columns_priv OK
mysql.db OK
mysql.event OK
@@ -37,6 +40,7 @@ mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
+mysql.proxies_priv OK
mysql.servers OK
mysql.tables_priv OK
mysql.time_zone OK
@@ -45,20 +49,66 @@ mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
-create table t1 (a int);
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func 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.proxies_priv OK
+mysql.servers 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
+mysql.columns_priv Table is already up to date
+mysql.db Table is already up to date
+mysql.event Table is already up to date
+mysql.func Table is already up to date
+mysql.help_category Table is already up to date
+mysql.help_keyword Table is already up to date
+mysql.help_relation Table is already up to date
+mysql.help_topic Table is already up to date
+mysql.host Table is already up to date
+mysql.ndb_binlog_index Table is already up to date
+mysql.plugin Table is already up to date
+mysql.proc Table is already up to date
+mysql.procs_priv Table is already up to date
+mysql.proxies_priv Table is already up to date
+mysql.servers Table is already up to date
+mysql.tables_priv Table is already up to date
+mysql.time_zone Table is already up to date
+mysql.time_zone_leap_second Table is already up to date
+mysql.time_zone_name Table is already up to date
+mysql.time_zone_transition Table is already up to date
+mysql.time_zone_transition_type Table is already up to date
+mysql.user Table is already up to date
+create table t1 (a int) engine=myisam;
create view v1 as select * from t1;
test.t1 OK
+test.t1 Table is already up to date
test.t1 OK
+test.t1 Table is already up to date
drop view v1;
drop table t1;
-create table `t``1`(a int);
-create table `t 1`(a int);
+create table `t``1`(a int) engine=myisam;
+create table `t 1`(a int) engine=myisam;
test.t 1 OK
test.t`1 OK
drop table `t``1`, `t 1`;
create database d_bug25347;
use d_bug25347;
-create table t_bug25347 (a int);
+create table t_bug25347 (a int) engine=myisam;
create view v_bug25347 as select * from t_bug25347;
insert into t_bug25347 values (1),(2),(3);
flush tables;
@@ -98,15 +148,15 @@ Table Op Msg_type Msg_text
test.v1 check status OK
information_schema.routines check note The storage engine for the table doesn't support check
drop view v1;
-CREATE TABLE t1(a INT);
-CREATE TABLE t2(a INT);
+CREATE TABLE t1(a INT) engine=myisam;
+CREATE TABLE t2(a INT) engine=myisam;
test.t1
Error : Incorrect information in file: './test/t1.frm'
error : Corrupt
test.t2 OK
DROP TABLE t1, t2;
End of 5.0 tests
-create table t1(a int);
+create table t1(a int) engine=myisam;
create view v1 as select * from t1;
show tables;
Tables_in_test
@@ -117,6 +167,7 @@ Tables_in_test
t1
#mysql50#v-1
v1
+test.t1 OK
show tables;
Tables_in_test
t1
@@ -125,7 +176,7 @@ v-1
drop view v1, `v-1`;
drop table t1;
SET NAMES utf8;
-CREATE TABLE `#mysql50#@` (a INT);
+CREATE TABLE `#mysql50#@` (a INT) engine=myisam;
SHOW TABLES;
Tables_in_test
#mysql50#@
@@ -136,7 +187,7 @@ SHOW TABLES;
Tables_in_test
@
DROP TABLE `@`;
-CREATE TABLE `Ñ` (a INT);
+CREATE TABLE `Ñ` (a INT) engine=myisam;
SET NAMES DEFAULT;
mysqlcheck --default-character-set="latin1" --databases test
test.?
@@ -149,8 +200,8 @@ DROP TABLE `Ñ`;
SET NAMES DEFAULT;
CREATE DATABASE `#mysql50#a@b`;
USE `#mysql50#a@b`;
-CREATE TABLE `#mysql50#c@d` (a INT);
-CREATE TABLE t1 (a INT);
+CREATE TABLE `#mysql50#c@d` (a INT) engine=myisam;
+CREATE TABLE t1 (a INT) engine=myisam;
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
@@ -179,14 +230,81 @@ USE test;
# Bug #31821: --all-in-1 and --fix-table-names don't work together
#
drop table if exists `#mysql50#t1-1`;
-create table `#mysql50#t1-1` (a int);
+create table `#mysql50#t1-1` (a int) engine=myisam;
show tables like 't1-1';
Tables_in_test (t1-1)
t1-1
drop table `t1-1`;
-create table `#mysql50#t1-1` (a int);
+create table `#mysql50#t1-1` (a int) engine=myisam;
show tables like 't1-1';
Tables_in_test (t1-1)
t1-1
drop table `t1-1`;
End of 5.1 tests
+#
+# Bug #35269: mysqlcheck behaves different depending on order of parameters
+#
+#
+# Bug#11755431 47205: MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR
+# ENGINES NOT SUPPORTING NATIVE
+#
+DROP TABLE IF EXISTS bug47205;
+#
+# Test 1: Check that ALTER TABLE ... rebuilds the table
+CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY)
+DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb;
+INSERT INTO bug47205 VALUES ("foobar");
+FLUSH TABLE bug47205;
+# Replace the FRM with a 5.0 FRM that will require upgrade
+# Should indicate that ALTER TABLE ... FORCE is needed
+CHECK TABLE bug47205 FOR UPGRADE;
+Table Op Msg_type Msg_text
+test.bug47205 check error Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it!
+# ALTER TABLE ... FORCE should rebuild the table
+# and therefore output "affected rows: 1"
+ALTER TABLE bug47205 FORCE;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+# Table should now be ok
+CHECK TABLE bug47205 FOR UPGRADE;
+Table Op Msg_type Msg_text
+test.bug47205 check status OK
+DROP TABLE bug47205;
+#
+# Test 2: InnoDB - REPAIR not supported
+CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY)
+DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb;
+FLUSH TABLE bug47205;
+# Replace the FRM with a 5.0 FRM that will require upgrade
+# Should indicate that ALTER TABLE .. FORCE is needed
+CHECK TABLE bug47205 FOR UPGRADE;
+Table Op Msg_type Msg_text
+test.bug47205 check error Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it!
+# Running mysqlcheck to check and upgrade
+test.bug47205
+error : Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it!
+
+Repairing tables
+# Table should now be ok
+CHECK TABLE bug47205 FOR UPGRADE;
+Table Op Msg_type Msg_text
+test.bug47205 check status OK
+DROP TABLE bug47205;
+#
+# Test 3: MyISAM - REPAIR supported
+# Use an old FRM that will require upgrade
+# Should indicate that REPAIR TABLE is needed
+CHECK TABLE bug47205 FOR UPGRADE;
+Table Op Msg_type Msg_text
+test.bug47205 check error Table upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it!
+# Running mysqlcheck to check and upgrade
+test.bug47205
+error : Table upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it!
+
+Repairing tables
+test.bug47205 OK
+# Table should now be ok
+CHECK TABLE bug47205 FOR UPGRADE;
+Table Op Msg_type Msg_text
+test.bug47205 check status OK
+DROP TABLE bug47205;
diff --git a/mysql-test/r/mysqld--defaults-file.result b/mysql-test/r/mysqld--defaults-file.result
new file mode 100644
index 00000000000..5fd5ca8d95a
--- /dev/null
+++ b/mysql-test/r/mysqld--defaults-file.result
@@ -0,0 +1,12 @@
+Could not open required defaults file: /path/with/no/extension
+Fatal error in defaults handling. Program aborted
+Could not open required defaults file: /path/with.ext
+Fatal error in defaults handling. Program aborted
+Could not open required defaults file: MYSQL_TEST_DIR/relative/path/with.ext
+Fatal error in defaults handling. Program aborted
+Could not open required defaults file: MYSQL_TEST_DIR/relative/path/without/extension
+Fatal error in defaults handling. Program aborted
+Could not open required defaults file: MYSQL_TEST_DIR/with.ext
+Fatal error in defaults handling. Program aborted
+Could not open required defaults file: MYSQL_TEST_DIR/no_extension
+Fatal error in defaults handling. Program aborted
diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result
index 8cd8dc2b0dd..631829c30de 100644
--- a/mysql-test/r/mysqld--help-notwin.result
+++ b/mysql-test/r/mysqld--help-notwin.result
@@ -19,6 +19,8 @@ The following options may be given as the first argument:
--auto-increment-offset[=#]
Offset added to Auto-increment columns. Used when
auto-increment-increment != 1
+ --autocommit Set default value for autocommit (0 or 1)
+ (Defaults to on; use --skip-autocommit to disable.)
--automatic-sp-privileges
Creating and dropping stored procedures alters ACLs
(Defaults to on; use --skip-automatic-sp-privileges to disable.)
@@ -31,10 +33,10 @@ The following options may be given as the first argument:
file (Solves most 'table full' errors)
--bind-address=name IP address to bind to.
--binlog-cache-size=#
- The size of the cache to hold the SQL statements for the
- binary log during a transaction. If you often use big,
- multi-statement transactions you can increase this to get
- more performance
+ The size of the transactional cache for updates to
+ transactional engines for the binary log. If you often
+ use transactions containing many statements, you can
+ increase this to get more performance
--binlog-direct-non-transactional-updates
Causes updates to non-transactional engines using
statement format to be written directly to binary log.
@@ -65,6 +67,11 @@ The following options may be given as the first argument:
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.
+ --binlog-stmt-cache-size=#
+ The size of the statement cache for updates to
+ non-transactional engines for the binary log. If you
+ often use statements updating a great number of rows, you
+ can increase this to get more performance
--bootstrap Used by mysql installation scripts.
--bulk-insert-buffer-size=#
Size of tree cache used in bulk insert optimisation. Note
@@ -311,14 +318,15 @@ The following options may be given as the first argument:
--max-allowed-packet=#
Max packet length to send to or receive from the server
--max-binlog-cache-size=#
- Can be used to restrict the total size used to cache a
- multi-transaction query
+ Sets the total size of the transactional cache
--max-binlog-dump-events=#
Option used by mysql-test for debugging and testing of
replication.
--max-binlog-size=# Binary log will be rotated automatically when the size
exceeds this value. Will also apply to relay logs if
max_relay_log_size is 0
+ --max-binlog-stmt-cache-size=#
+ Sets the total size of the statement cache
--max-connect-errors=#
If there is more than this number of interrupted
connections from a host this host will be blocked from
@@ -335,6 +343,10 @@ The following options may be given as the first argument:
max_join_size records return an error
--max-length-for-sort-data=#
Max number of bytes in sorted records
+ --max-long-data-size=#
+ The maximum BLOB length to send to server from
+ mysql_send_long_data API. Deprecated option; use
+ max_allowed_packet instead.
--max-prepared-stmt-count=#
Maximum number of prepared statements in the server
--max-relay-log-size=#
@@ -775,6 +787,7 @@ abort-slave-event-count 0
allow-suspicious-udfs FALSE
auto-increment-increment 1
auto-increment-offset 1
+autocommit TRUE
automatic-sp-privileges TRUE
back-log 50
big-tables FALSE
@@ -783,6 +796,7 @@ binlog-cache-size 32768
binlog-direct-non-transactional-updates FALSE
binlog-format STATEMENT
binlog-row-event-max-size 1024
+binlog-stmt-cache-size 32768
bulk-insert-buffer-size 8388608
character-set-client-handshake TRUE
character-set-filesystem binary
@@ -873,6 +887,7 @@ max-allowed-packet 1048576
max-binlog-cache-size 18446744073709547520
max-binlog-dump-events 0
max-binlog-size 1073741824
+max-binlog-stmt-cache-size 18446744073709547520
max-connect-errors 10
max-connections 151
max-delayed-threads 20
@@ -880,6 +895,7 @@ max-error-count 64
max-heap-table-size 16777216
max-join-size 18446744073709551615
max-length-for-sort-data 1024
+max-long-data-size 1048576
max-prepared-stmt-count 16382
max-relay-log-size 0
max-seeks-for-key 18446744073709551615
@@ -977,7 +993,6 @@ slave-transaction-retries 10
slave-type-conversions
slow-launch-time 2
slow-query-log FALSE
-socket /tmp/mysql.sock
sort-buffer-size 2097152
sporadic-binlog-dump-fail FALSE
sql-mode
diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result
index e1098b71e25..361d30620f7 100644
--- a/mysql-test/r/mysqld--help-win.result
+++ b/mysql-test/r/mysqld--help-win.result
@@ -19,6 +19,8 @@ The following options may be given as the first argument:
--auto-increment-offset[=#]
Offset added to Auto-increment columns. Used when
auto-increment-increment != 1
+ --autocommit Set default value for autocommit (0 or 1)
+ (Defaults to on; use --skip-autocommit to disable.)
--automatic-sp-privileges
Creating and dropping stored procedures alters ACLs
(Defaults to on; use --skip-automatic-sp-privileges to disable.)
@@ -31,10 +33,10 @@ The following options may be given as the first argument:
file (Solves most 'table full' errors)
--bind-address=name IP address to bind to.
--binlog-cache-size=#
- The size of the cache to hold the SQL statements for the
- binary log during a transaction. If you often use big,
- multi-statement transactions you can increase this to get
- more performance
+ The size of the transactional cache for updates to
+ transactional engines for the binary log. If you often
+ use transactions containing many statements, you can
+ increase this to get more performance
--binlog-direct-non-transactional-updates
Causes updates to non-transactional engines using
statement format to be written directly to binary log.
@@ -65,6 +67,11 @@ The following options may be given as the first argument:
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.
+ --binlog-stmt-cache-size=#
+ The size of the statement cache for updates to
+ non-transactional engines for the binary log. If you
+ often use statements updating a great number of rows, you
+ can increase this to get more performance
--bootstrap Used by mysql installation scripts.
--bulk-insert-buffer-size=#
Size of tree cache used in bulk insert optimisation. Note
@@ -276,14 +283,15 @@ The following options may be given as the first argument:
--max-allowed-packet=#
Max packet length to send to or receive from the server
--max-binlog-cache-size=#
- Can be used to restrict the total size used to cache a
- multi-transaction query
+ Sets the total size of the transactional cache
--max-binlog-dump-events=#
Option used by mysql-test for debugging and testing of
replication.
--max-binlog-size=# Binary log will be rotated automatically when the size
exceeds this value. Will also apply to relay logs if
max_relay_log_size is 0
+ --max-binlog-stmt-cache-size=#
+ Sets the total size of the statement cache
--max-connect-errors=#
If there is more than this number of interrupted
connections from a host this host will be blocked from
@@ -300,6 +308,10 @@ The following options may be given as the first argument:
max_join_size records return an error
--max-length-for-sort-data=#
Max number of bytes in sorted records
+ --max-long-data-size=#
+ The maximum BLOB length to send to server from
+ mysql_send_long_data API. Deprecated option; use
+ max_allowed_packet instead.
--max-prepared-stmt-count=#
Maximum number of prepared statements in the server
--max-relay-log-size=#
@@ -729,6 +741,7 @@ abort-slave-event-count 0
allow-suspicious-udfs FALSE
auto-increment-increment 1
auto-increment-offset 1
+autocommit TRUE
automatic-sp-privileges TRUE
back-log 50
big-tables FALSE
@@ -737,6 +750,7 @@ binlog-cache-size 32768
binlog-direct-non-transactional-updates FALSE
binlog-format STATEMENT
binlog-row-event-max-size 1024
+binlog-stmt-cache-size 32768
bulk-insert-buffer-size 8388608
character-set-client-handshake TRUE
character-set-filesystem binary
@@ -815,6 +829,7 @@ max-allowed-packet 1048576
max-binlog-cache-size 18446744073709547520
max-binlog-dump-events 0
max-binlog-size 1073741824
+max-binlog-stmt-cache-size 18446744073709547520
max-connect-errors 10
max-connections 151
max-delayed-threads 20
@@ -822,6 +837,7 @@ max-error-count 64
max-heap-table-size 16777216
max-join-size 18446744073709551615
max-length-for-sort-data 1024
+max-long-data-size 1048576
max-prepared-stmt-count 16382
max-relay-log-size 0
max-seeks-for-key 18446744073709551615
@@ -919,7 +935,6 @@ slave-transaction-retries 10
slave-type-conversions
slow-launch-time 2
slow-query-log FALSE
-socket MySQL
sort-buffer-size 2097152
sporadic-binlog-dump-fail FALSE
sql-mode
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 87e7d837587..9f1d1a50ef1 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -15,7 +15,7 @@ INSERT INTO t1 VALUES (1), (2);
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
- <field Field="a" Type="int(11)" Null="YES" Key="MUL" Extra="" />
+ <field Field="a" Type="int(11)" Null="YES" Key="MUL" Extra="" Comment="" />
<key Table="t1" Non_unique="1" Key_name="a" Seq_in_index="1" Column_name="a" Collation="A" Null="YES" Index_type="BTREE" Comment="" Index_comment="" />
</table_structure>
<table_data name="t1">
@@ -151,9 +151,9 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
- <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
- <field Field="b" Type="text" Null="YES" Key="" Extra="" />
- <field Field="c" Type="varchar(3)" Null="YES" Key="" Extra="" />
+ <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
+ <field Field="b" Type="text" Null="YES" Key="" Extra="" Comment="" />
+ <field Field="c" Type="varchar(3)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_data name="t1">
<row>
@@ -179,7 +179,7 @@ INSERT INTO t1 VALUES ("1\""), ("\"2");
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
- <field Field="a&quot;b&quot;" Type="char(2)" Null="YES" Key="" Extra="" />
+ <field Field="a&quot;b&quot;" Type="char(2)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_data name="t1">
<row>
@@ -1613,10 +1613,10 @@ CREATE TABLE `t2` (
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="mysqldump_test_db">
<table_structure name="t1">
- <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
+ <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_structure name="t2">
- <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
+ <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
</database>
</mysqldump>
@@ -1624,10 +1624,10 @@ CREATE TABLE `t2` (
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="mysqldump_test_db">
<table_structure name="t1">
- <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
+ <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_structure name="t2">
- <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
+ <field Field="a" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
</database>
</mysqldump>
@@ -3645,8 +3645,8 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
<table_structure name="t1">
- <field Field="f1" Type="int(10)" Null="YES" Key="" Extra="" />
- <field Field="data" Type="mediumblob" Null="YES" Key="" Extra="" />
+ <field Field="f1" Type="int(10)" Null="YES" Key="" Extra="" Comment="" />
+ <field Field="data" Type="mediumblob" Null="YES" Key="" Extra="" Comment="" />
</table_structure>
<table_data name="t1">
<row>
@@ -4577,5 +4577,89 @@ LENGTH(a)
800
DROP TABLE t1, t2;
#
+# Bug #13618 : mysqldump --xml ommit comment on table field
+#
+CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT';
+<?xml version="1.0"?>
+<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<database name="test">
+ <table_structure name="comment_table">
+ <field Field="i" Type="int(11)" Null="YES" Key="" Extra="" Comment="FIELD COMMENT" />
+ </table_structure>
+ <table_data name="comment_table">
+ </table_data>
+</database>
+</mysqldump>
+DROP TABLE `comment_table`;
+#
+# BUG#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH ("-") IN
+# DATABASE NAMES IN ALTER DATABASE
+#
+CREATE DATABASE `test-database`;
+USE `test-database`;
+CREATE TABLE `test` (`c1` VARCHAR(10)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+CREATE TRIGGER `trig` BEFORE INSERT ON `test` FOR EACH ROW BEGIN
+END |
+ALTER DATABASE `test-database` CHARACTER SET latin1 COLLATE latin1_swedish_ci;
+ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `test` (
+ `c1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+ALTER DATABASE `test-database` CHARACTER SET latin1 COLLATE latin1_swedish_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 = 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 `trig` BEFORE INSERT ON `test` FOR EACH ROW BEGIN
+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 `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+DROP DATABASE `test-database`;
+USE test;
+#
# End of 5.1 tests
#
+#
+# Verify that two modes can be given in --compatible;
+# and are reflected in SET SQL_MODE in the mysqldump output.
+# Also verify that a prefix of the mode's name is enough.
+#
+CREATE TABLE t1 (a INT);
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!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,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS `t1`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+);
+/*!40101 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;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+DROP TABLE t1;
diff --git a/mysql-test/r/mysqldump_restore.result b/mysql-test/r/mysqldump_restore.result
index 16698251913..9eac8b253de 100644
--- a/mysql-test/r/mysqldump_restore.result
+++ b/mysql-test/r/mysqldump_restore.result
@@ -20,7 +20,7 @@ ALTER TABLE test.t1 RENAME to test.t1_orig;
# Compare original and recreated tables
# Recreated table: test.t1
# Original table: test.t1_orig
-Comparing tables test.t1 and test.t1_orig
+include/diff_tables.inc [test.t1, test.t1_orig]
# Cleanup
DROP TABLE test.t1, test.t1_orig;
#
@@ -45,7 +45,7 @@ ALTER TABLE test.t1 RENAME to test.t1_orig;
# Compare original and recreated tables
# Recreated table: test.t1
# Original table: test.t1_orig
-Comparing tables test.t1 and test.t1_orig
+include/diff_tables.inc [test.t1, test.t1_orig]
# Cleanup
DROP TABLE test.t1, test.t1_orig;
#
@@ -63,7 +63,7 @@ ALTER TABLE test.t1 RENAME to test.t1_orig;
# Compare original and recreated tables
# Recreated table: test.t1
# Original table: test.t1_orig
-Comparing tables test.t1 and test.t1_orig
+include/diff_tables.inc [test.t1, test.t1_orig]
# Cleanup
DROP TABLE test.t1, test.t1_orig;
#
@@ -82,7 +82,7 @@ ALTER TABLE test.t2 RENAME to test.t2_orig;
# Compare original and recreated tables
# Recreated table: test.t2
# Original table: test.t2_orig
-Comparing tables test.t2 and test.t2_orig
+include/diff_tables.inc [test.t2, test.t2_orig]
# Cleanup
DROP TABLE test.t2, test.t2_orig;
DROP TABLE t1;
@@ -100,7 +100,7 @@ ALTER TABLE test.t1 RENAME to test.t1_orig;
# Compare original and recreated tables
# Recreated table: test.t1
# Original table: test.t1_orig
-Comparing tables test.t1 and test.t1_orig
+include/diff_tables.inc [test.t1, test.t1_orig]
# Cleanup
DROP TABLE test.t1, test.t1_orig;
# End tests
diff --git a/mysql-test/r/mysqlslap.result b/mysql-test/r/mysqlslap.result
index c113f18bd3f..9defe1d6093 100644
--- a/mysql-test/r/mysqlslap.result
+++ b/mysql-test/r/mysqlslap.result
@@ -219,3 +219,25 @@ DROP SCHEMA IF EXISTS `mysqlslap`;
DROP PROCEDURE IF EXISTS p1;
CREATE PROCEDURE p1() SELECT 1;
DROP PROCEDURE p1;
+#
+# Bug #11765157 - 58090: mysqlslap drops schema specified in
+# create_schema if auto-generate-sql also set.
+#
+# 'bug58090' database should not be present.
+SHOW DATABASES;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+# 'bug58090' database should be present.
+SHOW DATABASES;
+Database
+information_schema
+bug58090
+mtr
+mysql
+performance_schema
+test
+DROP DATABASE bug58090;
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index edb1ec72070..8f72669ac06 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -309,11 +309,36 @@ var3 two columns with same name
var4 from query that returns NULL
var5 from query that returns no row
failing query in let
+create table t1 (a varchar(100));
+insert into t1 values ('`select 42`');
+`select 42`
+insert into t1 values ('$dollar');
+$dollar
+`select 42`
+drop table t1;
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 './non_existingFile' for reading, errno: 2
-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
+mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql":
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
+At line 1: Source directives are nesting too deep
+mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql":
+included from MYSQLTEST_VARDIR/tmp/error.sql at line 1:
+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
2 = outer loop variable after while
here is the sourced script
@@ -370,23 +395,24 @@ mysqltest: At line 1: Missing required argument 'sleep_delay' to command 'real_s
mysqltest: At line 1: Invalid argument to sleep "abc"
mysqltest: At line 1: Invalid argument to real_sleep "abc"
1
-2
101
-hej
-1
+-99
mysqltest: At line 1: Missing argument to inc
mysqltest: At line 1: The argument to inc must be a variable (start with $)
+mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
mysqltest: At line 1: End of line junk detected: "1000"
-4
-4
+mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
+mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
+-96
+-96
-1
--2
99
-hej
--1
mysqltest: At line 1: Missing argument to dec
mysqltest: At line 1: The argument to dec must be a variable (start with $)
+mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
mysqltest: At line 1: End of line junk detected: "1000"
+mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
+mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
mysqltest: At line 1: Missing arguments to system, nothing to do!
mysqltest: At line 1: Missing arguments to system, nothing to do!
system command 'NonExistsinfComamdn 2> /dev/null' failed
@@ -399,13 +425,50 @@ true-inner
true-inner again
true-outer
Counter is greater than 0, (counter=10)
+Counter should still be 10, is 10
Counter is not 0, (counter=0)
+Not space var works
Counter is true, (counter=alpha)
-Beta is true
while with string, only once
+5<7
+5<7 again
+5<7 still
+5<6
+5>=5
+5>=5 again
+5>3
+5==5
+5!=8
+5!=five
+5==3+2
+5 == 5
+hello == hello
+hello == hello
+hello != goodbye
+'quoted' == ''quoted''
+two words
+'two words'
+"two words"
+two words are two words
+right answer
+anything goes
+0 != string
+mysqltest: At line 2: Only == and != are supported for string values
+mysqltest: At line 2: Found junk '~= 6' after $variable in condition
+mysqltest: At line 2: Expression in if/while must beging with $, ` or a number
+mysqltest: At line 1: Missing right operand in comparison
+mysqltest: At line 1: Missing right operand in comparison
+counter is 2
+counter is 3
+counter is 4
+counter is 5
+counter is 6
+counter is 7
1
Testing while with not
-mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest_while.inc": At line 64: Nesting too deeply
+mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest_while.inc":
+included from MYSQLTEST_VARDIR/tmp/mysqltest_while.inc at line 65:
+At line 64: Nesting too deeply
mysqltest: At line 1: missing '(' in while
mysqltest: At line 1: missing ')' in while
mysqltest: At line 1: Missing '{' after while. Found "dec $i"
@@ -454,8 +517,12 @@ 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
200 connects succeeded
-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
+mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql":
+included from MYSQLTEST_VARDIR/tmp/mysqltest.sql at line 3:
+At line 3: connection 'test_con1' not found in connection pool
+mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql":
+included from MYSQLTEST_VARDIR/tmp/mysqltest.sql at line 2:
+At line 2: Connection test_con1 already exists
show tables;
ERROR 3D000: No database selected
connect con1,localhost,root,,;
@@ -586,7 +653,7 @@ if things work as expected
Some data
for cat_file command
of mysqltest
-mysqltest: At line 1: command "cat_file" failed with error 1
+mysqltest: At line 1: command "cat_file" failed with error 1. (my_errno)
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'
@@ -799,7 +866,7 @@ drop table t1;
mysqltest: At line 1: change user failed: Unknown database 'inexistent'
mysqltest: At line 1: change user failed: Access denied for user 'inexistent'@'localhost' (using password: NO)
mysqltest: At line 1: change user failed: Access denied for user 'root'@'localhost' (using password: YES)
-file1.txt
+REPLACED_FILE1.txt
file1.txt
file2.txt
file11.txt
@@ -807,8 +874,6 @@ dir-list.txt
SELECT 'c:\\a.txt' AS col;
col
z
-hej
-mysqltest: At line 1: Found junk ' != 143' after $variable in expression
select 1;
1
1
diff --git a/mysql-test/r/not_embedded_server.result b/mysql-test/r/not_embedded_server.result
index fac38624695..eccf6151d33 100644
--- a/mysql-test/r/not_embedded_server.result
+++ b/mysql-test/r/not_embedded_server.result
@@ -3,14 +3,47 @@ SHOW VARIABLES like 'slave_skip_errors';
Variable_name Value
slave_skip_errors OFF
#
+# Bug#58026: massive recursion and crash in regular expression handling
+#
+SELECT '1' RLIKE RPAD('1', 10000, '(');
+#
# WL#4284: Transactional DDL locking
#
# FLUSH PRIVILEGES should not implicitly unlock locked tables.
#
-drop table if exists t1;
-create table t1 (c1 int);
-lock tables t1 read;
-flush privileges;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT);
+LOCK TABLES t1 READ;
+FLUSH PRIVILEGES;
ERROR HY000: Table 'host' was not locked with LOCK TABLES
-unlock tables;
-drop table t1;
+UNLOCK TABLES;
+DROP TABLE t1;
+#
+# Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN
+#
+CREATE USER nopriv_user@localhost;
+connection: default
+DROP TABLE IF EXISTS t1,t2,t3;
+DROP FUNCTION IF EXISTS f;
+CREATE TABLE t1 (key1 INT PRIMARY KEY);
+CREATE TABLE t2 (key2 INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE FUNCTION f() RETURNS INT RETURN 1;
+GRANT FILE ON *.* TO 'nopriv_user'@'localhost';
+FLUSH PRIVILEGES;
+connection: con1
+SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE '<outfile>';
+ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
+INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1;
+ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
+SELECT MAX(key1) INTO @dummy FROM t1 WHERE f() < 1;
+ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
+CREATE TABLE t3 (i INT) AS SELECT MAX(key1) FROM t1 WHERE f() < 1;
+ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
+connection: default
+DROP TABLE t1,t2;
+DROP FUNCTION f;
+DROP USER nopriv_user@localhost;
+#
+# End Bug#54812
+#
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index d87aeefbc34..72bbaa71da5 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -44,13 +44,13 @@ ERROR 42000: DELETE command denied to user 'ssl_user4'@'localhost' for table 't1
drop user ssl_user1@localhost, ssl_user2@localhost,
ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
drop table t1;
-mysqltest: Could not open connection 'default': 2026 SSL error: ASN: bad other signature confirmation
-mysqltest: Could not open connection 'default': 2026 SSL error: ASN: bad other signature confirmation
-mysqltest: Could not open connection 'default': 2026 SSL error: ASN: bad other signature confirmation
+mysqltest: Could not open connection 'default': 2026 SSL connection error: ASN: bad other signature confirmation
+mysqltest: Could not open connection 'default': 2026 SSL connection error: ASN: bad other signature confirmation
+mysqltest: Could not open connection 'default': 2026 SSL connection error: ASN: bad other signature confirmation
SSL error: Unable to get private key from ''
-mysqltest: Could not open connection 'default': 2026 SSL connection error
+mysqltest: Could not open connection 'default': 2026 SSL connection error: Unable to get private key
SSL error: Unable to get certificate from ''
-mysqltest: Could not open connection 'default': 2026 SSL connection error
+mysqltest: Could not open connection 'default': 2026 SSL connection error: Unable to get certificate
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
@@ -83,7 +83,7 @@ Ssl_cipher AES128-SHA
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher AES128-SHA
-mysqltest: Could not open connection 'default': 2026 SSL connection error
+mysqltest: Could not open connection 'default': 2026 SSL connection error: SSL_CTX_new failed
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2);
@@ -189,7 +189,7 @@ UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
SSL error: Unable to get private key from 'MYSQL_TEST_DIR/std_data/client-cert.pem'
-mysqldump: Got error: 2026: "SSL connection error" when trying to connect
+mysqldump: Got error: 2026: SSL connection error: Unable to get private key when trying to connect
DROP TABLE t1;
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index c92e3696c21..1405893213d 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -1430,9 +1430,11 @@ set session sort_buffer_size= 30000;
Warnings:
Warning 1292 Truncated incorrect sort_buffer_size value: '30000'
set session max_sort_length= 2180;
+CALL mtr.add_suppression("Out of sort memory");
select * from t1 order by b;
-ERROR HY001: Out of sort memory; increase server sort buffer size
+ERROR HY001: Out of sort memory, consider increasing server sort buffer size
drop table t1;
+call mtr.add_suppression("Out of sort memory; increase server sort buffer size");
#
# Bug #39844: Query Crash Mysql Server 5.0.67
#
@@ -1643,6 +1645,31 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 8 NULL 10 Using index; Using temporary; Using filesort
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using where
DROP TABLE t1, t2;
+#
+# Bug #59110: Memory leak of QUICK_SELECT_I allocated memory
+# and
+# Bug #59308: Incorrect result for
+SELECT DISTINCT <col>... ORDER BY <col> DESC
+
+# Use Valgrind to detect #59110!
+#
+CREATE TABLE t1 (a INT,KEY (a));
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+EXPLAIN SELECT DISTINCT a,1 FROM t1 WHERE a <> 1 ORDER BY a DESC;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index a a 5 NULL 10 Using where; Using index; Using filesort
+SELECT DISTINCT a,1 FROM t1 WHERE a <> 1 ORDER BY a DESC;
+a 1
+10 1
+9 1
+8 1
+7 1
+6 1
+5 1
+4 1
+3 1
+2 1
+DROP TABLE t1;
End of 5.1 tests
#
# Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY
diff --git a/mysql-test/r/packet.result b/mysql-test/r/packet.result
index ecbb47d4ee0..dcc2c608d0b 100644
--- a/mysql-test/r/packet.result
+++ b/mysql-test/r/packet.result
@@ -3,6 +3,7 @@ set @net_buffer_length=@@global.net_buffer_length;
set global max_allowed_packet=100;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '100'
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
set global net_buffer_length=100;
Warnings:
Warning 1292 Truncated incorrect net_buffer_length value: '100'
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 83ff66eabe5..0febdbc38d0 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1,5 +1,105 @@
drop table if exists t1, t2;
#
+# Bug#11765667: bug#58655: ASSERTION FAILED,
+# SERVER CRASHES WITH MYSQLD GOT SIGNAL 6
+#
+CREATE TABLE t1 (
+id MEDIUMINT NOT NULL AUTO_INCREMENT,
+dt DATE, st VARCHAR(255), uid INT,
+id2nd LONGBLOB, filler VARCHAR(255), PRIMARY KEY(id, dt)
+);
+INSERT INTO t1 (dt, st, uid, id2nd, filler) VALUES
+('1991-03-14', 'Initial Insert', 200, 1234567, 'No Data'),
+('1991-02-26', 'Initial Insert', 201, 1234567, 'No Data'),
+('1992-03-16', 'Initial Insert', 234, 1234567, 'No Data'),
+('1992-07-02', 'Initial Insert', 287, 1234567, 'No Data'),
+('1991-05-26', 'Initial Insert', 256, 1234567, 'No Data'),
+('1991-04-25', 'Initial Insert', 222, 1234567, 'No Data'),
+('1993-03-12', 'Initial Insert', 267, 1234567, 'No Data'),
+('1993-03-14', 'Initial Insert', 291, 1234567, 'No Data'),
+('1991-12-20', 'Initial Insert', 298, 1234567, 'No Data'),
+('1994-10-31', 'Initial Insert', 220, 1234567, 'No Data');
+ALTER TABLE t1 PARTITION BY LIST (YEAR(dt)) (
+PARTITION d1 VALUES IN (1991, 1994),
+PARTITION d2 VALUES IN (1993),
+PARTITION d3 VALUES IN (1992, 1995, 1996)
+);
+INSERT INTO t1 (dt, st, uid, id2nd, filler) VALUES
+('1991-07-14', 'After Partitioning Insert', 299, 1234567, 'Insert row');
+UPDATE t1 SET filler='Updating the row' WHERE uid=298;
+DROP TABLE t1;
+#
+# Bug#59297: Can't find record in 'tablename' on update inner join
+#
+CREATE TABLE t1 (
+a char(2) NOT NULL,
+b char(2) NOT NULL,
+c int(10) unsigned NOT NULL,
+d varchar(255) DEFAULT NULL,
+e varchar(1000) DEFAULT NULL,
+PRIMARY KEY (a, b, c),
+KEY (a),
+KEY (a, b)
+)
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 20 */;
+INSERT INTO t1 (a, b, c, d, e) VALUES
+('07', '03', 343, '1', '07_03_343'),
+('01', '04', 343, '2', '01_04_343'),
+('01', '06', 343, '3', '01_06_343'),
+('01', '07', 343, '4', '01_07_343'),
+('01', '08', 343, '5', '01_08_343'),
+('01', '09', 343, '6', '01_09_343'),
+('03', '03', 343, '7', '03_03_343'),
+('03', '06', 343, '8', '03_06_343'),
+('03', '07', 343, '9', '03_07_343'),
+('04', '03', 343, '10', '04_03_343'),
+('04', '06', 343, '11', '04_06_343'),
+('05', '03', 343, '12', '05_03_343'),
+('11', '03', 343, '13', '11_03_343'),
+('11', '04', 343, '14', '11_04_343')
+;
+UPDATE t1 AS A,
+(SELECT '03' AS a, '06' AS b, 343 AS c, 'last' AS d) AS B
+SET A.e = B.d
+WHERE A.a = '03'
+AND A.b = '06'
+AND A.c = 343;
+DROP TABLE t1;
+#
+# Bug#57778: failed primary key add to partitioned innodb table
+# inconsistent and crashes
+#
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL)
+PARTITION BY KEY (a) PARTITIONS 2;
+INSERT INTO t1 VALUES (0,1), (0,2);
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` int(11) NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 2 */
+SELECT * FROM t1;
+a b
+0 1
+0 2
+UPDATE t1 SET a = 1, b = 1 WHERE a = 0 AND b = 2;
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+SELECT * FROM t1;
+a b
+1 1
+0 1
+ALTER TABLE t1 DROP PRIMARY KEY;
+SELECT * FROM t1;
+a b
+1 1
+0 1
+DROP TABLE t1;
+#
# Bug#57113: ha_partition::extra(ha_extra_function):
# Assertion `m_extra_cache' failed
CREATE TABLE t1
@@ -118,6 +218,15 @@ a b
2007-07-30 17:35:48 p1
2009-07-14 17:35:55 pmax
2009-09-21 17:31:42 pmax
+SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01';
+a b
+2007-07-30 17:35:48 p1
+EXPLAIN PARTITIONS SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1 system PRIMARY NULL NULL NULL 1
+EXPLAIN PARTITIONS SELECT * FROM t1 where a = '2007-07-30 17:35:48';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1 system PRIMARY NULL NULL NULL 1
ALTER TABLE t1 REORGANIZE PARTITION pmax INTO (
PARTITION p3 VALUES LESS THAN (1247688000),
PARTITION pmax VALUES LESS THAN MAXVALUE);
@@ -126,6 +235,15 @@ a b
2007-07-30 17:35:48 p1
2009-07-14 17:35:55 pmax
2009-09-21 17:31:42 pmax
+SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01';
+a b
+2007-07-30 17:35:48 p1
+EXPLAIN PARTITIONS SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1 system PRIMARY NULL NULL NULL 1
+EXPLAIN PARTITIONS SELECT * FROM t1 where a = '2007-07-30 17:35:48';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1 system PRIMARY NULL NULL NULL 1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -566,12 +684,12 @@ create table t1 (a bigint)
partition by range (a)
(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
partition p1 values less than (10));
-ERROR HY000: VALUES value must be of same type as partition function
+ERROR HY000: VALUES value for partition 'p0' must have type INT
create table t1 (a bigint)
partition by list (a)
(partition p0 values in (0xFFFFFFFFFFFFFFFF),
partition p1 values in (10));
-ERROR HY000: VALUES value must be of same type as partition function
+ERROR HY000: VALUES value for partition 'p0' must have type INT
create table t1 (a bigint unsigned)
partition by range (a)
(partition p0 values less than (100),
@@ -1868,7 +1986,7 @@ c1 bigint,
c2 set('sweet'),
key (c2,c1,c0),
key(c0)
-) engine=myisam partition by hash (month(c0)) partitions 5;
+) engine=myisam partition by hash (c0) partitions 5;
insert ignore into t1 set c0 = -6502262, c1 = 3992917, c2 = 35019;
insert ignore into t1 set c0 = 241221, c1 = -6862346, c2 = 56644;
select c1 from t1 group by (select c0 from t1 limit 1);
@@ -2231,3 +2349,51 @@ INSERT INTO t1 VALUES(0);
DROP TABLE t1;
SET GLOBAL myisam_use_mmap=default;
End of 5.1 tests
+#
+# BUG#55385: UPDATE statement throws an error, but still updates
+# the table entries
+CREATE TABLE t1_part (
+partkey int,
+nokey int
+) PARTITION BY LINEAR HASH(partkey) PARTITIONS 3;
+INSERT INTO t1_part VALUES (1, 1) , (10, 10);
+CREATE VIEW v1 AS SELECT * FROM t1_part;
+
+# Should be (1,1),(10,10)
+SELECT * FROM t1_part;
+partkey nokey
+1 1
+10 10
+
+# Case 1
+# Update is refused because partitioning key is updated
+UPDATE t1_part AS A NATURAL JOIN t1_part B SET A.partkey = 2, B.nokey = 3;
+ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'.
+UPDATE t1_part AS A NATURAL JOIN t1_part B SET A.nokey = 2, B.partkey = 3;
+ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'.
+
+# Case 2
+# Like 1, but partition accessed through a view
+UPDATE t1_part AS A NATURAL JOIN v1 as B SET A.nokey = 2 , B.partkey = 3;
+ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'.
+UPDATE v1 AS A NATURAL JOIN t1_part as B SET A.nokey = 2 , B.partkey = 3;
+ERROR HY000: Primary key/partition key update is not allowed since the table is updated both as 'A' and 'B'.
+
+# Should be (1,1),(10,10)
+SELECT * FROM t1_part;
+partkey nokey
+1 1
+10 10
+
+# Case 3
+# Update is accepted because partitioning key is not updated
+UPDATE t1_part AS A NATURAL JOIN t1_part B SET A.nokey = 2 , B.nokey = 3;
+
+# Should be (1,3),(10,3)
+SELECT * FROM t1_part;
+partkey nokey
+1 3
+10 3
+
+DROP VIEW v1;
+DROP TABLE t1_part;
diff --git a/mysql-test/r/partition_binlog.result b/mysql-test/r/partition_binlog.result
new file mode 100644
index 00000000000..c8fa02c4b99
--- /dev/null
+++ b/mysql-test/r/partition_binlog.result
@@ -0,0 +1,49 @@
+DROP TABLE IF EXISTS t1;
+#
+# Bug#58147: ALTER TABLE w/ TRUNCATE PARTITION fails
+# but the statement is written to binlog
+#
+CREATE TABLE t1(id INT)
+PARTITION BY RANGE (id)
+(PARTITION p0 VALUES LESS THAN (100),
+PARTITION pmax VALUES LESS THAN (MAXVALUE));
+INSERT INTO t1 VALUES (1), (10), (100), (1000);
+ALTER TABLE t1 TRUNCATE PARTITION p1;
+ERROR HY000: Incorrect partition name
+ALTER TABLE t1 DROP PARTITION p1;
+ERROR HY000: Error in list of partitions to DROP
+# No error returned, output in table format instead:
+ALTER TABLE t1 ANALYZE PARTITION p1;
+Table Op Msg_type Msg_text
+test.t1 analyze error Error in list of partitions to test.t1
+ALTER TABLE t1 CHECK PARTITION p1;
+Table Op Msg_type Msg_text
+test.t1 check error Error in list of partitions to test.t1
+ALTER TABLE t1 OPTIMIZE PARTITION p1;
+Table Op Msg_type Msg_text
+test.t1 optimize error Error in list of partitions to test.t1
+ALTER TABLE t1 REPAIR PARTITION p1;
+Table Op Msg_type Msg_text
+test.t1 repair error Error in list of partitions to test.t1
+ALTER TABLE t1 ANALYZE PARTITION p0;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+ALTER TABLE t1 CHECK PARTITION p0;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+ALTER TABLE t1 OPTIMIZE PARTITION p0;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+ALTER TABLE t1 REPAIR PARTITION p0;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+ALTER TABLE t1 TRUNCATE PARTITION p0;
+ALTER TABLE t1 DROP PARTITION p0;
+show binlog events in 'master-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 ANALYZE PARTITION p0
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 OPTIMIZE PARTITION p0
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 REPAIR PARTITION p0
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 TRUNCATE PARTITION p0
+master-bin.000001 # Query # # use `test`; ALTER TABLE t1 DROP PARTITION p0
+DROP TABLE t1;
diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result
index 47ea799f497..651d924d7e5 100644
--- a/mysql-test/r/partition_datatype.result
+++ b/mysql-test/r/partition_datatype.result
@@ -338,3 +338,1003 @@ select hex(a) from t1 where a = 7;
hex(a)
7
drop table t1;
+#
+# Bug#28928: UNIX_TIMESTAMP() should be considered unary monotonic
+# by partition pruning
+SET @old_time_zone= @@session.time_zone;
+SET @@session.time_zone = 'UTC';
+# Using MyISAM to get stable values on TABLE_ROWS in I_S.PARTITIONS
+CREATE TABLE t1
+(a TIMESTAMP NULL,
+tz varchar(16))
+ENGINE = MyISAM;
+CREATE TABLE t2 LIKE t1;
+ALTER TABLE t2 PARTITION BY RANGE (UNIX_TIMESTAMP(a))
+(PARTITION `p0` VALUES LESS THAN (0),
+PARTITION `p-2000` VALUES LESS THAN (UNIX_TIMESTAMP('2000-01-01')),
+PARTITION `p-2011-MSK` VALUES LESS THAN (UNIX_TIMESTAMP('2011-03-26 23:00:00')),
+PARTITION `p-2011-MSD-1` VALUES LESS THAN (UNIX_TIMESTAMP('2011-10-29 22:00:00')),
+PARTITION `p-2011-MSD-2` VALUES LESS THAN (UNIX_TIMESTAMP('2011-10-29 23:00:00')),
+PARTITION `p-2012-MSK-1` VALUES LESS THAN (UNIX_TIMESTAMP('2011-10-30 00:00:00')),
+PARTITION `p-2012-MSK-2` VALUES LESS THAN (UNIX_TIMESTAMP('2012-03-24 23:00:00')),
+PARTITION `pEnd` VALUES LESS THAN (UNIX_TIMESTAMP('2038-01-19 03:14:07')),
+PARTITION `pMax` VALUES LESS THAN MAXVALUE);
+# Test 'odd' values
+INSERT INTO t1 VALUES (NULL, 'UTC');
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00', 'UTC');
+# Test invalid values
+INSERT INTO t1 VALUES ('1901-01-01 00:00:00', 'UTCI');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+INSERT INTO t1 VALUES ('1969-12-31 23:59:59', 'UTCI');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+INSERT INTO t1 VALUES ('2038-01-19 03:14:08', 'UTCI');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+INSERT INTO t1 VALUES ('1970-01-01 00:00:00', 'UTCI');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+# Test start range
+INSERT INTO t1 VALUES ('1970-01-01 00:00:01', 'UTC');
+INSERT INTO t1 VALUES ('1974-02-05 21:28:16', 'UTC');
+# Test end range
+INSERT INTO t1 VALUES ('2038-01-19 03:14:06', 'UTC');
+INSERT INTO t1 VALUES ('2038-01-19 03:14:07', 'UTC');
+# Test Daylight saving shift
+INSERT INTO t1 VALUES ('2011-03-26 22:59:59', 'UTC');
+INSERT INTO t1 VALUES ('2011-03-26 23:00:00', 'UTC');
+INSERT INTO t1 VALUES ('2011-03-26 23:00:01', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 21:59:59', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 22:00:00', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 22:00:01', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 22:59:59', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 23:00:00', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 23:00:01', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 23:59:59', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-30 00:00:00', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-30 00:00:01', 'UTC');
+SET @@session.time_zone = 'Europe/Moscow';
+# Test 'odd' values
+INSERT INTO t1 VALUES (NULL, 'Moscow');
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00', 'Moscow');
+# Test invalid values
+INSERT INTO t1 VALUES ('0000-00-00 03:00:00', 'MoscowI');
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+INSERT INTO t1 VALUES ('1901-01-01 00:00:00', 'MoscowI');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+INSERT INTO t1 VALUES ('1969-12-31 23:59:59', 'MoscowI');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+INSERT INTO t1 VALUES ('1970-01-01 02:29:29', 'MoscowI');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+INSERT INTO t1 VALUES ('2038-01-19 06:14:08', 'MoscowI');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+INSERT INTO t1 VALUES ('1970-01-01 03:00:00', 'MoscowI');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+# values truncated to 03:00:00 due to daylight saving shift
+INSERT INTO t1 VALUES ('2011-03-27 02:00:00', 'MoscowI');
+Warnings:
+Warning 1299 Invalid TIMESTAMP value in column 'a' at row 1
+INSERT INTO t1 VALUES ('2011-03-27 02:00:01', 'MoscowI');
+Warnings:
+Warning 1299 Invalid TIMESTAMP value in column 'a' at row 1
+INSERT INTO t1 VALUES ('2011-03-27 02:59:59', 'MoscowI');
+Warnings:
+Warning 1299 Invalid TIMESTAMP value in column 'a' at row 1
+# Test start range
+INSERT INTO t1 VALUES ('1970-01-01 03:00:01', 'Moscow');
+INSERT INTO t1 VALUES ('1974-02-05 21:28:16', 'Moscow');
+# Test end range
+INSERT INTO t1 VALUES ('2038-01-19 06:14:06', 'Moscow');
+INSERT INTO t1 VALUES ('2038-01-19 06:14:07', 'Moscow');
+# Test Daylight saving shift
+INSERT INTO t1 VALUES ('2011-03-27 01:59:59', 'Moscow');
+INSERT INTO t1 VALUES ('2011-03-27 03:00:00', 'Moscow');
+INSERT INTO t1 VALUES ('2011-03-27 03:00:01', 'Moscow');
+INSERT INTO t1 VALUES ('2011-10-30 01:59:59', 'Moscow');
+# All values between 02:00 and 02:59:59 will be interpretated as DST
+INSERT INTO t1 VALUES ('2011-10-30 02:00:00', 'MoscowD');
+INSERT INTO t1 VALUES ('2011-10-30 02:00:01', 'MoscowD');
+INSERT INTO t1 VALUES ('2011-10-30 02:59:59', 'MoscowD');
+INSERT INTO t1 VALUES ('2011-10-30 03:00:00', 'Moscow');
+INSERT INTO t1 VALUES ('2011-10-30 03:00:01', 'Moscow');
+SET @@session.time_zone = 'UTC';
+INSERT INTO t2 SELECT * FROM t1;
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't2';
+PARTITION_NAME TABLE_ROWS
+p0 2
+p-2000 16
+p-2011-MSK 2
+p-2011-MSD-1 9
+p-2011-MSD-2 6
+p-2012-MSK-1 3
+p-2012-MSK-2 4
+pEnd 2
+pMax 2
+SELECT * FROM t1 ORDER BY a, tz;
+a tz
+NULL Moscow
+NULL UTC
+0000-00-00 00:00:00 Moscow
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 UTC
+0000-00-00 00:00:00 UTCI
+0000-00-00 00:00:00 UTCI
+0000-00-00 00:00:00 UTCI
+0000-00-00 00:00:00 UTCI
+1970-01-01 00:00:01 Moscow
+1970-01-01 00:00:01 UTC
+1974-02-05 18:28:16 Moscow
+1974-02-05 21:28:16 UTC
+2011-03-26 22:59:59 Moscow
+2011-03-26 22:59:59 UTC
+2011-03-26 23:00:00 Moscow
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 UTC
+2011-03-26 23:00:01 Moscow
+2011-03-26 23:00:01 UTC
+2011-10-29 21:59:59 Moscow
+2011-10-29 21:59:59 UTC
+2011-10-29 22:00:00 MoscowD
+2011-10-29 22:00:00 UTC
+2011-10-29 22:00:01 MoscowD
+2011-10-29 22:00:01 UTC
+2011-10-29 22:59:59 MoscowD
+2011-10-29 22:59:59 UTC
+2011-10-29 23:00:00 UTC
+2011-10-29 23:00:01 UTC
+2011-10-29 23:59:59 UTC
+2011-10-30 00:00:00 Moscow
+2011-10-30 00:00:00 UTC
+2011-10-30 00:00:01 Moscow
+2011-10-30 00:00:01 UTC
+2038-01-19 03:14:06 Moscow
+2038-01-19 03:14:06 UTC
+2038-01-19 03:14:07 Moscow
+2038-01-19 03:14:07 UTC
+SELECT * FROM t2 ORDER BY a, tz;
+a tz
+NULL Moscow
+NULL UTC
+0000-00-00 00:00:00 Moscow
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 UTC
+0000-00-00 00:00:00 UTCI
+0000-00-00 00:00:00 UTCI
+0000-00-00 00:00:00 UTCI
+0000-00-00 00:00:00 UTCI
+1970-01-01 00:00:01 Moscow
+1970-01-01 00:00:01 UTC
+1974-02-05 18:28:16 Moscow
+1974-02-05 21:28:16 UTC
+2011-03-26 22:59:59 Moscow
+2011-03-26 22:59:59 UTC
+2011-03-26 23:00:00 Moscow
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 UTC
+2011-03-26 23:00:01 Moscow
+2011-03-26 23:00:01 UTC
+2011-10-29 21:59:59 Moscow
+2011-10-29 21:59:59 UTC
+2011-10-29 22:00:00 MoscowD
+2011-10-29 22:00:00 UTC
+2011-10-29 22:00:01 MoscowD
+2011-10-29 22:00:01 UTC
+2011-10-29 22:59:59 MoscowD
+2011-10-29 22:59:59 UTC
+2011-10-29 23:00:00 UTC
+2011-10-29 23:00:01 UTC
+2011-10-29 23:59:59 UTC
+2011-10-30 00:00:00 Moscow
+2011-10-30 00:00:00 UTC
+2011-10-30 00:00:01 Moscow
+2011-10-30 00:00:01 UTC
+2038-01-19 03:14:06 Moscow
+2038-01-19 03:14:06 UTC
+2038-01-19 03:14:07 Moscow
+2038-01-19 03:14:07 UTC
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-26 23:00:00' ORDER BY a, tz;
+a tz
+2011-03-26 22:59:59 Moscow
+2011-03-26 22:59:59 UTC
+2011-03-26 23:00:00 Moscow
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-26 23:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSK,p-2011-MSD-1 ALL NULL NULL NULL NULL 11 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-26 22:59:59' ORDER BY a, tz;
+a tz
+2011-03-26 22:59:59 Moscow
+2011-03-26 22:59:59 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-26 22:59:59' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSK ALL NULL NULL NULL NULL 2 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 22:59:59' and '2011-03-28 00:00:00' ORDER BY a, tz;
+a tz
+2011-03-26 22:59:59 Moscow
+2011-03-26 22:59:59 UTC
+2011-03-26 23:00:00 Moscow
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 UTC
+2011-03-26 23:00:01 Moscow
+2011-03-26 23:00:01 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 22:59:59' and '2011-03-28 00:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSK,p-2011-MSD-1 ALL NULL NULL NULL NULL 11 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 23:00:00' and '2011-03-28 00:00:00' ORDER BY a, tz;
+a tz
+2011-03-26 23:00:00 Moscow
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 UTC
+2011-03-26 23:00:01 Moscow
+2011-03-26 23:00:01 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 23:00:00' and '2011-03-28 00:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSD-1 ALL NULL NULL NULL NULL 9 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 23:00:00' ORDER BY a, tz;
+a tz
+2011-10-29 21:59:59 Moscow
+2011-10-29 21:59:59 UTC
+2011-10-29 22:00:00 MoscowD
+2011-10-29 22:00:00 UTC
+2011-10-29 22:00:01 MoscowD
+2011-10-29 22:00:01 UTC
+2011-10-29 22:59:59 MoscowD
+2011-10-29 22:59:59 UTC
+2011-10-29 23:00:00 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 23:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSD-1,p-2011-MSD-2,p-2012-MSK-1 ALL NULL NULL NULL NULL 18 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 22:59:59' ORDER BY a, tz;
+a tz
+2011-10-29 21:59:59 Moscow
+2011-10-29 21:59:59 UTC
+2011-10-29 22:00:00 MoscowD
+2011-10-29 22:00:00 UTC
+2011-10-29 22:00:01 MoscowD
+2011-10-29 22:00:01 UTC
+2011-10-29 22:59:59 MoscowD
+2011-10-29 22:59:59 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 22:59:59' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSD-1,p-2011-MSD-2 ALL NULL NULL NULL NULL 15 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 22:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz;
+a tz
+2011-10-29 22:59:59 MoscowD
+2011-10-29 22:59:59 UTC
+2011-10-29 23:00:00 UTC
+2011-10-29 23:00:01 UTC
+2011-10-29 23:59:59 UTC
+2011-10-30 00:00:00 Moscow
+2011-10-30 00:00:00 UTC
+2011-10-30 00:00:01 Moscow
+2011-10-30 00:00:01 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 22:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSD-2,p-2012-MSK-1,p-2012-MSK-2 ALL NULL NULL NULL NULL 13 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 23:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz;
+a tz
+2011-10-29 23:00:00 UTC
+2011-10-29 23:00:01 UTC
+2011-10-29 23:59:59 UTC
+2011-10-30 00:00:00 Moscow
+2011-10-30 00:00:00 UTC
+2011-10-30 00:00:01 Moscow
+2011-10-30 00:00:01 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 23:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2012-MSK-1,p-2012-MSK-2 ALL NULL NULL NULL NULL 7 Using where; Using filesort
+# Test end range changes
+DELETE FROM t2 WHERE a = 0;
+INSERT INTO t2 VALUES ('1970-01-01 00:00:00', 'UTC');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+35
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+COUNT(*)
+1
+SELECT * FROM t2 ORDER BY a, tz LIMIT 3;
+a tz
+NULL Moscow
+NULL UTC
+0000-00-00 00:00:00 UTC
+SELECT * FROM t2 ORDER BY a DESC, tz LIMIT 3;
+a tz
+2038-01-19 03:14:07 Moscow
+2038-01-19 03:14:07 UTC
+2038-01-19 03:14:06 Moscow
+UPDATE t2 SET a = TIMESTAMPADD(SECOND, 1, a);
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 34
+Warning 1264 Out of range value for column 'a' at row 35
+SELECT MIN(a), MAX(a) FROM t2;
+MIN(a) MAX(a)
+0000-00-00 00:00:00 2038-01-19 03:14:07
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+35
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+COUNT(*)
+2
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't2';
+PARTITION_NAME TABLE_ROWS
+p0 3
+p-2000 6
+p-2011-MSK 0
+p-2011-MSD-1 9
+p-2011-MSD-2 6
+p-2012-MSK-1 4
+p-2012-MSK-2 5
+pEnd 0
+pMax 2
+SELECT * FROM t2 ORDER BY a, tz;
+a tz
+NULL Moscow
+NULL UTC
+NULL UTC
+0000-00-00 00:00:00 Moscow
+0000-00-00 00:00:00 UTC
+1970-01-01 00:00:02 Moscow
+1970-01-01 00:00:02 UTC
+1974-02-05 18:28:17 Moscow
+1974-02-05 21:28:17 UTC
+2011-03-26 23:00:00 Moscow
+2011-03-26 23:00:00 UTC
+2011-03-26 23:00:01 Moscow
+2011-03-26 23:00:01 MoscowI
+2011-03-26 23:00:01 MoscowI
+2011-03-26 23:00:01 MoscowI
+2011-03-26 23:00:01 UTC
+2011-03-26 23:00:02 Moscow
+2011-03-26 23:00:02 UTC
+2011-10-29 22:00:00 Moscow
+2011-10-29 22:00:00 UTC
+2011-10-29 22:00:01 MoscowD
+2011-10-29 22:00:01 UTC
+2011-10-29 22:00:02 MoscowD
+2011-10-29 22:00:02 UTC
+2011-10-29 23:00:00 MoscowD
+2011-10-29 23:00:00 UTC
+2011-10-29 23:00:01 UTC
+2011-10-29 23:00:02 UTC
+2011-10-30 00:00:00 UTC
+2011-10-30 00:00:01 Moscow
+2011-10-30 00:00:01 UTC
+2011-10-30 00:00:02 Moscow
+2011-10-30 00:00:02 UTC
+2038-01-19 03:14:07 Moscow
+2038-01-19 03:14:07 UTC
+# Test start range changes
+INSERT INTO t2 VALUES ('1970-01-01 00:00:00', 'UTC');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+36
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+COUNT(*)
+3
+SELECT * FROM t2 ORDER BY a, tz LIMIT 3;
+a tz
+NULL Moscow
+NULL UTC
+NULL UTC
+SELECT * FROM t2 ORDER BY a DESC, tz LIMIT 3;
+a tz
+2038-01-19 03:14:07 Moscow
+2038-01-19 03:14:07 UTC
+2011-10-30 00:00:02 Moscow
+UPDATE t2 SET a = TIMESTAMPADD(SECOND, -1, a);
+SELECT MIN(a), MAX(a) FROM t2;
+MIN(a) MAX(a)
+1970-01-01 00:00:01 2038-01-19 03:14:06
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+36
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+COUNT(*)
+0
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't2';
+PARTITION_NAME TABLE_ROWS
+p0 6
+p-2000 4
+p-2011-MSK 2
+p-2011-MSD-1 9
+p-2011-MSD-2 6
+p-2012-MSK-1 3
+p-2012-MSK-2 4
+pEnd 2
+pMax 0
+SELECT * FROM t2 ORDER BY a, tz;
+a tz
+NULL Moscow
+NULL Moscow
+NULL UTC
+NULL UTC
+NULL UTC
+NULL UTC
+1970-01-01 00:00:01 Moscow
+1970-01-01 00:00:01 UTC
+1974-02-05 18:28:16 Moscow
+1974-02-05 21:28:16 UTC
+2011-03-26 22:59:59 Moscow
+2011-03-26 22:59:59 UTC
+2011-03-26 23:00:00 Moscow
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 MoscowI
+2011-03-26 23:00:00 UTC
+2011-03-26 23:00:01 Moscow
+2011-03-26 23:00:01 UTC
+2011-10-29 21:59:59 Moscow
+2011-10-29 21:59:59 UTC
+2011-10-29 22:00:00 MoscowD
+2011-10-29 22:00:00 UTC
+2011-10-29 22:00:01 MoscowD
+2011-10-29 22:00:01 UTC
+2011-10-29 22:59:59 MoscowD
+2011-10-29 22:59:59 UTC
+2011-10-29 23:00:00 UTC
+2011-10-29 23:00:01 UTC
+2011-10-29 23:59:59 UTC
+2011-10-30 00:00:00 Moscow
+2011-10-30 00:00:00 UTC
+2011-10-30 00:00:01 Moscow
+2011-10-30 00:00:01 UTC
+2038-01-19 03:14:06 Moscow
+2038-01-19 03:14:06 UTC
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` timestamp NULL DEFAULT NULL,
+ `tz` varchar(16) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (UNIX_TIMESTAMP(a))
+(PARTITION p0 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION `p-2000` VALUES LESS THAN (946684800) ENGINE = MyISAM,
+ PARTITION `p-2011-MSK` VALUES LESS THAN (1301180400) ENGINE = MyISAM,
+ PARTITION `p-2011-MSD-1` VALUES LESS THAN (1319925600) ENGINE = MyISAM,
+ PARTITION `p-2011-MSD-2` VALUES LESS THAN (1319929200) ENGINE = MyISAM,
+ PARTITION `p-2012-MSK-1` VALUES LESS THAN (1319932800) ENGINE = MyISAM,
+ PARTITION `p-2012-MSK-2` VALUES LESS THAN (1332630000) ENGINE = MyISAM,
+ PARTITION pEnd VALUES LESS THAN (2147483647) ENGINE = MyISAM,
+ PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+TRUNCATE TABLE t2;
+SET @@session.time_zone = 'Europe/Moscow';
+INSERT INTO t2 SELECT * FROM t1;
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't2';
+PARTITION_NAME TABLE_ROWS
+p0 2
+p-2000 16
+p-2011-MSK 2
+p-2011-MSD-1 9
+p-2011-MSD-2 6
+p-2012-MSK-1 3
+p-2012-MSK-2 4
+pEnd 2
+pMax 2
+SELECT * FROM t1 ORDER BY a, tz;
+a tz
+NULL Moscow
+NULL UTC
+0000-00-00 00:00:00 Moscow
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 UTC
+0000-00-00 00:00:00 UTCI
+0000-00-00 00:00:00 UTCI
+0000-00-00 00:00:00 UTCI
+0000-00-00 00:00:00 UTCI
+1970-01-01 03:00:01 Moscow
+1970-01-01 03:00:01 UTC
+1974-02-05 21:28:16 Moscow
+1974-02-06 00:28:16 UTC
+2011-03-27 01:59:59 Moscow
+2011-03-27 01:59:59 UTC
+2011-03-27 03:00:00 Moscow
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 UTC
+2011-03-27 03:00:01 Moscow
+2011-03-27 03:00:01 UTC
+2011-10-30 01:59:59 Moscow
+2011-10-30 01:59:59 UTC
+2011-10-30 02:00:00 MoscowD
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 MoscowD
+2011-10-30 02:00:01 UTC
+2011-10-30 02:59:59 MoscowD
+2011-10-30 02:59:59 UTC
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 UTC
+2011-10-30 02:59:59 UTC
+2011-10-30 03:00:00 Moscow
+2011-10-30 03:00:00 UTC
+2011-10-30 03:00:01 Moscow
+2011-10-30 03:00:01 UTC
+2038-01-19 06:14:06 Moscow
+2038-01-19 06:14:06 UTC
+2038-01-19 06:14:07 Moscow
+2038-01-19 06:14:07 UTC
+SELECT * FROM t2 ORDER BY a, tz;
+a tz
+NULL Moscow
+NULL UTC
+0000-00-00 00:00:00 Moscow
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 MoscowI
+0000-00-00 00:00:00 UTC
+0000-00-00 00:00:00 UTCI
+0000-00-00 00:00:00 UTCI
+0000-00-00 00:00:00 UTCI
+0000-00-00 00:00:00 UTCI
+1970-01-01 03:00:01 Moscow
+1970-01-01 03:00:01 UTC
+1974-02-05 21:28:16 Moscow
+1974-02-06 00:28:16 UTC
+2011-03-27 01:59:59 Moscow
+2011-03-27 01:59:59 UTC
+2011-03-27 03:00:00 Moscow
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 UTC
+2011-03-27 03:00:01 Moscow
+2011-03-27 03:00:01 UTC
+2011-10-30 01:59:59 Moscow
+2011-10-30 01:59:59 UTC
+2011-10-30 02:00:00 MoscowD
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 MoscowD
+2011-10-30 02:00:01 UTC
+2011-10-30 02:59:59 MoscowD
+2011-10-30 02:59:59 UTC
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 UTC
+2011-10-30 02:59:59 UTC
+2011-10-30 03:00:00 Moscow
+2011-10-30 03:00:00 UTC
+2011-10-30 03:00:01 Moscow
+2011-10-30 03:00:01 UTC
+2038-01-19 06:14:06 Moscow
+2038-01-19 06:14:06 UTC
+2038-01-19 06:14:07 Moscow
+2038-01-19 06:14:07 UTC
+# Testing the leap from 01:59:59 to 03:00:00
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-27 03:00:00' ORDER BY a, tz;
+a tz
+2011-03-27 01:59:59 Moscow
+2011-03-27 01:59:59 UTC
+2011-03-27 03:00:00 Moscow
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-27 03:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSK,p-2011-MSD-1 ALL NULL NULL NULL NULL 11 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-27 01:59:59' ORDER BY a, tz;
+a tz
+2011-03-27 01:59:59 Moscow
+2011-03-27 01:59:59 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-27 01:59:59' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSK ALL NULL NULL NULL NULL 2 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 01:59:59' and '2011-03-28 00:00:00' ORDER BY a, tz;
+a tz
+2011-03-27 01:59:59 Moscow
+2011-03-27 01:59:59 UTC
+2011-03-27 03:00:00 Moscow
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 UTC
+2011-03-27 03:00:01 Moscow
+2011-03-27 03:00:01 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 01:59:59' and '2011-03-28 00:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSK,p-2011-MSD-1 ALL NULL NULL NULL NULL 11 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 03:00:00' and '2011-03-28 00:00:00' ORDER BY a, tz;
+a tz
+2011-03-27 01:59:59 Moscow
+2011-03-27 01:59:59 UTC
+2011-03-27 03:00:00 Moscow
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 UTC
+2011-03-27 03:00:01 Moscow
+2011-03-27 03:00:01 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 03:00:00' and '2011-03-28 00:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSK,p-2011-MSD-1 ALL NULL NULL NULL NULL 11 Using where; Using filesort
+# Testing the leap from 02:59:59 to 02:00:00
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 02:00:00' ORDER BY a, tz;
+a tz
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 02:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSD-1 ALL NULL NULL NULL NULL 9 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 02:59:59' ORDER BY a, tz;
+a tz
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 02:59:59' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSD-1 ALL NULL NULL NULL NULL 9 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 03:00:00' ORDER BY a, tz;
+a tz
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 03:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSD-1 ALL NULL NULL NULL NULL 9 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 01:59:59' ORDER BY a, tz;
+a tz
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 01:59:59' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSD-1 ALL NULL NULL NULL NULL 9 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 02:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz;
+a tz
+2011-10-30 01:59:59 Moscow
+2011-10-30 01:59:59 UTC
+2011-10-30 02:00:00 MoscowD
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 MoscowD
+2011-10-30 02:00:01 UTC
+2011-10-30 02:59:59 MoscowD
+2011-10-30 02:59:59 UTC
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 UTC
+2011-10-30 02:59:59 UTC
+2011-10-30 03:00:00 Moscow
+2011-10-30 03:00:00 UTC
+2011-10-30 03:00:01 Moscow
+2011-10-30 03:00:01 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 02:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSD-1,p-2011-MSD-2,p-2012-MSK-1,p-2012-MSK-2 ALL NULL NULL NULL NULL 22 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 02:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz;
+a tz
+2011-10-30 01:59:59 Moscow
+2011-10-30 01:59:59 UTC
+2011-10-30 02:00:00 MoscowD
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 MoscowD
+2011-10-30 02:00:01 UTC
+2011-10-30 02:59:59 MoscowD
+2011-10-30 02:59:59 UTC
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 UTC
+2011-10-30 02:59:59 UTC
+2011-10-30 03:00:00 Moscow
+2011-10-30 03:00:00 UTC
+2011-10-30 03:00:01 Moscow
+2011-10-30 03:00:01 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 02:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSD-1,p-2011-MSD-2,p-2012-MSK-1,p-2012-MSK-2 ALL NULL NULL NULL NULL 22 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 03:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz;
+a tz
+2011-10-30 01:59:59 Moscow
+2011-10-30 01:59:59 UTC
+2011-10-30 02:00:00 MoscowD
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 MoscowD
+2011-10-30 02:00:01 UTC
+2011-10-30 02:59:59 MoscowD
+2011-10-30 02:59:59 UTC
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 UTC
+2011-10-30 02:59:59 UTC
+2011-10-30 03:00:00 Moscow
+2011-10-30 03:00:00 UTC
+2011-10-30 03:00:01 Moscow
+2011-10-30 03:00:01 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 03:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSD-1,p-2011-MSD-2,p-2012-MSK-1,p-2012-MSK-2 ALL NULL NULL NULL NULL 22 Using where; Using filesort
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 01:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz;
+a tz
+2011-10-30 01:59:59 Moscow
+2011-10-30 01:59:59 UTC
+2011-10-30 02:00:00 MoscowD
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 MoscowD
+2011-10-30 02:00:01 UTC
+2011-10-30 02:59:59 MoscowD
+2011-10-30 02:59:59 UTC
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 UTC
+2011-10-30 02:59:59 UTC
+2011-10-30 03:00:00 Moscow
+2011-10-30 03:00:00 UTC
+2011-10-30 03:00:01 Moscow
+2011-10-30 03:00:01 UTC
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 01:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p-2011-MSD-1,p-2011-MSD-2,p-2012-MSK-1,p-2012-MSK-2 ALL NULL NULL NULL NULL 22 Using where; Using filesort
+# Test end range changes
+DELETE FROM t2 WHERE a = 0;
+INSERT INTO t2 VALUES ('1970-01-01 00:00:00', 'Moscow');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+35
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+COUNT(*)
+1
+SELECT * FROM t2 ORDER BY a, tz LIMIT 3;
+a tz
+NULL Moscow
+NULL UTC
+0000-00-00 00:00:00 Moscow
+SELECT * FROM t2 ORDER BY a DESC, tz LIMIT 3;
+a tz
+2038-01-19 06:14:07 Moscow
+2038-01-19 06:14:07 UTC
+2038-01-19 06:14:06 Moscow
+UPDATE t2 SET a = TIMESTAMPADD(SECOND, 1, a);
+Warnings:
+Warning 1299 Invalid TIMESTAMP value in column 'a' at row 8
+Warning 1299 Invalid TIMESTAMP value in column 'a' at row 9
+Warning 1264 Out of range value for column 'a' at row 34
+Warning 1264 Out of range value for column 'a' at row 35
+SELECT MIN(a), MAX(a) FROM t2;
+MIN(a) MAX(a)
+0000-00-00 00:00:00 2038-01-19 06:14:07
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+35
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+COUNT(*)
+2
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't2';
+PARTITION_NAME TABLE_ROWS
+p0 3
+p-2000 6
+p-2011-MSK 0
+p-2011-MSD-1 9
+p-2011-MSD-2 8
+p-2012-MSK-1 0
+p-2012-MSK-2 7
+pEnd 0
+pMax 2
+SELECT * FROM t2 ORDER BY a, tz;
+a tz
+NULL Moscow
+NULL Moscow
+NULL UTC
+0000-00-00 00:00:00 Moscow
+0000-00-00 00:00:00 UTC
+1970-01-01 03:00:02 Moscow
+1970-01-01 03:00:02 UTC
+1974-02-05 21:28:17 Moscow
+1974-02-06 00:28:17 UTC
+2011-03-27 03:00:00 Moscow
+2011-03-27 03:00:00 UTC
+2011-03-27 03:00:01 Moscow
+2011-03-27 03:00:01 MoscowI
+2011-03-27 03:00:01 MoscowI
+2011-03-27 03:00:01 MoscowI
+2011-03-27 03:00:01 UTC
+2011-03-27 03:00:02 Moscow
+2011-03-27 03:00:02 UTC
+2011-10-30 02:00:00 Moscow
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 MoscowD
+2011-10-30 02:00:01 UTC
+2011-10-30 02:00:01 UTC
+2011-10-30 02:00:02 MoscowD
+2011-10-30 02:00:02 UTC
+2011-10-30 02:00:02 UTC
+2011-10-30 03:00:00 MoscowD
+2011-10-30 03:00:00 UTC
+2011-10-30 03:00:00 UTC
+2011-10-30 03:00:01 Moscow
+2011-10-30 03:00:01 UTC
+2011-10-30 03:00:02 Moscow
+2011-10-30 03:00:02 UTC
+2038-01-19 06:14:07 Moscow
+2038-01-19 06:14:07 UTC
+# Test start range changes
+INSERT INTO t2 VALUES ('1970-01-01 00:00:00', 'Moscow');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+36
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+COUNT(*)
+3
+SELECT * FROM t2 ORDER BY a, tz LIMIT 3;
+a tz
+NULL Moscow
+NULL Moscow
+NULL UTC
+SELECT * FROM t2 ORDER BY a DESC, tz LIMIT 3;
+a tz
+2038-01-19 06:14:07 Moscow
+2038-01-19 06:14:07 UTC
+2011-10-30 03:00:02 Moscow
+UPDATE t2 SET a = TIMESTAMPADD(SECOND, -1, a);
+Warnings:
+Warning 1299 Invalid TIMESTAMP value in column 'a' at row 18
+Warning 1299 Invalid TIMESTAMP value in column 'a' at row 19
+SELECT MIN(a), MAX(a) FROM t2;
+MIN(a) MAX(a)
+1970-01-01 03:00:01 2038-01-19 06:14:06
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+36
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+COUNT(*)
+0
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't2';
+PARTITION_NAME TABLE_ROWS
+p0 6
+p-2000 4
+p-2011-MSK 0
+p-2011-MSD-1 11
+p-2011-MSD-2 9
+p-2012-MSK-1 0
+p-2012-MSK-2 4
+pEnd 2
+pMax 0
+SELECT * FROM t2 ORDER BY a, tz;
+a tz
+NULL Moscow
+NULL Moscow
+NULL Moscow
+NULL Moscow
+NULL UTC
+NULL UTC
+1970-01-01 03:00:01 Moscow
+1970-01-01 03:00:01 UTC
+1974-02-05 21:28:16 Moscow
+1974-02-06 00:28:16 UTC
+2011-03-27 03:00:00 Moscow
+2011-03-27 03:00:00 Moscow
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 MoscowI
+2011-03-27 03:00:00 UTC
+2011-03-27 03:00:00 UTC
+2011-03-27 03:00:01 Moscow
+2011-03-27 03:00:01 UTC
+2011-10-30 01:59:59 Moscow
+2011-10-30 01:59:59 UTC
+2011-10-30 02:00:00 MoscowD
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:00 UTC
+2011-10-30 02:00:01 MoscowD
+2011-10-30 02:00:01 UTC
+2011-10-30 02:00:01 UTC
+2011-10-30 02:59:59 MoscowD
+2011-10-30 02:59:59 UTC
+2011-10-30 02:59:59 UTC
+2011-10-30 03:00:00 Moscow
+2011-10-30 03:00:00 UTC
+2011-10-30 03:00:01 Moscow
+2011-10-30 03:00:01 UTC
+2038-01-19 06:14:06 Moscow
+2038-01-19 06:14:06 UTC
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` timestamp NULL DEFAULT NULL,
+ `tz` varchar(16) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (UNIX_TIMESTAMP(a))
+(PARTITION p0 VALUES LESS THAN (0) ENGINE = MyISAM,
+ PARTITION `p-2000` VALUES LESS THAN (946684800) ENGINE = MyISAM,
+ PARTITION `p-2011-MSK` VALUES LESS THAN (1301180400) ENGINE = MyISAM,
+ PARTITION `p-2011-MSD-1` VALUES LESS THAN (1319925600) ENGINE = MyISAM,
+ PARTITION `p-2011-MSD-2` VALUES LESS THAN (1319929200) ENGINE = MyISAM,
+ PARTITION `p-2012-MSK-1` VALUES LESS THAN (1319932800) ENGINE = MyISAM,
+ PARTITION `p-2012-MSK-2` VALUES LESS THAN (1332630000) ENGINE = MyISAM,
+ PARTITION pEnd VALUES LESS THAN (2147483647) ENGINE = MyISAM,
+ PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+TRUNCATE TABLE t2;
+DROP TABLE t1, t2;
+SET @@session.time_zone= @old_time_zone;
diff --git a/mysql-test/r/partition_debug_sync.result b/mysql-test/r/partition_debug_sync.result
index 0e3241cf88e..6b8c8e48acc 100644
--- a/mysql-test/r/partition_debug_sync.result
+++ b/mysql-test/r/partition_debug_sync.result
@@ -25,7 +25,7 @@ ALTER TABLE t1 REMOVE PARTITIONING;
# Con default
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning';
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_alter';
-SET DEBUG_SYNC= 'rm_table_part2_before_delete_table WAIT_FOR partitioning_removed';
+SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table WAIT_FOR partitioning_removed';
DROP TABLE IF EXISTS t1;
# Con 1
SET SESSION debug= "-d,sleep_before_create_table_no_lock";
@@ -51,12 +51,12 @@ SET DEBUG_SYNC= 'alter_table_before_open_tables SIGNAL removing_partitions WAIT_
SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done';
ALTER TABLE t2 REMOVE PARTITIONING;
# Con default
-SET SESSION debug= "+d,sleep_before_part2_delete_table";
+SET SESSION debug= "+d,sleep_before_no_locks_delete_table";
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
-SET DEBUG_SYNC= 'rm_table_part2_before_delete_table SIGNAL waiting_for_alter';
-SET DEBUG_SYNC= 'rm_table_part2_before_binlog SIGNAL delete_done';
+SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter';
+SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done';
DROP TABLE IF EXISTS t2;
-SET SESSION debug= "-d,sleep_before_part2_delete_table";
+SET SESSION debug= "-d,sleep_before_no_locks_delete_table";
# Con 1
ERROR 42S02: Table 'test.t2' doesn't exist
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result
index 8fe16fd7afb..252a6b4386a 100644
--- a/mysql-test/r/partition_error.result
+++ b/mysql-test/r/partition_error.result
@@ -1,20 +1,717 @@
-drop table if exists t1;
+drop table if exists t1, t2;
#
-# Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
+# Bug#57924: crash when creating partitioned table with
+# multiple columns in the partition key
#
-CREATE TABLE t1 (a INT) PARTITION BY HASH (a);
-FLUSH TABLES;
-CHECK TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 check Error Failed to read from the .par file
-test.t1 check Error Incorrect information in file: './test/t1.frm'
-test.t1 check error Corrupt
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
+PARTITION BY KEY(a, b, a);
+ERROR HY000: Duplicate partition field name 'a'
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
+PARTITION BY KEY(A, b);
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
+PARTITION BY KEY(a, b, A);
+ERROR HY000: Duplicate partition field name 'a'
+#
+# Bug#54483: valgrind errors when making warnings for multiline inserts
+# into partition
+#
+CREATE TABLE t1 (a VARBINARY(10))
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a CHAR(10))
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIMESTAMP)
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+INSERT INTO t1 VALUES ('test'),('a'),('5');
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 2
+Warning 1265 Data truncated for column 'a' at row 3
+SHOW WARNINGS;
+Level Code Message
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 2
+Warning 1265 Data truncated for column 'a' at row 3
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+INSERT INTO t1 VALUES ('test'),('a'),('5');
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+Warning 1264 Out of range value for column 'a' at row 2
+Warning 1264 Out of range value for column 'a' at row 3
+SHOW WARNINGS;
+Level Code Message
+Warning 1264 Out of range value for column 'a' at row 1
+Warning 1264 Out of range value for column 'a' at row 2
+Warning 1264 Out of range value for column 'a' at row 3
+DROP TABLE t1;
+CREATE TABLE t1 (a TIME)
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+SHOW WARNINGS;
+Level Code Message
+Error 1486 Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (TO_DAYS(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (TO_DAYS(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (TO_DAYS(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (TO_DAYS(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (TO_DAYS(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (DAYOFMONTH(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (DAYOFMONTH(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (DAYOFMONTH(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (DAYOFMONTH(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (DAYOFMONTH(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (MONTH(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (MONTH(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (MONTH(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (MONTH(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (MONTH(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (DAYOFYEAR(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (DAYOFYEAR(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (DAYOFYEAR(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (DAYOFYEAR(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (DAYOFYEAR(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (HOUR(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (HOUR(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (HOUR(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (HOUR(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (HOUR(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (MINUTE(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (MINUTE(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (MINUTE(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (MINUTE(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (MINUTE(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (QUARTER(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (QUARTER(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (QUARTER(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (QUARTER(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (QUARTER(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (SECOND(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (SECOND(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (SECOND(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (SECOND(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (SECOND(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (YEARWEEK(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (YEARWEEK(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (YEARWEEK(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (YEARWEEK(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (YEARWEEK(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (WEEKDAY(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (WEEKDAY(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (WEEKDAY(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (WEEKDAY(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (WEEKDAY(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+# TO_SECONDS() is added in 5.5.
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (TO_SECONDS(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (TO_SECONDS(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (TO_SECONDS(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (TO_SECONDS(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (TO_SECONDS(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (TIME_TO_SEC(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (TIME_TO_SEC(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (TIME_TO_SEC(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (TIME_TO_SEC(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (TIME_TO_SEC(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (FROM_DAYS(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (FROM_DAYS(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (FROM_DAYS(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (TO_DAYS(FROM_DAYS(a)));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (FROM_DAYS(a));
+ERROR HY000: The PARTITION function returns the wrong type
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (TO_DAYS(FROM_DAYS(a)));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (FROM_DAYS(a));
+ERROR HY000: The PARTITION function returns the wrong type
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (MICROSECOND(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (MICROSECOND(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (MICROSECOND(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (MICROSECOND(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (MICROSECOND(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+# Bug#57071
+CREATE TABLE t1
+(`date` date,
+`extracted_week` int,
+`yearweek` int,
+`week` int,
+`default_week_format` int)
+PARTITION BY LIST (EXTRACT(WEEK FROM date) % 3)
+(PARTITION p0 VALUES IN (0),
+PARTITION p1 VALUES IN (1),
+PARTITION p2 VALUES IN (2));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1
+(`date` date,
+`extracted_week` int,
+`yearweek` int,
+`week` int,
+`default_week_format` int);
+SET @old_default_week_format := @@default_week_format;
+SET default_week_format = 0;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 1;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 2;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 3;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 4;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 5;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 6;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 7;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
SELECT * FROM t1;
-ERROR HY000: Failed to read from the .par file
-# Note that it is currently impossible to drop a partitioned table
-# without the .par file
+date extracted_week yearweek week default_week_format
+2000-01-01 0 199952 0 0
+2000-01-01 0 199952 0 1
+2000-01-01 52 199952 52 2
+2000-01-01 52 199952 52 3
+2000-01-01 0 199952 0 4
+2000-01-01 0 199952 0 5
+2000-01-01 52 199952 52 6
+2000-01-01 52 199952 52 7
+SET default_week_format = @old_default_week_format;
+DROP TABLE t1;
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(YEAR FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(YEAR FROM a));
DROP TABLE t1;
-ERROR 42S02: Unknown table 't1'
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(YEAR FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(YEAR FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(YEAR FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(QUARTER FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(QUARTER FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(QUARTER FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(QUARTER FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(QUARTER FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(MONTH FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(MONTH FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(MONTH FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(MONTH FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(MONTH FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+# EXTRACT(WEEK...) is disallowed, see bug#57071.
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(WEEK FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(WEEK FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(WEEK FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(WEEK FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(WEEK FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(DAY FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(DAY FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(DAY FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(DAY FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(DAY FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(HOUR FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(HOUR FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(HOUR FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(HOUR FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(HOUR FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(MINUTE FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(MINUTE FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(MINUTE FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(MINUTE FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(MINUTE FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(SECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(SECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(SECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(SECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(SECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME, b DATE)
+PARTITION BY HASH (DATEDIFF(a, b));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATE, b DATETIME)
+PARTITION BY HASH (DATEDIFF(a, b));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME, b DATE)
+PARTITION BY HASH (DATEDIFF(a, b));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE, b VARCHAR(10))
+PARTITION BY HASH (DATEDIFF(a, b));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT, b DATETIME)
+PARTITION BY HASH (DATEDIFF(a, b));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (TIME_TO_SEC(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (TIME_TO_SEC(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (TIME_TO_SEC(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (TIME_TO_SEC(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (TIME_TO_SEC(a));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+#
+# Bug#50036: Inconsistent errors when using TIMESTAMP
+# columns/expressions
+# 1. correct and appropriate errors in light of
+# the fix for BUG#42849:
+CREATE TABLE t1 (c TIMESTAMP)
+PARTITION BY RANGE (TO_DAYS(c))
+(PARTITION p0 VALUES LESS THAN (10000),
+PARTITION p1 VALUES LESS THAN (MAXVALUE));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t2 (c TIMESTAMP);
+ALTER TABLE t2
+PARTITION BY RANGE (TO_DAYS(c))
+(PARTITION p0 VALUES LESS THAN (10000),
+PARTITION p1 VALUES LESS THAN (MAXVALUE));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+CREATE TABLE t1 (c TIMESTAMP)
+PARTITION BY RANGE COLUMNS(c)
+(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
+PARTITION p1 VALUES LESS THAN (MAXVALUE));
+ERROR HY000: Field 'c' is of a not allowed type for this type of partitioning
+ALTER TABLE t2 PARTITION BY RANGE COLUMNS(c)
+(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
+PARTITION p1 VALUES LESS THAN (MAXVALUE));
+ERROR HY000: Field 'c' is of a not allowed type for this type of partitioning
+DROP TABLE t2;
+# 2. These errors where questionable before the fix:
+# VALUES clause are checked first, clearified the error message.
+CREATE TABLE t1 (c TIMESTAMP)
+PARTITION BY RANGE (c)
+(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
+PARTITION p1 VALUES LESS THAN (MAXVALUE));
+ERROR HY000: VALUES value for partition 'p0' must have type INT
+# TIMESTAMP is not INT (e.g. UNIX_TIMESTAMP).
+CREATE TABLE t1 (c TIMESTAMP)
+PARTITION BY RANGE (UNIX_TIMESTAMP(c))
+(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
+PARTITION p1 VALUES LESS THAN (MAXVALUE));
+ERROR HY000: VALUES value for partition 'p0' must have type INT
+CREATE TABLE t1 (c TIMESTAMP)
+PARTITION BY RANGE (UNIX_TIMESTAMP(c))
+(PARTITION p0 VALUES LESS THAN (UNIX_TIMESTAMP('2000-01-01 00:00:00')),
+PARTITION p1 VALUES LESS THAN (MAXVALUE));
+DROP TABLE t1;
+# Changed error from ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
+CREATE TABLE t1 (c TIMESTAMP)
+PARTITION BY HASH (c) PARTITIONS 4;
+ERROR HY000: Field 'c' is of a not allowed type for this type of partitioning
+# Moved to partition_myisam, since it was MyISAM specific
+# Added test with existing TIMESTAMP partitioning (when it was allowed).
#
# Bug#49477: Assertion `0' failed in ha_partition.cc:5530
# with temporary table and partitions
@@ -47,10 +744,10 @@ Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL,
`purchased` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=<curr_engine> DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (YEAR(purchased))
SUBPARTITION BY HASH (TO_DAYS(purchased))
-(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = <curr_engine>) */
DROP TABLE t1;
CREATE TABLE t1 (id INT, purchased DATE)
PARTITION BY RANGE(YEAR(purchased))
@@ -68,12 +765,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL,
`purchased` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=<curr_engine> DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (YEAR(purchased))
SUBPARTITION BY HASH (TO_DAYS(purchased))
(PARTITION p0 VALUES LESS THAN MAXVALUE
- (SUBPARTITION sp0 ENGINE = MyISAM,
- SUBPARTITION sp1 ENGINE = MyISAM)) */
+ (SUBPARTITION sp0 ENGINE = <curr_engine>,
+ SUBPARTITION sp1 ENGINE = <curr_engine>)) */
DROP TABLE t1;
CREATE TABLE t1 (id INT, purchased DATE)
PARTITION BY RANGE(YEAR(purchased))
@@ -88,53 +785,11 @@ Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL,
`purchased` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=<curr_engine> DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (YEAR(purchased))
-(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = <curr_engine>) */
DROP TABLE t1;
SET @@sql_mode= @org_mode;
-#
-# Bug#50392: insert_id is not reset for partitioned tables
-# auto_increment on duplicate entry
-CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);
-SET INSERT_ID= 13;
-INSERT INTO t1 VALUES (NULL);
-SET INSERT_ID= 12;
-INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
-ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1
-INSERT INTO t1 VALUES (NULL);
-SELECT * FROM t1;
-a
-12
-13
-14
-DROP TABLE t1;
-CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) PARTITION BY KEY(a);
-SET INSERT_ID= 13;
-INSERT INTO t1 VALUES (NULL);
-SET INSERT_ID= 12;
-INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
-ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a) */
-INSERT INTO t1 VALUES (NULL);
-SELECT * FROM t1;
-a
-12
-13
-14
-DROP TABLE t1;
CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a));
INSERT INTO t1 VALUES (1),(1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
@@ -144,19 +799,6 @@ PARTITION BY KEY (a) PARTITIONS 2;
INSERT INTO t1 VALUES (1),(1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
DROP TABLE t1;
-CREATE TABLE t1 (a INT)
-PARTITION BY HASH (a)
-( PARTITION p0 ENGINE=MyISAM,
-PARTITION p1);
-ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
-CREATE TABLE t1 (a INT)
-PARTITION BY LIST (a)
-SUBPARTITION BY HASH (a)
-( PARTITION p0 VALUES IN (0)
-( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2),
-PARTITION p1 VALUES IN (1)
-( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM));
-ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
CREATE TABLE t1 (
a int
)
@@ -497,7 +1139,7 @@ partition by range (a)
partitions 2
(partition x1 values less than (4.0) tablespace ts1,
partition x2 values less than (8) tablespace ts2);
-ERROR HY000: VALUES value must be of same type as partition function
+ERROR HY000: VALUES value for partition 'x1' must have type INT
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -736,7 +1378,7 @@ partition by list (a)
partitions 2
(partition x1 values in (4.0, 12+8),
partition x2 values in (3, 21));
-ERROR HY000: VALUES value must be of same type as partition function
+ERROR HY000: VALUES value for partition 'x1' must have type INT
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -796,12 +1438,12 @@ CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
PARTITION BY RANGE (a) (
PARTITION p VALUES LESS THAN (20080819),
PARTITION pmax VALUES LESS THAN MAXVALUE);
-ERROR HY000: The PARTITION function returns the wrong type
+ERROR HY000: Field 'a' is of a not allowed type for this type of partitioning
ALTER TABLE old
PARTITION BY RANGE (a) (
PARTITION p VALUES LESS THAN (20080819),
PARTITION pmax VALUES LESS THAN MAXVALUE);
-ERROR HY000: The PARTITION function returns the wrong type
+ERROR HY000: Field 'a' is of a not allowed type for this type of partitioning
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
PARTITION BY RANGE (a+0) (
PARTITION p VALUES LESS THAN (20080819),
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index bbd69083038..da2f59f375e 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -1,12 +1,38 @@
+set global default_storage_engine='innodb';
+set session default_storage_engine='innodb';
drop table if exists t1, t2;
#
+# Bug#56287: crash when using Partition datetime in sub in query
+#
+CREATE TABLE t1
+(c1 bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+c2 varchar(40) not null default '',
+c3 datetime not NULL,
+PRIMARY KEY (c1,c3),
+KEY partidx(c3))
+ENGINE=InnoDB
+PARTITION BY RANGE (TO_DAYS(c3))
+(PARTITION p200912 VALUES LESS THAN (to_days('2010-01-01')),
+PARTITION p201103 VALUES LESS THAN (to_days('2011-04-01')),
+PARTITION p201912 VALUES LESS THAN MAXVALUE);
+insert into t1(c2,c3) values ("Test row",'2010-01-01 00:00:00');
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
+PARTITION_NAME TABLE_ROWS
+p200912 0
+p201103 1
+p201912 0
+SELECT count(*) FROM t1 p where c3 in
+(select c3 from t1 t where t.c3 < date '2011-04-26 19:19:44'
+ and t.c3 > date '2011-04-26 19:18:44') ;
+count(*)
+0
+DROP TABLE t1;
+#
# Bug#54747: Deadlock between REORGANIZE PARTITION and
# SELECT is not detected
#
SET @old_innodb_thread_concurrency:= @@innodb_thread_concurrency;
SET GLOBAL innodb_thread_concurrency = 1;
-set global default_storage_engine='innodb';
-set session default_storage_engine='innodb';
CREATE TABLE t1
(user_num BIGINT,
hours SMALLINT,
@@ -491,4 +517,32 @@ Warning 1265 Data truncated for column 'b' at row 1
Error 1067 Invalid default value for 'b'
SET SESSION sql_mode = @old_mode;
DROP TABLE t1;
+#
+# Bug#57985 "ONLINE/FAST ALTER PARTITION can fail and leave the
+# table unusable".
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a bigint not null, b int not null, PRIMARY KEY (a))
+ENGINE = InnoDB PARTITION BY KEY(a) PARTITIONS 2;
+INSERT INTO t1 values (0,1), (1,2);
+# The below ALTER should fail. It should leave the
+# table in its original, non-corrupted, usable state.
+ALTER TABLE t1 ADD UNIQUE KEY (b);
+ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
+# The below statements should succeed, as ALTER should
+# have left table intact.
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) NOT NULL,
+ `b` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 2 */
+SELECT * FROM t1;
+a b
+1 2
+0 1
+DROP TABLE t1;
set global default_storage_engine=default;
diff --git a/mysql-test/r/partition_innodb_plugin.result b/mysql-test/r/partition_innodb_plugin.result
index dd91eee316a..aa0944e96b5 100644
--- a/mysql-test/r/partition_innodb_plugin.result
+++ b/mysql-test/r/partition_innodb_plugin.result
@@ -1,3 +1,76 @@
+call mtr.add_suppression("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB internal");
+#
+# Bug#55091: Server crashes on ADD PARTITION after a failed attempt
+#
+SET @old_innodb_file_format_max = @@global.innodb_file_format_max;
+SET @old_innodb_file_format = @@global.innodb_file_format;
+SET @old_innodb_file_per_table = @@global.innodb_file_per_table;
+SET @old_innodb_strict_mode = @@global.innodb_strict_mode;
+SET @@global.innodb_file_format = Barracuda,
+@@global.innodb_file_per_table = ON,
+@@global.innodb_strict_mode = ON;
+# Connection con1
+CREATE TABLE t1 (id INT NOT NULL
+PRIMARY KEY,
+user_num CHAR(10)
+) ENGINE = InnoDB
+KEY_BLOCK_SIZE=4
+PARTITION BY HASH(id) PARTITIONS 1;
+t1#P#p0.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `user_num` char(10) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=4
+/*!50100 PARTITION BY HASH (id)
+PARTITIONS 1 */
+SET GLOBAL innodb_file_per_table = OFF;
+# Connection con2
+LOCK TABLE t1 WRITE;
+# ALTER fails because COMPRESSED/KEY_BLOCK_SIZE
+# are incompatible with innodb_file_per_table = OFF;
+ALTER TABLE t1 ADD PARTITION PARTITIONS 1;
+ERROR HY000: Got error 1478 from storage engine
+t1#P#p0.ibd
+t1.frm
+t1.par
+# This SET is not needed to reproduce the bug,
+# it is here just to make the test case more realistic
+SET innodb_strict_mode = OFF;
+ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
+Warnings:
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
+t1.frm
+t1.par
+ALTER TABLE t1 REBUILD PARTITION p0;
+Warnings:
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
+UNLOCK TABLES;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `user_num` char(10) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=4
+/*!50100 PARTITION BY HASH (id)
+PARTITIONS 3 */
+DROP TABLE t1;
+# Connection default
+SET @@global.innodb_strict_mode = @old_innodb_strict_mode;
+SET @@global.innodb_file_format = @old_innodb_file_format;
+SET @@global.innodb_file_per_table = @old_innodb_file_per_table;
+SET @@global.innodb_file_format_max = @old_innodb_file_format_max;
SET NAMES utf8;
CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
ENGINE=InnoDB
diff --git a/mysql-test/r/partition_myisam.result b/mysql-test/r/partition_myisam.result
new file mode 100644
index 00000000000..97bcc11495c
--- /dev/null
+++ b/mysql-test/r/partition_myisam.result
@@ -0,0 +1,250 @@
+DROP TABLE IF EXISTS t1, t2;
+#
+# Bug#50036: Inconsistent errors when using TIMESTAMP
+# columns/expressions
+# Added test with existing TIMESTAMP partitioning (when it was allowed).
+CREATE TABLE t1 (a TIMESTAMP)
+ENGINE = MyISAM
+PARTITION BY HASH (UNIX_TIMESTAMP(a));
+INSERT INTO t1 VALUES ('2000-01-02 03:04:05');
+SELECT * FROM t1;
+a
+2000-01-02 03:04:05
+FLUSH TABLES;
+# replacing t1.frm with TO_DAYS(a) which was allowed earlier.
+# Disable warnings, since the result would differ when running with
+# --ps-protocol (only for the 'SELECT * FROM t1' statement).
+SELECT * FROM t1;
+a
+2000-01-02 03:04:05
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=<curr_engine> DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (TO_DAYS(a)) */
+INSERT INTO t1 VALUES ('2001-02-03 04:05:06');
+SELECT * FROM t1;
+a
+2000-01-02 03:04:05
+2001-02-03 04:05:06
+ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
+Warnings:
+Warning 1486 Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+ALTER TABLE t1
+PARTITION BY RANGE (TO_DAYS(a))
+(PARTITION p0 VALUES LESS THAN (10000),
+PARTITION p1 VALUES LESS THAN (MAXVALUE));
+ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (TO_DAYS(a))
+PARTITIONS 3 */
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (TO_DAYS(a))
+PARTITIONS 3 */
+Warnings:
+Warning 1486 Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
+DROP TABLE t2;
+CREATE TABLE t2 SELECT * FROM t1;
+DROP TABLE t2;
+ALTER TABLE t1 PARTITION BY HASH (UNIX_TIMESTAMP(a));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (UNIX_TIMESTAMP(a)) */
+ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (UNIX_TIMESTAMP(a))
+PARTITIONS 3 */
+SELECT * FROM t1;
+a
+2000-01-02 03:04:05
+2001-02-03 04:05:06
+DROP TABLE t1;
+#
+# Bug#31931: Mix of handlers error message
+#
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (a)
+( PARTITION p0 ENGINE=MyISAM,
+PARTITION p1);
+ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
+CREATE TABLE t1 (a INT)
+PARTITION BY LIST (a)
+SUBPARTITION BY HASH (a)
+( PARTITION p0 VALUES IN (0)
+( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2),
+PARTITION p1 VALUES IN (1)
+( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM));
+ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
+#
+# Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
+#
+CREATE TABLE t1 (a INT)
+ENGINE = MyISAM
+PARTITION BY HASH (a);
+FLUSH TABLES;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check Error Failed to read from the .par file
+test.t1 check Error Incorrect information in file: './test/t1.frm'
+test.t1 check error Corrupt
+SELECT * FROM t1;
+ERROR HY000: Failed to read from the .par file
+# Note that it is currently impossible to drop a partitioned table
+# without the .par file
+DROP TABLE t1;
+ERROR 42S02: Unknown table 't1'
+#
+# Bug#50392: insert_id is not reset for partitioned tables
+# auto_increment on duplicate entry
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY)
+ENGINE = MyISAM;
+SET INSERT_ID= 13;
+INSERT INTO t1 VALUES (NULL);
+SET INSERT_ID= 12;
+# For transactional engines, 12 will not be inserted, since the failing
+# statement is rolled back.
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (NULL);
+# NOTE: 12 exists only in non transactional engines!
+SELECT * FROM t1;
+a
+12
+13
+14
+DROP TABLE t1;
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY)
+ENGINE = MyISAM
+PARTITION BY KEY(a);
+SET INSERT_ID= 13;
+INSERT INTO t1 VALUES (NULL);
+SET INSERT_ID= 12;
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY KEY (a) */
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1;
+a
+12
+13
+14
+DROP TABLE t1;
+# Bug#30102 test
+CREATE TABLE t1 (a INT)
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (6),
+PARTITION `p1....................` VALUES LESS THAN (9),
+PARTITION p2 VALUES LESS THAN MAXVALUE);
+# List of files in database `test`, all original t1-files here
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
+t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1.frm
+t1.par
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+# Renaming to a file name where the first partition is 250 chars
+# and the second partition is 350 chars
+RENAME TABLE t1 TO `t2_new..............................................end`;
+Got one of the listed errors
+# List of files in database `test`, should not be any t2-files here
+# List of files in database `test`, should be all t1-files here
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
+t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1.frm
+t1.par
+SELECT * FROM t1;
+a
+1
+10
+2
+3
+4
+5
+6
+7
+8
+9
+# List of files in database `test`, should be all t1-files here
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
+t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1.frm
+t1.par
+# Renaming to a file name where the first partition is 156 chars
+# and the second partition is 256 chars
+RENAME TABLE t1 TO `t2_............................_end`;
+Got one of the listed errors
+# List of files in database `test`, should not be any t2-files here
+# List of files in database `test`, should be all t1-files here
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
+t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1.frm
+t1.par
+SELECT * FROM t1;
+a
+1
+10
+2
+3
+4
+5
+6
+7
+8
+9
+DROP TABLE t1;
+# Should not be any files left here
+# End of bug#30102 test.
+# Test of post-push fix for bug#11766249/59316
+CREATE TABLE t1 (a INT, b VARCHAR(255), PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (0) MAX_ROWS=100,
+PARTITION p1 VALUES LESS THAN (100) MAX_ROWS=100,
+PARTITION pMax VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (1, "Partition p1, first row");
+DROP TABLE t1;
diff --git a/mysql-test/r/partition_not_embedded.result b/mysql-test/r/partition_not_embedded.result
deleted file mode 100644
index c942189a956..00000000000
--- a/mysql-test/r/partition_not_embedded.result
+++ /dev/null
@@ -1,81 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-# Bug#30102 test
-CREATE TABLE t1 (a INT)
-PARTITION BY RANGE (a)
-(PARTITION p0 VALUES LESS THAN (6),
-PARTITION `p1....................` VALUES LESS THAN (9),
-PARTITION p2 VALUES LESS THAN MAXVALUE);
-# List of files in database `test`, all original t1-files here
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
-t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1.frm
-t1.par
-INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
-# Renaming to a file name where the first partition is 250 chars
-# and the second partition is 350 chars
-RENAME TABLE t1 TO `t2_new..............................................end`;
-Got one of the listed errors
-# List of files in database `test`, should not be any t2-files here
-# List of files in database `test`, should be all t1-files here
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
-t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1.frm
-t1.par
-SELECT * FROM t1;
-a
-1
-10
-2
-3
-4
-5
-6
-7
-8
-9
-# List of files in database `test`, should be all t1-files here
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
-t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1.frm
-t1.par
-# Renaming to a file name where the first partition is 156 chars
-# and the second partition is 256 chars
-RENAME TABLE t1 TO `t2_............................_end`;
-Got one of the listed errors
-# List of files in database `test`, should not be any t2-files here
-# List of files in database `test`, should be all t1-files here
-t1#P#p0.MYD
-t1#P#p0.MYI
-t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYD
-t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.MYI
-t1#P#p2.MYD
-t1#P#p2.MYI
-t1.frm
-t1.par
-SELECT * FROM t1;
-a
-1
-10
-2
-3
-4
-5
-6
-7
-8
-9
-DROP TABLE t1;
-# Should not be any files left here
-# End of bug#30102 test.
diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result
index 4280158dd16..339f2209cb3 100644
--- a/mysql-test/r/partition_range.result
+++ b/mysql-test/r/partition_range.result
@@ -13,16 +13,16 @@ EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100, 3) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 4 Using where; Using index
DROP TABLE t1;
-create table t1 (a int)
-partition by range (a)
+create table t1 (a DATETIME)
+partition by range (TO_DAYS(a))
subpartition by hash(to_seconds(a))
(partition p0 values less than (1));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL
+ `a` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50500 PARTITION BY RANGE (a)
+/*!50500 PARTITION BY RANGE (TO_DAYS(a))
SUBPARTITION BY HASH (to_seconds(a))
(PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM) */
drop table t1;
diff --git a/mysql-test/r/partition_symlink.result b/mysql-test/r/partition_symlink.result
index 60184d11d9c..f26a1642a52 100644
--- a/mysql-test/r/partition_symlink.result
+++ b/mysql-test/r/partition_symlink.result
@@ -6,11 +6,12 @@ DROP DATABASE IF EXISTS mysqltest2;
CREATE USER mysqltest_1@localhost;
CREATE DATABASE mysqltest2;
USE mysqltest2;
-CREATE TABLE t1 (a INT);
+CREATE TABLE t1 (a INT) ENGINE = MyISAM;
INSERT INTO t1 VALUES (0);
# user mysqltest_1:
USE test;
CREATE TABLE t1 (a INT)
+ENGINE = MyISAM
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
@@ -47,6 +48,7 @@ DROP DATABASE mysqltest2;
CREATE DATABASE mysqltest2;
USE mysqltest2;
CREATE TABLE t1 (a INT)
+ENGINE = MyISAM
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
@@ -58,6 +60,7 @@ DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
# user mysqltest_1:
USE test;
CREATE TABLE t1 (a INT)
+ENGINE = MyISAM
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
@@ -68,6 +71,7 @@ DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
);
Got one of the listed errors
CREATE TABLE t1 (a INT)
+ENGINE = MyISAM
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
@@ -82,6 +86,7 @@ DROP DATABASE mysqltest2;
USE test;
DROP USER mysqltest_1@localhost;
create table t2 (i int )
+ENGINE = MyISAM
partition by range (i)
(
partition p01 values less than (1000)
@@ -94,6 +99,7 @@ select @@sql_mode;
@@sql_mode
NO_DIR_IN_CREATE
create table t1 (i int )
+ENGINE = MyISAM
partition by range (i)
(
partition p01 values less than (1000)
@@ -113,10 +119,12 @@ t2 CREATE TABLE `t2` (
DROP TABLE t1, t2;
set @@sql_mode=@org_mode;
create table t1 (a int)
+ENGINE = MyISAM
partition by key (a)
(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
Got one of the listed errors
create table t1 (a int)
+ENGINE = MyISAM
partition by key (a)
(partition p0,
partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result
new file mode 100644
index 00000000000..91a5d2d8478
--- /dev/null
+++ b/mysql-test/r/plugin_auth.result
@@ -0,0 +1,450 @@
+SELECT PLUGIN_STATUS, PLUGIN_TYPE, PLUGIN_DESCRIPTION
+FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='test_plugin_server';
+PLUGIN_STATUS ACTIVE
+PLUGIN_TYPE AUTHENTICATION
+PLUGIN_DESCRIPTION plugin API test plugin
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+SELECT plugin,authentication_string FROM mysql.user WHERE User='plug';
+plugin authentication_string
+test_plugin_server plug_dest
+## test plugin auth
+ERROR 28000: Access denied for user 'plug'@'localhost' (using password: YES)
+GRANT PROXY ON plug_dest TO plug;
+test proxies_priv columns
+SELECT * FROM mysql.proxies_priv;
+Host User Proxied_host Proxied_user With_grant Grantor Timestamp
+xx root 1 xx
+xx root 1 xx
+xx plug % plug_dest 0 root@localhost xx
+test mysql.proxies_priv;
+SHOW CREATE TABLE mysql.proxies_priv;
+Table Create Table
+proxies_priv CREATE TABLE `proxies_priv` (
+ `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
+ `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
+ `Proxied_host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
+ `Proxied_user` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
+ `With_grant` tinyint(1) NOT NULL DEFAULT '0',
+ `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
+ `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`),
+ KEY `Grantor` (`Grantor`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges'
+select USER(),CURRENT_USER();
+USER() CURRENT_USER()
+plug@localhost plug_dest@%
+## test SET PASSWORD
+SET PASSWORD = PASSWORD('plug_dest');
+Warnings:
+Note 1699 SET PASSWORD has no significance for users authenticating via plugins
+## test bad credentials
+ERROR 28000: Access denied for user 'plug'@'localhost' (using password: YES)
+## test bad default plugin : should get CR_AUTH_PLUGIN_CANNOT_LOAD
+## test correct default plugin
+select USER(),CURRENT_USER();
+USER() CURRENT_USER()
+plug@localhost plug@%
+## test no_auto_create_user sql mode with plugin users
+SET @@sql_mode=no_auto_create_user;
+GRANT INSERT ON TEST.* TO grant_user IDENTIFIED WITH 'test_plugin_server';
+SET @@sql_mode=default;
+DROP USER grant_user;
+## test utf-8 user name
+CREATE USER `Ÿ` IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+GRANT PROXY ON plug_dest TO `Ÿ`;
+select USER(),CURRENT_USER();
+USER() CURRENT_USER()
+Ÿ@localhost plug_dest@%
+DROP USER `Ÿ`;
+## test GRANT ... IDENTIFIED WITH/BY ...
+CREATE DATABASE test_grant_db;
+# create new user via GRANT WITH
+GRANT ALL PRIVILEGES ON test_grant_db.* TO new_grant_user
+IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+GRANT PROXY ON plug_dest TO new_grant_user;
+select USER(),CURRENT_USER();
+USER() CURRENT_USER()
+new_grant_user@localhost plug_dest@%
+USE test_grant_db;
+CREATE TABLE t1 (a INT);
+DROP TABLE t1;
+REVOKE ALL PRIVILEGES ON test_grant_db.* FROM new_grant_user;
+# try re-create existing user via GRANT IDENTIFIED BY
+GRANT ALL PRIVILEGES ON test_grant_db.* TO new_grant_user
+IDENTIFIED BY 'unused_password';
+# make sure password doesn't take precendence
+ERROR 28000: Access denied for user 'new_grant_user'@'localhost' (using password: YES)
+#make sure plugin auth still available
+select USER(),CURRENT_USER();
+USER() CURRENT_USER()
+new_grant_user@localhost plug_dest@%
+USE test_grant_db;
+CREATE TABLE t1 (a INT);
+DROP TABLE t1;
+DROP USER new_grant_user;
+# try re-create existing user via GRANT IDENTIFIED WITH
+GRANT ALL PRIVILEGES ON test_grant_db.* TO plug
+IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+ERROR HY000: GRANT with IDENTIFIED WITH is illegal because the user plug already exists
+GRANT ALL PRIVILEGES ON test_grant_db.* TO plug_dest
+IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+ERROR HY000: GRANT with IDENTIFIED WITH is illegal because the user plug_dest already exists
+REVOKE SELECT on test_grant_db.* FROM joro
+INDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'' at line 2
+REVOKE SELECT on test_grant_db.* FROM joro
+INDENTIFIED BY 'plug_dest_passwd';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INDENTIFIED BY 'plug_dest_passwd'' at line 2
+REVOKE SELECT on test_grant_db.* FROM joro
+INDENTIFIED BY PASSWORD 'plug_dest_passwd';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INDENTIFIED BY PASSWORD 'plug_dest_passwd'' at line 2
+DROP DATABASE test_grant_db;
+## GRANT PROXY tests
+CREATE USER grant_plug IDENTIFIED WITH 'test_plugin_server'
+AS 'grant_plug_dest';
+CREATE USER grant_plug_dest IDENTIFIED BY 'grant_plug_dest_passwd';
+CREATE USER grant_plug_dest2 IDENTIFIED BY 'grant_plug_dest_passwd2';
+# ALL PRIVILEGES doesn't include PROXY
+GRANT ALL PRIVILEGES ON *.* TO grant_plug;
+ERROR 28000: Access denied for user 'grant_plug'@'localhost' (using password: YES)
+GRANT ALL PRIVILEGES,PROXY ON grant_plug_dest TO grant_plug;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PROXY ON grant_plug_dest TO grant_plug' at line 1
+this should fail : can't combine PROXY
+GRANT ALL SELECT,PROXY ON grant_plug_dest TO grant_plug;
+ERROR 42000: You 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,PROXY ON grant_plug_dest TO grant_plug' at line 1
+# this should fail : no such grant
+REVOKE PROXY ON grant_plug_dest FROM grant_plug;
+ERROR 42000: There is no such grant defined for user 'grant_plug' on host '%'
+in grant_plug_dest_con
+## testing what an ordinary user can grant
+this should fail : no rights to grant all
+GRANT PROXY ON ''@'' TO grant_plug;
+ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
+this should fail : not the same user
+GRANT PROXY ON grant_plug TO grant_plug_dest;
+ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
+this should fail : same user, but on a different host
+GRANT PROXY ON grant_plug_dest TO grant_plug;
+ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
+this should work : same user
+GRANT PROXY ON grant_plug_dest@localhost TO grant_plug_dest2;
+REVOKE PROXY ON grant_plug_dest@localhost FROM grant_plug_dest2;
+this should work : same user
+GRANT PROXY ON grant_plug_dest@localhost TO grant_plug WITH GRANT OPTION;
+REVOKE PROXY ON grant_plug_dest@localhost FROM grant_plug;
+this should fail : can't create users
+GRANT PROXY ON grant_plug_dest@localhost TO grant_plug@localhost;
+ERROR 42000: You are not allowed to create a user with GRANT
+in default connection
+# test what root can grant
+should work : root has PROXY to all users
+GRANT PROXY ON ''@'' TO grant_plug;
+REVOKE PROXY ON ''@'' FROM grant_plug;
+should work : root has PROXY to all users
+GRANT PROXY ON ''@'' TO proxy_admin IDENTIFIED BY 'test'
+WITH GRANT OPTION;
+need USAGE : PROXY doesn't contain it.
+GRANT USAGE on *.* TO proxy_admin;
+in proxy_admin_con;
+should work : proxy_admin has proxy to ''@''
+GRANT PROXY ON future_user TO grant_plug;
+in default connection
+SHOW GRANTS FOR grant_plug;
+Grants for grant_plug@%
+GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' WITH GRANT OPTION
+GRANT PROXY ON 'future_user'@'%' TO 'grant_plug'@'%'
+REVOKE PROXY ON future_user FROM grant_plug;
+SHOW GRANTS FOR grant_plug;
+Grants for grant_plug@%
+GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' WITH GRANT OPTION
+## testing drop user
+CREATE USER test_drop@localhost;
+GRANT PROXY ON future_user TO test_drop@localhost;
+SHOW GRANTS FOR test_drop@localhost;
+Grants for test_drop@localhost
+GRANT USAGE ON *.* TO 'test_drop'@'localhost'
+GRANT PROXY ON 'future_user'@'%' TO 'test_drop'@'localhost'
+DROP USER test_drop@localhost;
+SELECT * FROM mysql.proxies_priv WHERE Host = 'test_drop' AND User = 'localhost';
+Host User Proxied_host Proxied_user With_grant Grantor Timestamp
+DROP USER proxy_admin;
+DROP USER grant_plug,grant_plug_dest,grant_plug_dest2;
+## END GRANT PROXY tests
+## cleanup
+DROP USER plug;
+DROP USER plug_dest;
+## @@proxy_user tests
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug;
+SELECT USER(),CURRENT_USER(),@@LOCAL.proxy_user;
+USER() CURRENT_USER() @@LOCAL.proxy_user
+root@localhost root@localhost NULL
+SELECT @@GLOBAL.proxy_user;
+ERROR HY000: Variable 'proxy_user' is a SESSION variable
+SELECT @@LOCAL.proxy_user;
+@@LOCAL.proxy_user
+NULL
+SET GLOBAL proxy_user = 'test';
+ERROR HY000: Variable 'proxy_user' is a read only variable
+SET LOCAL proxy_user = 'test';
+ERROR HY000: Variable 'proxy_user' is a read only variable
+SELECT @@LOCAL.proxy_user;
+@@LOCAL.proxy_user
+NULL
+# in connection plug_con
+SELECT @@LOCAL.proxy_user;
+@@LOCAL.proxy_user
+'plug'@'%'
+# in connection default
+## cleanup
+DROP USER plug;
+DROP USER plug_dest;
+## END @@proxy_user tests
+## @@external_user tests
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug;
+SELECT USER(),CURRENT_USER(),@@LOCAL.external_user;
+USER() CURRENT_USER() @@LOCAL.external_user
+root@localhost root@localhost NULL
+SELECT @@GLOBAL.external_user;
+ERROR HY000: Variable 'external_user' is a SESSION variable
+SELECT @@LOCAL.external_user;
+@@LOCAL.external_user
+NULL
+SET GLOBAL external_user = 'test';
+ERROR HY000: Variable 'external_user' is a read only variable
+SET LOCAL external_user = 'test';
+ERROR HY000: Variable 'external_user' is a read only variable
+SELECT @@LOCAL.external_user;
+@@LOCAL.external_user
+NULL
+# in connection plug_con
+SELECT @@LOCAL.external_user;
+@@LOCAL.external_user
+'plug'@'%'
+# in connection default
+## cleanup
+DROP USER plug;
+DROP USER plug_dest;
+## END @@external_user tests
+#
+# Bug #56798 : Wrong credentials assigned when using a proxy user.
+#
+GRANT ALL PRIVILEGES ON *.* TO power_user;
+GRANT USAGE ON anonymous_db.* TO ''@''
+ IDENTIFIED WITH 'test_plugin_server' AS 'power_user';
+GRANT PROXY ON power_user TO ''@'';
+CREATE DATABASE confidential_db;
+SELECT user(),current_user(),@@proxy_user;
+user() current_user() @@proxy_user
+test_login_user@localhost power_user@% ''@''
+DROP USER power_user;
+DROP USER ''@'';
+DROP DATABASE confidential_db;
+# Test case #2 (crash with double grant proxy)
+CREATE USER ''@'' IDENTIFIED WITH 'test_plugin_server' AS 'standard_user';
+CREATE USER standard_user;
+CREATE DATABASE shared;
+GRANT ALL PRIVILEGES ON shared.* TO standard_user;
+GRANT PROXY ON standard_user TO ''@'';
+#should not crash
+GRANT PROXY ON standard_user TO ''@'';
+DROP USER ''@'';
+DROP USER standard_user;
+DROP DATABASE shared;
+#
+# Bug #57551 : Live upgrade fails between 5.1.52 -> 5.5.7-rc
+#
+CALL mtr.add_suppression("Missing system table mysql.proxies_priv.");
+DROP TABLE mysql.proxies_priv;
+# Must come back with mysql.proxies_priv absent.
+SELECT * FROM mysql.proxies_priv;
+ERROR 42S02: Table 'mysql.proxies_priv' doesn't exist
+CREATE USER u1@localhost;
+GRANT ALL PRIVILEGES ON *.* TO u1@localhost;
+REVOKE ALL PRIVILEGES ON *.* FROM u1@localhost;
+GRANT ALL PRIVILEGES ON *.* TO u1@localhost;
+CREATE USER u2@localhost;
+GRANT ALL PRIVILEGES ON *.* TO u2@localhost;
+# access denied because of no privileges to root
+GRANT PROXY ON u2@localhost TO u1@localhost;
+ERROR 28000: Access denied for user 'root'@'localhost'
+# access denied because of no privileges to root
+REVOKE PROXY ON u2@localhost FROM u1@localhost;
+ERROR 28000: Access denied for user 'root'@'localhost'
+# go try graning proxy on itself, so that it will need the table
+GRANT PROXY ON u2@localhost TO u1@localhost;
+ERROR 42S02: Table 'mysql.proxies_priv' doesn't exist
+REVOKE PROXY ON u2@localhost FROM u1@localhost;
+ERROR 42S02: Table 'mysql.proxies_priv' doesn't exist
+# test if REVOKE works without the proxies_priv table
+REVOKE ALL PRIVILEGES ON *.* FROM u1@localhost, u2@localhost;
+# test if DROP USER work without the proxies_priv table
+DROP USER u1@localhost,u2@localhost;
+# test if FLUSH PRIVILEGES works without the proxies_priv table
+FLUSH PRIVILEGES;
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.general_log 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 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
+SELECT Host,User,Proxied_host,Proxied_user,With_grant FROM mysql.proxies_priv;
+Host localhost
+User root
+Proxied_host
+Proxied_user
+With_grant 1
+FLUSH PRIVILEGES;
+#
+# Bug#58139 : default-auth option not recognized in MySQL standard
+# command line clients
+#
+# Executing 'mysql'
+1
+1
+# Executing 'mysqladmin'
+mysqld is alive
+# Executing 'mysqldump'
+# Executing 'mysql_upgrade'
+The --upgrade-system-tables option was used, databases won't be touched.
+#
+# Bug #59657: Move the client authentication_pam plugin into the
+# server repository
+#
+CREATE USER uplain@localhost IDENTIFIED WITH 'cleartext_plugin_server'
+ AS 'cleartext_test';
+## test plugin auth
+ERROR 28000: Access denied for user 'uplain'@'localhost' (using password: YES)
+select USER(),CURRENT_USER();
+USER() CURRENT_USER()
+uplain@localhost uplain@localhost
+DROP USER uplain@localhost;
+#
+# Bug #59038 : mysql.user.authentication_string column
+# causes configuration wizard to fail
+INSERT INTO mysql.user(
+Host,
+User,
+Password,
+Select_priv,
+Insert_priv,
+Update_priv,
+Delete_priv,
+Create_priv,
+Drop_priv,
+Reload_priv,
+Shutdown_priv,
+Process_priv,
+File_priv,
+Grant_priv,
+References_priv,
+Index_priv,
+Alter_priv,
+Show_db_priv,
+Super_priv,
+Create_tmp_table_priv,
+Lock_tables_priv,
+Execute_priv,
+Repl_slave_priv,
+Repl_client_priv,
+/*!50001
+Create_view_priv,
+Show_view_priv,
+Create_routine_priv,
+Alter_routine_priv,
+Create_user_priv,
+*/
+ssl_type,
+ssl_cipher,
+x509_issuer,
+x509_subject,
+max_questions,
+max_updates,
+max_connections)
+VALUES (
+'localhost',
+'inserttest', '',
+'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
+'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
+/*!50001 'Y', 'Y', 'Y', 'Y', 'Y', */'', '', '', '', '0', '0', '0');
+FLUSH PRIVILEGES;
+DROP USER inserttest@localhost;
+SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE
+COLUMN_NAME IN ('authentication_string', 'plugin') AND
+TABLE_NAME='user' AND
+TABLE_SCHEMA='mysql'
+ORDER BY COLUMN_NAME;
+IS_NULLABLE COLUMN_NAME
+YES authentication_string
+YES plugin
+#
+# Bug #11936829: diff. between mysql.user (authentication_string)
+# in fresh and upgraded 5.5.11
+#
+SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
+WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND
+COLUMN_NAME IN ('plugin', 'authentication_string')
+ORDER BY COLUMN_NAME;
+IS_NULLABLE COLUMN_NAME
+YES authentication_string
+YES plugin
+ALTER TABLE mysql.user MODIFY plugin char(64) DEFAULT '' NOT NULL;
+ALTER TABLE mysql.user MODIFY authentication_string TEXT NOT NULL;
+Run mysql_upgrade on a 5.5.10 external authentication column layout
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.event OK
+mysql.func OK
+mysql.general_log 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.proxies_priv OK
+mysql.servers OK
+mysql.slow_log 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
+SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
+WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND
+COLUMN_NAME IN ('plugin', 'authentication_string')
+ORDER BY COLUMN_NAME;
+IS_NULLABLE COLUMN_NAME
+YES authentication_string
+YES plugin
+End of 5.5 tests
diff --git a/mysql-test/r/plugin_auth_qa.result b/mysql-test/r/plugin_auth_qa.result
new file mode 100644
index 00000000000..d1128cf04ee
--- /dev/null
+++ b/mysql-test/r/plugin_auth_qa.result
@@ -0,0 +1,327 @@
+CREATE DATABASE test_user_db;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+========== test 1.1 ======================================================
+CREATE USER plug IDENTIFIED WITH test_plugin_server;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server
+DROP USER plug;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server
+REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug;
+DROP USER plug;
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server
+DROP USER plug;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server
+REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug;
+DROP USER plug;
+CREATE USER plug IDENTIFIED WITH test_plugin_server AS '';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server
+DROP USER plug;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS '';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server
+REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug;
+DROP USER plug;
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS ;
+ERROR 42000: You 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
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS;
+ERROR 42000: You 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 USER plug IDENTIFIED WITH test_plugin_server AS plug_dest;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'plug_dest' at line 1
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS plug_dest;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'plug_dest' at line 1
+========== test 1.1 syntax errors ========================================
+CREATE USER plug IDENTIFIED WITH AS plug_dest;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS plug_dest' at line 1
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH AS plug_dest;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS plug_dest' at line 1
+CREATE USER plug IDENTIFIED WITH;
+ERROR 42000: You 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
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH;
+ERROR 42000: You 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 USER plug IDENTIFIED AS '';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS ''' at line 1
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED AS '';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS ''' at line 1
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' IDENTIFIED WITH 'test_plugin_server';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED WITH 'test_plugin_server'' at line 1
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug
+IDENTIFIED WITH 'test_plugin_server' IDENTIFIED WITH 'test_plugin_server';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED WITH 'test_plugin_server'' at line 2
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS '' AS 'plug_dest';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS 'plug_dest'' at line 1
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug AS '' AS 'plug_dest';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS '' AS 'plug_dest'' at line 1
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS ''
+IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED WITH test_plugin_server AS 'plug_dest'' at line 2
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS ''
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED WITH test_plugin_server AS 'plug_dest'' at line 2
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'
+IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'' at line 2
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd'
+ IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'' at line 2
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
+USER plug_dest IDENTIFIED by 'plug_dest_pwd';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USER plug_dest IDENTIFIED by 'plug_dest_pwd'' at line 2
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
+ USER plug_dest IDENTIFIED by 'plug_dest_pwd';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USER plug_dest IDENTIFIED by 'plug_dest_pwd'' at line 2
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
+plug_dest IDENTIFIED by 'plug_dest_pwd';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'plug_dest IDENTIFIED by 'plug_dest_pwd'' at line 2
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
+ plug_dest IDENTIFIED by 'plug_dest_pwd';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'plug_dest IDENTIFIED by 'plug_dest_pwd'' at line 2
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
+IDENTIFIED by 'plug_dest_pwd';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED by 'plug_dest_pwd'' at line 2
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
+ IDENTIFIED by 'plug_dest_pwd';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED by 'plug_dest_pwd'' at line 2
+========== test 1.1 combinations ==========================
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+========== test 1.1.1.6/1.1.2.5 ============================
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server plug_dest
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server plug_dest
+plug_dest NULL
+DROP USER plug, plug_dest;
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server plug_dest
+DROP USER plug;
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug_dest NULL
+DROP USER plug_dest;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server plug_dest
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server plug_dest
+plug_dest NULL
+DROP USER plug, plug_dest;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server plug_dest
+DROP USER plug;
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug_dest NULL
+DROP USER plug_dest;
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server plug_dest
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server plug_dest
+plug_dest NULL
+DROP USER plug, plug_dest;
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server plug_dest
+DROP USER plug;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug_dest NULL
+DROP USER plug_dest;
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+ERROR HY000: GRANT with IDENTIFIED WITH is illegal because the user plug already exists
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server';
+ERROR HY000: GRANT with IDENTIFIED WITH is illegal because the user plug already exists
+DROP USER plug;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+ERROR HY000: Operation CREATE USER failed for 'plug'@'%'
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server';
+ERROR HY000: Operation CREATE USER failed for 'plug'@'%'
+DROP USER plug;
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+user plugin authentication_string password
+plug test_plugin_server plug_dest
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+user plugin authentication_string password
+plug test_plugin_server plug_dest *939AEE68989794C0F408277411C26055CDF41119
+DROP USER plug;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug IDENTIFIED BY 'plug_dest_passwd';
+ERROR HY000: Operation CREATE USER failed for 'plug'@'%'
+DROP USER plug;
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+user plugin authentication_string password
+plug test_plugin_server plug_dest
+plug_dest test_plugin_server plug_dest
+DROP USER plug,plug_dest;
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+user plugin authentication_string password
+plug test_plugin_server plug_dest
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest
+IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+user plugin authentication_string password
+plug test_plugin_server plug_dest
+plug_dest test_plugin_server plug_dest
+DROP USER plug,plug_dest;
+========== test 1.1.1.1/1.1.2.1/1.1.1.5 ====================
+SET NAMES utf8;
+CREATE USER plüg IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plüg test_plugin_server plüg_dest
+DROP USER plüg;
+CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plüg_dest NULL
+DROP USER plüg_dest;
+SET NAMES ascii;
+CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+pl??g test_plugin_server pl??g_dest
+DROP USER 'plüg';
+CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+pl??g_dest NULL
+DROP USER 'plüg_dest';
+SET NAMES latin1;
+========== test 1.1.1.5 ====================================
+CREATE USER 'plüg' IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest';
+ERROR HY000: Plugin 'test_plügin_server' is not loaded
+CREATE USER 'plug' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server plüg_dest
+DROP USER 'plug';
+CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plüg_dest NULL
+DROP USER 'plüg_dest';
+SET NAMES utf8;
+CREATE USER plüg IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest';
+ERROR HY000: Plugin 'test_plügin_server' is not loaded
+CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plüg test_plugin_server plüg_dest
+DROP USER 'plüg';
+CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plüg_dest NULL
+DROP USER 'plüg_dest';
+CREATE USER plüg IDENTIFIED WITH test_plugin_server AS 'plüg_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plüg test_plugin_server plüg_dest
+DROP USER plüg;
+CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plüg_dest NULL
+DROP USER plüg_dest;
+========== test 1.1.1.2/1.1.2.2=============================
+SET @auth_name= 'test_plugin_server';
+CREATE USER plug IDENTIFIED WITH @auth_name AS 'plug_dest';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@auth_name AS 'plug_dest'' at line 1
+SET @auth_string= 'plug_dest';
+CREATE USER plug IDENTIFIED WITH test_plugin_server AS @auth_string;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@auth_string' at line 1
+========== test 1.1.1.3/1.1.2.3=============================
+CREATE USER plug IDENTIFIED WITH 'hh''s_test_plugin_server' AS 'plug_dest';
+ERROR HY000: Plugin 'hh's_test_plugin_server' is not loaded
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'hh''s_plug_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug test_plugin_server hh's_plug_dest
+DROP USER plug;
+CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+hh's_plug_dest NULL
+DROP USER 'hh''s_plug_dest';
+========== test 1.1.1.4 ====================================
+CREATE USER plug IDENTIFIED WITH hh''s_test_plugin_server AS 'plug_dest';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''s_test_plugin_server AS 'plug_dest'' at line 1
+========== test 1.1.3.1 ====================================
+GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+grant_user test_plugin_server plug_dest
+CREATE USER plug_dest;
+DROP USER plug_dest;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+grant_user test_plugin_server plug_dest
+plug_dest NULL
+DROP USER grant_user,plug_dest;
+set @save_sql_mode= @@sql_mode;
+SET @@sql_mode=no_auto_create_user;
+GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+grant_user test_plugin_server plug_dest
+CREATE USER plug_dest;
+DROP USER plug_dest;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest;
+ERROR 42000: Can't find any matching row in the user table
+DROP USER grant_user;
+GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+grant_user test_plugin_server plug_dest
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+user plugin authentication_string password
+grant_user test_plugin_server plug_dest
+plug_dest NULL *939AEE68989794C0F408277411C26055CDF41119
+DROP USER plug_dest;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_user_passwd';
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+user plugin authentication_string password
+grant_user test_plugin_server plug_dest
+plug_dest NULL *560881EB651416CEF77314D07D55EDCD5FC1BD6D
+DROP USER grant_user,plug_dest;
+set @@sql_mode= @save_sql_mode;
+DROP DATABASE test_user_db;
diff --git a/mysql-test/r/plugin_auth_qa_1.result b/mysql-test/r/plugin_auth_qa_1.result
new file mode 100644
index 00000000000..51c7260d9ae
--- /dev/null
+++ b/mysql-test/r/plugin_auth_qa_1.result
@@ -0,0 +1,335 @@
+CREATE DATABASE test_user_db;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+========== test 1.1.3.2 ====================================
+CREATE USER plug_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug_user;
+current_user()
+plug_dest@%
+user()
+plug_user@localhost
+Tables_in_test_user_db
+t1
+REVOKE PROXY ON plug_dest FROM plug_user;
+ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
+DROP USER plug_user,plug_dest;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user
+IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug_user;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug_dest NULL
+plug_user test_plugin_server plug_dest
+1)
+current_user()
+plug_dest@%
+user()
+plug_user@localhost
+Tables_in_test_user_db
+t1
+REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_user'
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+2)
+current_user()
+plug_dest@%
+user()
+plug_user@localhost
+Tables_in_test_user_db
+t1
+REVOKE PROXY ON plug_dest FROM plug_user;
+3)
+ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
+DROP USER plug_user,plug_dest;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user
+IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+1)
+ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
+GRANT PROXY ON plug_dest TO plug_user;
+2)
+current_user()
+plug_dest@%
+user()
+plug_user@localhost
+Tables_in_test_user_db
+t1
+REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_user'
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+DROP USER plug_user,plug_dest;
+========== test 1.2 ========================================
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user
+IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug_user;
+current_user()
+plug_dest@%
+user()
+plug_user@localhost
+RENAME USER plug_dest TO new_dest;
+ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
+GRANT PROXY ON new_dest TO plug_user;
+ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+new_dest NULL
+plug_user test_plugin_server plug_dest
+DROP USER plug_user,new_dest;
+CREATE USER plug_user
+IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
+GRANT PROXY ON plug_dest TO plug_user;
+current_user()
+plug_dest@%
+user()
+plug_user@localhost
+RENAME USER plug_dest TO new_dest;
+ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
+GRANT PROXY ON new_dest TO plug_user;
+ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES)
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+new_dest NULL
+plug_user test_plugin_server plug_dest
+DROP USER plug_user,new_dest;
+CREATE USER plug_user
+IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug_user;
+connect(plug_user,localhost,plug_user,plug_dest);
+select USER(),CURRENT_USER();
+USER() CURRENT_USER()
+plug_user@localhost plug_dest@%
+connection default;
+disconnect plug_user;
+RENAME USER plug_user TO new_user;
+connect(plug_user,localhost,new_user,plug_dest);
+select USER(),CURRENT_USER();
+USER() CURRENT_USER()
+new_user@localhost plug_dest@%
+connection default;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+new_user test_plugin_server plug_dest
+plug_dest NULL
+disconnect plug_user;
+UPDATE mysql.user SET user='plug_user' WHERE user='new_user';
+FLUSH PRIVILEGES;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug_dest NULL
+plug_user test_plugin_server plug_dest
+DROP USER plug_dest,plug_user;
+========== test 1.3 ========================================
+CREATE USER plug_user
+IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug_user;
+connect(plug_user,localhost,plug_user,plug_dest);
+select USER(),CURRENT_USER();
+USER() CURRENT_USER()
+plug_user@localhost plug_dest@%
+connection default;
+disconnect plug_user;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+plug_dest NULL
+plug_user test_plugin_server plug_dest
+UPDATE mysql.user SET user='new_user' WHERE user='plug_user';
+FLUSH PRIVILEGES;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+new_user test_plugin_server plug_dest
+plug_dest NULL
+UPDATE mysql.user SET authentication_string='new_dest' WHERE user='new_user';
+FLUSH PRIVILEGES;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+new_user test_plugin_server new_dest
+plug_dest NULL
+UPDATE mysql.user SET plugin='new_plugin_server' WHERE user='new_user';
+FLUSH PRIVILEGES;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+new_user new_plugin_server new_dest
+plug_dest NULL
+connect(plug_user,localhost,new_user,new_dest);
+ERROR HY000: Plugin 'new_plugin_server' is not loaded
+UPDATE mysql.user SET plugin='test_plugin_server' WHERE user='new_user';
+UPDATE mysql.user SET USER='new_dest' WHERE user='plug_dest';
+FLUSH PRIVILEGES;
+GRANT PROXY ON new_dest TO new_user;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+new_dest NULL
+new_user test_plugin_server new_dest
+connect(plug_user,localhost,new_user,new_dest);
+select USER(),CURRENT_USER();
+USER() CURRENT_USER()
+new_user@localhost new_dest@%
+connection default;
+disconnect plug_user;
+UPDATE mysql.user SET USER='plug_dest' WHERE user='new_dest';
+FLUSH PRIVILEGES;
+CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+new_dest NULL
+new_user test_plugin_server new_dest
+plug_dest NULL
+GRANT ALL PRIVILEGES ON test.* TO new_user;
+connect(plug_user,localhost,new_dest,new_dest_passwd);
+select USER(),CURRENT_USER();
+USER() CURRENT_USER()
+new_dest@localhost new_dest@%
+connection default;
+disconnect plug_user;
+DROP USER new_user,new_dest,plug_dest;
+========== test 2, 2.1, 2.2 ================================
+CREATE USER ''@'' IDENTIFIED WITH test_plugin_server AS 'proxied_user';
+CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+ test_plugin_server proxied_user
+proxied_user NULL
+connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+proxied_user@localhost proxied_user@%
+========== test 2.2.1 ======================================
+SELECT @@proxy_user;
+@@proxy_user
+NULL
+connection default;
+disconnect proxy_con;
+connect(proxy_con,localhost,proxy_user,proxied_user);
+ERROR 28000: Access denied for user 'proxy_user'@'localhost' (using password: YES)
+GRANT PROXY ON proxied_user TO ''@'';
+connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+proxied_user@localhost proxied_user@%
+connection default;
+disconnect proxy_con;
+connect(proxy_con,localhost,proxy_user,proxied_user);
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+proxy_user@localhost proxied_user@%
+========== test 2.2.1 ======================================
+SELECT @@proxy_user;
+@@proxy_user
+''@''
+connection default;
+disconnect proxy_con;
+DROP USER ''@'',proxied_user;
+GRANT ALL PRIVILEGES ON test_user_db.* TO ''@''
+IDENTIFIED WITH test_plugin_server AS 'proxied_user';
+CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+ test_plugin_server proxied_user
+proxied_user NULL
+connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+proxied_user@localhost proxied_user@%
+SELECT @@proxy_user;
+@@proxy_user
+NULL
+connection default;
+disconnect proxy_con;
+connect(proxy_con,localhost,proxy_user,proxied_user);
+ERROR 28000: Access denied for user 'proxy_user'@'localhost' (using password: YES)
+GRANT PROXY ON proxied_user TO ''@'';
+connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+proxied_user@localhost proxied_user@%
+connection default;
+disconnect proxy_con;
+connect(proxy_con,localhost,proxy_user,proxied_user);
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+proxy_user@localhost proxied_user@%
+SELECT @@proxy_user;
+@@proxy_user
+''@''
+connection default;
+disconnect proxy_con;
+DROP USER ''@'',proxied_user;
+CREATE USER ''@'' IDENTIFIED WITH test_plugin_server AS 'proxied_user';
+CREATE USER proxied_user_1 IDENTIFIED BY 'proxied_user_1_pwd';
+CREATE USER proxied_user_2 IDENTIFIED BY 'proxied_user_2_pwd';
+CREATE USER proxied_user_3 IDENTIFIED BY 'proxied_user_3_pwd';
+CREATE USER proxied_user_4 IDENTIFIED BY 'proxied_user_4_pwd';
+CREATE USER proxied_user_5 IDENTIFIED BY 'proxied_user_5_pwd';
+GRANT PROXY ON proxied_user_1 TO ''@'';
+GRANT PROXY ON proxied_user_2 TO ''@'';
+GRANT PROXY ON proxied_user_3 TO ''@'';
+GRANT PROXY ON proxied_user_4 TO ''@'';
+GRANT PROXY ON proxied_user_5 TO ''@'';
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+ test_plugin_server proxied_user
+proxied_user_1 NULL
+proxied_user_2 NULL
+proxied_user_3 NULL
+proxied_user_4 NULL
+proxied_user_5 NULL
+connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd');
+connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd);
+connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd);
+connect(proxy_con_4,localhost,proxied_user_4,proxied_user_4_pwd);
+connect(proxy_con_5,localhost,proxied_user_5,proxied_user_5_pwd);
+connection proxy_con_1;
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+proxied_user_1@localhost proxied_user_1@%
+SELECT @@proxy_user;
+@@proxy_user
+NULL
+connection proxy_con_2;
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+proxied_user_2@localhost proxied_user_2@%
+SELECT @@proxy_user;
+@@proxy_user
+NULL
+connection proxy_con_3;
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+proxied_user_3@localhost proxied_user_3@%
+SELECT @@proxy_user;
+@@proxy_user
+NULL
+connection proxy_con_4;
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+proxied_user_4@localhost proxied_user_4@%
+SELECT @@proxy_user;
+@@proxy_user
+NULL
+connection proxy_con_5;
+SELECT USER(),CURRENT_USER();
+USER() CURRENT_USER()
+proxied_user_5@localhost proxied_user_5@%
+SELECT @@proxy_user;
+@@proxy_user
+NULL
+connection default;
+disconnect proxy_con_1;
+disconnect proxy_con_2;
+disconnect proxy_con_3;
+disconnect proxy_con_4;
+disconnect proxy_con_5;
+DROP USER ''@'',proxied_user_1,proxied_user_2,proxied_user_3,proxied_user_4,proxied_user_5;
+========== test 3 ==========================================
+GRANT ALL PRIVILEGES ON *.* TO plug_user
+IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug_user;
+FLUSH PRIVILEGES;
+DROP USER plug_user, plug_dest;
+DROP DATABASE test_user_db;
diff --git a/mysql-test/r/plugin_auth_qa_2.result b/mysql-test/r/plugin_auth_qa_2.result
new file mode 100644
index 00000000000..f4706e5aa0b
--- /dev/null
+++ b/mysql-test/r/plugin_auth_qa_2.result
@@ -0,0 +1,150 @@
+CREATE DATABASE test_user_db;
+========== test 1.1.3.2 ====================================
+=== check contens of components of info ====================
+CREATE USER qa_test_1_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_1_dest';
+CREATE USER qa_test_1_dest IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_1_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_1_dest TO qa_test_1_user;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+qa_test_1_dest NULL
+qa_test_1_user qa_auth_interface qa_test_1_dest
+SELECT @@proxy_user;
+@@proxy_user
+NULL
+SELECT @@external_user;
+@@external_user
+NULL
+exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_1_user --password=qa_test_1_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+current_user() user() @@local.proxy_user @@local.external_user
+qa_test_1_user@% qa_test_1_user@localhost NULL NULL
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+qa_test_1_dest NULL
+qa_test_1_user qa_auth_interface qa_test_1_dest
+DROP USER qa_test_1_user;
+DROP USER qa_test_1_dest;
+=== Assign values to components of info ====================
+CREATE USER qa_test_2_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_2_dest';
+CREATE USER qa_test_2_dest IDENTIFIED BY 'dest_passwd';
+CREATE USER authenticated_as IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_2_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_2_dest TO qa_test_2_user;
+GRANT PROXY ON authenticated_as TO qa_test_2_user;
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+authenticated_as NULL
+qa_test_2_dest NULL
+qa_test_2_user qa_auth_interface qa_test_2_dest
+SELECT @@proxy_user;
+@@proxy_user
+NULL
+SELECT @@external_user;
+@@external_user
+NULL
+exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+current_user() user() @@local.proxy_user @@local.external_user
+authenticated_as@% user_name@localhost 'qa_test_2_user'@'%' 'qa_test_2_user'@'%'
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+user plugin authentication_string
+authenticated_as NULL
+qa_test_2_dest NULL
+qa_test_2_user qa_auth_interface qa_test_2_dest
+DROP USER qa_test_2_user;
+DROP USER qa_test_2_dest;
+DROP USER authenticated_as;
+=== Assign too high values for *length, which should have no effect ====
+CREATE USER qa_test_3_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_3_dest';
+CREATE USER qa_test_3_dest IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_3_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_3_dest TO qa_test_3_user;
+exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+current_user() user() @@local.proxy_user @@local.external_user
+qa_test_3_dest@% qa_test_3_user@localhost 'qa_test_3_user'@'%' 'qa_test_3_user'@'%'
+DROP USER qa_test_3_user;
+DROP USER qa_test_3_dest;
+=== Assign too low values for *length, which should have no effect ====
+CREATE USER qa_test_4_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_4_dest';
+CREATE USER qa_test_4_dest IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_4_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_4_dest TO qa_test_4_user;
+exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+current_user() user() @@local.proxy_user @@local.external_user
+qa_test_4_dest@% qa_test_4_user@localhost 'qa_test_4_user'@'%' 'qa_test_4_user'@'%'
+DROP USER qa_test_4_user;
+DROP USER qa_test_4_dest;
+=== Assign empty string especially to authenticated_as (in plugin) ====
+CREATE USER qa_test_5_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_5_dest';
+CREATE USER qa_test_5_dest IDENTIFIED BY 'dest_passwd';
+CREATE USER ''@'localhost' IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_5_dest identified by 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO ''@'localhost' identified by 'dest_passwd';
+GRANT PROXY ON qa_test_5_dest TO qa_test_5_user;
+GRANT PROXY ON qa_test_5_dest TO ''@'localhost';
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+user plugin authentication_string password
+ NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22
+qa_test_5_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22
+qa_test_5_user qa_auth_interface qa_test_5_dest
+exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+ERROR 1045 (28000): Access denied for user 'qa_test_5_user'@'localhost' (using password: YES)
+DROP USER qa_test_5_user;
+DROP USER qa_test_5_dest;
+DROP USER ''@'localhost';
+=== Assign 'root' especially to authenticated_as (in plugin) ====
+CREATE USER qa_test_6_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest';
+CREATE USER qa_test_6_dest IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_6_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_6_dest TO qa_test_6_user;
+SELECT user,plugin,authentication_string,password FROM mysql.user;
+user plugin authentication_string password
+qa_test_6_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22
+qa_test_6_user qa_auth_interface qa_test_6_dest
+root
+root
+root
+root
+exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+ERROR 1045 (28000): Access denied for user 'qa_test_6_user'@'localhost' (using password: YES)
+GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest';
+SELECT user,plugin,authentication_string,password FROM mysql.user;
+user plugin authentication_string password
+qa_test_6_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22
+qa_test_6_user qa_auth_interface qa_test_6_dest
+root
+root
+root
+root
+root qa_auth_interface qa_test_6_dest
+exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
+REVOKE PROXY ON qa_test_6_dest FROM root;
+SELECT user,plugin,authentication_string FROM mysql.user;
+user plugin authentication_string
+qa_test_6_dest NULL
+qa_test_6_user qa_auth_interface qa_test_6_dest
+root
+root
+root
+root
+root qa_auth_interface qa_test_6_dest
+exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
+DROP USER qa_test_6_user;
+DROP USER qa_test_6_dest;
+DELETE FROM mysql.user WHERE user='root' AND plugin='qa_auth_interface';
+SELECT user,plugin,authentication_string,password FROM mysql.user;
+user plugin authentication_string password
+root
+root
+root
+root
+=== Test of the --default_auth option for clients ====
+CREATE USER qa_test_11_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_11_dest';
+CREATE USER qa_test_11_dest IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_11_dest TO qa_test_11_user;
+exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+ERROR 1045 (28000): Access denied for user 'qa_test_11_user'@'localhost' (using password: YES)
+DROP USER qa_test_11_user, qa_test_11_dest;
+DROP DATABASE test_user_db;
diff --git a/mysql-test/r/plugin_auth_qa_3.result b/mysql-test/r/plugin_auth_qa_3.result
new file mode 100644
index 00000000000..d94d8879e7d
--- /dev/null
+++ b/mysql-test/r/plugin_auth_qa_3.result
@@ -0,0 +1,11 @@
+CREATE DATABASE test_user_db;
+CREATE USER qa_test_11_user IDENTIFIED WITH qa_auth_server AS 'qa_test_11_dest';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_11_dest TO qa_test_11_user;
+exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+current_user() user() @@local.proxy_user @@local.external_user
+qa_test_11_dest@% qa_test_11_user@localhost 'qa_test_11_user'@'%' 'qa_test_11_user'@'%'
+exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+ERROR 1045 (28000): Access denied for user 'qa_test_2_user'@'localhost' (using password: NO)
+DROP USER qa_test_11_user, qa_test_11_dest;
+DROP DATABASE test_user_db;
diff --git a/mysql-test/r/plugin_load_option.result b/mysql-test/r/plugin_load_option.result
new file mode 100644
index 00000000000..fec41bac8e6
--- /dev/null
+++ b/mysql-test/r/plugin_load_option.result
@@ -0,0 +1,7 @@
+UNINSTALL PLUGIN example;
+ERROR HY000: Plugin 'example' is force_plus_permanent and can not be unloaded
+SELECT PLUGIN_NAME, PLUGIN_STATUS, LOAD_OPTION FROM INFORMATION_SCHEMA.PLUGINS
+WHERE PLUGIN_NAME IN ('MyISAM', 'EXAMPLE');
+PLUGIN_NAME PLUGIN_STATUS LOAD_OPTION
+MyISAM ACTIVE FORCE
+EXAMPLE ACTIVE FORCE_PLUS_PERMANENT
diff --git a/mysql-test/r/plugin_not_embedded.result b/mysql-test/r/plugin_not_embedded.result
index 82cfe7b23b8..27553366660 100644
--- a/mysql-test/r/plugin_not_embedded.result
+++ b/mysql-test/r/plugin_not_embedded.result
@@ -8,3 +8,5 @@ ERROR 42000: DELETE command denied to user 'bug51770'@'localhost' for table 'plu
GRANT DELETE ON mysql.plugin TO bug51770@localhost;
UNINSTALL PLUGIN example;
DROP USER bug51770@localhost;
+INSTALL PLUGIN example SONAME '../ha_example.so';
+ERROR HY000: No paths allowed for shared library
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 48a995f1b10..fb6951f49fd 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -3046,6 +3046,7 @@ id select_type table type possible_keys key key_len ref rows Extra
3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+
End of 5.1 tests.
#
@@ -3204,6 +3205,510 @@ test1
DROP PROCEDURE p1;
DROP PROCEDURE p2;
+TINYINT
+
+CREATE PROCEDURE p1(OUT v TINYINT)
+SET v = 127;
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = 127;
+@a @a = 127
+127 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+SMALLINT
+
+CREATE PROCEDURE p1(OUT v SMALLINT)
+SET v = 32767;
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = 32767;
+@a @a = 32767
+32767 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+MEDIUMINT
+
+CREATE PROCEDURE p1(OUT v MEDIUMINT)
+SET v = 8388607;
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = 8388607;
+@a @a = 8388607
+8388607 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+INT
+
+CREATE PROCEDURE p1(OUT v INT)
+SET v = 2147483647;
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = 2147483647;
+@a @a = 2147483647
+2147483647 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+BIGINT
+
+CREATE PROCEDURE p1(OUT v BIGINT)
+SET v = 9223372036854775807;
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = 9223372036854775807;
+@a @a = 9223372036854775807
+9223372036854775807 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+BIT(11)
+
+CREATE PROCEDURE p1(OUT v BIT(11))
+SET v = b'10100100101';
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = b'10100100101';
+@a @a = b'10100100101'
+1317 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+TIMESTAMP
+
+CREATE PROCEDURE p1(OUT v TIMESTAMP)
+SET v = '2007-11-18 15:01:02';
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = '2007-11-18 15:01:02';
+@a @a = '2007-11-18 15:01:02'
+2007-11-18 15:01:02 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+DATETIME
+
+CREATE PROCEDURE p1(OUT v DATETIME)
+SET v = '1234-11-12 12:34:59';
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = '1234-11-12 12:34:59';
+@a @a = '1234-11-12 12:34:59'
+1234-11-12 12:34:59 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+TIME
+
+CREATE PROCEDURE p1(OUT v TIME)
+SET v = '123:45:01';
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = '123:45:01';
+@a @a = '123:45:01'
+123:45:01 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+DATE
+
+CREATE PROCEDURE p1(OUT v DATE)
+SET v = '1234-11-12';
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = '1234-11-12';
+@a @a = '1234-11-12'
+1234-11-12 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+YEAR
+
+CREATE PROCEDURE p1(OUT v YEAR)
+SET v = 2010;
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` bigint(20) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = 2010;
+@a @a = 2010
+2010 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+FLOAT(7, 4)
+
+CREATE PROCEDURE p1(OUT v FLOAT(7, 4))
+SET v = 123.4567;
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a - 123.4567 < 0.00001;
+@a @a - 123.4567 < 0.00001
+123.45670318603516 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+DOUBLE(8, 5)
+
+CREATE PROCEDURE p1(OUT v DOUBLE(8, 5))
+SET v = 123.45678;
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` double DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a - 123.45678 < 0.000001;
+@a @a - 123.45678 < 0.000001
+123.45678 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+DECIMAL(9, 6)
+
+CREATE PROCEDURE p1(OUT v DECIMAL(9, 6))
+SET v = 123.456789;
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` decimal(65,30) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = 123.456789;
+@a @a = 123.456789
+123.456789 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+CHAR(32)
+
+CREATE PROCEDURE p1(OUT v CHAR(32))
+SET v = REPEAT('a', 16);
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = REPEAT('a', 16);
+@a @a = REPEAT('a', 16)
+aaaaaaaaaaaaaaaa 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+VARCHAR(32)
+
+CREATE PROCEDURE p1(OUT v VARCHAR(32))
+SET v = REPEAT('b', 16);
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = REPEAT('b', 16);
+@a @a = REPEAT('b', 16)
+bbbbbbbbbbbbbbbb 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+TINYTEXT
+
+CREATE PROCEDURE p1(OUT v TINYTEXT)
+SET v = REPEAT('c', 16);
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = REPEAT('c', 16);
+@a @a = REPEAT('c', 16)
+cccccccccccccccc 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+TEXT
+
+CREATE PROCEDURE p1(OUT v TEXT)
+SET v = REPEAT('d', 16);
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = REPEAT('d', 16);
+@a @a = REPEAT('d', 16)
+dddddddddddddddd 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+MEDIUMTEXT
+
+CREATE PROCEDURE p1(OUT v MEDIUMTEXT)
+SET v = REPEAT('e', 16);
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = REPEAT('e', 16);
+@a @a = REPEAT('e', 16)
+eeeeeeeeeeeeeeee 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+LONGTEXT
+
+CREATE PROCEDURE p1(OUT v LONGTEXT)
+SET v = REPEAT('f', 16);
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = REPEAT('f', 16);
+@a @a = REPEAT('f', 16)
+ffffffffffffffff 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+BINARY(32)
+
+CREATE PROCEDURE p1(OUT v BINARY(32))
+SET v = REPEAT('g', 32);
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = REPEAT('g', 32);
+@a @a = REPEAT('g', 32)
+gggggggggggggggggggggggggggggggg 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+VARBINARY(32)
+
+CREATE PROCEDURE p1(OUT v VARBINARY(32))
+SET v = REPEAT('h', 16);
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = REPEAT('h', 16);
+@a @a = REPEAT('h', 16)
+hhhhhhhhhhhhhhhh 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+TINYBLOB
+
+CREATE PROCEDURE p1(OUT v TINYBLOB)
+SET v = REPEAT('i', 16);
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = REPEAT('i', 16);
+@a @a = REPEAT('i', 16)
+iiiiiiiiiiiiiiii 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+BLOB
+
+CREATE PROCEDURE p1(OUT v BLOB)
+SET v = REPEAT('j', 16);
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = REPEAT('j', 16);
+@a @a = REPEAT('j', 16)
+jjjjjjjjjjjjjjjj 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+MEDIUMBLOB
+
+CREATE PROCEDURE p1(OUT v MEDIUMBLOB)
+SET v = REPEAT('k', 16);
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = REPEAT('k', 16);
+@a @a = REPEAT('k', 16)
+kkkkkkkkkkkkkkkk 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+LONGBLOB
+
+CREATE PROCEDURE p1(OUT v LONGBLOB)
+SET v = REPEAT('l', 16);
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = REPEAT('l', 16);
+@a @a = REPEAT('l', 16)
+llllllllllllllll 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+SET('aaa', 'bbb')
+
+CREATE PROCEDURE p1(OUT v SET('aaa', 'bbb'))
+SET v = 'aaa';
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = 'aaa';
+@a @a = 'aaa'
+aaa 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+ENUM('aaa', 'bbb')
+
+CREATE PROCEDURE p1(OUT v ENUM('aaa', 'bbb'))
+SET v = 'aaa';
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+SHOW CREATE TABLE tmp1;
+Table Create Table
+tmp1 CREATE TEMPORARY TABLE `tmp1` (
+ `c1` longblob
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT @a, @a = 'aaa';
+@a @a = 'aaa'
+aaa 1
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
# End of WL#4435.
#
# WL#4284: Transactional DDL locking
@@ -3229,5 +3734,19 @@ CREATE TABLE t1 (a INT);
BEGIN;
PREPARE stmt1 FROM "SELECT * FROM t1";
DROP TABLE t1;
+
+#
+# Bug#56115: invalid memory reads when PS selecting from
+# information_schema tables
+# Bug#58701: crash in Field::make_field, cursor-protocol
+#
+# NOTE: MTR should be run both with --ps-protocol and --cursor-protocol.
+#
+
+SELECT *
+FROM (SELECT 1 UNION SELECT 2) t;
+1
+1
+2
#
-# End of 6.0 tests.
+# End of 5.5 tests.
diff --git a/mysql-test/r/query_cache_28249.result b/mysql-test/r/query_cache_28249.result
index aed84911032..72d713e8e70 100644
--- a/mysql-test/r/query_cache_28249.result
+++ b/mysql-test/r/query_cache_28249.result
@@ -8,7 +8,7 @@ SET @query_cache_size= @@global.query_cache_size;
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;
+SET GLOBAL query_cache_size= 102400;
FLUSH TABLES;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a INT);
@@ -23,10 +23,10 @@ SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
# Switch to connection user3
# Poll till the select of connection user1 is blocked by the write lock on t1.
SELECT user,command,state,info FROM information_schema.processlist
-WHERE state = 'Locked'
+WHERE state = 'Waiting for table metadata lock'
AND info = 'SELECT *, (SELECT COUNT(*) FROM t2) FROM t1';
user command state info
-root Query Locked SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
+root Query Waiting for table metadata lock SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
INSERT INTO t1 VALUES (4);
# Switch to connection user2
UNLOCK TABLES;
diff --git a/mysql-test/r/query_cache_debug.result b/mysql-test/r/query_cache_debug.result
index 80c21add075..ec78fe65802 100644
--- a/mysql-test/r/query_cache_debug.result
+++ b/mysql-test/r/query_cache_debug.result
@@ -5,20 +5,24 @@ drop table if exists t1;
create table t1 (a varchar(100));
insert into t1 values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
Activate debug hook and attempt to retrieve the statement from the cache.
-set session debug='+d,foobar,wait_in_query_cache_insert';
+set debug_sync="wait_in_query_cache_insert SIGNAL parked WAIT_FOR go";
select SQL_CACHE * from t1;;
+set debug_sync="now WAIT_FOR parked";
On a second connection; clear the query cache.
show status like 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 1
set global query_cache_size= 0;
Signal the debug hook to release the lock.
-select id from information_schema.processlist where state='wait_in_query_cache_insert' into @thread_id;
-kill query @thread_id;
+set debug_sync="now SIGNAL go";
Show query cache status.
show status like 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 0
+a
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+set debug_sync= 'RESET';
set global query_cache_size= 0;
use test;
drop table t1;
@@ -32,11 +36,12 @@ SET GLOBAL concurrent_insert= 1;
SET GLOBAL query_cache_size= 1024*512;
SET GLOBAL query_cache_type= ON;
# Switch to connection con1
-SET SESSION debug='+d,foobar,wait_after_query_cache_invalidate';
+SET DEBUG_SYNC = "wait_after_query_cache_invalidate SIGNAL parked WAIT_FOR go";
# Send concurrent insert, will wait in the query cache table invalidate
INSERT INTO t1 VALUES (4);
# Switch to connection default
# Wait for concurrent insert to reach the debug point
+SET DEBUG_SYNC = "now WAIT_FOR parked";
# Switch to connection con2
# Send SELECT that shouldn't be cached
SELECT * FROM t1;
@@ -46,9 +51,7 @@ a
3
# Switch to connection default
# Notify the concurrent insert to proceed
-SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
-WHERE STATE = 'wait_after_query_cache_invalidate' INTO @thread_id;
-KILL QUERY @thread_id;
+SET DEBUG_SYNC = "now SIGNAL go";
# Switch to connection con1
# Gather insert result
SHOW STATUS LIKE "Qcache_queries_in_cache";
@@ -66,6 +69,7 @@ Variable_name Value
Qcache_queries_in_cache 1
# Disconnect
# Restore defaults
+SET DEBUG_SYNC= 'RESET';
RESET QUERY CACHE;
DROP TABLE t1,t2;
SET GLOBAL concurrent_insert= DEFAULT;
@@ -108,43 +112,50 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
** before the mutex lock in invalidate_table_internal.
** This will allow new result sets to be written into the QC.
**
-SET SESSION debug='+d,foobar,wait_in_query_cache_invalidate1';
-SET SESSION debug='+d,foobar,wait_in_query_cache_invalidate2';
+SET DEBUG_SYNC="wait_in_query_cache_invalidate1 SIGNAL parked1_1 WAIT_FOR go1_1";
+SET DEBUG_SYNC="wait_in_query_cache_invalidate2 SIGNAL parked1_2 WAIT_FOR go1_2";
DELETE FROM t1 WHERE a like '%a%';;
=================================== Connection default
** Assert that the expect process status is obtained.
+SET DEBUG_SYNC="now WAIT_FOR parked1_1";
**
=================================== Connection thd2
** On THD2: Insert a result into the cache. This attempt will be blocked
** because of a debug hook placed just before the mutex lock after which
** the first part of the result set is written.
-SET SESSION debug='+d,foobar,wait_in_query_cache_insert';
+SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked2 WAIT_FOR go2 EXECUTE 1";
SELECT SQL_CACHE * FROM t2 UNION SELECT * FROM t3;
+=================================== Connection default
+** Assert that the SELECT-stmt thread reaches the sync point.
+SET DEBUG_SYNC="now WAIT_FOR parked2";
+**
+**
=================================== Connection thd3
** On THD3: Insert another result into the cache and block on the same
** debug hook.
-SET SESSION debug='+d,foobar,wait_in_query_cache_insert';
-SELECT SQL_CACHE * FROM t4 UNION SELECT * FROM t5;;
+SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked3 WAIT_FOR go3 EXECUTE 1";
+SELECT SQL_CACHE * FROM t4 UNION SELECT * FROM t5;
=================================== Connection default
-** Assert that the two SELECT-stmt threads to reach the hook.
+** Assert that the SELECT-stmt thread reaches the sync point.
+SET DEBUG_SYNC="now WAIT_FOR parked3";
**
**
** Signal the DELETE thread, THD1, to continue. It will enter the mutex
** lock and set query cache status to TABLE_FLUSH_IN_PROGRESS and then
** unlock the mutex before stopping on the next debug hook.
-SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_invalidate1' LIMIT 1 INTO @flush_thread_id;
-KILL QUERY @flush_thread_id;
+SET DEBUG_SYNC="now SIGNAL go1_1";
** Assert that we reach the next debug hook.
+SET DEBUG_SYNC="now WAIT_FOR parked1_2";
**
** Signal the remaining debug hooks blocking THD2 and THD3.
** The threads will grab the guard mutex enter the wait condition and
** and finally release the mutex. The threads will continue to wait
** until a broadcast signal reaches them causing both threads to
** come alive and check the condition.
-SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' ORDER BY id ASC LIMIT 1 INTO @thread_id;
-KILL QUERY @thread_id;
-SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' ORDER BY id DESC LIMIT 1 INTO @thread_id;
-KILL QUERY @thread_id;
+SET DEBUG_SYNC="now SIGNAL go2";
+** Wait for thd2 to receive the signal
+SET DEBUG_SYNC="now SIGNAL go3";
+** Wait for thd3 to receive the signal
**
** Finally signal the DELETE statement on THD1 one last time.
** The stmt will complete the query cache invalidation and return
@@ -152,8 +163,7 @@ KILL QUERY @thread_id;
** One signal will be sent to the thread group waiting for executing
** invalidations and a broadcast signal will be sent to the thread
** group holding result set writers.
-SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_invalidate2' LIMIT 1 INTO @flush_thread_id;
-KILL QUERY @flush_thread_id;
+SET DEBUG_SYNC="now SIGNAL go1_2";
**
*************************************************************************
** No tables should be locked
@@ -172,6 +182,7 @@ DELETE FROM t4;
DELETE FROM t5;
=================================== Connection thd1
** Done.
+SET DEBUG_SYNC= 'RESET';
SET GLOBAL query_cache_size= 0;
# Restore defaults
RESET QUERY CACHE;
@@ -179,3 +190,35 @@ FLUSH STATUS;
DROP TABLE t1,t2,t3,t4,t5;
SET GLOBAL query_cache_size= DEFAULT;
SET GLOBAL query_cache_type= DEFAULT;
+#
+# Bug#56822: Add a thread state for sessions waiting on the query cache lock
+#
+SET @old_query_cache_size= @@GLOBAL.query_cache_size;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+SET GLOBAL concurrent_insert= 1;
+SET GLOBAL query_cache_size= 1024*512;
+SET GLOBAL query_cache_type= ON;
+# Switch to connection con1
+SET DEBUG_SYNC = "wait_in_query_cache_invalidate2 SIGNAL parked WAIT_FOR go";
+# Send INSERT, will wait in the query cache table invalidation
+INSERT INTO t1 VALUES (4);;
+# Switch to connection default
+# Wait for insert to reach the debug point
+SET DEBUG_SYNC = "now WAIT_FOR parked";
+# Switch to connection con2
+# Send a query that should wait on the query cache lock
+RESET QUERY CACHE;
+# Switch to connection default
+# Wait for the state to be reflected in the processlist
+# Signal that the query cache can be unlocked
+SET DEBUG_SYNC="now SIGNAL go";
+# Reap con1 and disconnect
+# Reap con2 and disconnect
+# Restore defaults
+SET DEBUG_SYNC= 'RESET';
+RESET QUERY CACHE;
+DROP TABLE t1;
+SET GLOBAL query_cache_size= DEFAULT;
+SET GLOBAL query_cache_type= DEFAULT;
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 1b1ac169869..eff45844064 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -1666,4 +1666,105 @@ c_key c_notkey
1 1
3 3
DROP TABLE t1;
+#
+# Bug #57030: 'BETWEEN' evaluation is incorrect
+#
+CREATE TABLE t1(pk INT PRIMARY KEY, i4 INT);
+CREATE UNIQUE INDEX i4_uq ON t1(i4);
+INSERT INTO t1 VALUES (1,10), (2,20), (3,30);
+EXPLAIN
+SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const i4_uq i4_uq 5 const 1
+SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 10;
+pk i4
+1 10
+EXPLAIN
+SELECT * FROM t1 WHERE 10 BETWEEN i4 AND i4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const i4_uq i4_uq 5 const 1
+SELECT * FROM t1 WHERE 10 BETWEEN i4 AND i4;
+pk i4
+1 10
+EXPLAIN
+SELECT * FROM t1 WHERE 10 BETWEEN 10 AND i4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range i4_uq i4_uq 5 NULL 3 Using where
+SELECT * FROM t1 WHERE 10 BETWEEN 10 AND i4;
+pk i4
+1 10
+2 20
+3 30
+EXPLAIN
+SELECT * FROM t1 WHERE 10 BETWEEN i4 AND 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range i4_uq i4_uq 5 NULL 1 Using where
+SELECT * FROM t1 WHERE 10 BETWEEN i4 AND 10;
+pk i4
+1 10
+EXPLAIN
+SELECT * FROM t1 WHERE 10 BETWEEN 10 AND 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+SELECT * FROM t1 WHERE 10 BETWEEN 10 AND 10;
+pk i4
+1 10
+2 20
+3 30
+EXPLAIN
+SELECT * FROM t1 WHERE 10 BETWEEN 11 AND 11;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+SELECT * FROM t1 WHERE 10 BETWEEN 11 AND 11;
+pk i4
+EXPLAIN
+SELECT * FROM t1 WHERE 10 BETWEEN 100 AND 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+SELECT * FROM t1 WHERE 10 BETWEEN 100 AND 0;
+pk i4
+EXPLAIN
+SELECT * FROM t1 WHERE i4 BETWEEN 100 AND 0;
+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
+SELECT * FROM t1 WHERE i4 BETWEEN 100 AND 0;
+pk i4
+EXPLAIN
+SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 99999999999999999;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range i4_uq i4_uq 5 NULL 2 Using where
+SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 99999999999999999;
+pk i4
+1 10
+2 20
+3 30
+EXPLAIN
+SELECT * FROM t1 WHERE i4 BETWEEN 999999999999999 AND 30;
+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
+SELECT * FROM t1 WHERE i4 BETWEEN 999999999999999 AND 30;
+pk i4
+EXPLAIN
+SELECT * FROM t1 WHERE i4 BETWEEN 10 AND '20';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range i4_uq i4_uq 5 NULL 1 Using where
+SELECT * FROM t1 WHERE i4 BETWEEN 10 AND '20';
+pk i4
+1 10
+2 20
+EXPLAIN
+SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL i4_uq NULL NULL NULL 3
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.i4 1 Using where
+SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4;
+pk i4 pk i4
+EXPLAIN
+SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL i4_uq NULL NULL NULL 3
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.i4 1 Using where
+SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk;
+pk i4 pk i4
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/rpl_mysqldump_slave.result b/mysql-test/r/rpl_mysqldump_slave.result
index 2229725a61d..76caab5fcfa 100644
--- a/mysql-test/r/rpl_mysqldump_slave.result
+++ b/mysql-test/r/rpl_mysqldump_slave.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
#
# New --dump-slave, --apply-slave-statements functionality
#
@@ -15,3 +11,4 @@ START SLAVE;
STOP SLAVE;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT='MASTER_MYPORT', MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
START SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index b5716264f56..49fea815b62 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -4866,6 +4866,70 @@ SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
1
1
DROP TABLE t1;
+#
+# Bug #58422: Incorrect result when OUTER JOIN'ing
+# with an empty table
+#
+CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM;
+CREATE TABLE t1(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM;
+INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
+CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM;
+INSERT INTO t2 VALUES (1,1), (2,2), (3,3);
+EXPLAIN
+SELECT *
+FROM
+t1
+LEFT OUTER JOIN
+(t2 INNER JOIN t_empty ON TRUE)
+ON t1.pk=t2.pk
+WHERE t2.pk <> 2;
+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
+SELECT *
+FROM
+t1
+LEFT OUTER JOIN
+(t2 INNER JOIN t_empty ON TRUE)
+ON t1.pk=t2.pk
+WHERE t2.pk <> 2;
+pk i pk i pk i
+EXPLAIN
+SELECT *
+FROM
+t1
+LEFT OUTER JOIN
+(t2 CROSS JOIN t_empty)
+ON t1.pk=t2.pk
+WHERE t2.pk <> 2;
+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
+SELECT *
+FROM
+t1
+LEFT OUTER JOIN
+(t2 CROSS JOIN t_empty)
+ON t1.pk=t2.pk
+WHERE t2.pk <> 2;
+pk i pk i pk i
+EXPLAIN
+SELECT *
+FROM
+t1
+LEFT OUTER JOIN
+(t2 INNER JOIN t_empty ON t_empty.i=t2.i)
+ON t1.pk=t2.pk
+WHERE t2.pk <> 2;
+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
+SELECT *
+FROM
+t1
+LEFT OUTER JOIN
+(t2 INNER JOIN t_empty ON t_empty.i=t2.i)
+ON t1.pk=t2.pk
+WHERE t2.pk <> 2;
+pk i pk i pk i
+DROP TABLE t1,t2,t_empty;
End of 5.1 tests
#
# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on
@@ -4886,3 +4950,22 @@ col_int_key
DROP VIEW view_t1;
DROP TABLE t1;
# End of test BUG#54515
+#
+# Bug #57203 Assertion `field_length <= 255' failed.
+#
+SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)")))))
+UNION ALL
+SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)")))))
+AS foo
+;
+coalesce((avg(distinct (geomfromtext("point(25379 -22010)")))))
+0.0000
+0.0000
+CREATE table t1(a text);
+INSERT INTO t1 VALUES (''), ('');
+SELECT avg(distinct(t1.a)) FROM t1, t1 t2
+GROUP BY t2.a ORDER BY t1.a;
+avg(distinct(t1.a))
+0
+DROP TABLE t1;
+# End of test BUG#57203
diff --git a/mysql-test/r/shm.result b/mysql-test/r/shm.result
index 4f57049406d..53b2483d97e 100644
--- a/mysql-test/r/shm.result
+++ b/mysql-test/r/shm.result
@@ -2155,6 +2155,8 @@ mysqld is alive
SET @max_allowed_packet= @@global.max_allowed_packet;
SET @net_buffer_length= @@global.net_buffer_length;
SET GLOBAL max_allowed_packet= 1024;
+Warnings:
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SET GLOBAL net_buffer_length= 1024;
ERROR 1153 (08S01) at line 1: Got a packet bigger than 'max_allowed_packet' bytes
SET GLOBAL max_allowed_packet= @max_allowed_packet;
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 073b0b331f0..351bfaf9d96 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -663,6 +663,8 @@ flush tables;
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 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm'
+Warnings:
+Warning 1033 Incorrect information in file: './test/t1.frm'
show create table t1;
ERROR HY000: Incorrect information in file: './test/t1.frm'
drop table if exists t1;
@@ -1323,8 +1325,20 @@ Tables_in_test Table_type
été BASE TABLE
drop table `été`;
set names latin1;
+#
+# Bug#4374 SHOW TABLE STATUS FROM ignores collation_connection
+# Character set: Latin-1 (ISO-8859-1)
+#
+SET NAMES latin1;
+CREATE DATABASE `ä`;
+CREATE TABLE `ä`.`ä` (a int) ENGINE=Memory;
+SHOW TABLE STATUS FROM `ä` LIKE 'ä';
+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
+ä MEMORY 10 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+DROP DATABASE `ä`;
show columns from `#mysql50#????????`;
Got one of the listed errors
+call mtr.add_suppression("Can.t find file: '.\\\\test\\\\\\?{8}.frm'");
DROP TABLE IF EXISTS t1;
DROP PROCEDURE IF EXISTS p1;
CREATE TABLE t1(c1 INT);
@@ -1514,3 +1528,27 @@ ALTER TABLE t1 CHARACTER SET = utf8;
COMMIT;
DROP TRIGGER t1_bi;
DROP TABLE t1;
+#
+# Bug#57306 SHOW PROCESSLIST does not display string literals well.
+#
+SET NAMES latin1;
+SELECT GET_LOCK('t', 1000);
+GET_LOCK('t', 1000)
+1
+SET NAMES latin1;
+SELECT GET_LOCK('t',1000) AS 'óóóó';;
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+### root ### test Query ### ### SHOW PROCESSLIST
+### root ### test Query ### ### SELECT GET_LOCK('t',1000) AS 'óóóó'
+SET NAMES utf8;
+SHOW PROCESSLIST;
+Id User Host db Command Time State Info
+### root ### test Query ### ### SHOW PROCESSLIST
+### root ### test Query ### ### SELECT GET_LOCK('t',1000) AS 'óóóó'
+SELECT RELEASE_LOCK('t');
+RELEASE_LOCK('t')
+1
+óóóó
+1
+SET NAMES latin1;
diff --git a/mysql-test/r/signal.result b/mysql-test/r/signal.result
index 67bf9330451..cfa056d5d13 100644
--- a/mysql-test/r/signal.result
+++ b/mysql-test/r/signal.result
@@ -1379,9 +1379,6 @@ MESSAGE_TEXT = msg,
MYSQL_ERRNO = 1012;
end $$
insert into t1 values (1), (2) $$
-Warnings:
-Warning 1012 This trigger SIGNAL a warning, a=1
-Warning 1012 This trigger SIGNAL a warning, a=2
drop trigger t1_ai $$
create trigger t1_ai after insert on t1 for each row
begin
@@ -1416,11 +1413,7 @@ MESSAGE_TEXT = NEW.msg,
MYSQL_ERRNO = NEW.errno;
end $$
insert into t1 set errno=1012, msg='Warning message 1 in trigger' $$
-Warnings:
-Warning 1012 Warning message 1 in trigger
insert into t1 set errno=1013, msg='Warning message 2 in trigger' $$
-Warnings:
-Warning 1013 Warning message 2 in trigger
drop table t1 $$
drop table if exists t1 $$
drop procedure if exists p1 $$
diff --git a/mysql-test/r/signal_code.result b/mysql-test/r/signal_code.result
index 2ecba4701fa..ca46f1d2079 100644
--- a/mysql-test/r/signal_code.result
+++ b/mysql-test/r/signal_code.result
@@ -20,16 +20,16 @@ return 0;
end $$
show procedure code signal_proc;
Pos Instruction
-0 stmt 131 "SIGNAL foo"
-1 stmt 131 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
-2 stmt 132 "RESIGNAL foo"
-3 stmt 132 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
+0 stmt 130 "SIGNAL foo"
+1 stmt 130 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
+2 stmt 131 "RESIGNAL foo"
+3 stmt 131 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
drop procedure signal_proc;
show function code signal_func;
Pos Instruction
-0 stmt 131 "SIGNAL foo"
-1 stmt 131 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
-2 stmt 132 "RESIGNAL foo"
-3 stmt 132 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
+0 stmt 130 "SIGNAL foo"
+1 stmt 130 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
+2 stmt 131 "RESIGNAL foo"
+3 stmt 131 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
4 freturn 3 0
drop function signal_func;
diff --git a/mysql-test/r/sp-bugs.result b/mysql-test/r/sp-bugs.result
index a88c89537e2..2425f40d9c2 100644
--- a/mysql-test/r/sp-bugs.result
+++ b/mysql-test/r/sp-bugs.result
@@ -75,4 +75,40 @@ CALL p1 ();
ERROR HY000: Trigger does not exist
DROP TABLE t1;
DROP PROCEDURE p1;
+#
+# Bug#54375: Error in stored procedure leaves connection
+# in different default schema
+#
+SET @@SQL_MODE = 'STRICT_ALL_TABLES';
+DROP DATABASE IF EXISTS db1;
+CREATE DATABASE db1;
+USE db1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 int NOT NULL PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+CREATE FUNCTION f1 (
+some_value int
+)
+RETURNS smallint
+DETERMINISTIC
+BEGIN
+INSERT INTO t1 SET c1 = some_value;
+RETURN(LAST_INSERT_ID());
+END$$
+DROP DATABASE IF EXISTS db2;
+CREATE DATABASE db2;
+USE db2;
+SELECT DATABASE();
+DATABASE()
+db2
+SELECT db1.f1(1);
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+SELECT DATABASE();
+DATABASE()
+db2
+USE test;
+DROP FUNCTION db1.f1;
+DROP TABLE db1.t1;
+DROP DATABASE db1;
+DROP DATABASE db2;
End of 5.1 tests
diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result
index c7ea4cbb311..16a43a00f04 100644
--- a/mysql-test/r/sp-code.result
+++ b/mysql-test/r/sp-code.result
@@ -155,11 +155,11 @@ Pos Instruction
0 stmt 9 "drop temporary table if exists sudoku..."
1 stmt 1 "create temporary table sudoku_work ( ..."
2 stmt 1 "create temporary table sudoku_schedul..."
-3 stmt 89 "call sudoku_init()"
+3 stmt 88 "call sudoku_init()"
4 jump_if_not 7(8) p_naive@0
5 stmt 4 "update sudoku_work set cnt = 0 where ..."
6 jump 8
-7 stmt 89 "call sudoku_count()"
+7 stmt 88 "call sudoku_count()"
8 stmt 6 "insert into sudoku_schedule (row,col)..."
9 set v_scounter@2 0
10 set v_i@3 1
diff --git a/mysql-test/r/sp-destruct.result b/mysql-test/r/sp-destruct.result
index fbe982b86bc..a529a62680b 100644
--- a/mysql-test/r/sp-destruct.result
+++ b/mysql-test/r/sp-destruct.result
@@ -1,4 +1,5 @@
call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted");
+call mtr.add_suppression("Stored routine .test...bug14233_[123].: invalid value in column mysql.proc");
flush table mysql.proc;
use test;
drop procedure if exists bug14233;
@@ -151,3 +152,21 @@ Warnings:
Error 1547 Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted
# Restore mysql.proc.
drop table mysql.proc;
+#
+# Bug#58414 mysql_upgrade fails on dump upgrade between 5.1.53 -> 5.5.8
+#
+DROP TABLE IF EXISTS proc_backup;
+DROP DATABASE IF EXISTS db1;
+# Backup the proc table
+RENAME TABLE mysql.proc TO proc_backup;
+CREATE TABLE mysql.proc LIKE proc_backup;
+CREATE DATABASE db1;
+CREATE PROCEDURE db1.p1() SET @foo = 10;
+# Modify a field of the table.
+ALTER TABLE mysql.proc MODIFY comment CHAR (32);
+DROP DATABASE db1;
+Warnings:
+Error 1548 Cannot load from mysql.proc. The table is probably corrupted
+# Restore mysql.proc
+DROP TABLE mysql.proc;
+RENAME TABLE proc_backup TO mysql.proc;
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 7b8364379df..4e97429c48f 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1877,9 +1877,6 @@ DROP PROCEDURE p1;
#
# Bug#5889: Exit handler for a warning doesn't hide the warning in trigger
#
-
-# - Case 1
-
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1 VALUES (1, 2);
CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
@@ -1889,40 +1886,13 @@ SET NEW.a = 10;
SET NEW.a = 99999999999;
END|
UPDATE t1 SET b = 20;
-Warnings:
-Warning 1264 Out of range value for column 'a' at row 1
SHOW WARNINGS;
Level Code Message
-Warning 1264 Out of range value for column 'a' at row 1
SELECT * FROM t1;
a b
10 20
DROP TRIGGER t1_bu;
DROP TABLE t1;
-
-# - Case 2
-
-CREATE TABLE t1(a INT);
-CREATE TABLE t2(b CHAR(1));
-CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-INSERT INTO t2 VALUES('ab'); # Produces a warning.
-INSERT INTO t2 VALUES('b'); # Does not produce a warning,
-# previous warning should be cleared.
-END|
-INSERT INTO t1 VALUES(0);
-SHOW WARNINGS;
-Level Code Message
-SELECT * FROM t1;
-a
-0
-SELECT * FROM t2;
-b
-a
-b
-DROP TRIGGER t1_bi;
-DROP TABLE t1;
-DROP TABLE t2;
#
# Bug#9857: Stored procedures: handler for sqlwarning ignored
#
@@ -1961,3 +1931,64 @@ Warning 1365 Division by 0
DROP PROCEDURE p1;
DROP PROCEDURE p2;
SET sql_mode = @sql_mode_saved;
+#
+# Bug#55850: Trigger warnings not cleared.
+#
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP PROCEDURE IF EXISTS p1;
+CREATE TABLE t1(x SMALLINT, y SMALLINT, z SMALLINT);
+CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT,
+d SMALLINT, e SMALLINT, f SMALLINT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+INSERT INTO t2(a, b, c) VALUES(99999, 99999, 99999);
+CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
+INSERT INTO t2(d, e, f) VALUES(99999, 99999, 99999);
+CREATE PROCEDURE p1()
+INSERT INTO t1 VALUES(99999, 99999, 99999);
+
+CALL p1();
+Warnings:
+Warning 1264 Out of range value for column 'x' at row 1
+Warning 1264 Out of range value for column 'y' at row 1
+Warning 1264 Out of range value for column 'z' at row 1
+
+SHOW WARNINGS;
+Level Code Message
+Warning 1264 Out of range value for column 'x' at row 1
+Warning 1264 Out of range value for column 'y' at row 1
+Warning 1264 Out of range value for column 'z' at row 1
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+# ----------------------------------------------------------------------
+CREATE TABLE t1(x SMALLINT, y SMALLINT, z SMALLINT);
+CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT NOT NULL);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+INSERT INTO t2 VALUES(
+CAST('111111 ' AS SIGNED),
+CAST('222222 ' AS SIGNED),
+NULL);
+END|
+CREATE PROCEDURE p1()
+INSERT INTO t1 VALUES(99999, 99999, 99999);
+
+CALL p1();
+ERROR 23000: Column 'c' cannot be null
+
+SHOW WARNINGS;
+Level Code Message
+Warning 1264 Out of range value for column 'x' at row 1
+Warning 1264 Out of range value for column 'y' at row 1
+Warning 1264 Out of range value for column 'z' at row 1
+Warning 1292 Truncated incorrect INTEGER value: '111111 '
+Warning 1264 Out of range value for column 'a' at row 1
+Warning 1292 Truncated incorrect INTEGER value: '222222 '
+Warning 1264 Out of range value for column 'b' at row 1
+Error 1048 Column 'c' cannot be null
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
diff --git a/mysql-test/r/sp-lock.result b/mysql-test/r/sp-lock.result
index 0d3e87f17e2..860312dca3e 100644
--- a/mysql-test/r/sp-lock.result
+++ b/mysql-test/r/sp-lock.result
@@ -735,5 +735,96 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
# Connection default;
DROP PROCEDURE p1;
#
+# Bug#57663 Concurrent statement using stored function and DROP DATABASE
+# breaks SBR
+#
+DROP DATABASE IF EXISTS db1;
+DROP FUNCTION IF EXISTS f1;
+# Test 1: Check that DROP DATABASE block if a function is used
+# by an active transaction.
+# Connection default
+CREATE DATABASE db1;
+CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
+START TRANSACTION;
+SELECT db1.f1();
+db1.f1()
+1
+# Connection con1
+# Sending:
+DROP DATABASE db1;
+# Connection default
+# Waiting for DROP DATABASE to be blocked by the lock on f1()
+COMMIT;
+# Connection con1
+# Reaping: DROP DATABASE db1
+# Test 2: Check that DROP DATABASE blocks if a procedure is
+# used by an active transaction.
+# Connection default
+CREATE DATABASE db1;
+CREATE PROCEDURE db1.p1() BEGIN END;
+CREATE FUNCTION f1() RETURNS INTEGER
+BEGIN
+CALL db1.p1();
+RETURN 1;
+END|
+START TRANSACTION;
+SELECT f1();
+f1()
+1
+# Connection con1
+# Sending:
+DROP DATABASE db1;
+# Connection default
+# Waiting for DROP DATABASE to be blocked by the lock on p1()
+COMMIT;
+# Connection con1
+# Reaping: DROP DATABASE db1
+# Test 3: Check that DROP DATABASE is not selected as a victim if a
+# deadlock is discovered with DML statements.
+# Connection default
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (a INT);
+CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
+START TRANSACTION;
+SELECT db1.f1();
+db1.f1()
+1
+# Connection con1
+# Sending:
+DROP DATABASE db1;
+# Connection default
+# Waiting for DROP DATABASE to be blocked by the lock on f1()
+SELECT * FROM db1.t1;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+COMMIT;
+# Connection con1
+# Reaping: DROP DATABASE db1
+# Test 4: Check that active DROP DATABASE blocks stored routine DDL.
+# Connection default
+CREATE DATABASE db1;
+CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
+CREATE FUNCTION db1.f2() RETURNS INTEGER RETURN 2;
+START TRANSACTION;
+SELECT db1.f2();
+db1.f2()
+2
+# Connection con1
+# Sending:
+DROP DATABASE db1;
+# Connection con2
+# Waiting for DROP DATABASE to be blocked by the lock on f2()
+# Sending:
+ALTER FUNCTION db1.f1 COMMENT "test";
+# Connection default
+# Waiting for ALTER FUNCTION to be blocked by the schema lock on db1
+COMMIT;
+# Connection con1
+# Reaping: DROP DATABASE db1
+# Connection con2
+# Reaping: ALTER FUNCTION f1 COMMENT 'test'
+ERROR 42000: FUNCTION db1.f1 does not exist
+# Connection default
+DROP FUNCTION f1;
+#
# End of 5.5 tests
#
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index 4ea26d1021a..c09579b13eb 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -44,7 +44,7 @@ ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table 't1'
create procedure db1_secret.dummy() begin end;
ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
drop procedure db1_secret.dummy;
-ERROR 42000: PROCEDURE db1_secret.dummy does not exist
+ERROR 42000: alter routine command denied to user 'user1'@'localhost' for routine 'db1_secret.dummy'
drop procedure db1_secret.stamp;
ERROR 42000: alter routine command denied to user 'user1'@'localhost' for routine 'db1_secret.stamp'
drop function db1_secret.db;
@@ -58,7 +58,7 @@ ERROR 42000: SELECT command denied to user ''@'localhost' for table 't1'
create procedure db1_secret.dummy() begin end;
ERROR 42000: Access denied for user ''@'%' to database 'db1_secret'
drop procedure db1_secret.dummy;
-ERROR 42000: PROCEDURE db1_secret.dummy does not exist
+ERROR 42000: alter routine command denied to user ''@'%' for routine 'db1_secret.dummy'
drop procedure db1_secret.stamp;
ERROR 42000: alter routine command denied to user ''@'%' for routine 'db1_secret.stamp'
drop function db1_secret.db;
@@ -567,3 +567,28 @@ DROP USER 'tester';
DROP USER 'Tester';
DROP DATABASE B48872;
End of 5.0 tests.
+#
+# Test for bug#57061 "User without privilege on routine can discover
+# its existence."
+#
+drop database if exists mysqltest_db;
+create database mysqltest_db;
+# Create user with no privileges on mysqltest_db database.
+create user bug57061_user@localhost;
+create function mysqltest_db.f1() returns int return 0;
+create procedure mysqltest_db.p1() begin end;
+# Connect as user 'bug57061_user@localhost'
+# Attempt to drop routine on which user doesn't have privileges
+# should result in the same 'access denied' type of error whether
+# routine exists or not.
+drop function if exists mysqltest_db.f_does_not_exist;
+ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhost' for routine 'mysqltest_db.f_does_not_exist'
+drop procedure if exists mysqltest_db.p_does_not_exist;
+ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhost' for routine 'mysqltest_db.p_does_not_exist'
+drop function if exists mysqltest_db.f1;
+ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhost' for routine 'mysqltest_db.f1'
+drop procedure if exists mysqltest_db.p1;
+ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhost' for routine 'mysqltest_db.p1'
+# Connection 'default'.
+drop user bug57061_user@localhost;
+drop database mysqltest_db;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 0f18e0e5d6f..0c9b5e30c04 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -7451,4 +7451,52 @@ c1
# Cleanup
drop table t1;
drop procedure p1;
+#
+# BUG#11766234: 59299: ASSERT (TABLE_REF->TABLE || TABLE_REF->VIEW)
+# FAILS IN SET_FIELD_ITERATOR
+#
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+CREATE VIEW v1 AS SELECT a FROM t2;
+CREATE PROCEDURE proc() SELECT * FROM t1 NATURAL JOIN v1;
+ALTER TABLE t2 CHANGE COLUMN a b CHAR;
+
+CALL proc();
+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
+CALL proc();
+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
+
+DROP TABLE t1,t2;
+DROP VIEW v1;
+DROP PROCEDURE proc;
+
+# --
+# -- Bug 11765684 - 58674: SP-cache does not detect changes in
+# -- pre-locking list caused by triggers
+# ---
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP PROCEDURE IF EXISTS p1;
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+CREATE TABLE t3(a INT);
+CREATE PROCEDURE p1()
+INSERT INTO t1(a) VALUES (1);
+
+CREATE TRIGGER t1_ai AFTER INSERT ON t1
+FOR EACH ROW
+INSERT INTO t2(a) VALUES (new.a);
+
+CALL p1();
+
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1
+FOR EACH ROW
+INSERT INTO t3(a) VALUES (new.a);
+
+CALL p1();
+
+DROP TABLE t1, t2, t3;
+DROP PROCEDURE p1;
+
# End of 5.5 test
diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result
index 44d62f17f95..58744a3be2d 100644
--- a/mysql-test/r/sp_notembedded.result
+++ b/mysql-test/r/sp_notembedded.result
@@ -9,9 +9,11 @@ end|
call bug4902()|
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
call bug4902()|
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
drop procedure bug4902|
drop procedure if exists bug4902_2|
create procedure bug4902_2()
@@ -154,9 +156,11 @@ create procedure 15298_2 () sql security definer show grants;
call 15298_1();
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
call 15298_2();
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
drop user mysqltest_1@localhost;
drop procedure 15298_1;
drop procedure 15298_2;
@@ -200,7 +204,6 @@ CREATE PROCEDURE p1(i INT) BEGIN END;
DROP PROCEDURE p1;
DELETE FROM mysql.user WHERE User='mysqltest_1';
FLUSH PRIVILEGES;
-set @@global.concurrent_insert= @old_concurrent_insert;
#
# Bug#44521 Prepared Statement: CALL p() - crashes: `! thd->main_da.is_sent' failed et.al.
#
@@ -234,3 +237,25 @@ DROP FUNCTION f1;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
+#
+# Test for bug#11763757 "56510: ERROR 42000: FUNCTION DOES NOT EXIST
+# IF NOT-PRIV USER RECONNECTS ".
+#
+# The real problem was that server was unable handle properly stored
+# functions in databases which names contained dot.
+#
+DROP DATABASE IF EXISTS `my.db`;
+create database `my.db`;
+use `my.db`;
+CREATE FUNCTION f1(a int) RETURNS INT RETURN a;
+# Create new connection.
+USE `my.db`;
+SELECT f1(1);
+f1(1)
+1
+SELECT `my.db`.f1(2);
+`my.db`.f1(2)
+2
+# Switching to default connection.
+DROP DATABASE `my.db`;
+set @@global.concurrent_insert= @old_concurrent_insert;
diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result
index 4fa91121f50..4163725a196 100644
--- a/mysql-test/r/sp_trans.result
+++ b/mysql-test/r/sp_trans.result
@@ -585,3 +585,20 @@ UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()|
ERROR 23000: Column 'f2' cannot be null
DROP TABLE t1_aux, t1_not_null|
DROP FUNCTION f1_two_inserts|
+#
+# Bug#49938: Failing assertion: inode or deadlock in fsp/fsp0fsp.c
+#
+DROP PROCEDURE IF EXISTS p1|
+DROP TABLE IF EXISTS t1|
+CREATE TABLE t1 (a INT) ENGINE=INNODB|
+CREATE PROCEDURE p1()
+BEGIN
+TRUNCATE TABLE t1;
+END|
+LOCK TABLES t1 WRITE|
+CALL p1()|
+FLUSH TABLES;
+UNLOCK TABLES|
+CALL p1()|
+DROP PROCEDURE p1|
+DROP TABLE t1|
diff --git a/mysql-test/r/ssl_and_innodb.result b/mysql-test/r/ssl_and_innodb.result
new file mode 100644
index 00000000000..71373fc4033
--- /dev/null
+++ b/mysql-test/r/ssl_and_innodb.result
@@ -0,0 +1,8 @@
+CREATE TABLE t1(a int) engine=innodb;
+INSERT INTO t1 VALUES (1);
+SELECT DISTINCT
+convert((SELECT des_decrypt(2,1) AS a FROM t1 WHERE @a:=1), signed) as d
+FROM t1 ;
+d
+2
+DROP TABLE t1;
diff --git a/mysql-test/r/ssl_cipher.result b/mysql-test/r/ssl_cipher.result
new file mode 100644
index 00000000000..78081300b5b
--- /dev/null
+++ b/mysql-test/r/ssl_cipher.result
@@ -0,0 +1,9 @@
+#
+# BUG#11760210 - SSL_CIPHER_LIST NOT SET OR RETURNED FOR "SHOW STATUS LIKE 'SSL_CIPHER_LIST'"
+#
+SHOW STATUS LIKE 'Ssl_cipher';
+Variable_name Value
+Ssl_cipher AES128-SHA
+SHOW STATUS LIKE 'Ssl_cipher_list';
+Variable_name Value
+Ssl_cipher_list AES128-SHA
diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result
index c0cd0f7bc1a..ce3acba9b8a 100644
--- a/mysql-test/r/status.result
+++ b/mysql-test/r/status.result
@@ -238,11 +238,5 @@ SELECT 9;
9
DROP PROCEDURE p1;
DROP FUNCTION f1;
-DROP VIEW IF EXISTS v1;
-CREATE VIEW v1 AS SELECT VARIABLE_NAME AS NAME, CONVERT(VARIABLE_VALUE, UNSIGNED) AS VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
-SELECT VALUE INTO @tc FROM v1 WHERE NAME = 'Threads_connected';
-SELECT NAME FROM v1 WHERE NAME = 'Threads_created' AND VALUE < @tc;
-NAME
-DROP VIEW v1;
set @@global.concurrent_insert= @old_concurrent_insert;
SET GLOBAL log_output = @old_log_output;
diff --git a/mysql-test/r/status_bug17954.result b/mysql-test/r/status_bug17954.result
new file mode 100644
index 00000000000..5c244cd8aca
--- /dev/null
+++ b/mysql-test/r/status_bug17954.result
@@ -0,0 +1,13 @@
+set @old_concurrent_insert= @@global.concurrent_insert;
+set @@global.concurrent_insert= 0;
+SET @old_log_output = @@global.log_output;
+SET GLOBAL LOG_OUTPUT = 'FILE';
+flush status;
+DROP VIEW IF EXISTS v1;
+CREATE VIEW v1 AS SELECT VARIABLE_NAME AS NAME, CONVERT(VARIABLE_VALUE, UNSIGNED) AS VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
+SELECT VALUE INTO @tc FROM v1 WHERE NAME = 'Threads_connected';
+SELECT NAME FROM v1 WHERE NAME = 'Threads_created' AND VALUE < @tc;
+NAME
+DROP VIEW v1;
+set @@global.concurrent_insert= @old_concurrent_insert;
+SET GLOBAL log_output = @old_log_output;
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index f4e07636467..7531acda7a5 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -5252,8 +5252,90 @@ ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
SELECT * FROM t2 UNION SELECT * FROM t2
ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE));
DROP TABLE t1,t2;
+#
+# Bug #58818: Incorrect result for IN/ANY subquery
+# with HAVING condition
+#
+CREATE TABLE t1(i INT);
+INSERT INTO t1 VALUES (1), (2), (3);
+CREATE TABLE t1s(i INT);
+INSERT INTO t1s VALUES (10), (20), (30);
+CREATE TABLE t2s(i INT);
+INSERT INTO t2s VALUES (100), (200), (300);
+SELECT * FROM t1
+WHERE t1.i NOT IN
+(
+SELECT STRAIGHT_JOIN t2s.i
+FROM
+t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
+HAVING t2s.i = 999
+);
+i
+1
+2
+3
+SELECT * FROM t1
+WHERE t1.I IN
+(
+SELECT STRAIGHT_JOIN t2s.i
+FROM
+t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
+HAVING t2s.i = 999
+) IS UNKNOWN;
+i
+SELECT * FROM t1
+WHERE NOT t1.I = ANY
+(
+SELECT STRAIGHT_JOIN t2s.i
+FROM
+t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
+HAVING t2s.i = 999
+);
+i
+1
+2
+3
+SELECT * FROM t1
+WHERE t1.i = ANY (
+SELECT STRAIGHT_JOIN t2s.i
+FROM
+t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
+HAVING t2s.i = 999
+) IS UNKNOWN;
+i
+DROP TABLE t1,t1s,t2s;
End of 5.1 tests
#
+# Bug #11765713 58705:
+# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES
+# CREATED BY OPT_SUM_QUERY
+#
+CREATE TABLE t1(a INT NOT NULL, KEY (a));
+INSERT INTO t1 VALUES (0), (1);
+SELECT 1 as foo FROM t1 WHERE a < SOME
+(SELECT a FROM t1 WHERE a <=>
+(SELECT a FROM t1)
+);
+ERROR 21000: Subquery returns more than 1 row
+SELECT 1 as foo FROM t1 WHERE a < SOME
+(SELECT a FROM t1 WHERE a <=>
+(SELECT a FROM t1 where a is null)
+);
+foo
+DROP TABLE t1;
+#
+# Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool):
+# Assertion `file' failed.
+#
+CREATE TABLE t1 (a INT);
+SELECT 1 FROM
+(SELECT ROW(
+(SELECT 1 FROM t1 RIGHT JOIN
+(SELECT 1 FROM t1, t1 t2) AS d ON 1),
+1) FROM t1) AS e;
+ERROR 21000: Operand should contain 1 column(s)
+DROP TABLE t1;
+#
# No BUG#, a case brought from 5.2's innodb_mysql_lock.test
#
create table t1 (i int not null primary key);
diff --git a/mysql-test/r/subselect4.result b/mysql-test/r/subselect4.result
index 72fa5f23ab1..63d051e03f2 100644
--- a/mysql-test/r/subselect4.result
+++ b/mysql-test/r/subselect4.result
@@ -186,6 +186,17 @@ a b
2 NULL
DROP TABLE t1, t2, t3, t4, t5;
#
+# Bug#58207: invalid memory reads when using default column value and
+# tmptable needed
+#
+CREATE TABLE t(a VARCHAR(245) DEFAULT
+'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
+INSERT INTO t VALUES (''),(''),(''),(''),(''),(''),(''),(''),(''),(''),('');
+SELECT * FROM (SELECT default(a) FROM t GROUP BY a) d;
+default(a)
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+DROP TABLE t;
+#
# End of 5.1 tests.
#
#
diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result
index 6c6d563e284..ab623ad6a28 100644
--- a/mysql-test/r/subselect_innodb.result
+++ b/mysql-test/r/subselect_innodb.result
@@ -245,3 +245,12 @@ x
NULL
drop procedure p1;
drop tables t1,t2,t3;
+#
+# Bug#60085 crash in Item::save_in_field() with time data type
+#
+CREATE TABLE t1(a date, b int, unique(b), unique(a), key(b)) engine=innodb;
+INSERT INTO t1 VALUES ('2011-05-13', 0);
+SELECT * FROM t1 WHERE b < (SELECT CAST(a as date) FROM t1 GROUP BY a);
+a b
+2011-05-13 0
+DROP TABLE t1;
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index 4dac7443135..20736aec47f 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -22,7 +22,8 @@ insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
drop table t2;
-create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="MYSQLTEST_VARDIR/tmp" index directory="MYSQLTEST_VARDIR/run";
+create table t9 (a int not null auto_increment, b char(16) not null, primary key (a))
+engine=myisam data directory="MYSQLTEST_VARDIR/tmp" index directory="MYSQLTEST_VARDIR/run";
insert into t9 select * from t1;
check table t9;
Table Op Msg_type Msg_text
@@ -56,11 +57,17 @@ t9 CREATE TABLE `t9` (
PRIMARY KEY (`a`)
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
create database mysqltest;
-create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="/this-dir-does-not-exist";
+create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a))
+engine=myisam index directory="/this-dir-does-not-exist";
Got one of the listed errors
-create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="MYSQLTEST_VARDIR/run";
+create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a))
+engine=myisam index directory="not-hard-path";
+ERROR 42000: Incorrect table name 'not-hard-path'
+create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a))
+engine=myisam index directory="MYSQLTEST_VARDIR/run";
Got one of the listed errors
-create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="MYSQLTEST_VARDIR/tmp";
+create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a))
+engine=myisam data directory="MYSQLTEST_VARDIR/tmp";
Got one of the listed errors
alter table t9 rename mysqltest.t9;
select count(*) from mysqltest.t9;
@@ -181,3 +188,28 @@ DROP TABLE user;
FLUSH TABLE mysql.user;
SELECT * FROM mysql.user;
End of 5.1 tests
+#
+# Test for bug #11759990 - "52354: 'CREATE TABLE .. LIKE ... '
+# STATEMENTS FAIL".
+#
+drop table if exists t1, t2;
+create table t1 (a int primary key) engine=myisam
+data directory="MYSQLTEST_VARDIR/tmp"
+ index directory="MYSQLTEST_VARDIR/run";
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
+# CREATE TABLE LIKE statement on table with INDEX/DATA DIRECTORY
+# options should not fail. Per documentation newly created table
+# should not inherit value of these options from the original table.
+create table t2 like t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop tables t1, t2;
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index e963e1ebff7..10b14daf299 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -14,6 +14,7 @@ ndb_binlog_index
plugin
proc
procs_priv
+proxies_priv
servers
slow_log
tables_priv
@@ -119,8 +120,8 @@ user CREATE TABLE `user` (
`max_updates` int(11) unsigned NOT NULL DEFAULT '0',
`max_connections` int(11) unsigned NOT NULL DEFAULT '0',
`max_user_connections` int(11) unsigned NOT NULL DEFAULT '0',
- `plugin` char(60) CHARACTER SET latin1 NOT NULL DEFAULT '',
- `auth_string` text COLLATE utf8_bin NOT NULL,
+ `plugin` char(64) CHARACTER SET latin1 NOT NULL DEFAULT '',
+ `authentication_string` text COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`Host`,`User`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
show create table func;
diff --git a/mysql-test/r/tablespace.result b/mysql-test/r/tablespace.result
new file mode 100644
index 00000000000..38d450ae430
--- /dev/null
+++ b/mysql-test/r/tablespace.result
@@ -0,0 +1,112 @@
+CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(a int) TABLESPACE ts STORAGE MEMORY ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) /*!50100 TABLESPACE ts STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(a int) STORAGE MEMORY ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) /*!50100 STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(a int) STORAGE DISK ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) /*!50100 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM;
+ALTER TABLE t1 ADD COLUMN b int;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM;
+ALTER TABLE t1 ADD COLUMN b int;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(a int) ENGINE=MyISAM;
+ALTER TABLE t1 TABLESPACE ts;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) /*!50100 TABLESPACE ts */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE t1 TABLESPACE ts2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) /*!50100 TABLESPACE ts2 */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(a int) ENGINE=MyISAM;
+ALTER TABLE t1 STORAGE MEMORY;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) /*!50100 STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE t1 STORAGE DISK;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) /*!50100 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(a int) ENGINE=MyISAM;
+ALTER TABLE t1 STORAGE MEMORY TABLESPACE ts;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) /*!50100 TABLESPACE ts STORAGE MEMORY */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE t1 STORAGE DISK TABLESPACE ts2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) /*!50100 TABLESPACE ts2 STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL,
+ `d` int(11) NOT NULL,
+ `e` int(11) DEFAULT NULL,
+ `f` int(11) DEFAULT NULL,
+ `g` int(11) DEFAULT NULL,
+ `h` int(11) NOT NULL,
+ `i` int(11) DEFAULT NULL,
+ `j` int(11) DEFAULT NULL,
+ `k` int(11) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) /*!50100 TABLESPACE the_tablespacename STORAGE DISK */ ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
diff --git a/mysql-test/r/trigger-compat.result b/mysql-test/r/trigger-compat.result
index d1f1ec87efd..284731d8dfc 100644
--- a/mysql-test/r/trigger-compat.result
+++ b/mysql-test/r/trigger-compat.result
@@ -41,3 +41,98 @@ DROP TABLE t2;
DROP USER mysqltest_dfn@localhost;
DROP USER mysqltest_inv@localhost;
DROP DATABASE mysqltest_db1;
+USE test;
+#
+# Bug#45235: 5.1 does not support 5.0-only syntax triggers in any way
+#
+DROP TABLE IF EXISTS t1, t2, t3;
+CREATE TABLE t1 ( a INT );
+CREATE TABLE t2 ( a INT );
+CREATE TABLE t3 ( a INT );
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (1), (2), (3);
+INSERT INTO t3 VALUES (1), (2), (3);
+# We simulate importing a trigger from 5.0 by writing a .TRN file for
+# each trigger plus a .TRG file the way MySQL 5.0 would have done it,
+# with syntax allowed in 5.0 only.
+#
+# Note that in 5.0 the following lines are missing from t1.TRG:
+#
+# client_cs_names='latin1'
+# connection_cl_names='latin1_swedish_ci'
+# db_cl_names='latin1_swedish_ci'
+FLUSH TABLE t1;
+FLUSH TABLE t2;
+# We will get parse errors for most DDL and DML statements when the table
+# has broken triggers. The parse error refers to the first broken
+# trigger.
+CREATE TRIGGER tr16 AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO t1 VALUES (1);
+ERROR 42000: Trigger 'tr13' has an error in its body: 'You 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 USING t1 a' at line 1'
+CREATE TRIGGER tr22 BEFORE INSERT ON t2 FOR EACH ROW DELETE FROM non_existing_table;
+ERROR 42000: Unknown trigger has an error in its body: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Not allowed syntax here, and trigger name cant be extracted either.' at line 1'
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+tr11 INSERT t1 DELETE FROM t3 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+tr12 INSERT t1 DELETE FROM t3 AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+tr14 DELETE t1 DELETE FROM non_existing_table AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+INSERT INTO t1 VALUES (1);
+ERROR 42000: Trigger 'tr13' has an error in its body: 'You 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 USING t1 a' at line 1'
+INSERT INTO t2 VALUES (1);
+ERROR 42000: Unknown trigger has an error in its body: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Not allowed syntax here, and trigger name cant be extracted either.' at line 1'
+DELETE FROM t1;
+ERROR 42000: Trigger 'tr13' has an error in its body: 'You 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 USING t1 a' at line 1'
+UPDATE t1 SET a = 1 WHERE a = 1;
+ERROR 42000: Trigger 'tr13' has an error in its body: 'You 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 USING t1 a' at line 1'
+SELECT * FROM t1;
+a
+1
+2
+3
+RENAME TABLE t1 TO t1_2;
+ERROR 42000: Trigger 'tr13' has an error in its body: 'You 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 USING t1 a' at line 1'
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+tr11 INSERT t1 DELETE FROM t3 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+tr12 INSERT t1 DELETE FROM t3 AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+tr14 DELETE t1 DELETE FROM non_existing_table AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+DROP TRIGGER tr11;
+Warnings:
+Warning 1603 Triggers for table `test`.`t1` have no creation context
+DROP TRIGGER tr12;
+DROP TRIGGER tr13;
+DROP TRIGGER tr14;
+DROP TRIGGER tr15;
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
+# Make sure there is no trigger file left.
+# We write the same trigger files one more time to test DROP TABLE.
+FLUSH TABLE t1;
+FLUSH TABLE t2;
+DROP TABLE t1;
+Warnings:
+Warning 1603 Triggers for table `test`.`t1` have no creation context
+DROP TABLE t2;
+Warnings:
+Warning 1603 Triggers for table `test`.`t2` have no creation context
+DROP TABLE t3;
+# Make sure there is no trigger file left.
+CREATE TABLE t1 ( a INT );
+CREATE TABLE t2 ( a INT );
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (1), (2), (3);
+# We write three trigger files. First trigger is syntaxically incorrect, next trigger is correct
+# and last trigger is broken.
+# Next we try to execute SHOW CREATE TRGGIR command for broken trigger and then try to drop one.
+FLUSH TABLE t1;
+SHOW CREATE TRIGGER tr12;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+tr12 CREATE DEFINER=`root`@`localhost` TRIGGER tr12 BEFORE INSERT ON t1 FOR EACH ROW DELETE FROM t2 latin1 latin1_swedish_ci latin1_swedish_ci
+Warnings:
+Warning 1603 Triggers for table `test`.`t1` have no creation context
+SHOW CREATE TRIGGER tr11;
+Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
+tr11 CREATE DEFINER=`root`@`localhost` TRIGGER tr11 BEFORE DELETE ON t1 FOR EACH ROW DELETE FROM t1 a USING t1 a latin1 latin1_swedish_ci latin1_swedish_ci
+DROP TRIGGER tr12;
+DROP TRIGGER tr11;
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/r/trigger-trans.result b/mysql-test/r/trigger-trans.result
index 2c4e355af9d..722ac79854d 100644
--- a/mysql-test/r/trigger-trans.result
+++ b/mysql-test/r/trigger-trans.result
@@ -151,9 +151,14 @@ CREATE TRIGGER t1_ad AFTER DELETE ON t1 FOR EACH ROW SET @b = 1;
SET @a = 0;
SET @b = 0;
TRUNCATE t1;
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `test`.`t1` (`a`))
SELECT @a, @b;
@a @b
0 0
+DELETE FROM t1;
+SELECT @a, @b;
+@a @b
+1 1
INSERT INTO t1 VALUES (1);
DELETE FROM t1;
SELECT @a, @b;
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index a1c21e18f83..faea2e791d5 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -821,7 +821,6 @@ drop trigger t1_bi;
create trigger t1_bi after insert on t1 for each row insert into t3 values (new.id);
execute stmt1;
call p1();
-ERROR 42S02: Table 'test.t3' doesn't exist
deallocate prepare stmt1;
drop procedure p1;
drop table t1, t2, t3;
@@ -1072,8 +1071,6 @@ SELECT @x;
NULL
SET @x=2;
UPDATE t1 SET i1 = @x;
-Warnings:
-Warning 1365 Division by 0
SELECT @x;
@x
NULL
@@ -1085,9 +1082,6 @@ SELECT @x;
NULL
SET @x=4;
UPDATE t1 SET i1 = @x;
-Warnings:
-Warning 1365 Division by 0
-Warning 1365 Division by 0
SELECT @x;
@x
NULL
@@ -1198,8 +1192,6 @@ Warnings:
Warning 1365 Division by 0
create trigger t1_bi before insert on t1 for each row set @a:=1/0|
insert into t1 values(20, 20)|
-Warnings:
-Warning 1365 Division by 0
drop trigger t1_bi|
create trigger t1_bi before insert on t1 for each row
begin
@@ -1218,8 +1210,6 @@ set @a:=1/0;
end|
set @check=0, @t4_bi_called=0, @t4_bu_called=0|
insert into t1 values(30, 30)|
-Warnings:
-Warning 1365 Division by 0
select @check, @t4_bi_called, @t4_bu_called|
@check @t4_bi_called @t4_bu_called
2 1 1
@@ -2063,12 +2053,8 @@ SELECT 1 FROM t1 c WHERE
END//
SET @bug51650 = 1;
INSERT IGNORE INTO t2 VALUES();
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
INSERT IGNORE INTO t1 SET b = '777';
INSERT IGNORE INTO t2 SET a = '111';
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
SET @bug51650 = 1;
INSERT IGNORE INTO t2 SET a = '777';
DROP TRIGGER trg1;
@@ -2105,7 +2091,7 @@ CREATE TRIGGER trg1 BEFORE INSERT ON t2 FOR EACH ROW INSERT/*!INTO*/t1 VALUES (1
SHOW TRIGGERS IN db1;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
INSERT INTO t2 VALUES (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 'VALUES (1)' at line 1
+ERROR 42000: Trigger 'trg1' has an error in its body: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES (1)' at line 1'
SELECT * FROM t1;
b
# Work around Bug#45235
@@ -2150,8 +2136,6 @@ SELECT 'ab' INTO a;
SELECT 'a' INTO a;
END|
INSERT INTO t1 VALUES (1);
-Warnings:
-Warning 1265 Data truncated for column 'a' at row 1
DROP TRIGGER trg1;
DROP TABLE t1;
DROP TRIGGER IF EXISTS trg1;
@@ -2169,20 +2153,12 @@ DECLARE trg2 CHAR;
SELECT 'ab' INTO trg2;
END|
INSERT INTO t1 VALUES (0);
-Warnings:
-Warning 1265 Data truncated for column 'trg1' at row 1
-Warning 1265 Data truncated for column 'trg2' at row 1
SELECT * FROM t1;
a
0
SHOW WARNINGS;
Level Code Message
INSERT INTO t1 VALUES (1),(2);
-Warnings:
-Warning 1265 Data truncated for column 'trg1' at row 1
-Warning 1265 Data truncated for column 'trg2' at row 1
-Warning 1265 Data truncated for column 'trg1' at row 1
-Warning 1265 Data truncated for column 'trg2' at row 1
DROP TRIGGER trg1;
DROP TRIGGER trg2;
DROP TABLE t1;
@@ -2205,4 +2181,22 @@ trigger_name
# Clean-up.
drop temporary table t1;
drop table t1;
-End of 6.0 tests.
+
+#
+# Bug #12362125: SP INOUT HANDLING IS BROKEN FOR TEXT TYPE.
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(c TEXT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE v TEXT;
+SET v = 'aaa';
+SET NEW.c = v;
+END|
+INSERT INTO t1 VALUES('qazwsxedc');
+SELECT c FROM t1;
+c
+aaa
+DROP TABLE t1;
+
+End of 5.5 tests.
diff --git a/mysql-test/r/truncate_coverage.result b/mysql-test/r/truncate_coverage.result
index a7a4b9c70f4..728702f7ab5 100644
--- a/mysql-test/r/truncate_coverage.result
+++ b/mysql-test/r/truncate_coverage.result
@@ -78,3 +78,30 @@ COMMIT;
UNLOCK TABLES;
DROP TABLE t1;
SET DEBUG_SYNC='RESET';
+#
+# Bug#57659 Segfault in Query_cache::invalidate_data for TRUNCATE TABLE
+#
+# Note that this test case only reproduces the problem
+# when it is run with valgrind.
+DROP TABLE IF EXISTS t1, m1;
+CREATE TABLE t1(a INT) engine=memory;
+CREATE TABLE m1(a INT) engine=merge UNION(t1);
+# Connection con1
+SET DEBUG_SYNC= 'open_tables_after_open_and_process_table SIGNAL opened WAIT_FOR dropped';
+# Sending:
+TRUNCATE TABLE m1;
+# Connection con2
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+# Sending:
+FLUSH TABLES;
+# Connection default
+# Waiting for FLUSH TABLES to be blocked.
+SET DEBUG_SYNC= 'now SIGNAL dropped';
+# Connection con1
+# Reaping: TRUNCATE TABLE m1
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+# Connection con2
+# Reaping: FLUSH TABLES
+# Connection default
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE m1, t1;
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index 78f31286ea7..e3363fcabf9 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -975,4 +975,14 @@ SELECT LENGTH(c) FROM t2;
LENGTH(c)
65535
DROP TABLE t1, t2;
+# Bug #52160: crash and inconsistent results when grouping
+# by a function and column
+CREATE FUNCTION f1() RETURNS TINYBLOB RETURN 1;
+CREATE TABLE t1(a CHAR(1));
+INSERT INTO t1 VALUES ('0'), ('0');
+SELECT COUNT(*) FROM t1 GROUP BY f1(), a;
+COUNT(*)
+2
+DROP FUNCTION f1;
+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 80aa63467a9..4f679e4f28d 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -300,6 +300,18 @@ the_date the_time the_date the_time
2010-01-01 01:01:01 2010-01-01 01:01:01
DROP TABLE t1;
DROP VIEW v1;
+#
+# Bug#59685 crash in String::length with date types
+#
+CREATE TABLE t1(a DATE, b YEAR, KEY(a));
+INSERT INTO t1 VALUES ('2011-01-01',2011);
+SELECT b = (SELECT CONVERT(a, DATE) FROM t1 GROUP BY a) FROM t1;
+b = (SELECT CONVERT(a, DATE) FROM t1 GROUP BY a)
+1
+SELECT b = CONVERT((SELECT CONVERT(a, DATE) FROM t1 GROUP BY a), DATE) FROM t1;
+b = CONVERT((SELECT CONVERT(a, DATE) FROM t1 GROUP BY a), DATE)
+1
+DROP TABLE t1;
End of 5.1 tests
#
# Bug #33629: last_day function can return null, but has 'not null'
@@ -322,4 +334,12 @@ f1 date YES NULL
f2 date YES NULL
DROP TABLE t1;
#
+#
+# Bug#57278: Crash on min/max + with date out of range.
+#
+set @a=(select min(makedate('111','1'))) ;
+select @a;
+@a
+0111-01-01
+#
End of 6.0 tests
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index a37d3945ca1..a1e461f3f88 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -635,6 +635,17 @@ CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7))
20080729104251.1234560
Warnings:
Warning 1292 Truncated incorrect datetime value: '2008-07-29T10:42:51.1234567'
+#
+# Bug#59173: Failure to handle DATE(TIME) values where Year, Month or
+# Day is ZERO
+#
+CREATE TABLE t1 (dt1 DATETIME);
+INSERT INTO t1 (dt1) VALUES ('0000-00-01 00:00:01');
+DELETE FROM t1 WHERE dt1 = '0000-00-01 00:00:01';
+# Should be empty
+SELECT * FROM t1;
+dt1
+DROP TABLE t1;
End of 5.1 tests
#
# Start of 5.5 tests
@@ -678,5 +689,63 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 const PRIMARY PRIMARY 8 const 1 Using index
DROP TABLE t1,t2;
#
+# Bug#57095: Wrongly chosen expression cache type led to a wrong
+# result.
+#
+CREATE TABLE t1 (`b` datetime );
+INSERT INTO t1 VALUES ('2010-01-01 00:00:00'), ('2010-01-01 00:00:00');
+SELECT * FROM t1 WHERE b <= coalesce(NULL, now());
+b
+2010-01-01 00:00:00
+2010-01-01 00:00:00
+DROP TABLE t1;
+#
+#
+# BUG#12561818: RERUN OF STORED FUNCTION GIVES ERROR 1172:
+# RESULT CONSISTED OF MORE THAN ONE ROW
+#
+CREATE TABLE t1 (a DATE NOT NULL, b INT);
+INSERT INTO t1 VALUES ('0000-00-00',1), ('1999-05-10',2);
+CREATE TABLE t2 (a DATETIME NOT NULL, b INT);
+INSERT INTO t2 VALUES ('0000-00-00 00:00:00',1), ('1999-05-10 00:00:00',2);
+
+SELECT * FROM t1 WHERE a IS NULL;
+a b
+0000-00-00 1
+SELECT * FROM t2 WHERE a IS NULL;
+a b
+0000-00-00 00:00:00 1
+SELECT * FROM t1 LEFT JOIN t1 AS t1_2 ON 1 WHERE t1_2.a IS NULL;
+a b a b
+0000-00-00 1 0000-00-00 1
+1999-05-10 2 0000-00-00 1
+SELECT * FROM t2 LEFT JOIN t2 AS t2_2 ON 1 WHERE t2_2.a IS NULL;
+a b a b
+0000-00-00 00:00:00 1 0000-00-00 00:00:00 1
+1999-05-10 00:00:00 2 0000-00-00 00:00:00 1
+SELECT * FROM t1 JOIN t1 AS t1_2 ON 1 WHERE t1_2.a IS NULL;
+a b a b
+0000-00-00 1 0000-00-00 1
+1999-05-10 2 0000-00-00 1
+SELECT * FROM t2 JOIN t2 AS t2_2 ON 1 WHERE t2_2.a IS NULL;
+a b a b
+0000-00-00 00:00:00 1 0000-00-00 00:00:00 1
+1999-05-10 00:00:00 2 0000-00-00 00:00:00 1
+
+PREPARE stmt1 FROM
+'SELECT *
+ FROM t1 LEFT JOIN t1 AS t1_2 ON 1
+ WHERE t1_2.a IS NULL AND t1_2.b < 2';
+EXECUTE stmt1;
+a b a b
+0000-00-00 1 0000-00-00 1
+1999-05-10 2 0000-00-00 1
+EXECUTE stmt1;
+a b a b
+0000-00-00 1 0000-00-00 1
+1999-05-10 2 0000-00-00 1
+DEALLOCATE PREPARE stmt1;
+DROP TABLE t1,t2;
+#
# End of 5.5 tests
#
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index 819e41f41c5..c9db73c5f85 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -1920,4 +1920,17 @@ SELECT SUM(DISTINCT a) FROM t1;
SUM(DISTINCT a)
0.0000
DROP TABLE t1;
+#
+# Bug#55436: buffer overflow in debug binary of dbug_buff in
+# Field_new_decimal::store_value
+#
+SET SQL_MODE='';
+CREATE TABLE t1(f1 DECIMAL(44,24)) ENGINE=MYISAM;
+INSERT INTO t1 SET f1 = -64878E-85;
+Warnings:
+Note 1265 Data truncated for column 'f1' at row 1
+SELECT f1 FROM t1;
+f1
+0.000000000000000000000000
+DROP TABLE IF EXISTS t1;
End of 5.1 tests
diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result
index ac3d52b9ead..d99c2363d62 100644
--- a/mysql-test/r/type_ranges.result
+++ b/mysql-test/r/type_ranges.result
@@ -271,7 +271,7 @@ drop table t2;
create table t2 (primary key (auto)) select auto+1 as auto,1 as t1, 'a' as t2, repeat('a',256) as t3, binary repeat('b',256) as t4, repeat('a',4096) as t5, binary repeat('b',4096) as t6, '' as t7, binary '' as t8 from t1;
show full columns from t2;
Field Type Collation Null Key Default Extra Privileges Comment
-auto int(6) unsigned NULL NO PRI 0 #
+auto int(11) unsigned NULL NO PRI 0 #
t1 int(1) NULL NO 0 #
t2 varchar(1) latin1_swedish_ci NO #
t3 varchar(256) latin1_swedish_ci NO #
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index 10a2b47ba02..55f8b0753a8 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -523,6 +523,69 @@ a
2000-01-01 00:00:01
2000-01-01 00:00:01
DROP TABLE t1;
+#
+# Bug#50774: failed to get the correct resultset when timestamp values
+# are appended with .0
+#
+CREATE TABLE t1 ( a TIMESTAMP, KEY ( a ) );
+INSERT INTO t1 VALUES( '2010-02-01 09:31:01' );
+INSERT INTO t1 VALUES( '2010-02-01 09:31:02' );
+INSERT INTO t1 VALUES( '2010-02-01 09:31:03' );
+INSERT INTO t1 VALUES( '2010-02-01 09:31:04' );
+SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
+a
+2010-02-01 09:31:02
+2010-02-01 09:31:03
+2010-02-01 09:31:04
+SELECT * FROM t1 WHERE '2010-02-01 09:31:02.0' <= a;
+a
+2010-02-01 09:31:02
+2010-02-01 09:31:03
+2010-02-01 09:31:04
+SELECT * FROM t1 WHERE a <= '2010-02-01 09:31:02.0';
+a
+2010-02-01 09:31:01
+2010-02-01 09:31:02
+SELECT * FROM t1 WHERE '2010-02-01 09:31:02.0' >= a;
+a
+2010-02-01 09:31:01
+2010-02-01 09:31:02
+EXPLAIN
+SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
+id select_type table type possible_keys key key_len ref rows Extra
+x x x range x x x x x x
+SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
+a
+2010-02-01 09:31:02
+2010-02-01 09:31:03
+2010-02-01 09:31:04
+CREATE TABLE t2 ( a TIMESTAMP, KEY ( a DESC ) );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:01' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:02' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:03' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:04' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:05' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:06' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:07' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:08' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:09' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:10' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:11' );
+# The bug would cause the range optimizer's comparison to use an open
+# interval here. This reveals itself only in the number of reads
+# performed.
+FLUSH STATUS;
+EXPLAIN
+SELECT * FROM t2 WHERE a < '2010-02-01 09:31:02.0';
+id select_type table type possible_keys key key_len ref rows Extra
+x x x range x x x x x x
+SELECT * FROM t2 WHERE a < '2010-02-01 09:31:02.0';
+a
+2010-02-01 09:31:01
+SHOW STATUS LIKE 'Handler_read_next';
+Variable_name Value
+Handler_read_next 1
+DROP TABLE t1, t2;
End of 5.1 tests
Bug#50888 valgrind warnings in Field_timestamp::val_str
@@ -540,3 +603,32 @@ a
2010-03-05 11:08:02
DROP TABLE t1;
End of Bug#50888
+#
+# Bug59330: Incorrect result when comparing an aggregate
+# function with TIMESTAMP
+#
+CREATE TABLE t1 (dt DATETIME, ts TIMESTAMP);
+INSERT INTO t1 VALUES('2011-01-06 12:34:30', '2011-01-06 12:34:30');
+SELECT MAX(dt), MAX(ts) FROM t1;
+MAX(dt) MAX(ts)
+2011-01-06 12:34:30 2011-01-06 12:34:30
+SELECT MAX(ts) < '2010-01-01 00:00:00' FROM t1;
+MAX(ts) < '2010-01-01 00:00:00'
+0
+SELECT MAX(dt) < '2010-01-01 00:00:00' FROM t1;
+MAX(dt) < '2010-01-01 00:00:00'
+0
+SELECT MAX(ts) > '2010-01-01 00:00:00' FROM t1;
+MAX(ts) > '2010-01-01 00:00:00'
+1
+SELECT MAX(dt) > '2010-01-01 00:00:00' FROM t1;
+MAX(dt) > '2010-01-01 00:00:00'
+1
+SELECT MAX(ts) = '2011-01-06 12:34:30' FROM t1;
+MAX(ts) = '2011-01-06 12:34:30'
+1
+SELECT MAX(dt) = '2011-01-06 12:34:30' FROM t1;
+MAX(dt) = '2011-01-06 12:34:30'
+1
+DROP TABLE t1;
+End of 5.5 tests
diff --git a/mysql-test/r/type_year.result b/mysql-test/r/type_year.result
index 8948214f565..2dc491c6166 100644
--- a/mysql-test/r/type_year.result
+++ b/mysql-test/r/type_year.result
@@ -341,4 +341,18 @@ ta_y s tb_y s
2001 2001 2001 2001
DROP TABLE t1;
#
+# Bug #59211: Select Returns Different Value for min(year) Function
+#
+CREATE TABLE t1(c1 YEAR(4));
+INSERT INTO t1 VALUES (1901),(2155),(0000);
+SELECT * FROM t1;
+c1
+1901
+2155
+0000
+SELECT COUNT(*) AS total_rows, MIN(c1) AS min_value, MAX(c1) FROM t1;
+total_rows min_value MAX(c1)
+3 0 2155
+DROP TABLE t1;
+#
End of 5.1 tests
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index d1342098329..bcf4df8e12c 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1644,3 +1644,128 @@ b
2
DROP TABLE t1,t2;
End of 5.1 tests
+#
+# Bug#57986 ORDER BY clause is not used after a UNION,
+# if embedded in a SELECT
+#
+CREATE TABLE t1 (c1 VARCHAR(10) NOT NULL, c2 INT NOT NULL);
+CREATE TABLE t2 (c1 VARCHAR(10) NOT NULL, c2 INT NOT NULL);
+INSERT INTO t1 (c1, c2) VALUES ('t1a', 1), ('t1a', 2), ('t1a', 3), ('t1b', 2), ('t1b', 1);
+INSERT INTO t2 (c1, c2) VALUES ('t2a', 1), ('t2a', 2), ('t2a', 3), ('t2b', 2), ('t2b', 1);
+SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY c2, c1;
+c1 c2
+t1a 1
+t1b 1
+t2a 1
+t2b 1
+t1a 2
+t1b 2
+t2a 2
+t2b 2
+t1a 3
+t2a 3
+SELECT * FROM t1 UNION (SELECT * FROM t2) ORDER BY c2, c1;
+c1 c2
+t1a 1
+t1b 1
+t2a 1
+t2b 1
+t1a 2
+t1b 2
+t2a 2
+t2b 2
+t1a 3
+t2a 3
+SELECT * FROM t1 UNION (SELECT * FROM t2 ORDER BY c2, c1);
+c1 c2
+t1a 1
+t1a 2
+t1a 3
+t1b 2
+t1b 1
+t2a 1
+t2a 2
+t2a 3
+t2b 2
+t2b 1
+SELECT c1, c2 FROM (
+SELECT c1, c2 FROM t1
+UNION
+(SELECT c1, c2 FROM t2)
+ORDER BY c2, c1
+) AS res;
+c1 c2
+t1a 1
+t1b 1
+t2a 1
+t2b 1
+t1a 2
+t1b 2
+t2a 2
+t2b 2
+t1a 3
+t2a 3
+SELECT c1, c2 FROM (
+SELECT c1, c2 FROM t1
+UNION
+(SELECT c1, c2 FROM t2)
+ORDER BY c2 DESC, c1 LIMIT 1
+) AS res;
+c1 c2
+t1a 3
+SELECT c1, c2 FROM (
+SELECT c1, c2 FROM t1
+UNION
+(SELECT c1, c2 FROM t2 ORDER BY c2 DESC, c1 LIMIT 1)
+) AS res;
+c1 c2
+t1a 1
+t1a 2
+t1a 3
+t1b 2
+t1b 1
+t2a 3
+SELECT c1, c2 FROM (
+SELECT c1, c2 FROM t1
+UNION
+SELECT c1, c2 FROM t2
+ORDER BY c2 DESC, c1 DESC LIMIT 1
+) AS res;
+c1 c2
+t2a 3
+SELECT c1, c2 FROM (
+(
+(SELECT c1, c2 FROM t1)
+UNION
+(SELECT c1, c2 FROM t2)
+)
+ORDER BY c2 DESC, c1 ASC LIMIT 1
+) AS res;
+c1 c2
+t1a 3
+DROP TABLE t1, t2;
+#
+# Bug #58970 Problem Subquery (without referencing a table)
+# and Order By
+#
+SELECT(SELECT 0 AS a UNION SELECT 1 AS a ORDER BY a ASC LIMIT 1) AS dev;
+dev
+0
+SELECT(SELECT 0 AS a UNION SELECT 1 AS a ORDER BY a DESC LIMIT 1) AS dev;
+dev
+1
+SELECT(SELECT 0 AS a FROM dual UNION SELECT 1 AS a FROM dual ORDER BY a ASC LIMIT 1) AS dev;
+dev
+0
+SELECT(SELECT 0 AS a FROM dual UNION SELECT 1 AS a FROM dual ORDER BY a DESC LIMIT 1) AS dev;
+dev
+1
+SELECT(SELECT 1 AS a ORDER BY a) AS dev;
+dev
+1
+SELECT(SELECT 1 AS a LIMIT 1) AS dev;
+dev
+1
+SELECT(SELECT 1 AS a FROM dual ORDER BY a DESC LIMIT 1) AS dev;
+dev
+1
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index a680e837cae..589186184c3 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -445,6 +445,15 @@ IF(
count(*), 1)
1
DROP TABLE t1;
+select @v:=@v:=sum(1) from dual;
+@v:=@v:=sum(1)
+1
+CREATE TABLE t1(a DECIMAL(31,21));
+INSERT INTO t1 VALUES (0);
+SELECT (@v:=a) <> (@v:=1) FROM t1;
+(@v:=a) <> (@v:=1)
+1
+DROP TABLE t1;
End of 5.1 tests
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(f1 INT AUTO_INCREMENT, PRIMARY KEY(f1));
diff --git a/mysql-test/r/variables-big.result b/mysql-test/r/variables-big.result
index 960fc6d22f4..02908502c8b 100644
--- a/mysql-test/r/variables-big.result
+++ b/mysql-test/r/variables-big.result
@@ -1,20 +1,22 @@
+SET @def_var= @@session.transaction_prealloc_size;
SET SESSION transaction_prealloc_size=1024*1024*1024*1;
SHOW PROCESSLIST;
Id User Host db Command Time State Info
-<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST
+<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST
SET SESSION transaction_prealloc_size=1024*1024*1024*2;
SHOW PROCESSLIST;
Id User Host db Command Time State Info
-<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST
+<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST
SET SESSION transaction_prealloc_size=1024*1024*1024*3;
SHOW PROCESSLIST;
Id User Host db Command Time State Info
-<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST
+<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST
SET SESSION transaction_prealloc_size=1024*1024*1024*4;
SHOW PROCESSLIST;
Id User Host db Command Time State Info
-<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST
+<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST
SET SESSION transaction_prealloc_size=1024*1024*1024*5;
SHOW PROCESSLIST;
Id User Host db Command Time State Info
-<Id> root localhost test Query <Time> NULL SHOW PROCESSLIST
+<Id> root <Host> test Query <Time> NULL SHOW PROCESSLIST
+SET @@session.transaction_prealloc_size= @def_var;
diff --git a/mysql-test/r/variables-notembedded.result b/mysql-test/r/variables-notembedded.result
index 8c6d54757ed..ceac676589f 100644
--- a/mysql-test/r/variables-notembedded.result
+++ b/mysql-test/r/variables-notembedded.result
@@ -108,3 +108,27 @@ SET @@session.slave_skip_errors= 7;
ERROR HY000: Variable 'slave_skip_errors' is a read only variable
SET @@global.slave_skip_errors= 7;
ERROR HY000: Variable 'slave_skip_errors' is a read only variable
+#
+# Bug #11766769 : 59959: SMALL VALUES OF --MAX-ALLOWED-PACKET
+# ARE NOT BEING HONORED
+#
+CREATE TABLE t1 (a MEDIUMTEXT);
+SET GLOBAL max_allowed_packet=2048;
+Warnings:
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
+SET GLOBAL net_buffer_length=4096;
+Warnings:
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
+SHOW SESSION VARIABLES LIKE 'max_allowed_packet';
+Variable_name Value
+max_allowed_packet 2048
+SHOW SESSION VARIABLES LIKE 'net_buffer_length';
+Variable_name Value
+net_buffer_length 4096
+ERROR 08S01: Got a packet bigger than 'max_allowed_packet' bytes
+SELECT LENGTH(a) FROM t1;
+LENGTH(a)
+SET GLOBAL max_allowed_packet=default;
+SET GLOBAL net_buffer_length=default;
+DROP TABLE t1;
+End of 5.1 tests
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index ba27802bce3..29f477fcfd2 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -501,6 +501,7 @@ set low_priority_updates=1;
set global max_allowed_packet=100;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '100'
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
set global max_binlog_cache_size=100;
Warnings:
Warning 1292 Truncated incorrect max_binlog_cache_size value: '100'
@@ -1048,6 +1049,8 @@ set global max_write_lock_count =default;
set global myisam_data_pointer_size =@my_myisam_data_pointer_size;
set global myisam_max_sort_file_size =@my_myisam_max_sort_file_size;
set global net_buffer_length =@my_net_buffer_length;
+Warnings:
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
set global net_write_timeout =@my_net_write_timeout;
set global net_read_timeout =@my_net_read_timeout;
set global rpl_recovery_rank =@my_rpl_recovery_rank;
@@ -1499,6 +1502,58 @@ SELECT @@skip_name_resolve;
SHOW VARIABLES LIKE 'skip_name_resolve';
Variable_name Value
skip_name_resolve OFF
+#
+# Bug #43233 : Some server variables are clipped during "update,"
+# not "check" stage
+#
+SET @kbs=@@global.key_buffer_size;
+SET @kcbs=@@global.key_cache_block_size;
+throw errors in STRICT mode
+SET SQL_MODE=STRICT_ALL_TABLES;
+SET @@global.max_binlog_cache_size=-1;
+ERROR 42000: Variable 'max_binlog_cache_size' can't be set to the value of '-1'
+SET @@global.max_join_size=0;
+ERROR 42000: Variable 'max_join_size' can't be set to the value of '0'
+SET @@global.key_buffer_size=0;
+ERROR HY000: Cannot drop default keycache
+SET @@global.key_cache_block_size=0;
+ERROR 42000: Variable 'key_cache_block_size' can't be set to the value of '0'
+throw warnings in default mode
+SET SQL_MODE=DEFAULT;
+SET @@global.max_binlog_cache_size=-1;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_cache_size value: '-1'
+SET @@global.max_join_size=0;
+Warnings:
+Warning 1292 Truncated incorrect max_join_size value: '0'
+SET @@global.key_buffer_size=0;
+ERROR HY000: Cannot drop default keycache
+SET @@global.key_cache_block_size=0;
+Warnings:
+Warning 1292 Truncated incorrect key_cache_block_size value: '0'
+select @@max_long_data_size;
+@@max_long_data_size
+1048576
+#
+# Bug#11766424 59527: DECIMAL_BIN_SIZE: ASSERTION `SCALE >= 0 && PRECISION > 0 && SCALE <= PRE
+#
+CREATE TABLE t1(f1 DECIMAL(1,1) UNSIGNED);
+INSERT INTO t1 VALUES (0.2),(0.1);
+SELECT 1 FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE @a=f1);
+1
+1
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT @a:= CAST(1 AS UNSIGNED) AS a;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(1) unsigned NOT NULL DEFAULT '0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+SET @@global.max_binlog_cache_size=DEFAULT;
+SET @@global.max_join_size=DEFAULT;
+SET @@global.key_buffer_size=@kbs;
+SET @@global.key_cache_block_size=@kcbs;
End of 5.1 tests
#
@@ -1687,3 +1742,25 @@ set @@session.autocommit=t1_min(), @@session.autocommit=t1_max(),
drop table t1;
drop function t1_min;
drop function t1_max;
+#
+# Bug #59884: setting charset to 2048 crashes
+#
+set session character_set_results = 2048;
+ERROR 42000: Unknown character set: '2048'
+set session character_set_client=2048;
+ERROR 42000: Unknown character set: '2048'
+set session character_set_connection=2048;
+ERROR 42000: Unknown character set: '2048'
+set session character_set_server=2048;
+ERROR 42000: Unknown character set: '2048'
+set session collation_server=2048;
+ERROR HY000: Unknown collation: '2048'
+set session character_set_filesystem=2048;
+ERROR 42000: Unknown character set: '2048'
+set session character_set_database=2048;
+ERROR 42000: Unknown character set: '2048'
+set session collation_connection=2048;
+ERROR HY000: Unknown collation: '2048'
+set session collation_database=2048;
+ERROR HY000: Unknown collation: '2048'
+End of 5.5 tests
diff --git a/mysql-test/r/variables_debug.result b/mysql-test/r/variables_debug.result
index a823c6778a0..63592b2146c 100644
--- a/mysql-test/r/variables_debug.result
+++ b/mysql-test/r/variables_debug.result
@@ -45,3 +45,47 @@ SELECT @@debug;
SET @@debug = @old_local_debug;
End of 5.1 tests
+#
+# Bug#46165 server crash in dbug
+#
+SET @old_globaldebug = @@global.debug;
+SET @old_sessiondebug= @@session.debug;
+# Test 1 - Bug test case, single connection
+SET GLOBAL debug= '+O,../../log/bug46165.1.trace';
+SET SESSION debug= '-d:-t:-i';
+SET GLOBAL debug= '';
+SET SESSION debug= '';
+# Test 2 - Bug test case, two connections
+# Connection default
+SET GLOBAL debug= '+O,../../log/bug46165.2.trace';
+SET SESSION debug= '-d:-t:-i';
+# Connection con1
+SET GLOBAL debug= '';
+# Connection default
+SET SESSION debug= '';
+# Connection con1
+# Connection default
+SET GLOBAL debug= '';
+# Test 3 - Active session trace file on disconnect
+# Connection con1
+SET GLOBAL debug= '+O,../../log/bug46165.3.trace';
+SET SESSION debug= '-d:-t:-i';
+SET GLOBAL debug= '';
+# Test 4 - Active session trace file on two connections
+# Connection default
+SET GLOBAL debug= '+O,../../log/bug46165.4.trace';
+SET SESSION debug= '-d:-t:-i';
+# Connection con1
+SET SESSION debug= '-d:-t:-i';
+SET GLOBAL debug= '';
+SET SESSION debug= '';
+# Connection default
+SET SESSION debug= '';
+# Connection con1
+# Connection default
+# Test 5 - Different trace files
+SET SESSION debug= '+O,../../log/bug46165.5.trace';
+SET SESSION debug= '+O,../../log/bug46165.6.trace';
+SET SESSION debug= '-O';
+SET GLOBAL debug= @old_globaldebug;
+SET SESSION debug= @old_sessiondebug;
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index f4c93ddb36d..fff10b73469 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -840,6 +840,8 @@ 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 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL
v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+Warnings:
+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;
create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1;
@@ -3997,6 +3999,28 @@ CREATE VIEW v1 AS SELECT 1 from t1
WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1'));
DROP VIEW v1;
DROP TABLE t1;
+#
+# Bug#57703 create view cause Assertion failed: 0, file .\item_subselect.cc, line 846
+#
+CREATE TABLE t1(a int);
+CREATE VIEW v1 AS SELECT 1 FROM t1 GROUP BY
+SUBSTRING(1 FROM (SELECT 3 FROM t1 WHERE a >= ANY(SELECT 1)));
+DROP VIEW v1;
+DROP TABLE t1;
+#
+# Bug#57352 valgrind warnings when creating view
+#
+CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f;
+DROP VIEW v1;
+#
+# Bug 11829681 - 60295: ERROR 1356 ON VIEW THAT EXECUTES FINE AS A QUERY
+#
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT s.* FROM t1 s, t1 b HAVING a;
+SELECT * FROM v1;
+a
+DROP VIEW v1;
+DROP TABLE t1;
# -----------------------------------------------------------------
# -- End of 5.1 tests.
# -----------------------------------------------------------------
diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result
index 1412df20012..9a0408bc174 100644
--- a/mysql-test/r/view_grant.result
+++ b/mysql-test/r/view_grant.result
@@ -1248,3 +1248,129 @@ Note 1449 The user specified as a definer ('unknown'@'unknown') does not exist
LOCK TABLES v1 READ;
ERROR HY000: The user specified as a definer ('unknown'@'unknown') does not exist
DROP VIEW v1;
+#
+# Bug #58499 "DEFINER-security view selecting from INVOKER-security view
+# access check wrong".
+#
+# Check that we correctly handle privileges for various combinations
+# of INVOKER and DEFINER-security views using each other.
+DROP DATABASE IF EXISTS mysqltest1;
+CREATE DATABASE mysqltest1;
+USE mysqltest1;
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 (j INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2);
+#
+# 1) DEFINER-security view uses INVOKER-security view (covers
+# scenario originally described in the bug report).
+CREATE SQL SECURITY INVOKER VIEW v1_uses_t1 AS SELECT * FROM t1;
+CREATE SQL SECURITY INVOKER VIEW v1_uses_t2 AS SELECT * FROM t2;
+CREATE USER 'mysqluser1'@'%';
+GRANT CREATE VIEW ON mysqltest1.* TO 'mysqluser1'@'%';
+GRANT SELECT ON t1 TO 'mysqluser1'@'%';
+# To be able create 'v2_uses_t2' we also need select on t2.
+GRANT SELECT ON t2 TO 'mysqluser1'@'%';
+GRANT SELECT ON v1_uses_t1 TO 'mysqluser1'@'%';
+GRANT SELECT ON v1_uses_t2 TO 'mysqluser1'@'%';
+#
+# Connection 'mysqluser1'.
+CREATE SQL SECURITY DEFINER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
+CREATE SQL SECURITY DEFINER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
+#
+# Connection 'default'.
+CREATE USER 'mysqluser2'@'%';
+GRANT SELECT ON v2_uses_t1 TO 'mysqluser2'@'%';
+GRANT SELECT ON v2_uses_t2 TO 'mysqluser2'@'%';
+GRANT SELECT ON t2 TO 'mysqluser2'@'%';
+GRANT CREATE VIEW ON mysqltest1.* TO 'mysqluser2'@'%';
+# Make 'mysqluser1' unable to access t2.
+REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
+#
+# Connection 'mysqluser2'.
+# The below statement should succeed thanks to suid nature of v2_uses_t1.
+SELECT * FROM v2_uses_t1;
+i
+1
+# The below statement should fail due to suid nature of v2_uses_t2.
+SELECT * FROM v2_uses_t2;
+ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+#
+# 2) INVOKER-security view uses INVOKER-security view.
+#
+# Connection 'default'.
+DROP VIEW v2_uses_t1, v2_uses_t2;
+CREATE SQL SECURITY INVOKER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
+CREATE SQL SECURITY INVOKER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
+GRANT SELECT ON v2_uses_t1 TO 'mysqluser1'@'%';
+GRANT SELECT ON v2_uses_t2 TO 'mysqluser1'@'%';
+GRANT SELECT ON v1_uses_t1 TO 'mysqluser2'@'%';
+GRANT SELECT ON v1_uses_t2 TO 'mysqluser2'@'%';
+#
+# Connection 'mysqluser1'.
+# For both versions of 'v2' 'mysqluser1' privileges should be used.
+SELECT * FROM v2_uses_t1;
+i
+1
+SELECT * FROM v2_uses_t2;
+ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+#
+# Connection 'mysqluser2'.
+# And now for both versions of 'v2' 'mysqluser2' privileges should
+# be used.
+SELECT * FROM v2_uses_t1;
+ERROR HY000: View 'mysqltest1.v2_uses_t1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+SELECT * FROM v2_uses_t2;
+j
+2
+#
+# 3) INVOKER-security view uses DEFINER-security view.
+#
+# Connection 'default'.
+DROP VIEW v1_uses_t1, v1_uses_t2;
+# To be able create 'v1_uses_t2' we also need select on t2.
+GRANT SELECT ON t2 TO 'mysqluser1'@'%';
+#
+# Connection 'mysqluser1'.
+CREATE SQL SECURITY DEFINER VIEW v1_uses_t1 AS SELECT * FROM t1;
+CREATE SQL SECURITY DEFINER VIEW v1_uses_t2 AS SELECT * FROM t2;
+#
+# Connection 'default'.
+# Make 'mysqluser1' unable to access t2.
+REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
+#
+# Connection 'mysqluser2'.
+# Due to suid nature of v1_uses_t1 and v1_uses_t2 the first
+# select should succeed and the second select should fail.
+SELECT * FROM v2_uses_t1;
+i
+1
+SELECT * FROM v2_uses_t2;
+ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+#
+# 4) DEFINER-security view uses DEFINER-security view.
+#
+# Connection 'default'.
+DROP VIEW v2_uses_t1, v2_uses_t2;
+# To be able create 'v2_uses_t2' we also need select on t2.
+GRANT SELECT ON t2 TO 'mysqluser1'@'%';
+#
+# Connection 'mysqluser2'.
+CREATE SQL SECURITY DEFINER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
+CREATE SQL SECURITY DEFINER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
+#
+# Connection 'default'.
+# Make 'mysqluser1' unable to access t2.
+REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
+#
+# Connection 'mysqluser2'.
+# Again privileges of creator of innermost views should apply.
+SELECT * FROM v2_uses_t1;
+i
+1
+SELECT * FROM v2_uses_t2;
+ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+USE test;
+DROP DATABASE mysqltest1;
+DROP USER 'mysqluser1'@'%';
+DROP USER 'mysqluser2'@'%';
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index 611e807ce8e..0f2d12d86c9 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -330,3 +330,25 @@ Warning 1264 Out of range value for column 'a' at row 2
Warning 1264 Out of range value for column 'a' at row 4
drop table t1;
End of 5.1 tests
+
+-- Bug#55847
+
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS f1;
+CREATE TABLE t1(a INT UNIQUE);
+CREATE FUNCTION f1(x INT) RETURNS INT
+BEGIN
+INSERT INTO t1 VALUES(x);
+INSERT INTO t1 VALUES(x);
+RETURN x;
+END|
+
+SHOW TABLES WHERE f1(11) = 11;
+ERROR 23000: Duplicate entry '11' for key 'a'
+
+SHOW WARNINGS;
+Level Code Message
+Error 1062 Duplicate entry '11' for key 'a'
+
+DROP TABLE t1;
+DROP FUNCTION f1;
diff --git a/mysql-test/r/xa.result b/mysql-test/r/xa.result
index fedbb43ea2a..7b580abb19f 100644
--- a/mysql-test/r/xa.result
+++ b/mysql-test/r/xa.result
@@ -131,3 +131,101 @@ XA START 'xid1';
XA END 'xid1';
XA ROLLBACK 'xid1';
DROP TABLE t1;
+#
+# Bug#56448 Assertion failed: ! is_set() with second xa end
+#
+XA START 'x';
+XA END 'x';
+XA END 'x';
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
+XA PREPARE 'x';
+XA PREPARE 'x';
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
+XA ROLLBACK 'x';
+#
+# Bug#59986 Assert in Diagnostics_area::set_ok_status() for XA COMMIT
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a)) engine=InnoDB;
+INSERT INTO t1 VALUES (1, 1), (2, 2);
+# Connection con1
+XA START 'a';
+UPDATE t1 SET b= 3 WHERE a=1;
+# Connection default
+XA START 'b';
+UPDATE t1 SET b=4 WHERE a=2;
+# Sending:
+UPDATE t1 SET b=5 WHERE a=1;
+# Connection con1
+UPDATE t1 SET b=6 WHERE a=2;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+XA COMMIT 'a';
+ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected
+# Connection default
+# Reaping: UPDATE t1 SET b=5 WHERE a=1
+XA END 'b';
+XA ROLLBACK 'b';
+DROP TABLE t1;
+#
+# Bug#11766752 59936: multiple xa assertions - transactional
+# statement fuzzer
+#
+CREATE TABLE t1 (a INT) engine=InnoDB;
+XA START 'a';
+INSERT INTO t1 VALUES (1);
+SAVEPOINT savep;
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
+XA END 'a';
+SELECT * FROM t1;
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
+INSERT INTO t1 VALUES (2);
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
+SAVEPOINT savep;
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
+SET @a=(SELECT * FROM t1);
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
+XA PREPARE 'a';
+SELECT * FROM t1;
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
+INSERT INTO t1 VALUES (2);
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
+SAVEPOINT savep;
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
+SET @a=(SELECT * FROM t1);
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
+UPDATE t1 SET a=1 WHERE a=2;
+ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the PREPARED state
+XA COMMIT 'a';
+SELECT * FROM t1;
+a
+1
+DROP TABLE t1;
+#
+# Bug#12352846 - TRANS_XA_START(THD*):
+# ASSERTION THD->TRANSACTION.XID_STATE.XID.IS_NULL()
+# FAILED
+#
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+# Connection con2
+XA START 'xid1';
+# Sending:
+INSERT INTO t2 SELECT a FROM t1;
+# Connection default
+# Waiting until INSERT ... is blocked
+DELETE FROM t1;
+COMMIT;
+# Connection con2
+# Reaping: INSERT INTO t2 SELECT a FROM t1
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+XA COMMIT 'xid1';
+ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected
+XA START 'xid1';
+XA END 'xid1';
+XA PREPARE 'xid1';
+XA ROLLBACK 'xid1';
+# Connection default
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result
index fad2cab0e57..8ca9ab84bf7 100644
--- a/mysql-test/r/xml.result
+++ b/mysql-test/r/xml.result
@@ -1093,4 +1093,56 @@ Warnings:
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT'
DROP TABLE t1;
+#
+# Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
+#
+SET NAMES utf8;
+SELECT REPLACE(EXTRACTVALUE('1', '/a'),'ds','');
+REPLACE(EXTRACTVALUE('1', '/a'),'ds','')
+
+#
+# Bug #57820 extractvalue crashes
+#
+SELECT AVG(DISTINCT EXTRACTVALUE((''),('$@k')));
+AVG(DISTINCT EXTRACTVALUE((''),('$@k')))
+NULL
+#
+# Bug#57279 updatexml dies with: Assertion failed: str_arg[length] == 0
+#
+SELECT UPDATEXML(NULL, (LPAD(0.1111E-15, '2011', 1)), 1);
+ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing
+SELECT EXTRACTVALUE('', LPAD(0.1111E-15, '2011', 1));
+ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing
+#
+# Bug #44332 my_xml_scan reads behind the end of buffer
+#
+SELECT UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1');
+UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1')
+NULL
+Warnings:
+Warning 1525 Incorrect XML value: 'parse error at line 1 pos 2: END-OF-INPUT unexpected (ident or '/' wanted)'
+SELECT UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1');
+UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1')
+NULL
+#
+# Bug#11766725 (bug#59901): EXTRACTVALUE STILL BROKEN AFTER FIX FOR BUG #44332
+#
+SELECT ExtractValue(CONVERT('<\"', BINARY(10)), 1);
+ExtractValue(CONVERT('<\"', BINARY(10)), 1)
+NULL
+Warnings:
+Warning 1525 Incorrect XML value: 'parse error at line 1 pos 11: STRING unexpected (ident or '/' wanted)'
End of 5.1 tests
+#
+# Start of 5.5 tests
+#
+#
+# Bug#58175 xml functions read initialized bytes when conversions happen
+#
+SET NAMES latin1;
+SELECT UPDATEXML(CONVERT('' USING swe7), TRUNCATE('',1), 0);
+UPDATEXML(CONVERT('' USING swe7), TRUNCATE('',1), 0)
+NULL
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/std_data/bug47205.frm b/mysql-test/std_data/bug47205.frm
new file mode 100644
index 00000000000..6d53b221d28
--- /dev/null
+++ b/mysql-test/std_data/bug47205.frm
Binary files differ
diff --git a/mysql-test/std_data/bug57108.cnf b/mysql-test/std_data/bug57108.cnf
new file mode 100644
index 00000000000..5fd8c485cf0
--- /dev/null
+++ b/mysql-test/std_data/bug57108.cnf
@@ -0,0 +1,95 @@
+[mysqld]
+open-files-limit=1024
+character-set-server=latin1
+connect-timeout=4711
+log-bin-trust-function-creators=1
+key_buffer_size=1M
+sort_buffer=256K
+max_heap_table_size=1M
+loose-innodb_data_file_path=ibdata1:10M:autoextend
+loose-innodb_buffer_pool_size=8M
+loose-innodb_write_io_threads=2
+loose-innodb_read_io_threads=2
+loose-innodb_log_buffer_size=1M
+loose-innodb_log_file_size=5M
+loose-innodb_additional_mem_pool_size=1M
+loose-innodb_log_files_in_group=2
+slave-net-timeout=120
+log-bin=mysqld-bin
+loose-enable-performance-schema
+loose-performance-schema-max-mutex-instances=10000
+loose-performance-schema-max-rwlock-instances=10000
+loose-performance-schema-max-table-instances=500
+loose-performance-schema-max-table-handles=1000
+binlog-direct-non-transactional-updates
+
+[mysql]
+default-character-set=latin1
+
+[mysqlshow]
+default-character-set=latin1
+
+[mysqlimport]
+default-character-set=latin1
+
+[mysqlcheck]
+default-character-set=latin1
+
+[mysql_upgrade]
+default-character-set=latin1
+tmpdir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp
+
+[mysqld.1]
+#!run-master-sh
+log-bin=master-bin
+loose-enable-performance-schema
+basedir=/home/bzr/bugs/b57108-5.5-bugteam
+tmpdir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1
+character-sets-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/charsets
+lc-messages-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/
+datadir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/data
+pid-file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/run/mysqld.1.pid
+#host=localhost
+port=13000
+socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
+#log-error=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/log/mysqld.1.err
+general_log=1
+general_log_file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/mysqld.log
+slow_query_log=1
+slow_query_log_file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/mysqld-slow.log
+#user=root
+#password=
+server-id=1
+secure-file-priv=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var
+ssl-ca=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/cacert.pem
+ssl-cert=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/server-cert.pem
+ssl-key=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/server-key.pem
+
+[mysqlbinlog]
+disable-force-if-open
+character-sets-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/charsets
+
+[ENV]
+MASTER_MYPORT=13000
+MASTER_MYSOCK=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
+
+[client]
+password=
+user=root
+port=13000
+host=localhost
+socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
+
+[mysqltest]
+ssl-ca=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/cacert.pem
+ssl-cert=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/client-cert.pem
+ssl-key=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/client-key.pem
+skip-ssl=1
+
+[client.1]
+password=
+user=root
+port=13000
+host=localhost
+socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
+
diff --git a/mysql-test/std_data/checkDBI_DBD-mysql.pl b/mysql-test/std_data/checkDBI_DBD-mysql.pl
new file mode 100644
index 00000000000..f001e471081
--- /dev/null
+++ b/mysql-test/std_data/checkDBI_DBD-mysql.pl
@@ -0,0 +1,97 @@
+#!/usr/bin/perl
+
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+################################################################################
+#
+# This perl script checks for availability of the Perl modules DBI and
+# DBD::mysql using the "current" perl interpreter.
+#
+# Useful for test environment checking before testing executable perl scripts
+# in the MySQL Server distribution.
+#
+# NOTE: The "shebang" on the first line of this script should always point to
+# /usr/bin/perl, so that we can use this script to check whether or not we
+# support running perl scripts with such a shebang without specifying the
+# perl interpreter on the command line. Such a script is mysqlhotcopy.
+#
+# When run as "checkDBI_DBD-mysql.pl" the shebang line will be evaluated
+# and used. When run as "perl checkDBI_DBD-mysql.pl" the shebang line is
+# not used.
+#
+# NOTE: This script will create a temporary file in MTR's tmp dir.
+# If modules are found, a mysql-test statement which sets a special
+# variable is written to this file. If one of the modules is not found
+# (or cannot be loaded), the file will remain empty.
+# A test (or include file) which sources that file can then easily do
+# an if-check on the special variable to determine success or failure.
+#
+# Example:
+#
+# --let $perlChecker= $MYSQLTEST_VARDIR/std_data/checkDBI_DBD-mysql.pl
+# --let $resultFile= $MYSQL_TMP_DIR/dbidbd-mysql.txt
+# --chmod 0755 $perlChecker
+# --exec $perlChecker
+# --source $resultFile
+# if (!$dbidbd) {
+# --skip Test needs Perl modules DBI and DBD::mysql
+# }
+#
+# The calling script is also responsible for cleaning up after use:
+#
+# --remove_file $resultFile
+#
+# Windows notes:
+# - shebangs may work differently - call this script with "perl " in front.
+#
+# See mysql-test/include/have_dbi_dbd-mysql.inc for example use of this script.
+# This script should be executable for the user running MTR.
+#
+################################################################################
+
+BEGIN {
+ # By using eval inside BEGIN we can suppress warnings and continue after.
+ # We need to catch "Can't locate" as well as "Can't load" errors.
+ eval{
+ $FOUND_DBI=0;
+ $FOUND_DBD_MYSQL=0;
+
+ # Check for DBI module:
+ $FOUND_DBI=1 if require DBI;
+
+ # Check for DBD::mysql module
+ $FOUND_DBD_MYSQL=1 if require DBD::mysql;
+ };
+};
+
+# Open a file to be used for transfer of result back to mysql-test.
+# The file must be created whether we write to it or not, otherwise mysql-test
+# will complain if trying to source it.
+# An empty file indicates failure to load modules.
+open(FILE, ">", $ENV{'MYSQL_TMP_DIR'}.'/dbidbd-mysql.txt');
+
+if ($FOUND_DBI && $FOUND_DBD_MYSQL) {
+ # write a mysql-test command setting a variable to indicate success
+ print(FILE 'let $dbidbd= FOUND_DBI_DBD-MYSQL;'."\n");
+}
+
+# close the file.
+close(FILE);
+
+1;
+
diff --git a/mysql-test/collections/test-bt-debug-fast b/mysql-test/std_data/cluster_7022_table.MYD
index e69de29bb2d..e69de29bb2d 100644
--- a/mysql-test/collections/test-bt-debug-fast
+++ b/mysql-test/std_data/cluster_7022_table.MYD
diff --git a/mysql-test/std_data/cluster_7022_table.MYI b/mysql-test/std_data/cluster_7022_table.MYI
new file mode 100644
index 00000000000..332b0e64797
--- /dev/null
+++ b/mysql-test/std_data/cluster_7022_table.MYI
Binary files differ
diff --git a/mysql-test/std_data/cluster_7022_table.frm b/mysql-test/std_data/cluster_7022_table.frm
new file mode 100644
index 00000000000..84714a1721a
--- /dev/null
+++ b/mysql-test/std_data/cluster_7022_table.frm
Binary files differ
diff --git a/mysql-test/std_data/parts/t1TIMESTAMP.frm b/mysql-test/std_data/parts/t1TIMESTAMP.frm
new file mode 100644
index 00000000000..c9fc49d86a9
--- /dev/null
+++ b/mysql-test/std_data/parts/t1TIMESTAMP.frm
Binary files differ
diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result
index 7fb5e50a219..9a9f328f2b5 100644
--- a/mysql-test/suite/binlog/r/binlog_base64_flag.result
+++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result
@@ -91,6 +91,9 @@ iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA==
';
ERROR HY000: master may suffer from http://bugs.mysql.com/bug.php?id=37426 so slave stops; check error log on slave for more info
drop table t1, char63_utf8, char128_utf8;
+call mtr.add_suppression("Slave SQL.*master suffers from this bug: http:..bugs.mysql.com.bug.php.id=37426.* Error_code: 1105");
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.char128_utf8. cannot be converted.* Error_code: 1677");
#
# Bug #54393: crash and/or valgrind errors in
# mysql_client_binlog_statement
diff --git a/mysql-test/suite/binlog/r/binlog_bug23533.result b/mysql-test/suite/binlog/r/binlog_bug23533.result
new file mode 100644
index 00000000000..d5cd93284a2
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_bug23533.result
@@ -0,0 +1,15 @@
+SET AUTOCOMMIT=0;
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1000
+SET GLOBAL binlog_cache_size=4096;
+SET GLOBAL max_binlog_cache_size=4096;
+START TRANSACTION;
+CREATE TABLE t2 SELECT * FROM t1;
+ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
+COMMIT;
+SHOW TABLES LIKE 't%';
+Tables_in_test (t%)
+t1
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_bug36391.result b/mysql-test/suite/binlog/r/binlog_bug36391.result
new file mode 100644
index 00000000000..551bfb9924d
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_bug36391.result
@@ -0,0 +1,10 @@
+CREATE TABLE t1(id INT);
+SHOW TABLES;
+Tables_in_test
+t1
+FLUSH LOGS;
+DROP TABLE t1;
+SHOW TABLES;
+Tables_in_test
+t1
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result
index b6299f9a940..0eaed3c97d7 100644
--- a/mysql-test/suite/binlog/r/binlog_database.result
+++ b/mysql-test/suite/binlog/r/binlog_database.result
@@ -39,6 +39,28 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
FLUSH STATUS;
+#
+# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT
+# BASED REPLICATION
+#
+DROP DATABASE IF EXISTS db1;
+DROP TABLE IF EXISTS t3;
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (a INT);
+CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb;
+CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b))
+engine=innodb;
+RESET MASTER;
+DROP DATABASE db1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+SHOW TABLES FROM db1;
+Tables_in_db1
+t2
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `db1`; drop table `t1`
+DROP TABLE t3;
+DROP DATABASE db1;
set binlog_format=mixed;
reset master;
create database testing_1;
@@ -80,6 +102,28 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
FLUSH STATUS;
+#
+# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT
+# BASED REPLICATION
+#
+DROP DATABASE IF EXISTS db1;
+DROP TABLE IF EXISTS t3;
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (a INT);
+CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb;
+CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b))
+engine=innodb;
+RESET MASTER;
+DROP DATABASE db1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+SHOW TABLES FROM db1;
+Tables_in_db1
+t2
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `db1`; drop table `t1`
+DROP TABLE t3;
+DROP DATABASE db1;
set binlog_format=row;
reset master;
create database testing_1;
@@ -122,6 +166,28 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
FLUSH STATUS;
+#
+# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT
+# BASED REPLICATION
+#
+DROP DATABASE IF EXISTS db1;
+DROP TABLE IF EXISTS t3;
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (a INT);
+CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb;
+CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b))
+engine=innodb;
+RESET MASTER;
+DROP DATABASE db1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+SHOW TABLES FROM db1;
+Tables_in_db1
+t2
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `db1`; drop table `t1`
+DROP TABLE t3;
+DROP DATABASE db1;
show databases;
Database
information_schema
diff --git a/mysql-test/suite/rpl/r/rpl_drop_if_exists.result b/mysql-test/suite/binlog/r/binlog_drop_if_exists.result
index 0c398bed440..0c398bed440 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_if_exists.result
+++ b/mysql-test/suite/binlog/r/binlog_drop_if_exists.result
diff --git a/mysql-test/suite/binlog/r/binlog_index.result b/mysql-test/suite/binlog/r/binlog_index.result
index e2688a15899..21a290bfc3b 100644
--- a/mysql-test/suite/binlog/r/binlog_index.result
+++ b/mysql-test/suite/binlog/r/binlog_index.result
@@ -2,8 +2,10 @@ call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file');
call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
+call mtr.add_suppression('Could not open .*');
call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
flush tables;
+RESET MASTER;
flush logs;
flush logs;
flush logs;
@@ -118,11 +120,31 @@ master-bin.000011
# This should put the server in unsafe state and stop
# accepting any command. If we inject a fault at this
# point and continue the execution the server crashes.
-# Besides the flush command does not report an error.
#
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000006
+master-bin.000007
+master-bin.000008
+master-bin.000009
+master-bin.000010
+master-bin.000011
+
# fault_injection_registering_index
SET SESSION debug="+d,fault_injection_registering_index";
flush logs;
+ERROR HY000: Can't open file: 'master-bin.000012' (errno: 1)
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000006
+master-bin.000007
+master-bin.000008
+master-bin.000009
+master-bin.000010
+master-bin.000011
+
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
@@ -137,6 +159,18 @@ master-bin.000012
# fault_injection_updating_index
SET SESSION debug="+d,fault_injection_updating_index";
flush logs;
+ERROR HY000: Can't open file: 'master-bin.000013' (errno: 1)
+SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
+SELECT @index;
+@index
+master-bin.000006
+master-bin.000007
+master-bin.000008
+master-bin.000009
+master-bin.000010
+master-bin.000011
+master-bin.000012
+
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
SELECT @index;
@index
diff --git a/mysql-test/suite/binlog/r/binlog_innodb.result b/mysql-test/suite/binlog/r/binlog_innodb.result
index dc170361026..cdb72aad902 100644
--- a/mysql-test/suite/binlog/r/binlog_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_innodb.result
@@ -123,7 +123,7 @@ Binlog_cache_disk_use 0
create table t1 (a int) engine=innodb;
show status like "binlog_cache_use";
Variable_name Value
-Binlog_cache_use 2
+Binlog_cache_use 1
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
@@ -132,7 +132,7 @@ delete from t1;
commit;
show status like "binlog_cache_use";
Variable_name Value
-Binlog_cache_use 4
+Binlog_cache_use 2
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
diff --git a/mysql-test/suite/binlog/r/binlog_innodb_row.result b/mysql-test/suite/binlog/r/binlog_innodb_row.result
index 093628c29cc..61f961f16da 100644
--- a/mysql-test/suite/binlog/r/binlog_innodb_row.result
+++ b/mysql-test/suite/binlog/r/binlog_innodb_row.result
@@ -59,3 +59,20 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */
###############################################
+#
+# Bug#12346411 SQL/LOG.CC:6509: ASSERTION `PREPARED_XIDS > 0' FAILED
+#
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1(a INT PRIMARY KEY) engine=innodb;
+CREATE TABLE t2(a INT) engine=myisam;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION;
+INSERT INTO t2 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1);
+COMMIT;
+INSERT INTO t1 VALUES (2);
+START TRANSACTION;
+INSERT INTO t2 VALUES (2);
+UPDATE IGNORE t1 SET a=1 WHERE a=2;
+COMMIT;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/binlog/r/binlog_max_extension.result b/mysql-test/suite/binlog/r/binlog_max_extension.result
index af341db4536..f69ffcce16a 100644
--- a/mysql-test/suite/binlog/r/binlog_max_extension.result
+++ b/mysql-test/suite/binlog/r/binlog_max_extension.result
@@ -3,6 +3,5 @@ call mtr.add_suppression("Log filename extension number exhausted:");
call mtr.add_suppression("Can't generate a unique log-filename");
RESET MASTER;
FLUSH LOGS;
-Warnings:
-Warning 1098 Can't generate a unique log-filename master-bin.(1-999)
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
diff --git a/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result
deleted file mode 100644
index 637be940383..00000000000
--- a/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result
+++ /dev/null
@@ -1,25 +0,0 @@
-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
-drop table if exists t1;
-create table t1 (a int) engine=innodb;
-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
-begin;
-delete from t1;
-commit;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 4
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 1
-drop table t1;
diff --git a/mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result b/mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result
new file mode 100644
index 00000000000..09cdab8414a
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_mixed_cache_stat.result
@@ -0,0 +1,66 @@
+drop table if exists t1, t2;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+**** Preparing the enviroment to check commit and its effect on status variables.
+**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+**** Transactional changes which are long enough so they will be flushed to disk...
+**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+**** Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+commit;
+**** Non-Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+commit;
+**** Mixed changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+commit;
+**** Preparing the enviroment to check abort and its effect on the status variables.
+**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+**** Transactional changes which are long enough so they will be flushed to disk...
+**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+**** Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+rollback;
+**** Non-Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+**** Mixed changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+drop table t1, t2;
diff --git a/mysql-test/suite/binlog/r/binlog_old_versions.result b/mysql-test/suite/binlog/r/binlog_old_versions.result
index 77289252b4c..a4850b835c8 100644
--- a/mysql-test/suite/binlog/r/binlog_old_versions.result
+++ b/mysql-test/suite/binlog/r/binlog_old_versions.result
@@ -1,4 +1,3 @@
-DROP TABLE IF EXISTS t1, t2, t3;
==== Read modern binlog (version 5.1.23) ====
SELECT * FROM t1 ORDER BY a;
a b
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_query_filter_rules.result b/mysql-test/suite/binlog/r/binlog_query_filter_rules.result
index 520d500ed7c..520d500ed7c 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_query_filter_rules.result
+++ b/mysql-test/suite/binlog/r/binlog_query_filter_rules.result
diff --git a/mysql-test/suite/binlog/r/binlog_reset_master.result b/mysql-test/suite/binlog/r/binlog_reset_master.result
new file mode 100644
index 00000000000..b3d605560ff
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_reset_master.result
@@ -0,0 +1 @@
+RESET MASTER;
diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result
index e45f4a76643..323d50d8f32 100644
--- a/mysql-test/suite/binlog/r/binlog_row_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result
@@ -1218,8 +1218,8 @@ master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
drop table t1,t2,t3,tt1;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-insert delayed into t1 values (207);
-insert delayed into t1 values (null);
+insert /* before delayed */ delayed /* after delayed */ into t1 values (207);
+insert /*! delayed */ into t1 values (null);
insert delayed into t1 values (300);
FLUSH TABLES;
show binlog events from <binlog_start>;
@@ -1330,3 +1330,63 @@ Log_name Pos Event_type Server_id End_log_pos Info
# # Write_rows 1 # table_id: # flags: STMT_END_F
# # Query 1 # COMMIT
DROP TABLE t1;
+
+# BUG#54903 BINLOG statement toggles session variables
+# ----------------------------------------------------------------------
+# This test verify that BINLOG statement doesn't change current session's
+# variables foreign_key_checks and unique_checks.
+
+CREATE TABLE t1 (c1 INT KEY);
+SET @@SESSION.foreign_key_checks= ON;
+SET @@SESSION.unique_checks= ON;
+# INSERT INTO t1 VALUES (1)
+# foreign_key_checks=0 and unique_checks=0
+BINLOG '
+dfLtTBMBAAAAKQAAANcAAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA==
+';
+SELECT * FROM t1;
+c1
+1
+# Their values should be ON
+SHOW SESSION VARIABLES LIKE "%_checks";
+Variable_name Value
+foreign_key_checks ON
+unique_checks ON
+
+SET @@SESSION.foreign_key_checks= OFF;
+SET @@SESSION.unique_checks= OFF;
+# INSERT INTO t1 VALUES(2)
+# foreign_key_checks=1 and unique_checks=1
+BINLOG '
+dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
+';
+SELECT * FROM t1;
+c1
+1
+2
+# Their values should be OFF
+SHOW SESSION VARIABLES LIKE "%_checks";
+Variable_name Value
+foreign_key_checks OFF
+unique_checks OFF
+# INSERT INTO t1 VALUES(2)
+# foreign_key_checks=1 and unique_checks=1
+# It should not change current session's variables, even error happens
+call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062");
+BINLOG '
+dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
+';
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SELECT * FROM t1;
+c1
+1
+2
+# Their values should be OFF
+SHOW SESSION VARIABLES LIKE "%_checks";
+Variable_name Value
+foreign_key_checks OFF
+unique_checks OFF
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_row_cache_stat.result b/mysql-test/suite/binlog/r/binlog_row_cache_stat.result
new file mode 100644
index 00000000000..09cdab8414a
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_row_cache_stat.result
@@ -0,0 +1,66 @@
+drop table if exists t1, t2;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+**** Preparing the enviroment to check commit and its effect on status variables.
+**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+**** Transactional changes which are long enough so they will be flushed to disk...
+**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+**** Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+commit;
+**** Non-Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+commit;
+**** Mixed changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+commit;
+**** Preparing the enviroment to check abort and its effect on the status variables.
+**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+**** Transactional changes which are long enough so they will be flushed to disk...
+**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+**** Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+rollback;
+**** Non-Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+**** Mixed changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+drop table t1, t2;
diff --git a/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
deleted file mode 100644
index 637be940383..00000000000
--- a/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
+++ /dev/null
@@ -1,25 +0,0 @@
-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
-drop table if exists t1;
-create table t1 (a int) engine=innodb;
-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
-begin;
-delete from t1;
-commit;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 4
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 1
-drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_server_id.result b/mysql-test/suite/binlog/r/binlog_server_id.result
index f7d778a288b..f7d778a288b 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id.result
+++ b/mysql-test/suite/binlog/r/binlog_server_id.result
diff --git a/mysql-test/suite/rpl/r/rpl_sf.result b/mysql-test/suite/binlog/r/binlog_sf.result
index 085ba1ebb8a..085ba1ebb8a 100644
--- a/mysql-test/suite/rpl/r/rpl_sf.result
+++ b/mysql-test/suite/binlog/r/binlog_sf.result
diff --git a/mysql-test/suite/binlog/r/binlog_sql_mode.result b/mysql-test/suite/binlog/r/binlog_sql_mode.result
index e306040502d..4477c94a95e 100644
--- a/mysql-test/suite/binlog/r/binlog_sql_mode.result
+++ b/mysql-test/suite/binlog/r/binlog_sql_mode.result
@@ -1,9 +1,3 @@
-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_sql_mode= @@global.sql_mode;
SET @old_binlog_format=@@session.binlog_format;
SET SESSION sql_mode=8;
@@ -27,7 +21,7 @@ DO
BEGIN
UPDATE t1 SET id = id +1;
END;|
-Chceck Result
+Check Result
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog"))
is not null;
diff --git a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
index 2219961aca0..cdcc96b94b0 100644
--- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
+++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result
@@ -1,6 +1,6 @@
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-insert delayed into t1 values (207);
-insert delayed into t1 values (null);
+insert /* before delayed */ delayed /* after delayed */ into t1 values (207);
+insert /*! delayed */ into t1 values (null);
insert delayed into t1 values (300);
FLUSH TABLES;
show binlog events from <binlog_start>;
@@ -10,14 +10,14 @@ master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern)
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; insert delayed into t1 values (207)
+master-bin.000001 # Query # # use `test`; insert /* before delayed */ /* after delayed */ into t1 values (207)
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Intvar # # INSERT_ID=208
-master-bin.000001 # Query # # use `test`; insert delayed into t1 values (null)
+master-bin.000001 # Query # # use `test`; insert /*! */ into t1 values (null)
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300)
+master-bin.000001 # Query # # use `test`; insert into t1 values (300)
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; FLUSH TABLES
RESET MASTER;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
index 55809d4bda1..1a05a930e2c 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
@@ -719,8 +719,8 @@ master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhos
master-bin.000001 # Query # # COMMIT
drop table t1,t2,t3,tt1;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-insert delayed into t1 values (207);
-insert delayed into t1 values (null);
+insert /* before delayed */ delayed /* after delayed */ into t1 values (207);
+insert /*! delayed */ into t1 values (null);
insert delayed into t1 values (300);
FLUSH TABLES;
show binlog events from <binlog_start>;
@@ -822,3 +822,63 @@ Log_name Pos Event_type Server_id End_log_pos Info
# # Write_rows 1 # table_id: # flags: STMT_END_F
# # Query 1 # COMMIT
DROP TABLE t1;
+
+# BUG#54903 BINLOG statement toggles session variables
+# ----------------------------------------------------------------------
+# This test verify that BINLOG statement doesn't change current session's
+# variables foreign_key_checks and unique_checks.
+
+CREATE TABLE t1 (c1 INT KEY);
+SET @@SESSION.foreign_key_checks= ON;
+SET @@SESSION.unique_checks= ON;
+# INSERT INTO t1 VALUES (1)
+# foreign_key_checks=0 and unique_checks=0
+BINLOG '
+dfLtTBMBAAAAKQAAANcAAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA==
+';
+SELECT * FROM t1;
+c1
+1
+# Their values should be ON
+SHOW SESSION VARIABLES LIKE "%_checks";
+Variable_name Value
+foreign_key_checks ON
+unique_checks ON
+
+SET @@SESSION.foreign_key_checks= OFF;
+SET @@SESSION.unique_checks= OFF;
+# INSERT INTO t1 VALUES(2)
+# foreign_key_checks=1 and unique_checks=1
+BINLOG '
+dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
+';
+SELECT * FROM t1;
+c1
+1
+2
+# Their values should be OFF
+SHOW SESSION VARIABLES LIKE "%_checks";
+Variable_name Value
+foreign_key_checks OFF
+unique_checks OFF
+# INSERT INTO t1 VALUES(2)
+# foreign_key_checks=1 and unique_checks=1
+# It should not change current session's variables, even error happens
+call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.t1; Duplicate entry .2. for key .PRIMARY., Error_code: 1062");
+BINLOG '
+dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
+dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
+';
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+SELECT * FROM t1;
+c1
+1
+2
+# Their values should be OFF
+SHOW SESSION VARIABLES LIKE "%_checks";
+Variable_name Value
+foreign_key_checks OFF
+unique_checks OFF
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_cache_stat.result b/mysql-test/suite/binlog/r/binlog_stm_cache_stat.result
new file mode 100644
index 00000000000..09cdab8414a
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_cache_stat.result
@@ -0,0 +1,66 @@
+drop table if exists t1, t2;
+create table t1 (a int) engine=innodb;
+create table t2 (a int) engine=myisam;
+**** Preparing the enviroment to check commit and its effect on status variables.
+**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+**** Transactional changes which are long enough so they will be flushed to disk...
+**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+**** Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+commit;
+**** Non-Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+commit;
+**** Mixed changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+commit;
+**** Preparing the enviroment to check abort and its effect on the status variables.
+**** Expected: binlog_cache_use = 0, binlog_cache_disk_use = 0.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+flush status;
+**** Transactional changes which are long enough so they will be flushed to disk...
+**** Expected: binlog_cache_use = 1, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+**** Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 0, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+rollback;
+**** Non-Transactional changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 2, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 1, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t2 values( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+**** Mixed changes which should not be flushed to disk and so should not
+**** increase either binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+**** Expected: binlog_cache_use = 3, binlog_cache_disk_use = 1.
+**** Expected: binlog_stmt_cache_use = 2, binlog_stmt_cache_disk_use = 0.
+begin;
+insert into t1 values( 1 );
+insert into t2 values( 1 );
+rollback;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+drop table t1, t2;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
deleted file mode 100644
index 637be940383..00000000000
--- a/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
+++ /dev/null
@@ -1,25 +0,0 @@
-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
-drop table if exists t1;
-create table t1 (a int) engine=innodb;
-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
-begin;
-delete from t1;
-commit;
-show status like "binlog_cache_use";
-Variable_name Value
-Binlog_cache_use 4
-show status like "binlog_cache_disk_use";
-Variable_name Value
-Binlog_cache_disk_use 1
-drop table t1;
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
index 20d82557122..da2e24506fd 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
@@ -698,7 +698,7 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
-master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`=((@b) + `bug27417`(2)) ;file_id=#
+master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`= @b + bug27417(2) ;file_id=#
master-bin.000001 # Query # # ROLLBACK
/* the output must denote there is the query */;
drop trigger trg_del_t2;
@@ -950,7 +950,7 @@ master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
-master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`=((@b) + `bug27417`(2)) ;file_id=#
+master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`= @b + bug27417(2) ;file_id=#
master-bin.000001 # Query # # ROLLBACK
drop trigger trg_del_t2;
drop table t1,t2,t3,t4,t5;
diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result
index 19d04169589..e8449f0cd11 100644
--- a/mysql-test/suite/binlog/r/binlog_unsafe.result
+++ b/mysql-test/suite/binlog/r/binlog_unsafe.result
@@ -2418,7 +2418,7 @@ INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
DROP TABLE t1,t2;
"Should NOT have any warning message issued in the following func7() and trig"
CREATE TABLE t1 (a INT);
-CREATE TABLE t2 (a CHAR(40));
+CREATE TABLE t2 (a TEXT);
CREATE TABLE trigger_table (a CHAR(7));
CREATE FUNCTION func7()
RETURNS INT
diff --git a/mysql-test/suite/binlog/t/binlog_base64_flag.test b/mysql-test/suite/binlog/t/binlog_base64_flag.test
index 3f1e4e98bec..2ec979aade0 100644
--- a/mysql-test/suite/binlog/t/binlog_base64_flag.test
+++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test
@@ -151,6 +151,9 @@ iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA==
drop table t1, char63_utf8, char128_utf8;
+call mtr.add_suppression("Slave SQL.*master suffers from this bug: http:..bugs.mysql.com.bug.php.id=37426.* Error_code: 1105");
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.char128_utf8. cannot be converted.* Error_code: 1677");
--echo #
--echo # Bug #54393: crash and/or valgrind errors in
diff --git a/mysql-test/suite/binlog/t/binlog_bug23533.test b/mysql-test/suite/binlog/t/binlog_bug23533.test
new file mode 100644
index 00000000000..ca610e399e4
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_bug23533.test
@@ -0,0 +1,50 @@
+#############################################################
+# Bug#23533: CREATE SELECT max_binlog_cache_size test
+# case needed
+#############################################################
+
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+--source include/have_binlog_format_row.inc
+
+SET AUTOCOMMIT=0;
+
+# Create 1st table
+CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB;
+--disable_query_log
+let $i= 1000;
+while ($i)
+{
+ BEGIN;
+ eval INSERT INTO t1 VALUES($i, REPEAT('x', 4096));
+ COMMIT;
+ dec $i;
+}
+--enable_query_log
+SELECT COUNT(*) FROM t1;
+
+# Set small value for max_binlog_cache_size
+let $saved_binlog_cache_size= query_get_value(SELECT @@binlog_cache_size AS Value, Value, 1);
+let $saved_max_binlog_cache_size= query_get_value(SELECT @@max_binlog_cache_size AS Value, Value, 1);
+SET GLOBAL binlog_cache_size=4096;
+SET GLOBAL max_binlog_cache_size=4096;
+
+# New value of max_binlog_cache_size will apply to new session
+disconnect default;
+connect(default,localhost,root,,test);
+
+# Copied data from t1 into t2 large than max_binlog_cache_size
+START TRANSACTION;
+--error ER_TRANS_CACHE_FULL
+CREATE TABLE t2 SELECT * FROM t1;
+COMMIT;
+SHOW TABLES LIKE 't%';
+
+# 5.1 End of Test
+--disable_query_log
+eval SET GLOBAL max_binlog_cache_size=$saved_max_binlog_cache_size;
+eval SET GLOBAL binlog_cache_size=$saved_binlog_cache_size;
+--enable_query_log
+DROP TABLE t1;
+disconnect default;
+connect(default,localhost,root,,test);
diff --git a/mysql-test/suite/bugs/t/rpl_bug36391-master.opt b/mysql-test/suite/binlog/t/binlog_bug36391-master.opt
index 56273241f14..56273241f14 100644
--- a/mysql-test/suite/bugs/t/rpl_bug36391-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_bug36391-master.opt
diff --git a/mysql-test/suite/binlog/t/binlog_bug36391.test b/mysql-test/suite/binlog/t/binlog_bug36391.test
new file mode 100644
index 00000000000..64d91dfafd9
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_bug36391.test
@@ -0,0 +1,30 @@
+#
+# BUG#36391 and BUG#38731
+#
+# The fix for BUG#20103 "Escaping with backslash does not work as expected"
+# was implemented too greedy though in that it not only changes the behavior
+# of backslashes within strings but in general, so disabling command shortcuts
+# like \G or \C (which in turn leads to BUG#36391: "mysqlbinlog creates invalid charset statements".
+#
+# The test executes simple commands that are stored in the binary log and
+# re-execute them through the mysql client which should have to process
+# some command shortcuts. The backslashes within strings is disabled in the file
+# rpl_bug36391-master.opt by the option --sql_mode=NO_BACKSLASH_ESCAPES.
+#
+#
+
+--source include/have_log_bin.inc
+--source include/have_binlog_format_mixed.inc
+
+CREATE TABLE t1(id INT);
+let $binlog= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_path= `SELECT CONCAT(@@DATADIR, '$binlog')`;
+SHOW TABLES;
+FLUSH LOGS;
+DROP TABLE t1;
+
+--exec $MYSQL_BINLOG $binlog_path | $MYSQL test
+SHOW TABLES;
+
+# Clean up
+DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/t/rpl_drop_if_exists.test b/mysql-test/suite/binlog/t/binlog_drop_if_exists.test
index 6b2b37ae791..6b2b37ae791 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_if_exists.test
+++ b/mysql-test/suite/binlog/t/binlog_drop_if_exists.test
diff --git a/mysql-test/suite/binlog/t/binlog_index-master.opt b/mysql-test/suite/binlog/t/binlog_index-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_index-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/binlog/t/binlog_index.test b/mysql-test/suite/binlog/t/binlog_index.test
index 3847e40aeb2..86c314e9236 100644
--- a/mysql-test/suite/binlog/t/binlog_index.test
+++ b/mysql-test/suite/binlog/t/binlog_index.test
@@ -6,15 +6,20 @@ source include/not_embedded.inc;
# Don't test this under valgrind, memory leaks will occur
--source include/not_valgrind.inc
source include/have_debug.inc;
+# Avoid CrashReporter popup on Mac
+--source include/not_crashrep.inc
call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file');
call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
+call mtr.add_suppression('Could not open .*');
call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
flush tables;
let $old=`select @@debug`;
+RESET MASTER;
+
let $MYSQLD_DATADIR= `select @@datadir`;
let $INDEX=$MYSQLD_DATADIR/master-bin.index;
@@ -208,12 +213,26 @@ SELECT @index;
--echo # This should put the server in unsafe state and stop
--echo # accepting any command. If we inject a fault at this
--echo # point and continue the execution the server crashes.
---echo # Besides the flush command does not report an error.
--echo #
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
--echo # fault_injection_registering_index
SET SESSION debug="+d,fault_injection_registering_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
flush logs;
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
--source include/restart_mysqld.inc
--chmod 0644 $INDEX
@@ -224,7 +243,16 @@ SELECT @index;
--echo # fault_injection_updating_index
SET SESSION debug="+d,fault_injection_updating_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
flush logs;
+
+--chmod 0644 $INDEX
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SET @index=LOAD_FILE('$index')
+-- replace_regex /\.[\\\/]master/master/
+SELECT @index;
+
--source include/restart_mysqld.inc
--chmod 0644 $INDEX
diff --git a/mysql-test/suite/binlog/t/binlog_innodb_row.test b/mysql-test/suite/binlog/t/binlog_innodb_row.test
index b491510c9c9..f4ad1058a7e 100644
--- a/mysql-test/suite/binlog/t/binlog_innodb_row.test
+++ b/mysql-test/suite/binlog/t/binlog_innodb_row.test
@@ -77,3 +77,29 @@ DROP TEMPORARY TABLE t1;
-- echo ###############################################
-- source include/show_binlog_events.inc
-- echo ###############################################
+
+
+--echo #
+--echo # Bug#12346411 SQL/LOG.CC:6509: ASSERTION `PREPARED_XIDS > 0' FAILED
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1(a INT PRIMARY KEY) engine=innodb;
+CREATE TABLE t2(a INT) engine=myisam;
+
+INSERT INTO t1 VALUES (1);
+START TRANSACTION;
+INSERT INTO t2 VALUES (1);
+INSERT IGNORE INTO t1 VALUES (1);
+COMMIT;
+
+INSERT INTO t1 VALUES (2);
+START TRANSACTION;
+INSERT INTO t2 VALUES (2);
+UPDATE IGNORE t1 SET a=1 WHERE a=2;
+COMMIT;
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/binlog/t/binlog_max_extension.test b/mysql-test/suite/binlog/t/binlog_max_extension.test
index 9f52d195e21..e5274d87b85 100644
--- a/mysql-test/suite/binlog/t/binlog_max_extension.test
+++ b/mysql-test/suite/binlog/t/binlog_max_extension.test
@@ -38,9 +38,7 @@ RESET MASTER;
##########
# 1. Stop master server
--- write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait
-EOF
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- shutdown_server 10
-- source include/wait_until_disconnected.inc
@@ -52,9 +50,7 @@ master-bin.2147483646
EOF
# 3. Restart the server
--- append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart
-EOF
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- enable_reconnect
-- source include/wait_until_connected_again.inc
@@ -62,7 +58,8 @@ EOF
# Assertion
###########
-# assertion: should throw warning
+# assertion: should raise error
+-- error ER_NO_UNIQUE_LOGFILE
FLUSH LOGS;
##############
@@ -70,9 +67,7 @@ FLUSH LOGS;
##############
# 1. Stop the server
--- write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait
-EOF
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- shutdown_server 10
-- source include/wait_until_disconnected.inc
@@ -85,8 +80,6 @@ EOF
-- remove_file $MYSQLD_DATADIR/master-bin.2147483647
# 3. Restart the server
--- append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart
-EOF
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-- enable_reconnect
-- source include/wait_until_connected_again.inc
diff --git a/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test
deleted file mode 100644
index 0be097c78ed..00000000000
--- a/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test
+++ /dev/null
@@ -1,5 +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.inc
--- source extra/binlog_tests/innodb_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test b/mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test
new file mode 100644
index 00000000000..3e63fb3bc9c
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_mixed_cache_stat.test
@@ -0,0 +1,5 @@
+# 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.inc
+-- source extra/binlog_tests/binlog_cache_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_old_versions.test b/mysql-test/suite/binlog/t/binlog_old_versions.test
index 0ccea406a82..b294adbc69d 100644
--- a/mysql-test/suite/binlog/t/binlog_old_versions.test
+++ b/mysql-test/suite/binlog/t/binlog_old_versions.test
@@ -24,9 +24,6 @@
source include/not_embedded.inc;
---disable_warnings
-DROP TABLE IF EXISTS t1, t2, t3;
-
--echo ==== Read modern binlog (version 5.1.23) ====
@@ -161,3 +158,4 @@ DROP TABLE t1, t2, t3;
#SELECT * FROM t1 ORDER BY a;
#SELECT * FROM t2 ORDER BY a;
#SELECT COUNT(*) FROM t3;
+#--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules-master.opt b/mysql-test/suite/binlog/t/binlog_query_filter_rules-master.opt
index 33632bf98e8..33632bf98e8 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_query_filter_rules-master.opt
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test b/mysql-test/suite/binlog/t/binlog_query_filter_rules.test
index d56a32ce2bd..d56a32ce2bd 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test
+++ b/mysql-test/suite/binlog/t/binlog_query_filter_rules.test
diff --git a/mysql-test/suite/binlog/t/binlog_reset_master.test b/mysql-test/suite/binlog/t/binlog_reset_master.test
new file mode 100644
index 00000000000..b7ad69da3ea
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_reset_master.test
@@ -0,0 +1,26 @@
+# ==== Purpose ====
+#
+# Test bugs in RESET MASTER.
+
+--source include/have_debug.inc
+--source include/have_log_bin.inc
+
+#######################################################################
+# BUG#12574820: binlog.binlog_tmp_table timing out in daily and weekly trunk run
+# Problem: MYSQL_BIN_LOG::reset_logs acquired LOCK_thread_count and
+# LOCK_log in the wrong order. This could cause a deadlock when
+# RESET MASTER was run concurrently with a disconnecting thread.
+#######################################################################
+
+# We use sleep, not debug_sync, because the sync point needs to be in
+# the thread shut down code after the debug sync facility has been
+# shut down.
+--let $write_var= SET DEBUG="+d,sleep_after_lock_thread_count_before_delete_thd"; CREATE TEMPORARY TABLE test.t1 (a INT);
+--let $write_to_file= GENERATE
+--disable_query_log
+--source include/write_var_to_file.inc
+--enable_query_log
+
+--exec $MYSQL < $write_to_file
+RESET MASTER;
+--remove_file $write_to_file
diff --git a/mysql-test/suite/binlog/t/binlog_row_cache_stat.test b/mysql-test/suite/binlog/t/binlog_row_cache_stat.test
new file mode 100644
index 00000000000..03f9c53f0cc
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_row_cache_stat.test
@@ -0,0 +1,5 @@
+# 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
+-- source extra/binlog_tests/binlog_cache_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test
deleted file mode 100644
index e4e6762226b..00000000000
--- a/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test
+++ /dev/null
@@ -1,5 +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
--- source extra/binlog_tests/innodb_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test b/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test
index 6682d84d9c9..2e3e53b86f1 100644
--- a/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test
+++ b/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test
@@ -83,17 +83,17 @@ while($i)
-- let $flags=--database=b42941
# construct CLI for mysqlbinlog
- if(`SELECT $i=3`)
+ if($i==3)
{
-- let $flags= $flags --verbose --hexdump
}
- if(`SELECT $i=2`)
+ if($i==2)
{
-- let $flags= $flags --verbose
}
-# if(`SELECT $i=1`)
+# if($i==1)
# {
# do nothing $flags is already set as it should be
# }
diff --git a/mysql-test/suite/rpl/t/rpl_server_id.test b/mysql-test/suite/binlog/t/binlog_server_id.test
index 6e98ec6ee6d..6e98ec6ee6d 100644
--- a/mysql-test/suite/rpl/t/rpl_server_id.test
+++ b/mysql-test/suite/binlog/t/binlog_server_id.test
diff --git a/mysql-test/suite/binlog/t/binlog_sf.test b/mysql-test/suite/binlog/t/binlog_sf.test
new file mode 100644
index 00000000000..05b31afcb58
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_sf.test
@@ -0,0 +1,191 @@
+-- source include/have_log_bin.inc
+
+# We change binlog format inside the test, so no need to re-run with
+# more than one binlog_format.
+-- source include/have_binlog_format_statement.inc
+
+# Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
+# BUG#41166 stored function requires "deterministic" if binlog_format is "statement"
+
+# 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_UNSAFE_ROUTINE
+select fn16456();
+
+
+
+# clean
+
+drop function fn16456;
+
+
+
+# success in definition with deterministic
+
+set global log_bin_trust_function_creators=0;
+
+delimiter |;
+create function fn16456()
+ returns int deterministic
+begin
+ return unix_timestamp();
+end|
+delimiter ;|
+
+
+
+# allow funcall in RBR
+
+set binlog_format=ROW;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+
+# allow funcall in SBR
+
+set binlog_format=STATEMENT;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+
+# clean
+
+drop function fn16456;
+
+
+# success in definition with NO SQL
+
+set global log_bin_trust_function_creators=0;
+
+delimiter |;
+create function fn16456()
+ returns int no sql
+begin
+ return unix_timestamp();
+end|
+delimiter ;|
+
+
+
+# allow funcall in RBR
+
+set binlog_format=ROW;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+
+# allow funcall in SBR
+
+set binlog_format=STATEMENT;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+# clean
+
+drop function fn16456;
+
+
+
+# success in definition with reads sql data
+
+set global log_bin_trust_function_creators=0;
+
+delimiter |;
+create function fn16456()
+ returns int reads sql data
+begin
+ return unix_timestamp();
+end|
+delimiter ;|
+
+
+
+# allow funcall in RBR
+
+set binlog_format=ROW;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+
+# allow funcall in SBR
+
+set binlog_format=STATEMENT;
+
+--replace_column 1 timestamp
+select fn16456();
+
+
+
+# clean
+
+drop function fn16456;
+
+
+
+# restore status
+
+--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/binlog/t/binlog_sql_mode.test b/mysql-test/suite/binlog/t/binlog_sql_mode.test
index 1777f8cb561..ab4f6450543 100644
--- a/mysql-test/suite/binlog/t/binlog_sql_mode.test
+++ b/mysql-test/suite/binlog/t/binlog_sql_mode.test
@@ -8,7 +8,6 @@
# Scan binlog file to check if the sql_mode is still set to 0 before generating binlog event
#
--- source include/master-slave.inc
-- source include/have_log_bin.inc
# BUG#39526 sql_mode not retained in binary log for CREATE PROCEDURE
@@ -50,10 +49,10 @@ CREATE EVENT testEvent ON SCHEDULE
END;|
DELIMITER ;|
---echo Chceck Result
+--echo Check Result
let $MYSQLD_DATADIR= `select @@datadir`;
---exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog
+--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog"))
diff --git a/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt b/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt
index 099f07e5d4e..62409b9f6be 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt
@@ -1 +1,2 @@
--max_binlog_size=4096 --default-storage-engine=MyISAM
+--force-restart
diff --git a/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test b/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test
new file mode 100644
index 00000000000..0f5aa9f6013
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_stm_cache_stat.test
@@ -0,0 +1,5 @@
+# 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_statement.inc
+-- source extra/binlog_tests/binlog_cache_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt b/mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt
index e2cfcb299cf..2a1187d3fe4 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_stm_do_db-master.opt
@@ -1 +1,2 @@
--binlog-do-db=b42829
+--force-restart
diff --git a/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
deleted file mode 100644
index c6017246e6d..00000000000
--- a/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
+++ /dev/null
@@ -1,5 +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_statement.inc
--- source extra/binlog_tests/innodb_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
index 35e4dd57877..022341ae833 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
@@ -116,7 +116,7 @@ DROP TABLE t1;
SET GLOBAL log_warnings = @old_log_warnings;
let $log_error_= `SELECT @@GLOBAL.log_error`;
-if(!`select LENGTH('$log_error_')`)
+if(!$log_error_)
{
# MySQL Server on windows is started with --console and thus
# does not know the location of its .err log, use default location
diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test
index 740649f0053..9fbdc9fc2c8 100644
--- a/mysql-test/suite/binlog/t/binlog_unsafe.test
+++ b/mysql-test/suite/binlog/t/binlog_unsafe.test
@@ -141,11 +141,11 @@ END|
# In each iteration of this loop, we select one method to make the
# statement unsafe.
--let $unsafe_type= 0
-while (`SELECT $unsafe_type < 9`) {
+while ($unsafe_type < 9) {
--echo
- if (`SELECT $unsafe_type = 0`) {
+ if ($unsafe_type == 0) {
--echo ==== Testing UUID() unsafeness ====
--let $desc_0= unsafe UUID() function
--let $stmt_sidef_0= INSERT INTO t0 VALUES (UUID())
@@ -155,7 +155,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 1
}
- if (`SELECT $unsafe_type = 1`) {
+ if ($unsafe_type == 1) {
--echo ==== Testing @@hostname unsafeness ====
--let $desc_0= unsafe @@hostname variable
--let $stmt_sidef_0= INSERT INTO t0 VALUES (@@hostname)
@@ -168,7 +168,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 1
}
- if (`SELECT $unsafe_type = 2`) {
+ if ($unsafe_type == 2) {
--echo ==== Testing SELECT...LIMIT unsafeness ====
--let $desc_0= unsafe SELECT...LIMIT statement
--let $stmt_sidef_0= INSERT INTO t0 SELECT * FROM data_table LIMIT 1
@@ -178,7 +178,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 1
}
- if (`SELECT $unsafe_type = 3`) {
+ if ($unsafe_type == 3) {
--echo ==== Testing INSERT DELAYED safeness after BUG#54579 is fixed ====
--let $desc_0= unsafe INSERT DELAYED statement
--let $stmt_sidef_0= INSERT DELAYED INTO t0 VALUES (1), (2)
@@ -188,7 +188,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 0
}
- if (`SELECT $unsafe_type = 4`) {
+ if ($unsafe_type == 4) {
--echo ==== Testing unsafeness of insert of two autoinc values ====
--let $desc_0= unsafe update of two autoinc columns
--let $stmt_sidef_0= INSERT INTO double_autoinc_table VALUES (NULL)
@@ -198,7 +198,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 1
}
- if (`SELECT $unsafe_type = 5`) {
+ if ($unsafe_type == 5) {
--echo ==== Testing unsafeness of UDF's ====
--let $desc_0= unsafe UDF
--let $stmt_sidef_0= INSERT INTO t0 VALUES (myfunc_int(10))
@@ -208,7 +208,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 1
}
- if (`SELECT $unsafe_type = 6`) {
+ if ($unsafe_type == 6) {
--echo ==== Testing unsafeness of access to mysql.general_log ====
--let $desc_0= unsafe use of mysql.general_log
--let $stmt_sidef_0= INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log
@@ -218,7 +218,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 1
}
- if (`SELECT $unsafe_type = 7`) {
+ if ($unsafe_type == 7) {
--echo ==== Testing a statement that is unsafe in many ways ====
--let $desc_0= statement that is unsafe in many ways
# Concatenate three unsafe values, and then concatenate NULL to
@@ -230,7 +230,7 @@ while (`SELECT $unsafe_type < 9`) {
--let $CRC_ARG_expected_number_of_warnings= 6
}
- if (`SELECT $unsafe_type = 8`) {
+ if ($unsafe_type == 8) {
--echo ==== Testing a statement that is unsafe several times ====
--let $desc_0= statement that is unsafe several times
--let $stmt_sidef_0= INSERT INTO ta0 VALUES (multi_unsafe_func())
@@ -249,7 +249,7 @@ while (`SELECT $unsafe_type < 9`) {
# construct. Instead, we just invoke the unsafe statement directly.
--let $call_type_1= 0
- while (`SELECT $call_type_1 < 8`) {
+ while ($call_type_1 < 8) {
#--echo debug: level 1, types $call_type_1 -> $unsafe_type
--let $CRC_ARG_level= 1
--let $CRC_ARG_type= $call_type_1
@@ -280,7 +280,7 @@ while (`SELECT $unsafe_type < 9`) {
# construct.
--let $call_type_2= 0
- while (`SELECT $call_type_2 < 7`) {
+ while ($call_type_2 < 7) {
#--echo debug: level 2, types $call_type_2 -> $call_type_1 -> $unsafe_type
--let $CRC_ARG_level= 2
--let $CRC_ARG_type= $call_type_2
@@ -309,7 +309,7 @@ while (`SELECT $unsafe_type < 9`) {
# construct.
--let $call_type_3= 0
- while (`SELECT $call_type_3 < 7`) {
+ while ($call_type_3 < 7) {
#--echo debug: level 3, types $call_type_2 -> $call_type_2 -> $call_type_1 -> $unsafe_type
--let $CRC_ARG_level= 3
--let $CRC_ARG_type= $call_type_3
@@ -321,7 +321,7 @@ while (`SELECT $unsafe_type < 9`) {
--source extra/rpl_tests/create_recursive_construct.inc
# Drop created object.
- if (`SELECT '$drop_3' != ''`) {
+ if ($drop_3) {
--eval $drop_3
}
--inc $call_type_3
@@ -330,7 +330,7 @@ while (`SELECT $unsafe_type < 9`) {
} # if (!is_toplevel_2)
# Drop created object.
- if (`SELECT '$drop_2' != ''`) {
+ if ($drop_2) {
--eval $drop_2
}
--inc $call_type_2
@@ -338,7 +338,7 @@ while (`SELECT $unsafe_type < 9`) {
} # if (!is_toplevel_1)
# Drop created object.
- if (`SELECT '$drop_1' != ''`) {
+ if ($drop_1) {
--eval $drop_1
}
--inc $call_type_1
@@ -481,7 +481,7 @@ DROP TABLE t1,t2;
--echo "Should NOT have any warning message issued in the following func7() and trig"
CREATE TABLE t1 (a INT);
-CREATE TABLE t2 (a CHAR(40));
+CREATE TABLE t2 (a TEXT);
CREATE TABLE trigger_table (a CHAR(7));
DELIMITER |;
CREATE FUNCTION func7()
diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def
index a9841f592f8..1abc9951322 100644
--- a/mysql-test/suite/binlog/t/disabled.def
+++ b/mysql-test/suite/binlog/t/disabled.def
@@ -9,6 +9,5 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-
-binlog_truncate_innodb : BUG#42643 2009-02-06 mats Changes to InnoDB requires to complete fix for BUG#36763
-binlog_spurious_ddl_errors : BUG#54195 2010-06-03 alik binlog_spurious_ddl_errors.test fails, thus disabled
+binlog_truncate_innodb : BUG#11764459 2010-10-20 anitha Originally disabled due to BUG#42643. Product bug fixed, but test changes needed
+binlog_spurious_ddl_errors : BUG#11761680 2010-06-03 alik binlog_spurious_ddl_errors.test fails, thus disabled
diff --git a/mysql-test/suite/bugs/combinations b/mysql-test/suite/bugs/combinations
deleted file mode 100644
index 07042c2cbec..00000000000
--- a/mysql-test/suite/bugs/combinations
+++ /dev/null
@@ -1,8 +0,0 @@
-[row]
-binlog-format=row
-
-[stmt]
-binlog-format=statement
-
-[mix]
-binlog-format=mixed
diff --git a/mysql-test/suite/bugs/data/rpl_bug12691.dat b/mysql-test/suite/bugs/data/rpl_bug12691.dat
deleted file mode 100644
index de980441c3a..00000000000
--- a/mysql-test/suite/bugs/data/rpl_bug12691.dat
+++ /dev/null
@@ -1,3 +0,0 @@
-a
-b
-c
diff --git a/mysql-test/suite/bugs/r/rpl_bug12691.result b/mysql-test/suite/bugs/r/rpl_bug12691.result
deleted file mode 100644
index 8feeb0effc3..00000000000
--- a/mysql-test/suite/bugs/r/rpl_bug12691.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;
-
-**** On Master ****
-CREATE TABLE t1 (b CHAR(10));
-
-**** On Slave ****
-STOP SLAVE;
-
-**** On Master ****
-LOAD DATA INFILE FILENAME
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-3
-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 (b CHAR(10))
-master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
-master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat' INTO TABLE `t1` FIELDS TERMINATED BY '|' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`b`) ;file_id=#
-
-**** On Slave ****
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-0
-
-**** On Master ****
-DROP TABLE t1;
diff --git a/mysql-test/suite/bugs/r/rpl_bug23533.result b/mysql-test/suite/bugs/r/rpl_bug23533.result
deleted file mode 100644
index 1dda75a69b0..00000000000
--- a/mysql-test/suite/bugs/r/rpl_bug23533.result
+++ /dev/null
@@ -1,23 +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;
-SET AUTOCOMMIT=0;
-SET GLOBAL max_binlog_cache_size=4096;
-SHOW VARIABLES LIKE 'max_binlog_cache_size';
-Variable_name Value
-max_binlog_cache_size 4096
-CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-1000
-START TRANSACTION;
-CREATE TABLE t2 SELECT * FROM t1;
-ERROR HY000: Writing one row to the row-based binary log failed
-COMMIT;
-SHOW TABLES LIKE 't%';
-Tables_in_test (t%)
-t1
diff --git a/mysql-test/suite/bugs/r/rpl_bug31582.result b/mysql-test/suite/bugs/r/rpl_bug31582.result
deleted file mode 100644
index 1f71fbf8fe7..00000000000
--- a/mysql-test/suite/bugs/r/rpl_bug31582.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 (a VARCHAR(10) PRIMARY KEY) ENGINE=MyISAM;
-INSERT INTO t1 VALUES ('a');
-UPDATE t1 SET a = 'MyISAM';
-SELECT * FROM t1 ORDER BY a;
-a
-MyISAM
-SELECT * FROM t1 ORDER BY a;
-a
-MyISAM
-DROP TABLE t1;
diff --git a/mysql-test/suite/bugs/r/rpl_bug31583.result b/mysql-test/suite/bugs/r/rpl_bug31583.result
deleted file mode 100644
index 74846607313..00000000000
--- a/mysql-test/suite/bugs/r/rpl_bug31583.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 ( a INT, b INT DEFAULT -3 );
-INSERT INTO t1 VALUES (1, DEFAULT);
-UPDATE t1 SET a = 3;
-SELECT * FROM t1 ORDER BY a;
-a b
-3 -3
-SELECT * FROM t1 ORDER BY a;
-a b
-3 -3
-DROP TABLE t1;
diff --git a/mysql-test/suite/bugs/r/rpl_bug33029.result b/mysql-test/suite/bugs/r/rpl_bug33029.result
deleted file mode 100644
index d11ae1cc0be..00000000000
--- a/mysql-test/suite/bugs/r/rpl_bug33029.result
+++ /dev/null
@@ -1,15 +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 not null auto_increment primary key);
-create trigger `trg` before insert on `t1` for each row begin end;
-set @@global.debug="+d,simulate_bug33029";
-stop slave;
-start slave;
-insert into `t1` values ();
-select * from t1;
-id
-1
diff --git a/mysql-test/suite/bugs/r/rpl_bug36391.result b/mysql-test/suite/bugs/r/rpl_bug36391.result
deleted file mode 100644
index 33175d89d30..00000000000
--- a/mysql-test/suite/bugs/r/rpl_bug36391.result
+++ /dev/null
@@ -1,18 +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(id int);
-show tables;
-Tables_in_test
-t1
-show master status;
-File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
-flush logs;
-drop table t1;
diff --git a/mysql-test/suite/bugs/r/rpl_bug37426.result b/mysql-test/suite/bugs/r/rpl_bug37426.result
deleted file mode 100644
index 24dfd27ca01..00000000000
--- a/mysql-test/suite/bugs/r/rpl_bug37426.result
+++ /dev/null
@@ -1,17 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-CREATE TABLE char128_utf8 (
-i1 INT NOT NULL,
-c CHAR(128) CHARACTER SET utf8 NOT NULL,
-i2 INT NOT NULL);
-INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
-SELECT * FROM char128_utf8;
-i1 c i2
-1 123 1
-SELECT * FROM char128_utf8;
-i1 c i2
-1 123 1
diff --git a/mysql-test/suite/bugs/r/rpl_bug38205.result b/mysql-test/suite/bugs/r/rpl_bug38205.result
deleted file mode 100644
index 8f1dee344fa..00000000000
--- a/mysql-test/suite/bugs/r/rpl_bug38205.result
+++ /dev/null
@@ -1,56 +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 t1i(n int primary key) engine=innodb;
-create table t2m(n int primary key) engine=myisam;
-begin;
-insert into t1i values (1);
-insert into t1i values (2);
-insert into t1i values (3);
-commit;
-begin;
-insert into t1i values (5);
-begin;
-insert into t1i values (4);
-insert into t2m values (1);
-update t1i set n = 5 where n = 4;
-commit;
-zero
-0
-*** kill sql thread ***
-rollback;
-*** sql thread is *not* running: No ***
-*** the prove: the killed slave has not finished the current transaction ***
-three
-3
-one
-1
-zero
-0
-delete from t2m;
-start slave sql_thread;
-delete from t1i;
-delete from t2m;
-begin;
-insert into t1i values (5);
-begin;
-insert into t1i values (4);
-update t1i set n = 5 where n = 4;
-commit;
-zero
-0
-stop slave sql_thread;
-rollback;
-*** sql thread is *not* running: No ***
-*** the prove: the stopped slave has rolled back the current transaction ***
-zero
-0
-zero
-0
-one
-1
-start slave sql_thread;
-drop table t1i, t2m;
diff --git a/mysql-test/suite/bugs/t/rpl_bug12691.test b/mysql-test/suite/bugs/t/rpl_bug12691.test
deleted file mode 100644
index 28d7f16935e..00000000000
--- a/mysql-test/suite/bugs/t/rpl_bug12691.test
+++ /dev/null
@@ -1,51 +0,0 @@
-# Bug#12691: Exec_master_log_pos corrupted with SQL_SLAVE_SKIP_COUNTER
-# Date: 01/31/2008
-# Added: Serge Kozlov <skozlov@mysql.com>
-
---source include/master-slave.inc
---connection master
---source include/have_binlog_format_mixed_or_statement.inc
-
---echo
---echo **** On Master ****
-CREATE TABLE t1 (b CHAR(10));
---echo
---echo **** On Slave ****
---sync_slave_with_master
-STOP SLAVE;
---source include/wait_for_slave_to_stop.inc
-
---connection master
-
---echo
---echo **** On Master ****
---exec cp $MYSQL_TEST_DIR/suite/bugs/data/rpl_bug12691.dat $MYSQLTEST_VARDIR/tmp/
---echo LOAD DATA INFILE FILENAME
---disable_query_log
---eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat' INTO TABLE t1 FIELDS TERMINATED BY '|'
---enable_query_log
---remove_file $MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat
-
-SELECT COUNT(*) FROM t1;
-
-source include/show_binlog_events.inc;
-
---save_master_pos
-
---connection slave
---echo
---echo **** On Slave ****
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-START SLAVE;
---source include/wait_for_slave_to_start.inc
---sync_with_master
-
-SELECT COUNT(*) FROM t1;
-
-# Clean up
---connection master
---echo
---echo **** On Master ****
-DROP TABLE t1;
---sync_slave_with_master
-
diff --git a/mysql-test/suite/bugs/t/rpl_bug23533.test b/mysql-test/suite/bugs/t/rpl_bug23533.test
deleted file mode 100644
index 397f1102f0e..00000000000
--- a/mysql-test/suite/bugs/t/rpl_bug23533.test
+++ /dev/null
@@ -1,43 +0,0 @@
-#############################################################
-# Author: Serge Kozlov <skozlov@mysql.com>
-# Date: 02/26/2008
-# Purpose: testing bug report
-# Bug#23533: CREATE SELECT max_binlog_cache_size test
-# case needed
-#############################################################
-
---source include/have_innodb.inc
---source include/have_binlog_format_row.inc
---source include/master-slave.inc
-
-
---disable_warnings
-DROP TABLE IF EXISTS t1,t2;
---enable_warnings
-
-SET AUTOCOMMIT=0;
-SET GLOBAL max_binlog_cache_size=4096;
-SHOW VARIABLES LIKE 'max_binlog_cache_size';
-
-CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB;
-
---disable_query_log
-let $i= 1000;
-while ($i)
-{
- eval INSERT INTO t1 VALUES($i, REPEAT('x', 4096));
- dec $i;
-}
---enable_query_log
-
-SELECT COUNT(*) FROM t1;
-
-# Copied data from t1 into t2 large than max_binlog_cache_size
-START TRANSACTION;
---error 1534
-CREATE TABLE t2 SELECT * FROM t1;
-COMMIT;
-SHOW TABLES LIKE 't%';
-
-
-# 5.1 End of Test
diff --git a/mysql-test/suite/bugs/t/rpl_bug31582.test b/mysql-test/suite/bugs/t/rpl_bug31582.test
deleted file mode 100644
index 7ba15eec8ce..00000000000
--- a/mysql-test/suite/bugs/t/rpl_bug31582.test
+++ /dev/null
@@ -1,25 +0,0 @@
-
-# BUG#31582: 5.1-telco-6.1 -> 5.1.22. Slave crashes when reading
-# UPDATE for VARCHAR
-
-# This is a problem for any update statement replicating from an old
-# server to a new server. The bug consisted of a new slave trying to
-# read two column bitmaps, but there is only one available in the old
-# format.
-
-# This test case should be executed replicating from an old server to
-# a new server, so make sure you have one handy.
-
-source include/master-slave.inc;
-
-CREATE TABLE t1 (a VARCHAR(10) PRIMARY KEY) ENGINE=MyISAM;
-INSERT INTO t1 VALUES ('a');
-UPDATE t1 SET a = 'MyISAM';
-SELECT * FROM t1 ORDER BY a;
-sync_slave_with_master;
-SELECT * FROM t1 ORDER BY a;
-
-connection master;
-DROP TABLE t1;
-sync_slave_with_master;
-
diff --git a/mysql-test/suite/bugs/t/rpl_bug31583.test b/mysql-test/suite/bugs/t/rpl_bug31583.test
deleted file mode 100644
index 657e4984b77..00000000000
--- a/mysql-test/suite/bugs/t/rpl_bug31583.test
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# BUG#31583: 5.1-telco-6.1 -> 5.1.22. Slave returns Error in unknown event
-
-# This is a problem for any update statement replicating from an old
-# server to a new server. The bug consisted of a new slave trying to
-# read two column bitmaps, but there is only one available in the old
-# format.
-
-# This test case should be executed replicating from an old server to
-# a new server, so make sure you have one handy.
-
-source include/master-slave.inc;
-
-CREATE TABLE t1 ( a INT, b INT DEFAULT -3 );
-
-INSERT INTO t1 VALUES (1, DEFAULT);
-UPDATE t1 SET a = 3;
-SELECT * FROM t1 ORDER BY a;
-sync_slave_with_master;
-SELECT * FROM t1 ORDER BY a;
-
-connection master;
-DROP TABLE t1;
-sync_slave_with_master;
-
diff --git a/mysql-test/suite/bugs/t/rpl_bug33029.test b/mysql-test/suite/bugs/t/rpl_bug33029.test
deleted file mode 100644
index 494cef42ce0..00000000000
--- a/mysql-test/suite/bugs/t/rpl_bug33029.test
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Bug #36443 Server crashes when executing insert when insert trigger on table
-#
-# Emulating the former bug#33029 situation to see that there is no crash anymore.
-#
-
-
-source include/master-slave.inc;
-
-create table `t1` (`id` int not null auto_increment primary key);
-create trigger `trg` before insert on `t1` for each row begin end;
-
-sync_slave_with_master;
-set @@global.debug="+d,simulate_bug33029";
-
-stop slave;
-start slave;
-
-connection master;
-
-insert into `t1` values ();
-
-sync_slave_with_master;
-select * from t1;
-
diff --git a/mysql-test/suite/bugs/t/rpl_bug36391.test b/mysql-test/suite/bugs/t/rpl_bug36391.test
deleted file mode 100644
index 8bca9a46c5a..00000000000
--- a/mysql-test/suite/bugs/t/rpl_bug36391.test
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# BUG#36391 and BUG#38731
-#
-# The fix for BUG#20103 "Escaping with backslash does not work as expected"
-# was implemented too greedy though in that it not only changes the behavior
-# of backslashes within strings but in general, so disabling command shortcuts
-# like \G or \C (which in turn leads to BUG#36391: "mysqlbinlog creates invalid charset statements".
-#
-# The test executes simple commands that are stored in the binary log and
-# re-execute them through the mysql client which should have to process
-# some command shortcuts. The backslashes within strings is disabled in the file
-# rpl_bug36391-master.opt by the option --sql_mode=NO_BACKSLASH_ESCAPES.
-#
-#
-
---source include/master-slave.inc
-
-drop table if exists t1;
-
-create table t1(id int);
-
-show tables;
-
---source include/show_master_status.inc
-
-flush logs;
-
---exec $MYSQL_BINLOG $MYSQL_TEST_DIR/var/log/master-bin.000001 | $MYSQL test
-
-drop table t1;
diff --git a/mysql-test/suite/bugs/t/rpl_bug37426.test b/mysql-test/suite/bugs/t/rpl_bug37426.test
deleted file mode 100644
index d2bad0fa0c1..00000000000
--- a/mysql-test/suite/bugs/t/rpl_bug37426.test
+++ /dev/null
@@ -1,22 +0,0 @@
-#############################################################
-# Author: Mats Kindahl <mats@mysql.com>
-# Date: 2008-06-18
-# Purpose: Test for BUG#37426
-# RBR breaks for CHAR() UTF8 fields > 85 chars
-#############################################################
-
-source include/master-slave.inc;
-source include/have_binlog_format_row.inc;
-
-connection master;
-CREATE TABLE char128_utf8 (
- i1 INT NOT NULL,
- c CHAR(128) CHARACTER SET utf8 NOT NULL,
- i2 INT NOT NULL);
-
-INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
-
-SELECT * FROM char128_utf8;
-sync_slave_with_master;
-
-SELECT * FROM char128_utf8;
diff --git a/mysql-test/suite/bugs/t/rpl_bug38205.test b/mysql-test/suite/bugs/t/rpl_bug38205.test
deleted file mode 100644
index 52b36636e79..00000000000
--- a/mysql-test/suite/bugs/t/rpl_bug38205.test
+++ /dev/null
@@ -1,166 +0,0 @@
-#
-# Bug #38205 Row-based Replication (RBR) causes inconsistencies: HA_ERR_FOUND_DUPP_KEY
-# Bug#319 if while a non-transactional slave is replicating a transaction possible problem
-#
-# Verifying the fact that STOP SLAVE in the middle of a group execution waits
-# for the end of the group before the slave sql thread will stop.
-# The patch refines STOP SLAVE to not interrupt a transaction or other type of
-# the replication events group (the part I).
-# Killing the sql thread continues to provide a "hard" stop (the part II).
-#
-# Non-deterministic tests
-#
-
-source include/master-slave.inc;
-source include/have_innodb.inc;
-
-
-#
-# Part II, killed sql slave leaves instantly
-#
-
-# A. multi-statement transaction as the replication group
-
-connection master;
-
-create table t1i(n int primary key) engine=innodb;
-create table t2m(n int primary key) engine=myisam;
-
-sync_slave_with_master;
-
-connection master;
-
-begin;
-insert into t1i values (1);
-insert into t1i values (2);
-insert into t1i values (3);
-commit;
-
-sync_slave_with_master;
-
-#
-# todo: first challenge is to find out the SQL thread id
-# the following is not fully reliable
-#
-
-let $id=`SELECT id from information_schema.processlist where user like 'system user' and state like '%Has read all relay log%' or user like 'system user' and state like '%Reading event from the relay log%'`;
-connection slave;
-begin;
-insert into t1i values (5);
-
-connection master;
-let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1);
-begin;
-insert into t1i values (4);
-insert into t2m values (1); # non-ta update
-update t1i set n = 5 where n = 4; # to block at. can't be played with killed
-commit;
-let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1);
-
-connection slave;
-# slave sql thread must be locked out by the conn `slave' explicit lock
-let $pos0_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
---disable_query_log
-eval select $pos0_master - $pos0_slave as zero;
---enable_query_log
-
-connection slave1;
-
-let $count= 1;
-let $table= t2m;
-source include/wait_until_rows_count.inc;
-#
-# todo: may fail as said above
-#
---echo *** kill sql thread ***
---disable_query_log
-eval kill connection $id;
---enable_query_log
-
-connection slave;
-rollback; # release the sql thread
-
-connection slave1;
-
-source include/wait_for_slave_sql_to_stop.inc;
-let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
---echo *** sql thread is *not* running: $sql_status ***
-let $pos1_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
-
-connection slave;
---echo *** the prove: the killed slave has not finished the current transaction ***
-
---disable_query_log
-select count(*) as three from t1i;
-eval select $pos1_master > $pos1_slave as one;
-eval select $pos1_slave - $pos0_slave as zero;
---enable_query_log
-
-delete from t2m; # remove the row to be able to replay
-start slave sql_thread;
-
-#
-# Part I: B The homogenous transaction remains interuptable in between
-#
-
-connection master;
-delete from t1i;
-delete from t2m;
-
-sync_slave_with_master;
-begin;
-insert into t1i values (5);
-
-connection master;
-let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1);
-begin;
-insert into t1i values (4);
-update t1i set n = 5 where n = 4; # to block at. not to be played
-commit;
-let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1);
-
-
-connection slave1;
-# slave sql can't advance as must be locked by the conn `slave' trans
-let $pos0_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
---disable_query_log
-eval select $pos0_master - $pos0_slave as zero;
---enable_query_log
-
-#
-# the replicated trans is blocked by the slave's local.
-# However, it's not easy to catch the exact moment when it happens.
-# The test issues sleep which makes the test either non-deterministic or
-# wasting too much time.
-#
---sleep 3
-
-send stop slave sql_thread;
-
-connection slave;
-rollback; # release the sql thread
-
-connection slave1;
-reap;
-source include/wait_for_slave_sql_to_stop.inc;
-let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
---echo *** sql thread is *not* running: $sql_status ***
-
-let $pos1_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
-
---echo *** the prove: the stopped slave has rolled back the current transaction ***
-
---disable_query_log
-select count(*) as zero from t1i;
-eval select $pos0_master - $pos0_slave as zero;
-eval select $pos1_master > $pos0_slave as one;
---enable_query_log
-
-start slave sql_thread;
-
-# clean-up
-
-connection master;
-drop table t1i, t2m;
-
-sync_slave_with_master;
diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_string_pk_constraint_error.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_string_pk_constraint_error.result
index 6f66eec52a0..ff161fbae7a 100644
--- a/mysql-test/suite/engines/funcs/r/in_multicolumn_string_pk_constraint_error.result
+++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_string_pk_constraint_error.result
@@ -55,6 +55,12 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
+ERROR 23000: Duplicate entry 'abc-abc-abc' for key 'PRIMARY'
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
+ERROR 23000: Duplicate entry 'abc-abc-def' for key 'PRIMARY'
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
+ERROR 23000: Duplicate entry 'abc-def-def' for key 'PRIMARY'
SELECT hex(c1),hex(c2),hex(c3) FROM t1;
hex(c1) hex(c2) hex(c3)
61626300000000000000 61626300000000000000 61626300000000000000
diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_string_pk_constraint_ignore.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_string_pk_constraint_ignore.result
index ac0fe07af56..c4d03026a87 100644
--- a/mysql-test/suite/engines/funcs/r/in_multicolumn_string_pk_constraint_ignore.result
+++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_string_pk_constraint_ignore.result
@@ -55,6 +55,12 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
+ERROR 23000: Duplicate entry 'abc-abc-abc' for key 'PRIMARY'
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
+ERROR 23000: Duplicate entry 'abc-abc-def' for key 'PRIMARY'
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
+ERROR 23000: Duplicate entry 'abc-def-def' for key 'PRIMARY'
SELECT * FROM t1;
c1 c2 c3
abc
diff --git a/mysql-test/suite/engines/funcs/r/in_multicolumn_string_unique_constraint_error.result b/mysql-test/suite/engines/funcs/r/in_multicolumn_string_unique_constraint_error.result
index 23fd244b40b..39e08f2f4ac 100644
--- a/mysql-test/suite/engines/funcs/r/in_multicolumn_string_unique_constraint_error.result
+++ b/mysql-test/suite/engines/funcs/r/in_multicolumn_string_unique_constraint_error.result
@@ -55,6 +55,12 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
+ERROR 23000: Duplicate entry 'abc-abc-abc' for key 'c1'
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
+ERROR 23000: Duplicate entry 'abc-abc-def' for key 'c1'
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
+ERROR 23000: Duplicate entry 'abc-def-def' for key 'c1'
SELECT * FROM t1;
c1 c2 c3
abc
diff --git a/mysql-test/suite/engines/funcs/r/in_string_pk_constraint_error.result b/mysql-test/suite/engines/funcs/r/in_string_pk_constraint_error.result
index bbbccf797e7..7f60b844b64 100644
--- a/mysql-test/suite/engines/funcs/r/in_string_pk_constraint_error.result
+++ b/mysql-test/suite/engines/funcs/r/in_string_pk_constraint_error.result
Binary files differ
diff --git a/mysql-test/suite/engines/funcs/r/in_string_unique_constraint_error.result b/mysql-test/suite/engines/funcs/r/in_string_unique_constraint_error.result
index b1163e0b08a..42be531343e 100644
--- a/mysql-test/suite/engines/funcs/r/in_string_unique_constraint_error.result
+++ b/mysql-test/suite/engines/funcs/r/in_string_unique_constraint_error.result
Binary files differ
diff --git a/mysql-test/suite/engines/funcs/r/ps_string_not_null.result b/mysql-test/suite/engines/funcs/r/ps_string_not_null.result
index 859fab8b490..5f2a630811c 100644
--- a/mysql-test/suite/engines/funcs/r/ps_string_not_null.result
+++ b/mysql-test/suite/engines/funcs/r/ps_string_not_null.result
Binary files differ
diff --git a/mysql-test/suite/engines/funcs/r/rpl_000015.result b/mysql-test/suite/engines/funcs/r/rpl_000015.result
index cfb4f0ead5a..bb3620ebc84 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_000015.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_000015.result
@@ -10,25 +10,174 @@ File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 107
stop slave;
reset slave;
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry #
Master_Log_File
Read_Master_Log_Pos 4
+Relay_Log_File #
+Relay_Log_Pos #
Relay_Master_Log_File
+Slave_IO_Running No
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
Exec_Master_Log_Pos 0
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno 0
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
change master to master_host='127.0.0.1';
+show slave status;
+Slave_IO_State #
+Master_Host 127.0.0.1
+Master_User root
+Master_Port MASTER_PORT
+Connect_Retry #
Master_Log_File
Read_Master_Log_Pos 4
+Relay_Log_File #
+Relay_Log_Pos #
Relay_Master_Log_File
+Slave_IO_Running No
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
Exec_Master_Log_Pos 0
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno 0
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
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 #
Master_Log_File
Read_Master_Log_Pos 4
+Relay_Log_File #
+Relay_Log_Pos #
Relay_Master_Log_File
+Slave_IO_Running No
+Slave_SQL_Running No
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
Exec_Master_Log_Pos 0
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno 0
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
start slave;
+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 107
+Relay_Log_File slave-relay-bin.000002
+Relay_Log_Pos 254
Relay_Master_Log_File master-bin.000001
-Checking that both slave threads are running.
+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 107
+Relay_Log_Space 410
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno 0
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
drop table if exists t1;
create table t1 (n int, PRIMARY KEY(n));
insert into t1 values (10),(45),(90);
diff --git a/mysql-test/suite/engines/funcs/r/rpl_change_master.result b/mysql-test/suite/engines/funcs/r/rpl_change_master.result
index 2258a35a869..c187f16cc83 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_change_master.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_change_master.result
@@ -11,7 +11,13 @@ 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 Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 192 # None 0 No # No 0 0 1
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 Replicate_Ignore_Server_Ids Master_Server_Id
+# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 # # # master-bin.000001 No No 0 0 192 # None 0 No # No 0 0 1
start slave;
select * from t1;
n
diff --git a/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result b/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result
index ef4d7797dbf..53a521aaf85 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result
@@ -17,6 +17,45 @@ let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%
--source include/wait_slave_status.inc
flush logs;
-Relay_Log_File mysqld-relay-bin.000003
-Checking that both slave threads are running.
+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 107
+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 107
+Relay_Log_Space #
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master #
+Master_SSL_Verify_Server_Cert No
+Last_IO_Errno 0
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 2
STOP SLAVE;
diff --git a/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result b/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result
index 779a3af9631..8b2da7ff9a1 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_loaddata_s.result
@@ -10,6 +10,6 @@ load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
select count(*) from test.t1;
count(*)
2
-show binlog events from <binlog_start>;
+show binlog events from 107;
Log_name Pos Event_type Server_id End_log_pos Info
drop table test.t1;
diff --git a/mysql-test/suite/engines/funcs/r/rpl_log_pos.result b/mysql-test/suite/engines/funcs/r/rpl_log_pos.result
index 1b2ded26f66..df4512fa0ea 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_log_pos.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_log_pos.result
@@ -4,23 +4,39 @@ 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 107 <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 Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 107 # # master-bin.000001 Yes Yes 0 0 107 # None 0 No # No 0 0 1
stop slave;
-change master to master_log_pos=MASTER_LOG_POS;
+change master to master_log_pos=107;
start slave;
stop slave;
-change master to master_log_pos=MASTER_LOG_POS;
+change master to master_log_pos=107;
+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 Replicate_Ignore_Server_Ids Master_Server_Id
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 107 # # master-bin.000001 No No 0 0 107 # None 0 No # No 0 0 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 Replicate_Ignore_Server_Ids Master_Server_Id
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 107 # # master-bin.000001 Yes Yes 0 0 107 # None 0 No # No 0 0 1
stop slave;
-# impossible position leads to an error
-change master to master_log_pos=MASTER_LOG_POS;
+change master to master_log_pos=178;
start slave;
-Last_IO_Error = Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position'
+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 Replicate_Ignore_Server_Ids Master_Server_Id
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 178 # # master-bin.000001 No Yes 0 0 178 # None 0 No # No 1236 Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position' 0 1
+show master status;
+File Position Binlog_Do_DB Binlog_Ignore_DB
+master-bin.000001 107 <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=MASTER_LOG_POS;
+change master to master_log_pos=207;
start slave;
select * from t1 ORDER BY n;
n
diff --git a/mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result b/mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result
index 0eb3d7e8ff9..13f7fbfbdeb 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_rbr_to_sbr.result
@@ -8,17 +8,48 @@ start slave;
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 from <binlog_start>;
+SHOW BINLOG EVENTS;
**** On Slave ****
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT, b LONG)
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (2,2)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-show binlog events from <binlog_start>;
+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
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
+SHOW BINLOG EVENTS;
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_drop.result b/mysql-test/suite/engines/funcs/r/rpl_row_drop.result
index 048e07271b3..d45bbadf7df 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_row_drop.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_row_drop.result
@@ -41,11 +41,14 @@ t1
t2
**** On Master ****
DROP TABLE t1,t2;
-show binlog events from <binlog_start>;
+SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int)
-master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int)
-master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+master-bin.000001 4 Format_desc 1 107 Server ver: VERSION, Binlog ver: 4
+master-bin.000001 107 Query 1 193 use `test`; CREATE TABLE t1 (a int)
+master-bin.000001 193 Query 1 279 use `test`; CREATE TABLE t2 (a int)
+master-bin.000001 279 Query 1 403 use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */
+master-bin.000001 403 Query 1 527 use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */
+master-bin.000001 527 Query 1 631 use `test`; DROP TABLE `t1` /* generated by server */
SHOW TABLES;
Tables_in_test
t2
diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result b/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result
index cd7528280d0..aff54e01b95 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_row_inexist_tbl.result
@@ -17,5 +17,45 @@ a
0
drop table t1;
insert into t1 values (1);
-Last_SQL_Error = Error 'Table 'test.t1' doesn't exist' on opening tables
+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 executing row event: 'Table 'test.t1' doesn't exist'
+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 1146
+Last_SQL_Error Error executing row event: 'Table 'test.t1' doesn't exist'
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
drop table t1, t2;
diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result b/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result
index 7bf09df31ca..5499d41bc1f 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_row_reset_slave.result
@@ -11,8 +11,9 @@ change master to master_user='test';
Master_User test
Master_Host 127.0.0.1
reset slave;
-Master_User root
+Master_User test
Master_Host 127.0.0.1
+change master to master_user='root';
include/start_slave.inc
Master_User root
Master_Host 127.0.0.1
@@ -30,11 +31,11 @@ include/stop_slave.inc
reset slave;
change master to master_user='impossible_user_name';
start slave;
-include/stop_slave.inc
+stop slave;
change master to master_user='root';
include/start_slave.inc
-include/stop_slave.inc
+stop slave;
change master to master_user='impossible_user_name';
start slave;
-include/stop_slave.inc
+stop slave;
reset slave;
diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_sp005.result b/mysql-test/suite/engines/funcs/r/rpl_row_sp005.result
index 01e1970e0df..58c53b394b2 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_row_sp005.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_row_sp005.result
@@ -77,6 +77,8 @@ id2
< ---- Master selects-- >
-------------------------
CALL test.p1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM test.t3 ORDER BY id3;
id3 c
1 MySQL
diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_trig003.result b/mysql-test/suite/engines/funcs/r/rpl_row_trig003.result
index 43c2ecde2b4..131af933b41 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_row_trig003.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_row_trig003.result
@@ -69,9 +69,15 @@ INSERT INTO test.t2 VALUES(NULL,0,'Testing MySQL databases is a cool ', 'MySQL C
UPDATE test.t1 SET b1 = 0 WHERE b1 = 1;
INSERT INTO test.t2 VALUES(NULL,1,'This is an after update test.', 'If this works, total will not be zero on the master or slave',1.4321,5.221,0,YEAR(NOW()),NOW());
UPDATE test.t2 SET b1 = 0 WHERE b1 = 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW());
DELETE FROM test.t1 WHERE id = 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
DELETE FROM test.t2 WHERE id = 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
DROP TRIGGER test.t1_bi;
DROP TRIGGER test.t2_ai;
DROP TRIGGER test.t1_bu;
diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_until.result b/mysql-test/suite/engines/funcs/r/rpl_row_until.result
index 72dd1a6a7c3..d8637578ecc 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_row_until.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_row_until.result
@@ -12,39 +12,201 @@ 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=MASTER_LOG_POS;
+start slave until master_log_file='master-bin.000001', master_log_pos=311;
select * from t1;
n
1
2
3
4
-start slave until master_log_file='master-no-such-bin.000001', master_log_pos=MASTER_LOG_POS;
+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 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 #
+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 0
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
+start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
select * from t1;
-n
-1
-2
-3
-4
-start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=RELAY_LOG_POS;
+n 1
+n 2
+n 3
+n 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 #
+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 #
+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 0
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
+start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=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_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+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 #
+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 0
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
start slave;
stop slave;
-start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS;
-start slave until master_log_file='master-bin', master_log_pos=MASTER_LOG_POS;
+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_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos #
+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 #
+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 0
+Last_IO_Error
+Last_SQL_Errno 0
+Last_SQL_Error
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
+start slave until master_log_file='master-bin', master_log_pos=561;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
-start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS, relay_log_pos=RELAY_LOG_POS;
+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=MASTER_LOG_POS;
+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=MASTER_LOG_POS;
+start slave until master_log_file='master-bin.000001', master_log_pos=740;
Warnings:
-Note 1254 Slave is already running
+Level Note
+Code 1254
+Message Slave is already running
diff --git a/mysql-test/suite/engines/funcs/r/rpl_server_id1.result b/mysql-test/suite/engines/funcs/r/rpl_server_id1.result
index 1e7108d7961..700bc270f07 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_server_id1.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_server_id1.result
@@ -8,8 +8,10 @@ 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 Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
+ 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # # 0 0 0 107 None 0 No NULL No 0 0 1
start slave;
-Last_IO_Error = Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
insert into t1 values (1);
show status like "slave_running";
Variable_name Value
diff --git a/mysql-test/suite/engines/funcs/r/rpl_server_id2.result b/mysql-test/suite/engines/funcs/r/rpl_server_id2.result
index 066b563c4e8..f8d24f70776 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_server_id2.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_server_id2.result
@@ -8,6 +8,9 @@ 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 Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
+ 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 107 None 0 No NULL No 0 0 1
start slave;
insert into t1 values (1);
select * from t1;
diff --git a/mysql-test/suite/engines/funcs/r/rpl_slave_status.result b/mysql-test/suite/engines/funcs/r/rpl_slave_status.result
index c4dc7686045..0e438d294fd 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_slave_status.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_slave_status.result
@@ -18,5 +18,46 @@ drop user rpl@127.0.0.1;
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 Connecting
+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
+Replicate_Ignore_Server_Ids
+Master_Server_Id 1
drop table t1;
drop table t1;
diff --git a/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result
index e7306cd6293..b0d92f3ca3f 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_switch_stm_row_mixed.result
@@ -376,7 +376,7 @@ CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE;
INSERT INTO t12 VALUES(UUID());
UNLOCK TABLES;
-show binlog events from <binlog_start>;
-show binlog events from <binlog_start>;
+show binlog events;
+show binlog events;
drop database mysqltest1;
set global binlog_format= @saved_binlog_format;
diff --git a/mysql-test/suite/engines/funcs/r/sf_alter.result b/mysql-test/suite/engines/funcs/r/sf_alter.result
index e89f529ba09..8885b20d557 100644
--- a/mysql-test/suite/engines/funcs/r/sf_alter.result
+++ b/mysql-test/suite/engines/funcs/r/sf_alter.result
@@ -35,6 +35,8 @@ ALTER FUNCTION sf1 #DET# ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -52,6 +54,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -72,6 +76,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -98,6 +105,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -163,6 +172,8 @@ ALTER FUNCTION sf1 #DET# CONTAINS SQL ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -180,6 +191,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -200,6 +213,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -226,6 +242,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -291,6 +309,8 @@ ALTER FUNCTION sf1 #DET# NO SQL ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -308,6 +328,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -328,6 +350,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -354,6 +379,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -419,6 +446,8 @@ ALTER FUNCTION sf1 #DET# READS SQL DATA ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -436,6 +465,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -456,6 +487,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -482,6 +516,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -547,6 +583,8 @@ ALTER FUNCTION sf1 #DET# MODIFIES SQL DATA ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -564,6 +602,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -584,6 +624,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -610,6 +653,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -675,6 +720,8 @@ ALTER FUNCTION sf1 #DET# COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -692,6 +739,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -712,6 +761,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -738,6 +790,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -803,6 +857,8 @@ ALTER FUNCTION sf1 #DET# CONTAINS SQL COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -820,6 +876,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -840,6 +898,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -866,6 +927,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -931,6 +994,8 @@ ALTER FUNCTION sf1 #DET# NO SQL COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -948,6 +1013,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -968,6 +1035,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -994,6 +1064,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1059,6 +1131,8 @@ ALTER FUNCTION sf1 #DET# READS SQL DATA COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1076,6 +1150,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1096,6 +1172,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1122,6 +1201,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1187,6 +1268,8 @@ ALTER FUNCTION sf1 #DET# MODIFIES SQL DATA COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1204,6 +1287,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1224,6 +1309,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1250,6 +1338,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1315,6 +1405,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1332,6 +1424,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1352,6 +1446,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1378,6 +1475,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1443,6 +1542,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# CONTAINS SQL ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1460,6 +1561,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1480,6 +1583,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1506,6 +1612,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1571,6 +1679,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# NO SQL ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1588,6 +1698,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1608,6 +1720,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1634,6 +1749,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1699,6 +1816,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# READS SQL DATA ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1716,6 +1835,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1736,6 +1857,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1762,6 +1886,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1827,6 +1953,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# MODIFIES SQL DATA ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1844,6 +1972,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1864,6 +1994,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1890,6 +2023,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1955,6 +2090,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1972,6 +2109,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1992,6 +2131,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2018,6 +2160,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2083,6 +2227,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# CONTAINS SQL COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2100,6 +2246,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2120,6 +2268,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2146,6 +2297,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2211,6 +2364,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# NO SQL COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2228,6 +2383,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2248,6 +2405,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2274,6 +2434,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2339,6 +2501,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# READS SQL DATA COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2356,6 +2520,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2376,6 +2542,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2402,6 +2571,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2467,6 +2638,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# MODIFIES SQL DATA COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2484,6 +2657,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2504,6 +2679,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2530,6 +2708,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2595,6 +2775,8 @@ ALTER FUNCTION sf1 #DET# SQL SECURITY INVOKER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2612,6 +2794,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2632,6 +2816,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2658,6 +2845,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2723,6 +2912,8 @@ ALTER FUNCTION sf1 #DET# CONTAINS SQL SQL SECURITY INVOKER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2740,6 +2931,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2760,6 +2953,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2786,6 +2982,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2851,6 +3049,8 @@ ALTER FUNCTION sf1 #DET# NO SQL SQL SECURITY INVOKER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2868,6 +3068,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2888,6 +3090,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2914,6 +3119,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2979,6 +3186,8 @@ ALTER FUNCTION sf1 #DET# READS SQL DATA SQL SECURITY INVOKER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2996,6 +3205,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3016,6 +3227,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3042,6 +3256,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3107,6 +3323,8 @@ ALTER FUNCTION sf1 #DET# MODIFIES SQL DATA SQL SECURITY INVOKER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3124,6 +3342,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3144,6 +3364,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3170,6 +3393,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3235,6 +3460,8 @@ ALTER FUNCTION sf1 #DET# SQL SECURITY INVOKER COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3252,6 +3479,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3272,6 +3501,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3298,6 +3530,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3363,6 +3597,8 @@ ALTER FUNCTION sf1 #DET# CONTAINS SQL SQL SECURITY INVOKER COMMENT 'comment'
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3380,6 +3616,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3400,6 +3638,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3426,6 +3667,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3491,6 +3734,8 @@ ALTER FUNCTION sf1 #DET# NO SQL SQL SECURITY INVOKER COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3508,6 +3753,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3528,6 +3775,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3554,6 +3804,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3619,6 +3871,8 @@ ALTER FUNCTION sf1 #DET# READS SQL DATA SQL SECURITY INVOKER COMMENT 'comment
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3636,6 +3890,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3656,6 +3912,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3682,6 +3941,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3747,6 +4008,8 @@ ALTER FUNCTION sf1 #DET# MODIFIES SQL DATA SQL SECURITY INVOKER COMMENT 'comm
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3764,6 +4027,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3784,6 +4049,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3810,6 +4078,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3875,6 +4145,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# SQL SECURITY INVOKER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3892,6 +4164,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3912,6 +4186,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -3938,6 +4215,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4003,6 +4282,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY INVOKER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4020,6 +4301,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4040,6 +4323,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4066,6 +4352,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4131,6 +4419,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# NO SQL SQL SECURITY INVOKER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4148,6 +4438,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4168,6 +4460,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4194,6 +4489,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4259,6 +4556,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY INVOKER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4276,6 +4575,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4296,6 +4597,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4322,6 +4626,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4387,6 +4693,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY INVOKER
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4404,6 +4712,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4424,6 +4734,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4450,6 +4763,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4515,6 +4830,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# SQL SECURITY INVOKER COMMENT 'comment'
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4532,6 +4849,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4552,6 +4871,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4578,6 +4900,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4643,6 +4967,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY INVOKER COMMENT
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4660,6 +4986,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4680,6 +5008,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4706,6 +5037,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4771,6 +5104,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# NO SQL SQL SECURITY INVOKER COMMENT 'comm
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4788,6 +5123,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4808,6 +5145,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4834,6 +5174,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4899,6 +5241,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY INVOKER COMME
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4916,6 +5260,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4936,6 +5282,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -4962,6 +5311,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5027,6 +5378,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY INVOKER CO
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5044,6 +5397,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5064,6 +5419,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5090,6 +5448,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5155,6 +5515,8 @@ ALTER FUNCTION sf1 #DET# SQL SECURITY DEFINER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5172,6 +5534,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5192,6 +5556,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5218,6 +5585,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5283,6 +5652,8 @@ ALTER FUNCTION sf1 #DET# CONTAINS SQL SQL SECURITY DEFINER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5300,6 +5671,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5320,6 +5693,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5346,6 +5722,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5411,6 +5789,8 @@ ALTER FUNCTION sf1 #DET# NO SQL SQL SECURITY DEFINER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5428,6 +5808,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5448,6 +5830,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5474,6 +5859,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5539,6 +5926,8 @@ ALTER FUNCTION sf1 #DET# READS SQL DATA SQL SECURITY DEFINER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5556,6 +5945,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5576,6 +5967,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5602,6 +5996,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5667,6 +6063,8 @@ ALTER FUNCTION sf1 #DET# MODIFIES SQL DATA SQL SECURITY DEFINER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5684,6 +6082,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5704,6 +6104,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5730,6 +6133,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5795,6 +6200,8 @@ ALTER FUNCTION sf1 #DET# SQL SECURITY DEFINER COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5812,6 +6219,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5832,6 +6241,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5858,6 +6270,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5923,6 +6337,8 @@ ALTER FUNCTION sf1 #DET# CONTAINS SQL SQL SECURITY DEFINER COMMENT 'comment'
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5940,6 +6356,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5960,6 +6378,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -5986,6 +6407,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6051,6 +6474,8 @@ ALTER FUNCTION sf1 #DET# NO SQL SQL SECURITY DEFINER COMMENT 'comment' ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6068,6 +6493,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6088,6 +6515,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6114,6 +6544,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6179,6 +6611,8 @@ ALTER FUNCTION sf1 #DET# READS SQL DATA SQL SECURITY DEFINER COMMENT 'commen
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6196,6 +6630,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6216,6 +6652,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6242,6 +6681,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6307,6 +6748,8 @@ ALTER FUNCTION sf1 #DET# MODIFIES SQL DATA SQL SECURITY DEFINER COMMENT 'com
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6324,6 +6767,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6344,6 +6789,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6370,6 +6818,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6435,6 +6885,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# SQL SECURITY DEFINER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6452,6 +6904,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6472,6 +6926,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6498,6 +6955,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6563,6 +7022,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY DEFINER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6580,6 +7041,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6600,6 +7063,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6626,6 +7092,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6691,6 +7159,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# NO SQL SQL SECURITY DEFINER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6708,6 +7178,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6728,6 +7200,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6754,6 +7229,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6819,6 +7296,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY DEFINER ;
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6836,6 +7315,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6856,6 +7337,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6882,6 +7366,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6947,6 +7433,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY DEFINER
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6964,6 +7452,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -6984,6 +7474,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7010,6 +7503,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7075,6 +7570,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# SQL SECURITY DEFINER COMMENT 'comment'
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7092,6 +7589,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7112,6 +7611,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7138,6 +7640,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7203,6 +7707,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY DEFINER COMMEN
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7220,6 +7726,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7240,6 +7748,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7266,6 +7777,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7331,6 +7844,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# NO SQL SQL SECURITY DEFINER COMMENT 'com
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7348,6 +7863,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7368,6 +7885,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7394,6 +7914,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7459,6 +7981,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY DEFINER COMM
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7476,6 +8000,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7496,6 +8022,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7522,6 +8051,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7587,6 +8118,8 @@ ALTER FUNCTION sf1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY DEFINER C
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7604,6 +8137,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7624,6 +8159,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -7650,6 +8188,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
diff --git a/mysql-test/suite/engines/funcs/r/sf_cursor.result b/mysql-test/suite/engines/funcs/r/sf_cursor.result
index 2fe2171b39d..e43bcaa50a3 100644
--- a/mysql-test/suite/engines/funcs/r/sf_cursor.result
+++ b/mysql-test/suite/engines/funcs/r/sf_cursor.result
@@ -34,6 +34,8 @@ END//
SELECT sf1();
sf1()
0
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -51,6 +53,8 @@ id data
2 1
3 3
INSERT INTO t4 VALUES(sf1());
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -71,6 +75,9 @@ id data
3 3
3 3
UPDATE t4 SET i = sf1() + 1 WHERE i = sf1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -97,6 +104,8 @@ id data
3 3
3 3
DELETE FROM t4 WHERE i = sf1() + 1;
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
diff --git a/mysql-test/suite/engines/funcs/r/sp_alter.result b/mysql-test/suite/engines/funcs/r/sp_alter.result
index 22036fecde7..794a692edc4 100644
--- a/mysql-test/suite/engines/funcs/r/sp_alter.result
+++ b/mysql-test/suite/engines/funcs/r/sp_alter.result
@@ -31,6 +31,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -80,6 +82,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# CONTAINS SQL ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -129,6 +133,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# NO SQL ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -178,6 +184,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# READS SQL DATA ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -227,6 +235,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# MODIFIES SQL DATA ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -276,6 +286,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -325,6 +337,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# CONTAINS SQL COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -374,6 +388,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# NO SQL COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -423,6 +439,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# READS SQL DATA COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -472,6 +490,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# MODIFIES SQL DATA COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -521,6 +541,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -570,6 +592,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# CONTAINS SQL ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -619,6 +643,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# NO SQL ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -668,6 +694,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# READS SQL DATA ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -717,6 +745,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# MODIFIES SQL DATA ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -766,6 +796,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -815,6 +847,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# CONTAINS SQL COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -864,6 +898,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# NO SQL COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -913,6 +949,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# READS SQL DATA COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -962,6 +1000,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# MODIFIES SQL DATA COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1011,6 +1051,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# SQL SECURITY INVOKER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1060,6 +1102,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# CONTAINS SQL SQL SECURITY INVOKER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1109,6 +1153,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# NO SQL SQL SECURITY INVOKER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1158,6 +1204,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# READS SQL DATA SQL SECURITY INVOKER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1207,6 +1255,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# MODIFIES SQL DATA SQL SECURITY INVOKER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1256,6 +1306,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# SQL SECURITY INVOKER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1305,6 +1357,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# CONTAINS SQL SQL SECURITY INVOKER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1354,6 +1408,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# NO SQL SQL SECURITY INVOKER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1403,6 +1459,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# READS SQL DATA SQL SECURITY INVOKER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1452,6 +1510,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# MODIFIES SQL DATA SQL SECURITY INVOKER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1501,6 +1561,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# SQL SECURITY INVOKER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1550,6 +1612,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY INVOKER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1599,6 +1663,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# NO SQL SQL SECURITY INVOKER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1648,6 +1714,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY INVOKER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1697,6 +1765,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY INVOKER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1746,6 +1816,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# SQL SECURITY INVOKER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1795,6 +1867,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY INVOKER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1844,6 +1918,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# NO SQL SQL SECURITY INVOKER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1893,6 +1969,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY INVOKER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1942,6 +2020,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY INVOKER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -1991,6 +2071,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# SQL SECURITY DEFINER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2040,6 +2122,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# CONTAINS SQL SQL SECURITY DEFINER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2089,6 +2173,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# NO SQL SQL SECURITY DEFINER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2138,6 +2224,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# READS SQL DATA SQL SECURITY DEFINER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2187,6 +2275,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# MODIFIES SQL DATA SQL SECURITY DEFINER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2236,6 +2326,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# SQL SECURITY DEFINER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2285,6 +2377,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# CONTAINS SQL SQL SECURITY DEFINER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2334,6 +2428,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# NO SQL SQL SECURITY DEFINER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2383,6 +2479,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# READS SQL DATA SQL SECURITY DEFINER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2432,6 +2530,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 #DET# MODIFIES SQL DATA SQL SECURITY DEFINER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2481,6 +2581,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# SQL SECURITY DEFINER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2530,6 +2632,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY DEFINER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2579,6 +2683,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# NO SQL SQL SECURITY DEFINER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2628,6 +2734,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY DEFINER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2677,6 +2785,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY DEFINER ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2726,6 +2836,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# SQL SECURITY DEFINER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2775,6 +2887,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# CONTAINS SQL SQL SECURITY DEFINER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2824,6 +2938,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# NO SQL SQL SECURITY DEFINER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2873,6 +2989,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# READS SQL DATA SQL SECURITY DEFINER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
@@ -2922,6 +3040,8 @@ CLOSE cur2;
END//
ALTER PROCEDURE sp1 LANGUAGE SQL #DET# MODIFIES SQL DATA SQL SECURITY DEFINER COMMENT 'comment' ;
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
diff --git a/mysql-test/suite/engines/funcs/r/sp_cursor.result b/mysql-test/suite/engines/funcs/r/sp_cursor.result
index 6ce2aae030c..58383f8a9cb 100644
--- a/mysql-test/suite/engines/funcs/r/sp_cursor.result
+++ b/mysql-test/suite/engines/funcs/r/sp_cursor.result
@@ -30,6 +30,8 @@ CLOSE cur1;
CLOSE cur2;
END//
CALL sp1();
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
SELECT * FROM t1 ORDER BY id;
id data
1 1
diff --git a/mysql-test/suite/engines/funcs/t/disabled.def b/mysql-test/suite/engines/funcs/t/disabled.def
index 19de28441f0..2d8ea2d4ff8 100644
--- a/mysql-test/suite/engines/funcs/t/disabled.def
+++ b/mysql-test/suite/engines/funcs/t/disabled.def
@@ -1,8 +1,99 @@
# List of disabled tests
# test name : comment
-rpl_redirect : Fails due to bug#49978
-crash_manycolumns_string : Bug#50495 'Row size too large' for plugin, but works for built-in innodb
-ix_unique_lob : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value
-ix_unique_string_length : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value
-rpl_empty_master_crash : Test not applicable in 5.5+
-rpl_REDIRECT : Test not applicable in 5.5+
+rpl_redirect : Fails due to bug#49978
+crash_manycolumns_string : Bug#50495 'Row size too large' for plugin, but works for built-in innodb
+ix_unique_lob : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value
+ix_unique_string_length : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value
+rpl_empty_master_crash : Test not applicable in 5.5+
+rpl_REDIRECT : Test not applicable in 5.5+
+
+rpl_create_database : Result Difference Due To Change In .inc file
+rpl_loaddata_m : Result Difference Due To Change In .inc file
+rpl_sp_effects : Result Difference Due To Change In .inc file
+rpl_variables : Result Difference Due To Change In .inc file
+rpl_loaddata_s : Result Difference Due To Change In .inc file
+rpl_dual_pos_advance : Result Difference Due To Change In .inc file
+rpl000011 : Result Difference Due To Change In .inc file
+rpl000013 : Result Difference Due To Change In .inc file
+rpl_000015 : Result Difference Due To Change In .inc file
+rpl_LD_INFILE : Result Difference Due To Change In .inc file
+rpl_alter : Result Difference Due To Change In .inc file
+rpl_alter_db : Result Difference Due To Change In .inc file
+rpl_alter_db : Result Difference Due To Change In .inc file
+rpl_bit : Result Difference Due To Change In .inc file
+rpl_bit_npk : Result Difference Due To Change In .inc file
+rpl_change_master : Result Difference Due To Change In .inc file
+rpl_do_grant : Result Difference Due To Change In .inc file
+rpl_drop : Result Difference Due To Change In .inc file
+rpl_drop_db : Result Difference Due To Change In .inc file
+rpl_flushlog_loop : Result Difference Due To Change In .inc file
+rpl_get_lock : Result Difference Due To Change In .inc file
+rpl_get_lock : Result Difference Due To Change In .inc file
+rpl_insert : Result Difference Due To Change In .inc file
+rpl_insert_select : Result Difference Due To Change In .inc file
+rpl_loaddata2 : Result Difference Due To Change In .inc file
+rpl_loaddatalocal : Result Difference Due To Change In .inc file
+rpl_loadfile : Result Difference Due To Change In .inc file
+rpl_log_pos : Result Difference Due To Change In .inc file
+rpl_many_optimize : Result Difference Due To Change In .inc file
+rpl_master_pos_wait : Result Difference Due To Change In .inc file
+rpl_misc_functions : Result Difference Due To Change In .inc file
+rpl_ps : Result Difference Due To Change In .inc file
+rpl_server_id1 : Result Difference Due To Change In .inc file
+rpl_session_var : Result Difference Due To Change In .inc file
+rpl_sf : Result Difference Due To Change In .inc file
+rpl_slave_status : Result Difference Due To Change In .inc file
+rpl_sp004 : Result Difference Due To Change In .inc file
+rpl_start_stop_slave : Result Difference Due To Change In .inc file
+rpl_stm_max_relay_size : Result Difference Due To Change In .inc file
+rpl_stm_mystery22 : Result Difference Due To Change In .inc file
+rpl_stm_no_op : Result Difference Due To Change In .inc file
+rpl_stm_reset_slave : Result Difference Due To Change In .inc file
+rpl_temp_table : Result Difference Due To Change In .inc file
+rpl_temporary : Result Difference Due To Change In .inc file
+rpl_trigger : Result Difference Due To Change In .inc file
+rpl_trunc_temp : Result Difference Due To Change In .inc file
+rpl_user_variables : Result Difference Due To Change In .inc file
+rpl_server_id2 : Result Difference Due To Change In .inc file
+rpl000010 : Result Difference Due To Change In .inc file
+rpl_init_slave : Result Difference Due To Change In .inc file
+rpl_multi_delete2 : Result Difference Due To Change In .inc file
+rpl_view : Result Difference Due To Change In .inc file
+rpl_ignore_table_update : Result Difference Due To Change In .inc file
+rpl_err_ignoredtable : Result Difference Due To Change In .inc file
+rpl_multi_update4 : Result Difference Due To Change In .inc file
+rpl_multi_delete : Result Difference Due To Change In .inc file
+rpl_ignore_grant : Result Difference Due To Change In .inc file
+rpl_ignore_revoke : Result Difference Due To Change In .inc file
+rpl_free_items : Result Difference Due To Change In .inc file
+rpl_replicate_ignore_db : Result Difference Due To Change In .inc file
+rpl000017 : Result Difference Due To Change In .inc file
+rpl_skip_error : Result Difference Due To Change In .inc file
+
+rpl_row_until : Test Present in rpl suite as well . Test Fails table with t2 table not found.
+rpl_loaddata_s : Test Present in rpl suite as well . Test Fails due to bin log truncation.
+rpl_log_pos : Test Present in rpl suite as well . Test Fails due to bin log truncation.
+rpl_row_NOW : Result Difference Due To Change In .inc file
+rpl_row_USER : Result Difference Due To Change In .inc file
+rpl_row_drop : Result Difference Due To Change In .inc file
+rpl_row_func001 : Result Difference Due To Change In .inc file
+rpl_row_max_relay_size : Result Difference Due To Change In .inc file
+rpl_row_reset_slave : Result Difference Due To Change In .inc file
+rpl_row_sp001 : Result Difference Due To Change In .inc file
+rpl_row_sp005 : Result Difference Due To Change In .inc file
+rpl_row_sp008 : Result Difference Due To Change In .inc file
+rpl_row_sp009 : Result Difference Due To Change In .inc file
+rpl_row_sp010 : Result Difference Due To Change In .inc file
+rpl_row_sp011 : Result Difference Due To Change In .inc file
+rpl_row_sp012 : Result Difference Due To Change In .inc file
+rpl_row_stop_middle : Result Difference Due To Change In .inc file
+rpl_row_trig001 : Result Difference Due To Change In .inc file
+rpl_row_trig002 : Result Difference Due To Change In .inc file
+rpl_row_trig003 : Result Difference Due To Change In .inc file
+rpl_row_view01 : Result Difference Due To Change In .inc file
+rpl_switch_stm_row_mixed : Result Difference Due To Change In .inc file
+rpl_relayspace : Result Difference Due To Change In .inc file
+rpl_row_inexist_tbl : Result Difference Due To Change In .inc file
+rpl_sp : Result Difference Due To Change In .inc file
+rpl_rbr_to_sbr : Result Difference Due To Change In .inc file
+rpl_row_until : Test Timesout
diff --git a/mysql-test/suite/engines/funcs/t/in_multicolumn_string_pk_constraint_error.test b/mysql-test/suite/engines/funcs/t/in_multicolumn_string_pk_constraint_error.test
index 1b07a750b7e..f2b8a0afcdd 100644
--- a/mysql-test/suite/engines/funcs/t/in_multicolumn_string_pk_constraint_error.test
+++ b/mysql-test/suite/engines/funcs/t/in_multicolumn_string_pk_constraint_error.test
@@ -43,14 +43,13 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
-# Bug#52430 : Uncomment the following lines
-# when the bug is fixed
-#--error ER_DUP_ENTRY
-#INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
-#--error ER_DUP_ENTRY
-#INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
-#--error ER_DUP_ENTRY
-#INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
+# Bug#52430
+--error ER_DUP_ENTRY
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
--sorted_result
SELECT hex(c1),hex(c2),hex(c3) FROM t1;
DROP TABLE t1;
diff --git a/mysql-test/suite/engines/funcs/t/in_multicolumn_string_pk_constraint_ignore.test b/mysql-test/suite/engines/funcs/t/in_multicolumn_string_pk_constraint_ignore.test
index 58d97d9793f..98d34144b14 100644
--- a/mysql-test/suite/engines/funcs/t/in_multicolumn_string_pk_constraint_ignore.test
+++ b/mysql-test/suite/engines/funcs/t/in_multicolumn_string_pk_constraint_ignore.test
@@ -43,14 +43,13 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
-# Bug#52430 : Uncomment the following lines
-# when the bug is fixed
-#--error ER_DUP_ENTRY
-#INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
-#--error ER_DUP_ENTRY
-#INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
-#--error ER_DUP_ENTRY
-#INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
+# Bug#52430
+--error ER_DUP_ENTRY
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
diff --git a/mysql-test/suite/engines/funcs/t/in_multicolumn_string_unique_constraint_error.test b/mysql-test/suite/engines/funcs/t/in_multicolumn_string_unique_constraint_error.test
index d5e58f1bb1d..07529317f88 100644
--- a/mysql-test/suite/engines/funcs/t/in_multicolumn_string_unique_constraint_error.test
+++ b/mysql-test/suite/engines/funcs/t/in_multicolumn_string_unique_constraint_error.test
@@ -43,14 +43,13 @@ INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','def','abc');
INSERT INTO t1 (c1,c2,c3) VALUES('def','abc','def');
INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
-# Bug#52430 : Uncomment the following lines
-# when the bug is fixed
-#--error ER_DUP_ENTRY
-#INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
-#--error ER_DUP_ENTRY
-#INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
-#--error ER_DUP_ENTRY
-#INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
+# Bug#52430
+--error ER_DUP_ENTRY
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','abc');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','abc','def');
+--error ER_DUP_ENTRY
+INSERT INTO t1 (c1,c2,c3) VALUES('abc','def','def');
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
diff --git a/mysql-test/suite/engines/funcs/t/in_string_pk_constraint_error.test b/mysql-test/suite/engines/funcs/t/in_string_pk_constraint_error.test
index 9a47ad296b2..5202992947c 100644
--- a/mysql-test/suite/engines/funcs/t/in_string_pk_constraint_error.test
+++ b/mysql-test/suite/engines/funcs/t/in_string_pk_constraint_error.test
@@ -18,10 +18,9 @@ DROP TABLE t1;
CREATE TABLE t1(c1 BINARY(10) NOT NULL PRIMARY KEY);
INSERT INTO t1 (c1) VALUES('abc');
INSERT INTO t1 (c1) VALUES('def');
-# Bug#52430 : Uncomment the following lines
-# when the bug is fixed
-#--error ER_DUP_ENTRY
-#INSERT INTO t1 (c1) VALUES('abc');
+# Bug#52430
+--error ER_DUP_ENTRY
+INSERT INTO t1 (c1) VALUES('abc');
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1(c1 VARBINARY(10) NOT NULL PRIMARY KEY);
diff --git a/mysql-test/suite/engines/funcs/t/in_string_unique_constraint_error.test b/mysql-test/suite/engines/funcs/t/in_string_unique_constraint_error.test
index 27d60c9caad..bc29aa57ec9 100644
--- a/mysql-test/suite/engines/funcs/t/in_string_unique_constraint_error.test
+++ b/mysql-test/suite/engines/funcs/t/in_string_unique_constraint_error.test
@@ -18,10 +18,9 @@ DROP TABLE t1;
CREATE TABLE t1(c1 BINARY(10) NULL UNIQUE);
INSERT INTO t1 (c1) VALUES('abc');
INSERT INTO t1 (c1) VALUES('def');
-# Bug#52430 : Uncomment the following lines
-# when the bug is fixed
-#--error ER_DUP_ENTRY
-#INSERT INTO t1 (c1) VALUES('abc');
+# Bug#52430
+--error ER_DUP_ENTRY
+INSERT INTO t1 (c1) VALUES('abc');
SELECT * FROM t1;
DROP TABLE t1;
CREATE TABLE t1(c1 VARBINARY(10) NULL UNIQUE);
diff --git a/mysql-test/suite/engines/funcs/t/ps_string_not_null.test b/mysql-test/suite/engines/funcs/t/ps_string_not_null.test
index f9e937cb24d..662adfd7a88 100644
--- a/mysql-test/suite/engines/funcs/t/ps_string_not_null.test
+++ b/mysql-test/suite/engines/funcs/t/ps_string_not_null.test
@@ -1,5 +1,5 @@
--disable_warnings
-DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1(c1 CHAR(100) NOT NULL);
PREPARE stmt1 FROM 'INSERT INTO t1 (c1) VALUES(?)';
diff --git a/mysql-test/suite/engines/funcs/t/rpl000013.test b/mysql-test/suite/engines/funcs/t/rpl000013.test
index 69a102e84ce..2c727107563 100644
--- a/mysql-test/suite/engines/funcs/t/rpl000013.test
+++ b/mysql-test/suite/engines/funcs/t/rpl000013.test
@@ -14,14 +14,22 @@ connection slave;
sync_with_master;
connection master;
+--disable_query_log
+CALL mtr.add_suppression(" Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--enable_query_log
+
create table t2(n int);
create temporary table t1 (n int);
insert into t1 values(1),(2),(3);
+--disable_warnings
insert into t2 select * from t1;
+--enable_warnings
connection master1;
create temporary table t1 (n int);
insert into t1 values (4),(5);
+--disable_warnings
insert into t2 select * from t1 as t10;
+--enable_warnings
save_master_pos;
disconnect master;
connection slave;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_000015.test b/mysql-test/suite/engines/funcs/t/rpl_000015.test
index 6c18e66a3a6..817ed6f407c 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_000015.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_000015.test
@@ -11,25 +11,31 @@ save_master_pos;
connection slave;
stop slave;
reset slave;
-let $status_items= Master_Log_File, Read_Master_Log_Pos, Relay_Master_Log_File, Exec_Master_Log_Pos;
-source include/show_slave_status.inc;
+--vertical_results
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 5 # 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
-source include/show_slave_status.inc;
-
+--vertical_results
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 5 # 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;
-source include/show_slave_status.inc;
-
+--vertical_results
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 5 # 8 # 9 # 23 # 33 #
+show slave status;
start slave;
sync_with_master;
-let $status_items= Master_Log_File, Relay_Master_Log_File;
-source include/show_slave_status.inc;
-source include/check_slave_is_running.inc;
-
--vertical_results
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 5 # 8 # 9 # 23 # 33 #
+--replace_column 33 #
+show slave status;
connection master;
--disable_warnings
drop table if exists t1;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_change_master.test b/mysql-test/suite/engines/funcs/t/rpl_change_master.test
index ce8c921c2ad..c031464c95e 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_change_master.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_change_master.test
@@ -18,26 +18,13 @@ save_master_pos;
connection slave;
--real_sleep 3 # wait for I/O thread to have read updates
stop slave;
-source include/wait_for_slave_to_stop.inc;
-
-let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
-let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
-if (`SELECT $read_pos = $exec_pos`)
-{
- source include/show_rpl_debug_info.inc;
- echo 'Read_Master_Log_Pos: $read_pos' == 'Exec_Master_Log_Pos: $exec_pos';
- die Failed because Read_Master_Log_Pos is equal to Exec_Master_Log_Pos;
-}
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 7 # 8 # 9 # 23 # 33 #
+show slave status;
change master to master_user='root';
-let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
-let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
-if (`SELECT $read_pos <> $exec_pos`)
-{
- source include/show_rpl_debug_info.inc;
- echo 'Read_Master_Log_Pos: $read_pos' <> 'Exec_Master_Log_Pos: $exec_pos';
- die Failed because Read_Master_Log_Pos is not equal to Exec_Master_Log_Pos;
-}
-
+--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;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test b/mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test
index 5f7af126940..6b23f1a0d03 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_err_ignoredtable.test
@@ -8,7 +8,7 @@
-- source include/master-slave.inc
--disable_query_log
-call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--enable_query_log
connection master;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test b/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test
index 0b71817226a..2e481f5e5e7 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test
@@ -41,7 +41,8 @@ sleep 5;
#
# Show status of slave
#
---let status_items= Relay_Log_File
---source include/show_slave_status.inc
---source include/check_slave_is_running.inc
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
+--vertical_results
+SHOW SLAVE STATUS;
STOP SLAVE;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_get_lock.test b/mysql-test/suite/engines/funcs/t/rpl_get_lock.test
index 6a6489954c9..c57e9313899 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_get_lock.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_get_lock.test
@@ -1,7 +1,7 @@
source include/master-slave.inc;
--disable_query_log
-call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--enable_query_log
create table t1(n int);
diff --git a/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test b/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test
index 2dd2218eb5c..a06df3bbfc9 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test
@@ -20,7 +20,9 @@ save_master_pos;
connection slave;
sync_with_master;
select count(*) from test.t1; # check that LOAD was replicated
-source include/show_binlog_events.inc;
+--replace_column 2 # 5 #
+--replace_regex /table_id: [0-9]+/table_id: #/
+show binlog events from 107; # should be nothing
# Cleanup
connection master;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_loadfile.test b/mysql-test/suite/engines/funcs/t/rpl_loadfile.test
index 8216af76341..97ee89a6d95 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_loadfile.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_loadfile.test
@@ -13,7 +13,7 @@
-- source include/master-slave.inc
--disable_query_log
-call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--enable_query_log
# Begin clean up test section
diff --git a/mysql-test/suite/engines/funcs/t/rpl_log_pos.test b/mysql-test/suite/engines/funcs/t/rpl_log_pos.test
index e07f0d5f2a7..3a762b19756 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_log_pos.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_log_pos.test
@@ -11,41 +11,36 @@
# Passes with rbr no problem, removed statement include [jbm]
source include/master-slave.inc;
-let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
+--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;
-
---replace_result $master_log_pos MASTER_LOG_POS
-eval change master to master_log_pos=$master_log_pos;
+change master to master_log_pos=107;
start slave;
sleep 5;
stop slave;
-
---replace_result $master_log_pos MASTER_LOG_POS
-eval change master to master_log_pos=$master_log_pos;
---let $slave_param= Read_Master_Log_Pos
---let $slave_param_value= $master_log_pos
---source include/wait_for_slave_param.inc
-
+change master to master_log_pos=107;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 # 33 #
+show slave status;
start slave;
sleep 5;
---let $slave_param= Read_Master_Log_Pos
---let $slave_param_value= $master_log_pos
---source include/wait_for_slave_param.inc
---source include/check_slave_no_error.inc
-
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 # 33 #
+show slave status;
stop slave;
---echo # impossible position leads to an error
---replace_result 177 MASTER_LOG_POS
-change master to master_log_pos=177;
+change master to master_log_pos=178;
start slave;
sleep 2;
-let $slave_io_errno= 1236;
-let $show_slave_io_error= 1;
-source include/wait_for_slave_io_error.inc;
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 8 # 9 # 23 # 33 #
+show slave status;
connection master;
-
-let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
+--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);
@@ -53,9 +48,7 @@ insert into t1 values (1),(2),(3);
save_master_pos;
connection slave;
stop slave;
-
---replace_result $master_log_pos MASTER_LOG_POS
-eval change master to master_log_pos=$master_log_pos;
+change master to master_log_pos=207;
start slave;
sync_with_master;
select * from t1 ORDER BY n;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_misc_functions.test b/mysql-test/suite/engines/funcs/t/rpl_misc_functions.test
index 205155a9a0e..6e4bedf7371 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_misc_functions.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_misc_functions.test
@@ -4,7 +4,7 @@
source include/master-slave.inc;
--disable_query_log
-call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--enable_query_log
create table t1(id int, i int, r1 int, r2 int, p varchar(100));
diff --git a/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test b/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test
index e78c74ab423..30d2688c3fb 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test
@@ -9,17 +9,25 @@
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: #/
# Different number of binlog events are generated by different engines
--disable_result_log
-source include/show_binlog_events.inc;
+SHOW BINLOG EVENTS;
--enable_result_log
sync_slave_with_master;
--echo **** On Slave ****
-source include/show_binlog_events.inc;
-
+--replace_result $MASTER_MYPORT MASTER_PORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--query_vertical SHOW SLAVE STATUS
+--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
+--replace_regex /table_id: [0-9]+/table_id: #/
# Different number of binlog events are generated by different engines
--disable_result_log
-source include/show_binlog_events.inc;
+SHOW BINLOG EVENTS;
--enable_result_log
--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
diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_drop.test b/mysql-test/suite/engines/funcs/t/rpl_row_drop.test
index d18ebc2846b..20c217a7c3a 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_row_drop.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_row_drop.test
@@ -30,7 +30,10 @@ connection master;
--echo **** On Master ****
# Should drop the non-temporary table t1 and the temporary table t2
DROP TABLE t1,t2;
-source include/show_binlog_events.inc;
+let $VERSION=`select version()`;
+--replace_result $VERSION VERSION
+--replace_regex /table_id: [0-9]+/table_id: #/
+SHOW BINLOG EVENTS;
SHOW TABLES;
sync_slave_with_master;
--echo **** On Slave ****
diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test b/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test
index dca2894c9da..736071a8ece 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test
@@ -22,11 +22,13 @@ connection master;
insert into t1 values (1);
connection slave;
-# slave should have stopped because can't find table t1
+# slave should have stopped because can't find table t1
+wait_for_slave_to_stop;
# see if we have a good error message:
---let $slave_sql_errno= 1146
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error.inc
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
+--vertical_results
+show slave status;
# cleanup
connection master;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_row_until.test b/mysql-test/suite/engines/funcs/t/rpl_row_until.test
index b60734317c6..ccd9ce11637 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_row_until.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_row_until.test
@@ -18,50 +18,44 @@ 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);
-let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1);
drop table t1;
-
create table t2(n int not null auto_increment primary key);
insert into t2 values (1),(2);
-let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1);
insert into t2 values (3),(4);
drop table t2;
# try to replicate all queries until drop of t1
connection slave;
---replace_result $master_log_pos_1 MASTER_LOG_POS
-eval start slave until master_log_file='master-bin.000001', master_log_pos=$master_log_pos_1;
+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;
---let $slave_param= Exec_Master_Log_Pos
---let $slave_param_value= $master_log_pos_1
---source include/check_slave_param.inc
+--vertical_results
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
+show slave status;
# this should fail right after start
---replace_result 291 MASTER_LOG_POS
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;
---let $slave_param= Exec_Master_Log_Pos
---let $slave_param_value= $master_log_pos_1
---source include/check_slave_param.inc
+--vertical_results
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
+show slave status;
# try replicate all up to and not including the second insert to t2;
-let $master_log_pos= $master_log_pos_2;
-let $relay_log_file= slave-relay-bin.000004;
---source include/get_relay_log_pos.inc
---replace_result $relay_log_pos RELAY_LOG_POS
-eval start slave until relay_log_file='$relay_log_file', relay_log_pos=$relay_log_pos;
+start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=728;
sleep 2;
wait_for_slave_to_stop;
select * from t2;
---let $slave_param= Exec_Master_Log_Pos
---let $slave_param_value= $master_log_pos
---source include/check_slave_param.inc
+--vertical_results
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+--replace_column 1 # 7 # 9 # 11 # 22 # 23 # 33 #
+show slave status;
# clean up
start slave;
@@ -71,32 +65,27 @@ connection slave;
sync_with_master;
stop slave;
---let $exec_log_pos_1= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
# this should stop immediately as we are already there
---replace_result $master_log_pos_2 MASTER_LOG_POS
-eval start slave until master_log_file='master-bin.000001', master_log_pos=$master_log_pos_2;
+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
---let $slave_param= Exec_Master_Log_Pos
---let $slave_param_value= $exec_log_pos_1
---source include/check_slave_param.inc
+--vertical_results
+--replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
+--replace_column 1 # 7 # 9 # 22 # 23 # 33 #
+show slave status;
#testing various error conditions
---replace_result 561 MASTER_LOG_POS
--error 1277
start slave until master_log_file='master-bin', master_log_pos=561;
---replace_result 561 MASTER_LOG_POS 12 RELAY_LOG_POS
--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';
---replace_result 561 MASTER_LOG_POS
--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;
---replace_result 740 MASTER_LOG_POS
start slave until master_log_file='master-bin.000001', master_log_pos=740;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_server_id1.test b/mysql-test/suite/engines/funcs/t/rpl_server_id1.test
index 014f38d3544..71310750b60 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_server_id1.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_server_id1.test
@@ -12,13 +12,10 @@ reset master;
stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_port=$SLAVE_MYPORT;
-source include/check_slave_no_error.inc;
-
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--replace_column 16 # 18 #
+show slave status;
start slave;
-let $slave_io_errno= 1593;
-let $show_slave_io_error= 1;
-source include/wait_for_slave_io_error.inc;
-
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)
diff --git a/mysql-test/suite/engines/funcs/t/rpl_server_id2.test b/mysql-test/suite/engines/funcs/t/rpl_server_id2.test
index 5b8683ecfb1..0f2eb560d18 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_server_id2.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_server_id2.test
@@ -9,6 +9,9 @@ reset master;
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;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_slave_status.test b/mysql-test/suite/engines/funcs/t/rpl_slave_status.test
index cc3fbf6abee..b3d6e49e215 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_slave_status.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_slave_status.test
@@ -22,7 +22,9 @@ drop table if exists t1;
--enable_warnings
create table t1 (n int);
insert into t1 values (1);
-sync_slave_with_master;
+save_master_pos;
+connection slave;
+sync_with_master;
select * from t1;
# 3. Delete new replication user
@@ -38,8 +40,12 @@ stop slave;
start slave;
# 5. Make sure Slave_IO_Running = No
-let $slave_io_errno= 1045;
-source include/wait_for_slave_io_error.inc;
+--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;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test
index c9e2ab6b703..b9df07101fb 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test
@@ -510,7 +510,9 @@ INSERT INTO t12 VALUES(UUID());
UNLOCK TABLES;
--disable_result_log
-source include/show_binlog_events.inc;
+--replace_column 2 # 5 #
+--replace_regex /table_id: [0-9]+/table_id: #/
+show binlog events;
--enable_result_log
sync_slave_with_master;
@@ -527,7 +529,9 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_
connection master;
--disable_result_log
-source include/show_binlog_events.inc;
+--replace_column 2 # 5 #
+--replace_regex /table_id: [0-9]+/table_id: #/
+show binlog events;
--enable_result_log
# Now test that mysqlbinlog works fine on a binlog generated by the
diff --git a/mysql-test/suite/engines/funcs/t/rpl_temp_table.test b/mysql-test/suite/engines/funcs/t/rpl_temp_table.test
index 9b73961aeea..c13470f20b6 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_temp_table.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_temp_table.test
@@ -4,18 +4,26 @@
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/master-slave.inc
+--disable_query_log
+CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--enable_query_log
+
create table t2 (n int, PRIMARY KEY(n));
create temporary table t1 (n int);
create temporary table t3 (n int not null);
insert into t1 values(1),(2),(3),(100),(25),(26),(200),(300);
+--disable_warnings
insert into t2 select * from t1;
+--enable_warnings
alter table t3 add primary key(n);
flush logs;
insert into t3 values (1010);
+--disable_warnings
insert into t2 select * from t3;
+--enable_warnings
drop table if exists t3;
insert into t2 values (1012);
@@ -23,7 +31,9 @@ insert into t2 values (1012);
connection master1;
create temporary table t1 (n int);
insert into t1 values (4),(5);
+--disable_warnings
insert into t2 select * from t1;
+--enable_warnings
save_master_pos;
disconnect master;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_temporary.test b/mysql-test/suite/engines/funcs/t/rpl_temporary.test
index 1539abeaceb..aa90a5153bf 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_temporary.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_temporary.test
@@ -18,6 +18,10 @@ sync_with_master;
reset master;
connection master;
+--disable_query_log
+CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--enable_query_log
+
connect (con1,localhost,root,,);
#added on 2007/5/18
@@ -62,7 +66,9 @@ insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
connection con1;
create temporary table t3(f int);
+--disable_warnings
insert into t3 select * from t1 where f<6;
+--enable_warnings
sleep 1;
connection con2;
@@ -70,11 +76,15 @@ create temporary table t3(f int);
sleep 1;
connection con1;
+--disable_warnings
insert into t2 select count(*) from t3;
+--enable_warnings
sleep 1;
connection con2;
+--disable_warnings
insert into t3 select * from t1 where f>=4;
+--enable_warnings
sleep 1;
connection con1;
@@ -82,7 +92,9 @@ drop temporary table t3;
sleep 1;
connection con2;
+--disable_warnings
insert into t2 select count(*) from t3;
+--enable_warnings
drop temporary table t3;
select * from t2 ORDER BY f;
@@ -107,22 +119,30 @@ SET @@session.pseudo_thread_id=1;
create temporary table t3(f int);
SET TIMESTAMP=1040323952;
SET @@session.pseudo_thread_id=1;
+--disable_warnings
insert into t3 select * from t1 where f<6;
+--enable_warnings
SET TIMESTAMP=1040324145;
SET @@session.pseudo_thread_id=2;
create temporary table t3(f int);
SET TIMESTAMP=1040324186;
SET @@session.pseudo_thread_id=1;
+--disable_warnings
insert into t2 select count(*) from t3;
+--enable_warnings
SET TIMESTAMP=1040324200;
SET @@session.pseudo_thread_id=2;
+--disable_warnings
insert into t3 select * from t1 where f>=4;
+--enable_warnings
SET TIMESTAMP=1040324211;
SET @@session.pseudo_thread_id=1;
drop temporary table t3;
SET TIMESTAMP=1040324219;
SET @@session.pseudo_thread_id=2;
+--disable_warnings
insert into t2 select count(*) from t3;
+--enable_warnings
SET TIMESTAMP=1040324224;
SET @@session.pseudo_thread_id=2;
drop temporary table t3;
@@ -149,7 +169,9 @@ create table t5 (f int);
# find dumper's $id
select id from information_schema.processlist where command='Binlog Dump' into @id;
kill @id; # to stimulate reconnection by slave w/o timeout
+--disable_warnings
insert into t5 select * from t4;
+--enable_warnings
save_master_pos;
connection slave;
diff --git a/mysql-test/suite/engines/funcs/t/rpl_trigger.test b/mysql-test/suite/engines/funcs/t/rpl_trigger.test
index 2162c488bfc..77cc7a3b2c0 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_trigger.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_trigger.test
@@ -6,7 +6,7 @@
--source include/master-slave.inc
disable_query_log;
-call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
enable_query_log;
--disable_warnings
diff --git a/mysql-test/suite/engines/iuds/r/insert_year.result b/mysql-test/suite/engines/iuds/r/insert_year.result
index 69d1139c037..386c8090434 100644
--- a/mysql-test/suite/engines/iuds/r/insert_year.result
+++ b/mysql-test/suite/engines/iuds/r/insert_year.result
@@ -2431,7 +2431,7 @@ c1 c2 c3 c4
2155 2155 1998-12-26 1998-12-26 11:30:45
SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3;
total_rows min_value max(c2)
-21 1901 2155
+21 0 2155
SELECT * FROM t3 WHERE c3 = '1998-12-11';
c1 c2 c3 c4
1990 1990 1998-12-11 1998-12-11 11:30:45
@@ -2838,7 +2838,7 @@ c1 c2 c3 c4
2155 2155 1998-12-26 1998-12-26 11:30:45
SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3;
total_rows min_value max(c2)
-21 1901 2155
+21 0 2155
SELECT * FROM t3 WHERE c3 = '1998-12-11';
c1 c2 c3 c4
1990 1990 1998-12-11 1998-12-11 11:30:45
diff --git a/mysql-test/suite/engines/iuds/r/update_delete_calendar.result b/mysql-test/suite/engines/iuds/r/update_delete_calendar.result
index e2dd83e03b4..a04585dfd72 100644
--- a/mysql-test/suite/engines/iuds/r/update_delete_calendar.result
+++ b/mysql-test/suite/engines/iuds/r/update_delete_calendar.result
@@ -791,6 +791,9 @@ Warning 1292 Truncated incorrect datetime value: '2009-01-10 23:60:59'
SELECT count(*) FROM t1 WHERE c2='2001-01-11 23:59:60' /* returns 0 */;
count(*)
0
+Warnings:
+Warning 1292 Incorrect datetime value: '2001-01-11 23:59:60' for column 'c2' at row 1
+Warning 1292 Incorrect datetime value: '2001-01-11 23:59:60' for column 'c2' at row 1
SELECT * FROM t1 WHERE c1='0000-00-00 00:00:00' OR c2='0000-00-00 00:00:00';
c1 c2 c3
0000-00-00 00:00:00 0000-00-00 00:00:00 6
diff --git a/mysql-test/suite/engines/iuds/r/update_delete_number.result b/mysql-test/suite/engines/iuds/r/update_delete_number.result
index 2ff7276f058..8e190870092 100644
--- a/mysql-test/suite/engines/iuds/r/update_delete_number.result
+++ b/mysql-test/suite/engines/iuds/r/update_delete_number.result
@@ -63,7 +63,7 @@ c1 c2 c3
4294967295 2147483647 9
UPDATE t1 SET c2=-2147483649 WHERE c1=109 ORDER BY c1;
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 13
SELECT c1,c2 FROM t1 WHERE c1=109;
c1 c2
109 -2147483648
@@ -1158,7 +1158,7 @@ c1 c2 c3
255 127 9
UPDATE t1 SET c2=-129 WHERE c1=109 ORDER BY c1;
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 13
SELECT c1,c2 FROM t1 WHERE c1=109;
c1 c2
109 -128
@@ -1929,7 +1929,7 @@ c1 c2 c3
65535 32767 9
UPDATE t1 SET c2=-32769 WHERE c1=109 ORDER BY c1;
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 13
SELECT c1,c2 FROM t1 WHERE c1=109;
c1 c2
109 -32768
@@ -2676,7 +2676,7 @@ c1 c2 c3
16777215 8388607 9
UPDATE t1 SET c2=-8388609 WHERE c1=109 ORDER BY c1;
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 13
SELECT c1,c2 FROM t1 WHERE c1=109;
c1 c2
109 -8388608
@@ -3423,7 +3423,7 @@ c1 c2 c3
18446744073709551615 9223372036854775807 9
UPDATE t1 SET c2=-9223372036854775809 WHERE c1=109 ORDER BY c1;
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 13
SELECT c1,c2 FROM t1 WHERE c1=109;
c1 c2
109 -9223372036854775808
diff --git a/mysql-test/suite/engines/iuds/t/disabled.def b/mysql-test/suite/engines/iuds/t/disabled.def
index c8fdf80274b..7fd504c0996 100644
--- a/mysql-test/suite/engines/iuds/t/disabled.def
+++ b/mysql-test/suite/engines/iuds/t/disabled.def
@@ -1,2 +1,3 @@
insert_calendar : Bug#52283 Innodb reports extra warnings when SELECT/WHERE is performed using invalid value
update_delete_calendar : Bug#52824 + Bug#52283(in case of Innodb)
+
diff --git a/mysql-test/suite/engines/iuds/t/insert_number.test b/mysql-test/suite/engines/iuds/t/insert_number.test
index b55bd8dc98a..e2c809fad85 100644
--- a/mysql-test/suite/engines/iuds/t/insert_number.test
+++ b/mysql-test/suite/engines/iuds/t/insert_number.test
@@ -7812,9 +7812,6 @@ SELECT * FROM t2 ORDER BY c1,c6 LIMIT 2;
SELECT * FROM t2 ORDER BY c1,c6 DESC LIMIT 2;
## ref type access
-
-# Bug#52283 : Remove the following --disable_warnings
-# command when the bug is fixed
--disable_warnings
SELECT * FROM t2 WHERE c1 = 18446744073709551616 ORDER BY c1,c6;
SELECT * FROM t2 WHERE c1 = 18446744073709551616 ORDER BY c1,c6 LIMIT 2;
diff --git a/mysql-test/suite/engines/iuds/t/update_delete_calendar.test b/mysql-test/suite/engines/iuds/t/update_delete_calendar.test
index c6a22511766..aa695953ce1 100644
--- a/mysql-test/suite/engines/iuds/t/update_delete_calendar.test
+++ b/mysql-test/suite/engines/iuds/t/update_delete_calendar.test
@@ -300,12 +300,7 @@ INSERT INTO t1 VALUES('2001-01-09','2001-01-10',6),('2001-01-11','2001-01-12',7)
UPDATE t1 SET c1='2001-01-09 24:59:59',c2='2009-01-10 23:60:59' WHERE c1='2001-01-09';
UPDATE t1 SET c2='2001-01-11 23:59:60' WHERE c1='2001-01-11';
SELECT count(*) FROM t1 WHERE c1='2001-01-09 24:59:59' AND c2='2009-01-10 23:60:59';
-
-# Bug#52283 : Remove the following --disable_warnings
-# command when the bug is fixed
---disable_warnings
SELECT count(*) FROM t1 WHERE c2='2001-01-11 23:59:60' /* returns 0 */;
---enable_warnings
--sorted_result
SELECT * FROM t1 WHERE c1='0000-00-00 00:00:00' OR c2='0000-00-00 00:00:00';
diff --git a/mysql-test/suite/federated/disabled.def b/mysql-test/suite/federated/disabled.def
index 1287864ef16..bb2e4dde141 100644
--- a/mysql-test/suite/federated/disabled.def
+++ b/mysql-test/suite/federated/disabled.def
@@ -9,4 +9,3 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-
diff --git a/mysql-test/suite/federated/federated_bug_25714.test b/mysql-test/suite/federated/federated_bug_25714.test
index 82745b2a094..633e469f595 100644
--- a/mysql-test/suite/federated/federated_bug_25714.test
+++ b/mysql-test/suite/federated/federated_bug_25714.test
@@ -1,5 +1,5 @@
# Check that path to the specific test program has been setup
-if (`select LENGTH("$MYSQL_BUG25714") = 0`)
+if (!$MYSQL_BUG25714)
{
skip Need bug25714 test program;
}
diff --git a/mysql-test/suite/federated/federated_bug_35333.result b/mysql-test/suite/federated/federated_bug_35333.result
new file mode 100644
index 00000000000..ca7aa960b73
--- /dev/null
+++ b/mysql-test/suite/federated/federated_bug_35333.result
@@ -0,0 +1,67 @@
+#
+# Bug 35333 "If a Federated table can't connect to the remote hose, can't retrieve metadata"
+#
+# Queries such as SHOW TABLE STATUS and SELECT * FROM INFORMATION_SCHEMA.TABLES fail
+# when encountering a federated table that cannot connect to its remote table.
+#
+# The fix is to store the error text in the TABLE COMMENTS column of I_S.TABLES, clear
+# the remote connection error and push a warning instead. This allows the SELECT operation
+# to complete while still indicating a problem. This fix applies to any non-fatal system
+# error that occurs during a query against I_S.TABLES.de
+CREATE DATABASE federated;
+CREATE DATABASE federated;
+CREATE DATABASE IF NOT EXISTS realdb;
+DROP TABLE IF EXISTS realdb.t0;
+DROP TABLE IF EXISTS federated.t0;
+#
+# Create the base table to be referenced
+#
+CREATE TABLE realdb.t0 (a text, b text) ENGINE=MYISAM;
+#
+# Create a federated table with a bogus port number
+#
+CREATE TABLE federated.t0 (a text, b text) ENGINE=FEDERATED
+CONNECTION='mysql://root@127.0.0.1:63333/realdb/t0';
+#
+# Trigger a federated system error during a INFORMATION_SCHEMA.TABLES query
+#
+SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT
+FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'realdb' or TABLE_SCHEMA = 'federated';
+TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_ROWS DATA_LENGTH TABLE_COMMENT
+federated t0 BASE TABLE FEDERATED NULL 0 Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno)
+realdb t0 BASE TABLE MyISAM Dynamic 0 0
+Warnings:
+Warning 1429 Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno)
+SHOW WARNINGS;
+Level Code Message
+Warning 1429 Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno)
+#
+# Create a MyISAM table then corrupt the file
+#
+USE realdb;
+CREATE TABLE t1 (c1 int) ENGINE=MYISAM;
+#
+# Corrupt the MyISAM table by deleting the base file
+#
+#
+# Trigger a MyISAM system error during an INFORMATION_SCHEMA.TABLES query
+#
+SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT
+FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_ROWS DATA_LENGTH TABLE_COMMENT
+realdb t1 BASE TABLE NULL NULL NULL NULL Can't find file: 't1' (errno: 2)
+Warnings:
+Warning 1017 Can't find file: 't1' (errno: 2)
+SHOW WARNINGS;
+Level Code Message
+Warning 1017 Can't find file: 't1' (errno: 2)
+#
+# Cleanup
+#
+DROP TABLE IF EXISTS realdb.t0;
+DROP TABLE IF EXISTS federated.t0;
+DROP DATABASE realdb;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE federated;
+DROP TABLE IF EXISTS federated.t1;
+DROP DATABASE federated;
diff --git a/mysql-test/suite/federated/federated_bug_35333.test b/mysql-test/suite/federated/federated_bug_35333.test
new file mode 100644
index 00000000000..58c217d24f2
--- /dev/null
+++ b/mysql-test/suite/federated/federated_bug_35333.test
@@ -0,0 +1,74 @@
+--echo #
+--echo # Bug 35333 "If a Federated table can't connect to the remote hose, can't retrieve metadata"
+--echo #
+--echo # Queries such as SHOW TABLE STATUS and SELECT * FROM INFORMATION_SCHEMA.TABLES fail
+--echo # when encountering a federated table that cannot connect to its remote table.
+--echo #
+--echo # The fix is to store the error text in the TABLE COMMENTS column of I_S.TABLES, clear
+--echo # the remote connection error and push a warning instead. This allows the SELECT operation
+--echo # to complete while still indicating a problem. This fix applies to any non-fatal system
+--echo # error that occurs during a query against I_S.TABLES.de
+
+--source federated.inc
+
+--disable_warnings
+CREATE DATABASE IF NOT EXISTS realdb;
+# Federated database exists
+DROP TABLE IF EXISTS realdb.t0;
+DROP TABLE IF EXISTS federated.t0;
+--enable_warnings
+
+--echo #
+--echo # Create the base table to be referenced
+--echo #
+CREATE TABLE realdb.t0 (a text, b text) ENGINE=MYISAM;
+
+--echo #
+--echo # Create a federated table with a bogus port number
+--echo #
+CREATE TABLE federated.t0 (a text, b text) ENGINE=FEDERATED
+ CONNECTION='mysql://root@127.0.0.1:63333/realdb/t0';
+
+#--warning ER_CONNECT_TO_FOREIGN_DATA_SOURCE
+
+--echo #
+--echo # Trigger a federated system error during a INFORMATION_SCHEMA.TABLES query
+--echo #
+# Remove O/S-specific socket error
+--replace_regex /\(.*\)/(socket errno)/
+SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT
+ FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'realdb' or TABLE_SCHEMA = 'federated';
+
+# Remove O/S-specific socket error
+--replace_regex /\(.*\)/(socket errno)/
+SHOW WARNINGS;
+
+--echo #
+--echo # Create a MyISAM table then corrupt the file
+--echo #
+USE realdb;
+CREATE TABLE t1 (c1 int) ENGINE=MYISAM;
+--echo #
+--echo # Corrupt the MyISAM table by deleting the base file
+--echo #
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+--remove_file $MYSQLD_DATADIR/realdb/t1.MYD
+--remove_file $MYSQLD_DATADIR/realdb/t1.MYI
+
+--echo #
+--echo # Trigger a MyISAM system error during an INFORMATION_SCHEMA.TABLES query
+--echo #
+SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT
+ FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+
+SHOW WARNINGS;
+--echo #
+--echo # Cleanup
+--echo #
+--disable_warnings
+DROP TABLE IF EXISTS realdb.t0;
+DROP TABLE IF EXISTS federated.t0;
+DROP DATABASE realdb;
+--enable_warnings
+
+--source federated_cleanup.inc
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 ee1548fe012..fa8fb6c1eb2 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
@@ -110,10 +110,10 @@ Ensure that root always has the GRANT CREATE ROUTINE privilege.
--------------------------------------------------------------------------------
grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
+DROP PROCEDURE IF EXISTS db_storedproc_1.sp3;
+DROP FUNCTION IF EXISTS db_storedproc_1.fn1;
user_1@localhost db_storedproc_1
-DROP PROCEDURE IF EXISTS sp3;
-DROP FUNCTION IF EXISTS fn1;
CREATE PROCEDURE sp3(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
@@ -128,8 +128,6 @@ root@localhost db_storedproc_1
drop user 'user_1'@'localhost';
DROP PROCEDURE sp3;
DROP FUNCTION fn1;
-Warnings:
-Warning 1403 There is no such grant defined for user 'user_1' on host 'localhost' on routine 'fn1'
Testcase 3.1.6.4:
-----------------
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 c963be41a35..9dabfcbef49 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
@@ -573,6 +573,7 @@ root@localhost
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
drop trigger trg1_1;
use priv_db;
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 b2b38694680..a25147a1480 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_08.result
@@ -353,8 +353,6 @@ B Test 3.5.8.5-case 00191 0000000016 C=one
C Test 3.5.8.5-case 00200 0000000001 C=one
Insert into tb3 (f120, f122, f136)
values ('d', 'Test 3.5.8.5-case', 152);
-Warnings:
-Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
@@ -364,8 +362,6 @@ B Test 3.5.8.5-case 00191 0000000016 1*0000099999
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
Insert into tb3 (f120, f122, f136, f144)
values ('e', 'Test 3.5.8.5-case', 200, 8);
-Warnings:
-Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
diff --git a/mysql-test/suite/funcs_1/r/is_cml_ndb.result b/mysql-test/suite/funcs_1/r/is_cml_ndb.result
deleted file mode 100644
index 22f90433acf..00000000000
--- a/mysql-test/suite/funcs_1/r/is_cml_ndb.result
+++ /dev/null
@@ -1,98 +0,0 @@
-USE test;
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1
-(
-f1 CHAR UNICODE,
-f2 CHAR(0) UNICODE,
-f3 CHAR(10) UNICODE,
-f5 VARCHAR(0) UNICODE,
-f6 VARCHAR(255) UNICODE,
-f7 VARCHAR(260) UNICODE,
-f8 TEXT UNICODE,
-f9 TINYTEXT UNICODE,
-f10 MEDIUMTEXT UNICODE,
-f11 LONGTEXT UNICODE,
-PRIMARY KEY(f1)
-) ENGINE = NDB;
-SELECT * FROM information_schema.columns
-WHERE table_schema LIKE 'test%'
-ORDER BY table_schema, table_name, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
-def test t1 f1 1 NO char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) PRI select,insert,update,references
-def test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
-def test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
-def test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
-def test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
-def test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
-def test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
-def test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
-def test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
-def test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
-##########################################################################
-# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
-##########################################################################
-SELECT DISTINCT
-CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
-DATA_TYPE,
-CHARACTER_SET_NAME,
-COLLATION_NAME
-FROM information_schema.columns
-WHERE table_schema LIKE 'test%'
-AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
-ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
-COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
-SELECT DISTINCT
-CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
-DATA_TYPE,
-CHARACTER_SET_NAME,
-COLLATION_NAME
-FROM information_schema.columns
-WHERE table_schema LIKE 'test%'
-AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
-ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
-COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
-2.0000 char ucs2 ucs2_general_ci
-2.0000 longtext ucs2 ucs2_general_ci
-2.0000 mediumtext ucs2 ucs2_general_ci
-2.0000 text ucs2 ucs2_general_ci
-2.0000 varchar ucs2 ucs2_general_ci
-2.0079 tinytext ucs2 ucs2_general_ci
-SELECT DISTINCT
-CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
-DATA_TYPE,
-CHARACTER_SET_NAME,
-COLLATION_NAME
-FROM information_schema.columns
-WHERE table_schema LIKE 'test%'
-AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
-ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
-COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
-NULL char ucs2 ucs2_general_ci
-NULL varchar ucs2 ucs2_general_ci
---> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
---> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
-SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
-TABLE_SCHEMA,
-TABLE_NAME,
-COLUMN_NAME,
-DATA_TYPE,
-CHARACTER_MAXIMUM_LENGTH,
-CHARACTER_OCTET_LENGTH,
-CHARACTER_SET_NAME,
-COLLATION_NAME,
-COLUMN_TYPE
-FROM information_schema.columns
-WHERE table_schema LIKE 'test%'
-ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
-COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
-2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1)
-NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0)
-2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10)
-NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0)
-2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255)
-2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260)
-2.0000 test t1 f8 text 32767 65535 ucs2 ucs2_general_ci text
-2.0079 test t1 f9 tinytext 127 255 ucs2 ucs2_general_ci tinytext
-2.0000 test t1 f10 mediumtext 8388607 16777215 ucs2 ucs2_general_ci mediumtext
-2.0000 test t1 f11 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
-DROP TABLE t1;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index d4f5560174b..f5d3a4daf83 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -204,6 +204,7 @@ def information_schema PARTITIONS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8
def information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
def information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
+def information_schema PLUGINS LOAD_OPTION 11 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
def information_schema PLUGINS PLUGIN_AUTH_VERSION 12 NULL YES varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
def information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
@@ -785,6 +786,7 @@ NULL information_schema PBXT_STATISTICS Value bigint NULL NULL NULL NULL bigint(
3.0000 information_schema PLUGINS PLUGIN_AUTHOR varchar 64 192 utf8 utf8_general_ci varchar(64)
1.0000 information_schema PLUGINS PLUGIN_DESCRIPTION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema PLUGINS PLUGIN_LICENSE varchar 80 240 utf8 utf8_general_ci varchar(80)
+3.0000 information_schema PLUGINS LOAD_OPTION varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema PLUGINS PLUGIN_MATURITY varchar 12 36 utf8 utf8_general_ci varchar(12)
3.0000 information_schema PLUGINS PLUGIN_AUTH_VERSION varchar 80 240 utf8 utf8_general_ci varchar(80)
NULL information_schema PROCESSLIST ID bigint NULL NULL NULL NULL bigint(4)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
index 121fc80e849..ba681e7865b 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
@@ -3,9 +3,336 @@ WHERE table_schema = 'information_schema'
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
ORDER BY table_schema, table_name, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
-#<<<<<<< TREE
-#=======
-#>>>>>>> MERGE-SOURCE
+def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL utf8 utf8_general_ci varchar(60)
+def information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3)
+def information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema COLLATIONS COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11)
+def information_schema COLLATIONS IS_COMPILED 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3)
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMNS EXTRA 17 NO varchar 27 81 NULL NULL utf8 utf8_general_ci varchar(27)
+def information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
+def information_schema COLUMNS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMNS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMN_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
+def information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ENGINES COMMENT 3 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
+def information_schema ENGINES ENGINE 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema ENGINES SUPPORT 2 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
+def information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema EVENTS DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema EVENTS DEFINER 4 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
+def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
+def information_schema EVENTS EVENT_CATALOG 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema EVENTS EVENT_COMMENT 20 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema EVENTS EVENT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema EVENTS EVENT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema EVENTS EVENT_TYPE 8 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9)
+def information_schema EVENTS EXECUTE_AT 9 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema EVENTS INTERVAL_FIELD 11 NULL YES varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18)
+def information_schema EVENTS INTERVAL_VALUE 10 NULL YES varchar 256 768 NULL NULL utf8 utf8_general_ci varchar(256)
+def information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema EVENTS ON_COMPLETION 16 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
+def information_schema EVENTS ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10)
+def information_schema EVENTS SQL_MODE 12 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192)
+def information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18)
+def information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES ENGINE 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES EXTENT_SIZE 16 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255)
+def information_schema FILES FILE_ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES FILE_NAME 2 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES FILE_TYPE 3 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
+def information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
+def information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
+def information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES TABLE_CATALOG 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10)
+def information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(10)
+def information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARAMETERS CHARACTER_MAXIMUM_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL int(21)
+def information_schema PARAMETERS CHARACTER_OCTET_LENGTH 9 NULL YES int NULL NULL 10 0 NULL NULL int(21)
+def information_schema PARAMETERS CHARACTER_SET_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARAMETERS COLLATION_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARAMETERS DATA_TYPE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARAMETERS DTD_IDENTIFIER 14 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema PARAMETERS NUMERIC_PRECISION 10 NULL YES int NULL NULL 10 0 NULL NULL int(21)
+def information_schema PARAMETERS NUMERIC_SCALE 11 NULL YES int NULL NULL 10 0 NULL NULL int(21)
+def information_schema PARAMETERS ORDINAL_POSITION 4 0 NO int NULL NULL 10 0 NULL NULL int(21)
+def information_schema PARAMETERS PARAMETER_MODE 5 NULL YES varchar 5 15 NULL NULL utf8 utf8_general_ci varchar(5)
+def information_schema PARAMETERS PARAMETER_NAME 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARAMETERS ROUTINE_TYPE 15 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9)
+def information_schema PARAMETERS SPECIFIC_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema PARAMETERS SPECIFIC_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARAMETERS SPECIFIC_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS NODEGROUP 24 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
+def information_schema PARTITIONS PARTITION_COMMENT 23 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
+def information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18)
+def information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
+def information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARTITIONS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema PARTITIONS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema PLUGINS LOAD_OPTION 11 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
+def information_schema PLUGINS PLUGIN_LICENSE 10 NULL YES varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
+def information_schema PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
+def information_schema PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
+def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
+def information_schema PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
+def information_schema PROCESSLIST COMMAND 5 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
+def information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PROCESSLIST HOST 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema PROCESSLIST TIME 6 0 NO int NULL NULL 10 0 NULL NULL int(7)
+def information_schema PROCESSLIST USER 2 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES CHARACTER_MAXIMUM_LENGTH 7 NULL YES int NULL NULL 10 0 NULL NULL int(21)
+def information_schema ROUTINES CHARACTER_OCTET_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL int(21)
+def information_schema ROUTINES CHARACTER_SET_CLIENT 28 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema ROUTINES CHARACTER_SET_NAME 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES COLLATION_CONNECTION 29 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema ROUTINES COLLATION_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES CREATED 23 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema ROUTINES DATABASE_COLLATION 30 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema ROUTINES DATA_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES DEFINER 27 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
+def information_schema ROUTINES DTD_IDENTIFIER 13 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema ROUTINES EXTERNAL_LANGUAGE 17 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES EXTERNAL_NAME 16 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES IS_DETERMINISTIC 19 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema ROUTINES LAST_ALTERED 24 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema ROUTINES NUMERIC_PRECISION 9 NULL YES int NULL NULL 10 0 NULL NULL int(21)
+def information_schema ROUTINES NUMERIC_SCALE 10 NULL YES int NULL NULL 10 0 NULL NULL int(21)
+def information_schema ROUTINES PARAMETER_STYLE 18 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
+def information_schema ROUTINES ROUTINE_BODY 14 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
+def information_schema ROUTINES ROUTINE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema ROUTINES ROUTINE_COMMENT 26 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema ROUTINES ROUTINE_DEFINITION 15 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema ROUTINES ROUTINE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES ROUTINE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES ROUTINE_TYPE 5 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9)
+def information_schema ROUTINES SECURITY_TYPE 22 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7)
+def information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES SQL_DATA_ACCESS 20 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema ROUTINES SQL_MODE 25 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192)
+def information_schema ROUTINES SQL_PATH 21 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SCHEMATA CATALOG_NAME 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema SCHEMATA SCHEMA_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
+def information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SESSION_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21)
+def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL utf8 utf8_general_ci varchar(1)
+def information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
+def information_schema STATISTICS INDEX_COMMENT 16 NO varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024)
+def information_schema STATISTICS INDEX_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema STATISTICS INDEX_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema STATISTICS INDEX_TYPE 14 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
+def information_schema STATISTICS NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1)
+def information_schema STATISTICS NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
+def information_schema STATISTICS SEQ_IN_INDEX 7 0 NO bigint NULL NULL 19 0 NULL NULL bigint(2)
+def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(3)
+def information_schema STATISTICS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255)
+def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
+def information_schema TABLES TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema TABLES TABLE_COMMENT 21 NO varchar 2048 6144 NULL NULL utf8 utf8_general_ci varchar(2048)
+def information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema TABLESPACES AUTOEXTEND_SIZE 6 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema TABLESPACES ENGINE 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLESPACES EXTENT_SIZE 5 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema TABLESPACES LOGFILE_GROUP_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLESPACES MAXIMUM_SIZE 7 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema TABLESPACES NODEGROUP_ID 8 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned
+def information_schema TABLESPACES TABLESPACE_COMMENT 9 NULL YES varchar 2048 6144 NULL NULL utf8 utf8_general_ci varchar(2048)
+def information_schema TABLESPACES TABLESPACE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLESPACES TABLESPACE_TYPE 3 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
+def information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema TABLE_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
+def information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9)
+def information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
+def information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6)
+def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
+def information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
+def information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6)
+def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TRIGGERS SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192)
+def information_schema TRIGGERS TRIGGER_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema TRIGGERS TRIGGER_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
+def information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema USER_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
+def information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
+def information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
+def information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
+def information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7)
+def information_schema VIEWS TABLE_CATALOG 1 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
+def information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
+def information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
@@ -119,7 +446,7 @@ NULL information_schema COLUMNS NUMERIC_SCALE bigint NULL NULL NULL NULL bigint(
3.0000 information_schema COLUMNS COLUMN_KEY varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema COLUMNS EXTRA varchar 27 81 utf8 utf8_general_ci varchar(27)
3.0000 information_schema COLUMNS PRIVILEGES varchar 80 240 utf8 utf8_general_ci varchar(80)
-3.0000 information_schema COLUMNS COLUMN_COMMENT varchar 255 765 utf8 utf8_general_ci varchar(255)
+3.0000 information_schema COLUMNS COLUMN_COMMENT varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema COLUMN_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
3.0000 information_schema COLUMN_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema COLUMN_PRIVILEGES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -355,6 +682,7 @@ NULL information_schema PARTITIONS CHECKSUM bigint NULL NULL NULL NULL bigint(21
3.0000 information_schema PLUGINS PLUGIN_AUTHOR varchar 64 192 utf8 utf8_general_ci varchar(64)
1.0000 information_schema PLUGINS PLUGIN_DESCRIPTION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema PLUGINS PLUGIN_LICENSE varchar 80 240 utf8 utf8_general_ci varchar(80)
+3.0000 information_schema PLUGINS LOAD_OPTION varchar 64 192 utf8 utf8_general_ci varchar(64)
NULL information_schema PROCESSLIST ID bigint NULL NULL NULL NULL bigint(4)
3.0000 information_schema PROCESSLIST USER varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema PROCESSLIST HOST varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -434,6 +762,7 @@ NULL information_schema STATISTICS SUB_PART bigint NULL NULL NULL NULL bigint(3)
3.0000 information_schema STATISTICS NULLABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema STATISTICS INDEX_TYPE varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema STATISTICS COMMENT varchar 16 48 utf8 utf8_general_ci varchar(16)
+3.0000 information_schema STATISTICS INDEX_COMMENT varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema TABLES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
3.0000 information_schema TABLES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
@@ -454,7 +783,7 @@ NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
3.0000 information_schema TABLES TABLE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255)
-3.0000 information_schema TABLES TABLE_COMMENT varchar 80 240 utf8 utf8_general_ci varchar(80)
+3.0000 information_schema TABLES TABLE_COMMENT varchar 2048 6144 utf8 utf8_general_ci varchar(2048)
3.0000 information_schema TABLESPACES TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLESPACES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64)
3.0000 information_schema TABLESPACES TABLESPACE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
index 55f7ebf91ae..5c22a38c63c 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
@@ -479,9 +479,9 @@ def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerof
def test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill
def test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20)
def test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
-def test tb1 f30 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
-def test tb1 f31 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill
-def test tb1 f32 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill
+def test tb1 f30 30 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned
+def test tb1 f31 31 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill
+def test tb1 f32 32 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill
def test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
def test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
def test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
@@ -602,9 +602,9 @@ def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned
def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill
def test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill
def test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20)
-def test tb3 f147 30 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
-def test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill
-def test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill
+def test tb3 f147 30 999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned
+def test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill
+def test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill
def test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0)
def test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned
def test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill
diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
index 1cc6d0fb9d1..f739c99b06b 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
@@ -134,6 +134,13 @@ def mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_general_
def mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI select,insert,update,references
def mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
def mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
+def mysql proxies_priv Grantor 6 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL select,insert,update,references
+def mysql proxies_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
+def mysql proxies_priv Proxied_host 3 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
+def mysql proxies_priv Proxied_user 4 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
+def mysql proxies_priv Timestamp 7 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
+def mysql proxies_priv User 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
+def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(1) select,insert,update,references
def mysql servers Db 3 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
def mysql servers Host 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
def mysql servers Owner 9 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
@@ -178,6 +185,7 @@ def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NU
def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
def mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
def mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
+def mysql user authentication_string 42 NULL YES text 65535 65535 NULL NULL utf8 utf8_bin text select,insert,update,references
def mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
def mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
def mysql user Create_tablespace_priv 32 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
@@ -199,6 +207,7 @@ def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsign
def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
def mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) select,insert,update,references
+def mysql user plugin 41 YES char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
def mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
def mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
@@ -418,6 +427,13 @@ NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp
3.0000 mysql procs_priv Grantor char 77 231 utf8 utf8_bin char(77)
3.0000 mysql procs_priv Proc_priv set 27 81 utf8 utf8_general_ci set('Execute','Alter Routine','Grant')
NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp
+3.0000 mysql proxies_priv Host char 60 180 utf8 utf8_bin char(60)
+3.0000 mysql proxies_priv User char 16 48 utf8 utf8_bin char(16)
+3.0000 mysql proxies_priv Proxied_host char 60 180 utf8 utf8_bin char(60)
+3.0000 mysql proxies_priv Proxied_user char 16 48 utf8 utf8_bin char(16)
+NULL mysql proxies_priv With_grant tinyint NULL NULL NULL NULL tinyint(1)
+3.0000 mysql proxies_priv Grantor char 77 231 utf8 utf8_bin char(77)
+NULL mysql proxies_priv Timestamp timestamp NULL NULL NULL NULL timestamp
3.0000 mysql servers Server_name char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql servers Host char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql servers Db char 64 192 utf8 utf8_general_ci char(64)
@@ -500,5 +516,5 @@ NULL mysql user max_questions int NULL NULL NULL NULL int(11) unsigned
NULL mysql user max_updates int NULL NULL NULL NULL int(11) unsigned
NULL mysql user max_connections int NULL NULL NULL NULL int(11) unsigned
NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) unsigned
-1.0000 mysql user plugin char 60 60 latin1 latin1_swedish_ci char(60)
-1.0000 mysql user auth_string text 65535 65535 utf8 utf8_bin text
+1.0000 mysql user plugin char 64 64 latin1 latin1_swedish_ci char(64)
+1.0000 mysql user authentication_string text 65535 65535 utf8 utf8_bin text
diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
index 37a1c6d5273..090fc38efeb 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
@@ -97,13 +97,13 @@ def mysql host Select_priv 3 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('
def mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql host Trigger_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql host Update_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
-def mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
-def mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned PRI
+def mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned
+def mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned PRI
def mysql ndb_binlog_index File 2 NULL NO varchar 255 255 NULL NULL latin1 latin1_swedish_ci varchar(255)
-def mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
-def mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
-def mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
-def mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
+def mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned
+def mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned
+def mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned
+def mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned
def mysql plugin dl 2 NO varchar 128 384 NULL NULL utf8 utf8_general_ci varchar(128)
def mysql plugin name 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) PRI
def mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
@@ -134,6 +134,13 @@ def mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_general_
def mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI
def mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
def mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
+def mysql proxies_priv Grantor 6 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL
+def mysql proxies_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
+def mysql proxies_priv Proxied_host 3 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
+def mysql proxies_priv Proxied_user 4 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
+def mysql proxies_priv Timestamp 7 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
+def mysql proxies_priv User 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
+def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(1)
def mysql servers Db 3 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
def mysql servers Host 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
def mysql servers Owner 9 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
@@ -178,6 +185,7 @@ def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NU
def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
def mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
+def mysql user authentication_string 42 NULL YES text 65535 65535 NULL NULL utf8 utf8_bin text
def mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql user Create_tablespace_priv 32 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
@@ -199,6 +207,7 @@ def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsign
def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
def mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41)
+def mysql user plugin 41 YES char 64 192 NULL NULL utf8 utf8_bin char(64)
def mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
def mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
@@ -418,6 +427,13 @@ NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp
3.0000 mysql procs_priv Grantor char 77 231 utf8 utf8_bin char(77)
3.0000 mysql procs_priv Proc_priv set 27 81 utf8 utf8_general_ci set('Execute','Alter Routine','Grant')
NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp
+3.0000 mysql proxies_priv Host char 60 180 utf8 utf8_bin char(60)
+3.0000 mysql proxies_priv User char 16 48 utf8 utf8_bin char(16)
+3.0000 mysql proxies_priv Proxied_host char 60 180 utf8 utf8_bin char(60)
+3.0000 mysql proxies_priv Proxied_user char 16 48 utf8 utf8_bin char(16)
+NULL mysql proxies_priv With_grant tinyint NULL NULL NULL NULL tinyint(1)
+3.0000 mysql proxies_priv Grantor char 77 231 utf8 utf8_bin char(77)
+NULL mysql proxies_priv Timestamp timestamp NULL NULL NULL NULL timestamp
3.0000 mysql servers Server_name char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql servers Host char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql servers Db char 64 192 utf8 utf8_general_ci char(64)
@@ -500,3 +516,5 @@ NULL mysql user max_questions int NULL NULL NULL NULL int(11) unsigned
NULL mysql user max_updates int NULL NULL NULL NULL int(11) unsigned
NULL mysql user max_connections int NULL NULL NULL NULL int(11) unsigned
NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) unsigned
+3.0000 mysql user plugin char 64 192 utf8 utf8_bin char(64)
+1.0000 mysql user authentication_string text 65535 65535 utf8 utf8_bin text
diff --git a/mysql-test/suite/funcs_1/r/is_columns_ndb.result b/mysql-test/suite/funcs_1/r/is_columns_ndb.result
deleted file mode 100644
index 8a1691ec7d2..00000000000
--- a/mysql-test/suite/funcs_1/r/is_columns_ndb.result
+++ /dev/null
@@ -1,228 +0,0 @@
-DROP DATABASE IF EXISTS test1;
-CREATE DATABASE test1;
-USE test;
-USE test;
-USE test;
-DROP TABLE IF EXISTS t1, t2, t4, t10, t11;
-CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-ENGINE = ndb;
-CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-ENGINE = ndb;
-CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-ENGINE = ndb;
-CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-ENGINE = ndb;
-CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-ENGINE = ndb;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t1;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t2;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t4;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t10;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t11;
-drop TABLE if exists t3;
-CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = ndb;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' INTO TABLE t3;
-drop database if exists test4;
-CREATE database test4;
-use test4;
-CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
-ENGINE = ndb;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' INTO TABLE t6;
-use test;
-drop TABLE if exists t7, t8;
-CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = ndb;
-CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = ndb;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' INTO TABLE t7;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' INTO TABLE t8;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-drop TABLE if exists t9;
-CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = ndb;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' INTO TABLE t9;
-SELECT * FROM information_schema.columns
-WHERE table_schema LIKE 'test%'
-ORDER BY table_schema, table_name, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
-def test t1 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-def test t1 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t1 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t10 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-def test t10 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t10 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t11 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-def test t11 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t11 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t2 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-def test t2 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t2 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t3 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-def test t3 f2 2 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t4 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-def test t4 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t4 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t7 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-def test t7 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t8 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-def test t8 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test t9 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test4 t6 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
-def test4 t6 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
-def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-def test4 t6 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
-def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
-##########################################################################
-# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
-##########################################################################
-SELECT DISTINCT
-CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
-DATA_TYPE,
-CHARACTER_SET_NAME,
-COLLATION_NAME
-FROM information_schema.columns
-WHERE table_schema LIKE 'test%'
-AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
-ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
-COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
-1.0000 char latin1 latin1_swedish_ci
-SELECT DISTINCT
-CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
-DATA_TYPE,
-CHARACTER_SET_NAME,
-COLLATION_NAME
-FROM information_schema.columns
-WHERE table_schema LIKE 'test%'
-AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
-ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
-COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
-SELECT DISTINCT
-CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
-DATA_TYPE,
-CHARACTER_SET_NAME,
-COLLATION_NAME
-FROM information_schema.columns
-WHERE table_schema LIKE 'test%'
-AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
-ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
-COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
-NULL date NULL NULL
-NULL int NULL NULL
---> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
---> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
-SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
-TABLE_SCHEMA,
-TABLE_NAME,
-COLUMN_NAME,
-DATA_TYPE,
-CHARACTER_MAXIMUM_LENGTH,
-CHARACTER_OCTET_LENGTH,
-CHARACTER_SET_NAME,
-COLLATION_NAME,
-COLUMN_TYPE
-FROM information_schema.columns
-WHERE table_schema LIKE 'test%'
-ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
-COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
-1.0000 test t1 f1 char 20 20 latin1 latin1_swedish_ci char(20)
-1.0000 test t1 f2 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test t1 f3 date NULL NULL NULL NULL date
-NULL test t1 f4 int NULL NULL NULL NULL int(11)
-1.0000 test t1 f5 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test t1 f6 int NULL NULL NULL NULL int(11)
-1.0000 test t10 f1 char 20 20 latin1 latin1_swedish_ci char(20)
-1.0000 test t10 f2 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test t10 f3 date NULL NULL NULL NULL date
-NULL test t10 f4 int NULL NULL NULL NULL int(11)
-1.0000 test t10 f5 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test t10 f6 int NULL NULL NULL NULL int(11)
-1.0000 test t11 f1 char 20 20 latin1 latin1_swedish_ci char(20)
-1.0000 test t11 f2 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test t11 f3 date NULL NULL NULL NULL date
-NULL test t11 f4 int NULL NULL NULL NULL int(11)
-1.0000 test t11 f5 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test t11 f6 int NULL NULL NULL NULL int(11)
-1.0000 test t2 f1 char 20 20 latin1 latin1_swedish_ci char(20)
-1.0000 test t2 f2 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test t2 f3 date NULL NULL NULL NULL date
-NULL test t2 f4 int NULL NULL NULL NULL int(11)
-1.0000 test t2 f5 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test t2 f6 int NULL NULL NULL NULL int(11)
-1.0000 test t3 f1 char 20 20 latin1 latin1_swedish_ci char(20)
-1.0000 test t3 f2 char 20 20 latin1 latin1_swedish_ci char(20)
-NULL test t3 f3 int NULL NULL NULL NULL int(11)
-1.0000 test t4 f1 char 20 20 latin1 latin1_swedish_ci char(20)
-1.0000 test t4 f2 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test t4 f3 date NULL NULL NULL NULL date
-NULL test t4 f4 int NULL NULL NULL NULL int(11)
-1.0000 test t4 f5 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test t4 f6 int NULL NULL NULL NULL int(11)
-1.0000 test t7 f1 char 20 20 latin1 latin1_swedish_ci char(20)
-1.0000 test t7 f2 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test t7 f3 date NULL NULL NULL NULL date
-NULL test t7 f4 int NULL NULL NULL NULL int(11)
-1.0000 test t8 f1 char 20 20 latin1 latin1_swedish_ci char(20)
-1.0000 test t8 f2 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test t8 f3 date NULL NULL NULL NULL date
-NULL test t8 f4 int NULL NULL NULL NULL int(11)
-NULL test t9 f1 int NULL NULL NULL NULL int(11)
-1.0000 test t9 f2 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test t9 f3 int NULL NULL NULL NULL int(11)
-1.0000 test4 t6 f1 char 20 20 latin1 latin1_swedish_ci char(20)
-1.0000 test4 t6 f2 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test4 t6 f3 date NULL NULL NULL NULL date
-NULL test4 t6 f4 int NULL NULL NULL NULL int(11)
-1.0000 test4 t6 f5 char 25 25 latin1 latin1_swedish_ci char(25)
-NULL test4 t6 f6 int NULL NULL NULL NULL int(11)
-DROP DATABASE test1;
-DROP DATABASE test4;
-DROP TABLE test.t1;
-DROP TABLE test.t2;
-DROP TABLE test.t3;
-DROP TABLE test.t4;
-DROP TABLE test.t7;
-DROP TABLE test.t8;
-DROP TABLE test.t9;
-DROP TABLE test.t10;
-DROP TABLE test.t11;
diff --git a/mysql-test/suite/funcs_1/r/is_engines_ndb.result b/mysql-test/suite/funcs_1/r/is_engines_ndb.result
deleted file mode 100644
index 238609fc09e..00000000000
--- a/mysql-test/suite/funcs_1/r/is_engines_ndb.result
+++ /dev/null
@@ -1,8 +0,0 @@
-SELECT * FROM information_schema.engines
-WHERE ENGINE = 'ndbcluster';
-ENGINE ndbcluster
-SUPPORT YES
-COMMENT Clustered, fault-tolerant tables
-TRANSACTIONS YES
-XA NO
-SAVEPOINTS NO
diff --git a/mysql-test/suite/funcs_1/r/is_key_column_usage.result b/mysql-test/suite/funcs_1/r/is_key_column_usage.result
index a81452b7927..afd1fe15fed 100644
--- a/mysql-test/suite/funcs_1/r/is_key_column_usage.result
+++ b/mysql-test/suite/funcs_1/r/is_key_column_usage.result
@@ -106,6 +106,10 @@ def mysql PRIMARY def mysql procs_priv Db
def mysql PRIMARY def mysql procs_priv User
def mysql PRIMARY def mysql procs_priv Routine_name
def mysql PRIMARY def mysql procs_priv Routine_type
+def mysql PRIMARY def mysql proxies_priv Host
+def mysql PRIMARY def mysql proxies_priv User
+def mysql PRIMARY def mysql proxies_priv Proxied_host
+def mysql PRIMARY def mysql proxies_priv Proxied_user
def mysql PRIMARY def mysql servers Server_name
def mysql PRIMARY def mysql tables_priv Host
def mysql PRIMARY def mysql tables_priv Db
diff --git a/mysql-test/suite/funcs_1/r/is_statistics.result b/mysql-test/suite/funcs_1/r/is_statistics.result
index 873b328dc2d..de84590e2f7 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics.result
@@ -118,6 +118,11 @@ def mysql procs_priv mysql PRIMARY
def mysql procs_priv mysql PRIMARY
def mysql procs_priv mysql PRIMARY
def mysql procs_priv mysql Grantor
+def mysql proxies_priv mysql PRIMARY
+def mysql proxies_priv mysql PRIMARY
+def mysql proxies_priv mysql PRIMARY
+def mysql proxies_priv mysql PRIMARY
+def mysql proxies_priv mysql Grantor
def mysql servers mysql PRIMARY
def mysql tables_priv mysql PRIMARY
def mysql tables_priv mysql PRIMARY
diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
index a1fa0cac9f2..4c7d58f96f1 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
@@ -40,6 +40,11 @@ def mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
+def mysql proxies_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
+def mysql proxies_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql proxies_priv 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
+def mysql proxies_priv 0 mysql PRIMARY 3 Proxied_host A #CARD# NULL NULL BTREE
+def mysql proxies_priv 0 mysql PRIMARY 4 Proxied_user A #CARD# NULL NULL BTREE
def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
index ea28427d0f5..9137d70b88c 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
@@ -6,108 +6,118 @@ GRANT SELECT ON db_datadict.* TO testuser1@localhost;
SELECT * FROM information_schema.statistics
WHERE table_schema = 'mysql'
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
-def mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
-def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
-def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
-def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
-def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
-def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
-def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
-def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
-def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
-def mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
-def mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
-def mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
-def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
-def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
-def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
-def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
-def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
-def mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
-def mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
-def mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
-def mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-def mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
-def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
-def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
-def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
-def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
-def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
-def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
-def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
-def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
-def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
+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 INDEX_COMMENT
+def mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
+def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
+def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
+def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
+def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
+def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
+def mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
+def mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
+def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
+def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
+def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
+def mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
+def mysql proxies_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
+def mysql proxies_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql proxies_priv 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
+def mysql proxies_priv 0 mysql PRIMARY 3 Proxied_host A #CARD# NULL NULL BTREE
+def mysql proxies_priv 0 mysql PRIMARY 4 Proxied_user A #CARD# NULL NULL BTREE
+def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
+def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
+def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
+def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
+def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
+def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
+def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.statistics
WHERE table_schema = 'mysql'
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
-def mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
-def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
-def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
-def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
-def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
-def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
-def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
-def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
-def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
-def mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
-def mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
-def mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
-def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
-def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
-def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
-def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
-def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
-def mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
-def mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
-def mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
-def mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-def mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
-def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
-def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
-def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
-def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
-def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
-def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
-def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
-def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
-def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
-def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
-def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
-def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
-def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
+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 INDEX_COMMENT
+def mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
+def mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
+def mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
+def mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
+def mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
+def mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
+def mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
+def mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
+def mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
+def mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
+def mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
+def mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
+def mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
+def mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
+def mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
+def mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
+def mysql proxies_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
+def mysql proxies_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql proxies_priv 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
+def mysql proxies_priv 0 mysql PRIMARY 3 Proxied_host A #CARD# NULL NULL BTREE
+def mysql proxies_priv 0 mysql PRIMARY 4 Proxied_user A #CARD# NULL NULL BTREE
+def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
+def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
+def mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
+def mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
+def mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
+def mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
+def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
+def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
+def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
+def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
# Switch to connection default and close connection testuser1
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints.result b/mysql-test/suite/funcs_1/r/is_table_constraints.result
index 7f1c83a8ea5..559a1f1f9f5 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints.result
@@ -73,6 +73,7 @@ def mysql PRIMARY mysql ndb_binlog_index
def mysql PRIMARY mysql plugin
def mysql PRIMARY mysql proc
def mysql PRIMARY mysql procs_priv
+def mysql PRIMARY mysql proxies_priv
def mysql PRIMARY mysql servers
def mysql PRIMARY mysql tables_priv
def mysql PRIMARY mysql time_zone
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
index 8b7ac6994c1..bca333b6387 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
@@ -23,6 +23,7 @@ def mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY
def mysql PRIMARY mysql plugin PRIMARY KEY
def mysql PRIMARY mysql proc PRIMARY KEY
def mysql PRIMARY mysql procs_priv PRIMARY KEY
+def mysql PRIMARY mysql proxies_priv PRIMARY KEY
def mysql PRIMARY mysql servers PRIMARY KEY
def mysql PRIMARY mysql tables_priv PRIMARY KEY
def mysql PRIMARY mysql time_zone PRIMARY KEY
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
index e0ea412e83a..307357cdd2b 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
@@ -23,6 +23,7 @@ def mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY
def mysql PRIMARY mysql plugin PRIMARY KEY
def mysql PRIMARY mysql proc PRIMARY KEY
def mysql PRIMARY mysql procs_priv PRIMARY KEY
+def mysql PRIMARY mysql proxies_priv PRIMARY KEY
def mysql PRIMARY mysql servers PRIMARY KEY
def mysql PRIMARY mysql tables_priv PRIMARY KEY
def mysql PRIMARY mysql time_zone PRIMARY KEY
@@ -52,6 +53,7 @@ def mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY
def mysql PRIMARY mysql plugin PRIMARY KEY
def mysql PRIMARY mysql proc PRIMARY KEY
def mysql PRIMARY mysql procs_priv PRIMARY KEY
+def mysql PRIMARY mysql proxies_priv PRIMARY KEY
def mysql PRIMARY mysql servers PRIMARY KEY
def mysql PRIMARY mysql tables_priv PRIMARY KEY
def mysql PRIMARY mysql time_zone PRIMARY KEY
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql.result b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
index 19923b6609b..1d139d33693 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
@@ -336,6 +336,29 @@ user_comment Procedure privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
+TABLE_NAME proxies_priv
+TABLE_TYPE BASE TABLE
+ENGINE MyISAM
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_bin
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment User proxy privileges
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA mysql
TABLE_NAME servers
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
index 04ac6d8bbdd..a4a1bc6876c 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
@@ -336,6 +336,29 @@ user_comment Procedure privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
+TABLE_NAME proxies_priv
+TABLE_TYPE BASE TABLE
+ENGINE MyISAM
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_bin
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment User proxy privileges
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA mysql
TABLE_NAME servers
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
@@ -881,6 +904,29 @@ user_comment Procedure privileges
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA mysql
+TABLE_NAME proxies_priv
+TABLE_TYPE BASE TABLE
+ENGINE MyISAM
+VERSION 10
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8_bin
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+user_comment User proxy privileges
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA mysql
TABLE_NAME servers
TABLE_TYPE BASE TABLE
ENGINE MYISAM_OR_MARIA
diff --git a/mysql-test/suite/funcs_1/r/is_tables_ndb.result b/mysql-test/suite/funcs_1/r/is_tables_ndb.result
deleted file mode 100644
index fe737a676ad..00000000000
--- a/mysql-test/suite/funcs_1/r/is_tables_ndb.result
+++ /dev/null
@@ -1,167 +0,0 @@
-DROP DATABASE IF EXISTS test1;
-DROP DATABASE IF EXISTS test2;
-CREATE DATABASE test1;
-CREATE DATABASE test2;
-CREATE TABLE test1.t1 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
-CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
-CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
-SELECT *,
-LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
-LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
-AS "user_comment",
-'-----------------------------------------------------' AS "Separator"
-FROM information_schema.tables
-WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
-ORDER BY table_schema,table_name;
-TABLE_CATALOG def
-TABLE_SCHEMA test1
-TABLE_NAME t1
-TABLE_TYPE BASE TABLE
-ENGINE ndbcluster
-VERSION 10
-ROW_FORMAT Dynamic
-TABLE_ROWS #TBLR#
-AVG_ROW_LENGTH #ARL#
-DATA_LENGTH #DL#
-MAX_DATA_LENGTH #MDL#
-INDEX_LENGTH #IL#
-DATA_FREE #DF#
-AUTO_INCREMENT NULL
-CREATE_TIME #CRT#
-UPDATE_TIME #UT#
-CHECK_TIME #CT#
-TABLE_COLLATION latin1_swedish_ci
-CHECKSUM NULL
-CREATE_OPTIONS #CO#
-TABLE_COMMENT #TC#
-user_comment
-Separator -----------------------------------------------------
-TABLE_CATALOG def
-TABLE_SCHEMA test1
-TABLE_NAME t2
-TABLE_TYPE BASE TABLE
-ENGINE ndbcluster
-VERSION 10
-ROW_FORMAT Dynamic
-TABLE_ROWS #TBLR#
-AVG_ROW_LENGTH #ARL#
-DATA_LENGTH #DL#
-MAX_DATA_LENGTH #MDL#
-INDEX_LENGTH #IL#
-DATA_FREE #DF#
-AUTO_INCREMENT NULL
-CREATE_TIME #CRT#
-UPDATE_TIME #UT#
-CHECK_TIME #CT#
-TABLE_COLLATION latin1_swedish_ci
-CHECKSUM NULL
-CREATE_OPTIONS #CO#
-TABLE_COMMENT #TC#
-user_comment
-Separator -----------------------------------------------------
-TABLE_CATALOG def
-TABLE_SCHEMA test2
-TABLE_NAME t1
-TABLE_TYPE BASE TABLE
-ENGINE ndbcluster
-VERSION 10
-ROW_FORMAT Dynamic
-TABLE_ROWS #TBLR#
-AVG_ROW_LENGTH #ARL#
-DATA_LENGTH #DL#
-MAX_DATA_LENGTH #MDL#
-INDEX_LENGTH #IL#
-DATA_FREE #DF#
-AUTO_INCREMENT NULL
-CREATE_TIME #CRT#
-UPDATE_TIME #UT#
-CHECK_TIME #CT#
-TABLE_COLLATION latin1_swedish_ci
-CHECKSUM NULL
-CREATE_OPTIONS #CO#
-TABLE_COMMENT #TC#
-user_comment
-Separator -----------------------------------------------------
-SHOW TABLES FROM test1;
-Tables_in_test1
-t1
-t2
-SHOW TABLES FROM test2;
-Tables_in_test2
-t1
-DROP USER testuser1@localhost;
-CREATE USER testuser1@localhost;
-GRANT SELECT ON test1.* TO testuser1@localhost;
-# Establish connection testuser1 (user=testuser1)
-SELECT *,
-LEFT( table_comment,
-IF(INSTR(table_comment,'InnoDB free') = 0
-AND INSTR(table_comment,'number_of_replicas') = 0,
-LENGTH(table_comment),
-INSTR(table_comment,'InnoDB free')
-+ INSTR(table_comment,'number_of_replicas') - 1))
-AS "user_comment",
-'-----------------------------------------------------' AS "Separator"
-FROM information_schema.tables
-WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
-ORDER BY table_schema,table_name;
-TABLE_CATALOG def
-TABLE_SCHEMA test1
-TABLE_NAME t1
-TABLE_TYPE BASE TABLE
-ENGINE ndbcluster
-VERSION 10
-ROW_FORMAT Dynamic
-TABLE_ROWS #TBLR#
-AVG_ROW_LENGTH #ARL#
-DATA_LENGTH #DL#
-MAX_DATA_LENGTH #MDL#
-INDEX_LENGTH #IL#
-DATA_FREE #DF#
-AUTO_INCREMENT NULL
-CREATE_TIME #CRT#
-UPDATE_TIME #UT#
-CHECK_TIME #CT#
-TABLE_COLLATION latin1_swedish_ci
-CHECKSUM NULL
-CREATE_OPTIONS #CO#
-TABLE_COMMENT #TC#
-user_comment
-Separator -----------------------------------------------------
-TABLE_CATALOG def
-TABLE_SCHEMA test1
-TABLE_NAME t2
-TABLE_TYPE BASE TABLE
-ENGINE ndbcluster
-VERSION 10
-ROW_FORMAT Dynamic
-TABLE_ROWS #TBLR#
-AVG_ROW_LENGTH #ARL#
-DATA_LENGTH #DL#
-MAX_DATA_LENGTH #MDL#
-INDEX_LENGTH #IL#
-DATA_FREE #DF#
-AUTO_INCREMENT NULL
-CREATE_TIME #CRT#
-UPDATE_TIME #UT#
-CHECK_TIME #CT#
-TABLE_COLLATION latin1_swedish_ci
-CHECKSUM NULL
-CREATE_OPTIONS #CO#
-TABLE_COMMENT #TC#
-user_comment
-Separator -----------------------------------------------------
-SHOW TABLES FROM test1;
-Tables_in_test1
-t1
-t2
-SHOW TABLES FROM test2;
-ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'test2'
-# Switch to connection default and close connection testuser1
-DROP USER testuser1@localhost;
-DROP DATABASE test1;
-DROP DATABASE test2;
diff --git a/mysql-test/suite/funcs_1/r/is_user_privileges.result b/mysql-test/suite/funcs_1/r/is_user_privileges.result
index bfcaf1a9de7..b269da53a3d 100644
--- a/mysql-test/suite/funcs_1/r/is_user_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_user_privileges.result
@@ -69,46 +69,436 @@ GRANT UPDATE ON *.* TO 'testuser2'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def USAGE NO
-'testuser2'@'localhost' def INSERT NO
-'testuser2'@'localhost' def UPDATE NO
-'testuser3'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE INSERT
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE UPDATE
+IS_GRANTABLE NO
+GRANTEE 'testuser3'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin auth_string
-localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
+Host localhost
+User testuser1
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser2
+Password
+Select_priv N
+Insert_priv Y
+Update_priv Y
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser3
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
#
# Add GRANT OPTION db_datadict.* to testuser1;
GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def USAGE NO
-'testuser2'@'localhost' def INSERT NO
-'testuser2'@'localhost' def UPDATE NO
-'testuser3'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE INSERT
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE UPDATE
+IS_GRANTABLE NO
+GRANTEE 'testuser3'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
+Host localhost
+User testuser1
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser2
+Password
+Select_priv N
+Insert_priv Y
+Update_priv Y
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser3
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
# Establish connection testuser1 (user=testuser1)
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
+Host localhost
+User testuser1
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser2
+Password
+Select_priv N
+Insert_priv Y
+Update_priv Y
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser3
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -123,46 +513,436 @@ GRANT SELECT ON *.* TO 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def SELECT NO
-'testuser2'@'localhost' def INSERT NO
-'testuser2'@'localhost' def UPDATE NO
-'testuser3'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE SELECT
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE INSERT
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE UPDATE
+IS_GRANTABLE NO
+GRANTEE 'testuser3'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost testuser1 Y N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
+Host localhost
+User testuser1
+Password
+Select_priv Y
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser2
+Password
+Select_priv N
+Insert_priv Y
+Update_priv Y
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser3
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
#
# Here <SELECT YES> is shown correctly for testuser1;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def SELECT YES
-'testuser2'@'localhost' def INSERT NO
-'testuser2'@'localhost' def UPDATE NO
-'testuser3'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE SELECT
+IS_GRANTABLE YES
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE INSERT
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE UPDATE
+IS_GRANTABLE NO
+GRANTEE 'testuser3'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost testuser1 Y N N N N N N N N N Y N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
+Host localhost
+User testuser1
+Password
+Select_priv Y
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv Y
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser2
+Password
+Select_priv N
+Insert_priv Y
+Update_priv Y
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser3
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
# Switch to connection testuser1
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def SELECT YES
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE SELECT
+IS_GRANTABLE YES
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost testuser1 Y N N N N N N N N N Y N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
+Host localhost
+User testuser1
+Password
+Select_priv Y
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv Y
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser2
+Password
+Select_priv N
+Insert_priv Y
+Update_priv Y
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser3
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
SHOW GRANTS;
Grants for testuser1@localhost
GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION
@@ -172,9 +952,14 @@ GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser2'@'localhost' def INSERT NO
-'testuser2'@'localhost' def UPDATE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE INSERT
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE UPDATE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 'user'
@@ -185,8 +970,10 @@ GRANT INSERT, UPDATE ON *.* TO 'testuser2'@'localhost'
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser3'@'localhost' def USAGE NO
+GRANTEE 'testuser3'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser3'@'localhost' for table 'user'
@@ -200,23 +987,158 @@ REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def USAGE NO
-'testuser2'@'localhost' def INSERT NO
-'testuser2'@'localhost' def UPDATE NO
-'testuser3'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE INSERT
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE UPDATE
+IS_GRANTABLE NO
+GRANTEE 'testuser3'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
+Host localhost
+User testuser1
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser2
+Password
+Select_priv N
+Insert_priv Y
+Update_priv Y
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser3
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
# Switch to connection testuser1
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
@@ -228,8 +1150,10 @@ ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
@@ -246,29 +1170,286 @@ GRANT SELECT ON mysql.user TO 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def USAGE NO
-'testuser2'@'localhost' def INSERT NO
-'testuser2'@'localhost' def UPDATE NO
-'testuser3'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE INSERT
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE UPDATE
+IS_GRANTABLE NO
+GRANTEE 'testuser3'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
+Host localhost
+User testuser1
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser2
+Password
+Select_priv N
+Insert_priv Y
+Update_priv Y
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser3
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
# Switch to connection testuser1
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
+Host localhost
+User testuser1
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser2
+Password
+Select_priv N
+Insert_priv Y
+Update_priv Y
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser3
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -280,14 +1461,138 @@ USE db_datadict;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
+Host localhost
+User testuser1
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser2
+Password
+Select_priv N
+Insert_priv Y
+Update_priv Y
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser3
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
SHOW GRANTS;
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -302,23 +1607,158 @@ REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def USAGE NO
-'testuser2'@'localhost' def INSERT NO
-'testuser2'@'localhost' def UPDATE NO
-'testuser3'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE INSERT
+IS_GRANTABLE NO
+GRANTEE 'testuser2'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE UPDATE
+IS_GRANTABLE NO
+GRANTEE 'testuser3'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
-localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
+Host localhost
+User testuser1
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser2
+Password
+Select_priv N
+Insert_priv Y
+Update_priv Y
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
+Host localhost
+User testuser3
+Password
+Select_priv N
+Insert_priv N
+Update_priv N
+Delete_priv N
+Create_priv N
+Drop_priv N
+Reload_priv N
+Shutdown_priv N
+Process_priv N
+File_priv N
+Grant_priv N
+References_priv N
+Index_priv N
+Alter_priv N
+Show_db_priv N
+Super_priv N
+Create_tmp_table_priv N
+Lock_tables_priv N
+Execute_priv N
+Repl_slave_priv N
+Repl_client_priv N
+Create_view_priv N
+Show_view_priv N
+Create_routine_priv N
+Alter_routine_priv N
+Create_user_priv N
+Event_priv N
+Trigger_priv N
+Create_tablespace_priv N
+ssl_type
+ssl_cipher
+x509_issuer
+x509_subject
+max_questions 0
+max_updates 0
+max_connections 0
+max_user_connections 0
+plugin
+authentication_string NULL
# Switch to connection testuser1
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
@@ -341,31 +1781,36 @@ DROP DATABASE IF EXISTS db_datadict;
########################################################################################
SELECT * FROM information_schema.user_privileges
WHERE grantee = '''testuser1''@''localhost''';
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: There is no such grant defined for user 'testuser1' on host 'localhost'
DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee = '''testuser1''@''localhost''';
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def USAGE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE USAGE
+IS_GRANTABLE NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee = '''testuser1''@''localhost''';
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'testuser1'@'localhost' def SELECT NO
-'testuser1'@'localhost' def FILE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE SELECT
+IS_GRANTABLE NO
+GRANTEE 'testuser1'@'localhost'
+TABLE_CATALOG def
+PRIVILEGE_TYPE FILE
+IS_GRANTABLE NO
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost'
DROP USER 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee = '''testuser1''@''localhost''';
-GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
SHOW GRANTS FOR 'testuser1'@'localhost';
ERROR 42000: There is no such grant defined for user 'testuser1' on host 'localhost'
########################################################################
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 096cbd1261e..f08165b21f8 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
@@ -111,10 +111,10 @@ Ensure that root always has the GRANT CREATE ROUTINE privilege.
--------------------------------------------------------------------------------
grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
+DROP PROCEDURE IF EXISTS db_storedproc_1.sp3;
+DROP FUNCTION IF EXISTS db_storedproc_1.fn1;
user_1@localhost db_storedproc_1
-DROP PROCEDURE IF EXISTS sp3;
-DROP FUNCTION IF EXISTS fn1;
CREATE PROCEDURE sp3(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
@@ -129,8 +129,6 @@ root@localhost db_storedproc_1
drop user 'user_1'@'localhost';
DROP PROCEDURE sp3;
DROP FUNCTION fn1;
-Warnings:
-Warning 1403 There is no such grant defined for user 'user_1' on host 'localhost' on routine 'fn1'
Testcase 3.1.6.4:
-----------------
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 0b04e72c4b1..9b2e9e27b4a 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03e.result
@@ -574,6 +574,7 @@ root@localhost
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
drop trigger trg1_1;
use priv_db;
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 03505af95c5..3f303ef607f 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_08.result
@@ -354,8 +354,6 @@ B Test 3.5.8.5-case 00191 0000000016 C=one
C Test 3.5.8.5-case 00200 0000000001 C=one
Insert into tb3 (f120, f122, f136)
values ('d', 'Test 3.5.8.5-case', 152);
-Warnings:
-Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
@@ -365,8 +363,6 @@ B Test 3.5.8.5-case 00191 0000000016 1*0000099999
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
Insert into tb3 (f120, f122, f136, f144)
values ('e', 'Test 3.5.8.5-case', 200, 8);
-Warnings:
-Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
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 096cbd1261e..f08165b21f8 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
@@ -111,10 +111,10 @@ Ensure that root always has the GRANT CREATE ROUTINE privilege.
--------------------------------------------------------------------------------
grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
+DROP PROCEDURE IF EXISTS db_storedproc_1.sp3;
+DROP FUNCTION IF EXISTS db_storedproc_1.fn1;
user_1@localhost db_storedproc_1
-DROP PROCEDURE IF EXISTS sp3;
-DROP FUNCTION IF EXISTS fn1;
CREATE PROCEDURE sp3(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
@@ -129,8 +129,6 @@ root@localhost db_storedproc_1
drop user 'user_1'@'localhost';
DROP PROCEDURE sp3;
DROP FUNCTION fn1;
-Warnings:
-Warning 1403 There is no such grant defined for user 'user_1' on host 'localhost' on routine 'fn1'
Testcase 3.1.6.4:
-----------------
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 dd8b0063339..ea421e85b86 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
@@ -574,6 +574,7 @@ root@localhost
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
drop trigger trg1_1;
use priv_db;
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 03505af95c5..3f303ef607f 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_08.result
@@ -354,8 +354,6 @@ B Test 3.5.8.5-case 00191 0000000016 C=one
C Test 3.5.8.5-case 00200 0000000001 C=one
Insert into tb3 (f120, f122, f136)
values ('d', 'Test 3.5.8.5-case', 152);
-Warnings:
-Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
@@ -365,8 +363,6 @@ B Test 3.5.8.5-case 00191 0000000016 1*0000099999
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
Insert into tb3 (f120, f122, f136, f144)
values ('e', 'Test 3.5.8.5-case', 200, 8);
-Warnings:
-Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
diff --git a/mysql-test/suite/funcs_1/r/myisam_views.result b/mysql-test/suite/funcs_1/r/myisam_views-big.result
index ca4dba9f337..ca4dba9f337 100644
--- a/mysql-test/suite/funcs_1/r/myisam_views.result
+++ b/mysql-test/suite/funcs_1/r/myisam_views-big.result
diff --git a/mysql-test/suite/funcs_1/r/ndb_bitdata.result b/mysql-test/suite/funcs_1/r/ndb_bitdata.result
deleted file mode 100644
index 917157fcdae..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_bitdata.result
+++ /dev/null
@@ -1,3 +0,0 @@
-
-NOT YET IMPLEMENTED: bitdata tests
---------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/ndb_cursors.result b/mysql-test/suite/funcs_1/r/ndb_cursors.result
deleted file mode 100644
index 9f20e51204b..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_cursors.result
+++ /dev/null
@@ -1,3 +0,0 @@
-
-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
deleted file mode 100644
index e788dfd9fc1..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_func_view.result
+++ /dev/null
@@ -1,5294 +0,0 @@
-DROP TABLE IF EXISTS t1_selects, t1_modes, t1_values;
-DROP VIEW IF EXISTS v1;
-CREATE TABLE t1_values
-(
-id BIGINT AUTO_INCREMENT,
-select_id BIGINT,
-PRIMARY KEY(id)
-) ENGINE = <engine_to_be_tested>;
-ALTER TABLE t1_values ADD my_char_30 CHAR(30);
-ALTER TABLE t1_values ADD my_varchar_1000 VARCHAR(1000);
-ALTER TABLE t1_values ADD my_binary_30 BINARY(30);
-ALTER TABLE t1_values ADD my_varbinary_1000 VARBINARY(1000);
-ALTER TABLE t1_values ADD my_datetime DATETIME;
-ALTER TABLE t1_values ADD my_date DATE;
-ALTER TABLE t1_values ADD ts_dummy TIMESTAMP;
-ALTER TABLE t1_values ADD my_timestamp TIMESTAMP;
-ALTER TABLE t1_values ADD my_time TIME;
-ALTER TABLE t1_values ADD my_year YEAR;
-ALTER TABLE t1_values ADD my_bigint BIGINT;
-ALTER TABLE t1_values ADD my_double DOUBLE;
-ALTER TABLE t1_values ADD my_decimal DECIMAL(64,30);
-SET sql_mode = 'traditional';
-INSERT INTO t1_values SET id = 0;
-INSERT INTO t1_values SET
-my_char_30 = '',
-my_varchar_1000 = '',
-my_binary_30 = '',
-my_varbinary_1000 = '',
-my_datetime = '0001-01-01 00:00:00',
-my_date = '0001-01-01',
-my_timestamp = '1970-01-01 03:00:01',
-my_time = '-838:59:59',
-my_year = '1901',
-my_bigint = -9223372036854775808,
-my_decimal = -9999999999999999999999999999999999.999999999999999999999999999999 ,
-my_double = -1.7976931348623E+308;
-INSERT INTO t1_values SET
-my_char_30 = '<--------30 characters------->',
-my_varchar_1000 = CONCAT('<---------1000 characters',
-RPAD('',965,'-'),'--------->'),
-my_binary_30 = '<--------30 characters------->',
-my_varbinary_1000 = CONCAT('<---------1000 characters',
-RPAD('',965,'-'),'--------->'),
-my_datetime = '9999-12-31 23:59:59',
-my_date = '9999-12-31',
-my_timestamp = '2038-01-01 02:59:59',
-my_time = '838:59:59',
-my_year = 2155,
-my_bigint = 9223372036854775807,
-my_decimal = +9999999999999999999999999999999999.999999999999999999999999999999 ,
-my_double = 1.7976931348623E+308;
-INSERT INTO t1_values SET
-my_char_30 = ' ---äÖüß@µ*$-- ',
-my_varchar_1000 = ' ---äÖüß@µ*$-- ',
-my_binary_30 = ' ---äÖüß@µ*$-- ',
-my_varbinary_1000 = ' ---äÖüß@µ*$-- ',
-my_datetime = '2004-02-29 23:59:59',
-my_date = '2004-02-29',
-my_timestamp = '2004-02-29 23:59:59',
-my_time = '13:00:00',
-my_year = 2000,
-my_bigint = 0,
-my_decimal = 0.0,
-my_double = 0;
-INSERT INTO t1_values SET
-my_char_30 = '-1',
-my_varchar_1000 = '-1',
-my_binary_30 = '-1',
-my_varbinary_1000 = '-1',
-my_datetime = '2005-06-28 10:00:00',
-my_date = '2005-06-28',
-my_timestamp = '2005-06-28 10:00:00',
-my_time = '10:00:00',
-my_year = 2005,
-my_bigint = -1,
-my_decimal = -1.000000000000000000000000000000,
-my_double = -0.1E+1;
-PREPARE ins_sel_with_result FROM "INSERT INTO t1_selects SET my_select = @my_select,
-disable_result = 'No'" ;
-PREPARE ins_sel_no_result FROM "INSERT INTO t1_selects SET my_select = @my_select,
-disable_result = 'Yes'" ;
-SET sql_mode = 'traditional';
-SET @my_select = 'SELECT sqrt(my_bigint), my_bigint, id FROM t1_values';
-INSERT INTO t1_values SET select_id = @select_id,
-my_bigint = 4;
-INSERT INTO t1_values SET select_id = @select_id,
-my_bigint = -25;
-##### 1.1.1. CAST --> BINARY
-##### 1.1.2. CAST --> CHAR
-##### 1.1.3. CAST --> DATE
-INSERT INTO t1_values SET select_id = @select_id,
-my_char_30 = '2005-06-27';
-INSERT INTO t1_values SET select_id = @select_id,
-my_varchar_1000 = '2005-06-27';
-INSERT INTO t1_values SET select_id = @select_id,
-my_binary_30 = '2005-06-27';
-INSERT INTO t1_values SET select_id = @select_id,
-my_varbinary_1000 = '2005-06-27';
-INSERT INTO t1_values SET select_id = @select_id,
-my_bigint = 20050627;
-INSERT INTO t1_values SET select_id = @select_id,
-my_double = +20.050627E+6;
-##### 1.1.4. CAST --> DATETIME
-INSERT INTO t1_values SET select_id = @select_id,
-my_char_30 = '2005-06-27 17:58';
-INSERT INTO t1_values SET select_id = @select_id,
-my_varchar_1000 = '2005-06-27 17:58';
-INSERT INTO t1_values SET select_id = @select_id,
-my_binary_30 = '2005-06-27 17:58';
-INSERT INTO t1_values SET select_id = @select_id,
-my_varbinary_1000 = '2005-06-27 17:58';
-INSERT INTO t1_values SET select_id = @select_id,
-my_bigint = 200506271758;
-INSERT INTO t1_values SET select_id = @select_id,
-my_double = +0.0200506271758E+13;
-##### 1.1.5. CAST --> TIME
-INSERT INTO t1_values SET select_id = @select_id,
-my_char_30 = '1 17:58';
-INSERT INTO t1_values SET select_id = @select_id,
-my_varchar_1000 = '1 17:58';
-INSERT INTO t1_values SET select_id = @select_id,
-my_binary_30 = '1 17:58';
-INSERT INTO t1_values SET select_id = @select_id,
-my_varbinary_1000 = '1 17:58';
-INSERT INTO t1_values SET select_id = @select_id,
-my_bigint = 1758;
-INSERT INTO t1_values SET select_id = @select_id,
-my_double = +1.758E+3;
-##### 1.1.6. CAST --> DECIMAL
-INSERT INTO t1_values SET select_id = @select_id,
-my_char_30 = '-3333.3333';
-INSERT INTO t1_values SET select_id = @select_id,
-my_varchar_1000 = '-3333.3333';
-INSERT INTO t1_values SET select_id = @select_id,
-my_binary_30 = '-3333.3333';
-INSERT INTO t1_values SET select_id = @select_id,
-my_varbinary_1000 = '-3333.3333';
-INSERT INTO t1_values SET select_id = @select_id,
-my_double = -0.33333333E+4;
-##### 1.1.7. CAST --> SIGNED INTEGER
-
-"Attention: CAST --> SIGNED INTEGER
- Bug#5913 Traditional mode: BIGINT range not correctly delimited
- Status: To be fixed later"
---------------------------------------------------------------------------------
-##### 1.1.8. CAST --> UNSIGNED INTEGER
-
-"Attention: CAST --> UNSIGNED INTEGER
- The file with expected results suffers from Bug 5913"
---------------------------------------------------------------------------------
-
-some statements disabled because of
-Bug#5913 Traditional mode: BIGINT range not correctly delimited
---------------------------------------------------------------------------------
-SET @my_select = 'SELECT CONVERT(my_char_30 USING utf8),
-my_char_30, id FROM t1_values';
-SET @my_select = 'SELECT CONVERT(my_varchar_1000 USING utf8),
-my_varchar_1000, id FROM t1_values';
-SET @my_select = 'SELECT CONVERT(my_binary_30 USING utf8),
-my_binary_30, id FROM t1_values';
-SET @my_select = 'SELECT CONVERT(my_varbinary_1000 USING utf8),
-my_varbinary_1000, id FROM t1_values';
-SET @my_select = 'SELECT CONVERT(my_char_30 USING koi8r),
-my_char_30, id FROM t1_values';
-SET @my_select = 'SELECT CONVERT(my_varchar_1000 USING koi8r),
-my_varchar_1000, id FROM t1_values';
-SET @my_select = 'SELECT CONVERT(my_binary_30 USING koi8r),
-my_binary_30, id FROM t1_values';
-SET @my_select = 'SELECT CONVERT(my_varbinary_1000 USING koi8r),
-my_varbinary_1000, id FROM t1_values';
-SET @my_select = 'SELECT BIT_LENGTH(my_char_30),
-my_char_30, id FROM t1_values';
-SET @my_select = 'SELECT BIT_LENGTH(my_varchar_1000),
-my_varchar_1000, id FROM t1_values';
-SET @my_select = 'SELECT BIT_LENGTH(my_binary_30),
-my_binary_30, id FROM t1_values';
-SET @my_select = 'SELECT BIT_LENGTH(my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values';
-SET @my_select = 'SELECT INSTR(my_char_30, ''char''),
-my_char_30, id FROM t1_values';
-SET @my_select = 'SELECT LCASE(my_varchar_1000),
-my_varchar_1000, id FROM t1_values';
-SET @my_select =
-'SELECT LEFT(my_char_30, 2), my_char_30, id FROM t1_values';
-SET @my_select =
-'SELECT LEFT(my_varchar_1000, 2), my_varchar_1000, id FROM t1_values';
-SET @my_select =
-'SELECT LEFT(my_binary_30, 2), my_binary_30, id FROM t1_values';
-SET @my_select =
-'SELECT LEFT(my_varbinary_1000, 2), my_varbinary_1000, id FROM t1_values';
-SET @my_select =
-'SELECT LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', my_bigint), my_bigint, id FROM t1_values';
-SET @my_select =
-'SELECT LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', my_decimal), my_decimal, id FROM t1_values';
-SET @my_select =
-'SELECT LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', my_double), my_double, id FROM t1_values';
-SET @my_select = 'SELECT LENGTH(my_char_30),
-my_char_30, id FROM t1_values';
-SET @my_select = 'SELECT LENGTH(my_varchar_1000),
-my_varchar_1000, id FROM t1_values';
-SET @my_select = 'SELECT LENGTH(my_binary_30),
-my_binary_30, id FROM t1_values';
-SET @my_select = 'SELECT LENGTH(my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values';
-SET @my_select =
-'SELECT LOAD_FILE(''<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt'')
- AS my_col,
- id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(''char'', my_char_30),
-my_char_30, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(''char'', my_varchar_1000),
-my_varchar_1000, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(''char'', my_binary_30),
-my_binary_30, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(''char'', my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_char_30, my_char_30 ),
-my_char_30, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_char_30, my_varchar_1000 ),
-my_char_30, my_varchar_1000 id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_char_30, my_binary_30 ),
-my_char_30, my_binary_30 id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_char_30, my_varbinary_1000 ),
-my_char_30, my_varbinary_1000 id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_varchar_1000, my_varchar_1000 ),
-my_varchar_1000, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_varchar_1000, my_char_30 ),
-my_varchar_1000, my_char_30 id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_varchar_1000, my_binary_30 ),
-my_varchar_1000, my_binary_30 id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_varchar_1000, my_varbinary_1000 ),
-my_varchar_1000, my_varbinary_1000 id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_binary_30, my_binary_30 ),
-my_binary_30, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_binary_30, my_char_30 ),
-my_binary_30, my_char_30 id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_binary_30, my_varchar_1000 ),
-my_binary_30, my_varchar_1000 id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_binary_30, my_varbinary_1000 ),
-my_binary_30, my_varbinary_1000 id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_varbinary_1000, my_varbinary_1000 ),
-my_varbinary_1000, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_varbinary_1000, my_char_30 ),
-my_varbinary_1000, my_char_30 id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_varbinary_1000, my_varchar_1000 ),
-my_varbinary_1000, my_varchar_1000 id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(my_varbinary_1000, my_binary_30 ),
-my_varbinary_1000, my_binary_30 id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(''-'', my_char_30, 3),
-my_char_30, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(''-'', my_varchar_1000, 3),
-my_varchar_1000, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(''-'', my_binary_30, 3),
-my_binary_30, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(''-'', my_varbinary_1000, 3),
-my_varbinary_1000, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(''-'', '' - -ABC'', my_bigint),
-my_bigint, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(''-'', '' - -ABC'', my_double),
-my_double, id FROM t1_values';
-SET @my_select = 'SELECT LOCATE(''-'', '' - -ABC'', my_decimal),
-my_decimal, id FROM t1_values';
-SET @my_select = 'SELECT LOWER(my_char_30),
-my_char_30, id FROM t1_values';
-SET @my_select = 'SELECT LOWER(my_varchar_1000),
-my_varchar_1000, id FROM t1_values';
-SET @my_select = 'SELECT LOWER(my_binary_30),
-my_binary_30, id FROM t1_values';
-SET @my_select = 'SELECT LOWER(my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values';
-SET @my_select = 'SELECT LTRIM(my_char_30),
-my_char_30, id FROM t1_values';
-SET @my_select = 'SELECT LTRIM(my_varchar_1000),
-my_varchar_1000, id FROM t1_values';
-SET @my_select = 'SELECT LTRIM(my_binary_30),
-my_binary_30, id FROM t1_values';
-SET @my_select = 'SELECT LTRIM(my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values';
-SET @my_select =
-'SELECT CONCAT(''A'',my_char_30), my_char_30, id FROM t1_values';
-SET @my_select = 'SELECT my_char_30, id FROM t1_values';
-INSERT INTO t1_values SET select_id = @select_id,
-my_char_30 = 'Viana do Castelo';
-SET sql_mode = '';
-
-"# The basic preparations end and the main test starts here"
---------------------------------------------------------------------------------
-CREATE VIEW v1 AS SELECT my_char_30, id FROM t1_values;
-SELECT my_char_30, id FROM t1_values
-WHERE select_id = 193 OR select_id IS NULL order by id;
-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 `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 = 193 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CONCAT('A',my_char_30), my_char_30, id FROM t1_values;
-SELECT CONCAT('A',my_char_30), my_char_30, id FROM t1_values
-WHERE select_id = 192 OR select_id IS NULL order by id;
-CONCAT('A',my_char_30) my_char_30 id
-NULL NULL 1
-A 2
-A<--------30 characters-------> <--------30 characters-------> 3
-A ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-A-1 -1 5
-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 concat('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 = 192 OR select_id IS NULL) order by id;
-CONCAT('A',my_char_30) my_char_30 id
-NULL NULL 1
-A 2
-A<--------30 characters-------> <--------30 characters-------> 3
-A ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
-A-1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LTRIM(my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values;
-SELECT LTRIM(my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 191 OR select_id IS NULL order by id;
-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 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 = 191 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LTRIM(my_binary_30),
-my_binary_30, id FROM t1_values;
-SELECT LTRIM(my_binary_30),
-my_binary_30, id FROM t1_values
-WHERE select_id = 190 OR select_id IS NULL order by id;
-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 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 = 190 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LTRIM(my_varchar_1000),
-my_varchar_1000, id FROM t1_values;
-SELECT LTRIM(my_varchar_1000),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 189 OR select_id IS NULL order by id;
-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 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 = 189 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LTRIM(my_char_30),
-my_char_30, id FROM t1_values;
-SELECT LTRIM(my_char_30),
-my_char_30, id FROM t1_values
-WHERE select_id = 188 OR select_id IS NULL order by id;
-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 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 = 188 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOWER(my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values;
-SELECT LOWER(my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 187 OR select_id IS NULL order by id;
-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 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 = 187 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOWER(my_binary_30),
-my_binary_30, id FROM t1_values;
-SELECT LOWER(my_binary_30),
-my_binary_30, id FROM t1_values
-WHERE select_id = 186 OR select_id IS NULL order by id;
-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 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 = 186 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOWER(my_varchar_1000),
-my_varchar_1000, id FROM t1_values;
-SELECT LOWER(my_varchar_1000),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 185 OR select_id IS NULL order by id;
-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 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 = 185 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOWER(my_char_30),
-my_char_30, id FROM t1_values;
-SELECT LOWER(my_char_30),
-my_char_30, id FROM t1_values
-WHERE select_id = 184 OR select_id IS NULL order by id;
-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 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 = 184 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE('-', ' - -ABC', my_decimal),
-my_decimal, id FROM t1_values;
-SELECT LOCATE('-', ' - -ABC', my_decimal),
-my_decimal, id FROM t1_values
-WHERE select_id = 183 OR select_id IS NULL order by id;
-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 locate('-',' - -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 = 183 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE('-', ' - -ABC', my_double),
-my_double, id FROM t1_values;
-SELECT LOCATE('-', ' - -ABC', my_double),
-my_double, id FROM t1_values
-WHERE select_id = 182 OR select_id IS NULL order by id;
-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 locate('-',' - -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 = 182 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE('-', ' - -ABC', my_bigint),
-my_bigint, id FROM t1_values;
-SELECT LOCATE('-', ' - -ABC', my_bigint),
-my_bigint, id FROM t1_values
-WHERE select_id = 181 OR select_id IS NULL order by id;
-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 locate('-',' - -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 = 181 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE('-', my_varbinary_1000, 3),
-my_varbinary_1000, id FROM t1_values;
-SELECT LOCATE('-', my_varbinary_1000, 3),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 180 OR select_id IS NULL order by id;
-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 locate('-',`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 = 180 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE('-', my_binary_30, 3),
-my_binary_30, id FROM t1_values;
-SELECT LOCATE('-', my_binary_30, 3),
-my_binary_30, id FROM t1_values
-WHERE select_id = 179 OR select_id IS NULL order by id;
-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 locate('-',`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 = 179 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE('-', my_varchar_1000, 3),
-my_varchar_1000, id FROM t1_values;
-SELECT LOCATE('-', my_varchar_1000, 3),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 178 OR select_id IS NULL order by id;
-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 locate('-',`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 = 178 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE('-', my_char_30, 3),
-my_char_30, id FROM t1_values;
-SELECT LOCATE('-', my_char_30, 3),
-my_char_30, id FROM t1_values
-WHERE select_id = 177 OR select_id IS NULL order by id;
-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 locate('-',`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 = 177 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_varbinary_1000, my_binary_30 ),
-my_varbinary_1000, my_binary_30 id FROM t1_values;
-SELECT LOCATE(my_varbinary_1000, my_binary_30 ),
-my_varbinary_1000, 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 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 = 176 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_varbinary_1000, my_varchar_1000 ),
-my_varbinary_1000, my_varchar_1000 id FROM t1_values;
-SELECT LOCATE(my_varbinary_1000, my_varchar_1000 ),
-my_varbinary_1000, 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 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 = 175 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_varbinary_1000, my_char_30 ),
-my_varbinary_1000, my_char_30 id FROM t1_values;
-SELECT LOCATE(my_varbinary_1000, my_char_30 ),
-my_varbinary_1000, 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 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 = 174 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_varbinary_1000, my_varbinary_1000 ),
-my_varbinary_1000, id FROM t1_values;
-SELECT LOCATE(my_varbinary_1000, my_varbinary_1000 ),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 173 OR select_id IS NULL order by id;
-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 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 = 173 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_binary_30, my_varbinary_1000 ),
-my_binary_30, my_varbinary_1000 id FROM t1_values;
-SELECT LOCATE(my_binary_30, my_varbinary_1000 ),
-my_binary_30, my_varbinary_1000 id FROM t1_values
-WHERE select_id = 172 OR select_id IS NULL order by id;
-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 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 = 172 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_binary_30, my_varchar_1000 ),
-my_binary_30, my_varchar_1000 id FROM t1_values;
-SELECT LOCATE(my_binary_30, my_varchar_1000 ),
-my_binary_30, my_varchar_1000 id FROM t1_values
-WHERE select_id = 171 OR select_id IS NULL order by id;
-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 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 = 171 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_binary_30, my_char_30 ),
-my_binary_30, my_char_30 id FROM t1_values;
-SELECT LOCATE(my_binary_30, my_char_30 ),
-my_binary_30, my_char_30 id FROM t1_values
-WHERE select_id = 170 OR select_id IS NULL order by id;
-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 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 = 170 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_binary_30, my_binary_30 ),
-my_binary_30, id FROM t1_values;
-SELECT LOCATE(my_binary_30, my_binary_30 ),
-my_binary_30, id FROM t1_values
-WHERE select_id = 169 OR select_id IS NULL order by id;
-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 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 = 169 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_varchar_1000, my_varbinary_1000 ),
-my_varchar_1000, my_varbinary_1000 id FROM t1_values;
-SELECT LOCATE(my_varchar_1000, my_varbinary_1000 ),
-my_varchar_1000, my_varbinary_1000 id FROM t1_values
-WHERE select_id = 168 OR select_id IS NULL order by id;
-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 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 = 168 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_varchar_1000, my_binary_30 ),
-my_varchar_1000, my_binary_30 id FROM t1_values;
-SELECT LOCATE(my_varchar_1000, my_binary_30 ),
-my_varchar_1000, my_binary_30 id FROM t1_values
-WHERE select_id = 167 OR select_id IS NULL order by id;
-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 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 = 167 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_varchar_1000, my_char_30 ),
-my_varchar_1000, my_char_30 id FROM t1_values;
-SELECT LOCATE(my_varchar_1000, my_char_30 ),
-my_varchar_1000, my_char_30 id FROM t1_values
-WHERE select_id = 166 OR select_id IS NULL order by id;
-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 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 = 166 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_varchar_1000, my_varchar_1000 ),
-my_varchar_1000, id FROM t1_values;
-SELECT LOCATE(my_varchar_1000, my_varchar_1000 ),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 165 OR select_id IS NULL order by id;
-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 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 = 165 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_char_30, my_varbinary_1000 ),
-my_char_30, my_varbinary_1000 id FROM t1_values;
-SELECT LOCATE(my_char_30, my_varbinary_1000 ),
-my_char_30, my_varbinary_1000 id FROM t1_values
-WHERE select_id = 164 OR select_id IS NULL order by id;
-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 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 = 164 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_char_30, my_binary_30 ),
-my_char_30, my_binary_30 id FROM t1_values;
-SELECT LOCATE(my_char_30, my_binary_30 ),
-my_char_30, my_binary_30 id FROM t1_values
-WHERE select_id = 163 OR select_id IS NULL order by id;
-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 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 = 163 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_char_30, my_varchar_1000 ),
-my_char_30, my_varchar_1000 id FROM t1_values;
-SELECT LOCATE(my_char_30, my_varchar_1000 ),
-my_char_30, 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 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 = 162 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE(my_char_30, my_char_30 ),
-my_char_30, id FROM t1_values;
-SELECT LOCATE(my_char_30, my_char_30 ),
-my_char_30, id FROM t1_values
-WHERE select_id = 161 OR select_id IS NULL order by id;
-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 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 = 161 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE('char', my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values;
-SELECT LOCATE('char', my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 160 OR select_id IS NULL order by id;
-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 locate('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 = 160 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE('char', my_binary_30),
-my_binary_30, id FROM t1_values;
-SELECT LOCATE('char', my_binary_30),
-my_binary_30, id FROM t1_values
-WHERE select_id = 159 OR select_id IS NULL order by id;
-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 locate('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 = 159 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE('char', my_varchar_1000),
-my_varchar_1000, id FROM t1_values;
-SELECT LOCATE('char', my_varchar_1000),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 158 OR select_id IS NULL order by id;
-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 locate('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 = 158 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOCATE('char', my_char_30),
-my_char_30, id FROM t1_values;
-SELECT LOCATE('char', my_char_30),
-my_char_30, id FROM t1_values
-WHERE select_id = 157 OR select_id IS NULL order by id;
-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 locate('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 = 157 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt')
- AS my_col,
- id FROM t1_values;
-SELECT LOAD_FILE('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt')
- AS my_col,
- id FROM t1_values
-WHERE select_id = 156 OR select_id IS NULL order by id;
-my_col id
-Here is content from load_file
- 1
-Here is content from load_file
- 2
-Here is content from load_file
- 3
-Here is content from load_file
- 4
-Here is content from load_file
- 5
-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 load_file('<MYSQLTEST_VARDIR>/std_data/funcs_1/load_file.txt') AS `my_col`,`t1_values`.`id` AS `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;
-my_col id
-Here is content from load_file
- 1
-Here is content from load_file
- 2
-Here is content from load_file
- 3
-Here is content from load_file
- 4
-Here is content from load_file
- 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LENGTH(my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values;
-SELECT LENGTH(my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 155 OR select_id IS NULL order by id;
-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 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 = 155 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LENGTH(my_binary_30),
-my_binary_30, id FROM t1_values;
-SELECT LENGTH(my_binary_30),
-my_binary_30, id FROM t1_values
-WHERE select_id = 154 OR select_id IS NULL order by id;
-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 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 = 154 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LENGTH(my_varchar_1000),
-my_varchar_1000, id FROM t1_values;
-SELECT LENGTH(my_varchar_1000),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 153 OR select_id IS NULL order by id;
-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 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 = 153 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LENGTH(my_char_30),
-my_char_30, id FROM t1_values;
-SELECT LENGTH(my_char_30),
-my_char_30, id FROM t1_values
-WHERE select_id = 152 OR select_id IS NULL order by id;
-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 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 = 152 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double), my_double, id FROM t1_values;
-SELECT LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double), my_double, id FROM t1_values
-WHERE select_id = 151 OR select_id IS NULL order by id;
-LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double) my_double id
-NULL NULL 1
- -1.7976931348623e308 2
-AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3
- 0 4
- -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308'
-Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308'
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_double`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', 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 = 151 OR select_id IS NULL) order by id;
-LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_double) my_double id
-NULL NULL 1
- -1.7976931348623e308 2
-AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 1.7976931348623e308 3
- 0 4
- -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308'
-Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_decimal), my_decimal, id FROM t1_values;
-SELECT LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_decimal), my_decimal, id FROM t1_values
-WHERE select_id = 150 OR select_id IS NULL order by id;
-LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_decimal) my_decimal id
-NULL NULL 1
- -9999999999999999999999999999999999.999999999999999999999999999999 2
-AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999999999999999999999 3
- 0.000000000000000000000000000000 4
- -1.000000000000000000000000000000 5
-Warnings:
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1292 Truncated incorrect DECIMAL value: ''
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_decimal`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_decimal)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
-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;
-LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_decimal) my_decimal id
-NULL NULL 1
- -9999999999999999999999999999999999.999999999999999999999999999999 2
-AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9999999999999999999999999999999999.999999999999999999999999999999 3
- 0.000000000000000000000000000000 4
- -1.000000000000000000000000000000 5
-Warnings:
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1292 Truncated incorrect DECIMAL value: ''
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_bigint), my_bigint, id FROM t1_values;
-SELECT LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_bigint), my_bigint, id FROM t1_values
-WHERE select_id = 149 OR select_id IS NULL order by id;
-LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_bigint) my_bigint id
-NULL NULL 1
- -9223372036854775808 2
-AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9223372036854775807 3
- 0 4
- -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö',`t1_values`.`my_bigint`) AS `LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', 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 = 149 OR select_id IS NULL) order by id;
-LEFT('AaBbCcDdEeFfGgHhIiJjÄäÜüÖö', my_bigint) my_bigint id
-NULL NULL 1
- -9223372036854775808 2
-AaBbCcDdEeFfGgHhIiJjÄäÜüÖö 9223372036854775807 3
- 0 4
- -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LEFT(my_varbinary_1000, 2), my_varbinary_1000, id FROM t1_values;
-SELECT LEFT(my_varbinary_1000, 2), my_varbinary_1000, id FROM t1_values
-WHERE select_id = 148 OR select_id IS NULL order by id;
-LEFT(my_varbinary_1000, 2) my_varbinary_1000 id
-NULL NULL 1
- 2
-<- <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- - ---äÖüß@µ*$-- 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`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 = 148 OR select_id IS NULL) order by id;
-LEFT(my_varbinary_1000, 2) my_varbinary_1000 id
-NULL NULL 1
- 2
-<- <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- - ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LEFT(my_binary_30, 2), my_binary_30, id FROM t1_values;
-SELECT LEFT(my_binary_30, 2), my_binary_30, id FROM t1_values
-WHERE select_id = 147 OR select_id IS NULL order by id;
-LEFT(my_binary_30, 2) my_binary_30 id
-NULL NULL 1
- 2
-<- <--------30 characters-------> 3
- - ---äÖüß@µ*$-- 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`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 = 147 OR select_id IS NULL) order by id;
-LEFT(my_binary_30, 2) my_binary_30 id
-NULL NULL 1
-
-<- <--------30 characters-------> 3
- - ---äÖüß@µ*$--
--1 -1
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LEFT(my_varchar_1000, 2), my_varchar_1000, id FROM t1_values;
-SELECT LEFT(my_varchar_1000, 2), my_varchar_1000, id FROM t1_values
-WHERE select_id = 146 OR select_id IS NULL order by id;
-LEFT(my_varchar_1000, 2) my_varchar_1000 id
-NULL NULL 1
- 2
-<- <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- - ---äÖüß@µ*$-- 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`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 = 146 OR select_id IS NULL) order by id;
-LEFT(my_varchar_1000, 2) my_varchar_1000 id
-NULL NULL 1
- 2
-<- <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- - ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LEFT(my_char_30, 2), my_char_30, id FROM t1_values;
-SELECT LEFT(my_char_30, 2), my_char_30, id FROM t1_values
-WHERE select_id = 145 OR select_id IS NULL order by id;
-LEFT(my_char_30, 2) my_char_30 id
-NULL NULL 1
- 2
-<- <--------30 characters-------> 3
- - ---äÖüß@µ*$-- 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select left(`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 = 145 OR select_id IS NULL) order by id;
-LEFT(my_char_30, 2) my_char_30 id
-NULL NULL 1
- 2
-<- <--------30 characters-------> 3
- - ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT LCASE(my_varchar_1000),
-my_varchar_1000, id FROM t1_values;
-SELECT LCASE(my_varchar_1000),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 144 OR select_id IS NULL order by id;
-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 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 = 144 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT INSTR(my_char_30, 'char'),
-my_char_30, id FROM t1_values;
-SELECT INSTR(my_char_30, 'char'),
-my_char_30, id FROM t1_values
-WHERE select_id = 143 OR select_id IS NULL order by id;
-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 locate('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 = 143 OR select_id IS NULL) order by id;
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT BIT_LENGTH(my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values;
-SELECT BIT_LENGTH(my_varbinary_1000),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 142 OR select_id IS NULL order by id;
-BIT_LENGTH(my_varbinary_1000) my_varbinary_1000 id
-NULL NULL 1
-0 2
-8000 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-160 ---äÖüß@µ*$-- 4
-16 -1 5
-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 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 = 142 OR select_id IS NULL) order by id;
-BIT_LENGTH(my_varbinary_1000) my_varbinary_1000 id
-NULL NULL 1
-0 2
-8000 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-160 ---äÖüß@µ*$-- 4
-16 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT BIT_LENGTH(my_binary_30),
-my_binary_30, id FROM t1_values;
-SELECT BIT_LENGTH(my_binary_30),
-my_binary_30, id FROM t1_values
-WHERE select_id = 141 OR select_id IS NULL order by id;
-BIT_LENGTH(my_binary_30) my_binary_30 id
-NULL NULL 1
-240 2
-240 <--------30 characters-------> 3
-240 ---äÖüß@µ*$-- 4
-240 -1 5
-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 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 = 141 OR select_id IS NULL) order by id;
-BIT_LENGTH(my_binary_30) my_binary_30 id
-NULL NULL 1
-240
-240 <--------30 characters-------> 3
-240 ---äÖüß@µ*$--
-240 -1
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT BIT_LENGTH(my_varchar_1000),
-my_varchar_1000, id FROM t1_values;
-SELECT BIT_LENGTH(my_varchar_1000),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 140 OR select_id IS NULL order by id;
-BIT_LENGTH(my_varchar_1000) my_varchar_1000 id
-NULL NULL 1
-0 2
-8000 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-160 ---äÖüß@µ*$-- 4
-16 -1 5
-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 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 = 140 OR select_id IS NULL) order by id;
-BIT_LENGTH(my_varchar_1000) my_varchar_1000 id
-NULL NULL 1
-0 2
-8000 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-160 ---äÖüß@µ*$-- 4
-16 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT BIT_LENGTH(my_char_30),
-my_char_30, id FROM t1_values;
-SELECT BIT_LENGTH(my_char_30),
-my_char_30, id FROM t1_values
-WHERE select_id = 139 OR select_id IS NULL order by id;
-BIT_LENGTH(my_char_30) my_char_30 id
-NULL NULL 1
-0 2
-240 <--------30 characters-------> 3
-152 ---äÖüß@µ*$-- 4
-16 -1 5
-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 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 = 139 OR select_id IS NULL) order by id;
-BIT_LENGTH(my_char_30) my_char_30 id
-NULL NULL 1
-0 2
-240 <--------30 characters-------> 3
-152 ---äÖüß@µ*$-- 4
-16 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IFNULL(my_year,'IS_NULL'),
-my_year, id FROM t1_values;
-SELECT IFNULL(my_year,'IS_NULL'),
-my_year, id FROM t1_values
-WHERE select_id = 138 OR select_id IS NULL order by id;
-IFNULL(my_year,'IS_NULL') my_year id
-IS_NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
-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 ifnull(`t1_values`.`my_year`,'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 = 138 OR select_id IS NULL) order by id;
-IFNULL(my_year,'IS_NULL') my_year id
-IS_NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IFNULL(my_time,'IS_NULL'),
-my_time, id FROM t1_values;
-SELECT IFNULL(my_time,'IS_NULL'),
-my_time, id FROM t1_values
-WHERE select_id = 137 OR select_id IS NULL order by id;
-IFNULL(my_time,'IS_NULL') my_time id
-IS_NULL NULL 1
--838:59:59 -838:59:59 2
-838:59:59 838:59:59 3
-13:00:00 13:00:00 4
-10:00:00 10:00:00 5
-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 ifnull(`t1_values`.`my_time`,'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 = 137 OR select_id IS NULL) order by id;
-IFNULL(my_time,'IS_NULL') my_time id
-IS_NULL NULL 1
--838:59:59 -838:59:59 2
-838:59:59 838:59:59 3
-13:00:00 13:00:00 4
-10:00:00 10:00:00 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IFNULL(my_timestamp,'IS_NULL'),
-my_timestamp, id FROM t1_values;
-SELECT IFNULL(my_timestamp,'IS_NULL'),
-my_timestamp, id FROM t1_values
-WHERE select_id = 136 OR select_id IS NULL order by id;
-IFNULL(my_timestamp,'IS_NULL') my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
-1970-01-01 03:00:01 1970-01-01 03:00:01 2
-2038-01-01 02:59:59 2038-01-01 02:59:59 3
-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 character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_timestamp`,'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 = 136 OR select_id IS NULL) order by id;
-IFNULL(my_timestamp,'IS_NULL') my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
-1970-01-01 03:00:01 1970-01-01 03:00:01 2
-2038-01-01 02:59:59 2038-01-01 02:59:59 3
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IFNULL(my_date,'IS_NULL'),
-my_date, id FROM t1_values;
-SELECT IFNULL(my_date,'IS_NULL'),
-my_date, id FROM t1_values
-WHERE select_id = 135 OR select_id IS NULL order by id;
-IFNULL(my_date,'IS_NULL') my_date id
-IS_NULL NULL 1
-0001-01-01 0001-01-01 2
-9999-12-31 9999-12-31 3
-2004-02-29 2004-02-29 4
-2005-06-28 2005-06-28 5
-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 ifnull(`t1_values`.`my_date`,'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 = 135 OR select_id IS NULL) order by id;
-IFNULL(my_date,'IS_NULL') my_date id
-IS_NULL NULL 1
-0001-01-01 0001-01-01 2
-9999-12-31 9999-12-31 3
-2004-02-29 2004-02-29 4
-2005-06-28 2005-06-28 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IFNULL(my_datetime,'IS_NULL'),
-my_datetime, id FROM t1_values;
-SELECT IFNULL(my_datetime,'IS_NULL'),
-my_datetime, id FROM t1_values
-WHERE select_id = 134 OR select_id IS NULL order by id;
-IFNULL(my_datetime,'IS_NULL') my_datetime id
-IS_NULL NULL 1
-0001-01-01 00:00:00 0001-01-01 00:00:00 2
-9999-12-31 23:59:59 9999-12-31 23:59:59 3
-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 character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select ifnull(`t1_values`.`my_datetime`,'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 = 134 OR select_id IS NULL) order by id;
-IFNULL(my_datetime,'IS_NULL') my_datetime id
-IS_NULL NULL 1
-0001-01-01 00:00:00 0001-01-01 00:00:00 2
-9999-12-31 23:59:59 9999-12-31 23:59:59 3
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IFNULL(my_double,'IS_NULL'),
-my_double, id FROM t1_values;
-SELECT IFNULL(my_double,'IS_NULL'),
-my_double, id FROM t1_values
-WHERE select_id = 133 OR select_id IS NULL order by id;
-IFNULL(my_double,'IS_NULL') my_double id
-IS_NULL NULL 1
--1.7976931348623e308 -1.7976931348623e308 2
-1.7976931348623e308 1.7976931348623e308 3
-0 0 4
--1 -1 5
-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 ifnull(`t1_values`.`my_double`,'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 = 133 OR select_id IS NULL) order by id;
-IFNULL(my_double,'IS_NULL') my_double id
-IS_NULL NULL 1
--1.7976931348623e308 -1.7976931348623e308 2
-1.7976931348623e308 1.7976931348623e308 3
-0 0 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IFNULL(my_decimal,'IS_NULL'),
-my_decimal, id FROM t1_values;
-SELECT IFNULL(my_decimal,'IS_NULL'),
-my_decimal, id FROM t1_values
-WHERE select_id = 132 OR select_id IS NULL order by id;
-IFNULL(my_decimal,'IS_NULL') my_decimal id
-IS_NULL NULL 1
--9999999999999999999999999999999999.999999999999999999999999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999999999999999999999999999.999999999999999999999999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0.000000000000000000000000000000 0.000000000000000000000000000000 4
--1.000000000000000000000000000000 -1.000000000000000000000000000000 5
-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 ifnull(`t1_values`.`my_decimal`,'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 = 132 OR select_id IS NULL) order by id;
-IFNULL(my_decimal,'IS_NULL') my_decimal id
-IS_NULL NULL 1
--9999999999999999999999999999999999.999999999999999999999999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999999999999999999999999999.999999999999999999999999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0.000000000000000000000000000000 0.000000000000000000000000000000 4
--1.000000000000000000000000000000 -1.000000000000000000000000000000 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IFNULL(my_bigint,'IS_NULL'),
-my_bigint, id FROM t1_values;
-SELECT IFNULL(my_bigint,'IS_NULL'),
-my_bigint, id FROM t1_values
-WHERE select_id = 131 OR select_id IS NULL order by id;
-IFNULL(my_bigint,'IS_NULL') my_bigint id
-IS_NULL NULL 1
--9223372036854775808 -9223372036854775808 2
-9223372036854775807 9223372036854775807 3
-0 0 4
--1 -1 5
-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 ifnull(`t1_values`.`my_bigint`,'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 = 131 OR select_id IS NULL) order by id;
-IFNULL(my_bigint,'IS_NULL') my_bigint id
-IS_NULL NULL 1
--9223372036854775808 -9223372036854775808 2
-9223372036854775807 9223372036854775807 3
-0 0 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IFNULL(my_varbinary_1000,'IS_NULL'),
-my_varbinary_1000, id FROM t1_values;
-SELECT IFNULL(my_varbinary_1000,'IS_NULL'),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 130 OR select_id IS NULL order by id;
-IFNULL(my_varbinary_1000,'IS_NULL') my_varbinary_1000 id
-IS_NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-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 ifnull(`t1_values`.`my_varbinary_1000`,'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 = 130 OR select_id IS NULL) order by id;
-IFNULL(my_varbinary_1000,'IS_NULL') my_varbinary_1000 id
-IS_NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IFNULL(my_binary_30,'IS_NULL'),
-my_binary_30, id FROM t1_values;
-SELECT IFNULL(my_binary_30,'IS_NULL'),
-my_binary_30, id FROM t1_values
-WHERE select_id = 129 OR select_id IS NULL order by id;
-IFNULL(my_binary_30,'IS_NULL') my_binary_30 id
-IS_NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-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 ifnull(`t1_values`.`my_binary_30`,'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 = 129 OR select_id IS NULL) order by id;
-IFNULL(my_binary_30,'IS_NULL') my_binary_30 id
-IS_NULL NULL 1
-
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$--
--1
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IFNULL(my_varchar_1000,'IS_NULL'),
-my_varchar_1000, id FROM t1_values;
-SELECT IFNULL(my_varchar_1000,'IS_NULL'),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 128 OR select_id IS NULL order by id;
-IFNULL(my_varchar_1000,'IS_NULL') my_varchar_1000 id
-IS_NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-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 ifnull(`t1_values`.`my_varchar_1000`,'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 = 128 OR select_id IS NULL) order by id;
-IFNULL(my_varchar_1000,'IS_NULL') my_varchar_1000 id
-IS_NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IFNULL(my_char_30,'IS_NULL'),
-my_char_30, id FROM t1_values;
-SELECT IFNULL(my_char_30,'IS_NULL'),
-my_char_30, id FROM t1_values
-WHERE select_id = 127 OR select_id IS NULL order by id;
-IFNULL(my_char_30,'IS_NULL') my_char_30 id
-IS_NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-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 ifnull(`t1_values`.`my_char_30`,'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 = 127 OR select_id IS NULL) order by id;
-IFNULL(my_char_30,'IS_NULL') my_char_30 id
-IS_NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_year IS NULL, 'IS NULL',
-'IS NOT NULL'), my_year, id FROM t1_values;
-SELECT IF(my_year IS NULL, 'IS NULL',
-'IS NOT NULL'), my_year, id FROM t1_values
-WHERE select_id = 126 OR select_id IS NULL order by id;
-IF(my_year IS NULL, 'IS NULL',
-'IS NOT NULL') my_year id
-IS NULL NULL 1
-IS NOT NULL 1901 2
-IS NOT NULL 2155 3
-IS NOT NULL 2000 4
-IS NOT NULL 2005 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_year`),'IS NULL','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` 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;
-IF(my_year IS NULL, 'IS NULL',
-'IS NOT NULL') my_year id
-IS NULL NULL 1
-IS NOT NULL 1901 2
-IS NOT NULL 2155 3
-IS NOT NULL 2000 4
-IS NOT NULL 2005 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_time IS NULL, 'IS NULL',
-'IS NOT NULL'), my_time, id FROM t1_values;
-SELECT IF(my_time IS NULL, 'IS NULL',
-'IS NOT NULL'), my_time, id FROM t1_values
-WHERE select_id = 125 OR select_id IS NULL order by id;
-IF(my_time IS NULL, 'IS NULL',
-'IS NOT NULL') my_time id
-IS NULL NULL 1
-IS NOT NULL -838:59:59 2
-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 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`),'IS NULL','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` 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;
-IF(my_time IS NULL, 'IS NULL',
-'IS NOT NULL') my_time id
-IS NULL NULL 1
-IS NOT NULL -838:59:59 2
-IS NOT NULL 838:59:59 3
-IS NOT NULL 13:00:00 4
-IS NOT NULL 10:00:00 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_timestamp IS NULL, 'IS NULL',
-'IS NOT NULL'), my_timestamp, id FROM t1_values;
-SELECT IF(my_timestamp IS NULL, 'IS NULL',
-'IS NOT NULL'), my_timestamp, id FROM t1_values
-WHERE select_id = 124 OR select_id IS NULL order by id;
-IF(my_timestamp IS NULL, 'IS NULL',
-'IS NOT NULL') my_timestamp id
-IS NOT NULL 0000-00-00 00:00:00 1
-IS NOT NULL 1970-01-01 03:00:01 2
-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 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`),'IS NULL','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` 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;
-IF(my_timestamp IS NULL, 'IS NULL',
-'IS NOT NULL') my_timestamp id
-IS NOT NULL 0000-00-00 00:00:00 1
-IS NOT NULL 1970-01-01 03:00:01 2
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_date IS NULL, 'IS NULL',
-'IS NOT NULL'), my_date, id FROM t1_values;
-SELECT IF(my_date IS NULL, 'IS NULL',
-'IS NOT NULL'), my_date, id FROM t1_values
-WHERE select_id = 123 OR select_id IS NULL order by id;
-IF(my_date IS NULL, 'IS NULL',
-'IS NOT NULL') my_date id
-IS NULL NULL 1
-IS NOT NULL 0001-01-01 2
-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 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`),'IS NULL','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` 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;
-IF(my_date IS NULL, 'IS NULL',
-'IS NOT NULL') my_date id
-IS NULL NULL 1
-IS NOT NULL 0001-01-01 2
-IS NOT NULL 9999-12-31 3
-IS NOT NULL 2004-02-29 4
-IS NOT NULL 2005-06-28 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_datetime IS NULL, 'IS NULL',
-'IS NOT NULL'), my_datetime, id FROM t1_values;
-SELECT IF(my_datetime IS NULL, 'IS NULL',
-'IS NOT NULL'), my_datetime, id FROM t1_values
-WHERE select_id = 122 OR select_id IS NULL order by id;
-IF(my_datetime IS NULL, 'IS NULL',
-'IS NOT NULL') my_datetime id
-IS NULL NULL 1
-IS NOT NULL 0001-01-01 00:00:00 2
-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 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`),'IS NULL','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` 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;
-IF(my_datetime IS NULL, 'IS NULL',
-'IS NOT NULL') my_datetime id
-IS NULL NULL 1
-IS NOT NULL 0001-01-01 00:00:00 2
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_double IS NULL, 'IS NULL',
-'IS NOT NULL'), my_double, id FROM t1_values;
-SELECT IF(my_double IS NULL, 'IS NULL',
-'IS NOT NULL'), my_double, id FROM t1_values
-WHERE select_id = 121 OR select_id IS NULL order by id;
-IF(my_double IS NULL, 'IS NULL',
-'IS NOT NULL') my_double id
-IS NULL NULL 1
-IS NOT NULL -1.7976931348623e308 2
-IS NOT NULL 1.7976931348623e308 3
-IS NOT NULL 0 4
-IS NOT NULL -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_double`),'IS NULL','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` 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;
-IF(my_double IS NULL, 'IS NULL',
-'IS NOT NULL') my_double id
-IS NULL NULL 1
-IS NOT NULL -1.7976931348623e308 2
-IS NOT NULL 1.7976931348623e308 3
-IS NOT NULL 0 4
-IS NOT NULL -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_decimal IS NULL, 'IS NULL',
-'IS NOT NULL'), my_decimal, id FROM t1_values;
-SELECT IF(my_decimal IS NULL, 'IS NULL',
-'IS NOT NULL'), my_decimal, id FROM t1_values
-WHERE select_id = 120 OR select_id IS NULL order by id;
-IF(my_decimal IS NULL, 'IS NULL',
-'IS NOT NULL') my_decimal id
-IS NULL NULL 1
-IS NOT NULL -9999999999999999999999999999999999.999999999999999999999999999999 2
-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 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`),'IS NULL','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` 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;
-IF(my_decimal IS NULL, 'IS NULL',
-'IS NOT NULL') my_decimal id
-IS NULL NULL 1
-IS NOT NULL -9999999999999999999999999999999999.999999999999999999999999999999 2
-IS NOT NULL 9999999999999999999999999999999999.999999999999999999999999999999 3
-IS NOT NULL 0.000000000000000000000000000000 4
-IS NOT NULL -1.000000000000000000000000000000 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_bigint IS NULL, 'IS NULL',
-'IS NOT NULL'), my_bigint, id FROM t1_values;
-SELECT IF(my_bigint IS NULL, 'IS NULL',
-'IS NOT NULL'), my_bigint, id FROM t1_values
-WHERE select_id = 119 OR select_id IS NULL order by id;
-IF(my_bigint IS NULL, 'IS NULL',
-'IS NOT NULL') my_bigint id
-IS NULL NULL 1
-IS NOT NULL -9223372036854775808 2
-IS NOT NULL 9223372036854775807 3
-IS NOT NULL 0 4
-IS NOT NULL -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_bigint`),'IS NULL','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` 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;
-IF(my_bigint IS NULL, 'IS NULL',
-'IS NOT NULL') my_bigint id
-IS NULL NULL 1
-IS NOT NULL -9223372036854775808 2
-IS NOT NULL 9223372036854775807 3
-IS NOT NULL 0 4
-IS NOT NULL -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_varbinary_1000 IS NULL, 'IS NULL',
-'IS NOT NULL'), my_varbinary_1000, id FROM t1_values;
-SELECT IF(my_varbinary_1000 IS NULL, 'IS NULL',
-'IS NOT NULL'), my_varbinary_1000, id FROM t1_values
-WHERE select_id = 118 OR select_id IS NULL order by id;
-IF(my_varbinary_1000 IS NULL, 'IS NULL',
-'IS NOT NULL') my_varbinary_1000 id
-IS NULL NULL 1
-IS NOT NULL 2
-IS NOT NULL <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-IS NOT NULL ---äÖüß@µ*$-- 4
-IS NOT NULL -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varbinary_1000`),'IS NULL','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` 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;
-IF(my_varbinary_1000 IS NULL, 'IS NULL',
-'IS NOT NULL') my_varbinary_1000 id
-IS NULL NULL 1
-IS NOT NULL 2
-IS NOT NULL <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-IS NOT NULL ---äÖüß@µ*$-- 4
-IS NOT NULL -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_binary_30 IS NULL, 'IS NULL',
-'IS NOT NULL'), my_binary_30, id FROM t1_values;
-SELECT IF(my_binary_30 IS NULL, 'IS NULL',
-'IS NOT NULL'), my_binary_30, id FROM t1_values
-WHERE select_id = 117 OR select_id IS NULL order by id;
-IF(my_binary_30 IS NULL, 'IS NULL',
-'IS NOT NULL') my_binary_30 id
-IS NULL NULL 1
-IS NOT NULL 2
-IS NOT NULL <--------30 characters-------> 3
-IS NOT NULL ---äÖüß@µ*$-- 4
-IS NOT NULL -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_binary_30`),'IS NULL','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` 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;
-IF(my_binary_30 IS NULL, 'IS NULL',
-'IS NOT NULL') my_binary_30 id
-IS NULL NULL 1
-IS NOT NULL
-IS NOT NULL <--------30 characters-------> 3
-IS NOT NULL ---äÖüß@µ*$--
-IS NOT NULL -1
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_varchar_1000 IS NULL, 'IS NULL',
-'IS NOT NULL'), my_varchar_1000, id FROM t1_values;
-SELECT IF(my_varchar_1000 IS NULL, 'IS NULL',
-'IS NOT NULL'), my_varchar_1000, id FROM t1_values
-WHERE select_id = 116 OR select_id IS NULL order by id;
-IF(my_varchar_1000 IS NULL, 'IS NULL',
-'IS NOT NULL') my_varchar_1000 id
-IS NULL NULL 1
-IS NOT NULL 2
-IS NOT NULL <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-IS NOT NULL ---äÖüß@µ*$-- 4
-IS NOT NULL -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_varchar_1000`),'IS NULL','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` 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;
-IF(my_varchar_1000 IS NULL, 'IS NULL',
-'IS NOT NULL') my_varchar_1000 id
-IS NULL NULL 1
-IS NOT NULL 2
-IS NOT NULL <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-IS NOT NULL ---äÖüß@µ*$-- 4
-IS NOT NULL -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_char_30 IS NULL, 'IS NULL',
-'IS NOT NULL'), my_char_30, id FROM t1_values;
-SELECT IF(my_char_30 IS NULL, 'IS NULL',
-'IS NOT NULL'), my_char_30, id FROM t1_values
-WHERE select_id = 115 OR select_id IS NULL order by id;
-IF(my_char_30 IS NULL, 'IS NULL',
-'IS NOT NULL') my_char_30 id
-IS NULL NULL 1
-IS NOT NULL 2
-IS NOT NULL <--------30 characters-------> 3
-IS NOT NULL ---äÖüß@µ*$-- 4
-IS NOT NULL -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(isnull(`t1_values`.`my_char_30`),'IS NULL','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` 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;
-IF(my_char_30 IS NULL, 'IS NULL',
-'IS NOT NULL') my_char_30 id
-IS NULL NULL 1
-IS NOT NULL 2
-IS NOT NULL <--------30 characters-------> 3
-IS NOT NULL ---äÖüß@µ*$-- 4
-IS NOT NULL -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_year, 'IS TRUE', 'IS NOT TRUE'),
-my_year, id FROM t1_values;
-SELECT IF(my_year, 'IS TRUE', 'IS NOT TRUE'),
-my_year, id FROM t1_values
-WHERE select_id = 114 OR select_id IS NULL order by id;
-IF(my_year, 'IS TRUE', 'IS NOT TRUE') my_year id
-IS NOT TRUE NULL 1
-IS TRUE 1901 2
-IS TRUE 2155 3
-IS TRUE 2000 4
-IS TRUE 2005 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_year`,'IS TRUE','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 = 114 OR select_id IS NULL) order by id;
-IF(my_year, 'IS TRUE', 'IS NOT TRUE') my_year id
-IS NOT TRUE NULL 1
-IS TRUE 1901 2
-IS TRUE 2155 3
-IS TRUE 2000 4
-IS TRUE 2005 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_time, 'IS TRUE', 'IS NOT TRUE'),
-my_time, id FROM t1_values;
-SELECT IF(my_time, 'IS TRUE', 'IS NOT TRUE'),
-my_time, id FROM t1_values
-WHERE select_id = 113 OR select_id IS NULL order by id;
-IF(my_time, 'IS TRUE', 'IS NOT TRUE') my_time id
-IS NOT TRUE NULL 1
-IS TRUE -838:59:59 2
-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 character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_time`,'IS TRUE','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 = 113 OR select_id IS NULL) order by id;
-IF(my_time, 'IS TRUE', 'IS NOT TRUE') my_time id
-IS NOT TRUE NULL 1
-IS TRUE -838:59:59 2
-IS TRUE 838:59:59 3
-IS TRUE 13:00:00 4
-IS TRUE 10:00:00 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE'),
-my_timestamp, id FROM t1_values;
-SELECT IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE'),
-my_timestamp, id FROM t1_values
-WHERE select_id = 112 OR select_id IS NULL order by id;
-IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE') my_timestamp id
-IS NOT TRUE 0000-00-00 00:00:00 1
-IS TRUE 1970-01-01 03:00:01 2
-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 character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_timestamp`,'IS TRUE','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 = 112 OR select_id IS NULL) order by id;
-IF(my_timestamp, 'IS TRUE', 'IS NOT TRUE') my_timestamp id
-IS NOT TRUE 0000-00-00 00:00:00 1
-IS TRUE 1970-01-01 03:00:01 2
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_date, 'IS TRUE', 'IS NOT TRUE'),
-my_date, id FROM t1_values;
-SELECT IF(my_date, 'IS TRUE', 'IS NOT TRUE'),
-my_date, id FROM t1_values
-WHERE select_id = 111 OR select_id IS NULL order by id;
-IF(my_date, 'IS TRUE', 'IS NOT TRUE') my_date id
-IS NOT TRUE NULL 1
-IS TRUE 0001-01-01 2
-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 character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_date`,'IS TRUE','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 = 111 OR select_id IS NULL) order by id;
-IF(my_date, 'IS TRUE', 'IS NOT TRUE') my_date id
-IS NOT TRUE NULL 1
-IS TRUE 0001-01-01 2
-IS TRUE 9999-12-31 3
-IS TRUE 2004-02-29 4
-IS TRUE 2005-06-28 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_datetime, 'IS TRUE', 'IS NOT TRUE'),
-my_datetime, id FROM t1_values;
-SELECT IF(my_datetime, 'IS TRUE', 'IS NOT TRUE'),
-my_datetime, id FROM t1_values
-WHERE select_id = 110 OR select_id IS NULL order by id;
-IF(my_datetime, 'IS TRUE', 'IS NOT TRUE') my_datetime id
-IS NOT TRUE NULL 1
-IS TRUE 0001-01-01 00:00:00 2
-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 character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_datetime`,'IS TRUE','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 = 110 OR select_id IS NULL) order by id;
-IF(my_datetime, 'IS TRUE', 'IS NOT TRUE') my_datetime id
-IS NOT TRUE NULL 1
-IS TRUE 0001-01-01 00:00:00 2
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_double, 'IS TRUE', 'IS NOT TRUE'),
-my_double, id FROM t1_values;
-SELECT IF(my_double, 'IS TRUE', 'IS NOT TRUE'),
-my_double, id FROM t1_values
-WHERE select_id = 109 OR select_id IS NULL order by id;
-IF(my_double, 'IS TRUE', 'IS NOT TRUE') my_double id
-IS NOT TRUE NULL 1
-IS TRUE -1.7976931348623e308 2
-IS TRUE 1.7976931348623e308 3
-IS NOT TRUE 0 4
-IS TRUE -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_double`,'IS TRUE','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 = 109 OR select_id IS NULL) order by id;
-IF(my_double, 'IS TRUE', 'IS NOT TRUE') my_double id
-IS NOT TRUE NULL 1
-IS TRUE -1.7976931348623e308 2
-IS TRUE 1.7976931348623e308 3
-IS NOT TRUE 0 4
-IS TRUE -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_decimal, 'IS TRUE', 'IS NOT TRUE'),
-my_decimal, id FROM t1_values;
-SELECT IF(my_decimal, 'IS TRUE', 'IS NOT TRUE'),
-my_decimal, id FROM t1_values
-WHERE select_id = 108 OR select_id IS NULL order by id;
-IF(my_decimal, 'IS TRUE', 'IS NOT TRUE') my_decimal id
-IS NOT TRUE NULL 1
-IS TRUE -9999999999999999999999999999999999.999999999999999999999999999999 2
-IS TRUE 9999999999999999999999999999999999.999999999999999999999999999999 3
-IS NOT TRUE 0.000000000000000000000000000000 4
-IS TRUE -1.000000000000000000000000000000 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_decimal`,'IS TRUE','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 = 108 OR select_id IS NULL) order by id;
-IF(my_decimal, 'IS TRUE', 'IS NOT TRUE') my_decimal id
-IS NOT TRUE NULL 1
-IS TRUE -9999999999999999999999999999999999.999999999999999999999999999999 2
-IS TRUE 9999999999999999999999999999999999.999999999999999999999999999999 3
-IS NOT TRUE 0.000000000000000000000000000000 4
-IS TRUE -1.000000000000000000000000000000 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_bigint, 'IS TRUE', 'IS NOT TRUE'),
-my_bigint, id FROM t1_values;
-SELECT IF(my_bigint, 'IS TRUE', 'IS NOT TRUE'),
-my_bigint, id FROM t1_values
-WHERE select_id = 107 OR select_id IS NULL order by id;
-IF(my_bigint, 'IS TRUE', 'IS NOT TRUE') my_bigint id
-IS NOT TRUE NULL 1
-IS TRUE -9223372036854775808 2
-IS TRUE 9223372036854775807 3
-IS NOT TRUE 0 4
-IS TRUE -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_bigint`,'IS TRUE','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 = 107 OR select_id IS NULL) order by id;
-IF(my_bigint, 'IS TRUE', 'IS NOT TRUE') my_bigint id
-IS NOT TRUE NULL 1
-IS TRUE -9223372036854775808 2
-IS TRUE 9223372036854775807 3
-IS NOT TRUE 0 4
-IS TRUE -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE'),
-my_varbinary_1000, id FROM t1_values;
-SELECT IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE'),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 106 OR select_id IS NULL order by id;
-IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE') my_varbinary_1000 id
-IS NOT TRUE NULL 1
-IS NOT TRUE 2
-IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-IS NOT TRUE ---äÖüß@µ*$-- 4
-IS TRUE -1 5
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varbinary_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
-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;
-IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE') my_varbinary_1000 id
-IS NOT TRUE NULL 1
-IS NOT TRUE 2
-IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-IS NOT TRUE ---äÖüß@µ*$-- 4
-IS TRUE -1 5
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_binary_30, 'IS TRUE', 'IS NOT TRUE'),
-my_binary_30, id FROM t1_values;
-SELECT IF(my_binary_30, 'IS TRUE', 'IS NOT TRUE'),
-my_binary_30, id FROM t1_values
-WHERE select_id = 105 OR select_id IS NULL order by id;
-IF(my_binary_30, 'IS TRUE', 'IS NOT TRUE') my_binary_30 id
-IS NOT TRUE NULL 1
-IS NOT TRUE 2
-IS NOT TRUE <--------30 characters-------> 3
-IS NOT TRUE ---äÖüß@µ*$-- 4
-IS TRUE -1 5
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning 1292 Truncated incorrect DOUBLE value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_binary_30`,'IS TRUE','IS NOT TRUE') AS `IF(my_binary_30, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
-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;
-IF(my_binary_30, 'IS TRUE', 'IS NOT TRUE') my_binary_30 id
-IS NOT TRUE NULL 1
-IS NOT TRUE
-IS NOT TRUE <--------30 characters-------> 3
-IS NOT TRUE ---äÖüß@µ*$--
-IS TRUE -1
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning 1292 Truncated incorrect DOUBLE value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE'),
-my_varchar_1000, id FROM t1_values;
-SELECT IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE'),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 104 OR select_id IS NULL order by id;
-IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE') my_varchar_1000 id
-IS NOT TRUE NULL 1
-IS NOT TRUE 2
-IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-IS NOT TRUE ---äÖüß@µ*$-- 4
-IS TRUE -1 5
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varchar_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
-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;
-IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE') my_varchar_1000 id
-IS NOT TRUE NULL 1
-IS NOT TRUE 2
-IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-IS NOT TRUE ---äÖüß@µ*$-- 4
-IS TRUE -1 5
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT IF(my_char_30, 'IS TRUE', 'IS NOT TRUE'),
-my_char_30, id FROM t1_values;
-SELECT IF(my_char_30, 'IS TRUE', 'IS NOT TRUE'),
-my_char_30, id FROM t1_values
-WHERE select_id = 103 OR select_id IS NULL order by id;
-IF(my_char_30, 'IS TRUE', 'IS NOT TRUE') my_char_30 id
-IS NOT TRUE NULL 1
-IS NOT TRUE 2
-IS NOT TRUE <--------30 characters-------> 3
-IS NOT TRUE ---äÖüß@µ*$-- 4
-IS TRUE -1 5
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_char_30`,'IS TRUE','IS NOT TRUE') AS `IF(my_char_30, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_char_30` AS `my_char_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
-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;
-IF(my_char_30, 'IS TRUE', 'IS NOT TRUE') my_char_30 id
-IS NOT TRUE NULL 1
-IS NOT TRUE 2
-IS NOT TRUE <--------30 characters-------> 3
-IS NOT TRUE ---äÖüß@µ*$-- 4
-IS TRUE -1 5
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CONVERT(my_varbinary_1000 USING koi8r),
-my_varbinary_1000, id FROM t1_values;
-SELECT CONVERT(my_varbinary_1000 USING koi8r),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 102 OR select_id IS NULL order by id;
-CONVERT(my_varbinary_1000 USING koi8r) my_varbinary_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---???????÷@??*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-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 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 = 102 OR select_id IS NULL) order by id;
-CONVERT(my_varbinary_1000 USING koi8r) my_varbinary_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---???????÷@??*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CONVERT(my_binary_30 USING koi8r),
-my_binary_30, id FROM t1_values;
-SELECT CONVERT(my_binary_30 USING koi8r),
-my_binary_30, id FROM t1_values
-WHERE select_id = 101 OR select_id IS NULL order by id;
-CONVERT(my_binary_30 USING koi8r) my_binary_30 id
-NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---???????÷@??*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-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 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 = 101 OR select_id IS NULL) order by id;
-CONVERT(my_binary_30 USING koi8r) my_binary_30 id
-NULL NULL 1
-
-<--------30 characters-------> <--------30 characters-------> 3
- ---???????÷@??*$--
--1
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CONVERT(my_varchar_1000 USING koi8r),
-my_varchar_1000, id FROM t1_values;
-SELECT CONVERT(my_varchar_1000 USING koi8r),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 100 OR select_id IS NULL order by id;
-CONVERT(my_varchar_1000 USING koi8r) my_varchar_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---????????@??*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-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 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 = 100 OR select_id IS NULL) order by id;
-CONVERT(my_varchar_1000 USING koi8r) my_varchar_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---????????@??*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CONVERT(my_char_30 USING koi8r),
-my_char_30, id FROM t1_values;
-SELECT CONVERT(my_char_30 USING koi8r),
-my_char_30, id FROM t1_values
-WHERE select_id = 99 OR select_id IS NULL order by id;
-CONVERT(my_char_30 USING koi8r) my_char_30 id
-NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---????????@??*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-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 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 = 99 OR select_id IS NULL) order by id;
-CONVERT(my_char_30 USING koi8r) my_char_30 id
-NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---????????@??*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CONVERT(my_varbinary_1000 USING utf8),
-my_varbinary_1000, id FROM t1_values;
-SELECT CONVERT(my_varbinary_1000 USING utf8),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 98 OR select_id IS NULL order by id;
-CONVERT(my_varbinary_1000 USING utf8) my_varbinary_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-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 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 = 98 OR select_id IS NULL) order by id;
-CONVERT(my_varbinary_1000 USING utf8) my_varbinary_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CONVERT(my_binary_30 USING utf8),
-my_binary_30, id FROM t1_values;
-SELECT CONVERT(my_binary_30 USING utf8),
-my_binary_30, id FROM t1_values
-WHERE select_id = 97 OR select_id IS NULL order by id;
-CONVERT(my_binary_30 USING utf8) my_binary_30 id
-NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-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 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 = 97 OR select_id IS NULL) order by id;
-CONVERT(my_binary_30 USING utf8) my_binary_30 id
-NULL NULL 1
-
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$--
--1
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CONVERT(my_varchar_1000 USING utf8),
-my_varchar_1000, id FROM t1_values;
-SELECT CONVERT(my_varchar_1000 USING utf8),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 96 OR select_id IS NULL order by id;
-CONVERT(my_varchar_1000 USING utf8) my_varchar_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-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 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 = 96 OR select_id IS NULL) order by id;
-CONVERT(my_varchar_1000 USING utf8) my_varchar_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CONVERT(my_char_30 USING utf8),
-my_char_30, id FROM t1_values;
-SELECT CONVERT(my_char_30 USING utf8),
-my_char_30, id FROM t1_values
-WHERE select_id = 95 OR select_id IS NULL order by id;
-CONVERT(my_char_30 USING utf8) my_char_30 id
-NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-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 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 = 95 OR select_id IS NULL) order by id;
-CONVERT(my_char_30 USING utf8) my_char_30 id
-NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_year AS UNSIGNED INTEGER),
-my_year, id FROM t1_values;
-SELECT CAST(my_year AS UNSIGNED INTEGER),
-my_year, id FROM t1_values
-WHERE select_id = 94 OR select_id IS NULL order by id;
-CAST(my_year AS UNSIGNED INTEGER) my_year id
-NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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 = 94 OR select_id IS NULL) order by id;
-CAST(my_year AS UNSIGNED INTEGER) my_year id
-NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_time AS UNSIGNED INTEGER),
-my_time, id FROM t1_values;
-SELECT CAST(my_time AS UNSIGNED INTEGER),
-my_time, id FROM t1_values
-WHERE select_id = 93 OR select_id IS NULL order by id;
-CAST(my_time AS UNSIGNED INTEGER) my_time id
-NULL NULL 1
-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 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 = 93 OR select_id IS NULL) order by id;
-CAST(my_time AS UNSIGNED INTEGER) my_time id
-NULL NULL 1
-18446744073701165657 -838:59:59 2
-8385959 838:59:59 3
-130000 13:00:00 4
-100000 10:00:00 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_timestamp AS UNSIGNED INTEGER),
-my_timestamp, id FROM t1_values;
-SELECT CAST(my_timestamp AS UNSIGNED INTEGER),
-my_timestamp, id FROM t1_values
-WHERE select_id = 92 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
-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 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 = 92 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
-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;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_date AS UNSIGNED INTEGER),
-my_date, id FROM t1_values;
-SELECT CAST(my_date AS UNSIGNED INTEGER),
-my_date, id FROM t1_values
-WHERE select_id = 91 OR select_id IS NULL order by id;
-CAST(my_date AS UNSIGNED INTEGER) 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
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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 = 91 OR select_id IS NULL) order by id;
-CAST(my_date AS UNSIGNED INTEGER) 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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_datetime AS UNSIGNED INTEGER),
-my_datetime, id FROM t1_values;
-SELECT CAST(my_datetime AS UNSIGNED INTEGER),
-my_datetime, id FROM t1_values
-WHERE select_id = 90 OR select_id IS NULL order by id;
-CAST(my_datetime AS UNSIGNED INTEGER) my_datetime id
-NULL NULL 1
-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 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 = 90 OR select_id IS NULL) order by id;
-CAST(my_datetime AS UNSIGNED INTEGER) my_datetime id
-NULL NULL 1
-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;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_double AS UNSIGNED INTEGER),
-my_double, id FROM t1_values;
-SELECT CAST(my_double AS UNSIGNED INTEGER),
-my_double, id FROM t1_values
-WHERE select_id = 89 OR select_id IS NULL order by id;
-CAST(my_double AS UNSIGNED INTEGER) my_double id
-NULL NULL 1
-9223372036854775808 -1.7976931348623e308 2
-9223372036854775807 1.7976931348623e308 3
-0 0 4
-18446744073709551615 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308'
-Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308'
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as unsigned) AS `CAST(my_double AS UNSIGNED 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 = 89 OR select_id IS NULL) order by id;
-CAST(my_double AS UNSIGNED INTEGER) my_double id
-NULL NULL 1
-9223372036854775808 -1.7976931348623e308 2
-9223372036854775807 1.7976931348623e308 3
-0 0 4
-18446744073709551615 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308'
-Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_decimal AS UNSIGNED INTEGER),
-my_decimal, id FROM t1_values;
-SELECT CAST(my_decimal AS UNSIGNED INTEGER),
-my_decimal, id FROM t1_values
-WHERE select_id = 88 OR select_id IS NULL order by id;
-CAST(my_decimal AS UNSIGNED INTEGER) my_decimal id
-NULL NULL 1
-0 -9999999999999999999999999999999999.999999999999999999999999999999 2
-18446744073709551615 9999999999999999999999999999999999.999999999999999999999999999999 3
-0 0.000000000000000000000000000000 4
-0 -1.000000000000000000000000000000 5
-Warnings:
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1292 Truncated incorrect DECIMAL value: ''
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as unsigned) AS `CAST(my_decimal AS UNSIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
-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;
-CAST(my_decimal AS UNSIGNED INTEGER) my_decimal id
-NULL NULL 1
-0 -9999999999999999999999999999999999.999999999999999999999999999999 2
-18446744073709551615 9999999999999999999999999999999999.999999999999999999999999999999 3
-0 0.000000000000000000000000000000 4
-0 -1.000000000000000000000000000000 5
-Warnings:
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1292 Truncated incorrect DECIMAL value: ''
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_bigint AS UNSIGNED INTEGER),
-my_bigint, id FROM t1_values;
-SELECT CAST(my_bigint AS UNSIGNED INTEGER),
-my_bigint, id FROM t1_values
-WHERE select_id = 87 OR select_id IS NULL order by id;
-CAST(my_bigint AS UNSIGNED INTEGER) my_bigint id
-NULL NULL 1
-9223372036854775808 -9223372036854775808 2
-9223372036854775807 9223372036854775807 3
-0 0 4
-18446744073709551615 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_bigint AS UNSIGNED INTEGER) my_bigint id
-NULL NULL 1
-9223372036854775808 -9223372036854775808 2
-9223372036854775807 9223372036854775807 3
-0 0 4
-18446744073709551615 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS UNSIGNED INTEGER),
-my_varbinary_1000, id FROM t1_values;
-SELECT CAST(my_varbinary_1000 AS UNSIGNED INTEGER),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 86 OR select_id IS NULL order by id;
-CAST(my_varbinary_1000 AS UNSIGNED INTEGER) my_varbinary_1000 id
-NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
-18446744073709551615 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: ''
-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 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;
-CAST(my_varbinary_1000 AS UNSIGNED INTEGER) my_varbinary_1000 id
-NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
-18446744073709551615 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: ''
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS UNSIGNED INTEGER),
-my_binary_30, id FROM t1_values;
-SELECT CAST(my_binary_30 AS UNSIGNED INTEGER),
-my_binary_30, id FROM t1_values
-WHERE select_id = 85 OR select_id IS NULL order by id;
-CAST(my_binary_30 AS UNSIGNED INTEGER) my_binary_30 id
-NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
-18446744073709551615 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: ''
-Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
-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 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;
-CAST(my_binary_30 AS UNSIGNED INTEGER) my_binary_30 id
-NULL NULL 1
-0
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$--
-18446744073709551615 -1
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: ''
-Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS UNSIGNED INTEGER),
-my_varchar_1000, id FROM t1_values;
-SELECT CAST(my_varchar_1000 AS UNSIGNED INTEGER),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 84 OR select_id IS NULL order by id;
-CAST(my_varchar_1000 AS UNSIGNED INTEGER) my_varchar_1000 id
-NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
-18446744073709551615 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: ''
-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 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;
-CAST(my_varchar_1000 AS UNSIGNED INTEGER) my_varchar_1000 id
-NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
-18446744073709551615 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: ''
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_char_30 AS UNSIGNED INTEGER),
-my_char_30, id FROM t1_values;
-SELECT CAST(my_char_30 AS UNSIGNED INTEGER),
-my_char_30, id FROM t1_values
-WHERE select_id = 83 OR select_id IS NULL order by id;
-CAST(my_char_30 AS UNSIGNED INTEGER) my_char_30 id
-NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
-18446744073709551615 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: ''
-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 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;
-CAST(my_char_30 AS UNSIGNED INTEGER) my_char_30 id
-NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
-18446744073709551615 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: ''
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_year AS SIGNED INTEGER),
-my_year, id FROM t1_values;
-SELECT CAST(my_year AS SIGNED INTEGER),
-my_year, id FROM t1_values
-WHERE select_id = 82 OR select_id IS NULL order by id;
-CAST(my_year AS SIGNED INTEGER) my_year id
-NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_year AS SIGNED INTEGER) my_year id
-NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_time AS SIGNED INTEGER),
-my_time, id FROM t1_values;
-SELECT CAST(my_time AS SIGNED INTEGER),
-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
--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 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
--8385959 -838:59:59 2
-8385959 838:59:59 3
-130000 13:00:00 4
-100000 10:00:00 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_timestamp AS SIGNED INTEGER),
-my_timestamp, id FROM t1_values;
-SELECT CAST(my_timestamp AS SIGNED INTEGER),
-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
-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 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
-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;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_date AS SIGNED INTEGER),
-my_date, id FROM t1_values;
-SELECT CAST(my_date AS SIGNED INTEGER),
-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
-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 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
-10101 0001-01-01 2
-99991231 9999-12-31 3
-20040229 2004-02-29 4
-20050628 2005-06-28 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_datetime AS SIGNED INTEGER),
-my_datetime, id FROM t1_values;
-SELECT CAST(my_datetime AS SIGNED INTEGER),
-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
-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 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
-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;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_double AS SIGNED INTEGER),
-my_double, id FROM t1_values;
-SELECT CAST(my_double AS SIGNED INTEGER),
-my_double, id FROM t1_values
-WHERE select_id = 77 OR select_id IS NULL order by id;
-CAST(my_double AS SIGNED INTEGER) my_double id
-NULL NULL 1
--9223372036854775808 -1.7976931348623e308 2
-9223372036854775807 1.7976931348623e308 3
-0 0 4
--1 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308'
-Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308'
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as 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;
-CAST(my_double AS SIGNED INTEGER) my_double id
-NULL NULL 1
--9223372036854775808 -1.7976931348623e308 2
-9223372036854775807 1.7976931348623e308 3
-0 0 4
--1 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-1.7976931348623e308'
-Warning 1292 Truncated incorrect INTEGER value: '1.7976931348623e308'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_decimal AS SIGNED INTEGER),
-my_decimal, id FROM t1_values;
-SELECT CAST(my_decimal AS SIGNED INTEGER),
-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
--9223372036854775808 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9223372036854775807 9999999999999999999999999999999999.999999999999999999999999999999 3
-0 0.000000000000000000000000000000 4
--1 -1.000000000000000000000000000000 5
-Warnings:
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1292 Truncated incorrect DECIMAL value: ''
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as signed) AS `CAST(my_decimal AS SIGNED INTEGER)`,`t1_values`.`my_decimal` AS `my_decimal`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
-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
--9223372036854775808 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9223372036854775807 9999999999999999999999999999999999.999999999999999999999999999999 3
-0 0.000000000000000000000000000000 4
--1 -1.000000000000000000000000000000 5
-Warnings:
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1292 Truncated incorrect DECIMAL value: ''
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_bigint AS SIGNED INTEGER),
-my_bigint, id FROM t1_values;
-SELECT CAST(my_bigint AS SIGNED INTEGER),
-my_bigint, id FROM t1_values
-WHERE select_id = 75 OR select_id IS NULL order by id;
-CAST(my_bigint AS SIGNED INTEGER) my_bigint id
-NULL NULL 1
--9223372036854775808 -9223372036854775808 2
-9223372036854775807 9223372036854775807 3
-0 0 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_bigint AS SIGNED INTEGER) my_bigint id
-NULL NULL 1
--9223372036854775808 -9223372036854775808 2
-9223372036854775807 9223372036854775807 3
-0 0 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS SIGNED INTEGER),
-my_varbinary_1000, id FROM t1_values;
-SELECT CAST(my_varbinary_1000 AS SIGNED INTEGER),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 74 OR select_id IS NULL order by id;
-CAST(my_varbinary_1000 AS SIGNED INTEGER) my_varbinary_1000 id
-NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
-Warnings:
-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 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;
-CAST(my_varbinary_1000 AS SIGNED INTEGER) my_varbinary_1000 id
-NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: ''
-Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS SIGNED INTEGER),
-my_binary_30, id FROM t1_values;
-SELECT CAST(my_binary_30 AS SIGNED INTEGER),
-my_binary_30, id FROM t1_values
-WHERE select_id = 73 OR select_id IS NULL order by id;
-CAST(my_binary_30 AS SIGNED INTEGER) my_binary_30 id
-NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: ''
-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 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;
-CAST(my_binary_30 AS SIGNED INTEGER) my_binary_30 id
-NULL NULL 1
-0
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$--
--1 -1
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: ''
-Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect INTEGER value: '-1'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS SIGNED INTEGER),
-my_varchar_1000, id FROM t1_values;
-SELECT CAST(my_varchar_1000 AS SIGNED INTEGER),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 72 OR select_id IS NULL order by id;
-CAST(my_varchar_1000 AS SIGNED INTEGER) my_varchar_1000 id
-NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
-Warnings:
-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 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;
-CAST(my_varchar_1000 AS SIGNED INTEGER) my_varchar_1000 id
-NULL NULL 1
-0 2
-0 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: ''
-Warning 1292 Truncated incorrect INTEGER value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$-- '
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_char_30 AS SIGNED INTEGER),
-my_char_30, id FROM t1_values;
-SELECT CAST(my_char_30 AS SIGNED INTEGER),
-my_char_30, id FROM t1_values
-WHERE select_id = 71 OR select_id IS NULL order by id;
-CAST(my_char_30 AS SIGNED INTEGER) my_char_30 id
-NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
-Warnings:
-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 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;
-CAST(my_char_30 AS SIGNED INTEGER) my_char_30 id
-NULL NULL 1
-0 2
-0 <--------30 characters-------> 3
-0 ---äÖüß@µ*$-- 4
--1 -1 5
-Warnings:
-Warning 1292 Truncated incorrect INTEGER value: ''
-Warning 1292 Truncated incorrect INTEGER value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect INTEGER value: ' ---äÖüß@µ*$--'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_year AS DECIMAL(37,2)),
-my_year, id FROM t1_values;
-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(37,2)) my_year id
-NULL NULL 1
-1901.00 1901 2
-2155.00 2155 3
-2000.00 2000 4
-2005.00 2005 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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(37,2)) my_year id
-NULL NULL 1
-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(37,2)),
-my_time, id FROM t1_values;
-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(37,2)) my_time id
-NULL NULL 1
--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 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(37,2)) my_time id
-NULL NULL 1
--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(37,2)),
-my_timestamp, id FROM t1_values;
-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(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 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(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(37,2)),
-my_date, id FROM t1_values;
-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(37,2)) my_date id
-NULL NULL 1
-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 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(37,2)) my_date id
-NULL NULL 1
-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(37,2)),
-my_datetime, id FROM t1_values;
-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(37,2)) my_datetime id
-NULL NULL 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 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(37,2)) my_datetime id
-NULL NULL 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(37,2)),
-my_double, id FROM t1_values;
-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(37,2)) my_double id
-NULL NULL 1
--99999999999999999999999999999999999.99 -1.7976931348623e308 2
-99999999999999999999999999999999999.99 1.7976931348623e308 3
-0.00 0 4
--1.00 -1 5
--3333.33 -3333.3333 30
-Warnings:
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as decimal(37,2)) AS `CAST(my_double AS DECIMAL(37,2))`,`t1_values`.`my_double` AS `my_double`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
-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(37,2)) my_double id
-NULL NULL 1
--99999999999999999999999999999999999.99 -1.7976931348623e308 2
-99999999999999999999999999999999999.99 1.7976931348623e308 3
-0.00 0 4
--1.00 -1 5
--3333.33 -3333.3333 30
-Warnings:
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1264 Out of range value for column 'CAST(my_double AS DECIMAL(37,2))' at row 1
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_decimal AS DECIMAL(37,2)),
-my_decimal, id FROM t1_values;
-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(37,2)) my_decimal id
-NULL NULL 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 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(37,2)) my_decimal id
-NULL NULL 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(37,2)),
-my_bigint, id FROM t1_values;
-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(37,2)) my_bigint id
-NULL NULL 1
--9223372036854775808.00 -9223372036854775808 2
-9223372036854775807.00 9223372036854775807 3
-0.00 0 4
--1.00 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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(37,2)) my_bigint id
-NULL NULL 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(37,2)),
-my_varbinary_1000, id FROM t1_values;
-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(37,2)) my_varbinary_1000 id
-NULL NULL 1
-0.00 2
-0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0.00 ---äÖüß@µ*$-- 4
--1.00 -1 5
--3333.33 -3333.3333 29
-Warnings:
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
-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(37,2)) my_varbinary_1000 id
-NULL NULL 1
-0.00 2
-0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0.00 ---äÖüß@µ*$-- 4
--1.00 -1 5
--3333.33 -3333.3333 29
-Warnings:
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-DROP VIEW v1;
-
-
-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(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(37,2)) my_binary_30 id
-NULL NULL 1
-0.00 2
-0.00 <--------30 characters-------> 3
-0.00 ---äÖüß@µ*$-- 4
--1.00 -1 5
--3333.33 -3333.3333 28
-Warnings:
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as decimal(37,2)) AS `CAST(my_binary_30 AS DECIMAL(37,2))`,`t1_values`.`my_binary_30` AS `my_binary_30`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
-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(37,2)) my_binary_30 id
-NULL NULL 1
-0.00
-0.00 <--------30 characters-------> 3
-0.00 ---äÖüß@µ*$--
--1.00 -1
--3333.33 -3333.3333
-Warnings:
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning 1292 Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning 1292 Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-DROP VIEW v1;
-
-
-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(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(37,2)) my_varchar_1000 id
-NULL NULL 1
-0.00 2
-0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0.00 ---äÖüß@µ*$-- 4
--1.00 -1 5
--3333.33 -3333.3333 27
-Warnings:
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
-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(37,2)) my_varchar_1000 id
-NULL NULL 1
-0.00 2
-0.00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-0.00 ---äÖüß@µ*$-- 4
--1.00 -1 5
--3333.33 -3333.3333 27
-Warnings:
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ''
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-DROP VIEW v1;
-
-
-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(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(37,2)) my_char_30 id
-NULL NULL 1
-0.00 2
-0.00 <--------30 characters-------> 3
-0.00 ---äÖüß@µ*$-- 4
--1.00 -1 5
--3333.33 -3333.3333 26
-Warnings:
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' '
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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(37,2)) my_char_30 id
-NULL NULL 1
-0.00 2
-0.00 <--------30 characters-------> 3
-0.00 ---äÖüß@µ*$-- 4
--1.00 -1 5
--3333.33 -3333.3333 26
-Warnings:
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' '
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning 1366 Incorrect decimal value: '' for column '' at row -1
-Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_year AS TIME),
-my_year, id FROM t1_values;
-SELECT CAST(my_year AS TIME),
-my_year, id FROM t1_values
-WHERE select_id = 58 OR select_id IS NULL order by id;
-CAST(my_year AS TIME) my_year id
-NULL NULL 1
-00:19:01 1901 2
-00:21:55 2155 3
-00:20:00 2000 4
-00:20:05 2005 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_year AS TIME) my_year id
-NULL NULL 1
-00:19:01 1901 2
-00:21:55 2155 3
-00:20:00 2000 4
-00:20:05 2005 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_time AS TIME),
-my_time, id FROM t1_values;
-SELECT CAST(my_time AS TIME),
-my_time, id FROM t1_values
-WHERE select_id = 57 OR select_id IS NULL order by id;
-CAST(my_time AS TIME) my_time id
-NULL NULL 1
--838:59:59 -838:59:59 2
-838:59:59 838:59:59 3
-13:00:00 13:00:00 4
-10:00:00 10:00:00 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_time AS TIME) my_time id
-NULL NULL 1
--838:59:59 -838:59:59 2
-838:59:59 838:59:59 3
-13:00:00 13:00:00 4
-10:00:00 10:00:00 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_timestamp AS TIME),
-my_timestamp, id FROM t1_values;
-SELECT CAST(my_timestamp AS TIME),
-my_timestamp, id FROM t1_values
-WHERE select_id = 56 OR select_id IS NULL order by id;
-CAST(my_timestamp AS TIME) my_timestamp id
-00:00:00 0000-00-00 00:00:00 1
-03:00:01 1970-01-01 03:00:01 2
-02:59:59 2038-01-01 02:59:59 3
-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 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;
-CAST(my_timestamp AS TIME) my_timestamp id
-00:00:00 0000-00-00 00:00:00 1
-03:00:01 1970-01-01 03:00:01 2
-02:59:59 2038-01-01 02:59:59 3
-23:59:59 2004-02-29 23:59:59 4
-10:00:00 2005-06-28 10:00:00 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_date AS TIME),
-my_date, id FROM t1_values;
-SELECT CAST(my_date AS TIME),
-my_date, id FROM t1_values
-WHERE select_id = 55 OR select_id IS NULL order by id;
-CAST(my_date AS TIME) my_date id
-NULL NULL 1
-00:00:00 0001-01-01 2
-00:00:00 9999-12-31 3
-00:00:00 2004-02-29 4
-00:00:00 2005-06-28 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_date AS TIME) my_date id
-NULL NULL 1
-00:00:00 0001-01-01 2
-00:00:00 9999-12-31 3
-00:00:00 2004-02-29 4
-00:00:00 2005-06-28 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_datetime AS TIME),
-my_datetime, id FROM t1_values;
-SELECT CAST(my_datetime AS TIME),
-my_datetime, id FROM t1_values
-WHERE select_id = 54 OR select_id IS NULL order by id;
-CAST(my_datetime AS TIME) my_datetime id
-NULL NULL 1
-00:00:00 0001-01-01 00:00:00 2
-23:59:59 9999-12-31 23:59:59 3
-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 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;
-CAST(my_datetime AS TIME) my_datetime id
-NULL NULL 1
-00:00:00 0001-01-01 00:00:00 2
-23:59:59 9999-12-31 23:59:59 3
-23:59:59 2004-02-29 23:59:59 4
-10:00:00 2005-06-28 10:00:00 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_double AS TIME),
-my_double, id FROM t1_values;
-SELECT CAST(my_double AS TIME),
-my_double, id FROM t1_values
-WHERE select_id = 53 OR select_id IS NULL order by id;
-CAST(my_double AS TIME) my_double id
-NULL NULL 1
-NULL -1.7976931348623e308 2
-NULL 1.7976931348623e308 3
-00:00:00 0 4
--00:00:01 -1 5
-00:17:58 1758 25
-Warnings:
-Warning 1292 Truncated incorrect time value: '-1.7976931348623e308'
-Warning 1292 Truncated incorrect time value: '1.7976931348623e308'
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as 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;
-CAST(my_double AS TIME) my_double id
-NULL NULL 1
-NULL -1.7976931348623e308 2
-NULL 1.7976931348623e308 3
-00:00:00 0 4
--00:00:01 -1 5
-00:17:58 1758 25
-Warnings:
-Warning 1292 Truncated incorrect time value: '-1.7976931348623e308'
-Warning 1292 Truncated incorrect time value: '1.7976931348623e308'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_bigint AS TIME),
-my_bigint, id FROM t1_values;
-SELECT CAST(my_bigint AS TIME),
-my_bigint, id FROM t1_values
-WHERE select_id = 52 OR select_id IS NULL order by id;
-CAST(my_bigint AS TIME) my_bigint id
-NULL NULL 1
-NULL -9223372036854775808 2
-NULL 9223372036854775807 3
-00:00:00 0 4
--00:00:01 -1 5
-00:17:58 1758 24
-Warnings:
-Warning 1292 Truncated incorrect time value: '-9223372036854775808'
-Warning 1292 Truncated incorrect time value: '9223372036854775807'
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_bigint AS TIME) my_bigint id
-NULL NULL 1
-NULL -9223372036854775808 2
-NULL 9223372036854775807 3
-00:00:00 0 4
--00:00:01 -1 5
-00:17:58 1758 24
-Warnings:
-Warning 1292 Truncated incorrect time value: '-9223372036854775808'
-Warning 1292 Truncated incorrect time value: '9223372036854775807'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS TIME),
-my_varbinary_1000, id FROM t1_values;
-SELECT CAST(my_varbinary_1000 AS TIME),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 51 OR select_id IS NULL order by id;
-CAST(my_varbinary_1000 AS TIME) my_varbinary_1000 id
-NULL NULL 1
-NULL 2
-00:00:00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
--00:00:00 ---äÖüß@µ*$-- 4
--00:00:01 -1 5
-41:58:00 1 17:58 23
-Warnings:
-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 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;
-CAST(my_varbinary_1000 AS TIME) my_varbinary_1000 id
-NULL NULL 1
-NULL 2
-00:00:00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
--00:00:00 ---äÖüß@µ*$-- 4
--00:00:01 -1 5
-41:58:00 1 17:58 23
-Warnings:
-Warning 1292 Truncated incorrect time value: ''
-Warning 1292 Truncated incorrect time value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS TIME),
-my_binary_30, id FROM t1_values;
-SELECT CAST(my_binary_30 AS TIME),
-my_binary_30, id FROM t1_values
-WHERE select_id = 50 OR select_id IS NULL order by id;
-CAST(my_binary_30 AS TIME) my_binary_30 id
-NULL NULL 1
-00:00:00 2
-00:00:00 <--------30 characters-------> 3
--00:00:00 ---äÖüß@µ*$-- 4
-NULL -1 5
-41:58:00 1 17:58 22
-Warnings:
-Warning 1292 Truncated incorrect time value: ''
-Warning 1292 Truncated incorrect time value: '<--------30 characters------->'
-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 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;
-CAST(my_binary_30 AS TIME) my_binary_30 id
-NULL NULL 1
-00:00:00
-00:00:00 <--------30 characters-------> 3
--00:00:00 ---äÖüß@µ*$--
-NULL -1
-41:58:00 1 17:58
-Warnings:
-Warning 1292 Truncated incorrect time value: ''
-Warning 1292 Truncated incorrect time value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
-Warning 1292 Truncated incorrect time value: '-1'
-Warning 1292 Truncated incorrect time value: '1 17:58'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS TIME),
-my_varchar_1000, id FROM t1_values;
-SELECT CAST(my_varchar_1000 AS TIME),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 49 OR select_id IS NULL order by id;
-CAST(my_varchar_1000 AS TIME) my_varchar_1000 id
-NULL NULL 1
-NULL 2
-00:00:00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
--00:00:00 ---äÖüß@µ*$-- 4
--00:00:01 -1 5
-41:58:00 1 17:58 21
-Warnings:
-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 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;
-CAST(my_varchar_1000 AS TIME) my_varchar_1000 id
-NULL NULL 1
-NULL 2
-00:00:00 <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
--00:00:00 ---äÖüß@µ*$-- 4
--00:00:01 -1 5
-41:58:00 1 17:58 21
-Warnings:
-Warning 1292 Truncated incorrect time value: ''
-Warning 1292 Truncated incorrect time value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$-- '
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_char_30 AS TIME),
-my_char_30, id FROM t1_values;
-SELECT CAST(my_char_30 AS TIME),
-my_char_30, id FROM t1_values
-WHERE select_id = 48 OR select_id IS NULL order by id;
-CAST(my_char_30 AS TIME) my_char_30 id
-NULL NULL 1
-NULL 2
-00:00:00 <--------30 characters-------> 3
--00:00:00 ---äÖüß@µ*$-- 4
--00:00:01 -1 5
-41:58:00 1 17:58 20
-Warnings:
-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 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;
-CAST(my_char_30 AS TIME) my_char_30 id
-NULL NULL 1
-NULL 2
-00:00:00 <--------30 characters-------> 3
--00:00:00 ---äÖüß@µ*$-- 4
--00:00:01 -1 5
-41:58:00 1 17:58 20
-Warnings:
-Warning 1292 Truncated incorrect time value: ''
-Warning 1292 Truncated incorrect time value: '<--------30 characters------->'
-Warning 1292 Truncated incorrect time value: ' ---äÖüß@µ*$--'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_year AS DATETIME),
-my_year, id FROM t1_values;
-SELECT CAST(my_year AS DATETIME),
-my_year, id FROM t1_values
-WHERE select_id = 47 OR select_id IS NULL order by id;
-CAST(my_year AS DATETIME) my_year id
-NULL NULL 1
-NULL 1901 2
-NULL 2155 3
-NULL 2000 4
-NULL 2005 5
-Warnings:
-Warning 1292 Incorrect datetime value: '1901'
-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 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;
-CAST(my_year AS DATETIME) my_year id
-NULL NULL 1
-NULL 1901 2
-NULL 2155 3
-NULL 2000 4
-NULL 2005 5
-Warnings:
-Warning 1292 Incorrect datetime value: '1901'
-Warning 1292 Incorrect datetime value: '2155'
-Warning 1292 Incorrect datetime value: '2000'
-Warning 1292 Incorrect datetime value: '2005'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_time AS DATETIME),
-my_time, id FROM t1_values;
-SELECT CAST(my_time AS DATETIME),
-my_time, id FROM t1_values
-WHERE select_id = 46 OR select_id IS NULL order by id;
-CAST(my_time AS DATETIME) my_time id
-NULL NULL 1
-0000-00-00 00:00:00 -838:59:59 2
-0000-00-00 00:00:00 838:59:59 3
-0000-00-00 13:00:00 13:00:00 4
-0000-00-00 10:00:00 10:00:00 5
-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 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;
-CAST(my_time AS DATETIME) my_time id
-NULL NULL 1
-0000-00-00 00:00:00 -838:59:59 2
-0000-00-00 00:00:00 838:59:59 3
-0000-00-00 13:00:00 13:00:00 4
-0000-00-00 10:00:00 10:00:00 5
-Warnings:
-Warning 1292 Incorrect datetime value: '0000-00-00 838:59:59'
-Warning 1292 Incorrect datetime value: '0000-00-00 838:59:59'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_timestamp AS DATETIME),
-my_timestamp, id FROM t1_values;
-SELECT CAST(my_timestamp AS DATETIME),
-my_timestamp, id FROM t1_values
-WHERE select_id = 45 OR select_id IS NULL order by id;
-CAST(my_timestamp AS DATETIME) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
-1970-01-01 03:00:01 1970-01-01 03:00:01 2
-2038-01-01 02:59:59 2038-01-01 02:59:59 3
-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 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;
-CAST(my_timestamp AS DATETIME) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
-1970-01-01 03:00:01 1970-01-01 03:00:01 2
-2038-01-01 02:59:59 2038-01-01 02:59:59 3
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_date AS DATETIME),
-my_date, id FROM t1_values;
-SELECT CAST(my_date AS DATETIME),
-my_date, id FROM t1_values
-WHERE select_id = 44 OR select_id IS NULL order by id;
-CAST(my_date AS DATETIME) my_date id
-NULL NULL 1
-0001-01-01 00:00:00 0001-01-01 2
-9999-12-31 00:00:00 9999-12-31 3
-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 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;
-CAST(my_date AS DATETIME) my_date id
-NULL NULL 1
-0001-01-01 00:00:00 0001-01-01 2
-9999-12-31 00:00:00 9999-12-31 3
-2004-02-29 00:00:00 2004-02-29 4
-2005-06-28 00:00:00 2005-06-28 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_datetime AS DATETIME),
-my_datetime, id FROM t1_values;
-SELECT CAST(my_datetime AS DATETIME),
-my_datetime, id FROM t1_values
-WHERE select_id = 43 OR select_id IS NULL order by id;
-CAST(my_datetime AS DATETIME) my_datetime id
-NULL NULL 1
-0001-01-01 00:00:00 0001-01-01 00:00:00 2
-9999-12-31 23:59:59 9999-12-31 23:59:59 3
-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 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;
-CAST(my_datetime AS DATETIME) my_datetime id
-NULL NULL 1
-0001-01-01 00:00:00 0001-01-01 00:00:00 2
-9999-12-31 23:59:59 9999-12-31 23:59:59 3
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_double AS DATETIME),
-my_double, id FROM t1_values;
-SELECT CAST(my_double AS DATETIME),
-my_double, id FROM t1_values
-WHERE select_id = 42 OR select_id IS NULL order by id;
-CAST(my_double AS DATETIME) my_double id
-NULL NULL 1
-NULL -1.7976931348623e308 2
-NULL 1.7976931348623e308 3
-NULL 0 4
-NULL -1 5
-NULL 200506271758 19
-Warnings:
-Warning 1292 Incorrect datetime value: '-1.7976931348623e308'
-Warning 1292 Incorrect datetime value: '1.7976931348623e308'
-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 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;
-CAST(my_double AS DATETIME) my_double id
-NULL NULL 1
-NULL -1.7976931348623e308 2
-NULL 1.7976931348623e308 3
-NULL 0 4
-NULL -1 5
-NULL 200506271758 19
-Warnings:
-Warning 1292 Incorrect datetime value: '-1.7976931348623e308'
-Warning 1292 Incorrect datetime value: '1.7976931348623e308'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
-Warning 1292 Incorrect datetime value: '200506271758'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_bigint AS DATETIME),
-my_bigint, id FROM t1_values;
-SELECT CAST(my_bigint AS DATETIME),
-my_bigint, id FROM t1_values
-WHERE select_id = 41 OR select_id IS NULL order by id;
-CAST(my_bigint AS DATETIME) my_bigint id
-NULL NULL 1
-NULL -9223372036854775808 2
-NULL 9223372036854775807 3
-NULL 0 4
-NULL -1 5
-NULL 200506271758 18
-Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-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 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;
-CAST(my_bigint AS DATETIME) my_bigint id
-NULL NULL 1
-NULL -9223372036854775808 2
-NULL 9223372036854775807 3
-NULL 0 4
-NULL -1 5
-NULL 200506271758 18
-Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
-Warning 1292 Incorrect datetime value: '200506271758'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS DATETIME),
-my_varbinary_1000, id FROM t1_values;
-SELECT CAST(my_varbinary_1000 AS DATETIME),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 40 OR select_id IS NULL order by id;
-CAST(my_varbinary_1000 AS DATETIME) my_varbinary_1000 id
-NULL NULL 1
-NULL 2
-NULL <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 17:58:00 2005-06-27 17:58 17
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-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 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;
-CAST(my_varbinary_1000 AS DATETIME) my_varbinary_1000 id
-NULL NULL 1
-NULL 2
-NULL <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 17:58:00 2005-06-27 17:58 17
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-Warning 1292 Incorrect datetime value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
-Warning 1292 Incorrect datetime value: '-1'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS DATETIME),
-my_binary_30, id FROM t1_values;
-SELECT CAST(my_binary_30 AS DATETIME),
-my_binary_30, id FROM t1_values
-WHERE select_id = 39 OR select_id IS NULL order by id;
-CAST(my_binary_30 AS DATETIME) my_binary_30 id
-NULL NULL 1
-NULL 2
-NULL <--------30 characters-------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 17:58:00 2005-06-27 17:58 16
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-Warning 1292 Incorrect datetime value: '<--------30 characters------->'
-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 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;
-CAST(my_binary_30 AS DATETIME) my_binary_30 id
-NULL NULL 1
-NULL
-NULL <--------30 characters-------> 3
-NULL ---äÖüß@µ*$--
-NULL -1
-2005-06-27 17:58:00 2005-06-27 17:58
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-Warning 1292 Incorrect datetime value: '<--------30 characters------->'
-Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
-Warning 1292 Incorrect datetime value: '-1'
-Warning 1292 Truncated incorrect datetime value: '2005-06-27 17:58'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS DATETIME),
-my_varchar_1000, id FROM t1_values;
-SELECT CAST(my_varchar_1000 AS DATETIME),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 38 OR select_id IS NULL order by id;
-CAST(my_varchar_1000 AS DATETIME) my_varchar_1000 id
-NULL NULL 1
-NULL 2
-NULL <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 17:58:00 2005-06-27 17:58 15
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-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 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;
-CAST(my_varchar_1000 AS DATETIME) my_varchar_1000 id
-NULL NULL 1
-NULL 2
-NULL <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 17:58:00 2005-06-27 17:58 15
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-Warning 1292 Incorrect datetime value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
-Warning 1292 Incorrect datetime value: '-1'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_char_30 AS DATETIME),
-my_char_30, id FROM t1_values;
-SELECT CAST(my_char_30 AS DATETIME),
-my_char_30, id FROM t1_values
-WHERE select_id = 37 OR select_id IS NULL order by id;
-CAST(my_char_30 AS DATETIME) my_char_30 id
-NULL NULL 1
-NULL 2
-NULL <--------30 characters-------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 17:58:00 2005-06-27 17:58 14
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-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 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;
-CAST(my_char_30 AS DATETIME) my_char_30 id
-NULL NULL 1
-NULL 2
-NULL <--------30 characters-------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 17:58:00 2005-06-27 17:58 14
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-Warning 1292 Incorrect datetime value: '<--------30 characters------->'
-Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$--'
-Warning 1292 Incorrect datetime value: '-1'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_year AS DATE),
-my_year, id FROM t1_values;
-SELECT CAST(my_year AS DATE),
-my_year, id FROM t1_values
-WHERE select_id = 36 OR select_id IS NULL order by id;
-CAST(my_year AS DATE) my_year id
-NULL NULL 1
-NULL 1901 2
-NULL 2155 3
-NULL 2000 4
-NULL 2005 5
-Warnings:
-Warning 1292 Incorrect datetime value: '1901'
-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 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;
-CAST(my_year AS DATE) my_year id
-NULL NULL 1
-NULL 1901 2
-NULL 2155 3
-NULL 2000 4
-NULL 2005 5
-Warnings:
-Warning 1292 Incorrect datetime value: '1901'
-Warning 1292 Incorrect datetime value: '2155'
-Warning 1292 Incorrect datetime value: '2000'
-Warning 1292 Incorrect datetime value: '2005'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_time AS DATE),
-my_time, id FROM t1_values;
-SELECT CAST(my_time AS DATE),
-my_time, id FROM t1_values
-WHERE select_id = 35 OR select_id IS NULL order by id;
-CAST(my_time AS DATE) my_time id
-NULL NULL 1
-0000-00-00 -838:59:59 2
-0000-00-00 838:59:59 3
-0000-00-00 13:00:00 4
-0000-00-00 10:00:00 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_time AS DATE) my_time id
-NULL NULL 1
-0000-00-00 -838:59:59 2
-0000-00-00 838:59:59 3
-0000-00-00 13:00:00 4
-0000-00-00 10:00:00 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_timestamp AS DATE),
-my_timestamp, id FROM t1_values;
-SELECT CAST(my_timestamp AS DATE),
-my_timestamp, id FROM t1_values
-WHERE select_id = 34 OR select_id IS NULL order by id;
-CAST(my_timestamp AS DATE) my_timestamp id
-0000-00-00 0000-00-00 00:00:00 1
-1970-01-01 1970-01-01 03:00:01 2
-2038-01-01 2038-01-01 02:59:59 3
-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 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;
-CAST(my_timestamp AS DATE) my_timestamp id
-0000-00-00 0000-00-00 00:00:00 1
-1970-01-01 1970-01-01 03:00:01 2
-2038-01-01 2038-01-01 02:59:59 3
-2004-02-29 2004-02-29 23:59:59 4
-2005-06-28 2005-06-28 10:00:00 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_date AS DATE),
-my_date, id FROM t1_values;
-SELECT CAST(my_date AS DATE),
-my_date, id FROM t1_values
-WHERE select_id = 33 OR select_id IS NULL order by id;
-CAST(my_date AS DATE) my_date id
-NULL NULL 1
-0001-01-01 0001-01-01 2
-9999-12-31 9999-12-31 3
-2004-02-29 2004-02-29 4
-2005-06-28 2005-06-28 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_date AS DATE) my_date id
-NULL NULL 1
-0001-01-01 0001-01-01 2
-9999-12-31 9999-12-31 3
-2004-02-29 2004-02-29 4
-2005-06-28 2005-06-28 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_datetime AS DATE),
-my_datetime, id FROM t1_values;
-SELECT CAST(my_datetime AS DATE),
-my_datetime, id FROM t1_values
-WHERE select_id = 32 OR select_id IS NULL order by id;
-CAST(my_datetime AS DATE) my_datetime id
-NULL NULL 1
-0001-01-01 0001-01-01 00:00:00 2
-9999-12-31 9999-12-31 23:59:59 3
-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 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;
-CAST(my_datetime AS DATE) my_datetime id
-NULL NULL 1
-0001-01-01 0001-01-01 00:00:00 2
-9999-12-31 9999-12-31 23:59:59 3
-2004-02-29 2004-02-29 23:59:59 4
-2005-06-28 2005-06-28 10:00:00 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_double AS DATE),
-my_double, id FROM t1_values;
-SELECT CAST(my_double AS DATE),
-my_double, id FROM t1_values
-WHERE select_id = 31 OR select_id IS NULL order by id;
-CAST(my_double AS DATE) my_double id
-NULL NULL 1
-NULL -1.7976931348623e308 2
-NULL 1.7976931348623e308 3
-NULL 0 4
-NULL -1 5
-2005-06-27 20050627 13
-Warnings:
-Warning 1292 Incorrect datetime value: '-1.7976931348623e308'
-Warning 1292 Incorrect datetime value: '1.7976931348623e308'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as 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;
-CAST(my_double AS DATE) my_double id
-NULL NULL 1
-NULL -1.7976931348623e308 2
-NULL 1.7976931348623e308 3
-NULL 0 4
-NULL -1 5
-2005-06-27 20050627 13
-Warnings:
-Warning 1292 Incorrect datetime value: '-1.7976931348623e308'
-Warning 1292 Incorrect datetime value: '1.7976931348623e308'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_bigint AS DATE),
-my_bigint, id FROM t1_values;
-SELECT CAST(my_bigint AS DATE),
-my_bigint, id FROM t1_values
-WHERE select_id = 30 OR select_id IS NULL order by id;
-CAST(my_bigint AS DATE) my_bigint id
-NULL NULL 1
-NULL -9223372036854775808 2
-NULL 9223372036854775807 3
-NULL 0 4
-NULL -1 5
-2005-06-27 20050627 12
-Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-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 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;
-CAST(my_bigint AS DATE) my_bigint id
-NULL NULL 1
-NULL -9223372036854775808 2
-NULL 9223372036854775807 3
-NULL 0 4
-NULL -1 5
-2005-06-27 20050627 12
-Warnings:
-Warning 1292 Incorrect datetime value: '-9223372036854775808'
-Warning 1292 Incorrect datetime value: '9223372036854775807'
-Warning 1292 Incorrect datetime value: '0'
-Warning 1292 Incorrect datetime value: '-1'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS DATE),
-my_varbinary_1000, id FROM t1_values;
-SELECT CAST(my_varbinary_1000 AS DATE),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 29 OR select_id IS NULL order by id;
-CAST(my_varbinary_1000 AS DATE) my_varbinary_1000 id
-NULL NULL 1
-NULL 2
-NULL <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 2005-06-27 11
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-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 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;
-CAST(my_varbinary_1000 AS DATE) my_varbinary_1000 id
-NULL NULL 1
-NULL 2
-NULL <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 2005-06-27 11
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-Warning 1292 Incorrect datetime value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
-Warning 1292 Incorrect datetime value: '-1'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS DATE),
-my_binary_30, id FROM t1_values;
-SELECT CAST(my_binary_30 AS DATE),
-my_binary_30, id FROM t1_values
-WHERE select_id = 28 OR select_id IS NULL order by id;
-CAST(my_binary_30 AS DATE) my_binary_30 id
-NULL NULL 1
-NULL 2
-NULL <--------30 characters-------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 2005-06-27 10
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-Warning 1292 Incorrect datetime value: '<--------30 characters------->'
-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 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;
-CAST(my_binary_30 AS DATE) my_binary_30 id
-NULL NULL 1
-NULL
-NULL <--------30 characters-------> 3
-NULL ---äÖüß@µ*$--
-NULL -1
-2005-06-27 2005-06-27
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-Warning 1292 Incorrect datetime value: '<--------30 characters------->'
-Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
-Warning 1292 Incorrect datetime value: '-1'
-Warning 1292 Truncated incorrect date value: '2005-06-27'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS DATE),
-my_varchar_1000, id FROM t1_values;
-SELECT CAST(my_varchar_1000 AS DATE),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 27 OR select_id IS NULL order by id;
-CAST(my_varchar_1000 AS DATE) my_varchar_1000 id
-NULL NULL 1
-NULL 2
-NULL <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 2005-06-27 9
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-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 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;
-CAST(my_varchar_1000 AS DATE) my_varchar_1000 id
-NULL NULL 1
-NULL 2
-NULL <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 2005-06-27 9
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-Warning 1292 Incorrect datetime value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
-Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$-- '
-Warning 1292 Incorrect datetime value: '-1'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_char_30 AS DATE),
-my_char_30, id FROM t1_values;
-SELECT CAST(my_char_30 AS DATE),
-my_char_30, id FROM t1_values
-WHERE select_id = 26 OR select_id IS NULL order by id;
-CAST(my_char_30 AS DATE) my_char_30 id
-NULL NULL 1
-NULL 2
-NULL <--------30 characters-------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 2005-06-27 8
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-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 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;
-CAST(my_char_30 AS DATE) my_char_30 id
-NULL NULL 1
-NULL 2
-NULL <--------30 characters-------> 3
-NULL ---äÖüß@µ*$-- 4
-NULL -1 5
-2005-06-27 2005-06-27 8
-Warnings:
-Warning 1292 Incorrect datetime value: ''
-Warning 1292 Incorrect datetime value: '<--------30 characters------->'
-Warning 1292 Incorrect datetime value: ' ---äÖüß@µ*$--'
-Warning 1292 Incorrect datetime value: '-1'
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_year AS CHAR),
-my_year, id FROM t1_values;
-SELECT CAST(my_year AS CHAR),
-my_year, id FROM t1_values
-WHERE select_id = 25 OR select_id IS NULL order by id;
-CAST(my_year AS CHAR) my_year id
-NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_year AS CHAR) my_year id
-NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_time AS CHAR),
-my_time, id FROM t1_values;
-SELECT CAST(my_time AS CHAR),
-my_time, id FROM t1_values
-WHERE select_id = 24 OR select_id IS NULL order by id;
-CAST(my_time AS CHAR) my_time id
-NULL NULL 1
--838:59:59 -838:59:59 2
-838:59:59 838:59:59 3
-13:00:00 13:00:00 4
-10:00:00 10:00:00 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_time AS CHAR) my_time id
-NULL NULL 1
--838:59:59 -838:59:59 2
-838:59:59 838:59:59 3
-13:00:00 13:00:00 4
-10:00:00 10:00:00 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_timestamp AS CHAR),
-my_timestamp, id FROM t1_values;
-SELECT CAST(my_timestamp AS CHAR),
-my_timestamp, id FROM t1_values
-WHERE select_id = 23 OR select_id IS NULL order by id;
-CAST(my_timestamp AS CHAR) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
-1970-01-01 03:00:01 1970-01-01 03:00:01 2
-2038-01-01 02:59:59 2038-01-01 02:59:59 3
-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 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;
-CAST(my_timestamp AS CHAR) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
-1970-01-01 03:00:01 1970-01-01 03:00:01 2
-2038-01-01 02:59:59 2038-01-01 02:59:59 3
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_date AS CHAR),
-my_date, id FROM t1_values;
-SELECT CAST(my_date AS CHAR),
-my_date, id FROM t1_values
-WHERE select_id = 22 OR select_id IS NULL order by id;
-CAST(my_date AS CHAR) my_date id
-NULL NULL 1
-0001-01-01 0001-01-01 2
-9999-12-31 9999-12-31 3
-2004-02-29 2004-02-29 4
-2005-06-28 2005-06-28 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_date AS CHAR) my_date id
-NULL NULL 1
-0001-01-01 0001-01-01 2
-9999-12-31 9999-12-31 3
-2004-02-29 2004-02-29 4
-2005-06-28 2005-06-28 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_datetime AS CHAR),
-my_datetime, id FROM t1_values;
-SELECT CAST(my_datetime AS CHAR),
-my_datetime, id FROM t1_values
-WHERE select_id = 21 OR select_id IS NULL order by id;
-CAST(my_datetime AS CHAR) my_datetime id
-NULL NULL 1
-0001-01-01 00:00:00 0001-01-01 00:00:00 2
-9999-12-31 23:59:59 9999-12-31 23:59:59 3
-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 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;
-CAST(my_datetime AS CHAR) my_datetime id
-NULL NULL 1
-0001-01-01 00:00:00 0001-01-01 00:00:00 2
-9999-12-31 23:59:59 9999-12-31 23:59:59 3
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_double AS CHAR),
-my_double, id FROM t1_values;
-SELECT CAST(my_double AS CHAR),
-my_double, id FROM t1_values
-WHERE select_id = 20 OR select_id IS NULL order by id;
-CAST(my_double AS CHAR) my_double id
-NULL NULL 1
--1.7976931348623e308 -1.7976931348623e308 2
-1.7976931348623e308 1.7976931348623e308 3
-0 0 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as 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;
-CAST(my_double AS CHAR) my_double id
-NULL NULL 1
--1.7976931348623e308 -1.7976931348623e308 2
-1.7976931348623e308 1.7976931348623e308 3
-0 0 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_decimal AS CHAR),
-my_decimal, id FROM t1_values;
-SELECT CAST(my_decimal AS CHAR),
-my_decimal, id FROM t1_values
-WHERE select_id = 19 OR select_id IS NULL order by id;
-CAST(my_decimal AS CHAR) my_decimal id
-NULL NULL 1
--9999999999999999999999999999999999.999999999999999999999999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999999999999999999999999999.999999999999999999999999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0.000000000000000000000000000000 0.000000000000000000000000000000 4
--1.000000000000000000000000000000 -1.000000000000000000000000000000 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as 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;
-CAST(my_decimal AS CHAR) my_decimal id
-NULL NULL 1
--9999999999999999999999999999999999.999999999999999999999999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999999999999999999999999999.999999999999999999999999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0.000000000000000000000000000000 0.000000000000000000000000000000 4
--1.000000000000000000000000000000 -1.000000000000000000000000000000 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_bigint AS CHAR),
-my_bigint, id FROM t1_values;
-SELECT CAST(my_bigint AS CHAR),
-my_bigint, id FROM t1_values
-WHERE select_id = 18 OR select_id IS NULL order by id;
-CAST(my_bigint AS CHAR) my_bigint id
-NULL NULL 1
--9223372036854775808 -9223372036854775808 2
-9223372036854775807 9223372036854775807 3
-0 0 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_bigint AS CHAR) my_bigint id
-NULL NULL 1
--9223372036854775808 -9223372036854775808 2
-9223372036854775807 9223372036854775807 3
-0 0 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS CHAR),
-my_varbinary_1000, id FROM t1_values;
-SELECT CAST(my_varbinary_1000 AS CHAR),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 17 OR select_id IS NULL order by id;
-CAST(my_varbinary_1000 AS CHAR) my_varbinary_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as 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;
-CAST(my_varbinary_1000 AS CHAR) my_varbinary_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS CHAR),
-my_binary_30, id FROM t1_values;
-SELECT CAST(my_binary_30 AS CHAR),
-my_binary_30, id FROM t1_values
-WHERE select_id = 16 OR select_id IS NULL order by id;
-CAST(my_binary_30 AS CHAR) my_binary_30 id
-NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as 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;
-CAST(my_binary_30 AS CHAR) my_binary_30 id
-NULL NULL 1
-
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$--
--1
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS CHAR),
-my_varchar_1000, id FROM t1_values;
-SELECT CAST(my_varchar_1000 AS CHAR),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 15 OR select_id IS NULL order by id;
-CAST(my_varchar_1000 AS CHAR) my_varchar_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as 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;
-CAST(my_varchar_1000 AS CHAR) my_varchar_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_char_30 AS CHAR),
-my_char_30, id FROM t1_values;
-SELECT CAST(my_char_30 AS CHAR),
-my_char_30, id FROM t1_values
-WHERE select_id = 14 OR select_id IS NULL order by id;
-CAST(my_char_30 AS CHAR) my_char_30 id
-NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as 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;
-CAST(my_char_30 AS CHAR) my_char_30 id
-NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_year AS BINARY),
-my_year, id FROM t1_values;
-SELECT CAST(my_year AS BINARY),
-my_year, id FROM t1_values
-WHERE select_id = 13 OR select_id IS NULL order by id;
-CAST(my_year AS BINARY) my_year id
-NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_year AS BINARY) my_year id
-NULL NULL 1
-1901 1901 2
-2155 2155 3
-2000 2000 4
-2005 2005 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_time AS BINARY),
-my_time, id FROM t1_values;
-SELECT CAST(my_time AS BINARY),
-my_time, id FROM t1_values
-WHERE select_id = 12 OR select_id IS NULL order by id;
-CAST(my_time AS BINARY) my_time id
-NULL NULL 1
--838:59:59 -838:59:59 2
-838:59:59 838:59:59 3
-13:00:00 13:00:00 4
-10:00:00 10:00:00 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_time AS BINARY) my_time id
-NULL NULL 1
--838:59:59 -838:59:59 2
-838:59:59 838:59:59 3
-13:00:00 13:00:00 4
-10:00:00 10:00:00 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_timestamp AS BINARY),
-my_timestamp, id FROM t1_values;
-SELECT CAST(my_timestamp AS BINARY),
-my_timestamp, id FROM t1_values
-WHERE select_id = 11 OR select_id IS NULL order by id;
-CAST(my_timestamp AS BINARY) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
-1970-01-01 03:00:01 1970-01-01 03:00:01 2
-2038-01-01 02:59:59 2038-01-01 02:59:59 3
-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 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;
-CAST(my_timestamp AS BINARY) my_timestamp id
-0000-00-00 00:00:00 0000-00-00 00:00:00 1
-1970-01-01 03:00:01 1970-01-01 03:00:01 2
-2038-01-01 02:59:59 2038-01-01 02:59:59 3
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_date AS BINARY),
-my_date, id FROM t1_values;
-SELECT CAST(my_date AS BINARY),
-my_date, id FROM t1_values
-WHERE select_id = 10 OR select_id IS NULL order by id;
-CAST(my_date AS BINARY) my_date id
-NULL NULL 1
-0001-01-01 0001-01-01 2
-9999-12-31 9999-12-31 3
-2004-02-29 2004-02-29 4
-2005-06-28 2005-06-28 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_date AS BINARY) my_date id
-NULL NULL 1
-0001-01-01 0001-01-01 2
-9999-12-31 9999-12-31 3
-2004-02-29 2004-02-29 4
-2005-06-28 2005-06-28 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_datetime AS BINARY),
-my_datetime, id FROM t1_values;
-SELECT CAST(my_datetime AS BINARY),
-my_datetime, id FROM t1_values
-WHERE select_id = 9 OR select_id IS NULL order by id;
-CAST(my_datetime AS BINARY) my_datetime id
-NULL NULL 1
-0001-01-01 00:00:00 0001-01-01 00:00:00 2
-9999-12-31 23:59:59 9999-12-31 23:59:59 3
-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 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;
-CAST(my_datetime AS BINARY) my_datetime id
-NULL NULL 1
-0001-01-01 00:00:00 0001-01-01 00:00:00 2
-9999-12-31 23:59:59 9999-12-31 23:59:59 3
-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
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_double AS BINARY),
-my_double, id FROM t1_values;
-SELECT CAST(my_double AS BINARY),
-my_double, id FROM t1_values
-WHERE select_id = 8 OR select_id IS NULL order by id;
-CAST(my_double AS BINARY) my_double id
-NULL NULL 1
--1.7976931348623e308 -1.7976931348623e308 2
-1.7976931348623e308 1.7976931348623e308 3
-0 0 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_double` as 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;
-CAST(my_double AS BINARY) my_double id
-NULL NULL 1
--1.7976931348623e308 -1.7976931348623e308 2
-1.7976931348623e308 1.7976931348623e308 3
-0 0 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_decimal AS BINARY),
-my_decimal, id FROM t1_values;
-SELECT CAST(my_decimal AS BINARY),
-my_decimal, id FROM t1_values
-WHERE select_id = 7 OR select_id IS NULL order by id;
-CAST(my_decimal AS BINARY) my_decimal id
-NULL NULL 1
--9999999999999999999999999999999999.999999999999999999999999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999999999999999999999999999.999999999999999999999999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0.000000000000000000000000000000 0.000000000000000000000000000000 4
--1.000000000000000000000000000000 -1.000000000000000000000000000000 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_decimal` as 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;
-CAST(my_decimal AS BINARY) my_decimal id
-NULL NULL 1
--9999999999999999999999999999999999.999999999999999999999999999999 -9999999999999999999999999999999999.999999999999999999999999999999 2
-9999999999999999999999999999999999.999999999999999999999999999999 9999999999999999999999999999999999.999999999999999999999999999999 3
-0.000000000000000000000000000000 0.000000000000000000000000000000 4
--1.000000000000000000000000000000 -1.000000000000000000000000000000 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_bigint AS BINARY),
-my_bigint, id FROM t1_values;
-SELECT CAST(my_bigint AS BINARY),
-my_bigint, id FROM t1_values
-WHERE select_id = 6 OR select_id IS NULL order by id;
-CAST(my_bigint AS BINARY) my_bigint id
-NULL NULL 1
--9223372036854775808 -9223372036854775808 2
-9223372036854775807 9223372036854775807 3
-0 0 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_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;
-CAST(my_bigint AS BINARY) my_bigint id
-NULL NULL 1
--9223372036854775808 -9223372036854775808 2
-9223372036854775807 9223372036854775807 3
-0 0 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varbinary_1000 AS BINARY),
-my_varbinary_1000, id FROM t1_values;
-SELECT CAST(my_varbinary_1000 AS BINARY),
-my_varbinary_1000, id FROM t1_values
-WHERE select_id = 5 OR select_id IS NULL order by id;
-CAST(my_varbinary_1000 AS BINARY) my_varbinary_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as 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;
-CAST(my_varbinary_1000 AS BINARY) my_varbinary_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_binary_30 AS BINARY),
-my_binary_30, id FROM t1_values;
-SELECT CAST(my_binary_30 AS BINARY),
-my_binary_30, id FROM t1_values
-WHERE select_id = 4 OR select_id IS NULL order by id;
-CAST(my_binary_30 AS BINARY) my_binary_30 id
-NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_binary_30` as 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;
-CAST(my_binary_30 AS BINARY) my_binary_30 id
-NULL NULL 1
-
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$--
--1
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_varchar_1000 AS BINARY),
-my_varchar_1000, id FROM t1_values;
-SELECT CAST(my_varchar_1000 AS BINARY),
-my_varchar_1000, id FROM t1_values
-WHERE select_id = 3 OR select_id IS NULL order by id;
-CAST(my_varchar_1000 AS BINARY) my_varchar_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as 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;
-CAST(my_varchar_1000 AS BINARY) my_varchar_1000 id
-NULL NULL 1
- 2
-<---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT CAST(my_char_30 AS BINARY),
-my_char_30, id FROM t1_values;
-SELECT CAST(my_char_30 AS BINARY),
-my_char_30, id FROM t1_values
-WHERE select_id = 2 OR select_id IS NULL order by id;
-CAST(my_char_30 AS BINARY) my_char_30 id
-NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_char_30` as 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;
-CAST(my_char_30 AS BINARY) my_char_30 id
-NULL NULL 1
- 2
-<--------30 characters-------> <--------30 characters-------> 3
- ---äÖüß@µ*$-- ---äÖüß@µ*$-- 4
--1 -1 5
-DROP VIEW v1;
-
-
-CREATE VIEW v1 AS SELECT sqrt(my_bigint), my_bigint, id FROM t1_values;
-SELECT sqrt(my_bigint), my_bigint, id FROM t1_values
-WHERE select_id = 1 OR select_id IS NULL order by id;
-sqrt(my_bigint) my_bigint id
-NULL NULL 1
-NULL -9223372036854775808 2
-3037000499.97605 9223372036854775807 3
-0 0 4
-NULL -1 5
-2 4 6
-NULL -25 7
-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 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;
-sqrt(my_bigint) my_bigint id
-NULL NULL 1
-NULL -9223372036854775808 2
-3037000499.97605 9223372036854775807 3
-0 0 4
-NULL -1 5
-2 4 6
-NULL -25 7
-DROP VIEW v1;
-
-
-DROP TABLE t1_selects, t1_modes, t1_values;
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result
deleted file mode 100644
index 3e2d084aa0c..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_02.result
+++ /dev/null
@@ -1,1398 +0,0 @@
-
---source suite/funcs_1/storedproc/load_sp_tb.inc
---------------------------------------------------------------------------------
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-CREATE DATABASE db_storedproc;
-CREATE DATABASE db_storedproc_1;
-USE db_storedproc;
-create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
-create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
-create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
-create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
-USE db_storedproc_1;
-create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
-USE db_storedproc;
-create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
-create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
-create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
-
-Section 3.1.2 - Syntax checks for the stored procedure-specific
-programming statements BEGIN/END, DECLARE, SET, SELECT/INTO, OPEN, FETCH, CLOSE:
---------------------------------------------------------------------------------
-
-Testcase 3.1.2.8:
------------------
-
-Ensure that the scope of each BEGIN/END compound statement within a stored
-procedure definition is properly applied
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-begin_label: BEGIN
-declare x char DEFAULT 'x';
-declare y char DEFAULT 'y';
-set x = '1';
-set y = '2';
-label1: BEGIN
-declare x char DEFAULT 'X';
-declare y char DEFAULT 'Y';
-SELECT f1, f2 into x, y from t2 limit 1;
-SELECT '1.1', x, y;
-label2: BEGIN
-declare x char default 'a';
-declare y char default 'b';
-label3: BEGIN
-declare x char default 'c';
-declare y char default 'd';
-label4: BEGIN
-declare x char default 'e';
-declare y char default 'f';
-label5: BEGIN
-declare x char default 'g';
-declare y char default 'h';
-SELECT 5, x, y;
-END label5;
-SELECT 4, x, y;
-END label4;
-SELECT 3, x, y;
-END label3;
-SELECT 2, x, y;
-END label2;
-END label1;
-set @v1 = x;
-set @v2 = y;
-SELECT '1.2', @v1, @v2;
-END begin_label//
-CALL sp1();
-1.1 x y
-1.1 a a
-5 x y
-5 g h
-4 x y
-4 e f
-3 x y
-3 c d
-2 x y
-2 a b
-1.2 @v1 @v2
-1.2 1 2
-Warnings:
-Warning 1265 Data truncated for column 'x' at row 1
-Warning 1265 Data truncated for column 'y' at row 1
-DROP PROCEDURE IF EXISTS sp1;
-
-Testcase 3.1.2.26:
-------------------
-
-Ensure that the initial value of every variable declared for a stored procedure
-is either NULL or its DEFAULT value, as appropriate.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-set @v1=0;
-set @v2=0;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x1 char default 'x';
-declare y1 char;
-declare x2 tinytext default 'tinytext';
-declare y2 tinytext;
-declare x3 datetime default '2005-10-03 12:13:14';
-declare y3 datetime;
-declare x4 float default 1.2;
-declare y4 float;
-declare x5 blob default 'b';
-declare y5 blob;
-declare x6 smallint default 127;
-declare y6 smallint;
-SELECT x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6;
-END//
-CALL sp1();
-x1 x2 x3 x4 x5 x6 y1 y2 y3 y4 y5 y6
-x tinytext 2005-10-03 12:13:14 1.2 b 127 NULL NULL NULL NULL NULL NULL
-DROP PROCEDURE sp1;
-
-Testcase 3.1.2.30:
-------------------
-
-Ensure that, when a stored procedure is called/executed, every variable always
-uses the correct value: either the value with which it is initialized or the
-value to which it is subsequently SET or otherwise assigned, as appropriate.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( IN invar INT, OUT outvar INT )
-BEGIN
-declare x integer;
-declare y integer default 1;
-set @x = x;
-set @y = y;
-set @z = 234;
-SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
-SELECT @x, @y, @z, invar;
-BEGIN
-set @x = 2;
-SELECT @x, @y, @z;
-SET outvar = @x * invar + @z * @f;
-SET invar = outvar;
-BEGIN
-set @y = null, @z = 'abcd';
-SELECT @x, @y, @z;
-END;
-END;
-END//
-SET @invar = 100;
-SET @outvar = @invar;
-SET @f = 10;
-SELECT @x, @y, @z, @invar, @outvar;
-@x @y @z @invar @outvar
-NULL NULL NULL 100 100
-CALL sp1( @invar, @outvar );
-@x @y @z invar
-a` a` 234 100
-@x @y @z
-2 a` 234
-@x @y @z
-2 NULL abcd
-SELECT @x, @y, @z, @invar, @outvar;
-@x @y @z @invar @outvar
-2 NULL abcd 100 2540
-DROP PROCEDURE sp1;
-
-Testcase 3.1.2.31:
-------------------
-
-Ensure that the SELECT ... INTO statement properly assigns values to the
-variables in its variable list.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x integer; declare y integer;
-set @x=x;
-set @y=y;
-SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
-SELECT @x, @y;
-END//
-CALL sp1();
-@x @y
--5000 1000-01-01
-DROP PROCEDURE sp1;
-
-Testcase 3.1.2.32:
-------------------
-
-Ensure that a SELECT ... INTO statement that retrieves multiple rows is
-rejected, with an appropriate error message.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x integer; declare y integer;
-set @x=x;
-set @y=y;
-SELECT f4, f3 into @x, @y from t2;
-END//
-CALL sp1();
-ERROR 42000: Result consisted of more than one row
-DROP PROCEDURE sp1;
-
-Testcase 3.1.2.33:
-------------------
-
-Ensure that a SELECT ... INTO statement that retrieves too many columns for the
-number of variables in its variable list is rejected, with an appropriate error
-message.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x integer; declare y integer;
-set @x=x;
-set @y=y;
-SELECT f4, f3, f2, f1 into @x, @y from t2;
-END//
-CALL sp1();
-ERROR 21000: The used SELECT statements have a different number of columns
-DROP PROCEDURE sp1;
-
-Testcase 3.1.2.34:
-------------------
-
-Ensure that a SELECT ... INTO statement that retrieves too few columns for the
-number of variables in its variable list is rejected, with an appropriate error
-message.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-CREATE PROCEDURE sp1( )
-BEGIN
-declare x integer; declare y integer; declare z integer;
-set @x=x;
-set @y=y;
-set @z=z;
-SELECT f4 into @x, @y, @z from t2;
-END//
-CALL sp1();
-ERROR 21000: The used SELECT statements have a different number of columns
-DROP PROCEDURE sp1;
-
-Testcase 3.1.2.38:
-------------------
-
-Ensure that the scope of every condition declared is properly applied.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP TABLE IF EXISTS res_t1;
-create table res_t1(w char unique, x char);
-insert into res_t1 values('a', 'b');
-CREATE PROCEDURE h1 ()
-BEGIN
-declare x1, x2, x3, x4, x5, x6 int default 0;
-SELECT '-1-', x1, x2, x3, x4, x5, x6;
-BEGIN
-declare condname condition for sqlstate '23000';
-declare continue handler for condname set x5 = 1;
-set x6 = 0;
-insert into res_t1 values ('a', 'b');
-set x6 = 1;
-SELECT '-2-', x1, x2, x3, x4, x5, x6;
-END;
-begin1_label: BEGIN
-BEGIN
-declare condname condition for sqlstate '20000';
-declare continue handler for condname set x1 = 1;
-set x2 = 0;
-case x2
-when 1 then set x2=10;
-when 2 then set x2=11;
-END case;
-set x2 = 1;
-SELECT '-3-', x1, x2, x3, x4, x5, x6;
-begin2_label: BEGIN
-BEGIN
-declare condname condition for sqlstate '23000';
-declare exit handler for condname set x3 = 1;
-set x4= 1;
-SELECT '-4a', x1, x2, x3, x4, x5, x6;
-insert into res_t1 values ('a', 'b');
-set x4= 2;
-SELECT '-4b', x1, x2, x3, x4, x5, x6;
-END;
-SELECT '-5-', x1, x2, x3, x4, x5, x6;
-END begin2_label;
-SELECT '-6-', x1, x2, x3, x4, x5, x6;
-END;
-SELECT '-7-', x1, x2, x3, x4, x5, x6;
-END begin1_label;
-SELECT 'END', x1, x2, x3, x4, x5, x6;
-END//
-CALL h1();
--1- x1 x2 x3 x4 x5 x6
--1- 0 0 0 0 0 0
--2- x1 x2 x3 x4 x5 x6
--2- 0 0 0 0 1 1
--3- x1 x2 x3 x4 x5 x6
--3- 1 1 0 0 1 1
--4a x1 x2 x3 x4 x5 x6
--4a 1 1 0 1 1 1
--5- x1 x2 x3 x4 x5 x6
--5- 1 1 1 1 1 1
--6- x1 x2 x3 x4 x5 x6
--6- 1 1 1 1 1 1
--7- x1 x2 x3 x4 x5 x6
--7- 1 1 1 1 1 1
-END x1 x2 x3 x4 x5 x6
-END 1 1 1 1 1 1
-DROP TABLE IF EXISTS tnull;
-DROP PROCEDURE IF EXISTS sp1;
-CREATE TABLE tnull(f1 int);
-CREATE PROCEDURE sp1()
-BEGIN
-declare cond1 condition for sqlstate '42S02';
-declare continue handler for cond1 set @var2 = 1;
-BEGIN
-declare cond1 condition for sqlstate '23000';
-declare continue handler for cond1 set @var2 = 1;
-END;
-insert into tnull values(1);
-END//
-CALL sp1();
-DROP PROCEDURE h1;
-drop table res_t1;
-DROP PROCEDURE sp1;
-DROP TABLE tnull;
-
-Testcase 3.1.2.43:
-------------------
-
-Ensure that the DECLARE ... HANDLER FOR statement can not declare any handler
-for a condition declared outside of the scope of the handler.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS h2;
-drop table IF EXISTS res_t1;
-create table res_t1(w char unique, x char);
-insert into res_t1 values ('a', 'b');
-CREATE PROCEDURE h1 ()
-BEGIN
-declare x1, x2, x3, x4, x5, x6 int default 0;
-BEGIN
-declare cond_1 condition for sqlstate '23000';
-declare continue handler for cond_1 set x5 = 1;
-BEGIN
-declare cond_2 condition for sqlstate '20000';
-declare continue handler for cond_1 set x1 = 1;
-BEGIN
-declare continue handler for cond_2 set x3 = 1;
-set x2 = 1;
-END;
-set x6 = 0;
-END;
-BEGIN
-declare continue handler for cond_1 set x1 = 1;
-BEGIN
-declare continue handler for cond_2 set x3 = 1;
-set x2 = 1;
-END;
-set x6 = 0;
-END;
-END;
-SELECT x1, x2, x3, x4, x5, x6;
-END//
-ERROR 42000: Undefined CONDITION: cond_2
-CREATE PROCEDURE h2 ()
-BEGIN
-declare x1, x2, x3, x4, x5, x6 int default 0;
-BEGIN
-declare condname condition for sqlstate '23000';
-declare continue handler for condname set x5 = 1;
-BEGIN
-declare condname condition for sqlstate '20000';
-declare continue handler for condname set x1 = 1;
-BEGIN
-declare condname condition for sqlstate '42000';
-declare continue handler for condname set x3 = 1;
-set x6 = 0;
-insert into res_t1 values ('a', 'b');
-set x6 = 1;
-set x4= 0;
-CALL sp1();
-set x4= 1;
-set x2 = 0;
-case x2
-when 1 then set x2=10;
-when 2 then set x2=11;
-END case;
-set x2 = 1;
-END;
-set x2 = 0;
-case x2
-when 1 then set x2=10;
-when 2 then set x2=11;
-END case;
-set x2 = 1;
-set x6 = 0;
-insert into res_t1 values ('a', 'b');
-set x6 = 1;
-END;
-END;
-SELECT x1, x2, x3, x4, x5, x6;
-END//
-CALL h2();
-x1 x2 x3 x4 x5 x6
-1 1 1 1 1 1
-SELECT * FROM res_t1;
-w x
-a b
-DROP PROCEDURE h2;
-drop table res_t1;
-
-Testcase 3.1.2.44:
-------------------
-
-Ensure that the DECLARE ... HANDLER FOR statement cannot declare a handler for
-any invalid, or undeclared, condition.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS h1;
-CREATE PROCEDURE h1 ()
-BEGIN
-declare x1, x2, x3, x4, x5, x6 int default 0;
-BEGIN
-declare condname1 condition for sqlstate '23000';
-BEGIN
-declare condname2 condition for sqlstate '20000';
-declare continue handler for condname1 set x3 = 1;
-declare continue handler for condname2 set x1 = 1;
-END;
-END;
-BEGIN
-declare condname3 condition for sqlstate '42000';
-declare continue handler for condname1 set x3 = 1;
-declare continue handler for condname2 set x5 = 1;
-declare continue handler for condname3 set x1 = 1;
-END;
-END//
-ERROR 42000: Undefined CONDITION: condname1
-CREATE PROCEDURE h1 ()
-BEGIN
-DECLARE x1 INT DEFAULT 0;
-BEGIN
-DECLARE condname1 CONDITION CHECK SQLSTATE '23000';
-END;
-DECLARE CONTINUE HANDLER FOR condname1 SET x1 = 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 'CHECK SQLSTATE '23000';
-END;
-DECLARE CONTINUE HANDLER FOR condname1 SET x1 = 1;
-' at line 5
-CREATE PROCEDURE h1 ()
-BEGIN
-DECLARE x1 INT DEFAULT 0;
-BEGIN
-DECLARE condname1 CONDITION FOR SQLSTATE 'qwert';
-END;
-DECLARE CONTINUE HANDLER FOR condname1 SET x1 = 1;
-END//
-ERROR 42000: Bad SQLSTATE: 'qwert'
-
-Testcase 3.1.2.45 + 3.1.2.50:
------------------------------
-
-45. Ensure that the scope of every handler declared is properly applied.
-50. Ensure that a CONTINUE handler allows the execution of the stored procedure
-. to continue once the handler statement has completed its own execution (that
-. is, once the handler action statement has been executed).
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS p1undo;
-DROP PROCEDURE IF EXISTS h1;
-DROP PROCEDURE IF EXISTS sp1;
-drop table IF EXISTS res_t1;
-==> 'UNDO' is still not supported.
-create procedure p1undo ()
-begin
-declare undo handler for sqlexception select '1';
-select * from tqq;
-SELECT 'end of 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 'undo handler for sqlexception select '1';
-select * from tqq;
-SELECT 'end of 1';
-' at line 3
-create procedure p1 ()
-begin
-declare exit handler for sqlexception select 'exit handler 1';
-begin
-declare exit handler for sqlexception select 'exit handler 2';
-begin
-declare continue handler for sqlexception select 'continue handler 3';
-drop table if exists tqq;
-select * from tqq;
-SELECT 'end of BEGIN/END 3';
-end;
-drop table if exists tqq;
-select * from tqq;
-SELECT 'end of BEGIN/END 2';
-end;
-select * from tqq;
-SELECT 'end of BEGIN/END 1';
-end;//
-call p1()//
-continue handler 3
-continue handler 3
-end of BEGIN/END 3
-end of BEGIN/END 3
-exit handler 2
-exit handler 2
-exit handler 1
-exit handler 1
-create table res_t1(w char unique, x char);
-insert into res_t1 values ('a', 'b');
-CREATE PROCEDURE h1 ()
-BEGIN
-declare x1, x2, x3, x4, x5, x6 int default 0;
-BEGIN
-declare continue handler for sqlstate '23000' set x5 = 1;
-insert into res_t1 values ('a', 'b');
-set x6 = 1;
-END;
-begin1_label: BEGIN
-BEGIN
-declare continue handler for sqlstate '23000' set x1 = 1;
-insert into res_t1 values ('a', 'b');
-set x2 = 1;
-begin2_label: BEGIN
-BEGIN
-declare exit handler for sqlstate '23000' set x3 = 1;
-set x4= 1;
-insert into res_t1 values ('a', 'b');
-set x4= 0;
-END;
-END begin2_label;
-END;
-END begin1_label;
-SELECT x1, x2, x3, x4, x5, x6;
-END//
-CALL h1();
-x1 x2 x3 x4 x5 x6
-1 1 1 1 1 1
-This will fail, SQLSTATE 00000 is not allowed
-CREATE PROCEDURE sp1()
-begin1_label:BEGIN
-declare exit handler for sqlstate '00000' set @var1 = 5;
-set @var2 = 6;
-begin2_label:BEGIN
-declare continue handler for sqlstate '00000' set @var3 = 7;
-set @var4 = 8;
-SELECT @var3, @var4;
-END begin2_label;
-SELECT @var1, @var2;
-END begin1_label//
-ERROR 42000: Bad SQLSTATE: '00000'
-Verify SP wasn't created
-CALL sp1();
-ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
-DROP PROCEDURE p1;
-DROP PROCEDURE h1;
-DROP PROCEDURE IF EXISTS sp1;
-DROP TABLE res_t1;
-
-Testcase 3.1.2.50:
-------------------
-DROP PROCEDURE IF EXISTS sp1;
-DROP PROCEDURE IF EXISTS sp2;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @y=0;
-END//
-CREATE PROCEDURE sp2 ()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 1;
-set @x=1;
-SELECT @x2;
-CALL sp1(1);
-set @x=2;
-SELECT @x2, @x;
-END//
-CALL sp2();
-@x2
-NULL
-@x2 @x
-1 2
-DROP PROCEDURE sp1;
-DROP PROCEDURE sp2;
-
-Testcase 3.2.2.51:
-------------------
-
-Ensure that an EXIT handler causes the execution of the stored procedure to
-terminate, within its scope, once the handler action statement has been
-executed.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-DROP PROCEDURE IF EXISTS sp2;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @x=0;
-END//
-CREATE PROCEDURE sp2 ()
-BEGIN
-declare exit handler for sqlstate '42000' set @x2 = 1;
-set @x2=0;
-set @x=1;
-SELECT '-1-', @x2, @x;
-CALL sp1(1);
-SELECT '-2-', @x2, @x;
-set @x=2;
-END//
-CALL sp1(1);
-ERROR 42000: Incorrect number of arguments for PROCEDURE db_storedproc.sp1; expected 2, got 1
-CALL sp2();
--1- @x2 @x
--1- 0 1
-SELECT '-3-', @x2, @x;
--3- @x2 @x
--3- 1 1
-DROP PROCEDURE sp1;
-DROP PROCEDURE sp2;
-
-Testcase 3.1.2.52:
-------------------
-
-Ensure that an EXIT handler does not cause the execution of the stored procedure
-to terminate outside of its scope.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-DROP PROCEDURE IF EXISTS sp2;
-CREATE PROCEDURE sp1 (x int, y int)
-BEGIN
-set @x=0;
-END//
-CREATE PROCEDURE sp2()
-BEGIN
-declare continue handler for sqlstate '42000' set @x2 = 2;
-set @x2 = 1;
-set @x =20;
-SELECT '-1-', @x2, @x;
-BEGIN
-declare exit handler for sqlstate '42000' set @x2 = 11;
-SELECT '-2-', @x2, @x;
-CALL sp1(1);
-SELECT '-3a', @x2, @x;
-set @x=21;
-SELECT '-3b', @x2, @x;
-END;
-set @x=22;
-SELECT '-4-', @x2, @x;
-END//
-CALL sp2();
--1- @x2 @x
--1- 1 20
--2- @x2 @x
--2- 1 20
--4- @x2 @x
--4- 11 22
-DROP PROCEDURE sp1;
-DROP PROCEDURE sp2;
-
-Testcase 3.1.2.54:
-------------------
-
-Ensure that a handler with a condition defined with an SQLSTATE that begins with
-“01“ is always exactly equivalent in action to a handler with an SQLWARNING
-condition.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp0;
-DROP PROCEDURE IF EXISTS sp1;
-DROP PROCEDURE IF EXISTS sp2;
-DROP PROCEDURE IF EXISTS sp3;
-DROP PROCEDURE IF EXISTS sp4;
-DROP TABLE IF EXISTS temp;
-CREATE TABLE temp( f1 CHAR, f2 CHAR);
-CREATE PROCEDURE sp0()
-BEGIN
-set @done=0;
-set @x=0;
-insert into temp values('xxx', 'yy');
-set @x=1;
-END//
-CREATE PROCEDURE sp1()
-BEGIN
-declare continue handler for sqlstate '01000' set @done = 1;
-set @done=0;
-set @x=0;
-insert into temp values('xxx', 'yy');
-set @x=1;
-END//
-CREATE PROCEDURE sp2()
-BEGIN
-declare continue handler for sqlwarning set @done = 1;
-set @done=0;
-set @x=0;
-insert into temp values('xxx', 'yy');
-set @x=1;
-END//
-CREATE PROCEDURE sp3()
-BEGIN
-declare exit handler for sqlstate '01000' set @done = 1;
-set @done=0;
-set @x=0;
-insert into temp values('xxx', 'yy');
-set @x=1;
-END//
-CREATE PROCEDURE sp4()
-BEGIN
-declare exit handler for sqlwarning set @done = 1;
-set @done=0;
-set @x=0;
-insert into temp values('xxx', 'yy');
-set @x=1;
-END//
-INSERT INTO temp VALUES('0', NULL);
-CALL sp0();
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-Warning 1265 Data truncated for column 'f2' at row 1
-SELECT @done, @x;
-@done @x
-0 1
-INSERT INTO temp VALUES('1', NULL);
-CALL sp1();
-SELECT @done, @x;
-@done @x
-1 1
-INSERT INTO temp VALUES('2', NULL);
-CALL sp2();
-SELECT @done, @x;
-@done @x
-1 1
-INSERT INTO temp VALUES('3', NULL);
-CALL sp3();
-SELECT @done, @x;
-@done @x
-1 0
-INSERT INTO temp VALUES('4', NULL);
-CALL sp4();
-SELECT @done, @x;
-@done @x
-1 0
-SELECT * FROM temp;
-f1 f2
-0 NULL
-x y
-1 NULL
-x y
-2 NULL
-x y
-3 NULL
-x y
-4 NULL
-x y
-DROP PROCEDURE sp1;
-DROP PROCEDURE sp2;
-DROP PROCEDURE sp3;
-DROP PROCEDURE sp4;
-DROP TABLE temp;
-
-Testcase 3.1.2.56:
-------------------
-
-Ensure that a handler with a condition defined with an SQLSTATE that begins with
-“02“ is always exactly equivalent in action to a handler with a NOT FOUND
-condition.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp0;
-DROP PROCEDURE IF EXISTS sp1;
-DROP PROCEDURE IF EXISTS sp2;
-DROP PROCEDURE IF EXISTS sp3;
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp0()
-BEGIN
-DECLARE f1_value CHAR(20);
-DECLARE cur1 CURSOR FOR SELECT f1 FROM t2 LIMIT 1;
-SET @done = 0;
-SET @x = 0;
-OPEN cur1;
-FETCH cur1 INTO f1_value;
-SET @x = 1;
-FETCH cur1 INTO f1_value;
-SET @x = 2;
-CLOSE cur1;
-END//
-CREATE PROCEDURE sp1()
-BEGIN
-DECLARE f1_value CHAR(20);
-DECLARE cur1 CURSOR FOR SELECT f1 FROM t2 LIMIT 1;
-declare continue handler for sqlstate '02000' set @done = 1;
-SET @done = 0;
-SET @x = 0;
-OPEN cur1;
-FETCH cur1 INTO f1_value;
-SET @x = 1;
-FETCH cur1 INTO f1_value;
-SET @x = 2;
-CLOSE cur1;
-END//
-CREATE PROCEDURE sp2()
-BEGIN
-DECLARE f1_value CHAR(20);
-DECLARE cur1 CURSOR FOR SELECT f1 FROM t2 LIMIT 1;
-declare continue handler for not found set @done = 1;
-SET @done = 0;
-SET @x = 0;
-OPEN cur1;
-FETCH cur1 INTO f1_value;
-SET @x = 1;
-FETCH cur1 INTO f1_value;
-SET @x = 2;
-CLOSE cur1;
-END//
-CREATE PROCEDURE sp3()
-BEGIN
-DECLARE f1_value CHAR(20);
-DECLARE cur1 CURSOR FOR SELECT f1 FROM t2 LIMIT 1;
-declare exit handler for sqlstate '02000' set @done = 1;
-SET @done = 0;
-SET @x = 0;
-OPEN cur1;
-FETCH cur1 INTO f1_value;
-SET @x = 1;
-FETCH cur1 INTO f1_value;
-SET @x = 2;
-CLOSE cur1;
-END//
-CREATE PROCEDURE sp4()
-BEGIN
-DECLARE f1_value CHAR(20);
-DECLARE cur1 CURSOR FOR SELECT f1 FROM t2 LIMIT 1;
-declare exit handler for not found set @done = 1;
-SET @done = 0;
-SET @x = 0;
-OPEN cur1;
-FETCH cur1 INTO f1_value;
-SET @x = 1;
-FETCH cur1 INTO f1_value;
-SET @x = 2;
-CLOSE cur1;
-END//
-CALL sp0();
-ERROR 02000: No data - zero rows fetched, selected, or processed
-SELECT @done, @x;
-@done @x
-0 1
-CALL sp1();
-SELECT @done, @x;
-@done @x
-1 2
-CALL sp2();
-SELECT @done, @x;
-@done @x
-1 2
-CALL sp3();
-SELECT @done, @x;
-@done @x
-1 1
-CALL sp4();
-SELECT @done, @x;
-@done @x
-1 1
-DROP PROCEDURE sp0;
-DROP PROCEDURE sp1;
-DROP PROCEDURE sp2;
-DROP PROCEDURE sp3;
-DROP PROCEDURE sp4;
-
-Testcase 3.1.2.58:
-------------------
-
-Ensure that a handler with a condition defined with an SQLSTATE that begins with
-anything other that “01“ or “02“ is always exactly equivalent in action to a
-handler with an SQLEXCEPTION condition.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp0;
-DROP PROCEDURE IF EXISTS sp1;
-DROP PROCEDURE IF EXISTS sp2;
-DROP PROCEDURE IF EXISTS sp3;
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp0()
-BEGIN
-DECLARE f1_value CHAR(20);
-DECLARE cv INT DEFAULT 0;
-DECLARE cur1 CURSOR FOR SELECT f1 FROM t2 LIMIT 1;
-SET @x = 1;
-CASE cv
-WHEN 2 THEN SET @x = 2;
-WHEN 3 THEN SET @x = 3;
-END case;
-SET @x = 4;
-SELECT f1, f2 FROM t2
-UNION
-SELECT f1, f2,3 FROM t2;
-SET @x = 5;
-FETCH cur1 INTO f1_value;
-SET @x = 6;
-END//
-CREATE PROCEDURE sp1()
-BEGIN
-DECLARE f1_value CHAR(20);
-DECLARE cv INT DEFAULT 0;
-DECLARE cur1 CURSOR FOR SELECT f1 FROM t2 LIMIT 1;
-DECLARE continue HANDLER FOR SQLSTATE '20000' SELECT '20000' AS 'SQLSTATE';
-DECLARE continue HANDLER FOR SQLSTATE '21000' SELECT '21000' AS 'SQLSTATE';
-DECLARE continue HANDLER FOR SQLSTATE '24000' SELECT '24000' AS 'SQLSTATE';
-SET @x = 1;
-CASE cv
-WHEN 2 THEN SET @x = 2;
-WHEN 3 THEN SET @x = 3;
-END case;
-SET @x = 4;
-SELECT f1, f2 FROM t2
-UNION
-SELECT f1, f2,3 FROM t2;
-SET @x = 5;
-FETCH cur1 INTO f1_value;
-SET @x = 6;
-END//
-CREATE PROCEDURE sp2()
-BEGIN
-DECLARE f1_value CHAR(20);
-DECLARE cv INT DEFAULT 0;
-DECLARE cur1 CURSOR FOR SELECT f1 FROM t2 LIMIT 1;
-DECLARE continue HANDLER FOR SQLEXCEPTION SELECT 'SQLEXCEPTION' AS 'SQLSTATE';
-DECLARE continue HANDLER FOR SQLSTATE '24000' SELECT '24000' AS 'SQLSTATE';
-SET @x = 1;
-CASE cv
-WHEN 2 THEN SET @x = 2;
-WHEN 3 THEN SET @x = 3;
-END case;
-SET @x = 4;
-SELECT f1, f2 FROM t2
-UNION
-SELECT f1, f2,3 FROM t2;
-SET @x = 5;
-FETCH cur1 INTO f1_value;
-SET @x = 6;
-END//
-CREATE PROCEDURE sp3()
-BEGIN
-DECLARE f1_value CHAR(20);
-DECLARE cv INT DEFAULT 0;
-DECLARE cur1 CURSOR FOR SELECT f1 FROM t2 LIMIT 1;
-DECLARE EXIT HANDLER FOR SQLSTATE '20000' SELECT '20000' AS 'SQLSTATE';
-DECLARE EXIT HANDLER FOR SQLSTATE '21000' SELECT '21000' AS 'SQLSTATE';
-DECLARE EXIT HANDLER FOR SQLSTATE '24000' SELECT '24000' AS 'SQLSTATE';
-SET @x = 1;
-CASE cv
-WHEN 2 THEN SET @x = 2;
-WHEN 3 THEN SET @x = 3;
-END case;
-SET @x = 4;
-SELECT f1, f2 FROM t2
-UNION
-SELECT f1, f2,3 FROM t2;
-SET @x = 5;
-FETCH cur1 INTO f1_value;
-SET @x = 6;
-END//
-CREATE PROCEDURE sp4()
-BEGIN
-DECLARE f1_value CHAR(20);
-DECLARE cv INT DEFAULT 0;
-DECLARE cur1 CURSOR FOR SELECT f1 FROM t2 LIMIT 1;
-DECLARE EXIT HANDLER FOR SQLEXCEPTION SELECT 'SQLEXCEPTION' AS 'SQLSTATE';
-DECLARE EXIT HANDLER FOR SQLSTATE '24000' SELECT '24000' AS 'SQLSTATE';
-SET @x = 1;
-CASE cv
-WHEN 2 THEN SET @x = 2;
-WHEN 3 THEN SET @x = 3;
-END case;
-SET @x = 4;
-SELECT f1, f2 FROM t2
-UNION
-SELECT f1, f2,3 FROM t2;
-SET @x = 5;
-FETCH cur1 INTO f1_value;
-SET @x = 6;
-CLOSE cur1;
-END//
-CALL sp0();
-ERROR 20000: Case not found for CASE statement
-SELECT '-0-', @x;
--0- @x
--0- 1
-CALL sp1();
-SQLSTATE
-20000
-SQLSTATE
-21000
-SQLSTATE
-24000
-SELECT '-1-', @x;
--1- @x
--1- 6
-CALL sp2();
-SQLSTATE
-SQLEXCEPTION
-SQLSTATE
-SQLEXCEPTION
-SQLSTATE
-24000
-SELECT '-2-', @x;
--2- @x
--2- 6
-CALL sp3();
-SQLSTATE
-20000
-SELECT '-3-', @x;
--3- @x
--3- 1
-CALL sp4();
-SQLSTATE
-SQLEXCEPTION
-SELECT '-4-', @x;
--4- @x
--4- 1
-DROP PROCEDURE sp0;
-DROP PROCEDURE sp1;
-DROP PROCEDURE sp2;
-DROP PROCEDURE sp3;
-DROP PROCEDURE sp4;
-
-Testcase 3.1.2.65:
-------------------
-
-Ensure that FETCH <cursor name> returns the first row of the cursor_s result set
-the first time FETCH is executed, that it returns each subsequent row of the
-cursor_s result set each of the subsequent times FETCH is executed, and that it
-returns a NOT FOUND warning if it is executed after the last row of the cursor_s
-result set has already been fetched.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-DROP TABLE IF EXISTS temp;
-CREATE TABLE temp(
-cnt INT,
-f1 CHAR(20),
-f2 CHAR(20),
-f3 INT,
-f4 CHAR(20),
-f5 INT);
-INSERT INTO temp VALUES(0, 'onip', 'abc', 8760, 'xyz', 10);
-CREATE PROCEDURE sp1( )
-BEGIN
-declare proceed int default 1;
-declare count integer default 1;
-declare f1_value char(20);
-declare f2_value char(20);
-declare f5_value char(20);
-declare f4_value integer;
-declare f6_value integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
-where f4 >=-5000 order by f4 limit 3;
-open cur1;
-while proceed do
-SELECT count AS 'loop';
-fetch cur1 into f1_value, f2_value, f4_value, f5_value, f6_value;
-insert into temp values (count, f1_value, f2_value, f4_value, f5_value, f6_value);
-set count = count + 1;
-END while;
-END//
-CALL sp1();
-loop
-1
-loop
-2
-loop
-3
-loop
-4
-ERROR 02000: No data - zero rows fetched, selected, or processed
-SELECT * FROM temp;
-cnt f1 f2 f3 f4 f5
-0 onip abc 8760 xyz 10
-1 a` a` -5000 a` -5000
-2 aaa aaa -4999 aaa -4999
-3 abaa abaa -4998 abaa -4998
-DROP TABLE temp;
-DROP PROCEDURE sp1;
-
-Testcase 3.1.2.68:
-------------------
-
-Ensure that FETCH <cursor name> fails with an appropriate error message if the
-number of columns to be fetched does not match the number of variables specified
-by the FETCH statement.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-DROP PROCEDURE IF EXISTS sp2;
---> not enough columns in FETCH statement
-CREATE PROCEDURE sp1( )
-BEGIN
-declare newf1 char(20);
-declare cur1 cursor for SELECT f1, f2 from t2 limit 10;
-declare continue handler for sqlstate '02000' SELECT 'HANDLER executed.' AS '';
-BEGIN
-open cur1;
-fetch cur1 into newf1;
-SELECT newf1;
-close cur1;
-END;
-END//
---> too many columns in FETCH statement
-CREATE PROCEDURE sp2( )
-BEGIN
-declare newf1 char(20);
-declare newf2 char(20);
-declare cur1 cursor for SELECT f1 from t2 limit 10;
-declare continue handler for sqlstate '02000' SELECT 'HANDLER executed.' AS '';
-BEGIN
-open cur1;
-fetch cur1 into newf1, newf2;
-SELECT newf1, newf2;
-close cur1;
-END;
-END//
---> not enough columns in FETCH statement
-CALL sp1();
-ERROR HY000: Incorrect number of FETCH variables
---> too many columns in FETCH statement
-CALL sp2();
-ERROR HY000: Incorrect number of FETCH variables
-DROP PROCEDURE sp1;
-DROP PROCEDURE sp2;
-
-Testcase 3.1.2.75:
-------------------
-
-Ensure that, for nested compound statements, a cursor that was declared and
-opened during an outer level of the statement is not closed when an inner level
-of a compound statement ends.
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS temp1;
-DROP PROCEDURE IF EXISTS sp1;
-create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
-SELECT f1, f2, f4, f5 from t2 order by f4;
-f1 f2 f4 f5
-a` a` -5000 a`
-aaa aaa -4999 aaa
-abaa abaa -4998 abaa
-acaaa acaaa -4997 acaaa
-adaaaa adaaaa -4996 adaaaa
-aeaaaaa aeaaaaa -4995 aeaaaaa
-afaaaaaa afaaaaaa -4994 afaaaaaa
-agaaaaaaa agaaaaaaa -4993 agaaaaaaa
-a^aaaaaaaa a^aaaaaaaa -4992 a^aaaaaaaa
-a_aaaaaaaaa a_aaaaaaaaa -4991 a_aaaaaaaaa
-CREATE PROCEDURE sp1( )
-BEGIN
-declare count integer;
-declare from0 char(20);
-declare newf1 char(20);
-declare newf2 char(20);
-declare newf5 char(20);
-declare newf4 integer;
-declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
-declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
-open cur1;
-open cur2;
-BEGIN
-declare continue handler for sqlstate '02000' set count = 1;
-fetch cur1 into newf1, newf2, newf4, newf5;
-SELECT '-1-', count, newf1, newf2, newf4, newf5;
-insert into temp1 values ('cur1_out', newf1, newf2, newf4, newf5);
-set count = 4;
-BEGIN
-while count > 0 do
-fetch cur1 into newf1, newf2, newf4, newf5;
-SELECT '-2-', count, newf1, newf2, newf4, newf5;
-set count = count - 1;
-END while;
-SELECT '-3-', count, newf1, newf2, newf4, newf4;
-END;
-BEGIN
-fetch cur1 into newf1, newf2, newf4, newf5;
-SELECT '-4-', newf1, newf2, newf4, newf5;
-insert into temp1 values ('cur1_in', newf1, newf2, newf4, newf5);
-END;
-fetch cur2 into newf1, newf2, newf4, newf5;
-SELECT '-5-', newf1, newf2, newf4, newf5;
-insert into temp1 values ('cur2', newf1, newf2, newf4, newf5);
-close cur1;
-END;
-fetch cur2 into newf1, newf2, newf4, newf5;
-SELECT '-6-', newf1, newf2, newf4, newf5;
-close cur2;
-END//
-CALL sp1();
--1- count newf1 newf2 newf4 newf5
--1- NULL a` a` -5000 a`
--2- count newf1 newf2 newf4 newf5
--2- 4 aaa aaa -4999 aaa
--2- count newf1 newf2 newf4 newf5
--2- 3 abaa abaa -4998 abaa
--2- count newf1 newf2 newf4 newf5
--2- 2 acaaa acaaa -4997 acaaa
--2- count newf1 newf2 newf4 newf5
--2- 1 adaaaa adaaaa -4996 adaaaa
--3- count newf1 newf2 newf4 newf4
--3- 0 adaaaa adaaaa -4996 -4996
--4- newf1 newf2 newf4 newf5
--4- adaaaa adaaaa -4996 adaaaa
--5- newf1 newf2 newf4 newf5
--5- a` a` -5000 a`
--6- newf1 newf2 newf4 newf5
--6- aaa aaa -4999 aaa
-SELECT * from temp1;
-f0 f1 f2 f3 f4
-cur1_out a` a` -5000 a`
-cur1_in adaaaa adaaaa -4996 adaaaa
-cur2 a` a` -5000 a`
-DROP PROCEDURE sp1;
-drop table temp1;
-
-Testcase 3.1.2.76:
-------------------
-
-Ensure that all cursors operate asensitively, so that there is no concurrency
-conflict between cursors operating on the same, or similar, sets of results
-during execution of one or more stored procedures.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-drop table IF EXISTS temp1;
-drop table IF EXISTS temp2;
-create table temp1( f0 char(10), cnt int, f1 char(20), f2 char(20), f3 date, f4 integer );
-create table temp2( f0 char(10), cnt int, f1 char(20), f2 char(20), f3 date, f4 integer );
-CREATE PROCEDURE sp_inner( )
-BEGIN
-declare proceed int default 1;
-declare i_count integer default 20;
-declare i_newf1 char(20);
-declare i_newf2 char(20);
-declare i_newf3 date;
-declare i_newf4 integer;
-declare i_newf11 char(20);
-declare i_newf12 char(20);
-declare i_newf13 date;
-declare i_newf14 integer;
-declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
-where f4>=-5000 order by f4 limit 4;
-declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
-where f4>=-5000 order by f4 limit 3;
-declare continue handler for sqlstate '02000' set proceed=0;
-open cur1;
-open cur2;
-set i_count = 10;
-while proceed do
-fetch cur1 into i_newf1, i_newf2, i_newf3, i_newf4;
-IF proceed THEN
-insert into temp1 values ('sp_inner', i_count, i_newf1, i_newf2, i_newf3, i_newf4);
-fetch cur2 into i_newf11, i_newf12, i_newf13, i_newf14;
-IF proceed THEN
-insert into temp2 values ('sp_inner', i_count, i_newf11, i_newf12, i_newf13, i_newf14);
-END IF;
-END IF;
-set i_count = i_count - 1;
-END while;
-close cur1;
-close cur2;
-END//
-CREATE PROCEDURE sp_outer( )
-BEGIN
-DECLARE proceed INT DEFAULT 1;
-DECLARE o_count INTEGER DEFAULT 20;
-DECLARE o_newf1 CHAR(20);
-DECLARE o_newf2 CHAR(20);
-DECLARE o_newf3 DATE;
-DECLARE o_newf4 INTEGER;
-DECLARE o_newf11 CHAR(20);
-DECLARE o_newf12 CHAR(20);
-DECLARE o_newf13 DATE;
-DECLARE o_newf14 INTEGER;
-DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
-WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
-DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
-WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
-DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
-OPEN cur1;
-OPEN cur2;
-SET o_count = 1;
-WHILE proceed DO
-FETCH cur1 INTO o_newf1, o_newf2, o_newf3, o_newf4;
-IF proceed THEN
-INSERT INTO temp1 VALUES ('_sp_out_', o_count, o_newf1, o_newf2, o_newf3, o_newf4);
-CALL sp_inner();
-FETCH cur2 INTO o_newf11, o_newf12, o_newf13, o_newf14;
-IF proceed THEN
-INSERT INTO temp2 VALUES ('_sp_out_', o_count, o_newf11, o_newf12, o_newf13, o_newf14);
-END IF;
-END IF;
-SET o_count = o_count + 1;
-END WHILE;
-CLOSE cur1;
-CLOSE cur2;
-END//
-CALL sp_outer();
-SELECT * FROM temp1;
-f0 cnt f1 f2 f3 f4
-_sp_out_ 1 a` a` 1000-01-01 -5000
-sp_inner 10 a` a` 1000-01-01 -5000
-sp_inner 9 aaa aaa 1000-01-02 -4999
-sp_inner 8 abaa abaa 1000-01-03 -4998
-sp_inner 7 acaaa acaaa 1000-01-04 -4997
-_sp_out_ 2 aaa aaa 1000-01-02 -4999
-sp_inner 10 a` a` 1000-01-01 -5000
-sp_inner 9 aaa aaa 1000-01-02 -4999
-sp_inner 8 abaa abaa 1000-01-03 -4998
-sp_inner 7 acaaa acaaa 1000-01-04 -4997
-_sp_out_ 3 abaa abaa 1000-01-03 -4998
-sp_inner 10 a` a` 1000-01-01 -5000
-sp_inner 9 aaa aaa 1000-01-02 -4999
-sp_inner 8 abaa abaa 1000-01-03 -4998
-sp_inner 7 acaaa acaaa 1000-01-04 -4997
-_sp_out_ 4 acaaa acaaa 1000-01-04 -4997
-sp_inner 10 a` a` 1000-01-01 -5000
-sp_inner 9 aaa aaa 1000-01-02 -4999
-sp_inner 8 abaa abaa 1000-01-03 -4998
-sp_inner 7 acaaa acaaa 1000-01-04 -4997
-_sp_out_ 5 adaaaa adaaaa 1000-01-05 -4996
-sp_inner 10 a` a` 1000-01-01 -5000
-sp_inner 9 aaa aaa 1000-01-02 -4999
-sp_inner 8 abaa abaa 1000-01-03 -4998
-sp_inner 7 acaaa acaaa 1000-01-04 -4997
-SELECT * FROM temp2;
-f0 cnt f1 f2 f3 f4
-sp_inner 10 a` a` 1000-01-01 -5000
-sp_inner 9 aaa aaa 1000-01-02 -4999
-sp_inner 8 abaa abaa 1000-01-03 -4998
-_sp_out_ 1 a` a` 1000-01-01 -5000
-sp_inner 10 a` a` 1000-01-01 -5000
-sp_inner 9 aaa aaa 1000-01-02 -4999
-sp_inner 8 abaa abaa 1000-01-03 -4998
-_sp_out_ 2 aaa aaa 1000-01-02 -4999
-sp_inner 10 a` a` 1000-01-01 -5000
-sp_inner 9 aaa aaa 1000-01-02 -4999
-sp_inner 8 abaa abaa 1000-01-03 -4998
-_sp_out_ 3 abaa abaa 1000-01-03 -4998
-sp_inner 10 a` a` 1000-01-01 -5000
-sp_inner 9 aaa aaa 1000-01-02 -4999
-sp_inner 8 abaa abaa 1000-01-03 -4998
-_sp_out_ 4 acaaa acaaa 1000-01-04 -4997
-sp_inner 10 a` a` 1000-01-01 -5000
-sp_inner 9 aaa aaa 1000-01-02 -4999
-sp_inner 8 abaa abaa 1000-01-03 -4998
-_sp_out_ 5 adaaaa adaaaa 1000-01-05 -4996
-DROP PROCEDURE sp_outer;
-DROP PROCEDURE sp_inner;
-DROP TABLE temp1;
-DROP TABLE temp2;
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-
-. +++ END OF SCRIPT +++
---------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_03.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_03.result
deleted file mode 100644
index fdbe03e17fc..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_03.result
+++ /dev/null
@@ -1,496 +0,0 @@
-
---source suite/funcs_1/storedproc/load_sp_tb.inc
---------------------------------------------------------------------------------
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-CREATE DATABASE db_storedproc;
-CREATE DATABASE db_storedproc_1;
-USE db_storedproc;
-create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
-create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
-create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
-create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
-USE db_storedproc_1;
-create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
-USE db_storedproc;
-create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
-create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
-create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
-
-Section 3.1.3 - Syntax checks for the stored procedure-specific flow
-control statements IF, CASE, LOOP, LEAVE, ITERATE, REPEAT, WHILE:
---------------------------------------------------------------------------------
-
-Testcase 3.1.3.7:
------------------
-
-Ensure that the IF statement acts correctly for all variants, including cases
-where statements are nested.
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp9;
-CREATE TABLE res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 CHAR(20), f2 VARCHAR(20), f3 SMALLINT);
-CREATE PROCEDURE sp9( action char(20), subaction char(20) )
-BEGIN
-if action = 'action' then
-if subaction = 'subaction' then
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'action', 'subaction' , 1);
-else
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'action', 'none' , 2);
-END if;
-else
-if subaction = 'subaction'
- then
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'none', 'subaction' , 3);
-elseif subaction = 'subaction1'
- then
-BEGIN
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values ('none', 'subaction1', 4);
-END;
-else
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'none', 'none' , 5);
-END if;
-END if;
-END//
-CALL sp9( 'action', 'subaction' );
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742 where f3=1;
-f1 f2 f3
-action subaction 1
-CALL sp9( 'temp', 'subaction' );
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742 where f3=3;
-f1 f2 f3
-none subaction 3
-CALL sp9( 'temp', 'subaction1' );
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742 where f3=4;
-f1 f2 f3
-none subaction1 4
-CALL sp9( 'action', 'temp' );
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742 where f3=2;
-f1 f2 f3
-action none 2
-CALL sp9( 'temp', 'temp' );
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742 where f3=5;
-f1 f2 f3
-none none 5
-DROP PROCEDURE sp9;
-DROP TABLE res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 3.1.3.8.:
-------------------
-
-Ensure that the CASE statement acts correctly for all variants, including cases
-where statements are nested.
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp10;
-create table res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 char(20), f2 varchar(20), f3 smallint);
-CREATE PROCEDURE sp10( action char(20), subaction char(20) )
-BEGIN
-case action
-when 'action' then
-case
-when subaction = 'subaction_1' then
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'action', 'subaction_2' , 1);
-when subaction = 'subaction_2' then
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'action', 'subaction_2' , 2);
-else
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'action', 'none' , 3);
-END case;
-else
-case
-when subaction = 'subaction_1' then
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'none', 'subaction_1' , 4);
-when subaction = 'subaction_2' then
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'none', 'subaction_2' , 5);
-else
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'none', 'none' , 6);
-END case;
-END case;
-END//
-CALL sp10( 'action', 'subaction_1' );
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-action subaction_2 1
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CALL sp10( 'action', 'subaction_2' );
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-action subaction_2 2
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CALL sp10( 'temp', 'subaction_1' );
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-none subaction_1 4
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CALL sp10( 'temp', 'subaction_2' );
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-none subaction_2 5
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CALL sp10( 'action', 'temp' );
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-action none 3
-delete from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CALL sp10( 'temp', 'temp' );
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-none none 6
-DROP PROCEDURE sp10;
-DROP TABLE res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 3.1.3.9 + 3.1.3.15:
-----------------------------
-
-09. Ensure that the LOOP statement acts correctly for all variants, including
-. cases where statements are nested.
-15. Ensure that the LEAVE statement acts correctly for all variants, including
-. cases where statements are nested.
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-DROP PROCEDURE IF EXISTS sp11;
-CREATE TABLE res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 CHAR(20), f2 VARCHAR(20), f3 SMALLINT);
-CREATE PROCEDURE sp11( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-label1: loop
-if count2 > 3 then leave label1;
-END if;
-set count1 = 1;
-label2: loop
-if count1 > 4 then leave label2;
-END if;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-set count1 = count1 + 1;
-iterate label2;
-END loop label2;
-set count2 = count2 + 1;
-iterate label1;
-END loop label1;
-END//
-CALL sp11();
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-xyz pqr 1
-xyz pqr 2
-xyz pqr 3
-xyz pqr 4
-xyz pqr 1
-xyz pqr 2
-xyz pqr 3
-xyz pqr 4
-xyz pqr 1
-xyz pqr 2
-xyz pqr 3
-xyz pqr 4
-DROP PROCEDURE sp11;
-DROP TABLE res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 3.1.3.16:
-------------------
-
-Ensure that the ITERATE statement acts correctly for all variants, including
-cases where statements are nested.
-(tests for this testcase are also included in other testcases)
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp31316;
-CREATE PROCEDURE sp31316( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-label1: loop
-if count2 > 3 then leave label1;
-END if;
-set count1 = 1;
-label2: loop
-if count1 > 4 then leave label2;
-END if;
-insert into temp values( count1, count2);
-set count1 = count1 + 1;
-iterate label3;
-END loop label2;
-set count2 = count2 + 1;
-iterate label1;
-END loop label1;
-END//
-ERROR 42000: ITERATE with no matching label: label3
-
-Testcase 3.1.3.18:
-------------------
-
-Ensure that the REPEAT statement acts correctly for all variants, including
-cases where statements are nested.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp17;
-DROP TABLE IF EXISTS res_t3_itisalongname_1381742_itsaverylongname_1381742;
-CREATE TABLE res_t3_itisalongname_1381742_itsaverylongname_1381742( f1 CHAR(20), f2 VARCHAR(20), f3 SMALLINT);
-CREATE PROCEDURE sp17( )
-BEGIN
-declare count1 integer default 1;
-declare count2 integer default 1;
-repeat
-set count1 = count1 + 1;
-set count2 = 1;
-label1: repeat
-set count2 = count2 + 1;
-insert into res_t3_itisalongname_1381742_itsaverylongname_1381742 values( 'xyz' , 'pqr', count1);
-until count2 > 3
-END repeat label1;
-until count1 > 3
-END repeat;
-END//
-CALL sp17();
-SELECT * from res_t3_itisalongname_1381742_itsaverylongname_1381742;
-f1 f2 f3
-xyz pqr 2
-xyz pqr 2
-xyz pqr 2
-xyz pqr 3
-xyz pqr 3
-xyz pqr 3
-xyz pqr 4
-xyz pqr 4
-xyz pqr 4
-DROP PROCEDURE sp17;
-DROP TABLE res_t3_itisalongname_1381742_itsaverylongname_1381742;
-
-Testcase 3.1.3.24:
-------------------
-
-Ensure that the WHILE statement acts correctly for all variants, including cases
-where statements are nested.
---------------------------------------------------------------------------------
-drop table IF EXISTS res_t21;
-DROP PROCEDURE IF EXISTS sp21;
-create table res_t21(name text(10), surname blob(20), age_averylongfieldname_averylongname_1234569 smallint);
-insert into res_t21 values('ashwin', 'mokadam', 25);
-CREATE PROCEDURE sp21( )
-BEGIN
-declare count1 integer default 0;
-declare count2 integer default 0;
-while count1 < 3 do
-BEGIN
-declare ithisissamevariablename int default 100;
-SELECT ithisissamevariablename;
-BEGIN
-declare ithisissamevariablename int default 200;
-SELECT ithisissamevariablename;
-END;
-set count2 = 0;
-label1: while count2 < 3 do
-BEGIN
-declare count1 integer default 7;
-set count2 = count2 + 1;
-insert into res_t21 values( 'xyz' , 'pqr', count2);
-label2: while count1 < 10 do
-set count1 = count1 + 1;
-insert into res_t21 values( 'xyz' , 'pqr', count1);
-END while label2;
-END;
-END while label1;
-set count1 = count1 + 1;
-END;
-END while;
-END//
-CALL sp21();
-ithisissamevariablename
-100
-ithisissamevariablename
-200
-ithisissamevariablename
-100
-ithisissamevariablename
-200
-ithisissamevariablename
-100
-ithisissamevariablename
-200
-SELECT * from res_t21;
-name surname age_averylongfieldname_averylongname_1234569
-ashwin mokadam 25
-xyz pqr 1
-xyz pqr 8
-xyz pqr 9
-xyz pqr 10
-xyz pqr 2
-xyz pqr 8
-xyz pqr 9
-xyz pqr 10
-xyz pqr 3
-xyz pqr 8
-xyz pqr 9
-xyz pqr 10
-xyz pqr 1
-xyz pqr 8
-xyz pqr 9
-xyz pqr 10
-xyz pqr 2
-xyz pqr 8
-xyz pqr 9
-xyz pqr 10
-xyz pqr 3
-xyz pqr 8
-xyz pqr 9
-xyz pqr 10
-xyz pqr 1
-xyz pqr 8
-xyz pqr 9
-xyz pqr 10
-xyz pqr 2
-xyz pqr 8
-xyz pqr 9
-xyz pqr 10
-xyz pqr 3
-xyz pqr 8
-xyz pqr 9
-xyz pqr 10
-DROP PROCEDURE sp21;
-drop table res_t21;
-
-Testcase 3.1.3.30:
-------------------
-
-Ensure that multiple cases of all possible combinations of the control flow
-statements, nested within multiple compound statements within a stored
-procedure, always act correctly and return the expected result.
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS res_tbl;
-DROP PROCEDURE IF EXISTS sp31330;
-create table res_tbl (f1 int, f2 text, f3 blob, f4 date,
-f5 set('one', 'two', 'three', 'four', 'five') default 'one');
-CREATE PROCEDURE sp31330 (path int)
-BEGIN
-declare count int default 1;
-declare var1 text;
-declare var2 blob;
-declare var3 date;
-declare var4 set('one', 'two', 'three', 'four', 'five') DEFAULT 'five';
-case
-when path=1 then
-set var3 = '2000-11-09';
-set var1 = 'flowing through case 1';
-label1: loop
-if count > 5 then
-if var4=1000 then
-set var2 = 'exiting out of case 1 - invalid SET';
-END if;
-if var4='two' then
-set var2 = 'exiting out of case 1';
-END if;
-insert into res_tbl values (1, var1, var2, var3, (count-2));
-leave label1;
-elseif count = 5 then
-set count= count + 2;
-set var4='two';
-iterate label1;
-else
-set count= count + 1;
-END if;
-set var4='one';
-END loop label1;
-when path=2 then
-set var3 = '1989-11-09';
-set var1 = 'flowing through case 2';
-set @count3=0;
-label2: repeat
-set count=count + 1;
-set @count2=1;
-while @count2 <= 5 do
-set @count2 = @count2 + 1;
-END while;
-SELECT @count2;
-set @count3=@count3 + @count2;
-until count > 5
-END repeat label2;
-set var2 = 'exiting out of case 2';
-set var4 = count-3;
-SELECT @count3;
-insert into res_tbl values (2, var1, var2, var3, var4);
-ELSE BEGIN
-set @error_opt='undefined path specified';
-SELECT @error_opt;
-END;
-END case;
-END//
-CALL sp31330();
-ERROR 42000: Incorrect number of arguments for PROCEDURE db_storedproc.sp31330; expected 1, got 0
-CALL sp31330(1);
-SELECT * from res_tbl;
-f1 f2 f3 f4 f5
-1 flowing through case 1 exiting out of case 1 2000-11-09 one,three
-CALL sp31330(2);
-@count2
-6
-@count2
-6
-@count2
-6
-@count2
-6
-@count2
-6
-@count3
-30
-SELECT * from res_tbl;
-f1 f2 f3 f4 f5
-1 flowing through case 1 exiting out of case 1 2000-11-09 one,three
-2 flowing through case 2 exiting out of case 2 1989-11-09 one,two
-CALL sp31330(4);
-@error_opt
-undefined path specified
-DROP PROCEDURE sp31330;
-drop table res_tbl;
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-
-. +++ END OF SCRIPT +++
---------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result
deleted file mode 100644
index ee1548fe012..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_06.result
+++ /dev/null
@@ -1,395 +0,0 @@
-
---source suite/funcs_1/storedproc/load_sp_tb.inc
---------------------------------------------------------------------------------
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-CREATE DATABASE db_storedproc;
-CREATE DATABASE db_storedproc_1;
-USE db_storedproc;
-create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
-create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
-create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
-create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
-USE db_storedproc_1;
-create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
-USE db_storedproc;
-create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
-create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
-create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
-
-Section 3.1.6 - Privilege Checks:
---------------------------------------------------------------------------------
-USE db_storedproc_1;
-
-root@localhost db_storedproc_1
-
-Testcase 3.1.6.1:
------------------
-Ensure that no user may create a stored procedure without the GRANT CREATE
-ROUTINE privilege.
---------------------------------------------------------------------------------
-create user 'user_1'@'localhost';
-grant all on db_storedproc_1.* to 'user_1'@'localhost';
-revoke create routine on db_storedproc_1.* from 'user_1'@'localhost';
-flush privileges;
-DROP PROCEDURE IF EXISTS sp1;
-
-user_1@localhost db_storedproc_1
-USE db_storedproc_1;
-CREATE PROCEDURE sp1(v1 char(20))
-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';
-
-user_1@localhost db_storedproc_1
-USE db_storedproc_1;
-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';
-DROP PROCEDURE sp1;
-
-Testcase 3.1.6.2:
------------------
-Ensure that root always has the GRANT CREATE ROUTINE privilege.
-(checked by other testscases)
---------------------------------------------------------------------------------
-grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
-flush privileges;
-
-user_1@localhost db_storedproc_1
-DROP PROCEDURE IF EXISTS sp3;
-DROP FUNCTION IF EXISTS fn1;
-CREATE PROCEDURE sp3(v1 char(20))
-BEGIN
-SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
-END//
-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';
-DROP PROCEDURE sp3;
-DROP FUNCTION fn1;
-Warnings:
-Warning 1403 There is no such grant defined for user 'user_1' on host 'localhost' on routine 'fn1'
-
-Testcase 3.1.6.4:
------------------
-Ensure that the default security provision of a stored procedure is SQL SECURITY
-DEFINER.
---------------------------------------------------------------------------------
-CREATE USER 'user_1'@'localhost';
-grant update on db_storedproc_1.t6 to 'user_1'@'localhost';
-grant execute on db_storedproc_1.* to 'user_1'@'localhost';
-flush privileges;
-USE db_storedproc_1;
-DROP PROCEDURE IF EXISTS sp4;
-CREATE PROCEDURE sp4(v1 char(20))
-BEGIN
-SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
-END//
-
-user_1@localhost db_storedproc_1
-USE db_storedproc_1;
-CALL sp4('a');
-f1 f2 f3 f4 f5 f6
-SELECT SPECIFIC_NAME, ROUTINE_SCHEMA, ROUTINE_NAME, ROUTINE_TYPE,
-ROUTINE_BODY, ROUTINE_DEFINITION, IS_DETERMINISTIC,
-SQL_DATA_ACCESS, SECURITY_TYPE, SQL_MODE, ROUTINE_COMMENT
-FROM information_schema.routines
-WHERE routine_schema LIKE 'db_sto%';
-SPECIFIC_NAME sp4
-ROUTINE_SCHEMA db_storedproc_1
-ROUTINE_NAME sp4
-ROUTINE_TYPE PROCEDURE
-ROUTINE_BODY SQL
-ROUTINE_DEFINITION NULL
-IS_DETERMINISTIC NO
-SQL_DATA_ACCESS CONTAINS SQL
-SECURITY_TYPE DEFINER
-SQL_MODE
-ROUTINE_COMMENT
-
-root@localhost db_storedproc_1
-DROP PROCEDURE sp4;
-DROP USER 'user_1'@'localhost';
-
-Testcase 3.1.6.5:
------------------
-Ensure that a stored procedure defined with SQL SECURITY DEFINER can be
-called/executed by any user, using only the privileges (including database
-access privileges) associated with the user who created the stored procedure.
---------------------------------------------------------------------------------
-USE db_storedproc_1;
-CREATE TABLE t3165 ( c1 char(20), c2 char(20), c3 date);
-INSERT INTO t3165 VALUES ('inserted', 'outside of SP', NULL);
-create user 'user_1'@'localhost';
-create user 'user_2'@'localhost';
-grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
-grant SELECT on db_storedproc_1.* to 'user_2'@'localhost';
-grant execute on db_storedproc_1.* to 'user_2'@'localhost';
-flush privileges;
-
-user_1@localhost db_storedproc_1
-CREATE PROCEDURE sp5_s_i () sql security definer
-BEGIN
-SELECT * from db_storedproc_1.t3165;
-insert into db_storedproc_1.t3165 values ('inserted', 'from sp5_s_i', 1000);
-END//
-CREATE PROCEDURE sp5_sel () sql security definer
-BEGIN
-SELECT * from db_storedproc_1.t3165;
-END//
-CREATE PROCEDURE sp5_ins () sql security definer
-BEGIN
-insert into db_storedproc_1.t3165 values ('inserted', 'from sp5_ins', 1000);
-END//
-
-user_2@localhost db_storedproc_1
-CALL sp5_s_i();
-ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
-CALL sp5_ins();
-ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't3165'
-CALL sp5_sel();
-ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
-
-root@localhost db_storedproc_1
-CALL sp5_sel();
-ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
-grant insert on db_storedproc_1.* to 'user_1'@'localhost';
-flush privileges;
-
-user_2@localhost db_storedproc_1
-CALL sp5_s_i();
-ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
-CALL sp5_ins();
-CALL sp5_sel();
-ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
-
-root@localhost db_storedproc_1
-CALL sp5_sel();
-ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
-grant SELECT on db_storedproc_1.* to 'user_1'@'localhost';
-flush privileges;
-
-user_2@localhost db_storedproc_1
-CALL sp5_s_i();
-c1 c2 c3
-inserted outside of SP NULL
-inserted from sp5_ins 2000-10-00
-CALL sp5_ins();
-CALL sp5_sel();
-c1 c2 c3
-inserted outside of SP NULL
-inserted from sp5_ins 2000-10-00
-inserted from sp5_s_i 2000-10-00
-inserted from sp5_ins 2000-10-00
-
-root@localhost db_storedproc_1
-REVOKE INSERT on db_storedproc_1.* from 'user_1'@'localhost';
-flush privileges;
-
-user_2@localhost db_storedproc_1
-CALL sp5_s_i();
-c1 c2 c3
-inserted outside of SP NULL
-inserted from sp5_ins 2000-10-00
-inserted from sp5_s_i 2000-10-00
-inserted from sp5_ins 2000-10-00
-ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't3165'
-CALL sp5_ins();
-ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't3165'
-CALL sp5_sel();
-c1 c2 c3
-inserted outside of SP NULL
-inserted from sp5_ins 2000-10-00
-inserted from sp5_s_i 2000-10-00
-inserted from sp5_ins 2000-10-00
-
-root@localhost db_storedproc_1
-REVOKE SELECT on db_storedproc_1.* from 'user_1'@'localhost';
-flush privileges;
-
-user_2@localhost db_storedproc_1
-CALL sp5_s_i();
-ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
-CALL sp5_ins();
-ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't3165'
-CALL sp5_sel();
-ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
-
-root@localhost db_storedproc_1
-DROP PROCEDURE sp5_s_i;
-DROP PROCEDURE sp5_sel;
-DROP PROCEDURE sp5_ins;
-DROP TABLE t3165;
-DROP USER 'user_1'@'localhost';
-DROP USER 'user_2'@'localhost';
-
-Testcase 3.1.6.6:
------------------
-Ensure that a stored procedure defined with SQL SECURITY INVOKER can be
-called/executed by any user, using only the privileges (including database
-access privileges) associated with the user executing the stored procedure.
---------------------------------------------------------------------------------
-USE db_storedproc_1;
-CREATE TABLE t3166 ( c1 char(30) );
-INSERT INTO db_storedproc_1.t3166 VALUES ('inserted outside SP');
-create user 'user_1'@'localhost';
-create user 'user_2'@'localhost';
-GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
-GRANT SELECT ON db_storedproc_1.* TO 'user_2'@'localhost';
-GRANT EXECUTE ON db_storedproc_1.* TO 'user_2'@'localhost';
-FLUSH PRIVILEGES;
-
-user_1@localhost db_storedproc_1
-CREATE PROCEDURE sp3166_s_i () SQL SECURITY INVOKER
-BEGIN
-SELECT * from db_storedproc_1.t3166;
-insert into db_storedproc_1.t3166 values ('inserted from sp3166_s_i');
-END//
-CREATE PROCEDURE sp3166_sel () SQL SECURITY INVOKER
-BEGIN
-SELECT * from db_storedproc_1.t3166;
-END//
-CREATE PROCEDURE sp3166_ins () SQL SECURITY INVOKER
-BEGIN
-insert into db_storedproc_1.t3166 values ('inserted from sp3166_ins');
-END//
-
-user_2@localhost db_storedproc_1
-CALL sp3166_s_i();
-c1
-inserted outside SP
-ERROR 42000: INSERT command denied to user 'user_2'@'localhost' for table 't3166'
-CALL sp3166_ins();
-ERROR 42000: INSERT command denied to user 'user_2'@'localhost' for table 't3166'
-CALL sp3166_sel();
-c1
-inserted outside SP
-
-root@localhost db_storedproc_1
-CALL sp3166_sel();
-c1
-inserted outside SP
-GRANT INSERT ON db_storedproc_1.* TO 'user_2'@'localhost';
-FLUSH PRIVILEGES;
-
-user_2@localhost db_storedproc_1
-CALL sp3166_s_i();
-c1
-inserted outside SP
-CALL sp3166_ins();
-CALL sp3166_sel();
-c1
-inserted outside SP
-inserted from sp3166_s_i
-inserted from sp3166_ins
-
-root@localhost db_storedproc_1
-CALL sp3166_sel();
-c1
-inserted outside SP
-inserted from sp3166_s_i
-inserted from sp3166_ins
-REVOKE SELECT ON db_storedproc_1.* FROM 'user_2'@'localhost';
-FLUSH PRIVILEGES;
-
-user_2@localhost db_storedproc_1
-CALL sp3166_s_i();
-ERROR 42000: SELECT command denied to user 'user_2'@'localhost' for table 't3166'
-CALL sp3166_ins();
-CALL sp3166_sel();
-ERROR 42000: SELECT command denied to user 'user_2'@'localhost' for table 't3166'
-CALL sp3166_s_i();
-c1
-inserted outside SP
-inserted from sp3166_s_i
-inserted from sp3166_ins
-inserted from sp3166_ins
-
-root@localhost db_storedproc_1
-REVOKE EXECUTE on db_storedproc_1.* FROM 'user_2'@'localhost';
-FLUSH PRIVILEGES;
-
-user_2@localhost db_storedproc_1
-CALL sp3166_s_i();
-ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc_1.sp3166_s_i'
-CALL sp3166_ins();
-ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc_1.sp3166_ins'
-CALL sp3166_sel();
-ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc_1.sp3166_sel'
-
-root@localhost db_storedproc_1
-DROP PROCEDURE sp3166_s_i;
-DROP PROCEDURE sp3166_sel;
-DROP PROCEDURE sp3166_ins;
-DROP TABLE t3166;
-DROP USER 'user_1'@'localhost';
-DROP USER 'user_2'@'localhost';
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-
-. +++ END OF SCRIPT +++
---------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_07.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_07.result
deleted file mode 100644
index a520bdfac36..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_07.result
+++ /dev/null
@@ -1,178 +0,0 @@
-
---source suite/funcs_1/storedproc/load_sp_tb.inc
---------------------------------------------------------------------------------
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-CREATE DATABASE db_storedproc;
-CREATE DATABASE db_storedproc_1;
-USE db_storedproc;
-create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
-create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
-create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
-create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
-USE db_storedproc_1;
-create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
-USE db_storedproc;
-create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
-create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
-create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
-
-Section 3.1.7 - SQL mode checks:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 3.1.7.1:
------------------
-Ensure that the sql_mode setting in effect at the time a stored procedure is
-created is the same setting under which the stored procedure runs when it is
-called/executed.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-DROP TABLE IF EXISTS temp_tbl;
-DROP TABLE IF EXISTS result;
-CREATE TABLE temp_tbl (f1 tinyint);
-CREATE TABLE result (f1 text(200), f2 char(20));
-set @@sql_mode='traditional';
-SHOW VARIABLES LIKE 'sql_mode';
-Variable_name Value
-sql_mode STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
-CREATE PROCEDURE sp1()
-BEGIN
-declare a tinyint;
-declare count_ int default 1;
-declare continue handler for sqlstate '22003' set count_=1000;
-SHOW VARIABLES LIKE 'sql_mode';
-SELECT @@sql_mode into @cur_val_sql_mode;
-insert into temp_tbl values (1000);
-if count_ = 1000 THEN
-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//
-SHOW CREATE PROCEDURE sp1;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp1 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
-BEGIN
-declare a tinyint;
-declare count_ int default 1;
-declare continue handler for sqlstate '22003' set count_=1000;
-SHOW VARIABLES LIKE 'sql_mode';
-SELECT @@sql_mode into @cur_val_sql_mode;
-insert into temp_tbl values (1000);
-if count_ = 1000 THEN
-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 latin1 latin1_swedish_ci latin1_swedish_ci
-set @@sql_mode='';
-SHOW VARIABLES LIKE 'sql_mode';
-Variable_name Value
-sql_mode
-CALL sp1();
-Variable_name Value
-sql_mode STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
-SELECT * from result;
-f1 f2
-STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION value restored
-SHOW VARIABLES LIKE 'sql_mode';
-Variable_name Value
-sql_mode
-SELECT @@sql_mode;
-@@sql_mode
-
-SET @@sql_mode='TRADITIONAL';
-DROP PROCEDURE sp1;
-DROP TABLE temp_tbl;
-DROP TABLE result;
-
-Testcase 3.1.7.2:
------------------
-Ensure that if the sql_mode setting is changed when a stored procedure is run,
-that the original setting is restored as soon as the stored procedure execution
-is complete.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp2;
-... show initial value
-SHOW VARIABLES LIKE 'sql_mode';
-Variable_name Value
-sql_mode STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
-CREATE PROCEDURE sp2()
-BEGIN
-SET @@sql_mode='MAXDB';
-SHOW VARIABLES LIKE 'sql_mode';
-END//
-SHOW CREATE PROCEDURE sp2;
-Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sp2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
-BEGIN
-SET @@sql_mode='MAXDB';
-SHOW VARIABLES LIKE 'sql_mode';
-END latin1 latin1_swedish_ci latin1_swedish_ci
-... show value prior calling procedure
-SHOW VARIABLES LIKE 'sql_mode';
-Variable_name Value
-sql_mode STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
-... call procedure that changes sql_mode
-CALL sp2();
-Variable_name Value
-sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,MAXDB,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER
-... check whether old value is re-set
-SHOW VARIABLES LIKE 'sql_mode';
-Variable_name Value
-sql_mode STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
-DROP PROCEDURE sp2;
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-
-. +++ END OF SCRIPT +++
---------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_08.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_08.result
deleted file mode 100644
index 4d85b97369c..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_08.result
+++ /dev/null
@@ -1,835 +0,0 @@
-
---source suite/funcs_1/storedproc/load_sp_tb.inc
---------------------------------------------------------------------------------
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-CREATE DATABASE db_storedproc;
-CREATE DATABASE db_storedproc_1;
-USE db_storedproc;
-create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
-create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
-create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
-create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
-USE db_storedproc_1;
-create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
-USE db_storedproc;
-create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
-create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
-create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
-
-Section 3.1.8 - SHOW statement checks:
---------------------------------------------------------------------------------
-
-Testcase 3.1.8.9:
------------------
-
-Ensure that all stored procedure changes made with ALTER PROCEDURE or ALTER
-FUNCTION are properly recorded and displayed when a SHOW CREATE PROCEDURE or
-SHOW CREATE PROCEDURE STATUS statement, or a SHOW CREATE FUNCTION or SHOW CREATE
-FUNCTION STATUS statement (respectively) is executed.
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn_1;
-DROP FUNCTION IF EXISTS fn_2;
-DROP PROCEDURE IF EXISTS sp_1;
-DROP PROCEDURE IF EXISTS sp_2;
-CREATE PROCEDURE sp_1 (i1 int)
-BEGIN
-set @x=i1;
-END//
-CREATE PROCEDURE sp_2 (i1 int) SQL SECURITY INVOKER COMMENT 'created with INVOKER'
-BEGIN
-set @x=i1;
-END//
-CREATE FUNCTION fn_1 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) returns year
-BEGIN
-set @x=i1;
-set @y=@x;
-return i4;
-END//
-CREATE FUNCTION fn_2 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
-RETURNS YEAR
-SQL SECURITY INVOKER
-COMMENT 'created with INVOKER'
-BEGIN
-set @x=i1;
-set @y=@x;
-return i4;
-END//
-
-... now check what is stored:
------------------------------
-SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
-SPECIFIC_NAME fn_1
-ROUTINE_CATALOG def
-ROUTINE_SCHEMA db_storedproc
-ROUTINE_NAME fn_1
-ROUTINE_TYPE FUNCTION
-DATA_TYPE year
-CHARACTER_MAXIMUM_LENGTH NULL
-CHARACTER_OCTET_LENGTH NULL
-NUMERIC_PRECISION NULL
-NUMERIC_SCALE NULL
-CHARACTER_SET_NAME NULL
-COLLATION_NAME NULL
-DTD_IDENTIFIER year(4)
-ROUTINE_BODY SQL
-ROUTINE_DEFINITION BEGIN
-set @x=i1;
-set @y=@x;
-return i4;
-END
-EXTERNAL_NAME NULL
-EXTERNAL_LANGUAGE NULL
-PARAMETER_STYLE SQL
-IS_DETERMINISTIC NO
-SQL_DATA_ACCESS CONTAINS SQL
-SQL_PATH NULL
-SECURITY_TYPE DEFINER
-CREATED <modified>
-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 def
-ROUTINE_SCHEMA db_storedproc
-ROUTINE_NAME fn_2
-ROUTINE_TYPE FUNCTION
-DATA_TYPE year
-CHARACTER_MAXIMUM_LENGTH NULL
-CHARACTER_OCTET_LENGTH NULL
-NUMERIC_PRECISION NULL
-NUMERIC_SCALE NULL
-CHARACTER_SET_NAME NULL
-COLLATION_NAME NULL
-DTD_IDENTIFIER year(4)
-ROUTINE_BODY SQL
-ROUTINE_DEFINITION BEGIN
-set @x=i1;
-set @y=@x;
-return i4;
-END
-EXTERNAL_NAME NULL
-EXTERNAL_LANGUAGE NULL
-PARAMETER_STYLE SQL
-IS_DETERMINISTIC NO
-SQL_DATA_ACCESS CONTAINS SQL
-SQL_PATH NULL
-SECURITY_TYPE INVOKER
-CREATED <modified>
-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 def
-ROUTINE_SCHEMA db_storedproc
-ROUTINE_NAME sp_1
-ROUTINE_TYPE PROCEDURE
-DATA_TYPE
-CHARACTER_MAXIMUM_LENGTH NULL
-CHARACTER_OCTET_LENGTH NULL
-NUMERIC_PRECISION NULL
-NUMERIC_SCALE NULL
-CHARACTER_SET_NAME NULL
-COLLATION_NAME NULL
-DTD_IDENTIFIER NULL
-ROUTINE_BODY SQL
-ROUTINE_DEFINITION BEGIN
-set @x=i1;
-END
-EXTERNAL_NAME NULL
-EXTERNAL_LANGUAGE NULL
-PARAMETER_STYLE SQL
-IS_DETERMINISTIC NO
-SQL_DATA_ACCESS CONTAINS SQL
-SQL_PATH NULL
-SECURITY_TYPE DEFINER
-CREATED <modified>
-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 def
-ROUTINE_SCHEMA db_storedproc
-ROUTINE_NAME sp_2
-ROUTINE_TYPE PROCEDURE
-DATA_TYPE
-CHARACTER_MAXIMUM_LENGTH NULL
-CHARACTER_OCTET_LENGTH NULL
-NUMERIC_PRECISION NULL
-NUMERIC_SCALE NULL
-CHARACTER_SET_NAME NULL
-COLLATION_NAME NULL
-DTD_IDENTIFIER NULL
-ROUTINE_BODY SQL
-ROUTINE_DEFINITION BEGIN
-set @x=i1;
-END
-EXTERNAL_NAME NULL
-EXTERNAL_LANGUAGE NULL
-PARAMETER_STYLE SQL
-IS_DETERMINISTIC NO
-SQL_DATA_ACCESS CONTAINS SQL
-SQL_PATH NULL
-SECURITY_TYPE INVOKER
-CREATED <modified>
-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
-Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
-BEGIN
-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
-Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
- SQL SECURITY INVOKER
- COMMENT 'created with INVOKER'
-BEGIN
-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
-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
-Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
- SQL SECURITY INVOKER
- COMMENT 'created with INVOKER'
-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
-Type FUNCTION
-Definer root@localhost
-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
-Definer root@localhost
-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
-Type PROCEDURE
-Definer root@localhost
-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
-Definer root@localhost
-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:
---------------------------
-ALTER PROCEDURE sp_1 SQL SECURITY INVOKER;
-ALTER PROCEDURE sp_1 COMMENT 'new comment, SP changed to INVOKER';
-ALTER PROCEDURE sp_2 SQL SECURITY DEFINER;
-ALTER PROCEDURE sp_2 DROP COMMENT;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DROP COMMENT' at line 1
-ALTER PROCEDURE sp_2 COMMENT 'SP changed to DEFINER';
-ALTER PROCEDURE sp_2 READS SQL DATA;
-ALTER FUNCTION fn_1 SQL SECURITY INVOKER;
-ALTER FUNCTION fn_1 COMMENT 'new comment, FN changed to INVOKER';
-ALTER FUNCTION fn_1 NO SQL;
-ALTER FUNCTION fn_2 SQL SECURITY DEFINER;
-ALTER FUNCTION fn_2 COMMENT 'FN changed to DEFINER';
-ALTER FUNCTION fn_2 MODIFIES SQL DATA;
-
-... now check what is stored:
------------------------------
-SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
-SPECIFIC_NAME fn_1
-ROUTINE_CATALOG def
-ROUTINE_SCHEMA db_storedproc
-ROUTINE_NAME fn_1
-ROUTINE_TYPE FUNCTION
-DATA_TYPE year
-CHARACTER_MAXIMUM_LENGTH NULL
-CHARACTER_OCTET_LENGTH NULL
-NUMERIC_PRECISION NULL
-NUMERIC_SCALE NULL
-CHARACTER_SET_NAME NULL
-COLLATION_NAME NULL
-DTD_IDENTIFIER year(4)
-ROUTINE_BODY SQL
-ROUTINE_DEFINITION BEGIN
-set @x=i1;
-set @y=@x;
-return i4;
-END
-EXTERNAL_NAME NULL
-EXTERNAL_LANGUAGE NULL
-PARAMETER_STYLE SQL
-IS_DETERMINISTIC NO
-SQL_DATA_ACCESS NO SQL
-SQL_PATH NULL
-SECURITY_TYPE INVOKER
-CREATED <modified>
-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 def
-ROUTINE_SCHEMA db_storedproc
-ROUTINE_NAME fn_2
-ROUTINE_TYPE FUNCTION
-DATA_TYPE year
-CHARACTER_MAXIMUM_LENGTH NULL
-CHARACTER_OCTET_LENGTH NULL
-NUMERIC_PRECISION NULL
-NUMERIC_SCALE NULL
-CHARACTER_SET_NAME NULL
-COLLATION_NAME NULL
-DTD_IDENTIFIER year(4)
-ROUTINE_BODY SQL
-ROUTINE_DEFINITION BEGIN
-set @x=i1;
-set @y=@x;
-return i4;
-END
-EXTERNAL_NAME NULL
-EXTERNAL_LANGUAGE NULL
-PARAMETER_STYLE SQL
-IS_DETERMINISTIC NO
-SQL_DATA_ACCESS MODIFIES SQL DATA
-SQL_PATH NULL
-SECURITY_TYPE DEFINER
-CREATED <modified>
-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 def
-ROUTINE_SCHEMA db_storedproc
-ROUTINE_NAME sp_1
-ROUTINE_TYPE PROCEDURE
-DATA_TYPE
-CHARACTER_MAXIMUM_LENGTH NULL
-CHARACTER_OCTET_LENGTH NULL
-NUMERIC_PRECISION NULL
-NUMERIC_SCALE NULL
-CHARACTER_SET_NAME NULL
-COLLATION_NAME NULL
-DTD_IDENTIFIER NULL
-ROUTINE_BODY SQL
-ROUTINE_DEFINITION BEGIN
-set @x=i1;
-END
-EXTERNAL_NAME NULL
-EXTERNAL_LANGUAGE NULL
-PARAMETER_STYLE SQL
-IS_DETERMINISTIC NO
-SQL_DATA_ACCESS CONTAINS SQL
-SQL_PATH NULL
-SECURITY_TYPE INVOKER
-CREATED <modified>
-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 def
-ROUTINE_SCHEMA db_storedproc
-ROUTINE_NAME sp_2
-ROUTINE_TYPE PROCEDURE
-DATA_TYPE
-CHARACTER_MAXIMUM_LENGTH NULL
-CHARACTER_OCTET_LENGTH NULL
-NUMERIC_PRECISION NULL
-NUMERIC_SCALE NULL
-CHARACTER_SET_NAME NULL
-COLLATION_NAME NULL
-DTD_IDENTIFIER NULL
-ROUTINE_BODY SQL
-ROUTINE_DEFINITION BEGIN
-set @x=i1;
-END
-EXTERNAL_NAME NULL
-EXTERNAL_LANGUAGE NULL
-PARAMETER_STYLE SQL
-IS_DETERMINISTIC NO
-SQL_DATA_ACCESS READS SQL DATA
-SQL_PATH NULL
-SECURITY_TYPE DEFINER
-CREATED <modified>
-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
-Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
- NO SQL
- SQL SECURITY INVOKER
- COMMENT 'new comment, FN changed to INVOKER'
-BEGIN
-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
-Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
- MODIFIES SQL DATA
- COMMENT 'FN changed to DEFINER'
-BEGIN
-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
-Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
- SQL SECURITY INVOKER
- COMMENT 'new comment, SP changed to INVOKER'
-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
-Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
- READS SQL DATA
- COMMENT 'SP changed to DEFINER'
-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
-Type FUNCTION
-Definer root@localhost
-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
-Definer root@localhost
-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
-Type PROCEDURE
-Definer root@localhost
-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
-Definer root@localhost
-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:
---------------------------------------------
-ALTER FUNCTION fn_2 CONTAINS SQL;
-
-... now check what is stored:
------------------------------
-SELECT * FROM information_schema.routines where routine_schema = 'db_storedproc';
-SPECIFIC_NAME fn_1
-ROUTINE_CATALOG def
-ROUTINE_SCHEMA db_storedproc
-ROUTINE_NAME fn_1
-ROUTINE_TYPE FUNCTION
-DATA_TYPE year
-CHARACTER_MAXIMUM_LENGTH NULL
-CHARACTER_OCTET_LENGTH NULL
-NUMERIC_PRECISION NULL
-NUMERIC_SCALE NULL
-CHARACTER_SET_NAME NULL
-COLLATION_NAME NULL
-DTD_IDENTIFIER year(4)
-ROUTINE_BODY SQL
-ROUTINE_DEFINITION BEGIN
-set @x=i1;
-set @y=@x;
-return i4;
-END
-EXTERNAL_NAME NULL
-EXTERNAL_LANGUAGE NULL
-PARAMETER_STYLE SQL
-IS_DETERMINISTIC NO
-SQL_DATA_ACCESS NO SQL
-SQL_PATH NULL
-SECURITY_TYPE INVOKER
-CREATED <modified>
-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 def
-ROUTINE_SCHEMA db_storedproc
-ROUTINE_NAME fn_2
-ROUTINE_TYPE FUNCTION
-DATA_TYPE year
-CHARACTER_MAXIMUM_LENGTH NULL
-CHARACTER_OCTET_LENGTH NULL
-NUMERIC_PRECISION NULL
-NUMERIC_SCALE NULL
-CHARACTER_SET_NAME NULL
-COLLATION_NAME NULL
-DTD_IDENTIFIER year(4)
-ROUTINE_BODY SQL
-ROUTINE_DEFINITION BEGIN
-set @x=i1;
-set @y=@x;
-return i4;
-END
-EXTERNAL_NAME NULL
-EXTERNAL_LANGUAGE NULL
-PARAMETER_STYLE SQL
-IS_DETERMINISTIC NO
-SQL_DATA_ACCESS CONTAINS SQL
-SQL_PATH NULL
-SECURITY_TYPE DEFINER
-CREATED <modified>
-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 def
-ROUTINE_SCHEMA db_storedproc
-ROUTINE_NAME sp_1
-ROUTINE_TYPE PROCEDURE
-DATA_TYPE
-CHARACTER_MAXIMUM_LENGTH NULL
-CHARACTER_OCTET_LENGTH NULL
-NUMERIC_PRECISION NULL
-NUMERIC_SCALE NULL
-CHARACTER_SET_NAME NULL
-COLLATION_NAME NULL
-DTD_IDENTIFIER NULL
-ROUTINE_BODY SQL
-ROUTINE_DEFINITION BEGIN
-set @x=i1;
-END
-EXTERNAL_NAME NULL
-EXTERNAL_LANGUAGE NULL
-PARAMETER_STYLE SQL
-IS_DETERMINISTIC NO
-SQL_DATA_ACCESS CONTAINS SQL
-SQL_PATH NULL
-SECURITY_TYPE INVOKER
-CREATED <modified>
-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 def
-ROUTINE_SCHEMA db_storedproc
-ROUTINE_NAME sp_2
-ROUTINE_TYPE PROCEDURE
-DATA_TYPE
-CHARACTER_MAXIMUM_LENGTH NULL
-CHARACTER_OCTET_LENGTH NULL
-NUMERIC_PRECISION NULL
-NUMERIC_SCALE NULL
-CHARACTER_SET_NAME NULL
-COLLATION_NAME NULL
-DTD_IDENTIFIER NULL
-ROUTINE_BODY SQL
-ROUTINE_DEFINITION BEGIN
-set @x=i1;
-END
-EXTERNAL_NAME NULL
-EXTERNAL_LANGUAGE NULL
-PARAMETER_STYLE SQL
-IS_DETERMINISTIC NO
-SQL_DATA_ACCESS READS SQL DATA
-SQL_PATH NULL
-SECURITY_TYPE DEFINER
-CREATED <modified>
-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
-Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
- NO SQL
- SQL SECURITY INVOKER
- COMMENT 'new comment, FN changed to INVOKER'
-BEGIN
-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
-Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
- COMMENT 'FN changed to DEFINER'
-BEGIN
-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
-Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
- SQL SECURITY INVOKER
- COMMENT 'new comment, SP changed to INVOKER'
-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
-Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
- READS SQL DATA
- COMMENT 'SP changed to DEFINER'
-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
-Type FUNCTION
-Definer root@localhost
-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
-Definer root@localhost
-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
-Type PROCEDURE
-Definer root@localhost
-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
-Definer root@localhost
-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
------------
-DROP FUNCTION fn_1;
-DROP FUNCTION fn_2;
-DROP PROCEDURE sp_1;
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-
-. +++ END OF SCRIPT +++
---------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result
deleted file mode 100644
index d731979a095..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result
+++ /dev/null
@@ -1,400 +0,0 @@
-
---source suite/funcs_1/storedproc/load_sp_tb.inc
---------------------------------------------------------------------------------
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-CREATE DATABASE db_storedproc;
-CREATE DATABASE db_storedproc_1;
-USE db_storedproc;
-create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1;
-create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2;
-create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3;
-create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4;
-USE db_storedproc_1;
-create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6;
-USE db_storedproc;
-create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8;
-Warnings:
-Warning 1265 Data truncated for column 'f3' at row 1
-Warning 1265 Data truncated for column 'f3' at row 2
-Warning 1265 Data truncated for column 'f3' at row 3
-Warning 1265 Data truncated for column 'f3' at row 4
-Warning 1265 Data truncated for column 'f3' at row 5
-Warning 1265 Data truncated for column 'f3' at row 6
-Warning 1265 Data truncated for column 'f3' at row 7
-Warning 1265 Data truncated for column 'f3' at row 8
-Warning 1265 Data truncated for column 'f3' at row 9
-Warning 1265 Data truncated for column 'f3' at row 10
-create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9;
-create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10;
-create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
-engine = <engine_to_be_tested>;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
-
-Section 3.1.10 - CALL checks:
---------------------------------------------------------------------------------
-USE db_storedproc;
-
-Testcase 3.1.10.2 + 3.1.10.5:
------------------------------
-
-2. Ensure that a procedure cannot be called if the appropriate privileges do not
-exist.
-5. Ensure that a function cannot be executed if the appropriate privileges do
-not exist.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp31102;
-DROP FUNCTION IF EXISTS fn31105;
-create user 'user_1'@'localhost';
-create user 'user_2'@'localhost';
-GRANT CREATE ROUTINE ON db_storedproc.* TO 'user_1'@'localhost';
-GRANT SELECT ON db_storedproc.* TO 'user_2'@'localhost';
-FLUSH PRIVILEGES;
-
-user_1@localhost db_storedproc
-CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
-BEGIN
-SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
-END//
-CREATE FUNCTION fn31105(n INT) RETURNS INT
-BEGIN
-DECLARE res INT;
-SET res = n * n;
-RETURN res;
-END//
-
-user_2@localhost db_storedproc
-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'
-connection default;
-USE db_storedproc;
-
-root@localhost db_storedproc
-CALL sp31102();
-f1 f2 f3 f4 f5 f6
-a` a` 1000-01-01 -5000 a` -5000
-SELECT fn31105( 9 );
-fn31105( 9 )
-81
-GRANT EXECUTE ON db_storedproc.* TO 'user_2'@'localhost';
-FLUSH PRIVILEGES;
-
-user_2@localhost db_storedproc
-CALL sp31102();
-f1 f2 f3 f4 f5 f6
-a` a` 1000-01-01 -5000 a` -5000
-SELECT fn31105( 9 );
-fn31105( 9 )
-81
-connection default;
-USE db_storedproc;
-
-root@localhost db_storedproc
-REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost';
-FLUSH PRIVILEGES;
-CALL sp31102();
-f1 f2 f3 f4 f5 f6
-a` a` 1000-01-01 -5000 a` -5000
-SELECT fn31105( 9 );
-fn31105( 9 )
-81
-
-user_2@localhost db_storedproc
-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;
-DROP FUNCTION fn31105;
-DROP USER 'user_1'@'localhost';
-DROP USER 'user_2'@'localhost';
-
-Testcase 3.1.10.3:
-------------------
-
-Ensure that a function can never be called.
---------------------------------------------------------------------------------
-DROP FUNCTION IF EXISTS fn1;
-CREATE FUNCTION fn1(a int) returns int
-BEGIN
-set @b = 0.9 * a;
-return @b;
-END//
-CALL fn1();
-ERROR 42000: PROCEDURE db_storedproc.fn1 does not exist
-DROP FUNCTION fn1;
-
-Testcase 3.1.10.6:
-------------------
-
-Ensure that a procedure can never be executed.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp1;
-DROP FUNCTION IF EXISTS sp1;
-CREATE PROCEDURE sp1()
-BEGIN
-SELECT * from t10;
-END//
-SELECT sp1();
-ERROR 42000: FUNCTION db_storedproc.sp1 does not exist
-DROP PROCEDURE sp1;
-
-Testcase 3.1.10.7:
-------------------
-
-Ensure that the ROW_COUNT() SQL function always returns the correct number of
-rows affected by the execution of a stored procedure.
---------------------------------------------------------------------------------
-DROP PROCEDURE IF EXISTS sp_ins_1;
-DROP PROCEDURE IF EXISTS sp_ins_3;
-DROP PROCEDURE IF EXISTS sp_upd;
-DROP PROCEDURE IF EXISTS sp_ins_upd;
-DROP PROCEDURE IF EXISTS sp_del;
-DROP PROCEDURE IF EXISTS sp_with_rowcount;
-CREATE TABLE temp(f1 CHAR(20),f2 CHAR(25),f3 DATE,f4 INT,f5 CHAR(25),f6 INT);
-INSERT INTO temp SELECT * FROM t10;
-CREATE PROCEDURE sp_ins_1()
-BEGIN
-INSERT INTO temp VALUES ('abc', 'abc', '20051003', 100, 'uvw', 1000);
-END//
-CREATE PROCEDURE sp_ins_3()
-BEGIN
-INSERT INTO temp VALUES ('abc', 'xyz', '19490523', 100, 'uvw', 1000);
-INSERT INTO temp VALUES ('abc', 'xyz', '1989-11-09', 100, 'uvw', 1000);
-INSERT INTO temp VALUES ('abc', 'xyz', '2005-10-24', 100, 'uvw', 1000);
-END//
-CREATE PROCEDURE sp_upd()
-BEGIN
-UPDATE temp SET temp.f1 = 'updated' WHERE temp.f1 ='abc';
-END//
-CREATE PROCEDURE sp_ins_upd()
-BEGIN
-BEGIN
-INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000);
-INSERT INTO temp VALUES ('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000);
-INSERT INTO temp VALUES ('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000);
-INSERT INTO temp VALUES ('qwe', 'abc', '2005-11-07', 100, 'uvw', 1000);
-END;
-SELECT COUNT( f1 ), f1 FROM temp GROUP BY f1;
-UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f1 ='qwe' AND temp.f2 = 'abc';
-END//
-CREATE PROCEDURE sp_del()
-BEGIN
-DELETE FROM temp WHERE temp.f1 ='qwe' OR temp.f1 = 'updated_2';
-END//
-CREATE PROCEDURE sp_with_rowcount()
-BEGIN
-BEGIN
-INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000),
-('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000),
-('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000),
-('qwe', 'xyz', '2005-11-07', 100, 'uvw', 1000);
-END;
-SELECT row_count() AS 'row_count() after insert';
-SELECT row_count() AS 'row_count() after select row_count()';
-SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
-UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f2 = 'abc';
-SELECT row_count() AS 'row_count() after update';
-SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
-DELETE FROM temp WHERE temp.f1 = 'updated_2';
-SELECT row_count() AS 'row_count() after delete';
-END//
-CALL sp_ins_1();
-SELECT row_count();
-row_count()
-1
-SELECT * FROM temp;
-f1 f2 f3 f4 f5 f6
-a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
-a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
-a` a` 1000-01-01 -5000 a` -5000
-aaa aaa 1000-01-02 -4999 aaa -4999
-abaa abaa 1000-01-03 -4998 abaa -4998
-abc abc 2005-10-03 100 uvw 1000
-acaaa acaaa 1000-01-04 -4997 acaaa -4997
-adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
-aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
-afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
-agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
-CALL sp_ins_3();
-SELECT row_count();
-row_count()
-1
-SELECT * FROM temp;
-f1 f2 f3 f4 f5 f6
-a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
-a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
-a` a` 1000-01-01 -5000 a` -5000
-aaa aaa 1000-01-02 -4999 aaa -4999
-abaa abaa 1000-01-03 -4998 abaa -4998
-abc abc 2005-10-03 100 uvw 1000
-abc xyz 1949-05-23 100 uvw 1000
-abc xyz 1989-11-09 100 uvw 1000
-abc xyz 2005-10-24 100 uvw 1000
-acaaa acaaa 1000-01-04 -4997 acaaa -4997
-adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
-aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
-afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
-agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
-CALL sp_upd();
-SELECT row_count();
-row_count()
-4
-SELECT * FROM temp;
-f1 f2 f3 f4 f5 f6
-a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
-a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
-a` a` 1000-01-01 -5000 a` -5000
-aaa aaa 1000-01-02 -4999 aaa -4999
-abaa abaa 1000-01-03 -4998 abaa -4998
-acaaa acaaa 1000-01-04 -4997 acaaa -4997
-adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
-aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
-afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
-agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
-updated abc 2005-10-03 100 uvw 1000
-updated xyz 1949-05-23 100 uvw 1000
-updated xyz 1989-11-09 100 uvw 1000
-updated xyz 2005-10-24 100 uvw 1000
-CALL sp_ins_upd();
-COUNT( f1 ) f1
-1 aaa
-1 abaa
-1 acaaa
-1 adaaaa
-1 aeaaaaa
-1 afaaaaaa
-1 agaaaaaaa
-1 a^aaaaaaaa
-1 a_aaaaaaaaa
-1 a`
-4 qwe
-4 updated
-SELECT row_count();
-row_count()
-3
-SELECT * FROM temp;
-f1 f2 f3 f4 f5 f6
-a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
-a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
-a` a` 1000-01-01 -5000 a` -5000
-aaa aaa 1000-01-02 -4999 aaa -4999
-abaa abaa 1000-01-03 -4998 abaa -4998
-acaaa acaaa 1000-01-04 -4997 acaaa -4997
-adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
-aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
-afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
-agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
-qwe xyz 1998-03-26 100 uvw 1000
-updated abc 2005-10-03 100 uvw 1000
-updated xyz 1949-05-23 100 uvw 1000
-updated xyz 1989-11-09 100 uvw 1000
-updated xyz 2005-10-24 100 uvw 1000
-updated_2 abc 1989-11-09 100 uvw 1000
-updated_2 abc 2000-11-09 100 uvw 1000
-updated_2 abc 2005-11-07 100 uvw 1000
-CALL sp_del();
-SELECT row_count();
-row_count()
-4
-SELECT * FROM temp;
-f1 f2 f3 f4 f5 f6
-a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
-a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
-a` a` 1000-01-01 -5000 a` -5000
-aaa aaa 1000-01-02 -4999 aaa -4999
-abaa abaa 1000-01-03 -4998 abaa -4998
-acaaa acaaa 1000-01-04 -4997 acaaa -4997
-adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
-aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
-afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
-agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
-updated abc 2005-10-03 100 uvw 1000
-updated xyz 1949-05-23 100 uvw 1000
-updated xyz 1989-11-09 100 uvw 1000
-updated xyz 2005-10-24 100 uvw 1000
-DELETE FROM temp;
-CALL sp_with_rowcount();
-row_count() after insert
-4
-row_count() after select row_count()
--1
-f1 f2 f3
-qwe abc 1989-11-09
-qwe abc 2000-11-09
-qwe xyz 1998-03-26
-qwe xyz 2005-11-07
-row_count() after update
-2
-f1 f2 f3
-qwe xyz 1998-03-26
-qwe xyz 2005-11-07
-updated_2 abc 1989-11-09
-updated_2 abc 2000-11-09
-row_count() after delete
-2
-SELECT row_count();
-row_count()
-0
-SELECT * FROM temp;
-f1 f2 f3 f4 f5 f6
-qwe xyz 1998-03-26 100 uvw 1000
-qwe xyz 2005-11-07 100 uvw 1000
-DROP PROCEDURE sp_ins_1;
-DROP PROCEDURE sp_ins_3;
-DROP PROCEDURE sp_upd;
-DROP PROCEDURE sp_ins_upd;
-DROP PROCEDURE sp_del;
-DROP PROCEDURE sp_with_rowcount;
-DROP TABLE temp;
-
-Testcase 3.1.10.8:
-------------------
-
-Ensure that the mysql_affected_rows() C API function always returns the correct
-number of rows affected by the execution of a stored procedure.
---------------------------------------------------------------------------------
-
---source suite/funcs_1/storedproc/cleanup_sp_tb.inc
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS db_storedproc;
-DROP DATABASE IF EXISTS db_storedproc_1;
-
-. +++ END OF SCRIPT +++
---------------------------------------------------------------------------------
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_0102.result b/mysql-test/suite/funcs_1/r/ndb_trig_0102.result
deleted file mode 100644
index 5ca24acf0bf..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_trig_0102.result
+++ /dev/null
@@ -1,366 +0,0 @@
-USE test;
-drop table if exists tb3;
-create table tb3 (
-f118 char not null DEFAULT 'a',
-f119 char binary not null DEFAULT b'101',
-f120 char ascii not null DEFAULT b'101',
-f121 char(50),
-f122 char(50),
-f129 binary not null DEFAULT b'101',
-f130 tinyint not null DEFAULT 99,
-f131 tinyint unsigned not null DEFAULT 99,
-f132 tinyint zerofill not null DEFAULT 99,
-f133 tinyint unsigned zerofill not null DEFAULT 99,
-f134 smallint not null DEFAULT 999,
-f135 smallint unsigned not null DEFAULT 999,
-f136 smallint zerofill not null DEFAULT 999,
-f137 smallint unsigned zerofill not null DEFAULT 999,
-f138 mediumint not null DEFAULT 9999,
-f139 mediumint unsigned not null DEFAULT 9999,
-f140 mediumint zerofill not null DEFAULT 9999,
-f141 mediumint unsigned zerofill not null DEFAULT 9999,
-f142 int not null DEFAULT 99999,
-f143 int unsigned not null DEFAULT 99999,
-f144 int zerofill not null DEFAULT 99999,
-f145 int unsigned zerofill not null DEFAULT 99999,
-f146 bigint not null DEFAULT 999999,
-f147 bigint unsigned not null DEFAULT 999999,
-f148 bigint zerofill not null DEFAULT 999999,
-f149 bigint unsigned zerofill not null DEFAULT 999999,
-f150 decimal not null DEFAULT 999.999,
-f151 decimal unsigned not null DEFAULT 999.17,
-f152 decimal zerofill not null DEFAULT 999.999,
-f153 decimal unsigned zerofill,
-f154 decimal (0),
-f155 decimal (64),
-f156 decimal (0) unsigned,
-f157 decimal (64) unsigned,
-f158 decimal (0) zerofill,
-f159 decimal (64) zerofill,
-f160 decimal (0) unsigned zerofill,
-f161 decimal (64) unsigned zerofill,
-f162 decimal (0,0),
-f163 decimal (63,30),
-f164 decimal (0,0) unsigned,
-f165 decimal (63,30) unsigned,
-f166 decimal (0,0) zerofill,
-f167 decimal (63,30) zerofill,
-f168 decimal (0,0) unsigned zerofill,
-f169 decimal (63,30) unsigned zerofill,
-f170 numeric,
-f171 numeric unsigned,
-f172 numeric zerofill,
-f173 numeric unsigned zerofill,
-f174 numeric (0),
-f175 numeric (64)
-) engine = <engine_to_be_used>;
-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
-
-Testcase: 3.5.1.1:
-------------------
-use test;
-Create trigger trg1_1 BEFORE INSERT
-on tb3 for each row set @test_before = 2, new.f142 = @test_before;
-Create trigger trg1_2 AFTER INSERT
-on tb3 for each row set @test_after = 6;
-Create trigger trg1_4 BEFORE UPDATE
-on tb3 for each row set @test_before = 27,
-new.f142 = @test_before,
-new.f122 = 'Before Update Trigger';
-Create trigger trg1_3 AFTER UPDATE
-on tb3 for each row set @test_after = '15';
-Create trigger trg1_5 BEFORE DELETE on tb3 for each row
-select count(*) into @test_before from tb3 as tr_tb3
-where f121 = 'Test 3.5.1.1';
-Create trigger trg1_6 AFTER DELETE on tb3 for each row
-select count(*) into @test_after from tb3 as tr_tb3
-where f121 = 'Test 3.5.1.1';
-set @test_before = 1;
-set @test_after = 5;
-select @test_before, @test_after;
-@test_before @test_after
-1 5
-Insert into tb3 (f121, f122, f142, f144, f134)
-values ('Test 3.5.1.1', 'First Row', @test_before, @test_after, 1);
-select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
-f121 f122 f142 f144 f134
-Test 3.5.1.1 First Row 2 0000000005 1
-select @test_before, @test_after;
-@test_before @test_after
-2 6
-set @test_before = 18;
-set @test_after = 8;
-select @test_before, @test_after;
-@test_before @test_after
-18 8
-Update tb3 set tb3.f122 = 'Update',
-tb3.f142 = @test_before,
-tb3.f144 = @test_after
-where tb3.f121 = 'Test 3.5.1.1';
-select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
-f121 f122 f142 f144 f134
-Test 3.5.1.1 Before Update Trigger 27 0000000008 1
-select @test_before, @test_after;
-@test_before @test_after
-27 15
-Insert into tb3 (f121, f122, f142, f144, f134)
-values ('Test 3.5.1.1', 'Second Row', 5, 6, 2);
-set @test_before = 0;
-set @test_after = 0;
-select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
-f121 f122 f142 f144 f134
-Test 3.5.1.1 Before Update Trigger 27 0000000008 1
-Test 3.5.1.1 Second Row 2 0000000006 2
-select @test_before, @test_after;
-@test_before @test_after
-0 0
-Delete from tb3 where f121 = 'Test 3.5.1.1' and f134 = 2;
-select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
-f121 f122 f142 f144 f134
-Test 3.5.1.1 Before Update Trigger 27 0000000008 1
-select @test_before, @test_after;
-@test_before @test_after
-2 1
-drop trigger trg1_1;
-drop trigger trg1_2;
-drop trigger trg1_3;
-drop trigger trg1_4;
-drop trigger trg1_5;
-drop trigger trg1_6;
-delete from tb3 where f121='Test 3.5.1.1';
-
-Testcase: 3.5.1.2:
-------------------
-Create trigger trg_1 after insert
-on tb3 for each statement set @x= 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 'statement set @x= 1' at line 2
-drop trigger trg_1;
-
-Testcase 3.5.1.3:
------------------
-CREATE TRIGGER trg3_1 on tb3 BEFORE INSERT for each row set new.f120 = '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 'on tb3 BEFORE INSERT for each row set new.f120 = 't'' at line 1
-CREATE trg3_2 TRIGGER AFTER INSERT on tb3 for each row set new.f120 = 's';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trg3_2 TRIGGER AFTER INSERT on tb3 for each row set new.f120 = 's'' at line 1
-CREATE TRIGGER trg3_3 Before DELETE on tb3 set @ret1 = 'test' for each row;
-ERROR 42000: You 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 @ret1 = 'test' for each row' at line 1
-CREATE TRIGGER trg3_4 DELETE AFTER on tb3 set @ret1 = 'test' for each row;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELETE AFTER on tb3 set @ret1 = 'test' for each row' at line 1
-CREATE for each row TRIGGER trg3_5 AFTER UPDATE on tb3 set @ret1 = '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 'for each row TRIGGER trg3_5 AFTER UPDATE on tb3 set @ret1 = 'test'' at line 1
-drop trigger trg3_1;
-drop trigger trg3_2;
-drop trigger trg3_3;
-drop trigger trg3_4;
-drop trigger trg3_5;
-
-Testcase: 3.5.1.5:
-------------------
-CREATE TRIGGER trg4_1 AFTER on tb3 for each row set new.f120 = 'e';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on tb3 for each row set new.f120 = 'e'' at line 1
-CREATE TRIGGER trg4_2 INSERT on tb3 for each set row new.f120 = 'f';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT on tb3 for each set row new.f120 = 'f'' at line 1
-CREATE TRIGGER trg4_3 BEFORE INSERT tb3 for each row set new.f120 = 'g';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tb3 for each row set new.f120 = 'g'' at line 1
-CREATE TRIGGER trg4_4 AFTER UPDATE on tb3 for each set new.f120 = 'g';
-ERROR 42000: You 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 new.f120 = 'g'' at line 1
-CREATE trg4_5 AFTER DELETE on tb3 for each set new.f120 = 'g';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trg4_5 AFTER DELETE on tb3 for each set new.f120 = 'g'' at line 1
-CREATE TRIGGER trg4_6 BEFORE DELETE for each row set new.f120 = 'g';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for each row set new.f120 = 'g'' at line 1
-drop trigger trg4_1;
-drop trigger trg4_2;
-drop trigger trg4_3;
-drop trigger trg4_4;
-drop trigger trg4_5;
-drop trigger trg4_6;
-
-Testcase 3.5.1.6: - Need to fix
--------------------------------
-
-Testcase 3.5.1.7: - need to fix
--------------------------------
-drop table if exists t1;
-Warnings:
-Note 1051 Unknown table 't1'
-create table t1 (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
-CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
-for each row set new.f3 = '14';
-CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
-BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
-ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
-CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
-BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
-insert into t1 (f2) values ('insert 3.5.1.7');
-select * from t1;
-f1 f2 f3
-NULL insert 3.5.1.7 14
-update t1 set f2='update 3.5.1.7';
-select * from t1;
-f1 f2 f3
-NULL update 3.5.1.7 42
-select trigger_name from information_schema.triggers order by trigger_name;
-trigger_name
-gs_insert
-trg5_1
-trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
-ts_insert
-drop trigger trg5_1;
-drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
-ERROR 42000: Identifier name 'trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ' is too long
-drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX;
-drop table t1;
-
-Testcase 3.5.1.8:
------------------
-CREATE TRIGGER trg12* before insert on tb3 for each row set new.f120 = '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 '* before insert on tb3 for each row set new.f120 = 't'' at line 1
-CREATE TRIGGER trigger before insert on tb3 for each row set new.f120 = '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 'trigger before insert on tb3 for each row set new.f120 = 't'' at line 1
-CREATE TRIGGER 100 before insert on tb3 for each row set new.f120 = '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 '100 before insert on tb3 for each row set new.f120 = 't'' at line 1
-CREATE TRIGGER @@view before insert on tb3 for each row set new.f120 = '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 '@@view before insert on tb3 for each row set new.f120 = 't'' at line 1
-CREATE TRIGGER @name before insert on tb3 for each row set new.f120 = '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 '@name before insert on tb3 for each row set new.f120 = 't'' at line 1
-CREATE TRIGGER tb3.trg6_1 BEFORE INSERT on test.tb3
-for each row set new.f120 ='X';
-ERROR HY000: Trigger in wrong schema
-drop database if exists trig_db;
-create database trig_db;
-use trig_db;
-create table t1 (f1 integer) engine = <engine_to_be_used>;
-use test;
-CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
-for each row set @ret_trg6_2 = 5;
-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;
-ERROR HY000: Trigger in wrong schema
-use test;
-drop database trig_db;
-drop trigger trg6_1;
-drop trigger trg6_3;
-
-Testcase 3.5.1.9:(cannot be inplemented at this point)
-------------------------------------------------------
-
-Testcase 3.5.1.10:
-------------------
-CREATE TRIGGER trg7_1 BEFORE UPDATE on tb3 for each row set new.f120 ='X';
-CREATE TRIGGER trg7_1 AFTER INSERT on tb3 for each row set @x ='Y';
-ERROR HY000: Trigger already exists
-drop trigger trg7_1;
-
-Testcase 3.5.1.?:
------------------
-drop table if exists t1;
-drop table if exists t2;
-create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
-create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
-create trigger trig before insert on t1
-for each row set new.f1 ='trig t1';
-create trigger trig before update on t2
-for each row set new.f1 ='trig t2';
-ERROR HY000: Trigger already exists
-insert into t1 value ('insert to t1',1);
-select * from t1;
-f1 f2
-trig t1 1
-update t1 set f1='update to t1';
-select * from t1;
-f1 f2
-update to t1 1
-insert into t2 value ('insert to t2',2);
-update t2 set f1='update to t1';
-select * from t2;
-f1 f2
-update to t1 2
-drop table t1;
-drop table t2;
-drop trigger trig;
-
-Testcase 3.5.1.11:
-------------------
-drop database if exists trig_db1;
-drop database if exists trig_db2;
-drop database if exists trig_db3;
-create database trig_db1;
-create database trig_db2;
-create database trig_db3;
-use trig_db1;
-create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
-create trigger trig before insert on t1
-for each row set new.f1 ='trig1', @test_var1='trig1';
-use trig_db2;
-create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
-create trigger trig before insert on t2
-for each row set new.f1 ='trig2', @test_var2='trig2';
-use trig_db3;
-create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
-create trigger trig before insert on t1
-for each row set new.f1 ='trig3', @test_var3='trig3';
-set @test_var1= '', @test_var2= '', @test_var3= '';
-use trig_db1;
-insert into t1 (f1,f2) values ('insert to db1 t1',1);
-insert into trig_db1.t1 (f1,f2) values ('insert to db1 t1 from db1',2);
-insert into trig_db2.t2 (f1,f2) values ('insert to db2 t2 from db1',3);
-insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
-select @test_var1, @test_var2, @test_var3;
-@test_var1 @test_var2 @test_var3
-trig1 trig2 trig3
-select * from t1 order by f2;
-f1 f2
-trig1 1
-trig1 2
-select * from trig_db2.t2;
-f1 f2
-trig2 3
-select * from trig_db3.t1;
-f1 f2
-trig3 4
-select * from t1 order by f2;
-f1 f2
-trig1 1
-trig1 2
-use test;
-drop database trig_db1;
-drop database trig_db2;
-drop database trig_db3;
-
-Testcase 3.5.2.1/2/3:
----------------------
-drop database if exists trig_db1;
-drop database if exists trig_db2;
-create database trig_db1;
-create database trig_db2;
-use trig_db1;
-create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
-create table trig_db2.t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
-create trigger trig1_b before insert on t1
-for each row set @test_var1='trig1_b';
-create trigger trig_db1.trig1_a after insert on t1
-for each row set @test_var2='trig1_a';
-create trigger trig_db2.trig2 before insert on trig_db2.t1
-for each row set @test_var3='trig2';
-select trigger_schema, trigger_name, event_object_table
-from information_schema.triggers
-where trigger_schema like 'trig_db%'
- order by trigger_name;
-trigger_schema trigger_name event_object_table
-trig_db1 trig1_a t1
-trig_db1 trig1_b t1
-trig_db2 trig2 t1
-set @test_var1= '', @test_var2= '', @test_var3= '';
-insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);
-insert into trig_db2.t1 (f1,f2) values ('insert to db2 t1 from db1',352);
-select @test_var1, @test_var2, @test_var3;
-@test_var1 @test_var2 @test_var3
-trig1_b trig1_a trig2
-drop database trig_db1;
-drop database trig_db2;
-DROP TABLE test.tb3;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_03.result b/mysql-test/suite/funcs_1/r/ndb_trig_03.result
deleted file mode 100644
index db92ea56444..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_trig_03.result
+++ /dev/null
@@ -1,675 +0,0 @@
-USE test;
-drop table if exists tb3;
-create table tb3 (
-f118 char not null DEFAULT 'a',
-f119 char binary not null DEFAULT b'101',
-f120 char ascii not null DEFAULT b'101',
-f121 char(50),
-f122 char(50),
-f129 binary not null DEFAULT b'101',
-f130 tinyint not null DEFAULT 99,
-f131 tinyint unsigned not null DEFAULT 99,
-f132 tinyint zerofill not null DEFAULT 99,
-f133 tinyint unsigned zerofill not null DEFAULT 99,
-f134 smallint not null DEFAULT 999,
-f135 smallint unsigned not null DEFAULT 999,
-f136 smallint zerofill not null DEFAULT 999,
-f137 smallint unsigned zerofill not null DEFAULT 999,
-f138 mediumint not null DEFAULT 9999,
-f139 mediumint unsigned not null DEFAULT 9999,
-f140 mediumint zerofill not null DEFAULT 9999,
-f141 mediumint unsigned zerofill not null DEFAULT 9999,
-f142 int not null DEFAULT 99999,
-f143 int unsigned not null DEFAULT 99999,
-f144 int zerofill not null DEFAULT 99999,
-f145 int unsigned zerofill not null DEFAULT 99999,
-f146 bigint not null DEFAULT 999999,
-f147 bigint unsigned not null DEFAULT 999999,
-f148 bigint zerofill not null DEFAULT 999999,
-f149 bigint unsigned zerofill not null DEFAULT 999999,
-f150 decimal not null DEFAULT 999.999,
-f151 decimal unsigned not null DEFAULT 999.17,
-f152 decimal zerofill not null DEFAULT 999.999,
-f153 decimal unsigned zerofill,
-f154 decimal (0),
-f155 decimal (64),
-f156 decimal (0) unsigned,
-f157 decimal (64) unsigned,
-f158 decimal (0) zerofill,
-f159 decimal (64) zerofill,
-f160 decimal (0) unsigned zerofill,
-f161 decimal (64) unsigned zerofill,
-f162 decimal (0,0),
-f163 decimal (63,30),
-f164 decimal (0,0) unsigned,
-f165 decimal (63,30) unsigned,
-f166 decimal (0,0) zerofill,
-f167 decimal (63,30) zerofill,
-f168 decimal (0,0) unsigned zerofill,
-f169 decimal (63,30) unsigned zerofill,
-f170 numeric,
-f171 numeric unsigned,
-f172 numeric zerofill,
-f173 numeric unsigned zerofill,
-f174 numeric (0),
-f175 numeric (64)
-) engine = <engine_to_be_used>;
-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
-
-Testcase 3.5.3:
----------------
-drop database if exists priv_db;
-create database priv_db;
-use priv_db;
-create table t1 (f1 char(20)) engine= <engine_to_be_used>;
-create User test_noprivs@localhost;
-set password for test_noprivs@localhost = password('PWD');
-create User test_yesprivs@localhost;
-set password for test_yesprivs@localhost = password('PWD');
-
-Testcase 3.5.3.2/6:
--------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant ALL on *.* to test_noprivs@localhost;
-revoke TRIGGER on *.* from test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant SELECT on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-
-Testcase 3.5.3.2:
------------------
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-create trigger trg1_1 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.2_1-no';
-ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
-use priv_db;
-insert into t1 (f1) values ('insert 3.5.3.2-no');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-create trigger trg1_2 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.2_2-yes';
-select current_user;
-current_user
-root@localhost
-use priv_db;
-insert into t1 (f1) values ('insert 3.5.3.2-yes');
-ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't1'
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
-insert into t1 (f1) values ('insert 3.5.3.2-yes');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-trig 3.5.3.2_2-yes
-
-Testcase 3.5.3.6:
------------------
-use priv_db;
-drop trigger trg1_2;
-ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
-use priv_db;
-insert into t1 (f1) values ('insert 3.5.3.6-yes');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-use priv_db;
-drop trigger trg1_2;
-use priv_db;
-insert into t1 (f1) values ('insert 3.5.3.6-no');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-drop trigger trg1_2;
-
-Testcase 3.5.3.7a:
-------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant ALL on *.* to test_noprivs@localhost;
-revoke UPDATE on *.* from test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-show grants;
-Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-create trigger trg4a_1 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.7-1a';
-insert into t1 (f1) values ('insert 3.5.3.7-1a');
-ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-drop trigger trg4a_1;
-use priv_db;
-select current_user;
-current_user
-test_yesprivs@localhost
-show grants;
-Grants for test_yesprivs@localhost
-GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-create trigger trg4a_2 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.7-2a';
-insert into t1 (f1) values ('insert 3.5.3.7-2b');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-drop trigger trg4a_2;
-
-Testcase 3.5.3.7b:
-------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant TRIGGER on *.* to test_noprivs;
-grant ALL on priv_db.* to test_noprivs@localhost;
-revoke UPDATE on priv_db.* from test_noprivs@localhost;
-show grants for test_noprivs;
-Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant UPDATE on priv_db.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-show grants;
-Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
-use priv_db;
-create trigger trg4b_1 before UPDATE on t1 for each row
-set new.f1 = 'trig 3.5.3.7-1b';
-insert into t1 (f1) values ('insert 3.5.3.7-1b');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
-ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-drop trigger trg4b_1;
-show grants;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-use priv_db;
-create trigger trg4b_2 before UPDATE on t1 for each row
-set new.f1 = 'trig 3.5.3.7-2b';
-insert into t1 (f1) values ('insert 3.5.3.7-2b');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-insert 3.5.3.7-2b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-trig 3.5.3.7-2b
-drop trigger trg4b_2;
-
-Testcase 3.5.3.7c
------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant TRIGGER on *.* to test_noprivs@localhost;
-grant ALL on priv_db.t1 to test_noprivs@localhost;
-revoke UPDATE on priv_db.t1 from test_noprivs@localhost;
-show grants for test_noprivs;
-Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-show grants;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-use priv_db;
-create trigger trg4c_1 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.7-1c';
-insert into t1 (f1) values ('insert 3.5.3.7-1c');
-ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-trig 3.5.3.7-2b
-drop trigger trg4c_1;
-show grants;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-use priv_db;
-create trigger trg4c_2 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.7-2c';
-insert into t1 (f1) values ('insert 3.5.3.7-2c');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-trig 3.5.3.7-2b
-trig 3.5.3.7-2c
-drop trigger trg4c_2;
-
-Testcase 3.5.3.7d:
-------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant TRIGGER on *.* to test_noprivs@localhost;
-grant SELECT (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
-show grants for test_noprivs;
-Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_noprivs;
-Grants for test_noprivs@%
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
-show grants;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-use priv_db;
-create trigger trg4d_1 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.7-1d';
-insert into t1 (f1) values ('insert 3.5.3.7-1d');
-ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-trig 3.5.3.7-2b
-trig 3.5.3.7-2c
-drop trigger trg4d_1;
-show grants;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-use priv_db;
-create trigger trg4d_2 before INSERT on t1 for each row
-set new.f1 = 'trig 3.5.3.7-2d';
-insert into t1 (f1) values ('insert 3.5.3.7-2d');
-select f1 from t1 order by f1;
-f1
-insert 3.5.3.2-no
-insert 3.5.3.6-no
-insert 3.5.3.7-1b
-trig 3.5.3.2_2-yes
-trig 3.5.3.2_2-yes
-trig 3.5.3.7-2a
-trig 3.5.3.7-2b
-trig 3.5.3.7-2c
-trig 3.5.3.7-2d
-drop trigger trg4d_2;
-
-Testcase 3.5.3.8a:
-------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant ALL on *.* to test_noprivs@localhost;
-revoke SELECT on *.* from test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-show grants;
-Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-create trigger trg5a_1 before INSERT on t1 for each row
-set @test_var = new.f1;
-set @test_var = 'before trig 3.5.3.8-1a';
-select @test_var;
-@test_var
-before trig 3.5.3.8-1a
-insert into t1 (f1) values ('insert 3.5.3.8-1a');
-ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select @test_var;
-@test_var
-before trig 3.5.3.8-1a
-drop trigger trg5a_1;
-use priv_db;
-select current_user;
-current_user
-test_yesprivs@localhost
-show grants;
-Grants for test_yesprivs@localhost
-GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-create trigger trg5a_2 before INSERT on t1 for each row
-set @test_var= new.f1;
-set @test_var= 'before trig 3.5.3.8-2a';
-select @test_var;
-@test_var
-before trig 3.5.3.8-2a
-insert into t1 (f1) values ('insert 3.5.3.8-2a');
-select @test_var;
-@test_var
-insert 3.5.3.8-2a
-drop trigger trg5a_2;
-
-Testcase: 3.5.3.8b
-------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant TRIGGER on *.* to test_noprivs@localhost;
-grant ALL on priv_db.* to test_noprivs@localhost;
-revoke SELECT on priv_db.* from test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant SELECT on priv_db.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-show grants;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `priv_db`.* TO 'test_noprivs'@'localhost'
-use priv_db;
-create trigger trg5b_1 before UPDATE on t1 for each row
-set @test_var= new.f1;
-set @test_var= 'before trig 3.5.3.8-1b';
-insert into t1 (f1) values ('insert 3.5.3.8-1b');
-select @test_var;
-@test_var
-before trig 3.5.3.8-1b
-update t1 set f1= 'update 3.5.3.8-1b' where f1 = 'insert 3.5.3.8-1b';
-ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select @test_var;
-@test_var
-before trig 3.5.3.8-1b
-drop trigger trg5b_1;
-show grants;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-use priv_db;
-create trigger trg5b_2 before UPDATE on t1 for each row
-set @test_var= new.f1;
-set @test_var= 'before trig 3.5.3.8-2b';
-insert into t1 (f1) values ('insert 3.5.3.8-2b');
-select @test_var;
-@test_var
-before trig 3.5.3.8-2b
-update t1 set f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
-select @test_var;
-@test_var
-update 3.5.3.8-2b
-drop trigger trg5b_2;
-
-Testcase 3.5.3.8c:
-------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant TRIGGER on *.* to test_noprivs@localhost;
-grant ALL on priv_db.t1 to test_noprivs@localhost;
-revoke SELECT on priv_db.t1 from test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant SELECT on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-show grants;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-use priv_db;
-create trigger trg5c_1 before INSERT on t1 for each row
-set @test_var= new.f1;
-set @test_var= 'before trig 3.5.3.8-1c';
-insert into t1 (f1) values ('insert 3.5.3.8-1c');
-ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select @test_var;
-@test_var
-before trig 3.5.3.8-1c
-drop trigger trg5c_1;
-show grants;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-use priv_db;
-create trigger trg5c_2 before INSERT on t1 for each row
-set @test_var= new.f1;
-set @test_var='before trig 3.5.3.8-2c';
-insert into t1 (f1) values ('insert 3.5.3.8-2c');
-select @test_var;
-@test_var
-insert 3.5.3.8-2c
-drop trigger trg5c_2;
-
-Testcase: 3.5.3.8d:
--------------------
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant TRIGGER on *.* to test_noprivs@localhost;
-grant UPDATE (f1), INSERT (f1) on priv_db.t1 to test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-show grants;
-Grants for test_noprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-use priv_db;
-create trigger trg5d_1 before INSERT on t1 for each row
-set @test_var= new.f1;
-set @test_var='before trig 3.5.3.8-1d';
-insert into t1 (f1) values ('insert 3.5.3.8-1d');
-ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
-select @test_var;
-@test_var
-before trig 3.5.3.8-1d
-drop trigger trg5d_1;
-show grants;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-use priv_db;
-create trigger trg5d_2 before INSERT on t1 for each row
-set @test_var= new.f1;
-set @test_var='before trig 3.5.3.8-2d';
-insert into t1 (f1) values ('insert 3.5.3.8-2d');
-select @test_var;
-@test_var
-insert 3.5.3.8-2d
-drop trigger trg5d_2;
-
-Testcase: 3.5.3.x:
-------------------
-use priv_db;
-drop table if exists t1;
-drop table if exists t2;
-create table t1 (f1 int) engine= <engine_to_be_used>;
-create table t2 (f2 int) engine= <engine_to_be_used>;
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on *.* to test_yesprivs@localhost;
-grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
-grant SELECT on priv_db.t2 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-create trigger trg1 before insert on t1 for each row
-insert into t2 values (new.f1);
-use priv_db;
-insert into t1 (f1) values (4);
-ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table 't2'
-revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
-grant INSERT on priv_db.t2 to test_yesprivs@localhost;
-insert into t1 (f1) values (4);
-select f1 from t1 order by f1;
-f1
-4
-select f2 from t2 order by f2;
-f2
-4
-use priv_db;
-drop trigger trg1;
-create trigger trg2 before insert on t1 for each row
-update t2 set f2=new.f1-1;
-use priv_db;
-insert into t1 (f1) values (2);
-ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table 't2'
-revoke INSERT on priv_db.t2 from test_yesprivs@localhost;
-grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
-insert into t1 (f1) values (2);
-select f1 from t1 order by f1;
-f1
-2
-4
-select f2 from t2 order by f2;
-f2
-1
-use priv_db;
-drop trigger trg2;
-create trigger trg3 before insert on t1 for each row
-select f2 into @aaa from t2 where f2=new.f1;
-use priv_db;
-insert into t1 (f1) values (1);
-ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table 't2'
-revoke UPDATE on priv_db.t2 from test_yesprivs@localhost;
-grant SELECT on priv_db.t2 to test_yesprivs@localhost;
-insert into t1 (f1) values (1);
-select f1 from t1 order by f1;
-f1
-1
-2
-4
-select f2 from t2 order by f2;
-f2
-1
-select @aaa;
-@aaa
-1
-use priv_db;
-drop trigger trg3;
-create trigger trg4 before insert on t1 for each row
-delete from t2;
-use priv_db;
-insert into t1 (f1) values (1);
-ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table 't2'
-revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
-grant DELETE on priv_db.t2 to test_yesprivs@localhost;
-insert into t1 (f1) values (1);
-select f1 from t1 order by f1;
-f1
-1
-1
-2
-4
-select f2 from t2 order by f2;
-f2
-drop database if exists priv_db;
-drop user test_yesprivs@localhost;
-drop user test_noprivs@localhost;
-drop user test_noprivs;
-use test;
-drop table tb3;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_03e.result b/mysql-test/suite/funcs_1/r/ndb_trig_03e.result
deleted file mode 100644
index 91bd22d3c06..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_trig_03e.result
+++ /dev/null
@@ -1,1620 +0,0 @@
-USE test;
-
-Testcase for db level:
-----------------------
-drop database if exists priv_db;
-drop database if exists no_priv_db;
-create database priv_db;
-create database no_priv_db;
-use priv_db;
-create table t1 (f1 char(20)) engine= ndb;
-create User test_yesprivs@localhost;
-set password for test_yesprivs@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant select on priv_db.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-create User test_noprivs@localhost;
-set password for test_noprivs@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant select,insert on priv_db.* to test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT ON `priv_db`.* TO 'test_noprivs'@'localhost'
-
-no trigger privilege on db level for create:
---------------------------------------------
-use priv_db;
-create trigger trg1_1 before INSERT on t1 for each row
-set new.f1 = 'trig 1_1-no';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-use priv_db;
-insert into t1 (f1) values ('insert-yes');
-select f1 from t1 order by f1;
-f1
-insert-yes
-select current_user;
-current_user
-root@localhost
-grant TRIGGER on priv_db.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-
-trigger privilege on db level for create:
------------------------------------------
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-create trigger trg1_2 before INSERT on t1 for each row
-set new.f1 = 'trig 1_2-yes';
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-insert into t1 (f1) values ('insert-yes');
-ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't1'
-select f1 from t1 order by f1;
-f1
-insert-yes
-select current_user;
-current_user
-root@localhost
-grant UPDATE on priv_db.* to test_yesprivs@localhost;
-use priv_db;
-insert into t1 (f1) values ('insert-no');
-select f1 from t1 order by f1;
-f1
-insert-yes
-trig 1_2-yes
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-insert into t1 (f1) values ('insert-yes');
-select f1 from t1 order by f1;
-f1
-insert-yes
-trig 1_2-yes
-trig 1_2-yes
-select current_user;
-current_user
-root@localhost
-revoke TRIGGER on priv_db.* from test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-
-no trigger privilege on db level for drop:
-------------------------------------------
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-drop trigger trg1_2;
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-
-no trigger privilege at activation time:
-----------------------------------------
-insert into t1 (f1) values ('insert-yes');
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select f1 from t1 order by f1;
-f1
-insert-yes
-trig 1_2-yes
-trig 1_2-yes
-
-trigger privilege at activation time:
--------------------------------------
-select current_user;
-current_user
-root@localhost
-grant TRIGGER on priv_db.* to test_yesprivs@localhost;
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-insert into t1 (f1) values ('insert-no');
-select f1 from t1 order by f1;
-f1
-insert-yes
-trig 1_2-yes
-trig 1_2-yes
-trig 1_2-yes
-
-trigger privilege on db level for drop:
----------------------------------------
-select current_user;
-current_user
-test_yesprivs@localhost
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-drop trigger trg1_2;
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-
-takes effect after use priv_db:
--------------------------------
-use priv_db;
-drop trigger trg1_2;
-select current_user;
-current_user
-root@localhost
-use priv_db;
-insert into t1 (f1) values ('insert-yes');
-select f1 from t1 order by f1;
-f1
-insert-yes
-insert-yes
-trig 1_2-yes
-trig 1_2-yes
-trig 1_2-yes
-
-switch to db without having trigger priv for it:
-------------------------------------------------
-use no_priv_db;
-create table t1 (f1 char(20)) engine= ndb;
-grant SELECT,UPDATE on no_priv_db.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `no_priv_db`.* TO 'test_yesprivs'@'localhost'
-
-use db with trigger privilege on db level and without...:
----------------------------------------------------------
-select current_user;
-current_user
-test_yesprivs@localhost
-use no_priv_db;
-create trigger trg1_3 before INSERT on t1 for each row
-set new.f1 = 'trig 1_3-no';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-use priv_db;
-create trigger trg1_3 before INSERT on t1 for each row
-set new.f1 = 'trig 1_3-yes';
-use no_priv_db;
-create trigger trg1_4 before UPDATE on t1 for each row
-set new.f1 = 'trig 1_4-no';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-use priv_db;
-create trigger trg1_4 before UPDATE on t1 for each row
-set new.f1 = 'trig 1_4-yes';
-select current_user;
-current_user
-test_noprivs@localhost
-use no_priv_db;
-ERROR 42000: Access denied for user 'test_noprivs'@'localhost' to database 'no_priv_db'
-insert into t1 (f1) values ('insert-yes');
-select f1 from t1 order by f1;
-f1
-insert-yes
-insert-yes
-trig 1_2-yes
-trig 1_2-yes
-trig 1_2-yes
-trig 1_3-yes
-use priv_db;
-insert into t1 (f1) values ('insert-no');
-select f1 from t1 order by f1;
-f1
-insert-yes
-insert-yes
-trig 1_2-yes
-trig 1_2-yes
-trig 1_2-yes
-trig 1_3-yes
-trig 1_3-yes
-select current_user;
-current_user
-test_yesprivs@localhost
-use no_priv_db;
-drop trigger trg1_3;
-ERROR HY000: Trigger does not exist
-use priv_db;
-drop trigger trg1_3;
-use no_priv_db;
-drop trigger trg1_4;
-ERROR HY000: Trigger does not exist
-use priv_db;
-drop trigger trg1_4;
-select current_user;
-current_user
-root@localhost
-drop table priv_db.t1;
-drop table no_priv_db.t1;
-drop database if exists priv_db;
-drop database if exists no_priv_db;
-drop user test_yesprivs@localhost;
-drop user test_noprivs@localhost;
-
-######### Testcase for table level: ########
----------------------------------------------------
-drop database if exists priv_db;
-create database priv_db;
-use priv_db;
-create table t1 (f1 char(20)) engine= ndb;
-create User test_yesprivs@localhost;
-set password for test_yesprivs@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-create User test_noprivs@localhost;
-set password for test_noprivs@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-
-no trigger privilege on table level for create:
------------------------------------------------
-select current_user;
-current_user
-root@localhost
-show triggers;
-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
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-grant select, update, insert on priv_db.t1 to test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-show tables;
-Tables_in_priv_db
-t1
-create trigger trg1_1 before INSERT on t1 for each row
-set new.f1 = 'trig 1_1-no';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-insert into t1 (f1) values ('insert1-yes');
-select f1 from t1 order by f1;
-f1
-insert1-yes
-select current_user;
-current_user
-root@localhost
-show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-show tables;
-Tables_in_priv_db
-t1
-insert into t1 (f1) values ('insert2-yes');
-select f1 from t1 order by f1;
-f1
-insert1-yes
-insert2-yes
-grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-
-trigger privilege on table level for create:
---------------------------------------------
-select current_user;
-current_user
-test_yesprivs@localhost
-show triggers;
-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;
-current_user
-test_noprivs@localhost
-insert into t1 (f1) values ('insert3-no');
-select f1 from t1 order by f1;
-f1
-insert1-yes
-insert2-yes
-trig 1_2-yes
-select current_user;
-current_user
-root@localhost
-insert into t1 (f1) values ('insert4-no');
-select f1 from t1 order by f1;
-f1
-insert1-yes
-insert2-yes
-trig 1_2-yes
-trig 1_2-yes
-revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-
-no trigger privilege on table level for drop:
----------------------------------------------
-select current_user;
-current_user
-test_yesprivs@localhost
-drop trigger trg1_2;
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-
-no trigger privilege at activation time:
-----------------------------------------
-select current_user;
-current_user
-test_noprivs@localhost
-insert into t1 (f1) values ('insert5-no');
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select f1 from t1 order by f1;
-f1
-insert1-yes
-insert2-yes
-trig 1_2-yes
-trig 1_2-yes
-select current_user;
-current_user
-root@localhost
-grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
-
-trigger privilege at activation time:
--------------------------------------
-select current_user;
-current_user
-test_noprivs@localhost
-insert into t1 (f1) values ('insert6-no');
-select f1 from t1 order by f1;
-f1
-insert1-yes
-insert2-yes
-trig 1_2-yes
-trig 1_2-yes
-trig 1_2-yes
-
-trigger privilege on table level for drop:
-------------------------------------------
-select current_user;
-current_user
-test_yesprivs@localhost
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-drop trigger trg1_2;
-select current_user;
-current_user
-test_noprivs@localhost
-insert into t1 (f1) values ('insert7-yes');
-select f1 from t1 order by f1;
-f1
-insert1-yes
-insert2-yes
-insert7-yes
-trig 1_2-yes
-trig 1_2-yes
-trig 1_2-yes
-select current_user;
-current_user
-root@localhost
-insert into t1 (f1) values ('insert8-yes');
-select f1 from t1 order by f1;
-f1
-insert1-yes
-insert2-yes
-insert7-yes
-insert8-yes
-trig 1_2-yes
-trig 1_2-yes
-trig 1_2-yes
-
-switch to table without having trigger priv for it:
----------------------------------------------------
-create table t2 (f1 char(20)) engine= ndb;
-grant SELECT, INSERT, UPDATE on priv_db.t2 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-grant SELECT, INSERT, UPDATE on priv_db.t2 to test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_noprivs'@'localhost'
-
-use table with trigger privilege and without...:
-------------------------------------------------
-select current_user;
-current_user
-test_yesprivs@localhost
-create trigger trg2_1 before INSERT on t2 for each row
-set new.f1 = 'trig 2_1-no';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't2'
-create trigger trg1_3 before INSERT on t1 for each row
-set new.f1 = 'trig 1_3-yes';
-create trigger trg2_2 before UPDATE on t2 for each row
-set new.f1 = 'trig 2_2-no';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't2'
-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 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
-insert into t2 (f1) values ('insert9-yes');
-select f1 from t2 order by f1;
-f1
-insert9-yes
-insert into t1 (f1) values ('insert10-no');
-select f1 from t1 order by f1;
-f1
-insert1-yes
-insert2-yes
-insert7-yes
-insert8-yes
-trig 1_2-yes
-trig 1_2-yes
-trig 1_2-yes
-trig 1_3-yes
-select current_user;
-current_user
-test_yesprivs@localhost
-drop trigger trg2_1;
-ERROR HY000: Trigger does not exist
-drop trigger trg1_3;
-drop trigger trg2_2;
-ERROR HY000: Trigger does not exist
-drop trigger trg1_4;
-select current_user;
-current_user
-root@localhost
-drop database if exists priv_db;
-drop user test_yesprivs@localhost;
-drop user test_noprivs@localhost;
-
-#### Testcase for mix of user(global) and db level: ####
---------------------------------------------------------
-drop database if exists priv_db;
-drop database if exists no_priv_db;
-create database priv_db;
-create database no_priv_db;
-use priv_db;
-create table t1 (f1 char(20)) engine= ndb;
-use no_priv_db;
-create table t1 (f1 char(20)) engine= ndb;
-create User test_yesprivs@localhost;
-set password for test_yesprivs@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant ALL on *.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-create User test_noprivs@localhost;
-set password for test_noprivs@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant SELECT,INSERT on *.* to test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT SELECT, INSERT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-select current_user;
-current_user
-test_yesprivs@localhost
-
-trigger privilege on user level for create:
--------------------------------------------
-use priv_db;
-create trigger trg1_1 before INSERT on t1 for each row
-set new.f1 = 'trig 1_1-yes';
-insert into t1 (f1) values ('insert-no');
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-use no_priv_db;
-create trigger priv_db.trg1_5 before UPDATE on priv_db.t1
-for each row
-set new.f1 = 'trig 1_5-yes';
-insert into priv_db.t1 (f1) values ('insert-no');
-select f1 from priv_db.t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-drop trigger priv_db.trg1_5;
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-insert into t1 (f1) values ('insert-no');
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-select current_user;
-current_user
-root@localhost
-use priv_db;
-insert into t1 (f1) values ('insert-no');
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-revoke TRIGGER on *.* from test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-show triggers;
-Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-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 CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-drop trigger trg1_1;
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select current_user;
-current_user
-root@localhost
-show grants;
-Grants for root@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
-drop trigger trg1_1;
-use priv_db;
-
-no trigger privilege on db level for create:
---------------------------------------------
-select current_user;
-current_user
-test_yesprivs@localhost
-create trigger trg1_1 before INSERT on t1 for each row
-set new.f1 = 'trig 1_1-no';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-insert into t1 (f1) values ('insert-yes');
-select f1 from t1 order by f1;
-f1
-insert-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-select current_user;
-current_user
-root@localhost
-grant TRIGGER on priv_db.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-
-trigger privilege on db level for create:
------------------------------------------
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-create trigger trg1_2 before INSERT on t1 for each row
-set new.f1 = 'trig 1_2-yes';
-create trigger no_priv_db.trg1_9 before insert on no_priv_db.t1
-for each row
-set new.f1 = 'trig 1_9-yes';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-use no_priv_db;
-create trigger trg1_2 before INSERT on t1 for each row
-set new.f1 = 'trig 1_2-no';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-create trigger priv_db.trg1_9 before UPDATE on priv_db.t1
-for each row
-set new.f1 = 'trig 1_9-yes';
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-insert into t1 (f1) values ('insert-yes');
-select f1 from t1 order by f1;
-f1
-insert-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_2-yes
-use no_priv_db;
-insert into t1 (f1) values ('insert-yes');
-select f1 from t1 order by f1;
-f1
-insert-yes
-drop trigger priv_db.trg1_9;
-ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
-select current_user;
-current_user
-root@localhost
-drop trigger priv_db.trg1_9;
-revoke TRIGGER on priv_db.* from test_yesprivs@localhost;
-use priv_db;
-insert into t1 (f1) values ('insert-yes');
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select f1 from t1 order by f1;
-f1
-insert-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_2-yes
-grant TRIGGER on *.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-select current_user;
-current_user
-test_yesprivs@localhost
-use no_priv_db;
-create trigger trg1_2 before INSERT on t1 for each row
-set new.f1 = 'trig 1_2-no';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-insert into t1 (f1) values ('insert-no');
-select f1 from t1 order by f1;
-f1
-insert-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_2-yes
-trig 1_2-yes
-use no_priv_db;
-insert into t1 (f1) values ('insert-yes');
-select f1 from t1 order by f1;
-f1
-insert-yes
-insert-yes
-select current_user;
-current_user
-test_yesprivs@localhost
-use no_priv_db;
-create trigger trg1_2 before INSERT on t1 for each row
-set new.f1 = 'trig 1_2-yes';
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-insert into t1 (f1) values ('insert-no');
-select f1 from t1 order by f1;
-f1
-insert-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_2-yes
-trig 1_2-yes
-trig 1_2-yes
-use no_priv_db;
-insert into t1 (f1) values ('insert-no');
-select f1 from t1 order by f1;
-f1
-insert-yes
-insert-yes
-trig 1_2-yes
-select current_user;
-current_user
-root@localhost
-drop database if exists priv_db;
-drop database if exists no_priv_db;
-drop database if exists h1;
-drop user test_yesprivs@localhost;
-drop user test_noprivs@localhost;
-
-####### Testcase for mix of db and table level: #######
--------------------------------------------------------
-drop database if exists priv1_db;
-drop database if exists priv2_db;
-create database priv1_db;
-create database priv2_db;
-use priv1_db;
-create table t1 (f1 char(20)) engine= ndb;
-create table t2 (f1 char(20)) engine= ndb;
-use priv2_db;
-create table t1 (f1 char(20)) engine= ndb;
-create User test_yesprivs@localhost;
-set password for test_yesprivs@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant ALL on priv1_db.* to test_yesprivs@localhost;
-grant SELECT,UPDATE on priv2_db.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-create User test_noprivs@localhost;
-set password for test_noprivs@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant SELECT,INSERT,UPDATE on priv1_db.* to test_noprivs@localhost;
-grant SELECT,INSERT on priv2_db.* to test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO 'test_noprivs'@'localhost'
-GRANT SELECT, INSERT ON `priv2_db`.* TO 'test_noprivs'@'localhost'
-use priv1_db;
-use priv1_db;
-
-trigger privilege on one db1 db level, not on db2
--------------------------------------------------
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv1_db;
-create trigger trg1_1 before INSERT on t1 for each row
-set new.f1 = 'trig 1_1-yes';
-create trigger trg2_1 before INSERT on t2 for each row
-set new.f1 = 'trig 2_1-yes';
-use priv2_db;
-create trigger trg1_1 before INSERT on t1 for each row
-set new.f1 = 'trig1_1-yes';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select current_user;
-current_user
-test_noprivs@localhost
-insert into t1 (f1) values ('insert1_no');
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-insert into t2 (f1) values ('insert1_no');
-select f1 from t2 order by f1;
-f1
-trig 2_1-yes
-insert into priv2_db.t1 (f1) values ('insert21-yes');
-select f1 from priv2_db.t1 order by f1;
-f1
-insert21-yes
-use priv2_db;
-insert into t1 (f1) values ('insert1_yes');
-select f1 from t1 order by f1;
-f1
-insert1_yes
-insert21-yes
-insert into priv1_db.t1 (f1) values ('insert11-no');
-select f1 from priv1_db.t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-insert into priv1_db.t2 (f1) values ('insert22-no');
-select f1 from priv1_db.t2 order by f1;
-f1
-trig 2_1-yes
-trig 2_1-yes
-
-revoke trigger privilege on table level (not existing)
-------------------------------------------------------
-select current_user;
-current_user
-root@localhost
-use priv1_db;
-revoke TRIGGER on priv1_db.t1 from test_yesprivs@localhost;
-ERROR 42000: There is no such grant defined for user 'test_yesprivs' on host 'localhost' on table 't1'
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-select current_user;
-current_user
-test_yesprivs@localhost
-drop trigger trg1_1;
-ERROR HY000: Trigger does not exist
-drop trigger trg2_1;
-ERROR HY000: Trigger does not exist
-use priv1_db;
-drop trigger trg1_1;
-drop trigger trg2_1;
-select current_user;
-current_user
-root@localhost
-use priv1_db;
-revoke TRIGGER on priv1_db.* from test_yesprivs@localhost;
-
-no trigger privilege on table level for create:
------------------------------------------------
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv1_db;
-create trigger trg1_1 before INSERT on t1 for each row
-set new.f1 = 'trig 1_1-no';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select current_user;
-current_user
-root@localhost
-show triggers;
-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
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
-
-trigger privilege on table level for create:
---------------------------------------------
-select current_user;
-current_user
-test_yesprivs@localhost
-show triggers;
-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
-set new.f1 = 'trig 2_1-no';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't2'
-select current_user;
-current_user
-test_noprivs@localhost
-use priv1_db;
-insert into t1 (f1) values ('insert2-no');
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_2-yes
-insert into t2 (f1) values ('insert2-yes');
-select f1 from t2 order by f1;
-f1
-insert2-yes
-trig 2_1-yes
-trig 2_1-yes
-insert into priv2_db.t1 (f1) values ('insert22-yes');
-select f1 from priv2_db.t1 order by f1;
-f1
-insert1_yes
-insert21-yes
-insert22-yes
-select current_user;
-current_user
-root@localhost
-grant TRIGGER on priv1_db.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
-GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
-select current_user;
-current_user
-test_yesprivs@localhost
-create trigger trg2_1 before INSERT on t2 for each row
-set new.f1 = 'trig 2_1-yes';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't2'
-use priv1_db;
-create trigger trg2_1 before INSERT on t2 for each row
-set new.f1 = 'trig 2_1-yes';
-select current_user;
-current_user
-test_noprivs@localhost
-use priv1_db;
-insert into t1 (f1) values ('insert3-no');
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_2-yes
-trig 1_2-yes
-insert into t2 (f1) values ('insert3-no');
-select f1 from t2 order by f1;
-f1
-insert2-yes
-trig 2_1-yes
-trig 2_1-yes
-trig 2_1-yes
-use priv2_db;
-insert into priv1_db.t1 (f1) values ('insert12-no');
-select f1 from priv1_db.t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_2-yes
-trig 1_2-yes
-trig 1_2-yes
-insert into priv1_db.t2 (f1) values ('insert23-no');
-select f1 from priv1_db.t2 order by f1;
-f1
-insert2-yes
-trig 2_1-yes
-trig 2_1-yes
-trig 2_1-yes
-trig 2_1-yes
-select current_user;
-current_user
-test_yesprivs@localhost
-drop trigger trg1_2;
-drop trigger trg2_1;
-select current_user;
-current_user
-root@localhost
-drop database if exists priv1_db;
-drop database if exists priv2_db;
-drop user test_yesprivs@localhost;
-drop user test_noprivs@localhost;
-
-#### Testcase for trigger privilege on execution time ########
---------------------------------------------------------------
-drop database if exists priv_db;
-create database priv_db;
-use priv_db;
-create table t1 (f1 char(20)) engine= ndb;
-create User test_yesprivs@localhost;
-set password for test_yesprivs@localhost = password('PWD');
-create User test_useprivs@localhost;
-set password for test_useprivs@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_useprivs@localhost;
-select current_user;
-current_user
-root@localhost
-show triggers;
-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;
-grant select
-on priv_db.t1 to test_useprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-create trigger trg1_1 before INSERT on t1 for each row
-set new.f1 = 'trig 1_1-yes';
-grant insert on t1 to test_useprivs@localhost;
-prepare ins1 from 'insert into t1 (f1) values (''insert1-no'')';
-execute ins1;
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-prepare ins1 from 'insert into t1 (f1) values (''insert2-no'')';
-select current_user;
-current_user
-test_useprivs@localhost
-use priv_db;
-prepare ins1 from 'insert into t1 (f1) values (''insert3-no'')';
-execute ins1;
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-select current_user;
-current_user
-root@localhost
-revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-select current_user;
-current_user
-test_yesprivs@localhost
-execute ins1;
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-prepare ins1 from 'insert into t1 (f1) values (''insert4-no'')';
-select current_user;
-current_user
-test_useprivs@localhost
-prepare ins1 from 'insert into t1 (f1) values (''insert5-no'')';
-execute ins1;
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-select current_user;
-current_user
-root@localhost
-grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-select current_user;
-current_user
-test_yesprivs@localhost
-execute ins1;
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-prepare ins1 from 'insert into t1 (f1) values (''insert6-no'')';
-select current_user;
-current_user
-test_useprivs@localhost
-execute ins1;
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-prepare ins1 from 'insert into t1 (f1) values (''insert7-no'')';
-select current_user;
-current_user
-root@localhost
-revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-select current_user;
-current_user
-test_yesprivs@localhost
-execute ins1;
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-select current_user;
-current_user
-test_useprivs@localhost
-execute ins1;
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-select current_user;
-current_user
-root@localhost
-grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-select current_user;
-current_user
-test_yesprivs@localhost
-execute ins1;
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-select current_user;
-current_user
-test_useprivs@localhost
-execute ins1;
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-select current_user;
-current_user
-root@localhost
-revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-select current_user;
-current_user
-test_yesprivs@localhost
-execute ins1;
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-deallocate prepare ins1;
-select current_user;
-current_user
-test_useprivs@localhost
-execute ins1;
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-deallocate prepare ins1;
-select current_user;
-current_user
-root@localhost
-grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-select current_user;
-current_user
-test_yesprivs@localhost
-drop trigger trg1_1;
-select current_user;
-current_user
-root@localhost
-select current_user;
-current_user
-root@localhost
-drop database if exists priv_db;
-drop user test_yesprivs@localhost;
-drop user test_useprivs@localhost;
-
-######### Testcase for definer: ########
------------------------------------------------
-drop database if exists priv_db;
-create database priv_db;
-use priv_db;
-create table t1 (f1 char(20)) engine= ndb;
-create User test_yesprivs@localhost;
-set password for test_yesprivs@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-select current_user;
-current_user
-root@localhost
-create definer=not_ex_user@localhost trigger trg1_0
-before INSERT on t1 for each row
-set new.f1 = 'trig 1_0-yes';
-Warnings:
-Note 1449 The user specified as a definer ('not_ex_user'@'localhost') does not exist
-drop trigger trg1_0;
-create definer=test_yesprivs@localhost trigger trg1_0
-before INSERT on t1 for each row
-set new.f1 = 'trig 1_0-yes';
-grant select, insert, update
-on priv_db.t1 to test_yesprivs@localhost;
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-insert into t1 (f1) values ('insert-no');
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select f1 from t1 order by f1;
-f1
-drop trigger trg1_0;
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select current_user;
-current_user
-root@localhost
-grant select, insert, update ,trigger
-on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-select current_user;
-current_user
-test_yesprivs@localhost
-insert into t1 (f1) values ('insert-no');
-select f1 from t1 order by f1;
-f1
-trig 1_0-yes
-drop trigger trg1_0;
-create definer=not_ex_user@localhost trigger trg1_0
-before INSERT on t1 for each row
-set new.f1 = 'trig 1_0-yes';
-ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
-create definer=current_user trigger trg1_1
-before INSERT on t1 for each row
-set new.f1 = 'trig 1_1-yes';
-insert into t1 (f1) values ('insert-no');
-select f1 from t1 order by f1;
-f1
-trig 1_0-yes
-trig 1_1-yes
-create definer=test_yesprivs@localhost trigger trg1_2
-before UPDATE on t1 for each row
-set new.f1 = 'trig 1_2-yes';
-update t1 set f1 = 'update-yes' where f1 like '%trig%';
-select f1 from t1 order by f1;
-f1
-trig 1_2-yes
-trig 1_2-yes
-select current_user;
-current_user
-root@localhost
-grant trigger on priv_db.* to test_yesprivs@localhost
-with grant option;
-select current_user;
-current_user
-test_yesprivs@localhost
-show grants;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-create definer=not_ex_user@localhost trigger trg1_3
-after UPDATE on t1 for each row
-set @var1 = 'trig 1_3-yes';
-ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
-select current_user;
-current_user
-root@localhost
-select current_user;
-current_user
-root@localhost
-drop database if exists priv_db;
-drop user test_yesprivs@localhost;
-
-######### Testcase for transactions: ########
-----------------------------------------------------
-drop database if exists priv_db;
-create database priv_db;
-use priv_db;
-create table t1 (f1 char(20)) engine= ndb;
-create User test_yesprivs@localhost;
-set password for test_yesprivs@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-select current_user;
-current_user
-root@localhost
-grant select, insert, update ,trigger
-on priv_db.t1 to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-set autocommit=0;
-create definer=current_user trigger trg1_1
-before INSERT on t1 for each row
-set new.f1 = 'trig 1_1-yes';
-rollback work;
-insert into t1 (f1) values ('insert-no');
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-create definer=test_yesprivs@localhost trigger trg1_2
-before UPDATE on t1 for each row
-set new.f1 = 'trig 1_2-yes';
-commit work;
-update t1 set f1 = 'update-yes' where f1 like '%trig%';
-select f1 from t1 order by f1;
-f1
-trig 1_2-yes
-commit work;
-drop trigger trg1_1;
-rollback work;
-drop trigger trg1_1;
-ERROR HY000: Trigger does not exist
-drop trigger trg1_2;
-commit work;
-set autocommit=1;
-select current_user;
-current_user
-root@localhost
-select current_user;
-current_user
-root@localhost
-drop database if exists priv_db;
-drop user test_yesprivs@localhost;
-
-####### Testcase for column privileges of triggers: #######
------------------------------------------------------------
-drop database if exists priv_db;
-drop database if exists no_priv_db;
-create database priv_db;
-use priv_db;
-create table t1 (f1 char(20)) engine= ndb;
-create table t2 (f1 char(20)) engine= ndb;
-create User test_yesprivs@localhost;
-set password for test_yesprivs@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
-grant TRIGGER on priv_db.* to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-create User test_noprivs@localhost;
-set password for test_noprivs@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
-grant SELECT,UPDATE on priv_db.* to test_noprivs@localhost;
-show grants for test_noprivs@localhost;
-Grants for test_noprivs@localhost
-GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_noprivs'@'localhost'
-
-update only on column:
-----------------------
-select current_user;
-current_user
-root@localhost
-grant SELECT(f1),INSERT,UPDATE(f1) on priv_db.t1
-to test_yesprivs@localhost;
-grant SELECT(f1),INSERT,UPDATE(f1) on priv_db.t2
-to test_yesprivs@localhost;
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-insert into t1 (f1) values ('insert1-yes');
-insert into t2 (f1) values ('insert1-yes');
-create trigger trg1_1 before UPDATE on t1 for each row
-set new.f1 = 'trig 1_1-yes';
-create trigger trg2_1 before UPDATE on t2 for each row
-set new.f1 = 'trig 2_1-yes';
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-select f1 from t1 order by f1;
-f1
-insert1-yes
-update t1 set f1 = 'update1_no'
- where f1 like '%insert%';
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-select f1 from t2 order by f1;
-f1
-insert1-yes
-update t2 set f1 = 'update1_no'
- where f1 like '%insert%';
-select f1 from t2 order by f1;
-f1
-trig 2_1-yes
-select current_user;
-current_user
-root@localhost
-revoke UPDATE on priv_db.*
-from test_yesprivs@localhost;
-revoke UPDATE(f1) on priv_db.t2
-from test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-insert into t1 (f1) values ('insert2-yes');
-insert into t2 (f1) values ('insert2-yes');
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-update t1 set f1 = 'update2_no'
- where f1 like '%insert%';
-update t2 set f1 = 'update2_no'
- where f1 like '%insert%';
-ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't2'
-update t1 set f1 = 'update3_no'
- where f1 like '%insert%';
-update t2 set f1 = 'update3_no'
- where f1 like '%insert%';
-ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't2'
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-select f1 from t2 order by f1;
-f1
-insert2-yes
-trig 2_1-yes
-
-check if access only on one of three columns
---------------------------------------------
-select current_user;
-current_user
-root@localhost
-alter table priv_db.t1 add f2 char(20), add f3 int;
-revoke TRIGGER on priv_db.* from test_yesprivs@localhost;
-grant TRIGGER,SELECT on priv_db.t1 to test_yesprivs@localhost;
-grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-insert into t1 values ('insert2-yes','insert2-yes',1);
-insert into t1 values ('insert3-yes','insert3-yes',2);
-select * from t1 order by f1;
-f1 f2 f3
-insert2-yes insert2-yes 1
-insert3-yes insert3-yes 2
-trig 1_1-yes NULL NULL
-trig 1_1-yes NULL NULL
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-update t1 set f1 = 'update4-no',
-f2 = 'update4-yes',
-f3 = f3*10
-where f2 like '%yes';
-select * from t1 order by f1,f2,f3;
-f1 f2 f3
-trig 1_1-yes NULL NULL
-trig 1_1-yes NULL NULL
-trig 1_1-yes update4-yes 10
-trig 1_1-yes update4-yes 20
-select current_user;
-current_user
-test_yesprivs@localhost
-create trigger trg1_2 after UPDATE on t1 for each row
-set @f2 = 'trig 1_2-yes';
-select current_user;
-current_user
-test_noprivs@localhost
-update t1 set f1 = 'update5-yes',
-f2 = 'update5-yes'
- where f2 like '%yes';
-select * from t1 order by f1,f2,f3;
-f1 f2 f3
-trig 1_1-yes NULL NULL
-trig 1_1-yes NULL NULL
-trig 1_1-yes update5-yes 10
-trig 1_1-yes update5-yes 20
-select @f2;
-@f2
-trig 1_2-yes
-update t1 set f1 = 'update6_no'
- where f1 like '%insert%';
-update t2 set f1 = 'update6_no'
- where f1 like '%insert%';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't2'
-update t1 set f1 = 'update7_no'
- where f1 like '%insert%';
-update t2 set f1 = 'update7_no'
- where f1 like '%insert%';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't2'
-select f1 from t1 order by f1;
-f1
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-trig 1_1-yes
-select f1 from t2 order by f1;
-f1
-insert2-yes
-trig 2_1-yes
-
-check if rejected without trigger privilege:
---------------------------------------------
-select current_user;
-current_user
-root@localhost
-revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
-select current_user;
-current_user
-test_noprivs@localhost
-update t1 set f1 = 'update8-no',
-f2 = 'update8-no'
- where f2 like '%yes';
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select * from t1 order by f1,f2,f3;
-f1 f2 f3
-trig 1_1-yes NULL NULL
-trig 1_1-yes NULL NULL
-trig 1_1-yes update5-yes 10
-trig 1_1-yes update5-yes 20
-select @f2;
-@f2
-trig 1_2-yes
-
-check trigger, but not update privilege on column:
---------------------------------------------------
-select current_user;
-current_user
-root@localhost
-revoke UPDATE(f1) on priv_db.t1 from test_yesprivs@localhost;
-grant TRIGGER,UPDATE(f2),UPDATE(f3) on priv_db.t1
-to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-select current_user;
-current_user
-test_yesprivs@localhost
-use priv_db;
-drop trigger trg1_1;
-create trigger trg1_3 before UPDATE on t1 for each row
-set new.f1 = 'trig 1_3-yes';
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-update t1 set f1 = 'update9-no',
-f2 = 'update9-no'
- where f2 like '%yes';
-ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't1'
-select * from t1 order by f1,f2,f3;
-f1 f2 f3
-trig 1_1-yes NULL NULL
-trig 1_1-yes NULL NULL
-trig 1_1-yes update5-yes 10
-trig 1_1-yes update5-yes 20
-update t1 set f3= f3+1;
-ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't1'
-select f3 from t1 order by f3;
-f3
-NULL
-NULL
-10
-20
-select current_user;
-current_user
-root@localhost
-revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
-grant UPDATE(f1),UPDATE(f2),UPDATE(f3) on priv_db.t1
-to test_yesprivs@localhost;
-show grants for test_yesprivs@localhost;
-Grants for test_yesprivs@localhost
-GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
-GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
-select current_user;
-current_user
-test_noprivs@localhost
-use priv_db;
-update t1 set f3= f3+1;
-ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
-select f3 from t1 order by f3;
-f3
-NULL
-NULL
-10
-20
-
-##### trigger privilege on column level? #######
-------------------------------------------------
-grant TRIGGER(f1) on priv_db.t1 to test_yesprivs@localhost;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(f1) on priv_db.t1 to test_yesprivs@localhost' at line 1
-select current_user;
-current_user
-root@localhost
-drop database if exists priv_db;
-drop user test_yesprivs@localhost;
-drop user test_noprivs@localhost;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_0407.result b/mysql-test/suite/funcs_1/r/ndb_trig_0407.result
deleted file mode 100644
index 8597f252e54..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_trig_0407.result
+++ /dev/null
@@ -1,470 +0,0 @@
-USE test;
-drop table if exists tb3;
-create table tb3 (
-f118 char not null DEFAULT 'a',
-f119 char binary not null DEFAULT b'101',
-f120 char ascii not null DEFAULT b'101',
-f121 char(50),
-f122 char(50),
-f129 binary not null DEFAULT b'101',
-f130 tinyint not null DEFAULT 99,
-f131 tinyint unsigned not null DEFAULT 99,
-f132 tinyint zerofill not null DEFAULT 99,
-f133 tinyint unsigned zerofill not null DEFAULT 99,
-f134 smallint not null DEFAULT 999,
-f135 smallint unsigned not null DEFAULT 999,
-f136 smallint zerofill not null DEFAULT 999,
-f137 smallint unsigned zerofill not null DEFAULT 999,
-f138 mediumint not null DEFAULT 9999,
-f139 mediumint unsigned not null DEFAULT 9999,
-f140 mediumint zerofill not null DEFAULT 9999,
-f141 mediumint unsigned zerofill not null DEFAULT 9999,
-f142 int not null DEFAULT 99999,
-f143 int unsigned not null DEFAULT 99999,
-f144 int zerofill not null DEFAULT 99999,
-f145 int unsigned zerofill not null DEFAULT 99999,
-f146 bigint not null DEFAULT 999999,
-f147 bigint unsigned not null DEFAULT 999999,
-f148 bigint zerofill not null DEFAULT 999999,
-f149 bigint unsigned zerofill not null DEFAULT 999999,
-f150 decimal not null DEFAULT 999.999,
-f151 decimal unsigned not null DEFAULT 999.17,
-f152 decimal zerofill not null DEFAULT 999.999,
-f153 decimal unsigned zerofill,
-f154 decimal (0),
-f155 decimal (64),
-f156 decimal (0) unsigned,
-f157 decimal (64) unsigned,
-f158 decimal (0) zerofill,
-f159 decimal (64) zerofill,
-f160 decimal (0) unsigned zerofill,
-f161 decimal (64) unsigned zerofill,
-f162 decimal (0,0),
-f163 decimal (63,30),
-f164 decimal (0,0) unsigned,
-f165 decimal (63,30) unsigned,
-f166 decimal (0,0) zerofill,
-f167 decimal (63,30) zerofill,
-f168 decimal (0,0) unsigned zerofill,
-f169 decimal (63,30) unsigned zerofill,
-f170 numeric,
-f171 numeric unsigned,
-f172 numeric zerofill,
-f173 numeric unsigned zerofill,
-f174 numeric (0),
-f175 numeric (64)
-) engine = <engine_to_be_used>;
-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
-
-Testcase: 3.5:
---------------
-create User test_general@localhost;
-set password for test_general@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_general@localhost;
-create User test_super@localhost;
-set password for test_super@localhost = password('PWD');
-grant ALL on *.* to test_super@localhost with grant OPTION;
-
-Testcase 3.5.4:
----------------
-use test;
-
-Testcase 3.5.4.1:
------------------
-create database db_drop;
-Use db_drop;
-create table t1 (f1 char(30)) engine = <engine_to_be_used>;
-grant INSERT, SELECT on db_drop.t1 to test_general;
-Use db_drop;
-Create trigger trg1 BEFORE INSERT on t1
-for each row set new.f1='Trigger 3.5.4.1';
-Use db_drop;
-Insert into t1 values ('Insert error 3.5.4.1');
-Select * from t1 order by f1;
-f1
-Trigger 3.5.4.1
-drop trigger trg1;
-select trigger_schema, trigger_name, event_object_table
-from information_schema.triggers
-where trigger_schema = 'db_drop'
- order by trigger_name;
-trigger_schema trigger_name event_object_table
-Insert into t1 values ('Insert no trigger 3.5.4.1');
-Select * from t1 order by f1;
-f1
-Insert no trigger 3.5.4.1
-Trigger 3.5.4.1
-drop trigger trg1;
-drop database if exists db_drop;
-revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
-
-Testcase 3.5.4.2:
------------------
-create database db_drop2;
-Use db_drop2;
-drop table if exists t1_432 ;
-create table t1_432 (f1 char (30)) engine = <engine_to_be_used>;
-Drop trigger tr_does_not_exit;
-ERROR HY000: Trigger does not exist
-drop table if exists t1_432 ;
-drop database if exists db_drop2;
-
-Testcase 3.5.4.3:
------------------
-create database db_drop3;
-Use db_drop3;
-drop table if exists t1_433 ;
-drop table if exists t1_433a ;
-create table t1_433 (f1 char (30)) engine = <engine_to_be_used>;
-create table t1_433a (f1a char (5)) engine = <engine_to_be_used>;
-CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
-set new.f1 = 'Trigger 3.5.4.3';
-Drop trigger t1.433.trg3;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.trg3' at line 1
-Drop trigger db_drop3.t1.433.trg3;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.433.trg3' at line 1
-Drop trigger mysql.trg3;
-ERROR HY000: Trigger does not exist
-Drop trigger tbx.trg3;
-ERROR HY000: Trigger does not exist
-Drop trigger db_drop3.trg3;
-drop table if exists t1_433;
-drop table if exists t1_433a;
-drop database if exists db_drop3;
-
-Testcase 3.5.4.4:
------------------
-create database db_drop4;
-Use db_drop4;
-create table t1 (f1 char(30)) engine = <engine_to_be_used>;
-grant INSERT, SELECT on db_drop4.t1 to test_general;
-Create trigger trg4 BEFORE INSERT on t1
-for each row set new.f1='Trigger 3.5.4.4';
-Use db_drop4;
-Insert into t1 values ('Insert 3.5.4.4');
-Select * from t1;
-f1
-Trigger 3.5.4.4
-Drop database db_drop4;
-Show databases like 'db_drop4';
-Database (db_drop4)
-select trigger_schema, trigger_name, event_object_table
-from information_schema.triggers
-where information_schema.triggers.trigger_name='trg4';
-trigger_schema trigger_name event_object_table
-create database db_drop4;
-Use db_drop4;
-create table t1 (f1 char(30)) engine = <engine_to_be_used>;
-grant INSERT, SELECT on db_drop4.t1 to test_general;
-Insert into t1 values ('2nd Insert 3.5.4.4');
-Select * from t1;
-f1
-2nd Insert 3.5.4.4
-drop trigger trg4;
-ERROR HY000: Trigger does not exist
-drop database if exists db_drop4;
-revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
-
-Testcase 3.5.4.5:
------------------
-create database db_drop5;
-Use db_drop5;
-create table t1 (f1 char(50)) engine = <engine_to_be_used>;
-grant INSERT, SELECT on t1 to test_general;
-Create trigger trg5 BEFORE INSERT on t1
-for each row set new.f1='Trigger 3.5.4.5';
-Use db_drop5;
-Insert into t1 values ('Insert 3.5.4.5');
-Select * from t1;
-f1
-Trigger 3.5.4.5
-Drop table t1;
-Show tables;
-Tables_in_db_drop5
-select trigger_schema, trigger_name, event_object_table
-from information_schema.triggers
-where information_schema.triggers.trigger_name='trg5';
-trigger_schema trigger_name event_object_table
-create table t1 (f1 char(50)) engine = <engine_to_be_used>;
-grant INSERT, SELECT on t1 to test_general;
-Insert into t1 values ('2nd Insert 3.5.4.5');
-Select * from t1;
-f1
-2nd Insert 3.5.4.5
-drop trigger trg5;
-ERROR HY000: Trigger does not exist
-drop database if exists db_drop5;
-revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
-
-Testcase 3.5.5:
----------------
-use test;
-
-Testcase 3.5.5.1:
------------------
-Create trigger trg1 before INSERT on t100 for each row set new.f2=1000;
-ERROR 42S02: Table 'test.t100' doesn't exist
-
-Testcase 3.5.5.2:
------------------
-Create temporary table t1_temp (f1 bigint signed, f2 bigint unsigned);
-Create trigger trg2 before INSERT
-on t1_temp for each row set new.f2=9999;
-ERROR HY000: Trigger's 't1_temp' is view or temporary table
-drop table t1_temp;
-
-Testcase 3.5.5.3:
------------------
-Create view vw3 as select f118 from tb3;
-Create trigger trg3 before INSERT
-on vw3 for each row set new.f118='s';
-ERROR HY000: 'test.vw3' is not BASE TABLE
-drop view vw3;
-
-Testcase 3.5.5.4:
------------------
-create database dbtest_one;
-create database dbtest_two;
-use dbtest_two;
-create table t2 (f1 char(15)) engine = <engine_to_be_used>;
-use dbtest_one;
-create trigger trg4 before INSERT
-on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
-ERROR HY000: Trigger in wrong schema
-grant INSERT, SELECT on dbtest_two.t2 to test_general;
-grant SELECT on dbtest_one.* to test_general;
-use dbtest_two;
-Insert into t2 values ('1st Insert 3.5.5.4');
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-Select * from t2;
-f1
-1st Insert 3.5.
-use dbtest_one;
-Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
-Warnings:
-Warning 1265 Data truncated for column 'f1' at row 1
-Select * from dbtest_two.t2 order by f1;
-f1
-1st Insert 3.5.
-2nd Insert 3.5.
-revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
-DROP DATABASE if exists dbtest_one;
-drop database if EXISTS dbtest_two;
-
-Testcase 3.5.6:
----------------
-use test;
-
-Testcase 3.5.6.1 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.6.2 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.6.3:
------------------
-Create trigger trg3_1 DURING UPDATE on tb3 for each row set new.f132=25;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DURING UPDATE on tb3 for each row set new.f132=25' at line 1
-Create trigger trg3_2 TIME INSERT on tb3 for each row set new.f132=15;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TIME INSERT on tb3 for each row set new.f132=15' at line 1
-drop trigger tb3.trg3_1;
-drop trigger tb3.trg3_2;
-
-Testcase 3.5.6.4 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.6.5 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.7.1 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.7.2 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.7.3 (see Testcase 3.5.1.1)
----------------------------------------
-
-Testcase 3.5.7.4:
------------------
-Create trigger trg4_1 BEFORE SELECT on tb3 for each row set new.f132=5;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT on tb3 for each row set new.f132=5' at line 1
-Create trigger trg4_2 AFTER VALUE on tb3 for each row set new.f132=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 'VALUE on tb3 for each row set new.f132=1' at line 1
-drop trigger tb3.trg4_1;
-drop trigger tb3.trg4_2;
-
-Testcase 3.5.7.5 / 3.5.7.6:
----------------------------
-Create trigger trg5_1 BEFORE INSERT
-on tb3 for each row set new.f122='Trigger1 3.5.7.5/6';
-Create trigger trg5_2 BEFORE INSERT
-on tb3 for each row set new.f122='Trigger2 3.5.7.5';
-ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
-Insert into tb3 (f121,f122) values ('Test 3.5.7.5/6','Insert 3.5.7.5');
-Select f121,f122 from tb3 where f121='Test 3.5.7.5/6';
-f121 f122
-Test 3.5.7.5/6 Trigger1 3.5.7.5/6
-update tb3 set f122='Update 3.5.7.6' where f121= 'Test 3.5.7.5/6';
-Select f121,f122 from tb3 where f121='Test 3.5.7.5/6';
-f121 f122
-Test 3.5.7.5/6 Update 3.5.7.6
-drop trigger trg5_1;
-drop trigger trg5_2;
-delete from tb3 where f121='Test 3.5.7.5/6';
-
-Testcase 3.5.7.7 / 3.5.7.8:
----------------------------
-set @test_var='Before trig 3.5.7.7';
-Create trigger trg6_1 AFTER INSERT
-on tb3 for each row set @test_var='Trigger1 3.5.7.7/8';
-Create trigger trg6_2 AFTER INSERT
-on tb3 for each row set @test_var='Trigger2 3.5.7.7';
-ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
-select @test_var;
-@test_var
-Before trig 3.5.7.7
-Insert into tb3 (f121,f122) values ('Test 3.5.7.7/8','Insert 3.5.7.7');
-Select f121,f122 from tb3 where f121='Test 3.5.7.7/8';
-f121 f122
-Test 3.5.7.7/8 Insert 3.5.7.7
-select @test_var;
-@test_var
-Trigger1 3.5.7.7/8
-update tb3 set f122='Update 3.5.7.8' where f121= 'Test 3.5.7.7/8';
-Select f121,f122 from tb3 where f121='Test 3.5.7.7/8';
-f121 f122
-Test 3.5.7.7/8 Update 3.5.7.8
-select @test_var;
-@test_var
-Trigger1 3.5.7.7/8
-drop trigger trg6_1;
-drop trigger trg6_2;
-delete from tb3 where f121='Test 3.5.7.7/8';
-
-Testcase 3.5.7.9/10:
---------------------
-Create trigger trg7_1 BEFORE UPDATE
-on tb3 for each row set new.f122='Trigger1 3.5.7.9/10';
-Create trigger trg7_2 BEFORE UPDATE
-on tb3 for each row set new.f122='Trigger2 3.5.7.9';
-ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
-Insert into tb3 (f121,f122) values ('Test 3.5.7.9/10','Insert 3.5.7.9');
-Select f121,f122 from tb3 where f121='Test 3.5.7.9/10';
-f121 f122
-Test 3.5.7.9/10 Insert 3.5.7.9
-update tb3 set f122='update 3.5.7.10' where f121='Test 3.5.7.9/10';
-Select f121,f122 from tb3 where f121='Test 3.5.7.9/10';
-f121 f122
-Test 3.5.7.9/10 Trigger1 3.5.7.9/10
-drop trigger trg7_1;
-drop trigger trg7_2;
-delete from tb3 where f121='Test 3.5.7.9/10';
-
-Testcase 3.5.7.11/12:
----------------------
-set @test_var='Before trig 3.5.7.11';
-Create trigger trg8_1 AFTER UPDATE
-on tb3 for each row set @test_var='Trigger 3.5.7.11/12';
-Create trigger trg8_2 AFTER UPDATE
-on tb3 for each row set @test_var='Trigger2 3.5.7.11';
-ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
-select @test_var;
-@test_var
-Before trig 3.5.7.11
-Insert into tb3 (f121,f122) values ('Test 3.5.7.11/12','Insert 3.5.7.11/12');
-select @test_var;
-@test_var
-Before trig 3.5.7.11
-Select f121,f122 from tb3 where f121='Test 3.5.7.11/12';
-f121 f122
-Test 3.5.7.11/12 Insert 3.5.7.11/12
-update tb3 set f122='update 3.5.7.12' where f121='Test 3.5.7.11/12';
-Select f121,f122 from tb3 where f121='Test 3.5.7.11/12';
-f121 f122
-Test 3.5.7.11/12 update 3.5.7.12
-select @test_var;
-@test_var
-Trigger 3.5.7.11/12
-delete from tb3 where f121='Test 3.5.7.11/12';
-drop trigger trg8_1;
-drop trigger trg8_2;
-delete from tb3 where f121='Test 3.5.7.11/12';
-
-Testcase 3.5.7.13/14:
----------------------
-set @test_var=1;
-Create trigger trg9_1 BEFORE DELETE
-on tb3 for each row set @test_var=@test_var+1;
-Create trigger trg9_2 BEFORE DELETE
-on tb3 for each row set @test_var=@test_var+10;
-ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
-select @test_var;
-@test_var
-1
-Insert into tb3 (f121,f122) values ('Test 3.5.7.13/14','Insert 3.5.7.13');
-Select f121,f122 from tb3 where f121='Test 3.5.7.13/14';
-f121 f122
-Test 3.5.7.13/14 Insert 3.5.7.13
-select @test_var;
-@test_var
-1
-delete from tb3 where f121='Test 3.5.7.13/14';
-Select f121,f122 from tb3 where f121='Test 3.5.7.13/14';
-f121 f122
-select @test_var;
-@test_var
-2
-delete from tb3 where f121='Test 3.5.7.13/14';
-select @test_var;
-@test_var
-2
-drop trigger trg9_1;
-drop trigger trg9_2;
-delete from tb3 where f121='Test 3.5.7.13/14';
-
-Testcase 3.5.7.15/16:
----------------------
-set @test_var=1;
-Create trigger trg_3_406010_1 AFTER DELETE
-on tb3 for each row set @test_var=@test_var+5;
-Create trigger trg_3_406010_2 AFTER DELETE
-on tb3 for each row set @test_var=@test_var+50;
-ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
-Create trigger trg_3_406010_1 AFTER INSERT
-on tb3 for each row set @test_var=@test_var+1;
-ERROR HY000: Trigger already exists
-select @test_var;
-@test_var
-1
-Insert into tb3 (f121,f122) values ('Test 3.5.7.15/16','Insert 3.5.7.15/16');
-Select f121,f122 from tb3 where f121='Test 3.5.7.15/16';
-f121 f122
-Test 3.5.7.15/16 Insert 3.5.7.15/16
-select @test_var;
-@test_var
-1
-delete from tb3 where f121='Test 3.5.7.15/16';
-Select f121,f122 from tb3 where f121='Test 3.5.7.15/16';
-f121 f122
-select @test_var;
-@test_var
-6
-delete from tb3 where f121='Test 3.5.7.15/16';
-select @test_var;
-@test_var
-6
-drop trigger trg_3_406010_1;
-drop trigger trg_3_406010_2;
-delete from tb3 where f121='Test 3.5.7.15/16';
-
-Testcase 3.5.7.17 (see Testcase 3.5.1.1)
-----------------------------------------
-drop user test_general@localhost;
-drop user test_general;
-drop user test_super@localhost;
-DROP TABLE test.tb3;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_08.result b/mysql-test/suite/funcs_1/r/ndb_trig_08.result
deleted file mode 100644
index b2b38694680..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_trig_08.result
+++ /dev/null
@@ -1,527 +0,0 @@
-USE test;
-drop table if exists tb3;
-create table tb3 (
-f118 char not null DEFAULT 'a',
-f119 char binary not null DEFAULT b'101',
-f120 char ascii not null DEFAULT b'101',
-f121 char(50),
-f122 char(50),
-f129 binary not null DEFAULT b'101',
-f130 tinyint not null DEFAULT 99,
-f131 tinyint unsigned not null DEFAULT 99,
-f132 tinyint zerofill not null DEFAULT 99,
-f133 tinyint unsigned zerofill not null DEFAULT 99,
-f134 smallint not null DEFAULT 999,
-f135 smallint unsigned not null DEFAULT 999,
-f136 smallint zerofill not null DEFAULT 999,
-f137 smallint unsigned zerofill not null DEFAULT 999,
-f138 mediumint not null DEFAULT 9999,
-f139 mediumint unsigned not null DEFAULT 9999,
-f140 mediumint zerofill not null DEFAULT 9999,
-f141 mediumint unsigned zerofill not null DEFAULT 9999,
-f142 int not null DEFAULT 99999,
-f143 int unsigned not null DEFAULT 99999,
-f144 int zerofill not null DEFAULT 99999,
-f145 int unsigned zerofill not null DEFAULT 99999,
-f146 bigint not null DEFAULT 999999,
-f147 bigint unsigned not null DEFAULT 999999,
-f148 bigint zerofill not null DEFAULT 999999,
-f149 bigint unsigned zerofill not null DEFAULT 999999,
-f150 decimal not null DEFAULT 999.999,
-f151 decimal unsigned not null DEFAULT 999.17,
-f152 decimal zerofill not null DEFAULT 999.999,
-f153 decimal unsigned zerofill,
-f154 decimal (0),
-f155 decimal (64),
-f156 decimal (0) unsigned,
-f157 decimal (64) unsigned,
-f158 decimal (0) zerofill,
-f159 decimal (64) zerofill,
-f160 decimal (0) unsigned zerofill,
-f161 decimal (64) unsigned zerofill,
-f162 decimal (0,0),
-f163 decimal (63,30),
-f164 decimal (0,0) unsigned,
-f165 decimal (63,30) unsigned,
-f166 decimal (0,0) zerofill,
-f167 decimal (63,30) zerofill,
-f168 decimal (0,0) unsigned zerofill,
-f169 decimal (63,30) unsigned zerofill,
-f170 numeric,
-f171 numeric unsigned,
-f172 numeric zerofill,
-f173 numeric unsigned zerofill,
-f174 numeric (0),
-f175 numeric (64)
-) engine = <engine_to_be_used>;
-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
-
-Testcase: 3.5:
---------------
-create User test_general@localhost;
-set password for test_general@localhost = password('PWD');
-revoke ALL PRIVILEGES, GRANT OPTION FROM test_general@localhost;
-create User test_super@localhost;
-set password for test_super@localhost = password('PWD');
-grant ALL on *.* to test_super@localhost with grant OPTION;
-
-Testcase 3.5.8.1: (implied in previous tests)
----------------------------------------------
-
-Testcase 3.5.8.2: (implied in previous tests)
----------------------------------------------
-
-Testcase 3.5.8.3/4:
--------------------
-create database db_test;
-grant SELECT, INSERT, UPDATE, DELETE on db_test.* to test_general;
-grant LOCK TABLES on db_test.* to test_general;
-Use db_test;
-create table t1_i (
-i120 char ascii not null DEFAULT b'101',
-i136 smallint zerofill not null DEFAULT 999,
-i144 int zerofill not null DEFAULT 99999,
-i163 decimal (63,30)) engine=<engine_to_be_used>;
-create table t1_u (
-u120 char ascii not null DEFAULT b'101',
-u136 smallint zerofill not null DEFAULT 999,
-u144 int zerofill not null DEFAULT 99999,
-u163 decimal (63,30)) engine=<engine_to_be_used>;
-create table t1_d (
-d120 char ascii not null DEFAULT b'101',
-d136 smallint zerofill not null DEFAULT 999,
-d144 int zerofill not null DEFAULT 99999,
-d163 decimal (63,30)) engine=<engine_to_be_used>;
-Insert into t1_u values ('a',111,99999,999.99);
-Insert into t1_u values ('b',222,99999,999.99);
-Insert into t1_u values ('c',333,99999,999.99);
-Insert into t1_u values ('d',222,99999,999.99);
-Insert into t1_u values ('e',222,99999,999.99);
-Insert into t1_u values ('f',333,99999,999.99);
-Insert into t1_d values ('a',111,99999,999.99);
-Insert into t1_d values ('b',222,99999,999.99);
-Insert into t1_d values ('c',333,99999,999.99);
-Insert into t1_d values ('d',444,99999,999.99);
-Insert into t1_d values ('e',222,99999,999.99);
-Insert into t1_d values ('f',222,99999,999.99);
-
-3.5.8.4 - multiple SQL
-----------------------
-use test;
-Create trigger trg1 AFTER INSERT on tb3 for each row
-BEGIN
-insert into db_test.t1_i
-values (new.f120, new.f136, new.f144, new.f163);
-update db_test.t1_u
-set u144=new.f144, u163=new.f163
-where u136=new.f136;
-delete from db_test.t1_d where d136= new.f136;
-select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
-where u136= new.f136;
-END//
-Use test;
-set @test_var=0;
-Insert into tb3 (f120, f122, f136, f144, f163)
-values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
-Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
-f120 f122 f136 f144 f163
-1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
-select * from db_test.t1_i;
-i120 i136 i144 i163
-1 00222 0000023456 1.050000000000000000000000000000
-select * from db_test.t1_u;
-u120 u136 u144 u163
-a 00111 0000099999 999.990000000000000000000000000000
-b 00222 0000023456 1.050000000000000000000000000000
-c 00333 0000099999 999.990000000000000000000000000000
-d 00222 0000023456 1.050000000000000000000000000000
-e 00222 0000023456 1.050000000000000000000000000000
-f 00333 0000099999 999.990000000000000000000000000000
-select * from db_test.t1_d;
-d120 d136 d144 d163
-a 00111 0000099999 999.990000000000000000000000000000
-c 00333 0000099999 999.990000000000000000000000000000
-d 00444 0000099999 999.990000000000000000000000000000
-select @test_var;
-@test_var
-3.150000000000000000000000000000
-
-3.5.8.4 - single SQL - insert
------------------------------
-Create trigger trg2 BEFORE UPDATE on tb3 for each row
-BEGIN
-insert into db_test.t1_i
-values (new.f120, new.f136, new.f144, new.f163);
-END//
-Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
-f120 f122 f136 f144 f163
-1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
-select * from db_test.t1_i order by i120;
-i120 i136 i144 i163
-1 00222 0000023456 1.050000000000000000000000000000
-update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
- where f122='Test 3.5.8.4';
-Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
-f120 f122 f136 f144 f163
-I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
-select * from db_test.t1_i order by i120;
-i120 i136 i144 i163
-1 00222 0000023456 1.050000000000000000000000000000
-I 00222 0000023456 1.050000000000000000000000000000
-
-3.5.8.4 - single SQL - update
------------------------------
-drop trigger trg2;
-Create trigger trg3 BEFORE UPDATE on tb3 for each row
-update db_test.t1_u
-set u120=new.f120
-where u136=new.f136;
-update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
- where f122='Test 3.5.8.4-Single Insert';
-Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
-f120 f122 f136 f144 f163
-U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
-select * from db_test.t1_u order by u120;
-u120 u136 u144 u163
-a 00111 0000099999 999.990000000000000000000000000000
-c 00333 0000099999 999.990000000000000000000000000000
-f 00333 0000099999 999.990000000000000000000000000000
-U 00222 0000023456 1.050000000000000000000000000000
-U 00222 0000023456 1.050000000000000000000000000000
-U 00222 0000023456 1.050000000000000000000000000000
-
-3.5.8.3/4 - single SQL - delete
--------------------------------
-drop trigger trg3;
-Create trigger trg4 AFTER UPDATE on tb3 for each row
-delete from db_test.t1_d where d136= new.f136;
-update tb3 set f120='D', f136=444,
-f122='Test 3.5.8.4-Single Delete'
- where f122='Test 3.5.8.4-Single Update';
-Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
-f120 f122 f136 f144 f163
-D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
-select * from db_test.t1_d order by d120;
-d120 d136 d144 d163
-a 00111 0000099999 999.990000000000000000000000000000
-c 00333 0000099999 999.990000000000000000000000000000
-
-3.5.8.3/4 - single SQL - select
--------------------------------
-drop trigger trg4;
-Create trigger trg5 AFTER UPDATE on tb3 for each row
-select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
-where u136= new.f136;
-set @test_var=0;
-update tb3 set f120='S', f136=111,
-f122='Test 3.5.8.4-Single Select'
- where f122='Test 3.5.8.4-Single Delete';
-Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
-f120 f122 f136 f144 f163
-S Test 3.5.8.4-Single Select 00111 0000023456 1.050000000000000000000000000000
-select @test_var;
-@test_var
-999.990000000000000000000000000000
-drop trigger trg1;
-drop trigger trg5;
-drop database if exists db_test;
-delete from tb3 where f122 like 'Test 3.5.8.4%';
-revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
-
-Testcase 3.5.8.5 (IF):
-----------------------
-create trigger trg2 before insert on tb3 for each row
-BEGIN
-IF new.f120='1' then
-set @test_var='one', new.f120='2';
-ELSEIF new.f120='2' then
-set @test_var='two', new.f120='3';
-ELSEIF new.f120='3' then
-set @test_var='three', new.f120='4';
-END IF;
-IF (new.f120='4') and (new.f136=10) then
-set @test_var2='2nd if', new.f120='d';
-ELSE
-set @test_var2='2nd else', new.f120='D';
-END IF;
-END//
-set @test_var='Empty', @test_var2=0;
-Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
-select f120, f122, f136, @test_var, @test_var2
-from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
-f120 f122 f136 @test_var @test_var2
-D Test 3.5.8.5-if 00101 one 2nd else
-Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
-select f120, f122, f136, @test_var, @test_var2
-from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
-f120 f122 f136 @test_var @test_var2
-D Test 3.5.8.5-if 00101 two 2nd else
-D Test 3.5.8.5-if 00102 two 2nd else
-Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
-select f120, f122, f136, @test_var, @test_var2
-from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
-f120 f122 f136 @test_var @test_var2
-d Test 3.5.8.5-if 00010 three 2nd if
-D Test 3.5.8.5-if 00101 three 2nd if
-D Test 3.5.8.5-if 00102 three 2nd if
-Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
-select f120, f122, f136, @test_var, @test_var2
-from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
-f120 f122 f136 @test_var @test_var2
-d Test 3.5.8.5-if 00010 three 2nd else
-D Test 3.5.8.5-if 00101 three 2nd else
-D Test 3.5.8.5-if 00102 three 2nd else
-D Test 3.5.8.5-if 00103 three 2nd else
-create trigger trg3 before update on tb3 for each row
-BEGIN
-ELSEIF new.f120='2' then
-END IF;
-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 'ELSEIF new.f120='2' then
-END IF;
-END' at line 3
-drop trigger trg3//
-create trigger trg4 before update on tb3 for each row
-BEGIN
-IF (new.f120='4') and (new.f136=10) then
-set @test_var2='2nd if', new.f120='d';
-ELSE
-set @test_var2='2nd else', new.f120='D';
-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 '' at line 7
-drop trigger trg4;
-drop trigger trg2;
-delete from tb3 where f121='Test 3.5.8.5-if';
-
-Testcase 3.5.8.5-case:
-----------------------
-create trigger trg3 before insert on tb3 for each row
-BEGIN
-SET new.f120=char(ascii(new.f120)-32);
-CASE
-when new.f136<100 then set new.f136=new.f136+120;
-when new.f136<10 then set new.f144=777;
-when new.f136>100 then set new.f120=new.f136-1;
-END case;
-CASE
-when new.f136=200 then set @test_var=CONCAT(new.f120, '=');
-ELSE set @test_var=concat(new.f120, '*');
-END case;
-CASE new.f144
-when 1 then set @test_var=concat(@test_var, 'one');
-when 2 then set @test_var=concat(@test_var, 'two');
-when 3 then set @test_var=concat(@test_var, 'three');
-when 4 then set @test_var=concat(@test_var, 'four');
-when 5 then set @test_var=concat(@test_var, 'five');
-when 6 then set @test_var=concat(@test_var, 'six');
-when 7 then set @test_var=concat(@test_var, 'seven');
-when 8 then set @test_var=concat(@test_var, 'eight');
-when 9 then set @test_var=concat(@test_var, 'nine');
-when 10 then set @test_var=concat(@test_var, 'ten');
-when 11 then set @test_var=concat(@test_var, 'eleven');
-when 12 then set @test_var=concat(@test_var, 'twelve');
-when 13 then set @test_var=concat(@test_var, 'thirteen');
-when 14 then set @test_var=concat(@test_var, 'fourteen');
-when 15 then set @test_var=concat(@test_var, 'fifteen');
-ELSE set @test_var=CONCAT(new.f120, '*', new.f144);
-END case;
-END//
-set @test_var='Empty';
-Insert into tb3 (f120, f122, f136, f144)
-values ('a', 'Test 3.5.8.5-case', 5, 7);
-select f120, f122, f136, f144, @test_var
-from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
-f120 f122 f136 f144 @test_var
-A Test 3.5.8.5-case 00125 0000000007 A*seven
-Insert into tb3 (f120, f122, f136, f144)
-values ('b', 'Test 3.5.8.5-case', 71,16);
-select f120, f122, f136, f144, @test_var
-from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
-f120 f122 f136 f144 @test_var
-A Test 3.5.8.5-case 00125 0000000007 B*0000000016
-B Test 3.5.8.5-case 00191 0000000016 B*0000000016
-Insert into tb3 (f120, f122, f136, f144)
-values ('c', 'Test 3.5.8.5-case', 80,1);
-select f120, f122, f136, f144, @test_var
-from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
-f120 f122 f136 f144 @test_var
-A Test 3.5.8.5-case 00125 0000000007 C=one
-B Test 3.5.8.5-case 00191 0000000016 C=one
-C Test 3.5.8.5-case 00200 0000000001 C=one
-Insert into tb3 (f120, f122, f136)
-values ('d', 'Test 3.5.8.5-case', 152);
-Warnings:
-Warning 1265 Data truncated for column 'f120' at row 1
-select f120, f122, f136, f144, @test_var
-from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
-f120 f122 f136 f144 @test_var
-1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
-A Test 3.5.8.5-case 00125 0000000007 1*0000099999
-B Test 3.5.8.5-case 00191 0000000016 1*0000099999
-C Test 3.5.8.5-case 00200 0000000001 1*0000099999
-Insert into tb3 (f120, f122, f136, f144)
-values ('e', 'Test 3.5.8.5-case', 200, 8);
-Warnings:
-Warning 1265 Data truncated for column 'f120' at row 1
-select f120, f122, f136, f144, @test_var
-from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
-f120 f122 f136 f144 @test_var
-1 Test 3.5.8.5-case 00152 0000099999 1=eight
-1 Test 3.5.8.5-case 00200 0000000008 1=eight
-A Test 3.5.8.5-case 00125 0000000007 1=eight
-B Test 3.5.8.5-case 00191 0000000016 1=eight
-C Test 3.5.8.5-case 00200 0000000001 1=eight
-Insert into tb3 (f120, f122, f136, f144)
-values ('f', 'Test 3.5.8.5-case', 100, 8);
-select f120, f122, f136, f144, @test_var
-from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
-f120 f122 f136 f144 @test_var
-1 Test 3.5.8.5-case 00152 0000099999 1=eight
-1 Test 3.5.8.5-case 00200 0000000008 1=eight
-A Test 3.5.8.5-case 00125 0000000007 1=eight
-B Test 3.5.8.5-case 00191 0000000016 1=eight
-C Test 3.5.8.5-case 00200 0000000001 1=eight
-create trigger trg3a before update on tb3 for each row
-BEGIN
-CASE
-when new.f136<100 then set new.f120='p';
-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 '' at line 5
-drop trigger trg3a;
-drop trigger trg3;
-delete from tb3 where f121='Test 3.5.8.5-case';
-
-Testcase 3.5.8.5-loop/leave:
-----------------------------
-Create trigger trg4 after insert on tb3 for each row
-BEGIN
-set @counter=0, @flag='Initial';
-Label1: loop
-if new.f136<new.f144 then
-set @counter='Nothing to loop';
-leave Label1;
-else
-set @counter=@counter+1;
-if new.f136=new.f144+@counter then
-set @counter=concat(@counter, ' loops');
-leave Label1;
-end if;
-end if;
-iterate label1;
-set @flag='Final';
-END loop Label1;
-END//
-Insert into tb3 (f122, f136, f144)
-values ('Test 3.5.8.5-loop', 2, 8);
-select @counter, @flag;
-@counter @flag
-Nothing to loop Initial
-Insert into tb3 (f122, f136, f144)
-values ('Test 3.5.8.5-loop', 11, 8);
-select @counter, @flag;
-@counter @flag
-3 loops Initial
-Create trigger trg4_2 after update on tb3 for each row
-BEGIN
-Label1: loop
-set @counter=@counter+1;
-END;
-END//
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
-END' at line 5
-drop trigger trg4_2;
-drop trigger trg4;
-delete from tb3 where f122='Test 3.5.8.5-loop';
-
-Testcase 3.5.8.5-repeat:
-------------------------
-Create trigger trg6 after insert on tb3 for each row
-BEGIN
-rp_label: REPEAT
-SET @counter1 = @counter1 + 1;
-IF (@counter1 MOD 2 = 0) THEN ITERATE rp_label;
-END IF;
-SET @counter2 = @counter2 + 1;
-UNTIL @counter1> new.f136 END REPEAT rp_label;
-END//
-set @counter1= 0, @counter2= 0;
-Insert into tb3 (f122, f136)
-values ('Test 3.5.8.5-repeat', 13);
-select @counter1, @counter2;
-@counter1 @counter2
-15 8
-Create trigger trg6_2 after update on tb3 for each row
-BEGIN
-REPEAT
-SET @counter2 = @counter2 + 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 'END' at line 5
-drop trigger trg6;
-delete from tb3 where f122='Test 3.5.8.5-repeat';
-
-Testcase 3.5.8.5-while:
------------------------
-Create trigger trg7 after insert on tb3 for each row
-wl_label: WHILE @counter1 < new.f136 DO
-SET @counter1 = @counter1 + 1;
-IF (@counter1 MOD 2 = 0) THEN ITERATE wl_label;
-END IF;
-SET @counter2 = @counter2 + 1;
-END WHILE wl_label//
-set @counter1= 0, @counter2= 0;
-Insert into tb3 (f122, f136)
-values ('Test 3.5.8.5-while', 7);
-select @counter1, @counter2;
-@counter1 @counter2
-7 4
-Create trigger trg7_2 after update on tb3 for each row
-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 'SET @counter1 = @counter1 + 1;
-END' at line 4
-delete from tb3 where f122='Test 3.5.8.5-while';
-drop trigger trg7;
-
-Testcase 3.5.8.6: (requirement void)
-------------------------------------
-CREATE PROCEDURE sp_01 () BEGIN set @v1=1; END//
-CREATE TRIGGER trg8_1 BEFORE UPDATE ON tb3 FOR EACH ROW
-BEGIN
-CALL sp_01 ();
-END//
-Insert into tb3 (f120, f122, f136) values ('6', 'Test 3.5.8.6-insert', 101);
-update tb3 set f120='S', f136=111,
-f122='Test 3.5.8.6-tr8_1'
- where f122='Test 3.5.8.6-insert';
-select f120, f122
-from tb3 where f122 like 'Test 3.5.8.6%' order by f120;
-f120 f122
-S Test 3.5.8.6-tr8_1
-DROP TRIGGER trg8_1;
-DROP PROCEDURE sp_01;
-
-Testcase 3.5.8.7
-----------------
-Create trigger trg9_1 before update on tb3 for each row
-BEGIN
-Start transaction;
-Set new.f120='U';
-Commit;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-Create trigger trg9_2 before delete on tb3 for each row
-BEGIN
-Start transaction;
-Set @var2=old.f120;
-Rollback;
-END//
-ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-drop user test_general@localhost;
-drop user test_general;
-drop user test_super@localhost;
-DROP TABLE test.tb3;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_09.result b/mysql-test/suite/funcs_1/r/ndb_trig_09.result
deleted file mode 100644
index 986506b4e71..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_trig_09.result
+++ /dev/null
@@ -1,269 +0,0 @@
-USE test;
-drop table if exists tb3;
-create table tb3 (
-f118 char not null DEFAULT 'a',
-f119 char binary not null DEFAULT b'101',
-f120 char ascii not null DEFAULT b'101',
-f121 char(50),
-f122 char(50),
-f129 binary not null DEFAULT b'101',
-f130 tinyint not null DEFAULT 99,
-f131 tinyint unsigned not null DEFAULT 99,
-f132 tinyint zerofill not null DEFAULT 99,
-f133 tinyint unsigned zerofill not null DEFAULT 99,
-f134 smallint not null DEFAULT 999,
-f135 smallint unsigned not null DEFAULT 999,
-f136 smallint zerofill not null DEFAULT 999,
-f137 smallint unsigned zerofill not null DEFAULT 999,
-f138 mediumint not null DEFAULT 9999,
-f139 mediumint unsigned not null DEFAULT 9999,
-f140 mediumint zerofill not null DEFAULT 9999,
-f141 mediumint unsigned zerofill not null DEFAULT 9999,
-f142 int not null DEFAULT 99999,
-f143 int unsigned not null DEFAULT 99999,
-f144 int zerofill not null DEFAULT 99999,
-f145 int unsigned zerofill not null DEFAULT 99999,
-f146 bigint not null DEFAULT 999999,
-f147 bigint unsigned not null DEFAULT 999999,
-f148 bigint zerofill not null DEFAULT 999999,
-f149 bigint unsigned zerofill not null DEFAULT 999999,
-f150 decimal not null DEFAULT 999.999,
-f151 decimal unsigned not null DEFAULT 999.17,
-f152 decimal zerofill not null DEFAULT 999.999,
-f153 decimal unsigned zerofill,
-f154 decimal (0),
-f155 decimal (64),
-f156 decimal (0) unsigned,
-f157 decimal (64) unsigned,
-f158 decimal (0) zerofill,
-f159 decimal (64) zerofill,
-f160 decimal (0) unsigned zerofill,
-f161 decimal (64) unsigned zerofill,
-f162 decimal (0,0),
-f163 decimal (63,30),
-f164 decimal (0,0) unsigned,
-f165 decimal (63,30) unsigned,
-f166 decimal (0,0) zerofill,
-f167 decimal (63,30) zerofill,
-f168 decimal (0,0) unsigned zerofill,
-f169 decimal (63,30) unsigned zerofill,
-f170 numeric,
-f171 numeric unsigned,
-f172 numeric zerofill,
-f173 numeric unsigned zerofill,
-f174 numeric (0),
-f175 numeric (64)
-) engine = <engine_to_be_used>;
-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
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
-into table tb3;
-
-Testcase 3.5.9.1/2:
--------------------
-Create trigger trg1 BEFORE UPDATE on tb3 for each row
-set new.f142 = 94087, @counter=@counter+1;
-TotalRows
-10
-Affected
-9
-NotAffected
-1
-NewValuew
-0
-set @counter=0;
-Update tb3 Set f142='1' where f130<100;
-select count(*) as ExpectedChanged, @counter as TrigCounter
-from tb3 where f142=94087;
-ExpectedChanged TrigCounter
-9 9
-select count(*) as ExpectedNotChange from tb3
-where f130<100 and f142<>94087;
-ExpectedNotChange
-0
-select count(*) as NonExpectedChanged from tb3
-where f130>=130 and f142=94087;
-NonExpectedChanged
-0
-drop trigger trg1;
-
-Testcase 3.5.9.3:
------------------
-Create trigger trg2_a before update on tb3 for each row
-set @tr_var_b4_118=old.f118, @tr_var_b4_121=old.f121,
-@tr_var_b4_122=old.f122, @tr_var_b4_136=old.f136,
-@tr_var_b4_163=old.f163;
-Create trigger trg2_b after update on tb3 for each row
-set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
-@tr_var_af_122=old.f122, @tr_var_af_136=old.f136,
-@tr_var_af_163=old.f163;
-Create trigger trg2_c before delete on tb3 for each row
-set @tr_var_b4_118=old.f118, @tr_var_b4_121=old.f121,
-@tr_var_b4_122=old.f122, @tr_var_b4_136=old.f136,
-@tr_var_b4_163=old.f163;
-Create trigger trg2_d after delete on tb3 for each row
-set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
-@tr_var_af_122=old.f122, @tr_var_af_136=old.f136,
-@tr_var_af_163=old.f163;
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_163
-0 0 0 0 0
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
-0 0 0 0 0
-Insert into tb3 (f122, f136, f163)
-values ('Test 3.5.9.3', 7, 123.17);
-Update tb3 Set f136=8 where f122='Test 3.5.9.3';
-select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
-f118 f121 f122 f136 f163
-a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
-select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
-@tr_var_b4_136, @tr_var_b4_163;
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_163
-a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
-select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
-@tr_var_af_136, @tr_var_af_163;
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
-a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_163
-0 0 0 0 0
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
-0 0 0 0 0
-delete from tb3 where f122='Test 3.5.9.3';
-select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
-f118 f121 f122 f136 f163
-select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
-@tr_var_b4_136, @tr_var_b4_163;
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_163
-a NULL Test 3.5.9.3 8 123.170000000000000000000000000000
-select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
-@tr_var_af_136, @tr_var_af_163;
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
-a NULL Test 3.5.9.3 8 123.170000000000000000000000000000
-drop trigger trg2_a;
-drop trigger trg2_b;
-drop trigger trg2_c;
-drop trigger trg2_d;
-
-Testcase 3.5.9.4:
------------------
-Create trigger trg3_a before insert on tb3 for each row
-set @tr_var_b4_118=new.f118, @tr_var_b4_121=new.f121,
-@tr_var_b4_122=new.f122, @tr_var_b4_136=new.f136,
-@tr_var_b4_151=new.f151, @tr_var_b4_163=new.f163;
-Create trigger trg3_b after insert on tb3 for each row
-set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
-@tr_var_af_122=new.f122, @tr_var_af_136=new.f136,
-@tr_var_af_151=new.f151, @tr_var_af_163=new.f163;
-Create trigger trg3_c before update on tb3 for each row
-set @tr_var_b4_118=new.f118, @tr_var_b4_121=new.f121,
-@tr_var_b4_122=new.f122, @tr_var_b4_136=new.f136,
-@tr_var_b4_151=new.f151, @tr_var_b4_163=new.f163;
-Create trigger trg3_d after update on tb3 for each row
-set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
-@tr_var_af_122=new.f122, @tr_var_af_136=new.f136,
-@tr_var_af_151=new.f151, @tr_var_af_163=new.f163;
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
-0 0 0 0 0 0
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
-0 0 0 0 0 0
-Insert into tb3 (f122, f136, f151, f163)
-values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
-select f118, f121, f122, f136, f151, f163 from tb3
-where f122 like 'Test 3.5.9.4%' order by f163;
-f118 f121 f122 f136 f151 f163
-a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
-select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
-@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
-a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
-select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
-@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
-a NULL Test 3.5.9.4 7 999 995.240000000000000000000000000000
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
-0 0 0 0 0 0
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
-0 0 0 0 0 0
-Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
-where f122='Test 3.5.9.4';
-Warnings:
-Warning 1048 Column 'f136' cannot be null
-Update tb3 Set f122='Test 3.5.9.4-trig', f136=0, f151=DEFAULT, f163=NULL
-where f122='Test 3.5.9.4';
-select f118, f121, f122, f136, f151, f163 from tb3
-where f122 like 'Test 3.5.9.4-trig' order by f163;
-f118 f121 f122 f136 f151 f163
-a NULL Test 3.5.9.4-trig 00000 999 NULL
-select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
-@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
-@tr_var_b4_118 @tr_var_b4_121 @tr_var_b4_122 @tr_var_b4_136 @tr_var_b4_151 @tr_var_b4_163
-a NULL Test 3.5.9.4-trig 0 999 NULL
-select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
-@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
-@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_151 @tr_var_af_163
-a NULL Test 3.5.9.4-trig 0 999 NULL
-drop trigger trg3_a;
-drop trigger trg3_b;
-drop trigger trg3_c;
-drop trigger trg3_d;
-delete from tb3 where f122='Test 3.5.9.4-trig';
-
-Testcase 3.5.9.5: (implied in previous tests)
----------------------------------------------
-
-Testcase 3.5.9.6:
------------------
-create trigger trg4a before insert on tb3 for each row
-set @temp1= old.f120;
-ERROR HY000: There is no OLD row in on INSERT trigger
-create trigger trg4b after insert on tb3 for each row
-set old.f120= 'test';
-ERROR HY000: Updating of OLD row is not allowed in trigger
-drop trigger trg4a;
-drop trigger trg4b;
-
-Testcase 3.5.9.7: (implied in previous tests)
----------------------------------------------
-
-Testcase 3.5.9.8: (implied in previous tests)
----------------------------------------------
-
-Testcase 3.5.9.9:
------------------
-create trigger trg5a before DELETE on tb3 for each row
-set @temp1=new.f122;
-ERROR HY000: There is no NEW row in on DELETE trigger
-create trigger trg5b after DELETE on tb3 for each row
-set new.f122='test';
-ERROR HY000: There is no NEW row in on DELETE trigger
-drop trigger trg5a;
-drop trigger trg5b;
-
-Testcase 3.5.9.10: (implied in previous tests)
-----------------------------------------------
-
-Testcase 3.5.9.11: covered by 3.5.9.9
--------------------------------------
-
-Testcase 3.5.9.12: covered by 3.5.9.6
--------------------------------------
-
-Testcase 3.5.9.13:
-------------------
-create trigger trg6a before UPDATE on tb3 for each row
-set old.f118='C', new.f118='U';
-ERROR HY000: Updating of OLD row is not allowed in trigger
-create trigger trg6b after INSERT on tb3 for each row
-set old.f136=163, new.f118='U';
-ERROR HY000: Updating of OLD row is not allowed in trigger
-create trigger trg6c after UPDATE on tb3 for each row
-set old.f136=NULL;
-ERROR HY000: Updating of OLD row is not allowed in trigger
-drop trigger trg6a;
-drop trigger trg6b;
-drop trigger trg6c;
-
-Testcase 3.5.9.14: (implied in previous tests)
-----------------------------------------------
-DROP TABLE test.tb3;
diff --git a/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result b/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result
deleted file mode 100644
index 198382b409d..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_trig_1011ext.result
+++ /dev/null
@@ -1,394 +0,0 @@
-USE test;
-drop table if exists tb3;
-create table tb3 (
-f118 char not null DEFAULT 'a',
-f119 char binary not null DEFAULT b'101',
-f120 char ascii not null DEFAULT b'101',
-f121 char(50),
-f122 char(50),
-f129 binary not null DEFAULT b'101',
-f130 tinyint not null DEFAULT 99,
-f131 tinyint unsigned not null DEFAULT 99,
-f132 tinyint zerofill not null DEFAULT 99,
-f133 tinyint unsigned zerofill not null DEFAULT 99,
-f134 smallint not null DEFAULT 999,
-f135 smallint unsigned not null DEFAULT 999,
-f136 smallint zerofill not null DEFAULT 999,
-f137 smallint unsigned zerofill not null DEFAULT 999,
-f138 mediumint not null DEFAULT 9999,
-f139 mediumint unsigned not null DEFAULT 9999,
-f140 mediumint zerofill not null DEFAULT 9999,
-f141 mediumint unsigned zerofill not null DEFAULT 9999,
-f142 int not null DEFAULT 99999,
-f143 int unsigned not null DEFAULT 99999,
-f144 int zerofill not null DEFAULT 99999,
-f145 int unsigned zerofill not null DEFAULT 99999,
-f146 bigint not null DEFAULT 999999,
-f147 bigint unsigned not null DEFAULT 999999,
-f148 bigint zerofill not null DEFAULT 999999,
-f149 bigint unsigned zerofill not null DEFAULT 999999,
-f150 decimal not null DEFAULT 999.999,
-f151 decimal unsigned not null DEFAULT 999.17,
-f152 decimal zerofill not null DEFAULT 999.999,
-f153 decimal unsigned zerofill,
-f154 decimal (0),
-f155 decimal (64),
-f156 decimal (0) unsigned,
-f157 decimal (64) unsigned,
-f158 decimal (0) zerofill,
-f159 decimal (64) zerofill,
-f160 decimal (0) unsigned zerofill,
-f161 decimal (64) unsigned zerofill,
-f162 decimal (0,0),
-f163 decimal (63,30),
-f164 decimal (0,0) unsigned,
-f165 decimal (63,30) unsigned,
-f166 decimal (0,0) zerofill,
-f167 decimal (63,30) zerofill,
-f168 decimal (0,0) unsigned zerofill,
-f169 decimal (63,30) unsigned zerofill,
-f170 numeric,
-f171 numeric unsigned,
-f172 numeric zerofill,
-f173 numeric unsigned zerofill,
-f174 numeric (0),
-f175 numeric (64)
-) engine = <engine_to_be_used>;
-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
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb3.txt'
-into table tb3;
-
-Testcase 3.5.10.1/2/3:
-----------------------
-Create view vw11 as select * from tb3
-where f122 like 'Test 3.5.10.1/2/3%';
-Create trigger trg1a before insert on tb3
-for each row set new.f163=111.11;
-Create trigger trg1b after insert on tb3
-for each row set @test_var='After Insert';
-Create trigger trg1c before update on tb3
-for each row set new.f121='Y', new.f122='Test 3.5.10.1/2/3-Update';
-Create trigger trg1d after update on tb3
-for each row set @test_var='After Update';
-Create trigger trg1e before delete on tb3
-for each row set @test_var=5;
-Create trigger trg1f after delete on tb3
-for each row set @test_var= 2* @test_var+7;
-Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
-Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
-Insert into vw11 (f122, f151) values ('Not in View', 3);
-select f121, f122, f151, f163
-from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
-f121 f122 f151 f163
-NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
-NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
-select f121, f122, f151, f163 from vw11;
-f121 f122 f151 f163
-NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
-NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
-select f121, f122, f151, f163
-from tb3 where f122 like 'Not in View';
-f121 f122 f151 f163
-NULL Not in View 3 111.110000000000000000000000000000
-Update vw11 set f163=1;
-select f121, f122, f151, f163 from tb3
-where f122 like 'Test 3.5.10.1/2/3%' order by f151;
-f121 f122 f151 f163
-Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
-Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
-select f121, f122, f151, f163 from vw11;
-f121 f122 f151 f163
-Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
-Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
-set @test_var=0;
-Select @test_var as 'before delete';
-before delete
-0
-delete from vw11 where f151=1;
-select f121, f122, f151, f163 from tb3
-where f122 like 'Test 3.5.10.1/2/3%' order by f151;
-f121 f122 f151 f163
-Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
-select f121, f122, f151, f163 from vw11;
-f121 f122 f151 f163
-Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
-Select @test_var as 'after delete';
-after delete
-17
-drop view vw11;
-drop trigger trg1a;
-drop trigger trg1b;
-drop trigger trg1c;
-drop trigger trg1d;
-drop trigger trg1e;
-drop trigger trg1f;
-delete from tb3 where f122 like 'Test 3.5.10.1/2/3%';
-
-Testcase 3.5.10.4:
-------------------
-create table tb_load (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
-Create trigger trg4 before insert on tb_load
-for each row set new.f3=-(new.f1 div 5), @counter= @counter+1;
-set @counter= 0;
-select @counter as 'Rows Loaded Before';
-Rows Loaded Before
-0
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table tb_load;
-select @counter as 'Rows Loaded After';
-Rows Loaded After
-10
-Select * from tb_load order by f1 limit 10;
-f1 f2 f3
--5000 a` 1000
--4999 aaa 999
--4998 abaa 999
--4997 acaaa 999
--4996 adaaaa 999
--4995 aeaaaaa 999
--4994 afaaaaaa 998
--4993 agaaaaaaa 998
--4992 a^aaaaaaaa 998
--4991 a_aaaaaaaaa 998
-drop trigger trg4;
-drop table tb_load;
-
-Testcase 3.5.10.5: (implemented in trig_frkey.test)
----------------------------------------------------
-
-Testcase 3.5.10.6: (implemented in trig_frkey.test)
----------------------------------------------------
-
-Testcase 3.5.10.extra:
-----------------------
-create table t1_sp (var136 tinyint, var151 decimal) engine = <engine_to_be_used>;
-create trigger trg before insert on t1_sp
-for each row set @counter=@counter+1;
-create procedure trig_sp()
-begin
-declare done int default 0;
-declare var151 decimal;
-declare var136 tinyint;
-declare cur1 cursor for select f136, f151 from tb3;
-declare continue handler for sqlstate '01000' set done = 1;
-open cur1;
-fetch cur1 into var136, var151;
-wl_loop: WHILE NOT done DO
-insert into t1_sp values (var136, var151);
-fetch cur1 into var136, var151;
-END WHILE wl_loop;
-close cur1;
-end//
-set @counter=0;
-select @counter;
-@counter
-0
-call trig_sp();
-ERROR 02000: No data - zero rows fetched, selected, or processed
-select @counter;
-@counter
-11
-select count(*) from tb3;
-count(*)
-11
-select count(*) from t1_sp;
-count(*)
-11
-drop procedure trig_sp;
-drop trigger trg;
-drop table t1_sp;
-
-Testcase 3.5.11.1 (implemented in trig_perf.test)
--------------------------------------------------
-
-Testcase y.y.y.2: Check for triggers starting triggers
-------------------------------------------------------
-use test;
-drop table if exists t1;
-drop table if exists t2_1;
-drop table if exists t2_2;
-drop table if exists t2_3;
-drop table if exists t2_4;
-drop table if exists t3;
-create table t1 (f1 integer) engine = <engine_to_be_used>;
-create table t2_1 (f1 integer) engine = <engine_to_be_used>;
-create table t2_2 (f1 integer) engine = <engine_to_be_used>;
-create table t2_3 (f1 integer) engine = <engine_to_be_used>;
-create table t2_4 (f1 integer) engine = <engine_to_be_used>;
-create table t3 (f1 integer) engine = <engine_to_be_used>;
-insert into t1 values (1);
-create trigger tr1 after insert on t1 for each row
-BEGIN
-insert into t2_1 (f1) values (new.f1+1);
-insert into t2_2 (f1) values (new.f1+1);
-insert into t2_3 (f1) values (new.f1+1);
-insert into t2_4 (f1) values (new.f1+1);
-END//
-create trigger tr2_1 after insert on t2_1 for each row
-insert into t3 (f1) values (new.f1+10);
-create trigger tr2_2 after insert on t2_2 for each row
-insert into t3 (f1) values (new.f1+100);
-create trigger tr2_3 after insert on t2_3 for each row
-insert into t3 (f1) values (new.f1+1000);
-create trigger tr2_4 after insert on t2_4 for each row
-insert into t3 (f1) values (new.f1+10000);
-insert into t1 values (1);
-select * from t3 order by f1;
-f1
-12
-102
-1002
-10002
-drop trigger tr1;
-drop trigger tr2_1;
-drop trigger tr2_2;
-drop trigger tr2_3;
-drop trigger tr2_4;
-drop table t1, t2_1, t2_2, t2_3, t2_4, t3;
-
-Testcase y.y.y.3: Circular trigger reference
---------------------------------------------
-use test;
-drop table if exists t1;
-drop table if exists t2;
-drop table if exists t3;
-drop table if exists t4;
-create table t1 (f1 integer) engine = <engine_to_be_used>;
-create table t2 (f2 integer) engine = <engine_to_be_used>;
-create table t3 (f3 integer) engine = <engine_to_be_used>;
-create table t4 (f4 integer) engine = <engine_to_be_used>;
-insert into t1 values (0);
-create trigger tr1 after insert on t1
-for each row insert into t2 (f2) values (new.f1+1);
-create trigger tr2 after insert on t2
-for each row insert into t3 (f3) values (new.f2+1);
-create trigger tr3 after insert on t3
-for each row insert into t4 (f4) values (new.f3+1);
-create trigger tr4 after insert on t4
-for each row insert into t1 (f1) values (new.f4+1);
-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.
-select * from t1 order by f1;
-f1
-0
-select * from t2 order by f2;
-f2
-select * from t3 order by f3;
-f3
-select * from t4 order by f4;
-f4
-drop trigger tr1;
-drop trigger tr2;
-drop trigger tr3;
-drop trigger tr4;
-drop table t1;
-drop table t2;
-drop table t3;
-drop table t4;
-
-Testcase y.y.y.4: Recursive trigger/SP references
--------------------------------------------------
-set @sql_mode='traditional';
-create table t1_sp (
-count integer,
-var136 tinyint,
-var151 decimal) engine = <engine_to_be_used>;
-create procedure trig_sp()
-begin
-declare done int default 0;
-declare var151 decimal;
-declare var136 tinyint;
-declare cur1 cursor for select f136, f151 from tb3;
-declare continue handler for sqlstate '01000' set done = 1;
-set @counter= @counter+1;
-open cur1;
-fetch cur1 into var136, var151;
-wl_loop: WHILE NOT done DO
-insert into t1_sp values (@counter, var136, var151);
-fetch cur1 into var136, var151;
-END WHILE wl_loop;
-close cur1;
-end//
-create trigger trg before insert on t1_sp
-for each row call trig_sp();
-set @counter=0;
-select @counter;
-@counter
-0
-call trig_sp();
-ERROR HY000: Recursive limit 0 (as set by the max_sp_recursion_depth variable) was exceeded for routine trig_sp
-select @counter;
-@counter
-1
-select count(*) from tb3;
-count(*)
-11
-select count(*) from t1_sp;
-count(*)
-0
-set @@max_sp_recursion_depth= 10;
-set @counter=0;
-select @counter;
-@counter
-0
-call trig_sp();
-ERROR HY000: Can't update table 't1_sp' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
-select @counter;
-@counter
-2
-select count(*) from tb3;
-count(*)
-11
-select count(*) from t1_sp;
-count(*)
-0
-drop procedure trig_sp;
-drop trigger trg;
-drop table t1_sp;
-
-Testcase y.y.y.5: Rollback of nested trigger references
--------------------------------------------------------
-set @@sql_mode='traditional';
-use test;
-drop table if exists t1;
-drop table if exists t2;
-drop table if exists t3;
-drop table if exists t4;
-create table t1 (f1 integer) engine = <engine_to_be_used>;
-create table t2 (f2 integer) engine = <engine_to_be_used>;
-create table t3 (f3 integer) engine = <engine_to_be_used>;
-create table t4 (f4 tinyint) engine = <engine_to_be_used>;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f1` int(11) default NULL
-) ENGINE=<engine_to_be_used> DEFAULT CHARSET=latin1
-insert into t1 values (1);
-create trigger tr1 after insert on t1
-for each row insert into t2 (f2) values (new.f1+1);
-create trigger tr2 after insert on t2
-for each row insert into t3 (f3) values (new.f2+1);
-create trigger tr3 after insert on t3
-for each row insert into t4 (f4) values (new.f3+1000);
-set autocommit=0;
-start transaction;
-insert into t1 values (1);
-ERROR 22003: Out of range value adjusted for column 'f4' at row 1
-commit;
-select * from t1 order by f1;
-f1
-1
-select * from t2 order by f2;
-f2
-select * from t3 order by f3;
-f3
-drop trigger tr1;
-drop trigger tr2;
-drop trigger tr3;
-drop table t1;
-drop table t2;
-drop table t3;
-drop table t4;
-DROP TABLE test.tb3;
diff --git a/mysql-test/suite/funcs_1/r/ndb_views.result b/mysql-test/suite/funcs_1/r/ndb_views.result
deleted file mode 100644
index 6c5a10845a0..00000000000
--- a/mysql-test/suite/funcs_1/r/ndb_views.result
+++ /dev/null
@@ -1,22914 +0,0 @@
-USE test;
-drop table if exists tb2 ;
-create table tb2 (
-f59 numeric (0) unsigned,
-f60 numeric (64) unsigned,
-f61 numeric (0) zerofill,
-f62 numeric (64) zerofill,
-f63 numeric (0) unsigned zerofill,
-f64 numeric (64) unsigned zerofill,
-f65 numeric (0,0),
-f66 numeric (63,30),
-f67 numeric (0,0) unsigned,
-f68 numeric (63,30) unsigned,
-f69 numeric (0,0) zerofill,
-f70 numeric (63,30) zerofill,
-f71 numeric (0,0) unsigned zerofill,
-f72 numeric (63,30) unsigned zerofill,
-f73 real,
-f74 real unsigned,
-f75 real zerofill,
-f76 real unsigned zerofill,
-f77 double default 7.7,
-f78 double unsigned default 7.7,
-f79 double zerofill default 7.7,
-f80 double unsigned zerofill default 8.8,
-f81 float not null default 8.8,
-f82 float unsigned not null default 8.8,
-f83 float zerofill not null default 8.8,
-f84 float unsigned zerofill not null default 8.8,
-f85 float(0) not null default 8.8,
-f86 float(23) not null default 8.8,
-f87 float(0) unsigned not null default 8.8,
-f88 float(23) unsigned not null default 8.8,
-f89 float(0) zerofill not null default 8.8,
-f90 float(23) zerofill not null default 8.8,
-f91 float(0) unsigned zerofill not null default 8.8,
-f92 float(23) unsigned zerofill not null default 8.8,
-f93 float(24) not null default 8.8,
-f94 float(53) not null default 8.8,
-f95 float(24) unsigned not null default 8.8,
-f96 float(53) unsigned not null default 8.8,
-f97 float(24) zerofill not null default 8.8,
-f98 float(53) zerofill not null default 8.8,
-f99 float(24) unsigned zerofill not null default 8.8,
-f100 float(53) unsigned zerofill not null default 8.8,
-f101 date not null default '2000-01-01',
-f102 time not null default 20,
-f103 datetime not null default '2/2/2',
-f104 timestamp not null default 20001231235959,
-f105 year not null default 2000,
-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 = ndb;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/ndb_tb2.txt'
-into table tb2 ;
-DROP DATABASE IF EXISTS test1;
-CREATE DATABASE test1;
-USE test1;
-drop table if exists tb2 ;
-create table tb2 (
-f59 numeric (0) unsigned,
-f60 numeric (64) unsigned,
-f61 numeric (0) zerofill,
-f62 numeric (64) zerofill,
-f63 numeric (0) unsigned zerofill,
-f64 numeric (64) unsigned zerofill,
-f65 numeric (0,0),
-f66 numeric (63,30),
-f67 numeric (0,0) unsigned,
-f68 numeric (63,30) unsigned,
-f69 numeric (0,0) zerofill,
-f70 numeric (63,30) zerofill,
-f71 numeric (0,0) unsigned zerofill,
-f72 numeric (63,30) unsigned zerofill,
-f73 real,
-f74 real unsigned,
-f75 real zerofill,
-f76 real unsigned zerofill,
-f77 double default 7.7,
-f78 double unsigned default 7.7,
-f79 double zerofill default 7.7,
-f80 double unsigned zerofill default 8.8,
-f81 float not null default 8.8,
-f82 float unsigned not null default 8.8,
-f83 float zerofill not null default 8.8,
-f84 float unsigned zerofill not null default 8.8,
-f85 float(0) not null default 8.8,
-f86 float(23) not null default 8.8,
-f87 float(0) unsigned not null default 8.8,
-f88 float(23) unsigned not null default 8.8,
-f89 float(0) zerofill not null default 8.8,
-f90 float(23) zerofill not null default 8.8,
-f91 float(0) unsigned zerofill not null default 8.8,
-f92 float(23) unsigned zerofill not null default 8.8,
-f93 float(24) not null default 8.8,
-f94 float(53) not null default 8.8,
-f95 float(24) unsigned not null default 8.8,
-f96 float(53) unsigned not null default 8.8,
-f97 float(24) zerofill not null default 8.8,
-f98 float(53) zerofill not null default 8.8,
-f99 float(24) unsigned zerofill not null default 8.8,
-f100 float(53) unsigned zerofill not null default 8.8,
-f101 date not null default '2000-01-01',
-f102 time not null default 20,
-f103 datetime not null default '2/2/2',
-f104 timestamp not null default 20001231235959,
-f105 year not null default 2000,
-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 = ndb;
-load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/ndb_tb2.txt'
-into table tb2 ;
-USE test;
-
-! Attention: The file with the expected results is not
-| thoroughly checked.
-! The server return codes are correct, but
-| most result sets where the table tb2 is
-! involved are not checked.
---------------------------------------------------------------------------------
-
-There are some statements where the ps-protocol is switched off.
-Bug#32285: mysqltest, --ps-protocol, strange output, float/double/real with zerofill
---------------------------------------------------------------------------------
-insert into test.tb2 (f59,f60) values (76710,226546);
-insert into test.tb2 (f59,f60) values(2760,985654);
-insert into test.tb2 (f59,f60) values(569300,9114376);
-insert into test.tb2 (f59,f60) values(660,876546);
-insert into test.tb2 (f59,f60) values(250,87895654);
-insert into test.tb2 (f59,f60) values(340,9984376);
-insert into test.tb2 (f59,f60) values(3410,996546);
-insert into test.tb2 (f59,f60) values(2550,775654);
-insert into test.tb2 (f59,f60) values(3330,764376);
-insert into test.tb2 (f59,f60) values(441,16546);
-insert into test.tb2 (f59,f60) values(24,51654);
-insert into test.tb2 (f59,f60) values(323,14376);
-insert into test.tb2 (f59,f60) values(34,41);
-insert into test.tb2 (f59,f60) values(04,74);
-insert into test.tb2 (f59,f60) values(15,87);
-insert into test.tb2 (f59,f60) values(22,93);
-insert into test.tb2 (f59,f60) values(394,41);
-insert into test.tb2 (f59,f60) values(094,74);
-insert into test.tb2 (f59,f60) values(195,87);
-insert into test.tb2 (f59,f60) values(292,93);
-insert into test.tb2 (f59,f60) values(0987,41) ;
-insert into test.tb2 (f59,f60) values(7876,74) ;
-INSERT INTO tb2 (f59,f61) VALUES(321,765 );
-INSERT INTO tb2 (f59,f61) VALUES(9112,8771);
-INSERT INTO tb2 (f59,f61) VALUES (500,900 ) ;
-INSERT INTO tb2 (f59,f61) VALUES (500,900 ) ;
-INSERT INTO tb2 (f59,f61) VALUES (500,900 ) ;
-Insert into tb2 (f59,f60,f61) values (107,105,106) ;
-Insert into tb2 (f59,f60,f61) values (109,108,104) ;
-Insert into tb2 (f59,f60,f61) values (207,205,206) ;
-Insert into tb2 (f59,f60,f61) values (209,208,204) ;
-Insert into tb2 (f59,f60,f61) values (27,25,26) ;
-Insert into tb2 (f59,f60,f61) values (29,28,24) ;
-Insert into tb2 (f59,f60,f61) values (17,15,16) ;
-Insert into tb2 (f59,f60,f61) values (19,18,14) ;
-insert into tb2 (f59,f60,f61) values (107,105,106);
-insert into tb2 (f59,f60,f61) values (109,108,104);
-INSERT INTO tb2 (f59,f60) VALUES( 299,899 );
-INSERT INTO tb2 (f59,f60) VALUES( 242,79 );
-INSERT INTO tb2 (f59,f60) VALUES( 424,89 );
-SELECT * FROM tb2 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
-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
-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
-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
-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
-Use test;
-
-Testcase 3.3.1.1
---------------------------------------------------------------------------------
-Drop table if exists t1;
-Create table t1 (f59 INT, f60 INT) ;
-Insert into t1 values (100,4234);
-Insert into t1 values (990,6624);
-Insert into t1 values (710,765);
-Insert into t1 values (300,433334);
-Insert into t1 values (800,9788);
-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 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 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
-CREATE or REPLACE VIEW v1 AS select f59,f60,f61
-FROM test.tb2;
-select * FROM v1 order by f59,f60,f61 limit 4,3;
-f59 f60 f61
-4 74 NULL
-5 5 0000000005
-6 6 0000000006
-CREATE or REPLACE VIEW v1 AS select distinct f59
-FROM test.tb2;
-select * FROM v1 order by f59 limit 4,3;
-f59
-5
-6
-7
-ALTER VIEW v1 AS select f59
-FROM test.tb2;
-select * FROM v1 order by f59 limit 6,2;
-f59
-6
-7
-CREATE or REPLACE VIEW v1 AS select f59
-from tb2 order by f59;
-select * FROM v1 order by f59 limit 0,10;
-f59
-1
-2
-3
-4
-4
-5
-6
-7
-8
-9
-CREATE or REPLACE VIEW v1 AS select f59
-from tb2 order by f59 asc;
-select * FROM v1 limit 0,10;
-f59
-1
-2
-3
-4
-4
-5
-6
-7
-8
-9
-CREATE or REPLACE VIEW v1 AS select f59
-from tb2 order by f59 desc;
-select * FROM v1 limit 0,10;
-f59
-569300
-76710
-9112
-7876
-3410
-3330
-2760
-2550
-987
-660
-CREATE or REPLACE VIEW v1 AS select f59
-from tb2 group by f59;
-select * FROM v1 order by f59 limit 0,10;
-f59
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-CREATE or REPLACE VIEW v1 AS select f59
-from tb2 group by f59 asc;
-select * FROM v1 order by f59 limit 0,10;
-f59
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-CREATE or REPLACE VIEW v1 AS select f59
-from tb2 group by f59 desc;
-select * FROM v1 order by f59 limit 0,10;
-f59
-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);
-select * FROM v1 order by f59 limit 0,10;
-f59
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-CREATE or REPLACE VIEW v1 AS (select f59 FROM tb2)
-UNION DISTINCT(select f59 FROM t1) ;
-select * FROM v1 order by f59 limit 0,10;
-f59
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-CREATE or REPLACE VIEW v1 AS (select f59 FROM tb2)
-UNION ALL(select f59 FROM t1) ;
-select * FROM v1 order by f59 limit 0,10;
-f59
-1
-2
-3
-4
-4
-5
-6
-7
-8
-9
-CREATE or REPLACE VIEW v1 AS select *
-FROM test.tb2 WITH LOCAL CHECK OPTION ;
-select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,50;
-f59 1
-f60 1
-f61 0000000001
-f62 0000000000000000000000000000000000000000000000000000000000000001
-f63 0000000001
-f64 0000000000000000000000000000000000000000000000000000000000000001
-f65 -5
-f66 0.000000000000000000000000000000
-f67 1
-f68 0.000000000000000000000000000000
-f69 0000000001
-f70 000000000000000000000000000000000.000000000000000000000000000000
-f71 0000000001
-f72 000000000000000000000000000000000.000000000000000000000000000000
-f73 -1.17549435e-38
-f74 1.175494352e-38
-f75 00000001.175494352e-38
-f76 00000001.175494352e-38
-f77 -1.17549435e-38
-f78 1.175494352e-38
-f79 00000001.175494352e-38
-f80 00000001.175494352e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.17549435e-38
-f95 1.17549e-38
-f96 1.175494352e-38
-f97 01.17549e-38
-f98 00000001.175494352e-38
-f99 01.17549e-38
-f100 00000001.175494352e-38
-f101 1000-01-01
-f102 838:59:58
-f103 1970-01-02 00:00:01
-f104 1970-01-02 00:00:01
-f105 1902
-f106 1902
-f107 1902
-f108 2enum
-f109 2set
-f59 2
-f60 2
-f61 0000000002
-f62 0000000000000000000000000000000000000000000000000000000000000002
-f63 0000000002
-f64 0000000000000000000000000000000000000000000000000000000000000002
-f65 -4
-f66 1.100000000000000000000000000000
-f67 2
-f68 1.100000000000000000000000000000
-f69 0000000002
-f70 000000000000000000000000000000001.100000000000000000000000000000
-f71 0000000002
-f72 000000000000000000000000000000001.100000000000000000000000000000
-f73 -1.175494349e-38
-f74 1.175494353e-38
-f75 00000001.175494353e-38
-f76 00000001.175494353e-38
-f77 -1.175494349e-38
-f78 1.175494353e-38
-f79 00000001.175494353e-38
-f80 00000001.175494353e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494349e-38
-f95 1.17549e-38
-f96 1.175494353e-38
-f97 01.17549e-38
-f98 00000001.175494353e-38
-f99 01.17549e-38
-f100 00000001.175494353e-38
-f101 1000-01-02
-f102 838:59:57
-f103 1970-01-03 00:00:02
-f104 1970-01-03 00:00:02
-f105 1903
-f106 1903
-f107 1903
-f108 1enum
-f109 1set,2set
-f59 3
-f60 3
-f61 0000000003
-f62 0000000000000000000000000000000000000000000000000000000000000003
-f63 0000000003
-f64 0000000000000000000000000000000000000000000000000000000000000003
-f65 -3
-f66 2.200000000000000000000000000000
-f67 3
-f68 2.200000000000000000000000000000
-f69 0000000003
-f70 000000000000000000000000000000002.200000000000000000000000000000
-f71 0000000003
-f72 000000000000000000000000000000002.200000000000000000000000000000
-f73 -1.175494348e-38
-f74 1.175494354e-38
-f75 00000001.175494354e-38
-f76 00000001.175494354e-38
-f77 -1.175494348e-38
-f78 1.175494354e-38
-f79 00000001.175494354e-38
-f80 00000001.175494354e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494348e-38
-f95 1.17549e-38
-f96 1.175494354e-38
-f97 01.17549e-38
-f98 00000001.175494354e-38
-f99 01.17549e-38
-f100 00000001.175494354e-38
-f101 1000-01-03
-f102 838:59:56
-f103 1970-01-04 00:00:03
-f104 1970-01-04 00:00:03
-f105 1904
-f106 1904
-f107 1904
-f108 2enum
-f109 1set
-f59 4
-f60 4
-f61 0000000004
-f62 0000000000000000000000000000000000000000000000000000000000000004
-f63 0000000004
-f64 0000000000000000000000000000000000000000000000000000000000000004
-f65 -2
-f66 3.300000000000000000000000000000
-f67 4
-f68 3.300000000000000000000000000000
-f69 0000000004
-f70 000000000000000000000000000000003.300000000000000000000000000000
-f71 0000000004
-f72 000000000000000000000000000000003.300000000000000000000000000000
-f73 -1.175494347e-38
-f74 1.175494355e-38
-f75 00000001.175494355e-38
-f76 00000001.175494355e-38
-f77 -1.175494347e-38
-f78 1.175494355e-38
-f79 00000001.175494355e-38
-f80 00000001.175494355e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494347e-38
-f95 1.17549e-38
-f96 1.175494355e-38
-f97 01.17549e-38
-f98 00000001.175494355e-38
-f99 01.17549e-38
-f100 00000001.175494355e-38
-f101 1000-01-04
-f102 838:59:55
-f103 1970-01-05 00:00:04
-f104 1970-01-05 00:00:04
-f105 1905
-f106 1905
-f107 1905
-f108 1enum
-f109 2set
-f59 4
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 5
-f60 5
-f61 0000000005
-f62 0000000000000000000000000000000000000000000000000000000000000005
-f63 0000000005
-f64 0000000000000000000000000000000000000000000000000000000000000005
-f65 -1
-f66 4.400000000000000000000000000000
-f67 5
-f68 4.400000000000000000000000000000
-f69 0000000005
-f70 000000000000000000000000000000004.400000000000000000000000000000
-f71 0000000005
-f72 000000000000000000000000000000004.400000000000000000000000000000
-f73 -1.175494346e-38
-f74 1.175494356e-38
-f75 00000001.175494356e-38
-f76 00000001.175494356e-38
-f77 -1.175494346e-38
-f78 1.175494356e-38
-f79 00000001.175494356e-38
-f80 00000001.175494356e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494346e-38
-f95 1.17549e-38
-f96 1.175494356e-38
-f97 01.17549e-38
-f98 00000001.175494356e-38
-f99 01.17549e-38
-f100 00000001.175494356e-38
-f101 1000-01-05
-f102 838:59:54
-f103 1970-01-06 00:00:05
-f104 1970-01-06 00:00:05
-f105 1906
-f106 1906
-f107 1906
-f108 2enum
-f109 1set,2set
-f59 6
-f60 6
-f61 0000000006
-f62 0000000000000000000000000000000000000000000000000000000000000006
-f63 0000000006
-f64 0000000000000000000000000000000000000000000000000000000000000006
-f65 0
-f66 5.500000000000000000000000000000
-f67 6
-f68 5.500000000000000000000000000000
-f69 0000000006
-f70 000000000000000000000000000000005.500000000000000000000000000000
-f71 0000000006
-f72 000000000000000000000000000000005.500000000000000000000000000000
-f73 -1.175494345e-38
-f74 1.175494357e-38
-f75 00000001.175494357e-38
-f76 00000001.175494357e-38
-f77 -1.175494345e-38
-f78 1.175494357e-38
-f79 00000001.175494357e-38
-f80 00000001.175494357e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494345e-38
-f95 1.17549e-38
-f96 1.175494357e-38
-f97 01.17549e-38
-f98 00000001.175494357e-38
-f99 01.17549e-38
-f100 00000001.175494357e-38
-f101 1000-01-06
-f102 838:59:53
-f103 1970-01-07 00:00:06
-f104 1970-01-07 00:00:06
-f105 1907
-f106 1907
-f107 1907
-f108 1enum
-f109 1set
-f59 7
-f60 7
-f61 0000000007
-f62 0000000000000000000000000000000000000000000000000000000000000007
-f63 0000000007
-f64 0000000000000000000000000000000000000000000000000000000000000007
-f65 1
-f66 6.600000000000000000000000000000
-f67 7
-f68 6.600000000000000000000000000000
-f69 0000000007
-f70 000000000000000000000000000000006.600000000000000000000000000000
-f71 0000000007
-f72 000000000000000000000000000000006.600000000000000000000000000000
-f73 -1.175494344e-38
-f74 1.175494358e-38
-f75 00000001.175494358e-38
-f76 00000001.175494358e-38
-f77 -1.175494344e-38
-f78 1.175494358e-38
-f79 00000001.175494358e-38
-f80 00000001.175494358e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494344e-38
-f95 1.17549e-38
-f96 1.175494358e-38
-f97 01.17549e-38
-f98 00000001.175494358e-38
-f99 01.17549e-38
-f100 00000001.175494358e-38
-f101 1000-01-07
-f102 838:59:52
-f103 1970-01-08 00:00:07
-f104 1970-01-08 00:00:07
-f105 1908
-f106 1908
-f107 1908
-f108 2enum
-f109 2set
-f59 8
-f60 8
-f61 0000000008
-f62 0000000000000000000000000000000000000000000000000000000000000008
-f63 0000000008
-f64 0000000000000000000000000000000000000000000000000000000000000008
-f65 2
-f66 7.700000000000000000000000000000
-f67 8
-f68 7.700000000000000000000000000000
-f69 0000000008
-f70 000000000000000000000000000000007.700000000000000000000000000000
-f71 0000000008
-f72 000000000000000000000000000000007.700000000000000000000000000000
-f73 -1.175494343e-38
-f74 1.175494359e-38
-f75 00000001.175494359e-38
-f76 00000001.175494359e-38
-f77 -1.175494343e-38
-f78 1.175494359e-38
-f79 00000001.175494359e-38
-f80 00000001.175494359e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494343e-38
-f95 1.17549e-38
-f96 1.175494359e-38
-f97 01.17549e-38
-f98 00000001.175494359e-38
-f99 01.17549e-38
-f100 00000001.175494359e-38
-f101 1000-01-08
-f102 838:59:51
-f103 1970-01-09 00:00:08
-f104 1970-01-09 00:00:08
-f105 1909
-f106 1909
-f107 1909
-f108 1enum
-f109 1set,2set
-f59 9
-f60 9
-f61 0000000009
-f62 0000000000000000000000000000000000000000000000000000000000000009
-f63 0000000009
-f64 0000000000000000000000000000000000000000000000000000000000000009
-f65 3
-f66 8.800000000000000000000000000000
-f67 9
-f68 8.800000000000000000000000000000
-f69 0000000009
-f70 000000000000000000000000000000008.800000000000000000000000000000
-f71 0000000009
-f72 000000000000000000000000000000008.800000000000000000000000000000
-f73 -1.175494342e-38
-f74 1.17549436e-38
-f75 000000001.17549436e-38
-f76 000000001.17549436e-38
-f77 -1.175494342e-38
-f78 1.17549436e-38
-f79 000000001.17549436e-38
-f80 000000001.17549436e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494342e-38
-f95 1.17549e-38
-f96 1.17549436e-38
-f97 01.17549e-38
-f98 000000001.17549436e-38
-f99 01.17549e-38
-f100 000000001.17549436e-38
-f101 1000-01-09
-f102 838:59:50
-f103 1970-01-10 00:00:09
-f104 1970-01-10 00:00:09
-f105 1910
-f106 1910
-f107 1910
-f108 2enum
-f109 1set
-f59 10
-f60 10
-f61 0000000010
-f62 0000000000000000000000000000000000000000000000000000000000000010
-f63 0000000010
-f64 0000000000000000000000000000000000000000000000000000000000000010
-f65 4
-f66 9.900000000000000000000000000000
-f67 10
-f68 9.900000000000000000000000000000
-f69 0000000010
-f70 000000000000000000000000000000009.900000000000000000000000000000
-f71 0000000010
-f72 000000000000000000000000000000009.900000000000000000000000000000
-f73 -1.175494341e-38
-f74 1.175494361e-38
-f75 00000001.175494361e-38
-f76 00000001.175494361e-38
-f77 -1.175494341e-38
-f78 1.175494361e-38
-f79 00000001.175494361e-38
-f80 00000001.175494361e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494341e-38
-f95 1.17549e-38
-f96 1.175494361e-38
-f97 01.17549e-38
-f98 00000001.175494361e-38
-f99 01.17549e-38
-f100 00000001.175494361e-38
-f101 1000-01-10
-f102 838:59:49
-f103 1970-01-11 00:00:10
-f104 1970-01-11 00:00:10
-f105 1911
-f106 1911
-f107 1911
-f108 1enum
-f109 2set
-f59 15
-f60 87
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 17
-f60 15
-f61 0000000016
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 19
-f60 18
-f61 0000000014
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 22
-f60 93
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 24
-f60 51654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 27
-f60 25
-f61 0000000026
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 29
-f60 28
-f61 0000000024
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 34
-f60 41
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 94
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 107
-f60 105
-f61 0000000106
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 107
-f60 105
-f61 0000000106
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 109
-f60 108
-f61 0000000104
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 109
-f60 108
-f61 0000000104
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 195
-f60 87
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 207
-f60 205
-f61 0000000206
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 209
-f60 208
-f61 0000000204
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 242
-f60 79
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 250
-f60 87895654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 292
-f60 93
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 299
-f60 899
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 321
-f60 NULL
-f61 0000000765
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 323
-f60 14376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 340
-f60 9984376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 394
-f60 41
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 424
-f60 89
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 441
-f60 16546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 500
-f60 NULL
-f61 0000000900
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 500
-f60 NULL
-f61 0000000900
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 500
-f60 NULL
-f61 0000000900
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 660
-f60 876546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 987
-f60 41
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 2550
-f60 775654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 2760
-f60 985654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 3330
-f60 764376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 3410
-f60 996546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 7876
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 9112
-f60 NULL
-f61 0000008771
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 76710
-f60 226546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 569300
-f60 9114376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-CREATE or REPLACE VIEW v1 AS select *
-FROM test.tb2 WITH CASCADED CHECK OPTION ;
-select * FROM v1 order by f59,f60,f61,f62,f63,f64 limit 0,10;
-f59 1
-f60 1
-f61 0000000001
-f62 0000000000000000000000000000000000000000000000000000000000000001
-f63 0000000001
-f64 0000000000000000000000000000000000000000000000000000000000000001
-f65 -5
-f66 0.000000000000000000000000000000
-f67 1
-f68 0.000000000000000000000000000000
-f69 0000000001
-f70 000000000000000000000000000000000.000000000000000000000000000000
-f71 0000000001
-f72 000000000000000000000000000000000.000000000000000000000000000000
-f73 -1.17549435e-38
-f74 1.175494352e-38
-f75 00000001.175494352e-38
-f76 00000001.175494352e-38
-f77 -1.17549435e-38
-f78 1.175494352e-38
-f79 00000001.175494352e-38
-f80 00000001.175494352e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.17549435e-38
-f95 1.17549e-38
-f96 1.175494352e-38
-f97 01.17549e-38
-f98 00000001.175494352e-38
-f99 01.17549e-38
-f100 00000001.175494352e-38
-f101 1000-01-01
-f102 838:59:58
-f103 1970-01-02 00:00:01
-f104 1970-01-02 00:00:01
-f105 1902
-f106 1902
-f107 1902
-f108 2enum
-f109 2set
-f59 2
-f60 2
-f61 0000000002
-f62 0000000000000000000000000000000000000000000000000000000000000002
-f63 0000000002
-f64 0000000000000000000000000000000000000000000000000000000000000002
-f65 -4
-f66 1.100000000000000000000000000000
-f67 2
-f68 1.100000000000000000000000000000
-f69 0000000002
-f70 000000000000000000000000000000001.100000000000000000000000000000
-f71 0000000002
-f72 000000000000000000000000000000001.100000000000000000000000000000
-f73 -1.175494349e-38
-f74 1.175494353e-38
-f75 00000001.175494353e-38
-f76 00000001.175494353e-38
-f77 -1.175494349e-38
-f78 1.175494353e-38
-f79 00000001.175494353e-38
-f80 00000001.175494353e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494349e-38
-f95 1.17549e-38
-f96 1.175494353e-38
-f97 01.17549e-38
-f98 00000001.175494353e-38
-f99 01.17549e-38
-f100 00000001.175494353e-38
-f101 1000-01-02
-f102 838:59:57
-f103 1970-01-03 00:00:02
-f104 1970-01-03 00:00:02
-f105 1903
-f106 1903
-f107 1903
-f108 1enum
-f109 1set,2set
-f59 3
-f60 3
-f61 0000000003
-f62 0000000000000000000000000000000000000000000000000000000000000003
-f63 0000000003
-f64 0000000000000000000000000000000000000000000000000000000000000003
-f65 -3
-f66 2.200000000000000000000000000000
-f67 3
-f68 2.200000000000000000000000000000
-f69 0000000003
-f70 000000000000000000000000000000002.200000000000000000000000000000
-f71 0000000003
-f72 000000000000000000000000000000002.200000000000000000000000000000
-f73 -1.175494348e-38
-f74 1.175494354e-38
-f75 00000001.175494354e-38
-f76 00000001.175494354e-38
-f77 -1.175494348e-38
-f78 1.175494354e-38
-f79 00000001.175494354e-38
-f80 00000001.175494354e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494348e-38
-f95 1.17549e-38
-f96 1.175494354e-38
-f97 01.17549e-38
-f98 00000001.175494354e-38
-f99 01.17549e-38
-f100 00000001.175494354e-38
-f101 1000-01-03
-f102 838:59:56
-f103 1970-01-04 00:00:03
-f104 1970-01-04 00:00:03
-f105 1904
-f106 1904
-f107 1904
-f108 2enum
-f109 1set
-f59 4
-f60 4
-f61 0000000004
-f62 0000000000000000000000000000000000000000000000000000000000000004
-f63 0000000004
-f64 0000000000000000000000000000000000000000000000000000000000000004
-f65 -2
-f66 3.300000000000000000000000000000
-f67 4
-f68 3.300000000000000000000000000000
-f69 0000000004
-f70 000000000000000000000000000000003.300000000000000000000000000000
-f71 0000000004
-f72 000000000000000000000000000000003.300000000000000000000000000000
-f73 -1.175494347e-38
-f74 1.175494355e-38
-f75 00000001.175494355e-38
-f76 00000001.175494355e-38
-f77 -1.175494347e-38
-f78 1.175494355e-38
-f79 00000001.175494355e-38
-f80 00000001.175494355e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494347e-38
-f95 1.17549e-38
-f96 1.175494355e-38
-f97 01.17549e-38
-f98 00000001.175494355e-38
-f99 01.17549e-38
-f100 00000001.175494355e-38
-f101 1000-01-04
-f102 838:59:55
-f103 1970-01-05 00:00:04
-f104 1970-01-05 00:00:04
-f105 1905
-f106 1905
-f107 1905
-f108 1enum
-f109 2set
-f59 4
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 5
-f60 5
-f61 0000000005
-f62 0000000000000000000000000000000000000000000000000000000000000005
-f63 0000000005
-f64 0000000000000000000000000000000000000000000000000000000000000005
-f65 -1
-f66 4.400000000000000000000000000000
-f67 5
-f68 4.400000000000000000000000000000
-f69 0000000005
-f70 000000000000000000000000000000004.400000000000000000000000000000
-f71 0000000005
-f72 000000000000000000000000000000004.400000000000000000000000000000
-f73 -1.175494346e-38
-f74 1.175494356e-38
-f75 00000001.175494356e-38
-f76 00000001.175494356e-38
-f77 -1.175494346e-38
-f78 1.175494356e-38
-f79 00000001.175494356e-38
-f80 00000001.175494356e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494346e-38
-f95 1.17549e-38
-f96 1.175494356e-38
-f97 01.17549e-38
-f98 00000001.175494356e-38
-f99 01.17549e-38
-f100 00000001.175494356e-38
-f101 1000-01-05
-f102 838:59:54
-f103 1970-01-06 00:00:05
-f104 1970-01-06 00:00:05
-f105 1906
-f106 1906
-f107 1906
-f108 2enum
-f109 1set,2set
-f59 6
-f60 6
-f61 0000000006
-f62 0000000000000000000000000000000000000000000000000000000000000006
-f63 0000000006
-f64 0000000000000000000000000000000000000000000000000000000000000006
-f65 0
-f66 5.500000000000000000000000000000
-f67 6
-f68 5.500000000000000000000000000000
-f69 0000000006
-f70 000000000000000000000000000000005.500000000000000000000000000000
-f71 0000000006
-f72 000000000000000000000000000000005.500000000000000000000000000000
-f73 -1.175494345e-38
-f74 1.175494357e-38
-f75 00000001.175494357e-38
-f76 00000001.175494357e-38
-f77 -1.175494345e-38
-f78 1.175494357e-38
-f79 00000001.175494357e-38
-f80 00000001.175494357e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494345e-38
-f95 1.17549e-38
-f96 1.175494357e-38
-f97 01.17549e-38
-f98 00000001.175494357e-38
-f99 01.17549e-38
-f100 00000001.175494357e-38
-f101 1000-01-06
-f102 838:59:53
-f103 1970-01-07 00:00:06
-f104 1970-01-07 00:00:06
-f105 1907
-f106 1907
-f107 1907
-f108 1enum
-f109 1set
-f59 7
-f60 7
-f61 0000000007
-f62 0000000000000000000000000000000000000000000000000000000000000007
-f63 0000000007
-f64 0000000000000000000000000000000000000000000000000000000000000007
-f65 1
-f66 6.600000000000000000000000000000
-f67 7
-f68 6.600000000000000000000000000000
-f69 0000000007
-f70 000000000000000000000000000000006.600000000000000000000000000000
-f71 0000000007
-f72 000000000000000000000000000000006.600000000000000000000000000000
-f73 -1.175494344e-38
-f74 1.175494358e-38
-f75 00000001.175494358e-38
-f76 00000001.175494358e-38
-f77 -1.175494344e-38
-f78 1.175494358e-38
-f79 00000001.175494358e-38
-f80 00000001.175494358e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494344e-38
-f95 1.17549e-38
-f96 1.175494358e-38
-f97 01.17549e-38
-f98 00000001.175494358e-38
-f99 01.17549e-38
-f100 00000001.175494358e-38
-f101 1000-01-07
-f102 838:59:52
-f103 1970-01-08 00:00:07
-f104 1970-01-08 00:00:07
-f105 1908
-f106 1908
-f107 1908
-f108 2enum
-f109 2set
-f59 8
-f60 8
-f61 0000000008
-f62 0000000000000000000000000000000000000000000000000000000000000008
-f63 0000000008
-f64 0000000000000000000000000000000000000000000000000000000000000008
-f65 2
-f66 7.700000000000000000000000000000
-f67 8
-f68 7.700000000000000000000000000000
-f69 0000000008
-f70 000000000000000000000000000000007.700000000000000000000000000000
-f71 0000000008
-f72 000000000000000000000000000000007.700000000000000000000000000000
-f73 -1.175494343e-38
-f74 1.175494359e-38
-f75 00000001.175494359e-38
-f76 00000001.175494359e-38
-f77 -1.175494343e-38
-f78 1.175494359e-38
-f79 00000001.175494359e-38
-f80 00000001.175494359e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494343e-38
-f95 1.17549e-38
-f96 1.175494359e-38
-f97 01.17549e-38
-f98 00000001.175494359e-38
-f99 01.17549e-38
-f100 00000001.175494359e-38
-f101 1000-01-08
-f102 838:59:51
-f103 1970-01-09 00:00:08
-f104 1970-01-09 00:00:08
-f105 1909
-f106 1909
-f107 1909
-f108 1enum
-f109 1set,2set
-f59 9
-f60 9
-f61 0000000009
-f62 0000000000000000000000000000000000000000000000000000000000000009
-f63 0000000009
-f64 0000000000000000000000000000000000000000000000000000000000000009
-f65 3
-f66 8.800000000000000000000000000000
-f67 9
-f68 8.800000000000000000000000000000
-f69 0000000009
-f70 000000000000000000000000000000008.800000000000000000000000000000
-f71 0000000009
-f72 000000000000000000000000000000008.800000000000000000000000000000
-f73 -1.175494342e-38
-f74 1.17549436e-38
-f75 000000001.17549436e-38
-f76 000000001.17549436e-38
-f77 -1.175494342e-38
-f78 1.17549436e-38
-f79 000000001.17549436e-38
-f80 000000001.17549436e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494342e-38
-f95 1.17549e-38
-f96 1.17549436e-38
-f97 01.17549e-38
-f98 000000001.17549436e-38
-f99 01.17549e-38
-f100 000000001.17549436e-38
-f101 1000-01-09
-f102 838:59:50
-f103 1970-01-10 00:00:09
-f104 1970-01-10 00:00:09
-f105 1910
-f106 1910
-f107 1910
-f108 2enum
-f109 1set
-CREATE OR REPLACE VIEW v1 AS SELECT F59, F60
-FROM test.tb2 WITH CASCADED CHECK OPTION;
-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
-CREATE or REPLACE VIEW v1 AS select f59, f60
-from test.tb2 where f59=3330 ;
-select * FROM v1 order by f60 limit 0,10;
-f59 f60
-3330 764376
-DROP VIEW v1 ;
-DROP TABLE t1 ;
-
-Testcase 3.3.1.2
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1 ;
-DROP VIEW IF EXISTS v1 ;
-DROP VIEW IF EXISTS v2 ;
-CREATE TABLE t1 (f1 BIGINT) ;
-SET @x=0;
-CREATE or REPLACE VIEW v1 AS Select 1 INTO @x;
-ERROR HY000: View's SELECT contains a 'INTO' clause
-Select @x;
-@x
-0
-CREATE or REPLACE VIEW v1 AS Select 1
-FROM (SELECT 1 FROM t1) my_table;
-ERROR HY000: View's SELECT contains a subquery in the FROM clause
-CREATE VIEW v1 AS SELECT f1 FROM t1;
-CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ;
-SET @a:=0 ;
-SELECT @a ;
-@a
-0
-INSERT INTO v1 VALUES (1) ;
-SELECT @a ;
-@a
-1
-SELECT * FROM t1;
-f1
-1
-DROP TRIGGER tr1 ;
-SET @a:=0 ;
-CREATE TRIGGER tr1 BEFORE INSERT ON v1 FOR EACH ROW SET @a:=1 ;
-ERROR HY000: 'test.v1' is not BASE TABLE
-RENAME TABLE v1 TO v2;
-RENAME VIEW v2 TO v1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VIEW v2 TO v1' at line 1
-ALTER TABLE v2 RENAME AS v1;
-ERROR HY000: 'test.v2' is not BASE TABLE
-ALTER VIEW v1 RENAME AS v2;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RENAME AS v2' at line 1
-DROP TABLE IF EXISTS t1, t2 ;
-DROP VIEW IF EXISTS v1 ;
-DROP VIEW IF EXISTS v2 ;
-CREATE TABLE t1 ( f1 DATE, f2 BLOB, f3 DOUBLE );
-CREATE VIEW v1 AS SELECT f1, f2, f3 FROM t1;
-ALTER TABLE t1 ADD PRIMARY KEY(f1);
-ALTER TABLE v1 ADD PRIMARY KEY(f1);
-ERROR HY000: 'test.v1' is not BASE TABLE
-ALTER VIEW v1 ADD PRIMARY KEY(f1);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ADD PRIMARY KEY(f1)' at line 1
-CREATE INDEX t1_idx ON t1(f3);
-CREATE INDEX v1_idx ON v1(f3);
-ERROR HY000: 'test.v1' is not BASE TABLE
-DROP TABLE t1;
-DROP VIEW v1;
-
-Testcase 3.3.1.3 + 3.1.1.4
---------------------------------------------------------------------------------
-DROP VIEW IF EXISTS v1 ;
-CREATE VIEW v1 or REPLACE AS Select * from tb2 my_table;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'or REPLACE AS Select * from tb2 my_table' at line 1
-CREATE VIEW v1 WITH CASCADED CHECK OPTION AS Select *
-from tb2 my_table limit 50;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CASCADED CHECK OPTION AS Select *
-from tb2 my_table limit 50' at line 1
-CREATE VIEW v1 WITH LOCAL CHECK OPTION AS Select *
-from tb2 my_table limit 50;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LOCAL CHECK OPTION AS Select *
-from tb2 my_table limit 50' at line 1
-SELECT * FROM tb2 my_table CREATE VIEW As v1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE VIEW As v1' at line 1
-CREATE or REPLACE VIEW v1 Select f59, f60
-from test.tb2 my_table where f59 = 250 ;
-ERROR 42000: You 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 f59, f60
-from test.tb2 my_table where f59 = 250' at line 1
-CREATE OR REPLACE VIEW v1 AS SELECT F59, F60
-FROM test.tb2 my_table WITH CASCADED CHECK OPTION;
-DROP VIEW v1;
-REPLACE OR CREATE VIEW v1 AS SELECT F59, F60
-FROM test.tb2 my_table WITH CASCADED CHECK OPTION;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR CREATE VIEW v1 AS SELECT F59, F60
-FROM test.tb2 my_table WITH CASCADED CHECK ' at line 1
-CREATE OR REPLACE VIEW v1 SELECT AS F59, F60
-FROM test.tb2 my_table WITH CASCADED CHECK OPTION;
-ERROR 42000: You 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 AS F59, F60
-FROM test.tb2 my_table WITH CASCADED CHECK OPTION' at line 1
-CREATE OR REPLACE VIEW v1 AS SELECT F59, F60
-FROM test.tb2 my_table CASCADED WITH CHECK OPTION;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CASCADED WITH CHECK OPTION' at line 2
-CREATE OR REPLACE VIEW v1 AS SELECT F59, F60
-FROM test.tb2 my_table WITH CASCADED OPTION CHECK;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION CHECK' at line 2
-CREATE OR REPLACE VIEW v1 AS SELECT F59, F60
-FROM test.tb2 my_table CHECK OPTION WITH CASCADED;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CHECK OPTION WITH CASCADED' at line 2
-CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
-AS SELECT F59, F60 FROM test.tb2 my_table;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CASCADED CHECK OPTION
-AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
-CREATE OR REPLACE AS SELECT F59, F60
-FROM test.tb2 my_table VIEW v1 WITH CASCADED CHECK OPTION;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS SELECT F59, F60
-FROM test.tb2 my_table VIEW v1 WITH CASCADED CHECK OPTION' at line 1
-CREATE OR REPLACE AS SELECT F59, F60
-FROM test.tb2 my_table WITH CASCADED CHECK OPTION VIEW v1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS SELECT F59, F60
-FROM test.tb2 my_table WITH CASCADED CHECK OPTION VIEW v1' at line 1
-REPLACE OR CREATE VIEW v1 AS SELECT F59, F60
-FROM test.tb2 my_table WITH LOCAL CHECK OPTION;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR CREATE VIEW v1 AS SELECT F59, F60
-FROM test.tb2 my_table WITH LOCAL CHECK OPT' at line 1
-CREATE OR REPLACE VIEW v1 SELECT AS F59, F60
-FROM test.tb2 my_table WITH LOCAL CHECK OPTION;
-ERROR 42000: You 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 AS F59, F60
-FROM test.tb2 my_table WITH LOCAL CHECK OPTION' at line 1
-CREATE OR REPLACE VIEW v1 AS SELECT F59, F60
-FROM test.tb2 my_table LOCAL WITH CHECK OPTION;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LOCAL WITH CHECK OPTION' at line 2
-CREATE OR REPLACE VIEW v1 AS SELECT F59, F60
-FROM test.tb2 my_table WITH LOCAL OPTION CHECK;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION CHECK' at line 2
-CREATE OR REPLACE VIEW v1 AS SELECT F59, F60
-FROM test.tb2 my_table CHECK OPTION WITH LOCAL;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CHECK OPTION WITH LOCAL' at line 2
-CREATE OR REPLACE VIEW v1 WITH CASCADED CHECK OPTION
-AS SELECT F59, F60 FROM test.tb2 my_table;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CASCADED CHECK OPTION
-AS SELECT F59, F60 FROM test.tb2 my_table' at line 1
-CREATE OR REPLACE AS SELECT F59, F60
-FROM test.tb2 my_table VIEW v1 WITH LOCAL CHECK OPTION;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS SELECT F59, F60
-FROM test.tb2 my_table VIEW v1 WITH LOCAL CHECK OPTION' at line 1
-CREATE OR REPLACE AS SELECT F59, F60
-FROM test.tb2 my_table WITH LOCAL CHECK OPTION VIEW v1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS SELECT F59, F60
-FROM test.tb2 my_table WITH LOCAL CHECK OPTION VIEW v1' at line 1
-Drop table if exists t1 ;
-CREATE table t1 (f1 int ,f2 int) ;
-INSERT INTO t1 values (235, 22);
-INSERT INTO t1 values (554, 11);
-CREATE or REPLACE view v1 as (Select from f59 tb2)
-Union ALL (Select from f1 t1);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from f59 tb2)
-Union ALL (Select from f1 t1)' at line 1
-CREATE or REPLACE view v1 as Select f59, f60
-from tb2 by order f59;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by order f59' at line 2
-CREATE or REPLACE view v1 as Select f59, f60
-from tb2 by group f59 ;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by group f59' at line 2
-
-Testcase 3.3.1.5
---------------------------------------------------------------------------------
-DROP VIEW IF EXISTS v1 ;
-CREATE VIEW v1 SELECT * FROM tb2;
-ERROR 42000: You 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 * FROM tb2' at line 1
-CREATE v1 AS SELECT * FROM tb2;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'v1 AS SELECT * FROM tb2' at line 1
-VIEW v1 AS SELECT * FROM tb2;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VIEW v1 AS SELECT * FROM tb2' at line 1
-CREATE VIEW v1 AS SELECT 1;
-DROP VIEW v1;
-VIEW v1 AS 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 'VIEW v1 AS SELECT 1' at line 1
-CREATE v1 AS 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 'v1 AS SELECT 1' at line 1
-CREATE VIEW AS 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 'AS SELECT 1' at line 1
-CREATE VIEW v1 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
-CREATE VIEW v1 AS ;
-ERROR 42000: You 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
-
-Testcase 3.3.1.6
---------------------------------------------------------------------------------
-DROP VIEW IF EXISTS v1 ;
-CREATE or REPLACE VIEW v1
-as SELECT * from tb2;
-CREATE or REPLACE ALGORITHM = UNDEFINED VIEW v1
-as SELECT * from tb2;
-CREATE or REPLACE ALGORITHM = MERGE VIEW v1
-as SELECT * from tb2;
-CREATE or REPLACE ALGORITHM = TEMPTABLE VIEW v1
-as SELECT * from tb2;
-CREATE or REPLACE ALGORITHM = TEMPTABLE VIEW v1
-as SELECT * from tb2;
-CREATE or REPLACE = TEMPTABLE VIEW v1
-as SELECT * from tb2;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= TEMPTABLE VIEW v1
-as SELECT * from tb2' at line 1
-CREATE or REPLACE ALGORITHM TEMPTABLE VIEW v1
-as SELECT * from tb2;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TEMPTABLE VIEW v1
-as SELECT * from tb2' at line 1
-CREATE or REPLACE ALGORITHM = VIEW v1
-as SELECT * from tb2;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VIEW v1
-as SELECT * from tb2' at line 1
-CREATE or REPLACE TEMPTABLE = ALGORITHM VIEW v1
-as SELECT * from tb2;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TEMPTABLE = ALGORITHM VIEW v1
-as SELECT * from tb2' at line 1
-CREATE or REPLACE TEMPTABLE - ALGORITHM VIEW v1
-as SELECT * from tb2;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TEMPTABLE - ALGORITHM VIEW v1
-as SELECT * from tb2' at line 1
-CREATE or REPLACE GARBAGE = TEMPTABLE VIEW v1
-as SELECT * from tb2;
-ERROR 42000: You 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 = TEMPTABLE VIEW v1
-as SELECT * from tb2' at line 1
-CREATE or REPLACE ALGORITHM = GARBAGE VIEW v1
-as SELECT * from tb2;
-ERROR 42000: You 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 VIEW v1
-as SELECT * from tb2' at line 1
-Drop view if exists v1 ;
-CREATE or REPLACE VIEW v1
-AS SELECT * from tb2 where f59 < 1;
-CREATE or REPLACE VIEW v1
-AS SELECT * from tb2 where f59 < 1 WITH CHECK OPTION;
-CREATE or REPLACE VIEW v1
-AS SELECT * from tb2 where f59 < 1 WITH CASCADED CHECK OPTION;
-CREATE or REPLACE VIEW v1
-AS SELECT * from tb2 where f59 < 1 WITH LOCAL CHECK OPTION;
-CREATE or REPLACE VIEW v1
-AS SELECT * from tb2 where f59 < 1 WITH NO CHECK OPTION;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NO CHECK OPTION' at line 2
-CREATE or REPLACE VIEW v1
-AS SELECT * from tb2 where f59 < 1 CASCADED CHECK OPTION;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CASCADED CHECK OPTION' at line 2
-CREATE or REPLACE VIEW v1
-AS SELECT * from tb2 where f59 < 1 WITH CASCADED OPTION;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION' at line 2
-CREATE or REPLACE VIEW v1
-AS SELECT * from tb2 where f59 < 1 WITH CASCADED CHECK ;
-ERROR 42000: You 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 2
-
-Testcase 3.3.1.7
---------------------------------------------------------------------------------
-DROP VIEW IF EXISTS v1 ;
-Create view test.v1 AS Select * from test.tb2;
-Alter view test.v1 AS Select F59 from test. tb2 limit 100 ;
-Drop view test.v1 ;
-Create view v1 AS Select * from test.tb2 limit 100 ;
-Alter view v1 AS Select F59 from test.tb2 limit 100 ;
-Drop view v1 ;
-
-Testcase 3.3.1.A0
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1 ;
-DROP VIEW IF EXISTS v1 ;
-DROP VIEW IF EXISTS V1 ;
-CREATE TABLE t1 (f1 NUMERIC(4)) ENGINE = ndb;
-INSERT INTO t1 VALUES(1111), (2222);
-CREATE VIEW v1 AS SELECT * FROM t1 WHERE f1 = 1111;
-CREATE VIEW V1 AS SELECT * FROM t1 WHERE f1 = 2222;
-SELECT * FROM v1;
-f1
-1111
-DROP TABLE IF EXISTS t1 ;
-DROP VIEW IF EXISTS v1 ;
-DROP VIEW IF EXISTS V1 ;
-
-Testcase 3.3.1.8
---------------------------------------------------------------------------------
-Create view select AS Select * from test.tb2 limit 100;
-ERROR 42000: You 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 AS Select * from test.tb2 limit 100' at line 1
-Create view as AS Select * from test.tb2 limit 100;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as AS Select * from test.tb2 limit 100' at line 1
-Create view where AS Select * from test.tb2 limit 100;
-ERROR 42000: You 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 AS Select * from test.tb2 limit 100' at line 1
-Create view from AS Select * from test.tb2 limit 100;
-ERROR 42000: You 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 AS Select * from test.tb2 limit 100' at line 1
-Create view while AS Select * from test.tb2 limit 100;
-ERROR 42000: You 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 AS Select * from test.tb2 limit 100' at line 1
-Create view asdkj*(&*&&^ as Select * from test.tb2 limit 100 ;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*(&*&&^ as Select * from test.tb2 limit 100' at line 1
-Drop view if exists test.procedure ;
-Create view test.procedure as Select * from test.tb2 limit 100 ;
-Drop view if exists test.procedure ;
-
-Testcase 3.3.1.9
---------------------------------------------------------------------------------
-Drop TABLE IF EXISTS t1 ;
-Drop VIEW IF EXISTS v1;
-Drop VIEW IF EXISTS v2;
-Drop VIEW IF EXISTS v3;
-CREATE TABLE t1 ( f1 char(5));
-INSERT INTO t1 SET f1 = 'abcde';
-CREATE VIEW v1 AS SELECT f1 FROM t1;
-CREATE VIEW v2 AS SELECT * FROM v1;
-DROP TABLE t1;
-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
-DELETE 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
-UPDATE v1 SET f1 = 'aaaaa';
-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
-INSERT INTO v1 SET f1 = "fffff";
-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
-SELECT * FROM v2;
-ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-DELETE FROM v2;
-ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-UPDATE v2 SET f1 = 'aaaaa';
-ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-INSERT INTO v2 SET f1 = "fffff";
-ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-DROP VIEW v1;
-SELECT * FROM v2;
-ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-DELETE FROM v2;
-ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-UPDATE v2 SET f1 = 'aaaaa';
-ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-INSERT INTO v2 SET f1 = "fffff";
-ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-DROP VIEW v2;
-DROP TABLE IF EXISTS t1 ;
-DROP VIEW IF EXISTS v1 ;
-CREATE TABLE t1 (f1 FLOAT);
-CREATE VIEW v1 AS SELECT * FROM v1;
-ERROR 42S02: Table 'test.v1' doesn't exist
-CREATE VIEW v1 AS SELECT * FROM t1;
-CREATE or REPLACE VIEW v1 AS SELECT * FROM v1;
-ERROR 42S02: Table 'test.v1' doesn't exist
-DROP VIEW v1;
-DROP TABLE t1;
-
-Testcase 3.3.1.10
---------------------------------------------------------------------------------
-Drop view if exists test.v1 ;
-Create view test.v1 AS Select * from test.tb2 ;
-Create view test.v1 AS Select F59 from test.tb2 ;
-ERROR 42S01: Table 'v1' already exists
-Create view v1 AS Select F59 from test.tb2 ;
-ERROR 42S01: Table 'v1' already exists
-
-Testcase 3.3.1.11
---------------------------------------------------------------------------------
-Create view test.tb2 AS Select f59,f60 from test.tb2 limit 100 ;
-ERROR 42S01: Table 'tb2' already exists
-Create view tb2 AS Select f59,f60 from test.tb2 limit 100 ;
-ERROR 42S01: Table 'tb2' already exists
-Drop view if exists test.v111 ;
-Create view test.v111 as select * from tb2 limit 50;
-Create table test.v111(f1 int );
-ERROR 42S01: Table 'v111' already exists
-Create table v111(f1 int );
-ERROR 42S01: Table 'v111' already exists
-DROP VIEW test.v111;
-
-Testcase 3.3.1.12
---------------------------------------------------------------------------------
-USE test;
-Drop database if exists test2 ;
-Create database test2 ;
-DROP TABLE IF EXISTS test.t0, test.t1, test.t2;
-DROP VIEW IF EXISTS test.v1;
-DROP VIEW IF EXISTS test.v2;
-CREATE TABLE test.t1 ( f1 VARCHAR(20));
-CREATE TABLE test2.t1 ( f1 VARCHAR(20));
-CREATE TABLE test.t2 ( f1 VARCHAR(20));
-CREATE TABLE test2.v1 ( f1 VARCHAR(20));
-CREATE TABLE test.t0 ( f1 VARCHAR(20));
-CREATE TABLE test2.t0 ( f1 VARCHAR(20));
-CREATE VIEW test2.t2 AS SELECT * FROM test2.t0;
-CREATE VIEW test.v1 AS SELECT * FROM test.t0;
-CREATE VIEW test.v2 AS SELECT * FROM test.t0;
-CREATE VIEW test2.v2 AS SELECT * FROM test2.t0;
-INSERT INTO test.t1 VALUES('test.t1 - 1');
-INSERT INTO test2.t1 VALUES('test2.t1 - 1');
-INSERT INTO test.t2 VALUES('test.t2 - 1');
-INSERT INTO test2.v1 VALUES('test2.v1 - 1');
-INSERT INTO test.t0 VALUES('test.t0 - 1');
-INSERT INTO test2.t0 VALUES('test2.t0 - 1');
-USE test;
-INSERT INTO t1 VALUES('test.t1 - 2');
-INSERT INTO t2 VALUES('test.t2 - 2');
-INSERT INTO t0 VALUES('test.t0 - 2');
-USE test2;
-INSERT INTO t1 VALUES('test2.t1 - 2');
-INSERT INTO v1 VALUES('test2.v1 - 2');
-INSERT INTO t0 VALUES('test2.t0 - 2');
-SELECT * FROM t1;
-f1
-test2.t1 - 1
-test2.t1 - 2
-SELECT * FROM t2;
-f1
-test2.t0 - 1
-test2.t0 - 2
-SELECT * FROM v1;
-f1
-test2.v1 - 1
-test2.v1 - 2
-SELECT * FROM v2;
-f1
-test2.t0 - 1
-test2.t0 - 2
-USE test;
-SELECT * FROM t1;
-f1
-test.t1 - 1
-test.t1 - 2
-SELECT * FROM t2;
-f1
-test.t2 - 1
-test.t2 - 2
-SELECT * FROM v1;
-f1
-test.t0 - 1
-test.t0 - 2
-SELECT * FROM v2;
-f1
-test.t0 - 1
-test.t0 - 2
-
-Testcase 3.3.1.13
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1;
-DROP VIEW IF EXISTS v1;
-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 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 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 order by f59 limit 2;
-SHOW CREATE VIEW 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 1
-f60 1
-f61 0000000001
-f62 0000000000000000000000000000000000000000000000000000000000000001
-f63 0000000001
-f64 0000000000000000000000000000000000000000000000000000000000000001
-f65 -5
-f66 0.000000000000000000000000000000
-f67 1
-f68 0.000000000000000000000000000000
-f69 0000000001
-f70 000000000000000000000000000000000.000000000000000000000000000000
-f71 0000000001
-f72 000000000000000000000000000000000.000000000000000000000000000000
-f73 -1.17549435e-38
-f74 1.175494352e-38
-f75 00000001.175494352e-38
-f76 00000001.175494352e-38
-f77 -1.17549435e-38
-f78 1.175494352e-38
-f79 00000001.175494352e-38
-f80 00000001.175494352e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.17549435e-38
-f95 1.17549e-38
-f96 1.175494352e-38
-f97 01.17549e-38
-f98 00000001.175494352e-38
-f99 01.17549e-38
-f100 00000001.175494352e-38
-f101 1000-01-01
-f102 838:59:58
-f103 1970-01-02 00:00:01
-f104 1970-01-02 00:00:01
-f105 1902
-f106 1902
-f107 1902
-f108 2enum
-f109 2set
-f59 2
-f60 2
-f61 0000000002
-f62 0000000000000000000000000000000000000000000000000000000000000002
-f63 0000000002
-f64 0000000000000000000000000000000000000000000000000000000000000002
-f65 -4
-f66 1.100000000000000000000000000000
-f67 2
-f68 1.100000000000000000000000000000
-f69 0000000002
-f70 000000000000000000000000000000001.100000000000000000000000000000
-f71 0000000002
-f72 000000000000000000000000000000001.100000000000000000000000000000
-f73 -1.175494349e-38
-f74 1.175494353e-38
-f75 00000001.175494353e-38
-f76 00000001.175494353e-38
-f77 -1.175494349e-38
-f78 1.175494353e-38
-f79 00000001.175494353e-38
-f80 00000001.175494353e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494349e-38
-f95 1.17549e-38
-f96 1.175494353e-38
-f97 01.17549e-38
-f98 00000001.175494353e-38
-f99 01.17549e-38
-f100 00000001.175494353e-38
-f101 1000-01-02
-f102 838:59:57
-f103 1970-01-03 00:00:02
-f104 1970-01-03 00:00:02
-f105 1903
-f106 1903
-f107 1903
-f108 1enum
-f109 1set,2set
-CREATE OR REPLACE VIEW test.v1 AS SELECT F59 FROM tb2;
-SHOW CREATE VIEW 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` latin1 latin1_swedish_ci
-SELECT * FROM test.v1 order by F59 limit 10,100;
-F59
-10
-15
-17
-19
-22
-24
-27
-29
-34
-94
-107
-107
-109
-109
-195
-207
-209
-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 ;
-
-Testcase 3.3.1.14
---------------------------------------------------------------------------------
-CREATE OR REPLACE VIEW test.tb2 AS SELECT * From tb2 LIMIT 2;
-ERROR HY000: 'test.tb2' is not VIEW
-CREATE OR REPLACE VIEW tb2 AS SELECT * From tb2 LIMIT 2;
-ERROR HY000: 'test.tb2' is not VIEW
-
-Testcase 3.3.1.15
---------------------------------------------------------------------------------
-Drop table if exists test.v1 ;
-CREATE OR REPLACE view test.v1 as select * from tb2;
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-Drop view test.v1 ;
-
-Testcase 3.3.1.16 + 3.3.1.17
---------------------------------------------------------------------------------
-Drop table if exists test.v1 ;
-CREATE OR REPLACE VIEW v1 AS SELECT * From tb2;
-SELECT * FROM tb2 WHERE 1 = 2;
-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 v1 WHERE 1 = 2;
-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 v1;
-DROP TABLE IF EXISTS t1;
-DROP VIEW IF EXISTS v1;
-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 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 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 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 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 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
-
-Testcase 3.3.1.18
---------------------------------------------------------------------------------
-Drop view if exists v1 ;
-Drop view if exists v1_1 ;
-Create view v1
-as Select test.tb2.f59 as NewNameF1, test.tb2.f60
-from test.tb2 limit 0,100 ;
-Create view v1_1
-as Select test.tb2.f59 as NewNameF1, test.tb2.f60 as NewNameF2
-from tb2 limit 0,100 ;
-SELECT NewNameF1,f60 FROM test.v1_1 ;
-ERROR 42S22: Unknown column 'f60' in 'field list'
-SELECT NewNameF1, v1_1.f60 FROM test.v1_1 ;
-ERROR 42S22: Unknown column 'v1_1.f60' in 'field list'
-SELECT f59, f60 FROM test.v1 ;
-ERROR 42S22: Unknown column 'f59' in 'field list'
-Use test ;
-SELECT F59 FROM v1 ;
-ERROR 42S22: Unknown column 'F59' in 'field list'
-
-Testcase 3.3.1.19
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1, t2;
-DROP VIEW IF EXISTS v1;
-CREATE TABLE t1( f1 BIGINT, f2 DECIMAL(5,2));
-INSERT INTO t1 VALUES(7, 7.7);
-CREATE TABLE t2( f1 BIGINT, f2 DECIMAL(5,2));
-INSERT INTO t2 VALUES(6, 6.6);
-CREATE VIEW v1 AS SELECT * FROM t1;
-SELECT * FROM v1;
-f1 f2
-7 7.70
-CREATE OR REPLACE VIEW v1 AS SELECT f1, f2 FROM t1;
-SELECT * FROM v1;
-f1 f2
-7 7.70
-CREATE OR REPLACE VIEW v1 AS SELECT f1 AS my_f1, f2 AS my_f2 FROM t1;
-SELECT * FROM v1;
-my_f1 my_f2
-7 7.70
-CREATE OR REPLACE VIEW v1 (my_f1, my_f2) AS SELECT f1, f2 FROM t1;
-SELECT * FROM v1;
-my_f1 my_f2
-7 7.70
-CREATE OR REPLACE VIEW v1 (my_f1, my_f2) AS SELECT t1.f1, t2.f2 FROM t1, t2;
-SELECT * FROM v1;
-my_f1 my_f2
-7 6.60
-SELECT f1, f2 AS f1 FROM t1;
-f1 f1
-7 7.70
-CREATE OR REPLACE VIEW v1 AS SELECT f1, f2 AS f1 FROM t1;
-ERROR 42S21: Duplicate column name 'f1'
-SELECT t1.f1, t2.f1 AS f1 FROM t1, t2;
-f1 f1
-7 6
-CREATE OR REPLACE VIEW v1 AS SELECT t1.f1, t2.f1 AS f1 FROM t1, t2;
-ERROR 42S21: Duplicate column name 'f1'
-CREATE OR REPLACE VIEW v1 (my_col, my_col) AS SELECT * FROM t1;
-ERROR 42S21: Duplicate column name 'my_col'
-
-Testcase 3.3.1.20
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1( f1 BIGINT, f2 DECIMAL(5,2));
-CREATE OR REPLACE VIEW v1 (my_f1, my_f2) AS SELECT * FROM t1;
-CREATE OR REPLACE VIEW v1 (my_f1, my_f2) AS SELECT f1, f2 FROM t1;
-CREATE OR REPLACE VIEW v1 (my_f1 ) AS SELECT * FROM t1;
-ERROR HY000: View's SELECT and view's field list have different column counts
-CREATE OR REPLACE VIEW v1 (my_f1 ) AS SELECT f1, f2 FROM t1;
-ERROR HY000: View's SELECT and view's field list have different column counts
-CREATE OR REPLACE VIEW v1 (my_f1, my_f2, my_f3) AS SELECT * FROM t1;
-ERROR HY000: View's SELECT and view's field list have different column counts
-CREATE OR REPLACE VIEW v1 (my_f1, my_f2, my_f3) AS SELECT f1, f2 FROM t1;
-ERROR HY000: View's SELECT and view's field list have different column counts
-
-Testcase 3.3.1.21
---------------------------------------------------------------------------------
-DROP VIEW IF EXISTS v1;
-CREATE VIEW test.v1( F59, F60 ) AS SELECT F59, F60 From tb2;
-SELECT * FROM test.v1 order by F59, F60 desc LIMIT 2;
-F59 F60
-1 1
-2 2
-Drop view if exists test.v1 ;
-
-Testcase 3.3.1.22
---------------------------------------------------------------------------------
-DROP VIEW IF EXISTS v1;
-CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2 WHERE f59 < 3;
-SELECT * FROM test.v1;
-product
-1
-4
-CREATE OR REPLACE VIEW test.v1( product ) AS SELECT 1*2;
-SELECT * FROM test.v1;
-product
-2
-CREATE OR REPLACE VIEW test.v1( product ) AS SELECT USER();
-SELECT * FROM test.v1;
-product
-root@localhost
-Drop view if exists test.v1 ;
-
-Testcase 3.3.1.23 + 3.3.1.24
---------------------------------------------------------------------------------
-USE test;
-DROP TABLE IF EXISTS t1;
-DROP VIEW IF EXISTS v1;
-DROP VIEW IF EXISTS v2;
-CREATE VIEW test.v2 AS SELECT * FROM test.t1;
-ERROR 42S02: Table 'test.t1' doesn't exist
-CREATE VIEW v2 AS Select * from test.v1;
-ERROR 42S02: Table 'test.v1' doesn't exist
-DROP VIEW IF EXISTS v2;
-Warnings:
-Note 1051 Unknown table 'test.v2'
-
-Testcase 3.3.1.25
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1_temp;
-DROP TABLE IF EXISTS t2_temp;
-DROP VIEW IF EXISTS v1;
-Create table t1_temp(f59 char(10),f60 int) ;
-Create temporary table t1_temp(f59 char(10),f60 int) ;
-Insert into t1_temp values('FER',90);
-Insert into t1_temp values('CAR',27);
-Create view v1 as select * from t1_temp ;
-ERROR HY000: View's SELECT refers to a temporary table 't1_temp'
-Create temporary table t2_temp(f59 char(10),f60 int) ;
-Insert into t2_temp values('AAA',11);
-Insert into t2_temp values('BBB',22);
-Create or replace view v1
-as select t1_temp.f59,t2_temp.f59 from t1_temp,t2_temp ;
-ERROR HY000: View's SELECT refers to a temporary table 't1_temp'
-DROP temporary table t1_temp;
-DROP table t1_temp;
-DROP temporary table t2_temp;
-DROP TABLE IF EXISTS t1;
-DROP VIEW IF EXISTS v1;
-CREATE TABLE t1 (f1 char(10));
-CREATE TEMPORARY TABLE t2 (f2 char(10));
-INSERT INTO t1 VALUES('t1');
-INSERT INTO t1 VALUES('A');
-INSERT INTO t2 VALUES('t2');
-INSERT INTO t2 VALUES('B');
-CREATE OR REPLACE VIEW v1 AS SELECT f2 FROM t2;
-ERROR HY000: View's SELECT refers to a temporary table 't2'
-CREATE OR REPLACE VIEW v1 AS SELECT * FROM t2, t1;
-ERROR HY000: View's SELECT refers to a temporary table 't2'
-CREATE OR REPLACE VIEW v1 AS SELECT f2, f1 FROM t2, t1;
-ERROR HY000: View's SELECT refers to a temporary table 't2'
-CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1, t2;
-ERROR HY000: View's SELECT refers to a temporary table 't2'
-CREATE OR REPLACE VIEW v1 AS SELECT f1, f2 FROM t1, t2;
-ERROR HY000: View's SELECT refers to a temporary table 't2'
-CREATE OR REPLACE VIEW v1 AS SELECT * FROM t2 UNION SELECT * FROM t1;
-ERROR HY000: View's SELECT refers to a temporary table 't2'
-CREATE OR REPLACE VIEW v1 AS SELECT f2 FROM t2 UNION SELECT f1 FROM t1;
-ERROR HY000: View's SELECT refers to a temporary table 't2'
-CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1 UNION SELECT * FROM t2;
-ERROR HY000: View's SELECT refers to a temporary table 't2'
-CREATE OR REPLACE VIEW v1 AS SELECT f1 FROM t1 UNION SELECT f2 FROM t2;
-ERROR HY000: View's SELECT refers to a temporary table 't2'
-CREATE OR REPLACE VIEW v1 AS SELECT 1 FROM t2
-WHERE f2 = ( SELECT f1 FROM t1 );
-ERROR HY000: View's SELECT refers to a temporary table 't2'
-CREATE OR REPLACE VIEW v1 AS SELECT 1 FROM t1
-WHERE f1 = ( SELECT f2 FROM t2 );
-ERROR HY000: View's SELECT refers to a temporary table 't2'
-DROP TABLE t1;
-DROP TEMPORARY TABLE t2;
-
-Testcase 3.3.1.26
---------------------------------------------------------------------------------
-DROP VIEW IF EXISTS v1;
-Create view test.v1 AS Select * from test.tb2;
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-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
-Drop view test.v1 ;
-
-Testcase 3.3.1.27
---------------------------------------------------------------------------------
-DROP VIEW IF EXISTS test.v1;
-Drop VIEW IF EXISTS test.v1_1 ;
-Create view test.v1 AS Select * from test.tb2;
-Create view test.v1_1 AS Select F59 from test.v1 ;
-Select * from test.v1_1 order by F59 limit 2;
-F59
-1
-2
-Drop view test.v1 ;
-Drop view test.v1_1 ;
-
-Testcase 3.3.1.28
---------------------------------------------------------------------------------
-Drop database if exists test2 ;
-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 order by f59,f60,f61,f62,f63,f64,f65;
-f59 1
-f60 1
-f61 0000000001
-f62 0000000000000000000000000000000000000000000000000000000000000001
-f63 0000000001
-f64 0000000000000000000000000000000000000000000000000000000000000001
-f65 -5
-f66 0.000000000000000000000000000000
-f67 1
-f68 0.000000000000000000000000000000
-f69 0000000001
-f70 000000000000000000000000000000000.000000000000000000000000000000
-f71 0000000001
-f72 000000000000000000000000000000000.000000000000000000000000000000
-f73 -1.17549435e-38
-f74 1.175494352e-38
-f75 00000001.175494352e-38
-f76 00000001.175494352e-38
-f77 -1.17549435e-38
-f78 1.175494352e-38
-f79 00000001.175494352e-38
-f80 00000001.175494352e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.17549435e-38
-f95 1.17549e-38
-f96 1.175494352e-38
-f97 01.17549e-38
-f98 00000001.175494352e-38
-f99 01.17549e-38
-f100 00000001.175494352e-38
-f101 1000-01-01
-f102 838:59:58
-f103 1970-01-02 00:00:01
-f104 1970-01-02 00:00:01
-f105 1902
-f106 1902
-f107 1902
-f108 2enum
-f109 2set
-f59 2
-f60 2
-f61 0000000002
-f62 0000000000000000000000000000000000000000000000000000000000000002
-f63 0000000002
-f64 0000000000000000000000000000000000000000000000000000000000000002
-f65 -4
-f66 1.100000000000000000000000000000
-f67 2
-f68 1.100000000000000000000000000000
-f69 0000000002
-f70 000000000000000000000000000000001.100000000000000000000000000000
-f71 0000000002
-f72 000000000000000000000000000000001.100000000000000000000000000000
-f73 -1.175494349e-38
-f74 1.175494353e-38
-f75 00000001.175494353e-38
-f76 00000001.175494353e-38
-f77 -1.175494349e-38
-f78 1.175494353e-38
-f79 00000001.175494353e-38
-f80 00000001.175494353e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494349e-38
-f95 1.17549e-38
-f96 1.175494353e-38
-f97 01.17549e-38
-f98 00000001.175494353e-38
-f99 01.17549e-38
-f100 00000001.175494353e-38
-f101 1000-01-02
-f102 838:59:57
-f103 1970-01-03 00:00:02
-f104 1970-01-03 00:00:02
-f105 1903
-f106 1903
-f107 1903
-f108 1enum
-f109 1set,2set
-f59 3
-f60 3
-f61 0000000003
-f62 0000000000000000000000000000000000000000000000000000000000000003
-f63 0000000003
-f64 0000000000000000000000000000000000000000000000000000000000000003
-f65 -3
-f66 2.200000000000000000000000000000
-f67 3
-f68 2.200000000000000000000000000000
-f69 0000000003
-f70 000000000000000000000000000000002.200000000000000000000000000000
-f71 0000000003
-f72 000000000000000000000000000000002.200000000000000000000000000000
-f73 -1.175494348e-38
-f74 1.175494354e-38
-f75 00000001.175494354e-38
-f76 00000001.175494354e-38
-f77 -1.175494348e-38
-f78 1.175494354e-38
-f79 00000001.175494354e-38
-f80 00000001.175494354e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494348e-38
-f95 1.17549e-38
-f96 1.175494354e-38
-f97 01.17549e-38
-f98 00000001.175494354e-38
-f99 01.17549e-38
-f100 00000001.175494354e-38
-f101 1000-01-03
-f102 838:59:56
-f103 1970-01-04 00:00:03
-f104 1970-01-04 00:00:03
-f105 1904
-f106 1904
-f107 1904
-f108 2enum
-f109 1set
-f59 4
-f60 4
-f61 0000000004
-f62 0000000000000000000000000000000000000000000000000000000000000004
-f63 0000000004
-f64 0000000000000000000000000000000000000000000000000000000000000004
-f65 -2
-f66 3.300000000000000000000000000000
-f67 4
-f68 3.300000000000000000000000000000
-f69 0000000004
-f70 000000000000000000000000000000003.300000000000000000000000000000
-f71 0000000004
-f72 000000000000000000000000000000003.300000000000000000000000000000
-f73 -1.175494347e-38
-f74 1.175494355e-38
-f75 00000001.175494355e-38
-f76 00000001.175494355e-38
-f77 -1.175494347e-38
-f78 1.175494355e-38
-f79 00000001.175494355e-38
-f80 00000001.175494355e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494347e-38
-f95 1.17549e-38
-f96 1.175494355e-38
-f97 01.17549e-38
-f98 00000001.175494355e-38
-f99 01.17549e-38
-f100 00000001.175494355e-38
-f101 1000-01-04
-f102 838:59:55
-f103 1970-01-05 00:00:04
-f104 1970-01-05 00:00:04
-f105 1905
-f106 1905
-f107 1905
-f108 1enum
-f109 2set
-f59 4
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 5
-f60 5
-f61 0000000005
-f62 0000000000000000000000000000000000000000000000000000000000000005
-f63 0000000005
-f64 0000000000000000000000000000000000000000000000000000000000000005
-f65 -1
-f66 4.400000000000000000000000000000
-f67 5
-f68 4.400000000000000000000000000000
-f69 0000000005
-f70 000000000000000000000000000000004.400000000000000000000000000000
-f71 0000000005
-f72 000000000000000000000000000000004.400000000000000000000000000000
-f73 -1.175494346e-38
-f74 1.175494356e-38
-f75 00000001.175494356e-38
-f76 00000001.175494356e-38
-f77 -1.175494346e-38
-f78 1.175494356e-38
-f79 00000001.175494356e-38
-f80 00000001.175494356e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494346e-38
-f95 1.17549e-38
-f96 1.175494356e-38
-f97 01.17549e-38
-f98 00000001.175494356e-38
-f99 01.17549e-38
-f100 00000001.175494356e-38
-f101 1000-01-05
-f102 838:59:54
-f103 1970-01-06 00:00:05
-f104 1970-01-06 00:00:05
-f105 1906
-f106 1906
-f107 1906
-f108 2enum
-f109 1set,2set
-f59 6
-f60 6
-f61 0000000006
-f62 0000000000000000000000000000000000000000000000000000000000000006
-f63 0000000006
-f64 0000000000000000000000000000000000000000000000000000000000000006
-f65 0
-f66 5.500000000000000000000000000000
-f67 6
-f68 5.500000000000000000000000000000
-f69 0000000006
-f70 000000000000000000000000000000005.500000000000000000000000000000
-f71 0000000006
-f72 000000000000000000000000000000005.500000000000000000000000000000
-f73 -1.175494345e-38
-f74 1.175494357e-38
-f75 00000001.175494357e-38
-f76 00000001.175494357e-38
-f77 -1.175494345e-38
-f78 1.175494357e-38
-f79 00000001.175494357e-38
-f80 00000001.175494357e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494345e-38
-f95 1.17549e-38
-f96 1.175494357e-38
-f97 01.17549e-38
-f98 00000001.175494357e-38
-f99 01.17549e-38
-f100 00000001.175494357e-38
-f101 1000-01-06
-f102 838:59:53
-f103 1970-01-07 00:00:06
-f104 1970-01-07 00:00:06
-f105 1907
-f106 1907
-f107 1907
-f108 1enum
-f109 1set
-f59 7
-f60 7
-f61 0000000007
-f62 0000000000000000000000000000000000000000000000000000000000000007
-f63 0000000007
-f64 0000000000000000000000000000000000000000000000000000000000000007
-f65 1
-f66 6.600000000000000000000000000000
-f67 7
-f68 6.600000000000000000000000000000
-f69 0000000007
-f70 000000000000000000000000000000006.600000000000000000000000000000
-f71 0000000007
-f72 000000000000000000000000000000006.600000000000000000000000000000
-f73 -1.175494344e-38
-f74 1.175494358e-38
-f75 00000001.175494358e-38
-f76 00000001.175494358e-38
-f77 -1.175494344e-38
-f78 1.175494358e-38
-f79 00000001.175494358e-38
-f80 00000001.175494358e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494344e-38
-f95 1.17549e-38
-f96 1.175494358e-38
-f97 01.17549e-38
-f98 00000001.175494358e-38
-f99 01.17549e-38
-f100 00000001.175494358e-38
-f101 1000-01-07
-f102 838:59:52
-f103 1970-01-08 00:00:07
-f104 1970-01-08 00:00:07
-f105 1908
-f106 1908
-f107 1908
-f108 2enum
-f109 2set
-f59 8
-f60 8
-f61 0000000008
-f62 0000000000000000000000000000000000000000000000000000000000000008
-f63 0000000008
-f64 0000000000000000000000000000000000000000000000000000000000000008
-f65 2
-f66 7.700000000000000000000000000000
-f67 8
-f68 7.700000000000000000000000000000
-f69 0000000008
-f70 000000000000000000000000000000007.700000000000000000000000000000
-f71 0000000008
-f72 000000000000000000000000000000007.700000000000000000000000000000
-f73 -1.175494343e-38
-f74 1.175494359e-38
-f75 00000001.175494359e-38
-f76 00000001.175494359e-38
-f77 -1.175494343e-38
-f78 1.175494359e-38
-f79 00000001.175494359e-38
-f80 00000001.175494359e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494343e-38
-f95 1.17549e-38
-f96 1.175494359e-38
-f97 01.17549e-38
-f98 00000001.175494359e-38
-f99 01.17549e-38
-f100 00000001.175494359e-38
-f101 1000-01-08
-f102 838:59:51
-f103 1970-01-09 00:00:08
-f104 1970-01-09 00:00:08
-f105 1909
-f106 1909
-f107 1909
-f108 1enum
-f109 1set,2set
-f59 9
-f60 9
-f61 0000000009
-f62 0000000000000000000000000000000000000000000000000000000000000009
-f63 0000000009
-f64 0000000000000000000000000000000000000000000000000000000000000009
-f65 3
-f66 8.800000000000000000000000000000
-f67 9
-f68 8.800000000000000000000000000000
-f69 0000000009
-f70 000000000000000000000000000000008.800000000000000000000000000000
-f71 0000000009
-f72 000000000000000000000000000000008.800000000000000000000000000000
-f73 -1.175494342e-38
-f74 1.17549436e-38
-f75 000000001.17549436e-38
-f76 000000001.17549436e-38
-f77 -1.175494342e-38
-f78 1.17549436e-38
-f79 000000001.17549436e-38
-f80 000000001.17549436e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494342e-38
-f95 1.17549e-38
-f96 1.17549436e-38
-f97 01.17549e-38
-f98 000000001.17549436e-38
-f99 01.17549e-38
-f100 000000001.17549436e-38
-f101 1000-01-09
-f102 838:59:50
-f103 1970-01-10 00:00:09
-f104 1970-01-10 00:00:09
-f105 1910
-f106 1910
-f107 1910
-f108 2enum
-f109 1set
-f59 10
-f60 10
-f61 0000000010
-f62 0000000000000000000000000000000000000000000000000000000000000010
-f63 0000000010
-f64 0000000000000000000000000000000000000000000000000000000000000010
-f65 4
-f66 9.900000000000000000000000000000
-f67 10
-f68 9.900000000000000000000000000000
-f69 0000000010
-f70 000000000000000000000000000000009.900000000000000000000000000000
-f71 0000000010
-f72 000000000000000000000000000000009.900000000000000000000000000000
-f73 -1.175494341e-38
-f74 1.175494361e-38
-f75 00000001.175494361e-38
-f76 00000001.175494361e-38
-f77 -1.175494341e-38
-f78 1.175494361e-38
-f79 00000001.175494361e-38
-f80 00000001.175494361e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494341e-38
-f95 1.17549e-38
-f96 1.175494361e-38
-f97 01.17549e-38
-f98 00000001.175494361e-38
-f99 01.17549e-38
-f100 00000001.175494361e-38
-f101 1000-01-10
-f102 838:59:49
-f103 1970-01-11 00:00:10
-f104 1970-01-11 00:00:10
-f105 1911
-f106 1911
-f107 1911
-f108 1enum
-f109 2set
-f59 15
-f60 87
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 17
-f60 15
-f61 0000000016
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 19
-f60 18
-f61 0000000014
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 22
-f60 93
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 24
-f60 51654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 27
-f60 25
-f61 0000000026
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 29
-f60 28
-f61 0000000024
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 34
-f60 41
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 94
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 107
-f60 105
-f61 0000000106
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 107
-f60 105
-f61 0000000106
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 109
-f60 108
-f61 0000000104
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 109
-f60 108
-f61 0000000104
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 195
-f60 87
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 207
-f60 205
-f61 0000000206
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 209
-f60 208
-f61 0000000204
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 242
-f60 79
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 250
-f60 87895654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 292
-f60 93
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 299
-f60 899
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 321
-f60 NULL
-f61 0000000765
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 323
-f60 14376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 340
-f60 9984376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 394
-f60 41
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 424
-f60 89
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 441
-f60 16546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 500
-f60 NULL
-f61 0000000900
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 500
-f60 NULL
-f61 0000000900
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 500
-f60 NULL
-f61 0000000900
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 660
-f60 876546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 987
-f60 41
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 2550
-f60 775654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 2760
-f60 985654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 3330
-f60 764376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 3410
-f60 996546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 7876
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 9112
-f60 NULL
-f61 0000008771
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 76710
-f60 226546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 569300
-f60 9114376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 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 ;
-Drop view if exists test2.v2 ;
-Drop database test2 ;
-
-Testcase 3.3.1.29
---------------------------------------------------------------------------------
-Drop database if exists test2 ;
-Drop view if exists test.v1 ;
-create database test2 ;
-use test2;
-Create view test.v1 AS Select * from test.tb2 limit 50 ;
-Create view test2.v2 AS Select F59 from test.v1 ;
-Drop view if exists test.v1 ;
-Drop view if exists test2.v2 ;
-
-Testcase 3.3.1.31
---------------------------------------------------------------------------------
-Drop table if exists test.t1 ;
-CREATE TABLE test.t1 ( f59 int, f60 int );
-INSERT INTO test.t1 VALUES( 34, 654 );
-INSERT INTO test.t1 VALUES( 906, 434 );
-INSERT INTO test.t1 VALUES( 445, 765 );
-Create or replace view test.v1
-AS SELECT test.t1.F59, test.tb2.F60
-FROM test.tb2 JOIN test.t1 ON test.tb2.F59 = test.t1.F59 ;
-Select * from test.v1;
-F59 F60
-34 41
-Drop view test.v1 ;
-
-Testcase 3.3.1.32
---------------------------------------------------------------------------------
-Drop table if exists test.t1 ;
-Drop database if exists test2 ;
-Drop view if exists test.v1 ;
-create database test2 ;
-use test2 ;
-CREATE TABLE t1 ( f59 int, f60 int );
-INSERT INTO t1 VALUES( 34, 654 );
-INSERT INTO t1 VALUES( 906, 434 );
-INSERT INTO t1 VALUES( 445, 765 );
-CREATE VIEW test2.v1
-AS SELECT test.tb2.F59, test.tb2.F60
-FROM test.tb2 INNER JOIN test2.t1 ON tb2.f59 = t1.f59;
-Select * from test2.v1;
-F59 F60
-34 41
-Use test;
-
-Testcase 3.3.1.33
---------------------------------------------------------------------------------
-Drop view if exists test.v1_firstview ;
-Drop view if exists test.v1_secondview ;
-Drop view if exists test.v1 ;
-CREATE VIEW test.v1_firstview AS SELECT * FROM test.tb2;
-CREATE VIEW test.v1_secondview AS SELECT * FROM test.tb2;
-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 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
-Drop view if exists test.v1_firstview ;
-Drop view if exists test.v1_secondview ;
-Drop view if exists test.v1 ;
-
-Testcase 3.3.1.34
---------------------------------------------------------------------------------
-Drop database if exists test2 ;
-Drop view if exists test.v1_firstview ;
-Drop view if exists test.v1_secondview ;
-create database test2 ;
-use test2 ;
-CREATE VIEW test.v1_firstview AS SELECT * FROM test.tb2 ;
-CREATE VIEW test.v1_secondview AS SELECT * FROM test.tb2 ;
-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 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
-Drop view v1 ;
-Drop view test.v1_firstview ;
-Drop view test.v1_secondview ;
-
-Testcase 3.3.1.35
---------------------------------------------------------------------------------
-use test;
-Drop view if exists test.v1;
-Drop view if exists test.v1_firstview;
-CREATE VIEW test.v1_firstview AS SELECT * FROM test.tb2;
-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 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
-Drop view test.v1 ;
-Drop view test.v1_firstview;
-
-Testcase 3.3.1.36
---------------------------------------------------------------------------------
-Drop database if exists test2 ;
-create database test2 ;
-use test2 ;
-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 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
-Drop database test2 ;
-
-Testcase 3.3.1.37
---------------------------------------------------------------------------------
-use test;
-Drop table if exists t1;
-Drop view if exists test.v1 ;
-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 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
-Create table t1(f59 int, f60 int);
-Insert into t1 values (90,507) ;
-Create view v1_1 as Select f59,f60 from t1 ;
-Select * from v1_1 ;
-f59 f60
-90 507
-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 order by f59 limit 0,10;
-f59
-1
-2
-3
-4
-4
-4
-4
-5
-6
-7
-Drop table t1;
-Drop view test.v1 ;
-Drop view test.v1_1 ;
-Drop view test.v1_main ;
-
-Testcase 3.3.1.31 - 3.3.1.37 New Implementation
---------------------------------------------------------------------------------
-USE test;
-DROP DATABASE IF EXISTS test2;
-DROP TABLE IF EXISTS t0,t1;
-DROP VIEW IF EXISTS t3,t4;
-CREATE DATABASE test2;
-CREATE TABLE test1.t0 (f1 VARCHAR(20));
-CREATE TABLE test1.t1 (f1 VARCHAR(20));
-CREATE TABLE test2.t0 (f1 VARCHAR(20));
-CREATE TABLE test2.t1 (f1 VARCHAR(20));
-CREATE VIEW test1.t2 AS SELECT * FROM test1.t0;
-CREATE VIEW test1.t3 AS SELECT * FROM test2.t0;
-CREATE VIEW test2.t2 AS SELECT * FROM test2.t0;
-CREATE VIEW test2.t3 AS SELECT * FROM test1.t0;
-INSERT INTO test1.t0 VALUES('test1.t0');
-INSERT INTO test1.t1 VALUES('test1.t1');
-INSERT INTO test2.t0 VALUES('test2.t0');
-INSERT INTO test2.t1 VALUES('test2.t1');
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t3 ta, test2.t3 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t0 test1.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t3 ta, test1.t3 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t0 test2.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t3 ta, test2.t3 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t0 test1.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t3 ta, test1.t3 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t0 test2.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t3 ta, test2.t2 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t0 test2.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t3 ta, test1.t2 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t0 test1.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t3 ta, test2.t2 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t0 test2.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t3 ta, test1.t2 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t0 test1.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t3 ta, test2.t1 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t0 test2.t1
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t3 ta, test1.t1 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t0 test1.t1
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t3 ta, test2.t1 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t0 test2.t1
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t3 ta, test1.t1 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t0 test1.t1
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t2 ta, test2.t3 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t0 test1.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t2 ta, test1.t3 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t0 test2.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t2 ta, test2.t3 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t0 test1.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t2 ta, test1.t3 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t0 test2.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t2 ta, test2.t2 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t0 test2.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t2 ta, test1.t2 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t0 test1.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t2 ta, test2.t2 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t0 test2.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t2 ta, test1.t2 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t0 test1.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t2 ta, test2.t1 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t0 test2.t1
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t2 ta, test1.t1 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t0 test1.t1
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t2 ta, test2.t1 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t0 test2.t1
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t2 ta, test1.t1 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t0 test1.t1
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t1 ta, test2.t3 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t1 test1.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t1 ta, test1.t3 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t1 test2.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t1 ta, test2.t3 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t1 test1.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t1 ta, test1.t3 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t1 test2.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t1 ta, test2.t2 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t1 test2.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t1 ta, test1.t2 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t1 test1.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t1 ta, test2.t2 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t1 test2.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t1 ta, test1.t2 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t1 test1.t0
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t1 ta, test2.t1 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t1 test2.t1
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test2.t1 ta, test1.t1 tb;
-SELECT * FROM test.v1;
-col1 col2
-test2.t1 test1.t1
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t1 ta, test2.t1 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t1 test2.t1
-CREATE OR REPLACE VIEW test.v1 AS
-SELECT ta.f1 AS col1,
-tb.f1 AS col2
-FROM test1.t1 ta, test1.t1 tb;
-SELECT * FROM test.v1;
-col1 col2
-test1.t1 test1.t1
-
-Testcase 3.3.1.38
---------------------------------------------------------------------------------
-Drop table if exists test1.t1 ;
-Drop view if exists test.v1 ;
-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;
-Select * from test.v1 order by f59,f60 limit 20;
-f59 f60
-1 1
-2 2
-3 3
-4 4
-4 74
-5 5
-6 6
-7 7
-8 8
-9 9
-10 10
-15 87
-17 15
-19 18
-22 93
-24 51654
-27 25
-29 28
-34 41
-94 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 ;
-Select * from test1.v1_1 ;
-f59 f60
-199 507
-Create database test3 ;
-Create table test3.t1(f59 int,f60 int) ;
-Insert into test3.t1 values (1023,7670) ;
-Create view test3.v1_2 as Select f59,f60 from test3.t1 ;
-Select * from test3.v1_2 ;
-f59 f60
-1023 7670
-use test ;
-Create view v1_main
-as SELECT test.tb2.f59 as f1, test1.v1_1.f59 as f2,
-test3.v1_2.f59 as f3
-FROM (test.tb2,test1.v1_1,test.v1) JOIN test3.v1_2
-ON (test.v1.f59 = test1.v1_1.f59) ;
-Select * from v1_main ;
-f1 f2 f3
-DROP VIEW test.v1 ;
-DROP VIEW test1.v1_1 ;
-DROP VIEW test.v1_main ;
-DROP DATABASE test3;
-
-Testcase 3.3.1.39
---------------------------------------------------------------------------------
-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 order by f59 ;
-ERROR 42S02: Table 'test.v1' doesn't exist
-Drop view if exists test.v1 ;
-
-Testcase 3.3.1.40
---------------------------------------------------------------------------------
-Drop view if exists test.v1 ;
-Set @var1 = 'ABC' ;
-Set @var2 = 'XYZ' ;
-CREATE VIEW test.v1 AS SELECT @var1, @var2 ;
-ERROR HY000: View's SELECT contains a variable or parameter
-CREATE VIEW test.v1 AS SELECT @@global.sort_buffer_size;
-ERROR HY000: View's SELECT contains a variable or parameter
-Drop view if exists test.v1 ;
-
-Testcase 3.3.1.41
---------------------------------------------------------------------------------
-Drop view if exists test.v1 ;
-Drop procedure if exists sp1 ;
-Create procedure sp1() DETERMINISTIC
-Begin
-DECLARE x char;
-Set x = 200 ;
-Create view test.v1 as SELECT * FROM tb2 WHERE f59 = x ;
-End //
-ERROR HY000: View's SELECT contains a variable or parameter
-Call sp1() ;
-ERROR 42000: PROCEDURE test.sp1 does not exist
-Drop view if exists test.v1 ;
-Warnings:
-Note 1051 Unknown table 'test.v1'
-Drop procedure sp1 ;
-ERROR 42000: PROCEDURE test.sp1 does not exist
-
-Testcase 3.3.1.42
---------------------------------------------------------------------------------
-Drop VIEW if exists test.v1 ;
-CREATE TEMPORARY VIEW test.v1 AS
-SELECT * FROM test.tb2 limit 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 'VIEW test.v1 AS
-SELECT * FROM test.tb2 limit 2' at line 1
-CREATE OR REPLACE TEMPORARY VIEW test.v1 AS
-SELECT * FROM test.tb2 limit 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 'TEMPORARY VIEW test.v1 AS
-SELECT * FROM test.tb2 limit 2' at line 1
-Drop view if exists test.v1 ;
-Use test;
-
-Testcase 3.3.1.43
---------------------------------------------------------------------------------
-Drop view if exists test.v1 ;
-CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2;
-INSERT INTO test.v1 values(122,432);
-SELECT * FROM test.tb2 where f59 = 122 and f60 = 432 limit 0,20;
-f59 122
-f60 432
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-UPDATE test.v1 SET f59 = 3000 WHERE test.v1.f59 = 122 ;
-SELECT * FROM test.tb2 where f59 = 3000 limit 0,20;
-f59 3000
-f60 432
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-DELETE FROM test.v1
-where test.v1.f59 = 3000 and test.v1.f60 = 432;
-SELECT * FROM test.tb2 where f59 = 3000 and f60 = 432;
-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 test.v1 ;
-
-Testcase 3.3.1.44
---------------------------------------------------------------------------------
-Drop view if exists test.v1 ;
-CREATE VIEW test.v1 AS SELECT f59,f60 FROM test.tb2 limit 100;
-INSERT INTO test.v1 values(31, 32, 33) ;
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-Drop view test.v1 ;
-
-Testcase 3.3.1.45
---------------------------------------------------------------------------------
-Drop view if exists test.v1 ;
-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 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 30
-f60 4
-f61 0000000004
-f62 0000000000000000000000000000000000000000000000000000000000000004
-f63 0000000004
-f64 0000000000000000000000000000000000000000000000000000000000000004
-f65 -2
-f66 3.300000000000000000000000000000
-f67 4
-f68 3.300000000000000000000000000000
-f69 0000000004
-f70 000000000000000000000000000000003.300000000000000000000000000000
-f71 0000000004
-f72 000000000000000000000000000000003.300000000000000000000000000000
-f73 -1.175494347e-38
-f74 1.175494355e-38
-f75 00000001.175494355e-38
-f76 00000001.175494355e-38
-f77 -1.175494347e-38
-f78 1.175494355e-38
-f79 00000001.175494355e-38
-f80 00000001.175494355e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494347e-38
-f95 1.17549e-38
-f96 1.175494355e-38
-f97 01.17549e-38
-f98 00000001.175494355e-38
-f99 01.17549e-38
-f100 00000001.175494355e-38
-f101 1000-01-04
-f102 838:59:55
-f103 1970-01-05 00:00:04
-f104 1970-01-05 00:00:04
-f105 1905
-f106 1905
-f107 1905
-f108 1enum
-f109 2set
-f59 30
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-UPDATE tb2 SET f59 = 100 where f59 = 30 ;
-affected rows: 2
-info: Rows matched: 2 Changed: 2 Warnings: 0
-SELECT * FROM tb2 where f59 = 100 ;
-f59 100
-f60 4
-f61 0000000004
-f62 0000000000000000000000000000000000000000000000000000000000000004
-f63 0000000004
-f64 0000000000000000000000000000000000000000000000000000000000000004
-f65 -2
-f66 3.300000000000000000000000000000
-f67 4
-f68 3.300000000000000000000000000000
-f69 0000000004
-f70 000000000000000000000000000000003.300000000000000000000000000000
-f71 0000000004
-f72 000000000000000000000000000000003.300000000000000000000000000000
-f73 -1.175494347e-38
-f74 1.175494355e-38
-f75 00000001.175494355e-38
-f76 00000001.175494355e-38
-f77 -1.175494347e-38
-f78 1.175494355e-38
-f79 00000001.175494355e-38
-f80 00000001.175494355e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494347e-38
-f95 1.17549e-38
-f96 1.175494355e-38
-f97 01.17549e-38
-f98 00000001.175494355e-38
-f99 01.17549e-38
-f100 00000001.175494355e-38
-f101 1000-01-04
-f102 838:59:55
-f103 1970-01-05 00:00:04
-f104 1970-01-05 00:00:04
-f105 1905
-f106 1905
-f107 1905
-f108 1enum
-f109 2set
-f59 100
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-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 ;
-Drop VIEW IF EXISTS test.v1 ;
-CREATE TABLE t1 (f1 BIGINT, f2 VARCHAR(20), PRIMARY KEY(f1))
-ENGINE = ndb;
-INSERT INTO t1 VALUES(1,'one');
-INSERT INTO t1 VALUES(2,'two');
-INSERT INTO t1 VALUES(3,'three');
-INSERT INTO t1 VALUES(5,'five');
-CREATE VIEW v1 AS SELECT * FROM t1 WHERE f1 BETWEEN 2 AND 4;
-SELECT COUNT(*) FROM v1 WHERE f1 = 2;
-COUNT(*)
-1
-SELECT COUNT(*) FROM v1 WHERE f1 = 4;
-COUNT(*)
-0
-SELECT COUNT(*) FROM v1 WHERE f1 = 5;
-COUNT(*)
-0
-SELECT COUNT(*) FROM v1 WHERE f1 = 10;
-COUNT(*)
-0
-INSERT INTO t1 VALUES(4,'four');
-DELETE FROM v1 WHERE f1 = 3;
-affected rows: 1
-DELETE FROM v1 WHERE f1 = 5;
-affected rows: 0
-SELECT * FROM t1 ORDER BY f1;
-f1 f2
-1 one
-2 two
-4 four
-5 five
-SELECT * FROM v1 ORDER BY f1;
-f1 f2
-2 two
-4 four
-INSERT INTO v1 VALUES(2,'two');
-ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
-INSERT INTO v1 VALUES(3,'three');
-affected rows: 1
-INSERT INTO v1 VALUES(6,'six');
-affected rows: 1
-SELECT * FROM t1 ORDER BY f1;
-f1 f2
-1 one
-2 two
-3 three
-4 four
-5 five
-6 six
-SELECT * FROM v1 ORDER BY f1;
-f1 f2
-2 two
-3 three
-4 four
-UPDATE v1 SET f1 = 2 WHERE f1 = 3;
-ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
-UPDATE v1 SET f2 = 'number' WHERE f1 = 3;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-UPDATE v1 SET f1 = 10 WHERE f1 = 3;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-UPDATE v1 SET f2 = 'number' WHERE f1 = 1;
-affected rows: 0
-
-Testcase 3.3.1.46
---------------------------------------------------------------------------------
-Drop view if exists test.v1 ;
-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 order by f59 ;
-f59 f60
-195 87
-drop view if exists test.v1 ;
-
-Testcase 3.3.1.47
---------------------------------------------------------------------------------
-Drop view if exists test.v1 ;
-Drop view if exists test.v2 ;
-CREATE VIEW test.v1 AS SELECT f59,f60
-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 order by f59 ;
-f59 f60
-987 41
-UPDATE test.v2 SET F59 = 9879 where f59 = 919 ;
-SELECT * FROM tb2 where f59 = 9879 ;
-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 v1 ;
-drop view if exists v2 ;
-
-Testcase 3.3.1.48
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS test.t1;
-DROP VIEW IF EXISTS test.v1;
-CREATE TABLE t1 (f1 ENUM('A', 'B', 'C') NOT NULL, f2 INTEGER)
-ENGINE = ndb;
-INSERT INTO t1 VALUES ('A', 1);
-SELECT * FROM t1 order by f1, f2;
-f1 f2
-A 1
-CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
-WITH CASCADED CHECK OPTION ;
-SELECT * FROM v1 order by f1, f2;
-f1 f2
-A 1
-UPDATE v1 SET f2 = 2 WHERE f2 = 1;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-INSERT INTO v1 VALUES('B',2);
-affected rows: 1
-SELECT * FROM v1 order by f1, f2;
-f1 f2
-A 2
-B 2
-UPDATE v1 SET f2 = 4;
-ERROR HY000: CHECK OPTION failed 'test.v1'
-INSERT INTO v1 VALUES('B',3);
-ERROR HY000: CHECK OPTION failed 'test.v1'
-SELECT * FROM v1 order by f1, f2;
-f1 f2
-A 2
-B 2
-
-Testcase 3.3.1.49
---------------------------------------------------------------------------------
-Drop table if exists test.t1 ;
-Drop view if exists test.v1 ;
-Drop view if exists test.v2 ;
-Drop view if exists test.v3 ;
-Create table test.t1 (f59 INT, f60 INT) ;
-Insert into test.t1 values (100,4234);
-Insert into test.t1 values (290,6624);
-Insert into test.t1 values (410,765);
-Insert into test.t1 values (300,433334);
-Insert into test.t1 values (800,9788);
-Insert into test.t1 values (501,9866);
-Create view test.v1 as select f59
-FROM test.t1 where f59<500 with check option ;
-Create view test.v2 as select *
-from test.v1 where f59>0 with local check option ;
-Create view test.v3 as select *
-from test.v1 where f59>0 with cascaded check option ;
-Insert into test.v2 values(23) ;
-Insert into test.v3 values(24) ;
-drop view if exists test.v1 ;
-drop view if exists test.v2 ;
-drop view if exists test.v3 ;
-
-Testcase 3.3.1.49A
---------------------------------------------------------------------------------
-USE test;
-DROP TABLE IF EXISTS test.t1 ;
-DROP TABLE IF EXISTS test.t1_results ;
-DROP VIEW IF EXISTS test.v1;
-DROP VIEW IF EXISTS test.v2;
-DROP VIEW IF EXISTS test.v3;
-CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20));
-CREATE TABLE t1_results (v3_to_v1_options VARCHAR(100), statement VARCHAR(10),
-v3_to_v1_violation VARCHAR(20), errno CHAR(10));
-CREATE VIEW v1 AS SELECT f1, f2
- FROM t1 WHERE f1 BETWEEN 0 AND 10 WITH LOCAL CHECK OPTION ;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 WITH LOCAL CHECK OPTION ;
-option_variant WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 WITH CASCADED CHECK OPTION ;
-option_variant WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 WITH CHECK OPTION ;
-option_variant WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - WITH CHECK OPTION - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 ;
-option_variant WITH LOCAL CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - <nothing> - WITH LOCAL CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT f1, f2
- FROM t1 WHERE f1 BETWEEN 0 AND 10 WITH CASCADED CHECK OPTION ;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 WITH LOCAL CHECK OPTION ;
-option_variant WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 WITH CASCADED CHECK OPTION ;
-option_variant WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 WITH CHECK OPTION ;
-option_variant WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - WITH CHECK OPTION - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 ;
-option_variant WITH LOCAL CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - <nothing> - WITH CASCADED CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT f1, f2
- FROM t1 WHERE f1 BETWEEN 0 AND 10 WITH CHECK OPTION ;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 WITH LOCAL CHECK OPTION ;
-option_variant WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - WITH LOCAL CHECK OPTION - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 WITH CASCADED CHECK OPTION ;
-option_variant WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - WITH CASCADED CHECK OPTION - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 WITH CHECK OPTION ;
-option_variant WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - WITH CHECK OPTION - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 ;
-option_variant WITH LOCAL CHECK OPTION - <nothing> - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - <nothing> - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - <nothing> - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - <nothing> - WITH CHECK OPTION
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT f1, f2
- FROM t1 WHERE f1 BETWEEN 0 AND 10 ;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 WITH LOCAL CHECK OPTION ;
-option_variant WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - WITH LOCAL CHECK OPTION - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 WITH CASCADED CHECK OPTION ;
-option_variant WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - WITH CASCADED CHECK OPTION - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 WITH CHECK OPTION ;
-option_variant WITH LOCAL CHECK OPTION - WITH CHECK OPTION - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - WITH CHECK OPTION - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - WITH CHECK OPTION - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - WITH CHECK OPTION - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-CREATE VIEW v2 AS SELECT f1 AS col1, f2 AS col2
- FROM v1 WHERE f1 BETWEEN 6 AND 16 ;
-option_variant WITH LOCAL CHECK OPTION - <nothing> - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CASCADED CHECK OPTION - <nothing> - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant WITH CHECK OPTION - <nothing> - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-ERROR HY000: CHECK OPTION failed 'test.v3'
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(0, 'zero');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(7, 'seven');
-ERROR HY000: CHECK OPTION failed 'test.v3'
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-option_variant <nothing> - <nothing> - <nothing>
-option_variant --------------------------------------------------------------------------------
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-SELECT * FROM v1;
-f1 f2
-0 zero
-7 seven
-8 eight
-SELECT * FROM v2;
-col1 col2
-7 seven
-8 eight
-SELECT * FROM v3;
-my_col1 my_col2
-8 eight
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-DELETE FROM v3 WHERE my_col1 = 16;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 0;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 7;
-affected rows: 0
-DELETE FROM v3 WHERE my_col1 = 8;
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-DELETE FROM t1;
-INSERT INTO t1 VALUES(16, 'sixteen');
-INSERT INTO t1 VALUES(0, 'zero');
-INSERT INTO t1 VALUES(7, 'seven');
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 16;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 0;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 7;
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
-UPDATE v3 SET my_col2 = 'whatever' WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 whatever
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 7 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-7 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 0 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-0 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 16 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-16 eight
-DELETE FROM t1;
-INSERT INTO t1 VALUES(8, 'eight');
-UPDATE v3 SET my_col1 = 10 WHERE my_col1 = 8;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM t1;
-f1 f2
-10 eight
-DELETE FROM t1;
-INSERT INTO v3 VALUES(16, 'sixteen');
-affected rows: 1
-INSERT INTO v3 VALUES(0, 'zero');
-affected rows: 1
-INSERT INTO v3 VALUES(7, 'seven');
-affected rows: 1
-INSERT INTO v3 VALUES(8, 'eight');
-affected rows: 1
-SELECT * FROM t1;
-f1 f2
-16 sixteen
-0 zero
-7 seven
-8 eight
-DELETE FROM t1;
-DROP VIEW v3;
-DROP VIEW v2;
-DROP VIEW v1;
-SELECT * FROM t1_results ORDER BY v3_to_v1_options;
-v3_to_v1_options statement v3_to_v1_violation errno
- <nothing> - <nothing> - <nothing> UPDATE _v2_ 0
- <nothing> - <nothing> - <nothing> INSERT _v2_ 0
- <nothing> - <nothing> - <nothing> INSERT _ _v1 0
- <nothing> - <nothing> - <nothing> UPDATE _ _ 0
- <nothing> - <nothing> - <nothing> UPDATE _ _v1 0
- <nothing> - <nothing> - <nothing> UPDATE v3_ _ 0
- <nothing> - <nothing> - <nothing> INSERT _ _ 0
- <nothing> - <nothing> - WITH CHECK OPTION UPDATE _v2_ 0
- <nothing> - <nothing> - WITH CHECK OPTION INSERT _ _ 0
- <nothing> - <nothing> - WITH CHECK OPTION UPDATE _ _v1 0
- <nothing> - <nothing> - WITH CHECK OPTION UPDATE _ _ 0
- <nothing> - <nothing> - WITH CHECK OPTION UPDATE v3_ _ 0
- <nothing> - <nothing> - WITH CHECK OPTION INSERT _v2_ 0
- <nothing> - <nothing> - WITH CHECK OPTION INSERT _ _v1 0
- <nothing> - <nothing> - WITH CASCADED CHECK OPTION INSERT _v2_ 0
- <nothing> - <nothing> - WITH CASCADED CHECK OPTION INSERT _ _ 0
- <nothing> - <nothing> - WITH CASCADED CHECK OPTION INSERT _ _v1 0
- <nothing> - <nothing> - WITH CASCADED CHECK OPTION UPDATE _ _ 0
- <nothing> - <nothing> - WITH CASCADED CHECK OPTION UPDATE _ _v1 0
- <nothing> - <nothing> - WITH CASCADED CHECK OPTION UPDATE _v2_ 0
- <nothing> - <nothing> - WITH CASCADED CHECK OPTION UPDATE v3_ _ 0
- <nothing> - <nothing> - WITH LOCAL CHECK OPTION UPDATE _ _v1 0
- <nothing> - <nothing> - WITH LOCAL CHECK OPTION INSERT _v2_ 0
- <nothing> - <nothing> - WITH LOCAL CHECK OPTION INSERT _ _v1 0
- <nothing> - <nothing> - WITH LOCAL CHECK OPTION INSERT _ _ 0
- <nothing> - <nothing> - WITH LOCAL CHECK OPTION UPDATE v3_ _ 0
- <nothing> - <nothing> - WITH LOCAL CHECK OPTION UPDATE _v2_ 0
- <nothing> - <nothing> - WITH LOCAL CHECK OPTION UPDATE _ _ 0
- <nothing> - WITH CHECK OPTION - <nothing> UPDATE _v2_ 0
- <nothing> - WITH CHECK OPTION - <nothing> INSERT _v2_ 0
- <nothing> - WITH CHECK OPTION - <nothing> UPDATE v3_ _ 0
- <nothing> - WITH CHECK OPTION - <nothing> UPDATE _ _v1 0
- <nothing> - WITH CHECK OPTION - <nothing> UPDATE _ _ 0
- <nothing> - WITH CHECK OPTION - <nothing> INSERT _ _v1 0
- <nothing> - WITH CHECK OPTION - <nothing> INSERT _ _ 0
- <nothing> - WITH CHECK OPTION - WITH CHECK OPTION UPDATE v3_ _ 0
- <nothing> - WITH CHECK OPTION - WITH CHECK OPTION UPDATE _v2_ 0
- <nothing> - WITH CHECK OPTION - WITH CHECK OPTION UPDATE _ _ 0
- <nothing> - WITH CHECK OPTION - WITH CHECK OPTION INSERT _ _v1 0
- <nothing> - WITH CHECK OPTION - WITH CHECK OPTION INSERT _v2_ 0
- <nothing> - WITH CHECK OPTION - WITH CHECK OPTION INSERT _ _ 0
- <nothing> - WITH CHECK OPTION - WITH CHECK OPTION UPDATE _ _v1 0
- <nothing> - WITH CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _ 0
- <nothing> - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _v2_ 0
- <nothing> - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _v1 0
- <nothing> - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _ 0
- <nothing> - WITH CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _v1 0
- <nothing> - WITH CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _v2_ 0
- <nothing> - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE v3_ _ 0
- <nothing> - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE v3_ _ 0
- <nothing> - WITH CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _ 0
- <nothing> - WITH CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _v2_ 0
- <nothing> - WITH CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _v1 0
- <nothing> - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _ 0
- <nothing> - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _v1 0
- <nothing> - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _v2_ 0
- <nothing> - WITH CASCADED CHECK OPTION - <nothing> INSERT _ _v1 0
- <nothing> - WITH CASCADED CHECK OPTION - <nothing> UPDATE _ _v1 0
- <nothing> - WITH CASCADED CHECK OPTION - <nothing> UPDATE _v2_ 0
- <nothing> - WITH CASCADED CHECK OPTION - <nothing> UPDATE _ _ 0
- <nothing> - WITH CASCADED CHECK OPTION - <nothing> UPDATE v3_ _ 0
- <nothing> - WITH CASCADED CHECK OPTION - <nothing> INSERT _ _ 0
- <nothing> - WITH CASCADED CHECK OPTION - <nothing> INSERT _v2_ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CHECK OPTION INSERT _ _v1 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE _ _v1 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CHECK OPTION INSERT _ _ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CHECK OPTION INSERT _v2_ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE v3_ _ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE _ _ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE _v2_ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE v3_ _ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _v2_ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _v1 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _v2_ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _v1 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _v1 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _v1 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _v2_ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE v3_ _ 0
- <nothing> - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _v2_ 0
- <nothing> - WITH LOCAL CHECK OPTION - <nothing> UPDATE v3_ _ 0
- <nothing> - WITH LOCAL CHECK OPTION - <nothing> INSERT _ _ 0
- <nothing> - WITH LOCAL CHECK OPTION - <nothing> INSERT _v2_ 0
- <nothing> - WITH LOCAL CHECK OPTION - <nothing> INSERT _ _v1 0
- <nothing> - WITH LOCAL CHECK OPTION - <nothing> UPDATE _ _ 0
- <nothing> - WITH LOCAL CHECK OPTION - <nothing> UPDATE _ _v1 0
- <nothing> - WITH LOCAL CHECK OPTION - <nothing> UPDATE _v2_ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE v3_ _ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE _v2_ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE _ _ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CHECK OPTION INSERT _v2_ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE _ _v1 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CHECK OPTION INSERT _ _ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CHECK OPTION INSERT _ _v1 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _v1 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE v3_ _ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _v2_ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _v1 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _v2_ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE v3_ _ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _v2_ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _v1 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _v2_ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _ 0
- <nothing> - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _v1 0
-WITH CHECK OPTION - <nothing> - <nothing> UPDATE v3_ _ 1369
-WITH CHECK OPTION - <nothing> - <nothing> INSERT _ _ 0
-WITH CHECK OPTION - <nothing> - <nothing> INSERT _v2_ 1369
-WITH CHECK OPTION - <nothing> - <nothing> INSERT _ _v1 1369
-WITH CHECK OPTION - <nothing> - <nothing> UPDATE _v2_ 1369
-WITH CHECK OPTION - <nothing> - <nothing> UPDATE _ _v1 1369
-WITH CHECK OPTION - <nothing> - <nothing> UPDATE _ _ 0
-WITH CHECK OPTION - <nothing> - WITH CHECK OPTION UPDATE _v2_ 1369
-WITH CHECK OPTION - <nothing> - WITH CHECK OPTION UPDATE v3_ _ 1369
-WITH CHECK OPTION - <nothing> - WITH CHECK OPTION INSERT _v2_ 1369
-WITH CHECK OPTION - <nothing> - WITH CHECK OPTION INSERT _ _v1 1369
-WITH CHECK OPTION - <nothing> - WITH CHECK OPTION UPDATE _ _ 0
-WITH CHECK OPTION - <nothing> - WITH CHECK OPTION UPDATE _ _v1 1369
-WITH CHECK OPTION - <nothing> - WITH CHECK OPTION INSERT _ _ 0
-WITH CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION UPDATE v3_ _ 1369
-WITH CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION INSERT _ _ 0
-WITH CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION UPDATE _v2_ 1369
-WITH CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION INSERT _v2_ 1369
-WITH CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION INSERT _ _v1 1369
-WITH CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION UPDATE _ _ 0
-WITH CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION UPDATE _ _v1 1369
-WITH CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION INSERT _ _ 0
-WITH CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION UPDATE _v2_ 1369
-WITH CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION UPDATE _ _v1 1369
-WITH CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION UPDATE _ _ 0
-WITH CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION INSERT _ _v1 1369
-WITH CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION INSERT _v2_ 1369
-WITH CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION UPDATE v3_ _ 1369
-WITH CHECK OPTION - WITH CHECK OPTION - <nothing> UPDATE _ _ 0
-WITH CHECK OPTION - WITH CHECK OPTION - <nothing> INSERT _ _v1 1369
-WITH CHECK OPTION - WITH CHECK OPTION - <nothing> INSERT _v2_ 1369
-WITH CHECK OPTION - WITH CHECK OPTION - <nothing> INSERT _ _ 0
-WITH CHECK OPTION - WITH CHECK OPTION - <nothing> UPDATE _ _v1 1369
-WITH CHECK OPTION - WITH CHECK OPTION - <nothing> UPDATE v3_ _ 1369
-WITH CHECK OPTION - WITH CHECK OPTION - <nothing> UPDATE _v2_ 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION INSERT _v2_ 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION UPDATE _v2_ 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION UPDATE v3_ _ 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION UPDATE _ _v1 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION UPDATE _ _ 0
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION INSERT _ _v1 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION INSERT _ _ 0
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _v1 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _v2_ 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE v3_ _ 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _ 0
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _v1 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _ 0
-WITH CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _v2_ 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _v2_ 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _v1 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _v2_ 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _ 0
-WITH CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _v1 1369
-WITH CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _ 0
-WITH CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE v3_ _ 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> UPDATE v3_ _ 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> UPDATE _v2_ 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> UPDATE _ _v1 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> UPDATE _ _ 0
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> INSERT _ _v1 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> INSERT _v2_ 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> INSERT _ _ 0
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE v3_ _ 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE _v2_ 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE _ _v1 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE _ _ 0
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION INSERT _ _v1 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION INSERT _v2_ 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION INSERT _ _ 0
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE v3_ _ 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _v2_ 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _v1 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _ 0
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _v1 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _v2_ 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _ 0
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _v2_ 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE v3_ _ 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _v2_ 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _v1 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _ 0
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _v1 1369
-WITH CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _ 0
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> INSERT _ _v1 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> UPDATE _ _ 0
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> UPDATE _ _v1 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> INSERT _ _ 0
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> INSERT _v2_ 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> UPDATE _v2_ 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> UPDATE v3_ _ 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION INSERT _ _ 0
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION INSERT _ _v1 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE v3_ _ 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE _ _v1 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE _v2_ 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE _ _ 0
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION INSERT _v2_ 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _v2_ 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _v1 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _ 0
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _v1 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _ 0
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE v3_ _ 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _v2_ 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _ 0
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _v1 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE v3_ _ 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _v2_ 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _v2_ 1369
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _ 0
-WITH CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - <nothing> - <nothing> INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - <nothing> - <nothing> INSERT _ _ 0
-WITH CASCADED CHECK OPTION - <nothing> - <nothing> UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - <nothing> - <nothing> UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - <nothing> - <nothing> UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - <nothing> - <nothing> UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - <nothing> - <nothing> INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH CHECK OPTION INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH CHECK OPTION UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH CHECK OPTION UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH CHECK OPTION UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH CHECK OPTION UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - <nothing> - WITH CHECK OPTION INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH CHECK OPTION INSERT _ _ 0
-WITH CASCADED CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION INSERT _ _ 0
-WITH CASCADED CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION INSERT _ _ 0
-WITH CASCADED CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - <nothing> UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - <nothing> UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - <nothing> UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - <nothing> INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - <nothing> UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - <nothing> INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - <nothing> INSERT _ _ 0
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION INSERT _ _ 0
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _ 0
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _ 0
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> INSERT _ _ 0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION INSERT _ _ 0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _ 0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _ 0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> INSERT _ _ 0
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION INSERT _ _ 0
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _ 0
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _ 0
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _ 0
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE v3_ _ 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _v2_ 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _v1 1369
-WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - <nothing> - <nothing> INSERT _ _ 0
-WITH LOCAL CHECK OPTION - <nothing> - <nothing> UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - <nothing> - <nothing> UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - <nothing> - <nothing> UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - <nothing> - <nothing> INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - <nothing> - <nothing> INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - <nothing> - <nothing> UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - <nothing> - WITH CHECK OPTION UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH CHECK OPTION UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - <nothing> - WITH CHECK OPTION UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH CHECK OPTION UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH CHECK OPTION INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH CHECK OPTION INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH CHECK OPTION INSERT _ _ 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION INSERT _ _ 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH CASCADED CHECK OPTION UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION INSERT _ _ 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - <nothing> - WITH LOCAL CHECK OPTION UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - <nothing> UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - <nothing> UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - <nothing> UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - <nothing> INSERT _ _ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - <nothing> INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - <nothing> INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - <nothing> UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION INSERT _ _ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CHECK OPTION UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - WITH CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - <nothing> INSERT _ _ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION INSERT _ _ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CHECK OPTION UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> INSERT _ _ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - <nothing> INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION INSERT _ _ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CHECK OPTION UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _v2_ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH CASCADED CHECK OPTION UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _v2_ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _v1 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE _ _ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _v1 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _ _ 0
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION UPDATE v3_ _ 1369
-WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION - WITH LOCAL CHECK OPTION INSERT _v2_ 0
-
-Plausibility checks for INSERTs and UPDATEs ( 4. and 5. above).
-All following SELECTs must give ROW NOT FOUND
---------------------------------------------------------------------------------
-SELECT * FROM t1_results
-WHERE v3_to_v1_violation = ' _ _ ' AND errno <> 0
-ORDER BY v3_to_v1_options;
-v3_to_v1_options statement v3_to_v1_violation errno
-SELECT * FROM t1_results
-WHERE v3_to_v1_options LIKE ' %' AND errno <> 0
-ORDER BY v3_to_v1_options;
-v3_to_v1_options statement v3_to_v1_violation errno
-SELECT * FROM t1_results
-WHERE v3_to_v1_options LIKE 'WITH %'
- AND v3_to_v1_violation LIKE 'v3_%' AND errno = 0
-ORDER BY v3_to_v1_options;
-v3_to_v1_options statement v3_to_v1_violation errno
-SELECT * FROM t1_results
-WHERE v3_to_v1_options LIKE 'WITH %' AND v3_to_v1_options NOT LIKE 'WITH LOCAL %'
- AND v3_to_v1_violation NOT LIKE ' _ _ ' AND errno = 0
-ORDER BY v3_to_v1_options;
-v3_to_v1_options statement v3_to_v1_violation errno
-SELECT * FROM t1_results
-WHERE errno <> 0 AND errno <> 1369
-ORDER BY v3_to_v1_options;
-v3_to_v1_options statement v3_to_v1_violation errno
-
-End of plausibility checks
---------------------------------------------------------------------------------
-DROP TABLE t1_results;
-
-Testcase 3.3.1.50 - 3.3.1.53
---------------------------------------------------------------------------------
-DROP VIEW IF EXISTS test.v1;
-CREATE VIEW test.v1 AS SELECT * FROM test.tb2;
-SELECT * FROM test.v1 order by f59,f60,f61 ;
-f59 1
-f60 1
-f61 0000000001
-f62 0000000000000000000000000000000000000000000000000000000000000001
-f63 0000000001
-f64 0000000000000000000000000000000000000000000000000000000000000001
-f65 -5
-f66 0.000000000000000000000000000000
-f67 1
-f68 0.000000000000000000000000000000
-f69 0000000001
-f70 000000000000000000000000000000000.000000000000000000000000000000
-f71 0000000001
-f72 000000000000000000000000000000000.000000000000000000000000000000
-f73 -1.17549435e-38
-f74 1.175494352e-38
-f75 00000001.175494352e-38
-f76 00000001.175494352e-38
-f77 -1.17549435e-38
-f78 1.175494352e-38
-f79 00000001.175494352e-38
-f80 00000001.175494352e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.17549435e-38
-f95 1.17549e-38
-f96 1.175494352e-38
-f97 01.17549e-38
-f98 00000001.175494352e-38
-f99 01.17549e-38
-f100 00000001.175494352e-38
-f101 1000-01-01
-f102 838:59:58
-f103 1970-01-02 00:00:01
-f104 1970-01-02 00:00:01
-f105 1902
-f106 1902
-f107 1902
-f108 2enum
-f109 2set
-f59 2
-f60 2
-f61 0000000002
-f62 0000000000000000000000000000000000000000000000000000000000000002
-f63 0000000002
-f64 0000000000000000000000000000000000000000000000000000000000000002
-f65 -4
-f66 1.100000000000000000000000000000
-f67 2
-f68 1.100000000000000000000000000000
-f69 0000000002
-f70 000000000000000000000000000000001.100000000000000000000000000000
-f71 0000000002
-f72 000000000000000000000000000000001.100000000000000000000000000000
-f73 -1.175494349e-38
-f74 1.175494353e-38
-f75 00000001.175494353e-38
-f76 00000001.175494353e-38
-f77 -1.175494349e-38
-f78 1.175494353e-38
-f79 00000001.175494353e-38
-f80 00000001.175494353e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494349e-38
-f95 1.17549e-38
-f96 1.175494353e-38
-f97 01.17549e-38
-f98 00000001.175494353e-38
-f99 01.17549e-38
-f100 00000001.175494353e-38
-f101 1000-01-02
-f102 838:59:57
-f103 1970-01-03 00:00:02
-f104 1970-01-03 00:00:02
-f105 1903
-f106 1903
-f107 1903
-f108 1enum
-f109 1set,2set
-f59 3
-f60 3
-f61 0000000003
-f62 0000000000000000000000000000000000000000000000000000000000000003
-f63 0000000003
-f64 0000000000000000000000000000000000000000000000000000000000000003
-f65 -3
-f66 2.200000000000000000000000000000
-f67 3
-f68 2.200000000000000000000000000000
-f69 0000000003
-f70 000000000000000000000000000000002.200000000000000000000000000000
-f71 0000000003
-f72 000000000000000000000000000000002.200000000000000000000000000000
-f73 -1.175494348e-38
-f74 1.175494354e-38
-f75 00000001.175494354e-38
-f76 00000001.175494354e-38
-f77 -1.175494348e-38
-f78 1.175494354e-38
-f79 00000001.175494354e-38
-f80 00000001.175494354e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494348e-38
-f95 1.17549e-38
-f96 1.175494354e-38
-f97 01.17549e-38
-f98 00000001.175494354e-38
-f99 01.17549e-38
-f100 00000001.175494354e-38
-f101 1000-01-03
-f102 838:59:56
-f103 1970-01-04 00:00:03
-f104 1970-01-04 00:00:03
-f105 1904
-f106 1904
-f107 1904
-f108 2enum
-f109 1set
-f59 5
-f60 5
-f61 0000000005
-f62 0000000000000000000000000000000000000000000000000000000000000005
-f63 0000000005
-f64 0000000000000000000000000000000000000000000000000000000000000005
-f65 -1
-f66 4.400000000000000000000000000000
-f67 5
-f68 4.400000000000000000000000000000
-f69 0000000005
-f70 000000000000000000000000000000004.400000000000000000000000000000
-f71 0000000005
-f72 000000000000000000000000000000004.400000000000000000000000000000
-f73 -1.175494346e-38
-f74 1.175494356e-38
-f75 00000001.175494356e-38
-f76 00000001.175494356e-38
-f77 -1.175494346e-38
-f78 1.175494356e-38
-f79 00000001.175494356e-38
-f80 00000001.175494356e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494346e-38
-f95 1.17549e-38
-f96 1.175494356e-38
-f97 01.17549e-38
-f98 00000001.175494356e-38
-f99 01.17549e-38
-f100 00000001.175494356e-38
-f101 1000-01-05
-f102 838:59:54
-f103 1970-01-06 00:00:05
-f104 1970-01-06 00:00:05
-f105 1906
-f106 1906
-f107 1906
-f108 2enum
-f109 1set,2set
-f59 6
-f60 6
-f61 0000000006
-f62 0000000000000000000000000000000000000000000000000000000000000006
-f63 0000000006
-f64 0000000000000000000000000000000000000000000000000000000000000006
-f65 0
-f66 5.500000000000000000000000000000
-f67 6
-f68 5.500000000000000000000000000000
-f69 0000000006
-f70 000000000000000000000000000000005.500000000000000000000000000000
-f71 0000000006
-f72 000000000000000000000000000000005.500000000000000000000000000000
-f73 -1.175494345e-38
-f74 1.175494357e-38
-f75 00000001.175494357e-38
-f76 00000001.175494357e-38
-f77 -1.175494345e-38
-f78 1.175494357e-38
-f79 00000001.175494357e-38
-f80 00000001.175494357e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494345e-38
-f95 1.17549e-38
-f96 1.175494357e-38
-f97 01.17549e-38
-f98 00000001.175494357e-38
-f99 01.17549e-38
-f100 00000001.175494357e-38
-f101 1000-01-06
-f102 838:59:53
-f103 1970-01-07 00:00:06
-f104 1970-01-07 00:00:06
-f105 1907
-f106 1907
-f107 1907
-f108 1enum
-f109 1set
-f59 7
-f60 7
-f61 0000000007
-f62 0000000000000000000000000000000000000000000000000000000000000007
-f63 0000000007
-f64 0000000000000000000000000000000000000000000000000000000000000007
-f65 1
-f66 6.600000000000000000000000000000
-f67 7
-f68 6.600000000000000000000000000000
-f69 0000000007
-f70 000000000000000000000000000000006.600000000000000000000000000000
-f71 0000000007
-f72 000000000000000000000000000000006.600000000000000000000000000000
-f73 -1.175494344e-38
-f74 1.175494358e-38
-f75 00000001.175494358e-38
-f76 00000001.175494358e-38
-f77 -1.175494344e-38
-f78 1.175494358e-38
-f79 00000001.175494358e-38
-f80 00000001.175494358e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494344e-38
-f95 1.17549e-38
-f96 1.175494358e-38
-f97 01.17549e-38
-f98 00000001.175494358e-38
-f99 01.17549e-38
-f100 00000001.175494358e-38
-f101 1000-01-07
-f102 838:59:52
-f103 1970-01-08 00:00:07
-f104 1970-01-08 00:00:07
-f105 1908
-f106 1908
-f107 1908
-f108 2enum
-f109 2set
-f59 8
-f60 8
-f61 0000000008
-f62 0000000000000000000000000000000000000000000000000000000000000008
-f63 0000000008
-f64 0000000000000000000000000000000000000000000000000000000000000008
-f65 2
-f66 7.700000000000000000000000000000
-f67 8
-f68 7.700000000000000000000000000000
-f69 0000000008
-f70 000000000000000000000000000000007.700000000000000000000000000000
-f71 0000000008
-f72 000000000000000000000000000000007.700000000000000000000000000000
-f73 -1.175494343e-38
-f74 1.175494359e-38
-f75 00000001.175494359e-38
-f76 00000001.175494359e-38
-f77 -1.175494343e-38
-f78 1.175494359e-38
-f79 00000001.175494359e-38
-f80 00000001.175494359e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494343e-38
-f95 1.17549e-38
-f96 1.175494359e-38
-f97 01.17549e-38
-f98 00000001.175494359e-38
-f99 01.17549e-38
-f100 00000001.175494359e-38
-f101 1000-01-08
-f102 838:59:51
-f103 1970-01-09 00:00:08
-f104 1970-01-09 00:00:08
-f105 1909
-f106 1909
-f107 1909
-f108 1enum
-f109 1set,2set
-f59 9
-f60 9
-f61 0000000009
-f62 0000000000000000000000000000000000000000000000000000000000000009
-f63 0000000009
-f64 0000000000000000000000000000000000000000000000000000000000000009
-f65 3
-f66 8.800000000000000000000000000000
-f67 9
-f68 8.800000000000000000000000000000
-f69 0000000009
-f70 000000000000000000000000000000008.800000000000000000000000000000
-f71 0000000009
-f72 000000000000000000000000000000008.800000000000000000000000000000
-f73 -1.175494342e-38
-f74 1.17549436e-38
-f75 000000001.17549436e-38
-f76 000000001.17549436e-38
-f77 -1.175494342e-38
-f78 1.17549436e-38
-f79 000000001.17549436e-38
-f80 000000001.17549436e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494342e-38
-f95 1.17549e-38
-f96 1.17549436e-38
-f97 01.17549e-38
-f98 000000001.17549436e-38
-f99 01.17549e-38
-f100 000000001.17549436e-38
-f101 1000-01-09
-f102 838:59:50
-f103 1970-01-10 00:00:09
-f104 1970-01-10 00:00:09
-f105 1910
-f106 1910
-f107 1910
-f108 2enum
-f109 1set
-f59 10
-f60 10
-f61 0000000010
-f62 0000000000000000000000000000000000000000000000000000000000000010
-f63 0000000010
-f64 0000000000000000000000000000000000000000000000000000000000000010
-f65 4
-f66 9.900000000000000000000000000000
-f67 10
-f68 9.900000000000000000000000000000
-f69 0000000010
-f70 000000000000000000000000000000009.900000000000000000000000000000
-f71 0000000010
-f72 000000000000000000000000000000009.900000000000000000000000000000
-f73 -1.175494341e-38
-f74 1.175494361e-38
-f75 00000001.175494361e-38
-f76 00000001.175494361e-38
-f77 -1.175494341e-38
-f78 1.175494361e-38
-f79 00000001.175494361e-38
-f80 00000001.175494361e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494341e-38
-f95 1.17549e-38
-f96 1.175494361e-38
-f97 01.17549e-38
-f98 00000001.175494361e-38
-f99 01.17549e-38
-f100 00000001.175494361e-38
-f101 1000-01-10
-f102 838:59:49
-f103 1970-01-11 00:00:10
-f104 1970-01-11 00:00:10
-f105 1911
-f106 1911
-f107 1911
-f108 1enum
-f109 2set
-f59 15
-f60 87
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 17
-f60 15
-f61 0000000016
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 19
-f60 18
-f61 0000000014
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 22
-f60 93
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 24
-f60 51654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 27
-f60 25
-f61 0000000026
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 29
-f60 28
-f61 0000000024
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 34
-f60 41
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 94
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 100
-f60 4
-f61 0000000004
-f62 0000000000000000000000000000000000000000000000000000000000000004
-f63 0000000004
-f64 0000000000000000000000000000000000000000000000000000000000000004
-f65 -2
-f66 3.300000000000000000000000000000
-f67 4
-f68 3.300000000000000000000000000000
-f69 0000000004
-f70 000000000000000000000000000000003.300000000000000000000000000000
-f71 0000000004
-f72 000000000000000000000000000000003.300000000000000000000000000000
-f73 -1.175494347e-38
-f74 1.175494355e-38
-f75 00000001.175494355e-38
-f76 00000001.175494355e-38
-f77 -1.175494347e-38
-f78 1.175494355e-38
-f79 00000001.175494355e-38
-f80 00000001.175494355e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494347e-38
-f95 1.17549e-38
-f96 1.175494355e-38
-f97 01.17549e-38
-f98 00000001.175494355e-38
-f99 01.17549e-38
-f100 00000001.175494355e-38
-f101 1000-01-04
-f102 838:59:55
-f103 1970-01-05 00:00:04
-f104 1970-01-05 00:00:04
-f105 1905
-f106 1905
-f107 1905
-f108 1enum
-f109 2set
-f59 100
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 107
-f60 105
-f61 0000000106
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 107
-f60 105
-f61 0000000106
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 109
-f60 108
-f61 0000000104
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 109
-f60 108
-f61 0000000104
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 195
-f60 87
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 207
-f60 205
-f61 0000000206
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 209
-f60 208
-f61 0000000204
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 242
-f60 79
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 250
-f60 87895654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 292
-f60 93
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 299
-f60 899
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 321
-f60 NULL
-f61 0000000765
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 323
-f60 14376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 340
-f60 9984376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 394
-f60 41
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 424
-f60 89
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 441
-f60 16546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 500
-f60 NULL
-f61 0000000900
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 500
-f60 NULL
-f61 0000000900
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 500
-f60 NULL
-f61 0000000900
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 660
-f60 876546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 987
-f60 41
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 2550
-f60 775654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 2760
-f60 985654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 3330
-f60 764376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 3410
-f60 996546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 7876
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 9112
-f60 NULL
-f61 0000008771
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 76710
-f60 226546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 569300
-f60 9114376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-drop view test.v1 ;
-CREATE VIEW test.v1 AS SELECT F59,F61 FROM test.tb2;
-SELECT * FROM test.v1 order by F59, F61 limit 50;
-F59 F61
-1 0000000001
-2 0000000002
-3 0000000003
-5 0000000005
-6 0000000006
-7 0000000007
-8 0000000008
-9 0000000009
-10 0000000010
-15 NULL
-17 0000000016
-19 0000000014
-22 NULL
-24 NULL
-27 0000000026
-29 0000000024
-34 NULL
-94 NULL
-100 NULL
-100 0000000004
-107 0000000106
-107 0000000106
-109 0000000104
-109 0000000104
-195 NULL
-207 0000000206
-209 0000000204
-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 order by f59, f60, f61;
-SELECT * FROM test.v1 order by f59,f60,f61 ;
-f59 1
-f60 1
-f61 0000000001
-f62 0000000000000000000000000000000000000000000000000000000000000001
-f63 0000000001
-f64 0000000000000000000000000000000000000000000000000000000000000001
-f65 -5
-f66 0.000000000000000000000000000000
-f67 1
-f68 0.000000000000000000000000000000
-f69 0000000001
-f70 000000000000000000000000000000000.000000000000000000000000000000
-f71 0000000001
-f72 000000000000000000000000000000000.000000000000000000000000000000
-f73 -1.17549435e-38
-f74 1.175494352e-38
-f75 00000001.175494352e-38
-f76 00000001.175494352e-38
-f77 -1.17549435e-38
-f78 1.175494352e-38
-f79 00000001.175494352e-38
-f80 00000001.175494352e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.17549435e-38
-f95 1.17549e-38
-f96 1.175494352e-38
-f97 01.17549e-38
-f98 00000001.175494352e-38
-f99 01.17549e-38
-f100 00000001.175494352e-38
-f101 1000-01-01
-f102 838:59:58
-f103 1970-01-02 00:00:01
-f104 1970-01-02 00:00:01
-f105 1902
-f106 1902
-f107 1902
-f108 2enum
-f109 2set
-f59 2
-f60 2
-f61 0000000002
-f62 0000000000000000000000000000000000000000000000000000000000000002
-f63 0000000002
-f64 0000000000000000000000000000000000000000000000000000000000000002
-f65 -4
-f66 1.100000000000000000000000000000
-f67 2
-f68 1.100000000000000000000000000000
-f69 0000000002
-f70 000000000000000000000000000000001.100000000000000000000000000000
-f71 0000000002
-f72 000000000000000000000000000000001.100000000000000000000000000000
-f73 -1.175494349e-38
-f74 1.175494353e-38
-f75 00000001.175494353e-38
-f76 00000001.175494353e-38
-f77 -1.175494349e-38
-f78 1.175494353e-38
-f79 00000001.175494353e-38
-f80 00000001.175494353e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494349e-38
-f95 1.17549e-38
-f96 1.175494353e-38
-f97 01.17549e-38
-f98 00000001.175494353e-38
-f99 01.17549e-38
-f100 00000001.175494353e-38
-f101 1000-01-02
-f102 838:59:57
-f103 1970-01-03 00:00:02
-f104 1970-01-03 00:00:02
-f105 1903
-f106 1903
-f107 1903
-f108 1enum
-f109 1set,2set
-f59 3
-f60 3
-f61 0000000003
-f62 0000000000000000000000000000000000000000000000000000000000000003
-f63 0000000003
-f64 0000000000000000000000000000000000000000000000000000000000000003
-f65 -3
-f66 2.200000000000000000000000000000
-f67 3
-f68 2.200000000000000000000000000000
-f69 0000000003
-f70 000000000000000000000000000000002.200000000000000000000000000000
-f71 0000000003
-f72 000000000000000000000000000000002.200000000000000000000000000000
-f73 -1.175494348e-38
-f74 1.175494354e-38
-f75 00000001.175494354e-38
-f76 00000001.175494354e-38
-f77 -1.175494348e-38
-f78 1.175494354e-38
-f79 00000001.175494354e-38
-f80 00000001.175494354e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494348e-38
-f95 1.17549e-38
-f96 1.175494354e-38
-f97 01.17549e-38
-f98 00000001.175494354e-38
-f99 01.17549e-38
-f100 00000001.175494354e-38
-f101 1000-01-03
-f102 838:59:56
-f103 1970-01-04 00:00:03
-f104 1970-01-04 00:00:03
-f105 1904
-f106 1904
-f107 1904
-f108 2enum
-f109 1set
-f59 5
-f60 5
-f61 0000000005
-f62 0000000000000000000000000000000000000000000000000000000000000005
-f63 0000000005
-f64 0000000000000000000000000000000000000000000000000000000000000005
-f65 -1
-f66 4.400000000000000000000000000000
-f67 5
-f68 4.400000000000000000000000000000
-f69 0000000005
-f70 000000000000000000000000000000004.400000000000000000000000000000
-f71 0000000005
-f72 000000000000000000000000000000004.400000000000000000000000000000
-f73 -1.175494346e-38
-f74 1.175494356e-38
-f75 00000001.175494356e-38
-f76 00000001.175494356e-38
-f77 -1.175494346e-38
-f78 1.175494356e-38
-f79 00000001.175494356e-38
-f80 00000001.175494356e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494346e-38
-f95 1.17549e-38
-f96 1.175494356e-38
-f97 01.17549e-38
-f98 00000001.175494356e-38
-f99 01.17549e-38
-f100 00000001.175494356e-38
-f101 1000-01-05
-f102 838:59:54
-f103 1970-01-06 00:00:05
-f104 1970-01-06 00:00:05
-f105 1906
-f106 1906
-f107 1906
-f108 2enum
-f109 1set,2set
-f59 6
-f60 6
-f61 0000000006
-f62 0000000000000000000000000000000000000000000000000000000000000006
-f63 0000000006
-f64 0000000000000000000000000000000000000000000000000000000000000006
-f65 0
-f66 5.500000000000000000000000000000
-f67 6
-f68 5.500000000000000000000000000000
-f69 0000000006
-f70 000000000000000000000000000000005.500000000000000000000000000000
-f71 0000000006
-f72 000000000000000000000000000000005.500000000000000000000000000000
-f73 -1.175494345e-38
-f74 1.175494357e-38
-f75 00000001.175494357e-38
-f76 00000001.175494357e-38
-f77 -1.175494345e-38
-f78 1.175494357e-38
-f79 00000001.175494357e-38
-f80 00000001.175494357e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494345e-38
-f95 1.17549e-38
-f96 1.175494357e-38
-f97 01.17549e-38
-f98 00000001.175494357e-38
-f99 01.17549e-38
-f100 00000001.175494357e-38
-f101 1000-01-06
-f102 838:59:53
-f103 1970-01-07 00:00:06
-f104 1970-01-07 00:00:06
-f105 1907
-f106 1907
-f107 1907
-f108 1enum
-f109 1set
-f59 7
-f60 7
-f61 0000000007
-f62 0000000000000000000000000000000000000000000000000000000000000007
-f63 0000000007
-f64 0000000000000000000000000000000000000000000000000000000000000007
-f65 1
-f66 6.600000000000000000000000000000
-f67 7
-f68 6.600000000000000000000000000000
-f69 0000000007
-f70 000000000000000000000000000000006.600000000000000000000000000000
-f71 0000000007
-f72 000000000000000000000000000000006.600000000000000000000000000000
-f73 -1.175494344e-38
-f74 1.175494358e-38
-f75 00000001.175494358e-38
-f76 00000001.175494358e-38
-f77 -1.175494344e-38
-f78 1.175494358e-38
-f79 00000001.175494358e-38
-f80 00000001.175494358e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494344e-38
-f95 1.17549e-38
-f96 1.175494358e-38
-f97 01.17549e-38
-f98 00000001.175494358e-38
-f99 01.17549e-38
-f100 00000001.175494358e-38
-f101 1000-01-07
-f102 838:59:52
-f103 1970-01-08 00:00:07
-f104 1970-01-08 00:00:07
-f105 1908
-f106 1908
-f107 1908
-f108 2enum
-f109 2set
-f59 8
-f60 8
-f61 0000000008
-f62 0000000000000000000000000000000000000000000000000000000000000008
-f63 0000000008
-f64 0000000000000000000000000000000000000000000000000000000000000008
-f65 2
-f66 7.700000000000000000000000000000
-f67 8
-f68 7.700000000000000000000000000000
-f69 0000000008
-f70 000000000000000000000000000000007.700000000000000000000000000000
-f71 0000000008
-f72 000000000000000000000000000000007.700000000000000000000000000000
-f73 -1.175494343e-38
-f74 1.175494359e-38
-f75 00000001.175494359e-38
-f76 00000001.175494359e-38
-f77 -1.175494343e-38
-f78 1.175494359e-38
-f79 00000001.175494359e-38
-f80 00000001.175494359e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494343e-38
-f95 1.17549e-38
-f96 1.175494359e-38
-f97 01.17549e-38
-f98 00000001.175494359e-38
-f99 01.17549e-38
-f100 00000001.175494359e-38
-f101 1000-01-08
-f102 838:59:51
-f103 1970-01-09 00:00:08
-f104 1970-01-09 00:00:08
-f105 1909
-f106 1909
-f107 1909
-f108 1enum
-f109 1set,2set
-f59 9
-f60 9
-f61 0000000009
-f62 0000000000000000000000000000000000000000000000000000000000000009
-f63 0000000009
-f64 0000000000000000000000000000000000000000000000000000000000000009
-f65 3
-f66 8.800000000000000000000000000000
-f67 9
-f68 8.800000000000000000000000000000
-f69 0000000009
-f70 000000000000000000000000000000008.800000000000000000000000000000
-f71 0000000009
-f72 000000000000000000000000000000008.800000000000000000000000000000
-f73 -1.175494342e-38
-f74 1.17549436e-38
-f75 000000001.17549436e-38
-f76 000000001.17549436e-38
-f77 -1.175494342e-38
-f78 1.17549436e-38
-f79 000000001.17549436e-38
-f80 000000001.17549436e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494342e-38
-f95 1.17549e-38
-f96 1.17549436e-38
-f97 01.17549e-38
-f98 000000001.17549436e-38
-f99 01.17549e-38
-f100 000000001.17549436e-38
-f101 1000-01-09
-f102 838:59:50
-f103 1970-01-10 00:00:09
-f104 1970-01-10 00:00:09
-f105 1910
-f106 1910
-f107 1910
-f108 2enum
-f109 1set
-f59 10
-f60 10
-f61 0000000010
-f62 0000000000000000000000000000000000000000000000000000000000000010
-f63 0000000010
-f64 0000000000000000000000000000000000000000000000000000000000000010
-f65 4
-f66 9.900000000000000000000000000000
-f67 10
-f68 9.900000000000000000000000000000
-f69 0000000010
-f70 000000000000000000000000000000009.900000000000000000000000000000
-f71 0000000010
-f72 000000000000000000000000000000009.900000000000000000000000000000
-f73 -1.175494341e-38
-f74 1.175494361e-38
-f75 00000001.175494361e-38
-f76 00000001.175494361e-38
-f77 -1.175494341e-38
-f78 1.175494361e-38
-f79 00000001.175494361e-38
-f80 00000001.175494361e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494341e-38
-f95 1.17549e-38
-f96 1.175494361e-38
-f97 01.17549e-38
-f98 00000001.175494361e-38
-f99 01.17549e-38
-f100 00000001.175494361e-38
-f101 1000-01-10
-f102 838:59:49
-f103 1970-01-11 00:00:10
-f104 1970-01-11 00:00:10
-f105 1911
-f106 1911
-f107 1911
-f108 1enum
-f109 2set
-f59 15
-f60 87
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 17
-f60 15
-f61 0000000016
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 19
-f60 18
-f61 0000000014
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 22
-f60 93
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 24
-f60 51654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 27
-f60 25
-f61 0000000026
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 29
-f60 28
-f61 0000000024
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 34
-f60 41
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 94
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 100
-f60 4
-f61 0000000004
-f62 0000000000000000000000000000000000000000000000000000000000000004
-f63 0000000004
-f64 0000000000000000000000000000000000000000000000000000000000000004
-f65 -2
-f66 3.300000000000000000000000000000
-f67 4
-f68 3.300000000000000000000000000000
-f69 0000000004
-f70 000000000000000000000000000000003.300000000000000000000000000000
-f71 0000000004
-f72 000000000000000000000000000000003.300000000000000000000000000000
-f73 -1.175494347e-38
-f74 1.175494355e-38
-f75 00000001.175494355e-38
-f76 00000001.175494355e-38
-f77 -1.175494347e-38
-f78 1.175494355e-38
-f79 00000001.175494355e-38
-f80 00000001.175494355e-38
-f81 -1.17549e-38
-f82 1.17549e-38
-f83 01.17549e-38
-f84 01.17549e-38
-f85 -1.17549e-38
-f86 -1.17549e-38
-f87 1.17549e-38
-f88 1.17549e-38
-f89 01.17549e-38
-f90 01.17549e-38
-f91 01.17549e-38
-f92 01.17549e-38
-f93 -1.17549e-38
-f94 -1.175494347e-38
-f95 1.17549e-38
-f96 1.175494355e-38
-f97 01.17549e-38
-f98 00000001.175494355e-38
-f99 01.17549e-38
-f100 00000001.175494355e-38
-f101 1000-01-04
-f102 838:59:55
-f103 1970-01-05 00:00:04
-f104 1970-01-05 00:00:04
-f105 1905
-f106 1905
-f107 1905
-f108 1enum
-f109 2set
-f59 100
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 107
-f60 105
-f61 0000000106
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 107
-f60 105
-f61 0000000106
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 109
-f60 108
-f61 0000000104
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 109
-f60 108
-f61 0000000104
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 195
-f60 87
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 207
-f60 205
-f61 0000000206
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 209
-f60 208
-f61 0000000204
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 242
-f60 79
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 250
-f60 87895654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 292
-f60 93
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 299
-f60 899
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 321
-f60 NULL
-f61 0000000765
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 323
-f60 14376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 340
-f60 9984376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 394
-f60 41
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 424
-f60 89
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 441
-f60 16546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 500
-f60 NULL
-f61 0000000900
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 500
-f60 NULL
-f61 0000000900
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 500
-f60 NULL
-f61 0000000900
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 660
-f60 876546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 987
-f60 41
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 2550
-f60 775654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 2760
-f60 985654
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 3330
-f60 764376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 3410
-f60 996546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 7876
-f60 74
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 9112
-f60 NULL
-f61 0000008771
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 76710
-f60 226546
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 569300
-f60 9114376
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-drop view test.v1 ;
-CREATE VIEW test.v1 AS SELECT F59,f61 FROM test.tb2;
-SELECT * FROM test.v1 order by f59,f61 desc limit 20;
-F59 f61
-1 0000000001
-2 0000000002
-3 0000000003
-5 0000000005
-6 0000000006
-7 0000000007
-8 0000000008
-9 0000000009
-10 0000000010
-15 NULL
-17 0000000016
-19 0000000014
-22 NULL
-24 NULL
-27 0000000026
-29 0000000024
-34 NULL
-94 NULL
-100 0000000004
-100 NULL
-drop view test.v1 ;
-
-Testcase 3.3.1.54
---------------------------------------------------------------------------------
-USE test;
-drop table if exists test.t1 ;
-drop table if exists test.t2 ;
-drop view if exists test.v1 ;
-Create table t1 (f59 int, f60 int) ;
-Create table t2 (f59 int, f60 int) ;
-Insert into t1 values (1,10) ;
-Insert into t1 values (2,20) ;
-Insert into t1 values (47,80) ;
-Insert into t2 values (1,1000) ;
-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 order by f59 limit 50 ;
-f59 f60
-1 10
-2 20
-drop table test.t1 ;
-drop table test.t2 ;
-drop view test.v1 ;
-
-Testcase 3.3.1.50 - 3.3.1.54 additional implementation
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1 ;
-DROP VIEW IF EXISTS v1 ;
-CREATE TABLE t1 ( f1 BIGINT, f2 char(10), f3 DECIMAL(10,5) );
-INSERT INTO t1 VALUES(1, 'one', 1.1);
-INSERT INTO t1 VALUES(2, 'two', 2.2);
-INSERT INTO t1 VALUES(3, 'three', 3.3);
-CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1;
-SELECT * FROM v1;
-f1 f2 f3
-1 one 1.10000
-2 two 2.20000
-3 three 3.30000
-CREATE OR REPLACE VIEW v1 AS SELECT f2 FROM t1;
-SELECT * FROM v1;
-f2
-one
-two
-three
-CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1 WHERE f3 = 2.2;
-SELECT * FROM v1;
-f1 f2 f3
-2 two 2.20000
-CREATE OR REPLACE VIEW v1 AS SELECT f2 FROM t1 WHERE f3 = 2.2;
-SELECT * FROM v1;
-f2
-two
-SET sql_mode = 'traditional,ansi';
-CREATE OR REPLACE VIEW v1 AS
-SELECT f3 AS "pure column f3:", f1 + f3 AS "sum of columns f1 + f3 =",
-3 * (- 0.11111E+1) AS "product of constants 3 * (- 0.11111E+1):",
-'->' || CAST(f3 AS CHAR) || '<-'
- AS "expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR):"
-FROM t1 WHERE f1 = 2;
-CREATE OR REPLACE VIEW v1 AS
-SELECT f3 AS "pure column f3: ", f1 + f3 AS "sum of columns f1 + f3 = ",
-3 * (- 0.11111E+1) AS "product of constants 3 * (- 0.11111E+1): ",
-'->' || CAST(f3 AS CHAR) || '<-'
- AS "expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): "
-FROM t1 WHERE f1 = 2;
-ERROR 42000: Incorrect column name 'pure column f3: '
-SELECT * FROM v1;
-pure column f3: 2.20000
-sum of columns f1 + f3 = 4.20000
-product of constants 3 * (- 0.11111E+1): -3.3333
-expression with '||'=CONCAT and CAST(DECIMAL column AS CHAR): ->2.20000<-
-SET sql_mode = '';
-
-Testcases 3.3.1.55 - 3.3.1.62
---------------------------------------------------------------------------------
-Drop table if exists t1, t2 ;
-Drop view if exists v1 ;
-Create table t1 (f59 int, f60 char(10), f61 int, a char(1)) ;
-Insert into t1 values (1, 'single', 3, '1') ;
-Insert into t1 values (2, 'double', 6, '2') ;
-Insert into t1 values (3, 'single-f3', 4, '3') ;
-Create table t2 (f59 int, f60 char(10), f61 int, b char(1)) ;
-Insert into t2 values (2, 'double', 6, '2') ;
-Insert into t2 values (3, 'single-f3', 6, '3') ;
-Insert into t2 values (4, 'single', 4, '4') ;
-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 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
-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;
-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
-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 order by t1_f59,t2_f59;
-t1_f59 t2_f59
-1 2
-1 3
-1 4
-2 2
-2 3
-2 4
-3 2
-3 3
-3 4
-Select t1.f59 AS t1_f59, t2.f59 AS t2_f59
-FROM t2 cross join t1;
-t1_f59 t2_f59
-1 2
-1 3
-1 4
-2 2
-2 3
-2 4
-3 2
-3 3
-3 4
-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 order by t1_f59,t2_f59;
-t1_f59 t2_f59
-1 2
-1 3
-1 4
-2 2
-2 3
-2 4
-3 2
-3 3
-3 4
-Select straight_join t1.f59 AS t1_f59, t2.f59 AS t2_f59
-FROM t2,t1;
-t1_f59 t2_f59
-1 2
-1 3
-1 4
-2 2
-2 3
-2 4
-3 2
-3 3
-3 4
-Create or replace view test.v1 as
-Select f59, f60, f61, a, b
-FROM t2 natural join t1;
-Select * from v1 order by f59;
-f59 f60 f61 a b
-2 double 6 2 2
-Select f59, f60, f61, a, b
-FROM t2 natural join t1;
-f59 f60 f61 a b
-2 double 6 2 2
-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 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
-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;
-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
-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 order by f59;
-f59 f60 f61 a b
-2 double 6 2 2
-3 single-f3 6 NULL 3
-4 single 4 NULL 4
-Select f59, f60, f61, t1.a, t2.b
-FROM t2 natural left outer join t1;
-f59 f60 f61 a b
-2 double 6 2 2
-3 single-f3 6 NULL 3
-4 single 4 NULL 4
-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 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
-3 3 single-f3 single-f3 4 6
-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;
-t1_f59 t2_f59 t1_f60 t2_f60 t1_f61 t2_f61
-1 NULL single NULL 3 NULL
-2 2 double double 6 6
-3 3 single-f3 single-f3 4 6
-Create or replace view test.v1 as
-Select f59, f60, a, b
-FROM t2 natural right outer join t1;
-Select * from v1 order by f59 desc;
-f59 f60 a b
-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
-1 single 1 NULL
-2 double 2 2
-3 single-f3 3 NULL
-drop table t1, t2;
-drop view v1 ;
-Use test;
-
-Testcase 3.3.1.A1 - 3.3.1.A3
---------------------------------------------------------------------------------
-Drop table if exists t1 ;
-Drop view if exists v1;
-Create table t1 (f59 int, f60 int, f61 int) ;
-Insert into t1 values (101,201,301) ;
-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 order by f59 limit 0,10;
-f59
-1
-2
-3
-5
-6
-7
-8
-9
-10
-15
-Drop view if exists test.v1 ;
-Drop table if exists t1 ;
-Drop view if exists v1;
-Create table t1 (f59 int, f60 int, f61 int) ;
-Insert into t1 values (201,201,201) ;
-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 order by f59 limit 0,10;
-f59
-207
-Drop view if exists test.v1 ;
-Drop table if exists t1 ;
-Drop view if exists v1;
-Create table t1 (f59 int, f60 int, f61 int) ;
-Insert into t1 values (21,21,21) ;
-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 order by f59 limit 0,10;
-f59
-27
-Drop view test.v1 ;
-
-Testcase 3.3.1.63
---------------------------------------------------------------------------------
-Drop table if exists t1 ;
-Drop view if exists test.v1 ;
-Create table t1 (f59 int, f60 int, f61 int) ;
-Insert into t1 values (11,21,31) ;
-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 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 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 order by f59 limit 0,10;
-f59
-17
-Drop view test.v1 ;
-drop table if exists t1;
-drop view if exists test.v1;
-create table t1 (f59 int, f60 int, f61 int);
-insert into t1 values (101,201,301);
-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 order by f59 limit 0,10;
-f59
-107
-107
-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 order by f59 limit 0,10;
-f59
-107
-107
-107
-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 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 order by f59 limit 0,10;
-f59
-107
-drop view if exists test.v1 ;
-drop table t1;
-
-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 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 order by f59 limit 0,10;
-f59 242
-f60 79
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-Drop view test.v1 ;
-
-Testcase 3.3.1.65, 3.3.1.A4, 3.3.1.66, 3.3.1.67
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1;
-DROP VIEW IF EXISTS test.v1 ;
-CREATE TABLE t1 ( f1 VARCHAR(1000) ) ENGINE = ndb ;
-CREATE VIEW v1 AS SELECT f1 FROM t1;
-DROP VIEW v1;
-DROP VIEW v1;
-ERROR 42S02: Unknown table 'v1'
-CREATE VIEW v1 AS SELECT f1 FROM t1;
-DROP VIEW IF EXISTS v1;
-DROP VIEW IF EXISTS v1;
-Warnings:
-Note 1051 Unknown table 'test.v1'
-
-Testcase 3.3.1.68
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1;
-DROP VIEW IF EXISTS v1_base ;
-DROP VIEW IF EXISTS v1_top ;
-CREATE TABLE t1 ( f1 DOUBLE);
-CREATE VIEW v1_base AS SELECT * FROM t1;
-CREATE VIEW v1_top AS SELECT * FROM v1_base;
-DROP VIEW v1_top ;
-DROP VIEW v1_top;
-ERROR 42S02: Unknown table 'v1_top'
-CREATE VIEW v1_top AS SELECT * FROM v1_base;
-DROP VIEW v1_base ;
-DROP VIEW v1_base;
-ERROR 42S02: Unknown table 'v1_base'
-DROP VIEW v1_top;
-CREATE VIEW v1_base AS SELECT * FROM t1;
-CREATE VIEW v1_top AS SELECT * FROM v1_base;
-DROP VIEW v1_top CASCADE ;
-DROP VIEW v1_top;
-ERROR 42S02: Unknown table 'v1_top'
-CREATE VIEW v1_top AS SELECT * FROM v1_base;
-DROP VIEW v1_base CASCADE ;
-DROP VIEW v1_base;
-ERROR 42S02: Unknown table 'v1_base'
-DROP VIEW v1_top;
-CREATE VIEW v1_base AS SELECT * FROM t1;
-CREATE VIEW v1_top AS SELECT * FROM v1_base;
-DROP VIEW v1_top RESTRICT ;
-DROP VIEW v1_top;
-ERROR 42S02: Unknown table 'v1_top'
-CREATE VIEW v1_top AS SELECT * FROM v1_base;
-DROP VIEW v1_base RESTRICT ;
-DROP VIEW v1_base;
-ERROR 42S02: Unknown table 'v1_base'
-DROP VIEW v1_top;
-
-Testcase 3.3.1.69, 3.3.1.70, 3.3.1.A5
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1 ;
-DROP VIEW IF EXISTS v1 ;
-CREATE TABLE t1 (f59 INT, f60 INT, f61 INT) ENGINE = ndb;
-CREATE VIEW v1 AS SELECT * FROM t1;
-DROP VIEW v1 ;
-SELECT * FROM v1 ;
-ERROR 42S02: Table 'test.v1' doesn't exist
-SHOW CREATE VIEW v1 ;
-ERROR 42S02: Table 'test.v1' doesn't exist
-SHOW CREATE TABLE v1 ;
-ERROR 42S02: Table 'test.v1' doesn't exist
-SHOW TABLE STATUS like 'v1' ;
-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 TABLES LIKE 'v1';
-Tables_in_test (v1)
-SHOW COLUMNS FROM v1;
-ERROR 42S02: Table 'test.v1' doesn't exist
-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 status Operation failed
-DESCRIBE v1;
-ERROR 42S02: Table 'test.v1' doesn't exist
-EXPLAIN SELECT * FROM v1;
-ERROR 42S02: Table 'test.v1' doesn't exist
-Use test;
-
-Testcase 3.3.1.A6
---------------------------------------------------------------------------------
-DROP DATABASE IF EXISTS test3;
-CREATE DATABASE test3;
-CREATE TABLE test3.t1 (f1 DECIMAL(5,3)) ENGINE = ndb;
-INSERT INTO test3.t1 SET f1 = 1.0;
-CREATE VIEW test3.v0 AS SELECT * FROM test3.t1;
-CREATE VIEW test3.v1 AS SELECT * FROM test3.v0;
-CREATE VIEW test3.v2 AS SELECT * FROM test3.v1;
-CREATE VIEW test3.v3 AS SELECT * FROM test3.v2;
-CREATE VIEW test3.v4 AS SELECT * FROM test3.v3;
-CREATE VIEW test3.v5 AS SELECT * FROM test3.v4;
-CREATE VIEW test3.v6 AS SELECT * FROM test3.v5;
-CREATE VIEW test3.v7 AS SELECT * FROM test3.v6;
-CREATE VIEW test3.v8 AS SELECT * FROM test3.v7;
-CREATE VIEW test3.v9 AS SELECT * FROM test3.v8;
-CREATE VIEW test3.v10 AS SELECT * FROM test3.v9;
-CREATE VIEW test3.v11 AS SELECT * FROM test3.v10;
-CREATE VIEW test3.v12 AS SELECT * FROM test3.v11;
-CREATE VIEW test3.v13 AS SELECT * FROM test3.v12;
-CREATE VIEW test3.v14 AS SELECT * FROM test3.v13;
-CREATE VIEW test3.v15 AS SELECT * FROM test3.v14;
-CREATE VIEW test3.v16 AS SELECT * FROM test3.v15;
-CREATE VIEW test3.v17 AS SELECT * FROM test3.v16;
-CREATE VIEW test3.v18 AS SELECT * FROM test3.v17;
-CREATE VIEW test3.v19 AS SELECT * FROM test3.v18;
-CREATE VIEW test3.v20 AS SELECT * FROM test3.v19;
-CREATE VIEW test3.v21 AS SELECT * FROM test3.v20;
-CREATE VIEW test3.v22 AS SELECT * FROM test3.v21;
-CREATE VIEW test3.v23 AS SELECT * FROM test3.v22;
-CREATE VIEW test3.v24 AS SELECT * FROM test3.v23;
-CREATE VIEW test3.v25 AS SELECT * FROM test3.v24;
-CREATE VIEW test3.v26 AS SELECT * FROM test3.v25;
-CREATE VIEW test3.v27 AS SELECT * FROM test3.v26;
-CREATE VIEW test3.v28 AS SELECT * FROM test3.v27;
-CREATE VIEW test3.v29 AS SELECT * FROM test3.v28;
-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 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
-EXPLAIN SELECT * FROM test3.v32;
-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 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;
-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
-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 28 - hangs for higher values
-----------------------------------------------------------
-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.v27;
-DROP VIEW IF EXISTS test1.v26;
-DROP VIEW IF EXISTS test1.v25;
-DROP VIEW IF EXISTS test1.v24;
-DROP VIEW IF EXISTS test1.v23;
-DROP VIEW IF EXISTS test1.v22;
-DROP VIEW IF EXISTS test1.v21;
-DROP VIEW IF EXISTS test1.v20;
-DROP VIEW IF EXISTS test1.v19;
-DROP VIEW IF EXISTS test1.v18;
-DROP VIEW IF EXISTS test1.v17;
-DROP VIEW IF EXISTS test1.v16;
-DROP VIEW IF EXISTS test1.v15;
-DROP VIEW IF EXISTS test1.v14;
-DROP VIEW IF EXISTS test1.v13;
-DROP VIEW IF EXISTS test1.v12;
-DROP VIEW IF EXISTS test1.v11;
-DROP VIEW IF EXISTS test1.v10;
-DROP VIEW IF EXISTS test1.v9;
-DROP VIEW IF EXISTS test1.v8;
-DROP VIEW IF EXISTS test1.v7;
-DROP VIEW IF EXISTS test1.v6;
-DROP VIEW IF EXISTS test1.v5;
-DROP VIEW IF EXISTS test1.v4;
-DROP VIEW IF EXISTS test1.v3;
-DROP VIEW IF EXISTS test1.v2;
-DROP VIEW IF EXISTS test1.v1;
-DROP VIEW IF EXISTS test1.v0;
-CREATE DATABASE test3;
-USE test1;
-CREATE TABLE t1 (f1 BIGINT, f2 CHAR(50)) ENGINE = ndb ;
-INSERT INTO t1 VALUES (NULL, 'numeric column is NULL');
-INSERT INTO t1 VALUES (0, NULL);
-INSERT INTO t1 VALUES (5, 'five');
-INSERT INTO t1 VALUES (1, 'one');
-INSERT INTO t1 VALUES (2, 'two');
-USE test2;
-CREATE TABLE t1 (f1 DECIMAL(64,30), f2 VARCHAR(50)) ENGINE = ndb;
-INSERT INTO t1 VALUES (NULL, 'numeric column is NULL');
-INSERT INTO t1 VALUES (0.000000000000000000000000000000, NULL);
-INSERT INTO t1 VALUES (5.000000000000000000000000000000, 'five');
-INSERT INTO t1 VALUES (+1.000000000000000000000000000000, 'one');
-INSERT INTO t1 VALUES (3.000000000000000, 'three');
-USE test3;
-CREATE TABLE t1 (f1 DOUBLE, f2 VARBINARY(50)) ENGINE = ndb;
-INSERT INTO t1 VALUES (NULL, 'numeric column is NULL');
-INSERT INTO t1 VALUES (+0.0E-35, NULL);
-INSERT INTO t1 VALUES (+0.5E+1, 'five');
-INSERT INTO t1 VALUES (20.0E-1, 'two');
-INSERT INTO t1 VALUES (0.0300E2, 'three');
-USE test;
-CREATE OR REPLACE VIEW test1.v0 AS SELECT * FROM test2.t1;
-CREATE OR REPLACE VIEW test1.v1 AS SELECT f1, f2
-FROM test2.t1 tab1 NATURAL JOIN test1.v0 tab2;
-CREATE OR REPLACE VIEW test1.v2 AS SELECT f1, f2
-FROM test3.t1 tab1 NATURAL JOIN test1.v1 tab2;
-CREATE OR REPLACE VIEW test1.v3 AS SELECT f1, f2
-FROM test1.t1 tab1 NATURAL JOIN test1.v2 tab2;
-CREATE OR REPLACE VIEW test1.v4 AS SELECT f1, f2
-FROM test2.t1 tab1 NATURAL JOIN test1.v3 tab2;
-CREATE OR REPLACE VIEW test1.v5 AS SELECT f1, f2
-FROM test3.t1 tab1 NATURAL JOIN test1.v4 tab2;
-CREATE OR REPLACE VIEW test1.v6 AS SELECT f1, f2
-FROM test1.t1 tab1 NATURAL JOIN test1.v5 tab2;
-CREATE OR REPLACE VIEW test1.v7 AS SELECT f1, f2
-FROM test2.t1 tab1 NATURAL JOIN test1.v6 tab2;
-CREATE OR REPLACE VIEW test1.v8 AS SELECT f1, f2
-FROM test3.t1 tab1 NATURAL JOIN test1.v7 tab2;
-CREATE OR REPLACE VIEW test1.v9 AS SELECT f1, f2
-FROM test1.t1 tab1 NATURAL JOIN test1.v8 tab2;
-CREATE OR REPLACE VIEW test1.v10 AS SELECT f1, f2
-FROM test2.t1 tab1 NATURAL JOIN test1.v9 tab2;
-CREATE OR REPLACE VIEW test1.v11 AS SELECT f1, f2
-FROM test3.t1 tab1 NATURAL JOIN test1.v10 tab2;
-CREATE OR REPLACE VIEW test1.v12 AS SELECT f1, f2
-FROM test1.t1 tab1 NATURAL JOIN test1.v11 tab2;
-CREATE OR REPLACE VIEW test1.v13 AS SELECT f1, f2
-FROM test2.t1 tab1 NATURAL JOIN test1.v12 tab2;
-CREATE OR REPLACE VIEW test1.v14 AS SELECT f1, f2
-FROM test3.t1 tab1 NATURAL JOIN test1.v13 tab2;
-CREATE OR REPLACE VIEW test1.v15 AS SELECT f1, f2
-FROM test1.t1 tab1 NATURAL JOIN test1.v14 tab2;
-CREATE OR REPLACE VIEW test1.v16 AS SELECT f1, f2
-FROM test2.t1 tab1 NATURAL JOIN test1.v15 tab2;
-CREATE OR REPLACE VIEW test1.v17 AS SELECT f1, f2
-FROM test3.t1 tab1 NATURAL JOIN test1.v16 tab2;
-CREATE OR REPLACE VIEW test1.v18 AS SELECT f1, f2
-FROM test1.t1 tab1 NATURAL JOIN test1.v17 tab2;
-CREATE OR REPLACE VIEW test1.v19 AS SELECT f1, f2
-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;
-CREATE OR REPLACE VIEW test1.v21 AS SELECT f1, f2
-FROM test1.t1 tab1 NATURAL JOIN test1.v20 tab2;
-CREATE OR REPLACE VIEW test1.v22 AS SELECT f1, f2
-FROM test2.t1 tab1 NATURAL JOIN test1.v21 tab2;
-CREATE OR REPLACE VIEW test1.v23 AS SELECT f1, f2
-FROM test3.t1 tab1 NATURAL JOIN test1.v22 tab2;
-CREATE OR REPLACE VIEW test1.v24 AS SELECT f1, f2
-FROM test1.t1 tab1 NATURAL JOIN test1.v23 tab2;
-CREATE OR REPLACE VIEW test1.v25 AS SELECT f1, f2
-FROM test2.t1 tab1 NATURAL JOIN test1.v24 tab2;
-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;
-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.v27;
-f1 f2
-5 five
-
-The output of following EXPLAIN is deactivated, because the result
-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.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.v28;
-f1 f2
-5 five
-
-The output of following EXPLAIN is deactivated, because the result
-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.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.v27;
-SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-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.v27;
-CREATE OR REPLACE VIEW test3.v0 AS
-SELECT f1 , CONVERT('ßÄäÖöÜü§' USING UCS2) as f2 FROM test1.t1;
-SHOW CREATE VIEW test1.v27;
-SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-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.v27;
-CREATE OR REPLACE VIEW test3.v0 AS
-SELECT CONVERT('ßÄäÖöÜü§' USING UCS2) as f1, f2 FROM test1.t1;
-SHOW CREATE VIEW test1.v27;
-SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
-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.v27;
-DROP VIEW IF EXISTS test1.v27;
-DROP VIEW IF EXISTS test1.v26;
-DROP VIEW IF EXISTS test1.v25;
-DROP VIEW IF EXISTS test1.v24;
-DROP VIEW IF EXISTS test1.v23;
-DROP VIEW IF EXISTS test1.v22;
-DROP VIEW IF EXISTS test1.v21;
-DROP VIEW IF EXISTS test1.v20;
-DROP VIEW IF EXISTS test1.v19;
-DROP VIEW IF EXISTS test1.v18;
-DROP VIEW IF EXISTS test1.v17;
-DROP VIEW IF EXISTS test1.v16;
-DROP VIEW IF EXISTS test1.v15;
-DROP VIEW IF EXISTS test1.v14;
-DROP VIEW IF EXISTS test1.v13;
-DROP VIEW IF EXISTS test1.v12;
-DROP VIEW IF EXISTS test1.v11;
-DROP VIEW IF EXISTS test1.v10;
-DROP VIEW IF EXISTS test1.v9;
-DROP VIEW IF EXISTS test1.v8;
-DROP VIEW IF EXISTS test1.v7;
-DROP VIEW IF EXISTS test1.v6;
-DROP VIEW IF EXISTS test1.v5;
-DROP VIEW IF EXISTS test1.v4;
-DROP VIEW IF EXISTS test1.v3;
-DROP VIEW IF EXISTS test1.v2;
-DROP VIEW IF EXISTS test1.v1;
-DROP VIEW IF EXISTS test1.v0;
-DROP DATABASE test3;
-DROP TABLE test1.t1;
-DROP TABLE test2.t1;
-Use test;
-
-Testcase 3.3.2.1
---------------------------------------------------------------------------------
-Drop view if exists test.v1 ;
-Create View test.v1 AS SELECT f59,f60 FROM tb2 where f59 = 1995 ;
-INSERT INTO test.v1 (f59,f60) values (879,700) ;
-affected rows: 1
-SELECT f59,f60 FROM test.v1 where f59 = 879 and f60 = 700 ;
-f59 f60
-DELETE FROM tb2 where f59 = 879 and f60 = 700 ;
-Drop view test.v1 ;
-
-Testcase 3.3.2.2
---------------------------------------------------------------------------------
-Drop view if exists test.v1 ;
-Create view test.v1 AS SELECT f59,f60,f61 FROM tb2 ;
-INSERT INTO test.v1 ( f59 , f60 ) values (2005,0101) ;
-affected rows: 1
-SELECT * FROM tb2 where f59 = 2005 and f60 = 0101 ;
-f59 2005
-f60 101
-f61 NULL
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-SELECT f59,f60 FROM test.v1 where f59 = 2005 and f60 = 0101 ;
-f59 f60
-2005 101
-DELETE FROM tb2 where f59 = 2005 and f60 = 0101 ;
-Drop view test.v1 ;
-
-Testcase 3.3.2.3
---------------------------------------------------------------------------------
-Insert into tb2 (f59,f60,f61) values (780,105,106) ;
-Drop view if exists test.v1 ;
-CREATE VIEW test.v1 AS SELECT f59,f60,f61 FROM tb2 ;
-UPDATE test.v1 SET f59 = 8 WHERE f59 = 780 and f60 = 105;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-SELECT * FROM tb2 where f59 = 8 and f60 = 105;
-f59 8
-f60 105
-f61 0000000106
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-SELECT f59,f60 FROM test.v1 where f59 = 8 and f60 = 105 ;
-f59 f60
-8 105
-Drop view test.v1 ;
-
-Testcase 3.3.2.4
---------------------------------------------------------------------------------
-Insert into tb2 (f59,f60,f61) values (781,105,106) ;
-Drop view if exists test.v1 ;
-CREATE VIEW test.v1 AS SELECT f59,f60,f61 FROM tb2 ;
-UPDATE test.v1 SET f59 = 891 WHERE f60 = 105 ;
-affected rows: 4
-info: Rows matched: 4 Changed: 4 Warnings: 0
-SELECT * FROM tb2 where f59 = 891 and f60 = 105;
-f59 891
-f60 105
-f61 0000000106
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 891
-f60 105
-f61 0000000106
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 891
-f60 105
-f61 0000000106
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-f59 891
-f60 105
-f61 0000000106
-f62 NULL
-f63 NULL
-f64 NULL
-f65 NULL
-f66 NULL
-f67 NULL
-f68 NULL
-f69 NULL
-f70 NULL
-f71 NULL
-f72 NULL
-f73 NULL
-f74 NULL
-f75 NULL
-f76 NULL
-f77 7.7
-f78 7.7
-f79 00000000000000000007.7
-f80 00000000000000000008.8
-f81 8.8
-f82 8.8
-f83 0000000008.8
-f84 0000000008.8
-f85 8.8
-f86 8.8
-f87 8.8
-f88 8.8
-f89 0000000008.8
-f90 0000000008.8
-f91 0000000008.8
-f92 0000000008.8
-f93 8.8
-f94 8.8
-f95 8.8
-f96 8.8
-f97 0000000008.8
-f98 00000000000000000008.8
-f99 0000000008.8
-f100 00000000000000000008.8
-f101 2000-01-01
-f102 00:00:20
-f103 0002-02-02 00:00:00
-f104 2000-12-31 23:59:59
-f105 2000
-f106 2000
-f107 2000
-f108 1enum
-f109 1set
-SELECT f59,f60 FROM test.v1 where f59 = 891 and f60 = 105 ;
-f59 f60
-891 105
-891 105
-891 105
-891 105
-Drop view test.v1 ;
-
-Testcase 3.3.2.5
---------------------------------------------------------------------------------
-Insert into tb2 (f59,f60,f61) values (789,105,106) ;
-Drop view if exists test.v1 ;
-CREATE VIEW test.v1 AS SELECT f59,f60,f61 FROM tb2 where f59 = 789 ;
-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 order by f60 ;
-f59 f60
-Drop view test.v1 ;
-
-Testcase 3.3.2.6
---------------------------------------------------------------------------------
-Insert into tb2 (f59,f60,f61) values (711,105,106) ;
-Drop view if exists test.v1 ;
-CREATE VIEW test.v1 AS SELECT f59,f60,f61 FROM tb2 where f59 = 711 ;
-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 order by f60 ;
-f59 f60
-Drop view test.v1 ;
-
-Testcase 3.3.2.1 - 3.3.2.6 alternative implementation
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1;
-DROP VIEW IF EXISTS v1;
-CREATE TABLE t1 ( f1 BIGINT, f2 CHAR(20), f3 NUMERIC(7,4),
-f4 CHAR, PRIMARY KEY(f1));
-CREATE VIEW v1 AS SELECT f1, f2, f3 FROM t1;
-INSERT INTO v1 SET f1 = 1;
-SELECT * from t1;
-f1 f2 f3 f4
-1 NULL NULL NULL
-DELETE FROM t1;
-INSERT INTO v1 SET f2 = 'ABC';
-INSERT INTO v1 SET f2 = 'ABC';
-ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
-SELECT * from t1;
-f1 f2 f3 f4
-0 ABC NULL NULL
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-DELETE FROM v1 WHERE f1 = 1;
-SELECT * from t1;
-f1 f2 f3 f4
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-DELETE FROM v1 WHERE f2 = 'ABC';
-SELECT * from t1;
-f1 f2 f3 f4
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-DELETE FROM v1;
-SELECT * from t1;
-f1 f2 f3 f4
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f1 = 2 WHERE f1 = 1;
-SELECT * from t1;
-f1 f2 f3 f4
-2 ABC -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f1 = 2 WHERE f2 = 'ABC';
-SELECT * from t1;
-f1 f2 f3 f4
-2 ABC -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f1 = 2;
-SELECT * from t1;
-f1 f2 f3 f4
-2 ABC -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f2 = 'NNN' WHERE f1 = 1;
-SELECT * from t1;
-f1 f2 f3 f4
-1 NNN -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f2 = 'NNN' WHERE f2 = 'ABC';
-SELECT * from t1;
-f1 f2 f3 f4
-1 NNN -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f2 = 'NNN' WHERE f3 = -1.2E-3;
-SELECT * from t1;
-f1 f2 f3 f4
-1 NNN -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f2 = 'NNN';
-SELECT * from t1;
-f1 f2 f3 f4
-1 NNN -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f1 = 2, f2 = 'NNN' WHERE f1 = 1 AND f2 = 'ABC';
-SELECT * from t1;
-f1 f2 f3 f4
-2 NNN -0.0012 X
-DELETE FROM t1;
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
-INSERT INTO v1 SET f2 = 'ABC';
-INSERT INTO v1 SET f2 = 'ABC';
-ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
-SELECT * from t1;
-f1 f2 f3 f4
-0 ABC NULL NULL
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-DELETE FROM v1 WHERE f2 = 'ABC';
-SELECT * from t1;
-f1 f2 f3 f4
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-DELETE FROM v1;
-SELECT * from t1;
-f1 f2 f3 f4
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f2 = 'NNN' WHERE f2 = 'ABC';
-SELECT * from t1;
-f1 f2 f3 f4
-1 NNN -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f2 = 'NNN' WHERE f3 = -1.2E-3;
-SELECT * from t1;
-f1 f2 f3 f4
-1 NNN -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f2 = 'NNN';
-SELECT * from t1;
-f1 f2 f3 f4
-1 NNN -0.0012 X
-DELETE FROM t1;
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT f1, f2, f3, 'HELLO' AS my_greeting FROM t1;
-INSERT INTO v1 SET f1 = 1;
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-SELECT * from t1;
-f1 f2 f3 f4
-DELETE FROM t1;
-INSERT INTO v1 SET f1 = 1, my_greeting = 'HELLO';
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-SELECT * from t1;
-f1 f2 f3 f4
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-DELETE FROM v1 WHERE f1 = 1;
-SELECT * from t1;
-f1 f2 f3 f4
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-DELETE FROM v1 WHERE f2 = 'ABC';
-SELECT * from t1;
-f1 f2 f3 f4
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-DELETE FROM v1 WHERE my_greeting = 'HELLO';
-SELECT * from t1;
-f1 f2 f3 f4
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-DELETE FROM v1;
-SELECT * from t1;
-f1 f2 f3 f4
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f1 = 2 WHERE f1 = 1;
-SELECT * from t1;
-f1 f2 f3 f4
-2 ABC -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f1 = 2 WHERE f2 = 'ABC';
-SELECT * from t1;
-f1 f2 f3 f4
-2 ABC -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f1 = 2 WHERE my_greeting = 'HELLO';
-SELECT * from t1;
-f1 f2 f3 f4
-2 ABC -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f1 = 2;
-SELECT * from t1;
-f1 f2 f3 f4
-2 ABC -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f2 = 'NNN' WHERE f1 = 1;
-SELECT * from t1;
-f1 f2 f3 f4
-1 NNN -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f2 = 'NNN' WHERE f2 = 'ABC';
-SELECT * from t1;
-f1 f2 f3 f4
-1 NNN -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f2 = 'NNN' WHERE f3 = -1.2E-3;
-SELECT * from t1;
-f1 f2 f3 f4
-1 NNN -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f2 = 'NNN' WHERE my_greeting = 'HELLO';
-SELECT * from t1;
-f1 f2 f3 f4
-1 NNN -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f2 = 'NNN';
-SELECT * from t1;
-f1 f2 f3 f4
-1 NNN -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET my_greeting = 'Hej' WHERE f1 = 1;
-ERROR HY000: Column 'my_greeting' is not updatable
-SELECT * from t1;
-f1 f2 f3 f4
-1 ABC -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET my_greeting = 'Hej' WHERE f2 = 'ABC';
-ERROR HY000: Column 'my_greeting' is not updatable
-SELECT * from t1;
-f1 f2 f3 f4
-1 ABC -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET my_greeting = 'Hej' WHERE my_greeting = 'HELLO';
-ERROR HY000: Column 'my_greeting' is not updatable
-SELECT * from t1;
-f1 f2 f3 f4
-1 ABC -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET my_greeting = 'Hej';
-ERROR HY000: Column 'my_greeting' is not updatable
-SELECT * from t1;
-f1 f2 f3 f4
-1 ABC -0.0012 X
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f1 = 2, f2 = 'NNN' WHERE f1 = 1 AND f2 = 'ABC';
-SELECT * from t1;
-f1 f2 f3 f4
-2 NNN -0.0012 X
-DELETE FROM t1;
-DROP TABLE t1;
-SET sql_mode = 'traditional';
-CREATE TABLE t1 ( f1 BIGINT, f2 CHAR(20), f3 NUMERIC(7,4) NOT NULL,
-f4 CHAR, PRIMARY KEY(f1));
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT f1, f2, f4 FROM t1;
-INSERT INTO v1 SET f1 = 1;
-ERROR HY000: Field of view 'test.v1' underlying table doesn't have a default value
-SELECT * from t1;
-f1 f2 f3 f4
-DELETE FROM t1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-DELETE FROM v1 WHERE f1 = 1;
-INSERT INTO t1 VALUES(1, 'ABC', -1.2E-3, 'X');
-UPDATE v1 SET f4 = 'Y' WHERE f2 = 'ABC';
-SELECT * from t1;
-f1 f2 f3 f4
-1 ABC -0.0012 Y
-DELETE FROM t1;
-SET sql_mode = '';
-
-Testcases 3.3.2.7 - 3.3.2.9,
-3.3.2.10 - 3.3.2.11 omitted because of missing
-features EXCEPT and INTERSECT
---------------------------------------------------------------------------------
-INSERT INTO tb2 (f59,f60,f61) VALUES (77,185,126) ;
-INSERT INTO tb2 (f59,f60,f61) VALUES (59,58,54) ;
-DROP TABLE IF EXISTS t1 ;
-DROP VIEW IF EXISTS v1 ;
-CREATE TABLE t1 (f59 INT, f60 INT, f61 INT) ;
-INSERT INTO t1 VALUES (19,41,32) ;
-INSERT INTO t1 VALUES (59,54,71) ;
-INSERT INTO t1 VALUES (21,91,99) ;
-SET @variant1 = 'UNION ';
-SET @variant2 = 'UNION ALL ';
-SET @variant3 = 'UNION DISTINCT ';
-SET @variant4 = 'EXCEPT ';
-SET @variant5 = 'INTERSECT ';
-CREATE VIEW v1 AS SELECT f61 FROM tb2 WHERE f59=59 UNION DISTINCT SELECT f61 FROM t1 WHERE f59=19;
-INSERT INTO v1 VALUES (3000);
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-UPDATE v1 SET f61 = 100 WHERE f61 = 32;
-ERROR HY000: The target table v1 of the UPDATE is not updatable
-DELETE FROM v1;
-ERROR HY000: The target table v1 of the DELETE is not updatable
-DROP VIEW v1 ;
-CREATE VIEW v1 AS SELECT f61 FROM tb2 WHERE f59=59 UNION ALL SELECT f61 FROM t1 WHERE f59=19;
-INSERT INTO v1 VALUES (3000);
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-UPDATE v1 SET f61 = 100 WHERE f61 = 32;
-ERROR HY000: The target table v1 of the UPDATE is not updatable
-DELETE FROM v1;
-ERROR HY000: The target table v1 of the DELETE is not updatable
-DROP VIEW v1 ;
-CREATE VIEW v1 AS SELECT f61 FROM tb2 WHERE f59=59 UNION SELECT f61 FROM t1 WHERE f59=19;
-INSERT INTO v1 VALUES (3000);
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-UPDATE v1 SET f61 = 100 WHERE f61 = 32;
-ERROR HY000: The target table v1 of the UPDATE is not updatable
-DELETE FROM v1;
-ERROR HY000: The target table v1 of the DELETE is not updatable
-DROP VIEW v1 ;
-
-Testcases 3.3.2.12 - 3.3.2.20
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1, t2 ;
-DROP VIEW IF EXISTS test.v1 ;
-Drop view if exists v2 ;
-CREATE TABLE t1 (f59 int, f60 int, f61 int) ;
-INSERT INTO t1 VALUES (19,41,32) ;
-INSERT INTO t1 VALUES (59,54,71) ;
-INSERT INTO t1 VALUES (21,91,99) ;
-CREATE TABLE t2 (f59 int, f60 int, f61 int) ;
-INSERT INTO t2 VALUES (19,41,32) ;
-INSERT INTO t2 VALUES (59,54,71) ;
-INSERT INTO t2 VALUES (21,91,99) ;
-CREATE VIEW v2 AS SELECT f59, f60, f61 FROM t2 LIMIT 5;
-SET @variant1= 'CREATE VIEW v1 AS SELECT DISTINCT(f61) FROM t1';
-SET @variant2= 'CREATE VIEW v1 AS SELECT DISTINCTROW(f61) FROM t1';
-SET @variant3= 'CREATE VIEW v1 AS SELECT SUM(f59) AS f61 FROM t1';
-SET @variant4= 'CREATE VIEW v1 AS SELECT f61 FROM t1 GROUP BY f61';
-SET @variant5= 'CREATE VIEW v1 AS SELECT f61 FROM t1 HAVING f61 > 0';
-SET @variant6= 'CREATE VIEW v1 AS SELECT (SELECT f60 FROM t2 WHERE f59=19) AS f61 FROM t1';
-SET @variant7= 'CREATE VIEW v1 AS SELECT f61 FROM v2';
-SET @variant8= 'CREATE VIEW v1 AS SELECT f59 AS f61 FROM t1 WHERE f60 IN (SELECT f59 FROM t1)';
-SET @variant9= 'CREATE ALGORITHM = TEMPTABLE VIEW v1 (f61) AS select f60 from t1';
-CREATE ALGORITHM = TEMPTABLE VIEW v1 (f61) AS select f60 from t1;
-INSERT INTO v1 VALUES (1002);
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-UPDATE v1 SET f61=1007;
-ERROR HY000: The target table v1 of the UPDATE is not updatable
-DELETE FROM v1;
-ERROR HY000: The target table v1 of the DELETE is not updatable
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT f59 AS f61 FROM t1 WHERE f60 IN (SELECT f59 FROM t1);
-INSERT INTO v1 VALUES (1002);
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-UPDATE v1 SET f61=1007;
-ERROR HY000: The target table v1 of the UPDATE is not updatable
-DELETE FROM v1;
-ERROR HY000: The target table v1 of the DELETE is not updatable
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT f61 FROM v2;
-INSERT INTO v1 VALUES (1002);
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-UPDATE v1 SET f61=1007;
-ERROR HY000: The target table v1 of the UPDATE is not updatable
-DELETE FROM v1;
-ERROR HY000: The target table v1 of the DELETE is not updatable
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT (SELECT f60 FROM t2 WHERE f59=19) AS f61 FROM t1;
-INSERT INTO v1 VALUES (1002);
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-UPDATE v1 SET f61=1007;
-ERROR HY000: The target table v1 of the UPDATE is not updatable
-DELETE FROM v1;
-ERROR HY000: The target table v1 of the DELETE is not updatable
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT f61 FROM t1 HAVING f61 > 0;
-INSERT INTO v1 VALUES (1002);
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-UPDATE v1 SET f61=1007;
-ERROR HY000: The target table v1 of the UPDATE is not updatable
-DELETE FROM v1;
-ERROR HY000: The target table v1 of the DELETE is not updatable
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT f61 FROM t1 GROUP BY f61;
-INSERT INTO v1 VALUES (1002);
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-UPDATE v1 SET f61=1007;
-ERROR HY000: The target table v1 of the UPDATE is not updatable
-DELETE FROM v1;
-ERROR HY000: The target table v1 of the DELETE is not updatable
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT SUM(f59) AS f61 FROM t1;
-INSERT INTO v1 VALUES (1002);
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-UPDATE v1 SET f61=1007;
-ERROR HY000: The target table v1 of the UPDATE is not updatable
-DELETE FROM v1;
-ERROR HY000: The target table v1 of the DELETE is not updatable
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT DISTINCTROW(f61) FROM t1;
-INSERT INTO v1 VALUES (1002);
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-UPDATE v1 SET f61=1007;
-ERROR HY000: The target table v1 of the UPDATE is not updatable
-DELETE FROM v1;
-ERROR HY000: The target table v1 of the DELETE is not updatable
-DROP VIEW v1;
-CREATE VIEW v1 AS SELECT DISTINCT(f61) FROM t1;
-INSERT INTO v1 VALUES (1002);
-ERROR HY000: The target table v1 of the INSERT is not insertable-into
-UPDATE v1 SET f61=1007;
-ERROR HY000: The target table v1 of the UPDATE is not updatable
-DELETE FROM v1;
-ERROR HY000: The target table v1 of the DELETE is not updatable
-DROP VIEW v1;
-Drop TABLE t1, t2 ;
-Drop VIEW v2 ;
-
-Testcases 3.3.A1
---------------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
-DROP VIEW IF EXISTS v1;
-DROP VIEW IF EXISTS v2;
-CREATE TABLE t1 (f1 BIGINT, f2 DATE DEFAULT NULL, f4 CHAR(5),
-report char(10)) ENGINE = ndb;
-CREATE VIEW v1 AS SELECT * FROM t1;
-INSERT INTO t1 SET f1 = -1, f4 = 'ABC', report = 't1 0';
-INSERT INTO v1 SET f1 = -1, f4 = 'ABC', report = 'v1 0';
-DESCRIBE t1;
-Field Type Null Key Default Extra
-f1 bigint(20) YES NULL
-f2 date YES NULL
-f4 char(5) YES NULL
-report char(10) YES NULL
-DESCRIBE v1;
-Field Type Null Key Default Extra
-f1 bigint(20) YES NULL
-f2 date YES NULL
-f4 char(5) YES NULL
-report char(10) YES NULL
-SELECT * FROM t1 order by f1, report;
-f1 f2 f4 report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-SELECT * FROM v1 order by f1, report;
-f1 f2 f4 report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-ALTER TABLE t1 CHANGE COLUMN f4 f4x CHAR(5);
-INSERT INTO t1 SET f1 = 0, f4x = 'ABC', report = 't1 1';
-INSERT INTO v1 SET f1 = 0, f4 = 'ABC', report = 'v1 1';
-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
-INSERT INTO v1 SET f1 = 0, f4x = 'ABC', report = 'v1 1a';
-ERROR 42S22: Unknown column 'f4x' in 'field list'
-INSERT INTO v1 SET f1 = 0, report = 'v1 1b';
-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
-DESCRIBE t1;
-Field Type Null Key Default Extra
-f1 bigint(20) YES NULL
-f2 date YES NULL
-f4x char(5) YES NULL
-report char(10) YES NULL
-DESCRIBE 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
-SELECT * FROM t1 order by f1, report;
-f1 f2 f4x report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-0 NULL ABC t1 1
-SELECT * FROM v1 order by f1, report;
-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
-ALTER TABLE t1 CHANGE COLUMN f4x f4 CHAR(5);
-ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(10);
-INSERT INTO t1 SET f1 = 2, f4 = '<-- 10 -->', report = 't1 2';
-INSERT INTO v1 SET f1 = 2, f4 = '<-- 10 -->', report = 'v1 2';
-DESCRIBE t1;
-Field Type Null Key Default Extra
-f1 bigint(20) YES NULL
-f2 date YES NULL
-f4 char(10) YES NULL
-report char(10) YES NULL
-DESCRIBE v1;
-Field Type Null Key Default Extra
-f1 bigint(20) YES NULL
-f2 date YES NULL
-f4 char(10) YES NULL
-report char(10) YES NULL
-SELECT * FROM t1 order by f1, report;
-f1 f2 f4 report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-0 NULL ABC t1 1
-2 NULL <-- 10 --> t1 2
-2 NULL <-- 10 --> v1 2
-SELECT * FROM v1 order by f1, report;
-f1 f2 f4 report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-0 NULL ABC t1 1
-2 NULL <-- 10 --> t1 2
-2 NULL <-- 10 --> v1 2
-ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(8);
-Warnings:
-Warning 1265 Data truncated for column 'f4' at row <some number>
-Warning 1265 Data truncated for column 'f4' at row <some number>
-INSERT INTO t1 SET f1 = 3, f4 = '<-- 10 -->', report = 't1 3';
-Warnings:
-Warning 1265 Data truncated for column 'f4' at row 1
-INSERT INTO v1 SET f1 = 3, f4 = '<-- 10 -->', report = 'v1 3';
-Warnings:
-Warning 1265 Data truncated for column 'f4' at row 1
-DESCRIBE t1;
-Field Type Null Key Default Extra
-f1 bigint(20) YES NULL
-f2 date YES NULL
-f4 char(8) YES NULL
-report char(10) YES NULL
-DESCRIBE v1;
-Field Type Null Key Default Extra
-f1 bigint(20) YES NULL
-f2 date YES NULL
-f4 char(8) YES NULL
-report char(10) YES NULL
-SELECT * FROM t1 order by f1, report;
-f1 f2 f4 report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-0 NULL ABC t1 1
-2 NULL <-- 10 - t1 2
-2 NULL <-- 10 - v1 2
-3 NULL <-- 10 - t1 3
-3 NULL <-- 10 - v1 3
-SELECT * FROM v1 order by f1, report;
-f1 f2 f4 report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-0 NULL ABC t1 1
-2 NULL <-- 10 - t1 2
-2 NULL <-- 10 - v1 2
-3 NULL <-- 10 - t1 3
-3 NULL <-- 10 - v1 3
-ALTER TABLE t1 CHANGE COLUMN f4 f4 VARCHAR(20);
-INSERT INTO t1 SET f1 = 4, f4 = '<------ 20 -------->', report = 't1 4';
-INSERT INTO v1 SET f1 = 4, f4 = '<------ 20 -------->', report = 'v1 4';
-DESCRIBE t1;
-Field Type Null Key Default Extra
-f1 bigint(20) YES NULL
-f2 date YES NULL
-f4 varchar(20) YES NULL
-report char(10) YES NULL
-DESCRIBE v1;
-Field Type Null Key Default Extra
-f1 bigint(20) YES NULL
-f2 date YES NULL
-f4 varchar(20) YES NULL
-report char(10) YES NULL
-SELECT * FROM t1 order by f1, report;
-f1 f2 f4 report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-0 NULL ABC t1 1
-2 NULL <-- 10 - t1 2
-2 NULL <-- 10 - v1 2
-3 NULL <-- 10 - t1 3
-3 NULL <-- 10 - v1 3
-4 NULL <------ 20 --------> t1 4
-4 NULL <------ 20 --------> v1 4
-SELECT * FROM v1 order by f1, report;
-f1 f2 f4 report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-0 NULL ABC t1 1
-2 NULL <-- 10 - t1 2
-2 NULL <-- 10 - v1 2
-3 NULL <-- 10 - t1 3
-3 NULL <-- 10 - v1 3
-4 NULL <------ 20 --------> t1 4
-4 NULL <------ 20 --------> v1 4
-ALTER TABLE t1 CHANGE COLUMN f1 f1 VARCHAR(30);
-INSERT INTO t1 SET f1 = '<------------- 30 ----------->',
-f4 = '<------ 20 -------->', report = 't1 5';
-INSERT INTO v1 SET f1 = '<------------- 30 ----------->',
-f4 = '<------ 20 -------->', report = 'v1 5';
-DESCRIBE t1;
-Field Type Null Key Default Extra
-f1 varchar(30) YES NULL
-f2 date YES NULL
-f4 varchar(20) YES NULL
-report char(10) YES NULL
-DESCRIBE v1;
-Field Type Null Key Default Extra
-f1 varchar(30) YES NULL
-f2 date YES NULL
-f4 varchar(20) YES NULL
-report char(10) YES NULL
-SELECT * FROM t1 order by f1, report;
-f1 f2 f4 report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-0 NULL ABC t1 1
-2 NULL <-- 10 - t1 2
-2 NULL <-- 10 - v1 2
-3 NULL <-- 10 - t1 3
-3 NULL <-- 10 - v1 3
-4 NULL <------ 20 --------> t1 4
-4 NULL <------ 20 --------> v1 4
-<------------- 30 -----------> NULL <------ 20 --------> t1 5
-<------------- 30 -----------> NULL <------ 20 --------> v1 5
-SELECT * FROM v1 order by f1, report;
-f1 f2 f4 report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-0 NULL ABC t1 1
-2 NULL <-- 10 - t1 2
-2 NULL <-- 10 - v1 2
-3 NULL <-- 10 - t1 3
-3 NULL <-- 10 - v1 3
-4 NULL <------ 20 --------> t1 4
-4 NULL <------ 20 --------> v1 4
-<------------- 30 -----------> NULL <------ 20 --------> t1 5
-<------------- 30 -----------> NULL <------ 20 --------> v1 5
-ALTER TABLE t1 DROP COLUMN f2;
-INSERT INTO t1 SET f1 = 'ABC', f4 = '<------ 20 -------->', report = 't1 6';
-INSERT INTO v1 SET f1 = 'ABC', f4 = '<------ 20 -------->', report = 'v1 6';
-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
-DESCRIBE t1;
-Field Type Null Key Default Extra
-f1 varchar(30) YES NULL
-f4 varchar(20) YES NULL
-report char(10) YES NULL
-DESCRIBE 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
-SELECT * FROM t1 order by f1, report;
-f1 f4 report
--1 ABC t1 0
--1 ABC v1 0
-0 ABC t1 1
-2 <-- 10 - t1 2
-2 <-- 10 - v1 2
-3 <-- 10 - t1 3
-3 <-- 10 - v1 3
-4 <------ 20 --------> t1 4
-4 <------ 20 --------> v1 4
-<------------- 30 -----------> <------ 20 --------> t1 5
-<------------- 30 -----------> <------ 20 --------> v1 5
-ABC <------ 20 --------> t1 6
-SELECT * FROM v1 order by f1, report;
-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
-ALTER TABLE t1 ADD COLUMN f2 DATE DEFAULT NULL;
-INSERT INTO t1 SET f1 = 'ABC', f2 = '1500-12-04',
-f4 = '<------ 20 -------->', report = 't1 7';
-INSERT INTO v1 SET f1 = 'ABC', f2 = '1500-12-04',
-f4 = '<------ 20 -------->', report = 'v1 7';
-DESCRIBE t1;
-Field Type Null Key Default Extra
-f1 varchar(30) YES NULL
-f4 varchar(20) YES NULL
-report char(10) YES NULL
-f2 date YES NULL
-DESCRIBE v1;
-Field Type Null Key Default Extra
-f1 varchar(30) YES NULL
-f2 date YES NULL
-f4 varchar(20) YES NULL
-report char(10) YES NULL
-SELECT * FROM t1 order by f1, report;
-f1 f4 report f2
--1 ABC t1 0 NULL
--1 ABC v1 0 NULL
-0 ABC t1 1 NULL
-2 <-- 10 - t1 2 NULL
-2 <-- 10 - v1 2 NULL
-3 <-- 10 - t1 3 NULL
-3 <-- 10 - v1 3 NULL
-4 <------ 20 --------> t1 4 NULL
-4 <------ 20 --------> v1 4 NULL
-<------------- 30 -----------> <------ 20 --------> t1 5 NULL
-<------------- 30 -----------> <------ 20 --------> v1 5 NULL
-ABC <------ 20 --------> t1 6 NULL
-ABC <------ 20 --------> t1 7 1500-12-04
-ABC <------ 20 --------> v1 7 1500-12-04
-SELECT * FROM v1 order by f1, report;
-f1 f2 f4 report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-0 NULL ABC t1 1
-2 NULL <-- 10 - t1 2
-2 NULL <-- 10 - v1 2
-3 NULL <-- 10 - t1 3
-3 NULL <-- 10 - v1 3
-4 NULL <------ 20 --------> t1 4
-4 NULL <------ 20 --------> v1 4
-<------------- 30 -----------> NULL <------ 20 --------> t1 5
-<------------- 30 -----------> NULL <------ 20 --------> v1 5
-ABC NULL <------ 20 --------> t1 6
-ABC 1500-12-04 <------ 20 --------> t1 7
-ABC 1500-12-04 <------ 20 --------> v1 7
-ALTER TABLE t1 DROP COLUMN f2;
-ALTER TABLE t1 ADD COLUMN f2 FLOAT;
-INSERT INTO t1 SET f1 = 'ABC', f2 = -3.3E-4,
-f4 = '<------ 20 -------->', report = 't1 8';
-INSERT INTO v1 SET f1 = 'ABC', f2 = -3.3E-4,
-f4 = '<------ 20 -------->', report = 'v1 8';
-DESCRIBE t1;
-Field Type Null Key Default Extra
-f1 varchar(30) YES NULL
-f4 varchar(20) YES NULL
-report char(10) YES NULL
-f2 float YES NULL
-DESCRIBE v1;
-Field Type Null Key Default Extra
-f1 varchar(30) YES NULL
-f2 float YES NULL
-f4 varchar(20) YES NULL
-report char(10) YES NULL
-SELECT * FROM t1 order by f1, report;
-f1 f4 report f2
--1 ABC t1 0 NULL
--1 ABC v1 0 NULL
-0 ABC t1 1 NULL
-2 <-- 10 - t1 2 NULL
-2 <-- 10 - v1 2 NULL
-3 <-- 10 - t1 3 NULL
-3 <-- 10 - v1 3 NULL
-4 <------ 20 --------> t1 4 NULL
-4 <------ 20 --------> v1 4 NULL
-<------------- 30 -----------> <------ 20 --------> t1 5 NULL
-<------------- 30 -----------> <------ 20 --------> v1 5 NULL
-ABC <------ 20 --------> t1 6 NULL
-ABC <------ 20 --------> t1 7 NULL
-ABC <------ 20 --------> t1 8 -0.00033
-ABC <------ 20 --------> v1 7 NULL
-ABC <------ 20 --------> v1 8 -0.00033
-SELECT * FROM v1 order by f1, report;
-f1 f2 f4 report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-0 NULL ABC t1 1
-2 NULL <-- 10 - t1 2
-2 NULL <-- 10 - v1 2
-3 NULL <-- 10 - t1 3
-3 NULL <-- 10 - v1 3
-4 NULL <------ 20 --------> t1 4
-4 NULL <------ 20 --------> v1 4
-<------------- 30 -----------> NULL <------ 20 --------> t1 5
-<------------- 30 -----------> NULL <------ 20 --------> v1 5
-ABC NULL <------ 20 --------> t1 6
-ABC NULL <------ 20 --------> t1 7
-ABC -0.00033 <------ 20 --------> t1 8
-ABC NULL <------ 20 --------> v1 7
-ABC -0.00033 <------ 20 --------> v1 8
-ALTER TABLE t1 ADD COLUMN f3 NUMERIC(7,2);
-INSERT INTO t1 SET f1 = 'ABC', f2 = -3.3E-4,
-f3 = -2.2, f4 = '<------ 20 -------->', report = 't1 9';
-INSERT INTO v1 SET f1 = 'ABC', f2 = -3.3E-4,
-f3 = -2.2, f4 = '<------ 20 -------->', report = 'v1 9';
-ERROR 42S22: Unknown column 'f3' in 'field list'
-INSERT INTO v1 SET f1 = 'ABC', f2 = -3.3E-4,
-f4 = '<------ 20 -------->', report = 'v1 9a';
-DESCRIBE t1;
-Field Type Null Key Default Extra
-f1 varchar(30) YES NULL
-f4 varchar(20) YES NULL
-report char(10) YES NULL
-f2 float YES NULL
-f3 decimal(7,2) YES NULL
-DESCRIBE v1;
-Field Type Null Key Default Extra
-f1 varchar(30) YES NULL
-f2 float YES NULL
-f4 varchar(20) YES NULL
-report char(10) YES NULL
-SELECT * FROM t1 order by f1, report;
-f1 f4 report f2 f3
--1 ABC t1 0 NULL NULL
--1 ABC v1 0 NULL NULL
-0 ABC t1 1 NULL NULL
-2 <-- 10 - t1 2 NULL NULL
-2 <-- 10 - v1 2 NULL NULL
-3 <-- 10 - t1 3 NULL NULL
-3 <-- 10 - v1 3 NULL NULL
-4 <------ 20 --------> t1 4 NULL NULL
-4 <------ 20 --------> v1 4 NULL NULL
-<------------- 30 -----------> <------ 20 --------> t1 5 NULL NULL
-<------------- 30 -----------> <------ 20 --------> v1 5 NULL NULL
-ABC <------ 20 --------> t1 6 NULL NULL
-ABC <------ 20 --------> t1 7 NULL NULL
-ABC <------ 20 --------> t1 8 -0.00033 NULL
-ABC <------ 20 --------> t1 9 -0.00033 -2.20
-ABC <------ 20 --------> v1 7 NULL NULL
-ABC <------ 20 --------> v1 8 -0.00033 NULL
-ABC <------ 20 --------> v1 9a -0.00033 NULL
-SELECT * FROM v1 order by f1, report;
-f1 f2 f4 report
--1 NULL ABC t1 0
--1 NULL ABC v1 0
-0 NULL ABC t1 1
-2 NULL <-- 10 - t1 2
-2 NULL <-- 10 - v1 2
-3 NULL <-- 10 - t1 3
-3 NULL <-- 10 - v1 3
-4 NULL <------ 20 --------> t1 4
-4 NULL <------ 20 --------> v1 4
-<------------- 30 -----------> NULL <------ 20 --------> t1 5
-<------------- 30 -----------> NULL <------ 20 --------> v1 5
-ABC NULL <------ 20 --------> t1 6
-ABC NULL <------ 20 --------> t1 7
-ABC -0.00033 <------ 20 --------> t1 8
-ABC -0.00033 <------ 20 --------> t1 9
-ABC NULL <------ 20 --------> v1 7
-ABC -0.00033 <------ 20 --------> v1 8
-ABC -0.00033 <------ 20 --------> v1 9a
-DROP TABLE t1;
-DROP VIEW v1;
-CREATE TABLE t1 (f1 CHAR(10), f2 BIGINT) ENGINE = ndb;
-INSERT INTO t1 SET f1 = 'ABC', f2 = 3;
-CREATE VIEW v1 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
-DESCRIBE t1;
-Field Type Null Key Default Extra
-f1 char(10) YES NULL
-f2 bigint(20) YES NULL
-DESCRIBE v1;
-Field Type Null Key Default Extra
-f1 char(10) YES NULL
-my_sqrt double YES NULL
-SELECT * FROM t1 order by f1, f2;
-f1 f2
-ABC 3
-SELECT * FROM v1 order by 2;
-f1 my_sqrt
-ABC 1.7320508075688772
-ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
-INSERT INTO t1 SET f1 = 'ABC', f2 = 'DEF';
-DESCRIBE t1;
-Field Type Null Key Default Extra
-f1 char(10) YES NULL
-f2 varchar(30) YES NULL
-DESCRIBE v1;
-Field Type Null Key Default Extra
-f1 char(10) YES NULL
-my_sqrt double YES NULL
-SELECT * FROM t1 order by f1, f2;
-f1 f2
-ABC 3
-ABC DEF
-SELECT * FROM v1 order by 2;
-f1 my_sqrt
-ABC 0
-ABC 1.7320508075688772
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
-Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
-SELECT SQRT('DEF');
-SQRT('DEF')
-0
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
-CREATE VIEW v2 AS SELECT SQRT('DEF');
-SELECT * FROM v2 order by 1;
-SQRT('DEF')
-0
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
-CREATE OR REPLACE VIEW v2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
-DESCRIBE v2;
-Field Type Null Key Default Extra
-f1 char(10) YES NULL
-my_sqrt double YES NULL
-SELECT * FROM v2 order by 2;
-f1 my_sqrt
-ABC 0
-ABC 1.7320508075688772
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
-Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
-CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
-SELECT * FROM t2 order by 2;
-f1 ABC
-my_sqrt 0
-f1 ABC
-my_sqrt 1.7320508075688772
-DROP TABLE t2;
-CREATE TABLE t2 AS SELECT * FROM v1;
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
-SELECT * FROM t2 order by 2;
-f1 ABC
-my_sqrt 0
-f1 ABC
-my_sqrt 1.7320508075688772
-DROP TABLE t2;
-CREATE TABLE t2 AS SELECT * FROM v2;
-Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
-SELECT * FROM t2 order by 2;
-f1 ABC
-my_sqrt 0
-f1 ABC
-my_sqrt 1.7320508075688772
-DROP TABLE t1;
-DROP TABLE t2;
-DROP VIEW v1;
-DROP VIEW v2;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
-DROP VIEW IF EXISTS v1;
-DROP VIEW IF EXISTS v1_1;
-DROP VIEW IF EXISTS v1_2;
-DROP VIEW IF EXISTS v1_firstview;
-DROP VIEW IF EXISTS v1_secondview;
-DROP VIEW IF EXISTS v2;
-DROP DATABASE IF EXISTS test2;
-DROP DATABASE IF EXISTS test3;
-DROP DATABASE test1;
-DROP TABLE test.tb2;
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
index ec7a13f1df4..0e3511d2ad5 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
@@ -66,6 +66,7 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
SHOW GRANTS;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY 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;
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
index 36659ec9bd9..37ce8a3bf49 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
@@ -65,6 +65,7 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
SHOW GRANTS;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY 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;
diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
index 4ecca63351d..3e5ca055ae1 100644
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc
@@ -117,15 +117,15 @@ create user 'user_1'@'localhost';
grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
+--disable_warnings
+DROP PROCEDURE IF EXISTS db_storedproc_1.sp3;
+DROP FUNCTION IF EXISTS db_storedproc_1.fn1;
+--enable_warnings
+
# disconnect default;
connect (user2, localhost, user_1, , db_storedproc_1);
--source suite/funcs_1/include/show_connection.inc
---disable_warnings
-DROP PROCEDURE IF EXISTS sp3;
-DROP FUNCTION IF EXISTS fn1;
---enable_warnings
-
delimiter //;
CREATE PROCEDURE sp3(v1 char(20))
BEGIN
@@ -149,10 +149,6 @@ USE db_storedproc_1;
drop user 'user_1'@'localhost';
DROP PROCEDURE sp3;
-# This drop function shouldn't generated a warning as the
-# privileges should have been removed when the user was
-# dropped. Reported as Bug#36544 DROP USER does not remove
-# stored function privileges
DROP FUNCTION fn1;
diff --git a/mysql-test/suite/funcs_1/t/disabled.def b/mysql-test/suite/funcs_1/t/disabled.def
index 23f15b78103..9bfe9567d83 100644
--- a/mysql-test/suite/funcs_1/t/disabled.def
+++ b/mysql-test/suite/funcs_1/t/disabled.def
@@ -10,4 +10,3 @@
#
##############################################################################
-ndb_trig_1011ext: Bug#47564
diff --git a/mysql-test/suite/funcs_1/t/is_cml_ndb.test b/mysql-test/suite/funcs_1/t/is_cml_ndb.test
deleted file mode 100644
index 6d46424d14e..00000000000
--- a/mysql-test/suite/funcs_1/t/is_cml_ndb.test
+++ /dev/null
@@ -1,42 +0,0 @@
-# suite/funcs_1/t/is_cml_ndb.test
-#
-# Check the content of information_schema.columns about tables using
-# UNICODE columns.
-# Variant for storage engine NDB
-#
-# Author:
-# 2008-06-04 mleich Create this script based on older scripts and new code.
-#
-
---source include/have_ucs2.inc
-
-# This test cannot be used for the embedded server because privileges
-# are expected within result sets.
---source include/not_embedded.inc
-
---source include/have_ndb.inc
-let $engine_type= NDB;
-USE test;
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-eval CREATE TABLE t1
-(
- f1 CHAR UNICODE,
- f2 CHAR(0) UNICODE,
- f3 CHAR(10) UNICODE,
- f5 VARCHAR(0) UNICODE,
- f6 VARCHAR(255) UNICODE,
- f7 VARCHAR(260) UNICODE,
- f8 TEXT UNICODE,
- f9 TINYTEXT UNICODE,
- f10 MEDIUMTEXT UNICODE,
- f11 LONGTEXT UNICODE,
- PRIMARY KEY(f1)
-) ENGINE = $engine_type;
-
-# We look only for the tables created here.
-let $my_where = WHERE table_schema LIKE 'test%';
---source suite/funcs_1/datadict/columns.inc
-
-DROP TABLE t1;
diff --git a/mysql-test/suite/funcs_1/t/is_columns_ndb.test b/mysql-test/suite/funcs_1/t/is_columns_ndb.test
deleted file mode 100644
index 3d2a8d7aa5b..00000000000
--- a/mysql-test/suite/funcs_1/t/is_columns_ndb.test
+++ /dev/null
@@ -1,37 +0,0 @@
-# suite/funcs_1/t/is_columns_ndb.test
-#
-# Check the content of information_schema.columns about tables within
-# the databases created by the user.
-# Variant for storage engine ndb
-#
-# Author:
-# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
-# testsuite funcs_1
-# Create this script based on older scripts and new code.
-#
-
-# This test cannot be used for the embedded server because we check here
-# privileges.
---source include/not_embedded.inc
-
---source include/have_ndb.inc
-let $engine_type= ndb;
---source suite/funcs_1/datadict/datadict_load.inc
-
-# We look only for the tables created by datadict_load.inc.
-let $my_where = WHERE table_schema LIKE 'test%';
---source suite/funcs_1/datadict/columns.inc
-
-# This test runs with a different set of tables.
-# --source suite/funcs_1/include/cleanup.inc
-DROP DATABASE test1;
-DROP DATABASE test4;
-DROP TABLE test.t1;
-DROP TABLE test.t2;
-DROP TABLE test.t3;
-DROP TABLE test.t4;
-DROP TABLE test.t7;
-DROP TABLE test.t8;
-DROP TABLE test.t9;
-DROP TABLE test.t10;
-DROP TABLE test.t11;
diff --git a/mysql-test/suite/funcs_1/t/is_engines_ndb.test b/mysql-test/suite/funcs_1/t/is_engines_ndb.test
deleted file mode 100644
index bf9af8510a8..00000000000
--- a/mysql-test/suite/funcs_1/t/is_engines_ndb.test
+++ /dev/null
@@ -1,15 +0,0 @@
-# suite/funcs_1/t/is_engines_ndb.test
-#
-# Check the content of information_schema.engines
-# Variant for storage engine NDB
-#
-# Author:
-# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
-# testsuite funcs_1
-#
-
-let $engine_type= ndbcluster;
---source include/have_ndb.inc
---vertical_results
-eval SELECT * FROM information_schema.engines
-WHERE ENGINE = '$engine_type';
diff --git a/mysql-test/suite/funcs_1/t/is_tables_ndb.test b/mysql-test/suite/funcs_1/t/is_tables_ndb.test
deleted file mode 100644
index d21831b75c8..00000000000
--- a/mysql-test/suite/funcs_1/t/is_tables_ndb.test
+++ /dev/null
@@ -1,22 +0,0 @@
-# suite/funcs_1/t/is_tables_ndb.test
-#
-# Check the content of information_schema.tables about tables within
-# the databases created by the user.
-# Variant for storage engine NDB
-#
-# Author:
-# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
-# testsuite funcs_1
-# Create this script based on older scripts and new code.
-#
-
-# This test cannot be used for the embedded server because we check here
-# privileges.
---source include/not_embedded.inc
-
---source include/have_ndb.inc
-let $engine_type= NDB;
-
-# We look only for the tables created by suite/funcs_1/datadict/tables.inc
-let $my_where = WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE';
---source suite/funcs_1/datadict/tables.inc
diff --git a/mysql-test/suite/funcs_1/t/is_user_privileges.test b/mysql-test/suite/funcs_1/t/is_user_privileges.test
index 253323af9a7..0f0e398d75b 100644
--- a/mysql-test/suite/funcs_1/t/is_user_privileges.test
+++ b/mysql-test/suite/funcs_1/t/is_user_privileges.test
@@ -104,20 +104,26 @@ ORDER BY grantee, table_catalog, privilege_type;
let $my_select2= SELECT * FROM mysql.user
WHERE user LIKE 'testuser%' ORDER BY host, user;
let $my_show= SHOW GRANTS;
+--vertical_results
eval $my_select1;
eval $my_select2;
+--horizontal_results
--echo #
--echo # Add GRANT OPTION db_datadict.* to testuser1;
GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
+--vertical_results
eval $my_select1;
eval $my_select2;
+--horizontal_results
--echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
+--vertical_results
eval $my_select1;
eval $my_select2;
+--horizontal_results
eval $my_show;
--echo
@@ -128,36 +134,46 @@ connection default;
GRANT SELECT ON *.* TO 'testuser1'@'localhost';
--echo #
--echo # Here <SELECT NO> is shown correctly for testuser1;
+--vertical_results
eval $my_select1;
eval $my_select2;
+--horizontal_results
GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
--echo #
--echo # Here <SELECT YES> is shown correctly for testuser1;
+--vertical_results
eval $my_select1;
eval $my_select2;
+--horizontal_results
--echo # Switch to connection testuser1
# check that this appears
connection testuser1;
+--vertical_results
eval $my_select1;
eval $my_select2;
+--horizontal_results
eval $my_show;
--echo # Establish connection testuser2 (user=testuser2)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , db_datadict);
+--vertical_results
eval $my_select1;
--error ER_TABLEACCESS_DENIED_ERROR
eval $my_select2;
+--horizontal_results
eval $my_show;
--echo # Establish connection testuser3 (user=testuser3)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser3, localhost, testuser3, , test);
+--vertical_results
eval $my_select1;
--error ER_TABLEACCESS_DENIED_ERROR
eval $my_select2;
+--horizontal_results
eval $my_show;
--echo
@@ -165,23 +181,29 @@ eval $my_show;
--echo # Switch to connection default
connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost';
+--vertical_results
eval $my_select1;
eval $my_select2;
+--horizontal_results
--echo # Switch to connection testuser1
# check for changes
connection testuser1;
+--vertical_results
eval $my_select1;
--error ER_TABLEACCESS_DENIED_ERROR
eval $my_select2;
+--horizontal_results
eval $my_show;
# OK, testuser1 has no privs here
--error ER_TABLEACCESS_DENIED_ERROR
CREATE TABLE db_datadict.tb_55 ( c1 TEXT );
+--vertical_results
eval $my_select1;
--error ER_TABLEACCESS_DENIED_ERROR
eval $my_select2;
+--horizontal_results
eval $my_show;
# OK, testuser1 has no privs here
--error ER_TABLEACCESS_DENIED_ERROR
@@ -193,13 +215,17 @@ CREATE TABLE db_datadict.tb_66 ( c1 TEXT );
connection default;
GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
GRANT SELECT ON mysql.user TO 'testuser1'@'localhost';
+--vertical_results
eval $my_select1;
eval $my_select2;
+--horizontal_results
--echo # Switch to connection testuser1
connection testuser1;
+--vertical_results
eval $my_select1;
eval $my_select2;
+--horizontal_results
eval $my_show;
# OK, testuser1 has no privs here
@@ -208,8 +234,10 @@ CREATE TABLE db_datadict.tb_56 ( c1 TEXT );
# using 'USE' lets the server read the privileges new, so now the CREATE works
USE db_datadict;
+--vertical_results
eval $my_select1;
eval $my_select2;
+--horizontal_results
eval $my_show;
--replace_result $other_engine_type <other_engine_type>
eval
@@ -221,15 +249,19 @@ ENGINE = $other_engine_type;
--echo # Switch to connection default
connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost';
+--vertical_results
eval $my_select1;
eval $my_select2;
+--horizontal_results
--echo # Switch to connection testuser1
# check for changes
connection testuser1;
+--vertical_results
eval $my_select1;
--error ER_TABLEACCESS_DENIED_ERROR
eval $my_select2;
+--horizontal_results
eval $my_show;
# WORKS, as the existing old privileges are used!
--replace_result $other_engine_type <other_engine_type>
@@ -273,19 +305,27 @@ DROP DATABASE IF EXISTS db_datadict;
let $my_select = SELECT * FROM information_schema.user_privileges
WHERE grantee = '''testuser1''@''localhost''';
let $my_show = SHOW GRANTS FOR 'testuser1'@'localhost';
+--vertical_results
eval $my_select;
+--horizontal_results
--error ER_NONEXISTING_GRANT
eval $my_show;
--error 0,ER_CANNOT_USER
DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
+--vertical_results
eval $my_select;
+--horizontal_results
eval $my_show;
GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost';
+--vertical_results
eval $my_select;
+--horizontal_results
eval $my_show;
DROP USER 'testuser1'@'localhost';
+--vertical_results
eval $my_select;
+--horizontal_results
--error ER_NONEXISTING_GRANT
eval $my_show;
diff --git a/mysql-test/suite/funcs_1/t/myisam_views-big.test b/mysql-test/suite/funcs_1/t/myisam_views-big.test
new file mode 100644
index 00000000000..21613e78b24
--- /dev/null
+++ b/mysql-test/suite/funcs_1/t/myisam_views-big.test
@@ -0,0 +1,34 @@
+#### suite/funcs_1/t/myisam_views.test
+
+--source include/no_valgrind_without_big.inc
+# because of a pair of slow Solaris Sparc machines in pb2,
+# this test is marked as big:
+--source include/big_test.inc
+
+# MyISAM tables should be used
+#
+# Set $engine_type
+SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
+let $engine_type= myisam;
+
+# Create some objects needed in many testcases
+USE test;
+--source suite/funcs_1/include/myisam_tb2.inc
+--disable_warnings
+DROP DATABASE IF EXISTS test1;
+--enable_warnings
+CREATE DATABASE test1;
+USE test1;
+--source suite/funcs_1/include/myisam_tb2.inc
+USE test;
+
+let $message= Attention: The nesting level @max_level in Testcase 3.3.1.A6
+ (Complicated nested VIEWs) has to be limited to 20 because of
+ MyISAM(only) performance issues Bug#11948;
+--source include/show_msg80.inc
+SET @limit1 = 20;
+--source suite/funcs_1/views/views_master.inc
+
+DROP DATABASE test1;
+DROP TABLE test.tb2;
+
diff --git a/mysql-test/suite/funcs_1/t/myisam_views.test b/mysql-test/suite/funcs_1/t/myisam_views.test
deleted file mode 100644
index fe72843cfaf..00000000000
--- a/mysql-test/suite/funcs_1/t/myisam_views.test
+++ /dev/null
@@ -1,31 +0,0 @@
-#### suite/funcs_1/t/myisam_views.test
-
---source include/no_valgrind_without_big.inc
-
-# MyISAM tables should be used
-#
-# Set $engine_type
-SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
-let $engine_type= myisam;
-
-# Create some objects needed in many testcases
-USE test;
---source suite/funcs_1/include/myisam_tb2.inc
---disable_warnings
-DROP DATABASE IF EXISTS test1;
---enable_warnings
-CREATE DATABASE test1;
-USE test1;
---source suite/funcs_1/include/myisam_tb2.inc
-USE test;
-
-let $message= Attention: The nesting level @max_level in Testcase 3.3.1.A6
- (Complicated nested VIEWs) has to be limited to 20 because of
- MyISAM(only) performance issues Bug#11948;
---source include/show_msg80.inc
-SET @limit1 = 20;
---source suite/funcs_1/views/views_master.inc
-
-DROP DATABASE test1;
-DROP TABLE test.tb2;
-
diff --git a/mysql-test/suite/funcs_1/t/ndb_bitdata.test b/mysql-test/suite/funcs_1/t/ndb_bitdata.test
deleted file mode 100644
index f685a4abc6d..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_bitdata.test
+++ /dev/null
@@ -1,18 +0,0 @@
-#### suite/funcs_1/t/ndb_bitdata.test
-
-# NDB tables should be used
-#
-# 1. Check if InnoDB is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndb;
-
-let $message= NOT YET IMPLEMENTED: bitdata tests;
---source include/show_msg80.inc
-exit;
-
-# Create some objects needed in many testcases
-USE test;
---source suite/funcs_1/include/ndb_tb4.inc
-
---source suite/funcs_1/bitdata/bitdata_master.test
diff --git a/mysql-test/suite/funcs_1/t/ndb_cursors.test b/mysql-test/suite/funcs_1/t/ndb_cursors.test
deleted file mode 100644
index 6aeeb3f298d..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_cursors.test
+++ /dev/null
@@ -1,19 +0,0 @@
-#### suite/funcs_1/t/ndb_cursors.test
-
-# NDB tables should be used
-#
-# 1. Check if ndb is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndb;
-
-let $message= NOT YET IMPLEMENTED: cursor tests;
---source include/show_msg80.inc
-exit;
-
-# Create some objects needed in many testcases
-USE test;
---source suite/funcs_1/include/ndb_tb1.inc
-
---source suite/funcs_1/cursors/cursors_master.test
-
diff --git a/mysql-test/suite/funcs_1/t/ndb_func_view.test b/mysql-test/suite/funcs_1/t/ndb_func_view.test
deleted file mode 100644
index 183ebc7053c..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_func_view.test
+++ /dev/null
@@ -1,16 +0,0 @@
-###################################################
-# #
-# Functions within VIEWs based on ndb tables #
-# #
-###################################################
-
-#
-# NOTE: PLEASE SEE THE DETAILED DESCRIPTION IN
-# suite/funcs_1/views/func_view.inc
-# BEFORE ADDING NEW TEST CASES HERE !!!
-
-let $type= 'ndb' ;
---source include/have_ndb.inc
-
---source suite/funcs_1/views/func_view.inc
-
diff --git a/mysql-test/suite/funcs_1/t/ndb_storedproc_02.test b/mysql-test/suite/funcs_1/t/ndb_storedproc_02.test
deleted file mode 100644
index 9c701ece72f..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_storedproc_02.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#### suite/funcs_1/t/ndb_storedproc_02.test
-#
-# 1. Check if ndb is available
---source include/have_ndb.inc
-
-# 2. Set $engine_type
-let $engine_type= ndb;
-
---source suite/funcs_1/storedproc/storedproc_02.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_storedproc_03.test b/mysql-test/suite/funcs_1/t/ndb_storedproc_03.test
deleted file mode 100644
index 53c71932710..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_storedproc_03.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#### suite/funcs_1/t/ndb_storedproc_03.test
-#
-# 1. Check if nsd is available
---source include/have_ndb.inc
-
-# 2. Set $engine_type
-let $engine_type= ndb;
-
---source suite/funcs_1/storedproc/storedproc_03.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_storedproc_06.test b/mysql-test/suite/funcs_1/t/ndb_storedproc_06.test
deleted file mode 100644
index b8640391b02..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_storedproc_06.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#### suite/funcs_1/t/ndb_storedproc_06.test
-#
-# 1. Check if ndb is available
---source include/have_ndb.inc
-
-# 2. Set $engine_type
-let $engine_type= ndb;
-
---source suite/funcs_1/storedproc/storedproc_06.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_storedproc_07.test b/mysql-test/suite/funcs_1/t/ndb_storedproc_07.test
deleted file mode 100644
index f0ef9fed313..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_storedproc_07.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#### suite/funcs_1/t/ndb_storedproc_07.test
-#
-# 1. Check if ndb is available
---source include/have_ndb.inc
-
-# 2. Set $engine_type
-let $engine_type= ndb;
-
---source suite/funcs_1/storedproc/storedproc_07.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_storedproc_08.test b/mysql-test/suite/funcs_1/t/ndb_storedproc_08.test
deleted file mode 100644
index 21db9081822..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_storedproc_08.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#### suite/funcs_1/t/ndb_storedproc_08.test
-#
-# 1. Check if ndb is available
---source include/have_ndb.inc
-
-# 2. Set $engine_type
-let $engine_type= ndb;
-
---source suite/funcs_1/storedproc/storedproc_08.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_storedproc_10.test b/mysql-test/suite/funcs_1/t/ndb_storedproc_10.test
deleted file mode 100644
index 6f5888ad2d3..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_storedproc_10.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#### suite/funcs_1/t/ndb_storedproc_10.test
-#
-# 1. Check if ndb is available
---source include/have_ndb.inc
-
-# 2. Set $engine_type
-let $engine_type= ndb;
-
---source suite/funcs_1/storedproc/storedproc_10.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_trig_0102.test b/mysql-test/suite/funcs_1/t/ndb_trig_0102.test
deleted file mode 100644
index dd239ff5edb..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_trig_0102.test
+++ /dev/null
@@ -1,10 +0,0 @@
-#### suite/funcs_1/t/ndb_trig_0102.test
-
-# NDB tables should be used
-#
-# 1. Check if NDB is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndbcluster;
-
---source suite/funcs_1/triggers/triggers_0102.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_trig_03.test b/mysql-test/suite/funcs_1/t/ndb_trig_03.test
deleted file mode 100644
index 1f68bd05a80..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_trig_03.test
+++ /dev/null
@@ -1,10 +0,0 @@
-#### suite/funcs_1/t/ndb_trig_03.test
-
-# NDB tables should be used
-#
-# 1. Check if NDB is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndbcluster;
-
---source suite/funcs_1/triggers/triggers_03.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_trig_03e.test b/mysql-test/suite/funcs_1/t/ndb_trig_03e.test
deleted file mode 100644
index 2f0e3a7af51..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_trig_03e.test
+++ /dev/null
@@ -1,25 +0,0 @@
-#### suite/funcs_1/t/ndb_triggers.test
-
-# This test cannot be used for the embedded server because we check here
-# privileges.
---source include/not_embedded.inc
-
-# NDB tables should be used
-#
-# 1. Check if NDB is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndb;
-
-# Create some objects needed in many testcases
-USE test;
-
---source suite/funcs_1/triggers/triggers_03e_db_level.inc
---source suite/funcs_1/triggers/triggers_03e_table_level.inc
---source suite/funcs_1/triggers/triggers_03e_global_db_mix.inc
---source suite/funcs_1/triggers/triggers_03e_db_table_mix.inc
---source suite/funcs_1/triggers/triggers_03e_prepare.inc
---source suite/funcs_1/triggers/triggers_03e_definer.inc
---source suite/funcs_1/triggers/triggers_03e_transaction.inc
---source suite/funcs_1/triggers/triggers_03e_columns.inc
-
diff --git a/mysql-test/suite/funcs_1/t/ndb_trig_0407.test b/mysql-test/suite/funcs_1/t/ndb_trig_0407.test
deleted file mode 100644
index eccefd12dd9..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_trig_0407.test
+++ /dev/null
@@ -1,10 +0,0 @@
-#### suite/funcs_1/t/ndb_trig_0407.test
-
-# NDB tables should be used
-#
-# 1. Check if NDB is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndbcluster;
-
---source suite/funcs_1/triggers/triggers_0407.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_trig_08.test b/mysql-test/suite/funcs_1/t/ndb_trig_08.test
deleted file mode 100644
index e07c4fe7ec4..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_trig_08.test
+++ /dev/null
@@ -1,10 +0,0 @@
-#### suite/funcs_1/t/ndb_trig_08.test
-
-# NDB tables should be used
-#
-# 1. Check if NDB is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndbcluster;
-
---source suite/funcs_1/triggers/triggers_08.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_trig_09.test b/mysql-test/suite/funcs_1/t/ndb_trig_09.test
deleted file mode 100644
index 8def1d9eea1..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_trig_09.test
+++ /dev/null
@@ -1,10 +0,0 @@
-#### suite/funcs_1/t/ndb_trig_09.test
-
-# NDB tables should be used
-#
-# 1. Check if NDB is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndbcluster;
-
---source suite/funcs_1/triggers/triggers_09.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_trig_1011ext.test b/mysql-test/suite/funcs_1/t/ndb_trig_1011ext.test
deleted file mode 100644
index 729d5fee60b..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_trig_1011ext.test
+++ /dev/null
@@ -1,10 +0,0 @@
-#### suite/funcs_1/t/ndb_trig_1011ext.test
-
-# NDB tables should be used
-#
-# 1. Check if NDB is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndbcluster;
-
---source suite/funcs_1/triggers/triggers_1011ext.inc
diff --git a/mysql-test/suite/funcs_1/t/ndb_views.test b/mysql-test/suite/funcs_1/t/ndb_views.test
deleted file mode 100644
index 910b8adb189..00000000000
--- a/mysql-test/suite/funcs_1/t/ndb_views.test
+++ /dev/null
@@ -1,24 +0,0 @@
-#### suite/funcs_1/t/ndb_views.test
-
-# ndb tables should be used
-#
-# 1. Check if ndb is available
---source include/have_ndb.inc
-# 2. Set $engine_type
-let $engine_type= ndb;
-
-# Create some objects needed in many testcases
-USE test;
---source suite/funcs_1/include/ndb_tb2.inc
---disable_warnings
-DROP DATABASE IF EXISTS test1;
---enable_warnings
-CREATE DATABASE test1;
-USE test1;
---source suite/funcs_1/include/ndb_tb2.inc
-USE test;
-
---source suite/funcs_1/views/views_master.inc
-DROP DATABASE test1;
-DROP TABLE test.tb2;
-
diff --git a/mysql-test/suite/funcs_2/r/ndb_charset.result b/mysql-test/suite/funcs_2/r/ndb_charset.result
deleted file mode 100644
index 0a4dba2e302..00000000000
--- a/mysql-test/suite/funcs_2/r/ndb_charset.result
+++ /dev/null
@@ -1,119156 +0,0 @@
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-60 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-7E 1
-5A 1
-7A 1
-5D 1
-5B 1
-5C 1
-5E 1
-5F 1
-7B 1
-7C 1
-7D 1
-7F 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-A5 1
-B9 1
-C1 1
-C2 1
-C3 1
-C4 1
-E1 1
-E2 1
-E3 1
-E4 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-C8 1
-E8 1
-C6 1
-E6 1
-44 1
-64 1
-CF 1
-EF 1
-D0 1
-F0 1
-45 1
-65 1
-C9 1
-CA 1
-CB 1
-CC 1
-E9 1
-EA 1
-EB 1
-EC 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-CD 1
-CE 1
-ED 1
-EE 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-A3 1
-B3 1
-BC 1
-BE 1
-C5 1
-E5 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-D2 1
-F1 1
-F2 1
-4F 1
-6F 1
-D3 1
-D4 1
-D5 1
-D6 1
-F3 1
-F4 1
-F5 1
-F6 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-C0 1
-D8 1
-E0 1
-F8 1
-53 1
-73 1
-8C 1
-9C 1
-AA 1
-BA 1
-DF 1
-8A 1
-9A 1
-54 1
-74 1
-8D 1
-9D 1
-DE 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DD 1
-FD 1
-5A 1
-7A 1
-8F 1
-9F 1
-AF 1
-BF 1
-8E 1
-9E 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8B 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9B 1
-A0 1
-A1 1
-A2 1
-A4 1
-A6 1
-A7 1
-A8 1
-A9 1
-AB 1
-AC 1
-AD 1
-AE 1
-B0 1
-B1 1
-B2 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-BB 1
-BD 1
-D7 1
-F7 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-80 1
-81 1
-83 1
-88 1
-90 1
-98 1
-B6 1
-A0 1
-21 1
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-C1 1
-E1 1
-C2 1
-E2 1
-C3 1
-E3 1
-C4 1
-E4 1
-A5 1
-B9 1
-42 1
-62 1
-43 1
-63 1
-C6 1
-E6 1
-C7 1
-E7 1
-C8 1
-E8 1
-44 1
-64 1
-CF 1
-EF 1
-D0 1
-F0 1
-45 1
-65 1
-C9 1
-E9 1
-CC 1
-EC 1
-CB 1
-EB 1
-CA 1
-EA 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-CD 1
-ED 1
-CE 1
-EE 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-C5 1
-E5 1
-BC 1
-BE 1
-A3 1
-B3 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-D2 1
-F2 1
-4F 1
-6F 1
-D3 1
-F3 1
-D4 1
-F4 1
-D6 1
-F6 1
-D5 1
-F5 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-C0 1
-E0 1
-D8 1
-F8 1
-53 1
-73 1
-8C 1
-9C 1
-AA 1
-BA 1
-8A 1
-9A 1
-DF 1
-54 1
-74 1
-8D 1
-9D 1
-DE 1
-55 1
-75 1
-DA 1
-FA 1
-D9 1
-F9 1
-DC 1
-FC 1
-DB 1
-FB 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DD 1
-FD 1
-5A 1
-7A 1
-AF 1
-BF 1
-8F 1
-9F 1
-8E 1
-9E 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-82 1
-84 1
-85 1
-86 1
-87 1
-89 1
-8B 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-99 1
-9B 1
-A1 1
-A2 1
-A4 1
-A6 1
-A7 1
-A8 1
-A9 1
-AB 1
-AC 1
-AD 1
-AE 1
-B0 1
-B1 1
-B2 1
-B4 1
-B5 1
-B7 1
-B8 1
-BB 1
-BD 1
-D7 1
-F7 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-21 1
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-A5 1
-B9 1
-C1 1
-C2 1
-C3 1
-C4 1
-E1 1
-E2 1
-E3 1
-E4 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-C8 1
-E8 1
-C6 1
-E6 1
-44 1
-64 1
-CF 1
-EF 1
-D0 1
-F0 1
-45 1
-65 1
-C9 1
-CA 1
-CB 1
-CC 1
-E9 1
-EA 1
-EB 1
-EC 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-CD 1
-CE 1
-ED 1
-EE 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-A3 1
-B3 1
-BC 1
-BE 1
-C5 1
-E5 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-D2 1
-F1 1
-F2 1
-4F 1
-6F 1
-D3 1
-D4 1
-D5 1
-D6 1
-F3 1
-F4 1
-F5 1
-F6 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-C0 1
-D8 1
-E0 1
-F8 1
-53 1
-73 1
-A7 1
-AA 1
-BA 1
-DF 1
-8A 1
-8C 1
-9A 1
-9C 1
-54 1
-74 1
-8D 1
-9D 1
-DE 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DD 1
-FD 1
-5A 1
-7A 1
-8E 1
-8F 1
-9E 1
-9F 1
-AF 1
-BF 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8B 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9B 1
-A1 1
-A2 1
-A4 1
-A6 1
-A8 1
-A9 1
-AB 1
-AC 1
-AD 1
-AE 1
-B0 1
-B1 1
-B2 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-BB 1
-BD 1
-D7 1
-F7 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-C0 1
-E0 1
-C1 1
-E1 1
-C2 1
-E2 1
-C3 1
-E3 1
-C4 1
-E4 1
-C5 1
-E5 1
-A8 1
-B8 1
-C6 1
-E6 1
-C7 1
-E7 1
-C8 1
-E8 1
-C9 1
-E9 1
-CA 1
-EA 1
-CB 1
-EB 1
-CC 1
-EC 1
-CD 1
-ED 1
-CE 1
-EE 1
-CF 1
-EF 1
-D0 1
-F0 1
-D1 1
-F1 1
-D2 1
-F2 1
-D3 1
-F3 1
-D4 1
-F4 1
-D5 1
-F5 1
-D6 1
-F6 1
-D7 1
-F7 1
-D8 1
-F8 1
-D9 1
-F9 1
-DA 1
-FA 1
-DB 1
-FB 1
-DC 1
-FC 1
-DD 1
-FD 1
-DE 1
-DF 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-C0 1
-E0 1
-C1 1
-E1 1
-C2 1
-E2 1
-C3 1
-E3 1
-A5 1
-B4 1
-C4 1
-E4 1
-80 1
-90 1
-81 1
-83 1
-C5 1
-E5 1
-A8 1
-B8 1
-AA 1
-BA 1
-C6 1
-E6 1
-C7 1
-E7 1
-BD 1
-BE 1
-C8 1
-E8 1
-B2 1
-B3 1
-AF 1
-BF 1
-C9 1
-E9 1
-A3 1
-BC 1
-CA 1
-EA 1
-8D 1
-9D 1
-CB 1
-EB 1
-8A 1
-9A 1
-CC 1
-EC 1
-CD 1
-ED 1
-8C 1
-9C 1
-CE 1
-EE 1
-CF 1
-EF 1
-D0 1
-F0 1
-D1 1
-F1 1
-D2 1
-F2 1
-8E 1
-9E 1
-D3 1
-F3 1
-A1 1
-A2 1
-D4 1
-F4 1
-D5 1
-F5 1
-D6 1
-F6 1
-D7 1
-F7 1
-8F 1
-9F 1
-D8 1
-F8 1
-D9 1
-F9 1
-DA 1
-FA 1
-DB 1
-FB 1
-DC 1
-FC 1
-DD 1
-FD 1
-DE 1
-DF 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-82 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8B 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9B 1
-A0 1
-A4 1
-A6 1
-A7 1
-A9 1
-AB 1
-AC 1
-AD 1
-AE 1
-B0 1
-B1 1
-B5 1
-B6 1
-B7 1
-B9 1
-BB 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-C0 1
-E0 1
-C1 1
-E1 1
-C2 1
-E2 1
-C3 1
-E3 1
-A5 1
-B4 1
-C4 1
-E4 1
-80 1
-90 1
-81 1
-83 1
-C5 1
-E5 1
-A8 1
-B8 1
-AA 1
-BA 1
-C6 1
-E6 1
-C7 1
-E7 1
-BD 1
-BE 1
-C8 1
-E8 1
-B2 1
-B3 1
-AF 1
-BF 1
-C9 1
-E9 1
-A3 1
-BC 1
-CA 1
-EA 1
-8D 1
-9D 1
-CB 1
-EB 1
-8A 1
-9A 1
-CC 1
-EC 1
-CD 1
-ED 1
-8C 1
-9C 1
-CE 1
-EE 1
-CF 1
-EF 1
-D0 1
-F0 1
-D1 1
-F1 1
-D2 1
-F2 1
-8E 1
-9E 1
-D3 1
-F3 1
-A1 1
-A2 1
-D4 1
-F4 1
-D5 1
-F5 1
-D6 1
-F6 1
-D7 1
-F7 1
-8F 1
-9F 1
-D8 1
-F8 1
-D9 1
-F9 1
-DA 1
-FA 1
-DB 1
-FB 1
-DC 1
-FC 1
-DD 1
-FD 1
-DE 1
-DF 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-82 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8B 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9B 1
-A0 1
-A4 1
-A6 1
-A7 1
-A9 1
-AB 1
-AC 1
-AD 1
-AE 1
-B0 1
-B1 1
-B5 1
-B6 1
-B7 1
-B9 1
-BB 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-21 1
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-C0 1
-E0 1
-C1 1
-E1 1
-C2 1
-E2 1
-C3 1
-E3 1
-A5 1
-B4 1
-C4 1
-E4 1
-C5 1
-E5 1
-AA 1
-BA 1
-A8 1
-B8 1
-C6 1
-E6 1
-C7 1
-E7 1
-C8 1
-E8 1
-B2 1
-B3 1
-AF 1
-BF 1
-C9 1
-E9 1
-CA 1
-EA 1
-CB 1
-EB 1
-CC 1
-EC 1
-CD 1
-ED 1
-CE 1
-EE 1
-CF 1
-EF 1
-D0 1
-F0 1
-D1 1
-F1 1
-D2 1
-F2 1
-D3 1
-F3 1
-D4 1
-F4 1
-D5 1
-F5 1
-D6 1
-F6 1
-D7 1
-F7 1
-D8 1
-F8 1
-D9 1
-F9 1
-DA 1
-FA 1
-DB 1
-FB 1
-DC 1
-FC 1
-DD 1
-FD 1
-DE 1
-DF 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A6 1
-A7 1
-A9 1
-AB 1
-AC 1
-AD 1
-AE 1
-B0 1
-B1 1
-B5 1
-B6 1
-B7 1
-B9 1
-BB 1
-BC 1
-BD 1
-BE 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-E0 1
-E2 1
-42 1
-62 1
-43 1
-63 1
-E7 1
-44 1
-64 1
-45 1
-65 1
-E8 1
-E9 1
-EA 1
-EB 1
-46 1
-66 1
-83 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-EE 1
-EF 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-F4 1
-8C 1
-9C 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-F9 1
-FB 1
-FC 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-81 1
-CB 1
-CC 1
-8D 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-8E 1
-D3 1
-D4 1
-D5 1
-D6 1
-D8 1
-CA 1
-D9 1
-DA 1
-DB 1
-DD 1
-DE 1
-DF 1
-90 1
-E1 1
-E3 1
-E4 1
-E5 1
-E6 1
-EC 1
-ED 1
-DC 1
-F0 1
-F1 1
-F2 1
-F3 1
-F5 1
-F6 1
-F8 1
-FA 1
-A1 1
-BA 1
-BF 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-82 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8F 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9D 1
-9E 1
-9F 1
-A0 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BB 1
-BC 1
-BD 1
-BE 1
-C0 1
-D7 1
-F7 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-AF 1
-BF 1
-C0 1
-C2 1
-C4 1
-C5 1
-E0 1
-E2 1
-E4 1
-E5 1
-42 1
-62 1
-43 1
-63 1
-C3 1
-C8 1
-E3 1
-E8 1
-44 1
-64 1
-45 1
-65 1
-C6 1
-C7 1
-C9 1
-CB 1
-E6 1
-E7 1
-E9 1
-EB 1
-46 1
-66 1
-47 1
-67 1
-CC 1
-EC 1
-48 1
-68 1
-49 1
-69 1
-C1 1
-CE 1
-E1 1
-EE 1
-4A 1
-6A 1
-4B 1
-6B 1
-CD 1
-ED 1
-4C 1
-6C 1
-CF 1
-D9 1
-EF 1
-F9 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-D2 1
-F1 1
-F2 1
-4F 1
-6F 1
-A8 1
-B8 1
-D3 1
-D4 1
-D5 1
-D6 1
-F3 1
-F4 1
-F5 1
-F6 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-AA 1
-BA 1
-53 1
-73 1
-D0 1
-DA 1
-DF 1
-F0 1
-FA 1
-54 1
-74 1
-55 1
-75 1
-D8 1
-DB 1
-DC 1
-F8 1
-FB 1
-FC 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-CA 1
-DD 1
-DE 1
-EA 1
-FD 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-D7 1
-F7 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A9 1
-AB 1
-AC 1
-AD 1
-AE 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B9 1
-BB 1
-BC 1
-BD 1
-BE 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-C0 1
-42 1
-62 1
-43 1
-63 1
-C8 1
-E8 1
-44 1
-64 1
-45 1
-65 1
-C6 1
-E6 1
-CB 1
-EB 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-59 1
-79 1
-C1 1
-E1 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-D0 1
-F0 1
-54 1
-74 1
-55 1
-75 1
-DB 1
-FB 1
-D8 1
-F8 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-5A 1
-7A 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C2 1
-C3 1
-C4 1
-C5 1
-C7 1
-C9 1
-CA 1
-CC 1
-CD 1
-CE 1
-CF 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D9 1
-DA 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E2 1
-E3 1
-E4 1
-E5 1
-E7 1
-E9 1
-EA 1
-EC 1
-ED 1
-EE 1
-EF 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F9 1
-FA 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-85 1
-B7 1
-A0 1
-B5 1
-83 1
-B6 1
-C6 1
-C7 1
-84 1
-8E 1
-86 1
-8F 1
-91 1
-92 1
-42 1
-62 1
-43 1
-63 1
-80 1
-87 1
-44 1
-64 1
-D0 1
-D1 1
-45 1
-65 1
-8A 1
-D4 1
-82 1
-90 1
-88 1
-D2 1
-89 1
-D3 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-8D 1
-DE 1
-A1 1
-D6 1
-8C 1
-D7 1
-8B 1
-D8 1
-D5 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-A4 1
-A5 1
-4F 1
-6F 1
-95 1
-E3 1
-A2 1
-E0 1
-93 1
-E2 1
-E4 1
-E5 1
-94 1
-99 1
-9B 1
-9D 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-E1 1
-54 1
-74 1
-55 1
-75 1
-97 1
-EB 1
-A3 1
-E9 1
-96 1
-EA 1
-81 1
-9A 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-EC 1
-ED 1
-98 1
-5A 1
-7A 1
-E7 1
-E8 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-F7 1
-9E 1
-9F 1
-F6 1
-F2 1
-C4 1
-B3 1
-DA 1
-BF 1
-C0 1
-D9 1
-C3 1
-B4 1
-C2 1
-C1 1
-C5 1
-CD 1
-AD 1
-BA 1
-C9 1
-BB 1
-C8 1
-BC 1
-CC 1
-B9 1
-CB 1
-CA 1
-CE 1
-DF 1
-DC 1
-DB 1
-B0 1
-B1 1
-B2 1
-BD 1
-9C 1
-CF 1
-BE 1
-DD 1
-F5 1
-F9 1
-B8 1
-A6 1
-AE 1
-AA 1
-F0 1
-A9 1
-EE 1
-F8 1
-F1 1
-FD 1
-FC 1
-EF 1
-E6 1
-F4 1
-FA 1
-FB 1
-A7 1
-AF 1
-AC 1
-AB 1
-F3 1
-A8 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-83 1
-84 1
-8E 1
-A0 1
-A4 1
-A5 1
-B5 1
-B6 1
-C6 1
-C7 1
-42 1
-62 1
-43 1
-63 1
-80 1
-86 1
-87 1
-8F 1
-9F 1
-AC 1
-44 1
-64 1
-D0 1
-D1 1
-D2 1
-D4 1
-45 1
-65 1
-82 1
-89 1
-90 1
-A8 1
-A9 1
-B7 1
-D3 1
-D8 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-8C 1
-A1 1
-D6 1
-D7 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-88 1
-91 1
-92 1
-95 1
-96 1
-9D 1
-4D 1
-6D 1
-4E 1
-6E 1
-D5 1
-E3 1
-E4 1
-E5 1
-4F 1
-6F 1
-8A 1
-8B 1
-93 1
-94 1
-99 1
-A2 1
-E0 1
-E2 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-E8 1
-EA 1
-FC 1
-FD 1
-53 1
-73 1
-97 1
-98 1
-AD 1
-B8 1
-E6 1
-E7 1
-E1 1
-54 1
-74 1
-9B 1
-9C 1
-DD 1
-EE 1
-55 1
-75 1
-81 1
-85 1
-9A 1
-A3 1
-DE 1
-E9 1
-EB 1
-FB 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-EC 1
-ED 1
-5A 1
-7A 1
-8D 1
-A6 1
-A7 1
-AB 1
-BD 1
-BE 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-9E 1
-AA 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B9 1
-BA 1
-BB 1
-BC 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D9 1
-DA 1
-DB 1
-DC 1
-DF 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-80 1
-A0 1
-81 1
-A1 1
-82 1
-A2 1
-83 1
-A3 1
-84 1
-A4 1
-85 1
-A5 1
-F0 1
-F1 1
-F2 1
-F3 1
-86 1
-A6 1
-87 1
-A7 1
-88 1
-A8 1
-F4 1
-F5 1
-89 1
-A9 1
-8A 1
-AA 1
-8B 1
-AB 1
-8C 1
-AC 1
-8D 1
-AD 1
-8E 1
-AE 1
-8F 1
-AF 1
-90 1
-E0 1
-91 1
-E1 1
-92 1
-E2 1
-93 1
-E3 1
-F6 1
-F7 1
-94 1
-E4 1
-95 1
-E5 1
-96 1
-E6 1
-97 1
-E7 1
-98 1
-E8 1
-99 1
-E9 1
-9A 1
-EA 1
-9B 1
-EB 1
-9C 1
-EC 1
-9D 1
-ED 1
-9E 1
-EE 1
-9F 1
-EF 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-B0 1
-B1 1
-B2 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-C0 1
-C1 1
-C2 1
-C3 1
-E0 1
-E1 1
-E2 1
-E3 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-44 1
-64 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-4F 1
-6F 1
-D2 1
-D3 1
-D4 1
-D5 1
-F2 1
-F3 1
-F4 1
-F5 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-F9 1
-FA 1
-FB 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DC 1
-DD 1
-FC 1
-FD 1
-5A 1
-7A 1
-5B 1
-C5 1
-E5 1
-5C 1
-C4 1
-C6 1
-E4 1
-E6 1
-5D 1
-D6 1
-F6 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-D7 1
-D8 1
-F8 1
-DE 1
-DF 1
-F7 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-7E 1
-5A 1
-7A 1
-5D 1
-5B 1
-5C 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7F 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-7E 1
-5A 1
-7A 1
-5D 1
-5B 1
-5C 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7F 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-60 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B7 1
-BB 1
-BD 1
-B6 1
-C1 1
-DC 1
-E1 1
-C2 1
-E2 1
-C3 1
-E3 1
-C4 1
-E4 1
-B8 1
-C5 1
-DD 1
-E5 1
-C6 1
-E6 1
-B9 1
-C7 1
-DE 1
-E7 1
-C8 1
-E8 1
-BA 1
-C0 1
-C9 1
-DA 1
-DF 1
-E9 1
-FA 1
-CA 1
-EA 1
-CB 1
-EB 1
-CC 1
-EC 1
-CD 1
-ED 1
-CE 1
-EE 1
-BC 1
-CF 1
-EF 1
-FC 1
-D0 1
-F0 1
-D1 1
-F1 1
-D2 1
-D3 1
-F2 1
-F3 1
-D4 1
-F4 1
-BE 1
-D5 1
-DB 1
-E0 1
-F5 1
-FB 1
-FD 1
-D6 1
-F6 1
-D7 1
-F7 1
-D8 1
-F8 1
-BF 1
-D9 1
-F9 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-D7 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5D 1
-5B 1
-5C 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-84 1
-8E 1
-8F 1
-A0 1
-42 1
-62 1
-43 1
-63 1
-80 1
-87 1
-44 1
-64 1
-83 1
-85 1
-45 1
-65 1
-82 1
-88 1
-89 1
-90 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-8B 1
-A1 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-8A 1
-8C 1
-8D 1
-9C 1
-4D 1
-6D 1
-4E 1
-6E 1
-A4 1
-A5 1
-4F 1
-6F 1
-93 1
-94 1
-95 1
-99 1
-A2 1
-A7 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-9E 1
-A9 1
-AA 1
-AB 1
-53 1
-73 1
-9B 1
-A8 1
-E1 1
-54 1
-74 1
-86 1
-9F 1
-55 1
-75 1
-81 1
-96 1
-97 1
-9A 1
-A3 1
-A6 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-98 1
-9D 1
-5A 1
-7A 1
-91 1
-92 1
-E0 1
-EB 1
-EE 1
-E2 1
-EA 1
-E8 1
-ED 1
-E3 1
-E4 1
-E5 1
-E7 1
-E9 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E6 1
-EC 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C1 1
-E1 1
-C2 1
-E2 1
-D7 1
-F7 1
-C7 1
-E7 1
-C4 1
-E4 1
-C5 1
-E5 1
-A3 1
-B3 1
-D6 1
-F6 1
-DA 1
-FA 1
-C9 1
-E9 1
-CA 1
-EA 1
-CB 1
-EB 1
-CC 1
-EC 1
-CD 1
-ED 1
-CE 1
-EE 1
-CF 1
-EF 1
-D0 1
-F0 1
-D2 1
-F2 1
-D3 1
-F3 1
-D4 1
-F4 1
-D5 1
-F5 1
-C6 1
-E6 1
-C8 1
-E8 1
-C3 1
-E3 1
-DE 1
-DB 1
-FB 1
-DD 1
-FD 1
-DF 1
-D9 1
-F9 1
-D8 1
-F8 1
-DC 1
-FC 1
-C0 1
-E0 1
-D1 1
-F1 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-21 1
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-C1 1
-E1 1
-C2 1
-E2 1
-D7 1
-F7 1
-C7 1
-E7 1
-AD 1
-BD 1
-C4 1
-E4 1
-C5 1
-E5 1
-A4 1
-B4 1
-A3 1
-B3 1
-D6 1
-F6 1
-DA 1
-FA 1
-C9 1
-E9 1
-A6 1
-B6 1
-A7 1
-B7 1
-CA 1
-EA 1
-CB 1
-EB 1
-CC 1
-EC 1
-CD 1
-ED 1
-CE 1
-EE 1
-CF 1
-EF 1
-D0 1
-F0 1
-D2 1
-F2 1
-D3 1
-F3 1
-D4 1
-F4 1
-D5 1
-F5 1
-C6 1
-E6 1
-C8 1
-E8 1
-C3 1
-E3 1
-DE 1
-DB 1
-FB 1
-DD 1
-FD 1
-DF 1
-D9 1
-F9 1
-D8 1
-F8 1
-DC 1
-FC 1
-C0 1
-E0 1
-D1 1
-F1 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A5 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B5 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BE 1
-BF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-C0 1
-C1 1
-C2 1
-C3 1
-E0 1
-E1 1
-E2 1
-E3 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-44 1
-64 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-4F 1
-6F 1
-D2 1
-D3 1
-D4 1
-D5 1
-F2 1
-F3 1
-F4 1
-F5 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-F9 1
-FA 1
-FB 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DC 1
-DD 1
-FC 1
-FD 1
-5A 1
-7A 1
-5B 1
-C4 1
-C6 1
-E4 1
-E6 1
-5C 1
-D6 1
-D8 1
-F6 1
-F8 1
-5D 1
-C5 1
-E5 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-D7 1
-DE 1
-DF 1
-F7 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-C0 1
-E0 1
-C1 1
-E1 1
-C2 1
-E2 1
-C3 1
-E3 1
-C4 1
-E4 1
-C5 1
-E5 1
-C6 1
-E6 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-44 1
-64 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-E8 1
-C9 1
-E9 1
-CA 1
-EA 1
-CB 1
-EB 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-CC 1
-EC 1
-CD 1
-ED 1
-CE 1
-EE 1
-CF 1
-EF 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-4F 1
-6F 1
-D2 1
-F2 1
-D3 1
-F3 1
-D4 1
-F4 1
-D5 1
-F5 1
-D6 1
-F6 1
-D8 1
-F8 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-DF 1
-54 1
-74 1
-55 1
-75 1
-D9 1
-F9 1
-DA 1
-FA 1
-DB 1
-FB 1
-DC 1
-FC 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DD 1
-FD 1
-5A 1
-7A 1
-DE 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-D7 1
-F7 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-C0 1
-E0 1
-C1 1
-E1 1
-C2 1
-E2 1
-C3 1
-E3 1
-C4 1
-E4 1
-C5 1
-E5 1
-C6 1
-E6 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-44 1
-64 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-E8 1
-C9 1
-E9 1
-CA 1
-EA 1
-CB 1
-EB 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-CC 1
-EC 1
-CD 1
-ED 1
-CE 1
-EE 1
-CF 1
-EF 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-4F 1
-6F 1
-D2 1
-F2 1
-D3 1
-F3 1
-D4 1
-F4 1
-D5 1
-F5 1
-D6 1
-F6 1
-D8 1
-F8 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-DF 1
-54 1
-74 1
-55 1
-75 1
-D9 1
-F9 1
-DA 1
-FA 1
-DB 1
-FB 1
-DC 1
-FC 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DD 1
-FD 1
-5A 1
-7A 1
-DE 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-D7 1
-F7 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-44 1
-64 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-4F 1
-6F 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D8 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F8 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-DF 1
-54 1
-74 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DD 1
-FD 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-D0 1
-F0 1
-D7 1
-DE 1
-F7 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-C0 1
-C1 1
-C2 1
-C3 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E5 1
-C4 1
-E4 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-44 1
-64 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-4F 1
-6F 1
-D2 1
-D3 1
-D4 1
-D5 1
-F2 1
-F3 1
-F4 1
-F5 1
-D6 1
-F6 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-DF 1
-54 1
-74 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-F9 1
-FA 1
-FB 1
-DC 1
-FC 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DD 1
-FD 1
-5A 1
-7A 1
-5B 1
-5C 1
-C6 1
-E6 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-D7 1
-D8 1
-F8 1
-DE 1
-F7 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-44 1
-64 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-4F 1
-6F 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D8 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F8 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-DF 1
-54 1
-74 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DD 1
-FD 1
-5A 1
-7A 1
-DE 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-D7 1
-F7 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-C0 1
-C1 1
-C2 1
-C3 1
-E0 1
-E1 1
-E2 1
-E3 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-44 1
-64 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-4F 1
-6F 1
-D2 1
-D3 1
-D4 1
-D5 1
-F2 1
-F3 1
-F4 1
-F5 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-F9 1
-FA 1
-FB 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DC 1
-DD 1
-FC 1
-FD 1
-5A 1
-7A 1
-5B 1
-C5 1
-E5 1
-5C 1
-C4 1
-C6 1
-E4 1
-E6 1
-5D 1
-D6 1
-F6 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-D7 1
-D8 1
-F8 1
-DE 1
-DF 1
-F7 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-A1 1
-B1 1
-C1 1
-C2 1
-C3 1
-C4 1
-E1 1
-E2 1
-E3 1
-E4 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-C8 1
-E8 1
-C6 1
-E6 1
-44 1
-64 1
-CF 1
-EF 1
-D0 1
-F0 1
-45 1
-65 1
-C9 1
-CA 1
-CB 1
-CC 1
-E9 1
-EA 1
-EB 1
-EC 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-CD 1
-CE 1
-ED 1
-EE 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-A3 1
-A5 1
-B3 1
-B5 1
-C5 1
-E5 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-D2 1
-F1 1
-F2 1
-4F 1
-6F 1
-D3 1
-D4 1
-D5 1
-D6 1
-F3 1
-F4 1
-F5 1
-F6 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-C0 1
-D8 1
-E0 1
-F8 1
-53 1
-73 1
-A6 1
-AA 1
-B6 1
-BA 1
-DF 1
-A9 1
-B9 1
-54 1
-74 1
-AB 1
-BB 1
-DE 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DD 1
-FD 1
-5A 1
-7A 1
-AC 1
-AF 1
-BC 1
-BF 1
-AE 1
-BE 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A2 1
-A4 1
-A7 1
-A8 1
-AD 1
-B0 1
-B2 1
-B4 1
-B7 1
-B8 1
-BD 1
-D7 1
-F7 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-2C 1
-3B 1
-3F 1
-21 1
-3A 1
-22 1
-60 1
-27 1
-2F 1
-7C 1
-5C 1
-28 1
-29 1
-5B 1
-5D 1
-3C 1
-3E 1
-7B 1
-7D 1
-40 1
-26 1
-25 1
-23 1
-5E 1
-5F 1
-7E 1
-3D 1
-2B 1
-2A 1
-2D 1
-D7 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-24 1
-7F 1
-A0 1
-A2 1
-A4 1
-A7 1
-A8 1
-AD 1
-B0 1
-B2 1
-B4 1
-B7 1
-B8 1
-BD 1
-DF 1
-F7 1
-61 1
-41 1
-E1 1
-C1 1
-E2 1
-C2 1
-E4 1
-C4 1
-E3 1
-C3 1
-B1 1
-A1 1
-62 1
-42 1
-63 1
-43 1
-E8 1
-C8 1
-E6 1
-C6 1
-E7 1
-C7 1
-64 1
-44 1
-EF 1
-CF 1
-F0 1
-D0 1
-65 1
-45 1
-E9 1
-C9 1
-EC 1
-CC 1
-EB 1
-CB 1
-EA 1
-CA 1
-66 1
-46 1
-67 1
-47 1
-68 1
-48 1
-69 1
-49 1
-ED 1
-CD 1
-EE 1
-CE 1
-6A 1
-4A 1
-6B 1
-4B 1
-6C 1
-4C 1
-E5 1
-C5 1
-B5 1
-A5 1
-B3 1
-A3 1
-6D 1
-4D 1
-6E 1
-4E 1
-F2 1
-D2 1
-F1 1
-D1 1
-6F 1
-4F 1
-F3 1
-D3 1
-F4 1
-D4 1
-F6 1
-D6 1
-F5 1
-D5 1
-70 1
-50 1
-71 1
-51 1
-72 1
-52 1
-E0 1
-C0 1
-F8 1
-D8 1
-73 1
-53 1
-B9 1
-A9 1
-B6 1
-A6 1
-BA 1
-AA 1
-74 1
-54 1
-BB 1
-AB 1
-DE 1
-75 1
-55 1
-FA 1
-DA 1
-F9 1
-D9 1
-FC 1
-DC 1
-FB 1
-DB 1
-76 1
-56 1
-77 1
-57 1
-78 1
-58 1
-79 1
-59 1
-FD 1
-DD 1
-7A 1
-5A 1
-BE 1
-AE 1
-BC 1
-AC 1
-BF 1
-AF 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-A1 1
-B1 1
-C1 1
-C2 1
-C3 1
-C4 1
-E1 1
-E2 1
-E3 1
-E4 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-C6 1
-E6 1
-C8 1
-E8 1
-44 1
-64 1
-CF 1
-EF 1
-45 1
-65 1
-C9 1
-CB 1
-CC 1
-E9 1
-EB 1
-EC 1
-CA 1
-EA 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-CD 1
-CE 1
-ED 1
-EE 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-A5 1
-B5 1
-C5 1
-E5 1
-A3 1
-B3 1
-4D 1
-6D 1
-4E 1
-6E 1
-D2 1
-F2 1
-D1 1
-F1 1
-4F 1
-6F 1
-D4 1
-D5 1
-D6 1
-F4 1
-F5 1
-F6 1
-D3 1
-F3 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-C0 1
-D8 1
-E0 1
-F8 1
-53 1
-73 1
-AA 1
-BA 1
-A6 1
-B6 1
-A9 1
-B9 1
-54 1
-74 1
-AB 1
-BB 1
-DE 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DD 1
-FD 1
-5A 1
-7A 1
-AC 1
-BC 1
-AF 1
-BF 1
-AE 1
-BE 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A2 1
-A4 1
-A7 1
-A8 1
-AD 1
-B0 1
-B2 1
-B4 1
-B7 1
-B8 1
-BD 1
-D0 1
-D7 1
-DF 1
-F0 1
-F7 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-80 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8E 1
-91 1
-92 1
-9B 1
-9C 1
-9D 1
-9E 1
-21 1
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-8F 1
-A0 1
-B5 1
-C1 1
-E1 1
-B1 1
-C2 1
-E2 1
-C3 1
-E3 1
-C4 1
-E4 1
-42 1
-62 1
-43 1
-63 1
-C6 1
-E6 1
-C8 1
-E8 1
-C7 1
-E7 1
-44 1
-64 1
-CF 1
-EF 1
-45 1
-65 1
-82 1
-90 1
-C9 1
-E9 1
-CC 1
-EC 1
-CA 1
-EA 1
-CB 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-8C 1
-8D 1
-A1 1
-CD 1
-ED 1
-CE 1
-EE 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-B3 1
-A4 1
-C5 1
-E5 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-D2 1
-F2 1
-4F 1
-6F 1
-95 1
-A2 1
-D3 1
-E0 1
-F3 1
-D4 1
-F4 1
-8A 1
-8B 1
-93 1
-94 1
-99 1
-A7 1
-D5 1
-D6 1
-F5 1
-F6 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-C0 1
-D8 1
-F8 1
-53 1
-73 1
-A5 1
-B6 1
-A9 1
-B9 1
-AA 1
-BA 1
-54 1
-74 1
-AB 1
-BB 1
-DE 1
-55 1
-75 1
-97 1
-A3 1
-DA 1
-FA 1
-D9 1
-F9 1
-81 1
-96 1
-98 1
-9A 1
-DB 1
-DC 1
-EB 1
-FB 1
-FC 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-DD 1
-FD 1
-5A 1
-7A 1
-AC 1
-BC 1
-AE 1
-BE 1
-AF 1
-BF 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-9F 1
-A6 1
-A8 1
-AD 1
-B0 1
-B2 1
-B4 1
-B7 1
-B8 1
-BD 1
-D0 1
-D7 1
-DF 1
-F0 1
-F7 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-44 1
-64 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-46 1
-66 1
-47 1
-67 1
-D0 1
-F0 1
-48 1
-68 1
-49 1
-FD 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-DD 1
-EC 1
-ED 1
-EE 1
-EF 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-4F 1
-6F 1
-D2 1
-D3 1
-D4 1
-D5 1
-D8 1
-F2 1
-F3 1
-F4 1
-F5 1
-F8 1
-D6 1
-F6 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-DF 1
-DE 1
-54 1
-74 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-F9 1
-FA 1
-FB 1
-DC 1
-FC 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-D7 1
-F7 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-7F 1
-81 1
-83 1
-88 1
-8A 1
-8C 1
-90 1
-98 1
-9A 1
-9C 1
-9F 1
-27 1
-2D 1
-AD 1
-96 1
-97 1
-A0 1
-21 1
-22 1
-23 1
-24 1
-25 1
-26 1
-28 1
-29 1
-2A 1
-2C 1
-2E 1
-2F 1
-3A 1
-3B 1
-3F 1
-40 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-A6 1
-8D 1
-9D 1
-B4 1
-8F 1
-8E 1
-9E 1
-91 1
-92 1
-82 1
-93 1
-94 1
-84 1
-8B 1
-9B 1
-2B 1
-3C 1
-3D 1
-3E 1
-B1 1
-AB 1
-BB 1
-D7 1
-F7 1
-A2 1
-A3 1
-A4 1
-A7 1
-A9 1
-AC 1
-AE 1
-B0 1
-B5 1
-B6 1
-B7 1
-86 1
-87 1
-95 1
-85 1
-89 1
-30 1
-BC 1
-BD 1
-BE 1
-31 1
-B9 1
-32 1
-B2 1
-33 1
-B3 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-41 1
-61 1
-C2 1
-E2 1
-C5 1
-E5 1
-C0 1
-E0 1
-AF 1
-BF 1
-42 1
-62 1
-43 1
-63 1
-C3 1
-E3 1
-C8 1
-E8 1
-44 1
-64 1
-45 1
-65 1
-C9 1
-E9 1
-CB 1
-EB 1
-C7 1
-E7 1
-C6 1
-E6 1
-46 1
-66 1
-47 1
-67 1
-CC 1
-EC 1
-48 1
-68 1
-49 1
-69 1
-CE 1
-EE 1
-C1 1
-E1 1
-4A 1
-6A 1
-4B 1
-6B 1
-CD 1
-ED 1
-4C 1
-6C 1
-CF 1
-EF 1
-D9 1
-F9 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-D2 1
-F2 1
-4F 1
-6F 1
-D3 1
-F3 1
-D4 1
-F4 1
-A8 1
-B8 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-AA 1
-BA 1
-53 1
-73 1
-DA 1
-FA 1
-DF 1
-D0 1
-F0 1
-5A 1
-7A 1
-CA 1
-EA 1
-DD 1
-FD 1
-DE 1
-54 1
-74 1
-99 1
-55 1
-75 1
-DB 1
-FB 1
-D8 1
-F8 1
-56 1
-76 1
-57 1
-77 1
-D5 1
-F5 1
-C4 1
-E4 1
-D6 1
-F6 1
-DC 1
-FC 1
-58 1
-78 1
-59 1
-79 1
-A1 1
-A5 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-81 1
-83 1
-88 1
-8A 1
-8C 1
-90 1
-98 1
-9A 1
-9C 1
-9F 1
-27 1
-2D 1
-A8 1
-AD 1
-96 1
-97 1
-A0 1
-21 1
-22 1
-23 1
-24 1
-25 1
-26 1
-28 1
-29 1
-2A 1
-2C 1
-2E 1
-2F 1
-3A 1
-3B 1
-3F 1
-40 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-A6 1
-8D 1
-9D 1
-B4 1
-8F 1
-8E 1
-9E 1
-91 1
-92 1
-82 1
-93 1
-94 1
-84 1
-8B 1
-9B 1
-2B 1
-3C 1
-3D 1
-3E 1
-B1 1
-AB 1
-BB 1
-D7 1
-F7 1
-A2 1
-A3 1
-A4 1
-A7 1
-A9 1
-AC 1
-AE 1
-B0 1
-B5 1
-B6 1
-B7 1
-86 1
-87 1
-95 1
-85 1
-89 1
-80 1
-30 1
-BC 1
-BD 1
-BE 1
-31 1
-B9 1
-32 1
-B2 1
-33 1
-B3 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-41 1
-61 1
-C4 1
-E4 1
-C2 1
-E2 1
-C5 1
-E5 1
-C0 1
-E0 1
-AF 1
-BF 1
-42 1
-62 1
-43 1
-63 1
-C3 1
-E3 1
-C8 1
-E8 1
-44 1
-64 1
-45 1
-65 1
-C9 1
-E9 1
-CB 1
-EB 1
-C7 1
-E7 1
-C6 1
-E6 1
-46 1
-66 1
-47 1
-67 1
-CC 1
-EC 1
-48 1
-68 1
-49 1
-69 1
-CE 1
-EE 1
-C1 1
-E1 1
-4A 1
-6A 1
-4B 1
-6B 1
-CD 1
-ED 1
-4C 1
-6C 1
-D9 1
-F9 1
-CF 1
-EF 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-D2 1
-F2 1
-4F 1
-6F 1
-D3 1
-F3 1
-D6 1
-F6 1
-D4 1
-F4 1
-D5 1
-F5 1
-B8 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-AA 1
-BA 1
-53 1
-73 1
-DA 1
-FA 1
-DF 1
-D0 1
-F0 1
-74 1
-54 1
-99 1
-55 1
-75 1
-DC 1
-FC 1
-DB 1
-FB 1
-D8 1
-F8 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-CA 1
-EA 1
-DD 1
-FD 1
-DE 1
-A1 1
-A5 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-81 1
-83 1
-88 1
-8A 1
-8C 1
-90 1
-98 1
-9A 1
-9C 1
-9F 1
-27 1
-2D 1
-AD 1
-96 1
-97 1
-A0 1
-21 1
-22 1
-23 1
-24 1
-25 1
-26 1
-28 1
-29 1
-2A 1
-2C 1
-2E 1
-2F 1
-3A 1
-3B 1
-3F 1
-40 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-A6 1
-8D 1
-9D 1
-B4 1
-8F 1
-8E 1
-9E 1
-91 1
-92 1
-82 1
-93 1
-94 1
-84 1
-8B 1
-9B 1
-2B 1
-3C 1
-3D 1
-3E 1
-B1 1
-AB 1
-BB 1
-D7 1
-F7 1
-A2 1
-A3 1
-A4 1
-A7 1
-A9 1
-AC 1
-AE 1
-B0 1
-B5 1
-B6 1
-B7 1
-86 1
-87 1
-95 1
-85 1
-89 1
-80 1
-30 1
-BC 1
-BD 1
-BE 1
-31 1
-B9 1
-32 1
-B2 1
-33 1
-B3 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-41 1
-61 1
-C4 1
-E4 1
-C2 1
-E2 1
-C5 1
-E5 1
-C0 1
-E0 1
-AF 1
-BF 1
-42 1
-62 1
-43 1
-63 1
-C3 1
-E3 1
-C8 1
-E8 1
-44 1
-64 1
-45 1
-65 1
-C9 1
-E9 1
-CB 1
-EB 1
-C7 1
-E7 1
-C6 1
-E6 1
-46 1
-66 1
-47 1
-67 1
-CC 1
-EC 1
-48 1
-68 1
-49 1
-69 1
-CE 1
-EE 1
-C1 1
-E1 1
-4A 1
-6A 1
-4B 1
-6B 1
-CD 1
-ED 1
-4C 1
-6C 1
-D9 1
-F9 1
-CF 1
-EF 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-D2 1
-F2 1
-4F 1
-6F 1
-D3 1
-F3 1
-D6 1
-F6 1
-D4 1
-F4 1
-D5 1
-F5 1
-B8 1
-A8 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-AA 1
-BA 1
-53 1
-73 1
-DA 1
-FA 1
-DF 1
-D0 1
-F0 1
-54 1
-74 1
-99 1
-55 1
-75 1
-DC 1
-FC 1
-DB 1
-FB 1
-D8 1
-F8 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-CA 1
-EA 1
-DD 1
-FD 1
-DE 1
-A1 1
-A5 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-80 1
-81 1
-82 1
-84 1
-87 1
-88 1
-8A 1
-E7 1
-42 1
-62 1
-43 1
-63 1
-89 1
-8B 1
-8C 1
-8D 1
-44 1
-64 1
-91 1
-93 1
-45 1
-65 1
-83 1
-8E 1
-94 1
-95 1
-96 1
-98 1
-9D 1
-9E 1
-A2 1
-AB 1
-46 1
-66 1
-47 1
-67 1
-AE 1
-48 1
-68 1
-49 1
-69 1
-92 1
-AF 1
-B0 1
-B1 1
-B4 1
-EA 1
-4A 1
-6A 1
-4B 1
-6B 1
-B5 1
-FA 1
-4C 1
-6C 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-FC 1
-4D 1
-4E 1
-6D 1
-6E 1
-BF 1
-C0 1
-C1 1
-C4 1
-C5 1
-CB 1
-4F 1
-6F 1
-85 1
-97 1
-99 1
-9A 1
-9B 1
-CC 1
-CD 1
-CE 1
-CF 1
-D8 1
-EE 1
-EF 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-D9 1
-DA 1
-DB 1
-DE 1
-DF 1
-E0 1
-53 1
-73 1
-A7 1
-E1 1
-E4 1
-E5 1
-E6 1
-54 1
-74 1
-E8 1
-E9 1
-55 1
-75 1
-86 1
-9C 1
-9F 1
-ED 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-F8 1
-F9 1
-5A 1
-7A 1
-8F 1
-90 1
-EB 1
-EC 1
-FB 1
-FD 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-A0 1
-A1 1
-A3 1
-A4 1
-A5 1
-A6 1
-A8 1
-A9 1
-AA 1
-AC 1
-AD 1
-B2 1
-B3 1
-B6 1
-B7 1
-C2 1
-C3 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-DC 1
-DD 1
-E2 1
-E3 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-80 1
-81 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-CB 1
-CC 1
-E5 1
-E7 1
-AE 1
-BE 1
-42 1
-62 1
-43 1
-63 1
-82 1
-8D 1
-44 1
-64 1
-45 1
-65 1
-83 1
-8E 1
-8F 1
-90 1
-91 1
-E6 1
-E8 1
-E9 1
-46 1
-66 1
-C4 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-92 1
-93 1
-94 1
-95 1
-EA 1
-EB 1
-EC 1
-ED 1
-F5 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-84 1
-96 1
-4F 1
-6F 1
-85 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-AF 1
-BF 1
-CD 1
-EE 1
-EF 1
-F1 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-A7 1
-54 1
-74 1
-55 1
-75 1
-86 1
-9C 1
-9D 1
-9E 1
-9F 1
-F2 1
-F3 1
-F4 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-D8 1
-D9 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-C0 1
-C1 1
-C2 1
-C3 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-F0 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-40 1
-45 1
-60 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-5E 1
-79 1
-7E 1
-5A 1
-7A 1
-5D 1
-7D 1
-5B 1
-7B 1
-5C 1
-7C 1
-5F 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-EC 1
-F9 1
-E7 1
-FA 1
-E8 1
-FB 1
-E9 1
-FC 1
-EA 1
-FD 1
-EB 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-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 # # #
-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
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-42 1
-62 1
-43 1
-63 1
-44 1
-64 1
-45 1
-65 1
-46 1
-66 1
-47 1
-67 1
-48 1
-68 1
-49 1
-69 1
-4A 1
-6A 1
-4B 1
-6B 1
-4C 1
-6C 1
-4D 1
-6D 1
-4E 1
-6E 1
-4F 1
-6F 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-53 1
-73 1
-54 1
-74 1
-55 1
-75 1
-56 1
-76 1
-57 1
-77 1
-58 1
-78 1
-59 1
-79 1
-5A 1
-7A 1
-5B 1
-5C 1
-5D 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-21 1
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B5 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-C6 1
-C7 1
-C8 1
-C9 1
-CA 1
-CB 1
-CC 1
-CD 1
-CE 1
-CF 1
-D0 1
-D1 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-D7 1
-D8 1
-D9 1
-DA 1
-DB 1
-DC 1
-DD 1
-DE 1
-DF 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-E6 1
-E7 1
-E8 1
-E9 1
-EA 1
-EB 1
-EC 1
-ED 1
-EE 1
-EF 1
-F0 1
-F1 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-F7 1
-F8 1
-F9 1
-FA 1
-FB 1
-FC 1
-FD 1
-FE 1
-FF 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-10E 1
-10F 1
-110 1
-111 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-124 1
-125 1
-126 1
-127 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-131 1
-132 1
-133 1
-134 1
-135 1
-136 1
-137 1
-138 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-13F 1
-140 1
-141 1
-142 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-149 1
-14A 1
-14B 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-152 1
-153 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-160 1
-161 1
-162 1
-163 1
-164 1
-165 1
-166 1
-167 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-174 1
-175 1
-176 1
-177 1
-178 1
-179 1
-17A 1
-17B 1
-17C 1
-17D 1
-17E 1
-17F 1
-180 1
-181 1
-182 1
-183 1
-184 1
-185 1
-186 1
-187 1
-188 1
-189 1
-18A 1
-18B 1
-18C 1
-18D 1
-18E 1
-18F 1
-190 1
-191 1
-192 1
-193 1
-194 1
-195 1
-196 1
-197 1
-198 1
-199 1
-19A 1
-19B 1
-19C 1
-19D 1
-19E 1
-19F 1
-1A0 1
-1A1 1
-1A2 1
-1A3 1
-1A4 1
-1A5 1
-1A6 1
-1A7 1
-1A8 1
-1A9 1
-1AA 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-1AF 1
-1B0 1
-1B1 1
-1B2 1
-1B3 1
-1B4 1
-1B5 1
-1B6 1
-1B7 1
-1B8 1
-1B9 1
-1BA 1
-1BB 1
-1BC 1
-1BD 1
-1BE 1
-1BF 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-1C4 1
-1C5 1
-1C6 1
-1C7 1
-1C8 1
-1C9 1
-1CA 1
-1CB 1
-1CC 1
-1CD 1
-1CE 1
-1CF 1
-1D0 1
-1D1 1
-1D2 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-1DD 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1E2 1
-1E3 1
-1E4 1
-1E5 1
-1E6 1
-1E7 1
-1E8 1
-1E9 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-1EE 1
-1EF 1
-1F0 1
-1F1 1
-1F2 1
-1F3 1
-1F4 1
-1F5 1
-1F6 1
-1F7 1
-1F8 1
-1F9 1
-1FA 1
-1FB 1
-1FC 1
-1FD 1
-1FE 1
-1FF 1
-200 1
-201 1
-202 1
-203 1
-204 1
-205 1
-206 1
-207 1
-208 1
-209 1
-20A 1
-20B 1
-20C 1
-20D 1
-20E 1
-20F 1
-210 1
-211 1
-212 1
-213 1
-214 1
-215 1
-216 1
-217 1
-218 1
-219 1
-21A 1
-21B 1
-21C 1
-21D 1
-21E 1
-21F 1
-220 1
-221 1
-222 1
-223 1
-224 1
-225 1
-226 1
-227 1
-228 1
-229 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-232 1
-233 1
-234 1
-235 1
-236 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-250 1
-251 1
-252 1
-253 1
-254 1
-255 1
-256 1
-257 1
-258 1
-259 1
-25A 1
-25B 1
-25C 1
-25D 1
-25E 1
-25F 1
-260 1
-261 1
-262 1
-263 1
-264 1
-265 1
-266 1
-267 1
-268 1
-269 1
-26A 1
-26B 1
-26C 1
-26D 1
-26E 1
-26F 1
-270 1
-271 1
-272 1
-273 1
-274 1
-275 1
-276 1
-277 1
-278 1
-279 1
-27A 1
-27B 1
-27C 1
-27D 1
-27E 1
-27F 1
-280 1
-281 1
-282 1
-283 1
-284 1
-285 1
-286 1
-287 1
-288 1
-289 1
-28A 1
-28B 1
-28C 1
-28D 1
-28E 1
-28F 1
-290 1
-291 1
-292 1
-293 1
-294 1
-295 1
-296 1
-297 1
-298 1
-299 1
-29A 1
-29B 1
-29C 1
-29D 1
-29E 1
-29F 1
-2A0 1
-2A1 1
-2A2 1
-2A3 1
-2A4 1
-2A5 1
-2A6 1
-2A7 1
-2A8 1
-2A9 1
-2AA 1
-2AB 1
-2AC 1
-2AD 1
-2AE 1
-2AF 1
-2B0 1
-2B1 1
-2B2 1
-2B3 1
-2B4 1
-2B5 1
-2B6 1
-2B7 1
-2B8 1
-2B9 1
-2BA 1
-2BB 1
-2BC 1
-2BD 1
-2BE 1
-2BF 1
-2C0 1
-2C1 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D0 1
-2D1 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2D8 1
-2D9 1
-2DA 1
-2DB 1
-2DC 1
-2DD 1
-2DE 1
-2DF 1
-2E0 1
-2E1 1
-2E2 1
-2E3 1
-2E4 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EE 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-363 1
-364 1
-365 1
-366 1
-367 1
-368 1
-369 1
-36A 1
-36B 1
-36C 1
-36D 1
-36E 1
-36F 1
-370 1
-371 1
-372 1
-373 1
-374 1
-375 1
-376 1
-377 1
-378 1
-379 1
-37A 1
-37B 1
-37C 1
-37D 1
-37E 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-384 1
-385 1
-386 1
-387 1
-388 1
-389 1
-38A 1
-38B 1
-38C 1
-38D 1
-38E 1
-38F 1
-390 1
-391 1
-392 1
-393 1
-394 1
-395 1
-396 1
-397 1
-398 1
-399 1
-39A 1
-39B 1
-39C 1
-39D 1
-39E 1
-39F 1
-3A0 1
-3A1 1
-3A2 1
-3A3 1
-3A4 1
-3A5 1
-3A6 1
-3A7 1
-3A8 1
-3A9 1
-3AA 1
-3AB 1
-3AC 1
-3AD 1
-3AE 1
-3AF 1
-3B0 1
-3B1 1
-3B2 1
-3B3 1
-3B4 1
-3B5 1
-3B6 1
-3B7 1
-3B8 1
-3B9 1
-3BA 1
-3BB 1
-3BC 1
-3BD 1
-3BE 1
-3BF 1
-3C0 1
-3C1 1
-3C2 1
-3C3 1
-3C4 1
-3C5 1
-3C6 1
-3C7 1
-3C8 1
-3C9 1
-3CA 1
-3CB 1
-3CC 1
-3CD 1
-3CE 1
-3CF 1
-3D0 1
-3D1 1
-3D2 1
-3D3 1
-3D4 1
-3D5 1
-3D6 1
-3D7 1
-3D8 1
-3D9 1
-3DA 1
-3DB 1
-3DC 1
-3DD 1
-3DE 1
-3DF 1
-3E0 1
-3E1 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-3F0 1
-3F1 1
-3F2 1
-3F3 1
-3F4 1
-3F5 1
-3F6 1
-3F7 1
-3F8 1
-3F9 1
-3FA 1
-3FB 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-400 1
-401 1
-402 1
-403 1
-404 1
-405 1
-406 1
-407 1
-408 1
-409 1
-40A 1
-40B 1
-40C 1
-40D 1
-40E 1
-40F 1
-410 1
-411 1
-412 1
-413 1
-414 1
-415 1
-416 1
-417 1
-418 1
-419 1
-41A 1
-41B 1
-41C 1
-41D 1
-41E 1
-41F 1
-420 1
-421 1
-422 1
-423 1
-424 1
-425 1
-426 1
-427 1
-428 1
-429 1
-42A 1
-42B 1
-42C 1
-42D 1
-42E 1
-42F 1
-430 1
-431 1
-432 1
-433 1
-434 1
-435 1
-436 1
-437 1
-438 1
-439 1
-43A 1
-43B 1
-43C 1
-43D 1
-43E 1
-43F 1
-440 1
-441 1
-442 1
-443 1
-444 1
-445 1
-446 1
-447 1
-448 1
-449 1
-44A 1
-44B 1
-44C 1
-44D 1
-44E 1
-44F 1
-450 1
-451 1
-452 1
-453 1
-454 1
-455 1
-456 1
-457 1
-458 1
-459 1
-45A 1
-45B 1
-45C 1
-45D 1
-45E 1
-45F 1
-460 1
-461 1
-462 1
-463 1
-464 1
-465 1
-466 1
-467 1
-468 1
-469 1
-46A 1
-46B 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-478 1
-479 1
-47A 1
-47B 1
-47C 1
-47D 1
-47E 1
-47F 1
-480 1
-481 1
-482 1
-483 1
-484 1
-485 1
-486 1
-487 1
-488 1
-489 1
-48A 1
-48B 1
-48C 1
-48D 1
-48E 1
-48F 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-496 1
-497 1
-498 1
-499 1
-49A 1
-49B 1
-49C 1
-49D 1
-49E 1
-49F 1
-4A0 1
-4A1 1
-4A2 1
-4A3 1
-4A4 1
-4A5 1
-4A6 1
-4A7 1
-4A8 1
-4A9 1
-4AA 1
-4AB 1
-4AC 1
-4AD 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-4B2 1
-4B3 1
-4B4 1
-4B5 1
-4B6 1
-4B7 1
-4B8 1
-4B9 1
-4BA 1
-4BB 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-4C0 1
-4C1 1
-4C2 1
-4C3 1
-4C4 1
-4C5 1
-4C6 1
-4C7 1
-4C8 1
-4C9 1
-4CA 1
-4CB 1
-4CC 1
-4CD 1
-4CE 1
-4CF 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D4 1
-4D5 1
-4D6 1
-4D7 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4DC 1
-4DD 1
-4DE 1
-4DF 1
-4E0 1
-4E1 1
-4E2 1
-4E3 1
-4E4 1
-4E5 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-4EC 1
-4ED 1
-4EE 1
-4EF 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4F4 1
-4F5 1
-4F6 1
-4F7 1
-4F8 1
-4F9 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-500 1
-501 1
-502 1
-503 1
-504 1
-505 1
-506 1
-507 1
-508 1
-509 1
-50A 1
-50B 1
-50C 1
-50D 1
-50E 1
-50F 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-531 1
-532 1
-533 1
-534 1
-535 1
-536 1
-537 1
-538 1
-539 1
-53A 1
-53B 1
-53C 1
-53D 1
-53E 1
-53F 1
-540 1
-541 1
-542 1
-543 1
-544 1
-545 1
-546 1
-547 1
-548 1
-549 1
-54A 1
-54B 1
-54C 1
-54D 1
-54E 1
-54F 1
-550 1
-551 1
-552 1
-553 1
-554 1
-555 1
-556 1
-557 1
-558 1
-559 1
-55A 1
-55B 1
-55C 1
-55D 1
-55E 1
-55F 1
-560 1
-561 1
-562 1
-563 1
-564 1
-565 1
-566 1
-567 1
-568 1
-569 1
-56A 1
-56B 1
-56C 1
-56D 1
-56E 1
-56F 1
-570 1
-571 1
-572 1
-573 1
-574 1
-575 1
-576 1
-577 1
-578 1
-579 1
-57A 1
-57B 1
-57C 1
-57D 1
-57E 1
-57F 1
-580 1
-581 1
-582 1
-583 1
-584 1
-585 1
-586 1
-587 1
-588 1
-589 1
-58A 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A2 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BA 1
-5BB 1
-5BC 1
-5BD 1
-5BE 1
-5BF 1
-5C0 1
-5C1 1
-5C2 1
-5C3 1
-5C4 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F0 1
-5F1 1
-5F2 1
-5F3 1
-5F4 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-600 1
-601 1
-602 1
-603 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-60C 1
-60D 1
-60E 1
-60F 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61B 1
-61C 1
-61D 1
-61E 1
-61F 1
-620 1
-621 1
-622 1
-623 1
-624 1
-625 1
-626 1
-627 1
-628 1
-629 1
-62A 1
-62B 1
-62C 1
-62D 1
-62E 1
-62F 1
-630 1
-631 1
-632 1
-633 1
-634 1
-635 1
-636 1
-637 1
-638 1
-639 1
-63A 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-640 1
-641 1
-642 1
-643 1
-644 1
-645 1
-646 1
-647 1
-648 1
-649 1
-64A 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-660 1
-661 1
-662 1
-663 1
-664 1
-665 1
-666 1
-667 1
-668 1
-669 1
-66A 1
-66B 1
-66C 1
-66D 1
-66E 1
-66F 1
-670 1
-671 1
-672 1
-673 1
-674 1
-675 1
-676 1
-677 1
-678 1
-679 1
-67A 1
-67B 1
-67C 1
-67D 1
-67E 1
-67F 1
-680 1
-681 1
-682 1
-683 1
-684 1
-685 1
-686 1
-687 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-69A 1
-69B 1
-69C 1
-69D 1
-69E 1
-69F 1
-6A0 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-6A7 1
-6A8 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-6B9 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6BE 1
-6BF 1
-6C0 1
-6C1 1
-6C2 1
-6C3 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CC 1
-6CD 1
-6CE 1
-6CF 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-6D4 1
-6D5 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E5 1
-6E6 1
-6E7 1
-6E8 1
-6E9 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-6EE 1
-6EF 1
-6F0 1
-6F1 1
-6F2 1
-6F3 1
-6F4 1
-6F5 1
-6F6 1
-6F7 1
-6F8 1
-6F9 1
-6FA 1
-6FB 1
-6FC 1
-6FD 1
-6FE 1
-6FF 1
-700 1
-701 1
-702 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-709 1
-70A 1
-70B 1
-70C 1
-70D 1
-70E 1
-70F 1
-710 1
-711 1
-712 1
-713 1
-714 1
-715 1
-716 1
-717 1
-718 1
-719 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-72D 1
-72E 1
-72F 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-74B 1
-74C 1
-74D 1
-74E 1
-74F 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-780 1
-781 1
-782 1
-783 1
-784 1
-785 1
-786 1
-787 1
-788 1
-789 1
-78A 1
-78B 1
-78C 1
-78D 1
-78E 1
-78F 1
-790 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-798 1
-799 1
-79A 1
-79B 1
-79C 1
-79D 1
-79E 1
-79F 1
-7A0 1
-7A1 1
-7A2 1
-7A3 1
-7A4 1
-7A5 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-7B1 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-368 1
-10C 1
-10D 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-158 1
-159 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-160 1
-161 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-18D 1
-17D 1
-17E 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-E0 1
-E1 1
-E2 1
-E3 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-368 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-F2 1
-F3 1
-F4 1
-F5 1
-14C 1
-14D 1
-14E 1
-14F 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-276 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-160 1
-161 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-F9 1
-FA 1
-FB 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DC 1
-DD 1
-FC 1
-FD 1
-FF 1
-170 1
-171 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-17D 1
-17E 1
-18D 1
-C4 1
-C6 1
-E4 1
-E6 1
-D6 1
-D8 1
-F6 1
-F8 1
-150 1
-151 1
-C5 1
-E5 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-368 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-F2 1
-F3 1
-F4 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-160 1
-161 1
-5A 1
-7A 1
-17D 1
-17E 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-F9 1
-FA 1
-FB 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-D5 1
-F5 1
-C4 1
-E4 1
-D6 1
-F6 1
-DC 1
-FC 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-179 1
-17A 1
-17B 1
-17C 1
-18D 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-21 1
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-42 1
-62 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-44 1
-64 1
-10E 1
-10F 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-46 1
-66 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-131 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-4D 1
-6D 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-4F 1
-6F 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-160 1
-161 1
-17F 1
-218 1
-219 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-56 1
-76 1
-57 1
-77 1
-174 1
-175 1
-58 1
-78 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-17D 1
-17E 1
-5B 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-85 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-A1 1
-A2 1
-A3 1
-A4 1
-A5 1
-A6 1
-A7 1
-A8 1
-A9 1
-AA 1
-AB 1
-AC 1
-AD 1
-AE 1
-AF 1
-B0 1
-B1 1
-B2 1
-B3 1
-B4 1
-B6 1
-B7 1
-B8 1
-B9 1
-BA 1
-BB 1
-BC 1
-BD 1
-BE 1
-BF 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-D0 1
-F0 1
-D7 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-DE 1
-FE 1
-DF 1
-F7 1
-110 1
-111 1
-126 1
-127 1
-132 1
-133 1
-138 1
-13F 1
-140 1
-141 1
-142 1
-149 1
-14A 1
-14B 1
-152 1
-153 1
-166 1
-167 1
-180 1
-181 1
-253 1
-182 1
-183 1
-184 1
-185 1
-186 1
-254 1
-187 1
-188 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-18D 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-191 1
-192 1
-193 1
-260 1
-194 1
-263 1
-196 1
-269 1
-197 1
-268 1
-198 1
-199 1
-19A 1
-19B 1
-19C 1
-26F 1
-19D 1
-272 1
-19E 1
-19F 1
-275 1
-1A2 1
-1A3 1
-1A4 1
-1A5 1
-1A6 1
-280 1
-1A7 1
-1A8 1
-1A9 1
-283 1
-1AA 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-1B1 1
-28A 1
-1B2 1
-28B 1
-1B3 1
-1B4 1
-1B5 1
-1B6 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-1BB 1
-1BC 1
-1BD 1
-1BE 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-1C4 1
-1C5 1
-1C6 1
-1C7 1
-1C8 1
-1C9 1
-1CA 1
-1CB 1
-1CC 1
-1E4 1
-1E5 1
-1F1 1
-1F2 1
-1F3 1
-195 1
-1F6 1
-1BF 1
-1F7 1
-21C 1
-21D 1
-220 1
-221 1
-222 1
-223 1
-224 1
-225 1
-234 1
-235 1
-236 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-250 1
-251 1
-252 1
-255 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-25F 1
-261 1
-262 1
-264 1
-265 1
-266 1
-267 1
-26A 1
-26B 1
-26C 1
-26D 1
-26E 1
-270 1
-271 1
-273 1
-274 1
-276 1
-277 1
-278 1
-279 1
-27A 1
-27B 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-282 1
-284 1
-285 1
-286 1
-287 1
-289 1
-28C 1
-28D 1
-28E 1
-28F 1
-290 1
-291 1
-293 1
-294 1
-295 1
-296 1
-297 1
-298 1
-299 1
-29A 1
-29B 1
-29C 1
-29D 1
-29E 1
-29F 1
-2A0 1
-2A1 1
-2A2 1
-2A3 1
-2A4 1
-2A5 1
-2A6 1
-2A7 1
-2A8 1
-2A9 1
-2AA 1
-2AB 1
-2AC 1
-2AD 1
-2AE 1
-2AF 1
-2B0 1
-2B1 1
-2B2 1
-2B3 1
-2B4 1
-2B5 1
-2B6 1
-2B7 1
-2B8 1
-2B9 1
-2BA 1
-2BB 1
-2BC 1
-2BD 1
-2BE 1
-2BF 1
-2C0 1
-2C1 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D0 1
-2D1 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2D8 1
-2D9 1
-2DA 1
-2DB 1
-2DC 1
-2DD 1
-2DE 1
-2DF 1
-2E0 1
-2E1 1
-2E2 1
-2E3 1
-2E4 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EE 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-363 1
-364 1
-365 1
-366 1
-367 1
-368 1
-369 1
-36A 1
-36B 1
-36C 1
-36D 1
-36E 1
-36F 1
-370 1
-371 1
-372 1
-373 1
-374 1
-375 1
-376 1
-377 1
-378 1
-379 1
-37A 1
-37B 1
-37C 1
-37D 1
-37E 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-384 1
-385 1
-387 1
-38B 1
-38D 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-345 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-39A 1
-3BA 1
-3F0 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3A1 1
-3C1 1
-3F1 1
-3A2 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3CF 1
-3D2 1
-3D3 1
-3D4 1
-3D7 1
-3D8 1
-3D9 1
-3DA 1
-3DB 1
-3DC 1
-3DD 1
-3DE 1
-3DF 1
-3E0 1
-3E1 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-3F3 1
-3F4 1
-3F5 1
-3F6 1
-3F7 1
-3F8 1
-3F9 1
-3FA 1
-3FB 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-402 1
-452 1
-404 1
-454 1
-405 1
-455 1
-406 1
-407 1
-456 1
-457 1
-408 1
-458 1
-409 1
-459 1
-40A 1
-45A 1
-40B 1
-45B 1
-40F 1
-45F 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-411 1
-431 1
-412 1
-432 1
-403 1
-413 1
-433 1
-453 1
-414 1
-434 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-417 1
-437 1
-4DE 1
-4DF 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-4E4 1
-4E5 1
-419 1
-439 1
-40C 1
-41A 1
-43A 1
-45C 1
-41B 1
-43B 1
-41C 1
-43C 1
-41D 1
-43D 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-41F 1
-43F 1
-420 1
-440 1
-421 1
-441 1
-422 1
-442 1
-40E 1
-423 1
-443 1
-45E 1
-4EE 1
-4EF 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-424 1
-444 1
-425 1
-445 1
-426 1
-446 1
-427 1
-447 1
-4F4 1
-4F5 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-460 1
-461 1
-462 1
-463 1
-464 1
-465 1
-466 1
-467 1
-468 1
-469 1
-46A 1
-46B 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-478 1
-479 1
-47A 1
-47B 1
-47C 1
-47D 1
-47E 1
-47F 1
-480 1
-481 1
-482 1
-483 1
-484 1
-485 1
-486 1
-487 1
-488 1
-489 1
-48A 1
-48B 1
-48C 1
-48D 1
-48E 1
-48F 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-496 1
-497 1
-498 1
-499 1
-49A 1
-49B 1
-49C 1
-49D 1
-49E 1
-49F 1
-4A0 1
-4A1 1
-4A2 1
-4A3 1
-4A4 1
-4A5 1
-4A6 1
-4A7 1
-4A8 1
-4A9 1
-4AA 1
-4AB 1
-4AC 1
-4AD 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-4B2 1
-4B3 1
-4B4 1
-4B5 1
-4B6 1
-4B7 1
-4B8 1
-4B9 1
-4BA 1
-4BB 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-4C0 1
-4C3 1
-4C4 1
-4C5 1
-4C6 1
-4C7 1
-4C8 1
-4C9 1
-4CA 1
-4CB 1
-4CC 1
-4CD 1
-4CE 1
-4CF 1
-4D4 1
-4D5 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4E0 1
-4E1 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-500 1
-501 1
-502 1
-503 1
-504 1
-505 1
-506 1
-507 1
-508 1
-509 1
-50A 1
-50B 1
-50C 1
-50D 1
-50E 1
-50F 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-557 1
-558 1
-559 1
-55A 1
-55B 1
-55C 1
-55D 1
-55E 1
-55F 1
-560 1
-587 1
-588 1
-589 1
-58A 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A2 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BA 1
-5BB 1
-5BC 1
-5BD 1
-5BE 1
-5BF 1
-5C0 1
-5C1 1
-5C2 1
-5C3 1
-5C4 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F0 1
-5F1 1
-5F2 1
-5F3 1
-5F4 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-600 1
-601 1
-602 1
-603 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-60C 1
-60D 1
-60E 1
-60F 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61B 1
-61C 1
-61D 1
-61E 1
-61F 1
-620 1
-621 1
-622 1
-623 1
-624 1
-625 1
-626 1
-627 1
-628 1
-629 1
-62A 1
-62B 1
-62C 1
-62D 1
-62E 1
-62F 1
-630 1
-631 1
-632 1
-633 1
-634 1
-635 1
-636 1
-637 1
-638 1
-639 1
-63A 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-640 1
-641 1
-642 1
-643 1
-644 1
-645 1
-646 1
-647 1
-648 1
-649 1
-64A 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-660 1
-661 1
-662 1
-663 1
-664 1
-665 1
-666 1
-667 1
-668 1
-669 1
-66A 1
-66B 1
-66C 1
-66D 1
-66E 1
-66F 1
-670 1
-671 1
-672 1
-673 1
-674 1
-675 1
-676 1
-677 1
-678 1
-679 1
-67A 1
-67B 1
-67C 1
-67D 1
-67E 1
-67F 1
-680 1
-681 1
-682 1
-683 1
-684 1
-685 1
-686 1
-687 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-69A 1
-69B 1
-69C 1
-69D 1
-69E 1
-69F 1
-6A0 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-6A7 1
-6A8 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-6B9 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6BE 1
-6BF 1
-6C0 1
-6C1 1
-6C2 1
-6C3 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CC 1
-6CD 1
-6CE 1
-6CF 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-6D4 1
-6D5 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E5 1
-6E6 1
-6E7 1
-6E8 1
-6E9 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-6EE 1
-6EF 1
-6F0 1
-6F1 1
-6F2 1
-6F3 1
-6F4 1
-6F5 1
-6F6 1
-6F7 1
-6F8 1
-6F9 1
-6FA 1
-6FB 1
-6FC 1
-6FD 1
-6FE 1
-6FF 1
-700 1
-701 1
-702 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-709 1
-70A 1
-70B 1
-70C 1
-70D 1
-70E 1
-70F 1
-710 1
-711 1
-712 1
-713 1
-714 1
-715 1
-716 1
-717 1
-718 1
-719 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-72D 1
-72E 1
-72F 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-74B 1
-74C 1
-74D 1
-74E 1
-74F 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-780 1
-781 1
-782 1
-783 1
-784 1
-785 1
-786 1
-787 1
-788 1
-789 1
-78A 1
-78B 1
-78C 1
-78D 1
-78E 1
-78F 1
-790 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-798 1
-799 1
-79A 1
-79B 1
-79C 1
-79D 1
-79E 1
-79F 1
-7A0 1
-7A1 1
-7A2 1
-7A3 1
-7A4 1
-7A5 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-7B1 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-368 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-F2 1
-F3 1
-F4 1
-F5 1
-14C 1
-14D 1
-14E 1
-14F 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-D6 1
-F6 1
-150 1
-151 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-160 1
-161 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-F9 1
-FA 1
-FB 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-DC 1
-FC 1
-170 1
-171 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-17D 1
-17E 1
-18D 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C2 1
-C3 1
-E0 1
-E2 1
-E3 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-C1 1
-E1 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-368 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-D0 1
-F0 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-45 1
-65 1
-C8 1
-CA 1
-CB 1
-E8 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-C9 1
-E9 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CE 1
-CF 1
-EC 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-CD 1
-ED 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D4 1
-D5 1
-F2 1
-F4 1
-F5 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-D3 1
-F3 1
-276 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-160 1
-161 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DB 1
-DC 1
-F9 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-DA 1
-FA 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-DD 1
-FD 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-17D 1
-17E 1
-18D 1
-DE 1
-FE 1
-C4 1
-C6 1
-E4 1
-E6 1
-D6 1
-D8 1
-F6 1
-F8 1
-C5 1
-E5 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-368 1
-10C 1
-10D 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-122 1
-123 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-59 1
-79 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-1E8 1
-1E9 1
-136 1
-137 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-13B 1
-13C 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-145 1
-146 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-156 1
-157 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-160 1
-161 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-18D 1
-17D 1
-17E 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-368 1
-10C 1
-10D 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-59 1
-69 1
-79 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-160 1
-161 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-18D 1
-17D 1
-17E 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-653 1
-654 1
-655 1
-670 1
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-651 1
-652 1
-656 1
-657 1
-658 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-64E 1
-26 1
-650 1
-23 1
-64F 1
-25 1
-66A 1
-64B 1
-64D 1
-64C 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-622 1
-627 1
-671 1
-621 1
-623 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-625 1
-624 1
-626 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-368 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-160 1
-161 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-17D 1
-17E 1
-18D 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-674 1
-6FD 1
-672 1
-673 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-689 1
-68A 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A9 1
-643 1
-6A8 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6D5 1
-648 1
-6E5 1
-676 1
-647 1
-6C4 1
-629 1
-6C5 1
-6C0 1
-6C6 1
-6C7 1
-6CC 1
-677 1
-649 1
-6C8 1
-64A 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-6E6 1
-678 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-104 1
-105 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-368 1
-106 1
-107 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-118 1
-119 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-141 1
-142 1
-29F 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-143 1
-144 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D4 1
-D5 1
-D6 1
-F2 1
-F4 1
-F5 1
-F6 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-D3 1
-F3 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15C 1
-15D 1
-15E 1
-15F 1
-160 1
-161 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-15A 1
-15B 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-17D 1
-17E 1
-18D 1
-179 1
-17A 1
-17B 1
-17C 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-368 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-4A 1
-69 1
-6A 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-160 1
-161 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-55 1
-56 1
-75 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-17D 1
-17E 1
-18D 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-102 1
-103 1
-C2 1
-E2 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-368 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CF 1
-EC 1
-ED 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-CE 1
-EE 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-160 1
-161 1
-17F 1
-2E2 1
-DF 1
-15E 1
-15F 1
-218 1
-219 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-164 1
-165 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-162 1
-163 1
-21A 1
-21B 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-17D 1
-17E 1
-18D 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-C4 1
-E4 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-368 1
-10C 1
-10D 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D5 1
-D6 1
-F2 1
-F3 1
-F5 1
-F6 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-D4 1
-F4 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-160 1
-161 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-18D 1
-17D 1
-17E 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-368 1
-10C 1
-10D 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-160 1
-161 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-18D 1
-17D 1
-17E 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-368 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-D1 1
-F1 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-160 1
-161 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-17D 1
-17E 1
-18D 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-368 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-D1 1
-F1 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-160 1
-161 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-17D 1
-17E 1
-18D 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-E0 1
-E1 1
-E2 1
-E3 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-368 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-F2 1
-F3 1
-F4 1
-F5 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-276 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-160 1
-161 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-F9 1
-FA 1
-FB 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DC 1
-DD 1
-FC 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-17D 1
-17E 1
-18D 1
-C5 1
-E5 1
-C4 1
-C6 1
-E4 1
-E6 1
-D6 1
-D8 1
-F6 1
-F8 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-368 1
-C7 1
-E7 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-11E 1
-11F 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-49 1
-131 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-F2 1
-F3 1
-F4 1
-F5 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-D6 1
-F6 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-160 1
-161 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-15E 1
-15F 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-F9 1
-FA 1
-FB 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-DC 1
-FC 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-17D 1
-17E 1
-18D 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-USE test;
-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 # # #
-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;
-DELETE FROM test.t1 WHERE CHAR_LENGTH(a) <> 1;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-85 1
-7F 1
-80 1
-81 1
-82 1
-83 1
-84 1
-86 1
-87 1
-88 1
-89 1
-8A 1
-8B 1
-8C 1
-8D 1
-8E 1
-8F 1
-90 1
-91 1
-92 1
-93 1
-94 1
-95 1
-96 1
-97 1
-98 1
-99 1
-9A 1
-9B 1
-9C 1
-9D 1
-9E 1
-9F 1
-A0 1
-300 1
-301 1
-302 1
-303 1
-304 1
-305 1
-306 1
-307 1
-308 1
-309 1
-30A 1
-30B 1
-30C 1
-30D 1
-30E 1
-30F 1
-310 1
-311 1
-312 1
-313 1
-314 1
-315 1
-316 1
-317 1
-318 1
-319 1
-31A 1
-31B 1
-31C 1
-31D 1
-31E 1
-31F 1
-320 1
-321 1
-322 1
-323 1
-324 1
-325 1
-326 1
-327 1
-328 1
-329 1
-32A 1
-32B 1
-32C 1
-32D 1
-32E 1
-32F 1
-330 1
-331 1
-332 1
-333 1
-334 1
-335 1
-336 1
-337 1
-338 1
-339 1
-33A 1
-33B 1
-33C 1
-33D 1
-33E 1
-33F 1
-340 1
-341 1
-342 1
-343 1
-344 1
-345 1
-346 1
-347 1
-348 1
-349 1
-34A 1
-34B 1
-34C 1
-34D 1
-34E 1
-34F 1
-350 1
-351 1
-352 1
-353 1
-354 1
-355 1
-356 1
-357 1
-35D 1
-35E 1
-35F 1
-360 1
-361 1
-362 1
-483 1
-484 1
-485 1
-486 1
-488 1
-489 1
-591 1
-592 1
-593 1
-594 1
-595 1
-596 1
-597 1
-598 1
-599 1
-59A 1
-59B 1
-59C 1
-59D 1
-59E 1
-59F 1
-5A0 1
-5A1 1
-5A3 1
-5A4 1
-5A5 1
-5A6 1
-5A7 1
-5A8 1
-5A9 1
-5AA 1
-5AB 1
-5AC 1
-5AD 1
-5AE 1
-5AF 1
-5B0 1
-5B1 1
-5B2 1
-5B3 1
-5B4 1
-5B5 1
-5B6 1
-5B7 1
-5B8 1
-5B9 1
-5BB 1
-5BC 1
-5BD 1
-5BF 1
-5C1 1
-5C2 1
-5C4 1
-600 1
-601 1
-602 1
-603 1
-610 1
-611 1
-612 1
-613 1
-614 1
-615 1
-64B 1
-64C 1
-64D 1
-64E 1
-64F 1
-650 1
-651 1
-652 1
-653 1
-654 1
-655 1
-656 1
-657 1
-658 1
-670 1
-6D6 1
-6D7 1
-6D8 1
-6D9 1
-6DA 1
-6DB 1
-6DC 1
-6DD 1
-6DE 1
-6DF 1
-6E0 1
-6E1 1
-6E2 1
-6E3 1
-6E4 1
-6E7 1
-6E8 1
-6EA 1
-6EB 1
-6EC 1
-6ED 1
-70F 1
-711 1
-730 1
-731 1
-732 1
-733 1
-734 1
-735 1
-736 1
-737 1
-738 1
-739 1
-73A 1
-73B 1
-73C 1
-73D 1
-73E 1
-73F 1
-740 1
-741 1
-742 1
-743 1
-744 1
-745 1
-746 1
-747 1
-748 1
-749 1
-74A 1
-640 1
-60 1
-B4 1
-384 1
-2DC 1
-5E 1
-AF 1
-2D8 1
-2D9 1
-A8 1
-385 1
-2DA 1
-2DD 1
-B8 1
-2DB 1
-5F 1
-AD 1
-2D 1
-58A 1
-2C 1
-55D 1
-60C 1
-60D 1
-66B 1
-66C 1
-3B 1
-37E 1
-61B 1
-3A 1
-589 1
-703 1
-704 1
-705 1
-706 1
-707 1
-708 1
-21 1
-A1 1
-55C 1
-3F 1
-BF 1
-55E 1
-61F 1
-709 1
-2E 1
-6D4 1
-701 1
-702 1
-B7 1
-387 1
-700 1
-27 1
-22 1
-AB 1
-BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-A7 1
-B6 1
-A9 1
-AE 1
-40 1
-2A 1
-66D 1
-2F 1
-26 1
-23 1
-25 1
-66A 1
-55A 1
-55B 1
-55F 1
-5BE 1
-5C0 1
-5C3 1
-5F3 1
-5F4 1
-70A 1
-70B 1
-70C 1
-70D 1
-2B9 1
-374 1
-375 1
-2BA 1
-2C2 1
-2C3 1
-2C4 1
-2C5 1
-2C6 1
-2C7 1
-2C8 1
-2C9 1
-2CA 1
-2CB 1
-2CC 1
-2CD 1
-2CE 1
-2CF 1
-2D2 1
-2D3 1
-2D4 1
-2D5 1
-2D6 1
-2D7 1
-2DE 1
-2DF 1
-2E5 1
-2E6 1
-2E7 1
-2E8 1
-2E9 1
-2EA 1
-2EB 1
-2EC 1
-2ED 1
-2EF 1
-2F0 1
-2F1 1
-2F2 1
-2F3 1
-2F4 1
-2F5 1
-2F6 1
-2F7 1
-2F8 1
-2F9 1
-2FA 1
-2FB 1
-2FC 1
-2FD 1
-2FE 1
-2FF 1
-B0 1
-482 1
-60E 1
-60F 1
-6E9 1
-3F6 1
-2B 1
-B1 1
-F7 1
-D7 1
-3C 1
-3D 1
-3E 1
-AC 1
-7C 1
-A6 1
-7E 1
-2D0 1
-2D1 1
-A4 1
-A2 1
-24 1
-A3 1
-A5 1
-30 1
-660 1
-6F0 1
-31 1
-B9 1
-661 1
-6F1 1
-BD 1
-BC 1
-32 1
-B2 1
-662 1
-6F2 1
-33 1
-B3 1
-663 1
-6F3 1
-BE 1
-34 1
-664 1
-6F4 1
-35 1
-665 1
-6F5 1
-36 1
-666 1
-6F6 1
-37 1
-667 1
-6F7 1
-38 1
-668 1
-6F8 1
-39 1
-669 1
-6F9 1
-41 1
-61 1
-AA 1
-C0 1
-C1 1
-C2 1
-C3 1
-C4 1
-C5 1
-E0 1
-E1 1
-E2 1
-E3 1
-E4 1
-E5 1
-100 1
-101 1
-102 1
-103 1
-104 1
-105 1
-1CD 1
-1CE 1
-1DE 1
-1DF 1
-1E0 1
-1E1 1
-1FA 1
-1FB 1
-200 1
-201 1
-202 1
-203 1
-226 1
-227 1
-363 1
-C6 1
-E6 1
-1E2 1
-1E3 1
-1FC 1
-1FD 1
-250 1
-251 1
-252 1
-42 1
-62 1
-299 1
-180 1
-181 1
-253 1
-182 1
-183 1
-43 1
-63 1
-C7 1
-E7 1
-106 1
-107 1
-108 1
-109 1
-10A 1
-10B 1
-10C 1
-10D 1
-368 1
-187 1
-188 1
-255 1
-44 1
-64 1
-10E 1
-10F 1
-369 1
-1C4 1
-1C5 1
-1C6 1
-1F1 1
-1F2 1
-1F3 1
-2A3 1
-2A5 1
-2A4 1
-110 1
-111 1
-189 1
-256 1
-18A 1
-257 1
-18B 1
-18C 1
-221 1
-D0 1
-F0 1
-45 1
-65 1
-C8 1
-C9 1
-CA 1
-CB 1
-E8 1
-E9 1
-EA 1
-EB 1
-112 1
-113 1
-114 1
-115 1
-116 1
-117 1
-118 1
-119 1
-11A 1
-11B 1
-204 1
-205 1
-206 1
-207 1
-228 1
-229 1
-364 1
-18E 1
-1DD 1
-18F 1
-259 1
-190 1
-25B 1
-258 1
-25A 1
-25C 1
-25D 1
-25E 1
-29A 1
-264 1
-46 1
-66 1
-2A9 1
-191 1
-192 1
-47 1
-67 1
-11C 1
-11D 1
-11E 1
-11F 1
-120 1
-121 1
-122 1
-123 1
-1E6 1
-1E7 1
-1F4 1
-1F5 1
-261 1
-262 1
-1E4 1
-1E5 1
-193 1
-260 1
-29B 1
-194 1
-263 1
-2E0 1
-1A2 1
-1A3 1
-48 1
-68 1
-124 1
-125 1
-21E 1
-21F 1
-2B0 1
-36A 1
-29C 1
-195 1
-1F6 1
-126 1
-127 1
-266 1
-2B1 1
-267 1
-2BB 1
-2BD 1
-49 1
-69 1
-CC 1
-CD 1
-CE 1
-CF 1
-EC 1
-ED 1
-EE 1
-EF 1
-128 1
-129 1
-12A 1
-12B 1
-12C 1
-12D 1
-12E 1
-12F 1
-130 1
-1CF 1
-1D0 1
-208 1
-209 1
-20A 1
-20B 1
-365 1
-132 1
-133 1
-131 1
-26A 1
-197 1
-268 1
-196 1
-269 1
-4A 1
-6A 1
-134 1
-135 1
-1F0 1
-2B2 1
-29D 1
-25F 1
-284 1
-4B 1
-6B 1
-136 1
-137 1
-1E8 1
-1E9 1
-198 1
-199 1
-29E 1
-4C 1
-6C 1
-139 1
-13A 1
-13B 1
-13C 1
-13D 1
-13E 1
-2E1 1
-13F 1
-140 1
-1C7 1
-1C8 1
-1C9 1
-2AA 1
-2AB 1
-29F 1
-141 1
-142 1
-19A 1
-26B 1
-26C 1
-26D 1
-234 1
-26E 1
-19B 1
-28E 1
-4D 1
-6D 1
-36B 1
-271 1
-4E 1
-6E 1
-D1 1
-F1 1
-143 1
-144 1
-145 1
-146 1
-147 1
-148 1
-1F8 1
-1F9 1
-1CA 1
-1CB 1
-1CC 1
-274 1
-19D 1
-272 1
-19E 1
-220 1
-273 1
-235 1
-14A 1
-14B 1
-4F 1
-6F 1
-BA 1
-D2 1
-D3 1
-D4 1
-D5 1
-D6 1
-F2 1
-F3 1
-F4 1
-F5 1
-F6 1
-14C 1
-14D 1
-14E 1
-14F 1
-150 1
-151 1
-1A0 1
-1A1 1
-1D1 1
-1D2 1
-1EA 1
-1EB 1
-1EC 1
-1ED 1
-20C 1
-20D 1
-20E 1
-20F 1
-22A 1
-22B 1
-22C 1
-22D 1
-22E 1
-22F 1
-230 1
-231 1
-366 1
-152 1
-153 1
-276 1
-D8 1
-F8 1
-1FE 1
-1FF 1
-186 1
-254 1
-19F 1
-275 1
-277 1
-222 1
-223 1
-50 1
-70 1
-1A4 1
-1A5 1
-278 1
-51 1
-71 1
-2A0 1
-138 1
-52 1
-72 1
-154 1
-155 1
-156 1
-157 1
-158 1
-159 1
-210 1
-211 1
-212 1
-213 1
-2B3 1
-36C 1
-1A6 1
-280 1
-279 1
-2B4 1
-27A 1
-27B 1
-2B5 1
-27C 1
-27D 1
-27E 1
-27F 1
-281 1
-2B6 1
-53 1
-73 1
-15A 1
-15B 1
-15C 1
-15D 1
-15E 1
-15F 1
-160 1
-161 1
-17F 1
-218 1
-219 1
-2E2 1
-DF 1
-282 1
-1A9 1
-283 1
-1AA 1
-285 1
-286 1
-54 1
-74 1
-162 1
-163 1
-164 1
-165 1
-21A 1
-21B 1
-36D 1
-2A8 1
-1BE 1
-2A6 1
-2A7 1
-166 1
-167 1
-1AB 1
-1AC 1
-1AD 1
-1AE 1
-288 1
-236 1
-287 1
-55 1
-75 1
-D9 1
-DA 1
-DB 1
-DC 1
-F9 1
-FA 1
-FB 1
-FC 1
-168 1
-169 1
-16A 1
-16B 1
-16C 1
-16D 1
-16E 1
-16F 1
-170 1
-171 1
-172 1
-173 1
-1AF 1
-1B0 1
-1D3 1
-1D4 1
-1D5 1
-1D6 1
-1D7 1
-1D8 1
-1D9 1
-1DA 1
-1DB 1
-1DC 1
-214 1
-215 1
-216 1
-217 1
-367 1
-289 1
-265 1
-2AE 1
-2AF 1
-19C 1
-26F 1
-270 1
-1B1 1
-28A 1
-56 1
-76 1
-36E 1
-1B2 1
-28B 1
-28C 1
-57 1
-77 1
-174 1
-175 1
-2B7 1
-28D 1
-58 1
-78 1
-2E3 1
-36F 1
-59 1
-79 1
-DD 1
-FD 1
-FF 1
-176 1
-177 1
-178 1
-232 1
-233 1
-2B8 1
-28F 1
-1B3 1
-1B4 1
-5A 1
-7A 1
-179 1
-17A 1
-17B 1
-17C 1
-17D 1
-17E 1
-18D 1
-1B5 1
-1B6 1
-224 1
-225 1
-290 1
-291 1
-1B7 1
-1EE 1
-1EF 1
-292 1
-1B8 1
-1B9 1
-1BA 1
-293 1
-21C 1
-21D 1
-DE 1
-FE 1
-1BF 1
-1F7 1
-1BB 1
-1A7 1
-1A8 1
-1BC 1
-1BD 1
-184 1
-185 1
-294 1
-2C0 1
-2BC 1
-149 1
-2EE 1
-2BE 1
-295 1
-2E4 1
-2BF 1
-2C1 1
-2A1 1
-2A2 1
-296 1
-1C0 1
-1C1 1
-1C2 1
-1C3 1
-297 1
-298 1
-2AC 1
-2AD 1
-386 1
-391 1
-3AC 1
-3B1 1
-392 1
-3B2 1
-3D0 1
-393 1
-3B3 1
-394 1
-3B4 1
-388 1
-395 1
-3AD 1
-3B5 1
-3F5 1
-3DC 1
-3DD 1
-3DA 1
-3DB 1
-396 1
-3B6 1
-389 1
-397 1
-3AE 1
-3B7 1
-398 1
-3B8 1
-3D1 1
-3F4 1
-37A 1
-38A 1
-390 1
-399 1
-3AA 1
-3AF 1
-3B9 1
-3CA 1
-3F3 1
-39A 1
-3BA 1
-3F0 1
-3D7 1
-39B 1
-3BB 1
-B5 1
-39C 1
-3BC 1
-39D 1
-3BD 1
-39E 1
-3BE 1
-38C 1
-39F 1
-3BF 1
-3CC 1
-3A0 1
-3C0 1
-3D6 1
-3DE 1
-3DF 1
-3D8 1
-3D9 1
-3A1 1
-3C1 1
-3F1 1
-3A3 1
-3C2 1
-3C3 1
-3F2 1
-3F9 1
-3A4 1
-3C4 1
-38E 1
-3A5 1
-3AB 1
-3B0 1
-3C5 1
-3CB 1
-3CD 1
-3D2 1
-3D3 1
-3D4 1
-3A6 1
-3C6 1
-3D5 1
-3A7 1
-3C7 1
-3A8 1
-3C8 1
-38F 1
-3A9 1
-3C9 1
-3CE 1
-3E0 1
-3E1 1
-3F7 1
-3F8 1
-3FA 1
-3FB 1
-3E2 1
-3E3 1
-3E4 1
-3E5 1
-3E6 1
-3E7 1
-3E8 1
-3E9 1
-3EA 1
-3EB 1
-3EC 1
-3ED 1
-3EE 1
-3EF 1
-410 1
-430 1
-4D0 1
-4D1 1
-4D2 1
-4D3 1
-4D8 1
-4D9 1
-4DA 1
-4DB 1
-4D4 1
-4D5 1
-411 1
-431 1
-412 1
-432 1
-413 1
-433 1
-490 1
-491 1
-492 1
-493 1
-494 1
-495 1
-414 1
-434 1
-500 1
-501 1
-402 1
-452 1
-502 1
-503 1
-403 1
-453 1
-498 1
-499 1
-400 1
-401 1
-415 1
-435 1
-450 1
-451 1
-4D6 1
-4D7 1
-404 1
-454 1
-416 1
-436 1
-4C1 1
-4C2 1
-4DC 1
-4DD 1
-496 1
-497 1
-417 1
-437 1
-504 1
-505 1
-4DE 1
-4DF 1
-405 1
-455 1
-4E0 1
-4E1 1
-506 1
-507 1
-40D 1
-418 1
-438 1
-45D 1
-4E2 1
-4E3 1
-48A 1
-48B 1
-4E4 1
-4E5 1
-406 1
-456 1
-407 1
-457 1
-419 1
-439 1
-408 1
-458 1
-41A 1
-43A 1
-49A 1
-49B 1
-4C3 1
-4C4 1
-4A0 1
-4A1 1
-49E 1
-49F 1
-49C 1
-49D 1
-41B 1
-43B 1
-4C5 1
-4C6 1
-409 1
-459 1
-508 1
-509 1
-41C 1
-43C 1
-4CD 1
-4CE 1
-41D 1
-43D 1
-4C9 1
-4CA 1
-4A2 1
-4A3 1
-4C7 1
-4C8 1
-4A4 1
-4A5 1
-40A 1
-45A 1
-50A 1
-50B 1
-41E 1
-43E 1
-4E6 1
-4E7 1
-4E8 1
-4E9 1
-4EA 1
-4EB 1
-41F 1
-43F 1
-4A6 1
-4A7 1
-480 1
-481 1
-420 1
-440 1
-48E 1
-48F 1
-421 1
-441 1
-50C 1
-50D 1
-4AA 1
-4AB 1
-422 1
-442 1
-50E 1
-50F 1
-4AC 1
-4AD 1
-40B 1
-45B 1
-40C 1
-45C 1
-423 1
-443 1
-4EE 1
-4EF 1
-40E 1
-45E 1
-4F0 1
-4F1 1
-4F2 1
-4F3 1
-4AE 1
-4AF 1
-4B0 1
-4B1 1
-478 1
-479 1
-424 1
-444 1
-425 1
-445 1
-4B2 1
-4B3 1
-4BA 1
-4BB 1
-460 1
-461 1
-47E 1
-47F 1
-47C 1
-47D 1
-47A 1
-47B 1
-426 1
-446 1
-4B4 1
-4B5 1
-427 1
-447 1
-4F4 1
-4F5 1
-4B6 1
-4B7 1
-4CB 1
-4CC 1
-4B8 1
-4B9 1
-4BC 1
-4BD 1
-4BE 1
-4BF 1
-40F 1
-45F 1
-428 1
-448 1
-429 1
-449 1
-42A 1
-44A 1
-42B 1
-44B 1
-4F8 1
-4F9 1
-42C 1
-44C 1
-48C 1
-48D 1
-462 1
-463 1
-42D 1
-44D 1
-4EC 1
-4ED 1
-42E 1
-44E 1
-42F 1
-44F 1
-464 1
-465 1
-466 1
-467 1
-46A 1
-46B 1
-468 1
-469 1
-46C 1
-46D 1
-46E 1
-46F 1
-470 1
-471 1
-472 1
-473 1
-474 1
-475 1
-476 1
-477 1
-4A8 1
-4A9 1
-4C0 1
-531 1
-561 1
-532 1
-562 1
-533 1
-563 1
-534 1
-564 1
-535 1
-565 1
-587 1
-536 1
-566 1
-537 1
-567 1
-538 1
-568 1
-539 1
-569 1
-53A 1
-56A 1
-53B 1
-56B 1
-53C 1
-56C 1
-53D 1
-56D 1
-53E 1
-56E 1
-53F 1
-56F 1
-540 1
-570 1
-541 1
-571 1
-542 1
-572 1
-543 1
-573 1
-544 1
-574 1
-545 1
-575 1
-546 1
-576 1
-547 1
-577 1
-548 1
-578 1
-549 1
-579 1
-54A 1
-57A 1
-54B 1
-57B 1
-54C 1
-57C 1
-54D 1
-57D 1
-54E 1
-57E 1
-54F 1
-57F 1
-550 1
-580 1
-551 1
-581 1
-552 1
-582 1
-553 1
-583 1
-554 1
-584 1
-555 1
-585 1
-556 1
-586 1
-559 1
-5D0 1
-5D1 1
-5D2 1
-5D3 1
-5D4 1
-5D5 1
-5F0 1
-5F1 1
-5D6 1
-5D7 1
-5D8 1
-5D9 1
-5F2 1
-5DA 1
-5DB 1
-5DC 1
-5DD 1
-5DE 1
-5DF 1
-5E0 1
-5E1 1
-5E2 1
-5E3 1
-5E4 1
-5E5 1
-5E6 1
-5E7 1
-5E8 1
-5E9 1
-5EA 1
-621 1
-674 1
-6FD 1
-622 1
-623 1
-672 1
-671 1
-624 1
-625 1
-673 1
-626 1
-627 1
-675 1
-66E 1
-628 1
-67B 1
-67E 1
-680 1
-629 1
-62A 1
-62B 1
-679 1
-67A 1
-67C 1
-67D 1
-67F 1
-62C 1
-683 1
-684 1
-686 1
-6BF 1
-687 1
-62D 1
-62E 1
-681 1
-682 1
-685 1
-62F 1
-630 1
-688 1
-689 1
-68A 1
-68B 1
-68C 1
-68D 1
-68E 1
-68F 1
-690 1
-6EE 1
-631 1
-632 1
-691 1
-692 1
-693 1
-694 1
-695 1
-696 1
-697 1
-698 1
-699 1
-6EF 1
-633 1
-634 1
-69A 1
-69B 1
-69C 1
-6FA 1
-635 1
-636 1
-69D 1
-69E 1
-6FB 1
-637 1
-638 1
-69F 1
-639 1
-63A 1
-6A0 1
-6FC 1
-641 1
-6A1 1
-6A2 1
-6A3 1
-6A4 1
-6A5 1
-6A6 1
-66F 1
-642 1
-6A7 1
-6A8 1
-643 1
-6A9 1
-6AA 1
-6AB 1
-6AC 1
-6AD 1
-6AE 1
-6AF 1
-6B0 1
-6B1 1
-6B2 1
-6B3 1
-6B4 1
-644 1
-6B5 1
-6B6 1
-6B7 1
-6B8 1
-645 1
-6FE 1
-646 1
-6BA 1
-6BB 1
-6BC 1
-6BD 1
-6B9 1
-647 1
-6BE 1
-6C1 1
-6C2 1
-6C3 1
-6FF 1
-6C0 1
-6D5 1
-648 1
-6E5 1
-676 1
-6C4 1
-6C5 1
-6C6 1
-6C7 1
-677 1
-6C8 1
-6C9 1
-6CA 1
-6CB 1
-6CF 1
-649 1
-64A 1
-6E6 1
-678 1
-6CC 1
-6CD 1
-6CE 1
-6D0 1
-6D1 1
-6D2 1
-6D3 1
-710 1
-712 1
-72D 1
-713 1
-714 1
-72E 1
-716 1
-715 1
-72F 1
-717 1
-718 1
-719 1
-74D 1
-71A 1
-71B 1
-71C 1
-71D 1
-71E 1
-71F 1
-74E 1
-720 1
-721 1
-722 1
-723 1
-724 1
-725 1
-726 1
-727 1
-74F 1
-728 1
-729 1
-72A 1
-72B 1
-72C 1
-780 1
-799 1
-79A 1
-781 1
-782 1
-783 1
-79C 1
-784 1
-785 1
-786 1
-787 1
-7A2 1
-7A3 1
-788 1
-7A5 1
-789 1
-78A 1
-78B 1
-79B 1
-78C 1
-798 1
-7A0 1
-7A1 1
-78D 1
-78E 1
-7A4 1
-78F 1
-790 1
-79D 1
-79E 1
-79F 1
-791 1
-792 1
-793 1
-794 1
-795 1
-796 1
-797 1
-7B1 1
-7A6 1
-7A7 1
-7A8 1
-7A9 1
-7AA 1
-7AB 1
-7AC 1
-7AD 1
-7AE 1
-7AF 1
-7B0 1
-4E00 1
-4E01 1
-4E02 1
-4E03 1
-4E04 1
-4E05 1
-4E06 1
-4E07 1
-4E08 1
-4E09 1
-4E0A 1
-4E0B 1
-4E0C 1
-4E0D 1
-4E0E 1
-4E0F 1
-4E10 1
-4E11 1
-4E12 1
-4E13 1
-4E14 1
-4E15 1
-4E16 1
-4E17 1
-4E18 1
-4E19 1
-4E1A 1
-4E1B 1
-4E1C 1
-4E1D 1
-4E1E 1
-4E1F 1
-4E20 1
-4E21 1
-4E22 1
-4E23 1
-4E24 1
-4E25 1
-4E26 1
-4E27 1
-4E28 1
-4E29 1
-4E2A 1
-4E2B 1
-4E2C 1
-4E2D 1
-4E2E 1
-4E2F 1
-4E30 1
-4E31 1
-4E32 1
-4E33 1
-4E34 1
-4E35 1
-4E36 1
-4E37 1
-4E38 1
-4E39 1
-4E3A 1
-4E3B 1
-4E3C 1
-4E3D 1
-4E3E 1
-4E3F 1
-4E40 1
-4E41 1
-4E42 1
-4E43 1
-4E44 1
-4E45 1
-4E46 1
-4E47 1
-4E48 1
-4E49 1
-4E4A 1
-4E4B 1
-4E4C 1
-4E4D 1
-4E4E 1
-4E4F 1
-4E50 1
-4E51 1
-4E52 1
-4E53 1
-4E54 1
-4E55 1
-4E56 1
-4E57 1
-4E58 1
-4E59 1
-4E5A 1
-4E5B 1
-4E5C 1
-4E5D 1
-4E5E 1
-4E5F 1
-4E60 1
-4E61 1
-4E62 1
-4E63 1
-4E64 1
-4E65 1
-4E66 1
-4E67 1
-4E68 1
-4E69 1
-4E6A 1
-4E6B 1
-4E6C 1
-4E6D 1
-4E6E 1
-4E6F 1
-4E70 1
-4E71 1
-4E72 1
-4E73 1
-4E74 1
-4E75 1
-4E76 1
-4E77 1
-4E78 1
-4E79 1
-4E7A 1
-4E7B 1
-4E7C 1
-4E7D 1
-4E7E 1
-4E7F 1
-4E80 1
-4E81 1
-4E82 1
-4E83 1
-4E84 1
-4E85 1
-4E86 1
-4E87 1
-4E88 1
-4E89 1
-4E8A 1
-4E8B 1
-4E8C 1
-4E8D 1
-4E8E 1
-4E8F 1
-4E90 1
-4E91 1
-4E92 1
-4E93 1
-4E94 1
-4E95 1
-4E96 1
-4E97 1
-4E98 1
-4E99 1
-4E9A 1
-4E9B 1
-4E9C 1
-4E9D 1
-4E9E 1
-4E9F 1
-4EA0 1
-4EA1 1
-4EA2 1
-4EA3 1
-4EA4 1
-4EA5 1
-4EA6 1
-4EA7 1
-4EA8 1
-4EA9 1
-4EAA 1
-4EAB 1
-4EAC 1
-4EAD 1
-4EAE 1
-4EAF 1
-4EB0 1
-4EB1 1
-4EB2 1
-4EB3 1
-4EB4 1
-4EB5 1
-4EB6 1
-4EB7 1
-4EB8 1
-4EB9 1
-4EBA 1
-4EBB 1
-4EBC 1
-4EBD 1
-4EBE 1
-4EBF 1
-4EC0 1
-4EC1 1
-4EC2 1
-4EC3 1
-4EC4 1
-4EC5 1
-4EC6 1
-4EC7 1
-4EC8 1
-4EC9 1
-4ECA 1
-4ECB 1
-4ECC 1
-4ECD 1
-4ECE 1
-4ECF 1
-4ED0 1
-4ED1 1
-4ED2 1
-4ED3 1
-4ED4 1
-4ED5 1
-4ED6 1
-4ED7 1
-4ED8 1
-4ED9 1
-4EDA 1
-4EDB 1
-4EDC 1
-4EDD 1
-4EDE 1
-4EDF 1
-4EE0 1
-4EE1 1
-4EE2 1
-4EE3 1
-4EE4 1
-4EE5 1
-4EE6 1
-4EE7 1
-4EE8 1
-4EE9 1
-4EEA 1
-4EEB 1
-4EEC 1
-4EED 1
-4EEE 1
-4EEF 1
-4EF0 1
-4EF1 1
-4EF2 1
-4EF3 1
-4EF4 1
-4EF5 1
-4EF6 1
-4EF7 1
-4EF8 1
-4EF9 1
-4EFA 1
-4EFB 1
-4EFC 1
-4EFD 1
-4EFE 1
-4EFF 1
-4F00 1
-4F01 1
-4F02 1
-4F03 1
-4F04 1
-4F05 1
-4F06 1
-4F07 1
-4F08 1
-4F09 1
-4F0A 1
-4F0B 1
-4F0C 1
-4F0D 1
-4F0E 1
-4F0F 1
-4F10 1
-4F11 1
-4F12 1
-4F13 1
-4F14 1
-4F15 1
-4F16 1
-4F17 1
-4F18 1
-4F19 1
-4F1A 1
-4F1B 1
-4F1C 1
-4F1D 1
-4F1E 1
-4F1F 1
-4F20 1
-4F21 1
-4F22 1
-4F23 1
-4F24 1
-4F25 1
-4F26 1
-4F27 1
-4F28 1
-4F29 1
-4F2A 1
-4F2B 1
-4F2C 1
-4F2D 1
-4F2E 1
-4F2F 1
-4F30 1
-4F31 1
-4F32 1
-4F33 1
-4F34 1
-4F35 1
-4F36 1
-4F37 1
-4F38 1
-4F39 1
-4F3A 1
-4F3B 1
-4F3C 1
-4F3D 1
-4F3E 1
-4F3F 1
-4F40 1
-4F41 1
-4F42 1
-4F43 1
-4F44 1
-4F45 1
-4F46 1
-4F47 1
-4F48 1
-4F49 1
-4F4A 1
-4F4B 1
-4F4C 1
-4F4D 1
-4F4E 1
-4F4F 1
-4F50 1
-4F51 1
-4F52 1
-4F53 1
-4F54 1
-4F55 1
-4F56 1
-4F57 1
-4F58 1
-4F59 1
-4F5A 1
-4F5B 1
-4F5C 1
-4F5D 1
-4F5E 1
-4F5F 1
-4F60 1
-4F61 1
-4F62 1
-4F63 1
-4F64 1
-4F65 1
-4F66 1
-4F67 1
-4F68 1
-4F69 1
-4F6A 1
-4F6B 1
-4F6C 1
-4F6D 1
-4F6E 1
-4F6F 1
-4F70 1
-4F71 1
-4F72 1
-4F73 1
-4F74 1
-4F75 1
-4F76 1
-4F77 1
-4F78 1
-4F79 1
-4F7A 1
-4F7B 1
-4F7C 1
-4F7D 1
-4F7E 1
-4F7F 1
-4F80 1
-4F81 1
-4F82 1
-4F83 1
-4F84 1
-4F85 1
-4F86 1
-4F87 1
-4F88 1
-4F89 1
-4F8A 1
-4F8B 1
-4F8C 1
-4F8D 1
-4F8E 1
-4F8F 1
-4F90 1
-4F91 1
-4F92 1
-4F93 1
-4F94 1
-4F95 1
-4F96 1
-4F97 1
-4F98 1
-4F99 1
-4F9A 1
-4F9B 1
-4F9C 1
-4F9D 1
-4F9E 1
-4F9F 1
-4FA0 1
-4FA1 1
-4FA2 1
-4FA3 1
-4FA4 1
-4FA5 1
-4FA6 1
-4FA7 1
-4FA8 1
-4FA9 1
-4FAA 1
-4FAB 1
-4FAC 1
-4FAD 1
-4FAE 1
-4FAF 1
-4FB0 1
-4FB1 1
-4FB2 1
-4FB3 1
-4FB4 1
-4FB5 1
-4FB6 1
-4FB7 1
-4FB8 1
-4FB9 1
-4FBA 1
-4FBB 1
-4FBC 1
-4FBD 1
-4FBE 1
-4FBF 1
-4FC0 1
-4FC1 1
-4FC2 1
-4FC3 1
-4FC4 1
-4FC5 1
-4FC6 1
-4FC7 1
-4FC8 1
-4FC9 1
-4FCA 1
-4FCB 1
-4FCC 1
-4FCD 1
-4FCE 1
-4FCF 1
-4FD0 1
-4FD1 1
-4FD2 1
-4FD3 1
-4FD4 1
-4FD5 1
-4FD6 1
-4FD7 1
-4FD8 1
-4FD9 1
-4FDA 1
-4FDB 1
-4FDC 1
-4FDD 1
-4FDE 1
-4FDF 1
-4FE0 1
-4FE1 1
-4FE2 1
-4FE3 1
-4FE4 1
-4FE5 1
-4FE6 1
-4FE7 1
-4FE8 1
-4FE9 1
-4FEA 1
-4FEB 1
-4FEC 1
-4FED 1
-4FEE 1
-4FEF 1
-4FF0 1
-4FF1 1
-4FF2 1
-4FF3 1
-4FF4 1
-4FF5 1
-4FF6 1
-4FF7 1
-4FF8 1
-4FF9 1
-4FFA 1
-4FFB 1
-4FFC 1
-4FFD 1
-4FFE 1
-4FFF 1
-237 1
-238 1
-239 1
-23A 1
-23B 1
-23C 1
-23D 1
-23E 1
-23F 1
-240 1
-241 1
-242 1
-243 1
-244 1
-245 1
-246 1
-247 1
-248 1
-249 1
-24A 1
-24B 1
-24C 1
-24D 1
-24E 1
-24F 1
-358 1
-359 1
-35A 1
-35B 1
-35C 1
-370 1
-371 1
-372 1
-373 1
-376 1
-377 1
-378 1
-379 1
-37B 1
-37C 1
-37D 1
-37F 1
-380 1
-381 1
-382 1
-383 1
-38B 1
-38D 1
-3A2 1
-3CF 1
-3FC 1
-3FD 1
-3FE 1
-3FF 1
-487 1
-4CF 1
-4F6 1
-4F7 1
-4FA 1
-4FB 1
-4FC 1
-4FD 1
-4FE 1
-4FF 1
-510 1
-511 1
-512 1
-513 1
-514 1
-515 1
-516 1
-517 1
-518 1
-519 1
-51A 1
-51B 1
-51C 1
-51D 1
-51E 1
-51F 1
-520 1
-521 1
-522 1
-523 1
-524 1
-525 1
-526 1
-527 1
-528 1
-529 1
-52A 1
-52B 1
-52C 1
-52D 1
-52E 1
-52F 1
-530 1
-557 1
-558 1
-560 1
-588 1
-58B 1
-58C 1
-58D 1
-58E 1
-58F 1
-590 1
-5A2 1
-5BA 1
-5C5 1
-5C6 1
-5C7 1
-5C8 1
-5C9 1
-5CA 1
-5CB 1
-5CC 1
-5CD 1
-5CE 1
-5CF 1
-5EB 1
-5EC 1
-5ED 1
-5EE 1
-5EF 1
-5F5 1
-5F6 1
-5F7 1
-5F8 1
-5F9 1
-5FA 1
-5FB 1
-5FC 1
-5FD 1
-5FE 1
-5FF 1
-604 1
-605 1
-606 1
-607 1
-608 1
-609 1
-60A 1
-60B 1
-616 1
-617 1
-618 1
-619 1
-61A 1
-61C 1
-61D 1
-61E 1
-620 1
-63B 1
-63C 1
-63D 1
-63E 1
-63F 1
-659 1
-65A 1
-65B 1
-65C 1
-65D 1
-65E 1
-65F 1
-70E 1
-74B 1
-74C 1
-750 1
-751 1
-752 1
-753 1
-754 1
-755 1
-756 1
-757 1
-758 1
-759 1
-75A 1
-75B 1
-75C 1
-75D 1
-75E 1
-75F 1
-760 1
-761 1
-762 1
-763 1
-764 1
-765 1
-766 1
-767 1
-768 1
-769 1
-76A 1
-76B 1
-76C 1
-76D 1
-76E 1
-76F 1
-770 1
-771 1
-772 1
-773 1
-774 1
-775 1
-776 1
-777 1
-778 1
-779 1
-77A 1
-77B 1
-77C 1
-77D 1
-77E 1
-77F 1
-7B2 1
-7B3 1
-7B4 1
-7B5 1
-7B6 1
-7B7 1
-7B8 1
-7B9 1
-7BA 1
-7BB 1
-7BC 1
-7BD 1
-7BE 1
-7BF 1
-7C0 1
-7C1 1
-7C2 1
-7C3 1
-7C4 1
-7C5 1
-7C6 1
-7C7 1
-7C8 1
-7C9 1
-7CA 1
-7CB 1
-7CC 1
-7CD 1
-7CE 1
-7CF 1
-7D0 1
-7D1 1
-7D2 1
-7D3 1
-7D4 1
-7D5 1
-7D6 1
-7D7 1
-7D8 1
-7D9 1
-7DA 1
-7DB 1
-7DC 1
-7DD 1
-7DE 1
-7DF 1
-7E0 1
-7E1 1
-7E2 1
-7E3 1
-7E4 1
-7E5 1
-7E6 1
-7E7 1
-7E8 1
-7E9 1
-7EA 1
-7EB 1
-7EC 1
-7ED 1
-7EE 1
-7EF 1
-7F0 1
-7F1 1
-7F2 1
-7F3 1
-7F4 1
-7F5 1
-7F6 1
-7F7 1
-7F8 1
-7F9 1
-7FA 1
-7FB 1
-7FC 1
-7FD 1
-7FE 1
-7FF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-21 1
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-42 1
-43 1
-44 1
-45 1
-46 1
-47 1
-48 1
-49 1
-4A 1
-4B 1
-4C 1
-4D 1
-4E 1
-4F 1
-50 1
-51 1
-52 1
-53 1
-54 1
-55 1
-56 1
-57 1
-58 1
-59 1
-5A 1
-5B 1
-5E 1
-5F 1
-60 1
-61 1
-62 1
-63 1
-64 1
-65 1
-66 1
-67 1
-68 1
-69 1
-6A 1
-6B 1
-6C 1
-6D 1
-6E 1
-6F 1
-70 1
-71 1
-72 1
-73 1
-74 1
-75 1
-76 1
-77 1
-78 1
-79 1
-7A 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C285 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-C2A1 1
-C2A2 1
-C2A3 1
-C2A4 1
-C2A5 1
-C2A6 1
-C2A7 1
-C2A8 1
-C2A9 1
-C2AA 1
-C2AB 1
-C2AC 1
-C2AD 1
-C2AE 1
-C2AF 1
-C2B0 1
-C2B1 1
-C2B2 1
-C2B3 1
-C2B4 1
-C2B5 1
-C2B6 1
-C2B7 1
-C2B8 1
-C2B9 1
-C2BA 1
-C2BB 1
-C2BC 1
-C2BD 1
-C2BE 1
-C2BF 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C386 1
-C387 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C390 1
-C391 1
-C392 1
-C393 1
-C394 1
-C395 1
-C396 1
-C397 1
-C398 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C39D 1
-C39E 1
-C39F 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C3A6 1
-C3A7 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C3B0 1
-C3B1 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C3B6 1
-C3B7 1
-C3B8 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C3BD 1
-C3BE 1
-C3BF 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-C48E 1
-C48F 1
-C490 1
-C491 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C4A4 1
-C4A5 1
-C4A6 1
-C4A7 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C4B1 1
-C4B2 1
-C4B3 1
-C4B4 1
-C4B5 1
-C4B6 1
-C4B7 1
-C4B8 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-C4BF 1
-C580 1
-C581 1
-C582 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C589 1
-C58A 1
-C58B 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C592 1
-C593 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5A0 1
-C5A1 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C5A6 1
-C5A7 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C5B4 1
-C5B5 1
-C5B6 1
-C5B7 1
-C5B8 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C5BD 1
-C5BE 1
-C5BF 1
-C680 1
-C681 1
-C682 1
-C683 1
-C684 1
-C685 1
-C686 1
-C687 1
-C688 1
-C689 1
-C68A 1
-C68B 1
-C68C 1
-C68D 1
-C68E 1
-C68F 1
-C690 1
-C691 1
-C692 1
-C693 1
-C694 1
-C695 1
-C696 1
-C697 1
-C698 1
-C699 1
-C69A 1
-C69B 1
-C69C 1
-C69D 1
-C69E 1
-C69F 1
-C6A0 1
-C6A1 1
-C6A2 1
-C6A3 1
-C6A4 1
-C6A5 1
-C6A6 1
-C6A7 1
-C6A8 1
-C6A9 1
-C6AA 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-C6AF 1
-C6B0 1
-C6B1 1
-C6B2 1
-C6B3 1
-C6B4 1
-C6B5 1
-C6B6 1
-C6B7 1
-C6B8 1
-C6B9 1
-C6BA 1
-C6BB 1
-C6BC 1
-C6BD 1
-C6BE 1
-C6BF 1
-C780 1
-C781 1
-C782 1
-C783 1
-C784 1
-C785 1
-C786 1
-C787 1
-C788 1
-C789 1
-C78A 1
-C78B 1
-C78C 1
-C78D 1
-C78E 1
-C78F 1
-C790 1
-C791 1
-C792 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C79D 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7A2 1
-C7A3 1
-C7A4 1
-C7A5 1
-C7A6 1
-C7A7 1
-C7A8 1
-C7A9 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C7AE 1
-C7AF 1
-C7B0 1
-C7B1 1
-C7B2 1
-C7B3 1
-C7B4 1
-C7B5 1
-C7B6 1
-C7B7 1
-C7B8 1
-C7B9 1
-C7BA 1
-C7BB 1
-C7BC 1
-C7BD 1
-C7BE 1
-C7BF 1
-C880 1
-C881 1
-C882 1
-C883 1
-C884 1
-C885 1
-C886 1
-C887 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C890 1
-C891 1
-C892 1
-C893 1
-C894 1
-C895 1
-C896 1
-C897 1
-C898 1
-C899 1
-C89A 1
-C89B 1
-C89C 1
-C89D 1
-C89E 1
-C89F 1
-C8A0 1
-C8A1 1
-C8A2 1
-C8A3 1
-C8A4 1
-C8A5 1
-C8A6 1
-C8A7 1
-C8A8 1
-C8A9 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-C8B2 1
-C8B3 1
-C8B4 1
-C8B5 1
-C8B6 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-C990 1
-C991 1
-C992 1
-C993 1
-C994 1
-C995 1
-C996 1
-C997 1
-C998 1
-C999 1
-C99A 1
-C99B 1
-C99C 1
-C99D 1
-C99E 1
-C99F 1
-C9A0 1
-C9A1 1
-C9A2 1
-C9A3 1
-C9A4 1
-C9A5 1
-C9A6 1
-C9A7 1
-C9A8 1
-C9A9 1
-C9AA 1
-C9AB 1
-C9AC 1
-C9AD 1
-C9AE 1
-C9AF 1
-C9B0 1
-C9B1 1
-C9B2 1
-C9B3 1
-C9B4 1
-C9B5 1
-C9B6 1
-C9B7 1
-C9B8 1
-C9B9 1
-C9BA 1
-C9BB 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA80 1
-CA81 1
-CA82 1
-CA83 1
-CA84 1
-CA85 1
-CA86 1
-CA87 1
-CA88 1
-CA89 1
-CA8A 1
-CA8B 1
-CA8C 1
-CA8D 1
-CA8E 1
-CA8F 1
-CA90 1
-CA91 1
-CA92 1
-CA93 1
-CA94 1
-CA95 1
-CA96 1
-CA97 1
-CA98 1
-CA99 1
-CA9A 1
-CA9B 1
-CA9C 1
-CA9D 1
-CA9E 1
-CA9F 1
-CAA0 1
-CAA1 1
-CAA2 1
-CAA3 1
-CAA4 1
-CAA5 1
-CAA6 1
-CAA7 1
-CAA8 1
-CAA9 1
-CAAA 1
-CAAB 1
-CAAC 1
-CAAD 1
-CAAE 1
-CAAF 1
-CAB0 1
-CAB1 1
-CAB2 1
-CAB3 1
-CAB4 1
-CAB5 1
-CAB6 1
-CAB7 1
-CAB8 1
-CAB9 1
-CABA 1
-CABB 1
-CABC 1
-CABD 1
-CABE 1
-CABF 1
-CB80 1
-CB81 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB90 1
-CB91 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB98 1
-CB99 1
-CB9A 1
-CB9B 1
-CB9C 1
-CB9D 1
-CB9E 1
-CB9F 1
-CBA0 1
-CBA1 1
-CBA2 1
-CBA3 1
-CBA4 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAE 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-CDA3 1
-CDA4 1
-CDA5 1
-CDA6 1
-CDA7 1
-CDA8 1
-CDA9 1
-CDAA 1
-CDAB 1
-CDAC 1
-CDAD 1
-CDAE 1
-CDAF 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB4 1
-CDB5 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBA 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBE 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE84 1
-CE85 1
-CE86 1
-CE87 1
-CE88 1
-CE89 1
-CE8A 1
-CE8B 1
-CE8C 1
-CE8D 1
-CE8E 1
-CE8F 1
-CE90 1
-CE91 1
-CE92 1
-CE93 1
-CE94 1
-CE95 1
-CE96 1
-CE97 1
-CE98 1
-CE99 1
-CE9A 1
-CE9B 1
-CE9C 1
-CE9D 1
-CE9E 1
-CE9F 1
-CEA0 1
-CEA1 1
-CEA2 1
-CEA3 1
-CEA4 1
-CEA5 1
-CEA6 1
-CEA7 1
-CEA8 1
-CEA9 1
-CEAA 1
-CEAB 1
-CEAC 1
-CEAD 1
-CEAE 1
-CEAF 1
-CEB0 1
-CEB1 1
-CEB2 1
-CEB3 1
-CEB4 1
-CEB5 1
-CEB6 1
-CEB7 1
-CEB8 1
-CEB9 1
-CEBA 1
-CEBB 1
-CEBC 1
-CEBD 1
-CEBE 1
-CEBF 1
-CF80 1
-CF81 1
-CF82 1
-CF83 1
-CF84 1
-CF85 1
-CF86 1
-CF87 1
-CF88 1
-CF89 1
-CF8A 1
-CF8B 1
-CF8C 1
-CF8D 1
-CF8E 1
-CF8F 1
-CF90 1
-CF91 1
-CF92 1
-CF93 1
-CF94 1
-CF95 1
-CF96 1
-CF97 1
-CF98 1
-CF99 1
-CF9A 1
-CF9B 1
-CF9C 1
-CF9D 1
-CF9E 1
-CF9F 1
-CFA0 1
-CFA1 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-CFB0 1
-CFB1 1
-CFB2 1
-CFB3 1
-CFB4 1
-CFB5 1
-CFB6 1
-CFB7 1
-CFB8 1
-CFB9 1
-CFBA 1
-CFBB 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D080 1
-D081 1
-D082 1
-D083 1
-D084 1
-D085 1
-D086 1
-D087 1
-D088 1
-D089 1
-D08A 1
-D08B 1
-D08C 1
-D08D 1
-D08E 1
-D08F 1
-D090 1
-D091 1
-D092 1
-D093 1
-D094 1
-D095 1
-D096 1
-D097 1
-D098 1
-D099 1
-D09A 1
-D09B 1
-D09C 1
-D09D 1
-D09E 1
-D09F 1
-D0A0 1
-D0A1 1
-D0A2 1
-D0A3 1
-D0A4 1
-D0A5 1
-D0A6 1
-D0A7 1
-D0A8 1
-D0A9 1
-D0AA 1
-D0AB 1
-D0AC 1
-D0AD 1
-D0AE 1
-D0AF 1
-D0B0 1
-D0B1 1
-D0B2 1
-D0B3 1
-D0B4 1
-D0B5 1
-D0B6 1
-D0B7 1
-D0B8 1
-D0B9 1
-D0BA 1
-D0BB 1
-D0BC 1
-D0BD 1
-D0BE 1
-D0BF 1
-D180 1
-D181 1
-D182 1
-D183 1
-D184 1
-D185 1
-D186 1
-D187 1
-D188 1
-D189 1
-D18A 1
-D18B 1
-D18C 1
-D18D 1
-D18E 1
-D18F 1
-D190 1
-D191 1
-D192 1
-D193 1
-D194 1
-D195 1
-D196 1
-D197 1
-D198 1
-D199 1
-D19A 1
-D19B 1
-D19C 1
-D19D 1
-D19E 1
-D19F 1
-D1A0 1
-D1A1 1
-D1A2 1
-D1A3 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1A8 1
-D1A9 1
-D1AA 1
-D1AB 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D1B8 1
-D1B9 1
-D1BA 1
-D1BB 1
-D1BC 1
-D1BD 1
-D1BE 1
-D1BF 1
-D280 1
-D281 1
-D282 1
-D283 1
-D284 1
-D285 1
-D286 1
-D287 1
-D288 1
-D289 1
-D28A 1
-D28B 1
-D28C 1
-D28D 1
-D28E 1
-D28F 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D296 1
-D297 1
-D298 1
-D299 1
-D29A 1
-D29B 1
-D29C 1
-D29D 1
-D29E 1
-D29F 1
-D2A0 1
-D2A1 1
-D2A2 1
-D2A3 1
-D2A4 1
-D2A5 1
-D2A6 1
-D2A7 1
-D2A8 1
-D2A9 1
-D2AA 1
-D2AB 1
-D2AC 1
-D2AD 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D2B2 1
-D2B3 1
-D2B4 1
-D2B5 1
-D2B6 1
-D2B7 1
-D2B8 1
-D2B9 1
-D2BA 1
-D2BB 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D380 1
-D381 1
-D382 1
-D383 1
-D384 1
-D385 1
-D386 1
-D387 1
-D388 1
-D389 1
-D38A 1
-D38B 1
-D38C 1
-D38D 1
-D38E 1
-D38F 1
-D390 1
-D391 1
-D392 1
-D393 1
-D394 1
-D395 1
-D396 1
-D397 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D39C 1
-D39D 1
-D39E 1
-D39F 1
-D3A0 1
-D3A1 1
-D3A2 1
-D3A3 1
-D3A4 1
-D3A5 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D3AC 1
-D3AD 1
-D3AE 1
-D3AF 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D3B4 1
-D3B5 1
-D3B6 1
-D3B7 1
-D3B8 1
-D3B9 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D480 1
-D481 1
-D482 1
-D483 1
-D484 1
-D485 1
-D486 1
-D487 1
-D488 1
-D489 1
-D48A 1
-D48B 1
-D48C 1
-D48D 1
-D48E 1
-D48F 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D4B1 1
-D4B2 1
-D4B3 1
-D4B4 1
-D4B5 1
-D4B6 1
-D4B7 1
-D4B8 1
-D4B9 1
-D4BA 1
-D4BB 1
-D4BC 1
-D4BD 1
-D4BE 1
-D4BF 1
-D580 1
-D581 1
-D582 1
-D583 1
-D584 1
-D585 1
-D586 1
-D587 1
-D588 1
-D589 1
-D58A 1
-D58B 1
-D58C 1
-D58D 1
-D58E 1
-D58F 1
-D590 1
-D591 1
-D592 1
-D593 1
-D594 1
-D595 1
-D596 1
-D597 1
-D598 1
-D599 1
-D59A 1
-D59B 1
-D59C 1
-D59D 1
-D59E 1
-D59F 1
-D5A0 1
-D5A1 1
-D5A2 1
-D5A3 1
-D5A4 1
-D5A5 1
-D5A6 1
-D5A7 1
-D5A8 1
-D5A9 1
-D5AA 1
-D5AB 1
-D5AC 1
-D5AD 1
-D5AE 1
-D5AF 1
-D5B0 1
-D5B1 1
-D5B2 1
-D5B3 1
-D5B4 1
-D5B5 1
-D5B6 1
-D5B7 1
-D5B8 1
-D5B9 1
-D5BA 1
-D5BB 1
-D5BC 1
-D5BD 1
-D5BE 1
-D5BF 1
-D680 1
-D681 1
-D682 1
-D683 1
-D684 1
-D685 1
-D686 1
-D687 1
-D688 1
-D689 1
-D68A 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A2 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BA 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BE 1
-D6BF 1
-D780 1
-D781 1
-D782 1
-D783 1
-D784 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D796 1
-D797 1
-D798 1
-D799 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B0 1
-D7B1 1
-D7B2 1
-D7B3 1
-D7B4 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D880 1
-D881 1
-D882 1
-D883 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D88C 1
-D88D 1
-D88E 1
-D88F 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89B 1
-D89C 1
-D89D 1
-D89E 1
-D89F 1
-D8A0 1
-D8A1 1
-D8A2 1
-D8A3 1
-D8A4 1
-D8A5 1
-D8A6 1
-D8A7 1
-D8A8 1
-D8A9 1
-D8AA 1
-D8AB 1
-D8AC 1
-D8AD 1
-D8AE 1
-D8AF 1
-D8B0 1
-D8B1 1
-D8B2 1
-D8B3 1
-D8B4 1
-D8B5 1
-D8B6 1
-D8B7 1
-D8B8 1
-D8B9 1
-D8BA 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D980 1
-D981 1
-D982 1
-D983 1
-D984 1
-D985 1
-D986 1
-D987 1
-D988 1
-D989 1
-D98A 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-D9A0 1
-D9A1 1
-D9A2 1
-D9A3 1
-D9A4 1
-D9A5 1
-D9A6 1
-D9A7 1
-D9A8 1
-D9A9 1
-D9AA 1
-D9AB 1
-D9AC 1
-D9AD 1
-D9AE 1
-D9AF 1
-D9B0 1
-D9B1 1
-D9B2 1
-D9B3 1
-D9B4 1
-D9B5 1
-D9B6 1
-D9B7 1
-D9B8 1
-D9B9 1
-D9BA 1
-D9BB 1
-D9BC 1
-D9BD 1
-D9BE 1
-D9BF 1
-DA80 1
-DA81 1
-DA82 1
-DA83 1
-DA84 1
-DA85 1
-DA86 1
-DA87 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DA9A 1
-DA9B 1
-DA9C 1
-DA9D 1
-DA9E 1
-DA9F 1
-DAA0 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-DAA7 1
-DAA8 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-DAB9 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DABE 1
-DABF 1
-DB80 1
-DB81 1
-DB82 1
-DB83 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB8F 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DB94 1
-DB95 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA5 1
-DBA6 1
-DBA7 1
-DBA8 1
-DBA9 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DBAE 1
-DBAF 1
-DBB0 1
-DBB1 1
-DBB2 1
-DBB3 1
-DBB4 1
-DBB5 1
-DBB6 1
-DBB7 1
-DBB8 1
-DBB9 1
-DBBA 1
-DBBB 1
-DBBC 1
-DBBD 1
-DBBE 1
-DBBF 1
-DC80 1
-DC81 1
-DC82 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-DC89 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-DC8E 1
-DC8F 1
-DC90 1
-DC91 1
-DC92 1
-DC93 1
-DC94 1
-DC95 1
-DC96 1
-DC97 1
-DC98 1
-DC99 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DCAD 1
-DCAE 1
-DCAF 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-DD8B 1
-DD8C 1
-DD8D 1
-DD8E 1
-DD8F 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DE80 1
-DE81 1
-DE82 1
-DE83 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DE88 1
-DE89 1
-DE8A 1
-DE8B 1
-DE8C 1
-DE8D 1
-DE8E 1
-DE8F 1
-DE90 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DE98 1
-DE99 1
-DE9A 1
-DE9B 1
-DE9C 1
-DE9D 1
-DE9E 1
-DE9F 1
-DEA0 1
-DEA1 1
-DEA2 1
-DEA3 1
-DEA4 1
-DEA5 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-DEB1 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-CDA8 1
-C48C 1
-C48D 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C396 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C3B6 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C598 1
-C599 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-C5A0 1
-C5A1 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C68D 1
-C5BD 1
-C5BE 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-CDA8 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C9B6 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5A0 1
-C5A1 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C3B9 1
-C3BA 1
-C3BB 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39C 1
-C39D 1
-C3BC 1
-C3BD 1
-C3BF 1
-C5B0 1
-C5B1 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C5BD 1
-C5BE 1
-C68D 1
-C384 1
-C386 1
-C3A4 1
-C3A6 1
-C396 1
-C398 1
-C3B6 1
-C3B8 1
-C590 1
-C591 1
-C385 1
-C3A5 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-CDA8 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C3B2 1
-C3B3 1
-C3B4 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-C5A0 1
-C5A1 1
-5A 1
-7A 1
-C5BD 1
-C5BE 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C3B9 1
-C3BA 1
-C3BB 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-C395 1
-C3B5 1
-C384 1
-C3A4 1
-C396 1
-C3B6 1
-C39C 1
-C3BC 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C68D 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-21 1
-22 1
-23 1
-24 1
-25 1
-26 1
-27 1
-28 1
-29 1
-2A 1
-2B 1
-2C 1
-2D 1
-2E 1
-2F 1
-30 1
-31 1
-32 1
-33 1
-34 1
-35 1
-36 1
-37 1
-38 1
-39 1
-3A 1
-3B 1
-3C 1
-3D 1
-3E 1
-3F 1
-40 1
-41 1
-61 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-42 1
-62 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-44 1
-64 1
-C48E 1
-C48F 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-46 1
-66 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C4B1 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-4D 1
-6D 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-4F 1
-6F 1
-C392 1
-C393 1
-C394 1
-C395 1
-C396 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C3B6 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-50 1
-70 1
-51 1
-71 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5A0 1
-C5A1 1
-C5BF 1
-C898 1
-C899 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-56 1
-76 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-58 1
-78 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C5BD 1
-C5BE 1
-5B 1
-5E 1
-5F 1
-60 1
-7B 1
-7C 1
-7D 1
-7E 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C285 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-C2A1 1
-C2A2 1
-C2A3 1
-C2A4 1
-C2A5 1
-C2A6 1
-C2A7 1
-C2A8 1
-C2A9 1
-C2AA 1
-C2AB 1
-C2AC 1
-C2AD 1
-C2AE 1
-C2AF 1
-C2B0 1
-C2B1 1
-C2B2 1
-C2B3 1
-C2B4 1
-C2B6 1
-C2B7 1
-C2B8 1
-C2B9 1
-C2BA 1
-C2BB 1
-C2BC 1
-C2BD 1
-C2BE 1
-C2BF 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C390 1
-C3B0 1
-C397 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C39E 1
-C3BE 1
-C39F 1
-C3B7 1
-C490 1
-C491 1
-C4A6 1
-C4A7 1
-C4B2 1
-C4B3 1
-C4B8 1
-C4BF 1
-C580 1
-C581 1
-C582 1
-C589 1
-C58A 1
-C58B 1
-C592 1
-C593 1
-C5A6 1
-C5A7 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-C684 1
-C685 1
-C686 1
-C994 1
-C687 1
-C688 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C68D 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C691 1
-C692 1
-C693 1
-C9A0 1
-C694 1
-C9A3 1
-C696 1
-C9A9 1
-C697 1
-C9A8 1
-C698 1
-C699 1
-C69A 1
-C69B 1
-C69C 1
-C9AF 1
-C69D 1
-C9B2 1
-C69E 1
-C69F 1
-C9B5 1
-C6A2 1
-C6A3 1
-C6A4 1
-C6A5 1
-C6A6 1
-CA80 1
-C6A7 1
-C6A8 1
-C6A9 1
-CA83 1
-C6AA 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C6B1 1
-CA8A 1
-C6B2 1
-CA8B 1
-C6B3 1
-C6B4 1
-C6B5 1
-C6B6 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-C6BB 1
-C6BC 1
-C6BD 1
-C6BE 1
-C780 1
-C781 1
-C782 1
-C783 1
-C784 1
-C785 1
-C786 1
-C787 1
-C788 1
-C789 1
-C78A 1
-C78B 1
-C78C 1
-C7A4 1
-C7A5 1
-C7B1 1
-C7B2 1
-C7B3 1
-C695 1
-C7B6 1
-C6BF 1
-C7B7 1
-C89C 1
-C89D 1
-C8A0 1
-C8A1 1
-C8A2 1
-C8A3 1
-C8A4 1
-C8A5 1
-C8B4 1
-C8B5 1
-C8B6 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-C990 1
-C991 1
-C992 1
-C995 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-C99F 1
-C9A1 1
-C9A2 1
-C9A4 1
-C9A5 1
-C9A6 1
-C9A7 1
-C9AA 1
-C9AB 1
-C9AC 1
-C9AD 1
-C9AE 1
-C9B0 1
-C9B1 1
-C9B3 1
-C9B4 1
-C9B6 1
-C9B7 1
-C9B8 1
-C9B9 1
-C9BA 1
-C9BB 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CA82 1
-CA84 1
-CA85 1
-CA86 1
-CA87 1
-CA89 1
-CA8C 1
-CA8D 1
-CA8E 1
-CA8F 1
-CA90 1
-CA91 1
-CA93 1
-CA94 1
-CA95 1
-CA96 1
-CA97 1
-CA98 1
-CA99 1
-CA9A 1
-CA9B 1
-CA9C 1
-CA9D 1
-CA9E 1
-CA9F 1
-CAA0 1
-CAA1 1
-CAA2 1
-CAA3 1
-CAA4 1
-CAA5 1
-CAA6 1
-CAA7 1
-CAA8 1
-CAA9 1
-CAAA 1
-CAAB 1
-CAAC 1
-CAAD 1
-CAAE 1
-CAAF 1
-CAB0 1
-CAB1 1
-CAB2 1
-CAB3 1
-CAB4 1
-CAB5 1
-CAB6 1
-CAB7 1
-CAB8 1
-CAB9 1
-CABA 1
-CABB 1
-CABC 1
-CABD 1
-CABE 1
-CABF 1
-CB80 1
-CB81 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB90 1
-CB91 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB98 1
-CB99 1
-CB9A 1
-CB9B 1
-CB9C 1
-CB9D 1
-CB9E 1
-CB9F 1
-CBA0 1
-CBA1 1
-CBA2 1
-CBA3 1
-CBA4 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAE 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-CDA3 1
-CDA4 1
-CDA5 1
-CDA6 1
-CDA7 1
-CDA8 1
-CDA9 1
-CDAA 1
-CDAB 1
-CDAC 1
-CDAD 1
-CDAE 1
-CDAF 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB4 1
-CDB5 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBA 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBE 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE84 1
-CE85 1
-CE87 1
-CE8B 1
-CE8D 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CD85 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CE9A 1
-CEBA 1
-CFB0 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA2 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CF8F 1
-CF92 1
-CF93 1
-CF94 1
-CF97 1
-CF98 1
-CF99 1
-CF9A 1
-CF9B 1
-CF9C 1
-CF9D 1
-CF9E 1
-CF9F 1
-CFA0 1
-CFA1 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-CFB3 1
-CFB4 1
-CFB5 1
-CFB6 1
-CFB7 1
-CFB8 1
-CFB9 1
-CFBA 1
-CFBB 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D082 1
-D192 1
-D084 1
-D194 1
-D085 1
-D195 1
-D086 1
-D087 1
-D196 1
-D197 1
-D088 1
-D198 1
-D089 1
-D199 1
-D08A 1
-D19A 1
-D08B 1
-D19B 1
-D08F 1
-D19F 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D083 1
-D093 1
-D0B3 1
-D193 1
-D094 1
-D0B4 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D097 1
-D0B7 1
-D39E 1
-D39F 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D3A4 1
-D3A5 1
-D099 1
-D0B9 1
-D08C 1
-D09A 1
-D0BA 1
-D19C 1
-D09B 1
-D0BB 1
-D09C 1
-D0BC 1
-D09D 1
-D0BD 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D09F 1
-D0BF 1
-D0A0 1
-D180 1
-D0A1 1
-D181 1
-D0A2 1
-D182 1
-D08E 1
-D0A3 1
-D183 1
-D19E 1
-D3AE 1
-D3AF 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D0A6 1
-D186 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A0 1
-D1A1 1
-D1A2 1
-D1A3 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1A8 1
-D1A9 1
-D1AA 1
-D1AB 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D1B8 1
-D1B9 1
-D1BA 1
-D1BB 1
-D1BC 1
-D1BD 1
-D1BE 1
-D1BF 1
-D280 1
-D281 1
-D282 1
-D283 1
-D284 1
-D285 1
-D286 1
-D287 1
-D288 1
-D289 1
-D28A 1
-D28B 1
-D28C 1
-D28D 1
-D28E 1
-D28F 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D296 1
-D297 1
-D298 1
-D299 1
-D29A 1
-D29B 1
-D29C 1
-D29D 1
-D29E 1
-D29F 1
-D2A0 1
-D2A1 1
-D2A2 1
-D2A3 1
-D2A4 1
-D2A5 1
-D2A6 1
-D2A7 1
-D2A8 1
-D2A9 1
-D2AA 1
-D2AB 1
-D2AC 1
-D2AD 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D2B2 1
-D2B3 1
-D2B4 1
-D2B5 1
-D2B6 1
-D2B7 1
-D2B8 1
-D2B9 1
-D2BA 1
-D2BB 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D380 1
-D383 1
-D384 1
-D385 1
-D386 1
-D387 1
-D388 1
-D389 1
-D38A 1
-D38B 1
-D38C 1
-D38D 1
-D38E 1
-D38F 1
-D394 1
-D395 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D3A0 1
-D3A1 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D480 1
-D481 1
-D482 1
-D483 1
-D484 1
-D485 1
-D486 1
-D487 1
-D488 1
-D489 1
-D48A 1
-D48B 1
-D48C 1
-D48D 1
-D48E 1
-D48F 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D597 1
-D598 1
-D599 1
-D59A 1
-D59B 1
-D59C 1
-D59D 1
-D59E 1
-D59F 1
-D5A0 1
-D687 1
-D688 1
-D689 1
-D68A 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A2 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BA 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BE 1
-D6BF 1
-D780 1
-D781 1
-D782 1
-D783 1
-D784 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D796 1
-D797 1
-D798 1
-D799 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B0 1
-D7B1 1
-D7B2 1
-D7B3 1
-D7B4 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D880 1
-D881 1
-D882 1
-D883 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D88C 1
-D88D 1
-D88E 1
-D88F 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89B 1
-D89C 1
-D89D 1
-D89E 1
-D89F 1
-D8A0 1
-D8A1 1
-D8A2 1
-D8A3 1
-D8A4 1
-D8A5 1
-D8A6 1
-D8A7 1
-D8A8 1
-D8A9 1
-D8AA 1
-D8AB 1
-D8AC 1
-D8AD 1
-D8AE 1
-D8AF 1
-D8B0 1
-D8B1 1
-D8B2 1
-D8B3 1
-D8B4 1
-D8B5 1
-D8B6 1
-D8B7 1
-D8B8 1
-D8B9 1
-D8BA 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D980 1
-D981 1
-D982 1
-D983 1
-D984 1
-D985 1
-D986 1
-D987 1
-D988 1
-D989 1
-D98A 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-D9A0 1
-D9A1 1
-D9A2 1
-D9A3 1
-D9A4 1
-D9A5 1
-D9A6 1
-D9A7 1
-D9A8 1
-D9A9 1
-D9AA 1
-D9AB 1
-D9AC 1
-D9AD 1
-D9AE 1
-D9AF 1
-D9B0 1
-D9B1 1
-D9B2 1
-D9B3 1
-D9B4 1
-D9B5 1
-D9B6 1
-D9B7 1
-D9B8 1
-D9B9 1
-D9BA 1
-D9BB 1
-D9BC 1
-D9BD 1
-D9BE 1
-D9BF 1
-DA80 1
-DA81 1
-DA82 1
-DA83 1
-DA84 1
-DA85 1
-DA86 1
-DA87 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DA9A 1
-DA9B 1
-DA9C 1
-DA9D 1
-DA9E 1
-DA9F 1
-DAA0 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-DAA7 1
-DAA8 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-DAB9 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DABE 1
-DABF 1
-DB80 1
-DB81 1
-DB82 1
-DB83 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB8F 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DB94 1
-DB95 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA5 1
-DBA6 1
-DBA7 1
-DBA8 1
-DBA9 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DBAE 1
-DBAF 1
-DBB0 1
-DBB1 1
-DBB2 1
-DBB3 1
-DBB4 1
-DBB5 1
-DBB6 1
-DBB7 1
-DBB8 1
-DBB9 1
-DBBA 1
-DBBB 1
-DBBC 1
-DBBD 1
-DBBE 1
-DBBF 1
-DC80 1
-DC81 1
-DC82 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-DC89 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-DC8E 1
-DC8F 1
-DC90 1
-DC91 1
-DC92 1
-DC93 1
-DC94 1
-DC95 1
-DC96 1
-DC97 1
-DC98 1
-DC99 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DCAD 1
-DCAE 1
-DCAF 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-DD8B 1
-DD8C 1
-DD8D 1
-DD8E 1
-DD8F 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DE80 1
-DE81 1
-DE82 1
-DE83 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DE88 1
-DE89 1
-DE8A 1
-DE8B 1
-DE8C 1
-DE8D 1
-DE8E 1
-DE8F 1
-DE90 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DE98 1
-DE99 1
-DE9A 1
-DE9B 1
-DE9C 1
-DE9D 1
-DE9E 1
-DE9F 1
-DEA0 1
-DEA1 1
-DEA2 1
-DEA3 1
-DEA4 1
-DEA5 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-DEB1 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-CDA8 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C396 1
-C3B6 1
-C590 1
-C591 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5A0 1
-C5A1 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C3B9 1
-C3BA 1
-C3BB 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-C39C 1
-C3BC 1
-C5B0 1
-C5B1 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C5BD 1
-C5BE 1
-C68D 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C382 1
-C383 1
-C3A0 1
-C3A2 1
-C3A3 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C381 1
-C3A1 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-CDA8 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C390 1
-C3B0 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-45 1
-65 1
-C388 1
-C38A 1
-C38B 1
-C3A8 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C389 1
-C3A9 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38E 1
-C38F 1
-C3AC 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C38D 1
-C3AD 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C394 1
-C395 1
-C3B2 1
-C3B4 1
-C3B5 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C393 1
-C3B3 1
-C9B6 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5A0 1
-C5A1 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39B 1
-C39C 1
-C3B9 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-C39A 1
-C3BA 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-C39D 1
-C3BD 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C5BD 1
-C5BE 1
-C68D 1
-C39E 1
-C3BE 1
-C384 1
-C386 1
-C3A4 1
-C3A6 1
-C396 1
-C398 1
-C3B6 1
-C3B8 1
-C385 1
-C3A5 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-CDA8 1
-C48C 1
-C48D 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C4A2 1
-C4A3 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-59 1
-79 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C7A8 1
-C7A9 1
-C4B6 1
-C4B7 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-C4BB 1
-C4BC 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C585 1
-C586 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C396 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C3B6 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C596 1
-C597 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-C5A0 1
-C5A1 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C68D 1
-C5BD 1
-C5BE 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-CDA8 1
-C48C 1
-C48D 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-59 1
-69 1
-79 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C396 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C3B6 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-C5A0 1
-C5A1 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C68D 1
-C5BD 1
-C5BE 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-D993 1
-D994 1
-D995 1
-D9B0 1
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D991 1
-D992 1
-D996 1
-D997 1
-D998 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-D98E 1
-26 1
-D990 1
-23 1
-D98F 1
-25 1
-D9AA 1
-D98B 1
-D98D 1
-D98C 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-D8A2 1
-D8A7 1
-D9B1 1
-D8A1 1
-D8A3 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-D8A5 1
-D8A4 1
-D8A6 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-CDA8 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C396 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C3B6 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5A0 1
-C5A1 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C5BD 1
-C5BE 1
-C68D 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D9B4 1
-DBBD 1
-D9B2 1
-D9B3 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-DA89 1
-DA8A 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA9 1
-D983 1
-DAA8 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-D987 1
-DB84 1
-D8A9 1
-DB85 1
-DB80 1
-DB86 1
-DB87 1
-DB8C 1
-D9B7 1
-D989 1
-DB88 1
-D98A 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-DBA6 1
-D9B8 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C484 1
-C485 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-CDA8 1
-C486 1
-C487 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C498 1
-C499 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-C581 1
-C582 1
-CA9F 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C583 1
-C584 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C394 1
-C395 1
-C396 1
-C3B2 1
-C3B4 1
-C3B5 1
-C3B6 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C393 1
-C3B3 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5A0 1
-C5A1 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-C59A 1
-C59B 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5BD 1
-C5BE 1
-C68D 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-CDA8 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-4A 1
-69 1
-6A 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C396 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C3B6 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5A0 1
-C5A1 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-55 1
-56 1
-75 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C5BD 1
-C5BE 1
-C68D 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C482 1
-C483 1
-C382 1
-C3A2 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-CDA8 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C38E 1
-C3AE 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C396 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C3B6 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C5A0 1
-C5A1 1
-C5BF 1
-CBA2 1
-C39F 1
-C59E 1
-C59F 1
-C898 1
-C899 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A4 1
-C5A5 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A2 1
-C5A3 1
-C89A 1
-C89B 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C5BD 1
-C5BE 1
-C68D 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C384 1
-C3A4 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-CDA8 1
-C48C 1
-C48D 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C395 1
-C396 1
-C3B2 1
-C3B3 1
-C3B5 1
-C3B6 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C394 1
-C3B4 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-C5A0 1
-C5A1 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C68D 1
-C5BD 1
-C5BE 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-CDA8 1
-C48C 1
-C48D 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C396 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C3B6 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-C5A0 1
-C5A1 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C68D 1
-C5BD 1
-C5BE 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-CDA8 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C391 1
-C3B1 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C396 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C3B6 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5A0 1
-C5A1 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C5BD 1
-C5BE 1
-C68D 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-CDA8 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C391 1
-C3B1 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C396 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C3B6 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5A0 1
-C5A1 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C5BD 1
-C5BE 1
-C68D 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-CDA8 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C9B6 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5A0 1
-C5A1 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C3B9 1
-C3BA 1
-C3BB 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39C 1
-C39D 1
-C3BC 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C5BD 1
-C5BE 1
-C68D 1
-C385 1
-C3A5 1
-C384 1
-C386 1
-C3A4 1
-C3A6 1
-C396 1
-C398 1
-C3B6 1
-C3B8 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-CDA8 1
-C387 1
-C3A7 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C49E 1
-C49F 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-49 1
-C4B1 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C396 1
-C3B6 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C5A0 1
-C5A1 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-C59E 1
-C59F 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C3B9 1
-C3BA 1
-C3BB 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-C39C 1
-C3BC 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C5BD 1
-C5BE 1
-C68D 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t1;
-DROP DATABASE test;
-CREATE DATABASE test CHARACTER SET utf8;
-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 # # #
-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;
-SELECT HEX(ORD(a)) AS a_ord, CHAR_LENGTH(a) AS a_len FROM test.t1 ORDER BY a, ORD(a);
-a_ord a_len
-C285 1
-7F 1
-C280 1
-C281 1
-C282 1
-C283 1
-C284 1
-C286 1
-C287 1
-C288 1
-C289 1
-C28A 1
-C28B 1
-C28C 1
-C28D 1
-C28E 1
-C28F 1
-C290 1
-C291 1
-C292 1
-C293 1
-C294 1
-C295 1
-C296 1
-C297 1
-C298 1
-C299 1
-C29A 1
-C29B 1
-C29C 1
-C29D 1
-C29E 1
-C29F 1
-C2A0 1
-CC80 1
-CC81 1
-CC82 1
-CC83 1
-CC84 1
-CC85 1
-CC86 1
-CC87 1
-CC88 1
-CC89 1
-CC8A 1
-CC8B 1
-CC8C 1
-CC8D 1
-CC8E 1
-CC8F 1
-CC90 1
-CC91 1
-CC92 1
-CC93 1
-CC94 1
-CC95 1
-CC96 1
-CC97 1
-CC98 1
-CC99 1
-CC9A 1
-CC9B 1
-CC9C 1
-CC9D 1
-CC9E 1
-CC9F 1
-CCA0 1
-CCA1 1
-CCA2 1
-CCA3 1
-CCA4 1
-CCA5 1
-CCA6 1
-CCA7 1
-CCA8 1
-CCA9 1
-CCAA 1
-CCAB 1
-CCAC 1
-CCAD 1
-CCAE 1
-CCAF 1
-CCB0 1
-CCB1 1
-CCB2 1
-CCB3 1
-CCB4 1
-CCB5 1
-CCB6 1
-CCB7 1
-CCB8 1
-CCB9 1
-CCBA 1
-CCBB 1
-CCBC 1
-CCBD 1
-CCBE 1
-CCBF 1
-CD80 1
-CD81 1
-CD82 1
-CD83 1
-CD84 1
-CD85 1
-CD86 1
-CD87 1
-CD88 1
-CD89 1
-CD8A 1
-CD8B 1
-CD8C 1
-CD8D 1
-CD8E 1
-CD8F 1
-CD90 1
-CD91 1
-CD92 1
-CD93 1
-CD94 1
-CD95 1
-CD96 1
-CD97 1
-CD9D 1
-CD9E 1
-CD9F 1
-CDA0 1
-CDA1 1
-CDA2 1
-D283 1
-D284 1
-D285 1
-D286 1
-D288 1
-D289 1
-D691 1
-D692 1
-D693 1
-D694 1
-D695 1
-D696 1
-D697 1
-D698 1
-D699 1
-D69A 1
-D69B 1
-D69C 1
-D69D 1
-D69E 1
-D69F 1
-D6A0 1
-D6A1 1
-D6A3 1
-D6A4 1
-D6A5 1
-D6A6 1
-D6A7 1
-D6A8 1
-D6A9 1
-D6AA 1
-D6AB 1
-D6AC 1
-D6AD 1
-D6AE 1
-D6AF 1
-D6B0 1
-D6B1 1
-D6B2 1
-D6B3 1
-D6B4 1
-D6B5 1
-D6B6 1
-D6B7 1
-D6B8 1
-D6B9 1
-D6BB 1
-D6BC 1
-D6BD 1
-D6BF 1
-D781 1
-D782 1
-D784 1
-D880 1
-D881 1
-D882 1
-D883 1
-D890 1
-D891 1
-D892 1
-D893 1
-D894 1
-D895 1
-D98B 1
-D98C 1
-D98D 1
-D98E 1
-D98F 1
-D990 1
-D991 1
-D992 1
-D993 1
-D994 1
-D995 1
-D996 1
-D997 1
-D998 1
-D9B0 1
-DB96 1
-DB97 1
-DB98 1
-DB99 1
-DB9A 1
-DB9B 1
-DB9C 1
-DB9D 1
-DB9E 1
-DB9F 1
-DBA0 1
-DBA1 1
-DBA2 1
-DBA3 1
-DBA4 1
-DBA7 1
-DBA8 1
-DBAA 1
-DBAB 1
-DBAC 1
-DBAD 1
-DC8F 1
-DC91 1
-DCB0 1
-DCB1 1
-DCB2 1
-DCB3 1
-DCB4 1
-DCB5 1
-DCB6 1
-DCB7 1
-DCB8 1
-DCB9 1
-DCBA 1
-DCBB 1
-DCBC 1
-DCBD 1
-DCBE 1
-DCBF 1
-DD80 1
-DD81 1
-DD82 1
-DD83 1
-DD84 1
-DD85 1
-DD86 1
-DD87 1
-DD88 1
-DD89 1
-DD8A 1
-D980 1
-60 1
-C2B4 1
-CE84 1
-CB9C 1
-5E 1
-C2AF 1
-CB98 1
-CB99 1
-C2A8 1
-CE85 1
-CB9A 1
-CB9D 1
-C2B8 1
-CB9B 1
-5F 1
-C2AD 1
-2D 1
-D68A 1
-2C 1
-D59D 1
-D88C 1
-D88D 1
-D9AB 1
-D9AC 1
-3B 1
-CDBE 1
-D89B 1
-3A 1
-D689 1
-DC83 1
-DC84 1
-DC85 1
-DC86 1
-DC87 1
-DC88 1
-21 1
-C2A1 1
-D59C 1
-3F 1
-C2BF 1
-D59E 1
-D89F 1
-DC89 1
-2E 1
-DB94 1
-DC81 1
-DC82 1
-C2B7 1
-CE87 1
-DC80 1
-27 1
-22 1
-C2AB 1
-C2BB 1
-28 1
-29 1
-5B 1
-7B 1
-7D 1
-C2A7 1
-C2B6 1
-C2A9 1
-C2AE 1
-40 1
-2A 1
-D9AD 1
-2F 1
-26 1
-23 1
-25 1
-D9AA 1
-D59A 1
-D59B 1
-D59F 1
-D6BE 1
-D780 1
-D783 1
-D7B3 1
-D7B4 1
-DC8A 1
-DC8B 1
-DC8C 1
-DC8D 1
-CAB9 1
-CDB4 1
-CDB5 1
-CABA 1
-CB82 1
-CB83 1
-CB84 1
-CB85 1
-CB86 1
-CB87 1
-CB88 1
-CB89 1
-CB8A 1
-CB8B 1
-CB8C 1
-CB8D 1
-CB8E 1
-CB8F 1
-CB92 1
-CB93 1
-CB94 1
-CB95 1
-CB96 1
-CB97 1
-CB9E 1
-CB9F 1
-CBA5 1
-CBA6 1
-CBA7 1
-CBA8 1
-CBA9 1
-CBAA 1
-CBAB 1
-CBAC 1
-CBAD 1
-CBAF 1
-CBB0 1
-CBB1 1
-CBB2 1
-CBB3 1
-CBB4 1
-CBB5 1
-CBB6 1
-CBB7 1
-CBB8 1
-CBB9 1
-CBBA 1
-CBBB 1
-CBBC 1
-CBBD 1
-CBBE 1
-CBBF 1
-C2B0 1
-D282 1
-D88E 1
-D88F 1
-DBA9 1
-CFB6 1
-2B 1
-C2B1 1
-C3B7 1
-C397 1
-3C 1
-3D 1
-3E 1
-C2AC 1
-7C 1
-C2A6 1
-7E 1
-CB90 1
-CB91 1
-C2A4 1
-C2A2 1
-24 1
-C2A3 1
-C2A5 1
-30 1
-D9A0 1
-DBB0 1
-31 1
-C2B9 1
-D9A1 1
-DBB1 1
-C2BD 1
-C2BC 1
-32 1
-C2B2 1
-D9A2 1
-DBB2 1
-33 1
-C2B3 1
-D9A3 1
-DBB3 1
-C2BE 1
-34 1
-D9A4 1
-DBB4 1
-35 1
-D9A5 1
-DBB5 1
-36 1
-D9A6 1
-DBB6 1
-37 1
-D9A7 1
-DBB7 1
-38 1
-D9A8 1
-DBB8 1
-39 1
-D9A9 1
-DBB9 1
-41 1
-61 1
-C2AA 1
-C380 1
-C381 1
-C382 1
-C383 1
-C384 1
-C385 1
-C3A0 1
-C3A1 1
-C3A2 1
-C3A3 1
-C3A4 1
-C3A5 1
-C480 1
-C481 1
-C482 1
-C483 1
-C484 1
-C485 1
-C78D 1
-C78E 1
-C79E 1
-C79F 1
-C7A0 1
-C7A1 1
-C7BA 1
-C7BB 1
-C880 1
-C881 1
-C882 1
-C883 1
-C8A6 1
-C8A7 1
-CDA3 1
-C386 1
-C3A6 1
-C7A2 1
-C7A3 1
-C7BC 1
-C7BD 1
-C990 1
-C991 1
-C992 1
-42 1
-62 1
-CA99 1
-C680 1
-C681 1
-C993 1
-C682 1
-C683 1
-43 1
-63 1
-C387 1
-C3A7 1
-C486 1
-C487 1
-C488 1
-C489 1
-C48A 1
-C48B 1
-C48C 1
-C48D 1
-CDA8 1
-C687 1
-C688 1
-C995 1
-44 1
-64 1
-C48E 1
-C48F 1
-CDA9 1
-C784 1
-C785 1
-C786 1
-C7B1 1
-C7B2 1
-C7B3 1
-CAA3 1
-CAA5 1
-CAA4 1
-C490 1
-C491 1
-C689 1
-C996 1
-C68A 1
-C997 1
-C68B 1
-C68C 1
-C8A1 1
-C390 1
-C3B0 1
-45 1
-65 1
-C388 1
-C389 1
-C38A 1
-C38B 1
-C3A8 1
-C3A9 1
-C3AA 1
-C3AB 1
-C492 1
-C493 1
-C494 1
-C495 1
-C496 1
-C497 1
-C498 1
-C499 1
-C49A 1
-C49B 1
-C884 1
-C885 1
-C886 1
-C887 1
-C8A8 1
-C8A9 1
-CDA4 1
-C68E 1
-C79D 1
-C68F 1
-C999 1
-C690 1
-C99B 1
-C998 1
-C99A 1
-C99C 1
-C99D 1
-C99E 1
-CA9A 1
-C9A4 1
-46 1
-66 1
-CAA9 1
-C691 1
-C692 1
-47 1
-67 1
-C49C 1
-C49D 1
-C49E 1
-C49F 1
-C4A0 1
-C4A1 1
-C4A2 1
-C4A3 1
-C7A6 1
-C7A7 1
-C7B4 1
-C7B5 1
-C9A1 1
-C9A2 1
-C7A4 1
-C7A5 1
-C693 1
-C9A0 1
-CA9B 1
-C694 1
-C9A3 1
-CBA0 1
-C6A2 1
-C6A3 1
-48 1
-68 1
-C4A4 1
-C4A5 1
-C89E 1
-C89F 1
-CAB0 1
-CDAA 1
-CA9C 1
-C695 1
-C7B6 1
-C4A6 1
-C4A7 1
-C9A6 1
-CAB1 1
-C9A7 1
-CABB 1
-CABD 1
-49 1
-69 1
-C38C 1
-C38D 1
-C38E 1
-C38F 1
-C3AC 1
-C3AD 1
-C3AE 1
-C3AF 1
-C4A8 1
-C4A9 1
-C4AA 1
-C4AB 1
-C4AC 1
-C4AD 1
-C4AE 1
-C4AF 1
-C4B0 1
-C78F 1
-C790 1
-C888 1
-C889 1
-C88A 1
-C88B 1
-CDA5 1
-C4B2 1
-C4B3 1
-C4B1 1
-C9AA 1
-C697 1
-C9A8 1
-C696 1
-C9A9 1
-4A 1
-6A 1
-C4B4 1
-C4B5 1
-C7B0 1
-CAB2 1
-CA9D 1
-C99F 1
-CA84 1
-4B 1
-6B 1
-C4B6 1
-C4B7 1
-C7A8 1
-C7A9 1
-C698 1
-C699 1
-CA9E 1
-4C 1
-6C 1
-C4B9 1
-C4BA 1
-C4BB 1
-C4BC 1
-C4BD 1
-C4BE 1
-CBA1 1
-C4BF 1
-C580 1
-C787 1
-C788 1
-C789 1
-CAAA 1
-CAAB 1
-CA9F 1
-C581 1
-C582 1
-C69A 1
-C9AB 1
-C9AC 1
-C9AD 1
-C8B4 1
-C9AE 1
-C69B 1
-CA8E 1
-4D 1
-6D 1
-CDAB 1
-C9B1 1
-4E 1
-6E 1
-C391 1
-C3B1 1
-C583 1
-C584 1
-C585 1
-C586 1
-C587 1
-C588 1
-C7B8 1
-C7B9 1
-C78A 1
-C78B 1
-C78C 1
-C9B4 1
-C69D 1
-C9B2 1
-C69E 1
-C8A0 1
-C9B3 1
-C8B5 1
-C58A 1
-C58B 1
-4F 1
-6F 1
-C2BA 1
-C392 1
-C393 1
-C394 1
-C395 1
-C396 1
-C3B2 1
-C3B3 1
-C3B4 1
-C3B5 1
-C3B6 1
-C58C 1
-C58D 1
-C58E 1
-C58F 1
-C590 1
-C591 1
-C6A0 1
-C6A1 1
-C791 1
-C792 1
-C7AA 1
-C7AB 1
-C7AC 1
-C7AD 1
-C88C 1
-C88D 1
-C88E 1
-C88F 1
-C8AA 1
-C8AB 1
-C8AC 1
-C8AD 1
-C8AE 1
-C8AF 1
-C8B0 1
-C8B1 1
-CDA6 1
-C592 1
-C593 1
-C9B6 1
-C398 1
-C3B8 1
-C7BE 1
-C7BF 1
-C686 1
-C994 1
-C69F 1
-C9B5 1
-C9B7 1
-C8A2 1
-C8A3 1
-50 1
-70 1
-C6A4 1
-C6A5 1
-C9B8 1
-51 1
-71 1
-CAA0 1
-C4B8 1
-52 1
-72 1
-C594 1
-C595 1
-C596 1
-C597 1
-C598 1
-C599 1
-C890 1
-C891 1
-C892 1
-C893 1
-CAB3 1
-CDAC 1
-C6A6 1
-CA80 1
-C9B9 1
-CAB4 1
-C9BA 1
-C9BB 1
-CAB5 1
-C9BC 1
-C9BD 1
-C9BE 1
-C9BF 1
-CA81 1
-CAB6 1
-53 1
-73 1
-C59A 1
-C59B 1
-C59C 1
-C59D 1
-C59E 1
-C59F 1
-C5A0 1
-C5A1 1
-C5BF 1
-C898 1
-C899 1
-CBA2 1
-C39F 1
-CA82 1
-C6A9 1
-CA83 1
-C6AA 1
-CA85 1
-CA86 1
-54 1
-74 1
-C5A2 1
-C5A3 1
-C5A4 1
-C5A5 1
-C89A 1
-C89B 1
-CDAD 1
-CAA8 1
-C6BE 1
-CAA6 1
-CAA7 1
-C5A6 1
-C5A7 1
-C6AB 1
-C6AC 1
-C6AD 1
-C6AE 1
-CA88 1
-C8B6 1
-CA87 1
-55 1
-75 1
-C399 1
-C39A 1
-C39B 1
-C39C 1
-C3B9 1
-C3BA 1
-C3BB 1
-C3BC 1
-C5A8 1
-C5A9 1
-C5AA 1
-C5AB 1
-C5AC 1
-C5AD 1
-C5AE 1
-C5AF 1
-C5B0 1
-C5B1 1
-C5B2 1
-C5B3 1
-C6AF 1
-C6B0 1
-C793 1
-C794 1
-C795 1
-C796 1
-C797 1
-C798 1
-C799 1
-C79A 1
-C79B 1
-C79C 1
-C894 1
-C895 1
-C896 1
-C897 1
-CDA7 1
-CA89 1
-C9A5 1
-CAAE 1
-CAAF 1
-C69C 1
-C9AF 1
-C9B0 1
-C6B1 1
-CA8A 1
-56 1
-76 1
-CDAE 1
-C6B2 1
-CA8B 1
-CA8C 1
-57 1
-77 1
-C5B4 1
-C5B5 1
-CAB7 1
-CA8D 1
-58 1
-78 1
-CBA3 1
-CDAF 1
-59 1
-79 1
-C39D 1
-C3BD 1
-C3BF 1
-C5B6 1
-C5B7 1
-C5B8 1
-C8B2 1
-C8B3 1
-CAB8 1
-CA8F 1
-C6B3 1
-C6B4 1
-5A 1
-7A 1
-C5B9 1
-C5BA 1
-C5BB 1
-C5BC 1
-C5BD 1
-C5BE 1
-C68D 1
-C6B5 1
-C6B6 1
-C8A4 1
-C8A5 1
-CA90 1
-CA91 1
-C6B7 1
-C7AE 1
-C7AF 1
-CA92 1
-C6B8 1
-C6B9 1
-C6BA 1
-CA93 1
-C89C 1
-C89D 1
-C39E 1
-C3BE 1
-C6BF 1
-C7B7 1
-C6BB 1
-C6A7 1
-C6A8 1
-C6BC 1
-C6BD 1
-C684 1
-C685 1
-CA94 1
-CB80 1
-CABC 1
-C589 1
-CBAE 1
-CABE 1
-CA95 1
-CBA4 1
-CABF 1
-CB81 1
-CAA1 1
-CAA2 1
-CA96 1
-C780 1
-C781 1
-C782 1
-C783 1
-CA97 1
-CA98 1
-CAAC 1
-CAAD 1
-CE86 1
-CE91 1
-CEAC 1
-CEB1 1
-CE92 1
-CEB2 1
-CF90 1
-CE93 1
-CEB3 1
-CE94 1
-CEB4 1
-CE88 1
-CE95 1
-CEAD 1
-CEB5 1
-CFB5 1
-CF9C 1
-CF9D 1
-CF9A 1
-CF9B 1
-CE96 1
-CEB6 1
-CE89 1
-CE97 1
-CEAE 1
-CEB7 1
-CE98 1
-CEB8 1
-CF91 1
-CFB4 1
-CDBA 1
-CE8A 1
-CE90 1
-CE99 1
-CEAA 1
-CEAF 1
-CEB9 1
-CF8A 1
-CFB3 1
-CE9A 1
-CEBA 1
-CFB0 1
-CF97 1
-CE9B 1
-CEBB 1
-C2B5 1
-CE9C 1
-CEBC 1
-CE9D 1
-CEBD 1
-CE9E 1
-CEBE 1
-CE8C 1
-CE9F 1
-CEBF 1
-CF8C 1
-CEA0 1
-CF80 1
-CF96 1
-CF9E 1
-CF9F 1
-CF98 1
-CF99 1
-CEA1 1
-CF81 1
-CFB1 1
-CEA3 1
-CF82 1
-CF83 1
-CFB2 1
-CFB9 1
-CEA4 1
-CF84 1
-CE8E 1
-CEA5 1
-CEAB 1
-CEB0 1
-CF85 1
-CF8B 1
-CF8D 1
-CF92 1
-CF93 1
-CF94 1
-CEA6 1
-CF86 1
-CF95 1
-CEA7 1
-CF87 1
-CEA8 1
-CF88 1
-CE8F 1
-CEA9 1
-CF89 1
-CF8E 1
-CFA0 1
-CFA1 1
-CFB7 1
-CFB8 1
-CFBA 1
-CFBB 1
-CFA2 1
-CFA3 1
-CFA4 1
-CFA5 1
-CFA6 1
-CFA7 1
-CFA8 1
-CFA9 1
-CFAA 1
-CFAB 1
-CFAC 1
-CFAD 1
-CFAE 1
-CFAF 1
-D090 1
-D0B0 1
-D390 1
-D391 1
-D392 1
-D393 1
-D398 1
-D399 1
-D39A 1
-D39B 1
-D394 1
-D395 1
-D091 1
-D0B1 1
-D092 1
-D0B2 1
-D093 1
-D0B3 1
-D290 1
-D291 1
-D292 1
-D293 1
-D294 1
-D295 1
-D094 1
-D0B4 1
-D480 1
-D481 1
-D082 1
-D192 1
-D482 1
-D483 1
-D083 1
-D193 1
-D298 1
-D299 1
-D080 1
-D081 1
-D095 1
-D0B5 1
-D190 1
-D191 1
-D396 1
-D397 1
-D084 1
-D194 1
-D096 1
-D0B6 1
-D381 1
-D382 1
-D39C 1
-D39D 1
-D296 1
-D297 1
-D097 1
-D0B7 1
-D484 1
-D485 1
-D39E 1
-D39F 1
-D085 1
-D195 1
-D3A0 1
-D3A1 1
-D486 1
-D487 1
-D08D 1
-D098 1
-D0B8 1
-D19D 1
-D3A2 1
-D3A3 1
-D28A 1
-D28B 1
-D3A4 1
-D3A5 1
-D086 1
-D196 1
-D087 1
-D197 1
-D099 1
-D0B9 1
-D088 1
-D198 1
-D09A 1
-D0BA 1
-D29A 1
-D29B 1
-D383 1
-D384 1
-D2A0 1
-D2A1 1
-D29E 1
-D29F 1
-D29C 1
-D29D 1
-D09B 1
-D0BB 1
-D385 1
-D386 1
-D089 1
-D199 1
-D488 1
-D489 1
-D09C 1
-D0BC 1
-D38D 1
-D38E 1
-D09D 1
-D0BD 1
-D389 1
-D38A 1
-D2A2 1
-D2A3 1
-D387 1
-D388 1
-D2A4 1
-D2A5 1
-D08A 1
-D19A 1
-D48A 1
-D48B 1
-D09E 1
-D0BE 1
-D3A6 1
-D3A7 1
-D3A8 1
-D3A9 1
-D3AA 1
-D3AB 1
-D09F 1
-D0BF 1
-D2A6 1
-D2A7 1
-D280 1
-D281 1
-D0A0 1
-D180 1
-D28E 1
-D28F 1
-D0A1 1
-D181 1
-D48C 1
-D48D 1
-D2AA 1
-D2AB 1
-D0A2 1
-D182 1
-D48E 1
-D48F 1
-D2AC 1
-D2AD 1
-D08B 1
-D19B 1
-D08C 1
-D19C 1
-D0A3 1
-D183 1
-D3AE 1
-D3AF 1
-D08E 1
-D19E 1
-D3B0 1
-D3B1 1
-D3B2 1
-D3B3 1
-D2AE 1
-D2AF 1
-D2B0 1
-D2B1 1
-D1B8 1
-D1B9 1
-D0A4 1
-D184 1
-D0A5 1
-D185 1
-D2B2 1
-D2B3 1
-D2BA 1
-D2BB 1
-D1A0 1
-D1A1 1
-D1BE 1
-D1BF 1
-D1BC 1
-D1BD 1
-D1BA 1
-D1BB 1
-D0A6 1
-D186 1
-D2B4 1
-D2B5 1
-D0A7 1
-D187 1
-D3B4 1
-D3B5 1
-D2B6 1
-D2B7 1
-D38B 1
-D38C 1
-D2B8 1
-D2B9 1
-D2BC 1
-D2BD 1
-D2BE 1
-D2BF 1
-D08F 1
-D19F 1
-D0A8 1
-D188 1
-D0A9 1
-D189 1
-D0AA 1
-D18A 1
-D0AB 1
-D18B 1
-D3B8 1
-D3B9 1
-D0AC 1
-D18C 1
-D28C 1
-D28D 1
-D1A2 1
-D1A3 1
-D0AD 1
-D18D 1
-D3AC 1
-D3AD 1
-D0AE 1
-D18E 1
-D0AF 1
-D18F 1
-D1A4 1
-D1A5 1
-D1A6 1
-D1A7 1
-D1AA 1
-D1AB 1
-D1A8 1
-D1A9 1
-D1AC 1
-D1AD 1
-D1AE 1
-D1AF 1
-D1B0 1
-D1B1 1
-D1B2 1
-D1B3 1
-D1B4 1
-D1B5 1
-D1B6 1
-D1B7 1
-D2A8 1
-D2A9 1
-D380 1
-D4B1 1
-D5A1 1
-D4B2 1
-D5A2 1
-D4B3 1
-D5A3 1
-D4B4 1
-D5A4 1
-D4B5 1
-D5A5 1
-D687 1
-D4B6 1
-D5A6 1
-D4B7 1
-D5A7 1
-D4B8 1
-D5A8 1
-D4B9 1
-D5A9 1
-D4BA 1
-D5AA 1
-D4BB 1
-D5AB 1
-D4BC 1
-D5AC 1
-D4BD 1
-D5AD 1
-D4BE 1
-D5AE 1
-D4BF 1
-D5AF 1
-D580 1
-D5B0 1
-D581 1
-D5B1 1
-D582 1
-D5B2 1
-D583 1
-D5B3 1
-D584 1
-D5B4 1
-D585 1
-D5B5 1
-D586 1
-D5B6 1
-D587 1
-D5B7 1
-D588 1
-D5B8 1
-D589 1
-D5B9 1
-D58A 1
-D5BA 1
-D58B 1
-D5BB 1
-D58C 1
-D5BC 1
-D58D 1
-D5BD 1
-D58E 1
-D5BE 1
-D58F 1
-D5BF 1
-D590 1
-D680 1
-D591 1
-D681 1
-D592 1
-D682 1
-D593 1
-D683 1
-D594 1
-D684 1
-D595 1
-D685 1
-D596 1
-D686 1
-D599 1
-D790 1
-D791 1
-D792 1
-D793 1
-D794 1
-D795 1
-D7B0 1
-D7B1 1
-D796 1
-D797 1
-D798 1
-D799 1
-D7B2 1
-D79A 1
-D79B 1
-D79C 1
-D79D 1
-D79E 1
-D79F 1
-D7A0 1
-D7A1 1
-D7A2 1
-D7A3 1
-D7A4 1
-D7A5 1
-D7A6 1
-D7A7 1
-D7A8 1
-D7A9 1
-D7AA 1
-D8A1 1
-D9B4 1
-DBBD 1
-D8A2 1
-D8A3 1
-D9B2 1
-D9B1 1
-D8A4 1
-D8A5 1
-D9B3 1
-D8A6 1
-D8A7 1
-D9B5 1
-D9AE 1
-D8A8 1
-D9BB 1
-D9BE 1
-DA80 1
-D8A9 1
-D8AA 1
-D8AB 1
-D9B9 1
-D9BA 1
-D9BC 1
-D9BD 1
-D9BF 1
-D8AC 1
-DA83 1
-DA84 1
-DA86 1
-DABF 1
-DA87 1
-D8AD 1
-D8AE 1
-DA81 1
-DA82 1
-DA85 1
-D8AF 1
-D8B0 1
-DA88 1
-DA89 1
-DA8A 1
-DA8B 1
-DA8C 1
-DA8D 1
-DA8E 1
-DA8F 1
-DA90 1
-DBAE 1
-D8B1 1
-D8B2 1
-DA91 1
-DA92 1
-DA93 1
-DA94 1
-DA95 1
-DA96 1
-DA97 1
-DA98 1
-DA99 1
-DBAF 1
-D8B3 1
-D8B4 1
-DA9A 1
-DA9B 1
-DA9C 1
-DBBA 1
-D8B5 1
-D8B6 1
-DA9D 1
-DA9E 1
-DBBB 1
-D8B7 1
-D8B8 1
-DA9F 1
-D8B9 1
-D8BA 1
-DAA0 1
-DBBC 1
-D981 1
-DAA1 1
-DAA2 1
-DAA3 1
-DAA4 1
-DAA5 1
-DAA6 1
-D9AF 1
-D982 1
-DAA7 1
-DAA8 1
-D983 1
-DAA9 1
-DAAA 1
-DAAB 1
-DAAC 1
-DAAD 1
-DAAE 1
-DAAF 1
-DAB0 1
-DAB1 1
-DAB2 1
-DAB3 1
-DAB4 1
-D984 1
-DAB5 1
-DAB6 1
-DAB7 1
-DAB8 1
-D985 1
-DBBE 1
-D986 1
-DABA 1
-DABB 1
-DABC 1
-DABD 1
-DAB9 1
-D987 1
-DABE 1
-DB81 1
-DB82 1
-DB83 1
-DBBF 1
-DB80 1
-DB95 1
-D988 1
-DBA5 1
-D9B6 1
-DB84 1
-DB85 1
-DB86 1
-DB87 1
-D9B7 1
-DB88 1
-DB89 1
-DB8A 1
-DB8B 1
-DB8F 1
-D989 1
-D98A 1
-DBA6 1
-D9B8 1
-DB8C 1
-DB8D 1
-DB8E 1
-DB90 1
-DB91 1
-DB92 1
-DB93 1
-DC90 1
-DC92 1
-DCAD 1
-DC93 1
-DC94 1
-DCAE 1
-DC96 1
-DC95 1
-DCAF 1
-DC97 1
-DC98 1
-DC99 1
-DD8D 1
-DC9A 1
-DC9B 1
-DC9C 1
-DC9D 1
-DC9E 1
-DC9F 1
-DD8E 1
-DCA0 1
-DCA1 1
-DCA2 1
-DCA3 1
-DCA4 1
-DCA5 1
-DCA6 1
-DCA7 1
-DD8F 1
-DCA8 1
-DCA9 1
-DCAA 1
-DCAB 1
-DCAC 1
-DE80 1
-DE99 1
-DE9A 1
-DE81 1
-DE82 1
-DE83 1
-DE9C 1
-DE84 1
-DE85 1
-DE86 1
-DE87 1
-DEA2 1
-DEA3 1
-DE88 1
-DEA5 1
-DE89 1
-DE8A 1
-DE8B 1
-DE9B 1
-DE8C 1
-DE98 1
-DEA0 1
-DEA1 1
-DE8D 1
-DE8E 1
-DEA4 1
-DE8F 1
-DE90 1
-DE9D 1
-DE9E 1
-DE9F 1
-DE91 1
-DE92 1
-DE93 1
-DE94 1
-DE95 1
-DE96 1
-DE97 1
-DEB1 1
-DEA6 1
-DEA7 1
-DEA8 1
-DEA9 1
-DEAA 1
-DEAB 1
-DEAC 1
-DEAD 1
-DEAE 1
-DEAF 1
-DEB0 1
-E4B880 1
-E4B881 1
-E4B882 1
-E4B883 1
-E4B884 1
-E4B885 1
-E4B886 1
-E4B887 1
-E4B888 1
-E4B889 1
-E4B88A 1
-E4B88B 1
-E4B88C 1
-E4B88D 1
-E4B88E 1
-E4B88F 1
-E4B890 1
-E4B891 1
-E4B892 1
-E4B893 1
-E4B894 1
-E4B895 1
-E4B896 1
-E4B897 1
-E4B898 1
-E4B899 1
-E4B89A 1
-E4B89B 1
-E4B89C 1
-E4B89D 1
-E4B89E 1
-E4B89F 1
-E4B8A0 1
-E4B8A1 1
-E4B8A2 1
-E4B8A3 1
-E4B8A4 1
-E4B8A5 1
-E4B8A6 1
-E4B8A7 1
-E4B8A8 1
-E4B8A9 1
-E4B8AA 1
-E4B8AB 1
-E4B8AC 1
-E4B8AD 1
-E4B8AE 1
-E4B8AF 1
-E4B8B0 1
-E4B8B1 1
-E4B8B2 1
-E4B8B3 1
-E4B8B4 1
-E4B8B5 1
-E4B8B6 1
-E4B8B7 1
-E4B8B8 1
-E4B8B9 1
-E4B8BA 1
-E4B8BB 1
-E4B8BC 1
-E4B8BD 1
-E4B8BE 1
-E4B8BF 1
-E4B980 1
-E4B981 1
-E4B982 1
-E4B983 1
-E4B984 1
-E4B985 1
-E4B986 1
-E4B987 1
-E4B988 1
-E4B989 1
-E4B98A 1
-E4B98B 1
-E4B98C 1
-E4B98D 1
-E4B98E 1
-E4B98F 1
-E4B990 1
-E4B991 1
-E4B992 1
-E4B993 1
-E4B994 1
-E4B995 1
-E4B996 1
-E4B997 1
-E4B998 1
-E4B999 1
-E4B99A 1
-E4B99B 1
-E4B99C 1
-E4B99D 1
-E4B99E 1
-E4B99F 1
-E4B9A0 1
-E4B9A1 1
-E4B9A2 1
-E4B9A3 1
-E4B9A4 1
-E4B9A5 1
-E4B9A6 1
-E4B9A7 1
-E4B9A8 1
-E4B9A9 1
-E4B9AA 1
-E4B9AB 1
-E4B9AC 1
-E4B9AD 1
-E4B9AE 1
-E4B9AF 1
-E4B9B0 1
-E4B9B1 1
-E4B9B2 1
-E4B9B3 1
-E4B9B4 1
-E4B9B5 1
-E4B9B6 1
-E4B9B7 1
-E4B9B8 1
-E4B9B9 1
-E4B9BA 1
-E4B9BB 1
-E4B9BC 1
-E4B9BD 1
-E4B9BE 1
-E4B9BF 1
-E4BA80 1
-E4BA81 1
-E4BA82 1
-E4BA83 1
-E4BA84 1
-E4BA85 1
-E4BA86 1
-E4BA87 1
-E4BA88 1
-E4BA89 1
-E4BA8A 1
-E4BA8B 1
-E4BA8C 1
-E4BA8D 1
-E4BA8E 1
-E4BA8F 1
-E4BA90 1
-E4BA91 1
-E4BA92 1
-E4BA93 1
-E4BA94 1
-E4BA95 1
-E4BA96 1
-E4BA97 1
-E4BA98 1
-E4BA99 1
-E4BA9A 1
-E4BA9B 1
-E4BA9C 1
-E4BA9D 1
-E4BA9E 1
-E4BA9F 1
-E4BAA0 1
-E4BAA1 1
-E4BAA2 1
-E4BAA3 1
-E4BAA4 1
-E4BAA5 1
-E4BAA6 1
-E4BAA7 1
-E4BAA8 1
-E4BAA9 1
-E4BAAA 1
-E4BAAB 1
-E4BAAC 1
-E4BAAD 1
-E4BAAE 1
-E4BAAF 1
-E4BAB0 1
-E4BAB1 1
-E4BAB2 1
-E4BAB3 1
-E4BAB4 1
-E4BAB5 1
-E4BAB6 1
-E4BAB7 1
-E4BAB8 1
-E4BAB9 1
-E4BABA 1
-E4BABB 1
-E4BABC 1
-E4BABD 1
-E4BABE 1
-E4BABF 1
-E4BB80 1
-E4BB81 1
-E4BB82 1
-E4BB83 1
-E4BB84 1
-E4BB85 1
-E4BB86 1
-E4BB87 1
-E4BB88 1
-E4BB89 1
-E4BB8A 1
-E4BB8B 1
-E4BB8C 1
-E4BB8D 1
-E4BB8E 1
-E4BB8F 1
-E4BB90 1
-E4BB91 1
-E4BB92 1
-E4BB93 1
-E4BB94 1
-E4BB95 1
-E4BB96 1
-E4BB97 1
-E4BB98 1
-E4BB99 1
-E4BB9A 1
-E4BB9B 1
-E4BB9C 1
-E4BB9D 1
-E4BB9E 1
-E4BB9F 1
-E4BBA0 1
-E4BBA1 1
-E4BBA2 1
-E4BBA3 1
-E4BBA4 1
-E4BBA5 1
-E4BBA6 1
-E4BBA7 1
-E4BBA8 1
-E4BBA9 1
-E4BBAA 1
-E4BBAB 1
-E4BBAC 1
-E4BBAD 1
-E4BBAE 1
-E4BBAF 1
-E4BBB0 1
-E4BBB1 1
-E4BBB2 1
-E4BBB3 1
-E4BBB4 1
-E4BBB5 1
-E4BBB6 1
-E4BBB7 1
-E4BBB8 1
-E4BBB9 1
-E4BBBA 1
-E4BBBB 1
-E4BBBC 1
-E4BBBD 1
-E4BBBE 1
-E4BBBF 1
-E4BC80 1
-E4BC81 1
-E4BC82 1
-E4BC83 1
-E4BC84 1
-E4BC85 1
-E4BC86 1
-E4BC87 1
-E4BC88 1
-E4BC89 1
-E4BC8A 1
-E4BC8B 1
-E4BC8C 1
-E4BC8D 1
-E4BC8E 1
-E4BC8F 1
-E4BC90 1
-E4BC91 1
-E4BC92 1
-E4BC93 1
-E4BC94 1
-E4BC95 1
-E4BC96 1
-E4BC97 1
-E4BC98 1
-E4BC99 1
-E4BC9A 1
-E4BC9B 1
-E4BC9C 1
-E4BC9D 1
-E4BC9E 1
-E4BC9F 1
-E4BCA0 1
-E4BCA1 1
-E4BCA2 1
-E4BCA3 1
-E4BCA4 1
-E4BCA5 1
-E4BCA6 1
-E4BCA7 1
-E4BCA8 1
-E4BCA9 1
-E4BCAA 1
-E4BCAB 1
-E4BCAC 1
-E4BCAD 1
-E4BCAE 1
-E4BCAF 1
-E4BCB0 1
-E4BCB1 1
-E4BCB2 1
-E4BCB3 1
-E4BCB4 1
-E4BCB5 1
-E4BCB6 1
-E4BCB7 1
-E4BCB8 1
-E4BCB9 1
-E4BCBA 1
-E4BCBB 1
-E4BCBC 1
-E4BCBD 1
-E4BCBE 1
-E4BCBF 1
-E4BD80 1
-E4BD81 1
-E4BD82 1
-E4BD83 1
-E4BD84 1
-E4BD85 1
-E4BD86 1
-E4BD87 1
-E4BD88 1
-E4BD89 1
-E4BD8A 1
-E4BD8B 1
-E4BD8C 1
-E4BD8D 1
-E4BD8E 1
-E4BD8F 1
-E4BD90 1
-E4BD91 1
-E4BD92 1
-E4BD93 1
-E4BD94 1
-E4BD95 1
-E4BD96 1
-E4BD97 1
-E4BD98 1
-E4BD99 1
-E4BD9A 1
-E4BD9B 1
-E4BD9C 1
-E4BD9D 1
-E4BD9E 1
-E4BD9F 1
-E4BDA0 1
-E4BDA1 1
-E4BDA2 1
-E4BDA3 1
-E4BDA4 1
-E4BDA5 1
-E4BDA6 1
-E4BDA7 1
-E4BDA8 1
-E4BDA9 1
-E4BDAA 1
-E4BDAB 1
-E4BDAC 1
-E4BDAD 1
-E4BDAE 1
-E4BDAF 1
-E4BDB0 1
-E4BDB1 1
-E4BDB2 1
-E4BDB3 1
-E4BDB4 1
-E4BDB5 1
-E4BDB6 1
-E4BDB7 1
-E4BDB8 1
-E4BDB9 1
-E4BDBA 1
-E4BDBB 1
-E4BDBC 1
-E4BDBD 1
-E4BDBE 1
-E4BDBF 1
-E4BE80 1
-E4BE81 1
-E4BE82 1
-E4BE83 1
-E4BE84 1
-E4BE85 1
-E4BE86 1
-E4BE87 1
-E4BE88 1
-E4BE89 1
-E4BE8A 1
-E4BE8B 1
-E4BE8C 1
-E4BE8D 1
-E4BE8E 1
-E4BE8F 1
-E4BE90 1
-E4BE91 1
-E4BE92 1
-E4BE93 1
-E4BE94 1
-E4BE95 1
-E4BE96 1
-E4BE97 1
-E4BE98 1
-E4BE99 1
-E4BE9A 1
-E4BE9B 1
-E4BE9C 1
-E4BE9D 1
-E4BE9E 1
-E4BE9F 1
-E4BEA0 1
-E4BEA1 1
-E4BEA2 1
-E4BEA3 1
-E4BEA4 1
-E4BEA5 1
-E4BEA6 1
-E4BEA7 1
-E4BEA8 1
-E4BEA9 1
-E4BEAA 1
-E4BEAB 1
-E4BEAC 1
-E4BEAD 1
-E4BEAE 1
-E4BEAF 1
-E4BEB0 1
-E4BEB1 1
-E4BEB2 1
-E4BEB3 1
-E4BEB4 1
-E4BEB5 1
-E4BEB6 1
-E4BEB7 1
-E4BEB8 1
-E4BEB9 1
-E4BEBA 1
-E4BEBB 1
-E4BEBC 1
-E4BEBD 1
-E4BEBE 1
-E4BEBF 1
-E4BF80 1
-E4BF81 1
-E4BF82 1
-E4BF83 1
-E4BF84 1
-E4BF85 1
-E4BF86 1
-E4BF87 1
-E4BF88 1
-E4BF89 1
-E4BF8A 1
-E4BF8B 1
-E4BF8C 1
-E4BF8D 1
-E4BF8E 1
-E4BF8F 1
-E4BF90 1
-E4BF91 1
-E4BF92 1
-E4BF93 1
-E4BF94 1
-E4BF95 1
-E4BF96 1
-E4BF97 1
-E4BF98 1
-E4BF99 1
-E4BF9A 1
-E4BF9B 1
-E4BF9C 1
-E4BF9D 1
-E4BF9E 1
-E4BF9F 1
-E4BFA0 1
-E4BFA1 1
-E4BFA2 1
-E4BFA3 1
-E4BFA4 1
-E4BFA5 1
-E4BFA6 1
-E4BFA7 1
-E4BFA8 1
-E4BFA9 1
-E4BFAA 1
-E4BFAB 1
-E4BFAC 1
-E4BFAD 1
-E4BFAE 1
-E4BFAF 1
-E4BFB0 1
-E4BFB1 1
-E4BFB2 1
-E4BFB3 1
-E4BFB4 1
-E4BFB5 1
-E4BFB6 1
-E4BFB7 1
-E4BFB8 1
-E4BFB9 1
-E4BFBA 1
-E4BFBB 1
-E4BFBC 1
-E4BFBD 1
-E4BFBE 1
-E4BFBF 1
-C8B7 1
-C8B8 1
-C8B9 1
-C8BA 1
-C8BB 1
-C8BC 1
-C8BD 1
-C8BE 1
-C8BF 1
-C980 1
-C981 1
-C982 1
-C983 1
-C984 1
-C985 1
-C986 1
-C987 1
-C988 1
-C989 1
-C98A 1
-C98B 1
-C98C 1
-C98D 1
-C98E 1
-C98F 1
-CD98 1
-CD99 1
-CD9A 1
-CD9B 1
-CD9C 1
-CDB0 1
-CDB1 1
-CDB2 1
-CDB3 1
-CDB6 1
-CDB7 1
-CDB8 1
-CDB9 1
-CDBB 1
-CDBC 1
-CDBD 1
-CDBF 1
-CE80 1
-CE81 1
-CE82 1
-CE83 1
-CE8B 1
-CE8D 1
-CEA2 1
-CF8F 1
-CFBC 1
-CFBD 1
-CFBE 1
-CFBF 1
-D287 1
-D38F 1
-D3B6 1
-D3B7 1
-D3BA 1
-D3BB 1
-D3BC 1
-D3BD 1
-D3BE 1
-D3BF 1
-D490 1
-D491 1
-D492 1
-D493 1
-D494 1
-D495 1
-D496 1
-D497 1
-D498 1
-D499 1
-D49A 1
-D49B 1
-D49C 1
-D49D 1
-D49E 1
-D49F 1
-D4A0 1
-D4A1 1
-D4A2 1
-D4A3 1
-D4A4 1
-D4A5 1
-D4A6 1
-D4A7 1
-D4A8 1
-D4A9 1
-D4AA 1
-D4AB 1
-D4AC 1
-D4AD 1
-D4AE 1
-D4AF 1
-D4B0 1
-D597 1
-D598 1
-D5A0 1
-D688 1
-D68B 1
-D68C 1
-D68D 1
-D68E 1
-D68F 1
-D690 1
-D6A2 1
-D6BA 1
-D785 1
-D786 1
-D787 1
-D788 1
-D789 1
-D78A 1
-D78B 1
-D78C 1
-D78D 1
-D78E 1
-D78F 1
-D7AB 1
-D7AC 1
-D7AD 1
-D7AE 1
-D7AF 1
-D7B5 1
-D7B6 1
-D7B7 1
-D7B8 1
-D7B9 1
-D7BA 1
-D7BB 1
-D7BC 1
-D7BD 1
-D7BE 1
-D7BF 1
-D884 1
-D885 1
-D886 1
-D887 1
-D888 1
-D889 1
-D88A 1
-D88B 1
-D896 1
-D897 1
-D898 1
-D899 1
-D89A 1
-D89C 1
-D89D 1
-D89E 1
-D8A0 1
-D8BB 1
-D8BC 1
-D8BD 1
-D8BE 1
-D8BF 1
-D999 1
-D99A 1
-D99B 1
-D99C 1
-D99D 1
-D99E 1
-D99F 1
-DC8E 1
-DD8B 1
-DD8C 1
-DD90 1
-DD91 1
-DD92 1
-DD93 1
-DD94 1
-DD95 1
-DD96 1
-DD97 1
-DD98 1
-DD99 1
-DD9A 1
-DD9B 1
-DD9C 1
-DD9D 1
-DD9E 1
-DD9F 1
-DDA0 1
-DDA1 1
-DDA2 1
-DDA3 1
-DDA4 1
-DDA5 1
-DDA6 1
-DDA7 1
-DDA8 1
-DDA9 1
-DDAA 1
-DDAB 1
-DDAC 1
-DDAD 1
-DDAE 1
-DDAF 1
-DDB0 1
-DDB1 1
-DDB2 1
-DDB3 1
-DDB4 1
-DDB5 1
-DDB6 1
-DDB7 1
-DDB8 1
-DDB9 1
-DDBA 1
-DDBB 1
-DDBC 1
-DDBD 1
-DDBE 1
-DDBF 1
-DEB2 1
-DEB3 1
-DEB4 1
-DEB5 1
-DEB6 1
-DEB7 1
-DEB8 1
-DEB9 1
-DEBA 1
-DEBB 1
-DEBC 1
-DEBD 1
-DEBE 1
-DEBF 1
-DF80 1
-DF81 1
-DF82 1
-DF83 1
-DF84 1
-DF85 1
-DF86 1
-DF87 1
-DF88 1
-DF89 1
-DF8A 1
-DF8B 1
-DF8C 1
-DF8D 1
-DF8E 1
-DF8F 1
-DF90 1
-DF91 1
-DF92 1
-DF93 1
-DF94 1
-DF95 1
-DF96 1
-DF97 1
-DF98 1
-DF99 1
-DF9A 1
-DF9B 1
-DF9C 1
-DF9D 1
-DF9E 1
-DF9F 1
-DFA0 1
-DFA1 1
-DFA2 1
-DFA3 1
-DFA4 1
-DFA5 1
-DFA6 1
-DFA7 1
-DFA8 1
-DFA9 1
-DFAA 1
-DFAB 1
-DFAC 1
-DFAD 1
-DFAE 1
-DFAF 1
-DFB0 1
-DFB1 1
-DFB2 1
-DFB3 1
-DFB4 1
-DFB5 1
-DFB6 1
-DFB7 1
-DFB8 1
-DFB9 1
-DFBA 1
-DFBB 1
-DFBC 1
-DFBD 1
-DFBE 1
-DFBF 1
-DROP TABLE IF EXISTS test.t1;
diff --git a/mysql-test/suite/funcs_2/t/disabled.def b/mysql-test/suite/funcs_2/t/disabled.def
index 8ca94961dd2..8b137891791 100644
--- a/mysql-test/suite/funcs_2/t/disabled.def
+++ b/mysql-test/suite/funcs_2/t/disabled.def
@@ -1,4 +1 @@
-# Should maybe be enabled, but ndb is not part of the ordinary build.
-# Bernt M. Johnsen 2010-05-10
-ndb_charset : Bug#20447 Problem with prefix keys with contractions and expansions
diff --git a/mysql-test/suite/funcs_2/t/ndb_charset.test b/mysql-test/suite/funcs_2/t/ndb_charset.test
deleted file mode 100644
index 68665cc1ae5..00000000000
--- a/mysql-test/suite/funcs_2/t/ndb_charset.test
+++ /dev/null
@@ -1,14 +0,0 @@
-################################################################################
-# Author: Serge Kozlov #
-# Date: 09/21/2005 #
-# Purpose: Testing the charsets for NDB engine #
-# #
-# Checking of other prerequisites is in charset_master.test #
-################################################################################
-
---source include/have_ndb.inc
---source include/not_embedded.inc
-
-let $engine_type= NDB;
---source suite/funcs_2/charset/charset_master.test
-
diff --git a/mysql-test/suite/ibmdb2i/include/have_i54.inc b/mysql-test/suite/ibmdb2i/include/have_i54.inc
deleted file mode 100644
index 7054e196153..00000000000
--- a/mysql-test/suite/ibmdb2i/include/have_i54.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-# Check for IBM i 6.1 or later
---disable_query_log
-system uname -rv > $MYSQLTEST_VARDIR/tmp/version;
---disable_warnings
-drop table if exists uname_vr;
---enable_warnings
-create temporary table uname_vr (r int, v int);
---disable_warnings
-eval LOAD DATA INFILE "$MYSQLTEST_VARDIR/tmp/version" into table uname_vr fields terminated by ' ';
---enable_warnings
-let $ok = `select count(*) from uname_vr where v = 5 and r = 4`;
-drop table uname_vr;
-remove_file $MYSQLTEST_VARDIR/tmp/version;
---enable_query_log
-if (!$ok)
-{
- skip "Need IBM i 5.4 or later";
-}
-
-
diff --git a/mysql-test/suite/ibmdb2i/include/have_i61.inc b/mysql-test/suite/ibmdb2i/include/have_i61.inc
deleted file mode 100644
index 84b9a17c1d8..00000000000
--- a/mysql-test/suite/ibmdb2i/include/have_i61.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-# Check for IBM i 6.1 or later
---disable_query_log
-system uname -rv > $MYSQLTEST_VARDIR/tmp/version;
---disable_warnings
-drop table if exists uname_vr;
---enable_warnings
-create temporary table uname_vr (r int, v int);
---disable_warnings
-eval LOAD DATA INFILE "$MYSQLTEST_VARDIR/tmp/version" into table uname_vr fields terminated by ' ';
---enable_warnings
-let $ok = `select count(*) from uname_vr where v > 5`;
-drop table uname_vr;
-remove_file $MYSQLTEST_VARDIR/tmp/version;
---enable_query_log
-if (!$ok)
-{
- skip "Need IBM i 6.1 or later";
-}
-
-
diff --git a/mysql-test/suite/ibmdb2i/include/have_ibmdb2i.inc b/mysql-test/suite/ibmdb2i/include/have_ibmdb2i.inc
deleted file mode 100644
index f3ef0b4f1ac..00000000000
--- a/mysql-test/suite/ibmdb2i/include/have_ibmdb2i.inc
+++ /dev/null
@@ -1,6 +0,0 @@
-if (!`SELECT count(*) FROM information_schema.engines WHERE
- (support = 'YES' OR support = 'DEFAULT') AND
- engine = 'ibmdb2i'`)
-{
- skip Need ibmdb2i engine;
-}
diff --git a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44020.result b/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44020.result
deleted file mode 100644
index ddf92db6bca..00000000000
--- a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44020.result
+++ /dev/null
@@ -1,11 +0,0 @@
-create schema `A12345_@$#`;
-create table `A12345_@$#`.t1 (i int) engine=ibmdb2i;
-show create table `A12345_@$#`.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `i` int(11) DEFAULT NULL
-) ENGINE=IBMDB2I DEFAULT CHARSET=latin1
-select * from `A12345_@$#`.t1;
-i
-drop table `A12345_@$#`.t1;
-drop schema `A12345_@$#`;
diff --git a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44025.result b/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44025.result
deleted file mode 100644
index 10a3070fcc4..00000000000
--- a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44025.result
+++ /dev/null
@@ -1,4 +0,0 @@
-create table t1 (c char(10) collate utf8_swedish_ci, index(c)) engine=ibmdb2i;
-drop table t1;
-create table t1 (c char(10) collate ucs2_swedish_ci, index(c)) engine=ibmdb2i;
-drop table t1;
diff --git a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44232.result b/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44232.result
deleted file mode 100644
index 8276b401073..00000000000
--- a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44232.result
+++ /dev/null
@@ -1,4 +0,0 @@
-create table t1 (c char(1) character set armscii8) engine=ibmdb2i;
-ERROR HY000: Can't create table 'test.t1' (errno: 2504)
-create table t1 (c char(1) character set eucjpms ) engine=ibmdb2i;
-ERROR HY000: Can't create table 'test.t1' (errno: 2504)
diff --git a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44610.result b/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44610.result
deleted file mode 100644
index 311e800e1b0..00000000000
--- a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44610.result
+++ /dev/null
@@ -1,18 +0,0 @@
-create table ABC (i int) engine=ibmdb2i;
-drop table ABC;
-create table `1234567890ABC` (i int) engine=ibmdb2i;
-drop table `1234567890ABC`;
-create table `!@#$%` (i int) engine=ibmdb2i;
-drop table `!@#$%`;
-create table `ABCD#########` (i int) engine=ibmdb2i;
-drop table `ABCD#########`;
-create table `_` (i int) engine=ibmdb2i;
-drop table `_`;
-create table `abc##def` (i int) engine=ibmdb2i;
-drop table `abc##def`;
-set names utf8;
-create table Ä° (s1 int) engine=ibmdb2i;
-drop table Ä°;
-create table Ä°Ä° (s1 int) engine=ibmdb2i;
-drop table Ä°Ä°;
-set names latin1;
diff --git a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45196.result b/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45196.result
deleted file mode 100644
index 916e1d93ee5..00000000000
--- a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45196.result
+++ /dev/null
@@ -1,33 +0,0 @@
-drop table if exists t1;
-create table t1 (c char(10), index(c)) collate ucs2_czech_ci engine=ibmdb2i;
-insert into t1 values ("ch"),("h"),("i");
-select * from t1 order by c;
-c
-h
-ch
-i
-drop table t1;
-create table t1 (c char(10), index(c)) collate utf8_czech_ci engine=ibmdb2i;
-insert into t1 values ("ch"),("h"),("i");
-select * from t1 order by c;
-c
-h
-ch
-i
-drop table t1;
-create table t1 (c char(10), index(c)) collate ucs2_danish_ci engine=ibmdb2i;
-insert into t1 values("abc"),("abcd"),("aaaa");
-select c from t1 order by c;
-c
-abc
-abcd
-aaaa
-drop table t1;
-create table t1 (c char(10), index(c)) collate utf8_danish_ci engine=ibmdb2i;
-insert into t1 values("abc"),("abcd"),("aaaa");
-select c from t1 order by c;
-c
-abc
-abcd
-aaaa
-drop table t1;
diff --git a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45793.result b/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45793.result
deleted file mode 100644
index 2392b746877..00000000000
--- a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45793.result
+++ /dev/null
@@ -1,7 +0,0 @@
-drop table if exists t1;
-create table t1 (c char(10), index(c)) charset macce engine=ibmdb2i;
-insert into t1 values ("test");
-select * from t1 order by c;
-c
-test
-drop table t1;
diff --git a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45983.result b/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45983.result
deleted file mode 100644
index b9f4dcfc656..00000000000
--- a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45983.result
+++ /dev/null
@@ -1,20 +0,0 @@
-set ibmdb2i_create_index_option=1;
-drop schema if exists test1;
-create schema test1;
-use test1;
-CREATE TABLE t1 (f int primary key, index(f)) engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (f char(10) collate utf8_bin primary key, index(f)) engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (f char(10) collate latin1_swedish_ci primary key, index(f)) engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (f char(10) collate latin1_swedish_ci primary key, i int, index i(i,f)) engine=ibmdb2i;
-drop table t1;
-create table fd (SQSSEQ CHAR(10)) engine=ibmdb2i;
-select * from fd;
-SQSSEQ
-*HEX
-*HEX
-*HEX
-*HEX
-drop table fd;
diff --git a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_49329.result b/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_49329.result
deleted file mode 100644
index d5bfc2579fd..00000000000
--- a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_49329.result
+++ /dev/null
@@ -1,9 +0,0 @@
-create table ABC (i int) engine=ibmdb2i;
-insert into ABC values(1);
-create table abc (i int) engine=ibmdb2i;
-insert into abc values (2);
-select * from ABC;
-i
-1
-drop table ABC;
-drop table abc;
diff --git a/mysql-test/suite/ibmdb2i/r/ibmdb2i_collations.result b/mysql-test/suite/ibmdb2i/r/ibmdb2i_collations.result
deleted file mode 100644
index 4f7d71cab2d..00000000000
--- a/mysql-test/suite/ibmdb2i/r/ibmdb2i_collations.result
+++ /dev/null
@@ -1,1204 +0,0 @@
-drop table if exists t1, ffd, fd;
-CREATE TABLE t1 (armscii8_bin integer, c char(10), v varchar(20), index(c), index(v)) collate armscii8_bin engine=ibmdb2i;
-CREATE TABLE t1 (armscii8_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate armscii8_general_ci engine=ibmdb2i;
-CREATE TABLE t1 (ascii_bin integer, c char(10), v varchar(20), index(c), index(v)) collate ascii_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (ascii_bin char(10) primary key) collate ascii_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ascii_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ascii_general_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (ascii_general_ci char(10) primary key) collate ascii_general_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (big5_bin integer, c char(10), v varchar(20), index(c), index(v)) collate big5_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (big5_bin char(10) primary key) collate big5_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (big5_chinese_ci integer, c char(10), v varchar(20), index(c), index(v)) collate big5_chinese_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (big5_chinese_ci char(10) primary key) collate big5_chinese_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp1250_bin integer, c char(10), v varchar(20), index(c), index(v)) collate cp1250_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp1250_bin char(10) primary key) collate cp1250_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp1250_croatian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate cp1250_croatian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp1250_croatian_ci char(10) primary key) collate cp1250_croatian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp1250_czech_cs integer, c char(10), v varchar(20), index(c), index(v)) collate cp1250_czech_cs engine=ibmdb2i;
-CREATE TABLE t1 (cp1250_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate cp1250_general_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp1250_general_ci char(10) primary key) collate cp1250_general_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp1250_polish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate cp1250_polish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp1250_polish_ci char(10) primary key) collate cp1250_polish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp1251_bin integer, c char(10), v varchar(20), index(c), index(v)) collate cp1251_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp1251_bin char(10) primary key) collate cp1251_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp1251_bulgarian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate cp1251_bulgarian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp1251_bulgarian_ci char(10) primary key) collate cp1251_bulgarian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp1251_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate cp1251_general_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp1251_general_ci char(10) primary key) collate cp1251_general_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp1251_general_cs integer, c char(10), v varchar(20), index(c), index(v)) collate cp1251_general_cs engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp1251_general_cs char(10) primary key) collate cp1251_general_cs engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp1251_ukrainian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate cp1251_ukrainian_ci engine=ibmdb2i;
-CREATE TABLE t1 (cp1256_bin integer, c char(10), v varchar(20), index(c), index(v)) collate cp1256_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp1256_bin char(10) primary key) collate cp1256_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp1256_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate cp1256_general_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp1256_general_ci char(10) primary key) collate cp1256_general_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp1257_bin integer, c char(10), v varchar(20), index(c), index(v)) collate cp1257_bin engine=ibmdb2i;
-CREATE TABLE t1 (cp1257_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate cp1257_general_ci engine=ibmdb2i;
-CREATE TABLE t1 (cp1257_lithuanian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate cp1257_lithuanian_ci engine=ibmdb2i;
-CREATE TABLE t1 (cp850_bin integer, c char(10), v varchar(20), index(c), index(v)) collate cp850_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp850_bin char(10) primary key) collate cp850_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp850_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate cp850_general_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp850_general_ci char(10) primary key) collate cp850_general_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp852_bin integer, c char(10), v varchar(20), index(c), index(v)) collate cp852_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp852_bin char(10) primary key) collate cp852_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp852_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate cp852_general_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (cp852_general_ci char(10) primary key) collate cp852_general_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp866_bin integer, c char(10), v varchar(20), index(c), index(v)) collate cp866_bin engine=ibmdb2i;
-CREATE TABLE t1 (cp866_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate cp866_general_ci engine=ibmdb2i;
-CREATE TABLE t1 (cp932_bin integer, c char(10), v varchar(20), index(c), index(v)) collate cp932_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (cp932_bin char(10) primary key) collate cp932_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (cp932_japanese_ci integer, c char(10), v varchar(20), index(c), index(v)) collate cp932_japanese_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (cp932_japanese_ci char(10) primary key) collate cp932_japanese_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (dec8_bin integer, c char(10), v varchar(20), index(c), index(v)) collate dec8_bin engine=ibmdb2i;
-CREATE TABLE t1 (dec8_swedish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate dec8_swedish_ci engine=ibmdb2i;
-CREATE TABLE t1 (eucjpms_bin integer, c char(10), v varchar(20), index(c), index(v)) collate eucjpms_bin engine=ibmdb2i;
-CREATE TABLE t1 (eucjpms_japanese_ci integer, c char(10), v varchar(20), index(c), index(v)) collate eucjpms_japanese_ci engine=ibmdb2i;
-CREATE TABLE t1 (euckr_bin integer, c char(10), v varchar(20), index(c), index(v)) collate euckr_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (euckr_bin char(10) primary key) collate euckr_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (euckr_korean_ci integer, c char(10), v varchar(20), index(c), index(v)) collate euckr_korean_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (euckr_korean_ci char(10) primary key) collate euckr_korean_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (gb2312_bin integer, c char(10), v varchar(20), index(c), index(v)) collate gb2312_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (gb2312_bin char(10) primary key) collate gb2312_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (gb2312_chinese_ci integer, c char(10), v varchar(20), index(c), index(v)) collate gb2312_chinese_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (gb2312_chinese_ci char(10) primary key) collate gb2312_chinese_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (gbk_bin integer, c char(10), v varchar(20), index(c), index(v)) collate gbk_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (gbk_bin char(10) primary key) collate gbk_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (gbk_chinese_ci integer, c char(10), v varchar(20), index(c), index(v)) collate gbk_chinese_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (gbk_chinese_ci char(10) primary key) collate gbk_chinese_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (geostd8_bin integer, c char(10), v varchar(20), index(c), index(v)) collate geostd8_bin engine=ibmdb2i;
-CREATE TABLE t1 (geostd8_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate geostd8_general_ci engine=ibmdb2i;
-CREATE TABLE t1 (greek_bin integer, c char(10), v varchar(20), index(c), index(v)) collate greek_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (greek_bin char(10) primary key) collate greek_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (greek_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate greek_general_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (greek_general_ci char(10) primary key) collate greek_general_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (hebrew_bin integer, c char(10), v varchar(20), index(c), index(v)) collate hebrew_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (hebrew_bin char(10) primary key) collate hebrew_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (hebrew_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate hebrew_general_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (hebrew_general_ci char(10) primary key) collate hebrew_general_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (hp8_bin integer, c char(10), v varchar(20), index(c), index(v)) collate hp8_bin engine=ibmdb2i;
-CREATE TABLE t1 (hp8_english_ci integer, c char(10), v varchar(20), index(c), index(v)) collate hp8_english_ci engine=ibmdb2i;
-CREATE TABLE t1 (keybcs2_bin integer, c char(10), v varchar(20), index(c), index(v)) collate keybcs2_bin engine=ibmdb2i;
-CREATE TABLE t1 (keybcs2_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate keybcs2_general_ci engine=ibmdb2i;
-CREATE TABLE t1 (koi8r_bin integer, c char(10), v varchar(20), index(c), index(v)) collate koi8r_bin engine=ibmdb2i;
-CREATE TABLE t1 (koi8r_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate koi8r_general_ci engine=ibmdb2i;
-CREATE TABLE t1 (koi8u_bin integer, c char(10), v varchar(20), index(c), index(v)) collate koi8u_bin engine=ibmdb2i;
-CREATE TABLE t1 (koi8u_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate koi8u_general_ci engine=ibmdb2i;
-CREATE TABLE t1 (latin1_bin integer, c char(10), v varchar(20), index(c), index(v)) collate latin1_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (latin1_bin char(10) primary key) collate latin1_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (latin1_danish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate latin1_danish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (latin1_danish_ci char(10) primary key) collate latin1_danish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (latin1_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate latin1_general_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (latin1_general_ci char(10) primary key) collate latin1_general_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (latin1_general_cs integer, c char(10), v varchar(20), index(c), index(v)) collate latin1_general_cs engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (latin1_general_cs char(10) primary key) collate latin1_general_cs engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (latin1_german1_ci integer, c char(10), v varchar(20), index(c), index(v)) collate latin1_german1_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (latin1_german1_ci char(10) primary key) collate latin1_german1_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (latin1_german2_ci integer, c char(10), v varchar(20), index(c), index(v)) collate latin1_german2_ci engine=ibmdb2i;
-CREATE TABLE t1 (latin1_spanish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate latin1_spanish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (latin1_spanish_ci char(10) primary key) collate latin1_spanish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (latin1_swedish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate latin1_swedish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (latin1_swedish_ci char(10) primary key) collate latin1_swedish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (latin2_bin integer, c char(10), v varchar(20), index(c), index(v)) collate latin2_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (latin2_bin char(10) primary key) collate latin2_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (latin2_croatian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate latin2_croatian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (latin2_croatian_ci char(10) primary key) collate latin2_croatian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (latin2_czech_cs integer, c char(10), v varchar(20), index(c), index(v)) collate latin2_czech_cs engine=ibmdb2i;
-CREATE TABLE t1 (latin2_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate latin2_general_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (latin2_general_ci char(10) primary key) collate latin2_general_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (latin2_hungarian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate latin2_hungarian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (latin2_hungarian_ci char(10) primary key) collate latin2_hungarian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (latin5_bin integer, c char(10), v varchar(20), index(c), index(v)) collate latin5_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (latin5_bin char(10) primary key) collate latin5_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (latin5_turkish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate latin5_turkish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (latin5_turkish_ci char(10) primary key) collate latin5_turkish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (latin7_bin integer, c char(10), v varchar(20), index(c), index(v)) collate latin7_bin engine=ibmdb2i;
-CREATE TABLE t1 (latin7_estonian_cs integer, c char(10), v varchar(20), index(c), index(v)) collate latin7_estonian_cs engine=ibmdb2i;
-CREATE TABLE t1 (latin7_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate latin7_general_ci engine=ibmdb2i;
-CREATE TABLE t1 (latin7_general_cs integer, c char(10), v varchar(20), index(c), index(v)) collate latin7_general_cs engine=ibmdb2i;
-CREATE TABLE t1 (macce_bin integer, c char(10), v varchar(20), index(c), index(v)) collate macce_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (macce_bin char(10) primary key) collate macce_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (macce_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate macce_general_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (macce_general_ci char(10) primary key) collate macce_general_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (macroman_bin integer, c char(10), v varchar(20), index(c), index(v)) collate macroman_bin engine=ibmdb2i;
-CREATE TABLE t1 (macroman_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate macroman_general_ci engine=ibmdb2i;
-CREATE TABLE t1 (sjis_bin integer, c char(10), v varchar(20), index(c), index(v)) collate sjis_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (sjis_bin char(10) primary key) collate sjis_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (sjis_japanese_ci integer, c char(10), v varchar(20), index(c), index(v)) collate sjis_japanese_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (sjis_japanese_ci char(10) primary key) collate sjis_japanese_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (swe7_bin integer, c char(10), v varchar(20), index(c), index(v)) collate swe7_bin engine=ibmdb2i;
-CREATE TABLE t1 (swe7_swedish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate swe7_swedish_ci engine=ibmdb2i;
-CREATE TABLE t1 (tis620_bin integer, c char(10), v varchar(20), index(c), index(v)) collate tis620_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (tis620_bin char(10) primary key) collate tis620_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (tis620_thai_ci integer, c char(10), v varchar(20), index(c), index(v)) collate tis620_thai_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 11 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 23 NULL 6 Using where
-drop table t1;
-create table t1 (tis620_thai_ci char(10) primary key) collate tis620_thai_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_bin integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_bin char(10) primary key) collate ucs2_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_czech_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_czech_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_czech_ci char(10) primary key) collate ucs2_czech_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_danish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_danish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_danish_ci char(10) primary key) collate ucs2_danish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_esperanto_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_esperanto_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_esperanto_ci char(10) primary key) collate ucs2_esperanto_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_estonian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_estonian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_estonian_ci char(10) primary key) collate ucs2_estonian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_general_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_general_ci char(10) primary key) collate ucs2_general_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_hungarian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_hungarian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_hungarian_ci char(10) primary key) collate ucs2_hungarian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_icelandic_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_icelandic_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_icelandic_ci char(10) primary key) collate ucs2_icelandic_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_latvian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_latvian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_latvian_ci char(10) primary key) collate ucs2_latvian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_lithuanian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_lithuanian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_lithuanian_ci char(10) primary key) collate ucs2_lithuanian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_persian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_persian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_persian_ci char(10) primary key) collate ucs2_persian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_polish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_polish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_polish_ci char(10) primary key) collate ucs2_polish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_romanian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_romanian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_romanian_ci char(10) primary key) collate ucs2_romanian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_roman_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_roman_ci engine=ibmdb2i;
-CREATE TABLE t1 (ucs2_slovak_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_slovak_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_slovak_ci char(10) primary key) collate ucs2_slovak_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_slovenian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_slovenian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_slovenian_ci char(10) primary key) collate ucs2_slovenian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_spanish2_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_spanish2_ci engine=ibmdb2i;
-CREATE TABLE t1 (ucs2_spanish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_spanish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_spanish_ci char(10) primary key) collate ucs2_spanish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_swedish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_swedish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_swedish_ci char(10) primary key) collate ucs2_swedish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_turkish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_turkish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_turkish_ci char(10) primary key) collate ucs2_turkish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ucs2_unicode_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ucs2_unicode_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 21 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 43 NULL 6 Using where
-drop table t1;
-create table t1 (ucs2_unicode_ci char(10) primary key) collate ucs2_unicode_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ujis_bin integer, c char(10), v varchar(20), index(c), index(v)) collate ujis_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (ujis_bin char(10) primary key) collate ujis_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (ujis_japanese_ci integer, c char(10), v varchar(20), index(c), index(v)) collate ujis_japanese_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (ujis_japanese_ci char(10) primary key) collate ujis_japanese_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_bin integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_bin engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_bin char(10) primary key) collate utf8_bin engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_czech_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_czech_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_czech_ci char(10) primary key) collate utf8_czech_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_danish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_danish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_danish_ci char(10) primary key) collate utf8_danish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_esperanto_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_esperanto_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_esperanto_ci char(10) primary key) collate utf8_esperanto_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_estonian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_estonian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_estonian_ci char(10) primary key) collate utf8_estonian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_general_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_general_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_general_ci char(10) primary key) collate utf8_general_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_hungarian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_hungarian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_hungarian_ci char(10) primary key) collate utf8_hungarian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_icelandic_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_icelandic_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_icelandic_ci char(10) primary key) collate utf8_icelandic_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_latvian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_latvian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_latvian_ci char(10) primary key) collate utf8_latvian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_lithuanian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_lithuanian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_lithuanian_ci char(10) primary key) collate utf8_lithuanian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_persian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_persian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_persian_ci char(10) primary key) collate utf8_persian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_polish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_polish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_polish_ci char(10) primary key) collate utf8_polish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_romanian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_romanian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_romanian_ci char(10) primary key) collate utf8_romanian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_roman_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_roman_ci engine=ibmdb2i;
-CREATE TABLE t1 (utf8_slovak_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_slovak_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_slovak_ci char(10) primary key) collate utf8_slovak_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_slovenian_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_slovenian_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_slovenian_ci char(10) primary key) collate utf8_slovenian_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_spanish2_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_spanish2_ci engine=ibmdb2i;
-CREATE TABLE t1 (utf8_spanish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_spanish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_spanish_ci char(10) primary key) collate utf8_spanish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_swedish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_swedish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_swedish_ci char(10) primary key) collate utf8_swedish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_turkish_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_turkish_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_turkish_ci char(10) primary key) collate utf8_turkish_ci engine=ibmdb2i;
-drop table t1;
-CREATE TABLE t1 (utf8_unicode_ci integer, c char(10), v varchar(20), index(c), index(v)) collate utf8_unicode_ci engine=ibmdb2i;
-insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
-insert into t1 select * from t1;
-explain select c,v from t1 force index(c) where c like "ab%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 31 NULL 6 Using where
-explain select c,v from t1 force index(v) where v like "de%";
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 63 NULL 6 Using where
-drop table t1;
-create table t1 (utf8_unicode_ci char(10) primary key) collate utf8_unicode_ci engine=ibmdb2i;
-drop table t1;
-create table ffd (WHCHD1 CHAR(20), WHCSID decimal(5,0)) engine=ibmdb2i;
-create table fd (SQSSEQ CHAR(10)) engine=ibmdb2i;
-create temporary table intermed (row integer key auto_increment, cs char(30), ccsid integer);
-insert into intermed (cs, ccsid) select * from ffd;
-create temporary table intermed2 (row integer key auto_increment, srtseq char(10));
-insert into intermed2 (srtseq) select * from fd;
-select ccsid, cs, srtseq from intermed inner join intermed2 on intermed.row = intermed2.row;
-ccsid cs srtseq
-500 "ascii_bin" QBLA101F4U
-500 "ascii_general_ci" QALA101F4S
-1200 "big5_bin" QBCHT04B0U
-1200 "big5_chinese_ci" QACHT04B0S
-1153 "cp1250_bin" QELA20481U
-1153 "cp1250_croatian_ci" QALA20481S
-1153 "cp1250_general_ci" QCLA20481S
-1153 "cp1250_polish_ci" QDLA20481S
-1025 "cp1251_bin" QCCYR0401U
-1025 "cp1251_bulgarian_ci QACYR0401S
-1025 "cp1251_general_ci" QBCYR0401S
-1025 "cp1251_general_cs" QBCYR0401U
-420 "cp1256_bin" QBARA01A4U
-420 "cp1256_general_ci" QAARA01A4S
-500 "cp850_bin" QDLA101F4U
-500 "cp850_general_ci" QCLA101F4S
-870 "cp852_bin" QBLA20366U
-870 "cp852_general_ci" QALA20366S
-1200 "cp932_bin" QBJPN04B0U
-1200 "cp932_japanese_ci" QAJPN04B0S
-1200 "euckr_bin" QBKOR04B0U
-1200 "euckr_korean_ci" QAKOR04B0S
-1200 "gb2312_bin" QBCHS04B0U
-1200 "gb2312_chinese_ci" QACHS04B0S
-1200 "gbk_bin" QDCHS04B0U
-1200 "gbk_chinese_ci" QCCHS04B0S
-875 "greek_bin" QBELL036BU
-875 "greek_general_ci" QAELL036BS
-424 "hebrew_bin" QBHEB01A8U
-424 "hebrew_general_ci" QAHEB01A8S
-1148 "latin1_bin" QFLA1047CU
-1148 "latin1_danish_ci" QALA1047CS
-1148 "latin1_general_ci" QBLA1047CS
-1148 "latin1_general_cs" QBLA1047CU
-1148 "latin1_german1_ci" QCLA1047CS
-1148 "latin1_spanish_ci" QDLA1047CS
-1148 "latin1_swedish_ci" QELA1047CS
-870 "latin2_bin" QGLA20366U
-870 "latin2_croatian_ci" QCLA20366S
-870 "latin2_general_ci" QELA20366S
-870 "latin2_hungarian_ci QFLA20366S
-1026 "latin5_bin" QBTRK0402U
-1026 "latin5_turkish_ci" QATRK0402S
-870 "macce_bin" QILA20366U
-870 "macce_general_ci" QHLA20366S
-1200 "sjis_bin" QDJPN04B0U
-1200 "sjis_japanese_ci" QCJPN04B0S
-838 "tis620_bin" QBTHA0346U
-838 "tis620_thai_ci" QATHA0346S
-13488 "ucs2_bin" *HEX
-13488 "ucs2_czech_ci" I34ACS_CZ
-13488 "ucs2_danish_ci" I34ADA_DK
-13488 "ucs2_esperanto_ci" I34AEO
-13488 "ucs2_estonian_ci" I34AET
-13488 "ucs2_general_ci" QAUCS04B0S
-13488 "ucs2_hungarian_ci" I34AHU
-13488 "ucs2_icelandic_ci" I34AIS
-13488 "ucs2_latvian_ci" I34ALV
-13488 "ucs2_lithuanian_ci" I34ALT
-13488 "ucs2_persian_ci" I34AFA
-13488 "ucs2_polish_ci" I34APL
-13488 "ucs2_romanian_ci" I34ARO
-13488 "ucs2_slovak_ci" I34ASK
-13488 "ucs2_slovenian_ci" I34ASL
-13488 "ucs2_spanish_ci" I34AES
-13488 "ucs2_swedish_ci" I34ASW
-13488 "ucs2_turkish_ci" I34ATR
-13488 "ucs2_unicode_ci" I34AEN
-1200 "ujis_bin" QFJPN04B0U
-1200 "ujis_japanese_ci" QEJPN04B0S
-1208 "utf8_bin" *HEX
-1208 "utf8_czech_ci" I34ACS_CZ
-1208 "utf8_danish_ci" I34ADA_DK
-1208 "utf8_esperanto_ci" I34AEO
-1208 "utf8_estonian_ci" I34AET
-1200 "utf8_general_ci" QAUCS04B0S
-1208 "utf8_hungarian_ci" I34AHU
-1208 "utf8_icelandic_ci" I34AIS
-1208 "utf8_latvian_ci" I34ALV
-1208 "utf8_lithuanian_ci" I34ALT
-1208 "utf8_persian_ci" I34AFA
-1208 "utf8_polish_ci" I34APL
-1208 "utf8_romanian_ci" I34ARO
-1208 "utf8_slovak_ci" I34ASK
-1208 "utf8_slovenian_ci" I34ASL
-1208 "utf8_spanish_ci" I34AES
-1208 "utf8_swedish_ci" I34ASW
-1208 "utf8_turkish_ci" I34ATR
-1208 "utf8_unicode_ci" I34AEN
-drop table ffd, fd;
diff --git a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44020.test b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44020.test
deleted file mode 100644
index 09a7c75cfc0..00000000000
--- a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44020.test
+++ /dev/null
@@ -1,9 +0,0 @@
-source suite/ibmdb2i/include/have_ibmdb2i.inc;
-source include/have_case_sensitive_file_system.inc;
-
-create schema `A12345_@$#`;
-create table `A12345_@$#`.t1 (i int) engine=ibmdb2i;
-show create table `A12345_@$#`.t1;
-select * from `A12345_@$#`.t1;
-drop table `A12345_@$#`.t1;
-drop schema `A12345_@$#`;
diff --git a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44025.test b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44025.test
deleted file mode 100644
index 9b033a2298f..00000000000
--- a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44025.test
+++ /dev/null
@@ -1,9 +0,0 @@
-source suite/ibmdb2i/include/have_ibmdb2i.inc;
-source suite/ibmdb2i/include/have_i61.inc;
-
-
-create table t1 (c char(10) collate utf8_swedish_ci, index(c)) engine=ibmdb2i;
-drop table t1;
-
-create table t1 (c char(10) collate ucs2_swedish_ci, index(c)) engine=ibmdb2i;
-drop table t1;
diff --git a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44232.test b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44232.test
deleted file mode 100644
index ea29b5abcd4..00000000000
--- a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44232.test
+++ /dev/null
@@ -1,8 +0,0 @@
---source suite/ibmdb2i/include/have_ibmdb2i.inc
---source suite/ibmdb2i/include/have_i54.inc
-
---error 1005
-create table t1 (c char(1) character set armscii8) engine=ibmdb2i;
-
---error 1005
-create table t1 (c char(1) character set eucjpms ) engine=ibmdb2i;
diff --git a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test
deleted file mode 100644
index da69b5d9148..00000000000
--- a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test
+++ /dev/null
@@ -1,28 +0,0 @@
-source suite/ibmdb2i/include/have_ibmdb2i.inc;
-
-# Test RCDFMT generation for a variety of kinds of table names
-create table ABC (i int) engine=ibmdb2i;
-drop table ABC;
-
-create table `1234567890ABC` (i int) engine=ibmdb2i;
-drop table `1234567890ABC`;
-
-create table `!@#$%` (i int) engine=ibmdb2i;
-drop table `!@#$%`;
-
-create table `ABCD#########` (i int) engine=ibmdb2i;
-drop table `ABCD#########`;
-
-create table `_` (i int) engine=ibmdb2i;
-drop table `_`;
-
-create table `abc##def` (i int) engine=ibmdb2i;
-drop table `abc##def`;
-
-set names utf8;
-create table Ä° (s1 int) engine=ibmdb2i;
-drop table Ä°;
-
-create table Ä°Ä° (s1 int) engine=ibmdb2i;
-drop table Ä°Ä°;
-set names latin1;
diff --git a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45196.test b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45196.test
deleted file mode 100644
index 17b1d658975..00000000000
--- a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45196.test
+++ /dev/null
@@ -1,26 +0,0 @@
-source suite/ibmdb2i/include/have_ibmdb2i.inc;
-source suite/ibmdb2i/include/have_i61.inc;
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (c char(10), index(c)) collate ucs2_czech_ci engine=ibmdb2i;
-insert into t1 values ("ch"),("h"),("i");
-select * from t1 order by c;
-drop table t1;
-
-create table t1 (c char(10), index(c)) collate utf8_czech_ci engine=ibmdb2i;
-insert into t1 values ("ch"),("h"),("i");
-select * from t1 order by c;
-drop table t1;
-
-create table t1 (c char(10), index(c)) collate ucs2_danish_ci engine=ibmdb2i;
-insert into t1 values("abc"),("abcd"),("aaaa");
-select c from t1 order by c;
-drop table t1;
-
-create table t1 (c char(10), index(c)) collate utf8_danish_ci engine=ibmdb2i;
-insert into t1 values("abc"),("abcd"),("aaaa");
-select c from t1 order by c;
-drop table t1;
diff --git a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45793.test b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45793.test
deleted file mode 100644
index 93fb78ff421..00000000000
--- a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45793.test
+++ /dev/null
@@ -1,11 +0,0 @@
-source suite/ibmdb2i/include/have_ibmdb2i.inc;
-source suite/ibmdb2i/include/have_i61.inc;
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (c char(10), index(c)) charset macce engine=ibmdb2i;
-insert into t1 values ("test");
-select * from t1 order by c;
-drop table t1;
diff --git a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45983.test b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45983.test
deleted file mode 100644
index 695d8e90ada..00000000000
--- a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45983.test
+++ /dev/null
@@ -1,47 +0,0 @@
-source suite/ibmdb2i/include/have_ibmdb2i.inc;
-
-# Confirm that ibmdb2i_create_index_option causes additional *HEX sorted indexes to be created for all non-binary keys.
-
-set ibmdb2i_create_index_option=1;
---disable_warnings
-drop schema if exists test1;
-create schema test1;
-use test1;
---enable_warnings
-
---disable_abort_on_error
---error 0,255
-exec system "DLTF QGPL/FDOUT" > /dev/null;
---enable_abort_on_error
-
-#No additional index because no string fields in key
-CREATE TABLE t1 (f int primary key, index(f)) engine=ibmdb2i;
---error 255
-exec system "DSPFD FILE(\"test1\"/PRIM0001) TYPE(*SEQ) OUTPUT(*OUTFILE) OUTFILE(QGPL/FDOUT) OUTMBR(*FIRST *ADD)" > /dev/null;
---error 255
-exec system "DSPFD FILE(\"test1\"/\"f___H_t1\") TYPE(*SEQ) OUTPUT(*OUTFILE) OUTFILE(QGPL/FDOUT) OUTMBR(*FIRST *ADD)" > /dev/null;
-drop table t1;
-
-#No additional index because binary sorting
-CREATE TABLE t1 (f char(10) collate utf8_bin primary key, index(f)) engine=ibmdb2i;
---error 255
-exec system "DSPFD FILE(\"test1\"/PRIM0001) TYPE(*SEQ) OUTPUT(*OUTFILE) OUTFILE(QGPL/FDOUT) OUTMBR(*FIRST *ADD)" > /dev/null;
---error 255
-exec system "DSPFD FILE(\"test1\"/\"f___H_t1\") TYPE(*SEQ) OUTPUT(*OUTFILE) OUTFILE(QGPL/FDOUT) OUTMBR(*FIRST *ADD)" > /dev/null;
-drop table t1;
-
-CREATE TABLE t1 (f char(10) collate latin1_swedish_ci primary key, index(f)) engine=ibmdb2i;
-exec system "DSPFD FILE(\"test1\"/PRIM0001) TYPE(*SEQ) OUTPUT(*OUTFILE) OUTFILE(QGPL/FDOUT) OUTMBR(*FIRST *ADD)" > /dev/null;
-exec system "DSPFD FILE(\"test1\"/\"f___H_t1\") TYPE(*SEQ) OUTPUT(*OUTFILE) OUTFILE(QGPL/FDOUT) OUTMBR(*FIRST *ADD)" > /dev/null;
-drop table t1;
-
-CREATE TABLE t1 (f char(10) collate latin1_swedish_ci primary key, i int, index i(i,f)) engine=ibmdb2i;
-exec system "DSPFD FILE(\"test1\"/PRIM0001) TYPE(*SEQ) OUTPUT(*OUTFILE) OUTFILE(QGPL/FDOUT) OUTMBR(*FIRST *ADD)" > /dev/null;
-exec system "DSPFD FILE(\"test1\"/\"i___H_t1\") TYPE(*SEQ) OUTPUT(*OUTFILE) OUTFILE(QGPL/FDOUT) OUTMBR(*FIRST *ADD)" > /dev/null;
-drop table t1;
-
-
-create table fd (SQSSEQ CHAR(10)) engine=ibmdb2i;
-system system "CPYF FROMFILE(QGPL/FDOUT) TOFILE(\"test1\"/\"fd\") mbropt(*replace) fmtopt(*drop *map)" > /dev/null;
-select * from fd;
-drop table fd;
diff --git a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_49329.test b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_49329.test
deleted file mode 100644
index 615df284d8f..00000000000
--- a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_49329.test
+++ /dev/null
@@ -1,10 +0,0 @@
-source suite/ibmdb2i/include/have_ibmdb2i.inc;
-source include/have_case_sensitive_file_system.inc;
-
-create table ABC (i int) engine=ibmdb2i;
-insert into ABC values(1);
-create table abc (i int) engine=ibmdb2i;
-insert into abc values (2);
-select * from ABC;
-drop table ABC;
-drop table abc;
diff --git a/mysql-test/suite/ibmdb2i/t/ibmdb2i_collations.test b/mysql-test/suite/ibmdb2i/t/ibmdb2i_collations.test
deleted file mode 100644
index 899f330d360..00000000000
--- a/mysql-test/suite/ibmdb2i/t/ibmdb2i_collations.test
+++ /dev/null
@@ -1,44 +0,0 @@
-source suite/ibmdb2i/include/have_ibmdb2i.inc;
-source suite/ibmdb2i/include/have_i61.inc;
---disable_warnings
-drop table if exists t1, ffd, fd;
---enable_warnings
-
---disable_abort_on_error
---error 0,255
-exec system "DLTF QGPL/FFDOUT" > /dev/null;
---error 0,255
-exec system "DLTF QGPL/FDOUT" > /dev/null;
---enable_abort_on_error
-let $count= query_get_value(select count(*) from information_schema.COLLATIONS where COLLATION_NAME <> "binary", count(*),1);
-
-while ($count)
-{
- let $collation = query_get_value(select COLLATION_NAME from information_schema.COLLATIONS where COLLATION_NAME <> "binary" order by COLLATION_NAME desc, COLLATION_NAME, $count);
- error 0,1005,2504,2028;
- eval CREATE TABLE t1 ($collation integer, c char(10), v varchar(20), index(c), index(v)) collate $collation engine=ibmdb2i;
- if (!$mysql_errno)
- {
- insert into t1 (c,v) values ("abc","def"),("abcd", "def"),("abcde","defg"),("aaaa","bbbb");
- insert into t1 select * from t1;
- explain select c,v from t1 force index(c) where c like "ab%";
- explain select c,v from t1 force index(v) where v like "de%";
- drop table t1;
- eval create table t1 ($collation char(10) primary key) collate $collation engine=ibmdb2i;
- system system "DSPFFD FILE(\"test\"/\"t1\") OUTPUT(*OUTFILE) OUTFILE(QGPL/FFDOUT) OUTMBR(*FIRST *ADD)" > /dev/null;
- system system "DSPFD FILE(\"test\"/\"t1\") TYPE(*SEQ) OUTPUT(*OUTFILE) OUTFILE(QGPL/FDOUT) OUTMBR(*FIRST *ADD)" > /dev/null;
- drop table t1;
- }
- dec $count;
-}
-
-create table ffd (WHCHD1 CHAR(20), WHCSID decimal(5,0)) engine=ibmdb2i;
-system system "CPYF FROMFILE(QGPL/FFDOUT) TOFILE(\"test\"/\"ffd\") mbropt(*replace) fmtopt(*drop *map)" > /dev/null;
-create table fd (SQSSEQ CHAR(10)) engine=ibmdb2i;
-system system "CPYF FROMFILE(QGPL/FDOUT) TOFILE(\"test\"/\"fd\") mbropt(*replace) fmtopt(*drop *map)" > /dev/null;
-create temporary table intermed (row integer key auto_increment, cs char(30), ccsid integer);
-insert into intermed (cs, ccsid) select * from ffd;
-create temporary table intermed2 (row integer key auto_increment, srtseq char(10));
-insert into intermed2 (srtseq) select * from fd;
-select ccsid, cs, srtseq from intermed inner join intermed2 on intermed.row = intermed2.row;
-drop table ffd, fd;
diff --git a/mysql-test/suite/innodb/r/innodb-autoinc-18274.result b/mysql-test/suite/innodb/r/innodb-autoinc-18274.result
new file mode 100644
index 00000000000..22afc65a649
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-autoinc-18274.result
@@ -0,0 +1,26 @@
+drop table if exists t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (null);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+DELETE FROM t1;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES(null);
+SELECT * FROM t1;
+c1
+2
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-autoinc-56228.result b/mysql-test/suite/innodb/r/innodb-autoinc-56228.result
new file mode 100644
index 00000000000..492130d1f08
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-autoinc-56228.result
@@ -0,0 +1,30 @@
+DROP TABLE IF EXISTS t1_56228;
+Warnings:
+Note 1051 Unknown table 't1_56228'
+DROP TABLE IF EXISTS t2_56228;
+Warnings:
+Note 1051 Unknown table 't2_56228'
+DROP FUNCTION IF EXISTS bug56228;
+Warnings:
+Note 1305 FUNCTION test.bug56228 does not exist
+CREATE TEMPORARY TABLE t1_56228(
+c1 iNT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE t2_56228(
+c1 iNT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+CREATE FUNCTION bug56228() RETURNS INT DETERMINISTIC
+BEGIN
+INSERT INTO t1_56228 VALUES(NULL);
+INSERT INTO t2_56228 VALUES(NULL);
+INSERT INTO t1_56228 VALUES(NULL);
+INSERT INTO t2_56228 VALUES(NULL);
+DROP TEMPORARY TABLE t1_56228;
+RETURN 42;
+END //
+SELECT bug56228();
+bug56228()
+42
+DROP FUNCTION bug56228;
+DROP TEMPORARY TABLE t2_56228;
+DROP TEMPORARY TABLE IF EXISTS t1_56228;
+Warnings:
+Note 1051 Unknown table 't1_56228'
diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result
index 350c7ebd541..0c8d16f27fb 100644
--- a/mysql-test/suite/innodb/r/innodb-autoinc.result
+++ b/mysql-test/suite/innodb/r/innodb-autoinc.result
@@ -471,17 +471,12 @@ SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 2
auto_increment_offset 10
-INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+ERROR HY000: Failed to read auto-increment value from storage engine
SELECT * FROM t1;
c1
1
18446744073709551603
-18446744073709551604
-18446744073709551606
-18446744073709551608
-18446744073709551610
-18446744073709551612
-18446744073709551614
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
@@ -504,13 +499,12 @@ SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 5
auto_increment_offset 7
-INSERT INTO t1 VALUES (NULL),(NULL);
+INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
+ERROR HY000: Failed to read auto-increment value from storage engine
SELECT * FROM t1;
c1
1
18446744073709551603
-18446744073709551607
-18446744073709551612
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
@@ -572,12 +566,12 @@ SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 65535
auto_increment_offset 65535
-INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL),(NULL);
+ERROR 22003: Out of range value for column 't1' at row 167
SELECT * FROM t1;
c1
1
18446744073709551610
-18446744073709551615
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
diff --git a/mysql-test/suite/innodb/r/innodb-create-options.result b/mysql-test/suite/innodb/r/innodb-create-options.result
new file mode 100644
index 00000000000..aec9d731ce6
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-create-options.result
@@ -0,0 +1,854 @@
+SET storage_engine=InnoDB;
+SET GLOBAL innodb_file_format=`Barracuda`;
+SET GLOBAL innodb_file_per_table=ON;
+SET SESSION innodb_strict_mode = ON;
+# Test 1) StrictMode=ON, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0
+# KEY_BLOCK_SIZE=0 means 'no KEY_BLOCK_SIZE is specified'
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+# 'FIXED' is sent to InnoDB since it is used by MyISAM.
+# But it is an invalid mode in InnoDB
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: invalid ROW_FORMAT specifier.
+Error 1005 Can't create table 'test.t1' (errno: 1478)
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED
+ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPACT
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Dynamic row_format=DYNAMIC
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Redundant row_format=REDUNDANT
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact
+ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: invalid ROW_FORMAT specifier.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact
+# Test 2) StrictMode=ON, CREATE with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE
+# KEY_BLOCK_SIZE is incompatible with COMPACT, REDUNDANT, & DYNAMIC
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
+Error 1005 Can't create table 'test.t1' (errno: 1478)
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
+Error 1005 Can't create table 'test.t1' (errno: 1478)
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
+Error 1005 Can't create table 'test.t1' (errno: 1478)
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=8
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=8
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed KEY_BLOCK_SIZE=16
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed KEY_BLOCK_SIZE=16
+# Test 3) StrictMode=ON, ALTER with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT );
+ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: invalid ROW_FORMAT specifier.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=8;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed KEY_BLOCK_SIZE=16
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=1
+# Test 4) StrictMode=ON, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid non-zero KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPACT
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Redundant row_format=REDUNDANT
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Dynamic row_format=DYNAMIC
+ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED
+ALTER TABLE t1 KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=16
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed KEY_BLOCK_SIZE=1
+# Test 5) StrictMode=ON, CREATE with a valid KEY_BLOCK_SIZE
+# ALTER with each ROW_FORMAT
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=2;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL,
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2
+ALTER TABLE t1 ROW_FORMAT=COMPACT;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=2
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact
+ALTER TABLE t1 ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPACT
+# Test 6) StrictMode=ON, CREATE with an invalid KEY_BLOCK_SIZE.
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=9;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
+Error 1005 Can't create table 'test.t1' (errno: 1478)
+# Test 7) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and
+# and a valid non-zero KEY_BLOCK_SIZE are rejected with Antelope
+# and that they can be set to default values during strict mode.
+SET GLOBAL innodb_file_format=Antelope;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=4;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
+Error 1005 Can't create table 'test.t1' (errno: 1478)
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
+Error 1005 Can't create table 'test.t1' (errno: 1478)
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
+Error 1005 Can't create table 'test.t1' (errno: 1478)
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Redundant row_format=REDUNDANT
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPACT
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT;
+SHOW WARNINGS;
+Level Code Message
+ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
+SET GLOBAL innodb_file_format=Antelope;
+ALTER TABLE t1 ADD COLUMN f1 INT;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
+Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+ALTER TABLE t1 ADD COLUMN f2 INT;
+SHOW WARNINGS;
+Level Code Message
+SET GLOBAL innodb_file_format=Barracuda;
+# Test 8) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and
+# and a valid non-zero KEY_BLOCK_SIZE are rejected with
+# innodb_file_per_table=OFF and that they can be set to default
+# values during strict mode.
+SET GLOBAL innodb_file_per_table=OFF;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=16;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Error 1005 Can't create table 'test.t1' (errno: 1478)
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
+Error 1005 Can't create table 'test.t1' (errno: 1478)
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
+ERROR HY000: Can't create table 'test.t1' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
+Error 1005 Can't create table 'test.t1' (errno: 1478)
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Redundant row_format=REDUNDANT
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPACT
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT;
+SHOW WARNINGS;
+Level Code Message
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPACT
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Redundant row_format=REDUNDANT
+ALTER TABLE t1 ROW_FORMAT=DEFAULT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact
+SET GLOBAL innodb_file_per_table=ON;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
+SET GLOBAL innodb_file_per_table=OFF;
+ALTER TABLE t1 ADD COLUMN f1 INT;
+ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
+Error 1005 Can't create table '#sql-temporary' (errno: 1478)
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+ALTER TABLE t1 ADD COLUMN f2 INT;
+SHOW WARNINGS;
+Level Code Message
+SET GLOBAL innodb_file_per_table=ON;
+##################################################
+SET SESSION innodb_strict_mode = OFF;
+# Test 9) StrictMode=OFF, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0
+# KEY_BLOCK_SIZE=0 means 'no KEY_BLOCK_SIZE is specified'
+# 'FIXED' is sent to InnoDB since it is used by MyISAM.
+# It is an invalid mode in InnoDB, use COMPACT
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED;
+Warnings:
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=FIXED
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED
+ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPACT
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Dynamic row_format=DYNAMIC
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Redundant row_format=REDUNDANT
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact
+ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0;
+Warnings:
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=FIXED
+# Test 10) StrictMode=OFF, CREATE with each ROW_FORMAT & a valid KEY_BLOCK_SIZE
+# KEY_BLOCK_SIZE is ignored with COMPACT, REDUNDANT, & DYNAMIC
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPACT KEY_BLOCK_SIZE=1
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Redundant row_format=REDUNDANT KEY_BLOCK_SIZE=2
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Dynamic row_format=DYNAMIC KEY_BLOCK_SIZE=4
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=8
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=8
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed KEY_BLOCK_SIZE=16
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed KEY_BLOCK_SIZE=16
+# Test 11) StrictMode=OFF, ALTER with each ROW_FORMAT & a valid KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT );
+ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=FIXED KEY_BLOCK_SIZE=1
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT );
+ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPACT KEY_BLOCK_SIZE=2
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT );
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Dynamic row_format=DYNAMIC KEY_BLOCK_SIZE=4
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT );
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=8;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=8 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=8 unless ROW_FORMAT=COMPRESSED.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Redundant row_format=REDUNDANT KEY_BLOCK_SIZE=8
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT );
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed KEY_BLOCK_SIZE=16
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=1
+# Test 12) StrictMode=OFF, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPACT
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPACT KEY_BLOCK_SIZE=2
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Redundant row_format=REDUNDANT KEY_BLOCK_SIZE=2
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Dynamic row_format=DYNAMIC KEY_BLOCK_SIZE=2
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=2
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=4
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed KEY_BLOCK_SIZE=8
+# Test 13) StrictMode=OFF, CREATE with a valid KEY_BLOCK_SIZE
+# ALTER with each ROW_FORMAT
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=16
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+Level Code Message
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL,
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=16
+ALTER TABLE t1 ROW_FORMAT=COMPACT;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPACT KEY_BLOCK_SIZE=16
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Redundant row_format=REDUNDANT KEY_BLOCK_SIZE=16
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Dynamic row_format=DYNAMIC KEY_BLOCK_SIZE=16
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=16
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact
+ALTER TABLE t1 ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPACT
+# Test 14) StrictMode=OFF, CREATE with an invalid KEY_BLOCK_SIZE, it defaults to 8
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=15;
+Warnings:
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=15.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=15.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact KEY_BLOCK_SIZE=15
+# Test 15) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a
+valid KEY_BLOCK_SIZE are remembered but not used when ROW_FORMAT
+is reverted to Antelope and then used again when ROW_FORMAT=Barracuda.
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=1
+SET GLOBAL innodb_file_format=Antelope;
+ALTER TABLE t1 ADD COLUMN f1 INT;
+Warnings:
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
+Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
+Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPRESSED KEY_BLOCK_SIZE=1
+SET GLOBAL innodb_file_format=Barracuda;
+ALTER TABLE t1 ADD COLUMN f2 INT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=1
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Dynamic row_format=DYNAMIC
+SET GLOBAL innodb_file_format=Antelope;
+ALTER TABLE t1 ADD COLUMN f1 INT;
+Warnings:
+Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=DYNAMIC
+SET GLOBAL innodb_file_format=Barracuda;
+ALTER TABLE t1 ADD COLUMN f2 INT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Dynamic row_format=DYNAMIC
+# Test 16) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a
+valid KEY_BLOCK_SIZE are remembered but not used when innodb_file_per_table=OFF
+and then used again when innodb_file_per_table=ON.
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=2
+SET GLOBAL innodb_file_per_table=OFF;
+ALTER TABLE t1 ADD COLUMN f1 INT;
+Warnings:
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2.
+Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
+Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2.
+Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=COMPRESSED KEY_BLOCK_SIZE=2
+SET GLOBAL innodb_file_per_table=ON;
+ALTER TABLE t1 ADD COLUMN f2 INT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=2
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Dynamic row_format=DYNAMIC
+SET GLOBAL innodb_file_per_table=OFF;
+ALTER TABLE t1 ADD COLUMN f1 INT;
+Warnings:
+Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SHOW WARNINGS;
+Level Code Message
+Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Compact row_format=DYNAMIC
+SET GLOBAL innodb_file_per_table=ON;
+ALTER TABLE t1 ADD COLUMN f2 INT;
+SHOW WARNINGS;
+Level Code Message
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+TABLE_NAME ROW_FORMAT CREATE_OPTIONS
+t1 Dynamic row_format=DYNAMIC
+# Cleanup
+DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result
index 1aeca2c226a..7d7062c9161 100644
--- a/mysql-test/suite/innodb/r/innodb-index.result
+++ b/mysql-test/suite/innodb/r/innodb-index.result
@@ -842,31 +842,31 @@ create table t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob,
q blob,r blob,s blob,t blob,u blob)
engine=innodb row_format=dynamic;
-create index t1a on t1 (a(1));
-create index t1b on t1 (b(1));
-create index t1c on t1 (c(1));
-create index t1d on t1 (d(1));
-create index t1e on t1 (e(1));
-create index t1f on t1 (f(1));
-create index t1g on t1 (g(1));
-create index t1h on t1 (h(1));
-create index t1i on t1 (i(1));
-create index t1j on t1 (j(1));
-create index t1k on t1 (k(1));
-create index t1l on t1 (l(1));
-create index t1m on t1 (m(1));
-create index t1n on t1 (n(1));
-create index t1o on t1 (o(1));
-create index t1p on t1 (p(1));
-create index t1q on t1 (q(1));
-create index t1r on t1 (r(1));
-create index t1s on t1 (s(1));
-create index t1t on t1 (t(1));
-create index t1u on t1 (u(1));
+create index t1a on t1 (a(767));
+create index t1b on t1 (b(767));
+create index t1c on t1 (c(767));
+create index t1d on t1 (d(767));
+create index t1e on t1 (e(767));
+create index t1f on t1 (f(767));
+create index t1g on t1 (g(767));
+create index t1h on t1 (h(767));
+create index t1i on t1 (i(767));
+create index t1j on t1 (j(767));
+create index t1k on t1 (k(767));
+create index t1l on t1 (l(767));
+create index t1m on t1 (m(767));
+create index t1n on t1 (n(767));
+create index t1o on t1 (o(767));
+create index t1p on t1 (p(767));
+create index t1q on t1 (q(767));
+create index t1r on t1 (r(767));
+create index t1s on t1 (s(767));
+create index t1t on t1 (t(767));
+create index t1u on t1 (u(767));
ERROR HY000: Too big row
-create index t1ut on t1 (u(1), t(1));
+create index t1ut on t1 (u(767), t(767));
ERROR HY000: Too big row
-create index t1st on t1 (s(1), t(1));
+create index t1st on t1 (s(767), t(767));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -891,36 +891,36 @@ t1 CREATE TABLE `t1` (
`s` blob,
`t` blob,
`u` blob,
- KEY `t1a` (`a`(1)),
- KEY `t1b` (`b`(1)),
- KEY `t1c` (`c`(1)),
- KEY `t1d` (`d`(1)),
- KEY `t1e` (`e`(1)),
- KEY `t1f` (`f`(1)),
- KEY `t1g` (`g`(1)),
- KEY `t1h` (`h`(1)),
- KEY `t1i` (`i`(1)),
- KEY `t1j` (`j`(1)),
- KEY `t1k` (`k`(1)),
- KEY `t1l` (`l`(1)),
- KEY `t1m` (`m`(1)),
- KEY `t1n` (`n`(1)),
- KEY `t1o` (`o`(1)),
- KEY `t1p` (`p`(1)),
- KEY `t1q` (`q`(1)),
- KEY `t1r` (`r`(1)),
- KEY `t1s` (`s`(1)),
- KEY `t1t` (`t`(1)),
- KEY `t1st` (`s`(1),`t`(1))
+ KEY `t1a` (`a`(767)),
+ KEY `t1b` (`b`(767)),
+ KEY `t1c` (`c`(767)),
+ KEY `t1d` (`d`(767)),
+ KEY `t1e` (`e`(767)),
+ KEY `t1f` (`f`(767)),
+ KEY `t1g` (`g`(767)),
+ KEY `t1h` (`h`(767)),
+ KEY `t1i` (`i`(767)),
+ KEY `t1j` (`j`(767)),
+ KEY `t1k` (`k`(767)),
+ KEY `t1l` (`l`(767)),
+ KEY `t1m` (`m`(767)),
+ KEY `t1n` (`n`(767)),
+ KEY `t1o` (`o`(767)),
+ KEY `t1p` (`p`(767)),
+ KEY `t1q` (`q`(767)),
+ KEY `t1r` (`r`(767)),
+ KEY `t1s` (`s`(767)),
+ KEY `t1t` (`t`(767)),
+ KEY `t1st` (`s`(767),`t`(767))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
-create index t1u on t1 (u(1));
+create index t1u on t1 (u(767));
ERROR HY000: Too big row
alter table t1 row_format=compact;
-create index t1u on t1 (u(1));
+create index t1u on t1 (u(767));
drop table t1;
-set global innodb_file_per_table=1;
-set global innodb_file_format=Barracuda;
-set global innodb_file_format_max=Barracuda;
+set global innodb_file_per_table=0;
+set global innodb_file_format=Antelope;
+set global innodb_file_format_max=Antelope;
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
CREATE TABLE t1(
diff --git a/mysql-test/suite/innodb/r/innodb-system-table-view.result b/mysql-test/suite/innodb/r/innodb-system-table-view.result
deleted file mode 100644
index ffa57ee32ce..00000000000
--- a/mysql-test/suite/innodb/r/innodb-system-table-view.result
+++ /dev/null
@@ -1,110 +0,0 @@
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
-TABLE_ID NAME FLAG N_COLS SPACE
-11 SYS_FOREIGN 0 7 0
-12 SYS_FOREIGN_COLS 0 7 0
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
-INDEX_ID NAME TABLE_ID TYPE N_FIELDS PAGE_NO SPACE
-11 ID_IND 11 3 1 302 0
-12 FOR_IND 11 0 1 303 0
-13 REF_IND 11 0 1 304 0
-14 ID_IND 12 3 2 305 0
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS;
-TABLE_ID NAME POS MTYPE PRTYPE LEN
-11 ID 0 1 524292 0
-11 FOR_NAME 1 1 524292 0
-11 REF_NAME 2 1 524292 0
-11 N_COLS 3 6 0 4
-12 ID 0 1 524292 0
-12 POS 1 6 0 4
-12 FOR_COL_NAME 2 1 524292 0
-12 REF_COL_NAME 3 1 524292 0
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS;
-INDEX_ID NAME POS
-11 ID 0
-12 FOR_NAME 0
-13 REF_NAME 0
-14 ID 0
-14 POS 1
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
-ID FOR_NAME REF_NAME N_COLS TYPE
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
-ID FOR_COL_NAME REF_COL_NAME POS
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS;
-TABLE_ID NAME STATS_INITIALIZED NUM_ROWS CLUST_INDEX_SIZE OTHER_INDEX_SIZE MODIFIED_COUNTER AUTOINC MYSQL_HANDLES_OPENED
-11 SYS_FOREIGN Uninitialized 0 0 0 0 0 0
-12 SYS_FOREIGN_COLS Uninitialized 0 0 0 0 0 0
-CREATE TABLE parent (id INT NOT NULL,
-PRIMARY KEY (id)) ENGINE=INNODB;
-CREATE TABLE child (id INT, parent_id INT,
-INDEX par_ind (parent_id),
-CONSTRAINT constraint_test
-FOREIGN KEY (parent_id) REFERENCES parent(id)
-ON DELETE CASCADE) ENGINE=INNODB;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
-ID FOR_NAME REF_NAME N_COLS TYPE
-test/constraint_test test/child test/parent 1 1
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
-ID FOR_COL_NAME REF_COL_NAME POS
-test/constraint_test parent_id id 0
-INSERT INTO parent VALUES(1);
-SELECT name, num_rows, mysql_handles_opened
-FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
-WHERE name LIKE "%parent";
-name num_rows mysql_handles_opened
-test/parent 1 1
-SELECT NAME, FLAG, N_COLS, SPACE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
-NAME FLAG N_COLS SPACE
-SYS_FOREIGN 0 7 0
-SYS_FOREIGN_COLS 0 7 0
-test/child 1 5 0
-test/parent 1 4 0
-SELECT name, n_fields
-from INFORMATION_SCHEMA.INNODB_SYS_INDEXES
-WHERE table_id In (SELECT table_id from
-INFORMATION_SCHEMA.INNODB_SYS_TABLES
-WHERE name LIKE "%parent%");
-name n_fields
-PRIMARY 1
-SELECT name, n_fields
-from INFORMATION_SCHEMA.INNODB_SYS_INDEXES
-WHERE table_id In (SELECT table_id from
-INFORMATION_SCHEMA.INNODB_SYS_TABLES
-WHERE name LIKE "%child%");
-name n_fields
-GEN_CLUST_INDEX 0
-par_ind 1
-SELECT name, pos, mtype, len
-from INFORMATION_SCHEMA.INNODB_SYS_COLUMNS
-WHERE table_id In (SELECT table_id from
-INFORMATION_SCHEMA.INNODB_SYS_TABLES
-WHERE name LIKE "%child%");
-name pos mtype len
-id 0 6 4
-parent_id 1 6 4
-DROP TABLE child;
-DROP TABLE parent;
-CREATE TABLE parent (id INT NOT NULL, newid INT NOT NULL,
-PRIMARY KEY (id, newid)) ENGINE=INNODB;
-CREATE TABLE child (id INT, parent_id INT,
-INDEX par_ind (parent_id),
-CONSTRAINT constraint_test
-FOREIGN KEY (id, parent_id) REFERENCES parent(id, newid)
-ON DELETE CASCADE) ENGINE=INNODB;
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
-ID FOR_NAME REF_NAME N_COLS TYPE
-test/constraint_test test/child test/parent 2 1
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
-ID FOR_COL_NAME REF_COL_NAME POS
-test/constraint_test id id 0
-test/constraint_test parent_id newid 1
-INSERT INTO parent VALUES(1, 9);
-SELECT * FROM parent WHERE id IN (SELECT id FROM parent);
-id newid
-1 9
-SELECT name, num_rows, mysql_handles_opened
-FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
-WHERE name LIKE "%parent";
-name num_rows mysql_handles_opened
-test/parent 1 2
-DROP TABLE child;
-DROP TABLE parent;
diff --git a/mysql-test/suite/innodb/r/innodb-timeout.result b/mysql-test/suite/innodb/r/innodb-timeout.result
index be9a688cd72..bb71ba5cb3d 100644
--- a/mysql-test/suite/innodb/r/innodb-timeout.result
+++ b/mysql-test/suite/innodb/r/innodb-timeout.result
@@ -13,13 +13,14 @@ set global innodb_lock_wait_timeout=347;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
42
-set innodb_lock_wait_timeout=1;
+set innodb_lock_wait_timeout=10;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
-1
+10
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
347
+SET @connection_b_id = <connection_b_id>;
create table t1(a int primary key)engine=innodb;
begin;
insert into t1 values(1),(2),(3);
@@ -31,8 +32,9 @@ a
3
begin;
insert into t1 values(4);
+set innodb_lock_wait_timeout=3;
select * from t1 for update;
commit;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
drop table t1;
-set global innodb_lock_wait_timeout=50;
+set global innodb_lock_wait_timeout=<initial_timeout>;
diff --git a/mysql-test/suite/innodb/r/innodb-truncate.result b/mysql-test/suite/innodb/r/innodb-truncate.result
new file mode 100644
index 00000000000..f63e9272850
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-truncate.result
@@ -0,0 +1,68 @@
+#
+# TRUNCATE TABLE
+#
+# Truncating is disallowed for parent tables unless such table
+# participates in self-referencing foreign keys only.
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE t2 (fk INT NOT NULL, FOREIGN KEY (fk) REFERENCES t1 (pk)) ENGINE=INNODB;
+TRUNCATE TABLE t1;
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fk`) REFERENCES `test`.`t1` (`pk`))
+# Truncation of child should succeed.
+TRUNCATE TABLE t2;
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (pk INT PRIMARY KEY, fk INT,
+FOREIGN KEY (fk) REFERENCES t1 (pk)) ENGINE=INNODB;
+# Truncation of self-referencing table should succeed.
+TRUNCATE TABLE t1;
+DROP TABLE t1;
+#
+# Also, truncating such tables is allowed if foreign key
+# checks are disabled.
+#
+SET @old_foreign_key_checks = @@SESSION.foreign_key_checks;
+CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE t2 (fk INT NOT NULL, FOREIGN KEY (fk) REFERENCES t1 (pk)) ENGINE=INNODB;
+CREATE TABLE t3 (pk INT PRIMARY KEY, fk INT,
+FOREIGN KEY (fk) REFERENCES t1 (pk)) ENGINE=INNODB;
+SET @@SESSION.foreign_key_checks = 0;
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+SET @@SESSION.foreign_key_checks = 1;
+TRUNCATE TABLE t1;
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fk`) REFERENCES `test`.`t1` (`pk`))
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+LOCK TABLES t1 WRITE;
+SET @@SESSION.foreign_key_checks = 0;
+TRUNCATE TABLE t1;
+SET @@SESSION.foreign_key_checks = 1;
+TRUNCATE TABLE t1;
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fk`) REFERENCES `test`.`t1` (`pk`))
+UNLOCK TABLES;
+DROP TABLE t3,t2,t1;
+SET @@SESSION.foreign_key_checks = @old_foreign_key_checks;
+#
+# Test that TRUNCATE resets auto-increment.
+#
+CREATE TABLE t1 (a INT PRIMARY KEY NOT NULL AUTO_INCREMENT);
+INSERT INTO t1 VALUES (NULL), (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't1';
+AUTO_INCREMENT
+3
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+TRUNCATE TABLE t1;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't1';
+AUTO_INCREMENT
+1
+INSERT INTO t1 VALUES (NULL), (NULL);
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-zip.result b/mysql-test/suite/innodb/r/innodb-zip.result
index da2be2bb07d..a63ddff15ce 100644
--- a/mysql-test/suite/innodb/r/innodb-zip.result
+++ b/mysql-test/suite/innodb/r/innodb-zip.result
@@ -84,8 +84,6 @@ test t8 Compact
test t9 Compact
drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
alter table t1 key_block_size=0;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=0.
alter table t1 row_format=dynamic;
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
@@ -191,16 +189,9 @@ set global innodb_file_per_table = on;
set global innodb_file_format = `1`;
set innodb_strict_mode = off;
create table t1 (id int primary key) engine = innodb key_block_size = 0;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=0.
drop table t1;
set innodb_strict_mode = on;
create table t1 (id int primary key) engine = innodb key_block_size = 0;
-ERROR HY000: Can't create table 'test.t1' (errno: 1478)
-show warnings;
-Level Code Message
-Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 0. Valid values are [1, 2, 4, 8, 16]
-Error 1005 Can't create table 'test.t1' (errno: 1478)
create table t2 (id int primary key) engine = innodb key_block_size = 9;
ERROR HY000: Can't create table 'test.t2' (errno: 1478)
show warnings;
@@ -219,6 +210,7 @@ create table t11(id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
+test t1 Compact
test t10 Compact
test t11 Redundant
test t3 Compressed
@@ -228,7 +220,7 @@ test t6 Compressed
test t7 Compressed
test t8 Compressed
test t9 Dynamic
-drop table t3, t4, t5, t6, t7, t8, t9, t10, t11;
+drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
create table t1 (id int primary key) engine = innodb
key_block_size = 8 row_format = compressed;
create table t2 (id int primary key) engine = innodb
@@ -254,16 +246,12 @@ Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
Error 1005 Can't create table 'test.t4' (errno: 1478)
create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default;
-ERROR HY000: Can't create table 'test.t5' (errno: 1478)
-show warnings;
-Level Code Message
-Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
-Error 1005 Can't create table 'test.t5' (errno: 1478)
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
table_schema table_name row_format
test t1 Compressed
-drop table t1;
+test t5 Compressed
+drop table t1, t5;
create table t1 (id int primary key) engine = innodb
key_block_size = 9 row_format = redundant;
ERROR HY000: Can't create table 'test.t1' (errno: 1478)
@@ -394,8 +382,8 @@ table_schema table_name row_format
test t8 Compact
test t9 Redundant
drop table t8, t9;
-set global innodb_file_per_table=1;
-set global innodb_file_format=Barracuda;
+set global innodb_file_per_table=0;
+set global innodb_file_format=Antelope;
set global innodb_file_per_table=on;
set global innodb_file_format=`Barracuda`;
set global innodb_file_format_max=`Antelope`;
diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result
index fd7cf87d138..651ad391db0 100644
--- a/mysql-test/suite/innodb/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -2,6 +2,9 @@ set optimizer_switch='index_condition_pushdown=off';
set @@optimizer_use_mrr=disable;
drop table if exists t1,t2,t3,t4;
drop database if exists mysqltest;
+CREATE TABLE bug58912 (a BLOB, b TEXT, PRIMARY KEY(a(1))) ENGINE=InnoDB;
+INSERT INTO bug58912 VALUES(REPEAT('a',8000),REPEAT('b',8000));
+UPDATE bug58912 SET a=REPEAT('a',7999);
create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb;
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
select id, code, name from t1 order by id;
@@ -1672,10 +1675,10 @@ variable_value - @innodb_rows_deleted_orig
71
SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
variable_value - @innodb_rows_inserted_orig
-1065
+1066
SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
variable_value - @innodb_rows_updated_orig
-865
+866
SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits';
variable_value - @innodb_row_lock_waits_orig
0
@@ -2426,10 +2429,6 @@ drop table t1,t2;
CREATE TABLE t1 (
id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id)
) ENGINE=InnoDB;
-CREATE TABLE t2 (
-id INTEGER NOT NULL,
-FOREIGN KEY (id) REFERENCES t1 (id)
-) ENGINE=InnoDB;
INSERT INTO t1 (id) VALUES (NULL);
SELECT * FROM t1;
id
@@ -2445,7 +2444,7 @@ INSERT INTO t1 (id) VALUES (NULL);
SELECT * FROM t1;
id
1
-DROP TABLE t2, t1;
+DROP TABLE t1;
CREATE TABLE t1
(
id INT PRIMARY KEY
@@ -2623,13 +2622,15 @@ ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fail
update t4 set a=2;
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`))
truncate t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t1` (`a`))
truncate t3;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`))
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t3` (`a`))
truncate t2;
truncate t4;
truncate t1;
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t1` (`a`))
truncate t3;
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `test`.`t3` (`a`))
drop table t4,t3,t2,t1;
create table t1 (a varchar(255) character set utf8,
b varchar(255) character set utf8,
@@ -3177,3 +3178,4 @@ Variable_name Value
Handler_update 1
Variable_name Value
Handler_delete 1
+DROP TABLE bug58912;
diff --git a/mysql-test/suite/innodb/r/innodb_bug30423.result b/mysql-test/suite/innodb/r/innodb_bug30423.result
new file mode 100644
index 00000000000..d7b72b1ec2a
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug30423.result
@@ -0,0 +1,95 @@
+set global innodb_stats_method = default;
+select @@innodb_stats_method;
+@@innodb_stats_method
+nulls_equal
+select count(*) from bug30243_3 where org_id is not NULL;
+count(*)
+20
+select count(*) from bug30243_3 where org_id is NULL;
+count(*)
+16384
+select count(*) from bug30243_2 where org_id is not NULL;
+count(*)
+224
+select count(*) from bug30243_2 where org_id is NULL;
+count(*)
+65536
+select @@innodb_stats_method;
+@@innodb_stats_method
+nulls_equal
+analyze table bug30243_1;
+Table Op Msg_type Msg_text
+test.bug30243_1 analyze status OK
+analyze table bug30243_2;
+Table Op Msg_type Msg_text
+test.bug30243_2 analyze status OK
+analyze table bug30243_3;
+Table Op Msg_type Msg_text
+test.bug30243_3 analyze status OK
+set global innodb_stats_method = "NULL";
+ERROR 42000: Variable 'innodb_stats_method' can't be set to the value of 'NULL'
+set global innodb_stats_method = "nulls_ignored";
+select @@innodb_stats_method;
+@@innodb_stats_method
+nulls_ignored
+analyze table bug30243_1;
+Table Op Msg_type Msg_text
+test.bug30243_1 analyze status OK
+analyze table bug30243_2;
+Table Op Msg_type Msg_text
+test.bug30243_2 analyze status OK
+analyze table bug30243_3;
+Table Op Msg_type Msg_text
+test.bug30243_3 analyze status OK
+explain SELECT COUNT(*), 0
+FROM bug30243_1 orgs
+LEFT JOIN bug30243_3 sa_opportunities
+ON orgs.org_id=sa_opportunities.org_id
+LEFT JOIN bug30243_2 contacts
+ON orgs.org_id=contacts.org_id ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE orgs index NULL org_id 4 NULL 128 Using index
+1 SIMPLE sa_opportunities ref org_id org_id 5 test.orgs.org_id 1 Using index
+1 SIMPLE contacts ref contacts$org_id contacts$org_id 5 test.orgs.org_id 1 Using index
+select @@innodb_stats_method;
+@@innodb_stats_method
+nulls_ignored
+set global innodb_stats_method = "nulls_unequal";
+select @@innodb_stats_method;
+@@innodb_stats_method
+nulls_unequal
+analyze table bug30243_1;
+Table Op Msg_type Msg_text
+test.bug30243_1 analyze status OK
+analyze table bug30243_2;
+Table Op Msg_type Msg_text
+test.bug30243_2 analyze status OK
+analyze table bug30243_3;
+Table Op Msg_type Msg_text
+test.bug30243_3 analyze status OK
+explain SELECT COUNT(*), 0
+FROM bug30243_1 orgs
+LEFT JOIN bug30243_3 sa_opportunities
+ON orgs.org_id=sa_opportunities.org_id
+LEFT JOIN bug30243_2 contacts
+ON orgs.org_id=contacts.org_id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE orgs index NULL org_id 4 NULL 128 Using index
+1 SIMPLE sa_opportunities ref org_id org_id 5 test.orgs.org_id 1 Using index
+1 SIMPLE contacts ref contacts$org_id contacts$org_id 5 test.orgs.org_id 1 Using index
+SELECT COUNT(*) FROM table_bug30423 WHERE org_id IS NULL;
+COUNT(*)
+1024
+set global innodb_stats_method = "nulls_unequal";
+analyze table table_bug30423;
+Table Op Msg_type Msg_text
+test.table_bug30423 analyze status OK
+set global innodb_stats_method = "nulls_ignored";
+analyze table table_bug30423;
+Table Op Msg_type Msg_text
+test.table_bug30423 analyze status OK
+set global innodb_stats_method = nulls_equal;
+drop table bug30243_2;
+drop table bug30243_1;
+drop table bug30243_3;
+drop table table_bug30423;
diff --git a/mysql-test/suite/innodb/r/innodb_bug52745.result b/mysql-test/suite/innodb/r/innodb_bug52745.result
index 16dd356997e..d746fb427b5 100644
--- a/mysql-test/suite/innodb/r/innodb_bug52745.result
+++ b/mysql-test/suite/innodb/r/innodb_bug52745.result
@@ -125,6 +125,6 @@ Warning 1264 Out of range value for column 'col78' at row 1
Warning 1265 Data truncated for column 'col79' at row 1
Warning 1264 Out of range value for column 'col84' at row 1
DROP TABLE bug52745;
-SET GLOBAL innodb_file_format=Barracuda;
+SET GLOBAL innodb_file_format=Antelope;
SET GLOBAL innodb_file_format_max=Antelope;
-SET GLOBAL innodb_file_per_table=1;
+SET GLOBAL innodb_file_per_table=0;
diff --git a/mysql-test/suite/innodb/r/innodb_bug53046.result b/mysql-test/suite/innodb/r/innodb_bug53046.result
new file mode 100644
index 00000000000..69be6c4e0a7
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug53046.result
@@ -0,0 +1,27 @@
+CREATE TABLE bug53046_1 (c1 INT PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE bug53046_2 (c2 INT PRIMARY KEY,
+FOREIGN KEY (c2) REFERENCES bug53046_1(c1)
+ON UPDATE CASCADE ON DELETE CASCADE) ENGINE=INNODB;
+INSERT INTO bug53046_1 VALUES (1);
+INSERT INTO bug53046_1 SELECT c1+(SELECT MAX(c1) FROM bug53046_1)
+FROM bug53046_1;
+INSERT INTO bug53046_1 SELECT c1+(SELECT MAX(c1) FROM bug53046_1)
+FROM bug53046_1;
+INSERT INTO bug53046_1 SELECT c1+(SELECT MAX(c1) FROM bug53046_1)
+FROM bug53046_1;
+INSERT INTO bug53046_1 SELECT c1+(SELECT MAX(c1) FROM bug53046_1)
+FROM bug53046_1;
+INSERT INTO bug53046_1 SELECT c1+(SELECT MAX(c1) FROM bug53046_1)
+FROM bug53046_1;
+INSERT INTO bug53046_2 VALUES (1), (2);
+ANALYZE TABLE bug53046_1;
+Table Op Msg_type Msg_text
+test.bug53046_1 analyze status OK
+SHOW TABLE STATUS LIKE 'bug53046_1';
+UPDATE bug53046_1 SET c1 = c1 - 1;
+DELETE FROM bug53046_1;
+INSERT INTO bug53046_1 VALUES (1);
+INSERT INTO bug53046_2 VALUES (1);
+TRUNCATE TABLE bug53046_2;
+DROP TABLE bug53046_2;
+DROP TABLE bug53046_1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug53591.result b/mysql-test/suite/innodb/r/innodb_bug53591.result
index 8573fb60718..d3f8dfeafc2 100644
--- a/mysql-test/suite/innodb/r/innodb_bug53591.result
+++ b/mysql-test/suite/innodb/r/innodb_bug53591.result
@@ -11,6 +11,6 @@ Error 139 Too big row
Error 1118 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
Error 1030 Got error 139 from storage engine
DROP TABLE bug53591;
-SET GLOBAL innodb_file_format=Barracuda;
+SET GLOBAL innodb_file_format=Antelope;
SET GLOBAL innodb_file_format_max=Antelope;
-SET GLOBAL innodb_file_per_table=1;
+SET GLOBAL innodb_file_per_table=0;
diff --git a/mysql-test/suite/innodb/r/innodb_bug53756.result b/mysql-test/suite/innodb/r/innodb_bug53756.result
new file mode 100644
index 00000000000..37453be8201
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug53756.result
@@ -0,0 +1,118 @@
+DROP TABLE IF EXISTS bug_53756 ;
+CREATE TABLE bug_53756 (pk INT, c1 INT) ENGINE=InnoDB;
+ALTER TABLE bug_53756 ADD PRIMARY KEY (pk);
+INSERT INTO bug_53756 VALUES(1, 11), (2, 22), (3, 33), (4, 44);
+
+# Select a less restrictive isolation level.
+SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+COMMIT;
+
+# Start a transaction in the default connection for isolation.
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+SELECT * FROM bug_53756;
+pk c1
+1 11
+2 22
+3 33
+4 44
+
+# connection con1 deletes row 1
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+DELETE FROM bug_53756 WHERE pk=1;
+
+# connection con2 deletes row 2
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+DELETE FROM bug_53756 WHERE pk=2;
+
+# connection con3 updates row 3
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+UPDATE bug_53756 SET c1=77 WHERE pk=3;
+
+# connection con4 updates row 4
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+UPDATE bug_53756 SET c1=88 WHERE pk=4;
+
+# connection con5 inserts row 5
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+INSERT INTO bug_53756 VALUES(5, 55);
+
+# connection con6 inserts row 6
+START TRANSACTION;
+SELECT @@tx_isolation;
+@@tx_isolation
+READ-COMMITTED
+INSERT INTO bug_53756 VALUES(6, 66);
+
+# connection con1 commits.
+COMMIT;
+
+# connection con3 commits.
+COMMIT;
+
+# connection con4 rolls back.
+ROLLBACK;
+
+# connection con6 rolls back.
+ROLLBACK;
+
+# The connections 2 and 5 stay open.
+
+# connection default selects resulting data.
+# Delete of row 1 was committed.
+# Update of row 3 was committed.
+# Due to isolation level read committed, these should be included.
+# All other changes should not be included.
+SELECT * FROM bug_53756;
+pk c1
+2 22
+3 77
+4 44
+
+# connection default
+#
+# Crash server.
+START TRANSACTION;
+INSERT INTO bug_53756 VALUES (666,666);
+SET SESSION debug="+d,crash_commit_before";
+COMMIT;
+ERROR HY000: Lost connection to MySQL server during query
+
+#
+# disconnect con1, con2, con3, con4, con5, con6.
+#
+# Restart server.
+
+#
+# Select recovered data.
+# Delete of row 1 was committed.
+# Update of row 3 was committed.
+# These should be included.
+# All other changes should not be included.
+# Delete of row 2 and insert of row 5 should be rolled back
+SELECT * FROM bug_53756;
+pk c1
+2 22
+3 77
+4 44
+
+# Clean up.
+DROP TABLE bug_53756;
diff --git a/mysql-test/suite/innodb/r/innodb_bug54679.result b/mysql-test/suite/innodb/r/innodb_bug54679.result
deleted file mode 100644
index 9763c5c0dd3..00000000000
--- a/mysql-test/suite/innodb/r/innodb_bug54679.result
+++ /dev/null
@@ -1,88 +0,0 @@
-SET GLOBAL innodb_file_format='Barracuda';
-SET GLOBAL innodb_file_per_table=ON;
-SET innodb_strict_mode=ON;
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
-WHERE TABLE_NAME='bug54679';
-TABLE_NAME ROW_FORMAT CREATE_OPTIONS
-bug54679 Compressed row_format=COMPRESSED
-ALTER TABLE bug54679 ADD COLUMN b INT;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
-WHERE TABLE_NAME='bug54679';
-TABLE_NAME ROW_FORMAT CREATE_OPTIONS
-bug54679 Compressed row_format=COMPRESSED
-DROP TABLE bug54679;
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
-WHERE TABLE_NAME='bug54679';
-TABLE_NAME ROW_FORMAT CREATE_OPTIONS
-bug54679 Compact
-ALTER TABLE bug54679 KEY_BLOCK_SIZE=1;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
-WHERE TABLE_NAME='bug54679';
-TABLE_NAME ROW_FORMAT CREATE_OPTIONS
-bug54679 Compressed key_block_size=1
-ALTER TABLE bug54679 ROW_FORMAT=REDUNDANT;
-ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
-Error 1005 Can't create table '#sql-temporary' (errno: 1478)
-DROP TABLE bug54679;
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
-WHERE TABLE_NAME='bug54679';
-TABLE_NAME ROW_FORMAT CREATE_OPTIONS
-bug54679 Redundant row_format=REDUNDANT
-ALTER TABLE bug54679 KEY_BLOCK_SIZE=2;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
-WHERE TABLE_NAME='bug54679';
-TABLE_NAME ROW_FORMAT CREATE_OPTIONS
-bug54679 Compressed row_format=REDUNDANT key_block_size=2
-SET GLOBAL innodb_file_format=Antelope;
-ALTER TABLE bug54679 KEY_BLOCK_SIZE=4;
-ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error 1005 Can't create table '#sql-temporary' (errno: 1478)
-ALTER TABLE bug54679 ROW_FORMAT=DYNAMIC;
-ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
-Error 1005 Can't create table '#sql-temporary' (errno: 1478)
-DROP TABLE bug54679;
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-ERROR HY000: Can't create table 'test.bug54679' (errno: 1478)
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
-Error 1005 Can't create table 'test.bug54679' (errno: 1478)
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB;
-SET GLOBAL innodb_file_format=Barracuda;
-SET GLOBAL innodb_file_per_table=OFF;
-ALTER TABLE bug54679 KEY_BLOCK_SIZE=4;
-ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Error 1005 Can't create table '#sql-temporary' (errno: 1478)
-ALTER TABLE bug54679 ROW_FORMAT=DYNAMIC;
-ERROR HY000: Can't create table '#sql-temporary' (errno: 1478)
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
-Error 1005 Can't create table '#sql-temporary' (errno: 1478)
-DROP TABLE bug54679;
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-ERROR HY000: Can't create table 'test.bug54679' (errno: 1478)
-SHOW WARNINGS;
-Level Code Message
-Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
-Error 1005 Can't create table 'test.bug54679' (errno: 1478)
-SET GLOBAL innodb_file_per_table=ON;
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-DROP TABLE bug54679;
diff --git a/mysql-test/suite/innodb/r/innodb_bug56143.result b/mysql-test/suite/innodb/r/innodb_bug56143.result
new file mode 100644
index 00000000000..1efec7e8887
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug56143.result
@@ -0,0 +1,556 @@
+SHOW CREATE TABLE bug56143_2;
+Table Create Table
+bug56143_2 CREATE TABLE `bug56143_2` (
+ `a` int(11) DEFAULT NULL,
+ KEY `a` (`a`),
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa10` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa100` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa101` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa102` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa103` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa104` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa105` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa106` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa107` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa108` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa109` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa11` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa110` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa111` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa112` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa113` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa114` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa115` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa116` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa117` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa118` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa119` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa120` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa121` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa122` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa123` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa124` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa125` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa126` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa127` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa128` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa129` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa13` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa130` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa131` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa132` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa133` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa134` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa135` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa136` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa137` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa138` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa139` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa14` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa140` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa141` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa142` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa143` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa144` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa145` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa146` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa147` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa148` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa149` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa15` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa150` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa151` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa152` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa153` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa154` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa155` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa156` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa157` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa158` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa159` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa16` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa160` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa161` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa162` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa163` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa164` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa165` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa166` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa167` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa168` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa169` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa17` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa170` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa171` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa172` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa173` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa174` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa175` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa176` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa177` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa178` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa179` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa18` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa180` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa181` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa182` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa183` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa184` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa185` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa186` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa187` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa188` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa189` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa19` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa190` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa191` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa192` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa193` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa194` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa195` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa196` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa197` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa198` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa199` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa20` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa200` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa201` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa202` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa203` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa204` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa205` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa206` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa207` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa208` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa209` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa21` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa210` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa211` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa212` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa213` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa214` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa215` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa216` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa217` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa218` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa219` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa22` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa220` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa221` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa222` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa223` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa224` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa225` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa226` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa227` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa228` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa229` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa23` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa230` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa231` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa232` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa233` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa234` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa235` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa236` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa237` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa238` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa239` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa24` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa240` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa241` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa242` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa243` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa244` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa245` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa246` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa247` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa248` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa249` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa25` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa250` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa251` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa252` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa253` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa254` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa255` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa256` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa257` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa258` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa259` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa26` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa260` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa261` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa262` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa263` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa264` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa265` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa266` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa267` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa268` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa269` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa27` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa270` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa271` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa272` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa273` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa274` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa275` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa276` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa277` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa278` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa279` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa28` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa280` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa281` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa282` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa283` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa284` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa285` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa286` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa287` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa288` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa289` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa29` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa290` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa291` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa292` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa293` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa294` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa295` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa296` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa297` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa298` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa299` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa30` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa300` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa301` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa302` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa303` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa304` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa305` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa306` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa307` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa308` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa309` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa31` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa310` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa311` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa312` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa313` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa314` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa315` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa316` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa317` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa318` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa319` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa32` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa320` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa321` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa322` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa323` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa324` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa325` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa326` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa327` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa328` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa329` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa33` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa330` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa331` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa332` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa333` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa334` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa335` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa336` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa337` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa338` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa339` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa34` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa340` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa341` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa342` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa343` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa344` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa345` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa346` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa347` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa348` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa349` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa35` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa350` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa351` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa352` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa353` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa354` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa355` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa356` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa357` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa358` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa359` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa36` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa360` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa361` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa362` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa363` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa364` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa365` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa366` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa367` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa368` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa369` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa37` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa370` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa371` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa372` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa373` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa374` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa375` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa376` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa377` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa378` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa379` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa38` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa380` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa381` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa382` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa383` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa384` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa385` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa386` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa387` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa388` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa389` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa39` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa390` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa391` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa392` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa393` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa394` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa395` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa396` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa397` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa398` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa399` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa40` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa400` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa401` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa402` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa403` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa404` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa405` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa406` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa407` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa408` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa409` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa41` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa410` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa411` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa412` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa413` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa414` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa415` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa416` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa417` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa418` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa419` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa42` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa420` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa421` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa422` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa423` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa424` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa425` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa426` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa427` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa428` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa429` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa43` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa430` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa431` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa432` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa433` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa434` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa435` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa436` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa437` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa438` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa439` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa44` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa440` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa441` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa442` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa443` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa444` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa445` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa446` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa447` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa448` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa449` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa45` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa450` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa451` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa452` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa453` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa454` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa455` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa456` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa457` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa458` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa459` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa46` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa460` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa461` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa462` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa463` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa464` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa465` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa466` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa467` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa468` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa469` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa47` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa470` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa471` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa472` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa473` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa474` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa475` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa476` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa477` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa478` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa479` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa48` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa480` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa481` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa482` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa483` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa484` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa485` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa486` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa487` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa488` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa489` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa49` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa490` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa491` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa492` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa493` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa494` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa495` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa496` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa497` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa498` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa499` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa50` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa500` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa501` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa502` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa503` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa504` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa505` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa506` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa507` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa508` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa509` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa51` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa510` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa511` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa512` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa513` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa514` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa515` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa516` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa517` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa518` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa519` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa52` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa520` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa521` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa522` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa523` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa524` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa525` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa526` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa527` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa528` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa529` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa53` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa530` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa531` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa532` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa533` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa534` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa535` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa536` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa537` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa538` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa539` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa54` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa540` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa541` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa542` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa543` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa544` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa545` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa546` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa547` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa548` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa549` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa55` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa550` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa56` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa57` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa58` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa59` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa60` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa61` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa62` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa63` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa64` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa65` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa66` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa67` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa68` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa69` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa7` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa70` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa71` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa72` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa73` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa74` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa75` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa76` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa77` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa78` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa79` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa8` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa80` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa81` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa82` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa83` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa84` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa85` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa86` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa87` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa88` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa89` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa90` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa91` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa92` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa93` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa94` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa95` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa96` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa97` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa98` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa99` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
diff --git a/mysql-test/suite/innodb/r/innodb_bug56680.result b/mysql-test/suite/innodb/r/innodb_bug56680.result
new file mode 100644
index 00000000000..5e798b69167
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug56680.result
@@ -0,0 +1,109 @@
+SET GLOBAL tx_isolation='REPEATABLE-READ';
+SET GLOBAL innodb_file_format=Barracuda;
+SET GLOBAL innodb_file_per_table=on;
+CREATE TABLE bug56680(
+a INT AUTO_INCREMENT PRIMARY KEY,
+b CHAR(1),
+c INT,
+INDEX(b))
+ENGINE=InnoDB;
+INSERT INTO bug56680 VALUES(0,'x',1);
+BEGIN;
+SELECT b FROM bug56680;
+b
+x
+BEGIN;
+UPDATE bug56680 SET b='X';
+SELECT b FROM bug56680;
+b
+x
+SELECT * FROM bug56680;
+a b c
+1 x 1
+ROLLBACK;
+SELECT b FROM bug56680;
+b
+x
+SET GLOBAL tx_isolation='READ-UNCOMMITTED';
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+BEGIN;
+SELECT b FROM bug56680 LIMIT 2;
+b
+x
+x
+BEGIN;
+DELETE FROM bug56680 WHERE a=1;
+INSERT INTO bug56680 VALUES(1,'X',1);
+SELECT b FROM bug56680 LIMIT 3;
+b
+X
+x
+x
+SELECT b FROM bug56680 LIMIT 2;
+b
+x
+x
+CHECK TABLE bug56680;
+Table Op Msg_type Msg_text
+test.bug56680 check status OK
+ROLLBACK;
+SELECT b FROM bug56680 LIMIT 2;
+b
+x
+x
+CHECK TABLE bug56680;
+Table Op Msg_type Msg_text
+test.bug56680 check status OK
+SELECT b FROM bug56680 LIMIT 2;
+b
+x
+x
+CREATE TABLE bug56680_2(
+a INT AUTO_INCREMENT PRIMARY KEY,
+b VARCHAR(2) CHARSET latin1 COLLATE latin1_german2_ci,
+c INT,
+INDEX(b))
+ENGINE=InnoDB;
+INSERT INTO bug56680_2 SELECT 0,_latin1 0xdf,c FROM bug56680;
+BEGIN;
+SELECT HEX(b) FROM bug56680_2 LIMIT 2;
+HEX(b)
+DF
+DF
+DELETE FROM bug56680_2 WHERE a=1;
+INSERT INTO bug56680_2 VALUES(1,'SS',1);
+SELECT HEX(b) FROM bug56680_2 LIMIT 3;
+HEX(b)
+5353
+DF
+DF
+CHECK TABLE bug56680_2;
+Table Op Msg_type Msg_text
+test.bug56680_2 check status OK
+ALTER TABLE bug56680_2 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+SELECT HEX(b) FROM bug56680_2 LIMIT 2;
+HEX(b)
+5353
+DF
+DELETE FROM bug56680_2 WHERE a=1;
+INSERT INTO bug56680_2 VALUES(1,_latin1 0xdf,1);
+SELECT HEX(b) FROM bug56680_2 LIMIT 3;
+HEX(b)
+DF
+DF
+DF
+CHECK TABLE bug56680_2;
+Table Op Msg_type Msg_text
+test.bug56680_2 check status OK
+DROP TABLE bug56680_2;
+DROP TABLE bug56680;
diff --git a/mysql-test/suite/innodb/r/innodb_bug56716.result b/mysql-test/suite/innodb/r/innodb_bug56716.result
deleted file mode 100644
index 50d83e8d87a..00000000000
--- a/mysql-test/suite/innodb/r/innodb_bug56716.result
+++ /dev/null
@@ -1,4 +0,0 @@
-CREATE TABLE bug56716 (a INT PRIMARY KEY,b INT,c INT,INDEX(b)) ENGINE=InnoDB;
-SELECT * FROM bug56716 WHERE b<=42 ORDER BY b DESC FOR UPDATE;
-a b c
-DROP TABLE bug56716;
diff --git a/mysql-test/suite/innodb/r/innodb_bug56947.result b/mysql-test/suite/innodb/r/innodb_bug56947.result
new file mode 100644
index 00000000000..b279069d834
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug56947.result
@@ -0,0 +1,8 @@
+SET @old_innodb_file_per_table=@@innodb_file_per_table;
+SET GLOBAL innodb_file_per_table=0;
+create table bug56947(a int not null) engine = innodb;
+CREATE TABLE `bug56947#1`(a int) ENGINE=InnoDB;
+alter table bug56947 add unique index (a);
+ERROR HY000: Table 'test.bug56947#1' already exists
+drop table `bug56947#1`;
+drop table bug56947;
diff --git a/mysql-test/suite/innodb/r/innodb_bug57252.result b/mysql-test/suite/innodb/r/innodb_bug57252.result
new file mode 100644
index 00000000000..efa50c742e0
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug57252.result
@@ -0,0 +1,6 @@
+cardinality
+10
+Table Op Msg_type Msg_text
+test.bug57252 analyze status OK
+cardinality
+10
diff --git a/mysql-test/suite/innodb/r/innodb_bug57904.result b/mysql-test/suite/innodb/r/innodb_bug57904.result
new file mode 100644
index 00000000000..d265adc385f
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug57904.result
@@ -0,0 +1,41 @@
+CREATE TABLE product (category INT NOT NULL, id INT NOT NULL,
+price DECIMAL, PRIMARY KEY(category, id)) ENGINE=INNODB;
+CREATE TABLE customer (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT,
+product_category INT NOT NULL,
+product_id INT NOT NULL,
+customer_id INT NOT NULL,
+PRIMARY KEY(no),
+INDEX (product_category, product_id),
+FOREIGN KEY (product_category, product_id)
+REFERENCES product(category, id) ON UPDATE CASCADE ON DELETE RESTRICT,
+INDEX (customer_id),
+FOREIGN KEY (customer_id)
+REFERENCES customer(id)
+) ENGINE=INNODB;
+SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
+CONSTRAINT_CATALOG def
+CONSTRAINT_SCHEMA test
+CONSTRAINT_NAME product_order_ibfk_1
+UNIQUE_CONSTRAINT_CATALOG def
+UNIQUE_CONSTRAINT_SCHEMA test
+UNIQUE_CONSTRAINT_NAME PRIMARY
+MATCH_OPTION NONE
+UPDATE_RULE CASCADE
+DELETE_RULE RESTRICT
+TABLE_NAME product_order
+REFERENCED_TABLE_NAME product
+CONSTRAINT_CATALOG def
+CONSTRAINT_SCHEMA test
+CONSTRAINT_NAME product_order_ibfk_2
+UNIQUE_CONSTRAINT_CATALOG def
+UNIQUE_CONSTRAINT_SCHEMA test
+UNIQUE_CONSTRAINT_NAME PRIMARY
+MATCH_OPTION NONE
+UPDATE_RULE RESTRICT
+DELETE_RULE RESTRICT
+TABLE_NAME product_order
+REFERENCED_TABLE_NAME customer
+DROP TABLE product_order;
+DROP TABLE product;
+DROP TABLE customer;
diff --git a/mysql-test/suite/innodb/r/innodb_bug59307.result b/mysql-test/suite/innodb/r/innodb_bug59307.result
new file mode 100644
index 00000000000..0d726e83708
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug59307.result
@@ -0,0 +1,28 @@
+CREATE TABLE t1 (
+t1_int INT,
+t1_time TIME
+) ENGINE=innodb;
+CREATE TABLE t2 (
+t2_int int PRIMARY KEY,
+t2_int2 INT
+) ENGINE=INNODB;
+INSERT INTO t2 VALUES ();
+Warnings:
+Warning 1364 Field 't2_int' doesn't have a default value
+INSERT INTO t1 VALUES ();
+SELECT *
+FROM t1 AS t1a
+WHERE NOT EXISTS
+(SELECT *
+FROM t1 AS t1b
+WHERE t1b.t1_int NOT IN
+(SELECT t2.t2_int
+FROM t2
+WHERE t1b.t1_time LIKE t1b.t1_int
+OR t1b.t1_time <> t2.t2_int2
+AND 6=7
+)
+)
+;
+t1_int t1_time
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/innodb/r/innodb_bug59410.result b/mysql-test/suite/innodb/r/innodb_bug59410.result
new file mode 100644
index 00000000000..494d601ba4f
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug59410.result
@@ -0,0 +1,17 @@
+create table `bug59410_1`(`a` int)engine=innodb;
+insert into `bug59410_1` values (1),(2),(3);
+select 1 from `bug59410_1` where `a` <> any (
+select 1 from `bug59410_1` where `a` <> 1 for update)
+for update;
+1
+1
+1
+drop table bug59410_1;
+create table bug59410_2(`a` char(1),`b` int)engine=innodb;
+insert into bug59410_2 values('0',0);
+set transaction isolation level read uncommitted;
+start transaction;
+set @a=(select b from bug59410_2 where
+(select 1 from bug59410_2 where a group by @a=b)
+group by @a:=b);
+drop table bug59410_2;
diff --git a/mysql-test/suite/innodb/r/innodb_bug59641.result b/mysql-test/suite/innodb/r/innodb_bug59641.result
new file mode 100644
index 00000000000..361172aa82b
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug59641.result
@@ -0,0 +1,57 @@
+CREATE TABLE t(a INT PRIMARY KEY, b INT)ENGINE=InnoDB;
+INSERT INTO t VALUES(2,2),(4,4),(8,8),(16,16),(32,32);
+COMMIT;
+XA START '123';
+INSERT INTO t VALUES(1,1);
+XA END '123';
+XA PREPARE '123';
+XA START '456';
+INSERT INTO t VALUES(3,47),(5,67);
+UPDATE t SET b=2*b WHERE a BETWEEN 5 AND 8;
+XA END '456';
+XA PREPARE '456';
+XA START '789';
+UPDATE t SET b=4*a WHERE a=32;
+XA END '789';
+XA PREPARE '789';
+call mtr.add_suppression("Found 3 prepared XA transactions");
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t;
+a b
+1 1
+2 2
+3 47
+4 4
+5 134
+8 16
+16 16
+32 128
+COMMIT;
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t;
+a b
+1 1
+2 2
+3 47
+4 4
+5 134
+8 16
+16 16
+32 128
+COMMIT;
+XA RECOVER;
+formatID gtrid_length bqual_length data
+1 3 0 789
+1 3 0 456
+1 3 0 123
+XA ROLLBACK '123';
+XA ROLLBACK '456';
+XA COMMIT '789';
+SELECT * FROM t;
+a b
+2 2
+4 4
+8 8
+16 16
+32 128
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb/r/innodb_bug60049.result b/mysql-test/suite/innodb/r/innodb_bug60049.result
new file mode 100644
index 00000000000..bec0e05a897
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug60049.result
@@ -0,0 +1,8 @@
+CREATE TABLE t(a INT)ENGINE=InnoDB;
+RENAME TABLE t TO u;
+DROP TABLE u;
+SELECT @@innodb_fast_shutdown;
+@@innodb_fast_shutdown
+0
+Last record of ID_IND root page (9):
+1808000018050074000000000000000c5359535f464f524549474e5f434f4c53
diff --git a/mysql-test/suite/innodb/r/innodb_bug60196.result b/mysql-test/suite/innodb/r/innodb_bug60196.result
new file mode 100755
index 00000000000..411950b49dd
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug60196.result
@@ -0,0 +1,117 @@
+CREATE TABLE Bug_60196_FK1 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE Bug_60196_FK2 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE Bug_60196 (
+FK1_Key INT NOT NULL,
+FK2_Key INT NOT NULL,
+PRIMARY KEY (FK2_Key, FK1_Key),
+KEY FK1_Key (FK1_Key),
+KEY FK2_Key (FK2_Key),
+CONSTRAINT FK_FK1 FOREIGN KEY (FK1_Key)
+REFERENCES Bug_60196_FK1 (Primary_Key)
+ON DELETE CASCADE
+ON UPDATE CASCADE,
+CONSTRAINT FK_FK2 FOREIGN KEY (FK2_Key)
+REFERENCES Bug_60196_FK2 (Primary_Key)
+ON DELETE CASCADE
+ON UPDATE CASCADE
+) ENGINE=InnoDB;
+INSERT INTO Bug_60196_FK1 VALUES (1), (2), (3), (4), (5);
+INSERT INTO Bug_60196_FK2 VALUES (1), (2), (3), (4), (5);
+INSERT INTO Bug_60196 VALUES (1, 1);
+INSERT INTO Bug_60196 VALUES (1, 2);
+INSERT INTO Bug_60196 VALUES (1, 3);
+INSERT INTO Bug_60196 VALUES (1, 99);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`bug_60196`, CONSTRAINT `FK_FK2` FOREIGN KEY (`FK2_Key`) REFERENCES `Bug_60196_FK2` (`Primary_Key`) ON DELETE CASCADE ON UPDATE CASCADE)
+INSERT INTO Bug_60196 VALUES (99, 1);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`bug_60196`, CONSTRAINT `FK_FK1` FOREIGN KEY (`FK1_Key`) REFERENCES `Bug_60196_FK1` (`Primary_Key`) ON DELETE CASCADE ON UPDATE CASCADE)
+SELECT * FROM bug_60196_FK1;
+Primary_Key
+1
+2
+3
+4
+5
+SELECT * FROM bug_60196_FK2;
+Primary_Key
+1
+2
+3
+4
+5
+SELECT * FROM bug_60196;
+FK1_Key FK2_Key
+1 1
+1 2
+1 3
+# Stop server
+# Restart server.
+#
+# Try to insert more to the example table with foreign keys.
+# Bug60196 causes the foreign key file not to be found after
+# the resstart above.
+#
+SELECT * FROM Bug_60196;
+FK1_Key FK2_Key
+1 1
+1 2
+1 3
+INSERT INTO Bug_60196 VALUES (2, 1);
+INSERT INTO Bug_60196 VALUES (2, 2);
+INSERT INTO Bug_60196 VALUES (2, 3);
+SELECT * FROM Bug_60196;
+FK1_Key FK2_Key
+1 1
+1 2
+1 3
+2 1
+2 2
+2 3
+
+# Clean up.
+DROP TABLE Bug_60196;
+DROP TABLE Bug_60196_FK1;
+DROP TABLE Bug_60196_FK2;
+CREATE TABLE Bug_60309_FK (
+ID INT PRIMARY KEY,
+ID2 INT,
+KEY K2(ID2)
+) ENGINE=InnoDB;
+CREATE TABLE Bug_60309 (
+ID INT PRIMARY KEY,
+FK_ID INT,
+KEY (FK_ID),
+CONSTRAINT FK FOREIGN KEY (FK_ID) REFERENCES Bug_60309_FK (ID)
+) ENGINE=InnoDB;
+INSERT INTO Bug_60309_FK (ID, ID2) VALUES (1, 1), (2, 2), (3, 3);
+INSERT INTO Bug_60309 VALUES (1, 1);
+INSERT INTO Bug_60309 VALUES (2, 99);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`bug_60309`, CONSTRAINT `FK` FOREIGN KEY (`FK_ID`) REFERENCES `Bug_60309_FK` (`ID`))
+SELECT * FROM Bug_60309_FK;
+ID ID2
+1 1
+2 2
+3 3
+SELECT * FROM Bug_60309;
+ID FK_ID
+1 1
+# Stop server
+# Restart server.
+#
+# Try to insert more to the example table with foreign keys.
+# Bug60309 causes the foreign key file not to be found after
+# the resstart above.
+#
+SELECT * FROM Bug_60309;
+ID FK_ID
+1 1
+INSERT INTO Bug_60309 VALUES (2, 2);
+INSERT INTO Bug_60309 VALUES (3, 3);
+SELECT * FROM Bug_60309;
+ID FK_ID
+1 1
+2 2
+3 3
+
+# Clean up.
+DROP TABLE Bug_60309;
+DROP TABLE Bug_60309_FK;
diff --git a/mysql-test/suite/innodb/r/innodb_file_format.result b/mysql-test/suite/innodb/r/innodb_file_format.result
index 447e13f0d60..70cfc9e4f47 100644
--- a/mysql-test/suite/innodb/r/innodb_file_format.result
+++ b/mysql-test/suite/innodb/r/innodb_file_format.result
@@ -1,6 +1,6 @@
select @@innodb_file_format;
@@innodb_file_format
-Barracuda
+Antelope
select @@innodb_file_format_check;
@@innodb_file_format_check
1
@@ -17,14 +17,14 @@ Barracuda
set global innodb_file_format=default;
select @@innodb_file_format;
@@innodb_file_format
-Barracuda
+Antelope
set global innodb_file_format=on;
ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'ON'
set global innodb_file_format=off;
ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'off'
select @@innodb_file_format;
@@innodb_file_format
-Barracuda
+Antelope
set global innodb_file_format_max=antelope;
set global innodb_file_format_max=barracuda;
set global innodb_file_format_max=cheetah;
@@ -46,5 +46,5 @@ Antelope
set global innodb_file_format_max=antelope;
set global innodb_file_format_check=off;
ERROR HY000: Variable 'innodb_file_format_check' is a read only variable
-SET GLOBAL innodb_file_format=Barracuda;
+SET GLOBAL innodb_file_format=Antelope;
SET GLOBAL innodb_file_format_max=Antelope;
diff --git a/mysql-test/suite/innodb/r/innodb_gis.result b/mysql-test/suite/innodb/r/innodb_gis.result
index 5712d08c9fa..9d015d91c0d 100644
--- a/mysql-test/suite/innodb/r/innodb_gis.result
+++ b/mysql-test/suite/innodb/r/innodb_gis.result
@@ -585,5 +585,17 @@ COUNT(*)
2
DROP TABLE t1, t2;
End of 5.0 tests
+#
+# Test for bug #58650 "Failing assertion: primary_key_no == -1 ||
+# primary_key_no == 0".
+#
+drop table if exists t1;
+# The minimal test case.
+create table t1 (a int not null, b linestring not null, unique key b (b(12)), unique key a (a));
+drop table t1;
+# The original test case.
+create table t1 (a int not null, b linestring not null, unique key b (b(12)));
+create unique index a on t1(a);
+drop table t1;
create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
ERROR HY000: The used table type doesn't support SPATIAL indexes
diff --git a/mysql-test/suite/innodb/r/innodb_index_large_prefix.result b/mysql-test/suite/innodb/r/innodb_index_large_prefix.result
new file mode 100644
index 00000000000..6e2d3527ee9
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_index_large_prefix.result
@@ -0,0 +1,185 @@
+set global innodb_file_format="Barracuda";
+set global innodb_file_per_table=1;
+set global innodb_large_prefix=1;
+create table worklog5743(a TEXT not null, primary key (a(1000)))
+ROW_FORMAT=DYNAMIC, engine = innodb;
+insert into worklog5743 values(repeat("a", 20000));
+update worklog5743 set a = (repeat("b", 16000));
+create index idx on worklog5743(a(2000));
+begin;
+update worklog5743 set a = (repeat("x", 17000));
+select @@session.tx_isolation;
+@@session.tx_isolation
+REPEATABLE-READ
+select a = repeat("x", 17000) from worklog5743;
+a = repeat("x", 17000)
+0
+select a = repeat("b", 16000) from worklog5743;
+a = repeat("b", 16000)
+1
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+@@session.tx_isolation
+READ-UNCOMMITTED
+select a = repeat("x", 17000) from worklog5743;
+a = repeat("x", 17000)
+1
+rollback;
+drop table worklog5743;
+create table worklog5743(a1 int, a2 TEXT not null)
+ROW_FORMAT=DYNAMIC, engine = innodb;
+create index idx on worklog5743(a1, a2(2000));
+insert into worklog5743 values(9, repeat("a", 10000));
+begin;
+update worklog5743 set a1 = 1000;
+select @@session.tx_isolation;
+@@session.tx_isolation
+REPEATABLE-READ
+explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE worklog5743 ref idx idx 5 const 1 Using where
+select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
+a1 a2 = repeat("a", 10000)
+9 1
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+@@session.tx_isolation
+READ-UNCOMMITTED
+select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
+a1 a2 = repeat("a", 10000)
+rollback;
+drop table worklog5743;
+create table worklog5743(a1 int, a2 TEXT not null)
+ROW_FORMAT=DYNAMIC, engine = innodb;
+create index idx on worklog5743(a1, a2(50));
+insert into worklog5743 values(9, repeat("a", 10000));
+begin;
+update worklog5743 set a1 = 1000;
+select @@session.tx_isolation;
+@@session.tx_isolation
+REPEATABLE-READ
+explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE worklog5743 ref idx idx 5 const 1 Using where
+select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
+a1 a2 = repeat("a", 10000)
+9 1
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+@@session.tx_isolation
+READ-UNCOMMITTED
+select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
+a1 a2 = repeat("a", 10000)
+rollback;
+drop table worklog5743;
+create table worklog5743_2(a1 int, a2 TEXT not null)
+ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
+create table worklog5743_4(a1 int, a2 TEXT not null)
+ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb;
+create index idx1 on worklog5743_2(a1, a2(942));
+ERROR HY000: Too big row
+create index idx1 on worklog5743_2(a1, a2(940));
+create index idx1 on worklog5743_4(a1, a2(1966));
+ERROR HY000: Too big row
+create index idx1 on worklog5743_4(a1, a2(1964));
+insert into worklog5743_2 values(9, repeat("a", 10000));
+insert into worklog5743_4 values(9, repeat("a", 10000));
+begin;
+update worklog5743_2 set a1 = 1000;
+update worklog5743_4 set a1 = 1000;
+select @@session.tx_isolation;
+@@session.tx_isolation
+REPEATABLE-READ
+explain select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE worklog5743_2 ref idx1 idx1 5 const 1 Using where
+select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
+a1 a2 = repeat("a", 10000)
+9 1
+select a1, a2 = repeat("a", 10000) from worklog5743_4 where a1 = 9;
+a1 a2 = repeat("a", 10000)
+9 1
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+@@session.tx_isolation
+READ-UNCOMMITTED
+select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
+a1 a2 = repeat("a", 10000)
+select a1, a2 = repeat("a", 10000) from worklog5743_4 where a1 = 9;
+a1 a2 = repeat("a", 10000)
+rollback;
+drop table worklog5743_2;
+drop table worklog5743_4;
+create table worklog5743(a1 int, a2 varchar(3000))
+ROW_FORMAT=DYNAMIC, engine = innodb;
+create index idx on worklog5743(a1, a2);
+insert into worklog5743 values(9, repeat("a", 3000));
+begin;
+update worklog5743 set a1 = 1000;
+select @@session.tx_isolation;
+@@session.tx_isolation
+REPEATABLE-READ
+explain select a1 from worklog5743 where a1 = 9;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE worklog5743 ref idx idx 5 const 1 Using where; Using index
+select a1 from worklog5743 where a1 = 9;
+a1
+9
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+@@session.tx_isolation
+READ-UNCOMMITTED
+select a1 from worklog5743 where a1 = 9;
+a1
+rollback;
+drop table worklog5743;
+create table worklog5743(a TEXT not null, primary key (a(1000)))
+engine = innodb;
+ERROR HY000: Index column size too large. The maximum column size is 767 bytes.
+create table worklog5743(a TEXT) engine = innodb;
+create index idx on worklog5743(a(1000));
+ERROR HY000: Index column size too large. The maximum column size is 767 bytes.
+create index idx on worklog5743(a(725));
+insert into worklog5743 values(repeat("a", 20000));
+begin;
+insert into worklog5743 values(repeat("b", 20000));
+update worklog5743 set a = (repeat("x", 25000));
+select @@session.tx_isolation;
+@@session.tx_isolation
+REPEATABLE-READ
+select a = repeat("a", 20000) from worklog5743;
+a = repeat("a", 20000)
+1
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+@@session.tx_isolation
+READ-UNCOMMITTED
+select a = repeat("x", 25000) from worklog5743;
+a = repeat("x", 25000)
+1
+1
+rollback;
+drop table worklog5743;
+create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC, engine = innodb;
+create index idx on worklog5743(a(3073));
+Warnings:
+Warning 1071 Specified key was too long; max key length is 3072 bytes
+Warning 1071 Specified key was too long; max key length is 3072 bytes
+create index idx2 on worklog5743(a(3072));
+show create table worklog5743;
+Table Create Table
+worklog5743 CREATE TABLE `worklog5743` (
+ `a` text NOT NULL,
+ KEY `idx` (`a`(3072)),
+ KEY `idx2` (`a`(3072))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
+drop table worklog5743;
+create table worklog5743(a TEXT not null) engine = innodb;
+create index idx on worklog5743(a(768));
+ERROR HY000: Index column size too large. The maximum column size is 767 bytes.
+create index idx2 on worklog5743(a(767));
+drop table worklog5743;
+SET GLOBAL innodb_file_format=Antelope;
+SET GLOBAL innodb_file_per_table=0;
+SET GLOBAL innodb_file_format_max=Antelope;
+SET GLOBAL innodb_large_prefix=0;
diff --git a/mysql-test/suite/innodb/r/innodb_multi_update.result b/mysql-test/suite/innodb/r/innodb_multi_update.result
index 7af9b030d1f..558fc3938a8 100644
--- a/mysql-test/suite/innodb/r/innodb_multi_update.result
+++ b/mysql-test/suite/innodb/r/innodb_multi_update.result
@@ -74,3 +74,11 @@ a b
4 14
5 15
drop table bug38999_1,bug38999_2;
+#
+# Bug#54475 improper error handling causes cascading crashing failures in innodb/ndb
+#
+CREATE TABLE t1(f1 INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+UPDATE (SELECT ((SELECT 1 FROM t1), 1) FROM t1 WHERE (SELECT 1 FROM t1)) x, (SELECT 1) AS d SET d.f1 = 1;
+ERROR 21000: Operand should contain 1 column(s)
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result
index 2b4c25dab0d..5b1c0a8b611 100644
--- a/mysql-test/suite/innodb/r/innodb_mysql.result
+++ b/mysql-test/suite/innodb/r/innodb_mysql.result
@@ -1944,7 +1944,7 @@ INSERT INTO t2 VALUES (3,2);
SET AUTOCOMMIT = 0;
START TRANSACTION;
TRUNCATE TABLE t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`))
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `test`.`t1` (`id`))
SELECT * FROM t1;
id
1
@@ -1956,7 +1956,7 @@ id
2
START TRANSACTION;
TRUNCATE TABLE t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`))
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `test`.`t1` (`id`))
SELECT * FROM t1;
id
1
@@ -1974,7 +1974,7 @@ id
2
COMMIT;
TRUNCATE TABLE t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`))
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `test`.`t1` (`id`))
SELECT * FROM t1;
id
1
@@ -1986,9 +1986,12 @@ id
1
2
TRUNCATE TABLE t1;
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `test`.`t1` (`id`))
ROLLBACK;
SELECT * FROM t1;
id
+1
+2
TRUNCATE TABLE t2;
DROP TABLE t2;
DROP TABLE t1;
@@ -2080,9 +2083,9 @@ i i
** error handling inside a row iteration.
**
DROP TRIGGER trg;
-TRUNCATE TABLE t1;
-TRUNCATE TABLE t2;
-TRUNCATE TABLE t3;
+DELETE FROM t1;
+DELETE FROM t2;
+DELETE FROM t3;
INSERT INTO t1 VALUES (1),(2),(3),(4);
INSERT INTO t3 VALUES (1),(2),(3),(4);
INSERT INTO t4 VALUES (3,3),(4,4);
@@ -2108,9 +2111,9 @@ DROP TRIGGER trg;
**
** Induce an error midway through an AFTER-trigger
**
-TRUNCATE TABLE t4;
-TRUNCATE TABLE t1;
-TRUNCATE TABLE t3;
+DELETE FROM t4;
+DELETE FROM t1;
+DELETE FROM t3;
INSERT INTO t1 VALUES (1),(2),(3),(4);
INSERT INTO t3 VALUES (1),(2),(3),(4);
CREATE TRIGGER trg AFTER DELETE ON t1 FOR EACH ROW
@@ -2653,6 +2656,60 @@ Extra Using index
DROP TABLE t1;
End of 5.1 tests
#
+#
+# Bug#55826: create table .. select crashes with when KILL_BAD_DATA
+# is returned
+#
+CREATE TABLE t1(a INT) ENGINE=innodb;
+INSERT INTO t1 VALUES (0);
+SET SQL_MODE='STRICT_ALL_TABLES';
+CREATE TABLE t2
+SELECT LEAST((SELECT '' FROM t1),NOW()) FROM `t1`;
+ERROR 22007: Incorrect datetime value: '' for column 'NOW()' at row 2
+DROP TABLE t1;
+SET SQL_MODE=DEFAULT;
+#
+# Bug#56862 Execution of a query that uses index merge returns a wrong result
+#
+CREATE TABLE t1 (
+pk int NOT NULL AUTO_INCREMENT PRIMARY KEY,
+a int,
+b int,
+INDEX idx(a))
+ENGINE=INNODB;
+INSERT INTO t1(a,b) VALUES
+(11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
+(3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
+(6, 600), (18, 1800), (9, 900), (10, 1000), (7, 700),
+(13, 1300), (15, 1500), (19, 1900), (16, 1600), (20, 2000);
+INSERT INTO t1(a,b) SELECT a+20, b+2000 FROM t1;
+INSERT INTO t1(a,b) SELECT a+40, b+4000 FROM t1;
+INSERT INTO t1(a,b) SELECT a+80, b+8000 FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1 VALUES (1000000, 0, 0);
+SET SESSION sort_buffer_size = 1024*36;
+EXPLAIN
+SELECT COUNT(*) FROM
+(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
+WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+2 DERIVED t1 index_merge PRIMARY,idx idx,PRIMARY 5,4 NULL 1536 Using sort_union(idx,PRIMARY); Using where
+SELECT COUNT(*) FROM
+(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
+WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
+COUNT(*)
+1537
+SET SESSION sort_buffer_size = DEFAULT;
+DROP TABLE t1;
+#
# Bug#668644: HAVING + ORDER BY
#
CREATE TABLE t1 (
@@ -2710,6 +2767,23 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t2, t1;
#
+# Test for bug #11762012 - "54553: INNODB ASSERTS IN HA_INNOBASE::
+# UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
+#
+DROP TABLE IF EXISTS t1;
+CREATE TEMPORARY TABLE t1 (c int) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1);
+LOCK TABLES t1 READ;
+# Even though temporary table was locked for READ we
+# still allow writes to it to be compatible with MyISAM.
+# This is possible since due to fact that temporary tables
+# are specific to connection and therefore locking for them
+# is irrelevant.
+UPDATE t1 SET c = 5;
+UNLOCK TABLES;
+DROP TEMPORARY TABLE t1;
+End of 5.1 tests
+#
# Bug#44613 SELECT statement inside FUNCTION takes a shared lock
#
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result b/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
new file mode 100644
index 00000000000..73d75241a10
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result
@@ -0,0 +1,1354 @@
+set global innodb_file_format="Barracuda";
+set global innodb_file_per_table=1;
+set global innodb_large_prefix=1;
+DROP TABLE IF EXISTS worklog5743;
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+SELECT COLUMN_NAME,INDEX_NAME,SUB_PART,INDEX_TYPE FROM
+INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'worklog5743' ;
+COLUMN_NAME INDEX_NAME SUB_PART INDEX_TYPE
+col_1_varchar PRIMARY 3072 BTREE
+col_1_varchar prefix_idx 3072 BTREE
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+col_1_varchar = REPEAT("c", 4000)
+1
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743;
+col_1_varchar = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_text TEXT (4000) , col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_text (3072));
+SELECT COLUMN_NAME,INDEX_NAME,SUB_PART,INDEX_TYPE FROM
+INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'worklog5743' ;
+COLUMN_NAME INDEX_NAME SUB_PART INDEX_TYPE
+col_1_text PRIMARY 3072 BTREE
+col_1_text prefix_idx 3072 BTREE
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("c", 4000)
+1
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743;
+col_1_text = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_mediumtext MEDIUMTEXT , col_2_mediumtext MEDIUMTEXT ,
+PRIMARY KEY (col_1_mediumtext(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_mediumtext (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_mediumtext = REPEAT("a", 4000),col_2_mediumtext = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_mediumtext = REPEAT("a", 4000) col_2_mediumtext = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_mediumtext = REPEAT("c", 4000)
+WHERE col_1_mediumtext = REPEAT("a", 4000)
+AND col_2_mediumtext = REPEAT("o", 4000);
+SELECT col_1_mediumtext = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_mediumtext = REPEAT("c", 4000)
+AND col_2_mediumtext = REPEAT("o", 4000);
+col_1_mediumtext = REPEAT("c", 4000)
+1
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_mediumtext = REPEAT("b", 4000);
+SELECT col_1_mediumtext = REPEAT("c", 4000) FROM worklog5743;
+col_1_mediumtext = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_longtext LONGTEXT , col_2_longtext LONGTEXT ,
+PRIMARY KEY (col_1_longtext(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_longtext (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_longtext = REPEAT("a", 4000) , col_2_longtext = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_longtext = REPEAT("a", 4000) col_2_longtext = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_longtext = REPEAT("c", 4000)
+WHERE col_1_longtext = REPEAT("a", 4000)
+AND col_2_longtext = REPEAT("o", 4000);
+SELECT col_1_longtext = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_longtext = REPEAT("c", 4000)
+AND col_2_longtext = REPEAT("o", 4000);
+col_1_longtext = REPEAT("c", 4000)
+1
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_longtext = REPEAT("b", 4000);
+SELECT col_1_longtext = REPEAT("c", 4000) FROM worklog5743;
+col_1_longtext = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_blob BLOB (4000) , col_2_blob BLOB (4000) ,
+PRIMARY KEY (col_1_blob(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_blob (3072));
+SELECT COLUMN_NAME,INDEX_NAME,SUB_PART,INDEX_TYPE FROM
+INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'worklog5743' ;
+COLUMN_NAME INDEX_NAME SUB_PART INDEX_TYPE
+col_1_blob PRIMARY 3072 BTREE
+col_1_blob prefix_idx 3072 BTREE
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_blob = REPEAT("a", 4000) , col_2_blob = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_blob = REPEAT("a", 4000) col_2_blob = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_blob = REPEAT("c", 4000)
+WHERE col_1_blob = REPEAT("a", 4000) AND col_2_blob = REPEAT("o", 4000);
+SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_blob = REPEAT("c", 4000) AND col_2_blob = REPEAT("o", 4000);
+col_1_blob = REPEAT("c", 4000)
+1
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_blob = REPEAT("b", 4000);
+SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743;
+col_1_blob = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_mediumblob MEDIUMBLOB , col_2_mediumblob MEDIUMBLOB ,
+PRIMARY KEY (col_1_mediumblob(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_mediumblob (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_mediumblob = REPEAT("a", 4000),col_2_mediumblob = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_mediumblob = REPEAT("a", 4000) col_2_mediumblob = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_mediumblob = REPEAT("c", 4000)
+WHERE col_1_mediumblob = REPEAT("a", 4000)
+AND col_2_mediumblob = REPEAT("o", 4000);
+SELECT col_1_mediumblob = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_mediumblob = REPEAT("c", 4000)
+AND col_2_mediumblob = REPEAT("o", 4000);
+col_1_mediumblob = REPEAT("c", 4000)
+1
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_mediumblob = REPEAT("b", 4000);
+SELECT col_1_mediumblob = REPEAT("c", 4000) FROM worklog5743;
+col_1_mediumblob = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_longblob LONGBLOB , col_2_longblob LONGBLOB ,
+PRIMARY KEY (col_1_longblob(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_longblob (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_longblob = REPEAT("a", 4000) , col_2_longblob = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_longblob = REPEAT("a", 4000) col_2_longblob = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_longblob = REPEAT("c", 4000)
+WHERE col_1_longblob = REPEAT("a", 4000)
+AND col_2_longblob = REPEAT("o", 4000);
+SELECT col_1_longblob = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_longblob = REPEAT("c", 4000)
+AND col_2_longblob = REPEAT("o", 4000);
+col_1_longblob = REPEAT("c", 4000)
+1
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_longblob = REPEAT("b", 4000);
+SELECT col_1_longblob = REPEAT("c", 4000) FROM worklog5743;
+col_1_longblob = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_varbinary VARBINARY (4000) , col_2_varbinary VARBINARY (4000) ,
+PRIMARY KEY (col_1_varbinary(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varbinary = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_varbinary = REPEAT("a", 4000) col_2_varbinary = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
+WHERE col_1_varbinary = REPEAT("a", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+col_1_varbinary = REPEAT("c", 4000)
+1
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("b", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743;
+col_1_varbinary = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (col_1_char CHAR (255) , col_2_char CHAR (255),
+col_3_char CHAR (255), col_4_char CHAR (255),col_5_char CHAR (255),
+col_6_char CHAR (255), col_7_char CHAR (255),col_8_char CHAR (255),
+col_9_char CHAR (255), col_10_char CHAR (255),col_11_char CHAR (255),
+col_12_char CHAR (255), col_13_char CHAR (255),col_14_char CHAR (255)
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 255) , REPEAT("o", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255)
+);
+CREATE INDEX prefix_idx ON worklog5743(col_1_char(250),col_2_char(250),
+col_3_char(250),col_4_char(250),col_5_char(250),col_6_char(250),
+col_7_char(250),col_8_char(250),col_9_char(250),col_10_char(250),
+col_11_char(250),col_12_char(250),col_13_char(72)
+);
+INSERT INTO worklog5743 VALUES(REPEAT("b", 255) , REPEAT("p", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255)
+);
+SELECT col_1_char = REPEAT("a", 255) , col_2_char = REPEAT("o", 255) FROM worklog5743;
+col_1_char = REPEAT("a", 255) col_2_char = REPEAT("o", 255)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_char = REPEAT("c", 255)
+WHERE col_1_char = REPEAT("a", 255) AND col_2_char = REPEAT("o", 255);
+SELECT col_1_char = REPEAT("c", 255) FROM worklog5743
+WHERE col_1_char = REPEAT("c", 255) AND col_2_char = REPEAT("o", 255);
+col_1_char = REPEAT("c", 255)
+1
+INSERT INTO worklog5743 VALUES(REPEAT("a", 255) , REPEAT("o", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255)
+);
+DELETE FROM worklog5743 WHERE col_1_char = REPEAT("b", 255);
+SELECT col_1_char = REPEAT("c", 255) FROM worklog5743;
+col_1_char = REPEAT("c", 255)
+1
+0
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (col_1_binary BINARY (255) , col_2_binary BINARY (255),
+col_3_binary BINARY(255),col_4_binary BINARY (255),col_5_binary BINARY (255),
+col_6_binary BINARY(255),col_7_binary BINARY (255),col_8_binary BINARY (255),
+col_9_binary BINARY(255),col_10_binary BINARY (255),col_11_binary BINARY (255),
+col_12_binary BINARY(255),col_13_binary BINARY (255),col_14_binary BINARY (255)
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 255) , REPEAT("o", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255)
+);
+CREATE INDEX prefix_idx ON worklog5743(col_1_binary (250),col_2_binary (250),
+col_3_binary (250),col_4_binary (250),col_5_binary (250),
+col_6_binary (250),col_7_binary (250),col_8_binary (250),
+col_9_binary (250),col_10_binary (250),col_11_binary (250),
+col_12_binary (250),col_13_binary (72)
+);
+INSERT INTO worklog5743 VALUES(REPEAT("b", 255) , REPEAT("p", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255)
+);
+SELECT col_1_binary = REPEAT("a", 255) , col_2_binary = REPEAT("o", 255) FROM worklog5743;
+col_1_binary = REPEAT("a", 255) col_2_binary = REPEAT("o", 255)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_binary = REPEAT("c", 255)
+WHERE col_1_binary = REPEAT("a", 255)
+AND col_2_binary = REPEAT("o", 255);
+SELECT col_1_binary = REPEAT("c", 255) FROM worklog5743
+WHERE col_1_binary = REPEAT("c", 255)
+AND col_2_binary = REPEAT("o", 255);
+col_1_binary = REPEAT("c", 255)
+1
+INSERT INTO worklog5743 VALUES(REPEAT("a", 255) , REPEAT("o", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255)
+);
+DELETE FROM worklog5743 WHERE col_1_binary = REPEAT("b", 255);
+SELECT col_1_binary = REPEAT("c", 255) FROM worklog5743;
+col_1_binary = REPEAT("c", 255)
+1
+0
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743_key2 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(948))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
+INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+INSERT INTO worklog5743_key2 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743_key2;
+col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743_key2 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743_key2
+WHERE col_2_varchar = REPEAT("o", 4000);
+col_1_varchar = REPEAT("c", 4000)
+1
+INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key2 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743_key2;
+col_1_varchar = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743_key2;
+CREATE TABLE worklog5743_key4 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(1964))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb;
+INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+INSERT INTO worklog5743_key4 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743_key4;
+col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743_key4 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000)
+AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743_key4
+WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+col_1_varchar = REPEAT("b", 3500)
+0
+INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key4 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743_key4;
+col_1_varchar = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743_key4;
+CREATE TABLE worklog5743_key8 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(3072))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8, engine = innodb;
+INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+INSERT INTO worklog5743_key8 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743_key8;
+col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743_key8 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743_key8
+WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+col_1_varchar = REPEAT("b", 3500)
+0
+INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key8 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743_key8;
+col_1_varchar = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743_key8;
+CREATE TABLE worklog5743_key2 (
+col_1_text TEXT (4000) , col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(948))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
+INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+INSERT INTO worklog5743_key2 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000)
+FROM worklog5743_key2;
+col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743_key2 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("b", 3500) FROM worklog5743_key2
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("b", 3500)
+0
+INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key2 WHERE col_1_text = REPEAT("b", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743_key2;
+col_1_text = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743_key2;
+CREATE TABLE worklog5743_key4 (
+col_1_text TEXT (4000) , col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(1964))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb;
+INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+INSERT INTO worklog5743_key4 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000)
+FROM worklog5743_key4;
+col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743_key4 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("b", 3500) FROM worklog5743_key4
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("b", 3500)
+0
+INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key4 WHERE col_1_text = REPEAT("b", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743_key4;
+col_1_text = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743_key4;
+CREATE TABLE worklog5743_key8 (
+col_1_text TEXT (4000) , col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(3072))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8, engine = innodb;
+INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+INSERT INTO worklog5743_key8 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000)
+FROM worklog5743_key8;
+col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743_key8 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("b", 3500) FROM worklog5743_key8
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("b", 3500)
+0
+INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key8 WHERE col_1_text = REPEAT("b", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743_key8;
+col_1_text = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743_key8;
+CREATE TABLE worklog5743_key2 (
+col_1_blob BLOB (4000) , col_2_blob BLOB (4000) ,
+PRIMARY KEY (col_1_blob(948))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
+INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+INSERT INTO worklog5743_key2 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_blob = REPEAT("a", 4000) , col_2_blob = REPEAT("o", 4000)
+FROM worklog5743_key2;
+col_1_blob = REPEAT("a", 4000) col_2_blob = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743_key2 SET col_1_blob = REPEAT("c", 4000)
+WHERE col_1_blob = REPEAT("a", 4000) AND col_2_blob = REPEAT("o", 4000);
+SELECT col_1_blob = REPEAT("b", 3500) FROM worklog5743_key2
+WHERE col_1_blob = REPEAT("c", 4000) AND col_2_blob = REPEAT("o", 4000);
+col_1_blob = REPEAT("b", 3500)
+0
+INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key2 WHERE col_1_blob = REPEAT("b", 4000);
+SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743_key2;
+col_1_blob = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743_key2;
+CREATE TABLE worklog5743_key4 (
+col_1_blob BLOB (4000) , col_2_blob BLOB (4000) ,
+PRIMARY KEY (col_1_blob(1964))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb;
+INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+INSERT INTO worklog5743_key4 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_blob = REPEAT("a", 4000) , col_2_blob = REPEAT("o", 4000)
+FROM worklog5743_key4;
+col_1_blob = REPEAT("a", 4000) col_2_blob = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743_key4 SET col_1_blob = REPEAT("c", 4000)
+WHERE col_1_blob = REPEAT("a", 4000) AND col_2_blob = REPEAT("o", 4000);
+SELECT col_1_blob = REPEAT("b", 3500) FROM worklog5743_key4
+WHERE col_1_blob = REPEAT("c", 4000) AND col_2_blob = REPEAT("o", 4000);
+col_1_blob = REPEAT("b", 3500)
+0
+INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key4 WHERE col_1_blob = REPEAT("b", 4000);
+SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743_key4;
+col_1_blob = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743_key4;
+CREATE TABLE worklog5743_key8 (
+col_1_blob BLOB (4000) , col_2_blob BLOB (4000) ,
+PRIMARY KEY (col_1_blob(3072))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8, engine = innodb;
+INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+INSERT INTO worklog5743_key8 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_blob = REPEAT("a", 4000) , col_2_blob = REPEAT("o", 4000)
+FROM worklog5743_key8;
+col_1_blob = REPEAT("a", 4000) col_2_blob = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743_key8 SET col_1_blob = REPEAT("c", 4000)
+WHERE col_1_blob = REPEAT("a", 4000) AND col_2_blob = REPEAT("o", 4000);
+SELECT col_1_blob = REPEAT("b", 3500) FROM worklog5743_key8
+WHERE col_1_blob = REPEAT("c", 4000) AND col_2_blob = REPEAT("o", 4000);
+col_1_blob = REPEAT("b", 3500)
+0
+INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key8 WHERE col_1_blob = REPEAT("b", 4000);
+SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743_key8;
+col_1_blob = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743_key8;
+CREATE TABLE worklog5743 (
+col_1_varbinary VARBINARY (4000) , col_2_varchar VARCHAR (4000) ,
+col_3_text TEXT (4000), col_4_blob BLOB (4000),col_5_text TEXT (4000),
+col_6_varchar VARCHAR (4000), col_7_binary BINARY (255)
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_varbinary = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
+WHERE col_1_varbinary = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+col_1_varbinary = REPEAT("c", 4000)
+1
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("b", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743;
+col_1_varbinary = REPEAT("c", 4000)
+1
+0
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_varbinary VARBINARY (4000) , col_2_varchar VARCHAR (4000) ,
+col_3_text TEXT (4000), col_4_blob BLOB (4000),col_5_text TEXT (4000),
+col_6_varchar VARCHAR (4000), col_7_binary BINARY (255)
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+CREATE INDEX prefix_idx1 ON worklog5743(col_1_varbinary (3072));
+CREATE INDEX prefix_idx2 ON worklog5743(col_2_varchar (3072));
+CREATE INDEX prefix_idx3 ON worklog5743(col_3_text (3072));
+CREATE INDEX prefix_idx4 ON worklog5743(col_4_blob (3072));
+CREATE INDEX prefix_idx5 ON worklog5743(col_5_text (3072));
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_varbinary = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000)
+1 1
+ROLLBACK;
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+COMMIT;
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_varbinary = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000)
+1 1
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+ROLLBACK;
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+col_1_varbinary = REPEAT("c", 4000)
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("b", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743;
+col_1_varbinary = REPEAT("c", 4000)
+0
+0
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_text TEXT (4000) CHARACTER SET 'utf8',
+col_2_text TEXT (4000) CHARACTER SET 'utf8',
+PRIMARY KEY (col_1_text(1024))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_text (1024));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000) FROM worklog5743;
+col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("c", 4000)
+1
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743;
+col_1_text = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (col_1_varchar VARCHAR (4000) CHARACTER SET 'utf8',
+col_2_varchar VARCHAR (4000) CHARACTER SET 'utf8' ,
+PRIMARY KEY (col_1_varchar(1024))
+) ROW_FORMAT=DYNAMIC, 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
+CREATE TABLE worklog5743 (
+col_1_varbinary VARBINARY (4000) ,
+col_2_varchar VARCHAR (4000) CHARACTER SET 'utf8',
+col_3_text TEXT (4000) CHARACTER SET 'utf8',
+col_4_blob BLOB (4000),col_5_text TEXT (4000),
+col_6_varchar VARCHAR (4000), col_7_binary BINARY (255)
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+CREATE INDEX prefix_idx2 ON worklog5743(col_2_varchar (500));
+CREATE INDEX prefix_idx3 ON worklog5743(col_3_text (500));
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_varbinary = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000)
+1 1
+ROLLBACK;
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+COMMIT;
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_varbinary = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000)
+1 1
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+ROLLBACK;
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000)
+AND col_2_varchar = REPEAT("o", 4000);
+col_1_varbinary = REPEAT("c", 4000)
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("b", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743;
+col_1_varbinary = REPEAT("c", 4000)
+0
+0
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_text TEXT (4000) CHARACTER SET 'utf8',
+col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(1024))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("स", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_text (1024));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("स", 4000) , col_2_text = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_text = REPEAT("स", 4000) col_2_text = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_text = REPEAT("क", 4000)
+WHERE col_1_text = REPEAT("स", 4000) AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("क", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("क", 4000)
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 4000);
+SELECT col_1_text = REPEAT("क", 4000) FROM worklog5743;
+col_1_text = REPEAT("क", 4000)
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
+PRIMARY KEY (col_1_text(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 200) , REPEAT("o", 200));
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
+1 1
+"In connection 1"
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
+1 1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+"In connection 2"
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200));
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
+1 1
+0 1
+"In connection 1"
+select @@session.tx_isolation;
+@@session.tx_isolation
+REPEATABLE-READ
+SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200)
+0 1
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+@@session.tx_isolation
+READ-UNCOMMITTED
+SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200)
+0 1
+1 1
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+START TRANSACTION;
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
+1 1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+"In connection 2"
+COMMIT;
+"In connection 1"
+SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200)
+0 1
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
+1 1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+COMMIT;
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
+PRIMARY KEY (col_1_text(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 200) , REPEAT("o", 200));
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
+1 1
+"In connection 1"
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
+1 1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+START TRANSACTION;
+"In connection 2"
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200));
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("a", 200);
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
+0 1
+COMMIT;
+"In connection 1"
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+@@session.tx_isolation
+READ-UNCOMMITTED
+SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200)
+1 1
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200)
+1 1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+COMMIT;
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
+PRIMARY KEY (col_1_text(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 200) , REPEAT("o", 200));
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
+1 1
+"In connection 1"
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
+1 1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+START TRANSACTION;
+"In connection 2"
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200));
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("a", 200);
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
+0 1
+ROLLBACK;
+"In connection 1"
+SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200)
+0 1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+COMMIT;
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000)
+AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varchar = REPEAT("c", 4000)
+AND col_2_varchar = REPEAT("o", 4000);
+col_1_varchar = REPEAT("c", 4000)
+1
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743;
+col_1_varchar = REPEAT("c", 4000)
+0
+0
+1
+SELECT tbl1.col_1_varchar = tbl2.col_1_varchar
+FROM worklog5743 tbl1 , worklog5743 tbl2
+WHERE tbl1.col_1_varchar = tbl2.col_1_varchar ;
+tbl1.col_1_varchar = tbl2.col_1_varchar
+1
+1
+1
+SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1
+WHERE col_1_varchar IN (SELECT tbl2.col_1_varchar FROM worklog5743 tbl2) ;
+tbl1.col_1_varchar = REPEAT("c", 4000)
+0
+0
+1
+SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1
+WHERE col_1_varchar NOT IN (SELECT tbl2.col_1_varchar FROM worklog5743 tbl2) ;
+tbl1.col_1_varchar = REPEAT("c", 4000)
+SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1 WHERE
+col_1_varchar IN (SELECT tbl2.col_1_varchar FROM worklog5743 tbl2)
+AND col_1_varchar = REPEAT("c", 4000);
+tbl1.col_1_varchar = REPEAT("c", 4000)
+1
+SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1
+WHERE col_1_varchar in (
+SELECT tbl2.col_1_varchar FROM worklog5743 tbl2
+WHERE tbl1.col_1_varchar != tbl2.col_1_varchar
+) ;
+tbl1.col_1_varchar = REPEAT("c", 4000)
+SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1
+WHERE col_1_varchar in (
+SELECT tbl2.col_1_varchar FROM worklog5743 tbl2
+WHERE tbl1.col_1_varchar = tbl2.col_1_varchar
+) ;
+tbl1.col_1_varchar = REPEAT("c", 4000)
+0
+0
+1
+SELECT
+REVERSE(col_1_varchar) = REPEAT("c", 4000) ,
+REVERSE(REVERSE(col_1_varchar)) = REPEAT("c", 4000)
+FROM worklog5743;
+REVERSE(col_1_varchar) = REPEAT("c", 4000) REVERSE(REVERSE(col_1_varchar)) = REPEAT("c", 4000)
+0 0
+0 0
+1 1
+SELECT
+UPPER(col_1_varchar) = REPEAT("c", 4000) ,
+UPPER(col_1_varchar) = REPEAT("C", 4000) ,
+LOWER(UPPER(col_1_varchar)) = REPEAT("c", 4000)
+FROM worklog5743;
+UPPER(col_1_varchar) = REPEAT("c", 4000) UPPER(col_1_varchar) = REPEAT("C", 4000) LOWER(UPPER(col_1_varchar)) = REPEAT("c", 4000)
+0 0 0
+0 0 0
+1 1 1
+SELECT
+col_1_varchar = REPEAT("c", 4000)
+FROM worklog5743 WHERE col_1_varchar like '%c__%';
+col_1_varchar = REPEAT("c", 4000)
+1
+SELECT SUBSTRING(INSERT(col_1_varchar, 1, 4, 'kkkk'),1,10) FROM worklog5743 ;
+SUBSTRING(INSERT(col_1_varchar, 1, 4, 'kkkk'),1,10)
+kkkkaaaaaa
+kkkkbbbbbb
+kkkkcccccc
+SELECT CONCAT(SUBSTRING(col_1_varchar,-5,3),'append') FROM worklog5743 ;
+CONCAT(SUBSTRING(col_1_varchar,-5,3),'append')
+aaaappend
+bbbappend
+cccappend
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) ,
+col_2_varchar VARCHAR (4000) ,
+UNIQUE INDEX (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743
+VALUES(concat(REPEAT("a", 2000),REPEAT("b", 1000),REPEAT("c", 1000)), REPEAT("o", 4000));
+INSERT INTO worklog5743
+VALUES(concat(REPEAT("a", 2000),REPEAT("b", 2000)), REPEAT("o", 4000));
+INSERT INTO worklog5743 VALUES(NULL,NULL);
+INSERT INTO worklog5743 VALUES(NULL,NULL);
+SELECT COLUMN_NAME,INDEX_NAME,SUB_PART,INDEX_TYPE
+FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'worklog5743' ;
+COLUMN_NAME INDEX_NAME SUB_PART INDEX_TYPE
+col_1_varchar col_1_varchar 3072 BTREE
+SELECT col_1_varchar FROM worklog5743 WHERE col_1_varchar IS NULL;
+col_1_varchar
+NULL
+NULL
+SELECT col_1_varchar = concat(REPEAT("a", 2000),REPEAT("b", 2000))
+FROM worklog5743 WHERE col_1_varchar IS NOT NULL ORDER BY 1;
+col_1_varchar = concat(REPEAT("a", 2000),REPEAT("b", 2000))
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(3072))) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+DROP INDEX prefix_idx ON worklog5743;
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+col_1_varchar = REPEAT("c", 4000)
+1
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743;
+col_1_varchar = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY `prefix_primary` (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000)
+AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varchar = REPEAT("c", 4000)
+AND col_2_varchar = REPEAT("o", 4000);
+col_1_varchar = REPEAT("c", 4000)
+1
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_varchar(3072));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+ERROR 23000: Duplicate entry 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' for key 'PRIMARY'
+DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743;
+col_1_varchar = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY `prefix_primary` (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+DROP INDEX prefix_idx ON worklog5743;
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+col_1_varchar = REPEAT("c", 4000)
+1
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_varchar(3072));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+ERROR 23000: Duplicate entry 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' for key 'PRIMARY'
+DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743;
+col_1_varchar = REPEAT("c", 4000)
+0
+1
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR(4000) , col_2_varchar VARCHAR(4000) ,
+PRIMARY KEY (col_1_varchar (3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("c", 3500) , REPEAT("o", 3500));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+" Switching to con1 connection For select "
+SELECT col_1_varchar = REPEAT("c", 3500) , col_2_varchar = REPEAT("o", 3500)
+FROM worklog5743;
+col_1_varchar = REPEAT("c", 3500) col_2_varchar = REPEAT("o", 3500)
+1 1
+" Switching to default connection For DMLs "
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500));
+SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743
+WHERE col_2_varchar = REPEAT("o", 3500);
+col_1_varchar = REPEAT("b", 3500)
+0
+0
+COMMIT;
+" Switching to con1 connection For Dropping index and some DMLs "
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("k", 3500),REPEAT("p", 3500));
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+UPDATE worklog5743 SET col_1_varchar = REPEAT("b", 3500)
+WHERE col_1_varchar = REPEAT("a", 3500)
+AND col_2_varchar = REPEAT("o", 3500);
+SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743
+WHERE col_2_varchar = REPEAT("o", 3500);
+col_1_varchar = REPEAT("b", 3500)
+1
+0
+" Switching to default connection For DELETE "
+DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 3500);
+SELECT col_1_varchar = REPEAT("a", 3500) FROM worklog5743
+WHERE col_2_varchar = REPEAT("p", 3500);
+col_1_varchar = REPEAT("a", 3500)
+0
+" Switching to con1 connection to commit changes "
+COMMIT;
+" Switching to default connection to drop and end sub-test "
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_varbinary VARBINARY (4000) , col_2_varbinary VARBINARY (4000) ,
+PRIMARY KEY (col_1_varbinary(3072))) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varbinary = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_varbinary = REPEAT("a", 4000) col_2_varbinary = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
+WHERE col_1_varbinary = REPEAT("a", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+col_1_varbinary = REPEAT("c", 4000)
+1
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("c", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+col_1_varbinary = REPEAT("c", 4000)
+DROP INDEX prefix_idx ON worklog5743;
+SELECT col_1_varbinary = REPEAT("b", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("b", 4000)
+AND col_2_varbinary = REPEAT("p", 4000);
+col_1_varbinary = REPEAT("b", 4000)
+1
+CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (2000));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_varbinary = REPEAT("a", 4000) FROM worklog5743;
+col_1_varbinary = REPEAT("a", 4000)
+1
+0
+UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
+WHERE col_1_varbinary = REPEAT("a", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("c", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+col_1_varbinary = REPEAT("c", 4000)
+DROP INDEX prefix_idx ON worklog5743;
+CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (4000));
+Warnings:
+Warning 1071 Specified key was too long; max key length is 3072 bytes
+Warning 1071 Specified key was too long; max key length is 3072 bytes
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_varbinary = REPEAT("a", 4000) FROM worklog5743;
+col_1_varbinary = REPEAT("a", 4000)
+1
+0
+UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
+WHERE col_1_varbinary = REPEAT("a", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("c", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+col_1_varbinary = REPEAT("c", 4000)
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (col_1_text TEXT (4000) , col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(500))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_text (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000)
+FROM worklog5743;
+col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000)
+AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("c", 4000)
+1
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("c", 4000)
+DROP INDEX prefix_idx ON worklog5743;
+SELECT col_1_text = REPEAT("b", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("b", 4000) AND col_2_text = REPEAT("p", 4000);
+col_1_text = REPEAT("b", 4000)
+1
+CREATE INDEX prefix_idx ON worklog5743(col_1_text (1000));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_text = REPEAT("a", 4000) FROM worklog5743;
+col_1_text = REPEAT("a", 4000)
+1
+0
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("c", 4000)
+DROP INDEX prefix_idx ON worklog5743;
+CREATE INDEX prefix_idx ON worklog5743(col_1_text (4000));
+Warnings:
+Warning 1071 Specified key was too long; max key length is 3072 bytes
+Warning 1071 Specified key was too long; max key length is 3072 bytes
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_text = REPEAT("a", 4000) FROM worklog5743;
+col_1_text = REPEAT("a", 4000)
+1
+0
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("c", 4000)
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_text TEXT (4000) , col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(948))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000) FROM worklog5743;
+col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000)
+1 1
+0 0
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000)
+AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000)
+AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("c", 4000)
+1
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000)
+AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("c", 4000)
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+SELECT col_1_text = REPEAT("b", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("b", 4000)
+AND col_2_text = REPEAT("p", 4000);
+col_1_text = REPEAT("b", 4000)
+1
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_text (700));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_text = REPEAT("a", 4000) FROM worklog5743;
+col_1_text = REPEAT("a", 4000)
+1
+0
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000)
+AND col_2_text = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000)
+AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("c", 4000)
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_text (950));
+ERROR HY000: Too big row
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_text = REPEAT("a", 4000) FROM worklog5743;
+col_1_text = REPEAT("a", 4000)
+0
+1
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000)
+AND col_2_text = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000)
+AND col_2_text = REPEAT("o", 4000);
+col_1_text = REPEAT("c", 4000)
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , PRIMARY KEY (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_varchar (900));
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_varchar (3073));
+ERROR 42000: Specified key was too long; max key length is 3072 bytes
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_BLOB BLOB (4000) , PRIMARY KEY (col_1_BLOB(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_BLOB (500));
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_BLOB (3073));
+ERROR 42000: Specified key was too long; max key length is 3072 bytes
+DROP TABLE worklog5743;
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000)
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743
+VALUES(concat(REPEAT("a", 2000),REPEAT("b", 1000),REPEAT("c", 1000)),
+REPEAT("o", 4000));
+INSERT INTO worklog5743
+VALUES(concat(REPEAT("a", 2000),REPEAT("b", 2000)), REPEAT("o", 4000));
+ALTER TABLE worklog5743 ADD PRIMARY KEY `pk_idx` (col_1_varchar(3000));
+ERROR 23000: Duplicate entry 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' for key 'PRIMARY'
+DROP TABLE worklog5743;
+set global innodb_large_prefix=0;
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+ERROR 42000: Specified key was too long; max key length is 767 bytes
+set global innodb_large_prefix=0;
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(767))
+) engine = innodb;
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (1000));
+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
+DROP TABLE worklog5743;
+SET GLOBAL innodb_file_format=Antelope;
+SET GLOBAL innodb_file_per_table=0;
+SET GLOBAL innodb_file_format_max=Antelope;
+SET GLOBAL innodb_large_prefix=0;
diff --git a/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result b/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
new file mode 100644
index 00000000000..09756954b92
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
@@ -0,0 +1,91 @@
+set global innodb_file_format="Barracuda";
+set global innodb_file_per_table=1;
+set global innodb_large_prefix=1;
+DROP TABLE IF EXISTS worklog5743;
+CREATE TABLE worklog5743 (
+col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
+PRIMARY KEY (col_1_text(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500));
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
+1 1
+"In connection 1"
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
+1 1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+"In connection 2"
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
+"In connection 1"
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
+1 1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+START TRANSACTION;
+"In connection default ....restarting the server"
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
+1 1
+"In connection 1"
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
+1 1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 3500);
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
+1 1
+"In connection default ....restarting the server"
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
+1 1
+"In connection 1"
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
+1 1
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+START TRANSACTION;
+UPDATE worklog5743 SET col_1_text = REPEAT("b", 3500) WHERE col_1_text = REPEAT("a", 3500);
+SELECT col_1_text = REPEAT("b", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+col_1_text = REPEAT("b", 3500) col_2_text = REPEAT("o", 3500)
+1 1
+"In connection default ....restarting the server"
+SELECT COUNT(*) FROM worklog5743;
+COUNT(*)
+1
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
+1 1
+DROP TABLE worklog5743;
+SET GLOBAL innodb_file_format=Antelope;
+SET GLOBAL innodb_file_per_table=0;
+SET GLOBAL innodb_file_format_max=Antelope;
+SET GLOBAL innodb_large_prefix=0;
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc-18274.test b/mysql-test/suite/innodb/t/innodb-autoinc-18274.test
new file mode 100644
index 00000000000..de9f3e3d18b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-autoinc-18274.test
@@ -0,0 +1,26 @@
+-- source include/have_innodb.inc
+# embedded server ignores 'delayed', so skip this
+-- source include/not_embedded.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# Bug #18274 InnoDB auto_increment field reset on OPTIMIZE TABLE
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (null);
+SHOW CREATE TABLE t1;
+DELETE FROM t1;
+OPTIMIZE TABLE t1;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES(null);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# restore environment to the state it was before this test execution
+#
+
+-- disable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc-56228-master.opt b/mysql-test/suite/innodb/t/innodb-autoinc-56228-master.opt
new file mode 100644
index 00000000000..0eed7aaadad
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-autoinc-56228-master.opt
@@ -0,0 +1 @@
+--innodb_autoinc_lock_mode=0
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc-56228.test b/mysql-test/suite/innodb/t/innodb-autoinc-56228.test
new file mode 100644
index 00000000000..626efcf9897
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-autoinc-56228.test
@@ -0,0 +1,33 @@
+-- source include/have_innodb.inc
+
+##
+# Bug #56228: dropping tables from within an active statement crashes server
+#
+DROP TABLE IF EXISTS t1_56228;
+DROP TABLE IF EXISTS t2_56228;
+DROP FUNCTION IF EXISTS bug56228;
+
+CREATE TEMPORARY TABLE t1_56228(
+ c1 iNT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE t2_56228(
+ c1 iNT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+
+DELIMITER //;
+
+CREATE FUNCTION bug56228() RETURNS INT DETERMINISTIC
+BEGIN
+ INSERT INTO t1_56228 VALUES(NULL);
+ INSERT INTO t2_56228 VALUES(NULL);
+ INSERT INTO t1_56228 VALUES(NULL);
+ INSERT INTO t2_56228 VALUES(NULL);
+ DROP TEMPORARY TABLE t1_56228;
+ RETURN 42;
+END //
+
+DELIMITER ;//
+
+SELECT bug56228();
+
+DROP FUNCTION bug56228;
+DROP TEMPORARY TABLE t2_56228;
+DROP TEMPORARY TABLE IF EXISTS t1_56228;
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test
index 84c359a6bde..4ca761b45ce 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc.test
@@ -292,21 +292,8 @@ INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
SHOW VARIABLES LIKE "%auto_inc%";
-# This should fail because of overflow but it doesn't, it seems to be
-# a MySQL server bug. It wraps around to 0 for the last value.
-# See MySQL Bug# 39828
-#
-# Instead of wrapping around, it asserts when MySQL is compiled --with-debug
-# (see sql/handler.cc:handler::update_auto_increment()). Don't test for
-# overflow until Bug #39828 is fixed.
-#
-# Since this asserts when compiled --with-debug, we can't properly test this
-# until Bug #39828 is fixed. For now, this test is meaningless.
-#if Bug #39828 is fixed
-#INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
-#else
-INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
-#endif
+--error ER_AUTOINC_READ_FAILED
+INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
SELECT * FROM t1;
DROP TABLE t1;
@@ -324,20 +311,8 @@ INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
SHOW VARIABLES LIKE "%auto_inc%";
-# This should fail because of overflow but it doesn't. It fails with
-# a duplicate entry message because of a MySQL server bug, it wraps
-# around. See MySQL Bug# 39828, once MySQL fix the bug we can replace
-# the ER_DUP_ENTRY, 1062 below with the appropriate error message
-#
-# Since this asserts when compiled --with-debug, we can't properly test this
-# until Bug #39828 is fixed. For now, this test is meaningless.
-#if Bug #39828 is fixed
-# Still need to fix this error code, error should mention overflow
-#-- error ER_DUP_ENTRY,1062
-#INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
-#else
-INSERT INTO t1 VALUES (NULL),(NULL);
-#endif
+--error ER_AUTOINC_READ_FAILED
+INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
SELECT * FROM t1;
DROP TABLE t1;
@@ -375,20 +350,8 @@ INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2
SELECT * FROM t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
SHOW VARIABLES LIKE "%auto_inc%";
-# This should fail because of overflow but it doesn't. It wraps around
-# and the autoinc values look bogus too.
-# See MySQL Bug# 39828, once MySQL fix the bug we can enable the error
-# code expected test.
-# -- error ER_AUTOINC_READ_FAILED,1467
-#
-# Since this asserts when compiled --with-debug, we can't properly test this
-# until Bug #39828 is fixed. For now, this test is meaningless.
-#if Bug #39828 is fixed
-#-- error ER_AUTOINC_READ_FAILED,1467
-#INSERT INTO t1 VALUES (NULL),(NULL);
-#else
-INSERT INTO t1 VALUES (NULL);
-#endif
+--error ER_WARN_DATA_OUT_OF_RANGE
+INSERT INTO t1 VALUES (NULL),(NULL);
SELECT * FROM t1;
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb-create-options.test b/mysql-test/suite/innodb/t/innodb-create-options.test
new file mode 100644
index 00000000000..3daa5f09e71
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-create-options.test
@@ -0,0 +1,575 @@
+# Tests for various combinations of ROW_FORMAT and KEY_BLOCK_SIZE
+# Related bugs;
+# Bug#54679: ALTER TABLE causes compressed row_format to revert to compact
+# Bug#56628: ALTER TABLE .. KEY_BLOCK_SIZE=0 produces untrue warning or unnecessary error
+# Bug#56632: ALTER TABLE implicitly changes ROW_FORMAT to COMPRESSED
+# Rules for interpreting CREATE_OPTIONS
+# 1) Create options on an ALTER are added to the options on the
+# previous CREATE or ALTER statements.
+# 2) KEY_BLOCK_SIZE=0 is considered a unspecified value.
+# If the current ROW_FORMAT has explicitly been set to COMPRESSED,
+# InnoDB will use a default value of 8. Otherwise KEY_BLOCK_SIZE
+# will not be used.
+# 3) ROW_FORMAT=DEFAULT allows InnoDB to choose its own default, COMPACT.
+# 4) ROW_FORMAT=DEFAULT and KEY_BLOCK_SIZE=0 can be used at any time to
+# unset or erase the values persisted in the MySQL dictionary and
+# by SHOW CTREATE TABLE.
+# 5) When incompatible values for ROW_FORMAT and KEY_BLOCK_SIZE are
+# both explicitly given, the ROW_FORMAT is always used in non-strict
+# mode.
+# 6) InnoDB will automatically convert a table to COMPRESSED only if a
+# valid non-zero KEY_BLOCK_SIZE has been given and ROW_FORMAT=DEFAULT
+# or has not been used on a previous CREATE TABLE or ALTER TABLE.
+# 7) InnoDB strict mode is designed to prevent incompatible create
+# options from being used together.
+# 8) The non-strict behavior is intended to permit you to import a
+# mysqldump file into a database that does not support compressed
+# tables, even if the source database contained compressed tables.
+# All invalid values and/or incompatible combinations of ROW_FORMAT
+# and KEY_BLOCK_SIZE are automatically corrected
+#
+# *** innodb_strict_mode=ON ***
+# 1) Valid ROW_FORMATs are COMPRESSED, COMPACT, DEFAULT, DYNAMIC
+# & REDUNDANT. All others are rejected.
+# 2) Valid KEY_BLOCK_SIZEs are 0,1,2,4,8,16. All others are rejected.
+# 3) KEY_BLOCK_SIZE=0 can be used to set it to 'unspecified'.
+# 4) KEY_BLOCK_SIZE=1,2,4,8 & 16 are incompatible with COMPACT, DYNAMIC &
+# REDUNDANT.
+# 5) KEY_BLOCK_SIZE=1,2,4,8 & 16 as well as ROW_FORMAT=COMPRESSED and
+# ROW_FORMAT=DYNAMIC are incompatible with innodb_file_format=Antelope
+# and innodb_file_per_table=OFF
+# 6) KEY_BLOCK_SIZE on an ALTER must occur with ROW_FORMAT=COMPRESSED
+# or ROW_FORMAT=DEFAULT if the ROW_FORMAT was previously specified
+# as COMPACT, DYNAMIC or REDUNDANT.
+# 7) KEY_BLOCK_SIZE on an ALTER can occur without a ROW_FORMAT if the
+# previous ROW_FORMAT was DEFAULT, COMPRESSED, or unspecified.
+#
+# *** innodb_strict_mode=OFF ***
+# 1. Ignore a bad KEY_BLOCK_SIZE, defaulting it to 8.
+# 2. Ignore a bad ROW_FORMAT, defaulting to COMPACT.
+# 3. Ignore a valid KEY_BLOCK_SIZE when an incompatible but valid
+# ROW_FORMAT is specified.
+# 4. If innodb_file_format=Antelope or innodb_file_per_table=OFF
+# it will ignore ROW_FORMAT=COMPRESSED or DYNAMIC and it will
+# ignore all non-zero KEY_BLOCK_SIZEs.
+#
+# See InnoDB documentation page "SQL Compression Syntax Warnings and Errors"
+
+-- source include/have_innodb.inc
+SET storage_engine=InnoDB;
+
+--disable_query_log
+# These values can change during the test
+LET $innodb_file_format_orig=`select @@innodb_file_format`;
+LET $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
+LET $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
+LET $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format=`Barracuda`;
+SET GLOBAL innodb_file_per_table=ON;
+
+# The first half of these tests are with strict mode ON.
+SET SESSION innodb_strict_mode = ON;
+
+--echo # Test 1) StrictMode=ON, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0
+--echo # KEY_BLOCK_SIZE=0 means 'no KEY_BLOCK_SIZE is specified'
+DROP TABLE IF EXISTS t1;
+--echo # 'FIXED' is sent to InnoDB since it is used by MyISAM.
+--echo # But it is an invalid mode in InnoDB
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED;
+SHOW WARNINGS;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+
+
+--echo # Test 2) StrictMode=ON, CREATE with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE
+--echo # KEY_BLOCK_SIZE is incompatible with COMPACT, REDUNDANT, & DYNAMIC
+DROP TABLE IF EXISTS t1;
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+
+--echo # Test 3) StrictMode=ON, ALTER with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT );
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=8;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+
+--echo # Test 4) StrictMode=ON, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid non-zero KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+--echo # Test 5) StrictMode=ON, CREATE with a valid KEY_BLOCK_SIZE
+--echo # ALTER with each ROW_FORMAT
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=2;
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW CREATE TABLE t1;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ROW_FORMAT=COMPACT;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+--echo # Test 6) StrictMode=ON, CREATE with an invalid KEY_BLOCK_SIZE.
+DROP TABLE IF EXISTS t1;
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=9;
+SHOW WARNINGS;
+
+--echo # Test 7) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and
+--echo # and a valid non-zero KEY_BLOCK_SIZE are rejected with Antelope
+--echo # and that they can be set to default values during strict mode.
+SET GLOBAL innodb_file_format=Antelope;
+DROP TABLE IF EXISTS t1;
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
+SHOW WARNINGS;
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT;
+SHOW WARNINGS;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 KEY_BLOCK_SIZE=8;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+SET GLOBAL innodb_file_format=Barracuda;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
+SET GLOBAL innodb_file_format=Antelope;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ADD COLUMN f1 INT;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+ALTER TABLE t1 ADD COLUMN f2 INT;
+SHOW WARNINGS;
+SET GLOBAL innodb_file_format=Barracuda;
+
+--echo # Test 8) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and
+--echo # and a valid non-zero KEY_BLOCK_SIZE are rejected with
+--echo # innodb_file_per_table=OFF and that they can be set to default
+--echo # values during strict mode.
+SET GLOBAL innodb_file_per_table=OFF;
+DROP TABLE IF EXISTS t1;
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
+SHOW WARNINGS;
+--error ER_CANT_CREATE_TABLE
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT;
+SHOW WARNINGS;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 KEY_BLOCK_SIZE=1;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+ALTER TABLE t1 ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=DEFAULT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+SET GLOBAL innodb_file_per_table=ON;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
+SET GLOBAL innodb_file_per_table=OFF;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+--error ER_CANT_CREATE_TABLE
+ALTER TABLE t1 ADD COLUMN f1 INT;
+--replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
+SHOW WARNINGS;
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+ALTER TABLE t1 ADD COLUMN f2 INT;
+SHOW WARNINGS;
+SET GLOBAL innodb_file_per_table=ON;
+
+--echo ##################################################
+SET SESSION innodb_strict_mode = OFF;
+
+--echo # Test 9) StrictMode=OFF, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0
+--echo # KEY_BLOCK_SIZE=0 means 'no KEY_BLOCK_SIZE is specified'
+--echo # 'FIXED' is sent to InnoDB since it is used by MyISAM.
+--echo # It is an invalid mode in InnoDB, use COMPACT
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+--echo # Test 10) StrictMode=OFF, CREATE with each ROW_FORMAT & a valid KEY_BLOCK_SIZE
+--echo # KEY_BLOCK_SIZE is ignored with COMPACT, REDUNDANT, & DYNAMIC
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+
+--echo # Test 11) StrictMode=OFF, ALTER with each ROW_FORMAT & a valid KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT );
+ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT );
+ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT );
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT );
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT );
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+
+--echo # Test 12) StrictMode=OFF, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid KEY_BLOCK_SIZE
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 KEY_BLOCK_SIZE=4;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT;
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=8;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+--echo # Test 13) StrictMode=OFF, CREATE with a valid KEY_BLOCK_SIZE
+--echo # ALTER with each ROW_FORMAT
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=16;
+SHOW WARNINGS;
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=REDUNDANT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+ALTER TABLE t1 ROW_FORMAT=COMPACT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+--echo # Test 14) StrictMode=OFF, CREATE with an invalid KEY_BLOCK_SIZE, it defaults to 8
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=15;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+--echo # Test 15) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a
+--echo valid KEY_BLOCK_SIZE are remembered but not used when ROW_FORMAT
+--echo is reverted to Antelope and then used again when ROW_FORMAT=Barracuda.
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+SET GLOBAL innodb_file_format=Antelope;
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+SET GLOBAL innodb_file_format=Barracuda;
+ALTER TABLE t1 ADD COLUMN f2 INT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+SET GLOBAL innodb_file_format=Antelope;
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+SET GLOBAL innodb_file_format=Barracuda;
+ALTER TABLE t1 ADD COLUMN f2 INT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+--echo # Test 16) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a
+--echo valid KEY_BLOCK_SIZE are remembered but not used when innodb_file_per_table=OFF
+--echo and then used again when innodb_file_per_table=ON.
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+SET GLOBAL innodb_file_per_table=OFF;
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+SET GLOBAL innodb_file_per_table=ON;
+ALTER TABLE t1 ADD COLUMN f2 INT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+SET GLOBAL innodb_file_per_table=OFF;
+ALTER TABLE t1 ADD COLUMN f1 INT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+SET GLOBAL innodb_file_per_table=ON;
+ALTER TABLE t1 ADD COLUMN f2 INT;
+SHOW WARNINGS;
+SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1';
+
+
+--echo # Cleanup
+DROP TABLE IF EXISTS t1;
+
+--disable_query_log
+EVAL SET GLOBAL innodb_file_format=$innodb_file_format_orig;
+EVAL SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
+EVAL SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
+EVAL SET SESSION innodb_strict_mode=$innodb_strict_mode_orig;
+--enable_query_log
+
diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test
index 26de072f08b..86189f1426d 100644
--- a/mysql-test/suite/innodb/t/innodb-index.test
+++ b/mysql-test/suite/innodb/t/innodb-index.test
@@ -368,36 +368,36 @@ create table t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob,
q blob,r blob,s blob,t blob,u blob)
engine=innodb row_format=dynamic;
-create index t1a on t1 (a(1));
-create index t1b on t1 (b(1));
-create index t1c on t1 (c(1));
-create index t1d on t1 (d(1));
-create index t1e on t1 (e(1));
-create index t1f on t1 (f(1));
-create index t1g on t1 (g(1));
-create index t1h on t1 (h(1));
-create index t1i on t1 (i(1));
-create index t1j on t1 (j(1));
-create index t1k on t1 (k(1));
-create index t1l on t1 (l(1));
-create index t1m on t1 (m(1));
-create index t1n on t1 (n(1));
-create index t1o on t1 (o(1));
-create index t1p on t1 (p(1));
-create index t1q on t1 (q(1));
-create index t1r on t1 (r(1));
-create index t1s on t1 (s(1));
-create index t1t on t1 (t(1));
+create index t1a on t1 (a(767));
+create index t1b on t1 (b(767));
+create index t1c on t1 (c(767));
+create index t1d on t1 (d(767));
+create index t1e on t1 (e(767));
+create index t1f on t1 (f(767));
+create index t1g on t1 (g(767));
+create index t1h on t1 (h(767));
+create index t1i on t1 (i(767));
+create index t1j on t1 (j(767));
+create index t1k on t1 (k(767));
+create index t1l on t1 (l(767));
+create index t1m on t1 (m(767));
+create index t1n on t1 (n(767));
+create index t1o on t1 (o(767));
+create index t1p on t1 (p(767));
+create index t1q on t1 (q(767));
+create index t1r on t1 (r(767));
+create index t1s on t1 (s(767));
+create index t1t on t1 (t(767));
--error 139
-create index t1u on t1 (u(1));
+create index t1u on t1 (u(767));
--error 139
-create index t1ut on t1 (u(1), t(1));
-create index t1st on t1 (s(1), t(1));
+create index t1ut on t1 (u(767), t(767));
+create index t1st on t1 (s(767), t(767));
show create table t1;
--error 139
-create index t1u on t1 (u(1));
+create index t1u on t1 (u(767));
alter table t1 row_format=compact;
-create index t1u on t1 (u(1));
+create index t1u on t1 (u(767));
drop table t1;
eval set global innodb_file_per_table=$per_table;
diff --git a/mysql-test/suite/innodb/t/innodb-system-table-view-master.opt b/mysql-test/suite/innodb/t/innodb-system-table-view-master.opt
deleted file mode 100644
index 303ec1be1d0..00000000000
--- a/mysql-test/suite/innodb/t/innodb-system-table-view-master.opt
+++ /dev/null
@@ -1,3 +0,0 @@
---default-storage-engine=MyISAM
---innodb-strict-mode=0
---innodb-file-per-table=0
diff --git a/mysql-test/suite/innodb/t/innodb-system-table-view.test b/mysql-test/suite/innodb/t/innodb-system-table-view.test
deleted file mode 100644
index 904087577c8..00000000000
--- a/mysql-test/suite/innodb/t/innodb-system-table-view.test
+++ /dev/null
@@ -1,93 +0,0 @@
-# This is the test for Information Schema System Table View
-# that displays the InnoDB system table content through
-# information schema tables.
-
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS;
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS;
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS;
-
-# Create a foreign key constraint, and verify the information
-# in INFORMATION_SCHEMA.INNODB_SYS_FOREIGN and
-# INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS
-CREATE TABLE parent (id INT NOT NULL,
- PRIMARY KEY (id)) ENGINE=INNODB;
-
-CREATE TABLE child (id INT, parent_id INT,
- INDEX par_ind (parent_id),
- CONSTRAINT constraint_test
- FOREIGN KEY (parent_id) REFERENCES parent(id)
- ON DELETE CASCADE) ENGINE=INNODB;
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
-
-# Insert a row in the table "parent", and see whether that reflected in
-# INNODB_SYS_TABLESTATS
-INSERT INTO parent VALUES(1);
-
-SELECT name, num_rows, mysql_handles_opened
-FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
-WHERE name LIKE "%parent";
-
-SELECT NAME, FLAG, N_COLS, SPACE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES;
-
-SELECT name, n_fields
-from INFORMATION_SCHEMA.INNODB_SYS_INDEXES
-WHERE table_id In (SELECT table_id from
- INFORMATION_SCHEMA.INNODB_SYS_TABLES
- WHERE name LIKE "%parent%");
-
-SELECT name, n_fields
-from INFORMATION_SCHEMA.INNODB_SYS_INDEXES
-WHERE table_id In (SELECT table_id from
- INFORMATION_SCHEMA.INNODB_SYS_TABLES
- WHERE name LIKE "%child%");
-
-SELECT name, pos, mtype, len
-from INFORMATION_SCHEMA.INNODB_SYS_COLUMNS
-WHERE table_id In (SELECT table_id from
- INFORMATION_SCHEMA.INNODB_SYS_TABLES
- WHERE name LIKE "%child%");
-
-DROP TABLE child;
-
-DROP TABLE parent;
-
-# Create table with 2 columns in the foreign key constraint
-CREATE TABLE parent (id INT NOT NULL, newid INT NOT NULL,
- PRIMARY KEY (id, newid)) ENGINE=INNODB;
-
-CREATE TABLE child (id INT, parent_id INT,
- INDEX par_ind (parent_id),
- CONSTRAINT constraint_test
- FOREIGN KEY (id, parent_id) REFERENCES parent(id, newid)
- ON DELETE CASCADE) ENGINE=INNODB;
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
-
-SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS;
-
-INSERT INTO parent VALUES(1, 9);
-
-# Nested query will open the table handle twice
-SELECT * FROM parent WHERE id IN (SELECT id FROM parent);
-
-SELECT name, num_rows, mysql_handles_opened
-FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
-WHERE name LIKE "%parent";
-
-DROP TABLE child;
-
-DROP TABLE parent;
diff --git a/mysql-test/suite/innodb/t/innodb-timeout.test b/mysql-test/suite/innodb/t/innodb-timeout.test
index fd839540667..07d03093b63 100644
--- a/mysql-test/suite/innodb/t/innodb-timeout.test
+++ b/mysql-test/suite/innodb/t/innodb-timeout.test
@@ -1,5 +1,5 @@
-let $timeout=`select @@innodb_lock_wait_timeout`;
+let $initial_timeout=`select @@innodb_lock_wait_timeout`;
set global innodb_lock_wait_timeout=42;
connect (a,localhost,root,,);
@@ -11,19 +11,24 @@ set innodb_lock_wait_timeout=1;
select @@innodb_lock_wait_timeout;
connection b;
+let $connection_b_id=`SELECT CONNECTION_ID()`;
select @@innodb_lock_wait_timeout;
set global innodb_lock_wait_timeout=347;
select @@innodb_lock_wait_timeout;
-set innodb_lock_wait_timeout=1;
+set innodb_lock_wait_timeout=10;
select @@innodb_lock_wait_timeout;
connect (c,localhost,root,,);
connection c;
+
select @@innodb_lock_wait_timeout;
-connection default;
+
disconnect c;
+--source include/wait_until_disconnected.inc
connection a;
+--replace_result $connection_b_id <connection_b_id>
+eval SET @connection_b_id = $connection_b_id;
create table t1(a int primary key)engine=innodb;
begin;
insert into t1 values(1),(2),(3);
@@ -32,7 +37,37 @@ connection b;
--send
select * from t1 for update;
+# Observation on information_schema.processlist (2010-12 mysql-5.5)
+# -----------------------------------------------------------------
+# As soon as the server started the execution of the
+# connection a: --send select ... for update
+# High parallel load could delay this up to two seconds.
+# and before either
+# - the innodb_lock_wait_timeout was exceeded
+# -> connection b reap gets ER_LOCK_WAIT_TIMEOUT
+# or
+# - connection a commits, the lock disappears and the statement
+# of connection b finishes
+# -> connection b reap gets success + result set
+# we see within information_schema.processlist for connection b a row
+# command state info
+# Query Sending data select * from t1 for update
+# The highest time value seen was @@innodb_lock_wait_timeout + 1.
+# Please note that there is unfortunately nothing which says
+# that we are just waiting for a lock.
+
connection a;
+# In order to ensure that the execution of
+# connection b: select * from t1 for update
+# has really started and is most probably waiting for the lock now we poll on
+# information_schema.processlist.
+# Also our current session innodb_lock_wait_timeout of 10 seconds should big
+# enough to prevent that connection b ends up with getting ER_LOCK_WAIT_TIMEOUT.
+#
+let $wait_timeout= 10;
+let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist
+WHERE id = @connection_b_id AND INFO = 'select * from t1 for update';
+--source include/wait_condition.inc
commit;
connection b;
@@ -43,21 +78,39 @@ begin;
insert into t1 values(4);
connection b;
+set innodb_lock_wait_timeout=3;
+# 3 seconds should be big enough that the wait routine of connection a will
+# hit the time span where our next statement is visible within the
+# information_schema.processlist.
--send
select * from t1 for update;
connection a;
-sleep 2;
+# Wait till the execution of the connection b statement was started.
+let $wait_timeout= 10;
+let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist
+WHERE id = @connection_b_id AND INFO = 'select * from t1 for update';
+--source include/wait_condition.inc
+# Wait till the execution of the connection b statement has ended.
+let $wait_timeout= 10;
+let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist
+WHERE id = @connection_b_id AND INFO IS NULL;
+--source include/wait_condition.inc
+# Give "commit" though this must be too late for the statement of connection b.
commit;
connection b;
--error ER_LOCK_WAIT_TIMEOUT
reap;
-drop table t1;
-connection default;
+disconnect b;
+--source include/wait_until_disconnected.inc
+connection a;
disconnect a;
-disconnect b;
+--source include/wait_until_disconnected.inc
-eval set global innodb_lock_wait_timeout=$timeout;
+connection default;
+drop table t1;
+--replace_result $initial_timeout <initial_timeout>
+eval set global innodb_lock_wait_timeout=$initial_timeout;
diff --git a/mysql-test/suite/innodb/t/innodb-truncate.test b/mysql-test/suite/innodb/t/innodb-truncate.test
new file mode 100644
index 00000000000..7629eb1a980
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-truncate.test
@@ -0,0 +1,65 @@
+--source include/have_innodb.inc
+
+--echo #
+--echo # TRUNCATE TABLE
+--echo #
+--echo # Truncating is disallowed for parent tables unless such table
+--echo # participates in self-referencing foreign keys only.
+--echo #
+CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE t2 (fk INT NOT NULL, FOREIGN KEY (fk) REFERENCES t1 (pk)) ENGINE=INNODB;
+--error ER_TRUNCATE_ILLEGAL_FK
+TRUNCATE TABLE t1;
+--echo # Truncation of child should succeed.
+TRUNCATE TABLE t2;
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (pk INT PRIMARY KEY, fk INT,
+ FOREIGN KEY (fk) REFERENCES t1 (pk)) ENGINE=INNODB;
+--echo # Truncation of self-referencing table should succeed.
+TRUNCATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # Also, truncating such tables is allowed if foreign key
+--echo # checks are disabled.
+--echo #
+
+SET @old_foreign_key_checks = @@SESSION.foreign_key_checks;
+CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE t2 (fk INT NOT NULL, FOREIGN KEY (fk) REFERENCES t1 (pk)) ENGINE=INNODB;
+CREATE TABLE t3 (pk INT PRIMARY KEY, fk INT,
+ FOREIGN KEY (fk) REFERENCES t1 (pk)) ENGINE=INNODB;
+SET @@SESSION.foreign_key_checks = 0;
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+SET @@SESSION.foreign_key_checks = 1;
+--error ER_TRUNCATE_ILLEGAL_FK
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+TRUNCATE TABLE t3;
+LOCK TABLES t1 WRITE;
+SET @@SESSION.foreign_key_checks = 0;
+TRUNCATE TABLE t1;
+SET @@SESSION.foreign_key_checks = 1;
+--error ER_TRUNCATE_ILLEGAL_FK
+TRUNCATE TABLE t1;
+UNLOCK TABLES;
+DROP TABLE t3,t2,t1;
+SET @@SESSION.foreign_key_checks = @old_foreign_key_checks;
+
+--echo #
+--echo # Test that TRUNCATE resets auto-increment.
+--echo #
+
+CREATE TABLE t1 (a INT PRIMARY KEY NOT NULL AUTO_INCREMENT);
+INSERT INTO t1 VALUES (NULL), (NULL);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't1';
+SELECT * FROM t1 ORDER BY a;
+TRUNCATE TABLE t1;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't1';
+INSERT INTO t1 VALUES (NULL), (NULL);
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/innodb/t/innodb-zip.test b/mysql-test/suite/innodb/t/innodb-zip.test
index 236579c83b8..e28b0862166 100644
--- a/mysql-test/suite/innodb/t/innodb-zip.test
+++ b/mysql-test/suite/innodb/t/innodb-zip.test
@@ -175,9 +175,7 @@ set innodb_strict_mode = on;
#Test different values of KEY_BLOCK_SIZE
---error ER_CANT_CREATE_TABLE
create table t1 (id int primary key) engine = innodb key_block_size = 0;
-show warnings;
--error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb key_block_size = 9;
@@ -198,7 +196,7 @@ create table t11(id int primary key) engine = innodb row_format = redundant;
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
-drop table t3, t4, t5, t6, t7, t8, t9, t10, t11;
+drop table t1, t3, t4, t5, t6, t7, t8, t9, t10, t11;
#test different values of ROW_FORMAT with KEY_BLOCK_SIZE
create table t1 (id int primary key) engine = innodb
@@ -219,14 +217,12 @@ create table t4 (id int primary key) engine = innodb
key_block_size = 8 row_format = dynamic;
show warnings;
---error ER_CANT_CREATE_TABLE
create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default;
-show warnings;
SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
-drop table t1;
+drop table t1, t5;
#test multiple errors
--error ER_CANT_CREATE_TABLE
diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test
index d9cdedb13bf..1284f19b741 100644
--- a/mysql-test/suite/innodb/t/innodb.test
+++ b/mysql-test/suite/innodb/t/innodb.test
@@ -52,6 +52,15 @@ drop table if exists t1,t2,t3,t4;
drop database if exists mysqltest;
--enable_warnings
+# Bug#58912 InnoDB unnecessarily avoids update-in-place on column prefixes
+CREATE TABLE bug58912 (a BLOB, b TEXT, PRIMARY KEY(a(1))) ENGINE=InnoDB;
+INSERT INTO bug58912 VALUES(REPEAT('a',8000),REPEAT('b',8000));
+UPDATE bug58912 SET a=REPEAT('a',7999);
+# The above statements used to trigger a failure during purge when
+# Bug#55284 was fixed while Bug#58912 was not. Defer the DROP TABLE,
+# so that purge gets a chance to run (and a double free of the
+# off-page column can be detected, if one is to occur.)
+
#
# Small basic test with ignore
#
@@ -1474,11 +1483,6 @@ CREATE TABLE t1 (
id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id)
) ENGINE=InnoDB;
-CREATE TABLE t2 (
-id INTEGER NOT NULL,
-FOREIGN KEY (id) REFERENCES t1 (id)
-) ENGINE=InnoDB;
-
INSERT INTO t1 (id) VALUES (NULL);
SELECT * FROM t1;
TRUNCATE t1;
@@ -1491,7 +1495,7 @@ DELETE FROM t1;
TRUNCATE t1;
INSERT INTO t1 (id) VALUES (NULL);
SELECT * FROM t1;
-DROP TABLE t2, t1;
+DROP TABLE t1;
# Test that foreign keys in temporary tables are not accepted (bug #12084)
CREATE TABLE t1
@@ -1726,13 +1730,15 @@ update t2 set a=2;
update t3 set a=2;
-- error 1452
update t4 set a=2;
--- error 1451
+-- error ER_TRUNCATE_ILLEGAL_FK
truncate t1;
--- error 1451
+-- error ER_TRUNCATE_ILLEGAL_FK
truncate t3;
truncate t2;
truncate t4;
+-- error ER_TRUNCATE_ILLEGAL_FK
truncate t1;
+-- error ER_TRUNCATE_ILLEGAL_FK
truncate t3;
drop table t4,t3,t2,t1;
@@ -2554,6 +2560,9 @@ SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig;
-- enable_query_log
+# Clean up after the Bug#55284/Bug#58912 test case.
+DROP TABLE bug58912;
+
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
diff --git a/mysql-test/suite/innodb/t/innodb_bug30423.test b/mysql-test/suite/innodb/t/innodb_bug30423.test
new file mode 100644
index 00000000000..f2a3ee8d099
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug30423.test
@@ -0,0 +1,211 @@
+# Test for Bug #30423, InnoDBs treatment of NULL in index stats causes
+# bad "rows examined" estimates.
+# Implemented InnoDB system variable "innodb_stats_method" with
+# "nulls_equal" (default), "nulls_unequal", and "nulls_ignored" options.
+
+-- source include/have_innodb.inc
+
+let $innodb_stats_method_orig = `select @@innodb_stats_method`;
+
+# default setting for innodb_stats_method is "nulls_equal"
+set global innodb_stats_method = default;
+
+select @@innodb_stats_method;
+
+# create three tables, bug30243_1, bug30243_2 and bug30243_3.
+# The test scenario is adopted from original bug #30423 report.
+# table bug30243_1 and bug30243_3 have many NULL values
+
+-- disable_result_log
+-- disable_query_log
+
+DROP TABLE IF EXISTS bug30243_1;
+CREATE TABLE bug30243_1 (
+ org_id int(11) NOT NULL default '0',
+ UNIQUE KEY (org_id)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+LOCK TABLES bug30243_1 WRITE;
+INSERT INTO bug30243_1 VALUES (11),(15),(16),(17),(19),(20),(21),(23),(24),
+(25),(26),(27),(28),(29),(30),(31),(32),(33),(34),(35),(37),(38),(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);
+UNLOCK TABLES;
+
+DROP TABLE IF EXISTS bug30243_3;
+CREATE TABLE bug30243_3 (
+ org_id int(11) default NULL,
+ KEY (org_id)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+INSERT INTO bug30243_3 VALUES (NULL);
+
+begin;
+let $i=14;
+while ($i)
+{
+ INSERT INTO bug30243_3 SELECT NULL FROM bug30243_3;
+ dec $i;
+}
+
+INSERT INTO bug30243_3 VALUES (34),(34),(35),(56),(58),(62),(62),(64),(65),(66),(80),(135),(137),(138),(139),(140),(142),(143),(144),(145);
+commit;
+
+DROP TABLE IF EXISTS bug30243_2;
+CREATE TABLE bug30243_2 (
+ org_id int(11) default NULL,
+ KEY `contacts$org_id` (org_id)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+INSERT INTO bug30243_2 VALUES (NULL);
+
+begin;
+let $i=16;
+while ($i)
+{
+ INSERT INTO bug30243_2 SELECT NULL FROM bug30243_2;
+ dec $i;
+}
+
+INSERT INTO bug30243_2 VALUES (11),(15),(16),(17),(20),(21),(23),(24),(25),
+(26),(27),(28),(29),(30),(31),(32),(33),(34),(37),(38),(40),(41),(42),(43),
+(44),(45),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),
+(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),
+(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),
+(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),
+(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),
+(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(46),(48),
+(48),(50),(51),(52),(52),(53),(54),(55),(57),(60),(61),(62),(62),(62),(62),
+(62),(63),(64),(64),(65),(66),(66),(67),(68),(69),(70),(71),(72),(73),(74),
+(75),(76),(77),(78),(79),(80),(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),(133),(135),(135),(135),(135),
+(136),(136),(138),(138),(139),(139),(139),(140),(141),(141),(142),(143),
+(143),(145),(145);
+commit;
+
+
+-- enable_result_log
+-- enable_query_log
+
+# check tables's value
+select count(*) from bug30243_3 where org_id is not NULL;
+select count(*) from bug30243_3 where org_id is NULL;
+
+select count(*) from bug30243_2 where org_id is not NULL;
+select count(*) from bug30243_2 where org_id is NULL;
+
+select @@innodb_stats_method;
+
+analyze table bug30243_1;
+analyze table bug30243_2;
+analyze table bug30243_3;
+
+# Following query plan shows that we over estimate the rows per
+# unique value (since there are many NULLs).
+# Skip this query log since the stats estimate could vary from runs
+-- disable_query_log
+-- disable_result_log
+explain SELECT COUNT(*), 0
+ FROM bug30243_1 orgs
+ LEFT JOIN bug30243_3 sa_opportunities
+ ON orgs.org_id=sa_opportunities.org_id
+ LEFT JOIN bug30243_2 contacts
+ ON orgs.org_id=contacts.org_id ;
+-- enable_query_log
+-- enable_result_log
+
+# following set operation will fail
+#--error ER_WRONG_VALUE_FOR_VAR
+--error 1231
+set global innodb_stats_method = "NULL";
+
+set global innodb_stats_method = "nulls_ignored";
+
+select @@innodb_stats_method;
+
+# Regenerate the stats with "nulls_ignored" option
+
+analyze table bug30243_1;
+analyze table bug30243_2;
+analyze table bug30243_3;
+
+# Following query plan shows that we get the correct rows per
+# unique value (should be approximately 1 row per value)
+explain SELECT COUNT(*), 0
+ FROM bug30243_1 orgs
+ LEFT JOIN bug30243_3 sa_opportunities
+ ON orgs.org_id=sa_opportunities.org_id
+ LEFT JOIN bug30243_2 contacts
+ ON orgs.org_id=contacts.org_id ;
+
+select @@innodb_stats_method;
+
+# Try the "nulls_unequal" option
+set global innodb_stats_method = "nulls_unequal";
+
+select @@innodb_stats_method;
+
+analyze table bug30243_1;
+analyze table bug30243_2;
+analyze table bug30243_3;
+
+# Following query plan shows that we get the correct rows per
+# unique value (~1)
+explain SELECT COUNT(*), 0
+ FROM bug30243_1 orgs
+ LEFT JOIN bug30243_3 sa_opportunities
+ ON orgs.org_id=sa_opportunities.org_id
+ LEFT JOIN bug30243_2 contacts
+ ON orgs.org_id=contacts.org_id;
+
+
+# Create a table with all NULL values, make sure the stats calculation
+# does not crash with table of all NULL values
+-- disable_query_log
+CREATE TABLE table_bug30423 (
+ org_id int(11) default NULL,
+ KEY(org_id)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+INSERT INTO `table_bug30423` VALUES (NULL);
+
+begin;
+let $i=10;
+while ($i)
+{
+ INSERT INTO table_bug30423 SELECT NULL FROM table_bug30423;
+ dec $i;
+}
+commit;
+
+-- enable_query_log
+
+SELECT COUNT(*) FROM table_bug30423 WHERE org_id IS NULL;
+
+# calculate the statistics for the table for "nulls_ignored" and
+# "nulls_unequal" option
+set global innodb_stats_method = "nulls_unequal";
+analyze table table_bug30423;
+
+set global innodb_stats_method = "nulls_ignored";
+analyze table table_bug30423;
+
+
+eval set global innodb_stats_method = $innodb_stats_method_orig;
+
+drop table bug30243_2;
+
+drop table bug30243_1;
+
+drop table bug30243_3;
+
+drop table table_bug30423;
diff --git a/mysql-test/suite/innodb/t/innodb_bug42419.test b/mysql-test/suite/innodb/t/innodb_bug42419.test
index b3d732662e1..43e9ada96db 100644
--- a/mysql-test/suite/innodb/t/innodb_bug42419.test
+++ b/mysql-test/suite/innodb/t/innodb_bug42419.test
@@ -6,7 +6,7 @@
--source include/not_embedded.inc
let $innodb_lock_wait_timeout= query_get_value(SHOW VARIABLES LIKE 'innodb_lock_wait_timeout%', Value, 1);
-if (`SELECT $innodb_lock_wait_timeout < 10`)
+if ($innodb_lock_wait_timeout < 10)
{
--echo # innodb_lock_wait_timeout must be >= 10 seconds
--echo # so that this test can work all time fine on an overloaded testing box
diff --git a/mysql-test/suite/innodb/t/innodb_bug53046.test b/mysql-test/suite/innodb/t/innodb_bug53046.test
new file mode 100644
index 00000000000..77f0a638728
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug53046.test
@@ -0,0 +1,48 @@
+#
+# http://bugs.mysql.com/53046
+# dict_update_statistics_low can still be run concurrently on same table
+#
+# This is a symbolic test, it would not fail if the bug is present.
+# Rather those SQL commands have been used during manual testing under
+# UNIV_DEBUG & UNIV_SYNC_DEBUG to test all changed codepaths for locking
+# correctness.
+#
+
+-- source include/have_innodb.inc
+
+CREATE TABLE bug53046_1 (c1 INT PRIMARY KEY) ENGINE=INNODB;
+CREATE TABLE bug53046_2 (c2 INT PRIMARY KEY,
+ FOREIGN KEY (c2) REFERENCES bug53046_1(c1)
+ ON UPDATE CASCADE ON DELETE CASCADE) ENGINE=INNODB;
+
+INSERT INTO bug53046_1 VALUES (1);
+let $i = 5;
+while ($i) {
+ eval INSERT INTO bug53046_1 SELECT c1+(SELECT MAX(c1) FROM bug53046_1)
+ FROM bug53046_1;
+ dec $i;
+}
+
+INSERT INTO bug53046_2 VALUES (1), (2);
+
+# CREATE TABLE innodb_table_monitor (a int) ENGINE=INNODB;
+# wait more than 1 minute and observe the mysqld output
+# DROP TABLE innodb_table_monitor;
+
+ANALYZE TABLE bug53046_1;
+
+# this prints create time and other nondeterministic data
+-- disable_result_log
+SHOW TABLE STATUS LIKE 'bug53046_1';
+-- enable_result_log
+
+UPDATE bug53046_1 SET c1 = c1 - 1;
+
+DELETE FROM bug53046_1;
+
+INSERT INTO bug53046_1 VALUES (1);
+INSERT INTO bug53046_2 VALUES (1);
+TRUNCATE TABLE bug53046_2;
+
+DROP TABLE bug53046_2;
+DROP TABLE bug53046_1;
diff --git a/mysql-test/suite/innodb/t/innodb_bug53756-master.opt b/mysql-test/suite/innodb/t/innodb_bug53756-master.opt
new file mode 100644
index 00000000000..425fda95086
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug53756-master.opt
@@ -0,0 +1 @@
+--skip-stack-trace --skip-core-file
diff --git a/mysql-test/suite/innodb/t/innodb_bug53756.test b/mysql-test/suite/innodb/t/innodb_bug53756.test
new file mode 100644
index 00000000000..ae23e9d41a3
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug53756.test
@@ -0,0 +1,187 @@
+# This is the test case for bug #53756. Alter table operation could
+# leave a deleted record for the temp table (later renamed to the altered
+# table) in the SYS_TABLES secondary index, we should ignore this row and
+# find the first non-deleted row for the specified table_id when load table
+# metadata in the function dict_load_table_on_id() during crash recovery.
+
+#
+# innobackup needs to connect to the server. Not supported in embedded.
+--source include/not_embedded.inc
+#
+# This test case needs to crash the server. Needs a debug server.
+--source include/have_debug.inc
+#
+# Don't test this under valgrind, memory leaks will occur.
+--source include/not_valgrind.inc
+#
+# This test case needs InnoDB.
+-- source include/have_innodb.inc
+
+# Avoid CrashReporter popup on Mac
+--source include/not_crashrep.inc
+
+#
+# Precautionary clean up.
+#
+--disable_warnings
+DROP TABLE IF EXISTS bug_53756 ;
+--enable_warnings
+
+#
+# Create test data.
+#
+CREATE TABLE bug_53756 (pk INT, c1 INT) ENGINE=InnoDB;
+ALTER TABLE bug_53756 ADD PRIMARY KEY (pk);
+INSERT INTO bug_53756 VALUES(1, 11), (2, 22), (3, 33), (4, 44);
+
+--echo
+--echo # Select a less restrictive isolation level.
+# Don't use user variables. They won't survive server crash.
+--let $global_isolation= `SELECT @@global.tx_isolation`
+--let $session_isolation= `SELECT @@session.tx_isolation`
+SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+COMMIT;
+
+--echo
+--echo # Start a transaction in the default connection for isolation.
+START TRANSACTION;
+SELECT @@tx_isolation;
+SELECT * FROM bug_53756;
+
+--echo
+--echo # connection con1 deletes row 1
+--connect (con1,localhost,root,,)
+START TRANSACTION;
+SELECT @@tx_isolation;
+DELETE FROM bug_53756 WHERE pk=1;
+
+--echo
+--echo # connection con2 deletes row 2
+--connect (con2,localhost,root,,)
+START TRANSACTION;
+SELECT @@tx_isolation;
+DELETE FROM bug_53756 WHERE pk=2;
+
+--echo
+--echo # connection con3 updates row 3
+--connect (con3,localhost,root,,)
+START TRANSACTION;
+SELECT @@tx_isolation;
+UPDATE bug_53756 SET c1=77 WHERE pk=3;
+
+--echo
+--echo # connection con4 updates row 4
+--connect (con4,localhost,root,,)
+START TRANSACTION;
+SELECT @@tx_isolation;
+UPDATE bug_53756 SET c1=88 WHERE pk=4;
+
+--echo
+--echo # connection con5 inserts row 5
+--connect (con5,localhost,root,,)
+START TRANSACTION;
+SELECT @@tx_isolation;
+INSERT INTO bug_53756 VALUES(5, 55);
+
+--echo
+--echo # connection con6 inserts row 6
+--connect (con6,localhost,root,,)
+START TRANSACTION;
+SELECT @@tx_isolation;
+INSERT INTO bug_53756 VALUES(6, 66);
+
+--echo
+--echo # connection con1 commits.
+--connection con1
+COMMIT;
+
+--echo
+--echo # connection con3 commits.
+--connection con3
+COMMIT;
+
+--echo
+--echo # connection con4 rolls back.
+--connection con4
+ROLLBACK;
+
+--echo
+--echo # connection con6 rolls back.
+--connection con6
+ROLLBACK;
+
+--echo
+--echo # The connections 2 and 5 stay open.
+
+--echo
+--echo # connection default selects resulting data.
+--echo # Delete of row 1 was committed.
+--echo # Update of row 3 was committed.
+--echo # Due to isolation level read committed, these should be included.
+--echo # All other changes should not be included.
+--connection default
+SELECT * FROM bug_53756;
+
+--echo
+--echo # connection default
+--connection default
+--echo #
+--echo # Crash server.
+#
+# Write file to make mysql-test-run.pl expect the "crash", but don't start
+# it until it's told to
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+#
+START TRANSACTION;
+INSERT INTO bug_53756 VALUES (666,666);
+#
+# Request a crash on next execution of commit.
+SET SESSION debug="+d,crash_commit_before";
+#
+# Execute the statement that causes the crash.
+--error 2013
+COMMIT;
+--echo
+--echo #
+--echo # disconnect con1, con2, con3, con4, con5, con6.
+--disconnect con1
+--disconnect con2
+--disconnect con3
+--disconnect con4
+--disconnect con5
+--disconnect con6
+--echo #
+--echo # Restart server.
+#
+# Write file to make mysql-test-run.pl start up the server again
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+#
+# Turn on reconnect
+--enable_reconnect
+#
+# Call script that will poll the server waiting for it to be back online again
+--source include/wait_until_connected_again.inc
+#
+# Turn off reconnect again
+--disable_reconnect
+--echo
+
+--echo #
+--echo # Select recovered data.
+--echo # Delete of row 1 was committed.
+--echo # Update of row 3 was committed.
+--echo # These should be included.
+--echo # All other changes should not be included.
+--echo # Delete of row 2 and insert of row 5 should be rolled back
+SELECT * FROM bug_53756;
+
+--echo
+--echo # Clean up.
+DROP TABLE bug_53756;
+
+--disable_query_log
+eval SET GLOBAL tx_isolation= '$global_isolation';
+eval SET SESSION tx_isolation= '$session_isolation';
+--enable_query_log
+
diff --git a/mysql-test/suite/innodb/t/innodb_bug54679.test b/mysql-test/suite/innodb/t/innodb_bug54679.test
deleted file mode 100644
index b279e1eaf9f..00000000000
--- a/mysql-test/suite/innodb/t/innodb_bug54679.test
+++ /dev/null
@@ -1,100 +0,0 @@
-# Test Bug #54679 alter table causes compressed row_format to revert to compact
-
-
-let $file_format=`select @@innodb_file_format`;
-let $file_format_max=`select @@innodb_file_format_max`;
-let $file_per_table=`select @@innodb_file_per_table`;
-SET GLOBAL innodb_file_format='Barracuda';
-SET GLOBAL innodb_file_per_table=ON;
-SET innodb_strict_mode=ON;
-
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
-WHERE TABLE_NAME='bug54679';
-
-# The ROW_FORMAT of the table should be preserved when it is not specified
-# in ALTER TABLE.
-ALTER TABLE bug54679 ADD COLUMN b INT;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
-WHERE TABLE_NAME='bug54679';
-
-DROP TABLE bug54679;
-
-# Check that the ROW_FORMAT conversion to/from COMPRESSED works.
-
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
-WHERE TABLE_NAME='bug54679';
-
-# KEY_BLOCK_SIZE implies COMPRESSED.
-ALTER TABLE bug54679 KEY_BLOCK_SIZE=1;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
-WHERE TABLE_NAME='bug54679';
-
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-ALTER TABLE bug54679 ROW_FORMAT=REDUNDANT;
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
-SHOW WARNINGS;
-DROP TABLE bug54679;
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
-WHERE TABLE_NAME='bug54679';
-
-ALTER TABLE bug54679 KEY_BLOCK_SIZE=2;
-SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables
-WHERE TABLE_NAME='bug54679';
-
-# This prevents other than REDUNDANT or COMPACT ROW_FORMAT for new tables.
-SET GLOBAL innodb_file_format=Antelope;
-
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-ALTER TABLE bug54679 KEY_BLOCK_SIZE=4;
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
-SHOW WARNINGS;
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-ALTER TABLE bug54679 ROW_FORMAT=DYNAMIC;
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
-SHOW WARNINGS;
-DROP TABLE bug54679;
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
-SHOW WARNINGS;
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB;
-
-SET GLOBAL innodb_file_format=Barracuda;
-# This will prevent ROW_FORMAT=COMPRESSED, because the system tablespace
-# cannot be compressed.
-SET GLOBAL innodb_file_per_table=OFF;
-
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-ALTER TABLE bug54679 KEY_BLOCK_SIZE=4;
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
-SHOW WARNINGS;
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-ALTER TABLE bug54679 ROW_FORMAT=DYNAMIC;
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
-SHOW WARNINGS;
-DROP TABLE bug54679;
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
---replace_regex /'[^']*test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
-SHOW WARNINGS;
-SET GLOBAL innodb_file_per_table=ON;
-CREATE TABLE bug54679 (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-DROP TABLE bug54679;
-
-# restore original values, quietly so the test does not fail if those
-# defaults are changed
--- disable_query_log
-EVAL SET GLOBAL innodb_file_format=$file_format;
-EVAL SET GLOBAL innodb_file_format_max=$file_format_max;
-EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
--- enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_bug56143.test b/mysql-test/suite/innodb/t/innodb_bug56143.test
new file mode 100644
index 00000000000..c21de09892c
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug56143.test
@@ -0,0 +1,586 @@
+#
+# Bug#56143 too many foreign keys causes output of show create table to become invalid
+# http://bugs.mysql.com/56143
+#
+
+-- source include/have_innodb.inc
+
+-- disable_query_log
+-- disable_result_log
+
+if ($VALGRIND_TEST)
+{
+ call mtr.add_suppression("InnoDB: Warning: a long semaphore wait:");
+}
+
+SET foreign_key_checks=0;
+
+DROP TABLE IF EXISTS bug56143_1;
+DROP TABLE IF EXISTS bug56143_2;
+
+CREATE TABLE bug56143_1 (a INT, KEY(a)) ENGINE=INNODB;
+
+CREATE TABLE `bug56143_2` (
+ `a` int(11) DEFAULT NULL,
+ KEY `a` (`a`),
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa10` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa100` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa101` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa102` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa103` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa104` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa105` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa106` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa107` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa108` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa109` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa11` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa110` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa111` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa112` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa113` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa114` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa115` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa116` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa117` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa118` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa119` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa120` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa121` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa122` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa123` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa124` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa125` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa126` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa127` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa128` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa129` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa13` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa130` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa131` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa132` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa133` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa134` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa135` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa136` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa137` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa138` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa139` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa14` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa140` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa141` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa142` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa143` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa144` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa145` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa146` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa147` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa148` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa149` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa15` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa150` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa151` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa152` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa153` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa154` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa155` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa156` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa157` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa158` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa159` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa16` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa160` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa161` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa162` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa163` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa164` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa165` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa166` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa167` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa168` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa169` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa17` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa170` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa171` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa172` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa173` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa174` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa175` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa176` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa177` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa178` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa179` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa18` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa180` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa181` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa182` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa183` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa184` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa185` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa186` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa187` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa188` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa189` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa19` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa190` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa191` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa192` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa193` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa194` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa195` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa196` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa197` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa198` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa199` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa20` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa200` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa201` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa202` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa203` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa204` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa205` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa206` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa207` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa208` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa209` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa21` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa210` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa211` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa212` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa213` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa214` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa215` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa216` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa217` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa218` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa219` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa22` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa220` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa221` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa222` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa223` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa224` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa225` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa226` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa227` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa228` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa229` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa23` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa230` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa231` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa232` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa233` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa234` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa235` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa236` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa237` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa238` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa239` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa24` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa240` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa241` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa242` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa243` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa244` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa245` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa246` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa247` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa248` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa249` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa25` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa250` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa251` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa252` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa253` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa254` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa255` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa256` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa257` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa258` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa259` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa26` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa260` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa261` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa262` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa263` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa264` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa265` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa266` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa267` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa268` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa269` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa27` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa270` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa271` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa272` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa273` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa274` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa275` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa276` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa277` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa278` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa279` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa28` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa280` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa281` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa282` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa283` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa284` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa285` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa286` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa287` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa288` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa289` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa29` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa290` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa291` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa292` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa293` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa294` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa295` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa296` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa297` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa298` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa299` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa30` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa300` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa301` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa302` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa303` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa304` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa305` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa306` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa307` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa308` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa309` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa31` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa310` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa311` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa312` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa313` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa314` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa315` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa316` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa317` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa318` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa319` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa32` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa320` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa321` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa322` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa323` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa324` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa325` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa326` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa327` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa328` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa329` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa33` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa330` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa331` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa332` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa333` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa334` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa335` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa336` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa337` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa338` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa339` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa34` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa340` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa341` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa342` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa343` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa344` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa345` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa346` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa347` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa348` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa349` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa35` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa350` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa351` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa352` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa353` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa354` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa355` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa356` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa357` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa358` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa359` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa36` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa360` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa361` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa362` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa363` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa364` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa365` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa366` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa367` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa368` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa369` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa37` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa370` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa371` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa372` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa373` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa374` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa375` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa376` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa377` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa378` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa379` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa38` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa380` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa381` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa382` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa383` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa384` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa385` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa386` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa387` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa388` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa389` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa39` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa390` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa391` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa392` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa393` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa394` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa395` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa396` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa397` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa398` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa399` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa40` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa400` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa401` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa402` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa403` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa404` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa405` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa406` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa407` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa408` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa409` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa41` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa410` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa411` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa412` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa413` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa414` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa415` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa416` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa417` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa418` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa419` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa42` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa420` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa421` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa422` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa423` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa424` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa425` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa426` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa427` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa428` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa429` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa43` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa430` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa431` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa432` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa433` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa434` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa435` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa436` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa437` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa438` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa439` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa44` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa440` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa441` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa442` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa443` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa444` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa445` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa446` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa447` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa448` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa449` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa45` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa450` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa451` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa452` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa453` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa454` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa455` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa456` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa457` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa458` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa459` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa46` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa460` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa461` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa462` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa463` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa464` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa465` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa466` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa467` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa468` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa469` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa47` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa470` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa471` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa472` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa473` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa474` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa475` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa476` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa477` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa478` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa479` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa48` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa480` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa481` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa482` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa483` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa484` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa485` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa486` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa487` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa488` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa489` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa49` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa490` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa491` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa492` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa493` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa494` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa495` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa496` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa497` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa498` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa499` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa5` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa50` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa500` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa501` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa502` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa503` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa504` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa505` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa506` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa507` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa508` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa509` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa51` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa510` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa511` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa512` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa513` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa514` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa515` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa516` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa517` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa518` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa519` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa52` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa520` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa521` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa522` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa523` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa524` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa525` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa526` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa527` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa528` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa529` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa53` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa530` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa531` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa532` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa533` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa534` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa535` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa536` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa537` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa538` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa539` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa54` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa540` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa541` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa542` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa543` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa544` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa545` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa546` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa547` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa548` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa549` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa55` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa550` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa56` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa57` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa58` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa59` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa60` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa61` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa62` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa63` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa64` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa65` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa66` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa67` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa68` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa69` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa7` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa70` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa71` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa72` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa73` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa74` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa75` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa76` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa77` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa78` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa79` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa8` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa80` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa81` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa82` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa83` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa84` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa85` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa86` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa87` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa88` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa89` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa90` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa91` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa92` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa93` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa94` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa95` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa96` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa97` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa98` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL,
+ CONSTRAINT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa99` FOREIGN KEY (`a`) REFERENCES `bug56143_1` (`a`) ON UPDATE SET NULL
+) ENGINE=InnoDB;
+
+-- enable_query_log
+-- enable_result_log
+
+SHOW CREATE TABLE bug56143_2;
+
+-- disable_query_log
+-- disable_result_log
+DROP TABLE bug56143_1;
+DROP TABLE bug56143_2;
diff --git a/mysql-test/suite/innodb/t/innodb_bug56680.test b/mysql-test/suite/innodb/t/innodb_bug56680.test
new file mode 100644
index 00000000000..48723195141
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug56680.test
@@ -0,0 +1,142 @@
+#
+# Bug #56680 InnoDB may return wrong results from a case-insensitive index
+#
+-- source include/have_innodb.inc
+
+-- disable_query_log
+SET @tx_isolation_orig = @@tx_isolation;
+SET @innodb_file_per_table_orig = @@innodb_file_per_table;
+SET @innodb_file_format_orig = @@innodb_file_format;
+SET @innodb_file_format_max_orig = @@innodb_file_format_max;
+# The flag innodb_change_buffering_debug is only available in debug builds.
+# It instructs InnoDB to try to evict pages from the buffer pool when
+# change buffering is possible, so that the change buffer will be used
+# whenever possible.
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
+-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = 1;
+-- enable_query_log
+SET GLOBAL tx_isolation='REPEATABLE-READ';
+SET GLOBAL innodb_file_format=Barracuda;
+SET GLOBAL innodb_file_per_table=on;
+
+CREATE TABLE bug56680(
+ a INT AUTO_INCREMENT PRIMARY KEY,
+ b CHAR(1),
+ c INT,
+ INDEX(b))
+ENGINE=InnoDB;
+
+INSERT INTO bug56680 VALUES(0,'x',1);
+BEGIN;
+SELECT b FROM bug56680;
+
+connect (con1,localhost,root,,);
+connection con1;
+BEGIN;
+UPDATE bug56680 SET b='X';
+
+connection default;
+# This should return the last committed value 'x', but would return 'X'
+# due to a bug in row_search_for_mysql().
+SELECT b FROM bug56680;
+# This would always return the last committed value 'x'.
+SELECT * FROM bug56680;
+
+connection con1;
+ROLLBACK;
+disconnect con1;
+
+connection default;
+
+SELECT b FROM bug56680;
+
+# For the rest of this test, use the READ UNCOMMITTED isolation level
+# to see what exists in the secondary index.
+SET GLOBAL tx_isolation='READ-UNCOMMITTED';
+
+# Create enough rows for the table, so that the insert buffer will be
+# used for modifying the secondary index page. There must be multiple
+# index pages, because changes to the root page are never buffered.
+
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
+
+BEGIN;
+SELECT b FROM bug56680 LIMIT 2;
+
+connect (con1,localhost,root,,);
+connection con1;
+BEGIN;
+DELETE FROM bug56680 WHERE a=1;
+# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
+INSERT INTO bug56680 VALUES(1,'X',1);
+
+# This should force an insert buffer merge, and return 'X' in the first row.
+SELECT b FROM bug56680 LIMIT 3;
+
+connection default;
+SELECT b FROM bug56680 LIMIT 2;
+CHECK TABLE bug56680;
+
+connection con1;
+ROLLBACK;
+SELECT b FROM bug56680 LIMIT 2;
+CHECK TABLE bug56680;
+
+connection default;
+disconnect con1;
+
+SELECT b FROM bug56680 LIMIT 2;
+
+CREATE TABLE bug56680_2(
+ a INT AUTO_INCREMENT PRIMARY KEY,
+ b VARCHAR(2) CHARSET latin1 COLLATE latin1_german2_ci,
+ c INT,
+ INDEX(b))
+ENGINE=InnoDB;
+
+INSERT INTO bug56680_2 SELECT 0,_latin1 0xdf,c FROM bug56680;
+
+BEGIN;
+SELECT HEX(b) FROM bug56680_2 LIMIT 2;
+DELETE FROM bug56680_2 WHERE a=1;
+# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
+INSERT INTO bug56680_2 VALUES(1,'SS',1);
+
+# This should force an insert buffer merge, and return 'SS' in the first row.
+SELECT HEX(b) FROM bug56680_2 LIMIT 3;
+CHECK TABLE bug56680_2;
+
+# Test this with compressed tables.
+ALTER TABLE bug56680_2 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+
+SELECT HEX(b) FROM bug56680_2 LIMIT 2;
+DELETE FROM bug56680_2 WHERE a=1;
+# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
+INSERT INTO bug56680_2 VALUES(1,_latin1 0xdf,1);
+
+# This should force an insert buffer merge, and return 0xdf in the first row.
+SELECT HEX(b) FROM bug56680_2 LIMIT 3;
+CHECK TABLE bug56680_2;
+
+DROP TABLE bug56680_2;
+DROP TABLE bug56680;
+
+-- disable_query_log
+SET GLOBAL tx_isolation = @tx_isolation_orig;
+SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig;
+SET GLOBAL innodb_file_format = @innodb_file_format_orig;
+SET GLOBAL innodb_file_format_max = @innodb_file_format_max_orig;
+-- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
+SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_bug56716.test b/mysql-test/suite/innodb/t/innodb_bug56716.test
deleted file mode 100644
index c8e1ed83e38..00000000000
--- a/mysql-test/suite/innodb/t/innodb_bug56716.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# Bug #56716 InnoDB locks a record gap without locking the table
-#
-
-CREATE TABLE bug56716 (a INT PRIMARY KEY,b INT,c INT,INDEX(b)) ENGINE=InnoDB;
-
-SELECT * FROM bug56716 WHERE b<=42 ORDER BY b DESC FOR UPDATE;
-
-DROP TABLE bug56716;
diff --git a/mysql-test/suite/innodb/t/innodb_bug56947.test b/mysql-test/suite/innodb/t/innodb_bug56947.test
new file mode 100644
index 00000000000..e11f39b97a8
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug56947.test
@@ -0,0 +1,16 @@
+#
+# Bug #56947 valgrind reports a memory leak in innodb-plugin.innodb-index
+#
+-- source include/have_innodb.inc
+
+SET @old_innodb_file_per_table=@@innodb_file_per_table;
+# avoid a message about filed *.ibd file creation in the error log
+SET GLOBAL innodb_file_per_table=0;
+create table bug56947(a int not null) engine = innodb;
+CREATE TABLE `bug56947#1`(a int) ENGINE=InnoDB;
+--error 156
+alter table bug56947 add unique index (a);
+drop table `bug56947#1`;
+drop table bug56947;
+--disable_query_log
+SET GLOBAL innodb_file_per_table=@old_innodb_file_per_table;
diff --git a/mysql-test/suite/innodb/t/innodb_bug57252.test b/mysql-test/suite/innodb/t/innodb_bug57252.test
new file mode 100644
index 00000000000..04c3ed0cea7
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug57252.test
@@ -0,0 +1,46 @@
+#
+# Bug#57252 disabling innobase_stats_on_metadata disables ANALYZE
+# http://bugs.mysql.com/57252
+#
+
+-- source include/have_innodb.inc
+
+-- disable_query_log
+-- disable_result_log
+
+SET @innodb_stats_on_metadata_orig = @@innodb_stats_on_metadata;
+
+CREATE TABLE bug57252 (a INT, KEY akey (a)) ENGINE=INNODB;
+
+BEGIN;
+let $i = 10;
+while ($i) {
+ eval INSERT INTO bug57252 VALUES ($i);
+ dec $i;
+}
+COMMIT;
+
+-- enable_result_log
+
+SET GLOBAL innodb_stats_on_metadata=0;
+
+# this calls ::info() without HA_STATUS_CONST and so
+# index->stat_n_diff_key_vals[] is not copied to the mysql-visible
+# rec_per_key
+SELECT cardinality FROM information_schema.statistics
+WHERE table_name='bug57252' AND index_name='akey';
+
+# this calls ::info() with HA_STATUS_CONST and so
+# index->stat_n_diff_key_vals[] is copied to the mysql-visible
+# rec_per_key at the end; when the bug is present dict_update_statistics()
+# is not called beforehand and so index->stat_n_diff_key_vals[] contains
+# an outdated data and thus we get an outdated data in the result when the
+# bug is present
+ANALYZE TABLE bug57252;
+
+SELECT cardinality FROM information_schema.statistics
+WHERE table_name='bug57252' AND index_name='akey';
+
+DROP TABLE bug57252;
+
+SET GLOBAL innodb_stats_on_metadata = @innodb_stats_on_metadata_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_bug57255.test b/mysql-test/suite/innodb/t/innodb_bug57255.test
index 4f08a9b46bf..27e0a1af1a0 100644
--- a/mysql-test/suite/innodb/t/innodb_bug57255.test
+++ b/mysql-test/suite/innodb/t/innodb_bug57255.test
@@ -11,6 +11,7 @@ create table C(id int not null auto_increment primary key, f1 int not null, fore
insert into A values(1), (2);
--disable_query_log
+begin;
let $i=257;
while ($i)
{
@@ -23,6 +24,7 @@ while ($i)
insert into C(f1) values(2);
dec $i;
}
+commit;
--enable_query_log
# Following Deletes should not report error
diff --git a/mysql-test/suite/innodb/t/innodb_bug57904.test b/mysql-test/suite/innodb/t/innodb_bug57904.test
new file mode 100755
index 00000000000..1131e24844d
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug57904.test
@@ -0,0 +1,27 @@
+#
+# Bug #57904 Missing constraint from information schema REFERENTIAL_CONSTRAINTS table
+#
+-- source include/have_innodb.inc
+
+CREATE TABLE product (category INT NOT NULL, id INT NOT NULL,
+ price DECIMAL, PRIMARY KEY(category, id)) ENGINE=INNODB;
+CREATE TABLE customer (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
+CREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT,
+ product_category INT NOT NULL,
+ product_id INT NOT NULL,
+ customer_id INT NOT NULL,
+ PRIMARY KEY(no),
+ INDEX (product_category, product_id),
+ FOREIGN KEY (product_category, product_id)
+ REFERENCES product(category, id) ON UPDATE CASCADE ON DELETE RESTRICT,
+ INDEX (customer_id),
+ FOREIGN KEY (customer_id)
+ REFERENCES customer(id)
+ ) ENGINE=INNODB;
+
+query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
+
+DROP TABLE product_order;
+DROP TABLE product;
+DROP TABLE customer;
+
diff --git a/mysql-test/suite/innodb/t/innodb_bug59307.test b/mysql-test/suite/innodb/t/innodb_bug59307.test
new file mode 100644
index 00000000000..31841fa6018
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug59307.test
@@ -0,0 +1,32 @@
+-- source include/have_innodb.inc
+# Bug #59307 uninitialized value in rw_lock_set_writer_id_and_recursion_flag()
+# when Valgrind instrumentation (UNIV_DEBUG_VALGRIND) is not enabled
+
+CREATE TABLE t1 (
+ t1_int INT,
+ t1_time TIME
+) ENGINE=innodb;
+
+CREATE TABLE t2 (
+ t2_int int PRIMARY KEY,
+ t2_int2 INT
+) ENGINE=INNODB;
+
+INSERT INTO t2 VALUES ();
+INSERT INTO t1 VALUES ();
+
+SELECT *
+FROM t1 AS t1a
+WHERE NOT EXISTS
+ (SELECT *
+ FROM t1 AS t1b
+ WHERE t1b.t1_int NOT IN
+ (SELECT t2.t2_int
+ FROM t2
+ WHERE t1b.t1_time LIKE t1b.t1_int
+ OR t1b.t1_time <> t2.t2_int2
+ AND 6=7
+ )
+)
+;
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/innodb/t/innodb_bug59410.test b/mysql-test/suite/innodb/t/innodb_bug59410.test
new file mode 100644
index 00000000000..30bb0642679
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug59410.test
@@ -0,0 +1,24 @@
+#
+# Bug#59410 read uncommitted: unlock row could not find a 3 mode lock on the record
+#
+-- source include/have_innodb.inc
+
+# only interested that the following do not produce something like
+# InnoDB: Error: unlock row could not find a 2 mode lock on the record
+# in the error log
+
+create table `bug59410_1`(`a` int)engine=innodb;
+insert into `bug59410_1` values (1),(2),(3);
+select 1 from `bug59410_1` where `a` <> any (
+select 1 from `bug59410_1` where `a` <> 1 for update)
+for update;
+drop table bug59410_1;
+
+create table bug59410_2(`a` char(1),`b` int)engine=innodb;
+insert into bug59410_2 values('0',0);
+set transaction isolation level read uncommitted;
+start transaction;
+set @a=(select b from bug59410_2 where
+(select 1 from bug59410_2 where a group by @a=b)
+group by @a:=b);
+drop table bug59410_2;
diff --git a/mysql-test/suite/innodb/t/innodb_bug59641.test b/mysql-test/suite/innodb/t/innodb_bug59641.test
new file mode 100644
index 00000000000..b933abd1d14
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug59641.test
@@ -0,0 +1,68 @@
+# Bug #59641 Prepared XA transaction causes shutdown hang after a crash
+
+-- source include/not_embedded.inc
+-- source include/have_innodb.inc
+
+CREATE TABLE t(a INT PRIMARY KEY, b INT)ENGINE=InnoDB;
+INSERT INTO t VALUES(2,2),(4,4),(8,8),(16,16),(32,32);
+COMMIT;
+XA START '123';
+INSERT INTO t VALUES(1,1);
+XA END '123';
+XA PREPARE '123';
+
+CONNECT (con1,localhost,root,,);
+CONNECTION con1;
+
+XA START '456';
+INSERT INTO t VALUES(3,47),(5,67);
+UPDATE t SET b=2*b WHERE a BETWEEN 5 AND 8;
+XA END '456';
+XA PREPARE '456';
+
+CONNECT (con2,localhost,root,,);
+CONNECTION con2;
+
+XA START '789';
+UPDATE t SET b=4*a WHERE a=32;
+XA END '789';
+XA PREPARE '789';
+
+CONNECT (con3,localhost,root,,);
+CONNECTION con3;
+# The server would issue this warning on restart.
+call mtr.add_suppression("Found 3 prepared XA transactions");
+
+# Kill the server without sending a shutdown command
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- shutdown_server 0
+-- source include/wait_until_disconnected.inc
+
+# Restart the server.
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- enable_reconnect
+-- source include/wait_until_connected_again.inc
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t;
+COMMIT;
+
+# Shut down the server. This would hang because of the bug.
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- shutdown_server
+-- source include/wait_until_disconnected.inc
+
+# Restart the server.
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- enable_reconnect
+-- source include/wait_until_connected_again.inc
+
+SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+SELECT * FROM t;
+COMMIT;
+XA RECOVER;
+XA ROLLBACK '123';
+XA ROLLBACK '456';
+XA COMMIT '789';
+SELECT * FROM t;
+
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb/t/innodb_bug60049-master.opt b/mysql-test/suite/innodb/t/innodb_bug60049-master.opt
new file mode 100644
index 00000000000..22a5d4ed221
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug60049-master.opt
@@ -0,0 +1 @@
+--innodb_fast_shutdown=0
diff --git a/mysql-test/suite/innodb/t/innodb_bug60049.test b/mysql-test/suite/innodb/t/innodb_bug60049.test
new file mode 100644
index 00000000000..ec4e3b8de7e
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug60049.test
@@ -0,0 +1,39 @@
+# Bug #60049 Verify that purge leaves no garbage in unique secondary indexes
+# This test requires a fresh server start-up and a slow shutdown.
+# This was a suspected bug (not a bug).
+
+-- source include/not_embedded.inc
+-- source include/have_innodb.inc
+
+CREATE TABLE t(a INT)ENGINE=InnoDB;
+RENAME TABLE t TO u;
+DROP TABLE u;
+SELECT @@innodb_fast_shutdown;
+let $MYSQLD_DATADIR=`select @@datadir`;
+
+# Shut down the server
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- shutdown_server 30
+-- source include/wait_until_disconnected.inc
+
+# Check the tail of ID_IND (SYS_TABLES.ID)
+let IBDATA1=$MYSQLD_DATADIR/ibdata1;
+perl;
+my $file = $ENV{'IBDATA1'};
+open(FILE, "<$file") || die "Unable to open $file";
+# Read DICT_HDR_TABLE_IDS, the root page number of ID_IND (SYS_TABLES.ID).
+seek(FILE, 7*16384+38+36, 0) || die "Unable to seek $file";
+die unless read(FILE, $_, 4) == 4;
+my $sys_tables_id_root = unpack("N", $_);
+print "Last record of ID_IND root page ($sys_tables_id_root):\n";
+# This should be the last record in ID_IND. Dump it in hexadecimal.
+seek(FILE, $sys_tables_id_root*16384 + 152, 0) || die "Unable to seek $file";
+read(FILE, $_, 32) || die "Unable to read $file";
+close(FILE);
+print unpack("H*", $_), "\n";
+EOF
+
+# Restart the server.
+-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+-- enable_reconnect
+-- source include/wait_until_connected_again.inc
diff --git a/mysql-test/suite/innodb/t/innodb_bug60196-master.opt b/mysql-test/suite/innodb/t/innodb_bug60196-master.opt
new file mode 100755
index 00000000000..c0a1981fa7c
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug60196-master.opt
@@ -0,0 +1 @@
+--lower-case-table-names=2
diff --git a/mysql-test/suite/innodb/t/innodb_bug60196.test b/mysql-test/suite/innodb/t/innodb_bug60196.test
new file mode 100755
index 00000000000..ea85653f1af
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug60196.test
@@ -0,0 +1,157 @@
+# Bug#60196 - Setting lowercase_table_names to 2 on Windows causing
+# Foreign Key problems after an engine is restarted.
+
+# This test case needs InnoDB, a lowercase file system,
+# lower-case-table-names=2, and cannot use the embedded server
+# because it restarts the server.
+--source include/not_embedded.inc
+--source include/have_lowercase2.inc
+--source include/have_case_insensitive_file_system.inc
+--source include/have_innodb.inc
+
+#
+# Create test data.
+#
+CREATE TABLE Bug_60196_FK1 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE Bug_60196_FK2 (Primary_Key INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE Bug_60196 (
+ FK1_Key INT NOT NULL,
+ FK2_Key INT NOT NULL,
+ PRIMARY KEY (FK2_Key, FK1_Key),
+ KEY FK1_Key (FK1_Key),
+ KEY FK2_Key (FK2_Key),
+ CONSTRAINT FK_FK1 FOREIGN KEY (FK1_Key)
+ REFERENCES Bug_60196_FK1 (Primary_Key)
+ ON DELETE CASCADE
+ ON UPDATE CASCADE,
+ CONSTRAINT FK_FK2 FOREIGN KEY (FK2_Key)
+ REFERENCES Bug_60196_FK2 (Primary_Key)
+ ON DELETE CASCADE
+ ON UPDATE CASCADE
+) ENGINE=InnoDB;
+INSERT INTO Bug_60196_FK1 VALUES (1), (2), (3), (4), (5);
+INSERT INTO Bug_60196_FK2 VALUES (1), (2), (3), (4), (5);
+INSERT INTO Bug_60196 VALUES (1, 1);
+INSERT INTO Bug_60196 VALUES (1, 2);
+INSERT INTO Bug_60196 VALUES (1, 3);
+--error ER_NO_REFERENCED_ROW_2
+INSERT INTO Bug_60196 VALUES (1, 99);
+--error ER_NO_REFERENCED_ROW_2
+INSERT INTO Bug_60196 VALUES (99, 1);
+
+SELECT * FROM bug_60196_FK1;
+SELECT * FROM bug_60196_FK2;
+SELECT * FROM bug_60196;
+
+--echo # Stop server
+
+# Write file to make mysql-test-run.pl wait for the server to stop
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Send a shutdown request to the server
+-- shutdown_server 10
+
+# Call script that will poll the server waiting for it to disapear
+-- source include/wait_until_disconnected.inc
+
+--echo # Restart server.
+
+# Write file to make mysql-test-run.pl start up the server again
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Turn on reconnect
+--enable_reconnect
+
+# Call script that will poll the server waiting for it to be back online again
+--source include/wait_until_connected_again.inc
+
+# Turn off reconnect again
+--disable_reconnect
+
+--echo #
+--echo # Try to insert more to the example table with foreign keys.
+--echo # Bug60196 causes the foreign key file not to be found after
+--echo # the resstart above.
+--echo #
+SELECT * FROM Bug_60196;
+INSERT INTO Bug_60196 VALUES (2, 1);
+INSERT INTO Bug_60196 VALUES (2, 2);
+INSERT INTO Bug_60196 VALUES (2, 3);
+SELECT * FROM Bug_60196;
+
+--echo
+--echo # Clean up.
+DROP TABLE Bug_60196;
+DROP TABLE Bug_60196_FK1;
+DROP TABLE Bug_60196_FK2;
+
+
+# Bug#60309/12356829
+# MYSQL 5.5.9 FOR MAC OSX HAS BUG WITH FOREIGN KEY CONSTRAINTS
+# This testcase is different from that for Bug#60196 in that the
+# referenced table contains a secondary key. When the engine is
+# restarted, the referenced table is opened by the purge thread,
+# which does not notice that lower_case_table_names == 2.
+
+#
+# Create test data.
+#
+CREATE TABLE Bug_60309_FK (
+ ID INT PRIMARY KEY,
+ ID2 INT,
+ KEY K2(ID2)
+) ENGINE=InnoDB;
+CREATE TABLE Bug_60309 (
+ ID INT PRIMARY KEY,
+ FK_ID INT,
+ KEY (FK_ID),
+ CONSTRAINT FK FOREIGN KEY (FK_ID) REFERENCES Bug_60309_FK (ID)
+) ENGINE=InnoDB;
+
+INSERT INTO Bug_60309_FK (ID, ID2) VALUES (1, 1), (2, 2), (3, 3);
+INSERT INTO Bug_60309 VALUES (1, 1);
+--error ER_NO_REFERENCED_ROW_2
+INSERT INTO Bug_60309 VALUES (2, 99);
+
+SELECT * FROM Bug_60309_FK;
+SELECT * FROM Bug_60309;
+
+--echo # Stop server
+
+# Write file to make mysql-test-run.pl wait for the server to stop
+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Send a shutdown request to the server
+-- shutdown_server 10
+
+# Call script that will poll the server waiting for it to disapear
+-- source include/wait_until_disconnected.inc
+
+--echo # Restart server.
+
+# Write file to make mysql-test-run.pl start up the server again
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Turn on reconnect
+--enable_reconnect
+
+# Call script that will poll the server waiting for it to be back online again
+--source include/wait_until_connected_again.inc
+
+# Turn off reconnect again
+--disable_reconnect
+
+--echo #
+--echo # Try to insert more to the example table with foreign keys.
+--echo # Bug60309 causes the foreign key file not to be found after
+--echo # the resstart above.
+--echo #
+SELECT * FROM Bug_60309;
+INSERT INTO Bug_60309 VALUES (2, 2);
+INSERT INTO Bug_60309 VALUES (3, 3);
+SELECT * FROM Bug_60309;
+
+--echo
+--echo # Clean up.
+DROP TABLE Bug_60309;
+DROP TABLE Bug_60309_FK;
diff --git a/mysql-test/suite/innodb/t/innodb_index_large_prefix.test b/mysql-test/suite/innodb/t/innodb_index_large_prefix.test
new file mode 100644
index 00000000000..3ed8aa6e096
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_index_large_prefix.test
@@ -0,0 +1,271 @@
+# Testcase for worklog #5743: Lift the limit of index key prefixes
+
+--source include/have_innodb.inc
+
+let $innodb_file_format_orig=`select @@innodb_file_format`;
+let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
+let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
+let $innodb_large_prefix_orig=`select @@innodb_large_prefix`;
+
+set global innodb_file_format="Barracuda";
+set global innodb_file_per_table=1;
+set global innodb_large_prefix=1;
+
+# Create a table of DYNAMIC format, with a primary index of 1000 bytes in
+# size
+create table worklog5743(a TEXT not null, primary key (a(1000)))
+ROW_FORMAT=DYNAMIC, engine = innodb;
+
+# Do some insertion and update to excercise the external cache
+# code path
+insert into worklog5743 values(repeat("a", 20000));
+
+# default session, update the table
+update worklog5743 set a = (repeat("b", 16000));
+
+# Create a secondary index
+create index idx on worklog5743(a(2000));
+
+# Start a few sessions to do selections on table being updated in default
+# session, so it would rebuild the previous version from undo log.
+# 1) Default session: Initiate an update on the externally stored column
+# 2) Session con1: Select from table with repeated read
+# 3) Session con2: Select from table with read uncommitted
+# 4) Default session: rollback updates
+
+begin;
+update worklog5743 set a = (repeat("x", 17000));
+
+# Start a new session to select the column to force it build
+# an earlier version of the clustered index through undo log. So it should
+# just see the result of repeat("b", 16000)
+select @@session.tx_isolation;
+--connect (con1,localhost,root,,)
+select a = repeat("x", 17000) from worklog5743;
+select a = repeat("b", 16000) from worklog5743;
+
+# Start another session doing "read uncommitted" query, it
+# should see the uncommitted update
+--connect (con2,localhost,root,,)
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+select a = repeat("x", 17000) from worklog5743;
+
+# Roll back the transaction
+--connection default
+rollback;
+
+drop table worklog5743;
+
+# Create a table with only a secondary index has large prefix column
+create table worklog5743(a1 int, a2 TEXT not null)
+ROW_FORMAT=DYNAMIC, engine = innodb;
+
+create index idx on worklog5743(a1, a2(2000));
+
+insert into worklog5743 values(9, repeat("a", 10000));
+
+begin;
+
+update worklog5743 set a1 = 1000;
+
+# Do a select from another connection that would use the secondary index
+--connection con1
+select @@session.tx_isolation;
+explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
+select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
+
+# Do read uncommitted in another session, it would show there is no
+# row with a1 = 9
+--connection con2
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
+
+--connection default
+rollback;
+
+drop table worklog5743;
+
+# Create a table with a secondary index has small (50 bytes) prefix column
+create table worklog5743(a1 int, a2 TEXT not null)
+ROW_FORMAT=DYNAMIC, engine = innodb;
+
+create index idx on worklog5743(a1, a2(50));
+
+insert into worklog5743 values(9, repeat("a", 10000));
+
+begin;
+
+update worklog5743 set a1 = 1000;
+
+# Do a select from another connection that would use the secondary index
+--connection con1
+select @@session.tx_isolation;
+explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
+select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
+
+# Do read uncommitted in another session, it would show there is no
+# row with a1 = 9
+--connection con2
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
+
+--connection default
+rollback;
+
+drop table worklog5743;
+
+# Create a table of ROW_FORMAT=COMPRESSED format
+create table worklog5743_2(a1 int, a2 TEXT not null)
+ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
+
+create table worklog5743_4(a1 int, a2 TEXT not null)
+ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb;
+
+# The maximum overall index record (not prefix) length for this table
+# is page_zip_empty_size() / 2, which is 960. "Too big row" error (
+# HA_ERR_TO_BIG_ROW) will be printed if this limit is exceeded.
+# Considering other fields and their overhead, the maximum length
+# for column a2 is 940 or 941 depending on the zlib version used and
+# compressBound() value used in page_zip_empty_size() (please refer
+# to Bug #47495 for more detail).
+-- error 139
+create index idx1 on worklog5743_2(a1, a2(942));
+
+create index idx1 on worklog5743_2(a1, a2(940));
+
+# similarly, the maximum index record length for the table is
+# 1984. Considering other fields and their overhead, the
+# maximum length for column a2 is 1964 or 1965 (please refer
+# to Bug #47495 for more detail).
+-- error 139
+create index idx1 on worklog5743_4(a1, a2(1966));
+
+create index idx1 on worklog5743_4(a1, a2(1964));
+
+insert into worklog5743_2 values(9, repeat("a", 10000));
+insert into worklog5743_4 values(9, repeat("a", 10000));
+
+begin;
+
+update worklog5743_2 set a1 = 1000;
+update worklog5743_4 set a1 = 1000;
+
+# Do a select from another connection that would use the secondary index
+--connection con1
+select @@session.tx_isolation;
+explain select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
+select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
+select a1, a2 = repeat("a", 10000) from worklog5743_4 where a1 = 9;
+
+# Do read uncommitted in another session, it would show there is no
+# row with a1 = 9
+--connection con2
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9;
+select a1, a2 = repeat("a", 10000) from worklog5743_4 where a1 = 9;
+
+--connection default
+rollback;
+
+drop table worklog5743_2;
+drop table worklog5743_4;
+
+# Create a table with varchar column, and create index directly on this
+# large column (without prefix)
+create table worklog5743(a1 int, a2 varchar(3000))
+ROW_FORMAT=DYNAMIC, engine = innodb;
+
+# Create an index with large column without prefix
+create index idx on worklog5743(a1, a2);
+
+insert into worklog5743 values(9, repeat("a", 3000));
+
+begin;
+
+update worklog5743 set a1 = 1000;
+
+# Do a select from another connection that would use the secondary index
+--connection con1
+select @@session.tx_isolation;
+explain select a1 from worklog5743 where a1 = 9;
+select a1 from worklog5743 where a1 = 9;
+
+# Do read uncommitted, it would show there is no row with a1 = 9
+--connection con2
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+select a1 from worklog5743 where a1 = 9;
+
+--connection default
+rollback;
+
+drop table worklog5743;
+
+# Create a table with old format, and the limit is 768 bytes.
+-- error ER_INDEX_COLUMN_TOO_LONG
+create table worklog5743(a TEXT not null, primary key (a(1000)))
+engine = innodb;
+
+create table worklog5743(a TEXT) engine = innodb;
+
+# Excercise the column length check in ha_innobase::add_index()
+-- error ER_INDEX_COLUMN_TOO_LONG
+create index idx on worklog5743(a(1000));
+
+# This should be successful
+create index idx on worklog5743(a(725));
+
+# Perform some DMLs
+insert into worklog5743 values(repeat("a", 20000));
+
+begin;
+insert into worklog5743 values(repeat("b", 20000));
+update worklog5743 set a = (repeat("x", 25000));
+
+# Start a new session to select the table to force it build
+# an earlier version of the cluster index through undo log
+select @@session.tx_isolation;
+--connection con1
+select a = repeat("a", 20000) from worklog5743;
+
+--connection con2
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+select a = repeat("x", 25000) from worklog5743;
+
+--connection default
+rollback;
+
+drop table worklog5743;
+
+# Some border line test on the column length.
+# We have a limit of 3072 bytes for Barracuda table
+create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC, engine = innodb;
+
+# Length exceeds maximum supported key length, will auto-truncated to 3072
+create index idx on worklog5743(a(3073));
+
+create index idx2 on worklog5743(a(3072));
+
+show create table worklog5743;
+
+drop table worklog5743;
+
+# We have a limit of 767 bytes for Antelope table
+create table worklog5743(a TEXT not null) engine = innodb;
+
+-- error ER_INDEX_COLUMN_TOO_LONG
+create index idx on worklog5743(a(768));
+
+create index idx2 on worklog5743(a(767));
+
+drop table worklog5743;
+
+eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
+eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
+eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
+eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_information_schema.test b/mysql-test/suite/innodb/t/innodb_information_schema.test
index 934642dcb40..05fb67edf75 100644
--- a/mysql-test/suite/innodb/t/innodb_information_schema.test
+++ b/mysql-test/suite/innodb/t/innodb_information_schema.test
@@ -117,11 +117,29 @@ SELECT * FROM ```t'\"_str` WHERE c1 = '4' FOR UPDATE;
# executes before some of them, resulting in less than expected number
# of rows being selected from innodb_locks. If there is a bug and there
# are no 14 rows in innodb_locks then this test will fail with timeout.
-let $count = 14;
-let $table = INFORMATION_SCHEMA.INNODB_LOCKS;
--- source include/wait_until_rows_count.inc
-# the above enables the query log, re-disable it
--- disable_query_log
+# Notice that if we query INNODB_LOCKS more often than once per 0.1 sec
+# then its contents will never change because the cache from which it is
+# filled is updated only if it has not been read for 0.1 seconds. See
+# CACHE_MIN_IDLE_TIME_US in trx/trx0i_s.c.
+let $cnt=10;
+while ($cnt)
+{
+ let $success=`SELECT COUNT(*) = 14 FROM INFORMATION_SCHEMA.INNODB_LOCKS`;
+ if ($success)
+ {
+ let $cnt=0;
+ }
+ if (!$success)
+ {
+ real_sleep 0.2;
+ dec $cnt;
+ }
+}
+if (!$success)
+{
+ -- echo Timeout waiting for rows in INNODB_LOCKS to appear
+}
+
SELECT lock_mode, lock_type, lock_table, lock_index, lock_rec, lock_data
FROM INFORMATION_SCHEMA.INNODB_LOCKS ORDER BY lock_data;
diff --git a/mysql-test/suite/innodb/t/innodb_multi_update.test b/mysql-test/suite/innodb/t/innodb_multi_update.test
index 6393671d358..e15f7470960 100644
--- a/mysql-test/suite/innodb/t/innodb_multi_update.test
+++ b/mysql-test/suite/innodb/t/innodb_multi_update.test
@@ -26,3 +26,12 @@ select * from bug38999_1;
select * from bug38999_2;
drop table bug38999_1,bug38999_2;
+
+--echo #
+--echo # Bug#54475 improper error handling causes cascading crashing failures in innodb/ndb
+--echo #
+CREATE TABLE t1(f1 INT) ENGINE=INNODB;
+INSERT INTO t1 VALUES(1);
+--error ER_OPERAND_COLUMNS
+UPDATE (SELECT ((SELECT 1 FROM t1), 1) FROM t1 WHERE (SELECT 1 FROM t1)) x, (SELECT 1) AS d SET d.f1 = 1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_mysql.test b/mysql-test/suite/innodb/t/innodb_mysql.test
index ef43a192d52..2f983436177 100644
--- a/mysql-test/suite/innodb/t/innodb_mysql.test
+++ b/mysql-test/suite/innodb/t/innodb_mysql.test
@@ -154,14 +154,14 @@ INSERT INTO t2 VALUES (3,2);
SET AUTOCOMMIT = 0;
START TRANSACTION;
---error ER_ROW_IS_REFERENCED_2
+--error ER_TRUNCATE_ILLEGAL_FK
TRUNCATE TABLE t1;
SELECT * FROM t1;
COMMIT;
SELECT * FROM t1;
START TRANSACTION;
---error ER_ROW_IS_REFERENCED_2
+--error ER_TRUNCATE_ILLEGAL_FK
TRUNCATE TABLE t1;
SELECT * FROM t1;
ROLLBACK;
@@ -173,13 +173,14 @@ START TRANSACTION;
SELECT * FROM t1;
COMMIT;
---error ER_ROW_IS_REFERENCED_2
+--error ER_TRUNCATE_ILLEGAL_FK
TRUNCATE TABLE t1;
SELECT * FROM t1;
DELETE FROM t2 WHERE id = 3;
START TRANSACTION;
SELECT * FROM t1;
+--error ER_TRUNCATE_ILLEGAL_FK
TRUNCATE TABLE t1;
ROLLBACK;
SELECT * FROM t1;
@@ -278,9 +279,9 @@ SELECT * FROM t1 LEFT JOIN t3 ON t1.i=t3.i;
--echo ** error handling inside a row iteration.
--echo **
DROP TRIGGER trg;
-TRUNCATE TABLE t1;
-TRUNCATE TABLE t2;
-TRUNCATE TABLE t3;
+DELETE FROM t1;
+DELETE FROM t2;
+DELETE FROM t3;
INSERT INTO t1 VALUES (1),(2),(3),(4);
INSERT INTO t3 VALUES (1),(2),(3),(4);
@@ -307,9 +308,9 @@ DROP TRIGGER trg;
--echo **
--echo ** Induce an error midway through an AFTER-trigger
--echo **
-TRUNCATE TABLE t4;
-TRUNCATE TABLE t1;
-TRUNCATE TABLE t3;
+DELETE FROM t4;
+DELETE FROM t1;
+DELETE FROM t3;
INSERT INTO t1 VALUES (1),(2),(3),(4);
INSERT INTO t3 VALUES (1),(2),(3),(4);
delimiter ||;
@@ -839,6 +840,65 @@ CREATE INDEX b ON t1(a,b,c,d);
DROP TABLE t1;
--echo End of 5.1 tests
+--echo #
+
+--echo #
+--echo # Bug#55826: create table .. select crashes with when KILL_BAD_DATA
+--echo # is returned
+--echo #
+
+CREATE TABLE t1(a INT) ENGINE=innodb;
+INSERT INTO t1 VALUES (0);
+SET SQL_MODE='STRICT_ALL_TABLES';
+--error ER_TRUNCATED_WRONG_VALUE
+CREATE TABLE t2
+ SELECT LEAST((SELECT '' FROM t1),NOW()) FROM `t1`;
+DROP TABLE t1;
+SET SQL_MODE=DEFAULT;
+
+--echo #
+--echo # Bug#56862 Execution of a query that uses index merge returns a wrong result
+--echo #
+
+CREATE TABLE t1 (
+ pk int NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ a int,
+ b int,
+ INDEX idx(a))
+ENGINE=INNODB;
+
+INSERT INTO t1(a,b) VALUES
+ (11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
+ (3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
+ (6, 600), (18, 1800), (9, 900), (10, 1000), (7, 700),
+ (13, 1300), (15, 1500), (19, 1900), (16, 1600), (20, 2000);
+INSERT INTO t1(a,b) SELECT a+20, b+2000 FROM t1;
+INSERT INTO t1(a,b) SELECT a+40, b+4000 FROM t1;
+INSERT INTO t1(a,b) SELECT a+80, b+8000 FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t1 VALUES (1000000, 0, 0);
+
+SET SESSION sort_buffer_size = 1024*36;
+
+EXPLAIN
+SELECT COUNT(*) FROM
+ (SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
+ WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
+
+SELECT COUNT(*) FROM
+ (SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
+ WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
+
+SET SESSION sort_buffer_size = DEFAULT;
+
+DROP TABLE t1;
--echo #
--echo # Bug#668644: HAVING + ORDER BY
@@ -896,6 +956,28 @@ drop table t2, t1;
--echo #
+--echo # Test for bug #11762012 - "54553: INNODB ASSERTS IN HA_INNOBASE::
+--echo # UPDATE_ROW, TEMPORARY TABLE, TABLE LOCK".
+--echo #
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TEMPORARY TABLE t1 (c int) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1);
+LOCK TABLES t1 READ;
+--echo # Even though temporary table was locked for READ we
+--echo # still allow writes to it to be compatible with MyISAM.
+--echo # This is possible since due to fact that temporary tables
+--echo # are specific to connection and therefore locking for them
+--echo # is irrelevant.
+UPDATE t1 SET c = 5;
+UNLOCK TABLES;
+DROP TEMPORARY TABLE t1;
+
+--echo End of 5.1 tests
+
+
+--echo #
--echo # Bug#44613 SELECT statement inside FUNCTION takes a shared lock
--echo #
diff --git a/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test b/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
new file mode 100644
index 00000000000..2bc89bf05d2
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_prefix_index_liftedlimit.test
@@ -0,0 +1,1339 @@
+######## suite/innodb/t/innodb_prefix_index_liftedlimit.test ##########
+# #
+# Testcase for worklog WL#5743: Lift the limit of index key prefixes #
+# Accorrding to WL#5743 - prefix index limit is increased from 767 #
+# to 3072 for innodb. This change is applicable with Barracuda file #
+# format. #
+# All sub-test in this file focus on prefix index along with other #
+# operations #
+# #
+# #
+# Creation: #
+# 2011-05-19 Implemented this test as part of WL#5743 #
+# #
+######################################################################
+
+
+--source include/have_innodb.inc
+# Save innodb variables
+let $innodb_file_format_orig=`select @@innodb_file_format`;
+let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
+let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
+let $innodb_large_prefix_orig=`select @@innodb_large_prefix`;
+
+# Set Innodb file format as feature works for Barracuda file format
+set global innodb_file_format="Barracuda";
+set global innodb_file_per_table=1;
+set global innodb_large_prefix=1;
+
+-- disable_warnings
+DROP TABLE IF EXISTS worklog5743;
+-- enable_warnings
+#------------------------------------------------------------------------------
+# Prefix index with VARCHAR data type , primary/secondary index and DML ops
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+# check IS
+SELECT COLUMN_NAME,INDEX_NAME,SUB_PART,INDEX_TYPE FROM
+INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'worklog5743' ;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+
+#------------------------------------------------------------------------------
+# Prefix index with TEXT data type , primary/secondary index and DML ops
+CREATE TABLE worklog5743 (
+col_1_text TEXT (4000) , col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_text (3072));
+# check IS
+SELECT COLUMN_NAME,INDEX_NAME,SUB_PART,INDEX_TYPE FROM
+INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'worklog5743' ;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+#------------------------------------------------------------------------------
+# Prefix index with MEDIUMTEXT data type , primary/secondary index and DML ops
+CREATE TABLE worklog5743 (
+col_1_mediumtext MEDIUMTEXT , col_2_mediumtext MEDIUMTEXT ,
+PRIMARY KEY (col_1_mediumtext(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_mediumtext (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_mediumtext = REPEAT("a", 4000),col_2_mediumtext = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_mediumtext = REPEAT("c", 4000)
+WHERE col_1_mediumtext = REPEAT("a", 4000)
+AND col_2_mediumtext = REPEAT("o", 4000);
+SELECT col_1_mediumtext = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_mediumtext = REPEAT("c", 4000)
+AND col_2_mediumtext = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_mediumtext = REPEAT("b", 4000);
+SELECT col_1_mediumtext = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+
+#------------------------------------------------------------------------------
+# Prefix index with LONGTEXT data type , primary/secondary index and DML ops
+CREATE TABLE worklog5743 (
+col_1_longtext LONGTEXT , col_2_longtext LONGTEXT ,
+PRIMARY KEY (col_1_longtext(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_longtext (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_longtext = REPEAT("a", 4000) , col_2_longtext = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_longtext = REPEAT("c", 4000)
+WHERE col_1_longtext = REPEAT("a", 4000)
+AND col_2_longtext = REPEAT("o", 4000);
+SELECT col_1_longtext = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_longtext = REPEAT("c", 4000)
+AND col_2_longtext = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_longtext = REPEAT("b", 4000);
+SELECT col_1_longtext = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+
+#------------------------------------------------------------------------------
+# Prefix index with BLOB data type , primary/secondary index and DML ops
+CREATE TABLE worklog5743 (
+col_1_blob BLOB (4000) , col_2_blob BLOB (4000) ,
+PRIMARY KEY (col_1_blob(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_blob (3072));
+# check IS
+SELECT COLUMN_NAME,INDEX_NAME,SUB_PART,INDEX_TYPE FROM
+INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'worklog5743' ;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_blob = REPEAT("a", 4000) , col_2_blob = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_blob = REPEAT("c", 4000)
+WHERE col_1_blob = REPEAT("a", 4000) AND col_2_blob = REPEAT("o", 4000);
+SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_blob = REPEAT("c", 4000) AND col_2_blob = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_blob = REPEAT("b", 4000);
+SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+
+#------------------------------------------------------------------------------
+# Prefix index with MEDIUMBLOB data type , primary/secondary index and DML ops
+CREATE TABLE worklog5743 (
+col_1_mediumblob MEDIUMBLOB , col_2_mediumblob MEDIUMBLOB ,
+PRIMARY KEY (col_1_mediumblob(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_mediumblob (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_mediumblob = REPEAT("a", 4000),col_2_mediumblob = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_mediumblob = REPEAT("c", 4000)
+WHERE col_1_mediumblob = REPEAT("a", 4000)
+AND col_2_mediumblob = REPEAT("o", 4000);
+SELECT col_1_mediumblob = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_mediumblob = REPEAT("c", 4000)
+AND col_2_mediumblob = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_mediumblob = REPEAT("b", 4000);
+SELECT col_1_mediumblob = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+#------------------------------------------------------------------------------
+# Prefix index with LONGBLOB data type , primary/secondary index and DML ops
+CREATE TABLE worklog5743 (
+col_1_longblob LONGBLOB , col_2_longblob LONGBLOB ,
+PRIMARY KEY (col_1_longblob(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_longblob (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_longblob = REPEAT("a", 4000) , col_2_longblob = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_longblob = REPEAT("c", 4000)
+WHERE col_1_longblob = REPEAT("a", 4000)
+AND col_2_longblob = REPEAT("o", 4000);
+SELECT col_1_longblob = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_longblob = REPEAT("c", 4000)
+AND col_2_longblob = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_longblob = REPEAT("b", 4000);
+SELECT col_1_longblob = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+#------------------------------------------------------------------------------
+# Prefix index with VARBINARY data type , primary/secondary index and DML ops
+CREATE TABLE worklog5743 (
+col_1_varbinary VARBINARY (4000) , col_2_varbinary VARBINARY (4000) ,
+PRIMARY KEY (col_1_varbinary(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varbinary = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
+WHERE col_1_varbinary = REPEAT("a", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("b", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+#------------------------------------------------------------------------------
+# Prefix index with CHAR data type , composite index and DML ops
+CREATE TABLE worklog5743 (col_1_char CHAR (255) , col_2_char CHAR (255),
+col_3_char CHAR (255), col_4_char CHAR (255),col_5_char CHAR (255),
+col_6_char CHAR (255), col_7_char CHAR (255),col_8_char CHAR (255),
+col_9_char CHAR (255), col_10_char CHAR (255),col_11_char CHAR (255),
+col_12_char CHAR (255), col_13_char CHAR (255),col_14_char CHAR (255)
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 255) , REPEAT("o", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255)
+);
+# Create index with total prefix index length = 3072
+CREATE INDEX prefix_idx ON worklog5743(col_1_char(250),col_2_char(250),
+col_3_char(250),col_4_char(250),col_5_char(250),col_6_char(250),
+col_7_char(250),col_8_char(250),col_9_char(250),col_10_char(250),
+col_11_char(250),col_12_char(250),col_13_char(72)
+);
+INSERT INTO worklog5743 VALUES(REPEAT("b", 255) , REPEAT("p", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255)
+);
+SELECT col_1_char = REPEAT("a", 255) , col_2_char = REPEAT("o", 255) FROM worklog5743;
+UPDATE worklog5743 SET col_1_char = REPEAT("c", 255)
+WHERE col_1_char = REPEAT("a", 255) AND col_2_char = REPEAT("o", 255);
+SELECT col_1_char = REPEAT("c", 255) FROM worklog5743
+WHERE col_1_char = REPEAT("c", 255) AND col_2_char = REPEAT("o", 255);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 255) , REPEAT("o", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255)
+);
+DELETE FROM worklog5743 WHERE col_1_char = REPEAT("b", 255);
+SELECT col_1_char = REPEAT("c", 255) FROM worklog5743;
+DROP TABLE worklog5743;
+
+#------------------------------------------------------------------------------
+# Prefix index with BINARY data type , composite index and DML ops
+CREATE TABLE worklog5743 (col_1_binary BINARY (255) , col_2_binary BINARY (255),
+col_3_binary BINARY(255),col_4_binary BINARY (255),col_5_binary BINARY (255),
+col_6_binary BINARY(255),col_7_binary BINARY (255),col_8_binary BINARY (255),
+col_9_binary BINARY(255),col_10_binary BINARY (255),col_11_binary BINARY (255),
+col_12_binary BINARY(255),col_13_binary BINARY (255),col_14_binary BINARY (255)
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 255) , REPEAT("o", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255)
+);
+# Create index with total prefix index length = 3072
+CREATE INDEX prefix_idx ON worklog5743(col_1_binary (250),col_2_binary (250),
+col_3_binary (250),col_4_binary (250),col_5_binary (250),
+col_6_binary (250),col_7_binary (250),col_8_binary (250),
+col_9_binary (250),col_10_binary (250),col_11_binary (250),
+col_12_binary (250),col_13_binary (72)
+);
+INSERT INTO worklog5743 VALUES(REPEAT("b", 255) , REPEAT("p", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255)
+);
+SELECT col_1_binary = REPEAT("a", 255) , col_2_binary = REPEAT("o", 255) FROM worklog5743;
+UPDATE worklog5743 SET col_1_binary = REPEAT("c", 255)
+WHERE col_1_binary = REPEAT("a", 255)
+AND col_2_binary = REPEAT("o", 255);
+SELECT col_1_binary = REPEAT("c", 255) FROM worklog5743
+WHERE col_1_binary = REPEAT("c", 255)
+AND col_2_binary = REPEAT("o", 255);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 255) , REPEAT("o", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255),
+REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255)
+);
+DELETE FROM worklog5743 WHERE col_1_binary = REPEAT("b", 255);
+SELECT col_1_binary = REPEAT("c", 255) FROM worklog5743;
+DROP TABLE worklog5743;
+
+#------------------------------------------------------------------------------
+# Prefix index with VARCHAR data type , primary/seconday index , DML ops
+# and COMPRESSED row format. KEY_BLOCK_SIZE is varied as 2 , 4 , 8.
+
+# With KEY_BLOCK_SIZE = 2,prefix index limit comes around ~948 for following
+CREATE TABLE worklog5743_key2 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(948))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
+INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+#CREATE INDEX prefix_idx ON worklog5743_key2 (col_1_varchar (767));
+INSERT INTO worklog5743_key2 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743_key2;
+UPDATE worklog5743_key2 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743_key2
+WHERE col_2_varchar = REPEAT("o", 4000);
+INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key2 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743_key2;
+DROP TABLE worklog5743_key2;
+
+# With KEY_BLOCK_SIZE = 4,prefix index limit comes around ~1964 for following
+CREATE TABLE worklog5743_key4 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(1964))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb;
+INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+#CREATE INDEX prefix_idx ON worklog5743_key4 (col_1_varchar (767));
+INSERT INTO worklog5743_key4 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743_key4;
+UPDATE worklog5743_key4 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000)
+AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743_key4
+WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key4 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743_key4;
+DROP TABLE worklog5743_key4;
+
+# With KEY_BLOCK_SIZE = 8,prefix index limit comes around ~3072 for following
+CREATE TABLE worklog5743_key8 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(3072))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8, engine = innodb;
+INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+#CREATE INDEX prefix_idx ON worklog5743_key8 (col_1_varchar (767));
+INSERT INTO worklog5743_key8 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743_key8;
+UPDATE worklog5743_key8 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743_key8
+WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key8 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743_key8;
+DROP TABLE worklog5743_key8;
+
+# Prefix index with TEXT data type , primary/seconday index , DML ops
+# and COMPRESSED row format. KEY_BLOCK_SIZE is varied as 2 , 4 , 8.
+
+# With KEY_BLOCK_SIZE = 2,prefix index limit comes around ~948 for following
+CREATE TABLE worklog5743_key2 (
+col_1_text TEXT (4000) , col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(948))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
+INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+#CREATE INDEX prefix_idx ON worklog5743_key2 (col_1_text (767));
+INSERT INTO worklog5743_key2 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000)
+FROM worklog5743_key2;
+UPDATE worklog5743_key2 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("b", 3500) FROM worklog5743_key2
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key2 WHERE col_1_text = REPEAT("b", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743_key2;
+DROP TABLE worklog5743_key2;
+
+# With KEY_BLOCK_SIZE = 4,prefix index limit comes around ~1964 for following
+CREATE TABLE worklog5743_key4 (
+col_1_text TEXT (4000) , col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(1964))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb;
+INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+#CREATE INDEX prefix_idx ON worklog5743_key4 (col_1_text (767));
+INSERT INTO worklog5743_key4 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000)
+FROM worklog5743_key4;
+UPDATE worklog5743_key4 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("b", 3500) FROM worklog5743_key4
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key4 WHERE col_1_text = REPEAT("b", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743_key4;
+DROP TABLE worklog5743_key4;
+
+# With KEY_BLOCK_SIZE = 8,prefix index limit comes around ~3072 for following
+CREATE TABLE worklog5743_key8 (
+col_1_text TEXT (4000) , col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(3072))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8, engine = innodb;
+INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+#CREATE INDEX prefix_idx ON worklog5743_key8 (col_1_text (767));
+INSERT INTO worklog5743_key8 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000)
+FROM worklog5743_key8;
+UPDATE worklog5743_key8 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("b", 3500) FROM worklog5743_key8
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key8 WHERE col_1_text = REPEAT("b", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743_key8;
+DROP TABLE worklog5743_key8;
+
+# Prefix index with BLOB data type , primary/seconday index , DML ops
+# and COMPRESSED row format. KEY_BLOCK_SIZE is varied as 2 , 4 , 8.
+
+# With KEY_BLOCK_SIZE = 2,prefix index limit comes around ~948 for following
+CREATE TABLE worklog5743_key2 (
+col_1_blob BLOB (4000) , col_2_blob BLOB (4000) ,
+PRIMARY KEY (col_1_blob(948))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
+INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+#CREATE INDEX prefix_idx ON worklog5743_key2 (col_1_blob (767));
+INSERT INTO worklog5743_key2 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_blob = REPEAT("a", 4000) , col_2_blob = REPEAT("o", 4000)
+FROM worklog5743_key2;
+UPDATE worklog5743_key2 SET col_1_blob = REPEAT("c", 4000)
+WHERE col_1_blob = REPEAT("a", 4000) AND col_2_blob = REPEAT("o", 4000);
+SELECT col_1_blob = REPEAT("b", 3500) FROM worklog5743_key2
+WHERE col_1_blob = REPEAT("c", 4000) AND col_2_blob = REPEAT("o", 4000);
+INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key2 WHERE col_1_blob = REPEAT("b", 4000);
+SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743_key2;
+DROP TABLE worklog5743_key2;
+
+# With KEY_BLOCK_SIZE = 4,prefix index limit comes around ~1964 for following
+CREATE TABLE worklog5743_key4 (
+col_1_blob BLOB (4000) , col_2_blob BLOB (4000) ,
+PRIMARY KEY (col_1_blob(1964))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb;
+INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+#CREATE INDEX prefix_idx ON worklog5743_key4 (col_1_blob (767));
+INSERT INTO worklog5743_key4 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_blob = REPEAT("a", 4000) , col_2_blob = REPEAT("o", 4000)
+FROM worklog5743_key4;
+UPDATE worklog5743_key4 SET col_1_blob = REPEAT("c", 4000)
+WHERE col_1_blob = REPEAT("a", 4000) AND col_2_blob = REPEAT("o", 4000);
+SELECT col_1_blob = REPEAT("b", 3500) FROM worklog5743_key4
+WHERE col_1_blob = REPEAT("c", 4000) AND col_2_blob = REPEAT("o", 4000);
+INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key4 WHERE col_1_blob = REPEAT("b", 4000);
+SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743_key4;
+DROP TABLE worklog5743_key4;
+
+# With KEY_BLOCK_SIZE = 8,prefix index limit comes around ~3072 for following
+CREATE TABLE worklog5743_key8 (
+col_1_blob BLOB (4000) , col_2_blob BLOB (4000) ,
+PRIMARY KEY (col_1_blob(3072))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8, engine = innodb;
+INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+#CREATE INDEX prefix_idx ON worklog5743_key8 (col_1_blob (767));
+INSERT INTO worklog5743_key8 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_blob = REPEAT("a", 4000) , col_2_blob = REPEAT("o", 4000)
+FROM worklog5743_key8;
+UPDATE worklog5743_key8 SET col_1_blob = REPEAT("c", 4000)
+WHERE col_1_blob = REPEAT("a", 4000) AND col_2_blob = REPEAT("o", 4000);
+SELECT col_1_blob = REPEAT("b", 3500) FROM worklog5743_key8
+WHERE col_1_blob = REPEAT("c", 4000) AND col_2_blob = REPEAT("o", 4000);
+INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743_key8 WHERE col_1_blob = REPEAT("b", 4000);
+SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743_key8;
+DROP TABLE worklog5743_key8;
+
+
+#------------------------------------------------------------------------------
+# Create mutiple prefix index. We can not create prefix index length > 16K
+# as index is written in undo log page which of 16K size.
+# So we can create max 5 prefix index of length 3072 on table
+CREATE TABLE worklog5743 (
+col_1_varbinary VARBINARY (4000) , col_2_varchar VARCHAR (4000) ,
+col_3_text TEXT (4000), col_4_blob BLOB (4000),col_5_text TEXT (4000),
+col_6_varchar VARCHAR (4000), col_7_binary BINARY (255)
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+
+# Update hangs if we create following 5 indexes. Uncomment them once its fix
+# Bug#12547647 - UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
+#CREATE INDEX prefix_idx1 ON worklog5743(col_1_varbinary (3072));
+#CREATE INDEX prefix_idx2 ON worklog5743(col_2_varchar (3072));
+#CREATE INDEX prefix_idx3 ON worklog5743(col_3_text (3072));
+#CREATE INDEX prefix_idx4 ON worklog5743(col_4_blob (3072));
+#CREATE INDEX prefix_idx5 ON worklog5743(col_5_text (3072));
+
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
+WHERE col_1_varbinary = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("b", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+
+#------------------------------------------------------------------------------
+# Create mutiple prefix index. We can not create prefix index length > 16K as
+# we write in undo log page which of 16K size.
+# so we can create max 5 prefix index of length 3072 on table.
+# Similar to above case but with transactions
+CREATE TABLE worklog5743 (
+col_1_varbinary VARBINARY (4000) , col_2_varchar VARCHAR (4000) ,
+col_3_text TEXT (4000), col_4_blob BLOB (4000),col_5_text TEXT (4000),
+col_6_varchar VARCHAR (4000), col_7_binary BINARY (255)
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+
+
+# Update hangs if we create following 5 indexes. Uncomment them once its fix
+CREATE INDEX prefix_idx1 ON worklog5743(col_1_varbinary (3072));
+CREATE INDEX prefix_idx2 ON worklog5743(col_2_varchar (3072));
+CREATE INDEX prefix_idx3 ON worklog5743(col_3_text (3072));
+CREATE INDEX prefix_idx4 ON worklog5743(col_4_blob (3072));
+CREATE INDEX prefix_idx5 ON worklog5743(col_5_text (3072));
+
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+ROLLBACK;
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+COMMIT;
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+ROLLBACK;
+# Uncomment Update fater Bug#12547647 is fixed - UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
+# Bug#12547647 - UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
+#UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
+#WHERE col_1_varbinary = REPEAT("a", 4000)
+#AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("b", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+#------------------------------------------------------------------------------
+# Prefix index with utf8 charset
+# utf8 charcter takes 3 bytes in mysql so prefix index limit is 3072/3 = 1024
+CREATE TABLE worklog5743 (
+col_1_text TEXT (4000) CHARACTER SET 'utf8',
+col_2_text TEXT (4000) CHARACTER SET 'utf8',
+PRIMARY KEY (col_1_text(1024))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_text (1024));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000) FROM worklog5743;
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+# Prefix index with utf8 charset + varchar.
+# For varchar we also log the column itself as oppose of TEXT so it error
+# with limit 1024 due to overhead.
+-- error 1118
+CREATE TABLE worklog5743 (col_1_varchar VARCHAR (4000) CHARACTER SET 'utf8',
+col_2_varchar VARCHAR (4000) CHARACTER SET 'utf8' ,
+PRIMARY KEY (col_1_varchar(1024))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+
+#------------------------------------------------------------------------------
+# prefinx index on utf8 charset with transaction
+CREATE TABLE worklog5743 (
+col_1_varbinary VARBINARY (4000) ,
+col_2_varchar VARCHAR (4000) CHARACTER SET 'utf8',
+col_3_text TEXT (4000) CHARACTER SET 'utf8',
+col_4_blob BLOB (4000),col_5_text TEXT (4000),
+col_6_varchar VARCHAR (4000), col_7_binary BINARY (255)
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+
+
+CREATE INDEX prefix_idx2 ON worklog5743(col_2_varchar (500));
+CREATE INDEX prefix_idx3 ON worklog5743(col_3_text (500));
+
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+ROLLBACK;
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+COMMIT;
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+ROLLBACK;
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000)
+AND col_2_varchar = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000),
+REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000),
+REPEAT("a", 4000) , REPEAT("a", 255)
+);
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("b", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+
+#------------------------------------------------------------------------------
+# Prefix index with utf8 charset on TEXT data type with actual utf8 character
+# like "स" and "क"
+CREATE TABLE worklog5743 (
+col_1_text TEXT (4000) CHARACTER SET 'utf8',
+col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(1024))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("स", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_text (1024));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("स", 4000) , col_2_text = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_text = REPEAT("क", 4000)
+WHERE col_1_text = REPEAT("स", 4000) AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("क", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 4000);
+SELECT col_1_text = REPEAT("क", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+
+#------------------------------------------------------------------------------
+# Prefix index with transaction when 2 client are ruuning there transaction
+# in different sessions.With ISOLATION LEVEL as REPEATABLE READ and
+# READ UNCOMMITTED.
+CREATE TABLE worklog5743 (
+col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
+PRIMARY KEY (col_1_text(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 200) , REPEAT("o", 200));
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+
+--echo "In connection 1"
+--connect (con1,localhost,root,,)
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+
+
+--echo "In connection 2"
+--connect (con2,localhost,root,,)
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200));
+# Uncomment after Bug#12552164 - TRANSACTION CAN NOT SEE OLD VERSION ROWS THAT
+# BEING UPDATED
+#UPDATE worklog5743 SET col_1_varchar = REPEAT("d", 200) WHERE col_1_varchar =
+#REPEAT("a", 200) AND col_2_varchar = REPEAT("o", 200);
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+
+
+--echo "In connection 1"
+--connection con1
+select @@session.tx_isolation;
+SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+
+START TRANSACTION;
+
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+
+--echo "In connection 2"
+--connection con2
+COMMIT;
+# Wait for commit
+let $wait_condition=SELECT COUNT(*)=0 FROM information_schema.processlist
+WHERE info='COMMIT';
+--source include/wait_condition.inc
+
+--echo "In connection 1"
+--connection con1
+SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+COMMIT;
+
+--connection default
+DROP TABLE worklog5743;
+
+
+#------------------------------------------------------------------------------
+# Prefix index with transaction when 2 client are ruuning there transaction
+# in different sessions.With ISOLATION LEVEL as REPEATABLE READ and
+# READ UNCOMMITTED. Same as above case but con2 starts tnx before con1
+
+CREATE TABLE worklog5743 (
+col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
+PRIMARY KEY (col_1_text(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 200) , REPEAT("o", 200));
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+
+--echo "In connection 1"
+--connection con1
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+START TRANSACTION;
+
+
+--echo "In connection 2"
+--connection con2
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200));
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("a", 200);
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+COMMIT;
+# Wait for commit
+let $wait_condition=SELECT COUNT(*)=0 FROM information_schema.processlist
+WHERE info='COMMIT';
+--source include/wait_condition.inc
+
+
+--echo "In connection 1"
+--connection con1
+SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
+select @@session.tx_isolation;
+SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+
+SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+COMMIT;
+
+--connection default
+DROP TABLE worklog5743;
+
+#------------------------------------------------------------------------------
+
+# Prefix index with transaction when 2 client are ruuning there transaction
+# in different sessions.With ISOLATION LEVEL as REPEATABLE READ and
+# READ UNCOMMITTED. Same as above cases but with ROLLBACK
+
+CREATE TABLE worklog5743 (
+col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
+PRIMARY KEY (col_1_text(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 200) , REPEAT("o", 200));
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+
+--echo "In connection 1"
+--connection con1
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+START TRANSACTION;
+
+
+--echo "In connection 2"
+--connection con2
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200));
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("a", 200);
+SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+ROLLBACK;
+# Wait for rollback
+let $wait_condition=SELECT COUNT(*)=0 FROM information_schema.processlist
+WHERE info='COMMIT';
+--source include/wait_condition.inc
+
+
+--echo "In connection 1"
+--connection con1
+SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+COMMIT;
+
+--disconnect con1
+--disconnect con2
+
+--connection default
+DROP TABLE worklog5743;
+
+
+#------------------------------------------------------------------------------
+# Select queries on prefix index column as index will be used in queries.
+# Use few select functions , join condition , subqueries.
+
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000)
+AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varchar = REPEAT("c", 4000)
+AND col_2_varchar = REPEAT("o", 4000);
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743;
+
+# Select with Join
+SELECT tbl1.col_1_varchar = tbl2.col_1_varchar
+FROM worklog5743 tbl1 , worklog5743 tbl2
+WHERE tbl1.col_1_varchar = tbl2.col_1_varchar ;
+
+# Select in subquey
+SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1
+WHERE col_1_varchar IN (SELECT tbl2.col_1_varchar FROM worklog5743 tbl2) ;
+SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1
+WHERE col_1_varchar NOT IN (SELECT tbl2.col_1_varchar FROM worklog5743 tbl2) ;
+SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1 WHERE
+col_1_varchar IN (SELECT tbl2.col_1_varchar FROM worklog5743 tbl2)
+AND col_1_varchar = REPEAT("c", 4000);
+SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1
+WHERE col_1_varchar in (
+SELECT tbl2.col_1_varchar FROM worklog5743 tbl2
+WHERE tbl1.col_1_varchar != tbl2.col_1_varchar
+) ;
+SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1
+WHERE col_1_varchar in (
+SELECT tbl2.col_1_varchar FROM worklog5743 tbl2
+WHERE tbl1.col_1_varchar = tbl2.col_1_varchar
+) ;
+
+# function
+SELECT
+REVERSE(col_1_varchar) = REPEAT("c", 4000) ,
+REVERSE(REVERSE(col_1_varchar)) = REPEAT("c", 4000)
+FROM worklog5743;
+SELECT
+UPPER(col_1_varchar) = REPEAT("c", 4000) ,
+UPPER(col_1_varchar) = REPEAT("C", 4000) ,
+LOWER(UPPER(col_1_varchar)) = REPEAT("c", 4000)
+FROM worklog5743;
+SELECT
+col_1_varchar = REPEAT("c", 4000)
+FROM worklog5743 WHERE col_1_varchar like '%c__%';
+SELECT SUBSTRING(INSERT(col_1_varchar, 1, 4, 'kkkk'),1,10) FROM worklog5743 ;
+SELECT CONCAT(SUBSTRING(col_1_varchar,-5,3),'append') FROM worklog5743 ;
+
+
+DROP TABLE worklog5743;
+
+#------------------------------------------------------------------------------
+# Prefix index with NULL values
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) ,
+col_2_varchar VARCHAR (4000) ,
+UNIQUE INDEX (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743
+VALUES(concat(REPEAT("a", 2000),REPEAT("b", 1000),REPEAT("c", 1000)), REPEAT("o", 4000));
+INSERT INTO worklog5743
+VALUES(concat(REPEAT("a", 2000),REPEAT("b", 2000)), REPEAT("o", 4000));
+INSERT INTO worklog5743 VALUES(NULL,NULL);
+INSERT INTO worklog5743 VALUES(NULL,NULL);
+# check IS
+SELECT COLUMN_NAME,INDEX_NAME,SUB_PART,INDEX_TYPE
+FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'worklog5743' ;
+SELECT col_1_varchar FROM worklog5743 WHERE col_1_varchar IS NULL;
+SELECT col_1_varchar = concat(REPEAT("a", 2000),REPEAT("b", 2000))
+FROM worklog5743 WHERE col_1_varchar IS NOT NULL ORDER BY 1;
+
+
+DROP TABLE worklog5743;
+
+# -----------------------------------------------------------------------------
+# Try drop and add secondary prefix index
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(3072))) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+# Create index
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+# Drop index
+DROP INDEX prefix_idx ON worklog5743;
+
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+# Again add index
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+# -----------------------------------------------------------------------------
+
+# Try drop and add primary prefix index
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY `prefix_primary` (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+# Create index
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+# Drop index
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000)
+AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varchar = REPEAT("c", 4000)
+AND col_2_varchar = REPEAT("o", 4000);
+# Again add index
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_varchar(3072));
+
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+--error 1062
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+
+# -----------------------------------------------------------------------------
+
+# Try drop and add both (primary/secondary) prefix index
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY `prefix_primary` (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+# Create index
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+# Drop primary index
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+# Drop secondary index
+DROP INDEX prefix_idx ON worklog5743;
+
+SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000)
+WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000);
+# Again add index
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_varchar(3072));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+--error 1062
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 4000);
+SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743;
+DROP TABLE worklog5743;
+
+
+# -----------------------------------------------------------------------------
+# Drop index from differnt session
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR(4000) , col_2_varchar VARCHAR(4000) ,
+PRIMARY KEY (col_1_varchar (3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("c", 3500) , REPEAT("o", 3500));
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
+
+# Start new session
+--connect (con1,localhost,root,,)
+
+
+--echo " Switching to con1 connection For select "
+--connection con1
+SELECT col_1_varchar = REPEAT("c", 3500) , col_2_varchar = REPEAT("o", 3500)
+FROM worklog5743;
+
+--echo " Switching to default connection For DMLs "
+--connection default
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500));
+SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743
+WHERE col_2_varchar = REPEAT("o", 3500);
+COMMIT;
+
+--echo " Switching to con1 connection For Dropping index and some DMLs "
+--connection con1
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("k", 3500),REPEAT("p", 3500));
+# Drop primary index
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+UPDATE worklog5743 SET col_1_varchar = REPEAT("b", 3500)
+WHERE col_1_varchar = REPEAT("a", 3500)
+AND col_2_varchar = REPEAT("o", 3500);
+SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743
+WHERE col_2_varchar = REPEAT("o", 3500);
+
+--echo " Switching to default connection For DELETE "
+--connection default
+DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 3500);
+SELECT col_1_varchar = REPEAT("a", 3500) FROM worklog5743
+WHERE col_2_varchar = REPEAT("p", 3500);
+
+--echo " Switching to con1 connection to commit changes "
+--connection con1
+COMMIT;
+
+--echo " Switching to default connection to drop and end sub-test "
+--connection default
+DROP TABLE worklog5743;
+
+
+
+# -----------------------------------------------------------------------------
+# Create prefix index with length < 3072 , length = 3072 , length > 3072
+# - varbinary data type + secondary index
+CREATE TABLE worklog5743 (
+col_1_varbinary VARBINARY (4000) , col_2_varbinary VARBINARY (4000) ,
+PRIMARY KEY (col_1_varbinary(3072))) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+# Create index of 3072
+CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varbinary = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
+WHERE col_1_varbinary = REPEAT("a", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("c", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+# Drop index
+DROP INDEX prefix_idx ON worklog5743;
+SELECT col_1_varbinary = REPEAT("b", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("b", 4000)
+AND col_2_varbinary = REPEAT("p", 4000);
+
+
+# Again add index length < 3072
+CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (2000));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_varbinary = REPEAT("a", 4000) FROM worklog5743;
+UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
+WHERE col_1_varbinary = REPEAT("a", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("c", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+# Drop index
+DROP INDEX prefix_idx ON worklog5743;
+
+# Again add index length > 3072.
+# If "innodb_large_prefix" is turned on, than the index prefix larger than 3072
+# will be truncated to 3072. If the table is REDUNDANT and COMPACT, which does
+# not support prefix > 767, the create index will be rejected.
+CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (4000));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_varbinary = REPEAT("a", 4000) FROM worklog5743;
+UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000)
+WHERE col_1_varbinary = REPEAT("a", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("c", 4000);
+SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_varbinary = REPEAT("c", 4000)
+AND col_2_varbinary = REPEAT("o", 4000);
+
+
+DROP TABLE worklog5743;
+
+# -----------------------------------------------------------------------------
+# Create prefix index with length < 3072 , length = 3072 , length > 3072
+# text data type + secondary index
+CREATE TABLE worklog5743 (col_1_text TEXT (4000) , col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(500))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+# Create index of 3072
+CREATE INDEX prefix_idx ON worklog5743(col_1_text (3072));
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000)
+FROM worklog5743;
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000)
+AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+# Drop index
+DROP INDEX prefix_idx ON worklog5743;
+SELECT col_1_text = REPEAT("b", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("b", 4000) AND col_2_text = REPEAT("p", 4000);
+
+# Again add index length < 3072
+CREATE INDEX prefix_idx ON worklog5743(col_1_text (1000));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_text = REPEAT("a", 4000) FROM worklog5743;
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+# Drop index
+DROP INDEX prefix_idx ON worklog5743;
+
+# Again add index length > 3072. Expect error.Length exceeds maximum supported
+# key length
+# Again add index length > 3072.
+# If "innodb_large_prefix" is turned on, than the index prefix larger than 3072
+# will be truncated to 3072. If the table is REDUNDANT and COMPACT, which does
+# not support prefix > 767, the create index will be rejected.
+CREATE INDEX prefix_idx ON worklog5743(col_1_text (4000));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_text = REPEAT("a", 4000) FROM worklog5743;
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000);
+
+DROP TABLE worklog5743;
+
+
+# -----------------------------------------------------------------------------
+# Create prefix index with length < 948 , length = 948 , length > 948
+# For compressed row type + primary key
+CREATE TABLE worklog5743 (
+col_1_text TEXT (4000) , col_2_text TEXT (4000) ,
+PRIMARY KEY (col_1_text(948))
+) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000));
+# Create index of 767
+INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000));
+SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000) FROM worklog5743;
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000)
+AND col_2_text = REPEAT("o", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000)
+AND col_2_text = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000)
+AND col_2_text = REPEAT("o", 4000);
+# Drop index
+#DROP INDEX prefix_idx ON worklog5743;
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+SELECT col_1_text = REPEAT("b", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("b", 4000)
+AND col_2_text = REPEAT("p", 4000);
+
+# Again add index length < 767
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_text (700));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_text = REPEAT("a", 4000) FROM worklog5743;
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000)
+AND col_2_text = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000)
+AND col_2_text = REPEAT("o", 4000);
+# Drop index
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+
+# Again add index length > 948. Expect error 'to big row ' due to exceed
+# in key length.
+-- error 139
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_text (950));
+INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000));
+SELECT col_1_text = REPEAT("a", 4000) FROM worklog5743;
+UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000)
+WHERE col_1_text = REPEAT("a", 4000)
+AND col_2_text = REPEAT("o", 4000);
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000);
+SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743
+WHERE col_1_text = REPEAT("c", 4000)
+AND col_2_text = REPEAT("o", 4000);
+
+DROP TABLE worklog5743;
+
+# -----------------------------------------------------------------------------
+# Create prefix index with length < 3072 , length = 3072 , length > 3072
+# data types VARCHAR
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , PRIMARY KEY (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_varchar (900));
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+# Again add index length > 3072. Expect error.Length exceeds maximum supported
+# key length
+# Again add index length > 3072.
+# If "innodb_large_prefix" is turned on, than the index prefix larger than 3072
+# will be truncated to 3072. If the table is REDUNDANT and COMPACT, which does
+# not support prefix > 767, the create index will be rejected.
+# Index length is truncated only for 'create index' , but error if we add
+# prefix index with length > 3072
+--error ER_TOO_LONG_KEY
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_varchar (3073));
+DROP TABLE worklog5743;
+
+
+CREATE TABLE worklog5743 (
+col_1_BLOB BLOB (4000) , PRIMARY KEY (col_1_BLOB(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_BLOB (500));
+ALTER TABLE worklog5743 DROP PRIMARY KEY;
+# Negative case
+# Again add index length > 3072. Expect error.Length exceeds maximum supported
+# key length
+# Index length is truncated only for 'create index' , but error if we add
+# prefix index with length > 3072
+--error ER_TOO_LONG_KEY
+ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_BLOB (3073));
+
+DROP TABLE worklog5743;
+
+# -----------------------------------------------------------------------------
+# Error on adding larger prefix if violates unique index.
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000)
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743
+VALUES(concat(REPEAT("a", 2000),REPEAT("b", 1000),REPEAT("c", 1000)),
+REPEAT("o", 4000));
+INSERT INTO worklog5743
+VALUES(concat(REPEAT("a", 2000),REPEAT("b", 2000)), REPEAT("o", 4000));
+--error 1062
+ALTER TABLE worklog5743 ADD PRIMARY KEY `pk_idx` (col_1_varchar(3000));
+DROP TABLE worklog5743;
+
+# -----------------------------------------------------------------------------
+set global innodb_large_prefix=0;
+# Prefix index > 767 is allowed if innodb_large_prefix is set to 1
+--error ER_TOO_LONG_KEY
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+
+
+# -----------------------------------------------------------------------------
+set global innodb_large_prefix=0;
+# Backward compatibility test - Index lenghth > 767 is truncated for REDUNDANT
+# and COMPACT
+CREATE TABLE worklog5743 (
+col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
+PRIMARY KEY (col_1_varchar(767))
+) engine = innodb;
+# Prefix index > 767 is truncated with REDUNDANT and COMPACT
+CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (1000));
+DROP TABLE worklog5743;
+#------------------------------------------------------------------------------
+
+eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
+eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
+eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
+eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test b/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
new file mode 100644
index 00000000000..587e6fe1f6b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
@@ -0,0 +1,127 @@
+######## suite/innodb/t/innodb_prefix_iindex_restart_server.test #####
+# #
+# Testcase for worklog WL#5743: Lift the limit of index key prefixes #
+# Test scenario : Stop the server in between when prefix index are #
+# created and see if state is preserved after restart #
+# #
+# Creation: #
+# 2011-06-02 Implemented this test as part of WL#5743 #
+# #
+######################################################################
+
+# Don't test this under valgrind, memory leaks will occur due restart
+--source include/not_valgrind.inc
+# Test restart the server and "shutdown_server" looks for pid file
+# which is not there with embedded mode
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+# Save innodb variables
+let $innodb_file_format_orig=`select @@innodb_file_format`;
+let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
+let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
+let $innodb_large_prefix_orig=`select @@innodb_large_prefix`;
+
+# Set Innodb file format as feature works for Barracuda file format
+set global innodb_file_format="Barracuda";
+set global innodb_file_per_table=1;
+set global innodb_large_prefix=1;
+
+-- disable_warnings
+DROP TABLE IF EXISTS worklog5743;
+-- enable_warnings
+
+
+#------------------------------------------------------------------------------
+# Stop the server in between when prefix index are created and see if state is
+# correct when server is restarted.
+# Server is restarted at differnt points.
+
+CREATE TABLE worklog5743 (
+col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
+PRIMARY KEY (col_1_text(3072))
+) ROW_FORMAT=DYNAMIC, engine = innodb;
+INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500));
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+
+--echo "In connection 1"
+--connect (con1,localhost,root,,)
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+
+
+--echo "In connection 2"
+--connect (con2,localhost,root,,)
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
+
+
+--echo "In connection 1"
+--connection con1
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+START TRANSACTION;
+
+
+--echo "In connection default ....restarting the server"
+--connection default
+# Restart the server
+-- source include/restart_mysqld.inc
+SELECT COUNT(*) FROM worklog5743;
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+
+--disconnect con1
+--disconnect con2
+
+--echo "In connection 1"
+--connect (con1,localhost,root,,)
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+START TRANSACTION;
+INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
+DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 3500);
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+
+--echo "In connection default ....restarting the server"
+--connection default
+# Restart the server
+-- source include/restart_mysqld.inc
+SELECT COUNT(*) FROM worklog5743;
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+
+--disconnect con1
+
+--echo "In connection 1"
+--connect (con2,localhost,root,,)
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+SELECT COUNT(*) FROM worklog5743;
+START TRANSACTION;
+UPDATE worklog5743 SET col_1_text = REPEAT("b", 3500) WHERE col_1_text = REPEAT("a", 3500);
+SELECT col_1_text = REPEAT("b", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+
+--echo "In connection default ....restarting the server"
+--connection default
+# Restart the server
+-- source include/restart_mysqld.inc
+SELECT COUNT(*) FROM worklog5743;
+SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
+worklog5743;
+
+DROP TABLE worklog5743;
+
+
+#------------------------------------------------------------------------------
+
+eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
+eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
+eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
+eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig;
+
diff --git a/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result b/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result
index 81de6e228e0..4dcc2e6295f 100644
--- a/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result
+++ b/mysql-test/suite/large_tests/r/rpl_slave_net_timeout.result
@@ -1,25 +1,20 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
set @save_general_log = @@global.general_log;
set @save_log_output = @@global.log_output;
set @save_slave_net_timeout = @@global.slave_net_timeout;
set @@global.general_log = ON;
set @@global.log_output = 'table,file';
include/stop_slave.inc
-set @@global.slave_net_timeout = @@global.net_read_timeout * 2;
change master to master_host = '127.0.0.1',master_port = MASTER_PORT,
master_user = 'root', master_heartbeat_period = 0;
+set @@global.slave_net_timeout = @@global.net_read_timeout * 2;
include/start_slave.inc
include/stop_slave.inc
select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time desc limit 1 into @ts_last;
select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time asc limit 1 into @ts_prev;
-select @result as 'Must be 1';
-Must be 1
-1
+include/assert.inc [time between last reconnection and the reconnection before that should be >= slave_net_timeout]
set @@global.general_log = @save_general_log;
set @@global.log_output = @save_log_output;
set @@global.slave_net_timeout = @save_slave_net_timeout;
+include/rpl_end.inc
diff --git a/mysql-test/suite/large_tests/t/lock_tables_big.test b/mysql-test/suite/large_tests/t/lock_tables_big.test
index 41dcff3577c..7fab19ac274 100644
--- a/mysql-test/suite/large_tests/t/lock_tables_big.test
+++ b/mysql-test/suite/large_tests/t/lock_tables_big.test
@@ -1,6 +1,16 @@
#
# Bug#24509 cannot use more than 2048 file descriptors on windows
#
+
+#
+# This test requires approximately 6000 of files to be open simultaneously.
+# Let us skip it on platforms where open files limit is too low.
+let $max_open_files_limit= `SELECT @@open_files_limit < 6100`;
+if ($max_open_files_limit)
+{
+ skip Need open_files_limit to be greater than 6100;
+}
+
--disable_query_log
create database many_tables;
use many_tables;
@@ -19,14 +29,14 @@ while ($i)
}
#lock all tables we just created (resembles mysqldump startup is doing with --all-databases operation)
-#There will be 3 descriptors for each table (table.FRM, table.MYI and table.MYD files) means 9000 files
+#There will be 2 descriptors for each table (table.MYI and table.MYD files) means 6000 files
#descriptors altogether. For Microsoft C runtime, this is way too many.
eval LOCK TABLES $table_list;
unlock tables;
drop database many_tables;
---disable_query_log
+--enable_query_log
--echo all done
diff --git a/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test b/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test
index 9a2cdc3b596..238146cdaaa 100644
--- a/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test
+++ b/mysql-test/suite/large_tests/t/rpl_slave_net_timeout.test
@@ -21,11 +21,6 @@ set @@global.log_output = 'table,file';
connection slave;
--source include/stop_slave.inc
---disable_warnings
-set @@global.slave_net_timeout = @@global.net_read_timeout * 2;
---enable_warnings
-let $idle_time=`select @@global.slave_net_timeout * 2`;
-
#
# if heartbeat is disabled then reconnecting to the idle master
# should happen with `slave_net_timeout' period.
@@ -42,6 +37,9 @@ let $idle_time=`select @@global.slave_net_timeout * 2`;
eval change master to master_host = '127.0.0.1',master_port = $MASTER_MYPORT,
master_user = 'root', master_heartbeat_period = 0;
+set @@global.slave_net_timeout = @@global.net_read_timeout * 2;
+let $idle_time=`select @@global.slave_net_timeout * 2`;
+
let $slave_net_timeout = `select @@global.slave_net_timeout`;
--source include/start_slave.inc
@@ -64,11 +62,9 @@ connection master;
select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time desc limit 1 into @ts_last;
select event_time from (select event_time from mysql.general_log as t_1 where command_type like 'Connect' order by event_time desc limit 2) as t_2 order by event_time asc limit 1 into @ts_prev;
---disable_query_log
-eval select time_to_sec(@ts_last) - $slave_net_timeout >= time_to_sec(@ts_prev) into @result;
---enable_query_log
-
-select @result as 'Must be 1';
+--let $assert_cond= time_to_sec(@ts_last) - time_to_sec(@ts_prev) >= $slave_net_timeout
+--let $assert_text= time between last reconnection and the reconnection before that should be >= slave_net_timeout
+--source include/assert.inc
# cleanup
@@ -79,3 +75,5 @@ set @@global.log_output = @save_log_output;
connection slave;
set @@global.slave_net_timeout = @save_slave_net_timeout;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/manual/t/rpl_replication_delay.test b/mysql-test/suite/manual/t/rpl_replication_delay.test
index fc1db9bfe18..f2b2da6f53c 100644
--- a/mysql-test/suite/manual/t/rpl_replication_delay.test
+++ b/mysql-test/suite/manual/t/rpl_replication_delay.test
@@ -7,9 +7,8 @@
source include/master-slave.inc;
-connection master;
-#connection slave;
-sync_slave_with_master;
+connection slave;
+
--echo # Second_behind reports 0
let $status_items= Seconds_Behind_Master;
source include/show_slave_status.inc;
@@ -61,9 +60,4 @@ unlock tables;
connection master;
drop table t1;
-#connection slave;
-sync_slave_with_master;
-
-
-# End of tests
-
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/ndb/my.cnf b/mysql-test/suite/ndb/my.cnf
deleted file mode 100644
index 37dfc3945ce..00000000000
--- a/mysql-test/suite/ndb/my.cnf
+++ /dev/null
@@ -1,22 +0,0 @@
-!include include/default_mysqld.cnf
-!include include/default_ndbd.cnf
-!include include/default_client.cnf
-
-[cluster_config.1]
-NoOfReplicas= 2
-ndbd=,
-ndb_mgmd=
-mysqld=,
-
-[mysqld]
-# Make all mysqlds use cluster
-ndbcluster
-
-[ENV]
-NDB_CONNECTSTRING= @mysql_cluster.1.ndb_connectstring
-MASTER_MYSOCK= @mysqld.1.1.socket
-MASTER_MYPORT= @mysqld.1.1.port
-MASTER_MYPORT1= @mysqld.2.1.port
-
-NDB_BACKUP_DIR= @cluster_config.ndbd.1.1.BackupDataDir
-
diff --git a/mysql-test/suite/ndb/r/loaddata_autocom_ndb.result b/mysql-test/suite/ndb/r/loaddata_autocom_ndb.result
deleted file mode 100644
index b4d0b0b81a7..00000000000
--- a/mysql-test/suite/ndb/r/loaddata_autocom_ndb.result
+++ /dev/null
@@ -1,23 +0,0 @@
-SET SESSION STORAGE_ENGINE = ndbcluster;
-drop table if exists t1;
-create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
-start transaction;
-load data infile 'LOAD_FILE' into table t1 fields terminated by ',' enclosed by '''' (a, b);
-Warnings:
-Warning 1261 Row 3 doesn't contain data for all columns
-commit;
-select count(*) from t1;
-count(*)
-4
-truncate table t1;
-start transaction;
-load data infile 'LOAD_FILE' into table t1 fields terminated by ',' enclosed by '''' (a, b);
-Warnings:
-Warning 1261 Row 3 doesn't contain data for all columns
-rollback;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-select count(*) from t1;
-count(*)
-4
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_alter_table.result b/mysql-test/suite/ndb/r/ndb_alter_table.result
deleted file mode 100644
index 35b983e1901..00000000000
--- a/mysql-test/suite/ndb/r/ndb_alter_table.result
+++ /dev/null
@@ -1,437 +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) engine=ndb;
-$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-PRIMARY KEY($PK) - UniqueHashIndex
-insert into t1 values (1),(2),(3);
-alter table t1 add primary key (a);
-a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-PRIMARY KEY(a) - UniqueHashIndex
-PRIMARY(a) - OrderedIndex
-update t1 set a = 17 where a = 1;
-select * from t1 order by a;
-a
-2
-3
-17
-alter table t1 drop primary key;
-$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-PRIMARY KEY($PK) - UniqueHashIndex
-update t1 set a = 1 where a = 17;
-select * from t1 order by a;
-a
-1
-2
-3
-drop table t1;
-create table t1(a int not null) engine=ndb;
-$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-PRIMARY KEY($PK) - UniqueHashIndex
-insert into t1 values (1),(2),(3);
-create unique index pk on t1(a);
-a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-PRIMARY KEY(a) - UniqueHashIndex
-update t1 set a = 17 where a = 1;
-select * from t1 order by a;
-a
-2
-3
-17
-alter table t1 drop index pk;
-$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-PRIMARY KEY($PK) - UniqueHashIndex
-update t1 set a = 1 where a = 17;
-select * from t1 order by a;
-a
-1
-2
-3
-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/suite/ndb/r/ndb_alter_table2.result b/mysql-test/suite/ndb/r/ndb_alter_table2.result
deleted file mode 100644
index 3783c76447c..00000000000
--- a/mysql-test/suite/ndb/r/ndb_alter_table2.result
+++ /dev/null
@@ -1,41 +0,0 @@
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-a INT NOT NULL PRIMARY KEY,
-b INT NOT NULL
-) ENGINE=ndbcluster;
-BEGIN;
-INSERT INTO t1 VALUES (9410,9412);
-BEGIN;
-INSERT INTO t1 VALUES (9411,9412);
-BEGIN;
-INSERT INTO t1 VALUES (9412,9412);
-BEGIN;
-INSERT INTO t1 VALUES (9413,9412);
-BEGIN;
-INSERT INTO t1 VALUES (9414,9412);
-BEGIN;
-INSERT INTO t1 VALUES (9415,9412);
-ROLLBACK;
-ROLLBACK;
-ROLLBACK;
-ROLLBACK;
-ROLLBACK;
-ROLLBACK;
-drop table t1;
-CREATE TABLE t1 (
-a INT NOT NULL PRIMARY KEY,
-b INT NOT NULL,
-c INT NOT NULL
-) ENGINE=ndbcluster;
-select * from t1;
-select * from t1;
-a b c
-select * from t1;
-a b c
-select * from t1;
-a b c
-select * from t1;
-a b c
-select * from t1;
-a b c
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_alter_table3.result b/mysql-test/suite/ndb/r/ndb_alter_table3.result
deleted file mode 100644
index bf80d95bf82..00000000000
--- a/mysql-test/suite/ndb/r/ndb_alter_table3.result
+++ /dev/null
@@ -1,35 +0,0 @@
-DROP TABLE IF EXISTS t1;
-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);
-show indexes from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t1 0 PRIMARY 1 a A 3 NULL NULL BTREE
-t1 1 b 1 b A 3 NULL NULL YES BTREE
-t1 1 c 1 c A 3 NULL NULL YES BTREE
-select * from t1 where c = 'two';
-a b c
-2 two two
-alter table t1 drop index c;
-show indexes from t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t1 0 PRIMARY 1 a A 3 NULL NULL BTREE
-t1 1 b 1 b A 3 NULL NULL YES BTREE
-select * from t1 where c = 'two';
-a b c
-2 two two
-drop table t1;
-create table t3 (a int primary key) engine=ndbcluster;
-begin;
-insert into t3 values (1);
-alter table t3 rename t4;
-commit;
-select * from t3;
-ERROR 42S02: Table 'test.t3' doesn't exist
-select * from t4;
-a
-1
-drop table t4;
-show tables;
-Tables_in_test
diff --git a/mysql-test/suite/ndb/r/ndb_auto_increment.result b/mysql-test/suite/ndb/r/ndb_auto_increment.result
deleted file mode 100644
index 9f16f1ae477..00000000000
--- a/mysql-test/suite/ndb/r/ndb_auto_increment.result
+++ /dev/null
@@ -1,445 +0,0 @@
-DROP TABLE IF EXISTS t1,t2;
-DROP TABLE IF EXISTS t1;
-set @old_auto_increment_offset = @@session.auto_increment_offset;
-set @old_auto_increment_increment = @@session.auto_increment_increment;
-set @old_ndb_autoincrement_prefetch_sz = @@session.ndb_autoincrement_prefetch_sz;
-flush status;
-create table t1 (a int not null auto_increment primary key) engine ndb;
-insert into t1 values (NULL);
-select * from t1 order by a;
-a
-1
-update t1 set a = 5 where a = 1;
-insert into t1 values (NULL);
-select * from t1 order by a;
-a
-5
-6
-insert into t1 values (7);
-insert into t1 values (NULL);
-select * from t1 order by a;
-a
-5
-6
-7
-8
-insert into t1 values (2);
-insert into t1 values (NULL);
-select * from t1 order by a;
-a
-2
-5
-6
-7
-8
-9
-update t1 set a = 4 where a = 2;
-insert into t1 values (NULL);
-select * from t1 order by a;
-a
-4
-5
-6
-7
-8
-9
-10
-delete from t1 where a = 10;
-insert into t1 values (NULL);
-select * from t1 order by a;
-a
-4
-5
-6
-7
-8
-9
-11
-replace t1 values (NULL);
-select * from t1 order by a;
-a
-4
-5
-6
-7
-8
-9
-11
-12
-replace t1 values (15);
-select * from t1 order by a;
-a
-4
-5
-6
-7
-8
-9
-11
-12
-15
-replace into t1 values (NULL);
-select * from t1 order by a;
-a
-4
-5
-6
-7
-8
-9
-11
-12
-15
-16
-replace t1 values (15);
-select * from t1 order by a;
-a
-4
-5
-6
-7
-8
-9
-11
-12
-15
-16
-insert ignore into t1 values (NULL);
-select * from t1 order by a;
-a
-4
-5
-6
-7
-8
-9
-11
-12
-15
-16
-17
-insert ignore into t1 values (15), (NULL);
-select * from t1 order by a;
-a
-4
-5
-6
-7
-8
-9
-11
-12
-15
-16
-17
-18
-insert into t1 values (15)
-on duplicate key update a = 20;
-insert into t1 values (NULL);
-select * from t1 order by a;
-a
-4
-5
-6
-7
-8
-9
-11
-12
-16
-17
-18
-20
-21
-insert into t1 values (NULL) on duplicate key update a = 30;
-select * from t1 order by a;
-a
-4
-5
-6
-7
-8
-9
-11
-12
-16
-17
-18
-20
-21
-22
-insert into t1 values (30) on duplicate key update a = 40;
-select * from t1 order by a;
-a
-4
-5
-6
-7
-8
-9
-11
-12
-16
-17
-18
-20
-21
-22
-30
-insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
-select * from t1 order by a;
-a
-4
-5
-6
-7
-8
-9
-11
-12
-16
-17
-18
-20
-21
-22
-30
-600
-601
-602
-610
-611
-drop table t1;
-create table t1 (a int not null primary key,
-b int not null unique auto_increment) engine ndb;
-insert into t1 values (1, NULL);
-insert into t1 values (3, NULL);
-update t1 set b = 3 where a = 3;
-insert into t1 values (4, NULL);
-select * from t1 order by a;
-a b
-1 1
-3 3
-4 4
-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;
-SET @@session.auto_increment_offset=1;
-SET @@session.auto_increment_increment=1;
-set ndb_autoincrement_prefetch_sz = 32;
-drop table if exists t1;
-SET @@session.auto_increment_offset=1;
-SET @@session.auto_increment_increment=1;
-set ndb_autoincrement_prefetch_sz = 32;
-create table t1 (a int not null auto_increment primary key) engine ndb;
-insert into t1 values (NULL);
-insert into t1 values (NULL);
-select * from t1 order by a;
-a
-1
-33
-insert into t1 values (20);
-insert into t1 values (NULL);
-select * from t1 order by a;
-a
-1
-20
-33
-34
-insert into t1 values (35);
-insert into t1 values (NULL);
-insert into t1 values (NULL);
-Got one of the listed errors
-select * from t1 order by a;
-a
-1
-20
-33
-34
-35
-65
-insert into t1 values (100);
-insert into t1 values (NULL);
-insert into t1 values (NULL);
-select * from t1 order by a;
-a
-1
-20
-33
-34
-35
-65
-66
-100
-101
-set auto_increment_offset = @old_auto_increment_offset;
-set auto_increment_increment = @old_auto_increment_increment;
-set ndb_autoincrement_prefetch_sz = @old_ndb_autoincrement_prefetch_sz;
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_autoinc.result b/mysql-test/suite/ndb/r/ndb_autoinc.result
deleted file mode 100644
index fe9d36393ad..00000000000
--- a/mysql-test/suite/ndb/r/ndb_autoinc.result
+++ /dev/null
@@ -1,37 +0,0 @@
-DROP TABLE IF EXISTS t1,t2,t3;
-USE test;
-CREATE TABLE t1 (
-id INT AUTO_INCREMENT,
-PRIMARY KEY(id)
-) ENGINE=NDBCLUSTER;
-CREATE TABLE t2 (
-id INT AUTO_INCREMENT,
-KEY(id)
-) ENGINE=NDBCLUSTER;
-ERROR HY000: Can't create table 'test.t2' (errno: 4335)
-SHOW TABLES;
-Tables_in_test
-t1
-CREATE TABLE t3 (
-id INT AUTO_INCREMENT,
-KEY(id)
-) ENGINE=MYISAM;
-ALTER TABLE t3
-ENGINE NDBCLUSTER;
-SHOW CREATE TABLE t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- KEY `id` (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-ALTER TABLE t3
-ADD PRIMARY KEY (id);
-SHOW CREATE TABLE t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`id`),
- KEY `id` (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-DROP TABLE t1, t3;
-End of 5.1 tests
diff --git a/mysql-test/suite/ndb/r/ndb_basic.result b/mysql-test/suite/ndb/r/ndb_basic.result
deleted file mode 100644
index 8cb86fb4c2b..00000000000
--- a/mysql-test/suite/ndb/r/ndb_basic.result
+++ /dev/null
@@ -1,930 +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;
-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_distribution #
-ndb_extra_logging #
-ndb_force_send #
-ndb_index_stat_cache_entries #
-ndb_index_stat_enable #
-ndb_index_stat_update_freq #
-ndb_mgmd_host #
-ndb_nodeid #
-ndb_optimized_node_selection #
-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 Index_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 Index_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
-MySQL error code 1186 (ER_FLUSH_MASTER_BINLOG_CLOSED): Binlog closed, cannot RESET MASTER
-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;
-create table t1 (a varchar(100) primary key, b varchar(100)) engine = NDB;
-insert into t1 values
-('a', 'a'),('b','b'),('c', 'c'),('aa', 'aa'),('bb', 'bb'),('cc', 'cc');
-replace into t1 values ('a', '-a');
-replace into t1 values ('b', '-b');
-replace into t1 values ('c', '-c');
-replace into t1 values ('aa', '-aa');
-replace into t1 values ('bb', '-bb');
-replace into t1 values ('cc', '-cc');
-replace into t1 values ('aaa', '-aaa');
-replace into t1 values ('bbb', '-bbb');
-replace into t1 values ('ccc', '-ccc');
-select * from t1 order by 1,2;
-a b
-a -a
-aa -aa
-aaa -aaa
-b -b
-bb -bb
-bbb -bbb
-c -c
-cc -cc
-ccc -ccc
-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;
-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
deleted file mode 100644
index 09edd78bdb3..00000000000
--- a/mysql-test/suite/ndb/r/ndb_binlog_basic.result
+++ /dev/null
@@ -1,48 +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();
-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/suite/ndb/r/ndb_binlog_ddl_multi.result b/mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result
deleted file mode 100644
index e3792f8272d..00000000000
--- a/mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result
+++ /dev/null
@@ -1,196 +0,0 @@
-drop database if exists mysqltest;
-drop table if exists t1,t2,t3;
-drop database if exists mysqltest;
-drop table if exists t1,t2,t3;
-reset master;
-reset master;
-create database mysqltest;
-use mysqltest;
-create table t1 (a int primary key) engine=ndb;
-create table t2 (a int primary key) engine=ndb;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 1 # create database mysqltest
-mysqld-bin.000001 # Query 1 # use `mysqltest`; create table t1 (a int primary key) engine=ndb
-mysqld-bin.000001 # Query 2 # use `test`; create table t2 (a int primary key) engine=ndb
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 1 # create database mysqltest
-mysqld-bin.000001 # Query 1 # use `mysqltest`; create table t1 (a int primary key) engine=ndb
-mysqld-bin.000001 # Query 2 # use `test`; create table t2 (a int primary key) engine=ndb
-reset master;
-reset master;
-alter table t2 add column (b int);
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 2 # use `test`; alter table t2 add column (b int)
-reset master;
-reset master;
-ALTER DATABASE mysqltest CHARACTER SET latin1;
-drop table mysqltest.t1;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 2 # ALTER DATABASE mysqltest CHARACTER SET latin1
-mysqld-bin.000001 # Query 2 # use `mysqltest`; drop table `t1`
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 2 # ALTER DATABASE mysqltest CHARACTER SET latin1
-mysqld-bin.000001 # Query 2 # use `mysqltest`; drop table `t1`
-reset master;
-reset master;
-use test;
-insert into t2 values (1,2);
-drop database mysqltest;
-create table t1 (a int primary key) engine=ndb;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 2 # BEGIN
-mysqld-bin.000001 # Table_map 2 # table_id: # (test.t2)
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 2 # table_id: #
-mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 2 # COMMIT
-mysqld-bin.000001 # Query 1 # drop database mysqltest
-mysqld-bin.000001 # Query 1 # use `test`; create table t1 (a int primary key) engine=ndb
-drop table t2;
-reset master;
-reset master;
-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;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 1 # CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB
-mysqld-bin.000001 # Query 1 # ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB
-mysqld-bin.000001 # Query 1 # CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB
-mysqld-bin.000001 # Query 1 # ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB
-mysqld-bin.000001 # Query 1 # ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE = NDB
-mysqld-bin.000001 # Query 1 # ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile02.dat'
-ENGINE = NDB
-mysqld-bin.000001 # Query 1 # DROP TABLESPACE ts1
-ENGINE = NDB
-mysqld-bin.000001 # Query 1 # DROP LOGFILE GROUP lg1
-ENGINE =NDB
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 1 # CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB
-mysqld-bin.000001 # Query 1 # ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB
-mysqld-bin.000001 # Query 1 # CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M
-ENGINE NDB
-mysqld-bin.000001 # Query 1 # ALTER TABLESPACE ts1
-ADD DATAFILE 'datafile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=NDB
-mysqld-bin.000001 # Query 1 # ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE = NDB
-mysqld-bin.000001 # Query 1 # ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile02.dat'
-ENGINE = NDB
-mysqld-bin.000001 # Query 1 # DROP TABLESPACE ts1
-ENGINE = NDB
-mysqld-bin.000001 # Query 1 # DROP LOGFILE GROUP lg1
-ENGINE =NDB
-drop table t1;
-reset master;
-show tables;
-Tables_in_test
-reset master;
-show tables;
-Tables_in_test
-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;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 1 # use `test`; create table t1 (a int key) engine=ndb
-mysqld-bin.000001 # Query 1 # use `test`; create table t2 (a int key) engine=ndb
-mysqld-bin.000001 # Query 1 # use `test`; create table t3 (a int key) engine=ndb
-mysqld-bin.000001 # Query 1 # use `test`; rename table `test.t3` to `test.t4`
-mysqld-bin.000001 # Query 1 # use `test`; rename table `test.t2` to `test.t3`
-mysqld-bin.000001 # Query 1 # use `test`; rename table `test.t1` to `test.t2`
-mysqld-bin.000001 # Query 1 # use `test`; rename table `test.t4` to `test.t1`
-drop table t1;
-drop table t2;
-drop table t3;
-reset master;
-show tables;
-Tables_in_test
-reset master;
-show tables;
-Tables_in_test
-create table t1 (a int key) engine=ndb;
-insert into t1 values(1);
-rename table t1 to t2;
-insert into t2 values(2);
-drop table t2;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 1 # use `test`; create table t1 (a int key) engine=ndb
-mysqld-bin.000001 # Query 2 # BEGIN
-mysqld-bin.000001 # Table_map 2 # table_id: # (test.t1)
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 2 # table_id: #
-mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 2 # COMMIT
-mysqld-bin.000001 # Query 1 # use `test`; rename table `test.t1` to `test.t2`
-mysqld-bin.000001 # Query 2 # BEGIN
-mysqld-bin.000001 # Table_map 2 # table_id: # (test.t2)
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 2 # table_id: #
-mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 2 # COMMIT
-mysqld-bin.000001 # Query 2 # use `test`; DROP TABLE `t2` /* generated by server */
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_discover.result b/mysql-test/suite/ndb/r/ndb_binlog_discover.result
deleted file mode 100644
index f8704971878..00000000000
--- a/mysql-test/suite/ndb/r/ndb_binlog_discover.result
+++ /dev/null
@@ -1,17 +0,0 @@
-drop table if exists t1;
-create table t1 (a int key) engine=ndb;
-reset master;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Incident 1 # #1 (LOST_EVENTS)
-mysqld-bin.000001 # Rotate 1 # mysqld-bin.000002;pos=4
-PURGE MASTER LOGS TO 'mysqld-bin.000002';
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000002 # Query 1 # BEGIN
-mysqld-bin.000002 # Table_map 1 # table_id: # (test.t1)
-mysqld-bin.000002 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000002 # Write_rows 1 # table_id: #
-mysqld-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
-mysqld-bin.000002 # Query 1 # COMMIT
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_format.result b/mysql-test/suite/ndb/r/ndb_binlog_format.result
deleted file mode 100644
index b6022b61746..00000000000
--- a/mysql-test/suite/ndb/r/ndb_binlog_format.result
+++ /dev/null
@@ -1,41 +0,0 @@
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-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;
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.
-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
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2)
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2)
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Query # # use `test`; UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Query # # use `test`; UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2)
-mysqld-bin.000001 # Query # # use `test`; UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f
-mysqld-bin.000001 # Query # # COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Table_map # # table_id: # (test.t3)
-mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query # # COMMIT
-DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result b/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result
deleted file mode 100644
index 423b9f71ac6..00000000000
--- a/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result
+++ /dev/null
@@ -1,11 +0,0 @@
-reset master;
-drop table if exists t1;
-drop database if exists mysqltest;
-create database mysqltest;
-use mysqltest;
-create table t1 (a int primary key, b int) engine=ndb;
-insert into t1 values (1, 1);
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
-drop database mysqltest;
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result b/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result
deleted file mode 100644
index ab952430d2d..00000000000
--- a/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result
+++ /dev/null
@@ -1,80 +0,0 @@
-drop table if exists t1,t2,t3;
-reset master;
-drop table if exists t1,t2,t3;
-reset master;
-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;
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 1 # BEGIN
-mysqld-bin.000001 # Table_map 1 # table_id: # (mysqltest.t1)
-mysqld-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 1 # COMMIT
-reset master;
-use mysqltest;
-insert into t2 values (1,1);
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 2 # BEGIN
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysqltest.t1)
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 2 # COMMIT
-mysqld-bin.000001 # Query 2 # BEGIN
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysqltest.t2)
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 2 # table_id: #
-mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 2 # COMMIT
-reset master;
-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);
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 1 # BEGIN
-mysqld-bin.000001 # Table_map 1 # table_id: # (mysqltest.t2)
-mysqld-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 1 # table_id: #
-mysqld-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 1 # COMMIT
-mysqld-bin.000001 # Query 1 # use `mysqltest`; DROP TABLE `t1` /* generated by server */
-mysqld-bin.000001 # Query 1 # use `mysqltest`; DROP TABLE `t2` /* generated by server */
-mysqld-bin.000001 # Query 1 # use `mysqltest`; create table t1 (d int key, e int) engine=ndb
-mysqld-bin.000001 # Query 1 # use `mysqltest`; create table t2 (d int key, e int) engine=ndb
-mysqld-bin.000001 # Query 1 # BEGIN
-mysqld-bin.000001 # Table_map 1 # table_id: # (mysqltest.t1)
-mysqld-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 1 # table_id: #
-mysqld-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 1 # COMMIT
-use mysqltest;
-insert into t2 values (1,1);
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query 1 # use `mysqltest`; drop table `t1`
-mysqld-bin.000001 # Query 1 # use `mysqltest`; drop table `t2`
-mysqld-bin.000001 # Query 1 # use `mysqltest`; create table t1 (d int key, e int) engine=ndb
-mysqld-bin.000001 # Query 1 # use `mysqltest`; create table t2 (d int key, e int) engine=ndb
-mysqld-bin.000001 # Query 2 # BEGIN
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysqltest.t1)
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 2 # table_id: #
-mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 2 # COMMIT
-mysqld-bin.000001 # Query 2 # BEGIN
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysqltest.t2)
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 2 # table_id: #
-mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 2 # COMMIT
-drop database mysqltest;
diff --git a/mysql-test/suite/ndb/r/ndb_binlog_multi.result b/mysql-test/suite/ndb/r/ndb_binlog_multi.result
deleted file mode 100644
index 3fbb2660eb6..00000000000
--- a/mysql-test/suite/ndb/r/ndb_binlog_multi.result
+++ /dev/null
@@ -1,80 +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
-mysqld-bin.000001 # Query 2 # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB
-mysqld-bin.000001 # Query 2 # BEGIN
-mysqld-bin.000001 # Table_map 2 # table_id: # (test.t2)
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 2 # table_id: #
-mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 2 # 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
-mysqld-bin.000001 # Query 2 # use `test`; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB
-mysqld-bin.000001 # Query 1 # BEGIN
-mysqld-bin.000001 # Table_map 1 # table_id: # (test.t2)
-mysqld-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 1 # table_id: #
-mysqld-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 1 # COMMIT
-mysqld-bin.000001 # Query 1 # use `test`; DROP TABLE `t2` /* generated by server */
-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
-mysqld-bin.000001 # Query 2 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB
-mysqld-bin.000001 # Query 2 # BEGIN
-mysqld-bin.000001 # Table_map 2 # table_id: # (test.t1)
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 2 # table_id: #
-mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 2 # 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
-mysqld-bin.000001 # Query 2 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB
-mysqld-bin.000001 # Query 2 # BEGIN
-mysqld-bin.000001 # Table_map 2 # table_id: # (test.t1)
-mysqld-bin.000001 # Table_map 2 # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows 2 # table_id: #
-mysqld-bin.000001 # Write_rows 2 # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query 2 # COMMIT
-mysqld-bin.000001 # Query 2 # use `test`; DROP TABLE `t1` /* generated by server */
-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/suite/ndb/r/ndb_bitfield.result b/mysql-test/suite/ndb/r/ndb_bitfield.result
deleted file mode 100644
index 826f3a98348..00000000000
--- a/mysql-test/suite/ndb/r/ndb_bitfield.result
+++ /dev/null
@@ -1,224 +0,0 @@
-drop table if exists t1;
-create table t1 (
-pk1 int not null primary key,
-b bit(64)
-) engine=ndbcluster;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `pk1` int(11) NOT NULL,
- `b` bit(64) DEFAULT NULL,
- PRIMARY KEY (`pk1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-insert into t1 values
-(0,b'1111111111111111111111111111111111111111111111111111111111111111'),
-(1,b'1000000000000000000000000000000000000000000000000000000000000000'),
-(2,b'0000000000000000000000000000000000000000000000000000000000000001'),
-(3,b'1010101010101010101010101010101010101010101010101010101010101010'),
-(4,b'0101010101010101010101010101010101010101010101010101010101010101');
-select hex(b) from t1 order by pk1;
-hex(b)
-FFFFFFFFFFFFFFFF
-8000000000000000
-1
-AAAAAAAAAAAAAAAA
-5555555555555555
-drop table t1;
-create table t1 (
-pk1 int not null primary key,
-b bit(9)
-) engine=ndbcluster;
-insert into t1 values
-(0,b'000000000'),
-(1,b'000000001'),
-(2,b'000000010'),
-(3,b'000000011'),
-(4,b'000000100');
-select hex(b) from t1 order by pk1;
-hex(b)
-0
-1
-2
-3
-4
-update t1 set b = b + b'101010101';
-select hex(b) from t1 order by pk1;
-hex(b)
-155
-156
-157
-158
-159
-drop table t1;
-create table t1 (a bit(7), b bit(9)) engine = ndbcluster;
-insert into t1 values
-(94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),
-(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),
-(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),
-(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),
-(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),
-(44, 307), (68, 454), (57, 135);
-select a+0 from t1 order by a;
-a+0
-0
-4
-5
-9
-23
-24
-28
-29
-30
-31
-34
-44
-49
-56
-57
-59
-60
-61
-68
-68
-75
-77
-78
-79
-87
-88
-94
-94
-104
-106
-108
-111
-116
-118
-119
-122
-123
-127
-select b+0 from t1 order by b;
-b+0
-36
-42
-46
-67
-83
-118
-123
-133
-135
-152
-177
-178
-188
-202
-206
-245
-280
-307
-343
-345
-349
-351
-363
-368
-368
-379
-380
-390
-398
-399
-403
-411
-411
-438
-446
-454
-468
-499
-drop table t1;
-create table t1 (
-dummyKey INTEGER NOT NULL,
-a001 TINYINT,
-a010 TINYINT,
-a012 TINYINT,
-a015 TINYINT,
-a016 TINYINT,
-a017 TINYINT,
-a019 TINYINT,
-a029 TINYINT,
-a030 TINYINT,
-a031 TINYINT,
-a032 TINYINT,
-a042 TINYINT,
-a043 TINYINT,
-a044 TINYINT,
-a3001 TINYINT,
-a3002 TINYINT,
-a3003 TINYINT,
-a3004 TINYINT,
-a3005 TINYINT,
-a3021 TINYINT,
-a3022 TINYINT,
-a BIT(6),
-b BIT(6),
-c BIT(6),
-d TINYINT,
-e TINYINT,
-f TINYINT,
-g TINYINT,
-h TINYINT,
-i TINYINT,
-j TINYINT,
-k TINYINT,
-l TINYINT,
-m TINYINT,
-n TINYINT,
-o TINYINT,
-a034 TINYINT,
-PRIMARY KEY USING HASH (dummyKey) ) engine=ndb;
-INSERT INTO `t1` VALUES
-(1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000001',b'111111',b'111110',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000010',b'000000',b'111101',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000100',b'001111',b'111011',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'001000',b'110000',b'110111',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'010000',b'100001',b'101111',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'100000',b'010010',b'011111',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'001100',b'111111',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x01,0x3F,0x3E,4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x02,0x00,0x3D,4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x04,0x0F,0x3B,4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x08,0x30,0x37,4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x10,0x21,0x2F,4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x20,0x12,0x1F,4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x00,0x0C,0x3F,4,5,5,5,5,5,5,5,5,5,3,2,1);
-INSERT INTO `t1` VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0x3F,0x00,0x00,4,5,5,5,5,5,5,5,5,5,3,2,1);
-drop table t1;
-create table t1 (
-pk1 bit(9) not null primary key,
-b int
-) engine=ndbcluster;
-ERROR HY000: Can't create table 'test.t1' (errno: 906)
-show warnings;
-Level Code Message
-Warning 1296 Got error 906 'Unsupported attribute type in index' from NDB
-Error 1005 Can't create table 'test.t1' (errno: 906)
-create table t1 (
-pk1 int not null primary key,
-b bit(9),
-key(b)
-) engine=ndbcluster;
-ERROR HY000: Can't create table 'test.t1' (errno: 906)
-show warnings;
-Level Code Message
-Warning 1296 Got error 906 'Unsupported attribute type in index' from NDB
-Error 1005 Can't create table 'test.t1' (errno: 906)
-create table t1 (
-pk1 int primary key,
-b bit(32) not null
-) engine=ndbcluster;
-insert into t1 values (1,1);
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_blob.result b/mysql-test/suite/ndb/r/ndb_blob.result
deleted file mode 100644
index 31ce36864af..00000000000
--- a/mysql-test/suite/ndb/r/ndb_blob.result
+++ /dev/null
@@ -1,591 +0,0 @@
-drop table if exists t1;
-drop database if exists test2;
-set autocommit=0;
-create table t1 (
-a int not null primary key,
-b text not null,
-c int not null,
-d longblob,
-key (c)
-) 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 @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);
-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);
-set @d2 = 'dd2';
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-select length(@x0),length(@b1),length(@d1) from dual;
-length(@x0) length(@b1) length(@d1)
-256 2256 3000
-select length(@x0),length(@b2),length(@d2) from dual;
-length(@x0) length(@b2) length(@d2)
-256 20000 30000
-insert into t1 values(1,@b1,111,@d1);
-insert into t1 values(2,@b2,222,@d2);
-commit;
-explain select * from t1 where a = 1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 const PRIMARY PRIMARY 4 const #
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a=1;
-a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
-1 2256 b1 3000 dd1
-select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
-from t1 where a=2;
-a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3)
-2 20000 b2 30000 dd2
-update t1 set b=@b2,d=@d2 where a=1;
-update t1 set b=@b1,d=@d1 where a=2;
-commit;
-select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
-from t1 where a=1;
-a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3)
-1 20000 b2 30000 dd2
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a=2;
-a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
-2 2256 b1 3000 dd1
-update t1 set b=concat(b,b),d=concat(d,d) where a=1;
-update t1 set b=concat(b,b),d=concat(d,d) where a=2;
-commit;
-select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
-from t1 where a=1;
-a length(b) substr(b,1+4*9000,2) length(d) substr(d,1+6*9000,3)
-1 40000 b2 60000 dd2
-select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3)
-from t1 where a=2;
-a length(b) substr(b,1+4*900,2) length(d) substr(d,1+6*900,3)
-2 4512 b1 6000 dd1
-update t1 set d=null where a=1;
-commit;
-select a from t1 where d is null;
-a
-1
-delete from t1 where a=45567;
-commit;
-delete from t1 where a=1;
-delete from t1 where a=2;
-commit;
-select count(*) from t1;
-count(*)
-0
-replace t1 set a=1,b=@b1,c=111,d=@d1;
-replace t1 set a=2,b=@b2,c=222,d=@d2;
-commit;
-explain select * from t1 where a = 1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 const PRIMARY PRIMARY 4 const #
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a=1;
-a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
-1 2256 b1 3000 dd1
-select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
-from t1 where a=2;
-a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3)
-2 20000 b2 30000 dd2
-replace t1 set a=1,b=@b2,c=111,d=@d2;
-replace t1 set a=2,b=@b1,c=222,d=@d1;
-commit;
-select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
-from t1 where a=1;
-a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3)
-1 20000 b2 30000 dd2
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a=2;
-a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
-2 2256 b1 3000 dd1
-replace t1 set a=1,b=concat(@b2,@b2),c=111,d=concat(@d2,@d2);
-replace t1 set a=2,b=concat(@b1,@b1),c=222,d=concat(@d1,@d1);
-commit;
-select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
-from t1 where a=1;
-a length(b) substr(b,1+4*9000,2) length(d) substr(d,1+6*9000,3)
-1 40000 b2 60000 dd2
-select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3)
-from t1 where a=2;
-a length(b) substr(b,1+4*900,2) length(d) substr(d,1+6*900,3)
-2 4512 b1 6000 dd1
-replace t1 set a=1,b='xyz',c=111,d=null;
-commit;
-select a,b from t1 where d is null;
-a b
-1 xyz
-delete from t1 where a=1;
-delete from t1 where a=2;
-commit;
-select count(*) from t1;
-count(*)
-0
-insert into t1 values(1,@b1,111,@d1);
-insert into t1 values(2,@b2,222,@d2);
-commit;
-explain select * from t1 where c = 111;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref c c 4 const #
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where c=111;
-a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
-1 2256 b1 3000 dd1
-select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
-from t1 where c=222;
-a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3)
-2 20000 b2 30000 dd2
-update t1 set b=@b2,d=@d2 where c=111;
-update t1 set b=@b1,d=@d1 where c=222;
-commit;
-select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
-from t1 where c=111;
-a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3)
-1 20000 b2 30000 dd2
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where c=222;
-a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
-2 2256 b1 3000 dd1
-update t1 set d=null where c=111;
-commit;
-select a from t1 where d is null;
-a
-1
-delete from t1 where c=111;
-delete from t1 where c=222;
-commit;
-select count(*) from t1;
-count(*)
-0
-insert into t1 values(1,'b1',111,'dd1');
-insert into t1 values(2,'b2',222,'dd2');
-insert into t1 values(3,'b3',333,'dd3');
-insert into t1 values(4,'b4',444,'dd4');
-insert into t1 values(5,'b5',555,'dd5');
-insert into t1 values(6,'b6',666,'dd6');
-insert into t1 values(7,'b7',777,'dd7');
-insert into t1 values(8,'b8',888,'dd8');
-insert into t1 values(9,'b9',999,'dd9');
-commit;
-explain select * from t1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL #
-select * from t1 order by a;
-a b c d
-1 b1 111 dd1
-2 b2 222 dd2
-3 b3 333 dd3
-4 b4 444 dd4
-5 b5 555 dd5
-6 b6 666 dd6
-7 b7 777 dd7
-8 b8 888 dd8
-9 b9 999 dd9
-update t1 set b=concat(a,'x',b),d=concat(a,'x',d);
-commit;
-select * from t1 order by a;
-a b c d
-1 1xb1 111 1xdd1
-2 2xb2 222 2xdd2
-3 3xb3 333 3xdd3
-4 4xb4 444 4xdd4
-5 5xb5 555 5xdd5
-6 6xb6 666 6xdd6
-7 7xb7 777 7xdd7
-8 8xb8 888 8xdd8
-9 9xb9 999 9xdd9
-delete from t1;
-commit;
-select count(*) from t1;
-count(*)
-0
-insert into t1 values(1,@b1,111,@d1);
-insert into t1 values(2,@b2,222,@d2);
-commit;
-explain select * from t1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL #
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 order by a;
-a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
-1 2256 b1 3000 dd1
-2 20000 b2 30000 dd2
-update t1 set b=concat(b,b),d=concat(d,d);
-commit;
-select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
-from t1 order by a;
-a length(b) substr(b,1+4*9000,2) length(d) substr(d,1+6*9000,3)
-1 4512 6000
-2 40000 b2 60000 dd2
-delete from t1;
-commit;
-select count(*) from t1;
-count(*)
-0
-insert into t1 values(1,'b1',111,'dd1');
-insert into t1 values(2,'b2',222,'dd2');
-insert into t1 values(3,'b3',333,'dd3');
-insert into t1 values(4,'b4',444,'dd4');
-insert into t1 values(5,'b5',555,'dd5');
-insert into t1 values(6,'b6',666,'dd6');
-insert into t1 values(7,'b7',777,'dd7');
-insert into t1 values(8,'b8',888,'dd8');
-insert into t1 values(9,'b9',999,'dd9');
-commit;
-explain select * from t1 where c >= 100 order by a;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 4 NULL # Using where with pushed condition; Using filesort
-select * from t1 where c >= 100 order by a;
-a b c d
-1 b1 111 dd1
-2 b2 222 dd2
-3 b3 333 dd3
-4 b4 444 dd4
-5 b5 555 dd5
-6 b6 666 dd6
-7 b7 777 dd7
-8 b8 888 dd8
-9 b9 999 dd9
-update t1 set b=concat(a,'x',b),d=concat(a,'x',d)
-where c >= 100;
-commit;
-select * from t1 where c >= 100 order by a;
-a b c d
-1 1xb1 111 1xdd1
-2 2xb2 222 2xdd2
-3 3xb3 333 3xdd3
-4 4xb4 444 4xdd4
-5 5xb5 555 5xdd5
-6 6xb6 666 6xdd6
-7 7xb7 777 7xdd7
-8 8xb8 888 8xdd8
-9 9xb9 999 9xdd9
-delete from t1 where c >= 100;
-commit;
-select count(*) from t1;
-count(*)
-0
-insert into t1 values(1,@b1,111,@d1);
-insert into t1 values(2,@b2,222,@d2);
-commit;
-explain select * from t1 where c >= 100 order by a;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range c c 4 NULL # Using where with pushed condition; Using filesort
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where c >= 100 order by a;
-a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
-1 2256 b1 3000 dd1
-2 20000 b2 30000 dd2
-update t1 set b=concat(b,b),d=concat(d,d);
-commit;
-select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
-from t1 where c >= 100 order by a;
-a length(b) substr(b,1+4*9000,2) length(d) substr(d,1+6*9000,3)
-1 4512 6000
-2 40000 b2 60000 dd2
-delete from t1 where c >= 100;
-commit;
-select count(*) from t1;
-count(*)
-0
-insert into t1 values(1,@b1,111,@d1);
-insert into t1 values(2,@b2,222,@d2);
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a = 0;
-a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a = 1;
-a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
-1 2256 b1 3000 dd1
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a = 2;
-a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
-2 20000 b2 30000 dd2
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 order by a;
-a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3)
-1 2256 b1 3000 dd1
-2 20000 b2 30000 dd2
-rollback;
-select count(*) from t1;
-count(*)
-0
-insert into t1 values(1,'b1',111,'dd1');
-insert into t1 values(2,'b2',222,'dd2');
-insert into t1 values(3,'b3',333,'dd3');
-insert into t1 values(4,'b4',444,'dd4');
-insert into t1 values(5,'b5',555,'dd5');
-insert into t1 values(6,'b6',666,'dd6');
-insert into t1 values(7,'b7',777,'dd7');
-insert into t1 values(8,'b8',888,'dd8');
-insert into t1 values(9,'b9',999,'dd9');
-commit;
-select * from t1 order by a;
-a b c d
-1 b1 111 dd1
-2 b2 222 dd2
-3 b3 333 dd3
-4 b4 444 dd4
-5 b5 555 dd5
-6 b6 666 dd6
-7 b7 777 dd7
-8 b8 888 dd8
-9 b9 999 dd9
-alter table t1 add x int;
-select * from t1 order by a;
-a b c d x
-1 b1 111 dd1 NULL
-2 b2 222 dd2 NULL
-3 b3 333 dd3 NULL
-4 b4 444 dd4 NULL
-5 b5 555 dd5 NULL
-6 b6 666 dd6 NULL
-7 b7 777 dd7 NULL
-8 b8 888 dd8 NULL
-9 b9 999 dd9 NULL
-alter table t1 drop x;
-select * from t1 order by a;
-a b c d
-1 b1 111 dd1
-2 b2 222 dd2
-3 b3 333 dd3
-4 b4 444 dd4
-5 b5 555 dd5
-6 b6 666 dd6
-7 b7 777 dd7
-8 b8 888 dd8
-9 b9 999 dd9
-create database test2;
-use test2;
-CREATE TABLE t2 (
-a bigint unsigned NOT NULL PRIMARY KEY,
-b int unsigned not null,
-c int unsigned
-) engine=ndbcluster;
-insert into t2 values (1,1,1),(2,2,2);
-select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a;
-a b c d a b c
-1 b1 111 dd1 1 1 1
-2 b2 222 dd2 2 2 2
-drop table t2;
-use test;
-select * from t1 order by a;
-a b c d
-1 b1 111 dd1
-2 b2 222 dd2
-3 b3 333 dd3
-4 b4 444 dd4
-5 b5 555 dd5
-6 b6 666 dd6
-7 b7 777 dd7
-8 b8 888 dd8
-9 b9 999 dd9
-alter table t1 add x int;
-select * from t1 order by a;
-a b c d x
-1 b1 111 dd1 NULL
-2 b2 222 dd2 NULL
-3 b3 333 dd3 NULL
-4 b4 444 dd4 NULL
-5 b5 555 dd5 NULL
-6 b6 666 dd6 NULL
-7 b7 777 dd7 NULL
-8 b8 888 dd8 NULL
-9 b9 999 dd9 NULL
-alter table t1 drop x;
-select * from t1 order by a;
-a b c d
-1 b1 111 dd1
-2 b2 222 dd2
-3 b3 333 dd3
-4 b4 444 dd4
-5 b5 555 dd5
-6 b6 666 dd6
-7 b7 777 dd7
-8 b8 888 dd8
-9 b9 999 dd9
-drop table t1;
-drop database test2;
-set autocommit=0;
-create table t1 (
-a int not null primary key,
-b tinytext
-) engine=ndbcluster;
-insert into t1 values(1, 'x');
-update t1 set b = 'y';
-select * from t1;
-a b
-1 y
-delete from t1;
-select * from t1;
-a b
-commit;
-replace t1 set a=2, b='y';
-select * from t1;
-a b
-2 y
-delete from t1;
-select * from t1;
-a b
-drop table t1;
-set autocommit=0;
-create table t1 (
-a int not null primary key,
-b text not null
-) engine=ndbcluster;
-insert into t1 values(1, '');
-select * from t1;
-a b
-1
-commit;
-drop table t1;
-set autocommit=1;
-use test;
-CREATE TABLE t1 (
-a int,
-b text,
-PRIMARY KEY (a)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-INSERT INTO t1 VALUES
-(1,'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA');
-INSERT INTO t1 VALUES
-(2,'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB');
-select * from t1 order by a;
-a b
-1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
-alter table t1 engine=ndb;
-select * from t1 order by a;
-a b
-1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
-set autocommit=1;
-alter table t1 engine=myisam;
-select * from t1 order by a;
-a b
-1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
-drop table t1;
-create table t1 (
-id int(11) unsigned primary key NOT NULL auto_increment,
-msg text NOT NULL
-) engine=ndbcluster default charset=utf8;
-insert into t1 (msg) values(
-'Tries to validate (8 byte length + inline bytes) as UTF8 :(
-Fast fix: removed validation for Text. It is not yet indexable
-so bad data will not crash kernel.');
-select * from t1;
-id msg
-1 Tries to validate (8 byte length + inline bytes) as UTF8 :(
-Fast fix: removed validation for Text. It is not yet indexable
-so bad data will not crash kernel.
-drop table t1;
-create table t1 (
-a int primary key not null auto_increment,
-b text
-) engine=ndbcluster;
-select count(*) from t1;
-count(*)
-500
-truncate t1;
-select count(*) from t1;
-count(*)
-0
-drop table t1;
-create table t1 (
-a varchar(40) not null,
-b mediumint not null,
-t text,
-c varchar(2) not null,
-d bigint not null,
-primary key (a,b,c),
-key (c,a),
-unique key (d)
-) engine=ndb;
-insert into t1 (a,b,c,d,t) values ('a',1110,'a',1,@v1);
-insert into t1 (a,b,c,d,t) values ('b',1110,'a',2,@v2);
-insert into t1 (a,b,c,d,t) values ('a',1110,'b',3,@v3);
-insert into t1 (a,b,c,d,t) values ('b',1110,'b',4,@v4);
-select a,b,c,d,sha1(t) from t1 order by c,a;
-a b c d sha1(t)
-a 1110 a 1 558a30713786aa72f66abc1e6a521d55aacdeeb5
-b 1110 a 2 b238654911689bfb626a3ef9dba4a1ca074e6a5e
-a 1110 b 3 2b6515f29c20b8e9e17cc597527e516c0de8d612
-b 1110 b 4 NULL
-select a,b,c,d,sha1(t) from t1 where a='a' and b=1110 and c='a';
-a b c d sha1(t)
-a 1110 a 1 558a30713786aa72f66abc1e6a521d55aacdeeb5
-select a,b,c,d,sha1(t) from t1 where a='a' and b=1110 and c='b';
-a b c d sha1(t)
-a 1110 b 3 2b6515f29c20b8e9e17cc597527e516c0de8d612
-update t1 set t=@v4 where a='b' and b=1110 and c='a';
-update t1 set t=@v2 where a='b' and b=1110 and c='b';
-select a,b,c,d,sha1(t) from t1 order by c,a;
-a b c d sha1(t)
-a 1110 a 1 558a30713786aa72f66abc1e6a521d55aacdeeb5
-b 1110 a 2 NULL
-a 1110 b 3 2b6515f29c20b8e9e17cc597527e516c0de8d612
-b 1110 b 4 b238654911689bfb626a3ef9dba4a1ca074e6a5e
-update t1 set t=@v2 where d=2;
-update t1 set t=@v4 where d=4;
-select a,b,c,d,sha1(t) from t1 order by c,a;
-a b c d sha1(t)
-a 1110 a 1 558a30713786aa72f66abc1e6a521d55aacdeeb5
-b 1110 a 2 b238654911689bfb626a3ef9dba4a1ca074e6a5e
-a 1110 b 3 2b6515f29c20b8e9e17cc597527e516c0de8d612
-b 1110 b 4 NULL
-update t1 set t=@v4 where a='b' and c='a';
-update t1 set t=@v2 where a='b' and c='b';
-select a,b,c,d,sha1(t) from t1 order by c,a;
-a b c d sha1(t)
-a 1110 a 1 558a30713786aa72f66abc1e6a521d55aacdeeb5
-b 1110 a 2 NULL
-a 1110 b 3 2b6515f29c20b8e9e17cc597527e516c0de8d612
-b 1110 b 4 b238654911689bfb626a3ef9dba4a1ca074e6a5e
-update t1 set t=@v2 where b+d=1112;
-update t1 set t=@v4 where b+d=1114;
-select a,b,c,d,sha1(t) from t1 order by c,a;
-a b c d sha1(t)
-a 1110 a 1 558a30713786aa72f66abc1e6a521d55aacdeeb5
-b 1110 a 2 b238654911689bfb626a3ef9dba4a1ca074e6a5e
-a 1110 b 3 2b6515f29c20b8e9e17cc597527e516c0de8d612
-b 1110 b 4 NULL
-delete from t1 where a='a' and b=1110 and c='a';
-delete from t1 where a='b' and c='a';
-delete from t1 where d=3;
-delete from t1 where b+d=1114;
-select count(*) from t1;
-count(*)
-0
-drop table t1;
-create table t1(
-a int,
-blob_nn blob not null,
-text_nn text not null,
-blob_nl blob,
-text_nl text,
-primary key(a)
-) engine=ndb;
-insert into t1(a) values (1);
-Warnings:
-Warning 1364 Field 'blob_nn' doesn't have a default value
-Warning 1364 Field 'text_nn' doesn't have a default value
-insert into t1(a, text_nl) values (2, 'MySQL Cluster NDB');
-Warnings:
-Warning 1364 Field 'blob_nn' doesn't have a default value
-Warning 1364 Field 'text_nn' doesn't have a default value
-select a, length(blob_nn), length(text_nn), blob_nl, text_nl from t1 order by a;
-a length(blob_nn) length(text_nn) blob_nl text_nl
-1 0 0 NULL NULL
-2 0 0 NULL MySQL Cluster NDB
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_blob_partition.result b/mysql-test/suite/ndb/r/ndb_blob_partition.result
deleted file mode 100644
index b08a91f0cdd..00000000000
--- a/mysql-test/suite/ndb/r/ndb_blob_partition.result
+++ /dev/null
@@ -1,104 +0,0 @@
-drop table if exists t1;
-create table t1 (
-a mediumint not null,
-b text not null,
-c int not null,
-d longblob,
-primary key using hash (a,c),
-unique key (c)
-)
-engine=ndb
-partition by range (c)
-partitions 3
-( partition p1 values less than (200),
-partition p2 values less than (300),
-partition p3 values less than (400));
-insert into t1 values (1, @v1, 101, @v2);
-insert into t1 values (1, @v2, 102, @v3);
-insert into t1 values (1, @v3, 103, @v4);
-insert into t1 values (2, @v4, 201, @v5);
-insert into t1 values (2, @v5, 202, @v6);
-insert into t1 values (2, @v6, 203, @v7);
-insert into t1 values (3, @v7, 301, @v8);
-insert into t1 values (3, @v8, 302, @v9);
-insert into t1 values (3, @v9, 303, @v1);
-select a, sha1(b), c, sha1(d) from t1 order by a;
-a sha1(b) c sha1(d)
-1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6
-1 10d3c783026b310218d10b7188da96a2401648c6 102 a33549d9844092289a58ac348dd59f09fc28406a
-1 a33549d9844092289a58ac348dd59f09fc28406a 103 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c
-2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d
-2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 202 090565c580809efed3d369481a4bbb168b20713e
-2 090565c580809efed3d369481a4bbb168b20713e 203 1e0070bec426871a46291de27b9bd6e4255ab4e5
-3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e
-3 acbaba01bc2e682f015f40e79d9cbe475db3002e 302 9ee30d99162574f79c66ae95cdf132dcf9cbc259
-3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 303 1d42dd9090cf78314a06665d4ea938c35cc760f4
-select a, sha1(b), c, sha1(d) from t1 where a = 1 and c = 101;
-a sha1(b) c sha1(d)
-1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6
-select a, sha1(b), c, sha1(d) from t1 where a = 2 and c = 201;
-a sha1(b) c sha1(d)
-2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d
-select a, sha1(b), c, sha1(d) from t1 where a = 3 and c = 301;
-a sha1(b) c sha1(d)
-3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e
-update t1 set b = @v3, d = @v4 where a = 1 and c = 102;
-update t1 set b = @v6, d = @v7 where a = 2 and c = 202;
-update t1 set b = @v9, d = @v1 where a = 3 and c = 302;
-select a, sha1(b), c, sha1(d) from t1 order by a;
-a sha1(b) c sha1(d)
-1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6
-1 a33549d9844092289a58ac348dd59f09fc28406a 102 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c
-1 a33549d9844092289a58ac348dd59f09fc28406a 103 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c
-2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d
-2 090565c580809efed3d369481a4bbb168b20713e 202 1e0070bec426871a46291de27b9bd6e4255ab4e5
-2 090565c580809efed3d369481a4bbb168b20713e 203 1e0070bec426871a46291de27b9bd6e4255ab4e5
-3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e
-3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 302 1d42dd9090cf78314a06665d4ea938c35cc760f4
-3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 303 1d42dd9090cf78314a06665d4ea938c35cc760f4
-update t1 set b = @v4, d = @v5 where c = 103;
-update t1 set b = @v7, d = @v8 where c = 203;
-update t1 set b = @v1, d = @v2 where c = 303;
-select a, sha1(b), c, sha1(d) from t1 order by a;
-a sha1(b) c sha1(d)
-1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6
-1 a33549d9844092289a58ac348dd59f09fc28406a 102 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c
-1 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 103 70fc9a7d08beebc522258bfb02000a30c77a8f1d
-2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d
-2 090565c580809efed3d369481a4bbb168b20713e 202 1e0070bec426871a46291de27b9bd6e4255ab4e5
-2 1e0070bec426871a46291de27b9bd6e4255ab4e5 203 acbaba01bc2e682f015f40e79d9cbe475db3002e
-3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e
-3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 302 1d42dd9090cf78314a06665d4ea938c35cc760f4
-3 1d42dd9090cf78314a06665d4ea938c35cc760f4 303 10d3c783026b310218d10b7188da96a2401648c6
-update t1 set b = @v5, d = @v6;
-select a, sha1(b), c, sha1(d) from t1 order by a;
-a sha1(b) c sha1(d)
-1 70fc9a7d08beebc522258bfb02000a30c77a8f1d 101 090565c580809efed3d369481a4bbb168b20713e
-1 70fc9a7d08beebc522258bfb02000a30c77a8f1d 102 090565c580809efed3d369481a4bbb168b20713e
-1 70fc9a7d08beebc522258bfb02000a30c77a8f1d 103 090565c580809efed3d369481a4bbb168b20713e
-2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 201 090565c580809efed3d369481a4bbb168b20713e
-2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 202 090565c580809efed3d369481a4bbb168b20713e
-2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 203 090565c580809efed3d369481a4bbb168b20713e
-3 70fc9a7d08beebc522258bfb02000a30c77a8f1d 301 090565c580809efed3d369481a4bbb168b20713e
-3 70fc9a7d08beebc522258bfb02000a30c77a8f1d 302 090565c580809efed3d369481a4bbb168b20713e
-3 70fc9a7d08beebc522258bfb02000a30c77a8f1d 303 090565c580809efed3d369481a4bbb168b20713e
-update t1 set b = @v1, d = @v2 where 100 < c and c < 200;
-update t1 set b = @v4, d = @v5 where 200 < c and c < 300;
-update t1 set b = @v7, d = @v8 where 300 < c and c < 400;
-select a, sha1(b), c, sha1(d) from t1 order by a;
-a sha1(b) c sha1(d)
-1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6
-1 1d42dd9090cf78314a06665d4ea938c35cc760f4 102 10d3c783026b310218d10b7188da96a2401648c6
-1 1d42dd9090cf78314a06665d4ea938c35cc760f4 103 10d3c783026b310218d10b7188da96a2401648c6
-2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d
-2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 202 70fc9a7d08beebc522258bfb02000a30c77a8f1d
-2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 203 70fc9a7d08beebc522258bfb02000a30c77a8f1d
-3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e
-3 1e0070bec426871a46291de27b9bd6e4255ab4e5 302 acbaba01bc2e682f015f40e79d9cbe475db3002e
-3 1e0070bec426871a46291de27b9bd6e4255ab4e5 303 acbaba01bc2e682f015f40e79d9cbe475db3002e
-delete from t1 where a = 1 and c = 101;
-delete from t1 where c = 102;
-delete from t1;
-select a, sha1(b), c, sha1(d) from t1 order by a;
-a sha1(b) c sha1(d)
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_bug26793.result b/mysql-test/suite/ndb/r/ndb_bug26793.result
deleted file mode 100644
index a9a8a798546..00000000000
--- a/mysql-test/suite/ndb/r/ndb_bug26793.result
+++ /dev/null
@@ -1,8 +0,0 @@
-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/suite/ndb/r/ndb_bug31477.result b/mysql-test/suite/ndb/r/ndb_bug31477.result
deleted file mode 100644
index 002a928b485..00000000000
--- a/mysql-test/suite/ndb/r/ndb_bug31477.result
+++ /dev/null
@@ -1,98 +0,0 @@
-drop table if exists t1;
-create table t1(a int primary key, b int, c int, unique(b)) engine = ndb;
-insert into t1 values (2,2,2);
-insert into t1 values (3,3,3);
-insert into t1 values (4,4,4);
-begin;
-insert into t1 values (1,1,1);
-begin;
-update t1 set c = 2 where b = 1;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-rollback;
-rollback;
-drop table t1;
-create table t1(a int primary key, b int, c int, key(b)) engine = ndb;
-insert into t1 values (2,2,2);
-insert into t1 values (3,3,3);
-insert into t1 values (4,4,4);
-begin;
-insert into t1 values (1,1,1);
-begin;
-update t1 set c = 2 where b = 1;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-rollback;
-rollback;
-drop table t1;
---con1
-create table t1(a int primary key, b int, c int, key(b)) engine = ndb;
-insert into t1 values (1,1,1);
-insert into t1 values (2,2,2);
-insert into t1 values (3,3,3);
-insert into t1 values (4,4,4);
-begin;
-update t1 set c = 10 where a = 1;
-update t1 set c = 20 where a = 1;
-update t1 set c = 30 where a = 1;
---con1 c=30
-select * from t1 where b >= 1 order by b;
-a b c
-1 1 30
-2 2 2
-3 3 3
-4 4 4
---con2 c=1
-select * from t1 where b >= 1 order by b;
-a b c
-1 1 1
-2 2 2
-3 3 3
-4 4 4
---con1
-delete from t1 where a = 1;
---con1 c=none
-select * from t1 where b >= 1 order by b;
-a b c
-2 2 2
-3 3 3
-4 4 4
---con2 c=1
-select * from t1 where b >= 1 order by b;
-a b c
-1 1 1
-2 2 2
-3 3 3
-4 4 4
---con1
-commit;
---con1 c=none
-select * from t1 where b >= 1 order by b;
-a b c
-2 2 2
-3 3 3
-4 4 4
---con2 c=none
-select * from t1 where b >= 1 order by b;
-a b c
-2 2 2
-3 3 3
-4 4 4
---con1
-begin;
-insert into t1 values (1,1,1);
-update t1 set c = 10 where a = 1;
-update t1 set c = 20 where a = 1;
-update t1 set c = 30 where a = 1;
---con1 c=30
-select * from t1 where b >= 1 order by b;
-a b c
-1 1 30
-2 2 2
-3 3 3
-4 4 4
---con2 c=none
-select * from t1 where b >= 1 order by b;
-a b c
-2 2 2
-3 3 3
-4 4 4
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_cache.result b/mysql-test/suite/ndb/r/ndb_cache.result
deleted file mode 100644
index 478663b1aa1..00000000000
--- a/mysql-test/suite/ndb/r/ndb_cache.result
+++ /dev/null
@@ -1,191 +0,0 @@
-drop table if exists t1;
-set GLOBAL query_cache_type=on;
-set GLOBAL query_cache_size=1355776;
-reset query cache;
-flush status;
-CREATE TABLE t1 ( pk int not null primary key,
-a int, b int not null, c varchar(20)) ENGINE=ndbcluster;
-insert into t1 value (1, 2, 3, 'First row');
-select * from t1;
-pk a b c
-1 2 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 1
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1;
-pk a b c
-1 2 3 First row
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 1
-update t1 set a=3 where pk=1;
-select * from t1;
-pk a b c
-1 3 3 First row
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 1
-insert into t1 value (2, 7, 8, 'Second row');
-insert into t1 value (4, 5, 6, 'Fourth row');
-select * from t1 order by pk;
-pk a b c
-1 3 3 First row
-2 7 8 Second row
-4 5 6 Fourth row
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 3
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 1
-select * from t1 order by pk;
-pk a b c
-1 3 3 First row
-2 7 8 Second row
-4 5 6 Fourth row
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 2
-select * from t1 where b=3;
-pk a b c
-1 3 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 2
-select * from t1 where b=3;
-pk a b c
-1 3 3 First row
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 3
-delete from t1 where c='Fourth row';
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 0
-select * from t1 where b=3;
-pk a b c
-1 3 3 First row
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 3
-use test;
-select * from t1 order by pk;
-pk a b c
-1 3 3 First row
-2 7 8 Second row
-select * from t1 where b=3;
-pk a b c
-1 3 3 First row
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 4
-update t1 set a=4 where b=3;
-use test;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 0
-select * from t1 order by pk desc;
-pk a b c
-2 7 8 Second row
-1 4 3 First row
-select * from t1 order by pk desc;
-pk a b c
-2 7 8 Second row
-1 4 3 First row
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 7
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 5
-select * from t1 order by pk desc;
-pk a b c
-2 7 8 Second row
-1 4 3 First row
-select * from t1 order by pk desc;
-pk a b c
-2 7 8 Second row
-1 4 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 1
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 7
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 7
-begin;
-update t1 set a=5 where pk=1;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 0
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 7
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 7
-select * from t1 order by pk desc;
-pk a b c
-2 7 8 Second row
-1 4 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 1
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 8
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 7
-commit;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 1
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 8
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 7
-select * from t1 order by pk desc;
-pk a b c
-2 7 8 Second row
-1 5 3 First row
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 9
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 7
-select * from t1 order by pk desc;
-pk a b c
-2 7 8 Second row
-1 5 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 1
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 9
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 8
-drop table t1;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 0
-SET GLOBAL query_cache_size=0;
diff --git a/mysql-test/suite/ndb/r/ndb_cache2.result b/mysql-test/suite/ndb/r/ndb_cache2.result
deleted file mode 100644
index 2876002f864..00000000000
--- a/mysql-test/suite/ndb/r/ndb_cache2.result
+++ /dev/null
@@ -1,623 +0,0 @@
-drop table if exists t1, t2, t3, t4, t5;
-set GLOBAL query_cache_type=on;
-set GLOBAL query_cache_size=1355776;
-set GLOBAL ndb_cache_check_time=100;
-reset query cache;
-flush status;
-CREATE TABLE t1 (
-pk int not null primary key,
-a1 int,
-b1 int not null,
-c1 varchar(20)
-) ENGINE=ndb;
-CREATE TABLE t2 (
-pk int not null primary key,
-a2 int,
-b2 int not null
-) ENGINE=ndb;
-CREATE TABLE t3 (
-pk int not null primary key,
-a3 int,
-b3 int not null,
-c3 int not null,
-d3 varchar(20)
-) ENGINE=ndb;
-CREATE TABLE t4 (
-a4 int,
-b4 int not null,
-c4 char(20)
-) ENGINE=ndbcluster;
-CREATE TABLE t5 (
-pk int not null primary key,
-a5 int,
-b5 int not null,
-c5 varchar(255)
-) ENGINE=ndbcluster;
-insert into t1 value (1, 2, 3, 'First row');
-insert into t2 value (1, 2, 3);
-insert into t3 value (1, 2, 3, 4, '3 - First row');
-insert into t4 value (2, 3, '4 - First row');
-insert into t5 value (1, 2, 3, '5 - First row');
-select * from t1;
-pk a1 b1 c1
-1 2 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 1
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1;
-pk a1 b1 c1
-1 2 3 First row
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 1
-update t1 set a1=3 where pk=1;
-select * from t1;
-pk a1 b1 c1
-1 3 3 First row
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 1
-insert into t1 value (2, 7, 8, 'Second row');
-insert into t1 value (4, 5, 6, 'Fourth row');
-select * from t1 order by pk desc;
-pk a1 b1 c1
-4 5 6 Fourth row
-2 7 8 Second row
-1 3 3 First row
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 3
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 1
-select * from t1 order by pk desc;
-pk a1 b1 c1
-4 5 6 Fourth row
-2 7 8 Second row
-1 3 3 First row
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 2
-select * from t1 where b1=3;
-pk a1 b1 c1
-1 3 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 2
-select * from t1 where b1=3;
-pk a1 b1 c1
-1 3 3 First row
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 3
-delete from t1 where c1='Fourth row';
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 0
-select * from t1 where b1=3;
-pk a1 b1 c1
-1 3 3 First row
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 3
-use test;
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 3 3 First row
-select * from t1 where b1=3;
-pk a1 b1 c1
-1 3 3 First row
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 4
-update t1 set a1=4 where b1=3;
-use test;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 0
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 4 3 First row
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 4 3 First row
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 7
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 5
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 4 3 First row
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 4 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 1
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 7
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 7
-select * from t2;
-pk a2 b2
-1 2 3
-select * from t3;
-pk a3 b3 c3 d3
-1 2 3 4 3 - First row
-select * from t4;
-a4 b4 c4
-2 3 4 - First row
-select * from t5;
-pk a5 b5 c5
-1 2 3 5 - First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-flush status;
-begin;
-update t1 set a1=5 where pk=1;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 4
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 0
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 4 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-commit;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 5 3 First row
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 5 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 1
-flush status;
-begin;
-update t1 set a1=6 where pk=1;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 4
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 0
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 5 3 First row
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 5 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 1
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 6 3 First row
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 6 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 1
-commit;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 1
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 6 3 First row
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 1
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 6 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 2
-flush status;
-begin;
-insert into t1 set pk=5, a1=6, b1=3, c1="New row";
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 4
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 0
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1 where pk=5;
-pk a1 b1 c1
-select * from t1 order by pk desc;
-pk a1 b1 c1
-2 7 8 Second row
-1 6 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1 where pk=5;
-pk a1 b1 c1
-5 6 3 New row
-select * from t1 where pk=5;
-pk a1 b1 c1
-5 6 3 New row
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-2 7 8 Second row
-1 6 3 First row
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-2 7 8 Second row
-1 6 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-commit;
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-2 7 8 Second row
-1 6 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 3
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-flush status;
-begin;
-delete from t1 where pk=2;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 4
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 0
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1 where pk=2;
-pk a1 b1 c1
-2 7 8 Second row
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-2 7 8 Second row
-1 6 3 First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1 where pk=2;
-pk a1 b1 c1
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-1 6 3 First row
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-1 6 3 First row
-select * from t1 where pk=2;
-pk a1 b1 c1
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-commit;
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-1 6 3 First row
-select * from t1 where pk=2;
-pk a1 b1 c1
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 6
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 4
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-flush status;
-begin;
-update t1 set a1=9 where pk=1;
-update t2 set a2=9 where pk=1;
-update t3 set a3=9 where pk=1;
-update t4 set a4=9 where a4=2;
-update t5 set a5=9 where pk=1;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 0
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 0
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-1 6 3 First row
-select * from t2;
-pk a2 b2
-1 2 3
-select * from t3;
-pk a3 b3 c3 d3
-1 2 3 4 3 - First row
-select * from t4;
-a4 b4 c4
-2 3 4 - First row
-select * from t5;
-pk a5 b5 c5
-1 2 3 5 - First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 5
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-1 9 3 First row
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-1 9 3 First row
-select * from t2;
-pk a2 b2
-1 9 3
-select * from t3;
-pk a3 b3 c3 d3
-1 9 3 4 3 - First row
-select * from t4;
-a4 b4 c4
-9 3 4 - First row
-select * from t5;
-pk a5 b5 c5
-1 9 3 5 - First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 5
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-commit;
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-1 9 3 First row
-select * from t2;
-pk a2 b2
-1 9 3
-select * from t3;
-pk a3 b3 c3 d3
-1 9 3 4 3 - First row
-select * from t4;
-a4 b4 c4
-9 3 4 - First row
-select * from t5;
-pk a5 b5 c5
-1 9 3 5 - First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 10
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-1 9 3 First row
-select * from t2;
-pk a2 b2
-1 9 3
-select * from t3;
-pk a3 b3 c3 d3
-1 9 3 4 3 - First row
-select * from t4;
-a4 b4 c4
-9 3 4 - First row
-select * from t5;
-pk a5 b5 c5
-1 9 3 5 - First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 10
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 5
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-1 9 3 First row
-select * from t2;
-pk a2 b2
-1 9 3
-select * from t3;
-pk a3 b3 c3 d3
-1 9 3 4 3 - First row
-select * from t4;
-a4 b4 c4
-9 3 4 - First row
-select * from t5;
-pk a5 b5 c5
-1 9 3 5 - First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 10
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 10
-select * from t1 order by pk desc;
-pk a1 b1 c1
-5 6 3 New row
-1 9 3 First row
-select * from t2;
-pk a2 b2
-1 9 3
-select * from t3;
-pk a3 b3 c3 d3
-1 9 3 4 3 - First row
-select * from t4;
-a4 b4 c4
-9 3 4 - First row
-select * from t5;
-pk a5 b5 c5
-1 9 3 5 - First row
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 5
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 10
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 15
-drop table t1, t2, t3, t4, t5;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 0
-SET GLOBAL query_cache_size=0;
-SET GLOBAL ndb_cache_check_time=0;
diff --git a/mysql-test/suite/ndb/r/ndb_cache_multi.result b/mysql-test/suite/ndb/r/ndb_cache_multi.result
deleted file mode 100644
index 388131ec30a..00000000000
--- a/mysql-test/suite/ndb/r/ndb_cache_multi.result
+++ /dev/null
@@ -1,74 +0,0 @@
-drop table if exists t1, t2;
-set GLOBAL query_cache_type=on;
-set GLOBAL query_cache_size=1355776;
-reset query cache;
-flush status;
-set GLOBAL query_cache_type=on;
-set GLOBAL query_cache_size=1355776;
-reset query cache;
-flush status;
-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;
-a
-2
-select * from t2;
-a
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 2
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-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
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 0
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1;
-a
-2
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 1
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-update t1 set a=3 where a=2;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 2
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 2
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1;
-a
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 2
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 3
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-drop table t1, t2;
-set GLOBAL query_cache_size=0;
-set GLOBAL query_cache_size=0;
diff --git a/mysql-test/suite/ndb/r/ndb_cache_multi2.result b/mysql-test/suite/ndb/r/ndb_cache_multi2.result
deleted file mode 100644
index 53767bb6d3c..00000000000
--- a/mysql-test/suite/ndb/r/ndb_cache_multi2.result
+++ /dev/null
@@ -1,75 +0,0 @@
-drop table if exists t1, t2;
-== 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;
-== 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;
-== 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;
-a
-2
-select a != 3 from t1;
-a != 3
-1
-select * from t2;
-a
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 3
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 3
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-== Connected to server2 ==
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 0
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 0
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-select * from t1;
-a
-2
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 1
-show status like "Qcache_inserts";
-Variable_name Value
-Qcache_inserts 1
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 0
-update t1 set a=3 where a=2;
-== Connected to server1 ==
-select * from t1;
-a
-3
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 3
-drop table t1, t2;
-set GLOBAL query_cache_size=0;
-set GLOBAL ndb_cache_check_time=0;
-reset query cache;
-flush status;
-set GLOBAL query_cache_size=0;
-set GLOBAL ndb_cache_check_time=0;
-reset query cache;
-flush status;
diff --git a/mysql-test/suite/ndb/r/ndb_charset.result b/mysql-test/suite/ndb/r/ndb_charset.result
deleted file mode 100644
index e84c906dd7e..00000000000
--- a/mysql-test/suite/ndb/r/ndb_charset.result
+++ /dev/null
@@ -1,320 +0,0 @@
-drop table if exists t1;
-create table t1 (
-a char(3) character set latin1 collate latin1_bin primary key
-) engine=ndb;
-insert into t1 values('aAa');
-insert into t1 values('aaa');
-insert into t1 values('AAA');
-select * from t1 order by a;
-a
-AAA
-aAa
-aaa
-select * from t1 where a = 'aAa';
-a
-aAa
-select * from t1 where a = 'aaa';
-a
-aaa
-select * from t1 where a = 'AaA';
-a
-select * from t1 where a = 'AAA';
-a
-AAA
-drop table t1;
-create table t1 (
-a char(3) character set latin1 collate latin1_swedish_ci primary key
-) engine=ndb;
-insert into t1 values('aAa');
-insert into t1 values('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'PRIMARY'
-insert into t1 values('AAA');
-ERROR 23000: Duplicate entry 'AAA' for key 'PRIMARY'
-select * from t1 order by a;
-a
-aAa
-select * from t1 where a = 'aAa';
-a
-aAa
-select * from t1 where a = 'aaa';
-a
-aAa
-select * from t1 where a = 'AaA';
-a
-aAa
-select * from t1 where a = 'AAA';
-a
-aAa
-drop table t1;
-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');
-insert into t1 values('b');
-ERROR 23000: Duplicate entry 'b' for key 'PRIMARY'
-insert into t1 values('a ');
-ERROR 23000: Duplicate entry 'a ' for key 'PRIMARY'
-select a,length(a) from t1 order by a;
-a length(a)
-A 1
-b 2
-C 3
-d 7
-E 1
-f 1
-select a,length(a) from t1 order by a desc;
-a length(a)
-f 1
-E 1
-d 7
-C 3
-b 2
-A 1
-select * from t1 where a = 'a';
-a
-A
-select * from t1 where a = 'a ';
-a
-A
-select * from t1 where a = 'd';
-a
-d
-drop table t1;
-create table t1 (
-p int primary key,
-a char(3) character set latin1 collate latin1_bin not null,
-unique key(a)
-) engine=ndb;
-insert into t1 values(1, 'aAa');
-insert into t1 values(2, 'aaa');
-insert into t1 values(3, 'AAA');
-select * from t1 order by p;
-p a
-1 aAa
-2 aaa
-3 AAA
-select * from t1 where a = 'aAa';
-p a
-1 aAa
-select * from t1 where a = 'aaa';
-p a
-2 aaa
-select * from t1 where a = 'AaA';
-p a
-select * from t1 where a = 'AAA';
-p a
-3 AAA
-drop table t1;
-create table t1 (
-p int primary key,
-a char(3) character set latin1 collate latin1_swedish_ci not null,
-unique key(a)
-) engine=ndb;
-insert into t1 values(1, 'aAa');
-insert into t1 values(2, 'aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
-insert into t1 values(3, 'AAA');
-ERROR 23000: Duplicate entry 'AAA' for key 'a'
-select * from t1 order by p;
-p a
-1 aAa
-select * from t1 where a = 'aAa';
-p a
-1 aAa
-select * from t1 where a = 'aaa';
-p a
-1 aAa
-select * from t1 where a = 'AaA';
-p a
-1 aAa
-select * from t1 where a = 'AAA';
-p a
-1 aAa
-drop table t1;
-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');
-insert into t1 values(99,'b');
-ERROR 23000: Duplicate entry 'b' for key 'a'
-insert into t1 values(99,'a ');
-ERROR 23000: Duplicate entry 'a ' for key 'a'
-select a,length(a) from t1 order by a;
-a length(a)
-A 1
-b 2
-C 3
-d 7
-E 1
-f 1
-select a,length(a) from t1 order by a desc;
-a length(a)
-f 1
-E 1
-d 7
-C 3
-b 2
-A 1
-select * from t1 where a = 'a';
-p a
-1 A
-select * from t1 where a = 'a ';
-p a
-1 A
-select * from t1 where a = 'd';
-p a
-4 d
-drop table t1;
-create table t1 (
-p int primary key,
-a char(3) character set latin1 collate latin1_bin not null,
-index(a)
-) engine=ndb;
-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');
-select * from t1 order by p;
-p a
-1 aAa
-2 aaa
-3 AAA
-4 aAa
-5 aaa
-6 AAA
-select * from t1 where a = 'aAa' order by p;
-p a
-1 aAa
-4 aAa
-select * from t1 where a = 'aaa' order by p;
-p a
-2 aaa
-5 aaa
-select * from t1 where a = 'AaA' order by p;
-p a
-select * from t1 where a = 'AAA' order by p;
-p a
-3 AAA
-6 AAA
-drop table t1;
-create table t1 (
-p int primary key,
-a char(3) character set latin1 collate latin1_swedish_ci not null,
-index(a)
-) engine=ndb;
-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');
-select * from t1 order by p;
-p a
-1 aAa
-2 aaa
-3 AAA
-4 aAa
-5 aaa
-6 AAA
-select * from t1 where a = 'aAa' order by p;
-p a
-1 aAa
-2 aaa
-3 AAA
-4 aAa
-5 aaa
-6 AAA
-select * from t1 where a = 'aaa' order by p;
-p a
-1 aAa
-2 aaa
-3 AAA
-4 aAa
-5 aaa
-6 AAA
-select * from t1 where a = 'AaA' order by p;
-p a
-1 aAa
-2 aaa
-3 AAA
-4 aAa
-5 aaa
-6 AAA
-select * from t1 where a = 'AAA' order by p;
-p a
-1 aAa
-2 aaa
-3 AAA
-4 aAa
-5 aaa
-6 AAA
-drop table t1;
-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;
-p a length(a)
-1 A 1
-7 a 1
-2 b 2
-8 B 2
-3 C 3
-9 c 3
-4 d 7
-10 D 1
-5 E 1
-11 e 1
-6 f 1
-12 F 3
-select * from t1 where a = 'a ' order by a desc, p desc;
-p a
-7 a
-1 A
-select * from t1 where a >= 'D' order by a, p;
-p a
-4 d
-10 D
-5 E
-11 e
-6 f
-12 F
-select * from t1 where a < 'D' order by a, p;
-p a
-1 A
-7 a
-2 b
-8 B
-3 C
-9 c
-select count(*) from t1 x, t1 y, t1 z where x.a = y.a and y.a = z.a;
-count(*)
-48
-drop table t1;
-create table t1 (
-a char(10) primary key
-) engine=ndbcluster default charset=latin1;
-insert into t1 values ('aaabb');
-select * from t1;
-a
-aaabb
-replace into t1 set a = 'AAABB';
-select * from t1;
-a
-AAABB
-replace into t1 set a = 'aAaBb';
-select * from t1;
-a
-aAaBb
-replace into t1 set a = 'aaabb';
-select * from t1;
-a
-aaabb
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_condition_pushdown.result b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result
deleted file mode 100644
index f2b5b882f10..00000000000
--- a/mysql-test/suite/ndb/r/ndb_condition_pushdown.result
+++ /dev/null
@@ -1,1920 +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_optimizer_switch = @@session.optimizer_switch;
-set optimizer_switch = "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 optimizer_switch = "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 optimizer_switch = "engine_condition_pushdown=off";
-select * from t5 where b like '%jo%' order by a;
-a b
-1 jonas
-3 johan
-set optimizer_switch = "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 optimizer_switch = "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 optimizer_switch = "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 optimizer_switch = "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 optimizer_switch = "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 optimizer_switch = "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 optimizer_switch = "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 optimizer_switch = "engine_condition_pushdown=off";
-SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
-fname lname
-Young Foo
-set optimizer_switch = "engine_condition_pushdown=on";
-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 optimizer_switch = "engine_condition_pushdown=off";
-SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
-fname lname
-Young Foo
-set optimizer_switch = "engine_condition_pushdown=on";
-SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
-fname lname
-Young Foo
-drop table t1;
-create table t1 (a int, b int, c int, d int, primary key using hash(a))
-engine=ndbcluster;
-insert into t1 values (10,1,100,0+0x1111);
-insert into t1 values (20,2,200,0+0x2222);
-insert into t1 values (30,3,300,0+0x3333);
-insert into t1 values (40,4,400,0+0x4444);
-insert into t1 values (50,5,500,0+0x5555);
-set optimizer_switch = "engine_condition_pushdown=on";
-select a,b,d from t1
-where b in (0,1,2,5)
-order by b;
-a b d
-10 1 4369
-20 2 8738
-50 5 21845
--- big filter just below limit
-a b d
-10 1 4369
-20 2 8738
-50 5 21845
--- big filter just above limit
-a b d
-10 1 4369
-20 2 8738
-50 5 21845
-Warnings:
-Warning 4294 Scan filter is too large, discarded
-set optimizer_switch = @old_optimizer_switch;
-DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/suite/ndb/r/ndb_config.result b/mysql-test/suite/ndb/r/ndb_config.result
deleted file mode 100644
index e12741212d6..00000000000
--- a/mysql-test/suite/ndb/r/ndb_config.result
+++ /dev/null
@@ -1,14 +0,0 @@
-ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4,localhost mysqld,5,localhost mysqld,6,localhost
-1,localhost,20971520,1048576 2,localhost,20971520,1048576
-1 localhost 20971520 1048576
-2 localhost 20971520 1048576
-1 2
-ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7, mysqld,8, mysqld,9, mysqld,10, mysqld,11,
-ndbd,1,localhost,52428800,26214400 ndbd,2,localhost,52428800,36700160 ndbd,3,localhost,52428800,52428800 ndbd,4,localhost,52428800,52428800 ndb_mgmd,5,localhost,, mysqld,6,localhost,,
-ndbd,1,localhost ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndb_mgmd,5,localhost mysqld,6, mysqld,7, mysqld,8, mysqld,9, mysqld,10,
-ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndb_mgmd,6,localhost mysqld,1, mysqld,7, mysqld,8, mysqld,9, mysqld,10,
-ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndbd,6,localhost ndb_mgmd,1,localhost ndb_mgmd,2,localhost mysqld,11, mysqld,12, mysqld,13, mysqld,14, mysqld,15,
-shm,3,4,35,3 shm,3,5,35,3 shm,3,6,35,3 shm,4,5,35,4 shm,4,6,35,4 shm,5,6,35,5 tcp,11,3,55,3 tcp,11,4,55,4 tcp,11,5,55,5 tcp,11,6,55,6 tcp,12,3,55,3 tcp,12,4,55,4 tcp,12,5,55,5 tcp,12,6,55,6 tcp,13,3,55,3 tcp,13,4,55,4 tcp,13,5,55,5 tcp,13,6,55,6 tcp,14,3,55,3 tcp,14,4,55,4 tcp,14,5,55,5 tcp,14,6,55,6 tcp,15,3,55,3 tcp,15,4,55,4 tcp,15,5,55,5 tcp,15,6,55,6 tcp,1,3,55,1 tcp,1,4,55,1 tcp,1,5,55,1 tcp,1,6,55,1 tcp,2,3,55,2 tcp,2,4,55,2 tcp,2,5,55,2 tcp,2,6,55,2
-1 2 3
-
-1 2 3
diff --git a/mysql-test/suite/ndb/r/ndb_config2.result b/mysql-test/suite/ndb/r/ndb_config2.result
deleted file mode 100644
index cfd012933c4..00000000000
--- a/mysql-test/suite/ndb/r/ndb_config2.result
+++ /dev/null
@@ -1 +0,0 @@
-shm,3,4,35,3 shm,3,5,35,3 shm,3,6,35,3 shm,4,5,35,4 shm,4,6,35,4 shm,5,6,35,5 tcp,11,3,55,3 tcp,11,4,55,4 tcp,11,5,55,5 tcp,11,6,55,6 tcp,12,3,55,3 tcp,12,4,55,4 tcp,12,5,55,5 tcp,12,6,55,6 tcp,13,3,55,3 tcp,13,4,55,4 tcp,13,5,55,5 tcp,13,6,55,6 tcp,14,3,55,3 tcp,14,4,55,4 tcp,14,5,55,5 tcp,14,6,55,6 tcp,15,3,55,3 tcp,15,4,55,4 tcp,15,5,55,5 tcp,15,6,55,6 tcp,1,3,55,1 tcp,1,4,55,1 tcp,1,5,55,1 tcp,1,6,55,1 tcp,2,3,55,2 tcp,2,4,55,2 tcp,2,5,55,2 tcp,2,6,55,2
diff --git a/mysql-test/suite/ndb/r/ndb_cursor.result b/mysql-test/suite/ndb/r/ndb_cursor.result
deleted file mode 100644
index 3e6f207e153..00000000000
--- a/mysql-test/suite/ndb/r/ndb_cursor.result
+++ /dev/null
@@ -1,42 +0,0 @@
-drop table if exists t1;
-drop table if exists t2;
-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), (4, 40);
-create procedure test_cursor ()
-begin
-declare done int default 0;
-declare temp_a int;
-declare temp_b int;
-declare cur1 cursor for select a,b from t1;
-declare continue handler for sqlstate '02000' set done = 1;
-open cur1;
-repeat
-fetch cur1 into temp_a, temp_b;
-if not done then
-insert into t2 values (temp_a, temp_b);
-end if;
-until done end repeat;
-close cur1;
-end;
-//
-select * from t2 order by a;
-a b
-call test_cursor();
-Warnings:
-Error 1329 No data - zero rows fetched, selected, or processed
-select * from t2 order by a;
-a b
-1 10
-2 20
-3 30
-4 40
-drop procedure test_cursor;
-drop table t1,t2;
-end of 5.1 tests
diff --git a/mysql-test/suite/ndb/r/ndb_database.result b/mysql-test/suite/ndb/r/ndb_database.result
deleted file mode 100644
index e3da4af0265..00000000000
--- a/mysql-test/suite/ndb/r/ndb_database.result
+++ /dev/null
@@ -1,13 +0,0 @@
-drop database if exists mysqltest;
-create database mysqltest;
-create table mysqltest.t1 (a int primary key, b int) engine=ndb;
-use mysqltest;
-show tables;
-Tables_in_mysqltest
-t1
-drop database mysqltest;
-create database mysqltest;
-use mysqltest;
-show tables;
-Tables_in_mysqltest
-drop database mysqltest;
diff --git a/mysql-test/suite/ndb/r/ndb_dd_alter.result b/mysql-test/suite/ndb/r/ndb_dd_alter.result
deleted file mode 100644
index 7ebbb24c84f..00000000000
--- a/mysql-test/suite/ndb/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
-def test t1 p0 NULL 1 NULL KEY NULL NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default ts
-ALTER TABLE test.t1 ADD a2 FLOAT, ADD a3 DOUBLE;
-SELECT * FROM information_schema.partitions WHERE table_name= 't1' AND partition_name = 'p0';
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-def test t1 p0 NULL 1 NULL KEY NULL NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default ts
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3
-1 2.2345 20000001
-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_basic.result b/mysql-test/suite/ndb/r/ndb_dd_basic.result
deleted file mode 100644
index e56c18c5d95..00000000000
--- a/mysql-test/suite/ndb/r/ndb_dd_basic.result
+++ /dev/null
@@ -1,535 +0,0 @@
-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:
-Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE = 4M
-ENGINE=XYZ;
-Warnings:
-Warning 1286 Unknown storage engine 'XYZ'
-Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 12M;
-Warnings:
-Warning 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
-set storage_engine=ndb;
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-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
-DELETE FROM t1;
-INSERT INTO t1 VALUES (3,'1','1');
-BEGIN;
-UPDATE t1 SET b = b + 2 WHERE A = 3;
-DELETE FROM t1 WHERE A = 3;
-INSERT INTO t1 VALUES (3,'0','0');
-COMMIT;
-SELECT * from t1 ORDER BY 1;
-a b c
-3 0 0
-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;
-CREATE TABLE t1 (
-id int unsigned NOT NULL,
-c1 int unsigned NOT NULL,
-c2 int DEFAULT NULL,
-PRIMARY KEY using hash (id),
-UNIQUE KEY c1 using hash (c1))
-TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster;
-insert into t1 values(1, 1, 3);
-insert into t1 values(2, 2, 3);
-update t1 set c1 = 1 where id = 2;
-ERROR 23000: Duplicate entry '1' for key 'c1'
-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/ndb/r/ndb_dd_ddl.result b/mysql-test/suite/ndb/r/ndb_dd_ddl.result
deleted file mode 100644
index 35516efb48c..00000000000
--- a/mysql-test/suite/ndb/r/ndb_dd_ddl.result
+++ /dev/null
@@ -1,315 +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
-Warning 1296 Got error 1514 'Currently there is a limit of one logfile group' from NDB
-Error 1528 Failed to create LOGFILE GROUP
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-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;
-
-# -----------------------------------------------------------------
-# End 5.1 test
-# -----------------------------------------------------------------
-
-# --
-# -- WL#4300: Define privileges for tablespaces.
-# --
-GRANT CREATE TABLESPACE ON *.* TO mysqltest_u1@localhost;
-
-DROP DATABASE IF EXISTS mysqltest2;
-CREATE DATABASE mysqltest2;
-GRANT ALL PRIVILEGES ON mysqltest2.* TO mysqltest_u2@localhost;
-
-# -- Connection: mysqltest_u1@localhost
-
-# -- Grants for mysqltest_u1@localhost:
-SHOW GRANTS;
-Grants for mysqltest_u1@localhost
-GRANT CREATE TABLESPACE ON *.* TO 'mysqltest_u1'@'localhost'
-
-# -- Check CREATE LOGFILE GROUP...
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 1M
-UNDO_BUFFER_SIZE = 1M
-ENGINE = NDB;
-
-# -- Check ALTER LOGFILE GROUP...
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE 1M
-ENGINE = NDB;
-
-# -- Check CREATE TABLESPACE...
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 1M
-ENGINE = NDB;
-
-# -- Check ALTER TABLESPACE...
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-INITIAL_SIZE 1M
-ENGINE = NDB;
-
-# -- Connection: mysqltest_u2@localhost
-
-# -- Grants for mysqltest_u2@localhost:
-SHOW GRANTS;
-Grants for mysqltest_u2@localhost
-GRANT USAGE ON *.* TO 'mysqltest_u2'@'localhost'
-GRANT ALL PRIVILEGES ON `mysqltest2`.* TO 'mysqltest_u2'@'localhost'
-CREATE TABLE t1(c INT) TABLESPACE ts1;
-DROP TABLE t1;
-
-# -- Connection: mysqltest_u1@localhost
-
-
-# -- Check DROP TABLESPACE...
-DROP TABLESPACE ts1
-ENGINE = NDB;
-
-# -- Check DROP LOGFILE GROUP...
-DROP LOGFILE GROUP lg1
-ENGINE = NDB;
-
-# -- Connection: root@localhost
-
-DROP USER mysqltest_u1@localhost;
-DROP USER mysqltest_u2@localhost;
-DROP DATABASE mysqltest2;
-
-# -----------------------------------------------------------------
-# End 6.0 test
-# -----------------------------------------------------------------
diff --git a/mysql-test/suite/ndb/r/ndb_dd_disk2memory.result b/mysql-test/suite/ndb/r/ndb_dd_disk2memory.result
deleted file mode 100644
index 46661f36d1b..00000000000
--- a/mysql-test/suite/ndb/r/ndb_dd_disk2memory.result
+++ /dev/null
@@ -1,505 +0,0 @@
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
-**** Test Setup Section ****
-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 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE table_space1 STORAGE DISK
-ENGINE=NDB;
-CREATE TABLE test.t2
-(pk2 INT NOT NULL PRIMARY KEY, b2 INT NOT NULL, c2 INT NOT NULL)
-ENGINE=NDB;
-
-**** Data load for first test ****
-INSERT INTO test.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);
-INSERT INTO test.t2 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);
-
-*** Test 1 Section Begins ***
-SELECT COUNT(*) FROM test.t2 LEFT JOIN test.t1 ON pk2=pk1 WHERE b2 IN (4);
-COUNT(*)
-1
-SELECT * FROM test.t2 LEFT JOIN test.t1 ON pk2=pk1 WHERE b2 IN (4);
-pk2 b2 c2 pk1 b c
-4 4 4 4 4 4
-SELECT COUNT(*) FROM test.t1 LEFT JOIN test.t2 ON pk1=pk2 WHERE b IN (4);
-COUNT(*)
-1
-SELECT COUNT(*) FROM test.t1 LEFT JOIN test.t2 ON b=b2 WHERE pk1 IN (75);
-COUNT(*)
-1
-SELECT b, c FROM test.t1 LEFT JOIN test.t2 ON pk1=pk2 ORDER BY b;
-b c
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
-7 7
-8 8
-9 9
-10 10
-11 11
-12 12
-13 13
-14 14
-15 15
-16 16
-17 17
-18 18
-19 19
-20 20
-21 21
-22 22
-23 23
-24 24
-25 25
-26 26
-27 27
-28 28
-29 29
-30 30
-31 31
-32 32
-33 33
-34 34
-35 35
-36 36
-37 37
-38 38
-39 39
-40 40
-41 41
-42 42
-43 43
-44 44
-45 45
-46 46
-47 47
-48 48
-49 49
-50 50
-51 51
-52 52
-53 53
-54 54
-55 55
-56 56
-57 57
-58 58
-59 59
-60 60
-61 61
-62 62
-63 63
-64 64
-65 65
-66 66
-67 67
-68 68
-69 69
-70 70
-71 71
-72 72
-73 73
-74 74
-75 75
-
-*** Setup for test 2 ****
-DELETE FROM test.t1;
-INSERT INTO test.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);
-
-**** Test Section 2 ****
-SELECT b, c FROM test.t1 LEFT JOIN test.t2 ON pk1=pk2 ORDER BY b;
-b c
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
-7 7
-8 8
-9 9
-10 10
-11 11
-12 12
-13 13
-14 14
-15 15
-16 16
-17 17
-18 18
-19 19
-20 20
-21 21
-22 22
-23 23
-24 24
-25 25
-26 26
-27 27
-28 28
-29 29
-30 30
-31 31
-32 32
-33 33
-34 34
-35 35
-36 36
-37 37
-38 38
-39 39
-40 40
-41 41
-42 42
-43 43
-44 44
-45 45
-SELECT COUNT(*) FROM test.t1 LEFT JOIN test.t2 ON b=b2;
-COUNT(*)
-45
-SELECT COUNT(*) FROM test.t1 RIGHT JOIN test.t2 ON b=b2;
-COUNT(*)
-75
-SHOW CREATE TABLE test.t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `pk2` int(11) NOT NULL,
- `b2` int(11) NOT NULL,
- `c2` int(11) NOT NULL,
- PRIMARY KEY (`pk2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-SHOW CREATE TABLE test.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 table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-ALTER TABLE test.t2 TABLESPACE table_space1 STORAGE DISK
-ENGINE=NDB;
-SHOW CREATE TABLE test.t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `pk2` int(11) NOT NULL,
- `b2` int(11) NOT NULL,
- `c2` int(11) NOT NULL,
- PRIMARY KEY (`pk2`)
-) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-ALTER TABLE test.t1 STORAGE MEMORY ENGINE=NDBCLUSTER;
-SHOW CREATE TABLE test.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`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-DROP TABLE test.t1;
-DROP TABLE test.t2;
-*** Setup for Test Section 3 ***
-CREATE TABLE test.t1 (
-usr_id INT unsigned NOT NULL,
-uniq_id INT unsigned NOT NULL AUTO_INCREMENT,
-start_num INT unsigned NOT NULL DEFAULT 1,
-increment INT unsigned NOT NULL DEFAULT 1,
-PRIMARY KEY (uniq_id),
-INDEX usr_uniq_idx (usr_id, uniq_id),
-INDEX uniq_usr_idx (uniq_id, usr_id))
-TABLESPACE table_space1 STORAGE DISK
-ENGINE=NDB;
-CREATE TABLE test.t2 (
-id INT unsigned NOT NULL DEFAULT 0,
-usr2_id INT unsigned NOT NULL DEFAULT 0,
-max INT unsigned NOT NULL DEFAULT 0,
-c_amount INT unsigned NOT NULL DEFAULT 0,
-d_max INT unsigned NOT NULL DEFAULT 0,
-d_num INT unsigned NOT NULL DEFAULT 0,
-orig_time INT unsigned NOT NULL DEFAULT 0,
-c_time INT unsigned NOT NULL DEFAULT 0,
-active ENUM ("no","yes") NOT NULL,
-PRIMARY KEY (id,usr2_id),
-INDEX id_idx (id),
-INDEX usr2_idx (usr2_id))
-ENGINE=NDB;
-INSERT INTO test.t1 VALUES (3,NULL,0,50),(3,NULL,0,200),(3,NULL,0,25),(3,NULL,0,84676),(3,NULL,0,235),(3,NULL,0,10),(3,NULL,0,3098),(3,NULL,0,2947),(3,NULL,0,8987),(3,NULL,0,8347654),(3,NULL,0,20398),(3,NULL,0,8976),(3,NULL,0,500),(3,NULL,0,198);
-
-**** Test Section 3 ****
-SELECT test.t1.usr_id,test.t1.uniq_id,test.t1.increment,
-test.t2.usr2_id,test.t2.c_amount,test.t2.max
-FROM test.t1
-LEFT JOIN test.t2 ON test.t2.id = test.t1.uniq_id
-WHERE test.t1.uniq_id = 4
-ORDER BY test.t2.c_amount;
-usr_id uniq_id increment usr2_id c_amount max
-3 4 84676 NULL NULL NULL
-INSERT INTO test.t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes');
-INSERT INTO test.t2 VALUES (4,3,3000,6000,0,0,746584,837484,'yes');
-INSERT INTO test.t2 VALUES (7,3,1000,2000,0,0,746294,937484,'yes');
-SELECT test.t1.usr_id,test.t1.uniq_id,test.t1.increment,
-test.t2.usr2_id,test.t2.c_amount,test.t2.max
-FROM test.t1
-LEFT JOIN test.t2 ON test.t2.id = test.t1.uniq_id
-WHERE test.t1.uniq_id = 4
-ORDER BY test.t2.c_amount;
-usr_id uniq_id increment usr2_id c_amount max
-3 4 84676 3 6000 3000
-
-DROP TABLE test.t1;
-DROP TABLE test.t2;
-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)
-) TABLESPACE table_space1 STORAGE DISK ENGINE=NDB;
-CREATE TABLE test.t2 (
-b1 smallint NOT NULL,
-b2 int NOT NULL,
-b3 bigint NOT NULL,
-b4 char(10),
-b5 decimal(5,1),
-b6 time,
-b7 date,
-b8 datetime,
-b9 VARCHAR(255),
-b10 blob,
-PRIMARY KEY(b1)
-) ENGINE=NDB;
-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`),
- KEY `a2` (`a2`),
- KEY `a3` (`a3`),
- KEY `a8` (`a8`)
-) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-Table Create Table
-t2 CREATE TABLE `t2` (
- `b1` smallint(6) NOT NULL,
- `b2` int(11) NOT NULL,
- `b3` bigint(20) NOT NULL,
- `b4` char(10) DEFAULT NULL,
- `b5` decimal(5,1) DEFAULT NULL,
- `b6` time DEFAULT NULL,
- `b7` date DEFAULT NULL,
- `b8` datetime DEFAULT NULL,
- `b9` varchar(255) DEFAULT NULL,
- `b10` blob,
- PRIMARY KEY (`b1`),
- KEY `b2` (`b2`),
- KEY `b3` (`b3`),
- KEY `b8` (`b8`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-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
-b1 b2 b3 b4 b5 b6 b7 b8 b9 b10
-3 4 3000000001 aaa1 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
-4 5 3000000002 aaa2 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
-5 6 3000000003 aaa3 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
-6 7 3000000004 aaa4 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
-7 8 3000000005 aaa5 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
-8 9 3000000006 aaa6 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
-9 10 3000000007 aaa7 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
-10 11 3000000008 aaa8 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
-11 12 3000000009 aaa9 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
-12 13 3000000010 aaa10 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
-13 14 3000000011 aaa11 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
-14 15 3000000012 aaa12 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
-15 16 3000000013 aaa13 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
-16 17 3000000014 aaa14 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
-17 18 3000000015 aaa15 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
-18 19 3000000016 aaa16 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
-19 20 3000000017 aaa17 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
-20 21 3000000018 aaa18 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
-21 22 3000000019 aaa19 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
-22 23 3000000020 aaa20 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
-COUNT(a1) a1 COUNT(a1)*a1
-1 1 1
-1 2 2
-1 3 3
-1 4 4
-1 5 5
-1 6 6
-1 7 7
-1 8 8
-1 9 9
-1 10 10
-1 11 11
-1 12 12
-1 13 13
-1 14 14
-1 15 15
-1 16 16
-1 17 17
-1 18 18
-1 19 19
-1 20 20
-COUNT(a2) (a2+1) COUNT(a2)*(a2+0)
-1 3 2
-1 4 3
-1 5 4
-1 6 5
-1 7 6
-1 8 7
-1 9 8
-1 10 9
-1 11 10
-1 12 11
-1 13 12
-1 14 13
-1 15 14
-1 16 15
-1 17 16
-1 18 17
-1 19 18
-1 20 19
-1 21 20
-1 22 21
-a
-8
-7
-6
-5
-a c
-8 Clavin
-7 Serge
-6 Jeb
-5 Stewart
-4 Martin
-3 Pekka
-a
-2
-3
-4
-5
-6
-7
-8
-a c
-4 Martin
-5 Stewart
-6 Jeb
-7 Serge
-8 Clavin
-a
-1
-1
-1
-2
-2
-3
-3
-a
-3
-2
-1
-a
-3
-2
-1
-a
-1
-2
-3
-email shipcode
-test1@testdomain.com Z001
-test2@testdomain.com R002
-test2@testdomain.com Z001
-test3@testdomain.com Z001
-email
-test1@testdomain.com
-test2@testdomain.com
-test3@testdomain.com
-email shipcode
-test1@testdomain.com Z001
-test2@testdomain.com Z001
-test2@testdomain.com R002
-test3@testdomain.com Z001
diff --git a/mysql-test/suite/ndb/r/ndb_dd_dump.result b/mysql-test/suite/ndb/r/ndb_dd_dump.result
deleted file mode 100644
index b48073df1fd..00000000000
--- a/mysql-test/suite/ndb/r/ndb_dd_dump.result
+++ /dev/null
@@ -1,452 +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;
-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/suite/ndb/r/ndb_dd_sql_features.result b/mysql-test/suite/ndb/r/ndb_dd_sql_features.result
deleted file mode 100644
index 135250fe7e8..00000000000
--- a/mysql-test/suite/ndb/r/ndb_dd_sql_features.result
+++ /dev/null
@@ -1,599 +0,0 @@
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
-DROP TABLE IF EXISTS test.t3;
-*****
-**** Copy data from table in one table space to table
-**** in different table space
-*****
-CREATE LOGFILE GROUP lg
-ADD UNDOFILE './lg_group/undofile.dat'
- INITIAL_SIZE 16M
-UNDO_BUFFER_SIZE = 1M
-ENGINE=NDB;
-CREATE TABLESPACE ts1
-ADD DATAFILE './table_space1/datafile.dat'
- USE LOGFILE GROUP lg
-INITIAL_SIZE 25M
-ENGINE NDB;
-CREATE TABLESPACE ts2
-ADD DATAFILE './table_space2/datafile.dat'
- USE LOGFILE GROUP lg
-INITIAL_SIZE 20M
-ENGINE NDB;
-CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-CREATE TABLE test.t2 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
-TABLESPACE ts2 STORAGE DISK ENGINE=NDB;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` int(11) NOT NULL,
- `a2` varchar(256) DEFAULT NULL,
- `a3` blob,
- PRIMARY KEY (`a1`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-SHOW CREATE TABLE test.t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a1` int(11) NOT NULL,
- `a2` varchar(256) DEFAULT NULL,
- `a3` blob,
- PRIMARY KEY (`a1`)
-) /*!50100 TABLESPACE ts2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-INSERT INTO test.t1 VALUES (1,'111111','aaaaaaaa');
-INSERT INTO test.t1 VALUES (2,'222222','bbbbbbbb');
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3
-1 111111 aaaaaaaa
-2 222222 bbbbbbbb
-INSERT INTO test.t2(a1,a2,a3) SELECT * FROM test.t1;
-SELECT * FROM test.t2 ORDER BY a1;
-a1 a2 a3
-1 111111 aaaaaaaa
-2 222222 bbbbbbbb
-DROP TABLE test.t1, test.t2;
-set @vc1 = repeat('a', 200);
-set @vc2 = repeat('b', 500);
-set @vc3 = repeat('c', 1000);
-set @vc4 = repeat('d', 4000);
-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 @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);
-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);
-set @d2 = 'dd2';
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-select length(@x0),length(@b1),length(@d1) from dual;
-length(@x0) length(@b1) length(@d1)
-256 2256 3000
-select length(@x0),length(@b2),length(@d2) from dual;
-length(@x0) length(@b2) length(@d2)
-256 20000 30000
-CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(5000), a3 BLOB)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-CREATE TABLE test.t2 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(5000), a3 BLOB)
-TABLESPACE ts2 STORAGE DISK ENGINE=NDB;
-SHOW CREATE TABLE test.t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a1` int(11) NOT NULL,
- `a2` varchar(5000) DEFAULT NULL,
- `a3` blob,
- PRIMARY KEY (`a1`)
-) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-SHOW CREATE TABLE test.t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a1` int(11) NOT NULL,
- `a2` varchar(5000) DEFAULT NULL,
- `a3` blob,
- PRIMARY KEY (`a1`)
-) /*!50100 TABLESPACE ts2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
-INSERT INTO test.t1 VALUES (1,@vc1,@d1);
-INSERT INTO test.t1 VALUES (2,@vc2,@b1);
-INSERT INTO test.t1 VALUES (3,@vc3,@d2);
-INSERT INTO test.t1 VALUES (4,@vc4,@b2);
-SELECT a1,length(a2),substr(a2,180,2),length(a3),substr(a3,1+3*900,3)
-FROM test.t1 WHERE a1=1;
-a1 length(a2) substr(a2,180,2) length(a3) substr(a3,1+3*900,3)
-1 200 aa 3000 dd1
-SELECT a1,length(a2),substr(a2,480,2),length(a3),substr(a3,1+2*900,3)
-FROM test.t1 where a1=2;
-a1 length(a2) substr(a2,480,2) length(a3) substr(a3,1+2*900,3)
-2 500 bb 2256 b1b
-INSERT INTO test.t2(a1,a2,a3) SELECT * FROM test.t1;
-SELECT a1,length(a2),substr(a2,180,2),length(a3),substr(a3,1+3*900,3)
-FROM test.t2 WHERE a1=1;
-a1 length(a2) substr(a2,180,2) length(a3) substr(a3,1+3*900,3)
-1 200 aa 3000 dd1
-SELECT a1,length(a2),substr(a2,480,2),length(a3),substr(a3,1+2*900,3)
-FROM test.t2 where a1=2;
-a1 length(a2) substr(a2,480,2) length(a3) substr(a3,1+2*900,3)
-2 500 bb 2256 b1b
-DROP TABLE test.t1, test.t2;
-*****
-**** Insert, Update, Delete from NDB table with BLOB fields
-*****
-set @vc1 = repeat('a', 200);
-set @vc2 = repeat('b', 500);
-set @vc3 = repeat('c', 1000);
-set @vc4 = repeat('d', 4000);
-set @vc5 = repeat('d', 5000);
-set @bb1 = repeat('1', 2000);
-set @bb2 = repeat('2', 5000);
-set @bb3 = repeat('3', 10000);
-set @bb4 = repeat('4', 40000);
-set @bb5 = repeat('5', 50000);
-select length(@vc1),length(@vc2),length(@vc3),length(@vc4),length(@vc5)
-from dual;
-length(@vc1) length(@vc2) length(@vc3) length(@vc4) length(@vc5)
-200 500 1000 4000 5000
-select length(@bb1),length(@bb2),length(@bb3),length(@bb4),length(@bb5)
-from dual;
-length(@bb1) length(@bb2) length(@bb3) length(@bb4) length(@bb5)
-2000 5000 10000 40000 50000
-CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(5000), a3 BLOB)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-INSERT INTO test.t1 VALUES (1,@vc1,@bb1);
-INSERT INTO test.t1 VALUES (2,@vc2,@bb2);
-INSERT INTO test.t1 VALUES (3,@vc3,@bb3);
-INSERT INTO test.t1 VALUES (4,@vc4,@bb4);
-INSERT INTO test.t1 VALUES (5,@vc5,@bb5);
-UPDATE test.t1 SET a2=@vc5, a3=@bb5 WHERE a1=1;
-SELECT a1,length(a2),substr(a2,4998,2),length(a3),substr(a3,49997,3)
-FROM test.t1 WHERE a1=1;
-a1 length(a2) substr(a2,4998,2) length(a3) substr(a3,49997,3)
-1 5000 dd 50000 555
-UPDATE test.t1 SET a2=@vc4, a3=@bb4 WHERE a1=2;
-SELECT a1,length(a2),substr(a2,3998,2),length(a3),substr(a3,39997,3)
-FROM test.t1 WHERE a1=2;
-a1 length(a2) substr(a2,3998,2) length(a3) substr(a3,39997,3)
-2 4000 dd 40000 444
-UPDATE test.t1 SET a2=@vc2, a3=@bb2 WHERE a1=3;
-SELECT a1,length(a2),substr(a2,498,2),length(a3),substr(a3,3997,3)
-FROM test.t1 WHERE a1=3;
-a1 length(a2) substr(a2,498,2) length(a3) substr(a3,3997,3)
-3 500 bb 5000 222
-UPDATE test.t1 SET a2=@vc3, a3=@bb3 WHERE a1=4;
-SELECT a1,length(a2),substr(a2,998,2),length(a3),substr(a3,9997,3)
-FROM test.t1 WHERE a1=4;
-a1 length(a2) substr(a2,998,2) length(a3) substr(a3,9997,3)
-4 1000 cc 10000 333
-UPDATE test.t1 SET a2=@vc1, a3=@bb1 WHERE a1=5;
-SELECT a1,length(a2),substr(a2,198,2),length(a3),substr(a3,1997,3)
-FROM test.t1 WHERE a1=5;
-a1 length(a2) substr(a2,198,2) length(a3) substr(a3,1997,3)
-5 200 aa 2000 111
-DELETE FROM test.t1 where a1=5;
-SELECT count(*) from test.t1;
-count(*)
-4
-DELETE FROM test.t1 where a1=4;
-SELECT count(*) from test.t1;
-count(*)
-3
-DELETE FROM test.t1 where a1=3;
-SELECT count(*) from test.t1;
-count(*)
-2
-DELETE FROM test.t1 where a1=2;
-SELECT count(*) from test.t1;
-count(*)
-1
-DELETE FROM test.t1 where a1=1;
-SELECT count(*) from test.t1;
-count(*)
-0
-DROP TABLE test.t1;
-*****
-**** Create Stored procedures that use disk based tables
-*****
-CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB//
-CREATE PROCEDURE test.sp1()
-BEGIN
-INSERT INTO test.t1 values (1,'111111','aaaaaaaa');
-END//
-CALL test.sp1();
-SELECT * FROM test.t1;
-a1 a2 a3
-1 111111 aaaaaaaa
-CREATE PROCEDURE test.sp2(n INT, vc VARCHAR(256), blb BLOB)
-BEGIN
-UPDATE test.t1 SET a2=vc, a3=blb where a1=n;
-END//
-CALL test.sp2(1,'222222','bbbbbbbb');
-SELECT * FROM test.t1;
-a1 a2 a3
-1 222222 bbbbbbbb
-DELETE FROM test.t1;
-DROP PROCEDURE test.sp1;
-DROP PROCEDURE test.sp2;
-DROP TABLE test.t1;
-*****
-***** Create function that operate on disk based tables
-*****
-CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-CREATE FUNCTION test.fn1(n INT) RETURNS INT
-BEGIN
-DECLARE v INT;
-SELECT a1 INTO v FROM test.t1 WHERE a1=n;
-RETURN v;
-END//
-CREATE FUNCTION test.fn2(n INT, blb BLOB) RETURNS BLOB
-BEGIN
-DECLARE vv BLOB;
-UPDATE test.t1 SET a3=blb where a1=n;
-SELECT a3 INTO vv FROM test.t1 WHERE a1=n;
-RETURN vv;
-END//
-SELECT test.fn1(10) FROM DUAL;
-test.fn1(10)
-10
-SELECT test.fn2(50, 'new BLOB content') FROM DUAL;
-test.fn2(50, 'new BLOB content')
-new BLOB content
-DELETE FROM test.t1;
-DROP FUNCTION test.fn1;
-DROP FUNCTION test.fn2;
-DROP TABLE test.t1;
-*****
-***** Create triggers that operate on disk based tables
-*****
-CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-CREATE TRIGGER test.trg1 BEFORE INSERT ON test.t1 FOR EACH ROW
-BEGIN
-if isnull(new.a2) then
-set new.a2:= 'trg1 works on a2 field';
-end if;
-if isnull(new.a3) then
-set new.a3:= 'trg1 works on a3 field';
-end if;
-end//
-insert into test.t1 (a1) values (1)//
-insert into test.t1 (a1,a2) values (2, 'ccccccc')//
-select * from test.t1 order by a1//
-a1 a2 a3
-1 trg1 works on a2 field trg1 works on a3 field
-2 ccccccc trg1 works on a3 field
-DELETE FROM test.t1;
-DROP TRIGGER test.trg1;
-DROP TABLE test.t1;
-*****
-***** Create, update views that operate on disk based tables
-*****
-CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-CREATE VIEW test.v1 AS SELECT * FROM test.t1;
-SELECT * FROM test.v1 order by a1;
-a1 a2 a3
-1 aaaaa1 bbbbb1
-2 aaaaa2 bbbbb2
-3 aaaaa3 bbbbb3
-4 aaaaa4 bbbbb4
-5 aaaaa5 bbbbb5
-6 aaaaa6 bbbbb6
-7 aaaaa7 bbbbb7
-8 aaaaa8 bbbbb8
-9 aaaaa9 bbbbb9
-10 aaaaa10 bbbbb10
-CHECK TABLE test.v1, test.t1;
-Table Op Msg_type Msg_text
-test.v1 check status OK
-test.t1 check note The storage engine for the table doesn't support check
-UPDATE test.v1 SET a2='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' WHERE a1=5;
-SELECT * FROM test.v1 order by a1;
-a1 a2 a3
-1 aaaaa1 bbbbb1
-2 aaaaa2 bbbbb2
-3 aaaaa3 bbbbb3
-4 aaaaa4 bbbbb4
-5 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz bbbbb5
-6 aaaaa6 bbbbb6
-7 aaaaa7 bbbbb7
-8 aaaaa8 bbbbb8
-9 aaaaa9 bbbbb9
-10 aaaaa10 bbbbb10
-DROP VIEW test.v1;
-DELETE FROM test.t1;
-DROP TABLE test.t1;
-*****
-***** Create and use disk based table that use auto inc
-*****
-CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-a2 VARCHAR(256), a3 BLOB)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3
-1 aaaaa10 bbbbb10
-2 aaaaa9 bbbbb9
-3 aaaaa8 bbbbb8
-4 aaaaa7 bbbbb7
-5 aaaaa6 bbbbb6
-6 aaaaa5 bbbbb5
-7 aaaaa4 bbbbb4
-8 aaaaa3 bbbbb3
-9 aaaaa2 bbbbb2
-10 aaaaa1 bbbbb1
-DELETE FROM test.t1;
-DROP TABLE test.t1;
-*****
-***** Create test that use transaction (commit, rollback)
-*****
-SET AUTOCOMMIT=0;
-CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-a2 VARCHAR(256), a3 BLOB)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-INSERT INTO test.t1 VALUES(NULL, "aaaaa1", "bbbbb1");
-COMMIT;
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3
-1 aaaaa1 bbbbb1
-INSERT INTO test.t1 VALUES(NULL, "aaaaa2", "bbbbb2");
-ROLLBACK;
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3
-1 aaaaa1 bbbbb1
-DELETE FROM test.t1;
-DROP TABLE test.t1;
-SET AUTOCOMMIT=1;
-CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-a2 VARCHAR(256), a3 BLOB)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-START TRANSACTION;
-INSERT INTO test.t1 VALUES(NULL, "aaaaa1", "bbbbb1");
-COMMIT;
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3
-1 aaaaa1 bbbbb1
-START TRANSACTION;
-INSERT INTO test.t1 VALUES(NULL, "aaaaa2", "bbbbb2");
-ROLLBACK;
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3
-1 aaaaa1 bbbbb1
-DELETE FROM test.t1;
-DROP TABLE test.t1;
-*****
-***** Create test that uses locks
-*****
-drop table if exists test.t1;
-CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-a2 VARCHAR(256), a3 BLOB)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-LOCK TABLES test.t1 write;
-INSERT INTO test.t1 VALUES(NULL, "aaaaa1", "bbbbb1");
-INSERT INTO test.t1 VALUES(NULL, "aaaaa2", "bbbbb2");
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3
-1 aaaaa1 bbbbb1
-2 aaaaa2 bbbbb2
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3
-1 aaaaa1 bbbbb1
-2 aaaaa2 bbbbb2
-INSERT INTO test.t1 VALUES(NULL, "aaaaa3", "bbbbb3");
-UNLOCK TABLES;
-INSERT INTO test.t1 VALUES(NULL, "aaaaa3", "bbbbb3");
-SELECT * FROM test.t1 ORDER BY a1;
-a1 a2 a3
-1 aaaaa1 bbbbb1
-2 aaaaa2 bbbbb2
-3 aaaaa3 bbbbb3
-4 aaaaa3 bbbbb3
-DELETE FROM test.t1;
-DROP TABLE test.t1;
-*****
-***** Create large disk base table, do random queries, check cache hits
-*****
-set @vc1 = repeat('a', 200);
-SELECT @vc1 FROM DUAL;
-@vc1
-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-set @vc2 = repeat('b', 500);
-set @vc3 = repeat('b', 998);
-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 @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);
-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);
-set @d2 = 'dd2';
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-select length(@x0),length(@b1),length(@d1) from dual;
-length(@x0) length(@b1) length(@d1)
-256 2256 3000
-select length(@x0),length(@b2),length(@d2) from dual;
-length(@x0) length(@b2) length(@d2)
-256 20000 30000
-CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(1000), a3 BLOB)
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-INSERT INTO test.t1 values(1,@vc1,@d1);
-INSERT INTO test.t1 values(2,@vc2,@d2);
-explain SELECT * from test.t1 WHERE a1 = 1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 const PRIMARY PRIMARY 4 const #
-SELECT a1,length(a2),substr(a2,1+2*900,2),length(a3),substr(a3,1+3*900,3)
-FROM test.t1 WHERE a1=1 ORDER BY a1;
-a1 length(a2) substr(a2,1+2*900,2) length(a3) substr(a3,1+3*900,3)
-1 200 3000 dd1
-SELECT a1,length(a2),substr(a2,1+2*9000,2),length(a3),substr(a3,1+3*9000,3)
-FROM test.t1 where a1=2 ORDER BY a1;
-a1 length(a2) substr(a2,1+2*9000,2) length(a3) substr(a3,1+3*9000,3)
-2 500 30000 dd2
-UPDATE test.t1 set a2=@vc2,a3=@d2 where a1=1;
-UPDATE test.t1 set a2=@vc1,a3=@d1 where a1=2;
-SELECT a1,length(a2),substr(a2,1+2*9000,2),length(a3),substr(a3,1+3*9000,3)
-FROM test.t1 where a1=1;
-a1 length(a2) substr(a2,1+2*9000,2) length(a3) substr(a3,1+3*9000,3)
-1 500 30000 dd2
-SELECT a1,length(a2),substr(a2,1+2*900,2),length(a3),substr(a3,1+3*900,3)
-FROM test.t1 where a1=2;
-a1 length(a2) substr(a2,1+2*900,2) length(a3) substr(a3,1+3*900,3)
-2 200 3000 dd1
-DELETE FROM test.t1;
-DROP TABLE test.t1;
-*****
-***** Create test that uses COUNT(), SUM(), MAX(), MIN(), NOW(),
-***** USER(), TRUNCATE
-*****
-CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256),
-a3 BLOB, a4 DATE, a5 CHAR(250))
-TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-SELECT COUNT(*) from test.t1;
-COUNT(*)
-100
-SELECT SUM(a1) from test.t1;
-SUM(a1)
-5050
-SELECT MIN(a1) from test.t1;
-MIN(a1)
-1
-SELECT MAX(a1) from test.t1;
-MAX(a1)
-100
-SELECT a5 from test.t1 where a1=50;
-a5
-root@localhost
-SELECT * from test.t1 order by a1;
-a1 a2 a3 a4 a5
-1 aaaaaaaaaaaaaaaa1 bbbbbbbbbbbbbbbbbb1 2006-06-20 root@localhost
-2 aaaaaaaaaaaaaaaa2 bbbbbbbbbbbbbbbbbb2 2006-06-20 root@localhost
-3 aaaaaaaaaaaaaaaa3 bbbbbbbbbbbbbbbbbb3 2006-06-20 root@localhost
-4 aaaaaaaaaaaaaaaa4 bbbbbbbbbbbbbbbbbb4 2006-06-20 root@localhost
-5 aaaaaaaaaaaaaaaa5 bbbbbbbbbbbbbbbbbb5 2006-06-20 root@localhost
-6 aaaaaaaaaaaaaaaa6 bbbbbbbbbbbbbbbbbb6 2006-06-20 root@localhost
-7 aaaaaaaaaaaaaaaa7 bbbbbbbbbbbbbbbbbb7 2006-06-20 root@localhost
-8 aaaaaaaaaaaaaaaa8 bbbbbbbbbbbbbbbbbb8 2006-06-20 root@localhost
-9 aaaaaaaaaaaaaaaa9 bbbbbbbbbbbbbbbbbb9 2006-06-20 root@localhost
-10 aaaaaaaaaaaaaaaa10 bbbbbbbbbbbbbbbbbb10 2006-06-20 root@localhost
-11 aaaaaaaaaaaaaaaa11 bbbbbbbbbbbbbbbbbb11 2006-06-20 root@localhost
-12 aaaaaaaaaaaaaaaa12 bbbbbbbbbbbbbbbbbb12 2006-06-20 root@localhost
-13 aaaaaaaaaaaaaaaa13 bbbbbbbbbbbbbbbbbb13 2006-06-20 root@localhost
-14 aaaaaaaaaaaaaaaa14 bbbbbbbbbbbbbbbbbb14 2006-06-20 root@localhost
-15 aaaaaaaaaaaaaaaa15 bbbbbbbbbbbbbbbbbb15 2006-06-20 root@localhost
-16 aaaaaaaaaaaaaaaa16 bbbbbbbbbbbbbbbbbb16 2006-06-20 root@localhost
-17 aaaaaaaaaaaaaaaa17 bbbbbbbbbbbbbbbbbb17 2006-06-20 root@localhost
-18 aaaaaaaaaaaaaaaa18 bbbbbbbbbbbbbbbbbb18 2006-06-20 root@localhost
-19 aaaaaaaaaaaaaaaa19 bbbbbbbbbbbbbbbbbb19 2006-06-20 root@localhost
-20 aaaaaaaaaaaaaaaa20 bbbbbbbbbbbbbbbbbb20 2006-06-20 root@localhost
-21 aaaaaaaaaaaaaaaa21 bbbbbbbbbbbbbbbbbb21 2006-06-20 root@localhost
-22 aaaaaaaaaaaaaaaa22 bbbbbbbbbbbbbbbbbb22 2006-06-20 root@localhost
-23 aaaaaaaaaaaaaaaa23 bbbbbbbbbbbbbbbbbb23 2006-06-20 root@localhost
-24 aaaaaaaaaaaaaaaa24 bbbbbbbbbbbbbbbbbb24 2006-06-20 root@localhost
-25 aaaaaaaaaaaaaaaa25 bbbbbbbbbbbbbbbbbb25 2006-06-20 root@localhost
-26 aaaaaaaaaaaaaaaa26 bbbbbbbbbbbbbbbbbb26 2006-06-20 root@localhost
-27 aaaaaaaaaaaaaaaa27 bbbbbbbbbbbbbbbbbb27 2006-06-20 root@localhost
-28 aaaaaaaaaaaaaaaa28 bbbbbbbbbbbbbbbbbb28 2006-06-20 root@localhost
-29 aaaaaaaaaaaaaaaa29 bbbbbbbbbbbbbbbbbb29 2006-06-20 root@localhost
-30 aaaaaaaaaaaaaaaa30 bbbbbbbbbbbbbbbbbb30 2006-06-20 root@localhost
-31 aaaaaaaaaaaaaaaa31 bbbbbbbbbbbbbbbbbb31 2006-06-20 root@localhost
-32 aaaaaaaaaaaaaaaa32 bbbbbbbbbbbbbbbbbb32 2006-06-20 root@localhost
-33 aaaaaaaaaaaaaaaa33 bbbbbbbbbbbbbbbbbb33 2006-06-20 root@localhost
-34 aaaaaaaaaaaaaaaa34 bbbbbbbbbbbbbbbbbb34 2006-06-20 root@localhost
-35 aaaaaaaaaaaaaaaa35 bbbbbbbbbbbbbbbbbb35 2006-06-20 root@localhost
-36 aaaaaaaaaaaaaaaa36 bbbbbbbbbbbbbbbbbb36 2006-06-20 root@localhost
-37 aaaaaaaaaaaaaaaa37 bbbbbbbbbbbbbbbbbb37 2006-06-20 root@localhost
-38 aaaaaaaaaaaaaaaa38 bbbbbbbbbbbbbbbbbb38 2006-06-20 root@localhost
-39 aaaaaaaaaaaaaaaa39 bbbbbbbbbbbbbbbbbb39 2006-06-20 root@localhost
-40 aaaaaaaaaaaaaaaa40 bbbbbbbbbbbbbbbbbb40 2006-06-20 root@localhost
-41 aaaaaaaaaaaaaaaa41 bbbbbbbbbbbbbbbbbb41 2006-06-20 root@localhost
-42 aaaaaaaaaaaaaaaa42 bbbbbbbbbbbbbbbbbb42 2006-06-20 root@localhost
-43 aaaaaaaaaaaaaaaa43 bbbbbbbbbbbbbbbbbb43 2006-06-20 root@localhost
-44 aaaaaaaaaaaaaaaa44 bbbbbbbbbbbbbbbbbb44 2006-06-20 root@localhost
-45 aaaaaaaaaaaaaaaa45 bbbbbbbbbbbbbbbbbb45 2006-06-20 root@localhost
-46 aaaaaaaaaaaaaaaa46 bbbbbbbbbbbbbbbbbb46 2006-06-20 root@localhost
-47 aaaaaaaaaaaaaaaa47 bbbbbbbbbbbbbbbbbb47 2006-06-20 root@localhost
-48 aaaaaaaaaaaaaaaa48 bbbbbbbbbbbbbbbbbb48 2006-06-20 root@localhost
-49 aaaaaaaaaaaaaaaa49 bbbbbbbbbbbbbbbbbb49 2006-06-20 root@localhost
-50 aaaaaaaaaaaaaaaa50 bbbbbbbbbbbbbbbbbb50 2006-06-20 root@localhost
-51 aaaaaaaaaaaaaaaa51 bbbbbbbbbbbbbbbbbb51 2006-06-20 root@localhost
-52 aaaaaaaaaaaaaaaa52 bbbbbbbbbbbbbbbbbb52 2006-06-20 root@localhost
-53 aaaaaaaaaaaaaaaa53 bbbbbbbbbbbbbbbbbb53 2006-06-20 root@localhost
-54 aaaaaaaaaaaaaaaa54 bbbbbbbbbbbbbbbbbb54 2006-06-20 root@localhost
-55 aaaaaaaaaaaaaaaa55 bbbbbbbbbbbbbbbbbb55 2006-06-20 root@localhost
-56 aaaaaaaaaaaaaaaa56 bbbbbbbbbbbbbbbbbb56 2006-06-20 root@localhost
-57 aaaaaaaaaaaaaaaa57 bbbbbbbbbbbbbbbbbb57 2006-06-20 root@localhost
-58 aaaaaaaaaaaaaaaa58 bbbbbbbbbbbbbbbbbb58 2006-06-20 root@localhost
-59 aaaaaaaaaaaaaaaa59 bbbbbbbbbbbbbbbbbb59 2006-06-20 root@localhost
-60 aaaaaaaaaaaaaaaa60 bbbbbbbbbbbbbbbbbb60 2006-06-20 root@localhost
-61 aaaaaaaaaaaaaaaa61 bbbbbbbbbbbbbbbbbb61 2006-06-20 root@localhost
-62 aaaaaaaaaaaaaaaa62 bbbbbbbbbbbbbbbbbb62 2006-06-20 root@localhost
-63 aaaaaaaaaaaaaaaa63 bbbbbbbbbbbbbbbbbb63 2006-06-20 root@localhost
-64 aaaaaaaaaaaaaaaa64 bbbbbbbbbbbbbbbbbb64 2006-06-20 root@localhost
-65 aaaaaaaaaaaaaaaa65 bbbbbbbbbbbbbbbbbb65 2006-06-20 root@localhost
-66 aaaaaaaaaaaaaaaa66 bbbbbbbbbbbbbbbbbb66 2006-06-20 root@localhost
-67 aaaaaaaaaaaaaaaa67 bbbbbbbbbbbbbbbbbb67 2006-06-20 root@localhost
-68 aaaaaaaaaaaaaaaa68 bbbbbbbbbbbbbbbbbb68 2006-06-20 root@localhost
-69 aaaaaaaaaaaaaaaa69 bbbbbbbbbbbbbbbbbb69 2006-06-20 root@localhost
-70 aaaaaaaaaaaaaaaa70 bbbbbbbbbbbbbbbbbb70 2006-06-20 root@localhost
-71 aaaaaaaaaaaaaaaa71 bbbbbbbbbbbbbbbbbb71 2006-06-20 root@localhost
-72 aaaaaaaaaaaaaaaa72 bbbbbbbbbbbbbbbbbb72 2006-06-20 root@localhost
-73 aaaaaaaaaaaaaaaa73 bbbbbbbbbbbbbbbbbb73 2006-06-20 root@localhost
-74 aaaaaaaaaaaaaaaa74 bbbbbbbbbbbbbbbbbb74 2006-06-20 root@localhost
-75 aaaaaaaaaaaaaaaa75 bbbbbbbbbbbbbbbbbb75 2006-06-20 root@localhost
-76 aaaaaaaaaaaaaaaa76 bbbbbbbbbbbbbbbbbb76 2006-06-20 root@localhost
-77 aaaaaaaaaaaaaaaa77 bbbbbbbbbbbbbbbbbb77 2006-06-20 root@localhost
-78 aaaaaaaaaaaaaaaa78 bbbbbbbbbbbbbbbbbb78 2006-06-20 root@localhost
-79 aaaaaaaaaaaaaaaa79 bbbbbbbbbbbbbbbbbb79 2006-06-20 root@localhost
-80 aaaaaaaaaaaaaaaa80 bbbbbbbbbbbbbbbbbb80 2006-06-20 root@localhost
-81 aaaaaaaaaaaaaaaa81 bbbbbbbbbbbbbbbbbb81 2006-06-20 root@localhost
-82 aaaaaaaaaaaaaaaa82 bbbbbbbbbbbbbbbbbb82 2006-06-20 root@localhost
-83 aaaaaaaaaaaaaaaa83 bbbbbbbbbbbbbbbbbb83 2006-06-20 root@localhost
-84 aaaaaaaaaaaaaaaa84 bbbbbbbbbbbbbbbbbb84 2006-06-20 root@localhost
-85 aaaaaaaaaaaaaaaa85 bbbbbbbbbbbbbbbbbb85 2006-06-20 root@localhost
-86 aaaaaaaaaaaaaaaa86 bbbbbbbbbbbbbbbbbb86 2006-06-20 root@localhost
-87 aaaaaaaaaaaaaaaa87 bbbbbbbbbbbbbbbbbb87 2006-06-20 root@localhost
-88 aaaaaaaaaaaaaaaa88 bbbbbbbbbbbbbbbbbb88 2006-06-20 root@localhost
-89 aaaaaaaaaaaaaaaa89 bbbbbbbbbbbbbbbbbb89 2006-06-20 root@localhost
-90 aaaaaaaaaaaaaaaa90 bbbbbbbbbbbbbbbbbb90 2006-06-20 root@localhost
-91 aaaaaaaaaaaaaaaa91 bbbbbbbbbbbbbbbbbb91 2006-06-20 root@localhost
-92 aaaaaaaaaaaaaaaa92 bbbbbbbbbbbbbbbbbb92 2006-06-20 root@localhost
-93 aaaaaaaaaaaaaaaa93 bbbbbbbbbbbbbbbbbb93 2006-06-20 root@localhost
-94 aaaaaaaaaaaaaaaa94 bbbbbbbbbbbbbbbbbb94 2006-06-20 root@localhost
-95 aaaaaaaaaaaaaaaa95 bbbbbbbbbbbbbbbbbb95 2006-06-20 root@localhost
-96 aaaaaaaaaaaaaaaa96 bbbbbbbbbbbbbbbbbb96 2006-06-20 root@localhost
-97 aaaaaaaaaaaaaaaa97 bbbbbbbbbbbbbbbbbb97 2006-06-20 root@localhost
-98 aaaaaaaaaaaaaaaa98 bbbbbbbbbbbbbbbbbb98 2006-06-20 root@localhost
-99 aaaaaaaaaaaaaaaa99 bbbbbbbbbbbbbbbbbb99 2006-06-20 root@localhost
-100 aaaaaaaaaaaaaaaa100 bbbbbbbbbbbbbbbbbb100 2006-06-20 root@localhost
-DROP TABLE test.t1;
-ALTER TABLESPACE ts1
-DROP DATAFILE './table_space1/datafile.dat'
- ENGINE=NDB;
-DROP TABLESPACE ts1 ENGINE=NDB;
-ALTER TABLESPACE ts2
-DROP DATAFILE './table_space2/datafile.dat'
- ENGINE=NDB;
-DROP TABLESPACE ts2 ENGINE=NDB;
-DROP LOGFILE GROUP lg
-ENGINE=NDB;
diff --git a/mysql-test/suite/ndb/r/ndb_gis.result b/mysql-test/suite/ndb/r/ndb_gis.result
deleted file mode 100644
index 76a53804d8f..00000000000
--- a/mysql-test/suite/ndb/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.14213562373095
-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.416666666666668 25.416666666666668)
-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.58852775304245 17.426536064113982)
-118 POINT(55.58852775304245 17.426536064113982)
-119 POINT(2 2)
-SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
-fid Area(g)
-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:
-Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
-INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
-INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
-INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
-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 optimizer_switch = "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.14213562373095
-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.416666666666668 25.416666666666668)
-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.58852775304245 17.426536064113982)
-118 POINT(55.58852775304245 17.426536064113982)
-119 POINT(2 2)
-SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
-fid Area(g)
-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:
-Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
-INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
-INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
-INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
-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/suite/ndb/r/ndb_grant.result b/mysql-test/suite/ndb/r/ndb_grant.result
deleted file mode 100644
index 6192a7cace5..00000000000
--- a/mysql-test/suite/ndb/r/ndb_grant.result
+++ /dev/null
@@ -1,444 +0,0 @@
-drop table if exists t1;
-SET NAMES binary;
-use mysql;
-alter table columns_priv engine=ndb;
-alter table db engine=ndb;
-alter table func engine=ndb;
-alter table help_category engine=ndb;
-alter table help_keyword engine=ndb;
-alter table help_relation engine=ndb;
-alter table help_topic engine=ndb;
-alter table host engine=ndb;
-alter table tables_priv engine=ndb;
-alter table time_zone engine=ndb;
-alter table time_zone_leap_second engine=ndb;
-alter table time_zone_name engine=ndb;
-alter table time_zone_transition engine=ndb;
-alter table time_zone_transition_type engine=ndb;
-alter table user engine=ndb;
-use test;
-delete from mysql.user where user='mysqltest_1';
-delete from mysql.db where user='mysqltest_1';
-flush privileges;
-begin;
-grant select on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
-commit;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
-begin;
-grant delete on mysqltest.* to mysqltest_1@localhost;
-commit;
-select * from mysql.user where user="mysqltest_1";
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections
-localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N 0 0 0
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
-GRANT SELECT, DELETE ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
-begin;
-revoke delete on mysqltest.* from mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
-begin;
-grant select on mysqltest.* to mysqltest_1@localhost require NONE;
-commit;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
-begin;
-grant USAGE on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "testsubject" ISSUER "MySQL AB";
-commit;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE ISSUER 'MySQL AB' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA'
-GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
-begin;
-revoke all privileges on mysqltest.* from mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE ISSUER 'MySQL AB' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA'
-delete from mysql.user where user='mysqltest_1';
-flush privileges;
-begin;
-grant CREATE TEMPORARY TABLES, LOCK TABLES on mysqltest.* to mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
-flush privileges;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
-begin;
-revoke CREATE TEMPORARY TABLES on mysqltest.* from mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
-begin;
-grant ALL PRIVILEGES on mysqltest.* to mysqltest_1@localhost with GRANT OPTION;
-commit;
-flush privileges;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
-begin;
-revoke LOCK TABLES, ALTER on mysqltest.* from mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TEMPORARY TABLES, CREATE VIEW, SHOW VIEW ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
-begin;
-revoke all privileges on mysqltest.* from mysqltest_1@localhost;
-commit;
-delete from mysql.user where user='mysqltest_1';
-flush privileges;
-begin;
-grant usage on test.* to mysqltest_1@localhost with grant option;
-commit;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT USAGE ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
-GRANT USAGE ON `test`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
-delete from mysql.user where user='mysqltest_1';
-delete from mysql.db where user='mysqltest_1';
-delete from mysql.tables_priv where user='mysqltest_1';
-delete from mysql.columns_priv where user='mysqltest_1';
-flush privileges;
-show grants for mysqltest_1@localhost;
-ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host 'localhost'
-create table t1 (a int);
-begin;
-GRANT select,update,insert on t1 to mysqltest_1@localhost;
-GRANT select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT, SELECT (a), INSERT, INSERT (a), UPDATE, UPDATE (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
-select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
-table_priv column_priv
-Select,Insert,Update Select,Insert,Update,References
-begin;
-REVOKE select (a), update on t1 from mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT SELECT, INSERT, INSERT (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
-begin;
-REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
-GRANT REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
-begin;
-GRANT select,references on t1 to mysqltest_1@localhost;
-commit;
-select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
-table_priv column_priv
-Select,References References
-begin;
-grant all on test.* to mysqltest_3@localhost with grant option;
-revoke all on test.* from mysqltest_3@localhost;
-commit;
-show grants for mysqltest_3@localhost;
-Grants for mysqltest_3@localhost
-GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost'
-GRANT USAGE ON `test`.* TO 'mysqltest_3'@'localhost' WITH GRANT OPTION
-begin;
-revoke grant option on test.* from mysqltest_3@localhost;
-commit;
-show grants for mysqltest_3@localhost;
-Grants for mysqltest_3@localhost
-GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost'
-begin;
-grant all on test.t1 to mysqltest_2@localhost with grant option;
-revoke all on test.t1 from mysqltest_2@localhost;
-commit;
-show grants for mysqltest_2@localhost;
-Grants for mysqltest_2@localhost
-GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost'
-GRANT USAGE ON `test`.`t1` TO 'mysqltest_2'@'localhost' WITH GRANT OPTION
-begin;
-revoke grant option on test.t1 from mysqltest_2@localhost;
-commit;
-show grants for mysqltest_2@localhost;
-Grants for mysqltest_2@localhost
-GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost'
-delete from mysql.user where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
-delete from mysql.db where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
-delete from mysql.tables_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
-delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
-flush privileges;
-drop table t1;
-begin;
-GRANT FILE on mysqltest.* to mysqltest_1@localhost;
-ERROR HY000: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
-commit;
-select 1;
-1
-1
-create database mysqltest1;
-begin;
-grant usage on mysqltest1.* to test6123 identified by 'magic123';
-commit;
-select host,db,user,select_priv,insert_priv from mysql.db where db="mysqltest1";
-host db user select_priv insert_priv
-delete from mysql.user where user='test6123';
-drop database mysqltest1;
-create table t1 (a int);
-begin;
-grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION;
-commit;
-show grants for drop_user2@localhost;
-Grants for drop_user2@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user2'@'localhost' WITH GRANT OPTION
-begin;
-revoke all privileges, grant option from drop_user2@localhost;
-commit;
-drop user drop_user2@localhost;
-begin;
-grant ALL PRIVILEGES on *.* to drop_user@localhost with GRANT OPTION;
-grant ALL PRIVILEGES on test.* to drop_user@localhost with GRANT OPTION;
-grant select(a) on test.t1 to drop_user@localhost;
-commit;
-show grants for drop_user@localhost;
-Grants for drop_user@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT ALL PRIVILEGES ON `test`.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT SELECT (a) ON `test`.`t1` TO 'drop_user'@'localhost'
-set sql_mode=ansi_quotes;
-show grants for drop_user@localhost;
-Grants for drop_user@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT ALL PRIVILEGES ON "test".* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT SELECT (a) ON "test"."t1" TO 'drop_user'@'localhost'
-set sql_mode=default;
-set sql_quote_show_create=0;
-show grants for drop_user@localhost;
-Grants for drop_user@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT ALL PRIVILEGES ON test.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT SELECT (a) ON test.t1 TO 'drop_user'@'localhost'
-set sql_mode="ansi_quotes";
-show grants for drop_user@localhost;
-Grants for drop_user@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT ALL PRIVILEGES ON test.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT SELECT (a) ON test.t1 TO 'drop_user'@'localhost'
-set sql_quote_show_create=1;
-show grants for drop_user@localhost;
-Grants for drop_user@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT ALL PRIVILEGES ON "test".* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT SELECT (a) ON "test"."t1" TO 'drop_user'@'localhost'
-set sql_mode="";
-show grants for drop_user@localhost;
-Grants for drop_user@localhost
-GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT ALL PRIVILEGES ON `test`.* TO 'drop_user'@'localhost' WITH GRANT OPTION
-GRANT SELECT (a) ON `test`.`t1` TO 'drop_user'@'localhost'
-revoke all privileges, grant option from drop_user@localhost;
-show grants for drop_user@localhost;
-Grants for drop_user@localhost
-GRANT USAGE ON *.* TO 'drop_user'@'localhost'
-drop user drop_user@localhost;
-begin;
-revoke all privileges, grant option from drop_user@localhost;
-ERROR HY000: Can't revoke all privileges, grant for one or more of the requested users
-commit;
-begin;
-grant select(a) on test.t1 to drop_user1@localhost;
-commit;
-flush privileges;
-begin;
-grant select on test.t1 to drop_user2@localhost;
-grant select on test.* to drop_user3@localhost;
-grant select on *.* to drop_user4@localhost;
-commit;
-flush privileges;
-drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost,
-drop_user4@localhost;
-begin;
-revoke all privileges, grant option from drop_user1@localhost, drop_user2@localhost,
-drop_user3@localhost, drop_user4@localhost;
-ERROR HY000: Can't revoke all privileges, grant for one or more of the requested users
-commit;
-flush privileges;
-drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost,
-drop_user4@localhost;
-drop table t1;
-begin;
-grant usage on *.* to mysqltest_1@localhost identified by "password";
-grant select, update, insert on test.* to mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-Grants for mysqltest_1@localhost
-GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19'
-GRANT SELECT, INSERT, UPDATE ON `test`.* TO 'mysqltest_1'@'localhost'
-drop user mysqltest_1@localhost;
-SET NAMES koi8r;
-CREATE DATABASE ÂÄ;
-USE ÂÄ;
-CREATE TABLE ÔÁÂ (ËÏÌ int);
-begin;
-GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost;
-commit;
-SHOW GRANTS FOR ÀÚÅÒ@localhost;
-Grants for ÀÚÅÒ@localhost
-GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost'
-GRANT SELECT ON `ÂÄ`.* TO 'ÀÚÅÒ'@'localhost'
-begin;
-REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost;
-commit;
-begin;
-GRANT SELECT ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost;
-commit;
-SHOW GRANTS FOR ÀÚÅÒ@localhost;
-Grants for ÀÚÅÒ@localhost
-GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost'
-GRANT SELECT ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost'
-begin;
-REVOKE SELECT ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost;
-commit;
-begin;
-GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost;
-commit;
-SHOW GRANTS FOR ÀÚÅÒ@localhost;
-Grants for ÀÚÅÒ@localhost
-GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost'
-GRANT SELECT (ËÏÌ) ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost'
-begin;
-REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost;
-commit;
-DROP DATABASE ÂÄ;
-SET NAMES latin1;
-USE test;
-CREATE TABLE t1 (a int );
-CREATE TABLE t2 LIKE t1;
-CREATE TABLE t3 LIKE t1;
-CREATE TABLE t4 LIKE t1;
-CREATE TABLE t5 LIKE t1;
-CREATE TABLE t6 LIKE t1;
-CREATE TABLE t7 LIKE t1;
-CREATE TABLE t8 LIKE t1;
-CREATE TABLE t9 LIKE t1;
-CREATE TABLE t10 LIKE t1;
-CREATE DATABASE testdb1;
-CREATE DATABASE testdb2;
-CREATE DATABASE testdb3;
-CREATE DATABASE testdb4;
-CREATE DATABASE testdb5;
-CREATE DATABASE testdb6;
-CREATE DATABASE testdb7;
-CREATE DATABASE testdb8;
-CREATE DATABASE testdb9;
-CREATE DATABASE testdb10;
-begin;
-GRANT ALL ON testdb1.* TO testuser@localhost;
-GRANT ALL ON testdb2.* TO testuser@localhost;
-GRANT ALL ON testdb3.* TO testuser@localhost;
-GRANT ALL ON testdb4.* TO testuser@localhost;
-GRANT ALL ON testdb5.* TO testuser@localhost;
-GRANT ALL ON testdb6.* TO testuser@localhost;
-GRANT ALL ON testdb7.* TO testuser@localhost;
-GRANT ALL ON testdb8.* TO testuser@localhost;
-GRANT ALL ON testdb9.* TO testuser@localhost;
-GRANT ALL ON testdb10.* TO testuser@localhost;
-GRANT SELECT ON test.t1 TO testuser@localhost;
-GRANT SELECT ON test.t2 TO testuser@localhost;
-GRANT SELECT ON test.t3 TO testuser@localhost;
-GRANT SELECT ON test.t4 TO testuser@localhost;
-GRANT SELECT ON test.t5 TO testuser@localhost;
-GRANT SELECT ON test.t6 TO testuser@localhost;
-GRANT SELECT ON test.t7 TO testuser@localhost;
-GRANT SELECT ON test.t8 TO testuser@localhost;
-GRANT SELECT ON test.t9 TO testuser@localhost;
-GRANT SELECT ON test.t10 TO testuser@localhost;
-GRANT SELECT (a) ON test.t1 TO testuser@localhost;
-GRANT SELECT (a) ON test.t2 TO testuser@localhost;
-GRANT SELECT (a) ON test.t3 TO testuser@localhost;
-GRANT SELECT (a) ON test.t4 TO testuser@localhost;
-GRANT SELECT (a) ON test.t5 TO testuser@localhost;
-GRANT SELECT (a) ON test.t6 TO testuser@localhost;
-GRANT SELECT (a) ON test.t7 TO testuser@localhost;
-GRANT SELECT (a) ON test.t8 TO testuser@localhost;
-GRANT SELECT (a) ON test.t9 TO testuser@localhost;
-GRANT SELECT (a) ON test.t10 TO testuser@localhost;
-commit;
-begin;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM testuser@localhost;
-commit;
-SHOW GRANTS FOR testuser@localhost;
-Grants for testuser@localhost
-GRANT USAGE ON *.* TO 'testuser'@'localhost'
-DROP USER testuser@localhost;
-DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-DROP DATABASE testdb1;
-DROP DATABASE testdb2;
-DROP DATABASE testdb3;
-DROP DATABASE testdb4;
-DROP DATABASE testdb5;
-DROP DATABASE testdb6;
-DROP DATABASE testdb7;
-DROP DATABASE testdb8;
-DROP DATABASE testdb9;
-DROP DATABASE testdb10;
-SHOW PRIVILEGES;
-Privilege Context Comment
-Alter Tables To alter the table
-Create Databases,Tables,Indexes To create new databases and tables
-Create temporary tables Databases To use CREATE TEMPORARY TABLE
-Create view Tables To create new views
-Delete Tables To delete existing rows
-Drop Databases,Tables To drop databases, tables, and views
-File File access on server To read and write files on the server
-Grant option Databases,Tables To give to other users those privileges you possess
-Index Tables To create or drop indexes
-Insert Tables To insert data into tables
-Lock tables Databases To use LOCK TABLES (together with SELECT privilege)
-Process Server Admin To view the plain text of currently executing queries
-References Databases,Tables To have references on tables
-Reload Server Admin To reload or refresh tables, logs and privileges
-Replication client Server Admin To ask where the slave or master servers are
-Replication slave Server Admin To read binary log events from the master
-Select Tables To retrieve rows from table
-Show databases Server Admin To see all databases with SHOW DATABASES
-Show view Tables To see views with SHOW CREATE VIEW
-Shutdown Server Admin To shut down the server
-Super Server Admin To use KILL thread, SET GLOBAL, CHANGE MASTER, etc.
-Update Tables To update existing rows
-Usage Server Admin No privileges - allow connect only
-use mysql;
-alter table columns_priv engine=myisam;
-alter table db engine=myisam;
-alter table func engine=myisam;
-alter table help_category engine=myisam;
-alter table help_keyword engine=myisam;
-alter table help_relation engine=myisam;
-alter table help_topic engine=myisam;
-alter table host engine=myisam;
-alter table tables_priv engine=myisam;
-alter table time_zone engine=myisam;
-alter table time_zone_leap_second engine=myisam;
-alter table time_zone_name engine=myisam;
-alter table time_zone_transition engine=myisam;
-alter table time_zone_transition_type engine=myisam;
-alter table user engine=myisam;
-use test;
-flush privileges;
diff --git a/mysql-test/suite/ndb/r/ndb_index.result b/mysql-test/suite/ndb/r/ndb_index.result
deleted file mode 100644
index 5702552b0b5..00000000000
--- a/mysql-test/suite/ndb/r/ndb_index.result
+++ /dev/null
@@ -1,154 +0,0 @@
-drop table if exists t1;
-CREATE TABLE t1 (
-PORT varchar(16) NOT NULL,
-ACCESSNODE varchar(16) NOT NULL,
-POP varchar(48) NOT NULL,
-ACCESSTYPE int unsigned NOT NULL,
-CUSTOMER_ID varchar(20) collate latin1_bin NOT NULL,
-PROVIDER varchar(16),
-TEXPIRE int unsigned,
-NUM_IP int unsigned,
-LEASED_NUM_IP int unsigned,
-LOCKED_IP int unsigned,
-STATIC_DNS int unsigned,
-SUSPENDED_SERVICE int unsigned,
-SUSPENDED_REASON int unsigned,
-BGP_COMMUNITY int unsigned,
-INDEX CUSTOMER_ID_INDEX(CUSTOMER_ID),
-INDEX FQPN_INDEX(POP,ACCESSNODE,PORT),
-PRIMARY KEY(POP,ACCESSNODE,PORT,ACCESSTYPE)
-) engine=ndbcluster;
-INSERT INTO t1 VALUES ('port67', 'node78', 'pop98', 1, 'kllopmn', 'pr_43', 121212, 1, 2, 3, 8, NULL, NULL, NULL);
-INSERT INTO t1 VALUES ('port67', 'node78', 'pop99', 2, 'klkighh', 'pr_44', 121213, 3, 3, 6, 7, NULL, NULL, NULL);
-INSERT INTO t1 VALUES ('port79', 'node79', 'pop79', 2, 'kpongfaa', 'pr_44', 981213, 2, 4, 10, 11, 2, 99, 1278);
-select port, accessnode, pop, accesstype from t1 where port='port67' order by accesstype;
-port accessnode pop accesstype
-port67 node78 pop98 1
-port67 node78 pop99 2
-select port, accessnode, pop, accesstype from t1 where port='foo';
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where accessnode='node78' order by accesstype;
-port accessnode pop accesstype
-port67 node78 pop98 1
-port67 node78 pop99 2
-select port, accessnode, pop, accesstype from t1 where accessnode='foo';
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where pop='pop98';
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where pop='pop98';
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where pop='pop98';
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where pop='pop98' order by accesstype;
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where pop='foo';
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where accesstype=1;
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where accesstype=2 order by port;
-port accessnode pop accesstype
-port67 node78 pop99 2
-port79 node79 pop79 2
-select port, accessnode, pop, accesstype from t1 where accesstype=98 order by port;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn';
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where customer_id='KLLOPMN';
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where customer_id='kLLoPMn';
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where customer_id='foo';
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where provider='pr_43';
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where provider='foo';
-port accessnode pop accesstype
-select port, accessnode from t1 where texpire=121212;
-port accessnode
-port67 node78
-select port, accessnode from t1 where texpire=2323;
-port accessnode
-select port, accessnode, pop, accesstype from t1 where num_ip=1;
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where num_ip=89;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where leased_num_ip=2;
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where leased_num_ip=89;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where locked_ip=3;
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where locked_ip=89;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where static_dns=8;
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where static_dns=89;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where suspended_service=8;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where suspended_service=89;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where suspended_reason=NULL;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where suspended_reason=89;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where suspended_reason=0;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where bgp_community=NULL;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where bgp_community=89;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where bgp_community=0;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where port='port67' and accessnode='node78' and pop='pop98' and accesstype=1;
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where port='port67' and accesstype=1 and accessnode='node78' and pop='pop98';
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where pop='pop98' and port='port67' and accesstype=1 and accessnode='node78';
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode from t1 where port='foo' and accessnode='foo' and pop='foo' and accesstype=99;
-port accessnode
-select port, accessnode, pop, accesstype from t1 where port='port67' and pop='pop98' and accesstype=1;
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where accesstype=1 and accessnode='node78' and pop='pop98';
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where port='port67' and accesstype=1 and accessnode='node78';
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode from t1 where port='foo' and accessnode='foo' and pop='foo';
-port accessnode
-select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn';
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn' and accesstype=1;
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn' and accesstype=2;
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where accesstype=2 and customer_id='kllopmn';
-port accessnode pop accesstype
-select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67';
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='kllopmn';
-port accessnode pop accesstype
-port67 node78 pop98 1
-select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='foo';
-port accessnode pop accesstype
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_index_ordered.result b/mysql-test/suite/ndb/r/ndb_index_ordered.result
deleted file mode 100644
index c99db354314..00000000000
--- a/mysql-test/suite/ndb/r/ndb_index_ordered.result
+++ /dev/null
@@ -1,839 +0,0 @@
-drop table if exists t1, test1, test2;
-CREATE TABLE t1 (
-a int unsigned NOT NULL PRIMARY KEY,
-b int unsigned not null,
-c int unsigned,
-KEY(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;
-a b c
-1 2 3
-2 3 5
-3 4 6
-4 5 8
-5 6 2
-6 7 2
-select * from t1 where b >= 4 order by b;
-a b c
-3 4 6
-4 5 8
-5 6 2
-6 7 2
-select * from t1 where b = 4 order by b;
-a b c
-3 4 6
-select * from t1 where b > 4 order by b;
-a b c
-4 5 8
-5 6 2
-6 7 2
-select * from t1 where b < 4 order by b;
-a b c
-1 2 3
-2 3 5
-select * from t1 where b <= 4 order by b;
-a b c
-1 2 3
-2 3 5
-3 4 6
-select tt1.* from t1 as tt1, t1 as tt2 use index(b) where tt1.b = tt2.b order by tt1.b;
-a b c
-1 2 3
-2 3 5
-3 4 6
-4 5 8
-5 6 2
-6 7 2
-select a, b, c from t1 where a!=2 and c=6;
-a b c
-3 4 6
-select a, b, c from t1 where a!=2 order by a;
-a b c
-1 2 3
-3 4 6
-4 5 8
-5 6 2
-6 7 2
-update t1 set c = 3 where b = 3;
-select * from t1 order by a;
-a b c
-1 2 3
-2 3 3
-3 4 6
-4 5 8
-5 6 2
-6 7 2
-update t1 set c = 10 where b >= 6;
-select * from t1 order by a;
-a b c
-1 2 3
-2 3 3
-3 4 6
-4 5 8
-5 6 10
-6 7 10
-update t1 set c = 11 where b < 5;
-select * from t1 order by a;
-a b c
-1 2 11
-2 3 11
-3 4 11
-4 5 8
-5 6 10
-6 7 10
-update t1 set c = 12 where b > 0;
-select * from t1 order by a;
-a b c
-1 2 12
-2 3 12
-3 4 12
-4 5 12
-5 6 12
-6 7 12
-update t1 set c = 13 where b <= 3;
-select * from t1 order by a;
-a b c
-1 2 13
-2 3 13
-3 4 12
-4 5 12
-5 6 12
-6 7 12
-update t1 set b = b + 1 where b > 4 and b < 7;
-select * from t1 order by a;
-a b c
-1 2 13
-2 3 13
-3 4 12
-4 6 12
-5 7 12
-6 7 12
-update t1 set a = a + 10 where b > 1 and b < 7;
-select * from t1 order by a;
-a b c
-5 7 12
-6 7 12
-11 2 13
-12 3 13
-13 4 12
-14 6 12
-drop table t1;
-CREATE TABLE t1 (
-a int unsigned NOT NULL PRIMARY KEY,
-b int unsigned not null,
-c int unsigned,
-KEY(b)
-) engine=ndbcluster;
-insert t1 values(1, 2, 13), (2,3, 13), (3, 4, 12), (4, 5, 12), (5,6, 12), (6,7, 12);
-delete from t1 where b = 3;
-select * from t1 order by a;
-a b c
-1 2 13
-3 4 12
-4 5 12
-5 6 12
-6 7 12
-delete from t1 where b >= 6;
-select * from t1 order by a;
-a b c
-1 2 13
-3 4 12
-4 5 12
-delete from t1 where b < 4;
-select * from t1 order by a;
-a b c
-3 4 12
-4 5 12
-delete from t1 where b > 5;
-select * from t1 order by a;
-a b c
-3 4 12
-4 5 12
-delete from t1 where b <= 4;
-select * from t1 order by a;
-a b c
-4 5 12
-drop table t1;
-CREATE TABLE t1 (
-a int unsigned NOT NULL PRIMARY KEY,
-b int unsigned not null,
-c int unsigned not null
-) engine = ndb;
-create index a1 on t1 (b, c);
-insert into t1 values (1, 2, 13);
-insert into t1 values (2,3, 13);
-insert into t1 values (3, 4, 12);
-insert into t1 values (4, 5, 12);
-insert into t1 values (5,6, 12);
-insert into t1 values (6,7, 12);
-insert into t1 values (7, 2, 1);
-insert into t1 values (8,3, 6);
-insert into t1 values (9, 4, 12);
-insert into t1 values (14, 5, 4);
-insert into t1 values (15,5,5);
-insert into t1 values (16,5, 6);
-insert into t1 values (17,4,4);
-insert into t1 values (18,1, 7);
-select * from t1 order by a;
-a b c
-1 2 13
-2 3 13
-3 4 12
-4 5 12
-5 6 12
-6 7 12
-7 2 1
-8 3 6
-9 4 12
-14 5 4
-15 5 5
-16 5 6
-17 4 4
-18 1 7
-select * from t1 where b<=5 order by a;
-a b c
-1 2 13
-2 3 13
-3 4 12
-4 5 12
-7 2 1
-8 3 6
-9 4 12
-14 5 4
-15 5 5
-16 5 6
-17 4 4
-18 1 7
-select * from t1 where b<=5 and c=0;
-a b c
-insert into t1 values (19,4, 0);
-select * from t1 where b<=5 and c=0;
-a b c
-19 4 0
-select * from t1 where b=4 and c<=5 order by a;
-a b c
-17 4 4
-19 4 0
-select * from t1 where b<=4 and c<=5 order by a;
-a b c
-7 2 1
-17 4 4
-19 4 0
-select * from t1 where b<=5 and c=0 or b<=5 and c=2;
-a b c
-19 4 0
-select count(*) from t1 where b = 0;
-count(*)
-0
-select count(*) from t1 where b = 1;
-count(*)
-1
-drop table t1;
-CREATE TABLE t1 (
-a int unsigned NOT NULL PRIMARY KEY,
-b int unsigned,
-c int unsigned,
-KEY 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;
-a b c
-2 NULL 2
-3 NULL NULL
-select * from t1 use index (bc)order by a;
-a b c
-1 1 1
-2 NULL 2
-3 NULL NULL
-4 4 NULL
-select * from t1 use index (bc) order by a;
-a b c
-1 1 1
-2 NULL 2
-3 NULL NULL
-4 4 NULL
-select * from t1 use index (PRIMARY) where b IS NULL order by a;
-a b c
-2 NULL 2
-3 NULL NULL
-select * from t1 use index (bc) where b IS NULL order by a;
-a b c
-2 NULL 2
-3 NULL NULL
-select * from t1 use index (bc) where b IS NULL and c IS NULL order by a;
-a b c
-3 NULL NULL
-select * from t1 use index (bc) where b IS NULL and c = 2 order by a;
-a b c
-2 NULL 2
-select * from t1 use index (bc) where b < 4 order by a;
-a b c
-1 1 1
-select * from t1 use index (bc) where b IS NOT NULL order by a;
-a b c
-1 1 1
-4 4 NULL
-drop table t1;
-create table t1 (
-a int unsigned primary key,
-b int unsigned,
-c char(10),
-key bc (b, c)
-) engine=ndb;
-insert into t1 values(1,1,'a'),(2,2,'b'),(3,3,'c'),(4,4,'d'),(5,5,'e');
-insert into t1 select a*7,10*b,'f' from t1;
-insert into t1 select a*13,10*b,'g' from t1;
-insert into t1 select a*17,10*b,'h' from t1;
-insert into t1 select a*19,10*b,'i' from t1;
-insert into t1 select a*23,10*b,'j' from t1;
-insert into t1 select a*29,10*b,'k' from t1;
-select b, c from t1 where b <= 10 and c <'f' order by b, c;
-b c
-1 a
-2 b
-3 c
-4 d
-5 e
-select b, c from t1 where b <= 10 and c <'f' order by b desc, c desc;
-b c
-5 e
-4 d
-3 c
-2 b
-1 a
-select b, c from t1 where b=4000 and c<'k' order by b, c;
-b c
-4000 h
-4000 i
-4000 i
-4000 i
-4000 j
-4000 j
-4000 j
-4000 j
-4000 j
-4000 j
-select b, c from t1 where b=4000 and c<'k' order by b desc, c desc;
-b c
-4000 j
-4000 j
-4000 j
-4000 j
-4000 j
-4000 j
-4000 i
-4000 i
-4000 i
-4000 h
-select b, c from t1 where 1000<=b and b<=100000 and c<'j' order by b, c;
-b c
-1000 h
-1000 i
-1000 i
-1000 i
-2000 h
-2000 i
-2000 i
-2000 i
-3000 h
-3000 i
-3000 i
-3000 i
-4000 h
-4000 i
-4000 i
-4000 i
-5000 h
-5000 i
-5000 i
-5000 i
-10000 i
-20000 i
-30000 i
-40000 i
-50000 i
-select b, c from t1 where 1000<=b and b<=100000 and c<'j' order by b desc, c desc;
-b c
-50000 i
-40000 i
-30000 i
-20000 i
-10000 i
-5000 i
-5000 i
-5000 i
-5000 h
-4000 i
-4000 i
-4000 i
-4000 h
-3000 i
-3000 i
-3000 i
-3000 h
-2000 i
-2000 i
-2000 i
-2000 h
-1000 i
-1000 i
-1000 i
-1000 h
-select min(b), max(b) from t1;
-min(b) max(b)
-1 5000000
-drop table t1;
-CREATE TABLE test1 (
-SubscrID int(11) NOT NULL auto_increment,
-UsrID int(11) NOT NULL default '0',
-PRIMARY KEY (SubscrID),
-KEY idx_usrid (UsrID)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO test1 VALUES (2,224),(3,224),(1,224);
-CREATE TABLE test2 (
-SbclID int(11) NOT NULL auto_increment,
-SbcrID int(11) NOT NULL default '0',
-PRIMARY KEY (SbclID),
-KEY idx_sbcrid (SbcrID)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO test2 VALUES (3,2),(1,1),(2,1),(4,2);
-select * from test1 order by 1;
-SubscrID UsrID
-1 224
-2 224
-3 224
-select * from test2 order by 1;
-SbclID SbcrID
-1 1
-2 1
-3 2
-4 2
-SELECT s.SubscrID,l.SbclID FROM test1 s left JOIN test2 l ON
-l.SbcrID=s.SubscrID WHERE s.UsrID=224 order by 1, 2;
-SubscrID SbclID
-1 1
-1 2
-2 3
-2 4
-3 NULL
-drop table test1;
-drop table test2;
-create table t1 (
-pk int primary key,
-dt datetime not null,
-da date not null,
-ye year not null,
-ti time not null,
-ts timestamp not null,
-index(dt),
-index(da),
-index(ye),
-index(ti),
-index(ts)
-) engine=ndb;
-insert into t1 (pk,dt,da,ye,ti,ts) values
-(1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59', '2001-01-01 23:00:59'),
-(2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59', '2001-01-01 13:00:59'),
-(3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00', '2001-01-01 00:00:00'),
-(4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00', '2001-01-01 00:00:00'),
-(5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06', '2001-01-01 06:06:06'),
-(6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06', '2001-01-01 06:06:06'),
-(7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10', '2001-01-01 10:11:10'),
-(8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11', '2001-01-01 10:11:11'),
-(9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59', '2001-01-01 23:59:59');
-select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00';
-count(*)-9
-0
-select count(*)-6 from t1 use index (dt) where dt >= '1955-12-31 00:00:00';
-count(*)-6
-0
-select count(*)-5 from t1 use index (dt) where dt > '1955-12-31 00:00:00';
-count(*)-5
-0
-select count(*)-5 from t1 use index (dt) where dt < '1970-03-03 22:22:22';
-count(*)-5
-0
-select count(*)-7 from t1 use index (dt) where dt < '2001-01-01 10:11:11';
-count(*)-7
-0
-select count(*)-8 from t1 use index (dt) where dt <= '2001-01-01 10:11:11';
-count(*)-8
-0
-select count(*)-9 from t1 use index (dt) where dt <= '2055-01-01 00:00:00';
-count(*)-9
-0
-select count(*)-9 from t1 use index (da) where da > '1900-01-01';
-count(*)-9
-0
-select count(*)-6 from t1 use index (da) where da >= '1955-12-31';
-count(*)-6
-0
-select count(*)-5 from t1 use index (da) where da > '1955-12-31';
-count(*)-5
-0
-select count(*)-5 from t1 use index (da) where da < '1970-03-03';
-count(*)-5
-0
-select count(*)-6 from t1 use index (da) where da < '2001-01-01';
-count(*)-6
-0
-select count(*)-8 from t1 use index (da) where da <= '2001-01-02';
-count(*)-8
-0
-select count(*)-9 from t1 use index (da) where da <= '2055-01-01';
-count(*)-9
-0
-select count(*)-9 from t1 use index (ye) where ye > '1900';
-count(*)-9
-0
-select count(*)-6 from t1 use index (ye) where ye >= '1955';
-count(*)-6
-0
-select count(*)-5 from t1 use index (ye) where ye > '1955';
-count(*)-5
-0
-select count(*)-5 from t1 use index (ye) where ye < '1970';
-count(*)-5
-0
-select count(*)-6 from t1 use index (ye) where ye < '2001';
-count(*)-6
-0
-select count(*)-8 from t1 use index (ye) where ye <= '2001';
-count(*)-8
-0
-select count(*)-9 from t1 use index (ye) where ye <= '2055';
-count(*)-9
-0
-select count(*)-9 from t1 use index (ti) where ti >= '00:00:00';
-count(*)-9
-0
-select count(*)-7 from t1 use index (ti) where ti > '00:00:00';
-count(*)-7
-0
-select count(*)-7 from t1 use index (ti) where ti > '05:05:05';
-count(*)-7
-0
-select count(*)-5 from t1 use index (ti) where ti > '06:06:06';
-count(*)-5
-0
-select count(*)-5 from t1 use index (ti) where ti < '10:11:11';
-count(*)-5
-0
-select count(*)-6 from t1 use index (ti) where ti <= '10:11:11';
-count(*)-6
-0
-select count(*)-8 from t1 use index (ti) where ti < '23:59:59';
-count(*)-8
-0
-select count(*)-9 from t1 use index (ti) where ti <= '23:59:59';
-count(*)-9
-0
-select count(*)-9 from t1 use index (ts) where ts >= '2001-01-01 00:00:00';
-count(*)-9
-0
-select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 00:00:00';
-count(*)-7
-0
-select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 05:05:05';
-count(*)-7
-0
-select count(*)-5 from t1 use index (ts) where ts > '2001-01-01 06:06:06';
-count(*)-5
-0
-select count(*)-5 from t1 use index (ts) where ts < '2001-01-01 10:11:11';
-count(*)-5
-0
-select count(*)-6 from t1 use index (ts) where ts <= '2001-01-01 10:11:11';
-count(*)-6
-0
-select count(*)-8 from t1 use index (ts) where ts < '2001-01-01 23:59:59';
-count(*)-8
-0
-select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59';
-count(*)-9
-0
-drop table t1;
-create table t1 (
-a int primary key,
-s decimal(12),
-t decimal(12, 5),
-u decimal(12) unsigned,
-v decimal(12, 5) unsigned,
-key (s),
-key (t),
-key (u),
-key (v)
-) engine=ndb;
-insert into t1 values
-( 0, -000000000007, -0000061.00003, 000000000061, 0000965.00042),
-( 1, -000000000007, -0000061.00042, 000000000061, 0000965.00003),
-( 2, -071006035767, 4210253.00024, 000000000001, 0000001.84488),
-( 3, 000000007115, 0000000.77607, 000077350625, 0000018.00013),
-( 4, -000000068391, -0346486.00000, 000000005071, 0005334.00002),
-( 5, -521579890459, -1936874.00001, 000000000154, 0000003.00018),
-( 6, -521579890459, -1936874.00018, 000000000154, 0000003.00001),
-( 7, 000000000333, 0000051.39140, 000000907958, 0788643.08374),
-( 8, 000042731229, 0000009.00000, 000000000009, 6428667.00000),
-( 9, -000008159769, 0000918.00004, 000096951421, 7607730.00008);
-select count(*)- 5 from t1 use index (s) where s < -000000000007;
-count(*)- 5
-0
-select count(*)- 7 from t1 use index (s) where s <= -000000000007;
-count(*)- 7
-0
-select count(*)- 2 from t1 use index (s) where s = -000000000007;
-count(*)- 2
-0
-select count(*)- 5 from t1 use index (s) where s >= -000000000007;
-count(*)- 5
-0
-select count(*)- 3 from t1 use index (s) where s > -000000000007;
-count(*)- 3
-0
-select count(*)- 4 from t1 use index (t) where t < -0000061.00003;
-count(*)- 4
-0
-select count(*)- 5 from t1 use index (t) where t <= -0000061.00003;
-count(*)- 5
-0
-select count(*)- 1 from t1 use index (t) where t = -0000061.00003;
-count(*)- 1
-0
-select count(*)- 6 from t1 use index (t) where t >= -0000061.00003;
-count(*)- 6
-0
-select count(*)- 5 from t1 use index (t) where t > -0000061.00003;
-count(*)- 5
-0
-select count(*)- 2 from t1 use index (u) where u < 000000000061;
-count(*)- 2
-0
-select count(*)- 4 from t1 use index (u) where u <= 000000000061;
-count(*)- 4
-0
-select count(*)- 2 from t1 use index (u) where u = 000000000061;
-count(*)- 2
-0
-select count(*)- 8 from t1 use index (u) where u >= 000000000061;
-count(*)- 8
-0
-select count(*)- 6 from t1 use index (u) where u > 000000000061;
-count(*)- 6
-0
-select count(*)- 5 from t1 use index (v) where v < 0000965.00042;
-count(*)- 5
-0
-select count(*)- 6 from t1 use index (v) where v <= 0000965.00042;
-count(*)- 6
-0
-select count(*)- 1 from t1 use index (v) where v = 0000965.00042;
-count(*)- 1
-0
-select count(*)- 5 from t1 use index (v) where v >= 0000965.00042;
-count(*)- 5
-0
-select count(*)- 4 from t1 use index (v) where v > 0000965.00042;
-count(*)- 4
-0
-drop table t1;
-create table t1 (a int, c varchar(10),
-primary key using hash (a), index(c)) engine=ndb;
-insert into t1 (a, c) values (1,'aaa'),(3,'bbb');
-select count(*) from t1 where c<'bbb';
-count(*)
-1
-drop table t1;
-set autocommit=1;
-show session variables like 'ndb_index_stat_%';
-Variable_name Value
-ndb_index_stat_cache_entries 32
-ndb_index_stat_enable OFF
-ndb_index_stat_update_freq 20
-set ndb_index_stat_enable = off;
-show session variables like 'ndb_index_stat_%';
-Variable_name Value
-ndb_index_stat_cache_entries 32
-ndb_index_stat_enable OFF
-ndb_index_stat_update_freq 20
-create table t1 (a int, b int, c varchar(10) not null,
-primary key using hash (a), index(b,c)) engine=ndb;
-insert into t1 values
-(1,10,'aaa'),(2,10,'bbb'),(3,10,'ccc'),
-(4,20,'aaa'),(5,20,'bbb'),(6,20,'ccc'),
-(7,30,'aaa'),(8,30,'bbb'),(9,30,'ccc');
-select count(*) from t1 where b < 10;
-count(*)
-0
-select count(*) from t1 where b >= 10 and c >= 'bbb';
-count(*)
-6
-select count(*) from t1 where b > 10;
-count(*)
-6
-select count(*) from t1 where b <= 20 and c < 'ccc';
-count(*)
-4
-select count(*) from t1 where b = 20 and c = 'ccc';
-count(*)
-1
-select count(*) from t1 where b > 20;
-count(*)
-3
-select count(*) from t1 where b = 30 and c > 'aaa';
-count(*)
-2
-select count(*) from t1 where b <= 20;
-count(*)
-6
-select count(*) from t1 where b >= 20 and c > 'aaa';
-count(*)
-4
-drop table t1;
-set ndb_index_stat_enable = on;
-set ndb_index_stat_cache_entries = 0;
-show session variables like 'ndb_index_stat_%';
-Variable_name Value
-ndb_index_stat_cache_entries 0
-ndb_index_stat_enable ON
-ndb_index_stat_update_freq 20
-create table t1 (a int, b int, c varchar(10) not null,
-primary key using hash (a), index(b,c)) engine=ndb;
-insert into t1 values
-(1,10,'aaa'),(2,10,'bbb'),(3,10,'ccc'),
-(4,20,'aaa'),(5,20,'bbb'),(6,20,'ccc'),
-(7,30,'aaa'),(8,30,'bbb'),(9,30,'ccc');
-select count(*) from t1 where b < 10;
-count(*)
-0
-select count(*) from t1 where b >= 10 and c >= 'bbb';
-count(*)
-6
-select count(*) from t1 where b > 10;
-count(*)
-6
-select count(*) from t1 where b <= 20 and c < 'ccc';
-count(*)
-4
-select count(*) from t1 where b = 20 and c = 'ccc';
-count(*)
-1
-select count(*) from t1 where b > 20;
-count(*)
-3
-select count(*) from t1 where b = 30 and c > 'aaa';
-count(*)
-2
-select count(*) from t1 where b <= 20;
-count(*)
-6
-select count(*) from t1 where b >= 20 and c > 'aaa';
-count(*)
-4
-drop table t1;
-set ndb_index_stat_enable = on;
-set ndb_index_stat_cache_entries = 4;
-set ndb_index_stat_update_freq = 2;
-show session variables like 'ndb_index_stat_%';
-Variable_name Value
-ndb_index_stat_cache_entries 4
-ndb_index_stat_enable ON
-ndb_index_stat_update_freq 2
-create table t1 (a int, b int, c varchar(10) not null,
-primary key using hash (a), index(b,c)) engine=ndb;
-insert into t1 values
-(1,10,'aaa'),(2,10,'bbb'),(3,10,'ccc'),
-(4,20,'aaa'),(5,20,'bbb'),(6,20,'ccc'),
-(7,30,'aaa'),(8,30,'bbb'),(9,30,'ccc');
-select count(*) from t1 where b < 10;
-count(*)
-0
-select count(*) from t1 where b >= 10 and c >= 'bbb';
-count(*)
-6
-select count(*) from t1 where b > 10;
-count(*)
-6
-select count(*) from t1 where b <= 20 and c < 'ccc';
-count(*)
-4
-select count(*) from t1 where b = 20 and c = 'ccc';
-count(*)
-1
-select count(*) from t1 where b > 20;
-count(*)
-3
-select count(*) from t1 where b = 30 and c > 'aaa';
-count(*)
-2
-select count(*) from t1 where b <= 20;
-count(*)
-6
-select count(*) from t1 where b >= 20 and c > 'aaa';
-count(*)
-4
-drop table t1;
-set ndb_index_stat_enable = @@global.ndb_index_stat_enable;
-set ndb_index_stat_cache_entries = @@global.ndb_index_stat_cache_entries;
-set ndb_index_stat_update_freq = @@global.ndb_index_stat_update_freq;
-show session variables like 'ndb_index_stat_%';
-Variable_name Value
-ndb_index_stat_cache_entries 32
-ndb_index_stat_enable OFF
-ndb_index_stat_update_freq 20
-create table t1 (a int primary key) engine = ndb;
-insert into t1 values (1), (2), (3);
-begin;
-delete from t1 where a > 1;
-rollback;
-select * from t1 order by a;
-a
-1
-2
-3
-begin;
-delete from t1 where a > 1;
-rollback;
-begin;
-select * from t1 order by a;
-a
-1
-2
-3
-delete from t1 where a > 2;
-select * from t1 order by a;
-a
-1
-2
-delete from t1 where a > 1;
-select * from t1 order by a;
-a
-1
-delete from t1 where a > 0;
-select * from t1 order by a;
-a
-rollback;
-select * from t1 order by a;
-a
-1
-2
-3
-delete from t1;
-drop table t1;
-create table nationaldish (DishID int(10) unsigned NOT NULL AUTO_INCREMENT,
-CountryCode char(3) NOT NULL,
-DishTitle varchar(64) NOT NULL,
-calories smallint(5) unsigned DEFAULT NULL,
-PRIMARY KEY (DishID),
-INDEX i USING HASH (countrycode,calories)
-) ENGINE=ndbcluster;
-ERROR HY000: Can't create table 'test.nationaldish' (errno: 138)
-create table nationaldish (DishID int(10) unsigned NOT NULL AUTO_INCREMENT,
-CountryCode char(3) NOT NULL,
-DishTitle varchar(64) NOT NULL,
-calories smallint(5) unsigned DEFAULT NULL,
-PRIMARY KEY (DishID)
-) ENGINE=ndbcluster;
-create index i on nationaldish(countrycode,calories) using hash;
-ERROR 42000: Table 'nationaldish' uses an extension that doesn't exist in this MySQL version
-drop table nationaldish;
diff --git a/mysql-test/suite/ndb/r/ndb_index_unique.result b/mysql-test/suite/ndb/r/ndb_index_unique.result
deleted file mode 100644
index 5d0f4038211..00000000000
--- a/mysql-test/suite/ndb/r/ndb_index_unique.result
+++ /dev/null
@@ -1,692 +0,0 @@
-drop table if exists t1, t2, t3, t4, t5, t6, t7, t8;
-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;
-a b c
-1 2 3
-2 3 5
-3 4 6
-4 5 8
-5 6 2
-6 7 2
-select * from t1 where b = 4 order by b;
-a b c
-3 4 6
-insert into t1 values(7,8,3);
-select * from t1 where b = 4 order by a;
-a b c
-3 4 6
-insert into t1 values(8, 2, 3);
-ERROR 23000: Duplicate entry '2' for key 'ib'
-select * from t1 order by a;
-a b c
-1 2 3
-2 3 5
-3 4 6
-4 5 8
-5 6 2
-6 7 2
-7 8 3
-delete from t1 where a = 1;
-insert into t1 values(8, 2, 3);
-select * from t1 order by a;
-a b c
-2 3 5
-3 4 6
-4 5 8
-5 6 2
-6 7 2
-7 8 3
-8 2 3
-alter table t1 drop index ib;
-insert into t1 values(1, 2, 3);
-create unique index ib on t1(b);
-ERROR 23000: Can't write, because of unique constraint, to table 't1'
-drop table t1;
-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;
-a b c
-2 NULL 2
-3 NULL NULL
-select * from t1 use index (bc)order by a;
-a b c
-1 1 1
-2 NULL 2
-3 NULL NULL
-4 4 NULL
-select * from t1 use index (bc) order by a;
-a b c
-1 1 1
-2 NULL 2
-3 NULL NULL
-4 4 NULL
-select * from t1 use index (PRIMARY) where b IS NULL order by a;
-a b c
-2 NULL 2
-3 NULL NULL
-select * from t1 use index (bc) where b IS NULL order by a;
-a b c
-2 NULL 2
-3 NULL NULL
-select * from t1 use index (bc) where b IS NULL and c IS NULL order by a;
-a b c
-3 NULL NULL
-select * from t1 use index (bc) where b IS NULL and c = 2 order by a;
-a b c
-2 NULL 2
-select * from t1 use index (bc) where b < 4 order by a;
-a b c
-1 1 1
-select * from t1 use index (bc) where b IS NOT NULL order by a;
-a b c
-1 1 1
-4 4 NULL
-insert into t1 values(5,1,1);
-ERROR 23000: Duplicate entry '1-1' for key 'bc'
-drop table t1;
-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;
-a b c
-3 4 6
-select * from t2 where b = 4;
-a b c
-3 4 6
-select * from t2 where c = 6;
-a b c
-3 4 6
-insert into t2 values(7,8,3);
-select * from t2 where b = 4 order by a;
-a b c
-3 4 6
-insert into t2 values(8, 2, 3);
-ERROR 23000: Duplicate entry '2-3' for key 'b'
-select * from t2 order by a;
-a b c
-1 2 3
-2 3 5
-3 4 6
-4 5 8
-5 6 2
-6 7 2
-7 8 3
-delete from t2 where a = 1;
-insert into t2 values(8, 2, 3);
-select * from t2 order by a;
-a b c
-2 3 5
-3 4 6
-4 5 8
-5 6 2
-6 7 2
-7 8 3
-8 2 3
-create unique index bi using hash on t2(b);
-insert into t2 values(9, 3, 1);
-ERROR 23000: Duplicate entry '3' for key 'bi'
-alter table t2 drop index bi;
-insert into t2 values(9, 3, 1);
-select * from t2 order by a;
-a b c
-2 3 5
-3 4 6
-4 5 8
-5 6 2
-6 7 2
-7 8 3
-8 2 3
-9 3 1
-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;
-Warnings:
-Warning 1121 Ndb does not support unique index on NULL valued attributes, index access with NULL value will become full table scan
-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;
-a b c
-1 1 NULL
-3 3 NULL
-5 5 NULL
-7 7 NULL
-8 3 NULL
-9 3 NULL
-select * from t2 where b = 3 AND c IS NULL order by a;
-a b c
-3 3 NULL
-8 3 NULL
-9 3 NULL
-select * from t2 where (b = 3 OR b = 5) AND c IS NULL order by a;
-a b c
-3 3 NULL
-5 5 NULL
-8 3 NULL
-9 3 NULL
-set @old_optimizer_switch = @@session.optimizer_switch;
-set optimizer_switch = "engine_condition_pushdown=on";
-explain select * from t2 where (b = 3 OR b = 5) AND c IS NULL AND a < 9 order by a;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range PRIMARY,b PRIMARY 4 NULL 1 Using where with pushed condition
-select * from t2 where (b = 3 OR b = 5) AND c IS NULL AND a < 9 order by a;
-a b c
-3 3 NULL
-5 5 NULL
-8 3 NULL
-set optimizer_switch = @old_optimizer_switch;
-drop table t2;
-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;
-a b c
-3 4 6
-select * from t3 where b = 4;
-a b c
-3 4 6
-select * from t3 where c = 6;
-a b c
-3 4 6
-insert into t3 values(7,8,3);
-select * from t3 where b = 4 order by a;
-a b c
-3 4 6
-drop table t3;
-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;
-pk a
--1 NULL
-0 0
-1 NULL
-2 2
-3 NULL
-4 4
-insert into t1 values (5,0);
-ERROR 23000: Duplicate entry '0' for key 'a'
-select * from t1 order by pk;
-pk a
--1 NULL
-0 0
-1 NULL
-2 2
-3 NULL
-4 4
-delete from t1 where a = 0;
-insert into t1 values (5,0);
-select * from t1 order by pk;
-pk a
--1 NULL
-1 NULL
-2 2
-3 NULL
-4 4
-5 0
-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;
-pk a b c
--1 1 17 NULL
-0 NULL 18 NULL
-1 3 19 abc
-insert into t2 values(2,3,19,'abc');
-ERROR 23000: Duplicate entry '3-abc' for key 'si'
-select * from t2 order by pk;
-pk a b c
--1 1 17 NULL
-0 NULL 18 NULL
-1 3 19 abc
-delete from t2 where c IS NOT NULL;
-insert into t2 values(2,3,19,'abc');
-select * from t2 order by pk;
-pk a b c
--1 1 17 NULL
-0 NULL 18 NULL
-2 3 19 abc
-drop table t1, t2;
-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';
-cid cv
-8 dummy
-select * from t1 where cv = 'test';
-cid cv
-select * from t2 where cap = 'another dummy';
-cid cap
-1 another dummy
-select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4;
-uid gid rid cid
-1 1 2 4
-select * from t4 where uid = 1 and gid=1 and rid=1 and cid=4;
-uid gid rid cid
-select * from t4 where uid = 1 order by cid;
-uid gid rid cid
-1 1 2 3
-1 1 2 4
-1 1 5 7
-1 1 10 8
-select * from t4 where rid = 2 order by cid;
-uid gid rid cid
-1 1 2 3
-1 1 2 4
-select * from t6 where un='test' and uc=8;
-uid un uc
-1 test 8
-select * from t6 where un='test' and uc=7;
-uid un uc
-select * from t6 where un='test';
-uid un uc
-1 test 8
-select * from t7 where mid = 8;
-mid uid gid rid cid
-8 3 1 1 8
-select * from t7 where uid = 8;
-mid uid gid rid cid
-select * from t7 where uid = 1 order by mid;
-mid uid gid rid cid
-1 1 1 1 1
-6 1 1 1 6
-select * from t7 where uid = 4 order by mid;
-mid uid gid rid cid
-4 4 1 1 1
-9 4 1 1 9
-select * from t7 where gid = 4;
-mid uid gid rid cid
-select * from t7 where gid = 1 order by mid;
-mid uid gid rid cid
-1 1 1 1 1
-2 2 1 1 1
-3 3 1 1 1
-4 4 1 1 1
-5 5 1 1 1
-6 1 1 1 6
-7 2 1 1 7
-8 3 1 1 8
-9 4 1 1 9
-10 5 1 1 10
-select * from t7 where cid = 4;
-mid uid gid rid cid
-select * from t7 where cid = 8;
-mid uid gid rid cid
-8 3 1 1 8
-select * from t4 where uid = 1 and gid=1 and rid=2 and cid=4;
-uid gid rid cid
-1 1 2 4
-select * from t4 where uid = 1 and gid=1 and rid=1 and cid=4;
-uid gid rid cid
-select * from t4 where uid = 1 order by gid,cid;
-uid gid rid cid
-1 1 2 3
-1 1 2 4
-1 1 5 7
-1 1 10 8
-1 1 5 12
-1 2 5 12
-1 3 9 11
-1 3 5 12
-1 4 5 12
-1 5 5 12
-1 6 5 12
-1 7 5 12
-1 8 5 12
-1 9 5 12
-1 10 5 12
-1 11 5 12
-1 12 5 12
-1 13 5 12
-1 14 5 12
-1 15 5 12
-1 16 5 12
-1 17 5 12
-1 18 5 12
-1 19 5 12
-1 20 5 12
-1 21 5 12
-1 22 5 12
-1 23 5 12
-1 24 5 12
-1 25 5 12
-1 26 5 12
-1 27 5 12
-1 28 5 12
-1 29 5 12
-1 30 5 12
-1 31 5 12
-1 32 5 12
-1 33 5 12
-1 34 5 12
-1 35 5 12
-1 36 5 12
-1 37 5 12
-1 38 5 12
-1 39 5 12
-1 40 5 12
-1 41 5 12
-1 42 5 12
-1 43 5 12
-1 44 5 12
-1 45 5 12
-1 46 5 12
-1 47 5 12
-1 48 5 12
-1 49 5 12
-1 50 5 12
-1 51 5 12
-1 52 5 12
-1 53 5 12
-1 54 5 12
-1 55 5 12
-1 56 5 12
-1 57 5 12
-1 58 5 12
-1 59 5 12
-1 60 5 12
-1 61 5 12
-1 62 5 12
-1 63 5 12
-1 64 5 12
-1 65 5 12
-1 66 5 12
-1 67 5 12
-1 68 5 12
-1 69 5 12
-1 70 5 12
-1 71 5 12
-1 72 5 12
-1 73 5 12
-1 74 5 12
-1 75 5 12
-1 76 5 12
-1 77 5 12
-1 78 5 12
-1 79 5 12
-1 80 5 12
-1 81 5 12
-1 82 5 12
-1 83 5 12
-1 84 5 12
-1 85 5 12
-1 86 5 12
-1 87 5 12
-1 88 5 12
-1 89 5 12
-1 90 5 12
-1 91 5 12
-1 92 5 12
-1 93 5 12
-1 94 5 12
-1 95 5 12
-1 96 5 12
-1 97 5 12
-1 98 5 12
-1 99 5 12
-1 100 5 12
-select * from t4 where uid = 1 order by gid,cid;
-uid gid rid cid
-1 1 2 3
-1 1 2 4
-1 1 5 7
-1 1 10 8
-1 1 5 12
-1 2 5 12
-1 3 9 11
-1 3 5 12
-1 4 5 12
-1 5 5 12
-1 6 5 12
-1 7 5 12
-1 8 5 12
-1 9 5 12
-1 10 5 12
-1 11 5 12
-1 12 5 12
-1 13 5 12
-1 14 5 12
-1 15 5 12
-1 16 5 12
-1 17 5 12
-1 18 5 12
-1 19 5 12
-1 20 5 12
-1 21 5 12
-1 22 5 12
-1 23 5 12
-1 24 5 12
-1 25 5 12
-1 26 5 12
-1 27 5 12
-1 28 5 12
-1 29 5 12
-1 30 5 12
-1 31 5 12
-1 32 5 12
-1 33 5 12
-1 34 5 12
-1 35 5 12
-1 36 5 12
-1 37 5 12
-1 38 5 12
-1 39 5 12
-1 40 5 12
-1 41 5 12
-1 42 5 12
-1 43 5 12
-1 44 5 12
-1 45 5 12
-1 46 5 12
-1 47 5 12
-1 48 5 12
-1 49 5 12
-1 50 5 12
-1 51 5 12
-1 52 5 12
-1 53 5 12
-1 54 5 12
-1 55 5 12
-1 56 5 12
-1 57 5 12
-1 58 5 12
-1 59 5 12
-1 60 5 12
-1 61 5 12
-1 62 5 12
-1 63 5 12
-1 64 5 12
-1 65 5 12
-1 66 5 12
-1 67 5 12
-1 68 5 12
-1 69 5 12
-1 70 5 12
-1 71 5 12
-1 72 5 12
-1 73 5 12
-1 74 5 12
-1 75 5 12
-1 76 5 12
-1 77 5 12
-1 78 5 12
-1 79 5 12
-1 80 5 12
-1 81 5 12
-1 82 5 12
-1 83 5 12
-1 84 5 12
-1 85 5 12
-1 86 5 12
-1 87 5 12
-1 88 5 12
-1 89 5 12
-1 90 5 12
-1 91 5 12
-1 92 5 12
-1 93 5 12
-1 94 5 12
-1 95 5 12
-1 96 5 12
-1 97 5 12
-1 98 5 12
-1 99 5 12
-1 100 5 12
-select * from t4 where rid = 2 order by cid;
-uid gid rid cid
-1 1 2 3
-1 1 2 4
-drop table t1,t2,t3,t4,t5,t6,t7;
-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;
-a b c
-1 1 1
-select * from t1 where b is null and c is null;
-a b c
-3 NULL NULL
-select * from t1 where b is null and c = 2;
-a b c
-2 NULL 2
-select * from t1 where b = 4 and c is null;
-a b c
-4 4 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;
-a b c
-1 1 1
-2 NULL 2
-3 NULL NULL
-4 4 NULL
-select * from t1 order by a;
-a b c
-1 1 1
-2 NULL 2
-3 NULL NULL
-4 4 NULL
-drop table t1, t8;
-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 ;
-id month year code
-1 4 2004 12
-drop table t1;
-create table t1 (a int primary key, b varchar(1000) not null, unique key (b))
-engine=ndb charset=utf8;
-insert into t1 values (1, repeat(_utf8 0xe288ab6474, 200));
-insert into t1 values (2, repeat(_utf8 0xe288ab6474, 200));
-ERROR 23000: Duplicate entry '\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bdt\222Bd' for key 'b'
-select a, sha1(b) from t1;
-a sha1(b)
-1 08f5d02c8b8bc244f275bdfc22c42c5cab0d9d7d
-drop table t1;
-create table t1(id int not null) engine = NDB;
-alter table t1 add constraint uk_test unique (id) using hash;
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_insert.result b/mysql-test/suite/ndb/r/ndb_insert.result
deleted file mode 100644
index 7551dc71823..00000000000
--- a/mysql-test/suite/ndb/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/suite/ndb/r/ndb_limit.result b/mysql-test/suite/ndb/r/ndb_limit.result
deleted file mode 100644
index da1ec3b61c3..00000000000
--- a/mysql-test/suite/ndb/r/ndb_limit.result
+++ /dev/null
@@ -1,72 +0,0 @@
-DROP TABLE IF EXISTS t2;
-CREATE TABLE t2 (
-a bigint unsigned NOT NULL PRIMARY KEY,
-b int unsigned not null,
-c int unsigned
-) engine=ndbcluster;
-select count(*) from t2;
-count(*)
-10000
-delete from t2 limit 1;
-select count(*) from t2;
-count(*)
-9999
-delete from t2 limit 100;
-select count(*) from t2;
-count(*)
-9899
-delete from t2 limit 1000;
-select count(*) from t2;
-count(*)
-8899
-update t2 set c=12345678 limit 100;
-select count(*) from t2 where c=12345678;
-count(*)
-100
-select count(*) from t2 where c=12345678 limit 1000;
-count(*)
-100
-select * from t2 limit 0;
-a b c
-drop table t2;
-CREATE TABLE `t2` (
-`views` int(11) NOT NULL default '0',
-`clicks` int(11) NOT NULL default '0',
-`day` date NOT NULL default '0000-00-00',
-`hour` tinyint(4) NOT NULL default '0',
-`bannerid` smallint(6) NOT NULL default '0',
-`zoneid` smallint(6) NOT NULL default '0',
-`source` varchar(50) NOT NULL default '',
-PRIMARY KEY (`day`,`hour`,`bannerid`,`zoneid`,`source`),
-KEY `bannerid_day` (`bannerid`,`day`),
-KEY `zoneid` (`zoneid`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-INSERT INTO `t2` VALUES
-( 1,0,'2004-09-17', 5,100,100,''),
-( 1,0,'2004-09-18', 7,100,100,''),
-( 17,0,'2004-09-27',20,132,100,''),
-( 4,0,'2004-09-16',23,132,100,''),
-( 86,0,'2004-09-18', 7,196,196,''),
-( 11,0,'2004-09-16',16,132,100,''),
-(140,0,'2004-09-18', 0,100,164,''),
-( 2,0,'2004-09-17', 7,132,100,''),
-(846,0,'2004-09-27',11,132,164,''),
-( 1,0,'2004-09-18', 8,132,100,''),
-( 22,0,'2004-09-27', 9,164,132,''),
-(711,0,'2004-09-27', 9,100,164,''),
-( 11,0,'2004-09-18', 0,196,132,''),
-( 41,0,'2004-09-27',15,196,132,''),
-( 57,0,'2004-09-18', 2,164,196,'');
-SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y')
-as date_formatted FROM t2 GROUP BY day ORDER BY day DESC;
-date date_formatted
-20040927 27-09-2004
-20040918 18-09-2004
-20040917 17-09-2004
-20040916 16-09-2004
-SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y')
-as date_formatted FROM t2 GROUP BY day ORDER BY day DESC LIMIT 2;
-date date_formatted
-20040927 27-09-2004
-20040918 18-09-2004
-drop table t2;
diff --git a/mysql-test/suite/ndb/r/ndb_load.result b/mysql-test/suite/ndb/r/ndb_load.result
deleted file mode 100644
index f990b12e735..00000000000
--- a/mysql-test/suite/ndb/r/ndb_load.result
+++ /dev/null
@@ -1,80 +0,0 @@
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=NDB;
-LOAD DATA INFILE '../../../std_data/words.dat' INTO TABLE t1 ;
-ERROR 23000: Can't write; duplicate key in table 't1'
-DROP TABLE t1;
-CREATE TABLE t1 (word CHAR(20) NOT NULL) ENGINE=NDB;
-LOAD DATA INFILE '../../../std_data/words.dat' INTO TABLE t1 ;
-SELECT * FROM t1 ORDER BY word;
-word
-Aarhus
-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
-DROP TABLE t1;
diff --git a/mysql-test/suite/ndb/r/ndb_loaddatalocal.result b/mysql-test/suite/ndb/r/ndb_loaddatalocal.result
deleted file mode 100644
index 71d1b143089..00000000000
--- a/mysql-test/suite/ndb/r/ndb_loaddatalocal.result
+++ /dev/null
@@ -1,46 +0,0 @@
-DROP TABLE IF EXISTS t1;
-create table t1(a int) engine=myisam;
-select * into outfile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
-drop table t1;
-create table t1(a int) engine=ndb;
-load data local infile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
-select count(*) from t1;
-count(*)
-10000
-drop table t1;
-create table t1(a int) engine=myisam;
-insert into t1 values (1), (2), (2), (3);
-select * into outfile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
-drop table t1;
-create table t1(a int primary key) engine=ndb;
-load data local infile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
-select * from t1 order by a;
-a
-1
-2
-3
-drop table t1;
-create table t1(a int) engine=myisam;
-insert into t1 values (1), (1), (2), (3);
-select * into outfile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
-drop table t1;
-create table t1(a int primary key) engine=ndb;
-load data local infile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
-select * from t1 order by a;
-a
-1
-2
-3
-drop table t1;
-create table t1(a int) engine=myisam;
-insert into t1 values (1), (2), (3), (3);
-select * into outfile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
-drop table t1;
-create table t1(a int primary key) engine=ndb;
-load data local infile 'MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
-select * from t1 order by a;
-a
-1
-2
-3
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_lock.result b/mysql-test/suite/ndb/r/ndb_lock.result
deleted file mode 100644
index 9057731c3f4..00000000000
--- a/mysql-test/suite/ndb/r/ndb_lock.result
+++ /dev/null
@@ -1,200 +0,0 @@
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
-create table t1 (x integer not null primary key, y varchar(32)) engine = ndb;
-insert into t1 values (1,'one'), (2,'two');
-select * from t1 order by x;
-x y
-1 one
-2 two
-select * from t1 order by x;
-x y
-1 one
-2 two
-start transaction;
-insert into t1 values (3,'three');
-select * from t1 order by x;
-x y
-1 one
-2 two
-3 three
-start transaction;
-select * from t1 order by x;
-x y
-1 one
-2 two
-commit;
-select * from t1 order by x;
-x y
-1 one
-2 two
-3 three
-commit;
-drop table t1;
-create table t1 (pk integer not null primary key, u int not null, o int not null,
-unique(u), key(o)) engine = ndb;
-insert into t1 values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
-lock tables t1 write;
-delete from t1 where pk = 1;
-unlock tables;
-select * from t1 order by pk;
-pk u o
-2 2 2
-3 3 3
-4 4 4
-5 5 5
-insert into t1 values (1,1,1);
-lock tables t1 write;
-delete from t1 where u = 1;
-unlock tables;
-select * from t1 order by pk;
-pk u o
-2 2 2
-3 3 3
-4 4 4
-5 5 5
-insert into t1 values (1,1,1);
-lock tables t1 write;
-delete from t1 where o = 1;
-unlock tables;
-select * from t1 order by pk;
-pk u o
-2 2 2
-3 3 3
-4 4 4
-5 5 5
-insert into t1 values (1,1,1);
-drop table t1;
-create table t1 (x integer not null primary key, y varchar(32), z integer, key(z)) engine = ndb;
-insert into t1 values (1,'one',1);
-begin;
-select * from t1 where x = 1 for update;
-x y z
-1 one 1
-begin;
-select * from t1 where x = 1 for update;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-rollback;
-rollback;
-insert into t1 values (2,'two',2),(3,"three",3);
-begin;
-select * from t1 where x = 1 for update;
-x y z
-1 one 1
-select * from t1 where x = 1 for update;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-select * from t1 where x = 2 for update;
-x y z
-2 two 2
-rollback;
-commit;
-begin;
-select * from t1 where y = 'one' or y = 'three' for update;
-x y z
-# # #
-# # #
-begin;
-select * from t1 where x = 2 for update;
-x y z
-2 two 2
-select * from t1 where x = 1 for update;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-rollback;
-commit;
-begin;
-select * from t1 where y = 'one' or y = 'three' order by x for update;
-x y z
-1 one 1
-3 three 3
-begin;
-select * from t1 where x = 2 for update;
-x y z
-2 two 2
-select * from t1 where x = 1 for update;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-rollback;
-commit;
-begin;
-select * from t1 where z > 1 and z < 3 for update;
-x y z
-2 two 2
-begin;
-select * from t1 where x = 1 for update;
-x y z
-1 one 1
-select * from t1 where x = 2 for update;
-Got one of the listed errors
-rollback;
-commit;
-begin;
-select * from t1 where x = 1 lock in share mode;
-x y z
-1 one 1
-begin;
-select * from t1 where x = 1 lock in share mode;
-x y z
-1 one 1
-select * from t1 where x = 2 for update;
-x y z
-2 two 2
-select * from t1 where x = 1 for update;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-rollback;
-commit;
-begin;
-select * from t1 where y = 'one' or y = 'three' lock in share mode;
-x y z
-# # #
-# # #
-begin;
-select * from t1 where y = 'one' lock in share mode;
-x y z
-1 one 1
-select * from t1 where x = 2 for update;
-x y z
-2 two 2
-select * from t1 where x = 1 for update;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-rollback;
-commit;
-begin;
-select * from t1 where y = 'one' or y = 'three' order by x lock in share mode;
-x y z
-1 one 1
-3 three 3
-begin;
-select * from t1 where y = 'one' lock in share mode;
-x y z
-1 one 1
-select * from t1 where x = 2 for update;
-x y z
-2 two 2
-select * from t1 where x = 1 for update;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-rollback;
-commit;
-begin;
-select * from t1 where z > 1 and z < 3 lock in share mode;
-x y z
-2 two 2
-begin;
-select * from t1 where z = 1 lock in share mode;
-x y z
-1 one 1
-select * from t1 where x = 1 for update;
-x y z
-1 one 1
-select * from t1 where x = 2 for update;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-rollback;
-commit;
-drop table t1;
-create table t3 (id2 int) engine=ndb;
-lock tables t3 write;
-unlock tables;
-drop table t3;
-create table t2 (id int, j int) engine=ndb;
-insert into t2 values (2, 2);
-create table t3 (id int) engine=ndb;
-lock tables t3 read;
-delete t2 from t2, t3 where t2.id = t3.id;
-unlock tables;
-drop table t2, t3;
diff --git a/mysql-test/suite/ndb/r/ndb_lock_table.result b/mysql-test/suite/ndb/r/ndb_lock_table.result
deleted file mode 100644
index a0550273e1a..00000000000
--- a/mysql-test/suite/ndb/r/ndb_lock_table.result
+++ /dev/null
@@ -1,11 +0,0 @@
-drop table if exists t1;
-create table t1 (a int) engine ndb;
-set autocommit=1;
-lock table t1 write;
-set autocommit=0;
-insert into t1 values (0);
-rollback;
-select * from t1;
-a
-unlock tables;
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_minmax.result b/mysql-test/suite/ndb/r/ndb_minmax.result
deleted file mode 100644
index cc0c238ac6e..00000000000
--- a/mysql-test/suite/ndb/r/ndb_minmax.result
+++ /dev/null
@@ -1,120 +0,0 @@
-drop table if exists t1, t2;
-CREATE TABLE t1 (
-a int PRIMARY KEY
-) engine = ndb;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t1 VALUES (2);
-INSERT INTO t1 VALUES (3);
-INSERT INTO t1 VALUES (4);
-INSERT INTO t1 VALUES (5);
-INSERT INTO t1 VALUES (6);
-select MAX(a) from t1;
-MAX(a)
-6
-select MAX(a) from t1;
-MAX(a)
-6
-select MAX(a) from t1;
-MAX(a)
-6
-select MAX(a) from t1;
-MAX(a)
-6
-select MIN(a) from t1;
-MIN(a)
-1
-select MIN(a) from t1;
-MIN(a)
-1
-select MIN(a) from t1;
-MIN(a)
-1
-select * from t1 order by a;
-a
-1
-2
-3
-4
-5
-6
-select MIN(a) from t1;
-MIN(a)
-1
-select MAX(a) from t1;
-MAX(a)
-6
-select MAX(a) from t1;
-MAX(a)
-6
-select * from t1 order by a;
-a
-1
-2
-3
-4
-5
-6
-drop table t1;
-CREATE TABLE t2 (
-a int PRIMARY KEY,
-b int not null,
-c int not null,
-KEY(b),
-UNIQUE(c)
-) engine = ndb;
-INSERT INTO t2 VALUES (1, 5, 1);
-INSERT INTO t2 VALUES (2, 2, 7);
-INSERT INTO t2 VALUES (3, 3, 3);
-INSERT INTO t2 VALUES (4, 4, 4);
-INSERT INTO t2 VALUES (5, 5, 5);
-INSERT INTO t2 VALUES (6, 6, 6);
-INSERT INTO t2 VALUES (7, 2, 10);
-INSERT INTO t2 VALUES (8, 10, 2);
-select MAX(a) from t2;
-MAX(a)
-8
-select MAX(b) from t2;
-MAX(b)
-10
-select MAX(c) from t2;
-MAX(c)
-10
-select MIN(a) from t2;
-MIN(a)
-1
-select MIN(b) from t2;
-MIN(b)
-2
-select MIN(c) from t2;
-MIN(c)
-1
-select * from t2 order by a;
-a b c
-1 5 1
-2 2 7
-3 3 3
-4 4 4
-5 5 5
-6 6 6
-7 2 10
-8 10 2
-select MIN(b) from t2;
-MIN(b)
-2
-select MAX(a) from t2;
-MAX(a)
-8
-select MAX(c) from t2;
-MAX(c)
-10
-select * from t2 order by a;
-a b c
-1 5 1
-2 2 7
-3 3 3
-4 4 4
-5 5 5
-6 6 6
-7 2 10
-8 10 2
-drop table t2;
diff --git a/mysql-test/suite/ndb/r/ndb_multi.result b/mysql-test/suite/ndb/r/ndb_multi.result
deleted file mode 100644
index 40483887919..00000000000
--- a/mysql-test/suite/ndb/r/ndb_multi.result
+++ /dev/null
@@ -1,145 +0,0 @@
-drop table if exists t1, t2, t3, t4;
-flush status;
-drop table if exists t1, t2, t3, t4;
-flush status;
-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;
-a
-2
-select * from t2;
-a
-3
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-select * from t1;
-a
-2
-drop table t1;
-create table t1 (a int) engine=ndbcluster;
-insert into t1 value (2);
-select * from t1;
-a
-2
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-drop table t1;
-create table t1 (a int) engine=ndbcluster;
-insert into t1 value (2);
-select * from t1;
-a
-2
-select * from t1;
-a
-2
-flush status;
-select * from t1;
-a
-2
-update t1 set a=3 where a=2;
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-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;
-select * from t1;
-a
-3
-select * from t3;
-a b c last_col
-1 Hi! 89 Longtext column
-show tables like 't4';
-Tables_in_test (t4)
-t4
-show tables;
-Tables_in_test
-t1
-t2
-t3
-t4
-drop table t1, t2, t3, t4;
-create table t1(c1 int key)ENGINE=MyISAM;
-insert into t1 values(1),(3),(5);
-select * from t1 order by c1;
-c1
-1
-3
-5
-show tables;
-Tables_in_test
-create table t1(c1 int key)ENGINE=MyISAM;
-insert into t1 values(100),(344),(533);
-select * from t1 order by c1;
-c1
-100
-344
-533
-alter table t1 engine=ndb;
-show tables;
-Tables_in_test
-t1
-Warnings:
-Warning 1050 Local table test.t1 shadows ndb table
-select * from t1 order by c1;
-c1
-100
-344
-533
-drop table t1;
-select * from t1 order by c1;
-c1
-1
-3
-5
-drop table t1;
-create database db;
-use db;
-create table t1(x int) engine=ndb;
-use db;
-show tables;
-Tables_in_db
-t1
-drop database db;
-show tables;
-ERROR 42000: Unknown database 'db'
-create database db;
-use db;
-create table t1(x int) engine=ndb;
-use db;
-create table t2(x int) engine=myisam;
-show tables;
-Tables_in_db
-t1
-t2
-drop database db;
-show tables;
-Tables_in_db
-t2
-drop database db;
-use test;
-create table `test`.`t1$EX`
- (server_id int unsigned,
-master_server_id int unsigned,
-master_epoch bigint unsigned,
-count int unsigned,
-primary key(server_id, master_server_id,
-master_epoch, count))
-engine ndb;
-show tables like '%$%';
-Tables_in_test (%$%)
-t1$ex
-use test;
-show tables like '%$%';
-Tables_in_test (%$%)
-t1$ex
-drop table `test`.`t1$EX`;
-show tables like '%$%';
-Tables_in_test (%$%)
-show tables like '%$%';
-Tables_in_test (%$%)
diff --git a/mysql-test/suite/ndb/r/ndb_multi_row.result b/mysql-test/suite/ndb/r/ndb_multi_row.result
deleted file mode 100644
index 96986490d23..00000000000
--- a/mysql-test/suite/ndb/r/ndb_multi_row.result
+++ /dev/null
@@ -1,68 +0,0 @@
-drop table if exists t1, t2, t3, t4;
-flush status;
-drop table if exists t1, t2, t3, t4;
-flush status;
-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;
-a
-2
-select * from t2;
-a
-3
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-select * from t1;
-a
-2
-drop table t1;
-create table t1 (a int) engine=ndbcluster;
-insert into t1 value (2);
-select * from t1;
-a
-2
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-drop table t1;
-create table t1 (a int) engine=ndbcluster;
-insert into t1 value (2);
-select * from t1;
-a
-2
-flush status;
-select * from t1;
-a
-2
-update t1 set a=3 where a=2;
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-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;
-select * from t1;
-a
-3
-select * from t3;
-a b c last_col
-1 Hi! 89 Longtext column
-show tables like 't4';
-Tables_in_test (t4)
-t4
-show tables;
-Tables_in_test
-t1
-t2
-t3
-t4
-drop table t1, t2, t3, t4;
-drop table if exists t1, t3, t4;
-Warnings:
-Warning 155 Table 'test.t1' doesn't exist
-Warning 155 Table 'test.t3' doesn't exist
-Warning 155 Table 'test.t4' doesn't exist
diff --git a/mysql-test/suite/ndb/r/ndb_partition_error.result b/mysql-test/suite/ndb/r/ndb_partition_error.result
deleted file mode 100644
index df2db5c5f06..00000000000
--- a/mysql-test/suite/ndb/r/ndb_partition_error.result
+++ /dev/null
@@ -1,47 +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) nodegroup 12,
-partition x2 values less than (10) nodegroup 13,
-partition x3 values less than (20) nodegroup 14);
-ERROR HY000: Can't create table 'test.t1' (errno: 140)
-show warnings;
-Level Code Message
-Warning 1296 Got error 771 'Given NODEGROUP doesn't exist in this cluster' from NDB
-Error 1005 Can't create table 'test.t1' (errno: 140)
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(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));
-drop table t1;
-CREATE TABLE t1 (id INT) ENGINE=NDB
-PARTITION BY LIST(id)
-(PARTITION p0 VALUES IN (2, 4),
-PARTITION p1 VALUES IN (42, 142));
-INSERT INTO t1 VALUES (2);
-UPDATE t1 SET id=5 WHERE id=2;
-ERROR HY000: Table has no partition for value 5
-DROP TABLE t1;
-create table t1 (a int,b int, c int)
-engine = ndb
-partition by list(a)
-partitions 2
-(partition x123 values in (11, 12),
-partition x234 values in (5, 1));
-insert into t1 values (NULL,1,1);
-ERROR HY000: Table has no partition for value NULL
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_partition_error2.result b/mysql-test/suite/ndb/r/ndb_partition_error2.result
deleted file mode 100644
index a739ef3923c..00000000000
--- a/mysql-test/suite/ndb/r/ndb_partition_error2.result
+++ /dev/null
@@ -1,3 +0,0 @@
-drop table if exists t1;
-create table t1 (s1 int) engine=ndbcluster;
-ERROR HY000: For the partitioned engine it is necessary to define all partitions
diff --git a/mysql-test/suite/ndb/r/ndb_partition_key.result b/mysql-test/suite/ndb/r/ndb_partition_key.result
deleted file mode 100644
index bc15fd30413..00000000000
--- a/mysql-test/suite/ndb/r/ndb_partition_key.result
+++ /dev/null
@@ -1,312 +0,0 @@
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b,c))
-ENGINE = NDB
-PARTITION BY KEY (a,b);
-insert into t1 values (1,1,1,1);
-select * from t1;
-a b c d
-1 1 1 1
-update t1 set d = 2 where a = 1 and b = 1 and c = 1;
-select * from t1;
-a b c d
-1 1 1 2
-delete from t1;
-select * from t1;
-a b c d
-drop table t1;
-CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b))
-ENGINE = NDB
-PARTITION BY KEY (c);
-ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
-CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY(a,b))
-ENGINE = NDB
-PARTITION BY KEY (a);
-insert into t1 values
-(1,1,3),(1,2,3),(1,3,3),(1,4,3),(1,5,3),(1,6,3),
-(1,7,3),(1,8,3),(1,9,3),(1,10,3),(1,11,3),(1,12,3);
-select * from t1 order by b;
-a b c
-1 1 3
-1 2 3
-1 3 3
-1 4 3
-1 5 3
-1 6 3
-1 7 3
-1 8 3
-1 9 3
-1 10 3
-1 11 3
-1 12 3
-select max(b) from t1 where a = 1;
-max(b)
-12
-select b from t1 where a = 1 order by b desc;
-b
-12
-11
-10
-9
-8
-7
-6
-5
-4
-3
-2
-1
-DROP TABLE t1;
-CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT,
-PRIMARY KEY (a,b,c) USING HASH)
-ENGINE=NDB
-DEFAULT CHARSET=latin1
-PARTITION BY KEY (b);
-insert into t1 values (1,"a",1,1),(2,"a",1,1),(3,"a",1,1);
--- t1 --
-
-Fragment type: 5
-K Value: 6
-Min load factor: 78
-Max load factor: 80
-Temporary table: no
-Number of attributes: 4
-Number of primary keys: 3
-Length of frm data: #
-Row Checksum: 1
-Row GCI: 1
-SingleUserMode: 0
-ForceVarPart: 1
-TableStatus: Retrieved
--- Attributes --
-a Int PRIMARY KEY AT=FIXED ST=MEMORY
-b Char(10;latin1_bin) PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
-c Int PRIMARY KEY AT=FIXED ST=MEMORY
-d Int NULL AT=FIXED ST=MEMORY
-
--- Indexes --
-PRIMARY KEY(a, b, c) - UniqueHashIndex
-
-
-NDBT_ProgramExit: 0 - OK
-
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
- `b` char(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
- `c` int(11) NOT NULL DEFAULT '0',
- `d` int(11) DEFAULT NULL,
- PRIMARY KEY (`a`,`b`,`c`) USING HASH
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (b) */
-DROP TABLE t1;
-CREATE TABLE t1 (a int not null primary key)
-PARTITION BY KEY(a)
-(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
-drop table t1;
-CREATE TABLE t1 (a int not null primary key);
-ALTER TABLE t1
-ENGINE = NDB
-PARTITION BY KEY(a)
-(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
-drop table t1;
-CREATE TABLE t1 (a int not null primary key) ENGINE = NDB;
-ALTER TABLE t1
-PARTITION BY KEY(a)
-(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
-drop table t1;
-create table t1 (a int)
-engine=ndb
-partition by key(a)
-(partition p0, partition p1);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION p0 ENGINE = ndbcluster,
- PARTITION p1 ENGINE = ndbcluster) */
-alter table t1 engine=heap;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION p0 ENGINE = MEMORY,
- PARTITION p1 ENGINE = MEMORY) */
-alter table t1 engine=ndb;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION p0 ENGINE = ndbcluster,
- PARTITION p1 ENGINE = ndbcluster) */
-alter table t1 engine=heap remove partitioning;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL
-) ENGINE=MEMORY DEFAULT CHARSET=latin1
-alter table t1 engine=ndb
-partition by key(a)
-(partition p0, partition p1 engine = ndb);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION p0 ENGINE = ndbcluster,
- PARTITION p1 ENGINE = ndbcluster) */
-alter table t1
-partition by key (a)
-(partition p0 engine=ndb, partition p1 engine=ndb);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION p0 ENGINE = ndbcluster,
- PARTITION p1 ENGINE = ndbcluster) */
-alter table t1 remove partitioning;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-alter table t1
-partition by key(a)
-(partition p0 engine=ndb, partition p1);
-alter table t1
-engine=ndb
-partition by key(a)
-(partition p0 engine=ndb, partition p1 engine = ndb);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION p0 ENGINE = ndbcluster,
- PARTITION p1 ENGINE = ndbcluster) */
-drop table t1;
-CREATE TABLE t1 (
-c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
-c2 TEXT NOT NULL,
-c3 INT NOT NULL,
-c4 BIT NOT NULL,
-c5 FLOAT,
-c6 VARCHAR(255),
-c7 TIMESTAMP,
-PRIMARY KEY(c1,c3))
-ENGINE=NDB
-PARTITION BY KEY(c3) PARTITIONS 5;
-ALTER TABLE t1 COALESCE PARTITION 4;
-DROP TABLE t1;
-CREATE TABLE t1 (a int primary key)
-ENGINE=NDB
-PARTITION BY KEY(a);
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-REPAIR TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-ALTER TABLE t1 OPTIMIZE PARTITION p0;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-ALTER TABLE t1 CHECK PARTITION p0;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-ALTER TABLE t1 REPAIR PARTITION p0;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-ALTER TABLE t1 ANALYZE PARTITION p0;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-ALTER TABLE t1 REBUILD PARTITION p0;
-ERROR HY000: Table storage engine for 't1' doesn't have this option
-DROP TABLE t1;
-CREATE TABLE t1 (
-c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
-c2 TEXT NOT NULL,
-c3 INT NOT NULL,
-PRIMARY KEY(c1,c3))
-ENGINE=NDB
-PARTITION BY KEY(c3) PARTITIONS 5;
-ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
-DROP TABLE t1;
-CREATE TABLE t1 (
-c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
-c2 TEXT NOT NULL,
-c3 INT NOT NULL,
-PRIMARY KEY(c1,c3))
-ENGINE=NDB
-PARTITION BY KEY(c3)
-(PARTITION p0 NODEGROUP 0, PARTITION p1 NODEGROUP 0);
-ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
-SELECT NODEGROUP,PARTITION_NAME FROM information_schema.partitions WHERE
-table_name = "t1";
-NODEGROUP PARTITION_NAME
-0 p0
-0 p1
-DROP TABLE t1;
-CREATE TABLE t1 (
-a tinyint unsigned NOT NULL,
-b bigint(20) unsigned NOT NULL,
-c char(12),
-PRIMARY KEY (a,b)
-) ENGINE ndb DEFAULT CHARSET=latin1 PARTITION BY KEY (a);
-insert into t1 values(1,1,'1'), (2,2,'2'), (3,3,'3'), (4,4,'4'), (5,5,'5');
-select * from t1 where a = 1;
-a b c
-1 1 1
-select * from t1 where a = 2;
-a b c
-2 2 2
-select * from t1 where a = 3;
-a b c
-3 3 3
-select * from t1 where a = 4;
-a b c
-4 4 4
-select * from t1 where a = 5;
-a b c
-5 5 5
-delete from t1 where a = 1;
-select * from t1 order by 1;
-a b c
-2 2 2
-3 3 3
-4 4 4
-5 5 5
-delete from t1 where a = 2;
-select * from t1 order by 1;
-a b c
-3 3 3
-4 4 4
-5 5 5
-delete from t1 where a = 3;
-select * from t1 order by 1;
-a b c
-4 4 4
-5 5 5
-delete from t1 where a = 4;
-select * from t1 order by 1;
-a b c
-5 5 5
-delete from t1 where a = 5;
-select * from t1 order by 1;
-a b c
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_partition_list.result b/mysql-test/suite/ndb/r/ndb_partition_list.result
deleted file mode 100644
index ce2574ddcc4..00000000000
--- a/mysql-test/suite/ndb/r/ndb_partition_list.result
+++ /dev/null
@@ -1,51 +0,0 @@
-drop table if exists t1;
-CREATE TABLE t1 ( f_int1 INTEGER NOT NULL, f_int2 INTEGER NOT NULL,
-f_char1 CHAR(10),
-f_char2 CHAR(10), f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int1,f_int2))
-ENGINE = NDB
-PARTITION BY LIST(MOD(f_int1 + f_int2,4))
-(PARTITION part_3 VALUES IN (-3),
-PARTITION part_2 VALUES IN (-2),
-PARTITION part_1 VALUES IN (-1),
-PARTITION part0 VALUES IN (0),
-PARTITION part1 VALUES IN (1),
-PARTITION part2 VALUES IN (2),
-PARTITION part3 VALUES IN (3,4,5));
-INSERT INTO t1 SET f_int1 = -2, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20===';
-INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-INSERT INTO t1 SET f_int1 = 3, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-INSERT INTO t1 SET f_int1 = 4, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-INSERT INTO t1 SET f_int1 = 5, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-SELECT * FROM t1 ORDER BY f_int1;
-f_int1 f_int2 f_char1 f_char2 f_charbig
--2 20 20 20 ===20===
-1 1 1 1 ===1===
-2 1 1 1 ===1===
-3 1 1 1 ===1===
-4 1 1 1 ===1===
-5 1 1 1 ===1===
-20 1 1 1 ===1===
-DROP TABLE t1;
-CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, f_char1 CHAR(10),
-f_char2 CHAR(10), f_charbig VARCHAR(1000))
-ENGINE = NDB
-PARTITION BY LIST(f_int1)
-(PARTITION part_1 VALUES IN (-1),
-PARTITION part0 VALUES IN (0,1),
-PARTITION part1 VALUES IN (2));
-INSERT INTO t1 SET f_int1 = -1, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20===';
-INSERT INTO t1 SET f_int1 = 0, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20===';
-INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-ERROR HY000: Table has no partition for value 20
-SELECT * FROM t1 ORDER BY f_int1;
-f_int1 f_int2 f_char1 f_char2 f_charbig
--1 20 20 20 ===20===
-0 20 20 20 ===20===
-1 1 1 1 ===1===
-2 1 1 1 ===1===
-DROP TABLE t1;
diff --git a/mysql-test/suite/ndb/r/ndb_partition_range.result b/mysql-test/suite/ndb/r/ndb_partition_range.result
deleted file mode 100644
index fbaec81984d..00000000000
--- a/mysql-test/suite/ndb/r/ndb_partition_range.result
+++ /dev/null
@@ -1,275 +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
-def test t1 x1 NULL 1 NULL RANGE NULL a NULL 5 0 0 0 # 0 0 # # NULL NULL default NULL
-def test t1 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 0 # 0 0 # # NULL NULL default NULL
-def test t1 x3 NULL 3 NULL RANGE NULL a NULL 20 0 0 0 # 0 0 # # NULL NULL default NULL
-select * from t1 order by a;
-a b c
-1 1 1
-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
-INSERT into t1 values (1, 2, 2);
-select max(b) from t1 where a = 1;
-max(b)
-2
-select b from t1 where a = 1 order by b desc;
-b
-2
-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
deleted file mode 100644
index 113fb28bb78..00000000000
--- a/mysql-test/suite/ndb/r/ndb_read_multi_range.result
+++ /dev/null
@@ -1,494 +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=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, t2;
diff --git a/mysql-test/suite/ndb/r/ndb_rename.result b/mysql-test/suite/ndb/r/ndb_rename.result
deleted file mode 100644
index 2cc2dfb3ff1..00000000000
--- a/mysql-test/suite/ndb/r/ndb_rename.result
+++ /dev/null
@@ -1,24 +0,0 @@
-DROP TABLE IF EXISTS t1,t2;
-drop database if exists mysqltest;
-CREATE TABLE t1 (
-pk1 INT NOT NULL PRIMARY KEY,
-attr1 INT NOT NULL,
-attr2 INT,
-attr3 VARCHAR(10),
-INDEX i1(attr1)
-) ENGINE=ndbcluster;
-INSERT INTO t1 VALUES (0,0,0,"zero"),(1,1,1,"one"),(2,2,2,"two");
-SELECT * FROM t1 WHERE attr1 = 1;
-pk1 attr1 attr2 attr3
-1 1 1 one
-alter table t1 rename t2;
-SELECT * FROM t2 WHERE attr1 = 1;
-pk1 attr1 attr2 attr3
-1 1 1 one
-create database ndbtest;
-alter table t2 rename ndbtest.t2;
-SELECT * FROM ndbtest.t2 WHERE attr1 = 1;
-pk1 attr1 attr2 attr3
-1 1 1 one
-drop table ndbtest.t2;
-drop database ndbtest;
diff --git a/mysql-test/suite/ndb/r/ndb_replace.result b/mysql-test/suite/ndb/r/ndb_replace.result
deleted file mode 100644
index ba78017ef7b..00000000000
--- a/mysql-test/suite/ndb/r/ndb_replace.result
+++ /dev/null
@@ -1,99 +0,0 @@
-drop table if exists t1,t2;
-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);
-insert into t1 (gesuchnr,benutzer_id) values (1,1);
-ERROR 23000: Duplicate entry '1-1' for key 'PRIMARY'
-replace into t1 (gesuchnr,benutzer_id) values (1,1);
-select * from t1 order by gesuchnr;
-gesuchnr benutzer_id
-1 1
-2 1
-3 2
-drop table t1;
-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;
-i j k
-3 1 42
-17 2 NULL
-DROP TABLE t1;
-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;
-a b c x y z id i
-1 1 1 c c c 3 3
-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;
-a b c x y z id i
-1 1 1 b b b 5 2
-DROP TABLE t2;
-drop table if exists t1;
-create table t1 (pk int primary key, apk int unique, data int) engine=ndbcluster;
-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;
-pk apk data
-3 3 3
-4 1 NULL
-5 2 NULL
-delete from t1;
-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;
-pk apk data
-1 4 NULL
-2 5 NULL
-3 3 3
-delete from t1;
-insert into t1 values (1, 1, 1), (4, 4, 4), (6, 6, 6);
-load data infile '../../../std_data/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
-select * from t1 order by pk;
-pk apk data
-1 1 1
-3 4 NULL
-5 6 NULL
-delete from t1;
-insert into t1 values (1, 1, 1), (3, 3, 3), (5, 5, 5);
-load data infile '../../../std_data/loaddata5.dat' replace into table t1 fields terminated by '' enclosed by '' ignore 1 lines (pk, apk);
-select * from t1 order by pk;
-pk apk data
-1 1 1
-3 4 NULL
-5 6 NULL
-delete from t1;
-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;
-pk apk data
-2 4 NULL
-3 3 3
-4 1 NULL
-drop table t1;
-End of 5.0 tests.
diff --git a/mysql-test/suite/ndb/r/ndb_restore.result b/mysql-test/suite/ndb/r/ndb_restore.result
deleted file mode 100644
index 186cbb71f5e..00000000000
--- a/mysql-test/suite/ndb/r/ndb_restore.result
+++ /dev/null
@@ -1,501 +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'),(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 = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-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
-def test t1_c capgoaledatta 1 NULL NO mediumint NULL NULL 7 0 NULL NULL mediumint(5) unsigned PRI auto_increment select,insert,update,references
-def test t1_c goaledatta 2 NO char 2 2 NULL NULL latin1 latin1_swedish_ci char(2) PRI select,insert,update,references
-def test t1_c maturegarbagefa 3 NO varchar 32 32 NULL NULL latin1 latin1_swedish_ci varchar(32) PRI select,insert,update,references
-select count(*) from t1;
-count(*)
-5
-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
-select max(capgoaledatta) from t1_c;
-max(capgoaledatta)
-3000
-select auto_increment from information_schema.tables
-where table_name = 't1_c';
-auto_increment
-3001
-select max(capgotod) from t2_c;
-max(capgotod)
-500
-select auto_increment from information_schema.tables
-where table_name = 't2_c';
-auto_increment
-501
-select max(capfa) from t4_c;
-max(capfa)
-290000000
-select auto_increment from information_schema.tables
-where table_name = 't4_c';
-auto_increment
-290000001
-select max(dardtestard) from t7_c;
-max(dardtestard)
-28
-select auto_increment from information_schema.tables
-where table_name = 't7_c';
-auto_increment
-29
-select max(a) from t10_c;
-max(a)
-10000
-select auto_increment from information_schema.tables
-where table_name = 't10_c';
-auto_increment
-10001
-ALTER TABLE t7_c
-PARTITION BY LINEAR KEY (`dardtestard`);
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
-(id INT, backup_id INT) ENGINE = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-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 = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-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
deleted file mode 100644
index f2630573220..00000000000
--- a/mysql-test/suite/ndb/r/ndb_restore_compat.result
+++ /dev/null
@@ -1,119 +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
-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
deleted file mode 100644
index b101c93d156..00000000000
--- a/mysql-test/suite/ndb/r/ndb_restore_different_endian_data.result
+++ /dev/null
@@ -1,200 +0,0 @@
-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 1e20 1e150 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 1e20 1e150 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/suite/ndb/r/ndb_restore_partition.result b/mysql-test/suite/ndb/r/ndb_restore_partition.result
deleted file mode 100644
index b984c76a91d..00000000000
--- a/mysql-test/suite/ndb/r/ndb_restore_partition.result
+++ /dev/null
@@ -1,460 +0,0 @@
-use test;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
-CREATE TABLE `t1_c` (
-`capgoaledatta` smallint(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'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'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 (5,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;
-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),(22,'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),(32,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(29,'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 default '0',
-`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 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 TEMPORARY TABLE IF NOT EXISTS test.backup_info
-(id INT, backup_id INT) ENGINE = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-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;
-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
-ALTER TABLE t1_c
-PARTITION BY RANGE (`capgoaledatta`)
-(PARTITION p0 VALUES LESS THAN MAXVALUE);
-ALTER TABLE t2_c
-PARTITION BY LIST(`capgotod`)
-(PARTITION p0 VALUES IN (0,1,2,3,4,5,6));
-ALTER TABLE t3_c
-PARTITION BY HASH (`CapGoaledatta`);
-ALTER TABLE t5_c
-PARTITION BY HASH (`capfa`)
-PARTITIONS 4;
-ALTER TABLE t6_c
-PARTITION BY LINEAR HASH (`relatta`)
-PARTITIONS 4;
-ALTER TABLE t7_c
-PARTITION BY LINEAR KEY (`dardtestard`);
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
-(id INT, backup_id INT) ENGINE = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-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;
-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;
-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;
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
-(id INT, backup_id INT) ENGINE = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
-Create table test/def/t2_c failed: Translate frm error
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-drop table if exists t2_c;
-520093696,<the_backup_id>
diff --git a/mysql-test/suite/ndb/r/ndb_restore_print.result b/mysql-test/suite/ndb/r/ndb_restore_print.result
deleted file mode 100644
index fa52513e7d0..00000000000
--- a/mysql-test/suite/ndb/r/ndb_restore_print.result
+++ /dev/null
@@ -1,312 +0,0 @@
-use test;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-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 myisam;
-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
-);
-select pk
-,hex(a1), hex(a2), hex(a3), hex(a4), hex(a5)
-,b1, b2
-,c1 , c2
-,d1 , d2
-,e1 , e2
-,f1 , f2, f3
-,g1 , g2, g3
-,hex(h1), hex(h2), hex(h3)
-,hex(i1), hex(i2), hex(i3)
-from t1 order by pk;
-pk 1
-hex(a1) 1
-hex(a2) 17
-hex(a3) 789A
-hex(a4) 789ABCDE
-hex(a5) FEDC0001
-b1 127
-b2 255
-c1 32767
-c2 65535
-d1 2147483647
-d2 4294967295
-e1 9223372036854775807
-e2 18446744073709551615
-f1 1
-f2 12345678901234567890123456789012
-f3 123456789
-g1 1
-g2 12345678901234567890123456789012
-g3 123456789
-hex(h1) 12
-hex(h2) 123456789ABCDEF0
-hex(h3) 012345000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-hex(i1) 12
-hex(i2) 123456789ABCDEF0
-hex(i3) 00123450
-pk 2
-hex(a1) 0
-hex(a2) 0
-hex(a3) 0
-hex(a4) 0
-hex(a5) 0
-b1 -128
-b2 0
-c1 -32768
-c2 0
-d1 -2147483648
-d2 0
-e1 -9223372036854775808
-e2 0
-f1
-f2
-f3
-g1
-g2
-g3
-hex(h1) 00
-hex(h2) 0000000000000000
-hex(h3) 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-hex(i1) 00
-hex(i2) 00
-hex(i3) 00
-pk 3
-hex(a1) NULL
-hex(a2) NULL
-hex(a3) NULL
-hex(a4) NULL
-hex(a5) NULL
-b1 NULL
-b2 NULL
-c1 NULL
-c2 NULL
-d1 NULL
-d2 NULL
-e1 NULL
-e2 NULL
-f1 NULL
-f2 NULL
-f3 NULL
-g1 NULL
-g2 NULL
-g3 NULL
-hex(h1) NULL
-hex(h2) NULL
-hex(h3) NULL
-hex(i1) NULL
-hex(i2) NULL
-hex(i3) NULL
-alter table t1 engine ndb;
-select pk
-,hex(a1), hex(a2), hex(a3), hex(a4), hex(a5)
-,b1, b2
-,c1 , c2
-,d1 , d2
-,e1 , e2
-,f1 , f2, f3
-,g1 , g2, g3
-,hex(h1), hex(h2), hex(h3)
-,hex(i1), hex(i2), hex(i3)
-from t1 order by pk;
-pk 1
-hex(a1) 1
-hex(a2) 17
-hex(a3) 789A
-hex(a4) 789ABCDE
-hex(a5) FEDC0001
-b1 127
-b2 255
-c1 32767
-c2 65535
-d1 2147483647
-d2 4294967295
-e1 9223372036854775807
-e2 18446744073709551615
-f1 1
-f2 12345678901234567890123456789012
-f3 123456789
-g1 1
-g2 12345678901234567890123456789012
-g3 123456789
-hex(h1) 12
-hex(h2) 123456789ABCDEF0
-hex(h3) 012345000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-hex(i1) 12
-hex(i2) 123456789ABCDEF0
-hex(i3) 00123450
-pk 2
-hex(a1) 0
-hex(a2) 0
-hex(a3) 0
-hex(a4) 0
-hex(a5) 0
-b1 -128
-b2 0
-c1 -32768
-c2 0
-d1 -2147483648
-d2 0
-e1 -9223372036854775808
-e2 0
-f1
-f2
-f3
-g1
-g2
-g3
-hex(h1) 00
-hex(h2) 0000000000000000
-hex(h3) 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-hex(i1) 00
-hex(i2) 00
-hex(i3) 00
-pk 3
-hex(a1) NULL
-hex(a2) NULL
-hex(a3) NULL
-hex(a4) NULL
-hex(a5) NULL
-b1 NULL
-b2 NULL
-c1 NULL
-c2 NULL
-d1 NULL
-d2 NULL
-e1 NULL
-e2 NULL
-f1 NULL
-f2 NULL
-f3 NULL
-g1 NULL
-g2 NULL
-g3 NULL
-hex(h1) NULL
-hex(h2) NULL
-hex(h3) NULL
-hex(i1) NULL
-hex(i2) NULL
-hex(i3) NULL
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
-(id INT, backup_id INT) ENGINE = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
-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
-2;0x0;0x0;0x0;0x0;0x0;-128;0;-32768;0;-2147483648;0;-9223372036854775808;0;;;;;;;0x0;0x0;0x0;0x0;0x0;0x0
-3;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N;\N
-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
-2,0x0,0x0,0x0,0x0,0x0,-128,0,-32768,0,-2147483648,0,-9223372036854775808,0,'','','','','','',0x0,0x0,0x0,0x0,0x0,0x0
-3,,,,,,,,,,,,,,,,,,,,,,,,,
-drop table t1;
-create table t1
-(pk int key
-,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(9), h3 BINARY(255)
-,i1 VARBINARY(32), i2 VARBINARY(255), i3 VARBINARY(1000)
-) engine ndb;
-insert into t1 values
-(1
-,'1','12345678901234567890123456789012','123456789 '
- ,'1 ','12345678901234567890123456789012 ','123456789 '
- ,0x20,0x123456789abcdef020, 0x012345000020
-,0x1200000020,0x123456789abcdef000000020, 0x00123450000020
-);
-create table t2 (pk int key, a int) engine ndb;
-create table t3 (pk int key, a int) engine ndb;
-create table t4 (pk int key, a int) engine ndb;
-insert into t2 values (1,11),(2,12),(3,13),(4,14),(5,15);
-insert into t3 values (1,21),(2,22),(3,23),(4,24),(5,25);
-insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35);
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
-(id INT, backup_id INT) ENGINE = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
-'1' '1' '12345678901234567890123456789012' '123456789' '1' '12345678901234567890123456789012' '123456789' '0x20' '0x123456789ABCDEF020' '0x012345000020' '0x1200000020' '0x123456789ABCDEF000000020' '0x00123450000020'
-
-t1
---
-1 1 12345678901234567890123456789012 123456789 1 12345678901234567890123456789012 123456789 0x20 0x123456789ABCDEF020 0x012345000020 0x1200000020 0x123456789ABCDEF000000020 0x00123450000020
-
-t2
---
-1 11
-2 12
-3 13
-4 14
-5 15
-
-t3
---
-1 21
-2 22
-3 23
-4 24
-5 25
-
-t4
---
-1 31
-2 32
-3 33
-4 34
-5 35
-drop table t1;
-create table t1
-(pk int key
-,a1 MEDIUMINT, a2 MEDIUMINT UNSIGNED
-) engine ndb;
-insert into t1 values(1, 8388607, 16777215);
-insert into t1 values(2, -8388608, 0);
-insert into t1 values(3, -1, 1);
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info
-(id INT, backup_id INT) ENGINE = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.backup_info;
-1;8388607;16777215
-2;-8388608;0
-3;-1;1
-drop table t1;
-drop table t2;
-drop table t3;
-drop table t4;
diff --git a/mysql-test/suite/ndb/r/ndb_row_format.result b/mysql-test/suite/ndb/r/ndb_row_format.result
deleted file mode 100644
index 48a314c2fe9..00000000000
--- a/mysql-test/suite/ndb/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
-Warning 1478 Table storage engine 'ndbcluster' does not support the create option 'Row format FIXED incompatible with variable sized attribute'
-Error 1005 Can't create table 'test.t1' (errno: 138)
-CREATE TABLE t1
-( a INT KEY,
-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
deleted file mode 100644
index 1d5f3041adb..00000000000
--- a/mysql-test/suite/ndb/r/ndb_single_user.result
+++ /dev/null
@@ -1,119 +0,0 @@
-drop table if exists t1,t2;
-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
-Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
-Error 1528 Failed to create LOGFILE GROUP
-create table t1 (a int key, b int unique, c int) engine ndb;
-CREATE LOGFILE GROUP lg1
-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
-Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
-Error 1528 Failed to create TABLESPACE
-DROP LOGFILE GROUP lg1
-ENGINE =NDB;
-ERROR HY000: Failed to drop LOGFILE GROUP
-show warnings;
-Level Code Message
-Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
-Error 1529 Failed to drop LOGFILE GROUP
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-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
-Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
-Error 1533 Failed to alter: DROP DATAFILE
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-ENGINE NDB;
-DROP TABLESPACE ts1
-ENGINE NDB;
-ERROR HY000: Failed to drop TABLESPACE
-show warnings;
-Level Code Message
-Warning 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
-Error 1529 Failed to drop TABLESPACE
-DROP TABLESPACE ts1
-ENGINE NDB;
-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 t2;
-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
deleted file mode 100644
index dbd0325044d..00000000000
--- a/mysql-test/suite/ndb/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 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/suite/ndb/r/ndb_subquery.result b/mysql-test/suite/ndb/r/ndb_subquery.result
deleted file mode 100644
index 45662882d3a..00000000000
--- a/mysql-test/suite/ndb/r/ndb_subquery.result
+++ /dev/null
@@ -1,92 +0,0 @@
-drop table if exists t1, t2, t3, t4;
-create table t1 (p int not null primary key, u int not null, o int not null,
-unique (u), key(o)) engine=ndb;
-create table t2 (p int not null primary key, u int not null, o int not null,
-unique (u), key(o)) engine=ndb;
-create table t3 (a int not null primary key, b int not null) engine=ndb;
-create table t4 (c int not null primary key, d int not null) engine=ndb;
-insert into t1 values (1,1,1),(2,2,2),(3,3,3);
-insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5);
-insert into t3 values (1,10), (2,10), (3,30), (4, 30);
-insert into t4 values (1,10), (2,10), (3,30), (4, 30);
-explain select * from t2 where p NOT IN (select p from t1);
-id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL # Using where
-2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func #
-select * from t2 where p NOT IN (select p from t1) order by p;
-p u o
-4 4 4
-5 5 5
-explain select * from t2 where p NOT IN (select u from t1);
-id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL # Using where
-2 DEPENDENT SUBQUERY t1 unique_subquery u u 4 func #
-select * from t2 where p NOT IN (select u from t1) order by p;
-p u o
-4 4 4
-5 5 5
-explain select * from t2 where p NOT IN (select o from t1);
-id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL # Using where
-2 DEPENDENT SUBQUERY t1 index_subquery o o 4 func #
-select * from t2 where p NOT IN (select o from t1) order by p;
-p u o
-4 4 4
-5 5 5
-explain select * from t2 where p NOT IN (select p+0 from t1);
-id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL # Using where
-2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # Using where
-select * from t2 where p NOT IN (select p+0 from t1) order by p;
-p u o
-4 4 4
-5 5 5
-drop table t1;
-drop table t2;
-create table t1 (p int not null primary key, u int not null) engine=ndb;
-insert into t1 values (1,1),(2,2),(3,3);
-create table t2 as
-select t1.*
-from t1 as t1, t1 as t2, t1 as t3, t1 as t4, t1 as t5, t1 as t6, t1 as t7, t1 as t8
-where t1.u = t2.u
-and t2.u = t3.u
-and t3.u = t4.u
-and t4.u = t5.u
-and t5.u = t6.u
-and t6.u = t7.u
-and t7.u = t8.u;
-select * from t2 order by 1;
-p u
-1 1
-2 2
-3 3
-select * from t3 where a = any (select c from t4 where c = 1) order by a;
-a b
-1 10
-select * from t3 where a in (select c from t4 where c = 1) order by a;
-a b
-1 10
-select * from t3 where a <> some (select c from t4 where c = 1) order by a;
-a b
-2 10
-3 30
-4 30
-select * from t3 where a > all (select c from t4 where c = 1) order by a;
-a b
-2 10
-3 30
-4 30
-select * from t3 where row(1,10) = (select c,d from t4 where c = 1) order by a;
-a b
-1 10
-2 10
-3 30
-4 30
-select * from t3 where exists (select * from t4 where c = 1) order by a;
-a b
-1 10
-2 10
-3 30
-4 30
-drop table if exists t1, t2, t3, t4;
-End of 5.1 tests
diff --git a/mysql-test/suite/ndb/r/ndb_temporary.result b/mysql-test/suite/ndb/r/ndb_temporary.result
deleted file mode 100644
index 7b7740003af..00000000000
--- a/mysql-test/suite/ndb/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/suite/ndb/r/ndb_tmp_table_and_DDL.result b/mysql-test/suite/ndb/r/ndb_tmp_table_and_DDL.result
deleted file mode 100644
index 1b0f718ad65..00000000000
--- a/mysql-test/suite/ndb/r/ndb_tmp_table_and_DDL.result
+++ /dev/null
@@ -1,90 +0,0 @@
-CREATE TEMPORARY TABLE t1 (a INT);
-CREATE TABLE t2 (a INT, b INT) ENGINE= NDB;
-INSERT INTO t1 VALUES (1);
-CREATE EVENT e1 ON SCHEDULE EVERY 10 HOUR DO SELECT 1;
-INSERT INTO t1 VALUES (1);
-ALTER EVENT e1 ON SCHEDULE EVERY 20 HOUR DO SELECT 1;
-INSERT INTO t1 VALUES (1);
-DROP EVENT IF EXISTS e1;
-INSERT INTO t1 VALUES (1);
-CREATE PROCEDURE p1() SELECT 1;
-INSERT INTO t1 VALUES (1);
-ALTER PROCEDURE p1 SQL SECURITY INVOKER;
-INSERT INTO t1 VALUES (1);
-CREATE FUNCTION f1() RETURNS INT RETURN 123;
-INSERT INTO t1 VALUES (1);
-ALTER FUNCTION f1 SQL SECURITY INVOKER;
-INSERT INTO t1 VALUES (1);
-CREATE DATABASE mysqltest1;
-INSERT INTO t1 VALUES (1);
-DROP DATABASE mysqltest1;
-INSERT INTO t1 VALUES (1);
-CREATE USER test_1@localhost;
-INSERT INTO t1 VALUES (1);
-GRANT SELECT ON t2 TO test_1@localhost;
-INSERT INTO t1 VALUES (1);
-GRANT ALL ON f1 TO test_1@localhost;
-INSERT INTO t1 VALUES (1);
-GRANT ALL ON p1 TO test_1@localhost;
-INSERT INTO t1 VALUES (1);
-GRANT USAGE ON *.* TO test_1@localhost;
-INSERT INTO t1 VALUES (1);
-REVOKE ALL PRIVILEGES ON f1 FROM test_1@localhost;
-INSERT INTO t1 VALUES (1);
-REVOKE ALL PRIVILEGES ON p1 FROM test_1@localhost;
-INSERT INTO t1 VALUES (1);
-REVOKE ALL PRIVILEGES ON t2 FROM test_1@localhost;
-INSERT INTO t1 VALUES (1);
-REVOKE USAGE ON *.* FROM test_1@localhost;
-INSERT INTO t1 VALUES (1);
-RENAME USER test_1@localhost TO test_2@localhost;
-INSERT INTO t1 VALUES (1);
-DROP USER test_2@localhost;
-INSERT INTO t1 VALUES (1);
-CREATE PROCEDURE p2()
-BEGIN
-# CREATE USER when a temporary table is open.
-CREATE TEMPORARY TABLE t3 (a INT);
-CREATE USER test_2@localhost;
-INSERT INTO t1 VALUES (1);
-# GRANT select on table to user when a temporary table is open.
-GRANT SELECT ON t2 TO test_2@localhost;
-INSERT INTO t1 VALUES (1);
-# GRANT all on function to user when a temporary table is open.
-GRANT ALL ON f1 TO test_2@localhost;
-INSERT INTO t1 VALUES (1);
-# GRANT all on procedure to user when a temporary table is open.
-GRANT ALL ON p1 TO test_2@localhost;
-INSERT INTO t1 VALUES (1);
-# GRANT usage on *.* to user when a temporary table is open.
-GRANT USAGE ON *.* TO test_2@localhost;
-INSERT INTO t1 VALUES (1);
-# REVOKE ALL PRIVILEGES on function to user when a temporary table is open.
-REVOKE ALL PRIVILEGES ON f1 FROM test_2@localhost;
-INSERT INTO t1 VALUES (1);
-# REVOKE ALL PRIVILEGES on procedure to user when a temporary table is open.
-REVOKE ALL PRIVILEGES ON p1 FROM test_2@localhost;
-INSERT INTO t1 VALUES (1);
-# REVOKE ALL PRIVILEGES on table to user when a temporary table is open.
-REVOKE ALL PRIVILEGES ON t2 FROM test_2@localhost;
-INSERT INTO t1 VALUES (1);
-# REVOKE usage on *.* from user when a temporary table is open.
-REVOKE USAGE ON *.* FROM test_2@localhost;
-INSERT INTO t1 VALUES (1);
-# RENAME USER when a temporary table is open.
-RENAME USER test_2@localhost TO test_3@localhost;
-INSERT INTO t1 VALUES (1);
-# DROP USER when a temporary table is open.
-DROP USER test_3@localhost;
-INSERT INTO t1 VALUES (1);
-DROP TEMPORARY TABLE t3;
-END |
-DROP PROCEDURE p1;
-INSERT INTO t1 VALUES (1);
-DROP PROCEDURE p2;
-INSERT INTO t1 VALUES (1);
-DROP FUNCTION f1;
-INSERT INTO t1 VALUES (1);
-DROP TABLE t2;
-INSERT INTO t1 VALUES (1);
-DROP TEMPORARY TABLE t1;
diff --git a/mysql-test/suite/ndb/r/ndb_transaction.result b/mysql-test/suite/ndb/r/ndb_transaction.result
deleted file mode 100644
index 691b91b1d36..00000000000
--- a/mysql-test/suite/ndb/r/ndb_transaction.result
+++ /dev/null
@@ -1,257 +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
-) ENGINE=ndbcluster;
-begin;
-insert into t1 values(1,1);
-insert into t1 values(2,2);
-select count(*) from t1;
-count(*)
-2
-select * from t1 where pk1 = 1;
-pk1 attr1
-1 1
-select t1.attr1 from t1, t1 as t1x where t1.pk1 = t1x.pk1 + 1;
-attr1
-2
-rollback;
-select count(*) from t1;
-count(*)
-0
-select * from t1 where pk1 = 1;
-pk1 attr1
-select t1.attr1 from t1, t1 as t1x where t1.pk1 = t1x.pk1 + 1;
-attr1
-begin;
-insert into t1 values(1,1);
-insert into t1 values(2,2);
-commit;
-select count(*) from t1;
-count(*)
-2
-select * from t1 where pk1 = 1;
-pk1 attr1
-1 1
-select t1.attr1 from t1, t1 as t1x where t1.pk1 = t1x.pk1 + 1;
-attr1
-2
-begin;
-update t1 set attr1 = attr1 * 2;
-select count(*) from t1;
-count(*)
-2
-select * from t1 where pk1 = 1;
-pk1 attr1
-1 2
-select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
-pk1 attr1 pk1 attr1
-2 4 1 2
-rollback;
-select count(*) from t1;
-count(*)
-2
-select * from t1 where pk1 = 1;
-pk1 attr1
-1 1
-select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
-pk1 attr1 pk1 attr1
-begin;
-update t1 set attr1 = attr1 * 2;
-commit;
-select count(*) from t1;
-count(*)
-2
-select * from t1 where pk1 = 1;
-pk1 attr1
-1 2
-select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
-pk1 attr1 pk1 attr1
-2 4 1 2
-begin;
-delete from t1 where attr1 = 2;
-select count(*) from t1;
-count(*)
-1
-select * from t1 where pk1 = 1;
-pk1 attr1
-select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
-pk1 attr1 pk1 attr1
-rollback;
-select count(*) from t1;
-count(*)
-2
-select * from t1 where pk1 = 1;
-pk1 attr1
-1 2
-select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
-pk1 attr1 pk1 attr1
-2 4 1 2
-begin;
-delete from t1 where attr1 = 2;
-commit;
-select count(*) from t1;
-count(*)
-1
-select * from t1 where pk1 = 1;
-pk1 attr1
-select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
-pk1 attr1 pk1 attr1
-DROP TABLE t1;
-CREATE TABLE t1 (id INT, id2 int) engine=ndbcluster;
-begin;
-insert into t1 values(1,1);
-insert into t1 values(2,2);
-select sum(id) from t1;
-sum(id)
-3
-select * from t1 where id = 1;
-id id2
-1 1
-select t1.id from t1, t1 as t1x where t1.id2 = t1x.id2 + 1;
-id
-2
-rollback;
-select sum(id) from t1;
-sum(id)
-NULL
-select * from t1 where id = 1;
-id id2
-select t1.id from t1, t1 as t1x where t1.id2 = t1x.id2 + 1;
-id
-begin;
-insert into t1 values(1,1);
-insert into t1 values(2,2);
-commit;
-select sum(id) from t1;
-sum(id)
-3
-select * from t1 where id = 1;
-id id2
-1 1
-select t1.id from t1, t1 as t1x where t1.id2 = t1x.id2 + 1;
-id
-2
-begin;
-update t1 set id = id * 2;
-select sum(id) from t1;
-sum(id)
-6
-select * from t1 where id = 2;
-id id2
-2 1
-select * from t1, t1 as t1x where t1x.id = t1.id - 2;
-id id2 id id2
-4 2 2 1
-rollback;
-select sum(id) from t1;
-sum(id)
-3
-select * from t1 where id = 2;
-id id2
-2 2
-select * from t1, t1 as t1x where t1x.id = t1.id - 2;
-id id2 id id2
-begin;
-update t1 set id = id * 2;
-commit;
-select sum(id) from t1;
-sum(id)
-6
-select * from t1 where id = 2;
-id id2
-2 1
-select * from t1, t1 as t1x where t1x.id = t1.id - 2;
-id id2 id id2
-4 2 2 1
-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 count(*) from t2;
-count(*)
-0
-select count(*) from t3;
-count(*)
-0
-select count(*) from t4;
-count(*)
-0
-select count(*) from t2;
-count(*)
-100
-select count(*) from t3;
-count(*)
-100
-select count(*) from t4;
-count(*)
-100
-begin;
-begin;
-drop table t2;
-drop table t3;
-drop table t4;
-CREATE TABLE t1 (
-pk1 INT NOT NULL PRIMARY KEY,
-attr1 INT NOT NULL
-) ENGINE=ndbcluster;
-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;
-begin;
-insert into test.t1 values(1,1);
-insert into t2 values(1,1,1);
-insert into test.t1 values(2,2);
-insert into t2 values(2,2,2);
-select count(*) from test.t1;
-count(*)
-2
-select count(*) from t2;
-count(*)
-2
-select * from test.t1 where pk1 = 1;
-pk1 attr1
-1 1
-select * from t2 where a = 1;
-a b c
-1 1 1
-select test.t1.attr1
-from test.t1, test.t1 as t1x where test.t1.pk1 = t1x.pk1 + 1;
-attr1
-2
-select t2.a
-from t2, t2 as t2x where t2.a = t2x.a + 1;
-a
-2
-select test.t1.pk1, a from test.t1,t2 where b > test.t1.attr1;
-pk1 a
-1 2
-rollback;
-select count(*) from test.t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-drop table test.t1, t2;
-drop database mysqltest;
diff --git a/mysql-test/suite/ndb/r/ndb_trigger.result b/mysql-test/suite/ndb/r/ndb_trigger.result
deleted file mode 100644
index cc3e27df852..00000000000
--- a/mysql-test/suite/ndb/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)) 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/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/suite/ndb/r/ndb_truncate.result b/mysql-test/suite/ndb/r/ndb_truncate.result
deleted file mode 100644
index 811e5e3afeb..00000000000
--- a/mysql-test/suite/ndb/r/ndb_truncate.result
+++ /dev/null
@@ -1,23 +0,0 @@
-DROP TABLE IF EXISTS t1, t2;
-CREATE TABLE t1 (
-a bigint unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
-b int unsigned not null,
-c int unsigned
-) engine=ndbcluster;
-select count(*) from t1;
-count(*)
-5000
-select * from t1 order by a limit 2;
-a b c
-1 509 2500
-2 510 7
-truncate table t1;
-select count(*) from t1;
-count(*)
-0
-insert into t1 values(NULL,1,1),(NULL,2,2);
-select * from t1 order by a;
-a b c
-1 1 1
-2 2 2
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_types.result b/mysql-test/suite/ndb/r/ndb_types.result
deleted file mode 100644
index ec2858d818a..00000000000
--- a/mysql-test/suite/ndb/r/ndb_types.result
+++ /dev/null
@@ -1,76 +0,0 @@
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (
-auto int(5) unsigned NOT NULL auto_increment,
-string char(10) default "hello",
-vstring varchar(10) default "hello",
-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('one','two','tree') not null,
-flags set('one','two','tree') not null,
-date_field date,
-year_field year,
-time_field time,
-date_time datetime,
-time_stamp timestamp not null default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
-PRIMARY KEY (auto),
-KEY (utiny),
-KEY (tiny),
-KEY (short),
-KEY any_name (medium),
-KEY (longlong),
-KEY (real_float),
-KEY (ushort),
-KEY (umedium),
-KEY (ulong),
-KEY (ulonglong,ulong),
-KEY (options,flags)
-);
-set @now = now();
-insert into t1
-(string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
-real_float,real_double, real_decimal,utiny, ushort, umedium,ulong,ulonglong,
-bits,options,flags,date_field,year_field,time_field,date_time)
-values
-("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');
-select auto,string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
-real_float,real_double,real_decimal,utiny,ushort,umedium,ulong,ulonglong,
-bits,options,flags,date_field,year_field,time_field,date_time
-from t1;
-auto string vstring bin vbin tiny short medium long_int longlong real_float real_double real_decimal utiny ushort umedium ulong ulonglong bits options flags date_field year_field time_field date_time
-1 aaaa aaaa ªª ªª -1 -1 -1 -1 -1 1.1 1.1000 1.1000 1 00001 1 1 1  one one 1901-01-01 1901 01:01:01 1901-01-01 01:01:01
-select time_stamp>@now from t1;
-time_stamp>@now
-1
-set @now = now();
-update t1 set string="bbbb",vstring="bbbb",bin=0xBBBB,vbin=0xBBBB,
-tiny=-2,short=-2,medium=-2,long_int=-2,longlong=-2,real_float=2.2,
-real_double=2.2,real_decimal=2.2,utiny=2,ushort=2,umedium=2,ulong=2,
-ulonglong=2, bits=b'010',
-options='one',flags='one', date_field='1902-02-02',year_field='1902',
-time_field='02:02:02',date_time='1902-02-02 02:02:02' where auto=1;
-select auto,string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
-real_float,real_double,real_decimal,utiny,ushort,umedium,ulong,ulonglong,
-bits,options,flags,date_field,year_field,time_field,date_time
-from t1;
-auto string vstring bin vbin tiny short medium long_int longlong real_float real_double real_decimal utiny ushort umedium ulong ulonglong bits options flags date_field year_field time_field date_time
-1 bbbb bbbb »» »» -2 -2 -2 -2 -2 2.2 2.2000 2.2000 2 00002 2 2 2  one one 1902-02-02 1902 02:02:02 1902-02-02 02:02:02
-select time_stamp>@now from t1;
-time_stamp>@now
-1
-drop table t1;
-End of 4.1 tests
diff --git a/mysql-test/suite/ndb/r/ndb_update.result b/mysql-test/suite/ndb/r/ndb_update.result
deleted file mode 100644
index fa083587956..00000000000
--- a/mysql-test/suite/ndb/r/ndb_update.result
+++ /dev/null
@@ -1,96 +0,0 @@
-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 '2' for key 'c'
-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
-create unique index ib on t1(b);
-update t1 set c = 4 where pk1 = 12;
-update ignore t1 set b = 55 where pk1 = 14;
-select * from t1 order by pk1;
-pk1 b c
-10 0 0
-12 2 4
-14 55 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 '1-2' for key 'a'
-UPDATE t2 SET a = 1 ORDER BY a;
-ERROR 23000: Duplicate entry '1-2' for key 'a'
-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/suite/ndb/r/ndb_update_no_read.result b/mysql-test/suite/ndb/r/ndb_update_no_read.result
deleted file mode 100644
index 4373800d338..00000000000
--- a/mysql-test/suite/ndb/r/ndb_update_no_read.result
+++ /dev/null
@@ -1,75 +0,0 @@
-DROP TABLE IF EXISTS t1;
-create table t1 (a int not null primary key, b int not null, c int,
-unique index_b (b) using hash)
-engine ndb;
-insert into t1 values (1,10,1),(2,9,1),(3,8,1),(4,7,1),(5,6,1),(6,5,2),(7,4,2),(8,3,2),
-(9,2,2),(10,1,2);
-update t1 set c = 111, b = 20 where a = 1;
-select * from t1 where a = 1 order by a;
-a b c
-1 20 111
-delete from t1 where a = 1;
-select * from t1 where a = 1 order by a;
-a b c
-update t1 set c = 12, b = 19 where b = 2;
-select * from t1 where b = 2 order by a;
-a b c
-delete from t1 where b = 19;
-select * from t1 where b = 19 order by a;
-a b c
-update t1 set c = 22 where a = 10 or a >= 10;
-select * from t1 order by a;
-a b c
-2 9 1
-3 8 1
-4 7 1
-5 6 1
-6 5 2
-7 4 2
-8 3 2
-10 1 22
-update t1 set c = 23 where a in (8,10);
-select * from t1 order by a;
-a b c
-2 9 1
-3 8 1
-4 7 1
-5 6 1
-6 5 2
-7 4 2
-8 3 23
-10 1 23
-update t1 set c = 23 where a in (7,8) or a >= 10;
-select * from t1 order by a;
-a b c
-2 9 1
-3 8 1
-4 7 1
-5 6 1
-6 5 2
-7 4 23
-8 3 23
-10 1 23
-update t1 set c = 11 where a = 3 or b = 7;
-select * from t1 where a = 3 or b = 7 order by a;
-a b c
-3 8 11
-4 7 11
-update t1 set a = 13, b = 20 where a = 3;
-select * from t1 where a = 13 order by a;
-a b c
-13 20 11
-update t1 set a = 12, b = 19 where b = 7;
-select * from t1 where b = 19 order by a;
-a b c
-12 19 11
-select * from t1 where b = 7 order by a;
-a b c
-update t1 set c = 12, b = 29 where a = 5 and b = 6;
-select * from t1 where b = 19 order by a;
-a b c
-12 19 11
-delete from t1 where b = 6 and c = 12;
-select * from t1 where b = 6 order by a;
-a b c
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndb_view.result b/mysql-test/suite/ndb/r/ndb_view.result
deleted file mode 100644
index b7d1b6860c8..00000000000
--- a/mysql-test/suite/ndb/r/ndb_view.result
+++ /dev/null
@@ -1,24 +0,0 @@
-DROP TABLE IF EXISTS t1,t2,t3;
-DROP VIEW IF EXISTS v1,v2,v3;
-create table t1 (a int, b int, c int, d int) engine=ndb;
-insert into t1 values (1,2,3,4),(5,6,7,8);
-create view v1 as select t1.c as a, t1.a as b, t1.d as c, t1.a+t1.b+t1.c as d from t1;
-select * from v1 order by a,b,c;
-a b c d
-3 1 4 6
-7 5 8 18
-update v1 set a=a+100 where b=1;
-select * from v1 order by a,b,c;
-a b c d
-7 5 8 18
-103 1 4 106
-drop view v1;
-create view v1 as select t1.c as a from t1;
-insert into v1 values (200);
-select * from t1 order by a,b,c,d;
-a b c d
-NULL NULL 200 NULL
-1 2 103 4
-5 6 7 8
-drop view v1;
-drop table t1;
diff --git a/mysql-test/suite/ndb/r/ndbapi.result b/mysql-test/suite/ndb/r/ndbapi.result
deleted file mode 100644
index 8e680391a81..00000000000
--- a/mysql-test/suite/ndb/r/ndbapi.result
+++ /dev/null
@@ -1,22 +0,0 @@
-DROP TABLE IF EXISTS t0;
-drop database if exists mysqltest;
-Running ndbapi_simple
-Running ndbapi_simple_index
-Running ndbapi_scan
-Running ndbapi_retries
-Running ndbapi_async
-Running ndbapi_async1
-use TEST_DB;
-create table t0(c0 int, c1 int, c2 char(4), c3 char(4), c4 text,
-primary key(c0, c2)) engine ndb charset latin1;
-insert into t0 values (1, 2, 'a', 'b', null);
-insert into t0 values (3, 4, 'c', 'd', null);
-update t0 set c3 = 'e' where c0 = 1 and c2 = 'a';
-update t0 set c3 = 'f';
-update t0 set c3 = 'F';
-update t0 set c2 = 'g' where c0 = 1;
-update t0 set c2 = 'G' where c0 = 1;
-update t0 set c0 = 5, c2 = 'H' where c0 = 3;
-delete from t0;
-drop table t0;
-Running mgmapi_logevent
diff --git a/mysql-test/suite/ndb/r/ps_7ndb.result b/mysql-test/suite/ndb/r/ps_7ndb.result
deleted file mode 100644
index 724ae721e9a..00000000000
--- a/mysql-test/suite/ndb/r/ps_7ndb.result
+++ /dev/null
@@ -1,3122 +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 32768 4 63
-def test t9 t9 c12 c12 246 10 6 Y 32768 4 63
-def test t9 t9 c13 c13 10 10 10 Y 128 0 63
-def test t9 t9 c14 c14 12 19 19 Y 128 0 63
-def test t9 t9 c15 c15 7 19 19 N 9441 0 63
-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 outr where a+1=
- (SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
- (SELECT 1+outr.a from t1 where outr.a+1=a+1 and a=1) ';
-execute stmt1 ;
-ccc
-1
-deallocate prepare stmt1 ;
-prepare stmt1 from ' SELECT a as ccc from t1 outr where a+1=
- (SELECT 1+outr.a from t1 where outr.a+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 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 engine = MyISAM 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` longtext,
- `const08` varchar(19) NOT NULL DEFAULT '',
- `param08` longtext,
- `const09` datetime DEFAULT NULL,
- `param09` longtext,
- `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 32769 1 63
-def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
-def test t5 t5 const03 const03 5 17 1 N 32769 31 63
-def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
-def test t5 t5 const04 const04 253 3 3 N 1 0 8
-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 16 0 8
-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 16 0 8
-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 32768 30 63
-def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
-def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
-const01 8
-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 32896 30 63
-def @arg12 246 83 6 Y 32896 30 63
-def @arg13 50 16777215 10 Y 0 31 8
-def @arg14 50 16777215 19 Y 0 31 8
-def @arg15 50 16777215 19 Y 0 31 8
-def @arg16 50 16777215 8 Y 0 31 8
-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 250 16777215 1 Y 0 31 8
-def @arg21 250 16777215 10 Y 0 31 8
-def @arg22 250 16777215 30 Y 0 31 8
-def @arg23 250 16777215 8 Y 128 31 63
-def @arg24 250 16777215 8 Y 0 31 8
-def @arg25 250 16777215 4 Y 128 31 63
-def @arg26 250 16777215 4 Y 0 31 8
-def @arg27 250 16777215 10 Y 128 31 63
-def @arg28 250 16777215 10 Y 0 31 8
-def @arg29 250 16777215 8 Y 128 31 63
-def @arg30 250 16777215 8 Y 0 31 8
-def @arg31 250 16777215 3 Y 0 31 8
-def @arg32 250 16777215 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 32896 30 63
-def @arg12 246 83 0 Y 32896 30 63
-def @arg13 50 16777215 0 Y 0 31 8
-def @arg14 50 16777215 0 Y 0 31 8
-def @arg15 50 16777215 19 Y 0 31 8
-def @arg16 50 16777215 0 Y 0 31 8
-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 250 16777215 0 Y 0 31 8
-def @arg21 250 16777215 0 Y 0 31 8
-def @arg22 250 16777215 0 Y 0 31 8
-def @arg23 250 16777215 0 Y 128 31 63
-def @arg24 250 16777215 0 Y 0 31 8
-def @arg25 250 16777215 0 Y 128 31 63
-def @arg26 250 16777215 0 Y 0 31 8
-def @arg27 250 16777215 0 Y 128 31 63
-def @arg28 250 16777215 0 Y 0 31 8
-def @arg29 250 16777215 0 Y 128 31 63
-def @arg30 250 16777215 0 Y 0 31 8
-def @arg31 250 16777215 0 Y 0 31 8
-def @arg32 250 16777215 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 32896 30 63
-def @arg12 246 83 6 Y 32896 30 63
-def @arg13 50 16777215 10 Y 0 31 8
-def @arg14 50 16777215 19 Y 0 31 8
-def @arg15 50 16777215 19 Y 0 31 8
-def @arg16 50 16777215 8 Y 0 31 8
-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 250 16777215 1 Y 0 31 8
-def @arg21 250 16777215 10 Y 0 31 8
-def @arg22 250 16777215 30 Y 0 31 8
-def @arg23 250 16777215 8 Y 128 31 63
-def @arg24 250 16777215 8 Y 0 31 8
-def @arg25 250 16777215 4 Y 128 31 63
-def @arg26 250 16777215 4 Y 0 31 8
-def @arg27 250 16777215 10 Y 128 31 63
-def @arg28 250 16777215 10 Y 0 31 8
-def @arg29 250 16777215 8 Y 128 31 63
-def @arg30 250 16777215 8 Y 0 31 8
-def @arg31 250 16777215 3 Y 0 31 8
-def @arg32 250 16777215 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 32896 30 63
-def @arg12 246 83 0 Y 32896 30 63
-def @arg13 50 16777215 0 Y 0 31 8
-def @arg14 50 16777215 0 Y 0 31 8
-def @arg15 50 16777215 19 Y 0 31 8
-def @arg16 50 16777215 0 Y 0 31 8
-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 250 16777215 0 Y 0 31 8
-def @arg21 250 16777215 0 Y 0 31 8
-def @arg22 250 16777215 0 Y 0 31 8
-def @arg23 250 16777215 0 Y 128 31 63
-def @arg24 250 16777215 0 Y 0 31 8
-def @arg25 250 16777215 0 Y 128 31 63
-def @arg26 250 16777215 0 Y 0 31 8
-def @arg27 250 16777215 0 Y 128 31 63
-def @arg28 250 16777215 0 Y 0 31 8
-def @arg29 250 16777215 0 Y 128 31 63
-def @arg30 250 16777215 0 Y 0 31 8
-def @arg31 250 16777215 0 Y 0 31 8
-def @arg32 250 16777215 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 32896 30 63
-def @arg12 246 83 6 Y 32896 30 63
-def @arg13 50 16777215 10 Y 0 31 8
-def @arg14 50 16777215 19 Y 0 31 8
-def @arg15 50 16777215 19 Y 0 31 8
-def @arg16 50 16777215 8 Y 0 31 8
-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 250 16777215 1 Y 0 31 8
-def @arg21 250 16777215 10 Y 0 31 8
-def @arg22 250 16777215 30 Y 0 31 8
-def @arg23 250 16777215 8 Y 128 31 63
-def @arg24 250 16777215 8 Y 0 31 8
-def @arg25 250 16777215 4 Y 128 31 63
-def @arg26 250 16777215 4 Y 0 31 8
-def @arg27 250 16777215 10 Y 128 31 63
-def @arg28 250 16777215 10 Y 0 31 8
-def @arg29 250 16777215 8 Y 128 31 63
-def @arg30 250 16777215 8 Y 0 31 8
-def @arg31 250 16777215 3 Y 0 31 8
-def @arg32 250 16777215 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 32896 30 63
-def @arg12 246 83 0 Y 32896 30 63
-def @arg13 50 16777215 0 Y 0 31 8
-def @arg14 50 16777215 0 Y 0 31 8
-def @arg15 50 16777215 19 Y 0 31 8
-def @arg16 50 16777215 0 Y 0 31 8
-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 250 16777215 0 Y 0 31 8
-def @arg21 250 16777215 0 Y 0 31 8
-def @arg22 250 16777215 0 Y 0 31 8
-def @arg23 250 16777215 0 Y 128 31 63
-def @arg24 250 16777215 0 Y 0 31 8
-def @arg25 250 16777215 0 Y 128 31 63
-def @arg26 250 16777215 0 Y 0 31 8
-def @arg27 250 16777215 0 Y 128 31 63
-def @arg28 250 16777215 0 Y 0 31 8
-def @arg29 250 16777215 0 Y 128 31 63
-def @arg30 250 16777215 0 Y 0 31 8
-def @arg31 250 16777215 0 Y 0 31 8
-def @arg32 250 16777215 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 32896 30 63
-def @arg12 246 83 6 Y 32896 30 63
-def @arg13 50 16777215 10 Y 0 31 8
-def @arg14 50 16777215 19 Y 0 31 8
-def @arg15 50 16777215 19 Y 0 31 8
-def @arg16 50 16777215 8 Y 0 31 8
-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 250 16777215 1 Y 0 31 8
-def @arg21 250 16777215 10 Y 0 31 8
-def @arg22 250 16777215 30 Y 0 31 8
-def @arg23 250 16777215 8 Y 128 31 63
-def @arg24 250 16777215 8 Y 0 31 8
-def @arg25 250 16777215 4 Y 128 31 63
-def @arg26 250 16777215 4 Y 0 31 8
-def @arg27 250 16777215 10 Y 128 31 63
-def @arg28 250 16777215 10 Y 0 31 8
-def @arg29 250 16777215 8 Y 128 31 63
-def @arg30 250 16777215 8 Y 0 31 8
-def @arg31 250 16777215 3 Y 0 31 8
-def @arg32 250 16777215 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 @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 250 16777215 0 Y 0 31 8
-def @arg21 250 16777215 0 Y 0 31 8
-def @arg22 250 16777215 0 Y 0 31 8
-def @arg23 250 16777215 0 Y 128 31 63
-def @arg24 250 16777215 0 Y 0 31 8
-def @arg25 250 16777215 0 Y 128 31 63
-def @arg26 250 16777215 0 Y 0 31 8
-def @arg27 250 16777215 0 Y 128 31 63
-def @arg28 250 16777215 0 Y 0 31 8
-def @arg29 250 16777215 0 Y 128 31 63
-def @arg30 250 16777215 0 Y 0 31 8
-def @arg31 250 16777215 0 Y 0 31 8
-def @arg32 250 16777215 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.22337e18
-c8 9.223372036854776e18
-c9 9.223372036854776e18
-c10 9.223372036854776e18
-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.22337e18
-c8 9.223372036854776e18
-c9 9.223372036854776e18
-c10 9.223372036854776e18
-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.22337e18
-c8 -9.223372036854776e18
-c9 -9.223372036854776e18
-c10 -9.223372036854776e18
-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.22337e18
-c8 -9.223372036854776e18
-c9 -9.223372036854776e18
-c10 -9.223372036854776e18
-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.40282e38
-c8 1.111111111111111e50
-c9 1.111111111111111e50
-c10 1.111111111111111e50
-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.40282e38
-c8 1.111111111111111e50
-c9 1.111111111111111e50
-c10 1.111111111111111e50
-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.40282e38
-c8 -1.111111111111111e50
-c9 -1.111111111111111e50
-c10 -1.111111111111111e50
-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.40282e38
-c8 -1.111111111111111e50
-c9 -1.111111111111111e50
-c10 -1.111111111111111e50
-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 54 54 54 54 54 54 54
-55 6 55 55 55 55 55 55 55 55 55 55
-56 6 56 56 56 56 56 56 56 56 56 56
-57 6 57 57 57 57 57 57 57 57 57 57
-60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
-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:
-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 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:
-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 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-60 NULL NULL 1991-01-01 01:01:01 NULL NULL
-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/suite/ndb/r/strict_autoinc_5ndb.result b/mysql-test/suite/ndb/r/strict_autoinc_5ndb.result
deleted file mode 100644
index ea6e5ffc741..00000000000
--- a/mysql-test/suite/ndb/r/strict_autoinc_5ndb.result
+++ /dev/null
@@ -1,28 +0,0 @@
-drop table if exists t1;
-set @org_mode=@@sql_mode;
-create table t1
-(
-`a` tinyint(4) NOT NULL auto_increment,
-primary key (`a`)
-) engine = 'NDB' ;
-set @@sql_mode='strict_all_tables';
-insert into t1 values(1000);
-ERROR 22003: Out of range value for column 'a' at row 1
-select count(*) from t1;
-count(*)
-0
-set auto_increment_increment=1000;
-set auto_increment_offset=700;
-insert into t1 values(null);
-ERROR 22003: Out of range value for column 'a' at row 1
-select count(*) from t1;
-count(*)
-0
-set @@sql_mode=@org_mode;
-insert into t1 values(null);
-Warnings:
-Warning 1264 Out of range value for column 'a' at row 1
-select * from t1;
-a
-127
-drop table t1;
diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def
deleted file mode 100644
index c3c046e7ece..00000000000
--- a/mysql-test/suite/ndb/t/disabled.def
+++ /dev/null
@@ -1,18 +0,0 @@
-##############################################################################
-#
-# List the test cases that are to be disabled temporarily.
-#
-# Separate the test case name and the comment with ':'.
-#
-# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
-#
-# Do not use any TAB characters for whitespace.
-#
-##############################################################################
-
-ndb_binlog_discover : Bug#54851 2010-07-02 alik ndb.ndb_binlog_discover crashes the server
-ndb_partition_error2 : Bug#40989 ndb_partition_error2 needs maintenance
-
-
-# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
-ndb_alter_table3 : Bug#45621 2009-06-10 alik A few test files are disabled due to WL#4284
diff --git a/mysql-test/suite/ndb/t/loaddata_autocom_ndb.test b/mysql-test/suite/ndb/t/loaddata_autocom_ndb.test
deleted file mode 100644
index f4a6743aabe..00000000000
--- a/mysql-test/suite/ndb/t/loaddata_autocom_ndb.test
+++ /dev/null
@@ -1,4 +0,0 @@
---source include/have_ndb.inc
-let $engine_type=ndbcluster;
-
---source include/loaddata_autocom.inc
diff --git a/mysql-test/suite/ndb/t/ndb_alter_table.test b/mysql-test/suite/ndb/t/ndb_alter_table.test
deleted file mode 100644
index bf0f8a540bb..00000000000
--- a/mysql-test/suite/ndb/t/ndb_alter_table.test
+++ /dev/null
@@ -1,458 +0,0 @@
--- 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
-let $MYSQLD_DATADIR= `select @@datadir`;
---exec $NDB_TOOLS_DIR/ndb_show_tables --p > $MYSQLD_DATADIR/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 > $MYSQLD_DATADIR/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 > $MYSQLD_DATADIR/test/tmp.dat
-LOAD DATA INFILE 'tmp.dat' INTO TABLE ndb_show_tables;
---exec rm $MYSQLD_DATADIR/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
-# Check add/drop primary key (not supported on-line)
-create table t1(a int not null) engine=ndb;
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY
-insert into t1 values (1),(2),(3);
-alter table t1 add primary key (a);
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY
-update t1 set a = 17 where a = 1;
-select * from t1 order by a;
-alter table t1 drop primary key;
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY
-update t1 set a = 1 where a = 17;
-select * from t1 order by a;
-drop table t1;
-
-# bug#31233 mysql_alter_table() fails to drop UNIQUE KEY
-create table t1(a int not null) engine=ndb;
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY
-insert into t1 values (1),(2),(3);
-create unique index pk on t1(a);
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY
-update t1 set a = 17 where a = 1;
-select * from t1 order by a;
-alter table t1 drop index pk;
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY
-update t1 set a = 1 where a = 17;
-select * from t1 order by a;
-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
deleted file mode 100644
index f078ed6b479..00000000000
--- a/mysql-test/suite/ndb/t/ndb_alter_table2.test
+++ /dev/null
@@ -1,84 +0,0 @@
--- 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
deleted file mode 100644
index 86e664b23b0..00000000000
--- a/mysql-test/suite/ndb/t/ndb_alter_table3.test
+++ /dev/null
@@ -1,48 +0,0 @@
--- 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_auto_increment.test b/mysql-test/suite/ndb/t/ndb_auto_increment.test
deleted file mode 100644
index 33021331e44..00000000000
--- a/mysql-test/suite/ndb/t/ndb_auto_increment.test
+++ /dev/null
@@ -1,293 +0,0 @@
--- source include/have_multi_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-connection server1;
-DROP TABLE IF EXISTS t1,t2;
-connection server2;
-DROP TABLE IF EXISTS t1;
-connection server1;
---enable_warnings
-
-set @old_auto_increment_offset = @@session.auto_increment_offset;
-set @old_auto_increment_increment = @@session.auto_increment_increment;
-set @old_ndb_autoincrement_prefetch_sz = @@session.ndb_autoincrement_prefetch_sz;
-
-flush status;
-
-create table t1 (a int not null auto_increment primary key) engine ndb;
-
-# Step 1: Verify simple insert
-insert into t1 values (NULL);
-select * from t1 order by a;
-
-# Step 2: Verify simple update with higher than highest value causes
-# next insert to use updated_value + 1
-update t1 set a = 5 where a = 1;
-insert into t1 values (NULL);
-select * from t1 order by a;
-
-# Step 3: Verify insert that inserts higher than highest value causes
-# next insert to use inserted_value + 1
-insert into t1 values (7);
-insert into t1 values (NULL);
-select * from t1 order by a;
-
-# Step 4: Verify that insert into hole, lower than highest value doesn't
-# affect next insert
-insert into t1 values (2);
-insert into t1 values (NULL);
-select * from t1 order by a;
-
-# Step 5: Verify that update into hole, lower than highest value doesn't
-# affect next insert
-update t1 set a = 4 where a = 2;
-insert into t1 values (NULL);
-select * from t1 order by a;
-
-# Step 6: Verify that delete of highest value doesn't cause the next
-# insert to reuse this value
-delete from t1 where a = 10;
-insert into t1 values (NULL);
-select * from t1 order by a;
-
-# Step 7: Verify that REPLACE has the same effect as INSERT
-replace t1 values (NULL);
-select * from t1 order by a;
-replace t1 values (15);
-select * from t1 order by a;
-replace into t1 values (NULL);
-select * from t1 order by a;
-
-# Step 8: Verify that REPLACE has the same effect as UPDATE
-replace t1 values (15);
-select * from t1 order by a;
-
-# Step 9: Verify that IGNORE doesn't affect auto_increment
-insert ignore into t1 values (NULL);
-select * from t1 order by a;
-insert ignore into t1 values (15), (NULL);
-select * from t1 order by a;
-
-# Step 10: Verify that on duplicate key as UPDATE behaves as an
-# UPDATE
-insert into t1 values (15)
-on duplicate key update a = 20;
-insert into t1 values (NULL);
-select * from t1 order by a;
-
-# Step 11: Verify that on duplicate key as INSERT behaves as INSERT
-insert into t1 values (NULL) on duplicate key update a = 30;
-select * from t1 order by a;
-insert into t1 values (30) on duplicate key update a = 40;
-select * from t1 order by a;
-
-#Step 12: Vefify INSERT IGNORE (bug#32055)
-insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
-select * from t1 order by a;
-drop table t1;
-
-#Step 13: Verify auto_increment of unique key
-create table t1 (a int not null primary key,
- b int not null unique auto_increment) engine ndb;
-insert into t1 values (1, NULL);
-insert into t1 values (3, NULL);
-update t1 set b = 3 where a = 3;
-insert into t1 values (4, NULL);
-select * from t1 order by a;
-drop table t1;
-
-#Step 14: Verify that auto_increment_increment and auto_increment_offset
-# work as expected
-
-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;
-
-#Step 15: Now verify that behaviour on multiple MySQL Servers behave
-# properly. Start by dropping table and recreating it to start
-# counters and id caches from zero again.
---disable_warnings
-connection server2;
-SET @@session.auto_increment_offset=1;
-SET @@session.auto_increment_increment=1;
-set ndb_autoincrement_prefetch_sz = 32;
-drop table if exists t1;
-connection server1;
-SET @@session.auto_increment_offset=1;
-SET @@session.auto_increment_increment=1;
-set ndb_autoincrement_prefetch_sz = 32;
---enable_warnings
-
-
-create table t1 (a int not null auto_increment primary key) engine ndb;
-# Basic test, ensure that the second server gets a new range.
-#Generate record with key = 1
-insert into t1 values (NULL);
-connection server2;
-#Generate record with key = 33
-insert into t1 values (NULL);
-connection server1;
-select * from t1 order by a;
-
-#This insert should not affect the range of the second server
-insert into t1 values (20);
-connection server2;
-insert into t1 values (NULL);
-select * from t1 order by a;
-
-connection server1;
-#This insert should remove cached values but also skip values already
-#taken by server2, given that there is no method of communicating with
-#the other server it should also cause a conflict
-connection server1;
-
-insert into t1 values (35);
-insert into t1 values (NULL);
-connection server2;
---error ER_DUP_ENTRY, ER_DUP_KEY
-insert into t1 values (NULL);
-select * from t1 order by a;
-
-insert into t1 values (100);
-insert into t1 values (NULL);
-connection server1;
-insert into t1 values (NULL);
-select * from t1 order by a;
-
-set auto_increment_offset = @old_auto_increment_offset;
-set auto_increment_increment = @old_auto_increment_increment;
-set ndb_autoincrement_prefetch_sz = @old_ndb_autoincrement_prefetch_sz;
-
-drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_autoinc.test b/mysql-test/suite/ndb/t/ndb_autoinc.test
deleted file mode 100644
index a5ae52c88d7..00000000000
--- a/mysql-test/suite/ndb/t/ndb_autoinc.test
+++ /dev/null
@@ -1,45 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3;
---enable_warnings
-
-USE test;
-
-CREATE TABLE t1 (
- id INT AUTO_INCREMENT,
- PRIMARY KEY(id)
-) ENGINE=NDBCLUSTER;
-
-# Test For bug#30417
---error 1005
-
-CREATE TABLE t2 (
- id INT AUTO_INCREMENT,
- KEY(id)
-) ENGINE=NDBCLUSTER;
-
-SHOW TABLES;
-
-CREATE TABLE t3 (
- id INT AUTO_INCREMENT,
- KEY(id)
-) ENGINE=MYISAM;
-
---disable_result_log
---error 1005
-ALTER TABLE t3
-ENGINE NDBCLUSTER;
---enable_result_log
-
-SHOW CREATE TABLE t3;
-
-ALTER TABLE t3
-ADD PRIMARY KEY (id);
-
-SHOW CREATE TABLE t3;
-
-DROP TABLE t1, t3;
-
---echo End of 5.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_basic.test b/mysql-test/suite/ndb/t/ndb_basic.test
deleted file mode 100644
index 2fc140288ca..00000000000
--- a/mysql-test/suite/ndb/t/ndb_basic.test
+++ /dev/null
@@ -1,861 +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
-#
-
-#
-# 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;
-
-#
-# Bug#31635
-#
-create table t1 (a varchar(100) primary key, b varchar(100)) engine = NDB;
-insert into t1 values
- ('a', 'a'),('b','b'),('c', 'c'),('aa', 'aa'),('bb', 'bb'),('cc', 'cc');
-replace into t1 values ('a', '-a');
-replace into t1 values ('b', '-b');
-replace into t1 values ('c', '-c');
-
-replace into t1 values ('aa', '-aa');
-replace into t1 values ('bb', '-bb');
-replace into t1 values ('cc', '-cc');
-
-replace into t1 values ('aaa', '-aaa');
-replace into t1 values ('bbb', '-bbb');
-replace into t1 values ('ccc', '-ccc');
-select * from t1 order by 1,2;
-drop table t1;
-
---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
deleted file mode 100644
index 4d8b7a8b127..00000000000
--- a/mysql-test/suite/ndb/t/ndb_binlog_basic.test
+++ /dev/null
@@ -1,80 +0,0 @@
--- 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
deleted file mode 100644
index a70dbe2011f..00000000000
--- a/mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test
+++ /dev/null
@@ -1,190 +0,0 @@
--- 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
deleted file mode 100644
index dc8275a8a39..00000000000
--- a/mysql-test/suite/ndb/t/ndb_binlog_discover.test
+++ /dev/null
@@ -1,36 +0,0 @@
--- 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 'mysqld-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
deleted file mode 100644
index e240a33a20e..00000000000
--- a/mysql-test/suite/ndb/t/ndb_binlog_format.test
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# 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
-
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-
---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/suite/ndb/t/ndb_binlog_ignore_db-master.opt b/mysql-test/suite/ndb/t/ndb_binlog_ignore_db-master.opt
deleted file mode 100644
index e3947c0eeed..00000000000
--- a/mysql-test/suite/ndb/t/ndb_binlog_ignore_db-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog-ignore-db=mysqltest
diff --git a/mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test b/mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test
deleted file mode 100644
index 013df54a76a..00000000000
--- a/mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test
+++ /dev/null
@@ -1,16 +0,0 @@
--- 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
deleted file mode 100644
index 75ac766fd25..00000000000
--- a/mysql-test/suite/ndb/t/ndb_binlog_log_bin.test
+++ /dev/null
@@ -1,49 +0,0 @@
--- 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
deleted file mode 100644
index c39034c71f6..00000000000
--- a/mysql-test/suite/ndb/t/ndb_binlog_multi.test
+++ /dev/null
@@ -1,82 +0,0 @@
--- 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/suite/ndb/t/ndb_bitfield.test b/mysql-test/suite/ndb/t/ndb_bitfield.test
deleted file mode 100644
index de0ae23bfe6..00000000000
--- a/mysql-test/suite/ndb/t/ndb_bitfield.test
+++ /dev/null
@@ -1,124 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1 (
- pk1 int not null primary key,
- b bit(64)
-) engine=ndbcluster;
-
-show create table t1;
-insert into t1 values
-(0,b'1111111111111111111111111111111111111111111111111111111111111111'),
-(1,b'1000000000000000000000000000000000000000000000000000000000000000'),
-(2,b'0000000000000000000000000000000000000000000000000000000000000001'),
-(3,b'1010101010101010101010101010101010101010101010101010101010101010'),
-(4,b'0101010101010101010101010101010101010101010101010101010101010101');
-select hex(b) from t1 order by pk1;
-drop table t1;
-
-create table t1 (
- pk1 int not null primary key,
- b bit(9)
-) engine=ndbcluster;
-insert into t1 values
-(0,b'000000000'),
-(1,b'000000001'),
-(2,b'000000010'),
-(3,b'000000011'),
-(4,b'000000100');
-select hex(b) from t1 order by pk1;
-update t1 set b = b + b'101010101';
-select hex(b) from t1 order by pk1;
-drop table t1;
-
-create table t1 (a bit(7), b bit(9)) engine = ndbcluster;
-insert into t1 values
-(94, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),
-(75, 42), (108, 67), (79, 349), (59, 188), (68, 206), (49, 345), (118, 380),
-(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),
-(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),
-(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),
-(44, 307), (68, 454), (57, 135);
-select a+0 from t1 order by a;
-select b+0 from t1 order by b;
-drop table t1;
-
-create table t1 (
- dummyKey INTEGER NOT NULL,
- a001 TINYINT,
- a010 TINYINT,
- a012 TINYINT,
- a015 TINYINT,
- a016 TINYINT,
- a017 TINYINT,
- a019 TINYINT,
- a029 TINYINT,
- a030 TINYINT,
- a031 TINYINT,
- a032 TINYINT,
- a042 TINYINT,
- a043 TINYINT,
- a044 TINYINT,
- a3001 TINYINT,
- a3002 TINYINT,
- a3003 TINYINT,
- a3004 TINYINT,
- a3005 TINYINT,
- a3021 TINYINT,
- a3022 TINYINT,
- a BIT(6),
- b BIT(6),
- c BIT(6),
- d TINYINT,
- e TINYINT,
- f TINYINT,
- g TINYINT,
- h TINYINT,
- i TINYINT,
- j TINYINT,
- k TINYINT,
- l TINYINT,
- m TINYINT,
- n TINYINT,
- o TINYINT,
- a034 TINYINT,
-PRIMARY KEY USING HASH (dummyKey) ) engine=ndb;
-INSERT INTO `t1` VALUES
-(1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000001',b'111111',b'111110',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000010',b'000000',b'111101',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000100',b'001111',b'111011',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'001000',b'110000',b'110111',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'010000',b'100001',b'101111',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'100000',b'010010',b'011111',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'001100',b'111111',4,5,5,5,5,5,5,5,5,5,3,2,1),
-(8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
---exec $MYSQL_DUMP --hex-blob --compact --order-by-primary --skip-extended-insert --no-create-info test t1
-drop table t1;
-
---error 1005
-create table t1 (
- pk1 bit(9) not null primary key,
- b int
-) engine=ndbcluster;
-show warnings;
-
---error 1005
-create table t1 (
- pk1 int not null primary key,
- b bit(9),
- key(b)
-) engine=ndbcluster;
-show warnings;
-
-# bug#16125
-create table t1 (
- pk1 int primary key,
- b bit(32) not null
-) engine=ndbcluster;
-
-insert into t1 values (1,1);
-drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_blob.test b/mysql-test/suite/ndb/t/ndb_blob.test
deleted file mode 100644
index 0388913df8b..00000000000
--- a/mysql-test/suite/ndb/t/ndb_blob.test
+++ /dev/null
@@ -1,519 +0,0 @@
---source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1;
-drop database if exists test2;
---enable_warnings
-
-#
-# Minimal NDB blobs test.
-#
-# On NDB API level there is an extensive test program "testBlobs".
-# A prerequisite for this handler test is that "testBlobs" succeeds.
-#
-
-# -- general test starts --
-
-# make test harder with autocommit off
-set autocommit=0;
-
-create table t1 (
- a int not null primary key,
- b text not null,
- c int not null,
- d longblob,
- key (c)
-) engine=ndbcluster;
-
-# -- values --
-
-# x0 size 256 (current inline size)
-set @x0 = '01234567012345670123456701234567';
-set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
-
-# b1 length 2000+256 (blob part aligned)
-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);
-# 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);
-
-# 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);
-# d2 length 30000
-set @d2 = 'dd2';
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-
-select length(@x0),length(@b1),length(@d1) from dual;
-select length(@x0),length(@b2),length(@d2) from dual;
-
-# -- pk ops --
-
-insert into t1 values(1,@b1,111,@d1);
-insert into t1 values(2,@b2,222,@d2);
-commit;
---replace_column 9 #
-explain select * from t1 where a = 1;
-
-# pk read
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a=1;
-select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
-from t1 where a=2;
-
-# pk update
-update t1 set b=@b2,d=@d2 where a=1;
-update t1 set b=@b1,d=@d1 where a=2;
-commit;
-select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
-from t1 where a=1;
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a=2;
-
-# pk update
-update t1 set b=concat(b,b),d=concat(d,d) where a=1;
-update t1 set b=concat(b,b),d=concat(d,d) where a=2;
-commit;
-select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
-from t1 where a=1;
-select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3)
-from t1 where a=2;
-
-# pk update to null
-update t1 set d=null where a=1;
-commit;
-select a from t1 where d is null;
-
-# bug#24028 - does not occur on MySQL level
-# bug#17986 - not seen by us anymore but could show as warning here
-delete from t1 where a=45567;
-commit;
-
-# pk delete
-delete from t1 where a=1;
-delete from t1 where a=2;
-commit;
-select count(*) from t1;
-
-# -- replace ( bug-6018 ) --
-
-# insert
-replace t1 set a=1,b=@b1,c=111,d=@d1;
-replace t1 set a=2,b=@b2,c=222,d=@d2;
-commit;
---replace_column 9 #
-explain select * from t1 where a = 1;
-
-# pk read
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a=1;
-select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
-from t1 where a=2;
-
-# update
-replace t1 set a=1,b=@b2,c=111,d=@d2;
-replace t1 set a=2,b=@b1,c=222,d=@d1;
-commit;
-select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
-from t1 where a=1;
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a=2;
-
-# update
-replace t1 set a=1,b=concat(@b2,@b2),c=111,d=concat(@d2,@d2);
-replace t1 set a=2,b=concat(@b1,@b1),c=222,d=concat(@d1,@d1);
-commit;
-select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
-from t1 where a=1;
-select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3)
-from t1 where a=2;
-
-# update to null
-replace t1 set a=1,b='xyz',c=111,d=null;
-commit;
-select a,b from t1 where d is null;
-
-# pk delete
-delete from t1 where a=1;
-delete from t1 where a=2;
-commit;
-select count(*) from t1;
-
-# -- hash index ops --
-
-insert into t1 values(1,@b1,111,@d1);
-insert into t1 values(2,@b2,222,@d2);
-commit;
---replace_column 9 #
-explain select * from t1 where c = 111;
-
-# hash key read
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where c=111;
-select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
-from t1 where c=222;
-
-# hash key update
-update t1 set b=@b2,d=@d2 where c=111;
-update t1 set b=@b1,d=@d1 where c=222;
-commit;
-select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
-from t1 where c=111;
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where c=222;
-
-# hash key update to null
-update t1 set d=null where c=111;
-commit;
-select a from t1 where d is null;
-
-# hash key delete
-delete from t1 where c=111;
-delete from t1 where c=222;
-commit;
-select count(*) from t1;
-
-# -- table scan ops, short values --
-
-insert into t1 values(1,'b1',111,'dd1');
-insert into t1 values(2,'b2',222,'dd2');
-insert into t1 values(3,'b3',333,'dd3');
-insert into t1 values(4,'b4',444,'dd4');
-insert into t1 values(5,'b5',555,'dd5');
-insert into t1 values(6,'b6',666,'dd6');
-insert into t1 values(7,'b7',777,'dd7');
-insert into t1 values(8,'b8',888,'dd8');
-insert into t1 values(9,'b9',999,'dd9');
-commit;
---replace_column 9 #
-explain select * from t1;
-
-# table scan read
-select * from t1 order by a;
-
-# table scan update
-update t1 set b=concat(a,'x',b),d=concat(a,'x',d);
-commit;
-select * from t1 order by a;
-
-# table scan delete
-delete from t1;
-commit;
-select count(*) from t1;
-
-# -- table scan ops, long values --
-
-insert into t1 values(1,@b1,111,@d1);
-insert into t1 values(2,@b2,222,@d2);
-commit;
---replace_column 9 #
-explain select * from t1;
-
-# table scan read
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 order by a;
-
-# table scan update
-update t1 set b=concat(b,b),d=concat(d,d);
-commit;
-select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
-from t1 order by a;
-
-# table scan delete
-delete from t1;
-commit;
-select count(*) from t1;
-
-# -- range scan ops, short values --
-
-insert into t1 values(1,'b1',111,'dd1');
-insert into t1 values(2,'b2',222,'dd2');
-insert into t1 values(3,'b3',333,'dd3');
-insert into t1 values(4,'b4',444,'dd4');
-insert into t1 values(5,'b5',555,'dd5');
-insert into t1 values(6,'b6',666,'dd6');
-insert into t1 values(7,'b7',777,'dd7');
-insert into t1 values(8,'b8',888,'dd8');
-insert into t1 values(9,'b9',999,'dd9');
-commit;
---replace_column 9 #
-explain select * from t1 where c >= 100 order by a;
-
-# range scan read
-select * from t1 where c >= 100 order by a;
-
-# range scan update
-update t1 set b=concat(a,'x',b),d=concat(a,'x',d)
-where c >= 100;
-commit;
-select * from t1 where c >= 100 order by a;
-
-# range scan delete
-delete from t1 where c >= 100;
-commit;
-select count(*) from t1;
-
-# -- range scan ops, long values --
-
-insert into t1 values(1,@b1,111,@d1);
-insert into t1 values(2,@b2,222,@d2);
-commit;
---replace_column 9 #
-explain select * from t1 where c >= 100 order by a;
-
-# range scan read
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where c >= 100 order by a;
-
-# range scan update
-update t1 set b=concat(b,b),d=concat(d,d);
-commit;
-select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
-from t1 where c >= 100 order by a;
-
-# range scan delete
-delete from t1 where c >= 100;
-commit;
-select count(*) from t1;
-
-# -- rollback --
-
-insert into t1 values(1,@b1,111,@d1);
-insert into t1 values(2,@b2,222,@d2);
-# 626
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a = 0;
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a = 1;
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 where a = 2;
-select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
-from t1 order by a;
-rollback;
-select count(*) from t1;
-
-# -- alter table and multi db --
-
-insert into t1 values(1,'b1',111,'dd1');
-insert into t1 values(2,'b2',222,'dd2');
-insert into t1 values(3,'b3',333,'dd3');
-insert into t1 values(4,'b4',444,'dd4');
-insert into t1 values(5,'b5',555,'dd5');
-insert into t1 values(6,'b6',666,'dd6');
-insert into t1 values(7,'b7',777,'dd7');
-insert into t1 values(8,'b8',888,'dd8');
-insert into t1 values(9,'b9',999,'dd9');
-commit;
-
-select * from t1 order by a;
-alter table t1 add x int;
-select * from t1 order by a;
-alter table t1 drop x;
-select * from t1 order by a;
-
-create database test2;
-use test2;
-
-CREATE TABLE t2 (
- a bigint unsigned NOT NULL PRIMARY KEY,
- b int unsigned not null,
- c int unsigned
-) engine=ndbcluster;
-
-insert into t2 values (1,1,1),(2,2,2);
-select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a;
-
-drop table t2;
-use test;
-
-select * from t1 order by a;
-alter table t1 add x int;
-select * from t1 order by a;
-alter table t1 drop x;
-select * from t1 order by a;
-
-# -- end general test --
-
-drop table t1;
-drop database test2;
-
-# -- bug-5252 tinytext crashes + no-commit result + replace --
-
-set autocommit=0;
-create table t1 (
- a int not null primary key,
- b tinytext
-) engine=ndbcluster;
-
-insert into t1 values(1, 'x');
-update t1 set b = 'y';
-select * from t1;
-delete from t1;
-select * from t1;
-commit;
-replace t1 set a=2, b='y';
-select * from t1;
-delete from t1;
-select * from t1;
-drop table t1;
-
-# -- bug-5013 insert empty string to text --
-
-set autocommit=0;
-create table t1 (
- a int not null primary key,
- b text not null
-) engine=ndbcluster;
-
-insert into t1 values(1, '');
-select * from t1;
-commit;
-drop table t1;
-
-# -- bug #5349 --
-set autocommit=1;
-use test;
-CREATE TABLE t1 (
- a int,
- b text,
- PRIMARY KEY (a)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-
-INSERT INTO t1 VALUES
-(1,'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA');
-INSERT INTO t1 VALUES
-(2,'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB');
-
-select * from t1 order by a;
-alter table t1 engine=ndb;
-select * from t1 order by a;
-
-# -- bug #5872 --
-set autocommit=1;
-alter table t1 engine=myisam;
-select * from t1 order by a;
-drop table t1;
-
-# -- bug #7340 --
-create table t1 (
- id int(11) unsigned primary key NOT NULL auto_increment,
- msg text NOT NULL
-) engine=ndbcluster default charset=utf8;
-insert into t1 (msg) values(
-'Tries to validate (8 byte length + inline bytes) as UTF8 :(
-Fast fix: removed validation for Text. It is not yet indexable
-so bad data will not crash kernel.');
-select * from t1;
-drop table t1;
-
-# -- bug #19201
-create table t1 (
- a int primary key not null auto_increment,
- b text
-) engine=ndbcluster;
---disable_query_log
-set autocommit=1;
-# more rows than batch size (64)
-# for this bug no blob parts would be necessary
-let $1 = 500;
-while ($1)
-{
- insert into t1 (b) values (repeat('x',4000));
- dec $1;
-}
---enable_query_log
-select count(*) from t1;
-truncate t1;
-select count(*) from t1;
-drop table t1;
-
-# -- bug#19956 - var* key, complex key
-
-create table t1 (
- a varchar(40) not null,
- b mediumint not null,
- t text,
- c varchar(2) not null,
- d bigint not null,
- primary key (a,b,c),
- key (c,a),
- unique key (d)
-) engine=ndb;
-
---disable_query_log
-set @s1 = 'rggurloniukyehuxdbfkkyzlceixzrehqhvxvxbpwizzvjzpucqmzrhzxzfau';
-set @s2 = 'ykyymbzqgqlcjhlhmyqelfoaaohvtbekvifukdtnvcrrjveevfakxarxexomz';
-set @s3 = 'dbnfqyzgtqxalcrwtfsqabknvtfcbpoonxsjiqvmhnfikxxhcgoexlkoezvah';
-set @v1 = repeat(@s1,123);
-set @v2 = repeat(@s2,234);
-set @v3 = repeat(@s3,345);
-set @v4 = NULL;
---enable_query_log
-
-insert into t1 (a,b,c,d,t) values ('a',1110,'a',1,@v1);
-insert into t1 (a,b,c,d,t) values ('b',1110,'a',2,@v2);
-insert into t1 (a,b,c,d,t) values ('a',1110,'b',3,@v3);
-insert into t1 (a,b,c,d,t) values ('b',1110,'b',4,@v4);
-select a,b,c,d,sha1(t) from t1 order by c,a;
-
-select a,b,c,d,sha1(t) from t1 where a='a' and b=1110 and c='a';
-select a,b,c,d,sha1(t) from t1 where a='a' and b=1110 and c='b';
-
-update t1 set t=@v4 where a='b' and b=1110 and c='a';
-update t1 set t=@v2 where a='b' and b=1110 and c='b';
-select a,b,c,d,sha1(t) from t1 order by c,a;
-
-update t1 set t=@v2 where d=2;
-update t1 set t=@v4 where d=4;
-select a,b,c,d,sha1(t) from t1 order by c,a;
-
-update t1 set t=@v4 where a='b' and c='a';
-update t1 set t=@v2 where a='b' and c='b';
-select a,b,c,d,sha1(t) from t1 order by c,a;
-
-update t1 set t=@v2 where b+d=1112;
-update t1 set t=@v4 where b+d=1114;
-select a,b,c,d,sha1(t) from t1 order by c,a;
-
-delete from t1 where a='a' and b=1110 and c='a';
-delete from t1 where a='b' and c='a';
-delete from t1 where d=3;
-delete from t1 where b+d=1114;
-select count(*) from t1;
-
-drop table t1;
-
-# End of 4.1 tests
-
-
-# bug # 30674 :
-# NOT NULL Blobs should default to zero-length. Not NULL TEXT
-# should default to zero-chars
-create table t1(
- a int,
- blob_nn blob not null,
- text_nn text not null,
- blob_nl blob,
- text_nl text,
- primary key(a)
-) engine=ndb;
-
-insert into t1(a) values (1);
-insert into t1(a, text_nl) values (2, 'MySQL Cluster NDB');
-
-select a, length(blob_nn), length(text_nn), blob_nl, text_nl from t1 order by a;
-
-drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_blob_partition.test b/mysql-test/suite/ndb/t/ndb_blob_partition.test
deleted file mode 100644
index 35df57b96ba..00000000000
--- a/mysql-test/suite/ndb/t/ndb_blob_partition.test
+++ /dev/null
@@ -1,97 +0,0 @@
---source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_query_log
-set new=on;
---enable_query_log
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# Minimal NDB blobs test with range partitions.
-#
-
-create table t1 (
- a mediumint not null,
- b text not null,
- c int not null,
- d longblob,
- primary key using hash (a,c),
- unique key (c)
-)
- engine=ndb
- partition by range (c)
- partitions 3
- ( partition p1 values less than (200),
- partition p2 values less than (300),
- partition p3 values less than (400));
-
---disable_query_log
-sleep 1;
-
-# length 61
-set @s0 = 'rggurloniukyehuxdbfkkyzlceixzrehqhvxvxbpwizzvjzpucqmzrhzxzfau';
-set @s1 = 'ykyymbzqgqlcjhlhmyqelfoaaohvtbekvifukdtnvcrrjveevfakxarxexomz';
-set @s2 = 'dbnfqyzgtqxalcrwtfsqabknvtfcbpoonxsjiqvmhnfikxxhcgoexlkoezvah';
-
-set @v1 = repeat(@s0, 100); # 1d42dd9090cf78314a06665d4ea938c35cc760f4
-set @v2 = repeat(@s1, 200); # 10d3c783026b310218d10b7188da96a2401648c6
-set @v3 = repeat(@s2, 300); # a33549d9844092289a58ac348dd59f09fc28406a
-set @v4 = repeat(@s0, 400); # daa61c6de36a0526f0d47dc29d6b9de7e6d2630c
-set @v5 = repeat(@s1, 500); # 70fc9a7d08beebc522258bfb02000a30c77a8f1d
-set @v6 = repeat(@s2, 600); # 090565c580809efed3d369481a4bbb168b20713e
-set @v7 = repeat(@s0, 700); # 1e0070bec426871a46291de27b9bd6e4255ab4e5
-set @v8 = repeat(@s1, 800); # acbaba01bc2e682f015f40e79d9cbe475db3002e
-set @v9 = repeat(@s2, 900); # 9ee30d99162574f79c66ae95cdf132dcf9cbc259
---enable_query_log
-
-# -- insert --
-insert into t1 values (1, @v1, 101, @v2);
-insert into t1 values (1, @v2, 102, @v3);
-insert into t1 values (1, @v3, 103, @v4);
-insert into t1 values (2, @v4, 201, @v5);
-insert into t1 values (2, @v5, 202, @v6);
-insert into t1 values (2, @v6, 203, @v7);
-insert into t1 values (3, @v7, 301, @v8);
-insert into t1 values (3, @v8, 302, @v9);
-insert into t1 values (3, @v9, 303, @v1);
-select a, sha1(b), c, sha1(d) from t1 order by a;
-
-# -- pk read --
-select a, sha1(b), c, sha1(d) from t1 where a = 1 and c = 101;
-select a, sha1(b), c, sha1(d) from t1 where a = 2 and c = 201;
-select a, sha1(b), c, sha1(d) from t1 where a = 3 and c = 301;
-
-# -- pk update --
-update t1 set b = @v3, d = @v4 where a = 1 and c = 102;
-update t1 set b = @v6, d = @v7 where a = 2 and c = 202;
-update t1 set b = @v9, d = @v1 where a = 3 and c = 302;
-select a, sha1(b), c, sha1(d) from t1 order by a;
-
-# -- hash index update --
-update t1 set b = @v4, d = @v5 where c = 103;
-update t1 set b = @v7, d = @v8 where c = 203;
-update t1 set b = @v1, d = @v2 where c = 303;
-select a, sha1(b), c, sha1(d) from t1 order by a;
-
-# -- full scan update --
-update t1 set b = @v5, d = @v6;
-select a, sha1(b), c, sha1(d) from t1 order by a;
-
-# -- range scan update
-update t1 set b = @v1, d = @v2 where 100 < c and c < 200;
-update t1 set b = @v4, d = @v5 where 200 < c and c < 300;
-update t1 set b = @v7, d = @v8 where 300 < c and c < 400;
-select a, sha1(b), c, sha1(d) from t1 order by a;
-
-# -- delete --
-delete from t1 where a = 1 and c = 101;
-delete from t1 where c = 102;
-# delete from t1 where c < 300; # XXX coredump
-delete from t1;
-select a, sha1(b), c, sha1(d) from t1 order by a;
-
-# -- clean up --
-drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_bug26793.test b/mysql-test/suite/ndb/t/ndb_bug26793.test
deleted file mode 100644
index f35d8808c1a..00000000000
--- a/mysql-test/suite/ndb/t/ndb_bug26793.test
+++ /dev/null
@@ -1,35 +0,0 @@
--- 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/suite/ndb/t/ndb_bug31477.test b/mysql-test/suite/ndb/t/ndb_bug31477.test
deleted file mode 100644
index 41c519e56fd..00000000000
--- a/mysql-test/suite/ndb/t/ndb_bug31477.test
+++ /dev/null
@@ -1,109 +0,0 @@
---source include/have_ndb.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-# setup
-
-connect (con1,localhost,root,,test);
-connect (con2,localhost,root,,test);
-
-# unique index
-connection con1;
-create table t1(a int primary key, b int, c int, unique(b)) engine = ndb;
-insert into t1 values (2,2,2);
-insert into t1 values (3,3,3);
-insert into t1 values (4,4,4);
-
-begin;
-insert into t1 values (1,1,1);
-
-connection con2;
-begin;
---error 1205
-update t1 set c = 2 where b = 1;
-rollback;
-
-connection con1;
-rollback;
-drop table t1;
-# ordered index
-
-connection con1;
-create table t1(a int primary key, b int, c int, key(b)) engine = ndb;
-insert into t1 values (2,2,2);
-insert into t1 values (3,3,3);
-insert into t1 values (4,4,4);
-
-begin;
-insert into t1 values (1,1,1);
-
-connection con2;
-begin;
---error 1205
-update t1 set c = 2 where b = 1;
-rollback;
-
-connection con1;
-rollback;
-drop table t1;
-
-# multiple versions
-
---echo --con1
-connection con1;
-create table t1(a int primary key, b int, c int, key(b)) engine = ndb;
-insert into t1 values (1,1,1);
-insert into t1 values (2,2,2);
-insert into t1 values (3,3,3);
-insert into t1 values (4,4,4);
-
-begin;
-update t1 set c = 10 where a = 1;
-update t1 set c = 20 where a = 1;
-update t1 set c = 30 where a = 1;
-
---echo --con1 c=30
-select * from t1 where b >= 1 order by b;
---echo --con2 c=1
-connection con2;
-select * from t1 where b >= 1 order by b;
-
---echo --con1
-connection con1;
-delete from t1 where a = 1;
-
---echo --con1 c=none
-select * from t1 where b >= 1 order by b;
---echo --con2 c=1
-connection con2;
-select * from t1 where b >= 1 order by b;
-
---echo --con1
-connection con1;
-commit;
-
---echo --con1 c=none
-select * from t1 where b >= 1 order by b;
---echo --con2 c=none
-connection con2;
-select * from t1 where b >= 1 order by b;
-
---echo --con1
-connection con1;
-begin;
-insert into t1 values (1,1,1);
-update t1 set c = 10 where a = 1;
-update t1 set c = 20 where a = 1;
-update t1 set c = 30 where a = 1;
-
---echo --con1 c=30
-select * from t1 where b >= 1 order by b;
---echo --con2 c=none
-connection con2;
-select * from t1 where b >= 1 order by b;
-
-# this fails with "no such table" via con2 ???
-connection con1;
-drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_cache.test b/mysql-test/suite/ndb/t/ndb_cache.test
deleted file mode 100644
index 9c299b61c24..00000000000
--- a/mysql-test/suite/ndb/t/ndb_cache.test
+++ /dev/null
@@ -1,122 +0,0 @@
--- source include/have_query_cache.inc
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-# Turn on and reset query cache
-set GLOBAL query_cache_type=on;
-set GLOBAL query_cache_size=1355776;
-reset query cache;
-flush status;
-
-# Create test table in NDB
-CREATE TABLE t1 ( pk int not null primary key,
- a int, b int not null, c varchar(20)) ENGINE=ndbcluster;
-insert into t1 value (1, 2, 3, 'First row');
-
-# Perform one query which should be inerted in query cache
-select * from t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-# Perform the same query and make sure the query cache is hit
-select * from t1;
-show status like "Qcache_hits";
-
-# Update the table and make sure the correct data is returned
-update t1 set a=3 where pk=1;
-select * from t1;
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-# Insert a new record and make sure the correct data is returned
-insert into t1 value (2, 7, 8, 'Second row');
-insert into t1 value (4, 5, 6, 'Fourth row');
-select * from t1 order by pk;
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from t1 order by pk;
-show status like "Qcache_hits";
-
-# Perform a "new" query and make sure the query cache is not hit
-select * from t1 where b=3;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-
-# Same query again...
-select * from t1 where b=3;
-show status like "Qcache_hits";
-
-# Delete from the table
-delete from t1 where c='Fourth row';
-show status like "Qcache_queries_in_cache";
-select * from t1 where b=3;
-show status like "Qcache_hits";
-
-# Start another connection and check that the query cache is hit
-connect (con1,localhost,root,,);
-connection con1;
-use test;
-select * from t1 order by pk;
-select * from t1 where b=3;
-show status like "Qcache_hits";
-
-# Update the table and switch to other connection
-update t1 set a=4 where b=3;
-connect (con2,localhost,root,,);
-connection con2;
-use test;
-show status like "Qcache_queries_in_cache";
-select * from t1 order by pk desc;
-select * from t1 order by pk desc;
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con1;
-select * from t1 order by pk desc;
-select * from t1 order by pk desc;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-# Use transactions and make sure the query cache is not updated until
-# transaction is commited
-begin;
-update t1 set a=5 where pk=1;
-# Note!! the below test shows that table is invalidated
-# before transaction is committed
-# TODO Fix so that cache is not invalidated HERE!
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con2;
-select * from t1 order by pk desc;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con1;
-commit;
-# TODO Here query is invalidated once again, commit count in NDB has changed
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con2;
-select * from t1 order by pk desc;
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con1;
-select * from t1 order by pk desc;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-drop table t1;
-
-show status like "Qcache_queries_in_cache";
-
-SET GLOBAL query_cache_size=0;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_cache2.test b/mysql-test/suite/ndb/t/ndb_cache2.test
deleted file mode 100644
index 352b01ef73f..00000000000
--- a/mysql-test/suite/ndb/t/ndb_cache2.test
+++ /dev/null
@@ -1,361 +0,0 @@
--- source include/have_query_cache.inc
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1, t2, t3, t4, t5;
---enable_warnings
-
-
-# Turn on and reset query cache
-set GLOBAL query_cache_type=on;
-set GLOBAL query_cache_size=1355776;
-# Turn on thread that will fetch commit count for open tables
-set GLOBAL ndb_cache_check_time=100;
-reset query cache;
-flush status;
-
-# Create test tables in NDB
-CREATE TABLE t1 (
- pk int not null primary key,
- a1 int,
- b1 int not null,
- c1 varchar(20)
-) ENGINE=ndb;
-CREATE TABLE t2 (
- pk int not null primary key,
- a2 int,
- b2 int not null
-) ENGINE=ndb;
-CREATE TABLE t3 (
- pk int not null primary key,
- a3 int,
- b3 int not null,
- c3 int not null,
- d3 varchar(20)
-) ENGINE=ndb;
-CREATE TABLE t4 (
- a4 int,
- b4 int not null,
- c4 char(20)
-) ENGINE=ndbcluster;
-CREATE TABLE t5 (
- pk int not null primary key,
- a5 int,
- b5 int not null,
- c5 varchar(255)
-) ENGINE=ndbcluster;
-insert into t1 value (1, 2, 3, 'First row');
-insert into t2 value (1, 2, 3);
-insert into t3 value (1, 2, 3, 4, '3 - First row');
-insert into t4 value (2, 3, '4 - First row');
-insert into t5 value (1, 2, 3, '5 - First row');
-
-# Perform one query which should be inserted in query cache
-select * from t1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-# Perform the same query and make sure the query cache is hit
-select * from t1;
-show status like "Qcache_hits";
-
-# Update the table and make sure the correct data is returned
-update t1 set a1=3 where pk=1;
-select * from t1;
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-# Insert a new record and make sure the correct data is returned
-insert into t1 value (2, 7, 8, 'Second row');
-insert into t1 value (4, 5, 6, 'Fourth row');
-select * from t1 order by pk desc;
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from t1 order by pk desc;
-show status like "Qcache_hits";
-
-# Perform a "new" query and make sure the query cache is not hit
-select * from t1 where b1=3;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_hits";
-
-# Same query again...
-select * from t1 where b1=3;
-show status like "Qcache_hits";
-
-# Delete from the table
-delete from t1 where c1='Fourth row';
-show status like "Qcache_queries_in_cache";
-select * from t1 where b1=3;
-show status like "Qcache_hits";
-
-# Start another connection and check that the query cache is hit
-connect (con1,localhost,root,,);
-connection con1;
-use test;
-select * from t1 order by pk desc;
-select * from t1 where b1=3;
-show status like "Qcache_hits";
-
-# Update the table and switch to other connection
-update t1 set a1=4 where b1=3;
-connect (con2,localhost,root,,);
-connection con2;
-use test;
-show status like "Qcache_queries_in_cache";
-select * from t1 order by pk desc;
-select * from t1 order by pk desc;
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con1;
-select * from t1 order by pk desc;
-select * from t1 order by pk desc;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-# Load all tables into cache
-select * from t2;
-select * from t3;
-select * from t4;
-select * from t5;
-show status like "Qcache_queries_in_cache";
-
-#####################################################################
-# Start transaction and perform update
-# Switch to other transaction and check that update does not show up
-# Switch back and commit transaction
-# Switch to other transaction and check that update shows up
-#####################################################################
-connection con1;
-flush status;
-begin;
-update t1 set a1=5 where pk=1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con2;
-select * from t1 order by pk desc;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con1;
-commit;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con2;
-select * from t1 order by pk desc;
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con1;
-select * from t1 order by pk desc;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-#####################################################################
-# Start transaction and perform update
-# Switch to other transaction and check that update does not show up
-# Switch back, perform selects and commit transaction
-# Switch to other transaction and check that update shows up
-#####################################################################
-connection con1;
-flush status;
-begin;
-update t1 set a1=6 where pk=1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con2;
-select * from t1 order by pk desc;
-select * from t1 order by pk desc;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con1;
-# The two queries below will not hit cache since transaction is ongoing
-select * from t1 order by pk desc;
-select * from t1 order by pk desc;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-commit;
-
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con2;
-select * from t1 order by pk desc;
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con1;
-select * from t1 order by pk desc;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-#####################################################################
-# Start transaction and perform insert
-# Switch to other transaction and check that insert does not show up
-# Switch back, perform selects and commit transaction
-# Switch to other transaction and check that update shows up
-#####################################################################
-connection con1;
-flush status;
-begin;
-insert into t1 set pk=5, a1=6, b1=3, c1="New row";
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con2;
-select * from t1 where pk=5;
-select * from t1 order by pk desc;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con1;
-# The below four queries will not be cached, trans is ongoing
-select * from t1 where pk=5;
-select * from t1 where pk=5;
-select * from t1 order by pk desc;
-select * from t1 order by pk desc;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-commit;
-
-connection con2;
-select * from t1 order by pk desc;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-connection con1;
-
-#####################################################################
-# Start transaction and perform delete
-# Switch to other transaction and check that delete does not show up
-# Switch back, perform selects and commit transaction
-# Switch to other transaction and check that update shows up
-#####################################################################
-connection con1;
-flush status;
-begin;
-delete from t1 where pk=2;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con2;
-select * from t1 where pk=2;
-select * from t1 order by pk desc;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con1;
-# The below four queries will not be cached, trans is ongoing
-select * from t1 where pk=2;
-select * from t1 order by pk desc;
-select * from t1 order by pk desc;
-select * from t1 where pk=2;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-commit;
-
-connection con2;
-select * from t1 order by pk desc;
-select * from t1 where pk=2;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-connection con1;
-
-#####################################################################
-# Start a transaction which updates all tables
-# Switch to other transaction and check updates does not show up
-# Switch back, perform selects and commit transaction
-# Switch to other transaction and check that update shows up
-#####################################################################
-flush status;
-begin;
-update t1 set a1=9 where pk=1;
-update t2 set a2=9 where pk=1;
-update t3 set a3=9 where pk=1;
-update t4 set a4=9 where a4=2;
-update t5 set a5=9 where pk=1;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con2;
-select * from t1 order by pk desc;
-select * from t2;
-select * from t3;
-select * from t4;
-select * from t5;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-connection con1;
-# The below five queries will not be cached, trans is ongoing
-select * from t1 order by pk desc;
-select * from t1 order by pk desc;
-select * from t2;
-select * from t3;
-select * from t4;
-select * from t5;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-commit;
-
-connection con2;
-select * from t1 order by pk desc;
-select * from t2;
-select * from t3;
-select * from t4;
-select * from t5;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-connection con1;
-select * from t1 order by pk desc;
-select * from t2;
-select * from t3;
-select * from t4;
-select * from t5;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-select * from t1 order by pk desc;
-select * from t2;
-select * from t3;
-select * from t4;
-select * from t5;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-connection con2;
-select * from t1 order by pk desc;
-select * from t2;
-select * from t3;
-select * from t4;
-select * from t5;
-show status like "Qcache_queries_in_cache";
-show status like "Qcache_inserts";
-show status like "Qcache_hits";
-
-drop table t1, t2, t3, t4, t5;
-
-# There should be no queries in cache, when tables have been dropped
-show status like "Qcache_queries_in_cache";
-
-SET GLOBAL query_cache_size=0;
-SET GLOBAL ndb_cache_check_time=0;
-
-
diff --git a/mysql-test/suite/ndb/t/ndb_cache_multi.test b/mysql-test/suite/ndb/t/ndb_cache_multi.test
deleted file mode 100644
index 8c7f186b866..00000000000
--- a/mysql-test/suite/ndb/t/ndb_cache_multi.test
+++ /dev/null
@@ -1,71 +0,0 @@
--- 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
deleted file mode 100644
index 853e4090193..00000000000
--- a/mysql-test/suite/ndb/t/ndb_cache_multi2.test
+++ /dev/null
@@ -1,125 +0,0 @@
--- 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
deleted file mode 100644
index 2d9f66564bc..00000000000
--- a/mysql-test/suite/ndb/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
-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/suite/ndb/t/ndb_condition_pushdown.test b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test
deleted file mode 100644
index a6ab06eae31..00000000000
--- a/mysql-test/suite/ndb/t/ndb_condition_pushdown.test
+++ /dev/null
@@ -1,2054 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3,t4;
---enable_warnings
-
-#
-# Test of condition pushdown to storage engine
-#
-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_optimizer_switch = @@session.optimizer_switch;
-set optimizer_switch = "engine_condition_pushdown=off";
-
-# Test all types and compare operators
-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;
-
-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;
-
-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;
-
-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;
-
-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;
-
-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;
-
-# Test LIKE/NOT LIKE
-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;
-
-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;
-
-# BETWEEN
-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;
-
-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;
-
-# NOT BETWEEN
-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;
-
-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;
-
-# IN
-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;
-
-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;
-
-# NOT IN
-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;
-
-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;
-
-# Various tests
-select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
-select * from t2 where attr3 is not null and attr1 > 2 order by pk1;
-select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;
-select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
-select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
-select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
-
-set optimizer_switch = "engine_condition_pushdown=on";
-
-# Test all types and compare operators
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
-# Test index scan with filter
-create index medium_index on t1(medium);
-
-# Test all types and compare operators
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
-# Test LIKE/NOT LIKE
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
-# BETWEEN
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
-# NOT BETWEEN
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
-# IN
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
-# NOT IN
---replace_column 9 #
-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;
-
-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;
-
---replace_column 9 #
-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;
-
-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;
-
-# Update test
-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 test
-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;
-
-# Various tests
---replace_column 9 #
-explain
-select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
-select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
-
---replace_column 9 #
-explain
-select * from t2 where attr3 is not null and attr1 > 2 order by pk1;
-select * from t2 where attr3 is not null and attr1 > 2 order by pk1;
-
---replace_column 9 #
-explain
-select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;
-select * from t3 where attr2 > 9223372036854775803 and attr3 != 3 order by pk1;
-
---replace_column 9 #
-explain
-select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
-select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 order by t2.pk1;
-
---replace_column 9 #
-explain
-select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
-select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1;
-
---replace_column 9 #
-explain
-select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
-select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1;
-
-# Some tests that are currently not supported and should not push condition
---replace_column 9 #
-explain
-select auto from t1 where string = "aaaa" collate latin1_general_ci order by auto;
---replace_column 9 #
-explain
-select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1;
---replace_column 9 #
-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;
-
-# bug#15722
-create table t5 (a int primary key auto_increment, b tinytext not null)
-engine = ndb;
-insert into t5 (b) values ('jonas'), ('jensing'), ('johan');
-set optimizer_switch = "engine_condition_pushdown=off";
-select * from t5 where b like '%jo%' order by a;
-set optimizer_switch = "engine_condition_pushdown=on";
---replace_column 9 #
-explain select * from t5 where b like '%jo%';
-select * from t5 where b like '%jo%' order by a;
-
-# bug#21056 ndb pushdown equal/setValue error on datetime
-set optimizer_switch = "engine_condition_pushdown=off";
-select auto from t1 where date_time like '1902-02-02 %' order by auto;
-select auto from t1 where date_time not like '1902-02-02 %' order by auto;
-set optimizer_switch = "engine_condition_pushdown=on";
---replace_column 9 #
-explain select auto from t1 where date_time like '1902-02-02 %';
-select auto from t1 where date_time like '1902-02-02 %' order by auto;
---replace_column 9 #
-explain select auto from t1 where date_time not like '1902-02-02 %';
-select auto from t1 where date_time not like '1902-02-02 %' order by auto;
-
-# bug#17421 -1
-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');
-# in TUP the constants 'ab' 'abc' were expected in varchar format
-# "like" returned error which became "false"
-# scan filter negates "or" which exposes the bug
-set optimizer_switch = "engine_condition_pushdown=off";
-select * from t1 where b like 'ab';
-select * from t1 where b like 'ab' or b like 'ab';
-select * from t1 where b like 'abc';
-select * from t1 where b like 'abc' or b like 'abc';
-set optimizer_switch = "engine_condition_pushdown=on";
-select * from t1 where b like 'ab';
-select * from t1 where b like 'ab' or b like 'ab';
-select * from t1 where b like 'abc';
-select * from t1 where b like 'abc' or b like 'abc';
-
-# bug#17421 -2
-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');
-# test that incorrect MySQL behaviour is preserved
-# 'ab ' LIKE 'ab' is true in MySQL
-set optimizer_switch = "engine_condition_pushdown=off";
-select * from t1 where b like 'ab';
-select * from t1 where b like 'ab' or b like 'ab';
-select * from t1 where b like 'abc';
-select * from t1 where b like 'abc' or b like 'abc';
-set optimizer_switch = "engine_condition_pushdown=on";
-select * from t1 where b like 'ab';
-select * from t1 where b like 'ab' or b like 'ab';
-select * from t1 where b like 'abc';
-select * from t1 where b like 'abc' or b like 'abc';
-
-# bug#20406 (maybe same as bug#17421 -1, not seen on 32-bit x86)
-drop table t1;
-create table t1 ( fname varchar(255), lname varchar(255) )
-engine=ndbcluster;
-insert into t1 values ("Young","Foo");
-
-set optimizer_switch = "engine_condition_pushdown=off";
-SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
-set optimizer_switch = "engine_condition_pushdown=on";
-SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
-
-# make sure optimizer does not do some crazy shortcut
-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 optimizer_switch = "engine_condition_pushdown=off";
-SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
-set optimizer_switch = "engine_condition_pushdown=on";
-SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
-
-# bug#29390 (scan filter is too large, discarded)
-# bug#34107 (previous limit was too large for TUP)
-
-drop table t1;
-
-create table t1 (a int, b int, c int, d int, primary key using hash(a))
- engine=ndbcluster;
-
-insert into t1 values (10,1,100,0+0x1111);
-insert into t1 values (20,2,200,0+0x2222);
-insert into t1 values (30,3,300,0+0x3333);
-insert into t1 values (40,4,400,0+0x4444);
-insert into t1 values (50,5,500,0+0x5555);
-
-set optimizer_switch = "engine_condition_pushdown=on";
-
-select a,b,d from t1
- where b in (0,1,2,5)
- order by b;
-
---echo -- big filter just below limit
---disable_query_log
-select a,b,d from t1
- where b in (
-0,1,2,5,0,1,2,5,0,1,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2)
- order by b;
---enable_query_log
-
---echo -- big filter just above limit
---disable_query_log
-select a,b,d from t1
- where b in (
-0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,
-0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2)
- order by b;
---enable_query_log
-
-set optimizer_switch = @old_optimizer_switch;
-DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/suite/ndb/t/ndb_config.test b/mysql-test/suite/ndb/t/ndb_config.test
deleted file mode 100644
index 08d1226953c..00000000000
--- a/mysql-test/suite/ndb/t/ndb_config.test
+++ /dev/null
@@ -1,23 +0,0 @@
--- source include/have_ndb.inc
--- source include/ndb_default_cluster.inc
--- source include/not_embedded.inc
-
---exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host 2> /dev/null
---exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null
---exec $NDB_TOOLS_DIR/ndb_config --no-defaults -r \\\n -f " " --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null
---exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --type=ndbd --host=localhost 2> /dev/null
---exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host --config-file=$MYSQL_TEST_DIR/std_data/ndb_config_config.ini 2> /dev/null
-
-# End of 4.1 tests
-
---exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.jonas --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf1.cnf --query=type,nodeid,host,IndexMemory,DataMemory --mycnf 2> /dev/null
-
---exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster0 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null
---exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster1 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null
---exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null
---exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --ndb-shm --connections --query=type,nodeid1,nodeid2,group,nodeidserver --mycnf 2> /dev/null
-
-
---exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --host=localhost --config-file=$MYSQL_TEST_DIR/std_data/ndb_config_config.ini 2> /dev/null
---exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --host=1.2.3.4 --config-file=$MYSQL_TEST_DIR/std_data/ndb_config_config.ini 2> /dev/null
---exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --host=127.0.0.1 --config-file=$MYSQL_TEST_DIR/std_data/ndb_config_config.ini 2> /dev/null
diff --git a/mysql-test/suite/ndb/t/ndb_config2.test b/mysql-test/suite/ndb/t/ndb_config2.test
deleted file mode 100644
index 170f1b2e5e7..00000000000
--- a/mysql-test/suite/ndb/t/ndb_config2.test
+++ /dev/null
@@ -1,7 +0,0 @@
--- source include/have_ndb.inc
--- source include/ndb_default_cluster.inc
--- source include/not_embedded.inc
-
-# Following doesn't work in all configurations (if shm is not defined)
-
---exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --ndb-shm --connections --query=type,nodeid1,nodeid2,group,nodeidserver --mycnf 2> /dev/null
diff --git a/mysql-test/suite/ndb/t/ndb_cursor.test b/mysql-test/suite/ndb/t/ndb_cursor.test
deleted file mode 100644
index 406f8629cfe..00000000000
--- a/mysql-test/suite/ndb/t/ndb_cursor.test
+++ /dev/null
@@ -1,47 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1;
-drop table if exists t2;
---enable_warnings
-
-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), (4, 40);
-
-delimiter //;
-create procedure test_cursor ()
-begin
- declare done int default 0;
- declare temp_a int;
- declare temp_b int;
- declare cur1 cursor for select a,b from t1;
- declare continue handler for sqlstate '02000' set done = 1;
- open cur1;
- repeat
- fetch cur1 into temp_a, temp_b;
- if not done then
- insert into t2 values (temp_a, temp_b);
- end if;
- until done end repeat;
- close cur1;
-end;
-//
-delimiter ;//
-
-select * from t2 order by a;
-call test_cursor();
-select * from t2 order by a;
-drop procedure test_cursor;
-drop table t1,t2;
-
---echo end of 5.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_database.test b/mysql-test/suite/ndb/t/ndb_database.test
deleted file mode 100644
index 8bfdf40de88..00000000000
--- a/mysql-test/suite/ndb/t/ndb_database.test
+++ /dev/null
@@ -1,24 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop database if exists mysqltest;
---enable_warnings
-
-#
-# Check that all tables in a database are dropped when database is dropped
-#
-
-create database mysqltest;
-create table mysqltest.t1 (a int primary key, b int) engine=ndb;
-use mysqltest;
-show tables;
-
-drop database mysqltest;
-create database mysqltest;
-use mysqltest;
-show tables;
-
-drop database mysqltest;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_dd_alter.test b/mysql-test/suite/ndb/t/ndb_dd_alter.test
deleted file mode 100644
index 7635a8944da..00000000000
--- a/mysql-test/suite/ndb/t/ndb_dd_alter.test
+++ /dev/null
@@ -1,274 +0,0 @@
-##############################################################
-# Author: JBM
-# Date: 2006-01-12
-# Purpose: To test using ndb memory and disk tables together.
-##############################################################
-
-##############################################################
-# Author: Nikolay
-# Date: 2006-05-12
-# Purpose: To test using ndb memory and disk tables together.
-#
-# Select from disk into memory table
-# Select from disk into memory table
-# Create test that loads data, use mysql dump to dump data, drop table,
-# create table and load from mysql dump.
-# Use group by asc and dec; Use having; Use order by
-# ALTER Tests (Meta data testing):
-# ALTER from InnoDB to Cluster Disk Data
-# ALTER from MyISAM to Cluster Disk Data
-# ALTER from Cluster Disk Data to InnoDB
-# ALTER from Cluster Disk Data to MyISAM
-# ALTER DD Tables and add columns
-# ALTER DD Tables and add Indexes
-# ALTER DD Tables and drop columns
-#
-##############################################################
-# Author: Jonathan
-# Date 2006-08-28
-# Purpose: To take out some of the test that are already
-# Covered by other tests. Per Jonas
-# The new purpose of this test is testing "Alter"
-# Statements. Therefore the name is changed to
-# ndb_dd_alter.test
-# Removed tests include:
-# Select from disk into memory table
-# Select from disk into memory table
-# Create test that loads data, use mysql dump to dump data, drop table,
-# create table and load from mysql dump.
-# Use group by asc and dec; Use having; Use order by
-##############################################################
-
--- source include/have_ndb.inc
--- source include/have_innodb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
---enable_warnings
-
-############ Test Setup Section #############
--- echo **** Test Setup Section ****
-################## ALTER Tests (Meta data testing) ####################
-
- 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;
-
-#### Try to ALTER from InnoDB to Cluster Disk Data
-
-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;
-
-let $1=20;
-disable_query_log;
-while ($1)
-{
- eval insert into test.t1 values($1, $1+1, $1+2000000000, "aaa$1", 34.2, '4:3:2', '2006-1-1', '1971-5-28 16:55:03', "bbbbbbbbbbbbb$1", "binary data");
- dec $1;
-}
-enable_query_log;
-
-SHOW CREATE TABLE test.t1;
-SELECT * FROM test.t1 ORDER BY a1;
-ALTER TABLE test.t1 TABLESPACE ts STORAGE DISK ENGINE=NDB;
-SHOW CREATE TABLE test.t1;
-# Check column storage
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep 'ST='
-SELECT * FROM test.t1 ORDER BY a1;
-DROP TABLE test.t1;
-
-#### Try to ALTER from MyISAM to Cluster Disk Data
-
-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;
-
-let $1=20;
-disable_query_log;
-while ($1)
-{
- eval insert into test.t1 values($1, $1+1, $1+2000000000, "aaa$1", 34.2, '4:3:2', '2006-1-1', '1971-5-28 16:55:03', "bbbbbbbbbbbbb$1", "binary data");
- dec $1;
-}
-enable_query_log;
-
-SHOW CREATE TABLE test.t1;
-SELECT * FROM test.t1 ORDER BY a1;
-ALTER TABLE test.t1 TABLESPACE ts STORAGE DISK ENGINE=NDB;
-SHOW CREATE TABLE test.t1;
-# Check column storage
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep 'ST='
-SELECT * FROM test.t1 ORDER BY a1;
-
-#### Try to ALTER from Cluster Disk Data to InnoDB
-
-ALTER TABLE test.t1 ENGINE=InnoDB;
-SHOW CREATE TABLE test.t1;
-SELECT * FROM test.t1 ORDER BY a1;
-ALTER TABLE test.t1 TABLESPACE ts STORAGE DISK ENGINE=NDB;
-SHOW CREATE TABLE test.t1;
-# Check column storage
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep 'ST='
-
-#### Try to ALTER from Cluster Disk Data to MyISAM
-
-ALTER TABLE test.t1 ENGINE=MyISAM;
-SHOW CREATE TABLE test.t1;
-DROP TABLE test.t1;
-
-#### Try to ALTER DD Tables and add columns
-
-CREATE TABLE test.t1 (a1 INT PRIMARY KEY) TABLESPACE ts STORAGE DISK ENGINE=NDB;
-
-let $1=20;
-disable_query_log;
-while ($1)
-{
- eval insert into test.t1 values($1);
- dec $1;
-}
-enable_query_log;
-
-SELECT * FROM test.t1 ORDER BY a1;
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't1' AND partition_name = 'p0';
-
-ALTER TABLE test.t1 ADD a2 FLOAT, ADD a3 DOUBLE;
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't1' AND partition_name = 'p0';
-
-let $1=20;
-disable_query_log;
-while ($1)
-{
- eval update test.t1 set a2 = $1+1.2345, a3 = $1+20000000.00 where a1 = $1;
- dec $1;
-}
-enable_query_log;
-
-SELECT * FROM test.t1 ORDER BY a1;
-
-ALTER TABLE test.t1 ADD a4 BIT, ADD a5 TINYINT, ADD a6 BIGINT, ADD a7 DATE, ADD a8 TIME;
-
-let $1=20;
-disable_query_log;
-while ($1)
-{
- eval update test.t1 set a4 = 0, a5 = 1, a6 = $1+23456, a7 = '2006-1-1',
- a8 = '07:04:00' where a1 = $1;
- dec $1;
-}
-enable_query_log;
-
-SELECT a1,a2,a3,hex(a4), a5,a6,a7,a8 FROM test.t1 ORDER BY a1;
-
-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;
-# Check column storage
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep 'ST='
-
-disable_query_log;
-set @d2 = 'dd2';
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-enable_query_log;
-
-let $1=20;
-disable_query_log;
-while ($1)
-{
- eval update test.t1 set a9 = '1971-5-28 16:55:03', a10 = 'abc', a11 = 'abcdefg',
- a12 = 'LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', a13 = 'Text Field',
- a14 = @d2 where a1 = $1;
- dec $1;
-}
-enable_query_log;
-
-SELECT a1, a2,a3,hex(a4),a5,a6,a7,a8,a9,a10,a11,a12,a13 FROM test.t1 ORDER BY a1;
-
-#### Try to ALTER DD Tables and add Indexes
-
-ALTER TABLE test.t1 ADD INDEX a2_i (a2), ADD INDEX a3_i (a3);
-
-SHOW CREATE TABLE test.t1;
-
-# Check column storage
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep 'ST='
-
-ALTER TABLE test.t1 DROP INDEX a2_i;
-
-SHOW CREATE TABLE test.t1;
-
-# Check column storage
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep 'ST='
-
-TRUNCATE TABLE test.t1;
-
-SHOW CREATE TABLE test.t1;
-
-# Check column storage
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep 'ST='
-
-#### Try to ALTER DD Tables and drop columns
-
-
-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;
-
-# Check column storage
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep 'ST='
-
-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;
-
-####################### End section 4 #########################
-#End 5.1 test case
-
diff --git a/mysql-test/suite/ndb/t/ndb_dd_basic.test b/mysql-test/suite/ndb/t/ndb_dd_basic.test
deleted file mode 100644
index 0fb793e2142..00000000000
--- a/mysql-test/suite/ndb/t/ndb_dd_basic.test
+++ /dev/null
@@ -1,485 +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
-
-#
-# 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;
-
-DELETE FROM t1;
-INSERT INTO t1 VALUES (3,'1','1');
-BEGIN;
-UPDATE t1 SET b = b + 2 WHERE A = 3;
-DELETE FROM t1 WHERE A = 3;
-INSERT INTO t1 VALUES (3,'0','0');
-COMMIT;
-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;
-
-# bug#34118 hash index trigger and do not update any disk attr
-CREATE TABLE t1 (
-id int unsigned NOT NULL,
-c1 int unsigned NOT NULL,
-c2 int DEFAULT NULL,
-PRIMARY KEY using hash (id),
-UNIQUE KEY c1 using hash (c1))
-TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster;
-
-insert into t1 values(1, 1, 3);
-insert into t1 values(2, 2, 3);
---error ER_DUP_ENTRY
-update t1 set c1 = 1 where id = 2;
-drop table 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
deleted file mode 100644
index ca39be87c94..00000000000
--- a/mysql-test/suite/ndb/t/ndb_dd_ddl.test
+++ /dev/null
@@ -1,470 +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;
-# 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
-
-
---echo
---echo # -----------------------------------------------------------------
---echo # End 5.1 test
---echo # -----------------------------------------------------------------
-
---echo
---echo # --
---echo # -- WL#4300: Define privileges for tablespaces.
---echo # --
-
-GRANT CREATE TABLESPACE ON *.* TO mysqltest_u1@localhost;
-
---echo
-
---disable_warnings
-DROP DATABASE IF EXISTS mysqltest2;
---enable_warnings
-
-CREATE DATABASE mysqltest2;
-
-GRANT ALL PRIVILEGES ON mysqltest2.* TO mysqltest_u2@localhost;
-
---echo
---echo # -- Connection: mysqltest_u1@localhost
---echo
---connect(con1, localhost, mysqltest_u1,,)
-
---echo # -- Grants for mysqltest_u1@localhost:
-SHOW GRANTS;
-
---echo
---echo # -- Check CREATE LOGFILE GROUP...
-CREATE LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile.dat'
-INITIAL_SIZE 1M
-UNDO_BUFFER_SIZE = 1M
-ENGINE = NDB;
-
---echo
---echo # -- Check ALTER LOGFILE GROUP...
-ALTER LOGFILE GROUP lg1
-ADD UNDOFILE 'undofile02.dat'
-INITIAL_SIZE 1M
-ENGINE = NDB;
-
---echo
---echo # -- Check CREATE TABLESPACE...
-CREATE TABLESPACE ts1
-ADD DATAFILE 'datafile.dat'
-USE LOGFILE GROUP lg1
-INITIAL_SIZE 1M
-ENGINE = NDB;
-
---echo
---echo # -- Check ALTER TABLESPACE...
-ALTER TABLESPACE ts1
-DROP DATAFILE 'datafile.dat'
-INITIAL_SIZE 1M
-ENGINE = NDB;
-
---echo
---echo # -- Connection: mysqltest_u2@localhost
---echo
---connect(con2, localhost, mysqltest_u2,,mysqltest2)
-
---echo # -- Grants for mysqltest_u2@localhost:
-SHOW GRANTS;
-
-CREATE TABLE t1(c INT) TABLESPACE ts1;
-
-DROP TABLE t1;
-
---echo
---echo # -- Connection: mysqltest_u1@localhost
---echo
---connection con1
-
---echo
---echo # -- Check DROP TABLESPACE...
-DROP TABLESPACE ts1
-ENGINE = NDB;
-
---echo
---echo # -- Check DROP LOGFILE GROUP...
-DROP LOGFILE GROUP lg1
-ENGINE = NDB;
-
---echo
---echo # -- Connection: root@localhost
---echo
---connection default
---disconnect con1
-
-DROP USER mysqltest_u1@localhost;
-DROP USER mysqltest_u2@localhost;
-DROP DATABASE mysqltest2;
-
---echo
---echo # -----------------------------------------------------------------
---echo # End 6.0 test
---echo # -----------------------------------------------------------------
diff --git a/mysql-test/suite/ndb/t/ndb_dd_disk2memory.test b/mysql-test/suite/ndb/t/ndb_dd_disk2memory.test
deleted file mode 100644
index 5975f44e087..00000000000
--- a/mysql-test/suite/ndb/t/ndb_dd_disk2memory.test
+++ /dev/null
@@ -1,292 +0,0 @@
-########################################
-# Author: JBM
-# Date: 2006-01-12
-# Purpose: To test using ndb memory and
-# disk tables together.
-########################################
-
--- source include/have_ndb.inc
-
---disable_warnings
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
---enable_warnings
-
-############ Test Setup Section #############
--- echo **** Test Setup Section ****
-
-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 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
-TABLESPACE table_space1 STORAGE DISK
-ENGINE=NDB;
-
-CREATE TABLE test.t2
-(pk2 INT NOT NULL PRIMARY KEY, b2 INT NOT NULL, c2 INT NOT NULL)
-ENGINE=NDB;
-
---echo
-##################### Data load for first test ####################
---echo **** Data load for first test ****
-
-INSERT INTO test.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);
-
-
-INSERT INTO test.t2 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);
-
---echo
-##################### Test 1 Section Begins ###############
---echo *** Test 1 Section Begins ***
-SELECT COUNT(*) FROM test.t2 LEFT JOIN test.t1 ON pk2=pk1 WHERE b2 IN (4);
-SELECT * FROM test.t2 LEFT JOIN test.t1 ON pk2=pk1 WHERE b2 IN (4);
-SELECT COUNT(*) FROM test.t1 LEFT JOIN test.t2 ON pk1=pk2 WHERE b IN (4);
-SELECT COUNT(*) FROM test.t1 LEFT JOIN test.t2 ON b=b2 WHERE pk1 IN (75);
-SELECT b, c FROM test.t1 LEFT JOIN test.t2 ON pk1=pk2 ORDER BY b;
---echo
-####################### Test 1 Section End ################
-
-##################### Setup for test 2 ####################
---echo *** Setup for test 2 ****
-DELETE FROM test.t1;
-INSERT INTO test.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);
---echo
-############################# Test Section 2 ###############
---echo **** Test Section 2 ****
-SELECT b, c FROM test.t1 LEFT JOIN test.t2 ON pk1=pk2 ORDER BY b;
-SELECT COUNT(*) FROM test.t1 LEFT JOIN test.t2 ON b=b2;
-SELECT COUNT(*) FROM test.t1 RIGHT JOIN test.t2 ON b=b2;
-SHOW CREATE TABLE test.t2;
-SHOW CREATE TABLE test.t1;
-ALTER TABLE test.t2 TABLESPACE table_space1 STORAGE DISK
-ENGINE=NDB;
-SHOW CREATE TABLE test.t2;
-ALTER TABLE test.t1 STORAGE MEMORY ENGINE=NDBCLUSTER;
-SHOW CREATE TABLE test.t1;
---echo
-######################### End Test Section 2 #################
-DROP TABLE test.t1;
-DROP TABLE test.t2;
-##################### Setup for Test Section 3 ###############
---echo *** Setup for Test Section 3 ***
-CREATE TABLE test.t1 (
- usr_id INT unsigned NOT NULL,
- uniq_id INT unsigned NOT NULL AUTO_INCREMENT,
- start_num INT unsigned NOT NULL DEFAULT 1,
- increment INT unsigned NOT NULL DEFAULT 1,
- PRIMARY KEY (uniq_id),
- INDEX usr_uniq_idx (usr_id, uniq_id),
- INDEX uniq_usr_idx (uniq_id, usr_id))
-TABLESPACE table_space1 STORAGE DISK
-ENGINE=NDB;
-
-
-CREATE TABLE test.t2 (
- id INT unsigned NOT NULL DEFAULT 0,
- usr2_id INT unsigned NOT NULL DEFAULT 0,
- max INT unsigned NOT NULL DEFAULT 0,
- c_amount INT unsigned NOT NULL DEFAULT 0,
- d_max INT unsigned NOT NULL DEFAULT 0,
- d_num INT unsigned NOT NULL DEFAULT 0,
- orig_time INT unsigned NOT NULL DEFAULT 0,
- c_time INT unsigned NOT NULL DEFAULT 0,
- active ENUM ("no","yes") NOT NULL,
- PRIMARY KEY (id,usr2_id),
- INDEX id_idx (id),
- INDEX usr2_idx (usr2_id))
-ENGINE=NDB;
-
-INSERT INTO test.t1 VALUES (3,NULL,0,50),(3,NULL,0,200),(3,NULL,0,25),(3,NULL,0,84676),(3,NULL,0,235),(3,NULL,0,10),(3,NULL,0,3098),(3,NULL,0,2947),(3,NULL,0,8987),(3,NULL,0,8347654),(3,NULL,0,20398),(3,NULL,0,8976),(3,NULL,0,500),(3,NULL,0,198);
-
---echo
-###################### Test Section 3 ######################
---echo **** Test Section 3 ****
-SELECT test.t1.usr_id,test.t1.uniq_id,test.t1.increment,
-test.t2.usr2_id,test.t2.c_amount,test.t2.max
-FROM test.t1
-LEFT JOIN test.t2 ON test.t2.id = test.t1.uniq_id
-WHERE test.t1.uniq_id = 4
-ORDER BY test.t2.c_amount;
-
-INSERT INTO test.t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes');
-INSERT INTO test.t2 VALUES (4,3,3000,6000,0,0,746584,837484,'yes');
-INSERT INTO test.t2 VALUES (7,3,1000,2000,0,0,746294,937484,'yes');
-
-SELECT test.t1.usr_id,test.t1.uniq_id,test.t1.increment,
-test.t2.usr2_id,test.t2.c_amount,test.t2.max
-FROM test.t1
-LEFT JOIN test.t2 ON test.t2.id = test.t1.uniq_id
-WHERE test.t1.uniq_id = 4
-ORDER BY test.t2.c_amount;
---echo
-####################### End Section 3 #########################
-DROP TABLE test.t1;
-DROP TABLE test.t2;
-
-########## Test that use to be in ndb_dd_advance.test #########
-########## ndb_dd_advance.test is now ndb_dd_alter.test #######
-#### Use group by asc and dec; Use having; Use order by. ####
-
-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)
-) TABLESPACE table_space1 STORAGE DISK ENGINE=NDB;
-
-CREATE TABLE test.t2 (
- b1 smallint NOT NULL,
- b2 int NOT NULL,
- b3 bigint NOT NULL,
- b4 char(10),
- b5 decimal(5,1),
- b6 time,
- b7 date,
- b8 datetime,
- b9 VARCHAR(255),
- b10 blob,
- PRIMARY KEY(b1)
-) ENGINE=NDB;
-
-### ADD Some DATA to tables ######
-
-
-let $1=20;
-disable_query_log;
-while ($1)
-{
- eval insert into test.t1 values($1, $1+1, $1+2000000000, "aaa$1", 34.2, '4:3:2', '2006-1-1', '1971-5-28 16:55:03', "bbbbbbbbbbbbb$1", "binary data");
- eval insert into test.t2 values($1+2, $1+3, $1+3000000000, "aaa$1", 35.2, '4:3:2', '2006-1-1', '1971-5-28 16:55:03', "bbbbbbbbbbbbb$1", "binary data");
- dec $1;
-}
-
-ALTER TABLE test.t1 ADD INDEX (a2), ADD INDEX (a3), ADD INDEX (a8);
-ALTER TABLE test.t2 ADD INDEX (b2), ADD INDEX (b3), ADD INDEX (b8);
-SHOW CREATE TABLE test.t1;
-SHOW CREATE TABLE test.t2;
-SELECT * FROM test.t1 order by a1;
-SELECT * FROM test.t2 order by b1;
-SELECT COUNT(a1), a1, COUNT(a1)*a1 FROM test.t1 GROUP BY a1;
-SELECT COUNT(a2), (a2+1), COUNT(a2)*(a2+0) FROM test.t1 GROUP BY a2;
-
-DROP TABLE test.t1;
-DROP TABLE test.t2;
-
-CREATE TABLE test.t1 (a INT NOT NULL,
-b CHAR(5), c TEXT, d INT NOT NULL PRIMARY KEY) TABLESPACE
-table_space1 STORAGE DISK ENGINE=NDB;
-
-insert into test.t1 (a,b,c,d) values (1,'a','Jonas',1),(2,'b','Tomas',2),
-(3,'c','Pekka',3),(4,'d','Martin',4),(5,'e','Stewart',5),(6,'f','Jeb',6),
-(7,'g','Serge',7),(8,'h','Clavin',8);
-select distinct a from test.t1 group by b,a having a > 4 order by a desc;
-select distinct a,c from test.t1 group by b,c,a having a > 2 order by a desc;
-select distinct a from test.t1 group by b,a having a > 1 order by a asc;
-select distinct a,c from test.t1 group by b,c,a having a > 3 order by a asc;
-drop table test.t1;
-
-create table test.t1 (a char(1), key(a)) TABLESPACE table_space1
-STORAGE DISK ENGINE=NDB;
-insert into test.t1 values('1'),('1'),('1'),('2'),('2'),('3'),('3');
-select * from test.t1 where a >= '1' order by a;
-select distinct a from test.t1 order by a desc;
-select distinct a from test.t1 where a >= '1' order by a desc;
-select distinct a from test.t1 where a >= '1' order by a asc;
-drop table test.t1;
-
-CREATE TABLE test.t1 (email varchar(50), infoID BIGINT, dateentered DATETIME)
-TABLESPACE table_space1 STORAGE DISK ENGINE=NDB;
-CREATE TABLE test.t2 (infoID BIGINT, shipcode varchar(10)) ENGINE=NDB;
-
-INSERT INTO test.t1 (email, infoID, dateentered) VALUES
- ('test1@testdomain.com', 1, '2002-07-30 22:56:38'),
- ('test1@testdomain.com', 1, '2002-07-27 22:58:16'),
- ('test2@testdomain.com', 1, '2002-06-19 15:22:19'),
- ('test2@testdomain.com', 2, '2002-06-18 14:23:47'),
- ('test3@testdomain.com', 1, '2002-05-19 22:17:32');
-
-INSERT INTO test.t2(infoID, shipcode) VALUES
- (1, 'Z001'),
- (2, 'R002');
-
-SELECT DISTINCTROW email, shipcode FROM test.t1, test.t2
-WHERE t1.infoID=t2.infoID order by email, shipcode;
-SELECT DISTINCTROW email FROM test.t1 ORDER BY dateentered DESC;
-SELECT DISTINCTROW email, shipcode FROM test.t1, test.t2
-WHERE test.t1.infoID=test.t2.infoID ORDER BY dateentered DESC;
-
-DROP TABLE test.t1,test.t2;
-
-#################
-# Test Cleanup
-#################
-
-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;
-
-#End 5.1 test case
-
diff --git a/mysql-test/suite/ndb/t/ndb_dd_dump.test b/mysql-test/suite/ndb/t/ndb_dd_dump.test
deleted file mode 100644
index 7fc315ef167..00000000000
--- a/mysql-test/suite/ndb/t/ndb_dd_dump.test
+++ /dev/null
@@ -1,289 +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/suite/ndb/t/ndb_dd_sql_features.test b/mysql-test/suite/ndb/t/ndb_dd_sql_features.test
deleted file mode 100644
index f46cb217ab4..00000000000
--- a/mysql-test/suite/ndb/t/ndb_dd_sql_features.test
+++ /dev/null
@@ -1,551 +0,0 @@
-##############################################################
-# Author: Nikolay
-# Date: 2006-04-01
-# Purpose: Specific Blob and Varchar testing using disk tables.
-##############################################################
-# Create Stored procedures that use disk based tables.
-# Create function that operate on disk based tables.
-# Create triggers that operate on disk based tables.
-# Create views that operate on disk based tables.
-# Try to create FK constraints on disk based tables.
-# Create and use disk based table that use auto inc.
-# Create test that use transaction (commit, rollback)
-# Create large disk base table, do random queries, check cache hits,
-# do same query 10 times check cache hits.
-# Create test that uses COUNT(), SUM(), MAX(), MIN(),
-# NOW(), USER(), ... other built in # SQL functions
-# Create test that uses locks.
-# Create test using truncate.
-##############################################################
-# Author: Jonathan
-# Date: 2006-08-28
-# Change: Remove all the create and drop LFG and TS except
-# The first create and the last drop to make test
-# run faster.
-# In addition, renamed test to be to a name that
-# gives a better idea of what the test is about
-###########################################################
--- source include/have_ndb.inc
-
---disable_warnings
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
-DROP TABLE IF EXISTS test.t3;
---enable_warnings
-
-#### Copy data from table in one table space to table in ###
-#### different table space. ####
---echo *****
---echo **** Copy data from table in one table space to table
---echo **** in different table space
---echo *****
-
- CREATE LOGFILE GROUP lg
- ADD UNDOFILE './lg_group/undofile.dat'
- INITIAL_SIZE 16M
- UNDO_BUFFER_SIZE = 1M
- ENGINE=NDB;
-
- CREATE TABLESPACE ts1
- ADD DATAFILE './table_space1/datafile.dat'
- USE LOGFILE GROUP lg
- INITIAL_SIZE 25M
- ENGINE NDB;
-
- CREATE TABLESPACE ts2
- ADD DATAFILE './table_space2/datafile.dat'
- USE LOGFILE GROUP lg
- INITIAL_SIZE 20M
- ENGINE NDB;
-
- CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
- TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
- CREATE TABLE test.t2 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
- TABLESPACE ts2 STORAGE DISK ENGINE=NDB;
-
- SHOW CREATE TABLE test.t1;
- SHOW CREATE TABLE test.t2;
-
- INSERT INTO test.t1 VALUES (1,'111111','aaaaaaaa');
- INSERT INTO test.t1 VALUES (2,'222222','bbbbbbbb');
- SELECT * FROM test.t1 ORDER BY a1;
- INSERT INTO test.t2(a1,a2,a3) SELECT * FROM test.t1;
- SELECT * FROM test.t2 ORDER BY a1;
-
- DROP TABLE test.t1, test.t2;
-
- # populate BLOB field with large data
-
-set @vc1 = repeat('a', 200);
-set @vc2 = repeat('b', 500);
-set @vc3 = repeat('c', 1000);
-set @vc4 = repeat('d', 4000);
-
-# x0 size 256
-set @x0 = '01234567012345670123456701234567';
-set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
-
-# b1 length 2000+256
-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);
-# 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);
-
-# 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);
-# d2 length 30000
-set @d2 = 'dd2';
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-
-select length(@x0),length(@b1),length(@d1) from dual;
-select length(@x0),length(@b2),length(@d2) from dual;
-
- CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(5000), a3 BLOB)
- TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
- CREATE TABLE test.t2 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(5000), a3 BLOB)
- TABLESPACE ts2 STORAGE DISK ENGINE=NDB;
-
- SHOW CREATE TABLE test.t1;
- SHOW CREATE TABLE test.t2;
-
- INSERT INTO test.t1 VALUES (1,@vc1,@d1);
- INSERT INTO test.t1 VALUES (2,@vc2,@b1);
- INSERT INTO test.t1 VALUES (3,@vc3,@d2);
- INSERT INTO test.t1 VALUES (4,@vc4,@b2);
-
- SELECT a1,length(a2),substr(a2,180,2),length(a3),substr(a3,1+3*900,3)
- FROM test.t1 WHERE a1=1;
- SELECT a1,length(a2),substr(a2,480,2),length(a3),substr(a3,1+2*900,3)
- FROM test.t1 where a1=2;
-
- INSERT INTO test.t2(a1,a2,a3) SELECT * FROM test.t1;
- SELECT a1,length(a2),substr(a2,180,2),length(a3),substr(a3,1+3*900,3)
- FROM test.t2 WHERE a1=1;
- SELECT a1,length(a2),substr(a2,480,2),length(a3),substr(a3,1+2*900,3)
- FROM test.t2 where a1=2;
-
-
- DROP TABLE test.t1, test.t2;
-
-#### Insert, Update, Delete from NDB table with BLOB fields ####
---echo *****
---echo **** Insert, Update, Delete from NDB table with BLOB fields
---echo *****
-
-set @vc1 = repeat('a', 200);
-set @vc2 = repeat('b', 500);
-set @vc3 = repeat('c', 1000);
-set @vc4 = repeat('d', 4000);
-set @vc5 = repeat('d', 5000);
-
-set @bb1 = repeat('1', 2000);
-set @bb2 = repeat('2', 5000);
-set @bb3 = repeat('3', 10000);
-set @bb4 = repeat('4', 40000);
-set @bb5 = repeat('5', 50000);
-
-select length(@vc1),length(@vc2),length(@vc3),length(@vc4),length(@vc5)
-from dual;
-select length(@bb1),length(@bb2),length(@bb3),length(@bb4),length(@bb5)
-from dual;
-
- CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(5000), a3 BLOB)
- TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-# CREATE TABLE test.t2 (a1 int NOT NULL, a2 VARCHAR(5000), a3 BLOB)
-# TABLESPACE ts2 STORAGE DISK ENGINE=NDB;
-
- INSERT INTO test.t1 VALUES (1,@vc1,@bb1);
- INSERT INTO test.t1 VALUES (2,@vc2,@bb2);
- INSERT INTO test.t1 VALUES (3,@vc3,@bb3);
- INSERT INTO test.t1 VALUES (4,@vc4,@bb4);
- INSERT INTO test.t1 VALUES (5,@vc5,@bb5);
-
- UPDATE test.t1 SET a2=@vc5, a3=@bb5 WHERE a1=1;
- SELECT a1,length(a2),substr(a2,4998,2),length(a3),substr(a3,49997,3)
- FROM test.t1 WHERE a1=1;
-
- UPDATE test.t1 SET a2=@vc4, a3=@bb4 WHERE a1=2;
- SELECT a1,length(a2),substr(a2,3998,2),length(a3),substr(a3,39997,3)
- FROM test.t1 WHERE a1=2;
-
- UPDATE test.t1 SET a2=@vc2, a3=@bb2 WHERE a1=3;
- SELECT a1,length(a2),substr(a2,498,2),length(a3),substr(a3,3997,3)
- FROM test.t1 WHERE a1=3;
-
- UPDATE test.t1 SET a2=@vc3, a3=@bb3 WHERE a1=4;
- SELECT a1,length(a2),substr(a2,998,2),length(a3),substr(a3,9997,3)
- FROM test.t1 WHERE a1=4;
-
- UPDATE test.t1 SET a2=@vc1, a3=@bb1 WHERE a1=5;
- SELECT a1,length(a2),substr(a2,198,2),length(a3),substr(a3,1997,3)
- FROM test.t1 WHERE a1=5;
-
- DELETE FROM test.t1 where a1=5;
- SELECT count(*) from test.t1;
- DELETE FROM test.t1 where a1=4;
- SELECT count(*) from test.t1;
- DELETE FROM test.t1 where a1=3;
- SELECT count(*) from test.t1;
- DELETE FROM test.t1 where a1=2;
- SELECT count(*) from test.t1;
- DELETE FROM test.t1 where a1=1;
- SELECT count(*) from test.t1;
-
- DROP TABLE test.t1;
-
-##### Create Stored procedures that use disk based tables #####
---echo *****
---echo **** Create Stored procedures that use disk based tables
---echo *****
-
-delimiter //;
- CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
- TABLESPACE ts1 STORAGE DISK ENGINE=NDB//
- CREATE PROCEDURE test.sp1()
- BEGIN
- INSERT INTO test.t1 values (1,'111111','aaaaaaaa');
- END//
-delimiter ;//
-
- CALL test.sp1();
- SELECT * FROM test.t1;
-
-delimiter //;
- CREATE PROCEDURE test.sp2(n INT, vc VARCHAR(256), blb BLOB)
- BEGIN
- UPDATE test.t1 SET a2=vc, a3=blb where a1=n;
- END//
-delimiter ;//
-
- CALL test.sp2(1,'222222','bbbbbbbb');
- SELECT * FROM test.t1;
-
- DELETE FROM test.t1;
- DROP PROCEDURE test.sp1;
- DROP PROCEDURE test.sp2;
- DROP TABLE test.t1;
-
-
-#### Create function that operate on disk based tables ####
---echo *****
---echo ***** Create function that operate on disk based tables
---echo *****
-
- CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
- TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
- let $1=100;
- disable_query_log;
- while ($1)
- {
- eval insert into test.t1 values($1, "aaaaa$1", "bbbbb$1");
- dec $1;
- }
- enable_query_log;
-
- delimiter //;
- CREATE FUNCTION test.fn1(n INT) RETURNS INT
- BEGIN
- DECLARE v INT;
- SELECT a1 INTO v FROM test.t1 WHERE a1=n;
- RETURN v;
- END//
- delimiter ;//
-
-delimiter //;
- CREATE FUNCTION test.fn2(n INT, blb BLOB) RETURNS BLOB
- BEGIN
- DECLARE vv BLOB;
- UPDATE test.t1 SET a3=blb where a1=n;
- SELECT a3 INTO vv FROM test.t1 WHERE a1=n;
- RETURN vv;
- END//
- delimiter ;//
-
- SELECT test.fn1(10) FROM DUAL;
- SELECT test.fn2(50, 'new BLOB content') FROM DUAL;
-
- DELETE FROM test.t1;
- DROP FUNCTION test.fn1;
- DROP FUNCTION test.fn2;
- DROP TABLE test.t1;
-
-#### Create triggers that operate on disk based tables ####
---echo *****
---echo ***** Create triggers that operate on disk based tables
---echo *****
-
- CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
- TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-
- delimiter //;
- CREATE TRIGGER test.trg1 BEFORE INSERT ON test.t1 FOR EACH ROW
- BEGIN
- if isnull(new.a2) then
- set new.a2:= 'trg1 works on a2 field';
- end if;
- if isnull(new.a3) then
- set new.a3:= 'trg1 works on a3 field';
- end if;
- end//
- insert into test.t1 (a1) values (1)//
- insert into test.t1 (a1,a2) values (2, 'ccccccc')//
- select * from test.t1 order by a1//
- delimiter ;//
-
- DELETE FROM test.t1;
- DROP TRIGGER test.trg1;
- DROP TABLE test.t1;
-
-#### Create, update views that operate on disk based tables ####
---echo *****
---echo ***** Create, update views that operate on disk based tables
---echo *****
-
-
- CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
- TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
- let $1=10;
- disable_query_log;
- while ($1)
- {
- eval insert into test.t1 values($1, "aaaaa$1", "bbbbb$1");
- dec $1;
- }
- enable_query_log;
- CREATE VIEW test.v1 AS SELECT * FROM test.t1;
- SELECT * FROM test.v1 order by a1;
- CHECK TABLE test.v1, test.t1;
-
- UPDATE test.v1 SET a2='zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' WHERE a1=5;
- SELECT * FROM test.v1 order by a1;
-
- DROP VIEW test.v1;
- DELETE FROM test.t1;
- DROP TABLE test.t1;
-
-#### Create and use disk based table that use auto inc ####
---echo *****
---echo ***** Create and use disk based table that use auto inc
---echo *****
-
- CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
- a2 VARCHAR(256), a3 BLOB)
- TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
- let $1=10;
- disable_query_log;
- while ($1)
- {
- eval insert into test.t1 values(NULL, "aaaaa$1", "bbbbb$1");
- dec $1;
- }
- enable_query_log;
- SELECT * FROM test.t1 ORDER BY a1;
- DELETE FROM test.t1;
- DROP TABLE test.t1;
-
-
-#### Create test that use transaction (commit, rollback) ####
---echo *****
---echo ***** Create test that use transaction (commit, rollback)
---echo *****
-
- SET AUTOCOMMIT=0;
- CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
- a2 VARCHAR(256), a3 BLOB)
- TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-
- INSERT INTO test.t1 VALUES(NULL, "aaaaa1", "bbbbb1");
- COMMIT;
- SELECT * FROM test.t1 ORDER BY a1;
- INSERT INTO test.t1 VALUES(NULL, "aaaaa2", "bbbbb2");
- ROLLBACK;
- SELECT * FROM test.t1 ORDER BY a1;
-
- DELETE FROM test.t1;
- DROP TABLE test.t1;
- SET AUTOCOMMIT=1;
-
-# Now do the same thing with START TRANSACTION without using AUTOCOMMIT.
-
- CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
- a2 VARCHAR(256), a3 BLOB)
- TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-
- START TRANSACTION;
- INSERT INTO test.t1 VALUES(NULL, "aaaaa1", "bbbbb1");
- COMMIT;
- SELECT * FROM test.t1 ORDER BY a1;
-
- START TRANSACTION;
- INSERT INTO test.t1 VALUES(NULL, "aaaaa2", "bbbbb2");
- ROLLBACK;
- SELECT * FROM test.t1 ORDER BY a1;
-
- DELETE FROM test.t1;
- DROP TABLE test.t1;
-
-#### Create test that uses locks ####
---echo *****
---echo ***** Create test that uses locks
---echo *****
-
- connect (con1,localhost,root,,);
- connect (con2,localhost,root,,);
-
-# connection con1;
---disable_warnings
- drop table if exists test.t1;
- CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
- a2 VARCHAR(256), a3 BLOB)
- TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
---enable_warnings
-
- LOCK TABLES test.t1 write;
- INSERT INTO test.t1 VALUES(NULL, "aaaaa1", "bbbbb1");
- INSERT INTO test.t1 VALUES(NULL, "aaaaa2", "bbbbb2");
- SELECT * FROM test.t1 ORDER BY a1;
-
- connection con2;
- SELECT * FROM test.t1 ORDER BY a1;
- INSERT INTO test.t1 VALUES(NULL, "aaaaa3", "bbbbb3");
-
- connection con1;
- UNLOCK TABLES;
-
- connection con2;
- INSERT INTO test.t1 VALUES(NULL, "aaaaa3", "bbbbb3");
- SELECT * FROM test.t1 ORDER BY a1;
- DELETE FROM test.t1;
- DROP TABLE test.t1;
-
- #connection defualt;
-
-#### Create large disk base table, do random queries, check cache hits ####
---echo *****
---echo ***** Create large disk base table, do random queries, check cache hits
---echo *****
-
-set @vc1 = repeat('a', 200);
-SELECT @vc1 FROM DUAL;
-set @vc2 = repeat('b', 500);
-set @vc3 = repeat('b', 998);
-
-# x0 size 256
-set @x0 = '01234567012345670123456701234567';
-set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
-
-# b1 length 2000+256 (blob part aligned)
-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);
-# 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);
-
-# 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);
-# d2 length 30000
-set @d2 = 'dd2';
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-
-select length(@x0),length(@b1),length(@d1) from dual;
-select length(@x0),length(@b2),length(@d2) from dual;
-
- CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(1000), a3 BLOB)
- TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
-
- INSERT INTO test.t1 values(1,@vc1,@d1);
- INSERT INTO test.t1 values(2,@vc2,@d2);
- --replace_column 9 #
- explain SELECT * from test.t1 WHERE a1 = 1;
-
- SELECT a1,length(a2),substr(a2,1+2*900,2),length(a3),substr(a3,1+3*900,3)
- FROM test.t1 WHERE a1=1 ORDER BY a1;
- SELECT a1,length(a2),substr(a2,1+2*9000,2),length(a3),substr(a3,1+3*9000,3)
- FROM test.t1 where a1=2 ORDER BY a1;
-
- UPDATE test.t1 set a2=@vc2,a3=@d2 where a1=1;
- UPDATE test.t1 set a2=@vc1,a3=@d1 where a1=2;
-
- SELECT a1,length(a2),substr(a2,1+2*9000,2),length(a3),substr(a3,1+3*9000,3)
- FROM test.t1 where a1=1;
- SELECT a1,length(a2),substr(a2,1+2*900,2),length(a3),substr(a3,1+3*900,3)
- FROM test.t1 where a1=2;
-
- #SHOW VARIABLES LIKE 'have_query_cache';
- #SHOW STATUS LIKE 'Qcache%';
-
- DELETE FROM test.t1;
- DROP TABLE test.t1;
-
-#### Create test that uses COUNT(), SUM(), MAX(), ####
-##### MIN(), NOW(), USER(), TRUNCATE ####
---echo *****
---echo ***** Create test that uses COUNT(), SUM(), MAX(), MIN(), NOW(),
---echo ***** USER(), TRUNCATE
---echo *****
-
- CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256),
- a3 BLOB, a4 DATE, a5 CHAR(250))
- TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
- let $1=100;
- disable_query_log;
- while ($1)
- {
- eval insert into test.t1 values($1, "aaaaaaaaaaaaaaaa$1",
- "bbbbbbbbbbbbbbbbbb$1", '2006-06-20' , USER());
- dec $1;
- }
- enable_query_log;
-
- SELECT COUNT(*) from test.t1;
- SELECT SUM(a1) from test.t1;
- SELECT MIN(a1) from test.t1;
- SELECT MAX(a1) from test.t1;
- SELECT a5 from test.t1 where a1=50;
-
-
- SELECT * from test.t1 order by a1;
-
- DROP TABLE test.t1;
-
- ALTER TABLESPACE ts1
- DROP DATAFILE './table_space1/datafile.dat'
- ENGINE=NDB;
- DROP TABLESPACE ts1 ENGINE=NDB;
-
- ALTER TABLESPACE ts2
- DROP DATAFILE './table_space2/datafile.dat'
- ENGINE=NDB;
- DROP TABLESPACE ts2 ENGINE=NDB;
-
- DROP LOGFILE GROUP lg
- ENGINE=NDB;
-
-
-#End 5.1 test case
-
diff --git a/mysql-test/suite/ndb/t/ndb_gis.test b/mysql-test/suite/ndb/t/ndb_gis.test
deleted file mode 100644
index babff535f94..00000000000
--- a/mysql-test/suite/ndb/t/ndb_gis.test
+++ /dev/null
@@ -1,5 +0,0 @@
---source include/have_ndb.inc
-SET storage_engine=ndbcluster;
---source include/gis_generic.inc
-set optimizer_switch = "engine_condition_pushdown=on";
---source include/gis_generic.inc
diff --git a/mysql-test/suite/ndb/t/ndb_grant.later b/mysql-test/suite/ndb/t/ndb_grant.later
deleted file mode 100644
index 5431d94e1f8..00000000000
--- a/mysql-test/suite/ndb/t/ndb_grant.later
+++ /dev/null
@@ -1,385 +0,0 @@
--- source include/have_ndb.inc
-# Test of GRANT commands
-
-# Cleanup
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-SET NAMES binary;
-
-#
-# Alter mysql system tables to ndb
-# make sure you alter all back in the end
-#
-use mysql;
-alter table columns_priv engine=ndb;
-alter table db engine=ndb;
-alter table func engine=ndb;
-alter table help_category engine=ndb;
-alter table help_keyword engine=ndb;
-alter table help_relation engine=ndb;
-alter table help_topic engine=ndb;
-alter table host engine=ndb;
-alter table tables_priv engine=ndb;
-alter table time_zone engine=ndb;
-alter table time_zone_leap_second engine=ndb;
-alter table time_zone_name engine=ndb;
-alter table time_zone_transition engine=ndb;
-alter table time_zone_transition_type engine=ndb;
-alter table user engine=ndb;
-use test;
-
-#
-# Test that SSL options works properly
-#
-delete from mysql.user where user='mysqltest_1';
-delete from mysql.db where user='mysqltest_1';
-flush privileges;
-begin;
-grant select on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
-commit;
-show grants for mysqltest_1@localhost;
-begin;
-grant delete on mysqltest.* to mysqltest_1@localhost;
-commit;
-select * from mysql.user where user="mysqltest_1";
-show grants for mysqltest_1@localhost;
-begin;
-revoke delete on mysqltest.* from mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-begin;
-grant select on mysqltest.* to mysqltest_1@localhost require NONE;
-commit;
-show grants for mysqltest_1@localhost;
-begin;
-grant USAGE on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "testsubject" ISSUER "MySQL AB";
-commit;
-show grants for mysqltest_1@localhost;
-begin;
-revoke all privileges on mysqltest.* from mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
-flush privileges;
-
-#
-# Test that the new db privileges are stored/retrieved correctly
-#
-
-begin;
-grant CREATE TEMPORARY TABLES, LOCK TABLES on mysqltest.* to mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-flush privileges;
-show grants for mysqltest_1@localhost;
-begin;
-revoke CREATE TEMPORARY TABLES on mysqltest.* from mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-begin;
-grant ALL PRIVILEGES on mysqltest.* to mysqltest_1@localhost with GRANT OPTION;
-commit;
-flush privileges;
-show grants for mysqltest_1@localhost;
-begin;
-revoke LOCK TABLES, ALTER on mysqltest.* from mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-begin;
-revoke all privileges on mysqltest.* from mysqltest_1@localhost;
-commit;
-delete from mysql.user where user='mysqltest_1';
-flush privileges;
-begin;
-grant usage on test.* to mysqltest_1@localhost with grant option;
-commit;
-show grants for mysqltest_1@localhost;
-delete from mysql.user where user='mysqltest_1';
-delete from mysql.db where user='mysqltest_1';
-delete from mysql.tables_priv where user='mysqltest_1';
-delete from mysql.columns_priv where user='mysqltest_1';
-flush privileges;
---error 1141
-show grants for mysqltest_1@localhost;
-
-#
-# Test what happens when you have same table and colum level grants
-#
-
-create table t1 (a int);
-begin;
-GRANT select,update,insert on t1 to mysqltest_1@localhost;
-GRANT select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
-begin;
-REVOKE select (a), update on t1 from mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-begin;
-REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-begin;
-GRANT select,references on t1 to mysqltest_1@localhost;
-commit;
-select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
-begin;
-grant all on test.* to mysqltest_3@localhost with grant option;
-revoke all on test.* from mysqltest_3@localhost;
-commit;
-show grants for mysqltest_3@localhost;
-begin;
-revoke grant option on test.* from mysqltest_3@localhost;
-commit;
-show grants for mysqltest_3@localhost;
-begin;
-grant all on test.t1 to mysqltest_2@localhost with grant option;
-revoke all on test.t1 from mysqltest_2@localhost;
-commit;
-show grants for mysqltest_2@localhost;
-begin;
-revoke grant option on test.t1 from mysqltest_2@localhost;
-commit;
-show grants for mysqltest_2@localhost;
-delete from mysql.user where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
-delete from mysql.db where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
-delete from mysql.tables_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
-delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3";
-flush privileges;
-drop table t1;
-
-#
-# Test some error conditions
-#
-begin;
---error 1221
-GRANT FILE on mysqltest.* to mysqltest_1@localhost;
-commit;
-select 1; -- To test that the previous command didn't cause problems
-
-#
-# Bug#6123: GRANT USAGE inserts useless Db row
-#
-create database mysqltest1;
-begin;
-grant usage on mysqltest1.* to test6123 identified by 'magic123';
-commit;
-select host,db,user,select_priv,insert_priv from mysql.db where db="mysqltest1";
-delete from mysql.user where user='test6123';
-drop database mysqltest1;
-
-#
-# Test for 'drop user', 'revoke privileges, grant'
-#
-
-create table t1 (a int);
-begin;
-grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION;
-commit;
-show grants for drop_user2@localhost;
-begin;
-revoke all privileges, grant option from drop_user2@localhost;
-commit;
-drop user drop_user2@localhost;
-
-begin;
-grant ALL PRIVILEGES on *.* to drop_user@localhost with GRANT OPTION;
-grant ALL PRIVILEGES on test.* to drop_user@localhost with GRANT OPTION;
-grant select(a) on test.t1 to drop_user@localhost;
-commit;
-show grants for drop_user@localhost;
-
-#
-# Bug3086
-#
-set sql_mode=ansi_quotes;
-show grants for drop_user@localhost;
-set sql_mode=default;
-
-set sql_quote_show_create=0;
-show grants for drop_user@localhost;
-set sql_mode="ansi_quotes";
-show grants for drop_user@localhost;
-set sql_quote_show_create=1;
-show grants for drop_user@localhost;
-set sql_mode="";
-show grants for drop_user@localhost;
-
-revoke all privileges, grant option from drop_user@localhost;
-show grants for drop_user@localhost;
-drop user drop_user@localhost;
-begin;
---error 1269
-revoke all privileges, grant option from drop_user@localhost;
-commit;
-
-begin;
-grant select(a) on test.t1 to drop_user1@localhost;
-commit;
-flush privileges;
-begin;
-grant select on test.t1 to drop_user2@localhost;
-grant select on test.* to drop_user3@localhost;
-grant select on *.* to drop_user4@localhost;
-commit;
-flush privileges;
-# Drop user now implicitly revokes all privileges.
-drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost,
-drop_user4@localhost;
-begin;
---error 1269
-revoke all privileges, grant option from drop_user1@localhost, drop_user2@localhost,
-drop_user3@localhost, drop_user4@localhost;
-commit;
-flush privileges;
-#--error 1268
-drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost,
-drop_user4@localhost;
-drop table t1;
-begin;
-grant usage on *.* to mysqltest_1@localhost identified by "password";
-grant select, update, insert on test.* to mysqltest_1@localhost;
-commit;
-show grants for mysqltest_1@localhost;
-drop user mysqltest_1@localhost;
-
-#
-# Bug #3403 Wrong encodin in SHOW GRANTS output
-#
-SET NAMES koi8r;
-CREATE DATABASE ÂÄ;
-USE ÂÄ;
-CREATE TABLE ÔÁÂ (ËÏÌ int);
-
-begin;
-GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost;
-commit;
-SHOW GRANTS FOR ÀÚÅÒ@localhost;
-begin;
-REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost;
-commit;
-
-begin;
-GRANT SELECT ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost;
-commit;
-SHOW GRANTS FOR ÀÚÅÒ@localhost;
-begin;
-REVOKE SELECT ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost;
-commit;
-
-begin;
-GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost;
-commit;
-SHOW GRANTS FOR ÀÚÅÒ@localhost;
-begin;
-REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost;
-commit;
-
-DROP DATABASE ÂÄ;
-SET NAMES latin1;
-
-#
-# Bug #5831: REVOKE ALL PRIVILEGES, GRANT OPTION does not revoke everything
-#
-USE test;
-CREATE TABLE t1 (a int );
-CREATE TABLE t2 LIKE t1;
-CREATE TABLE t3 LIKE t1;
-CREATE TABLE t4 LIKE t1;
-CREATE TABLE t5 LIKE t1;
-CREATE TABLE t6 LIKE t1;
-CREATE TABLE t7 LIKE t1;
-CREATE TABLE t8 LIKE t1;
-CREATE TABLE t9 LIKE t1;
-CREATE TABLE t10 LIKE t1;
-CREATE DATABASE testdb1;
-CREATE DATABASE testdb2;
-CREATE DATABASE testdb3;
-CREATE DATABASE testdb4;
-CREATE DATABASE testdb5;
-CREATE DATABASE testdb6;
-CREATE DATABASE testdb7;
-CREATE DATABASE testdb8;
-CREATE DATABASE testdb9;
-CREATE DATABASE testdb10;
-begin;
-GRANT ALL ON testdb1.* TO testuser@localhost;
-GRANT ALL ON testdb2.* TO testuser@localhost;
-GRANT ALL ON testdb3.* TO testuser@localhost;
-GRANT ALL ON testdb4.* TO testuser@localhost;
-GRANT ALL ON testdb5.* TO testuser@localhost;
-GRANT ALL ON testdb6.* TO testuser@localhost;
-GRANT ALL ON testdb7.* TO testuser@localhost;
-GRANT ALL ON testdb8.* TO testuser@localhost;
-GRANT ALL ON testdb9.* TO testuser@localhost;
-GRANT ALL ON testdb10.* TO testuser@localhost;
-GRANT SELECT ON test.t1 TO testuser@localhost;
-GRANT SELECT ON test.t2 TO testuser@localhost;
-GRANT SELECT ON test.t3 TO testuser@localhost;
-GRANT SELECT ON test.t4 TO testuser@localhost;
-GRANT SELECT ON test.t5 TO testuser@localhost;
-GRANT SELECT ON test.t6 TO testuser@localhost;
-GRANT SELECT ON test.t7 TO testuser@localhost;
-GRANT SELECT ON test.t8 TO testuser@localhost;
-GRANT SELECT ON test.t9 TO testuser@localhost;
-GRANT SELECT ON test.t10 TO testuser@localhost;
-GRANT SELECT (a) ON test.t1 TO testuser@localhost;
-GRANT SELECT (a) ON test.t2 TO testuser@localhost;
-GRANT SELECT (a) ON test.t3 TO testuser@localhost;
-GRANT SELECT (a) ON test.t4 TO testuser@localhost;
-GRANT SELECT (a) ON test.t5 TO testuser@localhost;
-GRANT SELECT (a) ON test.t6 TO testuser@localhost;
-GRANT SELECT (a) ON test.t7 TO testuser@localhost;
-GRANT SELECT (a) ON test.t8 TO testuser@localhost;
-GRANT SELECT (a) ON test.t9 TO testuser@localhost;
-GRANT SELECT (a) ON test.t10 TO testuser@localhost;
-commit;
-begin;
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM testuser@localhost;
-commit;
-SHOW GRANTS FOR testuser@localhost;
-DROP USER testuser@localhost;
-DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
-DROP DATABASE testdb1;
-DROP DATABASE testdb2;
-DROP DATABASE testdb3;
-DROP DATABASE testdb4;
-DROP DATABASE testdb5;
-DROP DATABASE testdb6;
-DROP DATABASE testdb7;
-DROP DATABASE testdb8;
-DROP DATABASE testdb9;
-DROP DATABASE testdb10;
-
-#
-# just SHOW PRIVILEGES test
-#
-SHOW PRIVILEGES;
-
-#
-# Alter mysql system tables back to myisam
-#
-use mysql;
-alter table columns_priv engine=myisam;
-alter table db engine=myisam;
-alter table func engine=myisam;
-alter table help_category engine=myisam;
-alter table help_keyword engine=myisam;
-alter table help_relation engine=myisam;
-alter table help_topic engine=myisam;
-alter table host engine=myisam;
-alter table tables_priv engine=myisam;
-alter table time_zone engine=myisam;
-alter table time_zone_leap_second engine=myisam;
-alter table time_zone_name engine=myisam;
-alter table time_zone_transition engine=myisam;
-alter table time_zone_transition_type engine=myisam;
-alter table user engine=myisam;
-use test;
-flush privileges;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_index.test b/mysql-test/suite/ndb/t/ndb_index.test
deleted file mode 100644
index 272f30e3e6f..00000000000
--- a/mysql-test/suite/ndb/t/ndb_index.test
+++ /dev/null
@@ -1,131 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-CREATE TABLE t1 (
- PORT varchar(16) NOT NULL,
- ACCESSNODE varchar(16) NOT NULL,
- POP varchar(48) NOT NULL,
- ACCESSTYPE int unsigned NOT NULL,
- CUSTOMER_ID varchar(20) collate latin1_bin NOT NULL,
- PROVIDER varchar(16),
- TEXPIRE int unsigned,
- NUM_IP int unsigned,
- LEASED_NUM_IP int unsigned,
- LOCKED_IP int unsigned,
- STATIC_DNS int unsigned,
- SUSPENDED_SERVICE int unsigned,
- SUSPENDED_REASON int unsigned,
- BGP_COMMUNITY int unsigned,
- INDEX CUSTOMER_ID_INDEX(CUSTOMER_ID),
- INDEX FQPN_INDEX(POP,ACCESSNODE,PORT),
- PRIMARY KEY(POP,ACCESSNODE,PORT,ACCESSTYPE)
-) engine=ndbcluster;
-
-INSERT INTO t1 VALUES ('port67', 'node78', 'pop98', 1, 'kllopmn', 'pr_43', 121212, 1, 2, 3, 8, NULL, NULL, NULL);
-INSERT INTO t1 VALUES ('port67', 'node78', 'pop99', 2, 'klkighh', 'pr_44', 121213, 3, 3, 6, 7, NULL, NULL, NULL);
-INSERT INTO t1 VALUES ('port79', 'node79', 'pop79', 2, 'kpongfaa', 'pr_44', 981213, 2, 4, 10, 11, 2, 99, 1278);
-
-
-# Test select using port
-select port, accessnode, pop, accesstype from t1 where port='port67' order by accesstype;
-select port, accessnode, pop, accesstype from t1 where port='foo';
-
-# Test select using accessnode
-select port, accessnode, pop, accesstype from t1 where accessnode='node78' order by accesstype;
-select port, accessnode, pop, accesstype from t1 where accessnode='foo';
-
-# Test select using pop
-select port, accessnode, pop, accesstype from t1 where pop='pop98';
-select port, accessnode, pop, accesstype from t1 where pop='pop98';
-select port, accessnode, pop, accesstype from t1 where pop='pop98';
-select port, accessnode, pop, accesstype from t1 where pop='pop98' order by accesstype;
-# The following two querys will not return any rows since
-# the index used for access is case sensitive
-# They are thus disabled for now
-#select port, accessnode, pop, accesstype from t1 where pop='POP98';
-#select port, accessnode, pop, accesstype from t1 where pop='POP98' order by accesstype;
-select port, accessnode, pop, accesstype from t1 where pop='foo';
-
-# Test select using accesstype
-select port, accessnode, pop, accesstype from t1 where accesstype=1;
-select port, accessnode, pop, accesstype from t1 where accesstype=2 order by port;
-select port, accessnode, pop, accesstype from t1 where accesstype=98 order by port;
-
-# Test select using customer_id
-# NOTE! customer_id has a INDEX (ordered index in NDB), it's case sensitive!
-select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn';
-select port, accessnode, pop, accesstype from t1 where customer_id='KLLOPMN';
-select port, accessnode, pop, accesstype from t1 where customer_id='kLLoPMn';
-select port, accessnode, pop, accesstype from t1 where customer_id='foo';
-
-# Test select using provider
-select port, accessnode, pop, accesstype from t1 where provider='pr_43';
-select port, accessnode, pop, accesstype from t1 where provider='foo';
-
-# Test select using texpire
-select port, accessnode from t1 where texpire=121212;
-select port, accessnode from t1 where texpire=2323;
-
-# Test select using num_ip
-select port, accessnode, pop, accesstype from t1 where num_ip=1;
-select port, accessnode, pop, accesstype from t1 where num_ip=89;
-
-# Test select using leased_num_ip
-select port, accessnode, pop, accesstype from t1 where leased_num_ip=2;
-select port, accessnode, pop, accesstype from t1 where leased_num_ip=89;
-
-# Test select using locked_ip
-select port, accessnode, pop, accesstype from t1 where locked_ip=3;
-select port, accessnode, pop, accesstype from t1 where locked_ip=89;
-
-# Test select using static_dns
-select port, accessnode, pop, accesstype from t1 where static_dns=8;
-select port, accessnode, pop, accesstype from t1 where static_dns=89;
-
-# Test select using suspended_service
-select port, accessnode, pop, accesstype from t1 where suspended_service=8;
-select port, accessnode, pop, accesstype from t1 where suspended_service=89;
-
-# Test select using suspended_reason
-select port, accessnode, pop, accesstype from t1 where suspended_reason=NULL;
-select port, accessnode, pop, accesstype from t1 where suspended_reason=89;
-select port, accessnode, pop, accesstype from t1 where suspended_reason=0;
-
-# Test select using bgp_community
-select port, accessnode, pop, accesstype from t1 where bgp_community=NULL;
-select port, accessnode, pop, accesstype from t1 where bgp_community=89;
-select port, accessnode, pop, accesstype from t1 where bgp_community=0;
-
-# Test select using full primary key
-select port, accessnode, pop, accesstype from t1 where port='port67' and accessnode='node78' and pop='pop98' and accesstype=1;
-select port, accessnode, pop, accesstype from t1 where port='port67' and accesstype=1 and accessnode='node78' and pop='pop98';
-select port, accessnode, pop, accesstype from t1 where pop='pop98' and port='port67' and accesstype=1 and accessnode='node78';
-select port, accessnode from t1 where port='foo' and accessnode='foo' and pop='foo' and accesstype=99;
-
-# Test select using partial primary key
-select port, accessnode, pop, accesstype from t1 where port='port67' and pop='pop98' and accesstype=1;
-select port, accessnode, pop, accesstype from t1 where accesstype=1 and accessnode='node78' and pop='pop98';
-select port, accessnode, pop, accesstype from t1 where port='port67' and accesstype=1 and accessnode='node78';
-select port, accessnode from t1 where port='foo' and accessnode='foo' and pop='foo';
-
-# Test select using CUSTOMER_ID_INDEX
-select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn';
-select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn' and accesstype=1;
-select port, accessnode, pop, accesstype from t1 where customer_id='kllopmn' and accesstype=2;
-select port, accessnode, pop, accesstype from t1 where accesstype=2 and customer_id='kllopmn';
-
-# Test select using FQPN_INDEX
-select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67';
-#select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' order by accesstype;
-#select port, accessnode, pop, accesstype from t1 where accessnode='node78' and port='port67' and pop='pop98' order by accesstype;
-#select port, accessnode, pop, accesstype from t1 where port='port67' and pop='pop98' and accessnode='node78' order by accesstype;
-select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='kllopmn';
-select port, accessnode, pop, accesstype from t1 where pop='pop98' and accessnode='node78' and port='port67' and customer_id='foo';
-
-drop table t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_index_ordered.test b/mysql-test/suite/ndb/t/ndb_index_ordered.test
deleted file mode 100644
index c8dfc1de59f..00000000000
--- a/mysql-test/suite/ndb/t/ndb_index_ordered.test
+++ /dev/null
@@ -1,488 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1, test1, test2;
---enable_warnings
-
-#
-# Simple test to show use of ordered indexes
-#
-
-CREATE TABLE t1 (
- a int unsigned NOT NULL PRIMARY KEY,
- b int unsigned not null,
- c int unsigned,
- KEY(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;
-select * from t1 where b = 4 order by b;
-select * from t1 where b > 4 order by b;
-select * from t1 where b < 4 order by b;
-select * from t1 where b <= 4 order by b;
-
-# Test of reset_bounds
-select tt1.* from t1 as tt1, t1 as tt2 use index(b) where tt1.b = tt2.b order by tt1.b;
-select a, b, c from t1 where a!=2 and c=6;
-select a, b, c from t1 where a!=2 order by a;
-
-#
-# Here we should add some "explain select" to verify that the ordered index is
-# used for these queries.
-#
-
-#
-# Update using ordered index scan
-#
-
-update t1 set c = 3 where b = 3;
-select * from t1 order by a;
-update t1 set c = 10 where b >= 6;
-select * from t1 order by a;
-update t1 set c = 11 where b < 5;
-select * from t1 order by a;
-update t1 set c = 12 where b > 0;
-select * from t1 order by a;
-update t1 set c = 13 where b <= 3;
-select * from t1 order by a;
-update t1 set b = b + 1 where b > 4 and b < 7;
-select * from t1 order by a;
-# Update primary key
-update t1 set a = a + 10 where b > 1 and b < 7;
-select * from t1 order by a;
-
-#
-# Delete using ordered index scan
-#
-
-drop table t1;
-
-CREATE TABLE t1 (
- a int unsigned NOT NULL PRIMARY KEY,
- b int unsigned not null,
- c int unsigned,
- KEY(b)
-) engine=ndbcluster;
-
-insert t1 values(1, 2, 13), (2,3, 13), (3, 4, 12), (4, 5, 12), (5,6, 12), (6,7, 12);
-
-delete from t1 where b = 3;
-select * from t1 order by a;
-delete from t1 where b >= 6;
-select * from t1 order by a;
-delete from t1 where b < 4;
-select * from t1 order by a;
-delete from t1 where b > 5;
-select * from t1 order by a;
-delete from t1 where b <= 4;
-select * from t1 order by a;
-
-drop table t1;
-
-
-#
-#multi part key
-#
-CREATE TABLE t1 (
- a int unsigned NOT NULL PRIMARY KEY,
- b int unsigned not null,
- c int unsigned not null
-) engine = ndb;
-
-create index a1 on t1 (b, c);
-
-insert into t1 values (1, 2, 13);
-insert into t1 values (2,3, 13);
-insert into t1 values (3, 4, 12);
-insert into t1 values (4, 5, 12);
-insert into t1 values (5,6, 12);
-insert into t1 values (6,7, 12);
-insert into t1 values (7, 2, 1);
-insert into t1 values (8,3, 6);
-insert into t1 values (9, 4, 12);
-insert into t1 values (14, 5, 4);
-insert into t1 values (15,5,5);
-insert into t1 values (16,5, 6);
-insert into t1 values (17,4,4);
-insert into t1 values (18,1, 7);
-
-
-
-select * from t1 order by a;
-select * from t1 where b<=5 order by a;
-select * from t1 where b<=5 and c=0;
-insert into t1 values (19,4, 0);
-select * from t1 where b<=5 and c=0;
-select * from t1 where b=4 and c<=5 order by a;
-select * from t1 where b<=4 and c<=5 order by a;
-select * from t1 where b<=5 and c=0 or b<=5 and c=2;
-
-select count(*) from t1 where b = 0;
-select count(*) from t1 where b = 1;
-drop table t1;
-
-#
-# Indexing NULL values
-#
-
-CREATE TABLE t1 (
- a int unsigned NOT NULL PRIMARY KEY,
- b int unsigned,
- c int unsigned,
- KEY 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;
-drop table t1;
-
-#
-# Order by again, including descending.
-#
-
-create table t1 (
- a int unsigned primary key,
- b int unsigned,
- c char(10),
- key bc (b, c)
-) engine=ndb;
-
-insert into t1 values(1,1,'a'),(2,2,'b'),(3,3,'c'),(4,4,'d'),(5,5,'e');
-insert into t1 select a*7,10*b,'f' from t1;
-insert into t1 select a*13,10*b,'g' from t1;
-insert into t1 select a*17,10*b,'h' from t1;
-insert into t1 select a*19,10*b,'i' from t1;
-insert into t1 select a*23,10*b,'j' from t1;
-insert into t1 select a*29,10*b,'k' from t1;
-#
-select b, c from t1 where b <= 10 and c <'f' order by b, c;
-select b, c from t1 where b <= 10 and c <'f' order by b desc, c desc;
-#
-select b, c from t1 where b=4000 and c<'k' order by b, c;
-select b, c from t1 where b=4000 and c<'k' order by b desc, c desc;
-select b, c from t1 where 1000<=b and b<=100000 and c<'j' order by b, c;
-select b, c from t1 where 1000<=b and b<=100000 and c<'j' order by b desc, c desc;
-#
-select min(b), max(b) from t1;
-#
-drop table t1;
-
-#
-# Bug #6435
-CREATE TABLE test1 (
-SubscrID int(11) NOT NULL auto_increment,
-UsrID int(11) NOT NULL default '0',
-PRIMARY KEY (SubscrID),
-KEY idx_usrid (UsrID)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-
-INSERT INTO test1 VALUES (2,224),(3,224),(1,224);
-
-CREATE TABLE test2 (
-SbclID int(11) NOT NULL auto_increment,
-SbcrID int(11) NOT NULL default '0',
-PRIMARY KEY (SbclID),
-KEY idx_sbcrid (SbcrID)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-
-INSERT INTO test2 VALUES (3,2),(1,1),(2,1),(4,2);
-select * from test1 order by 1;
-select * from test2 order by 1;
-SELECT s.SubscrID,l.SbclID FROM test1 s left JOIN test2 l ON
-l.SbcrID=s.SubscrID WHERE s.UsrID=224 order by 1, 2;
-drop table test1;
-drop table test2;
-
-# bug#7424 + bug#7725
-
-create table t1 (
- pk int primary key,
- dt datetime not null,
- da date not null,
- ye year not null,
- ti time not null,
- ts timestamp not null,
- index(dt),
- index(da),
- index(ye),
- index(ti),
- index(ts)
-) engine=ndb;
-
-insert into t1 (pk,dt,da,ye,ti,ts) values
- (1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59', '2001-01-01 23:00:59'),
- (2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59', '2001-01-01 13:00:59'),
- (3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00', '2001-01-01 00:00:00'),
- (4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00', '2001-01-01 00:00:00'),
- (5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06', '2001-01-01 06:06:06'),
- (6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06', '2001-01-01 06:06:06'),
- (7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10', '2001-01-01 10:11:10'),
- (8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11', '2001-01-01 10:11:11'),
- (9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59', '2001-01-01 23:59:59');
-
-# datetime
-select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00';
-select count(*)-6 from t1 use index (dt) where dt >= '1955-12-31 00:00:00';
-select count(*)-5 from t1 use index (dt) where dt > '1955-12-31 00:00:00';
-select count(*)-5 from t1 use index (dt) where dt < '1970-03-03 22:22:22';
-select count(*)-7 from t1 use index (dt) where dt < '2001-01-01 10:11:11';
-select count(*)-8 from t1 use index (dt) where dt <= '2001-01-01 10:11:11';
-select count(*)-9 from t1 use index (dt) where dt <= '2055-01-01 00:00:00';
-
-# date
-select count(*)-9 from t1 use index (da) where da > '1900-01-01';
-select count(*)-6 from t1 use index (da) where da >= '1955-12-31';
-select count(*)-5 from t1 use index (da) where da > '1955-12-31';
-select count(*)-5 from t1 use index (da) where da < '1970-03-03';
-select count(*)-6 from t1 use index (da) where da < '2001-01-01';
-select count(*)-8 from t1 use index (da) where da <= '2001-01-02';
-select count(*)-9 from t1 use index (da) where da <= '2055-01-01';
-
-# year
-select count(*)-9 from t1 use index (ye) where ye > '1900';
-select count(*)-6 from t1 use index (ye) where ye >= '1955';
-select count(*)-5 from t1 use index (ye) where ye > '1955';
-select count(*)-5 from t1 use index (ye) where ye < '1970';
-select count(*)-6 from t1 use index (ye) where ye < '2001';
-select count(*)-8 from t1 use index (ye) where ye <= '2001';
-select count(*)-9 from t1 use index (ye) where ye <= '2055';
-
-# time
-select count(*)-9 from t1 use index (ti) where ti >= '00:00:00';
-select count(*)-7 from t1 use index (ti) where ti > '00:00:00';
-select count(*)-7 from t1 use index (ti) where ti > '05:05:05';
-select count(*)-5 from t1 use index (ti) where ti > '06:06:06';
-select count(*)-5 from t1 use index (ti) where ti < '10:11:11';
-select count(*)-6 from t1 use index (ti) where ti <= '10:11:11';
-select count(*)-8 from t1 use index (ti) where ti < '23:59:59';
-select count(*)-9 from t1 use index (ti) where ti <= '23:59:59';
-
-# timestamp
-select count(*)-9 from t1 use index (ts) where ts >= '2001-01-01 00:00:00';
-select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 00:00:00';
-select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 05:05:05';
-select count(*)-5 from t1 use index (ts) where ts > '2001-01-01 06:06:06';
-select count(*)-5 from t1 use index (ts) where ts < '2001-01-01 10:11:11';
-select count(*)-6 from t1 use index (ts) where ts <= '2001-01-01 10:11:11';
-select count(*)-8 from t1 use index (ts) where ts < '2001-01-01 23:59:59';
-select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59';
-
-drop table t1;
-
-# decimal (not the new 5.0 thing)
-
-create table t1 (
- a int primary key,
- s decimal(12),
- t decimal(12, 5),
- u decimal(12) unsigned,
- v decimal(12, 5) unsigned,
- key (s),
- key (t),
- key (u),
- key (v)
-) engine=ndb;
-#
-insert into t1 values
- ( 0, -000000000007, -0000061.00003, 000000000061, 0000965.00042),
- ( 1, -000000000007, -0000061.00042, 000000000061, 0000965.00003),
- ( 2, -071006035767, 4210253.00024, 000000000001, 0000001.84488),
- ( 3, 000000007115, 0000000.77607, 000077350625, 0000018.00013),
- ( 4, -000000068391, -0346486.00000, 000000005071, 0005334.00002),
- ( 5, -521579890459, -1936874.00001, 000000000154, 0000003.00018),
- ( 6, -521579890459, -1936874.00018, 000000000154, 0000003.00001),
- ( 7, 000000000333, 0000051.39140, 000000907958, 0788643.08374),
- ( 8, 000042731229, 0000009.00000, 000000000009, 6428667.00000),
- ( 9, -000008159769, 0000918.00004, 000096951421, 7607730.00008);
-#
-select count(*)- 5 from t1 use index (s) where s < -000000000007;
-select count(*)- 7 from t1 use index (s) where s <= -000000000007;
-select count(*)- 2 from t1 use index (s) where s = -000000000007;
-select count(*)- 5 from t1 use index (s) where s >= -000000000007;
-select count(*)- 3 from t1 use index (s) where s > -000000000007;
-#
-select count(*)- 4 from t1 use index (t) where t < -0000061.00003;
-select count(*)- 5 from t1 use index (t) where t <= -0000061.00003;
-select count(*)- 1 from t1 use index (t) where t = -0000061.00003;
-select count(*)- 6 from t1 use index (t) where t >= -0000061.00003;
-select count(*)- 5 from t1 use index (t) where t > -0000061.00003;
-#
-select count(*)- 2 from t1 use index (u) where u < 000000000061;
-select count(*)- 4 from t1 use index (u) where u <= 000000000061;
-select count(*)- 2 from t1 use index (u) where u = 000000000061;
-select count(*)- 8 from t1 use index (u) where u >= 000000000061;
-select count(*)- 6 from t1 use index (u) where u > 000000000061;
-#
-select count(*)- 5 from t1 use index (v) where v < 0000965.00042;
-select count(*)- 6 from t1 use index (v) where v <= 0000965.00042;
-select count(*)- 1 from t1 use index (v) where v = 0000965.00042;
-select count(*)- 5 from t1 use index (v) where v >= 0000965.00042;
-select count(*)- 4 from t1 use index (v) where v > 0000965.00042;
-
-drop table t1;
-
-#
-# Disabled due to WL#4284
-#
-# Needs to be reworked. It's not possible anymore to do a non-fast alter table
-# on a table that is being used by a pending transaction (transaction holds a
-# metadata lock on the table).
-#
-# bug#7798
-# create table t1(a int primary key, b int not null, c int, index(b));
-# insert into t1 values (1,1,1), (2,2,2);
-# connect (con1,localhost,root,,test);
-# connect (con2,localhost,root,,test);
-# connection con1;
-# set autocommit=0;
-# begin;
-# select count(*) from t1;
-# connection con2;
-# ALTER TABLE t1 ADD COLUMN c int
-# connection con1;
-# select a from t1 where b = 2;
-# show tables;
-# drop table t1;
-#
-
-# mysqld 5.0.13 crash, no bug#
-create table t1 (a int, c varchar(10),
- primary key using hash (a), index(c)) engine=ndb;
-insert into t1 (a, c) values (1,'aaa'),(3,'bbb');
-select count(*) from t1 where c<'bbb';
-drop table t1;
-
-# -- index statistics --
-
-set autocommit=1;
-show session variables like 'ndb_index_stat_%';
-
-set ndb_index_stat_enable = off;
-show session variables like 'ndb_index_stat_%';
-
-create table t1 (a int, b int, c varchar(10) not null,
- primary key using hash (a), index(b,c)) engine=ndb;
-insert into t1 values
- (1,10,'aaa'),(2,10,'bbb'),(3,10,'ccc'),
- (4,20,'aaa'),(5,20,'bbb'),(6,20,'ccc'),
- (7,30,'aaa'),(8,30,'bbb'),(9,30,'ccc');
-select count(*) from t1 where b < 10;
-select count(*) from t1 where b >= 10 and c >= 'bbb';
-select count(*) from t1 where b > 10;
-select count(*) from t1 where b <= 20 and c < 'ccc';
-select count(*) from t1 where b = 20 and c = 'ccc';
-select count(*) from t1 where b > 20;
-select count(*) from t1 where b = 30 and c > 'aaa';
-select count(*) from t1 where b <= 20;
-select count(*) from t1 where b >= 20 and c > 'aaa';
-drop table t1;
-
-set ndb_index_stat_enable = on;
-set ndb_index_stat_cache_entries = 0;
-show session variables like 'ndb_index_stat_%';
-
-create table t1 (a int, b int, c varchar(10) not null,
- primary key using hash (a), index(b,c)) engine=ndb;
-insert into t1 values
- (1,10,'aaa'),(2,10,'bbb'),(3,10,'ccc'),
- (4,20,'aaa'),(5,20,'bbb'),(6,20,'ccc'),
- (7,30,'aaa'),(8,30,'bbb'),(9,30,'ccc');
-select count(*) from t1 where b < 10;
-select count(*) from t1 where b >= 10 and c >= 'bbb';
-select count(*) from t1 where b > 10;
-select count(*) from t1 where b <= 20 and c < 'ccc';
-select count(*) from t1 where b = 20 and c = 'ccc';
-select count(*) from t1 where b > 20;
-select count(*) from t1 where b = 30 and c > 'aaa';
-select count(*) from t1 where b <= 20;
-select count(*) from t1 where b >= 20 and c > 'aaa';
-drop table t1;
-
-set ndb_index_stat_enable = on;
-set ndb_index_stat_cache_entries = 4;
-set ndb_index_stat_update_freq = 2;
-show session variables like 'ndb_index_stat_%';
-
-create table t1 (a int, b int, c varchar(10) not null,
- primary key using hash (a), index(b,c)) engine=ndb;
-insert into t1 values
- (1,10,'aaa'),(2,10,'bbb'),(3,10,'ccc'),
- (4,20,'aaa'),(5,20,'bbb'),(6,20,'ccc'),
- (7,30,'aaa'),(8,30,'bbb'),(9,30,'ccc');
-select count(*) from t1 where b < 10;
-select count(*) from t1 where b >= 10 and c >= 'bbb';
-select count(*) from t1 where b > 10;
-select count(*) from t1 where b <= 20 and c < 'ccc';
-select count(*) from t1 where b = 20 and c = 'ccc';
-select count(*) from t1 where b > 20;
-select count(*) from t1 where b = 30 and c > 'aaa';
-select count(*) from t1 where b <= 20;
-select count(*) from t1 where b >= 20 and c > 'aaa';
-drop table t1;
-
-set ndb_index_stat_enable = @@global.ndb_index_stat_enable;
-set ndb_index_stat_cache_entries = @@global.ndb_index_stat_cache_entries;
-set ndb_index_stat_update_freq = @@global.ndb_index_stat_update_freq;
-show session variables like 'ndb_index_stat_%';
-
-# End of 4.1 tests
-
-# bug#24039
-
-create table t1 (a int primary key) engine = ndb;
-insert into t1 values (1), (2), (3);
-begin;
-delete from t1 where a > 1;
-rollback;
-select * from t1 order by a;
-begin;
-delete from t1 where a > 1;
-rollback;
-
-begin;
-select * from t1 order by a;
-delete from t1 where a > 2;
-select * from t1 order by a;
-delete from t1 where a > 1;
-select * from t1 order by a;
-delete from t1 where a > 0;
-select * from t1 order by a;
-rollback;
-select * from t1 order by a;
-delete from t1;
-drop table t1;
-
-# bug#24820 CREATE INDEX ....USING HASH on NDB table creates ordered index, not HASH index
-
---error ER_CANT_CREATE_TABLE
-create table nationaldish (DishID int(10) unsigned NOT NULL AUTO_INCREMENT,
- CountryCode char(3) NOT NULL,
- DishTitle varchar(64) NOT NULL,
- calories smallint(5) unsigned DEFAULT NULL,
- PRIMARY KEY (DishID),
- INDEX i USING HASH (countrycode,calories)
- ) ENGINE=ndbcluster;
-
-create table nationaldish (DishID int(10) unsigned NOT NULL AUTO_INCREMENT,
- CountryCode char(3) NOT NULL,
- DishTitle varchar(64) NOT NULL,
- calories smallint(5) unsigned DEFAULT NULL,
- PRIMARY KEY (DishID)
- ) ENGINE=ndbcluster;
-
---error ER_UNSUPPORTED_EXTENSION
-create index i on nationaldish(countrycode,calories) using hash;
-
-drop table nationaldish;
diff --git a/mysql-test/suite/ndb/t/ndb_index_unique.test b/mysql-test/suite/ndb/t/ndb_index_unique.test
deleted file mode 100644
index 9178ace1ad0..00000000000
--- a/mysql-test/suite/ndb/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
-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_optimizer_switch = @@session.optimizer_switch;
-set optimizer_switch = "engine_condition_pushdown=on";
-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 optimizer_switch = @old_optimizer_switch;
-
-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
deleted file mode 100644
index d659f8357f2..00000000000
--- a/mysql-test/suite/ndb/t/ndb_insert.test
+++ /dev/null
@@ -1,641 +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
-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/suite/ndb/t/ndb_limit.test b/mysql-test/suite/ndb/t/ndb_limit.test
deleted file mode 100644
index 01613606d66..00000000000
--- a/mysql-test/suite/ndb/t/ndb_limit.test
+++ /dev/null
@@ -1,85 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t2;
---enable_warnings
-
-
-CREATE TABLE t2 (
- a bigint unsigned NOT NULL PRIMARY KEY,
- b int unsigned not null,
- c int unsigned
-) engine=ndbcluster;
-
-
-#
-# insert records into table
-#
-let $1=1000;
-disable_query_log;
-while ($1)
-{
- eval insert into t2 values($1*10, $1+9, 5*$1), ($1*10+1, $1+10, 7),($1*10+2, $1+10, 7*$1), ($1*10+3, $1+10, 10+$1), ($1*10+4, $1+10, 70*$1), ($1*10+5, $1+10, 7), ($1*10+6, $1+10, 9), ($1*10+7, $1+299, 899), ($1*10+8, $1+10, 12), ($1*10+9, $1+10, 14*$1);
- dec $1;
-}
-enable_query_log;
-
-select count(*) from t2;
-
-delete from t2 limit 1;
-select count(*) from t2;
-
-delete from t2 limit 100;
-select count(*) from t2;
-
-delete from t2 limit 1000;
-select count(*) from t2;
-
-update t2 set c=12345678 limit 100;
-select count(*) from t2 where c=12345678;
-select count(*) from t2 where c=12345678 limit 1000;
-
-select * from t2 limit 0;
-
-drop table t2;
-
-CREATE TABLE `t2` (
- `views` int(11) NOT NULL default '0',
- `clicks` int(11) NOT NULL default '0',
- `day` date NOT NULL default '0000-00-00',
- `hour` tinyint(4) NOT NULL default '0',
- `bannerid` smallint(6) NOT NULL default '0',
- `zoneid` smallint(6) NOT NULL default '0',
- `source` varchar(50) NOT NULL default '',
- PRIMARY KEY (`day`,`hour`,`bannerid`,`zoneid`,`source`),
- KEY `bannerid_day` (`bannerid`,`day`),
- KEY `zoneid` (`zoneid`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
-
-INSERT INTO `t2` VALUES
-( 1,0,'2004-09-17', 5,100,100,''),
-( 1,0,'2004-09-18', 7,100,100,''),
-( 17,0,'2004-09-27',20,132,100,''),
-( 4,0,'2004-09-16',23,132,100,''),
-( 86,0,'2004-09-18', 7,196,196,''),
-( 11,0,'2004-09-16',16,132,100,''),
-(140,0,'2004-09-18', 0,100,164,''),
-( 2,0,'2004-09-17', 7,132,100,''),
-(846,0,'2004-09-27',11,132,164,''),
-( 1,0,'2004-09-18', 8,132,100,''),
-( 22,0,'2004-09-27', 9,164,132,''),
-(711,0,'2004-09-27', 9,100,164,''),
-( 11,0,'2004-09-18', 0,196,132,''),
-( 41,0,'2004-09-27',15,196,132,''),
-( 57,0,'2004-09-18', 2,164,196,'');
-
-SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y')
-as date_formatted FROM t2 GROUP BY day ORDER BY day DESC;
-
-SELECT DATE_FORMAT(day, '%Y%m%d') as date, DATE_FORMAT(day, '%d-%m-%Y')
-as date_formatted FROM t2 GROUP BY day ORDER BY day DESC LIMIT 2;
-
-drop table t2;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_load.test b/mysql-test/suite/ndb/t/ndb_load.test
deleted file mode 100644
index aa48b3dfdcf..00000000000
--- a/mysql-test/suite/ndb/t/ndb_load.test
+++ /dev/null
@@ -1,24 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-#
-# Basic test for different types of loading data
-#
-
-# should give duplicate key
-CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=NDB;
---error 1022
-LOAD DATA INFILE '../../../std_data/words.dat' INTO TABLE t1 ;
-DROP TABLE t1;
-
-# now without a primary key we should be ok
-CREATE TABLE t1 (word CHAR(20) NOT NULL) ENGINE=NDB;
-LOAD DATA INFILE '../../../std_data/words.dat' INTO TABLE t1 ;
-SELECT * FROM t1 ORDER BY word;
-DROP TABLE t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_loaddatalocal.test b/mysql-test/suite/ndb/t/ndb_loaddatalocal.test
deleted file mode 100644
index 257a26087b7..00000000000
--- a/mysql-test/suite/ndb/t/ndb_loaddatalocal.test
+++ /dev/null
@@ -1,71 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-create table t1(a int) engine=myisam;
-let $1=10000;
-disable_query_log;
-set SQL_LOG_BIN=0;
-while ($1)
-{
- insert into t1 values(1);
- dec $1;
-}
-set SQL_LOG_BIN=1;
-let $MYSQLD_DATADIR= `select @@datadir`;
-enable_query_log;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval select * into outfile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
-#This will generate a 20KB file, now test LOAD DATA LOCAL
-drop table t1;
-
-create table t1(a int) engine=ndb;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval load data local infile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
-select count(*) from t1;
---remove_file $MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile
-drop table t1;
-
-create table t1(a int) engine=myisam;
-insert into t1 values (1), (2), (2), (3);
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval select * into outfile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
-drop table t1;
-
-create table t1(a int primary key) engine=ndb;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval load data local infile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
---remove_file $MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile
-select * from t1 order by a;
-drop table t1;
-
-create table t1(a int) engine=myisam;
-insert into t1 values (1), (1), (2), (3);
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval select * into outfile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
-drop table t1;
-
-create table t1(a int primary key) engine=ndb;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval load data local infile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
---remove_file $MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile
-select * from t1 order by a;
-drop table t1;
-
-create table t1(a int) engine=myisam;
-insert into t1 values (1), (2), (3), (3);
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval select * into outfile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' from t1;
-drop table t1;
-
-create table t1(a int primary key) engine=ndb;
---replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
-eval load data local infile '$MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile' into table t1;
---remove_file $MYSQLD_DATADIR/ndb_loaddatalocal.select_outfile
-select * from t1 order by a;
-drop table t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_lock.test b/mysql-test/suite/ndb/t/ndb_lock.test
deleted file mode 100644
index b6cd1ca7eb4..00000000000
--- a/mysql-test/suite/ndb/t/ndb_lock.test
+++ /dev/null
@@ -1,269 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
-connect (con1,localhost,root,,);
-connect (con2,localhost,root,,);
-
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
---enable_warnings
-
-#
-# Transaction lock test to show that the NDB
-# table handler is working properly with
-# transaction locks
-#
-
-#
-# Testing of scan isolation
-#
-connection con1;
-create table t1 (x integer not null primary key, y varchar(32)) engine = ndb;
-insert into t1 values (1,'one'), (2,'two');
-select * from t1 order by x;
-
-connection con2;
-select * from t1 order by x;
-
-connection con1;
-start transaction;
-insert into t1 values (3,'three');
-select * from t1 order by x;
-
-connection con2;
-start transaction;
-select * from t1 order by x;
-
-connection con1;
-commit;
-
-connection con2;
-select * from t1 order by x;
-commit;
-
-drop table t1;
-
-###
-# Bug#6020
-create table t1 (pk integer not null primary key, u int not null, o int not null,
- unique(u), key(o)) engine = ndb;
-insert into t1 values (1,1,1), (2,2,2), (3,3,3), (4,4,4), (5,5,5);
-
-lock tables t1 write;
-delete from t1 where pk = 1;
-unlock tables;
-select * from t1 order by pk;
-insert into t1 values (1,1,1);
-
-lock tables t1 write;
-delete from t1 where u = 1;
-unlock tables;
-select * from t1 order by pk;
-insert into t1 values (1,1,1);
-
-lock tables t1 write;
-delete from t1 where o = 1;
-unlock tables;
-select * from t1 order by pk;
-insert into t1 values (1,1,1);
-
-drop table t1;
-
-# Lock for update
-
-create table t1 (x integer not null primary key, y varchar(32), z integer, key(z)) engine = ndb;
-
-insert into t1 values (1,'one',1);
-
-# PK access
-connection con1;
-begin;
-select * from t1 where x = 1 for update;
-
-connection con2;
-begin;
---error 1205
-select * from t1 where x = 1 for update;
-rollback;
-
-connection con1;
-rollback;
-insert into t1 values (2,'two',2),(3,"three",3);
-begin;
-select * from t1 where x = 1 for update;
-
-connection con2;
---error 1205
-select * from t1 where x = 1 for update;
-select * from t1 where x = 2 for update;
-rollback;
-
-connection con1;
-commit;
-
-# table scan
-#
-# Note that there are two distinct execution paths in which we unlock
-# non-matching rows inspected during table scan - one that is used in
-# case of filesort and one that used in rest of cases. Below we cover
-# the latter (Bug #20390 "SELECT FOR UPDATE does not release locks of
-# untouched rows in full table scans").
-connection con1;
-begin;
-# We can't use "order by x" here as it will cause filesort
---replace_column 1 # 2 # 3 #
-select * from t1 where y = 'one' or y = 'three' for update;
-
-connection con2;
-begin;
-# Have to check with pk access here since scans take locks on
-# all rows and then release them in chunks
-select * from t1 where x = 2 for update;
---error 1205
-select * from t1 where x = 1 for update;
-rollback;
-
-connection con1;
-commit;
-
-# And now the test for case with filesort
-begin;
-select * from t1 where y = 'one' or y = 'three' order by x for update;
-connection con2;
-begin;
-select * from t1 where x = 2 for update;
---error 1205
-select * from t1 where x = 1 for update;
-rollback;
-
-connection con1;
-commit;
-
-# index scan
-connection con1;
-begin;
-select * from t1 where z > 1 and z < 3 for update;
-
-connection con2;
-begin;
-# Have to check with pk access here since scans take locks on
-# all rows and then release them in chunks
-select * from t1 where x = 1 for update;
---error 1105,1205
-select * from t1 where x = 2 for update;
-rollback;
-
-connection con1;
-commit;
-
-# share locking
-
-# PK access
-connection con1;
-begin;
-select * from t1 where x = 1 lock in share mode;
-
-connection con2;
-begin;
-select * from t1 where x = 1 lock in share mode;
-select * from t1 where x = 2 for update;
---error 1205
-select * from t1 where x = 1 for update;
-rollback;
-
-connection con1;
-commit;
-
-# table scan
-connection con1;
-begin;
-# We can't use "order by x" here as it will cause filesort
---replace_column 1 # 2 # 3 #
-select * from t1 where y = 'one' or y = 'three' lock in share mode;
-
-connection con2;
-begin;
-select * from t1 where y = 'one' lock in share mode;
-# Have to check with pk access here since scans take locks on
-# all rows and then release them in chunks
-select * from t1 where x = 2 for update;
---error 1205
-select * from t1 where x = 1 for update;
-rollback;
-
-connection con1;
-commit;
-
-# And the same test for case with filesort
-connection con1;
-begin;
-select * from t1 where y = 'one' or y = 'three' order by x lock in share mode;
-
-connection con2;
-begin;
-select * from t1 where y = 'one' lock in share mode;
-select * from t1 where x = 2 for update;
---error 1205
-select * from t1 where x = 1 for update;
-rollback;
-
-connection con1;
-commit;
-
-# index scan
-connection con1;
-begin;
-select * from t1 where z > 1 and z < 3 lock in share mode;
-
-connection con2;
-begin;
-select * from t1 where z = 1 lock in share mode;
-# Have to check with pk access here since scans take locks on
-# all rows and then release them in chunks
-select * from t1 where x = 1 for update;
---error 1205
-select * from t1 where x = 2 for update;
-rollback;
-
-connection con1;
-commit;
-
-drop table t1;
-
-# End of 4.1 tests
-
-#
-# Bug #17812 Previous lock table for write causes "stray" lock
-# although table is recreated
-#
-# this creating, locking, and dropping causes a subsequent hang
-# on the delete below waiting for table t2 the locking in the
-# "other" connection is relevant, as without it there is no problem
-#
-connection con1;
-create table t3 (id2 int) engine=ndb;
-
-connection con2;
-lock tables t3 write;
-unlock tables;
-
-connection con1;
-drop table t3;
-
-connection con1;
-create table t2 (id int, j int) engine=ndb;
-insert into t2 values (2, 2);
-create table t3 (id int) engine=ndb;
-
-connection con2;
-lock tables t3 read;
-
-connection con1;
-# here we get a hang before bugfix although we shouldn't
-delete t2 from t2, t3 where t2.id = t3.id;
-
-connection con2;
-unlock tables;
-
-connection con1;
-drop table t2, t3;
diff --git a/mysql-test/suite/ndb/t/ndb_lock_table.test b/mysql-test/suite/ndb/t/ndb_lock_table.test
deleted file mode 100644
index 6c21e8e8232..00000000000
--- a/mysql-test/suite/ndb/t/ndb_lock_table.test
+++ /dev/null
@@ -1,15 +0,0 @@
--- source include/have_ndb.inc
-
-# BUG 30996
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (a int) engine ndb;
-set autocommit=1;
-lock table t1 write;
-set autocommit=0;
-insert into t1 values (0);
-rollback;
-select * from t1;
-unlock tables;
-drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_minmax.test b/mysql-test/suite/ndb/t/ndb_minmax.test
deleted file mode 100644
index a3ac677cd2a..00000000000
--- a/mysql-test/suite/ndb/t/ndb_minmax.test
+++ /dev/null
@@ -1,65 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
-
-CREATE TABLE t1 (
- a int PRIMARY KEY
-) engine = ndb;
-
-INSERT INTO t1 VALUES (1);
-INSERT INTO t1 VALUES (2);
-INSERT INTO t1 VALUES (3);
-INSERT INTO t1 VALUES (4);
-INSERT INTO t1 VALUES (5);
-INSERT INTO t1 VALUES (6);
-
-select MAX(a) from t1;
-select MAX(a) from t1;
-select MAX(a) from t1;
-select MAX(a) from t1;
-select MIN(a) from t1;
-select MIN(a) from t1;
-select MIN(a) from t1;
-select * from t1 order by a;
-select MIN(a) from t1;
-select MAX(a) from t1;
-select MAX(a) from t1;
-select * from t1 order by a;
-drop table t1;
-
-
-CREATE TABLE t2 (
- a int PRIMARY KEY,
- b int not null,
- c int not null,
- KEY(b),
- UNIQUE(c)
-) engine = ndb;
-
-INSERT INTO t2 VALUES (1, 5, 1);
-INSERT INTO t2 VALUES (2, 2, 7);
-INSERT INTO t2 VALUES (3, 3, 3);
-INSERT INTO t2 VALUES (4, 4, 4);
-INSERT INTO t2 VALUES (5, 5, 5);
-INSERT INTO t2 VALUES (6, 6, 6);
-INSERT INTO t2 VALUES (7, 2, 10);
-INSERT INTO t2 VALUES (8, 10, 2);
-
-
-select MAX(a) from t2;
-select MAX(b) from t2;
-select MAX(c) from t2;
-select MIN(a) from t2;
-select MIN(b) from t2;
-select MIN(c) from t2;
-select * from t2 order by a;
-select MIN(b) from t2;
-select MAX(a) from t2;
-select MAX(c) from t2;
-select * from t2 order by a;
-drop table t2;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_multi.test b/mysql-test/suite/ndb/t/ndb_multi.test
deleted file mode 100644
index e033ad1e479..00000000000
--- a/mysql-test/suite/ndb/t/ndb_multi.test
+++ /dev/null
@@ -1,154 +0,0 @@
--- source include/have_multi_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-connection server2;
-drop table if exists t1, t2, t3, t4;
-flush status;
-connection server1;
-drop table if exists t1, t2, t3, t4;
-flush status;
---enable_warnings
-
-# 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;
-
-
-#
-# bug#31470, ndb table with special characters in name
-# are not discovered correctly
-connection server1;
-use test;
-create table `test`.`t1$EX`
- (server_id int unsigned,
- master_server_id int unsigned,
- master_epoch bigint unsigned,
- count int unsigned,
- primary key(server_id, master_server_id,
- master_epoch, count))
- engine ndb;
-
-# check that table shows up ok on both servers
-# before bugfix table would not show up on server2
---replace_regex /EX/ex/
-show tables like '%$%';
-connection server2;
-use test;
---replace_regex /EX/ex/
-show tables like '%$%';
-
-# check cleanup
-drop table `test`.`t1$EX`;
-show tables like '%$%';
-
-connection server1;
-show tables like '%$%';
diff --git a/mysql-test/suite/ndb/t/ndb_multi_row.test b/mysql-test/suite/ndb/t/ndb_multi_row.test
deleted file mode 100644
index 26953093ed0..00000000000
--- a/mysql-test/suite/ndb/t/ndb_multi_row.test
+++ /dev/null
@@ -1,76 +0,0 @@
--- 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;
-flush status;
-connection server1;
-drop table if exists t1, t2, t3, t4;
-flush status;
---enable_warnings
-
-
-# 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/suite/ndb/t/ndb_partition_error.test b/mysql-test/suite/ndb/t/ndb_partition_error.test
deleted file mode 100644
index 9db2a6a6f6d..00000000000
--- a/mysql-test/suite/ndb/t/ndb_partition_error.test
+++ /dev/null
@@ -1,74 +0,0 @@
--- source include/have_ndb.inc
-#--disable_abort_on_error
-#
-# Simple test for the partition storage engine
-# Focuses on range partitioning tests
-#
-#-- source include/have_partition.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
---disable_query_log
-set new=on;
---enable_query_log
-#
-# Partition by range, generate node group error
-#
---error 1005
-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) nodegroup 12,
- partition x2 values less than (10) nodegroup 13,
- partition x3 values less than (20) nodegroup 14);
-show warnings;
-
-#
-# Partition by range, create normal valid table
-#
-CREATE TABLE t1 (
-a int not null,
-b int not null,
-c int not null,
-primary key(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));
-
-drop table t1;
-
-#
-# Bug #17763 mysqld cores with list partitioning if update to missing partition
-#
-CREATE TABLE t1 (id INT) ENGINE=NDB
- PARTITION BY LIST(id)
- (PARTITION p0 VALUES IN (2, 4),
- PARTITION p1 VALUES IN (42, 142));
-INSERT INTO t1 VALUES (2);
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-UPDATE t1 SET id=5 WHERE id=2;
-DROP TABLE t1;
-
-#
-# NULL for LIST partition
-#
-create table t1 (a int,b int, c int)
-engine = ndb
-partition by list(a)
-partitions 2
-(partition x123 values in (11, 12),
- partition x234 values in (5, 1));
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-insert into t1 values (NULL,1,1);
-drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_partition_error2-master.opt b/mysql-test/suite/ndb/t/ndb_partition_error2-master.opt
deleted file mode 100644
index 955f7692c8b..00000000000
--- a/mysql-test/suite/ndb/t/ndb_partition_error2-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---ndbcluster
diff --git a/mysql-test/suite/ndb/t/ndb_partition_error2.test b/mysql-test/suite/ndb/t/ndb_partition_error2.test
deleted file mode 100644
index afedd0e3c5c..00000000000
--- a/mysql-test/suite/ndb/t/ndb_partition_error2.test
+++ /dev/null
@@ -1,14 +0,0 @@
-disable_query_log;
---require r/true.require
-select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
-enable_query_log;
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-#
-# Bug #27359 Partitions: memory allocation error message
-#
---error ER_PARTITION_NOT_DEFINED_ERROR
-create table t1 (s1 int) engine=ndbcluster;
-
diff --git a/mysql-test/suite/ndb/t/ndb_partition_key.test b/mysql-test/suite/ndb/t/ndb_partition_key.test
deleted file mode 100644
index a3898407445..00000000000
--- a/mysql-test/suite/ndb/t/ndb_partition_key.test
+++ /dev/null
@@ -1,244 +0,0 @@
--- source include/have_ndb.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-#
-# Basic syntax test
-#
-
-# Support for partition key verified
-CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b,c))
- ENGINE = NDB
- PARTITION BY KEY (a,b);
-
-insert into t1 values (1,1,1,1);
-select * from t1;
-update t1 set d = 2 where a = 1 and b = 1 and c = 1;
-select * from t1;
-delete from t1;
-select * from t1;
-
-drop table t1;
-
-# only support for partition key on primary key
---error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
-CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b))
- ENGINE = NDB
- PARTITION BY KEY (c);
-
-CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY(a,b))
- ENGINE = NDB
- PARTITION BY KEY (a);
-
-insert into t1 values
- (1,1,3),(1,2,3),(1,3,3),(1,4,3),(1,5,3),(1,6,3),
- (1,7,3),(1,8,3),(1,9,3),(1,10,3),(1,11,3),(1,12,3);
-
-select * from t1 order by b;
-
-# BUG#33061: ORDER BY DESC becomes ASC in NDB partition pruning to one partition
-select max(b) from t1 where a = 1;
-select b from t1 where a = 1 order by b desc;
-
-DROP TABLE t1;
-
-#
-# Test partition and char support
-#
-
-CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT,
- PRIMARY KEY (a,b,c) USING HASH)
- ENGINE=NDB
- DEFAULT CHARSET=latin1
- PARTITION BY KEY (b);
-
-insert into t1 values (1,"a",1,1),(2,"a",1,1),(3,"a",1,1);
-
-# should show only one attribute with DISTRIBUTION KEY
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | sed 's/Version: [0-9]*//' | sed 's/\(Length of frm data: \)[0-9]*/\1#/'
-
-#
-# Test that explicit partition info is not shown in show create table
-# result should not contain (PARTITION P0 ... etc) since this is what shows up in
-# mysqldump, and we don't want that info there
-#
-show create table t1;
-
-DROP TABLE t1;
-
-#
-# Bug #13155: Problem in Create Table using SHOW CREATE TABLE syntax
-#
-CREATE TABLE t1 (a int not null primary key)
-PARTITION BY KEY(a)
-(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
-
-drop table t1;
-
-CREATE TABLE t1 (a int not null primary key);
-ALTER TABLE t1
-ENGINE = NDB
-PARTITION BY KEY(a)
-(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
-
-drop table t1;
-
-CREATE TABLE t1 (a int not null primary key) ENGINE = NDB;
-ALTER TABLE t1
-PARTITION BY KEY(a)
-(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
-
-drop table t1;
-
-#
-# Bug #17754 Improper handling of removal of partitioning in ALTER TABLE
-# Also added a number of general test cases in the same area
-#
-create table t1 (a int)
-engine=ndb
-partition by key(a)
-(partition p0, partition p1);
-show create table t1;
-
-alter table t1 engine=heap;
-show create table t1;
-
-alter table t1 engine=ndb;
-show create table t1;
-
-alter table t1 engine=heap remove partitioning;
-show create table t1;
-
-alter table t1 engine=ndb
-partition by key(a)
-(partition p0, partition p1 engine = ndb);
-show create table t1;
-
-alter table t1
-partition by key (a)
-(partition p0 engine=ndb, partition p1 engine=ndb);
-show create table t1;
-
-alter table t1 remove partitioning;
-show create table t1;
-
-# after bug#31931 was fixed
-# this is OK, since the storage engine is specified
-# on table level before.
-#--error ER_MIX_HANDLER_ERROR
-alter table t1
-partition by key(a)
-(partition p0 engine=ndb, partition p1);
-
-alter table t1
-engine=ndb
-partition by key(a)
-(partition p0 engine=ndb, partition p1 engine = ndb);
-show create table t1;
-
-drop table t1;
-
-#
-# BUG 16810 Out of memory when coalesce partition
-#
-CREATE TABLE t1 (
- c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
- c2 TEXT NOT NULL,
- c3 INT NOT NULL,
- c4 BIT NOT NULL,
- c5 FLOAT,
- c6 VARCHAR(255),
- c7 TIMESTAMP,
- PRIMARY KEY(c1,c3))
- ENGINE=NDB
- PARTITION BY KEY(c3) PARTITIONS 5;
-
-let $j= 11;
---disable_query_log
-while ($j)
-{
- eval INSERT INTO t1 VALUES (NULL, "Tested Remotely from Texas, USA", $j,
-b'0',
- $j.00,"By JBM $j","2006-01-26");
- dec $j;
-}
---enable_query_log
-ALTER TABLE t1 COALESCE PARTITION 4;
-
-DROP TABLE t1;
-
-#
-# Bug 16822: OPTIMIZE TABLE hangs test
-#
-CREATE TABLE t1 (a int primary key)
-ENGINE=NDB
-PARTITION BY KEY(a);
-ANALYZE TABLE t1;
-CHECK TABLE t1;
-OPTIMIZE TABLE t1;
-REPAIR TABLE t1;
-ALTER TABLE t1 OPTIMIZE PARTITION p0;
-ALTER TABLE t1 CHECK PARTITION p0;
-ALTER TABLE t1 REPAIR PARTITION p0;
-ALTER TABLE t1 ANALYZE PARTITION p0;
---error ER_ILLEGAL_HA
-ALTER TABLE t1 REBUILD PARTITION p0;
-DROP TABLE t1;
-
-#
-# BUG 16806: ALTER TABLE fails
-#
-CREATE TABLE t1 (
- c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
- c2 TEXT NOT NULL,
- c3 INT NOT NULL,
- PRIMARY KEY(c1,c3))
- ENGINE=NDB
- PARTITION BY KEY(c3) PARTITIONS 5;
-
-ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
-DROP TABLE t1;
-
-CREATE TABLE t1 (
- c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
- c2 TEXT NOT NULL,
- c3 INT NOT NULL,
- PRIMARY KEY(c1,c3))
- ENGINE=NDB
- PARTITION BY KEY(c3)
- (PARTITION p0 NODEGROUP 0, PARTITION p1 NODEGROUP 0);
-
-ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
-SELECT NODEGROUP,PARTITION_NAME FROM information_schema.partitions WHERE
-table_name = "t1";
-DROP TABLE t1;
-
-# bug#25587
-
-CREATE TABLE t1 (
-a tinyint unsigned NOT NULL,
-b bigint(20) unsigned NOT NULL,
-c char(12),
-PRIMARY KEY (a,b)
-) ENGINE ndb DEFAULT CHARSET=latin1 PARTITION BY KEY (a);
-
-insert into t1 values(1,1,'1'), (2,2,'2'), (3,3,'3'), (4,4,'4'), (5,5,'5');
-select * from t1 where a = 1;
-select * from t1 where a = 2;
-select * from t1 where a = 3;
-select * from t1 where a = 4;
-select * from t1 where a = 5;
-delete from t1 where a = 1;
-select * from t1 order by 1;
-delete from t1 where a = 2;
-select * from t1 order by 1;
-delete from t1 where a = 3;
-select * from t1 order by 1;
-delete from t1 where a = 4;
-select * from t1 order by 1;
-delete from t1 where a = 5;
-select * from t1 order by 1;
-
-drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_partition_list.test b/mysql-test/suite/ndb/t/ndb_partition_list.test
deleted file mode 100644
index ccfcdbc84f4..00000000000
--- a/mysql-test/suite/ndb/t/ndb_partition_list.test
+++ /dev/null
@@ -1,68 +0,0 @@
---source include/have_ndb.inc
-#
-# Simple test for the partition storage engine
-# Focuses on range partitioning tests
-#
-#-- source include/have_partition.inc
-
---disable_query_log
-set new=on;
---enable_query_log
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# Partition by list, basic
-#
-
-CREATE TABLE t1 ( f_int1 INTEGER NOT NULL, f_int2 INTEGER NOT NULL,
- f_char1 CHAR(10),
- f_char2 CHAR(10), f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int1,f_int2))
-ENGINE = NDB
-PARTITION BY LIST(MOD(f_int1 + f_int2,4))
-(PARTITION part_3 VALUES IN (-3),
- PARTITION part_2 VALUES IN (-2),
- PARTITION part_1 VALUES IN (-1),
- PARTITION part0 VALUES IN (0),
- PARTITION part1 VALUES IN (1),
- PARTITION part2 VALUES IN (2),
- PARTITION part3 VALUES IN (3,4,5));
-
-INSERT INTO t1 SET f_int1 = -2, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20===';
-INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-INSERT INTO t1 SET f_int1 = 3, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-INSERT INTO t1 SET f_int1 = 4, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-INSERT INTO t1 SET f_int1 = 5, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-
-SELECT * FROM t1 ORDER BY f_int1;
-
-DROP TABLE t1;
-
-#
-# Partition by list, no pk
-#
-
-CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, f_char1 CHAR(10),
- f_char2 CHAR(10), f_charbig VARCHAR(1000))
-ENGINE = NDB
-PARTITION BY LIST(f_int1)
-(PARTITION part_1 VALUES IN (-1),
- PARTITION part0 VALUES IN (0,1),
- PARTITION part1 VALUES IN (2));
-
-INSERT INTO t1 SET f_int1 = -1, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20===';
-INSERT INTO t1 SET f_int1 = 0, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20===';
-INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1===';
-
-SELECT * FROM t1 ORDER BY f_int1;
-
-DROP TABLE t1;
-
diff --git a/mysql-test/suite/ndb/t/ndb_partition_range.test b/mysql-test/suite/ndb/t/ndb_partition_range.test
deleted file mode 100644
index 778e552c6d8..00000000000
--- a/mysql-test/suite/ndb/t/ndb_partition_range.test
+++ /dev/null
@@ -1,269 +0,0 @@
--- source include/have_ndb.inc
-#--disable_abort_on_error
-#
-# Simple test for the partition storage engine
-# Focuses on range partitioning tests
-#
-#-- source include/have_partition.inc
-
---disable_query_log
-set new=on;
---enable_query_log
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-#
-# Partition by range, basic
-#
-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));
-
-# Simple insert and verify test
-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);
-
---replace_column 16 # 19 # 20 #
-select * from information_schema.partitions where table_name= 't1';
-
-select * from t1 order by a;
-
-select * from t1 where a=1 order by a;
-select * from t1 where a=15 and b=1 order by a;
-select * from t1 where a=21 and b=1 order by a;
-select * from t1 where a=21 order by a;
-select * from t1 where a in (1,6,10,21) order by a;
-select * from t1 where b=1 and a in (1,6,10,21) order by a;
-
-# BUG#33061: ORDER BY DESC becomes ASC in NDB partition pruning to one partition
-INSERT into t1 values (1, 2, 2);
-select max(b) from t1 where a = 1;
-select b from t1 where a = 1 order by b desc;
-
-drop table t1;
-
-#
-# Partition by range, basic
-#
-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));
-
-# Simple insert and verify test
-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;
-UPDATE t1 set a = 5 WHERE b = 15;
-select * from t1 order by a;
-UPDATE t1 set a = 6 WHERE a = 5;
-select * from t1 order by a;
-
-select * from t1 where b=1 order by b;
-select * from t1 where b=15 and a=1 order by b;
-select * from t1 where b=21 and a=1 order by b;
-select * from t1 where b=21 order by b;
-select * from t1 where b in (1,6,10,21) order by b;
-select * from t1 where a in (1,2,5,6) order by b;
-select * from t1 where a=1 and b in (1,6,10,21) order by b;
-
-DELETE from t1 WHERE b = 6;
-DELETE from t1 WHERE a = 6;
-
-#
-# Test that explicit partition info _is_ shown in show create table
-# result _should_ contain (PARTITION x1 ... etc)
-#
-show create table t1;
-
-drop table t1;
-
-#
-# Bug #17499, #17687
-# Alter partitioned NDB table causes mysqld to core
-#
-
-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;
-ALTER TABLE t1 ENGINE=MYISAM;
-SELECT * FROM t1;
-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 directly without any statements inbetween
-ALTER TABLE test.t1 DROP COLUMN a6;
-ALTER TABLE test.t1 ADD COLUMN a6 VARCHAR(255);
-
-let $j= 15;
---disable_query_log
-while ($j)
-{
-eval INSERT INTO test.t1 VALUES ($j, "Tested Remotely from Texas, USA",
-b'1',$j.00,$j+1,"By NIK $j");
-dec $j;
-}
---enable_query_log
-SELECT COUNT(*) FROM test.t1;
-
-ALTER TABLE test.t1 DROP COLUMN a4;
-SELECT COUNT(*) FROM test.t1;
-
-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;
-
-let $j= 15;
---disable_query_log
-while ($j)
-{
-eval INSERT INTO test.t1 VALUES ($j, "Tested Remotely from Texas, USA",
-b'1',$j.00,$j+1,"By NIK $j");
-dec $j;
-}
---enable_query_log
-SELECT COUNT(*) FROM test.t1;
-
-ALTER TABLE test.t1 DROP COLUMN a4;
-SELECT COUNT(*) FROM test.t1;
-
-DROP TABLE t1;
-
-ALTER TABLESPACE ts1
- DROP DATAFILE 'datafile.dat'
- ENGINE=NDB;
-DROP TABLESPACE ts1 ENGINE=NDB;
-DROP LOGFILE GROUP lg1 ENGINE=NDB;
-
-
-#
-# Bug #17701 ALTER TABLE t1 ADD PARTITION for PARTITION BY LIST hangs test
-#
-
-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;
-ALTER TABLE t1 ADD PARTITION
- (PARTITION p2 VALUES IN (412));
-SELECT * FROM t1;
-DROP TABLE t1;
-
-#
-# Bug #17806 Update on NDB table with list partition causes mysqld to core
-# Bug #16385 Partitions: crash when updating a range partitioned NDB table
-#
-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;
-UPDATE t1 SET a=8 WHERE a=5 AND b=1;
-select * from t1;
-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;
-UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 2;
-select * from t1 order by f1;
-UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 1;
-select * from t1 order by f1;
-drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_read_multi_range.test b/mysql-test/suite/ndb/t/ndb_read_multi_range.test
deleted file mode 100644
index 1c439e65099..00000000000
--- a/mysql-test/suite/ndb/t/ndb_read_multi_range.test
+++ /dev/null
@@ -1,340 +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=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, t2;
diff --git a/mysql-test/suite/ndb/t/ndb_rename.test b/mysql-test/suite/ndb/t/ndb_rename.test
deleted file mode 100644
index 7f9fd0e6984..00000000000
--- a/mysql-test/suite/ndb/t/ndb_rename.test
+++ /dev/null
@@ -1,36 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1,t2;
-drop database if exists mysqltest;
---enable_warnings
-
-#
-# Table rename tests
-#
-
-#
-# 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),
- INDEX i1(attr1)
-) ENGINE=ndbcluster;
-
-INSERT INTO t1 VALUES (0,0,0,"zero"),(1,1,1,"one"),(2,2,2,"two");
-SELECT * FROM t1 WHERE attr1 = 1;
-alter table t1 rename t2;
-SELECT * FROM t2 WHERE attr1 = 1;
-
-create database ndbtest;
-alter table t2 rename ndbtest.t2;
-SELECT * FROM ndbtest.t2 WHERE attr1 = 1;
-
-drop table ndbtest.t2;
-drop database ndbtest;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_replace.test b/mysql-test/suite/ndb/t/ndb_replace.test
deleted file mode 100644
index 432cf7f2dcd..00000000000
--- a/mysql-test/suite/ndb/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
-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/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/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
deleted file mode 100644
index c8b07fd351a..00000000000
--- a/mysql-test/suite/ndb/t/ndb_restore.test
+++ /dev/null
@@ -1,413 +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'),(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
-select max(capgoaledatta) from t1_c;
-select auto_increment from information_schema.tables
-where table_name = 't1_c';
-select max(capgotod) from t2_c;
-select auto_increment from information_schema.tables
-where table_name = 't2_c';
-select max(capfa) from t4_c;
-select auto_increment from information_schema.tables
-where table_name = 't4_c';
-select max(dardtestard) from t7_c;
-select auto_increment from information_schema.tables
-where table_name = 't7_c';
-select max(a) from t10_c;
-select auto_increment from information_schema.tables
-where table_name = '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
deleted file mode 100644
index 8e5b30aa6fd..00000000000
--- a/mysql-test/suite/ndb/t/ndb_restore_compat.test
+++ /dev/null
@@ -1,67 +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;
---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
deleted file mode 100644
index 069796f43c4..00000000000
--- a/mysql-test/suite/ndb/t/ndb_restore_different_endian_data.test
+++ /dev/null
@@ -1,185 +0,0 @@
--- 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/suite/ndb/t/ndb_restore_partition-master.opt b/mysql-test/suite/ndb/t/ndb_restore_partition-master.opt
deleted file mode 100644
index 075c6392dde..00000000000
--- a/mysql-test/suite/ndb/t/ndb_restore_partition-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---new
diff --git a/mysql-test/suite/ndb/t/ndb_restore_partition.test b/mysql-test/suite/ndb/t/ndb_restore_partition.test
deleted file mode 100644
index f11324492c2..00000000000
--- a/mysql-test/suite/ndb/t/ndb_restore_partition.test
+++ /dev/null
@@ -1,375 +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;
-drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
---enable_warnings
-
-CREATE TABLE `t1_c` (
- `capgoaledatta` smallint(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'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'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 (5,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;
-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),(22,'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),(32,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(29,'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 default '0',
- `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 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;
-
-
---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;
---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
-
-# 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;
-
-#
-# Try Partitioned tables as well
-#
-ALTER TABLE t1_c
-PARTITION BY RANGE (`capgoaledatta`)
-(PARTITION p0 VALUES LESS THAN MAXVALUE);
-
-ALTER TABLE t2_c
-PARTITION BY LIST(`capgotod`)
-(PARTITION p0 VALUES IN (0,1,2,3,4,5,6));
-
-ALTER TABLE t3_c
-PARTITION BY HASH (`CapGoaledatta`);
-
-ALTER TABLE t5_c
-PARTITION BY HASH (`capfa`)
-PARTITIONS 4;
-
-ALTER TABLE t6_c
-PARTITION BY LINEAR HASH (`relatta`)
-PARTITIONS 4;
-
-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;
---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;
---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;
---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;
-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 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_restore_print.test b/mysql-test/suite/ndb/t/ndb_restore_print.test
deleted file mode 100644
index 9a880f8968c..00000000000
--- a/mysql-test/suite/ndb/t/ndb_restore_print.test
+++ /dev/null
@@ -1,193 +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;
---enable_warnings
-
-# basic datatypes
-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 myisam;
-
-# max values
-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
- );
-
-# min values
-insert into t1 values
- (2
- ,0, 0, 0, 0, 0
- ,-128, 0
- ,-32768, 0
- ,-2147483648, 0
- ,-9223372036854775808, 0
- ,'','',''
- ,'','',''
- ,0x0,0x0,0x0
- ,0x0,0x0,0x0
- );
-
-# null values
-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
- );
-
---vertical_results
-select pk
- ,hex(a1), hex(a2), hex(a3), hex(a4), hex(a5)
- ,b1, b2
- ,c1 , c2
- ,d1 , d2
- ,e1 , e2
- ,f1 , f2, f3
- ,g1 , g2, g3
- ,hex(h1), hex(h2), hex(h3)
- ,hex(i1), hex(i2), hex(i3)
- from t1 order by pk;
-
-alter table t1 engine ndb;
-
-select pk
- ,hex(a1), hex(a2), hex(a3), hex(a4), hex(a5)
- ,b1, b2
- ,c1 , c2
- ,d1 , d2
- ,e1 , e2
- ,f1 , f2, f3
- ,g1 , g2, g3
- ,hex(h1), hex(h2), hex(h3)
- ,hex(i1), hex(i2), hex(i3)
- from t1 order by pk;
---horizontal_results
-
---source include/ndb_backup.inc
-
---let ndb_restore_filter=test t1
---let ndb_restore_opts=--verbose=0 --print_data --hex --fields-terminated-by=";"
---source include/ndb_backup_print.inc
-
---let ndb_restore_filter=test t1
---let ndb_restore_opts=--verbose=0 --print_data --hex --fields-terminated-by="," --fields-optionally-enclosed-by="'"
---source include/ndb_backup_print.inc
-
-
-drop table t1;
-
-# some binary char tests with trailing spaces
-create table t1
- (pk int key
- ,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(9), h3 BINARY(255)
- ,i1 VARBINARY(32), i2 VARBINARY(255), i3 VARBINARY(1000)
- ) engine ndb;
-
-insert into t1 values
- (1
- ,'1','12345678901234567890123456789012','123456789 '
- ,'1 ','12345678901234567890123456789012 ','123456789 '
- ,0x20,0x123456789abcdef020, 0x012345000020
- ,0x1200000020,0x123456789abcdef000000020, 0x00123450000020
- );
-
-create table t2 (pk int key, a int) engine ndb;
-create table t3 (pk int key, a int) engine ndb;
-create table t4 (pk int key, a int) engine ndb;
-
-insert into t2 values (1,11),(2,12),(3,13),(4,14),(5,15);
-insert into t3 values (1,21),(2,22),(3,23),(4,24),(5,25);
-insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35);
-
---source include/ndb_backup.inc
---let ndb_restore_opts=--verbose=0 --print_data --hex --fields-enclosed-by="'" --fields-optionally-enclosed-by="X"
---let ndb_restore_filter=test t1
---source include/ndb_backup_print.inc
-
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/t2.txt
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/t3.txt
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/t4.txt
-
---let ndb_restore_opts=--verbose=0 --print_data --hex --tab $MYSQLTEST_VARDIR/tmp --append
---let ndb_restore_filter=test
---source include/ndb_backup_print.inc
-
---let $message= t1
---source include/show_msg.inc
---exec sort $MYSQLTEST_VARDIR/tmp/t1.txt
---let $message= t2
---source include/show_msg.inc
---exec sort $MYSQLTEST_VARDIR/tmp/t2.txt
---let $message= t3
---source include/show_msg.inc
---exec sort $MYSQLTEST_VARDIR/tmp/t3.txt
---let $message= t4
---source include/show_msg.inc
---exec sort $MYSQLTEST_VARDIR/tmp/t4.txt
-
---remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
---remove_file $MYSQLTEST_VARDIR/tmp/t2.txt
---remove_file $MYSQLTEST_VARDIR/tmp/t3.txt
---remove_file $MYSQLTEST_VARDIR/tmp/t4.txt
-
-# now test some other datatypes
-drop table t1;
-create table t1
- (pk int key
- ,a1 MEDIUMINT, a2 MEDIUMINT UNSIGNED
- ) engine ndb;
-
-# max values
-insert into t1 values(1, 8388607, 16777215);
-# min values
-insert into t1 values(2, -8388608, 0);
-# small values
-insert into t1 values(3, -1, 1);
-
-# backup and print
---source include/ndb_backup.inc
-
---let ndb_restore_filter=test t1
---let ndb_restore_opts=--verbose=0 --print_data --hex --fields-terminated-by=";"
---source include/ndb_backup_print.inc
-
-# clean up
-drop table t1;
-drop table t2;
-drop table t3;
-drop table t4;
diff --git a/mysql-test/suite/ndb/t/ndb_row_format.test b/mysql-test/suite/ndb/t/ndb_row_format.test
deleted file mode 100644
index b1582cbe339..00000000000
--- a/mysql-test/suite/ndb/t/ndb_row_format.test
+++ /dev/null
@@ -1,86 +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
-
-#
-# some negative tests
-#
-
-# cannot have ROW_FORMAT=FIXED and var attrs mixed
---error 1005
-CREATE TABLE t1
- ( a INT KEY,
- b VARCHAR(10) )
- ROW_FORMAT=FIXED
- ENGINE=NDB;
-
-# warnings give more detail on the error
-SHOW WARNINGS;
-
-
-#
-# Check force var part for different ROW_FORMAT
-#
-
-# default => ForceVarPart: 1
-CREATE TABLE t1
- ( a INT KEY,
- b INT )
- ENGINE=NDB;
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep ForceVarPart
-DROP TABLE t1;
-
-# explicit DEFAULT => ForceVarPart: 1
-CREATE TABLE t1
- ( a INT KEY,
- b INT )
- ROW_FORMAT=DEFAULT
- ENGINE=NDB;
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep ForceVarPart
-DROP TABLE t1;
-
-# FIXED => ForceVarPart: 0
-CREATE TABLE t1
- ( a INT KEY,
- b INT )
- ROW_FORMAT=FIXED
- ENGINE=NDB;
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep ForceVarPart
-DROP TABLE t1;
-
-# DYNAMIC => ForceVarPart: 1
-CREATE TABLE t1
- ( a INT KEY,
- b INT )
- ROW_FORMAT=DYNAMIC
- ENGINE=NDB;
---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep ForceVarPart
-DROP TABLE t1;
-
-# test of bug
-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;
-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;
-drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_single_user.test b/mysql-test/suite/ndb/t/ndb_single_user.test
deleted file mode 100644
index a64ac066a49..00000000000
--- a/mysql-test/suite/ndb/t/ndb_single_user.test
+++ /dev/null
@@ -1,174 +0,0 @@
--- source include/have_multi_ndb.inc
--- source include/ndb_default_cluster.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1,t2;
---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="$NDB_CONNECTSTRING" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" --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);
-
-drop table t2;
-
-# 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="$NDB_CONNECTSTRING" -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="$NDB_CONNECTSTRING" -e "enter single user mode $node_id" >> $NDB_TOOLS_OUTPUT
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" --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="$NDB_CONNECTSTRING" -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/suite/ndb/t/ndb_sp.test b/mysql-test/suite/ndb/t/ndb_sp.test
deleted file mode 100644
index b833869cad0..00000000000
--- a/mysql-test/suite/ndb/t/ndb_sp.test
+++ /dev/null
@@ -1,42 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-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);
-
-delimiter //;
-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;
-//
-delimiter ;//
-call test_proc1(1);
-call test_proc2(@test_var);
-select @test_var;
-set @test_var = 1;
-call test_proc3(@test_var);
-select @test_var;
-alter procedure test_proc1 comment 'new comment';
-show create procedure test_proc1;
-drop procedure test_proc1;
-drop procedure test_proc2;
-drop procedure test_proc3;
-drop table t1;
-
---echo End of 5.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_subquery.test b/mysql-test/suite/ndb/t/ndb_subquery.test
deleted file mode 100644
index 6282c31c922..00000000000
--- a/mysql-test/suite/ndb/t/ndb_subquery.test
+++ /dev/null
@@ -1,79 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1, t2, t3, t4;
---enable_warnings
-
-##########
-# bug#5367
-create table t1 (p int not null primary key, u int not null, o int not null,
-unique (u), key(o)) engine=ndb;
-
-create table t2 (p int not null primary key, u int not null, o int not null,
-unique (u), key(o)) engine=ndb;
-
-create table t3 (a int not null primary key, b int not null) engine=ndb;
-create table t4 (c int not null primary key, d int not null) engine=ndb;
-
-insert into t1 values (1,1,1),(2,2,2),(3,3,3);
-insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5);
-insert into t3 values (1,10), (2,10), (3,30), (4, 30);
-insert into t4 values (1,10), (2,10), (3,30), (4, 30);
-
-# Use pk
---replace_column 9 #
-explain select * from t2 where p NOT IN (select p from t1);
-select * from t2 where p NOT IN (select p from t1) order by p;
-
-# Use unique index
---replace_column 9 #
-explain select * from t2 where p NOT IN (select u from t1);
-select * from t2 where p NOT IN (select u from t1) order by p;
-
-# Use ordered index
---replace_column 9 #
-explain select * from t2 where p NOT IN (select o from t1);
-select * from t2 where p NOT IN (select o from t1) order by p;
-
-# Use scan
---replace_column 9 #
-explain select * from t2 where p NOT IN (select p+0 from t1);
-select * from t2 where p NOT IN (select p+0 from t1) order by p;
-
-drop table t1;
-drop table t2;
-# bug#5367
-##########
-
-# End of 4.1 tests
-
-#
-# bug#11205
-#
-create table t1 (p int not null primary key, u int not null) engine=ndb;
-insert into t1 values (1,1),(2,2),(3,3);
-
-create table t2 as
-select t1.*
-from t1 as t1, t1 as t2, t1 as t3, t1 as t4, t1 as t5, t1 as t6, t1 as t7, t1 as t8
-where t1.u = t2.u
- and t2.u = t3.u
- and t3.u = t4.u
- and t4.u = t5.u
- and t5.u = t6.u
- and t6.u = t7.u
- and t7.u = t8.u;
-
-select * from t2 order by 1;
-
-select * from t3 where a = any (select c from t4 where c = 1) order by a;
-select * from t3 where a in (select c from t4 where c = 1) order by a;
-select * from t3 where a <> some (select c from t4 where c = 1) order by a;
-select * from t3 where a > all (select c from t4 where c = 1) order by a;
-select * from t3 where row(1,10) = (select c,d from t4 where c = 1) order by a;
-select * from t3 where exists (select * from t4 where c = 1) order by a;
-
-drop table if exists t1, t2, t3, t4;
-
---echo End of 5.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_temporary.test b/mysql-test/suite/ndb/t/ndb_temporary.test
deleted file mode 100644
index 7f6902bf745..00000000000
--- a/mysql-test/suite/ndb/t/ndb_temporary.test
+++ /dev/null
@@ -1,38 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-#
-# creating a temporary table with engine=ndb should give an error
-#
---error ER_ILLEGAL_HA_CREATE_OPTION
-create temporary table t1 (a int key) engine=ndb;
-
-
-#
-# alter temporary table to engine=ndb should give an error
-#
-create temporary table t1 (a int key) engine=myisam;
---error ER_ILLEGAL_HA_CREATE_OPTION
-alter table t1 engine=ndb;
-drop table t1;
-
-
-#
-# if default storage engine=ndb, temporary tables
-# without explicit engine= should be created as myisam
-#
-SET SESSION storage_engine=NDBCLUSTER;
-create table t1 (a int key);
-
-# verify that we have a ndb table
-select engine from information_schema.tables where table_name = 't1';
-drop table t1;
-
-# verify that we have a myisam table
-create temporary table t1 (a int key);
-show create table t1;
-drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndb_tmp_table_and_DDL.test b/mysql-test/suite/ndb/t/ndb_tmp_table_and_DDL.test
deleted file mode 100644
index 748c0ac28e4..00000000000
--- a/mysql-test/suite/ndb/t/ndb_tmp_table_and_DDL.test
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# Bug#49132
-# This test verifies if executing DDL statement before trying to manipulate
-# a temporary table causes row-based replication to break with error 'table
-# does not exist' base on ndb engine.
-#
-
-source include/have_ndb.inc;
-
-LET $ENGINE_TYPE= NDB;
-source extra/rpl_tests/rpl_tmp_table_and_DDL.test;
diff --git a/mysql-test/suite/ndb/t/ndb_transaction.test b/mysql-test/suite/ndb/t/ndb_transaction.test
deleted file mode 100644
index d3ebadb1a78..00000000000
--- a/mysql-test/suite/ndb/t/ndb_transaction.test
+++ /dev/null
@@ -1,298 +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
-
-#
-# Transactionc test to show that the NDB
-# table handler is working properly with
-# transactions
-#
-
-#
-# Create a normal table with primary key
-#
-CREATE TABLE t1 (
- pk1 INT NOT NULL PRIMARY KEY,
- attr1 INT NOT NULL
-) ENGINE=ndbcluster;
-
-# insert
-begin;
-insert into t1 values(1,1);
-insert into t1 values(2,2);
-select count(*) from t1;
-select * from t1 where pk1 = 1;
-select t1.attr1 from t1, t1 as t1x where t1.pk1 = t1x.pk1 + 1;
-rollback;
-
-select count(*) from t1;
-select * from t1 where pk1 = 1;
-select t1.attr1 from t1, t1 as t1x where t1.pk1 = t1x.pk1 + 1;
-
-begin;
-insert into t1 values(1,1);
-insert into t1 values(2,2);
-commit;
-
-select count(*) from t1;
-select * from t1 where pk1 = 1;
-select t1.attr1 from t1, t1 as t1x where t1.pk1 = t1x.pk1 + 1;
-
-# update
-begin;
-update t1 set attr1 = attr1 * 2;
-select count(*) from t1;
-select * from t1 where pk1 = 1;
-select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
-rollback;
-
-select count(*) from t1;
-select * from t1 where pk1 = 1;
-select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
-
-begin;
-update t1 set attr1 = attr1 * 2;
-commit;
-
-select count(*) from t1;
-select * from t1 where pk1 = 1;
-select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
-
-# delete
-begin;
-delete from t1 where attr1 = 2;
-select count(*) from t1;
-select * from t1 where pk1 = 1;
-select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
-rollback;
-
-select count(*) from t1;
-select * from t1 where pk1 = 1;
-select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
-
-begin;
-delete from t1 where attr1 = 2;
-commit;
-
-select count(*) from t1;
-select * from t1 where pk1 = 1;
-select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
-
-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
-begin;
-insert into t1 values(1,1);
-insert into t1 values(2,2);
-select sum(id) from t1;
-select * from t1 where id = 1;
-select t1.id from t1, t1 as t1x where t1.id2 = t1x.id2 + 1;
-rollback;
-
-select sum(id) from t1;
-select * from t1 where id = 1;
-select t1.id from t1, t1 as t1x where t1.id2 = t1x.id2 + 1;
-
-begin;
-insert into t1 values(1,1);
-insert into t1 values(2,2);
-commit;
-
-select sum(id) from t1;
-select * from t1 where id = 1;
-select t1.id from t1, t1 as t1x where t1.id2 = t1x.id2 + 1;
-
-# update
-begin;
-update t1 set id = id * 2;
-select sum(id) from t1;
-select * from t1 where id = 2;
-select * from t1, t1 as t1x where t1x.id = t1.id - 2;
-rollback;
-
-select sum(id) from t1;
-select * from t1 where id = 2;
-select * from t1, t1 as t1x where t1x.id = t1.id - 2;
-
-begin;
-update t1 set id = id * 2;
-commit;
-
-select sum(id) from t1;
-select * from t1 where id = 2;
-select * from t1, t1 as t1x where t1x.id = t1.id - 2;
-
-# delete
-
-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 records into tables and rollback
-#
-let $1=100;
-disable_query_log;
-begin;
-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;
-}
-rollback;
-enable_query_log;
-
-select count(*) from t2;
-select count(*) from t3;
-select count(*) from t4;
-
-#
-# insert records into tables and commit;
-#
-let $1=100;
-disable_query_log;
-begin;
-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;
-}
-commit;
-enable_query_log;
-
-select count(*) from t2;
-select count(*) from t3;
-select count(*) from t4;
-
-#
-# delete every other record in the tables
-#
-let $1=100;
-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;
-
-#
-# update records and rollback
-#
-begin;
-let $1=100;
-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;
-}
-rollback;
-enable_query_log;
-
-#
-# update records and commit
-#
-begin;
-let $1=100;
-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;
-}
-rollback;
-enable_query_log;
-
-drop table t2;
-drop table t3;
-drop table t4;
-
-#
-# Test multiple databases in one transaction
-#
-
-CREATE TABLE t1 (
- pk1 INT NOT NULL PRIMARY KEY,
- attr1 INT NOT NULL
-) ENGINE=ndbcluster;
-
-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;
-
-begin;
-insert into test.t1 values(1,1);
-insert into t2 values(1,1,1);
-insert into test.t1 values(2,2);
-insert into t2 values(2,2,2);
-select count(*) from test.t1;
-select count(*) from t2;
-select * from test.t1 where pk1 = 1;
-select * from t2 where a = 1;
-select test.t1.attr1
-from test.t1, test.t1 as t1x where test.t1.pk1 = t1x.pk1 + 1;
-select t2.a
-from t2, t2 as t2x where t2.a = t2x.a + 1;
-select test.t1.pk1, a from test.t1,t2 where b > test.t1.attr1;
-rollback;
-
-select count(*) from test.t1;
-select count(*) from t2;
-
-drop table test.t1, t2;
-drop database mysqltest;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_trigger.test b/mysql-test/suite/ndb/t/ndb_trigger.test
deleted file mode 100644
index 9f01157fc93..00000000000
--- a/mysql-test/suite/ndb/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)) 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/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/suite/ndb/t/ndb_truncate.test b/mysql-test/suite/ndb/t/ndb_truncate.test
deleted file mode 100644
index a1ef4be0d48..00000000000
--- a/mysql-test/suite/ndb/t/ndb_truncate.test
+++ /dev/null
@@ -1,41 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
---enable_warnings
-
-CREATE TABLE t1 (
- a bigint unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
- b int unsigned not null,
- c int unsigned
-) engine=ndbcluster;
-
-
-#
-# insert records into table
-#
-let $1=500;
-disable_query_log;
-while ($1)
-{
- eval insert into t1 values(NULL, $1+9, 5*$1), (NULL, $1+10, 7),(NULL, $1+10, 7*$1), (NULL, $1+10, 10+$1), (NULL, $1+10, 70*$1), (NULL, $1+10, 7), (NULL, $1+10, 9), (NULL, $1+299, 899), (NULL, $1+10, 12), (NULL, $1+10, 14*$1);
- dec $1;
-}
-enable_query_log;
-
-select count(*) from t1;
-
-select * from t1 order by a limit 2;
-
-truncate table t1;
-
-select count(*) from t1;
-
-insert into t1 values(NULL,1,1),(NULL,2,2);
-
-select * from t1 order by a;
-
-drop table t1;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_types.test b/mysql-test/suite/ndb/t/ndb_types.test
deleted file mode 100644
index ab18817132e..00000000000
--- a/mysql-test/suite/ndb/t/ndb_types.test
+++ /dev/null
@@ -1,85 +0,0 @@
---source include/have_ndb.inc
---source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-#
-# Test creation of different column types in NDB
-#
-CREATE TABLE t1 (
- auto int(5) unsigned NOT NULL auto_increment,
- string char(10) default "hello",
- vstring varchar(10) default "hello",
- 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('one','two','tree') not null,
- flags set('one','two','tree') not null,
- date_field date,
- year_field year,
- time_field time,
- date_time datetime,
- time_stamp timestamp not null default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
- PRIMARY KEY (auto),
- KEY (utiny),
- KEY (tiny),
- KEY (short),
- KEY any_name (medium),
- KEY (longlong),
- KEY (real_float),
- KEY (ushort),
- KEY (umedium),
- KEY (ulong),
- KEY (ulonglong,ulong),
- KEY (options,flags)
-);
-
-set @now = now();
---sleep 1.5
-insert into t1
-(string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
- real_float,real_double, real_decimal,utiny, ushort, umedium,ulong,ulonglong,
- bits,options,flags,date_field,year_field,time_field,date_time)
-values
-("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');
-
-select auto,string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
- real_float,real_double,real_decimal,utiny,ushort,umedium,ulong,ulonglong,
- bits,options,flags,date_field,year_field,time_field,date_time
-from t1;
-select time_stamp>@now from t1;
-
-set @now = now();
---sleep 1.5
-update t1 set string="bbbb",vstring="bbbb",bin=0xBBBB,vbin=0xBBBB,
-tiny=-2,short=-2,medium=-2,long_int=-2,longlong=-2,real_float=2.2,
-real_double=2.2,real_decimal=2.2,utiny=2,ushort=2,umedium=2,ulong=2,
-ulonglong=2, bits=b'010',
-options='one',flags='one', date_field='1902-02-02',year_field='1902',
-time_field='02:02:02',date_time='1902-02-02 02:02:02' where auto=1;
-
-select auto,string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
- real_float,real_double,real_decimal,utiny,ushort,umedium,ulong,ulonglong,
- bits,options,flags,date_field,year_field,time_field,date_time
-from t1;
-select time_stamp>@now from t1;
-
-drop table t1;
-
---echo End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/ndb_update.test b/mysql-test/suite/ndb/t/ndb_update.test
deleted file mode 100644
index ab0fbee171e..00000000000
--- a/mysql-test/suite/ndb/t/ndb_update.test
+++ /dev/null
@@ -1,94 +0,0 @@
--- 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;
-# bug#25817
-create unique index ib on t1(b);
-update t1 set c = 4 where pk1 = 12;
-update ignore t1 set b = 55 where pk1 = 14;
-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/suite/ndb/t/ndb_update_no_read.test b/mysql-test/suite/ndb/t/ndb_update_no_read.test
deleted file mode 100644
index 60bea53b7b5..00000000000
--- a/mysql-test/suite/ndb/t/ndb_update_no_read.test
+++ /dev/null
@@ -1,79 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-#
-# New test case for WL 3686 (which is not until CGE-6.3)
-# but test is committed in 5.1 to verify consistant results.
-#
-# When only constant expressions in update statements and
-# only PK or UK in WHERE clause. No extra WHERE parts are
-# allowed. WL #3687 takes of more advanced variants of
-# avoiding the read before the update/delete
-
-create table t1 (a int not null primary key, b int not null, c int,
- unique index_b (b) using hash)
-engine ndb;
-
-insert into t1 values (1,10,1),(2,9,1),(3,8,1),(4,7,1),(5,6,1),(6,5,2),(7,4,2),(8,3,2),
- (9,2,2),(10,1,2);
-
-# These ones should use optimisation
-
-update t1 set c = 111, b = 20 where a = 1;
-
-select * from t1 where a = 1 order by a;
-
-delete from t1 where a = 1;
-
-select * from t1 where a = 1 order by a;
-
-update t1 set c = 12, b = 19 where b = 2;
-
-select * from t1 where b = 2 order by a;
-
-delete from t1 where b = 19;
-
-select * from t1 where b = 19 order by a;
-
-update t1 set c = 22 where a = 10 or a >= 10;
-
-select * from t1 order by a;
-
-update t1 set c = 23 where a in (8,10);
-
-select * from t1 order by a;
-
-update t1 set c = 23 where a in (7,8) or a >= 10;
-
-select * from t1 order by a;
-
-# These ones should not use optimisation
-
-update t1 set c = 11 where a = 3 or b = 7;
-
-select * from t1 where a = 3 or b = 7 order by a;
-
-update t1 set a = 13, b = 20 where a = 3;
-
-select * from t1 where a = 13 order by a;
-
-update t1 set a = 12, b = 19 where b = 7;
-
-select * from t1 where b = 19 order by a;
-
-select * from t1 where b = 7 order by a;
-
-update t1 set c = 12, b = 29 where a = 5 and b = 6;
-
-select * from t1 where b = 19 order by a;
-
-delete from t1 where b = 6 and c = 12;
-
-select * from t1 where b = 6 order by a;
-
-drop table t1;
-
diff --git a/mysql-test/suite/ndb/t/ndb_view.test b/mysql-test/suite/ndb/t/ndb_view.test
deleted file mode 100644
index 3b8fc330b40..00000000000
--- a/mysql-test/suite/ndb/t/ndb_view.test
+++ /dev/null
@@ -1,29 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3;
-DROP VIEW IF EXISTS v1,v2,v3;
---enable_warnings
-
-#
-# simple operations via view
-#
-
-create table t1 (a int, b int, c int, d int) engine=ndb;
-insert into t1 values (1,2,3,4),(5,6,7,8);
-
-create view v1 as select t1.c as a, t1.a as b, t1.d as c, t1.a+t1.b+t1.c as d from t1;
-select * from v1 order by a,b,c;
-
-update v1 set a=a+100 where b=1;
-select * from v1 order by a,b,c;
-
-drop view v1;
-
-create view v1 as select t1.c as a from t1;
-insert into v1 values (200);
-select * from t1 order by a,b,c,d;
-
-drop view v1;
-drop table t1;
diff --git a/mysql-test/suite/ndb/t/ndbapi.test b/mysql-test/suite/ndb/t/ndbapi.test
deleted file mode 100644
index 398a2cbfbfa..00000000000
--- a/mysql-test/suite/ndb/t/ndbapi.test
+++ /dev/null
@@ -1,44 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_ndbapi_examples.inc
-
---disable_warnings
-DROP TABLE IF EXISTS t0;
-drop database if exists mysqltest;
---enable_warnings
-
---exec echo Running ndbapi_simple
---exec $NDB_EXAMPLES_DIR/ndbapi_simple/ndbapi_simple $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
-
---exec echo Running ndbapi_simple_index
---exec $NDB_EXAMPLES_DIR/ndbapi_simple_index/ndbapi_simple_index $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
-
---exec echo Running ndbapi_scan
---exec $NDB_EXAMPLES_DIR/ndbapi_scan/ndbapi_scan $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
-
---exec echo Running ndbapi_retries
---exec $NDB_EXAMPLES_DIR/ndbapi_retries/ndbapi_retries $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
-
---exec echo Running ndbapi_async
---exec $NDB_EXAMPLES_DIR/ndbapi_async/ndbapi_async $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
-
---exec echo Running ndbapi_async1
---exec $NDB_EXAMPLES_DIR/ndbapi_async1/ndbapi_async1 $MASTER_MYSOCK "$NDB_CONNECTSTRING" >> $NDB_EXAMPLES_OUTPUT
-
-use TEST_DB;
-create table t0(c0 int, c1 int, c2 char(4), c3 char(4), c4 text,
- primary key(c0, c2)) engine ndb charset latin1;
-#--exec echo Running ndbapi_event
-#--exec $NDB_EXAMPLES_DIR/ndbapi_event/ndbapi_event "$NDB_CONNECTSTRING" 1 >> $NDB_EXAMPLES_OUTPUT
-insert into t0 values (1, 2, 'a', 'b', null);
-insert into t0 values (3, 4, 'c', 'd', null);
-update t0 set c3 = 'e' where c0 = 1 and c2 = 'a'; -- use pk
-update t0 set c3 = 'f'; -- use scan
-update t0 set c3 = 'F'; -- use scan update to 'same'
-update t0 set c2 = 'g' where c0 = 1; -- update pk part
-update t0 set c2 = 'G' where c0 = 1; -- update pk part to 'same'
-update t0 set c0 = 5, c2 = 'H' where c0 = 3; -- update full PK
-delete from t0;
-drop table t0;
-
---exec echo Running mgmapi_logevent
---exec $NDB_EXAMPLES_DIR/mgmapi_logevent/mgmapi_logevent "$NDB_CONNECTSTRING" 1 >> $NDB_EXAMPLES_OUTPUT
diff --git a/mysql-test/suite/ndb/t/ps_7ndb.test b/mysql-test/suite/ndb/t/ps_7ndb.test
deleted file mode 100644
index e3f65ec2c4e..00000000000
--- a/mysql-test/suite/ndb/t/ps_7ndb.test
+++ /dev/null
@@ -1,25 +0,0 @@
-###############################################
-# #
-# Prepared Statements test on NDB tables #
-# #
-###############################################
-
-#
-# NOTE: PLEASE SEE ps_1general.test (bottom)
-# BEFORE ADDING NEW TEST CASES HERE !!!
-
-use test;
-
--- source include/have_ndb.inc
-let $type= 'NDB' ;
--- source include/ps_create.inc
--- source include/ps_renew.inc
-
--- source include/ps_query.inc
--- source include/ps_modify.inc
--- source include/ps_modify1.inc
--- source include/ps_conv.inc
-
-drop table t1, t9;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb/t/strict_autoinc_5ndb.test b/mysql-test/suite/ndb/t/strict_autoinc_5ndb.test
deleted file mode 100644
index 9e2090fddef..00000000000
--- a/mysql-test/suite/ndb/t/strict_autoinc_5ndb.test
+++ /dev/null
@@ -1,10 +0,0 @@
--- source include/have_ndb.inc
-
-#
-# Bug#20573 Strict mode auto-increment
-#
-
-let $type= 'NDB' ;
---source include/strict_autoinc.inc
-
-# end of test
diff --git a/mysql-test/suite/ndb_team/r/ndb_autodiscover.result b/mysql-test/suite/ndb_team/r/ndb_autodiscover.result
deleted file mode 100644
index 487f52f6427..00000000000
--- a/mysql-test/suite/ndb_team/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: 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/suite/ndb_team/r/ndb_autodiscover2.result b/mysql-test/suite/ndb_team/r/ndb_autodiscover2.result
deleted file mode 100644
index 269888e0820..00000000000
--- a/mysql-test/suite/ndb_team/r/ndb_autodiscover2.result
+++ /dev/null
@@ -1,13 +0,0 @@
-select * from t9 order by a;
-a b
-1 2
-2 3
-3 4
-4 5
-show status like 'handler_discover%';
-Variable_name Value
-Handler_discover 0
-drop table t9;
-select * from t10;
-ERROR HY000: Got error 4263 'Invalid blob attributes or invalid blob parts table' from NDBCLUSTER
-drop table t10;
diff --git a/mysql-test/suite/ndb_team/r/ndb_autodiscover3.result b/mysql-test/suite/ndb_team/r/ndb_autodiscover3.result
deleted file mode 100644
index 86495ebb3eb..00000000000
--- a/mysql-test/suite/ndb_team/r/ndb_autodiscover3.result
+++ /dev/null
@@ -1,53 +0,0 @@
-drop table if exists t1, t2;
-create table t1 (a int key) engine=ndbcluster;
-begin;
-insert into t1 values (1);
-insert into t1 values (2);
-ERROR HY000: Got temporary error 4025 'Node failure caused abort of transaction' from NDBCLUSTER
-commit;
-ERROR HY000: Got error 4350 'Transaction already aborted' from NDBCLUSTER
-drop table t1;
-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;
-a b
-1 1
-2 1
-3 1
-select * from t2;
-ERROR 42S02: Table 'test.t2' doesn't exist
-show tables like 't2';
-Tables_in_test (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;
-a
-1
-2
-3
-select * from t2 order by a limit 3;
-a
-1
-2
-3
-reset master;
-select * from t2;
-ERROR 42S02: Table 'test.t2' doesn't exist
-show tables like 't2';
-Tables_in_test (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;
-a
-1
-2
-3
-select * from t2 order by a limit 3;
-a
-1
-2
-3
-reset master;
-drop table t2;
diff --git a/mysql-test/suite/ndb_team/r/ndb_backup_print.result b/mysql-test/suite/ndb_team/r/ndb_backup_print.result
deleted file mode 100644
index 7fa073bafb5..00000000000
--- a/mysql-test/suite/ndb_team/r/ndb_backup_print.result
+++ /dev/null
@@ -1,65 +0,0 @@
-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_team/r/ndb_dd_backuprestore.result b/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
deleted file mode 100644
index 12a65a433a3..00000000000
--- a/mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result
+++ /dev/null
@@ -1,512 +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 = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-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 = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-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 = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-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_team/r/rpl_ndb_dd_advance.result b/mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result
deleted file mode 100644
index 37188aeb1ca..00000000000
--- a/mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result
+++ /dev/null
@@ -1,323 +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);
-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 test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DROP TABLE test.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/ndb_team/r/rpl_ndb_extraColMaster.result b/mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result
deleted file mode 100644
index 55a95605839..00000000000
--- a/mysql-test/suite/ndb_team/r/rpl_ndb_extraColMaster.result
+++ /dev/null
@@ -1,1752 +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;
-
-***********************************************************
-***********************************************************
-***************** Start of Testing ************************
-***********************************************************
-***********************************************************
-* This test format == binlog_format ROW and engine == 'NDB'
-***********************************************************
-***********************************************************
-
-***** Testing more columns on the Master *****
-
-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='NDB';
-
-* Alter Table on Slave and drop columns f5 through f11 *
-
-alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-
-* Insert data in Master then update and delete some rows*
-
-* Select count and 20 rows from Master *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
-hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
-2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-
-* Select count and 20 rows from Slave *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT * FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-Checking that both slave threads are running.
-
-***** Testing Altering table def scenario *****
-
-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='NDB';
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-
-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='NDB';
-
-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='NDB';
-Warnings:
-Warning 1264 Out of range value for column 'f8' at row 1
-
-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='NDB';
-
-** Alter tables on slave and drop columns **
-
-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;
-
-** Insert Data into 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');
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-Warning 1264 Out of range value for column 'f9' at row 2
-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';
-Warnings:
-Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
-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'
- );
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-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
-);
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-Warning 1264 Out of range value for column 'f5' at row 2
-Warning 1264 Out of range value for column 'f24' at row 2
-Warning 1264 Out of range value for column 'f24' at row 3
-
-** Sync slave with master **
-** Do selects from tables **
-
-select * from t1 order by f3;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-31 31 31 second
-32 32 32 second
-33 33 33 second
-34 34 34 second
-35 35 35 second
-36 36 36 second
-37 37 37 second
-38 38 38 second
-39 39 39 second
-40 40 40 second
-41 41 41 second
-42 42 42 second
-43 43 43 second
-44 44 44 second
-45 45 45 second
-46 46 46 second
-47 47 47 second
-48 48 48 second
-49 49 49 second
-50 50 50 second
-select * from t2 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-2 2 2 second
-3 3 3 third
-select * from t3 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t4 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t31 order by f3;
-f1 f2 f3 f4
-1 1 1 first
-1 1 2 second
-1 1 3 third
-1 1 4 fourth
-1 1 5 fifth
-1 1 6 sixth
-
-** Do updates 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;
-Warnings:
-Warning 1048 Column 'f3' cannot be null
-
-** Delete from Master **
-
-delete from t1;
-delete from t2;
-delete from t3;
-delete from t4;
-delete from t31;
-select * from t31;
-f1 f2 f3 f4
-
-** Check slave status **
-
-Checking that both slave threads are running.
-
-****************************************
-* columns in master at middle of table *
-* Expect: Proper error message *
-****************************************
-
-** Stop and Reset Slave **
-
-STOP SLAVE;
-RESET SLAVE;
-
-** create table slave side **
-CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='NDB';
-
-** Connect to master and create table **
-
-CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
-c CHAR(5), e INT DEFAULT '1')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,DEFAULT,'Kyle',DEFAULT),
-(2,@b1,DEFAULT,'JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1677 ***
-********************************************
-
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-
-*** Drop t10 ***
-DROP TABLE t10;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: Proper error message *
-*********************************************
-
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
-) ENGINE='NDB';
-
-*** Create t11 on Master ***
-CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')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,'Testing is fun','Kyle',DEFAULT),
-(2,@b1,'Testing is cool','JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1677 ***
-********************************************
-
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-
-*** Drop t11 ***
-DROP TABLE t11;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: This one should pass blob-text *
-*********************************************
-
-*** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
-) ENGINE='NDB';
-
-*** Create t12 on Master ***
-CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')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',DEFAULT,DEFAULT),
-(2,@b1,'JOE',DEFAULT,DEFAULT),
-(3,@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
-a hex(b) f c e
-1 62316231623162316231623162316231 Kyle test 1
-2 62316231623162316231623162316231 JOE test 1
-3 62316231623162316231623162316231 QA test 1
-
-*** Select on Slave ***
-SELECT a,hex(b),c FROM t12 ORDER BY a;
-a hex(b) c
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-*** Drop t12 ***
-DROP TABLE t12;
-
-****************************************************
-* - Alter Master adding columns at middle of table *
-* Expect: columns added *
-****************************************************
-
-
-*** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='NDB';
-
-*** Create t14 on Master ***
-CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)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',DEFAULT,DEFAULT),
-(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5 c6 c7
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
-
-*** Select on Slave ****
-SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
-
-****************************************************
-* - Alter Master Dropping columns from the middle. *
-* Expect: columns dropped *
-****************************************************
-
-*** connect to master and drop columns ***
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c7;
-
-*** Select from Master ***
-SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
-c1 c3 hex(c4) c5 c6
-1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
-2 This Test Should work 62316231623162316231623162316231 JOE 1
-3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
-
-************
-* Bug30415 *
-************
-Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t14 ***
-DROP TABLE t14;
-DROP TABLE t14;
-RESET MASTER;
-START SLAVE;
-
-*************************************************
-* - Alter Master adding columns at end of table *
-* Expect: Error 1054 *
-*************************************************
-
-*** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='NDB';
-
-*** Create t15 on Master ***
-CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
-(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
-(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
-SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
-c1 hex(c4) c5 c6 c7 c2
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
-2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
-3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
-
-********************************************
-*** Expect slave to fail with Error 1054 ***
-********************************************
-
-Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t15 ***
-DROP TABLE t15;
-DROP TABLE t15;
-RESET MASTER;
-START SLAVE;
-
-************************************************
-* - Create index on Master column not on slave *
-* Expect:Warning *
-************************************************
-
-*** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='NDB';
-
-*** Create t16 on Master ***
-CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Create Index and Data Insert ***
-CREATE INDEX part_of_c6 ON t16 (c6);
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-*****************
-*** BUG 30434 ***
-*****************
-
-Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t16 ***
-DROP TABLE t16;
-DROP TABLE t16;
-RESET MASTER;
-START SLAVE;
-
-*****************************************************
-* - Delete rows using column on Master not on slave *
-* Expect: Rows Deleted *
-*****************************************************
-
-*** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='NDB';
-
-*** Create t17 on Master ***
-CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** Delete from master **
-DELETE FROM t17 WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-DROP TABLE t17;
-
-
-*****************************************************
-* - Update row using column on Master not on slave *
-* Expect: Rows updated *
-*****************************************************
-
-** Bug30674 **
-
-*** Create t18 on slave ***
-
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='NDB';
-
-*** Create t18 on Master ***
-CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** update from master **
-UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 TEST
-DROP TABLE t18;
-
-
-*****************************************************
-* - Insert UUID column on Master not on slave *
-* Expect: Rows inserted *
-*****************************************************
-
-*** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='NDB';
-
-*** Create t5 on Master ***
-CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 LONG,
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
-(2,@b1,'JOE',UUID(),DEFAULT),
-(3,@b1,'QA',UUID(),DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 6231623162316231 Kyle UUID TIME
-2 6231623162316231 JOE UUID TIME
-3 6231623162316231 QA UUID TIME
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
-c1 hex(c4) c5
-1 6231623162316231 Kyle
-2 6231623162316231 JOE
-3 6231623162316231 QA
-DROP TABLE t5;
-
-set binlog_format=mixed;
-
-***********************************************************
-***********************************************************
-***************** Start of Testing ************************
-***********************************************************
-***********************************************************
-* This test format == binlog_format MIXED and engine == 'NDB'
-***********************************************************
-***********************************************************
-
-***** Testing more columns on the Master *****
-
-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='NDB';
-
-* Alter Table on Slave and drop columns f5 through f11 *
-
-alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-
-* Insert data in Master then update and delete some rows*
-
-* Select count and 20 rows from Master *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
-hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
-2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-
-* Select count and 20 rows from Slave *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT * FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-Checking that both slave threads are running.
-
-***** Testing Altering table def scenario *****
-
-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='NDB';
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-
-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='NDB';
-
-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='NDB';
-Warnings:
-Warning 1264 Out of range value for column 'f8' at row 1
-
-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='NDB';
-
-** Alter tables on slave and drop columns **
-
-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;
-
-** Insert Data into 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');
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-Warning 1264 Out of range value for column 'f9' at row 2
-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';
-Warnings:
-Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
-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'
- );
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-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
-);
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-Warning 1264 Out of range value for column 'f5' at row 2
-Warning 1264 Out of range value for column 'f24' at row 2
-Warning 1264 Out of range value for column 'f24' at row 3
-
-** Sync slave with master **
-** Do selects from tables **
-
-select * from t1 order by f3;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-31 31 31 second
-32 32 32 second
-33 33 33 second
-34 34 34 second
-35 35 35 second
-36 36 36 second
-37 37 37 second
-38 38 38 second
-39 39 39 second
-40 40 40 second
-41 41 41 second
-42 42 42 second
-43 43 43 second
-44 44 44 second
-45 45 45 second
-46 46 46 second
-47 47 47 second
-48 48 48 second
-49 49 49 second
-50 50 50 second
-select * from t2 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-2 2 2 second
-3 3 3 third
-select * from t3 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t4 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t31 order by f3;
-f1 f2 f3 f4
-1 1 1 first
-1 1 2 second
-1 1 3 third
-1 1 4 fourth
-1 1 5 fifth
-1 1 6 sixth
-
-** Do updates 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;
-Warnings:
-Warning 1048 Column 'f3' cannot be null
-
-** Delete from Master **
-
-delete from t1;
-delete from t2;
-delete from t3;
-delete from t4;
-delete from t31;
-select * from t31;
-f1 f2 f3 f4
-
-** Check slave status **
-
-Checking that both slave threads are running.
-
-****************************************
-* columns in master at middle of table *
-* Expect: Proper error message *
-****************************************
-
-** Stop and Reset Slave **
-
-STOP SLAVE;
-RESET SLAVE;
-
-** create table slave side **
-CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='NDB';
-
-** Connect to master and create table **
-
-CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
-c CHAR(5), e INT DEFAULT '1')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,DEFAULT,'Kyle',DEFAULT),
-(2,@b1,DEFAULT,'JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1677 ***
-********************************************
-
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-
-*** Drop t10 ***
-DROP TABLE t10;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: Proper error message *
-*********************************************
-
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
-) ENGINE='NDB';
-
-*** Create t11 on Master ***
-CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')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,'Testing is fun','Kyle',DEFAULT),
-(2,@b1,'Testing is cool','JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1677 ***
-********************************************
-
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-
-*** Drop t11 ***
-DROP TABLE t11;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: This one should pass blob-text *
-*********************************************
-
-*** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
-) ENGINE='NDB';
-
-*** Create t12 on Master ***
-CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')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',DEFAULT,DEFAULT),
-(2,@b1,'JOE',DEFAULT,DEFAULT),
-(3,@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
-a hex(b) f c e
-1 62316231623162316231623162316231 Kyle test 1
-2 62316231623162316231623162316231 JOE test 1
-3 62316231623162316231623162316231 QA test 1
-
-*** Select on Slave ***
-SELECT a,hex(b),c FROM t12 ORDER BY a;
-a hex(b) c
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-*** Drop t12 ***
-DROP TABLE t12;
-
-****************************************************
-* - Alter Master adding columns at middle of table *
-* Expect: columns added *
-****************************************************
-
-
-*** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='NDB';
-
-*** Create t14 on Master ***
-CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)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',DEFAULT,DEFAULT),
-(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5 c6 c7
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
-
-*** Select on Slave ****
-SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
-
-****************************************************
-* - Alter Master Dropping columns from the middle. *
-* Expect: columns dropped *
-****************************************************
-
-*** connect to master and drop columns ***
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c7;
-
-*** Select from Master ***
-SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
-c1 c3 hex(c4) c5 c6
-1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
-2 This Test Should work 62316231623162316231623162316231 JOE 1
-3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
-
-************
-* Bug30415 *
-************
-Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t14 ***
-DROP TABLE t14;
-DROP TABLE t14;
-RESET MASTER;
-START SLAVE;
-
-*************************************************
-* - Alter Master adding columns at end of table *
-* Expect: Error 1054 *
-*************************************************
-
-*** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='NDB';
-
-*** Create t15 on Master ***
-CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
-(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
-(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
-SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
-c1 hex(c4) c5 c6 c7 c2
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
-2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
-3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
-
-********************************************
-*** Expect slave to fail with Error 1054 ***
-********************************************
-
-Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t15 ***
-DROP TABLE t15;
-DROP TABLE t15;
-RESET MASTER;
-START SLAVE;
-
-************************************************
-* - Create index on Master column not on slave *
-* Expect:Warning *
-************************************************
-
-*** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='NDB';
-
-*** Create t16 on Master ***
-CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Create Index and Data Insert ***
-CREATE INDEX part_of_c6 ON t16 (c6);
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-*****************
-*** BUG 30434 ***
-*****************
-
-Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t16 ***
-DROP TABLE t16;
-DROP TABLE t16;
-RESET MASTER;
-START SLAVE;
-
-*****************************************************
-* - Delete rows using column on Master not on slave *
-* Expect: Rows Deleted *
-*****************************************************
-
-*** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='NDB';
-
-*** Create t17 on Master ***
-CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** Delete from master **
-DELETE FROM t17 WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-DROP TABLE t17;
-
-
-*****************************************************
-* - Update row using column on Master not on slave *
-* Expect: Rows updated *
-*****************************************************
-
-** Bug30674 **
-
-*** Create t18 on slave ***
-
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='NDB';
-
-*** Create t18 on Master ***
-CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** update from master **
-UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 TEST
-DROP TABLE t18;
-
-
-*****************************************************
-* - Insert UUID column on Master not on slave *
-* Expect: Rows inserted *
-*****************************************************
-
-*** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='NDB';
-
-*** Create t5 on Master ***
-CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 LONG,
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
-(2,@b1,'JOE',UUID(),DEFAULT),
-(3,@b1,'QA',UUID(),DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 6231623162316231 Kyle UUID TIME
-2 6231623162316231 JOE UUID TIME
-3 6231623162316231 QA UUID TIME
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
-c1 hex(c4) c5
-1 6231623162316231 Kyle
-2 6231623162316231 JOE
-3 6231623162316231 QA
-DROP TABLE t5;
-
diff --git a/mysql-test/suite/ndb_team/r/rpl_ndb_mix_innodb.result b/mysql-test/suite/ndb_team/r/rpl_ndb_mix_innodb.result
deleted file mode 100644
index 203a59b4613..00000000000
--- a/mysql-test/suite/ndb_team/r/rpl_ndb_mix_innodb.result
+++ /dev/null
@@ -1,143 +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;
-
-*** 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>
-
-# Now check that that is in the apply_status table is consistant
-# with what is in the binlog
-
-# since insert is done with transactional engine, expect a BEGIN
-# at <start_pos>
-
-show binlog events from <binlog_start> limit 1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-
-# Now the insert, one step after
-
-show binlog events from <binlog_start> limit 1,1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; insert into t1 values (1,2)
-
-# and the COMMIT should be at <end_pos>
-
-show binlog events from <binlog_start> limit 2,1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Xid # # 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 <binlog_start> limit 1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-
-show binlog events from <binlog_start> 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 <binlog_start> limit 3,1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Xid # # 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/suite/ndb_team/t/disabled.def b/mysql-test/suite/ndb_team/t/disabled.def
deleted file mode 100644
index 714f1014a10..00000000000
--- a/mysql-test/suite/ndb_team/t/disabled.def
+++ /dev/null
@@ -1,20 +0,0 @@
-##############################################################################
-#
-# List the test cases that are to be disabled temporarily.
-#
-# Separate the test case name and the comment with ':'.
-#
-# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
-#
-# Do not use any TAB characters for whitespace.
-#
-##############################################################################
-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
-#rpl_ndb_extraColMaster : BUG#30854 : Tables name show as binary in slave err msg on vm-win2003-64-b and Solaris
-#rpl_ndb_mix_innodb : Bug #32720 Test rpl_ndb_mix_innodb fails on SPARC and PowerPC
-#rpl_ndb_dd_advance : Bug #30222 rpl_ndb_dd_advance.test fails
diff --git a/mysql-test/suite/ndb_team/t/ndb_autodiscover.test b/mysql-test/suite/ndb_team/t/ndb_autodiscover.test
deleted file mode 100644
index 9ded27cea31..00000000000
--- a/mysql-test/suite/ndb_team/t/ndb_autodiscover.test
+++ /dev/null
@@ -1,555 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
-# Bug#41308: Test main.ndb_autodiscover.test doesn't work on Windows due
-# to 'grep' calls
-# Test is currently disabled on Windows via the next line until this bug
-# can be resolved.
---source include/not_windows.inc
-
---disable_warnings
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
---enable_warnings
-
-################################################
-# Test that a table that does not exist as a
-# frm file on disk can be "discovered" from a
-# connected NDB Cluster
-#
-
-flush status;
-
-#
-# Test discover + SELECT
-#
-
-create table t1(
- id int not null primary key,
- name char(20)
-) engine=ndb;
-
-insert into t1 values(1, "Autodiscover");
-flush tables;
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
-select * from t1;
-show status like 'handler_discover%';
-
-#
-# Test discover + INSERT
-#
-
-flush tables;
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
-insert into t1 values (2, "Auto 2");
-show status like 'handler_discover%';
-insert into t1 values (3, "Discover 3");
-show status like 'handler_discover%';
-flush tables;
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
-select * from t1 order by id;
-show status like 'handler_discover%';
-
-#
-# Test discover + UPDATE
-#
-
-flush tables;
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
-update t1 set name="Autodiscover" where id = 2;
-show status like 'handler_discover%';
-select * from t1 order by id;
-show status like 'handler_discover%';
-
-#
-# Test discover + DELETE
-#
-
-flush tables;
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
-delete from t1 where id = 3;
-select * from t1 order by id;
-show status like 'handler_discover%';
-
-drop table t1;
-
-
-
-######################################################
-# Test that a table that is outdated on disk
-# can be "discovered" from a connected NDB Cluster
-#
-
-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;
-show status like 'handler_discover%';
-flush tables;
-
-# Modify the frm file on disk
-system echo "blaj" >> $MYSQLTEST_VARDIR/master-data/test/t2.frm ;
-select * from t2;
-
-show status like 'handler_discover%';
-
-drop table t2;
-
-
-##################################################
-# Test that a table that already exists in NDB
-# is only discovered if CREATE TABLE IF NOT EXISTS
-# is used
-#
-
-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;
-show status like 'handler_discover%';
-flush tables;
-
-# Remove the frm file from disk
---remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm
-
---error ER_TABLE_EXISTS_ERROR
-create table t3(
- id int not null primary key,
- name char(20), a int, b float, c char(24)
-) engine=ndb;
-
-# The table shall not have been discovered since
-# IF NOT EXISTS wasn't specified
-
-show status like 'handler_discover%';
-
-# now it should be discovered
-create table IF NOT EXISTS t3(
- id int not null primary key,
- id2 int not null,
- name char(20)
-) engine=ndb;
-
-# NOTE! the table called t3 have now been updated to
-# use the same frm as in NDB, thus it's not certain that
-# the table schema is the same as was stated in the
-# CREATE TABLE statement above
-
-show status like 'handler_discover%';
-
-SHOW CREATE TABLE t3;
-
-select * from t3;
-show status like 'handler_discover%';
-
-drop table t3;
-
-##################################################
-# Test that a table that already exists in NDB
-# is discovered when SHOW TABLES
-# is used
-#
-
-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;
-show status like 'handler_discover%';
-
-# Remove the frm file from disk
-flush tables;
---remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm
-
-show tables from test;
-show status like 'handler_discover%';
-
-# Remove the frm file from disk again
-flush tables;
---remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm
-
---replace_column 6 # 7 # 8 # 9 # 12 # 13 # 15 # 18 #
-show table status;
-show status like 'handler_discover%';
-
-drop table t6, t7;
-
-
-#######################################################
-# Test that a table that has been dropped from NDB
-# but still exists on disk, get a consistent error message
-# saying "No such table existed"
-#
-
-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;
-
-# Remove the table from NDB
-system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ;
-
-#
-# Test that correct error is returned
---error ER_NO_SUCH_TABLE
-select * from t4;
---error ER_NO_SUCH_TABLE
-select * from t4;
-
-show status like 'handler_discover%';
---error ER_BAD_TABLE_ERROR
-drop 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;
-
-# Remove the table from NDB
-system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ;
-
---error ER_NO_SUCH_TABLE
-select * from t4;
-
-drop table if exists t4;
-
-# Test that dropping a table that does not exists
-# on disk or in NDB gives same result as above
---error ER_BAD_TABLE_ERROR
-drop table t5;
-drop table if exists t5;
-
-
-#######################################################
-# Test that a table that has been dropped from NDB
-# but still exists on disk is deleted from disk
-# when SHOW TABLES is called
-#
-
-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;
-flush tables;
-
-# Remove the table from NDB
-system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ;
-
-SHOW TABLES;
-
---error ER_NO_SUCH_TABLE
-select * from t4;
-
-#######################################################
-# Test SHOW TABLES ability to detect new and delete old
-# tables. Test all at once using many tables
-#
-
-flush status;
-
-# Create tables
-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;
-
-# Populate tables
-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);
-
-# Remove t3, t5 from NDB
-system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 >> $NDB_TOOLS_OUTPUT ;
-system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 >> $NDB_TOOLS_OUTPUT ;
-# Remove t6, t7 from disk
---remove_file $MYSQLTEST_VARDIR/master-data/test/t6.frm
---remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm
-
-SHOW TABLES;
-
-select * from t6;
-select * from t7;
-
-show status like 'handler_discover%';
-
-drop table t1, t2, t4, t6, t7, t8, t9;
-
-#######################################################
-# Test SHOW TABLES LIKE ability to detect new and delete old
-# tables. Test all at once using many tables.
-#
-
-flush status;
-
-# Create tables
-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;
-
-# Populate tables
-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);
-
-# Remove t3, t5 from NDB
-system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 > /dev/null ;
-system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 > /dev/null ;
-# Remove t6, t7 from disk
---remove_file $MYSQLTEST_VARDIR/master-data/test/t6.frm
---remove_file $MYSQLTEST_VARDIR/master-data/test/t7.frm
-
-
-SHOW TABLES LIKE 't6';
-
-show status like 'handler_discover%';
-
-# Check that t3 or t5 can't be created
-# frm files for these tables is stilll on disk
---error ER_TABLE_EXISTS_ERROR
-create table t3(a int);
---error ER_TABLE_EXISTS_ERROR
-create table t5(a int);
-
-SHOW TABLES LIKE 't%';
-
-show status like 'handler_discover%';
-
-drop table t1, t2, t4, t6, t7, t8, t9;
-
-
-
-######################################################
-# Test that several tables can be discovered when
-# one statement access several table at once.
-#
-
-flush status;
-
-# Create tables
-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;
-
-# Populate tables
-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);
-
-# Remove t1, t2, t3 from disk
---remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
---remove_file $MYSQLTEST_VARDIR/master-data/test/t2.frm
---remove_file $MYSQLTEST_VARDIR/master-data/test/t3.frm
-flush tables;
-
-# Select from the table which only exists in NDB.
-select * from t1, t2, t3, t4;
-
-# 3 table should have been discovered
-show status like 'handler_discover%';
-
-drop table t1, t2, t3, t4;
-
-
-#########################################################
-# Test that a table that has been changed in NDB
-# since it's been opened will be refreshed and discovered
-# again
-#
-
-flush status;
-
-show status like 'handler_discover%';
-
-create table t5(
- id int not null primary key,
- name char(200)
-) engine=ndb;
-insert into t5 values (1, "Magnus");
-select * from t5;
-
-ALTER TABLE t5 ADD COLUMN adress char(255) FIRST;
-
-select * from t5;
-
-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;
-
-show status like 'handler_discover%';
-
-drop table t5;
-
-
-################################################################
-# Test that a table that has been changed with ALTER TABLE
-# can be used from the same thread
-#
-
-flush status;
-
-show status like 'handler_discover%';
-
-create table t6(
- id int not null primary key,
- name char(20)
-) engine=ndb;
-insert into t6 values (1, "Magnus");
-select * from t6;
-
-ALTER TABLE t6 ADD COLUMN adress char(255) FIRST;
-
-select * from t6;
-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;
-
-show status like 'handler_discover%';
-
-drop table t6;
-
-#####################################################
-# Test that only tables in the current database shows
-# up in SHOW TABLES
-#
-
-show tables;
-
-create table t1 (a int,b longblob) engine=ndb;
-show tables;
-create database test2;
-use test2;
-show tables;
---error ER_NO_SUCH_TABLE
-select * from t1;
-create table t2 (b int,c longblob) engine=ndb;
-use test;
-select * from t1;
-show tables;
-drop table t1;
-use test2;
-drop table t2;
-drop database test2;
-use test;
-
-#########################################################
-# Bug#8035
-# mysqld would segfault on second select * before bug was fixed
-#
---disable_warnings
-drop database if exists test_only_ndb_tables;
---enable_warnings
-create database test_only_ndb_tables;
-use test_only_ndb_tables;
-create table t1 (a int primary key) engine=ndb;
-select * from t1;
---exec $NDB_MGM --no-defaults -e "all restart -n" > /dev/null
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults --not-started > /dev/null
---error ER_CANT_LOCK
-select * from t1;
---exec $NDB_MGM --no-defaults -e "all start" > /dev/null
---exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults > /dev/null
---source include/ndb_wait_connected.inc
-use test;
-drop database test_only_ndb_tables;
-
-#####################################################
-# Test that it's not possible to create tables
-# with same name as NDB internal tables
-# This will also test that it's not possible to create
-# a table with tha same name as a table that can't be
-# discovered( for example a table created via NDBAPI)
-
-# Test disabled since it doesn't work on case insensitive systems
-#--error ER_TABLE_EXISTS_ERROR
-#CREATE TABLE sys.SYSTAB_0 (a int);
-#--error ER_UNKNOWN_ERROR
-#select * from sys.SYSTAB_0;
-
-#CREATE TABLE IF NOT EXISTS sys.SYSTAB_0 (a int);
-#show warnings;
-#--error ER_UNKNOWN_ERROR
-#select * from sys.SYSTAB_0;
-
-#--error ER_BAD_TABLE_ERROR
-#drop table sys.SYSTAB_0;
-#drop table IF EXISTS sys.SYSTAB_0;
-
-######################################################
-# Note! This should always be the last step in this
-# file, the table t9 will be used and dropped
-# by ndb_autodiscover2
-#
-
-CREATE TABLE t9 (
- a int NOT NULL PRIMARY KEY,
- b int
-) engine=ndb;
-
-insert t9 values(1, 2), (2,3), (3, 4), (4, 5);
-
-#Don't drop the table, instead remove the frm file
---remove_file $MYSQLTEST_VARDIR/master-data/test/t9.frm
-
-# Now leave test case, when ndb_autodiscover2 will run, this
-# MySQL Server will have been restarted because it has a
-# ndb_autodiscover2-master.opt file.
-
-create table t10 (
- a int not null primary key,
- b blob
-) engine=ndb;
-
-insert into t10 values (1, 'kalle');
-
---exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test `$NDB_TOOLS_DIR/ndb_show_tables --no-defaults | grep BLOB | while read a b c d e f g; do echo $g; done` >> $NDB_TOOLS_OUTPUT 2>&1 || true
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb_team/t/ndb_autodiscover2-master.opt b/mysql-test/suite/ndb_team/t/ndb_autodiscover2-master.opt
deleted file mode 100644
index e0d075c3fbd..00000000000
--- a/mysql-test/suite/ndb_team/t/ndb_autodiscover2-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---skip-external-locking
diff --git a/mysql-test/suite/ndb_team/t/ndb_autodiscover2.test b/mysql-test/suite/ndb_team/t/ndb_autodiscover2.test
deleted file mode 100644
index ebe14696cd2..00000000000
--- a/mysql-test/suite/ndb_team/t/ndb_autodiscover2.test
+++ /dev/null
@@ -1,21 +0,0 @@
--- source include/have_ndb.inc
--- source include/not_embedded.inc
-
-#
-# Simple test to show use of discover when the server has been restarted
-# The previous step has simply removed the frm file
-# from disk, but left the table in NDB
-#
---sleep 3
-select * from t9 order by a;
-
-# handler_discover should be 1
-show status like 'handler_discover%';
-
-drop table t9;
-
---error 1296
-select * from t10;
-drop table t10;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/ndb_team/t/ndb_autodiscover3.test b/mysql-test/suite/ndb_team/t/ndb_autodiscover3.test
deleted file mode 100644
index 10416aee11f..00000000000
--- a/mysql-test/suite/ndb_team/t/ndb_autodiscover3.test
+++ /dev/null
@@ -1,104 +0,0 @@
--- 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/ndb_team/t/ndb_backup_print.test b/mysql-test/suite/ndb_team/t/ndb_backup_print.test
deleted file mode 100644
index cf869fd56f5..00000000000
--- a/mysql-test/suite/ndb_team/t/ndb_backup_print.test
+++ /dev/null
@@ -1,68 +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;
---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_team/t/ndb_dd_backuprestore.test b/mysql-test/suite/ndb_team/t/ndb_dd_backuprestore.test
deleted file mode 100644
index 48db8ec3e0b..00000000000
--- a/mysql-test/suite/ndb_team/t/ndb_dd_backuprestore.test
+++ /dev/null
@@ -1,349 +0,0 @@
-########################################
-# Author: JBM
-# Date: 2006-01-24
-# Purpose: Test CDD backup and restore
-########################################
-
--- source include/have_ndb.inc
--- source include/ndb_default_cluster.inc
--- source include/not_embedded.inc
-
---disable_query_log
-set new=on;
---enable_query_log
-
---disable_warnings
-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;
---enable_warnings
-
-############ Test 1 Simple DD backup and restore #############
--- echo **** 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;
-
-let $j= 500;
---disable_query_log
-while ($j)
-{
- eval INSERT INTO test.t1 VALUES (NULL, "Sweden", $j, b'1');
- dec $j;
-}
---enable_query_log
-SELECT COUNT(*) FROM test.t1;
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
-
--- source include/ndb_backup.inc
-
-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;
-
--- source include/ndb_restore_master.inc
-
-SELECT COUNT(*) FROM test.t1;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
-
-################# Mixed Cluster Test ############################
--- echo **** 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;
-
-let $j= 500;
---disable_query_log
-while ($j)
-{
- eval INSERT INTO test.t2 VALUES (NULL, "Sweden, Texas", $j, b'0');
- dec $j;
-}
---enable_query_log
-
-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;
-
-let $j= 50;
---disable_query_log
-while ($j)
-{
- INSERT INTO test.t3 VALUES (NULL, repeat('a',1*1024));
- INSERT INTO test.t3 VALUES (NULL, repeat('b',16*1024));
- INSERT INTO test.t4 VALUES (NULL, repeat('a',1*1024));
- INSERT INTO test.t4 VALUES (NULL, repeat('b',16*1024));
- dec $j;
-}
---enable_query_log
-
-SELECT COUNT(*) FROM test.t1;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t2;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY pk1 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t3;
-
-SELECT LENGTH(data) FROM test.t3 WHERE c1 = 1;
-
-SELECT LENGTH(data) FROM test.t3 WHERE c1 = 2;
-
-SELECT COUNT(*) FROM test.t4;
-
-SELECT LENGTH(data) FROM test.t4 WHERE c1 = 1;
-
-SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
-
--- source include/ndb_backup.inc
-
-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;
-
--- source include/ndb_restore_master.inc
-
-SELECT COUNT(*) FROM test.t1;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t2;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY pk1 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t3;
-
-SELECT LENGTH(data) FROM test.t3 WHERE c1 = 1;
-
-SELECT LENGTH(data) FROM test.t3 WHERE c1 = 2;
-
-SELECT COUNT(*) FROM test.t4;
-
-SELECT LENGTH(data) FROM test.t4 WHERE c1 = 1;
-
-SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
-
-DROP TABLE test.t1;
-DROP TABLE test.t2;
-DROP TABLE test.t3;
-DROP TABLE test.t4;
-###################### Adding partition #################################
--- echo **** 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;
-
-SHOW CREATE TABLE test.t2;
-
-SHOW CREATE TABLE test.t3;
-
-SHOW CREATE TABLE test.t4;
-
-SHOW CREATE TABLE test.t5;
-
-SHOW CREATE TABLE test.t6;
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't1';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't2';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't3';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't4';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't5';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't6';
-
-
-let $j= 500;
---disable_query_log
-while ($j)
-{
- eval INSERT INTO test.t1 VALUES (NULL, "Sweden, Texas", $j, b'0');
- eval INSERT INTO test.t4 VALUES (NULL, "Sweden, Texas", $j, b'0');
- dec $j;
- eval INSERT INTO test.t2 VALUES (NULL, "Sweden, Texas, ITALY, Kyle, JO, JBM,TU", $j, b'1');
- eval INSERT INTO test.t5 VALUES (NULL, "Sweden, Texas, ITALY, Kyle, JO, JBM,TU", $j, b'1');
- dec $j;
- eval INSERT INTO test.t3 VALUES (NULL, "TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU", $j, b'1');
- eval INSERT INTO test.t6 VALUES (NULL, "TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU", $j, b'1'); } --enable_query_log
-
-SELECT COUNT(*) FROM test.t1;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t2;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t3;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t3 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t4;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t4 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t5;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t5 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t6;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t6 ORDER BY c3 LIMIT 5;
-
--- source include/ndb_backup.inc
-
-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;
-
--- source include/ndb_restore_master.inc
-
-
-SHOW CREATE TABLE test.t1;
-
-SHOW CREATE TABLE test.t2;
-
-SHOW CREATE TABLE test.t3;
-
-SHOW CREATE TABLE test.t4;
-
-SHOW CREATE TABLE test.t5;
-
-SHOW CREATE TABLE test.t6;
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't1';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't2';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't3';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't4';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't5';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't6';
-
-SELECT COUNT(*) FROM test.t1;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t2;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t3;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t3 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t4;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t4 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t5;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t5 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t6;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t6 ORDER BY c3 LIMIT 5;
-
-# Cleanup
-
-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;
-
-#End 5.1 test case
-
-
diff --git a/mysql-test/suite/ndb_team/t/rpl_ndb_dd_advance.test b/mysql-test/suite/ndb_team/t/rpl_ndb_dd_advance.test
deleted file mode 100644
index e08b1b6f701..00000000000
--- a/mysql-test/suite/ndb_team/t/rpl_ndb_dd_advance.test
+++ /dev/null
@@ -1,410 +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_mixed_or_row.inc
---source include/ndb_default_cluster.inc
---source include/not_embedded.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;
-
---source include/ndb_backup.inc
-
---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.
-
-remove_file $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_M.sql;
-remove_file $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_S.sql;
-
-# End 5.1 test case
diff --git a/mysql-test/suite/ndb_team/t/rpl_ndb_extraColMaster.test b/mysql-test/suite/ndb_team/t/rpl_ndb_extraColMaster.test
deleted file mode 100644
index d78eda7eef1..00000000000
--- a/mysql-test/suite/ndb_team/t/rpl_ndb_extraColMaster.test
+++ /dev/null
@@ -1,14 +0,0 @@
-#############################################################
-# Purpose: To test having extra columns on the master WL#3915
-#############################################################
--- source include/have_ndb.inc
--- source include/ndb_master-slave.inc
--- source include/have_binlog_format_mixed_or_row.inc
-
-let $engine_type = 'NDB';
-
-set binlog_format=row;
--- source extra/rpl_tests/rpl_extraMaster_Col.test
-
-set binlog_format=mixed;
--- source extra/rpl_tests/rpl_extraMaster_Col.test
diff --git a/mysql-test/suite/ndb_team/t/rpl_ndb_mix_innodb-master.opt b/mysql-test/suite/ndb_team/t/rpl_ndb_mix_innodb-master.opt
deleted file mode 100644
index 416f8692654..00000000000
--- a/mysql-test/suite/ndb_team/t/rpl_ndb_mix_innodb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb --default-storage-engine=innodb
diff --git a/mysql-test/suite/ndb_team/t/rpl_ndb_mix_innodb.test b/mysql-test/suite/ndb_team/t/rpl_ndb_mix_innodb.test
deleted file mode 100644
index b730bcc08e0..00000000000
--- a/mysql-test/suite/ndb_team/t/rpl_ndb_mix_innodb.test
+++ /dev/null
@@ -1,36 +0,0 @@
-#############################################
-#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/parts/inc/part_supported_sql_funcs_main.inc b/mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc
index 25a9774d2a1..b7a170dd9d8 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
@@ -39,29 +39,6 @@ let $val3 = 17 ;
let $val4 = 15 ;
--source suite/parts/inc/partition_supported_sql_funcs.inc
-
-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 ;
-# DISABLED due to bug 30577
-#--source suite/parts/inc/partition_supported_sql_funcs.inc
-
-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 ;
-# DISABLED due to bug 30577
-#--source suite/parts/inc/partition_supported_sql_funcs.inc
-
let $sqlfunc = mod(col1,10);
let $valsqlfunc = mod(15,10);
let $coltype = int;
@@ -111,8 +88,9 @@ let $val2 = '2006-01-17';
let $val3 = '2006-02-25';
let $val4 = '2006-02-05';
--source suite/parts/inc/partition_supported_sql_funcs.inc
-let $coltype = char(30);
---source suite/parts/inc/partition_supported_sql_funcs.inc
+# Disabled after fixing bug#54483.
+#let $coltype = char(30);
+#--source suite/parts/inc/partition_supported_sql_funcs.inc
let $sqlfunc = extract(month from col1);
let $valsqlfunc = extract(year from '1998-11-23');
@@ -162,8 +140,9 @@ let $val2 = '14:30:20';
let $val3 = '21:59:22';
let $val4 = '10:22:33';
--source suite/parts/inc/partition_supported_sql_funcs.inc
-let $coltype = char(30);
---source suite/parts/inc/partition_supported_sql_funcs.inc
+# second(non_time_col) is disabled after bug#54483.
+#let $coltype = char(30);
+#--source suite/parts/inc/partition_supported_sql_funcs.inc
let $sqlfunc = month(col1);
let $valsqlfunc = month('2006-10-14');
@@ -195,26 +174,28 @@ let $val3 = '21:59:22';
let $val4 = '10:33:11';
--source suite/parts/inc/partition_supported_sql_funcs.inc
-let $sqlfunc = to_days(col1)-to_days('2006-01-01');
-let $valsqlfunc = to_days('2006-02-02')-to_days('2006-01-01');
-let $coltype = date;
-let $infile = part_supported_sql_funcs_int_date.inc;
-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
+# to_days(non_date_col) is disabled after bug#54483.
+#let $sqlfunc = to_days(col1)-to_days('2006-01-01');
+#let $valsqlfunc = to_days('2006-02-02')-to_days('2006-01-01');
+#let $coltype = date;
+#let $infile = part_supported_sql_funcs_int_date.inc;
+#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
+# to_days(non_date_col) is disabled after bug#54483.
# 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-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
+#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-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
let $sqlfunc = weekday(col1);
let $valsqlfunc = weekday('2006-10-14');
diff --git a/mysql-test/suite/parts/inc/partition_auto_increment.inc b/mysql-test/suite/parts/inc/partition_auto_increment.inc
index 102e57d3d04..034460d49ac 100644
--- a/mysql-test/suite/parts/inc/partition_auto_increment.inc
+++ b/mysql-test/suite/parts/inc/partition_auto_increment.inc
@@ -105,6 +105,30 @@ OPTIMIZE TABLE t1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
+if (!$skip_update)
+{
+eval CREATE TABLE t1
+(a INT NULL AUTO_INCREMENT,
+ UNIQUE KEY (a))
+ENGINE=$engine;
+SET LAST_INSERT_ID = 999;
+SET INSERT_ID = 0;
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+SELECT * FROM t1;
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+SELECT * FROM t1;
+UPDATE t1 SET a = 1 WHERE a IS NULL;
+SELECT LAST_INSERT_ID();
+SELECT * FROM t1;
+UPDATE t1 SET a = NULL WHERE a = 1;
+SELECT LAST_INSERT_ID();
+SELECT * FROM t1;
+DROP TABLE t1;
+SET INSERT_ID = 1;
+}
+
-- echo # Simple test with NULL
eval CREATE TABLE t1 (
c1 INT NOT NULL AUTO_INCREMENT,
@@ -831,5 +855,30 @@ SELECT * FROM t ORDER BY c1 ASC;
DROP TABLE t;
+if (!$skip_update)
+{
+eval CREATE TABLE t1
+(a INT NULL AUTO_INCREMENT,
+ UNIQUE KEY (a))
+ENGINE=$engine
+PARTITION BY KEY(a) PARTITIONS 2;
+SET LAST_INSERT_ID = 999;
+SET INSERT_ID = 0;
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+SELECT * FROM t1;
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+SELECT * FROM t1;
+UPDATE t1 SET a = 1 WHERE a IS NULL;
+SELECT LAST_INSERT_ID();
+SELECT * FROM t1;
+UPDATE t1 SET a = NULL WHERE a = 1;
+SELECT LAST_INSERT_ID();
+SELECT * FROM t1;
+DROP TABLE t1;
+}
+
+
--echo ##############################################################################
}
diff --git a/mysql-test/suite/parts/inc/partition_check.inc b/mysql-test/suite/parts/inc/partition_check.inc
index 19d548cc8ef..235764a034f 100644
--- a/mysql-test/suite/parts/inc/partition_check.inc
+++ b/mysql-test/suite/parts/inc/partition_check.inc
@@ -177,7 +177,7 @@ let $any_unique= `SELECT @my_errno IN ($ER_DUP_KEY,$ER_DUP_ENTRY)`;
# @my_errno AS sql_errno;
if (`SELECT @my_errno NOT IN (0,$ER_DUP_KEY,$ER_DUP_ENTRY)`)
{
- --echo # The last command got an unexepected error response.
+ --echo # The last command got an unexpected error response.
--echo # Expected/handled SQL codes are 0,$ER_DUP_KEY,$ER_DUP_ENTRY
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
@@ -219,7 +219,7 @@ if ($any_unique)
# @my_errno AS sql_errno;
if (`SELECT @my_errno NOT IN (0,$ER_DUP_KEY,$ER_DUP_ENTRY)`)
{
- --echo # The last command got an unexepected error response.
+ --echo # The last command got an unexpected error response.
--echo # Expected/handled SQL codes are 0,$ER_DUP_KEY,$ER_DUP_ENTRY
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
@@ -255,7 +255,7 @@ if ($any_unique)
# @my_errno AS sql_errno;
if (`SELECT @my_errno NOT IN (0,$ER_DUP_KEY,$ER_DUP_ENTRY)`)
{
- --echo # The last command got an unexepected error response.
+ --echo # The last command got an unexpected error response.
--echo # Expected/handled SQL codes are 0,$ER_DUP_KEY,$ER_DUP_ENTRY
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
@@ -503,7 +503,7 @@ if ($no_debug)
eval SET @my_errno = $mysql_errno;
if (`SELECT @my_errno NOT IN (0,$ER_SAME_NAME_PARTITION,$ER_NO_PARTITION_FOR_GIVEN_VALUE)`)
{
- --echo # The last command got an unexepected error response.
+ --echo # The last command got an unexpected error response.
--echo # Expected/handled SQL codes are 0,$ER_SAME_NAME_PARTITION,$ER_NO_PARTITION_FOR_GIVEN_VALUE
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
@@ -566,7 +566,7 @@ eval SET @my_errno = $mysql_errno;
let $run= `SELECT @my_errno = 0`;
if (`SELECT @my_errno NOT IN (0,$ER_BAD_NULL_ERROR)`)
{
- --echo # The last command got an unexepected error response.
+ --echo # The last command got an unexpected error response.
--echo # Expected/handled SQL codes are 0,$ER_BAD_NULL_ERROR
SELECT '# SQL code we got was: ' AS "", @my_errno AS "";
--echo # Sorry, have to abort.
diff --git a/mysql-test/suite/parts/inc/partition_check_drop.inc b/mysql-test/suite/parts/inc/partition_check_drop.inc
index daaa5e541c7..7f8b5b7929b 100644
--- a/mysql-test/suite/parts/inc/partition_check_drop.inc
+++ b/mysql-test/suite/parts/inc/partition_check_drop.inc
@@ -26,16 +26,18 @@ if ($do_file_tests)
{
let $ls_file= $MYSQLD_DATADIR/test/tmp2;
# List the files belonging to the table t1
+ --replace_result $MYSQLTEST_VARDIR \$MYSQLTEST_VARDIR #p# #P# #sp# #SP#
--list_files_write_file $ls_file $MYSQLD_DATADIR/test t1*
--chmod 0644 $ls_file
if ($with_directories)
{
+ --replace_result $MYSQLTEST_VARDIR \$MYSQLTEST_VARDIR #p# #P# #sp# #SP#
--list_files_append_file $ls_file $MYSQLTEST_VARDIR/tmp t1*
}
eval SET @aux = load_file('$ls_file');
# clean up
- remove_file $ls_file;
+ --remove_file $ls_file
}
if (!$do_file_tests)
{
@@ -60,16 +62,15 @@ if ($found_garbage)
--echo # <alter partitioning> worked incomplete.
--echo # We found:
# Print the list of files into the protocol
- eval SELECT REPLACE(file_list,'$MYSQLTEST_VARDIR','\$MYSQLTEST_VARDIR')
- AS "unified filelist"
+ eval SELECT file_list AS "unified filelist"
FROM t0_definition WHERE state = 'old';
}
# Do a manual cleanup, because the following tests should not suffer from
# remaining files
- --exec rm -f $MYSQLD_DATADIR/test/t1* || true
+ --remove_files_wildcard $MYSQLD_DATADIR/test t1*
if ($with_directories)
{
- --exec rm -f $MYSQLTEST_VARDIR/tmp/t1* || true
+ --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1*
}
}
--enable_query_log
diff --git a/mysql-test/suite/parts/inc/partition_crash.inc b/mysql-test/suite/parts/inc/partition_crash.inc
index f18b8728784..b8a7c61792b 100644
--- a/mysql-test/suite/parts/inc/partition_crash.inc
+++ b/mysql-test/suite/parts/inc/partition_crash.inc
@@ -3,7 +3,7 @@
--eval $create_statement
--eval $insert_statement
--echo # State before crash
---replace_result #p# #P#
+--replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
--sorted_result
@@ -14,13 +14,13 @@ SELECT * FROM t1;
--error 2013
--eval $crash_statement
--echo # State after crash (before recovery)
---replace_regex /sqlx.*\./sqlx-nnnn_nnnn./ /#p#/#P#/
+--replace_regex /sqlx.*\./sqlx-nnnn_nnnn./ /#p#/#P#/ /#sp#/#SP#/ /#tmp#/#TMP#/
--list_files $DATADIR/test
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc
--echo # State after crash recovery
---replace_result #p# #P#
+--replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
--sorted_result
diff --git a/mysql-test/suite/parts/inc/partition_decimal.inc b/mysql-test/suite/parts/inc/partition_decimal.inc
index 95ef878b957..93e9e48c9c9 100644
--- a/mysql-test/suite/parts/inc/partition_decimal.inc
+++ b/mysql-test/suite/parts/inc/partition_decimal.inc
@@ -39,10 +39,8 @@ 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.
+# CEILING() do not, unless they have an INT or DECIMAL argument.
---disable_parsing
eval create table t3 (a decimal(18,9) not null, primary key(a)) engine=$engine
partition by range (floor(a)) subpartition by key (a) subpartitions 2 (
@@ -70,7 +68,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 (floor(a)) subpartition by key (a) subpartitions 2 (
+partition by list (ceiling(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),
@@ -93,6 +91,3 @@ commit;
--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_double.inc b/mysql-test/suite/parts/inc/partition_double.inc
index aef5aa4f675..9e43887be09 100644
--- a/mysql-test/suite/parts/inc/partition_double.inc
+++ b/mysql-test/suite/parts/inc/partition_double.inc
@@ -37,61 +37,3 @@ commit;
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 (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)
-);
-show create table t3;
-let $count=9;
---echo $count*3 inserts;
---disable_query_log
-begin;
-while ($count)
-{
-eval insert into t3 values ($count);
-eval insert into t3 values ($count+0.33);
-eval insert into t3 values ($count+0.75);
-dec $count;
-}
-commit;
---enable_query_log
-select count(*) from t3;
-select * from t3;
-drop table t3;
-
-eval create table t4 (a double not null, primary key(a)) engine=$engine
-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)
-);
-show create table t4;
-let $count=9;
---echo $count*3 inserts;
---disable_query_log
-begin;
-while ($count)
-{
-eval insert into t4 values ($count);
-eval insert into t4 values ($count+0.33);
-eval insert into t4 values ($count+0.75);
-dec $count;
-}
-commit;
---enable_query_log
-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_fail.inc b/mysql-test/suite/parts/inc/partition_fail.inc
index 6942b40042a..dd79cdf1dc8 100644
--- a/mysql-test/suite/parts/inc/partition_fail.inc
+++ b/mysql-test/suite/parts/inc/partition_fail.inc
@@ -3,6 +3,7 @@
--eval $create_statement
--eval $insert_statement
--echo # State before failure
+--replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
--sorted_result
@@ -11,8 +12,31 @@ SELECT * FROM t1;
--eval $fail_statement
--enable_abort_on_error
--echo # State after failure
+--replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test
SHOW CREATE TABLE t1;
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;
+
+--echo # Same test under LOCK TABLE
+--eval $create_statement
+--eval $insert_statement
+--echo # State before failure
+--replace_result #p# #P# #sp# #SP#
+--list_files $DATADIR/test
+SHOW CREATE TABLE t1;
+--sorted_result
+SELECT * FROM t1;
+LOCK TABLE t1 WRITE;
+--disable_abort_on_error
+--eval $fail_statement
+--enable_abort_on_error
+--echo # State after failure
+--replace_result #p# #P# #sp# #SP#
+--list_files $DATADIR/test
+SHOW CREATE TABLE t1;
+--sorted_result
+SELECT * FROM t1;
+UNLOCK TABLES;
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/inc/partition_float.inc b/mysql-test/suite/parts/inc/partition_float.inc
index 8da12a3e5bd..b9c6af84fc4 100644
--- a/mysql-test/suite/parts/inc/partition_float.inc
+++ b/mysql-test/suite/parts/inc/partition_float.inc
@@ -40,61 +40,3 @@ commit;
--enable_query_log
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 (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)
-);
-show create table t3;
-let $count=9;
---echo $count*3 inserts;
---disable_query_log
-begin;
-while ($count)
-{
-eval insert into t3 values ($count);
-eval insert into t3 values ($count+0.33);
-eval insert into t3 values ($count+0.75);
-dec $count;
-}
-commit;
---enable_query_log
-select count(*) from t3;
-select * from t3;
-drop table t3;
-
-eval create table t4 (a float not null, primary key(a)) engine=$engine
-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)
-);
-show create table t4;
-let $count=9;
---echo $count*3 inserts;
---disable_query_log
-begin;
-while ($count)
-{
-eval insert into t4 values ($count);
-eval insert into t4 values ($count+0.33);
-eval insert into t4 values ($count+0.75);
-dec $count;
-}
-commit;
---enable_query_log
-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.inc b/mysql-test/suite/parts/inc/partition_layout.inc
index 67d0fd4c0e9..12fbfb9a46a 100644
--- a/mysql-test/suite/parts/inc/partition_layout.inc
+++ b/mysql-test/suite/parts/inc/partition_layout.inc
@@ -10,6 +10,6 @@ eval SHOW CREATE TABLE t1;
if ($ls)
{
let $MYSQLD_DATADIR= `select @@datadir`;
- --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+ --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR #p# #P# #sp# #SP#
--list_files $MYSQLD_DATADIR/test t1*
}
diff --git a/mysql-test/suite/parts/inc/partition_layout_check1.inc b/mysql-test/suite/parts/inc/partition_layout_check1.inc
index bca41b6f9c7..76df4c1a250 100644
--- a/mysql-test/suite/parts/inc/partition_layout_check1.inc
+++ b/mysql-test/suite/parts/inc/partition_layout_check1.inc
@@ -29,14 +29,10 @@ DELETE FROM t0_definition;
let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`;
#echo MYSQLD_DATADIR: $MYSQLD_DATADIR;
-# Dump the current definition of the table t1 to tmp1
-# This complicated method - let another mysqltest collect the output - is used
-# because of two reasons
+# Save the current definition of the table t1
# - SHOW CREATE TABLE t1 is at least currently most probably more reliable than
# the corresponding SELECT on the INFORMATION_SCHEMA
-# - SHOW CREATE TABLE .. cannot write its out put into a file like SELECT
-let $show_file= $MYSQLD_DATADIR/test/tmp1;
---exec echo "SHOW CREATE TABLE t1; exit; " | $MYSQL_TEST > $show_file 2>&1
+let $show_create= `SHOW CREATE TABLE t1`;
if ($do_file_tests)
{
# List the files belonging to the table t1
@@ -49,6 +45,9 @@ if ($do_file_tests)
--list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1*
}
eval SET @aux = load_file('$ls_file');
+
+ # clean up
+ --remove_file $ls_file
}
if (!$do_file_tests)
{
@@ -57,19 +56,20 @@ if (!$do_file_tests)
# Insert the current definition of the table t1 into t0_definition
eval INSERT INTO t0_definition SET state = 'old',
- create_command = load_file('$show_file'),
+ create_command = "$show_create",
file_list = @aux;
# Print the create table statement into the protocol
+# Added the concat to avoid changing the result files
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR '\r' ''
-SELECT create_command FROM t0_definition WHERE state = 'old';
+SELECT concat('SHOW CREATE TABLE t1;\nTable\tCreate Table\n',create_command,'\n') as `create_command` FROM t0_definition WHERE state = 'old';
if ($do_file_tests)
{
# We stored the list of files, therefore printing the content makes sense
if ($ls)
{
# Print the list of files into the protocol
- replace_result $MYSQLD_DATADIR MYSQLD_DATADIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR;
+ replace_result $MYSQLD_DATADIR MYSQLD_DATADIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR #p# #P# #sp# #SP# part_n part_N;
SELECT file_list AS "unified filelist"
FROM t0_definition WHERE state = 'old';
}
diff --git a/mysql-test/suite/parts/inc/partition_layout_check2.inc b/mysql-test/suite/parts/inc/partition_layout_check2.inc
index 7ff871a4c45..23e4a9e1e95 100644
--- a/mysql-test/suite/parts/inc/partition_layout_check2.inc
+++ b/mysql-test/suite/parts/inc/partition_layout_check2.inc
@@ -28,9 +28,8 @@ DELETE FROM t0_definition WHERE state = 'new';
let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`;
#echo MYSQLD_DATADIR: $MYSQLD_DATADIR;
-# Dump the current definition of the table t1 to tmp1
-let $show_file= $MYSQLD_DATADIR/test/tmp1;
---exec echo "SHOW CREATE TABLE t1; exit; " | $MYSQL_TEST > $show_file 2>&1
+# Save the current definition of the table t1
+let $show_create= `SHOW CREATE TABLE t1`;
if ($do_file_tests)
{
@@ -44,6 +43,9 @@ if ($do_file_tests)
--list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-test-idx-dir t1*
}
eval SET @aux = load_file('$ls_file');
+
+ # clean up
+ --remove_file $ls_file
}
if (!$do_file_tests)
{
@@ -52,7 +54,7 @@ if (!$do_file_tests)
# Insert the current definition of the table t1 into t0_definition
eval INSERT INTO t0_definition SET state = 'new',
- create_command = load_file('$show_file'),
+ create_command = "$show_create",
file_list = @aux;
# Print the old and new table layout, if they differ
@@ -65,7 +67,7 @@ let $run= `SELECT @aux`;
if ($run)
{
--vertical_results
- --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+ --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR #p# #P# #sp# #SP#
SELECT state,
REPLACE(create_command,'\n',' ') AS "Table definition",
REPLACE(file_list ,'\n',' ') AS "File list"
diff --git a/mysql-test/suite/parts/r/ndb_dd_backuprestore.result b/mysql-test/suite/parts/r/ndb_dd_backuprestore.result
deleted file mode 100644
index 12a65a433a3..00000000000
--- a/mysql-test/suite/parts/r/ndb_dd_backuprestore.result
+++ /dev/null
@@ -1,512 +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 = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-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 = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-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 = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-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/parts/r/part_supported_sql_func_innodb.result b/mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
index 79462c25050..c5b4e0a8665 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
@@ -5425,513 +5425,6 @@ drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
-------------------------------------------------------------------------
---- dayofyear(col1) in partition with coltype char(30)
--------------------------------------------------------------------------
-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 dayofyear(col1)
--------------------------------------------------------------------------
-create table t1 (col1 char(30)) engine='INNODB'
-partition by range(dayofyear(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 char(30)) engine='INNODB'
-partition by list(dayofyear(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(30)) engine='INNODB'
-partition by hash(dayofyear(col1));
-create table t4 (colint int, col1 char(30)) engine='INNODB'
-partition by range(colint)
-subpartition by hash(dayofyear(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 char(30)) engine='INNODB'
-partition by list(colint)
-subpartition by hash(dayofyear(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(30)) engine='INNODB'
-partition by range(colint)
-(partition p0 values less than (dayofyear('2006-12-25')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with dayofyear(col1)
--------------------------------------------------------------------------
-insert into t1 values ('2006-01-03');
-insert into t1 values ('2006-01-17');
-insert into t2 values ('2006-01-03');
-insert into t2 values ('2006-01-17');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
-select dayofyear(col1) from t1 order by col1;
-dayofyear(col1)
-3
-17
-select * from t1 order by col1;
-col1
-2006-01-03
-2006-01-17
-select * from t2 order by col1;
-col1
-2006-01-03
-2006-01-17
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-03
-2006-01-17
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-update t1 set col1='2006-02-05' where col1='2006-01-03';
-update t2 set col1='2006-02-05' where col1='2006-01-03';
-update t3 set col1='2006-02-05' where col1='2006-01-03';
-update t4 set col1='2006-02-05' where col1='2006-01-03';
-update t5 set col1='2006-02-05' where col1='2006-01-03';
-update t6 set col1='2006-02-05' where col1='2006-01-03';
-select * from t1 order by col1;
-col1
-2006-01-17
-2006-02-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with dayofyear(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(dayofyear(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(dayofyear(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(dayofyear(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(dayofyear(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(dayofyear(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 (dayofyear('2006-12-25')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-2006-01-17
-2006-02-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- 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
-2006-01-17
-2006-02-05
-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-05
-alter table t55
-partition by list(colint)
-subpartition by hash(dayofyear(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(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (dayofyear(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
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (dayofyear('2006-12-25')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (dayofyear('2006-12-25')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with dayofyear(col1)
--------------------------------------------------------------------------
-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-05
-select * from t2 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-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-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-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
-2006-01-17
-2006-02-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with dayofyear(col1)
--------------------------------------------------------------------------
-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-05
-select * from t22 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-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-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-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
-2006-01-17
-2006-02-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
--------------------------
----- 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 ;
--------------------------------------------------------------------------
--- extract(month from col1) in partition with coltype date
-------------------------------------------------------------------------
drop table if exists t1 ;
@@ -8489,525 +7982,6 @@ drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
-------------------------------------------------------------------------
---- second(col1) in partition with coltype char(30)
--------------------------------------------------------------------------
-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 second(col1)
--------------------------------------------------------------------------
-create table t1 (col1 char(30)) engine='INNODB'
-partition by range(second(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 char(30)) engine='INNODB'
-partition by list(second(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(30)) engine='INNODB'
-partition by hash(second(col1));
-create table t4 (colint int, col1 char(30)) engine='INNODB'
-partition by range(colint)
-subpartition by hash(second(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 char(30)) engine='INNODB'
-partition by list(colint)
-subpartition by hash(second(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(30)) engine='INNODB'
-partition by range(colint)
-(partition p0 values less than (second('18:30:14')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with second(col1)
--------------------------------------------------------------------------
-insert into t1 values ('09:09:09');
-insert into t1 values ('14:30:20');
-insert into t2 values ('09:09:09');
-insert into t2 values ('14:30:20');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
-select second(col1) from t1 order by col1;
-second(col1)
-9
-20
-select * from t1 order by col1;
-col1
-09:09:09
-14:30:20
-select * from t2 order by col1;
-col1
-09:09:09
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-09:09:09
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t5 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t6 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-update t1 set col1='10:22:33' where col1='09:09:09';
-update t2 set col1='10:22:33' where col1='09:09:09';
-update t3 set col1='10:22:33' where col1='09:09:09';
-update t4 set col1='10:22:33' where col1='09:09:09';
-update t5 set col1='10:22:33' where col1='09:09:09';
-update t6 set col1='10:22:33' where col1='09:09:09';
-select * from t1 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t2 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t5 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t6 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
--------------------------------------------------------------------------
---- Alter tables with second(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(second(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(second(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(second(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(second(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(second(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 (second('18:30:14')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t22 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t55 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
----------------------------
----- 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
-10:22:33
-14:30:20
-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
-10:22:33
-14:30:20
-alter table t55
-partition by list(colint)
-subpartition by hash(second(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(30) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (second(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 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (second('18:30:14')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (second('18:30:14')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with second(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='14:30:20';
-delete from t2 where col1='14:30:20';
-delete from t3 where col1='14:30:20';
-delete from t4 where col1='14:30:20';
-delete from t5 where col1='14:30:20';
-delete from t6 where col1='14:30:20';
-select * from t1 order by col1;
-col1
-10:22:33
-select * from t2 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t5 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-insert into t1 values ('14:30:20');
-insert into t2 values ('14:30:20');
-insert into t3 values ('14:30:20');
-insert into t4 values (60,'14:30:20');
-insert into t5 values (60,'14:30:20');
-insert into t6 values (60,'14:30:20');
-select * from t1 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t2 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-select * from t5 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-select * from t6 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-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
-10:22:33
-14:30:20
-select * from t2 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-60 14:30:20
-select * from t5 order by colint;
-colint col1
-60 14:30:20
-select * from t6 order by colint;
-colint col1
-60 14:30:20
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with second(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='14:30:20';
-delete from t22 where col1='14:30:20';
-delete from t33 where col1='14:30:20';
-delete from t44 where col1='14:30:20';
-delete from t55 where col1='14:30:20';
-delete from t66 where col1='14:30:20';
-select * from t11 order by col1;
-col1
-10:22:33
-select * from t22 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t55 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-insert into t11 values ('14:30:20');
-insert into t22 values ('14:30:20');
-insert into t33 values ('14:30:20');
-insert into t44 values (60,'14:30:20');
-insert into t55 values (60,'14:30:20');
-insert into t66 values (60,'14:30:20');
-select * from t11 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t22 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-select * from t55 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-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
-10:22:33
-14:30:20
-select * from t22 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t44 order by colint;
-colint col1
-60 14:30:20
-select * from t55 order by colint;
-colint col1
-60 14:30:20
-select * from t66 order by colint;
-colint col1
-60 14:30:20
--------------------------
----- 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 ;
--------------------------------------------------------------------------
--- month(col1) in partition with coltype date
-------------------------------------------------------------------------
drop table if exists t1 ;
@@ -10549,1024 +9523,6 @@ drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
-------------------------------------------------------------------------
---- to_days(col1)-to_days('2006-01-01') in partition with coltype date
--------------------------------------------------------------------------
-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 to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='INNODB'
-partition by range(to_days(col1)-to_days('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(to_days(col1)-to_days('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),
-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 date) engine='INNODB'
-partition by hash(to_days(col1)-to_days('2006-01-01'));
-create table t4 (colint int, col1 date) engine='INNODB'
-partition by range(colint)
-subpartition by hash(to_days(col1)-to_days('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(to_days(col1)-to_days('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),
-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 date) engine='INNODB'
-partition by range(colint)
-(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/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
-33
-select * from t1 order by col1;
-col1
-2006-01-17
-2006-02-03
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t4 order by colint;
-colint col1
-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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-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(to_days(col1)-to_days('2006-01-01'))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(to_days(col1)-to_days('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),
-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(to_days(col1)-to_days('2006-01-01'));
-alter table t44
-partition by range(colint)
-subpartition by hash(to_days(col1)-to_days('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(to_days(col1)-to_days('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),
-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 (to_days('2006-02-02')-to_days('2006-01-01')),
-partition p1 values less than maxvalue);
-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
-select * from t44 order by colint;
-colint col1
-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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- 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
-2006-01-17
-2006-02-06
-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
-alter table t55
-partition by list(colint)
-subpartition by hash(to_days(col1)-to_days('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),
-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` date DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (to_days(col1)-to_days('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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-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 (to_days('2006-02-02')-to_days('2006-01-01')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-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 (to_days('2006-02-02')-to_days('2006-01-01')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-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
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-06
-select * from t4 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t4 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-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
-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
-select * from t4 order by colint;
-colint col1
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-60 2006-01-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-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
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-06
-select * from t44 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t44 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-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
-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
-select * from t44 order by colint;
-colint col1
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-60 2006-01-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- datediff(col1, '2006-01-01') in partition with coltype date
--------------------------------------------------------------------------
-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 datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='INNODB'
-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(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),
-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 date) engine='INNODB'
-partition by hash(datediff(col1, '2006-01-01'));
-create table t4 (colint int, col1 date) engine='INNODB'
-partition by range(colint)
-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(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),
-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 date) engine='INNODB'
-partition by range(colint)
-(partition p0 values less than (datediff('2006-02-02', '2006-01-01')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/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-01-17
-2006-02-03
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t4 order by colint;
-colint col1
-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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-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(datediff(col1, '2006-01-01'))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-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),
-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(datediff(col1, '2006-01-01'));
-alter table t44
-partition by range(colint)
-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(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),
-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 (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
-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
-select * from t44 order by colint;
-colint col1
-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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- 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
-2006-01-17
-2006-02-06
-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
-alter table t55
-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),
-partition p1 values in (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` date DEFAULT NULL
-) 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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-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 (datediff('2006-02-02', '2006-01-01')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-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 (datediff('2006-02-02', '2006-01-01')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-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
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-06
-select * from t4 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t4 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-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
-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
-select * from t4 order by colint;
-colint col1
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-60 2006-01-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-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
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-06
-select * from t44 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t44 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-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
-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
-select * from t44 order by colint;
-colint col1
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-60 2006-01-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
--- weekday(col1) in partition with coltype date
-------------------------------------------------------------------------
drop table if exists t1 ;
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 375a6e130be..3cd8e10a4f3 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
@@ -5425,513 +5425,6 @@ drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
-------------------------------------------------------------------------
---- dayofyear(col1) in partition with coltype char(30)
--------------------------------------------------------------------------
-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 dayofyear(col1)
--------------------------------------------------------------------------
-create table t1 (col1 char(30)) engine='MYISAM'
-partition by range(dayofyear(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 char(30)) engine='MYISAM'
-partition by list(dayofyear(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(30)) engine='MYISAM'
-partition by hash(dayofyear(col1));
-create table t4 (colint int, col1 char(30)) engine='MYISAM'
-partition by range(colint)
-subpartition by hash(dayofyear(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 char(30)) engine='MYISAM'
-partition by list(colint)
-subpartition by hash(dayofyear(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(30)) engine='MYISAM'
-partition by range(colint)
-(partition p0 values less than (dayofyear('2006-12-25')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with dayofyear(col1)
--------------------------------------------------------------------------
-insert into t1 values ('2006-01-03');
-insert into t1 values ('2006-01-17');
-insert into t2 values ('2006-01-03');
-insert into t2 values ('2006-01-17');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
-select dayofyear(col1) from t1 order by col1;
-dayofyear(col1)
-3
-17
-select * from t1 order by col1;
-col1
-2006-01-03
-2006-01-17
-select * from t2 order by col1;
-col1
-2006-01-03
-2006-01-17
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-03
-2006-01-17
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-update t1 set col1='2006-02-05' where col1='2006-01-03';
-update t2 set col1='2006-02-05' where col1='2006-01-03';
-update t3 set col1='2006-02-05' where col1='2006-01-03';
-update t4 set col1='2006-02-05' where col1='2006-01-03';
-update t5 set col1='2006-02-05' where col1='2006-01-03';
-update t6 set col1='2006-02-05' where col1='2006-01-03';
-select * from t1 order by col1;
-col1
-2006-01-17
-2006-02-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with dayofyear(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(dayofyear(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(dayofyear(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(dayofyear(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(dayofyear(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(dayofyear(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 (dayofyear('2006-12-25')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-2006-01-17
-2006-02-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- 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
-2006-01-17
-2006-02-05
-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-05
-alter table t55
-partition by list(colint)
-subpartition by hash(dayofyear(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(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (dayofyear(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
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (dayofyear('2006-12-25')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (dayofyear('2006-12-25')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with dayofyear(col1)
--------------------------------------------------------------------------
-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-05
-select * from t2 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-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-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-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
-2006-01-17
-2006-02-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with dayofyear(col1)
--------------------------------------------------------------------------
-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-05
-select * from t22 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-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-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-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
-2006-01-17
-2006-02-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
--------------------------
----- 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 ;
--------------------------------------------------------------------------
--- extract(month from col1) in partition with coltype date
-------------------------------------------------------------------------
drop table if exists t1 ;
@@ -8489,525 +7982,6 @@ drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
-------------------------------------------------------------------------
---- second(col1) in partition with coltype char(30)
--------------------------------------------------------------------------
-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 second(col1)
--------------------------------------------------------------------------
-create table t1 (col1 char(30)) engine='MYISAM'
-partition by range(second(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 char(30)) engine='MYISAM'
-partition by list(second(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(30)) engine='MYISAM'
-partition by hash(second(col1));
-create table t4 (colint int, col1 char(30)) engine='MYISAM'
-partition by range(colint)
-subpartition by hash(second(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 char(30)) engine='MYISAM'
-partition by list(colint)
-subpartition by hash(second(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(30)) engine='MYISAM'
-partition by range(colint)
-(partition p0 values less than (second('18:30:14')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with second(col1)
--------------------------------------------------------------------------
-insert into t1 values ('09:09:09');
-insert into t1 values ('14:30:20');
-insert into t2 values ('09:09:09');
-insert into t2 values ('14:30:20');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
-select second(col1) from t1 order by col1;
-second(col1)
-9
-20
-select * from t1 order by col1;
-col1
-09:09:09
-14:30:20
-select * from t2 order by col1;
-col1
-09:09:09
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-09:09:09
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t5 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t6 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-update t1 set col1='10:22:33' where col1='09:09:09';
-update t2 set col1='10:22:33' where col1='09:09:09';
-update t3 set col1='10:22:33' where col1='09:09:09';
-update t4 set col1='10:22:33' where col1='09:09:09';
-update t5 set col1='10:22:33' where col1='09:09:09';
-update t6 set col1='10:22:33' where col1='09:09:09';
-select * from t1 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t2 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t5 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t6 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
--------------------------------------------------------------------------
---- Alter tables with second(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(second(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(second(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(second(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(second(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(second(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 (second('18:30:14')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t22 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t55 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
----------------------------
----- 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
-10:22:33
-14:30:20
-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
-10:22:33
-14:30:20
-alter table t55
-partition by list(colint)
-subpartition by hash(second(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(30) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (second(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 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (second('18:30:14')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-alter table t66
-reorganize partition s1 into
-(partition p0 values less than (second('18:30:14')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with second(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='14:30:20';
-delete from t2 where col1='14:30:20';
-delete from t3 where col1='14:30:20';
-delete from t4 where col1='14:30:20';
-delete from t5 where col1='14:30:20';
-delete from t6 where col1='14:30:20';
-select * from t1 order by col1;
-col1
-10:22:33
-select * from t2 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t5 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-insert into t1 values ('14:30:20');
-insert into t2 values ('14:30:20');
-insert into t3 values ('14:30:20');
-insert into t4 values (60,'14:30:20');
-insert into t5 values (60,'14:30:20');
-insert into t6 values (60,'14:30:20');
-select * from t1 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t2 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-select * from t5 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-select * from t6 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-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
-10:22:33
-14:30:20
-select * from t2 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-60 14:30:20
-select * from t5 order by colint;
-colint col1
-60 14:30:20
-select * from t6 order by colint;
-colint col1
-60 14:30:20
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with second(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='14:30:20';
-delete from t22 where col1='14:30:20';
-delete from t33 where col1='14:30:20';
-delete from t44 where col1='14:30:20';
-delete from t55 where col1='14:30:20';
-delete from t66 where col1='14:30:20';
-select * from t11 order by col1;
-col1
-10:22:33
-select * from t22 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t55 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-insert into t11 values ('14:30:20');
-insert into t22 values ('14:30:20');
-insert into t33 values ('14:30:20');
-insert into t44 values (60,'14:30:20');
-insert into t55 values (60,'14:30:20');
-insert into t66 values (60,'14:30:20');
-select * from t11 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t22 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-select * from t55 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-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
-10:22:33
-14:30:20
-select * from t22 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t44 order by colint;
-colint col1
-60 14:30:20
-select * from t55 order by colint;
-colint col1
-60 14:30:20
-select * from t66 order by colint;
-colint col1
-60 14:30:20
--------------------------
----- 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 ;
--------------------------------------------------------------------------
--- month(col1) in partition with coltype date
-------------------------------------------------------------------------
drop table if exists t1 ;
@@ -10549,1024 +9523,6 @@ drop table if exists t44 ;
drop table if exists t55 ;
drop table if exists t66 ;
-------------------------------------------------------------------------
---- to_days(col1)-to_days('2006-01-01') in partition with coltype date
--------------------------------------------------------------------------
-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 to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='MYISAM'
-partition by range(to_days(col1)-to_days('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(to_days(col1)-to_days('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),
-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 date) engine='MYISAM'
-partition by hash(to_days(col1)-to_days('2006-01-01'));
-create table t4 (colint int, col1 date) engine='MYISAM'
-partition by range(colint)
-subpartition by hash(to_days(col1)-to_days('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(to_days(col1)-to_days('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),
-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 date) engine='MYISAM'
-partition by range(colint)
-(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/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
-33
-select * from t1 order by col1;
-col1
-2006-01-17
-2006-02-03
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t4 order by colint;
-colint col1
-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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-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(to_days(col1)-to_days('2006-01-01'))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(to_days(col1)-to_days('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),
-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(to_days(col1)-to_days('2006-01-01'));
-alter table t44
-partition by range(colint)
-subpartition by hash(to_days(col1)-to_days('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(to_days(col1)-to_days('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),
-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 (to_days('2006-02-02')-to_days('2006-01-01')),
-partition p1 values less than maxvalue);
-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
-select * from t44 order by colint;
-colint col1
-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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- 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
-2006-01-17
-2006-02-06
-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
-alter table t55
-partition by list(colint)
-subpartition by hash(to_days(col1)-to_days('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),
-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` date DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (to_days(col1)-to_days('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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-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 (to_days('2006-02-02')-to_days('2006-01-01')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-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 (to_days('2006-02-02')-to_days('2006-01-01')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-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
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-06
-select * from t4 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t4 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-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
-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
-select * from t4 order by colint;
-colint col1
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-60 2006-01-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-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
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-06
-select * from t44 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t44 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-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
-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
-select * from t44 order by colint;
-colint col1
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-60 2006-01-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- datediff(col1, '2006-01-01') in partition with coltype date
--------------------------------------------------------------------------
-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 datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='MYISAM'
-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(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),
-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 date) engine='MYISAM'
-partition by hash(datediff(col1, '2006-01-01'));
-create table t4 (colint int, col1 date) engine='MYISAM'
-partition by range(colint)
-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(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),
-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 date) engine='MYISAM'
-partition by range(colint)
-(partition p0 values less than (datediff('2006-02-02', '2006-01-01')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/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-01-17
-2006-02-03
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t4 order by colint;
-colint col1
-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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-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(datediff(col1, '2006-01-01'))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-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),
-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(datediff(col1, '2006-01-01'));
-alter table t44
-partition by range(colint)
-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(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),
-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 (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
-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
-select * from t44 order by colint;
-colint col1
-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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- 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
-2006-01-17
-2006-02-06
-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
-alter table t55
-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),
-partition p1 values in (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` date DEFAULT NULL
-) 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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-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 (datediff('2006-02-02', '2006-01-01')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-alter table t66
-reorganize partition p0,p1 into
-(partition s1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-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 (datediff('2006-02-02', '2006-01-01')),
-partition p1 values less than maxvalue);
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-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
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-06
-select * from t4 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t4 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-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
-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
-select * from t4 order by colint;
-colint col1
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-60 2006-01-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-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
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-06
-select * from t44 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t44 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-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
-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
-select * from t44 order by colint;
-colint col1
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-60 2006-01-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
--- weekday(col1) in partition with coltype date
-------------------------------------------------------------------------
drop table if exists t1 ;
diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result b/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result
deleted file mode 100644
index a1e10ee4a9c..00000000000
--- a/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result
+++ /dev/null
@@ -1,9918 +0,0 @@
--------------------------------------------------------------------------
---- abs(col1) in partition with coltype int
--------------------------------------------------------------------------
-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 abs(col1)
--------------------------------------------------------------------------
-create table t1 (col1 int) engine='NDB'
-partition by range(abs(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 int) engine='NDB'
-partition by list(abs(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 int) engine='NDB'
-partition by hash(abs(col1));
-create table t4 (colint int, col1 int) engine='NDB'
-partition by range(colint)
-subpartition by hash(abs(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 int) engine='NDB'
-partition by list(colint)
-subpartition by hash(abs(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 int) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (abs(15)),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with abs(col1)
--------------------------------------------------------------------------
-insert into t1 values (5 );
-insert into t1 values (13 );
-insert into t2 values (5 );
-insert into t2 values (13 );
-insert into t2 values (17 );
-insert into t3 values (5 );
-insert into t3 values (13 );
-insert into t3 values (17 );
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t6;
-select abs(col1) from t1 order by col1;
-abs(col1)
-5
-13
-select * from t1 order by col1;
-col1
-5
-13
-select * from t2 order by col1;
-col1
-5
-13
-17
-select * from t3 order by col1;
-col1
-5
-13
-17
-select * from t4 order by colint;
-colint col1
-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
-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
-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
-13
-15
-select * from t2 order by col1;
-col1
-13
-15
-17
-select * from t3 order by col1;
-col1
-13
-15
-17
-select * from t4 order by colint;
-colint col1
-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 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 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 abs(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(abs(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(abs(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(abs(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(abs(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(abs(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (abs(15)),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-13
-15
-select * from t22 order by col1;
-col1
-13
-15
-17
-select * from t33 order by col1;
-col1
-13
-15
-17
-select * from t44 order by colint;
-colint col1
-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 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 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
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(abs(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (abs(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-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 abs(col1)
--------------------------------------------------------------------------
-delete from t1 where col1=13 ;
-delete from t2 where col1=13 ;
-delete from t3 where col1=13 ;
-delete from t4 where col1=13 ;
-delete from t5 where col1=13 ;
-delete from t6 where col1=13 ;
-select * from t1 order by col1;
-col1
-15
-select * from t2 order by col1;
-col1
-15
-17
-select * from t3 order by col1;
-col1
-15
-17
-select * from t4 order by colint;
-colint col1
-1 15
-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 15
-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 (13 );
-insert into t2 values (13 );
-insert into t3 values (13 );
-insert into t4 values (60,13 );
-insert into t5 values (60,13 );
-insert into t6 values (60,13 );
-select * from t1 order by col1;
-col1
-13
-15
-select * from t2 order by col1;
-col1
-13
-15
-17
-select * from t3 order by col1;
-col1
-13
-15
-17
-select * from t4 order by colint;
-colint col1
-1 15
-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 13
-select * from t5 order by colint;
-colint col1
-1 15
-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 13
-select * from t6 order by colint;
-colint col1
-1 15
-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 13
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with abs(col1)
--------------------------------------------------------------------------
-delete from t11 where col1=13 ;
-delete from t22 where col1=13 ;
-delete from t33 where col1=13 ;
-delete from t44 where col1=13 ;
-delete from t55 where col1=13 ;
-delete from t66 where col1=13 ;
-select * from t11 order by col1;
-col1
-15
-select * from t22 order by col1;
-col1
-15
-17
-select * from t33 order by col1;
-col1
-15
-17
-select * from t44 order by colint;
-colint col1
-1 15
-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 15
-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 (13 );
-insert into t22 values (13 );
-insert into t33 values (13 );
-insert into t44 values (60,13 );
-insert into t55 values (60,13 );
-insert into t66 values (60,13 );
-select * from t11 order by col1;
-col1
-13
-15
-select * from t22 order by col1;
-col1
-13
-15
-17
-select * from t33 order by col1;
-col1
-13
-15
-17
-select * from t44 order by colint;
-colint col1
-1 15
-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 13
-select * from t55 order by colint;
-colint col1
-1 15
-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 13
-select * from t66 order by colint;
-colint col1
-1 15
-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 13
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- mod(col1,10) in partition with coltype int
--------------------------------------------------------------------------
-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 mod(col1,10)
--------------------------------------------------------------------------
-create table t1 (col1 int) engine='NDB'
-partition by range(mod(col1,10))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 int) engine='NDB'
-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),
-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 int) engine='NDB'
-partition by hash(mod(col1,10));
-create table t4 (colint int, col1 int) engine='NDB'
-partition by range(colint)
-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 int) engine='NDB'
-partition by list(colint)
-subpartition by hash(mod(col1,10)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 int) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (mod(15,10)),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with mod(col1,10)
--------------------------------------------------------------------------
-insert into t1 values (5);
-insert into t1 values (19);
-insert into t2 values (5);
-insert into t2 values (19);
-insert into t2 values (17);
-insert into t3 values (5);
-insert into t3 values (19);
-insert into t3 values (17);
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_int.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/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
-19
-select * from t2 order by col1;
-col1
-5
-17
-19
-select * from t3 order by col1;
-col1
-5
-17
-19
-select * from t4 order by colint;
-colint col1
-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
-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
-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
-19
-select * from t2 order by col1;
-col1
-15
-17
-19
-select * from t3 order by col1;
-col1
-15
-17
-19
-select * from t4 order by colint;
-colint col1
-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 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 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 mod(col1,10)
--------------------------------------------------------------------------
-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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(mod(col1,10))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-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),
-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(mod(col1,10));
-alter table t44
-partition by range(colint)
-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(mod(col1,10)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (mod(15,10)),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-15
-19
-select * from t22 order by col1;
-col1
-15
-17
-19
-select * from t33 order by col1;
-col1
-15
-17
-19
-select * from t44 order by colint;
-colint col1
-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 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 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
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(mod(col1,10)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (mod(col1,10))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-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 mod(col1,10)
--------------------------------------------------------------------------
-delete from t1 where col1=19;
-delete from t2 where col1=19;
-delete from t3 where col1=19;
-delete from t4 where col1=19;
-delete from t5 where col1=19;
-delete from t6 where col1=19;
-select * from t1 order by col1;
-col1
-15
-select * from t2 order by col1;
-col1
-15
-17
-select * from t3 order by col1;
-col1
-15
-17
-select * from t4 order by colint;
-colint col1
-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 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);
-insert into t4 values (60,19);
-insert into t5 values (60,19);
-insert into t6 values (60,19);
-select * from t1 order by col1;
-col1
-15
-19
-select * from t2 order by col1;
-col1
-15
-17
-19
-select * from t3 order by col1;
-col1
-15
-17
-19
-select * from t4 order by colint;
-colint col1
-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 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 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
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with mod(col1,10)
--------------------------------------------------------------------------
-delete from t11 where col1=19;
-delete from t22 where col1=19;
-delete from t33 where col1=19;
-delete from t44 where col1=19;
-delete from t55 where col1=19;
-delete from t66 where col1=19;
-select * from t11 order by col1;
-col1
-15
-select * from t22 order by col1;
-col1
-15
-17
-select * from t33 order by col1;
-col1
-15
-17
-select * from t44 order by colint;
-colint col1
-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 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);
-insert into t44 values (60,19);
-insert into t55 values (60,19);
-insert into t66 values (60,19);
-select * from t11 order by col1;
-col1
-15
-19
-select * from t22 order by col1;
-col1
-15
-17
-19
-select * from t33 order by col1;
-col1
-15
-17
-19
-select * from t44 order by colint;
-colint col1
-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 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 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
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- day(col1) in partition with coltype date
--------------------------------------------------------------------------
-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 day(col1)
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='NDB'
-partition by range(day(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 date) engine='NDB'
-partition by list(day(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 date) engine='NDB'
-partition by hash(day(col1));
-create table t4 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-subpartition by hash(day(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 date) engine='NDB'
-partition by list(colint)
-subpartition by hash(day(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (day('2006-12-21')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with day(col1)
--------------------------------------------------------------------------
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
-select day(col1) from t1 order by col1;
-day(col1)
-17
-3
-select * from t1 order by col1;
-col1
-2006-01-17
-2006-02-03
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-update t1 set col1='2006-02-05' where col1='2006-02-03';
-update t2 set col1='2006-02-05' where col1='2006-02-03';
-update t3 set col1='2006-02-05' where col1='2006-02-03';
-update t4 set col1='2006-02-05' where col1='2006-02-03';
-update t5 set col1='2006-02-05' where col1='2006-02-03';
-update t6 set col1='2006-02-05' where col1='2006-02-03';
-select * from t1 order by col1;
-col1
-2006-01-17
-2006-02-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t4 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with day(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(day(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(day(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(day(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(day(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(day(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (day('2006-12-21')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-2006-01-17
-2006-02-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t44 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(day(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (day(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with day(col1)
--------------------------------------------------------------------------
-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-05
-select * from t2 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t4 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-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-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t4 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with day(col1)
--------------------------------------------------------------------------
-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-05
-select * from t22 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t44 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-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-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t44 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- dayofmonth(col1) in partition with coltype date
--------------------------------------------------------------------------
-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 dayofmonth(col1)
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='NDB'
-partition by range(dayofmonth(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 date) engine='NDB'
-partition by list(dayofmonth(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 date) engine='NDB'
-partition by hash(dayofmonth(col1));
-create table t4 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-subpartition by hash(dayofmonth(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 date) engine='NDB'
-partition by list(colint)
-subpartition by hash(dayofmonth(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (dayofmonth('2006-12-24')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with dayofmonth(col1)
--------------------------------------------------------------------------
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
-select dayofmonth(col1) from t1 order by col1;
-dayofmonth(col1)
-17
-3
-select * from t1 order by col1;
-col1
-2006-01-17
-2006-02-03
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-update t1 set col1='2006-02-05' where col1='2006-02-03';
-update t2 set col1='2006-02-05' where col1='2006-02-03';
-update t3 set col1='2006-02-05' where col1='2006-02-03';
-update t4 set col1='2006-02-05' where col1='2006-02-03';
-update t5 set col1='2006-02-05' where col1='2006-02-03';
-update t6 set col1='2006-02-05' where col1='2006-02-03';
-select * from t1 order by col1;
-col1
-2006-01-17
-2006-02-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t4 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with dayofmonth(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(dayofmonth(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(dayofmonth(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(dayofmonth(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(dayofmonth(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(dayofmonth(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (dayofmonth('2006-12-24')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-2006-01-17
-2006-02-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t44 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(dayofmonth(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (dayofmonth(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 2006-02-05
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with dayofmonth(col1)
--------------------------------------------------------------------------
-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-05
-select * from t2 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t4 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-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-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t4 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with dayofmonth(col1)
--------------------------------------------------------------------------
-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-05
-select * from t22 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t44 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-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-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-05
-select * from t44 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-1 2006-02-05
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- dayofweek(col1) in partition with coltype date
--------------------------------------------------------------------------
-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 dayofweek(col1)
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='NDB'
-partition by range(dayofweek(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 date) engine='NDB'
-partition by list(dayofweek(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 date) engine='NDB'
-partition by hash(dayofweek(col1));
-create table t4 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-subpartition by hash(dayofweek(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 date) engine='NDB'
-partition by list(colint)
-subpartition by hash(dayofweek(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (dayofweek('2006-12-24')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with dayofweek(col1)
--------------------------------------------------------------------------
-insert into t1 values ('2006-01-03');
-insert into t1 values ('2006-02-17');
-insert into t2 values ('2006-01-03');
-insert into t2 values ('2006-02-17');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
-select dayofweek(col1) from t1 order by col1;
-dayofweek(col1)
-3
-6
-select * from t1 order by col1;
-col1
-2006-01-03
-2006-02-17
-select * from t2 order by col1;
-col1
-2006-01-03
-2006-01-25
-2006-02-17
-select * from t3 order by col1;
-col1
-2006-01-03
-2006-01-25
-2006-02-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
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-update t1 set col1='2006-02-05' where col1='2006-01-03';
-update t2 set col1='2006-02-05' where col1='2006-01-03';
-update t3 set col1='2006-02-05' where col1='2006-01-03';
-update t4 set col1='2006-02-05' where col1='2006-01-03';
-update t5 set col1='2006-02-05' where col1='2006-01-03';
-update t6 set col1='2006-02-05' where col1='2006-01-03';
-select * from t1 order by col1;
-col1
-2006-02-05
-2006-02-17
-select * from t2 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-17
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-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
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with dayofweek(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(dayofweek(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(dayofweek(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(dayofweek(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(dayofweek(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(dayofweek(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (dayofweek('2006-12-24')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-2006-02-05
-2006-02-17
-select * from t22 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-17
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-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
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(dayofweek(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (dayofweek(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with dayofweek(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='2006-02-17';
-delete from t2 where col1='2006-02-17';
-delete from t3 where col1='2006-02-17';
-delete from t4 where col1='2006-02-17';
-delete from t5 where col1='2006-02-17';
-delete from t6 where col1='2006-02-17';
-select * from t1 order by col1;
-col1
-2006-02-05
-select * from t2 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-insert into t1 values ('2006-02-17');
-insert into t2 values ('2006-02-17');
-insert into t3 values ('2006-02-17');
-insert into t4 values (60,'2006-02-17');
-insert into t5 values (60,'2006-02-17');
-insert into t6 values (60,'2006-02-17');
-select * from t1 order by col1;
-col1
-2006-02-05
-2006-02-17
-select * from t2 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-17
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-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-02-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-02-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-02-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with dayofweek(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='2006-02-17';
-delete from t22 where col1='2006-02-17';
-delete from t33 where col1='2006-02-17';
-delete from t44 where col1='2006-02-17';
-delete from t55 where col1='2006-02-17';
-delete from t66 where col1='2006-02-17';
-select * from t11 order by col1;
-col1
-2006-02-05
-select * from t22 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-insert into t11 values ('2006-02-17');
-insert into t22 values ('2006-02-17');
-insert into t33 values ('2006-02-17');
-insert into t44 values (60,'2006-02-17');
-insert into t55 values (60,'2006-02-17');
-insert into t66 values (60,'2006-02-17');
-select * from t11 order by col1;
-col1
-2006-02-05
-2006-02-17
-select * from t22 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-17
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-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-02-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-02-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-02-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- dayofyear(col1) in partition with coltype date
--------------------------------------------------------------------------
-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 dayofyear(col1)
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='NDB'
-partition by range(dayofyear(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 date) engine='NDB'
-partition by list(dayofyear(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 date) engine='NDB'
-partition by hash(dayofyear(col1));
-create table t4 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-subpartition by hash(dayofyear(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 date) engine='NDB'
-partition by list(colint)
-subpartition by hash(dayofyear(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (dayofyear('2006-12-25')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with dayofyear(col1)
--------------------------------------------------------------------------
-insert into t1 values ('2006-01-03');
-insert into t1 values ('2006-01-17');
-insert into t2 values ('2006-01-03');
-insert into t2 values ('2006-01-17');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
-select dayofyear(col1) from t1 order by col1;
-dayofyear(col1)
-3
-17
-select * from t1 order by col1;
-col1
-2006-01-03
-2006-01-17
-select * from t2 order by col1;
-col1
-2006-01-03
-2006-01-17
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-03
-2006-01-17
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-update t1 set col1='2006-02-05' where col1='2006-01-03';
-update t2 set col1='2006-02-05' where col1='2006-01-03';
-update t3 set col1='2006-02-05' where col1='2006-01-03';
-update t4 set col1='2006-02-05' where col1='2006-01-03';
-update t5 set col1='2006-02-05' where col1='2006-01-03';
-update t6 set col1='2006-02-05' where col1='2006-01-03';
-select * from t1 order by col1;
-col1
-2006-01-17
-2006-02-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with dayofyear(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(dayofyear(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(dayofyear(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(dayofyear(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(dayofyear(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(dayofyear(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (dayofyear('2006-12-25')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-2006-01-17
-2006-02-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(dayofyear(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (dayofyear(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with dayofyear(col1)
--------------------------------------------------------------------------
-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-05
-select * from t2 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-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-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with dayofyear(col1)
--------------------------------------------------------------------------
-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-05
-select * from t22 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-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-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- dayofyear(col1) in partition with coltype char(30)
--------------------------------------------------------------------------
-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 dayofyear(col1)
--------------------------------------------------------------------------
-create table t1 (col1 char(30)) engine='NDB'
-partition by range(dayofyear(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 char(30)) engine='NDB'
-partition by list(dayofyear(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(30)) engine='NDB'
-partition by hash(dayofyear(col1));
-create table t4 (colint int, col1 char(30)) engine='NDB'
-partition by range(colint)
-subpartition by hash(dayofyear(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 char(30)) engine='NDB'
-partition by list(colint)
-subpartition by hash(dayofyear(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 char(30)) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (dayofyear('2006-12-25')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with dayofyear(col1)
--------------------------------------------------------------------------
-insert into t1 values ('2006-01-03');
-insert into t1 values ('2006-01-17');
-insert into t2 values ('2006-01-03');
-insert into t2 values ('2006-01-17');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
-select dayofyear(col1) from t1 order by col1;
-dayofyear(col1)
-3
-17
-select * from t1 order by col1;
-col1
-2006-01-03
-2006-01-17
-select * from t2 order by col1;
-col1
-2006-01-03
-2006-01-17
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-03
-2006-01-17
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-update t1 set col1='2006-02-05' where col1='2006-01-03';
-update t2 set col1='2006-02-05' where col1='2006-01-03';
-update t3 set col1='2006-02-05' where col1='2006-01-03';
-update t4 set col1='2006-02-05' where col1='2006-01-03';
-update t5 set col1='2006-02-05' where col1='2006-01-03';
-update t6 set col1='2006-02-05' where col1='2006-01-03';
-select * from t1 order by col1;
-col1
-2006-01-17
-2006-02-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with dayofyear(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(dayofyear(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(dayofyear(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(dayofyear(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(dayofyear(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(dayofyear(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (dayofyear('2006-12-25')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-2006-01-17
-2006-02-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(dayofyear(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` char(30) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (dayofyear(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with dayofyear(col1)
--------------------------------------------------------------------------
-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-05
-select * from t2 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-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-05
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with dayofyear(col1)
--------------------------------------------------------------------------
-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-05
-select * from t22 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-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-05
-select * from t22 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t33 order by col1;
-col1
-2006-01-17
-2006-02-05
-2006-02-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- extract(month from col1) in partition with coltype date
--------------------------------------------------------------------------
-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 extract(month from col1)
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='NDB'
-partition by range(extract(month from col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 date) engine='NDB'
-partition by list(extract(month from 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 date) engine='NDB'
-partition by hash(extract(month from col1));
-create table t4 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-subpartition by hash(extract(month from col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 date) engine='NDB'
-partition by list(colint)
-subpartition by hash(extract(month from col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (extract(year from '1998-11-23')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with extract(month from col1)
--------------------------------------------------------------------------
-insert into t1 values ('2006-01-03');
-insert into t1 values ('2006-02-17');
-insert into t2 values ('2006-01-03');
-insert into t2 values ('2006-02-17');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/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
-2
-select * from t1 order by col1;
-col1
-2006-01-03
-2006-02-17
-select * from t2 order by col1;
-col1
-2006-01-03
-2006-01-25
-2006-02-17
-select * from t3 order by col1;
-col1
-2006-01-03
-2006-01-25
-2006-02-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
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-update t1 set col1='2006-02-05' where col1='2006-01-03';
-update t2 set col1='2006-02-05' where col1='2006-01-03';
-update t3 set col1='2006-02-05' where col1='2006-01-03';
-update t4 set col1='2006-02-05' where col1='2006-01-03';
-update t5 set col1='2006-02-05' where col1='2006-01-03';
-update t6 set col1='2006-02-05' where col1='2006-01-03';
-select * from t1 order by col1;
-col1
-2006-02-05
-2006-02-17
-select * from t2 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-17
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-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
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with extract(month from 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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(extract(month from col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(extract(month from 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(extract(month from col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(extract(month from 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(extract(month from col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (extract(year from '1998-11-23')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-2006-02-05
-2006-02-17
-select * from t22 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-17
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-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
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(extract(month from col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (extract(month from col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with extract(month from col1)
--------------------------------------------------------------------------
-delete from t1 where col1='2006-02-17';
-delete from t2 where col1='2006-02-17';
-delete from t3 where col1='2006-02-17';
-delete from t4 where col1='2006-02-17';
-delete from t5 where col1='2006-02-17';
-delete from t6 where col1='2006-02-17';
-select * from t1 order by col1;
-col1
-2006-02-05
-select * from t2 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-insert into t1 values ('2006-02-17');
-insert into t2 values ('2006-02-17');
-insert into t3 values ('2006-02-17');
-insert into t4 values (60,'2006-02-17');
-insert into t5 values (60,'2006-02-17');
-insert into t6 values (60,'2006-02-17');
-select * from t1 order by col1;
-col1
-2006-02-05
-2006-02-17
-select * from t2 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-17
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-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-02-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-02-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-02-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with extract(month from col1)
--------------------------------------------------------------------------
-delete from t11 where col1='2006-02-17';
-delete from t22 where col1='2006-02-17';
-delete from t33 where col1='2006-02-17';
-delete from t44 where col1='2006-02-17';
-delete from t55 where col1='2006-02-17';
-delete from t66 where col1='2006-02-17';
-select * from t11 order by col1;
-col1
-2006-02-05
-select * from t22 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-05
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-insert into t11 values ('2006-02-17');
-insert into t22 values ('2006-02-17');
-insert into t33 values ('2006-02-17');
-insert into t44 values (60,'2006-02-17');
-insert into t55 values (60,'2006-02-17');
-insert into t66 values (60,'2006-02-17');
-select * from t11 order by col1;
-col1
-2006-02-05
-2006-02-17
-select * from t22 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-17
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-05
-2006-02-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-02-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-02-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-02-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- hour(col1) in partition with coltype time
--------------------------------------------------------------------------
-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 hour(col1)
--------------------------------------------------------------------------
-create table t1 (col1 time) engine='NDB'
-partition by range(hour(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 time) engine='NDB'
-partition by list(hour(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 time) engine='NDB'
-partition by hash(hour(col1));
-create table t4 (colint int, col1 time) engine='NDB'
-partition by range(colint)
-subpartition by hash(hour(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 time) engine='NDB'
-partition by list(colint)
-subpartition by hash(hour(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 time) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (hour('18:30')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with hour(col1)
--------------------------------------------------------------------------
-insert into t1 values ('09:09');
-insert into t1 values ('14:30');
-insert into t2 values ('09:09');
-insert into t2 values ('14:30');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
-select hour(col1) from t1 order by col1;
-hour(col1)
-9
-14
-select * from t1 order by col1;
-col1
-09:09:00
-14:30:00
-select * from t2 order by col1;
-col1
-09:09:00
-14:30:00
-21:59:00
-select * from t3 order by col1;
-col1
-09:09:00
-14:30:00
-21:59:00
-select * from t4 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t6 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-update t1 set col1='10:30' where col1='09:09';
-update t2 set col1='10:30' where col1='09:09';
-update t3 set col1='10:30' where col1='09:09';
-update t4 set col1='10:30' where col1='09:09';
-update t5 set col1='10:30' where col1='09:09';
-update t6 set col1='10:30' where col1='09:09';
-select * from t1 order by col1;
-col1
-10:30:00
-14:30:00
-select * from t2 order by col1;
-col1
-10:30:00
-14:30:00
-21:59:00
-select * from t3 order by col1;
-col1
-10:30:00
-14:30:00
-21:59:00
-select * from t4 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t6 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
--------------------------------------------------------------------------
---- Alter tables with hour(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(hour(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(hour(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(hour(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(hour(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(hour(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (hour('18:30')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-10:30:00
-14:30:00
-select * from t22 order by col1;
-col1
-10:30:00
-14:30:00
-21:59:00
-select * from t33 order by col1;
-col1
-10:30:00
-14:30:00
-21:59:00
-select * from t44 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t55 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t66 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(hour(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` time DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (hour(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with hour(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='14:30';
-delete from t2 where col1='14:30';
-delete from t3 where col1='14:30';
-delete from t4 where col1='14:30';
-delete from t5 where col1='14:30';
-delete from t6 where col1='14:30';
-select * from t1 order by col1;
-col1
-10:30:00
-select * from t2 order by col1;
-col1
-10:30:00
-21:59:00
-select * from t3 order by col1;
-col1
-10:30:00
-21:59:00
-select * from t4 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-insert into t1 values ('14:30');
-insert into t2 values ('14:30');
-insert into t3 values ('14:30');
-insert into t4 values (60,'14:30');
-insert into t5 values (60,'14:30');
-insert into t6 values (60,'14:30');
-select * from t1 order by col1;
-col1
-10:30:00
-14:30:00
-select * from t2 order by col1;
-col1
-10:30:00
-14:30:00
-21:59:00
-select * from t3 order by col1;
-col1
-10:30:00
-14:30:00
-21:59:00
-select * from t4 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:00
-select * from t5 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:00
-select * from t6 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:00
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with hour(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='14:30';
-delete from t22 where col1='14:30';
-delete from t33 where col1='14:30';
-delete from t44 where col1='14:30';
-delete from t55 where col1='14:30';
-delete from t66 where col1='14:30';
-select * from t11 order by col1;
-col1
-10:30:00
-select * from t22 order by col1;
-col1
-10:30:00
-21:59:00
-select * from t33 order by col1;
-col1
-10:30:00
-21:59:00
-select * from t44 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t55 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-insert into t11 values ('14:30');
-insert into t22 values ('14:30');
-insert into t33 values ('14:30');
-insert into t44 values (60,'14:30');
-insert into t55 values (60,'14:30');
-insert into t66 values (60,'14:30');
-select * from t11 order by col1;
-col1
-10:30:00
-14:30:00
-select * from t22 order by col1;
-col1
-10:30:00
-14:30:00
-21:59:00
-select * from t33 order by col1;
-col1
-10:30:00
-14:30:00
-21:59:00
-select * from t44 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:00
-select * from t55 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:00
-select * from t66 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:00
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- microsecond(col1) in partition with coltype time
--------------------------------------------------------------------------
-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 microsecond(col1)
--------------------------------------------------------------------------
-create table t1 (col1 time) engine='NDB'
-partition by range(microsecond(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 time) engine='NDB'
-partition by list(microsecond(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 time) engine='NDB'
-partition by hash(microsecond(col1));
-create table t4 (colint int, col1 time) engine='NDB'
-partition by range(colint)
-subpartition by hash(microsecond(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 time) engine='NDB'
-partition by list(colint)
-subpartition by hash(microsecond(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 time) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (microsecond('10:30:10.000010')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with microsecond(col1)
--------------------------------------------------------------------------
-insert into t1 values ('09:09:15.000002');
-insert into t1 values ('04:30:01.000018');
-insert into t2 values ('09:09:15.000002');
-insert into t2 values ('04:30:01.000018');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
-select microsecond(col1) from t1 order by col1;
-microsecond(col1)
-0
-0
-select * from t1 order by col1;
-col1
-04:30:01
-09:09:15
-select * from t2 order by col1;
-col1
-00:59:22
-04:30:01
-09:09:15
-select * from t3 order by col1;
-col1
-00:59:22
-04:30:01
-09:09:15
-select * from t4 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t6 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-update t1 set col1='05:30:34.000037' where col1='09:09:15.000002';
-update t2 set col1='05:30:34.000037' where col1='09:09:15.000002';
-update t3 set col1='05:30:34.000037' where col1='09:09:15.000002';
-update t4 set col1='05:30:34.000037' where col1='09:09:15.000002';
-update t5 set col1='05:30:34.000037' where col1='09:09:15.000002';
-update t6 set col1='05:30:34.000037' where col1='09:09:15.000002';
-select * from t1 order by col1;
-col1
-04:30:01
-05:30:34
-select * from t2 order by col1;
-col1
-00:59:22
-04:30:01
-05:30:34
-select * from t3 order by col1;
-col1
-00:59:22
-04:30:01
-05:30:34
-select * from t4 order by colint;
-colint col1
-1 05:30:34
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 05:30:34
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t6 order by colint;
-colint col1
-1 05:30:34
-2 04:30:01
-3 00:59:22
-4 05:30:34
--------------------------------------------------------------------------
---- Alter tables with microsecond(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(microsecond(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(microsecond(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(microsecond(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(microsecond(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(microsecond(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (microsecond('10:30:10.000010')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-04:30:01
-05:30:34
-select * from t22 order by col1;
-col1
-00:59:22
-04:30:01
-05:30:34
-select * from t33 order by col1;
-col1
-00:59:22
-04:30:01
-05:30:34
-select * from t44 order by colint;
-colint col1
-1 05:30:34
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t55 order by colint;
-colint col1
-1 05:30:34
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t66 order by colint;
-colint col1
-1 05:30:34
-2 04:30:01
-3 00:59:22
-4 05:30:34
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(microsecond(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` time DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (microsecond(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 05:30:34
-2 04:30:01
-3 00:59:22
-4 05:30:34
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with microsecond(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='04:30:01.000018';
-delete from t2 where col1='04:30:01.000018';
-delete from t3 where col1='04:30:01.000018';
-delete from t4 where col1='04:30:01.000018';
-delete from t5 where col1='04:30:01.000018';
-delete from t6 where col1='04:30:01.000018';
-select * from t1 order by col1;
-col1
-05:30:34
-select * from t2 order by col1;
-col1
-00:59:22
-05:30:34
-select * from t3 order by col1;
-col1
-00:59:22
-05:30:34
-select * from t4 order by colint;
-colint col1
-1 05:30:34
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 05:30:34
-3 00:59:22
-4 05:30:34
-insert into t1 values ('04:30:01.000018');
-insert into t2 values ('04:30:01.000018');
-insert into t3 values ('04:30:01.000018');
-insert into t4 values (60,'04:30:01.000018');
-insert into t5 values (60,'04:30:01.000018');
-insert into t6 values (60,'04:30:01.000018');
-select * from t1 order by col1;
-col1
-04:30:01
-05:30:34
-select * from t2 order by col1;
-col1
-00:59:22
-04:30:01
-05:30:34
-select * from t3 order by col1;
-col1
-00:59:22
-04:30:01
-05:30:34
-select * from t4 order by colint;
-colint col1
-1 05:30:34
-3 00:59:22
-4 05:30:34
-60 04:30:01
-select * from t5 order by colint;
-colint col1
-1 05:30:34
-3 00:59:22
-4 05:30:34
-60 04:30:01
-select * from t6 order by colint;
-colint col1
-1 05:30:34
-3 00:59:22
-4 05:30:34
-60 04:30:01
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with microsecond(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='04:30:01.000018';
-delete from t22 where col1='04:30:01.000018';
-delete from t33 where col1='04:30:01.000018';
-delete from t44 where col1='04:30:01.000018';
-delete from t55 where col1='04:30:01.000018';
-delete from t66 where col1='04:30:01.000018';
-select * from t11 order by col1;
-col1
-05:30:34
-select * from t22 order by col1;
-col1
-00:59:22
-05:30:34
-select * from t33 order by col1;
-col1
-00:59:22
-05:30:34
-select * from t44 order by colint;
-colint col1
-1 05:30:34
-3 00:59:22
-4 05:30:34
-select * from t55 order by colint;
-colint col1
-1 05:30:34
-3 00:59:22
-4 05:30:34
-insert into t11 values ('04:30:01.000018');
-insert into t22 values ('04:30:01.000018');
-insert into t33 values ('04:30:01.000018');
-insert into t44 values (60,'04:30:01.000018');
-insert into t55 values (60,'04:30:01.000018');
-insert into t66 values (60,'04:30:01.000018');
-select * from t11 order by col1;
-col1
-04:30:01
-05:30:34
-select * from t22 order by col1;
-col1
-00:59:22
-04:30:01
-05:30:34
-select * from t33 order by col1;
-col1
-00:59:22
-04:30:01
-05:30:34
-select * from t44 order by colint;
-colint col1
-1 05:30:34
-3 00:59:22
-4 05:30:34
-60 04:30:01
-select * from t55 order by colint;
-colint col1
-1 05:30:34
-3 00:59:22
-4 05:30:34
-60 04:30:01
-select * from t66 order by colint;
-colint col1
-1 05:30:34
-3 00:59:22
-4 05:30:34
-60 04:30:01
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- minute(col1) in partition with coltype time
--------------------------------------------------------------------------
-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 minute(col1)
--------------------------------------------------------------------------
-create table t1 (col1 time) engine='NDB'
-partition by range(minute(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 time) engine='NDB'
-partition by list(minute(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 time) engine='NDB'
-partition by hash(minute(col1));
-create table t4 (colint int, col1 time) engine='NDB'
-partition by range(colint)
-subpartition by hash(minute(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 time) engine='NDB'
-partition by list(colint)
-subpartition by hash(minute(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 time) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (minute('18:30')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with minute(col1)
--------------------------------------------------------------------------
-insert into t1 values ('09:09:15');
-insert into t1 values ('14:30:45');
-insert into t2 values ('09:09:15');
-insert into t2 values ('14:30:45');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
-select minute(col1) from t1 order by col1;
-minute(col1)
-9
-30
-select * from t1 order by col1;
-col1
-09:09:15
-14:30:45
-select * from t2 order by col1;
-col1
-09:09:15
-14:30:45
-21:59:22
-select * from t3 order by col1;
-col1
-09:09:15
-14:30:45
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t6 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-update t1 set col1='10:24:23' where col1='09:09:15';
-update t2 set col1='10:24:23' where col1='09:09:15';
-update t3 set col1='10:24:23' where col1='09:09:15';
-update t4 set col1='10:24:23' where col1='09:09:15';
-update t5 set col1='10:24:23' where col1='09:09:15';
-update t6 set col1='10:24:23' where col1='09:09:15';
-select * from t1 order by col1;
-col1
-10:24:23
-14:30:45
-select * from t2 order by col1;
-col1
-10:24:23
-14:30:45
-21:59:22
-select * from t3 order by col1;
-col1
-10:24:23
-14:30:45
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t6 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
--------------------------------------------------------------------------
---- Alter tables with minute(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(minute(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(minute(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(minute(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(minute(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(minute(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (minute('18:30')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-10:24:23
-14:30:45
-select * from t22 order by col1;
-col1
-10:24:23
-14:30:45
-21:59:22
-select * from t33 order by col1;
-col1
-10:24:23
-14:30:45
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t55 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t66 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(minute(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` time DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (minute(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with minute(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='14:30:45';
-delete from t2 where col1='14:30:45';
-delete from t3 where col1='14:30:45';
-delete from t4 where col1='14:30:45';
-delete from t5 where col1='14:30:45';
-delete from t6 where col1='14:30:45';
-select * from t1 order by col1;
-col1
-10:24:23
-select * from t2 order by col1;
-col1
-10:24:23
-21:59:22
-select * from t3 order by col1;
-col1
-10:24:23
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-insert into t1 values ('14:30:45');
-insert into t2 values ('14:30:45');
-insert into t3 values ('14:30:45');
-insert into t4 values (60,'14:30:45');
-insert into t5 values (60,'14:30:45');
-insert into t6 values (60,'14:30:45');
-select * from t1 order by col1;
-col1
-10:24:23
-14:30:45
-select * from t2 order by col1;
-col1
-10:24:23
-14:30:45
-21:59:22
-select * from t3 order by col1;
-col1
-10:24:23
-14:30:45
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:45
-select * from t5 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:45
-select * from t6 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:45
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with minute(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='14:30:45';
-delete from t22 where col1='14:30:45';
-delete from t33 where col1='14:30:45';
-delete from t44 where col1='14:30:45';
-delete from t55 where col1='14:30:45';
-delete from t66 where col1='14:30:45';
-select * from t11 order by col1;
-col1
-10:24:23
-select * from t22 order by col1;
-col1
-10:24:23
-21:59:22
-select * from t33 order by col1;
-col1
-10:24:23
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t55 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-insert into t11 values ('14:30:45');
-insert into t22 values ('14:30:45');
-insert into t33 values ('14:30:45');
-insert into t44 values (60,'14:30:45');
-insert into t55 values (60,'14:30:45');
-insert into t66 values (60,'14:30:45');
-select * from t11 order by col1;
-col1
-10:24:23
-14:30:45
-select * from t22 order by col1;
-col1
-10:24:23
-14:30:45
-21:59:22
-select * from t33 order by col1;
-col1
-10:24:23
-14:30:45
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:45
-select * from t55 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:45
-select * from t66 order by colint;
-colint col1
-1 10:24:23
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:45
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- second(col1) in partition with coltype time
--------------------------------------------------------------------------
-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 second(col1)
--------------------------------------------------------------------------
-create table t1 (col1 time) engine='NDB'
-partition by range(second(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 time) engine='NDB'
-partition by list(second(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 time) engine='NDB'
-partition by hash(second(col1));
-create table t4 (colint int, col1 time) engine='NDB'
-partition by range(colint)
-subpartition by hash(second(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 time) engine='NDB'
-partition by list(colint)
-subpartition by hash(second(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 time) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (second('18:30:14')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with second(col1)
--------------------------------------------------------------------------
-insert into t1 values ('09:09:09');
-insert into t1 values ('14:30:20');
-insert into t2 values ('09:09:09');
-insert into t2 values ('14:30:20');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
-select second(col1) from t1 order by col1;
-second(col1)
-9
-20
-select * from t1 order by col1;
-col1
-09:09:09
-14:30:20
-select * from t2 order by col1;
-col1
-09:09:09
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-09:09:09
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t6 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-update t1 set col1='10:22:33' where col1='09:09:09';
-update t2 set col1='10:22:33' where col1='09:09:09';
-update t3 set col1='10:22:33' where col1='09:09:09';
-update t4 set col1='10:22:33' where col1='09:09:09';
-update t5 set col1='10:22:33' where col1='09:09:09';
-update t6 set col1='10:22:33' where col1='09:09:09';
-select * from t1 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t2 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t6 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
--------------------------------------------------------------------------
---- Alter tables with second(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(second(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(second(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(second(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(second(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(second(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (second('18:30:14')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t22 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t55 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t66 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(second(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` time DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (second(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with second(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='14:30:20';
-delete from t2 where col1='14:30:20';
-delete from t3 where col1='14:30:20';
-delete from t4 where col1='14:30:20';
-delete from t5 where col1='14:30:20';
-delete from t6 where col1='14:30:20';
-select * from t1 order by col1;
-col1
-10:22:33
-select * from t2 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-insert into t1 values ('14:30:20');
-insert into t2 values ('14:30:20');
-insert into t3 values ('14:30:20');
-insert into t4 values (60,'14:30:20');
-insert into t5 values (60,'14:30:20');
-insert into t6 values (60,'14:30:20');
-select * from t1 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t2 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:20
-select * from t5 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:20
-select * from t6 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:20
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with second(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='14:30:20';
-delete from t22 where col1='14:30:20';
-delete from t33 where col1='14:30:20';
-delete from t44 where col1='14:30:20';
-delete from t55 where col1='14:30:20';
-delete from t66 where col1='14:30:20';
-select * from t11 order by col1;
-col1
-10:22:33
-select * from t22 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t55 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-insert into t11 values ('14:30:20');
-insert into t22 values ('14:30:20');
-insert into t33 values ('14:30:20');
-insert into t44 values (60,'14:30:20');
-insert into t55 values (60,'14:30:20');
-insert into t66 values (60,'14:30:20');
-select * from t11 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t22 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:20
-select * from t55 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:20
-select * from t66 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:20
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- second(col1) in partition with coltype char(30)
--------------------------------------------------------------------------
-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 second(col1)
--------------------------------------------------------------------------
-create table t1 (col1 char(30)) engine='NDB'
-partition by range(second(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 char(30)) engine='NDB'
-partition by list(second(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(30)) engine='NDB'
-partition by hash(second(col1));
-create table t4 (colint int, col1 char(30)) engine='NDB'
-partition by range(colint)
-subpartition by hash(second(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 char(30)) engine='NDB'
-partition by list(colint)
-subpartition by hash(second(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 char(30)) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (second('18:30:14')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with second(col1)
--------------------------------------------------------------------------
-insert into t1 values ('09:09:09');
-insert into t1 values ('14:30:20');
-insert into t2 values ('09:09:09');
-insert into t2 values ('14:30:20');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t6;
-select second(col1) from t1 order by col1;
-second(col1)
-9
-20
-select * from t1 order by col1;
-col1
-09:09:09
-14:30:20
-select * from t2 order by col1;
-col1
-09:09:09
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-09:09:09
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t5 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t6 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-update t1 set col1='10:22:33' where col1='09:09:09';
-update t2 set col1='10:22:33' where col1='09:09:09';
-update t3 set col1='10:22:33' where col1='09:09:09';
-update t4 set col1='10:22:33' where col1='09:09:09';
-update t5 set col1='10:22:33' where col1='09:09:09';
-update t6 set col1='10:22:33' where col1='09:09:09';
-select * from t1 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t2 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t5 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t6 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
--------------------------------------------------------------------------
---- Alter tables with second(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(second(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(second(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(second(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(second(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(second(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (second('18:30:14')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t22 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t55 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(second(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` char(30) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (second(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with second(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='14:30:20';
-delete from t2 where col1='14:30:20';
-delete from t3 where col1='14:30:20';
-delete from t4 where col1='14:30:20';
-delete from t5 where col1='14:30:20';
-delete from t6 where col1='14:30:20';
-select * from t1 order by col1;
-col1
-10:22:33
-select * from t2 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t5 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-insert into t1 values ('14:30:20');
-insert into t2 values ('14:30:20');
-insert into t3 values ('14:30:20');
-insert into t4 values (60,'14:30:20');
-insert into t5 values (60,'14:30:20');
-insert into t6 values (60,'14:30:20');
-select * from t1 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t2 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t3 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-select * from t5 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-select * from t6 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with second(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='14:30:20';
-delete from t22 where col1='14:30:20';
-delete from t33 where col1='14:30:20';
-delete from t44 where col1='14:30:20';
-delete from t55 where col1='14:30:20';
-delete from t66 where col1='14:30:20';
-select * from t11 order by col1;
-col1
-10:22:33
-select * from t22 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-select * from t55 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-insert into t11 values ('14:30:20');
-insert into t22 values ('14:30:20');
-insert into t33 values ('14:30:20');
-insert into t44 values (60,'14:30:20');
-insert into t55 values (60,'14:30:20');
-insert into t66 values (60,'14:30:20');
-select * from t11 order by col1;
-col1
-10:22:33
-14:30:20
-select * from t22 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t33 order by col1;
-col1
-10:22:33
-14:30:20
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-select * from t55 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
-select * from t66 order by colint;
-colint col1
-1 09:09:15.000002
-2 04:30:01.000018
-3 00:59:22.000024
-4 05:30:34.000037
-60 14:30:20
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- month(col1) in partition with coltype date
--------------------------------------------------------------------------
-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 month(col1)
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='NDB'
-partition by range(month(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 date) engine='NDB'
-partition by list(month(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 date) engine='NDB'
-partition by hash(month(col1));
-create table t4 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-subpartition by hash(month(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 date) engine='NDB'
-partition by list(colint)
-subpartition by hash(month(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (month('2006-10-14')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with month(col1)
--------------------------------------------------------------------------
-insert into t1 values ('2006-01-03');
-insert into t1 values ('2006-12-17');
-insert into t2 values ('2006-01-03');
-insert into t2 values ('2006-12-17');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
-select month(col1) from t1 order by col1;
-month(col1)
-1
-12
-select * from t1 order by col1;
-col1
-2006-01-03
-2006-12-17
-select * from t2 order by col1;
-col1
-2006-01-03
-2006-05-25
-2006-12-17
-select * from t3 order by col1;
-col1
-2006-01-03
-2006-05-25
-2006-12-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
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-update t1 set col1='2006-11-06' where col1='2006-01-03';
-update t2 set col1='2006-11-06' where col1='2006-01-03';
-update t3 set col1='2006-11-06' where col1='2006-01-03';
-update t4 set col1='2006-11-06' where col1='2006-01-03';
-update t5 set col1='2006-11-06' where col1='2006-01-03';
-update t6 set col1='2006-11-06' where col1='2006-01-03';
-select * from t1 order by col1;
-col1
-2006-11-06
-2006-12-17
-select * from t2 order by col1;
-col1
-2006-05-25
-2006-11-06
-2006-12-17
-select * from t3 order by col1;
-col1
-2006-05-25
-2006-11-06
-2006-12-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
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with month(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(month(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(month(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(month(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(month(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(month(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (month('2006-10-14')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-2006-11-06
-2006-12-17
-select * from t22 order by col1;
-col1
-2006-05-25
-2006-11-06
-2006-12-17
-select * from t33 order by col1;
-col1
-2006-05-25
-2006-11-06
-2006-12-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
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(month(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (month(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with month(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='2006-12-17';
-delete from t2 where col1='2006-12-17';
-delete from t3 where col1='2006-12-17';
-delete from t4 where col1='2006-12-17';
-delete from t5 where col1='2006-12-17';
-delete from t6 where col1='2006-12-17';
-select * from t1 order by col1;
-col1
-2006-11-06
-select * from t2 order by col1;
-col1
-2006-05-25
-2006-11-06
-select * from t3 order by col1;
-col1
-2006-05-25
-2006-11-06
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-insert into t1 values ('2006-12-17');
-insert into t2 values ('2006-12-17');
-insert into t3 values ('2006-12-17');
-insert into t4 values (60,'2006-12-17');
-insert into t5 values (60,'2006-12-17');
-insert into t6 values (60,'2006-12-17');
-select * from t1 order by col1;
-col1
-2006-11-06
-2006-12-17
-select * from t2 order by col1;
-col1
-2006-05-25
-2006-11-06
-2006-12-17
-select * from t3 order by col1;
-col1
-2006-05-25
-2006-11-06
-2006-12-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-12-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-12-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-12-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with month(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='2006-12-17';
-delete from t22 where col1='2006-12-17';
-delete from t33 where col1='2006-12-17';
-delete from t44 where col1='2006-12-17';
-delete from t55 where col1='2006-12-17';
-delete from t66 where col1='2006-12-17';
-select * from t11 order by col1;
-col1
-2006-11-06
-select * from t22 order by col1;
-col1
-2006-05-25
-2006-11-06
-select * from t33 order by col1;
-col1
-2006-05-25
-2006-11-06
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-insert into t11 values ('2006-12-17');
-insert into t22 values ('2006-12-17');
-insert into t33 values ('2006-12-17');
-insert into t44 values (60,'2006-12-17');
-insert into t55 values (60,'2006-12-17');
-insert into t66 values (60,'2006-12-17');
-select * from t11 order by col1;
-col1
-2006-11-06
-2006-12-17
-select * from t22 order by col1;
-col1
-2006-05-25
-2006-11-06
-2006-12-17
-select * from t33 order by col1;
-col1
-2006-05-25
-2006-11-06
-2006-12-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-12-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-12-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-12-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- quarter(col1) in partition with coltype date
--------------------------------------------------------------------------
-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 quarter(col1)
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='NDB'
-partition by range(quarter(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 date) engine='NDB'
-partition by list(quarter(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 date) engine='NDB'
-partition by hash(quarter(col1));
-create table t4 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-subpartition by hash(quarter(col1)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 date) engine='NDB'
-partition by list(colint)
-subpartition by hash(quarter(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (quarter('2006-10-14')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with quarter(col1)
--------------------------------------------------------------------------
-insert into t1 values ('2006-01-03');
-insert into t1 values ('2006-12-17');
-insert into t2 values ('2006-01-03');
-insert into t2 values ('2006-12-17');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
-select quarter(col1) from t1 order by col1;
-quarter(col1)
-1
-4
-select * from t1 order by col1;
-col1
-2006-01-03
-2006-12-17
-select * from t2 order by col1;
-col1
-2006-01-03
-2006-09-25
-2006-12-17
-select * from t3 order by col1;
-col1
-2006-01-03
-2006-09-25
-2006-12-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
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-update t1 set col1='2006-07-30' where col1='2006-01-03';
-update t2 set col1='2006-07-30' where col1='2006-01-03';
-update t3 set col1='2006-07-30' where col1='2006-01-03';
-update t4 set col1='2006-07-30' where col1='2006-01-03';
-update t5 set col1='2006-07-30' where col1='2006-01-03';
-update t6 set col1='2006-07-30' where col1='2006-01-03';
-select * from t1 order by col1;
-col1
-2006-07-30
-2006-12-17
-select * from t2 order by col1;
-col1
-2006-07-30
-2006-09-25
-2006-12-17
-select * from t3 order by col1;
-col1
-2006-07-30
-2006-09-25
-2006-12-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
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with quarter(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(quarter(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(quarter(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(quarter(col1));
-alter table t44
-partition by range(colint)
-subpartition by hash(quarter(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(quarter(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (quarter('2006-10-14')),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-2006-07-30
-2006-12-17
-select * from t22 order by col1;
-col1
-2006-07-30
-2006-09-25
-2006-12-17
-select * from t33 order by col1;
-col1
-2006-07-30
-2006-09-25
-2006-12-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
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(quarter(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (quarter(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with quarter(col1)
--------------------------------------------------------------------------
-delete from t1 where col1='2006-12-17';
-delete from t2 where col1='2006-12-17';
-delete from t3 where col1='2006-12-17';
-delete from t4 where col1='2006-12-17';
-delete from t5 where col1='2006-12-17';
-delete from t6 where col1='2006-12-17';
-select * from t1 order by col1;
-col1
-2006-07-30
-select * from t2 order by col1;
-col1
-2006-07-30
-2006-09-25
-select * from t3 order by col1;
-col1
-2006-07-30
-2006-09-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-insert into t1 values ('2006-12-17');
-insert into t2 values ('2006-12-17');
-insert into t3 values ('2006-12-17');
-insert into t4 values (60,'2006-12-17');
-insert into t5 values (60,'2006-12-17');
-insert into t6 values (60,'2006-12-17');
-select * from t1 order by col1;
-col1
-2006-07-30
-2006-12-17
-select * from t2 order by col1;
-col1
-2006-07-30
-2006-09-25
-2006-12-17
-select * from t3 order by col1;
-col1
-2006-07-30
-2006-09-25
-2006-12-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-12-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-12-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-12-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with quarter(col1)
--------------------------------------------------------------------------
-delete from t11 where col1='2006-12-17';
-delete from t22 where col1='2006-12-17';
-delete from t33 where col1='2006-12-17';
-delete from t44 where col1='2006-12-17';
-delete from t55 where col1='2006-12-17';
-delete from t66 where col1='2006-12-17';
-select * from t11 order by col1;
-col1
-2006-07-30
-select * from t22 order by col1;
-col1
-2006-07-30
-2006-09-25
-select * from t33 order by col1;
-col1
-2006-07-30
-2006-09-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-insert into t11 values ('2006-12-17');
-insert into t22 values ('2006-12-17');
-insert into t33 values ('2006-12-17');
-insert into t44 values (60,'2006-12-17');
-insert into t55 values (60,'2006-12-17');
-insert into t66 values (60,'2006-12-17');
-select * from t11 order by col1;
-col1
-2006-07-30
-2006-12-17
-select * from t22 order by col1;
-col1
-2006-07-30
-2006-09-25
-2006-12-17
-select * from t33 order by col1;
-col1
-2006-07-30
-2006-09-25
-2006-12-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-12-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-12-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-12-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- time_to_sec(col1)-(time_to_sec(col1)-20) in partition with coltype time
--------------------------------------------------------------------------
-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 time_to_sec(col1)-(time_to_sec(col1)-20)
--------------------------------------------------------------------------
-create table t1 (col1 time) engine='NDB'
-partition by range(time_to_sec(col1)-(time_to_sec(col1)-20))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 time) engine='NDB'
-partition by list(time_to_sec(col1)-(time_to_sec(col1)-20))
-(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 time) engine='NDB'
-partition by hash(time_to_sec(col1)-(time_to_sec(col1)-20));
-create table t4 (colint int, col1 time) engine='NDB'
-partition by range(colint)
-subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 time) engine='NDB'
-partition by list(colint)
-subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 time) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with time_to_sec(col1)-(time_to_sec(col1)-20)
--------------------------------------------------------------------------
-insert into t1 values ('09:09:15');
-insert into t1 values ('14:30:45');
-insert into t2 values ('09:09:15');
-insert into t2 values ('14:30:45');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_time.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/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
-20
-select * from t1 order by col1;
-col1
-09:09:15
-14:30:45
-select * from t2 order by col1;
-col1
-09:09:15
-14:30:45
-21:59:22
-select * from t3 order by col1;
-col1
-09:09:15
-14:30:45
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t6 order by colint;
-colint col1
-1 09:09:15
-2 04:30:01
-3 00:59:22
-4 05:30:34
-update t1 set col1='10:33:11' where col1='09:09:15';
-update t2 set col1='10:33:11' where col1='09:09:15';
-update t3 set col1='10:33:11' where col1='09:09:15';
-update t4 set col1='10:33:11' where col1='09:09:15';
-update t5 set col1='10:33:11' where col1='09:09:15';
-update t6 set col1='10:33:11' where col1='09:09:15';
-select * from t1 order by col1;
-col1
-10:33:11
-14:30:45
-select * from t2 order by col1;
-col1
-10:33:11
-14:30:45
-21:59:22
-select * from t3 order by col1;
-col1
-10:33:11
-14:30:45
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t6 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
--------------------------------------------------------------------------
---- Alter tables with time_to_sec(col1)-(time_to_sec(col1)-20)
--------------------------------------------------------------------------
-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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(time_to_sec(col1)-(time_to_sec(col1)-20))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(time_to_sec(col1)-(time_to_sec(col1)-20))
-(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(time_to_sec(col1)-(time_to_sec(col1)-20));
-alter table t44
-partition by range(colint)
-subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t55
-partition by list(colint)
-subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-10:33:11
-14:30:45
-select * from t22 order by col1;
-col1
-10:33:11
-14:30:45
-21:59:22
-select * from t33 order by col1;
-col1
-10:33:11
-14:30:45
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t55 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t66 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` time DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20)
--------------------------------------------------------------------------
-delete from t1 where col1='14:30:45';
-delete from t2 where col1='14:30:45';
-delete from t3 where col1='14:30:45';
-delete from t4 where col1='14:30:45';
-delete from t5 where col1='14:30:45';
-delete from t6 where col1='14:30:45';
-select * from t1 order by col1;
-col1
-10:33:11
-select * from t2 order by col1;
-col1
-10:33:11
-21:59:22
-select * from t3 order by col1;
-col1
-10:33:11
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t5 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-insert into t1 values ('14:30:45');
-insert into t2 values ('14:30:45');
-insert into t3 values ('14:30:45');
-insert into t4 values (60,'14:30:45');
-insert into t5 values (60,'14:30:45');
-insert into t6 values (60,'14:30:45');
-select * from t1 order by col1;
-col1
-10:33:11
-14:30:45
-select * from t2 order by col1;
-col1
-10:33:11
-14:30:45
-21:59:22
-select * from t3 order by col1;
-col1
-10:33:11
-14:30:45
-21:59:22
-select * from t4 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:45
-select * from t5 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:45
-select * from t6 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:45
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20)
--------------------------------------------------------------------------
-delete from t11 where col1='14:30:45';
-delete from t22 where col1='14:30:45';
-delete from t33 where col1='14:30:45';
-delete from t44 where col1='14:30:45';
-delete from t55 where col1='14:30:45';
-delete from t66 where col1='14:30:45';
-select * from t11 order by col1;
-col1
-10:33:11
-select * from t22 order by col1;
-col1
-10:33:11
-21:59:22
-select * from t33 order by col1;
-col1
-10:33:11
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-select * from t55 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-insert into t11 values ('14:30:45');
-insert into t22 values ('14:30:45');
-insert into t33 values ('14:30:45');
-insert into t44 values (60,'14:30:45');
-insert into t55 values (60,'14:30:45');
-insert into t66 values (60,'14:30:45');
-select * from t11 order by col1;
-col1
-10:33:11
-14:30:45
-select * from t22 order by col1;
-col1
-10:33:11
-14:30:45
-21:59:22
-select * from t33 order by col1;
-col1
-10:33:11
-14:30:45
-21:59:22
-select * from t44 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:45
-select * from t55 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:45
-select * from t66 order by colint;
-colint col1
-1 10:33:11
-2 04:30:01
-3 00:59:22
-4 05:30:34
-60 14:30:45
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- to_days(col1)-to_days('2006-01-01') in partition with coltype date
--------------------------------------------------------------------------
-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 to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='NDB'
-partition by range(to_days(col1)-to_days('2006-01-01'))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 date) engine='NDB'
-partition by list(to_days(col1)-to_days('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),
-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 date) engine='NDB'
-partition by hash(to_days(col1)-to_days('2006-01-01'));
-create table t4 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-subpartition by hash(to_days(col1)-to_days('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='NDB'
-partition by list(colint)
-subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/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
-33
-select * from t1 order by col1;
-col1
-2006-01-17
-2006-02-03
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t4 order by colint;
-colint col1
-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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(to_days(col1)-to_days('2006-01-01'))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(to_days(col1)-to_days('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),
-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(to_days(col1)-to_days('2006-01-01'));
-alter table t44
-partition by range(colint)
-subpartition by hash(to_days(col1)-to_days('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(to_days(col1)-to_days('2006-01-01')) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')),
-partition p1 values less than maxvalue);
-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
-select * from t44 order by colint;
-colint col1
-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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01'))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-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
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-06
-select * from t4 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t4 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01')
--------------------------------------------------------------------------
-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
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-06
-select * from t44 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t44 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- datediff(col1, '2006-01-01') in partition with coltype date
--------------------------------------------------------------------------
-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 datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='NDB'
-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='NDB'
-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),
-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 date) engine='NDB'
-partition by hash(datediff(col1, '2006-01-01'));
-create table t4 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-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='NDB'
-partition by list(colint)
-subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (datediff('2006-02-02', '2006-01-01')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/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-01-17
-2006-02-03
-select * from t2 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t3 order by col1;
-col1
-2006-01-17
-2006-01-25
-2006-02-03
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t4 order by colint;
-colint col1
-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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-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(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),
-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(datediff(col1, '2006-01-01'));
-alter table t44
-partition by range(colint)
-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(datediff(col1, '2006-01-01')) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(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
-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
-select * from t44 order by colint;
-colint col1
-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-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (datediff(col1, '2006-01-01'))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-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
-select * from t3 order by col1;
-col1
-2006-01-25
-2006-02-06
-select * from t4 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t4 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t5 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t6 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with datediff(col1, '2006-01-01')
--------------------------------------------------------------------------
-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
-select * from t33 order by col1;
-col1
-2006-01-25
-2006-02-06
-select * from t44 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-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
-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
-select * from t44 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t55 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
-select * from t66 order by colint;
-colint col1
-1 2006-02-06
-3 2006-01-25
-4 2006-02-05
-60 2006-01-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- weekday(col1) in partition with coltype date
--------------------------------------------------------------------------
-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 weekday(col1)
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='NDB'
-partition by range(weekday(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 date) engine='NDB'
-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),
-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 date) engine='NDB'
-partition by hash(weekday(col1));
-create table t4 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-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='NDB'
-partition by list(colint)
-subpartition by hash(weekday(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (weekday('2006-10-14')),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with weekday(col1)
--------------------------------------------------------------------------
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/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-11-17
-2006-12-03
-select * from t2 order by col1;
-col1
-2006-05-25
-2006-11-17
-2006-12-03
-select * from t3 order by col1;
-col1
-2006-05-25
-2006-11-17
-2006-12-03
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-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';
-select * from t1 order by col1;
-col1
-2006-02-06
-2006-11-17
-select * from t2 order by col1;
-col1
-2006-02-06
-2006-05-25
-2006-11-17
-select * from t3 order by col1;
-col1
-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
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with weekday(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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(weekday(col1))
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-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),
-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(weekday(col1));
-alter table t44
-partition by range(colint)
-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(weekday(col1)) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,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 p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-2006-02-06
-2006-11-17
-select * from t22 order by col1;
-col1
-2006-02-06
-2006-05-25
-2006-11-17
-select * from t33 order by col1;
-col1
-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
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(weekday(col1)) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (weekday(col1))
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with weekday(col1)
--------------------------------------------------------------------------
-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-02-06
-select * from t2 order by col1;
-col1
-2006-02-06
-2006-05-25
-select * from t3 order by col1;
-col1
-2006-02-06
-2006-05-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-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');
-select * from t1 order by col1;
-col1
-2006-02-06
-2006-11-17
-select * from t2 order by col1;
-col1
-2006-02-06
-2006-05-25
-2006-11-17
-select * from t3 order by col1;
-col1
-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
-3 2006-01-25
-4 2006-02-05
-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-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-11-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with weekday(col1)
--------------------------------------------------------------------------
-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-02-06
-select * from t22 order by col1;
-col1
-2006-02-06
-2006-05-25
-select * from t33 order by col1;
-col1
-2006-02-06
-2006-05-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-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');
-select * from t11 order by col1;
-col1
-2006-02-06
-2006-11-17
-select * from t22 order by col1;
-col1
-2006-02-06
-2006-05-25
-2006-11-17
-select * from t33 order by col1;
-col1
-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
-3 2006-01-25
-4 2006-02-05
-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-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-11-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- year(col1)-1990 in partition with coltype date
--------------------------------------------------------------------------
-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 year(col1)-1990
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='NDB'
-partition by range(year(col1)-1990)
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 date) engine='NDB'
-partition by list(year(col1)-1990)
-(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 date) engine='NDB'
-partition by hash(year(col1)-1990);
-create table t4 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-subpartition by hash(year(col1)-1990) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 date) engine='NDB'
-partition by list(colint)
-subpartition by hash(year(col1)-1990) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (year('2005-10-14')-1990),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with year(col1)-1990
--------------------------------------------------------------------------
-insert into t1 values ('1996-01-03');
-insert into t1 values ('2000-02-17');
-insert into t2 values ('1996-01-03');
-insert into t2 values ('2000-02-17');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
-select year(col1)-1990 from t1 order by col1;
-year(col1)-1990
-6
-10
-select * from t1 order by col1;
-col1
-1996-01-03
-2000-02-17
-select * from t2 order by col1;
-col1
-1996-01-03
-2000-02-17
-2004-05-25
-select * from t3 order by col1;
-col1
-1996-01-03
-2000-02-17
-2004-05-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-update t1 set col1='2002-02-15' where col1='1996-01-03';
-update t2 set col1='2002-02-15' where col1='1996-01-03';
-update t3 set col1='2002-02-15' where col1='1996-01-03';
-update t4 set col1='2002-02-15' where col1='1996-01-03';
-update t5 set col1='2002-02-15' where col1='1996-01-03';
-update t6 set col1='2002-02-15' where col1='1996-01-03';
-select * from t1 order by col1;
-col1
-2000-02-17
-2002-02-15
-select * from t2 order by col1;
-col1
-2000-02-17
-2002-02-15
-2004-05-25
-select * from t3 order by col1;
-col1
-2000-02-17
-2002-02-15
-2004-05-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with year(col1)-1990
--------------------------------------------------------------------------
-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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(year(col1)-1990)
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(year(col1)-1990)
-(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(year(col1)-1990);
-alter table t44
-partition by range(colint)
-subpartition by hash(year(col1)-1990) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t55
-partition by list(colint)
-subpartition by hash(year(col1)-1990) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (year('2005-10-14')-1990),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-2000-02-17
-2002-02-15
-select * from t22 order by col1;
-col1
-2000-02-17
-2002-02-15
-2004-05-25
-select * from t33 order by col1;
-col1
-2000-02-17
-2002-02-15
-2004-05-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(year(col1)-1990) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (year(col1)-1990)
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with year(col1)-1990
--------------------------------------------------------------------------
-delete from t1 where col1='2000-02-17';
-delete from t2 where col1='2000-02-17';
-delete from t3 where col1='2000-02-17';
-delete from t4 where col1='2000-02-17';
-delete from t5 where col1='2000-02-17';
-delete from t6 where col1='2000-02-17';
-select * from t1 order by col1;
-col1
-2002-02-15
-select * from t2 order by col1;
-col1
-2002-02-15
-2004-05-25
-select * from t3 order by col1;
-col1
-2002-02-15
-2004-05-25
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-insert into t1 values ('2000-02-17');
-insert into t2 values ('2000-02-17');
-insert into t3 values ('2000-02-17');
-insert into t4 values (60,'2000-02-17');
-insert into t5 values (60,'2000-02-17');
-insert into t6 values (60,'2000-02-17');
-select * from t1 order by col1;
-col1
-2000-02-17
-2002-02-15
-select * from t2 order by col1;
-col1
-2000-02-17
-2002-02-15
-2004-05-25
-select * from t3 order by col1;
-col1
-2000-02-17
-2002-02-15
-2004-05-25
-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 2000-02-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 2000-02-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 2000-02-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with year(col1)-1990
--------------------------------------------------------------------------
-delete from t11 where col1='2000-02-17';
-delete from t22 where col1='2000-02-17';
-delete from t33 where col1='2000-02-17';
-delete from t44 where col1='2000-02-17';
-delete from t55 where col1='2000-02-17';
-delete from t66 where col1='2000-02-17';
-select * from t11 order by col1;
-col1
-2002-02-15
-select * from t22 order by col1;
-col1
-2002-02-15
-2004-05-25
-select * from t33 order by col1;
-col1
-2002-02-15
-2004-05-25
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-insert into t11 values ('2000-02-17');
-insert into t22 values ('2000-02-17');
-insert into t33 values ('2000-02-17');
-insert into t44 values (60,'2000-02-17');
-insert into t55 values (60,'2000-02-17');
-insert into t66 values (60,'2000-02-17');
-select * from t11 order by col1;
-col1
-2000-02-17
-2002-02-15
-select * from t22 order by col1;
-col1
-2000-02-17
-2002-02-15
-2004-05-25
-select * from t33 order by col1;
-col1
-2000-02-17
-2002-02-15
-2004-05-25
-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 2000-02-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 2000-02-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 2000-02-17
--------------------------
----- 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 ;
--------------------------------------------------------------------------
---- yearweek(col1)-200600 in partition with coltype date
--------------------------------------------------------------------------
-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 yearweek(col1)-200600
--------------------------------------------------------------------------
-create table t1 (col1 date) engine='NDB'
-partition by range(yearweek(col1)-200600)
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t2 (col1 date) engine='NDB'
-partition by list(yearweek(col1)-200600)
-(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 date) engine='NDB'
-partition by hash(yearweek(col1)-200600);
-create table t4 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-subpartition by hash(yearweek(col1)-200600) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-create table t5 (colint int, col1 date) engine='NDB'
-partition by list(colint)
-subpartition by hash(yearweek(col1)-200600) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-create table t6 (colint int, col1 date) engine='NDB'
-partition by range(colint)
-(partition p0 values less than (yearweek('2006-10-14')-200600),
-partition p1 values less than maxvalue);
--------------------------------------------------------------------------
---- Access tables with yearweek(col1)-200600
--------------------------------------------------------------------------
-insert into t1 values ('2006-01-03');
-insert into t1 values ('2006-08-17');
-insert into t2 values ('2006-01-03');
-insert into t2 values ('2006-08-17');
-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 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t4;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t5;
-load data infile 'MYSQLTEST_VARDIR/std_data/parts/part_supported_sql_funcs_int_date.inc' into table t6;
-select yearweek(col1)-200600 from t1 order by col1;
-yearweek(col1)-200600
-1
-33
-select * from t1 order by col1;
-col1
-2006-01-03
-2006-08-17
-select * from t2 order by col1;
-col1
-2006-01-03
-2006-03-25
-2006-08-17
-select * from t3 order by col1;
-col1
-2006-01-03
-2006-03-25
-2006-08-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
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-update t1 set col1='2006-11-15' where col1='2006-01-03';
-update t2 set col1='2006-11-15' where col1='2006-01-03';
-update t3 set col1='2006-11-15' where col1='2006-01-03';
-update t4 set col1='2006-11-15' where col1='2006-01-03';
-update t5 set col1='2006-11-15' where col1='2006-01-03';
-update t6 set col1='2006-11-15' where col1='2006-01-03';
-select * from t1 order by col1;
-col1
-2006-08-17
-2006-11-15
-select * from t2 order by col1;
-col1
-2006-03-25
-2006-08-17
-2006-11-15
-select * from t3 order by col1;
-col1
-2006-03-25
-2006-08-17
-2006-11-15
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t6 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Alter tables with yearweek(col1)-200600
--------------------------------------------------------------------------
-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='NDB' as select * from t1;
-create table t22 engine='NDB' as select * from t2;
-create table t33 engine='NDB' as select * from t3;
-create table t44 engine='NDB' as select * from t4;
-create table t55 engine='NDB' as select * from t5;
-create table t66 engine='NDB' as select * from t6;
-alter table t11
-partition by range(yearweek(col1)-200600)
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t22
-partition by list(yearweek(col1)-200600)
-(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(yearweek(col1)-200600);
-alter table t44
-partition by range(colint)
-subpartition by hash(yearweek(col1)-200600) subpartitions 2
-(partition p0 values less than (15),
-partition p1 values less than maxvalue);
-alter table t55
-partition by list(colint)
-subpartition by hash(yearweek(col1)-200600) subpartitions 2
-(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
-partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
-partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
-partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
-);
-alter table t66
-partition by range(colint)
-(partition p0 values less than (yearweek('2006-10-14')-200600),
-partition p1 values less than maxvalue);
-select * from t11 order by col1;
-col1
-2006-08-17
-2006-11-15
-select * from t22 order by col1;
-col1
-2006-03-25
-2006-08-17
-2006-11-15
-select * from t33 order by col1;
-col1
-2006-03-25
-2006-08-17
-2006-11-15
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t66 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
----------------------------
----- some alter table begin
----------------------------
-alter table t55
-partition by list(colint)
-subpartition by hash(yearweek(col1)-200600) subpartitions 4
-(partition p0 values in (0,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),
-partition p1 values in (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)
-);
-show create table t55;
-Table Create Table
-t55 CREATE TABLE `t55` (
- `colint` int(11) DEFAULT NULL,
- `col1` date DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY LIST (colint)
-SUBPARTITION BY HASH (yearweek(col1)-200600)
-SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (0,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) ENGINE = ndbcluster,
- PARTITION p1 VALUES IN (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) ENGINE = ndbcluster) */
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with yearweek(col1)-200600
--------------------------------------------------------------------------
-delete from t1 where col1='2006-08-17';
-delete from t2 where col1='2006-08-17';
-delete from t3 where col1='2006-08-17';
-delete from t4 where col1='2006-08-17';
-delete from t5 where col1='2006-08-17';
-delete from t6 where col1='2006-08-17';
-select * from t1 order by col1;
-col1
-2006-11-15
-select * from t2 order by col1;
-col1
-2006-03-25
-2006-11-15
-select * from t3 order by col1;
-col1
-2006-03-25
-2006-11-15
-select * from t4 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t5 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-insert into t1 values ('2006-08-17');
-insert into t2 values ('2006-08-17');
-insert into t3 values ('2006-08-17');
-insert into t4 values (60,'2006-08-17');
-insert into t5 values (60,'2006-08-17');
-insert into t6 values (60,'2006-08-17');
-select * from t1 order by col1;
-col1
-2006-08-17
-2006-11-15
-select * from t2 order by col1;
-col1
-2006-03-25
-2006-08-17
-2006-11-15
-select * from t3 order by col1;
-col1
-2006-03-25
-2006-08-17
-2006-11-15
-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-08-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-08-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-08-17
--------------------------------------------------------------------------
---- Delete rows and partitions of tables with yearweek(col1)-200600
--------------------------------------------------------------------------
-delete from t11 where col1='2006-08-17';
-delete from t22 where col1='2006-08-17';
-delete from t33 where col1='2006-08-17';
-delete from t44 where col1='2006-08-17';
-delete from t55 where col1='2006-08-17';
-delete from t66 where col1='2006-08-17';
-select * from t11 order by col1;
-col1
-2006-11-15
-select * from t22 order by col1;
-col1
-2006-03-25
-2006-11-15
-select * from t33 order by col1;
-col1
-2006-03-25
-2006-11-15
-select * from t44 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-select * from t55 order by colint;
-colint col1
-1 2006-02-03
-2 2006-01-17
-3 2006-01-25
-4 2006-02-05
-insert into t11 values ('2006-08-17');
-insert into t22 values ('2006-08-17');
-insert into t33 values ('2006-08-17');
-insert into t44 values (60,'2006-08-17');
-insert into t55 values (60,'2006-08-17');
-insert into t66 values (60,'2006-08-17');
-select * from t11 order by col1;
-col1
-2006-08-17
-2006-11-15
-select * from t22 order by col1;
-col1
-2006-03-25
-2006-08-17
-2006-11-15
-select * from t33 order by col1;
-col1
-2006-03-25
-2006-08-17
-2006-11-15
-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-08-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-08-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-08-17
--------------------------
----- 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 ;
diff --git a/mysql-test/suite/parts/r/partition_alter1_1_2_ndb.result b/mysql-test/suite/parts/r/partition_alter1_1_2_ndb.result
deleted file mode 100644
index c2095bffd5e..00000000000
--- a/mysql-test/suite/parts/r/partition_alter1_1_2_ndb.result
+++ /dev/null
@@ -1,27726 +0,0 @@
-SET @max_row = 20;
-SET @@session.storage_engine = 'ndbcluster';
-
-#------------------------------------------------------------------------
-# 0. Setting of auxiliary variables + Creation of an auxiliary tables
-# needed in many testcases
-#------------------------------------------------------------------------
-SELECT @max_row DIV 2 INTO @max_row_div2;
-SELECT @max_row DIV 3 INTO @max_row_div3;
-SELECT @max_row DIV 4 INTO @max_row_div4;
-SET @max_int_4 = 2147483647;
-DROP TABLE IF EXISTS t0_template;
-CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) ,
-PRIMARY KEY(f_int1))
-ENGINE = MEMORY;
-# Logging of <max_row> INSERTs into t0_template suppressed
-DROP TABLE IF EXISTS t0_definition;
-CREATE TABLE t0_definition (
-state CHAR(3),
-create_command VARBINARY(5000),
-file_list VARBINARY(10000),
-PRIMARY KEY (state)
-) ENGINE = MEMORY;
-DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) )
-ENGINE = MEMORY;
-SET AUTOCOMMIT= 1;
-SET @@session.sql_mode= '';
-# End of basic preparations needed for all tests
-#-----------------------------------------------
-
-#========================================================================
-# 1. ALTER TABLE ADD PRIMARY KEY and/or UNIQUE INDEX
-#========================================================================
-#------------------------------------------------------------------------
-# 1.2 ADD PRIMARY KEY or UNIQUE INDEX to table with two columns
-# (f_int1 and f_int2) within the partitioning function
-#------------------------------------------------------------------------
-# 1.2.1 PRIMARY KEY 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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-# 1.2.2 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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-# 1.2.3 PRIMARY KEY and 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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`),
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`),
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`),
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`),
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`),
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`),
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`),
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2), ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`),
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1), ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`),
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-DROP VIEW IF EXISTS v1;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t0_aux;
-DROP TABLE IF EXISTS t0_definition;
-DROP TABLE IF EXISTS t0_template;
diff --git a/mysql-test/suite/parts/r/partition_alter1_1_ndb.result b/mysql-test/suite/parts/r/partition_alter1_1_ndb.result
deleted file mode 100644
index 86608ece057..00000000000
--- a/mysql-test/suite/parts/r/partition_alter1_1_ndb.result
+++ /dev/null
@@ -1,24316 +0,0 @@
-SET @max_row = 20;
-SET @@session.storage_engine = 'ndbcluster';
-
-#------------------------------------------------------------------------
-# 0. Setting of auxiliary variables + Creation of an auxiliary tables
-# needed in many testcases
-#------------------------------------------------------------------------
-SELECT @max_row DIV 2 INTO @max_row_div2;
-SELECT @max_row DIV 3 INTO @max_row_div3;
-SELECT @max_row DIV 4 INTO @max_row_div4;
-SET @max_int_4 = 2147483647;
-DROP TABLE IF EXISTS t0_template;
-CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) ,
-PRIMARY KEY(f_int1))
-ENGINE = MEMORY;
-# Logging of <max_row> INSERTs into t0_template suppressed
-DROP TABLE IF EXISTS t0_definition;
-CREATE TABLE t0_definition (
-state CHAR(3),
-create_command VARBINARY(5000),
-file_list VARBINARY(10000),
-PRIMARY KEY (state)
-) ENGINE = MEMORY;
-DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) )
-ENGINE = MEMORY;
-SET AUTOCOMMIT= 1;
-SET @@session.sql_mode= '';
-# End of basic preparations needed for all tests
-#-----------------------------------------------
-
-#========================================================================
-# 1. ALTER TABLE ADD PRIMARY KEY and/or UNIQUE INDEX
-#========================================================================
-#------------------------------------------------------------------------
-# 1.1 ADD PRIMARY KEY or UNIQUE INDEX to table with one column (f_int1)
-# within the partitioning function
-#------------------------------------------------------------------------
-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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) DEFAULT NULL,
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-2-a success: 1
-
-# check unique-2-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-# 1.1.3 PRIMARY KEY 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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD PRIMARY KEY(f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL,
- PRIMARY KEY (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-# 1.1.4 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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int1,f_int2);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int1`,`f_int2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 ADD UNIQUE INDEX uidx1 (f_int2,f_int1);
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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,
- UNIQUE KEY `uidx1` (`f_int2`,`f_int1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-ERROR 23000: Can't write; duplicate key in table 't1'
-# check prerequisites-3 success: 1
-# INFO: f_int1 AND/OR f_int2 AND/OR (f_int1,f_int2) is UNIQUE
-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),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT 2 * @max_row + f_int1, f_int1, CAST((2 * @max_row + f_int1) AS CHAR),
-CAST((2 * @max_row + f_int1) AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT COUNT(*) INTO @try_count FROM t0_template
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT COUNT(*) INTO @clash_count
-FROM t1 INNER JOIN t0_template USING(f_int1)
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0
-AND f_int1 BETWEEN @max_row_div2 AND @max_row
-ON DUPLICATE KEY
-UPDATE f_int1 = 2 * @max_row + source_tab.f_int1,
-f_int2 = 2 * @max_row + source_tab.f_int1,
-f_charbig = 'was updated';
-
-# check unique-1-a success: 1
-
-# check unique-1-b success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===')
-WHERE f_charbig = 'was updated';
-REPLACE INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, - f_int1, '', '', 'was inserted or replaced'
- FROM t0_template source_tab
-WHERE MOD(f_int1,3) = 0 AND f_int1 BETWEEN @max_row_div2 AND @max_row;
-
-# check replace success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row_div2 + @max_row_div4;
-DELETE FROM t1
-WHERE f_int1 = f_int2 AND MOD(f_int1,3) = 0 AND
-f_int1 BETWEEN @max_row_div2 + @max_row_div4 AND @max_row;
-UPDATE t1 SET f_int2 = f_int1,
-f_char1 = CAST(f_int1 AS CHAR),
-f_char2 = CAST(f_int1 AS CHAR),
-f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===')
-WHERE f_charbig = 'was inserted or replaced' AND f_int1 = - f_int2;
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-DROP VIEW IF EXISTS v1;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t0_aux;
-DROP TABLE IF EXISTS t0_definition;
-DROP TABLE IF EXISTS t0_template;
diff --git a/mysql-test/suite/parts/r/partition_alter1_2_ndb.result b/mysql-test/suite/parts/r/partition_alter1_2_ndb.result
deleted file mode 100644
index e3f3f6f41c1..00000000000
--- a/mysql-test/suite/parts/r/partition_alter1_2_ndb.result
+++ /dev/null
@@ -1,35540 +0,0 @@
-SET @max_row = 20;
-SET @@session.storage_engine = 'ndbcluster';
-
-#------------------------------------------------------------------------
-# 0. Setting of auxiliary variables + Creation of an auxiliary tables
-# needed in many testcases
-#------------------------------------------------------------------------
-SELECT @max_row DIV 2 INTO @max_row_div2;
-SELECT @max_row DIV 3 INTO @max_row_div3;
-SELECT @max_row DIV 4 INTO @max_row_div4;
-SET @max_int_4 = 2147483647;
-DROP TABLE IF EXISTS t0_template;
-CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) ,
-PRIMARY KEY(f_int1))
-ENGINE = MEMORY;
-# Logging of <max_row> INSERTs into t0_template suppressed
-DROP TABLE IF EXISTS t0_definition;
-CREATE TABLE t0_definition (
-state CHAR(3),
-create_command VARBINARY(5000),
-file_list VARBINARY(10000),
-PRIMARY KEY (state)
-) ENGINE = MEMORY;
-DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) )
-ENGINE = MEMORY;
-SET AUTOCOMMIT= 1;
-SET @@session.sql_mode= '';
-# End of basic preparations needed for all tests
-#-----------------------------------------------
-
-#========================================================================
-# 2 DROP PRIMARY KEY or UNIQUE INDEX
-#========================================================================
-#------------------------------------------------------------------------
-# 2.1 Partitioning function contains one column(f_int1)
-#------------------------------------------------------------------------
-# 2.1.5 DROP 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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-#------------------------------------------------------------------------
-# 2.2 Partitioning function contains two columns (f_int1,f_int2)
-#------------------------------------------------------------------------
-# 2.2.1 DROP PRIMARY KEY 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)
-, PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-# 2.2.2 DROP 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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, UNIQUE INDEX uidx1 (f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-# 2.2.3 DROP 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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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), PRIMARY KEY(f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, UNIQUE INDEX uidx1 (f_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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_int2,f_int1), PRIMARY KEY(f_int1,f_int2)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP PRIMARY KEY, DROP INDEX uidx1;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `f_int1` int(11) NOT NULL DEFAULT '0',
- `f_int2` int(11) NOT NULL DEFAULT '0',
- `f_char1` char(20) DEFAULT NULL,
- `f_char2` char(20) DEFAULT NULL,
- `f_charbig` varchar(1000) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-ERROR 23000: Column 'f_int1' cannot be null
-# check null success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-, UNIQUE INDEX uidx1 (f_int1,f_int2), UNIQUE INDEX uidx2 (f_int2,f_int1)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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)
-)
-;
-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
-WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
-ALTER TABLE t1 DROP INDEX uidx1, DROP INDEX uidx2;
-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
-WHERE f_int1 BETWEEN @max_row_div2 AND @max_row;
-# Start usability test (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-DROP VIEW IF EXISTS v1;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t0_aux;
-DROP TABLE IF EXISTS t0_definition;
-DROP TABLE IF EXISTS t0_template;
diff --git a/mysql-test/suite/parts/r/partition_alter3_innodb.result b/mysql-test/suite/parts/r/partition_alter3_innodb.result
index c5750e007e6..7825a2350b0 100644
--- a/mysql-test/suite/parts/r/partition_alter3_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter3_innodb.result
@@ -57,7 +57,6 @@ t1 CREATE TABLE `t1` (
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
t1.frm
-t1.ibd
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
@@ -79,7 +78,6 @@ t1 CREATE TABLE `t1` (
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (YEAR(f_date)) */
-t1#P#p0.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -98,7 +96,6 @@ t1 CREATE TABLE `t1` (
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (DAYOFYEAR(f_date)) */
-t1#P#p0.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -115,7 +112,6 @@ t1 CREATE TABLE `t1` (
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (YEAR(f_date)) */
-t1#P#p0.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -141,9 +137,6 @@ t1 CREATE TABLE `t1` (
(PARTITION p0 ENGINE = InnoDB,
PARTITION part1 ENGINE = InnoDB,
PARTITION part7 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#part1.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -168,10 +161,6 @@ t1 CREATE TABLE `t1` (
PARTITION part1 ENGINE = InnoDB,
PARTITION part7 ENGINE = InnoDB,
PARTITION part2 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -197,14 +186,6 @@ t1 CREATE TABLE `t1` (
PARTITION p5 ENGINE = InnoDB,
PARTITION p6 ENGINE = InnoDB,
PARTITION p7 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#p4.ibd
-t1#P#p5.ibd
-t1#P#p6.ibd
-t1#P#p7.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -241,13 +222,6 @@ t1 CREATE TABLE `t1` (
PARTITION p4 ENGINE = InnoDB,
PARTITION p5 ENGINE = InnoDB,
PARTITION p6 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#p4.ibd
-t1#P#p5.ibd
-t1#P#p6.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -270,12 +244,6 @@ t1 CREATE TABLE `t1` (
PARTITION part2 ENGINE = InnoDB,
PARTITION p4 ENGINE = InnoDB,
PARTITION p5 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#p4.ibd
-t1#P#p5.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -297,11 +265,6 @@ t1 CREATE TABLE `t1` (
PARTITION part7 ENGINE = InnoDB,
PARTITION part2 ENGINE = InnoDB,
PARTITION p4 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#p4.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -322,10 +285,6 @@ t1 CREATE TABLE `t1` (
PARTITION part1 ENGINE = InnoDB,
PARTITION part7 ENGINE = InnoDB,
PARTITION part2 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -345,9 +304,6 @@ t1 CREATE TABLE `t1` (
(PARTITION p0 ENGINE = InnoDB,
PARTITION part1 ENGINE = InnoDB,
PARTITION part7 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#part1.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -366,8 +322,6 @@ t1 CREATE TABLE `t1` (
/*!50100 PARTITION BY HASH (YEAR(f_date))
(PARTITION p0 ENGINE = InnoDB,
PARTITION part1 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#part1.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -385,7 +339,6 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (YEAR(f_date))
(PARTITION p0 ENGINE = InnoDB) */
-t1#P#p0.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10';
@@ -406,7 +359,6 @@ t1 CREATE TABLE `t1` (
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
t1.frm
-t1.ibd
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
@@ -446,7 +398,6 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
t1.frm
-t1.ibd
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
@@ -469,7 +420,6 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (f_int1) */
-t1#P#p0.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -498,9 +448,6 @@ t1 CREATE TABLE `t1` (
(PARTITION p0 ENGINE = InnoDB,
PARTITION part1 ENGINE = InnoDB,
PARTITION part7 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#part1.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -525,10 +472,6 @@ t1 CREATE TABLE `t1` (
PARTITION part1 ENGINE = InnoDB,
PARTITION part7 ENGINE = InnoDB,
PARTITION part2 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -557,14 +500,6 @@ t1 CREATE TABLE `t1` (
PARTITION p5 ENGINE = InnoDB,
PARTITION p6 ENGINE = InnoDB,
PARTITION p7 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#p4.ibd
-t1#P#p5.ibd
-t1#P#p6.ibd
-t1#P#p7.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -599,13 +534,6 @@ t1 CREATE TABLE `t1` (
PARTITION p4 ENGINE = InnoDB,
PARTITION p5 ENGINE = InnoDB,
PARTITION p6 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#p4.ibd
-t1#P#p5.ibd
-t1#P#p6.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -631,12 +559,6 @@ t1 CREATE TABLE `t1` (
PARTITION part2 ENGINE = InnoDB,
PARTITION p4 ENGINE = InnoDB,
PARTITION p5 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#p4.ibd
-t1#P#p5.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -661,11 +583,6 @@ t1 CREATE TABLE `t1` (
PARTITION part7 ENGINE = InnoDB,
PARTITION part2 ENGINE = InnoDB,
PARTITION p4 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#p4.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -689,10 +606,6 @@ t1 CREATE TABLE `t1` (
PARTITION part1 ENGINE = InnoDB,
PARTITION part7 ENGINE = InnoDB,
PARTITION part2 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -715,9 +628,6 @@ t1 CREATE TABLE `t1` (
(PARTITION p0 ENGINE = InnoDB,
PARTITION part1 ENGINE = InnoDB,
PARTITION part7 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#part1.ibd
-t1#P#part7.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -739,8 +649,6 @@ t1 CREATE TABLE `t1` (
/*!50100 PARTITION BY KEY (f_int1)
(PARTITION p0 ENGINE = InnoDB,
PARTITION part1 ENGINE = InnoDB) */
-t1#P#p0.ibd
-t1#P#part1.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -761,7 +669,6 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (f_int1)
(PARTITION p0 ENGINE = InnoDB) */
-t1#P#p0.ibd
t1.frm
t1.par
EXPLAIN PARTITIONS SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3;
@@ -785,7 +692,6 @@ t1 CREATE TABLE `t1` (
`f_charbig` varchar(1000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
t1.frm
-t1.ibd
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_auto_increment_blackhole.result b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
index d6ea8ba0fe4..2344f03ce3f 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
@@ -120,6 +120,38 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`)
) ENGINE=BLACKHOLE DEFAULT CHARSET=latin1
DROP TABLE t1;
+CREATE TABLE t1
+(a INT NULL AUTO_INCREMENT,
+UNIQUE KEY (a))
+ENGINE='Blackhole';
+SET LAST_INSERT_ID = 999;
+SET INSERT_ID = 0;
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+UPDATE t1 SET a = 1 WHERE a IS NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+UPDATE t1 SET a = NULL WHERE a = 1;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+DROP TABLE t1;
+SET INSERT_ID = 1;
# Simple test with NULL
CREATE TABLE t1 (
c1 INT NOT NULL AUTO_INCREMENT,
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
index 4cd7aa57417..34e47f58272 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
@@ -134,8 +134,44 @@ Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1
+(a INT NULL AUTO_INCREMENT,
+UNIQUE KEY (a))
+ENGINE='InnoDB';
+SET LAST_INSERT_ID = 999;
+SET INSERT_ID = 0;
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+1
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = 1 WHERE a IS NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = NULL WHERE a = 1;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
DROP TABLE t1;
+SET INSERT_ID = 1;
# Simple test with NULL
CREATE TABLE t1 (
c1 INT NOT NULL AUTO_INCREMENT,
@@ -404,7 +440,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`c1`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (c1)
PARTITIONS 2 */
DROP TABLE t1;
@@ -1023,4 +1059,40 @@ c1 c2
2 20
127 40
DROP TABLE t;
+CREATE TABLE t1
+(a INT NULL AUTO_INCREMENT,
+UNIQUE KEY (a))
+ENGINE='InnoDB'
+PARTITION BY KEY(a) PARTITIONS 2;
+SET LAST_INSERT_ID = 999;
+SET INSERT_ID = 0;
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+1
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = 1 WHERE a IS NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = NULL WHERE a = 1;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+DROP TABLE t1;
##############################################################################
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_memory.result b/mysql-test/suite/parts/r/partition_auto_increment_memory.result
index 1a27d1c2e52..c3a5073b029 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_memory.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_memory.result
@@ -136,6 +136,42 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`)
) ENGINE=MEMORY AUTO_INCREMENT=102 DEFAULT CHARSET=latin1
DROP TABLE t1;
+CREATE TABLE t1
+(a INT NULL AUTO_INCREMENT,
+UNIQUE KEY (a))
+ENGINE='Memory';
+SET LAST_INSERT_ID = 999;
+SET INSERT_ID = 0;
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+1
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = 1 WHERE a IS NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = NULL WHERE a = 1;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+DROP TABLE t1;
+SET INSERT_ID = 1;
# Simple test with NULL
CREATE TABLE t1 (
c1 INT NOT NULL AUTO_INCREMENT,
@@ -1051,4 +1087,40 @@ c1 c2
2 20
127 40
DROP TABLE t;
+CREATE TABLE t1
+(a INT NULL AUTO_INCREMENT,
+UNIQUE KEY (a))
+ENGINE='Memory'
+PARTITION BY KEY(a) PARTITIONS 2;
+SET LAST_INSERT_ID = 999;
+SET INSERT_ID = 0;
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+1
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = 1 WHERE a IS NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = NULL WHERE a = 1;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+DROP TABLE t1;
##############################################################################
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_myisam.result b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
index 9885c78a921..ad440155d33 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
@@ -136,6 +136,42 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`)
) ENGINE=MyISAM AUTO_INCREMENT=102 DEFAULT CHARSET=latin1
DROP TABLE t1;
+CREATE TABLE t1
+(a INT NULL AUTO_INCREMENT,
+UNIQUE KEY (a))
+ENGINE='MyISAM';
+SET LAST_INSERT_ID = 999;
+SET INSERT_ID = 0;
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+1
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = 1 WHERE a IS NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = NULL WHERE a = 1;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+DROP TABLE t1;
+SET INSERT_ID = 1;
# Simple test with NULL
CREATE TABLE t1 (
c1 INT NOT NULL AUTO_INCREMENT,
@@ -1070,4 +1106,40 @@ c1 c2
2 20
127 40
DROP TABLE t;
+CREATE TABLE t1
+(a INT NULL AUTO_INCREMENT,
+UNIQUE KEY (a))
+ENGINE='MyISAM'
+PARTITION BY KEY(a) PARTITIONS 2;
+SET LAST_INSERT_ID = 999;
+SET INSERT_ID = 0;
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+1
+INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = 1 WHERE a IS NULL;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+UPDATE t1 SET a = NULL WHERE a = 1;
+SELECT LAST_INSERT_ID();
+LAST_INSERT_ID()
+999
+SELECT * FROM t1;
+a
+0
+DROP TABLE t1;
##############################################################################
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_ndb.result b/mysql-test/suite/parts/r/partition_auto_increment_ndb.result
deleted file mode 100644
index 40387b9777a..00000000000
--- a/mysql-test/suite/parts/r/partition_auto_increment_ndb.result
+++ /dev/null
@@ -1,1047 +0,0 @@
-SET new=on;
-DROP TABLE IF EXISTS t1;
-# test without partitioning for reference
-CREATE TABLE t1 (
-c1 INT NOT NULL AUTO_INCREMENT,
-PRIMARY KEY (c1))
-ENGINE='NDB';
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
-AND TABLE_NAME='t1';
-AUTO_INCREMENT
-1
-INSERT INTO t1 VALUES (2);
-INSERT INTO t1 VALUES (4);
-INSERT INTO t1 VALUES (NULL);
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
-AND TABLE_NAME='t1';
-AUTO_INCREMENT
-6
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
-AND TABLE_NAME='t1';
-AUTO_INCREMENT
-6
-INSERT INTO t1 VALUES (0);
-INSERT INTO t1 VALUES (5), (16);
-INSERT INTO t1 VALUES (17);
-INSERT INTO t1 VALUES (19), (NULL);
-INSERT INTO t1 VALUES (NULL), (10), (NULL);
-INSERT INTO t1 VALUES (NULL);
-SET INSERT_ID = 30;
-INSERT INTO t1 VALUES (NULL);
-SET INSERT_ID = 29;
-INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
-INSERT INTO t1 VALUES (NULL);
-UPDATE t1 SET c1 = 50 WHERE c1 = 17;
-UPDATE t1 SET c1 = 51 WHERE c1 = 19;
-FLUSH TABLES;
-UPDATE t1 SET c1 = 40 WHERE c1 = 50;
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
- AND TABLE_NAME='t1';
-AUTO_INCREMENT
-52
-UPDATE t1 SET c1 = NULL WHERE c1 = 4;
-Warnings:
-Warning 1048 Column 'c1' cannot be null
-INSERT INTO t1 VALUES (NULL);
-INSERT INTO t1 VALUES (NULL);
-SELECT * FROM t1 ORDER BY c1;
-c1
-0
-2
-5
-6
-10
-20
-21
-22
-23
-24
-30
-40
-51
-52
-53
-DROP TABLE t1;
-CREATE TABLE t1 (
-c1 INT NOT NULL AUTO_INCREMENT,
-PRIMARY KEY (c1))
-ENGINE='NDB';
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-FLUSH TABLE;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-INSERT INTO t1 VALUES (4);
-FLUSH TABLE;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-INSERT INTO t1 VALUES (NULL);
-FLUSH TABLE;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-DELETE FROM t1;
-INSERT INTO t1 VALUES (NULL);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-SELECT * FROM t1 ORDER BY c1;
-c1
-6
-TRUNCATE TABLE t1;
-INSERT INTO t1 VALUES (NULL);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-SELECT * FROM t1 ORDER BY c1;
-c1
-1
-INSERT INTO t1 VALUES (100);
-INSERT INTO t1 VALUES (NULL);
-DELETE FROM t1 WHERE c1 >= 100;
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-DROP TABLE t1;
-# Simple test with NULL
-CREATE TABLE t1 (
-c1 INT NOT NULL AUTO_INCREMENT,
-PRIMARY KEY (c1))
-ENGINE='NDB'
-PARTITION BY HASH(c1)
-PARTITIONS 2;
-INSERT INTO t1 VALUES (NULL);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-SELECT * FROM t1;
-c1
-1
-DROP TABLE t1;
-# Test with sql_mode and first insert as 0
-CREATE TABLE t1 (
-c1 INT,
-c2 INT NOT NULL AUTO_INCREMENT,
-PRIMARY KEY (c2))
-ENGINE='NDB'
-PARTITION BY HASH(c2)
-PARTITIONS 2;
-INSERT INTO t1 VALUES (1, NULL);
-INSERT INTO t1 VALUES (1, 1), (99, 99);
-INSERT INTO t1 VALUES (1, NULL);
-SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
-INSERT INTO t1 VALUES (1, 0);
-SELECT * FROM t1 ORDER BY c1, c2;
-c1 c2
-1 0
-1 1
-1 100
-DROP TABLE t1;
-CREATE TABLE t1 (
-c1 INT,
-c2 INT NOT NULL AUTO_INCREMENT,
-PRIMARY KEY (c2))
-ENGINE='NDB'
-PARTITION BY HASH(c2)
-PARTITIONS 2;
-INSERT INTO t1 VALUES (1, 0);
-INSERT INTO t1 VALUES (1, 1), (1, NULL);
-INSERT INTO t1 VALUES (2, NULL), (4, 7);
-INSERT INTO t1 VALUES (1, NULL);
-SELECT * FROM t1 ORDER BY c1, c2;
-c1 c2
-1 0
-1 1
-1 2
-1 8
-2 3
-4 7
-SET @@session.sql_mode = '';
-DROP TABLE t1;
-# Simple test with NULL, 0 and explicit values both incr. and desc.
-CREATE TABLE t1 (
-c1 INT NOT NULL AUTO_INCREMENT,
-PRIMARY KEY (c1))
-ENGINE='NDB'
-PARTITION BY HASH(c1)
-PARTITIONS 2;
-INSERT INTO t1 VALUES (2), (4), (NULL);
-INSERT INTO t1 VALUES (0);
-INSERT INTO t1 VALUES (5), (16);
-INSERT INTO t1 VALUES (17), (19), (NULL);
-INSERT INTO t1 VALUES (NULL), (10), (NULL);
-INSERT INTO t1 VALUES (NULL), (9);
-INSERT INTO t1 VALUES (59), (55);
-INSERT INTO t1 VALUES (NULL), (90);
-INSERT INTO t1 VALUES (NULL);
-UPDATE t1 SET c1 = 150 WHERE c1 = 17;
-UPDATE t1 SET c1 = 151 WHERE c1 = 19;
-FLUSH TABLES;
-UPDATE t1 SET c1 = 140 WHERE c1 = 150;
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
- AND TABLE_NAME='t1';
-AUTO_INCREMENT
-152
-UPDATE t1 SET c1 = NULL WHERE c1 = 4;
-Warnings:
-Warning 1048 Column 'c1' cannot be null
-INSERT INTO t1 VALUES (NULL);
-INSERT INTO t1 VALUES (NULL);
-SELECT * FROM t1 ORDER BY c1;
-c1
-0
-2
-5
-6
-9
-10
-20
-21
-22
-23
-55
-59
-60
-90
-91
-140
-151
-152
-153
-DROP TABLE t1;
-# Test with auto_increment_increment and auto_increment_offset.
-CREATE TABLE t1 (
-c1 INT NOT NULL AUTO_INCREMENT,
-PRIMARY KEY (c1))
-ENGINE='NDB'
-PARTITION BY HASH(c1)
-PARTITIONS 2;
-SET @@session.auto_increment_increment = 10;
-SET @@session.auto_increment_offset = 5;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
-SET @@session.auto_increment_increment = 5;
-SET @@session.auto_increment_offset = 3;
-INSERT INTO t1 VALUES (NULL);
-INSERT INTO t1 VALUES (33 + 1);
-INSERT INTO t1 VALUES (NULL);
-INSERT INTO t1 VALUES (38 + 2);
-INSERT INTO t1 VALUES (NULL);
-INSERT INTO t1 VALUES (43 + 3);
-INSERT INTO t1 VALUES (NULL);
-INSERT INTO t1 VALUES (48 + 4);
-INSERT INTO t1 VALUES (NULL);
-INSERT INTO t1 VALUES (53 + 5);
-INSERT INTO t1 VALUES (NULL);
-INSERT INTO t1 VALUES (63 + 6);
-INSERT INTO t1 VALUES (NULL);
-SET @@session.auto_increment_increment = 1;
-SET @@session.auto_increment_offset = 1;
-SELECT * FROM t1 ORDER BY c1;
-c1
-1
-5
-15
-25
-33
-34
-38
-40
-43
-46
-48
-52
-53
-58
-63
-69
-73
-DROP TABLE t1;
-# Test reported auto_increment value
-CREATE TABLE t1 (
-c1 INT NOT NULL AUTO_INCREMENT,
-PRIMARY KEY (c1))
-ENGINE='NDB'
-PARTITION BY HASH (c1)
-PARTITIONS 2;
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
-AND TABLE_NAME='t1';
-AUTO_INCREMENT
-1
-INSERT INTO t1 VALUES (2);
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
-AND TABLE_NAME='t1';
-AUTO_INCREMENT
-3
-INSERT INTO t1 VALUES (4);
-INSERT INTO t1 VALUES (NULL);
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
-AND TABLE_NAME='t1';
-AUTO_INCREMENT
-6
-INSERT INTO t1 VALUES (NULL);
-INSERT INTO t1 VALUES (17);
-INSERT INTO t1 VALUES (19);
-INSERT INTO t1 VALUES (NULL);
-INSERT INTO t1 VALUES (NULL);
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
-AND TABLE_NAME='t1';
-AUTO_INCREMENT
-22
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
-AND TABLE_NAME='t1';
-AUTO_INCREMENT
-22
-INSERT INTO t1 VALUES (10);
-SELECT * FROM t1 ORDER BY c1;
-c1
-2
-4
-5
-6
-10
-17
-19
-20
-21
-INSERT INTO t1 VALUES (NULL);
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'
-AND TABLE_NAME='t1';
-AUTO_INCREMENT
-23
-INSERT INTO t1 VALUES (NULL);
-INSERT INTO t1 VALUES (15);
-INSERT INTO t1 VALUES (NULL);
-SELECT * FROM t1 ORDER BY c1;
-c1
-2
-4
-5
-6
-10
-15
-17
-19
-20
-21
-22
-23
-24
-INSERT INTO t1 VALUES (NULL);
-DELETE FROM t1;
-INSERT INTO t1 VALUES (NULL);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-SELECT * FROM t1 ORDER BY c1;
-c1
-26
-TRUNCATE TABLE t1;
-INSERT INTO t1 VALUES (NULL);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-SELECT * FROM t1 ORDER BY c1;
-c1
-1
-INSERT INTO t1 VALUES (100);
-INSERT INTO t1 VALUES (NULL);
-DELETE FROM t1 WHERE c1 >= 100;
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-DROP TABLE t1;
-# Test with two threads
-# con default
-CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
-ENGINE = 'NDB'
-PARTITION BY HASH(c1)
-PARTITIONS 2;
-INSERT INTO t1 (c1) VALUES (2);
-INSERT INTO t1 (c1) VALUES (4);
-# con1
-INSERT INTO t1 (c1) VALUES (NULL);
-INSERT INTO t1 (c1) VALUES (10);
-# con default
-INSERT INTO t1 (c1) VALUES (NULL);
-INSERT INTO t1 (c1) VALUES (NULL);
-INSERT INTO t1 (c1) VALUES (19);
-INSERT INTO t1 (c1) VALUES (21);
-# con1
-INSERT INTO t1 (c1) VALUES (NULL);
-# con default
-INSERT INTO t1 (c1) VALUES (16);
-# con1
-INSERT INTO t1 (c1) VALUES (NULL);
-# con default
-INSERT INTO t1 (c1) VALUES (NULL);
-SELECT * FROM t1 ORDER BY c1;
-c1
-2
-4
-5
-10
-11
-12
-16
-19
-21
-22
-23
-24
-DROP TABLE t1;
-# Test with two threads + start transaction NO PARTITIONING
-# con default
-CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
-ENGINE = 'NDB';
-START TRANSACTION;
-INSERT INTO t1 (c1) VALUES (2);
-INSERT INTO t1 (c1) VALUES (4);
-# con1
-START TRANSACTION;
-INSERT INTO t1 (c1) VALUES (NULL);
-INSERT INTO t1 (c1) VALUES (10);
-# con default
-INSERT INTO t1 (c1) VALUES (NULL);
-INSERT INTO t1 (c1) VALUES (NULL);
-INSERT INTO t1 (c1) VALUES (19);
-INSERT INTO t1 (c1) VALUES (21);
-# con1
-INSERT INTO t1 (c1) VALUES (NULL);
-# con default
-INSERT INTO t1 (c1) VALUES (16);
-# con1
-INSERT INTO t1 (c1) VALUES (NULL);
-SELECT * FROM t1 ORDER BY c1;
-c1
-5
-10
-22
-23
-COMMIT;
-SELECT * FROM t1 ORDER BY c1;
-c1
-5
-10
-22
-23
-# con default
-INSERT INTO t1 (c1) VALUES (NULL);
-SELECT * FROM t1 ORDER BY c1;
-c1
-2
-4
-5
-10
-11
-12
-16
-19
-21
-22
-23
-24
-COMMIT;
-SELECT * FROM t1 ORDER BY c1;
-c1
-2
-4
-5
-10
-11
-12
-16
-19
-21
-22
-23
-24
-DROP TABLE t1;
-# Test with two threads + start transaction
-# con default
-CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
-ENGINE = 'NDB'
-PARTITION BY HASH(c1)
-PARTITIONS 2;
-START TRANSACTION;
-INSERT INTO t1 (c1) VALUES (2);
-INSERT INTO t1 (c1) VALUES (4);
-# con1
-START TRANSACTION;
-INSERT INTO t1 (c1) VALUES (NULL), (10);
-# con default
-INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
-INSERT INTO t1 (c1) VALUES (21);
-# con1
-INSERT INTO t1 (c1) VALUES (NULL);
-# con default
-INSERT INTO t1 (c1) VALUES (16);
-# con1
-INSERT INTO t1 (c1) VALUES (NULL);
-SELECT * FROM t1 ORDER BY c1;
-c1
-5
-10
-22
-23
-COMMIT;
-SELECT * FROM t1 ORDER BY c1;
-c1
-5
-10
-22
-23
-# con default
-INSERT INTO t1 (c1) VALUES (NULL);
-SELECT * FROM t1 ORDER BY c1;
-c1
-2
-4
-5
-10
-11
-12
-16
-19
-21
-22
-23
-24
-COMMIT;
-SELECT * FROM t1 ORDER BY c1;
-c1
-2
-4
-5
-10
-11
-12
-16
-19
-21
-22
-23
-24
-DROP TABLE t1;
-# Test with another column after
-CREATE TABLE t1 (
-c1 INT NOT NULL AUTO_INCREMENT,
-c2 INT,
-PRIMARY KEY (c1,c2))
-ENGINE = 'NDB'
-PARTITION BY HASH(c2)
-PARTITIONS 2;
-INSERT INTO t1 VALUES (1, 0);
-INSERT INTO t1 VALUES (1, 1);
-INSERT INTO t1 VALUES (NULL, 1), (NULL, 2), (NULL, 3);
-INSERT INTO t1 VALUES (NULL, 3);
-INSERT INTO t1 VALUES (2, 0), (NULL, 2);
-INSERT INTO t1 VALUES (2, 2);
-INSERT INTO t1 VALUES (2, 22);
-INSERT INTO t1 VALUES (NULL, 2);
-SELECT * FROM t1 ORDER BY c1,c2;
-c1 c2
-1 0
-1 1
-2 0
-2 1
-2 2
-2 22
-3 2
-4 3
-5 3
-6 2
-7 2
-DROP TABLE t1;
-# Test with another column before
-CREATE TABLE t1 (
-c1 INT,
-c2 INT NOT NULL AUTO_INCREMENT,
-PRIMARY KEY (c2))
-ENGINE = 'NDB'
-PARTITION BY HASH(c2)
-PARTITIONS 2;
-INSERT INTO t1 VALUES (1, 0);
-INSERT INTO t1 VALUES (1, 1);
-INSERT INTO t1 VALUES (1, NULL);
-INSERT INTO t1 VALUES (2, NULL), (3, 11), (3, NULL), (2, 0);
-INSERT INTO t1 VALUES (2, NULL);
-INSERT INTO t1 VALUES (2, 2);
-INSERT INTO t1 VALUES (2, 22);
-INSERT INTO t1 VALUES (2, NULL);
-SELECT * FROM t1 ORDER BY c1,c2;
-c1 c2
-1 1
-1 2
-2 3
-2 13
-2 14
-2 22
-2 23
-3 11
-3 12
-DROP TABLE t1;
-# Test with auto_increment on secondary column in multi-column-index
-CREATE TABLE t1 (
-c1 INT,
-c2 INT NOT NULL AUTO_INCREMENT,
-PRIMARY KEY (c1,c2))
-ENGINE = 'NDB'
-PARTITION BY HASH(c2)
-PARTITIONS 2;
-INSERT INTO t1 VALUES (1, 0);
-INSERT INTO t1 VALUES (1, 1);
-INSERT INTO t1 VALUES (1, NULL);
-INSERT INTO t1 VALUES (2, NULL);
-INSERT INTO t1 VALUES (3, NULL);
-INSERT INTO t1 VALUES (3, NULL), (2, 0), (2, NULL);
-INSERT INTO t1 VALUES (2, 2);
-# ERROR (only OK if Blackhole/NDB) should give ER_DUP_KEY or ER_DUP_ENTRY
-# mysql_errno: 0
-INSERT INTO t1 VALUES (2, 22), (2, NULL);
-SELECT * FROM t1 ORDER BY c1,c2;
-c1 c2
-1 1
-1 2
-2 2
-2 3
-2 6
-2 7
-2 22
-2 23
-3 4
-3 5
-DROP TABLE t1;
-# Test AUTO_INCREMENT in CREATE
-CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
-ENGINE = 'NDB'
-AUTO_INCREMENT = 15
-PARTITION BY HASH(c1)
-PARTITIONS 2;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-INSERT INTO t1 (c1) VALUES (4);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-INSERT INTO t1 (c1) VALUES (0);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-INSERT INTO t1 (c1) VALUES (NULL);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-SELECT * FROM t1 ORDER BY c1;
-c1
-4
-15
-16
-# Test sql_mode 'NO_AUTO_VALUE_ON_ZERO'
-SET @@session.sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
-INSERT INTO t1 (c1) VALUES (300);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-INSERT INTO t1 (c1) VALUES (0);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-INSERT INTO t1 (c1) VALUES (NULL);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-SELECT * FROM t1 ORDER BY c1;
-c1
-0
-4
-15
-16
-300
-301
-SET @@session.sql_mode = '';
-DROP TABLE t1;
-# Test SET INSERT_ID
-CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
-ENGINE = 'NDB'
-PARTITION BY HASH(c1)
-PARTITIONS 2;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-INSERT INTO t1 (c1) VALUES (NULL);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-SELECT * FROM t1;
-c1
-1
-SET INSERT_ID = 23;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-INSERT INTO t1 (c1) VALUES (NULL);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-SET INSERT_ID = 22;
-INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
-INSERT INTO t1 VALUES (NULL);
-SELECT * FROM t1 ORDER BY c1;
-c1
-1
-2
-23
-DROP TABLE t1;
-# Testing with FLUSH TABLE
-CREATE TABLE t1 (
-c1 INT NOT NULL AUTO_INCREMENT,
-PRIMARY KEY (c1))
-ENGINE='NDB'
-PARTITION BY HASH(c1)
-PARTITIONS 2;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-FLUSH TABLE;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-INSERT INTO t1 VALUES (4);
-FLUSH TABLE;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-INSERT INTO t1 VALUES (NULL);
-FLUSH TABLE;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (c1)
-PARTITIONS 2 */
-SELECT * FROM t1 ORDER BY c1;
-c1
-4
-5
-DROP TABLE t1;
-#############################################################################
-# Bug #45823 - Assertion failure in file row/row0mysql.c line 1386
-# Bug #43988 - AUTO_INCREMENT errors with partitioned InnoDB tables in 5.1.31
-##############################################################################
-# Inserting negative autoincrement values into a partition table (partitions >= 4)
-CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
-c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
-INSERT INTO t(c2) VALUES (10);
-INSERT INTO t(c2) VALUES (20);
-INSERT INTO t VALUES (-1,-10);
-INSERT INTO t(c2) VALUES (30);
-INSERT INTO t(c2) VALUES (40);
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
--1 -10
-1 10
-2 20
-3 30
-4 40
-DROP TABLE t;
-# Reading from a partition table (partitions >= 2 ) after inserting a negative
-# value into the auto increment column
-CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
-c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 2;
-INSERT INTO t VALUES (-2,-20);
-INSERT INTO t(c2) VALUES (30);
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
--2 -20
-1 30
-DROP TABLE t;
-# Inserting negative auto increment value into a partition table (partitions >= 2)
-# auto increment value > 2.
-CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
-c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 2;
-INSERT INTO t VALUES (-4,-20);
-INSERT INTO t(c2) VALUES (30);
-INSERT INTO t(c2) VALUES (40);
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
--4 -20
-1 30
-2 40
-DROP TABLE t;
-# Inserting -1 into autoincrement column of a partition table (partition >= 4)
-CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
-c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
-INSERT INTO t(c2) VALUES (10);
-INSERT INTO t(c2) VALUES (20);
-INSERT INTO t VALUES (-1,-10);
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
--1 -10
-1 10
-2 20
-INSERT INTO t(c2) VALUES (30);
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
--1 -10
-1 10
-2 20
-3 30
-DROP TABLE t;
-# Deleting from an auto increment table after inserting negative values
-CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
-c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
-INSERT INTO t(c2) VALUES (10);
-INSERT INTO t(c2) VALUES (20);
-INSERT INTO t VALUES (-1,-10);
-INSERT INTO t(c2) VALUES (30);
-INSERT INTO t VALUES (-3,-20);
-INSERT INTO t(c2) VALUES (40);
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
--3 -20
--1 -10
-1 10
-2 20
-3 30
-4 40
-DELETE FROM t WHERE c1 > 1;
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
--3 -20
--1 -10
-1 10
-DROP TABLE t;
-# Inserting a positive value that exceeds maximum allowed value for an
-# Auto Increment column (positive maximum)
-CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
-c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
-INSERT INTO t(c2) VALUES (10);
-INSERT INTO t(c2) VALUES (20);
-INSERT INTO t VALUES (126,30);
-INSERT INTO t VALUES (127,40);
-INSERT INTO t VALUES (128,50);
-ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
-INSERT INTO t VALUES (129,60);
-ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
-1 10
-2 20
-126 30
-127 40
-DROP TABLE t;
-# Inserting a negative value that goes below minimum allowed value for an
-# Auto Increment column (negative minimum)
-CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
-c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
-INSERT INTO t(c2) VALUES (10);
-INSERT INTO t(c2) VALUES (20);
-INSERT INTO t VALUES (-127,30);
-INSERT INTO t VALUES (-128,40);
-INSERT INTO t VALUES (-129,50);
-ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
-INSERT INTO t VALUES (-130,60);
-ERROR 23000: Duplicate entry '-128' for key 'PRIMARY'
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
--128 40
--127 30
-1 10
-2 20
-DROP TABLE t;
-# Updating the partition table with a negative Auto Increment value
-CREATE TABLE t (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
-c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
-INSERT INTO t(c2) VALUES (10);
-INSERT INTO t(c2) VALUES (20);
-INSERT INTO t VALUES (-1,-10);
-INSERT INTO t(c2) VALUES (30);
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
--1 -10
-1 10
-2 20
-3 30
-UPDATE t SET c1 = -6 WHERE c1 = 2;
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
--6 20
--1 -10
-1 10
-3 30
-INSERT INTO t(c2) VALUES (40);
-INSERT INTO t(c2) VALUES (50);
-UPDATE t SET c1 = -6 WHERE c1 = 2;
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
--6 20
--1 -10
-1 10
-3 30
-4 40
-5 50
-DROP TABLE t;
-# Updating the partition table with a value that crosses the upper limits
-# on both the positive and the negative side.
-CREATE TABLE t (c1 TINYINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(c1),
-c2 INT) ENGINE='NDB' PARTITION BY HASH(c1) PARTITIONS 4;
-INSERT INTO t(c2) VALUES (10);
-INSERT INTO t(c2) VALUES (20);
-INSERT INTO t VALUES (126,30);
-INSERT INTO t VALUES (127,40);
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
-1 10
-2 20
-126 30
-127 40
-UPDATE t SET c1 = 130 where c1 = 127;
-Warnings:
-Warning 1264 Out of range value for column 'c1' at row 1
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
-1 10
-2 20
-126 30
-127 40
-UPDATE t SET c1 = -140 where c1 = 126;
-Warnings:
-Warning 1264 Out of range value for column 'c1' at row 1
-SELECT * FROM t ORDER BY c1 ASC;
-c1 c2
--128 30
-1 10
-2 20
-127 40
-DROP TABLE t;
-##############################################################################
diff --git a/mysql-test/suite/parts/r/partition_basic_innodb.result b/mysql-test/suite/parts/r/partition_basic_innodb.result
index c6a89e970b3..21c5d70e6e3 100644
--- a/mysql-test/suite/parts/r/partition_basic_innodb.result
+++ b/mysql-test/suite/parts/r/partition_basic_innodb.result
@@ -77,8 +77,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
t1.frm
t1.par
@@ -534,11 +532,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 5 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
-t1#P#p2.ibd
-t1#P#p3.ibd
-t1#P#p4.ibd
t1.frm
t1.par
@@ -1009,14 +1002,6 @@ t1 CREATE TABLE `t1` (
PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
-t1#P#part0.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part3.ibd
-t1#P#part_1.ibd
-t1#P#part_2.ibd
-t1#P#part_3.ibd
-t1#P#part_N.ibd
t1.frm
t1.par
@@ -1483,12 +1468,6 @@ t1 CREATE TABLE `t1` (
PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta.ibd
-t1#P#partb.ibd
-t1#P#partc.ibd
-t1#P#partd.ibd
-t1#P#parte.ibd
-t1#P#partf.ibd
t1.frm
t1.par
@@ -1951,14 +1930,6 @@ SUBPARTITIONS 2
PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta#SP#partasp0.ibd
-t1#P#parta#SP#partasp1.ibd
-t1#P#partb#SP#partbsp0.ibd
-t1#P#partb#SP#partbsp1.ibd
-t1#P#partc#SP#partcsp0.ibd
-t1#P#partc#SP#partcsp1.ibd
-t1#P#partd#SP#partdsp0.ibd
-t1#P#partd#SP#partdsp1.ibd
t1.frm
t1.par
@@ -2434,14 +2405,6 @@ SUBPARTITION BY KEY (f_int1)
SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#subpart11.ibd
-t1#P#part1#SP#subpart12.ibd
-t1#P#part2#SP#subpart21.ibd
-t1#P#part2#SP#subpart22.ibd
-t1#P#part3#SP#subpart31.ibd
-t1#P#part3#SP#subpart32.ibd
-t1#P#part4#SP#subpart41.ibd
-t1#P#part4#SP#subpart42.ibd
t1.frm
t1.par
@@ -2919,14 +2882,6 @@ SUBPARTITION BY HASH (f_int1 + 1)
SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#sp11.ibd
-t1#P#part1#SP#sp12.ibd
-t1#P#part2#SP#sp21.ibd
-t1#P#part2#SP#sp22.ibd
-t1#P#part3#SP#sp31.ibd
-t1#P#part3#SP#sp32.ibd
-t1#P#part4#SP#sp41.ibd
-t1#P#part4#SP#sp42.ibd
t1.frm
t1.par
@@ -3390,15 +3345,6 @@ SUBPARTITIONS 3
PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
-t1#P#part1#SP#part1sp0.ibd
-t1#P#part1#SP#part1sp1.ibd
-t1#P#part1#SP#part1sp2.ibd
-t1#P#part2#SP#part2sp0.ibd
-t1#P#part2#SP#part2sp1.ibd
-t1#P#part2#SP#part2sp2.ibd
-t1#P#part3#SP#part3sp0.ibd
-t1#P#part3#SP#part3sp1.ibd
-t1#P#part3#SP#part3sp2.ibd
t1.frm
t1.par
@@ -3856,8 +3802,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
t1.frm
t1.par
@@ -4313,11 +4257,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 5 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
-t1#P#p2.ibd
-t1#P#p3.ibd
-t1#P#p4.ibd
t1.frm
t1.par
@@ -4788,14 +4727,6 @@ t1 CREATE TABLE `t1` (
PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
-t1#P#part0.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part3.ibd
-t1#P#part_1.ibd
-t1#P#part_2.ibd
-t1#P#part_3.ibd
-t1#P#part_N.ibd
t1.frm
t1.par
@@ -5262,12 +5193,6 @@ t1 CREATE TABLE `t1` (
PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta.ibd
-t1#P#partb.ibd
-t1#P#partc.ibd
-t1#P#partd.ibd
-t1#P#parte.ibd
-t1#P#partf.ibd
t1.frm
t1.par
@@ -5730,14 +5655,6 @@ SUBPARTITIONS 2
PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta#SP#partasp0.ibd
-t1#P#parta#SP#partasp1.ibd
-t1#P#partb#SP#partbsp0.ibd
-t1#P#partb#SP#partbsp1.ibd
-t1#P#partc#SP#partcsp0.ibd
-t1#P#partc#SP#partcsp1.ibd
-t1#P#partd#SP#partdsp0.ibd
-t1#P#partd#SP#partdsp1.ibd
t1.frm
t1.par
@@ -6211,14 +6128,6 @@ SUBPARTITION BY KEY (f_int2)
SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#subpart11.ibd
-t1#P#part1#SP#subpart12.ibd
-t1#P#part2#SP#subpart21.ibd
-t1#P#part2#SP#subpart22.ibd
-t1#P#part3#SP#subpart31.ibd
-t1#P#part3#SP#subpart32.ibd
-t1#P#part4#SP#subpart41.ibd
-t1#P#part4#SP#subpart42.ibd
t1.frm
t1.par
@@ -6692,14 +6601,6 @@ SUBPARTITION BY HASH (f_int2 + 1)
SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#sp11.ibd
-t1#P#part1#SP#sp12.ibd
-t1#P#part2#SP#sp21.ibd
-t1#P#part2#SP#sp22.ibd
-t1#P#part3#SP#sp31.ibd
-t1#P#part3#SP#sp32.ibd
-t1#P#part4#SP#sp41.ibd
-t1#P#part4#SP#sp42.ibd
t1.frm
t1.par
@@ -7163,15 +7064,6 @@ SUBPARTITIONS 3
PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
-t1#P#part1#SP#part1sp0.ibd
-t1#P#part1#SP#part1sp1.ibd
-t1#P#part1#SP#part1sp2.ibd
-t1#P#part2#SP#part2sp0.ibd
-t1#P#part2#SP#part2sp1.ibd
-t1#P#part2#SP#part2sp2.ibd
-t1#P#part3#SP#part3sp0.ibd
-t1#P#part3#SP#part3sp1.ibd
-t1#P#part3#SP#part3sp2.ibd
t1.frm
t1.par
@@ -7635,8 +7527,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
t1.frm
t1.par
@@ -8129,11 +8019,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 5 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
-t1#P#p2.ibd
-t1#P#p3.ibd
-t1#P#p4.ibd
t1.frm
t1.par
@@ -8641,14 +8526,6 @@ t1 CREATE TABLE `t1` (
PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
-t1#P#part0.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part3.ibd
-t1#P#part_1.ibd
-t1#P#part_2.ibd
-t1#P#part_3.ibd
-t1#P#part_N.ibd
t1.frm
t1.par
@@ -9152,12 +9029,6 @@ t1 CREATE TABLE `t1` (
PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta.ibd
-t1#P#partb.ibd
-t1#P#partc.ibd
-t1#P#partd.ibd
-t1#P#parte.ibd
-t1#P#partf.ibd
t1.frm
t1.par
@@ -9657,14 +9528,6 @@ SUBPARTITIONS 2
PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta#SP#partasp0.ibd
-t1#P#parta#SP#partasp1.ibd
-t1#P#partb#SP#partbsp0.ibd
-t1#P#partb#SP#partbsp1.ibd
-t1#P#partc#SP#partcsp0.ibd
-t1#P#partc#SP#partcsp1.ibd
-t1#P#partd#SP#partdsp0.ibd
-t1#P#partd#SP#partdsp1.ibd
t1.frm
t1.par
@@ -10177,14 +10040,6 @@ SUBPARTITION BY KEY (f_int1)
SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#subpart11.ibd
-t1#P#part1#SP#subpart12.ibd
-t1#P#part2#SP#subpart21.ibd
-t1#P#part2#SP#subpart22.ibd
-t1#P#part3#SP#subpart31.ibd
-t1#P#part3#SP#subpart32.ibd
-t1#P#part4#SP#subpart41.ibd
-t1#P#part4#SP#subpart42.ibd
t1.frm
t1.par
@@ -10699,14 +10554,6 @@ SUBPARTITION BY HASH (f_int1 + 1)
SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#sp11.ibd
-t1#P#part1#SP#sp12.ibd
-t1#P#part2#SP#sp21.ibd
-t1#P#part2#SP#sp22.ibd
-t1#P#part3#SP#sp31.ibd
-t1#P#part3#SP#sp32.ibd
-t1#P#part4#SP#sp41.ibd
-t1#P#part4#SP#sp42.ibd
t1.frm
t1.par
@@ -11207,15 +11054,6 @@ SUBPARTITIONS 3
PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
-t1#P#part1#SP#part1sp0.ibd
-t1#P#part1#SP#part1sp1.ibd
-t1#P#part1#SP#part1sp2.ibd
-t1#P#part2#SP#part2sp0.ibd
-t1#P#part2#SP#part2sp1.ibd
-t1#P#part2#SP#part2sp2.ibd
-t1#P#part3#SP#part3sp0.ibd
-t1#P#part3#SP#part3sp1.ibd
-t1#P#part3#SP#part3sp2.ibd
t1.frm
t1.par
@@ -11709,8 +11547,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
t1.frm
t1.par
@@ -12203,11 +12039,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 5 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
-t1#P#p2.ibd
-t1#P#p3.ibd
-t1#P#p4.ibd
t1.frm
t1.par
@@ -12715,14 +12546,6 @@ t1 CREATE TABLE `t1` (
PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
-t1#P#part0.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part3.ibd
-t1#P#part_1.ibd
-t1#P#part_2.ibd
-t1#P#part_3.ibd
-t1#P#part_N.ibd
t1.frm
t1.par
@@ -13226,12 +13049,6 @@ t1 CREATE TABLE `t1` (
PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta.ibd
-t1#P#partb.ibd
-t1#P#partc.ibd
-t1#P#partd.ibd
-t1#P#parte.ibd
-t1#P#partf.ibd
t1.frm
t1.par
@@ -13731,14 +13548,6 @@ SUBPARTITIONS 2
PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta#SP#partasp0.ibd
-t1#P#parta#SP#partasp1.ibd
-t1#P#partb#SP#partbsp0.ibd
-t1#P#partb#SP#partbsp1.ibd
-t1#P#partc#SP#partcsp0.ibd
-t1#P#partc#SP#partcsp1.ibd
-t1#P#partd#SP#partdsp0.ibd
-t1#P#partd#SP#partdsp1.ibd
t1.frm
t1.par
@@ -14251,14 +14060,6 @@ SUBPARTITION BY KEY (f_int1)
SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#subpart11.ibd
-t1#P#part1#SP#subpart12.ibd
-t1#P#part2#SP#subpart21.ibd
-t1#P#part2#SP#subpart22.ibd
-t1#P#part3#SP#subpart31.ibd
-t1#P#part3#SP#subpart32.ibd
-t1#P#part4#SP#subpart41.ibd
-t1#P#part4#SP#subpart42.ibd
t1.frm
t1.par
@@ -14773,14 +14574,6 @@ SUBPARTITION BY HASH (f_int1 + 1)
SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#sp11.ibd
-t1#P#part1#SP#sp12.ibd
-t1#P#part2#SP#sp21.ibd
-t1#P#part2#SP#sp22.ibd
-t1#P#part3#SP#sp31.ibd
-t1#P#part3#SP#sp32.ibd
-t1#P#part4#SP#sp41.ibd
-t1#P#part4#SP#sp42.ibd
t1.frm
t1.par
@@ -15281,15 +15074,6 @@ SUBPARTITIONS 3
PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
-t1#P#part1#SP#part1sp0.ibd
-t1#P#part1#SP#part1sp1.ibd
-t1#P#part1#SP#part1sp2.ibd
-t1#P#part2#SP#part2sp0.ibd
-t1#P#part2#SP#part2sp1.ibd
-t1#P#part2#SP#part2sp2.ibd
-t1#P#part3#SP#part3sp0.ibd
-t1#P#part3#SP#part3sp1.ibd
-t1#P#part3#SP#part3sp2.ibd
t1.frm
t1.par
@@ -15783,8 +15567,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
t1.frm
t1.par
@@ -16293,11 +16075,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 5 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
-t1#P#p2.ibd
-t1#P#p3.ibd
-t1#P#p4.ibd
t1.frm
t1.par
@@ -16821,14 +16598,6 @@ t1 CREATE TABLE `t1` (
PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
-t1#P#part0.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part3.ibd
-t1#P#part_1.ibd
-t1#P#part_2.ibd
-t1#P#part_3.ibd
-t1#P#part_N.ibd
t1.frm
t1.par
@@ -17348,12 +17117,6 @@ t1 CREATE TABLE `t1` (
PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta.ibd
-t1#P#partb.ibd
-t1#P#partc.ibd
-t1#P#partd.ibd
-t1#P#parte.ibd
-t1#P#partf.ibd
t1.frm
t1.par
@@ -17869,14 +17632,6 @@ SUBPARTITIONS 2
PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta#SP#partasp0.ibd
-t1#P#parta#SP#partasp1.ibd
-t1#P#partb#SP#partbsp0.ibd
-t1#P#partb#SP#partbsp1.ibd
-t1#P#partc#SP#partcsp0.ibd
-t1#P#partc#SP#partcsp1.ibd
-t1#P#partd#SP#partdsp0.ibd
-t1#P#partd#SP#partdsp1.ibd
t1.frm
t1.par
@@ -18405,14 +18160,6 @@ SUBPARTITION BY KEY (f_int1)
SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#subpart11.ibd
-t1#P#part1#SP#subpart12.ibd
-t1#P#part2#SP#subpart21.ibd
-t1#P#part2#SP#subpart22.ibd
-t1#P#part3#SP#subpart31.ibd
-t1#P#part3#SP#subpart32.ibd
-t1#P#part4#SP#subpart41.ibd
-t1#P#part4#SP#subpart42.ibd
t1.frm
t1.par
@@ -18943,14 +18690,6 @@ SUBPARTITION BY HASH (f_int1 + 1)
SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#sp11.ibd
-t1#P#part1#SP#sp12.ibd
-t1#P#part2#SP#sp21.ibd
-t1#P#part2#SP#sp22.ibd
-t1#P#part3#SP#sp31.ibd
-t1#P#part3#SP#sp32.ibd
-t1#P#part4#SP#sp41.ibd
-t1#P#part4#SP#sp42.ibd
t1.frm
t1.par
@@ -19467,15 +19206,6 @@ SUBPARTITIONS 3
PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
-t1#P#part1#SP#part1sp0.ibd
-t1#P#part1#SP#part1sp1.ibd
-t1#P#part1#SP#part1sp2.ibd
-t1#P#part2#SP#part2sp0.ibd
-t1#P#part2#SP#part2sp1.ibd
-t1#P#part2#SP#part2sp2.ibd
-t1#P#part3#SP#part3sp0.ibd
-t1#P#part3#SP#part3sp1.ibd
-t1#P#part3#SP#part3sp2.ibd
t1.frm
t1.par
@@ -19990,8 +19720,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
t1.frm
t1.par
@@ -20484,11 +20212,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 5 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
-t1#P#p2.ibd
-t1#P#p3.ibd
-t1#P#p4.ibd
t1.frm
t1.par
@@ -20996,14 +20719,6 @@ t1 CREATE TABLE `t1` (
PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
-t1#P#part0.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part3.ibd
-t1#P#part_1.ibd
-t1#P#part_2.ibd
-t1#P#part_3.ibd
-t1#P#part_N.ibd
t1.frm
t1.par
@@ -21507,12 +21222,6 @@ t1 CREATE TABLE `t1` (
PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta.ibd
-t1#P#partb.ibd
-t1#P#partc.ibd
-t1#P#partd.ibd
-t1#P#parte.ibd
-t1#P#partf.ibd
t1.frm
t1.par
@@ -22012,14 +21721,6 @@ SUBPARTITIONS 2
PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta#SP#partasp0.ibd
-t1#P#parta#SP#partasp1.ibd
-t1#P#partb#SP#partbsp0.ibd
-t1#P#partb#SP#partbsp1.ibd
-t1#P#partc#SP#partcsp0.ibd
-t1#P#partc#SP#partcsp1.ibd
-t1#P#partd#SP#partdsp0.ibd
-t1#P#partd#SP#partdsp1.ibd
t1.frm
t1.par
@@ -22530,14 +22231,6 @@ SUBPARTITION BY KEY (f_int2)
SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#subpart11.ibd
-t1#P#part1#SP#subpart12.ibd
-t1#P#part2#SP#subpart21.ibd
-t1#P#part2#SP#subpart22.ibd
-t1#P#part3#SP#subpart31.ibd
-t1#P#part3#SP#subpart32.ibd
-t1#P#part4#SP#subpart41.ibd
-t1#P#part4#SP#subpart42.ibd
t1.frm
t1.par
@@ -23048,14 +22741,6 @@ SUBPARTITION BY HASH (f_int2 + 1)
SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#sp11.ibd
-t1#P#part1#SP#sp12.ibd
-t1#P#part2#SP#sp21.ibd
-t1#P#part2#SP#sp22.ibd
-t1#P#part3#SP#sp31.ibd
-t1#P#part3#SP#sp32.ibd
-t1#P#part4#SP#sp41.ibd
-t1#P#part4#SP#sp42.ibd
t1.frm
t1.par
@@ -23556,15 +23241,6 @@ SUBPARTITIONS 3
PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
-t1#P#part1#SP#part1sp0.ibd
-t1#P#part1#SP#part1sp1.ibd
-t1#P#part1#SP#part1sp2.ibd
-t1#P#part2#SP#part2sp0.ibd
-t1#P#part2#SP#part2sp1.ibd
-t1#P#part2#SP#part2sp2.ibd
-t1#P#part3#SP#part3sp0.ibd
-t1#P#part3#SP#part3sp1.ibd
-t1#P#part3#SP#part3sp2.ibd
t1.frm
t1.par
@@ -24058,8 +23734,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
t1.frm
t1.par
@@ -24552,11 +24226,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 5 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
-t1#P#p2.ibd
-t1#P#p3.ibd
-t1#P#p4.ibd
t1.frm
t1.par
@@ -25064,14 +24733,6 @@ t1 CREATE TABLE `t1` (
PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
-t1#P#part0.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part3.ibd
-t1#P#part_1.ibd
-t1#P#part_2.ibd
-t1#P#part_3.ibd
-t1#P#part_N.ibd
t1.frm
t1.par
@@ -25575,12 +25236,6 @@ t1 CREATE TABLE `t1` (
PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta.ibd
-t1#P#partb.ibd
-t1#P#partc.ibd
-t1#P#partd.ibd
-t1#P#parte.ibd
-t1#P#partf.ibd
t1.frm
t1.par
@@ -26080,14 +25735,6 @@ SUBPARTITIONS 2
PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta#SP#partasp0.ibd
-t1#P#parta#SP#partasp1.ibd
-t1#P#partb#SP#partbsp0.ibd
-t1#P#partb#SP#partbsp1.ibd
-t1#P#partc#SP#partcsp0.ibd
-t1#P#partc#SP#partcsp1.ibd
-t1#P#partd#SP#partdsp0.ibd
-t1#P#partd#SP#partdsp1.ibd
t1.frm
t1.par
@@ -26598,14 +26245,6 @@ SUBPARTITION BY KEY (f_int2)
SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#subpart11.ibd
-t1#P#part1#SP#subpart12.ibd
-t1#P#part2#SP#subpart21.ibd
-t1#P#part2#SP#subpart22.ibd
-t1#P#part3#SP#subpart31.ibd
-t1#P#part3#SP#subpart32.ibd
-t1#P#part4#SP#subpart41.ibd
-t1#P#part4#SP#subpart42.ibd
t1.frm
t1.par
@@ -27116,14 +26755,6 @@ SUBPARTITION BY HASH (f_int2 + 1)
SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#sp11.ibd
-t1#P#part1#SP#sp12.ibd
-t1#P#part2#SP#sp21.ibd
-t1#P#part2#SP#sp22.ibd
-t1#P#part3#SP#sp31.ibd
-t1#P#part3#SP#sp32.ibd
-t1#P#part4#SP#sp41.ibd
-t1#P#part4#SP#sp42.ibd
t1.frm
t1.par
@@ -27624,15 +27255,6 @@ SUBPARTITIONS 3
PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
-t1#P#part1#SP#part1sp0.ibd
-t1#P#part1#SP#part1sp1.ibd
-t1#P#part1#SP#part1sp2.ibd
-t1#P#part2#SP#part2sp0.ibd
-t1#P#part2#SP#part2sp1.ibd
-t1#P#part2#SP#part2sp2.ibd
-t1#P#part3#SP#part3sp0.ibd
-t1#P#part3#SP#part3sp1.ibd
-t1#P#part3#SP#part3sp2.ibd
t1.frm
t1.par
@@ -28126,8 +27748,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
t1.frm
t1.par
@@ -28636,11 +28256,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 5 */
unified filelist
-t1#P#p0.ibd
-t1#P#p1.ibd
-t1#P#p2.ibd
-t1#P#p3.ibd
-t1#P#p4.ibd
t1.frm
t1.par
@@ -29164,14 +28779,6 @@ t1 CREATE TABLE `t1` (
PARTITION part3 VALUES IN (3) ENGINE = InnoDB) */
unified filelist
-t1#P#part0.ibd
-t1#P#part1.ibd
-t1#P#part2.ibd
-t1#P#part3.ibd
-t1#P#part_1.ibd
-t1#P#part_2.ibd
-t1#P#part_3.ibd
-t1#P#part_N.ibd
t1.frm
t1.par
@@ -29691,12 +29298,6 @@ t1 CREATE TABLE `t1` (
PARTITION partf VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta.ibd
-t1#P#partb.ibd
-t1#P#partc.ibd
-t1#P#partd.ibd
-t1#P#parte.ibd
-t1#P#partf.ibd
t1.frm
t1.par
@@ -30212,14 +29813,6 @@ SUBPARTITIONS 2
PARTITION partd VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
unified filelist
-t1#P#parta#SP#partasp0.ibd
-t1#P#parta#SP#partasp1.ibd
-t1#P#partb#SP#partbsp0.ibd
-t1#P#partb#SP#partbsp1.ibd
-t1#P#partc#SP#partcsp0.ibd
-t1#P#partc#SP#partcsp1.ibd
-t1#P#partd#SP#partdsp0.ibd
-t1#P#partd#SP#partdsp1.ibd
t1.frm
t1.par
@@ -30746,14 +30339,6 @@ SUBPARTITION BY KEY (f_int2)
SUBPARTITION subpart42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#subpart11.ibd
-t1#P#part1#SP#subpart12.ibd
-t1#P#part2#SP#subpart21.ibd
-t1#P#part2#SP#subpart22.ibd
-t1#P#part3#SP#subpart31.ibd
-t1#P#part3#SP#subpart32.ibd
-t1#P#part4#SP#subpart41.ibd
-t1#P#part4#SP#subpart42.ibd
t1.frm
t1.par
@@ -31280,14 +30865,6 @@ SUBPARTITION BY HASH (f_int2 + 1)
SUBPARTITION sp42 ENGINE = InnoDB)) */
unified filelist
-t1#P#part1#SP#sp11.ibd
-t1#P#part1#SP#sp12.ibd
-t1#P#part2#SP#sp21.ibd
-t1#P#part2#SP#sp22.ibd
-t1#P#part3#SP#sp31.ibd
-t1#P#part3#SP#sp32.ibd
-t1#P#part4#SP#sp41.ibd
-t1#P#part4#SP#sp42.ibd
t1.frm
t1.par
@@ -31804,15 +31381,6 @@ SUBPARTITIONS 3
PARTITION part3 VALUES IN (NULL) ENGINE = InnoDB) */
unified filelist
-t1#P#part1#SP#part1sp0.ibd
-t1#P#part1#SP#part1sp1.ibd
-t1#P#part1#SP#part1sp2.ibd
-t1#P#part2#SP#part2sp0.ibd
-t1#P#part2#SP#part2sp1.ibd
-t1#P#part2#SP#part2sp2.ibd
-t1#P#part3#SP#part3sp0.ibd
-t1#P#part3#SP#part3sp1.ibd
-t1#P#part3#SP#part3sp2.ibd
t1.frm
t1.par
diff --git a/mysql-test/suite/parts/r/partition_debug_innodb.result b/mysql-test/suite/parts/r/partition_debug_innodb.result
index eb2218e204e..49d863bca8e 100644
--- a/mysql-test/suite/parts/r/partition_debug_innodb.result
+++ b/mysql-test/suite/parts/r/partition_debug_innodb.result
@@ -747,6 +747,67 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_1";
SET SESSION debug="+d,fail_add_partition_2";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -807,6 +868,67 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_2";
SET SESSION debug="+d,fail_add_partition_3";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -867,6 +989,67 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_3";
SET SESSION debug="+d,fail_add_partition_4";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -927,6 +1110,67 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_4";
SET SESSION debug="+d,fail_add_partition_5";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -987,6 +1231,67 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_5";
SET SESSION debug="+d,fail_add_partition_6";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -1047,6 +1352,67 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_6";
SET SESSION debug="+d,fail_add_partition_7";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -1107,6 +1473,67 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_7";
SET SESSION debug="+d,fail_add_partition_8";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -1169,6 +1596,69 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1#P#p20.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_8";
SET SESSION debug="+d,fail_add_partition_9";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -1231,6 +1721,69 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1#P#p20.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_9";
SET SESSION debug="+d,fail_add_partition_10";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -1293,6 +1846,69 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1#P#p20.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_10";
# Test DROP PARTITION
SET SESSION debug="+d,crash_drop_partition_1";
@@ -1902,6 +2518,66 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_1";
SET SESSION debug="+d,fail_drop_partition_2";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -1961,6 +2637,66 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_2";
SET SESSION debug="+d,fail_drop_partition_3";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2020,6 +2756,66 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_3";
SET SESSION debug="+d,fail_drop_partition_4";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2073,6 +2869,60 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_4";
SET SESSION debug="+d,fail_drop_partition_5";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2126,6 +2976,60 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_5";
SET SESSION debug="+d,fail_drop_partition_6";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2179,6 +3083,60 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_6";
SET SESSION debug="+d,fail_drop_partition_7";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2232,6 +3190,60 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_7";
SET SESSION debug="+d,fail_drop_partition_8";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2285,6 +3297,60 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_8";
SET SESSION debug="+d,fail_drop_partition_9";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2338,6 +3404,60 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_9";
# Test change partition (REORGANIZE/REBUILD/COALESCE
# or ADD HASH PARTITION).
@@ -2730,6 +3850,7 @@ t1.par
# State after crash recovery
t1#P#p0.ibd
t1#P#p10.ibd
+t1#P#p20.ibd
t1.frm
t1.par
SHOW CREATE TABLE t1;
@@ -2740,7 +3861,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
- PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */
SELECT * FROM t1;
a b
1 Original from partition p0
@@ -2861,8 +3983,6 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Lost connection to MySQL server during query
# State after crash (before recovery)
-#sql-t1.frm
-#sql-t1.par
t1#P#p0.ibd
t1#P#p10#TMP#.ibd
t1#P#p10.ibd
@@ -3237,6 +4357,68 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_1";
SET SESSION debug="+d,fail_change_partition_2";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3298,6 +4480,68 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_2";
SET SESSION debug="+d,fail_change_partition_3";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3359,6 +4603,68 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_3";
SET SESSION debug="+d,fail_change_partition_4";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3420,6 +4726,68 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_4";
SET SESSION debug="+d,fail_change_partition_5";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3481,6 +4849,68 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_5";
SET SESSION debug="+d,fail_change_partition_6";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3520,6 +4950,40 @@ ERROR HY000: Unknown error
# State after failure
t1#P#p0.ibd
t1#P#p10.ibd
+t1#P#p20.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
t1.frm
t1.par
SHOW CREATE TABLE t1;
@@ -3541,6 +5005,38 @@ a b
2 Original from partition p0
3 Original from partition p0
4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1#P#p20.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_6";
SET SESSION debug="+d,fail_change_partition_7";
@@ -3605,6 +5101,70 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1#P#p20.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_7";
SET SESSION debug="+d,fail_change_partition_8";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3668,6 +5228,70 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1#P#p20.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_8";
SET SESSION debug="+d,fail_change_partition_9";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3731,6 +5355,70 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1#P#p20.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_9";
SET SESSION debug="+d,fail_change_partition_10";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3794,6 +5482,70 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1#P#p20.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_10";
SET SESSION debug="+d,fail_change_partition_11";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3857,6 +5609,70 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1#P#p20.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_11";
SET SESSION debug="+d,fail_change_partition_12";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3920,4 +5736,68 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'InnoDB'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.ibd
+t1#P#p10.ibd
+t1#P#p20.ibd
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = InnoDB,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = InnoDB,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = InnoDB) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_12";
diff --git a/mysql-test/suite/parts/r/partition_debug_myisam.result b/mysql-test/suite/parts/r/partition_debug_myisam.result
index d3f40aedee5..ca3dd708972 100644
--- a/mysql-test/suite/parts/r/partition_debug_myisam.result
+++ b/mysql-test/suite/parts/r/partition_debug_myisam.result
@@ -817,6 +817,71 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_1";
SET SESSION debug="+d,fail_add_partition_2";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -881,6 +946,71 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_2";
SET SESSION debug="+d,fail_add_partition_3";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -945,6 +1075,71 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_3";
SET SESSION debug="+d,fail_add_partition_4";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -1009,6 +1204,71 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_4";
SET SESSION debug="+d,fail_add_partition_5";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -1073,6 +1333,71 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_5";
SET SESSION debug="+d,fail_add_partition_6";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -1137,6 +1462,71 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_6";
SET SESSION debug="+d,fail_add_partition_7";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -1201,6 +1591,71 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_7";
SET SESSION debug="+d,fail_add_partition_8";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -1268,6 +1723,74 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1#P#p20.MYD
+t1#P#p20.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_8";
SET SESSION debug="+d,fail_add_partition_9";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -1335,6 +1858,74 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1#P#p20.MYD
+t1#P#p20.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_9";
SET SESSION debug="+d,fail_add_partition_10";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -1402,6 +1993,74 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 ADD PARTITION
+(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1#P#p20.MYD
+t1#P#p20.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_add_partition_10";
# Test DROP PARTITION
SET SESSION debug="+d,crash_drop_partition_1";
@@ -2061,6 +2720,70 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_1";
SET SESSION debug="+d,fail_drop_partition_2";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2124,6 +2847,70 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_2";
SET SESSION debug="+d,fail_drop_partition_3";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2187,6 +2974,70 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_3";
SET SESSION debug="+d,fail_drop_partition_4";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2243,6 +3094,63 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_4";
SET SESSION debug="+d,fail_drop_partition_5";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2299,6 +3207,63 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_5";
SET SESSION debug="+d,fail_drop_partition_6";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2355,6 +3320,63 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_6";
SET SESSION debug="+d,fail_drop_partition_7";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2411,6 +3433,63 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_7";
SET SESSION debug="+d,fail_drop_partition_8";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2467,6 +3546,63 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_8";
SET SESSION debug="+d,fail_drop_partition_9";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -2523,6 +3659,63 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 DROP PARTITION p10;
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_drop_partition_9";
# Test change partition (REORGANIZE/REBUILD/COALESCE
# or ADD HASH PARTITION).
@@ -2957,6 +4150,8 @@ t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p10.MYD
t1#P#p10.MYI
+t1#P#p20.MYD
+t1#P#p20.MYI
t1.frm
t1.par
SHOW CREATE TABLE t1;
@@ -2967,7 +4162,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
- PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */
SELECT * FROM t1;
a b
1 Original from partition p0
@@ -3099,8 +4295,6 @@ ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
ERROR HY000: Lost connection to MySQL server during query
# State after crash (before recovery)
-#sql-t1.frm
-#sql-t1.par
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p10#TMP#.MYD
@@ -3520,6 +4714,72 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_1";
SET SESSION debug="+d,fail_change_partition_2";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3585,6 +4845,72 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_2";
SET SESSION debug="+d,fail_change_partition_3";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3650,6 +4976,72 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_3";
SET SESSION debug="+d,fail_change_partition_4";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3715,6 +5107,72 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_4";
SET SESSION debug="+d,fail_change_partition_5";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3780,6 +5238,72 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_5";
SET SESSION debug="+d,fail_change_partition_6";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3823,6 +5347,43 @@ t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p10.MYD
t1#P#p10.MYI
+t1#P#p20.MYD
+t1#P#p20.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
t1.frm
t1.par
SHOW CREATE TABLE t1;
@@ -3844,6 +5405,41 @@ a b
2 Original from partition p0
3 Original from partition p0
4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1#P#p20.MYD
+t1#P#p20.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_6";
SET SESSION debug="+d,fail_change_partition_7";
@@ -3913,6 +5509,75 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1#P#p20.MYD
+t1#P#p20.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_7";
SET SESSION debug="+d,fail_change_partition_8";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -3981,6 +5646,75 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1#P#p20.MYD
+t1#P#p20.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_8";
SET SESSION debug="+d,fail_change_partition_9";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -4049,6 +5783,75 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1#P#p20.MYD
+t1#P#p20.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_9";
SET SESSION debug="+d,fail_change_partition_10";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -4117,6 +5920,75 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1#P#p20.MYD
+t1#P#p20.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_10";
SET SESSION debug="+d,fail_change_partition_11";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -4185,6 +6057,75 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1#P#p20.MYD
+t1#P#p20.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_11";
SET SESSION debug="+d,fail_change_partition_12";
CREATE TABLE t1 (a INT, b VARCHAR(64))
@@ -4253,4 +6194,73 @@ a b
3 Original from partition p0
4 Original from partition p0
DROP TABLE t1;
+# Same test under LOCK TABLE
+CREATE TABLE t1 (a INT, b VARCHAR(64))
+ENGINE = 'MyISAM'
+PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
+PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
+INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
+# State before failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
+(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
+PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
+ERROR HY000: Unknown error
+# State after failure
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p10.MYD
+t1#P#p10.MYI
+t1#P#p20.MYD
+t1#P#p20.MYI
+t1.frm
+t1.par
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(64) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9) ENGINE = MyISAM,
+ PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19) ENGINE = MyISAM,
+ PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29) ENGINE = MyISAM) */
+SELECT * FROM t1;
+a b
+1 Original from partition p0
+11 Original from partition p1
+12 Original from partition p1
+13 Original from partition p1
+14 Original from partition p1
+2 Original from partition p0
+3 Original from partition p0
+4 Original from partition p0
+UNLOCK TABLES;
+DROP TABLE t1;
SET SESSION debug="-d,fail_change_partition_12";
diff --git a/mysql-test/suite/parts/r/partition_decimal_innodb.result b/mysql-test/suite/parts/r/partition_decimal_innodb.result
index 70debf3c595..c69c880cc6f 100644
--- a/mysql-test/suite/parts/r/partition_decimal_innodb.result
+++ b/mysql-test/suite/parts/r/partition_decimal_innodb.result
@@ -86,3 +86,111 @@ 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 (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),
+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 (floor(a))
+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 (ceiling(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),
+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 (ceiling(a))
+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 f9f7a1e4fe2..cdafb721ea4 100644
--- a/mysql-test/suite/parts/r/partition_decimal_myisam.result
+++ b/mysql-test/suite/parts/r/partition_decimal_myisam.result
@@ -86,3 +86,111 @@ 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 (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),
+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 (floor(a))
+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 (ceiling(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),
+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 (ceiling(a))
+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_engine_ndb.result b/mysql-test/suite/parts/r/partition_engine_ndb.result
deleted file mode 100644
index 6662032ef53..00000000000
--- a/mysql-test/suite/parts/r/partition_engine_ndb.result
+++ /dev/null
@@ -1,5203 +0,0 @@
-SET @max_row = 20;
-SET @@session.storage_engine = 'ndbcluster';
-
-#------------------------------------------------------------------------
-# 0. Setting of auxiliary variables + Creation of an auxiliary tables
-# needed in many testcases
-#------------------------------------------------------------------------
-SELECT @max_row DIV 2 INTO @max_row_div2;
-SELECT @max_row DIV 3 INTO @max_row_div3;
-SELECT @max_row DIV 4 INTO @max_row_div4;
-SET @max_int_4 = 2147483647;
-DROP TABLE IF EXISTS t0_template;
-CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) ,
-PRIMARY KEY(f_int1))
-ENGINE = MEMORY;
-# Logging of <max_row> INSERTs into t0_template suppressed
-DROP TABLE IF EXISTS t0_definition;
-CREATE TABLE t0_definition (
-state CHAR(3),
-create_command VARBINARY(5000),
-file_list VARBINARY(10000),
-PRIMARY KEY (state)
-) ENGINE = MEMORY;
-DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) )
-ENGINE = MEMORY;
-SET AUTOCOMMIT= 1;
-SET @@session.sql_mode= '';
-# End of basic preparations needed for all tests
-#-----------------------------------------------
-
-#========================================================================
-# Checks where the engine is assigned on all supported (CREATE TABLE
-# statement) positions + basic operations on the tables
-# Storage engine mixups are currently (2005-12-23) not supported
-#========================================================================
-DROP TABLE IF EXISTS t1;
-#------------------------------------------------------------------------
-# 1 Assignment of storage engine just after column list only
-#------------------------------------------------------------------------
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-) ENGINE = 'ndbcluster'
-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 (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (f_int1)
-PARTITIONS 2 */
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-#------------------------------------------------------------------------
-# 2 Assignment of storage engine just after partition or subpartition
-# name only
-#------------------------------------------------------------------------
-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)
-( PARTITION part1 STORAGE ENGINE = 'ndbcluster',
-PARTITION part2 STORAGE ENGINE = 'ndbcluster'
-);
-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 (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (f_int1)
-(PARTITION part1 ENGINE = ndbcluster,
- PARTITION part2 ENGINE = ndbcluster) */
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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 HASH(f_int1)
-( PARTITION part1 VALUES LESS THAN (10)
-(SUBPARTITION subpart11 STORAGE ENGINE = 'ndbcluster',
-SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster'),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21 STORAGE ENGINE = 'ndbcluster',
-SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster')
-);
-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 (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY RANGE (f_int1)
-SUBPARTITION BY HASH (f_int1)
-(PARTITION part1 VALUES LESS THAN (10)
- (SUBPARTITION subpart11 ENGINE = ndbcluster,
- SUBPARTITION subpart12 ENGINE = ndbcluster),
- PARTITION part2 VALUES LESS THAN (2147483646)
- (SUBPARTITION subpart21 ENGINE = ndbcluster,
- SUBPARTITION subpart22 ENGINE = ndbcluster)) */
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-ERROR HY000: Table has no partition for value 2147483647
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-#------------------------------------------------------------------------
-# 3 Some but not all named partitions or subpartitions get a storage
-# engine assigned
-#------------------------------------------------------------------------
-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)
-( PARTITION part1 STORAGE ENGINE = 'ndbcluster',
-PARTITION part2
-);
-ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
-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)
-( PARTITION part1 ,
-PARTITION part2 STORAGE ENGINE = 'ndbcluster'
-);
-ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
-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 HASH(f_int1)
-( PARTITION part1 VALUES LESS THAN (10)
-(SUBPARTITION subpart11,
-SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster'),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21 STORAGE ENGINE = 'ndbcluster',
-SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster')
-);
-ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
-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 HASH(f_int1)
-( PARTITION part1 VALUES LESS THAN (10)
-(SUBPARTITION subpart11 STORAGE ENGINE = 'ndbcluster',
-SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster'),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21,
-SUBPARTITION subpart22 )
-);
-ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-)
-ENGINE = 'ndbcluster'
-PARTITION BY RANGE(f_int1)
-SUBPARTITION BY HASH(f_int1)
-( PARTITION part1 VALUES LESS THAN (10)
-(SUBPARTITION subpart11 STORAGE ENGINE = 'ndbcluster',
-SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster'),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21,
-SUBPARTITION subpart22 )
-);
-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 (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY RANGE (f_int1)
-SUBPARTITION BY HASH (f_int1)
-(PARTITION part1 VALUES LESS THAN (10)
- (SUBPARTITION subpart11 ENGINE = ndbcluster,
- SUBPARTITION subpart12 ENGINE = ndbcluster),
- PARTITION part2 VALUES LESS THAN (2147483646)
- (SUBPARTITION subpart21 ENGINE = ndbcluster,
- SUBPARTITION subpart22 ENGINE = ndbcluster)) */
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-ERROR HY000: Table has no partition for value 2147483647
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-#------------------------------------------------------------------------
-# 4 Storage engine assignment after partition name + after name of
-# subpartitions belonging to another partition
-#------------------------------------------------------------------------
-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 HASH(f_int1)
-( PARTITION part1 VALUES LESS THAN (10)
-(SUBPARTITION subpart11,
-SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21 STORAGE ENGINE = 'ndbcluster',
-SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster')
-);
-ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-)
-ENGINE = 'ndbcluster'
-PARTITION BY RANGE(f_int1)
-SUBPARTITION BY HASH(f_int1)
-( PARTITION part1 VALUES LESS THAN (10) ENGINE = 'ndbcluster'
-(SUBPARTITION subpart11,
-SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21,
-SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster')
-);
-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 HASH(f_int1)
-( PARTITION part1 VALUES LESS THAN (10) ENGINE = 'ndbcluster'
-(SUBPARTITION subpart11,
-SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21 STORAGE ENGINE = 'ndbcluster',
-SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster')
-);
-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 (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY RANGE (f_int1)
-SUBPARTITION BY HASH (f_int1)
-(PARTITION part1 VALUES LESS THAN (10)
- (SUBPARTITION subpart11 ENGINE = ndbcluster,
- SUBPARTITION subpart12 ENGINE = ndbcluster),
- PARTITION part2 VALUES LESS THAN (2147483646)
- (SUBPARTITION subpart21 ENGINE = ndbcluster,
- SUBPARTITION subpart22 ENGINE = ndbcluster)) */
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-ERROR HY000: Table has no partition for value 2147483647
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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 HASH(f_int1)
-( PARTITION part1 VALUES LESS THAN (10)
-(SUBPARTITION subpart11 STORAGE ENGINE = 'ndbcluster',
-SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster'),
-PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = 'ndbcluster'
-(SUBPARTITION subpart21 ENGINE = 'ndbcluster',
-SUBPARTITION subpart22)
-);
-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 (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY RANGE (f_int1)
-SUBPARTITION BY HASH (f_int1)
-(PARTITION part1 VALUES LESS THAN (10)
- (SUBPARTITION subpart11 ENGINE = ndbcluster,
- SUBPARTITION subpart12 ENGINE = ndbcluster),
- PARTITION part2 VALUES LESS THAN (2147483646)
- (SUBPARTITION subpart21 ENGINE = ndbcluster,
- SUBPARTITION subpart22 ENGINE = ndbcluster)) */
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-ERROR HY000: Table has no partition for value 2147483647
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-#------------------------------------------------------------------------
-# 5 Precedence of storage engine assignments (if there is any)
-#------------------------------------------------------------------------
-# 5.1 Storage engine assignment after column list + after partition
-# or subpartition name
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-) ENGINE = 'ndbcluster'
-PARTITION BY HASH(f_int1)
-( PARTITION part1 STORAGE ENGINE = 'ndbcluster',
-PARTITION part2 STORAGE ENGINE = 'ndbcluster'
-);
-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 (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (f_int1)
-(PARTITION part1 ENGINE = ndbcluster,
- PARTITION part2 ENGINE = ndbcluster) */
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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 HASH(f_int1)
-( PARTITION part1 VALUES LESS THAN (10)
-(SUBPARTITION subpart11 STORAGE ENGINE = 'ndbcluster',
-SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster'),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21 STORAGE ENGINE = 'ndbcluster',
-SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster')
-);
-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 (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY RANGE (f_int1)
-SUBPARTITION BY HASH (f_int1)
-(PARTITION part1 VALUES LESS THAN (10)
- (SUBPARTITION subpart11 ENGINE = ndbcluster,
- SUBPARTITION subpart12 ENGINE = ndbcluster),
- PARTITION part2 VALUES LESS THAN (2147483646)
- (SUBPARTITION subpart21 ENGINE = ndbcluster,
- SUBPARTITION subpart22 ENGINE = ndbcluster)) */
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-ERROR HY000: Table has no partition for value 2147483647
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-# 6.2 Storage engine assignment after partition name + after
-# subpartition name
-# in partition part + in sub partition part
-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 HASH(f_int1)
-( PARTITION part1 VALUES LESS THAN (10) STORAGE ENGINE = 'ndbcluster'
-(SUBPARTITION subpart11 STORAGE ENGINE = 'ndbcluster',
-SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster'),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21 STORAGE ENGINE = 'ndbcluster',
-SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster')
-);
-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 (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY RANGE (f_int1)
-SUBPARTITION BY HASH (f_int1)
-(PARTITION part1 VALUES LESS THAN (10)
- (SUBPARTITION subpart11 ENGINE = ndbcluster,
- SUBPARTITION subpart12 ENGINE = ndbcluster),
- PARTITION part2 VALUES LESS THAN (2147483646)
- (SUBPARTITION subpart21 ENGINE = ndbcluster,
- SUBPARTITION subpart22 ENGINE = ndbcluster)) */
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-ERROR HY000: Table has no partition for value 2147483647
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-#------------------------------------------------------------------------
-# 6 Session default engine differs from engine used within create table
-#------------------------------------------------------------------------
-SET SESSION storage_engine='MEMORY';
-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) ( PARTITION part1 ENGINE = 'ndbcluster');
-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 (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY HASH (f_int1)
-(PARTITION part1 ENGINE = ndbcluster) */
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be not transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/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 HASH(f_int1)
-( PARTITION part1 VALUES LESS THAN (1000)
-(SUBPARTITION subpart11 STORAGE ENGINE = 'ndbcluster',
-SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster'));
-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 (inc/partition_check.inc)
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY RANGE (f_int1)
-SUBPARTITION BY HASH (f_int1)
-(PARTITION part1 VALUES LESS THAN (1000)
- (SUBPARTITION subpart11 ENGINE = ndbcluster,
- SUBPARTITION subpart12 ENGINE = ndbcluster)) */
-
-# check prerequisites-1 success: 1
-# check COUNT(*) success: 1
-# check MIN/MAX(f_int1) success: 1
-# check MIN/MAX(f_int2) success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'delete me' FROM t0_template
-WHERE f_int1 IN (2,3);
-# check prerequisites-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'delete me';
-# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE
-# check read via f_int1 success: 1
-# check read via f_int2 success: 1
-
-# check multiple-1 success: 1
-DELETE FROM t1 WHERE MOD(f_int1,3) = 0;
-
-# check multiple-2 success: 1
-INSERT INTO t1 SELECT * FROM t0_template
-WHERE MOD(f_int1,3) = 0;
-
-# check multiple-3 success: 1
-UPDATE t1 SET f_int1 = f_int1 + @max_row
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4
-AND @max_row_div2 + @max_row_div4;
-
-# check multiple-4 success: 1
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row
-AND @max_row_div2 + @max_row_div4 + @max_row;
-
-# check multiple-5 success: 1
-SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-1 success: 1
-SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1;
-INSERT INTO t1
-SET f_int1 = @cur_value , f_int2 = @cur_value,
-f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR),
-f_charbig = '#SINGLE#';
-
-# check single-2 success: 1
-SELECT MIN(f_int1) INTO @cur_value1 FROM t1;
-SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value2
-WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#';
-
-# check single-3 success: 1
-SET @cur_value1= -1;
-SELECT MAX(f_int1) INTO @cur_value2 FROM t1;
-UPDATE t1 SET f_int1 = @cur_value1
-WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#';
-
-# check single-4 success: 1
-SELECT MAX(f_int1) INTO @cur_value FROM t1;
-DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#';
-
-# check single-5 success: 1
-DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#';
-
-# check single-6 success: 1
-INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##';
-
-# check single-7 success: 1
-DELETE FROM t1 WHERE f_charbig = '#2147483647##';
-DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0;
-INSERT t1 SET f_int1 = 0 , f_int2 = 0,
-f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR),
-f_charbig = '#NULL#';
-INSERT INTO t1
-SET f_int1 = NULL , f_int2 = -@max_row,
-f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR),
-f_charbig = '#NULL#';
-# check null success: 1
-
-# check null-1 success: 1
-UPDATE t1 SET f_int1 = -@max_row
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-2 success: 1
-UPDATE t1 SET f_int1 = NULL
-WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-3 success: 1
-DELETE FROM t1
-WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR)
-AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#';
-
-# check null-4 success: 1
-DELETE FROM t1
-WHERE f_int1 = 0 AND f_int2 = 0
-AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR)
-AND f_charbig = '#NULL#';
-SET AUTOCOMMIT= 0;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-1 success: 1
-COMMIT WORK;
-
-# check transactions-2 success: 1
-ROLLBACK WORK;
-
-# check transactions-3 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-ROLLBACK WORK;
-
-# check transactions-4 success: 1
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, '', '', 'was inserted'
-FROM t0_template source_tab
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-
-# check transactions-5 success: 1
-ROLLBACK WORK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-
-# check transactions-6 success: 1
-# INFO: Storage engine used for t1 seems to be not transactional.
-COMMIT;
-
-# check transactions-7 success: 1
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-SET @@session.sql_mode = 'traditional';
-SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1,
-'', '', 'was inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4;
-ERROR 22012: Division by 0
-COMMIT;
-
-# check transactions-8 success: 1
-# INFO: Storage engine used for t1 seems to be unable to revert
-# changes made by the failing statement.
-SET @@session.sql_mode = '';
-SET AUTOCOMMIT= 1;
-DELETE FROM t1 WHERE f_charbig = 'was inserted';
-COMMIT WORK;
-UPDATE t1 SET f_charbig = REPEAT('b', 1000);
-
-# check special-1 success: 1
-UPDATE t1 SET f_charbig = '';
-
-# check special-2 success: 1
-UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'===');
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-1 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-
-# check trigger-2 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-3 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-4 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = new.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-5 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-6 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-7 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig)
-SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR),
-'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW
-BEGIN
-UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2,
-f_charbig = 'updated by trigger'
- WHERE f_int1 = - old.f_int1;
-END|
-DELETE FROM t0_aux
-WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1));
-
-# check trigger-8 success: 1
-DROP TRIGGER trg_1;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = 'just inserted'
- WHERE f_int1 <> CAST(f_char1 AS SIGNED INT);
-DELETE FROM t0_aux
-WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-DELETE FROM t1
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1;
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = old.f_int1 + @max_row,
-new.f_int2 = old.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-9 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = new.f_int1 + @max_row,
-new.f_int2 = new.f_int2 - @max_row,
-new.f_charbig = '####updated per update trigger####';
-END|
-UPDATE t1
-SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row,
-f_charbig = '####updated per update statement itself####';
-
-# check trigger-10 success: 1
-DROP TRIGGER trg_2;
-UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
-f_int2 = CAST(f_char1 AS SIGNED INT),
-f_charbig = CONCAT('===',f_char1,'===');
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig)
-SELECT f_int1, f_int1, CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-11 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
-SET new.f_int1 = @my_max1 + @counter,
-new.f_int2 = @my_min2 - @counter,
-new.f_charbig = '####updated per insert trigger####';
-SET @counter = @counter + 1;
-END|
-SET @counter = 1;
-SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1;
-INSERT INTO t1 (f_char1, f_char2, f_charbig)
-SELECT CAST(f_int1 AS CHAR),
-CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template
-WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1
-ORDER BY f_int1;
-DROP TRIGGER trg_3;
-
-# check trigger-12 success: 1
-DELETE FROM t1
-WHERE f_int1 <> CAST(f_char1 AS SIGNED INT)
-AND f_int2 <> CAST(f_char1 AS SIGNED INT)
-AND f_charbig = '####updated per insert trigger####';
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze note The storage engine for the table doesn't support analyze
-CHECK TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 check note The storage engine for the table doesn't support check
-CHECKSUM TABLE t1 EXTENDED;
-Table Checksum
-test.t1 <some_value>
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note The storage engine for the table doesn't support optimize
-# check layout success: 1
-REPAIR TABLE t1 EXTENDED;
-Table Op Msg_type Msg_text
-test.t1 repair note The storage engine for the table doesn't support repair
-# check layout success: 1
-TRUNCATE t1;
-
-# check TRUNCATE success: 1
-# check layout success: 1
-# End usability test (inc/partition_check.inc)
-DROP TABLE t1;
-SET SESSION storage_engine='ndbcluster';
-DROP VIEW IF EXISTS v1;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t0_aux;
-DROP TABLE IF EXISTS t0_definition;
-DROP TABLE IF EXISTS t0_template;
diff --git a/mysql-test/suite/parts/r/partition_int_ndb.result b/mysql-test/suite/parts/r/partition_int_ndb.result
deleted file mode 100644
index d3c2d80d6b4..00000000000
--- a/mysql-test/suite/parts/r/partition_int_ndb.result
+++ /dev/null
@@ -1,557 +0,0 @@
-create table t1 (a tinyint unsigned not null, primary key(a)) engine='NDB'
-partition by key (a) (
-partition pa1 max_rows=20 min_rows=2,
-partition pa2 max_rows=30 min_rows=3,
-partition pa3 max_rows=30 min_rows=4,
-partition pa4 max_rows=40 min_rows=2);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` tinyint(3) unsigned NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster,
- PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster,
- PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster,
- PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
-insert into t1 values (255), (254), (253), (252), (1), (2), (128);
-select * from t1;
-a
-1
-128
-2
-252
-253
-254
-255
-select * from t1 where a=253;
-a
-253
-delete from t1 where a=253;
-select * from t1;
-a
-1
-128
-2
-252
-254
-255
-drop table t1;
-create table t2 (a tinyint unsigned not null, primary key(a)) engine='NDB'
-partition by key (a) partitions 8;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` tinyint(3) unsigned NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-PARTITIONS 8 */
-insert into t2 values (255), (254), (253), (252);
-select * from t2;
-a
-252
-253
-254
-255
-select * from t2 where a=253;
-a
-253
-delete from t2 where a=253;
-select * from t2;
-a
-252
-254
-255
-delete from t2;
-255 inserts;
-select count(*) from t2;
-count(*)
-255
-drop table t2;
-create table t3 (a tinyint not null, primary key(a)) engine='NDB'
-partition by key (a) partitions 7;
-show create table t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `a` tinyint(4) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-PARTITIONS 7 */
-insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0);
-select * from t3;
-a
--1
--127
--128
-0
-1
-124
-125
-126
-127
-select * from t3 where a=125;
-a
-125
-delete from t3 where a=125;
-select * from t3;
-a
--1
--127
--128
-0
-1
-124
-126
-127
-drop table t3;
-create table t1 (a smallint unsigned not null, primary key(a)) engine='NDB'
-partition by key (a) (
-partition pa1 max_rows=20 min_rows=2,
-partition pa2 max_rows=30 min_rows=3,
-partition pa3 max_rows=30 min_rows=4,
-partition pa4 max_rows=40 min_rows=2);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` smallint(5) unsigned NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster,
- PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster,
- PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster,
- PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
-insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256);
-select * from t1;
-a
-1
-2
-256
-65532
-65533
-65534
-65535
-select * from t1 where a=65533;
-a
-65533
-delete from t1 where a=65533;
-select * from t1;
-a
-1
-2
-256
-65532
-65534
-65535
-drop table t1;
-create table t2 (a smallint unsigned not null, primary key(a)) engine='NDB'
-partition by key (a) partitions 8;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` smallint(5) unsigned NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-PARTITIONS 8 */
-insert into t2 values (65535), (65534), (65533), (65532);
-select * from t2;
-a
-65532
-65533
-65534
-65535
-select * from t2 where a=65533;
-a
-65533
-delete from t2 where a=65533;
-select * from t2;
-a
-65532
-65534
-65535
-delete from t2;
-1024 inserts;
-select count(*) from t2;
-count(*)
-1024
-drop table t2;
-create table t3 (a smallint not null, primary key(a)) engine='NDB'
-partition by key (a) partitions 7;
-show create table t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `a` smallint(6) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-PARTITIONS 7 */
-insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0);
-select * from t3;
-a
--1
--32767
--32768
-0
-1
-32764
-32765
-32766
-32767
-select * from t3 where a=32765;
-a
-32765
-delete from t3 where a=32765;
-select * from t3;
-a
--1
--32767
--32768
-0
-1
-32764
-32766
-32767
-drop table t3;
-create table t1 (a int unsigned not null, primary key(a)) engine='NDB'
-partition by key (a) (
-partition pa1 max_rows=20 min_rows=2,
-partition pa2 max_rows=30 min_rows=3,
-partition pa3 max_rows=30 min_rows=4,
-partition pa4 max_rows=40 min_rows=2);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(10) unsigned NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster,
- PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster,
- PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster,
- PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
-insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535);
-select * from t1;
-a
-1
-2
-4294967292
-4294967293
-4294967294
-4294967295
-65535
-select * from t1 where a=4294967293;
-a
-4294967293
-delete from t1 where a=4294967293;
-select * from t1;
-a
-1
-2
-4294967292
-4294967294
-4294967295
-65535
-drop table t1;
-create table t2 (a int unsigned not null, primary key(a)) engine='NDB'
-partition by key (a) partitions 8;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(10) unsigned NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-PARTITIONS 8 */
-insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292);
-select * from t2;
-a
-4294967292
-4294967293
-4294967294
-4294967295
-select * from t2 where a=4294967293;
-a
-4294967293
-delete from t2 where a=4294967293;
-select * from t2;
-a
-4294967292
-4294967294
-4294967295
-delete from t2;
-1024 inserts;
-select count(*) from t2;
-count(*)
-1024
-drop table t2;
-create table t3 (a int not null, primary key(a)) engine='NDB'
-partition by key (a) partitions 7;
-show create table t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `a` int(11) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-PARTITIONS 7 */
-insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0);
-select * from t3;
-a
--1
--2147483647
--2147483648
-0
-1
-2147483644
-2147483645
-2147483646
-2147483647
-select * from t3 where a=2147483645;
-a
-2147483645
-delete from t3 where a=2147483645;
-select * from t3;
-a
--1
--2147483647
--2147483648
-0
-1
-2147483644
-2147483646
-2147483647
-drop table t3;
-create table t1 (a mediumint unsigned not null, primary key(a)) engine='NDB'
-partition by key (a) (
-partition pa1 max_rows=20 min_rows=2,
-partition pa2 max_rows=30 min_rows=3,
-partition pa3 max_rows=30 min_rows=4,
-partition pa4 max_rows=40 min_rows=2);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` mediumint(8) unsigned NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster,
- PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster,
- PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster,
- PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
-insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535);
-select * from t1;
-a
-1
-16777212
-16777213
-16777214
-16777215
-2
-65535
-select * from t1 where a=16777213;
-a
-16777213
-delete from t1 where a=16777213;
-select * from t1;
-a
-1
-16777212
-16777214
-16777215
-2
-65535
-drop table t1;
-create table t2 (a mediumint unsigned not null, primary key(a)) engine='NDB'
-partition by key (a) partitions 8;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` mediumint(8) unsigned NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-PARTITIONS 8 */
-insert into t2 values (16777215), (16777214), (16777213), (16777212);
-select * from t2;
-a
-16777212
-16777213
-16777214
-16777215
-select * from t2 where a=16777213;
-a
-16777213
-delete from t2 where a=16777213;
-select * from t2;
-a
-16777212
-16777214
-16777215
-delete from t2;
-1024 inserts;
-select count(*) from t2;
-count(*)
-1024
-drop table t2;
-create table t3 (a mediumint not null, primary key(a)) engine='NDB'
-partition by key (a) partitions 7;
-show create table t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `a` mediumint(9) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-PARTITIONS 7 */
-insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0);
-select * from t3;
-a
--1
--8388607
--8388608
-0
-1
-8388604
-8388605
-8388606
-8388607
-select * from t3 where a=8388605;
-a
-8388605
-delete from t3 where a=8388605;
-select * from t3;
-a
--1
--8388607
--8388608
-0
-1
-8388604
-8388606
-8388607
-drop table t3;
-create table t1 (a bigint unsigned not null, primary key(a)) engine='NDB'
-partition by key (a) (
-partition pa1 max_rows=20 min_rows=2,
-partition pa2 max_rows=30 min_rows=3,
-partition pa3 max_rows=30 min_rows=4,
-partition pa4 max_rows=40 min_rows=2);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bigint(20) unsigned NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster,
- PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster,
- PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster,
- PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */
-insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535);
-select * from t1;
-a
-1
-18446744073709551612
-18446744073709551613
-18446744073709551614
-18446744073709551615
-2
-65535
-select * from t1 where a=-2;
-a
-delete from t1 where a=-2;
-select * from t1;
-a
-1
-18446744073709551612
-18446744073709551613
-18446744073709551614
-18446744073709551615
-2
-65535
-select * from t1 where a=18446744073709551615;
-a
-18446744073709551615
-delete from t1 where a=18446744073709551615;
-select * from t1;
-a
-1
-18446744073709551612
-18446744073709551613
-18446744073709551614
-2
-65535
-drop table t1;
-create table t2 (a bigint unsigned not null, primary key(a)) engine='NDB'
-partition by key (a) partitions 8;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` bigint(20) unsigned NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-PARTITIONS 8 */
-insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
-select * from t2;
-a
-18446744073709551612
-18446744073709551613
-18446744073709551614
-18446744073709551615
-select * from t2 where a=18446744073709551615;
-a
-18446744073709551615
-delete from t2 where a=18446744073709551615;
-select * from t2;
-a
-18446744073709551612
-18446744073709551613
-18446744073709551614
-delete from t2;
-1024 inserts;
-select count(*) from t2;
-count(*)
-1024
-drop table t2;
-create table t3 (a bigint not null, primary key(a)) engine='NDB'
-partition by key (a) partitions 7;
-show create table t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `a` bigint(20) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-PARTITIONS 7 */
-insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0);
-select * from t3;
-a
--1
--9223372036854775807
--9223372036854775808
-0
-1
-9223372036854775804
-9223372036854775805
-9223372036854775806
-9223372036854775807
-select * from t3 where a=9223372036854775806;
-a
-9223372036854775806
-delete from t3 where a=9223372036854775806;
-select * from t3;
-a
--1
--9223372036854775807
--9223372036854775808
-0
-1
-9223372036854775804
-9223372036854775805
-9223372036854775807
-drop table t3;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result b/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result
deleted file mode 100644
index 15b3f424527..00000000000
--- a/mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result
+++ /dev/null
@@ -1,198 +0,0 @@
-# Creating database MySQL_TEST_DB
-CREATE DATABASE MySQL_Test_DB;
-USE MySQL_Test_DB;
-# 1.0 KEY partitioning mgm
-# Creating KEY partitioned table
-CREATE TABLE TableA (a INT)
-ENGINE = 'NDBCluster'
-PARTITION BY KEY (a)
-(PARTITION parta ,
-PARTITION partB ,
-PARTITION Partc ,
-PARTITION PartD );
-INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10);
-INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12);
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-# Test of ADD/COALESCE PARTITIONS
-# expecting duplicate partition name
-ALTER TABLE TableA ADD PARTITION
-(PARTITION partA,
-PARTITION Parta,
-PARTITION PartA);
-ERROR HY000: Duplicate partition name parta
-ALTER TABLE TableA ADD PARTITION
-(PARTITION partE,
-PARTITION Partf,
-PARTITION PartG);
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE TableA;
-Table Create Table
-TableA CREATE TABLE `TableA` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION parta ENGINE = ndbcluster,
- PARTITION partB ENGINE = ndbcluster,
- PARTITION Partc ENGINE = ndbcluster,
- PARTITION PartD ENGINE = ndbcluster,
- PARTITION partE ENGINE = ndbcluster,
- PARTITION Partf ENGINE = ndbcluster,
- PARTITION PartG ENGINE = ndbcluster) */
-ALTER TABLE TableA COALESCE PARTITION 4;
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE TableA;
-Table Create Table
-TableA CREATE TABLE `TableA` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION parta ENGINE = ndbcluster,
- PARTITION partB ENGINE = ndbcluster,
- PARTITION Partc ENGINE = ndbcluster) */
-# Test of REORGANIZE PARTITIONS
-# Should not work on HASH/KEY
-ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
-(PARTITION PARTA ,
-PARTITION partc );
-ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
-ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
-(PARTITION partB ,
-PARTITION parta );
-ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
-ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
-(PARTITION partB COMMENT="Previusly named parta",
-PARTITION parta COMMENT="Previusly named partB");
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE TableA;
-Table Create Table
-TableA CREATE TABLE `TableA` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster,
- PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster,
- PARTITION Partc ENGINE = ndbcluster) */
-# Test of RENAME TABLE
-RENAME TABLE TableA to TableB;
-SELECT * FROM TableB;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-RENAME TABLE TableB to TableA;
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-# Checking name comparision Upper vs Lower case
-# Error if lower_case_table_names != 0
-# lower_case_table_names: 0
-# Test of REMOVE PARTITIONING
-ALTER TABLE TableA REMOVE PARTITIONING;
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE TableA;
-Table Create Table
-TableA CREATE TABLE `TableA` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-# Cleaning up after KEY PARTITIONING test
-DROP TABLE TableA;
-# Verify that TRUNCATE PARTITION gives error
-CREATE TABLE t1
-(a BIGINT AUTO_INCREMENT PRIMARY KEY,
-b VARCHAR(255))
-ENGINE = 'NDBCluster'
-PARTITION BY KEY (a)
-(PARTITION LT1000,
-PARTITION LT2000,
-PARTITION MAX);
-INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
-ALTER TABLE t1 TRUNCATE PARTITION MAX;
-Got one of the listed errors
-# Cleaning up before exit
-USE test;
-DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result b/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result
deleted file mode 100644
index 1d221caa163..00000000000
--- a/mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result
+++ /dev/null
@@ -1,236 +0,0 @@
-# Creating database MySQL_TEST_DB
-CREATE DATABASE MySQL_Test_DB;
-USE MySQL_Test_DB;
-# 1.0 KEY partitioning mgm
-# Creating KEY partitioned table
-CREATE TABLE TableA (a INT)
-ENGINE = 'NDBCluster'
-PARTITION BY KEY (a)
-(PARTITION parta ,
-PARTITION partB ,
-PARTITION Partc ,
-PARTITION PartD );
-INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10);
-INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12);
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-# Test of ADD/COALESCE PARTITIONS
-# expecting duplicate partition name
-ALTER TABLE TableA ADD PARTITION
-(PARTITION partA,
-PARTITION Parta,
-PARTITION PartA);
-ERROR HY000: Duplicate partition name parta
-ALTER TABLE TableA ADD PARTITION
-(PARTITION partE,
-PARTITION Partf,
-PARTITION PartG);
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE TableA;
-Table Create Table
-TableA CREATE TABLE `tablea` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION parta ENGINE = ndbcluster,
- PARTITION partB ENGINE = ndbcluster,
- PARTITION Partc ENGINE = ndbcluster,
- PARTITION PartD ENGINE = ndbcluster,
- PARTITION partE ENGINE = ndbcluster,
- PARTITION Partf ENGINE = ndbcluster,
- PARTITION PartG ENGINE = ndbcluster) */
-ALTER TABLE TableA COALESCE PARTITION 4;
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE TableA;
-Table Create Table
-TableA CREATE TABLE `tablea` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION parta ENGINE = ndbcluster,
- PARTITION partB ENGINE = ndbcluster,
- PARTITION Partc ENGINE = ndbcluster) */
-# Test of REORGANIZE PARTITIONS
-# Should not work on HASH/KEY
-ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
-(PARTITION PARTA ,
-PARTITION partc );
-ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
-ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
-(PARTITION partB ,
-PARTITION parta );
-ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
-ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
-(PARTITION partB COMMENT="Previusly named parta",
-PARTITION parta COMMENT="Previusly named partB");
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE TableA;
-Table Create Table
-TableA CREATE TABLE `tablea` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster,
- PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster,
- PARTITION Partc ENGINE = ndbcluster) */
-# Test of RENAME TABLE
-RENAME TABLE TableA to TableB;
-SELECT * FROM TableB;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-RENAME TABLE TableB to TableA;
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-# Checking name comparision Upper vs Lower case
-# Error if lower_case_table_names != 0
-# lower_case_table_names: 1
-CREATE TABLE tablea (a INT)
-ENGINE = 'NDBCluster'
-PARTITION BY KEY (a)
-(PARTITION parta ,
-PARTITION partB ,
-PARTITION Partc ,
-PARTITION PartD );
-ERROR 42S01: Table 'tablea' already exists
-SHOW TABLES;
-Tables_in_mysql_test_db
-tablea
-RENAME TABLE TableA to tablea;
-ERROR 42S01: Table 'tablea' already exists
-RENAME TABLE tablea to TableA;
-ERROR 42S01: Table 'tablea' already exists
-SELECT * FROM tablea;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE tablea;
-Table Create Table
-tablea CREATE TABLE `tablea` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster,
- PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster,
- PARTITION Partc ENGINE = ndbcluster) */
-# Test of REMOVE PARTITIONING
-ALTER TABLE TableA REMOVE PARTITIONING;
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE TableA;
-Table Create Table
-TableA CREATE TABLE `tablea` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-# Cleaning up after KEY PARTITIONING test
-DROP TABLE TableA;
-# Verify that TRUNCATE PARTITION gives error
-CREATE TABLE t1
-(a BIGINT AUTO_INCREMENT PRIMARY KEY,
-b VARCHAR(255))
-ENGINE = 'NDBCluster'
-PARTITION BY KEY (a)
-(PARTITION LT1000,
-PARTITION LT2000,
-PARTITION MAX);
-INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
-ALTER TABLE t1 TRUNCATE PARTITION MAX;
-Got one of the listed errors
-# Cleaning up before exit
-USE test;
-DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result b/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result
deleted file mode 100644
index 2f5dfe5e08e..00000000000
--- a/mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result
+++ /dev/null
@@ -1,236 +0,0 @@
-# Creating database MySQL_TEST_DB
-CREATE DATABASE MySQL_Test_DB;
-USE MySQL_Test_DB;
-# 1.0 KEY partitioning mgm
-# Creating KEY partitioned table
-CREATE TABLE TableA (a INT)
-ENGINE = 'NDBCluster'
-PARTITION BY KEY (a)
-(PARTITION parta ,
-PARTITION partB ,
-PARTITION Partc ,
-PARTITION PartD );
-INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10);
-INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12);
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-# Test of ADD/COALESCE PARTITIONS
-# expecting duplicate partition name
-ALTER TABLE TableA ADD PARTITION
-(PARTITION partA,
-PARTITION Parta,
-PARTITION PartA);
-ERROR HY000: Duplicate partition name parta
-ALTER TABLE TableA ADD PARTITION
-(PARTITION partE,
-PARTITION Partf,
-PARTITION PartG);
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE TableA;
-Table Create Table
-TableA CREATE TABLE `TableA` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION parta ENGINE = ndbcluster,
- PARTITION partB ENGINE = ndbcluster,
- PARTITION Partc ENGINE = ndbcluster,
- PARTITION PartD ENGINE = ndbcluster,
- PARTITION partE ENGINE = ndbcluster,
- PARTITION Partf ENGINE = ndbcluster,
- PARTITION PartG ENGINE = ndbcluster) */
-ALTER TABLE TableA COALESCE PARTITION 4;
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE TableA;
-Table Create Table
-TableA CREATE TABLE `TableA` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION parta ENGINE = ndbcluster,
- PARTITION partB ENGINE = ndbcluster,
- PARTITION Partc ENGINE = ndbcluster) */
-# Test of REORGANIZE PARTITIONS
-# Should not work on HASH/KEY
-ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
-(PARTITION PARTA ,
-PARTITION partc );
-ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
-ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
-(PARTITION partB ,
-PARTITION parta );
-ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
-ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
-(PARTITION partB COMMENT="Previusly named parta",
-PARTITION parta COMMENT="Previusly named partB");
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE TableA;
-Table Create Table
-TableA CREATE TABLE `TableA` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster,
- PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster,
- PARTITION Partc ENGINE = ndbcluster) */
-# Test of RENAME TABLE
-RENAME TABLE TableA to TableB;
-SELECT * FROM TableB;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-RENAME TABLE TableB to TableA;
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-# Checking name comparision Upper vs Lower case
-# Error if lower_case_table_names != 0
-# lower_case_table_names: 2
-CREATE TABLE tablea (a INT)
-ENGINE = 'NDBCluster'
-PARTITION BY KEY (a)
-(PARTITION parta ,
-PARTITION partB ,
-PARTITION Partc ,
-PARTITION PartD );
-ERROR 42S01: Table 'tablea' already exists
-SHOW TABLES;
-Tables_in_mysql_test_db
-TableA
-RENAME TABLE TableA to tablea;
-ERROR 42S01: Table 'tablea' already exists
-RENAME TABLE tablea to TableA;
-ERROR 42S01: Table 'TableA' already exists
-SELECT * FROM tablea;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE tablea;
-Table Create Table
-tablea CREATE TABLE `tablea` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-/*!50100 PARTITION BY KEY (a)
-(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster,
- PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster,
- PARTITION Partc ENGINE = ndbcluster) */
-# Test of REMOVE PARTITIONING
-ALTER TABLE TableA REMOVE PARTITIONING;
-SELECT * FROM TableA;
-a
-1
-10
-11
-12
-2
-3
-4
-5
-6
-7
-8
-9
-SHOW CREATE TABLE TableA;
-Table Create Table
-TableA CREATE TABLE `TableA` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-# Cleaning up after KEY PARTITIONING test
-DROP TABLE TableA;
-# Verify that TRUNCATE PARTITION gives error
-CREATE TABLE t1
-(a BIGINT AUTO_INCREMENT PRIMARY KEY,
-b VARCHAR(255))
-ENGINE = 'NDBCluster'
-PARTITION BY KEY (a)
-(PARTITION LT1000,
-PARTITION LT2000,
-PARTITION MAX);
-INSERT INTO t1 VALUES (NULL, "First"), (NULL, "Second"), (999, "Last in LT1000"), (NULL, "First in LT2000"), (NULL, "Second in LT2000"), (1999, "Last in LT2000"), (NULL, "First in MAX"), (NULL, "Second in MAX");
-ALTER TABLE t1 TRUNCATE PARTITION MAX;
-Got one of the listed errors
-# Cleaning up before exit
-USE test;
-DROP DATABASE MySQL_Test_DB;
diff --git a/mysql-test/suite/parts/r/partition_recover_myisam.result b/mysql-test/suite/parts/r/partition_recover_myisam.result
index df737ec2853..7de0cd31825 100644
--- a/mysql-test/suite/parts/r/partition_recover_myisam.result
+++ b/mysql-test/suite/parts/r/partition_recover_myisam.result
@@ -1,3 +1,5 @@
+call mtr.add_suppression("..test.t1_will_crash");
+call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc");
CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM;
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
FLUSH TABLES;
diff --git a/mysql-test/suite/parts/r/partition_special_innodb.result b/mysql-test/suite/parts/r/partition_special_innodb.result
index cf47b9de3f1..37bc3e49ab7 100644
--- a/mysql-test/suite/parts/r/partition_special_innodb.result
+++ b/mysql-test/suite/parts/r/partition_special_innodb.result
@@ -245,11 +245,10 @@ LOCK TABLE t1 READ;
# Third attempt: says that the table does not exist
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-# Check table returns the same
+# Check table returns the same (not after fixing bug#56172!)
CHECK TABLE t1;
Table Op Msg_type Msg_text
-test.t1 check Error Lock wait timeout exceeded; try restarting transaction
-test.t1 check error Corrupt
+test.t1 check status OK
UNLOCK TABLES;
DROP TABLE t1;
CREATE TABLE t2 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
diff --git a/mysql-test/suite/parts/r/partition_special_myisam.result b/mysql-test/suite/parts/r/partition_special_myisam.result
index 828be71c437..31868ea03ed 100644
--- a/mysql-test/suite/parts/r/partition_special_myisam.result
+++ b/mysql-test/suite/parts/r/partition_special_myisam.result
@@ -221,7 +221,7 @@ SET lock_wait_timeout = 2;
ALTER TABLE t1 COALESCE PARTITION 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
# Connection 3 tries to load into the table:
-LOAD DATA LOCAL INFILE '/tmp/load.in' INTO TABLE t1 (f);
+LOAD DATA INFILE 'load.in' INTO TABLE t1 (f);
# Connection 1 commits the transaction
COMMIT;
# Connection 3...
diff --git a/mysql-test/suite/parts/r/partition_syntax_ndb.result b/mysql-test/suite/parts/r/partition_syntax_ndb.result
deleted file mode 100644
index 2b0899fe53a..00000000000
--- a/mysql-test/suite/parts/r/partition_syntax_ndb.result
+++ /dev/null
@@ -1,1820 +0,0 @@
-SET @max_row = 20;
-SET @@session.storage_engine = 'ndbcluster';
-
-#------------------------------------------------------------------------
-# There are several testcases disabled because of the open bugs
-# #15890
-# #18730, Bug#18735
-# The expected results suffer from the following bugs
-# harmless #17455, #19305
-# which cannot be suppressed because of technical reasons.
-#------------------------------------------------------------------------
-
-#------------------------------------------------------------------------
-# 0. Setting of auxiliary variables + Creation of an auxiliary tables
-# needed in many testcases
-#------------------------------------------------------------------------
-SELECT @max_row DIV 2 INTO @max_row_div2;
-SELECT @max_row DIV 3 INTO @max_row_div3;
-SELECT @max_row DIV 4 INTO @max_row_div4;
-SET @max_int_4 = 2147483647;
-DROP TABLE IF EXISTS t0_template;
-CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) ,
-PRIMARY KEY(f_int1))
-ENGINE = MEMORY;
-# Logging of <max_row> INSERTs into t0_template suppressed
-DROP TABLE IF EXISTS t0_definition;
-CREATE TABLE t0_definition (
-state CHAR(3),
-create_command VARBINARY(5000),
-file_list VARBINARY(5000),
-PRIMARY KEY (state)
-) ENGINE = MEMORY;
-DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) )
-ENGINE = MEMORY;
-SET AUTOCOMMIT= 1;
-SET @@session.sql_mode= '';
-# End of basic preparations needed for all tests
-#-----------------------------------------------
-
-#========================================================================
-# 1. Any PRIMARY KEYs or UNIQUE INDEXes must contain the columns used
-# within the partitioning functions
-#========================================================================
-DROP TABLE IF EXISTS t1;
-#------------------------------------------------------------------------
-# 1.1 column of partitioning function not included in PRIMARY KEY
-# PARTITION BY HASH/KEY/LIST/RANGE
-#------------------------------------------------------------------------
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int2)
-)
-PARTITION BY HASH(f_int1) PARTITIONS 2;
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int2)
-)
-PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int2)
-)
-PARTITION BY KEY(f_int1) PARTITIONS 2;
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int2)
-)
-PARTITION BY KEY(f_int1,f_int2) PARTITIONS 2;
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int2)
-)
-PARTITION BY LIST(f_int1)
-(PARTITION part1 VALUES IN (1));
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int2)
-)
-PARTITION BY LIST(f_int1 + f_int2)
-(PARTITION part1 VALUES IN (1));
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int2)
-)
-PARTITION BY RANGE(f_int1)
-(PARTITION part1 VALUES LESS THAN (1));
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int2)
-)
-PARTITION BY RANGE(f_int1 + f_int2)
-(PARTITION part1 VALUES LESS THAN (1));
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
-#------------------------------------------------------------------------
-# 1.2 column of partitioning function not included in UNIQUE INDEX
-# PARTITION BY HASH/KEY/LIST/RANGE
-# Variant a) Without additional PRIMARY KEY
-# Variant b) With correct additional PRIMARY KEY
-# Variant 1) one column in partitioning function
-# Variant 2) two columns in partitioning function
-#------------------------------------------------------------------------
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-UNIQUE INDEX (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;
-DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (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;
-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 (f_int2)
-)
-PARTITION BY HASH(f_int1 + f_int2) 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;
-DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
-)
-PARTITION BY HASH(f_int1 + f_int2) 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;
-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 (f_int2)
-)
-PARTITION BY KEY(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;
-DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
-)
-PARTITION BY KEY(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;
-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 (f_int2)
-)
-PARTITION BY KEY(f_int1,f_int2) 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;
-DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
-)
-PARTITION BY KEY(f_int1,f_int2) 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;
-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 (f_int2)
-)
-PARTITION BY LIST(MOD(f_int1,3))
-(PARTITION partN VALUES IN (NULL),
-PARTITION part0 VALUES IN (0),
-PARTITION part1 VALUES IN (1),
-PARTITION part2 VALUES IN (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;
-DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
-)
-PARTITION BY LIST(MOD(f_int1,3))
-(PARTITION partN VALUES IN (NULL),
-PARTITION part0 VALUES IN (0),
-PARTITION part1 VALUES IN (1),
-PARTITION part2 VALUES IN (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;
-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 (f_int2)
-)
-PARTITION BY LIST(MOD(f_int1 + f_int2,3))
-(PARTITION partN VALUES IN (NULL),
-PARTITION part0 VALUES IN (0),
-PARTITION part1 VALUES IN (1),
-PARTITION part2 VALUES IN (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;
-DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
-)
-PARTITION BY LIST(MOD(f_int1 + f_int2,3))
-(PARTITION partN VALUES IN (NULL),
-PARTITION part0 VALUES IN (0),
-PARTITION part1 VALUES IN (1),
-PARTITION part2 VALUES IN (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;
-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 (f_int2)
-)
-PARTITION BY RANGE(f_int1)
-(PARTITION part1 VALUES LESS THAN (1),
-PARTITION part2 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;
-DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
-)
-PARTITION BY RANGE(f_int1)
-(PARTITION part1 VALUES LESS THAN (1),
-PARTITION part2 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;
-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 (f_int2)
-)
-PARTITION BY RANGE(f_int1 + f_int2)
-(PARTITION part1 VALUES LESS THAN (1),
-PARTITION part2 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;
-DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
-)
-PARTITION BY RANGE(f_int1 + f_int2)
-(PARTITION part1 VALUES LESS THAN (1),
-PARTITION part2 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;
-DROP TABLE t1;
-#------------------------------------------------------------------------
-# 1.3 column of subpartitioning function not included in PRIMARY KEY
-# PARTITION BY RANGE/LIST -- SUBPARTITION BY HASH/KEY
-#------------------------------------------------------------------------
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int2)
-)
-PARTITION BY RANGE(f_int2) SUBPARTITION BY HASH(f_int1)
-(PARTITION part1 VALUES LESS THAN (1)
-(SUBPARTITION subpart1));
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int2)
-)
-PARTITION BY RANGE(f_int2) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES LESS THAN (1)
-(SUBPARTITION subpart1));
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int2)
-)
-PARTITION BY LIST(f_int2) SUBPARTITION BY HASH(f_int1)
-(PARTITION part1 VALUES IN (1)
-(SUBPARTITION subpart1));
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int2)
-)
-PARTITION BY LIST(f_int2) SUBPARTITION BY KEY(f_int1)
-(PARTITION part1 VALUES IN (1)
-(SUBPARTITION subpart1));
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
-#------------------------------------------------------------------------
-# 1.4 column of subpartitioning function not included in UNIQUE INDEX
-# PARTITION BY RANGE/LIST -- SUBPARTITION BY HASH/KEY
-# Variant a) Without additional PRIMARY KEY
-# Variant b) With correct additional PRIMARY KEY
-#------------------------------------------------------------------------
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-UNIQUE INDEX (f_int2)
-)
-PARTITION BY RANGE(f_int2)
-SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 3
-(PARTITION part1 VALUES LESS THAN (1),
-PARTITION part2 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;
-DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
-)
-PARTITION BY RANGE(f_int2)
-SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 3
-(PARTITION part1 VALUES LESS THAN (1),
-PARTITION part2 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;
-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 (f_int2)
-)
-PARTITION BY RANGE(f_int2)
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
-(PARTITION part1 VALUES LESS THAN (1),
-PARTITION part2 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;
-DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
-)
-PARTITION BY RANGE(f_int2)
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
-(PARTITION part1 VALUES LESS THAN (1),
-PARTITION part2 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;
-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 (f_int2)
-)
-PARTITION BY LIST(MOD(f_int2,3))
-SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-(PARTITION partN VALUES IN (NULL),
-PARTITION part0 VALUES IN (0),
-PARTITION part1 VALUES IN (1),
-PARTITION part2 VALUES IN (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;
-DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
-)
-PARTITION BY LIST(MOD(f_int2,3))
-SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-(PARTITION partN VALUES IN (NULL),
-PARTITION part0 VALUES IN (0),
-PARTITION part1 VALUES IN (1),
-PARTITION part2 VALUES IN (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;
-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 (f_int2)
-)
-PARTITION BY LIST(MOD(f_int2,3))
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 2
-(PARTITION partN VALUES IN (NULL),
-PARTITION part0 VALUES IN (0),
-PARTITION part1 VALUES IN (1),
-PARTITION part2 VALUES IN (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;
-DROP TABLE t1;
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
-)
-PARTITION BY LIST(MOD(f_int2,3))
-SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 2
-(PARTITION partN VALUES IN (NULL),
-PARTITION part0 VALUES IN (0),
-PARTITION part1 VALUES IN (1),
-PARTITION part2 VALUES IN (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;
-DROP TABLE t1;
-
-#========================================================================
-# 2 Some properties around subpartitioning
-#========================================================================
-#------------------------------------------------------------------------
-# 2.1 Subpartioned table without subpartitioning rule must be rejected
-#------------------------------------------------------------------------
-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 RANGE(f_int1)
-( PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11));
-ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
-#------------------------------------------------------------------------
-# 2.2 Every partition must have the same number of subpartitions.
-# This is a limitation of MySQL 5.1, which could be removed in
-# later releases.
-#------------------------------------------------------------------------
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000),
-PRIMARY KEY (f_int1)
-)
-PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
-(
-PARTITION part1 VALUES LESS THAN (0)
-(SUBPARTITION subpart1),
-PARTITION part2 VALUES LESS THAN (5)
-(SUBPARTITION subpart1, SUBPARTITION subpart2));
-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '))' at line 14
-
-#========================================================================
-# 3 VALUES clauses
-#========================================================================
-#------------------------------------------------------------------------
-# 3.1 The constants in VALUES IN clauses must differ
-#------------------------------------------------------------------------
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-)
-PARTITION BY LIST(MOD(f_int1,2))
-( PARTITION part1 VALUES IN (-1),
-PARTITION part2 VALUES IN (0),
-PARTITION part3 VALUES IN (-1));
-ERROR HY000: Multiple definition of same constant in list partitioning
-CREATE TABLE t1 (f1 BIGINT, f2 BIGINT)
-PARTITION BY RANGE(f1)
-(PARTITION part1 VALUES LESS THAN (0),
-PARTITION part2 VALUES LESS THAN (0),
-PARTITION part3 VALUES LESS THAN (10000));
-ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
-#------------------------------------------------------------------------
-# 3.2 The constants in VALUES LESS must be in increasing order
-#------------------------------------------------------------------------
-CREATE TABLE t1 (f1 BIGINT, f2 BIGINT)
-PARTITION BY RANGE(f1)
-(PARTITION part1 VALUES LESS THAN (0),
-PARTITION part2 VALUES LESS THAN (-1),
-PARTITION part3 VALUES LESS THAN (10000));
-ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
-#------------------------------------------------------------------------
-# 3.3 LIST partitions must be defined with VALUES IN
-#------------------------------------------------------------------------
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-)
-PARTITION BY LIST(MOD(f_int1,2))
-( PARTITION part1 VALUES LESS THAN (-1),
-PARTITION part2 VALUES LESS THAN (0),
-PARTITION part3 VALUES LESS THAN (1000));
-ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
-#------------------------------------------------------------------------
-# 3.4 RANGE partitions must be defined with VALUES LESS THAN
-#------------------------------------------------------------------------
-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 part1 VALUES IN (-1),
-PARTITION part2 VALUES IN (0),
-PARTITION part3 VALUES IN (1000));
-ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
-#------------------------------------------------------------------------
-# 3.5 Use of NULL in VALUES clauses
-#------------------------------------------------------------------------
-# 3.5.1 NULL in RANGE partitioning clause
-# 3.5.1.1 VALUE LESS THAN (NULL) is not allowed
-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 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
-# 3.5.1.2 VALUE LESS THAN (CAST(NULL AS SIGNED INTEGER)) is not allowed
-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 part1 VALUES LESS THAN (CAST(NULL AS SIGNED INTEGER)),
-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.2 NULL in LIST partitioning clause
-# 3.5.2.1 VALUE IN (NULL)
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-)
-PARTITION BY LIST(MOD(f_int1,2))
-( PARTITION part1 VALUES IN (NULL),
-PARTITION part2 VALUES IN (0),
-PARTITION part3 VALUES IN (1));
-DROP TABLE t1;
-# 3.5.2.2 VALUE IN (CAST(NULL AS SIGNED INTEGER))
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-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 part3 VALUES IN (1));
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = ndbcluster, PARTITION part3 VALUES IN (1) ENGINE = ndbcluster)
-
-DROP TABLE t1;
-# 3.5.3 Reveal that IN (...NULL) is not mapped to IN(0)
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-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 part2 VALUES IN (0),
-PARTITION part3 VALUES IN (1));
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = ndbcluster, PARTITION part2 VALUES IN (0) ENGINE = ndbcluster, PARTITION part3 VALUES IN (1) ENGINE = ndbcluster)
-
-DROP TABLE t1;
-
-#========================================================================
-# 4. Check assigning the number of partitions and subpartitions
-# with and without named partitions/subpartitions
-#========================================================================
-DROP TABLE IF EXISTS t1;
-#------------------------------------------------------------------------
-# 4.1 (positive) without partition/subpartition number assignment
-#------------------------------------------------------------------------
-# 4.1.1 no partition number, no named partitions
-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);
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1)
-
-DROP TABLE t1;
-# 4.1.2 no partition number, named partitions
-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) (PARTITION part1, PARTITION part2);
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster)
-
-DROP TABLE t1;
-# 4.1.3 variations on no partition/subpartition number, named partitions,
-# different subpartitions are/are not named
-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 HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)) ;
-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 HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '))' at line 7
-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 HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20)
-(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)) ;
-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), PARTITION part3 VALUES LESS THAN (2147483646))' at line 7
-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 HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20)
-(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), PARTITION part3 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart31 , SUBPA' at line 7
-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 HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10)
-(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)) ;
-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ' PARTITION part3 VALUES LESS THAN (2147483646))' at line 7
-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 HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10)
-(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ' PARTITION part3 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart31 , SUBPART' at line 7
-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 HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10)
-(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (20)
-(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)) ;
-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ')' at line 8
-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 HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10)
-(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (20)
-(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (20) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster), PARTITION part3 VALUES LESS THAN (2147483646) (SUBPARTITION subpart31 ENGINE = ndbcluster, SUBPARTITION subpart32 ENGINE = ndbcluster))
-
-DROP TABLE t1;
-#------------------------------------------------------------------------
-# 4.2 partition/subpartition numbers good and bad values and notations
-#------------------------------------------------------------------------
-DROP TABLE IF EXISTS t1;
-# 4.2.1 partition/subpartition numbers INTEGER notation
-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;
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) PARTITIONS 2
-
-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 HASH(f_int1)
-SUBPARTITIONS 2
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (10) , PARTITION part2 VALUES LESS THAN (2147483646) )
-
-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 1;
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) PARTITIONS 1
-
-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 HASH(f_int1)
-SUBPARTITIONS 1
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 1 (PARTITION part1 VALUES LESS THAN (10) , PARTITION part2 VALUES LESS THAN (2147483646) )
-
-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 0;
-ERROR HY000: Number of partitions = 0 is not an allowed value
-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 HASH(f_int1)
-SUBPARTITIONS 0
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR HY000: Number of subpartitions = 0 is not an allowed value
-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 -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 8
-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 HASH(f_int1)
-SUBPARTITIONS -1
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You 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
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (214' at line 9
-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 1000000;
-ERROR HY000: Too many partitions (including subpartitions) were defined
-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 HASH(f_int1)
-SUBPARTITIONS 1000000
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR HY000: Too many partitions (including subpartitions) were defined
-# 4.2.2 partition/subpartition numbers DECIMAL notation
-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.0;
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) PARTITIONS 2
-
-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 HASH(f_int1)
-SUBPARTITIONS 2.0
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (10) , PARTITION part2 VALUES LESS THAN (2147483646) )
-
-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 -2.0;
-ERROR 42000: You 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.0' at line 8
-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 HASH(f_int1)
-SUBPARTITIONS -2.0
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You 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.0
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2' at line 9
-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 0.0;
-ERROR HY000: Number of partitions = 0 is not an allowed value
-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 HASH(f_int1)
-SUBPARTITIONS 0.0
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR HY000: Number of subpartitions = 0 is not an allowed value
-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 999999999999999999999999999999.999999999999999999999999999999;
-ERROR HY000: Too many partitions (including subpartitions) were defined
-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 HASH(f_int1)
-SUBPARTITIONS 999999999999999999999999999999.999999999999999999999999999999
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR HY000: Too many partitions (including subpartitions) were defined
-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 0.000000000000000000000000000001;
-ERROR HY000: Number of partitions = 0 is not an allowed value
-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 HASH(f_int1)
-SUBPARTITIONS 0.000000000000000000000000000001
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR HY000: Number of subpartitions = 0 is not an allowed value
-# 4.2.3 partition/subpartition numbers FLOAT notation
-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.0E+0;
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) PARTITIONS 2
-
-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 HASH(f_int1)
-SUBPARTITIONS 2.0E+0
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (10) , PARTITION part2 VALUES LESS THAN (2147483646) )
-
-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 -2.0E+0;
-ERROR 42000: You 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.0E+0' at line 8
-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 HASH(f_int1)
-SUBPARTITIONS -2.0E+0
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You 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.0E+0
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN' at line 9
-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 0.0E+300;
-ERROR HY000: Number of partitions = 0 is not an allowed value
-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 HASH(f_int1)
-SUBPARTITIONS 0.0E+300
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR HY000: Number of subpartitions = 0 is not an allowed value
-# 4.2.4 partition/subpartition numbers STRING notation
-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';
-ERROR 42000: You 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 8
-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 HASH(f_int1)
-SUBPARTITIONS '2'
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You 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'
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (21' at line 9
-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.0';
-ERROR 42000: You 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.0'' at line 8
-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 HASH(f_int1)
-SUBPARTITIONS '2.0'
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You 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.0'
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (' at line 9
-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 '0.2E+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 ''0.2E+1'' at line 8
-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 HASH(f_int1)
-SUBPARTITIONS '0.2E+1'
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''0.2E+1'
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THA' at line 9
-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 '2A';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2A'' at line 8
-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 HASH(f_int1)
-SUBPARTITIONS '2A'
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2A'
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2' at line 9
-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 'A2';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''A2'' at line 8
-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 HASH(f_int1)
-SUBPARTITIONS 'A2'
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''A2'
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2' at line 9
-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 '';
-ERROR 42000: You 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 8
-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 HASH(f_int1)
-SUBPARTITIONS ''
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (214' at line 9
-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 'GARBAGE';
-ERROR 42000: You 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 8
-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 HASH(f_int1)
-SUBPARTITIONS 'GARBAGE'
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You 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'
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS TH' at line 9
-# 4.2.5 partition/subpartition numbers other notations
-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 2A;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2A' at line 8
-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 HASH(f_int1)
-SUBPARTITIONS 2A
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2A
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (214' at line 9
-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 A2;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'A2' at line 8
-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 HASH(f_int1)
-SUBPARTITIONS A2
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'A2
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (214' at line 9
-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 GARBAGE;
-ERROR 42000: You 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 8
-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 HASH(f_int1)
-SUBPARTITIONS GARBAGE
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You 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
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN' at line 9
-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";
-ERROR 42000: You 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 8
-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 HASH(f_int1)
-SUBPARTITIONS "2"
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You 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"
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (21' at line 9
-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 "2A";
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"2A"' at line 8
-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 HASH(f_int1)
-SUBPARTITIONS "2A"
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"2A"
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2' at line 9
-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 "A2";
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"A2"' at line 8
-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 HASH(f_int1)
-SUBPARTITIONS "A2"
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"A2"
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2' at line 9
-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 "GARBAGE";
-ERROR 42000: You 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 8
-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 HASH(f_int1)
-SUBPARTITIONS "GARBAGE"
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You 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"
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS TH' at line 9
-# 4.2.6 (negative) partition/subpartition numbers per @variables
-SET @aux = 5;
-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 @aux;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@aux' at line 8
-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 HASH(f_int1)
-SUBPARTITIONS @aux = 5
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THAN (2147483646));
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@aux = 5
-(PARTITION part1 VALUES LESS THAN (10),
-PARTITION part2 VALUES LESS THA' at line 9
-#------------------------------------------------------------------------
-# 4.3 Mixups of assigned partition/subpartition numbers and names
-#------------------------------------------------------------------------
-# 4.3.1 (positive) number of partition/subpartition
-# = number of named partition/subpartition
-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 part1, PARTITION part2 ) ;
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster)
-
-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) PARTITIONS 2
-SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-( PARTITION part1 VALUES LESS THAN (1000)
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21, SUBPARTITION subpart22)
-);
-create_command
-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=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster))
-
-DROP TABLE t1;
-# 4.3.2 (positive) number of partition/subpartition ,
-# 0 (= no) named partition/subpartition
-# already checked above
-# 4.3.3 (negative) number of partitions/subpartitions
-# > number of named partitions/subpartitions
-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 part1 ) ;
-ERROR 42000: Wrong number of partitions defined, mismatch with previous setting near ')' at line 8
-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 HASH(f_int1) SUBPARTITIONS 2
-( PARTITION part1 VALUES LESS THAN (1000)
-(SUBPARTITION subpart11 ),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21, SUBPARTITION subpart22)
-);
-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21, SUBPAR' at line 11
-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 HASH(f_int1) SUBPARTITIONS 2
-( PARTITION part1 VALUES LESS THAN (1000)
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (2000)
-(SUBPARTITION subpart21 ),
-PARTITION part3 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart31, SUBPARTITION subpart32)
-);
-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '),
-PARTITION part3 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart31, SUBPAR' at line 13
-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) PARTITIONS 2
-SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
-( PARTITION part1 VALUES LESS THAN (1000)
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21 )
-);
-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ')
-)' at line 13
-# 4.3.4 (negative) number of partitions < number of named partitions
-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 1 ( PARTITION part1, PARTITION part2 ) ;
-ERROR 42000: Wrong number of partitions defined, mismatch with previous setting near ')' at line 8
-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 HASH(f_int1) SUBPARTITIONS 1
-( PARTITION part1 VALUES LESS THAN (1000)
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21, SUBPARTITION subpart22)
-);
-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21, SUBPAR' at line 11
-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 HASH(f_int1) SUBPARTITIONS 1
-( PARTITION part1 VALUES LESS THAN (1000)
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (2000)
-(SUBPARTITION subpart21 ),
-PARTITION part3 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart31, SUBPARTITION subpart32)
-);
-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '),
-PARTITION part2 VALUES LESS THAN (2000)
-(SUBPARTITION subpart21 ' at line 11
-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 HASH(f_int1) SUBPARTITIONS 1
-( PARTITION part1 VALUES LESS THAN (1000)
-(SUBPARTITION subpart11, SUBPARTITION subpart12),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21, SUBPARTITION subpart22)
-);
-ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '),
-PARTITION part2 VALUES LESS THAN (2147483646)
-(SUBPARTITION subpart21, SUBPAR' at line 11
-
-#========================================================================
-# 5. Checks of logical partition/subpartition name
-# file name clashes during CREATE TABLE
-#========================================================================
-DROP TABLE IF EXISTS t1;
-#------------------------------------------------------------------------
-# 5.1 (negative) A partition/subpartition name used more than once
-#------------------------------------------------------------------------
-# 5.1.1 duplicate partition name
-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) (PARTITION part1, PARTITION part1);
-ERROR HY000: Duplicate partition name part1
-# 5.1.2 duplicate subpartition name
-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 HASH(f_int1)
-( PARTITION part1 VALUES LESS THAN (1000)
-(SUBPARTITION subpart11, SUBPARTITION subpart11)
-);
-ERROR HY000: Duplicate partition name subpart11
-DROP VIEW IF EXISTS v1;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t0_aux;
-DROP TABLE IF EXISTS t0_definition;
-DROP TABLE IF EXISTS t0_template;
diff --git a/mysql-test/suite/parts/r/partition_value_ndb.result b/mysql-test/suite/parts/r/partition_value_ndb.result
deleted file mode 100644
index 0787df5f5ac..00000000000
--- a/mysql-test/suite/parts/r/partition_value_ndb.result
+++ /dev/null
@@ -1,189 +0,0 @@
-SET @max_row = 20;
-SET @@session.storage_engine = 'ndbcluster';
-
-#------------------------------------------------------------------------
-# There are several testcases disabled because of the open bugs
-# #15890
-# #18730, Bug#18735
-# The expected results suffer from the following bugs
-# harmless #17455, #19305
-# which cannot be suppressed because of technical reasons.
-#------------------------------------------------------------------------
-
-#------------------------------------------------------------------------
-# 0. Setting of auxiliary variables + Creation of an auxiliary tables
-# needed in many testcases
-#------------------------------------------------------------------------
-SELECT @max_row DIV 2 INTO @max_row_div2;
-SELECT @max_row DIV 3 INTO @max_row_div3;
-SELECT @max_row DIV 4 INTO @max_row_div4;
-SET @max_int_4 = 2147483647;
-DROP TABLE IF EXISTS t0_template;
-CREATE TABLE t0_template (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) ,
-PRIMARY KEY(f_int1))
-ENGINE = MEMORY;
-# Logging of <max_row> INSERTs into t0_template suppressed
-DROP TABLE IF EXISTS t0_definition;
-CREATE TABLE t0_definition (
-state CHAR(3),
-create_command VARBINARY(5000),
-file_list VARBINARY(5000),
-PRIMARY KEY (state)
-) ENGINE = MEMORY;
-DROP TABLE IF EXISTS t0_aux;
-CREATE TABLE t0_aux ( f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000) )
-ENGINE = MEMORY;
-SET AUTOCOMMIT= 1;
-SET @@session.sql_mode= '';
-# End of basic preparations needed for all tests
-#-----------------------------------------------
-
-#========================================================================
-# Calculation of "exotic" results within the partition function
-# outside of SIGNED BIGINT value range, 0, NULL
-# column used in partitioning function has type CHAR
-#========================================================================
-# 1. HASH(<check value>)
-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(CAST(f_char1 AS SIGNED INTEGER) * CAST(5.0E+18 AS SIGNED INTEGER)) PARTITIONS 8;
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(2147483646,2147483646,'2147483646','2147483646','#2147483646#');
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char1 = '2147483646';
-COUNT(*) = 1
-1
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(-2147483646,-2147483646,'-2147483646','-2147483646','#-2147483646#');
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char1 = '-2147483646';
-COUNT(*) = 1
-1
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(0,0,'0','0','#0#');
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char1 = '0';
-COUNT(*) = 1
-1
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(NULL,NULL,NULL,NULL,NULL);
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char1 IS NULL;
-COUNT(*) = 1
-1
-DROP TABLE t1;
-# 2. RANGE(<check value>)
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-)
-PARTITION BY RANGE(CAST(f_char1 AS SIGNED INTEGER) * CAST(5.0E+18 AS SIGNED INTEGER))
-(PARTITION p0 VALUES LESS THAN (0),
-PARTITION p1 VALUES LESS THAN (1000000),
-PARTITION p2 VALUES LESS THAN MAXVALUE);
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(2147483646,2147483646,'2147483646','2147483646','#2147483646#');
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char1 = '2147483646';
-COUNT(*) = 1
-1
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(-2147483646,-2147483646,'-2147483646','-2147483646','#-2147483646#');
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char1 = '-2147483646';
-COUNT(*) = 1
-1
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(0,0,'0','0','#0#');
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char1 = '0';
-COUNT(*) = 1
-1
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(NULL,NULL,NULL,NULL,NULL);
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char1 IS NULL;
-COUNT(*) = 1
-1
-DROP TABLE t1;
-# 4. Partition by RANGE(...) subpartition by HASH(<check value>)
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-)
-PARTITION BY RANGE(CAST(f_char1 AS SIGNED INTEGER))
-SUBPARTITION BY HASH(CAST(f_char2 AS SIGNED INTEGER) * CAST(5.0E+18 AS SIGNED INTEGER)) SUBPARTITIONS 4
-(PARTITION p0 VALUES LESS THAN (0),
-PARTITION p1 VALUES LESS THAN MAXVALUE);
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(2147483646,2147483646,'1','2147483646','#2147483646#');
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char2 = '2147483646';
-COUNT(*) = 1
-1
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(-2147483646,-2147483646,'-1','-2147483646','#-2147483646#');
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char2 = '-2147483646';
-COUNT(*) = 1
-1
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(0,0,'0','0','#0#');
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char2 = '0';
-COUNT(*) = 1
-1
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(NULL,NULL,NULL,NULL,NULL);
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char2 IS NULL;
-COUNT(*) = 1
-1
-DROP TABLE t1;
-# 5. Partition by LIST(...) subpartition by HASH(<check value>)
-CREATE TABLE t1 (
-f_int1 INTEGER,
-f_int2 INTEGER,
-f_char1 CHAR(20),
-f_char2 CHAR(20),
-f_charbig VARCHAR(1000)
-)
-PARTITION BY LIST(CAST(f_char1 AS SIGNED INTEGER))
-SUBPARTITION BY HASH(CAST(f_char2 AS SIGNED INTEGER) * CAST(5.0E+18 AS SIGNED INTEGER)) SUBPARTITIONS 4
-(PARTITION p0 VALUES IN (NULL),
-PARTITION p1 VALUES IN (1));
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(2147483646,2147483646,'1','2147483646','#2147483646#');
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char2 = '2147483646';
-COUNT(*) = 1
-1
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(-2147483646,-2147483646,'1','-2147483646','#-2147483646#');
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char2 = '-2147483646';
-COUNT(*) = 1
-1
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(0,0,'1','0','#0#');
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char2 = '0';
-COUNT(*) = 1
-1
-INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
-VALUES(NULL,NULL,NULL,NULL,NULL);
-SELECT COUNT(*) = 1 FROM t1 WHERE f_char2 IS NULL;
-COUNT(*) = 1
-1
-DROP TABLE t1;
-DROP VIEW IF EXISTS v1;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t0_aux;
-DROP TABLE IF EXISTS t0_definition;
-DROP TABLE IF EXISTS t0_template;
diff --git a/mysql-test/suite/parts/r/rpl_partition.result b/mysql-test/suite/parts/r/rpl_partition.result
index abd3f7924df..70de17e6556 100644
--- a/mysql-test/suite/parts/r/rpl_partition.result
+++ b/mysql-test/suite/parts/r/rpl_partition.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
set @old_global_binlog_format= @@global.binlog_format;
set @old_session_binlog_format= @@session.binlog_format;
SET GLOBAL binlog_format = 'ROW';
@@ -22,10 +18,6 @@ select @@global.binlog_format, @@session.binlog_format;
include/stop_slave.inc
include/start_slave.inc
[on master]
-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),
@@ -149,7 +141,7 @@ SUBPARTITIONS 2
PARTITION pa9 VALUES LESS THAN (90) ENGINE = InnoDB,
PARTITION pa10 VALUES LESS THAN (100) ENGINE = InnoDB,
PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
SELECT count(*) "Slave norm" FROM t1;
Slave norm 500
SELECT count(*) "Slave bykey" FROM t2;
@@ -159,9 +151,10 @@ Slave byrange 500
set @@global.binlog_format= @old_global_binlog_format;
set @@session.binlog_format= @old_session_binlog_format;
DROP TABLE t1, t2, t3;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS p2;
-DROP PROCEDURE IF EXISTS p3;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
[on slave]
set @@global.binlog_format= @old_global_binlog_format;
set @@session.binlog_format= @old_session_binlog_format;
+include/rpl_end.inc
diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def
index 8a1dafe59a2..e69de29bb2d 100644
--- a/mysql-test/suite/parts/t/disabled.def
+++ b/mysql-test/suite/parts/t/disabled.def
@@ -1,3 +0,0 @@
-partition_basic_ndb : Bug#44919 parts-suite in mtr tries to use features not supported by ndb
-# http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-syntax.html
-partition_syntax_ndb : Bug#36735 Not supported
diff --git a/mysql-test/suite/parts/t/ndb_dd_backuprestore.test b/mysql-test/suite/parts/t/ndb_dd_backuprestore.test
deleted file mode 100644
index d2f79028c3f..00000000000
--- a/mysql-test/suite/parts/t/ndb_dd_backuprestore.test
+++ /dev/null
@@ -1,347 +0,0 @@
-########################################
-# Author: JBM
-# Date: 2006-01-24
-# Purpose: Test CDD backup and restore
-########################################
-
--- source include/have_ndb.inc
-# range, list and hash partitioning in ndb requires new_mode
---disable_query_log
-set new=on;
---enable_query_log
-
---disable_warnings
-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;
---enable_warnings
-
-############ Test 1 Simple DD backup and restore #############
--- echo **** 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;
-
-let $j= 500;
---disable_query_log
-while ($j)
-{
- eval INSERT INTO test.t1 VALUES (NULL, "Sweden", $j, b'1');
- dec $j;
-}
---enable_query_log
-SELECT COUNT(*) FROM test.t1;
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
-
--- source include/ndb_backup.inc
-
-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;
-
--- source include/ndb_restore_master.inc
-
-SELECT COUNT(*) FROM test.t1;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
-
-################# Mixed Cluster Test ############################
--- echo **** 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;
-
-let $j= 500;
---disable_query_log
-while ($j)
-{
- eval INSERT INTO test.t2 VALUES (NULL, "Sweden, Texas", $j, b'0');
- dec $j;
-}
---enable_query_log
-
-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;
-
-let $j= 50;
---disable_query_log
-while ($j)
-{
- INSERT INTO test.t3 VALUES (NULL, repeat('a',1*1024));
- INSERT INTO test.t3 VALUES (NULL, repeat('b',16*1024));
- INSERT INTO test.t4 VALUES (NULL, repeat('a',1*1024));
- INSERT INTO test.t4 VALUES (NULL, repeat('b',16*1024));
- dec $j;
-}
---enable_query_log
-
-SELECT COUNT(*) FROM test.t1;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t2;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY pk1 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t3;
-
-SELECT LENGTH(data) FROM test.t3 WHERE c1 = 1;
-
-SELECT LENGTH(data) FROM test.t3 WHERE c1 = 2;
-
-SELECT COUNT(*) FROM test.t4;
-
-SELECT LENGTH(data) FROM test.t4 WHERE c1 = 1;
-
-SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
-
--- source include/ndb_backup.inc
-
-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;
-
--- source include/ndb_restore_master.inc
-
-SELECT COUNT(*) FROM test.t1;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t2;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY pk1 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t3;
-
-SELECT LENGTH(data) FROM test.t3 WHERE c1 = 1;
-
-SELECT LENGTH(data) FROM test.t3 WHERE c1 = 2;
-
-SELECT COUNT(*) FROM test.t4;
-
-SELECT LENGTH(data) FROM test.t4 WHERE c1 = 1;
-
-SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
-
-DROP TABLE test.t1;
-DROP TABLE test.t2;
-DROP TABLE test.t3;
-DROP TABLE test.t4;
-###################### Adding partition #################################
--- echo **** 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;
-
-SHOW CREATE TABLE test.t2;
-
-SHOW CREATE TABLE test.t3;
-
-SHOW CREATE TABLE test.t4;
-
-SHOW CREATE TABLE test.t5;
-
-SHOW CREATE TABLE test.t6;
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't1';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't2';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't3';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't4';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't5';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't6';
-
-
-let $j= 500;
---disable_query_log
-while ($j)
-{
- eval INSERT INTO test.t1 VALUES (NULL, "Sweden, Texas", $j, b'0');
- eval INSERT INTO test.t4 VALUES (NULL, "Sweden, Texas", $j, b'0');
- dec $j;
- eval INSERT INTO test.t2 VALUES (NULL, "Sweden, Texas, ITALY, Kyle, JO, JBM,TU", $j, b'1');
- eval INSERT INTO test.t5 VALUES (NULL, "Sweden, Texas, ITALY, Kyle, JO, JBM,TU", $j, b'1');
- dec $j;
- eval INSERT INTO test.t3 VALUES (NULL, "TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU", $j, b'1');
- eval INSERT INTO test.t6 VALUES (NULL, "TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU", $j, b'1'); } --enable_query_log
-
-SELECT COUNT(*) FROM test.t1;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t2;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t3;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t3 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t4;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t4 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t5;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t5 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t6;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t6 ORDER BY c3 LIMIT 5;
-
--- source include/ndb_backup.inc
-
-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;
-
--- source include/ndb_restore_master.inc
-
-
-SHOW CREATE TABLE test.t1;
-
-SHOW CREATE TABLE test.t2;
-
-SHOW CREATE TABLE test.t3;
-
-SHOW CREATE TABLE test.t4;
-
-SHOW CREATE TABLE test.t5;
-
-SHOW CREATE TABLE test.t6;
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't1';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't2';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't3';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't4';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't5';
-
-SELECT * FROM information_schema.partitions WHERE table_name= 't6';
-
-SELECT COUNT(*) FROM test.t1;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t2;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t2 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t3;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t3 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t4;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t4 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t5;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t5 ORDER BY c3 LIMIT 5;
-
-SELECT COUNT(*) FROM test.t6;
-
-SELECT pk1, c2, c3, hex(c4) FROM test.t6 ORDER BY c3 LIMIT 5;
-
-# Cleanup
-
-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;
-
-#End 5.1 test case
-
-
diff --git a/mysql-test/suite/parts/t/part_supported_sql_func_innodb.test b/mysql-test/suite/parts/t/part_supported_sql_func_innodb.test
index fef41990e28..115bc08a624 100644
--- a/mysql-test/suite/parts/t/part_supported_sql_func_innodb.test
+++ b/mysql-test/suite/parts/t/part_supported_sql_func_innodb.test
@@ -30,6 +30,9 @@ let $do_long_tests= 1;
# The server must support partitioning.
--source include/have_partition.inc
+# This test takes long time, so only run it with the --big mtr-flag.
+--source include/big_test.inc
+
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test b/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test
deleted file mode 100644
index 5ac6b2a504f..00000000000
--- a/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test
+++ /dev/null
@@ -1,46 +0,0 @@
-################################################################################
-# t/part_supported_sql_funcs_ndb.test #
-# #
-# Purpose: #
-# Tests which SQL functions are allowed in partinioning clauses with #
-# NDB. #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: HH #
-# Original Date: 2006-11-22 #
-# Change Author: #
-# Change Date: #
-# Change: #
-################################################################################
-
-#
-# NOTE: PLEASE DO NOT ADD NOT NDB SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
-
-##### Options, for debugging support #####
-let $debug= 0;
-let $do_long_tests= 1;
-
-# The server must support partitioning.
---source include/have_partition.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-let $engine= 'NDB';
-connection default;
-
-# range, list and hash partitioning in ndb requires new_mode
---disable_query_log
-set new=on;
---enable_query_log
-let $max_8_partitions= 1;
-let $no_reorg_partition= 1;
-let $drop_partition_not_supported= 1;
-#------------------------------------------------------------------------------#
---source suite/parts/inc/part_supported_sql_funcs_main.inc
diff --git a/mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test b/mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test
index 240bfb4de1d..5a6488dfba0 100644
--- a/mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test
+++ b/mysql-test/suite/parts/t/partition_alter1_1_2_innodb.test
@@ -51,6 +51,9 @@ let $more_pk_ui_tests= 0;
# The server must support partitioning.
--source include/have_partition.inc
+# This test takes long time, so only run it with the --big mtr-flag.
+--source include/big_test.inc
+
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test b/mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test
deleted file mode 100644
index 1a8f1f311b6..00000000000
--- a/mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test
+++ /dev/null
@@ -1,88 +0,0 @@
-################################################################################
-# t/partition_alter1_1_2_ndb.test #
-# #
-# Purpose: #
-# Tests around ADD/DROP PRIMARY KEY and/or UNIQUE INDEX #
-# NDB branch #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: mleich #
-# Original Date: 2006-03-05 #
-# Change Author: pcrews #
-# Change Date: 2008-05-05 #
-# Change: Split up original partition_alter1.test file to better accommodate #
-# PushBuild machines' workloads. Total run time for all components #
-# is essentially the same, but max. single run time is significantly #
-# reduced #
-################################################################################
-#
-# NOTE: PLEASE DO NOT ADD NOT NDB SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
---source include/big_test.inc
-
-##### Options, for debugging support #####
-let $debug= 0;
-
-##### Option, for displaying files #####
-let $ls= 1;
-
-##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
-# on partioned tables
-SET @max_row = 20;
-
-##### Execute more tests #####
-let $more_trigger_tests= 0;
-let $more_pk_ui_tests= 0;
-
-# The server must support partitioning. But NDB is partitioned from the start.
-# Thats why the next line is set to comment.
-# --source include/have_partition.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-let $engine= 'ndbcluster';
-connection default;
-
-##### Execute the test of "table" files
-# NDB has no files per PK, UI, ...
-let $do_file_tests= 0;
-
-##### Execute PRIMARY KEY tests #####
-# AFAIK NDB is always partitioned using the explicit defined PRIMARY KEY
-# or uses an internal one.
-let $do_pk_tests= 1;
-
-##### Assign a big number smaller than the maximum value for partitions #####
-# and smaller than the maximum value of SIGNED INTEGER
-# The NDB handler only supports 32 bit integers in VALUES
-# 2147483647 seems to be too big.
-let $MAX_VALUE= (2147483646);
-
-# Generate the prerequisites ($variables, @variables, tables) needed
---source suite/parts/inc/partition.pre
-
-##### Workarounds for known open engine specific bugs
-# Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response
-let $fixed_bug18735= 1;
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_alter1_1_2.inc
-
-#------------------------------------------------------------------------------#
-# Execute storage engine specific tests
-
-#------------------------------------------------------------------------------#
-# Cleanup
---source suite/parts/inc/partition_cleanup.inc
diff --git a/mysql-test/suite/parts/t/partition_alter1_1_ndb.test b/mysql-test/suite/parts/t/partition_alter1_1_ndb.test
deleted file mode 100644
index 1a031f0ef79..00000000000
--- a/mysql-test/suite/parts/t/partition_alter1_1_ndb.test
+++ /dev/null
@@ -1,88 +0,0 @@
-################################################################################
-# t/partition_alter1_1_ndb.test #
-# #
-# Purpose: #
-# Tests around ADD/DROP PRIMARY KEY and/or UNIQUE INDEX #
-# NDB branch #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: mleich #
-# Original Date: 2006-03-05 #
-# Change Author: pcrews #
-# Change Date: 2008-05-05 #
-# Change: Split up original partition_alter1.test file to better accommodate #
-# PushBuild machines' workloads. Total run time for all components #
-# is essentially the same, but max. single run time is significantly #
-# reduced #
-################################################################################
-#
-# NOTE: PLEASE DO NOT ADD NOT NDB SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
---source include/big_test.inc
-
-##### Options, for debugging support #####
-let $debug= 0;
-
-##### Option, for displaying files #####
-let $ls= 1;
-
-##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
-# on partioned tables
-SET @max_row = 20;
-
-##### Execute more tests #####
-let $more_trigger_tests= 0;
-let $more_pk_ui_tests= 0;
-
-# The server must support partitioning. But NDB is partitioned from the start.
-# Thats why the next line is set to comment.
-# --source include/have_partition.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-let $engine= 'ndbcluster';
-connection default;
-
-##### Execute the test of "table" files
-# NDB has no files per PK, UI, ...
-let $do_file_tests= 0;
-
-##### Execute PRIMARY KEY tests #####
-# AFAIK NDB is always partitioned using the explicit defined PRIMARY KEY
-# or uses an internal one.
-let $do_pk_tests= 1;
-
-##### Assign a big number smaller than the maximum value for partitions #####
-# and smaller than the maximum value of SIGNED INTEGER
-# The NDB handler only supports 32 bit integers in VALUES
-# 2147483647 seems to be too big.
-let $MAX_VALUE= (2147483646);
-
-# Generate the prerequisites ($variables, @variables, tables) needed
---source suite/parts/inc/partition.pre
-
-##### Workarounds for known open engine specific bugs
-# Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response
-let $fixed_bug18735= 1;
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_alter1_1.inc
-
-#------------------------------------------------------------------------------#
-# Execute storage engine specific tests
-
-#------------------------------------------------------------------------------#
-# Cleanup
---source suite/parts/inc/partition_cleanup.inc
diff --git a/mysql-test/suite/parts/t/partition_alter1_2_innodb.test b/mysql-test/suite/parts/t/partition_alter1_2_innodb.test
index edb0a981c20..4a57bdd007d 100644
--- a/mysql-test/suite/parts/t/partition_alter1_2_innodb.test
+++ b/mysql-test/suite/parts/t/partition_alter1_2_innodb.test
@@ -51,6 +51,9 @@ let $more_pk_ui_tests= 0;
# The server must support partitioning.
--source include/have_partition.inc
+# This test takes long time, so only run it with the --big mtr-flag.
+--source include/big_test.inc
+
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_alter1_2_ndb.test b/mysql-test/suite/parts/t/partition_alter1_2_ndb.test
deleted file mode 100644
index 497898fb089..00000000000
--- a/mysql-test/suite/parts/t/partition_alter1_2_ndb.test
+++ /dev/null
@@ -1,89 +0,0 @@
-################################################################################
-# t/partition_alter1_2_ndb.test #
-# #
-# Purpose: #
-# Tests around ADD/DROP PRIMARY KEY and/or UNIQUE INDEX #
-# NDB branch #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: mleich #
-# Original Date: 2006-03-05 #
-# Change Author: pcrews #
-# Change Date: 2008-05-05 #
-# Change: Split up original partition_alter1.test file to better accommodate #
-# PushBuild machines' workloads. Total run time for all components #
-# is essentially the same, but max. single run time is significantly #
-# reduced #
-################################################################################
-
-#
-# NOTE: PLEASE DO NOT ADD NOT NDB SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
---source include/big_test.inc
-
-##### Options, for debugging support #####
-let $debug= 0;
-
-##### Option, for displaying files #####
-let $ls= 1;
-
-##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
-# on partioned tables
-SET @max_row = 20;
-
-##### Execute more tests #####
-let $more_trigger_tests= 0;
-let $more_pk_ui_tests= 0;
-
-# The server must support partitioning. But NDB is partitioned from the start.
-# Thats why the next line is set to comment.
-# --source include/have_partition.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-let $engine= 'ndbcluster';
-connection default;
-
-##### Execute the test of "table" files
-# NDB has no files per PK, UI, ...
-let $do_file_tests= 0;
-
-##### Execute PRIMARY KEY tests #####
-# AFAIK NDB is always partitioned using the explicit defined PRIMARY KEY
-# or uses an internal one.
-let $do_pk_tests= 1;
-
-##### Assign a big number smaller than the maximum value for partitions #####
-# and smaller than the maximum value of SIGNED INTEGER
-# The NDB handler only supports 32 bit integers in VALUES
-# 2147483647 seems to be too big.
-let $MAX_VALUE= (2147483646);
-
-# Generate the prerequisites ($variables, @variables, tables) needed
---source suite/parts/inc/partition.pre
-
-##### Workarounds for known open engine specific bugs
-# Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response
-let $fixed_bug18735= 1;
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_alter1_2.inc
-
-#------------------------------------------------------------------------------#
-# Execute storage engine specific tests
-
-#------------------------------------------------------------------------------#
-# Cleanup
---source suite/parts/inc/partition_cleanup.inc
diff --git a/mysql-test/suite/parts/t/partition_alter2_1_1_innodb.test b/mysql-test/suite/parts/t/partition_alter2_1_1_innodb.test
index 44fb24a1326..a772122c20a 100644
--- a/mysql-test/suite/parts/t/partition_alter2_1_1_innodb.test
+++ b/mysql-test/suite/parts/t/partition_alter2_1_1_innodb.test
@@ -50,6 +50,9 @@ let $only_part_1= 1;
# The server must support partitioning.
--source include/have_partition.inc
+# This test takes long time, so only run it with the --big mtr-flag.
+--source include/big_test.inc
+
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_alter2_1_2_innodb.test b/mysql-test/suite/parts/t/partition_alter2_1_2_innodb.test
index 28bbcb3115b..6448a8ac734 100644
--- a/mysql-test/suite/parts/t/partition_alter2_1_2_innodb.test
+++ b/mysql-test/suite/parts/t/partition_alter2_1_2_innodb.test
@@ -45,6 +45,9 @@ let $only_part_2= 1;
# The server must support partitioning.
--source include/have_partition.inc
+# This test takes long time, so only run it with the --big mtr-flag.
+--source include/big_test.inc
+
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_alter2_2_2_innodb.test b/mysql-test/suite/parts/t/partition_alter2_2_2_innodb.test
index a356b4e31a3..e3544c382a3 100644
--- a/mysql-test/suite/parts/t/partition_alter2_2_2_innodb.test
+++ b/mysql-test/suite/parts/t/partition_alter2_2_2_innodb.test
@@ -45,6 +45,9 @@ let $only_part_2= 1;
# The server must support partitioning.
--source include/have_partition.inc
+# This test takes long time, so only run it with the --big mtr-flag.
+--source include/big_test.inc
+
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_alter4_innodb.test b/mysql-test/suite/parts/t/partition_alter4_innodb.test
index 46883c390af..624c1a0d6b8 100644
--- a/mysql-test/suite/parts/t/partition_alter4_innodb.test
+++ b/mysql-test/suite/parts/t/partition_alter4_innodb.test
@@ -48,6 +48,9 @@ let $more_pk_ui_tests= 0;
# The server must support partitioning.
--source include/have_partition.inc
+# This test takes long time, so only run it with the --big mtr-flag.
+--source include/big_test.inc
+
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
diff --git a/mysql-test/suite/parts/t/partition_auto_increment_ndb.test b/mysql-test/suite/parts/t/partition_auto_increment_ndb.test
deleted file mode 100644
index 7aa3839762d..00000000000
--- a/mysql-test/suite/parts/t/partition_auto_increment_ndb.test
+++ /dev/null
@@ -1,41 +0,0 @@
-################################################################################
-# t/partition_auto_increment_ndb.test #
-# #
-# Purpose: #
-# Tests around auto increment column #
-# NDB branch #
-# #
-# Note: NDB behavior for auto_increment on secondary column in #
-# multi-column-index is NOT like MyISAM, instead it uses the same #
-# behavior as if it was the primary column. #
-#------------------------------------------------------------------------------#
-# Original Author: MattiasJ #
-# Original Date: 2008-09-02 #
-# Change Author: #
-# Change Date: #
-# Change: #
-################################################################################
-
-#
-# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-
-# The server must support partitioning.
---source include/have_partition.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
---source include/have_ndb.inc
-
-##### Storage engine to be tested
-let $engine= 'NDB';
-connection default;
-#enable hash partitioning
-SET new=on;
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_auto_increment.inc
-
diff --git a/mysql-test/suite/parts/t/partition_basic_ndb.test b/mysql-test/suite/parts/t/partition_basic_ndb.test
deleted file mode 100644
index 48e569006de..00000000000
--- a/mysql-test/suite/parts/t/partition_basic_ndb.test
+++ /dev/null
@@ -1,92 +0,0 @@
-################################################################################
-# t/partition_basic_ndb.test #
-# #
-# Purpose: #
-# Tests around Create Partitioned table #
-# NDB branch #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: mleich #
-# Original Date: 2006-03-05 #
-# Change Author: #
-# Change Date: #
-# Change: #
-################################################################################
-
-#
-# NOTE: PLEASE DO NOT ADD NOT NDB SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
-
-##### Options, for debugging support #####
-let $debug= 0;
-let $with_partitioning= 1;
-
-##### Option, for displaying files #####
-let $ls= 1;
-
-##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
-# on partioned tables
-SET @max_row = 20;
-
-##### Execute more tests #####
-let $more_trigger_tests= 0;
-let $more_pk_ui_tests= 0;
-
-# The server must support partitioning. But NDB is partitioned from the start.
-# Thats why the next line is set to comment.
-# --source include/have_partition.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-let $engine= 'ndbcluster';
-connection default;
-
-# range, list and hash partitioning in ndb requires new_mode
---disable_query_log
-set new=on;
---enable_query_log
-##### Execute the test of "table" files
-# NDB has no files per PK, UI, ...
-let $do_file_tests= 0;
-
-##### Execute PRIMARY KEY tests #####
-# AFAIK NDB is always partitioned using the explicit defined PRIMARY KEY
-# or uses an internal one.
-let $do_pk_tests= 1;
-
-##### Assign a big number smaller than the maximum value for partitions #####
-# and smaller than the maximum value of SIGNED INTEGER
-# The NDB handler only supports 32 bit integers in VALUES
-# 2147483647 seems to be too big.
-let $MAX_VALUE= (2147483646);
-
-# Generate the prerequisites ($variables, @variables, tables) needed
---source suite/parts/inc/partition.pre
-
-##### Workarounds for known open engine specific bugs
-# Bug#18730 Partitions: NDB, crash on SELECT MIN(<unique column>)
-let $fixed_bug18730= 1;
-# Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response
-let $fixed_bug18735= 0;
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_basic.inc
-
-#------------------------------------------------------------------------------#
-# Execute storage engine specific tests
-
-#------------------------------------------------------------------------------#
-# Cleanup
---source suite/parts/inc/partition_cleanup.inc
diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
index 915a3f2ceb6..fce26132030 100644
--- a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
+++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
@@ -56,6 +56,7 @@ partition by range (a)
insert into t1 values (1), (11), (21), (33);
SELECT * FROM t1;
SHOW CREATE TABLE t1;
+--replace_result #p# #P# #sp# #SP#
--list_files $MYSQLD_DATADIR/test
SET DEBUG_SYNC='before_open_in_get_all_tables SIGNAL parked WAIT_FOR open';
@@ -78,6 +79,7 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
disconnect con1;
connection default;
--reap
+--replace_result #p# #P# #sp# #SP#
--list_files $MYSQLD_DATADIR/test
SHOW CREATE TABLE t1;
SELECT * FROM t1;
diff --git a/mysql-test/suite/parts/t/partition_engine_ndb.test b/mysql-test/suite/parts/t/partition_engine_ndb.test
deleted file mode 100644
index 40d031eab69..00000000000
--- a/mysql-test/suite/parts/t/partition_engine_ndb.test
+++ /dev/null
@@ -1,88 +0,0 @@
-################################################################################
-# t/partition_engine_ndb.test #
-# #
-# Purpose: #
-# Tests around Create/Alter partitioned tables and storage engine settings #
-# NDB branch #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: mleich #
-# Original Date: 2006-03-05 #
-# Change Author: #
-# Change Date: #
-# Change: #
-################################################################################
-
-#
-# NOTE: PLEASE DO NOT ADD NOT NDB SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
-
-##### Options, for debugging support #####
-let $debug= 0;
-
-##### Option, for displaying files #####
-let $ls= 1;
-
-##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
-# on partioned tables
-SET @max_row = 20;
-
-##### Execute more tests #####
-let $more_trigger_tests= 0;
-let $more_pk_ui_tests= 0;
-
-# The server must support partitioning. But NDB is partitioned from the start.
-# Thats why the next line is set to comment.
-# --source include/have_partition.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-
-##### Storage engine to be tested
-let $engine= 'ndbcluster';
---source include/have_ndb.inc
-connection default;
-
-# range, list and hash partitioning in ndb requires new_mode
---disable_query_log
-set new=on;
---enable_query_log
-##### Execute the test of "table" files
-# NDB has no files per PK, UI, ...
-let $do_file_tests= 0;
-
-##### Execute PRIMARY KEY tests #####
-# AFAIK NDB is always partitioned using the explicit defined PRIMARY KEY
-# or uses an internal one.
-let $do_pk_tests= 1;
-
-##### Assign a big number smaller than the maximum value for partitions #####
-# and smaller than the maximum value of SIGNED INTEGER
-# The NDB handler only supports 32 bit integers in VALUES
-# 2147483647 seems to be too big.
-let $MAX_VALUE= (2147483646);
-
-# Generate the prerequisites ($variables, @variables, tables) needed
---source suite/parts/inc/partition.pre
-
-##### Workarounds for known open engine specific bugs
-# none
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_engine.inc
-
-#------------------------------------------------------------------------------#
-# Execute storage engine specific tests
-
-#------------------------------------------------------------------------------#
-# Cleanup
---source suite/parts/inc/partition_cleanup.inc
diff --git a/mysql-test/suite/parts/t/partition_int_ndb.test b/mysql-test/suite/parts/t/partition_int_ndb.test
deleted file mode 100644
index 5e464ff75b5..00000000000
--- a/mysql-test/suite/parts/t/partition_int_ndb.test
+++ /dev/null
@@ -1,54 +0,0 @@
-################################################################################
-# t/partition_int_ndb.test #
-# #
-# Purpose: #
-# Tests around integer type #
-# NDB branch #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: HH #
-# Original Date: 2006-08-01 #
-# Change Author: #
-# Change Date: #
-# Change: #
-################################################################################
-
-#
-# NOTE: PLEASE DO NOT ADD NOT NDB SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
-
-##### Options, for debugging support #####
-let $debug= 0;
-
-# The server must support partitioning.
---source include/have_partition.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-let $engine= 'NDB';
-connection default;
-
-##### max rows to be inserted
-let $maxrows=1024;
-# range, list and hash partitioning in ndb requires new_mode
---disable_query_log
-set new=on;
---enable_query_log
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_tinyint.inc
---source suite/parts/inc/partition_smallint.inc
---source suite/parts/inc/partition_int.inc
---source suite/parts/inc/partition_mediumint.inc
---source suite/parts/inc/partition_bigint.inc
diff --git a/mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test b/mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test
deleted file mode 100644
index 736e45067bc..00000000000
--- a/mysql-test/suite/parts/t/partition_mgm_lc0_ndb.test
+++ /dev/null
@@ -1,49 +0,0 @@
-################################################################################
-# t/partition_mgm_lc0_ndb.test #
-# #
-# Purpose: #
-# Test of partitioning management functions (incl upper/lower case names): #
-# NDB branch + lower_case_table_names = 0 #
-# (usually Unix like, apart from Mac OS X) #
-# Also requires lower_case_file_system OFF #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: mattiasj #
-# Original Date: 2008-06-27 #
-################################################################################
-
-# The server must support partitioning.
---source include/have_partition.inc
-
-#
-# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
---source include/have_lowercase0.inc
---source include/have_case_sensitive_file_system.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-let $have_bug33158= 1;
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-connection default;
-# Use either $can_only_key or new=on option to run test.
-let $can_only_key= 1;
-# Allow hash/list/range partitioning with ndb
-#SET new=on;
-let $engine= 'NDBCluster';
-# NDB does not yet support TRUNCATE PARTITION
-let $no_truncate= 1;
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_mgm.inc
diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_ndb-master.opt b/mysql-test/suite/parts/t/partition_mgm_lc1_ndb-master.opt
deleted file mode 100644
index 62ab6dad1e0..00000000000
--- a/mysql-test/suite/parts/t/partition_mgm_lc1_ndb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=1
diff --git a/mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test b/mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test
deleted file mode 100644
index ac425eb84ff..00000000000
--- a/mysql-test/suite/parts/t/partition_mgm_lc1_ndb.test
+++ /dev/null
@@ -1,46 +0,0 @@
-################################################################################
-# t/partition_mgm_lc1_ndb.test #
-# #
-# Purpose: #
-# Test of partitioning management functions (incl upper/lower case names): #
-# NDB branch + lower_case_table_names = 1 (usually Windows) #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: mattiasj #
-# Original Date: 2008-06-27 #
-################################################################################
-
-# The server must support partitioning.
---source include/have_partition.inc
-
-#
-# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
---source include/have_lowercase1.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-let $have_bug33158= 1;
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-connection default;
-# Use either $can_only_key or new=on option to run test.
-let $can_only_key= 1;
-# Allow hash/list/range partitioning with ndb
-#SET new=on;
-let $engine= 'NDBCluster';
-# NDB does not yet support TRUNCATE PARTITION
-let $no_truncate= 1;
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_mgm.inc
diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_ndb-master.opt b/mysql-test/suite/parts/t/partition_mgm_lc2_ndb-master.opt
deleted file mode 100644
index f18979f5a6a..00000000000
--- a/mysql-test/suite/parts/t/partition_mgm_lc2_ndb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---lower_case_table_names=2
diff --git a/mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test b/mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test
deleted file mode 100644
index 725ba3b5e74..00000000000
--- a/mysql-test/suite/parts/t/partition_mgm_lc2_ndb.test
+++ /dev/null
@@ -1,45 +0,0 @@
-################################################################################
-# t/partition_mgm_lc2_ndb.test #
-# #
-# Purpose: #
-# Test of partitioning management functions (incl upper/lower case names): #
-# NDB branch + lower_case_table_names = 2 (usually Mac OS X) #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: mattiasj #
-# Original Date: 2008-06-27 #
-################################################################################
-
-# The server must support partitioning.
---source include/have_partition.inc
-
-#
-# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
---source include/have_lowercase2.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-connection default;
-# Use either $can_only_key or new=on option to run test.
-let $can_only_key= 1;
-# Allow hash/list/range partitioning with ndb
-#SET new=on;
-let $engine= 'NDBCluster';
-# NDB does not yet support TRUNCATE PARTITION
-let $no_truncate= 1;
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_mgm.inc
diff --git a/mysql-test/suite/parts/t/partition_recover_myisam.test b/mysql-test/suite/parts/t/partition_recover_myisam.test
index c96cd938f8b..fc121b7408f 100644
--- a/mysql-test/suite/parts/t/partition_recover_myisam.test
+++ b/mysql-test/suite/parts/t/partition_recover_myisam.test
@@ -1,9 +1,7 @@
# test the auto-recover (--myisam-recover) of partitioned myisam tables
---disable_query_log
call mtr.add_suppression("..test.t1_will_crash");
call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc");
---enable_query_log
--source include/have_partition.inc
--disable_warnings
@@ -22,9 +20,10 @@ FLUSH TABLES;
let $MYSQLD_DATADIR= `select @@datadir`;
--remove_file $MYSQLD_DATADIR/test/t1_will_crash.MYI
--copy_file std_data/corrupt_t1.MYI $MYSQLD_DATADIR/test/t1_will_crash.MYI
-# Embedded server doesn't chdir to data directory
---replace_regex /Table '.*\/data\/test\/t1_will_crash/Table '.\/test\/t1_will_crash/
--enable_prepare_warnings
+# Embedded server doesn't chdir to data directory
+--replace_result \\ /
+--replace_regex /Table '.*data/Table './
SELECT * FROM t1_will_crash;
--disable_prepare_warnings
DROP TABLE t1_will_crash;
@@ -39,9 +38,10 @@ FLUSH TABLES;
--echo # head -c1024 t1#P#p1.MYI > corrupt_t1#P#p1.MYI
--remove_file $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI
--copy_file std_data/corrupt_t1#P#p1.MYI $MYSQLD_DATADIR/test/t1_will_crash#P#p1.MYI
-# Embedded server doesn't chdir to data directory
---replace_regex /Table '.*\/data\/test\/t1_will_crash/Table '.\/test\/t1_will_crash/
--enable_prepare_warnings
+# Embedded server doesn't chdir to data directory
+--replace_result \\ /
+--replace_regex /Table '.*data/Table './
SELECT * FROM t1_will_crash;
--disable_prepare_warnings
DROP TABLE t1_will_crash;
diff --git a/mysql-test/suite/parts/t/partition_special_innodb.test b/mysql-test/suite/parts/t/partition_special_innodb.test
index e5622237efc..1fc9ac7fafc 100644
--- a/mysql-test/suite/parts/t/partition_special_innodb.test
+++ b/mysql-test/suite/parts/t/partition_special_innodb.test
@@ -58,8 +58,8 @@ ENGINE = InnoDB
PARTITION BY HASH (a)
PARTITIONS 2;
-connect (con1,localhost,root,,test,$MASTER_MYPORT,);
-connect (con2,localhost,root,,test,$MASTER_MYPORT,);
+connect (con1, localhost, root,,);
+connect (con2, localhost, root,,);
--connection con1
SET autocommit=OFF;
@@ -111,7 +111,7 @@ LOCK TABLE t1 READ;
--echo # Third attempt: says that the table does not exist
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
---echo # Check table returns the same
+--echo # Check table returns the same (not after fixing bug#56172!)
CHECK TABLE t1;
--connection con1
diff --git a/mysql-test/suite/parts/t/partition_special_myisam.test b/mysql-test/suite/parts/t/partition_special_myisam.test
index 032722cbb7d..2eac5b3bf16 100644
--- a/mysql-test/suite/parts/t/partition_special_myisam.test
+++ b/mysql-test/suite/parts/t/partition_special_myisam.test
@@ -62,13 +62,14 @@ ALTER TABLE t1 COALESCE PARTITION 2;
--connect (con3,localhost,root,,)
-perl;
-open( LD, ">" . "/tmp/load.in" ) || die "Could not open file for writing " . $ENV{'MYSQLTEST_DATADIR'} . "/test/load.in";
-print LD "1\n2\n3\n";
-close( LD );
+--let $MYSQLD_DATADIR= `SELECT @@datadir`
+--write_file $MYSQLD_DATADIR/test/load.in
+1
+2
+3
EOF
--echo # Connection 3 tries to load into the table:
-send LOAD DATA LOCAL INFILE '/tmp/load.in' INTO TABLE t1 (f);
+send LOAD DATA INFILE 'load.in' INTO TABLE t1 (f);
--connection default
--real_sleep 1
diff --git a/mysql-test/suite/parts/t/partition_syntax_ndb.test b/mysql-test/suite/parts/t/partition_syntax_ndb.test
deleted file mode 100644
index c783e9f602e..00000000000
--- a/mysql-test/suite/parts/t/partition_syntax_ndb.test
+++ /dev/null
@@ -1,89 +0,0 @@
-################################################################################
-# t/partition_syntax_ndb.test #
-# #
-# Purpose: #
-# Tests around Create Partitioned table syntax #
-# NDB branch #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: mleich #
-# Original Date: 2006-03-05 #
-# Change Author: #
-# Change Date: #
-# Change: #
-################################################################################
-
-#
-# NOTE: PLEASE DO NOT ADD NOT NDB SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
-
-##### Options, for debugging support #####
-let $debug= 0;
-
-##### Option, for displaying files #####
-let $ls= 1;
-
-##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
-# on partioned tables
-SET @max_row = 20;
-
-##### Execute more tests #####
-let $more_trigger_tests= 0;
-let $more_pk_ui_tests= 0;
-
-# The server must support partitioning. But NDB is partitioned from the start.
-# Thats why the next line is set to comment.
-# --source include/have_partition.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-let $engine= 'ndbcluster';
-connection default;
-
-# range, list and hash partitioning in ndb requires new_mode
---disable_query_log
-set new=on;
---enable_query_log
-##### Execute the test of "table" files
-# NDB has no files per PK, UI, ...
-let $do_file_tests= 0;
-
-##### Execute PRIMARY KEY tests #####
-# AFAIK NDB is always partitioned using the explicit defined PRIMARY KEY
-# or uses an internal one.
-let $do_pk_tests= 1;
-
-##### Assign a big number smaller than the maximum value for partitions #####
-# and smaller than the maximum value of SIGNED INTEGER
-# The NDB handler only supports 32 bit integers in VALUES
-# 2147483647 seems to be too big.
-let $MAX_VALUE= (2147483646);
-
-# Generate the prerequisites ($variables, @variables, tables) needed
---source suite/parts/inc/partition.pre
-
-##### Workarounds for known open engine specific bugs
-# Bug#18735: Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response
-let $fixed_bug18735= 0;
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_syntax.inc
-
-#------------------------------------------------------------------------------#
-# Execute storage engine specific tests
-
-#------------------------------------------------------------------------------#
-# Cleanup
---source suite/parts/inc/partition_cleanup.inc
diff --git a/mysql-test/suite/parts/t/partition_value_ndb.test b/mysql-test/suite/parts/t/partition_value_ndb.test
deleted file mode 100644
index 80b4ba6fb64..00000000000
--- a/mysql-test/suite/parts/t/partition_value_ndb.test
+++ /dev/null
@@ -1,94 +0,0 @@
-################################################################################
-# t/partition_value_ndb.test #
-# #
-# Purpose: #
-# Tests around "exotic" values calculated by the partitioning function #
-# NDB branch #
-# #
-#------------------------------------------------------------------------------#
-# Original Author: mleich #
-# Original Date: 2006-04-11 #
-# Change Author: mleich #
-# Change Date: 2008-12-08 #
-# Change: Remove test from disabled.def + change test that it gets skipped #
-################################################################################
-
-#
-# NOTE: PLEASE DO NOT ADD NOT NDB SPECIFIC TESTCASES HERE !
-# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
-# THE SOURCED FILES ONLY.
-#
-# Please read the README at the end of inc/partition.pre before changing
-# any of the variables.
-#
-
-#
-# CAST() within the partitioning function si no more supported, but we get
-# this functionality probably soon again. Therefor we do not delete this test.
---skip # CAST() in partitioning function is currently not supported.
-
-
-#------------------------------------------------------------------------------#
-# General not engine specific settings and requirements
-
-##### Options, for debugging support #####
-let $debug= 0;
-
-##### Option, for displaying files #####
-let $ls= 1;
-
-##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
-# on partioned tables
-SET @max_row = 20;
-
-##### Execute more tests #####
-let $more_trigger_tests= 0;
-let $more_pk_ui_tests= 0;
-
-# The server must support partitioning. But NDB is partitioned from the start.
-# Thats why the next line is set to comment.
-# --source include/have_partition.inc
-
-#------------------------------------------------------------------------------#
-# Engine specific settings and requirements
-
-##### Storage engine to be tested
---source include/have_ndb.inc
-let $engine= 'ndbcluster';
-connection default;
-
-# range, list and hash partitioning in ndb requires new_mode
---disable_query_log
-set new=on;
---enable_query_log
-##### Execute the test of "table" files
-# NDB has no files per PK, UI, ...
-let $do_file_tests= 0;
-
-##### Execute PRIMARY KEY tests #####
-# AFAIK NDB is always partitioned using the explicit defined PRIMARY KEY
-# or uses an internal one.
-let $do_pk_tests= 1;
-
-##### Assign a big number smaller than the maximum value for partitions #####
-# and smaller than the maximum value of SIGNED INTEGER
-# The NDB handler only supports 32 bit integers in VALUES
-# 2147483647 seems to be too big.
-let $MAX_VALUE= (2147483646);
-
-# Generate the prerequisites ($variables, @variables, tables) needed
---source suite/parts/inc/partition.pre
-
-##### Workarounds for known open engine specific bugs
-# none
-
-#------------------------------------------------------------------------------#
-# Execute the tests to be applied to all storage engines
---source suite/parts/inc/partition_value.inc
-
-#------------------------------------------------------------------------------#
-# Execute storage engine specific tests
-
-#------------------------------------------------------------------------------#
-# Cleanup
---source suite/parts/inc/partition_cleanup.inc
diff --git a/mysql-test/suite/parts/t/rpl_partition.test b/mysql-test/suite/parts/t/rpl_partition.test
index 0de73cd9a73..b0f8b0bf55a 100644
--- a/mysql-test/suite/parts/t/rpl_partition.test
+++ b/mysql-test/suite/parts/t/rpl_partition.test
@@ -26,13 +26,6 @@ select @@global.binlog_format, @@session.binlog_format;
--echo [on master]
connection master;
---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),
@@ -154,7 +147,6 @@ 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;
@@ -167,12 +159,13 @@ connection master;
set @@global.binlog_format= @old_global_binlog_format;
set @@session.binlog_format= @old_session_binlog_format;
DROP TABLE t1, t2, t3;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS p2;
-DROP PROCEDURE IF EXISTS p3;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
--echo [on slave]
sync_slave_with_master;
set @@global.binlog_format= @old_global_binlog_format;
set @@session.binlog_format= @old_session_binlog_format;
# End of 5.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/perfschema/include/binlog_common.inc b/mysql-test/suite/perfschema/include/binlog_common.inc
index 10afe54ab5b..bbe09de3e19 100644
--- a/mysql-test/suite/perfschema/include/binlog_common.inc
+++ b/mysql-test/suite/perfschema/include/binlog_common.inc
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -10,19 +10,24 @@
# 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
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
# Tests for PERFORMANCE_SCHEMA
RESET MASTER;
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO'
- where name like "wait/synch/rwlock/%";
+# Note:
+# Do not include records that could depend on
+# compiling options (storage engines, SSL),
+# to ensure the expected output in the binlog is predictable.
+update performance_schema.setup_instruments set enabled='NO'
+ where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
-select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT;
+select count(*) > 0 from performance_schema.events_waits_current;
--disable_warnings
drop table if exists test.t1;
@@ -33,17 +38,19 @@ create table test.t1 (thread_id integer);
create table test.t2 (name varchar(128));
insert into test.t1
- select thread_id from performance_schema.EVENTS_WAITS_CURRENT;
+ select thread_id from performance_schema.events_waits_current;
insert into test.t2
- select name from performance_schema.SETUP_INSTRUMENTS
- where name like "wait/synch/rwlock/%";
+ select name from performance_schema.setup_instruments
+ where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
drop table test.t1;
drop table test.t2;
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
- where name like "wait/synch/rwlock/%";
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
--source include/show_binlog_events.inc
diff --git a/mysql-test/suite/perfschema/include/cleanup_helper.inc b/mysql-test/suite/perfschema/include/cleanup_helper.inc
index 5c2429ddb97..b7e37849f78 100644
--- a/mysql-test/suite/perfschema/include/cleanup_helper.inc
+++ b/mysql-test/suite/perfschema/include/cleanup_helper.inc
@@ -15,7 +15,7 @@
# Tests for PERFORMANCE_SCHEMA
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+update performance_schema.setup_instruments set enabled='YES';
disconnect con1;
disconnect con2;
diff --git a/mysql-test/suite/perfschema/include/privilege.inc b/mysql-test/suite/perfschema/include/privilege.inc
index ef2acc995d5..f29ef65f519 100644
--- a/mysql-test/suite/perfschema/include/privilege.inc
+++ b/mysql-test/suite/perfschema/include/privilege.inc
@@ -32,48 +32,48 @@ drop table if exists test.t1;
## drop table performance_schema.t1;
##
## --error ER_DBACCESS_DENIED_ERROR
-## create table performance_schema.SETUP_INSTRUMENTS(a int);
+## create table performance_schema.setup_instruments(a int);
##
## --error ER_DBACCESS_DENIED_ERROR
-## create table performance_schema.EVENTS_WAITS_CURRENT(a int);
+## create table performance_schema.events_waits_current(a int);
##
## --error ER_DBACCESS_DENIED_ERROR
-## create table performance_schema.FILE_INSTANCES(a int);
+## create table performance_schema.file_instances(a int);
##
## --error ER_DBACCESS_DENIED_ERROR
-## drop table performance_schema.SETUP_INSTRUMENTS;
+## drop table performance_schema.setup_instruments;
##
## --error ER_DBACCESS_DENIED_ERROR
-## drop table performance_schema.EVENTS_WAITS_CURRENT;
+## drop table performance_schema.events_waits_current;
##
## --error ER_DBACCESS_DENIED_ERROR
-## drop table performance_schema.FILE_INSTANCES;
+## drop table performance_schema.file_instances;
--error ER_DBACCESS_DENIED_ERROR
-rename table performance_schema.SETUP_INSTRUMENTS to test.t1;
+rename table performance_schema.setup_instruments to test.t1;
--error ER_DBACCESS_DENIED_ERROR
-rename table performance_schema.EVENTS_WAITS_CURRENT to test.t1;
+rename table performance_schema.events_waits_current to test.t1;
--error ER_DBACCESS_DENIED_ERROR
-rename table performance_schema.FILE_INSTANCES to test.t1;
+rename table performance_schema.file_instances to test.t1;
--error ER_DBACCESS_DENIED_ERROR
-rename table performance_schema.SETUP_INSTRUMENTS to performance_schema.t1;
+rename table performance_schema.setup_instruments to performance_schema.t1;
--error ER_DBACCESS_DENIED_ERROR
-rename table performance_schema.EVENTS_WAITS_CURRENT to performance_schema.t1;
+rename table performance_schema.events_waits_current to performance_schema.t1;
--error ER_DBACCESS_DENIED_ERROR
-rename table performance_schema.FILE_INSTANCES to performance_schema.t1;
+rename table performance_schema.file_instances to performance_schema.t1;
--error ER_DBACCESS_DENIED_ERROR
-rename table performance_schema.SETUP_INSTRUMENTS
- to performance_schema.EVENTS_WAITS_CURRENT;
+rename table performance_schema.setup_instruments
+ to performance_schema.events_waits_current;
--error ER_DBACCESS_DENIED_ERROR
-rename table performance_schema.EVENTS_WAITS_CURRENT
- to performance_schema.SETUP_INSTRUMENTS;
+rename table performance_schema.events_waits_current
+ to performance_schema.setup_instruments;
--error ER_DBACCESS_DENIED_ERROR
create procedure performance_schema.my_proc() begin end;
@@ -87,108 +87,93 @@ do begin end;
--error ER_DBACCESS_DENIED_ERROR
create trigger performance_schema.bi_setup_instruments
- before insert on performance_schema.SETUP_INSTRUMENTS
+ before insert on performance_schema.setup_instruments
for each row begin end;
--error ER_DBACCESS_DENIED_ERROR
create trigger performance_schema.bi_events_waits_current
- before insert on performance_schema.EVENTS_WAITS_CURRENT
+ before insert on performance_schema.events_waits_current
for each row begin end;
--error ER_DBACCESS_DENIED_ERROR
create trigger performance_schema.bi_file_instances
- before insert on performance_schema.FILE_INSTANCES
+ before insert on performance_schema.file_instances
for each row begin end;
---error ER_WRONG_PERFSCHEMA_USAGE
+--error ER_CANT_CREATE_TABLE
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
---error ER_WRONG_PERFSCHEMA_USAGE
-create table test.t1 like performance_schema.SETUP_INSTRUMENTS;
+--error ER_CANT_CREATE_TABLE
+create table test.t1 like performance_schema.setup_instruments;
---error ER_WRONG_PERFSCHEMA_USAGE
-create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT;
+--error ER_CANT_CREATE_TABLE
+create table test.t1 like performance_schema.events_waits_current;
---error ER_WRONG_PERFSCHEMA_USAGE
-create table test.t1 like performance_schema.FILE_INSTANCES;
+--error ER_CANT_CREATE_TABLE
+create table test.t1 like performance_schema.file_instances;
---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.SETUP_INSTRUMENTS
+insert into performance_schema.setup_instruments
set name="foo";
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.EVENTS_WAITS_CURRENT
+insert into performance_schema.events_waits_current
set name="foo";
---replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.FILE_INSTANCES
+insert into performance_schema.file_instances
set name="foo";
---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.SETUP_INSTRUMENTS;
+delete from performance_schema.setup_instruments;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_CURRENT;
+delete from performance_schema.events_waits_current;
---replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.FILE_INSTANCES;
+delete from performance_schema.file_instances;
-lock table performance_schema.SETUP_INSTRUMENTS read;
+lock table performance_schema.setup_instruments read;
unlock tables;
-lock table performance_schema.SETUP_INSTRUMENTS write;
+lock table performance_schema.setup_instruments write;
unlock tables;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-lock table performance_schema.EVENTS_WAITS_CURRENT read;
+lock table performance_schema.events_waits_current read;
unlock tables;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-lock table performance_schema.EVENTS_WAITS_CURRENT write;
+lock table performance_schema.events_waits_current write;
unlock tables;
---replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-lock table performance_schema.FILE_INSTANCES read;
+lock table performance_schema.file_instances read;
unlock tables;
---replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-lock table performance_schema.FILE_INSTANCES write;
+lock table performance_schema.file_instances write;
unlock tables;
--echo #
--echo # WL#4818, NFS2: Can use grants to give normal user access
---echo # to view data from _CURRENT and _HISTORY tables
+--echo # to view data from _current and _history tables
--echo #
--echo # Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3.
---echo # (Except for EVENTS_WAITS_CURRENT, which is granted.)
+--echo # (Except for events_waits_current, which is granted.)
# Errors here will be caught by the diff afterwards
--disable_abort_on_error
---replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY LIMIT 1;
+SELECT "can select" FROM performance_schema.events_waits_history LIMIT 1;
---replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY_LONG LIMIT 1;
+SELECT "can select" FROM performance_schema.events_waits_history_long LIMIT 1;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_CURRENT LIMIT 1;
+SELECT "can select" FROM performance_schema.events_waits_current LIMIT 1;
---replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE LIMIT 1;
+SELECT "can select" FROM performance_schema.events_waits_summary_by_instance LIMIT 1;
---replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
-SELECT "can select" FROM performance_schema.FILE_SUMMARY_BY_INSTANCE LIMIT 1;
+SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
--enable_abort_on_error
diff --git a/mysql-test/suite/perfschema/include/setup_helper.inc b/mysql-test/suite/perfschema/include/setup_helper.inc
index 1c8d4e412d5..cdbfd81a24c 100644
--- a/mysql-test/suite/perfschema/include/setup_helper.inc
+++ b/mysql-test/suite/perfschema/include/setup_helper.inc
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -10,8 +10,8 @@
# 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
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
# Tests for PERFORMANCE_SCHEMA
@@ -19,24 +19,24 @@ let $MYSQLD_DATADIR= `select @@datadir`;
let $MYSQLD_TMPDIR= `select @@tmpdir`;
--disable_query_log
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_CONSUMERS set enabled='YES';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_consumers set enabled='YES';
--enable_query_log
connect (con1, localhost, root, , );
-let $con1_THREAD_ID=`select thread_id from performance_schema.THREADS
- where ID in (select connection_id())`;
+let $con1_THREAD_ID=`select thread_id from performance_schema.threads
+ where PROCESSLIST_ID = connection_id()`;
connect (con2, localhost, root, , );
-let $con2_THREAD_ID=`select thread_id from performance_schema.THREADS
- where ID in (select connection_id())`;
+let $con2_THREAD_ID=`select thread_id from performance_schema.threads
+ where PROCESSLIST_ID = connection_id()`;
connect (con3, localhost, root, , );
-let $con3_THREAD_ID=`select thread_id from performance_schema.THREADS
- where ID in (select connection_id())`;
+let $con3_THREAD_ID=`select thread_id from performance_schema.threads
+ where PROCESSLIST_ID = connection_id()`;
connection default;
@@ -45,10 +45,10 @@ prepare stmt_dump_events from
"select event_name,
left(source, locate(\":\", source)) as short_source,
operation, number_of_bytes
- from performance_schema.EVENTS_WAITS_HISTORY_LONG
+ from performance_schema.events_waits_history_long
where thread_id=? order by event_id;";
prepare stmt_dump_thread from
- "select name from performance_schema.THREADS where thread_id=? ;";
+ "select name from performance_schema.threads where thread_id=? ;";
--enable_query_log
diff --git a/mysql-test/suite/perfschema/include/start_server_common.inc b/mysql-test/suite/perfschema/include/start_server_common.inc
index 083b302c5f7..f6e549ea44e 100644
--- a/mysql-test/suite/perfschema/include/start_server_common.inc
+++ b/mysql-test/suite/perfschema/include/start_server_common.inc
@@ -17,31 +17,31 @@
show databases;
-select count(*) from performance_schema.PERFORMANCE_TIMERS;
-select count(*) from performance_schema.SETUP_CONSUMERS;
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
-select count(*) from performance_schema.SETUP_TIMERS;
+select count(*) from performance_schema.performance_timers;
+select count(*) from performance_schema.setup_consumers;
+select count(*) > 0 from performance_schema.setup_instruments;
+select count(*) from performance_schema.setup_timers;
# Make sure we don't crash, no matter what the starting parameters are
--disable_result_log
-select * from performance_schema.COND_INSTANCES;
-select * from performance_schema.EVENTS_WAITS_CURRENT;
-select * from performance_schema.EVENTS_WAITS_HISTORY;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-select * from performance_schema.FILE_INSTANCES;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.RWLOCK_INSTANCES;
-select * from performance_schema.SETUP_CONSUMERS;
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_TIMERS;
-select * from performance_schema.THREADS;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.threads;
--enable_result_log
# This has a stable output, printing the result:
diff --git a/mysql-test/suite/perfschema/r/aggregate.result b/mysql-test/suite/perfschema/r/aggregate.result
index c7ac05ba69d..edc7ce0bcca 100644
--- a/mysql-test/suite/perfschema/r/aggregate.result
+++ b/mysql-test/suite/perfschema/r/aggregate.result
@@ -1,87 +1,87 @@
"General cleanup"
drop table if exists t1;
-update performance_schema.SETUP_INSTRUMENTS set enabled = 'NO';
-update performance_schema.SETUP_CONSUMERS set enabled = 'NO';
-truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE;
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-update performance_schema.SETUP_CONSUMERS set enabled = 'YES';
-update performance_schema.SETUP_INSTRUMENTS
+update performance_schema.setup_instruments set enabled = 'NO';
+update performance_schema.setup_consumers set enabled = 'NO';
+truncate table performance_schema.file_summary_by_event_name;
+truncate table performance_schema.file_summary_by_instance;
+truncate table performance_schema.events_waits_summary_global_by_event_name;
+truncate table performance_schema.events_waits_summary_by_instance;
+truncate table performance_schema.events_waits_summary_by_thread_by_event_name;
+update performance_schema.setup_consumers set enabled = 'YES';
+update performance_schema.setup_instruments
set enabled = 'YES', timed = 'YES';
create table t1 (
id INT PRIMARY KEY,
b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
insert into t1 (id) values (1), (2), (3), (4), (5), (6), (7), (8);
-update performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO';
-update performance_schema.SETUP_CONSUMERS set enabled = 'NO';
+update performance_schema.setup_instruments SET enabled = 'NO';
+update performance_schema.setup_consumers set enabled = 'NO';
set @dump_all=FALSE;
"Verifying file aggregate consistency"
SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
-FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
-JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.file_summary_by_event_name AS e
+JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
OR @dump_all;
EVENT_NAME COUNT_READ SUM(i.COUNT_READ)
SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
-FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
-JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.file_summary_by_event_name AS e
+JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
OR @dump_all;
EVENT_NAME COUNT_WRITE SUM(i.COUNT_WRITE)
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ)
-FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
-JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.file_summary_by_event_name AS e
+JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_READ <> SUM(i.SUM_NUMBER_OF_BYTES_READ))
OR @dump_all;
EVENT_NAME SUM_NUMBER_OF_BYTES_READ SUM(i.SUM_NUMBER_OF_BYTES_READ)
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_WRITE, SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
-FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
-JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.file_summary_by_event_name AS e
+JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_WRITE <> SUM(i.SUM_NUMBER_OF_BYTES_WRITE))
OR @dump_all;
EVENT_NAME SUM_NUMBER_OF_BYTES_WRITE SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
"Verifying waits aggregate consistency (instance)"
SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
-JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.events_waits_summary_global_by_event_name AS e
+JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_TIMER_WAIT < SUM(i.SUM_TIMER_WAIT))
OR @dump_all;
EVENT_NAME SUM_TIMER_WAIT SUM(i.SUM_TIMER_WAIT)
SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
-JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.events_waits_summary_global_by_event_name AS e
+JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MIN_TIMER_WAIT > MIN(i.MIN_TIMER_WAIT))
AND (MIN(i.MIN_TIMER_WAIT) != 0)
OR @dump_all;
EVENT_NAME MIN_TIMER_WAIT MIN(i.MIN_TIMER_WAIT)
SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
-JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.events_waits_summary_global_by_event_name AS e
+JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MAX_TIMER_WAIT < MAX(i.MAX_TIMER_WAIT))
OR @dump_all;
EVENT_NAME MAX_TIMER_WAIT MAX(i.MAX_TIMER_WAIT)
"Verifying waits aggregate consistency (thread)"
SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(t.SUM_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
-JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
+FROM performance_schema.events_waits_summary_global_by_event_name AS e
+JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_TIMER_WAIT < SUM(t.SUM_TIMER_WAIT))
OR @dump_all;
EVENT_NAME SUM_TIMER_WAIT SUM(t.SUM_TIMER_WAIT)
SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
-JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
+FROM performance_schema.events_waits_summary_global_by_event_name AS e
+JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MIN_TIMER_WAIT > MIN(t.MIN_TIMER_WAIT))
@@ -89,14 +89,14 @@ AND (MIN(t.MIN_TIMER_WAIT) != 0)
OR @dump_all;
EVENT_NAME MIN_TIMER_WAIT MIN(t.MIN_TIMER_WAIT)
SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(t.MAX_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
-JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
+FROM performance_schema.events_waits_summary_global_by_event_name AS e
+JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MAX_TIMER_WAIT < MAX(t.MAX_TIMER_WAIT))
OR @dump_all;
EVENT_NAME MAX_TIMER_WAIT MAX(t.MAX_TIMER_WAIT)
-update performance_schema.SETUP_CONSUMERS set enabled = 'YES';
-update performance_schema.SETUP_INSTRUMENTS
+update performance_schema.setup_consumers set enabled = 'YES';
+update performance_schema.setup_instruments
set enabled = 'YES', timed = 'YES';
drop table test.t1;
diff --git a/mysql-test/suite/perfschema/r/binlog_mix.result b/mysql-test/suite/perfschema/r/binlog_mix.result
index 1e58179af51..3b2ab2bb435 100644
--- a/mysql-test/suite/perfschema/r/binlog_mix.result
+++ b/mysql-test/suite/perfschema/r/binlog_mix.result
@@ -1,11 +1,12 @@
set binlog_format=mixed;
RESET MASTER;
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO'
- where name like "wait/synch/rwlock/%";
-select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT;
+update performance_schema.setup_instruments set enabled='NO'
+ where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
+select count(*) > 0 from performance_schema.events_waits_current;
count(*) > 0
1
drop table if exists test.t1;
@@ -13,19 +14,20 @@ drop table if exists test.t2;
create table test.t1 (thread_id integer);
create table test.t2 (name varchar(128));
insert into test.t1
-select thread_id from performance_schema.EVENTS_WAITS_CURRENT;
+select thread_id from performance_schema.events_waits_current;
insert into test.t2
-select name from performance_schema.SETUP_INSTRUMENTS
-where name like "wait/synch/rwlock/%";
+select name from performance_schema.setup_instruments
+where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
drop table test.t1;
drop table test.t2;
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
- where name like "wait/synch/rwlock/%";
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (performance_schema.SETUP_INSTRUMENTS)
-master-bin.000001 # Update_rows # # table_id: #
+master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
@@ -43,7 +45,6 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */
master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (performance_schema.SETUP_INSTRUMENTS)
-master-bin.000001 # Update_rows # # table_id: #
+master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
diff --git a/mysql-test/suite/perfschema/r/binlog_row.result b/mysql-test/suite/perfschema/r/binlog_row.result
index 28803c73a84..644e5d58e23 100644
--- a/mysql-test/suite/perfschema/r/binlog_row.result
+++ b/mysql-test/suite/perfschema/r/binlog_row.result
@@ -1,11 +1,12 @@
set binlog_format=row;
RESET MASTER;
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO'
- where name like "wait/synch/rwlock/%";
-select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT;
+update performance_schema.setup_instruments set enabled='NO'
+ where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
+select count(*) > 0 from performance_schema.events_waits_current;
count(*) > 0
1
drop table if exists test.t1;
@@ -13,19 +14,20 @@ drop table if exists test.t2;
create table test.t1 (thread_id integer);
create table test.t2 (name varchar(128));
insert into test.t1
-select thread_id from performance_schema.EVENTS_WAITS_CURRENT;
+select thread_id from performance_schema.events_waits_current;
insert into test.t2
-select name from performance_schema.SETUP_INSTRUMENTS
-where name like "wait/synch/rwlock/%";
+select name from performance_schema.setup_instruments
+where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
drop table test.t1;
drop table test.t2;
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
- where name like "wait/synch/rwlock/%";
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (performance_schema.SETUP_INSTRUMENTS)
-master-bin.000001 # Update_rows # # table_id: #
+master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
@@ -43,7 +45,6 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */
master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (performance_schema.SETUP_INSTRUMENTS)
-master-bin.000001 # Update_rows # # table_id: #
+master-bin.000001 # Table_map # # table_id: # (performance_schema.setup_instruments)
master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
diff --git a/mysql-test/suite/perfschema/r/binlog_stmt.result b/mysql-test/suite/perfschema/r/binlog_stmt.result
index 288eba4d3d6..3fcecfdd1ca 100644
--- a/mysql-test/suite/perfschema/r/binlog_stmt.result
+++ b/mysql-test/suite/perfschema/r/binlog_stmt.result
@@ -1,14 +1,15 @@
set binlog_format=statement;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
RESET MASTER;
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO'
- where name like "wait/synch/rwlock/%";
+update performance_schema.setup_instruments set enabled='NO'
+ where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
-select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT;
+select count(*) > 0 from performance_schema.events_waits_current;
count(*) > 0
1
drop table if exists test.t1;
@@ -16,25 +17,28 @@ drop table if exists test.t2;
create table test.t1 (thread_id integer);
create table test.t2 (name varchar(128));
insert into test.t1
-select thread_id from performance_schema.EVENTS_WAITS_CURRENT;
+select thread_id from performance_schema.events_waits_current;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
insert into test.t2
-select name from performance_schema.SETUP_INSTRUMENTS
-where name like "wait/synch/rwlock/%";
+select name from performance_schema.setup_instruments
+where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
drop table test.t1;
drop table test.t2;
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
- where name like "wait/synch/rwlock/%";
+update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock");
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves.
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; update performance_schema.SETUP_INSTRUMENTS set enabled='NO'
- where name like "wait/synch/rwlock/%"
+master-bin.000001 # Query # # use `test`; update performance_schema.setup_instruments set enabled='NO'
+ where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock")
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by server */
@@ -42,16 +46,18 @@ master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id intege
master-bin.000001 # Query # # use `test`; create table test.t2 (name varchar(128))
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; insert into test.t1
-select thread_id from performance_schema.EVENTS_WAITS_CURRENT
+select thread_id from performance_schema.events_waits_current
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; insert into test.t2
-select name from performance_schema.SETUP_INSTRUMENTS
-where name like "wait/synch/rwlock/%"
+select name from performance_schema.setup_instruments
+where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock")
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */
master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
- where name like "wait/synch/rwlock/%"
+master-bin.000001 # Query # # use `test`; update performance_schema.setup_instruments set enabled='YES'
+ where name like "wait/synch/rwlock/sql/%"
+ and name not in ("wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock")
master-bin.000001 # Query # # COMMIT
diff --git a/mysql-test/suite/perfschema/r/checksum.result b/mysql-test/suite/perfschema/r/checksum.result
index 323cb303dae..587dead845a 100644
--- a/mysql-test/suite/perfschema/r/checksum.result
+++ b/mysql-test/suite/perfschema/r/checksum.result
@@ -1,34 +1,34 @@
-checksum table performance_schema.COND_INSTANCES;
-checksum table performance_schema.EVENTS_WAITS_CURRENT;
-checksum table performance_schema.EVENTS_WAITS_HISTORY;
-checksum table performance_schema.EVENTS_WAITS_HISTORY_LONG;
-checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-checksum table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-checksum table performance_schema.FILE_INSTANCES;
-checksum table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-checksum table performance_schema.FILE_SUMMARY_BY_INSTANCE;
-checksum table performance_schema.MUTEX_INSTANCES;
-checksum table performance_schema.PERFORMANCE_TIMERS;
-checksum table performance_schema.RWLOCK_INSTANCES;
-checksum table performance_schema.SETUP_CONSUMERS;
-checksum table performance_schema.SETUP_INSTRUMENTS;
-checksum table performance_schema.SETUP_TIMERS;
-checksum table performance_schema.THREADS;
-checksum table performance_schema.COND_INSTANCES extended;
-checksum table performance_schema.EVENTS_WAITS_CURRENT extended;
-checksum table performance_schema.EVENTS_WAITS_HISTORY extended;
-checksum table performance_schema.EVENTS_WAITS_HISTORY_LONG extended;
-checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE extended;
-checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME extended;
-checksum table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME extended;
-checksum table performance_schema.FILE_INSTANCES extended;
-checksum table performance_schema.FILE_SUMMARY_BY_EVENT_NAME extended;
-checksum table performance_schema.FILE_SUMMARY_BY_INSTANCE extended;
-checksum table performance_schema.MUTEX_INSTANCES extended;
-checksum table performance_schema.PERFORMANCE_TIMERS extended;
-checksum table performance_schema.RWLOCK_INSTANCES extended;
-checksum table performance_schema.SETUP_CONSUMERS extended;
-checksum table performance_schema.SETUP_INSTRUMENTS extended;
-checksum table performance_schema.SETUP_TIMERS extended;
-checksum table performance_schema.THREADS extended;
+checksum table performance_schema.cond_instances;
+checksum table performance_schema.events_waits_current;
+checksum table performance_schema.events_waits_history;
+checksum table performance_schema.events_waits_history_long;
+checksum table performance_schema.events_waits_summary_by_instance;
+checksum table performance_schema.events_waits_summary_by_thread_by_event_name;
+checksum table performance_schema.events_waits_summary_global_by_event_name;
+checksum table performance_schema.file_instances;
+checksum table performance_schema.file_summary_by_event_name;
+checksum table performance_schema.file_summary_by_instance;
+checksum table performance_schema.mutex_instances;
+checksum table performance_schema.performance_timers;
+checksum table performance_schema.rwlock_instances;
+checksum table performance_schema.setup_consumers;
+checksum table performance_schema.setup_instruments;
+checksum table performance_schema.setup_timers;
+checksum table performance_schema.threads;
+checksum table performance_schema.cond_instances extended;
+checksum table performance_schema.events_waits_current extended;
+checksum table performance_schema.events_waits_history extended;
+checksum table performance_schema.events_waits_history_long extended;
+checksum table performance_schema.events_waits_summary_by_instance extended;
+checksum table performance_schema.events_waits_summary_by_thread_by_event_name extended;
+checksum table performance_schema.events_waits_summary_global_by_event_name extended;
+checksum table performance_schema.file_instances extended;
+checksum table performance_schema.file_summary_by_event_name extended;
+checksum table performance_schema.file_summary_by_instance extended;
+checksum table performance_schema.mutex_instances extended;
+checksum table performance_schema.performance_timers extended;
+checksum table performance_schema.rwlock_instances extended;
+checksum table performance_schema.setup_consumers extended;
+checksum table performance_schema.setup_instruments extended;
+checksum table performance_schema.setup_timers extended;
+checksum table performance_schema.threads extended;
diff --git a/mysql-test/suite/perfschema/r/column_privilege.result b/mysql-test/suite/perfschema/r/column_privilege.result
index 7bbc59ac452..aff5f3e6eee 100644
--- a/mysql-test/suite/perfschema/r/column_privilege.result
+++ b/mysql-test/suite/perfschema/r/column_privilege.result
@@ -1,27 +1,28 @@
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
grant usage on *.* to 'pfs_user_5'@localhost with GRANT OPTION;
-grant SELECT(thread_id, event_id) on performance_schema.EVENTS_WAITS_CURRENT
+grant SELECT(thread_id, event_id) on performance_schema.events_waits_current
to 'pfs_user_5'@localhost;
-grant UPDATE(enabled) on performance_schema.SETUP_INSTRUMENTS
+grant UPDATE(enabled) on performance_schema.setup_instruments
to 'pfs_user_5'@localhost;
flush privileges;
-select thread_id from performance_schema.EVENTS_WAITS_CURRENT;
-select thread_id, event_id from performance_schema.EVENTS_WAITS_CURRENT;
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
-select event_name from performance_schema.EVENTS_WAITS_CURRENT;
-ERROR 42000: SELECT command denied to user 'pfs_user_5'@'localhost' for column 'event_name' in table 'EVENTS_WAITS_CURRENT'
+select thread_id from performance_schema.events_waits_current;
+select thread_id, event_id from performance_schema.events_waits_current;
+update performance_schema.setup_instruments set enabled='YES';
+select event_name from performance_schema.events_waits_current;
+ERROR 42000: SELECT command denied to user 'pfs_user_5'@'localhost' for column 'event_name' in table 'events_waits_current'
select thread_id, event_id, event_name
-from performance_schema.EVENTS_WAITS_CURRENT;
-ERROR 42000: SELECT command denied to user 'pfs_user_5'@'localhost' for column 'event_name' in table 'EVENTS_WAITS_CURRENT'
-update performance_schema.SETUP_INSTRUMENTS set name='illegal';
-ERROR 42000: UPDATE command denied to user 'pfs_user_5'@'localhost' for column 'name' in table 'SETUP_INSTRUMENTS'
-update performance_schema.SETUP_INSTRUMENTS set timed='NO';
-ERROR 42000: UPDATE command denied to user 'pfs_user_5'@'localhost' for column 'timed' in table 'SETUP_INSTRUMENTS'
+from performance_schema.events_waits_current;
+ERROR 42000: SELECT command denied to user 'pfs_user_5'@'localhost' for column 'event_name' in table 'events_waits_current'
+update performance_schema.setup_instruments set name='illegal';
+ERROR 42000: UPDATE command denied to user 'pfs_user_5'@'localhost' for column 'name' in table 'setup_instruments'
+update performance_schema.setup_instruments set timed='NO';
+ERROR 42000: UPDATE command denied to user 'pfs_user_5'@'localhost' for column 'timed' in table 'setup_instruments'
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'pfs_user_5'@localhost;
DROP USER 'pfs_user_5'@localhost;
flush privileges;
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
-UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES';
-UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'CYCLE';
+UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
+UPDATE performance_schema.setup_consumers SET enabled = 'YES';
+UPDATE performance_schema.setup_timers SET timer_name = 'CYCLE';
diff --git a/mysql-test/suite/perfschema/r/ddl_cond_instances.result b/mysql-test/suite/perfschema/r/ddl_cond_instances.result
index 33adcebaceb..6b8b40af463 100644
--- a/mysql-test/suite/perfschema/r/ddl_cond_instances.result
+++ b/mysql-test/suite/perfschema/r/ddl_cond_instances.result
@@ -1,8 +1,8 @@
-alter table performance_schema.COND_INSTANCES add column foo integer;
+alter table performance_schema.cond_instances add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.COND_INSTANCES;
+truncate table performance_schema.cond_instances;
ERROR HY000: Invalid performance_schema usage.
-ALTER TABLE performance_schema.COND_INSTANCES ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.cond_instances ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.COND_INSTANCES(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.cond_instances(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_events_waits_current.result b/mysql-test/suite/perfschema/r/ddl_events_waits_current.result
index a438c93affe..545134e5bd0 100644
--- a/mysql-test/suite/perfschema/r/ddl_events_waits_current.result
+++ b/mysql-test/suite/perfschema/r/ddl_events_waits_current.result
@@ -1,7 +1,7 @@
-alter table performance_schema.EVENTS_WAITS_CURRENT add column foo integer;
+alter table performance_schema.events_waits_current add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.EVENTS_WAITS_CURRENT;
-ALTER TABLE performance_schema.EVENTS_WAITS_CURRENT ADD INDEX test_index(EVENT_ID);
+truncate table performance_schema.events_waits_current;
+ALTER TABLE performance_schema.events_waits_current ADD INDEX test_index(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_CURRENT(EVENT_ID);
+CREATE UNIQUE INDEX test_index ON performance_schema.events_waits_current(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_events_waits_history.result b/mysql-test/suite/perfschema/r/ddl_events_waits_history.result
index 748dc2f29cd..2907e865b37 100644
--- a/mysql-test/suite/perfschema/r/ddl_events_waits_history.result
+++ b/mysql-test/suite/perfschema/r/ddl_events_waits_history.result
@@ -1,7 +1,7 @@
-alter table performance_schema.EVENTS_WAITS_HISTORY add column foo integer;
+alter table performance_schema.events_waits_history add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.EVENTS_WAITS_HISTORY;
-ALTER TABLE performance_schema.EVENTS_WAITS_HISTORY ADD INDEX test_index(EVENT_ID);
+truncate table performance_schema.events_waits_history;
+ALTER TABLE performance_schema.events_waits_history ADD INDEX test_index(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_HISTORY(EVENT_ID);
+CREATE UNIQUE INDEX test_index ON performance_schema.events_waits_history(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_events_waits_history_long.result b/mysql-test/suite/perfschema/r/ddl_events_waits_history_long.result
index 1a047a765f6..8926d39374b 100644
--- a/mysql-test/suite/perfschema/r/ddl_events_waits_history_long.result
+++ b/mysql-test/suite/perfschema/r/ddl_events_waits_history_long.result
@@ -1,7 +1,7 @@
-alter table performance_schema.EVENTS_WAITS_HISTORY_LONG add column foo integer;
+alter table performance_schema.events_waits_history_long add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
-ALTER TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG ADD INDEX test_index(EVENT_ID);
+truncate table performance_schema.events_waits_history_long;
+ALTER TABLE performance_schema.events_waits_history_long ADD INDEX test_index(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_HISTORY_LONG(EVENT_ID);
+CREATE UNIQUE INDEX test_index ON performance_schema.events_waits_history_long(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_ews_by_instance.result b/mysql-test/suite/perfschema/r/ddl_ews_by_instance.result
index 4a35565bae0..94168f16eb7 100644
--- a/mysql-test/suite/perfschema/r/ddl_ews_by_instance.result
+++ b/mysql-test/suite/perfschema/r/ddl_ews_by_instance.result
@@ -1,7 +1,7 @@
-alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE add column foo integer;
+alter table performance_schema.events_waits_summary_by_instance add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE ADD INDEX test_index(EVENT_NAME);
+truncate table performance_schema.events_waits_summary_by_instance;
+ALTER TABLE performance_schema.events_waits_summary_by_instance ADD INDEX test_index(EVENT_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE(EVENT_NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.events_waits_summary_by_instance(EVENT_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_ews_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_ews_by_thread_by_event_name.result
index 18d98006220..1694ff9287d 100644
--- a/mysql-test/suite/perfschema/r/ddl_ews_by_thread_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/ddl_ews_by_thread_by_event_name.result
@@ -1,9 +1,9 @@
-alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+alter table performance_schema.events_waits_summary_by_thread_by_event_name
add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME ADD INDEX test_index(THREAD_ID);
+truncate table performance_schema.events_waits_summary_by_thread_by_event_name;
+ALTER TABLE performance_schema.events_waits_summary_by_thread_by_event_name ADD INDEX test_index(THREAD_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index
-ON performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME(THREAD_ID);
+ON performance_schema.events_waits_summary_by_thread_by_event_name(THREAD_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_ews_global_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_ews_global_by_event_name.result
index 4f3ebcaea43..3b8cf851f80 100644
--- a/mysql-test/suite/perfschema/r/ddl_ews_global_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/ddl_ews_global_by_event_name.result
@@ -1,10 +1,10 @@
-alter table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+alter table performance_schema.events_waits_summary_global_by_event_name
add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+truncate table performance_schema.events_waits_summary_global_by_event_name;
+ALTER TABLE performance_schema.events_waits_summary_global_by_event_name
ADD INDEX test_index(EVENT_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index
-ON performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME(EVENT_NAME);
+ON performance_schema.events_waits_summary_global_by_event_name(EVENT_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_file_instances.result b/mysql-test/suite/perfschema/r/ddl_file_instances.result
index 21e65c62405..338a0260326 100644
--- a/mysql-test/suite/perfschema/r/ddl_file_instances.result
+++ b/mysql-test/suite/perfschema/r/ddl_file_instances.result
@@ -1,8 +1,8 @@
-alter table performance_schema.FILE_INSTANCES add column foo integer;
+alter table performance_schema.file_instances add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.FILE_INSTANCES;
+truncate table performance_schema.file_instances;
ERROR HY000: Invalid performance_schema usage.
-ALTER TABLE performance_schema.FILE_INSTANCES ADD INDEX test_index(FILE_NAME);
+ALTER TABLE performance_schema.file_instances ADD INDEX test_index(FILE_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.FILE_INSTANCES(FILE_NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.file_instances(FILE_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_fs_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_fs_by_event_name.result
index 2f21ef56832..11bff4104bb 100644
--- a/mysql-test/suite/perfschema/r/ddl_fs_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/ddl_fs_by_event_name.result
@@ -1,7 +1,7 @@
-alter table performance_schema.FILE_SUMMARY_BY_EVENT_NAME add column foo integer;
+alter table performance_schema.file_summary_by_event_name add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-ALTER TABLE performance_schema.FILE_SUMMARY_BY_EVENT_NAME ADD INDEX test_index(NAME);
+truncate table performance_schema.file_summary_by_event_name;
+ALTER TABLE performance_schema.file_summary_by_event_name ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.FILE_SUMMARY_BY_EVENT_NAME(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.file_summary_by_event_name(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_fs_by_instance.result b/mysql-test/suite/perfschema/r/ddl_fs_by_instance.result
index 8e256d1fd8d..b28847b3aca 100644
--- a/mysql-test/suite/perfschema/r/ddl_fs_by_instance.result
+++ b/mysql-test/suite/perfschema/r/ddl_fs_by_instance.result
@@ -1,7 +1,7 @@
-alter table performance_schema.FILE_SUMMARY_BY_INSTANCE add column foo integer;
+alter table performance_schema.file_summary_by_instance add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE;
-ALTER TABLE performance_schema.FILE_SUMMARY_BY_INSTANCE ADD INDEX test_index(NAME);
+truncate table performance_schema.file_summary_by_instance;
+ALTER TABLE performance_schema.file_summary_by_instance ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.FILE_SUMMARY_BY_INSTANCE(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.file_summary_by_instance(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_mutex_instances.result b/mysql-test/suite/perfschema/r/ddl_mutex_instances.result
index 35397a5294d..0e35b0d766a 100644
--- a/mysql-test/suite/perfschema/r/ddl_mutex_instances.result
+++ b/mysql-test/suite/perfschema/r/ddl_mutex_instances.result
@@ -1,8 +1,8 @@
-alter table performance_schema.MUTEX_INSTANCES add column foo integer;
+alter table performance_schema.mutex_instances add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.MUTEX_INSTANCES;
+truncate table performance_schema.mutex_instances;
ERROR HY000: Invalid performance_schema usage.
-ALTER TABLE performance_schema.MUTEX_INSTANCES ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.mutex_instances ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.MUTEX_INSTANCES(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.mutex_instances(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_performance_timers.result b/mysql-test/suite/perfschema/r/ddl_performance_timers.result
index 5de8193b205..6868d419f1b 100644
--- a/mysql-test/suite/perfschema/r/ddl_performance_timers.result
+++ b/mysql-test/suite/perfschema/r/ddl_performance_timers.result
@@ -1,8 +1,8 @@
-alter table performance_schema.PERFORMANCE_TIMERS add column foo integer;
+alter table performance_schema.performance_timers add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.PERFORMANCE_TIMERS;
+truncate table performance_schema.performance_timers;
ERROR HY000: Invalid performance_schema usage.
-ALTER TABLE performance_schema.PERFORMANCE_TIMERS ADD INDEX test_index(TIMER_NAME);
+ALTER TABLE performance_schema.performance_timers ADD INDEX test_index(TIMER_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.PERFORMANCE_TIMERS(TIMER_NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.performance_timers(TIMER_NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_rwlock_instances.result b/mysql-test/suite/perfschema/r/ddl_rwlock_instances.result
index 849d191b17f..e93aef47a5c 100644
--- a/mysql-test/suite/perfschema/r/ddl_rwlock_instances.result
+++ b/mysql-test/suite/perfschema/r/ddl_rwlock_instances.result
@@ -1,8 +1,8 @@
-alter table performance_schema.RWLOCK_INSTANCES add column foo integer;
+alter table performance_schema.rwlock_instances add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.RWLOCK_INSTANCES;
+truncate table performance_schema.rwlock_instances;
ERROR HY000: Invalid performance_schema usage.
-ALTER TABLE performance_schema.RWLOCK_INSTANCES ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.rwlock_instances ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.RWLOCK_INSTANCES(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.rwlock_instances(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_setup_consumers.result b/mysql-test/suite/perfschema/r/ddl_setup_consumers.result
index f141725ee1f..1b121a0ec4c 100644
--- a/mysql-test/suite/perfschema/r/ddl_setup_consumers.result
+++ b/mysql-test/suite/perfschema/r/ddl_setup_consumers.result
@@ -1,8 +1,8 @@
-alter table performance_schema.SETUP_CONSUMERS add column foo integer;
+alter table performance_schema.setup_consumers add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.SETUP_CONSUMERS;
+truncate table performance_schema.setup_consumers;
ERROR HY000: Invalid performance_schema usage.
-ALTER TABLE performance_schema.SETUP_CONSUMERS ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.setup_consumers ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_CONSUMERS(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.setup_consumers(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_setup_instruments.result b/mysql-test/suite/perfschema/r/ddl_setup_instruments.result
index 42e54b587d8..f67b4f5791b 100644
--- a/mysql-test/suite/perfschema/r/ddl_setup_instruments.result
+++ b/mysql-test/suite/perfschema/r/ddl_setup_instruments.result
@@ -1,8 +1,8 @@
-alter table performance_schema.SETUP_INSTRUMENTS add column foo integer;
+alter table performance_schema.setup_instruments add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.SETUP_INSTRUMENTS;
+truncate table performance_schema.setup_instruments;
ERROR HY000: Invalid performance_schema usage.
-ALTER TABLE performance_schema.SETUP_INSTRUMENTS ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.setup_instruments ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_INSTRUMENTS(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.setup_instruments(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_setup_timers.result b/mysql-test/suite/perfschema/r/ddl_setup_timers.result
index fc74730bd50..69b3d36cc1b 100644
--- a/mysql-test/suite/perfschema/r/ddl_setup_timers.result
+++ b/mysql-test/suite/perfschema/r/ddl_setup_timers.result
@@ -1,8 +1,8 @@
-alter table performance_schema.SETUP_TIMERS add column foo integer;
+alter table performance_schema.setup_timers add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.SETUP_TIMERS;
+truncate table performance_schema.setup_timers;
ERROR HY000: Invalid performance_schema usage.
-ALTER TABLE performance_schema.SETUP_TIMERS ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.setup_timers ADD INDEX test_index(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_TIMERS(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.setup_timers(NAME);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/ddl_threads.result b/mysql-test/suite/perfschema/r/ddl_threads.result
index 5d4b54d8bbe..9d949e0920f 100644
--- a/mysql-test/suite/perfschema/r/ddl_threads.result
+++ b/mysql-test/suite/perfschema/r/ddl_threads.result
@@ -1,8 +1,8 @@
-alter table performance_schema.THREADS add column foo integer;
+alter table performance_schema.threads add column foo integer;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.THREADS;
+truncate table performance_schema.threads;
ERROR HY000: Invalid performance_schema usage.
-ALTER TABLE performance_schema.THREADS ADD INDEX test_index(ID);
+ALTER TABLE performance_schema.threads ADD INDEX test_index(ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.THREADS(ID);
+CREATE UNIQUE INDEX test_index ON performance_schema.threads(ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
diff --git a/mysql-test/suite/perfschema/r/dml_cond_instances.result b/mysql-test/suite/perfschema/r/dml_cond_instances.result
index 8adc632b91b..285c32090af 100644
--- a/mysql-test/suite/perfschema/r/dml_cond_instances.result
+++ b/mysql-test/suite/perfschema/r/dml_cond_instances.result
@@ -1,23 +1,20 @@
-select * from performance_schema.COND_INSTANCES limit 1;
-NAME OBJECT_INSTANCE_BEGIN
-# #
-select * from performance_schema.COND_INSTANCES
+select * from performance_schema.cond_instances limit 1;
+select * from performance_schema.cond_instances
where name='FOO';
-NAME OBJECT_INSTANCE_BEGIN
-insert into performance_schema.COND_INSTANCES
+insert into performance_schema.cond_instances
set name='FOO', object_instance_begin=12;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'COND_INSTANCES'
-update performance_schema.COND_INSTANCES
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'cond_instances'
+update performance_schema.cond_instances
set name='FOO';
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'COND_INSTANCES'
-delete from performance_schema.COND_INSTANCES
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'cond_instances'
+delete from performance_schema.cond_instances
where name like "wait/%";
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'COND_INSTANCES'
-delete from performance_schema.COND_INSTANCES;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'COND_INSTANCES'
-LOCK TABLES performance_schema.COND_INSTANCES READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'COND_INSTANCES'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'cond_instances'
+delete from performance_schema.cond_instances;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'cond_instances'
+LOCK TABLES performance_schema.cond_instances READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'cond_instances'
UNLOCK TABLES;
-LOCK TABLES performance_schema.COND_INSTANCES WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'COND_INSTANCES'
+LOCK TABLES performance_schema.cond_instances WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'cond_instances'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_current.result b/mysql-test/suite/perfschema/r/dml_events_waits_current.result
index 5cd0dba7ad1..122cfcce4a1 100644
--- a/mysql-test/suite/perfschema/r/dml_events_waits_current.result
+++ b/mysql-test/suite/perfschema/r/dml_events_waits_current.result
@@ -1,28 +1,25 @@
-select * from performance_schema.EVENTS_WAITS_CURRENT
+select * from performance_schema.events_waits_current
where event_name like 'Wait/Synch/%' limit 1;
-THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
-# # # # # # # # NULL NULL NULL # NULL # NULL 0
-select * from performance_schema.EVENTS_WAITS_CURRENT
+select * from performance_schema.events_waits_current
where event_name='FOO';
-THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
-insert into performance_schema.EVENTS_WAITS_CURRENT
+insert into performance_schema.events_waits_current
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-update performance_schema.EVENTS_WAITS_CURRENT
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_waits_current'
+update performance_schema.events_waits_current
set timer_start=12;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-update performance_schema.EVENTS_WAITS_CURRENT
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_current'
+update performance_schema.events_waits_current
set timer_start=12 where thread_id=0;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-delete from performance_schema.EVENTS_WAITS_CURRENT
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_current'
+delete from performance_schema.events_waits_current
where thread_id=1;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-delete from performance_schema.EVENTS_WAITS_CURRENT;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-LOCK TABLES performance_schema.EVENTS_WAITS_CURRENT READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_current'
+delete from performance_schema.events_waits_current;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_current'
+LOCK TABLES performance_schema.events_waits_current READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_current'
UNLOCK TABLES;
-LOCK TABLES performance_schema.EVENTS_WAITS_CURRENT WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
+LOCK TABLES performance_schema.events_waits_current WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_current'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_history.result b/mysql-test/suite/perfschema/r/dml_events_waits_history.result
index 953922868fb..199ccc1cfa5 100644
--- a/mysql-test/suite/perfschema/r/dml_events_waits_history.result
+++ b/mysql-test/suite/perfschema/r/dml_events_waits_history.result
@@ -1,36 +1,29 @@
-select * from performance_schema.EVENTS_WAITS_HISTORY
+select * from performance_schema.events_waits_history
where event_name like 'Wait/Synch/%' limit 1;
-THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
-# # # # # # # # NULL NULL NULL # NULL # NULL 0
-select * from performance_schema.EVENTS_WAITS_HISTORY
+select * from performance_schema.events_waits_history
where event_name='FOO';
-THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
-select * from performance_schema.EVENTS_WAITS_HISTORY
+select * from performance_schema.events_waits_history
where event_name like 'Wait/Synch/%' order by timer_wait limit 1;
-THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
-# # # # # # # # NULL NULL NULL # NULL # NULL 0
-select * from performance_schema.EVENTS_WAITS_HISTORY
+select * from performance_schema.events_waits_history
where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1;
-THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
-# # # # # # # # NULL NULL NULL # NULL # NULL 0
-insert into performance_schema.EVENTS_WAITS_HISTORY
+insert into performance_schema.events_waits_history
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
-update performance_schema.EVENTS_WAITS_HISTORY
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_waits_history'
+update performance_schema.events_waits_history
set timer_start=12;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
-update performance_schema.EVENTS_WAITS_HISTORY
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_history'
+update performance_schema.events_waits_history
set timer_start=12 where thread_id=0;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
-delete from performance_schema.EVENTS_WAITS_HISTORY
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_history'
+delete from performance_schema.events_waits_history
where thread_id=1;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
-delete from performance_schema.EVENTS_WAITS_HISTORY;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
-LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_history'
+delete from performance_schema.events_waits_history;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_history'
+LOCK TABLES performance_schema.events_waits_history READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_history'
UNLOCK TABLES;
-LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY'
+LOCK TABLES performance_schema.events_waits_history WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_history'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result b/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result
index 494469a0db8..773dcd3b1dc 100644
--- a/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result
+++ b/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result
@@ -1,36 +1,29 @@
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
+select * from performance_schema.events_waits_history_long
where event_name like 'Wait/Synch/%' limit 1;
-THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
-# # # # # # # # NULL NULL NULL # NULL # NULL 0
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
+select * from performance_schema.events_waits_history_long
where event_name='FOO';
-THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
+select * from performance_schema.events_waits_history_long
where event_name like 'Wait/Synch/%' order by timer_wait limit 1;
-THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
-# # # # # # # # NULL NULL NULL # NULL # NULL 0
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
+select * from performance_schema.events_waits_history_long
where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1;
-THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
-# # # # # # # # NULL NULL NULL # NULL # NULL 0
-insert into performance_schema.EVENTS_WAITS_HISTORY_LONG
+insert into performance_schema.events_waits_history_long
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
-update performance_schema.EVENTS_WAITS_HISTORY_LONG
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_waits_history_long'
+update performance_schema.events_waits_history_long
set timer_start=12;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
-update performance_schema.EVENTS_WAITS_HISTORY_LONG
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_history_long'
+update performance_schema.events_waits_history_long
set timer_start=12 where thread_id=0;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
-delete from performance_schema.EVENTS_WAITS_HISTORY_LONG
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_history_long'
+delete from performance_schema.events_waits_history_long
where thread_id=1;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
-delete from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
-LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY_LONG READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_history_long'
+delete from performance_schema.events_waits_history_long;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_history_long'
+LOCK TABLES performance_schema.events_waits_history_long READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_history_long'
UNLOCK TABLES;
-LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY_LONG WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
+LOCK TABLES performance_schema.events_waits_history_long WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_history_long'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_instance.result b/mysql-test/suite/perfschema/r/dml_ews_by_instance.result
index dc262982340..6ba37025d3b 100644
--- a/mysql-test/suite/perfschema/r/dml_ews_by_instance.result
+++ b/mysql-test/suite/perfschema/r/dml_ews_by_instance.result
@@ -1,45 +1,34 @@
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+select * from performance_schema.events_waits_summary_by_instance
where event_name like 'Wait/Synch/%' limit 1;
-EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
-# # # # # # #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+select * from performance_schema.events_waits_summary_by_instance
where event_name='FOO';
-EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+select * from performance_schema.events_waits_summary_by_instance
order by count_star limit 1;
-EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
-# # # # # # #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+select * from performance_schema.events_waits_summary_by_instance
order by count_star desc limit 1;
-EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
-# # # # # # #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+select * from performance_schema.events_waits_summary_by_instance
where min_timer_wait > 0 order by count_star limit 1;
-EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
-# # # # # # #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+select * from performance_schema.events_waits_summary_by_instance
where min_timer_wait > 0 order by count_star desc limit 1;
-EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
-# # # # # # #
-insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+insert into performance_schema.events_waits_summary_by_instance
set event_name='FOO', object_instance_begin=0,
count_star=1, sum_timer_wait=2, min_timer_wait=3,
avg_timer_wait=4, max_timer_wait=5;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
-update performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_waits_summary_by_instance'
+update performance_schema.events_waits_summary_by_instance
set count_star=12;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
-update performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_instance'
+update performance_schema.events_waits_summary_by_instance
set count_star=12 where event_name like "FOO";
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
-delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_instance'
+delete from performance_schema.events_waits_summary_by_instance
where count_star=1;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
-delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_instance'
+delete from performance_schema.events_waits_summary_by_instance;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_instance'
+LOCK TABLES performance_schema.events_waits_summary_by_instance READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_summary_by_instance'
UNLOCK TABLES;
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
+LOCK TABLES performance_schema.events_waits_summary_by_instance WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_summary_by_instance'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result
index 2a085659431..a98acb5f536 100644
--- a/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result
@@ -1,29 +1,26 @@
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+select * from performance_schema.events_waits_summary_by_thread_by_event_name
where event_name like 'Wait/Synch/%' limit 1;
-THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
-# # # # # # #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+select * from performance_schema.events_waits_summary_by_thread_by_event_name
where event_name='FOO';
-THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
-insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+insert into performance_schema.events_waits_summary_by_thread_by_event_name
set event_name='FOO', thread_id=1,
count_star=1, sum_timer_wait=2, min_timer_wait=3,
avg_timer_wait=4, max_timer_wait=5;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
-update performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_waits_summary_by_thread_by_event_name'
+update performance_schema.events_waits_summary_by_thread_by_event_name
set count_star=12;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
-update performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_thread_by_event_name'
+update performance_schema.events_waits_summary_by_thread_by_event_name
set count_star=12 where event_name like "FOO";
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
-delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_thread_by_event_name'
+delete from performance_schema.events_waits_summary_by_thread_by_event_name
where count_star=1;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
-delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_thread_by_event_name'
+delete from performance_schema.events_waits_summary_by_thread_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_by_thread_by_event_name'
+LOCK TABLES performance_schema.events_waits_summary_by_thread_by_event_name READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_summary_by_thread_by_event_name'
UNLOCK TABLES;
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
+LOCK TABLES performance_schema.events_waits_summary_by_thread_by_event_name WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_summary_by_thread_by_event_name'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result
index 64ede2fddac..159adbd8022 100644
--- a/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result
@@ -1,28 +1,25 @@
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+select * from performance_schema.events_waits_summary_global_by_event_name
where event_name like 'Wait/Synch/%' limit 1;
-EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
-# # # # # #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+select * from performance_schema.events_waits_summary_global_by_event_name
where event_name='FOO';
-EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
-insert into performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+insert into performance_schema.events_waits_summary_global_by_event_name
set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3,
avg_timer_wait=4, max_timer_wait=5;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
-update performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_waits_summary_global_by_event_name'
+update performance_schema.events_waits_summary_global_by_event_name
set count_star=12;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
-update performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_summary_global_by_event_name'
+update performance_schema.events_waits_summary_global_by_event_name
set count_star=12 where event_name like "FOO";
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
-delete from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'events_waits_summary_global_by_event_name'
+delete from performance_schema.events_waits_summary_global_by_event_name
where count_star=1;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
-delete from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_global_by_event_name'
+delete from performance_schema.events_waits_summary_global_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_summary_global_by_event_name'
+LOCK TABLES performance_schema.events_waits_summary_global_by_event_name READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_summary_global_by_event_name'
UNLOCK TABLES;
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+LOCK TABLES performance_schema.events_waits_summary_global_by_event_name WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_summary_global_by_event_name'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_file_instances.result b/mysql-test/suite/perfschema/r/dml_file_instances.result
index e15d68cbad3..4a8a7ac4d47 100644
--- a/mysql-test/suite/perfschema/r/dml_file_instances.result
+++ b/mysql-test/suite/perfschema/r/dml_file_instances.result
@@ -1,23 +1,20 @@
-select * from performance_schema.FILE_INSTANCES limit 1;
-FILE_NAME EVENT_NAME OPEN_COUNT
-# # #
-select * from performance_schema.FILE_INSTANCES
+select * from performance_schema.file_instances limit 1;
+select * from performance_schema.file_instances
where file_name='FOO';
-FILE_NAME EVENT_NAME OPEN_COUNT
-insert into performance_schema.FILE_INSTANCES
+insert into performance_schema.file_instances
set file_name='FOO', event_name='BAR', open_count=12;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
-update performance_schema.FILE_INSTANCES
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'file_instances'
+update performance_schema.file_instances
set file_name='FOO';
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
-delete from performance_schema.FILE_INSTANCES
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'file_instances'
+delete from performance_schema.file_instances
where event_name like "wait/%";
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
-delete from performance_schema.FILE_INSTANCES;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
-LOCK TABLES performance_schema.FILE_INSTANCES READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'file_instances'
+delete from performance_schema.file_instances;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'file_instances'
+LOCK TABLES performance_schema.file_instances READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'file_instances'
UNLOCK TABLES;
-LOCK TABLES performance_schema.FILE_INSTANCES WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
+LOCK TABLES performance_schema.file_instances WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'file_instances'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result b/mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result
index 1ecc82f40a5..a8a9fe852bb 100644
--- a/mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result
+++ b/mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result
@@ -1,28 +1,25 @@
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME
+select * from performance_schema.file_summary_by_event_name
where event_name like 'Wait/io/%' limit 1;
-EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
-# # # # #
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME
+select * from performance_schema.file_summary_by_event_name
where event_name='FOO';
-EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
-insert into performance_schema.FILE_SUMMARY_BY_EVENT_NAME
+insert into performance_schema.file_summary_by_event_name
set event_name='FOO', count_read=1, count_write=2,
sum_number_of_bytes_read=4, sum_number_of_bytes_write=5;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
-update performance_schema.FILE_SUMMARY_BY_EVENT_NAME
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'file_summary_by_event_name'
+update performance_schema.file_summary_by_event_name
set count_read=12;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
-update performance_schema.FILE_SUMMARY_BY_EVENT_NAME
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'file_summary_by_event_name'
+update performance_schema.file_summary_by_event_name
set count_write=12 where event_name like "FOO";
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
-delete from performance_schema.FILE_SUMMARY_BY_EVENT_NAME
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'file_summary_by_event_name'
+delete from performance_schema.file_summary_by_event_name
where count_read=1;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
-delete from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
-LOCK TABLES performance_schema.FILE_SUMMARY_BY_EVENT_NAME READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'file_summary_by_event_name'
+delete from performance_schema.file_summary_by_event_name;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'file_summary_by_event_name'
+LOCK TABLES performance_schema.file_summary_by_event_name READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'file_summary_by_event_name'
UNLOCK TABLES;
-LOCK TABLES performance_schema.FILE_SUMMARY_BY_EVENT_NAME WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME'
+LOCK TABLES performance_schema.file_summary_by_event_name WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'file_summary_by_event_name'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result b/mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result
index 05b204cc1a9..456d6e31173 100644
--- a/mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result
+++ b/mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result
@@ -1,28 +1,25 @@
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE
+select * from performance_schema.file_summary_by_instance
where event_name like 'Wait/io/%' limit 1;
-FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
-# # # # # #
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE
+select * from performance_schema.file_summary_by_instance
where event_name='FOO';
-FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
-insert into performance_schema.FILE_SUMMARY_BY_INSTANCE
+insert into performance_schema.file_summary_by_instance
set event_name='FOO', count_read=1, count_write=2,
sum_number_of_bytes_read=4, sum_number_of_bytes_write=5;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
-update performance_schema.FILE_SUMMARY_BY_INSTANCE
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'file_summary_by_instance'
+update performance_schema.file_summary_by_instance
set count_read=12;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
-update performance_schema.FILE_SUMMARY_BY_INSTANCE
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'file_summary_by_instance'
+update performance_schema.file_summary_by_instance
set count_write=12 where event_name like "FOO";
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
-delete from performance_schema.FILE_SUMMARY_BY_INSTANCE
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'file_summary_by_instance'
+delete from performance_schema.file_summary_by_instance
where count_read=1;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
-delete from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
-LOCK TABLES performance_schema.FILE_SUMMARY_BY_INSTANCE READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'file_summary_by_instance'
+delete from performance_schema.file_summary_by_instance;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'file_summary_by_instance'
+LOCK TABLES performance_schema.file_summary_by_instance READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'file_summary_by_instance'
UNLOCK TABLES;
-LOCK TABLES performance_schema.FILE_SUMMARY_BY_INSTANCE WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
+LOCK TABLES performance_schema.file_summary_by_instance WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'file_summary_by_instance'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_mutex_instances.result b/mysql-test/suite/perfschema/r/dml_mutex_instances.result
index 862123b3450..665517c7227 100644
--- a/mysql-test/suite/perfschema/r/dml_mutex_instances.result
+++ b/mysql-test/suite/perfschema/r/dml_mutex_instances.result
@@ -1,23 +1,20 @@
-select * from performance_schema.MUTEX_INSTANCES limit 1;
-NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID
-# # #
-select * from performance_schema.MUTEX_INSTANCES
+select * from performance_schema.mutex_instances limit 1;
+select * from performance_schema.mutex_instances
where name='FOO';
-NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID
-insert into performance_schema.MUTEX_INSTANCES
+insert into performance_schema.mutex_instances
set name='FOO', object_instance_begin=12;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES'
-update performance_schema.MUTEX_INSTANCES
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'mutex_instances'
+update performance_schema.mutex_instances
set name='FOO';
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES'
-delete from performance_schema.MUTEX_INSTANCES
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'mutex_instances'
+delete from performance_schema.mutex_instances
where name like "wait/%";
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES'
-delete from performance_schema.MUTEX_INSTANCES;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES'
-LOCK TABLES performance_schema.MUTEX_INSTANCES READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'mutex_instances'
+delete from performance_schema.mutex_instances;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'mutex_instances'
+LOCK TABLES performance_schema.mutex_instances READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'mutex_instances'
UNLOCK TABLES;
-LOCK TABLES performance_schema.MUTEX_INSTANCES WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES'
+LOCK TABLES performance_schema.mutex_instances WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'mutex_instances'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_performance_timers.result b/mysql-test/suite/perfschema/r/dml_performance_timers.result
index 99c1c74b797..f345cce921e 100644
--- a/mysql-test/suite/perfschema/r/dml_performance_timers.result
+++ b/mysql-test/suite/perfschema/r/dml_performance_timers.result
@@ -1,29 +1,29 @@
-select * from performance_schema.PERFORMANCE_TIMERS;
+select * from performance_schema.performance_timers;
TIMER_NAME TIMER_FREQUENCY TIMER_RESOLUTION TIMER_OVERHEAD
CYCLE <frequency> <resolution> <overhead>
NANOSECOND <frequency> <resolution> <overhead>
MICROSECOND <frequency> <resolution> <overhead>
MILLISECOND <frequency> <resolution> <overhead>
TICK <frequency> <resolution> <overhead>
-select * from performance_schema.PERFORMANCE_TIMERS
+select * from performance_schema.performance_timers
where timer_name='CYCLE';
TIMER_NAME TIMER_FREQUENCY TIMER_RESOLUTION TIMER_OVERHEAD
CYCLE <frequency> <resolution> <overhead>
-insert into performance_schema.PERFORMANCE_TIMERS
+insert into performance_schema.performance_timers
set timer_name='FOO', timer_frequency=1,
timer_resolution=2, timer_overhead=3;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS'
-update performance_schema.PERFORMANCE_TIMERS
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'performance_timers'
+update performance_schema.performance_timers
set timer_frequency=12 where timer_name='CYCLE';
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS'
-delete from performance_schema.PERFORMANCE_TIMERS;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS'
-delete from performance_schema.PERFORMANCE_TIMERS
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'performance_timers'
+delete from performance_schema.performance_timers;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'performance_timers'
+delete from performance_schema.performance_timers
where timer_name='CYCLE';
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS'
-LOCK TABLES performance_schema.PERFORMANCE_TIMERS READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'performance_timers'
+LOCK TABLES performance_schema.performance_timers READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'performance_timers'
UNLOCK TABLES;
-LOCK TABLES performance_schema.PERFORMANCE_TIMERS WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS'
+LOCK TABLES performance_schema.performance_timers WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'performance_timers'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_rwlock_instances.result b/mysql-test/suite/perfschema/r/dml_rwlock_instances.result
index 686007e58e9..b072eea3955 100644
--- a/mysql-test/suite/perfschema/r/dml_rwlock_instances.result
+++ b/mysql-test/suite/perfschema/r/dml_rwlock_instances.result
@@ -1,23 +1,20 @@
-select * from performance_schema.RWLOCK_INSTANCES limit 1;
-NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT
-# # # #
-select * from performance_schema.RWLOCK_INSTANCES
+select * from performance_schema.rwlock_instances limit 1;
+select * from performance_schema.rwlock_instances
where name='FOO';
-NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT
-insert into performance_schema.RWLOCK_INSTANCES
+insert into performance_schema.rwlock_instances
set name='FOO', object_instance_begin=12;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES'
-update performance_schema.RWLOCK_INSTANCES
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'rwlock_instances'
+update performance_schema.rwlock_instances
set name='FOO';
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES'
-delete from performance_schema.RWLOCK_INSTANCES
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'rwlock_instances'
+delete from performance_schema.rwlock_instances
where name like "wait/%";
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES'
-delete from performance_schema.RWLOCK_INSTANCES;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES'
-LOCK TABLES performance_schema.RWLOCK_INSTANCES READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'rwlock_instances'
+delete from performance_schema.rwlock_instances;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'rwlock_instances'
+LOCK TABLES performance_schema.rwlock_instances READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'rwlock_instances'
UNLOCK TABLES;
-LOCK TABLES performance_schema.RWLOCK_INSTANCES WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES'
+LOCK TABLES performance_schema.rwlock_instances WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'rwlock_instances'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_setup_consumers.result b/mysql-test/suite/perfschema/r/dml_setup_consumers.result
index 44ed751dcd2..db0a6820de9 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_consumers.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_consumers.result
@@ -1,4 +1,4 @@
-select * from performance_schema.SETUP_CONSUMERS;
+select * from performance_schema.setup_consumers;
NAME ENABLED
events_waits_current YES
events_waits_history YES
@@ -8,11 +8,11 @@ events_waits_summary_by_event_name YES
events_waits_summary_by_instance YES
file_summary_by_event_name YES
file_summary_by_instance YES
-select * from performance_schema.SETUP_CONSUMERS
+select * from performance_schema.setup_consumers
where name='events_waits_current';
NAME ENABLED
events_waits_current YES
-select * from performance_schema.SETUP_CONSUMERS
+select * from performance_schema.setup_consumers
where enabled='YES';
NAME ENABLED
events_waits_current YES
@@ -23,23 +23,23 @@ events_waits_summary_by_event_name YES
events_waits_summary_by_instance YES
file_summary_by_event_name YES
file_summary_by_instance YES
-select * from performance_schema.SETUP_CONSUMERS
+select * from performance_schema.setup_consumers
where enabled='NO';
NAME ENABLED
-insert into performance_schema.SETUP_CONSUMERS
+insert into performance_schema.setup_consumers
set name='FOO', enabled='YES';
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'SETUP_CONSUMERS'
-update performance_schema.SETUP_CONSUMERS
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'setup_consumers'
+update performance_schema.setup_consumers
set name='FOO';
ERROR HY000: Invalid performance_schema usage.
-update performance_schema.SETUP_CONSUMERS
+update performance_schema.setup_consumers
set enabled='YES';
-delete from performance_schema.SETUP_CONSUMERS;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_CONSUMERS'
-delete from performance_schema.SETUP_CONSUMERS
+delete from performance_schema.setup_consumers;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'setup_consumers'
+delete from performance_schema.setup_consumers
where name='events_waits_current';
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_CONSUMERS'
-LOCK TABLES performance_schema.SETUP_CONSUMERS READ;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'setup_consumers'
+LOCK TABLES performance_schema.setup_consumers READ;
UNLOCK TABLES;
-LOCK TABLES performance_schema.SETUP_CONSUMERS WRITE;
+LOCK TABLES performance_schema.setup_consumers WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
index 7f203118346..fefc4f46061 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
@@ -1,5 +1,5 @@
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_INSTRUMENTS
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_instruments
where name like 'Wait/Synch/Mutex/sql/%'
and name not in ('wait/synch/mutex/sql/DEBUG_SYNC::mutex')
order by name limit 10;
@@ -13,8 +13,8 @@ wait/synch/mutex/sql/LOCK_active_mi YES YES
wait/synch/mutex/sql/LOCK_audit_mask YES YES
wait/synch/mutex/sql/LOCK_connection_count YES YES
wait/synch/mutex/sql/LOCK_crypt YES YES
-wait/synch/mutex/sql/LOCK_dd_owns_lock_open YES YES
-select * from performance_schema.SETUP_INSTRUMENTS
+wait/synch/mutex/sql/LOCK_delayed_create YES YES
+select * from performance_schema.setup_instruments
where name like 'Wait/Synch/Rwlock/sql/%'
and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock')
order by name limit 10;
@@ -29,7 +29,7 @@ wait/synch/rwlock/sql/MDL_context::LOCK_waiting_for YES YES
wait/synch/rwlock/sql/MDL_lock::rwlock YES YES
wait/synch/rwlock/sql/Query_cache_query::lock YES YES
wait/synch/rwlock/sql/THR_LOCK_servers YES YES
-select * from performance_schema.SETUP_INSTRUMENTS
+select * from performance_schema.setup_instruments
where name like 'Wait/Synch/Cond/sql/%'
and name not in (
'wait/synch/cond/sql/COND_handler_count',
@@ -37,7 +37,6 @@ where name like 'Wait/Synch/Cond/sql/%'
order by name limit 10;
NAME ENABLED TIMED
wait/synch/cond/sql/COND_flush_thread_cache YES YES
-wait/synch/cond/sql/COND_global_read_lock YES YES
wait/synch/cond/sql/COND_manager YES YES
wait/synch/cond/sql/COND_queue_state YES YES
wait/synch/cond/sql/COND_rpl_status YES YES
@@ -46,29 +45,30 @@ wait/synch/cond/sql/COND_thread_cache YES YES
wait/synch/cond/sql/COND_thread_count YES YES
wait/synch/cond/sql/Delayed_insert::cond YES YES
wait/synch/cond/sql/Delayed_insert::cond_client YES YES
-select * from performance_schema.SETUP_INSTRUMENTS
+wait/synch/cond/sql/Event_scheduler::COND_state YES YES
+select * from performance_schema.setup_instruments
where name='Wait';
-select * from performance_schema.SETUP_INSTRUMENTS
+select * from performance_schema.setup_instruments
where enabled='YES';
-insert into performance_schema.SETUP_INSTRUMENTS
+insert into performance_schema.setup_instruments
set name='FOO', enabled='YES', timed='YES';
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS'
-update performance_schema.SETUP_INSTRUMENTS
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'setup_instruments'
+update performance_schema.setup_instruments
set name='FOO';
ERROR HY000: Invalid performance_schema usage.
-update performance_schema.SETUP_INSTRUMENTS
+update performance_schema.setup_instruments
set enabled='NO';
-update performance_schema.SETUP_INSTRUMENTS
+update performance_schema.setup_instruments
set timed='NO';
-select * from performance_schema.SETUP_INSTRUMENTS;
-update performance_schema.SETUP_INSTRUMENTS
+select * from performance_schema.setup_instruments;
+update performance_schema.setup_instruments
set enabled='YES', timed='YES';
-delete from performance_schema.SETUP_INSTRUMENTS;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS'
-delete from performance_schema.SETUP_INSTRUMENTS
+delete from performance_schema.setup_instruments;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'setup_instruments'
+delete from performance_schema.setup_instruments
where name like 'Wait/Synch/%';
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS'
-LOCK TABLES performance_schema.SETUP_INSTRUMENTS READ;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'setup_instruments'
+LOCK TABLES performance_schema.setup_instruments READ;
UNLOCK TABLES;
-LOCK TABLES performance_schema.SETUP_INSTRUMENTS WRITE;
+LOCK TABLES performance_schema.setup_instruments WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_setup_timers.result b/mysql-test/suite/perfschema/r/dml_setup_timers.result
index a9bee916cde..ad1f6df3e81 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_timers.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_timers.result
@@ -1,33 +1,33 @@
-select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.setup_timers;
NAME TIMER_NAME
wait CYCLE
-select * from performance_schema.SETUP_TIMERS
+select * from performance_schema.setup_timers
where name='Wait';
NAME TIMER_NAME
wait CYCLE
-select * from performance_schema.SETUP_TIMERS
+select * from performance_schema.setup_timers
where timer_name='CYCLE';
NAME TIMER_NAME
wait CYCLE
-insert into performance_schema.SETUP_TIMERS
+insert into performance_schema.setup_timers
set name='FOO', timer_name='CYCLE';
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'SETUP_TIMERS'
-update performance_schema.SETUP_TIMERS
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'setup_timers'
+update performance_schema.setup_timers
set name='FOO';
ERROR HY000: Invalid performance_schema usage.
-update performance_schema.SETUP_TIMERS
+update performance_schema.setup_timers
set timer_name='MILLISECOND';
-select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.setup_timers;
NAME TIMER_NAME
wait MILLISECOND
-update performance_schema.SETUP_TIMERS
+update performance_schema.setup_timers
set timer_name='CYCLE';
-delete from performance_schema.SETUP_TIMERS;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_TIMERS'
-delete from performance_schema.SETUP_TIMERS
+delete from performance_schema.setup_timers;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'setup_timers'
+delete from performance_schema.setup_timers
where name='Wait';
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_TIMERS'
-LOCK TABLES performance_schema.SETUP_TIMERS READ;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'setup_timers'
+LOCK TABLES performance_schema.setup_timers READ;
UNLOCK TABLES;
-LOCK TABLES performance_schema.SETUP_TIMERS WRITE;
+LOCK TABLES performance_schema.setup_timers WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/dml_threads.result b/mysql-test/suite/perfschema/r/dml_threads.result
index b4fa8705c95..b78d1934d1f 100644
--- a/mysql-test/suite/perfschema/r/dml_threads.result
+++ b/mysql-test/suite/perfschema/r/dml_threads.result
@@ -1,27 +1,24 @@
-select * from performance_schema.THREADS
+select * from performance_schema.threads
where name like 'Thread/%' limit 1;
-THREAD_ID ID NAME
-# # #
-select * from performance_schema.THREADS
+select * from performance_schema.threads
where name='FOO';
-THREAD_ID ID NAME
-insert into performance_schema.THREADS
-set name='FOO', thread_id=1, id=2;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'THREADS'
-update performance_schema.THREADS
+insert into performance_schema.threads
+set name='FOO', thread_id=1, processlist_id=2;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'threads'
+update performance_schema.threads
set thread_id=12;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'THREADS'
-update performance_schema.THREADS
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'threads'
+update performance_schema.threads
set thread_id=12 where name like "FOO";
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'THREADS'
-delete from performance_schema.THREADS
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'threads'
+delete from performance_schema.threads
where id=1;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'THREADS'
-delete from performance_schema.THREADS;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'THREADS'
-LOCK TABLES performance_schema.THREADS READ;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'THREADS'
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'threads'
+delete from performance_schema.threads;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'threads'
+LOCK TABLES performance_schema.threads READ;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'threads'
UNLOCK TABLES;
-LOCK TABLES performance_schema.THREADS WRITE;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'THREADS'
+LOCK TABLES performance_schema.threads WRITE;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'threads'
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/r/func_file_io.result b/mysql-test/suite/perfschema/r/func_file_io.result
index 201254aca21..d99e77dcd8c 100644
--- a/mysql-test/suite/perfschema/r/func_file_io.result
+++ b/mysql-test/suite/perfschema/r/func_file_io.result
@@ -1,18 +1,18 @@
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
+UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
+UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/io/file/%';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
SELECT * FROM t1 WHERE id = 1;
id b
1 initial value
SET @before_count = (SELECT SUM(TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD'));
SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation;
@@ -24,15 +24,15 @@ id b
2 initial value
3 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed;
test_ff1_timed
Success
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled='NO';
+UPDATE performance_schema.setup_instruments SET enabled='NO';
SET @before_count = (SELECT SUM(TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2));
SELECT * FROM t1 WHERE id < 6;
@@ -43,40 +43,40 @@ id b
4 initial value
5 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_ff2_timed;
test_ff2_timed
Success
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
+UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/io/file/%';
-UPDATE performance_schema.SETUP_INSTRUMENTS SET timed = 'NO';
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+UPDATE performance_schema.setup_instruments SET timed = 'NO';
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
SELECT * FROM t1 WHERE id > 4;
id b
5 initial value
6 initial value
7 initial value
8 initial value
-SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+SELECT * FROM performance_schema.events_waits_history_long
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
-SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY
+SELECT * FROM performance_schema.events_waits_history
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
-SELECT * FROM performance_schema.EVENTS_WAITS_CURRENT
+SELECT * FROM performance_schema.events_waits_current
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
-UPDATE performance_schema.SETUP_INSTRUMENTS SET timed = 'YES';
+UPDATE performance_schema.setup_instruments SET timed = 'YES';
SELECT * FROM t1 WHERE id < 4;
id b
1 initial value
@@ -87,31 +87,17 @@ SELECT SUM(COUNT_READ) AS sum_count_read,
SUM(COUNT_WRITE) AS sum_count_write,
SUM(SUM_NUMBER_OF_BYTES_READ) AS sum_num_bytes_read,
SUM(SUM_NUMBER_OF_BYTES_WRITE) AS sum_num_bytes_write
-FROM performance_schema.FILE_SUMMARY_BY_INSTANCE
+FROM performance_schema.file_summary_by_instance
WHERE FILE_NAME LIKE CONCAT('%', @@tmpdir, '%') ORDER BY NULL;
SELECT EVENT_NAME, COUNT_STAR, AVG_TIMER_WAIT, SUM_TIMER_WAIT
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+FROM performance_schema.events_waits_summary_global_by_event_name
WHERE COUNT_STAR > 0
ORDER BY SUM_TIMER_WAIT DESC
LIMIT 10;
-SELECT i.user, SUM(TIMER_WAIT) SUM_WAIT
-# ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
-INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
-LEFT JOIN information_schema.PROCESSLIST i USING (ID)
-GROUP BY i.user
-ORDER BY SUM_WAIT DESC
-LIMIT 20;
SELECT h.EVENT_NAME, SUM(h.TIMER_WAIT) TOTAL_WAIT
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
-INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
-WHERE p.ID = 1
+FROM performance_schema.events_waits_history_long h
+INNER JOIN performance_schema.threads p USING (THREAD_ID)
+WHERE p.PROCESSLIST_ID = 1
GROUP BY h.EVENT_NAME
HAVING TOTAL_WAIT > 0;
-SELECT i.user, h.operation, SUM(NUMBER_OF_BYTES) bytes
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
-INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
-LEFT JOIN information_schema.PROCESSLIST i USING (ID)
-GROUP BY i.user, h.operation
-HAVING BYTES > 0
-ORDER BY i.user, h.operation;
+UPDATE performance_schema.setup_instruments SET enabled = 'YES';
diff --git a/mysql-test/suite/perfschema/r/func_mutex.result b/mysql-test/suite/perfschema/r/func_mutex.result
index e32d7267bb1..93a8ae5d218 100644
--- a/mysql-test/suite/perfschema/r/func_mutex.result
+++ b/mysql-test/suite/perfschema/r/func_mutex.result
@@ -1,19 +1,19 @@
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
+UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
+UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
SELECT * FROM t1 WHERE id = 1;
id b
1 initial value
SET @before_count = (SELECT SUM(TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT * FROM t1;
id b
@@ -26,21 +26,21 @@ id b
7 initial value
8 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_timed;
test_fm1_timed
Success
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO'
+UPDATE performance_schema.setup_instruments SET enabled = 'NO'
WHERE NAME = 'wait/synch/mutex/sql/LOCK_open';
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
SELECT * FROM t1 WHERE id = 1;
id b
1 initial value
SET @before_count = (SELECT SUM(TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT * FROM t1;
id b
@@ -53,19 +53,19 @@ id b
7 initial value
8 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_timed;
test_fm2_timed
Success
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
SELECT * FROM t1 WHERE id = 1;
id b
1 initial value
SET @before_count = (SELECT SUM(TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT * FROM t1;
id b
@@ -78,21 +78,21 @@ id b
7 initial value
8 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_rw_timed;
test_fm1_rw_timed
Success
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO'
+UPDATE performance_schema.setup_instruments SET enabled = 'NO'
WHERE NAME = 'wait/synch/rwlock/sql/LOCK_grant';
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
SELECT * FROM t1 WHERE id = 1;
id b
1 initial value
SET @before_count = (SELECT SUM(TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT * FROM t1;
id b
@@ -105,9 +105,10 @@ id b
7 initial value
8 initial value
SET @after_count = (SELECT SUM(TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed;
test_fm2_rw_timed
Success
+UPDATE performance_schema.setup_instruments SET enabled = 'YES';
DROP TABLE t1;
diff --git a/mysql-test/suite/perfschema/r/global_read_lock.result b/mysql-test/suite/perfschema/r/global_read_lock.result
index 93d6adfd049..d71bcf81ea7 100644
--- a/mysql-test/suite/perfschema/r/global_read_lock.result
+++ b/mysql-test/suite/perfschema/r/global_read_lock.result
@@ -1,32 +1,33 @@
use performance_schema;
+update performance_schema.setup_instruments set enabled='YES';
grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost;
flush privileges;
connect (con1, localhost, pfsuser, , test);
-lock tables performance_schema.SETUP_INSTRUMENTS read;
-select * from performance_schema.SETUP_INSTRUMENTS;
+lock tables performance_schema.setup_instruments read;
+select * from performance_schema.setup_instruments;
unlock tables;
-lock tables performance_schema.SETUP_INSTRUMENTS write;
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+lock tables performance_schema.setup_instruments write;
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES';
unlock tables;
connection default;
flush tables with read lock;
connection con1;
-lock tables performance_schema.SETUP_INSTRUMENTS read;
-select * from performance_schema.SETUP_INSTRUMENTS;
+lock tables performance_schema.setup_instruments read;
+select * from performance_schema.setup_instruments;
unlock tables;
-lock tables performance_schema.SETUP_INSTRUMENTS write;
+lock tables performance_schema.setup_instruments write;
connection default;
select event_name,
left(source, locate(":", source)) as short_source,
timer_end, timer_wait, operation
-from performance_schema.EVENTS_WAITS_CURRENT
-where event_name like "wait/synch/cond/sql/COND_global_read_lock";
+from performance_schema.events_waits_current
+where event_name like "wait/synch/cond/sql/MDL_context::COND_wait_status";
event_name short_source timer_end timer_wait operation
-wait/synch/cond/sql/COND_global_read_lock lock.cc: NULL NULL wait
+wait/synch/cond/sql/MDL_context::COND_wait_status mdl.cc: NULL NULL timed_wait
unlock tables;
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES';
unlock tables;
connection default;
drop user pfsuser@localhost;
diff --git a/mysql-test/suite/perfschema/r/information_schema.result b/mysql-test/suite/perfschema/r/information_schema.result
index 8e7478564fb..ab464cce687 100644
--- a/mysql-test/suite/perfschema/r/information_schema.result
+++ b/mysql-test/suite/perfschema/r/information_schema.result
@@ -1,189 +1,189 @@
-select TABLE_SCHEMA, upper(TABLE_NAME), TABLE_CATALOG
+select TABLE_SCHEMA, lower(TABLE_NAME), TABLE_CATALOG
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-TABLE_SCHEMA upper(TABLE_NAME) TABLE_CATALOG
-performance_schema COND_INSTANCES def
-performance_schema EVENTS_WAITS_CURRENT def
-performance_schema EVENTS_WAITS_HISTORY def
-performance_schema EVENTS_WAITS_HISTORY_LONG def
-performance_schema EVENTS_WAITS_SUMMARY_BY_INSTANCE def
-performance_schema EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME def
-performance_schema EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME def
-performance_schema FILE_INSTANCES def
-performance_schema FILE_SUMMARY_BY_EVENT_NAME def
-performance_schema FILE_SUMMARY_BY_INSTANCE def
-performance_schema MUTEX_INSTANCES def
-performance_schema PERFORMANCE_TIMERS def
-performance_schema RWLOCK_INSTANCES def
-performance_schema SETUP_CONSUMERS def
-performance_schema SETUP_INSTRUMENTS def
-performance_schema SETUP_TIMERS def
-performance_schema THREADS def
-select upper(TABLE_NAME), TABLE_TYPE, ENGINE
+TABLE_SCHEMA lower(TABLE_NAME) TABLE_CATALOG
+performance_schema cond_instances def
+performance_schema events_waits_current def
+performance_schema events_waits_history def
+performance_schema events_waits_history_long def
+performance_schema events_waits_summary_by_instance def
+performance_schema events_waits_summary_by_thread_by_event_name def
+performance_schema events_waits_summary_global_by_event_name def
+performance_schema file_instances def
+performance_schema file_summary_by_event_name def
+performance_schema file_summary_by_instance def
+performance_schema mutex_instances def
+performance_schema performance_timers def
+performance_schema rwlock_instances def
+performance_schema setup_consumers def
+performance_schema setup_instruments def
+performance_schema setup_timers def
+performance_schema threads def
+select lower(TABLE_NAME), TABLE_TYPE, ENGINE
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-upper(TABLE_NAME) TABLE_TYPE ENGINE
-COND_INSTANCES BASE TABLE PERFORMANCE_SCHEMA
-EVENTS_WAITS_CURRENT BASE TABLE PERFORMANCE_SCHEMA
-EVENTS_WAITS_HISTORY BASE TABLE PERFORMANCE_SCHEMA
-EVENTS_WAITS_HISTORY_LONG BASE TABLE PERFORMANCE_SCHEMA
-EVENTS_WAITS_SUMMARY_BY_INSTANCE BASE TABLE PERFORMANCE_SCHEMA
-EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME BASE TABLE PERFORMANCE_SCHEMA
-EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME BASE TABLE PERFORMANCE_SCHEMA
-FILE_INSTANCES BASE TABLE PERFORMANCE_SCHEMA
-FILE_SUMMARY_BY_EVENT_NAME BASE TABLE PERFORMANCE_SCHEMA
-FILE_SUMMARY_BY_INSTANCE BASE TABLE PERFORMANCE_SCHEMA
-MUTEX_INSTANCES BASE TABLE PERFORMANCE_SCHEMA
-PERFORMANCE_TIMERS BASE TABLE PERFORMANCE_SCHEMA
-RWLOCK_INSTANCES BASE TABLE PERFORMANCE_SCHEMA
-SETUP_CONSUMERS BASE TABLE PERFORMANCE_SCHEMA
-SETUP_INSTRUMENTS BASE TABLE PERFORMANCE_SCHEMA
-SETUP_TIMERS BASE TABLE PERFORMANCE_SCHEMA
-THREADS BASE TABLE PERFORMANCE_SCHEMA
-select upper(TABLE_NAME), VERSION, ROW_FORMAT
+lower(TABLE_NAME) TABLE_TYPE ENGINE
+cond_instances BASE TABLE PERFORMANCE_SCHEMA
+events_waits_current BASE TABLE PERFORMANCE_SCHEMA
+events_waits_history BASE TABLE PERFORMANCE_SCHEMA
+events_waits_history_long BASE TABLE PERFORMANCE_SCHEMA
+events_waits_summary_by_instance BASE TABLE PERFORMANCE_SCHEMA
+events_waits_summary_by_thread_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+events_waits_summary_global_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+file_instances BASE TABLE PERFORMANCE_SCHEMA
+file_summary_by_event_name BASE TABLE PERFORMANCE_SCHEMA
+file_summary_by_instance BASE TABLE PERFORMANCE_SCHEMA
+mutex_instances BASE TABLE PERFORMANCE_SCHEMA
+performance_timers BASE TABLE PERFORMANCE_SCHEMA
+rwlock_instances BASE TABLE PERFORMANCE_SCHEMA
+setup_consumers BASE TABLE PERFORMANCE_SCHEMA
+setup_instruments BASE TABLE PERFORMANCE_SCHEMA
+setup_timers BASE TABLE PERFORMANCE_SCHEMA
+threads BASE TABLE PERFORMANCE_SCHEMA
+select lower(TABLE_NAME), VERSION, ROW_FORMAT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-upper(TABLE_NAME) VERSION ROW_FORMAT
-COND_INSTANCES 10 Dynamic
-EVENTS_WAITS_CURRENT 10 Dynamic
-EVENTS_WAITS_HISTORY 10 Dynamic
-EVENTS_WAITS_HISTORY_LONG 10 Dynamic
-EVENTS_WAITS_SUMMARY_BY_INSTANCE 10 Dynamic
-EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME 10 Dynamic
-EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME 10 Dynamic
-FILE_INSTANCES 10 Dynamic
-FILE_SUMMARY_BY_EVENT_NAME 10 Dynamic
-FILE_SUMMARY_BY_INSTANCE 10 Dynamic
-MUTEX_INSTANCES 10 Dynamic
-PERFORMANCE_TIMERS 10 Fixed
-RWLOCK_INSTANCES 10 Dynamic
-SETUP_CONSUMERS 10 Dynamic
-SETUP_INSTRUMENTS 10 Dynamic
-SETUP_TIMERS 10 Dynamic
-THREADS 10 Dynamic
-select upper(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH
+lower(TABLE_NAME) VERSION ROW_FORMAT
+cond_instances 10 Dynamic
+events_waits_current 10 Dynamic
+events_waits_history 10 Dynamic
+events_waits_history_long 10 Dynamic
+events_waits_summary_by_instance 10 Dynamic
+events_waits_summary_by_thread_by_event_name 10 Dynamic
+events_waits_summary_global_by_event_name 10 Dynamic
+file_instances 10 Dynamic
+file_summary_by_event_name 10 Dynamic
+file_summary_by_instance 10 Dynamic
+mutex_instances 10 Dynamic
+performance_timers 10 Fixed
+rwlock_instances 10 Dynamic
+setup_consumers 10 Dynamic
+setup_instruments 10 Dynamic
+setup_timers 10 Dynamic
+threads 10 Dynamic
+select lower(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-upper(TABLE_NAME) TABLE_ROWS AVG_ROW_LENGTH
-COND_INSTANCES 1000 0
-EVENTS_WAITS_CURRENT 1000 0
-EVENTS_WAITS_HISTORY 1000 0
-EVENTS_WAITS_HISTORY_LONG 10000 0
-EVENTS_WAITS_SUMMARY_BY_INSTANCE 1000 0
-EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME 1000 0
-EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME 1000 0
-FILE_INSTANCES 1000 0
-FILE_SUMMARY_BY_EVENT_NAME 1000 0
-FILE_SUMMARY_BY_INSTANCE 1000 0
-MUTEX_INSTANCES 1000 0
-PERFORMANCE_TIMERS 5 0
-RWLOCK_INSTANCES 1000 0
-SETUP_CONSUMERS 8 0
-SETUP_INSTRUMENTS 1000 0
-SETUP_TIMERS 1 0
-THREADS 1000 0
-select upper(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH
+lower(TABLE_NAME) TABLE_ROWS AVG_ROW_LENGTH
+cond_instances 1000 0
+events_waits_current 1000 0
+events_waits_history 1000 0
+events_waits_history_long 10000 0
+events_waits_summary_by_instance 1000 0
+events_waits_summary_by_thread_by_event_name 1000 0
+events_waits_summary_global_by_event_name 1000 0
+file_instances 1000 0
+file_summary_by_event_name 1000 0
+file_summary_by_instance 1000 0
+mutex_instances 1000 0
+performance_timers 5 0
+rwlock_instances 1000 0
+setup_consumers 8 0
+setup_instruments 1000 0
+setup_timers 1 0
+threads 1000 0
+select lower(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-upper(TABLE_NAME) DATA_LENGTH MAX_DATA_LENGTH
-COND_INSTANCES 0 0
-EVENTS_WAITS_CURRENT 0 0
-EVENTS_WAITS_HISTORY 0 0
-EVENTS_WAITS_HISTORY_LONG 0 0
-EVENTS_WAITS_SUMMARY_BY_INSTANCE 0 0
-EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME 0 0
-EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME 0 0
-FILE_INSTANCES 0 0
-FILE_SUMMARY_BY_EVENT_NAME 0 0
-FILE_SUMMARY_BY_INSTANCE 0 0
-MUTEX_INSTANCES 0 0
-PERFORMANCE_TIMERS 0 0
-RWLOCK_INSTANCES 0 0
-SETUP_CONSUMERS 0 0
-SETUP_INSTRUMENTS 0 0
-SETUP_TIMERS 0 0
-THREADS 0 0
-select upper(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT
+lower(TABLE_NAME) DATA_LENGTH MAX_DATA_LENGTH
+cond_instances 0 0
+events_waits_current 0 0
+events_waits_history 0 0
+events_waits_history_long 0 0
+events_waits_summary_by_instance 0 0
+events_waits_summary_by_thread_by_event_name 0 0
+events_waits_summary_global_by_event_name 0 0
+file_instances 0 0
+file_summary_by_event_name 0 0
+file_summary_by_instance 0 0
+mutex_instances 0 0
+performance_timers 0 0
+rwlock_instances 0 0
+setup_consumers 0 0
+setup_instruments 0 0
+setup_timers 0 0
+threads 0 0
+select lower(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-upper(TABLE_NAME) INDEX_LENGTH DATA_FREE AUTO_INCREMENT
-COND_INSTANCES 0 0 NULL
-EVENTS_WAITS_CURRENT 0 0 NULL
-EVENTS_WAITS_HISTORY 0 0 NULL
-EVENTS_WAITS_HISTORY_LONG 0 0 NULL
-EVENTS_WAITS_SUMMARY_BY_INSTANCE 0 0 NULL
-EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME 0 0 NULL
-EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME 0 0 NULL
-FILE_INSTANCES 0 0 NULL
-FILE_SUMMARY_BY_EVENT_NAME 0 0 NULL
-FILE_SUMMARY_BY_INSTANCE 0 0 NULL
-MUTEX_INSTANCES 0 0 NULL
-PERFORMANCE_TIMERS 0 0 NULL
-RWLOCK_INSTANCES 0 0 NULL
-SETUP_CONSUMERS 0 0 NULL
-SETUP_INSTRUMENTS 0 0 NULL
-SETUP_TIMERS 0 0 NULL
-THREADS 0 0 NULL
-select upper(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME
+lower(TABLE_NAME) INDEX_LENGTH DATA_FREE AUTO_INCREMENT
+cond_instances 0 0 NULL
+events_waits_current 0 0 NULL
+events_waits_history 0 0 NULL
+events_waits_history_long 0 0 NULL
+events_waits_summary_by_instance 0 0 NULL
+events_waits_summary_by_thread_by_event_name 0 0 NULL
+events_waits_summary_global_by_event_name 0 0 NULL
+file_instances 0 0 NULL
+file_summary_by_event_name 0 0 NULL
+file_summary_by_instance 0 0 NULL
+mutex_instances 0 0 NULL
+performance_timers 0 0 NULL
+rwlock_instances 0 0 NULL
+setup_consumers 0 0 NULL
+setup_instruments 0 0 NULL
+setup_timers 0 0 NULL
+threads 0 0 NULL
+select lower(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-upper(TABLE_NAME) CREATE_TIME UPDATE_TIME CHECK_TIME
-COND_INSTANCES NULL NULL NULL
-EVENTS_WAITS_CURRENT NULL NULL NULL
-EVENTS_WAITS_HISTORY NULL NULL NULL
-EVENTS_WAITS_HISTORY_LONG NULL NULL NULL
-EVENTS_WAITS_SUMMARY_BY_INSTANCE NULL NULL NULL
-EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME NULL NULL NULL
-EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME NULL NULL NULL
-FILE_INSTANCES NULL NULL NULL
-FILE_SUMMARY_BY_EVENT_NAME NULL NULL NULL
-FILE_SUMMARY_BY_INSTANCE NULL NULL NULL
-MUTEX_INSTANCES NULL NULL NULL
-PERFORMANCE_TIMERS NULL NULL NULL
-RWLOCK_INSTANCES NULL NULL NULL
-SETUP_CONSUMERS NULL NULL NULL
-SETUP_INSTRUMENTS NULL NULL NULL
-SETUP_TIMERS NULL NULL NULL
-THREADS NULL NULL NULL
-select upper(TABLE_NAME), TABLE_COLLATION, CHECKSUM
+lower(TABLE_NAME) CREATE_TIME UPDATE_TIME CHECK_TIME
+cond_instances NULL NULL NULL
+events_waits_current NULL NULL NULL
+events_waits_history NULL NULL NULL
+events_waits_history_long NULL NULL NULL
+events_waits_summary_by_instance NULL NULL NULL
+events_waits_summary_by_thread_by_event_name NULL NULL NULL
+events_waits_summary_global_by_event_name NULL NULL NULL
+file_instances NULL NULL NULL
+file_summary_by_event_name NULL NULL NULL
+file_summary_by_instance NULL NULL NULL
+mutex_instances NULL NULL NULL
+performance_timers NULL NULL NULL
+rwlock_instances NULL NULL NULL
+setup_consumers NULL NULL NULL
+setup_instruments NULL NULL NULL
+setup_timers NULL NULL NULL
+threads NULL NULL NULL
+select lower(TABLE_NAME), TABLE_COLLATION, CHECKSUM
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-upper(TABLE_NAME) TABLE_COLLATION CHECKSUM
-COND_INSTANCES utf8_general_ci NULL
-EVENTS_WAITS_CURRENT utf8_general_ci NULL
-EVENTS_WAITS_HISTORY utf8_general_ci NULL
-EVENTS_WAITS_HISTORY_LONG utf8_general_ci NULL
-EVENTS_WAITS_SUMMARY_BY_INSTANCE utf8_general_ci NULL
-EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME utf8_general_ci NULL
-EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME utf8_general_ci NULL
-FILE_INSTANCES utf8_general_ci NULL
-FILE_SUMMARY_BY_EVENT_NAME utf8_general_ci NULL
-FILE_SUMMARY_BY_INSTANCE utf8_general_ci NULL
-MUTEX_INSTANCES utf8_general_ci NULL
-PERFORMANCE_TIMERS utf8_general_ci NULL
-RWLOCK_INSTANCES utf8_general_ci NULL
-SETUP_CONSUMERS utf8_general_ci NULL
-SETUP_INSTRUMENTS utf8_general_ci NULL
-SETUP_TIMERS utf8_general_ci NULL
-THREADS utf8_general_ci NULL
-select upper(TABLE_NAME), TABLE_COMMENT
+lower(TABLE_NAME) TABLE_COLLATION CHECKSUM
+cond_instances utf8_general_ci NULL
+events_waits_current utf8_general_ci NULL
+events_waits_history utf8_general_ci NULL
+events_waits_history_long utf8_general_ci NULL
+events_waits_summary_by_instance utf8_general_ci NULL
+events_waits_summary_by_thread_by_event_name utf8_general_ci NULL
+events_waits_summary_global_by_event_name utf8_general_ci NULL
+file_instances utf8_general_ci NULL
+file_summary_by_event_name utf8_general_ci NULL
+file_summary_by_instance utf8_general_ci NULL
+mutex_instances utf8_general_ci NULL
+performance_timers utf8_general_ci NULL
+rwlock_instances utf8_general_ci NULL
+setup_consumers utf8_general_ci NULL
+setup_instruments utf8_general_ci NULL
+setup_timers utf8_general_ci NULL
+threads utf8_general_ci NULL
+select lower(TABLE_NAME), TABLE_COMMENT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-upper(TABLE_NAME) TABLE_COMMENT
-COND_INSTANCES
-EVENTS_WAITS_CURRENT
-EVENTS_WAITS_HISTORY
-EVENTS_WAITS_HISTORY_LONG
-EVENTS_WAITS_SUMMARY_BY_INSTANCE
-EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
-EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
-FILE_INSTANCES
-FILE_SUMMARY_BY_EVENT_NAME
-FILE_SUMMARY_BY_INSTANCE
-MUTEX_INSTANCES
-PERFORMANCE_TIMERS
-RWLOCK_INSTANCES
-SETUP_CONSUMERS
-SETUP_INSTRUMENTS
-SETUP_TIMERS
-THREADS
+lower(TABLE_NAME) TABLE_COMMENT
+cond_instances
+events_waits_current
+events_waits_history
+events_waits_history_long
+events_waits_summary_by_instance
+events_waits_summary_by_thread_by_event_name
+events_waits_summary_global_by_event_name
+file_instances
+file_summary_by_event_name
+file_summary_by_instance
+mutex_instances
+performance_timers
+rwlock_instances
+setup_consumers
+setup_instruments
+setup_timers
+threads
diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result
index e389a4ce65c..2f66f80ed75 100644
--- a/mysql-test/suite/perfschema/r/misc.result
+++ b/mysql-test/suite/perfschema/r/misc.result
@@ -1,14 +1,14 @@
-SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+SELECT EVENT_ID FROM performance_schema.events_waits_current
WHERE THREAD_ID IN
-(SELECT THREAD_ID FROM performance_schema.THREADS)
+(SELECT THREAD_ID FROM performance_schema.threads)
AND EVENT_NAME IN
-(SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
+(SELECT NAME FROM performance_schema.setup_instruments
WHERE NAME LIKE "wait/synch/%")
LIMIT 1;
create table test.t1(a int) engine=performance_schema;
-ERROR HY000: Invalid performance_schema usage.
-create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT;
-ERROR HY000: Invalid performance_schema usage.
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+create table test.t1 like performance_schema.events_waits_current;
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
create table performance_schema.t1(a int);
ERROR 42000: CREATE command denied to user 'root'@'localhost' for table 't1'
drop table if exists test.ghost;
@@ -22,7 +22,7 @@ a b
1 3
2 4
drop table test.ghost;
-select * from performance_schema.FILE_INSTANCES
+select * from performance_schema.file_instances
where file_name like "%ghost%";
FILE_NAME EVENT_NAME OPEN_COUNT
select * from performance_schema.no_such_table;
diff --git a/mysql-test/suite/perfschema/r/myisam_file_io.result b/mysql-test/suite/perfschema/r/myisam_file_io.result
index 5d710d9183d..5cdcf6ac789 100644
--- a/mysql-test/suite/perfschema/r/myisam_file_io.result
+++ b/mysql-test/suite/perfschema/r/myisam_file_io.result
@@ -1,9 +1,9 @@
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
where name like "wait/io/file/myisam/%";
-update performance_schema.SETUP_CONSUMERS
+update performance_schema.setup_consumers
set enabled='YES';
-truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
+truncate table performance_schema.events_waits_history_long;
flush status;
drop table if exists test.no_index_tab;
create table test.no_index_tab ( a varchar(255), b int ) engine=myisam;
@@ -14,8 +14,9 @@ select event_name,
left(source, locate(":", source)) as short_source,
operation, number_of_bytes,
substring(object_name, locate("no_index_tab", object_name)) as short_name
-from performance_schema.EVENTS_WAITS_HISTORY_LONG
+from performance_schema.events_waits_history_long
where operation not like "tell"
+ and event_name like "wait/io/file/myisam/%"
order by thread_id, event_id;
event_name short_source operation number_of_bytes short_name
wait/io/file/myisam/kfile mi_create.c: create NULL no_index_tab.MYI
@@ -56,5 +57,5 @@ Performance_schema_table_handles_lost 0
Performance_schema_table_instances_lost 0
Performance_schema_thread_classes_lost 0
Performance_schema_thread_instances_lost 0
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+update performance_schema.setup_instruments set enabled='YES';
drop table test.no_index_tab;
diff --git a/mysql-test/suite/perfschema/r/no_threads.result b/mysql-test/suite/perfschema/r/no_threads.result
index 79d16809eee..89ae72c8df1 100644
--- a/mysql-test/suite/perfschema/r/no_threads.result
+++ b/mysql-test/suite/perfschema/r/no_threads.result
@@ -1,11 +1,11 @@
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_CONSUMERS set enabled='YES';
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_consumers set enabled='YES';
+update performance_schema.setup_instruments set enabled='YES'
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
drop table if exists test.t1;
-truncate table performance_schema.EVENTS_WAITS_CURRENT;
-truncate table performance_schema.EVENTS_WAITS_HISTORY;
-truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
+truncate table performance_schema.events_waits_current;
+truncate table performance_schema.events_waits_history;
+truncate table performance_schema.events_waits_history_long;
show variables like "thread_handling";
Variable_name Value
thread_handling no-threads
@@ -17,27 +17,27 @@ show variables like "performance_schema_max_thread%";
Variable_name Value
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 10
-select count(*) from performance_schema.THREADS
+select count(*) from performance_schema.threads
where name like "thread/sql/main";
count(*)
1
-select count(*) from performance_schema.THREADS
+select count(*) from performance_schema.threads
where name like "thread/sql/OneConnection";
count(*)
0
select event_name, operation,
left(source, locate(":", source)) as short_source
-from performance_schema.EVENTS_WAITS_CURRENT;
+from performance_schema.events_waits_current;
event_name operation short_source
wait/synch/mutex/mysys/THR_LOCK_myisam lock mi_create.c:
select event_name, operation,
left(source, locate(":", source)) as short_source
-from performance_schema.EVENTS_WAITS_HISTORY;
+from performance_schema.events_waits_history;
event_name operation short_source
wait/synch/mutex/mysys/THR_LOCK_myisam lock mi_create.c:
select event_name, operation,
left(source, locate(":", source)) as short_source
-from performance_schema.EVENTS_WAITS_HISTORY_LONG;
+from performance_schema.events_waits_history_long;
event_name operation short_source
wait/synch/mutex/mysys/THR_LOCK_myisam lock mi_create.c:
drop table test.t1;
diff --git a/mysql-test/suite/perfschema/r/one_thread_per_con.result b/mysql-test/suite/perfschema/r/one_thread_per_con.result
index 9677a09933a..998aba6281c 100644
--- a/mysql-test/suite/perfschema/r/one_thread_per_con.result
+++ b/mysql-test/suite/perfschema/r/one_thread_per_con.result
@@ -1,9 +1,9 @@
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
+update performance_schema.setup_instruments set enabled='YES'
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
drop table if exists test.t1;
drop table if exists test.t2;
drop table if exists test.t3;
-truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
+truncate table performance_schema.events_waits_history_long;
show variables like "thread_handling";
Variable_name Value
thread_handling one-thread-per-connection
@@ -35,4 +35,4 @@ thread/sql/one_connection
drop table test.t1;
drop table test.t2;
drop table test.t3;
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+update performance_schema.setup_instruments set enabled='YES';
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade.result b/mysql-test/suite/perfschema/r/pfs_upgrade.result
index 08991726796..2ec6a3bd1dd 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade.result
@@ -8,24 +8,24 @@ use performance_schema;
show tables like "user_table";
Tables_in_performance_schema (user_table)
user_table
-ERROR 1050 (42S01) at line 181: Table 'COND_INSTANCES' already exists
-ERROR 1050 (42S01) at line 211: Table 'EVENTS_WAITS_CURRENT' already exists
-ERROR 1050 (42S01) at line 225: Table 'EVENTS_WAITS_HISTORY' already exists
-ERROR 1050 (42S01) at line 239: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
-ERROR 1050 (42S01) at line 260: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 301: Table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 318: Table 'FILE_INSTANCES' already exists
-ERROR 1050 (42S01) at line 337: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 357: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 374: Table 'MUTEX_INSTANCES' already exists
-ERROR 1050 (42S01) at line 392: Table 'PERFORMANCE_TIMERS' already exists
-ERROR 1050 (42S01) at line 410: Table 'RWLOCK_INSTANCES' already exists
-ERROR 1050 (42S01) at line 426: Table 'SETUP_CONSUMERS' already exists
-ERROR 1050 (42S01) at line 443: Table 'SETUP_INSTRUMENTS' already exists
-ERROR 1050 (42S01) at line 459: Table 'SETUP_TIMERS' already exists
-ERROR 1050 (42S01) at line 476: Table 'THREADS' already exists
-ERROR 1644 (HY000) at line 1119: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 478: Table 'threads' already exists
+ERROR 1644 (HY000) at line 1122: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
show tables like "user_table";
Tables_in_performance_schema (user_table)
@@ -38,24 +38,24 @@ use performance_schema;
show tables like "user_view";
Tables_in_performance_schema (user_view)
user_view
-ERROR 1050 (42S01) at line 181: Table 'COND_INSTANCES' already exists
-ERROR 1050 (42S01) at line 211: Table 'EVENTS_WAITS_CURRENT' already exists
-ERROR 1050 (42S01) at line 225: Table 'EVENTS_WAITS_HISTORY' already exists
-ERROR 1050 (42S01) at line 239: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
-ERROR 1050 (42S01) at line 260: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 301: Table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 318: Table 'FILE_INSTANCES' already exists
-ERROR 1050 (42S01) at line 337: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 357: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 374: Table 'MUTEX_INSTANCES' already exists
-ERROR 1050 (42S01) at line 392: Table 'PERFORMANCE_TIMERS' already exists
-ERROR 1050 (42S01) at line 410: Table 'RWLOCK_INSTANCES' already exists
-ERROR 1050 (42S01) at line 426: Table 'SETUP_CONSUMERS' already exists
-ERROR 1050 (42S01) at line 443: Table 'SETUP_INSTRUMENTS' already exists
-ERROR 1050 (42S01) at line 459: Table 'SETUP_TIMERS' already exists
-ERROR 1050 (42S01) at line 476: Table 'THREADS' already exists
-ERROR 1644 (HY000) at line 1119: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 478: Table 'threads' already exists
+ERROR 1644 (HY000) at line 1122: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
show tables like "user_view";
Tables_in_performance_schema (user_view)
@@ -66,24 +66,24 @@ drop view test.user_view;
create procedure test.user_proc()
select "Not supposed to be here";
update mysql.proc set db='performance_schema' where name='user_proc';
-ERROR 1050 (42S01) at line 181: Table 'COND_INSTANCES' already exists
-ERROR 1050 (42S01) at line 211: Table 'EVENTS_WAITS_CURRENT' already exists
-ERROR 1050 (42S01) at line 225: Table 'EVENTS_WAITS_HISTORY' already exists
-ERROR 1050 (42S01) at line 239: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
-ERROR 1050 (42S01) at line 260: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 301: Table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 318: Table 'FILE_INSTANCES' already exists
-ERROR 1050 (42S01) at line 337: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 357: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 374: Table 'MUTEX_INSTANCES' already exists
-ERROR 1050 (42S01) at line 392: Table 'PERFORMANCE_TIMERS' already exists
-ERROR 1050 (42S01) at line 410: Table 'RWLOCK_INSTANCES' already exists
-ERROR 1050 (42S01) at line 426: Table 'SETUP_CONSUMERS' already exists
-ERROR 1050 (42S01) at line 443: Table 'SETUP_INSTRUMENTS' already exists
-ERROR 1050 (42S01) at line 459: Table 'SETUP_TIMERS' already exists
-ERROR 1050 (42S01) at line 476: Table 'THREADS' already exists
-ERROR 1644 (HY000) at line 1119: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 478: Table 'threads' already exists
+ERROR 1644 (HY000) at line 1122: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
select name from mysql.proc where db='performance_schema';
name
@@ -94,24 +94,24 @@ drop procedure test.user_proc;
create function test.user_func() returns integer
return 0;
update mysql.proc set db='performance_schema' where name='user_func';
-ERROR 1050 (42S01) at line 181: Table 'COND_INSTANCES' already exists
-ERROR 1050 (42S01) at line 211: Table 'EVENTS_WAITS_CURRENT' already exists
-ERROR 1050 (42S01) at line 225: Table 'EVENTS_WAITS_HISTORY' already exists
-ERROR 1050 (42S01) at line 239: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
-ERROR 1050 (42S01) at line 260: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 301: Table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 318: Table 'FILE_INSTANCES' already exists
-ERROR 1050 (42S01) at line 337: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 357: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 374: Table 'MUTEX_INSTANCES' already exists
-ERROR 1050 (42S01) at line 392: Table 'PERFORMANCE_TIMERS' already exists
-ERROR 1050 (42S01) at line 410: Table 'RWLOCK_INSTANCES' already exists
-ERROR 1050 (42S01) at line 426: Table 'SETUP_CONSUMERS' already exists
-ERROR 1050 (42S01) at line 443: Table 'SETUP_INSTRUMENTS' already exists
-ERROR 1050 (42S01) at line 459: Table 'SETUP_TIMERS' already exists
-ERROR 1050 (42S01) at line 476: Table 'THREADS' already exists
-ERROR 1644 (HY000) at line 1119: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 478: Table 'threads' already exists
+ERROR 1644 (HY000) at line 1122: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
select name from mysql.proc where db='performance_schema';
name
@@ -122,24 +122,24 @@ drop function test.user_func;
create event test.user_event on schedule every 1 day do
select "not supposed to be here";
update mysql.event set db='performance_schema' where name='user_event';
-ERROR 1050 (42S01) at line 181: Table 'COND_INSTANCES' already exists
-ERROR 1050 (42S01) at line 211: Table 'EVENTS_WAITS_CURRENT' already exists
-ERROR 1050 (42S01) at line 225: Table 'EVENTS_WAITS_HISTORY' already exists
-ERROR 1050 (42S01) at line 239: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
-ERROR 1050 (42S01) at line 260: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 281: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 301: Table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 318: Table 'FILE_INSTANCES' already exists
-ERROR 1050 (42S01) at line 337: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 357: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 374: Table 'MUTEX_INSTANCES' already exists
-ERROR 1050 (42S01) at line 392: Table 'PERFORMANCE_TIMERS' already exists
-ERROR 1050 (42S01) at line 410: Table 'RWLOCK_INSTANCES' already exists
-ERROR 1050 (42S01) at line 426: Table 'SETUP_CONSUMERS' already exists
-ERROR 1050 (42S01) at line 443: Table 'SETUP_INSTRUMENTS' already exists
-ERROR 1050 (42S01) at line 459: Table 'SETUP_TIMERS' already exists
-ERROR 1050 (42S01) at line 476: Table 'THREADS' already exists
-ERROR 1644 (HY000) at line 1119: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 478: Table 'threads' already exists
+ERROR 1644 (HY000) at line 1122: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
select name from mysql.event where db='performance_schema';
name
diff --git a/mysql-test/suite/perfschema/r/privilege.result b/mysql-test/suite/perfschema/r/privilege.result
index ddbc150a72a..d1831c9c4be 100644
--- a/mysql-test/suite/perfschema/r/privilege.result
+++ b/mysql-test/suite/perfschema/r/privilege.result
@@ -1,6 +1,7 @@
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
grant ALL on *.* to 'pfs_user_1'@localhost with GRANT OPTION;
grant ALL on performance_schema.* to 'pfs_user_2'@localhost
with GRANT OPTION;
@@ -34,102 +35,102 @@ grant INSERT on performance_schema.* to 'pfs_user_2'@localhost;
grant UPDATE on performance_schema.* to 'pfs_user_2'@localhost;
grant DELETE on performance_schema.* to 'pfs_user_2'@localhost;
grant LOCK TABLES on performance_schema.* to 'pfs_user_2'@localhost;
-grant ALL on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost
+grant ALL on performance_schema.setup_instruments to 'pfs_user_3'@localhost
with GRANT OPTION;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant CREATE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
-grant DROP on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
-grant REFERENCES on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant CREATE on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
+grant DROP on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
+grant REFERENCES on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant INDEX on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant INDEX on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant ALTER on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant ALTER on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant CREATE VIEW on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant CREATE VIEW on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant SHOW VIEW on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant SHOW VIEW on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant TRIGGER on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant TRIGGER on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant INSERT on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
-ERROR 42000: INSERT,GRANT command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS'
-grant DELETE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
-ERROR 42000: DELETE,GRANT command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS'
-grant SELECT on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost
+grant INSERT on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
+ERROR 42000: INSERT,GRANT command denied to user 'root'@'localhost' for table 'setup_instruments'
+grant DELETE on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
+ERROR 42000: DELETE,GRANT command denied to user 'root'@'localhost' for table 'setup_instruments'
+grant SELECT on performance_schema.setup_instruments to 'pfs_user_3'@localhost
with GRANT OPTION;
-grant UPDATE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost
+grant UPDATE on performance_schema.setup_instruments to 'pfs_user_3'@localhost
with GRANT OPTION;
-grant ALL on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost
+grant ALL on performance_schema.events_waits_current to 'pfs_user_3'@localhost
with GRANT OPTION;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant CREATE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
-grant DROP on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
-grant REFERENCES on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant CREATE on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
+grant DROP on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
+grant REFERENCES on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant INDEX on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant INDEX on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant ALTER on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant ALTER on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant CREATE VIEW on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant CREATE VIEW on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant SHOW VIEW on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant SHOW VIEW on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant TRIGGER on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant TRIGGER on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant INSERT on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
-ERROR 42000: INSERT,GRANT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-grant UPDATE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
-ERROR 42000: UPDATE,GRANT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-grant DELETE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
-ERROR 42000: DELETE,GRANT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-grant SELECT on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost
+grant INSERT on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
+ERROR 42000: INSERT,GRANT command denied to user 'root'@'localhost' for table 'events_waits_current'
+grant UPDATE on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
+ERROR 42000: UPDATE,GRANT command denied to user 'root'@'localhost' for table 'events_waits_current'
+grant DELETE on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
+ERROR 42000: DELETE,GRANT command denied to user 'root'@'localhost' for table 'events_waits_current'
+grant SELECT on performance_schema.events_waits_current to 'pfs_user_3'@localhost
with GRANT OPTION;
-grant ALL on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost
+grant ALL on performance_schema.file_instances to 'pfs_user_3'@localhost
with GRANT OPTION;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant CREATE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
-grant DROP on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
-grant REFERENCES on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant CREATE on performance_schema.file_instances to 'pfs_user_3'@localhost;
+grant DROP on performance_schema.file_instances to 'pfs_user_3'@localhost;
+grant REFERENCES on performance_schema.file_instances to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant INDEX on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant INDEX on performance_schema.file_instances to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant ALTER on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant ALTER on performance_schema.file_instances to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant CREATE VIEW on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant CREATE VIEW on performance_schema.file_instances to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant SHOW VIEW on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant SHOW VIEW on performance_schema.file_instances to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant TRIGGER on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant TRIGGER on performance_schema.file_instances to 'pfs_user_3'@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-grant INSERT on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
-ERROR 42000: INSERT,GRANT command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
-grant UPDATE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
-ERROR 42000: UPDATE,GRANT command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
-grant DELETE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
-ERROR 42000: DELETE,GRANT command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
-grant SELECT on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost
+grant INSERT on performance_schema.file_instances to 'pfs_user_3'@localhost;
+ERROR 42000: INSERT,GRANT command denied to user 'root'@'localhost' for table 'file_instances'
+grant UPDATE on performance_schema.file_instances to 'pfs_user_3'@localhost;
+ERROR 42000: UPDATE,GRANT command denied to user 'root'@'localhost' for table 'file_instances'
+grant DELETE on performance_schema.file_instances to 'pfs_user_3'@localhost;
+ERROR 42000: DELETE,GRANT command denied to user 'root'@'localhost' for table 'file_instances'
+grant SELECT on performance_schema.file_instances to 'pfs_user_3'@localhost
with GRANT OPTION;
grant LOCK TABLES on performance_schema.* to 'pfs_user_3'@localhost
with GRANT OPTION;
flush privileges;
drop table if exists test.t1;
-rename table performance_schema.SETUP_INSTRUMENTS to test.t1;
+rename table performance_schema.setup_instruments to test.t1;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-rename table performance_schema.EVENTS_WAITS_CURRENT to test.t1;
+rename table performance_schema.events_waits_current to test.t1;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-rename table performance_schema.FILE_INSTANCES to test.t1;
+rename table performance_schema.file_instances to test.t1;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-rename table performance_schema.SETUP_INSTRUMENTS to performance_schema.t1;
+rename table performance_schema.setup_instruments to performance_schema.t1;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-rename table performance_schema.EVENTS_WAITS_CURRENT to performance_schema.t1;
+rename table performance_schema.events_waits_current to performance_schema.t1;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-rename table performance_schema.FILE_INSTANCES to performance_schema.t1;
+rename table performance_schema.file_instances to performance_schema.t1;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-rename table performance_schema.SETUP_INSTRUMENTS
-to performance_schema.EVENTS_WAITS_CURRENT;
+rename table performance_schema.setup_instruments
+to performance_schema.events_waits_current;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-rename table performance_schema.EVENTS_WAITS_CURRENT
-to performance_schema.SETUP_INSTRUMENTS;
+rename table performance_schema.events_waits_current
+to performance_schema.setup_instruments;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
create procedure performance_schema.my_proc() begin end;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
@@ -139,95 +140,95 @@ create event performance_schema.my_event on schedule every 15 minute
do begin end;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
create trigger performance_schema.bi_setup_instruments
-before insert on performance_schema.SETUP_INSTRUMENTS
+before insert on performance_schema.setup_instruments
for each row begin end;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
create trigger performance_schema.bi_events_waits_current
-before insert on performance_schema.EVENTS_WAITS_CURRENT
+before insert on performance_schema.events_waits_current
for each row begin end;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
create trigger performance_schema.bi_file_instances
-before insert on performance_schema.FILE_INSTANCES
+before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
-ERROR HY000: Invalid performance_schema usage.
-create table test.t1 like performance_schema.SETUP_INSTRUMENTS;
-ERROR HY000: Invalid performance_schema usage.
-create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT;
-ERROR HY000: Invalid performance_schema usage.
-create table test.t1 like performance_schema.FILE_INSTANCES;
-ERROR HY000: Invalid performance_schema usage.
-insert into performance_schema.SETUP_INSTRUMENTS
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+create table test.t1 like performance_schema.setup_instruments;
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+create table test.t1 like performance_schema.events_waits_current;
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+create table test.t1 like performance_schema.file_instances;
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+insert into performance_schema.setup_instruments
set name="foo";
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS'
-insert into performance_schema.EVENTS_WAITS_CURRENT
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'setup_instruments'
+insert into performance_schema.events_waits_current
set name="foo";
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-insert into performance_schema.FILE_INSTANCES
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'events_waits_current'
+insert into performance_schema.file_instances
set name="foo";
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
-delete from performance_schema.SETUP_INSTRUMENTS;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS'
-delete from performance_schema.EVENTS_WAITS_CURRENT;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-delete from performance_schema.FILE_INSTANCES;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
-lock table performance_schema.SETUP_INSTRUMENTS read;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'file_instances'
+delete from performance_schema.setup_instruments;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'setup_instruments'
+delete from performance_schema.events_waits_current;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'events_waits_current'
+delete from performance_schema.file_instances;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'file_instances'
+lock table performance_schema.setup_instruments read;
unlock tables;
-lock table performance_schema.SETUP_INSTRUMENTS write;
+lock table performance_schema.setup_instruments write;
unlock tables;
-lock table performance_schema.EVENTS_WAITS_CURRENT read;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
+lock table performance_schema.events_waits_current read;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_current'
unlock tables;
-lock table performance_schema.EVENTS_WAITS_CURRENT write;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT'
+lock table performance_schema.events_waits_current write;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'events_waits_current'
unlock tables;
-lock table performance_schema.FILE_INSTANCES read;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
+lock table performance_schema.file_instances read;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'file_instances'
unlock tables;
-lock table performance_schema.FILE_INSTANCES write;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_INSTANCES'
+lock table performance_schema.file_instances write;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'file_instances'
unlock tables;
#
# WL#4818, NFS2: Can use grants to give normal user access
-# to view data from _CURRENT and _HISTORY tables
+# to view data from _current and _history tables
#
# Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3.
-# (Except for EVENTS_WAITS_CURRENT, which is granted.)
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY LIMIT 1;
+# (Except for events_waits_current, which is granted.)
+SELECT "can select" FROM performance_schema.events_waits_history LIMIT 1;
can select
can select
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY_LONG LIMIT 1;
+SELECT "can select" FROM performance_schema.events_waits_history_long LIMIT 1;
can select
can select
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_CURRENT LIMIT 1;
+SELECT "can select" FROM performance_schema.events_waits_current LIMIT 1;
can select
can select
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE LIMIT 1;
+SELECT "can select" FROM performance_schema.events_waits_summary_by_instance LIMIT 1;
can select
can select
-SELECT "can select" FROM performance_schema.FILE_SUMMARY_BY_INSTANCE LIMIT 1;
+SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
can select
can select
drop table if exists test.t1;
-rename table performance_schema.SETUP_INSTRUMENTS to test.t1;
+rename table performance_schema.setup_instruments to test.t1;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
-rename table performance_schema.EVENTS_WAITS_CURRENT to test.t1;
+rename table performance_schema.events_waits_current to test.t1;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
-rename table performance_schema.FILE_INSTANCES to test.t1;
+rename table performance_schema.file_instances to test.t1;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
-rename table performance_schema.SETUP_INSTRUMENTS to performance_schema.t1;
+rename table performance_schema.setup_instruments to performance_schema.t1;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
-rename table performance_schema.EVENTS_WAITS_CURRENT to performance_schema.t1;
+rename table performance_schema.events_waits_current to performance_schema.t1;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
-rename table performance_schema.FILE_INSTANCES to performance_schema.t1;
+rename table performance_schema.file_instances to performance_schema.t1;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
-rename table performance_schema.SETUP_INSTRUMENTS
-to performance_schema.EVENTS_WAITS_CURRENT;
+rename table performance_schema.setup_instruments
+to performance_schema.events_waits_current;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
-rename table performance_schema.EVENTS_WAITS_CURRENT
-to performance_schema.SETUP_INSTRUMENTS;
+rename table performance_schema.events_waits_current
+to performance_schema.setup_instruments;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
create procedure performance_schema.my_proc() begin end;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
@@ -237,95 +238,95 @@ create event performance_schema.my_event on schedule every 15 minute
do begin end;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
create trigger performance_schema.bi_setup_instruments
-before insert on performance_schema.SETUP_INSTRUMENTS
+before insert on performance_schema.setup_instruments
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
create trigger performance_schema.bi_events_waits_current
-before insert on performance_schema.EVENTS_WAITS_CURRENT
+before insert on performance_schema.events_waits_current
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
create trigger performance_schema.bi_file_instances
-before insert on performance_schema.FILE_INSTANCES
+before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
-ERROR HY000: Invalid performance_schema usage.
-create table test.t1 like performance_schema.SETUP_INSTRUMENTS;
-ERROR HY000: Invalid performance_schema usage.
-create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT;
-ERROR HY000: Invalid performance_schema usage.
-create table test.t1 like performance_schema.FILE_INSTANCES;
-ERROR HY000: Invalid performance_schema usage.
-insert into performance_schema.SETUP_INSTRUMENTS
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+create table test.t1 like performance_schema.setup_instruments;
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+create table test.t1 like performance_schema.events_waits_current;
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+create table test.t1 like performance_schema.file_instances;
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+insert into performance_schema.setup_instruments
set name="foo";
-ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'SETUP_INSTRUMENTS'
-insert into performance_schema.EVENTS_WAITS_CURRENT
+ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'setup_instruments'
+insert into performance_schema.events_waits_current
set name="foo";
-ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-insert into performance_schema.FILE_INSTANCES
+ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'events_waits_current'
+insert into performance_schema.file_instances
set name="foo";
-ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'FILE_INSTANCES'
-delete from performance_schema.SETUP_INSTRUMENTS;
-ERROR 42000: DELETE command denied to user 'pfs_user_1'@'localhost' for table 'SETUP_INSTRUMENTS'
-delete from performance_schema.EVENTS_WAITS_CURRENT;
-ERROR 42000: DELETE command denied to user 'pfs_user_1'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-delete from performance_schema.FILE_INSTANCES;
-ERROR 42000: DELETE command denied to user 'pfs_user_1'@'localhost' for table 'FILE_INSTANCES'
-lock table performance_schema.SETUP_INSTRUMENTS read;
+ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'file_instances'
+delete from performance_schema.setup_instruments;
+ERROR 42000: DELETE command denied to user 'pfs_user_1'@'localhost' for table 'setup_instruments'
+delete from performance_schema.events_waits_current;
+ERROR 42000: DELETE command denied to user 'pfs_user_1'@'localhost' for table 'events_waits_current'
+delete from performance_schema.file_instances;
+ERROR 42000: DELETE command denied to user 'pfs_user_1'@'localhost' for table 'file_instances'
+lock table performance_schema.setup_instruments read;
unlock tables;
-lock table performance_schema.SETUP_INSTRUMENTS write;
+lock table performance_schema.setup_instruments write;
unlock tables;
-lock table performance_schema.EVENTS_WAITS_CURRENT read;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_1'@'localhost' for table 'EVENTS_WAITS_CURRENT'
+lock table performance_schema.events_waits_current read;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_1'@'localhost' for table 'events_waits_current'
unlock tables;
-lock table performance_schema.EVENTS_WAITS_CURRENT write;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_1'@'localhost' for table 'EVENTS_WAITS_CURRENT'
+lock table performance_schema.events_waits_current write;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_1'@'localhost' for table 'events_waits_current'
unlock tables;
-lock table performance_schema.FILE_INSTANCES read;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_1'@'localhost' for table 'FILE_INSTANCES'
+lock table performance_schema.file_instances read;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_1'@'localhost' for table 'file_instances'
unlock tables;
-lock table performance_schema.FILE_INSTANCES write;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_1'@'localhost' for table 'FILE_INSTANCES'
+lock table performance_schema.file_instances write;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_1'@'localhost' for table 'file_instances'
unlock tables;
#
# WL#4818, NFS2: Can use grants to give normal user access
-# to view data from _CURRENT and _HISTORY tables
+# to view data from _current and _history tables
#
# Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3.
-# (Except for EVENTS_WAITS_CURRENT, which is granted.)
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY LIMIT 1;
+# (Except for events_waits_current, which is granted.)
+SELECT "can select" FROM performance_schema.events_waits_history LIMIT 1;
can select
can select
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY_LONG LIMIT 1;
+SELECT "can select" FROM performance_schema.events_waits_history_long LIMIT 1;
can select
can select
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_CURRENT LIMIT 1;
+SELECT "can select" FROM performance_schema.events_waits_current LIMIT 1;
can select
can select
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE LIMIT 1;
+SELECT "can select" FROM performance_schema.events_waits_summary_by_instance LIMIT 1;
can select
can select
-SELECT "can select" FROM performance_schema.FILE_SUMMARY_BY_INSTANCE LIMIT 1;
+SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
can select
can select
drop table if exists test.t1;
-rename table performance_schema.SETUP_INSTRUMENTS to test.t1;
+rename table performance_schema.setup_instruments to test.t1;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
-rename table performance_schema.EVENTS_WAITS_CURRENT to test.t1;
+rename table performance_schema.events_waits_current to test.t1;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
-rename table performance_schema.FILE_INSTANCES to test.t1;
+rename table performance_schema.file_instances to test.t1;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
-rename table performance_schema.SETUP_INSTRUMENTS to performance_schema.t1;
+rename table performance_schema.setup_instruments to performance_schema.t1;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
-rename table performance_schema.EVENTS_WAITS_CURRENT to performance_schema.t1;
+rename table performance_schema.events_waits_current to performance_schema.t1;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
-rename table performance_schema.FILE_INSTANCES to performance_schema.t1;
+rename table performance_schema.file_instances to performance_schema.t1;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
-rename table performance_schema.SETUP_INSTRUMENTS
-to performance_schema.EVENTS_WAITS_CURRENT;
+rename table performance_schema.setup_instruments
+to performance_schema.events_waits_current;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
-rename table performance_schema.EVENTS_WAITS_CURRENT
-to performance_schema.SETUP_INSTRUMENTS;
+rename table performance_schema.events_waits_current
+to performance_schema.setup_instruments;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
create procedure performance_schema.my_proc() begin end;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
@@ -335,95 +336,95 @@ create event performance_schema.my_event on schedule every 15 minute
do begin end;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
create trigger performance_schema.bi_setup_instruments
-before insert on performance_schema.SETUP_INSTRUMENTS
+before insert on performance_schema.setup_instruments
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
create trigger performance_schema.bi_events_waits_current
-before insert on performance_schema.EVENTS_WAITS_CURRENT
+before insert on performance_schema.events_waits_current
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
create trigger performance_schema.bi_file_instances
-before insert on performance_schema.FILE_INSTANCES
+before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
-ERROR HY000: Invalid performance_schema usage.
-create table test.t1 like performance_schema.SETUP_INSTRUMENTS;
-ERROR HY000: Invalid performance_schema usage.
-create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT;
-ERROR HY000: Invalid performance_schema usage.
-create table test.t1 like performance_schema.FILE_INSTANCES;
-ERROR HY000: Invalid performance_schema usage.
-insert into performance_schema.SETUP_INSTRUMENTS
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+create table test.t1 like performance_schema.setup_instruments;
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+create table test.t1 like performance_schema.events_waits_current;
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+create table test.t1 like performance_schema.file_instances;
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+insert into performance_schema.setup_instruments
set name="foo";
-ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'SETUP_INSTRUMENTS'
-insert into performance_schema.EVENTS_WAITS_CURRENT
+ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'setup_instruments'
+insert into performance_schema.events_waits_current
set name="foo";
-ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-insert into performance_schema.FILE_INSTANCES
+ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'events_waits_current'
+insert into performance_schema.file_instances
set name="foo";
-ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'FILE_INSTANCES'
-delete from performance_schema.SETUP_INSTRUMENTS;
-ERROR 42000: DELETE command denied to user 'pfs_user_2'@'localhost' for table 'SETUP_INSTRUMENTS'
-delete from performance_schema.EVENTS_WAITS_CURRENT;
-ERROR 42000: DELETE command denied to user 'pfs_user_2'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-delete from performance_schema.FILE_INSTANCES;
-ERROR 42000: DELETE command denied to user 'pfs_user_2'@'localhost' for table 'FILE_INSTANCES'
-lock table performance_schema.SETUP_INSTRUMENTS read;
+ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'file_instances'
+delete from performance_schema.setup_instruments;
+ERROR 42000: DELETE command denied to user 'pfs_user_2'@'localhost' for table 'setup_instruments'
+delete from performance_schema.events_waits_current;
+ERROR 42000: DELETE command denied to user 'pfs_user_2'@'localhost' for table 'events_waits_current'
+delete from performance_schema.file_instances;
+ERROR 42000: DELETE command denied to user 'pfs_user_2'@'localhost' for table 'file_instances'
+lock table performance_schema.setup_instruments read;
unlock tables;
-lock table performance_schema.SETUP_INSTRUMENTS write;
+lock table performance_schema.setup_instruments write;
unlock tables;
-lock table performance_schema.EVENTS_WAITS_CURRENT read;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_2'@'localhost' for table 'EVENTS_WAITS_CURRENT'
+lock table performance_schema.events_waits_current read;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_2'@'localhost' for table 'events_waits_current'
unlock tables;
-lock table performance_schema.EVENTS_WAITS_CURRENT write;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_2'@'localhost' for table 'EVENTS_WAITS_CURRENT'
+lock table performance_schema.events_waits_current write;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_2'@'localhost' for table 'events_waits_current'
unlock tables;
-lock table performance_schema.FILE_INSTANCES read;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_2'@'localhost' for table 'FILE_INSTANCES'
+lock table performance_schema.file_instances read;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_2'@'localhost' for table 'file_instances'
unlock tables;
-lock table performance_schema.FILE_INSTANCES write;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_2'@'localhost' for table 'FILE_INSTANCES'
+lock table performance_schema.file_instances write;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_2'@'localhost' for table 'file_instances'
unlock tables;
#
# WL#4818, NFS2: Can use grants to give normal user access
-# to view data from _CURRENT and _HISTORY tables
+# to view data from _current and _history tables
#
# Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3.
-# (Except for EVENTS_WAITS_CURRENT, which is granted.)
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY LIMIT 1;
+# (Except for events_waits_current, which is granted.)
+SELECT "can select" FROM performance_schema.events_waits_history LIMIT 1;
can select
can select
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY_LONG LIMIT 1;
+SELECT "can select" FROM performance_schema.events_waits_history_long LIMIT 1;
can select
can select
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_CURRENT LIMIT 1;
+SELECT "can select" FROM performance_schema.events_waits_current LIMIT 1;
can select
can select
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE LIMIT 1;
+SELECT "can select" FROM performance_schema.events_waits_summary_by_instance LIMIT 1;
can select
can select
-SELECT "can select" FROM performance_schema.FILE_SUMMARY_BY_INSTANCE LIMIT 1;
+SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
can select
can select
drop table if exists test.t1;
-rename table performance_schema.SETUP_INSTRUMENTS to test.t1;
+rename table performance_schema.setup_instruments to test.t1;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
-rename table performance_schema.EVENTS_WAITS_CURRENT to test.t1;
+rename table performance_schema.events_waits_current to test.t1;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
-rename table performance_schema.FILE_INSTANCES to test.t1;
+rename table performance_schema.file_instances to test.t1;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
-rename table performance_schema.SETUP_INSTRUMENTS to performance_schema.t1;
+rename table performance_schema.setup_instruments to performance_schema.t1;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
-rename table performance_schema.EVENTS_WAITS_CURRENT to performance_schema.t1;
+rename table performance_schema.events_waits_current to performance_schema.t1;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
-rename table performance_schema.FILE_INSTANCES to performance_schema.t1;
+rename table performance_schema.file_instances to performance_schema.t1;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
-rename table performance_schema.SETUP_INSTRUMENTS
-to performance_schema.EVENTS_WAITS_CURRENT;
+rename table performance_schema.setup_instruments
+to performance_schema.events_waits_current;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
-rename table performance_schema.EVENTS_WAITS_CURRENT
-to performance_schema.SETUP_INSTRUMENTS;
+rename table performance_schema.events_waits_current
+to performance_schema.setup_instruments;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
create procedure performance_schema.my_proc() begin end;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
@@ -433,73 +434,73 @@ create event performance_schema.my_event on schedule every 15 minute
do begin end;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
create trigger performance_schema.bi_setup_instruments
-before insert on performance_schema.SETUP_INSTRUMENTS
+before insert on performance_schema.setup_instruments
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
create trigger performance_schema.bi_events_waits_current
-before insert on performance_schema.EVENTS_WAITS_CURRENT
+before insert on performance_schema.events_waits_current
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
create trigger performance_schema.bi_file_instances
-before insert on performance_schema.FILE_INSTANCES
+before insert on performance_schema.file_instances
for each row begin end;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
-ERROR HY000: Invalid performance_schema usage.
-create table test.t1 like performance_schema.SETUP_INSTRUMENTS;
-ERROR HY000: Invalid performance_schema usage.
-create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT;
-ERROR HY000: Invalid performance_schema usage.
-create table test.t1 like performance_schema.FILE_INSTANCES;
-ERROR HY000: Invalid performance_schema usage.
-insert into performance_schema.SETUP_INSTRUMENTS
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+create table test.t1 like performance_schema.setup_instruments;
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+create table test.t1 like performance_schema.events_waits_current;
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+create table test.t1 like performance_schema.file_instances;
+ERROR HY000: Can't create table 'test.t1' (errno: 131)
+insert into performance_schema.setup_instruments
set name="foo";
-ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'SETUP_INSTRUMENTS'
-insert into performance_schema.EVENTS_WAITS_CURRENT
+ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'setup_instruments'
+insert into performance_schema.events_waits_current
set name="foo";
-ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-insert into performance_schema.FILE_INSTANCES
+ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'events_waits_current'
+insert into performance_schema.file_instances
set name="foo";
-ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'FILE_INSTANCES'
-delete from performance_schema.SETUP_INSTRUMENTS;
-ERROR 42000: DELETE command denied to user 'pfs_user_3'@'localhost' for table 'SETUP_INSTRUMENTS'
-delete from performance_schema.EVENTS_WAITS_CURRENT;
-ERROR 42000: DELETE command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-delete from performance_schema.FILE_INSTANCES;
-ERROR 42000: DELETE command denied to user 'pfs_user_3'@'localhost' for table 'FILE_INSTANCES'
-lock table performance_schema.SETUP_INSTRUMENTS read;
+ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'file_instances'
+delete from performance_schema.setup_instruments;
+ERROR 42000: DELETE command denied to user 'pfs_user_3'@'localhost' for table 'setup_instruments'
+delete from performance_schema.events_waits_current;
+ERROR 42000: DELETE command denied to user 'pfs_user_3'@'localhost' for table 'events_waits_current'
+delete from performance_schema.file_instances;
+ERROR 42000: DELETE command denied to user 'pfs_user_3'@'localhost' for table 'file_instances'
+lock table performance_schema.setup_instruments read;
unlock tables;
-lock table performance_schema.SETUP_INSTRUMENTS write;
+lock table performance_schema.setup_instruments write;
unlock tables;
-lock table performance_schema.EVENTS_WAITS_CURRENT read;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_CURRENT'
+lock table performance_schema.events_waits_current read;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_3'@'localhost' for table 'events_waits_current'
unlock tables;
-lock table performance_schema.EVENTS_WAITS_CURRENT write;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_CURRENT'
+lock table performance_schema.events_waits_current write;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_3'@'localhost' for table 'events_waits_current'
unlock tables;
-lock table performance_schema.FILE_INSTANCES read;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_3'@'localhost' for table 'FILE_INSTANCES'
+lock table performance_schema.file_instances read;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_3'@'localhost' for table 'file_instances'
unlock tables;
-lock table performance_schema.FILE_INSTANCES write;
-ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_3'@'localhost' for table 'FILE_INSTANCES'
+lock table performance_schema.file_instances write;
+ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_3'@'localhost' for table 'file_instances'
unlock tables;
#
# WL#4818, NFS2: Can use grants to give normal user access
-# to view data from _CURRENT and _HISTORY tables
+# to view data from _current and _history tables
#
# Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3.
-# (Except for EVENTS_WAITS_CURRENT, which is granted.)
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY LIMIT 1;
-ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_HISTORY'
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY_LONG LIMIT 1;
-ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_CURRENT LIMIT 1;
-can select
-can select
-SELECT "can select" FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE LIMIT 1;
-ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
-SELECT "can select" FROM performance_schema.FILE_SUMMARY_BY_INSTANCE LIMIT 1;
-ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
+# (Except for events_waits_current, which is granted.)
+SELECT "can select" FROM performance_schema.events_waits_history LIMIT 1;
+ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'events_waits_history'
+SELECT "can select" FROM performance_schema.events_waits_history_long LIMIT 1;
+ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'events_waits_history_long'
+SELECT "can select" FROM performance_schema.events_waits_current LIMIT 1;
+can select
+can select
+SELECT "can select" FROM performance_schema.events_waits_summary_by_instance LIMIT 1;
+ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'events_waits_summary_by_instance'
+SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
+ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'file_summary_by_instance'
revoke all privileges, grant option from 'pfs_user_1'@localhost;
revoke all privileges, grant option from 'pfs_user_2'@localhost;
revoke all privileges, grant option from 'pfs_user_3'@localhost;
@@ -515,63 +516,63 @@ CREATE user pfs_user_4;
# without grants
#
# Select as pfs_user_4 should fail without grant
-SELECT event_id FROM performance_schema.EVENTS_WAITS_HISTORY;
-ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_HISTORY'
-SELECT event_id FROM performance_schema.EVENTS_WAITS_HISTORY_LONG;
-ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
-SELECT event_id FROM performance_schema.EVENTS_WAITS_CURRENT;
-ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_CURRENT'
-SELECT event_name FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
-SELECT event_name FROM performance_schema.FILE_SUMMARY_BY_INSTANCE;
-ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE'
+SELECT event_id FROM performance_schema.events_waits_history;
+ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'events_waits_history'
+SELECT event_id FROM performance_schema.events_waits_history_long;
+ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'events_waits_history_long'
+SELECT event_id FROM performance_schema.events_waits_current;
+ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'events_waits_current'
+SELECT event_name FROM performance_schema.events_waits_summary_by_instance;
+ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'events_waits_summary_by_instance'
+SELECT event_name FROM performance_schema.file_summary_by_instance;
+ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'file_summary_by_instance'
#
# WL#4818, NFS3: Normal user does not have access to change what is
# instrumented without grants
#
# User pfs_user_4 should not be allowed to tweak instrumentation without
# explicit grant
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
-ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table 'SETUP_INSTRUMENTS'
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
+UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
+ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table 'setup_instruments'
+UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
-ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table 'SETUP_INSTRUMENTS'
-UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES';
-ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table 'SETUP_CONSUMERS'
-UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'TICK';
-ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table 'SETUP_TIMERS'
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-ERROR 42000: DROP command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG'
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-ERROR 42000: DROP command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_HISTORY'
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
-ERROR 42000: DROP command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_CURRENT'
+ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table 'setup_instruments'
+UPDATE performance_schema.setup_consumers SET enabled = 'YES';
+ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table 'setup_consumers'
+UPDATE performance_schema.setup_timers SET timer_name = 'TICK';
+ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table 'setup_timers'
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+ERROR 42000: DROP command denied to user 'pfs_user_4'@'localhost' for table 'events_waits_history_long'
+TRUNCATE TABLE performance_schema.events_waits_history;
+ERROR 42000: DROP command denied to user 'pfs_user_4'@'localhost' for table 'events_waits_history'
+TRUNCATE TABLE performance_schema.events_waits_current;
+ERROR 42000: DROP command denied to user 'pfs_user_4'@'localhost' for table 'events_waits_current'
#
# WL#4814, NFS1: Can use grants to give normal user access
# to turn on and off instrumentation
#
# Grant access to change tables with the root account
-GRANT UPDATE ON performance_schema.SETUP_CONSUMERS TO pfs_user_4;
-GRANT UPDATE ON performance_schema.SETUP_TIMERS TO pfs_user_4;
-GRANT UPDATE, SELECT ON performance_schema.SETUP_INSTRUMENTS TO pfs_user_4;
-GRANT DROP ON performance_schema.EVENTS_WAITS_CURRENT TO pfs_user_4;
-GRANT DROP ON performance_schema.EVENTS_WAITS_HISTORY TO pfs_user_4;
-GRANT DROP ON performance_schema.EVENTS_WAITS_HISTORY_LONG TO pfs_user_4;
+GRANT UPDATE ON performance_schema.setup_consumers TO pfs_user_4;
+GRANT UPDATE ON performance_schema.setup_timers TO pfs_user_4;
+GRANT UPDATE, SELECT ON performance_schema.setup_instruments TO pfs_user_4;
+GRANT DROP ON performance_schema.events_waits_current TO pfs_user_4;
+GRANT DROP ON performance_schema.events_waits_history TO pfs_user_4;
+GRANT DROP ON performance_schema.events_waits_history_long TO pfs_user_4;
# User pfs_user_4 should now be allowed to tweak instrumentation
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
+UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
+UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
-UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES';
-UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'TICK';
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+UPDATE performance_schema.setup_consumers SET enabled = 'YES';
+UPDATE performance_schema.setup_timers SET timer_name = 'TICK';
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
# Clean up
REVOKE ALL PRIVILEGES, GRANT OPTION FROM pfs_user_4;
DROP USER pfs_user_4;
flush privileges;
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
-UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES';
-UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'CYCLE';
+UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
+UPDATE performance_schema.setup_consumers SET enabled = 'YES';
+UPDATE performance_schema.setup_timers SET timer_name = 'CYCLE';
diff --git a/mysql-test/suite/perfschema/r/query_cache.result b/mysql-test/suite/perfschema/r/query_cache.result
index a0aeac5a916..c7ac3d499b4 100644
--- a/mysql-test/suite/perfschema/r/query_cache.result
+++ b/mysql-test/suite/perfschema/r/query_cache.result
@@ -33,10 +33,10 @@ Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
-select spins from performance_schema.EVENTS_WAITS_CURRENT order by event_name limit 1;
+select spins from performance_schema.events_waits_current order by event_name limit 1;
spins
NULL
-select name from performance_schema.SETUP_INSTRUMENTS order by name limit 1;
+select name from performance_schema.setup_instruments order by name limit 1;
name
wait/io/file/csv/data
show status like "Qcache_queries_in_cache";
@@ -48,10 +48,10 @@ Qcache_inserts 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
-select spins from performance_schema.EVENTS_WAITS_CURRENT order by event_name limit 1;
+select spins from performance_schema.events_waits_current order by event_name limit 1;
spins
NULL
-select name from performance_schema.SETUP_INSTRUMENTS order by name limit 1;
+select name from performance_schema.setup_instruments order by name limit 1;
name
wait/io/file/csv/data
show status like "Qcache_queries_in_cache";
diff --git a/mysql-test/suite/perfschema/r/read_only.result b/mysql-test/suite/perfschema/r/read_only.result
index 6a30eb4ab8b..19108326f1b 100644
--- a/mysql-test/suite/perfschema/r/read_only.result
+++ b/mysql-test/suite/perfschema/r/read_only.result
@@ -13,9 +13,9 @@ show grants;
Grants for pfsuser@localhost
GRANT USAGE ON *.* TO 'pfsuser'@'localhost'
GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost'
-select * from performance_schema.SETUP_INSTRUMENTS;
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+select * from performance_schema.setup_instruments;
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES';
connection default;
set global read_only=1;
connection con1;
@@ -26,9 +26,9 @@ show grants;
Grants for pfsuser@localhost
GRANT USAGE ON *.* TO 'pfsuser'@'localhost'
GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost'
-select * from performance_schema.SETUP_INSTRUMENTS;
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+select * from performance_schema.setup_instruments;
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES';
connection default;
grant super on *.* to pfsuser@localhost;
flush privileges;
@@ -40,9 +40,9 @@ show grants;
Grants for pfsuser@localhost
GRANT SUPER ON *.* TO 'pfsuser'@'localhost'
GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost'
-select * from performance_schema.SETUP_INSTRUMENTS;
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+select * from performance_schema.setup_instruments;
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES';
connection default;
set global read_only= @start_read_only;
drop user pfsuser@localhost;
diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result
new file mode 100644
index 00000000000..e2f8270b1f0
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/relaylog.result
@@ -0,0 +1,169 @@
+include/master-slave.inc
+[connection master]
+drop table if exists test.t1;
+reset master;
+create table test.t1(a int);
+drop table test.t1;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; create table test.t1(a int)
+slave-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+"============ Performance schema on master ============"
+select
+substring(file_name, locate("master-", file_name)) as FILE_NAME,
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_instance
+where file_name like "%master-%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
+master-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
+select * from performance_schema.file_summary_by_instance
+where file_name like "%slave-%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+"Expect a master binlog + binlog_index"
+select
+substring(file_name, locate("master-", file_name)) as FILE_NAME,
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_instance
+where event_name like "%binlog%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
+master-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
+select
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_event_name
+where event_name like "%binlog%" order by event_name;
+EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+wait/io/file/sql/binlog MANY MANY MANY MANY
+wait/io/file/sql/binlog_index NONE MANY NONE MANY
+select
+EVENT_NAME,
+if (count_star > 0, "MANY", "NONE") as COUNT_STAR
+from performance_schema.events_waits_summary_global_by_event_name
+where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+EVENT_NAME COUNT_STAR
+wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
+wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond MANY
+wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
+wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
+"Expect no slave relay log"
+select * from performance_schema.file_summary_by_instance
+where event_name like "%relaylog%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+select * from performance_schema.file_summary_by_event_name
+where event_name like "%relaylog%" order by event_name;
+EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+wait/io/file/sql/relaylog 0 0 0 0
+wait/io/file/sql/relaylog_index 0 0 0 0
+select * from performance_schema.events_waits_summary_global_by_event_name
+where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
+wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond 0 0 0 0 0
+wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 0 0 0 0 0
+"============ Performance schema on slave ============"
+select * from performance_schema.file_summary_by_instance
+where file_name like "%master-%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+select
+substring(file_name, locate("slave-", file_name)) as FILE_NAME,
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_instance
+where file_name like "%slave-%"
+ and (file_name not like "%slave-relay-bin.0%"
+ or file_name like "%slave-relay-bin.000001"
+ or file_name like "%slave-relay-bin.000002")
+order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
+slave-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
+slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY
+slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY
+slave-relay-bin.index wait/io/file/sql/relaylog_index MANY MANY MANY MANY
+"Expect a slave binlog + binlog_index"
+select
+substring(file_name, locate("slave-", file_name)) as FILE_NAME,
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_instance
+where event_name like "%binlog%" order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
+slave-bin.index wait/io/file/sql/binlog_index NONE MANY NONE MANY
+select
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_event_name
+where event_name like "%binlog%" order by event_name;
+EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+wait/io/file/sql/binlog MANY MANY MANY MANY
+wait/io/file/sql/binlog_index NONE MANY NONE MANY
+select
+EVENT_NAME,
+if (count_star > 0, "MANY", "NONE") as COUNT_STAR
+from performance_schema.events_waits_summary_global_by_event_name
+where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+EVENT_NAME COUNT_STAR
+wait/synch/cond/sql/MYSQL_BIN_LOG::COND_prep_xids NONE
+wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond NONE
+wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
+wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_prep_xids NONE
+"Expect a slave relay log"
+select
+substring(file_name, locate("slave-", file_name)) as FILE_NAME,
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_instance
+where event_name like "%relaylog%"
+ and (file_name not like "%slave-relay-bin.0%"
+ or file_name like "%slave-relay-bin.000001"
+ or file_name like "%slave-relay-bin.000002")
+order by file_name;
+FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY
+slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY
+slave-relay-bin.index wait/io/file/sql/relaylog_index MANY MANY MANY MANY
+select
+EVENT_NAME,
+if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+from performance_schema.file_summary_by_event_name
+where event_name like "%relaylog%" order by event_name;
+EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
+wait/io/file/sql/relaylog MANY MANY MANY MANY
+wait/io/file/sql/relaylog_index MANY MANY MANY MANY
+select
+EVENT_NAME,
+if (count_star > 0, "MANY", "NONE") as COUNT_STAR
+from performance_schema.events_waits_summary_global_by_event_name
+where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+EVENT_NAME COUNT_STAR
+wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond MANY
+wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index MANY
+include/stop_slave.inc
diff --git a/mysql-test/suite/perfschema/r/schema.result b/mysql-test/suite/perfschema/r/schema.result
index a802539b7e0..5bafa137af5 100644
--- a/mysql-test/suite/perfschema/r/schema.result
+++ b/mysql-test/suite/perfschema/r/schema.result
@@ -8,32 +8,32 @@ test
use performance_schema;
show tables;
Tables_in_performance_schema
-COND_INSTANCES
-EVENTS_WAITS_CURRENT
-EVENTS_WAITS_HISTORY
-EVENTS_WAITS_HISTORY_LONG
-EVENTS_WAITS_SUMMARY_BY_INSTANCE
-EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
-EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
-FILE_INSTANCES
-FILE_SUMMARY_BY_EVENT_NAME
-FILE_SUMMARY_BY_INSTANCE
-MUTEX_INSTANCES
-PERFORMANCE_TIMERS
-RWLOCK_INSTANCES
-SETUP_CONSUMERS
-SETUP_INSTRUMENTS
-SETUP_TIMERS
-THREADS
-show create table COND_INSTANCES;
-Table Create Table
-COND_INSTANCES CREATE TABLE `COND_INSTANCES` (
+cond_instances
+events_waits_current
+events_waits_history
+events_waits_history_long
+events_waits_summary_by_instance
+events_waits_summary_by_thread_by_event_name
+events_waits_summary_global_by_event_name
+file_instances
+file_summary_by_event_name
+file_summary_by_instance
+mutex_instances
+performance_timers
+rwlock_instances
+setup_consumers
+setup_instruments
+setup_timers
+threads
+show create table cond_instances;
+Table Create Table
+cond_instances CREATE TABLE `cond_instances` (
`NAME` varchar(128) NOT NULL,
`OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table EVENTS_WAITS_CURRENT;
+show create table events_waits_current;
Table Create Table
-EVENTS_WAITS_CURRENT CREATE TABLE `EVENTS_WAITS_CURRENT` (
+events_waits_current CREATE TABLE `events_waits_current` (
`THREAD_ID` int(11) NOT NULL,
`EVENT_ID` bigint(20) unsigned NOT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
@@ -51,9 +51,9 @@ EVENTS_WAITS_CURRENT CREATE TABLE `EVENTS_WAITS_CURRENT` (
`NUMBER_OF_BYTES` bigint(20) unsigned DEFAULT NULL,
`FLAGS` int(10) unsigned DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table EVENTS_WAITS_HISTORY;
+show create table events_waits_history;
Table Create Table
-EVENTS_WAITS_HISTORY CREATE TABLE `EVENTS_WAITS_HISTORY` (
+events_waits_history CREATE TABLE `events_waits_history` (
`THREAD_ID` int(11) NOT NULL,
`EVENT_ID` bigint(20) unsigned NOT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
@@ -71,9 +71,9 @@ EVENTS_WAITS_HISTORY CREATE TABLE `EVENTS_WAITS_HISTORY` (
`NUMBER_OF_BYTES` bigint(20) unsigned DEFAULT NULL,
`FLAGS` int(10) unsigned DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table EVENTS_WAITS_HISTORY_LONG;
+show create table events_waits_history_long;
Table Create Table
-EVENTS_WAITS_HISTORY_LONG CREATE TABLE `EVENTS_WAITS_HISTORY_LONG` (
+events_waits_history_long CREATE TABLE `events_waits_history_long` (
`THREAD_ID` int(11) NOT NULL,
`EVENT_ID` bigint(20) unsigned NOT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
@@ -91,9 +91,9 @@ EVENTS_WAITS_HISTORY_LONG CREATE TABLE `EVENTS_WAITS_HISTORY_LONG` (
`NUMBER_OF_BYTES` bigint(20) unsigned DEFAULT NULL,
`FLAGS` int(10) unsigned DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table EVENTS_WAITS_SUMMARY_BY_INSTANCE;
+show create table events_waits_summary_by_instance;
Table Create Table
-EVENTS_WAITS_SUMMARY_BY_INSTANCE CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_INSTANCE` (
+events_waits_summary_by_instance CREATE TABLE `events_waits_summary_by_instance` (
`EVENT_NAME` varchar(128) NOT NULL,
`OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
`COUNT_STAR` bigint(20) unsigned NOT NULL,
@@ -102,9 +102,9 @@ EVENTS_WAITS_SUMMARY_BY_INSTANCE CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_INSTANCE`
`AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+show create table events_waits_summary_by_thread_by_event_name;
Table Create Table
-EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME` (
+events_waits_summary_by_thread_by_event_name CREATE TABLE `events_waits_summary_by_thread_by_event_name` (
`THREAD_ID` int(11) NOT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
`COUNT_STAR` bigint(20) unsigned NOT NULL,
@@ -113,9 +113,9 @@ EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME CREATE TABLE `EVENTS_WAITS_SUMMARY_
`AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
+show create table events_waits_summary_global_by_event_name;
Table Create Table
-EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME CREATE TABLE `EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME` (
+events_waits_summary_global_by_event_name CREATE TABLE `events_waits_summary_global_by_event_name` (
`EVENT_NAME` varchar(128) NOT NULL,
`COUNT_STAR` bigint(20) unsigned NOT NULL,
`SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
@@ -123,25 +123,25 @@ EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME CREATE TABLE `EVENTS_WAITS_SUMMARY_GLO
`AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
`MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table FILE_INSTANCES;
+show create table file_instances;
Table Create Table
-FILE_INSTANCES CREATE TABLE `FILE_INSTANCES` (
+file_instances CREATE TABLE `file_instances` (
`FILE_NAME` varchar(512) NOT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
`OPEN_COUNT` int(10) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table FILE_SUMMARY_BY_EVENT_NAME;
+show create table file_summary_by_event_name;
Table Create Table
-FILE_SUMMARY_BY_EVENT_NAME CREATE TABLE `FILE_SUMMARY_BY_EVENT_NAME` (
+file_summary_by_event_name CREATE TABLE `file_summary_by_event_name` (
`EVENT_NAME` varchar(128) NOT NULL,
`COUNT_READ` bigint(20) unsigned NOT NULL,
`COUNT_WRITE` bigint(20) unsigned NOT NULL,
`SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
`SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table FILE_SUMMARY_BY_INSTANCE;
+show create table file_summary_by_instance;
Table Create Table
-FILE_SUMMARY_BY_INSTANCE CREATE TABLE `FILE_SUMMARY_BY_INSTANCE` (
+file_summary_by_instance CREATE TABLE `file_summary_by_instance` (
`FILE_NAME` varchar(512) NOT NULL,
`EVENT_NAME` varchar(128) NOT NULL,
`COUNT_READ` bigint(20) unsigned NOT NULL,
@@ -149,52 +149,52 @@ FILE_SUMMARY_BY_INSTANCE CREATE TABLE `FILE_SUMMARY_BY_INSTANCE` (
`SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
`SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table MUTEX_INSTANCES;
+show create table mutex_instances;
Table Create Table
-MUTEX_INSTANCES CREATE TABLE `MUTEX_INSTANCES` (
+mutex_instances CREATE TABLE `mutex_instances` (
`NAME` varchar(128) NOT NULL,
`OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
`LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table PERFORMANCE_TIMERS;
+show create table performance_timers;
Table Create Table
-PERFORMANCE_TIMERS CREATE TABLE `PERFORMANCE_TIMERS` (
+performance_timers CREATE TABLE `performance_timers` (
`TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL,
`TIMER_FREQUENCY` bigint(20) DEFAULT NULL,
`TIMER_RESOLUTION` bigint(20) DEFAULT NULL,
`TIMER_OVERHEAD` bigint(20) DEFAULT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table RWLOCK_INSTANCES;
+show create table rwlock_instances;
Table Create Table
-RWLOCK_INSTANCES CREATE TABLE `RWLOCK_INSTANCES` (
+rwlock_instances CREATE TABLE `rwlock_instances` (
`NAME` varchar(128) NOT NULL,
`OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
`WRITE_LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL,
`READ_LOCKED_BY_COUNT` int(10) unsigned NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table SETUP_CONSUMERS;
+show create table setup_consumers;
Table Create Table
-SETUP_CONSUMERS CREATE TABLE `SETUP_CONSUMERS` (
+setup_consumers CREATE TABLE `setup_consumers` (
`NAME` varchar(64) NOT NULL,
`ENABLED` enum('YES','NO') NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table SETUP_INSTRUMENTS;
+show create table setup_instruments;
Table Create Table
-SETUP_INSTRUMENTS CREATE TABLE `SETUP_INSTRUMENTS` (
+setup_instruments CREATE TABLE `setup_instruments` (
`NAME` varchar(128) NOT NULL,
`ENABLED` enum('YES','NO') NOT NULL,
`TIMED` enum('YES','NO') NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table SETUP_TIMERS;
+show create table setup_timers;
Table Create Table
-SETUP_TIMERS CREATE TABLE `SETUP_TIMERS` (
+setup_timers CREATE TABLE `setup_timers` (
`NAME` varchar(64) NOT NULL,
`TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table THREADS;
+show create table threads;
Table Create Table
-THREADS CREATE TABLE `THREADS` (
+threads CREATE TABLE `threads` (
`THREAD_ID` int(11) NOT NULL,
- `ID` int(11) NOT NULL,
- `NAME` varchar(64) NOT NULL
+ `PROCESSLIST_ID` int(11) DEFAULT NULL,
+ `NAME` varchar(128) NOT NULL
) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
diff --git a/mysql-test/suite/perfschema/r/selects.result b/mysql-test/suite/perfschema/r/selects.result
index dfc9007c740..a3d0931cf4c 100644
--- a/mysql-test/suite/perfschema/r/selects.result
+++ b/mysql-test/suite/perfschema/r/selects.result
@@ -1,38 +1,38 @@
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
+UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
SELECT OPERATION, SUM(NUMBER_OF_BYTES) AS TOTAL
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
GROUP BY OPERATION
HAVING TOTAL IS NOT NULL
ORDER BY OPERATION
LIMIT 1;
OPERATION TOTAL
chsize [NUM_BYTES]
-SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+SELECT EVENT_ID FROM performance_schema.events_waits_current
WHERE THREAD_ID IN
-(SELECT THREAD_ID FROM performance_schema.THREADS)
+(SELECT THREAD_ID FROM performance_schema.threads)
AND EVENT_NAME IN
-(SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
+(SELECT NAME FROM performance_schema.setup_instruments
WHERE NAME LIKE "wait/synch/%")
LIMIT 1;
EVENT_ID
[EVENT_ID]
SELECT DISTINCT EVENT_ID
-FROM performance_schema.EVENTS_WAITS_CURRENT
-JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID)
-JOIN performance_schema.EVENTS_WAITS_HISTORY_LONG USING (EVENT_ID)
+FROM performance_schema.events_waits_current
+JOIN performance_schema.events_waits_history USING (EVENT_ID)
+JOIN performance_schema.events_waits_history_long USING (EVENT_ID)
ORDER BY EVENT_ID
LIMIT 1;
EVENT_ID
[EVENT_ID]
SELECT t1.THREAD_ID, t2.EVENT_ID, t3.EVENT_NAME, t4.TIMER_WAIT
-FROM performance_schema.EVENTS_WAITS_HISTORY t1
-JOIN performance_schema.EVENTS_WAITS_HISTORY t2 USING (EVENT_ID)
-JOIN performance_schema.EVENTS_WAITS_HISTORY t3 ON (t2.THREAD_ID = t3.THREAD_ID)
-JOIN performance_schema.EVENTS_WAITS_HISTORY t4 ON (t3.EVENT_NAME = t4.EVENT_NAME)
+FROM performance_schema.events_waits_history t1
+JOIN performance_schema.events_waits_history t2 USING (EVENT_ID)
+JOIN performance_schema.events_waits_history t3 ON (t2.THREAD_ID = t3.THREAD_ID)
+JOIN performance_schema.events_waits_history t4 ON (t3.EVENT_NAME = t4.EVENT_NAME)
ORDER BY t1.EVENT_ID, t2.EVENT_ID
LIMIT 5;
THREAD_ID EVENT_ID EVENT_NAME TIMER_WAIT
@@ -42,11 +42,11 @@ THREAD_ID EVENT_ID EVENT_NAME TIMER_WAIT
[THREAD_ID] [EVENT_ID] [EVENT_NAME] [TIMER_WAIT]
[THREAD_ID] [EVENT_ID] [EVENT_NAME] [TIMER_WAIT]
SELECT THREAD_ID, EVENT_ID FROM (
-SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+SELECT THREAD_ID, EVENT_ID FROM performance_schema.events_waits_current
UNION
-SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_HISTORY
+SELECT THREAD_ID, EVENT_ID FROM performance_schema.events_waits_history
UNION
-SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+SELECT THREAD_ID, EVENT_ID FROM performance_schema.events_waits_history_long
) t1 ORDER BY THREAD_ID, EVENT_ID
LIMIT 5;
THREAD_ID EVENT_ID
@@ -58,14 +58,14 @@ THREAD_ID EVENT_ID
DROP TABLE IF EXISTS t_event;
DROP EVENT IF EXISTS t_ps_event;
CREATE TABLE t_event AS
-SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+SELECT EVENT_ID FROM performance_schema.events_waits_current
WHERE 1 = 2;
CREATE EVENT t_ps_event
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
DO INSERT INTO t_event
SELECT DISTINCT EVENT_ID
-FROM performance_schema.EVENTS_WAITS_CURRENT
-JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID)
+FROM performance_schema.events_waits_current
+JOIN performance_schema.events_waits_history USING (EVENT_ID)
ORDER BY EVENT_ID
LIMIT 1;
ALTER TABLE t1 ADD COLUMN c INT;
@@ -73,7 +73,7 @@ DROP TRIGGER IF EXISTS t_ps_trigger;
CREATE TRIGGER t_ps_trigger BEFORE INSERT ON t1
FOR EACH ROW BEGIN
SET NEW.c = (SELECT MAX(EVENT_ID)
-FROM performance_schema.EVENTS_WAITS_CURRENT);
+FROM performance_schema.events_waits_current);
END;
|
INSERT INTO t1 (id) VALUES (11), (12), (13);
@@ -84,22 +84,22 @@ id c
13 [EVENT_ID]
DROP TRIGGER t_ps_trigger;
DROP PROCEDURE IF EXISTS t_ps_proc;
-CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT)
+CREATE PROCEDURE t_ps_proc(IN conid INT, OUT pid INT)
BEGIN
-SELECT id FROM performance_schema.THREADS
-WHERE THREAD_ID = tid INTO pid;
+SELECT thread_id FROM performance_schema.threads
+WHERE PROCESSLIST_ID = conid INTO pid;
END;
|
-CALL t_ps_proc(0, @p_id);
+CALL t_ps_proc(connection_id(), @p_id);
DROP FUNCTION IF EXISTS t_ps_proc;
-CREATE FUNCTION t_ps_func(tid INT) RETURNS int
+CREATE FUNCTION t_ps_func(conid INT) RETURNS int
BEGIN
-return (SELECT id FROM performance_schema.THREADS
-WHERE THREAD_ID = tid);
+return (SELECT thread_id FROM performance_schema.threads
+WHERE PROCESSLIST_ID = conid);
END;
|
-SELECT t_ps_func(0) = @p_id;
-t_ps_func(0) = @p_id
+SELECT t_ps_func(connection_id()) = @p_id;
+t_ps_func(connection_id()) = @p_id
1
SELECT * FROM t_event;
EVENT_ID
diff --git a/mysql-test/suite/perfschema/r/server_init.result b/mysql-test/suite/perfschema/r/server_init.result
index 0c1e06d157c..26104197686 100644
--- a/mysql-test/suite/perfschema/r/server_init.result
+++ b/mysql-test/suite/perfschema/r/server_init.result
@@ -1,209 +1,193 @@
use performance_schema;
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_threads";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_malloc";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_open";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_isam";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_heap";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_net";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_charset";
count(name)
1
-select count(name) from MUTEX_INSTANCES
-where name like "wait/synch/mutex/mysys/THR_LOCK_time";
-count(name)
-1
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/mysys/THR_COND_threads";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_open";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_thread_count";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_status";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_error_log";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_delayed_insert";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_uuid_generator";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_delayed_status";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_delayed_create";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_crypt";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_slave_list";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_active_mi";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_manager";
count(name)
1
-select count(name) from MUTEX_INSTANCES
-where name like "wait/synch/mutex/sql/LOCK_global_read_lock";
-count(name)
-1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_global_system_variables";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_user_conn";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_prepared_stmt_count";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_connection_count";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_server_started";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_rpl_status";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/Query_cache::structure_guard_mutex";
count(name)
1
-select count(name) from MUTEX_INSTANCES
-where name like "wait/synch/mutex/sql/LOCK_event_metadata";
-count(name)
-1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_event_queue";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_user_locks";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/Cversion_lock";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_audit_mask";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_xid_cache";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_plugin";
count(name)
1
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/tz_LOCK";
count(name)
1
-select count(name) from RWLOCK_INSTANCES
+select count(name) from rwlock_instances
where name like "wait/synch/rwlock/sql/LOCK_grant";
count(name)
1
-select count(name) from RWLOCK_INSTANCES
+select count(name) from rwlock_instances
where name like "wait/synch/rwlock/sql/LOCK_sys_init_connect";
count(name)
1
-select count(name) from RWLOCK_INSTANCES
+select count(name) from rwlock_instances
where name like "wait/synch/rwlock/sql/LOCK_sys_init_slave";
count(name)
1
-select count(name) from RWLOCK_INSTANCES
+select count(name) from rwlock_instances
where name like "wait/synch/rwlock/sql/LOCK_system_variables_hash";
count(name)
1
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_server_started";
count(name)
1
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_refresh";
count(name)
0
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_thread_count";
count(name)
1
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_manager";
count(name)
1
-select count(name) from COND_INSTANCES
-where name like "wait/synch/cond/sql/COND_global_read_lock";
-count(name)
-1
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_thread_cache";
count(name)
1
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_flush_thread_cache";
count(name)
1
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_rpl_status";
count(name)
1
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/Query_cache::COND_cache_status_changed";
count(name)
1
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_queue_state";
count(name)
1
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
index d03e227fc83..f32ffe327a2 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
@@ -5,35 +5,35 @@ mtr
mysql
performance_schema
test
-select count(*) from performance_schema.PERFORMANCE_TIMERS;
+select count(*) from performance_schema.performance_timers;
count(*)
5
-select count(*) from performance_schema.SETUP_CONSUMERS;
+select count(*) from performance_schema.setup_consumers;
count(*)
8
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-select count(*) from performance_schema.SETUP_TIMERS;
+select count(*) from performance_schema.setup_timers;
count(*)
1
-select * from performance_schema.COND_INSTANCES;
-select * from performance_schema.EVENTS_WAITS_CURRENT;
-select * from performance_schema.EVENTS_WAITS_HISTORY;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-select * from performance_schema.FILE_INSTANCES;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.RWLOCK_INSTANCES;
-select * from performance_schema.SETUP_CONSUMERS;
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_TIMERS;
-select * from performance_schema.THREADS;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.threads;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
@@ -57,7 +57,7 @@ show status like "performance_schema%";
show variables like "performance_schema_max_cond_classes";
Variable_name Value
performance_schema_max_cond_classes 0
-select count(*) from performance_schema.SETUP_INSTRUMENTS
+select count(*) from performance_schema.setup_instruments
where name like "wait/synch/cond/%";
count(*)
0
@@ -65,7 +65,7 @@ select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_COND_CLASSES_LOST';
variable_value > 0
1
-select count(*) from performance_schema.COND_INSTANCES;
+select count(*) from performance_schema.cond_instances;
count(*)
0
show status like "performance_schema_cond_instances_lost";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
index 812dc329aaf..ef853ccc710 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
@@ -5,35 +5,35 @@ mtr
mysql
performance_schema
test
-select count(*) from performance_schema.PERFORMANCE_TIMERS;
+select count(*) from performance_schema.performance_timers;
count(*)
5
-select count(*) from performance_schema.SETUP_CONSUMERS;
+select count(*) from performance_schema.setup_consumers;
count(*)
8
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-select count(*) from performance_schema.SETUP_TIMERS;
+select count(*) from performance_schema.setup_timers;
count(*)
1
-select * from performance_schema.COND_INSTANCES;
-select * from performance_schema.EVENTS_WAITS_CURRENT;
-select * from performance_schema.EVENTS_WAITS_HISTORY;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-select * from performance_schema.FILE_INSTANCES;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.RWLOCK_INSTANCES;
-select * from performance_schema.SETUP_CONSUMERS;
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_TIMERS;
-select * from performance_schema.THREADS;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.threads;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
@@ -57,7 +57,7 @@ show status like "performance_schema%";
show variables like "performance_schema_max_cond_classes";
Variable_name Value
performance_schema_max_cond_classes 80
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
+select count(*) > 0 from performance_schema.setup_instruments
where name like "wait/synch/cond/%";
count(*) > 0
1
@@ -67,7 +67,7 @@ Performance_schema_cond_classes_lost 0
show variables like "performance_schema_max_cond_instances";
Variable_name Value
performance_schema_max_cond_instances 0
-select count(*) from performance_schema.COND_INSTANCES;
+select count(*) from performance_schema.cond_instances;
count(*)
0
select variable_value > 0 from information_schema.global_status
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
index 7ef247e0755..bafb4cac270 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
@@ -5,35 +5,35 @@ mtr
mysql
performance_schema
test
-select count(*) from performance_schema.PERFORMANCE_TIMERS;
+select count(*) from performance_schema.performance_timers;
count(*)
5
-select count(*) from performance_schema.SETUP_CONSUMERS;
+select count(*) from performance_schema.setup_consumers;
count(*)
8
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-select count(*) from performance_schema.SETUP_TIMERS;
+select count(*) from performance_schema.setup_timers;
count(*)
1
-select * from performance_schema.COND_INSTANCES;
-select * from performance_schema.EVENTS_WAITS_CURRENT;
-select * from performance_schema.EVENTS_WAITS_HISTORY;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-select * from performance_schema.FILE_INSTANCES;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.RWLOCK_INSTANCES;
-select * from performance_schema.SETUP_CONSUMERS;
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_TIMERS;
-select * from performance_schema.THREADS;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.threads;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
@@ -57,7 +57,7 @@ show status like "performance_schema%";
show variables like "performance_schema_max_file_classes";
Variable_name Value
performance_schema_max_file_classes 0
-select count(*) from performance_schema.SETUP_INSTRUMENTS
+select count(*) from performance_schema.setup_instruments
where name like "wait/io/file/%";
count(*)
0
@@ -65,7 +65,7 @@ select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_FILE_CLASSES_LOST';
variable_value > 0
1
-select count(*) from performance_schema.FILE_INSTANCES;
+select count(*) from performance_schema.file_instances;
count(*)
0
show status like "performance_schema_file_instances_lost";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
index 301c4e44f1e..2e557e5510a 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
@@ -5,35 +5,35 @@ mtr
mysql
performance_schema
test
-select count(*) from performance_schema.PERFORMANCE_TIMERS;
+select count(*) from performance_schema.performance_timers;
count(*)
5
-select count(*) from performance_schema.SETUP_CONSUMERS;
+select count(*) from performance_schema.setup_consumers;
count(*)
8
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-select count(*) from performance_schema.SETUP_TIMERS;
+select count(*) from performance_schema.setup_timers;
count(*)
1
-select * from performance_schema.COND_INSTANCES;
-select * from performance_schema.EVENTS_WAITS_CURRENT;
-select * from performance_schema.EVENTS_WAITS_HISTORY;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-select * from performance_schema.FILE_INSTANCES;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.RWLOCK_INSTANCES;
-select * from performance_schema.SETUP_CONSUMERS;
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_TIMERS;
-select * from performance_schema.THREADS;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.threads;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
@@ -57,7 +57,7 @@ show status like "performance_schema%";
show variables like "performance_schema_max_file_classes";
Variable_name Value
performance_schema_max_file_classes 50
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
+select count(*) > 0 from performance_schema.setup_instruments
where name like "wait/io/file/%";
count(*) > 0
1
@@ -67,7 +67,7 @@ Performance_schema_file_classes_lost 0
show variables like "performance_schema_max_file_instances";
Variable_name Value
performance_schema_max_file_instances 0
-select count(*) from performance_schema.FILE_INSTANCES;
+select count(*) from performance_schema.file_instances;
count(*)
0
select variable_value > 0 from information_schema.global_status
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
index a1f880d3b9e..b6d359ae5d2 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
@@ -5,35 +5,35 @@ mtr
mysql
performance_schema
test
-select count(*) from performance_schema.PERFORMANCE_TIMERS;
+select count(*) from performance_schema.performance_timers;
count(*)
5
-select count(*) from performance_schema.SETUP_CONSUMERS;
+select count(*) from performance_schema.setup_consumers;
count(*)
8
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-select count(*) from performance_schema.SETUP_TIMERS;
+select count(*) from performance_schema.setup_timers;
count(*)
1
-select * from performance_schema.COND_INSTANCES;
-select * from performance_schema.EVENTS_WAITS_CURRENT;
-select * from performance_schema.EVENTS_WAITS_HISTORY;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-select * from performance_schema.FILE_INSTANCES;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.RWLOCK_INSTANCES;
-select * from performance_schema.SETUP_CONSUMERS;
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_TIMERS;
-select * from performance_schema.THREADS;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.threads;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
@@ -57,7 +57,7 @@ show status like "performance_schema%";
show variables like "performance_schema_max_mutex_classes";
Variable_name Value
performance_schema_max_mutex_classes 0
-select count(*) from performance_schema.SETUP_INSTRUMENTS
+select count(*) from performance_schema.setup_instruments
where name like "wait/synch/mutex/%";
count(*)
0
@@ -65,7 +65,7 @@ select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_MUTEX_CLASSES_LOST';
variable_value > 0
1
-select count(*) from performance_schema.MUTEX_INSTANCES;
+select count(*) from performance_schema.mutex_instances;
count(*)
0
show status like "performance_schema_mutex_instances_lost";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
index ab566f0703a..190d58378ac 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
@@ -5,35 +5,35 @@ mtr
mysql
performance_schema
test
-select count(*) from performance_schema.PERFORMANCE_TIMERS;
+select count(*) from performance_schema.performance_timers;
count(*)
5
-select count(*) from performance_schema.SETUP_CONSUMERS;
+select count(*) from performance_schema.setup_consumers;
count(*)
8
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-select count(*) from performance_schema.SETUP_TIMERS;
+select count(*) from performance_schema.setup_timers;
count(*)
1
-select * from performance_schema.COND_INSTANCES;
-select * from performance_schema.EVENTS_WAITS_CURRENT;
-select * from performance_schema.EVENTS_WAITS_HISTORY;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-select * from performance_schema.FILE_INSTANCES;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.RWLOCK_INSTANCES;
-select * from performance_schema.SETUP_CONSUMERS;
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_TIMERS;
-select * from performance_schema.THREADS;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.threads;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
@@ -57,7 +57,7 @@ show status like "performance_schema%";
show variables like "performance_schema_max_mutex_classes";
Variable_name Value
performance_schema_max_mutex_classes 200
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
+select count(*) > 0 from performance_schema.setup_instruments
where name like "wait/synch/mutex/%";
count(*) > 0
1
@@ -67,7 +67,7 @@ Performance_schema_mutex_classes_lost 0
show variables like "performance_schema_max_mutex_instances";
Variable_name Value
performance_schema_max_mutex_instances 0
-select count(*) from performance_schema.MUTEX_INSTANCES;
+select count(*) from performance_schema.mutex_instances;
count(*)
0
select variable_value > 0 from information_schema.global_status
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
index aabc9ec49bb..b27159828f6 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
@@ -5,35 +5,35 @@ mtr
mysql
performance_schema
test
-select count(*) from performance_schema.PERFORMANCE_TIMERS;
+select count(*) from performance_schema.performance_timers;
count(*)
5
-select count(*) from performance_schema.SETUP_CONSUMERS;
+select count(*) from performance_schema.setup_consumers;
count(*)
8
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-select count(*) from performance_schema.SETUP_TIMERS;
+select count(*) from performance_schema.setup_timers;
count(*)
1
-select * from performance_schema.COND_INSTANCES;
-select * from performance_schema.EVENTS_WAITS_CURRENT;
-select * from performance_schema.EVENTS_WAITS_HISTORY;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-select * from performance_schema.FILE_INSTANCES;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.RWLOCK_INSTANCES;
-select * from performance_schema.SETUP_CONSUMERS;
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_TIMERS;
-select * from performance_schema.THREADS;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.threads;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
@@ -57,7 +57,7 @@ show status like "performance_schema%";
show variables like "performance_schema_max_rwlock_classes";
Variable_name Value
performance_schema_max_rwlock_classes 0
-select count(*) from performance_schema.SETUP_INSTRUMENTS
+select count(*) from performance_schema.setup_instruments
where name like "wait/synch/rwlock/%";
count(*)
0
@@ -65,7 +65,7 @@ select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_RWLOCK_CLASSES_LOST';
variable_value > 0
1
-select count(*) from performance_schema.RWLOCK_INSTANCES;
+select count(*) from performance_schema.rwlock_instances;
count(*)
0
show status like "performance_schema_rwlock_instances_lost";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
index 5e5998a9959..7466235c42f 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
@@ -5,35 +5,35 @@ mtr
mysql
performance_schema
test
-select count(*) from performance_schema.PERFORMANCE_TIMERS;
+select count(*) from performance_schema.performance_timers;
count(*)
5
-select count(*) from performance_schema.SETUP_CONSUMERS;
+select count(*) from performance_schema.setup_consumers;
count(*)
8
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-select count(*) from performance_schema.SETUP_TIMERS;
+select count(*) from performance_schema.setup_timers;
count(*)
1
-select * from performance_schema.COND_INSTANCES;
-select * from performance_schema.EVENTS_WAITS_CURRENT;
-select * from performance_schema.EVENTS_WAITS_HISTORY;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-select * from performance_schema.FILE_INSTANCES;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.RWLOCK_INSTANCES;
-select * from performance_schema.SETUP_CONSUMERS;
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_TIMERS;
-select * from performance_schema.THREADS;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.threads;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
@@ -57,7 +57,7 @@ show status like "performance_schema%";
show variables like "performance_schema_max_rwlock_classes";
Variable_name Value
performance_schema_max_rwlock_classes 30
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
+select count(*) > 0 from performance_schema.setup_instruments
where name like "wait/synch/rwlock/%";
count(*) > 0
1
@@ -67,7 +67,7 @@ Performance_schema_rwlock_classes_lost 0
show variables like "performance_schema_max_rwlock_instances";
Variable_name Value
performance_schema_max_rwlock_instances 0
-select count(*) from performance_schema.RWLOCK_INSTANCES;
+select count(*) from performance_schema.rwlock_instances;
count(*)
0
select variable_value > 0 from information_schema.global_status
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
index 96c3cae97ab..075c22bc405 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
@@ -5,35 +5,35 @@ mtr
mysql
performance_schema
test
-select count(*) from performance_schema.PERFORMANCE_TIMERS;
+select count(*) from performance_schema.performance_timers;
count(*)
5
-select count(*) from performance_schema.SETUP_CONSUMERS;
+select count(*) from performance_schema.setup_consumers;
count(*)
8
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-select count(*) from performance_schema.SETUP_TIMERS;
+select count(*) from performance_schema.setup_timers;
count(*)
1
-select * from performance_schema.COND_INSTANCES;
-select * from performance_schema.EVENTS_WAITS_CURRENT;
-select * from performance_schema.EVENTS_WAITS_HISTORY;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-select * from performance_schema.FILE_INSTANCES;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.RWLOCK_INSTANCES;
-select * from performance_schema.SETUP_CONSUMERS;
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_TIMERS;
-select * from performance_schema.THREADS;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.threads;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
@@ -57,7 +57,7 @@ show status like "performance_schema%";
show variables like "performance_schema_max_thread_classes";
Variable_name Value
performance_schema_max_thread_classes 0
-select count(*) from performance_schema.SETUP_INSTRUMENTS
+select count(*) from performance_schema.setup_instruments
where name like "thread/%";
count(*)
0
@@ -65,7 +65,7 @@ select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_THREAD_CLASSES_LOST';
variable_value > 0
1
-select count(*) from performance_schema.THREADS;
+select count(*) from performance_schema.threads;
count(*)
0
show status like "performance_schema_thread_instances_lost";
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
index e2cf0917cbf..763b5b69ca1 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
@@ -5,35 +5,35 @@ mtr
mysql
performance_schema
test
-select count(*) from performance_schema.PERFORMANCE_TIMERS;
+select count(*) from performance_schema.performance_timers;
count(*)
5
-select count(*) from performance_schema.SETUP_CONSUMERS;
+select count(*) from performance_schema.setup_consumers;
count(*)
8
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-select count(*) from performance_schema.SETUP_TIMERS;
+select count(*) from performance_schema.setup_timers;
count(*)
1
-select * from performance_schema.COND_INSTANCES;
-select * from performance_schema.EVENTS_WAITS_CURRENT;
-select * from performance_schema.EVENTS_WAITS_HISTORY;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-select * from performance_schema.FILE_INSTANCES;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.RWLOCK_INSTANCES;
-select * from performance_schema.SETUP_CONSUMERS;
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_TIMERS;
-select * from performance_schema.THREADS;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.threads;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
@@ -63,7 +63,7 @@ Performance_schema_thread_classes_lost 0
show variables like "performance_schema_max_thread_instances";
Variable_name Value
performance_schema_max_thread_instances 0
-select count(*) from performance_schema.THREADS;
+select count(*) from performance_schema.threads;
count(*)
0
select variable_value > 0 from information_schema.global_status
diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result
index 8bf52580e77..4cdfad654ae 100644
--- a/mysql-test/suite/perfschema/r/start_server_off.result
+++ b/mysql-test/suite/perfschema/r/start_server_off.result
@@ -5,35 +5,35 @@ mtr
mysql
performance_schema
test
-select count(*) from performance_schema.PERFORMANCE_TIMERS;
+select count(*) from performance_schema.performance_timers;
count(*)
5
-select count(*) from performance_schema.SETUP_CONSUMERS;
+select count(*) from performance_schema.setup_consumers;
count(*)
8
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
0
-select count(*) from performance_schema.SETUP_TIMERS;
+select count(*) from performance_schema.setup_timers;
count(*)
1
-select * from performance_schema.COND_INSTANCES;
-select * from performance_schema.EVENTS_WAITS_CURRENT;
-select * from performance_schema.EVENTS_WAITS_HISTORY;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-select * from performance_schema.FILE_INSTANCES;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.RWLOCK_INSTANCES;
-select * from performance_schema.SETUP_CONSUMERS;
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_TIMERS;
-select * from performance_schema.THREADS;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.threads;
show variables like "performance_schema%";
Variable_name Value
performance_schema OFF
diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result
index 15fe4e082ab..a17f78b27db 100644
--- a/mysql-test/suite/perfschema/r/start_server_on.result
+++ b/mysql-test/suite/perfschema/r/start_server_on.result
@@ -5,35 +5,35 @@ mtr
mysql
performance_schema
test
-select count(*) from performance_schema.PERFORMANCE_TIMERS;
+select count(*) from performance_schema.performance_timers;
count(*)
5
-select count(*) from performance_schema.SETUP_CONSUMERS;
+select count(*) from performance_schema.setup_consumers;
count(*)
8
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS;
+select count(*) > 0 from performance_schema.setup_instruments;
count(*) > 0
1
-select count(*) from performance_schema.SETUP_TIMERS;
+select count(*) from performance_schema.setup_timers;
count(*)
1
-select * from performance_schema.COND_INSTANCES;
-select * from performance_schema.EVENTS_WAITS_CURRENT;
-select * from performance_schema.EVENTS_WAITS_HISTORY;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-select * from performance_schema.FILE_INSTANCES;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
-select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.RWLOCK_INSTANCES;
-select * from performance_schema.SETUP_CONSUMERS;
-select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_TIMERS;
-select * from performance_schema.THREADS;
+select * from performance_schema.cond_instances;
+select * from performance_schema.events_waits_current;
+select * from performance_schema.events_waits_history;
+select * from performance_schema.events_waits_history_long;
+select * from performance_schema.events_waits_summary_by_instance;
+select * from performance_schema.events_waits_summary_by_thread_by_event_name;
+select * from performance_schema.events_waits_summary_global_by_event_name;
+select * from performance_schema.file_instances;
+select * from performance_schema.file_summary_by_event_name;
+select * from performance_schema.file_summary_by_instance;
+select * from performance_schema.mutex_instances;
+select * from performance_schema.performance_timers;
+select * from performance_schema.rwlock_instances;
+select * from performance_schema.setup_consumers;
+select * from performance_schema.setup_instruments;
+select * from performance_schema.setup_timers;
+select * from performance_schema.threads;
show variables like "performance_schema%";
Variable_name Value
performance_schema ON
diff --git a/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result b/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result
index cdf0029eeb9..86252d4ca01 100644
--- a/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result
+++ b/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result
@@ -1,6 +1,6 @@
call mtr.add_suppression(
-"Column count of mysql.SETUP_INSTRUMENTS is wrong. "
+"Column count of mysql.setup_instruments is wrong. "
"Expected 4, found 3. The table is probably corrupted");
-select * from performance_schema.SETUP_INSTRUMENTS limit 1;
-ERROR HY000: Native table 'performance_schema'.'SETUP_INSTRUMENTS' has the wrong structure
-select * from performance_schema.SETUP_CONSUMERS limit 1;
+select * from performance_schema.setup_instruments limit 1;
+ERROR HY000: Native table 'performance_schema'.'setup_instruments' has the wrong structure
+select * from performance_schema.setup_consumers limit 1;
diff --git a/mysql-test/suite/perfschema/r/thread_cache.result b/mysql-test/suite/perfschema/r/thread_cache.result
index de4d19f9c64..f64cadc2705 100644
--- a/mysql-test/suite/perfschema/r/thread_cache.result
+++ b/mysql-test/suite/perfschema/r/thread_cache.result
@@ -1,3 +1,4 @@
+flush status;
SET @saved_thread_cache_size = @@global.thread_cache_size;
set global thread_cache_size = 0;
show variables like "thread_cache_size";
@@ -32,3 +33,7 @@ select @thread_id_increment;
@thread_id_increment
1
set global thread_cache_size = @saved_thread_cache_size;
+show status like "performance_schema_thread%";
+Variable_name Value
+Performance_schema_thread_classes_lost 0
+Performance_schema_thread_instances_lost 0
diff --git a/mysql-test/suite/perfschema/t/aggregate.test b/mysql-test/suite/perfschema/t/aggregate.test
index a8ca3dd91e2..13906af3099 100644
--- a/mysql-test/suite/perfschema/t/aggregate.test
+++ b/mysql-test/suite/perfschema/t/aggregate.test
@@ -25,19 +25,19 @@
drop table if exists t1;
--enable_warnings
-update performance_schema.SETUP_INSTRUMENTS set enabled = 'NO';
-update performance_schema.SETUP_CONSUMERS set enabled = 'NO';
+update performance_schema.setup_instruments set enabled = 'NO';
+update performance_schema.setup_consumers set enabled = 'NO';
# Cleanup statistics
-truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE;
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+truncate table performance_schema.file_summary_by_event_name;
+truncate table performance_schema.file_summary_by_instance;
+truncate table performance_schema.events_waits_summary_global_by_event_name;
+truncate table performance_schema.events_waits_summary_by_instance;
+truncate table performance_schema.events_waits_summary_by_thread_by_event_name;
# Start recording data
-update performance_schema.SETUP_CONSUMERS set enabled = 'YES';
-update performance_schema.SETUP_INSTRUMENTS
+update performance_schema.setup_consumers set enabled = 'YES';
+update performance_schema.setup_instruments
set enabled = 'YES', timed = 'YES';
@@ -49,27 +49,27 @@ create table t1 (
insert into t1 (id) values (1), (2), (3), (4), (5), (6), (7), (8);
# Stop recording data, so the select below don't add noise.
-update performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO';
+update performance_schema.setup_instruments SET enabled = 'NO';
# Disable all consumers, for long standing waits
-update performance_schema.SETUP_CONSUMERS set enabled = 'NO';
+update performance_schema.setup_consumers set enabled = 'NO';
# Helper to debug
set @dump_all=FALSE;
# Note that in general:
-# - COUNT/SUM/MAX(FILE_SUMMARY_BY_EVENT_NAME) >=
-# COUNT/SUM/MAX(FILE_SUMMARY_BY_INSTANCE).
-# - MIN(FILE_SUMMARY_BY_EVENT_NAME) <=
-# MIN(FILE_SUMMARY_BY_INSTANCE).
+# - COUNT/SUM/MAX(file_summary_by_event_name) >=
+# COUNT/SUM/MAX(file_summary_by_instance).
+# - MIN(file_summary_by_event_name) <=
+# MIN(file_summary_by_instance).
# There will be equality only when file instances are not removed,
# aka when a file is not deleted from the file system,
-# because doing so removes a row in FILE_SUMMARY_BY_INSTANCE.
+# because doing so removes a row in file_summary_by_instance.
# Likewise:
-# - COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME) >=
-# COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_INSTANCE)
-# - MIN(EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME) <=
-# MIN(EVENTS_WAITS_SUMMARY_BY_INSTANCE)
+# - COUNT/SUM/MAX(events_waits_summary_global_by_event_name) >=
+# COUNT/SUM/MAX(events_waits_summary_by_instance)
+# - MIN(events_waits_summary_global_by_event_name) <=
+# MIN(events_waits_summary_by_instance)
# There will be equality only when an instrument instance
# is not removed, which is next to impossible to predictably guarantee
# in the server.
@@ -77,18 +77,18 @@ set @dump_all=FALSE;
# will cause a mysql_mutex_destroy on myisam/MYISAM_SHARE::intern_lock.
# Another example, a thread terminating will cause a mysql_mutex_destroy
# on sql/LOCK_delete
-# Both cause a row to be deleted from EVENTS_WAITS_SUMMARY_BY_INSTANCE.
+# Both cause a row to be deleted from events_waits_summary_by_instance.
# Likewise:
-# - COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME) >=
-# COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME)
-# - MIN(EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME) <=
-# MIN(EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME)
+# - COUNT/SUM/MAX(events_waits_summary_global_by_event_name) >=
+# COUNT/SUM/MAX(events_waits_summary_by_thread_by_event_name)
+# - MIN(events_waits_summary_global_by_event_name) <=
+# MIN(events_waits_summary_by_thread_by_event_name)
# There will be equality only when no thread is removed,
# that is if no thread disconnects, or no sub thread (for example insert
# delayed) ever completes.
# A thread completing will cause rows in
-# EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME to be removed.
+# events_waits_summary_by_thread_by_event_name to be removed.
--echo "Verifying file aggregate consistency"
@@ -101,29 +101,29 @@ set @dump_all=FALSE;
# If any of these queries returns data, the test failed.
SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
-FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
-JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.file_summary_by_event_name AS e
+JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
OR @dump_all;
SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
-FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
-JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.file_summary_by_event_name AS e
+JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
OR @dump_all;
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ)
-FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
-JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.file_summary_by_event_name AS e
+JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_READ <> SUM(i.SUM_NUMBER_OF_BYTES_READ))
OR @dump_all;
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_WRITE, SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
-FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
-JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.file_summary_by_event_name AS e
+JOIN performance_schema.file_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_WRITE <> SUM(i.SUM_NUMBER_OF_BYTES_WRITE))
OR @dump_all;
@@ -131,23 +131,23 @@ OR @dump_all;
--echo "Verifying waits aggregate consistency (instance)"
SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
-JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.events_waits_summary_global_by_event_name AS e
+JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_TIMER_WAIT < SUM(i.SUM_TIMER_WAIT))
OR @dump_all;
SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
-JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.events_waits_summary_global_by_event_name AS e
+JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MIN_TIMER_WAIT > MIN(i.MIN_TIMER_WAIT))
AND (MIN(i.MIN_TIMER_WAIT) != 0)
OR @dump_all;
SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
-JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
+FROM performance_schema.events_waits_summary_global_by_event_name AS e
+JOIN performance_schema.events_waits_summary_by_instance AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MAX_TIMER_WAIT < MAX(i.MAX_TIMER_WAIT))
OR @dump_all;
@@ -155,16 +155,16 @@ OR @dump_all;
--echo "Verifying waits aggregate consistency (thread)"
SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(t.SUM_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
-JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
+FROM performance_schema.events_waits_summary_global_by_event_name AS e
+JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_TIMER_WAIT < SUM(t.SUM_TIMER_WAIT))
OR @dump_all;
SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
-JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
+FROM performance_schema.events_waits_summary_global_by_event_name AS e
+JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MIN_TIMER_WAIT > MIN(t.MIN_TIMER_WAIT))
@@ -172,8 +172,8 @@ AND (MIN(t.MIN_TIMER_WAIT) != 0)
OR @dump_all;
SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(t.MAX_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
-JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
+FROM performance_schema.events_waits_summary_global_by_event_name AS e
+JOIN performance_schema.events_waits_summary_by_thread_by_event_name AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MAX_TIMER_WAIT < MAX(t.MAX_TIMER_WAIT))
@@ -182,8 +182,8 @@ OR @dump_all;
# Cleanup
-update performance_schema.SETUP_CONSUMERS set enabled = 'YES';
-update performance_schema.SETUP_INSTRUMENTS
+update performance_schema.setup_consumers set enabled = 'YES';
+update performance_schema.setup_instruments
set enabled = 'YES', timed = 'YES';
drop table test.t1;
diff --git a/mysql-test/suite/perfschema/t/binlog_mix.test b/mysql-test/suite/perfschema/t/binlog_mix.test
index 4fe7d68b555..5e2c65d6fe4 100644
--- a/mysql-test/suite/perfschema/t/binlog_mix.test
+++ b/mysql-test/suite/perfschema/t/binlog_mix.test
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -10,8 +10,8 @@
# 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
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
# Tests for PERFORMANCE_SCHEMA
@@ -19,9 +19,6 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
-# See Bug#46896 binlog: case sensitivity of table names
---source include/have_lowercase0.inc
-
set binlog_format=mixed;
--source ../include/binlog_common.inc
diff --git a/mysql-test/suite/perfschema/t/binlog_row.test b/mysql-test/suite/perfschema/t/binlog_row.test
index c1c1e06d3f0..d09baaa3011 100644
--- a/mysql-test/suite/perfschema/t/binlog_row.test
+++ b/mysql-test/suite/perfschema/t/binlog_row.test
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -10,8 +10,8 @@
# 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
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
# Tests for PERFORMANCE_SCHEMA
@@ -19,9 +19,6 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
-# See Bug#46896 binlog: case sensitivity of table names
---source include/have_lowercase0.inc
-
set binlog_format=row;
--source ../include/binlog_common.inc
diff --git a/mysql-test/suite/perfschema/t/binlog_stmt.test b/mysql-test/suite/perfschema/t/binlog_stmt.test
index a0fbc5ef335..46418d5703f 100644
--- a/mysql-test/suite/perfschema/t/binlog_stmt.test
+++ b/mysql-test/suite/perfschema/t/binlog_stmt.test
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -10,8 +10,8 @@
# 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
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
# Tests for PERFORMANCE_SCHEMA
diff --git a/mysql-test/suite/perfschema/t/checksum.test b/mysql-test/suite/perfschema/t/checksum.test
index d7fdd7b4c2c..0600edcef26 100644
--- a/mysql-test/suite/perfschema/t/checksum.test
+++ b/mysql-test/suite/perfschema/t/checksum.test
@@ -24,41 +24,41 @@
#
--disable_result_log
-checksum table performance_schema.COND_INSTANCES;
-checksum table performance_schema.EVENTS_WAITS_CURRENT;
-checksum table performance_schema.EVENTS_WAITS_HISTORY;
-checksum table performance_schema.EVENTS_WAITS_HISTORY_LONG;
-checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-checksum table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-checksum table performance_schema.FILE_INSTANCES;
-checksum table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-checksum table performance_schema.FILE_SUMMARY_BY_INSTANCE;
-checksum table performance_schema.MUTEX_INSTANCES;
-checksum table performance_schema.PERFORMANCE_TIMERS;
-checksum table performance_schema.RWLOCK_INSTANCES;
-checksum table performance_schema.SETUP_CONSUMERS;
-checksum table performance_schema.SETUP_INSTRUMENTS;
-checksum table performance_schema.SETUP_TIMERS;
-checksum table performance_schema.THREADS;
+checksum table performance_schema.cond_instances;
+checksum table performance_schema.events_waits_current;
+checksum table performance_schema.events_waits_history;
+checksum table performance_schema.events_waits_history_long;
+checksum table performance_schema.events_waits_summary_by_instance;
+checksum table performance_schema.events_waits_summary_by_thread_by_event_name;
+checksum table performance_schema.events_waits_summary_global_by_event_name;
+checksum table performance_schema.file_instances;
+checksum table performance_schema.file_summary_by_event_name;
+checksum table performance_schema.file_summary_by_instance;
+checksum table performance_schema.mutex_instances;
+checksum table performance_schema.performance_timers;
+checksum table performance_schema.rwlock_instances;
+checksum table performance_schema.setup_consumers;
+checksum table performance_schema.setup_instruments;
+checksum table performance_schema.setup_timers;
+checksum table performance_schema.threads;
-checksum table performance_schema.COND_INSTANCES extended;
-checksum table performance_schema.EVENTS_WAITS_CURRENT extended;
-checksum table performance_schema.EVENTS_WAITS_HISTORY extended;
-checksum table performance_schema.EVENTS_WAITS_HISTORY_LONG extended;
-checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE extended;
-checksum table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME extended;
-checksum table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME extended;
-checksum table performance_schema.FILE_INSTANCES extended;
-checksum table performance_schema.FILE_SUMMARY_BY_EVENT_NAME extended;
-checksum table performance_schema.FILE_SUMMARY_BY_INSTANCE extended;
-checksum table performance_schema.MUTEX_INSTANCES extended;
-checksum table performance_schema.PERFORMANCE_TIMERS extended;
-checksum table performance_schema.RWLOCK_INSTANCES extended;
-checksum table performance_schema.SETUP_CONSUMERS extended;
-checksum table performance_schema.SETUP_INSTRUMENTS extended;
-checksum table performance_schema.SETUP_TIMERS extended;
-checksum table performance_schema.THREADS extended;
+checksum table performance_schema.cond_instances extended;
+checksum table performance_schema.events_waits_current extended;
+checksum table performance_schema.events_waits_history extended;
+checksum table performance_schema.events_waits_history_long extended;
+checksum table performance_schema.events_waits_summary_by_instance extended;
+checksum table performance_schema.events_waits_summary_by_thread_by_event_name extended;
+checksum table performance_schema.events_waits_summary_global_by_event_name extended;
+checksum table performance_schema.file_instances extended;
+checksum table performance_schema.file_summary_by_event_name extended;
+checksum table performance_schema.file_summary_by_instance extended;
+checksum table performance_schema.mutex_instances extended;
+checksum table performance_schema.performance_timers extended;
+checksum table performance_schema.rwlock_instances extended;
+checksum table performance_schema.setup_consumers extended;
+checksum table performance_schema.setup_instruments extended;
+checksum table performance_schema.setup_timers extended;
+checksum table performance_schema.threads extended;
--enable_result_log
diff --git a/mysql-test/suite/perfschema/t/column_privilege.test b/mysql-test/suite/perfschema/t/column_privilege.test
index b6bcbdb3396..a1b0ede6b45 100644
--- a/mysql-test/suite/perfschema/t/column_privilege.test
+++ b/mysql-test/suite/perfschema/t/column_privilege.test
@@ -26,10 +26,10 @@ grant usage on *.* to 'pfs_user_5'@localhost with GRANT OPTION;
# Test per column privileges on performance_schema
-grant SELECT(thread_id, event_id) on performance_schema.EVENTS_WAITS_CURRENT
+grant SELECT(thread_id, event_id) on performance_schema.events_waits_current
to 'pfs_user_5'@localhost;
-grant UPDATE(enabled) on performance_schema.SETUP_INSTRUMENTS
+grant UPDATE(enabled) on performance_schema.setup_instruments
to 'pfs_user_5'@localhost;
flush privileges;
@@ -42,32 +42,28 @@ connect (con1, localhost, pfs_user_5, , );
# For statements that works, we do not look at the output
--disable_result_log
-select thread_id from performance_schema.EVENTS_WAITS_CURRENT;
+select thread_id from performance_schema.events_waits_current;
-select thread_id, event_id from performance_schema.EVENTS_WAITS_CURRENT;
+select thread_id, event_id from performance_schema.events_waits_current;
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+update performance_schema.setup_instruments set enabled='YES';
--enable_result_log
# For statements that are denied, check the error number and error text.
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_COLUMNACCESS_DENIED_ERROR
-select event_name from performance_schema.EVENTS_WAITS_CURRENT;
+select event_name from performance_schema.events_waits_current;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_COLUMNACCESS_DENIED_ERROR
select thread_id, event_id, event_name
- from performance_schema.EVENTS_WAITS_CURRENT;
+ from performance_schema.events_waits_current;
---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_COLUMNACCESS_DENIED_ERROR
-update performance_schema.SETUP_INSTRUMENTS set name='illegal';
+update performance_schema.setup_instruments set name='illegal';
---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_COLUMNACCESS_DENIED_ERROR
-update performance_schema.SETUP_INSTRUMENTS set timed='NO';
+update performance_schema.setup_instruments set timed='NO';
# Cleanup
@@ -76,7 +72,7 @@ update performance_schema.SETUP_INSTRUMENTS set timed='NO';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'pfs_user_5'@localhost;
DROP USER 'pfs_user_5'@localhost;
flush privileges;
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
-UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES';
-UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'CYCLE';
+UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
+UPDATE performance_schema.setup_consumers SET enabled = 'YES';
+UPDATE performance_schema.setup_timers SET timer_name = 'CYCLE';
diff --git a/mysql-test/suite/perfschema/t/ddl_cond_instances.test b/mysql-test/suite/perfschema/t/ddl_cond_instances.test
index e78429cb181..2da1100702f 100644
--- a/mysql-test/suite/perfschema/t/ddl_cond_instances.test
+++ b/mysql-test/suite/perfschema/t/ddl_cond_instances.test
@@ -19,14 +19,14 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.COND_INSTANCES add column foo integer;
+alter table performance_schema.cond_instances add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
-truncate table performance_schema.COND_INSTANCES;
+truncate table performance_schema.cond_instances;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.COND_INSTANCES ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.cond_instances ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.COND_INSTANCES(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.cond_instances(NAME);
diff --git a/mysql-test/suite/perfschema/t/ddl_events_waits_current.test b/mysql-test/suite/perfschema/t/ddl_events_waits_current.test
index 34f735c1271..1914d333f00 100644
--- a/mysql-test/suite/perfschema/t/ddl_events_waits_current.test
+++ b/mysql-test/suite/perfschema/t/ddl_events_waits_current.test
@@ -19,13 +19,13 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.EVENTS_WAITS_CURRENT add column foo integer;
+alter table performance_schema.events_waits_current add column foo integer;
-truncate table performance_schema.EVENTS_WAITS_CURRENT;
+truncate table performance_schema.events_waits_current;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.EVENTS_WAITS_CURRENT ADD INDEX test_index(EVENT_ID);
+ALTER TABLE performance_schema.events_waits_current ADD INDEX test_index(EVENT_ID);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_CURRENT(EVENT_ID);
+CREATE UNIQUE INDEX test_index ON performance_schema.events_waits_current(EVENT_ID);
diff --git a/mysql-test/suite/perfschema/t/ddl_events_waits_history.test b/mysql-test/suite/perfschema/t/ddl_events_waits_history.test
index 76ebe3d85c4..97c840a350d 100644
--- a/mysql-test/suite/perfschema/t/ddl_events_waits_history.test
+++ b/mysql-test/suite/perfschema/t/ddl_events_waits_history.test
@@ -19,13 +19,13 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.EVENTS_WAITS_HISTORY add column foo integer;
+alter table performance_schema.events_waits_history add column foo integer;
-truncate table performance_schema.EVENTS_WAITS_HISTORY;
+truncate table performance_schema.events_waits_history;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.EVENTS_WAITS_HISTORY ADD INDEX test_index(EVENT_ID);
+ALTER TABLE performance_schema.events_waits_history ADD INDEX test_index(EVENT_ID);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_HISTORY(EVENT_ID);
+CREATE UNIQUE INDEX test_index ON performance_schema.events_waits_history(EVENT_ID);
diff --git a/mysql-test/suite/perfschema/t/ddl_events_waits_history_long.test b/mysql-test/suite/perfschema/t/ddl_events_waits_history_long.test
index 549c5d6880b..b57a3864e1a 100644
--- a/mysql-test/suite/perfschema/t/ddl_events_waits_history_long.test
+++ b/mysql-test/suite/perfschema/t/ddl_events_waits_history_long.test
@@ -19,13 +19,13 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.EVENTS_WAITS_HISTORY_LONG add column foo integer;
+alter table performance_schema.events_waits_history_long add column foo integer;
-truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
+truncate table performance_schema.events_waits_history_long;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG ADD INDEX test_index(EVENT_ID);
+ALTER TABLE performance_schema.events_waits_history_long ADD INDEX test_index(EVENT_ID);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_HISTORY_LONG(EVENT_ID);
+CREATE UNIQUE INDEX test_index ON performance_schema.events_waits_history_long(EVENT_ID);
diff --git a/mysql-test/suite/perfschema/t/ddl_ews_by_instance.test b/mysql-test/suite/perfschema/t/ddl_ews_by_instance.test
index e6dad07fd63..a6315edd31d 100644
--- a/mysql-test/suite/perfschema/t/ddl_ews_by_instance.test
+++ b/mysql-test/suite/perfschema/t/ddl_ews_by_instance.test
@@ -19,13 +19,13 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE add column foo integer;
+alter table performance_schema.events_waits_summary_by_instance add column foo integer;
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
+truncate table performance_schema.events_waits_summary_by_instance;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE ADD INDEX test_index(EVENT_NAME);
+ALTER TABLE performance_schema.events_waits_summary_by_instance ADD INDEX test_index(EVENT_NAME);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE(EVENT_NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.events_waits_summary_by_instance(EVENT_NAME);
diff --git a/mysql-test/suite/perfschema/t/ddl_ews_by_thread_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_ews_by_thread_by_event_name.test
index 5b65ec26064..f59daca4b46 100644
--- a/mysql-test/suite/perfschema/t/ddl_ews_by_thread_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/ddl_ews_by_thread_by_event_name.test
@@ -19,15 +19,15 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+alter table performance_schema.events_waits_summary_by_thread_by_event_name
add column foo integer;
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+truncate table performance_schema.events_waits_summary_by_thread_by_event_name;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME ADD INDEX test_index(THREAD_ID);
+ALTER TABLE performance_schema.events_waits_summary_by_thread_by_event_name ADD INDEX test_index(THREAD_ID);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index
- ON performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME(THREAD_ID);
+ ON performance_schema.events_waits_summary_by_thread_by_event_name(THREAD_ID);
diff --git a/mysql-test/suite/perfschema/t/ddl_ews_global_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_ews_global_by_event_name.test
index c7a767b013b..880b4bf1a59 100644
--- a/mysql-test/suite/perfschema/t/ddl_ews_global_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/ddl_ews_global_by_event_name.test
@@ -19,16 +19,16 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+alter table performance_schema.events_waits_summary_global_by_event_name
add column foo integer;
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
+truncate table performance_schema.events_waits_summary_global_by_event_name;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+ALTER TABLE performance_schema.events_waits_summary_global_by_event_name
ADD INDEX test_index(EVENT_NAME);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index
- ON performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME(EVENT_NAME);
+ ON performance_schema.events_waits_summary_global_by_event_name(EVENT_NAME);
diff --git a/mysql-test/suite/perfschema/t/ddl_file_instances.test b/mysql-test/suite/perfschema/t/ddl_file_instances.test
index a9c9a2a95b6..9d6b8c3cf26 100644
--- a/mysql-test/suite/perfschema/t/ddl_file_instances.test
+++ b/mysql-test/suite/perfschema/t/ddl_file_instances.test
@@ -19,14 +19,14 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.FILE_INSTANCES add column foo integer;
+alter table performance_schema.file_instances add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
-truncate table performance_schema.FILE_INSTANCES;
+truncate table performance_schema.file_instances;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.FILE_INSTANCES ADD INDEX test_index(FILE_NAME);
+ALTER TABLE performance_schema.file_instances ADD INDEX test_index(FILE_NAME);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.FILE_INSTANCES(FILE_NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.file_instances(FILE_NAME);
diff --git a/mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test
index 2581f07c0d2..f9a9cabb5b2 100644
--- a/mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test
@@ -19,13 +19,13 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.FILE_SUMMARY_BY_EVENT_NAME add column foo integer;
+alter table performance_schema.file_summary_by_event_name add column foo integer;
-truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
+truncate table performance_schema.file_summary_by_event_name;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.FILE_SUMMARY_BY_EVENT_NAME ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.file_summary_by_event_name ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.FILE_SUMMARY_BY_EVENT_NAME(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.file_summary_by_event_name(NAME);
diff --git a/mysql-test/suite/perfschema/t/ddl_fs_by_instance.test b/mysql-test/suite/perfschema/t/ddl_fs_by_instance.test
index e06ad2eb7cd..defbff34321 100644
--- a/mysql-test/suite/perfschema/t/ddl_fs_by_instance.test
+++ b/mysql-test/suite/perfschema/t/ddl_fs_by_instance.test
@@ -19,13 +19,13 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.FILE_SUMMARY_BY_INSTANCE add column foo integer;
+alter table performance_schema.file_summary_by_instance add column foo integer;
-truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE;
+truncate table performance_schema.file_summary_by_instance;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.FILE_SUMMARY_BY_INSTANCE ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.file_summary_by_instance ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.FILE_SUMMARY_BY_INSTANCE(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.file_summary_by_instance(NAME);
diff --git a/mysql-test/suite/perfschema/t/ddl_mutex_instances.test b/mysql-test/suite/perfschema/t/ddl_mutex_instances.test
index 6489a689620..ccd970655af 100644
--- a/mysql-test/suite/perfschema/t/ddl_mutex_instances.test
+++ b/mysql-test/suite/perfschema/t/ddl_mutex_instances.test
@@ -19,14 +19,14 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.MUTEX_INSTANCES add column foo integer;
+alter table performance_schema.mutex_instances add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
-truncate table performance_schema.MUTEX_INSTANCES;
+truncate table performance_schema.mutex_instances;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.MUTEX_INSTANCES ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.mutex_instances ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.MUTEX_INSTANCES(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.mutex_instances(NAME);
diff --git a/mysql-test/suite/perfschema/t/ddl_performance_timers.test b/mysql-test/suite/perfschema/t/ddl_performance_timers.test
index b692291b8cf..f6fcfd58bab 100644
--- a/mysql-test/suite/perfschema/t/ddl_performance_timers.test
+++ b/mysql-test/suite/perfschema/t/ddl_performance_timers.test
@@ -19,14 +19,14 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.PERFORMANCE_TIMERS add column foo integer;
+alter table performance_schema.performance_timers add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
-truncate table performance_schema.PERFORMANCE_TIMERS;
+truncate table performance_schema.performance_timers;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.PERFORMANCE_TIMERS ADD INDEX test_index(TIMER_NAME);
+ALTER TABLE performance_schema.performance_timers ADD INDEX test_index(TIMER_NAME);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.PERFORMANCE_TIMERS(TIMER_NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.performance_timers(TIMER_NAME);
diff --git a/mysql-test/suite/perfschema/t/ddl_rwlock_instances.test b/mysql-test/suite/perfschema/t/ddl_rwlock_instances.test
index c07cd1ede48..e5bd8b890a1 100644
--- a/mysql-test/suite/perfschema/t/ddl_rwlock_instances.test
+++ b/mysql-test/suite/perfschema/t/ddl_rwlock_instances.test
@@ -19,14 +19,14 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.RWLOCK_INSTANCES add column foo integer;
+alter table performance_schema.rwlock_instances add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
-truncate table performance_schema.RWLOCK_INSTANCES;
+truncate table performance_schema.rwlock_instances;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.RWLOCK_INSTANCES ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.rwlock_instances ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.RWLOCK_INSTANCES(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.rwlock_instances(NAME);
diff --git a/mysql-test/suite/perfschema/t/ddl_setup_consumers.test b/mysql-test/suite/perfschema/t/ddl_setup_consumers.test
index c44db822145..3984e0b7fab 100644
--- a/mysql-test/suite/perfschema/t/ddl_setup_consumers.test
+++ b/mysql-test/suite/perfschema/t/ddl_setup_consumers.test
@@ -18,16 +18,15 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_result '\'setup_consumers' '\'SETUP_CONSUMERS'
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.SETUP_CONSUMERS add column foo integer;
+alter table performance_schema.setup_consumers add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
-truncate table performance_schema.SETUP_CONSUMERS;
+truncate table performance_schema.setup_consumers;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.SETUP_CONSUMERS ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.setup_consumers ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_CONSUMERS(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.setup_consumers(NAME);
diff --git a/mysql-test/suite/perfschema/t/ddl_setup_instruments.test b/mysql-test/suite/perfschema/t/ddl_setup_instruments.test
index c20c386447c..b900f69e801 100644
--- a/mysql-test/suite/perfschema/t/ddl_setup_instruments.test
+++ b/mysql-test/suite/perfschema/t/ddl_setup_instruments.test
@@ -18,16 +18,15 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.SETUP_INSTRUMENTS add column foo integer;
+alter table performance_schema.setup_instruments add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
-truncate table performance_schema.SETUP_INSTRUMENTS;
+truncate table performance_schema.setup_instruments;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.SETUP_INSTRUMENTS ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.setup_instruments ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_INSTRUMENTS(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.setup_instruments(NAME);
diff --git a/mysql-test/suite/perfschema/t/ddl_setup_timers.test b/mysql-test/suite/perfschema/t/ddl_setup_timers.test
index b9a5c32ecbe..bf8878a496d 100644
--- a/mysql-test/suite/perfschema/t/ddl_setup_timers.test
+++ b/mysql-test/suite/perfschema/t/ddl_setup_timers.test
@@ -18,16 +18,15 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_result '\'setup_timers' '\'SETUP_TIMERS'
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.SETUP_TIMERS add column foo integer;
+alter table performance_schema.setup_timers add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
-truncate table performance_schema.SETUP_TIMERS;
+truncate table performance_schema.setup_timers;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.SETUP_TIMERS ADD INDEX test_index(NAME);
+ALTER TABLE performance_schema.setup_timers ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_TIMERS(NAME);
+CREATE UNIQUE INDEX test_index ON performance_schema.setup_timers(NAME);
diff --git a/mysql-test/suite/perfschema/t/ddl_threads.test b/mysql-test/suite/perfschema/t/ddl_threads.test
index 12613e30c1f..d9ff3356b8d 100644
--- a/mysql-test/suite/perfschema/t/ddl_threads.test
+++ b/mysql-test/suite/perfschema/t/ddl_threads.test
@@ -19,14 +19,14 @@
--source include/have_perfschema.inc
-- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.THREADS add column foo integer;
+alter table performance_schema.threads add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
-truncate table performance_schema.THREADS;
+truncate table performance_schema.threads;
-- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.THREADS ADD INDEX test_index(ID);
+ALTER TABLE performance_schema.threads ADD INDEX test_index(ID);
-- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.THREADS(ID);
+CREATE UNIQUE INDEX test_index ON performance_schema.threads(ID);
diff --git a/mysql-test/suite/perfschema/t/dml_cond_instances.test b/mysql-test/suite/perfschema/t/dml_cond_instances.test
index 1d1614db73f..e2773d15252 100644
--- a/mysql-test/suite/perfschema/t/dml_cond_instances.test
+++ b/mysql-test/suite/perfschema/t/dml_cond_instances.test
@@ -18,38 +18,33 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_column 1 # 2 #
-select * from performance_schema.COND_INSTANCES limit 1;
+--disable_result_log
+select * from performance_schema.cond_instances limit 1;
-select * from performance_schema.COND_INSTANCES
+select * from performance_schema.cond_instances
where name='FOO';
+--enable_result_log
---replace_result '\'cond_instances' '\'COND_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.COND_INSTANCES
+insert into performance_schema.cond_instances
set name='FOO', object_instance_begin=12;
---replace_result '\'cond_instances' '\'COND_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.COND_INSTANCES
+update performance_schema.cond_instances
set name='FOO';
---replace_result '\'cond_instances' '\'COND_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.COND_INSTANCES
+delete from performance_schema.cond_instances
where name like "wait/%";
---replace_result '\'cond_instances' '\'COND_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.COND_INSTANCES;
+delete from performance_schema.cond_instances;
---replace_result '\'cond_instances' '\'COND_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.COND_INSTANCES READ;
+LOCK TABLES performance_schema.cond_instances READ;
UNLOCK TABLES;
---replace_result '\'cond_instances' '\'COND_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.COND_INSTANCES WRITE;
+LOCK TABLES performance_schema.cond_instances WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_events_waits_current.test b/mysql-test/suite/perfschema/t/dml_events_waits_current.test
index 3a93b98cb57..43a70618b4d 100644
--- a/mysql-test/suite/perfschema/t/dml_events_waits_current.test
+++ b/mysql-test/suite/perfschema/t/dml_events_waits_current.test
@@ -18,45 +18,39 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
-select * from performance_schema.EVENTS_WAITS_CURRENT
+--disable_result_log
+select * from performance_schema.events_waits_current
where event_name like 'Wait/Synch/%' limit 1;
-select * from performance_schema.EVENTS_WAITS_CURRENT
+select * from performance_schema.events_waits_current
where event_name='FOO';
+--enable_result_log
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.EVENTS_WAITS_CURRENT
+insert into performance_schema.events_waits_current
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_CURRENT
+update performance_schema.events_waits_current
set timer_start=12;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_CURRENT
+update performance_schema.events_waits_current
set timer_start=12 where thread_id=0;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_CURRENT
+delete from performance_schema.events_waits_current
where thread_id=1;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_CURRENT;
+delete from performance_schema.events_waits_current;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_CURRENT READ;
+LOCK TABLES performance_schema.events_waits_current READ;
UNLOCK TABLES;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_CURRENT WRITE;
+LOCK TABLES performance_schema.events_waits_current WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_events_waits_history.test b/mysql-test/suite/perfschema/t/dml_events_waits_history.test
index 174ef2147d1..51937a75f49 100644
--- a/mysql-test/suite/perfschema/t/dml_events_waits_history.test
+++ b/mysql-test/suite/perfschema/t/dml_events_waits_history.test
@@ -18,53 +18,45 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
-select * from performance_schema.EVENTS_WAITS_HISTORY
+--disable_result_log
+select * from performance_schema.events_waits_history
where event_name like 'Wait/Synch/%' limit 1;
-select * from performance_schema.EVENTS_WAITS_HISTORY
+select * from performance_schema.events_waits_history
where event_name='FOO';
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
-select * from performance_schema.EVENTS_WAITS_HISTORY
+select * from performance_schema.events_waits_history
where event_name like 'Wait/Synch/%' order by timer_wait limit 1;
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
-select * from performance_schema.EVENTS_WAITS_HISTORY
+select * from performance_schema.events_waits_history
where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1;
+--enable_result_log
---replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.EVENTS_WAITS_HISTORY
+insert into performance_schema.events_waits_history
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
---replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_HISTORY
+update performance_schema.events_waits_history
set timer_start=12;
---replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_HISTORY
+update performance_schema.events_waits_history
set timer_start=12 where thread_id=0;
---replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_HISTORY
+delete from performance_schema.events_waits_history
where thread_id=1;
---replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_HISTORY;
+delete from performance_schema.events_waits_history;
---replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY READ;
+LOCK TABLES performance_schema.events_waits_history READ;
UNLOCK TABLES;
---replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY WRITE;
+LOCK TABLES performance_schema.events_waits_history WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test b/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test
index 73dc0aefd06..a7fc1937529 100644
--- a/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test
+++ b/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test
@@ -18,53 +18,45 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
+--disable_result_log
+select * from performance_schema.events_waits_history_long
where event_name like 'Wait/Synch/%' limit 1;
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
+select * from performance_schema.events_waits_history_long
where event_name='FOO';
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
+select * from performance_schema.events_waits_history_long
where event_name like 'Wait/Synch/%' order by timer_wait limit 1;
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
-select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
+select * from performance_schema.events_waits_history_long
where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1;
+--enable_result_log
---replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.EVENTS_WAITS_HISTORY_LONG
+insert into performance_schema.events_waits_history_long
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
---replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_HISTORY_LONG
+update performance_schema.events_waits_history_long
set timer_start=12;
---replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_HISTORY_LONG
+update performance_schema.events_waits_history_long
set timer_start=12 where thread_id=0;
---replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_HISTORY_LONG
+delete from performance_schema.events_waits_history_long
where thread_id=1;
---replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_HISTORY_LONG;
+delete from performance_schema.events_waits_history_long;
---replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY_LONG READ;
+LOCK TABLES performance_schema.events_waits_history_long READ;
UNLOCK TABLES;
---replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY_LONG WRITE;
+LOCK TABLES performance_schema.events_waits_history_long WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_instance.test b/mysql-test/suite/perfschema/t/dml_ews_by_instance.test
index 4c386313bc5..2f25f842dcc 100644
--- a/mysql-test/suite/perfschema/t/dml_ews_by_instance.test
+++ b/mysql-test/suite/perfschema/t/dml_ews_by_instance.test
@@ -18,62 +18,52 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+--disable_result_log
+select * from performance_schema.events_waits_summary_by_instance
where event_name like 'Wait/Synch/%' limit 1;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+select * from performance_schema.events_waits_summary_by_instance
where event_name='FOO';
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+select * from performance_schema.events_waits_summary_by_instance
order by count_star limit 1;
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+select * from performance_schema.events_waits_summary_by_instance
order by count_star desc limit 1;
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+select * from performance_schema.events_waits_summary_by_instance
where min_timer_wait > 0 order by count_star limit 1;
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+select * from performance_schema.events_waits_summary_by_instance
where min_timer_wait > 0 order by count_star desc limit 1;
+--enable_result_log
---replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+insert into performance_schema.events_waits_summary_by_instance
set event_name='FOO', object_instance_begin=0,
count_star=1, sum_timer_wait=2, min_timer_wait=3,
avg_timer_wait=4, max_timer_wait=5;
---replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+update performance_schema.events_waits_summary_by_instance
set count_star=12;
---replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+update performance_schema.events_waits_summary_by_instance
set count_star=12 where event_name like "FOO";
---replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
+delete from performance_schema.events_waits_summary_by_instance
where count_star=1;
---replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
+delete from performance_schema.events_waits_summary_by_instance;
---replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE READ;
+LOCK TABLES performance_schema.events_waits_summary_by_instance READ;
UNLOCK TABLES;
---replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE WRITE;
+LOCK TABLES performance_schema.events_waits_summary_by_instance WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test
index ce29e59d014..a1b41fdab42 100644
--- a/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test
@@ -18,46 +18,40 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+--disable_result_log
+select * from performance_schema.events_waits_summary_by_thread_by_event_name
where event_name like 'Wait/Synch/%' limit 1;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+select * from performance_schema.events_waits_summary_by_thread_by_event_name
where event_name='FOO';
+--enable_result_log
---replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+insert into performance_schema.events_waits_summary_by_thread_by_event_name
set event_name='FOO', thread_id=1,
count_star=1, sum_timer_wait=2, min_timer_wait=3,
avg_timer_wait=4, max_timer_wait=5;
---replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+update performance_schema.events_waits_summary_by_thread_by_event_name
set count_star=12;
---replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+update performance_schema.events_waits_summary_by_thread_by_event_name
set count_star=12 where event_name like "FOO";
---replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+delete from performance_schema.events_waits_summary_by_thread_by_event_name
where count_star=1;
---replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+delete from performance_schema.events_waits_summary_by_thread_by_event_name;
---replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME READ;
+LOCK TABLES performance_schema.events_waits_summary_by_thread_by_event_name READ;
UNLOCK TABLES;
---replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME WRITE;
+LOCK TABLES performance_schema.events_waits_summary_by_thread_by_event_name WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test
index cd3918f38be..bf311c7b470 100644
--- a/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test
@@ -18,45 +18,39 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_column 1 # 2 # 3 # 4 # 5 # 6 #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+--disable_result_log
+select * from performance_schema.events_waits_summary_global_by_event_name
where event_name like 'Wait/Synch/%' limit 1;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+select * from performance_schema.events_waits_summary_global_by_event_name
where event_name='FOO';
+--enable_result_log
---replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+insert into performance_schema.events_waits_summary_global_by_event_name
set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3,
avg_timer_wait=4, max_timer_wait=5;
---replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+update performance_schema.events_waits_summary_global_by_event_name
set count_star=12;
---replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+update performance_schema.events_waits_summary_global_by_event_name
set count_star=12 where event_name like "FOO";
---replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+delete from performance_schema.events_waits_summary_global_by_event_name
where count_star=1;
---replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
+delete from performance_schema.events_waits_summary_global_by_event_name;
---replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME READ;
+LOCK TABLES performance_schema.events_waits_summary_global_by_event_name READ;
UNLOCK TABLES;
---replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME WRITE;
+LOCK TABLES performance_schema.events_waits_summary_global_by_event_name WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_file_instances.test b/mysql-test/suite/perfschema/t/dml_file_instances.test
index 71a053c21be..d7a1002b040 100644
--- a/mysql-test/suite/perfschema/t/dml_file_instances.test
+++ b/mysql-test/suite/perfschema/t/dml_file_instances.test
@@ -18,38 +18,33 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_column 1 # 2 # 3 #
-select * from performance_schema.FILE_INSTANCES limit 1;
+--disable_result_log
+select * from performance_schema.file_instances limit 1;
-select * from performance_schema.FILE_INSTANCES
+select * from performance_schema.file_instances
where file_name='FOO';
+--enable_result_log
---replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.FILE_INSTANCES
+insert into performance_schema.file_instances
set file_name='FOO', event_name='BAR', open_count=12;
---replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.FILE_INSTANCES
+update performance_schema.file_instances
set file_name='FOO';
---replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.FILE_INSTANCES
+delete from performance_schema.file_instances
where event_name like "wait/%";
---replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.FILE_INSTANCES;
+delete from performance_schema.file_instances;
---replace_result '\'file_instances' '\'FILE_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.FILE_INSTANCES READ;
+LOCK TABLES performance_schema.file_instances READ;
UNLOCK TABLES;
---replace_result '\'file_instances' '\'FILE_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.FILE_INSTANCES WRITE;
+LOCK TABLES performance_schema.file_instances WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test b/mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test
index 3753f581560..8060c4a4cbe 100644
--- a/mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test
+++ b/mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test
@@ -18,45 +18,39 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_column 1 # 2 # 3 # 4 # 5 #
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME
+--disable_result_log
+select * from performance_schema.file_summary_by_event_name
where event_name like 'Wait/io/%' limit 1;
-select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME
+select * from performance_schema.file_summary_by_event_name
where event_name='FOO';
+--enable_result_log
---replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.FILE_SUMMARY_BY_EVENT_NAME
+insert into performance_schema.file_summary_by_event_name
set event_name='FOO', count_read=1, count_write=2,
sum_number_of_bytes_read=4, sum_number_of_bytes_write=5;
---replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.FILE_SUMMARY_BY_EVENT_NAME
+update performance_schema.file_summary_by_event_name
set count_read=12;
---replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.FILE_SUMMARY_BY_EVENT_NAME
+update performance_schema.file_summary_by_event_name
set count_write=12 where event_name like "FOO";
---replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.FILE_SUMMARY_BY_EVENT_NAME
+delete from performance_schema.file_summary_by_event_name
where count_read=1;
---replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
+delete from performance_schema.file_summary_by_event_name;
---replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.FILE_SUMMARY_BY_EVENT_NAME READ;
+LOCK TABLES performance_schema.file_summary_by_event_name READ;
UNLOCK TABLES;
---replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.FILE_SUMMARY_BY_EVENT_NAME WRITE;
+LOCK TABLES performance_schema.file_summary_by_event_name WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test b/mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test
index 07372af5f36..c24f57390a4 100644
--- a/mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test
+++ b/mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test
@@ -18,45 +18,39 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_column 1 # 2 # 3 # 4 # 5 # 6 #
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE
+--disable_result_log
+select * from performance_schema.file_summary_by_instance
where event_name like 'Wait/io/%' limit 1;
-select * from performance_schema.FILE_SUMMARY_BY_INSTANCE
+select * from performance_schema.file_summary_by_instance
where event_name='FOO';
+--enable_result_log
---replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.FILE_SUMMARY_BY_INSTANCE
+insert into performance_schema.file_summary_by_instance
set event_name='FOO', count_read=1, count_write=2,
sum_number_of_bytes_read=4, sum_number_of_bytes_write=5;
---replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.FILE_SUMMARY_BY_INSTANCE
+update performance_schema.file_summary_by_instance
set count_read=12;
---replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.FILE_SUMMARY_BY_INSTANCE
+update performance_schema.file_summary_by_instance
set count_write=12 where event_name like "FOO";
---replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.FILE_SUMMARY_BY_INSTANCE
+delete from performance_schema.file_summary_by_instance
where count_read=1;
---replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.FILE_SUMMARY_BY_INSTANCE;
+delete from performance_schema.file_summary_by_instance;
---replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.FILE_SUMMARY_BY_INSTANCE READ;
+LOCK TABLES performance_schema.file_summary_by_instance READ;
UNLOCK TABLES;
---replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.FILE_SUMMARY_BY_INSTANCE WRITE;
+LOCK TABLES performance_schema.file_summary_by_instance WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_mutex_instances.test b/mysql-test/suite/perfschema/t/dml_mutex_instances.test
index 0971c664eb8..1a48bd9d8ea 100644
--- a/mysql-test/suite/perfschema/t/dml_mutex_instances.test
+++ b/mysql-test/suite/perfschema/t/dml_mutex_instances.test
@@ -18,38 +18,33 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_column 1 # 2 # 3 #
-select * from performance_schema.MUTEX_INSTANCES limit 1;
+--disable_result_log
+select * from performance_schema.mutex_instances limit 1;
-select * from performance_schema.MUTEX_INSTANCES
+select * from performance_schema.mutex_instances
where name='FOO';
+--enable_result_log
---replace_result '\'mutex_instances' '\'MUTEX_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.MUTEX_INSTANCES
+insert into performance_schema.mutex_instances
set name='FOO', object_instance_begin=12;
---replace_result '\'mutex_instances' '\'MUTEX_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.MUTEX_INSTANCES
+update performance_schema.mutex_instances
set name='FOO';
---replace_result '\'mutex_instances' '\'MUTEX_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.MUTEX_INSTANCES
+delete from performance_schema.mutex_instances
where name like "wait/%";
---replace_result '\'mutex_instances' '\'MUTEX_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.MUTEX_INSTANCES;
+delete from performance_schema.mutex_instances;
---replace_result '\'mutex_instances' '\'MUTEX_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.MUTEX_INSTANCES READ;
+LOCK TABLES performance_schema.mutex_instances READ;
UNLOCK TABLES;
---replace_result '\'mutex_instances' '\'MUTEX_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.MUTEX_INSTANCES WRITE;
+LOCK TABLES performance_schema.mutex_instances WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_performance_timers.test b/mysql-test/suite/perfschema/t/dml_performance_timers.test
index 9c2efb6f709..211e6db4fb1 100644
--- a/mysql-test/suite/perfschema/t/dml_performance_timers.test
+++ b/mysql-test/suite/perfschema/t/dml_performance_timers.test
@@ -19,39 +19,33 @@
--source include/have_perfschema.inc
--replace_column 2 <frequency> 3 <resolution> 4 <overhead>
-select * from performance_schema.PERFORMANCE_TIMERS;
+select * from performance_schema.performance_timers;
--replace_column 2 <frequency> 3 <resolution> 4 <overhead>
-select * from performance_schema.PERFORMANCE_TIMERS
+select * from performance_schema.performance_timers
where timer_name='CYCLE';
---replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.PERFORMANCE_TIMERS
+insert into performance_schema.performance_timers
set timer_name='FOO', timer_frequency=1,
timer_resolution=2, timer_overhead=3;
---replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.PERFORMANCE_TIMERS
+update performance_schema.performance_timers
set timer_frequency=12 where timer_name='CYCLE';
---replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.PERFORMANCE_TIMERS;
+delete from performance_schema.performance_timers;
---replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.PERFORMANCE_TIMERS
+delete from performance_schema.performance_timers
where timer_name='CYCLE';
---replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.PERFORMANCE_TIMERS READ;
+LOCK TABLES performance_schema.performance_timers READ;
UNLOCK TABLES;
---replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.PERFORMANCE_TIMERS WRITE;
+LOCK TABLES performance_schema.performance_timers WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_rwlock_instances.test b/mysql-test/suite/perfschema/t/dml_rwlock_instances.test
index 33a42450681..b588502c996 100644
--- a/mysql-test/suite/perfschema/t/dml_rwlock_instances.test
+++ b/mysql-test/suite/perfschema/t/dml_rwlock_instances.test
@@ -18,38 +18,33 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_column 1 # 2 # 3 # 4 #
-select * from performance_schema.RWLOCK_INSTANCES limit 1;
+--disable_result_log
+select * from performance_schema.rwlock_instances limit 1;
-select * from performance_schema.RWLOCK_INSTANCES
+select * from performance_schema.rwlock_instances
where name='FOO';
+--enable_result_log
---replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.RWLOCK_INSTANCES
+insert into performance_schema.rwlock_instances
set name='FOO', object_instance_begin=12;
---replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.RWLOCK_INSTANCES
+update performance_schema.rwlock_instances
set name='FOO';
---replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.RWLOCK_INSTANCES
+delete from performance_schema.rwlock_instances
where name like "wait/%";
---replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.RWLOCK_INSTANCES;
+delete from performance_schema.rwlock_instances;
---replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.RWLOCK_INSTANCES READ;
+LOCK TABLES performance_schema.rwlock_instances READ;
UNLOCK TABLES;
---replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.RWLOCK_INSTANCES WRITE;
+LOCK TABLES performance_schema.rwlock_instances WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_setup_consumers.test b/mysql-test/suite/perfschema/t/dml_setup_consumers.test
index 85b65864f91..2a29f428f3d 100644
--- a/mysql-test/suite/perfschema/t/dml_setup_consumers.test
+++ b/mysql-test/suite/perfschema/t/dml_setup_consumers.test
@@ -18,42 +18,38 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
-select * from performance_schema.SETUP_CONSUMERS;
+select * from performance_schema.setup_consumers;
-select * from performance_schema.SETUP_CONSUMERS
+select * from performance_schema.setup_consumers
where name='events_waits_current';
-select * from performance_schema.SETUP_CONSUMERS
+select * from performance_schema.setup_consumers
where enabled='YES';
-select * from performance_schema.SETUP_CONSUMERS
+select * from performance_schema.setup_consumers
where enabled='NO';
---replace_result '\'setup_consumers' '\'SETUP_CONSUMERS'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.SETUP_CONSUMERS
+insert into performance_schema.setup_consumers
set name='FOO', enabled='YES';
---replace_result '\'setup_consumers' '\'SETUP_CONSUMERS'
--error ER_WRONG_PERFSCHEMA_USAGE
-update performance_schema.SETUP_CONSUMERS
+update performance_schema.setup_consumers
set name='FOO';
-update performance_schema.SETUP_CONSUMERS
+update performance_schema.setup_consumers
set enabled='YES';
---replace_result '\'setup_consumers' '\'SETUP_CONSUMERS'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.SETUP_CONSUMERS;
+delete from performance_schema.setup_consumers;
---replace_result '\'setup_consumers' '\'SETUP_CONSUMERS'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.SETUP_CONSUMERS
+delete from performance_schema.setup_consumers
where name='events_waits_current';
-LOCK TABLES performance_schema.SETUP_CONSUMERS READ;
+LOCK TABLES performance_schema.setup_consumers READ;
UNLOCK TABLES;
-LOCK TABLES performance_schema.SETUP_CONSUMERS WRITE;
+LOCK TABLES performance_schema.setup_consumers WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_setup_instruments.test b/mysql-test/suite/perfschema/t/dml_setup_instruments.test
index b82cde15fb5..b6e28440758 100644
--- a/mysql-test/suite/perfschema/t/dml_setup_instruments.test
+++ b/mysql-test/suite/perfschema/t/dml_setup_instruments.test
@@ -26,19 +26,19 @@
# - valgrind coverage
--disable_result_log
-select * from performance_schema.SETUP_INSTRUMENTS;
+select * from performance_schema.setup_instruments;
--enable_result_log
# DEBUG_SYNC::mutex is dependent on the build (DEBUG only)
-select * from performance_schema.SETUP_INSTRUMENTS
+select * from performance_schema.setup_instruments
where name like 'Wait/Synch/Mutex/sql/%'
and name not in ('wait/synch/mutex/sql/DEBUG_SYNC::mutex')
order by name limit 10;
# CRYPTO_dynlock_value::lock is dependent on the build (SSL)
-select * from performance_schema.SETUP_INSTRUMENTS
+select * from performance_schema.setup_instruments
where name like 'Wait/Synch/Rwlock/sql/%'
and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock')
order by name limit 10;
@@ -46,7 +46,7 @@ select * from performance_schema.SETUP_INSTRUMENTS
# COND_handler_count is dependent on the build (Windows only)
# DEBUG_SYNC::cond is dependent on the build (DEBUG only)
-select * from performance_schema.SETUP_INSTRUMENTS
+select * from performance_schema.setup_instruments
where name like 'Wait/Synch/Cond/sql/%'
and name not in (
'wait/synch/cond/sql/COND_handler_count',
@@ -54,50 +54,46 @@ select * from performance_schema.SETUP_INSTRUMENTS
order by name limit 10;
--disable_result_log
-select * from performance_schema.SETUP_INSTRUMENTS
+select * from performance_schema.setup_instruments
where name='Wait';
--enable_result_log
--disable_result_log
-select * from performance_schema.SETUP_INSTRUMENTS
+select * from performance_schema.setup_instruments
where enabled='YES';
--enable_result_log
---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.SETUP_INSTRUMENTS
+insert into performance_schema.setup_instruments
set name='FOO', enabled='YES', timed='YES';
---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_WRONG_PERFSCHEMA_USAGE
-update performance_schema.SETUP_INSTRUMENTS
+update performance_schema.setup_instruments
set name='FOO';
-update performance_schema.SETUP_INSTRUMENTS
+update performance_schema.setup_instruments
set enabled='NO';
-update performance_schema.SETUP_INSTRUMENTS
+update performance_schema.setup_instruments
set timed='NO';
--disable_result_log
-select * from performance_schema.SETUP_INSTRUMENTS;
+select * from performance_schema.setup_instruments;
--enable_result_log
-update performance_schema.SETUP_INSTRUMENTS
+update performance_schema.setup_instruments
set enabled='YES', timed='YES';
---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.SETUP_INSTRUMENTS;
+delete from performance_schema.setup_instruments;
---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.SETUP_INSTRUMENTS
+delete from performance_schema.setup_instruments
where name like 'Wait/Synch/%';
-LOCK TABLES performance_schema.SETUP_INSTRUMENTS READ;
+LOCK TABLES performance_schema.setup_instruments READ;
UNLOCK TABLES;
-LOCK TABLES performance_schema.SETUP_INSTRUMENTS WRITE;
+LOCK TABLES performance_schema.setup_instruments WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_setup_timers.test b/mysql-test/suite/perfschema/t/dml_setup_timers.test
index 5b5850db575..1bfc0ab83a2 100644
--- a/mysql-test/suite/perfschema/t/dml_setup_timers.test
+++ b/mysql-test/suite/perfschema/t/dml_setup_timers.test
@@ -18,44 +18,40 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
-select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.setup_timers;
-select * from performance_schema.SETUP_TIMERS
+select * from performance_schema.setup_timers
where name='Wait';
-select * from performance_schema.SETUP_TIMERS
+select * from performance_schema.setup_timers
where timer_name='CYCLE';
---replace_result '\'setup_timers' '\'SETUP_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.SETUP_TIMERS
+insert into performance_schema.setup_timers
set name='FOO', timer_name='CYCLE';
---replace_result '\'setup_timers' '\'SETUP_TIMERS'
--error ER_WRONG_PERFSCHEMA_USAGE
-update performance_schema.SETUP_TIMERS
+update performance_schema.setup_timers
set name='FOO';
-update performance_schema.SETUP_TIMERS
+update performance_schema.setup_timers
set timer_name='MILLISECOND';
-select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.setup_timers;
-update performance_schema.SETUP_TIMERS
+update performance_schema.setup_timers
set timer_name='CYCLE';
---replace_result '\'setup_timers' '\'SETUP_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.SETUP_TIMERS;
+delete from performance_schema.setup_timers;
---replace_result '\'setup_timers' '\'SETUP_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.SETUP_TIMERS
+delete from performance_schema.setup_timers
where name='Wait';
-LOCK TABLES performance_schema.SETUP_TIMERS READ;
+LOCK TABLES performance_schema.setup_timers READ;
UNLOCK TABLES;
-LOCK TABLES performance_schema.SETUP_TIMERS WRITE;
+LOCK TABLES performance_schema.setup_timers WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/dml_threads.test b/mysql-test/suite/perfschema/t/dml_threads.test
index 6ea456fee69..6cb372e2c96 100644
--- a/mysql-test/suite/perfschema/t/dml_threads.test
+++ b/mysql-test/suite/perfschema/t/dml_threads.test
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -10,52 +10,46 @@
# 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
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
# Tests for PERFORMANCE_SCHEMA
--source include/not_embedded.inc
--source include/have_perfschema.inc
---replace_column 1 # 2 # 3 #
-select * from performance_schema.THREADS
+--disable_result_log
+select * from performance_schema.threads
where name like 'Thread/%' limit 1;
-select * from performance_schema.THREADS
+select * from performance_schema.threads
where name='FOO';
+--enable_result_log
---replace_result '\'threads' '\'THREADS'
--error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.THREADS
- set name='FOO', thread_id=1, id=2;
+insert into performance_schema.threads
+ set name='FOO', thread_id=1, processlist_id=2;
---replace_result '\'threads' '\'THREADS'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.THREADS
+update performance_schema.threads
set thread_id=12;
---replace_result '\'threads' '\'THREADS'
--error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.THREADS
+update performance_schema.threads
set thread_id=12 where name like "FOO";
---replace_result '\'threads' '\'THREADS'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.THREADS
+delete from performance_schema.threads
where id=1;
---replace_result '\'threads' '\'THREADS'
--error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.THREADS;
+delete from performance_schema.threads;
---replace_result '\'threads' '\'THREADS'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.THREADS READ;
+LOCK TABLES performance_schema.threads READ;
UNLOCK TABLES;
---replace_result '\'threads' '\'THREADS'
-- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.THREADS WRITE;
+LOCK TABLES performance_schema.threads WRITE;
UNLOCK TABLES;
diff --git a/mysql-test/suite/perfschema/t/func_file_io.test b/mysql-test/suite/perfschema/t/func_file_io.test
index 6b6335ac424..64f71a99ee6 100644
--- a/mysql-test/suite/perfschema/t/func_file_io.test
+++ b/mysql-test/suite/perfschema/t/func_file_io.test
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2009 Sun Microsystems, Inc
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -10,8 +10,8 @@
# 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
+# along with this program; if not, write to the Free Software Foundation,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
##
## WL#4814, 4.1.4 FILE IO
@@ -22,9 +22,9 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
+UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
+UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/io/file/%';
--disable_warnings
@@ -40,9 +40,9 @@ ENGINE=MyISAM;
INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
#
# FF1: Count for file should increase with instrumentation enabled and
@@ -52,7 +52,7 @@ TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
SELECT * FROM t1 WHERE id = 1;
SET @before_count = (SELECT SUM(TIMER_WAIT)
- FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+ FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD'));
@@ -61,23 +61,23 @@ SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation;
SELECT * FROM t1 WHERE id < 4;
SET @after_count = (SELECT SUM(TIMER_WAIT)
- FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+ FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed;
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled='NO';
+UPDATE performance_schema.setup_instruments SET enabled='NO';
SET @before_count = (SELECT SUM(TIMER_WAIT)
- FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+ FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2));
SELECT * FROM t1 WHERE id < 6;
SET @after_count = (SELECT SUM(TIMER_WAIT)
- FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+ FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3));
@@ -87,33 +87,33 @@ SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success
# Check not timed measurements
#
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
+UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/io/file/%';
-UPDATE performance_schema.SETUP_INSTRUMENTS SET timed = 'NO';
+UPDATE performance_schema.setup_instruments SET timed = 'NO';
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
SELECT * FROM t1 WHERE id > 4;
-SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+SELECT * FROM performance_schema.events_waits_history_long
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
-SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY
+SELECT * FROM performance_schema.events_waits_history
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
-SELECT * FROM performance_schema.EVENTS_WAITS_CURRENT
+SELECT * FROM performance_schema.events_waits_current
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
-UPDATE performance_schema.SETUP_INSTRUMENTS SET timed = 'YES';
+UPDATE performance_schema.setup_instruments SET timed = 'YES';
SELECT * FROM t1 WHERE id < 4;
@@ -128,7 +128,7 @@ SELECT SUM(COUNT_READ) AS sum_count_read,
SUM(COUNT_WRITE) AS sum_count_write,
SUM(SUM_NUMBER_OF_BYTES_READ) AS sum_num_bytes_read,
SUM(SUM_NUMBER_OF_BYTES_WRITE) AS sum_num_bytes_write
-FROM performance_schema.FILE_SUMMARY_BY_INSTANCE
+FROM performance_schema.file_summary_by_instance
WHERE FILE_NAME LIKE CONCAT('%', @@tmpdir, '%') ORDER BY NULL;
--enable_result_log
@@ -144,7 +144,7 @@ WHERE FILE_NAME LIKE CONCAT('%', @@tmpdir, '%') ORDER BY NULL;
#
--disable_result_log
SELECT EVENT_NAME, COUNT_STAR, AVG_TIMER_WAIT, SUM_TIMER_WAIT
-FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+FROM performance_schema.events_waits_summary_global_by_event_name
WHERE COUNT_STAR > 0
ORDER BY SUM_TIMER_WAIT DESC
LIMIT 10;
@@ -154,25 +154,25 @@ LIMIT 10;
# Total and average wait time for different users
#
---disable_result_log
-SELECT i.user, SUM(TIMER_WAIT) SUM_WAIT
-# ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
-INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
-LEFT JOIN information_schema.PROCESSLIST i USING (ID)
-GROUP BY i.user
-ORDER BY SUM_WAIT DESC
-LIMIT 20;
---enable_result_log
+## --disable_result_log
+## SELECT i.user, SUM(TIMER_WAIT) SUM_WAIT
+## # ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE
+## FROM performance_schema.events_waits_history_long h
+## INNER JOIN performance_schema.threads p USING (THREAD_ID)
+## LEFT JOIN information_schema.PROCESSLIST i USING (ID)
+## GROUP BY i.user
+## ORDER BY SUM_WAIT DESC
+## LIMIT 20;
+## --enable_result_log
#
# Total and average wait times for different events for a session
#
--disable_result_log
SELECT h.EVENT_NAME, SUM(h.TIMER_WAIT) TOTAL_WAIT
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
-INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
-WHERE p.ID = 1
+FROM performance_schema.events_waits_history_long h
+INNER JOIN performance_schema.threads p USING (THREAD_ID)
+WHERE p.PROCESSLIST_ID = 1
GROUP BY h.EVENT_NAME
HAVING TOTAL_WAIT > 0;
--enable_result_log
@@ -181,12 +181,15 @@ HAVING TOTAL_WAIT > 0;
# Which user reads and writes data
#
---disable_result_log
-SELECT i.user, h.operation, SUM(NUMBER_OF_BYTES) bytes
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
-INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
-LEFT JOIN information_schema.PROCESSLIST i USING (ID)
-GROUP BY i.user, h.operation
-HAVING BYTES > 0
-ORDER BY i.user, h.operation;
---enable_result_log
+## --disable_result_log
+## SELECT i.user, h.operation, SUM(NUMBER_OF_BYTES) bytes
+## FROM performance_schema.events_waits_history_long h
+## INNER JOIN performance_schema.threads p USING (THREAD_ID)
+## LEFT JOIN information_schema.PROCESSLIST i USING (ID)
+## GROUP BY i.user, h.operation
+## HAVING BYTES > 0
+## ORDER BY i.user, h.operation;
+## --enable_result_log
+
+# Clean-up.
+UPDATE performance_schema.setup_instruments SET enabled = 'YES';
diff --git a/mysql-test/suite/perfschema/t/func_mutex.test b/mysql-test/suite/perfschema/t/func_mutex.test
index 98cb905c67c..51cbc77790e 100644
--- a/mysql-test/suite/perfschema/t/func_mutex.test
+++ b/mysql-test/suite/perfschema/t/func_mutex.test
@@ -22,9 +22,9 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
+UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
+UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
@@ -46,41 +46,41 @@ INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
# FM2: Count for mutex should not increase with instrumentation disabled
#
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
SELECT * FROM t1 WHERE id = 1;
SET @before_count = (SELECT SUM(TIMER_WAIT)
- FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+ FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT * FROM t1;
SET @after_count = (SELECT SUM(TIMER_WAIT)
- FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+ FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_timed;
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO'
+UPDATE performance_schema.setup_instruments SET enabled = 'NO'
WHERE NAME = 'wait/synch/mutex/sql/LOCK_open';
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
SELECT * FROM t1 WHERE id = 1;
SET @before_count = (SELECT SUM(TIMER_WAIT)
- FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+ FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT * FROM t1;
SET @after_count = (SELECT SUM(TIMER_WAIT)
- FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+ FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_timed;
@@ -89,43 +89,45 @@ SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success
# Repeat for RW-lock
#
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
SELECT * FROM t1 WHERE id = 1;
SET @before_count = (SELECT SUM(TIMER_WAIT)
- FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+ FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT * FROM t1;
SET @after_count = (SELECT SUM(TIMER_WAIT)
- FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+ FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_rw_timed;
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO'
+UPDATE performance_schema.setup_instruments SET enabled = 'NO'
WHERE NAME = 'wait/synch/rwlock/sql/LOCK_grant';
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
SELECT * FROM t1 WHERE id = 1;
SET @before_count = (SELECT SUM(TIMER_WAIT)
- FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+ FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT * FROM t1;
SET @after_count = (SELECT SUM(TIMER_WAIT)
- FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+ FROM performance_schema.events_waits_history_long
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed;
+# Clean-up.
+UPDATE performance_schema.setup_instruments SET enabled = 'YES';
DROP TABLE t1;
diff --git a/mysql-test/suite/perfschema/t/global_read_lock.test b/mysql-test/suite/perfschema/t/global_read_lock.test
index b953ea32ce0..d00c6583e31 100644
--- a/mysql-test/suite/perfschema/t/global_read_lock.test
+++ b/mysql-test/suite/perfschema/t/global_read_lock.test
@@ -15,28 +15,32 @@
# Tests for PERFORMANCE_SCHEMA
#
-# Test the effect of a flush tables with read lock on SETUP_ tables.
+# Test the effect of a flush tables with read lock on setup_ tables.
--source include/not_embedded.inc
--source include/have_perfschema.inc
use performance_schema;
+# Make test robust against errors in other tests.
+# Ensure that instrumentation is turned on when we create new connection.
+update performance_schema.setup_instruments set enabled='YES';
+
grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost;
flush privileges;
--echo connect (con1, localhost, pfsuser, , test);
connect (con1, localhost, pfsuser, , test);
-lock tables performance_schema.SETUP_INSTRUMENTS read;
+lock tables performance_schema.setup_instruments read;
--disable_result_log
-select * from performance_schema.SETUP_INSTRUMENTS;
+select * from performance_schema.setup_instruments;
--enable_result_log
unlock tables;
-lock tables performance_schema.SETUP_INSTRUMENTS write;
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+lock tables performance_schema.setup_instruments write;
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES';
unlock tables;
--echo connection default;
@@ -47,20 +51,20 @@ flush tables with read lock;
--echo connection con1;
connection con1;
-lock tables performance_schema.SETUP_INSTRUMENTS read;
+lock tables performance_schema.setup_instruments read;
--disable_result_log
-select * from performance_schema.SETUP_INSTRUMENTS;
+select * from performance_schema.setup_instruments;
--enable_result_log
unlock tables;
# This will block
--send
-lock tables performance_schema.SETUP_INSTRUMENTS write;
+lock tables performance_schema.setup_instruments write;
--echo connection default;
connection default;
-let $wait_condition= select 1 from performance_schema.EVENTS_WAITS_CURRENT where event_name like "wait/synch/cond/sql/COND_global_read_lock";
+let $wait_condition= select 1 from performance_schema.events_waits_current where event_name like "wait/synch/cond/sql/MDL_context::COND_wait_status";
--source include/wait_condition.inc
@@ -68,16 +72,16 @@ let $wait_condition= select 1 from performance_schema.EVENTS_WAITS_CURRENT where
select event_name,
left(source, locate(":", source)) as short_source,
timer_end, timer_wait, operation
- from performance_schema.EVENTS_WAITS_CURRENT
- where event_name like "wait/synch/cond/sql/COND_global_read_lock";
+ from performance_schema.events_waits_current
+ where event_name like "wait/synch/cond/sql/MDL_context::COND_wait_status";
unlock tables;
connection con1;
--reap
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES';
unlock tables;
disconnect con1;
diff --git a/mysql-test/suite/perfschema/t/information_schema.test b/mysql-test/suite/perfschema/t/information_schema.test
index 3d2822a1db3..36ba1912df3 100644
--- a/mysql-test/suite/perfschema/t/information_schema.test
+++ b/mysql-test/suite/perfschema/t/information_schema.test
@@ -22,46 +22,46 @@
# Note that TABLE_NAME is in uppercase is some platforms,
# and in lowercase in others.
-# Using upper(TABLE_NAME) to have consistent results.
+# Using lower(TABLE_NAME) to have consistent results.
-select TABLE_SCHEMA, upper(TABLE_NAME), TABLE_CATALOG
+select TABLE_SCHEMA, lower(TABLE_NAME), TABLE_CATALOG
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-select upper(TABLE_NAME), TABLE_TYPE, ENGINE
+select lower(TABLE_NAME), TABLE_TYPE, ENGINE
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-select upper(TABLE_NAME), VERSION, ROW_FORMAT
+select lower(TABLE_NAME), VERSION, ROW_FORMAT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-select upper(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH
+select lower(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-select upper(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH
+select lower(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-select upper(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT
+select lower(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-select upper(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME
+select lower(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
-select upper(TABLE_NAME), TABLE_COLLATION, CHECKSUM
+select lower(TABLE_NAME), TABLE_COLLATION, CHECKSUM
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
# TABLESPACE_NAME does not exist in 5.4
-# select upper(TABLE_NAME), CREATE_OPTIONS, TABLESPACE_NAME
+# select lower(TABLE_NAME), CREATE_OPTIONS, TABLESPACE_NAME
# from information_schema.tables
# where TABLE_SCHEMA='performance_schema';
-select upper(TABLE_NAME), TABLE_COMMENT
+select lower(TABLE_NAME), TABLE_COMMENT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test
index d497c205d50..dee18f0fa21 100644
--- a/mysql-test/suite/perfschema/t/misc.test
+++ b/mysql-test/suite/perfschema/t/misc.test
@@ -25,11 +25,11 @@
#
--disable_result_log
-SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+SELECT EVENT_ID FROM performance_schema.events_waits_current
WHERE THREAD_ID IN
- (SELECT THREAD_ID FROM performance_schema.THREADS)
+ (SELECT THREAD_ID FROM performance_schema.threads)
AND EVENT_NAME IN
- (SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
+ (SELECT NAME FROM performance_schema.setup_instruments
WHERE NAME LIKE "wait/synch/%")
LIMIT 1;
--enable_result_log
@@ -38,15 +38,15 @@ LIMIT 1;
# Bug#45088 Should not be able to create tables of engine PERFORMANCE_SCHEMA
#
---error ER_WRONG_PERFSCHEMA_USAGE
+--error ER_CANT_CREATE_TABLE
create table test.t1(a int) engine=performance_schema;
#
# Bug#44897 Performance Schema: can create a ghost table in another database
#
---error ER_WRONG_PERFSCHEMA_USAGE
-create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT;
+--error ER_CANT_CREATE_TABLE
+create table test.t1 like performance_schema.events_waits_current;
#
# Bug#44898 PerformanceSchema: can create a table in db performance_schema, cannot insert
@@ -73,7 +73,7 @@ select * from test.ghost;
drop table test.ghost;
# Shoud return nothing
-select * from performance_schema.FILE_INSTANCES
+select * from performance_schema.file_instances
where file_name like "%ghost%";
#
diff --git a/mysql-test/suite/perfschema/t/myisam_file_io.test b/mysql-test/suite/perfschema/t/myisam_file_io.test
index 0861e8f4b74..de9f6f48480 100644
--- a/mysql-test/suite/perfschema/t/myisam_file_io.test
+++ b/mysql-test/suite/perfschema/t/myisam_file_io.test
@@ -20,14 +20,14 @@
# Setup
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES'
where name like "wait/io/file/myisam/%";
-update performance_schema.SETUP_CONSUMERS
+update performance_schema.setup_consumers
set enabled='YES';
-truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
+truncate table performance_schema.events_waits_history_long;
# Reset lost counters to a known state
flush status;
@@ -46,13 +46,21 @@ insert into no_index_tab set a = 'foo', b = 1;
# Verification
# Note that mi_create.c contains mysql_file_tell() calls in debug only,
# so the result are filtered to remove 'tell'.
+# Note that even after setting other instruments to enabled='NO'
+# and truncating the events_waits_history_long table,
+# some events -- that were already started but not completed --
+# for other instruments could still be added in the history.
+# To protect against that, an extra where clause
+# "and event_name like "wait/io/file/myisam/%"
+# is added to the select to filter out the result.
select event_name,
left(source, locate(":", source)) as short_source,
operation, number_of_bytes,
substring(object_name, locate("no_index_tab", object_name)) as short_name
- from performance_schema.EVENTS_WAITS_HISTORY_LONG
+ from performance_schema.events_waits_history_long
where operation not like "tell"
+ and event_name like "wait/io/file/myisam/%"
order by thread_id, event_id;
# In case of failures, this will tell if file io are lost.
@@ -60,7 +68,7 @@ show status like 'performance_schema_%';
# Cleanup
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+update performance_schema.setup_instruments set enabled='YES';
drop table test.no_index_tab;
diff --git a/mysql-test/suite/perfschema/t/no_threads.test b/mysql-test/suite/perfschema/t/no_threads.test
index 9254535bf1f..dd0bd076dfc 100644
--- a/mysql-test/suite/perfschema/t/no_threads.test
+++ b/mysql-test/suite/perfschema/t/no_threads.test
@@ -17,22 +17,23 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
+--source include/not_threadpool.inc
# Setup : in this main thread
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_CONSUMERS set enabled='YES';
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_consumers set enabled='YES';
+update performance_schema.setup_instruments set enabled='YES'
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
--disable_warnings
drop table if exists test.t1;
--enable_warnings
-truncate table performance_schema.EVENTS_WAITS_CURRENT;
-truncate table performance_schema.EVENTS_WAITS_HISTORY;
-truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
+truncate table performance_schema.events_waits_current;
+truncate table performance_schema.events_waits_history;
+truncate table performance_schema.events_waits_history_long;
show variables like "thread_handling";
@@ -45,23 +46,23 @@ show variables like "performance_schema_max_thread%";
# Verification : in this main thread
-select count(*) from performance_schema.THREADS
+select count(*) from performance_schema.threads
where name like "thread/sql/main";
-select count(*) from performance_schema.THREADS
+select count(*) from performance_schema.threads
where name like "thread/sql/OneConnection";
select event_name, operation,
left(source, locate(":", source)) as short_source
- from performance_schema.EVENTS_WAITS_CURRENT;
+ from performance_schema.events_waits_current;
select event_name, operation,
left(source, locate(":", source)) as short_source
- from performance_schema.EVENTS_WAITS_HISTORY;
+ from performance_schema.events_waits_history;
select event_name, operation,
left(source, locate(":", source)) as short_source
- from performance_schema.EVENTS_WAITS_HISTORY_LONG;
+ from performance_schema.events_waits_history_long;
# Cleanup
diff --git a/mysql-test/suite/perfschema/t/one_thread_per_con.test b/mysql-test/suite/perfschema/t/one_thread_per_con.test
index 7d0daffe228..fc4d17e34c7 100644
--- a/mysql-test/suite/perfschema/t/one_thread_per_con.test
+++ b/mysql-test/suite/perfschema/t/one_thread_per_con.test
@@ -17,6 +17,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
+--source include/not_threadpool.inc
# Setup
@@ -27,7 +28,7 @@
# The point is not to test myisam, but to test that each
# connection is properly instrumented, with one-thread-per-connection
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
+update performance_schema.setup_instruments set enabled='YES'
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
--disable_warnings
@@ -36,7 +37,7 @@ drop table if exists test.t2;
drop table if exists test.t3;
--enable_warnings
-truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
+truncate table performance_schema.events_waits_history_long;
show variables like "thread_handling";
diff --git a/mysql-test/suite/perfschema/t/privilege.test b/mysql-test/suite/perfschema/t/privilege.test
index 2d682de2870..277ba9bf3b8 100644
--- a/mysql-test/suite/perfschema/t/privilege.test
+++ b/mysql-test/suite/perfschema/t/privilege.test
@@ -76,136 +76,128 @@ grant DELETE on performance_schema.* to 'pfs_user_2'@localhost;
grant LOCK TABLES on performance_schema.* to 'pfs_user_2'@localhost;
# Test denied privileges on specific performance_schema tables.
-# SETUP_INSTRUMENT : example of PFS_updatable_acl
-# EVENTS_WAITS_CURRENT : example of PFS_truncatable_acl
-# FILE_INSTANCES : example of PFS_readonly_acl
+# setup_instrument : example of PFS_updatable_acl
+# events_waits_current : example of PFS_truncatable_acl
+# file_instances : example of PFS_readonly_acl
--error ER_DBACCESS_DENIED_ERROR
-grant ALL on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost
+grant ALL on performance_schema.setup_instruments to 'pfs_user_3'@localhost
with GRANT OPTION;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
-grant CREATE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant CREATE on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
-grant DROP on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant DROP on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant REFERENCES on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant REFERENCES on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant INDEX on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant INDEX on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant ALTER on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant ALTER on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant CREATE VIEW on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant CREATE VIEW on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant SHOW VIEW on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant SHOW VIEW on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant TRIGGER on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant TRIGGER on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
-grant INSERT on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant INSERT on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
-grant DELETE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
+grant DELETE on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
-grant SELECT on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost
+grant SELECT on performance_schema.setup_instruments to 'pfs_user_3'@localhost
with GRANT OPTION;
-grant UPDATE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost
+grant UPDATE on performance_schema.setup_instruments to 'pfs_user_3'@localhost
with GRANT OPTION;
--error ER_DBACCESS_DENIED_ERROR
-grant ALL on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost
+grant ALL on performance_schema.events_waits_current to 'pfs_user_3'@localhost
with GRANT OPTION;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
-grant CREATE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant CREATE on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
-grant DROP on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant DROP on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant REFERENCES on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant REFERENCES on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant INDEX on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant INDEX on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant ALTER on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant ALTER on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant CREATE VIEW on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant CREATE VIEW on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant SHOW VIEW on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant SHOW VIEW on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant TRIGGER on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant TRIGGER on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-grant INSERT on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant INSERT on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-grant UPDATE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant UPDATE on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-grant DELETE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
+grant DELETE on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
-grant SELECT on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost
+grant SELECT on performance_schema.events_waits_current to 'pfs_user_3'@localhost
with GRANT OPTION;
--error ER_DBACCESS_DENIED_ERROR
-grant ALL on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost
+grant ALL on performance_schema.file_instances to 'pfs_user_3'@localhost
with GRANT OPTION;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
-grant CREATE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant CREATE on performance_schema.file_instances to 'pfs_user_3'@localhost;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
-grant DROP on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant DROP on performance_schema.file_instances to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant REFERENCES on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant REFERENCES on performance_schema.file_instances to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant INDEX on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant INDEX on performance_schema.file_instances to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant ALTER on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant ALTER on performance_schema.file_instances to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant CREATE VIEW on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant CREATE VIEW on performance_schema.file_instances to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant SHOW VIEW on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant SHOW VIEW on performance_schema.file_instances to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
-grant TRIGGER on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant TRIGGER on performance_schema.file_instances to 'pfs_user_3'@localhost;
---replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-grant INSERT on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant INSERT on performance_schema.file_instances to 'pfs_user_3'@localhost;
---replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-grant UPDATE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant UPDATE on performance_schema.file_instances to 'pfs_user_3'@localhost;
---replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
-grant DELETE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
+grant DELETE on performance_schema.file_instances to 'pfs_user_3'@localhost;
-grant SELECT on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost
+grant SELECT on performance_schema.file_instances to 'pfs_user_3'@localhost
with GRANT OPTION;
# See bug#45354 LOCK TABLES is not a TABLE privilege
@@ -258,25 +250,20 @@ CREATE user pfs_user_4;
--connection pfs_user_4
--echo # Select as pfs_user_4 should fail without grant
---replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
-SELECT event_id FROM performance_schema.EVENTS_WAITS_HISTORY;
+SELECT event_id FROM performance_schema.events_waits_history;
---replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
-SELECT event_id FROM performance_schema.EVENTS_WAITS_HISTORY_LONG;
+SELECT event_id FROM performance_schema.events_waits_history_long;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-SELECT event_id FROM performance_schema.EVENTS_WAITS_CURRENT;
+SELECT event_id FROM performance_schema.events_waits_current;
---replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
-SELECT event_name FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
+SELECT event_name FROM performance_schema.events_waits_summary_by_instance;
---replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
-SELECT event_name FROM performance_schema.FILE_SUMMARY_BY_INSTANCE;
+SELECT event_name FROM performance_schema.file_summary_by_instance;
--echo #
--echo # WL#4818, NFS3: Normal user does not have access to change what is
@@ -287,35 +274,28 @@ SELECT event_name FROM performance_schema.FILE_SUMMARY_BY_INSTANCE;
--echo # User pfs_user_4 should not be allowed to tweak instrumentation without
--echo # explicit grant
---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
+UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
+UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
---replace_result '\'setup_consumers' '\'SETUP_CONSUMERS'
--error ER_TABLEACCESS_DENIED_ERROR
-UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES';
+UPDATE performance_schema.setup_consumers SET enabled = 'YES';
---replace_result '\'setup_timers' '\'SETUP_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
-UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'TICK';
+UPDATE performance_schema.setup_timers SET timer_name = 'TICK';
---replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
+TRUNCATE TABLE performance_schema.events_waits_history_long;
---replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
+TRUNCATE TABLE performance_schema.events_waits_history;
---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+TRUNCATE TABLE performance_schema.events_waits_current;
--echo #
--echo # WL#4814, NFS1: Can use grants to give normal user access
@@ -325,29 +305,29 @@ TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
--connection default
--echo # Grant access to change tables with the root account
-GRANT UPDATE ON performance_schema.SETUP_CONSUMERS TO pfs_user_4;
-GRANT UPDATE ON performance_schema.SETUP_TIMERS TO pfs_user_4;
-GRANT UPDATE, SELECT ON performance_schema.SETUP_INSTRUMENTS TO pfs_user_4;
-GRANT DROP ON performance_schema.EVENTS_WAITS_CURRENT TO pfs_user_4;
-GRANT DROP ON performance_schema.EVENTS_WAITS_HISTORY TO pfs_user_4;
-GRANT DROP ON performance_schema.EVENTS_WAITS_HISTORY_LONG TO pfs_user_4;
+GRANT UPDATE ON performance_schema.setup_consumers TO pfs_user_4;
+GRANT UPDATE ON performance_schema.setup_timers TO pfs_user_4;
+GRANT UPDATE, SELECT ON performance_schema.setup_instruments TO pfs_user_4;
+GRANT DROP ON performance_schema.events_waits_current TO pfs_user_4;
+GRANT DROP ON performance_schema.events_waits_history TO pfs_user_4;
+GRANT DROP ON performance_schema.events_waits_history_long TO pfs_user_4;
--connection pfs_user_4
--echo # User pfs_user_4 should now be allowed to tweak instrumentation
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
+UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
+UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
-UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES';
+UPDATE performance_schema.setup_consumers SET enabled = 'YES';
-UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'TICK';
+UPDATE performance_schema.setup_timers SET timer_name = 'TICK';
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
-TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
+TRUNCATE TABLE performance_schema.events_waits_history_long;
+TRUNCATE TABLE performance_schema.events_waits_history;
+TRUNCATE TABLE performance_schema.events_waits_current;
--echo # Clean up
--disconnect pfs_user_4
@@ -356,7 +336,7 @@ TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM pfs_user_4;
DROP USER pfs_user_4;
flush privileges;
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
-UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES';
-UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'CYCLE';
+UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
+UPDATE performance_schema.setup_consumers SET enabled = 'YES';
+UPDATE performance_schema.setup_timers SET timer_name = 'CYCLE';
diff --git a/mysql-test/suite/perfschema/t/query_cache.test b/mysql-test/suite/perfschema/t/query_cache.test
index a48704dc9d6..6e322434ae0 100644
--- a/mysql-test/suite/perfschema/t/query_cache.test
+++ b/mysql-test/suite/perfschema/t/query_cache.test
@@ -47,17 +47,17 @@ show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
-select spins from performance_schema.EVENTS_WAITS_CURRENT order by event_name limit 1;
+select spins from performance_schema.events_waits_current order by event_name limit 1;
-select name from performance_schema.SETUP_INSTRUMENTS order by name limit 1;
+select name from performance_schema.setup_instruments order by name limit 1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
-select spins from performance_schema.EVENTS_WAITS_CURRENT order by event_name limit 1;
+select spins from performance_schema.events_waits_current order by event_name limit 1;
-select name from performance_schema.SETUP_INSTRUMENTS order by name limit 1;
+select name from performance_schema.setup_instruments order by name limit 1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
diff --git a/mysql-test/suite/perfschema/t/read_only.test b/mysql-test/suite/perfschema/t/read_only.test
index 73150207f66..98683e36327 100644
--- a/mysql-test/suite/perfschema/t/read_only.test
+++ b/mysql-test/suite/perfschema/t/read_only.test
@@ -16,8 +16,8 @@
# Tests for PERFORMANCE_SCHEMA
#
# Check that
-# - a regular user can not update SETUP_ tables under --read-only
-# - a user with SUPER privileges cam
+# - a regular user can not update setup_ tables under --read-only
+# - a user with SUPER privileges can
--source include/not_embedded.inc
--source include/have_perfschema.inc
@@ -43,9 +43,9 @@ connection con1;
select @@global.read_only;
show grants;
--disable_result_log
-select * from performance_schema.SETUP_INSTRUMENTS;
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+select * from performance_schema.setup_instruments;
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES';
--enable_result_log
--echo connection default;
@@ -59,11 +59,11 @@ connection con1;
select @@global.read_only;
show grants;
--disable_result_log
-select * from performance_schema.SETUP_INSTRUMENTS;
+select * from performance_schema.setup_instruments;
--error ER_OPTION_PREVENTS_STATEMENT
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
+update performance_schema.setup_instruments set enabled='NO';
--error ER_OPTION_PREVENTS_STATEMENT
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+update performance_schema.setup_instruments set enabled='YES';
--enable_result_log
--echo connection default;
@@ -79,9 +79,9 @@ connect (con1, localhost, pfsuser, , test);
select @@global.read_only;
show grants;
--disable_result_log
-select * from performance_schema.SETUP_INSTRUMENTS;
-update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
-update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
+select * from performance_schema.setup_instruments;
+update performance_schema.setup_instruments set enabled='NO';
+update performance_schema.setup_instruments set enabled='YES';
--enable_result_log
disconnect con1;
diff --git a/mysql-test/suite/perfschema/t/relaylog.test b/mysql-test/suite/perfschema/t/relaylog.test
new file mode 100644
index 00000000000..68ba57dd502
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/relaylog.test
@@ -0,0 +1,179 @@
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# 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,
+# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/have_log_bin.inc
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source include/master-slave.inc
+
+--disable_warnings
+drop table if exists test.t1;
+--sync_slave_with_master
+reset master;
+--enable_warnings
+
+create table test.t1(a int);
+drop table test.t1;
+
+--source include/show_binlog_events.inc
+
+# Notes
+#
+# The point of this test is to make sure code is properly instrumented,
+# where instruments have the proper key (binlog or relaylog),
+# it is not to dive into statistics for each instruments.
+# Different test execution sequence in different platforms do make the
+# results vary, making the test results very sensitive to changes.
+# To ensure robustness:
+# - log file rotation is limited to file .000001 and .000002
+# - statistics are normalized to "NONE" or "MANY"
+#
+
+connection master;
+-- echo "============ Performance schema on master ============"
+
+select
+ substring(file_name, locate("master-", file_name)) as FILE_NAME,
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_instance
+ where file_name like "%master-%" order by file_name;
+
+select * from performance_schema.file_summary_by_instance
+ where file_name like "%slave-%" order by file_name;
+
+-- echo "Expect a master binlog + binlog_index"
+
+select
+ substring(file_name, locate("master-", file_name)) as FILE_NAME,
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_instance
+ where event_name like "%binlog%" order by file_name;
+
+select
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_event_name
+ where event_name like "%binlog%" order by event_name;
+
+select
+ EVENT_NAME,
+ if (count_star > 0, "MANY", "NONE") as COUNT_STAR
+ from performance_schema.events_waits_summary_global_by_event_name
+ where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+
+-- echo "Expect no slave relay log"
+
+select * from performance_schema.file_summary_by_instance
+ where event_name like "%relaylog%" order by file_name;
+
+select * from performance_schema.file_summary_by_event_name
+ where event_name like "%relaylog%" order by event_name;
+
+select * from performance_schema.events_waits_summary_global_by_event_name
+ where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+
+sync_slave_with_master;
+-- echo "============ Performance schema on slave ============"
+
+select * from performance_schema.file_summary_by_instance
+ where file_name like "%master-%" order by file_name;
+
+select
+ substring(file_name, locate("slave-", file_name)) as FILE_NAME,
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_instance
+ where file_name like "%slave-%"
+ and (file_name not like "%slave-relay-bin.0%"
+ or file_name like "%slave-relay-bin.000001"
+ or file_name like "%slave-relay-bin.000002")
+ order by file_name;
+
+-- echo "Expect a slave binlog + binlog_index"
+
+select
+ substring(file_name, locate("slave-", file_name)) as FILE_NAME,
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_instance
+ where event_name like "%binlog%" order by file_name;
+
+select
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_event_name
+ where event_name like "%binlog%" order by event_name;
+
+select
+ EVENT_NAME,
+ if (count_star > 0, "MANY", "NONE") as COUNT_STAR
+ from performance_schema.events_waits_summary_global_by_event_name
+ where event_name like "%MYSQL_BIN_LOG%" order by event_name;
+
+-- echo "Expect a slave relay log"
+
+select
+ substring(file_name, locate("slave-", file_name)) as FILE_NAME,
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_instance
+ where event_name like "%relaylog%"
+ and (file_name not like "%slave-relay-bin.0%"
+ or file_name like "%slave-relay-bin.000001"
+ or file_name like "%slave-relay-bin.000002")
+ order by file_name;
+
+select
+ EVENT_NAME,
+ if (count_read > 0, "MANY", "NONE") as COUNT_READ,
+ if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
+ if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
+ if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
+ from performance_schema.file_summary_by_event_name
+ where event_name like "%relaylog%" order by event_name;
+
+select
+ EVENT_NAME,
+ if (count_star > 0, "MANY", "NONE") as COUNT_STAR
+ from performance_schema.events_waits_summary_global_by_event_name
+ where event_name like "%MYSQL_RELAY_LOG%" order by event_name;
+
+--source include/stop_slave.inc
+
diff --git a/mysql-test/suite/perfschema/t/schema.test b/mysql-test/suite/perfschema/t/schema.test
index 727c4f5a755..32ee4a26676 100644
--- a/mysql-test/suite/perfschema/t/schema.test
+++ b/mysql-test/suite/perfschema/t/schema.test
@@ -25,21 +25,21 @@ use performance_schema;
show tables;
-show create table COND_INSTANCES;
-show create table EVENTS_WAITS_CURRENT;
-show create table EVENTS_WAITS_HISTORY;
-show create table EVENTS_WAITS_HISTORY_LONG;
-show create table EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-show create table EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-show create table EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
-show create table FILE_INSTANCES;
-show create table FILE_SUMMARY_BY_EVENT_NAME;
-show create table FILE_SUMMARY_BY_INSTANCE;
-show create table MUTEX_INSTANCES;
-show create table PERFORMANCE_TIMERS;
-show create table RWLOCK_INSTANCES;
-show create table SETUP_CONSUMERS;
-show create table SETUP_INSTRUMENTS;
-show create table SETUP_TIMERS;
-show create table THREADS;
+show create table cond_instances;
+show create table events_waits_current;
+show create table events_waits_history;
+show create table events_waits_history_long;
+show create table events_waits_summary_by_instance;
+show create table events_waits_summary_by_thread_by_event_name;
+show create table events_waits_summary_global_by_event_name;
+show create table file_instances;
+show create table file_summary_by_event_name;
+show create table file_summary_by_instance;
+show create table mutex_instances;
+show create table performance_timers;
+show create table rwlock_instances;
+show create table setup_consumers;
+show create table setup_instruments;
+show create table setup_timers;
+show create table threads;
diff --git a/mysql-test/suite/perfschema/t/selects.test b/mysql-test/suite/perfschema/t/selects.test
index b673c896024..e8fd0827c53 100644
--- a/mysql-test/suite/perfschema/t/selects.test
+++ b/mysql-test/suite/perfschema/t/selects.test
@@ -22,7 +22,7 @@
# Make some data that we can work on:
-UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
+UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
--disable_warnings
DROP TABLE IF EXISTS t1;
@@ -35,7 +35,7 @@ INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
--replace_column 2 [NUM_BYTES]
SELECT OPERATION, SUM(NUMBER_OF_BYTES) AS TOTAL
-FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+FROM performance_schema.events_waits_history_long
GROUP BY OPERATION
HAVING TOTAL IS NOT NULL
ORDER BY OPERATION
@@ -43,11 +43,11 @@ LIMIT 1;
# Sub SELECT
--replace_column 1 [EVENT_ID]
-SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+SELECT EVENT_ID FROM performance_schema.events_waits_current
WHERE THREAD_ID IN
- (SELECT THREAD_ID FROM performance_schema.THREADS)
+ (SELECT THREAD_ID FROM performance_schema.threads)
AND EVENT_NAME IN
- (SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
+ (SELECT NAME FROM performance_schema.setup_instruments
WHERE NAME LIKE "wait/synch/%")
LIMIT 1;
@@ -55,9 +55,9 @@ LIMIT 1;
--replace_column 1 [EVENT_ID]
SELECT DISTINCT EVENT_ID
-FROM performance_schema.EVENTS_WAITS_CURRENT
-JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID)
-JOIN performance_schema.EVENTS_WAITS_HISTORY_LONG USING (EVENT_ID)
+FROM performance_schema.events_waits_current
+JOIN performance_schema.events_waits_history USING (EVENT_ID)
+JOIN performance_schema.events_waits_history_long USING (EVENT_ID)
ORDER BY EVENT_ID
LIMIT 1;
@@ -65,21 +65,21 @@ LIMIT 1;
--replace_column 1 [THREAD_ID] 2 [EVENT_ID] 3 [EVENT_NAME] 4 [TIMER_WAIT]
SELECT t1.THREAD_ID, t2.EVENT_ID, t3.EVENT_NAME, t4.TIMER_WAIT
-FROM performance_schema.EVENTS_WAITS_HISTORY t1
-JOIN performance_schema.EVENTS_WAITS_HISTORY t2 USING (EVENT_ID)
-JOIN performance_schema.EVENTS_WAITS_HISTORY t3 ON (t2.THREAD_ID = t3.THREAD_ID)
-JOIN performance_schema.EVENTS_WAITS_HISTORY t4 ON (t3.EVENT_NAME = t4.EVENT_NAME)
+FROM performance_schema.events_waits_history t1
+JOIN performance_schema.events_waits_history t2 USING (EVENT_ID)
+JOIN performance_schema.events_waits_history t3 ON (t2.THREAD_ID = t3.THREAD_ID)
+JOIN performance_schema.events_waits_history t4 ON (t3.EVENT_NAME = t4.EVENT_NAME)
ORDER BY t1.EVENT_ID, t2.EVENT_ID
LIMIT 5;
# UNION
--replace_column 1 [THREAD_ID] 2 [EVENT_ID]
SELECT THREAD_ID, EVENT_ID FROM (
-SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+SELECT THREAD_ID, EVENT_ID FROM performance_schema.events_waits_current
UNION
-SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_HISTORY
+SELECT THREAD_ID, EVENT_ID FROM performance_schema.events_waits_history
UNION
-SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
+SELECT THREAD_ID, EVENT_ID FROM performance_schema.events_waits_history_long
) t1 ORDER BY THREAD_ID, EVENT_ID
LIMIT 5;
@@ -93,14 +93,14 @@ DROP TABLE IF EXISTS t_event;
DROP EVENT IF EXISTS t_ps_event;
--enable_warnings
CREATE TABLE t_event AS
-SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
+SELECT EVENT_ID FROM performance_schema.events_waits_current
WHERE 1 = 2;
CREATE EVENT t_ps_event
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
DO INSERT INTO t_event
SELECT DISTINCT EVENT_ID
- FROM performance_schema.EVENTS_WAITS_CURRENT
- JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID)
+ FROM performance_schema.events_waits_current
+ JOIN performance_schema.events_waits_history USING (EVENT_ID)
ORDER BY EVENT_ID
LIMIT 1;
@@ -116,7 +116,7 @@ delimiter |;
CREATE TRIGGER t_ps_trigger BEFORE INSERT ON t1
FOR EACH ROW BEGIN
SET NEW.c = (SELECT MAX(EVENT_ID)
- FROM performance_schema.EVENTS_WAITS_CURRENT);
+ FROM performance_schema.events_waits_current);
END;
|
@@ -136,17 +136,17 @@ DROP PROCEDURE IF EXISTS t_ps_proc;
--enable_warnings
delimiter |;
-CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT)
+CREATE PROCEDURE t_ps_proc(IN conid INT, OUT pid INT)
BEGIN
- SELECT id FROM performance_schema.THREADS
- WHERE THREAD_ID = tid INTO pid;
+ SELECT thread_id FROM performance_schema.threads
+ WHERE PROCESSLIST_ID = conid INTO pid;
END;
|
delimiter ;|
-CALL t_ps_proc(0, @p_id);
+CALL t_ps_proc(connection_id(), @p_id);
# FUNCTION
@@ -155,17 +155,17 @@ DROP FUNCTION IF EXISTS t_ps_proc;
--enable_warnings
delimiter |;
-CREATE FUNCTION t_ps_func(tid INT) RETURNS int
+CREATE FUNCTION t_ps_func(conid INT) RETURNS int
BEGIN
- return (SELECT id FROM performance_schema.THREADS
- WHERE THREAD_ID = tid);
+ return (SELECT thread_id FROM performance_schema.threads
+ WHERE PROCESSLIST_ID = conid);
END;
|
delimiter ;|
-SELECT t_ps_func(0) = @p_id;
+SELECT t_ps_func(connection_id()) = @p_id;
# We might reach this point too early which means the event scheduler has not
# execute our "t_ps_event". Therefore we poll till the record was inserted
diff --git a/mysql-test/suite/perfschema/t/server_init.test b/mysql-test/suite/perfschema/t/server_init.test
index cc461374a79..95d8be0e864 100644
--- a/mysql-test/suite/perfschema/t/server_init.test
+++ b/mysql-test/suite/perfschema/t/server_init.test
@@ -28,185 +28,173 @@ use performance_schema;
# Verify that these global mutexes have been properly initilized in mysys
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_threads";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_malloc";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_open";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_isam";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_heap";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_net";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/mysys/THR_LOCK_charset";
-select count(name) from MUTEX_INSTANCES
- where name like "wait/synch/mutex/mysys/THR_LOCK_time";
-
# There are no global rwlock in mysys
# Verify that these global conditions have been properly initilized in mysys
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/mysys/THR_COND_threads";
# Verify that these global mutexes have been properly initilized in sql
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_open";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_thread_count";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_status";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_error_log";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_delayed_insert";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_uuid_generator";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_delayed_status";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_delayed_create";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_crypt";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_slave_list";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_active_mi";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_manager";
-select count(name) from MUTEX_INSTANCES
- where name like "wait/synch/mutex/sql/LOCK_global_read_lock";
-
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_global_system_variables";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_user_conn";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_prepared_stmt_count";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_connection_count";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_server_started";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_rpl_status";
# LOG_INFO object are created on demand, and are not global.
-# select count(name) from MUTEX_INSTANCES
+# select count(name) from mutex_instances
# where name like "wait/synch/mutex/sql/LOG_INFO::lock";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/Query_cache::structure_guard_mutex";
# The event scheduler may be disabled
-# select count(name) from MUTEX_INSTANCES
+# select count(name) from mutex_instances
# where name like "wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state";
-select count(name) from MUTEX_INSTANCES
- where name like "wait/synch/mutex/sql/LOCK_event_metadata";
-
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_event_queue";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_user_locks";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/Cversion_lock";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_audit_mask";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_xid_cache";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/LOCK_plugin";
# Not a global variable, may be destroyed already.
-# select count(name) from MUTEX_INSTANCES
+# select count(name) from mutex_instances
# where name like "wait/synch/mutex/sql/LOCK_gdl";
-select count(name) from MUTEX_INSTANCES
+select count(name) from mutex_instances
where name like "wait/synch/mutex/sql/tz_LOCK";
# Verify that these global rwlocks have been properly initilized in sql
-select count(name) from RWLOCK_INSTANCES
+select count(name) from rwlock_instances
where name like "wait/synch/rwlock/sql/LOCK_grant";
-select count(name) from RWLOCK_INSTANCES
+select count(name) from rwlock_instances
where name like "wait/synch/rwlock/sql/LOCK_sys_init_connect";
-select count(name) from RWLOCK_INSTANCES
+select count(name) from rwlock_instances
where name like "wait/synch/rwlock/sql/LOCK_sys_init_slave";
-select count(name) from RWLOCK_INSTANCES
+select count(name) from rwlock_instances
where name like "wait/synch/rwlock/sql/LOCK_system_variables_hash";
# Verify that these global conditions have been properly initilized in sql
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_server_started";
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_refresh";
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_thread_count";
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_manager";
-select count(name) from COND_INSTANCES
- where name like "wait/synch/cond/sql/COND_global_read_lock";
-
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_thread_cache";
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_flush_thread_cache";
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_rpl_status";
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/Query_cache::COND_cache_status_changed";
# The event scheduler may be disabled
-# select count(name) from COND_INSTANCES
+# select count(name) from cond_instances
# where name like "wait/synch/cond/sql/Event_scheduler::COND_state";
-select count(name) from COND_INSTANCES
+select count(name) from cond_instances
where name like "wait/synch/cond/sql/COND_queue_state";
diff --git a/mysql-test/suite/perfschema/t/start_server_no_cond_class.test b/mysql-test/suite/perfschema/t/start_server_no_cond_class.test
index 34ff61c358e..da75306c2ca 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_cond_class.test
+++ b/mysql-test/suite/perfschema/t/start_server_no_cond_class.test
@@ -23,7 +23,7 @@
# Expect no classes
show variables like "performance_schema_max_cond_classes";
-select count(*) from performance_schema.SETUP_INSTRUMENTS
+select count(*) from performance_schema.setup_instruments
where name like "wait/synch/cond/%";
# We lost all the classes
@@ -31,7 +31,7 @@ select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_COND_CLASSES_LOST';
# Expect no instances
-select count(*) from performance_schema.COND_INSTANCES;
+select count(*) from performance_schema.cond_instances;
# Expect no instances lost
show status like "performance_schema_cond_instances_lost";
diff --git a/mysql-test/suite/perfschema/t/start_server_no_cond_inst.test b/mysql-test/suite/perfschema/t/start_server_no_cond_inst.test
index fe2177adb82..eb77d76b70e 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_cond_inst.test
+++ b/mysql-test/suite/perfschema/t/start_server_no_cond_inst.test
@@ -23,7 +23,7 @@
# Expect classes
show variables like "performance_schema_max_cond_classes";
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
+select count(*) > 0 from performance_schema.setup_instruments
where name like "wait/synch/cond/%";
# Expect no class lost
@@ -32,7 +32,7 @@ show status like "performance_schema_cond_classes_lost";
# Expect no instances
show variables like "performance_schema_max_cond_instances";
-select count(*) from performance_schema.COND_INSTANCES;
+select count(*) from performance_schema.cond_instances;
# Expect instances lost
select variable_value > 0 from information_schema.global_status
diff --git a/mysql-test/suite/perfschema/t/start_server_no_file_class.test b/mysql-test/suite/perfschema/t/start_server_no_file_class.test
index ca84fbbdcf2..03180dae01e 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_file_class.test
+++ b/mysql-test/suite/perfschema/t/start_server_no_file_class.test
@@ -23,7 +23,7 @@
# Expect no classes
show variables like "performance_schema_max_file_classes";
-select count(*) from performance_schema.SETUP_INSTRUMENTS
+select count(*) from performance_schema.setup_instruments
where name like "wait/io/file/%";
# We lost all the classes
@@ -31,7 +31,7 @@ select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_FILE_CLASSES_LOST';
# Expect no instances
-select count(*) from performance_schema.FILE_INSTANCES;
+select count(*) from performance_schema.file_instances;
# Expect no instances lost
show status like "performance_schema_file_instances_lost";
diff --git a/mysql-test/suite/perfschema/t/start_server_no_file_inst.test b/mysql-test/suite/perfschema/t/start_server_no_file_inst.test
index dbbba7bbe4a..faa5e97a853 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_file_inst.test
+++ b/mysql-test/suite/perfschema/t/start_server_no_file_inst.test
@@ -23,7 +23,7 @@
# Expect classes
show variables like "performance_schema_max_file_classes";
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
+select count(*) > 0 from performance_schema.setup_instruments
where name like "wait/io/file/%";
# Expect no class lost
@@ -32,7 +32,7 @@ show status like "performance_schema_file_classes_lost";
# Expect no instances
show variables like "performance_schema_max_file_instances";
-select count(*) from performance_schema.FILE_INSTANCES;
+select count(*) from performance_schema.file_instances;
# Expect instances lost
select variable_value > 0 from information_schema.global_status
diff --git a/mysql-test/suite/perfschema/t/start_server_no_mutex_class.test b/mysql-test/suite/perfschema/t/start_server_no_mutex_class.test
index 142e150ede6..79bf3d52bc5 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_mutex_class.test
+++ b/mysql-test/suite/perfschema/t/start_server_no_mutex_class.test
@@ -23,7 +23,7 @@
# Expect no classes
show variables like "performance_schema_max_mutex_classes";
-select count(*) from performance_schema.SETUP_INSTRUMENTS
+select count(*) from performance_schema.setup_instruments
where name like "wait/synch/mutex/%";
# We lost all the classes
@@ -31,7 +31,7 @@ select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_MUTEX_CLASSES_LOST';
# Expect no instances
-select count(*) from performance_schema.MUTEX_INSTANCES;
+select count(*) from performance_schema.mutex_instances;
# Expect no instances lost
show status like "performance_schema_mutex_instances_lost";
diff --git a/mysql-test/suite/perfschema/t/start_server_no_mutex_inst.test b/mysql-test/suite/perfschema/t/start_server_no_mutex_inst.test
index 5a03251d97a..32c0a02b642 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_mutex_inst.test
+++ b/mysql-test/suite/perfschema/t/start_server_no_mutex_inst.test
@@ -23,7 +23,7 @@
# Expect classes
show variables like "performance_schema_max_mutex_classes";
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
+select count(*) > 0 from performance_schema.setup_instruments
where name like "wait/synch/mutex/%";
# Expect no class lost
@@ -32,7 +32,7 @@ show status like "performance_schema_mutex_classes_lost";
# Expect no instances
show variables like "performance_schema_max_mutex_instances";
-select count(*) from performance_schema.MUTEX_INSTANCES;
+select count(*) from performance_schema.mutex_instances;
# Expect instances lost
select variable_value > 0 from information_schema.global_status
diff --git a/mysql-test/suite/perfschema/t/start_server_no_rwlock_class.test b/mysql-test/suite/perfschema/t/start_server_no_rwlock_class.test
index e4dfe121fcf..10780b59fbe 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_rwlock_class.test
+++ b/mysql-test/suite/perfschema/t/start_server_no_rwlock_class.test
@@ -23,7 +23,7 @@
# Expect no classes
show variables like "performance_schema_max_rwlock_classes";
-select count(*) from performance_schema.SETUP_INSTRUMENTS
+select count(*) from performance_schema.setup_instruments
where name like "wait/synch/rwlock/%";
# We lost all the classes
@@ -31,7 +31,7 @@ select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_RWLOCK_CLASSES_LOST';
# Expect no instances
-select count(*) from performance_schema.RWLOCK_INSTANCES;
+select count(*) from performance_schema.rwlock_instances;
# Expect no instances lost
show status like "performance_schema_rwlock_instances_lost";
diff --git a/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst.test b/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst.test
index 1d79d2d3991..2ba2ebcdd4b 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst.test
+++ b/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst.test
@@ -23,7 +23,7 @@
# Expect classes
show variables like "performance_schema_max_rwlock_classes";
-select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
+select count(*) > 0 from performance_schema.setup_instruments
where name like "wait/synch/rwlock/%";
# Expect no class lost
@@ -32,7 +32,7 @@ show status like "performance_schema_rwlock_classes_lost";
# Expect no instances
show variables like "performance_schema_max_rwlock_instances";
-select count(*) from performance_schema.RWLOCK_INSTANCES;
+select count(*) from performance_schema.rwlock_instances;
# Expect instances lost
select variable_value > 0 from information_schema.global_status
diff --git a/mysql-test/suite/perfschema/t/start_server_no_thread_class.test b/mysql-test/suite/perfschema/t/start_server_no_thread_class.test
index 1ed0fecb538..df825ede637 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_thread_class.test
+++ b/mysql-test/suite/perfschema/t/start_server_no_thread_class.test
@@ -23,7 +23,7 @@
# Expect no classes
show variables like "performance_schema_max_thread_classes";
-select count(*) from performance_schema.SETUP_INSTRUMENTS
+select count(*) from performance_schema.setup_instruments
where name like "thread/%";
# We lost all the classes
@@ -31,7 +31,7 @@ select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_THREAD_CLASSES_LOST';
# Expect no instances
-select count(*) from performance_schema.THREADS;
+select count(*) from performance_schema.threads;
# Expect no instances lost
show status like "performance_schema_thread_instances_lost";
diff --git a/mysql-test/suite/perfschema/t/start_server_no_thread_inst.test b/mysql-test/suite/perfschema/t/start_server_no_thread_inst.test
index 489f814ba10..150886d01f9 100644
--- a/mysql-test/suite/perfschema/t/start_server_no_thread_inst.test
+++ b/mysql-test/suite/perfschema/t/start_server_no_thread_inst.test
@@ -24,7 +24,7 @@
show variables like "performance_schema_max_thread_classes";
# Not observable yet
-# select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
+# select count(*) > 0 from performance_schema.setup_instruments
# where name like "thread/%";
# Expect no class lost
@@ -33,7 +33,7 @@ show status like "performance_schema_thread_classes_lost";
# Expect no instances
show variables like "performance_schema_max_thread_instances";
-select count(*) from performance_schema.THREADS;
+select count(*) from performance_schema.threads;
# Expect instances lost
select variable_value > 0 from information_schema.global_status
diff --git a/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test b/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test
index be079bacfbf..741b41ec46b 100644
--- a/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test
+++ b/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test
@@ -27,18 +27,18 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
-# The message prints 'mysql.SETUP_INSTRUMENTS'
-# instead of 'performance_schema.SETUP_INSTRUMENTS',
+# The message prints 'mysql.setup_instruments'
+# instead of 'performance_schema.setup_instruments',
# due to Bug#46792
call mtr.add_suppression(
-"Column count of mysql.SETUP_INSTRUMENTS is wrong. "
+"Column count of mysql.setup_instruments is wrong. "
"Expected 4, found 3. The table is probably corrupted");
--error ER_WRONG_NATIVE_TABLE_STRUCTURE
-select * from performance_schema.SETUP_INSTRUMENTS limit 1;
+select * from performance_schema.setup_instruments limit 1;
--disable_result_log
-select * from performance_schema.SETUP_CONSUMERS limit 1;
+select * from performance_schema.setup_consumers limit 1;
--enable_result_log
diff --git a/mysql-test/suite/perfschema/t/thread_cache.test b/mysql-test/suite/perfschema/t/thread_cache.test
index 5560f66babb..e839552ed19 100644
--- a/mysql-test/suite/perfschema/t/thread_cache.test
+++ b/mysql-test/suite/perfschema/t/thread_cache.test
@@ -20,6 +20,8 @@
# Setup
+flush status;
+
SET @saved_thread_cache_size = @@global.thread_cache_size;
set global thread_cache_size = 0;
@@ -30,17 +32,17 @@ connect (con1, localhost, root, , );
let $con1_ID=`select connection_id()`;
-let $con1_THREAD_ID=`select thread_id from performance_schema.THREADS
- where ID = connection_id()`;
+let $con1_THREAD_ID=`select thread_id from performance_schema.threads
+ where PROCESSLIST_ID = connection_id()`;
connect (con2, localhost, root, , );
let $con2_ID=`select connection_id()`;
-let $con2_THREAD_ID=`select thread_id from performance_schema.THREADS
- where ID = connection_id()`;
+let $con2_THREAD_ID=`select thread_id from performance_schema.threads
+ where PROCESSLIST_ID = connection_id()`;
-connection default;
+--connection default
--disable_query_log
eval select ($con2_ID - $con1_ID) into @id_increment;
@@ -52,19 +54,33 @@ select @id_increment;
# Expect 1, THREAD_ID is incremented for each new connection
select @thread_id_increment;
-disconnect con2;
+--disconnect con2
+
+--connection default
+
+# Wait for the disconnect con2 to complete
+let $wait_condition=
+ select count(*) = 2 from performance_schema.threads
+ where name like "thread/sql/one_connection";
+--source include/wait_condition.inc
connect (con3, localhost, root, , );
let $con3_ID=`select connection_id()`;
-let $con3_THREAD_ID=`select thread_id from performance_schema.THREADS
- where ID = connection_id()`;
+let $con3_THREAD_ID=`select thread_id from performance_schema.threads
+ where PROCESSLIST_ID = connection_id()`;
+
+--disconnect con3
+--disconnect con1
-disconnect con3;
-disconnect con1;
+--connection default
-connection default;
+# Wait for the disconnect con1 and con3 to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where name like "thread/sql/one_connection";
+--source include/wait_condition.inc
--disable_query_log
eval select ($con3_ID - $con2_ID) into @id_increment;
@@ -82,17 +98,17 @@ connect (con1, localhost, root, , );
let $con1_ID=`select connection_id()`;
-let $con1_THREAD_ID=`select thread_id from performance_schema.THREADS
- where ID = connection_id()`;
+let $con1_THREAD_ID=`select thread_id from performance_schema.threads
+ where PROCESSLIST_ID = connection_id()`;
connect (con2, localhost, root, , );
let $con2_ID=`select connection_id()`;
-let $con2_THREAD_ID=`select thread_id from performance_schema.THREADS
- where ID = connection_id()`;
+let $con2_THREAD_ID=`select thread_id from performance_schema.threads
+ where PROCESSLIST_ID = connection_id()`;
-connection default;
+--connection default
--disable_query_log
eval select ($con2_ID - $con1_ID) into @id_increment;
@@ -102,19 +118,33 @@ eval select ($con2_THREAD_ID - $con1_THREAD_ID) into @thread_id_increment;
select @id_increment;
select @thread_id_increment;
-disconnect con2;
+--disconnect con2
+
+--connection default
+
+# Wait for the disconnect con2 to complete
+let $wait_condition=
+ select count(*) = 2 from performance_schema.threads
+ where name like "thread/sql/one_connection";
+--source include/wait_condition.inc
connect (con3, localhost, root, , );
let $con3_ID=`select connection_id()`;
-let $con3_THREAD_ID=`select thread_id from performance_schema.THREADS
- where ID = connection_id()`;
+let $con3_THREAD_ID=`select thread_id from performance_schema.threads
+ where PROCESSLIST_ID = connection_id()`;
-disconnect con3;
-disconnect con1;
+--disconnect con3
+--disconnect con1
-connection default;
+--connection default
+
+# Wait for the disconnect con1 and con3 to complete
+let $wait_condition=
+ select count(*) = 1 from performance_schema.threads
+ where name like "thread/sql/one_connection";
+--source include/wait_condition.inc
--disable_query_log
eval select ($con3_ID - $con2_ID) into @id_increment;
@@ -132,3 +162,5 @@ select @thread_id_increment;
set global thread_cache_size = @saved_thread_cache_size;
+show status like "performance_schema_thread%";
+
diff --git a/mysql-test/suite/perfschema_stress/t/modify.test b/mysql-test/suite/perfschema_stress/t/modify.test
index 08b0699ace6..f37255c6b09 100644
--- a/mysql-test/suite/perfschema_stress/t/modify.test
+++ b/mysql-test/suite/perfschema_stress/t/modify.test
@@ -19,7 +19,7 @@
let $have_table= `SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'`;
-if (`SELECT ($have_table = 0)`) {
+if (!$have_table) {
--source suite/perfschema_stress/t/setup.test
}
diff --git a/mysql-test/suite/perfschema_stress/t/setup.test b/mysql-test/suite/perfschema_stress/t/setup.test
index 9f643edfebe..e55ed5e8630 100644
--- a/mysql-test/suite/perfschema_stress/t/setup.test
+++ b/mysql-test/suite/perfschema_stress/t/setup.test
@@ -23,10 +23,10 @@ if (`SELECT VERSION() LIKE '%embedded%'`)
--disable_query_log
--disable_result_log
-if (`SELECT LENGTH('$engine_type') = 0`) {
+if (!$engine_type) {
let $engine_type= $default_engine_type;
}
-if (`SELECT '$engine_type' = 'Falcon'`) {
+if ($engine_type == Falcon) {
--source include/have_falcon.inc
}
diff --git a/mysql-test/suite/perfschema_stress/t/work.test b/mysql-test/suite/perfschema_stress/t/work.test
index 8f1bc42c5bc..4408a00b0c9 100644
--- a/mysql-test/suite/perfschema_stress/t/work.test
+++ b/mysql-test/suite/perfschema_stress/t/work.test
@@ -19,7 +19,7 @@
let $have_table= `SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'`;
-if (`SELECT ($have_table = 0)`) {
+if (!$have_table) {
--source suite/perfschema_stress/t/setup.test
}
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc b/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
index 79825016448..89db1c3545d 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
@@ -1,6 +1,4 @@
#########################################
-# Author: Serge Kozlov skozlov@mysql.com
-# Date: 07/10/2006
# Purpose: testing the replication in mixed mode
# Requirements: define binlog format for mysqld as in example below:
# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
@@ -82,3 +80,4 @@ sync_slave_with_master;
# the files your self to see what is not matching
--diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
index d953397c0cb..dc245b8d38c 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
@@ -1,6 +1,4 @@
#########################################
-# Author: Serge Kozlov skozlov@mysql.com
-# Date: 07/10/2006
# Purpose: testing the replication in mixed mode
# Requirements: define binlog format for mysqld as in example below:
# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
@@ -342,3 +340,4 @@ sync_slave_with_master;
# the files your self to see what is not matching
--diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl000010.result b/mysql-test/suite/rpl/r/rpl000010.result
deleted file mode 100644
index 65191ea411f..00000000000
--- a/mysql-test/suite/rpl/r/rpl000010.result
+++ /dev/null
@@ -1,14 +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 auto_increment primary key);
-insert into t1 values(NULL);
-insert into t1 values(2);
-select n from t1;
-n
-1
-2
-drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl000011.result b/mysql-test/suite/rpl/r/rpl000011.result
deleted file mode 100644
index dd0fa2fbe74..00000000000
--- a/mysql-test/suite/rpl/r/rpl000011.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);
-insert into t1 values(1);
-stop slave;
-start slave;
-insert into t1 values(2);
-select * from t1;
-n
-1
-2
-drop table t1;
diff --git a/mysql-test/suite/rpl/r/rpl000013.result b/mysql-test/suite/rpl/r/rpl000013.result
deleted file mode 100644
index 37838bb88e0..00000000000
--- a/mysql-test/suite/rpl/r/rpl000013.result
+++ /dev/null
@@ -1,28 +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 t2(n int);
-create temporary table t1 (n int);
-insert into t1 values(1),(2),(3);
-insert into t2 select * from t1;
-create temporary table t1 (n int);
-insert into t1 values (4),(5);
-insert into t2 select * from t1 as t10;
-insert into t2 values(6);
-select * from t2;
-n
-1
-2
-3
-4
-5
-6
-show status like 'Slave_open_temp_tables';
-Variable_name Value
-Slave_open_temp_tables 0
-drop table if exists t1,t2;
-Warnings:
-Note 1051 Unknown table 't1'
diff --git a/mysql-test/suite/rpl/r/rpl000017.result b/mysql-test/suite/rpl/r/rpl000017.result
deleted file mode 100644
index 403f4d4d4fe..00000000000
--- a/mysql-test/suite/rpl/r/rpl000017.result
+++ /dev/null
@@ -1,15 +0,0 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
-grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
-start slave;
-drop table if exists t1;
-create table t1(n int);
-insert into t1 values(24);
-select * from t1;
-n
-24
-drop table t1;
-delete from mysql.user where user="replicate";
diff --git a/mysql-test/suite/rpl/r/rpl_000010.result b/mysql-test/suite/rpl/r/rpl_000010.result
new file mode 100644
index 00000000000..4bb87a765cd
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_000010.result
@@ -0,0 +1,11 @@
+include/master-slave.inc
+[connection master]
+create table t1 (n int not null auto_increment primary key);
+insert into t1 values(NULL);
+insert into t1 values(2);
+select n from t1;
+n
+1
+2
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_000011.result b/mysql-test/suite/rpl/r/rpl_000011.result
new file mode 100644
index 00000000000..8a59eb746ad
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_000011.result
@@ -0,0 +1,15 @@
+include/master-slave.inc
+[connection master]
+create table t1 (n int);
+insert into t1 values(1);
+stop slave;
+include/wait_for_slave_to_stop.inc
+start slave;
+include/wait_for_slave_to_start.inc
+insert into t1 values(2);
+select * from t1;
+n
+1
+2
+drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_000013.result b/mysql-test/suite/rpl/r/rpl_000013.result
new file mode 100644
index 00000000000..e94a469e970
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_000013.result
@@ -0,0 +1,25 @@
+include/master-slave.inc
+[connection master]
+create table t2(n int);
+create temporary table t1 (n int);
+insert into t1 values(1),(2),(3);
+insert into t2 select * from t1;
+create temporary table t1 (n int);
+insert into t1 values (4),(5);
+insert into t2 select * from t1 as t10;
+insert into t2 values(6);
+select * from t2;
+n
+1
+2
+3
+4
+5
+6
+show status like 'Slave_open_temp_tables';
+Variable_name Value
+Slave_open_temp_tables 0
+drop table if exists t1,t2;
+Warnings:
+Note 1051 Unknown table 't1'
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_000017.result b/mysql-test/suite/rpl/r/rpl_000017.result
new file mode 100644
index 00000000000..1b4f9f1e8a3
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_000017.result
@@ -0,0 +1,13 @@
+include/master-slave.inc
+[connection master]
+grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
+grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
+include/start_slave.inc
+create table t1(n int);
+insert into t1 values(24);
+select * from t1;
+n
+24
+drop table t1;
+delete from mysql.user where user="replicate";
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_EE_err.result b/mysql-test/suite/rpl/r/rpl_EE_err.result
index 8c1277445b2..8220f4e0c8d 100644
--- a/mysql-test/suite/rpl/r/rpl_EE_err.result
+++ b/mysql-test/suite/rpl/r/rpl_EE_err.result
@@ -1,11 +1,8 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1 (a int) engine=myisam;
flush tables;
drop table if exists t1;
Warnings:
Warning 2 Can't find file: 't1' (errno: 2)
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_LD_INFILE.result b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
index b092dd9e088..3280d4bbaf7 100644
--- a/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
+++ b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a VARCHAR(255), PRIMARY KEY(a));
LOAD DATA INFILE '../../std_data/words2.dat' INTO TABLE test.t1;
@@ -115,3 +111,4 @@ abasement
abased
abase
DROP TABLE test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_alter.result b/mysql-test/suite/rpl/r/rpl_alter.result
index 6ef5ce3462a..2cffa70d778 100644
--- a/mysql-test/suite/rpl/r/rpl_alter.result
+++ b/mysql-test/suite/rpl/r/rpl_alter.result
@@ -1,10 +1,5 @@
-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 mysqltest;
+include/master-slave.inc
+[connection master]
create database mysqltest;
create table mysqltest.t1 ( n int);
alter table mysqltest.t1 add m int;
@@ -19,3 +14,4 @@ select * from mysqltest.t3;
n
45
drop database mysqltest;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_alter_db.result b/mysql-test/suite/rpl/r/rpl_alter_db.result
index 60c07d0dede..55adbfeda79 100644
--- a/mysql-test/suite/rpl/r/rpl_alter_db.result
+++ b/mysql-test/suite/rpl/r/rpl_alter_db.result
@@ -1,12 +1,9 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==== Verify that alter database does not stop replication ====
create database temp_db;
use temp_db;
alter database collate latin1_bin;
==== Clean up ====
drop database temp_db;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result
index 831e9b5c8b5..a0478947c72 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam auto_increment=3;
insert into t1 values (NULL,1),(NULL,2),(NULL,3);
select * from t1;
@@ -244,12 +240,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
drop table t1;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
@@ -303,12 +294,30 @@ id
INSERT INTO t1 VALUES(4);
INSERT INTO t2 VALUES(4);
FLUSH LOGS;
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1;
DROP TABLE t2;
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1;
DROP TABLE t2;
SET SQL_MODE='';
+CREATE TABLE t1 (id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, data INT) ENGINE=innodb;
+BEGIN;
+# Set sql_mode with NO_AUTO_VALUE_ON_ZERO for allowing
+# zero to fill the auto_increment field.
+SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
+INSERT INTO t1(id,data) VALUES(0,2);
+# Resetting sql_mode without NO_AUTO_VALUE_ON_ZERO to
+# affect the execution of the transaction on slave.
+SET SQL_MODE=0;
+COMMIT;
+SELECT * FROM t1;
+id data
+0 2
+SELECT * FROM t1;
+id data
+0 2
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result b/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result
index 25eda6ee454..62ff28e7159 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop database if exists test1;
create database test1;
use test1;
@@ -44,4 +40,4 @@ id fname
1 testtest 1
2 test
drop database test1;
-drop database test1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result b/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result
new file mode 100644
index 00000000000..71c6ff57f80
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result
@@ -0,0 +1,45 @@
+include/master-slave.inc
+[connection master]
+==== Initialize ====
+SET @old_relay_log_purge= @@global.relay_log_purge;
+include/setup_fake_relay_log.inc
+Setting up fake replication from MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001
+==== Test ====
+start slave sql_thread;
+include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
+# Result on slave
+SELECT * FROM t1;
+id
+5
+6
+7
+8
+9
+10
+11
+SELECT * FROM t2;
+id
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+==== Clean up ====
+stop slave sql_thread;
+include/cleanup_fake_relay_log.inc
+DROP TABLE t1, t2;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+SET @@global.relay_log_purge= @old_relay_log_purge;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result b/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result
index b2cc92491c3..af84978dc80 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
# Test case1: INVOKES A TRIGGER with after insert action
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
@@ -110,9 +106,9 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with after insert action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t4 and slave:test.t4
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t4, slave:t4]
+include/diff_tables.inc [master:t6, slave:t6]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -226,9 +222,9 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with before insert action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t4 and slave:test.t4
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t4, slave:t4]
+include/diff_tables.inc [master:t6, slave:t6]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -342,9 +338,9 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with after update action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t4 and slave:test.t4
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t4, slave:t4]
+include/diff_tables.inc [master:t6, slave:t6]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -458,9 +454,9 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with before update action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t4 and slave:test.t4
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t4, slave:t4]
+include/diff_tables.inc [master:t6, slave:t6]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -574,9 +570,9 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with after delete action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t4 and slave:test.t4
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t4, slave:t4]
+include/diff_tables.inc [master:t6, slave:t6]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -690,9 +686,9 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with before delete action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t4 and slave:test.t4
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t4, slave:t4]
+include/diff_tables.inc [master:t6, slave:t6]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -761,8 +757,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'CALLS A FUNCTION which INVOKES A TRIGGER with after insert action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t3 and slave:test.t3
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t3, slave:t3]
drop table t1;
drop table t2;
drop table t3;
@@ -828,8 +824,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */
commit;
#Test if the results are consistent on master and slave
#for 'CALLS A FUNCTION which INVOKES A TRIGGER with before insert action'
-Comparing tables master:test.t2 and slave:test.t2
-Comparing tables master:test.t3 and slave:test.t3
+include/diff_tables.inc [master:t2, slave:t2]
+include/diff_tables.inc [master:t3, slave:t3]
drop table t1;
drop table t2;
drop table t3;
@@ -853,7 +849,7 @@ INSERT INTO v16(c1) VALUES (25), (26);
commit;
#Test if the results are consistent on master and slave
#for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
-Comparing tables master:test.t3 and slave:test.t3
+include/diff_tables.inc [master:t3, slave:t3]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -877,7 +873,7 @@ INSERT INTO v16(c1) VALUES (25), (26);
commit;
#Test if the results are consistent on master and slave
#for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
-Comparing tables master:test.t3 and slave:test.t3
+include/diff_tables.inc [master:t3, slave:t3]
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -980,8 +976,8 @@ master-bin.000001 # Query # # use `test`; insert into t2(a,b) values(3,3)
master-bin.000001 # Xid # # COMMIT /* XID */
#Test if the results are consistent on master and slave
#for 'UPDATE MORE THAN ONE TABLES ON TOP-STATEMENT'
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
drop table t1;
drop table t2;
# Test case14: INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES
@@ -1034,8 +1030,9 @@ master-bin.000001 # Query # # use `test`; INSERT INTO v15(c2) VALUES (25), (26)
master-bin.000001 # Xid # # COMMIT /* XID */
#Test if the results are consistent on master and slave
#for 'INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES'
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
drop table t1;
drop table t2;
drop view v15;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
index 94c4e31d584..4cddb7d2cc7 100644
--- a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
+++ b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
SET @@session.binlog_direct_non_transactional_updates= FALSE;
@@ -52,6 +48,7 @@ before call db1.p1()
after call db1.p1()
[on slave]
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_POS;
+include/wait_for_slave_sql_to_stop.inc
#
# If we got non-zero here, then we're suffering BUG#43263
#
@@ -92,6 +89,7 @@ executed db1.p2()
after call db1.p2()
[on slave]
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_POS;
+include/wait_for_slave_sql_to_stop.inc
#
# If we got non-zero here, then we're suffering BUG#43263
#
@@ -110,6 +108,7 @@ s
before call db1.p1()
executed db1.p2()
START SLAVE;
+include/wait_for_slave_sql_to_start.inc
#
# SAVEPOINT and ROLLBACK TO have the same problem in BUG#43263
# This was reported by BUG#50407
@@ -178,3 +177,4 @@ a
#
DROP DATABASE db1;
DROP DATABASE db2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_auto_inc_bug33029.result b/mysql-test/suite/rpl/r/rpl_binlog_auto_inc_bug33029.result
deleted file mode 100644
index f0fdd5eaa1f..00000000000
--- a/mysql-test/suite/rpl/r/rpl_binlog_auto_inc_bug33029.result
+++ /dev/null
@@ -1,37 +0,0 @@
-Setting up fake replication from MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001
-start slave sql_thread;
-select MASTER_POS_WAIT('master-bin.000001', 3776);
-# Result on slave
-SELECT * FROM t1;
-id
-5
-6
-7
-8
-9
-10
-11
-SELECT * FROM t2;
-id
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-DROP TABLE IF EXISTS t1, t2;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS p2;
-DROP FUNCTION IF EXISTS f1;
-DROP TRIGGER IF EXISTS tr1;
-stop slave sql_thread;
-Cleaning up after setup_fake_relay_log.inc
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
index f94d2833603..a2a065e0a4f 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
@@ -1,8 +1,16 @@
+include/master-slave.inc
+[connection master]
call mtr.add_suppression('Found invalid event in binary log');
+call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594');
==== Initialize ====
+include/stop_slave.inc
+RESET SLAVE;
+include/setup_fake_relay_log.inc
Setting up fake replication from MYSQL_TEST_DIR/std_data/bug40482-bin.000001
==== Test ====
START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error.inc [errno=1594]
Last_SQL_Error = 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 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
==== Clean up ====
-Cleaning up after setup_fake_relay_log.inc
+include/cleanup_fake_relay_log.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_errors.result b/mysql-test/suite/rpl/r/rpl_binlog_errors.result
new file mode 100644
index 00000000000..be1b3b150bc
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_binlog_errors.result
@@ -0,0 +1,278 @@
+include/master-slave.inc
+[connection master]
+#######################################################################
+####################### PART 1: MASTER TESTS ##########################
+#######################################################################
+include/stop_slave.inc
+call mtr.add_suppression("Can't generate a unique log-filename");
+call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+call mtr.add_suppression("Error writing file .*");
+SET @old_debug= @@global.debug;
+SELECT repeat('x',8192) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data';
+SELECT repeat('x',10) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data';
+RESET MASTER;
+###################### TEST #1
+FLUSH LOGS;
+# assert: must show two binlogs
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+###################### TEST #2
+RESET MASTER;
+SET GLOBAL debug="+d,error_unique_log_filename";
+FLUSH LOGS;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# assert: must show one binlog
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+SET GLOBAL debug="";
+RESET MASTER;
+###################### TEST #3
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB;
+CREATE TABLE t4 (a VARCHAR(16384));
+INSERT INTO t1 VALUES (1);
+RESET MASTER;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
+# assert: must show two binlog
+show binary logs;
+Log_name File_size
+master-bin.000001 #
+master-bin.000002 #
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+###################### TEST #4
+SET GLOBAL debug="+d,error_unique_log_filename";
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# assert: must show one entry
+SELECT count(*) FROM t2;
+count(*)
+1
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+###################### TEST #5
+SET GLOBAL debug="+d,error_unique_log_filename";
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data' INTO TABLE t2;
+# assert: must show one entry
+SELECT count(*) FROM t2;
+count(*)
+1
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+###################### TEST #6
+SET GLOBAL debug="+d,error_unique_log_filename";
+SET AUTOCOMMIT=0;
+INSERT INTO t2 VALUES ('muse');
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
+INSERT INTO t2 VALUES ('muse');
+COMMIT;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# assert: must show three entries
+SELECT count(*) FROM t2;
+count(*)
+3
+SET AUTOCOMMIT= 1;
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+###################### TEST #7
+SET GLOBAL debug="+d,error_unique_log_filename";
+SELECT count(*) FROM t4;
+count(*)
+0
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# assert: must show 1 entry
+SELECT count(*) FROM t4;
+count(*)
+1
+### check that the incident event is written to the current log
+SET GLOBAL debug="-d,error_unique_log_filename";
+FLUSH LOGS;
+SHOW BINLOG EVENTS IN 'BINLOG_FILE' FROM <binlog_start> LIMIT 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+BINLOG_FILE # Incident # # #1 (LOST_EVENTS)
+DELETE FROM t4;
+RESET MASTER;
+###################### TEST #8
+SET GLOBAL debug="+d,error_unique_log_filename";
+# must show 0 entries
+SELECT count(*) FROM t4;
+count(*)
+0
+SELECT count(*) FROM t2;
+count(*)
+0
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc');
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# INFO: Count(*) Before Offending DELETEs
+# assert: must show 1 entry
+SELECT count(*) FROM t4;
+count(*)
+1
+# assert: must show 4 entries
+SELECT count(*) FROM t2;
+count(*)
+4
+DELETE FROM t4;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+DELETE FROM t2;
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
+
+# INFO: Count(*) After Offending DELETEs
+# assert: must show zero entries
+SELECT count(*) FROM t4;
+count(*)
+0
+SELECT count(*) FROM t2;
+count(*)
+0
+SET GLOBAL debug="-d,error_unique_log_filename";
+###################### TEST #9
+SET GLOBAL debug="+d,error_unique_log_filename";
+SET SQL_LOG_BIN=0;
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
+INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
+# assert: must show four entries
+SELECT count(*) FROM t2;
+count(*)
+4
+SELECT count(*) FROM t4;
+count(*)
+4
+DELETE FROM t2;
+DELETE FROM t4;
+# assert: must show zero entries
+SELECT count(*) FROM t2;
+count(*)
+0
+SELECT count(*) FROM t4;
+count(*)
+0
+SET SQL_LOG_BIN=1;
+SET GLOBAL debug="-d,error_unique_log_filename";
+###################### TEST #10
+call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Could not open .*");
+RESET MASTER;
+SHOW WARNINGS;
+Level Code Message
+SET GLOBAL debug="+d,fault_injection_registering_index";
+FLUSH LOGS;
+ERROR HY000: Can't open file: 'master-bin.000002' (errno: 1)
+SET GLOBAL debug="-d,fault_injection_registering_index";
+SHOW BINARY LOGS;
+ERROR HY000: You are not using binary logging
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+###################### TEST #11
+include/rpl_restart_server.inc [server_number=1]
+SET GLOBAL debug="+d,fault_injection_openning_index";
+FLUSH LOGS;
+ERROR HY000: Can't open file: 'master-bin.index' (errno: 1)
+SET GLOBAL debug="-d,fault_injection_openning_index";
+RESET MASTER;
+ERROR HY000: Binlog closed, cannot RESET MASTER
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+include/rpl_restart_server.inc [server_number=1]
+###################### TEST #12
+SET GLOBAL debug="+d,fault_injection_new_file_rotate_event";
+FLUSH LOGS;
+ERROR HY000: Can't open file: 'master-bin' (errno: 2)
+SET GLOBAL debug="-d,fault_injection_new_file_rotate_event";
+RESET MASTER;
+ERROR HY000: Binlog closed, cannot RESET MASTER
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+include/rpl_restart_server.inc [server_number=1]
+SET GLOBAL debug= @old_debug;
+DROP TABLE t1, t2, t4;
+RESET MASTER;
+include/start_slave.inc
+#######################################################################
+####################### PART 2: SLAVE TESTS ###########################
+#######################################################################
+include/rpl_reset.inc
+call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
+call mtr.add_suppression("Error writing file .*");
+call mtr.add_suppression("Could not open .*");
+call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Can't generate a unique log-filename .*");
+###################### TEST #13
+SET @old_debug=@@global.debug;
+include/stop_slave.inc
+SET GLOBAL debug="+d,error_unique_log_filename";
+START SLAVE io_thread;
+include/wait_for_slave_io_error.inc [errno=1595]
+Last_IO_Error = 'Relay log write failure: could not queue event from master'
+SET GLOBAL debug="-d,error_unique_log_filename";
+SET GLOBAL debug=@old_debug;
+include/rpl_restart_server.inc [server_number=2]
+###################### TEST #14
+SET @old_debug=@@global.debug;
+include/stop_slave.inc
+SET GLOBAL debug="+d,fault_injection_new_file_rotate_event";
+START SLAVE io_thread;
+include/wait_for_slave_io_error.inc [errno=1595]
+Last_IO_Error = 'Relay log write failure: could not queue event from master'
+SET GLOBAL debug="-d,fault_injection_new_file_rotate_event";
+SET GLOBAL debug=@old_debug;
+include/rpl_restart_server.inc [server_number=2]
+###################### TEST #15
+SET @old_debug=@@global.debug;
+include/stop_slave.inc
+SET GLOBAL debug="+d,fault_injection_registering_index";
+START SLAVE io_thread;
+include/wait_for_slave_io_error.inc [errno=1595]
+Last_IO_Error = 'Relay log write failure: could not queue event from master'
+SET GLOBAL debug="-d,fault_injection_registering_index";
+SET GLOBAL debug=@old_debug;
+include/rpl_restart_server.inc [server_number=2]
+###################### TEST #16
+SET @old_debug=@@global.debug;
+include/stop_slave.inc
+SET GLOBAL debug="+d,fault_injection_openning_index";
+START SLAVE io_thread;
+include/wait_for_slave_io_error.inc [errno=1595]
+Last_IO_Error = 'Relay log write failure: could not queue event from master'
+SET GLOBAL debug="-d,fault_injection_openning_index";
+SET GLOBAL debug=@old_debug;
+include/rpl_restart_server.inc [server_number=2]
+include/stop_slave_sql.inc
+Warnings:
+Note 1255 Slave already has been stopped
+SET GLOBAL debug=@old_debug;
+RESET SLAVE;
+RESET MASTER;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_grant.result b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
index 7a2e3183d5b..ccc7116a949 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_grant.result
@@ -1,10 +1,5 @@
-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 d1;
+include/master-slave.inc
+[connection master]
create database d1;
use d1;
create table t (s1 int) engine=innodb;
@@ -30,3 +25,4 @@ Grants for x@y
GRANT USAGE ON *.* TO 'x'@'y'
drop user x@y;
drop database d1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bit.result b/mysql-test/suite/rpl/r/rpl_bit.result
index 924de8a65f8..fa935cd9e56 100644
--- a/mysql-test/suite/rpl/r/rpl_bit.result
+++ b/mysql-test/suite/rpl/r/rpl_bit.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (
dummyKey INTEGER NOT NULL,
@@ -136,3 +132,4 @@ hex(bit3)
24
35
DROP TABLE IF EXISTS test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bit_npk.result b/mysql-test/suite/rpl/r/rpl_bit_npk.result
index 9599660f18f..13c9985614e 100644
--- a/mysql-test/suite/rpl/r/rpl_bit_npk.result
+++ b/mysql-test/suite/rpl/r/rpl_bit_npk.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (
dummyKey INTEGER NOT NULL,
@@ -167,3 +163,4 @@ a b
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_blackhole.result b/mysql-test/suite/rpl/r/rpl_blackhole.result
index b28261bef9b..1fb8dd6d125 100644
--- a/mysql-test/suite/rpl/r/rpl_blackhole.result
+++ b/mysql-test/suite/rpl/r/rpl_blackhole.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE t1 (a INT, b INT, c INT);
CREATE TABLE t2 (a INT, b INT, c INT);
@@ -91,4 +87,5 @@ SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
-drop table t1,t2;
+DROP TABLE t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug26395.result b/mysql-test/suite/rpl/r/rpl_bug26395.result
index c6dd2d01ed3..a3725f34a55 100644
--- a/mysql-test/suite/rpl/r/rpl_bug26395.result
+++ b/mysql-test/suite/rpl/r/rpl_bug26395.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==== Initialize ====
[on master]
CREATE TABLE tinnodb (a INT) ENGINE = INNODB;
@@ -20,6 +16,7 @@ SELECT * FROM tinnodb ORDER BY a;
a
1
[on slave]
+include/sync_slave_io_with_master.inc
==== Verify results on slave ====
include/stop_slave.inc
SELECT "" AS Slave_IO_State;
@@ -39,3 +36,4 @@ DROP TABLE tinnodb;
set @@debug= @old_debug;
[on slave]
DROP TABLE tinnodb;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug31076.result b/mysql-test/suite/rpl/r/rpl_bug31076.result
index 76bce39fc43..1cf8b87f68d 100644
--- a/mysql-test/suite/rpl/r/rpl_bug31076.result
+++ b/mysql-test/suite/rpl/r/rpl_bug31076.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
SET @saved_slave_type_conversions = @@slave_type_conversions;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
CREATE DATABASE track;
@@ -70,3 +66,4 @@ event_id visit_id timestamp src data visits_events_id
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
DROP DATABASE track;
End of 5.1 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug33931.result b/mysql-test/suite/rpl/r/rpl_bug33931.result
index a7f398f4546..ce8b6b169c7 100644
--- a/mysql-test/suite/rpl/r/rpl_bug33931.result
+++ b/mysql-test/suite/rpl/r/rpl_bug33931.result
@@ -1,7 +1,13 @@
-reset master;
-reset slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Failed during slave I/O thread initialization");
+call mtr.add_suppression("Slave SQL.*Failed during slave thread initialization.* 1593");
+include/stop_slave.inc
+reset slave;
SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
-Last_SQL_Error = Failed during slave thread initialization
+include/wait_for_slave_sql_error.inc [errno=1593]
+Last_SQL_Error = 'Failed during slave thread initialization'
SET GLOBAL debug="";
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug37426.result b/mysql-test/suite/rpl/r/rpl_bug37426.result
new file mode 100644
index 00000000000..bf96255c7b4
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_bug37426.result
@@ -0,0 +1,12 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE char128_utf8 (i1 INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, i2 INT NOT NULL);
+INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
+SELECT * FROM char128_utf8;
+i1 c i2
+1 123 1
+SELECT * FROM char128_utf8;
+i1 c i2
+1 123 1
+DROP TABLE char128_utf8;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug38694.result b/mysql-test/suite/rpl/r/rpl_bug38694.result
index 711c4a91c03..b666d9a9155 100644
--- a/mysql-test/suite/rpl/r/rpl_bug38694.result
+++ b/mysql-test/suite/rpl/r/rpl_bug38694.result
@@ -1,6 +1,3 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug41902.result b/mysql-test/suite/rpl/r/rpl_bug41902.result
index c65773708cc..5331d4334fa 100644
--- a/mysql-test/suite/rpl/r/rpl_bug41902.result
+++ b/mysql-test/suite/rpl/r/rpl_bug41902.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
stop slave;
SET @@debug="d,simulate_find_log_pos_error";
reset slave;
@@ -31,4 +27,6 @@ purge binary logs to 'master-bin.000001';
ERROR HY000: Target log not found in binlog index
SET @@debug="";
purge binary logs to 'master-bin.000001';
-End of the tests
+==== clean up ====
+CHANGE MASTER TO MASTER_HOST = '127.0.0.1';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_change_master.result b/mysql-test/suite/rpl/r/rpl_change_master.result
index af09bed8dce..6674ab168ef 100644
--- a/mysql-test/suite/rpl/r/rpl_change_master.result
+++ b/mysql-test/suite/rpl/r/rpl_change_master.result
@@ -1,15 +1,12 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1(n int);
select * from t1;
n
stop slave sql_thread;
insert into t1 values(1);
insert into t1 values(2);
+include/wait_for_slave_param.inc [Read_Master_Log_Pos]
include/stop_slave.inc
change master to master_user='root';
start slave;
@@ -18,20 +15,4 @@ n
1
2
drop table t1;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-create table t1 (a int);
-insert into t1 values (1);
-flush logs;
-insert into t1 values (2);
-include/stop_slave.inc
-delete from t1 where a=2;
-CHANGE MASTER TO relay_log_file='slave-relay-bin.000005', relay_log_pos=4;
-start slave sql_thread;
-start slave io_thread;
-set global relay_log_purge=1;
-drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_charset.result b/mysql-test/suite/rpl/r/rpl_charset.result
index a4841b0baf3..5b025445050 100644
--- a/mysql-test/suite/rpl/r/rpl_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_charset.result
@@ -1,12 +1,6 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
set timestamp=1000000000;
-drop database if exists mysqltest2;
-drop database if exists mysqltest3;
create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
create database mysqltest3;
@@ -141,3 +135,4 @@ primary key (`pk`)
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_charset_sjis.result b/mysql-test/suite/rpl/r/rpl_charset_sjis.result
index 770ad0588d1..b31bad28a59 100644
--- a/mysql-test/suite/rpl/r/rpl_charset_sjis.result
+++ b/mysql-test/suite/rpl/r/rpl_charset_sjis.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop table if exists t1;
drop procedure if exists p1;
create table t1 (a varchar(255) character set sjis);
@@ -24,3 +20,4 @@ hex(a)
965C
drop table t1;
drop procedure p1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
index c3ccc76d1bc..f9c5b48e227 100644
--- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
+++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
@@ -1,60 +1,11 @@
-*** Set up circular ring by schema A->B->C->D->A ***
-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 SLAVE;
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-SET auto_increment_increment = 4;
-SET auto_increment_offset = 1;
-RESET MASTER;
-RESET SLAVE;
-CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_A_PORT,master_user='root',MASTER_LOG_FILE='MASTER_A_LOG_FILE';
-SET auto_increment_increment = 4;
-SET auto_increment_offset = 2;
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_B_PORT,master_user='root',MASTER_LOG_FILE='MASTER_B_LOG_FILE';
-SET auto_increment_increment = 4;
-SET auto_increment_offset = 3;
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_C_PORT,master_user='root',MASTER_LOG_FILE='MASTER_C_LOG_FILE';
-SET auto_increment_increment = 4;
-SET auto_increment_offset = 4;
-CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_D_PORT,master_user='root',MASTER_LOG_FILE='MASTER_D_LOG_FILE';
-SHOW VARIABLES LIKE 'auto_increment_%';
-Variable_name Value
-auto_increment_increment 4
-auto_increment_offset 1
-SHOW VARIABLES LIKE 'auto_increment_%';
-Variable_name Value
-auto_increment_increment 4
-auto_increment_offset 2
-SHOW VARIABLES LIKE 'auto_increment_%';
-Variable_name Value
-auto_increment_increment 4
-auto_increment_offset 3
-SHOW VARIABLES LIKE 'auto_increment_%';
-Variable_name Value
-auto_increment_increment 4
-auto_increment_offset 4
-1
-START SLAVE;
-START SLAVE;
-START SLAVE;
-START SLAVE;
+*** Set up circular replication on four servers ***
+include/rpl_init.inc [topology=1->2->3->4->1]
*** Preparing data ***
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=MyISAM;
CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB;
+include/rpl_sync.inc
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
*** Testing schema A->B->C->D->A ***
@@ -62,6 +13,7 @@ INSERT INTO t1(b,c) VALUES('A',1);
INSERT INTO t1(b,c) VALUES('B',1);
INSERT INTO t1(b,c) VALUES('C',1);
INSERT INTO t1(b,c) VALUES('D',1);
+include/rpl_sync.inc
SELECT 'Master A',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
Master A a b
Master A 1 A
@@ -95,6 +47,8 @@ SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
include/start_slave.inc
INSERT INTO t1 VALUES(6,'C',2);
INSERT INTO t1(b,c) VALUES('B',2);
+call mtr.add_suppression("Slave SQL.*Duplicate entry .6. for key .PRIMARY.* Error_code: 1062");
+include/wait_for_slave_sql_error.inc [errno=1062]
INSERT INTO t1(b,c) VALUES('A',2);
INSERT INTO t1(b,c) VALUES('D',2);
@@ -116,9 +70,9 @@ Master D a b
Master D 8 D
* Reconfigure replication to schema A->B->D->A *
-STOP SLAVE;
-STOP SLAVE;
-CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_B_PORT,master_user='root',master_log_file='LOG_FILE',master_log_pos=LOG_POS;
+include/stop_slave_io.inc
+include/stop_slave.inc
+include/rpl_change_topology.inc [new topology=1->2->4->1,2->3]
include/start_slave.inc
* Check data inserted before failure *
@@ -145,6 +99,7 @@ Master D 8 D
INSERT INTO t1(b,c) VALUES('A',3);
INSERT INTO t1(b,c) VALUES('B',3);
INSERT INTO t1(b,c) VALUES('D',3);
+include/rpl_sync.inc
SELECT 'Master A',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
Master A a b
Master A 9 A
@@ -168,11 +123,12 @@ Master D 12 D
* Remove wrong event from C and restore B->C->D *
include/stop_slave.inc
DELETE FROM t1 WHERE a = 6;
-START SLAVE;
+include/start_slave.inc
RESET MASTER;
RESET SLAVE;
-CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_C_PORT,master_user='root',master_log_file='LOG_FILE',master_log_pos=LOG_POS;
-START SLAVE;
+include/rpl_change_topology.inc [new topology=1->2->3->4->1]
+include/start_slave.inc
+include/rpl_sync.inc
* Check data inserted before restoring schema A->B->C->D->A *
SELECT 'Master A',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
@@ -213,6 +169,7 @@ INSERT INTO t1(b,c) VALUES('A',4);
INSERT INTO t1(b,c) VALUES('B',4);
INSERT INTO t1(b,c) VALUES('C',4);
INSERT INTO t1(b,c) VALUES('D',4);
+include/rpl_sync.inc
SELECT 'Master A',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
Master A a b
Master A 13 A
@@ -241,6 +198,7 @@ Master D 16 D
* Transactions with commits *
BEGIN;
BEGIN;
+include/rpl_sync.inc
SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
Master A b COUNT(*)
Master A A 100
@@ -269,6 +227,7 @@ Master D D 100
* Transactions with rollbacks *
BEGIN;
BEGIN;
+include/rpl_sync.inc
SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
Master A b COUNT(*)
Master A B 100
@@ -288,11 +247,4 @@ Master D D 100
*** Clean up ***
DROP TABLE t1,t2;
-STOP SLAVE;
-RESET SLAVE;
-STOP SLAVE;
-RESET SLAVE;
-STOP SLAVE;
-RESET SLAVE;
-STOP SLAVE;
-RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_colSize.result b/mysql-test/suite/rpl/r/rpl_colSize.result
index ae1ac3c7fed..0f701e32d9b 100644
--- a/mysql-test/suite/rpl/r/rpl_colSize.result
+++ b/mysql-test/suite/rpl/r/rpl_colSize.result
@@ -1,13 +1,10 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t1;
**** Testing WL#3228 changes. ****
*** Create "wider" table on slave ***
STOP SLAVE;
+include/wait_for_slave_to_stop.inc
RESET SLAVE;
SET @saved_slave_type_conversions = @@slave_type_conversions;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
@@ -57,6 +54,7 @@ t LONGTEXT
RESET MASTER;
*** Start replication ***
START SLAVE;
+include/wait_for_slave_to_start.inc
*** Insert data on master and display it. ***
INSERT INTO t1 () VALUES (
17.567,
@@ -180,3 +178,4 @@ t1 CREATE TABLE `t1` (
*** Cleanup ***
DROP TABLE t1;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_commit_after_flush.result b/mysql-test/suite/rpl/r/rpl_commit_after_flush.result
index eaddda63b6a..b91b273e64e 100644
--- a/mysql-test/suite/rpl/r/rpl_commit_after_flush.result
+++ b/mysql-test/suite/rpl/r/rpl_commit_after_flush.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (a INT) ENGINE=innodb;
begin;
insert into t1 values(1);
@@ -11,3 +7,4 @@ flush tables with read lock;
commit;
unlock tables;
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_concurrency_error.result b/mysql-test/suite/rpl/r/rpl_concurrency_error.result
index eb303c46f28..b6ed9db6c66 100644
--- a/mysql-test/suite/rpl/r/rpl_concurrency_error.result
+++ b/mysql-test/suite/rpl/r/rpl_concurrency_error.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
########################################################################
# Environment
@@ -118,11 +114,12 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'dark blue 1' WHERE f = 'red'
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (6 + (1 * 10),"brown")
master-bin.000001 # Xid # # COMMIT /* XID */
-source include/diff_master_slave.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
+include/rpl_diff.inc
########################################################################
# Cleanup
########################################################################
DROP TRIGGER tr;
DROP TABLE t;
DROP TABLE n;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_conditional_comments.result b/mysql-test/suite/rpl/r/rpl_conditional_comments.result
index 0a2f4d60e6f..fca7d941718 100644
--- a/mysql-test/suite/rpl/r/rpl_conditional_comments.result
+++ b/mysql-test/suite/rpl/r/rpl_conditional_comments.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1(c1 INT);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
@@ -19,7 +15,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; /* 99999 --- */INSERT /*!INTO*/ /*!10000 t1 */ VALUES(10) /* 99999 ,(11)*/
master-bin.000001 # Query # # COMMIT
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
# Case 2:
# -----------------------------------------------------------------
@@ -30,7 +26,7 @@ EXECUTE stmt;
DROP TABLE t1;
CREATE TABLE t1(c1 INT);
EXECUTE stmt;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
SET @value=62;
PREPARE stmt FROM 'INSERT INTO /*!99999 blabla */ t1 VALUES(?) /*!99999 ,(63)*/';
@@ -56,7 +52,7 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE t1(c1 INT)
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO /* 99999 blabla */ t1 VALUES(62) /* 99999 ,(63)*/
master-bin.000001 # Query # # COMMIT
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
# Case 3:
# -----------------------------------------------------------------
@@ -65,3 +61,4 @@ Comparing tables master:test.t1 and slave:test.t1
SELECT c1 FROM /*!99999 t1 WHEREN;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/*!99999 t1 WHEREN' at line 1
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_database.result b/mysql-test/suite/rpl/r/rpl_create_database.result
index 9780b65f334..6bb950483ed 100644
--- a/mysql-test/suite/rpl/r/rpl_create_database.result
+++ b/mysql-test/suite/rpl/r/rpl_create_database.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP DATABASE IF EXISTS mysqltest_prometheus;
DROP DATABASE IF EXISTS mysqltest_sisyfos;
DROP DATABASE IF EXISTS mysqltest_bob;
@@ -60,3 +56,4 @@ t2
DROP DATABASE IF EXISTS mysqltest_prometheus;
DROP DATABASE IF EXISTS mysqltest_sisyfos;
DROP DATABASE IF EXISTS mysqltest_bob;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result b/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result
index 0d3fc1b79a7..d12f3ff1360 100644
--- a/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result
+++ b/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP DATABASE IF EXISTS mysqltest;
CREATE DATABASE IF NOT EXISTS mysqltest;
USE mysqltest;
@@ -69,12 +65,7 @@ DROP TABLE t3;
# After the worklog, it will insert nothing and the statement will not be
# binlogged if the table already exists.
# After the worklog, some bugs will disappear automotically.
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
# Case 1: BUG#47132
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
@@ -126,3 +117,4 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
DROP VIEW v1;
DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result b/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result
index 7459a977cf8..6bafbb32897 100644
--- a/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result
+++ b/mysql-test/suite/rpl/r/rpl_create_tmp_table_if_not_exists.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP DATABASE IF EXISTS mysqltest;
CREATE TEMPORARY TABLE IF NOT EXISTS tmp(c1 int);
CREATE TEMPORARY TABLE IF NOT EXISTS tmp(c1 int);
@@ -19,3 +15,4 @@ master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS t
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS tmp1 LIKE tmp
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS tmp1 LIKE tmp
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_cross_version.result b/mysql-test/suite/rpl/r/rpl_cross_version.result
index de5dd134516..ddb97ffa8c5 100644
--- a/mysql-test/suite/rpl/r/rpl_cross_version.result
+++ b/mysql-test/suite/rpl/r/rpl_cross_version.result
@@ -1,12 +1,19 @@
+include/master-slave.inc
+[connection master]
==== Initialize ====
+include/stop_slave.inc
+RESET SLAVE;
+include/setup_fake_relay_log.inc
Setting up fake replication from MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001
==== Test ====
start slave sql_thread;
+include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
==== a prove that the fake has been processed successfully ====
SELECT COUNT(*) - 17920 as zero FROM t3;
zero
0
==== Clean up ====
-stop slave sql_thread;
-Cleaning up after setup_fake_relay_log.inc
+include/stop_slave_sql.inc
+include/cleanup_fake_relay_log.inc
drop table t1, t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_current_user.result b/mysql-test/suite/rpl/r/rpl_current_user.result
index 69c20078531..ecf8fc851d8 100644
--- a/mysql-test/suite/rpl/r/rpl_current_user.result
+++ b/mysql-test/suite/rpl/r/rpl_current_user.result
@@ -1,26 +1,6 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
-
-# On slave2
-# Connect slave2 to slave
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=SLAVE_MYPORT;,
-MASTER_LOG_FILE='slave-bin.000001', MASTER_USER='root';
-START SLAVE;
-
-# [On master]
-DROP VIEW IF EXISTS v_user;
-DROP VIEW IF EXISTS v_tables_priv;
-DROP VIEW IF EXISTS v_procs_priv;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS my_grant;
-DROP PROCEDURE IF EXISTS my_revoke;
-DROP FUNCTION IF EXISTS my_user;
-DROP EVENT IF EXISTS e1;
+include/rpl_init.inc [topology=1->2->3]
+include/rpl_connect.inc [creating master]
+include/rpl_connect.inc [creating slave]
CREATE TABLE t1(c1 char(100));
CREATE VIEW test.v_user AS SELECT * FROM mysql.user WHERE User LIKE 'bug48321%';
CREATE VIEW test.v_tables_priv AS SELECT * FROM mysql.tables_priv WHERE User LIKE 'bug48321%';
@@ -42,76 +22,76 @@ ERROR HY000: String '01234567890123456789012345678901234567890123456789012345678
# [On conn1]
# Verify 'REVOKE ALL' statement
REVOKE ALL PRIVILEGES, GRANT OPTION FROM CURRENT_USER();
-Comparing tables master:test.v_user and slave:test.v_user
-Comparing tables master:test.v_user and slave2:test.v_user
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_user, server_2:v_user, server_3:v_user]
# Verify 'GRANT ... ON TABLE ...' statement
GRANT CREATE, INSERT, SELECT ON TABLE test.t1 TO CURRENT_USER();
-Comparing tables master:test.v_tables_priv and slave:test.v_tables_priv
-Comparing tables master:test.v_tables_priv and slave2:test.v_tables_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv]
# Verify 'GRANT ... ON PROCEDURE...' statement
GRANT ALTER ROUTINE, EXECUTE ON PROCEDURE p1 TO CURRENT_USER();
-Comparing tables master:test.v_procs_priv and slave:test.v_procs_priv
-Comparing tables master:test.v_procs_priv and slave2:test.v_procs_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_procs_priv, server_2:v_procs_priv, server_3:v_procs_priv]
# Verify 'GRANT ... ON *.* ...' statement
GRANT ALL PRIVILEGES ON *.* TO CURRENT_USER() WITH GRANT OPTION;
-Comparing tables master:test.v_procs_priv and slave:test.v_procs_priv
-Comparing tables master:test.v_procs_priv and slave2:test.v_procs_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_procs_priv, server_2:v_procs_priv, server_3:v_procs_priv]
# Verify 'REVOKE ... ON TABLE ...' statement
REVOKE CREATE, INSERT, SELECT ON TABLE t1 FROM CURRENT_USER();
-Comparing tables master:test.v_tables_priv and slave:test.v_tables_priv
-Comparing tables master:test.v_tables_priv and slave2:test.v_tables_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv]
# Verify 'REVOKE ... ON PROCEDURE...' statement
REVOKE ALTER ROUTINE, EXECUTE ON PROCEDURE p1 FROM CURRENT_USER();
-Comparing tables master:test.v_procs_priv and slave:test.v_procs_priv
-Comparing tables master:test.v_procs_priv and slave2:test.v_procs_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_procs_priv, server_2:v_procs_priv, server_3:v_procs_priv]
# Verify 'REVOKE ... ON *.* ...' statement
REVOKE ALL PRIVILEGES ON *.* FROM CURRENT_USER();
-Comparing tables master:test.v_user and slave:test.v_user
-Comparing tables master:test.v_user and slave2:test.v_user
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_user, server_2:v_user, server_3:v_user]
# Verify 'GRANT ...' statement in the procedure
CREATE PROCEDURE my_grant()
GRANT CREATE, INSERT, SELECT ON TABLE test.t1 TO CURRENT_USER();
call my_grant;
-Comparing tables master:test.v_tables_priv and slave:test.v_tables_priv
-Comparing tables master:test.v_tables_priv and slave2:test.v_tables_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv]
# Verify 'REVOKE ... ON TABLE ...' statement in the procedure
CREATE PROCEDURE my_revoke()
REVOKE CREATE, INSERT, SELECT ON TABLE t1 FROM CURRENT_USER();
call my_revoke;
-Comparing tables master:test.v_tables_priv and slave:test.v_tables_priv
-Comparing tables master:test.v_tables_priv and slave2:test.v_tables_priv
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv]
# Verify 'RENAME USER ...' statement
RENAME USER CURRENT_USER TO 'bug48321_2'@'localhost';
-Comparing tables master:test.v_user and slave:test.v_user
-Comparing tables master:test.v_user and slave2:test.v_user
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_user, server_2:v_user, server_3:v_user]
# Verify 'DROP USER ...' statement
GRANT CREATE USER ON *.* TO 'bug48321_2'@'localhost';
DROP USER CURRENT_USER();
-Comparing tables master:test.v_user and slave:test.v_user
-Comparing tables master:test.v_user and slave2:test.v_user
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_user, server_2:v_user, server_3:v_user]
# Verify 'ALTER EVENT...' statement
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT * FROM t1;
# Explicitly assign CURRENT_USER() to definer
ALTER DEFINER=CURRENT_USER() EVENT e1 ENABLE;
-Comparing tables master:test.v_event and slave:test.v_event
-Comparing tables master:test.v_event and slave2:test.v_event
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_event, server_2:v_event, server_3:v_event]
# Session user will be set as definer, if the statement does not assign
# a definer
ALTER EVENT e1 ENABLE;
-Comparing tables master:test.v_event and slave:test.v_event
-Comparing tables master:test.v_event and slave2:test.v_event
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:v_event, server_2:v_event, server_3:v_event]
# Verify that this patch does not affect the calling of CURRENT_USER()
# in the other statements
@@ -128,7 +108,7 @@ SELECT * FROM t1;
c1
@
1234
-# [On slave2]
+# [On server_3]
SELECT * FROM t1;
c1
@
@@ -146,7 +126,7 @@ SELECT * FROM t1;
c1
@
@
-# [On slave2]
+# [On server_3]
SELECT * FROM t1;
c1
@
@@ -160,7 +140,7 @@ c1
# [On slave]
SELECT * FROM t1;
c1
-# [On slave2]
+# [On server_3]
SELECT * FROM t1;
c1
# [On master]
@@ -187,7 +167,7 @@ c1
SELECT * FROM t2;
c1
@
-# [On slave2]
+# [On server_3]
SELECT * FROM t1;
c1
@
@@ -203,3 +183,4 @@ DROP PROCEDURE my_grant;
DROP PROCEDURE my_revoke;
DROP FUNCTION my_user;
DROP EVENT e1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
index 1485389204b..c399b408d5c 100644
--- a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
*** Prepare tables and data ***
CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
CREATE TABLE t2 (a INT) ENGINE=innodb;
@@ -50,7 +46,7 @@ a
SELECT * FROM t3;
a
3
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
*** Test lock wait timeout ***
include/stop_slave.inc
@@ -61,6 +57,7 @@ SELECT * FROM t1 FOR UPDATE;
a
1
START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1205]
SELECT COUNT(*) FROM t2;
COUNT(*)
0
@@ -74,7 +71,7 @@ SELECT * FROM t3;
a
3
3
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
*** Test lock wait timeout and purged relay logs ***
SET @my_max_relay_log_size= @@global.max_relay_log_size;
@@ -88,6 +85,7 @@ a
1
1
START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1205]
SELECT COUNT(*) FROM t2;
COUNT(*)
0
@@ -103,9 +101,10 @@ a
3
3
3
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
*** Clean up ***
DROP TABLE t1,t2,t3;
SET global max_relay_log_size= @my_max_relay_log_size;
End of 5.1 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_delete_no_where.result b/mysql-test/suite/rpl/r/rpl_delete_no_where.result
index 78edf4bf3fa..923cd428aec 100644
--- a/mysql-test/suite/rpl/r/rpl_delete_no_where.result
+++ b/mysql-test/suite/rpl/r/rpl_delete_no_where.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1 (a int, b int) engine=myisam;
insert into t1 values(1,1);
select * from t1;
@@ -13,3 +9,4 @@ delete from t1;
select * from t1;
a b
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result
index 45c5bcf7ba0..772ffd1db20 100644
--- a/mysql-test/suite/rpl/r/rpl_do_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_do_grant.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
@@ -166,22 +162,13 @@ USE test;
DROP FUNCTION bug42217_db.upgrade_del_func;
DROP FUNCTION bug42217_db.upgrade_alter_func;
DROP DATABASE bug42217_db;
-stop slave;
+SET SQL_LOG_BIN= 0;
DROP USER 'create_rout_db'@'localhost';
-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 SQL_LOG_BIN= 1;
+include/rpl_reset.inc
+USE test;
######## BUG#49119 #######
### i) test case from the 'how to repeat section'
-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 INT);
CREATE PROCEDURE p1() SELECT * FROM t1 |
REVOKE EXECUTE ON PROCEDURE p1 FROM 'root'@'localhost';
@@ -189,12 +176,7 @@ ERROR 42000: There is no such grant defined for user 'root' on host 'localhost'
DROP TABLE t1;
DROP PROCEDURE p1;
### ii) Test case in which REVOKE partially succeeds
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t1(c1 INT);
CREATE PROCEDURE p1() SELECT * FROM t1 |
CREATE USER 'user49119'@'localhost';
@@ -208,6 +190,7 @@ GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user49119'@'localhost'
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
##############################################################
### Showing grants for both users: root and user49119 (master)
@@ -218,6 +201,7 @@ GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user49119'@'localhost'
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
## This statement will make the revoke fail because root has no
## execute grant. However, it will still revoke the grant for
@@ -233,6 +217,7 @@ GRANT USAGE ON *.* TO 'user49119'@'localhost'
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
#############################################################
### Showing grants for both users: root and user49119 (slave)
@@ -243,16 +228,12 @@ GRANT USAGE ON *.* TO 'user49119'@'localhost'
SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
DROP TABLE t1;
DROP PROCEDURE p1;
DROP USER 'user49119'@'localhost';
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
grant all on *.* to foo@"1.2.3.4";
revoke all privileges, grant option from "foo";
ERROR HY000: Can't revoke all privileges for one or more of the requested users
@@ -260,5 +241,24 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; grant all on *.* to foo@"1.2.3.4"
master-bin.000001 # Query # # use `test`; revoke all privileges, grant option from "foo"
+include/check_slave_no_error.inc
DROP USER foo@"1.2.3.4";
-"End of test"
+
+# Bug#27606 GRANT statement should be replicated with DEFINER information
+include/rpl_reset.inc
+GRANT SELECT, INSERT ON mysql.user TO user_bug27606@localhost;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+Grantor
+root@localhost
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+Grantor
+root@localhost
+REVOKE SELECT ON mysql.user FROM user_bug27606@localhost;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+Grantor
+root@localhost
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+Grantor
+root@localhost
+DROP USER user_bug27606@localhost;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop.result b/mysql-test/suite/rpl/r/rpl_drop.result
index b83594c9bb1..bdba42e1d34 100644
--- a/mysql-test/suite/rpl/r/rpl_drop.result
+++ b/mysql-test/suite/rpl/r/rpl_drop.result
@@ -1,10 +1,6 @@
-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;
+include/master-slave.inc
+[connection master]
create table t1 (a int);
drop table t1, t2;
ERROR 42S02: Unknown table 't2'
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop_db.result b/mysql-test/suite/rpl/r/rpl_drop_db.result
index 8825797f80d..8a88f01a444 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_db.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_db.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
create database mysqltest1;
create table mysqltest1.t1 (n int);
@@ -34,4 +30,4 @@ n
use test;
drop table t1;
drop database mysqltest1;
-include/stop_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop_temp.result b/mysql-test/suite/rpl/r/rpl_drop_temp.result
index 726b8f2fe54..ffabd514b0f 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_temp.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_temp.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create database if not exists mysqltest;
use mysqltest;
create temporary table mysqltest.t1 (n int)ENGINE=MyISAM;
@@ -26,12 +22,7 @@ CREATE TEMPORARY TABLE tmp3 (a int);
DROP TEMPORARY TABLE tmp3;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t1 ( i INT );
SHOW STATUS LIKE 'Slave_open_temp_tables';
Variable_name Value
@@ -47,3 +38,4 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( i INT )
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE ttmp1 ( i INT )
master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1`
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop_view.result b/mysql-test/suite/rpl/r/rpl_drop_view.result
index c359011612a..0688ce42bc2 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_view.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_view.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop table if exists t1, t2;
drop view if exists v1, v2, v3, not_exist_view;
create table t1 (a int);
@@ -27,3 +23,4 @@ select * from v3;
ERROR 42S02: Table 'test.v3' doesn't exist
==== clean up ====
drop table t1, t2, t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result b/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
index aa1a573d052..3a3bed1a6fd 100644
--- a/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
+++ b/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
@@ -1,12 +1,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;
-reset master;
-change master to master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root";
-include/start_slave.inc
+include/rpl_init.inc [topology=1->2->1]
create table t1 (n int);
include/stop_slave.inc
create table t2 (n int);
@@ -25,6 +17,7 @@ insert into t3 values(4);
start slave until master_log_file="MASTER_LOG_FILE",master_log_pos=MASTER_LOG_POS;
Warnings:
Note 1278 It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart
+include/wait_for_slave_sql_to_stop.inc
show tables;
Tables_in_test
t1
@@ -32,12 +25,14 @@ t2
start slave until master_log_file="MASTER_LOG_FILE",master_log_pos=MASTER_LOG_POS;
Warnings:
Note 1278 It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart
+include/wait_for_slave_sql_to_stop.inc
select * from t3;
n
1
start slave until master_log_file="MASTER_LOG_FILE",master_log_pos=MASTER_LOG_POS;
Warnings:
Note 1278 It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart
+include/wait_for_slave_sql_to_stop.inc
select * from t3;
n
1
@@ -55,6 +50,5 @@ t3
t4
t5
t6
-include/stop_slave.inc
-reset slave;
-drop table t1,t2,t3,t4,t5,t6;
+drop table t1, t2, t3, t4, t5, t6;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_empty_master_host.result b/mysql-test/suite/rpl/r/rpl_empty_master_host.result
index 46ef32d415b..8b0b4ec30df 100644
--- a/mysql-test/suite/rpl/r/rpl_empty_master_host.result
+++ b/mysql-test/suite/rpl/r/rpl_empty_master_host.result
@@ -1,10 +1,7 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
STOP SLAVE;
+include/wait_for_slave_to_stop.inc
Master_Host = '127.0.0.1' (expected '127.0.0.1')
CHANGE MASTER TO MASTER_HOST="";
ERROR HY000: Incorrect arguments to MASTER_HOST
@@ -14,3 +11,5 @@ Master_Host = 'foo' (expected 'foo')
CHANGE MASTER TO MASTER_HOST="127.0.0.1";
Master_Host = '127.0.0.1' (expected '127.0.0.1')
START SLAVE;
+include/wait_for_slave_to_start.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result
index f211d5d9a2f..c2ec7eb4ba4 100644
--- a/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result
+++ b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1 (a int primary key);
create table t4 (a int primary key);
insert into t1 values (1),(1);
@@ -40,3 +36,4 @@ a
3
4
DROP TABLE test.t4;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result
index 7d4e8a208eb..23dcfab57f0 100644
--- a/mysql-test/suite/rpl/r/rpl_events.result
+++ b/mysql-test/suite/rpl/r/rpl_events.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
SET @old_event_scheduler = @@global.event_scheduler;
set global event_scheduler=1;
DROP EVENT IF EXISTS test.justonce;
@@ -167,3 +163,4 @@ DROP EVENT event44331_1;
DROP EVENT event44331_2;
DROP EVENT event44331_3;
DROP EVENT event44331_4;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
deleted file mode 100644
index 3f2256a65e0..00000000000
--- a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
+++ /dev/null
@@ -1,606 +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;
-call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
-**** Diff Table Def Start ****
-*** On Slave ***
-STOP SLAVE;
-RESET SLAVE;
-SET @saved_slave_type_conversions = @@slave_type_conversions;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
-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
-SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
-*** 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;
-Last_SQL_Error = Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)'
-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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** 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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** 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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** 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 1677 ***
-********************************************
-Last_SQL_Error = Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)'
-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;
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
-d TIMESTAMP,
-e INT NOT NULL,
-f text not null,
-g text,
-h blob not null,
-i blob) ENGINE='InnoDB';
-*** Create t9 on Master ***
-CREATE TABLE t9 (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 t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-select * from t9;
-a b c d e f g h i
-1 b1b1b1b1b1b1b1b1 Kyle 0000-00-00 00:00:00 0 NULL NULL
-2 b1b1b1b1b1b1b1b1 JOE 0000-00-00 00:00:00 0 NULL NULL
-3 b1b1b1b1b1b1b1b1 QA 0000-00-00 00:00:00 0 NULL NULL
-*** 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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** Drop t10 ***
-DROP TABLE t10;
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
-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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** 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
-*** Create t14a on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-*** Create t14a on Master ***
-CREATE TABLE t14a (c1 INT PRIMARY KEY, 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 t14a () VALUES(1,@b1,'Kyle'),
-(2,@b1,'JOE'),
-(3,@b1,'QA');
-SELECT * FROM t14a ORDER BY c1;
-c1 c4 c5
-1 b1b1b1b1b1b1b1b1 Kyle
-2 b1b1b1b1b1b1b1b1 JOE
-3 b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t14a ORDER BY c1;
-c1 c4 c5 c6 c7
-1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-STOP SLAVE;
-RESET SLAVE;
-*** Master Drop c5 ***
-ALTER TABLE t14a DROP COLUMN c5;
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14a () VALUES(4,@b1),
-(5,@b1),
-(6,@b1);
-SELECT * FROM t14a ORDER BY c1;
-c1 c4
-1 b1b1b1b1b1b1b1b1
-2 b1b1b1b1b1b1b1b1
-3 b1b1b1b1b1b1b1b1
-4 b1b1b1b1b1b1b1b1
-5 b1b1b1b1b1b1b1b1
-6 b1b1b1b1b1b1b1b1
-*** Select on Slave ****
-SELECT * FROM t14a ORDER BY c1;
-c1 c4 c5 c6 c7
-1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
-5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
-6 b1b1b1b1b1b1b1b1 NULL 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 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-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= 1;
-include/start_slave.inc
-*** 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
-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='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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-** 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
deleted file mode 100644
index af5d8539b7e..00000000000
--- a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
+++ /dev/null
@@ -1,606 +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;
-call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
-**** Diff Table Def Start ****
-*** On Slave ***
-STOP SLAVE;
-RESET SLAVE;
-SET @saved_slave_type_conversions = @@slave_type_conversions;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
-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
-SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
-*** 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;
-Last_SQL_Error = Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)'
-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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** 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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** 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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** 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 1677 ***
-********************************************
-Last_SQL_Error = Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)'
-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;
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
-d TIMESTAMP,
-e INT NOT NULL,
-f text not null,
-g text,
-h blob not null,
-i blob) ENGINE='MyISAM';
-*** Create t9 on Master ***
-CREATE TABLE t9 (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 t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-select * from t9;
-a b c d e f g h i
-1 b1b1b1b1b1b1b1b1 Kyle 0000-00-00 00:00:00 0 NULL NULL
-2 b1b1b1b1b1b1b1b1 JOE 0000-00-00 00:00:00 0 NULL NULL
-3 b1b1b1b1b1b1b1b1 QA 0000-00-00 00:00:00 0 NULL NULL
-*** 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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** Drop t10 ***
-DROP TABLE t10;
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
-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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** 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
-*** Create t14a on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-*** Create t14a on Master ***
-CREATE TABLE t14a (c1 INT PRIMARY KEY, 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 t14a () VALUES(1,@b1,'Kyle'),
-(2,@b1,'JOE'),
-(3,@b1,'QA');
-SELECT * FROM t14a ORDER BY c1;
-c1 c4 c5
-1 b1b1b1b1b1b1b1b1 Kyle
-2 b1b1b1b1b1b1b1b1 JOE
-3 b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t14a ORDER BY c1;
-c1 c4 c5 c6 c7
-1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-STOP SLAVE;
-RESET SLAVE;
-*** Master Drop c5 ***
-ALTER TABLE t14a DROP COLUMN c5;
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14a () VALUES(4,@b1),
-(5,@b1),
-(6,@b1);
-SELECT * FROM t14a ORDER BY c1;
-c1 c4
-1 b1b1b1b1b1b1b1b1
-2 b1b1b1b1b1b1b1b1
-3 b1b1b1b1b1b1b1b1
-4 b1b1b1b1b1b1b1b1
-5 b1b1b1b1b1b1b1b1
-6 b1b1b1b1b1b1b1b1
-*** Select on Slave ****
-SELECT * FROM t14a ORDER BY c1;
-c1 c4 c5 c6 c7
-1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
-2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
-3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
-4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
-5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
-6 b1b1b1b1b1b1b1b1 NULL 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 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-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= 1;
-include/start_slave.inc
-*** 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
-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='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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-** 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
deleted file mode 100644
index 137253e68c0..00000000000
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
+++ /dev/null
@@ -1,878 +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;
-
-***********************************************************
-***********************************************************
-***************** Start of Testing ************************
-***********************************************************
-***********************************************************
-* This test format == binlog_format ROW and engine == 'InnoDB'
-***********************************************************
-***********************************************************
-
-***** Testing more columns on the Master *****
-
-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='InnoDB';
-
-* Alter Table on Slave and drop columns f5 through f11 *
-
-alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-
-* Insert data in Master then update and delete some rows*
-
-* Select count and 20 rows from Master *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
-hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
-2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-
-* Select count and 20 rows from Slave *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT * FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-Checking that both slave threads are running.
-
-***** Testing Altering table def scenario *****
-
-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='InnoDB';
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-
-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='InnoDB';
-
-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='InnoDB';
-Warnings:
-Warning 1264 Out of range value for column 'f8' at row 1
-
-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='InnoDB';
-
-** Alter tables on slave and drop columns **
-
-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;
-
-** Insert Data into 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');
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-Warning 1264 Out of range value for column 'f9' at row 2
-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';
-Warnings:
-Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
-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'
- );
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-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
-);
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-Warning 1264 Out of range value for column 'f5' at row 2
-Warning 1264 Out of range value for column 'f24' at row 2
-Warning 1264 Out of range value for column 'f24' at row 3
-
-** Sync slave with master **
-** Do selects from tables **
-
-select * from t1 order by f3;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-31 31 31 second
-32 32 32 second
-33 33 33 second
-34 34 34 second
-35 35 35 second
-36 36 36 second
-37 37 37 second
-38 38 38 second
-39 39 39 second
-40 40 40 second
-41 41 41 second
-42 42 42 second
-43 43 43 second
-44 44 44 second
-45 45 45 second
-46 46 46 second
-47 47 47 second
-48 48 48 second
-49 49 49 second
-50 50 50 second
-select * from t2 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-2 2 2 second
-3 3 3 third
-select * from t3 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t4 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t31 order by f3;
-f1 f2 f3 f4
-1 1 1 first
-1 1 2 second
-1 1 3 third
-1 1 4 fourth
-1 1 5 fifth
-1 1 6 sixth
-
-** Do updates 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;
-Warnings:
-Warning 1048 Column 'f3' cannot be null
-
-** Delete from Master **
-
-delete from t1;
-delete from t2;
-delete from t3;
-delete from t4;
-delete from t31;
-select * from t31;
-f1 f2 f3 f4
-
-** Check slave status **
-
-Checking that both slave threads are running.
-
-****************************************
-* columns in master at middle of table *
-* Expect: Proper error message *
-****************************************
-
-** Stop and Reset Slave **
-
-STOP SLAVE;
-RESET SLAVE;
-
-** create table slave side **
-CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='InnoDB';
-
-** Connect to master and create table **
-
-CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
-c CHAR(5), e INT DEFAULT '1')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,DEFAULT,'Kyle',DEFAULT),
-(2,@b1,DEFAULT,'JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1677 ***
-********************************************
-
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-
-*** Drop t10 ***
-DROP TABLE t10;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: Proper error message *
-*********************************************
-
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
-) ENGINE='InnoDB';
-
-*** Create t11 on Master ***
-CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')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,'Testing is fun','Kyle',DEFAULT),
-(2,@b1,'Testing is cool','JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1677 ***
-********************************************
-
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-
-*** Drop t11 ***
-DROP TABLE t11;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: This one should pass blob-text *
-*********************************************
-
-*** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
-) ENGINE='InnoDB';
-
-*** Create t12 on Master ***
-CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')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',DEFAULT,DEFAULT),
-(2,@b1,'JOE',DEFAULT,DEFAULT),
-(3,@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
-a hex(b) f c e
-1 62316231623162316231623162316231 Kyle test 1
-2 62316231623162316231623162316231 JOE test 1
-3 62316231623162316231623162316231 QA test 1
-
-*** Select on Slave ***
-SELECT a,hex(b),c FROM t12 ORDER BY a;
-a hex(b) c
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-*** Drop t12 ***
-DROP TABLE t12;
-
-****************************************************
-* - Alter Master adding columns at middle of table *
-* Expect: columns added *
-****************************************************
-
-
-*** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t14 on Master ***
-CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)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',DEFAULT,DEFAULT),
-(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5 c6 c7
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
-
-*** Select on Slave ****
-SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
-
-****************************************************
-* - Alter Master Dropping columns from the middle. *
-* Expect: columns dropped *
-****************************************************
-
-*** connect to master and drop columns ***
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c7;
-
-*** Select from Master ***
-SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
-c1 c3 hex(c4) c5 c6
-1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
-2 This Test Should work 62316231623162316231623162316231 JOE 1
-3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
-
-************
-* Bug30415 *
-************
-Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t14 ***
-DROP TABLE t14;
-DROP TABLE t14;
-RESET MASTER;
-START SLAVE;
-
-*************************************************
-* - Alter Master adding columns at end of table *
-* Expect: Error 1054 *
-*************************************************
-
-*** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t15 on Master ***
-CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
-(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
-(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
-SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
-c1 hex(c4) c5 c6 c7 c2
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
-2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
-3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
-
-********************************************
-*** Expect slave to fail with Error 1054 ***
-********************************************
-
-Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t15 ***
-DROP TABLE t15;
-DROP TABLE t15;
-RESET MASTER;
-START SLAVE;
-
-************************************************
-* - Create index on Master column not on slave *
-* Expect:Warning *
-************************************************
-
-*** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t16 on Master ***
-CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Create Index and Data Insert ***
-CREATE INDEX part_of_c6 ON t16 (c6);
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-*****************
-*** BUG 30434 ***
-*****************
-
-Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t16 ***
-DROP TABLE t16;
-DROP TABLE t16;
-RESET MASTER;
-START SLAVE;
-
-*****************************************************
-* - Delete rows using column on Master not on slave *
-* Expect: Rows Deleted *
-*****************************************************
-
-*** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t17 on Master ***
-CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** Delete from master **
-DELETE FROM t17 WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-DROP TABLE t17;
-
-
-*****************************************************
-* - Update row using column on Master not on slave *
-* Expect: Rows updated *
-*****************************************************
-
-** Bug30674 **
-
-*** Create t18 on slave ***
-
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t18 on Master ***
-CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** update from master **
-UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 TEST
-DROP TABLE t18;
-
-
-*****************************************************
-* - Insert UUID column on Master not on slave *
-* Expect: Rows inserted *
-*****************************************************
-
-*** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t5 on Master ***
-CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 LONG,
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
-(2,@b1,'JOE',UUID(),DEFAULT),
-(3,@b1,'QA',UUID(),DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 6231623162316231 Kyle UUID TIME
-2 6231623162316231 JOE UUID TIME
-3 6231623162316231 QA UUID TIME
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
-c1 hex(c4) c5
-1 6231623162316231 Kyle
-2 6231623162316231 JOE
-3 6231623162316231 QA
-DROP TABLE t5;
-
diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
deleted file mode 100644
index d55a6bcbbf2..00000000000
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
+++ /dev/null
@@ -1,878 +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;
-
-***********************************************************
-***********************************************************
-***************** Start of Testing ************************
-***********************************************************
-***********************************************************
-* This test format == binlog_format ROW and engine == 'MyISAM'
-***********************************************************
-***********************************************************
-
-***** Testing more columns on the Master *****
-
-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='MyISAM';
-
-* Alter Table on Slave and drop columns f5 through f11 *
-
-alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-
-* Insert data in Master then update and delete some rows*
-
-* Select count and 20 rows from Master *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
-hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
-2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-
-* Select count and 20 rows from Slave *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT * FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-Checking that both slave threads are running.
-
-***** Testing Altering table def scenario *****
-
-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='MyISAM';
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-
-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='MyISAM';
-
-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='MyISAM';
-Warnings:
-Warning 1264 Out of range value for column 'f8' at row 1
-
-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='MyISAM';
-
-** Alter tables on slave and drop columns **
-
-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;
-
-** Insert Data into 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');
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-Warning 1264 Out of range value for column 'f9' at row 2
-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';
-Warnings:
-Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
-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'
- );
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-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
-);
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-Warning 1264 Out of range value for column 'f5' at row 2
-Warning 1264 Out of range value for column 'f24' at row 2
-Warning 1264 Out of range value for column 'f24' at row 3
-
-** Sync slave with master **
-** Do selects from tables **
-
-select * from t1 order by f3;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-31 31 31 second
-32 32 32 second
-33 33 33 second
-34 34 34 second
-35 35 35 second
-36 36 36 second
-37 37 37 second
-38 38 38 second
-39 39 39 second
-40 40 40 second
-41 41 41 second
-42 42 42 second
-43 43 43 second
-44 44 44 second
-45 45 45 second
-46 46 46 second
-47 47 47 second
-48 48 48 second
-49 49 49 second
-50 50 50 second
-select * from t2 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-2 2 2 second
-3 3 3 third
-select * from t3 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t4 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t31 order by f3;
-f1 f2 f3 f4
-1 1 1 first
-1 1 2 second
-1 1 3 third
-1 1 4 fourth
-1 1 5 fifth
-1 1 6 sixth
-
-** Do updates 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;
-Warnings:
-Warning 1048 Column 'f3' cannot be null
-
-** Delete from Master **
-
-delete from t1;
-delete from t2;
-delete from t3;
-delete from t4;
-delete from t31;
-select * from t31;
-f1 f2 f3 f4
-
-** Check slave status **
-
-Checking that both slave threads are running.
-
-****************************************
-* columns in master at middle of table *
-* Expect: Proper error message *
-****************************************
-
-** Stop and Reset Slave **
-
-STOP SLAVE;
-RESET SLAVE;
-
-** create table slave side **
-CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='MyISAM';
-
-** Connect to master and create table **
-
-CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
-c CHAR(5), e INT DEFAULT '1')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,DEFAULT,'Kyle',DEFAULT),
-(2,@b1,DEFAULT,'JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1677 ***
-********************************************
-
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-
-*** Drop t10 ***
-DROP TABLE t10;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: Proper error message *
-*********************************************
-
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
-) ENGINE='MyISAM';
-
-*** Create t11 on Master ***
-CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')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,'Testing is fun','Kyle',DEFAULT),
-(2,@b1,'Testing is cool','JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1677 ***
-********************************************
-
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-
-*** Drop t11 ***
-DROP TABLE t11;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: This one should pass blob-text *
-*********************************************
-
-*** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
-) ENGINE='MyISAM';
-
-*** Create t12 on Master ***
-CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')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',DEFAULT,DEFAULT),
-(2,@b1,'JOE',DEFAULT,DEFAULT),
-(3,@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
-a hex(b) f c e
-1 62316231623162316231623162316231 Kyle test 1
-2 62316231623162316231623162316231 JOE test 1
-3 62316231623162316231623162316231 QA test 1
-
-*** Select on Slave ***
-SELECT a,hex(b),c FROM t12 ORDER BY a;
-a hex(b) c
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-*** Drop t12 ***
-DROP TABLE t12;
-
-****************************************************
-* - Alter Master adding columns at middle of table *
-* Expect: columns added *
-****************************************************
-
-
-*** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t14 on Master ***
-CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)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',DEFAULT,DEFAULT),
-(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5 c6 c7
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
-
-*** Select on Slave ****
-SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
-
-****************************************************
-* - Alter Master Dropping columns from the middle. *
-* Expect: columns dropped *
-****************************************************
-
-*** connect to master and drop columns ***
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c7;
-
-*** Select from Master ***
-SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
-c1 c3 hex(c4) c5 c6
-1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
-2 This Test Should work 62316231623162316231623162316231 JOE 1
-3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
-
-************
-* Bug30415 *
-************
-Last_SQL_Error = Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t14 ***
-DROP TABLE t14;
-DROP TABLE t14;
-RESET MASTER;
-START SLAVE;
-
-*************************************************
-* - Alter Master adding columns at end of table *
-* Expect: Error 1054 *
-*************************************************
-
-*** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t15 on Master ***
-CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
-(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
-(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
-SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
-c1 hex(c4) c5 c6 c7 c2
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
-2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
-3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
-
-********************************************
-*** Expect slave to fail with Error 1054 ***
-********************************************
-
-Last_SQL_Error = Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t15 ***
-DROP TABLE t15;
-DROP TABLE t15;
-RESET MASTER;
-START SLAVE;
-
-************************************************
-* - Create index on Master column not on slave *
-* Expect:Warning *
-************************************************
-
-*** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t16 on Master ***
-CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Create Index and Data Insert ***
-CREATE INDEX part_of_c6 ON t16 (c6);
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-*****************
-*** BUG 30434 ***
-*****************
-
-Last_SQL_Error = Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t16 ***
-DROP TABLE t16;
-DROP TABLE t16;
-RESET MASTER;
-START SLAVE;
-
-*****************************************************
-* - Delete rows using column on Master not on slave *
-* Expect: Rows Deleted *
-*****************************************************
-
-*** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t17 on Master ***
-CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** Delete from master **
-DELETE FROM t17 WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-DROP TABLE t17;
-
-
-*****************************************************
-* - Update row using column on Master not on slave *
-* Expect: Rows updated *
-*****************************************************
-
-** Bug30674 **
-
-*** Create t18 on slave ***
-
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t18 on Master ***
-CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** update from master **
-UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 TEST
-DROP TABLE t18;
-
-
-*****************************************************
-* - Insert UUID column on Master not on slave *
-* Expect: Rows inserted *
-*****************************************************
-
-*** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t5 on Master ***
-CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 LONG,
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
-(2,@b1,'JOE',UUID(),DEFAULT),
-(3,@b1,'QA',UUID(),DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 6231623162316231 Kyle UUID TIME
-2 6231623162316231 JOE UUID TIME
-3 6231623162316231 QA UUID TIME
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
-c1 hex(c4) c5
-1 6231623162316231 Kyle
-2 6231623162316231 JOE
-3 6231623162316231 QA
-DROP TABLE t5;
-
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
new file mode 100644
index 00000000000..e5e690bdf52
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
@@ -0,0 +1,873 @@
+include/master-slave.inc
+[connection master]
+
+***********************************************************
+***********************************************************
+***************** Start of Testing ************************
+***********************************************************
+***********************************************************
+* This test format == binlog_format ROW and engine == 'InnoDB'
+***********************************************************
+***********************************************************
+
+***** Testing more columns on the Master *****
+
+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='InnoDB';
+
+* Alter Table on Slave and drop columns f5 through f11 *
+
+alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
+
+* Insert data in Master then update and delete some rows*
+
+* Select count and 20 rows from Master *
+
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+40
+
+SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
+hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
+f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
+2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+
+* Select count and 20 rows from Slave *
+
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+40
+
+SELECT * FROM t1 ORDER BY f3 LIMIT 20;
+f1 f2 f3 f4
+2 2 2 second
+3 3 3 next
+5 5 5 second
+6 6 6 next
+8 8 8 second
+9 9 9 next
+11 11 11 second
+12 12 12 next
+14 14 14 second
+15 15 15 next
+17 17 17 second
+18 18 18 next
+20 20 20 second
+21 21 21 next
+23 23 23 second
+24 24 24 next
+26 26 26 second
+27 27 27 next
+29 29 29 second
+30 30 30 next
+include/check_slave_is_running.inc
+
+***** Testing Altering table def scenario *****
+
+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='InnoDB';
+Warnings:
+Warning 1264 Out of range value for column 'f9' at row 1
+
+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='InnoDB';
+
+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='InnoDB';
+Warnings:
+Warning 1264 Out of range value for column 'f8' at row 1
+
+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='InnoDB';
+
+** Alter tables on slave and drop columns **
+
+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;
+
+** Insert Data into 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');
+Warnings:
+Warning 1264 Out of range value for column 'f9' at row 1
+Warning 1264 Out of range value for column 'f9' at row 2
+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';
+Warnings:
+Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
+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'
+ );
+Warnings:
+Warning 1264 Out of range value for column 'f5' at row 1
+Warning 1264 Out of range value for column 'f24' at row 1
+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
+);
+Warnings:
+Warning 1264 Out of range value for column 'f5' at row 1
+Warning 1264 Out of range value for column 'f24' at row 1
+Warning 1264 Out of range value for column 'f5' at row 2
+Warning 1264 Out of range value for column 'f24' at row 2
+Warning 1264 Out of range value for column 'f24' at row 3
+
+** Sync slave with master **
+** Do selects from tables **
+
+select * from t1 order by f3;
+f1 f2 f3 f4
+2 2 2 second
+3 3 3 next
+5 5 5 second
+6 6 6 next
+8 8 8 second
+9 9 9 next
+11 11 11 second
+12 12 12 next
+14 14 14 second
+15 15 15 next
+17 17 17 second
+18 18 18 next
+20 20 20 second
+21 21 21 next
+23 23 23 second
+24 24 24 next
+26 26 26 second
+27 27 27 next
+29 29 29 second
+30 30 30 next
+31 31 31 second
+32 32 32 second
+33 33 33 second
+34 34 34 second
+35 35 35 second
+36 36 36 second
+37 37 37 second
+38 38 38 second
+39 39 39 second
+40 40 40 second
+41 41 41 second
+42 42 42 second
+43 43 43 second
+44 44 44 second
+45 45 45 second
+46 46 46 second
+47 47 47 second
+48 48 48 second
+49 49 49 second
+50 50 50 second
+select * from t2 order by f1;
+f1 f2 f3 f4
+1 1 1 first
+2 2 2 second
+3 3 3 third
+select * from t3 order by f1;
+f1 f2 f3 f4
+1 1 1 first
+select * from t4 order by f1;
+f1 f2 f3 f4
+1 1 1 first
+select * from t31 order by f3;
+f1 f2 f3 f4
+1 1 1 first
+1 1 2 second
+1 1 3 third
+1 1 4 fourth
+1 1 5 fifth
+1 1 6 sixth
+
+** Do updates 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;
+Warnings:
+Warning 1048 Column 'f3' cannot be null
+
+** Delete from Master **
+
+delete from t1;
+delete from t2;
+delete from t3;
+delete from t4;
+delete from t31;
+select * from t31;
+f1 f2 f3 f4
+
+** Check slave status **
+
+include/check_slave_is_running.inc
+
+****************************************
+* columns in master at middle of table *
+* Expect: Proper error message *
+****************************************
+
+** Stop and Reset Slave **
+
+STOP SLAVE;
+RESET SLAVE;
+
+** create table slave side **
+CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='InnoDB';
+
+** Connect to master and create table **
+
+CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+c CHAR(5), e INT DEFAULT '1')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,DEFAULT,'Kyle',DEFAULT),
+(2,@b1,DEFAULT,'JOE',DEFAULT),
+(3,@b1,DEFAULT,'QA',DEFAULT);
+
+********************************************
+*** Expect slave to fail with Error 1677 ***
+********************************************
+
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)''
+
+*** Drop t10 ***
+DROP TABLE t10;
+
+*********************************************
+* More columns in master at middle of table *
+* Expect: Proper error message *
+*********************************************
+
+*** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+) ENGINE='InnoDB';
+
+*** Create t11 on Master ***
+CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')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,'Testing is fun','Kyle',DEFAULT),
+(2,@b1,'Testing is cool','JOE',DEFAULT),
+(3,@b1,DEFAULT,'QA',DEFAULT);
+
+********************************************
+*** Expect slave to fail with Error 1677 ***
+********************************************
+
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)''
+
+*** Drop t11 ***
+DROP TABLE t11;
+
+*********************************************
+* More columns in master at middle of table *
+* Expect: This one should pass blob-text *
+*********************************************
+
+*** Create t12 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+) ENGINE='InnoDB';
+
+*** Create t12 on Master ***
+CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')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',DEFAULT,DEFAULT),
+(2,@b1,'JOE',DEFAULT,DEFAULT),
+(3,@b1,'QA',DEFAULT,DEFAULT);
+
+SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
+a hex(b) f c e
+1 62316231623162316231623162316231 Kyle test 1
+2 62316231623162316231623162316231 JOE test 1
+3 62316231623162316231623162316231 QA test 1
+
+*** Select on Slave ***
+SELECT a,hex(b),c FROM t12 ORDER BY a;
+a hex(b) c
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+3 62316231623162316231623162316231 QA
+
+*** Drop t12 ***
+DROP TABLE t12;
+
+****************************************************
+* - Alter Master adding columns at middle of table *
+* Expect: columns added *
+****************************************************
+
+
+*** Create t14 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='InnoDB';
+
+*** Create t14 on Master ***
+CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)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',DEFAULT,DEFAULT),
+(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
+
+SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
+c1 c2 c3 hex(c4) c5 c6 c7
+1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
+
+*** Select on Slave ****
+SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
+c1 c2 c3 hex(c4) c5
+1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
+2 2.00 This Test Should work 62316231623162316231623162316231 JOE
+3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
+
+****************************************************
+* - Alter Master Dropping columns from the middle. *
+* Expect: columns dropped *
+****************************************************
+
+*** connect to master and drop columns ***
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c7;
+
+*** Select from Master ***
+SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
+c1 c3 hex(c4) c5 c6
+1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
+2 This Test Should work 62316231623162316231623162316231 JOE 1
+3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
+
+************
+* Bug30415 *
+************
+include/wait_for_slave_sql_error.inc [errno=1091]
+Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7''
+STOP SLAVE;
+RESET SLAVE;
+
+*** Drop t14 ***
+DROP TABLE t14;
+DROP TABLE t14;
+RESET MASTER;
+START SLAVE;
+
+*************************************************
+* - Alter Master adding columns at end of table *
+* Expect: Error 1054 *
+*************************************************
+
+*** Create t15 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='InnoDB';
+
+*** Create t15 on Master ***
+CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+RESET MASTER;
+
+*** Start Slave ***
+START SLAVE;
+
+*** Master Data Insert ***
+ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
+(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
+(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
+SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
+c1 hex(c4) c5 c6 c7 c2
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
+2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
+3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
+
+********************************************
+*** Expect slave to fail with Error 1054 ***
+********************************************
+
+include/wait_for_slave_sql_error.inc [errno=1054]
+Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7''
+STOP SLAVE;
+RESET SLAVE;
+
+*** Drop t15 ***
+DROP TABLE t15;
+DROP TABLE t15;
+RESET MASTER;
+START SLAVE;
+
+************************************************
+* - Create index on Master column not on slave *
+* Expect:Warning *
+************************************************
+
+*** Create t16 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='InnoDB';
+
+*** Create t16 on Master ***
+CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+RESET MASTER;
+
+*** Start Slave ***
+START SLAVE;
+
+*** Master Create Index and Data Insert ***
+CREATE INDEX part_of_c6 ON t16 (c6);
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+(2,@b1,'JOE',2,DEFAULT),
+(3,@b1,'QA',3,DEFAULT);
+SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
+
+*****************
+*** BUG 30434 ***
+*****************
+
+include/wait_for_slave_sql_error.inc [errno=1072]
+Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)''
+STOP SLAVE;
+RESET SLAVE;
+
+*** Drop t16 ***
+DROP TABLE t16;
+DROP TABLE t16;
+RESET MASTER;
+START SLAVE;
+
+*****************************************************
+* - Delete rows using column on Master not on slave *
+* Expect: Rows Deleted *
+*****************************************************
+
+*** Create t17 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='InnoDB';
+
+*** Create t17 on Master ***
+CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+RESET MASTER;
+
+*** Start Slave ***
+START SLAVE;
+
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+(2,@b1,'JOE',2,DEFAULT),
+(3,@b1,'QA',3,DEFAULT);
+SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
+
+** Select * from Slave **
+SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
+c1 hex(c4) c5
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+3 62316231623162316231623162316231 QA
+
+** Delete from master **
+DELETE FROM t17 WHERE c6 = 3;
+SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+
+** Check slave **
+SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
+c1 hex(c4) c5
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+DROP TABLE t17;
+
+
+*****************************************************
+* - Update row using column on Master not on slave *
+* Expect: Rows updated *
+*****************************************************
+
+** Bug30674 **
+
+*** Create t18 on slave ***
+
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='InnoDB';
+
+*** Create t18 on Master ***
+CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+RESET MASTER;
+
+*** Start Slave ***
+START SLAVE;
+
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+(2,@b1,'JOE',2,DEFAULT),
+(3,@b1,'QA',3,DEFAULT);
+SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
+
+** Select * from Slave **
+SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
+c1 hex(c4) c5
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+3 62316231623162316231623162316231 QA
+
+** update from master **
+UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
+SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
+
+** Check slave **
+SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
+c1 hex(c4) c5
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+3 62316231623162316231623162316231 TEST
+DROP TABLE t18;
+
+
+*****************************************************
+* - Insert UUID column on Master not on slave *
+* Expect: Rows inserted *
+*****************************************************
+
+*** Create t5 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='InnoDB';
+
+*** Create t5 on Master ***
+CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 LONG,
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+RESET MASTER;
+
+*** Start Slave ***
+START SLAVE;
+
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
+(2,@b1,'JOE',UUID(),DEFAULT),
+(3,@b1,'QA',UUID(),DEFAULT);
+SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 6231623162316231 Kyle UUID TIME
+2 6231623162316231 JOE UUID TIME
+3 6231623162316231 QA UUID TIME
+
+** Select * from Slave **
+SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
+c1 hex(c4) c5
+1 6231623162316231 Kyle
+2 6231623162316231 JOE
+3 6231623162316231 QA
+DROP TABLE t5;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
new file mode 100644
index 00000000000..9247ceb1030
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
@@ -0,0 +1,873 @@
+include/master-slave.inc
+[connection master]
+
+***********************************************************
+***********************************************************
+***************** Start of Testing ************************
+***********************************************************
+***********************************************************
+* This test format == binlog_format ROW and engine == 'MyISAM'
+***********************************************************
+***********************************************************
+
+***** Testing more columns on the Master *****
+
+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='MyISAM';
+
+* Alter Table on Slave and drop columns f5 through f11 *
+
+alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
+
+* Insert data in Master then update and delete some rows*
+
+* Select count and 20 rows from Master *
+
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+40
+
+SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
+hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
+f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
+2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+
+* Select count and 20 rows from Slave *
+
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+40
+
+SELECT * FROM t1 ORDER BY f3 LIMIT 20;
+f1 f2 f3 f4
+2 2 2 second
+3 3 3 next
+5 5 5 second
+6 6 6 next
+8 8 8 second
+9 9 9 next
+11 11 11 second
+12 12 12 next
+14 14 14 second
+15 15 15 next
+17 17 17 second
+18 18 18 next
+20 20 20 second
+21 21 21 next
+23 23 23 second
+24 24 24 next
+26 26 26 second
+27 27 27 next
+29 29 29 second
+30 30 30 next
+include/check_slave_is_running.inc
+
+***** Testing Altering table def scenario *****
+
+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='MyISAM';
+Warnings:
+Warning 1264 Out of range value for column 'f9' at row 1
+
+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='MyISAM';
+
+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='MyISAM';
+Warnings:
+Warning 1264 Out of range value for column 'f8' at row 1
+
+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='MyISAM';
+
+** Alter tables on slave and drop columns **
+
+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;
+
+** Insert Data into 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');
+Warnings:
+Warning 1264 Out of range value for column 'f9' at row 1
+Warning 1264 Out of range value for column 'f9' at row 2
+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';
+Warnings:
+Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
+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'
+ );
+Warnings:
+Warning 1264 Out of range value for column 'f5' at row 1
+Warning 1264 Out of range value for column 'f24' at row 1
+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
+);
+Warnings:
+Warning 1264 Out of range value for column 'f5' at row 1
+Warning 1264 Out of range value for column 'f24' at row 1
+Warning 1264 Out of range value for column 'f5' at row 2
+Warning 1264 Out of range value for column 'f24' at row 2
+Warning 1264 Out of range value for column 'f24' at row 3
+
+** Sync slave with master **
+** Do selects from tables **
+
+select * from t1 order by f3;
+f1 f2 f3 f4
+2 2 2 second
+3 3 3 next
+5 5 5 second
+6 6 6 next
+8 8 8 second
+9 9 9 next
+11 11 11 second
+12 12 12 next
+14 14 14 second
+15 15 15 next
+17 17 17 second
+18 18 18 next
+20 20 20 second
+21 21 21 next
+23 23 23 second
+24 24 24 next
+26 26 26 second
+27 27 27 next
+29 29 29 second
+30 30 30 next
+31 31 31 second
+32 32 32 second
+33 33 33 second
+34 34 34 second
+35 35 35 second
+36 36 36 second
+37 37 37 second
+38 38 38 second
+39 39 39 second
+40 40 40 second
+41 41 41 second
+42 42 42 second
+43 43 43 second
+44 44 44 second
+45 45 45 second
+46 46 46 second
+47 47 47 second
+48 48 48 second
+49 49 49 second
+50 50 50 second
+select * from t2 order by f1;
+f1 f2 f3 f4
+1 1 1 first
+2 2 2 second
+3 3 3 third
+select * from t3 order by f1;
+f1 f2 f3 f4
+1 1 1 first
+select * from t4 order by f1;
+f1 f2 f3 f4
+1 1 1 first
+select * from t31 order by f3;
+f1 f2 f3 f4
+1 1 1 first
+1 1 2 second
+1 1 3 third
+1 1 4 fourth
+1 1 5 fifth
+1 1 6 sixth
+
+** Do updates 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;
+Warnings:
+Warning 1048 Column 'f3' cannot be null
+
+** Delete from Master **
+
+delete from t1;
+delete from t2;
+delete from t3;
+delete from t4;
+delete from t31;
+select * from t31;
+f1 f2 f3 f4
+
+** Check slave status **
+
+include/check_slave_is_running.inc
+
+****************************************
+* columns in master at middle of table *
+* Expect: Proper error message *
+****************************************
+
+** Stop and Reset Slave **
+
+STOP SLAVE;
+RESET SLAVE;
+
+** create table slave side **
+CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
+) ENGINE='MyISAM';
+
+** Connect to master and create table **
+
+CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
+c CHAR(5), e INT DEFAULT '1')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,DEFAULT,'Kyle',DEFAULT),
+(2,@b1,DEFAULT,'JOE',DEFAULT),
+(3,@b1,DEFAULT,'QA',DEFAULT);
+
+********************************************
+*** Expect slave to fail with Error 1677 ***
+********************************************
+
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)''
+
+*** Drop t10 ***
+DROP TABLE t10;
+
+*********************************************
+* More columns in master at middle of table *
+* Expect: Proper error message *
+*********************************************
+
+*** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
+) ENGINE='MyISAM';
+
+*** Create t11 on Master ***
+CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')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,'Testing is fun','Kyle',DEFAULT),
+(2,@b1,'Testing is cool','JOE',DEFAULT),
+(3,@b1,DEFAULT,'QA',DEFAULT);
+
+********************************************
+*** Expect slave to fail with Error 1677 ***
+********************************************
+
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)''
+
+*** Drop t11 ***
+DROP TABLE t11;
+
+*********************************************
+* More columns in master at middle of table *
+* Expect: This one should pass blob-text *
+*********************************************
+
+*** Create t12 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
+) ENGINE='MyISAM';
+
+*** Create t12 on Master ***
+CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
+c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')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',DEFAULT,DEFAULT),
+(2,@b1,'JOE',DEFAULT,DEFAULT),
+(3,@b1,'QA',DEFAULT,DEFAULT);
+
+SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
+a hex(b) f c e
+1 62316231623162316231623162316231 Kyle test 1
+2 62316231623162316231623162316231 JOE test 1
+3 62316231623162316231623162316231 QA test 1
+
+*** Select on Slave ***
+SELECT a,hex(b),c FROM t12 ORDER BY a;
+a hex(b) c
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+3 62316231623162316231623162316231 QA
+
+*** Drop t12 ***
+DROP TABLE t12;
+
+****************************************************
+* - Alter Master adding columns at middle of table *
+* Expect: columns added *
+****************************************************
+
+
+*** Create t14 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='MyISAM';
+
+*** Create t14 on Master ***
+CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)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',DEFAULT,DEFAULT),
+(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
+(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
+
+SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
+c1 c2 c3 hex(c4) c5 c6 c7
+1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
+3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
+
+*** Select on Slave ****
+SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
+c1 c2 c3 hex(c4) c5
+1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
+2 2.00 This Test Should work 62316231623162316231623162316231 JOE
+3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
+
+****************************************************
+* - Alter Master Dropping columns from the middle. *
+* Expect: columns dropped *
+****************************************************
+
+*** connect to master and drop columns ***
+ALTER TABLE t14 DROP COLUMN c2;
+ALTER TABLE t14 DROP COLUMN c7;
+
+*** Select from Master ***
+SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
+c1 c3 hex(c4) c5 c6
+1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
+2 This Test Should work 62316231623162316231623162316231 JOE 1
+3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
+
+************
+* Bug30415 *
+************
+include/wait_for_slave_sql_error.inc [errno=1091]
+Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7''
+STOP SLAVE;
+RESET SLAVE;
+
+*** Drop t14 ***
+DROP TABLE t14;
+DROP TABLE t14;
+RESET MASTER;
+START SLAVE;
+
+*************************************************
+* - Alter Master adding columns at end of table *
+* Expect: Error 1054 *
+*************************************************
+
+*** Create t15 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='MyISAM';
+
+*** Create t15 on Master ***
+CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+RESET MASTER;
+
+*** Start Slave ***
+START SLAVE;
+
+*** Master Data Insert ***
+ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
+(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
+(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
+SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
+c1 hex(c4) c5 c6 c7 c2
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
+2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
+3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
+
+********************************************
+*** Expect slave to fail with Error 1054 ***
+********************************************
+
+include/wait_for_slave_sql_error.inc [errno=1054]
+Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7''
+STOP SLAVE;
+RESET SLAVE;
+
+*** Drop t15 ***
+DROP TABLE t15;
+DROP TABLE t15;
+RESET MASTER;
+START SLAVE;
+
+************************************************
+* - Create index on Master column not on slave *
+* Expect:Warning *
+************************************************
+
+*** Create t16 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='MyISAM';
+
+*** Create t16 on Master ***
+CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+RESET MASTER;
+
+*** Start Slave ***
+START SLAVE;
+
+*** Master Create Index and Data Insert ***
+CREATE INDEX part_of_c6 ON t16 (c6);
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+(2,@b1,'JOE',2,DEFAULT),
+(3,@b1,'QA',3,DEFAULT);
+SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
+
+*****************
+*** BUG 30434 ***
+*****************
+
+include/wait_for_slave_sql_error.inc [errno=1072]
+Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)''
+STOP SLAVE;
+RESET SLAVE;
+
+*** Drop t16 ***
+DROP TABLE t16;
+DROP TABLE t16;
+RESET MASTER;
+START SLAVE;
+
+*****************************************************
+* - Delete rows using column on Master not on slave *
+* Expect: Rows Deleted *
+*****************************************************
+
+*** Create t17 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='MyISAM';
+
+*** Create t17 on Master ***
+CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+RESET MASTER;
+
+*** Start Slave ***
+START SLAVE;
+
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+(2,@b1,'JOE',2,DEFAULT),
+(3,@b1,'QA',3,DEFAULT);
+SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
+
+** Select * from Slave **
+SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
+c1 hex(c4) c5
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+3 62316231623162316231623162316231 QA
+
+** Delete from master **
+DELETE FROM t17 WHERE c6 = 3;
+SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+
+** Check slave **
+SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
+c1 hex(c4) c5
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+DROP TABLE t17;
+
+
+*****************************************************
+* - Update row using column on Master not on slave *
+* Expect: Rows updated *
+*****************************************************
+
+** Bug30674 **
+
+*** Create t18 on slave ***
+
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='MyISAM';
+
+*** Create t18 on Master ***
+CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+RESET MASTER;
+
+*** Start Slave ***
+START SLAVE;
+
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
+(2,@b1,'JOE',2,DEFAULT),
+(3,@b1,'QA',3,DEFAULT);
+SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
+
+** Select * from Slave **
+SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
+c1 hex(c4) c5
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+3 62316231623162316231623162316231 QA
+
+** update from master **
+UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
+SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
+2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
+3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
+
+** Check slave **
+SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
+c1 hex(c4) c5
+1 62316231623162316231623162316231 Kyle
+2 62316231623162316231623162316231 JOE
+3 62316231623162316231623162316231 TEST
+DROP TABLE t18;
+
+
+*****************************************************
+* - Insert UUID column on Master not on slave *
+* Expect: Rows inserted *
+*****************************************************
+
+*** Create t5 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
+) ENGINE='MyISAM';
+
+*** Create t5 on Master ***
+CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 LONG,
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+RESET MASTER;
+
+*** Start Slave ***
+START SLAVE;
+
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
+(2,@b1,'JOE',UUID(),DEFAULT),
+(3,@b1,'QA',UUID(),DEFAULT);
+SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
+c1 hex(c4) c5 c6 c7
+1 6231623162316231 Kyle UUID TIME
+2 6231623162316231 JOE UUID TIME
+3 6231623162316231 QA UUID TIME
+
+** Select * from Slave **
+SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
+c1 hex(c4) c5
+1 6231623162316231 Kyle
+2 6231623162316231 JOE
+3 6231623162316231 QA
+DROP TABLE t5;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result
new file mode 100644
index 00000000000..c63ba401085
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result
@@ -0,0 +1,595 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* Error_code: 1677");
+**** Diff Table Def Start ****
+*** On Slave ***
+STOP SLAVE;
+RESET SLAVE;
+SET @saved_slave_type_conversions = @@slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
+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
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+*** 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;
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)''
+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 1677 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)''
+*** 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 1677 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)''
+*** 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 1677 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)''
+*** 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 1677 ***
+********************************************
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)''
+*** Drop t6 ***
+include/rpl_reset.inc
+DROP TABLE t6;
+**** 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;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP,
+e INT NOT NULL,
+f text not null,
+g text,
+h blob not null,
+i blob) ENGINE='InnoDB';
+*** Create t9 on Master ***
+CREATE TABLE t9 (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 t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+select * from t9;
+a b c d e f g h i
+1 b1b1b1b1b1b1b1b1 Kyle 0000-00-00 00:00:00 0 NULL NULL
+2 b1b1b1b1b1b1b1b1 JOE 0000-00-00 00:00:00 0 NULL NULL
+3 b1b1b1b1b1b1b1b1 QA 0000-00-00 00:00:00 0 NULL NULL
+DROP TABLE t9;
+*** 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 1677 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double''
+*** Drop t10 ***
+DROP TABLE t10;
+*** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
+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 1677 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)''
+*** 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
+*** Create t14a on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='InnoDB';
+*** Create t14a on Master ***
+CREATE TABLE t14a (c1 INT PRIMARY KEY, 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 t14a () VALUES(1,@b1,'Kyle'),
+(2,@b1,'JOE'),
+(3,@b1,'QA');
+SELECT * FROM t14a ORDER BY c1;
+c1 c4 c5
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t14a ORDER BY c1;
+c1 c4 c5 c6 c7
+1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+STOP SLAVE;
+RESET SLAVE;
+*** Master Drop c5 ***
+ALTER TABLE t14a DROP COLUMN c5;
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14a () VALUES(4,@b1),
+(5,@b1),
+(6,@b1);
+SELECT * FROM t14a ORDER BY c1;
+c1 c4
+1 b1b1b1b1b1b1b1b1
+2 b1b1b1b1b1b1b1b1
+3 b1b1b1b1b1b1b1b1
+4 b1b1b1b1b1b1b1b1
+5 b1b1b1b1b1b1b1b1
+6 b1b1b1b1b1b1b1b1
+*** Select on Slave ****
+SELECT * FROM t14a ORDER BY c1;
+c1 c4 c5 c6 c7
+1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+6 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+DROP TABLE t14a;
+*** 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;
+call mtr.add_suppression("Error .Unknown table .t6.. on query.* Error_code: 1051");
+call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* Error_code: 1060");
+call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535");
+*** 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 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [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''
+*** 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
+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='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 1677 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)''
+** DROP table t17 ***
+DROP TABLE t17;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result
new file mode 100644
index 00000000000..4e483da72e4
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result
@@ -0,0 +1,595 @@
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* Error_code: 1677");
+**** Diff Table Def Start ****
+*** On Slave ***
+STOP SLAVE;
+RESET SLAVE;
+SET @saved_slave_type_conversions = @@slave_type_conversions;
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
+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
+SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+*** 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;
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)''
+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 1677 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)''
+*** 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 1677 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)''
+*** 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 1677 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)''
+*** 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 1677 ***
+********************************************
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)''
+*** Drop t6 ***
+include/rpl_reset.inc
+DROP TABLE t6;
+**** 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;
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
+d TIMESTAMP,
+e INT NOT NULL,
+f text not null,
+g text,
+h blob not null,
+i blob) ENGINE='MyISAM';
+*** Create t9 on Master ***
+CREATE TABLE t9 (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 t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+select * from t9;
+a b c d e f g h i
+1 b1b1b1b1b1b1b1b1 Kyle 0000-00-00 00:00:00 0 NULL NULL
+2 b1b1b1b1b1b1b1b1 JOE 0000-00-00 00:00:00 0 NULL NULL
+3 b1b1b1b1b1b1b1b1 QA 0000-00-00 00:00:00 0 NULL NULL
+DROP TABLE t9;
+*** 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 1677 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double''
+*** Drop t10 ***
+DROP TABLE t10;
+*** Create t11 on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
+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 1677 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)''
+*** 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
+*** Create t14a on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5),
+c6 INT DEFAULT '1',
+c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
+)ENGINE='MyISAM';
+*** Create t14a on Master ***
+CREATE TABLE t14a (c1 INT PRIMARY KEY, 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 t14a () VALUES(1,@b1,'Kyle'),
+(2,@b1,'JOE'),
+(3,@b1,'QA');
+SELECT * FROM t14a ORDER BY c1;
+c1 c4 c5
+1 b1b1b1b1b1b1b1b1 Kyle
+2 b1b1b1b1b1b1b1b1 JOE
+3 b1b1b1b1b1b1b1b1 QA
+*** Select on Slave ****
+SELECT * FROM t14a ORDER BY c1;
+c1 c4 c5 c6 c7
+1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+STOP SLAVE;
+RESET SLAVE;
+*** Master Drop c5 ***
+ALTER TABLE t14a DROP COLUMN c5;
+RESET MASTER;
+*** Start Slave ***
+START SLAVE;
+*** Master Data Insert ***
+set @b1 = 'b1b1b1b1';
+set @b1 = concat(@b1,@b1);
+INSERT INTO t14a () VALUES(4,@b1),
+(5,@b1),
+(6,@b1);
+SELECT * FROM t14a ORDER BY c1;
+c1 c4
+1 b1b1b1b1b1b1b1b1
+2 b1b1b1b1b1b1b1b1
+3 b1b1b1b1b1b1b1b1
+4 b1b1b1b1b1b1b1b1
+5 b1b1b1b1b1b1b1b1
+6 b1b1b1b1b1b1b1b1
+*** Select on Slave ****
+SELECT * FROM t14a ORDER BY c1;
+c1 c4 c5 c6 c7
+1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
+2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
+3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
+4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+6 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+DROP TABLE t14a;
+*** 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;
+call mtr.add_suppression("Error .Unknown table .t6.. on query.* Error_code: 1051");
+call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* Error_code: 1060");
+call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* Error_code: 1535");
+*** 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 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [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''
+*** 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
+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='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 1677 ***
+********************************************
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)''
+** DROP table t17 ***
+DROP TABLE t17;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_failed_optimize.result b/mysql-test/suite/rpl/r/rpl_failed_optimize.result
index 7210898d521..0d46f78c150 100644
--- a/mysql-test/suite/rpl/r/rpl_failed_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_failed_optimize.result
@@ -1,19 +1,8 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
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 note Table does not support optimize, doing recreate + analyze instead
-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
@@ -23,3 +12,4 @@ a
1
commit;
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
index 5f1f72a9a3a..c88dcee9dbc 100644
--- a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
+++ b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (id int, a int);
CREATE TABLE t2 (id int, b int);
CREATE TABLE t3 (id int, c int);
@@ -46,86 +42,55 @@ UPDATE t4 LEFT JOIN (t1, t2, t5) ON (t1.id=t4.id and t2.id=t4.id and t5.id=t4.id
UPDATE t4 LEFT JOIN (t1, t6, t7) ON (t4.id=t1.id and t4.id=t6.id and t4.id=t7.id) SET a=0, d=0, f=0, g=0 where t4.id=1;
UPDATE t7 LEFT JOIN (t4, t1, t2) ON (t7.id=t4.id and t7.id=t1.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1;
UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id) SET a=0, d=0, g=0, h=0 where t7.id=1;
+call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146");
UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1''
UPDATE t1 LEFT JOIN (t4, t7) ON (t1.id=t4.id and t1.id=t7.id) SET a=0 where t1.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t7) ON (t1.id=t4.id and t1.id=t7.id) SET a=0 where t1.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t7) ON (t1.id=t4.id and t1.id=t7.id) SET a=0 where t1.id=1''
UPDATE t1 LEFT JOIN (t2, t4, t7) ON (t1.id=t2.id and t1.id=t4.id and t1.id=t7.id) SET a=0, b=0 where t1.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t2, t4, t7) ON (t1.id=t2.id and t1.id=t4.id and t1.id=t7.id) SET a=0, b=0 where t1.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t2, t4, t7) ON (t1.id=t2.id and t1.id=t4.id and t1.id=t7.id) SET a=0, b=0 where t1.id=1''
UPDATE t1 LEFT JOIN (t2, t3, t7) ON (t1.id=t2.id and t1.id=t3.id and t1.id=t7.id) SET a=0, b=0, c=0 where t1.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t2, t3, t7) ON (t1.id=t2.id and t1.id=t3.id and t1.id=t7.id) SET a=0, b=0, c=0 where t1.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t2, t3, t7) ON (t1.id=t2.id and t1.id=t3.id and t1.id=t7.id) SET a=0, b=0, c=0 where t1.id=1''
UPDATE t1 LEFT JOIN t7 ON (t1.id=t7.id) SET a=0, g=0 where t1.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t7 ON (t1.id=t7.id) SET a=0, g=0 where t1.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t7 ON (t1.id=t7.id) SET a=0, g=0 where t1.id=1''
UPDATE t7 LEFT JOIN t1 ON (t1.id=t7.id) SET a=0, g=0 where t7.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN t1 ON (t1.id=t7.id) SET a=0, g=0 where t7.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN t1 ON (t1.id=t7.id) SET a=0, g=0 where t7.id=1''
UPDATE t1 LEFT JOIN (t4, t5, t7) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t7.id) SET a=0, g=0 where t1.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t5, t7) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t7.id) SET a=0, g=0 where t1.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t5, t7) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t7.id) SET a=0, g=0 where t1.id=1''
UPDATE t1 LEFT JOIN (t4, t7, t8) ON (t1.id=t4.id and t1.id=t7.id and t1.id=t8.id) SET a=0, g=0 where t1.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t7, t8) ON (t1.id=t4.id and t1.id=t7.id and t1.id=t8.id) SET a=0, g=0 where t1.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t7, t8) ON (t1.id=t4.id and t1.id=t7.id and t1.id=t8.id) SET a=0, g=0 where t1.id=1''
UPDATE t1 LEFT JOIN (t7, t8, t9) ON (t1.id=t7.id and t1.id=t8.id and t1.id=t9.id) SET a=0, g=0, h=0, i=0 where t1.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t7, t8, t9) ON (t1.id=t7.id and t1.id=t8.id and t1.id=t9.id) SET a=0, g=0, h=0, i=0 where t1.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t7, t8, t9) ON (t1.id=t7.id and t1.id=t8.id and t1.id=t9.id) SET a=0, g=0, h=0, i=0 where t1.id=1''
UPDATE t7 LEFT JOIN (t1, t2, t3) ON (t7.id=t1.id and t7.id=t2.id and t7.id=t3.id) SET g=0, a=0, b=0, c=0 where t7.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t2, t3) ON (t7.id=t1.id and t7.id=t2.id and t7.id=t3.id) SET g=0, a=0, b=0, c=0 where t7.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t2, t3) ON (t7.id=t1.id and t7.id=t2.id and t7.id=t3.id) SET g=0, a=0, b=0, c=0 where t7.id=1''
UPDATE t7 LEFT JOIN (t4, t5, t3) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t3.id) SET g=0, c=0 where t7.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t4, t5, t3) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t3.id) SET g=0, c=0 where t7.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t4, t5, t3) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t3.id) SET g=0, c=0 where t7.id=1''
UPDATE t7 LEFT JOIN (t8, t9, t3) ON (t7.id=t8.id and t7.id=t9.id and t7.id=t3.id) SET g=0, h=0, i=0, c=0 where t7.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t8, t9, t3) ON (t7.id=t8.id and t7.id=t9.id and t7.id=t3.id) SET g=0, h=0, i=0, c=0 where t7.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t8, t9, t3) ON (t7.id=t8.id and t7.id=t9.id and t7.id=t3.id) SET g=0, h=0, i=0, c=0 where t7.id=1''
UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0, d=0 where t1.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0, d=0 where t1.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0, d=0 where t1.id=1''
UPDATE t1 LEFT JOIN (t4, t5, t6) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t6.id) SET a=0, d=0, e=0, f=0 where t1.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t5, t6) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t6.id) SET a=0, d=0, e=0, f=0 where t1.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN (t4, t5, t6) ON (t1.id=t4.id and t1.id=t5.id and t1.id=t6.id) SET a=0, d=0, e=0, f=0 where t1.id=1''
UPDATE t4 LEFT JOIN (t1, t5, t6) ON (t4.id=t1.id and t4.id=t5.id and t4.id=t6.id) SET a=0, e=0, f=0 where t4.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t4 LEFT JOIN (t1, t5, t6) ON (t4.id=t1.id and t4.id=t5.id and t4.id=t6.id) SET a=0, e=0, f=0 where t4.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t4 LEFT JOIN (t1, t5, t6) ON (t4.id=t1.id and t4.id=t5.id and t4.id=t6.id) SET a=0, e=0, f=0 where t4.id=1''
UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
+Last_SQL_Error = 'Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1''
[on slave]
show tables like 't%';
Tables_in_test (t%)
@@ -149,3 +114,4 @@ id c
3 3
[on master]
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_flush_logs.result b/mysql-test/suite/rpl/r/rpl_flush_logs.result
index 4c3352559c4..4fce91a7234 100644
--- a/mysql-test/suite/rpl/r/rpl_flush_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_flush_logs.result
@@ -1,20 +1,14 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
# Test if support 'flush error logs' statement.
flush error logs;
# Make sure binary logs was not be flushed
# after execute 'flush error logs' statement.
# Make sure relay logs was not be flushed
# after execute 'flush error logs' statement.
-# Make sure the 'slave-relay-bin.000004' file does not
-# exist before execute 'flush relay logs' statement.
# Test if support 'flush relay logs' statement.
flush relay logs;
-# Check the 'slave-relay-bin.000004' file is created
+# Check the 'slave-relay-bin.000003' file is created
# after executed 'flush relay logs' statement.
# Make sure binary logs was not be flushed
# after execute 'flush relay logs' statement.
@@ -36,20 +30,21 @@ flush engine logs;
flush binary logs;
# Check the 'master-bin.000002' file is created
# after executed 'flush binary logs' statement.
-# Make sure the 'slave-relay-bin.000007' file does not exist
+# Make sure the 'slave-relay-bin.000006' file does not exist
# exist before execute 'flush error logs, relay logs' statement.
# Test if support to combine all kinds of logs into one statement.
flush error logs, relay logs;
# Make sure binary logs was not be flushed
# after execute 'flush error logs, relay logs' statement.
-# Check the 'slave-relay-bin.000007' file is created after
+# Check the 'slave-relay-bin.000006' file is created after
# execute 'flush error logs, relay logs' statement.
-# Make sure the 'slave-relay-bin.000008' and 'slave-relay-bin.000009'
-# files do not exist before execute 'flush error logs, relay logs'
+# Make sure the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
+# files do not exist before execute 'flush error logs, relay logs'
# statement.
# Test if 'flush logs' statement works fine and flush all the logs.
flush logs;
# Check 'master-bin.000003' is created
# after execute 'flush logs' statement.
-# Check the 'slave-relay-bin.000008' and 'slave-relay-bin.000009'
+# Check the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
# files are created after execute 'flush logs' statement.
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
index 93e74c20e28..931335fb95c 100644
--- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
@@ -1,28 +1,16 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_init.inc [topology=1->2->1]
show variables like 'relay_log%';
Variable_name Value
-relay_log MYSQLD_DATADIR/relay-log
+relay_log
relay_log_index
relay_log_info_file relay-log.info
relay_log_purge ON
relay_log_recovery OFF
relay_log_space_limit 0
-stop slave;
-change master to master_host='127.0.0.1',master_user='root',
-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;
-include/start_slave.inc
CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM;
INSERT INTO t1 VALUE(1);
FLUSH LOGS;
INSERT INTO t1 VALUE(2);
-Checking that both slave threads are running.
-Relay_Log_File relay-log.000003
+include/check_slave_is_running.inc
+Relay_Log_File = 'mysqld-relay-bin.000003'
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
index 960833b85d8..f778e76adc0 100644
--- a/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (a INT AUTO_INCREMENT KEY) ENGINE=INNODB;
CREATE TABLE t2 (b INT AUTO_INCREMENT KEY, c INT, FOREIGN KEY(b) REFERENCES t1(a)) ENGINE=INNODB;
SET FOREIGN_KEY_CHECKS=0;
@@ -52,3 +48,4 @@ select count(*) from t1 /* must be zero */;
count(*)
0
drop table t2,t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_free_items.result b/mysql-test/suite/rpl/r/rpl_free_items.result
index 91c1e2aa6e5..416f597aebc 100644
--- a/mysql-test/suite/rpl/r/rpl_free_items.result
+++ b/mysql-test/suite/rpl/r/rpl_free_items.result
@@ -1,10 +1,7 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1 (a int);
create table t2 (a int);
drop table t1;
drop table t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_geometry.result b/mysql-test/suite/rpl/r/rpl_geometry.result
index 9b48dba4f22..7ec119c9ae8 100644
--- a/mysql-test/suite/rpl/r/rpl_geometry.result
+++ b/mysql-test/suite/rpl/r/rpl_geometry.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1(a varchar(100),
b multipoint not null,
c varchar(256));
@@ -16,3 +12,4 @@ b geometrycollection default null,
c decimal(10,0));
insert into t2(c) values (null);
drop table t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_get_lock.result b/mysql-test/suite/rpl/r/rpl_get_lock.result
index 2adda3cfc18..757ce9bba17 100644
--- a/mysql-test/suite/rpl/r/rpl_get_lock.result
+++ b/mysql-test/suite/rpl/r/rpl_get_lock.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table t1(n int);
insert into t1 values(get_lock("lock",2));
@@ -34,3 +30,4 @@ select is_free_lock(NULL);
is_free_lock(NULL)
NULL
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
index ba7db2d11e3..2997d4eb426 100644
--- a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
+++ b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
@@ -1,34 +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;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*");
call mtr.add_suppression("Slave I/O: .* failed with error: Lost connection to MySQL server at 'reading initial communication packet'");
call mtr.add_suppression("Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; .*");
call mtr.add_suppression("Slave I/O thread .* register on master");
-stop slave;
+include/stop_slave.inc
SET @@global.debug= "+d,'debug_lock.before_get_UNIX_TIMESTAMP'";
-start slave;
+include/start_slave.inc
slave is going to hang in get_master_version_and_clock
+include/rpl_stop_server.inc [server_number=1]
slave is unblocked
SET DEBUG_SYNC='now SIGNAL signal.get_unix_timestamp';
Check network error happened here
+include/wait_for_slave_io_error.inc [errno=1040, 1053, 2002, 2003, 2006, 2013]
set @@global.debug = "-d,'debug_lock.before_get_UNIX_TIMESTAMP'";
-stop slave;
+include/rpl_start_server.inc [server_number=1]
+include/wait_for_slave_param.inc [Slave_IO_Running]
+include/stop_slave.inc
SET @@global.debug= "+d,'debug_lock.before_get_SERVER_ID'";
-start slave;
+include/start_slave.inc
slave is going to hang in get_master_version_and_clock
+include/rpl_stop_server.inc [server_number=1]
slave is unblocked
SET DEBUG_SYNC='now SIGNAL signal.get_server_id';
Check network error happened here
+include/wait_for_slave_io_error.inc [errno=1040, 1053, 2002, 2003, 2006, 2013]
set @@global.debug = "-d,'debug_lock.before_get_SERVER_ID'";
+include/rpl_start_server.inc [server_number=1]
+include/wait_for_slave_param.inc [Slave_IO_Running]
set global debug= '';
-reset master;
-include/stop_slave.inc
-change master to master_port=SLAVE_PORT;
-start slave;
-*** must be having the replicate-same-server-id IO thread error ***
-Last_IO_Error = Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
SET DEBUG_SYNC= 'RESET';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_grant.result b/mysql-test/suite/rpl/r/rpl_grant.result
index 285d52b7678..4ec8c51a5dc 100644
--- a/mysql-test/suite/rpl/r/rpl_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_grant.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
**** On Master ****
CREATE USER dummy@localhost;
CREATE USER dummy1@localhost, dummy2@localhost;
@@ -41,3 +37,4 @@ user host
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
COUNT(*)
0
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result
index 05d37dc7d04..d4bdb77ef0b 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result
@@ -6,19 +6,19 @@ show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 5.000
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 4294968;
-ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
+ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds).
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 5.000
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 0.0009999;
Warnings:
-Warning 1624 The requested value for the heartbeat period is less than 1 msec. The period is reset to zero which means no heartbeats will be sending
+Warning 1703 The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled.
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 0.000
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 4294967;
Warnings:
-Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 4294967.000
@@ -30,7 +30,7 @@ reset slave;
set @@global.slave_net_timeout= 5;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 5.001;
Warnings:
-Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 5.001
@@ -42,7 +42,7 @@ Variable_name Slave_heartbeat_period
Value 4.000
set @@global.slave_net_timeout= 3 /* must be a warning */;
Warnings:
-Warning 1624 The current value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
reset slave;
drop table if exists t1;
set @@global.slave_net_timeout= 10;
@@ -52,10 +52,12 @@ Variable_name Slave_heartbeat_period
Value 0.500
start slave;
create table t1 (f1 int);
+include/check_slave_param.inc [Relay_Log_File]
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 0.500
A heartbeat has been received by the slave
drop table t1;
set @@global.slave_net_timeout= @restore_slave_net_timeout;
+include/stop_slave.inc
End of tests
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result b/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
index ecb7c62c488..e0e6df064b9 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
@@ -1,55 +1,41 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-
-*** Preparing ***
-[on slave]
+include/rpl_init.inc [topology=1->2,1->3]
+include/rpl_connect.inc [creating master]
+include/rpl_connect.inc [creating slave_1]
+include/rpl_connect.inc [creating slave_2]
include/stop_slave.inc
-RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1, MASTER_LOG_FILE='MASTER_BINLOG';
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 0.1;
include/start_slave.inc
-[on slave1]
-STOP SLAVE;
-RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='MASTER_BINLOG';
+include/stop_slave.inc
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 1;
include/start_slave.inc
-
-*** 2 slaves ***
Slave has received heartbeat event
-Slave1 has received heartbeat event
-Slave has received more heartbeats than Slave1 (1 means 'yes'): 1
+include/assert.inc [slave_1 should have received more heartbeats than slave_2]
-*** Master->data->Slave1->heartbeat->Slave: ***
-[on slave1]
-RESET MASTER;
-[on slave]
+include/rpl_stop_slaves.inc
+include/rpl_change_topology.inc [new topology=1->3->2]
+include/rpl_start_slaves.inc
include/stop_slave.inc
-RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=SLAVE1_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.2, MASTER_LOG_FILE='SLAVE1_BINLOG';
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
-Slave has received heartbeat event
+slave_1 has received heartbeat event
[on master]
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
INSERT INTO t1 VALUES (1, 'on master', '');
SHOW TABLES;
Tables_in_test
t1
-[on slave1]
+[on slave_2]
SHOW TABLES;
Tables_in_test
t1
-[on slave]
+[on slave_1]
SHOW TABLES;
Tables_in_test
[on master]
-creating updates on master and send to slave1 during 5 second
-[on slave]
-Slave has received heartbeats (1 means 'yes'): 1
+creating updates on master and send to slave_2 during 5 second
+[on slave_1]
+include/assert.inc [slave_1 should have received heartbeats]
*** Clean up ***
DROP TABLE t1;
-
-End of 6.0 test
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
index b54602663d8..93faf37053a 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
*** Preparing ***
include/stop_slave.inc
@@ -20,7 +16,7 @@ RESET SLAVE;
*** Reset slave affect ***
SET @@global.slave_net_timeout=30;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=5;
RESET SLAVE;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
@@ -28,7 +24,7 @@ Slave_heartbeat_period 15.000
*** Default value if slave_net_timeout changed ***
SET @@global.slave_net_timeout=50;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 25.000
@@ -38,19 +34,19 @@ RESET SLAVE;
*** Warning if updated slave_net_timeout < slave_heartbeat_timeout ***
SET @@global.slave_net_timeout=FLOOR(SLAVE_HEARTBEAT_TIMEOUT)-1;
Warnings:
-Warning 1624 The current value for master_heartbeat_period exceeds the new value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
RESET SLAVE;
*** Warning if updated slave_heartbeat_timeout > slave_net_timeout ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=SLAVE_NET_TIMEOUT;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=SLAVE_NET_TIMEOUT;
Warnings:
-Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
RESET SLAVE;
*** CHANGE MASTER statement only updates slave_heartbeat_period ***
SET @@global.slave_net_timeout=20;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=5;
SHOW VARIABLES LIKE 'slave_net_timeout';
Variable_name Value
slave_net_timeout 20
@@ -71,7 +67,7 @@ RESET SLAVE;
SET @@global.slave_net_timeout=500;
SET @@global.slave_net_timeout=200;
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20;
include/start_slave.inc
SHOW VARIABLES LIKE 'slave_net_timeout';
Variable_name Value
@@ -86,7 +82,7 @@ SET @@global.slave_net_timeout=@restore_slave_net_timeout;
*** Start/stop slave ***
SET @@global.slave_net_timeout=100;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=20;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=20;
include/start_slave.inc
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
@@ -98,15 +94,15 @@ Slave_heartbeat_period 20.000
*** Reload slave ***
SET @@global.slave_net_timeout=50;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=30;
-Reload slave
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=30;
+include/rpl_restart_server.inc [server_number=2]
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 30.000
SET @restore_slave_net_timeout=@@global.slave_net_timeout;
*** Disable heartbeat ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 0.000
@@ -133,50 +129,50 @@ Result
0
*** Min slave_heartbeat_timeout ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.001;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.001;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 0.001
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.0009;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.0009;
Warnings:
-Warning 1624 The requested value for the heartbeat period is less than 1 msec. The period is reset to zero which means no heartbeats will be sending
+Warning 1703 The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled.
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 0.000
RESET SLAVE;
*** Max slave_heartbeat_timeout ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=4294967;
Warnings:
-Warning 1624 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' sec. A sensible value for the period should be less than the timeout.
+Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 4294967.000
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294968;
-ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=4294968;
+ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds).
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=8589935;
-ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=8589935;
+ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds).
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967296;
-ERROR HY000: The requested value for the heartbeat period is negative or exceeds the maximum 4294967 seconds
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=4294967296;
+ERROR HY000: The requested value for the heartbeat period is either negative or exceeds the maximum allowed (4294967 seconds).
RESET SLAVE;
*** Misc incorrect values ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='-1';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD='-1';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''-1'' at line 1
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='123abc';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD='123abc';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''123abc'' at line 1
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD='';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''' at line 1
RESET SLAVE;
*** Running slave ***
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
Heartbeat event received
@@ -189,25 +185,29 @@ include/start_slave.inc
Heartbeat event received
*** Stopped IO thread ***
-STOP SLAVE IO_THREAD;
+include/stop_slave_io.inc
Number of received heartbeat events while io thread stopped: 0
*** Started IO thread ***
START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
Heartbeat event received
*** Stopped SQL thread ***
-STOP SLAVE SQL_THREAD;
+include/stop_slave_sql.inc
Heartbeat events are received while sql thread stopped (1 means 'yes'): 1
*** Started SQL thread ***
START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_start.inc
Heartbeat event received
*** Stopped SQL thread by error ***
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
INSERT INTO t1 VALUES (1, 'on slave', NULL);
INSERT INTO t1 VALUES (1, 'on master', NULL);
+call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
Heartbeat events are received while sql thread stopped (1 means 'yes'): 1
include/stop_slave.inc
DROP TABLE t1;
@@ -220,7 +220,7 @@ BEGIN
UPDATE test.t1 SET a = a + 1 WHERE a < 10;
END|
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=5;
include/start_slave.inc
SET @@global.event_scheduler=1;
Number of received heartbeat events: 0
@@ -233,7 +233,7 @@ RESET SLAVE;
DROP TABLE t1;
DROP TABLE t1;
RESET MASTER;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.5;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.5;
include/start_slave.inc
Heartbeat events are received while rotation of relay logs (1 means 'yes'): 1
@@ -242,7 +242,7 @@ SET @@global.slave_compressed_protocol=1;
include/stop_slave.inc
RESET SLAVE;
SET @@global.slave_compressed_protocol=1;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
Heartbeat event received
SET @@global.slave_compressed_protocol=0;
@@ -251,7 +251,7 @@ SET @@global.slave_compressed_protocol=0;
*** Reset master ***
STOP SLAVE;
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
RESET MASTER;
Heartbeat events are received after reset of master (1 means 'yes'): 1
@@ -259,21 +259,17 @@ Heartbeat events are received after reset of master (1 means 'yes'): 1
*** Reload master ***
STOP SLAVE;
RESET SLAVE;
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
Heartbeat event received
-Reload master
+include/rpl_restart_server.inc [server_number=1]
+include/wait_for_slave_io_to_start.inc
Heartbeat event received
*** Circular replication ***
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
include/stop_slave.inc
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=SLAVE_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='SLAVE_BINLOG';
+include/rpl_change_topology.inc [new topology=1->2->1]
include/start_slave.inc
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
INSERT INTO t1 VALUES(1, 'on master');
@@ -291,9 +287,6 @@ a b
Heartbeat event received on master
Heartbeat event received on slave
*** Clean up ***
-include/stop_slave.inc
DROP TABLE t1;
-include/stop_slave.inc
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
-
-End of tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
index 42de3c459cb..a73c99bd99b 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
*** Heartbeat over SSL ***
include/stop_slave.inc
@@ -23,5 +19,10 @@ Master_SSL_Allowed: Yes
Heartbeat event has received
*** Clean up ***
-
-End of 6.0 test
+include/stop_slave.inc
+CHANGE MASTER TO
+MASTER_SSL=0,
+MASTER_SSL_CA='',
+MASTER_SSL_CERT='',
+MASTER_SSL_KEY='';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result
index 5e37e7a1f5e..07c6db416b4 100644
--- a/mysql-test/suite/rpl/r/rpl_idempotency.result
+++ b/mysql-test/suite/rpl/r/rpl_idempotency.result
@@ -1,12 +1,9 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032");
-call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
-call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Slave SQL.*Can.t find record in .t[12].* Error_code: 1032");
+call mtr.add_suppression("Slave SQL.*Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
+call mtr.add_suppression("Slave SQL.*Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (-1),(-2),(-3);
@@ -33,8 +30,7 @@ SELECT * FROM t2 ORDER BY a;
a
-3
-1
-Last_SQL_Error
-0
+include/check_slave_no_error.inc
INSERT IGNORE INTO t1 VALUES (-2);
INSERT IGNORE INTO t1 VALUES (-2);
SELECT * FROM t1 ORDER BY a;
@@ -47,8 +43,7 @@ a
-3
-2
-1
-Last_SQL_Error
-0
+include/check_slave_no_error.inc
UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
UPDATE t1 SET a = 1 WHERE a = -1;
@@ -71,7 +66,7 @@ SELECT * FROM t2 ORDER BY a;
a
-3
1
-Last_SQL_Error
-0
+include/check_slave_no_error.inc
DROP TABLE t1, t2;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_grant.result b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
index 5169cc8e888..ae6d6ddfc8d 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
@@ -35,3 +31,4 @@ flush privileges;
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_revoke.result b/mysql-test/suite/rpl/r/rpl_ignore_revoke.result
index b1ccd2f0442..84e1a3b40c7 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_revoke.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_revoke.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
grant select on *.* to 'user_foo'@'%' identified by 'user_foopass';
revoke select on *.* from 'user_foo'@'%';
select select_priv from mysql.user where user='user_foo' /* master:must be N */;
@@ -28,3 +24,4 @@ Y
revoke select on *.* FROM 'user_foo';
delete from mysql.user where user="user_foo";
delete from mysql.user where user="user_foo";
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result
index d06dda66267..e5f39655c8d 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_table.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
**** Test case for BUG#16487 ****
**** Master ****
CREATE TABLE test.t4 (a int);
@@ -117,6 +113,7 @@ show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
set global slave_exec_mode='IDEMPOTENT';
+call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* Error_code: 1032");
drop table t1, mysqltest2.t2;
drop table t4;
drop database mysqltest2;
@@ -142,3 +139,4 @@ HEX(word)
SELECT * FROM tmptbl504451f4258$1;
ERROR 42S02: Table 'test.tmptbl504451f4258$1' doesn't exist
DROP TABLE t5;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table_update.result b/mysql-test/suite/rpl/r/rpl_ignore_table_update.result
index a88a3c690ed..c3882d0b98f 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_table_update.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table_update.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
use test;
drop table if exists mysqltest_foo;
drop table if exists mysqltest_bar;
@@ -21,3 +17,4 @@ n m k
4 15 55
drop table mysqltest_foo,mysqltest_bar,t1;
drop table mysqltest_foo,mysqltest_bar,t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_incident.result b/mysql-test/suite/rpl/r/rpl_incident.result
index 6c226aaf2f7..d528fb3297a 100644
--- a/mysql-test/suite/rpl/r/rpl_incident.result
+++ b/mysql-test/suite/rpl/r/rpl_incident.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
**** On Master ****
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
@@ -19,7 +15,9 @@ a
2
3
4
-Last_SQL_Error = The incident LOST_EVENTS occured on the master. Message: <none>
+call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master.* 1590");
+include/wait_for_slave_sql_error.inc [errno=1590]
+Last_SQL_Error = 'The incident LOST_EVENTS occured on the master. Message: <none>'
**** On Slave ****
SELECT * FROM t1;
a
@@ -34,5 +32,6 @@ a
2
3
4
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_init_slave.result b/mysql-test/suite/rpl/r/rpl_init_slave.result
index 908abf56c1f..fcf7114879c 100644
--- a/mysql-test/suite/rpl/r/rpl_init_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_init_slave.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
set global max_connections=151;
include/stop_slave.inc
include/start_slave.inc
@@ -25,6 +21,6 @@ set global init_connect="set @c=1";
show variables like 'init_connect';
Variable_name Value
init_connect set @c=1
-include/stop_slave.inc
set global init_connect= @my_global_init_connect;
set global max_connections= default;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_init_slave_errors.result b/mysql-test/suite/rpl/r/rpl_init_slave_errors.result
index c6ee82b13f3..a185afc5af2 100644
--- a/mysql-test/suite/rpl/r/rpl_init_slave_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_init_slave_errors.result
@@ -1,19 +1,19 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
stop slave;
reset slave;
SET GLOBAL debug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
-Reporting the following error: Failed during slave thread initialization
-call mtr.add_suppression("Failed during slave I/O thread initialization");
+include/wait_for_slave_sql_error.inc [errno=1593]
+Last_SQL_Error = 'Failed during slave thread initialization'
+call mtr.add_suppression("Failed during slave.* thread initialization");
SET GLOBAL debug= "";
-stop slave;
reset slave;
SET GLOBAL init_slave= "garbage";
start slave;
-Reporting the following error: Slave SQL thread aborted. Can't execute init_slave query
+include/wait_for_slave_sql_error.inc [errno=1064]
+Last_SQL_Error = 'Slave SQL thread aborted. Can't execute init_slave query'
SET GLOBAL init_slave= "";
+include/stop_slave_io.inc
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
index 6ad22c368b4..f8734b48295 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
use test;
CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
@@ -140,3 +136,4 @@ DROP PROCEDURE test.proc_byrange;
DROP TABLE test.regular_tbl;
DROP TABLE test.bykey_tbl;
DROP TABLE test.byrange_tbl;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
index abff02b4b07..d06e6681e81 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
use test;
CREATE TABLE test.regular_tbl(id MEDIUMINT NOT NULL AUTO_INCREMENT,
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
@@ -33,3 +29,4 @@ END|
CALL test.proc_norm();
DROP PROCEDURE test.proc_norm;
DROP TABLE test.regular_tbl;
+include/rpl_end.inc
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 549842198e8..36294a4333b 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==========MASTER==========
show global variables like 'binlog_format%';
Variable_name Value
@@ -157,3 +153,4 @@ master-bin.000001 # Query # # use `test_rpl`; CREATE INDEX index2 on t2 (d)
master-bin.000001 # Query # # use `test_rpl`; CREATE INDEX index3 on t2 (a, d)
master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t2 DROP COLUMN d
drop database test_rpl;
+include/rpl_end.inc
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 818a883a602..d89bce479e5 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==========MASTER==========
show global variables like 'binlog_format%';
Variable_name Value
@@ -1102,3 +1098,4 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
master-bin.000001 # Xid # # COMMIT /* XID */
drop database test_rpl;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert.result b/mysql-test/suite/rpl/r/rpl_insert.result
index 6080d18c5aa..b8e5bfad5d5 100644
--- a/mysql-test/suite/rpl/r/rpl_insert.result
+++ b/mysql-test/suite/rpl/r/rpl_insert.result
@@ -1,12 +1,8 @@
#
# Bug#20821: INSERT DELAYED fails to write some rows to binlog
#
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
CREATE TABLE t1 (id INT, name VARCHAR(64)) ENGINE=MyISAM;
@@ -21,3 +17,4 @@ COUNT(*)
#
USE test;
DROP SCHEMA mysqlslap;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_duplicate.result b/mysql-test/suite/rpl/r/rpl_insert_duplicate.result
new file mode 100644
index 00000000000..61ebbaaa5a9
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_insert_duplicate.result
@@ -0,0 +1,29 @@
+include/master-slave.inc
+[connection master]
+CREATE TABLE t1 (
+a INT UNSIGNED NOT NULL PRIMARY KEY
+) ENGINE=innodb;
+CREATE TABLE t2 (
+a INT UNSIGNED
+) ENGINE=innodb;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
+include/assert.inc [Sum of elements in t1 should be 1.]
+include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
+include/diff_tables.inc [master:test.t1 , slave:test.t1]
+drop table t1, t2;
+CREATE TABLE t1 (
+a INT UNSIGNED NOT NULL PRIMARY KEY
+) ENGINE=myisam;
+CREATE TABLE t2 (
+a INT UNSIGNED
+) ENGINE=myisam;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
+include/assert.inc [Sum of elements in t1 should be 1.]
+include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
+include/diff_tables.inc [master:test.t1 , slave:test.t1]
+drop table t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_id.result b/mysql-test/suite/rpl/r/rpl_insert_id.result
index f8a8e9eed32..05ef04e8a1d 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_id.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_id.result
@@ -1,21 +1,14 @@
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
#
# Setup
#
-use test;
-drop table if exists t1, t2, t3;
#
# See if queries that use both auto_increment and LAST_INSERT_ID()
# are replicated well
#
# We also check how the foreign_key_check variable is replicated
#
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
SET @old_concurrent_insert= @@global.concurrent_insert;
SET @@global.concurrent_insert= 0;
create table t1(a int auto_increment, key(a)) engine=myisam;
@@ -534,4 +527,4 @@ drop table t1, t2;
drop procedure foo;
SET @@global.concurrent_insert= @old_concurrent_insert;
set @@session.sql_auto_is_null=default;
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_id_pk.result b/mysql-test/suite/rpl/r/rpl_insert_id_pk.result
index 79815355332..c2d6d2c9b0c 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_id_pk.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_id_pk.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1(a int auto_increment, primary key(a));
create table t2(b int auto_increment, c int, primary key(b));
insert into t1 values (1),(2),(3);
@@ -74,3 +70,4 @@ SET FOREIGN_KEY_CHECKS=0;
INSERT INTO t1 VALUES (1),(1);
Got one of the listed errors
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_ignore.result b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
index e3e85c5e4c4..04b64359126 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_ignore.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
@@ -25,47 +21,36 @@ INSERT INTO t2 VALUES (4, 3);
INSERT INTO t2 VALUES (5, 4);
INSERT INTO t2 VALUES (6, 6);
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
-SELECT * FROM t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
-SELECT * FROM t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
-drop table t1;
+include/assert.inc [Count of elements in t1 should be 6.]
+include/diff_tables.inc [master:test.t1 , slave:test.t1]
+INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
+include/assert.inc [Count of elements in t1 should be 6.]
+include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
+drop table t1, t2;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned,
unique (b)
) ENGINE=myisam;
-INSERT INTO t1 VALUES (1, 1);
-INSERT INTO t1 VALUES (2, 2);
-INSERT INTO t1 VALUES (3, 3);
-INSERT INTO t1 VALUES (4, 4);
+CREATE TABLE t2 (
+a int unsigned, # to force INSERT SELECT to have a certain order
+b int unsigned
+) ENGINE=myisam;
+INSERT INTO t1 VALUES (NULL, 1);
+INSERT INTO t1 VALUES (NULL, 2);
+INSERT INTO t1 VALUES (NULL, 3);
+INSERT INTO t1 VALUES (NULL, 4);
+INSERT INTO t2 VALUES (1, 1);
+INSERT INTO t2 VALUES (2, 2);
+INSERT INTO t2 VALUES (3, 5);
+INSERT INTO t2 VALUES (4, 3);
+INSERT INTO t2 VALUES (5, 4);
+INSERT INTO t2 VALUES (6, 6);
+INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
+include/assert.inc [Count of elements in t1 should be 6.]
+include/diff_tables.inc [master:test.t1 , slave:test.t1]
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
-SELECT * FROM t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
-SELECT * FROM t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
+include/assert.inc [Count of elements in t1 should be 6.]
+include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
drop table t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_select.result b/mysql-test/suite/rpl/r/rpl_insert_select.result
index 1aff39e0026..d98ae2538fa 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_select.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_select.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1 (n int not null primary key);
insert into t1 values (1);
create table t2 (n int);
@@ -15,3 +11,4 @@ n
1
2
drop table t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_invoked_features.result b/mysql-test/suite/rpl/r/rpl_invoked_features.result
index be9169c785b..514483e7995 100644
--- a/mysql-test/suite/rpl/r/rpl_invoked_features.result
+++ b/mysql-test/suite/rpl/r/rpl_invoked_features.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
USE test;
DROP VIEW IF EXISTS v1,v11;
DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13;
@@ -447,3 +443,4 @@ DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
DROP EVENT IF EXISTS e1;
DROP EVENT IF EXISTS e11;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ip_mix.result b/mysql-test/suite/rpl/r/rpl_ip_mix.result
index ddd7a008a97..4d3999549b3 100644
--- a/mysql-test/suite/rpl/r/rpl_ip_mix.result
+++ b/mysql-test/suite/rpl/r/rpl_ip_mix.result
@@ -63,6 +63,4 @@ change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
-disconnect slave;
-disconnect master;
-connection default;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/r/rpl_ip_mix2.result b/mysql-test/suite/rpl/r/rpl_ip_mix2.result
index e1011bf85ee..3f536fc3efd 100644
--- a/mysql-test/suite/rpl/r/rpl_ip_mix2.result
+++ b/mysql-test/suite/rpl/r/rpl_ip_mix2.result
@@ -63,6 +63,4 @@ change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
-disconnect slave;
-disconnect master;
-connection default;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result
index 0393cfa483c..e1a0c6d4772 100644
--- a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result
+++ b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result
@@ -105,6 +105,4 @@ change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1';
Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1
-disconnect slave;
-disconnect master;
-connection default;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/r/rpl_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv6.result
index 6ae946d197b..04f0727b87f 100644
--- a/mysql-test/suite/rpl/r/rpl_ipv6.result
+++ b/mysql-test/suite/rpl/r/rpl_ipv6.result
@@ -60,6 +60,4 @@ change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
-disconnect slave;
-disconnect master;
-connection default;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/r/rpl_killed_ddl.result b/mysql-test/suite/rpl/r/rpl_killed_ddl.result
index c3cde16b9d2..a02c9b599bf 100644
--- a/mysql-test/suite/rpl/r/rpl_killed_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_killed_ddl.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP DATABASE IF EXISTS d1;
DROP DATABASE IF EXISTS d2;
DROP DATABASE IF EXISTS d3;
@@ -59,62 +55,62 @@ CREATE VIEW v1 AS SELECT a FROM t1 WHERE a < 100;
[on master1]
CREATE DATABASE d2;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP DATABASE d1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP DATABASE IF EXISTS d2;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE EVENT e2
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
DO INSERT INTO test.t1 VALUES (2);
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP EVENT e1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP EVENT IF EXISTS e2;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE FUNCTION f2 () RETURNS INT DETERMINISTIC
RETURN 1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
ALTER FUNCTION f1 SQL SECURITY INVOKER;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP FUNCTION f1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE PROCEDURE p2 (OUT rows INT)
BEGIN
SELECT COUNT(*) INTO rows FROM t2;
END;
//
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
ALTER PROCEDURE p1 SQL SECURITY INVOKER COMMENT 'return rows of table t1';
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP PROCEDURE p1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE TABLE t2 (b int);
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
ALTER TABLE t1 ADD (d int);
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
RENAME TABLE t3 TO t4;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE INDEX i2 on t1 (a);
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP INDEX i1 on t1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE TABLE IF NOT EXISTS t4 (a int);
CREATE TRIGGER tr2 BEFORE INSERT ON t4
FOR EACH ROW BEGIN
@@ -122,28 +118,28 @@ DELETE FROM t1 WHERE a=NEW.a;
END;
//
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP TRIGGER tr1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP TRIGGER IF EXISTS tr2;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
CREATE VIEW v2 AS SELECT a FROM t1 WHERE a > 100;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP VIEW v1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP VIEW IF EXISTS v2;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP TABLE t1;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP TABLE IF EXISTS t2;
source include/kill_query.inc;
-source include/diff_master_slave.inc;
+include/rpl_diff.inc
DROP DATABASE IF EXISTS d1;
DROP DATABASE IF EXISTS d2;
DROP DATABASE IF EXISTS d3;
@@ -168,3 +164,4 @@ DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
DROP PROCEDURE IF EXISTS p3;
DROP PROCEDURE IF EXISTS p4;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
index daefee9c669..43f5c082dea 100644
--- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
+++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
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;
@@ -11,14 +7,18 @@ SELECT * FROM t1;
a b
1 10
2 2
-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'
+call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432");
+include/wait_for_slave_sql_error.inc [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;
+include/wait_for_slave_to_stop.inc
reset slave;
reset master;
drop table t1;
start slave;
+include/wait_for_slave_to_start.inc
CREATE TABLE t1 (
id bigint(20) unsigned NOT NULL auto_increment,
field_1 int(10) unsigned NOT NULL,
@@ -56,12 +56,16 @@ id field_1 field_2 field_3
4 4 d 4d
5 5 e 5e
6 6 f 6f
-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)
+include/wait_for_slave_sql_error.inc [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'
+t1.field_3 = t2.field_c''
SELECT * FROM t1;
id field_1 field_2 field_3
drop table t1, t2;
drop table t1, t2;
+include/stop_slave_io.inc
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result
index 32ec2e624e2..621f3a1ddf5 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata.result
@@ -1,10 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
select last_insert_id();
last_insert_id()
0
@@ -32,32 +27,29 @@ drop table t3;
create table t1(a int, b int, unique(b));
insert into t1 values(1,10);
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
-set global sql_slave_skip_counter=1;
-start slave;
-Last_SQL_Errno=0
-Last_SQL_Error
-
+call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062");
+call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
+include/check_slave_no_error.inc
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
-stop slave;
+include/wait_for_slave_sql_error.inc [errno=1062]
+include/stop_slave_io.inc
change master to master_user='test';
change master to master_user='root';
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/check_slave_no_error.inc
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/rpl_loaddata.dat' into table t1;
+include/wait_for_slave_sql_error.inc [errno=1062]
stop slave;
reset slave;
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/check_slave_no_error.inc
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM;
@@ -80,18 +72,14 @@ load data infile '../../std_data/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'
+include/wait_for_slave_sql_error.inc [errno=0]
drop table t1, t2;
drop table t1, t2;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
LOAD DATA INFILE "../../std_data/words.dat" INTO TABLE t1;
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
-DROP TABLE IF EXISTS t1;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+DROP TABLE t1;
+include/rpl_reset.inc
drop database if exists b48297_db1;
drop database if exists b42897_db2;
create database b48297_db1;
@@ -112,15 +100,10 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
### disconnect and switch back to master connection
use b48297_db1;
-Comparing tables master:b48297_db1.t1 and slave:b48297_db1.t1
+include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1]
DROP DATABASE b48297_db1;
DROP DATABASE b42897_db2;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
@@ -132,3 +115,4 @@ Field 3 'Field 4'
'Field 5' 'Field 6'
Field 6 'Field 7'
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_charset.result b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
index e0971b84e3d..6b60bffa365 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1 (a varchar(10) character set utf8);
load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=koi8r;
@@ -76,3 +72,4 @@ E4B880E4BA8CE4B889
E59B9BE4BA94E585AD
E4B883E585ABE4B99D
DROP DATABASE mysqltest;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
index 9acc1ad93ac..b13e2ced183 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
@@ -1,14 +1,10 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,10);
LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1;
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Fatal error: Not enough memory
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
+call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, Error_code: 1593");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1593]
+Last_SQL_Error = 'Fatal error: Not enough memory'
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
index 4639c717cea..c34021b1fef 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_m.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest;
USE test;
CREATE TABLE t1(a INT, b INT, UNIQUE(b));
@@ -38,3 +34,4 @@ COUNT(*)
2
DROP DATABASE mysqltest;
DROP TABLE test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_map.result b/mysql-test/suite/rpl/r/rpl_loaddata_map.result
index 0588ae657ab..38e553e0117 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_map.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_map.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==== Create a big file ====
==== Load our big file into a table ====
create table t2 (id int not null primary key auto_increment);
@@ -31,3 +27,4 @@ count(*)
==== Clean up ====
[on master]
drop table t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_s.result b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
index 779a3af9631..351c5b584c5 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_s.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
reset master;
create table test.t1(a int, b int, unique(b));
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
@@ -13,3 +9,4 @@ count(*)
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
drop table test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_simple.result b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
index 5e3923616ed..24a1a35470d 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (word CHAR(20) NOT NULL);
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
SELECT * FROM t1 ORDER BY word;
@@ -151,3 +147,4 @@ Abernathy
aberrant
aberration
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result b/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result
index c7806f5ecce..c3b3c2232a6 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1(a int not null auto_increment, b int, primary key(a) );
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
select * from t1;
@@ -15,3 +11,4 @@ a b
1 10
2 15
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
index 6dccaa3d74c..902bc1cda00 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1(a int);
select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
truncate table t1;
@@ -78,7 +74,50 @@ LOAD/*!99999 special comments that do not expand */DATA/*!99999 code from the fu
SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER';
LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
[slave]
+
+Bug #59267:
+"LOAD DATA LOCAL INFILE not executed on slave with SBR"
+
+[master]
+SELECT * INTO OUTFILE 'MYSQLD_DATADIR/bug59267.sql' FROM t1;
+TRUNCATE TABLE t1;
+LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug59267.sql' INTO TABLE t1;
+SELECT 'Master', COUNT(*) FROM t1;
+Master COUNT(*)
+Master 44
+[slave]
+SELECT 'Slave', COUNT(*) FROM t1;
+Slave COUNT(*)
+Slave 44
[master]
DROP TABLE t1;
SET SESSION sql_mode=@old_mode;
[slave]
+
+Bug #60580/#11902767:
+"statement improperly replicated crashes slave sql thread"
+
+[master]
+CREATE TABLE t1(f1 INT, f2 INT);
+CREATE TABLE t2(f1 INT, f2 TIMESTAMP);
+INSERT INTO t2 VALUES(1, '2011-03-22 21:01:28');
+INSERT INTO t2 VALUES(2, '2011-03-21 21:01:28');
+INSERT INTO t2 VALUES(3, '2011-03-20 21:01:28');
+CREATE TABLE t3 AS SELECT * FROM t2;
+CREATE VIEW v1 AS SELECT * FROM t2
+WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL));
+SELECT 1 INTO OUTFILE 'MYSQLD_DATADIR/bug60580.csv' FROM DUAL;
+LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1);
+SELECT * FROM t1;
+f1 f2
+NULL NULL
+[slave]
+SELECT * FROM t1;
+f1 f2
+NULL NULL
+[master]
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+[slave]
+include/rpl_end.inc
+# End of 5.1 tests
diff --git a/mysql-test/suite/rpl/r/rpl_loadfile.result b/mysql-test/suite/rpl/r/rpl_loadfile.result
index 22f65c0b5e5..640d1f72bf5 100644
--- a/mysql-test/suite/rpl/r/rpl_loadfile.result
+++ b/mysql-test/suite/rpl/r/rpl_loadfile.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
@@ -225,11 +221,7 @@ aberration
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE test.t1;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
SELECT repeat('x',20) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_39701.data';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (t text);
@@ -240,6 +232,7 @@ END|
include/stop_slave.inc
CALL p('MYSQLTEST_VARDIR/tmp/bug_39701.data');
include/start_slave.inc
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
DROP PROCEDURE p;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_locale.result b/mysql-test/suite/rpl/r/rpl_locale.result
index b7396084663..1f6bd40cd16 100644
--- a/mysql-test/suite/rpl/r/rpl_locale.result
+++ b/mysql-test/suite/rpl/r/rpl_locale.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1 (s1 char(10));
set lc_time_names= 'de_DE';
insert into t1 values (date_format('2001-01-01','%W'));
@@ -18,3 +14,4 @@ s1
Montag
Monday
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result
index 7eec839e7cb..b8bf8b447d2 100644
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result
@@ -1,11 +1,5 @@
-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 if not exists t1 (n int);
-drop table t1;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary");
call mtr.add_suppression ("Error in Log_event::read_log_event");
show master status;
@@ -13,9 +7,11 @@ File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
include/stop_slave.inc
change master to master_log_pos=MASTER_LOG_POS;
+Read_Master_Log_Pos = '75'
start slave;
-Last_IO_Error = Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event'
-include/stop_slave.inc
+include/wait_for_slave_io_error.inc [errno=1236]
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master''
+include/stop_slave_sql.inc
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
@@ -32,3 +28,4 @@ n
3
drop table t1;
End of 5.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
index 9061abca477..23238d9c97b 100644
--- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
+++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
@@ -1,21 +1,18 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
FLUSH LOGS;
CREATE TABLE t1(c1 INT);
FLUSH LOGS;
call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log');
-Last_IO_Error
-Got fatal error 1236 from master when reading data from binary log: 'could not find next log'
+include/wait_for_slave_io_error.inc [errno=1236]
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log''
CREATE TABLE t2(c1 INT);
FLUSH LOGS;
CREATE TABLE t3(c1 INT);
FLUSH LOGS;
CREATE TABLE t4(c1 INT);
START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
SHOW TABLES;
Tables_in_test
t1
@@ -23,3 +20,4 @@ t2
t3
t4
DROP TABLE t1, t2, t3, t4;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_many_optimize.result b/mysql-test/suite/rpl/r/rpl_many_optimize.result
index b2148892591..53be9b48c7b 100644
--- a/mysql-test/suite/rpl/r/rpl_many_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_many_optimize.result
@@ -1,9 +1,6 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1 (a int not null auto_increment primary key, b int, key(b));
INSERT INTO t1 (a) VALUES (1),(2);
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
index edcae6e7506..bf4347757f7 100644
--- a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
+++ b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
select master_pos_wait('master-bin.999999',0,2);
master_pos_wait('master-bin.999999',0,2)
-1
@@ -22,3 +18,4 @@ show slave status;
select master_pos_wait('foo', 98);
master_pos_wait('foo', 98)
NULL
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_misc_functions.result b/mysql-test/suite/rpl/r/rpl_misc_functions.result
index 8e39aa0135a..61006ecd714 100644
--- a/mysql-test/suite/rpl/r/rpl_misc_functions.result
+++ b/mysql-test/suite/rpl/r/rpl_misc_functions.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT');
create table t1(id int, i int, r1 int, r2 int, p varchar(100));
insert into t1 values(1, connection_id(), 0, 0, "");
@@ -54,3 +50,4 @@ DROP TABLE t1, t1_slave;
DROP PROCEDURE test_replication_sp1;
DROP PROCEDURE test_replication_sp2;
DROP FUNCTION test_replication_sf;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mix_found_rows.result b/mysql-test/suite/rpl/r/rpl_mix_found_rows.result
index a3bc1934a70..40e80e23047 100644
--- a/mysql-test/suite/rpl/r/rpl_mix_found_rows.result
+++ b/mysql-test/suite/rpl/r/rpl_mix_found_rows.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==== Initialize ====
**** On Master ****
CREATE TABLE t1 (a INT);
@@ -136,3 +132,4 @@ DROP PROCEDURE just_log;
DROP PROCEDURE log_me;
DROP PROCEDURE log_me_inner;
DROP FUNCTION log_rows;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result
index ecc2987576c..0074d69ba15 100644
--- a/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result
+++ b/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
select @@global.binlog_format;
@@ -60,3 +56,4 @@ drop table t1;
FLUSH LOGS;
FLUSH LOGS;
End of 5.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
index 1ad34fbe961..14ed79680f1 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
@@ -1,10 +1,10 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
@@ -15,13 +15,11 @@ CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
Got one of the listed errors
*** Single statement on non-transactional table ***
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
*** Single statement on both transactional and non-transactional tables. ***
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
-source include/diff_master_slave.inc;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 2 - BEGIN - IMPLICIT COMMIT by DDL
########################################################################################
@@ -38,7 +36,7 @@ Got one of the listed errors
BEGIN;
Got one of the listed errors
Got one of the listed errors
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 3 - BEGIN - COMMIT
########################################################################################
@@ -50,7 +48,7 @@ Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 4 - BEGIN - ROLLBACK
########################################################################################
@@ -64,7 +62,7 @@ Got one of the listed errors
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 5 - PROCEDURE
########################################################################################
@@ -88,7 +86,7 @@ TRUNCATE TABLE t1;
BEGIN;
Got one of the listed errors
ROLLBACK;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 6 - XID
########################################################################################
@@ -103,7 +101,7 @@ ROLLBACK TO sv;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 7 - NON-TRANS TABLE
########################################################################################
@@ -118,7 +116,45 @@ COMMIT;
BEGIN;
Got one of the listed errors
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
+########################################################################
+# 8 - Bug#55375(Regression Bug) Transaction bigger than
+# max_binlog_cache_size crashes slave
+########################################################################
+# [ On Slave ]
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
+include/stop_slave.inc
+include/start_slave.inc
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
+TRUNCATE t1;
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+BEGIN;
+Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
+COMMIT;
+include/wait_for_slave_sql_error.inc [errno=1197]
+SELECT count(*) FROM t1;
+count(*)
+0
+show binlog events in 'slave-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+include/stop_slave.inc
+include/start_slave.inc
+SELECT count(*) FROM t1;
+count(*)
+128
########################################################################################
# CLEAN
########################################################################################
@@ -126,8 +162,6 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE IF EXISTS t4;
-DROP TABLE IF EXISTS t5;
-DROP TABLE IF EXISTS t6;
-Warnings:
-Note 1051 Unknown table 't6'
+DROP TABLE t5;
DROP PROCEDURE p1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result b/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
index f1b0b2ae5cb..2b5b31201cb 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
CREATE TABLE t1 (`bit_key` bit, `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
CREATE TABLE t2 (`bit_key` bit(4), `bit` bit, key (`bit_key` )) ENGINE=MyISAM;
@@ -30,3 +26,4 @@ DELETE FROM `t7` WHERE `bit` < 2 LIMIT 4;
INSERT INTO `t8` ( `bit` ) VALUES ( 0 );
DELETE FROM `t8` WHERE `bit` < 2 LIMIT 4;
DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
index 38806e2b66d..f24f34fa0bf 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1 (n int auto_increment primary key);
set insert_id = 2000;
insert into t1 values (NULL),(NULL),(NULL);
@@ -17,6 +13,7 @@ Server_id Host Port Master_id
2 127.0.0.1 9999 1
drop table t1;
stop slave;
+include/wait_for_slave_to_stop.inc
create table t2(id int auto_increment primary key, created datetime);
SET TIME_ZONE= '+03:00';
set timestamp=12345;
@@ -28,6 +25,7 @@ create table t3 like t2;
create temporary table t4 like t2;
create table t5 select * from t4;
start slave;
+include/wait_for_slave_to_start.inc
select * from t2;
id created
1 1970-01-01 06:25:45
@@ -45,3 +43,4 @@ t5 CREATE TABLE `t5` (
`created` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t2,t3,t5;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result
index b749778bcc2..541234fb5af 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -1563,3 +1559,4 @@ DROP TABLE IF EXISTS nt_1;
DROP TABLE IF EXISTS tt_2;
DROP TABLE IF EXISTS tt_1;
SET @commands= '';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result
index 7a5c6533641..baeefe7c6ea 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result
@@ -1,10 +1,5 @@
-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 session storage_engine=innodb;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -525,10 +520,8 @@ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db
###################################################################################
# CHECK CONSISTENCY
###################################################################################
-Comparing tables master:test.tt_1 and slave:test.tt_1
+include/diff_tables.inc [master:tt_1,slave:tt_1]
###################################################################################
# CLEAN
###################################################################################
-DROP TABLE tt_1;
-DROP TABLE tt_2;
-DROP TABLE nt_1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
index 5e42ca3d6da..5982d439a3e 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -11561,3 +11557,4 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_
###################################################################################
# CLEAN
###################################################################################
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_delete.result b/mysql-test/suite/rpl/r/rpl_multi_delete.result
index 4831502eb88..ea1d87a3960 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_delete.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_delete.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1 (a int primary key);
create table t2 (a int);
insert into t1 values (1);
@@ -20,3 +16,4 @@ select * from t2;
a
1
drop table t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_delete2.result b/mysql-test/suite/rpl/r/rpl_multi_delete2.result
index 8e6a6a3d4d0..c693a43a550 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_delete2.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_delete2.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
set sql_log_bin=0;
create database mysqltest_from;
set sql_log_bin=1;
@@ -42,3 +38,4 @@ set sql_log_bin=0;
drop database mysqltest_from;
set sql_log_bin=1;
drop database mysqltest_to;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_engine.result b/mysql-test/suite/rpl/r/rpl_multi_engine.result
index e26777c15ce..7815fa88c93 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_engine.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_engine.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop table if exists 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
@@ -360,3 +356,4 @@ id hex(b1) vc bc d f total y t
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
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_update.result b/mysql-test/suite/rpl/r/rpl_multi_update.result
index 524278be042..8634e86afed 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_update.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned
@@ -25,3 +21,4 @@ a b
2 1
UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
drop table t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_update2.result b/mysql-test/suite/rpl/r/rpl_multi_update2.result
index 5bb262764fa..a3cab693322 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_update2.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update2.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop table if exists t1,t2;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
@@ -53,3 +49,4 @@ select * from t1;
a
3
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_update3.result b/mysql-test/suite/rpl/r/rpl_multi_update3.result
index dba7f770ba2..6b9ec5c3947 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_update3.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update3.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
-------- Test for BUG#9361 --------
CREATE TABLE t1 (
@@ -195,3 +191,4 @@ idpro price nbprice
2 1.0000 2
3 2.0000 1
DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_update4.result b/mysql-test/suite/rpl/r/rpl_multi_update4.result
index f6dde65a35d..0c4857bed60 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_update4.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update4.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop database if exists d1;
drop database if exists d2;
drop database if exists d2;
@@ -23,3 +19,4 @@ id
0
drop database d1;
drop database d2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result b/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
index 26c3e545293..632529ce2b9 100644
--- a/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
+++ b/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
@@ -1,14 +1,12 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
CREATE DATABASE `#mysql50#mysqltest-1`;
Master position is not changed
STOP SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
Master position has been changed
DROP DATABASE `mysqltest-1`;
DROP DATABASE `#mysql50#mysqltest-1`;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_name_const.result b/mysql-test/suite/rpl/r/rpl_name_const.result
index acb2684d2c8..89a48bad09b 100644
--- a/mysql-test/suite/rpl/r/rpl_name_const.result
+++ b/mysql-test/suite/rpl/r/rpl_name_const.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==== Initialize ====
[on master]
create table t1 (id int);
@@ -26,3 +22,4 @@ id
[on master]
drop table t1;
drop procedure test_procedure;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
index 1f62ea7b100..9a72eba851f 100644
--- a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -11933,3 +11929,4 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_
###################################################################################
# CLEAN
###################################################################################
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
index 7390d5fd316..4106dc93198 100644
--- a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -13801,3 +13797,4 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_
###################################################################################
# CLEAN
###################################################################################
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
index 213a50f97ac..21031190660 100644
--- a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -11123,3 +11119,4 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_
###################################################################################
# CLEAN
###################################################################################
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result b/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result
index 1b7ac567936..ebbc657fcfd 100644
--- a/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result
+++ b/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT');
CREATE TABLE t1 (a VARCHAR(1000));
INSERT INTO t1 VALUES (CONNECTION_ID());
@@ -23,5 +19,6 @@ INSERT INTO t1 VALUES
(UTC_TIMESTAMP());
INSERT INTO t1 VALUES (RAND());
INSERT INTO t1 VALUES (LAST_INSERT_ID());
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_not_null_innodb.result b/mysql-test/suite/rpl/r/rpl_not_null_innodb.result
index b09fbab905a..1eaeaba05bb 100644
--- a/mysql-test/suite/rpl/r/rpl_not_null_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_not_null_innodb.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
SET SQL_LOG_BIN= 0;
CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
@@ -45,8 +41,8 @@ INSERT INTO t4(a,c) VALUES (4, 4);
INSERT INTO t4(a) VALUES (5);
************* SHOWING THE RESULT SETS WITH INSERTS *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
TABLES t2 and t3 must be different.
SELECT * FROM t3 ORDER BY a;
a b
@@ -80,7 +76,7 @@ UPDATE t1 set b= NULL, c= 300 where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
************* CLEANING *************
DROP TABLE t1;
DROP TABLE t2;
@@ -122,7 +118,7 @@ UPDATE t1 set b= NULL, c= b'00' where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
################################################################################
# NULL ---> NOT NULL (STRICT MODE)
@@ -200,3 +196,4 @@ a b c
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_not_null_myisam.result b/mysql-test/suite/rpl/r/rpl_not_null_myisam.result
index 09611dc6480..ec17e3bfafa 100644
--- a/mysql-test/suite/rpl/r/rpl_not_null_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_not_null_myisam.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
SET SQL_LOG_BIN= 0;
CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
@@ -45,8 +41,8 @@ INSERT INTO t4(a,c) VALUES (4, 4);
INSERT INTO t4(a) VALUES (5);
************* SHOWING THE RESULT SETS WITH INSERTS *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
TABLES t2 and t3 must be different.
SELECT * FROM t3 ORDER BY a;
a b
@@ -80,7 +76,7 @@ UPDATE t1 set b= NULL, c= 300 where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
************* CLEANING *************
DROP TABLE t1;
DROP TABLE t2;
@@ -122,7 +118,7 @@ UPDATE t1 set b= NULL, c= b'00' where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
################################################################################
# NULL ---> NOT NULL (STRICT MODE)
@@ -200,3 +196,4 @@ a b c
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_optimize.result b/mysql-test/suite/rpl/r/rpl_optimize.result
index 542e9dfd6cb..b606e47a55f 100644
--- a/mysql-test/suite/rpl/r/rpl_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_optimize.result
@@ -1,10 +1,5 @@
-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 tables if exists t1;
+include/master-slave.inc
+[connection master]
create table t1 (a int not null auto_increment primary key, b int, key(b));
INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
INSERT INTO t1 (a) SELECT null FROM t1;
@@ -26,3 +21,4 @@ optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result
index 1ec9259a1fb..6190f458367 100644
--- a/mysql-test/suite/rpl/r/rpl_packet.result
+++ b/mysql-test/suite/rpl/r/rpl_packet.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153");
call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:");
drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
@@ -33,22 +29,15 @@ include/stop_slave.inc
include/start_slave.inc
CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
-Slave_IO_Running = No (expect No)
-SELECT "Got a packet bigger than 'max_allowed_packet' bytes" AS Last_IO_Error;
-Last_IO_Error
-Got a packet bigger than 'max_allowed_packet' bytes
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/wait_for_slave_io_error.inc [errno=1153]
+Last_IO_Error = 'Got a packet bigger than 'max_allowed_packet' bytes'
+include/stop_slave_sql.inc
+include/rpl_reset.inc
+DROP TABLE t1;
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
-Slave_IO_Running = No (expect No)
-SELECT "Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master'" AS Last_IO_Error;
-Last_IO_Error
-Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master'
+include/wait_for_slave_io_error.inc [errno=1236]
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master''
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
@@ -60,5 +49,9 @@ SET @max_allowed_packet_2= @@session.max_allowed_packet;
==== clean up ====
DROP TABLE t1;
SET @@global.max_allowed_packet= 1024;
+Warnings:
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SET @@global.net_buffer_length= 1024;
DROP TABLE t1;
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_plugin_load.result b/mysql-test/suite/rpl/r/rpl_plugin_load.result
index 43e171a97c9..b33e29ef668 100644
--- a/mysql-test/suite/rpl/r/rpl_plugin_load.result
+++ b/mysql-test/suite/rpl/r/rpl_plugin_load.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
Verify that example engine is not installed.
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
@@ -33,4 +29,5 @@ Delta
Verify that example engine is not installed.
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
+include/rpl_end.inc
End of test
diff --git a/mysql-test/suite/rpl/r/rpl_ps.result b/mysql-test/suite/rpl/r/rpl_ps.result
index 89e822b3eb6..ca46f373610 100644
--- a/mysql-test/suite/rpl/r/rpl_ps.result
+++ b/mysql-test/suite/rpl/r/rpl_ps.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop table if exists t1;
create table t1(n char(30));
prepare stmt1 from 'insert into t1 values (?)';
@@ -26,6 +22,7 @@ from-master-2-'',
from-var-from-master-3
drop table t1;
stop slave;
+include/wait_for_slave_to_stop.inc
########################################################################
#
@@ -33,49 +30,22 @@ stop slave;
# 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;
DROP TABLE t1;
-
-
-# Connection: slave
-
-
-STOP SLAVE;
-
-########################################################################
-reset master;
-reset slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
index 7f43869c3b7..e41c16110dc 100644
--- a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
+++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
**** On Master ****
CREATE TABLE t1 (a INT, b LONG);
INSERT INTO t1 VALUES (1,1), (2,2);
@@ -30,3 +26,4 @@ slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
DROP TABLE IF EXISTS t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_read_only.result b/mysql-test/suite/rpl/r/rpl_read_only.result
index 971b20fcf3a..2f1f8cc1efb 100644
--- a/mysql-test/suite/rpl/r/rpl_read_only.result
+++ b/mysql-test/suite/rpl/r/rpl_read_only.result
@@ -1,10 +1,6 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-call mtr.add_suppression("Unsafe statement written to the binary log in statement format since BINLOG_FORMAT = STATEMENT");
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create user test;
create table t1(a int) engine=InnoDB;
create table t2(a int) engine=MyISAM;
@@ -31,15 +27,26 @@ a
2001
set global read_only=0;
BEGIN;
+BEGIN;
+select @@read_only;
+@@read_only
+0
+set global read_only=1;
+*** On SUPER USER connection ***
insert into t1 values(1002);
insert into t2 values(2002);
-BEGIN;
+*** On regular USER connection ***
insert into t1 values(1003);
+ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
insert into t2 values(2003);
-set global read_only=1;
+ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
+*** SUPER USER COMMIT (must succeed) ***
COMMIT;
+*** regular USER COMMIT (must succeed - nothing to commit) ***
COMMIT;
-ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
+select @@read_only;
+@@read_only
+1
set global read_only=0;
insert into t1 values(1004);
insert into t2 values(2004);
@@ -52,7 +59,6 @@ select * from t2;
a
2001
2002
-2003
2004
select * from t1;
a
@@ -63,7 +69,6 @@ select * from t2;
a
2001
2002
-2003
2004
set global read_only=1;
select @@read_only;
@@ -91,7 +96,6 @@ select * from t2;
a
2001
2002
-2003
2004
2005
select * from t1;
@@ -104,7 +108,6 @@ select * from t2;
a
2001
2002
-2003
2004
2005
insert into t1 values(1006);
@@ -115,3 +118,4 @@ drop user test;
drop table t1;
drop table t2;
set global read_only=0;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result b/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result
index 54aac2eca35..4f10ac50f9a 100644
--- a/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
SHOW VARIABLES LIKE 'relay_log_space_limit';
Variable_name Value
relay_log_space_limit 0
@@ -23,3 +19,4 @@ Andy 31 00000001
Jacob 2 00000002
Caleb 1 00000003
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result b/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result
index e8d2d63e46e..4c1a50b2f33 100644
--- a/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
SHOW VARIABLES LIKE 'relay_log_space_limit';
Variable_name Value
relay_log_space_limit 0
@@ -23,3 +19,4 @@ Andy 31 00000001
Jacob 2 00000002
Caleb 1 00000003
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_relayrotate.result b/mysql-test/suite/rpl/r/rpl_relayrotate.result
index 20f19973d83..ea00aee0085 100644
--- a/mysql-test/suite/rpl/r/rpl_relayrotate.result
+++ b/mysql-test/suite/rpl/r/rpl_relayrotate.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
stop slave;
create table t1 (a int) engine=innodb;
reset slave;
@@ -14,3 +10,4 @@ select max(a) from t1;
max(a)
8000
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_relayspace.result b/mysql-test/suite/rpl/r/rpl_relayspace.result
index bb4e672e7e5..fb21540aa31 100644
--- a/mysql-test/suite/rpl/r/rpl_relayspace.result
+++ b/mysql-test/suite/rpl/r/rpl_relayspace.result
@@ -1,19 +1,15 @@
-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;
+include/master-slave.inc
+[connection master]
+include/stop_slave.inc
create table t1 (a int);
drop table t1;
create table t1 (a int);
drop table t1;
reset slave;
start slave io_thread;
-stop slave io_thread;
+include/wait_for_slave_param.inc [Slave_IO_State]
+include/stop_slave_io.inc
reset slave;
-start slave;
-select master_pos_wait('MASTER_LOG_FILE',200,30)=-1;
-master_pos_wait('MASTER_LOG_FILE',200,30)=-1
-0
+include/start_slave.inc
+include/assert.inc [Assert that master_pos_wait does not timeout nor it returns NULL]
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_replicate_do.result b/mysql-test/suite/rpl/r/rpl_replicate_do.result
index 637047a883b..6f85fc15b1e 100644
--- a/mysql-test/suite/rpl/r/rpl_replicate_do.result
+++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop table if exists t11;
drop table if exists t11;
create table t2 (n int);
@@ -26,7 +22,7 @@ n
select * from t11;
ERROR 42S02: Table 'test.t11' doesn't exist
drop table if exists t1,t2,t11;
-Replicate_Do_Table test.t1
+Replicate_Do_Table = 'test.t1'
create table t1 (ts timestamp);
set one_shot time_zone='met';
insert into t1 values('2005-08-12 00:00:00');
@@ -73,3 +69,4 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
*** master ***
drop table t1;
drop table t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result b/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result
index 0135804c02d..f0c46b0b966 100644
--- a/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result
+++ b/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
drop database if exists mysqltest2;
create database mysqltest1;
@@ -21,3 +17,4 @@ a
1
drop database mysqltest1;
drop database mysqltest2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_report.result b/mysql-test/suite/rpl/r/rpl_report.result
index e129d7c8f22..b979d1faf5d 100644
--- a/mysql-test/suite/rpl/r/rpl_report.result
+++ b/mysql-test/suite/rpl/r/rpl_report.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
select * from Information_schema.GLOBAL_VARIABLES where variable_name like 'report_host';
VARIABLE_NAME VARIABLE_VALUE
REPORT_HOST 127.0.0.1
@@ -31,3 +27,4 @@ Value my_password
set @@global.report_host='my.new.address.net';
ERROR HY000: Variable 'report_host' is a read only variable
end of tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
index dae72d83b51..12071faecfd 100644
--- a/mysql-test/suite/rpl/r/rpl_rewrt_db.result
+++ b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
@@ -219,3 +215,4 @@ DROP DATABASE database_slave_temp_01;
DROP DATABASE database_slave_temp_02;
DROP DATABASE database_slave_temp_03;
SET sql_log_bin= 1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
index f529170d05e..279ab88bde3 100644
--- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
@@ -1,5 +1,3 @@
-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;
@@ -10,13 +8,14 @@ reset slave;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
reset master;
start slave;
+include/wait_for_slave_to_start.inc
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');
-Master_Log_File master-bin.000001
-Relay_Master_Log_File master-bin.000001
-Checking that both slave threads are running.
+Master_Log_File = 'master-bin.000001'
+Relay_Master_Log_File = 'master-bin.000001'
+include/check_slave_is_running.inc
select * from t1;
s
Could not break slave
@@ -38,8 +37,8 @@ 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;
+call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* Error_code: 1062");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
purge master logs to 'master-bin.000002';
show master logs;
Log_name master-bin.000002
@@ -57,9 +56,9 @@ show binary logs;
Log_name File_size
master-bin.000003 #
insert into t2 values (65);
-Master_Log_File master-bin.000003
-Relay_Master_Log_File master-bin.000003
-Checking that both slave threads are running.
+Master_Log_File = 'master-bin.000003'
+Relay_Master_Log_File = 'master-bin.000003'
+include/check_slave_is_running.inc
select * from t2;
m
34
@@ -91,7 +90,7 @@ a
testing temporary tables part 2
Master_Log_File master-bin.000009
Relay_Master_Log_File master-bin.000009
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
lock tables t3 read;
select count(*) from t3 where n >= 4;
count(*)
@@ -106,3 +105,4 @@ 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
+include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_001.result b/mysql-test/suite/rpl/r/rpl_row_001.result
index 0d682eb82e1..b5f6aea9698 100644
--- a/mysql-test/suite/rpl/r/rpl_row_001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_001.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (word CHAR(20) NOT NULL);
LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
@@ -53,3 +49,4 @@ SELECT n FROM t1;
n
3456
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_4_bytes.result b/mysql-test/suite/rpl/r/rpl_row_4_bytes.result
index e2431364ed3..ef9602204a1 100644
--- a/mysql-test/suite/rpl/r/rpl_row_4_bytes.result
+++ b/mysql-test/suite/rpl/r/rpl_row_4_bytes.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
@@ -25,3 +21,4 @@ ABE
ANG
LIL
DROP DATABASE mysqltest1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_NOW.result b/mysql-test/suite/rpl/r/rpl_row_NOW.result
index 23f95878608..eb6271d6e93 100644
--- a/mysql-test/suite/rpl/r/rpl_row_NOW.result
+++ b/mysql-test/suite/rpl/r/rpl_row_NOW.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create database if not exists mysqltest1;
DROP TABLE IF EXISTS mysqltest1.t1;
CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT,
@@ -27,3 +23,4 @@ INSERT INTO mysqltest1.t1 SET n = NULL, a = now();
DROP TABLE IF EXISTS mysqltest1.t1;
DROP FUNCTION mysqltest1.f1;
DROP DATABASE mysqltest1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_USER.result b/mysql-test/suite/rpl/r/rpl_row_USER.result
index 98755fb4653..5298395da20 100644
--- a/mysql-test/suite/rpl/r/rpl_row_USER.result
+++ b/mysql-test/suite/rpl/r/rpl_row_USER.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1;
CREATE USER tester IDENTIFIED BY 'test';
@@ -36,3 +32,4 @@ REVOKE ALL ON mysqltest1.* FROM 'tester'@'%';
REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
DROP USER tester@'%';
DROP USER ''@'localhost%';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_UUID.result b/mysql-test/suite/rpl/r/rpl_row_UUID.result
index 02174a7ecae..b7d3f8914e0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_UUID.result
+++ b/mysql-test/suite/rpl/r/rpl_row_UUID.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
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;
@@ -38,3 +34,4 @@ DROP PROCEDURE test.p1;
DROP FUNCTION test.fn1;
DROP TABLE test.t1;
DROP TABLE test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
index 1051d907b26..9f973bbe80e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE DATABASE test_ignore;
**** On Master ****
SHOW DATABASES;
@@ -48,11 +44,10 @@ 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;
+USE test;
+DROP TABLE t1;
+USE test;
+include/rpl_reset.inc
CREATE TABLE t1 (a INT);
DELETE FROM t1;
INSERT INTO t1 VALUES (1),(2);
@@ -67,13 +62,10 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
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;
+include/rpl_reset.inc
**** On Slave ****
SET GLOBAL QUERY_CACHE_SIZE=0;
+call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* Error_code: 1032");
**** On Master ****
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
@@ -105,12 +97,9 @@ a
8
9
SET GLOBAL QUERY_CACHE_SIZE=0;
+DROP TABLE t1;
================ 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;
+include/rpl_reset.inc
CREATE TABLE t1 (a BIT(1), b INT) ENGINE=MYISAM;
INSERT INTO t1 VALUES(1,2);
SELECT HEX(a),b FROM t1;
@@ -128,11 +117,7 @@ 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;
+include/rpl_reset.inc
**** 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;
@@ -249,13 +234,8 @@ a b
3 1
4 4
drop table t1,t2;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
**** On Master ****
-SET SESSION BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT PRIMARY KEY, b SET('master','slave'));
INSERT INTO t1 VALUES (1,'master,slave'), (2,'master,slave');
**** On Slave ****
@@ -279,6 +259,6 @@ SELECT * FROM t1 ORDER BY a;
a b
2 master,slave
5 slave
-DROP TABLE t1;
**** On Master ****
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
index 350ce0ac2c9..c864850a238 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'MYISAM' ;
SELECT * FROM t1;
C1 C2
@@ -422,11 +418,7 @@ a b c
**** Test for BUG#31552 ****
**** On Master ****
DELETE FROM t1;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
**** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master ****
@@ -436,7 +428,7 @@ DELETE FROM t1;
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
set @@global.slave_exec_mode= default;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
**** Test for BUG#37076 ****
@@ -480,47 +472,43 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
[expecting slave to replicate correctly]
INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
[expecting slave to replicate correctly]
INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032");
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, Error_code: 1677");
+include/rpl_reset.inc
[expecting slave to replicate correctly]
INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
-Comparing tables master:test.t4 and slave:test.t4
+include/diff_tables.inc [master:t4, slave:t4]
[expecting slave to stop]
INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)'
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1677 ]
+Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)''
+include/rpl_reset.inc
[expecting slave to stop]
INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
-Last_SQL_Error = Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)'
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1677 ]
+Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)''
+include/rpl_reset.inc
[expecting slave to replicate correctly]
INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
-Comparing tables master:test.t7 and slave:test.t7
+include/diff_tables.inc [master:t7, slave:t7]
drop table t1, t2, t3, t4, t5, t6, t7;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='MYISAM' ;
INSERT INTO t1 VALUES (1), (2), (3);
UPDATE t1 SET a = 10;
ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
INSERT INTO t1 VALUES (4);
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
drop table t1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
@@ -574,7 +562,7 @@ ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
*** results: t2 must be consistent ****
-Comparing tables master:test.t2 and master:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1, t2;
EOF OF TESTS
CREATE TABLE t1 (a int) ENGINE='MYISAM' ;
@@ -590,7 +578,7 @@ UPDATE t1 SET a = 9 WHERE a < 3;
INSERT INTO t1 ( a ) VALUES ( 3 );
UPDATE t1 SET a = 0 WHERE a < 4;
UPDATE t1 SET a = 8 WHERE a < 5;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
drop table t1;
CREATE TABLE t1 (a bit) ENGINE='MYISAM' ;
INSERT IGNORE INTO t1 VALUES (NULL);
@@ -632,5 +620,6 @@ DELETE FROM t1 WHERE a < 3 LIMIT 0;
UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
INSERT INTO t1 ( a ) VALUES ( 1 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
index 59441ac5684..0e00695500c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'INNODB' ;
SELECT * FROM t1;
C1 C2
@@ -425,11 +421,7 @@ a b c
**** Test for BUG#31552 ****
**** On Master ****
DELETE FROM t1;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
**** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master ****
@@ -439,7 +431,7 @@ DELETE FROM t1;
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
set @@global.slave_exec_mode= default;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
**** Test for BUG#37076 ****
@@ -483,47 +475,43 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
[expecting slave to replicate correctly]
INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
[expecting slave to replicate correctly]
INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* Error_code: 1032");
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, Error_code: 1677");
+include/rpl_reset.inc
[expecting slave to replicate correctly]
INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
-Comparing tables master:test.t4 and slave:test.t4
+include/diff_tables.inc [master:t4, slave:t4]
[expecting slave to stop]
INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)'
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1677 ]
+Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)''
+include/rpl_reset.inc
[expecting slave to stop]
INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
-Last_SQL_Error = Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)'
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1677 ]
+Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)''
+include/rpl_reset.inc
[expecting slave to replicate correctly]
INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
-Comparing tables master:test.t7 and slave:test.t7
+include/diff_tables.inc [master:t7, slave:t7]
drop table t1, t2, t3, t4, t5, t6, t7;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='INNODB' ;
INSERT INTO t1 VALUES (1), (2), (3);
UPDATE t1 SET a = 10;
ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
INSERT INTO t1 VALUES (4);
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
drop table t1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
@@ -577,7 +565,7 @@ ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
*** results: t2 must be consistent ****
-Comparing tables master:test.t2 and master:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1, t2;
EOF OF TESTS
CREATE TABLE t1 (a int) ENGINE='INNODB' ;
@@ -593,7 +581,7 @@ UPDATE t1 SET a = 9 WHERE a < 3;
INSERT INTO t1 ( a ) VALUES ( 3 );
UPDATE t1 SET a = 0 WHERE a < 4;
UPDATE t1 SET a = 8 WHERE a < 5;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
drop table t1;
SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY';
@@ -638,5 +626,6 @@ UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
INSERT INTO t1 ( a ) VALUES ( 1 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
index 3443e704031..c7241c52353 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t1;
SET @@BINLOG_FORMAT = ROW;
SELECT @@BINLOG_FORMAT;
@@ -717,3 +713,4 @@ COUNT(*)
4
DELETE FROM t1;
DROP TABLE IF EXISTS t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
index 6e47f747a79..077199a0c93 100644
--- a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
@@ -1,10 +1,10 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
@@ -15,13 +15,11 @@ CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
Got one of the listed errors
*** Single statement on non-transactional table ***
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
*** Single statement on both transactional and non-transactional tables. ***
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 2;
-START SLAVE SQL_THREAD;
-source include/diff_master_slave.inc;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 2 - BEGIN - IMPLICIT COMMIT by DDL
########################################################################################
@@ -39,9 +37,7 @@ Got one of the listed errors
BEGIN;
Got one of the listed errors
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 3 - BEGIN - COMMIT
########################################################################################
@@ -53,7 +49,7 @@ Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 4 - BEGIN - ROLLBACK
########################################################################################
@@ -67,7 +63,7 @@ Got one of the listed errors
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 5 - PROCEDURE
########################################################################################
@@ -91,7 +87,7 @@ TRUNCATE TABLE t1;
BEGIN;
Got one of the listed errors
ROLLBACK;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 6 - XID
########################################################################################
@@ -106,7 +102,7 @@ ROLLBACK TO sv;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 7 - NON-TRANS TABLE
########################################################################################
@@ -121,7 +117,45 @@ COMMIT;
BEGIN;
Got one of the listed errors
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
+########################################################################
+# 8 - Bug#55375(Regression Bug) Transaction bigger than
+# max_binlog_cache_size crashes slave
+########################################################################
+# [ On Slave ]
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
+include/stop_slave.inc
+include/start_slave.inc
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
+TRUNCATE t1;
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+BEGIN;
+Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
+COMMIT;
+include/wait_for_slave_sql_error.inc [errno=1534]
+SELECT count(*) FROM t1;
+count(*)
+0
+show binlog events in 'slave-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+include/stop_slave.inc
+include/start_slave.inc
+SELECT count(*) FROM t1;
+count(*)
+128
########################################################################################
# CLEAN
########################################################################################
@@ -129,10 +163,6 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE IF EXISTS t4;
-Warnings:
-Note 1051 Unknown table 't4'
-DROP TABLE IF EXISTS t5;
-DROP TABLE IF EXISTS t6;
-Warnings:
-Note 1051 Unknown table 't6'
+DROP TABLE t5;
DROP PROCEDURE p1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
index 055efffbd6a..4fb33dc4b6b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
***** Table Create Section ****
@@ -154,3 +150,4 @@ c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
index 055efffbd6a..4fb33dc4b6b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
***** Table Create Section ****
@@ -154,3 +150,4 @@ c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result
index 0ef47b8752d..487cddc2051 100644
--- a/mysql-test/suite/rpl/r/rpl_row_colSize.result
+++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t1;
**** Testing WL#3228 changes. ****
*** Create "wider" table on slave ***
@@ -18,7 +14,8 @@ CREATE TABLE t1 (a DECIMAL(20, 10));
RESET MASTER;
INSERT INTO t1 VALUES (901251.90125);
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -34,7 +31,8 @@ CREATE TABLE t1 (a DECIMAL(27, 18));
RESET MASTER;
INSERT INTO t1 VALUES (901251.90125);
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'decimal(27,18)' to type 'decimal(27,9)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'decimal(27,18)' to type 'decimal(27,9)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -50,7 +48,8 @@ CREATE TABLE t1 (a NUMERIC(20, 10));
RESET MASTER;
INSERT INTO t1 VALUES (901251.90125);
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -67,7 +66,8 @@ CREATE TABLE t1 (a FLOAT(47));
RESET MASTER;
INSERT INTO t1 VALUES (901251.90125);
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'double' to type 'float'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'double' to type 'float''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -84,7 +84,8 @@ CREATE TABLE t1 (a BIT(64));
RESET MASTER;
INSERT INTO t1 VALUES (B'10101');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'bit(64)' to type 'bit(5)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'bit(64)' to type 'bit(5)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -100,7 +101,8 @@ CREATE TABLE t1 (a BIT(12));
RESET MASTER;
INSERT INTO t1 VALUES (B'10101');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'bit(12)' to type 'bit(11)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'bit(12)' to type 'bit(11)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -117,7 +119,8 @@ CREATE TABLE t1 (a SET('1','2','3','4','5','6','7','8','9'));
RESET MASTER;
INSERT INTO t1 VALUES ('4');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'set' to type 'set('4')'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'set' to type 'set('4')''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -134,7 +137,8 @@ CREATE TABLE t1 (a CHAR(20));
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'char(20)' to type 'char(10)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'char(20)' to type 'char(10)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -182,7 +186,8 @@ CREATE TABLE t1 (a ENUM(
RESET MASTER;
INSERT INTO t1 VALUES ('44');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'enum' to type 'enum('44','54')'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'enum' to type 'enum('44','54')''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -199,7 +204,8 @@ CREATE TABLE t1 (a VARCHAR(2000));
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(100)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(100)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -215,7 +221,8 @@ CREATE TABLE t1 (a VARCHAR(200));
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'varchar(200)' to type 'varchar(10)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(200)' to type 'varchar(10)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -231,7 +238,8 @@ CREATE TABLE t1 (a VARCHAR(2000));
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(1000)'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(1000)''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -248,7 +256,8 @@ CREATE TABLE t1 (a LONGBLOB);
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
START SLAVE;
-Last_SQL_Error = Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob'
+include/wait_for_slave_sql_error.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob''
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -256,5 +265,8 @@ STOP SLAVE;
RESET SLAVE;
RESET MASTER;
START SLAVE;
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 0 ...e mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* Error_code: 1677");
*** Cleanup ***
DROP TABLE IF EXISTS t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_conflicts.result b/mysql-test/suite/rpl/r/rpl_row_conflicts.result
index 90ccae5d738..b42ff0c3b17 100644
--- a/mysql-test/suite/rpl/r/rpl_row_conflicts.result
+++ b/mysql-test/suite/rpl/r/rpl_row_conflicts.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: .*");
[on slave]
SET @old_slave_exec_mode= @@global.slave_exec_mode;
@@ -24,14 +20,17 @@ a
1
[on slave]
---- Wait until slave stops with an error ----
+include/wait_for_slave_sql_error.inc [errno=1062]
Last_SQL_Error (expected "duplicate key" error)
Could not execute Write_rows event on table test.t1; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log master-bin.000001, end_log_pos END_LOG_POS
+call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
SELECT * FROM t1;
a
1
---- Resolve the conflict on the slave and restart SQL thread ----
DELETE FROM t1 WHERE a = 1;
START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_start.inc
---- Sync slave and verify that there is no error ----
Last_SQL_Error = '' (expected no error)
SELECT * FROM t1;
@@ -51,12 +50,16 @@ SELECT * FROM t1;
a
[on slave]
---- Wait until slave stops with an error ----
-Last_SQL_Error = Could not execute Delete_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos 983 (expected "can't find record" error)
+call mtr.add_suppression("Slave SQL.*Can.t find record in .t1., Error_code: 1032");
+include/wait_for_slave_sql_error.inc [errno=1032]
+Last_SQL_Error (expected "duplicate key" error)
+Could not execute Delete_rows event on table test.t1; Can't find record in 't1', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log master-bin.000001, end_log_pos END_LOG_POS
SELECT * FROM t1;
a
---- Resolve the conflict on the slave and restart SQL thread ----
INSERT INTO t1 VALUES (1);
START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_start.inc
---- Sync slave and verify that there is no error ----
Last_SQL_Error = (expected no error)
SELECT * FROM t1;
@@ -65,6 +68,7 @@ a
[on master]
DROP TABLE t1;
[on slave]
+include/rpl_reset.inc
######## Run with slave_exec_mode=IDEMPOTENT ########
set @@global.slave_exec_mode= 'IDEMPOTENT';
==== Initialize ====
@@ -108,3 +112,4 @@ a
DROP TABLE t1;
[on slave]
SET @@global.slave_exec_mode= @old_slave_exec_mode;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result b/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result
index 90b68428008..4575588b1ef 100644
--- a/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result
+++ b/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1(a int not null primary key) engine=myisam;
insert delayed into t1 values (1);
insert delayed into t1 values (2);
@@ -20,3 +16,4 @@ a
2
3
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_drop.result b/mysql-test/suite/rpl/r/rpl_row_drop.result
index 402d20e469b..be7b2d16a0b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_drop.result
+++ b/mysql-test/suite/rpl/r/rpl_row_drop.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
**** On Master ****
CREATE TABLE t1 (a int);
CREATE TABLE t2 (a int);
@@ -55,3 +51,4 @@ t2
SHOW TABLES;
Tables_in_test
t2
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
index a0b7f74fea4..db38c2d8005 100644
--- a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -1628,3 +1624,4 @@ DROP TABLE IF EXISTS nt_1;
DROP TABLE IF EXISTS tt_2;
DROP TABLE IF EXISTS tt_1;
SET @commands= '';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_find_row.result b/mysql-test/suite/rpl/r/rpl_row_find_row.result
index 69516b47b7d..fff1f1b0c35 100644
--- a/mysql-test/suite/rpl/r/rpl_row_find_row.result
+++ b/mysql-test/suite/rpl/r/rpl_row_find_row.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
SET SQL_LOG_BIN=0;
CREATE TABLE t (a int, b int, c int, key(b));
SET SQL_LOG_BIN=1;
@@ -12,27 +8,18 @@ INSERT INTO t VALUES (1,2,4);
INSERT INTO t VALUES (4,3,4);
DELETE FROM t;
DROP TABLE t;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t (a int, b int, c int, key(b));
ALTER TABLE t DISABLE KEYS;
INSERT INTO t VALUES (1,2,4);
INSERT INTO t VALUES (4,3,4);
DELETE FROM t;
DROP TABLE t;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 INT NOT NULL, c2 INT NOT NULL, c3 INT, UNIQUE KEY(c1,c3), KEY(c2));
INSERT INTO t1(c1,c2) VALUES(1,1);
INSERT INTO t1(c1,c2) VALUES(1,2);
UPDATE t1 SET c1=1000 WHERE c2=2;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
index fe2fb1d9da2..6b8d8b9407e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
@@ -1,10 +1,6 @@
-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=MyISAM;
+include/master-slave.inc
+[connection master]
+create table t1 (a int);
insert into t1 values (10);
create table t2 (a int) ENGINE=MyISAM;
create table t3 (a int) engine=merge union(t1);
@@ -21,10 +17,13 @@ flush tables;
select * from t3;
a
stop slave;
+include/wait_for_slave_to_stop.inc
drop table t1;
flush tables with read lock;
start slave;
+include/wait_for_slave_to_start.inc
stop slave;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;
drop table t3, t4, t5;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_func001.result b/mysql-test/suite/rpl/r/rpl_row_func001.result
index b20f3f724d0..74a053abb26 100644
--- a/mysql-test/suite/rpl/r/rpl_row_func001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func001.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP FUNCTION test.f1;
DROP TABLE IF EXISTS test.t1;
create table test.t1 (a int, PRIMARY KEY(a));
@@ -28,3 +24,4 @@ a
2
DROP FUNCTION test.f1;
DROP TABLE test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_func002.result b/mysql-test/suite/rpl/r/rpl_row_func002.result
index 03f5b3115c3..69a732048b2 100644
--- a/mysql-test/suite/rpl/r/rpl_row_func002.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func002.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP FUNCTION test.f1;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@@ -24,3 +20,4 @@ INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
DROP FUNCTION test.f1;
DROP TABLE test.t1;
DROP TABLE test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_func003.result b/mysql-test/suite/rpl/r/rpl_row_func003.result
index 94d01b50ce5..cdc5bf6afba 100644
--- a/mysql-test/suite/rpl/r/rpl_row_func003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func003.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
DROP FUNCTION IF EXISTS test.f1;
DROP TABLE IF EXISTS test.t1;
@@ -28,3 +24,4 @@ ROLLBACK;
SET AUTOCOMMIT=1;
DROP FUNCTION test.f1;
DROP TABLE test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_idempotency.result b/mysql-test/suite/rpl/r/rpl_row_idempotency.result
index fcc68cd4712..20afcd0a393 100644
--- a/mysql-test/suite/rpl/r/rpl_row_idempotency.result
+++ b/mysql-test/suite/rpl/r/rpl_row_idempotency.result
@@ -1,12 +1,9 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032");
-call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
-call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Can.t find record in .t[12].* Error_code: 1032");
+call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
+call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+call mtr.add_suppression("Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
set @old_slave_exec_mode= @@global.slave_exec_mode;
set @@global.slave_exec_mode= IDEMPOTENT;
create table ti1 (b int primary key) engine = innodb;
@@ -76,6 +73,7 @@ b
2
3
*** slave must stop (Trying to delete a referenced foreing key)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1451
select * from ti1 order by b /* must be (1),(2),(3) - not deleted */;
@@ -94,6 +92,7 @@ set global slave_exec_mode='STRICT';
delete from ti1 where b=3;
insert into ti2 set a=3, b=3 /* offending write event */;
*** slave must stop (Trying to insert an invalid foreign key)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1452
select * from ti2 order by b /* must be (2,2) */;
@@ -114,6 +113,7 @@ a b
insert into ti1 set b=1;
insert into ti1 set b=1 /* offending write event */;
*** slave must stop (Trying to insert a dupliacte key)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1062
set foreign_key_checks= 0;
@@ -130,6 +130,7 @@ DELETE FROM t1 WHERE a = -2;
DELETE FROM t2 WHERE a = -2;
DELETE FROM t1 WHERE a = -2;
*** slave must stop (Key was not found)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
@@ -137,6 +138,7 @@ start slave sql_thread;
set global slave_exec_mode='STRICT';
DELETE FROM t2 WHERE a = -2;
*** slave must stop (Key was not found)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
@@ -146,6 +148,7 @@ UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
UPDATE t1 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
@@ -153,6 +156,7 @@ start slave sql_thread;
set global slave_exec_mode='STRICT';
UPDATE t2 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
+include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
@@ -161,3 +165,4 @@ SET @@global.slave_exec_mode= @old_slave_exec_mode;
drop table t1,t2,ti2,ti1;
set @@global.slave_exec_mode= @old_slave_exec_mode;
*** end of tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
index d9e70ce95c5..f81e5db986e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
@@ -1,10 +1,5 @@
-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 session storage_engine=innodb;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -563,10 +558,8 @@ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db
###################################################################################
# CHECK CONSISTENCY
###################################################################################
-Comparing tables master:test.tt_1 and slave:test.tt_1
+include/diff_tables.inc [master:tt_1,slave:tt_1]
###################################################################################
# CLEAN
###################################################################################
-DROP TABLE tt_1;
-DROP TABLE tt_2;
-DROP TABLE nt_1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
index 9a179478ecc..fa565c4061c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
+++ b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==== Setup table on master but not on slave ====
[on master]
CREATE TABLE t1 (a INT);
@@ -14,8 +10,11 @@ DROP TABLE t1;
INSERT INTO t1 VALUES (1);
==== Verify error on slave ====
[on slave]
-Last_SQL_Error = Error executing row event: 'Table 'test.t1' doesn't exist'
+call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., Error_code: 1146");
+include/wait_for_slave_sql_error.inc [errno=1146]
==== Clean up ====
-include/stop_slave.inc
+include/stop_slave_io.inc
+RESET SLAVE;
[on master]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result
index 5959a82183e..e7f25f9cb0a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result
+++ b/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
select @@global.binlog_format;
@@ -58,3 +54,4 @@ a
1
drop table t1;
End of 5.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result
index 4b2948f9382..988be2b84d0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result
+++ b/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result
@@ -13,13 +13,8 @@ master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
DROP TABLE t1;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-reset master;
+include/master-slave.inc
+[connection master]
select last_insert_id();
last_insert_id()
0
@@ -47,32 +42,27 @@ drop table t3;
create table t1(a int, b int, unique(b));
insert into t1 values(1,10);
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
-set global sql_slave_skip_counter=1;
-start slave;
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
+include/check_slave_no_error.inc
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
-stop slave;
+include/wait_for_slave_sql_error.inc [errno=1062]
+include/stop_slave_io.inc
change master to master_user='test';
change master to master_user='root';
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/check_slave_no_error.inc
set global sql_slave_skip_counter=1;
start slave;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
+include/wait_for_slave_sql_error.inc [errno=1062]
stop slave;
reset slave;
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/check_slave_no_error.inc
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM;
@@ -99,13 +89,8 @@ drop table t1, t2;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
LOAD DATA CONCURRENT INFILE "../../std_data/words.dat" INTO TABLE t1;
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
-DROP TABLE IF EXISTS t1;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+DROP TABLE t1;
+include/rpl_reset.inc
drop database if exists b48297_db1;
drop database if exists b42897_db2;
create database b48297_db1;
@@ -126,15 +111,10 @@ LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO
LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
### disconnect and switch back to master connection
use b48297_db1;
-Comparing tables master:b48297_db1.t1 and slave:b48297_db1.t1
+include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1]
DROP DATABASE b48297_db1;
DROP DATABASE b42897_db2;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
@@ -146,3 +126,4 @@ Field 3 'Field 4'
'Field 5' 'Field 6'
Field 6 'Field 7'
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result
index dbb43b9415b..b9be2cd0144 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log.result
@@ -1,13 +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;
+include/master-slave.inc
+[connection master]
include/stop_slave.inc
+include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
+include/wait_for_slave_to_start.inc
create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
insert into t1 values (NULL);
drop table t1;
@@ -243,18 +241,13 @@ slave-bin.000002 # Query # # BEGIN
slave-bin.000002 # Table_map # # table_id: # (test.t2)
slave-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
slave-bin.000002 # Query # # COMMIT
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
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;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
set insert_id=5;
@@ -276,3 +269,4 @@ a b
5 1
6 1
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
index ed6051829d4..15aa8f23b55 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
@@ -1,13 +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;
+include/master-slave.inc
+[connection master]
include/stop_slave.inc
+include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
+include/wait_for_slave_to_start.inc
create table t1(n int not null auto_increment primary key)ENGINE=InnoDB;
insert into t1 values (NULL);
drop table t1;
@@ -243,18 +241,13 @@ slave-bin.000002 # Query # # BEGIN
slave-bin.000002 # Table_map # # table_id: # (test.t2)
slave-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
slave-bin.000002 # Xid # # COMMIT /* XID */
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
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;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
set insert_id=5;
@@ -276,3 +269,4 @@ a b
5 1
6 1
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
index 547dd8e1541..379cea4d3fc 100644
--- a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
stop slave;
#
# Generate a big enough master's binlog to cause relay log rotations
@@ -23,7 +19,7 @@ select @@global.max_relay_log_size;
@@global.max_relay_log_size
4096
start slave;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 2
#
@@ -33,7 +29,7 @@ set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size;
@@global.max_relay_log_size 20480
start slave;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 3: max_relay_log_size = 0
#
@@ -43,7 +39,7 @@ set global max_relay_log_size=0;
select @@global.max_relay_log_size;
@@global.max_relay_log_size 0
start slave;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
#
@@ -57,13 +53,13 @@ reset slave;
start slave;
flush logs;
create table t1 (a int);
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
#
flush logs;
drop table t1;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
@@ -72,3 +68,4 @@ set global max_binlog_size= @my_max_binlog_size;
#
# End of 4.1 tests
#
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
index 7390d5fd316..4106dc93198 100644
--- a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -13801,3 +13797,4 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_
###################################################################################
# CLEAN
###################################################################################
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
index 0852d1048f2..9e3577e1d5c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
---Setup Section --
set timestamp=1000000000;
@@ -83,9 +79,11 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
stop slave;
+include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
+include/wait_for_slave_to_start.inc
--- Test 1 Load from Dump binlog file --
@@ -209,9 +207,11 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
stop slave;
+include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
+include/wait_for_slave_to_start.inc
SELECT COUNT(*) from t1;
COUNT(*)
352
@@ -337,9 +337,11 @@ ROLLBACK /* added by mysqlbinlog */;
--- Test 8 switch internal charset --
stop slave;
+include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
+include/wait_for_slave_to_start.inc
create table t4 (f text character set utf8);
create table t5 (f text character set cp932);
flush logs;
@@ -378,3 +380,4 @@ a b
1 1
FLUSH LOGS;
DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
index c461cafbd7c..523564a222e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
@@ -1,46 +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;
+include/master-slave.inc
+[connection master]
## case #1 - last_null_bit_pos==0 in record_compare without X bit
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
## (1 column less and no varchar)
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
## case #2 - X bit is wrongly set.
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=InnoDB DEFAULT CHARSET= latin1;
INSERT INTO t1(c1) VALUES (10);
INSERT INTO t1(c1) VALUES (NULL);
UPDATE t1 SET c1= 0;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
+include/rpl_reset.inc
+CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,2,NULL);
+UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3);
+include/diff_tables.inc [master:test.t1, slave:test.t1]
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
index 38fbe486d2e..4dc7c0bc7a3 100644
--- a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
@@ -1,60 +1,43 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
+## coverage purposes - Field_bits
+## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0
+include/rpl_reset.inc
+CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO t1(c1,c2) VALUES (10, b'1');
+INSERT INTO t1(c1,c2) VALUES (NULL, b'1');
+UPDATE t1 SET c1= 0;
+include/diff_tables.inc [master:t1, slave:t1]
+DROP TABLE t1;
## case #1 - last_null_bit_pos==0 in record_compare without X bit
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
## (1 column less and no varchar)
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
## case #2 - X bit is wrongly set.
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=MyISAM DEFAULT CHARSET= latin1;
INSERT INTO t1(c1) VALUES (10);
INSERT INTO t1(c1) VALUES (NULL);
UPDATE t1 SET c1= 0;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
-## coverage purposes - Field_bits
-## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==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 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-INSERT INTO t1(c1,c2) VALUES (10, b'1');
-INSERT INTO t1(c1,c2) VALUES (NULL, b'1');
-UPDATE t1 SET c1= 0;
-Comparing tables master:test.t1 and slave:test.t1
+include/rpl_reset.inc
+CREATE TABLE t1 (c1 int(11) NOT NULL, c2 int(11) NOT NULL, c3 int(11) DEFAULT '-1') ENGINE=MyISAM DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1,2,NULL);
+UPDATE t1 SET c1=1, c2=2, c3=-1 WHERE c1=1 AND c2=2 AND ISNULL(c3);
+include/diff_tables.inc [master:test.t1, slave:test.t1]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
index 5499d41bc1f..7dc94bab481 100644
--- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
@@ -1,22 +1,18 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-Master_User root
-Master_Host 127.0.0.1
+include/master-slave.inc
+[connection master]
+Master_User = 'root'
+Master_Host = '127.0.0.1'
include/stop_slave.inc
change master to master_user='test';
-Master_User test
-Master_Host 127.0.0.1
+Master_User = 'test'
+Master_Host = '127.0.0.1'
reset slave;
-Master_User test
-Master_Host 127.0.0.1
+Master_User = 'test'
+Master_Host = '127.0.0.1'
change master to master_user='root';
include/start_slave.inc
-Master_User root
-Master_Host 127.0.0.1
+Master_User = 'root'
+Master_Host = '127.0.0.1'
include/stop_slave.inc
reset slave;
include/start_slave.inc
@@ -29,13 +25,20 @@ Variable_name Value
Slave_open_temp_tables 0
include/stop_slave.inc
reset slave;
+include/check_slave_no_error.inc
change master to master_user='impossible_user_name';
start slave;
-stop slave;
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
change master to master_user='root';
include/start_slave.inc
+include/check_slave_no_error.inc
stop slave;
change master to master_user='impossible_user_name';
start slave;
-stop slave;
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
reset slave;
+include/check_slave_no_error.inc
+change master to master_user='root';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
index a05213217b2..7c55e44ed59 100644
--- a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
+++ b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
@@ -1,18 +1,12 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
-INSERT INTO t1 VALUES (4);
-INSERT INTO t1 VALUES (5);
-INSERT INTO t1 VALUES (6);
-[MASTER] ********* SOW BINLOG EVENTS IN ... *********
-show binlog events from <binlog_start>;
+******** [master] SHOW BINLOG EVENTS IN <FILE> ********
+show binlog events in 'master-bin.000001' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
master-bin.000001 # Query # # BEGIN
@@ -27,19 +21,17 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'master-bin.000001' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'master-bin.000001' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-[MASTER] ********* SOW BINLOG EVENTS *********
+******** [master] SHOW BINLOG EVENTS ********
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
@@ -55,33 +47,8 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-[MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows *********
-show binlog events from <binlog_start> limit 3;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-[MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
-show binlog events from <binlog_start> limit 1,4;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-[SLAVE] ********* SOW BINLOG EVENTS IN ... *********
-show binlog events from <binlog_start>;
+******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
+show binlog events in 'slave-bin.000001' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
slave-bin.000001 # Query # # BEGIN
@@ -96,19 +63,17 @@ slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'slave-bin.000001' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'slave-bin.000001' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-[SLAVE] ********* SOW BINLOG EVENTS *********
+******** [slave] SHOW BINLOG EVENTS ********
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
@@ -124,32 +89,7 @@ slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows *********
-show binlog events from <binlog_start> limit 3;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
-show binlog events from <binlog_start> limit 1,4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-[SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ********
show relaylog events in 'slave-relay-bin.000003' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4
@@ -167,42 +107,35 @@ slave-relay-bin.000003 # Query # # BEGIN
slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
-slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
-slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
-slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
-slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
-slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
-slave-relay-bin.000003 # Query # # COMMIT
-[SLAVE] ********* SOW RELAYLOG EVENTS *********
-show relaylog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=4
-[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows *********
-show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 3;
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ********
+show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4
-slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
-slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
-[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows *********
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ********
show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1,3;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
slave-relay-bin.000003 # Query # # BEGIN
+******** [slave] SHOW RELAYLOG EVENTS ********
+show relaylog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=4
FLUSH LOGS;
FLUSH LOGS;
DROP TABLE t1;
-[MASTER] ********* SOW BINLOG EVENTS IN ... *********
+******** [master] SHOW BINLOG EVENTS IN <FILE> ********
show binlog events in 'master-bin.000002' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
-[MASTER] ********* SOW BINLOG EVENTS *********
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'master-bin.000002' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'master-bin.000002' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
+******** [master] SHOW BINLOG EVENTS ********
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
@@ -218,24 +151,19 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
master-bin.000001 # Rotate # # master-bin.000002;pos=4
-[SLAVE] ********* SOW BINLOG EVENTS IN ... *********
+******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
show binlog events in 'slave-bin.000002' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
-[SLAVE] ********* SOW BINLOG EVENTS *********
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'slave-bin.000002' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'slave-bin.000002' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
+******** [slave] SHOW BINLOG EVENTS ********
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
@@ -251,26 +179,25 @@ slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Rotate # # slave-bin.000002;pos=4
-[SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
-show relaylog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4
-slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4
-[SLAVE] ********* SOW RELAYLOG EVENTS *********
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ********
+show relaylog events in 'slave-relay-bin.000006' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=4
+slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ********
+show relaylog events in 'slave-relay-bin.000006' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=4
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show relaylog events in 'slave-relay-bin.000006' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [slave] SHOW RELAYLOG EVENTS ********
show relaylog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4
slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp001.result b/mysql-test/suite/rpl/r/rpl_row_sp001.result
index 8c26c061376..17117ce2fac 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp001.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
<Begin test section 1 (non deterministic SP)>
---------------------------------------------
@@ -83,3 +79,4 @@ DROP PROCEDURE test.p1;
DROP PROCEDURE test.p2;
DROP TABLE test.t1;
DROP TABLE test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result b/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result
index a42c9af988c..f368cf6e356 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result
@@ -1,15 +1,5 @@
-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 PROCEDURE IF EXISTS test.p2;
-DROP PROCEDURE IF EXISTS test.p3;
-DROP TABLE IF EXISTS test.t3;
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
+include/master-slave.inc
+[connection master]
CREATE TABLE test.t1 (a INT AUTO_INCREMENT KEY, t CHAR(6)) ENGINE=INNODB;
CREATE TABLE test.t2 (a INT AUTO_INCREMENT KEY, f INT, FOREIGN KEY(a) REFERENCES test.t1(a) ON DELETE CASCADE) ENGINE=INNODB;
create procedure test.p1(IN i CHAR(6))
@@ -231,9 +221,10 @@ a t
98 NONE
SET AUTOCOMMIT=1;
SET FOREIGN_KEY_CHECKS=0;
-DROP PROCEDURE IF EXISTS test.p3;
-DROP PROCEDURE IF EXISTS test.p1;
-DROP PROCEDURE IF EXISTS test.p2;
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
-DROP TABLE IF EXISTS test.t3;
+DROP PROCEDURE test.p3;
+DROP PROCEDURE test.p1;
+DROP PROCEDURE test.p2;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP TABLE test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp003.result b/mysql-test/suite/rpl/r/rpl_row_sp003.result
index df3e2a7ceed..42acf21c836 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp003.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
@@ -26,6 +22,11 @@ CALL test.p2();
SELECT release_lock("test");
release_lock("test")
1
+get_lock("test", 100)
+1
+SELECT release_lock("test");
+release_lock("test")
+1
SELECT * FROM test.t1;
a
5
@@ -37,7 +38,10 @@ CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=INNODB;
CALL test.p2();
CALL test.p1();
get_lock("test", 100)
-0
+1
+SELECT release_lock("test");
+release_lock("test")
+1
SELECT * FROM test.t1;
a
8
@@ -47,3 +51,4 @@ a
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp005.result b/mysql-test/suite/rpl/r/rpl_row_sp005.result
index 58c53b394b2..0496fd6fe46 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp005.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp005.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t2;
@@ -100,3 +96,4 @@ DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result b/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
index 079e750e2eb..2b3348270f1 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP PROCEDURE IF EXISTS p1;
@@ -44,3 +40,4 @@ DROP TABLE t1;
DROP TABLE t2;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
index 5a6a9ace4c5..4f5008aae65 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
@@ -1,11 +1,5 @@
-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;
+include/master-slave.inc
+[connection master]
CREATE PROCEDURE test.p1(IN i INT)
BEGIN
DECLARE CONTINUE HANDLER FOR sqlexception BEGIN END;
@@ -44,5 +38,6 @@ num
SELECT * FROM test.t1;
num
13
-DROP PROCEDURE IF EXISTS test.p1;
-DROP TABLE IF EXISTS test.t1;
+DROP PROCEDURE test.p1;
+DROP TABLE test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp008.result b/mysql-test/suite/rpl/r/rpl_row_sp008.result
index 23197964a24..f817e9c5f1b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp008.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp008.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t2;
CREATE TABLE test.t1 (a INT,PRIMARY KEY(a));
@@ -32,3 +28,4 @@ a
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp009.result b/mysql-test/suite/rpl/r/rpl_row_sp009.result
index 35ce0d7b420..8e9a2cbb8e9 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp009.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp009.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@@ -75,3 +71,4 @@ a
DROP PROCEDURE test.p1;
DROP TABLE test.t1;
DROP TABLE test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp010.result b/mysql-test/suite/rpl/r/rpl_row_sp010.result
index 02567465428..d31f37d8411 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp010.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp010.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
@@ -54,3 +50,4 @@ DROP PROCEDURE IF EXISTS test.p3;
DROP PROCEDURE IF EXISTS test.p4;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp011.result b/mysql-test/suite/rpl/r/rpl_row_sp011.result
index e35c9f21adb..8588d739dff 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp011.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp011.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
@@ -67,3 +63,4 @@ DROP PROCEDURE IF EXISTS test.p6;
DROP PROCEDURE IF EXISTS test.p7;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp012.result b/mysql-test/suite/rpl/r/rpl_row_sp012.result
index b9c818bad9a..57d92386638 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp012.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp012.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
@@ -57,3 +53,4 @@ DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP USER user1@localhost;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
index 0e745feb3cd..49dccfc5d73 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
STOP SLAVE;
SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
@@ -118,27 +114,23 @@ a b
SELECT * FROM t2;
a
2
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
INSERT INTO t9 VALUES (4);
INSERT INTO t4 VALUES (4);
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* Error_code: 1677");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float''
INSERT INTO t9 VALUES (5);
INSERT INTO t5 VALUES (5,10,25);
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'int' to type 'float'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'int' to type 'float''
INSERT INTO t9 VALUES (6);
INSERT INTO t6 VALUES (6,12,36);
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t6' cannot be converted from type 'int' to type 'float'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t6' cannot be converted from type 'int' to type 'float''
INSERT INTO t9 VALUES (6);
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7 ORDER BY a;
@@ -194,3 +186,4 @@ a b x y z
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;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
index 7bd3be78c60..9c1e2740c03 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
STOP SLAVE;
SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
@@ -118,27 +114,23 @@ a b
SELECT * FROM t2;
a
2
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
INSERT INTO t9 VALUES (4);
INSERT INTO t4 VALUES (4);
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* Error_code: 1677");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float''
INSERT INTO t9 VALUES (5);
INSERT INTO t5 VALUES (5,10,25);
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'int' to type 'float'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'int' to type 'float''
INSERT INTO t9 VALUES (6);
INSERT INTO t6 VALUES (6,12,36);
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t6' cannot be converted from type 'int' to type 'float'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
+include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
+Last_SQL_Error = 'Column 2 of table 'test.t6' cannot be converted from type 'int' to type 'float''
INSERT INTO t9 VALUES (6);
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7 ORDER BY a;
@@ -194,3 +186,4 @@ a b x y z
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;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result
deleted file mode 100644
index 5876a0e1b65..00000000000
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result
+++ /dev/null
@@ -1,288 +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='NDB';
-CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE='NDB';
-CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE='NDB';
-CREATE TABLE t1_nodef (a INT PRIMARY KEY, b INT) ENGINE='NDB';
-CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE='NDB';
-CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE='NDB';
-CREATE TABLE t4 (a INT) ENGINE='NDB';
-CREATE TABLE t5 (a INT, b INT, c INT) ENGINE='NDB';
-CREATE TABLE t6 (a INT, b INT, c INT) ENGINE='NDB';
-CREATE TABLE t9 (a INT) ENGINE='NDB';
-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;
-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;
-a b
-1 2
-2 5
-SELECT * FROM t1_bit;
-a b
-1 2
-2 5
-SELECT * FROM t1_char;
-a b
-1 2
-2 5
-**** On Slave ****
-SELECT a,b,x FROM t1_int;
-a b x
-1 2 42
-2 5 42
-SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
-a b HEX(x) HEX(y) HEX(z)
-1 2 3 15 2
-2 5 3 15 2
-SELECT a,b,x FROM t1_char;
-a b x
-1 2 Just a test
-2 5 Just a test
-**** 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;
-a b
-1 2
-2 10
-SELECT * FROM t1_bit;
-a b
-1 2
-2 10
-SELECT * FROM t1_char;
-a b
-1 2
-2 10
-**** On Slave ****
-SELECT a,b,x FROM t1_int;
-a b x
-1 2 42
-2 10 42
-SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
-a b HEX(x) HEX(y) HEX(z)
-1 2 3 15 2
-2 10 3 15 2
-SELECT a,b,x FROM t1_char;
-a b x
-1 2 Just a test
-2 10 Just a test
-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 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 #
-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 1514
-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 #
-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 1514
-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 #
-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 1514
-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 #
-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 1514
-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 #
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
-DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t9;
-SET @@global.sql_mode= @my_sql_mode;
diff --git a/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result b/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result
index 711d0d063aa..eaee105a2d9 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS `t1`;
### TABLE with field_metadata_size == 290
CREATE TABLE `t1` (
@@ -159,15 +155,10 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1`(c2) VALUES ('1');
FLUSH LOGS;
### assertion: the slave replicated event successfully and tables match
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE `t1`;
=== Using mysqlbinlog to detect failure. Before the patch mysqlbinlog would find a corrupted event, thence would fail.
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
### action: generating several tables with different metadata
### sizes (resorting to perl)
### testing table with 249 field metadata size.
@@ -182,25 +173,26 @@ start slave;
### testing table with 258 field metadata size.
FLUSH LOGS;
### assertion: the slave replicated event successfully and tables match for t10
-Comparing tables master:test.t10 and slave:test.t10
+include/diff_tables.inc [master:t10, slave:t10]
### assertion: the slave replicated event successfully and tables match for t9
-Comparing tables master:test.t9 and slave:test.t9
+include/diff_tables.inc [master:t9, slave:t9]
### assertion: the slave replicated event successfully and tables match for t8
-Comparing tables master:test.t8 and slave:test.t8
+include/diff_tables.inc [master:t8, slave:t8]
### assertion: the slave replicated event successfully and tables match for t7
-Comparing tables master:test.t7 and slave:test.t7
+include/diff_tables.inc [master:t7, slave:t7]
### assertion: the slave replicated event successfully and tables match for t6
-Comparing tables master:test.t6 and slave:test.t6
+include/diff_tables.inc [master:t6, slave:t6]
### assertion: the slave replicated event successfully and tables match for t5
-Comparing tables master:test.t5 and slave:test.t5
+include/diff_tables.inc [master:t5, slave:t5]
### assertion: the slave replicated event successfully and tables match for t4
-Comparing tables master:test.t4 and slave:test.t4
+include/diff_tables.inc [master:t4, slave:t4]
### assertion: the slave replicated event successfully and tables match for t3
-Comparing tables master:test.t3 and slave:test.t3
+include/diff_tables.inc [master:t3, slave:t3]
### assertion: the slave replicated event successfully and tables match for t2
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
### assertion: the slave replicated event successfully and tables match for t1
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
### assertion: check that binlog is not corrupt. Using mysqlbinlog to
### detect failure. Before the patch mysqlbinlog would find
### a corrupted event, thence would fail.
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trig001.result b/mysql-test/suite/rpl/r/rpl_row_trig001.result
index ea0ef27fccd..d00da976d30 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trig001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig001.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE test.t1 (n MEDIUMINT NOT NULL, d DATETIME, PRIMARY KEY(n));
CREATE TABLE test.t2 (n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n));
CREATE TABLE test.t3 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d DATETIME, PRIMARY KEY(n));
@@ -29,3 +25,4 @@ DROP TRIGGER test.t3_bi_t2;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trig002.result b/mysql-test/suite/rpl/r/rpl_row_trig002.result
index 794104db750..b0be0316bf2 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trig002.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig002.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TRIGGER test.t2_ai;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@@ -67,3 +63,4 @@ DROP TRIGGER test.t2_ai;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trig003.result b/mysql-test/suite/rpl/r/rpl_row_trig003.result
index 131af933b41..68552ede1c0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trig003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig003.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TRIGGER test.t1_bi;
DROP TRIGGER test.t2_ai;
DROP TRIGGER test.t1_bu;
@@ -69,15 +65,9 @@ INSERT INTO test.t2 VALUES(NULL,0,'Testing MySQL databases is a cool ', 'MySQL C
UPDATE test.t1 SET b1 = 0 WHERE b1 = 1;
INSERT INTO test.t2 VALUES(NULL,1,'This is an after update test.', 'If this works, total will not be zero on the master or slave',1.4321,5.221,0,YEAR(NOW()),NOW());
UPDATE test.t2 SET b1 = 0 WHERE b1 = 1;
-Warnings:
-Error 1329 No data - zero rows fetched, selected, or processed
INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW());
DELETE FROM test.t1 WHERE id = 1;
-Warnings:
-Error 1329 No data - zero rows fetched, selected, or processed
DELETE FROM test.t2 WHERE id = 1;
-Warnings:
-Error 1329 No data - zero rows fetched, selected, or processed
DROP TRIGGER test.t1_bi;
DROP TRIGGER test.t2_ai;
DROP TRIGGER test.t1_bu;
@@ -87,3 +77,4 @@ DROP TRIGGER test.t2_ad;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trig004.result b/mysql-test/suite/rpl/r/rpl_row_trig004.result
index d0d0657f875..50317b55e2e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trig004.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig004.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TRIGGER test.t1_bi_t2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@@ -28,3 +24,4 @@ n f
DROP TRIGGER test.t1_bi_t2;
DROP TABLE test.t1;
DROP TABLE test.t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result b/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result
index f9181be9bc0..d3b892326ac 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TEMPORARY TABLE t1(c1 INTEGER);
CREATE TABLE t2(c1 INTEGER);
CREATE TABLE t1(c1 INTEGER);
@@ -27,3 +23,4 @@ SELECT * FROM t2;
c1
DROP TABLE t1;
DROP TABLE t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result b/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result
index 800670b78ae..b9ae1893629 100644
--- a/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result
+++ b/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT, b INT);
INSERT INTO t1 SELECT 1;
@@ -20,3 +16,4 @@ b
1
3
DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result
index 81aeb0d645b..5629f5c8cdd 100644
--- a/mysql-test/suite/rpl/r/rpl_row_until.result
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2),(3),(4);
DROP TABLE t1;
@@ -14,27 +10,37 @@ DROP TABLE t2;
include/stop_slave.inc
RESET SLAVE;
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1
+include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t1;
n
1
2
3
4
+include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
+include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t1;
n
1
2
3
4
+include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2
+include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t2;
n
1
2
+include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE;
+include/wait_for_slave_to_start.inc
include/stop_slave.inc
START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2
+include/wait_for_slave_param.inc [Until_Log_Pos]
+include/wait_for_slave_sql_to_stop.inc
+include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=MASTER_LOG_POS;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS, RELAY_LOG_POS=RELAY_LOG_POS;
@@ -49,3 +55,6 @@ START SLAVE;
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
Warnings:
Note 1254 Slave is already running
+include/stop_slave.inc
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_utf16.result b/mysql-test/suite/rpl/r/rpl_row_utf16.result
index f7e66dd92ee..cca69e1da82 100644
--- a/mysql-test/suite/rpl/r/rpl_row_utf16.result
+++ b/mysql-test/suite/rpl/r/rpl_row_utf16.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1(c1 CHAR(10) CHARACTER SET utf16 DEFAULT 'ola');
INSERT INTO t1 VALUES ('abc');
INSERT INTO t1 VALUES ();
@@ -19,5 +15,6 @@ c1 abc
hex(c1) 006100620063
c1 ola
hex(c1) 006F006C0061
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_utf32.result b/mysql-test/suite/rpl/r/rpl_row_utf32.result
index e07db9c9e48..0a212544113 100644
--- a/mysql-test/suite/rpl/r/rpl_row_utf32.result
+++ b/mysql-test/suite/rpl/r/rpl_row_utf32.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
SET SQL_LOG_BIN=0;
CREATE TABLE t1 (c1 char(255) DEFAULT NULL, KEY c1 (c1)) DEFAULT CHARSET=utf32;
Warnings:
@@ -23,3 +19,4 @@ DROP TABLE t1;
SET GLOBAL SLAVE_TYPE_CONVERSIONS= @saved_slave_type_conversions;
include/stop_slave.inc
include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_view01.result b/mysql-test/suite/rpl/r/rpl_row_view01.result
index 4dfe5826f32..471de20ea6d 100644
--- a/mysql-test/suite/rpl/r/rpl_row_view01.result
+++ b/mysql-test/suite/rpl/r/rpl_row_view01.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create database if not exists mysqltest1;
DROP VIEW IF EXISTS mysqltest1.v1;
DROP VIEW IF EXISTS mysqltest1.v2;
@@ -102,3 +98,4 @@ DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;
DROP TABLE IF EXISTS mysqltest1.t10;
DROP DATABASE mysqltest1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_wide_table.result b/mysql-test/suite/rpl/r/rpl_row_wide_table.result
index da96e84d1d5..f469a13837c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_wide_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_wide_table.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t300;
create table t300 (
f1 int,
@@ -316,3 +312,4 @@ one
1
*** Cleanup ***
DROP TABLE t300;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_savepoint.result b/mysql-test/suite/rpl/r/rpl_savepoint.result
index e1462f435a3..75eb0f307bb 100644
--- a/mysql-test/suite/rpl/r/rpl_savepoint.result
+++ b/mysql-test/suite/rpl/r/rpl_savepoint.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
#
# Bug#50124 Rpl failure on DROP table with concurrent txn/non-txn
# DML flow and SAVEPOINT
@@ -30,3 +26,4 @@ COMMIT;
FLUSH LOGS;
# Connection master
DROP TABLE nt;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result
index 13a5c179520..bb037de4e6d 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result
@@ -1,21 +1,9 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
#
# Uninstall semi-sync plugins on master and slave
#
include/stop_slave.inc
-reset slave;
-UNINSTALL PLUGIN rpl_semi_sync_slave;
-UNINSTALL PLUGIN rpl_semi_sync_master;
-reset master;
-set sql_log_bin=0;
-UNINSTALL PLUGIN rpl_semi_sync_slave;
-UNINSTALL PLUGIN rpl_semi_sync_master;
-set sql_log_bin=1;
#
# Main test of semi-sync replication start here
#
@@ -453,7 +441,9 @@ Rpl_semi_sync_slave_status OFF
include/stop_slave.inc
UNINSTALL PLUGIN rpl_semi_sync_slave;
UNINSTALL PLUGIN rpl_semi_sync_master;
+change master to master_user='root',master_password='';
include/start_slave.inc
drop table t1;
drop user rpl@127.0.0.1;
flush privileges;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_event.result b/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
index f3f5aa1559d..1c6d73fe681 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
include/stop_slave.inc
include/start_slave.inc
SET GLOBAL event_scheduler = ON;
@@ -44,3 +40,4 @@ include/start_slave.inc
DROP EVENT ev1;
DROP EVENT ev2;
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_server_id1.result b/mysql-test/suite/rpl/r/rpl_server_id1.result
index 76f187e3b01..80e5bbae146 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id1.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id1.result
@@ -1,13 +1,7 @@
-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;
-include/stop_slave.inc
-change master to master_port=SLAVE_PORT;
-start slave;
-*** must be having the replicate-same-server-id IO thread error ***
-Slave_IO_Errno= 1593
-Slave_IO_Error= Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
+include/rpl_init.inc [topology=2->2]
+START SLAVE;
+include/wait_for_slave_io_error.inc [errno=1593]
+Last_IO_Error = 'Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).'
+include/stop_slave_sql.inc
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_server_id2.result b/mysql-test/suite/rpl/r/rpl_server_id2.result
index bb5a175fbfe..69c0e1f7d9b 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id2.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id2.result
@@ -1,30 +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;
+include/master-slave.inc
+[connection master]
create table t1 (n int);
reset master;
stop slave;
+include/wait_for_slave_to_stop.inc
change master to master_port=SLAVE_PORT;
start slave;
+include/wait_for_slave_to_start.inc
insert into t1 values (1);
select * from t1;
n
1
1
stop slave;
+include/wait_for_slave_to_stop.inc
drop table t1;
reset master;
create table t1(n int);
create table t2(n int);
change master to master_port=MASTER_PORT;
start slave until master_log_file='master-bin.000001', master_log_pos=UNTIL_POS;
-*** checking until postion execution: must be only t1 in the list ***
+include/wait_for_slave_io_to_start.inc
+include/wait_for_slave_sql_to_stop.inc
+*** checking until position execution: must be only t1 in the list ***
show tables;
Tables_in_test
t1
start slave sql_thread;
drop table t1;
drop table t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_server_id_ignore.result b/mysql-test/suite/rpl/r/rpl_server_id_ignore.result
index cba6571eb1a..0a4f414ad6e 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id_ignore.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id_ignore.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
master_id: 1
stop slave;
*** --replicate-same-server-id and change master option can clash ***
@@ -25,11 +21,13 @@ ignore server id list: 1, 3, 4, 5
*** ignore master (server 1) queries for a while ***
start slave;
create table t1 (n int);
+include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
*** must be empty as the event is to be filtered out ***
show tables;
Tables_in_test
*** allowing events from master ***
stop slave;
+include/wait_for_slave_to_stop.inc
reset slave;
change master to IGNORE_SERVER_IDS= (10, 100);
*** the list must remain (10, 100) after reset slave ***
@@ -44,3 +42,4 @@ Tables_in_test
t1
drop table t1;
end of the tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_session_var.result b/mysql-test/suite/rpl/r/rpl_session_var.result
index 297a18a5931..030ae161b22 100644
--- a/mysql-test/suite/rpl/r/rpl_session_var.result
+++ b/mysql-test/suite/rpl/r/rpl_session_var.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
@@ -51,3 +47,4 @@ SELECT length(data) < 100 FROM t1;
length(data) < 100
1
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_set_charset.result b/mysql-test/suite/rpl/r/rpl_set_charset.result
index 480d926fbba..fa30a361d13 100644
--- a/mysql-test/suite/rpl/r/rpl_set_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_set_charset.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
create database mysqltest1 /*!40100 character set latin2 */;
use mysqltest1;
@@ -46,3 +42,4 @@ D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF D0
E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF E0
F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF F0
drop database mysqltest1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_set_null_innodb.result b/mysql-test/suite/rpl/r/rpl_set_null_innodb.result
index 41600a5fe1b..f099b2b7691 100644
--- a/mysql-test/suite/rpl/r/rpl_set_null_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_set_null_innodb.result
@@ -1,35 +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;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
CREATE TABLE t1 (c1 BIT, c2 INT) Engine=InnoDB;
INSERT INTO `t1` VALUES ( 1, 1 );
UPDATE t1 SET c1=NULL where c2=1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DELETE FROM t1 WHERE c2=1 LIMIT 1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 CHAR) Engine=InnoDB;
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
SELECT * FROM t1;
c1
w
UPDATE t1 SET c1=NULL WHERE c1='w';
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DELETE FROM t1 LIMIT 2;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_set_null_myisam.result b/mysql-test/suite/rpl/r/rpl_set_null_myisam.result
index cbd7010664a..5698be4ff0c 100644
--- a/mysql-test/suite/rpl/r/rpl_set_null_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_set_null_myisam.result
@@ -1,35 +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;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
CREATE TABLE t1 (c1 BIT, c2 INT) Engine=MyISAM;
INSERT INTO `t1` VALUES ( 1, 1 );
UPDATE t1 SET c1=NULL where c2=1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DELETE FROM t1 WHERE c2=1 LIMIT 1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t1 (c1 CHAR) Engine=MyISAM;
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
SELECT * FROM t1;
c1
w
UPDATE t1 SET c1=NULL WHERE c1='w';
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DELETE FROM t1 LIMIT 2;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result
index 9838d8b08a8..2ada5670e04 100644
--- a/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result
+++ b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result
@@ -1,17 +1,15 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
RESET SLAVE;
CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_PORT,master_user='root';
START SLAVE IO_THREAD;
+include/wait_for_slave_io_to_start.inc
SHOW SLAVE HOSTS;
Server_id Host Port Master_id
3 slave2 DEFAULT_PORT 1
2 SLAVE_PORT 1
-STOP SLAVE IO_THREAD;
+include/stop_slave_io.inc
SHOW SLAVE HOSTS;
Server_id Host Port Master_id
2 SLAVE_PORT 1
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_show_slave_running.result b/mysql-test/suite/rpl/r/rpl_show_slave_running.result
index 556acb14e5c..599290ac776 100644
--- a/mysql-test/suite/rpl/r/rpl_show_slave_running.result
+++ b/mysql-test/suite/rpl/r/rpl_show_slave_running.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
SET DEBUG_SYNC= 'RESET';
include/stop_slave.inc
set global debug= 'd,dbug.before_get_running_status_yes';
@@ -21,6 +17,7 @@ Slave_running OFF
Slave_IO_Running= Connecting
Slave_SQL_Running= No
SET DEBUG_SYNC='now SIGNAL signal.io_thread_let_running';
+include/wait_for_slave_param.inc [Slave_IO_Running]
Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF YES NO in three following queries
SHOW STATUS LIKE 'Slave_running';
Variable_name Value
@@ -28,6 +25,7 @@ Slave_running OFF
Slave_IO_Running= Yes
Slave_SQL_Running= No
start slave sql_thread;
+include/wait_for_slave_sql_to_start.inc
Slave_running, Slave_IO_Running, Slave_SQL_Running must be ON, YES, YES in three following queries
SHOW STATUS LIKE 'Slave_running';
Variable_name Value
@@ -37,3 +35,4 @@ Slave_SQL_Running= Yes
set global debug= '';
SET DEBUG_SYNC= 'RESET';
End of tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result
index 0aa8069a38c..f5675b5e25f 100644
--- a/mysql-test/suite/rpl/r/rpl_skip_error.result
+++ b/mysql-test/suite/rpl/r/rpl_skip_error.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==== Test Without sql_mode=strict_trans_tables ====
[on master]
create table t1 (n int not null primary key);
@@ -31,7 +27,7 @@ n
3
7
8
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
==== Clean Up ====
drop table t1;
create table t1(a int primary key);
@@ -46,7 +42,7 @@ select * from t1;
a
1
2
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
==== Clean Up ====
drop table t1;
==== Using Innodb ====
@@ -60,6 +56,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SET SQL_LOG_BIN=1;
+call mtr.add_suppression("Slave SQL.*Could not execute .*te_rows event on table test.t.; Duplicate entry.* Error_code: 1062");
CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
SHOW CREATE TABLE t1;
Table Create Table
@@ -112,3 +109,4 @@ UPDATE t2 SET id= id + 3, data = 2;
==== Clean Up ====
DROP TABLE t1;
DROP TABLE t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
index eb3c4ef5978..4c3b08589d9 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
*** Preparing data ***
CREATE TABLE t1 (a INT NOT NULL, b VARCHAR(10)) ENGINE=MyISAM;
@@ -33,6 +29,8 @@ a b
SELECT * FROM t3 ORDER BY a;
a b
1 ZZ
+call mtr.add_suppression("Slave SQL.*Table .test.t3. doesn.t exist.* Error_code: 1146");
+include/wait_for_slave_sql_error.inc [errno=1146]
SHOW TABLES LIKE 't%';
Tables_in_test (t%)
t1
@@ -44,7 +42,7 @@ a b
SELECT * FROM t2 ORDER BY a;
a b
1 AA_for_row_or_YY_for_stmt_mixed
-include/stop_slave.inc
+include/stop_slave_io.inc
RENAME TABLE t3_bak TO t3;
include/start_slave.inc
TRUNCATE t1;
@@ -60,6 +58,7 @@ INSERT INTO t3 VALUES(2, 'B');
INSERT INTO t2 VALUES(2, 'B');
INSERT INTO t1 VALUES(2, 'B');
UPDATE t1 SET b = 'X' WHERE a = 2;
+include/wait_for_slave_sql_error.inc [errno=1146]
SELECT * FROM t1 ORDER BY a;
a b
2 X
@@ -78,7 +77,7 @@ SELECT * FROM t1 ORDER BY a;
a b
SELECT * FROM t2 ORDER BY a;
a b
-include/stop_slave.inc
+include/stop_slave_io.inc
RENAME TABLE t3_bak TO t3;
include/start_slave.inc
TRUNCATE t1;
@@ -95,6 +94,7 @@ INSERT INTO t1 VALUES (3, 'C'), (4, 'D');
INSERT INTO t2 VALUES (3, 'C'), (4, 'D');
INSERT INTO t3 VALUES (3, 'C'), (4, 'D');
COMMIT;
+include/wait_for_slave_sql_error.inc [errno=1146]
SELECT * FROM t1 ORDER BY a;
a b
3 C
@@ -116,8 +116,9 @@ SELECT * FROM t1 ORDER BY a;
a b
SELECT * FROM t2 ORDER BY a;
a b
-include/stop_slave.inc
+include/stop_slave_io.inc
RENAME TABLE t3_bak TO t3;
include/start_slave.inc
*** Clean up ***
DROP TABLE t1,t2,t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_in.result b/mysql-test/suite/rpl/r/rpl_slave_load_in.result
index 2cc83fd0a19..504f6f60d9e 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_load_in.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_in.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1(a int not null auto_increment, b int, primary key(a));
create table t2(a int not null auto_increment, b int, primary key(a)) engine=innodb;
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
@@ -13,7 +9,8 @@ insert into t2(b) values (2);
load data infile '../../std_data/rpl_loaddata.dat' into table t2;
load data infile '../../std_data/rpl_loaddata.dat' into table t2;
commit;
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:t2, slave:t2]
drop table t1;
drop table t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
index 85fbcb69760..e08c066d226 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
@@ -1,16 +1,21 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
+SET @@GLOBAL.DEBUG = '+d,remove_slave_load_file_before_write';
create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb;
start transaction;
insert into t1(b) values (1);
insert into t1(b) values (2);
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
commit;
+include/wait_for_slave_sql_error.inc [errno=29, 13]
drop table t1;
+include/sync_slave_io_with_master.inc
+include/stop_slave_io.inc
+RESET SLAVE;
drop table t1;
call mtr.add_suppression("Slave: Can't get stat of .*");
+call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13");
call mtr.add_suppression("Slave: File.* not found.*");
+call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29");
+SET @@GLOBAL.DEBUG = '';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result b/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
index 3ed14a9cb6b..262404ff6f9 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
@@ -1,6 +1,8 @@
-CHANGE MASTER TO MASTER_USER='root',
-MASTER_CONNECT_RETRY=1,
-MASTER_HOST='127.0.0.1',
-MASTER_PORT=MASTER_MYPORT;
+include/master-slave.inc
+[connection master]
START SLAVE;
-12
+call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory.* Error_code: 12");
+include/wait_for_slave_sql_error.inc [errno=12]
+include/stop_slave_io.inc
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result
index 5feba69b64d..a1884731a3e 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_skip.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result
@@ -1,11 +1,8 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
**** On Slave ****
STOP SLAVE;
+include/wait_for_slave_to_stop.inc
**** On Master ****
SET SESSION BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
@@ -43,8 +40,12 @@ c d
3 18
**** On Slave ****
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
+include/wait_for_slave_sql_to_stop.inc
+include/check_slave_param.inc [Exec_Master_Log_Pos]
+include/check_slave_no_error.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
+include/wait_for_slave_to_start.inc
SELECT * FROM t1;
a b
1 1
@@ -56,6 +57,7 @@ c d
2 8
3 27
STOP SLAVE;
+include/wait_for_slave_to_stop.inc
RESET SLAVE;
RESET MASTER;
SET SESSION BINLOG_FORMAT=STATEMENT;
@@ -68,8 +70,10 @@ master-bin.000001 # User var # # @`foo`=12
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@foo, 2*@foo)
master-bin.000001 # Query # # COMMIT
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
+include/wait_for_slave_sql_to_stop.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
+include/wait_for_slave_to_start.inc
**** On Master ****
DROP TABLE t1, t2;
SET SESSION BINLOG_FORMAT=ROW;
@@ -281,3 +285,4 @@ include/start_slave.inc
SELECT * FROM t10 ORDER BY a;
a b
DROP TABLE t10;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_status.result b/mysql-test/suite/rpl/r/rpl_slave_status.result
index a98a81dc74f..be978362c81 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_status.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_status.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==== Create new replication user ====
[on master]
GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
@@ -27,9 +23,14 @@ FLUSH PRIVILEGES;
==== Restart slave without privileges =====
include/stop_slave.inc
START SLAVE;
-==== Verify that Slave_IO_Running = No ====
-Slave_IO_Running = No (should be No)
+include/wait_for_slave_sql_to_start.inc
+include/wait_for_slave_io_to_stop.inc
+==== Verify that Slave IO thread stopped with error ====
+include/wait_for_slave_io_error.inc [errno=1045]
==== Cleanup (Note that slave IO thread is not running) ====
-DROP TABLE t1;
+include/stop_slave_sql.inc
+CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = '';
+include/rpl_reset.inc
[on master]
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slow_query_log.result b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
index 0b35cf68e96..79b83b4ceb9 100644
--- a/mysql-test/suite/rpl/r/rpl_slow_query_log.result
+++ b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
@@ -1,10 +1,7 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
include/stop_slave.inc
SET @old_log_output= @@log_output;
SET GLOBAL log_output= 'TABLE';
@@ -46,12 +43,7 @@ include/stop_slave.inc
SET GLOBAL long_query_time= @old_long_query_time;
SET GLOBAL log_output= @old_log_output;
include/start_slave.inc
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
SET @old_log_output= @@log_output;
SET GLOBAL log_output= 'TABLE';
SET GLOBAL long_query_time= 2;
@@ -89,3 +81,4 @@ SET @@global.long_query_time= @old_long_query_time;
DROP TABLE t1;
SET @@global.log_output= @old_log_output;
SET @@global.long_query_time= @old_long_query_time;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 7d1d050e56b..4b9e768861d 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
@@ -1238,14 +1234,7 @@ ERROR 42000: FUNCTION test.f1 does not exist
#
# Bug #11918 Can't use a declared variable in LIMIT clause
#
-drop table if exists t1;
-drop procedure if exists p1;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
create table t1 (c1 int);
insert into t1 (c1) values
(1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
@@ -1281,3 +1270,4 @@ set @@session.binlog_format=@save_binlog_format;
drop table t1;
drop procedure p1;
# End of 5.5 tests.
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sp004.result b/mysql-test/suite/rpl/r/rpl_sp004.result
index 1c0ed3cc50a..5b67d225490 100644
--- a/mysql-test/suite/rpl/r/rpl_sp004.result
+++ b/mysql-test/suite/rpl/r/rpl_sp004.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t2;
@@ -91,3 +87,4 @@ DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sp_effects.result b/mysql-test/suite/rpl/r/rpl_sp_effects.result
index d9cdfd81167..a6e3ae03963 100644
--- a/mysql-test/suite/rpl/r/rpl_sp_effects.result
+++ b/mysql-test/suite/rpl/r/rpl_sp_effects.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
drop procedure if exists p1;
drop procedure if exists p2;
@@ -278,3 +274,4 @@ drop procedure sp_bug26199;
drop function sf_bug26199;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
end of the tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_spec_variables.result b/mysql-test/suite/rpl/r/rpl_spec_variables.result
index ea2778bf71c..785913134a7 100644
--- a/mysql-test/suite/rpl/r/rpl_spec_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_spec_variables.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
* auto_increment_increment, auto_increment_offset *
SET @@global.auto_increment_increment=2;
@@ -173,7 +169,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` varchar(10) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -223,3 +219,4 @@ SET @@global.max_heap_table_size=@restore_slave_max_heap_table_size;
SET @@global.storage_engine=@restore_slave_storage_engine;
call mtr.add_suppression("The table 't[12]' is full");
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sporadic_master.result b/mysql-test/suite/rpl/r/rpl_sporadic_master.result
index 14fb673a081..1ec94964acf 100644
--- a/mysql-test/suite/rpl/r/rpl_sporadic_master.result
+++ b/mysql-test/suite/rpl/r/rpl_sporadic_master.result
@@ -1,16 +1,12 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t2(n int);
create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL),(NULL);
truncate table t1;
insert into t1 values (4),(NULL);
-stop slave;
-start slave;
+include/stop_slave.inc
+include/start_slave.inc
insert into t1 values (NULL),(NULL);
flush logs;
truncate table t1;
@@ -24,3 +20,4 @@ n
14
15
drop table t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ssl.result b/mysql-test/suite/rpl/r/rpl_ssl.result
index 1af4c5e227c..35aaabc8c56 100644
--- a/mysql-test/suite/rpl/r/rpl_ssl.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
grant replication slave on *.* to replssl@localhost require ssl;
create table t1 (t int auto_increment, KEY(t));
stop slave;
@@ -19,23 +15,32 @@ insert into t1 values(1);
select * from t1;
t
1
-Master_SSL_Allowed Yes
-Master_SSL_CA_Path
-Master_SSL_CA_File 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
-Checking that both slave threads are running.
+Master_SSL_Allowed = 'Yes'
+Master_SSL_CA_Path = ''
+Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
+Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
+Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
+include/check_slave_is_running.inc
STOP SLAVE;
select * from t1;
t
1
insert into t1 values (NULL);
-Master_SSL_Allowed Yes
-Master_SSL_CA_Path
-Master_SSL_CA_File 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
-Checking that both slave threads are running.
+include/wait_for_slave_to_start.inc
+Master_SSL_Allowed = 'Yes'
+Master_SSL_CA_Path = ''
+Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
+Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
+Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
+include/check_slave_is_running.inc
drop user replssl@localhost;
drop table t1;
+include/stop_slave.inc
+CHANGE MASTER TO
+master_user = 'root',
+master_ssl = 0,
+master_ssl_ca = '',
+master_ssl_cert = '',
+master_ssl_key = '';
End of 5.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ssl1.result b/mysql-test/suite/rpl/r/rpl_ssl1.result
index 5b4aa126c77..a7a56d7c5ee 100644
--- a/mysql-test/suite/rpl/r/rpl_ssl1.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl1.result
@@ -1,41 +1,43 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
grant replication slave on *.* to replssl@localhost require ssl;
create table t1 (t int);
stop slave;
+include/wait_for_slave_to_stop.inc
change master to master_user='replssl',master_password='';
start slave;
insert into t1 values (1);
select * from t1;
t
stop slave;
+include/wait_for_slave_to_stop.inc
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;
+include/wait_for_slave_to_start.inc
select * from t1;
t
1
-Master_SSL_Allowed Yes
-Master_SSL_CA_Path
-Master_SSL_CA_File 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
-Checking that both slave threads are running.
+Master_SSL_Allowed = 'Yes'
+Master_SSL_CA_Path = ''
+Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
+Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
+Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
+include/check_slave_is_running.inc
stop slave;
+include/wait_for_slave_to_stop.inc
change master to master_user='root',master_password='', master_ssl=0;
start slave;
+include/wait_for_slave_to_start.inc
drop user replssl@localhost;
drop table t1;
-Master_SSL_Allowed No
-Master_SSL_CA_Path
-Master_SSL_CA_File 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
-Checking that both slave threads are running.
+Master_SSL_Allowed = 'No'
+Master_SSL_CA_Path = ''
+Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
+Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
+Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
+include/check_slave_is_running.inc
stop slave;
+include/wait_for_slave_to_stop.inc
change master to
master_host="localhost",
master_ssl=1 ,
@@ -44,16 +46,26 @@ 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;
+include/wait_for_slave_to_start.inc
create table t1 (t int);
insert into t1 values (1);
on slave
select * from t1;
t
1
-Master_SSL_Allowed Yes
-Master_SSL_CA_Path
-Master_SSL_CA_File 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
-Checking that both slave threads are running.
+Master_SSL_Allowed = 'Yes'
+Master_SSL_CA_Path = ''
+Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
+Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
+Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
+include/check_slave_is_running.inc
drop table t1;
+include/stop_slave.inc
+CHANGE MASTER TO
+master_host="127.0.0.1",
+master_ssl_ca ='',
+master_ssl_cert='',
+master_ssl_key='',
+master_ssl_verify_server_cert=0,
+master_ssl=0;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result
index 7fd9a6a9c92..65715b471aa 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_000001.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_000001.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
@@ -40,6 +36,7 @@ stop slave;
reset slave;
lock tables t1 read;
start slave;
+include/sync_slave_io_with_master.inc
unlock tables;
create table t2(id int);
insert into t2 values(connection_id());
@@ -52,8 +49,7 @@ select (@id := id) - id from t2;
kill @id;
drop table t2;
Got one of the listed errors
-set global sql_slave_skip_counter=1;
-start slave;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1053]
select count(*) from t1;
count(*)
5000
@@ -82,3 +78,4 @@ select_priv user
Y blafasel2
drop table t1;
delete from mysql.user where user="blafasel2";
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
index e69952787fb..d4a14adc6b8 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t1 (a int, unique(a)) engine=myisam;
set sql_log_bin=0;
insert into t1 values(2);
@@ -11,6 +7,11 @@ set sql_log_bin=1;
insert into t1 values(1),(2);
ERROR 23000: Duplicate entry '2' for key 'a'
drop table t1;
-Error: "Query caused different errors on master and slave. Error on master: 'Duplicate entry '%-.192s' for key %d' (1062), Error on slave: 'no error' (0). Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave)
+include/wait_for_slave_sql_to_stop.inc
+call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* Error_code: 0");
+Error: "Query caused different errors on master and slave. Error on master: message (format)='Duplicate entry '%-.192s' for key %d' error code=1062 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave)
Errno: "0" (expected 0)
drop table t1;
+include/stop_slave.inc
+RESET SLAVE;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result b/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result
index 7cbe1d73254..cade32bbfdd 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY);
@@ -206,3 +202,4 @@ DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
DROP FUNCTION IF EXISTS f1;
DROP TRIGGER IF EXISTS tr1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
index 1ad34fbe961..14ed79680f1 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
@@ -1,10 +1,10 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
@@ -15,13 +15,11 @@ CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
Got one of the listed errors
*** Single statement on non-transactional table ***
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
*** Single statement on both transactional and non-transactional tables. ***
Got one of the listed errors
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
-START SLAVE SQL_THREAD;
-source include/diff_master_slave.inc;
+include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 2 - BEGIN - IMPLICIT COMMIT by DDL
########################################################################################
@@ -38,7 +36,7 @@ Got one of the listed errors
BEGIN;
Got one of the listed errors
Got one of the listed errors
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 3 - BEGIN - COMMIT
########################################################################################
@@ -50,7 +48,7 @@ Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 4 - BEGIN - ROLLBACK
########################################################################################
@@ -64,7 +62,7 @@ Got one of the listed errors
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 5 - PROCEDURE
########################################################################################
@@ -88,7 +86,7 @@ TRUNCATE TABLE t1;
BEGIN;
Got one of the listed errors
ROLLBACK;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 6 - XID
########################################################################################
@@ -103,7 +101,7 @@ ROLLBACK TO sv;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 7 - NON-TRANS TABLE
########################################################################################
@@ -118,7 +116,45 @@ COMMIT;
BEGIN;
Got one of the listed errors
COMMIT;
-source include/diff_master_slave.inc;
+include/diff_tables.inc [master:t1,slave:t1]
+########################################################################
+# 8 - Bug#55375(Regression Bug) Transaction bigger than
+# max_binlog_cache_size crashes slave
+########################################################################
+# [ On Slave ]
+SET GLOBAL max_binlog_cache_size = 4096;
+SET GLOBAL binlog_cache_size = 4096;
+SET GLOBAL max_binlog_stmt_cache_size = 4096;
+SET GLOBAL binlog_stmt_cache_size = 4096;
+include/stop_slave.inc
+include/start_slave.inc
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
+CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master. Message: error writing to the binary log");
+TRUNCATE t1;
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+BEGIN;
+Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
+COMMIT;
+include/wait_for_slave_sql_error.inc [errno=1197]
+SELECT count(*) FROM t1;
+count(*)
+0
+show binlog events in 'slave-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
+SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
+SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+include/stop_slave.inc
+include/start_slave.inc
+SELECT count(*) FROM t1;
+count(*)
+128
########################################################################################
# CLEAN
########################################################################################
@@ -126,8 +162,6 @@ DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE IF EXISTS t4;
-DROP TABLE IF EXISTS t5;
-DROP TABLE IF EXISTS t6;
-Warnings:
-Note 1051 Unknown table 't6'
+DROP TABLE t5;
DROP PROCEDURE p1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result
index 6d9759b3562..e30429540fb 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==== Initialize ====
[on master]
CREATE TABLE t1(a INT PRIMARY KEY);
@@ -19,14 +15,17 @@ a
1
[on slave]
---- Wait until slave stops with an error ----
+include/wait_for_slave_sql_error.inc [errno=1062]
Last_SQL_Error (expected "duplicate key" error)
Error 'Duplicate entry '1' for key 'PRIMARY'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (1)'
+call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
SELECT * FROM t1;
a
1
---- Resolve the conflict on the slave and restart SQL thread ----
DELETE FROM t1 WHERE a = 1;
START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_start.inc
---- Sync slave and verify that there is no error ----
Last_SQL_Error = '' (expected no error)
SELECT * FROM t1;
@@ -53,3 +52,4 @@ a
[on master]
DROP TABLE t1;
[on slave]
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result
index 75f668d8c08..3f72e281b0b 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -1613,3 +1609,4 @@ DROP TABLE IF EXISTS nt_1;
DROP TABLE IF EXISTS tt_2;
DROP TABLE IF EXISTS tt_1;
SET @commands= '';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
index fe2fb1d9da2..6b8d8b9407e 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
@@ -1,10 +1,6 @@
-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=MyISAM;
+include/master-slave.inc
+[connection master]
+create table t1 (a int);
insert into t1 values (10);
create table t2 (a int) ENGINE=MyISAM;
create table t3 (a int) engine=merge union(t1);
@@ -21,10 +17,13 @@ flush tables;
select * from t3;
a
stop slave;
+include/wait_for_slave_to_stop.inc
drop table t1;
flush tables with read lock;
start slave;
+include/wait_for_slave_to_start.inc
stop slave;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;
drop table t3, t4, t5;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_found_rows.result b/mysql-test/suite/rpl/r/rpl_stm_found_rows.result
index 2388c4e4b7c..eff96952918 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_found_rows.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_found_rows.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==== Initialize ====
**** On Master ****
CREATE TABLE t1 (a INT);
@@ -100,8 +96,4 @@ DROP TABLE t1, logtbl;
DROP PROCEDURE just_log;
DROP PROCEDURE calc_and_log;
DROP FUNCTION log_rows;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result
index e48f1a7d0f3..626b748e63d 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
set session storage_engine=innodb;
#########################################################################
# CONFIGURATION
@@ -524,10 +520,8 @@ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db
###################################################################################
# CHECK CONSISTENCY
###################################################################################
-Comparing tables master:test.tt_1 and slave:test.tt_1
+include/diff_tables.inc [master:tt_1,slave:tt_1]
###################################################################################
# CLEAN
###################################################################################
-DROP TABLE tt_1;
-DROP TABLE tt_2;
-DROP TABLE nt_1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_innodb.result b/mysql-test/suite/rpl/r/rpl_stm_innodb.result
index f99457faaf0..0e9531317b9 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_innodb.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t4 (
id INT(5) unsigned NOT NULL auto_increment,
name varchar(15) NOT NULL default '',
@@ -130,3 +126,4 @@ id b
DROP TABLE t1;
DROP TABLE t3;
End of 6.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result
index c6b743c7c89..afff633cd49 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
select @@global.binlog_format;
@@ -51,8 +47,8 @@ CREATE TABLE t1(a int, UNIQUE(a));
INSERT DELAYED IGNORE INTO t1 VALUES(1);
INSERT DELAYED IGNORE INTO t1 VALUES(1);
flush table t1;
-use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
-use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+use `test`; INSERT IGNORE INTO t1 VALUES(1)
+use `test`; INSERT IGNORE INTO t1 VALUES(1)
select * from t1;
a
1
@@ -60,10 +56,10 @@ On slave
show binlog events in 'slave-bin.000002' from <binlog_start> limit 1,6;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 # Query # # BEGIN
-slave-bin.000002 # Query # # use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+slave-bin.000002 # Query # # use `test`; INSERT IGNORE INTO t1 VALUES(1)
slave-bin.000002 # Query # # COMMIT
slave-bin.000002 # Query # # BEGIN
-slave-bin.000002 # Query # # use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1)
+slave-bin.000002 # Query # # use `test`; INSERT IGNORE INTO t1 VALUES(1)
slave-bin.000002 # Query # # COMMIT
select * from t1;
a
@@ -72,3 +68,4 @@ drop table t1;
FLUSH LOGS;
FLUSH LOGS;
End of 5.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result
index 417da0e2237..feedc3d8281 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result
@@ -14,13 +14,8 @@ master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA CONCURRENT INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`c1`) ;file_id=#
master-bin.000001 # Query # # COMMIT
DROP TABLE t1;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-reset master;
+include/master-slave.inc
+[connection master]
select last_insert_id();
last_insert_id()
0
@@ -48,32 +43,29 @@ drop table t3;
create table t1(a int, b int, unique(b));
insert into t1 values(1,10);
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
-set global sql_slave_skip_counter=1;
-start slave;
-Last_SQL_Errno=0
-Last_SQL_Error
-
+call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* Error_code: 1062");
+call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*Error_code: 0");
+include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
+include/check_slave_no_error.inc
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
-stop slave;
+include/wait_for_slave_sql_error.inc [errno=1062]
+include/stop_slave_io.inc
change master to master_user='test';
change master to master_user='root';
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/check_slave_no_error.inc
set global sql_slave_skip_counter=1;
start slave;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
+include/wait_for_slave_sql_error.inc [errno=1062]
stop slave;
reset slave;
-Last_SQL_Errno=0
-Last_SQL_Error
-
+include/check_slave_no_error.inc
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM;
@@ -96,18 +88,14 @@ load data CONCURRENT infile '../../std_data/rpl_loaddata2.dat' into table t2 fie
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'
+include/wait_for_slave_sql_error.inc [errno=0]
drop table t1, t2;
drop table t1, t2;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
LOAD DATA CONCURRENT INFILE "../../std_data/words.dat" INTO TABLE t1;
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
-DROP TABLE IF EXISTS t1;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+DROP TABLE t1;
+include/rpl_reset.inc
drop database if exists b48297_db1;
drop database if exists b42897_db2;
create database b48297_db1;
@@ -128,15 +116,10 @@ LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO
LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
### disconnect and switch back to master connection
use b48297_db1;
-Comparing tables master:b48297_db1.t1 and slave:b48297_db1.t1
+include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1]
DROP DATABASE b48297_db1;
DROP DATABASE b42897_db2;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
@@ -148,3 +131,4 @@ Field 3 'Field 4'
'Field 5' 'Field 6'
Field 6 'Field 7'
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result
index 1abb0d88bbe..72fae5ce6ee 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
@@ -229,3 +225,4 @@ aberration
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE test.t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result
index 472be5ee607..3bb3f347a43 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_log.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result
@@ -1,13 +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;
+include/master-slave.inc
+[connection master]
include/stop_slave.inc
+include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
+include/wait_for_slave_to_start.inc
create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
insert into t1 values (NULL);
drop table t1;
@@ -241,18 +239,13 @@ slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM
slave-bin.000002 # Query # # BEGIN
slave-bin.000002 # Query # # use `test`; insert into t2 values (1)
slave-bin.000002 # Query # # COMMIT
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
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;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
set insert_id=5;
@@ -275,3 +268,4 @@ a b
5 1
6 1
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
index 547dd8e1541..379cea4d3fc 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
stop slave;
#
# Generate a big enough master's binlog to cause relay log rotations
@@ -23,7 +19,7 @@ select @@global.max_relay_log_size;
@@global.max_relay_log_size
4096
start slave;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 2
#
@@ -33,7 +29,7 @@ set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size;
@@global.max_relay_log_size 20480
start slave;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 3: max_relay_log_size = 0
#
@@ -43,7 +39,7 @@ set global max_relay_log_size=0;
select @@global.max_relay_log_size;
@@global.max_relay_log_size 0
start slave;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
#
@@ -57,13 +53,13 @@ reset slave;
start slave;
flush logs;
create table t1 (a int);
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
#
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
#
flush logs;
drop table t1;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
@@ -72,3 +68,4 @@ set global max_binlog_size= @my_max_binlog_size;
#
# End of 4.1 tests
#
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
index 5dc86137635..f706fa0fe75 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
@@ -1,18 +1,12 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
-INSERT INTO t1 VALUES (4);
-INSERT INTO t1 VALUES (5);
-INSERT INTO t1 VALUES (6);
-[MASTER] ********* SOW BINLOG EVENTS IN ... *********
-show binlog events from <binlog_start>;
+******** [master] SHOW BINLOG EVENTS IN <FILE> ********
+show binlog events in 'master-bin.000001' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
master-bin.000001 # Query # # BEGIN
@@ -24,16 +18,17 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
master-bin.000001 # Query # # COMMIT
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'master-bin.000001' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'master-bin.000001' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
master-bin.000001 # Query # # COMMIT
-[MASTER] ********* SOW BINLOG EVENTS *********
+******** [master] SHOW BINLOG EVENTS ********
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
@@ -46,30 +41,8 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
-master-bin.000001 # Query # # COMMIT
-[MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows *********
-show binlog events from <binlog_start> limit 3;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
-[MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
-show binlog events from <binlog_start> limit 1,4;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-[SLAVE] ********* SOW BINLOG EVENTS IN ... *********
-show binlog events from <binlog_start>;
+******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
+show binlog events in 'slave-bin.000001' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
slave-bin.000001 # Query # # BEGIN
@@ -81,16 +54,17 @@ slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
slave-bin.000001 # Query # # COMMIT
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'slave-bin.000001' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'slave-bin.000001' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
+slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
slave-bin.000001 # Query # # COMMIT
-[SLAVE] ********* SOW BINLOG EVENTS *********
+******** [slave] SHOW BINLOG EVENTS ********
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
@@ -103,29 +77,7 @@ slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
-slave-bin.000001 # Query # # COMMIT
-[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows *********
-show binlog events from <binlog_start> limit 3;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
-[SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows *********
-show binlog events from <binlog_start> limit 1,4;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-[SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ********
show relaylog events in 'slave-relay-bin.000003' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4
@@ -140,39 +92,35 @@ slave-relay-bin.000003 # Query # # COMMIT
slave-relay-bin.000003 # Query # # BEGIN
slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (3)
slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (6)
-slave-relay-bin.000003 # Query # # COMMIT
-[SLAVE] ********* SOW RELAYLOG EVENTS *********
-show relaylog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=4
-[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT rows *********
-show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 3;
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ********
+show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4
-slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
-slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
-[MASTER] ********* SOW RELAYLOG EVENTS ... LIMIT offset,rows *********
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ********
show relaylog events in 'slave-relay-bin.000003' from <binlog_start> limit 1,3;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
slave-relay-bin.000003 # Query # # BEGIN
+******** [slave] SHOW RELAYLOG EVENTS ********
+show relaylog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=4
FLUSH LOGS;
FLUSH LOGS;
DROP TABLE t1;
-[MASTER] ********* SOW BINLOG EVENTS IN ... *********
+******** [master] SHOW BINLOG EVENTS IN <FILE> ********
show binlog events in 'master-bin.000002' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
-[MASTER] ********* SOW BINLOG EVENTS *********
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'master-bin.000002' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'master-bin.000002' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
+******** [master] SHOW BINLOG EVENTS ********
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
@@ -185,21 +133,19 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
-master-bin.000001 # Query # # COMMIT
master-bin.000001 # Rotate # # master-bin.000002;pos=4
-[SLAVE] ********* SOW BINLOG EVENTS IN ... *********
+******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
show binlog events in 'slave-bin.000002' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
-[SLAVE] ********* SOW BINLOG EVENTS *********
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
+show binlog events in 'slave-bin.000002' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show binlog events in 'slave-bin.000002' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
+******** [slave] SHOW BINLOG EVENTS ********
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
@@ -212,23 +158,25 @@ slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5)
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6)
-slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Rotate # # slave-bin.000002;pos=4
-[SLAVE] ********* SOW RELAYLOG EVENTS IN ... *********
-show relaylog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4
-slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4
-[SLAVE] ********* SOW RELAYLOG EVENTS *********
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ********
+show relaylog events in 'slave-relay-bin.000006' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=4
+slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ********
+show relaylog events in 'slave-relay-bin.000006' from <binlog_start> limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=4
+******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ********
+show relaylog events in 'slave-relay-bin.000006' from <binlog_start> limit 1,3;
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+******** [slave] SHOW RELAYLOG EVENTS ********
show relaylog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=4
slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=4
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
index c11f974ac2f..6e0ee695b41 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
#########################################################################
# CONFIGURATION
#########################################################################
@@ -11266,23 +11262,6 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_xx_
###################################################################################
# CLEAN
###################################################################################
-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` int(10) unsigned NOT NULL AUTO_INCREMENT,
-`c2` tinyint(1) unsigned DEFAULT NULL,
-`c3` varchar(300) DEFAULT NULL,
-`c4` int(10) unsigned NOT NULL,
-`c5` int(10) unsigned DEFAULT NULL,
-PRIMARY KEY (`c1`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-ALTER TABLE `t1` Engine=InnoDB;
-SET AUTOCOMMIT=0;
-INSERT INTO t1 (c1,c2,c3,c4,c5) VALUES (1, 1, 'X', 1, NULL);
-COMMIT;
-ROLLBACK;
-SET AUTOCOMMIT=1;
-Comparing tables master:test.t1 and slave:test.t1
-DROP TABLE `t1`;
+include/rpl_reset.inc
+include/diff_tables.inc [master:t1, slave:t1]
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_multi_query.result b/mysql-test/suite/rpl/r/rpl_stm_multi_query.result
index 0bd57d4b78a..68c769a7ede 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_multi_query.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_multi_query.result
@@ -1,10 +1,5 @@
-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 mysqltest;
+include/master-slave.inc
+[connection master]
create database mysqltest;
create table mysqltest.t1 ( n int);
insert into mysqltest.t1 values(1)/
@@ -21,7 +16,6 @@ n
5
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 mysqltest
master-bin.000001 # Query # # create database mysqltest
master-bin.000001 # Query # # use `test`; create table mysqltest.t1 ( n int)
master-bin.000001 # Query # # BEGIN
@@ -40,3 +34,4 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; insert into mysqltest.t1 values(5)
master-bin.000001 # Query # # COMMIT
drop database mysqltest;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_no_op.result b/mysql-test/suite/rpl/r/rpl_stm_no_op.result
index 5a253d61fcb..cf5b03cdfa6 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_no_op.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_no_op.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create database mysqltest;
drop database if exists mysqltest;
Warnings:
@@ -50,3 +46,4 @@ a b
select * from t2;
a b
drop table t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
index c6c2c525098..aa8bc63a432 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
@@ -1,22 +1,18 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-Master_User root
-Master_Host 127.0.0.1
+include/master-slave.inc
+[connection master]
+Master_User = 'root'
+Master_Host = '127.0.0.1'
include/stop_slave.inc
change master to master_user='test';
-Master_User test
-Master_Host 127.0.0.1
+Master_User = 'test'
+Master_Host = '127.0.0.1'
reset slave;
-Master_User test
-Master_Host 127.0.0.1
+Master_User = 'test'
+Master_Host = '127.0.0.1'
change master to master_user='root';
include/start_slave.inc
-Master_User root
-Master_Host 127.0.0.1
+Master_User = 'root'
+Master_Host = '127.0.0.1'
include/stop_slave.inc
reset slave;
include/start_slave.inc
@@ -29,13 +25,20 @@ Variable_name Value
Slave_open_temp_tables 1
include/stop_slave.inc
reset slave;
+include/check_slave_no_error.inc
change master to master_user='impossible_user_name';
start slave;
-stop slave;
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
change master to master_user='root';
include/start_slave.inc
+include/check_slave_no_error.inc
stop slave;
change master to master_user='impossible_user_name';
start slave;
-stop slave;
+include/wait_for_slave_io_error.inc [errno=1045]
+include/stop_slave_sql.inc
reset slave;
+include/check_slave_no_error.inc
+change master to master_user='root';
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result b/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result
index fd143fc8a50..fa5ac2a0c85 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TABLE t1 (pk integer auto_increment , primary key (pk));
SET SESSION SQL_MODE='traditional';
# **** [MASTER] *****
@@ -16,3 +12,4 @@ DROP TABLE t1;
# assertion: sync slave with master makes slave not to stop with
# duplicate key error (because it has received event
# with expected error code).
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result
index 71ad0177bae..57206873e2f 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result
@@ -1,17 +1,19 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
+SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit;
+SET @@global.innodb_flush_log_at_trx_commit= 0;
+SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit;
+SET @@global.innodb_flush_log_at_trx_commit= 0;
SET @@session.binlog_direct_non_transactional_updates= FALSE;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table t1(n int);
stop slave;
+include/wait_for_slave_to_stop.inc
start slave;
stop slave io_thread;
start slave io_thread;
+include/wait_for_slave_to_start.inc
drop table t1;
create table t1i(n int primary key) engine=innodb;
create table t2m(n int primary key) engine=myisam;
@@ -33,6 +35,7 @@ zero
0
stop slave;
rollback;
+include/wait_for_slave_to_stop.inc
*** sql thread is *not* running: No ***
*** the prove: the stopped slave has finished the current transaction ***
five
@@ -43,3 +46,30 @@ one
1
include/start_slave.inc
drop table t1i, t2m;
+#
+# Bug#56096 STOP SLAVE hangs if executed in parallel with user sleep
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT );
+# Slave1: lock table for synchronization
+LOCK TABLES t1 WRITE;
+# Master: insert into the table
+INSERT INTO t1 SELECT SLEEP(4);
+Warnings:
+Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
+# Slave: wait for the insert
+# Slave: send slave stop
+STOP SLAVE;
+# Slave1: wait for stop slave
+# Slave1: unlock the table
+UNLOCK TABLES;
+# Slave: wait for the slave to stop
+include/wait_for_slave_to_stop.inc
+# Start slave again
+include/start_slave.inc
+# Clean up
+DROP TABLE t1;
+SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit;
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result
index eb1d6689bfc..0b3233437aa 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
SET @@session.binlog_direct_non_transactional_updates= FALSE;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table tm (a int auto_increment primary key) engine=myisam;
@@ -15,6 +11,9 @@ insert into tm set a=null;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.
commit;
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+call mtr.add_suppression("Slave SQL.*Slave SQL Thread stopped with incomplete event group having non-transactional changes");
+include/wait_for_slave_sql_to_stop.inc
SELECT "NO" AS Last_SQL_Error, @check as `true`;
Last_SQL_Error true
NO 1
@@ -36,9 +35,10 @@ insert into tm set a=null;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.
commit;
-SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
+include/wait_for_slave_sql_to_stop.inc
+SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
Last_SQL_Error true
-Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1
+Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1
select count(*) as one from tm;
one
1
@@ -52,9 +52,10 @@ include/start_slave.inc
set @@global.debug="+d,stop_slave_middle_group";
set @@global.debug="+d,incomplete_group_in_relay_log";
update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2;
-SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
+include/wait_for_slave_sql_to_stop.inc
+SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
Last_SQL_Error true
-Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1
+Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1
select max(a) as two from tm;
two
2
@@ -62,6 +63,6 @@ select max(a) as one from ti;
one
1
set @@global.debug="-d";
+include/rpl_reset.inc
drop table tm, ti;
-include/stop_slave.inc
-drop table tm, ti;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result
index c9c97bc533c..ed1d9a6f226 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_until.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_until.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
[on slave]
include/stop_slave.inc
==== Create some events on master ====
@@ -18,29 +14,41 @@ drop table t2;
==== Replicate one event at a time on slave ====
[on slave]
start slave until master_log_file='MASTER_LOG_FILE', master_log_pos=MASTER_LOG_POS;
+include/wait_for_slave_io_to_start.inc
+include/wait_for_slave_sql_to_stop.inc
select * from t1;
n
1
2
3
4
+include/check_slave_param.inc [Exec_Master_Log_Pos]
start slave until master_log_file='master-no-such-bin.000001', master_log_pos=MASTER_LOG_POS;
+include/wait_for_slave_io_to_start.inc
+include/wait_for_slave_sql_to_stop.inc
select * from t1;
n
1
2
3
4
-start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=RELAY_LOG_POS;
+include/check_slave_param.inc [Exec_Master_Log_Pos]
+start slave until relay_log_file='slave-relay-bin.000003', relay_log_pos=RELAY_LOG_POS;
+include/wait_for_slave_io_to_start.inc
+include/wait_for_slave_sql_to_stop.inc
select * from t2;
n
1
2
+include/check_slave_param.inc [Exec_Master_Log_Pos]
start slave;
[on master]
[on slave]
include/stop_slave.inc
start slave until master_log_file='MASTER_LOG_FILE', master_log_pos=MASTER_LOG_POS;
+include/wait_for_slave_io_to_start.inc
+include/wait_for_slave_sql_to_stop.inc
+include/check_slave_param.inc [Exec_Master_Log_Pos]
==== Test various error conditions ====
start slave until master_log_file='master-bin', master_log_pos=MASTER_LOG_POS;
ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
@@ -75,6 +83,7 @@ select count(*) as two from t1;
two
2
start slave until master_log_file='MASTER_LOG_FILE', master_log_pos= UNTIL_POS;;
+include/wait_for_slave_sql_to_stop.inc
slave stopped at the prescribed position
select 0 as zero;
zero
@@ -84,24 +93,17 @@ one
1
drop table t1;
start slave;
-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'
+include/rpl_reset.inc
+flush logs;
stop slave;
flush logs;
flush logs;
reset slave;
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_LOG_POS; /* to stop right before DROP */;
+include/wait_for_slave_sql_to_stop.inc
show tables /* t1 must exist */;
Tables_in_test
t1
drop table t1;
stop slave;
-reset slave;
-reset master;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_user_variables.result b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result
index 8f43425b201..e59928af66d 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_user_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
SET @positive= 18446744073709551615;
SET @negative= -9223372036854775808;
CREATE TABLE t1 (`tinyint` TINYINT,
@@ -58,7 +54,7 @@ real 18446744073709552000.00
decimal 18446744073709551615.00
#########################################
## assertion: master and slave tables are in sync
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
TRUNCATE t1;
### b) user var
INSERT INTO t1 VALUES (@positive,
@@ -110,7 +106,7 @@ real 18446744073709552000.00
decimal 18446744073709551615.00
#########################################
## assertion: master and slave tables are in sync
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
TRUNCATE t1;
### insert min signed
### a) declarative
@@ -150,7 +146,7 @@ real -9223372036854776000.00
decimal -9223372036854775808.00
#########################################
## assertion: master and slave tables are in sync
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
TRUNCATE t1;
### b) user var
INSERT INTO t1 VALUES (@negative,
@@ -202,16 +198,11 @@ real -9223372036854776000.00
decimal -9223372036854775808.00
#########################################
## assertion: master and slave tables are in sync
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
TRUNCATE t1;
## check: contents of both tables master's and slave's
DROP TABLE t1;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t1 ( c INT, PRIMARY KEY (c)) Engine=MyISAM;
CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW SET @aux = -1 ;
SET @aux = 10294947273192243200;
@@ -219,6 +210,7 @@ SET @aux1= @aux;
INSERT INTO t1 VALUES (@aux) , (@aux1);
ERROR 23000: Duplicate entry '2147483647' for key 'PRIMARY'
## assertion: master and slave tables are in sync
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1,slave:t1]
DROP TRIGGER tr1;
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result
new file mode 100644
index 00000000000..588d9bbabf5
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result
@@ -0,0 +1,122 @@
+include/master-slave.inc
+[connection master]
+
+# BUG#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends
+#
+# If a temporary table is created or dropped, the transaction should be
+# regarded similarly that a non-transactional table is modified. So
+# STOP SLAVE should wait until the transaction has finished.
+CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
+CREATE TABLE t2(c1 INT) ENGINE=InnoDB;
+SET DEBUG_SYNC= 'RESET';
+include/stop_slave.inc
+
+# Suspend the INSERT statement in current transaction on SQL thread.
+# It guarantees that SQL thread is applying the transaction when
+# STOP SLAVE command launchs.
+SET GLOBAL debug= 'd,after_mysql_insert';
+include/start_slave.inc
+
+# CREATE TEMPORARY TABLE with InnoDB engine
+# -----------------------------------------
+
+[ On Master ]
+BEGIN;
+DELETE FROM t1;
+CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1);
+DROP TEMPORARY TABLE tt1;
+COMMIT;
+
+[ On Slave ]
+STOP SLAVE SQL_THREAD;
+
+[ On Slave1 ]
+# To resume slave SQL thread
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'RESET';
+
+[ On Slave ]
+include/wait_for_slave_sql_to_stop.inc
+# Slave should stop after the transaction has committed.
+# So t1 on master is same to t1 on slave.
+include/diff_tables.inc [master:t1, slave:t1]
+START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_start.inc
+
+# CREATE TEMPORARY TABLE ... SELECT with InnoDB engine
+# ----------------------------------------------------
+
+[ On Master ]
+BEGIN;
+DELETE FROM t1;
+CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB
+SELECT c1 FROM t2;
+INSERT INTO t1 VALUES (1);
+DROP TEMPORARY TABLE tt1;
+COMMIT;
+
+[ On Slave ]
+STOP SLAVE SQL_THREAD;
+
+[ On Slave1 ]
+# To resume slave SQL thread
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'RESET';
+
+[ On Slave ]
+include/wait_for_slave_sql_to_stop.inc
+# Slave should stop after the transaction has committed.
+# So t1 on master is same to t1 on slave.
+include/diff_tables.inc [master:t1, slave:t1]
+START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_start.inc
+
+# Test end
+SET GLOBAL debug= '$debug_save';
+include/restart_slave.inc
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+[connection master]
+DROP TABLE t1, t2;
+
+# Bug#58546 test rpl_packet timeout failure sporadically on PB
+# ----------------------------------------------------------------------
+# STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
+# possible that IO thread stopped after replicating part of a transaction
+# which SQL thread was executing. SQL thread would be hung if the
+# transaction could not be rolled back safely.
+# It caused some sporadic failures on PB2.
+#
+# This test verifies that when 'STOP SLAVE' is issued by a user, IO
+# thread will continue to fetch the rest events of the transaction which
+# is being executed by SQL thread and is not able to be rolled back safely.
+CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(1, 1);
+[connection master]
+SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
+[connection slave]
+include/restart_slave.inc
+BEGIN;
+UPDATE t1 SET c2 = 2 WHERE c1 = 1;
+[connection master]
+BEGIN;
+INSERT INTO t1 VALUES(2, 2);
+INSERT INTO t2 VALUES(1);
+UPDATE t1 SET c2 = 3 WHERE c1 = 1;
+COMMIT;
+[connection slave1]
+STOP SLAVE;
+[connection slave]
+ROLLBACK;
+[connection master]
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'RESET';
+[connection slave]
+include/wait_for_slave_to_stop.inc
+[connection slave1]
+include/start_slave.inc
+[connection master]
+DROP TABLE t1, t2;
+SET GLOBAL debug= $debug_save;
+include/rpl_end.inc
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
index 23400df98bc..33666defaa4 100644
--- a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
@@ -427,3 +423,4 @@ INSERT INTO t13 VALUES (CURRENT_USER());
INSERT INTO t13 VALUES (my_current_user());
drop database mysqltest1;
set global binlog_format =@my_binlog_format;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sync.result b/mysql-test/suite/rpl/r/rpl_sync.result
index edc20c46140..de3506465aa 100644
--- a/mysql-test/suite/rpl/r/rpl_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_sync.result
@@ -1,10 +1,6 @@
=====Configuring the enviroment=======;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb;
@@ -12,20 +8,21 @@ insert into t1(a) values(1);
insert into t1(a) values(2);
insert into t1(a) values(3);
=====Inserting data on the master but without the SQL Thread being running=======;
-stop slave SQL_THREAD;
+include/stop_slave_sql.inc
insert into t1(a) values(4);
insert into t1(a) values(5);
insert into t1(a) values(6);
=====Removing relay log files and crashing/recoverying the slave=======;
-stop slave IO_THREAD;
+include/stop_slave_io.inc
SET SESSION debug="d,crash_before_rotate_relaylog";
FLUSH LOGS;
ERROR HY000: Lost connection to MySQL server during query
+include/rpl_reconnect.inc
=====Dumping and comparing tables=======;
-start slave;
-Comparing tables master:test.t1 and slave:test.t1
+include/start_slave.inc
+include/diff_tables.inc [master:t1,slave:t1]
=====Corrupting the master.info=======;
-stop slave;
+include/stop_slave.inc
FLUSH LOGS;
insert into t1(a) values(7);
insert into t1(a) values(8);
@@ -33,8 +30,10 @@ insert into t1(a) values(9);
SET SESSION debug="d,crash_before_rotate_relaylog";
FLUSH LOGS;
ERROR HY000: Lost connection to MySQL server during query
+include/rpl_reconnect.inc
=====Dumping and comparing tables=======;
-start slave;
-Comparing tables master:test.t1 and slave:test.t1
+include/start_slave.inc
+include/diff_tables.inc [master:t1,slave:t1]
=====Clean up=======;
drop table t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temp_table.result b/mysql-test/suite/rpl/r/rpl_temp_table.result
index e4ca31d8908..e7df070874a 100644
--- a/mysql-test/suite/rpl/r/rpl_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_temp_table.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create table t2 (n int, PRIMARY KEY(n));
create temporary table t1 (n int);
create temporary table t3 (n int not null);
@@ -46,3 +42,4 @@ Slave_open_temp_tables 0
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 't1'
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
index e90d7c3f2d2..8fb910666dc 100644
--- a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
+++ b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==== Initialize ====
[on master]
CREATE TABLE t1 (a CHAR(48));
@@ -15,6 +11,7 @@ SHOW STATUS LIKE "Slave_open_temp_tables";
Variable_name Value
Slave_open_temp_tables 1
[on master]
+[on master1]
[on slave]
==== Verify results on slave ====
SHOW STATUS LIKE "Slave_open_temp_tables";
@@ -22,14 +19,10 @@ Variable_name Value
Slave_open_temp_tables 0
==== Clean up ====
[on master]
+include/rpl_connect.inc [creating master]
DROP TABLE t1;
[on slave]
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
CREATE TABLE t1 (a int);
CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
@@ -65,9 +58,54 @@ slave-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server
slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Xid # # COMMIT /* XID */
slave-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2_tmp` /* generated by server */
slave-bin.000001 # Query # # BEGIN
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2)
-slave-bin.000001 # Query # # COMMIT
+slave-bin.000001 # Xid # # COMMIT /* XID */
slave-bin.000001 # Query # # use `test`; DROP TABLE `t3`,`t1` /* generated by server */
+
+# Bug#55478 Row events wrongly apply on the temporary table of the same name
+# ==========================================================================
+# The statement should be binlogged
+CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=InnoDB;
+
+# Case 1: CREATE TABLE t1 ... SELECT
+# ----------------------------------
+
+# The statement generates row events on t1. And the rows events should
+# be inserted into the base table on slave.
+CREATE TABLE t1 ENGINE=MyISAM SELECT rand();
+show binlog events in 'master-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` (
+ `rand()` double NOT NULL DEFAULT '0'
+) 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 # # COMMIT
+
+# Case 2: DROP TEMPORARY TABLE in a transacation
+# ----------------------------------------------
+
+BEGIN;
+DROP TEMPORARY TABLE t1;
+# The rows event will binlogged before 'DROP TEMPORARY TABLE t1',
+# as t1 is non-transactional table
+INSERT INTO t1 VALUES(Rand());
+COMMIT;
+show binlog events in 'master-bin.000001' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */
+master-bin.000001 # Query # # COMMIT
+# Compare the base table.
+include/diff_tables.inc [master:t1, slave:t1]
+
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result
index 1e73e4ecad7..dfab66d074f 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary.result
@@ -1,11 +1,6 @@
-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 sql_log_bin = 0;
-SET sql_log_bin = 1;
+include/master-slave.inc
+[connection master]
+call mtr.add_suppression("Slave: Can\'t find record in \'user\' Error_code: 1032");
reset master;
DROP TABLE IF EXISTS t1;
CREATE TEMPORARY TABLE t1 (a char(1));
@@ -130,8 +125,8 @@ select * from t1;
a
1
drop table t1;
-SET sql_log_bin = 0;
-SET sql_log_bin = 1;
+include/stop_slave.inc
+include/rpl_reset.inc
-- Bug#43748
-- make a user on the slave that can list but not kill system threads.
FLUSH PRIVILEGES;
@@ -143,5 +138,5 @@ KILL @id;
Got one of the listed errors
-- throw out test-user on slave.
DROP USER user43748@127.0.0.1;
--- done. back to master.
End of 5.1 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-test/suite/rpl/r/rpl_temporary_errors.result
index 64fa4ed14ea..4a9a8e1dad4 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Deadlock found");
**** On Master ****
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
@@ -39,7 +35,8 @@ a b
2 2
3 3
4 4
-Checking that both slave threads are running.
-DROP TABLE t1;
+include/check_slave_is_running.inc
+call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1");
**** On Master ****
DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_test_framework.result b/mysql-test/suite/rpl/r/rpl_test_framework.result
new file mode 100644
index 00000000000..e45c12ba0ec
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_test_framework.result
@@ -0,0 +1,170 @@
+==== Create t1 on all servers. ====
+include/rpl_init.inc [topology=1->2->3->4->5->6->7->8->9]
+CREATE TABLE t1 (a INT);
+include/rpl_end.inc
+==== Test 3-server topologies ====
+include/rpl_init.inc [topology=1 -> 2]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 12'
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1);
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (1);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=2 -> 3]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 23'
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (2);
+[connection server_2]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (2);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=none]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ''
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (3);
+[connection server_2]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (3);
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (3);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=1->2, 2->1]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 212'
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (4);
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (4);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=1->2->1]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 212'
+[connection server_2]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (5);
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (5);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=2->1->2]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 212'
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (6);
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (6);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=1->2->3]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 123'
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (7);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=2->3->2->1]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 323 21'
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (8);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=1->2,2->3,3->1]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 23123'
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (9);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=1->3->2->1]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 13213'
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (10);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1]
+include/rpl_end.inc
+==== Test 6-server topologies ====
+include/rpl_init.inc [topology=1->2->3->4->1->5->6]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 341234156'
+[connection server_1]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (11);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1,server_4:t1,server_5:t1,server_6:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=3->4->5->6->3->1->2]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 4563456 312'
+[connection server_4]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (12);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1,server_4:t1,server_5:t1,server_6:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=6->5->4->3->2->1]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 65 54 43 32 21'
+[connection server_6]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (13);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1,server_4:t1,server_5:t1,server_6:t1]
+include/rpl_end.inc
+include/rpl_init.inc [topology=1->2->3->1,4->5->6]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 456 23123'
+[connection server_3]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (14);
+[connection server_4]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (14);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1,server_4:t1,server_5:t1,server_6:t1]
+include/rpl_end.inc
+==== Test 9-server topology ====
+include/rpl_init.inc [topology=1->2, 2->3, 3->4, 4->5, 5->1, 1->6, 6->7, 6->8, 8->9]
+include/rpl_generate_sync_chain.inc
+rpl_sync_chain= ' 345123451689 67'
+[connection server_2]
+DELETE FROM t1;
+INSERT INTO t1 VALUES (15);
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1,server_4:t1,server_5:t1,server_6:t1,server_7:t1,server_8:t1,server_9:t1]
+include/rpl_end.inc
+==== Clean up ====
+include/rpl_init.inc [topology=1->2->3->4->5->6->7->8->9]
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_timezone.result b/mysql-test/suite/rpl/r/rpl_timezone.result
index 0b5c03b5300..ce93c3030c0 100644
--- a/mysql-test/suite/rpl/r/rpl_timezone.result
+++ b/mysql-test/suite/rpl/r/rpl_timezone.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
set @my_time_zone= @@global.time_zone;
set timestamp=100000000;
create table t1 (t timestamp, n int not null auto_increment, PRIMARY KEY(n));
@@ -122,6 +118,7 @@ a b
SET @@session.time_zone = default;
DROP TABLE t1;
SET @@session.time_zone = default;
+include/stop_slave.inc
reset master;
CREATE TABLE t1 (date timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, a int(11) default NULL);
SET @@session.time_zone='+01:00';
@@ -141,4 +138,5 @@ date a
2008-12-23 19:39:39 2
DROP TABLE t1;
SET @@session.time_zone = default;
+include/rpl_end.inc
End of 5.0 tests
diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
index 3136599e5aa..550b3f596e5 100644
--- a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
+++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
CREATE TEMPORARY TABLE t1 (a INT);
CREATE TABLE t2 (a INT, b INT) ENGINE= MyISAM;
INSERT INTO t1 VALUES (1);
@@ -123,16 +119,16 @@ DROP PROCEDURE p2;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
INSERT INTO t2 VALUES ("DROP PROCEDURE p2 with table locked");
CREATE EVENT e1 ON SCHEDULE EVERY 10 HOUR DO SELECT 1;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
INSERT INTO t2 VALUES ("CREATE EVENT e1 with table locked");
UNLOCK TABLE;
CREATE EVENT e2 ON SCHEDULE EVERY 10 HOUR DO SELECT 1;
LOCK TABLE t1 WRITE;
ALTER EVENT e2 ON SCHEDULE EVERY 20 HOUR DO SELECT 1;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
INSERT INTO t2 VALUES ("ALTER EVENT e2 with table locked");
DROP EVENT e2;
-ERROR HY000: Table 'event' was not locked with LOCK TABLES
+ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
INSERT INTO t2 VALUES ("DROP EVENT e2 with table locked");
CREATE DATABASE mysqltest1;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
@@ -191,3 +187,4 @@ DROP FUNCTION f2;
DROP PROCEDURE p2;
DROP EVENT e2;
DROP TABLE t1, t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result
index 01d886c4709..784cd1bcdff 100644
--- a/mysql-test/suite/rpl/r/rpl_trigger.result
+++ b/mysql-test/suite/rpl/r/rpl_trigger.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
@@ -862,8 +858,8 @@ drop table t21,t31;
drop table t11;
STOP SLAVE;
FLUSH LOGS;
---> Stop master server
---> Start master server
+include/rpl_stop_server.inc [server_number=1]
+include/rpl_start_server.inc [server_number=1]
--> Master binlog: Server ver: 5.0.16-debug-log, Binlog ver: 4
RESET SLAVE;
START SLAVE;
@@ -976,12 +972,7 @@ a b
2 b
3 c
drop table t1;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
create table t1 ( f int ) engine = innodb;
create table log ( r int ) engine = myisam;
create trigger tr
@@ -992,6 +983,7 @@ insert into t1 values ( 1 );
rollback;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
-Comparing tables master:test.t1 and slave:test.t1
-Comparing tables master:test.log and slave:test.log
+include/diff_tables.inc [master:t1, slave:t1]
+include/diff_tables.inc [master:log, slave:log]
drop table t1, log;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_trunc_temp.result b/mysql-test/suite/rpl/r/rpl_trunc_temp.result
index 44624a38875..ae2c9973c9f 100644
--- a/mysql-test/suite/rpl/r/rpl_trunc_temp.result
+++ b/mysql-test/suite/rpl/r/rpl_trunc_temp.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
create temporary table t1 (n int);
insert into t1 values(1);
show status like 'Slave_open_temp_tables';
@@ -20,3 +16,4 @@ Slave_open_temp_tables 1
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
index 38fb9e27764..da8db64cef4 100644
--- a/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
@@ -1,20 +1,12 @@
-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;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
**** On Master ****
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1), (2,2);
**** On Master ****
TRUNCATE TABLE t1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
**** On Master ****
SET @count := 1;
@@ -22,19 +14,15 @@ CREATE TABLE t2 (a INT, b LONG) ENGINE=MyISAM;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
**** On Master ****
TRUNCATE TABLE t1;
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1,t2;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
**** On Master ****
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1), (2,2);
**** On Master ****
DELETE FROM t1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
**** On Master ****
SET @count := 1;
@@ -42,5 +30,6 @@ CREATE TABLE t2 (a INT, b LONG) ENGINE=MyISAM;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
**** On Master ****
DELETE FROM t1;
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
index b5e5936834d..d8a4443022d 100644
--- a/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
@@ -1,20 +1,12 @@
-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;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
**** On Master ****
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
**** On Master ****
TRUNCATE TABLE t1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
**** On Master ****
SET @count := 1;
@@ -22,19 +14,15 @@ CREATE TABLE t2 (a INT, b LONG) ENGINE=InnoDB;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
**** On Master ****
TRUNCATE TABLE t1;
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1,t2;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
**** On Master ****
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
**** On Master ****
DELETE FROM t1;
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
**** On Master ****
SET @count := 1;
@@ -42,5 +30,6 @@ CREATE TABLE t2 (a INT, b LONG) ENGINE=InnoDB;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
**** On Master ****
DELETE FROM t1;
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
DROP TABLE t1,t2;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_typeconv.result b/mysql-test/suite/rpl/r/rpl_typeconv.result
index 89096153c14..f9d5b50b4e2 100644
--- a/mysql-test/suite/rpl/r/rpl_typeconv.result
+++ b/mysql-test/suite/rpl/r/rpl_typeconv.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
set @saved_slave_type_conversions = @@global.slave_type_conversions;
CREATE TABLE type_conversions (
TestNo INT AUTO_INCREMENT PRIMARY KEY,
@@ -41,32 +37,16 @@ SELECT @@global.slave_type_conversions;
ALL_LOSSY,ALL_NON_LOSSY
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = '' ****
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY' ****
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY' ****
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY,ALL_NON_LOSSY' ****
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
**** Result of conversions ****
Source_Type Target_Type All_Type_Conversion_Flags Value_On_Slave
TINYBLOB TINYBLOB <Correct value>
@@ -554,5 +534,7 @@ BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
DROP TABLE type_conversions;
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* Error_code: 1677");
DROP TABLE t1;
set global slave_type_conversions = @saved_slave_type_conversions;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result b/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
index 0b4286c54eb..67ac642bc5a 100644
--- a/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
@@ -1,18 +1,10 @@
-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;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/master-slave.inc
+[connection master]
SET @saved_slave_type_conversions = @@GLOBAL.SLAVE_TYPE_CONVERSIONS;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = '';
CREATE TABLE t1(b1 BIT(1), b2 BIT(2), b3 BIT(3)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (b'0', b'01', b'101');
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_udf.result b/mysql-test/suite/rpl/r/rpl_udf.result
index 92ffb9cffc7..f9a5765d3a3 100644
--- a/mysql-test/suite/rpl/r/rpl_udf.result
+++ b/mysql-test/suite/rpl/r/rpl_udf.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop table if exists t1;
"*** Test 1) Test UDFs via loadable libraries ***
"Running on the master"
@@ -155,3 +151,4 @@ affected rows: 0
"Running on the master"
DROP TABLE t1;
affected rows: 0
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_user.result b/mysql-test/suite/rpl/r/rpl_user.result
index a98e7e9ca55..4ad87eb1ae7 100644
--- a/mysql-test/suite/rpl/r/rpl_user.result
+++ b/mysql-test/suite/rpl/r/rpl_user.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
set session sql_log_bin=0;
delete from mysql.user where Host='fakehost';
set session sql_log_bin=1;
@@ -43,3 +39,4 @@ master-bin.000001 # Query # # use `test`; rename user 'foo'@'fakehost' to 'foofo
master-bin.000001 # Query # # use `test`; rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'bar'@'fakehost' to 'barbar'@'fakehost'
master-bin.000001 # Query # # use `test`; drop user 'foofoo'@'fakehost'
master-bin.000001 # Query # # use `test`; drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost'
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_user_variables.result b/mysql-test/suite/rpl/r/rpl_user_variables.result
index 1f76eae3fce..e302ec0aceb 100644
--- a/mysql-test/suite/rpl/r/rpl_user_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_user_variables.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
reset master;
create table t1(n char(30));
set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1;
@@ -279,4 +275,4 @@ i
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP TABLE t1;
-stop slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_variables.result b/mysql-test/suite/rpl/r/rpl_variables.result
index b3108c75a6e..8711dce4ab6 100644
--- a/mysql-test/suite/rpl/r/rpl_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_variables.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
==== Initialization ====
[on master]
SET @m_default_week_format= @@global.default_week_format;
@@ -38,13 +34,8 @@ SET @@global.sql_mode = 'ALLOW_INVALID_DATES';
SET @@local.sql_mode = 'ANSI_QUOTES,ERROR_FOR_DIVISION_BY_ZERO,HIGH_NOT_PRECEDENCE';
SET @user_num = 10;
SET @user_text = 'Alunda';
-[on master]
-**** Resetting master and slave ****
include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
include/start_slave.inc
-[on slave]
SET @@global.init_slave = 'SELECT 1';
[on master]
CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
@@ -550,15 +541,7 @@ id truth num text
30 NULL 30 NULL
31 NULL NULL Bergsbrunna
32 NULL NULL Centrum
-Comparing tables master:test.tstmt and master:test.tproc
-Comparing tables master:test.tstmt and master:test.tfunc
-Comparing tables master:test.tstmt and master:test.ttrig
-Comparing tables master:test.tstmt and master:test.tprep
-Comparing tables master:test.tstmt and slave:test.tstmt
-Comparing tables master:test.tstmt and slave:test.tproc
-Comparing tables master:test.tstmt and slave:test.tfunc
-Comparing tables master:test.tstmt and slave:test.ttrig
-Comparing tables master:test.tstmt and slave:test.tprep
+include/diff_tables.inc [master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep]
==== Clean up ====
[on master]
DROP PROCEDURE proc;
@@ -582,3 +565,4 @@ SET @@global.relay_log_purge= @s_relay_log_purge;
SET @@global.slave_exec_mode= @s_slave_exec_mode;
SET @@global.sql_mode= @s_sql_mode;
SET @@global.sync_binlog= @s_sync_binlog;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_variables_stm.result b/mysql-test/suite/rpl/r/rpl_variables_stm.result
index 29bdf771237..dfd78742e75 100644
--- a/mysql-test/suite/rpl/r/rpl_variables_stm.result
+++ b/mysql-test/suite/rpl/r/rpl_variables_stm.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
==== Initialization ====
[on master]
@@ -488,15 +484,7 @@ id num text
56 NULL 47124712
57 NULL 1616
58 NULL 1717
-Comparing tables master:test.tstmt and master:test.tproc
-Comparing tables master:test.tstmt and master:test.tfunc
-Comparing tables master:test.tstmt and master:test.ttrig
-Comparing tables master:test.tstmt and master:test.tprep
-Comparing tables master:test.tstmt and slave:test.tstmt
-Comparing tables master:test.tstmt and slave:test.tproc
-Comparing tables master:test.tstmt and slave:test.tfunc
-Comparing tables master:test.tstmt and slave:test.ttrig
-Comparing tables master:test.tstmt and slave:test.tprep
+include/diff_tables.inc [master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep]
==== Clean up ====
[on master]
DROP PROCEDURE proc;
@@ -520,3 +508,4 @@ SET @@global.collation_server= @s_collation_server;
SET @@global.time_zone= @s_time_zone;
SET @@global.lc_time_names= @s_lc_time_names;
SET @@global.collation_database= @s_collation_database;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_view.result b/mysql-test/suite/rpl/r/rpl_view.result
index b129223b6d2..307b88ff6f9 100644
--- a/mysql-test/suite/rpl/r/rpl_view.result
+++ b/mysql-test/suite/rpl/r/rpl_view.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
drop table if exists t1,v1;
drop view if exists t1,v1;
reset master;
@@ -116,3 +112,4 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
DROP VIEW v1;
DROP TABLE t1;
End of 5.0 tests
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_view_multi.result b/mysql-test/suite/rpl/r/rpl_view_multi.result
index b3f10584a24..e42c8e51411 100644
--- a/mysql-test/suite/rpl/r/rpl_view_multi.result
+++ b/mysql-test/suite/rpl/r/rpl_view_multi.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
#
# Bug #25144 "replication / binlog with view breaks".
# Statements that used views didn't ensure that view were not modified
@@ -88,3 +84,4 @@ i
drop table t1, t2;
drop view v1;
# Syncing slave with master and switching to connection 'slave'
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def
index d962394d91b..a45fdb47ae6 100644
--- a/mysql-test/suite/rpl/t/disabled.def
+++ b/mysql-test/suite/rpl/t/disabled.def
@@ -10,8 +10,8 @@
#
##############################################################################
-rpl_failed_optimize : WL#4284: Can't optimize table used by a pending transaction (there is metadata lock on the table).
-rpl_read_only : WL#4284: Setting Read only won't succeed until all metadata locks are released.
-rpl_row_create_table : Bug#51574 2010-02-27 andrei failed different way than earlier with bug#45576
-rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux
-rpl_log_pos : BUG#55675 Sep 10 2010 27 2010 alfranio rpl.rpl_log_pos fails sporadically with error binlog truncated in the middle
+rpl_row_create_table : Bug#11759274 2010-02-27 andrei failed different way than earlier with bug#45576
+rpl_spec_variables : BUG#11755836 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux
+rpl_get_master_version_and_clock : Bug#11766137 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock
+rpl_row_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out
+rpl_stm_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out
diff --git a/mysql-test/suite/rpl/t/rpl000010.test b/mysql-test/suite/rpl/t/rpl000010.test
deleted file mode 100644
index a95cded6496..00000000000
--- a/mysql-test/suite/rpl/t/rpl000010.test
+++ /dev/null
@@ -1,15 +0,0 @@
-# This tests the offset off by 22 mystery bug
-# Must run slave with --disconnect-slave-event-count=1 --master-connect-retry=1
-
-source include/master-slave.inc;
-
-create table t1 (n int not null auto_increment primary key);
-insert into t1 values(NULL);
-insert into t1 values(2);
-sync_slave_with_master;
-select n from t1;
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl000011.test b/mysql-test/suite/rpl/t/rpl000011.test
deleted file mode 100644
index baff7c1a1b5..00000000000
--- a/mysql-test/suite/rpl/t/rpl000011.test
+++ /dev/null
@@ -1,19 +0,0 @@
-source include/master-slave.inc;
-
-create table t1 (n int);
-insert into t1 values(1);
-sync_slave_with_master;
-stop slave;
---source include/wait_for_slave_to_stop.inc
-start slave;
---source include/wait_for_slave_to_start.inc
-connection master;
-insert into t1 values(2);
-#let slave catch up
-sync_slave_with_master;
-select * from t1;
-connection master;
-drop table t1;
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl000013.test b/mysql-test/suite/rpl/t/rpl000013.test
deleted file mode 100644
index 7f80252a9fc..00000000000
--- a/mysql-test/suite/rpl/t/rpl000013.test
+++ /dev/null
@@ -1,57 +0,0 @@
-# This test is to verify that DROP TEMPORARY TABLE
-# is automatically binlogged and sent to slave
-# when a temp table is dropped by disconnection
-# of a master's conection.
-# So it does not apply to row-based, where we neither need
-# nor do this automatic binlogging. And if we run this test
-# in row-based, it hangs waiting for an offset which is never
-# reached (the "sync_with_master 1"), logically.
-
---source include/have_binlog_format_mixed_or_statement.inc
-source include/master-slave.inc;
-sync_slave_with_master;
-connection master;
-
---disable_query_log
-CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
---enable_query_log
-
-create table t2(n int);
-create temporary table t1 (n int);
-insert into t1 values(1),(2),(3);
---disable_warnings
-insert into t2 select * from t1;
---enable_warnings
-connection master1;
-create temporary table t1 (n int);
-insert into t1 values (4),(5);
---disable_warnings
-insert into t2 select * from t1 as t10;
---enable_warnings
-save_master_pos;
-disconnect master;
-connection slave;
-#add 1 to catch drop table
-sync_with_master 1;
-connection master1;
-insert into t2 values(6);
-save_master_pos;
-disconnect master1;
-connection slave;
-# same trick to go one more event
-sync_with_master 1;
-select * from t2;
-show status like 'Slave_open_temp_tables';
-#
-# Clean up
-#
-connect (master2,localhost,root,,);
-connection master2;
-
-# We will get a warning for t1 as this is a temporary table that doesn't
-# exist in this connection.
-
-drop table if exists t1,t2;
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl000017-slave.sh b/mysql-test/suite/rpl/t/rpl000017-slave.sh
deleted file mode 100644
index 1d95798260a..00000000000
--- a/mysql-test/suite/rpl/t/rpl000017-slave.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-rm -f $MYSQLTEST_VARDIR/log/*relay*
-rm -f $MYSQLTEST_VARDIR/mysqld.2/data/relay-log.info
-cat > $MYSQLTEST_VARDIR/mysqld.2/data/master.info <<EOF
-master-bin.000001
-4
-127.0.0.1
-replicate
-aaaaaaaaaaaaaaab
-$MASTER_MYPORT
-1
-0
-EOF
diff --git a/mysql-test/suite/rpl/t/rpl000017.test b/mysql-test/suite/rpl/t/rpl000017.test
deleted file mode 100644
index a65189657cc..00000000000
--- a/mysql-test/suite/rpl/t/rpl000017.test
+++ /dev/null
@@ -1,34 +0,0 @@
-# The test manually replaces the relay-log.info file with connection
-# information which the slave then should pick up. However, to avoid
-# overwriting the file, no CHANGE MASTER TO nor RESET SLAVE statements
-# should be executed.
-#
-# Starting replication before granting a replication user privileges
-# to replicate will cause the start slave to fail, so we shouldn't do
-# that.
-
-let $no_change_master = 1;
-let $skip_slave_start = 1;
-source include/master-slave.inc;
-
-connection master;
-grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
-grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
-connection slave;
-start slave;
-source include/wait_for_slave_to_start.inc;
-
-connection master;
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1(n int);
-insert into t1 values(24);
-sync_slave_with_master;
-select * from t1;
-connection master;
-drop table t1;
-delete from mysql.user where user="replicate";
-sync_slave_with_master;
-
-# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl000010-slave.opt b/mysql-test/suite/rpl/t/rpl_000010-slave.opt
index 0dbfb311e33..0dbfb311e33 100644
--- a/mysql-test/suite/rpl/t/rpl000010-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_000010-slave.opt
diff --git a/mysql-test/suite/rpl/t/rpl_000010.test b/mysql-test/suite/rpl/t/rpl_000010.test
new file mode 100644
index 00000000000..de6337dd723
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_000010.test
@@ -0,0 +1,16 @@
+# This tests the offset off by 22 mystery bug
+# Must run slave with --disconnect-slave-event-count=1 --master-connect-retry=1
+
+source include/master-slave.inc;
+
+create table t1 (n int not null auto_increment primary key);
+insert into t1 values(NULL);
+insert into t1 values(2);
+sync_slave_with_master;
+select n from t1;
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_000011.test b/mysql-test/suite/rpl/t/rpl_000011.test
new file mode 100644
index 00000000000..625b0c22c62
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_000011.test
@@ -0,0 +1,20 @@
+source include/master-slave.inc;
+
+create table t1 (n int);
+insert into t1 values(1);
+sync_slave_with_master;
+stop slave;
+--source include/wait_for_slave_to_stop.inc
+start slave;
+--source include/wait_for_slave_to_start.inc
+connection master;
+insert into t1 values(2);
+#let slave catch up
+sync_slave_with_master;
+select * from t1;
+connection master;
+drop table t1;
+sync_slave_with_master;
+
+# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_000013.test b/mysql-test/suite/rpl/t/rpl_000013.test
new file mode 100644
index 00000000000..9f1b06665dd
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_000013.test
@@ -0,0 +1,55 @@
+# This test is to verify that DROP TEMPORARY TABLE
+# is automatically binlogged and sent to slave
+# when a temp table is dropped by disconnection
+# of a master's conection.
+# So it does not apply to row-based, where we neither need
+# nor do this automatic binlogging. And if we run this test
+# in row-based, it hangs waiting for an offset which is never
+# reached (the "sync_with_master 1"), logically.
+
+--source include/have_binlog_format_mixed_or_statement.inc
+source include/master-slave.inc;
+
+--disable_query_log
+CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--enable_query_log
+
+create table t2(n int);
+create temporary table t1 (n int);
+insert into t1 values(1),(2),(3);
+--disable_warnings
+insert into t2 select * from t1;
+--enable_warnings
+connection master1;
+create temporary table t1 (n int);
+insert into t1 values (4),(5);
+--disable_warnings
+insert into t2 select * from t1 as t10;
+--enable_warnings
+save_master_pos;
+disconnect master;
+connection slave;
+#add 1 to catch drop table
+sync_with_master 1;
+connection master1;
+insert into t2 values(6);
+save_master_pos;
+disconnect master1;
+connection slave;
+# same trick to go one more event
+sync_with_master 1;
+select * from t2;
+show status like 'Slave_open_temp_tables';
+#
+# Clean up
+#
+connect (master2,localhost,root,,);
+connection master2;
+
+# We will get a warning for t1 as this is a temporary table that doesn't
+# exist in this connection.
+
+drop table if exists t1,t2;
+
+--source include/rpl_end.inc
+# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_000017.test b/mysql-test/suite/rpl/t/rpl_000017.test
new file mode 100644
index 00000000000..a34419c37c8
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_000017.test
@@ -0,0 +1,48 @@
+# ==== Purpose ====
+#
+# Unknown.
+#
+# ==== Notes ====
+#
+# This test uses the -slave.opt file to start the slave with
+# --skip-slave-start.
+
+--source include/not_windows.inc
+
+--let $rpl_skip_start_slave= 1
+--source include/master-slave.inc
+
+--connection slave
+--let $slave_datadir= `SELECT @@datadir`
+
+--remove_file $slave_datadir/master.info
+--write_file $slave_datadir/master.info
+master-bin.000001
+4
+127.0.0.1
+replicate
+aaaaaaaaaaaaaaab
+$MASTER_MYPORT
+1
+0
+EOF
+
+connection master;
+grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
+grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
+connection slave;
+--source include/start_slave.inc
+
+connection master;
+create table t1(n int);
+insert into t1 values(24);
+sync_slave_with_master;
+select * from t1;
+connection master;
+drop table t1;
+delete from mysql.user where user="replicate";
+
+# End of 4.1 tests
+--source include/rpl_end.inc
+
+--source include/force_restart.inc
diff --git a/mysql-test/suite/rpl/t/rpl_EE_err.test b/mysql-test/suite/rpl/t/rpl_EE_err.test
index 6d064ae3197..5272b11f342 100644
--- a/mysql-test/suite/rpl/t/rpl_EE_err.test
+++ b/mysql-test/suite/rpl/t/rpl_EE_err.test
@@ -1,7 +1,3 @@
-########################################################
-# By JBM 2006-02-14 Wrapped to share test code between #
-# engines. Added to skip test when NDB is default #
-########################################################
-- source include/not_ndb_default.inc
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_EE_err.test
diff --git a/mysql-test/suite/rpl/t/rpl_LD_INFILE.test b/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
index ae647ed6648..0f02bdccb60 100644
--- a/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
+++ b/mysql-test/suite/rpl/t/rpl_LD_INFILE.test
@@ -36,3 +36,4 @@ sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_alter.test b/mysql-test/suite/rpl/t/rpl_alter.test
index 6a6da9c9f24..630197f8637 100644
--- a/mysql-test/suite/rpl/t/rpl_alter.test
+++ b/mysql-test/suite/rpl/t/rpl_alter.test
@@ -1,7 +1,4 @@
source include/master-slave.inc;
---disable_warnings
-drop database if exists mysqltest;
---enable_warnings
create database mysqltest;
create table mysqltest.t1 ( n int);
@@ -18,3 +15,4 @@ drop database mysqltest;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_alter_db.test b/mysql-test/suite/rpl/t/rpl_alter_db.test
index 341496350d7..f6f0782580f 100644
--- a/mysql-test/suite/rpl/t/rpl_alter_db.test
+++ b/mysql-test/suite/rpl/t/rpl_alter_db.test
@@ -12,3 +12,4 @@ sync_slave_with_master;
connection master;
drop database temp_db;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment.test b/mysql-test/suite/rpl/t/rpl_auto_increment.test
index 19770ffbdc0..8869e3745db 100644
--- a/mysql-test/suite/rpl/t/rpl_auto_increment.test
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment.test
@@ -1,10 +1,6 @@
#####################################
# Wrapper for rpl_auto_increment.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;
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test b/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test
index 8c95e158847..d1da69533ec 100644
--- a/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test
@@ -56,6 +56,6 @@ sync_slave_with_master;
use test1;
select * from t1;
-drop database test1;
connection master;
drop database test1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment_bug33029.test b/mysql-test/suite/rpl/t/rpl_auto_increment_bug33029.test
new file mode 100644
index 00000000000..6f7e0d80b5c
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment_bug33029.test
@@ -0,0 +1,60 @@
+# BUG#33029 5.0 to 5.1 replication fails on dup key when inserting
+# using a trig in SP
+
+# For all 5.0 up to 5.0.58 exclusive, and 5.1 up to 5.1.12 exclusive,
+# if one statement in a SP generated AUTO_INCREMENT value by the top
+# statement, all statements after it would be considered generated
+# AUTO_INCREMENT value by the top statement, and a erroneous INSERT_ID
+# value might be associated with these statement, which could cause
+# duplicate entry error and stop the slave.
+
+# Test if the slave can replicate from such a buggy master
+
+# The bug33029-slave-relay-bin.000001 file is the
+# slave-replay-bin.000003 file generated by run the
+# rpl_auto_increment_bug33029.test with clean up statements at the end
+# of the test case removed on a buggy 5.0 server
+
+--let $rpl_skip_start_slave= 1
+--source include/master-slave.inc
+
+--echo ==== Initialize ====
+--connection slave
+
+# The binlog we read does funny things with triggers and causes this warning.
+--disable_query_log
+CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT');
+--enable_query_log
+
+# Need to restore this at the end; CHANGE MASTER modifies it (see the
+# manual for CHANGE MASTER).
+SET @old_relay_log_purge= @@global.relay_log_purge;
+
+# the relay log contains create t1, t2 tables and load data infile
+--let $fake_relay_log = $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001
+--source include/setup_fake_relay_log.inc
+
+--echo ==== Test ====
+start slave sql_thread;
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_value= 3776
+--source include/wait_for_slave_param.inc
+
+
+echo # Result on slave;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+--echo ==== Clean up ====
+
+stop slave sql_thread;
+--source include/cleanup_fake_relay_log.inc
+
+DROP TABLE t1, t2;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+
+SET @@global.relay_log_purge= @old_relay_log_purge;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test b/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test
index f38d2151ab3..b5eb3c5408a 100644
--- a/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test
+++ b/mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test
@@ -159,11 +159,9 @@ source include/show_binlog_events.inc;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'UPDATE MORE THAN ONE TABLES ON TOP-STATEMENT'
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
-let $diff_table_1=master:test.t2;
-let $diff_table_2=slave:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
connection master;
@@ -199,11 +197,9 @@ source include/show_binlog_events.inc;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES'
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
-let $diff_table_1=master:test.t2;
-let $diff_table_2=slave:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
connection master;
@@ -212,3 +208,4 @@ drop table t2;
drop view v15;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test
index acb98a0ad88..b4798691ca3 100644
--- a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test
+++ b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test
@@ -177,4 +177,4 @@ SELECT * FROM db1.t1 WHERE a IN (30, 40);
connection master;
DROP DATABASE db1;
DROP DATABASE db2;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029-master.opt b/mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029-master.opt
deleted file mode 100644
index 74e71a8e558..00000000000
--- a/mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-same-server-id --relay-log=slave-relay-bin --skip-slave-start
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029.test b/mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029.test
deleted file mode 100644
index dbdd96347a2..00000000000
--- a/mysql-test/suite/rpl/t/rpl_binlog_auto_inc_bug33029.test
+++ /dev/null
@@ -1,42 +0,0 @@
-# BUG#33029 5.0 to 5.1 replication fails on dup key when inserting
-# using a trig in SP
-
-# For all 5.0 up to 5.0.58 exclusive, and 5.1 up to 5.1.12 exclusive,
-# if one statement in a SP generated AUTO_INCREMENT value by the top
-# statement, all statements after it would be considered generated
-# AUTO_INCREMENT value by the top statement, and a erroneous INSERT_ID
-# value might be associated with these statement, which could cause
-# duplicate entry error and stop the slave.
-
-# Test if the slave can replicate from such a buggy master
-
-# The bug33029-slave-relay-bin.000001 file is the
-# slave-replay-bin.000003 file generated by run the
-# rpl_auto_increment_bug33029.test with clean up statements at the end
-# of the test case removed on a buggy 5.0 server
-
-source include/have_log_bin.inc;
-
-let $fake_relay_log= $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001;
-source include/setup_fake_relay_log.inc;
-
-start slave sql_thread;
-disable_result_log;
-select MASTER_POS_WAIT('master-bin.000001', 3776);
-enable_result_log;
-
-echo # Result on slave;
-SELECT * FROM t1;
-SELECT * FROM t2;
-
-# clean up
-disable_warnings;
-DROP TABLE IF EXISTS t1, t2;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS p2;
-DROP FUNCTION IF EXISTS f1;
-DROP TRIGGER IF EXISTS tr1;
-enable_warnings;
-
-stop slave sql_thread;
-source include/cleanup_fake_relay_log.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt b/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt
deleted file mode 100644
index 815a8f81d32..00000000000
--- a/mysql-test/suite/rpl/t/rpl_binlog_corruption-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-same-server-id --relay-log=slave-relay-bin
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_corruption.test b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test
index 401597b5c64..6717bda0fa7 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_corruption.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test
@@ -15,15 +15,14 @@
# BUG#31793: log event corruption causes crash
# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
-# Temporarily disabled on Windows due to bug #47639
---source include/not_windows.inc
+--source include/master-slave.inc
-source include/have_log_bin.inc;
# BUG#40482 only manifested itself in debug-compiled binaries.
source include/have_debug.inc;
+--connection slave
call mtr.add_suppression('Found invalid event in binary log');
-
+call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594');
#
# BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event
@@ -32,6 +31,9 @@ call mtr.add_suppression('Found invalid event in binary log');
# incident number.
--echo ==== Initialize ====
+--source include/stop_slave.inc
+RESET SLAVE;
+
let $fake_relay_log= $MYSQL_TEST_DIR/std_data/bug40482-bin.000001;
source include/setup_fake_relay_log.inc;
@@ -44,3 +46,5 @@ let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
--echo ==== Clean up ====
source include/cleanup_fake_relay_log.inc;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors-master.opt b/mysql-test/suite/rpl/t/rpl_binlog_errors-master.opt
new file mode 100644
index 00000000000..f8e46a44854
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_binlog_errors-master.opt
@@ -0,0 +1 @@
+--max_binlog_size=4096
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors.test b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
new file mode 100644
index 00000000000..7c09dab704e
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
@@ -0,0 +1,413 @@
+# BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error
+# when generating new name.
+#
+# WHY
+# ===
+#
+# We want to check whether error is reported or not when
+# new_file_impl fails (this may happen when rotation is not
+# possible because there is some problem finding an
+# unique filename).
+#
+# HOW
+# ===
+#
+# Test cases are documented inline.
+
+-- source include/have_innodb.inc
+-- source include/have_debug.inc
+-- source include/master-slave.inc
+
+-- echo #######################################################################
+-- echo ####################### PART 1: MASTER TESTS ##########################
+-- echo #######################################################################
+
+
+### ACTION: stopping slave as it is not needed for the first part of
+### the test
+
+-- connection slave
+-- source include/stop_slave.inc
+-- connection master
+
+call mtr.add_suppression("Can't generate a unique log-filename");
+call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
+call mtr.add_suppression("Error writing file .*");
+
+SET @old_debug= @@global.debug;
+
+### ACTION: create a large file (> 4096 bytes) that will be later used
+### in LOAD DATA INFILE to check binlog errors in its vacinity
+-- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data
+-- let $MYSQLD_DATADIR= `select @@datadir`
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file'
+
+### ACTION: create a small file (< 4096 bytes) that will be later used
+### in LOAD DATA INFILE to check for absence of binlog errors
+### when file loading this file does not force flushing and
+### rotating the binary log
+-- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data
+-- let $MYSQLD_DATADIR= `select @@datadir`
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2'
+
+RESET MASTER;
+
+-- echo ###################### TEST #1
+
+### ASSERTION: no problem flushing logs (should show two binlogs)
+FLUSH LOGS;
+-- echo # assert: must show two binlogs
+-- source include/show_binary_logs.inc
+
+-- echo ###################### TEST #2
+
+### ASSERTION: check that FLUSH LOGS actually fails and reports
+### failure back to the user if find_uniq_filename fails
+### (should show just one binlog)
+
+RESET MASTER;
+SET GLOBAL debug="+d,error_unique_log_filename";
+-- error ER_NO_UNIQUE_LOGFILE
+FLUSH LOGS;
+-- echo # assert: must show one binlog
+-- source include/show_binary_logs.inc
+
+### ACTION: clean up and move to next test
+SET GLOBAL debug="";
+RESET MASTER;
+
+-- echo ###################### TEST #3
+
+### ACTION: create some tables (t1, t2, t4) and insert some values in
+### table t1
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB;
+CREATE TABLE t4 (a VARCHAR(16384));
+INSERT INTO t1 VALUES (1);
+RESET MASTER;
+
+### ASSERTION: we force rotation of the binary log because it exceeds
+### the max_binlog_size option (should show two binary
+### logs)
+
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+
+# shows two binary logs
+-- echo # assert: must show two binlog
+-- source include/show_binary_logs.inc
+
+# clean up the table and the binlog to be used in next part of test
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #4
+
+### ASSERTION: load the big file into a transactional table and check
+### that it reports error. The table will contain the
+### changes performed despite the fact that it reported an
+### error.
+
+SET GLOBAL debug="+d,error_unique_log_filename";
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+
+# show table
+-- echo # assert: must show one entry
+SELECT count(*) FROM t2;
+
+# clean up the table and the binlog to be used in next part of test
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #5
+
+### ASSERTION: load the small file into a transactional table and
+### check that it succeeds
+
+SET GLOBAL debug="+d,error_unique_log_filename";
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file2' INTO TABLE t2
+
+# show table
+-- echo # assert: must show one entry
+SELECT count(*) FROM t2;
+
+# clean up the table and the binlog to be used in next part of test
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #6
+
+### ASSERTION: check that even if one is using a transactional table
+### and explicit transactions (no autocommit) if rotation
+### fails we get the error. Transaction is not rolledback
+### because rotation happens after the commit.
+
+SET GLOBAL debug="+d,error_unique_log_filename";
+SET AUTOCOMMIT=0;
+INSERT INTO t2 VALUES ('muse');
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+INSERT INTO t2 VALUES ('muse');
+-- error ER_NO_UNIQUE_LOGFILE
+COMMIT;
+
+### ACTION: Show the contents of the table after the test
+-- echo # assert: must show three entries
+SELECT count(*) FROM t2;
+
+### ACTION: clean up and move to the next test
+SET AUTOCOMMIT= 1;
+SET GLOBAL debug="-d,error_unique_log_filename";
+DELETE FROM t2;
+RESET MASTER;
+
+-- echo ###################### TEST #7
+
+### ASSERTION: check that on a non-transactional table, if rotation
+### fails then an error is reported and an incident event
+### is written to the current binary log.
+
+SET GLOBAL debug="+d,error_unique_log_filename";
+SELECT count(*) FROM t4;
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
+
+-- echo # assert: must show 1 entry
+SELECT count(*) FROM t4;
+
+-- echo ### check that the incident event is written to the current log
+SET GLOBAL debug="-d,error_unique_log_filename";
+-- let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1)
+-- let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+
+# 53 is the size of the incident event, so we start from 22 bytes before the
+# current position
+-- let $binlog_start = `SELECT $binlog_start - 53`
+FLUSH LOGS;
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start> $binlog_file BINLOG_FILE
+-- replace_column 2 # 4 # 5 #
+-- eval SHOW BINLOG EVENTS IN '$binlog_file' FROM $binlog_start LIMIT 1
+
+# clean up and move to next test
+DELETE FROM t4;
+RESET MASTER;
+
+-- echo ###################### TEST #8
+
+### ASSERTION: check that statements end up in error but they succeed
+### on changing the data.
+
+SET GLOBAL debug="+d,error_unique_log_filename";
+-- echo # must show 0 entries
+SELECT count(*) FROM t4;
+SELECT count(*) FROM t2;
+
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4
+-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+-- error ER_NO_UNIQUE_LOGFILE
+-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2
+-- error ER_NO_UNIQUE_LOGFILE
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc');
+
+-- echo # INFO: Count(*) Before Offending DELETEs
+-- echo # assert: must show 1 entry
+SELECT count(*) FROM t4;
+-- echo # assert: must show 4 entries
+SELECT count(*) FROM t2;
+
+-- error ER_NO_UNIQUE_LOGFILE
+DELETE FROM t4;
+-- error ER_NO_UNIQUE_LOGFILE
+DELETE FROM t2;
+
+-- echo # INFO: Count(*) After Offending DELETEs
+-- echo # assert: must show zero entries
+SELECT count(*) FROM t4;
+SELECT count(*) FROM t2;
+
+# remove fault injection
+SET GLOBAL debug="-d,error_unique_log_filename";
+
+-- echo ###################### TEST #9
+
+### ASSERTION: check that if we disable binlogging, then statements
+### succeed.
+SET GLOBAL debug="+d,error_unique_log_filename";
+SET SQL_LOG_BIN=0;
+INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
+INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
+-- echo # assert: must show four entries
+SELECT count(*) FROM t2;
+SELECT count(*) FROM t4;
+DELETE FROM t2;
+DELETE FROM t4;
+-- echo # assert: must show zero entries
+SELECT count(*) FROM t2;
+SELECT count(*) FROM t4;
+SET SQL_LOG_BIN=1;
+SET GLOBAL debug="-d,error_unique_log_filename";
+
+-- echo ###################### TEST #10
+
+### ASSERTION: check that error is reported if there is a failure
+### while registering the index file and the binary log
+### file or failure to write the rotate event.
+
+call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Could not open .*");
+
+RESET MASTER;
+SHOW WARNINGS;
+
+# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open
+SET GLOBAL debug="+d,fault_injection_registering_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+FLUSH LOGS;
+SET GLOBAL debug="-d,fault_injection_registering_index";
+
+-- error ER_NO_BINARY_LOGGING
+SHOW BINARY LOGS;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+
+-- echo ###################### TEST #11
+
+### ASSERTION: check that error is reported if there is a failure
+### while opening the index file and the binary log file or
+### failure to write the rotate event.
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file
+SET GLOBAL debug="+d,fault_injection_openning_index";
+-- replace_regex /\.[\\\/]master/master/
+-- error ER_CANT_OPEN_FILE
+FLUSH LOGS;
+SET GLOBAL debug="-d,fault_injection_openning_index";
+
+-- error ER_FLUSH_MASTER_BINLOG_CLOSED
+RESET MASTER;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+-- echo ###################### TEST #12
+
+### ASSERTION: check that error is reported if there is a failure
+### while writing the rotate event when creating a new log
+### file.
+
+# +d,fault_injection_new_file_rotate_event => injects fault on MYSQL_BIN_LOG::MYSQL_BIN_LOG::new_file_impl
+SET GLOBAL debug="+d,fault_injection_new_file_rotate_event";
+-- error ER_ERROR_ON_WRITE
+FLUSH LOGS;
+SET GLOBAL debug="-d,fault_injection_new_file_rotate_event";
+
+-- error ER_FLUSH_MASTER_BINLOG_CLOSED
+RESET MASTER;
+
+# issue some statements and check that they don't fail
+CREATE TABLE t5 (a INT);
+INSERT INTO t4 VALUES ('bbbbb');
+INSERT INTO t2 VALUES ('aaaaa');
+DELETE FROM t4;
+DELETE FROM t2;
+DROP TABLE t5;
+
+# restart the server so that we have binlog again
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
+
+## clean up
+SET GLOBAL debug= @old_debug;
+DROP TABLE t1, t2, t4;
+RESET MASTER;
+
+# restart slave again
+-- connection slave
+-- source include/start_slave.inc
+-- connection master
+
+-- echo #######################################################################
+-- echo ####################### PART 2: SLAVE TESTS ###########################
+-- echo #######################################################################
+
+### setup
+--source include/rpl_reset.inc
+-- connection slave
+
+# slave suppressions
+
+call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
+call mtr.add_suppression("Error writing file .*");
+call mtr.add_suppression("Could not open .*");
+call mtr.add_suppression("MSYQL_BIN_LOG::open failed to sync the index file.");
+call mtr.add_suppression("Can't generate a unique log-filename .*");
+-- echo ###################### TEST #13
+
+#### ASSERTION: check against unique log filename error
+-- let $io_thd_injection_fault_flag= error_unique_log_filename
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #14
+
+#### ASSERTION: check against rotate failing
+-- let $io_thd_injection_fault_flag= fault_injection_new_file_rotate_event
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #15
+
+#### ASSERTION: check against relay log open failure
+-- let $io_thd_injection_fault_flag= fault_injection_registering_index
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+-- echo ###################### TEST #16
+
+#### ASSERTION: check against relay log index open failure
+-- let $io_thd_injection_fault_flag= fault_injection_openning_index
+-- let $slave_io_errno= 1595
+-- let $show_slave_io_error= 1
+-- source include/io_thd_fault_injection.inc
+
+### clean up
+-- source include/stop_slave_sql.inc
+SET GLOBAL debug=@old_debug;
+RESET SLAVE;
+RESET MASTER;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_binlog_grant.test b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
index 4c6402359fe..839399dea63 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_grant.test
@@ -10,9 +10,6 @@ let $VERSION=`select version()`;
# 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;
@@ -40,4 +37,5 @@ select * from t;
show grants for x@y;
drop user x@y;
drop database d1;
---sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bit.test b/mysql-test/suite/rpl/t/rpl_bit.test
index c648159ff3a..67606e5d509 100644
--- a/mysql-test/suite/rpl/t/rpl_bit.test
+++ b/mysql-test/suite/rpl/t/rpl_bit.test
@@ -90,3 +90,4 @@ DROP TABLE IF EXISTS test.t1;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bit_npk.test b/mysql-test/suite/rpl/t/rpl_bit_npk.test
index 1df7341eafc..d65ef66ae41 100644
--- a/mysql-test/suite/rpl/t/rpl_bit_npk.test
+++ b/mysql-test/suite/rpl/t/rpl_bit_npk.test
@@ -110,3 +110,4 @@ DROP TABLE IF EXISTS test.t3;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_blackhole.test b/mysql-test/suite/rpl/t/rpl_blackhole.test
index 647e65d89fd..5f9b955aaa4 100644
--- a/mysql-test/suite/rpl/t/rpl_blackhole.test
+++ b/mysql-test/suite/rpl/t/rpl_blackhole.test
@@ -96,4 +96,5 @@ let $statement = DELETE FROM t1 WHERE a % 2 = 0 AND b = 3;
source extra/rpl_tests/rpl_blackhole.test;
connection master;
-drop table t1,t2;
+DROP TABLE t1,t2;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug26395.test b/mysql-test/suite/rpl/t/rpl_bug26395.test
index 97c152d52e9..aeb0da9511d 100644
--- a/mysql-test/suite/rpl/t/rpl_bug26395.test
+++ b/mysql-test/suite/rpl/t/rpl_bug26395.test
@@ -95,3 +95,5 @@ connection slave;
DROP TABLE tinnodb;
# Warning: do not add more tests here. The binlog is in a bad state.
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug31076.test b/mysql-test/suite/rpl/t/rpl_bug31076.test
index 9461a91e933..028ca32636a 100644
--- a/mysql-test/suite/rpl/t/rpl_bug31076.test
+++ b/mysql-test/suite/rpl/t/rpl_bug31076.test
@@ -141,3 +141,4 @@ DROP DATABASE track;
sync_slave_with_master;
--echo End of 5.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug33931-master.opt b/mysql-test/suite/rpl/t/rpl_bug33931-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_bug33931-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_bug33931.test b/mysql-test/suite/rpl/t/rpl_bug33931.test
index 5dc06e6a605..5cc2da4a001 100644
--- a/mysql-test/suite/rpl/t/rpl_bug33931.test
+++ b/mysql-test/suite/rpl/t/rpl_bug33931.test
@@ -3,19 +3,16 @@
# Bug #33932 assertion at handle_slave_sql if init_slave_thread() fails
source include/have_debug.inc;
-source include/have_log_bin.inc;
-
-connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
-connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
-
-connection master;
-reset master;
+source include/master-slave.inc;
connection slave;
-reset slave;
# Add suppression for expected warnings in slaves error log
call mtr.add_suppression("Failed during slave I/O thread initialization");
+call mtr.add_suppression("Slave SQL.*Failed during slave thread initialization.* 1593");
+
+--source include/stop_slave.inc
+reset slave;
# Set debug flags on slave to force errors to occur
SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
@@ -29,18 +26,13 @@ eval CHANGE MASTER TO MASTER_USER='root',
start slave;
-connection master;
-save_master_pos;
-connection slave;
-
#
# slave is going to stop because of emulated failures
# but there won't be any crashes nor asserts hit.
#
-source include/wait_for_slave_to_stop.inc;
# 1593 = ER_SLAVE_FATAL_ERROR
---let $slave_sql_errno= 1593
+--let $slave_sql_errno= 1593
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
@@ -49,3 +41,8 @@ source include/wait_for_slave_to_stop.inc;
#
SET GLOBAL debug="";
+# Clear Last_SQL_Error
+RESET SLAVE;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug37426.test b/mysql-test/suite/rpl/t/rpl_bug37426.test
new file mode 100644
index 00000000000..d0a60524fef
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_bug37426.test
@@ -0,0 +1,22 @@
+#############################################################
+# Purpose: Test for BUG#37426
+# RBR breaks for CHAR() UTF8 fields > 85 chars
+#############################################################
+
+source include/master-slave.inc;
+source include/have_binlog_format_row.inc;
+
+connection master;
+CREATE TABLE char128_utf8 (i1 INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, i2 INT NOT NULL);
+INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
+
+SELECT * FROM char128_utf8;
+sync_slave_with_master;
+
+SELECT * FROM char128_utf8;
+
+# Clean up
+connection master;
+DROP TABLE char128_utf8;
+sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug38694.test b/mysql-test/suite/rpl/t/rpl_bug38694.test
index 41b11d271b9..48f950ad6ef 100644
--- a/mysql-test/suite/rpl/t/rpl_bug38694.test
+++ b/mysql-test/suite/rpl/t/rpl_bug38694.test
@@ -8,3 +8,4 @@
source include/master-slave.inc;
# End of tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug41902.test b/mysql-test/suite/rpl/t/rpl_bug41902.test
index d16fb986cea..12eeb903003 100644
--- a/mysql-test/suite/rpl/t/rpl_bug41902.test
+++ b/mysql-test/suite/rpl/t/rpl_bug41902.test
@@ -58,4 +58,7 @@ call mtr.add_suppression("Failed to locate old binlog or relay log files");
call mtr.add_suppression("MYSQL_BIN_LOG::purge_logs was called with file ./master-bin.000001 not listed in the index");
--enable_query_log
---echo End of the tests
+--echo ==== clean up ====
+CHANGE MASTER TO MASTER_HOST = '127.0.0.1';
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_change_master.test b/mysql-test/suite/rpl/t/rpl_change_master.test
index 514d6cf8c0f..c31359a84d8 100644
--- a/mysql-test/suite/rpl/t/rpl_change_master.test
+++ b/mysql-test/suite/rpl/t/rpl_change_master.test
@@ -23,7 +23,7 @@ source include/stop_slave.inc;
let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
-if (`SELECT $read_pos = $exec_pos`)
+if ($read_pos == $exec_pos)
{
source include/show_rpl_debug_info.inc;
echo 'Read_Master_Log_Pos: $read_pos' == 'Exec_Master_Log_Pos: $exec_pos';
@@ -32,7 +32,7 @@ if (`SELECT $read_pos = $exec_pos`)
change master to master_user='root';
let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
-if (`SELECT $read_pos <> $exec_pos`)
+if ($read_pos != $exec_pos)
{
source include/show_rpl_debug_info.inc;
echo 'Read_Master_Log_Pos: $read_pos' <> 'Exec_Master_Log_Pos: $exec_pos';
@@ -52,7 +52,8 @@ sync_slave_with_master;
# BUG#12190 CHANGE MASTER has differ path requiremts on MASTER_LOG_FILE and RELAY_LOG_FILE
#
-source include/master-slave-reset.inc;
+if ($bug_59037_is_fixed == 'true') {
+--source include/rpl_reset.inc
connection master;
create table t1 (a int);
@@ -65,8 +66,7 @@ insert into t1 values (2);
sync_slave_with_master;
# Check if the table t1 and t2 are identical on master and slave;
-let $diff_table_1= master:test.t1
-let $diff_table_2= slave:test.t1
+let $diff_tables= master:t1,slave:t1
source include/diff_tables.inc;
connection slave;
@@ -88,8 +88,7 @@ source include/wait_for_slave_sql_to_start.inc;
sync_with_master;
# Check if the table t1 and t2 are identical on master and slave;
-let $diff_table_1= master:test.t1
-let $diff_table_2= slave:test.t1
+let $diff_tables= master:t1,slave:t1
source include/diff_tables.inc;
# clean up
@@ -99,4 +98,6 @@ source include/wait_for_slave_io_to_start.inc;
eval set global relay_log_purge=$relay_log_purge;
connection master;
drop table t1;
-sync_slave_with_master;
+}
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_charset.test b/mysql-test/suite/rpl/t/rpl_charset.test
index ed0d835f22d..3ed9147508e 100644
--- a/mysql-test/suite/rpl/t/rpl_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_charset.test
@@ -1,3 +1,2 @@
let $engine_type=myisam;
source extra/rpl_tests/rpl_charset.test;
-
diff --git a/mysql-test/suite/rpl/t/rpl_charset_sjis.test b/mysql-test/suite/rpl/t/rpl_charset_sjis.test
index 2469b0db8a2..a3a3de8c1d0 100644
--- a/mysql-test/suite/rpl/t/rpl_charset_sjis.test
+++ b/mysql-test/suite/rpl/t/rpl_charset_sjis.test
@@ -23,3 +23,4 @@ sync_slave_with_master;
connection master;
# End of 5.0 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf
index 536551ec3dc..3ff94e458ce 100644
--- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf
+++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.cnf
@@ -17,11 +17,8 @@ log-slave-updates
loose-innodb
[ENV]
-SLAVE_MYPORT1= @mysqld.3.port
-SLAVE_MYSOCK1= @mysqld.3.socket
-
-SLAVE_MYPORT2= @mysqld.4.port
-SLAVE_MYSOCK2= @mysqld.4.socket
-
-
+SERVER_MYPORT_3= @mysqld.3.port
+SERVER_MYSOCK_3= @mysqld.3.socket
+SERVER_MYPORT_4= @mysqld.4.port
+SERVER_MYSOCK_4= @mysqld.4.socket
diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
index 2f1b86c2c31..7d4b538c8a6 100644
--- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
+++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
@@ -1,27 +1,36 @@
-#############################################################
-# Author: Serge Kozlov <skozlov@mysql.com>
-# Date: 03/12/2008
-# Purpose: Testing circular replication based on schema
-# A->B->C->D->A with using AUTO_INCREMENT_INCREMENT,
-# AUTO_INCREMENT_OFFSET variables and failover
-#############################################################
+# ==== Purpose ====
+#
+# Setup: circular replication on four hosts, i.e., topology
+# server_1 -> server_2 -> server_3 -> server_4 -> server_1
+#
+# Tested properties:
+# - Correctly configured autoinc works.
+# - Manual failover works.
+#
+# ==== Related bugs and worklogs ====
+#
+# WL#3754
+# BUG#49978
+
--source include/have_innodb.inc
# Use wait_for_slave_to_(start|stop) for current connections
let $keep_connection= 1;
# Set up circular ring and new names for servers
---echo *** Set up circular ring by schema A->B->C->D->A ***
---source include/circular_rpl_for_4_hosts_init.inc
+--echo *** Set up circular replication on four servers ***
+--let $rpl_topology= 1->2->3->4->1
+--source include/rpl_init.inc
--echo
# Preparing data.
--echo *** Preparing data ***
---connection master_a
+--connection server_1
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=MyISAM;
CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB;
---source include/circular_rpl_for_4_hosts_sync.inc
---connection master_d
+--source include/rpl_sync.inc
+--connection server_4
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
--echo
#
@@ -31,121 +40,135 @@ CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL,
--echo *** Testing schema A->B->C->D->A ***
--echo
# insert data via all hosts
---connection master_a
+--connection server_1
INSERT INTO t1(b,c) VALUES('A',1);
---sync_slave_with_master master_b
+--sync_slave_with_master server_2
INSERT INTO t1(b,c) VALUES('B',1);
---sync_slave_with_master master_c
+--sync_slave_with_master server_3
INSERT INTO t1(b,c) VALUES('C',1);
---sync_slave_with_master master_d
+--sync_slave_with_master server_4
INSERT INTO t1(b,c) VALUES('D',1);
---source include/circular_rpl_for_4_hosts_sync.inc
+--source include/rpl_sync.inc
---connection master_a
+--connection server_1
SELECT 'Master A',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
---connection master_b
+--connection server_2
SELECT 'Master B',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
---connection master_c
+--connection server_3
SELECT 'Master C',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
---connection master_d
+--connection server_4
SELECT 'Master D',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
--echo
--echo *** Testing schema A->B->D->A if C has failure ***
--echo
--echo * Do failure for C and then make new connection B->D *
+
+# Note: server_N has auto_increment_offset=N. Below, we insert value 6
+# in the autoinc column on server_3 (and prevent it from replicating
+# further using SQL_SLAVE_SKIP_COUNTER on server_4). Due to the
+# auto_increment_offset setting, the autoinc value 6 is normally
+# generated on server_2. When we later insert a row on server_2, we
+# thus cause a duplicate key error on server_3.
+
# Do not replicate next event from C
---connection master_d
-connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
+--connection server_4
STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
source include/start_slave.inc;
-disconnect slave;
---connection master_c
+--connection server_3
INSERT INTO t1 VALUES(6,'C',2);
---save_master_pos
---connection master_b
+--sync_slave_with_master server_4
+
+--connection server_2
INSERT INTO t1(b,c) VALUES('B',2);
# Wait while C will stop.
---connection master_c
-source include/wait_for_slave_sql_to_stop.inc;
---connection master_a
+--connection server_3
+# 1062 = ER_DUP_ENTRY
+call mtr.add_suppression("Slave SQL.*Duplicate entry .6. for key .PRIMARY.* Error_code: 1062");
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error.inc
+--connection server_1
INSERT INTO t1(b,c) VALUES('A',2);
---connection master_d
+--connection server_4
INSERT INTO t1(b,c) VALUES('D',2);
# Sync all servers except C
---connection master_b
+--connection server_2
let $wait_condition= SELECT COUNT(*)=3 FROM t1 WHERE a > 4;
+--let $server_connection= server_1
--source include/wait_condition.inc
--echo
--echo * Data on servers (C failed) *
# Masters C,D shouldn't have correct data
---connection master_a
+--connection server_1
SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
---connection master_b
+--connection server_2
SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
---connection master_c
+--connection server_3
SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
---connection master_d
+--connection server_4
SELECT 'Master D',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
--echo
--echo * Reconfigure replication to schema A->B->D->A *
# Exclude Master C
---connection master_c
-STOP SLAVE;
+--connection server_3
+--source include/stop_slave_io.inc
--let $pos_c= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
--let $file_c= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1)
---connection master_d
-STOP SLAVE;
---replace_result $SLAVE_MYPORT MASTER_B_PORT $file_c LOG_FILE $pos_c LOG_POS
---eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT,master_user='root',master_log_file='$file_c',master_log_pos=$pos_c
-connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
+
+--connection server_4
+--source include/stop_slave.inc
+
+--let $rpl_topology= 1->2->4->1,2->3
+--let $rpl_master_log_file= 4:$file_c
+--let $rpl_master_log_pos= 4:$pos_c
+--source include/rpl_change_topology.inc
+
+#--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2 $file_c LOG_FILE $pos_c LOG_POS
+#--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SERVER_MYPORT_2,master_user='root',master_log_file='$file_c',master_log_pos=$pos_c
source include/start_slave.inc;
-disconnect slave;
---connection master_b
---sync_slave_with_master master_d
---sync_slave_with_master master_a
+--connection server_2
+--sync_slave_with_master server_4
+--sync_slave_with_master server_1
--echo
--echo * Check data inserted before failure *
---connection master_a
+--connection server_1
SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
---connection master_b
+--connection server_2
SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
---connection master_c
+--connection server_3
SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
---connection master_d
+--connection server_4
SELECT 'Master D',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
--echo
--echo * Check data inserted after failure *
---connection master_a
+--connection server_1
INSERT INTO t1(b,c) VALUES('A',3);
---connection master_b
+--connection server_2
INSERT INTO t1(b,c) VALUES('B',3);
---connection master_d
+--connection server_4
INSERT INTO t1(b,c) VALUES('D',3);
-connection master_a;
+connection server_1;
---sync_slave_with_master master_b
---sync_slave_with_master master_d
---sync_slave_with_master master_a
---sync_slave_with_master master_b
+--let $rpl_only_running_threads= 1
+--source include/rpl_sync.inc
---connection master_a
+--connection server_1
SELECT 'Master A',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
---connection master_b
+--connection server_2
SELECT 'Master B',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
---connection master_c
+--connection server_3
SELECT 'Master C',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
---connection master_d
+--connection server_4
SELECT 'Master D',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
---connection master_a
+--connection server_1
--echo
--echo *** Testing restoring scheme A->B->C->D->A after failure ***
@@ -153,158 +176,150 @@ SELECT 'Master D',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
# Master D will ignore a next event from C so that event will not be
# distributed to other servers
--echo * Remove wrong event from C and restore B->C->D *
---connection master_d
+--connection server_4
source include/stop_slave.inc;
---connection master_c
+--connection server_3
DELETE FROM t1 WHERE a = 6;
-START SLAVE;
---connection master_b
---sync_slave_with_master master_c
+--source include/start_slave.inc
+--connection server_2
+--sync_slave_with_master server_3
RESET MASTER;
--let $file_d= query_get_value(SHOW MASTER STATUS, File, 1)
--let $pos_d= query_get_value(SHOW MASTER STATUS, Position, 1)
---connection master_d
+--connection server_4
RESET SLAVE;
---replace_result $SLAVE_MYPORT1 MASTER_C_PORT $file_d LOG_FILE $pos_d LOG_POS
---eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT1,master_user='root',master_log_file='$file_d',master_log_pos=$pos_d
-START SLAVE;
---connection master_c
---sync_slave_with_master master_d
---source include/circular_rpl_for_4_hosts_sync.inc
+--let $rpl_topology= 1->2->3->4->1
+--let $rpl_master_log_file= 4:$file_d
+--let $rpl_master_log_pos= 4:$pos_d
+--source include/rpl_change_topology.inc
+#--replace_result $SERVER_MYPORT_3 SERVER_MYPORT_3 $file_d LOG_FILE $pos_d LOG_POS
+#--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SERVER_MYPORT_3,master_user='root',master_log_file='$file_d',master_log_pos=$pos_d
+--source include/start_slave.inc
+--connection server_3
+--sync_slave_with_master server_4
+--source include/rpl_sync.inc
--echo
--echo * Check data inserted before restoring schema A->B->C->D->A *
---connection master_a
+--connection server_1
SELECT 'Master A',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
---sync_slave_with_master master_b
+--sync_slave_with_master server_2
SELECT 'Master B',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
---sync_slave_with_master master_c
+--sync_slave_with_master server_3
SELECT 'Master C',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
---sync_slave_with_master master_d
+--sync_slave_with_master server_4
SELECT 'Master D',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
---sync_slave_with_master master_a
+--sync_slave_with_master server_1
--echo
--echo * Check data inserted after restoring schema A->B->C->D->A *
---connection master_a
+--connection server_1
INSERT INTO t1(b,c) VALUES('A',4);
---connection master_b
+--connection server_2
INSERT INTO t1(b,c) VALUES('B',4);
---connection master_c
+--connection server_3
INSERT INTO t1(b,c) VALUES('C',4);
---connection master_d
+--connection server_4
INSERT INTO t1(b,c) VALUES('D',4);
---connection master_a
+--connection server_1
---source include/circular_rpl_for_4_hosts_sync.inc
+--source include/rpl_sync.inc
---connection master_a
+--connection server_1
SELECT 'Master A',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
---connection master_b
+--connection server_2
SELECT 'Master B',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
---connection master_c
+--connection server_3
SELECT 'Master C',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
---connection master_d
+--connection server_4
SELECT 'Master D',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
---connection master_a
+--connection server_1
--echo
--echo * Transactions with commits *
# Testing mixing of transactions and regular inserts
---connection master_a
+--connection server_1
BEGIN;
---connection master_c
+--connection server_3
BEGIN;
let $counter= 100;
---connection master_a
+--connection server_1
--disable_query_log
while ($counter) {
- --connection master_a
+ --connection server_1
INSERT INTO t2(b,c) VALUES('A',1);
- --connection master_b
+ --connection server_2
INSERT INTO t2(b,c) VALUES('B',1);
- --connection master_c
+ --connection server_3
INSERT INTO t2(b,c) VALUES('C',1);
- --connection master_d
+ --connection server_4
INSERT INTO t2(b,c) VALUES('D',1);
dec $counter;
}
---connection master_a
+--connection server_1
COMMIT;
---connection master_c
+--connection server_3
COMMIT;
---connection master_a
+--connection server_1
--enable_query_log
---source include/circular_rpl_for_4_hosts_sync.inc
+--source include/rpl_sync.inc
---connection master_a
+--connection server_1
SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
---connection master_b
+--connection server_2
SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
---connection master_c
+--connection server_3
SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
---connection master_d
+--connection server_4
SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
---connection master_a
+--connection server_1
--echo
--echo * Transactions with rollbacks *
# Testing mixing of transactions with rollback and regular inserts
---connection master_a
+--connection server_1
BEGIN;
---connection master_c
+--connection server_3
BEGIN;
let $counter= 100;
---connection master_a
+--connection server_1
--disable_query_log
while ($counter) {
- --connection master_a
+ --connection server_1
INSERT INTO t2(b,c) VALUES('A',2);
- --connection master_b
+ --connection server_2
INSERT INTO t2(b,c) VALUES('B',2);
- --connection master_c
+ --connection server_3
INSERT INTO t2(b,c) VALUES('C',2);
- --connection master_d
+ --connection server_4
INSERT INTO t2(b,c) VALUES('D',2);
dec $counter;
}
---connection master_a
+--connection server_1
ROLLBACK;
---connection master_c
+--connection server_3
ROLLBACK;
---connection master_a
+--connection server_1
--enable_query_log
---source include/circular_rpl_for_4_hosts_sync.inc
+--source include/rpl_sync.inc
---connection master_a
+--connection server_1
SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
---connection master_b
+--connection server_2
SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
---connection master_c
+--connection server_3
SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
---connection master_d
+--connection server_4
SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
---connection master_a
+--connection server_1
--echo
# Clean up
--echo *** Clean up ***
---connection master_a
+--connection server_1
DROP TABLE t1,t2;
---source include/circular_rpl_for_4_hosts_sync.inc
---connection master_a
-STOP SLAVE;
-RESET SLAVE;
---connection master_b
-STOP SLAVE;
-RESET SLAVE;
---connection master_c
-STOP SLAVE;
-RESET SLAVE;
---connection master_d
-STOP SLAVE;
-RESET SLAVE;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_colSize.test b/mysql-test/suite/rpl/t/rpl_colSize.test
index 4c808ef3dfd..d6f817af189 100644
--- a/mysql-test/suite/rpl/t/rpl_colSize.test
+++ b/mysql-test/suite/rpl/t/rpl_colSize.test
@@ -225,3 +225,4 @@ sync_slave_with_master;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
# END 5.1 Test Case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_commit_after_flush.test b/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
index 47df391d6be..5e070b14301 100644
--- a/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
+++ b/mysql-test/suite/rpl/t/rpl_commit_after_flush.test
@@ -1,12 +1,6 @@
-#####################################
-# 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
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_concurrency_error.test b/mysql-test/suite/rpl/t/rpl_concurrency_error.test
index 2e216d25211..15d5d5502a1 100644
--- a/mysql-test/suite/rpl/t/rpl_concurrency_error.test
+++ b/mysql-test/suite/rpl/t/rpl_concurrency_error.test
@@ -53,24 +53,24 @@ while ($type)
{
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
connection conn1;
- if (`select $type = 2`)
+ if ($type == 2)
{
SET AUTOCOMMIT = 1;
BEGIN;
}
- if (`select $type = 1`)
+ if ($type == 1)
{
SET AUTOCOMMIT = 0;
}
eval UPDATE t SET f = 'yellow $type' WHERE i = 3;
connection conn2;
- if (`select $type = 2`)
+ if ($type == 2)
{
SET AUTOCOMMIT = 1;
BEGIN;
}
- if (`select $type = 1`)
+ if ($type == 1)
{
SET AUTOCOMMIT = 0;
}
@@ -88,24 +88,24 @@ while ($type)
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
connection conn1;
- if (`select $type = 2`)
+ if ($type == 2)
{
SET AUTOCOMMIT = 1;
BEGIN;
}
- if (`select $type = 1`)
+ if ($type == 1)
{
SET AUTOCOMMIT = 0;
}
eval UPDATE t SET f = 'gray $type' WHERE i = 3;
connection conn2;
- if (`select $type = 2`)
+ if ($type == 2)
{
SET AUTOCOMMIT = 1;
BEGIN;
}
- if (`select $type = 1`)
+ if ($type == 1)
{
SET AUTOCOMMIT = 0;
}
@@ -127,13 +127,11 @@ while ($type)
connection master;
sync_slave_with_master;
-connection master;
-let $diff_statement= SELECT * FROM t order by i;
-source include/diff_master_slave.inc;
+let $rpl_diff_statement= SELECT * FROM t order by i;
+source include/rpl_diff.inc;
-connection master;
-let $diff_statement= SELECT * FROM n order by d, f;
-source include/diff_master_slave.inc;
+let $rpl_diff_statement= SELECT * FROM n order by d, f;
+source include/rpl_diff.inc;
--echo ########################################################################
--echo # Cleanup
@@ -149,3 +147,4 @@ sync_slave_with_master;
connection master;
disconnect conn1;
disconnect conn2;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_conditional_comments.test b/mysql-test/suite/rpl/t/rpl_conditional_comments.test
index 14251d5eb37..88adf3a20f1 100644
--- a/mysql-test/suite/rpl/t/rpl_conditional_comments.test
+++ b/mysql-test/suite/rpl/t/rpl_conditional_comments.test
@@ -26,15 +26,15 @@ let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
source include/show_binlog_events.inc;
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
-source include/diff_tables.inc;
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
--echo
--echo # Case 2:
--echo # -----------------------------------------------------------------
--echo # Verify whether it can be binlogged correctly when executing prepared
--echo # statement.
+--connection master
PREPARE stmt FROM 'INSERT INTO /*!99999 blabla*/ t1 VALUES(60) /*!99999 ,(61)*/';
EXECUTE stmt;
DROP TABLE t1;
@@ -42,10 +42,10 @@ CREATE TABLE t1(c1 INT);
EXECUTE stmt;
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
-source include/diff_tables.inc;
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
+--connection master
--echo
SET @value=62;
PREPARE stmt FROM 'INSERT INTO /*!99999 blabla */ t1 VALUES(?) /*!99999 ,(63)*/';
@@ -58,17 +58,17 @@ source include/show_binlog_events.inc;
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
-source include/diff_tables.inc;
+--let $diff_tables= master:t1,slave:t1
+--source include/diff_tables.inc
--echo
--echo # Case 3:
--echo # -----------------------------------------------------------------
--echo # Verify it can restore the '!', if the it is an uncomplete conditional
--echo # comments
+--connection master
--error 1064
SELECT c1 FROM /*!99999 t1 WHEREN;
DROP TABLE t1;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_database.test b/mysql-test/suite/rpl/t/rpl_create_database.test
index e3e2e637594..5eac3de0d15 100644
--- a/mysql-test/suite/rpl/t/rpl_create_database.test
+++ b/mysql-test/suite/rpl/t/rpl_create_database.test
@@ -70,3 +70,4 @@ DROP DATABASE IF EXISTS mysqltest_bob;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_if_not_exists.test b/mysql-test/suite/rpl/t/rpl_create_if_not_exists.test
index 6b459bb9c76..4e24b9a8133 100644
--- a/mysql-test/suite/rpl/t/rpl_create_if_not_exists.test
+++ b/mysql-test/suite/rpl/t/rpl_create_if_not_exists.test
@@ -125,7 +125,7 @@ DROP TABLE t3;
--echo # After the worklog, it will insert nothing and the statement will not be
--echo # binlogged if the table already exists.
--echo # After the worklog, some bugs will disappear automotically.
-source include/master-slave-reset.inc;
+--source include/rpl_reset.inc
--echo
--echo # Case 1: BUG#47132
@@ -173,4 +173,4 @@ DROP VIEW v1;
DROP TABLE t1, t2;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test b/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test
index a06dfa54cb1..daf6b7e9ad8 100644
--- a/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test
+++ b/mysql-test/suite/rpl/t/rpl_create_tmp_table_if_not_exists.test
@@ -38,4 +38,4 @@ CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp;
CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp;
source include/show_binlog_events.inc;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_critical_errors.test b/mysql-test/suite/rpl/t/rpl_critical_errors.test
index aa1f251b738..bc0d7096f80 100644
--- a/mysql-test/suite/rpl/t/rpl_critical_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_critical_errors.test
@@ -35,7 +35,7 @@ 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.
let $wait_condition= SELECT COUNT(*) > 1000 FROM t1;
-source include/wait_condition.inc
+--source include/wait_condition.inc
# SHOW PROCESSLIST;
@@ -62,4 +62,5 @@ connection slave;
# The following should be 0
SELECT COUNT(*) FROM t2;
+--source include/rpl_end.inc
enable_parsing;
diff --git a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
index 815a8f81d32..b0a1ce4a0be 100644
--- a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
@@ -1 +1,2 @@
--replicate-same-server-id --relay-log=slave-relay-bin
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_cross_version.test b/mysql-test/suite/rpl/t/rpl_cross_version.test
index 8cd268a5fd9..94c9f0432ce 100644
--- a/mysql-test/suite/rpl/t/rpl_cross_version.test
+++ b/mysql-test/suite/rpl/t/rpl_cross_version.test
@@ -10,18 +10,23 @@
# The master's binlog is treated as a relay log that the SQL thread executes.
#
---source include/have_log_bin.inc
-
-# The test is disabled for windows due to
-# Bug #42879 CHANGE MASTER RELAY_LOG_FILE=path fails on windows
-# Todo: release it from not_windows
---source include/not_windows.inc
+--source include/master-slave.inc
#
# Bug#31240 load data infile replication between (4.0 or 4.1) and 5.1 fails
#
--echo ==== Initialize ====
+--connection slave
+
+--disable_query_log
+# The binlog contains the function RAND which is unsafe.
+CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--enable_query_log
+
+--source include/stop_slave.inc
+RESET SLAVE;
+
# the relay log contains create t1, t3 tables and load data infile
--let $fake_relay_log = $MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001
--source include/setup_fake_relay_log.inc
@@ -36,6 +41,8 @@ start slave sql_thread;
SELECT COUNT(*) - 17920 as zero FROM t3;
--echo ==== Clean up ====
-stop slave sql_thread;
+--source include/stop_slave_sql.inc
--source include/cleanup_fake_relay_log.inc
drop table t1, t3;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_current_user-master.opt b/mysql-test/suite/rpl/t/rpl_current_user-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_current_user-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_current_user.cnf b/mysql-test/suite/rpl/t/rpl_current_user.cnf
index 999ee727a88..58b605ad928 100644
--- a/mysql-test/suite/rpl/t/rpl_current_user.cnf
+++ b/mysql-test/suite/rpl/t/rpl_current_user.cnf
@@ -1,9 +1,8 @@
!include ../my.cnf
[mysqld.3]
-server-id=3
-log-bin=slave-bin
+log-slave-updates
[ENV]
-SLAVE_MYPORT1= @mysqld.3.port
-SLAVE_MYSOCK1= @mysqld.3.socket
+SERVER_MYPORT_3= @mysqld.3.port
+SERVER_MYSOCK_3= @mysqld.3.socket
diff --git a/mysql-test/suite/rpl/t/rpl_current_user.test b/mysql-test/suite/rpl/t/rpl_current_user.test
index 79816ef6c95..ac2af1af14e 100644
--- a/mysql-test/suite/rpl/t/rpl_current_user.test
+++ b/mysql-test/suite/rpl/t/rpl_current_user.test
@@ -10,35 +10,31 @@
# 'ALTER EVENT'.
#
##############################################################################
-source include/master-slave.inc;
+
source include/have_binlog_format_statement.inc;
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
---echo
---echo # On slave2
-connect (slave2,127.0.0.1,root,,test,$SLAVE_MYPORT1,);
-connection slave2;
+--let $rpl_topology= 1->2->3
+--source include/rpl_init.inc
---echo # Connect slave2 to slave
---replace_result $SLAVE_MYPORT SLAVE_MYPORT;
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT,
- MASTER_LOG_FILE='slave-bin.000001', MASTER_USER='root';
-START SLAVE;
-source include/wait_for_slave_to_start.inc;
+--let $rpl_connection_name= master
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= slave
+--let $rpl_server_number= 2
+--source include/rpl_connect.inc
+
+--disable_query_log
+--connection server_1
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
+--connection server_2
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
+--connection server_3
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
+--enable_query_log
+
+--connection master
---echo
---echo # [On master]
-connection master;
---disable_warnings
-DROP VIEW IF EXISTS v_user;
-DROP VIEW IF EXISTS v_tables_priv;
-DROP VIEW IF EXISTS v_procs_priv;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS my_grant;
-DROP PROCEDURE IF EXISTS my_revoke;
-DROP FUNCTION IF EXISTS my_user;
-DROP EVENT IF EXISTS e1;
---enable_warnings
CREATE TABLE t1(c1 char(100));
CREATE VIEW test.v_user AS SELECT * FROM mysql.user WHERE User LIKE 'bug48321%';
CREATE VIEW test.v_tables_priv AS SELECT * FROM mysql.tables_priv WHERE User LIKE 'bug48321%';
@@ -64,75 +60,76 @@ connection conn1;
--echo # [On conn1]
--echo # Verify 'REVOKE ALL' statement
REVOKE ALL PRIVILEGES, GRANT OPTION FROM CURRENT_USER();
-let $diff_table= test.v_user;
-let $diff_server_list= master, slave, slave2;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_user, server_2:v_user, server_3:v_user;
+source include/diff_tables.inc;
--echo
--echo # Verify 'GRANT ... ON TABLE ...' statement
-connection conn1;
GRANT CREATE, INSERT, SELECT ON TABLE test.t1 TO CURRENT_USER();
-let $diff_table= test.v_tables_priv;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'GRANT ... ON PROCEDURE...' statement
-connection conn1;
GRANT ALTER ROUTINE, EXECUTE ON PROCEDURE p1 TO CURRENT_USER();
-let $diff_table= test.v_procs_priv;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_procs_priv, server_2:v_procs_priv, server_3:v_procs_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'GRANT ... ON *.* ...' statement
-connection conn1;
GRANT ALL PRIVILEGES ON *.* TO CURRENT_USER() WITH GRANT OPTION;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_procs_priv, server_2:v_procs_priv, server_3:v_procs_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'REVOKE ... ON TABLE ...' statement
-connection conn1;
REVOKE CREATE, INSERT, SELECT ON TABLE t1 FROM CURRENT_USER();
-let $diff_table= test.v_tables_priv;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'REVOKE ... ON PROCEDURE...' statement
-connection conn1;
REVOKE ALTER ROUTINE, EXECUTE ON PROCEDURE p1 FROM CURRENT_USER();
-let $diff_table= test.v_procs_priv;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_procs_priv, server_2:v_procs_priv, server_3:v_procs_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'REVOKE ... ON *.* ...' statement
-connection conn1;
REVOKE ALL PRIVILEGES ON *.* FROM CURRENT_USER();
-let $diff_table= test.v_user;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_user, server_2:v_user, server_3:v_user;
+source include/diff_tables.inc;
--echo
--echo # Verify 'GRANT ...' statement in the procedure
-connection conn1;
CREATE PROCEDURE my_grant()
GRANT CREATE, INSERT, SELECT ON TABLE test.t1 TO CURRENT_USER();
call my_grant;
-let $diff_table= test.v_tables_priv;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'REVOKE ... ON TABLE ...' statement in the procedure
-connection conn1;
CREATE PROCEDURE my_revoke()
REVOKE CREATE, INSERT, SELECT ON TABLE t1 FROM CURRENT_USER();
call my_revoke;
-let $diff_table= test.v_tables_priv;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_tables_priv, server_2:v_tables_priv, server_3:v_tables_priv;
+source include/diff_tables.inc;
--echo
--echo # Verify 'RENAME USER ...' statement
-connection conn1;
RENAME USER CURRENT_USER TO 'bug48321_2'@'localhost';
-let $diff_table= test.v_user;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_user, server_2:v_user, server_3:v_user;
+source include/diff_tables.inc;
disconnect conn1;
@@ -143,7 +140,9 @@ GRANT CREATE USER ON *.* TO 'bug48321_2'@'localhost';
connect (conn1, 127.0.0.1, 'bug48321_2'@'localhost',,);
connection conn1;
DROP USER CURRENT_USER();
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_user, server_2:v_user, server_3:v_user;
+source include/diff_tables.inc;
--echo
--echo # Verify 'ALTER EVENT...' statement
@@ -152,16 +151,17 @@ CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT * FROM t1;
--echo # Explicitly assign CURRENT_USER() to definer
ALTER DEFINER=CURRENT_USER() EVENT e1 ENABLE;
-let $diff_table= test.v_event;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_event, server_2:v_event, server_3:v_event;
+source include/diff_tables.inc;
-connection master;
--echo
--echo # Session user will be set as definer, if the statement does not assign
--echo # a definer
ALTER EVENT e1 ENABLE;
-sync_slave_with_master;
-source include/rpl_diff_tables.inc;
+--source include/rpl_sync.inc
+let $diff_tables= server_1:v_event, server_2:v_event, server_3:v_event;
+source include/diff_tables.inc;
--echo
--echo # Verify that this patch does not affect the calling of CURRENT_USER()
@@ -173,8 +173,8 @@ SELECT * FROM t1;
sync_slave_with_master;
--echo # [On slave]
SELECT * FROM t1;
---echo # [On slave2]
-sync_slave_with_master slave2;
+--echo # [On server_3]
+sync_slave_with_master server_3;
SELECT * FROM t1;
connection master;
@@ -184,8 +184,8 @@ SELECT * FROM t1;
sync_slave_with_master;
--echo # [On slave]
SELECT * FROM t1;
-sync_slave_with_master slave2;
---echo # [On slave2]
+sync_slave_with_master server_3;
+--echo # [On server_3]
SELECT * FROM t1;
connection master;
@@ -195,8 +195,8 @@ SELECT * FROM t1;
sync_slave_with_master;
--echo # [On slave]
SELECT * FROM t1;
-sync_slave_with_master slave2;
---echo # [On slave2]
+sync_slave_with_master server_3;
+--echo # [On server_3]
SELECT * FROM t1;
connection master;
@@ -219,8 +219,8 @@ sync_slave_with_master;
--echo # [On slave]
SELECT * FROM t1;
SELECT * FROM t2;
-sync_slave_with_master slave2;
---echo # [On slave2]
+sync_slave_with_master server_3;
+--echo # [On server_3]
SELECT * FROM t1;
SELECT * FROM t2;
@@ -234,6 +234,5 @@ DROP PROCEDURE my_grant;
DROP PROCEDURE my_revoke;
DROP FUNCTION my_user;
DROP EVENT e1;
-sync_slave_with_master;
-sync_slave_with_master slave2;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/rpl/t/rpl_ddl.test b/mysql-test/suite/rpl/t/rpl_ddl.test
index 80df16a7a00..83a530131a6 100644
--- a/mysql-test/suite/rpl/t/rpl_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_ddl.test
@@ -30,3 +30,4 @@ let $temp_engine_type= MEMORY;
let $show_binlog = 0;
let $manipulate = 0;
-- source extra/rpl_tests/rpl_ddl.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
index ee907f81b22..b2d4e42a973 100644
--- a/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test
@@ -1,10 +1,3 @@
-################################
-# Wrapper for rpl_deadlock.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;
diff --git a/mysql-test/suite/rpl/t/rpl_delete_no_where.test b/mysql-test/suite/rpl/t/rpl_delete_no_where.test
index 64a293b4058..4bfe6d07b5a 100644
--- a/mysql-test/suite/rpl/t/rpl_delete_no_where.test
+++ b/mysql-test/suite/rpl/t/rpl_delete_no_where.test
@@ -5,3 +5,4 @@
-- source include/master-slave.inc
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_delete_no_where.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test
index f04ac54ac50..94dd1c5d3f4 100644
--- a/mysql-test/suite/rpl/t/rpl_do_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_do_grant.test
@@ -213,17 +213,19 @@ stop slave;
connection master;
# user was already dropped in the slave before
-# so no need to wait for the slave to replicate
-# this statement (if it did and we later synced
-# the slave it would end up in an error anyway)
+# so we should not replicate this statement.
+SET SQL_LOG_BIN= 0;
DROP USER 'create_rout_db'@'localhost';
+SET SQL_LOG_BIN= 1;
--enable_warnings
# finish entire clean up (remove binlogs)
# so that we leave a pristine environment for the
# following tests
--- source include/master-slave-reset.inc
+--let $rpl_only_running_threads= 1
+-- source include/rpl_reset.inc
+USE test;
# BUG#49119: Master crashes when executing 'REVOKE ... ON
# {PROCEDURE|FUNCTION} FROM ...'
@@ -248,7 +250,7 @@ DROP USER 'create_rout_db'@'localhost';
-- echo ######## BUG#49119 #######
-- echo ### i) test case from the 'how to repeat section'
--- source include/master-slave-reset.inc
+
-- connection master
CREATE TABLE t1(c1 INT);
@@ -269,7 +271,7 @@ DROP PROCEDURE p1;
-- echo ### ii) Test case in which REVOKE partially succeeds
-- connection master
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
CREATE TABLE t1(c1 INT);
@@ -329,8 +331,7 @@ DROP USER 'user49119'@'localhost';
# Bug #51987 revoke privileges logs wrong error code
#
--- connection master
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
grant all on *.* to foo@"1.2.3.4";
@@ -344,14 +345,29 @@ revoke all privileges, grant option from "foo";
## assertion: slave replicates revoke and does not fail because master
## logged revoke with correct expected error code
--- let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1)
- if ($err)
-{
- -- die UNEXPECTED ERROR AT SLAVE: $err
-}
+--source include/check_slave_no_error.inc
-- connection master
DROP USER foo@"1.2.3.4";
-- sync_slave_with_master
---echo "End of test"
+--echo
+--echo # Bug#27606 GRANT statement should be replicated with DEFINER information
+--source include/rpl_reset.inc
+--connection master
+GRANT SELECT, INSERT ON mysql.user TO user_bug27606@localhost;
+
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+sync_slave_with_master;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+
+--connection master
+REVOKE SELECT ON mysql.user FROM user_bug27606@localhost;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+sync_slave_with_master;
+SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
+
+--connection master
+DROP USER user_bug27606@localhost;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_drop.test b/mysql-test/suite/rpl/t/rpl_drop.test
index 7af325240ee..7b8873345b9 100644
--- a/mysql-test/suite/rpl/t/rpl_drop.test
+++ b/mysql-test/suite/rpl/t/rpl_drop.test
@@ -1,13 +1,12 @@
# Testcase for BUG#4552 (DROP on two tables, one of which does not
# exist, must be binlogged with a non-zero error code)
source include/master-slave.inc;
---disable_warnings
-drop table if exists t1, t2;
---enable_warnings
+
create table t1 (a int);
--error 1051
drop table t1, t2;
-sync_slave_with_master;
+--sync_slave_with_master
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_drop_db.test b/mysql-test/suite/rpl/t/rpl_drop_db.test
index 11e93e7307a..c3194f08f52 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_db.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_db.test
@@ -58,4 +58,5 @@ drop table t1;
drop database mysqltest1;
sync_slave_with_master;
-source include/stop_slave.inc;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_drop_temp.test b/mysql-test/suite/rpl/t/rpl_drop_temp.test
index 7bc55c53447..641813070ca 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_temp.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_temp.test
@@ -71,9 +71,8 @@ sync_slave_with_master;
# BUG#54842: DROP TEMPORARY TABLE not binlogged after manual switching binlog format to ROW
#
--- connection master
--- source include/master-slave-reset.inc
--- connection master
+--source include/rpl_reset.inc
+--connection master
CREATE TABLE t1 ( i INT );
--sync_slave_with_master
@@ -95,3 +94,4 @@ SHOW STATUS LIKE 'Slave_open_temp_tables';
DROP TABLE t1;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_drop_view.test b/mysql-test/suite/rpl/t/rpl_drop_view.test
index 05bf112b8b8..55a0ea104d8 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_view.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_view.test
@@ -32,3 +32,4 @@ select * from v3;
connection master;
drop table t1, t2, t3;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
index ab1de6a2e9f..618576f5641 100644
--- a/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
+++ b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test
@@ -6,33 +6,21 @@
# of their server id).
# It also will test BUG#13861.
-source include/master-slave.inc;
source include/have_innodb.inc;
-
-# set up "dual head"
-
-# Needed for debug info in wait_for_slave_sql_to_stop.
-let $master_connection= slave;
-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";
-
-source include/start_slave.inc;
+--let $rpl_topology= 1->2->1
+--source include/rpl_init.inc
# now we test it
-connection slave;
+connection server_2;
create table t1 (n int);
let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1);
let $master_log_pos_1= query_get_value(SHOW MASTER STATUS, Position, 1);
let $master_log_pos_1= `SELECT $master_log_pos_1 + 3`;
-sync_slave_with_master master;
+--sync_slave_with_master server_1
#
# BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if
@@ -42,7 +30,7 @@ source include/stop_slave.inc;
create table t2 (n int); # create one ignored event
-sync_slave_with_master;
+--sync_slave_with_master server_2
show tables;
@@ -59,7 +47,8 @@ insert into t3 values(3);
commit;
insert into t3 values(4);
-connection master;
+
+connection server_1;
# bug is that START SLAVE UNTIL may stop too late, we test that by
# asking it to stop before creation of t3.
@@ -89,26 +78,20 @@ source include/start_slave.inc;
# BUG#13023 is that Exec_master_log_pos may stay too low "forever":
-connection master;
+connection server_1;
create table t4 (n int); # create 3 ignored events
create table t5 (n int);
create table t6 (n int);
-sync_slave_with_master;
-sync_slave_with_master master;
+--sync_slave_with_master server_2
# then BUG#13023 caused hang below ("master" looks behind, while it's
# not in terms of updates done).
+--sync_slave_with_master server_1
show tables;
# cleanup
-
-source include/stop_slave.inc;
-reset slave;
-drop table t1,t2,t3,t4,t5,t6;
-
-sync_slave_with_master;
-
-# End of 4.1 tests
+drop table t1, t2, t3, t4, t5, t6;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_empty_master_host.test b/mysql-test/suite/rpl/t/rpl_empty_master_host.test
index 7d245b1d5d5..df0c85ad7ec 100644
--- a/mysql-test/suite/rpl/t/rpl_empty_master_host.test
+++ b/mysql-test/suite/rpl/t/rpl_empty_master_host.test
@@ -49,3 +49,4 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
# start slave must succeed.
START SLAVE;
--source include/wait_for_slave_to_start.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
index 05cccdbae1d..9ebed299956 100644
--- a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
+++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test
@@ -64,3 +64,6 @@ DROP TABLE test.t4;
sync_slave_with_master;
# End of 4.1 tests
# Adding comment for force manual merge 5.0 -> wl1012. delete me if needed
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test
index 45ef12862fc..1de5006f647 100644
--- a/mysql-test/suite/rpl/t/rpl_events.test
+++ b/mysql-test/suite/rpl/t/rpl_events.test
@@ -101,3 +101,4 @@ DROP EVENT event44331_2;
DROP EVENT event44331_3;
DROP EVENT event44331_4;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_extraCol_innodb.test b/mysql-test/suite/rpl/t/rpl_extraCol_innodb.test
deleted file mode 100644
index e9685baf01b..00000000000
--- a/mysql-test/suite/rpl/t/rpl_extraCol_innodb.test
+++ /dev/null
@@ -1,13 +0,0 @@
-###########################################
-# Author: Jeb
-# Date: 2006-09-08
-# Purpose: Wapper for rpl_extraSlave_Col.test
-# Using innodb
-###########################################
--- 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_extraSlave_Col.test
-
-
diff --git a/mysql-test/suite/rpl/t/rpl_extraCol_myisam.test b/mysql-test/suite/rpl/t/rpl_extraCol_myisam.test
deleted file mode 100644
index d56df394ccf..00000000000
--- a/mysql-test/suite/rpl/t/rpl_extraCol_myisam.test
+++ /dev/null
@@ -1,12 +0,0 @@
-###########################################
-# Author: Jeb
-# Date: 2006-09-07
-# Purpose: Wapper for rpl_extraSlave_Col.test
-# Using MyISAM
-###########################################
--- source include/have_binlog_format_row.inc
--- source include/master-slave.inc
-let $engine_type = 'MyISAM';
--- source extra/rpl_tests/rpl_extraSlave_Col.test
-
-
diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test
deleted file mode 100644
index 29758366577..00000000000
--- a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test
+++ /dev/null
@@ -1,9 +0,0 @@
-#############################################################
-# Purpose: To test having extra columns on the master WL#3915
-#############################################################
--- source include/have_binlog_format_row.inc
--- source include/master-slave.inc
--- source include/have_innodb.inc
-
-let $engine_type = 'InnoDB';
---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
deleted file mode 100644
index 31529a19cfc..00000000000
--- a/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test
+++ /dev/null
@@ -1,8 +0,0 @@
-#############################################################
-# Purpose: To test having extra columns on the master WL#3915
-#############################################################
--- source include/have_binlog_format_row.inc
--- source include/master-slave.inc
-
-let $engine_type = 'MyISAM';
---source extra/rpl_tests/rpl_extraMaster_Col.test
diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test b/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test
new file mode 100644
index 00000000000..f48880b5dfa
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_extra_col_master_innodb.test
@@ -0,0 +1,11 @@
+#############################################################
+# Purpose: To test having extra columns on the master WL#3915
+#############################################################
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+-- source include/have_innodb.inc
+
+let $engine_type = 'InnoDB';
+--source extra/rpl_tests/rpl_extra_col_master.test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test b/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test
new file mode 100644
index 00000000000..4f344cfaca9
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_extra_col_master_myisam.test
@@ -0,0 +1,10 @@
+#############################################################
+# Purpose: To test having extra columns on the master WL#3915
+#############################################################
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+let $engine_type = 'MyISAM';
+--source extra/rpl_tests/rpl_extra_col_master.test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test b/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test
new file mode 100644
index 00000000000..f4b04468273
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_extra_col_slave_innodb.test
@@ -0,0 +1,7 @@
+-- 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_extra_col_slave.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test b/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test
new file mode 100644
index 00000000000..d8d64aed566
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_extra_col_slave_myisam.test
@@ -0,0 +1,6 @@
+-- source include/have_binlog_format_row.inc
+-- source include/master-slave.inc
+
+let $engine_type = 'MyISAM';
+-- source extra/rpl_tests/rpl_extra_col_slave.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt b/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt
deleted file mode 100644
index 3f82baff598..00000000000
--- a/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-lock-wait-timeout=1
diff --git a/mysql-test/suite/rpl/t/rpl_failed_optimize.test b/mysql-test/suite/rpl/t/rpl_failed_optimize.test
index 81e8342b5c0..798b3ef8b41 100644
--- a/mysql-test/suite/rpl/t/rpl_failed_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_failed_optimize.test
@@ -1,10 +1,3 @@
-#######################################
-# Wrapper for rpl_failed_optimize.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;
diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
index aa2dee0fe57..13c66f9f64b 100644
--- a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
+++ b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
@@ -122,6 +122,8 @@ UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id
# if any of the above statement are not ignored, it would cause error
# and stop slave sql thread.
sync_slave_with_master;
+connection slave;
+call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* Error_code: 1146");
connection master;
# Parameters for include/wait_for_slave_sql_error_and_skip.inc:
@@ -204,4 +206,4 @@ SELECT * FROM t3;
connection master;
echo [on master];
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_flush_logs.test b/mysql-test/suite/rpl/t/rpl_flush_logs.test
index 5159acaae14..6e9de634157 100644
--- a/mysql-test/suite/rpl/t/rpl_flush_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_flush_logs.test
@@ -24,23 +24,16 @@ sync_slave_with_master;
--echo # Make sure relay logs was not be flushed
--echo # after execute 'flush error logs' statement.
--error 1
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000004;
-
-
-# Test 'flush relay logs' statement.
---echo # Make sure the 'slave-relay-bin.000004' file does not
---echo # exist before execute 'flush relay logs' statement.
---error 1
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000004;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000003;
connection master;
--echo # Test if support 'flush relay logs' statement.
flush relay logs;
sync_slave_with_master;
---echo # Check the 'slave-relay-bin.000004' file is created
+--echo # Check the 'slave-relay-bin.000003' file is created
--echo # after executed 'flush relay logs' statement.
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000004;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000003;
connection master;
--echo # Make sure binary logs was not be flushed
@@ -96,10 +89,10 @@ file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000001;
# Test 'flush error logs, relay logs' statement
sync_slave_with_master;
---echo # Make sure the 'slave-relay-bin.000007' file does not exist
+--echo # Make sure the 'slave-relay-bin.000006' file does not exist
--echo # exist before execute 'flush error logs, relay logs' statement.
--error 1
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006;
connection master;
@@ -114,19 +107,19 @@ file_exists $MYSQLTEST_VARDIR/tmp/master_log.err;
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003;
sync_slave_with_master;
---echo # Check the 'slave-relay-bin.000007' file is created after
+--echo # Check the 'slave-relay-bin.000006' file is created after
--echo # execute 'flush error logs, relay logs' statement.
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006;
# Test 'flush logs' statement
---echo # Make sure the 'slave-relay-bin.000008' and 'slave-relay-bin.000009'
---echo # files do not exist before execute 'flush error logs, relay logs'
+--echo # Make sure the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
+--echo # files do not exist before execute 'flush error logs, relay logs'
--echo # statement.
--error 1
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007;
--error 1
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000009;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008;
connection master;
@@ -140,8 +133,9 @@ file_exists $MYSQLTEST_VARDIR/tmp/master_log.err;
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003;
sync_slave_with_master;
---echo # Check the 'slave-relay-bin.000008' and 'slave-relay-bin.000009'
+--echo # Check the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
--echo # files are created after execute 'flush logs' statement.
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007;
file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008;
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000009;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
index ad7fd508afe..3b5d41d4261 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt
@@ -1 +1 @@
---max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/mysqld.1/data/relay-log
+--max_binlog_size=1M
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh
deleted file mode 100644
index a321dd690cd..00000000000
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-rm -f $MYSQLTEST_VARDIR/slave-data/*-bin.*
-rm -f $MYSQLTEST_VARDIR/slave-data/master.info
-rm -f $MYSQLTEST_VARDIR/slave-data/*.index
-
-
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
index c8d2f85bcb7..3b5d41d4261 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt
@@ -1 +1 @@
---max_binlog_size=1M --relay-log=$MYSQLTEST_VARDIR/mysqld.2/data/relay-log
+--max_binlog_size=1M
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh
deleted file mode 100644
index e46ea6d400b..00000000000
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-rm -f $MYSQLTEST_VARDIR/master-data/master.info
-rm -f $MYSQLTEST_VARDIR/master-data/*-bin.*
-rm -f $MYSQLTEST_VARDIR/master-data/*.index
-
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
index 76cd73ba9e0..d5d362bac0f 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
@@ -1,37 +1,12 @@
# Testing if "flush logs" command bouncing resulting in logs created in a loop
# in case of bi-directional replication
--- source include/master-slave.inc
-# Use wait_for_slave_to_(start|stop) for current connections
-let $keep_connection= 1;
+--let $rpl_topology= 1->2->1
+--source include/rpl_init.inc
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR/
show variables like 'relay_log%';
-connection slave;
---disable_warnings
-stop slave;
---source include/wait_for_slave_to_stop.inc
---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;
---source include/wait_for_slave_to_start.inc
-#
-# Start replication slave -> master
-#
-connection master;
---disable_warnings
-stop slave;
---source include/wait_for_slave_to_stop.inc
---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;
-
-source include/start_slave.inc;
-
#
# Flush logs of slave
#
@@ -43,16 +18,16 @@ source include/start_slave.inc;
CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM;
let $wait_binlog_event= CREATE TABLE t1;
--source include/wait_for_binlog_event.inc
-sync_slave_with_master;
+sync_slave_with_master server_2;
-connection master;
+connection server_1;
INSERT INTO t1 VALUE(1);
FLUSH LOGS;
-sync_slave_with_master;
+sync_slave_with_master server_2;
INSERT INTO t1 VALUE(2);
let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1);
-sync_slave_with_master master;
+sync_slave_with_master server_1;
#
# Check that the master server's slave threads are still running and show
@@ -63,7 +38,9 @@ sync_slave_with_master master;
--source include/show_slave_status.inc
--disable_query_log
-connection master;
+connection server_1;
DROP TABLE t1;
-sync_slave_with_master;
+sync_slave_with_master server_2;
--enable_query_log
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
index d085bff2012..ce28c0334ec 100644
--- a/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test
@@ -1,10 +1,3 @@
-###################################
-# Wrapper for rpl_foreign_key.test#
-###################################
-# Change Author: JBM
-# Change Date: 2006-01-17
-# Change: FK not supported, skip test when NDB is forced
-####################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=INNODB;
diff --git a/mysql-test/suite/rpl/t/rpl_free_items.test b/mysql-test/suite/rpl/t/rpl_free_items.test
index 043e84160b8..581409cfc10 100644
--- a/mysql-test/suite/rpl/t/rpl_free_items.test
+++ b/mysql-test/suite/rpl/t/rpl_free_items.test
@@ -20,3 +20,4 @@ drop table t2;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_geometry.test b/mysql-test/suite/rpl/t/rpl_geometry.test
index eac98924b98..769c49c96b1 100644
--- a/mysql-test/suite/rpl/t/rpl_geometry.test
+++ b/mysql-test/suite/rpl/t/rpl_geometry.test
@@ -23,4 +23,4 @@ sync_slave_with_master;
connection master;
drop table t1, t2;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_get_lock.test b/mysql-test/suite/rpl/t/rpl_get_lock.test
index b4ca57ce541..b5c08858055 100644
--- a/mysql-test/suite/rpl/t/rpl_get_lock.test
+++ b/mysql-test/suite/rpl/t/rpl_get_lock.test
@@ -22,9 +22,7 @@ while ($1)
dec $1;
}
enable_query_log;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
select get_lock("lock",3);
select * from t1;
# There is no point in testing REPLICATIION of the IS_*_LOCK
@@ -41,8 +39,9 @@ select is_free_lock("lock2");
select is_free_lock(NULL);
connection master1;
drop table t1;
-save_master_pos;
-connection slave;
-sync_with_master;
+sync_slave_with_master;
+
+
+--source include/rpl_end.inc
# End of 4.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
index 60765581faf..01247fefd64 100644
--- a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
+++ b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
@@ -7,12 +7,6 @@
# So they can't be verified by test case here.
# Finish the following tests by calling its common test script:
# extra/rpl_tests/rpl_get_master_version_and_clock.test.
-# And meanwhile 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;
source include/have_debug.inc;
@@ -48,20 +42,6 @@ source extra/rpl_tests/rpl_get_master_version_and_clock.test;
eval set global debug= '$debug_saved';
-#Test case 3: This test checks that the slave I/O thread refuses to start
-#if slave and master have the same server id.
-connection slave;
-reset master;
-# replicate ourselves
-source include/stop_slave.inc;
---replace_result $SLAVE_MYPORT SLAVE_PORT
-eval change master to master_port=$SLAVE_MYPORT;
-start slave;
-
---echo *** must be having the replicate-same-server-id IO thread error ***
-let $slave_io_errno= 1593;
-let $show_slave_io_error= 1;
-source include/wait_for_slave_io_error.inc;
# cleanup
@@ -69,3 +49,4 @@ source include/wait_for_slave_io_error.inc;
SET DEBUG_SYNC= 'RESET';
# End of tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_grant.test b/mysql-test/suite/rpl/t/rpl_grant.test
index 6fbdafc0f9c..1091e5aab0d 100644
--- a/mysql-test/suite/rpl/t/rpl_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_grant.test
@@ -36,3 +36,5 @@ sync_slave_with_master;
--echo **** On Slave ****
SELECT user,host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat-master.opt b/mysql-test/suite/rpl/t/rpl_heartbeat-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat.test b/mysql-test/suite/rpl/t/rpl_heartbeat.test
index 59c3e10915e..92bf10eb741 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat.test
@@ -142,7 +142,7 @@ source include/check_slave_param.inc;
let $slave_wait_param_counter= 300;
let $slave_value= query_get_value("SHOW STATUS like 'Slave_received_heartbeats'", Value, 1);
# Checking the fact that at least one heartbeat is received
-while (`select $slave_value = 0`)
+while (!$slave_value)
{
dec $slave_wait_param_counter;
if (!$slave_wait_param_counter)
@@ -165,5 +165,6 @@ drop table t1;
sync_slave_with_master;
set @@global.slave_net_timeout= @restore_slave_net_timeout;
+--source include/stop_slave.inc
--echo End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf
index a3ed77c8bd2..f24de9ab8b8 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.cnf
@@ -1,17 +1,12 @@
!include ../my.cnf
[mysqld.1]
-server_id=1
+log-slave-updates
[mysqld.2]
-server_id=2
+log-slave-updates
[mysqld.3]
-server_id=3
[ENV]
-SLAVE_MYPORT1= @mysqld.3.port
-SLAVE_MYSOCK1= @mysqld.3.socket
-
-
-
+SERVER_MYPORT_3= @mysqld.3.port
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
index 81737feea9e..6bdd2bbee63 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
@@ -4,98 +4,91 @@
# Purpose: Testing heartbeat for schema
# 1 master and 2 slaves
#############################################################
---source include/master-slave.inc
---echo
+--let $rpl_topology= 1->2,1->3
+--source include/rpl_init.inc
---echo *** Preparing ***
---connection master
-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
---connection slave
---echo [on slave]
+--let $rpl_connection_name= master
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= slave_1
+--let $rpl_server_number= 2
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= slave_2
+--let $rpl_server_number= 3
+--source include/rpl_connect.inc
+
+#
+# Set different heartbeat periods for slaves
+#
+--connection slave_1
--source include/stop_slave.inc
-RESET SLAVE;
---replace_result $MASTER_MYPORT MASTER_PORT $binlog_file MASTER_BINLOG
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1, MASTER_LOG_FILE='$binlog_file';
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 0.1;
--source include/start_slave.inc
---disconnect slave1
---connect(slave1,127.0.0.1,root,,test,$SLAVE_MYPORT1,)
---connection slave1
---echo [on slave1]
---disable_warnings
-STOP SLAVE;
---enable_warnings
-RESET SLAVE;
---replace_result $MASTER_MYPORT MASTER_PORT $binlog_file MASTER_BINLOG
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$binlog_file';
+--connection slave_2
+--source include/stop_slave.inc
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 1;
--source include/start_slave.inc
---echo
#
-# Testing heartbeat
+# Testing heartbeat for one master and two slaves
#
# Check that heartbeat events sent to both slaves with correct periods
---echo *** 2 slaves ***
---connection slave
+--connection slave_1
let $status_var= slave_received_heartbeats;
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $status_var_comparsion= >;
--source include/wait_for_status_var.inc
--echo Slave has received heartbeat event
---connection slave1
+--connection slave_2
let $status_var= slave_received_heartbeats;
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $status_var_comparsion= >;
--source include/wait_for_status_var.inc
-let $slave1_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
---echo Slave1 has received heartbeat event
---connection slave
-let $slave_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
-let $result= query_get_value(SELECT ($slave_rcvd_heartbeats DIV $slave1_rcvd_heartbeats) > 1 AS Result, Result, 1);
---echo Slave has received more heartbeats than Slave1 (1 means 'yes'): $result
+--let $assert_cond= [slave_1:SHOW STATUS LIKE "slave_received_heartbeats", Value, 1] > [slave_2:SHOW STATUS LIKE "slave_received_heartbeats", Value, 1]
+--let $assert_text= slave_1 should have received more heartbeats than slave_2
+--source include/assert.inc
--echo
+# Create topology master->slave_2->slave_1 and check that slave_1
+# receives heartbeat while slave_2 gets data.
+
+# slave_2 was started w/o --log-slave-updates because slave_2 should
+# not send data from master to slave_1
-# Create topology A->B->C and check that C receives heartbeat while B gets data
-# Slave1 (B) started w/o --log-slave-updates because B should not send data from A to C
---echo *** Master->data->Slave1->heartbeat->Slave: ***
---connection slave1
---echo [on slave1]
-RESET MASTER;
-let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
---connection slave
---echo [on slave]
+--source include/rpl_stop_slaves.inc
+--let $rpl_topology= 1->3->2
+--source include/rpl_change_topology.inc
+--source include/rpl_start_slaves.inc
+--connection slave_1
--source include/stop_slave.inc
-RESET SLAVE;
---replace_result $SLAVE_MYPORT1 SLAVE1_PORT $binlog_file SLAVE1_BINLOG
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT1, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.2, MASTER_LOG_FILE='$binlog_file';
+CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
-# Check heartbeat for new replication channel slave1->slave
+
+# Check heartbeat for new replication channel slave_2->slave
let $status_var= slave_received_heartbeats;
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $status_var_comparsion= >;
--source include/wait_for_status_var.inc
---echo Slave has received heartbeat event
+--echo slave_1 has received heartbeat event
--connection master
--echo [on master]
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
INSERT INTO t1 VALUES (1, 'on master', '');
---save_master_pos
SHOW TABLES;
---connection slave1
---sync_with_master 0
---echo [on slave1]
+--echo [on slave_2]
+--sync_slave_with_master slave_2
SHOW TABLES;
-let $slave_pos_before= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
---save_master_pos
---connection slave
---sync_with_master 0
---echo [on slave]
+let $slave_2_pos_before= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+--echo [on slave_1]
+--sync_slave_with_master slave_1
SHOW TABLES;
--connection master
--echo [on master]
---echo creating updates on master and send to slave1 during 5 second
-# Generate events on master and send to slave1 during 5 second
+--echo creating updates on master and send to slave_2 during 5 second
+# Generate events on master and send to slave_2 during 5 second
let $i= 1;
let $j= 1;
let $k= 1;
@@ -103,17 +96,15 @@ let $k= 1;
while ($i) {
eval SET @c_text=REPEAT('1234567890', $j);
eval UPDATE t1 SET a=$j, c=@c_text;
- --connection slave1
- let $slave_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
- if (`SELECT ($k*($slave_pos - $slave_pos_before)) > 0`) {
- --connection slave
- let $slave_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
+ --connection slave_2
+ let $slave_2_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+ if (`SELECT ($k*($slave_2_pos - $slave_2_pos_before)) > 0`) {
+ --connection slave_1
+ let $slave_1_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $k= 0;
let $time_before = `SELECT NOW()`;
}
if (`SELECT ((1-$k)*TIMESTAMPDIFF(SECOND,'$time_before',NOW())) > 5`) {
- --connection slave
- let $slave_rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $i= 0;
}
--connection master
@@ -121,10 +112,11 @@ while ($i) {
sleep 0.1;
}
--enable_query_log
---connection slave
---echo [on slave]
-let $result= query_get_value(SELECT ($slave_rcvd_heartbeats_after - $slave_rcvd_heartbeats_before) > 0 AS Result, Result, 1);
---echo Slave has received heartbeats (1 means 'yes'): $result
+--connection slave_1
+--echo [on slave_1]
+--let $assert_cond= [SHOW STATUS LIKE "slave_received_heartbeats", Value, 1] > $slave_1_rcvd_heartbeats_before
+--let $assert_text= slave_1 should have received heartbeats
+--source include/assert.inc
--echo
#
@@ -133,10 +125,5 @@ let $result= query_get_value(SELECT ($slave_rcvd_heartbeats_after - $slave_rcvd_
--echo *** Clean up ***
--connection master
DROP TABLE t1;
---save_master_pos
---connection slave1
---sync_with_master 0
---echo
-# End of 6.0 test
---echo End of 6.0 test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
index 1f8ce4c1d78..b9a170c5bc1 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test
@@ -18,6 +18,9 @@
--source include/have_binlog_format_mixed.inc
--echo
+# Set number of retries to connect to master
+let $connect_retry= 20;
+
--echo *** Preparing ***
--connection slave
--source include/stop_slave.inc
@@ -57,7 +60,7 @@ RESET SLAVE;
SET @@global.slave_net_timeout=30;
--enable_warnings
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=5;
RESET SLAVE;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
--echo
@@ -68,7 +71,7 @@ SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SET @@global.slave_net_timeout=50;
--enable_warnings
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
RESET SLAVE;
@@ -88,7 +91,7 @@ RESET SLAVE;
let $slave_net_timeout= query_get_value(SHOW VARIABLES LIKE 'slave_net_timeout', Value, 1);
inc $slave_net_timeout;
--replace_result $MASTER_MYPORT MASTER_PORT $slave_net_timeout SLAVE_NET_TIMEOUT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=$slave_net_timeout;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=$slave_net_timeout;
RESET SLAVE;
--echo
@@ -98,7 +101,7 @@ RESET SLAVE;
SET @@global.slave_net_timeout=20;
--enable_warnings
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=5;
SHOW VARIABLES LIKE 'slave_net_timeout';
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SET @@global.slave_net_timeout=2*@@global.slave_net_timeout;
@@ -118,9 +121,10 @@ SET @@global.slave_net_timeout=500;
SET @@global.slave_net_timeout=200;
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry;
--source include/start_slave.inc
---sync_with_master
+--connection master
+--sync_slave_with_master
SHOW VARIABLES LIKE 'slave_net_timeout';
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
@@ -137,9 +141,10 @@ SET @@global.slave_net_timeout=@restore_slave_net_timeout;
SET @@global.slave_net_timeout=100;
--enable_warnings
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=20;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=20;
--source include/start_slave.inc
---sync_with_master
+--connection master
+--sync_slave_with_master
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
--source include/stop_slave.inc
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
@@ -152,18 +157,9 @@ SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SET @@global.slave_net_timeout=50;
--enable_warnings
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=30;
---write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
-wait
-EOF
---echo Reload slave
---shutdown_server 10
---source include/wait_until_disconnected.inc
---append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
-restart
-EOF
---enable_reconnect
---source include/wait_until_connected_again.inc
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=30;
+--let $rpl_server_number= 2
+--source include/rpl_restart_server.inc
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SET @restore_slave_net_timeout=@@global.slave_net_timeout;
--echo
@@ -171,11 +167,12 @@ SET @restore_slave_net_timeout=@@global.slave_net_timeout;
# Disable heartbeat
--echo *** Disable heartbeat ***
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SHOW STATUS LIKE 'slave_received_heartbeats';
--source include/start_slave.inc
---sync_with_master
+--connection master
+--sync_slave_with_master
--sleep 2
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
SHOW STATUS LIKE 'slave_received_heartbeats';
@@ -194,48 +191,48 @@ let $slave_heartbeat_timeout= query_get_value(SHOW GLOBAL STATUS LIKE 'slave_hea
--echo *** Min slave_heartbeat_timeout ***
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.001;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.001;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.0009;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.0009;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
RESET SLAVE;
--echo
--echo *** Max slave_heartbeat_timeout ***
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=4294967;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
--error ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294968;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=4294968;
RESET SLAVE;
# Check double size of max allowed value for master_heartbeat_period
--replace_result $MASTER_MYPORT MASTER_PORT
--error ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=8589935;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=8589935;
RESET SLAVE;
# Check 2^32
--replace_result $MASTER_MYPORT MASTER_PORT
--error ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=4294967296;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=4294967296;
RESET SLAVE;
--echo
--echo *** Misc incorrect values ***
--replace_result $MASTER_MYPORT MASTER_PORT
--error ER_PARSE_ERROR
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='-1';
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD='-1';
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
--error ER_PARSE_ERROR
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='123abc';
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD='123abc';
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
--error ER_PARSE_ERROR
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD='';
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD='';
RESET SLAVE;
--echo
@@ -246,9 +243,10 @@ RESET SLAVE;
# Check received heartbeat events for running slave
--echo *** Running slave ***
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
---sync_with_master
+--connection master
+--sync_slave_with_master
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $status_var= slave_received_heartbeats;
let $status_var_comparsion= >;
@@ -276,8 +274,7 @@ let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbea
# Check received heartbeat events for stopped IO thread
--echo *** Stopped IO thread ***
-STOP SLAVE IO_THREAD;
---source include/wait_for_slave_io_to_stop.inc
+--source include/stop_slave_io.inc
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
sleep 2;
let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -296,8 +293,7 @@ let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbea
# Check received heartbeat events for stopped SQL thread
--echo *** Stopped SQL thread ***
-STOP SLAVE SQL_THREAD;
---source include/wait_for_slave_sql_to_stop.inc
+--source include/stop_slave_sql.inc
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
sleep 2;
let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -323,6 +319,8 @@ INSERT INTO t1 VALUES (1, 'on slave', NULL);
--connection master
INSERT INTO t1 VALUES (1, 'on master', NULL);
--connection slave
+call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* Error_code: 1062");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
let $slave_errno= ER_DUP_ENTRY
--source include/wait_for_slave_sql_error.inc
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -349,14 +347,13 @@ DELIMITER ;|
--connection slave
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=5;
--source include/start_slave.inc
--connection master
# Enable scheduler
SET @@global.event_scheduler=1;
---connection slave
+--sync_slave_with_master
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
---sync_with_master
# Wait some updates for table t1 from master
let $wait_condition= SELECT COUNT(*)=1 FROM t1 WHERE a > 5;
--source include/wait_condition.inc
@@ -382,7 +379,7 @@ DROP TABLE t1;
RESET MASTER;
--connection slave
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.5;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.5;
let $slave_param_comparison= =;
--source include/start_slave.inc
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -409,7 +406,7 @@ SET @@global.slave_compressed_protocol=1;
RESET SLAVE;
SET @@global.slave_compressed_protocol=1;
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $status_var= slave_received_heartbeats;
@@ -428,7 +425,7 @@ SET @@global.slave_compressed_protocol=0;
STOP SLAVE;
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
--connection master
@@ -447,7 +444,7 @@ let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_b
STOP SLAVE;
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=0.1;
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
# Wait until slave_received_heartbeats will be incremented
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -455,21 +452,11 @@ let $status_var= slave_received_heartbeats;
let $status_var_comparsion= >;
--source include/wait_for_status_var.inc
--echo Heartbeat event received
---connection master
---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait
-EOF
---echo Reload master
---shutdown_server 10
---source include/wait_until_disconnected.inc
---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart
-EOF
---enable_reconnect
---source include/wait_until_connected_again.inc
---connection slave
+--let $rpl_server_number= 1
+--source include/rpl_restart_server.inc
# make sure IO thread has re-connected
# due to slow valgrind env the following wait_for_status may time out
+--let $rpl_allow_error= 1
--source include/wait_for_slave_io_to_start.inc
# Wait until slave_received_heartbeats will be incremented
let $status_var_value= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
@@ -482,13 +469,17 @@ let $status_var_comparsion= >;
# Circular replication: demonstrating bidirectional hearbeat flow
--echo *** Circular replication ***
# Configure circular replication
---source include/master-slave-reset.inc
---connection slave
+--source include/rpl_reset.inc
--source include/stop_slave.inc
-let $slave_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
+--let $rpl_topology= 1->2->1
+--source include/rpl_change_topology.inc
+
+#--connection slave
+#--source include/stop_slave.inc
+#let $slave_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
--connection master
---replace_result $SLAVE_MYPORT SLAVE_PORT $slave_binlog SLAVE_BINLOG
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog';
+#--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_binlog SLAVE_BINLOG
+#eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog';
--source include/start_slave.inc
# Insert data on master and on slave and make sure that it replicated for both directions
@@ -501,9 +492,7 @@ CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
--source include/start_slave.inc
--sync_with_master
INSERT INTO t1 VALUES(2, 'on slave');
---save_master_pos
---connection master
---sync_with_master
+--sync_slave_with_master master
SELECT * FROM t1 ORDER BY a;
let $master_rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
--connection slave
@@ -531,12 +520,10 @@ let $slave_rcvd_heartbeats= query_get_value(SHOW STATUS LIKE 'slave_received_hea
#
--echo *** Clean up ***
--connection master
---source include/stop_slave.inc
+#--source include/stop_slave.inc
DROP TABLE t1;
--sync_slave_with_master
---source include/stop_slave.inc
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
---echo
-# End of tests
---echo End of tests
+#--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test b/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test
index 6460b157b52..810db4cc6f7 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test
@@ -46,9 +46,11 @@ let $status_var_comparsion= >;
# Clean up
#
--echo *** Clean up ***
---connection master
---sync_slave_with_master
---echo
-
-# End of 6.0 test
---echo End of 6.0 test
+--source include/stop_slave.inc
+CHANGE MASTER TO
+ MASTER_SSL=0,
+ MASTER_SSL_CA='',
+ MASTER_SSL_CERT='',
+ MASTER_SSL_KEY='';
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test
index a1931ce9b60..c229711e005 100644
--- a/mysql-test/suite/rpl/t/rpl_idempotency.test
+++ b/mysql-test/suite/rpl/t/rpl_idempotency.test
@@ -4,9 +4,10 @@
source include/master-slave.inc;
# Add suppression for expected warning(s) in slaves error log
-call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032");
-call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
-call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+call mtr.add_suppression("Slave SQL.*Can.t find record in .t[12].* Error_code: 1032");
+call mtr.add_suppression("Slave SQL.*Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
+call mtr.add_suppression("Slave SQL.*Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
connection master;
CREATE TABLE t1 (a INT PRIMARY KEY);
@@ -34,10 +35,7 @@ SELECT * FROM t2 ORDER BY a;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
-let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
-disable_query_log;
-eval SELECT "$last_error" AS Last_SQL_Error;
-enable_query_log;
+--source include/check_slave_no_error.inc
# An insert of a row that already exists. Since we are replacing the
# row if it already exists, the most apropriate representation is
@@ -50,10 +48,7 @@ INSERT IGNORE INTO t1 VALUES (-2);
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
-let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
-disable_query_log;
-eval SELECT "$last_error" AS Last_SQL_Error;
-enable_query_log;
+--source include/check_slave_no_error.inc
# BUG#19958: RBR idempotency issue for UPDATE and DELETE
@@ -78,13 +73,12 @@ SELECT * FROM t2 ORDER BY a;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
-let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
-disable_query_log;
-eval SELECT "$last_error" AS Last_SQL_Error;
-enable_query_log;
+--source include/check_slave_no_error.inc
connection master;
DROP TABLE t1, t2;
sync_slave_with_master;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ignore_grant.test b/mysql-test/suite/rpl/t/rpl_ignore_grant.test
index 2e6e2ce9a31..34074ba8ca9 100644
--- a/mysql-test/suite/rpl/t/rpl_ignore_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_grant.test
@@ -57,3 +57,4 @@ delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ignore_revoke.test b/mysql-test/suite/rpl/t/rpl_ignore_revoke.test
index 00171605a92..db20e807afc 100644
--- a/mysql-test/suite/rpl/t/rpl_ignore_revoke.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_revoke.test
@@ -49,3 +49,4 @@ sync_slave_with_master;
# Since changes to mysql.* are ignored, the revoke need to
# be done on slave as well
delete from mysql.user where user="user_foo";
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test
index 15c4b193669..233206c4135 100644
--- a/mysql-test/suite/rpl/t/rpl_ignore_table.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test
@@ -127,6 +127,7 @@ show grants for mysqltest4@localhost;
# where mysqltest1 does not exist on slave,
# to succeed on slave the mode is temporarily changed
set global slave_exec_mode='IDEMPOTENT';
+call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* Error_code: 1032");
connection master;
drop table t1, mysqltest2.t2;
@@ -176,3 +177,6 @@ SELECT * FROM tmptbl504451f4258$1;
connection master;
DROP TABLE t5;
sync_slave_with_master;
+
+--source include/rpl_end.inc
+--source include/force_restart.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table_update.test b/mysql-test/suite/rpl/t/rpl_ignore_table_update.test
index fe030f90411..840052e2f25 100644
--- a/mysql-test/suite/rpl/t/rpl_ignore_table_update.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table_update.test
@@ -36,3 +36,4 @@ sync_with_master;
drop table mysqltest_foo,mysqltest_bar,t1;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test
index 08096d03c11..d6034009f4f 100644
--- a/mysql-test/suite/rpl/t/rpl_incident.test
+++ b/mysql-test/suite/rpl/t/rpl_incident.test
@@ -15,6 +15,7 @@ SELECT * FROM t1;
connection slave;
# Wait until SQL thread stops with error LOST_EVENT on master
+call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occured on the master.* 1590");
let $slave_sql_errno= 1590;
let $show_slave_sql_error= 1;
source include/wait_for_slave_sql_error.inc;
@@ -37,3 +38,4 @@ source include/check_slave_is_running.inc;
connection master;
DROP TABLE t1;
--sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_init_slave.test b/mysql-test/suite/rpl/t/rpl_init_slave.test
index 58d1f6bdc01..1803b146819 100644
--- a/mysql-test/suite/rpl/t/rpl_init_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_init_slave.test
@@ -25,10 +25,10 @@ set global init_connect="set @c=1";
show variables like 'init_connect';
connection master;
sync_slave_with_master;
-source include/stop_slave.inc;
# Restore changed global variable
set global init_connect= @my_global_init_connect;
set global max_connections= default;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
index 180821730ec..4dab13856d4 100644
--- a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test
@@ -53,11 +53,12 @@ start slave;
# slave is going to stop because of emulated failures
# but there won't be any crashes nor asserts hit.
#
-source include/wait_for_slave_to_stop.inc;
+# 1593 = ER_SLAVE_FATAL_ERROR
+--let $slave_sql_errno= 1593
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
-let $error= query_get_value(SHOW SLAVE STATUS, Last_Error, 1);
-echo Reporting the following error: $error;
-call mtr.add_suppression("Failed during slave I/O thread initialization");
+call mtr.add_suppression("Failed during slave.* thread initialization");
SET GLOBAL debug= "";
@@ -66,22 +67,23 @@ SET GLOBAL debug= "";
######################################################################
connection slave;
---disable_warnings
-stop slave;
---enable_warnings
-source include/wait_for_slave_to_stop.inc;
-
reset slave;
SET GLOBAL init_slave= "garbage";
start slave;
-source include/wait_for_slave_sql_to_stop.inc;
-
-let $error= query_get_value(SHOW SLAVE STATUS, Last_Error, 1);
-echo Reporting the following error: $error;
+# 1064 = ER_PARSE_ERROR
+--let $slave_sql_errno= 1064
+--let $show_slave_sql_error= 1
+--source include/wait_for_slave_sql_error.inc
######################################################################
# Clean up
######################################################################
SET GLOBAL init_slave= "";
+
+# Clean up Last_SQL_Error
+--source include/stop_slave_io.inc
+RESET SLAVE;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test
index a9cd6b15b6e..782c01ec04f 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug28430.test
@@ -151,4 +151,4 @@ DROP TABLE test.regular_tbl;
DROP TABLE test.bykey_tbl;
DROP TABLE test.byrange_tbl;
---source include/master-slave-end.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test
index 4311328b064..9bfce61804b 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb_bug30888.test
@@ -62,5 +62,5 @@ connection master;
DROP PROCEDURE test.proc_norm;
DROP TABLE test.regular_tbl;
---source include/master-slave-end.inc
+--source include/rpl_end.inc
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 6eb9c7075e4..5147e67c160 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb_mixed_ddl.test
@@ -1,6 +1,4 @@
#########################################
-# Author: Serge Kozlov skozlov@mysql.com
-# Date: 07/10/2006
# Purpose: testing the replication in mixed mode
# Requirements: define binlog format for mysqld as in example below:
# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
@@ -8,7 +6,4 @@
--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 d48e847a6c8..d04ced0f476 100644
--- a/mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test
+++ b/mysql-test/suite/rpl/t/rpl_innodb_mixed_dml.test
@@ -1,6 +1,4 @@
#########################################
-# Author: Serge Kozlov skozlov@mysql.com
-# Date: 07/10/2006
# Purpose: testing the replication in mixed mode
# Requirements: define binlog format for mysqld as in example below:
# ./mysql-test-run.pl --mysqld=--binlog-format=mixed
@@ -8,7 +6,4 @@
--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/suite/rpl/t/rpl_insert.test b/mysql-test/suite/rpl/t/rpl_insert.test
index 6f916fb1f90..2a29139ac48 100644
--- a/mysql-test/suite/rpl/t/rpl_insert.test
+++ b/mysql-test/suite/rpl/t/rpl_insert.test
@@ -42,3 +42,4 @@ connection master;
USE test;
DROP SCHEMA mysqlslap;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_insert_duplicate.test b/mysql-test/suite/rpl/t/rpl_insert_duplicate.test
new file mode 100644
index 00000000000..7dd38a696ae
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_insert_duplicate.test
@@ -0,0 +1,14 @@
+#########################################
+# Wrapper for rpl_insert_duplicate.test #
+#########################################
+-- source include/master-slave.inc
+-- source include/have_innodb.inc
+#-- source include/have_binlog_format_mixed_or_statement.inc
+
+let $engine_type=innodb;
+-- source extra/rpl_tests/rpl_insert_duplicate.test
+
+let $engine_type=myisam;
+-- source extra/rpl_tests/rpl_insert_duplicate.test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_insert_id.test b/mysql-test/suite/rpl/t/rpl_insert_id.test
index 6daecce5843..f2f62a207a0 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_id.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_id.test
@@ -1,12 +1,7 @@
#################################
# Wrapper for rpl_insert_id.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=myisam;
-- source extra/rpl_tests/rpl_insert_id.test
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
diff --git a/mysql-test/suite/rpl/t/rpl_insert_id_pk.test b/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
index 01f30b78ac5..c0d68855f85 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_id_pk.test
@@ -1,10 +1,6 @@
#################################
# Wrapper for rpl_insert_id.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;
diff --git a/mysql-test/suite/rpl/t/rpl_insert_ignore.test b/mysql-test/suite/rpl/t/rpl_insert_ignore.test
index 69be49634d0..0346975fcee 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_ignore.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_ignore.test
@@ -7,6 +7,10 @@
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-let $engine_type=innodb;
-let $engine_type2=myisam;
+-- let $engine_type=innodb
-- source extra/rpl_tests/rpl_insert_ignore.test
+
+-- let $engine_type=myisam
+-- source extra/rpl_tests/rpl_insert_ignore.test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_insert_select.test b/mysql-test/suite/rpl/t/rpl_insert_select.test
index 677be526982..23bc7ecd167 100644
--- a/mysql-test/suite/rpl/t/rpl_insert_select.test
+++ b/mysql-test/suite/rpl/t/rpl_insert_select.test
@@ -17,3 +17,4 @@ select * from t1;
connection master;
drop table t1,t2;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_invoked_features.test b/mysql-test/suite/rpl/t/rpl_invoked_features.test
index 74ea8e12a98..7770c36c397 100644
--- a/mysql-test/suite/rpl/t/rpl_invoked_features.test
+++ b/mysql-test/suite/rpl/t/rpl_invoked_features.test
@@ -308,3 +308,4 @@ DROP EVENT IF EXISTS e11;
--sync_slave_with_master slave
# End 5.1 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix-master.opt b/mysql-test/suite/rpl/t/rpl_ip_mix-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix.test b/mysql-test/suite/rpl/t/rpl_ip_mix.test
index 0852b3f4ff7..c86e1ba54b7 100644
--- a/mysql-test/suite/rpl/t/rpl_ip_mix.test
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix.test
@@ -35,7 +35,6 @@ connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
connection master;
reset master;
source include/show_master_status.inc;
-save_master_pos;
--echo connection slave;
connection slave;
reset slave;
@@ -50,10 +49,6 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
-disconnect slave;
---echo disconnect master;
-disconnect master;
---echo connection default;
-connection default;
+# clean up
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix2-master.opt b/mysql-test/suite/rpl/t/rpl_ip_mix2-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix2-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix2.test b/mysql-test/suite/rpl/t/rpl_ip_mix2.test
index 5d687006b76..3c928cffbc6 100644
--- a/mysql-test/suite/rpl/t/rpl_ip_mix2.test
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix2.test
@@ -50,10 +50,6 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
-disconnect slave;
---echo disconnect master;
-disconnect master;
---echo connection default;
-connection default;
+# clean up
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test
index ecd5a754fdc..cacf5e187ef 100644
--- a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test
+++ b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test
@@ -66,10 +66,6 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
-disconnect slave;
---echo disconnect master;
-disconnect master;
---echo connection default;
-connection default;
+# clean up
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/t/rpl_ipv6.test b/mysql-test/suite/rpl/t/rpl_ipv6.test
index 3eceedfd7a4..c42221445fb 100644
--- a/mysql-test/suite/rpl/t/rpl_ipv6.test
+++ b/mysql-test/suite/rpl/t/rpl_ipv6.test
@@ -52,10 +52,6 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='0:0:0:0:0:0:0:1';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
-disconnect slave;
---echo disconnect master;
-disconnect master;
---echo connection default;
-connection default;
+# clean up
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
diff --git a/mysql-test/suite/rpl/t/rpl_killed_ddl.test b/mysql-test/suite/rpl/t/rpl_killed_ddl.test
index 6957289b2d5..eff0392d5de 100644
--- a/mysql-test/suite/rpl/t/rpl_killed_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_killed_ddl.test
@@ -122,7 +122,7 @@ echo [on master];
# This will block the execution of a statement at the DBUG_SYNC_POINT
# with given lock name
-if (`SELECT '$debug_lock' != ''`)
+if ($debug_lock)
{
disable_query_log;
disable_result_log;
@@ -142,8 +142,8 @@ disable_warnings;
######## DATABASE ########
-let $diff_statement= SELECT schema_name FROM information_schema.schemata
- WHERE schema_name LIKE 'd%' ORDER BY schema_name;
+let $rpl_diff_statement= SELECT schema_name FROM information_schema.schemata
+ WHERE schema_name LIKE \'d%\' ORDER BY schema_name;
send CREATE DATABASE d2;
source include/kill_query_and_diff_master_slave.inc;
@@ -162,9 +162,9 @@ source include/kill_query_and_diff_master_slave.inc;
######## EVENT ########
-let $diff_statement= SELECT event_name, event_body, execute_at
- FROM information_schema.events where event_name like 'e%'
- ORDER BY event_name;
+let $rpl_diff_statement= SELECT event_name, event_body, execute_at
+ FROM information_schema.events where event_name like \'e%\'
+ ORDER BY event_name;
send CREATE EVENT e2
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
@@ -185,7 +185,7 @@ source include/kill_query_and_diff_master_slave.inc;
######## FUNCTION ########
-let $diff_statement= SHOW FUNCTION STATUS LIKE 'f%';
+--let $rpl_diff_statement= SHOW FUNCTION STATUS LIKE \'f%\'
send CREATE FUNCTION f2 () RETURNS INT DETERMINISTIC
RETURN 1;
@@ -214,7 +214,7 @@ source include/kill_query_and_diff_master_slave.inc;
######## PROCEDURE ########
-let $diff_statement= SHOW PROCEDURE STATUS LIKE 'p%';
+--let $rpl_diff_statement= SHOW PROCEDURE STATUS LIKE \'p%\'
DELIMITER //;
send CREATE PROCEDURE p2 (OUT rows INT)
@@ -237,7 +237,7 @@ source include/kill_query_and_diff_master_slave.inc;
######## TABLE ########
-let $diff_statement= SHOW TABLES LIKE 't%';
+--let $rpl_diff_statement= SHOW TABLES LIKE \'t%\'
send CREATE TABLE t2 (b int);
source include/kill_query_and_diff_master_slave.inc;
@@ -250,7 +250,7 @@ source include/kill_query_and_diff_master_slave.inc;
######## INDEX ########
-let $diff_statement= SHOW INDEX FROM t1;
+--let $rpl_diff_statement= SHOW INDEX FROM t1
send CREATE INDEX i2 on t1 (a);
source include/kill_query_and_diff_master_slave.inc;
@@ -263,7 +263,7 @@ source include/kill_query_and_diff_master_slave.inc;
# Tempoarily disabled, see bug#25705
-# let $diff_statement= SELECT * FROM mysql.server WHERE name like 's%';
+# --let $rpl_diff_statement= SELECT * FROM mysql.server WHERE name like \'s%\'
# send CREATE SERVER s2
# FOREIGN DATA WRAPPER mysql
@@ -287,7 +287,7 @@ connection master;
CREATE TABLE IF NOT EXISTS t4 (a int);
connection master1;
-let $diff_statement= SHOW TRIGGERS LIKE 'v%';
+--let $rpl_diff_statement= SHOW TRIGGERS LIKE \'v%\'
DELIMITER //;
send CREATE TRIGGER tr2 BEFORE INSERT ON t4
@@ -306,7 +306,7 @@ source include/kill_query_and_diff_master_slave.inc;
######## VIEW ########
-let $diff_statement= SHOW TABLES LIKE 'v%';
+--let $rpl_diff_statement= SHOW TABLES LIKE \'v%\'
send CREATE VIEW v2 AS SELECT a FROM t1 WHERE a > 100;
source include/kill_query_and_diff_master_slave.inc;
@@ -319,7 +319,7 @@ source include/kill_query_and_diff_master_slave.inc;
######## DROP TABLE ########
-let $diff_statement= SHOW TABLES LIKE 't%';
+--let $rpl_diff_statement= SHOW TABLES LIKE \'t%\'
send DROP TABLE t1;
source include/kill_query_and_diff_master_slave.inc;
@@ -360,3 +360,4 @@ DROP PROCEDURE IF EXISTS p2;
DROP PROCEDURE IF EXISTS p3;
DROP PROCEDURE IF EXISTS p4;
enable_warnings;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
index b48698baa47..f4b854eff87 100644
--- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
+++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
@@ -25,11 +25,12 @@ 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
#1105 = ER_UNKNOWN_ERROR
--let $slave_sql_errno= 1105
--let $show_slave_sql_error= 1
+call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432");
--source include/wait_for_slave_sql_error.inc
# show that it was not replicated
SELECT * FROM t1;
@@ -83,17 +84,25 @@ 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
#1105 = ER_UNKNOWN_ERROR
--let $slave_sql_errno= 1105
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
+
# show that it was not replicated
SELECT * FROM t1;
connection master;
+
+# clean up
drop table t1, t2;
connection slave;
drop table t1, t2;
+# clear error message in sql thread
+--source include/stop_slave_io.inc
+RESET SLAVE;
# End of 5.0 tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt b/mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt
deleted file mode 100644
index c015c02ba78..00000000000
--- a/mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-wild-do-table=mysqltest.%
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata.test b/mysql-test/suite/rpl/t/rpl_loaddata.test
index d5e0388be46..9f4ca1aaf18 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata.test
@@ -1,7 +1,3 @@
-########################################################
-# 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_statement.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_charset.test b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
index 3e1bc917a41..bb87ee95913 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test
@@ -46,3 +46,4 @@ source include/rpl_loaddata_charset.inc;
# LOAD DATA LOCAL INFILE
let $LOAD_LOCAL=0;
source include/rpl_loaddata_charset.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
index b8975308a86..be099c1b6c4 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test
@@ -15,6 +15,7 @@ connection master;
LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1;
connection slave;
+call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, Error_code: 1593");
let $slave_sql_errno= 1593;
let $show_slave_sql_error= 1;
source include/wait_for_slave_sql_error_and_skip.inc;
@@ -23,3 +24,4 @@ connection master;
DROP TABLE t1;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_m.test b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
index 48451c4aee1..1fe9283ef44 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_m.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_m.test
@@ -48,3 +48,4 @@ DROP TABLE test.t1;
sync_slave_with_master;
# End of test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt b/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt
index 831680eb5ef..5fdeb855110 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt
@@ -1 +1 @@
---read_buffer_size=12K --max_allowed_packet=8K
+--read_buffer_size=12K --max_allowed_packet=8K --net-buffer-length=8K
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt b/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt
index 95f55bcf7d8..7d404fae240 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt
@@ -1 +1 @@
---max_allowed_packet=8K
+--max_allowed_packet=8K --net-buffer-length=8K
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map.test b/mysql-test/suite/rpl/t/rpl_loaddata_map.test
index 1db7c4a893b..24c8221c20f 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_map.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_map.test
@@ -71,3 +71,4 @@ connection master;
drop table t2;
sync_slave_with_master;
remove_file $MYSQLTEST_VARDIR/tmp/bug30435_5k.txt;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_s.test b/mysql-test/suite/rpl/t/rpl_loaddata_s.test
index 91ebcf058a6..2116796871a 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_s.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_s.test
@@ -24,3 +24,4 @@ source include/show_binlog_events.inc;
connection master;
drop table test.t1;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_simple.test b/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
index 439c2b48ca5..a09d3feec42 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_simple.test
@@ -12,3 +12,4 @@ SELECT * FROM t1 ORDER BY word;
connection master;
drop table t1;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh b/mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh
index 066f72926af..e5bb3e61d11 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_symlink-master.sh
@@ -1 +1,2 @@
+rm -f $MYSQLTEST_VARDIR/std_data_master_link
ln -s $MYSQLTEST_VARDIR/std_data $MYSQLTEST_VARDIR/std_data_master_link
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh b/mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh
index 218209a2542..7a0c0bb382a 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_symlink-slave.sh
@@ -1 +1,2 @@
+rm -f $MYSQLTEST_VARDIR/std_data_slave_link
ln -s $MYSQLTEST_VARDIR/std_data $MYSQLTEST_VARDIR/std_data_slave_link
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test b/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test
index 69b481bddd1..c73fa2897f3 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_symlink.test
@@ -19,3 +19,4 @@ connection master;
drop table t1;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
index ed556f3aedf..4ebe572741f 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
@@ -151,12 +151,34 @@ eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
--echo [slave]
sync_slave_with_master;
-# cleanup
+--echo
+--echo Bug #59267:
+--echo "LOAD DATA LOCAL INFILE not executed on slave with SBR"
+--echo
---remove_file $MYSQLD_DATADIR/bug43746.sql
+--echo [master]
+connection master;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug59267.sql' FROM t1;
+TRUNCATE TABLE t1;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug59267.sql' INTO TABLE t1;
+
+SELECT 'Master', COUNT(*) FROM t1;
+
+--echo [slave]
+--sync_slave_with_master
+SELECT 'Slave', COUNT(*) FROM t1;
+
+# cleanup
--echo [master]
connection master;
+
+--remove_file $MYSQLD_DATADIR/bug43746.sql
+--remove_file $MYSQLD_DATADIR/bug59267.sql
+
DROP TABLE t1;
SET SESSION sql_mode=@old_mode;
@@ -164,3 +186,55 @@ SET SESSION sql_mode=@old_mode;
sync_slave_with_master;
connection master;
+
+--echo
+--echo Bug #60580/#11902767:
+--echo "statement improperly replicated crashes slave sql thread"
+--echo
+
+--echo [master]
+connection master;
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+CREATE TABLE t1(f1 INT, f2 INT);
+CREATE TABLE t2(f1 INT, f2 TIMESTAMP);
+
+INSERT INTO t2 VALUES(1, '2011-03-22 21:01:28');
+INSERT INTO t2 VALUES(2, '2011-03-21 21:01:28');
+INSERT INTO t2 VALUES(3, '2011-03-20 21:01:28');
+
+CREATE TABLE t3 AS SELECT * FROM t2;
+
+CREATE VIEW v1 AS SELECT * FROM t2
+ WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL));
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval SELECT 1 INTO OUTFILE '$MYSQLD_DATADIR/bug60580.csv' FROM DUAL;
+
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1);
+
+SELECT * FROM t1;
+
+sleep 1;
+
+--echo [slave]
+sync_slave_with_master;
+
+SELECT * FROM t1;
+
+--remove_file $MYSQLD_DATADIR/bug60580.csv
+
+--echo [master]
+connection master;
+
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+
+--echo [slave]
+sync_slave_with_master;
+
+connection master;
+--source include/rpl_end.inc
+
+--echo # End of 5.1 tests
diff --git a/mysql-test/suite/rpl/t/rpl_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test
index adb23d2c2bc..ced0054c52c 100644
--- a/mysql-test/suite/rpl/t/rpl_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_loadfile.test
@@ -58,8 +58,7 @@
# vii) assert that the contents of master and slave
# table are the same
-connection master;
-source include/reset_master_and_slave.inc;
+--source include/rpl_reset.inc
connection master;
let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data;
@@ -105,11 +104,12 @@ sync_slave_with_master;
# if the file was removed before the slave started,
# meaning that contents were indeed transfered
# through binlog (in row format)
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
# CLEAN UP
+--connection master
DROP TABLE t1;
DROP PROCEDURE p;
-sync_slave_with_master;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_locale.test b/mysql-test/suite/rpl/t/rpl_locale.test
index 2f2d637e1b4..0d6692dd89c 100644
--- a/mysql-test/suite/rpl/t/rpl_locale.test
+++ b/mysql-test/suite/rpl/t/rpl_locale.test
@@ -22,3 +22,4 @@ sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test
index daf4b9093fe..44837e45715 100644
--- a/mysql-test/suite/rpl/t/rpl_log_pos.test
+++ b/mysql-test/suite/rpl/t/rpl_log_pos.test
@@ -32,9 +32,7 @@ start slave;
let $slave_io_errno= 1236;
let $show_slave_io_error= 1;
source include/wait_for_slave_io_error.inc;
---disable_warnings
-source include/stop_slave.inc;
---enable_warnings
+source include/stop_slave_sql.inc;
connection master;
source include/show_master_status.inc;
@@ -54,3 +52,4 @@ drop table t1;
sync_slave_with_master;
--echo End of 5.0 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
index ecdf10ac2c2..b0d3b23b4e1 100644
--- a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
+++ b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
@@ -58,10 +58,10 @@ FLUSH LOGS;
# error to slave.
call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log');
connection slave;
-source include/wait_for_slave_io_to_stop.inc;
-let $last_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
-echo Last_IO_Error;
-echo $last_error;
+# 1236 = ER_MASTER_FATAL_ERROR_READING_BINLOG
+--let $slave_io_errno= 1236
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
connection master;
@@ -103,4 +103,4 @@ SHOW TABLES;
connection master;
DROP TABLE t1, t2, t3, t4;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_many_optimize.test b/mysql-test/suite/rpl/t/rpl_many_optimize.test
index 91fab0b27a8..d5e9f69b4bc 100644
--- a/mysql-test/suite/rpl/t/rpl_many_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_many_optimize.test
@@ -20,3 +20,4 @@ drop table t1;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
index ea107a28954..25e27f62d0a 100644
--- a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
+++ b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
@@ -25,3 +25,5 @@ echo "*** must be NULL ***";
select master_pos_wait('foo', 98);
# End of 4.1 tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_misc_functions.test b/mysql-test/suite/rpl/t/rpl_misc_functions.test
index d7ecde5f53c..7189e5c44ba 100644
--- a/mysql-test/suite/rpl/t/rpl_misc_functions.test
+++ b/mysql-test/suite/rpl/t/rpl_misc_functions.test
@@ -124,3 +124,4 @@ DROP FUNCTION test_replication_sf;
--sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mix_found_rows.test b/mysql-test/suite/rpl/t/rpl_mix_found_rows.test
index 9b8346ef21b..ed932eb5cea 100644
--- a/mysql-test/suite/rpl/t/rpl_mix_found_rows.test
+++ b/mysql-test/suite/rpl/t/rpl_mix_found_rows.test
@@ -156,3 +156,4 @@ DROP PROCEDURE log_me_inner;
DROP FUNCTION log_rows;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test
index 2c44829a649..a310fa254f7 100644
--- a/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test
+++ b/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test
@@ -3,3 +3,4 @@
--source include/not_embedded.inc
--source include/not_windows.inc
--source extra/rpl_tests/rpl_insert_delayed.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size-master.opt b/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size-master.opt
deleted file mode 100644
index 45631525481..00000000000
--- a/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog_cache_size=4096 --max_binlog_cache_size=7680
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test
index 1d407f87dfa..3850a84cbf1 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test
@@ -5,3 +5,4 @@
--source include/have_binlog_format_mixed.inc
--source extra/rpl_tests/rpl_binlog_max_cache_size.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test b/mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test
index c9b65d170ad..226a82dee97 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_bit_pk.test
@@ -80,3 +80,4 @@ sync_slave_with_master;
connection master;
DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test
index 333697e27e9..c5b821ca906 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test
@@ -47,3 +47,4 @@ drop table t2,t3,t5;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test
index 8c635202ad5..f37ce90e524 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test
@@ -8,3 +8,4 @@
--source include/have_innodb.inc
--source extra/rpl_tests/rpl_drop_create_temp_table.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test
index 1a32c388921..161ab2f9dca 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test
@@ -8,3 +8,4 @@
--let $engine=Innodb
set session storage_engine=innodb;
--source extra/rpl_tests/rpl_implicit_commit_binlog.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test
index 8bb5b61210b..0893f7d0158 100644
--- a/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test
@@ -8,3 +8,4 @@
let $engine_type=Innodb;
--source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_delete.test b/mysql-test/suite/rpl/t/rpl_multi_delete.test
index 568a8a578a9..80acf9c80e4 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_delete.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_delete.test
@@ -22,3 +22,4 @@ drop table t1,t2;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_delete2.test b/mysql-test/suite/rpl/t/rpl_multi_delete2.test
index c3f939276e0..7dc7ca41405 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_delete2.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_delete2.test
@@ -64,3 +64,4 @@ drop database mysqltest_to;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_engine.test b/mysql-test/suite/rpl/t/rpl_multi_engine.test
index 31c4a2050d7..b1dbf99f114 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_engine.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_engine.test
@@ -102,3 +102,4 @@ DROP TABLE t1;
sync_slave_with_master;
# End of 5.1 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update.test b/mysql-test/suite/rpl/t/rpl_multi_update.test
index a6111455d16..710337816da 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update.test
@@ -1,7 +1,3 @@
-########################################################
-# 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_multi_update.test
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update2.test b/mysql-test/suite/rpl/t/rpl_multi_update2.test
index 812a486ad69..497568f2738 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update2.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update2.test
@@ -8,3 +8,4 @@
--source include/master-slave.inc
let $engine_type=MyISAM;
--source extra/rpl_tests/rpl_multi_update2.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update3.test b/mysql-test/suite/rpl/t/rpl_multi_update3.test
index 5da91c26b04..f6e70f14b30 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update3.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update3.test
@@ -8,3 +8,4 @@
--source include/master-slave.inc
let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_multi_update3.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_multi_update4.test b/mysql-test/suite/rpl/t/rpl_multi_update4.test
index 4991a385f6f..8f069b9c18f 100644
--- a/mysql-test/suite/rpl/t/rpl_multi_update4.test
+++ b/mysql-test/suite/rpl/t/rpl_multi_update4.test
@@ -43,3 +43,4 @@ drop database d2;
sync_slave_with_master;
# End of test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
index 8797da4eccc..fedad86ea91 100644
--- a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
+++ b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
@@ -30,7 +30,7 @@ sync_slave_with_master;
connection master;
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
-if (`SELECT '$before_position'='$after_position'`)
+if ($before_position == $after_position)
{
echo Master position is not changed;
}
@@ -48,7 +48,7 @@ connection master;
let $after_file= query_get_value(SHOW MASTER STATUS, File, 1);
let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
-if (!`SELECT '$before_position'='$after_position'`)
+if ($before_position != $after_position)
{
echo Master position has been changed;
}
@@ -56,3 +56,5 @@ if (!`SELECT '$before_position'='$after_position'`)
DROP DATABASE `mysqltest-1`;
connection slave;
DROP DATABASE `#mysql50#mysqltest-1`;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_name_const.test b/mysql-test/suite/rpl/t/rpl_name_const.test
index d3ef557ddc0..4cacafa0523 100644
--- a/mysql-test/suite/rpl/t/rpl_name_const.test
+++ b/mysql-test/suite/rpl/t/rpl_name_const.test
@@ -45,4 +45,4 @@ select * from t1 order by id;
connection master;
drop table t1;
drop procedure test_procedure;
---sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test
index 2f2db01f422..94dbc56d73b 100644
--- a/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test
@@ -11,3 +11,4 @@ SET SESSION binlog_direct_non_transactional_updates = OFF;
--enable_query_log
let $engine_type=Innodb;
--source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test
index 614519331e0..53d8fec9434 100644
--- a/mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test
@@ -13,3 +13,4 @@ let $engine_type=Innodb;
--source extra/rpl_tests/rpl_mixing_engines.test
--diff_files suite/rpl/r/rpl_non_direct_row_mixing_engines.result suite/rpl/r/rpl_row_mixing_engines.result
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test
index 448719eb4f8..13d4c998fb4 100644
--- a/mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_non_direct_stm_mixing_engines.test
@@ -11,3 +11,4 @@ SET SESSION binlog_direct_non_transactional_updates = OFF;
--enable_query_log
let $engine_type=Innodb;
--source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test b/mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test
index f8e697d58ce..a174445f667 100644
--- a/mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test
+++ b/mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test
@@ -50,8 +50,9 @@ INSERT INTO t1 VALUES (RAND());
INSERT INTO t1 VALUES (LAST_INSERT_ID());
--sync_slave_with_master
---let $diff_table_1= master:test.t1
---let $diff_table_2= slave:test.t1
+--let $diff_tables= master:t1, slave:t1
--source include/diff_tables.inc
+--connection master
DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_not_null_innodb.test b/mysql-test/suite/rpl/t/rpl_not_null_innodb.test
index dca0ea6589c..1e67ba4eda1 100644
--- a/mysql-test/suite/rpl/t/rpl_not_null_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_not_null_innodb.test
@@ -17,3 +17,4 @@
let $engine=Innodb;
--source extra/rpl_tests/rpl_not_null.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_not_null_myisam.test b/mysql-test/suite/rpl/t/rpl_not_null_myisam.test
index 0c036f5bfd7..dcfaf006dad 100644
--- a/mysql-test/suite/rpl/t/rpl_not_null_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_not_null_myisam.test
@@ -16,3 +16,4 @@
let $engine=MyISAM;
--source extra/rpl_tests/rpl_not_null.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_optimize.test b/mysql-test/suite/rpl/t/rpl_optimize.test
index 77d045e70fe..b48ef579b6b 100644
--- a/mysql-test/suite/rpl/t/rpl_optimize.test
+++ b/mysql-test/suite/rpl/t/rpl_optimize.test
@@ -63,3 +63,4 @@ sync_slave_with_master;
# starts, this test will demonstrate nothing but will pass.
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test
index 38b868cb59d..7e9a35883a3 100644
--- a/mysql-test/suite/rpl/t/rpl_packet.test
+++ b/mysql-test/suite/rpl/t/rpl_packet.test
@@ -26,8 +26,8 @@ let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
SET @@global.max_allowed_packet=1024;
SET @@global.net_buffer_length=1024;
+sync_slave_with_master;
# Restart slave for setting to take effect
-connection slave;
source include/stop_slave.inc;
source include/start_slave.inc;
@@ -84,17 +84,21 @@ connection master;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
-# The slave I/O thread must stop after trying to read the above event
-connection slave;
---source include/wait_for_slave_io_to_stop.inc
-let $slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
---echo Slave_IO_Running = $slave_io_running (expect No)
+
#
# Bug#42914: The slave I/O thread must stop after trying to read the above
# event, However there is no Last_IO_Error report.
#
-let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
-eval SELECT "$last_io_error" AS Last_IO_Error;
+
+# The slave I/O thread must stop after trying to read the above event
+connection slave;
+# 1153 = ER_NET_PACKET_TOO_LARGE
+--let $slave_io_errno= 1153
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
+
+# TODO: this is needed because of BUG#55790. Remove once that is fixed.
+--source include/stop_slave_sql.inc
#
# Bug#42914: On the master, if a binary log event is larger than
@@ -102,7 +106,14 @@ eval SELECT "$last_io_error" AS Last_IO_Error;
# is sent to a slave when it requests a dump from the master, thus leading the
# I/O thread to stop. However, there is no Last_IO_Error reported.
#
-source include/master-slave-reset.inc;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
+--connection master
+DROP TABLE t1;
+--sync_slave_with_master
+
+
connection master;
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
sync_slave_with_master;
@@ -112,12 +123,10 @@ INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), R
connection slave;
# The slave I/O thread must stop after receiving
-# ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master.
---source include/wait_for_slave_io_to_stop.inc
-let $slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
---echo Slave_IO_Running = $slave_io_running (expect No)
-let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
-eval SELECT "$last_io_error" AS Last_IO_Error;
+# 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master.
+--let $slave_io_errno= 1236
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
# Remove the bad binlog and clear error status on slave.
STOP SLAVE;
@@ -160,4 +169,8 @@ eval SET @@global.net_buffer_length= $old_net_buffer_length;
connection slave;
DROP TABLE t1;
+# Clear Last_IO_Error
+RESET SLAVE;
+
+--source include/rpl_end.inc
# End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_plugin_load.test b/mysql-test/suite/rpl/t/rpl_plugin_load.test
index 100683922ad..5f9725a8e66 100644
--- a/mysql-test/suite/rpl/t/rpl_plugin_load.test
+++ b/mysql-test/suite/rpl/t/rpl_plugin_load.test
@@ -56,5 +56,5 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
sync_slave_with_master;
#
# Cleanup
---source include/master-slave-end.inc
+--source include/rpl_end.inc
--echo End of test
diff --git a/mysql-test/suite/rpl/t/rpl_ps.test b/mysql-test/suite/rpl/t/rpl_ps.test
index 143f75e5477..b3d07dd1400 100644
--- a/mysql-test/suite/rpl/t/rpl_ps.test
+++ b/mysql-test/suite/rpl/t/rpl_ps.test
@@ -66,73 +66,36 @@ source include/wait_for_slave_to_stop.inc;
###############################################################################
---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
---sync_slave_with_master
-
-
---echo
--echo # Connection: slave
---echo
+--sync_slave_with_master
---echo
SELECT * FROM t1;
---echo
--echo # Connection: master
---echo
--connection master
---echo
DROP DATABASE mysqltest1;
---echo
use test;
DROP TABLE t1;
---echo
---sync_slave_with_master
-
-
---echo
---echo # Connection: slave
---echo
-
---echo
-STOP SLAVE;
-
---echo
---echo ########################################################################
-
-###############################################################################
-reset master;
-reset slave;
-disconnect master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
index 4dca3e0880c..30cc564917a 100644
--- a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
+++ b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
@@ -31,3 +31,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql $MYSQLTEST_VARDIR/tmp
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_read_only.test b/mysql-test/suite/rpl/t/rpl_read_only.test
index 040ae71586b..fb92803847a 100644
--- a/mysql-test/suite/rpl/t/rpl_read_only.test
+++ b/mysql-test/suite/rpl/t/rpl_read_only.test
@@ -41,30 +41,39 @@ set global read_only=0;
connection master1;
BEGIN;
+
+connection master2;
+BEGIN;
+
+connection master;
+select @@read_only;
+set global read_only=1;
+
+connection master1;
+-- echo *** On SUPER USER connection ***
insert into t1 values(1002);
--disable_warnings
insert into t2 values(2002);
--enable_warnings
connection master2;
-BEGIN;
+-- echo *** On regular USER connection ***
+--error ER_OPTION_PREVENTS_STATEMENT
insert into t1 values(1003);
---disable_warnings
+--error ER_OPTION_PREVENTS_STATEMENT
insert into t2 values(2003);
---enable_warnings
-
-connection master;
-set global read_only=1;
connection master1;
## works even with read_only=1, because master1 is root
+-- echo *** SUPER USER COMMIT (must succeed) ***
COMMIT;
connection master2;
---error ER_OPTION_PREVENTS_STATEMENT
+-- echo *** regular USER COMMIT (must succeed - nothing to commit) ***
COMMIT;
connection master;
+select @@read_only;
set global read_only=0;
connection master1;
@@ -117,3 +126,4 @@ sync_slave_with_master;
set global read_only=0;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test b/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
index 156d53ef856..ca16a583fe5 100644
--- a/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test
@@ -1,22 +1,4 @@
-###################################
-# Wrapper rpl_sv_relay_space.test #
-# This test has to be wrapped as #
-# It tests ndb, innodb and MyISAM.#
-# By Wrapping we are saving some #
-# space and making the test more #
-# Maintainable by only having one #
-# test file and reusing the code #
-# In Addition, INNODB has to have #
-# Option files during this test #
-# to force innodb on the slave #
-# else the test will fail #
-###################################
-#Change Author: JBM #
-#Change Date: 2006-02-03 #
-#Change: Added Comments #
-###################################
-- source include/not_ndb_default.inc
-- source include/have_innodb.inc
let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_sv_relay_space.test
-
diff --git a/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test b/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
index 1d8563e7fd9..13719cbdc33 100644
--- a/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test
@@ -1,21 +1,3 @@
-###################################
-# Wrapper rpl_sv_relay_space.test #
-# This test has to be wrapped as #
-# It tests ndb, innodb and MyISAM.#
-# By Wrapping we are saving some #
-# space and making the test more #
-# Maintainable by only having one #
-# test file and reusing the code #
-# In Addition, INNODB has to have #
-# Option files during this test #
-# to force innodb on the slave #
-# else the test will fail #
-###################################
-#Change Author: JBM #
-#Change Date: 2006-02-03 #
-#Change: Added Comments #
-###################################
-- source include/not_ndb_default.inc
let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_sv_relay_space.test
-
diff --git a/mysql-test/suite/rpl/t/rpl_relayrotate.test b/mysql-test/suite/rpl/t/rpl_relayrotate.test
index 248389d793d..f187fbc033f 100644
--- a/mysql-test/suite/rpl/t/rpl_relayrotate.test
+++ b/mysql-test/suite/rpl/t/rpl_relayrotate.test
@@ -12,3 +12,4 @@
let $engine_type=innodb;
-- source extra/rpl_tests/rpl_relayrotate.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_relayspace.test b/mysql-test/suite/rpl/t/rpl_relayspace.test
index cd04c2ccc0b..fc33d6bc0ba 100644
--- a/mysql-test/suite/rpl/t/rpl_relayspace.test
+++ b/mysql-test/suite/rpl/t/rpl_relayspace.test
@@ -2,10 +2,9 @@
# to force the deadlock after one event.
source include/master-slave.inc;
-let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1);
+--let $master_log_file= query_get_value(SHOW MASTER STATUS, File, 1)
connection slave;
-stop slave;
-source include/wait_for_slave_to_stop.inc;
+--source include/stop_slave.inc
connection master;
# This will generate a master's binlog > 10 bytes
create table t1 (a int);
@@ -21,22 +20,33 @@ let $slave_param_value= Waiting for the slave SQL thread to free enough relay lo
source include/wait_for_slave_param.inc;
# A bug caused the I/O thread to refuse stopping.
-stop slave io_thread;
-source include/wait_for_slave_io_to_stop.inc;
+--source include/stop_slave_io.inc
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;
-# also the slave will probably not cooperate to shutdown
-# (as 2 threads are locked)
---replace_result $master_log_file MASTER_LOG_FILE
-eval select master_pos_wait('$master_log_file',200,30)=-1;
+--source include/start_slave.inc
+# 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 300 seconds (which is inline
+# with the default used for sync_slave_with_master and will protect us
+# against slow test envs); also the slave will probably not cooperate
+# to shutdown (as 2 threads are locked)
+--let $outcome= `SELECT MASTER_POS_WAIT('$master_log_file',200,300) AS mpw;`
+
+# master_pos_wait returns:
+#
+# * >= 0, the number of events the slave had to wait to advance to the
+# position
+#
+# * -1, if there was a timeout
+#
+# * NULL, if an error occurred, or the SQL thread was not started,
+# slave master info is not initialized, the arguments are incorrect
+--let $assert_text= Assert that master_pos_wait does not timeout nor it returns NULL
+--let $assert_cond= $outcome IS NOT NULL AND $outcome <> -1
+--source include/assert.inc
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_replicate_do.test b/mysql-test/suite/rpl/t/rpl_replicate_do.test
index dd3ecc075cc..e9a7eef9676 100644
--- a/mysql-test/suite/rpl/t/rpl_replicate_do.test
+++ b/mysql-test/suite/rpl/t/rpl_replicate_do.test
@@ -84,3 +84,4 @@ connection master;
drop table t1;
drop table t2;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test
index bcfef919fad..f1907456ed5 100644
--- a/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test
+++ b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test
@@ -28,3 +28,4 @@ connection master;
drop database mysqltest1;
drop database mysqltest2;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_report.test b/mysql-test/suite/rpl/t/rpl_report.test
index 8798905d372..a73442917fa 100644
--- a/mysql-test/suite/rpl/t/rpl_report.test
+++ b/mysql-test/suite/rpl/t/rpl_report.test
@@ -19,3 +19,4 @@ set @@global.report_host='my.new.address.net';
--echo end of tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
index 585b08be0b3..996ad0a10c7 100644
--- a/mysql-test/suite/rpl/t/rpl_rewrt_db.test
+++ b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
@@ -237,3 +237,4 @@ connection master;
sync_slave_with_master;
# end of 5.0 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt
deleted file mode 100644
index 80190bf6d29..00000000000
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---server-id=2
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh
deleted file mode 100644
index 81490a54b4b..00000000000
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-rm -f $MYSQLTEST_VARDIR/slave-data/master.info
-rm -f $MYSQLTEST_VARDIR/slave-data/*relay*
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
index ca83020bff0..6e2a7e22352 100644
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
@@ -18,19 +18,14 @@
-- 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
let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
write_file $MYSQLD_SLAVE_DATADIR/master.info;
EOF
chmod 0000 $MYSQLD_SLAVE_DATADIR/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)
@@ -98,12 +93,10 @@ 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;
---source include/wait_for_slave_to_start.inc
+# 1062 = ER_DUP_ENTRY
+call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* Error_code: 1062");
+--let $slave_sql_errno= 1062
+--source include/wait_for_slave_sql_error_and_skip.inc
connection master;
@@ -194,3 +187,4 @@ show binlog events in '';
purge master logs before now();
--echo End of 5.0 tests
+--source include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_001.test b/mysql-test/suite/rpl/t/rpl_row_001.test
index f949e0b2d5f..96521280afd 100644
--- a/mysql-test/suite/rpl/t/rpl_row_001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_001.test
@@ -10,3 +10,4 @@
let $engine_type=MYISAM;
-- source extra/rpl_tests/rpl_row_001.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_4_bytes.test b/mysql-test/suite/rpl/t/rpl_row_4_bytes.test
index 73ef6dd2345..6130f74983e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_4_bytes.test
+++ b/mysql-test/suite/rpl/t/rpl_row_4_bytes.test
@@ -31,3 +31,4 @@ select * from t2 order by a;
connection master;
DROP DATABASE mysqltest1;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_NOW.test b/mysql-test/suite/rpl/t/rpl_row_NOW.test
index c28b714277e..d732c6e6733 100644
--- a/mysql-test/suite/rpl/t/rpl_row_NOW.test
+++ b/mysql-test/suite/rpl/t/rpl_row_NOW.test
@@ -72,3 +72,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/NOW_master.sql $MYSQLTEST_VARDIR/tmp/NOW_slave.
sync_slave_with_master;
# End of 5.1 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_USER.test b/mysql-test/suite/rpl/t/rpl_row_USER.test
index 7b13ebc50ee..010e0e6ea05 100644
--- a/mysql-test/suite/rpl/t/rpl_row_USER.test
+++ b/mysql-test/suite/rpl/t/rpl_row_USER.test
@@ -58,3 +58,4 @@ DROP USER ''@'localhost%';
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_UUID.test b/mysql-test/suite/rpl/t/rpl_row_UUID.test
index b0ef96463d0..ce3a4ed40a9 100644
--- a/mysql-test/suite/rpl/t/rpl_row_UUID.test
+++ b/mysql-test/suite/rpl/t/rpl_row_UUID.test
@@ -7,3 +7,4 @@
-- source include/master-slave.inc
let $engine_type=myisam;
--source extra/rpl_tests/rpl_row_UUID.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
index f6c690aa590..8cd021e88fc 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
@@ -35,13 +35,15 @@ USE test_ignore;
connection master;
DROP DATABASE test_ignore;
+USE test;
+DROP TABLE t1;
sync_slave_with_master;
+USE test;
+
# 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
+--source include/rpl_reset.inc
connection master;
CREATE TABLE t1 (a INT);
@@ -57,13 +59,12 @@ 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
+--source include/rpl_reset.inc
--echo **** On Slave ****
connection slave;
SET GLOBAL QUERY_CACHE_SIZE=0;
+call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* Error_code: 1032");
--echo **** On Master ****
connection master;
@@ -91,12 +92,13 @@ sync_slave_with_master;
SELECT * FROM t1;
SET GLOBAL QUERY_CACHE_SIZE=0;
+--connection master
+DROP TABLE t1;
+
# Bug#22550: Replication of BIT columns failing
--echo ================ Test for BUG#22550 ================
---disable_query_log
---source include/master-slave-reset.inc
---enable_query_log
+--source include/rpl_reset.inc
connection master;
CREATE TABLE t1 (a BIT(1), b INT) ENGINE=MYISAM;
@@ -122,9 +124,7 @@ sync_slave_with_master;
# field does not work
--echo ================ Test for BUG#22583 ================
---disable_query_log
---source include/master-slave-reset.inc
---enable_query_log
+--source include/rpl_reset.inc
# disabling warnings temporarily for ENGINE=INNODB to work without InnoDB
--disable_warnings
@@ -229,13 +229,10 @@ sync_slave_with_master;
# row-based replication
#
-disable_query_log;
-source include/master-slave-reset.inc;
-enable_query_log;
+--source include/rpl_reset.inc
--echo **** On Master ****
connection master;
-SET SESSION BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT PRIMARY KEY, b SET('master','slave'));
INSERT INTO t1 VALUES (1,'master,slave'), (2,'master,slave');
--echo **** On Slave ****
@@ -243,7 +240,7 @@ sync_slave_with_master;
UPDATE t1 SET a = 5, b = 'slave' WHERE a = 1;
SELECT * FROM t1 ORDER BY a;
# since bug#31552/31609 idempotency is not default any longer. In
-# order the preceeding test UPDATE t1 to pass the mode is switched
+# order for the preceeding test UPDATE t1 to pass, the mode is switched
# temprorarily
set @@global.slave_exec_mode= 'IDEMPOTENT';
--echo **** On Master ****
@@ -257,9 +254,10 @@ let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
+
SELECT * FROM t1 ORDER BY a;
-DROP TABLE t1;
--echo **** On Master ****
connection master;
DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test b/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test
index c5648fa1d77..f1f5c584543 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test
@@ -4,3 +4,4 @@
let $type= 'MYISAM' ;
let $extra_index= ;
-- source extra/rpl_tests/rpl_row_basic.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
index 41cf1cc622a..55ea2f3c3c8 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test
@@ -8,3 +8,4 @@ let $type= 'INNODB' ;
let $extra_index= ;
-- source extra/rpl_tests/rpl_row_basic.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test b/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
index 687b3bc785d..3ec79ec8cd5 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
@@ -208,3 +208,4 @@ SHOW CREATE TABLE t1;
DROP TABLE IF EXISTS t1;
# End of 5.1 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size-master.opt b/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size-master.opt
deleted file mode 100644
index eb56e5c0a09..00000000000
--- a/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog_cache_size=4096 --max_binlog_cache_size=7680 --default-storage-engine=MyISAM
diff --git a/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test
index 5133c8b1b5e..9c8489658f8 100644
--- a/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test
+++ b/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test
@@ -5,3 +5,4 @@
--source include/have_binlog_format_row.inc
--source extra/rpl_tests/rpl_binlog_max_cache_size.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test b/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
index 6aa6c2a31b9..eaf86688a29 100644
--- a/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test
@@ -12,3 +12,4 @@
let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_row_blob.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test b/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
index 11f5336502a..482ccb7ecc0 100644
--- a/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test
@@ -11,3 +11,4 @@
let $engine_type=myisam;
-- source extra/rpl_tests/rpl_row_blob.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_colSize.test b/mysql-test/suite/rpl/t/rpl_row_colSize.test
index 078e6886ec7..0701c44edd3 100644
--- a/mysql-test/suite/rpl/t/rpl_row_colSize.test
+++ b/mysql-test/suite/rpl/t/rpl_row_colSize.test
@@ -160,9 +160,14 @@ 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;
+connection slave;
+call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 0 ...e mismatch.* Error_code: 1535");
+call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* Error_code: 1677");
+
--echo *** Cleanup ***
connection master;
DROP TABLE IF EXISTS t1;
sync_slave_with_master;
# END 5.1 Test Case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_conflicts.test b/mysql-test/suite/rpl/t/rpl_row_conflicts.test
index 59757e2e802..ce5332966ef 100644
--- a/mysql-test/suite/rpl/t/rpl_row_conflicts.test
+++ b/mysql-test/suite/rpl/t/rpl_row_conflicts.test
@@ -20,6 +20,8 @@ SET @old_slave_exec_mode= @@global.slave_exec_mode;
SET @@global.slave_exec_mode = 'STRICT';
source extra/rpl_tests/rpl_conflicts.test;
+--source include/rpl_reset.inc
+
--echo ######## Run with slave_exec_mode=IDEMPOTENT ########
@@ -28,4 +30,4 @@ source extra/rpl_tests/rpl_conflicts.test;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test
index 6b051fb46e5..ef3c0758643 100644
--- a/mysql-test/suite/rpl/t/rpl_row_create_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test
@@ -12,12 +12,6 @@ connection master;
# 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.
@@ -31,7 +25,7 @@ START SLAVE;
--source include/wait_for_slave_to_start.inc
--enable_query_log
---source include/reset_master_and_slave.inc
+--source include/rpl_reset.inc
connection master;
CREATE TABLE t1 (a INT, b INT);
@@ -67,7 +61,7 @@ SELECT * FROM t5 ORDER BY a,b,c;
--query_vertical SHOW CREATE TABLE t6
SELECT * FROM t6 ORDER BY a,b,c;
---source include/reset_master_and_slave.inc
+--source include/rpl_reset.inc
connection master;
# Test for erroneous constructions
@@ -86,7 +80,7 @@ SELECT * FROM t7 ORDER BY a,b;
sync_slave_with_master;
SELECT * FROM t7 ORDER BY a,b;
---source include/reset_master_and_slave.inc
+--source include/rpl_reset.inc
connection master;
CREATE TEMPORARY TABLE tt4 (a INT, b INT);
@@ -99,7 +93,7 @@ SELECT * FROM t7 ORDER BY a,b;
sync_slave_with_master;
SELECT * FROM t7 ORDER BY a,b;
---source include/reset_master_and_slave.inc
+--source include/rpl_reset.inc
connection master;
CREATE TABLE t8 LIKE t4;
@@ -131,7 +125,7 @@ START SLAVE;
# table' from log):
--echo ================ BUG#22864 ================
---source include/master-slave-reset.inc
+--source include/rpl_reset.inc
connection master;
SET AUTOCOMMIT=0;
@@ -168,17 +162,7 @@ SET AUTOCOMMIT=1;
sync_slave_with_master;
# Some tests with temporary tables
-connection slave;
-STOP SLAVE;
---source include/wait_for_slave_to_stop.inc
-RESET SLAVE;
-
-connection master;
-RESET MASTER;
-
-connection slave;
-START SLAVE;
---source include/wait_for_slave_to_start.inc
+--source include/rpl_reset.inc
connection master;
CREATE TABLE t1 (a INT);
@@ -204,7 +188,7 @@ connection master;
TRUNCATE TABLE t2;
sync_slave_with_master;
---source include/reset_master_and_slave.inc
+--source include/rpl_reset.inc
connection master;
BEGIN;
@@ -253,7 +237,7 @@ sync_slave_with_master;
# BUG#34707: Row based replication: slave creates table within wrong database
#
-source include/master-slave-reset.inc;
+--source include/rpl_reset.inc
connection master;
--disable_warnings
@@ -275,7 +259,7 @@ sync_slave_with_master;
# <tmp_tbl> with RBL
#
-source include/master-slave-reset.inc;
+--source include/rpl_reset.inc
connection master;
CREATE TEMPORARY TABLE t7(c1 INT);
@@ -305,5 +289,7 @@ DROP VIEW IF EXISTS bug48506_t1, bug48506_t2, bug48506_t3;
DROP TEMPORARY TABLES t7;
DROP TABLES t4, t5;
DROP TABLES IF EXISTS bug48506_t4;
-source include/master-slave-end.inc;
+
+--source include/rpl_end.inc
+
--echo end of the tests
diff --git a/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test b/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
index a0e74567349..db41ff09117 100644
--- a/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
+++ b/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test
@@ -1,7 +1,3 @@
-########################################################
-# 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_delayed_ins.test
diff --git a/mysql-test/suite/rpl/t/rpl_row_drop.test b/mysql-test/suite/rpl/t/rpl_row_drop.test
index d18ebc2846b..eca2ae0f643 100644
--- a/mysql-test/suite/rpl/t/rpl_row_drop.test
+++ b/mysql-test/suite/rpl/t/rpl_row_drop.test
@@ -43,3 +43,4 @@ DROP TABLE IF EXISTS t2;
sync_slave_with_master;
--enable_warnings
--enable_query_log
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test
index fc46665ddb1..5896f6a48b0 100644
--- a/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test
@@ -8,3 +8,4 @@
--source include/have_innodb.inc
--source extra/rpl_tests/rpl_drop_create_temp_table.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_find_row.test b/mysql-test/suite/rpl/t/rpl_row_find_row.test
index 9163ab54406..7f633c5aa97 100644
--- a/mysql-test/suite/rpl/t/rpl_row_find_row.test
+++ b/mysql-test/suite/rpl/t/rpl_row_find_row.test
@@ -50,7 +50,7 @@ DROP TABLE t;
# but it gets disabled sometime.
# Replication does not break anymore.
#
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
CREATE TABLE t (a int, b int, c int, key(b));
@@ -84,8 +84,7 @@ DROP TABLE t;
# As a consquence, the wrong row would be updated.
#
--- connection master
--- source include/master-slave-reset.inc
+-- source include/rpl_reset.inc
-- connection master
CREATE TABLE t1 (c1 INT NOT NULL, c2 INT NOT NULL, c3 INT, UNIQUE KEY(c1,c3), KEY(c2));
@@ -94,11 +93,11 @@ INSERT INTO t1(c1,c2) VALUES(1,2);
UPDATE t1 SET c1=1000 WHERE c2=2;
-- sync_slave_with_master
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
DROP TABLE t1;
-- sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
index eebe8059d5c..1d33962ad48 100644
--- a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
+++ b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test
@@ -14,4 +14,3 @@ let $rename_event_pos= 926;
--disable_ps_protocol
-- source extra/rpl_tests/rpl_flsh_tbls.test
--enable_ps_protocol
-
diff --git a/mysql-test/suite/rpl/t/rpl_row_func001.test b/mysql-test/suite/rpl/t/rpl_row_func001.test
index 53fb55118e6..6ff97388b31 100644
--- a/mysql-test/suite/rpl/t/rpl_row_func001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_func001.test
@@ -55,3 +55,4 @@ DROP TABLE test.t1;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_func002.test b/mysql-test/suite/rpl/t/rpl_row_func002.test
index 44a704bfbc5..2f4e3fdd910 100644
--- a/mysql-test/suite/rpl/t/rpl_row_func002.test
+++ b/mysql-test/suite/rpl/t/rpl_row_func002.test
@@ -102,3 +102,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/func002_master.sql $MYSQLTEST_VARDIR/tmp/func00
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_func003.test b/mysql-test/suite/rpl/t/rpl_row_func003.test
index 30b24cf4174..a17d70e4b04 100644
--- a/mysql-test/suite/rpl/t/rpl_row_func003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_func003.test
@@ -11,3 +11,4 @@
-- source include/master-slave.inc
let $engine_type=INNODB;
-- source extra/rpl_tests/rpl_row_func003.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_idempotency.test b/mysql-test/suite/rpl/t/rpl_row_idempotency.test
index cd62280f1d4..7f48d6503c1 100644
--- a/mysql-test/suite/rpl/t/rpl_row_idempotency.test
+++ b/mysql-test/suite/rpl/t/rpl_row_idempotency.test
@@ -9,10 +9,10 @@ connection slave;
source include/have_innodb.inc;
# Add suppression for expected warning(s) in slaves error log
-call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032");
-call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
-call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
-
+call mtr.add_suppression("Can.t find record in .t[12].* Error_code: 1032");
+call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
+call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
+call mtr.add_suppression("Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
# bug#31609 Not all RBR slave errors reported as errors
# bug#31552 Replication breaks when deleting rows from out-of-sync table
@@ -326,6 +326,5 @@ drop table t1,t2,ti2,ti1;
sync_slave_with_master;
set @@global.slave_exec_mode= @old_slave_exec_mode;
---source include/master-slave-end.inc
-
--echo *** end of tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test
index 8b54878a203..cfad4fca433 100644
--- a/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test
+++ b/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test
@@ -8,3 +8,4 @@
--let $engine=Innodb
set session storage_engine=innodb;
--source extra/rpl_tests/rpl_implicit_commit_binlog.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
index 0c038c41ebf..22fd65ecaf3 100644
--- a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
+++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
@@ -29,14 +29,17 @@ INSERT INTO t1 VALUES (1);
--echo [on slave]
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:
-let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
---echo Last_SQL_Error = $err
+# 1146 = ER_NO_SUCH_TABLE
+call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., Error_code: 1146");
+--let $slave_sql_errno= 1146
+--source include/wait_for_slave_sql_error.inc
--echo ==== Clean up ====
-source include/stop_slave.inc;
+source include/stop_slave_io.inc;
+RESET SLAVE;
--echo [on master]
connection master;
DROP TABLE t1;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test
index 436c0a9f517..a6c38117767 100644
--- a/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test
+++ b/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test
@@ -3,3 +3,4 @@
--source include/not_embedded.inc
--source include/not_windows.inc
--source extra/rpl_tests/rpl_insert_delayed.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_log.test b/mysql-test/suite/rpl/t/rpl_row_log.test
index 197f83c85af..b156a4c8dd4 100644
--- a/mysql-test/suite/rpl/t/rpl_row_log.test
+++ b/mysql-test/suite/rpl/t/rpl_row_log.test
@@ -15,3 +15,4 @@
let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_log.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_log_innodb.test b/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
index 16e775287b3..631fb29c7bc 100644
--- a/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_log_innodb.test
@@ -12,3 +12,4 @@
let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_log.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test
index 8af1ae51bb9..f2e26f36fdc 100644
--- a/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test
@@ -9,3 +9,4 @@
let $engine_type=Innodb;
--source extra/rpl_tests/rpl_mixing_engines.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
index 3b829e7db7b..169d100fef4 100644
--- a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
@@ -352,3 +352,4 @@ DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test b/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test
index 67e4c4fb14d..57d67c5c71b 100644
--- a/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_innodb.test
@@ -8,3 +8,4 @@
-- let $engine= InnoDB
-- source extra/rpl_tests/rpl_record_compare.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
index 43fa99a51da..f96603f69ed 100644
--- a/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
@@ -1,18 +1,17 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
+-- let $engine= MyISAM
#
# BUG#52868 Wrong handling of NULL value during update, replication out of sync
#
--- let $engine= MyISAM
--- source extra/rpl_tests/rpl_record_compare.test
-- echo ## coverage purposes - Field_bits
-- echo ## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0
## Added here because AFAIK it's only MyISAM and NDB that use Field_bits
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=$engine DEFAULT CHARSET=latin1
@@ -22,10 +21,13 @@ INSERT INTO t1(c1,c2) VALUES (NULL, b'1');
UPDATE t1 SET c1= 0;
-- sync_slave_with_master
--- let $diff_table_1= master:test.t1
--- let $diff_table_2= slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
DROP TABLE t1;
-- sync_slave_with_master
+
+-- source extra/rpl_tests/rpl_record_compare.test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test b/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test
index 6a426efc7ea..a78f7ad4271 100644
--- a/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test
+++ b/mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test
@@ -16,3 +16,4 @@
-- source include/have_binlog_format_row.inc
-- source extra/rpl_tests/rpl_show_relaylog_events.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp001.test b/mysql-test/suite/rpl/t/rpl_row_sp001.test
index 34d42d985f9..99db5e7febe 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp001.test
@@ -142,3 +142,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/sp001_master.sql $MYSQLTEST_VARDIR/tmp/sp001_sl
--remove_file $MYSQLTEST_VARDIR/tmp/sp001_slave.sql
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
index e272e34e715..aec421407c9 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test
@@ -1,10 +1,3 @@
-#################################
-# Wrapper for rpl_row_sp002.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;
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp003.test b/mysql-test/suite/rpl/t/rpl_row_sp003.test
index ab49174ddfa..bd085610725 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp003.test
@@ -14,3 +14,4 @@
let $engine_type=INNODB;
-- source extra/rpl_tests/rpl_row_sp003.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp005.test b/mysql-test/suite/rpl/t/rpl_row_sp005.test
index abc7fb4f490..bbe4ce47f9e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp005.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp005.test
@@ -109,3 +109,4 @@ DROP TABLE IF EXISTS test.t3;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
index e5be4e6dc28..df3952bead1 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test
@@ -11,3 +11,4 @@
-- source include/master-slave.inc
let $engine_type=InnoDB;
-- source extra/rpl_tests/rpl_row_sp006.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
index 41af5a5f997..fcac31df780 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test
@@ -1,10 +1,3 @@
-#################################
-# Wrapper for rpl_row_sp007.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;
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp008.test b/mysql-test/suite/rpl/t/rpl_row_sp008.test
index 80603c28d27..8af3c88ae11 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp008.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp008.test
@@ -53,3 +53,4 @@ DROP TABLE IF EXISTS test.t2;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp009.test b/mysql-test/suite/rpl/t/rpl_row_sp009.test
index 77860621961..6e7226593a1 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp009.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp009.test
@@ -97,3 +97,4 @@ DROP TABLE test.t2;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp010.test b/mysql-test/suite/rpl/t/rpl_row_sp010.test
index 7fa0077f117..aad7edcd3ea 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp010.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp010.test
@@ -74,3 +74,4 @@ DROP TABLE IF EXISTS test.t2;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp011.test b/mysql-test/suite/rpl/t/rpl_row_sp011.test
index 25c2fc9ad26..d2a323faad2 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp011.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp011.test
@@ -109,3 +109,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/sp011_master.sql $MYSQLTEST_VARDIR/tmp/sp011_sl
--remove_file $MYSQLTEST_VARDIR/tmp/sp011_slave.sql
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp012.test b/mysql-test/suite/rpl/t/rpl_row_sp012.test
index 3a8d295121c..23bc92b51cf 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp012.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp012.test
@@ -73,3 +73,4 @@ sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test b/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test
index ab4914e15fa..030ec7d6541 100644
--- a/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test
@@ -6,3 +6,4 @@ let $engine_type = 'MyISAM';
-- source extra/rpl_tests/rpl_row_tabledefs.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test
index 7824fbfb663..35eddfc3ed4 100644
--- a/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test
@@ -7,3 +7,4 @@ let $engine_type = 'InnoDB';
-- source extra/rpl_tests/rpl_row_tabledefs.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test b/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
index d854aa64dc5..e8ac74f0125 100644
--- a/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
+++ b/mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
@@ -193,8 +193,7 @@ FLUSH LOGS;
-- connection master
-- echo ### assertion: the slave replicated event successfully and tables match
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
DROP TABLE `t1`;
@@ -229,7 +228,7 @@ DROP TABLE `t1`;
# in both cases: when slave is replaying events and when
# mysqlbinlog is used to read the binary log
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
# Create several tables with field_metadata_size ranging
@@ -313,8 +312,7 @@ FLUSH LOGS;
while($ntables)
{
-- echo ### assertion: the slave replicated event successfully and tables match for t$ntables
- -- let $diff_table_1=master:test.t$ntables
- -- let $diff_table_2=slave:test.t$ntables
+ -- let $diff_tables= master:t$ntables, slave:t$ntables
-- source include/diff_tables.inc
-- connection master
@@ -337,4 +335,4 @@ while($ntables)
## For debugging purposes you might want not to remove these
-- remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug50018.binlog
-- remove_file $generated_sql
--- source include/master-slave-end.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_trig001.test b/mysql-test/suite/rpl/t/rpl_row_trig001.test
index 8669034713a..39f2662b569 100644
--- a/mysql-test/suite/rpl/t/rpl_row_trig001.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig001.test
@@ -113,3 +113,4 @@ sync_slave_with_master;
diff_files $MYSQLTEST_VARDIR/tmp/trig001_master.sql $MYSQLTEST_VARDIR/tmp/trig001_slave.sql;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_trig002.test b/mysql-test/suite/rpl/t/rpl_row_trig002.test
index 1ea245498d5..46f9ad91a3d 100644
--- a/mysql-test/suite/rpl/t/rpl_row_trig002.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig002.test
@@ -72,3 +72,4 @@ DROP TABLE test.t3;
sync_slave_with_master;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_trig003.test b/mysql-test/suite/rpl/t/rpl_row_trig003.test
index 1ec568bf243..e332fc9174e 100644
--- a/mysql-test/suite/rpl/t/rpl_row_trig003.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig003.test
@@ -152,3 +152,4 @@ sync_slave_with_master;
diff_files $MYSQLTEST_VARDIR/tmp/trg003_master.sql $MYSQLTEST_VARDIR/tmp/trg003_slave.sql;
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_trig004.test b/mysql-test/suite/rpl/t/rpl_row_trig004.test
index a918c602d56..fa5f973c355 100644
--- a/mysql-test/suite/rpl/t/rpl_row_trig004.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trig004.test
@@ -16,3 +16,4 @@
let $engine_type=INNODB;
-- source extra/rpl_tests/rpl_trig004.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_trunc_temp.test b/mysql-test/suite/rpl/t/rpl_row_trunc_temp.test
index 60e1cd73200..394bf949f72 100644
--- a/mysql-test/suite/rpl/t/rpl_row_trunc_temp.test
+++ b/mysql-test/suite/rpl/t/rpl_row_trunc_temp.test
@@ -32,4 +32,4 @@ SELECT * FROM t2;
DROP TABLE t1;
connection master;
DROP TABLE t2;
---source include/master-slave-end.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test b/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test
index 069700546ce..9e6485d6630 100644
--- a/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test
+++ b/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test
@@ -33,3 +33,4 @@ connection master;
DROP TABLE t1, t2;
sync_slave_with_master;
connection master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test
index bcd8ba8612b..b861bb8c8ec 100644
--- a/mysql-test/suite/rpl/t/rpl_row_until.test
+++ b/mysql-test/suite/rpl/t/rpl_row_until.test
@@ -4,39 +4,36 @@
# Note: The test is dependent on binlog positions
-# prepare version for substitutions
-let $VERSION=`select version()`;
-
# Create some events on master
connection master;
CREATE TABLE t1(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2),(3),(4);
-# Save master log postion for query DROP TABLE t1
+# Save master log position for query DROP TABLE t1
let $master_pos_drop_t1= query_get_value(SHOW MASTER STATUS, Position, 1);
DROP TABLE t1;
-# Save master log postion for query DROP TABLE t1
+# Save master log position for query DROP TABLE t1
save_master_pos;
let $master_pos_drop_t1= query_get_value(SHOW BINLOG EVENTS, Pos, 7);
let $master_log_file= query_get_value(SHOW BINLOG EVENTS, Log_name, 7);
-# Save master log postion for query CREATE TABLE t2
+# Save master log position for query CREATE TABLE t2
let $master_pos_create_t2= query_get_value(SHOW MASTER STATUS, Position, 1);
CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
#show binlog events;
INSERT INTO t2 VALUES (1),(2);
-# Save master log postion for query INSERT INTO t2 VALUES (1),(2);
+# Save master log position for query INSERT INTO t2 VALUES (1),(2);
let $master_pos_insert1_t2= query_get_value(SHOW MASTER STATUS, Position, 1);
sync_slave_with_master;
#show binlog events;
-# Save relay log postion for query INSERT INTO t2 VALUES (1),(2);
+# Save relay log position for query INSERT INTO t2 VALUES (1),(2);
let $relay_pos_insert1_t2= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1);
connection master;
INSERT INTO t2 VALUES (3),(4);
DROP TABLE t2;
-# Save master log postion for query DROP TABLE t2;
+# Save master log position for query DROP TABLE t2;
let $master_pos_drop_t2= query_get_value(SHOW MASTER STATUS, Position, 1);
sync_slave_with_master;
#show binlog events;
@@ -125,3 +122,10 @@ START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', MASTER_LOG_POS=561;
START SLAVE;
--replace_result 740 MASTER_LOG_POS
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=740;
+
+--source include/stop_slave.inc
+# Clear slave IO error.
+RESET SLAVE;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_utf16.test b/mysql-test/suite/rpl/t/rpl_row_utf16.test
index b8f7b724ea1..e3e7a51c002 100644
--- a/mysql-test/suite/rpl/t/rpl_row_utf16.test
+++ b/mysql-test/suite/rpl/t/rpl_row_utf16.test
@@ -19,8 +19,10 @@ INSERT INTO t1 VALUES (); # default value is inserted and encoded correctl
--query_vertical SELECT c1, hex(c1) FROM t1
# assertion: tables don't differ
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables=master:t1,slave:t1
-- source include/diff_tables.inc
+--connection master
DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_utf32.test b/mysql-test/suite/rpl/t/rpl_row_utf32.test
index 44ca4b345c0..936d62b09bd 100644
--- a/mysql-test/suite/rpl/t/rpl_row_utf32.test
+++ b/mysql-test/suite/rpl/t/rpl_row_utf32.test
@@ -42,3 +42,4 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS= @saved_slave_type_conversions;
-- source include/stop_slave.inc
-- source include/start_slave.inc
-- connection master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_view01.test b/mysql-test/suite/rpl/t/rpl_row_view01.test
index 77e4b98f780..cc60ab9912c 100644
--- a/mysql-test/suite/rpl/t/rpl_row_view01.test
+++ b/mysql-test/suite/rpl/t/rpl_row_view01.test
@@ -95,3 +95,4 @@ sync_slave_with_master;
# End of 5.1 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_wide_table.test b/mysql-test/suite/rpl/t/rpl_row_wide_table.test
index 7b17d7c4866..b1d16133096 100644
--- a/mysql-test/suite/rpl/t/rpl_row_wide_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_wide_table.test
@@ -337,3 +337,4 @@ sync_slave_with_master;
# END of Test Case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_savepoint.test b/mysql-test/suite/rpl/t/rpl_savepoint.test
index 7fe8a0da651..2aacd1fa81e 100644
--- a/mysql-test/suite/rpl/t/rpl_savepoint.test
+++ b/mysql-test/suite/rpl/t/rpl_savepoint.test
@@ -44,4 +44,5 @@ FLUSH LOGS;
--echo # Connection master
connection master;
DROP TABLE nt;
---source include/master-slave-end.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test
index 17fa67e97e3..f697fedfad4 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test
@@ -15,6 +15,7 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state
connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
enable_query_log;
connection master;
@@ -58,7 +59,7 @@ echo [ on master ];
disable_query_log;
let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1);
-if (`select '$value' = 'No such row'`)
+if ($value == No such row)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
@@ -123,7 +124,7 @@ echo [ on slave ];
disable_query_log;
let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1);
-if (`select '$value' = 'No such row'`)
+if ($value == No such row)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
@@ -609,6 +610,7 @@ UNINSTALL PLUGIN rpl_semi_sync_master;
enable_warnings;
connection slave;
+change master to master_user='root',master_password='';
source include/start_slave.inc;
connection master;
@@ -618,3 +620,4 @@ sync_slave_with_master;
connection master;
drop user rpl@127.0.0.1;
flush privileges;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt b/mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt
index 78be60a4852..4cfb5d53923 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event-master.opt
@@ -1 +1 @@
---max-connections=23
+--max-connections=40
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
index 3b68441141a..c84f597c1ee 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test
@@ -15,12 +15,13 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state
connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
enable_query_log;
connection master;
disable_query_log;
let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1);
-if (`select '$value' = 'No such row'`)
+if ($value == No such row)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
@@ -34,7 +35,7 @@ source include/stop_slave.inc;
disable_query_log;
let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1);
-if (`select '$value' = 'No such row'`)
+if ($value == No such row)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_SO';
@@ -107,3 +108,4 @@ DROP EVENT ev1;
DROP EVENT ev2;
DROP TABLE t1;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_server_id1.test b/mysql-test/suite/rpl/t/rpl_server_id1.test
index c97f7975278..90198a4ac5e 100644
--- a/mysql-test/suite/rpl/t/rpl_server_id1.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id1.test
@@ -4,21 +4,19 @@
# ignored, which has caught our customers), unless
# --replicate-same-server-id.
-source include/master-slave.inc;
-connection slave;
-reset master;
+--let $rpl_topology= 2->2
+--let $rpl_skip_start_slave= 1
+--source include/rpl_init.inc
-# replicate ourselves
-source include/stop_slave.inc;
---replace_result $SLAVE_MYPORT SLAVE_PORT
-eval change master to master_port=$SLAVE_MYPORT;
-start slave;
+--connection server_2
+START SLAVE;
+# 1593 = ER_SLAVE_FATAL_ERROR
+--let $slave_io_errno= 1593
+--let $show_slave_io_error= 1
+--source include/wait_for_slave_io_error.inc
-let $slave_param= Last_IO_Errno;
-let $slave_param_value= 1593;
-source include/wait_for_slave_param.inc;
---echo *** must be having the replicate-same-server-id IO thread error ***
-let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
-let $last_io_error= query_get_value("show slave status", Last_IO_Error, 1);
-echo Slave_IO_Errno= $last_io_errno;
-echo Slave_IO_Error= $last_io_error;
+--source include/stop_slave_sql.inc
+RESET SLAVE;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_server_id2.test b/mysql-test/suite/rpl/t/rpl_server_id2.test
index 5c51a7fc08e..21e197866cf 100644
--- a/mysql-test/suite/rpl/t/rpl_server_id2.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id2.test
@@ -50,7 +50,7 @@ eval start slave until master_log_file='master-bin.000001', master_log_pos=$unti
--source include/wait_for_slave_io_to_start.inc
--source include/wait_for_slave_sql_to_stop.inc
---echo *** checking until postion execution: must be only t1 in the list ***
+--echo *** checking until position execution: must be only t1 in the list ***
show tables;
# cleanup
@@ -64,3 +64,4 @@ drop table t2;
sync_slave_with_master;
# End of tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_server_id_ignore.test b/mysql-test/suite/rpl/t/rpl_server_id_ignore.test
index 1b38bd34d3d..004f4daa19d 100644
--- a/mysql-test/suite/rpl/t/rpl_server_id_ignore.test
+++ b/mysql-test/suite/rpl/t/rpl_server_id_ignore.test
@@ -112,3 +112,4 @@ sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_session_var.test b/mysql-test/suite/rpl/t/rpl_session_var.test
index 55e58674c61..cf3faa6578c 100644
--- a/mysql-test/suite/rpl/t/rpl_session_var.test
+++ b/mysql-test/suite/rpl/t/rpl_session_var.test
@@ -57,5 +57,5 @@ sync_slave_with_master;
SELECT length(data) < 100 FROM t1;
connection master;
drop table t1;
-sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_set_charset.test b/mysql-test/suite/rpl/t/rpl_set_charset.test
index 241c1c5738b..296e5dfb079 100644
--- a/mysql-test/suite/rpl/t/rpl_set_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_set_charset.test
@@ -29,3 +29,4 @@ drop database mysqltest1;
sync_slave_with_master;
# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_set_null_innodb.test b/mysql-test/suite/rpl/t/rpl_set_null_innodb.test
index dba79b78fa1..2d0c34e1d0a 100644
--- a/mysql-test/suite/rpl/t/rpl_set_null_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_set_null_innodb.test
@@ -4,3 +4,4 @@
-- let $engine= InnoDB
-- source extra/rpl_tests/rpl_set_null.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_set_null_myisam.test b/mysql-test/suite/rpl/t/rpl_set_null_myisam.test
index 7b433071553..13cd7c3e4a8 100644
--- a/mysql-test/suite/rpl/t/rpl_set_null_myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_set_null_myisam.test
@@ -3,3 +3,4 @@
-- let $engine= MyISAM
-- source extra/rpl_tests/rpl_set_null.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sf.test b/mysql-test/suite/rpl/t/rpl_sf.test
deleted file mode 100644
index 4d12f3839a2..00000000000
--- a/mysql-test/suite/rpl/t/rpl_sf.test
+++ /dev/null
@@ -1,187 +0,0 @@
--- source include/have_log_bin.inc
-
-# Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
-# BUG#41166 stored function requires "deterministic" if binlog_format is "statement"
-
-# 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_UNSAFE_ROUTINE
-select fn16456();
-
-
-
-# clean
-
-drop function fn16456;
-
-
-
-# success in definition with deterministic
-
-set global log_bin_trust_function_creators=0;
-
-delimiter |;
-create function fn16456()
- returns int deterministic
-begin
- return unix_timestamp();
-end|
-delimiter ;|
-
-
-
-# allow funcall in RBR
-
-set binlog_format=ROW;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-
-# allow funcall in SBR
-
-set binlog_format=STATEMENT;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-
-# clean
-
-drop function fn16456;
-
-
-# success in definition with NO SQL
-
-set global log_bin_trust_function_creators=0;
-
-delimiter |;
-create function fn16456()
- returns int no sql
-begin
- return unix_timestamp();
-end|
-delimiter ;|
-
-
-
-# allow funcall in RBR
-
-set binlog_format=ROW;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-
-# allow funcall in SBR
-
-set binlog_format=STATEMENT;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-# clean
-
-drop function fn16456;
-
-
-
-# success in definition with reads sql data
-
-set global log_bin_trust_function_creators=0;
-
-delimiter |;
-create function fn16456()
- returns int reads sql data
-begin
- return unix_timestamp();
-end|
-delimiter ;|
-
-
-
-# allow funcall in RBR
-
-set binlog_format=ROW;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-
-# allow funcall in SBR
-
-set binlog_format=STATEMENT;
-
---replace_column 1 timestamp
-select fn16456();
-
-
-
-# clean
-
-drop function fn16456;
-
-
-
-# restore status
-
---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_show_slave_hosts.test b/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test
index 9f202487968..105f1873659 100644
--- a/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test
+++ b/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test
@@ -23,14 +23,13 @@ connection master;
let $show_statement= SHOW SLAVE HOSTS;
let $field= Server_id;
# 3 is server_id of slave2.
-let $connection= ='3';
+let $condition= ='3';
source include/wait_show_condition.inc;
--replace_result $SLAVE_MYPORT SLAVE_PORT $DEFAULT_MASTER_PORT DEFAULT_PORT
SHOW SLAVE HOSTS;
connection slave2;
-STOP SLAVE IO_THREAD;
-source include/wait_for_slave_io_to_stop.inc;
+--source include/stop_slave_io.inc
connection master;
let $show_statement= SHOW SLAVE HOSTS;
@@ -44,4 +43,4 @@ source include/wait_show_condition.inc;
--replace_result $SLAVE_MYPORT SLAVE_PORT
SHOW SLAVE HOSTS;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_show_slave_running.test b/mysql-test/suite/rpl/t/rpl_show_slave_running.test
index 8578f1e5275..d8c86a2aeb1 100644
--- a/mysql-test/suite/rpl/t/rpl_show_slave_running.test
+++ b/mysql-test/suite/rpl/t/rpl_show_slave_running.test
@@ -80,3 +80,4 @@ connection slave;
eval set global debug= '$debug_saved';
SET DEBUG_SYNC= 'RESET';
--echo End of tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test
index 8d176ac0c3b..82d6e61a2cd 100644
--- a/mysql-test/suite/rpl/t/rpl_skip_error.test
+++ b/mysql-test/suite/rpl/t/rpl_skip_error.test
@@ -102,6 +102,8 @@ SET SQL_LOG_BIN=1;
connection slave;
+call mtr.add_suppression("Slave SQL.*Could not execute .*te_rows event on table test.t.; Duplicate entry.* Error_code: 1062");
+
CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
SHOW CREATE TABLE t1;
@@ -167,3 +169,4 @@ DROP TABLE t1;
DROP TABLE t2;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
index 1a0ff8d52f0..4fdc1268b80 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_grp_exec.test
@@ -62,7 +62,10 @@ SELECT * FROM t2 ORDER BY a;
SELECT * FROM t3 ORDER BY a;
--connection slave
---source include/wait_for_slave_sql_to_stop.inc
+# 1146 = ER_NO_SUCH_TABLE
+call mtr.add_suppression("Slave SQL.*Table .test.t3. doesn.t exist.* Error_code: 1146");
+--let $slave_sql_errno= 1146
+--source include/wait_for_slave_sql_error.inc
SHOW TABLES LIKE 't%';
if (`SELECT @@BINLOG_FORMAT = 'ROW'`) {
--replace_regex /AA/AA_for_row_or_XX_for_stmt_mixed/
@@ -77,7 +80,7 @@ if (!`SELECT @@BINLOG_FORMAT = 'ROW'`) {
SELECT * FROM t2 ORDER BY a;
}
---source include/stop_slave.inc
+--source include/stop_slave_io.inc
RENAME TABLE t3_bak TO t3;
--source include/start_slave.inc
@@ -107,7 +110,9 @@ INSERT INTO t1 VALUES(2, 'B');
UPDATE t1 SET b = 'X' WHERE a = 2;
--connection slave
---source include/wait_for_slave_sql_to_stop.inc
+# 1146 = ER_NO_SUCH_TABLE
+--let $slave_sql_errno= 1146
+--source include/wait_for_slave_sql_error.inc
--connection master
SELECT * FROM t1 ORDER BY a;
@@ -119,7 +124,7 @@ SHOW TABLES LIKE 't%';
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
---source include/stop_slave.inc
+--source include/stop_slave_io.inc
RENAME TABLE t3_bak TO t3;
--source include/start_slave.inc
@@ -151,7 +156,9 @@ INSERT INTO t3 VALUES (3, 'C'), (4, 'D');
COMMIT;
--connection slave
---source include/wait_for_slave_sql_to_stop.inc
+# 1146 = ER_NO_SUCH_TABLE
+--let $slave_sql_errno= 1146
+--source include/wait_for_slave_sql_error.inc
--connection master
SELECT * FROM t1 ORDER BY a;
@@ -163,7 +170,7 @@ SHOW TABLES LIKE 't%';
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
-source include/stop_slave.inc;
+source include/stop_slave_io.inc;
RENAME TABLE t3_bak TO t3;
source include/start_slave.inc;
@@ -174,3 +181,4 @@ DROP TABLE t1,t2,t3;
--sync_slave_with_master
# End of 5.1 test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_in.test b/mysql-test/suite/rpl/t/rpl_slave_load_in.test
index 54ebdffce69..80a27479ae2 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_load_in.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_in.test
@@ -31,12 +31,10 @@ commit;
##########################################################################
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
-let $diff_table_1=master:test.t2;
-let $diff_table_2=slave:test.t2;
+let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
##########################################################################
@@ -48,3 +46,4 @@ drop table t1;
drop table t2;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt
deleted file mode 100644
index 51e410f911f..00000000000
--- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-debug=d,remove_slave_load_file_before_write
diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
index 1cf88deb56f..36327e2354a 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
@@ -1,22 +1,37 @@
-##########################################################################
+# ==== Purpose ====
+#
# This test verifies if the slave fails gracefully when the temporary
-# file used to load data is removed while it is about to be used it.
+# file used to load data is removed while it is about to be used.
# Similar errors are caught if the temporary directory is removed.
#
+# ==== Implementation ====
+#
# Steps:
+# 0 - Set debug variable remove_slave_load_file_before_write. This
+# causes the slave to remove the file.
# 1 - Creates a table and populates it through "LOAD DATA INFILE".
# 2 - Catches error.
-##########################################################################
+#
+# ==== References ====
+#
+# BUG#42861: Assigning invalid directories to --slave-load-tmpdir crashes the slave
+# BUG#11872422: rpl_slave_load_remove_tmpfile fails sporadically in pb2
--source include/have_binlog_format_statement.inc
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/master-slave.inc
--source include/not_embedded.inc
+--source include/not_var_link.inc
##########################################################################
# Loading data
##########################################################################
+
+connection slave;
+--let $old_debug= `SELECT @@GLOBAL.DEBUG`
+SET @@GLOBAL.DEBUG = '+d,remove_slave_load_file_before_write';
+
connection master;
create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb;
@@ -31,19 +46,14 @@ commit;
# Catch Error
##########################################################################
connection slave;
-source include/wait_for_slave_sql_to_stop.inc;
---let $error= query_get_value(SHOW SLAVE STATUS, Last_Errno, 1)
# windows and linux different error numbers here:
# Windows:
# - Last_Errno 29 (File not found)
# Unix like OS:
# - Last_Errno 13 (Can't stat file)
---let $assertion= `SELECT $error=29 OR $error=13`
-if (!$assertion)
-{
- --echo UNEXPECTED ERROR NUMBER: $error
-}
+--let $slave_sql_errno= 29, 13
+--source include/wait_for_slave_sql_error.inc
##########################################################################
# Clean up
@@ -52,9 +62,19 @@ connection master;
drop table t1;
-connection slave;
+--source include/sync_slave_io_with_master.inc
+--source include/stop_slave_io.inc
+RESET SLAVE;
drop table t1;
call mtr.add_suppression("Slave: Can't get stat of .*");
+call mtr.add_suppression("Slave SQL: Error .Can.t get stat of.* Error_code: 13");
call mtr.add_suppression("Slave: File.* not found.*");
+call mtr.add_suppression("Slave SQL: Error .File.* not found.* Error_code: 29");
+--let $rpl_only_running_threads= 1
+
+eval SET @@GLOBAL.DEBUG = '$old_debug';
+
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-master.opt b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-master.opt
new file mode 100644
index 00000000000..cef79bc8585
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist-master.opt
@@ -0,0 +1 @@
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
index 68c41abf537..b99c71b1ca0 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test
@@ -5,20 +5,18 @@
--source include/have_log_bin.inc
--source include/not_embedded.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,);
+--let $rpl_skip_start_slave= 1
+--source include/master-slave.inc
-connection slave;
-
---replace_result $MASTER_MYPORT MASTER_MYPORT
-eval CHANGE MASTER TO MASTER_USER='root',
- MASTER_CONNECT_RETRY=1,
- MASTER_HOST='127.0.0.1',
- MASTER_PORT=$MASTER_MYPORT;
+--connection slave
START SLAVE;
+# Why 12???
+call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory.* Error_code: 12");
+--let $slave_sql_errno= 12
+source include/wait_for_slave_sql_error.inc;
+
+--source include/stop_slave_io.inc
+RESET SLAVE;
-source include/wait_for_slave_sql_to_stop.inc;
-let $errno=query_get_value("show slave status", Last_SQL_Errno, 1);
-echo $errno;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test
index 66762d4dad0..f2129bd7f18 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_skip.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test
@@ -309,3 +309,4 @@ connection master;
DROP TABLE t10;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slave_status.test b/mysql-test/suite/rpl/t/rpl_slave_status.test
index 02fd555d13c..0645b4267d6 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_status.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_status.test
@@ -56,15 +56,23 @@ START SLAVE;
source include/wait_for_slave_sql_to_start.inc;
source include/wait_for_slave_io_to_stop.inc;
---echo ==== Verify that Slave_IO_Running = No ====
-let $result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1);
---echo Slave_IO_Running = $result (should be No)
+--echo ==== Verify that Slave IO thread stopped with error ====
+# 1045 = ER_ACCESS_DENIED_ERROR
+--let $slave_io_errno= 1045
+--source include/wait_for_slave_io_error.inc
--echo ==== Cleanup (Note that slave IO thread is not running) ====
-DROP TABLE t1;
-# cleanup: slave io thread has been stopped "irrecoverably"
-# so we clean up mess manually
+
+# cleanup: slave io thread has is stopped so we reset replication
+--source include/stop_slave_sql.inc
+CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = '';
+# clear Slave_IO_Errno
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
--echo [on master]
connection master;
DROP TABLE t1;
+
+--source include/rpl_end.inc
+--source include/force_restart.inc
diff --git a/mysql-test/suite/rpl/t/rpl_slow_query_log.test b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
index 334c4393b83..faf037a9dff 100644
--- a/mysql-test/suite/rpl/t/rpl_slow_query_log.test
+++ b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
@@ -29,7 +29,7 @@ source include/master-slave.inc;
source include/have_binlog_format_statement.inc;
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
# Prepare slave for different long_query_time we need to stop the slave
# and restart it as long_query_time variable is dynamic and, after
@@ -196,7 +196,7 @@ disconnect extra2;
# BUG#50620: Adding an index to a table prevents slave from logging into slow log
#
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
SET @old_log_output= @@log_output;
@@ -233,7 +233,7 @@ let $master_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text
-- sync_slave_with_master
let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
-if (`SELECT $master_slow_query != $slave_slow_query`)
+if ($master_slow_query != $slave_slow_query)
{
-- connection master
-- echo ***********************************************
@@ -250,7 +250,7 @@ if (`SELECT $master_slow_query != $slave_slow_query`)
-- die "Assertion failed! Master and slave slow log contents differ. Bailing out!"
}
-if (`SELECT $master_slow_query = $slave_slow_query`)
+if ($master_slow_query == $slave_slow_query)
{
-- echo ### Assertion is good. Both Master and Slave exhibit the
-- echo ### same number of queries in slow log: $master_slow_query
@@ -276,7 +276,7 @@ let $master_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text
-- sync_slave_with_master
let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
-if (`SELECT $master_slow_query != $slave_slow_query`)
+if ($master_slow_query != $slave_slow_query)
{
-- connection master
-- echo ***********************************************
@@ -293,7 +293,7 @@ if (`SELECT $master_slow_query != $slave_slow_query`)
-- die "Assertion failed! Master and slave slow log contents differ. Bailing out!"
}
-if (`SELECT $master_slow_query = $slave_slow_query`)
+if ($master_slow_query == $slave_slow_query)
{
-- echo ### Assertion is good. Both Master and Slave exhibit the
-- echo ### same number of queries in slow log: $master_slow_query
@@ -307,3 +307,4 @@ DROP TABLE t1;
-- sync_slave_with_master
SET @@global.log_output= @old_log_output;
SET @@global.long_query_time= @old_long_query_time;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test
index b2e7418ce14..00815ab9d7e 100644
--- a/mysql-test/suite/rpl/t/rpl_sp.test
+++ b/mysql-test/suite/rpl/t/rpl_sp.test
@@ -692,13 +692,8 @@ drop function f1;
--echo #
--echo # Bug #11918 Can't use a declared variable in LIMIT clause
--echo #
---disable_warnings
-drop table if exists t1;
-drop procedure if exists p1;
---enable_warnings
-connection master;
--- source include/master-slave-reset.inc
-connection default;
+--source include/rpl_reset.inc
+
create table t1 (c1 int);
insert into t1 (c1) values
(1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
@@ -723,7 +718,7 @@ select * from t1;
sync_slave_with_master;
connection slave;
select * from t1;
-connection default;
+connection master;
--disable_warnings
call p1(-1);
--enable_warnings
@@ -731,7 +726,7 @@ select * from t1;
sync_slave_with_master;
connection slave;
select * from t1;
-connection default;
+connection master;
--echo # Cleanup
set @@session.binlog_format=@save_binlog_format;
@@ -743,3 +738,4 @@ drop procedure p1;
# Cleanup
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sp004.test b/mysql-test/suite/rpl/t/rpl_sp004.test
index 2f9b329eb66..31e4ce37df7 100644
--- a/mysql-test/suite/rpl/t/rpl_sp004.test
+++ b/mysql-test/suite/rpl/t/rpl_sp004.test
@@ -89,3 +89,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/sp004_master.sql $MYSQLTEST_VARDIR/tmp/sp004_sl
# End of 5.0 test case
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sp_effects.test b/mysql-test/suite/rpl/t/rpl_sp_effects.test
index 63ac3a8ad9c..df13ff253b1 100644
--- a/mysql-test/suite/rpl/t/rpl_sp_effects.test
+++ b/mysql-test/suite/rpl/t/rpl_sp_effects.test
@@ -261,3 +261,4 @@ SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creato
sync_slave_with_master;
--echo end of the tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_spec_variables.test b/mysql-test/suite/rpl/t/rpl_spec_variables.test
index a60738316c8..2cb580fce83 100644
--- a/mysql-test/suite/rpl/t/rpl_spec_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_spec_variables.test
@@ -304,3 +304,4 @@ SET @@global.storage_engine=@restore_slave_storage_engine;
call mtr.add_suppression("The table 't[12]' is full");
# End of 5.1 test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sporadic_master.test b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
index 6640544b0ed..592d13e67b0 100644
--- a/mysql-test/suite/rpl/t/rpl_sporadic_master.test
+++ b/mysql-test/suite/rpl/t/rpl_sporadic_master.test
@@ -1,6 +1,3 @@
-#############################################################
-# 2006-02-07 By JBM added order by
-#############################################################
# test to see if replication can continue when master sporadically fails on
# COM_BINLOG_DUMP and additionally limits the number of events per dump
@@ -13,10 +10,8 @@ truncate table t1;
# We have to use 4 in the following to make this test work with all table types
insert into t1 values (4),(NULL);
sync_slave_with_master;
-stop slave;
---source include/wait_for_slave_to_stop.inc
-start slave;
---source include/wait_for_slave_to_start.inc
+--source include/stop_slave.inc
+--source include/start_slave.inc
connection master;
insert into t1 values (NULL),(NULL);
flush logs;
@@ -28,4 +23,4 @@ connection master;
drop table t1,t2;
sync_slave_with_master;
-# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test
index 0f216983a32..43289428d45 100644
--- a/mysql-test/suite/rpl/t/rpl_ssl.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl.test
@@ -75,7 +75,7 @@ source include/check_slave_is_running.inc;
let $slave_count= `select count(*) from t1`;
-if (`select $slave_count != $master_count`)
+if ($slave_count != $master_count)
{
echo master and slave differed in number of rows;
echo master: $master_count;
@@ -97,4 +97,14 @@ drop user replssl@localhost;
drop table t1;
sync_slave_with_master;
+--source include/stop_slave.inc
+CHANGE MASTER TO
+ master_user = 'root',
+ master_ssl = 0,
+ master_ssl_ca = '',
+ master_ssl_cert = '',
+ master_ssl_key = '';
+
--echo End of 5.0 tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ssl1.test b/mysql-test/suite/rpl/t/rpl_ssl1.test
index 152f307fd31..f5f63a00033 100644
--- a/mysql-test/suite/rpl/t/rpl_ssl1.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl1.test
@@ -10,7 +10,6 @@ connection master;
grant replication slave on *.* to replssl@localhost require ssl;
create table t1 (t int);
-#syncing with master
sync_slave_with_master;
#trying to use this user without ssl
@@ -57,6 +56,7 @@ start slave;
connection master;
drop user replssl@localhost;
drop table t1;
+
sync_slave_with_master;
source include/show_slave_status.inc;
source include/check_slave_is_running.inc;
@@ -91,6 +91,19 @@ select * from t1;
source include/show_slave_status.inc;
--source include/check_slave_is_running.inc
+# ==== Clean up ====
+
connection master;
drop table t1;
sync_slave_with_master;
+--source include/stop_slave.inc
+CHANGE MASTER TO
+ master_host="127.0.0.1",
+ master_ssl_ca ='',
+ master_ssl_cert='',
+ master_ssl_key='',
+ master_ssl_verify_server_cert=0,
+ master_ssl=0;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_000001.test b/mysql-test/suite/rpl/t/rpl_stm_000001.test
index aee067b2d4a..268a10ad1fa 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_000001.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_000001.test
@@ -1,2 +1,128 @@
-let $engine_type=myisam;
--- source extra/rpl_tests/rpl_stm_000001.test
+# Requires binlog_format=statement format since query involving
+# get_lock() is logged in row format if binlog_format=mixed or row.
+-- source include/have_binlog_format_statement.inc
+-- source include/master-slave.inc
+
+CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--let $engine_type= myisam
+
+# Load some data into t1
+create table t1 (word char(20) not null);
+load data infile '../../std_data/words.dat' into table t1;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
+select * from t1 limit 10;
+
+#
+# Test slave with wrong password
+#
+sync_slave_with_master;
+stop slave;
+connection master;
+set password for root@"localhost" = password('foo');
+connection slave;
+start slave;
+connection master;
+#
+# Give slave time to do at last one failed connect retry
+# This one must be short so that the slave will not stop retrying
+real_sleep 2;
+set password for root@"localhost" = password('');
+# Give slave time to connect (will retry every second)
+sleep 2;
+
+create table t3(n int);
+insert into t3 values(1),(2);
+sync_slave_with_master;
+select * from t3;
+select sum(length(word)) from t1;
+connection master;
+drop table t1,t3;
+sync_slave_with_master;
+
+# Test if the slave SQL thread can be more than 16K behind the slave
+# I/O thread (> IO_SIZE)
+
+connection master;
+# we'll use table-level locking to delay slave SQL thread
+eval create table t1 (n int) engine=$engine_type;
+sync_slave_with_master;
+connection master;
+reset master;
+connection slave;
+stop slave;
+reset slave;
+
+connection master;
+let $1=5000;
+# Generate 16K of relay log
+disable_query_log;
+while ($1)
+{
+ eval insert into t1 values($1);
+ dec $1;
+}
+enable_query_log;
+
+# Try to cause a large relay log lag on the slave by locking t1
+connection slave;
+lock tables t1 read;
+start slave;
+connection master;
+--source include/sync_slave_io_with_master.inc
+unlock tables;
+
+#test handling of aborted connection in the middle of update
+
+connection master;
+create table t2(id int);
+insert into t2 values(connection_id());
+
+connection master1;
+# Avoid generating result
+create temporary table t3(n int);
+--disable_warnings
+insert into t3 select get_lock('crash_lock%20C', 1) from t2;
+--enable_warnings
+
+connection master;
+send update t1 set n = n + get_lock('crash_lock%20C', 2);
+connection master1;
+sleep 3;
+select (@id := id) - id from t2;
+kill @id;
+# We don't drop t3 as this is a temporary table
+drop table t2;
+connection master;
+# The get_lock function causes warning for unsafe statement.
+--disable_warnings
+--error 1317,2013
+reap;
+--enable_warnings
+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).
+# 1053 = ER_SERVER_SHUTDOWN
+--let $slave_sql_errno= 1053
+--source include/wait_for_slave_sql_error_and_skip.inc
+
+select count(*) from t1;
+connection master1;
+drop table t1;
+create table t1 (n int);
+insert into t1 values(3456);
+insert into mysql.user (Host, User, Password)
+ VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
+select select_priv,user from mysql.user where user = _binary'blafasel2';
+update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
+select select_priv,user from mysql.user where user = _binary'blafasel2';
+sync_slave_with_master;
+select n from t1;
+select select_priv,user from mysql.user where user = _binary'blafasel2';
+connection master1;
+drop table t1;
+delete from mysql.user where user="blafasel2";
+sync_slave_with_master;
+
+# End of 4.1 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test b/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test
index a996c6fac66..e8e20438d1d 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test
@@ -105,3 +105,4 @@ DROP FUNCTION IF EXISTS f1;
DROP TRIGGER IF EXISTS tr1;
enable_warnings;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size-master.opt b/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size-master.opt
deleted file mode 100644
index 45631525481..00000000000
--- a/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog_cache_size=4096 --max_binlog_cache_size=7680
diff --git a/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test
index 7e43b7a9e7d..352213304b6 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test
@@ -5,3 +5,4 @@
--source include/have_binlog_format_statement.inc
--source extra/rpl_tests/rpl_binlog_max_cache_size.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_conflicts.test b/mysql-test/suite/rpl/t/rpl_stm_conflicts.test
index 07b7a0bf8f7..cd9e71cbff9 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_conflicts.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_conflicts.test
@@ -1,11 +1,6 @@
-# See the top of mysql-test/extra/rpl_tests/rpl_conflicts.test for an
-# explanation of what this test does.
-#
-# This test file is for statement-logging mode.
-
source include/have_binlog_format_mixed_or_statement.inc;
source include/master-slave.inc;
source extra/rpl_tests/rpl_conflicts.test;
-source include/master-slave-end.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test
index b46da8a0150..6e3dabf6e32 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test
@@ -8,3 +8,4 @@
--source include/have_innodb.inc
--source extra/rpl_tests/rpl_drop_create_temp_table.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
index e24eb718c47..d8a3ad23b66 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test
@@ -3,6 +3,3 @@
let $rename_event_pos= 959;
-- source extra/rpl_tests/rpl_flsh_tbls.test
-
-# 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_stm_found_rows.test b/mysql-test/suite/rpl/t/rpl_stm_found_rows.test
index 2d8d480b910..1ec8f8a0424 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_found_rows.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_found_rows.test
@@ -119,7 +119,5 @@ DROP TABLE t1, logtbl;
DROP PROCEDURE just_log;
DROP PROCEDURE calc_and_log;
DROP FUNCTION log_rows;
-sync_slave_with_master;
-
-source include/reset_master_and_slave.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test
index f3a4b174ab3..ae59008c3ee 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test
@@ -8,3 +8,4 @@
--let $engine=Innodb
set session storage_engine=innodb;
--source extra/rpl_tests/rpl_implicit_commit_binlog.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_innodb.test b/mysql-test/suite/rpl/t/rpl_stm_innodb.test
index 5b3fef9c66b..cecf9ec7bcd 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_innodb.test
@@ -6,3 +6,4 @@ source include/have_innodb.inc;
source include/have_binlog_format_mixed_or_statement.inc;
source extra/rpl_tests/rpl_innodb.test;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test
index 3db3f7d9fcd..92d57625283 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test
@@ -2,7 +2,9 @@
--source include/master-slave.inc
--source include/not_embedded.inc
--source include/not_windows.inc
+
disable_query_log;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
enable_query_log;
--source extra/rpl_tests/rpl_insert_delayed.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_loadfile.test b/mysql-test/suite/rpl/t/rpl_stm_loadfile.test
index c27348ce987..5d2c85b2cb6 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_loadfile.test
@@ -22,3 +22,4 @@ enable_query_log;
-- source extra/rpl_tests/rpl_loadfile.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_log.test b/mysql-test/suite/rpl/t/rpl_stm_log.test
index 7bc17fbaada..7e7e1d4033f 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_log.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_log.test
@@ -7,3 +7,4 @@ let $engine_type=MyISAM;
# End of 4.1 tests
# Adding comment for force manual merge 5.0 -> wl1012: Delete me
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test b/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test
index 950aa8b322a..1a7139c889a 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test
@@ -6,6 +6,3 @@
# Requires statement logging
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/rpl_tests/rpl_max_relay_size.test
-
-# End of 4.1 tests
-#
diff --git a/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test b/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test
index 523e883d9fa..537d304687c 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test
@@ -16,3 +16,4 @@
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/rpl_tests/rpl_show_relaylog_events.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
index f32ab1f01f0..f13057a7d83 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test
@@ -13,7 +13,7 @@ let $engine_type=Innodb;
# BUG#49522: Replication problem with mixed MyISAM/InnoDB
#
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
CREATE TABLE `t1` (
@@ -37,12 +37,11 @@ SET AUTOCOMMIT=1;
-- sync_slave_with_master
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
DROP TABLE `t1`;
-- sync_slave_with_master
--- source include/master-slave-end.inc
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_multi_query.test b/mysql-test/suite/rpl/t/rpl_stm_multi_query.test
index c39d1fad015..e234f4b9622 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_multi_query.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_multi_query.test
@@ -3,10 +3,5 @@
# CLIENT_MULTI_STATEMENTS) will be binlogged ONE-query-per-event (not
# one binlog event containing all queries)
-# Requires statement logging
-- source include/have_binlog_format_mixed_or_statement.inc
-- source extra/rpl_tests/rpl_multi_query.test
-
-
-# End of 4.1 tests
-#
diff --git a/mysql-test/suite/rpl/t/rpl_stm_no_op.test b/mysql-test/suite/rpl/t/rpl_stm_no_op.test
index 66dc89bd712..1605b177ac4 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_no_op.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_no_op.test
@@ -91,3 +91,4 @@ select * from t2;
connection master;
drop table t1, t2;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test b/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test
index d5aac4a43e2..0eb41d1c6bd 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_sql_mode.test
@@ -22,3 +22,4 @@ DROP TABLE t1;
-- echo # duplicate key error (because it has received event
-- echo # with expected error code).
-- sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test
index 7701cd7aa06..ada080e9071 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test
@@ -5,5 +5,22 @@
--source include/have_binlog_format_statement.inc
--source include/have_innodb.inc
+# make innodb updates run fast
+--connection slave
+SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit;
+SET @@global.innodb_flush_log_at_trx_commit= 0;
+--connection master
+SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit;
+SET @@global.innodb_flush_log_at_trx_commit= 0;
+
SET @@session.binlog_direct_non_transactional_updates= FALSE;
--source ./extra/rpl_tests/rpl_start_stop_slave.test
+
+# clean up
+--connection slave
+SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit;
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+--connection master
+SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test b/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test
index dd3bf1a7f56..84d663298c4 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test
@@ -8,3 +8,4 @@
SET @@session.binlog_direct_non_transactional_updates= FALSE;
-- source extra/rpl_tests/rpl_stop_middle_group.test
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test
index 12782589b0d..4e9ccc2b0cf 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_until.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_until.test
@@ -72,7 +72,7 @@ select * from t1;
--let $slave_param_value= $master_log_pos_1
--source include/check_slave_param.inc
-let $relay_log_file= slave-relay-bin.000004;
+let $relay_log_file= slave-relay-bin.000003;
let $master_log_pos= $master_log_pos_2;
source include/get_relay_log_pos.inc;
# try replicate all up to and not including the second insert to t2;
@@ -195,24 +195,18 @@ sync_with_master;
# to substitute the genuine one with a prepared on 4.1 server.
#
---source include/master-slave-reset.inc
+--source include/rpl_reset.inc
connection master;
-drop table if exists t1; # there is create table t1 in bug47142_master-bin.000001
-sync_slave_with_master;
-connection slave;
-stop slave;
-connection master;
-
flush logs;
let $MYSQLD_DATADIR= `select @@datadir`;
--remove_file $MYSQLD_DATADIR/master-bin.000001
--copy_file $MYSQL_TEST_DIR/std_data/bug47142_master-bin.000001 $MYSQLD_DATADIR/master-bin.000001
# this a constant bound to the bug47142_master-bin.000001 binlog file
--let $binlog_before_drop=294;
-flush logs;
connection slave;
+stop slave;
reset slave;
--replace_regex /master_log_pos=[0-9]+/master_log_pos=MASTER_LOG_POS/
eval start slave until master_log_file='master-bin.000001', master_log_pos=$binlog_before_drop /* to stop right before DROP */;
@@ -224,9 +218,7 @@ show tables /* t1 must exist */;
drop table t1; # drop on slave only, master does not have t1.
stop slave;
-reset slave;
-
-connection master;
-reset master;
# End of tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_user_variables.test b/mysql-test/suite/rpl/t/rpl_stm_user_variables.test
index 05adc597776..2045dd6ae57 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_user_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_user_variables.test
@@ -43,8 +43,7 @@ CREATE TABLE t1 (`tinyint` TINYINT,
-- echo #########################################
-- connection master
-- echo ## assertion: master and slave tables are in sync
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables=master:t1,slave:t1
-- source include/diff_tables.inc
-- connection master
TRUNCATE t1;
@@ -74,8 +73,7 @@ INSERT INTO t1 VALUES (@positive,
-- echo #########################################
-- connection master
-- echo ## assertion: master and slave tables are in sync
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables=master:t1,slave:t1
-- source include/diff_tables.inc
-- connection master
TRUNCATE t1;
@@ -94,8 +92,7 @@ TRUNCATE t1;
-- echo #########################################
-- connection master
-- echo ## assertion: master and slave tables are in sync
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables=master:t1,slave:t1
-- source include/diff_tables.inc
-- connection master
TRUNCATE t1;
@@ -126,8 +123,7 @@ INSERT INTO t1 VALUES (@negative,
-- connection master
-- echo ## assertion: master and slave tables are in sync
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables=master:t1,slave:t1
-- source include/diff_tables.inc
-- connection master
TRUNCATE t1;
@@ -145,7 +141,7 @@ DROP TABLE t1;
# BUG#51426
#
#####################################################################
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
CREATE TABLE t1 ( c INT, PRIMARY KEY (c)) Engine=MyISAM;
@@ -162,8 +158,7 @@ INSERT INTO t1 VALUES (@aux) , (@aux1);
-- sync_slave_with_master
-- echo ## assertion: master and slave tables are in sync
--- let $diff_table_1=master:test.t1
--- let $diff_table_2=slave:test.t1
+-- let $diff_tables=master:t1,slave:t1
-- source include/diff_tables.inc
--connection master
@@ -172,3 +167,4 @@ DROP TABLE t1;
-- sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test
new file mode 100644
index 00000000000..296b002dbb7
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test
@@ -0,0 +1,119 @@
+source include/master-slave.inc;
+source include/have_innodb.inc;
+source include/have_debug.inc;
+source include/have_debug_sync.inc;
+source include/have_binlog_format_mixed_or_statement.inc;
+
+--echo
+--echo # BUG#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends
+--echo #
+--echo # If a temporary table is created or dropped, the transaction should be
+--echo # regarded similarly that a non-transactional table is modified. So
+--echo # STOP SLAVE should wait until the transaction has finished.
+
+CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
+CREATE TABLE t2(c1 INT) ENGINE=InnoDB;
+
+sync_slave_with_master;
+SET DEBUG_SYNC= 'RESET';
+source include/stop_slave.inc;
+
+--echo
+--echo # Suspend the INSERT statement in current transaction on SQL thread.
+--echo # It guarantees that SQL thread is applying the transaction when
+--echo # STOP SLAVE command launchs.
+let $debug_save= `SELECT @@GLOBAL.debug`;
+SET GLOBAL debug= 'd,after_mysql_insert';
+source include/start_slave.inc;
+
+--echo
+--echo # CREATE TEMPORARY TABLE with InnoDB engine
+--echo # -----------------------------------------
+let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB;
+source extra/rpl_tests/rpl_stop_slave.test;
+
+--echo
+--echo # CREATE TEMPORARY TABLE ... SELECT with InnoDB engine
+--echo # ----------------------------------------------------
+let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB
+ SELECT c1 FROM t2;
+source extra/rpl_tests/rpl_stop_slave.test;
+
+# Don't need to verify 'CREATE TEMPORARY TABLE' with MyIASM engine, as it
+# never is binlogged into a transaction since 5.5.
+
+--echo
+--echo # Test end
+SET GLOBAL debug= '$debug_save';
+source include/restart_slave_sql.inc;
+
+connection slave;
+call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+connection master;
+
+--source include/rpl_connection_master.inc
+DROP TABLE t1, t2;
+
+--echo
+--echo # Bug#58546 test rpl_packet timeout failure sporadically on PB
+--echo # ----------------------------------------------------------------------
+--echo # STOP SLAVE stopped IO thread first and then stopped SQL thread. It was
+--echo # possible that IO thread stopped after replicating part of a transaction
+--echo # which SQL thread was executing. SQL thread would be hung if the
+--echo # transaction could not be rolled back safely.
+--echo # It caused some sporadic failures on PB2.
+--echo #
+--echo # This test verifies that when 'STOP SLAVE' is issued by a user, IO
+--echo # thread will continue to fetch the rest events of the transaction which
+--echo # is being executed by SQL thread and is not able to be rolled back safely.
+
+CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(1, 1);
+
+sync_slave_with_master;
+
+--source include/rpl_connection_master.inc
+
+let $debug_save= `SELECT @@GLOBAL.debug`;
+SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid';
+
+--source include/rpl_connection_slave.inc
+source include/restart_slave_sql.inc;
+
+BEGIN;
+UPDATE t1 SET c2 = 2 WHERE c1 = 1;
+
+--source include/rpl_connection_master.inc
+BEGIN;
+INSERT INTO t1 VALUES(2, 2);
+INSERT INTO t2 VALUES(1);
+UPDATE t1 SET c2 = 3 WHERE c1 = 1;
+COMMIT;
+
+--source include/rpl_connection_slave1.inc
+let $show_statement= SHOW PROCESSLIST;
+let $field= Info;
+let $condition= = 'UPDATE t1 SET c2 = 3 WHERE c1 = 1';
+source include/wait_show_condition.inc;
+
+send STOP SLAVE;
+
+--source include/rpl_connection_slave.inc
+ROLLBACK;
+
+--source include/rpl_connection_master.inc
+SET DEBUG_SYNC= 'now SIGNAL signal.continue';
+SET DEBUG_SYNC= 'RESET';
+
+--source include/rpl_connection_slave.inc
+source include/wait_for_slave_to_stop.inc;
+
+--source include/rpl_connection_slave1.inc
+reap;
+source include/start_slave.inc;
+
+--source include/rpl_connection_master.inc
+DROP TABLE t1, t2;
+SET GLOBAL debug= $debug_save;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
index 63efcbeec04..6dab08ac503 100644
--- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
+++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
@@ -621,3 +621,4 @@ sync_slave_with_master;
connection master;
# Restore binlog format setting
set global binlog_format =@my_binlog_format;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_sync-slave.opt b/mysql-test/suite/rpl/t/rpl_sync-slave.opt
index fba451a5b3e..3816e61bb1e 100644
--- a/mysql-test/suite/rpl/t/rpl_sync-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_sync-slave.opt
@@ -1 +1,2 @@
--sync-relay-log-info=1 --relay-log-recovery=1 --innodb_file_format_check=1 --default-storage-engine=MyISAM --innodb-file-per-table=0
+--skip-core-file
diff --git a/mysql-test/suite/rpl/t/rpl_sync.test b/mysql-test/suite/rpl/t/rpl_sync.test
index 48c8dc02efb..e1750be0ff6 100644
--- a/mysql-test/suite/rpl/t/rpl_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_sync.test
@@ -31,6 +31,7 @@
--source include/not_valgrind.inc
--source include/have_debug.inc
--source include/have_innodb.inc
+--source include/not_crashrep.inc
call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001");
@@ -50,8 +51,7 @@ connection slave;
let $MYSQLD_SLAVE_DATADIR= `select @@datadir`;
--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
--copy_file $MYSQLD_SLAVE_DATADIR/master.info $MYSQLD_SLAVE_DATADIR/master.backup
-stop slave SQL_THREAD;
-source include/wait_for_slave_sql_to_stop.inc;
+--source include/stop_slave_sql.inc
connection master;
insert into t1(a) values(4);
@@ -60,8 +60,7 @@ insert into t1(a) values(6);
--echo =====Removing relay log files and crashing/recoverying the slave=======;
connection slave;
-stop slave IO_THREAD;
-source include/wait_for_slave_io_to_stop.inc;
+--source include/stop_slave_io.inc
let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1);
@@ -79,18 +78,16 @@ SET SESSION debug="d,crash_before_rotate_relaylog";
--error 2013
FLUSH LOGS;
---enable_reconnect
---source include/wait_until_connected_again.inc
+--let $rpl_server_number= 2
+--source include/rpl_reconnect.inc
--echo =====Dumping and comparing tables=======;
-start slave;
-source include/wait_for_slave_to_start.inc;
+--source include/start_slave.inc
connection master;
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables=master:t1,slave:t1;
source include/diff_tables.inc;
########################################################################################
@@ -98,8 +95,7 @@ source include/diff_tables.inc;
########################################################################################
--echo =====Corrupting the master.info=======;
connection slave;
-stop slave;
-source include/wait_for_slave_to_stop.inc;
+--source include/stop_slave.inc
connection master;
FLUSH LOGS;
@@ -130,18 +126,16 @@ SET SESSION debug="d,crash_before_rotate_relaylog";
--error 2013
FLUSH LOGS;
---enable_reconnect
---source include/wait_until_connected_again.inc
+--let $rpl_server_number= 2
+--source include/rpl_reconnect.inc
--echo =====Dumping and comparing tables=======;
-start slave;
-source include/wait_for_slave_to_start.inc;
+--source include/start_slave.inc
connection master;
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables=master:t1,slave:t1;
source include/diff_tables.inc;
########################################################################################
@@ -150,3 +144,7 @@ source include/diff_tables.inc;
--echo =====Clean up=======;
connection master;
drop table t1;
+
+--remove_file $MYSQLD_SLAVE_DATADIR/master.backup
+--source include/rpl_end.inc
+
diff --git a/mysql-test/suite/rpl/t/rpl_temp_table.test b/mysql-test/suite/rpl/t/rpl_temp_table.test
index 62c3633b7b2..92f8cef9c10 100644
--- a/mysql-test/suite/rpl/t/rpl_temp_table.test
+++ b/mysql-test/suite/rpl/t/rpl_temp_table.test
@@ -64,3 +64,6 @@ connect (master2,localhost,root,,);
connection master2;
drop table if exists t1,t2;
sync_slave_with_master;
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
index e19c3019aa1..63f0b6c2234 100644
--- a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
+++ b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
@@ -11,6 +11,7 @@
source include/master-slave.inc;
source include/have_binlog_format_mixed.inc;
+source include/have_innodb.inc;
--echo ==== Initialize ====
@@ -31,6 +32,7 @@ SHOW STATUS LIKE "Slave_open_temp_tables";
--connection master
disconnect master;
+--echo [on master1]
--connection master1
# waiting DROP TEMPORARY TABLE event to be written into binlog
@@ -46,7 +48,10 @@ SHOW STATUS LIKE "Slave_open_temp_tables";
--echo ==== Clean up ====
--echo [on master]
---connection master1
+--let $rpl_connection_name= master
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
+--connection master
DROP TABLE t1;
--echo [on slave]
@@ -88,8 +93,7 @@ sync_slave_with_master;
# 10. in the end the slave should not have open temp tables.
#
-connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
--- source include/master-slave-reset.inc
+--source include/rpl_reset.inc
-- connection master
# action: setup environment
@@ -146,3 +150,61 @@ DROP TABLE t3, t1;
-- sync_slave_with_master
-- source include/show_binlog_events.inc
+
+--echo
+--echo # Bug#55478 Row events wrongly apply on the temporary table of the same name
+--echo # ==========================================================================
+connection master;
+
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo # The statement should be binlogged
+CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=InnoDB;
+
+--echo
+--echo # Case 1: CREATE TABLE t1 ... SELECT
+--echo # ----------------------------------
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # The statement generates row events on t1. And the rows events should
+--echo # be inserted into the base table on slave.
+CREATE TABLE t1 ENGINE=MyISAM SELECT rand();
+
+source include/show_binlog_events.inc;
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--echo
+--echo # Case 2: DROP TEMPORARY TABLE in a transacation
+--echo # ----------------------------------------------
+--echo
+
+BEGIN;
+DROP TEMPORARY TABLE t1;
+
+# The patch for BUG#55478 fixed the problem only on RBR. The problem on SBR
+# will be fixed by the patch for bug#55709. So This statement cannot be
+# executed until Bug#55709 is fixed
+#
+# INSERT INTO t1 VALUES(1);
+
+--echo # The rows event will binlogged before 'DROP TEMPORARY TABLE t1',
+--echo # as t1 is non-transactional table
+INSERT INTO t1 VALUES(Rand());
+COMMIT;
+
+source include/show_binlog_events.inc;
+
+--sync_slave_with_master
+
+--echo # Compare the base table.
+--let $diff_tables= master:t1, slave:t1
+--source include/diff_tables.inc
+
+--echo
+connection master;
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_temporary.test b/mysql-test/suite/rpl/t/rpl_temporary.test
index 7a66a55d510..878589ef006 100644
--- a/mysql-test/suite/rpl/t/rpl_temporary.test
+++ b/mysql-test/suite/rpl/t/rpl_temporary.test
@@ -313,12 +313,15 @@ select * from t1;
connection master;
drop table t1;
--remove_file $MYSQLTEST_VARDIR/tmp/bug14157.sql
+--sync_slave_with_master
-# Delete the anonymous users
-SET sql_log_bin = 0;
+# Delete the anonymous users.
+--source include/stop_slave.inc
source include/delete_anonymous_users.inc;
-SET sql_log_bin = 1;
-
+--connection master
+source include/delete_anonymous_users.inc;
+--let $rpl_only_running_threads= 1
+--source include/rpl_reset.inc
#
@@ -350,9 +353,7 @@ connection slave;
DROP USER user43748@127.0.0.1;
---echo -- done. back to master.
-connection master;
-
-
--echo End of 5.1 tests
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt b/mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt
index 80c171170f6..b37427aa2cd 100644
--- a/mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt
@@ -1,3 +1,2 @@
--loose-debug="+d,all_errors_are_temporary_errors" --slave-transaction-retries=2
-
-
+--force-restart
diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors.test b/mysql-test/suite/rpl/t/rpl_temporary_errors.test
index f05cf73c6ed..07b23e10847 100644
--- a/mysql-test/suite/rpl/t/rpl_temporary_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_temporary_errors.test
@@ -26,8 +26,12 @@ set @@global.slave_exec_mode= default;
SHOW STATUS LIKE 'Slave_retried_transactions';
SELECT * FROM t1;
source include/check_slave_is_running.inc;
-DROP TABLE t1;
+
+connection slave;
+call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1");
--echo **** On Master ****
connection master;
DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_test_framework.cnf b/mysql-test/suite/rpl/t/rpl_test_framework.cnf
new file mode 100644
index 00000000000..8934d1c9ae1
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_test_framework.cnf
@@ -0,0 +1,46 @@
+!include ../my.cnf
+[mysqld.1]
+log-slave-updates
+[mysqld.2]
+log-slave-updates
+[mysqld.3]
+log-slave-updates
+[mysqld.4]
+log-slave-updates
+[mysqld.5]
+log-slave-updates
+[mysqld.6]
+log-slave-updates
+[mysqld.7]
+log-slave-updates
+[mysqld.8]
+log-slave-updates
+[mysqld.9]
+log-slave-updates
+#[mysqld.10]
+#log-slave-updates
+#[mysqld.11]
+#log-slave-updates
+#[mysqld.12]
+#log-slave-updates
+#[mysqld.13]
+#log-slave-updates
+#[mysqld.14]
+#log-slave-updates
+#[mysqld.15]
+#log-slave-updates
+
+[ENV]
+SERVER_MYPORT_3= @mysqld.3.port
+SERVER_MYPORT_4= @mysqld.4.port
+SERVER_MYPORT_5= @mysqld.5.port
+SERVER_MYPORT_6= @mysqld.6.port
+SERVER_MYPORT_7= @mysqld.7.port
+SERVER_MYPORT_8= @mysqld.8.port
+SERVER_MYPORT_9= @mysqld.9.port
+#SERVER_MYPORT_10= @mysqld.10.port
+#SERVER_MYPORT_11= @mysqld.11.port
+#SERVER_MYPORT_12= @mysqld.12.port
+#SERVER_MYPORT_13= @mysqld.13.port
+#SERVER_MYPORT_14= @mysqld.14.port
+#SERVER_MYPORT_15= @mysqld.15.port
diff --git a/mysql-test/suite/rpl/t/rpl_test_framework.test b/mysql-test/suite/rpl/t/rpl_test_framework.test
new file mode 100644
index 00000000000..e0f961caff1
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_test_framework.test
@@ -0,0 +1,143 @@
+# ==== Purpose ====
+#
+# Test that the sync chain generated by
+# include/rpl_change_topology.inc (sourced from include/rpl_init.inc)
+# is correct.
+#
+# We test a number of different topologies. Each topology is tested
+# in extra/rpl_tests/rpl_test_framework.inc. See
+# extra/rpl_tests/rpl_test_framework.inc for details on how the sync
+# chain is tested.
+#
+# ==== Related bugs ====
+#
+# BUG#49978: Replication tests don't clean up replication state at the end
+
+
+# We only need to execute this test once. Also, we rely on 'DELETE
+# FROM t1' to remove rows in slave tables that don't exist in master
+# tables (see include/rpl_test_framework.inc for details).
+--source include/have_binlog_format_statement.inc
+
+
+--echo ==== Create t1 on all servers. ====
+if ($mtr_supports_more_than_10_servers)
+{
+ --let $rpl_server_count= 15
+ --let $rpl_topology= 1->2->3->4->5->6->7->8->9->10->11->12->13->14->15
+}
+if (!$mtr_supports_more_than_10_servers)
+{
+ --let $rpl_server_count= 9
+ --let $rpl_topology= 1->2->3->4->5->6->7->8->9
+}
+--source include/rpl_init.inc
+CREATE TABLE t1 (a INT);
+--source include/rpl_end.inc
+
+# Initialize $next_number before first call to
+# extra/rpl_tests/rpl_test_framework.text
+--let $next_number= 0
+
+
+--echo ==== Test 3-server topologies ====
+
+--let $rpl_server_count= 3
+
+--let $rpl_topology= 1 -> 2
+--let $masters= 1,3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 2 -> 3
+--let $masters= 1,2
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= none
+--let $masters= 1,2,3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 1->2, 2->1
+--let $masters= 1,3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 1->2->1
+--let $masters= 2,3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 2->1->2
+--let $masters= 1,3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 1->2->3
+--let $masters= 1
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 2->3->2->1
+--let $masters= 3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 1->2,2->3,3->1
+--let $masters= 3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 1->3->2->1
+--let $masters= 3
+--source extra/rpl_tests/rpl_test_framework.inc
+
+
+--echo ==== Test 6-server topologies ====
+
+--let $rpl_server_count= 6
+
+--let $rpl_topology= 1->2->3->4->1->5->6
+--let $masters= 1
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 3->4->5->6->3->1->2
+--let $masters= 4
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 6->5->4->3->2->1
+--let $masters= 6
+--source extra/rpl_tests/rpl_test_framework.inc
+
+--let $rpl_topology= 1->2->3->1,4->5->6
+--let $masters= 3,4
+--source extra/rpl_tests/rpl_test_framework.inc
+
+
+--echo ==== Test 9-server topology ====
+
+--let $rpl_server_count= 9
+
+--let $rpl_topology= 1->2, 2->3, 3->4, 4->5, 5->1, 1->6, 6->7, 6->8, 8->9
+--let $masters= 2
+--source extra/rpl_tests/rpl_test_framework.inc
+
+if ($mtr_supports_more_than_10_servers) {
+--echo ==== Test 15-server topologies ====
+
+--let $rpl_server_count= 15
+
+--let $rpl_topology= 1->2->3->4->5->6->7->8->9->10->11->12->13->14->15->1
+--let $masters= 2
+--source extra/rpl_tests/rpl_test_framework.inc
+
+# This is a binary tree
+--let $rpl_topology= 1->2->4->8,1->3->6->12,2->5->10,3->7->14,4->9,5->11,6->13,7->15
+--let $masters= 1
+--source extra/rpl_tests/rpl_test_framework.inc
+}
+
+--echo ==== Clean up ====
+
+if ($mtr_supports_more_than_10_servers) {
+ --let $rpl_topology= 1->2->3->4->5->6->7->8->9->10->11->12->13->14->15
+}
+if (!$mtr_supports_more_than_10_servers) {
+ --let $rpl_topology= 1->2->3->4->5->6->7->8->9
+}
+--source include/rpl_init.inc
+--connection server_1
+DROP TABLE t1;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_timezone.test b/mysql-test/suite/rpl/t/rpl_timezone.test
index 1b380062dd7..7355106b6b4 100644
--- a/mysql-test/suite/rpl/t/rpl_timezone.test
+++ b/mysql-test/suite/rpl/t/rpl_timezone.test
@@ -168,6 +168,8 @@ SET @@session.time_zone = default;
connection master;
DROP TABLE t1;
SET @@session.time_zone = default;
+--sync_slave_with_master
+--source include/stop_slave.inc
# Bug#41719 delayed INSERT into timestamp col needs set time_zone for concurrent binlogging
# To test that time_zone is correctly binloging for 'insert delayed' statement
@@ -200,4 +202,7 @@ select * from t1 order by a;
DROP TABLE t1;
SET @@session.time_zone = default;
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
+
--echo End of 5.0 tests
diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
index b30548d0e45..aa22b23925c 100644
--- a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
+++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
@@ -20,6 +20,7 @@ sync_slave_with_master;
# to stop.
#
+--connection master
--disable_abort_on_error
CREATE TABLE t1 (a CHAR(30));
@@ -155,5 +156,4 @@ DROP PROCEDURE p2;
DROP EVENT e2;
DROP TABLE t1, t2;
---source include/master-slave-end.inc
-
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test
index 5642b865e6e..e2974a21bf7 100644
--- a/mysql-test/suite/rpl/t/rpl_trigger.test
+++ b/mysql-test/suite/rpl/t/rpl_trigger.test
@@ -319,24 +319,19 @@ let $MYSQLD_DATADIR= `select @@datadir`;
FLUSH LOGS;
# Stop master server
---echo --> Stop master server
---write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-wait
-EOF
---shutdown_server 10
---source include/wait_until_disconnected.inc
+--let $rpl_server_number= 1
+--source include/rpl_stop_server.inc
+
# Replace binlog
remove_file $MYSQLD_DATADIR/master-bin.000001;
copy_file $MYSQL_TEST_DIR/std_data/bug16266.000001 $MYSQLD_DATADIR/master-bin.000001;
-
---echo --> Start master server
---append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-restart
-EOF
---enable_reconnect
---source include/wait_until_connected_again.inc
+
+--let $rpl_server_number= 1
+--source include/rpl_start_server.inc
+
let $binlog_version= query_get_value(SHOW BINLOG EVENTS, Info, 1);
+
# Make the slave to replay the new binlog.
--echo --> Master binlog: $binlog_version
@@ -512,7 +507,8 @@ sync_slave_with_master;
#
connection master;
-source include/master-slave-reset.inc;
+--source include/rpl_reset.inc
+
connection slave;
connection master;
@@ -529,12 +525,10 @@ insert into t1 values ( 1 );
rollback;
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
--source include/diff_tables.inc
-let $diff_table_1=master:test.log;
-let $diff_table_2=slave:test.log;
+let $diff_tables= master:log, slave:log;
--source include/diff_tables.inc
connection master;
@@ -544,3 +538,4 @@ sync_slave_with_master;
#
# End of tests
#
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_trunc_temp.test b/mysql-test/suite/rpl/t/rpl_trunc_temp.test
index 88ecb7c18b0..0e7d5483f62 100644
--- a/mysql-test/suite/rpl/t/rpl_trunc_temp.test
+++ b/mysql-test/suite/rpl/t/rpl_trunc_temp.test
@@ -52,3 +52,6 @@ let $wait_binlog_event= DROP;
source include/wait_for_binlog_event.inc;
show status like 'Slave_open_temp_tables';
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test b/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
index a0f0ea04f44..bea6332963e 100644
--- a/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test
@@ -1,4 +1,3 @@
--source include/not_ndb_default.inc
let $engine=MyISAM;
--source extra/rpl_tests/rpl_truncate.test
-
diff --git a/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test b/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
index a31fd62a29a..093cf56a316 100644
--- a/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test
@@ -1,6 +1,4 @@
-
--source include/have_innodb.inc
--source include/not_ndb_default.inc
-
let $engine=InnoDB;
--source extra/rpl_tests/rpl_truncate.test
diff --git a/mysql-test/suite/rpl/t/rpl_typeconv-master.opt b/mysql-test/suite/rpl/t/rpl_typeconv-master.opt
new file mode 100644
index 00000000000..de048691031
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_typeconv-master.opt
@@ -0,0 +1 @@
+--testcase-timeout=40
diff --git a/mysql-test/suite/rpl/t/rpl_typeconv.test b/mysql-test/suite/rpl/t/rpl_typeconv.test
index 2a6a3f3b33d..efcbe97049f 100644
--- a/mysql-test/suite/rpl/t/rpl_typeconv.test
+++ b/mysql-test/suite/rpl/t/rpl_typeconv.test
@@ -61,9 +61,12 @@ SELECT RPAD(Source, 15, ' ') AS Source_Type,
enable_query_log;
DROP TABLE type_conversions;
+call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* Error_code: 1677");
+
connection master;
DROP TABLE t1;
sync_slave_with_master;
set global slave_type_conversions = @saved_slave_type_conversions;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test b/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
index 729a622348f..ba2172106b6 100644
--- a/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
+++ b/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
@@ -6,8 +6,6 @@
# BUG#49618: Field length stored incorrectly in binary log for InnoDB
#
-source include/reset_master_and_slave.inc;
-
connection slave;
SET @saved_slave_type_conversions = @@GLOBAL.SLAVE_TYPE_CONVERSIONS;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = '';
@@ -17,13 +15,12 @@ CREATE TABLE t1(b1 BIT(1), b2 BIT(2), b3 BIT(3)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (b'0', b'01', b'101');
sync_slave_with_master;
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
+let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;
DROP TABLE t1;
sync_slave_with_master;
-connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_udf.test b/mysql-test/suite/rpl/t/rpl_udf.test
index b52fea144ba..8643654f2a1 100644
--- a/mysql-test/suite/rpl/t/rpl_udf.test
+++ b/mysql-test/suite/rpl/t/rpl_udf.test
@@ -13,3 +13,5 @@ enable_query_log;
let $engine_type= MyISAM;
--source include/rpl_udf.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_user.test b/mysql-test/suite/rpl/t/rpl_user.test
index b8fe41d03c4..caa17b47733 100644
--- a/mysql-test/suite/rpl/t/rpl_user.test
+++ b/mysql-test/suite/rpl/t/rpl_user.test
@@ -59,3 +59,4 @@ select Host,User from mysql.user where Host='fakehost';
#
connection master;
source include/show_binlog_events.inc;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_user_variables.test b/mysql-test/suite/rpl/t/rpl_user_variables.test
index 915bcb9ae65..dd6ddf39580 100644
--- a/mysql-test/suite/rpl/t/rpl_user_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_user_variables.test
@@ -381,4 +381,5 @@ DROP FUNCTION f2;
DROP TABLE t1;
sync_slave_with_master;
-stop slave;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_variables.test b/mysql-test/suite/rpl/t/rpl_variables.test
index 6c3b3ab6d8a..c3a6f6e273e 100644
--- a/mysql-test/suite/rpl/t/rpl_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_variables.test
@@ -109,14 +109,11 @@ SET @user_text = 'Alunda';
# Stop slave so that we get a fresh sql thread, reading the slave's
# global values of variables into its local copies.
---echo [on master]
-connection master;
-source include/reset_master_and_slave.inc;
+--source include/stop_slave.inc
+--source include/start_slave.inc
# We would have wanted to set this together with the other variables
# above, but can't because it affects how the slave works.
---echo [on slave]
-connection slave;
SET @@global.init_slave = 'SELECT 1';
@@ -674,35 +671,19 @@ EXECUTE p49; EXECUTE p50; EXECUTE p51; EXECUTE p52; EXECUTE p53; EXECUTE p54;
EXECUTE p55; EXECUTE p56; EXECUTE p57; EXECUTE p58; EXECUTE p59; EXECUTE p60;
EXECUTE p61; EXECUTE p62; EXECUTE p63; EXECUTE p64;
+--sync_slave_with_master
+--connection master
+
--echo ==== Results ====
# Show the result in table test.tstmt on master...
SELECT * FROM tstmt ORDER BY id;
-let $diff_table_1=master:test.tstmt;
-# ... then compare test.tstmt on master to the other tables on master...
-let $diff_table_2=master:test.tproc;
-source include/diff_tables.inc;
-let $diff_table_2=master:test.tfunc;
-source include/diff_tables.inc;
-let $diff_table_2=master:test.ttrig;
-source include/diff_tables.inc;
-let $diff_table_2=master:test.tprep;
-source include/diff_tables.inc;
+--sync_slave_with_master
-# ... and to all tables on slave.
-connection master;
-sync_slave_with_master;
-let $diff_table_2=slave:test.tstmt;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.tproc;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.tfunc;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.ttrig;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.tprep;
+# ... then compare test.tstmt on master to the other tables on master and slave.
+let $diff_tables= master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep;
source include/diff_tables.inc;
@@ -737,3 +718,4 @@ SET @@global.sync_binlog= @s_sync_binlog;
connection master;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_variables_stm.test b/mysql-test/suite/rpl/t/rpl_variables_stm.test
index 9e9bff03830..8943585bc1d 100644
--- a/mysql-test/suite/rpl/t/rpl_variables_stm.test
+++ b/mysql-test/suite/rpl/t/rpl_variables_stm.test
@@ -571,34 +571,19 @@ EXECUTE p49; EXECUTE p50; EXECUTE p51; EXECUTE p52; EXECUTE p53; EXECUTE p54;
EXECUTE p55; EXECUTE p56; EXECUTE p57; EXECUTE p58; EXECUTE p59; EXECUTE p60;
EXECUTE p61; EXECUTE p62; EXECUTE p63; EXECUTE p64;
+--sync_slave_with_master
+--connection master
+
--echo ==== Results ====
# Show the result in table test.tstmt on master...
SELECT * FROM tstmt ORDER BY id;
-let $diff_table_1=master:test.tstmt;
-# ... then compare test.tstmt on master to the other tables on master...
-let $diff_table_2=master:test.tproc;
-source include/diff_tables.inc;
-let $diff_table_2=master:test.tfunc;
-source include/diff_tables.inc;
-let $diff_table_2=master:test.ttrig;
-source include/diff_tables.inc;
-let $diff_table_2=master:test.tprep;
-source include/diff_tables.inc;
+--sync_slave_with_master
-# ... and to all tables on slave.
-sync_slave_with_master;
-let $diff_table_2=slave:test.tstmt;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.tproc;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.tfunc;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.ttrig;
-source include/diff_tables.inc;
-let $diff_table_2=slave:test.tprep;
+# ... then compare test.tstmt on master to the other tables on master and slave.
+let $diff_tables= master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep;
source include/diff_tables.inc;
@@ -633,3 +618,4 @@ SET @@global.collation_database= @s_collation_database;
connection master;
sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_view.test b/mysql-test/suite/rpl/t/rpl_view.test
index 01b4dc5ef55..3f0052cd544 100644
--- a/mysql-test/suite/rpl/t/rpl_view.test
+++ b/mysql-test/suite/rpl/t/rpl_view.test
@@ -177,3 +177,4 @@ DROP TABLE t1;
sync_slave_with_master;
--echo End of 5.0 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_view_multi.test b/mysql-test/suite/rpl/t/rpl_view_multi.test
index 5b3e7cf76f8..22509f8e4fc 100644
--- a/mysql-test/suite/rpl/t/rpl_view_multi.test
+++ b/mysql-test/suite/rpl/t/rpl_view_multi.test
@@ -143,3 +143,4 @@ drop table t1, t2;
drop view v1;
--echo # Syncing slave with master and switching to connection 'slave'
--sync_slave_with_master
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl_ndb/combinations b/mysql-test/suite/rpl_ndb/combinations
deleted file mode 100644
index 75712d234e1..00000000000
--- a/mysql-test/suite/rpl_ndb/combinations
+++ /dev/null
@@ -1,5 +0,0 @@
-[row]
-binlog-format=row
-
-[mix]
-binlog-format=mixed
diff --git a/mysql-test/suite/rpl_ndb/my.cnf b/mysql-test/suite/rpl_ndb/my.cnf
deleted file mode 100644
index 0c62988b220..00000000000
--- a/mysql-test/suite/rpl_ndb/my.cnf
+++ /dev/null
@@ -1,70 +0,0 @@
-!include include/default_mysqld.cnf
-!include include/default_ndbd.cnf
-!include include/default_client.cnf
-
-[cluster_config.1]
-NoOfReplicas= 2
-ndbd=,
-ndb_mgmd=
-mysqld=,
-
-[cluster_config.slave]
-NoOfReplicas= 1
-ndbd=
-ndb_mgmd=
-mysqld=
-
-[mysqld]
-# Make all mysqlds use cluster
-ndbcluster
-# Turn on bin logging
-log-bin= master-bin
-# Cluster only supports row format
-binlog-format= row
-
-[mysqld.1.1]
-
-[mysqld.1.1]
-
-[mysqld.1.slave]
-
-# Append <testname>-slave.opt file to the list of argument used when
-# starting the mysqld
-#!use-slave-opt
-
-log-bin= slave-bin
-relay-log= slave-relay-bin
-# Cluster only supports row format
-binlog-format= row
-
-init-rpl-role= slave
-log-slave-updates
-master-retry-count= 10
-
-# Values reported by slave when it connect to master
-# and shows up in SHOW SLAVE STATUS;
-report-host= 127.0.0.1
-report-port= @mysqld.1.slave.port
-report-user= root
-
-loose-skip-innodb
-skip-slave-start
-
-# Directory where slaves find the dumps generated by "load data"
-# on the server. The path need to have constant length otherwise
-# test results will vary, thus a relative path is used.
-slave-load-tmpdir= ../../../tmp
-
-rpl-recovery-rank= @mysqld.1.slave.server-id
-
-
-[ENV]
-NDB_CONNECTSTRING= @mysql_cluster.1.ndb_connectstring
-MASTER_MYPORT= @mysqld.1.1.port
-MASTER_MYPORT1= @mysqld.2.1.port
-
-NDB_CONNECTSTRING_SLAVE= @mysql_cluster.slave.ndb_connectstring
-SLAVE_MYPORT= @mysqld.1.slave.port
-SLAVE_MYSOCK= @mysqld.1.slave.socket
-
-NDB_BACKUP_DIR= @cluster_config.ndbd.1.1.BackupDataDir
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result
deleted file mode 100644
index b4e6c7c77b5..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result
+++ /dev/null
@@ -1,928 +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 @@global.slave_exec_mode= 'IDEMPOTENT';
-CREATE TABLE mysql.ndb_apply_status
-( server_id INT UNSIGNED NOT NULL,
-epoch BIGINT UNSIGNED NOT NULL,
-log_name VARCHAR(255) BINARY NOT NULL,
-start_pos BIGINT UNSIGNED NOT NULL,
-end_pos BIGINT UNSIGNED NOT NULL,
-PRIMARY KEY USING HASH (server_id)) 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=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` 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
---- 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=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` 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
---- 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=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(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) */
---- 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=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` 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) */
---- 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=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(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) */
---- 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=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` 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) */
---- 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=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(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 */
---- 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=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` 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 */
---- 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=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(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 */
---- 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=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(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 */
---- 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=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` 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 */
---- 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;
-set @@global.slave_exec_mode= DEFAULT;
-drop table mysql.ndb_apply_status;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result
deleted file mode 100644
index 935a7d61dfa..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result
+++ /dev/null
@@ -1,928 +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 @@global.slave_exec_mode= 'IDEMPOTENT';
-CREATE TABLE mysql.ndb_apply_status
-( server_id INT UNSIGNED NOT NULL,
-epoch BIGINT UNSIGNED NOT NULL,
-log_name VARCHAR(255) BINARY NOT NULL,
-start_pos BIGINT UNSIGNED NOT NULL,
-end_pos BIGINT UNSIGNED NOT NULL,
-PRIMARY KEY USING HASH (server_id)) 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=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` 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
---- 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=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` 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
---- 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=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(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) */
---- 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=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` 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) */
---- 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=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(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) */
---- 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=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` 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) */
---- 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=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(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 */
---- 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=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` 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 */
---- 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=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(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 */
---- 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=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(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 */
---- 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=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` 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 */
---- 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;
-set @@global.slave_exec_mode= DEFAULT;
-drop table mysql.ndb_apply_status;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2ndb.result
deleted file mode 100644
index 12882b28254..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2ndb.result
+++ /dev/null
@@ -1,400 +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 storage_engine=ndb;
-
-=== NDB -> 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=ndbcluster 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=ndbcluster 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=ndbcluster 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 NULL
-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 NULL
-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 NULL
-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 NULL
-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 NULL
---- 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 NULL
-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 NULL
-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 NULL
-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=ndbcluster 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_2other.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result
deleted file mode 100644
index 28ca1ac43b9..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result
+++ /dev/null
@@ -1,807 +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 storage_engine=ndb;
-
-=== NDB -> MYISAM ===
-
-set @old_slave_exec_mode= @@global.slave_exec_mode;
-set @@global.slave_exec_mode= 'IDEMPOTENT';
-CREATE TABLE mysql.ndb_apply_status
-( server_id INT UNSIGNED NOT NULL,
-epoch BIGINT UNSIGNED NOT NULL,
-log_name VARCHAR(255) BINARY NOT NULL,
-start_pos BIGINT UNSIGNED NOT NULL,
-end_pos BIGINT UNSIGNED NOT NULL,
-PRIMARY KEY USING HASH (server_id)) ENGINE=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 ===
-
-alter table mysql.ndb_apply_status engine=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;
-drop table mysql.ndb_apply_status;
-set @@global.slave_exec_mode= @old_slave_exec_mode;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result
deleted file mode 100644
index 6babf49dcaa..00000000000
--- a/mysql-test/suite/rpl_ndb/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) 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/suite/rpl_ndb/r/rpl_ndb_apply_status.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result
deleted file mode 100644
index 0fcd361da21..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result
+++ /dev/null
@@ -1,20 +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 slave there should be zero rows ***
-select count(*) from mysql.ndb_apply_status;
-count(*)
-0
-create table t1 (a int key, b int) engine ndb;
-insert into t1 values (1,1);
-*** on master it should be empty ***
-select * from mysql.ndb_apply_status;
-server_id epoch log_name start_pos end_pos
-*** on slave there should be one row ***
-select count(*) from mysql.ndb_apply_status;
-count(*)
-1
-drop table t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result
deleted file mode 100644
index dd4cc90a75f..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result
+++ /dev/null
@@ -1,170 +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;
-***************** Test 1 ************************
-
-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);
-******* Select from Master *************
-
-select * from t1 ORDER BY a;
-a b
-3 1
-4 2
-5 3
-******* Select from Slave *************
-
-select * from t1 ORDER BY a;
-a b
-3 1
-4 2
-5 3
-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);
-******* Select from Master *************
-
-select * from t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-5 5
-6 6
-******* Select from Slave *************
-
-select * from t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-5 5
-6 6
-drop table t1;
-create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
-insert into t1 values (NULL),(5),(NULL);
-insert into t1 values (250),(NULL);
-******* Select from Master *************
-
-select * from t1 ORDER BY a;
-a
-1
-5
-6
-250
-251
-insert into t1 values (1000);
-set @@insert_id=400;
-insert into t1 values(NULL),(NULL);
-******* Select from Master *************
-
-select * from t1 ORDER BY a;
-a
-1
-5
-6
-250
-251
-400
-401
-1000
-******* Select from Slave *************
-
-select * from t1 ORDER BY a;
-a
-1
-5
-6
-250
-251
-400
-401
-1000
-drop table t1;
-create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
-insert into t1 values (NULL),(5),(NULL),(NULL);
-insert into t1 values (500),(NULL),(502),(NULL),(600);
-******* Select from Master *************
-
-select * from t1 ORDER BY a;
-a
-1
-5
-6
-7
-500
-501
-502
-503
-600
-set @@insert_id=600;
-insert into t1 values(600),(NULL),(NULL);
-ERROR 23000: Can't write; duplicate key in table 't1'
-set @@insert_id=600;
-insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
-******* Select from Master *************
-
-select * from t1 ORDER BY a;
-a
-1
-5
-6
-7
-500
-501
-502
-503
-600
-610
-611
-******* Select from Slave *************
-
-select * from t1 ORDER BY a;
-a
-1
-5
-6
-7
-500
-501
-502
-503
-600
-610
-611
-drop table t1;
-create table t1 (a int not null auto_increment, primary key (a)) engine=NDB;
-insert into t1 values(2),(12),(22),(32),(42);
-insert into t1 values (NULL),(NULL);
-insert into t1 values (3),(NULL),(NULL);
-******* Select from Master *************
-
-select * from t1 ORDER BY a;
-a
-1
-2
-3
-4
-5
-******* Select from Slave *************
-
-** Slave should have 2, 12, 22, 32, 42 **
-** Master will have 2 but not 12, 22, 32, 42 **
-
-select * from t1 ORDER BY a;
-a
-1
-2
-3
-4
-5
-12
-22
-32
-42
-drop table t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result
deleted file mode 100644
index 06c005427d1..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result
+++ /dev/null
@@ -1,120 +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 IF NOT EXISTS BANK;
-DROP DATABASE BANK;
-CREATE DATABASE BANK default charset=latin1 default collate=latin1_bin;
-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;
-STOP SLAVE;
-RESET SLAVE;
-CREATE DATABASE IF NOT EXISTS BANK;
-DROP DATABASE BANK;
-CREATE DATABASE BANK;
-RESET MASTER;
-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 ',';
-SELECT @the_backup_id:=backup_id FROM mysql.backup_info;
-@the_backup_id:=backup_id
-<the_backup_id>
-SELECT @the_epoch:=MAX(epoch) FROM mysql.apply_status;
-@the_epoch:=MAX(epoch)
-<the_epoch>
-SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
-FROM mysql.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
-<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>
-STOP SLAVE;
-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
-<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>
-STOP SLAVE;
-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
-<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>
-STOP SLAVE;
-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
-<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>
-STOP SLAVE;
-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
-<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>
-STOP SLAVE;
-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
-<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>
-STOP SLAVE;
-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
-<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>
-STOP SLAVE;
-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
-<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>
-STOP SLAVE;
-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
-<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>
-STOP SLAVE;
-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
-<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>
-STOP SLAVE;
-START SLAVE;
-use test;
-create table t1 (a int primary key) engine=ndb;
-insert into t1 values (1);
-drop table t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
deleted file mode 100644
index d4abf899ca6..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
+++ /dev/null
@@ -1,192 +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 ****
-set GLOBAL slave_transaction_retries=10;
-include/start_slave.inc
-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/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result
deleted file mode 100644
index 64ab9a6d637..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result
+++ /dev/null
@@ -1,174 +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;
-==== Initialize ====
-[on slave]
-SET @old_binlog_format= @@global.binlog_format;
-INSTALL PLUGIN example SONAME 'ha_example.so';
-[on master]
-SET @old_binlog_format= @@global.binlog_format;
-INSTALL PLUGIN example SONAME 'ha_example.so';
-CREATE TABLE t (a VARCHAR(100)) ENGINE = MYISAM;
-CREATE TABLE t_self_logging (a VARCHAR(100)) ENGINE = NDB;
-CREATE TABLE t_row (a VARCHAR(100)) ENGINE = INNODB;
-CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE;
-CREATE TABLE t_slave_stmt (a VARCHAR(100)) ENGINE = MYISAM;
-CREATE TABLE t_autoinc (a INT KEY AUTO_INCREMENT) ENGINE = MYISAM;
-CREATE TABLE t_double_autoinc (a INT KEY AUTO_INCREMENT) ENGINE = MYISAM;
-CREATE TRIGGER trig_autoinc BEFORE INSERT ON t_autoinc FOR EACH ROW BEGIN INSERT INTO t_stmt VALUES ('x'); END;
-CREATE TRIGGER trig_double_autoinc BEFORE INSERT ON t_double_autoinc FOR EACH ROW BEGIN INSERT INTO t_autoinc VALUES (NULL); END;
-CREATE DATABASE other;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-[on slave]
-DROP TABLE t_slave_stmt;
-CREATE TABLE t_slave_stmt (a INT) ENGINE = EXAMPLE;
-[on master]
-BINLOG '
-1gRVSg8BAAAAZgAAAGoAAAABAAQANS4xLjM2LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAADWBFVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
-';
-==== Test ====
----- binlog_format=row ----
-* Modify tables of more than one engine, one of which is self-logging
-CREATE TRIGGER trig_1 AFTER INSERT ON t_self_logging FOR EACH ROW BEGIN INSERT INTO t VALUES (1); END;
-INSERT INTO t_self_logging VALUES (1);
-ERROR HY000: Cannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-logging.
-DROP trigger trig_1;
-SELECT * FROM t_self_logging /* Should be empty */;
-a
-SELECT * FROM t /* Should be empty */;
-a
-* Modify both row-only and stmt-only table
-CREATE TRIGGER trig_2 AFTER INSERT ON t_stmt FOR EACH ROW BEGIN INSERT INTO t_row VALUES(1); END;
-INSERT INTO t_stmt VALUES (1);
-ERROR HY000: Cannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involved.
-SELECT * FROM t_stmt /* should be empty */;
-a
-DROP TRIGGER trig_2;
-* Stmt-only table and binlog_format=row
-INSERT INTO t_stmt VALUES (1);
-ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based logging.
-SELECT * FROM t_stmt /* should be empty */;
-a
-* Row injection and stmt-only table: in slave sql thread
-INSERT INTO t_slave_stmt VALUES (1);
-[on slave]
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error executing row event: 'Cannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based logging.'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
-SELECT * FROM t_slave_stmt /* should be empty */;
-a
-[on master]
-* Row injection and stmt-only table: use BINLOG statement
-BINLOG '
-1gRVShMBAAAALwAAAEABAAAAABcAAAAAAAAABHRlc3QABnRfc3RtdAABDwJkAAE=
-1gRVShcBAAAAIAAAAGABAAAQABcAAAAAAAEAAf/+ATE=
-';
-ERROR HY000: Cannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based logging.
-SELECT * FROM t_stmt /* should be empty */;
-a
----- binlog_format=mixed ----
-[on slave]
-include/stop_slave.inc
-SET @@global.binlog_format = MIXED;
-include/start_slave.inc
-[on master]
-SET @@global.binlog_format = MIXED;
-SET @@session.binlog_format = MIXED;
-* Unsafe statement and stmt-only engine
-INSERT INTO t_stmt VALUES (UUID());
-ERROR HY000: Cannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. Statement is unsafe because it uses a system function that may return a different value on the slave.
-* Multi-unsafe statement and stmt-only engine
-INSERT DELAYED INTO t_double_autoinc SELECT CONCAT(UUID(), @@hostname, NULL) FROM mysql.general_log LIMIT 1;
-ERROR HY000: Cannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.
----- binlog_format=statement ----
-[on slave]
-include/stop_slave.inc
-SET @@global.binlog_format = STATEMENT;
-include/start_slave.inc
-[on master]
-SET @@global.binlog_format = STATEMENT;
-SET @@session.binlog_format = STATEMENT;
-* Row-only engine and binlog_format=statement: innodb-specific message
-INSERT INTO t_row VALUES (1);
-ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
-SELECT * FROM t_row /* should be empty */;
-a
-* Row-only engine and binlog_format=statement: generic message
-SET @@session.debug= '+d,no_innodb_binlog_errors';
-INSERT INTO t_row VALUES (1);
-ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.
-SELECT * FROM t_row /* should be empty */;
-a
-* Same statement, but db filtered out - no error
-USE other;
-INSERT INTO test.t_row VALUES (1);
-USE test;
-SET @@session.debug= '';
-SELECT * FROM t_row /* should contain the value 1 */;
-a
-1
-* Row injection and binlog_format=statement: BINLOG statement
-BINLOG '
-cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB
-cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE=
-';
-ERROR HY000: Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT.
-SELECT * FROM t /* should be empty */;
-a
-* Same statement, but db filtered out - no error
-USE other;
-BINLOG '
-cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB
-cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE=
-';
-USE test;
-SELECT * FROM t /* should contain the value 1 */;
-a
-1
-DELETE FROM t;
-* Unsafe statement and binlog_format=statement
-INSERT INTO t VALUES (COALESCE(1, UUID()));
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
-SELECT * FROM t /* should contain the value 1 */;
-a
-1
-DELETE FROM t;
-* Same statement, but db filtered out - no message
-USE other;
-INSERT INTO test.t VALUES (COALESCE(1, UUID()));
-USE test;
-SELECT * FROM t /* should contain the value 1 */;
-a
-1
-DELETE FROM t;
----- master: binlog_format=mixed, slave: binlog_format=statement ----
-SET @@global.binlog_format = MIXED;
-SET @@session.binlog_format = MIXED;
-* Row injection and binlog_format=statement: in slave sql thread
-INSERT INTO t VALUES (COALESCE(1, UUID()));
-[on slave]
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Error executing row event: 'Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT.'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
-include/start_slave.inc
-SELECT * FROM t /* should be empty */;
-a
-[on master]
-==== Clean up ====
-DROP TRIGGER trig_autoinc;
-DROP TRIGGER trig_double_autoinc;
-DROP TABLE t, t_self_logging, t_row, t_stmt, t_slave_stmt, t_autoinc, t_double_autoinc;
-DROP DATABASE other;
-SET @@global.binlog_format = @old_binlog_format;
-SET @@session.binlog_format = @old_binlog_format;
-UNINSTALL PLUGIN example;
-[on slave]
-SET @@global.binlog_format = @old_binlog_format;
-SET @@session.binlog_format = @old_binlog_format;
-UNINSTALL PLUGIN example;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result
deleted file mode 100644
index c11de8c27e3..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.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,
-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;
-M a sha1(b)
-M 1 8a6c4cf7cf97e66c487c3e3b717e9ae13623d07d
-M 2 0ccd08c0fa6ad6a4382b27b1d36586d6ceb4fffa
-M 3 75e7b3299e0b776aeac2a4d1542d5b3c0ba2e05e
-select 'S', a, sha1(b) from t1
-order by a;
-S a sha1(b)
-S 1 8a6c4cf7cf97e66c487c3e3b717e9ae13623d07d
-S 2 0ccd08c0fa6ad6a4382b27b1d36586d6ceb4fffa
-S 3 75e7b3299e0b776aeac2a4d1542d5b3c0ba2e05e
-drop table t1;
-create table t1 (
-a int not null primary key,
-b text not null,
-c int,
-d longblob,
-e tinyblob
-) engine=ndbcluster;
-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;
-M a sha1(b) c sha1(d) sha1(e)
-M 0 9538f61e649383c0d1054de2a2f0171188129f33 100 2b6515f29c20b8e9e17cc597527e516c0de8d612 NULL
-M 1 dcb9a12ca86e718ff2564be041b7c1b3ff5ea559 NULL f23e7439d9a73c3954979b85a7ef6ef35faf4e9d abfe8ae5212b22d023aa6de84beeb1344ac5668a
-M 2 da39a3ee5e6b4b0d3255bfef95601890afd80709 102 da39a3ee5e6b4b0d3255bfef95601890afd80709 33deebe47470a40e960834bffa4cdc66790845a6
-M 3 ec8e06d9ac4695d6a898b519ba840590263a9bff 103 278629ad080c3c4377978c006c2e54d0992e43cc 700915801f853603510aeb67b331866d996fdbda
-M 4 0392fa8c425d293c79291f0f34779d1101d13fcb 104 5084b602c7203e0e9590a163415ac605da17ac32 700915801f853603510aeb67b331866d996fdbda
-M 5 0f9653f0c7a69cd1c617792d546582e974a7a24d 105 566588a04ff26d05160d61c83435292bfda2978e abfe8ae5212b22d023aa6de84beeb1344ac5668a
-M 6 a37e8b0ff4fc13a42be02cdecb36186436959bae 106 NULL abfe8ae5212b22d023aa6de84beeb1344ac5668a
-M 7 a6bae0cfe6b45ff8c3c12d2ce577a1cd3931190f 107 39ee712b4b9e47f2cf3ba7c9790b2bf0d8f378e8 da39a3ee5e6b4b0d3255bfef95601890afd80709
-M 8 e139adcb7b2974ee7ff227fd405709e5cb7c896c 108 ba8073b0e1a281d4111bd2d82c7722b01574c00b NULL
-M 9 1fc5168fe4be566b17b658d94e7813f0b5032cdb NULL NULL NULL
-select 'S', a, sha1(b), c, sha1(d), sha1(e)
-from t1 order by a;
-S a sha1(b) c sha1(d) sha1(e)
-S 0 9538f61e649383c0d1054de2a2f0171188129f33 100 2b6515f29c20b8e9e17cc597527e516c0de8d612 NULL
-S 1 dcb9a12ca86e718ff2564be041b7c1b3ff5ea559 NULL f23e7439d9a73c3954979b85a7ef6ef35faf4e9d abfe8ae5212b22d023aa6de84beeb1344ac5668a
-S 2 da39a3ee5e6b4b0d3255bfef95601890afd80709 102 da39a3ee5e6b4b0d3255bfef95601890afd80709 33deebe47470a40e960834bffa4cdc66790845a6
-S 3 ec8e06d9ac4695d6a898b519ba840590263a9bff 103 278629ad080c3c4377978c006c2e54d0992e43cc 700915801f853603510aeb67b331866d996fdbda
-S 4 0392fa8c425d293c79291f0f34779d1101d13fcb 104 5084b602c7203e0e9590a163415ac605da17ac32 700915801f853603510aeb67b331866d996fdbda
-S 5 0f9653f0c7a69cd1c617792d546582e974a7a24d 105 566588a04ff26d05160d61c83435292bfda2978e abfe8ae5212b22d023aa6de84beeb1344ac5668a
-S 6 a37e8b0ff4fc13a42be02cdecb36186436959bae 106 NULL abfe8ae5212b22d023aa6de84beeb1344ac5668a
-S 7 a6bae0cfe6b45ff8c3c12d2ce577a1cd3931190f 107 39ee712b4b9e47f2cf3ba7c9790b2bf0d8f378e8 da39a3ee5e6b4b0d3255bfef95601890afd80709
-S 8 e139adcb7b2974ee7ff227fd405709e5cb7c896c 108 ba8073b0e1a281d4111bd2d82c7722b01574c00b NULL
-S 9 1fc5168fe4be566b17b658d94e7813f0b5032cdb NULL NULL NULL
-drop table t1;
-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;
-M db name sha1(query) node_id epoch id version type
-M t t11111111111 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
-M t t111111111111 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
-M t t1111111111111 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
-M test t1 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
-M test t2 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
-M test t3 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
-M testtttttttttt t1 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
-M testttttttttttt t1 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
-M testtttttttttttt t1 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
-select 'S', db, name, sha1(query), node_id, epoch, id, version, type
-from t1 order by db, name;
-S db name sha1(query) node_id epoch id version type
-S t t11111111111 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
-S t t111111111111 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
-S t t1111111111111 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
-S test t1 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
-S test t2 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
-S test t3 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
-S testtttttttttt t1 8fc937d303ee7e4795c0b964d4066cedd6d74cfd 11 12 13 14 15
-S testttttttttttt t1 a5229e9f8977bc99afc3b3627c56f083e97e01bd 21 22 23 24 25
-S testtttttttttttt t1 0820e6ad3eeb06ea60e5e04d0bfe36f286b91098 31 32 33 34 35
-drop table t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result
deleted file mode 100644
index 055efffbd6a..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result
+++ /dev/null
@@ -1,156 +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 test.t1;
-DROP TABLE IF EXISTS test.t2;
-***** Table Create Section ****
-
-CREATE TABLE test.t1 (c1 int not null auto_increment,
-data LONGBLOB, PRIMARY KEY(c1))ENGINE=#;
-
-**** Data Insert Section test.t1 *****
-
-INSERT INTO test.t1 VALUES (NULL, NULL);
-INSERT INTO test.t1 VALUES (NULL, repeat('a',1*1024));
-INSERT INTO test.t1 VALUES (NULL, repeat('b',16*1024));
-
-**** Data Insert Validation Master Section test.t1 ****
-
-SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
-LENGTH(data)
-NULL
-SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
-LENGTH(data)
-1024
-SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
-LENGTH(data)
-16384
-
-**** Data Insert Validation Slave Section test.t1 ****
-
-SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
-LENGTH(data)
-NULL
-SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
-LENGTH(data)
-1024
-SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
-LENGTH(data)
-16384
-
-**** Data Update Section test.t1 ****
-
-UPDATE test.t1 set data=repeat('a',18*1024) where c1 = 1;
-UPDATE t1 set data=repeat('c',17*1024) where c1 = 2;
-
-**** Data Update Validation Master Section test.t1 ****
-
-SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
-LENGTH(data)
-18432
-SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
-LENGTH(data)
-17408
-
-**** Data Update Validation Slave Section test.t1 ****
-
-SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
-LENGTH(data)
-18432
-SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
-LENGTH(data)
-17408
-
-**** End Test Section test.t1 ****
-
-**** Create Table test.t2 ****
-
-CREATE TABLE test.t2 (
-c1 INT NOT NULL PRIMARY KEY,
-c2 TEXT,
-c3 INT,
-c4 LONGBLOB,
-KEY(c3))ENGINE=#;
-
-*** Setup Values For test.t2 ***
-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 @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);
-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);
-set @d2 = 'dd2';
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
-
-**** Data Insert Section test.t2 *****
-
-INSERT INTO test.t2 VALUES(1,@b1,111,@d1);
-INSERT INTO test.t2 VALUES(2,@b2,222,@d2);
-
-**** Data Insert Validation Master Section test.t2 ****
-
-SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
-FROM test.t2 WHERE c1=1;
-c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
-1 2256 b1 3000 dd1
-SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
-FROM test.t2 WHERE c1=2;
-c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
-2 20000 b2 30000 dd2
-
-**** Data Insert Validation Slave Section test.t2 ****
-
-SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
-FROM test.t2 WHERE c1=1;
-c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
-1 2256 b1 3000 dd1
-SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
-FROM test.t2 WHERE c1=2;
-c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
-2 20000 b2 30000 dd2
-
-**** Data Update Section test.t2 ****
-
-UPDATE test.t2 SET c2=@b2, c4=@d2 WHERE c1=1;
-UPDATE test.t2 SET c2=@b1, c4=@d1 WHERE c1=2;
-
-**** Data Update Validation Master Section test.t2 ****
-
-SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
-FROM test.t2 WHERE c1=1;
-c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
-1 20000 b2 30000 dd2
-SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
-FROM test.t2 WHERE c1=2;
-c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
-2 2256 b1 3000 dd1
-
-**** Data Update Validation Slave Section test.t2 ****
-
-SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
-FROM test.t2 WHERE c1=1;
-c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
-1 20000 b2 30000 dd2
-SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
-FROM test.t2 WHERE c1=2;
-c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
-2 2256 b1 3000 dd1
-
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
deleted file mode 100644
index dfbd7a37d8e..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
+++ /dev/null
@@ -1,27 +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
-Checking that both slave threads are running.
-SELECT * FROM t1 ORDER BY a;
-a b
-1 2
-2 3
-Checking that both slave threads are running.
-STOP SLAVE;
-DROP TABLE t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_2ch.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_2ch.result
deleted file mode 100644
index b7d4a3d76db..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_2ch.result
+++ /dev/null
@@ -1,64 +0,0 @@
-STOP SLAVE;
-STOP SLAVE;
-STOP SLAVE;
-STOP SLAVE;
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
-RESET MASTER;
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
-RESET MASTER;
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
-RESET MASTER;
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
-RESET MASTER;
-RESET SLAVE;
-CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_MYPORT,master_user='root';
-START SLAVE;
-RESET SLAVE;
-CHANGE MASTER TO master_host='127.0.0.1',master_port=SLAVE_MYPORT1,master_user='root';
-START SLAVE;
-
-*** Check server_id of mysqld servers ***
-SHOW VARIABLES LIKE "server_id";
-Variable_name Value
-server_id 1
-SET auto_increment_offset = 1;
-SET auto_increment_increment = 2;
-SHOW VARIABLES LIKE "server_id";
-Variable_name Value
-server_id 1
-SET auto_increment_offset = 1;
-SET auto_increment_increment = 2;
-SHOW VARIABLES LIKE "server_id";
-Variable_name Value
-server_id 2
-SET auto_increment_offset = 2;
-SET auto_increment_increment = 2;
-SHOW VARIABLES LIKE "server_id";
-Variable_name Value
-server_id 2
-SET auto_increment_offset = 2;
-SET auto_increment_increment = 2;
-
-*** Preparing data ***
-CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=ndb;
-
-*** Basic testing ***
-Insert rows via all hosts
-Check data on both clusters
-Comparing tables master:test.t1 and slave:test.t1
-*** Transaction testing ***
-BEGIN;
-BEGIN;
-COMMIT;
-COMMIT;
-Check data on both clusters
-Comparing tables master:test.t1 and slave:test.t1
-BEGIN;
-BEGIN;
-ROLLBACK;
-ROLLBACK;
-Check data on both clusters
-Comparing tables master:test.t1 and slave:test.t1
-DROP TABLE t1;
-DROP TABLE IF EXISTS 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
deleted file mode 100644
index 99438d663bb..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
+++ /dev/null
@@ -1,29 +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";
-START SLAVE;
-Checking that both slave threads are running.
-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
-Checking that both slave threads are running.
-DROP TABLE t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result
deleted file mode 100644
index 3fc4ca26967..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result
+++ /dev/null
@@ -1,13 +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=NDB;
-begin;
-insert into t1 values(1);
-flush tables with read lock;
-commit;
-unlock tables;
-drop table t1;
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
deleted file mode 100644
index a6e2144f532..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result
+++ /dev/null
@@ -1,27 +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 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` ( `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;
-nid nom prenom
-1 XYZ1 ABC1
-select * from t1 order by nid;
-nid nom prenom
-1 XYZ1 ABC1
-==== clean up ====
-DROP TABLE t1;
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
deleted file mode 100644
index 6fdfaa30369..00000000000
--- a/mysql-test/suite/rpl_ndb/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` /* generated by server */
-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
deleted file mode 100644
index c906f00bd40..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result
+++ /dev/null
@@ -1,790 +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
-) /*!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/suite/rpl_ndb/r/rpl_ndb_ddl.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result
deleted file mode 100644
index 3f3be8a05a8..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result
+++ /dev/null
@@ -1,1628 +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;
-
--------- switch to master -------
-SET AUTOCOMMIT = 1;
-DROP DATABASE IF EXISTS mysqltest1;
-DROP DATABASE IF EXISTS mysqltest2;
-DROP DATABASE IF EXISTS mysqltest3;
-CREATE DATABASE mysqltest1;
-CREATE DATABASE mysqltest2;
-CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=NDB;
-INSERT INTO mysqltest1.t1 SET f1= 0;
-CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t4 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t5 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t6 (f1 BIGINT) ENGINE=NDB;
-CREATE INDEX my_idx6 ON mysqltest1.t6(f1);
-CREATE TABLE mysqltest1.t7 (f1 BIGINT) ENGINE=NDB;
-INSERT INTO mysqltest1.t7 SET f1= 0;
-CREATE TABLE mysqltest1.t8 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t9 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t10 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t11 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t12 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t13 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t14 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t15 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t16 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t17 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t18 (f1 BIGINT) ENGINE=NDB;
-CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=NDB;
-CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) ENGINE=MEMORY;
-SET AUTOCOMMIT = 0;
-use mysqltest1;
-
--------- switch to slave --------
-SET AUTOCOMMIT = 1;
-use mysqltest1;
-
--------- switch to master -------
-
-######## SELECT 1 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 0 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-0
-
--------- switch to master -------
-SELECT 1;
-1
-1
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-0
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-0
-
-TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-0
-
-TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-
--------- switch to master -------
-
-######## SELECT COUNT(*) FROM t1 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 0 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-0
-
--------- switch to master -------
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-2
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-0
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-0
-
-TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-0
-
-TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-
--------- switch to master -------
-
-######## COMMIT ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 0 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-0
-
--------- switch to master -------
-COMMIT;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-
-######## ROLLBACK ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 1 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-2
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
-TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
-TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-
--------- switch to master -------
-
-######## SET AUTOCOMMIT=1 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 1 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-2
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-1
-
--------- switch to master -------
-SET AUTOCOMMIT=1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-2
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-2
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-2
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-2
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SET AUTOCOMMIT=0;
-
-######## START TRANSACTION ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 2 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-3
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-2
-
--------- switch to master -------
-START TRANSACTION;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-3
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-3
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-3
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-3
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-
-######## BEGIN ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 3 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-4
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-3
-
--------- switch to master -------
-BEGIN;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-4
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-4
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-4
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-4
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-
-######## DROP TABLE mysqltest1.t2 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 4 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-5
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-4
-
--------- switch to master -------
-DROP TABLE mysqltest1.t2;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-5
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-5
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-5
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-5
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SHOW TABLES LIKE 't2';
-Tables_in_mysqltest1 (t2)
-
--------- switch to slave --------
-SHOW TABLES LIKE 't2';
-Tables_in_mysqltest1 (t2)
-
--------- switch to master -------
-
-######## DROP TEMPORARY TABLE mysqltest1.t23 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 5 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-6
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-5
-
--------- switch to master -------
-DROP TEMPORARY TABLE mysqltest1.t23;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-6
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-5
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-5
-
-TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-5
-
-TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-
--------- switch to master -------
-SHOW TABLES LIKE 't23';
-Tables_in_mysqltest1 (t23)
-
--------- switch to slave --------
-SHOW TABLES LIKE 't23';
-Tables_in_mysqltest1 (t23)
-
--------- switch to master -------
-
-######## RENAME TABLE mysqltest1.t3 to mysqltest1.t20 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 5 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-6
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-5
-
--------- switch to master -------
-RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-6
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-6
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-6
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-6
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SHOW TABLES LIKE 't20';
-Tables_in_mysqltest1 (t20)
-t20
-
--------- switch to slave --------
-SHOW TABLES LIKE 't20';
-Tables_in_mysqltest1 (t20)
-t20
-
--------- switch to master -------
-
-######## ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 6 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-7
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-6
-
--------- switch to master -------
-ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-7
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-7
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-7
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-7
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-describe mysqltest1.t4;
-Field Type Null Key Default Extra
-f1 bigint(20) YES NULL
-f2 bigint(20) YES NULL
-
--------- switch to slave --------
-describe mysqltest1.t4;
-Field Type Null Key Default Extra
-f1 bigint(20) YES NULL
-f2 bigint(20) YES NULL
-
--------- switch to master -------
-
-######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= NDB ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 7 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-8
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-7
-
--------- switch to master -------
-CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= NDB;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-8
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-8
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-8
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-8
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-
-######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=MEMORY ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 8 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-9
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-8
-
--------- switch to master -------
-CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=MEMORY;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-9
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-8
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-8
-
-TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-8
-
-TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-
--------- switch to master -------
-
-######## TRUNCATE TABLE mysqltest1.t7 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 8 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-9
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-8
-
--------- switch to master -------
-TRUNCATE TABLE mysqltest1.t7;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-9
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-9
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-9
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-9
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SELECT * FROM mysqltest1.t7;
-f1
-
--------- switch to slave --------
-SELECT * FROM mysqltest1.t7;
-f1
-
--------- switch to master -------
-
-######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 9 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-9
-
--------- switch to master -------
-LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-UNLOCK TABLES;
-
-######## UNLOCK TABLES ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 10 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-11
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
--------- switch to master -------
-UNLOCK TABLES;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-11
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
-TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
-TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-
--------- switch to master -------
-LOCK TABLES mysqltest1.t1 READ;
-
-######## UNLOCK TABLES ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 10 + 1;
-ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
--------- switch to master -------
-UNLOCK TABLES;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
-TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
-TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-
--------- switch to master -------
-LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
-
-######## UNLOCK TABLES ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 10 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-11
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-10
-
--------- switch to master -------
-UNLOCK TABLES;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-11
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-11
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-11
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-11
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-
-######## DROP INDEX my_idx6 ON mysqltest1.t6 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 11 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-12
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-11
-
--------- switch to master -------
-DROP INDEX my_idx6 ON mysqltest1.t6;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-12
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-12
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-12
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-12
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SHOW INDEX FROM mysqltest1.t6;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-
--------- switch to slave --------
-SHOW INDEX FROM mysqltest1.t6;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-
--------- switch to master -------
-
-######## CREATE INDEX my_idx5 ON mysqltest1.t5(f1) ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 12 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-13
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-12
-
--------- switch to master -------
-CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-13
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-13
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-13
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-13
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SHOW INDEX FROM mysqltest1.t5;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE
-
--------- switch to slave --------
-SHOW INDEX FROM mysqltest1.t5;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
-t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE
-
--------- switch to master -------
-
-######## DROP DATABASE mysqltest2 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 13 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-14
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-13
-
--------- switch to master -------
-DROP DATABASE mysqltest2;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-14
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-14
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-14
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-14
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SHOW DATABASES LIKE "mysqltest2";
-Database (mysqltest2)
-
--------- switch to slave --------
-SHOW DATABASES LIKE "mysqltest2";
-Database (mysqltest2)
-
--------- switch to master -------
-
-######## CREATE DATABASE mysqltest3 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 14 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-15
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-14
-
--------- switch to master -------
-CREATE DATABASE mysqltest3;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-15
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-15
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-15
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-15
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SHOW DATABASES LIKE "mysqltest3";
-Database (mysqltest3)
-mysqltest3
-
--------- switch to slave --------
-SHOW DATABASES LIKE "mysqltest3";
-Database (mysqltest3)
-mysqltest3
-
--------- switch to master -------
-
-######## CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1" ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 15 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-16
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-15
-
--------- switch to master -------
-CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1";
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-16
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-16
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-16
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-16
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SHOW PROCEDURE STATUS LIKE 'p1';
-Db mysqltest1
-Name p1
-Type PROCEDURE
-Definer root@localhost
-Modified #
-Created #
-Security_type DEFINER
-Comment
-character_set_client latin1
-collation_connection latin1_swedish_ci
-Database Collation latin1_swedish_ci
-
--------- switch to slave --------
-SHOW PROCEDURE STATUS LIKE 'p1';
-Db mysqltest1
-Name p1
-Type PROCEDURE
-Definer root@localhost
-Modified #
-Created #
-Security_type DEFINER
-Comment
-character_set_client latin1
-collation_connection latin1_swedish_ci
-Database Collation latin1_swedish_ci
-
--------- switch to master -------
-
-######## ALTER PROCEDURE p1 COMMENT "I have been altered" ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 16 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-17
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-16
-
--------- switch to master -------
-ALTER PROCEDURE p1 COMMENT "I have been altered";
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-17
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-17
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-17
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-17
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SHOW PROCEDURE STATUS LIKE 'p1';
-Db mysqltest1
-Name p1
-Type PROCEDURE
-Definer root@localhost
-Modified #
-Created #
-Security_type DEFINER
-Comment I have been altered
-character_set_client latin1
-collation_connection latin1_swedish_ci
-Database Collation latin1_swedish_ci
-
--------- switch to slave --------
-SHOW PROCEDURE STATUS LIKE 'p1';
-Db mysqltest1
-Name p1
-Type PROCEDURE
-Definer root@localhost
-Modified #
-Created #
-Security_type DEFINER
-Comment I have been altered
-character_set_client latin1
-collation_connection latin1_swedish_ci
-Database Collation latin1_swedish_ci
-
--------- switch to master -------
-
-######## DROP PROCEDURE p1 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 17 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-18
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-17
-
--------- switch to master -------
-DROP PROCEDURE p1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-18
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-18
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-18
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-18
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SHOW PROCEDURE STATUS LIKE 'p1';
-
--------- switch to slave --------
-SHOW PROCEDURE STATUS LIKE 'p1';
-
--------- switch to master -------
-
-######## CREATE OR REPLACE VIEW v1 as select * from t1 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 18 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-19
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-18
-
--------- switch to master -------
-CREATE OR REPLACE VIEW v1 as select * from t1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-19
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-19
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-19
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-19
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-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 `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
-
--------- switch to slave --------
-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 `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
-
--------- switch to master -------
-
-######## ALTER VIEW v1 AS select f1 from t1 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 19 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-20
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-19
-
--------- switch to master -------
-ALTER VIEW v1 AS select f1 from t1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-20
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-20
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-20
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-20
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-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 `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
-
--------- switch to slave --------
-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 `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
-
--------- switch to master -------
-
-######## DROP VIEW IF EXISTS v1 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 20 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-21
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-20
-
--------- switch to master -------
-DROP VIEW IF EXISTS v1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-21
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-21
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-21
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-21
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SHOW CREATE VIEW v1;
-ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
-
--------- switch to slave --------
-SHOW CREATE VIEW v1;
-ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
-
--------- switch to master -------
-
-######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 21 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-22
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-21
-
--------- switch to master -------
-CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-22
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-22
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-22
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-22
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SHOW TRIGGERS;
-Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-
--------- switch to slave --------
-SHOW TRIGGERS;
-Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-
--------- switch to master -------
-
-######## DROP TRIGGER trg1 ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 22 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-23
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-22
-
--------- switch to master -------
-DROP TRIGGER trg1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-23
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-23
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-23
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-23
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SHOW TRIGGERS;
-Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-
--------- switch to slave --------
-SHOW TRIGGERS;
-Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-
--------- switch to master -------
-
-######## CREATE USER user1@localhost ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 23 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-24
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-23
-
--------- switch to master -------
-CREATE USER user1@localhost;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-24
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-24
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-24
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-24
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SELECT user FROM mysql.user WHERE user = 'user1';
-user
-user1
-
--------- switch to slave --------
-SELECT user FROM mysql.user WHERE user = 'user1';
-user
-user1
-
--------- switch to master -------
-
-######## RENAME USER user1@localhost TO rename1@localhost ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 24 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-25
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-24
-
--------- switch to master -------
-RENAME USER user1@localhost TO rename1@localhost;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-25
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-25
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-25
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-25
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SELECT user FROM mysql.user WHERE user = 'rename1';
-user
-rename1
-
--------- switch to slave --------
-SELECT user FROM mysql.user WHERE user = 'rename1';
-user
-rename1
-
--------- switch to master -------
-
-######## DROP USER rename1@localhost ########
-
--------- switch to master -------
-INSERT INTO t1 SET f1= 25 + 1;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-26
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-25
-
--------- switch to master -------
-DROP USER rename1@localhost;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-26
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-26
-
--------- switch to master -------
-ROLLBACK;
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-26
-
-TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
-SELECT MAX(f1) FROM t1;
-MAX(f1)
-26
-
-TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
-SELECT user FROM mysql.user WHERE user = 'rename1';
-user
-
--------- switch to slave --------
-SELECT user FROM mysql.user WHERE user = 'rename1';
-user
-use test;
-
--------- switch to master -------
-DROP DATABASE mysqltest1;
-DROP DATABASE mysqltest3;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result
deleted file mode 100644
index 1cecb030181..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result
+++ /dev/null
@@ -1,15 +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) engine=NDB;
-insert into t1 values(1,1);
-select * from t1;
-a b
-1 1
-delete from t1;
-select * from t1;
-a b
-drop table t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result
deleted file mode 100644
index 316f5fc7e31..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.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;
-DROP DATABASE IF EXISTS replica;
-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;
-USE test;
-INSERT INTO t1 VALUES(1, repeat('abc',10));
-INSERT INTO t2 VALUES(1, repeat('abc',10));
-SHOW TABLES;
-Tables_in_test
-t1
-t2
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-1
-SELECT COUNT(*) FROM t2;
-COUNT(*)
-1
-USE replica;
-INSERT INTO replica.t1 VALUES(2, repeat('def',200));
-INSERT INTO replica.t2 VALUES(2, repeat('def',200));
-SHOW TABLES;
-Tables_in_replica
-t1
-t2
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-1
-SELECT COUNT(*) FROM t2;
-COUNT(*)
-1
-SHOW TABLES;
-Tables_in_test
-USE replica;
-SHOW TABLES;
-Tables_in_replica
-t1
-t2
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-1
-SELECT COUNT(*) FROM t2;
-COUNT(*)
-1
-USE test;
-SHOW TABLES;
-Tables_in_test
-USE test;
-DROP TABLE t1, t2;
-DROP DATABASE IF EXISTS replica;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result
deleted file mode 100644
index dda2844f6d0..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.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;
-DROP TABLE IF EXISTS t1, t2;
-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));
-SHOW TABLES;
-Tables_in_test
-t1
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-3
-INSERT INTO t1 VALUES (3, repeat('bad',1));
-ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
-INSERT INTO t1 VALUES (3, repeat('bad too',1));
-ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
-DROP TABLE IF EXISTS t1, t2;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
deleted file mode 100644
index e1fdf993c7c..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
+++ /dev/null
@@ -1,582 +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;
-call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
-**** Diff Table Def Start ****
-*** On Slave ***
-STOP SLAVE;
-RESET SLAVE;
-SET @saved_slave_type_conversions = @@slave_type_conversions;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
-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
-SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
-*** 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;
-Last_SQL_Error = Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)'
-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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** 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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** 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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** 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 1677 ***
-********************************************
-Last_SQL_Error = Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)'
-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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** Drop t10 ***
-DROP TABLE t10;
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
-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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-*** 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
-*** Create t14a on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14a (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='NDB';
-*** Create t14a on Master ***
-CREATE TABLE t14a (c1 INT PRIMARY KEY, 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 t14a () VALUES(1,@b1,'Kyle'),
-(2,@b1,'JOE'),
-(3,@b1,'QA');
-SELECT * FROM t14a ORDER BY c1;
-c1 c4 c5
-1 b1b1b1b1b1b1b1b1 Kyle
-2 b1b1b1b1b1b1b1b1 JOE
-3 b1b1b1b1b1b1b1b1 QA
-*** Select on Slave ****
-SELECT * FROM t14a ORDER BY c1;
-c1 c4 c5 c6 c7
-1 b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
-2 b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
-3 b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
-STOP SLAVE;
-RESET SLAVE;
-*** Master Drop c5 ***
-ALTER TABLE t14a DROP COLUMN c5;
-RESET MASTER;
-*** Start Slave ***
-START SLAVE;
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14a () VALUES(4,@b1),
-(5,@b1),
-(6,@b1);
-SELECT * FROM t14a ORDER BY c1;
-c1 c4
-1 b1b1b1b1b1b1b1b1
-2 b1b1b1b1b1b1b1b1
-3 b1b1b1b1b1b1b1b1
-4 b1b1b1b1b1b1b1b1
-5 b1b1b1b1b1b1b1b1
-6 b1b1b1b1b1b1b1b1
-*** Select on Slave ****
-SELECT * FROM t14a ORDER BY c1;
-c1 c4 c5 c6 c7
-1 b1b1b1b1b1b1b1b1 Kyle NULL CURRENT_TIMESTAMP
-2 b1b1b1b1b1b1b1b1 JOE NULL CURRENT_TIMESTAMP
-3 b1b1b1b1b1b1b1b1 QA NULL CURRENT_TIMESTAMP
-4 b1b1b1b1b1b1b1b1 NULL NULL CURRENT_TIMESTAMP
-5 b1b1b1b1b1b1b1b1 NULL NULL CURRENT_TIMESTAMP
-6 b1b1b1b1b1b1b1b1 NULL 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 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-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= 1;
-include/start_slave.inc
-*** 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 1677 ***
-********************************************
---source include/wait_for_slave_sql_error_and_skip.inc
-Last_SQL_Error = Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)'
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER= 2;
-include/start_slave.inc
-** DROP table t17 ***
-DROP TABLE t17;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result
deleted file mode 100644
index 7e750f2ce2a..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.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;
-CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
-DROP FUNCTION IF EXISTS test.f1;
-DROP TABLE IF EXISTS test.t1;
-CREATE TABLE test.t1 (a INT NOT NULL AUTO_INCREMENT, c CHAR(16),PRIMARY KEY(a))ENGINE=NDB;
-create function test.f1() RETURNS CHAR(16)
-BEGIN
-DECLARE tmp CHAR(16);
-DECLARE var_name FLOAT;
-SET var_name = RAND();
-IF var_name > .6
-THEN SET tmp = 'Texas';
-ELSE SET tmp = 'MySQL';
-END IF;
-RETURN tmp;
-END|
-INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
-INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
-SET AUTOCOMMIT=0;
-START TRANSACTION;
-INSERT INTO test.t1 VALUES (null,test.f1());
-ROLLBACK;
-SET AUTOCOMMIT=1;
-DROP FUNCTION test.f1;
-DROP TABLE test.t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result
deleted file mode 100644
index e2755c04f28..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result
+++ /dev/null
@@ -1,66 +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
-Checking that both slave threads are running.
-STOP SLAVE;
-CHANGE MASTER TO
-master_log_file = 'master-bin.000001',
-master_log_pos = <the_pos> ;
-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
-Checking that both slave threads are running.
-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
deleted file mode 100644
index 4c96ccf85ee..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result
+++ /dev/null
@@ -1,919 +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 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/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result
deleted file mode 100644
index 7c3f331958f..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result
+++ /dev/null
@@ -1,103 +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, 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;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-select count(*) from t1;
-count(*)
-0
-select count(*) from t2;
-count(*)
-0
-begin;
-load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
-Warnings:
-Warning 1262 Row 1 was truncated; it contained more data than there were input columns
-Warning 1262 Row 2 was truncated; it contained more data than there were input columns
-load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
-Warnings:
-Warning 1262 Row 1 was truncated; it contained more data than there were input columns
-Warning 1262 Row 2 was truncated; it contained more data than there were input columns
-rollback;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-select count(*) from t1;
-count(*)
-2
-select count(*) from t2;
-count(*)
-0
-select count(*) from t1;
-count(*)
-2
-select count(*) from t2;
-count(*)
-0
-delete from t1;
-delete from t2;
-begin;
-load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
-Warnings:
-Warning 1262 Row 1 was truncated; it contained more data than there were input columns
-Warning 1262 Row 2 was truncated; it contained more data than there were input columns
-load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
-Warnings:
-Warning 1262 Row 1 was truncated; it contained more data than there were input columns
-Warning 1262 Row 2 was truncated; it contained more data than there were input columns
-rollback;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-select count(*) from t1;
-count(*)
-2
-select count(*) from t2;
-count(*)
-0
-select count(*) from t1;
-count(*)
-2
-select count(*) from t2;
-count(*)
-0
-delete from t1;
-delete from t2;
-begin;
-insert into t2 values(3),(4);
-insert into t1 values(3),(4);
-load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
-Warnings:
-Warning 1262 Row 1 was truncated; it contained more data than there were input columns
-Warning 1262 Row 2 was truncated; it contained more data than there were input columns
-load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
-Warnings:
-Warning 1262 Row 1 was truncated; it contained more data than there were input columns
-Warning 1262 Row 2 was truncated; it contained more data than there were input columns
-rollback;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-select count(*) from t1;
-count(*)
-4
-select count(*) from t2;
-count(*)
-0
-select count(*) from t1;
-count(*)
-4
-select count(*) from t2;
-count(*)
-0
-drop table t1,t2;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result
deleted file mode 100644
index 030845e89e2..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result
+++ /dev/null
@@ -1,70 +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 unsigned not null auto_increment primary key,
-b int unsigned,
-unique (b)
-) ENGINE=NDB;
-CREATE TABLE t2 (
-a int unsigned, # to force INSERT SELECT to have a certain order
-b int unsigned
-) ENGINE=NDB;
-INSERT INTO t1 VALUES (NULL, 1);
-INSERT INTO t1 VALUES (NULL, 2);
-INSERT INTO t1 VALUES (NULL, 3);
-INSERT INTO t1 VALUES (NULL, 4);
-INSERT INTO t2 VALUES (1, 1);
-INSERT INTO t2 VALUES (2, 2);
-INSERT INTO t2 VALUES (3, 5);
-INSERT INTO t2 VALUES (4, 3);
-INSERT INTO t2 VALUES (5, 4);
-INSERT INTO t2 VALUES (6, 6);
-INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
-SELECT * FROM t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
-SELECT * FROM t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
-drop table t1;
-CREATE TABLE t1 (
-a int unsigned not null auto_increment primary key,
-b int unsigned,
-unique (b)
-) ENGINE=myisam;
-INSERT INTO t1 VALUES (1, 1);
-INSERT INTO t1 VALUES (2, 2);
-INSERT INTO t1 VALUES (3, 3);
-INSERT INTO t1 VALUES (4, 4);
-INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
-SELECT * FROM t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
-SELECT * FROM t1 ORDER BY a;
-a b
-1 1
-2 2
-3 3
-4 4
-5 5
-6 6
-drop table t1, t2;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result
deleted file mode 100644
index e51f0096557..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result
+++ /dev/null
@@ -1,42 +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 TEST_DB;
-CREATE DATABASE TEST_DB;
-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 GROUP2
-( 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 BINARY(2000) 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;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
deleted file mode 100644
index ef563d71342..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
+++ /dev/null
@@ -1,294 +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;
-include/stop_slave.inc
-reset master;
-reset slave;
-start slave;
-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 'LOAD_FILE' into table t1 ignore 1 lines;
-select count(*) from t1;
-count(*)
-69
-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` /* generated by server */
-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
-show binlog events from <binlog_start> limit 1;
-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
-show binlog events from <binlog_start> limit 2;
-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
-show binlog events from <binlog_start> limit 1,4;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-master-bin.000001 # Write_rows # # table_id: #
-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
-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;
-include/stop_slave.inc
-include/start_slave.inc
-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` /* generated by server */
-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' from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=NDB
-master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=NDB
-master-bin.000002 # Query # # BEGIN
-master-bin.000002 # Table_map # # table_id: # (test.t2)
-master-bin.000002 # Table_map # # table_id: # (mysql.ndb_apply_status)
-master-bin.000002 # Write_rows # # table_id: #
-master-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000002 # Query # # COMMIT
-show binary logs;
-Log_name File_size
-master-bin.000001 #
-master-bin.000002 #
-show binary logs;
-Log_name File_size
-slave-bin.000001 #
-slave-bin.000002 #
-show binlog events from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-slave-bin.000001 # Write_rows # # table_id: #
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
-slave-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=NDB
-slave-bin.000001 # Query # # BEGIN
-slave-bin.000001 # Table_map # # table_id: # (test.t1)
-slave-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-slave-bin.000001 # Write_rows # # table_id: #
-slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000001 # Query # # COMMIT
-slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=NDB
-slave-bin.000001 # Rotate # # slave-bin.000002;pos=4
-show binlog events in 'slave-bin.000002' from <binlog_start>;
-Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=NDB
-slave-bin.000002 # Query # # BEGIN
-slave-bin.000002 # Table_map # # table_id: # (test.t2)
-slave-bin.000002 # Table_map # # table_id: # (mysql.ndb_apply_status)
-slave-bin.000002 # Write_rows # # table_id: #
-slave-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
-slave-bin.000002 # Query # # COMMIT
-Checking that both slave threads are running.
-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;
-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 auto_increment primary key, b int);
-insert into t1 values (NULL, 1);
-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 # Query # # use `test`; create table t1(a int auto_increment primary key, b int)
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-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_mixed_engines_transactions.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result
deleted file mode 100644
index 7caa88a16a1..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result
+++ /dev/null
@@ -1,486 +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 tmyisam (a int) ENGINE = MYISAM;
-CREATE TABLE tinnodb (a int) ENGINE = INNODB;
-CREATE TABLE tndb (a int) ENGINE = NDB;
-SHOW CREATE TABLE tmyisam;
-Table Create Table
-tmyisam CREATE TABLE `tmyisam` (
- `a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW CREATE TABLE tinnodb;
-Table Create Table
-tinnodb CREATE TABLE `tinnodb` (
- `a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SHOW CREATE TABLE tndb;
-Table Create Table
-tndb CREATE TABLE `tndb` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-[on master]
-==== Single-engine transactions ====
----- autocommitted ----
-SET AUTOCOMMIT = 1;
-INSERT INTO tmyisam VALUES (0);
-INSERT INTO tinnodb VALUES (1);
-INSERT INTO tndb VALUES (2);
----- committed with BEGIN ----
-BEGIN;
-INSERT INTO tmyisam VALUES (3);
-INSERT INTO tmyisam VALUES (4);
-COMMIT;
-BEGIN;
-INSERT INTO tinnodb VALUES (5);
-INSERT INTO tinnodb VALUES (6);
-COMMIT;
-BEGIN;
-INSERT INTO tndb VALUES (7);
-INSERT INTO tndb VALUES (8);
-COMMIT;
----- rolled back with BEGIN ----
-BEGIN;
-INSERT INTO tmyisam VALUES (9);
-INSERT INTO tmyisam VALUES (10);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-BEGIN;
-INSERT INTO tinnodb VALUES (11);
-INSERT INTO tinnodb VALUES (12);
-ROLLBACK;
-BEGIN;
-INSERT INTO tndb VALUES (13);
-INSERT INTO tndb VALUES (14);
-ROLLBACK;
----- committed with AUTOCOMMIT = 0 ----
-SET AUTOCOMMIT = 0;
-INSERT INTO tmyisam VALUES (15);
-INSERT INTO tmyisam VALUES (16);
-COMMIT;
-INSERT INTO tinnodb VALUES (17);
-INSERT INTO tinnodb VALUES (18);
-COMMIT;
-INSERT INTO tndb VALUES (19);
-INSERT INTO tndb VALUES (20);
-COMMIT;
----- rolled back with AUTOCOMMIT = 0 ----
-INSERT INTO tmyisam VALUES (21);
-INSERT INTO tmyisam VALUES (22);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-INSERT INTO tinnodb VALUES (23);
-INSERT INTO tinnodb VALUES (24);
-ROLLBACK;
-INSERT INTO tndb VALUES (25);
-INSERT INTO tndb VALUES (26);
-ROLLBACK;
-SET AUTOCOMMIT = 1;
-==== MyISAM + InnoDB ====
----- committed with BEGIN ----
-BEGIN;
-INSERT INTO tmyisam VALUES (27);
-INSERT INTO tinnodb VALUES (28);
-COMMIT;
-BEGIN;
-INSERT INTO tinnodb VALUES (29);
-INSERT INTO tmyisam VALUES (30);
-COMMIT;
----- rolled back with BEGIN ----
-BEGIN;
-INSERT INTO tmyisam VALUES (31);
-INSERT INTO tinnodb VALUES (32);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-BEGIN;
-INSERT INTO tinnodb VALUES (33);
-INSERT INTO tmyisam VALUES (34);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
----- committed with AUTOCOMMIT = 0 ----
-SET AUTOCOMMIT = 0;
-INSERT INTO tmyisam VALUES (35);
-INSERT INTO tinnodb VALUES (36);
-COMMIT;
-INSERT INTO tinnodb VALUES (37);
-INSERT INTO tmyisam VALUES (38);
-COMMIT;
----- rolled back with AUTOCOMMIT = 0 ----
-INSERT INTO tmyisam VALUES (39);
-INSERT INTO tinnodb VALUES (40);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-INSERT INTO tinnodb VALUES (41);
-INSERT INTO tmyisam VALUES (42);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-SET AUTOCOMMIT = 1;
-==== MyISAM + NDB ====
----- committed with BEGIN----
-BEGIN;
-INSERT INTO tmyisam VALUES (43);
-INSERT INTO tndb VALUES (44);
-COMMIT;
-BEGIN;
-INSERT INTO tndb VALUES (45);
-INSERT INTO tmyisam VALUES (46);
-COMMIT;
----- rolled back with BEGIN ----
-BEGIN;
-INSERT INTO tmyisam VALUES (47);
-INSERT INTO tndb VALUES (48);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-BEGIN;
-INSERT INTO tndb VALUES (49);
-INSERT INTO tmyisam VALUES (50);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
----- committed with AUTOCOMMIT = 0 ----
-SET AUTOCOMMIT = 0;
-INSERT INTO tmyisam VALUES (51);
-INSERT INTO tndb VALUES (52);
-COMMIT;
-INSERT INTO tndb VALUES (53);
-INSERT INTO tmyisam VALUES (54);
-COMMIT;
----- rolled back with AUTOCOMMIT = 0 ----
-INSERT INTO tmyisam VALUES (55);
-INSERT INTO tndb VALUES (56);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-INSERT INTO tndb VALUES (57);
-INSERT INTO tmyisam VALUES (58);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-SET AUTOCOMMIT = 1;
-==== InnoDB + NDB ====
----- committed with BEGIN ----
-BEGIN;
-INSERT INTO tinnodb VALUES (59);
-INSERT INTO tndb VALUES (60);
-COMMIT;
-BEGIN;
-INSERT INTO tndb VALUES (61);
-INSERT INTO tinnodb VALUES (62);
-COMMIT;
----- rolled back with BEGIN ----
-BEGIN;
-INSERT INTO tinnodb VALUES (63);
-INSERT INTO tndb VALUES (64);
-ROLLBACK;
-BEGIN;
-INSERT INTO tndb VALUES (65);
-INSERT INTO tinnodb VALUES (66);
-ROLLBACK;
----- committed with AUTOCOMMIT = 0 ----
-SET AUTOCOMMIT = 0;
-INSERT INTO tinnodb VALUES (67);
-INSERT INTO tndb VALUES (68);
-COMMIT;
-INSERT INTO tndb VALUES (69);
-INSERT INTO tinnodb VALUES (70);
-COMMIT;
----- rolled back with AUTOCOMMIT = 0 ----
-INSERT INTO tinnodb VALUES (71);
-INSERT INTO tndb VALUES (72);
-ROLLBACK;
-INSERT INTO tndb VALUES (73);
-INSERT INTO tinnodb VALUES (74);
-ROLLBACK;
-SET AUTOCOMMIT = 1;
-==== MyISAM + InnoDB + NDB ====
----- committed with BEGIN ----
-BEGIN;
-INSERT INTO tmyisam VALUES (75);
-INSERT INTO tinnodb VALUES (76);
-INSERT INTO tndb VALUES (77);
-COMMIT;
-BEGIN;
-INSERT INTO tmyisam VALUES (78);
-INSERT INTO tndb VALUES (79);
-INSERT INTO tinnodb VALUES (80);
-COMMIT;
-BEGIN;
-INSERT INTO tinnodb VALUES (81);
-INSERT INTO tmyisam VALUES (82);
-INSERT INTO tndb VALUES (83);
-COMMIT;
-BEGIN;
-INSERT INTO tinnodb VALUES (84);
-INSERT INTO tndb VALUES (85);
-INSERT INTO tmyisam VALUES (86);
-COMMIT;
-BEGIN;
-INSERT INTO tndb VALUES (87);
-INSERT INTO tmyisam VALUES (88);
-INSERT INTO tinnodb VALUES (89);
-COMMIT;
-BEGIN;
-INSERT INTO tndb VALUES (90);
-INSERT INTO tinnodb VALUES (91);
-INSERT INTO tmyisam VALUES (92);
-COMMIT;
----- rolled back with BEGIN ----
-BEGIN;
-INSERT INTO tmyisam VALUES (93);
-INSERT INTO tinnodb VALUES (94);
-INSERT INTO tndb VALUES (95);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-BEGIN;
-INSERT INTO tmyisam VALUES (96);
-INSERT INTO tndb VALUES (97);
-INSERT INTO tinnodb VALUES (98);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-BEGIN;
-INSERT INTO tinnodb VALUES (99);
-INSERT INTO tmyisam VALUES (100);
-INSERT INTO tndb VALUES (101);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-BEGIN;
-INSERT INTO tinnodb VALUES (102);
-INSERT INTO tndb VALUES (103);
-INSERT INTO tmyisam VALUES (104);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-BEGIN;
-INSERT INTO tndb VALUES (105);
-INSERT INTO tmyisam VALUES (106);
-INSERT INTO tinnodb VALUES (107);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-BEGIN;
-INSERT INTO tndb VALUES (108);
-INSERT INTO tinnodb VALUES (109);
-INSERT INTO tmyisam VALUES (110);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
----- committed with AUTOCOMMIT = 0 ----
-SET AUTOCOMMIT = 0;
-INSERT INTO tmyisam VALUES (111);
-INSERT INTO tinnodb VALUES (112);
-INSERT INTO tndb VALUES (113);
-COMMIT;
-INSERT INTO tmyisam VALUES (114);
-INSERT INTO tndb VALUES (115);
-INSERT INTO tinnodb VALUES (116);
-COMMIT;
-INSERT INTO tinnodb VALUES (117);
-INSERT INTO tmyisam VALUES (118);
-INSERT INTO tndb VALUES (119);
-COMMIT;
-INSERT INTO tinnodb VALUES (120);
-INSERT INTO tndb VALUES (121);
-INSERT INTO tmyisam VALUES (122);
-COMMIT;
-INSERT INTO tndb VALUES (123);
-INSERT INTO tmyisam VALUES (124);
-INSERT INTO tinnodb VALUES (125);
-COMMIT;
-INSERT INTO tndb VALUES (126);
-INSERT INTO tinnodb VALUES (127);
-INSERT INTO tmyisam VALUES (128);
-COMMIT;
----- rolled back with AUTOCOMMIT = 0 ----
-INSERT INTO tmyisam VALUES (129);
-INSERT INTO tinnodb VALUES (130);
-INSERT INTO tndb VALUES (131);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-INSERT INTO tmyisam VALUES (132);
-INSERT INTO tndb VALUES (133);
-INSERT INTO tinnodb VALUES (134);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-INSERT INTO tinnodb VALUES (135);
-INSERT INTO tmyisam VALUES (136);
-INSERT INTO tndb VALUES (137);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-INSERT INTO tinnodb VALUES (138);
-INSERT INTO tndb VALUES (139);
-INSERT INTO tmyisam VALUES (140);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-INSERT INTO tndb VALUES (141);
-INSERT INTO tmyisam VALUES (142);
-INSERT INTO tinnodb VALUES (143);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-INSERT INTO tndb VALUES (144);
-INSERT INTO tinnodb VALUES (145);
-INSERT INTO tmyisam VALUES (146);
-ROLLBACK;
-Warnings:
-Warning 1196 Some non-transactional changed tables couldn't be rolled back
-SET AUTOCOMMIT = 1;
----- Mixed statements Innodb ----
-BEGIN;
-INSERT INTO tndb VALUES (147);
-INSERT INTO tinnodb SELECT * FROM tndb ORDER BY a DESC LIMIT 1;
-COMMIT;
-INSERT INTO tndb VALUES (148);
-BEGIN;
-INSERT INTO tinnodb SELECT * FROM tndb ORDER BY a DESC LIMIT 1;
-INSERT INTO tndb VALUES (149);
-COMMIT;
-BEGIN;
-INSERT INTO tndb VALUES (150);
-INSERT INTO tmyisam SELECT * FROM tndb ORDER BY a DESC LIMIT 1;
-COMMIT;
-INSERT INTO tndb VALUES (151);
-BEGIN;
-INSERT INTO tmyisam SELECT * FROM tndb ORDER BY a DESC LIMIT 1;
-INSERT INTO tndb VALUES (152);
-COMMIT;
-==== Verify the result ====
-SELECT * FROM tmyisam ORDER BY a;
-a
-0
-3
-4
-9
-10
-15
-16
-21
-22
-27
-30
-31
-34
-35
-38
-39
-42
-43
-46
-47
-50
-51
-54
-55
-58
-75
-78
-82
-86
-88
-92
-93
-96
-100
-104
-106
-110
-111
-114
-118
-122
-124
-128
-129
-132
-136
-140
-142
-146
-150
-151
-SELECT * FROM tinnodb ORDER BY a;
-a
-1
-5
-6
-17
-18
-28
-29
-36
-37
-59
-62
-67
-70
-76
-80
-81
-84
-89
-91
-112
-116
-117
-120
-125
-127
-147
-148
-SELECT * FROM tndb ORDER BY a;
-a
-2
-7
-8
-19
-20
-44
-45
-52
-53
-60
-61
-68
-69
-77
-79
-83
-85
-87
-90
-113
-115
-119
-121
-123
-126
-147
-148
-149
-150
-151
-152
-[on slave]
-Comparing tables master:test.tmyisam and slave:test.tmyisam
-Comparing tables master:test.tinnodb and slave:test.tinnodb
-Comparing tables master:test.tndb and slave:test.tndb
-==== Clean up ====
-[on master]
-DROP TABLE tmyisam, tinnodb, tndb;
-[on slave]
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_implicit_commit_binlog.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_implicit_commit_binlog.result
deleted file mode 100644
index 65e5469c9eb..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_implicit_commit_binlog.result
+++ /dev/null
@@ -1,660 +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;
-#########################################################################
-# CONFIGURATION
-#########################################################################
-CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = NDB;
-CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = NDB;
-CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam;
-INSERT INTO tt_1(ddl_case) VALUES(0);
-INSERT INTO tt_2(ddl_case) VALUES(0);
-#########################################################################
-# CHECK IMPLICT COMMIT
-#########################################################################
-SET AUTOCOMMIT= 0;
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (41);
-LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES;
-Table Op Msg_type Msg_text
-test.nt_1 preload_keys status OK
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-master-bin.000001 # Table_map # # table_id: # (test.tt_2)
-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: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (40);
-LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES;
-Table Op Msg_type Msg_text
-test.tt_1 preload_keys note The storage engine for the table doesn't support preload_keys
-test.tt_2 preload_keys note The storage engine for the table doesn't support preload_keys
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (39);
-ANALYZE TABLE nt_1;
-Table Op Msg_type Msg_text
-test.nt_1 analyze status Table is already up to date
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; ANALYZE TABLE nt_1
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (38);
-CHECK TABLE nt_1;
-Table Op Msg_type Msg_text
-test.nt_1 check status OK
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (37);
-OPTIMIZE TABLE nt_1;
-Table Op Msg_type Msg_text
-test.nt_1 optimize status Table is already up to date
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; OPTIMIZE TABLE nt_1
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (36);
-REPAIR TABLE nt_1;
-Table Op Msg_type Msg_text
-test.nt_1 repair status OK
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; REPAIR TABLE nt_1
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (35);
-LOCK TABLES tt_1 WRITE;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (34);
-UNLOCK TABLES;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (33);
-CREATE USER 'user'@'localhost';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE USER 'user'@'localhost'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (32);
-GRANT ALL ON *.* TO 'user'@'localhost';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; GRANT ALL ON *.* TO 'user'@'localhost'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (31);
-SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass');
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; SET PASSWORD FOR 'user'@'localhost'='*D8DECEC305209EEFEC43008E1D420E1AA06B19E0'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (30);
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (29);
-RENAME USER 'user'@'localhost' TO 'user_new'@'localhost';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; RENAME USER 'user'@'localhost' TO 'user_new'@'localhost'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (28);
-DROP USER 'user_new'@'localhost';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP USER 'user_new'@'localhost'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (27);
-CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (26);
-ALTER EVENT evt COMMENT 'evt';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; ALTER EVENT evt COMMENT 'evt'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (25);
-DROP EVENT evt;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP EVENT evt
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (24);
-CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (23);
-DROP TRIGGER tr;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TRIGGER tr
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (22);
-CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc";
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `fc`() RETURNS varchar(64) CHARSET latin1
-RETURN "fc"
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (21);
-ALTER FUNCTION fc COMMENT 'fc';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; ALTER FUNCTION fc COMMENT 'fc'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (20);
-DROP FUNCTION fc;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP FUNCTION fc
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (19);
-CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `pc`()
-UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (18);
-ALTER PROCEDURE pc COMMENT 'pc';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; ALTER PROCEDURE pc COMMENT 'pc'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (17);
-DROP PROCEDURE pc;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP PROCEDURE pc
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (16);
-CREATE VIEW v AS SELECT * FROM tt_1;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (15);
-ALTER VIEW v AS SELECT * FROM tt_1;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (14);
-DROP VIEW v;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP VIEW v
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (13);
-CREATE INDEX ix ON tt_1(ddl_case);
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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`; CREATE INDEX ix ON tt_1(ddl_case)
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (12);
-DROP INDEX ix ON tt_1;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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 INDEX ix ON tt_1
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (11);
-CREATE TEMPORARY TABLE tt_xx (a int);
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx (a int)
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (10);
-ALTER TABLE tt_xx ADD COLUMN (b int);
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (9);
-ALTER TABLE tt_xx RENAME new_tt_xx;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (8);
-DROP TEMPORARY TABLE IF EXISTS new_tt_xx;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `new_tt_xx` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (7);
-CREATE TABLE tt_xx (a int);
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx (a int)
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (6);
-ALTER TABLE tt_xx ADD COLUMN (b int);
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; ALTER TABLE tt_xx ADD COLUMN (b int)
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (5);
-RENAME TABLE tt_xx TO new_tt_xx;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; RENAME TABLE tt_xx TO new_tt_xx
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (4);
-TRUNCATE TABLE new_tt_xx;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; TRUNCATE TABLE new_tt_xx
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (3);
-DROP TABLE IF EXISTS tt_xx, new_tt_xx;
-Warnings:
-Note 1051 Unknown table 'tt_xx'
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `tt_xx`,`new_tt_xx` /* generated by server */
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (2);
-CREATE DATABASE db;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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 # # CREATE DATABASE db
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (1);
-DROP DATABASE IF EXISTS db;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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 # # DROP DATABASE IF EXISTS db
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
-###################################################################################
-# CHECK CONSISTENCY
-###################################################################################
-Comparing tables master:test.tt_1 and slave:test.tt_1
-###################################################################################
-# CLEAN
-###################################################################################
-DROP TABLE tt_1;
-DROP TABLE tt_2;
-DROP TABLE nt_1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result
deleted file mode 100644
index 43efc10c2e1..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_tables.result
+++ /dev/null
@@ -1,246 +0,0 @@
-==== Initialization ====
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
----- setup master ----
-CREATE TABLE myisam_innodb (a INT) ENGINE=MYISAM;
-CREATE TABLE innodb_myisam (a INT) ENGINE=INNODB;
-CREATE TABLE myisam_ndb (a INT) ENGINE=MYISAM;
-CREATE TABLE ndb_myisam (a INT) ENGINE=NDB;
-CREATE TABLE innodb_ndb (a INT) ENGINE=INNODB;
-CREATE TABLE ndb_innodb (a INT) ENGINE=NDB;
-SHOW CREATE TABLE myisam_innodb;
-Table Create Table
-myisam_innodb CREATE TABLE `myisam_innodb` (
- `a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW CREATE TABLE innodb_myisam;
-Table Create Table
-innodb_myisam CREATE TABLE `innodb_myisam` (
- `a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SHOW CREATE TABLE myisam_ndb;
-Table Create Table
-myisam_ndb CREATE TABLE `myisam_ndb` (
- `a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW CREATE TABLE ndb_myisam;
-Table Create Table
-ndb_myisam CREATE TABLE `ndb_myisam` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-SHOW CREATE TABLE innodb_ndb;
-Table Create Table
-innodb_ndb CREATE TABLE `innodb_ndb` (
- `a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SHOW CREATE TABLE ndb_innodb;
-Table Create Table
-ndb_innodb CREATE TABLE `ndb_innodb` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
----- setup slave with different engines ----
-DROP TABLE myisam_innodb, innodb_myisam;
-DROP TABLE myisam_ndb, ndb_myisam;
-DROP TABLE innodb_ndb, ndb_innodb;
-CREATE TABLE myisam_innodb (a INT) ENGINE=INNODB;
-CREATE TABLE innodb_myisam (a INT) ENGINE=MYISAM;
-CREATE TABLE myisam_ndb (a INT) ENGINE=NDB;
-CREATE TABLE ndb_myisam (a INT) ENGINE=MYISAM;
-CREATE TABLE innodb_ndb (a INT) ENGINE=NDB;
-CREATE TABLE ndb_innodb (a INT) ENGINE=INNODB;
-SHOW CREATE TABLE myisam_innodb;
-Table Create Table
-myisam_innodb CREATE TABLE `myisam_innodb` (
- `a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SHOW CREATE TABLE innodb_myisam;
-Table Create Table
-innodb_myisam CREATE TABLE `innodb_myisam` (
- `a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW CREATE TABLE myisam_ndb;
-Table Create Table
-myisam_ndb CREATE TABLE `myisam_ndb` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-SHOW CREATE TABLE ndb_myisam;
-Table Create Table
-ndb_myisam CREATE TABLE `ndb_myisam` (
- `a` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW CREATE TABLE innodb_ndb;
-Table Create Table
-innodb_ndb CREATE TABLE `innodb_ndb` (
- `a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1
-SHOW CREATE TABLE ndb_innodb;
-Table Create Table
-ndb_innodb CREATE TABLE `ndb_innodb` (
- `a` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-==== AUTOCOMMIT=0, transactions ====
----- COMMIT ----
-SET AUTOCOMMIT = 0;
-BEGIN;
-INSERT INTO myisam_innodb VALUES (1);
-INSERT INTO myisam_innodb VALUES (2);
-COMMIT;
-BEGIN;
-INSERT INTO innodb_myisam VALUES (3);
-INSERT INTO innodb_myisam VALUES (4);
-COMMIT;
-BEGIN;
-INSERT INTO myisam_ndb VALUES (5);
-INSERT INTO myisam_ndb VALUES (6);
-COMMIT;
-BEGIN;
-INSERT INTO ndb_myisam VALUES (7);
-INSERT INTO ndb_myisam VALUES (8);
-COMMIT;
-BEGIN;
-INSERT INTO ndb_innodb VALUES (9);
-INSERT INTO ndb_innodb VALUES (10);
-COMMIT;
-BEGIN;
-INSERT INTO innodb_ndb VALUES (11);
-INSERT INTO innodb_ndb VALUES (12);
-COMMIT;
----- ROLLBACK ----
-BEGIN;
-INSERT INTO innodb_myisam VALUES (15);
-INSERT INTO innodb_myisam VALUES (16);
-ROLLBACK;
-BEGIN;
-INSERT INTO ndb_myisam VALUES (19);
-INSERT INTO ndb_myisam VALUES (20);
-ROLLBACK;
-BEGIN;
-INSERT INTO ndb_innodb VALUES (21);
-INSERT INTO ndb_innodb VALUES (22);
-ROLLBACK;
-BEGIN;
-INSERT INTO innodb_ndb VALUES (23);
-INSERT INTO innodb_ndb VALUES (24);
-ROLLBACK;
-==== AUTOCOMMIT=1, transactions ====
----- COMMIT ----
-SET AUTOCOMMIT = 1;
-BEGIN;
-INSERT INTO myisam_innodb VALUES (25);
-INSERT INTO myisam_innodb VALUES (26);
-COMMIT;
-BEGIN;
-INSERT INTO innodb_myisam VALUES (27);
-INSERT INTO innodb_myisam VALUES (28);
-COMMIT;
-BEGIN;
-INSERT INTO myisam_ndb VALUES (29);
-INSERT INTO myisam_ndb VALUES (30);
-COMMIT;
-BEGIN;
-INSERT INTO ndb_myisam VALUES (31);
-INSERT INTO ndb_myisam VALUES (32);
-COMMIT;
-BEGIN;
-INSERT INTO ndb_innodb VALUES (33);
-INSERT INTO ndb_innodb VALUES (34);
-COMMIT;
-BEGIN;
-INSERT INTO innodb_ndb VALUES (35);
-INSERT INTO innodb_ndb VALUES (36);
-COMMIT;
----- ROLLBACK ----
-BEGIN;
-INSERT INTO innodb_myisam VALUES (39);
-INSERT INTO innodb_myisam VALUES (40);
-ROLLBACK;
-BEGIN;
-INSERT INTO ndb_myisam VALUES (43);
-INSERT INTO ndb_myisam VALUES (44);
-ROLLBACK;
-BEGIN;
-INSERT INTO ndb_innodb VALUES (45);
-INSERT INTO ndb_innodb VALUES (46);
-ROLLBACK;
-BEGIN;
-INSERT INTO innodb_ndb VALUES (47);
-INSERT INTO innodb_ndb VALUES (48);
-ROLLBACK;
-==== AUTOCOMMIT=1, single statements ====
-INSERT INTO myisam_innodb VALUES (49);
-INSERT INTO myisam_innodb VALUES (50);
-INSERT INTO innodb_myisam VALUES (51);
-INSERT INTO innodb_myisam VALUES (52);
-INSERT INTO myisam_ndb VALUES (53);
-INSERT INTO myisam_ndb VALUES (54);
-INSERT INTO ndb_myisam VALUES (55);
-INSERT INTO ndb_myisam VALUES (56);
-INSERT INTO ndb_innodb VALUES (57);
-INSERT INTO ndb_innodb VALUES (58);
-INSERT INTO innodb_ndb VALUES (59);
-INSERT INTO innodb_ndb VALUES (60);
-==== AUTOCOMMIT=0, single statements, myisam on master ====
-SET AUTOCOMMIT = 0;
-==== Show results ====
-SELECT * FROM myisam_innodb ORDER BY a;
-a
-1
-2
-25
-26
-49
-50
-SELECT * FROM innodb_myisam ORDER BY a;
-a
-3
-4
-27
-28
-51
-52
-SELECT * FROM myisam_ndb ORDER BY a;
-a
-5
-6
-29
-30
-53
-54
-SELECT * FROM ndb_myisam ORDER BY a;
-a
-7
-8
-31
-32
-55
-56
-SELECT * FROM innodb_ndb ORDER BY a;
-a
-11
-12
-35
-36
-59
-60
-SELECT * FROM ndb_innodb ORDER BY a;
-a
-9
-10
-33
-34
-57
-58
-Comparing tables master:test.myisam_innodb and slave:test.myisam_innodb
-Comparing tables master:test.innodb_myisam and slave:test.innodb_myisam
-Comparing tables master:test.myisam_ndb and slave:test.myisam_ndb
-Comparing tables master:test.ndb_myisam and slave:test.ndb_myisam
-Comparing tables master:test.innodb_ndb and slave:test.innodb_ndb
-Comparing tables master:test.ndb_innodb and slave:test.ndb_innodb
-==== Clean up ====
-drop table myisam_innodb, innodb_myisam;
-drop table myisam_ndb, ndb_myisam;
-drop table innodb_ndb, ndb_innodb;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
deleted file mode 100644
index b17d30fa8e4..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
+++ /dev/null
@@ -1,57 +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 ;
-reset master;
-SHOW TABLES;
-Tables_in_test
-t1
-INSERT INTO t1 VALUES ("row1","will go away",1);
-SELECT * FROM t1 ORDER BY c3;
-c1 c2 c3
-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
-stop slave;
-SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
-FROM mysql.ndb_binlog_index WHERE epoch = <the_epoch> ;
-@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
-107 master-bin.000001
-CHANGE MASTER TO
-master_port=<MASTER_PORT1>,
-master_log_file = 'master-bin.000001',
-master_log_pos = BINLOG_START ;
-start slave;
-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
-INSERT INTO t1 VALUES ("row5","E",5);
-SELECT * FROM t1 ORDER BY c3;
-c1 c2 c3
-row3 C 3
-row4 D 4
-row5 E 5
-SELECT * FROM t1 ORDER BY c3;
-c1 c2 c3
-row3 C 3
-row4 D 4
-row5 E 5
-==== clean up ====
-DROP TABLE t1;
-STOP SLAVE;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result
deleted file mode 100644
index 5d00ae6598c..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.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;
-drop table if exists t1,t2;
-CREATE TABLE t1 (
-a int unsigned not null auto_increment primary key,
-b int unsigned
-) ENGINE=NDB;
-CREATE TABLE t2 (
-a int unsigned not null auto_increment primary key,
-b int unsigned
-) ENGINE=NDB;
-INSERT INTO t1 VALUES (NULL, 0);
-INSERT INTO t1 SELECT NULL, 0 FROM t1;
-INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
-SELECT * FROM t1 ORDER BY a;
-a b
-1 0
-2 0
-SELECT * FROM t2 ORDER BY a;
-a b
-1 0
-2 1
-UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a;
-SELECT * FROM t1 ORDER BY a;
-a b
-1 4
-2 5
-SELECT * FROM t2 ORDER BY a;
-a b
-1 0
-2 1
-SELECT * FROM t1 ORDER BY a;
-a b
-1 4
-2 5
-SELECT * FROM t2 ORDER BY a;
-a b
-1 0
-2 1
-drop table t1,t2;
-reset master;
-CREATE TABLE t1 ( a INT );
-INSERT INTO t1 VALUES (0);
-UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b;
-select * from t1;
-a
-3
-select * from t1;
-a
-3
-drop table t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result
deleted file mode 100644
index dc4e11c9c9e..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result
+++ /dev/null
@@ -1,197 +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;
-
--------- Test for BUG#9361 --------
-CREATE TABLE t1 (
-a int unsigned not null auto_increment primary key,
-b int unsigned
-) ENGINE=NDB;
-CREATE TABLE t2 (
-a int unsigned not null auto_increment primary key,
-b int unsigned
-) ENGINE=NDB;
-INSERT INTO t1 VALUES (NULL, 0);
-INSERT INTO t1 SELECT NULL, 0 FROM t1;
-INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
-SELECT * FROM t1 ORDER BY a;
-a b
-1 0
-2 0
-SELECT * FROM t2 ORDER BY a;
-a b
-1 0
-2 1
-UPDATE t2, (SELECT a FROM t1 ORDER BY a) AS t SET t2.b = t.a+5 ;
-SELECT * FROM t1 ORDER BY a;
-a b
-1 0
-2 0
-SELECT * FROM t2 ORDER BY a;
-a b
-1 6
-2 6
-SELECT * FROM t1 ORDER BY a;
-a b
-1 0
-2 0
-SELECT * FROM t2 ORDER BY a;
-a b
-1 6
-2 6
-drop table t1,t2;
-
--------- Test 1 for BUG#9361 --------
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
-CREATE TABLE t1 (
-a1 char(30),
-a2 int,
-a3 int,
-a4 char(30),
-a5 char(30)
-);
-CREATE TABLE t2 (
-b1 int,
-b2 char(30)
-);
-INSERT INTO t1 VALUES ('Yes', 1, NULL, 'foo', 'bar');
-INSERT INTO t2 VALUES (1, 'baz');
-UPDATE t1 a, t2
-SET a.a1 = 'No'
-WHERE a.a2 =
-(SELECT b1
-FROM t2
-WHERE b2 = 'baz')
-AND a.a3 IS NULL
-AND a.a4 = 'foo'
-AND a.a5 = 'bar';
-SELECT * FROM t1;
-a1 a2 a3 a4 a5
-No 1 NULL foo bar
-SELECT * FROM t2;
-b1 b2
-1 baz
-DROP TABLE t1, t2;
-
--------- Test 2 for BUG#9361 --------
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
-DROP TABLE IF EXISTS t3;
-CREATE TABLE t1 (
-i INT,
-j INT,
-x INT,
-y INT,
-z INT
-);
-CREATE TABLE t2 (
-i INT,
-k INT,
-x INT,
-y INT,
-z INT
-);
-CREATE TABLE t3 (
-j INT,
-k INT,
-x INT,
-y INT,
-z INT
-);
-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, t2, t3;
-DROP TABLE IF EXISTS t1;
-Warnings:
-Note 1051 Unknown table 't1'
-DROP TABLE IF EXISTS t2;
-Warnings:
-Note 1051 Unknown table 't2'
-CREATE TABLE t1 (
-idp int(11) NOT NULL default '0',
-idpro int(11) default NULL,
-price decimal(19,4) default NULL,
-PRIMARY KEY (idp)
-);
-CREATE TABLE t2 (
-idpro int(11) NOT NULL default '0',
-price decimal(19,4) default NULL,
-nbprice int(11) default NULL,
-PRIMARY KEY (idpro)
-);
-INSERT INTO t1 VALUES
-(1,1,'3.0000'),
-(2,2,'1.0000'),
-(3,1,'1.0000'),
-(4,1,'4.0000'),
-(5,3,'2.0000'),
-(6,2,'4.0000');
-INSERT INTO t2 VALUES
-(1,'0.0000',0),
-(2,'0.0000',0),
-(3,'0.0000',0);
-update
-t2
-join
-( select idpro, min(price) as min_price, count(*) as nbr_price
-from t1
-where idpro>0 and price>0
-group by idpro
-) as table_price
-on t2.idpro = table_price.idpro
-set t2.price = table_price.min_price,
-t2.nbprice = table_price.nbr_price;
-select "-- MASTER AFTER JOIN --" as "";
-
--- MASTER AFTER JOIN --
-select * from t1;
-idp idpro price
-1 1 3.0000
-2 2 1.0000
-3 1 1.0000
-4 1 4.0000
-5 3 2.0000
-6 2 4.0000
-select * from t2;
-idpro price nbprice
-1 1.0000 3
-2 1.0000 2
-3 2.0000 1
-select "-- SLAVE AFTER JOIN --" as "";
-
--- SLAVE AFTER JOIN --
-select * from t1;
-idp idpro price
-1 1 3.0000
-2 2 1.0000
-3 1 1.0000
-4 1 4.0000
-5 3 2.0000
-6 2 4.0000
-select * from t2;
-idpro price nbprice
-1 1.0000 3
-2 1.0000 2
-3 2.0000 1
-DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result
deleted file mode 100644
index eb7d88c812b..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result
+++ /dev/null
@@ -1,919 +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 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/suite/rpl_ndb/r/rpl_ndb_relayrotate.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result
deleted file mode 100644
index 6aa64973611..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.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;
-stop slave;
-create table t1 (a int) engine=NDB;
-reset slave;
-start slave;
-stop slave;
-start slave;
-select max(a) from t1;
-max(a)
-8000
-drop table t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result
deleted file mode 100644
index 4e28a7e5865..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.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;
-DROP DATABASE IF EXISTS replica;
-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;
-USE test;
-INSERT INTO t1 VALUES(1, repeat('abc',10));
-INSERT INTO t2 VALUES(1, repeat('abc',10));
-SHOW TABLES;
-Tables_in_test
-t1
-t2
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-1
-SELECT COUNT(*) FROM t2;
-COUNT(*)
-1
-USE replica;
-INSERT INTO replica.t1 VALUES(2, repeat('def',200));
-INSERT INTO replica.t2 VALUES(2, repeat('def',200));
-SHOW TABLES;
-Tables_in_replica
-t1
-t2
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-1
-SELECT COUNT(*) FROM t2;
-COUNT(*)
-1
-SHOW TABLES;
-Tables_in_test
-USE replica;
-SHOW TABLES;
-Tables_in_replica
-t2
-SELECT COUNT(*) FROM t2;
-COUNT(*)
-1
-USE test;
-SHOW TABLES;
-Tables_in_test
-USE test;
-DROP TABLE t1, t2;
-DROP DATABASE IF EXISTS replica;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result
deleted file mode 100644
index 7f75bdedd65..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.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 (word CHAR(20) NOT NULL);
-LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
-LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
-SELECT * FROM t1 ORDER BY word LIMIT 10;
-word
-Aarhus
-Aarhus
-Aarhus
-Aarhus
-Aaron
-Aaron
-Aaron
-Aaron
-Ababa
-Ababa
-STOP SLAVE;
-SET PASSWORD FOR root@"localhost" = PASSWORD('foo');
-START SLAVE;
-SET PASSWORD FOR root@"localhost" = PASSWORD('');
-CREATE TABLE t3(n INT);
-INSERT INTO t3 VALUES(1),(2);
-SELECT * FROM t3 ORDER BY n;
-n
-1
-2
-SELECT SUM(LENGTH(word)) FROM t1;
-SUM(LENGTH(word))
-1022
-DROP TABLE t1,t3;
-CREATE TABLE t1 (n INT) ENGINE=NDB;
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-5000
-LOCK TABLES t1 READ;
-START SLAVE;
-UNLOCK TABLES;
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-5000
-DROP TABLE t1;
-CREATE TABLE t1 (n INT);
-INSERT INTO t1 VALUES(3456);
-SELECT n FROM t1;
-n
-3456
-DROP TABLE t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_implicit_commit_binlog.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_implicit_commit_binlog.result
deleted file mode 100644
index 0f2732069ec..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_implicit_commit_binlog.result
+++ /dev/null
@@ -1,661 +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;
-#########################################################################
-# CONFIGURATION
-#########################################################################
-CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = NDB;
-CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = NDB;
-CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam;
-INSERT INTO tt_1(ddl_case) VALUES(0);
-INSERT INTO tt_2(ddl_case) VALUES(0);
-#########################################################################
-# CHECK IMPLICT COMMIT
-#########################################################################
-SET AUTOCOMMIT= 0;
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (41);
-LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES;
-Table Op Msg_type Msg_text
-test.nt_1 preload_keys status OK
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-master-bin.000001 # Table_map # # table_id: # (test.tt_2)
-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: #
-master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (40);
-LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES;
-Table Op Msg_type Msg_text
-test.tt_1 preload_keys note The storage engine for the table doesn't support preload_keys
-test.tt_2 preload_keys note The storage engine for the table doesn't support preload_keys
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (39);
-ANALYZE TABLE nt_1;
-Table Op Msg_type Msg_text
-test.nt_1 analyze status Table is already up to date
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; ANALYZE TABLE nt_1
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (38);
-CHECK TABLE nt_1;
-Table Op Msg_type Msg_text
-test.nt_1 check status OK
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (37);
-OPTIMIZE TABLE nt_1;
-Table Op Msg_type Msg_text
-test.nt_1 optimize status Table is already up to date
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; OPTIMIZE TABLE nt_1
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (36);
-REPAIR TABLE nt_1;
-Table Op Msg_type Msg_text
-test.nt_1 repair status OK
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; REPAIR TABLE nt_1
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (35);
-LOCK TABLES tt_1 WRITE;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (34);
-UNLOCK TABLES;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (33);
-CREATE USER 'user'@'localhost';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE USER 'user'@'localhost'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (32);
-GRANT ALL ON *.* TO 'user'@'localhost';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; GRANT ALL ON *.* TO 'user'@'localhost'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (31);
-SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass');
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; SET PASSWORD FOR 'user'@'localhost'='*D8DECEC305209EEFEC43008E1D420E1AA06B19E0'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (mysql.user)
-master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (30);
-REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (29);
-RENAME USER 'user'@'localhost' TO 'user_new'@'localhost';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; RENAME USER 'user'@'localhost' TO 'user_new'@'localhost'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (28);
-DROP USER 'user_new'@'localhost';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP USER 'user_new'@'localhost'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (27);
-CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (26);
-ALTER EVENT evt COMMENT 'evt';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; ALTER EVENT evt COMMENT 'evt'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (25);
-DROP EVENT evt;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP EVENT evt
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (24);
-CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (23);
-DROP TRIGGER tr;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TRIGGER tr
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (22);
-CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc";
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `fc`() RETURNS varchar(64) CHARSET latin1
-RETURN "fc"
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (21);
-ALTER FUNCTION fc COMMENT 'fc';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; ALTER FUNCTION fc COMMENT 'fc'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (20);
-DROP FUNCTION fc;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP FUNCTION fc
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (19);
-CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `pc`()
-UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (18);
-ALTER PROCEDURE pc COMMENT 'pc';
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; ALTER PROCEDURE pc COMMENT 'pc'
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (17);
-DROP PROCEDURE pc;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP PROCEDURE pc
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (16);
-CREATE VIEW v AS SELECT * FROM tt_1;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (15);
-ALTER VIEW v AS SELECT * FROM tt_1;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (14);
-DROP VIEW v;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP VIEW v
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (13);
-CREATE INDEX ix ON tt_1(ddl_case);
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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`; CREATE INDEX ix ON tt_1(ddl_case)
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (12);
-DROP INDEX ix ON tt_1;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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 INDEX ix ON tt_1
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (11);
-CREATE TEMPORARY TABLE tt_xx (a int);
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (10);
-ALTER TABLE tt_xx ADD COLUMN (b int);
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (9);
-ALTER TABLE tt_xx RENAME new_tt_xx;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (8);
-DROP TEMPORARY TABLE IF EXISTS new_tt_xx;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `new_tt_xx` /* generated by server */
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (7);
-CREATE TABLE tt_xx (a int);
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx (a int)
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (6);
-ALTER TABLE tt_xx ADD COLUMN (b int);
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; ALTER TABLE tt_xx ADD COLUMN (b int)
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (5);
-RENAME TABLE tt_xx TO new_tt_xx;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; RENAME TABLE tt_xx TO new_tt_xx
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (4);
-TRUNCATE TABLE new_tt_xx;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; TRUNCATE TABLE new_tt_xx
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (3);
-DROP TABLE IF EXISTS tt_xx, new_tt_xx;
-Warnings:
-Note 1051 Unknown table 'tt_xx'
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `tt_xx`,`new_tt_xx` /* generated by server */
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (2);
-CREATE DATABASE db;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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 # # CREATE DATABASE db
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-INSERT INTO tt_1(ddl_case) VALUES (1);
-DROP DATABASE IF EXISTS db;
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
--b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-master-bin.000001 # Table_map # # table_id: # (test.tt_1)
-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 # # DROP DATABASE IF EXISTS db
--e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
-
-###################################################################################
-# CHECK CONSISTENCY
-###################################################################################
-Comparing tables master:test.tt_1 and slave:test.tt_1
-###################################################################################
-# CLEAN
-###################################################################################
-DROP TABLE tt_1;
-DROP TABLE tt_2;
-DROP TABLE nt_1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_set_null.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_set_null.result
deleted file mode 100644
index 473cd63169c..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_set_null.result
+++ /dev/null
@@ -1,35 +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;
-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 BIT, c2 INT) Engine=NDB;
-INSERT INTO `t1` VALUES ( 1, 1 );
-UPDATE t1 SET c1=NULL where c2=1;
-Comparing tables master:test.t1 and slave:test.t1
-DELETE FROM t1 WHERE c2=1 LIMIT 1;
-Comparing tables master:test.t1 and slave:test.t1
-DROP TABLE t1;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-CREATE TABLE t1 (c1 CHAR) Engine=NDB;
-INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
-SELECT * FROM t1;
-c1
-w
-UPDATE t1 SET c1=NULL WHERE c1='w';
-Comparing tables master:test.t1 and slave:test.t1
-DELETE FROM t1 LIMIT 2;
-Comparing tables master:test.t1 and slave:test.t1
-DROP TABLE t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result
deleted file mode 100644
index d7922c61b52..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result
+++ /dev/null
@@ -1,49 +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 PROCEDURE IF EXISTS test.p2;
-DROP TABLE IF EXISTS test.t1;
-CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=NDBCLUSTER;
-CREATE PROCEDURE test.p1()
-BEGIN
-INSERT INTO test.t1 VALUES (4);
-SELECT get_lock("test", 100);
-UPDATE test.t1 set a=a+4 WHERE a=4;
-END|
-CREATE PROCEDURE test.p2()
-BEGIN
-UPDATE test.t1 SET a=a+1;
-END|
-SELECT get_lock("test", 200);
-get_lock("test", 200)
-1
-CALL test.p1();
-CALL test.p2();
-SELECT release_lock("test");
-release_lock("test")
-1
-SELECT * FROM test.t1;
-a
-5
-SELECT * FROM test.t1;
-a
-5
-DROP TABLE IF EXISTS test.t1;
-CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=NDBCLUSTER;
-CALL test.p2();
-CALL test.p1();
-get_lock("test", 100)
-0
-SELECT * FROM test.t1;
-a
-8
-SELECT * FROM test.t1;
-a
-8
-DROP PROCEDURE IF EXISTS test.p1;
-DROP PROCEDURE IF EXISTS test.p2;
-DROP TABLE IF EXISTS test.t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result
deleted file mode 100644
index 21a2cfe5441..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.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;
-DROP TABLE IF EXISTS t1;
-DROP TABLE IF EXISTS t2;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS p2;
-CREATE TABLE IF NOT EXISTS t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=NDBCLUSTER;
-CREATE TABLE IF NOT EXISTS t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=NDBCLUSTER;
-CREATE PROCEDURE p1()
-BEGIN
-DECLARE done INT DEFAULT 0;
-DECLARE spa CHAR(16);
-DECLARE spb INT;
-DECLARE cur1 CURSOR FOR SELECT name,
-(YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5)<RIGHT(birth,5))
-FROM t1;
-DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
-OPEN cur1;
-SET AUTOCOMMIT=0;
-REPEAT
-FETCH cur1 INTO spa, spb;
-IF NOT done THEN
-START TRANSACTION;
-INSERT INTO t2 VALUES (spa,spb);
-COMMIT;
-END IF;
-UNTIL done END REPEAT;
-SET AUTOCOMMIT=1;
-CLOSE cur1;
-END|
-CREATE PROCEDURE p2()
-BEGIN
-INSERT INTO t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
-END|
-CALL p2();
-CALL p1();
-Warnings:
-Error 1329 No data - zero rows fetched, selected, or processed
-DROP TABLE t1;
-DROP TABLE t2;
-DROP PROCEDURE p1;
-DROP PROCEDURE p2;
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
deleted file mode 100644
index 367738b21e5..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result
+++ /dev/null
@@ -1,144 +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 = STATEMENT;
-
-*** 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>
-
-# Now check that that is in the apply_status table is consistant
-# with what is in the binlog
-
-# since insert is done with transactional engine, expect a BEGIN
-# at <start_pos>
-
-show binlog events from <binlog_start> limit 1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-
-# Now the insert, one step after
-
-show binlog events from <binlog_start> limit 1,1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # use `test`; insert into t1 values (1,2)
-
-# and the COMMIT should be at <end_pos>
-
-show binlog events from <binlog_start> limit 2,1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Xid # # 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 <binlog_start> limit 1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query # # BEGIN
-
-show binlog events from <binlog_start> 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 <binlog_start> limit 3,1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Xid # # 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
deleted file mode 100644
index 49d068d5fe4..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.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;
-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 = MEMORY;
-LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-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;
-Checking that both slave threads are running.
-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/suite/rpl_ndb/r/rpl_ndb_trig004.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result
deleted file mode 100644
index ba5f0dea91c..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.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 TRIGGER test.t1_bi_t2;
-DROP TABLE IF EXISTS test.t1;
-DROP TABLE IF EXISTS test.t2;
-CREATE TABLE test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d FLOAT, PRIMARY KEY(n))ENGINE=NDB;
-CREATE TABLE test.t2 (n MEDIUMINT NOT NULL, f FLOAT, PRIMARY KEY(n))ENGINE=NDB;
-CREATE TRIGGER test.t1_bi_t2 BEFORE INSERT ON test.t2 FOR EACH ROW INSERT INTO test.t1 VALUES (NULL, 1.234)//
-INSERT INTO test.t2 VALUES (1, 0.0);
-INSERT INTO test.t2 VALUES (1, 0.0);
-Got one of the listed errors
-select * from test.t1;
-n d
-1 1.234
-select * from test.t2;
-n f
-1 0
-select * from test.t1;
-n d
-1 1.234
-select * from test.t2;
-n f
-1 0
-DROP TRIGGER test.t1_bi_t2;
-DROP TABLE test.t1;
-DROP TABLE test.t2;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result b/mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result
deleted file mode 100644
index 5de6914882d..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result
+++ /dev/null
@@ -1,8 +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;
-Running ndbapi_simple_dual
-Running mgmapi_logevent
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
deleted file mode 100644
index 3839bfe0b2e..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
+++ /dev/null
@@ -1,636 +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(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'NDB' ;
-SELECT * FROM t1;
-C1 C2
-SELECT * FROM t1;
-C1 C2
-INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X');
-INSERT INTO t1 VALUES ('A','C'), ('X','Z'), ('A','A');
-SELECT * FROM t1 ORDER BY C1,C2;
-C1 C2
-A A
-A B
-A C
-X X
-X Y
-X Z
-SELECT * FROM t1 ORDER BY C1,C2;
-C1 C2
-A A
-A B
-A C
-X X
-X Y
-X Z
-DELETE FROM t1 WHERE C1 = C2;
-SELECT * FROM t1 ORDER BY C1,C2;
-C1 C2
-A B
-A C
-X Y
-X Z
-SELECT * FROM t1 ORDER BY C1,C2;
-C1 C2
-A B
-A C
-X Y
-X Z
-UPDATE t1 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
-SELECT * FROM t1 ORDER BY C1,C2;
-C1 C2
-A B
-A I
-X Y
-X Z
-SELECT * FROM t1 ORDER BY C1,C2;
-C1 C2
-A B
-A I
-X Y
-X Z
-UPDATE t1 SET c2 = 'Q' WHERE c1 = 'A' AND c2 = 'N';
-SELECT * FROM t1 ORDER BY c1,c2;
-C1 C2
-A B
-A I
-X Y
-X Z
-SELECT * FROM t1 ORDER BY c1,c2;
-C1 C2
-A B
-A I
-X Y
-X Z
-CREATE TABLE t2 (c1 INT, c12 char(1), c2 INT, PRIMARY KEY (c1)) ENGINE = 'NDB' ;
-INSERT INTO t2
-VALUES (1,'A',2), (2,'A',4), (3,'A',9), (4,'A',15), (5,'A',25),
-(6,'A',35), (7,'A',50), (8,'A',64), (9,'A',81);
-SELECT * FROM t2 ORDER BY c1,c2;
-c1 c12 c2
-1 A 2
-2 A 4
-3 A 9
-4 A 15
-5 A 25
-6 A 35
-7 A 50
-8 A 64
-9 A 81
-SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
-c1 c12 c2
-2 A 4
-3 A 9
-5 A 25
-8 A 64
-9 A 81
-SELECT * FROM t2 ORDER BY c1,c2;
-c1 c12 c2
-1 A 2
-2 A 4
-3 A 9
-4 A 15
-5 A 25
-6 A 35
-7 A 50
-8 A 64
-9 A 81
-SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
-c1 c12 c2
-2 A 4
-3 A 9
-5 A 25
-8 A 64
-9 A 81
-UPDATE t2 SET c2 = c1*c1 WHERE c2 != c1*c1;
-SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
-c1 c12 c2
-1 A 1
-2 A 4
-3 A 9
-4 A 16
-5 A 25
-6 A 36
-7 A 49
-8 A 64
-9 A 81
-SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
-c1 c12 c2
-1 A 1
-2 A 4
-3 A 9
-4 A 16
-5 A 25
-6 A 36
-7 A 49
-8 A 64
-9 A 81
-UPDATE t2 SET c12 = 'Q' WHERE c1 = 1 AND c2 = 999;
-SELECT * FROM t2 ORDER BY c1,c2;
-c1 c12 c2
-1 A 1
-2 A 4
-3 A 9
-4 A 16
-5 A 25
-6 A 36
-7 A 49
-8 A 64
-9 A 81
-SELECT * FROM t2 ORDER BY c1,c2;
-c1 c12 c2
-1 A 1
-2 A 4
-3 A 9
-4 A 16
-5 A 25
-6 A 36
-7 A 49
-8 A 64
-9 A 81
-DELETE FROM t2 WHERE c1 % 4 = 0;
-SELECT * FROM t2 ORDER BY c1,c2;
-c1 c12 c2
-1 A 1
-2 A 4
-3 A 9
-5 A 25
-6 A 36
-7 A 49
-9 A 81
-SELECT * FROM t2 ORDER BY c1,c2;
-c1 c12 c2
-1 A 1
-2 A 4
-3 A 9
-5 A 25
-6 A 36
-7 A 49
-9 A 81
-UPDATE t2 SET c12='X';
-CREATE TABLE t3 (C1 CHAR(1), C2 CHAR(1), pk1 INT, C3 CHAR(1), pk2 INT, PRIMARY KEY (pk1,pk2)) ENGINE = 'NDB' ;
-INSERT INTO t3 VALUES ('A','B',1,'B',1), ('X','Y',2,'B',1), ('X','X',3,'B',1);
-INSERT INTO t3 VALUES ('A','C',1,'B',2), ('X','Z',2,'B',2), ('A','A',3,'B',2);
-SELECT * FROM t3 ORDER BY C1,C2;
-C1 C2 pk1 C3 pk2
-A A 3 B 2
-A B 1 B 1
-A C 1 B 2
-X X 3 B 1
-X Y 2 B 1
-X Z 2 B 2
-SELECT * FROM t3 ORDER BY C1,C2;
-C1 C2 pk1 C3 pk2
-A A 3 B 2
-A B 1 B 1
-A C 1 B 2
-X X 3 B 1
-X Y 2 B 1
-X Z 2 B 2
-DELETE FROM t3 WHERE C1 = C2;
-SELECT * FROM t3 ORDER BY C1,C2;
-C1 C2 pk1 C3 pk2
-A B 1 B 1
-A C 1 B 2
-X Y 2 B 1
-X Z 2 B 2
-SELECT * FROM t3 ORDER BY C1,C2;
-C1 C2 pk1 C3 pk2
-A B 1 B 1
-A C 1 B 2
-X Y 2 B 1
-X Z 2 B 2
-UPDATE t3 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
-SELECT * FROM t3 ORDER BY C1,C2;
-C1 C2 pk1 C3 pk2
-A B 1 B 1
-A I 1 B 2
-X Y 2 B 1
-X Z 2 B 2
-SELECT * FROM t3 ORDER BY C1,C2;
-C1 C2 pk1 C3 pk2
-A B 1 B 1
-A I 1 B 2
-X Y 2 B 1
-X Z 2 B 2
-CREATE TABLE t6 (C1 CHAR(1), C2 CHAR(1), C3 INT) ENGINE = 'NDB' ;
-INSERT INTO t6 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
-INSERT INTO t6 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
-SELECT * FROM t6 ORDER BY C3;
-C1 C2 C3
-A B 1
-X Y 2
-X X 3
-A C 4
-X Z 5
-A A 6
-SELECT * FROM t6 ORDER BY C3;
-C1 C2 C3
-A B 1
-X Y 2
-X X 3
-A C 4
-X Z 5
-A A 6
-DELETE FROM t6 WHERE C1 = C2;
-SELECT * FROM t6 ORDER BY C3;
-C1 C2 C3
-A B 1
-X Y 2
-A C 4
-X Z 5
-SELECT * FROM t6 ORDER BY C3;
-C1 C2 C3
-A B 1
-X Y 2
-A C 4
-X Z 5
-UPDATE t6 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
-SELECT * FROM t6 ORDER BY C3;
-C1 C2 C3
-A B 1
-X Y 2
-A I 4
-X Z 5
-SELECT * FROM t6 ORDER BY C3;
-C1 C2 C3
-A B 1
-X Y 2
-A I 4
-X Z 5
-CREATE TABLE t5 (C1 CHAR(1), C2 CHAR(1), C3 INT PRIMARY KEY) ENGINE = 'NDB' ;
-INSERT INTO t5 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
-INSERT INTO t5 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
-UPDATE t5,t2,t3 SET t5.C2='Q', t2.c12='R', t3.C3 ='S' WHERE t5.C1 = t2.c12 AND t5.C1 = t3.C1;
-SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
-C1 C2 C3 c1 c12 c2 C1 C2 pk1 C3 pk2
-X Q 2 1 R 1 X Y 2 S 1
-X Q 2 1 R 1 X Z 2 S 2
-X Q 2 2 R 4 X Y 2 S 1
-X Q 2 2 R 4 X Z 2 S 2
-X Q 2 3 R 9 X Y 2 S 1
-X Q 2 3 R 9 X Z 2 S 2
-X Q 2 5 R 25 X Y 2 S 1
-X Q 2 5 R 25 X Z 2 S 2
-X Q 2 6 R 36 X Y 2 S 1
-X Q 2 6 R 36 X Z 2 S 2
-X Q 2 7 R 49 X Y 2 S 1
-X Q 2 7 R 49 X Z 2 S 2
-X Q 2 9 R 81 X Y 2 S 1
-X Q 2 9 R 81 X Z 2 S 2
-X Q 3 1 R 1 X Y 2 S 1
-X Q 3 1 R 1 X Z 2 S 2
-X Q 3 2 R 4 X Y 2 S 1
-X Q 3 2 R 4 X Z 2 S 2
-X Q 3 3 R 9 X Y 2 S 1
-X Q 3 3 R 9 X Z 2 S 2
-X Q 3 5 R 25 X Y 2 S 1
-X Q 3 5 R 25 X Z 2 S 2
-X Q 3 6 R 36 X Y 2 S 1
-X Q 3 6 R 36 X Z 2 S 2
-X Q 3 7 R 49 X Y 2 S 1
-X Q 3 7 R 49 X Z 2 S 2
-X Q 3 9 R 81 X Y 2 S 1
-X Q 3 9 R 81 X Z 2 S 2
-X Q 5 1 R 1 X Y 2 S 1
-X Q 5 1 R 1 X Z 2 S 2
-X Q 5 2 R 4 X Y 2 S 1
-X Q 5 2 R 4 X Z 2 S 2
-X Q 5 3 R 9 X Y 2 S 1
-X Q 5 3 R 9 X Z 2 S 2
-X Q 5 5 R 25 X Y 2 S 1
-X Q 5 5 R 25 X Z 2 S 2
-X Q 5 6 R 36 X Y 2 S 1
-X Q 5 6 R 36 X Z 2 S 2
-X Q 5 7 R 49 X Y 2 S 1
-X Q 5 7 R 49 X Z 2 S 2
-X Q 5 9 R 81 X Y 2 S 1
-X Q 5 9 R 81 X Z 2 S 2
-SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
-C1 C2 C3 c1 c12 c2 C1 C2 pk1 C3 pk2
-X Q 2 1 R 1 X Y 2 S 1
-X Q 2 1 R 1 X Z 2 S 2
-X Q 2 2 R 4 X Y 2 S 1
-X Q 2 2 R 4 X Z 2 S 2
-X Q 2 3 R 9 X Y 2 S 1
-X Q 2 3 R 9 X Z 2 S 2
-X Q 2 5 R 25 X Y 2 S 1
-X Q 2 5 R 25 X Z 2 S 2
-X Q 2 6 R 36 X Y 2 S 1
-X Q 2 6 R 36 X Z 2 S 2
-X Q 2 7 R 49 X Y 2 S 1
-X Q 2 7 R 49 X Z 2 S 2
-X Q 2 9 R 81 X Y 2 S 1
-X Q 2 9 R 81 X Z 2 S 2
-X Q 3 1 R 1 X Y 2 S 1
-X Q 3 1 R 1 X Z 2 S 2
-X Q 3 2 R 4 X Y 2 S 1
-X Q 3 2 R 4 X Z 2 S 2
-X Q 3 3 R 9 X Y 2 S 1
-X Q 3 3 R 9 X Z 2 S 2
-X Q 3 5 R 25 X Y 2 S 1
-X Q 3 5 R 25 X Z 2 S 2
-X Q 3 6 R 36 X Y 2 S 1
-X Q 3 6 R 36 X Z 2 S 2
-X Q 3 7 R 49 X Y 2 S 1
-X Q 3 7 R 49 X Z 2 S 2
-X Q 3 9 R 81 X Y 2 S 1
-X Q 3 9 R 81 X Z 2 S 2
-X Q 5 1 R 1 X Y 2 S 1
-X Q 5 1 R 1 X Z 2 S 2
-X Q 5 2 R 4 X Y 2 S 1
-X Q 5 2 R 4 X Z 2 S 2
-X Q 5 3 R 9 X Y 2 S 1
-X Q 5 3 R 9 X Z 2 S 2
-X Q 5 5 R 25 X Y 2 S 1
-X Q 5 5 R 25 X Z 2 S 2
-X Q 5 6 R 36 X Y 2 S 1
-X Q 5 6 R 36 X Z 2 S 2
-X Q 5 7 R 49 X Y 2 S 1
-X Q 5 7 R 49 X Z 2 S 2
-X Q 5 9 R 81 X Y 2 S 1
-X Q 5 9 R 81 X Z 2 S 2
-CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFAULT 0, C2 CHAR(1) NOT NULL DEFAULT 'A') ENGINE = 'NDB' ;
-INSERT INTO t4 SET C1 = 1;
-SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
-C1 HEX(B1) HEX(B2)
-1 NULL 0
-SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
-C1 HEX(B1) HEX(B2)
-1 NULL 0
-CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'NDB' ;
---- on slave: original values ---
-INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
-SELECT * FROM t7 ORDER BY C1;
-C1 C2
-1 3
-2 6
-3 9
-set @@global.slave_exec_mode= 'IDEMPOTENT';
---- on master: new values inserted ---
-INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
-SELECT * FROM t7 ORDER BY C1;
-C1 C2
-1 2
-2 4
-3 6
-set @@global.slave_exec_mode= default;
---- on slave: old values should be overwritten by replicated values ---
-SELECT * FROM t7 ORDER BY C1;
-C1 C2
-1 2
-2 4
-3 6
---- on master ---
-CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = 'NDB' ;
-INSERT INTO t8 VALUES (99,99,99);
-INSERT INTO t8 VALUES (99,22,33);
-ERROR 23000: Duplicate entry '99' for key 'PRIMARY'
-INSERT INTO t8 VALUES (11,99,33);
-ERROR 23000: Duplicate entry '99' for key 'b'
-INSERT INTO t8 VALUES (11,22,99);
-ERROR 23000: Duplicate entry '99' for key 'c'
-SELECT * FROM t8 ORDER BY a;
-a b c
-99 99 99
---- on slave ---
-SELECT * FROM t8 ORDER BY a;
-a b c
-99 99 99
-INSERT INTO t8 VALUES (1,2,3), (2,4,6), (3,6,9);
-SELECT * FROM t8 ORDER BY a;
-a b c
-1 2 3
-2 4 6
-3 6 9
-99 99 99
-set @@global.slave_exec_mode= 'IDEMPOTENT';
---- on master ---
-INSERT INTO t8 VALUES (2,4,8);
-set @@global.slave_exec_mode= default;
---- on slave ---
-SELECT * FROM t8 ORDER BY a;
-a b c
-1 2 3
-2 4 8
-3 6 9
-99 99 99
-**** Test for BUG#31552 ****
-**** On Master ****
-DELETE FROM t1;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
-**** On Master ****
-INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
-**** On Master ****
-set @@global.slave_exec_mode= 'IDEMPOTENT';
-DELETE FROM t1 WHERE C1 = 'L';
-DELETE FROM t1;
-SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
-COUNT(*) 0
-set @@global.slave_exec_mode= default;
-Checking that both slave threads are running.
-SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
-COUNT(*) 0
-**** Test for BUG#37076 ****
-**** On Master ****
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
-INSERT INTO t1 VALUES(
-'2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
-**** On Slave ****
-SELECT * FROM t1;
-a b c
-2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14
-DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
-CREATE TABLE t1 (i INT NOT NULL,
-c CHAR(16) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL) ENGINE = 'NDB' ;
-CREATE TABLE t2 (i INT NOT NULL,
-c CHAR(16) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL) ENGINE = 'NDB' ;
-ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
-CREATE TABLE t3 (i INT NOT NULL,
-c CHAR(128) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL) ENGINE = 'NDB' ;
-ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
-CREATE TABLE t4 (i INT NOT NULL,
-c CHAR(128) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL) ENGINE = 'NDB' ;
-CREATE TABLE t5 (i INT NOT NULL,
-c CHAR(255) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL) ENGINE = 'NDB' ;
-ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
-CREATE TABLE t6 (i INT NOT NULL,
-c CHAR(255) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL) ENGINE = 'NDB' ;
-ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
-CREATE TABLE t7 (i INT NOT NULL,
-c CHAR(255) CHARACTER SET utf8 NOT NULL,
-j INT NOT NULL) ENGINE = 'NDB' ;
-SET @saved_slave_type_conversions = @@slave_type_conversions;
-SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
-[expecting slave to replicate correctly]
-INSERT INTO t1 VALUES (1, "", 1);
-INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
-Comparing tables master:test.t1 and slave:test.t1
-[expecting slave to replicate correctly]
-INSERT INTO t2 VALUES (1, "", 1);
-INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
-Comparing tables master:test.t2 and slave:test.t2
-SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
-[expecting slave to replicate correctly]
-INSERT INTO t4 VALUES (1, "", 1);
-INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
-Comparing tables master:test.t4 and slave:test.t4
-[expecting slave to stop]
-INSERT INTO t5 VALUES (1, "", 1);
-INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)'
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
-[expecting slave to stop]
-INSERT INTO t6 VALUES (1, "", 1);
-INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
-Last_SQL_Error = Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)'
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
-[expecting slave to replicate correctly]
-INSERT INTO t7 VALUES (1, "", 1);
-INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
-Comparing tables master:test.t7 and slave:test.t7
-drop table t1, t2, t3, t4, t5, t6, t7;
-CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='NDB' ;
-INSERT INTO t1 VALUES (1), (2), (3);
-UPDATE t1 SET a = 10;
-ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
-INSERT INTO t1 VALUES (4);
-Comparing tables master:test.t1 and slave:test.t1
-drop table t1;
-DROP TABLE IF EXISTS t1, t2;
-CREATE TABLE t1 (
-`pk` int(11) NOT NULL AUTO_INCREMENT,
-`int_nokey` int(11) NOT NULL,
-`int_key` int(11) NOT NULL,
-`date_key` date NOT NULL,
-`date_nokey` date NOT NULL,
-`time_key` time NOT NULL,
-`time_nokey` time NOT NULL,
-`datetime_key` datetime NOT NULL,
-`datetime_nokey` datetime NOT NULL,
-`varchar_key` varchar(1) NOT NULL,
-`varchar_nokey` varchar(1) NOT NULL,
-PRIMARY KEY (`pk`),
-KEY `int_key` (`int_key`),
-KEY `date_key` (`date_key`),
-KEY `time_key` (`time_key`),
-KEY `datetime_key` (`datetime_key`),
-KEY `varchar_key` (`varchar_key`)
-) ENGINE='NDB' ;
-INSERT INTO t1 VALUES (1,8,5,'0000-00-00','0000-00-00','10:37:38','10:37:38','0000-00-00 00:00:00','0000-00-00 00:00:00','p','p'),(2,0,9,'0000-00-00','0000-00-00','00:00:00','00:00:00','2007-10-14 00:00:00','2007-10-14 00:00:00','d','d');
-CREATE TABLE t2 (
-`pk` int(11) NOT NULL AUTO_INCREMENT,
-`int_nokey` int(11) NOT NULL,
-`int_key` int(11) NOT NULL,
-`date_key` date NOT NULL,
-`date_nokey` date NOT NULL,
-`time_key` time NOT NULL,
-`time_nokey` time NOT NULL,
-`datetime_key` datetime NOT NULL,
-`datetime_nokey` datetime NOT NULL,
-`varchar_key` varchar(1) NOT NULL,
-`varchar_nokey` varchar(1) NOT NULL,
-PRIMARY KEY (`pk`),
-KEY `int_key` (`int_key`),
-KEY `date_key` (`date_key`),
-KEY `time_key` (`time_key`),
-KEY `datetime_key` (`datetime_key`),
-KEY `varchar_key` (`varchar_key`)
-) ENGINE='NDB' ;
-INSERT INTO t2 VALUES (1,1,6,'2005-12-23','2005-12-23','02:24:28','02:24:28','0000-00-00 00:00:00','0000-00-00 00:00:00','g','g'),(2,0,3,'2009-09-14','2009-09-14','00:00:00','00:00:00','2000-01-30 16:39:40','2000-01-30 16:39:40','q','q'),(3,0,3,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','c','c'),(4,1,6,'2007-03-29','2007-03-29','15:49:00','15:49:00','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(5,4,0,'2002-12-04','2002-12-04','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','o','o'),(6,9,0,'2005-01-28','2005-01-28','00:00:00','00:00:00','2001-05-18 00:00:00','2001-05-18 00:00:00','w','w'),(7,6,0,'0000-00-00','0000-00-00','06:57:25','06:57:25','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(8,0,0,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','z','z'),(9,4,6,'2006-08-15','2006-08-15','00:00:00','00:00:00','2002-04-12 14:44:25','2002-04-12 14:44:25','j','j'),(10,0,5,'2006-12-20','2006-12-20','10:13:53','10:13:53','2008-07-22 00:00:00','2008-07-22 00:00:00','y','y'),(11,9,7,'0000-00-00','0000-00-00','00:00:00','00:00:00','2004-07-05 00:00:00','2004-07-05 00:00:00','{','{'),(12,4,3,'2007-01-26','2007-01-26','23:00:51','23:00:51','2001-05-16 00:00:00','2001-05-16 00:00:00','f','f'),(13,7,0,'2004-03-27','2004-03-27','00:00:00','00:00:00','2005-01-24 03:30:37','2005-01-24 03:30:37','',''),(14,6,0,'2006-07-26','2006-07-26','18:43:57','18:43:57','0000-00-00 00:00:00','0000-00-00 00:00:00','{','{'),(15,0,6,'2000-01-14','2000-01-14','00:00:00','00:00:00','2000-09-21 00:00:00','2000-09-21 00:00:00','o','o'),(16,9,8,'0000-00-00','0000-00-00','21:15:08','21:15:08','0000-00-00 00:00:00','0000-00-00 00:00:00','a','a'),(17,2,0,'2004-10-27','2004-10-27','00:00:00','00:00:00','2004-03-24 22:13:43','2004-03-24 22:13:43','',''),(18,7,4,'0000-00-00','0000-00-00','08:38:27','08:38:27','2002-03-18 19:51:44','2002-03-18 19:51:44','t','t'),(19,5,3,'2008-03-07','2008-03-07','03:29:07','03:29:07','2007-12-01 18:44:44','2007-12-01 18:44:44','t','t'),(20,0,0,'2002-04-09','2002-04-09','16:06:03','16:06:03','2009-04-22 00:00:00','2009-04-22 00:00:00','n','n');
-DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
-UPDATE t1 SET `int_key` = 3 ORDER BY `pk` LIMIT 4;
-DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
-DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
-UPDATE t1 SET `int_key` = 6 ORDER BY `pk` LIMIT 3;
-DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
-UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6;
-ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
-DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
-UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
-*** results: t2 must be consistent ****
-Comparing tables master:test.t2 and master:test.t2
-DROP TABLE t1, t2;
-EOF OF TESTS
-CREATE TABLE t1 (a int) ENGINE='NDB' ;
-INSERT IGNORE INTO t1 VALUES (NULL);
-INSERT INTO t1 ( a ) VALUES ( 0 );
-INSERT INTO t1 ( a ) VALUES ( 9 );
-INSERT INTO t1 ( a ) VALUES ( 2 );
-INSERT INTO t1 ( a ) VALUES ( 9 );
-INSERT INTO t1 ( a ) VALUES ( 5 );
-UPDATE t1 SET a = 5 WHERE a = 9;
-DELETE FROM t1 WHERE a < 6;
-UPDATE t1 SET a = 9 WHERE a < 3;
-INSERT INTO t1 ( a ) VALUES ( 3 );
-UPDATE t1 SET a = 0 WHERE a < 4;
-UPDATE t1 SET a = 8 WHERE a < 5;
-Comparing tables master:test.t1 and slave:test.t1
-drop table t1;
-CREATE TABLE t1 (a bit) ENGINE='NDB' ;
-INSERT IGNORE INTO t1 VALUES (NULL);
-INSERT INTO t1 ( a ) VALUES ( 0 );
-UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
-INSERT INTO t1 ( a ) VALUES ( 5 );
-DELETE FROM t1 WHERE a < 2 LIMIT 4;
-DELETE FROM t1 WHERE a < 9 LIMIT 4;
-INSERT INTO t1 ( a ) VALUES ( 9 );
-UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
-INSERT INTO t1 ( a ) VALUES ( 8 );
-UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
-INSERT INTO t1 ( a ) VALUES ( 4 );
-INSERT INTO t1 ( a ) VALUES ( 3 );
-UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
-DELETE FROM t1 WHERE a = 4 LIMIT 7;
-UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9;
-UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
-DELETE FROM t1 WHERE a < 0 LIMIT 5;
-INSERT INTO t1 ( a ) VALUES ( 5 );
-UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4;
-INSERT INTO t1 ( a ) VALUES ( 5 );
-UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8;
-DELETE FROM t1 WHERE a < 8 LIMIT 8;
-INSERT INTO t1 ( a ) VALUES ( 6 );
-DELETE FROM t1 WHERE a < 6 LIMIT 7;
-UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
-UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
-INSERT INTO t1 ( a ) VALUES ( 7 );
-DELETE FROM t1 WHERE a < 9 LIMIT 4;
-INSERT INTO t1 ( a ) VALUES ( 7 );
-INSERT INTO t1 ( a ) VALUES ( 6 );
-UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
-DELETE FROM t1 WHERE a = 2 LIMIT 9;
-DELETE FROM t1 WHERE a = 1 LIMIT 4;
-UPDATE t1 SET a = 4 WHERE a = 2 LIMIT 7;
-INSERT INTO t1 ( a ) VALUES ( 0 );
-DELETE FROM t1 WHERE a < 3 LIMIT 0;
-UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
-INSERT INTO t1 ( a ) VALUES ( 1 );
-UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
-Comparing tables master:test.t1 and slave:test.t1
-drop table t1;
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result
deleted file mode 100644
index 36a7ae0016b..00000000000
--- a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result
+++ /dev/null
@@ -1,89 +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 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 LONG) 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`; TRUNCATE TABLE t1
-master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
-**** 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 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 LONG) 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`; TRUNCATE TABLE t1
-master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
-master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) 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 # # 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 # Delete_rows # # table_id: # flags: STMT_END_F
-master-bin.000001 # Query # # COMMIT
-master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
diff --git a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result
deleted file mode 100644
index d6c57aed41b..00000000000
--- a/mysql-test/suite/rpl_ndb/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 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
deleted file mode 100644
index 3dca5048213..00000000000
--- a/mysql-test/suite/rpl_ndb/t/disabled.def
+++ /dev/null
@@ -1,16 +0,0 @@
-##############################################################################
-#
-# List the test cases that are to be disabled temporarily.
-#
-# Separate the test case name and the comment with ':'.
-#
-# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
-#
-# Do not use any TAB characters for whitespace.
-#
-##############################################################################
-
-rpl_ndb_row_implicit_commit_binlog : Bug#55849 2010-08-09 alik rpl_ndb.rpl_ndb_row_implicit_commit_binlog fails
-
-# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
-rpl_ndb_2ndb : Bug#45974: rpl_ndb_2ndb fails sporadically
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt
deleted file mode 100644
index 9a3f30e4bd0..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---new --default-storage-engine=ndbcluster
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt
deleted file mode 100644
index 4dda0e45a63..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb --default-storage-engine=innodb --ndbcluster=0
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
deleted file mode 100644
index ce16170fde3..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
+++ /dev/null
@@ -1,39 +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
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
--- source include/have_binlog_format_mixed_or_row.inc
--- source include/master-slave.inc
-
--- connection slave
--- source include/have_innodb.inc
-
-# Remove any old ndb_apply_status from slaves datadir
-let $datadir= `SELECT @@datadir`;
---error 0,1
-remove_file $datadir/mysql/ndb_apply_status.frm;
---error 0,1
-remove_file $datadir/mysql/ndb_apply_status.ndb;
-
-set @@global.slave_exec_mode= 'IDEMPOTENT';
-CREATE TABLE mysql.ndb_apply_status
- ( server_id INT UNSIGNED NOT NULL,
- epoch BIGINT UNSIGNED NOT NULL,
- log_name VARCHAR(255) BINARY NOT NULL,
- start_pos BIGINT UNSIGNED NOT NULL,
- end_pos BIGINT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (server_id)) ENGINE=INNODB;
-
---source extra/rpl_tests/rpl_ndb_2multi_eng.test
-
-set @@global.slave_exec_mode= DEFAULT;
---connection slave
-drop table mysql.ndb_apply_status;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt
deleted file mode 100644
index b63ef44e8fc..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---new --default-storage-engine=ndbcluster
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt
deleted file mode 100644
index 9b5f524e131..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---default-storage-engine=myisam --ndbcluster=0
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
deleted file mode 100644
index 8bd9be0c346..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
+++ /dev/null
@@ -1,38 +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
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
--- source include/have_binlog_format_mixed_or_row.inc
--- source include/master-slave.inc
-
--- connection slave
-
-# Remove any old ndb_apply_status from slaves datadir
-let $datadir= `SELECT @@datadir`;
---error 0,1
-remove_file $datadir/mysql/ndb_apply_status.frm;
---error 0,1
-remove_file $datadir/mysql/ndb_apply_status.ndb;
-
-set @@global.slave_exec_mode= 'IDEMPOTENT';
-CREATE TABLE mysql.ndb_apply_status
- ( server_id INT UNSIGNED NOT NULL,
- epoch BIGINT UNSIGNED NOT NULL,
- log_name VARCHAR(255) BINARY NOT NULL,
- start_pos BIGINT UNSIGNED NOT NULL,
- end_pos BIGINT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
-
---source extra/rpl_tests/rpl_ndb_2multi_eng.test
-
-set @@global.slave_exec_mode= DEFAULT;
---connection slave
-drop table mysql.ndb_apply_status;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb-slave.opt
deleted file mode 100644
index 5304fd49b6b..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---default-storage-engine=ndbcluster --log-slave-updates=0
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test
deleted file mode 100644
index e954c72fd1d..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test
+++ /dev/null
@@ -1,19 +0,0 @@
-#############################################################
-# Author: Rafal Somla
-# Date: 2006-08-20
-# Purpose: Trying to test ability to replicate from cluster
-# to other engines (innodb, myisam), see also rpl_ndb_2other.test
-##############################################################
---source include/have_binlog_format_mixed_or_row.inc
---source include/have_ndb.inc
---source include/ndb_master-slave.inc
-
-# On master use NDB as storage engine.
-connection master;
-SET storage_engine=ndb;
-
---echo
---echo === NDB -> NDB ===
---echo
-connection slave;
---source extra/rpl_tests/rpl_ndb_2multi_basic.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
deleted file mode 100644
index cf2fe6b9c62..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb --loose-ndbcluster=OFF --log-slave-updates=0 --default-storage-engine=MyISAM
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test
deleted file mode 100644
index 41f91d62dec..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test
+++ /dev/null
@@ -1,50 +0,0 @@
-#############################################################
-# 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/master-slave.inc
-
-# On master use NDB as storage engine.
-connection master;
-SET storage_engine=ndb;
-
---echo
---echo === NDB -> MYISAM ===
---echo
-connection slave;
-
-# Remove any old ndb_apply_status from slaves datadir
-let $datadir= `SELECT @@datadir`;
---error 0,1
-remove_file $datadir/mysql/ndb_apply_status.frm;
---error 0,1
-remove_file $datadir/mysql/ndb_apply_status.ndb;
-
-set @old_slave_exec_mode= @@global.slave_exec_mode;
-set @@global.slave_exec_mode= 'IDEMPOTENT';
-CREATE TABLE mysql.ndb_apply_status
- ( server_id INT UNSIGNED NOT NULL,
- epoch BIGINT UNSIGNED NOT NULL,
- log_name VARCHAR(255) BINARY NOT NULL,
- start_pos BIGINT UNSIGNED NOT NULL,
- end_pos BIGINT UNSIGNED NOT NULL,
- PRIMARY KEY USING HASH (server_id)) ENGINE=MYISAM;
-SET storage_engine=myisam;
---source extra/rpl_tests/rpl_ndb_2multi_basic.test
-
---echo
---echo === NDB -> INNODB ===
---echo
-connection slave;
-alter table mysql.ndb_apply_status engine=innodb;
-SET storage_engine=innodb;
---source extra/rpl_tests/rpl_ndb_2multi_basic.test
-
-connection slave;
-drop table mysql.ndb_apply_status;
-set @@global.slave_exec_mode= @old_slave_exec_mode;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test
deleted file mode 100644
index ea623a06fd1..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test
+++ /dev/null
@@ -1,8 +0,0 @@
-########################################################
-# 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_apply_status-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status-master.opt
deleted file mode 100644
index 3f4aff8a321..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate_ignore_db=mysql
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status.test
deleted file mode 100644
index cc74acc6490..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status.test
+++ /dev/null
@@ -1,26 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_binlog_format_row.inc
--- source include/ndb_master-slave.inc
-
-#
-# Bug#28170 replicate-ignore-db=mysql should not ignore mysql.ndb_apply_status
-#
-# Slave is started with --replicate-ignore-db=mysql
-#
-sync_slave_with_master;
-echo *** on slave there should be zero rows ***;
-select count(*) from mysql.ndb_apply_status;
-
-connection master;
-create table t1 (a int key, b int) engine ndb;
-insert into t1 values (1,1);
-echo *** on master it should be empty ***;
-select * from mysql.ndb_apply_status;
-
-sync_slave_with_master;
-echo *** on slave there should be one row ***;
-select count(*) from mysql.ndb_apply_status;
-
-connection master;
-drop table t1;
-sync_slave_with_master;
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
deleted file mode 100644
index 5e0584e332a..00000000000
--- a/mysql-test/suite/rpl_ndb/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/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
deleted file mode 100644
index b90e6fff8bc..00000000000
--- a/mysql-test/suite/rpl_ndb/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_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=$NDB_CONNECTSTRING ../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=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/bank/bankTimer -w 5 >> $NDB_TOOLS_OUTPUT &
---exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/bank/bankMakeGL >> $NDB_TOOLS_OUTPUT &
---exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../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="$NDB_CONNECTSTRING" -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="$NDB_CONNECTSTRING" -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="$NDB_CONNECTSTRING_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="$NDB_CONNECTSTRING_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=$NDB_CONNECTSTRING_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
deleted file mode 100644
index 69f630c856a..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
+++ /dev/null
@@ -1,264 +0,0 @@
---source include/have_ndb.inc
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
---source include/have_binlog_format_mixed_or_row.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;
-
---echo **** On Slave ****
-# Wait for deadlock to be detected.
-# When detected, the slave will stop, so we just wait for it to stop.
-connection slave;
-source include/wait_for_slave_sql_to_stop.inc;
-
-# Replication should have stopped, since max retries were not enough.
-# verify with show slave status
-# 1205 = ER_LOCK_WAIT_TIMEOUT
---let $slave_sql_errno= 1205
---source include/wait_for_slave_sql_error.inc
-
-# now set max retries high enough to succeed, and start slave again
-set GLOBAL slave_transaction_retries=10;
-source include/start_slave.inc;
-# Wait for deadlock to be detected and retried.
-# We want to wait until at least one retry has been made, but before
-# the slave stops. currently, there is no safe way to do that: we
-# would need to access the retry counter, but that is not exposed.
-# Failing that, we just wait sufficiently long that one but not all
-# retries have been made. See BUG#35183.
-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_binlog_format_errors-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt
deleted file mode 100644
index efea2bf1db5..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb $EXAMPLE_PLUGIN_OPT --binlog-ignore-db=other
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-slave.opt
deleted file mode 100644
index ffa981152ea..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb $EXAMPLE_PLUGIN_OPT
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test
deleted file mode 100644
index 1aae0d2d57f..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test
+++ /dev/null
@@ -1,262 +0,0 @@
-# ==== Purpose ====
-#
-# Verify that errors or warnings are issued for all error conditions
-# related to deciding the binlog format of a statement. The possible
-# errors are listed in a comment above decide_logging_format() in
-# sql_base.cc.
-#
-# ==== Method ====
-#
-# Each error condition is executed; we verify that there is an error.
-#
-# ==== Related bugs ====
-#
-# BUG#39934: Slave stops for engine that only support row-based logging
-# BUG#42829: binlogging enabled for all schemas regardless of binlog-db-db / binlog-ignore-db
-#
-# ==== Related test cases ====
-#
-# binlog.binlog_unsafe verifies more thoroughly that a warning is
-# given for the case when an unsafe statement is executed and
-# binlog_format = STATEMENT.
-
-# Need debug so that 'SET @@session.debug' works.
---source include/have_debug.inc
-# Need example plugin because it is the only statement-only engine.
---source include/have_example_plugin.inc
-# The test changes binlog_format, so there is no reason to run it
-# under more than one binlog format.
---source include/have_binlog_format_row.inc
---source include/have_ndb.inc
---source include/have_innodb.inc
---source include/ndb_master-slave.inc
-
-disable_query_log;
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-call mtr.add_suppression("Slave: Cannot execute statement: impossible to write to binary log");
-enable_query_log;
-
---echo ==== Initialize ====
-
---echo [on slave]
---connection slave
-
-SET @old_binlog_format= @@global.binlog_format;
-INSTALL PLUGIN example SONAME 'ha_example.so';
-
---echo [on master]
---connection master
-
-SET @old_binlog_format= @@global.binlog_format;
-INSTALL PLUGIN example SONAME 'ha_example.so';
-
-CREATE TABLE t (a VARCHAR(100)) ENGINE = MYISAM;
-CREATE TABLE t_self_logging (a VARCHAR(100)) ENGINE = NDB;
-CREATE TABLE t_row (a VARCHAR(100)) ENGINE = INNODB;
-CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE;
-CREATE TABLE t_slave_stmt (a VARCHAR(100)) ENGINE = MYISAM;
-CREATE TABLE t_autoinc (a INT KEY AUTO_INCREMENT) ENGINE = MYISAM;
-CREATE TABLE t_double_autoinc (a INT KEY AUTO_INCREMENT) ENGINE = MYISAM;
-
---eval CREATE TRIGGER trig_autoinc BEFORE INSERT ON t_autoinc FOR EACH ROW BEGIN INSERT INTO t_stmt VALUES ('x'); END
---eval CREATE TRIGGER trig_double_autoinc BEFORE INSERT ON t_double_autoinc FOR EACH ROW BEGIN INSERT INTO t_autoinc VALUES (NULL); END
-
-CREATE DATABASE other;
-
-# This makes the innodb table row-only
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-
---echo [on slave]
---sync_slave_with_master
-
-DROP TABLE t_slave_stmt;
-CREATE TABLE t_slave_stmt (a INT) ENGINE = EXAMPLE;
-
---echo [on master]
---connection master
-
-# This is a format description event. It is needed because any BINLOG
-# statement containing a row event must be preceded by a BINLOG
-# statement containing a format description event.
-BINLOG '
-1gRVSg8BAAAAZgAAAGoAAAABAAQANS4xLjM2LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAADWBFVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
-';
-
-
---echo ==== Test ====
-
---echo ---- binlog_format=row ----
-
---echo * Modify tables of more than one engine, one of which is self-logging
---eval CREATE TRIGGER trig_1 AFTER INSERT ON t_self_logging FOR EACH ROW BEGIN INSERT INTO t VALUES (1); END
---error ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE
-INSERT INTO t_self_logging VALUES (1);
-DROP trigger trig_1;
-SELECT * FROM t_self_logging /* Should be empty */;
-SELECT * FROM t /* Should be empty */;
-
---echo * Modify both row-only and stmt-only table
---eval CREATE TRIGGER trig_2 AFTER INSERT ON t_stmt FOR EACH ROW BEGIN INSERT INTO t_row VALUES(1); END
---error ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE
-INSERT INTO t_stmt VALUES (1);
-SELECT * FROM t_stmt /* should be empty */;
-DROP TRIGGER trig_2;
-
---echo * Stmt-only table and binlog_format=row
---error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE
-INSERT INTO t_stmt VALUES (1);
-SELECT * FROM t_stmt /* should be empty */;
-
---echo * Row injection and stmt-only table: in slave sql thread
-INSERT INTO t_slave_stmt VALUES (1);
---echo [on slave]
---connection slave
-# 1664 = ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE
---let $slave_sql_errno= 1664
---let $show_slave_sql_error= 1
---source include/wait_for_slave_sql_error_and_skip.inc
---connection slave
-SELECT * FROM t_slave_stmt /* should be empty */;
-
---echo [on master]
---connection master
---echo * Row injection and stmt-only table: use BINLOG statement
-# This is a Table_map_event and a Write_rows_event. Together, they are
-# equivalent to 'INSERT INTO t_stmt VALUES (1)'
---error ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE
-BINLOG '
-1gRVShMBAAAALwAAAEABAAAAABcAAAAAAAAABHRlc3QABnRfc3RtdAABDwJkAAE=
-1gRVShcBAAAAIAAAAGABAAAQABcAAAAAAAEAAf/+ATE=
-';
-SELECT * FROM t_stmt /* should be empty */;
-
-
---echo ---- binlog_format=mixed ----
-
---echo [on slave]
---sync_slave_with_master
---source include/stop_slave.inc
-SET @@global.binlog_format = MIXED;
---source include/start_slave.inc
---echo [on master]
---connection master
-SET @@global.binlog_format = MIXED;
-SET @@session.binlog_format = MIXED;
-
---echo * Unsafe statement and stmt-only engine
---error ER_BINLOG_UNSAFE_AND_STMT_ENGINE
-INSERT INTO t_stmt VALUES (UUID());
-
-# Concatenate two unsafe values, and then concatenate NULL to
-# that so that the result is NULL and we instead use autoinc.
---echo * Multi-unsafe statement and stmt-only engine
---error ER_BINLOG_UNSAFE_AND_STMT_ENGINE
-INSERT DELAYED INTO t_double_autoinc SELECT CONCAT(UUID(), @@hostname, NULL) FROM mysql.general_log LIMIT 1;
-
-
---echo ---- binlog_format=statement ----
-
---echo [on slave]
---sync_slave_with_master
---source include/stop_slave.inc
-SET @@global.binlog_format = STATEMENT;
---source include/start_slave.inc
---echo [on master]
---connection master
-SET @@global.binlog_format = STATEMENT;
-SET @@session.binlog_format = STATEMENT;
-
---echo * Row-only engine and binlog_format=statement: innodb-specific message
---error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
-INSERT INTO t_row VALUES (1);
-SELECT * FROM t_row /* should be empty */;
-
-# Commented out since innodb gives an error (this is a bug)
-#--echo * Same statement, but db filtered out - no error
-#USE other;
-#INSERT INTO test.t_row VALUES (1);
-#USE test;
-
---echo * Row-only engine and binlog_format=statement: generic message
-SET @@session.debug= '+d,no_innodb_binlog_errors';
---error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
-INSERT INTO t_row VALUES (1);
-SELECT * FROM t_row /* should be empty */;
-
---echo * Same statement, but db filtered out - no error
-USE other;
-INSERT INTO test.t_row VALUES (1);
-USE test;
-SET @@session.debug= '';
-SELECT * FROM t_row /* should contain the value 1 */;
-
---echo * Row injection and binlog_format=statement: BINLOG statement
-# This is a Table_map_event and a Write_rows_event. Together, they are
-# equivalent to 'INSERT INTO t VALUES (1)'.
---error ER_BINLOG_ROW_INJECTION_AND_STMT_MODE
-BINLOG '
-cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB
-cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE=
-';
-SELECT * FROM t /* should be empty */;
-
---echo * Same statement, but db filtered out - no error
-# This is a Table_map_event and a Write_rows_event. Together, they are
-# equivalent to 'INSERT INTO t VALUES (1)'.
-USE other;
-BINLOG '
-cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB
-cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE=
-';
-USE test;
-SELECT * FROM t /* should contain the value 1 */;
-DELETE FROM t;
-
---echo * Unsafe statement and binlog_format=statement
-# This will give a warning.
-INSERT INTO t VALUES (COALESCE(1, UUID()));
-SELECT * FROM t /* should contain the value 1 */;
-DELETE FROM t;
-
---echo * Same statement, but db filtered out - no message
-USE other;
-INSERT INTO test.t VALUES (COALESCE(1, UUID()));
-USE test;
-SELECT * FROM t /* should contain the value 1 */;
-DELETE FROM t;
-
-
---echo ---- master: binlog_format=mixed, slave: binlog_format=statement ----
-
-SET @@global.binlog_format = MIXED;
-SET @@session.binlog_format = MIXED;
-
---echo * Row injection and binlog_format=statement: in slave sql thread
-INSERT INTO t VALUES (COALESCE(1, UUID()));
---echo [on slave]
---connection slave
-# 1666 = ER_BINLOG_ROW_INJECTION_AND_STMT_MODE
---let $slave_sql_errno= 1666
---let $show_sql_error= 1
---source include/wait_for_slave_sql_error_and_skip.inc
---connection slave
-SELECT * FROM t /* should be empty */;
---echo [on master]
---connection master
-
-
---echo ==== Clean up ====
-
-DROP TRIGGER trig_autoinc;
-DROP TRIGGER trig_double_autoinc;
-DROP TABLE t, t_self_logging, t_row, t_stmt, t_slave_stmt, t_autoinc, t_double_autoinc;
-DROP DATABASE other;
-SET @@global.binlog_format = @old_binlog_format;
-SET @@session.binlog_format = @old_binlog_format;
-UNINSTALL PLUGIN example;
---echo [on slave]
---sync_slave_with_master
-SET @@global.binlog_format = @old_binlog_format;
-SET @@session.binlog_format = @old_binlog_format;
-UNINSTALL PLUGIN example;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test
deleted file mode 100644
index a79c62e2a10..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test
+++ /dev/null
@@ -1,144 +0,0 @@
---source include/have_ndb.inc
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
---source include/have_binlog_format_mixed_or_row.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
deleted file mode 100644
index 26946450e07..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test
+++ /dev/null
@@ -1,15 +0,0 @@
-#################################
-# Wrapper for rpl_row_blob.test #
-# Using wrapper to share test #
-# code between engine tests #
-#################################
-#
-# Since the master generates row-based events, the slave may not be in
-# STATEMENT mode to accept the events.
-#
--- source include/have_binlog_format_mixed_or_row.inc
--- 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_circular.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
deleted file mode 100644
index b8b7c520973..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
+++ /dev/null
@@ -1,56 +0,0 @@
---source include/have_ndb.inc
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
---source include/have_binlog_format_mixed_or_row.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;
-sync_slave_with_master 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
-sync_slave_with_master 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;
-source include/check_slave_is_running.inc;
-# connect to master and ensure data it there.
---connection master
-SELECT * FROM t1 ORDER BY a;
-#SELECT * FROM t2 ORDER BY a;
-source include/check_slave_is_running.inc;
-
-# stop replication on "master" as not to replicate
-# shutdown circularly, eg drop table
---connection master
-STOP SLAVE;
-
-# cleanup
---connection master
-DROP TABLE t1;
--- sync_slave_with_master
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf
deleted file mode 100644
index 76e6e3f8caa..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf
+++ /dev/null
@@ -1,22 +0,0 @@
-!include ../my.cnf
-
-[mysqld.1.1]
-server-id= 1
-
-[mysqld.2.1]
-server-id= 1
-
-[mysqld.1.slave]
-server-id= 2
-skip-slave-start
-
-[mysqld.2.slave]
-server-id= 2
-init-rpl-role= slave
-skip-slave-start
-ndb_connectstring= @mysql_cluster.slave.ndb_connectstring
-
-[ENV]
-
-SLAVE_MYPORT1= @mysqld.2.slave.port
-SLAVE_MYSOCK1= @mysqld.2.slave.socket
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test
deleted file mode 100644
index 8721e85780d..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test
+++ /dev/null
@@ -1,172 +0,0 @@
-#############################################################
-# Author: Serge Kozlov <skozlov@mysql.com>
-# Date: 03/17/2008
-# Purpose: Testing cluster circular replication based on two
-# independent channels between two clusters
-#############################################################
---source include/have_ndb.inc
---source include/ndb_master-slave_2ch.inc
---source include/have_binlog_format_mixed_or_row.inc
---echo
-
-# Check server_id and set auto_increment_* variables
---echo *** Check server_id of mysqld servers ***
---connection master
-SHOW VARIABLES LIKE "server_id";
-SET auto_increment_offset = 1;
-SET auto_increment_increment = 2;
---connection master1
-SHOW VARIABLES LIKE "server_id";
-SET auto_increment_offset = 1;
-SET auto_increment_increment = 2;
---connection slave
-SHOW VARIABLES LIKE "server_id";
-SET auto_increment_offset = 2;
-SET auto_increment_increment = 2;
---connection slave1
-SHOW VARIABLES LIKE "server_id";
-SET auto_increment_offset = 2;
-SET auto_increment_increment = 2;
---echo
-
-# Preparing data.
---echo *** Preparing data ***
---connection master
-CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=ndb;
-
-let $wait_binlog_event= CREATE TABLE t1;
---source include/wait_for_binlog_event.inc
---connection master1
---source include/wait_for_binlog_event.inc
---connection slave
---source include/wait_for_binlog_event.inc
---connection slave1
---source include/wait_for_binlog_event.inc
---echo
-
-#
-# Testing
-#
-
---echo *** Basic testing ***
-# insert data via all hosts
---echo Insert rows via all hosts
---disable_query_log
-let $counter= 10;
-while ($counter) {
- --connection master
- INSERT INTO t1(b,c) VALUES('master',1);
- --connection master1
- INSERT INTO t1(b,c) VALUES('master1',1);
- --connection slave
- INSERT INTO t1(b,c) VALUES('slave',1);
- --connection slave1
- INSERT INTO t1(b,c) VALUES('slave1',1);
- dec $counter;
-}
---connection master
---enable_query_log
-
-# Wait replication between clusters
-let $wait_condition= SELECT COUNT(*)=40 FROM t1 WHERE c = 1;
---source include/wait_condition.inc
---connection slave
---source include/wait_condition.inc
-
-# Check data
---echo Check data on both clusters
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
-
-source include/diff_tables.inc;
-
---echo *** Transaction testing ***
-# Start transaction for one mysqld and do mass of inserts for other.
-# Do it for for both clusters
-
---connection master
-BEGIN;
---connection slave1
-BEGIN;
-let $counter= 100;
---connection master
---disable_query_log
-while ($counter) {
- --connection master
- INSERT INTO t1(b,c) VALUES('master',2);
- --connection master1
- INSERT INTO t1(b,c) VALUES('master1',2);
- --connection slave
- INSERT INTO t1(b,c) VALUES('slave',2);
- --connection slave1
- INSERT INTO t1(b,c) VALUES('slave1',2);
- dec $counter;
-}
---connection master
---enable_query_log
-COMMIT;
---connection slave1
-COMMIT;
-
-# Wait replication between clusters
---connection master
-let $wait_condition= SELECT COUNT(*)=400 FROM t1 WHERE c = 2;
---source include/wait_condition.inc
---connection slave
---source include/wait_condition.inc
-
---echo Check data on both clusters
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
-
-source include/diff_tables.inc;
-
-# Start transaction and then roll back
-
---connection master
-BEGIN;
---connection slave1
-BEGIN;
-let $counter= 100;
---connection master
---disable_query_log
-while ($counter) {
- --connection master
- INSERT INTO t1(b,c) VALUES('master',3);
- --connection master1
- INSERT INTO t1(b,c) VALUES('master1',3);
- --connection slave
- INSERT INTO t1(b,c) VALUES('slave',3);
- --connection slave1
- INSERT INTO t1(b,c) VALUES('slave1',3);
- dec $counter;
-}
---connection master
---enable_query_log
-ROLLBACK;
---connection slave1
-ROLLBACK;
-
-# Wait replication between clusters
---connection master
-let $wait_condition= SELECT COUNT(*)=200 FROM t1 WHERE c = 3;
---source include/wait_condition.inc
---connection slave
---source include/wait_condition.inc
-
---echo Check data on both clusters
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
-
-source include/diff_tables.inc;
-
-# Clean up
---connection master
-DROP TABLE t1;
---connection slave
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
---echo
-
-# End of test 5.1
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
deleted file mode 100644
index 74e841c6c4d..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
+++ /dev/null
@@ -1,82 +0,0 @@
---source include/have_ndb.inc
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
---source include/have_binlog_format_mixed_or_row.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;
-sync_slave_with_master 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
-source include/check_slave_is_running.inc;
-
-# 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
-source include/check_slave_is_running.inc;
-
-connection master;
-DROP TABLE t1;
-
-sync_slave_with_master;
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
deleted file mode 100644
index cf3eb9589d2..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test
+++ /dev/null
@@ -1,14 +0,0 @@
-#####################################
-# Wrapper for rpl_commit_after_flush#
-# Wrapped to reuse test code on #
-# Different engines #
-# By JBM 2004-02-15 #
-#####################################
-
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
--- 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_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
deleted file mode 100644
index 711ec42bd8a..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---collation-server=ucs2_unicode_ci --character-set-server=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
deleted file mode 100644
index cb99d049266..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test
+++ /dev/null
@@ -1,46 +0,0 @@
---source include/have_ucs2.inc
---source include/have_ndb.inc
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
---source include/have_binlog_format_mixed_or_row.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` ( `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;
-
---echo ==== clean up ====
-connection master;
-DROP TABLE t1;
-sync_slave_with_master;
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
deleted file mode 100644
index ac0ab01f8dd..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test
+++ /dev/null
@@ -1,85 +0,0 @@
---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
deleted file mode 100644
index 075c6392dde..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---new
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
deleted file mode 100644
index 075c6392dde..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---new
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
deleted file mode 100644
index c84854e89e8..00000000000
--- a/mysql-test/suite/rpl_ndb/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_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
deleted file mode 100644
index 654d1c08944..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test
+++ /dev/null
@@ -1,33 +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/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
deleted file mode 100644
index c06d1a62fef..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test
+++ /dev/null
@@ -1,11 +0,0 @@
-#########################################
-# By JBM 2006-02-14 Test wrapping to #
-# Share test code between engine tests #
-#########################################
---source include/have_ndb.inc
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
---source include/have_binlog_format_mixed_or_row.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/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt
deleted file mode 100644
index fb5e378b65f..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-do-db=replica
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
deleted file mode 100644
index 750ae377350..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test
+++ /dev/null
@@ -1,59 +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
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
---source include/have_binlog_format_mixed_or_row.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_do_table-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt
deleted file mode 100644
index da345474216..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-do-table=test.t1
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
deleted file mode 100644
index 4598795cead..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test
+++ /dev/null
@@ -1,48 +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
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
---source include/have_binlog_format_mixed_or_row.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
deleted file mode 100644
index 9cf4f8dba0b..00000000000
--- a/mysql-test/suite/rpl_ndb/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_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
deleted file mode 100644
index 5f0fd3dfe49..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test
+++ /dev/null
@@ -1,16 +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
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
--- 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_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
deleted file mode 100644
index 99c9df40094..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test
+++ /dev/null
@@ -1,109 +0,0 @@
---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
-SELECT * FROM t1 ORDER BY c3;
-
-source include/check_slave_is_running.inc;
-
-# 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 ;
-
-source include/check_slave_no_error.inc;
-
-# 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
-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;
-source include/check_slave_is_running.inc;
-
-connection master;
-DROP TABLE IF EXISTS t1;
-
-# End of 5.1 Test
--- source include/master-slave-end.inc
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
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
deleted file mode 100644
index b63ef44e8fc..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---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
deleted file mode 100644
index 92374c26742..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.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/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/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
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
deleted file mode 100644
index 66531172894..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test
+++ /dev/null
@@ -1,69 +0,0 @@
-# Test of a transaction mixing the two engines
-
--- source include/have_ndb.inc
--- source include/have_innodb.inc
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
--- source include/have_binlog_format_mixed_or_row.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/rpl_loaddata.dat' into table t2;
-load data infile '../../../std_data/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/rpl_loaddata.dat' into table t2;
-load data infile '../../../std_data/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/rpl_loaddata.dat' into table t2;
-load data infile '../../../std_data/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
deleted file mode 100644
index be6f71eb5b5..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test
+++ /dev/null
@@ -1,11 +0,0 @@
-#####################################
-# Wrapper for rpl_insert_ignore.test#
-#####################################
--- source include/have_ndb.inc
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
--- source include/have_binlog_format_mixed_or_row.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
deleted file mode 100644
index 75fe2688b4a..00000000000
--- a/mysql-test/suite/rpl_ndb/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/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=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/DbCreate >> $NDB_TOOLS_OUTPUT
---exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/DbAsyncGenerator >> $NDB_TOOLS_OUTPUT
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt
deleted file mode 100644
index e0d075c3fbd..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---skip-external-locking
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test
deleted file mode 100644
index d32a05bf92a..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_log.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/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_mixed_engines_transactions-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-master.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-slave.opt
deleted file mode 100644
index 48457b17309..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test
deleted file mode 100644
index d93c5328000..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test
+++ /dev/null
@@ -1,476 +0,0 @@
-# ==== Purpose ====
-#
-# Tests that transactions containing multiple table types are
-# replicated correctly to the slave.
-#
-# This test was previously part of rpl_ndb_transactions.
-#
-#
-# ==== Method ====
-#
-# Try all combinations of the following:
-# - Committed/rollback transactions.
-# - Transactions started by AUTOCOMMIT = 0 or BEGIN.
-# - Transactions using myisam, innodb, or ndb tables, or combinations
-# of them. For combinations, we use the engines in all possible
-# orders.
-# For single-engine transactions, we also try with AUTOCOMMIT = 1.
-#
-#
-# ==== Related bugs ====
-#
-# BUG#26395: if crash during autocommit update to transactional table on master, slave fails
-
-
-source include/have_ndb.inc;
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
-source include/have_binlog_format_mixed_or_row.inc;
-source include/ndb_master-slave.inc;
-source include/have_innodb.inc;
-
-CREATE TABLE tmyisam (a int) ENGINE = MYISAM;
-CREATE TABLE tinnodb (a int) ENGINE = INNODB;
-CREATE TABLE tndb (a int) ENGINE = NDB;
-
-SHOW CREATE TABLE tmyisam;
-SHOW CREATE TABLE tinnodb;
-SHOW CREATE TABLE tndb;
-
-
---echo [on master]
-
-
---echo ==== Single-engine transactions ====
-
---echo ---- autocommitted ----
-
-SET AUTOCOMMIT = 1;
-
-INSERT INTO tmyisam VALUES (0);
-INSERT INTO tinnodb VALUES (1);
-INSERT INTO tndb VALUES (2);
-
---echo ---- committed with BEGIN ----
-
-BEGIN;
-INSERT INTO tmyisam VALUES (3);
-INSERT INTO tmyisam VALUES (4);
-COMMIT;
-
-BEGIN;
-INSERT INTO tinnodb VALUES (5);
-INSERT INTO tinnodb VALUES (6);
-COMMIT;
-
-BEGIN;
-INSERT INTO tndb VALUES (7);
-INSERT INTO tndb VALUES (8);
-COMMIT;
-
---echo ---- rolled back with BEGIN ----
-
-BEGIN;
-INSERT INTO tmyisam VALUES (9);
-INSERT INTO tmyisam VALUES (10);
-ROLLBACK;
-
-BEGIN;
-INSERT INTO tinnodb VALUES (11);
-INSERT INTO tinnodb VALUES (12);
-ROLLBACK;
-
-BEGIN;
-INSERT INTO tndb VALUES (13);
-INSERT INTO tndb VALUES (14);
-ROLLBACK;
-
-
---echo ---- committed with AUTOCOMMIT = 0 ----
-
-SET AUTOCOMMIT = 0;
-
-INSERT INTO tmyisam VALUES (15);
-INSERT INTO tmyisam VALUES (16);
-COMMIT;
-
-INSERT INTO tinnodb VALUES (17);
-INSERT INTO tinnodb VALUES (18);
-COMMIT;
-
-INSERT INTO tndb VALUES (19);
-INSERT INTO tndb VALUES (20);
-COMMIT;
-
---echo ---- rolled back with AUTOCOMMIT = 0 ----
-
-INSERT INTO tmyisam VALUES (21);
-INSERT INTO tmyisam VALUES (22);
-ROLLBACK;
-
-INSERT INTO tinnodb VALUES (23);
-INSERT INTO tinnodb VALUES (24);
-ROLLBACK;
-
-INSERT INTO tndb VALUES (25);
-INSERT INTO tndb VALUES (26);
-ROLLBACK;
-
-SET AUTOCOMMIT = 1;
-
-
---echo ==== MyISAM + InnoDB ====
-
---echo ---- committed with BEGIN ----
-
-BEGIN;
-INSERT INTO tmyisam VALUES (27);
-INSERT INTO tinnodb VALUES (28);
-COMMIT;
-
-BEGIN;
-INSERT INTO tinnodb VALUES (29);
-INSERT INTO tmyisam VALUES (30);
-COMMIT;
-
---echo ---- rolled back with BEGIN ----
-
-BEGIN;
-INSERT INTO tmyisam VALUES (31);
-INSERT INTO tinnodb VALUES (32);
-ROLLBACK;
-
-BEGIN;
-INSERT INTO tinnodb VALUES (33);
-INSERT INTO tmyisam VALUES (34);
-ROLLBACK;
-
---echo ---- committed with AUTOCOMMIT = 0 ----
-
-SET AUTOCOMMIT = 0;
-
-INSERT INTO tmyisam VALUES (35);
-INSERT INTO tinnodb VALUES (36);
-COMMIT;
-
-INSERT INTO tinnodb VALUES (37);
-INSERT INTO tmyisam VALUES (38);
-COMMIT;
-
---echo ---- rolled back with AUTOCOMMIT = 0 ----
-
-INSERT INTO tmyisam VALUES (39);
-INSERT INTO tinnodb VALUES (40);
-ROLLBACK;
-
-INSERT INTO tinnodb VALUES (41);
-INSERT INTO tmyisam VALUES (42);
-ROLLBACK;
-
-SET AUTOCOMMIT = 1;
-
-
---echo ==== MyISAM + NDB ====
-
---echo ---- committed with BEGIN----
-
-BEGIN;
-INSERT INTO tmyisam VALUES (43);
-INSERT INTO tndb VALUES (44);
-COMMIT;
-
-BEGIN;
-INSERT INTO tndb VALUES (45);
-INSERT INTO tmyisam VALUES (46);
-COMMIT;
-
---echo ---- rolled back with BEGIN ----
-
-BEGIN;
-INSERT INTO tmyisam VALUES (47);
-INSERT INTO tndb VALUES (48);
-ROLLBACK;
-
-BEGIN;
-INSERT INTO tndb VALUES (49);
-INSERT INTO tmyisam VALUES (50);
-ROLLBACK;
-
---echo ---- committed with AUTOCOMMIT = 0 ----
-
-SET AUTOCOMMIT = 0;
-
-INSERT INTO tmyisam VALUES (51);
-INSERT INTO tndb VALUES (52);
-COMMIT;
-
-INSERT INTO tndb VALUES (53);
-INSERT INTO tmyisam VALUES (54);
-COMMIT;
-
---echo ---- rolled back with AUTOCOMMIT = 0 ----
-
-INSERT INTO tmyisam VALUES (55);
-INSERT INTO tndb VALUES (56);
-ROLLBACK;
-
-INSERT INTO tndb VALUES (57);
-INSERT INTO tmyisam VALUES (58);
-ROLLBACK;
-
-SET AUTOCOMMIT = 1;
-
-
---echo ==== InnoDB + NDB ====
-
---echo ---- committed with BEGIN ----
-
-BEGIN;
-INSERT INTO tinnodb VALUES (59);
-INSERT INTO tndb VALUES (60);
-COMMIT;
-
-BEGIN;
-INSERT INTO tndb VALUES (61);
-INSERT INTO tinnodb VALUES (62);
-COMMIT;
-
---echo ---- rolled back with BEGIN ----
-
-BEGIN;
-INSERT INTO tinnodb VALUES (63);
-INSERT INTO tndb VALUES (64);
-ROLLBACK;
-
-BEGIN;
-INSERT INTO tndb VALUES (65);
-INSERT INTO tinnodb VALUES (66);
-ROLLBACK;
-
---echo ---- committed with AUTOCOMMIT = 0 ----
-
-SET AUTOCOMMIT = 0;
-
-INSERT INTO tinnodb VALUES (67);
-INSERT INTO tndb VALUES (68);
-COMMIT;
-
-INSERT INTO tndb VALUES (69);
-INSERT INTO tinnodb VALUES (70);
-COMMIT;
-
---echo ---- rolled back with AUTOCOMMIT = 0 ----
-
-INSERT INTO tinnodb VALUES (71);
-INSERT INTO tndb VALUES (72);
-ROLLBACK;
-
-INSERT INTO tndb VALUES (73);
-INSERT INTO tinnodb VALUES (74);
-ROLLBACK;
-
-SET AUTOCOMMIT = 1;
-
-
---echo ==== MyISAM + InnoDB + NDB ====
-
---echo ---- committed with BEGIN ----
-
-BEGIN;
-INSERT INTO tmyisam VALUES (75);
-INSERT INTO tinnodb VALUES (76);
-INSERT INTO tndb VALUES (77);
-COMMIT;
-
-BEGIN;
-INSERT INTO tmyisam VALUES (78);
-INSERT INTO tndb VALUES (79);
-INSERT INTO tinnodb VALUES (80);
-COMMIT;
-
-BEGIN;
-INSERT INTO tinnodb VALUES (81);
-INSERT INTO tmyisam VALUES (82);
-INSERT INTO tndb VALUES (83);
-COMMIT;
-
-BEGIN;
-INSERT INTO tinnodb VALUES (84);
-INSERT INTO tndb VALUES (85);
-INSERT INTO tmyisam VALUES (86);
-COMMIT;
-
-BEGIN;
-INSERT INTO tndb VALUES (87);
-INSERT INTO tmyisam VALUES (88);
-INSERT INTO tinnodb VALUES (89);
-COMMIT;
-
-BEGIN;
-INSERT INTO tndb VALUES (90);
-INSERT INTO tinnodb VALUES (91);
-INSERT INTO tmyisam VALUES (92);
-COMMIT;
-
---echo ---- rolled back with BEGIN ----
-
-BEGIN;
-INSERT INTO tmyisam VALUES (93);
-INSERT INTO tinnodb VALUES (94);
-INSERT INTO tndb VALUES (95);
-ROLLBACK;
-
-BEGIN;
-INSERT INTO tmyisam VALUES (96);
-INSERT INTO tndb VALUES (97);
-INSERT INTO tinnodb VALUES (98);
-ROLLBACK;
-
-BEGIN;
-INSERT INTO tinnodb VALUES (99);
-INSERT INTO tmyisam VALUES (100);
-INSERT INTO tndb VALUES (101);
-ROLLBACK;
-
-BEGIN;
-INSERT INTO tinnodb VALUES (102);
-INSERT INTO tndb VALUES (103);
-INSERT INTO tmyisam VALUES (104);
-ROLLBACK;
-
-BEGIN;
-INSERT INTO tndb VALUES (105);
-INSERT INTO tmyisam VALUES (106);
-INSERT INTO tinnodb VALUES (107);
-ROLLBACK;
-
-BEGIN;
-INSERT INTO tndb VALUES (108);
-INSERT INTO tinnodb VALUES (109);
-INSERT INTO tmyisam VALUES (110);
-ROLLBACK;
-
---echo ---- committed with AUTOCOMMIT = 0 ----
-
-SET AUTOCOMMIT = 0;
-
-INSERT INTO tmyisam VALUES (111);
-INSERT INTO tinnodb VALUES (112);
-INSERT INTO tndb VALUES (113);
-COMMIT;
-
-INSERT INTO tmyisam VALUES (114);
-INSERT INTO tndb VALUES (115);
-INSERT INTO tinnodb VALUES (116);
-COMMIT;
-
-INSERT INTO tinnodb VALUES (117);
-INSERT INTO tmyisam VALUES (118);
-INSERT INTO tndb VALUES (119);
-COMMIT;
-
-INSERT INTO tinnodb VALUES (120);
-INSERT INTO tndb VALUES (121);
-INSERT INTO tmyisam VALUES (122);
-COMMIT;
-
-INSERT INTO tndb VALUES (123);
-INSERT INTO tmyisam VALUES (124);
-INSERT INTO tinnodb VALUES (125);
-COMMIT;
-
-INSERT INTO tndb VALUES (126);
-INSERT INTO tinnodb VALUES (127);
-INSERT INTO tmyisam VALUES (128);
-COMMIT;
-
---echo ---- rolled back with AUTOCOMMIT = 0 ----
-
-INSERT INTO tmyisam VALUES (129);
-INSERT INTO tinnodb VALUES (130);
-INSERT INTO tndb VALUES (131);
-ROLLBACK;
-
-INSERT INTO tmyisam VALUES (132);
-INSERT INTO tndb VALUES (133);
-INSERT INTO tinnodb VALUES (134);
-ROLLBACK;
-
-INSERT INTO tinnodb VALUES (135);
-INSERT INTO tmyisam VALUES (136);
-INSERT INTO tndb VALUES (137);
-ROLLBACK;
-
-INSERT INTO tinnodb VALUES (138);
-INSERT INTO tndb VALUES (139);
-INSERT INTO tmyisam VALUES (140);
-ROLLBACK;
-
-INSERT INTO tndb VALUES (141);
-INSERT INTO tmyisam VALUES (142);
-INSERT INTO tinnodb VALUES (143);
-ROLLBACK;
-
-INSERT INTO tndb VALUES (144);
-INSERT INTO tinnodb VALUES (145);
-INSERT INTO tmyisam VALUES (146);
-ROLLBACK;
-
-SET AUTOCOMMIT = 1;
-
---echo ---- Mixed statements Innodb ----
-
-BEGIN;
-INSERT INTO tndb VALUES (147);
-INSERT INTO tinnodb SELECT * FROM tndb ORDER BY a DESC LIMIT 1;
-COMMIT;
-
-INSERT INTO tndb VALUES (148);
-BEGIN;
-INSERT INTO tinnodb SELECT * FROM tndb ORDER BY a DESC LIMIT 1;
-INSERT INTO tndb VALUES (149);
-COMMIT;
-
-BEGIN;
-INSERT INTO tndb VALUES (150);
-INSERT INTO tmyisam SELECT * FROM tndb ORDER BY a DESC LIMIT 1;
-COMMIT;
-
-INSERT INTO tndb VALUES (151);
-BEGIN;
-INSERT INTO tmyisam SELECT * FROM tndb ORDER BY a DESC LIMIT 1;
-INSERT INTO tndb VALUES (152);
-COMMIT;
-
---echo ==== Verify the result ====
-
-SELECT * FROM tmyisam ORDER BY a;
-SELECT * FROM tinnodb ORDER BY a;
-SELECT * FROM tndb ORDER BY a;
-
---echo [on slave]
---sync_slave_with_master
-
-let $diff_table_1=master:test.tmyisam;
-let $diff_table_2=slave:test.tmyisam;
-source include/diff_tables.inc;
-
-let $diff_table_1=master:test.tinnodb;
-let $diff_table_2=slave:test.tinnodb;
-source include/diff_tables.inc;
-
-let $diff_table_1=master:test.tndb;
-let $diff_table_2=slave:test.tndb;
-source include/diff_tables.inc;
-
-
---echo ==== Clean up ====
-
---echo [on master]
-connection master;
-DROP TABLE tmyisam, tinnodb, tndb;
-
---echo [on slave]
-sync_slave_with_master;
-
-source include/master-slave-end.inc;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_implicit_commit_binlog.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_implicit_commit_binlog.test
deleted file mode 100644
index d70d9b48834..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_implicit_commit_binlog.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Check file extra/rpl_tests/rpl_implicit_commit_binlog.test
-################################################################################
---source include/have_binlog_format_mixed.inc
---source include/have_ndb.inc
---source include/ndb_master-slave.inc
-
---let $engine=NDB
---source extra/rpl_tests/rpl_implicit_commit_binlog.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-master.opt
deleted file mode 100644
index 0f4722c3fbd..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb --ndbcluster
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt
deleted file mode 100644
index a8829991a6d..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb --ndbcluster --replicate-ignore-table=mysql.ndb_apply_status
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test
deleted file mode 100644
index 17f2d00cbf6..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test
+++ /dev/null
@@ -1,374 +0,0 @@
-# ==== Purpose ====
-#
-# Test replication of transactions on tables which have different
-# engines on master and slave. This tests all combinations of innodb,
-# myisam, and ndb.
-#
-# ==== Method ====
-#
-# Set up six tables, each being innodb, myisam, or innodb on master,
-# and another of innodb, myisam, or innodb on slave. For each table,
-# do the following:
-#
-# - committed and rollback'ed transactions, with autocommit on and
-# off
-# - non-transactions with autocommit on
-# - non-transactions with autocommit off, where the master table is
-# myisam.
-#
-# Note: we are running the slave with
-# --replicate-ignore-table=mysql.ndb_apply_status . See BUG#34557 for
-# explanation.
-#
-# ==== Related bugs ====
-#
-# BUG#26395: if crash during autocommit update to transactional table on master, slave fails
-# BUG#29288: myisam transactions replicated to a transactional slave leaves slave unstable
-# BUG#34557: Row-based replication from ndb to non-ndb gives error on slave
-# BUG#34600: Rolled-back punch transactions not replicated correctly
-#
-# ==== Todo ====
-#
-# We should eventually try transactions touching two tables which are
-# of different engines on the same server (so that we try, e.g. punch
-# transactions; cf BUG#34600). However, that will make the test much
-# bigger (9 master-slave engine combinations [myisam->myisam,
-# myisam->ndb, etc]. To try all combinations of one or more such
-# tables means 2^9-1=511 transactions. We need to multiplied by 5
-# since we want to test committed/rollback'ed transactions
-# with/without AUTOCOMMIT, as well as non-transactions with
-# autocommit). We'd have to write a script to produce the test case.
-
-
---echo ==== Initialization ====
-
---source include/have_ndb.inc
---source include/have_innodb.inc
---source include/ndb_master-slave.inc
---source include/have_binlog_format_mixed_or_row.inc
-
---echo ---- setup master ----
-
-CREATE TABLE myisam_innodb (a INT) ENGINE=MYISAM;
-CREATE TABLE innodb_myisam (a INT) ENGINE=INNODB;
-CREATE TABLE myisam_ndb (a INT) ENGINE=MYISAM;
-CREATE TABLE ndb_myisam (a INT) ENGINE=NDB;
-CREATE TABLE innodb_ndb (a INT) ENGINE=INNODB;
-CREATE TABLE ndb_innodb (a INT) ENGINE=NDB;
-
-SHOW CREATE TABLE myisam_innodb;
-SHOW CREATE TABLE innodb_myisam;
-SHOW CREATE TABLE myisam_ndb;
-SHOW CREATE TABLE ndb_myisam;
-SHOW CREATE TABLE innodb_ndb;
-SHOW CREATE TABLE ndb_innodb;
-
---echo ---- setup slave with different engines ----
-
-sync_slave_with_master;
-
-DROP TABLE myisam_innodb, innodb_myisam;
-DROP TABLE myisam_ndb, ndb_myisam;
-DROP TABLE innodb_ndb, ndb_innodb;
-
-CREATE TABLE myisam_innodb (a INT) ENGINE=INNODB;
-CREATE TABLE innodb_myisam (a INT) ENGINE=MYISAM;
-CREATE TABLE myisam_ndb (a INT) ENGINE=NDB;
-CREATE TABLE ndb_myisam (a INT) ENGINE=MYISAM;
-CREATE TABLE innodb_ndb (a INT) ENGINE=NDB;
-CREATE TABLE ndb_innodb (a INT) ENGINE=INNODB;
-
-SHOW CREATE TABLE myisam_innodb;
-SHOW CREATE TABLE innodb_myisam;
-SHOW CREATE TABLE myisam_ndb;
-SHOW CREATE TABLE ndb_myisam;
-SHOW CREATE TABLE innodb_ndb;
-SHOW CREATE TABLE ndb_innodb;
-
-connection master;
-
-
---echo ==== AUTOCOMMIT=0, transactions ====
-
---echo ---- COMMIT ----
-
-SET AUTOCOMMIT = 0;
-
-BEGIN;
-INSERT INTO myisam_innodb VALUES (1);
-INSERT INTO myisam_innodb VALUES (2);
-COMMIT;
-sync_slave_with_master;
-connection master;
-BEGIN;
-INSERT INTO innodb_myisam VALUES (3);
-INSERT INTO innodb_myisam VALUES (4);
-COMMIT;
-sync_slave_with_master;
-connection master;
-
-BEGIN;
-INSERT INTO myisam_ndb VALUES (5);
-INSERT INTO myisam_ndb VALUES (6);
-COMMIT;
-sync_slave_with_master;
-connection master;
-BEGIN;
-INSERT INTO ndb_myisam VALUES (7);
-INSERT INTO ndb_myisam VALUES (8);
-COMMIT;
-sync_slave_with_master;
-connection master;
-
-BEGIN;
-INSERT INTO ndb_innodb VALUES (9);
-INSERT INTO ndb_innodb VALUES (10);
-COMMIT;
-sync_slave_with_master;
-connection master;
-BEGIN;
-INSERT INTO innodb_ndb VALUES (11);
-INSERT INTO innodb_ndb VALUES (12);
-COMMIT;
-sync_slave_with_master;
-connection master;
-
---echo ---- ROLLBACK ----
-
-# This test does not work in ROW mode after the changes introduced in
-# BUG#40116. After WL#2687 is pushed, Tests should be added again.
---disable_parsing
-BEGIN;
-INSERT INTO myisam_innodb VALUES (13);
-INSERT INTO myisam_innodb VALUES (14);
-ROLLBACK;
-sync_slave_with_master;
---enable_parsing
-connection master;
-BEGIN;
-INSERT INTO innodb_myisam VALUES (15);
-INSERT INTO innodb_myisam VALUES (16);
-ROLLBACK;
-sync_slave_with_master;
-connection master;
-
-# This test does not work in ROW mode after the changes introduced in
-# BUG#40116. After WL#2687 is pushed, these tests should be enabled
-# again.
---disable_parsing
-BEGIN;
-INSERT INTO myisam_ndb VALUES (17);
-INSERT INTO myisam_ndb VALUES (18);
-ROLLBACK;
-sync_slave_with_master;
-connection master;
---enable_parsing
-BEGIN;
-INSERT INTO ndb_myisam VALUES (19);
-INSERT INTO ndb_myisam VALUES (20);
-ROLLBACK;
-sync_slave_with_master;
-connection master;
-
-BEGIN;
-INSERT INTO ndb_innodb VALUES (21);
-INSERT INTO ndb_innodb VALUES (22);
-ROLLBACK;
-sync_slave_with_master;
-connection master;
-BEGIN;
-INSERT INTO innodb_ndb VALUES (23);
-INSERT INTO innodb_ndb VALUES (24);
-ROLLBACK;
-sync_slave_with_master;
-connection master;
-
-
---echo ==== AUTOCOMMIT=1, transactions ====
-
---echo ---- COMMIT ----
-
-SET AUTOCOMMIT = 1;
-
-BEGIN;
-INSERT INTO myisam_innodb VALUES (25);
-INSERT INTO myisam_innodb VALUES (26);
-COMMIT;
-sync_slave_with_master;
-connection master;
-BEGIN;
-INSERT INTO innodb_myisam VALUES (27);
-INSERT INTO innodb_myisam VALUES (28);
-COMMIT;
-sync_slave_with_master;
-connection master;
-
-BEGIN;
-INSERT INTO myisam_ndb VALUES (29);
-INSERT INTO myisam_ndb VALUES (30);
-COMMIT;
-sync_slave_with_master;
-connection master;
-BEGIN;
-INSERT INTO ndb_myisam VALUES (31);
-INSERT INTO ndb_myisam VALUES (32);
-COMMIT;
-sync_slave_with_master;
-connection master;
-
-BEGIN;
-INSERT INTO ndb_innodb VALUES (33);
-INSERT INTO ndb_innodb VALUES (34);
-COMMIT;
-sync_slave_with_master;
-connection master;
-BEGIN;
-INSERT INTO innodb_ndb VALUES (35);
-INSERT INTO innodb_ndb VALUES (36);
-COMMIT;
-sync_slave_with_master;
-connection master;
-
---echo ---- ROLLBACK ----
-
-# This test does not work in ROW mode after the changes introduced in
-# BUG#40116. After WL#2687 is pushed, these tests should be enabled
-# again.
---disable_parsing
-BEGIN;
-INSERT INTO myisam_innodb VALUES (37);
-INSERT INTO myisam_innodb VALUES (38);
-ROLLBACK;
-sync_slave_with_master;
-connection master;
---enable_parsing
-BEGIN;
-INSERT INTO innodb_myisam VALUES (39);
-INSERT INTO innodb_myisam VALUES (40);
-ROLLBACK;
-sync_slave_with_master;
-connection master;
-
-# This test does not work in ROW mode after the changes introduced in
-# BUG#40116. After WL#2687 is pushed, these tests should be enabled
-# again.
---disable_parsing
-BEGIN;
-INSERT INTO myisam_ndb VALUES (41);
-INSERT INTO myisam_ndb VALUES (42);
-ROLLBACK;
-sync_slave_with_master;
-connection master;
---enable_parsing
-BEGIN;
-INSERT INTO ndb_myisam VALUES (43);
-INSERT INTO ndb_myisam VALUES (44);
-ROLLBACK;
-sync_slave_with_master;
-connection master;
-
-BEGIN;
-INSERT INTO ndb_innodb VALUES (45);
-INSERT INTO ndb_innodb VALUES (46);
-ROLLBACK;
-sync_slave_with_master;
-connection master;
-BEGIN;
-INSERT INTO innodb_ndb VALUES (47);
-INSERT INTO innodb_ndb VALUES (48);
-ROLLBACK;
-sync_slave_with_master;
-connection master;
-
-
---echo ==== AUTOCOMMIT=1, single statements ====
-
-INSERT INTO myisam_innodb VALUES (49);
-INSERT INTO myisam_innodb VALUES (50);
-sync_slave_with_master;
-connection master;
-INSERT INTO innodb_myisam VALUES (51);
-INSERT INTO innodb_myisam VALUES (52);
-sync_slave_with_master;
-connection master;
-
-INSERT INTO myisam_ndb VALUES (53);
-INSERT INTO myisam_ndb VALUES (54);
-sync_slave_with_master;
-connection master;
-INSERT INTO ndb_myisam VALUES (55);
-INSERT INTO ndb_myisam VALUES (56);
-sync_slave_with_master;
-connection master;
-
-INSERT INTO ndb_innodb VALUES (57);
-INSERT INTO ndb_innodb VALUES (58);
-sync_slave_with_master;
-connection master;
-INSERT INTO innodb_ndb VALUES (59);
-INSERT INTO innodb_ndb VALUES (60);
-sync_slave_with_master;
-connection master;
-
-
---echo ==== AUTOCOMMIT=0, single statements, myisam on master ====
-
-SET AUTOCOMMIT = 0;
-
-# These tests do not work in ROW mode after the changes introduced in
-# BUG#40116. After WL#2687 is pushed, these tests should be enabled
-# again.
---disable_parsing
-# This tests BUG#29288.
-INSERT INTO myisam_innodb VALUES (61);
-INSERT INTO myisam_innodb VALUES (62);
-sync_slave_with_master;
-connection master;
-
-INSERT INTO myisam_ndb VALUES (63);
-INSERT INTO myisam_ndb VALUES (64);
-sync_slave_with_master;
-connection master;
---enable_parsing
-
-
---echo ==== Show results ====
-
-SELECT * FROM myisam_innodb ORDER BY a;
-SELECT * FROM innodb_myisam ORDER BY a;
-SELECT * FROM myisam_ndb ORDER BY a;
-SELECT * FROM ndb_myisam ORDER BY a;
-SELECT * FROM innodb_ndb ORDER BY a;
-SELECT * FROM ndb_innodb ORDER BY a;
-
-let $diff_table_1=master:test.myisam_innodb;
-let $diff_table_2=slave:test.myisam_innodb;
-source include/diff_tables.inc;
-
-let $diff_table_1=master:test.innodb_myisam;
-let $diff_table_2=slave:test.innodb_myisam;
-source include/diff_tables.inc;
-
-let $diff_table_1=master:test.myisam_ndb;
-let $diff_table_2=slave:test.myisam_ndb;
-source include/diff_tables.inc;
-
-let $diff_table_1=master:test.ndb_myisam;
-let $diff_table_2=slave:test.ndb_myisam;
-source include/diff_tables.inc;
-
-let $diff_table_1=master:test.innodb_ndb;
-let $diff_table_2=slave:test.innodb_ndb;
-source include/diff_tables.inc;
-
-let $diff_table_1=master:test.ndb_innodb;
-let $diff_table_2=slave:test.ndb_innodb;
-source include/diff_tables.inc;
-
-
---echo ==== Clean up ====
-
-drop table myisam_innodb, innodb_myisam;
-drop table myisam_ndb, ndb_myisam;
-drop table innodb_ndb, ndb_innodb;
-sync_slave_with_master;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test
deleted file mode 100644
index 800362db67a..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test
+++ /dev/null
@@ -1,73 +0,0 @@
---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>
---replace_regex /master_log_pos = [0-9]+/master_log_pos = BINLOG_START/
-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;
-
-# 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;
-SELECT * FROM t1 ORDER BY c3;
-
---echo ==== clean up ====
-connection server2;
-DROP TABLE t1;
-sync_slave_with_master;
-
-STOP SLAVE;
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt
deleted file mode 100644
index 17d4171af0e..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-ignore-table=nothing.sensible
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
deleted file mode 100644
index 6b86f8146f8..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test
+++ /dev/null
@@ -1,13 +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_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
deleted file mode 100644
index 0375fd7fe6d..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test
+++ /dev/null
@@ -1,11 +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
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
--- 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_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
deleted file mode 100644
index b63ef44e8fc..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---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
deleted file mode 100644
index a9e56d17139..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test
+++ /dev/null
@@ -1,14 +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/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
deleted file mode 100644
index 2211d2dbb2d..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt
+++ /dev/null
@@ -1,3 +0,0 @@
---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
deleted file mode 100644
index b0b9dd9e7da..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test
+++ /dev/null
@@ -1,9 +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
--- source include/ndb_master-slave.inc
-let $engine_type=NDB;
--- source extra/rpl_tests/rpl_relayrotate.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt
deleted file mode 100644
index 6262cf451a6..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-ignore-db=test --replicate-ignore-table=replica.t1
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
deleted file mode 100644
index 2d0c87927a5..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test
+++ /dev/null
@@ -1,60 +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
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
---source include/have_binlog_format_mixed_or_row.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
deleted file mode 100644
index c711e6ddfa3..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test
+++ /dev/null
@@ -1,10 +0,0 @@
-########################################################
-# By JBM 2005-02-15 Wrapped to allow reuse of test code#
-########################################################
---source include/have_ndb.inc
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
---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_001.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_implicit_commit_binlog.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_implicit_commit_binlog.test
deleted file mode 100644
index 3ddf659f1e9..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_implicit_commit_binlog.test
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Check file extra/rpl_tests/rpl_implicit_commit_binlog.test
-################################################################################
---source include/have_binlog_format_row.inc
---source include/have_ndb.inc
---source include/ndb_master-slave.inc
-
---let $engine=NDB
---source extra/rpl_tests/rpl_implicit_commit_binlog.test
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_set_null.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_set_null.test
deleted file mode 100644
index 454807d9591..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_set_null.test
+++ /dev/null
@@ -1,6 +0,0 @@
--- source include/have_ndb.inc
--- source include/have_binlog_format_mixed_or_row.inc
--- source include/ndb_master-slave.inc
-
--- let $engine= NDB
--- source extra/rpl_tests/rpl_set_null.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
deleted file mode 100644
index a8dab098df5..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test
+++ /dev/null
@@ -1,13 +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
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
--- source include/have_binlog_format_mixed_or_row.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
deleted file mode 100644
index f005d9cd67a..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test
+++ /dev/null
@@ -1,13 +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
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
--- source include/have_binlog_format_mixed_or_row.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
deleted file mode 100644
index 416f8692654..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb --default-storage-engine=innodb
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-slave.opt
deleted file mode 100644
index 96f0ce3f36c..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-slave.opt
+++ /dev/null
@@ -1 +0,0 @@
---default-storage-engine=MyISAM
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
deleted file mode 100644
index 5e54ca38dc1..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test
+++ /dev/null
@@ -1,40 +0,0 @@
-#############################################
-#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/ndb_master-slave.inc
---enable_query_log
-
-# statement format is supported because master uses innodb
-SET binlog_format = STATEMENT;
-let $off_set = 6;
-let $rpl_format = 'SBR';
-disable_query_log;
-call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-enable_query_log;
---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
deleted file mode 100644
index 152839c8676..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test
+++ /dev/null
@@ -1,101 +0,0 @@
---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="$NDB_CONNECTSTRING_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="$NDB_CONNECTSTRING_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="$NDB_CONNECTSTRING_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="$NDB_CONNECTSTRING_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
---source include/check_slave_is_running.inc
-
-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
deleted file mode 100644
index 1fef32b7a65..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test
+++ /dev/null
@@ -1,17 +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_ndb.inc
-# Since the master generates row-based events, the slave must be in
-# ROW or MIXED mode to accept the events.
--- source include/have_binlog_format_mixed_or_row.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
deleted file mode 100644
index 543393b980d..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test
+++ /dev/null
@@ -1,11 +0,0 @@
--- 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 "$NDB_CONNECTSTRING" $SLAVE_MYSOCK "$NDB_CONNECTSTRING_SLAVE" >> $NDB_EXAMPLES_OUTPUT
-
---exec echo Running mgmapi_logevent
---exec $NDB_EXAMPLES_DIR/mgmapi_logevent/mgmapi_logevent "$NDB_CONNECTSTRING" "$NDB_CONNECTSTRING_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
deleted file mode 100644
index 3a17de1bc9e..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test
+++ /dev/null
@@ -1,8 +0,0 @@
--- 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
deleted file mode 100644
index d3b80297ffc..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test
+++ /dev/null
@@ -1,66 +0,0 @@
-
---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;
---source include/show_binlog_events.inc
-
---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;
---source include/show_binlog_events.inc
-
--- source include/master-slave-end.inc
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2-master.opt
deleted file mode 100644
index 01cf3e0520f..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---binlog-format=mixed
diff --git a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test
deleted file mode 100644
index 549227db61a..00000000000
--- a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test
+++ /dev/null
@@ -1,11 +0,0 @@
-# Same test as rpl_truncate_7ndb.test, but with mixed mode
-# This is marked with 'big_test' just because the rpl_truncate_7ndb test is
-# so slow...
-
-# Last Change: 2008-09-03
-# Change Author: pcrews
-# Change: Moved test to rpl_ndb suite, updated location of --source .test file
-
---source include/have_binlog_format_mixed.inc
---source include/big_test.inc
---source suite/rpl_ndb/t/rpl_truncate_7ndb.test
diff --git a/mysql-test/suite/stress/r/ddl_ndb.result b/mysql-test/suite/stress/r/ddl_ndb.result
deleted file mode 100644
index 05c29456f7c..00000000000
--- a/mysql-test/suite/stress/r/ddl_ndb.result
+++ /dev/null
@@ -1,216 +0,0 @@
-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 NOT NULL) ENGINE=NDB
-# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) 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 NOT NULL) ENGINE=NDB
-# default: CREATE TABLE t1 (f1 BIGINT NOT NULL) 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 NOT NULL) ENGINE=NDB
-# con2: CREATE TABLE t1 (f1 BIGINT NOT NULL) 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 NOT NULL) ENGINE=NDB
-# con2: CREATE TABLE t1 (f1 BIGINT NOT NULL) 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_ndb.test b/mysql-test/suite/stress/t/ddl_ndb.test
deleted file mode 100644
index 1e0a3680f8a..00000000000
--- a/mysql-test/suite/stress/t/ddl_ndb.test
+++ /dev/null
@@ -1,58 +0,0 @@
-######## 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
-connection default;
-
-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/suite/sys_vars/inc/autocommit_func2.inc b/mysql-test/suite/sys_vars/inc/autocommit_func2.inc
new file mode 100644
index 00000000000..5fff72157b4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/autocommit_func2.inc
@@ -0,0 +1,29 @@
+--source include/have_innodb.inc
+
+CREATE TABLE t1
+(
+id INT NOT NULL auto_increment,
+PRIMARY KEY (id),
+name varchar(30)
+) ENGINE = INNODB;
+
+SELECT @@global.autocommit;
+SELECT @@autocommit;
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+ROLLBACK;
+SELECT * from t1;
+
+set @@global.autocommit = 1-@@global.autocommit;
+set @@autocommit = 1-@@autocommit;
+SELECT @@global.autocommit;
+SELECT @@autocommit;
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+ROLLBACK;
+SELECT * from t1;
+
+DROP TABLE t1;
+set @@global.autocommit = 1-@@global.autocommit;
diff --git a/mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc b/mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc
new file mode 100644
index 00000000000..f5df54b7acd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc
@@ -0,0 +1,154 @@
+################ mysql-test\t\binlog_stmt_cache_size_basic.test ################
+# #
+# Variable Name: binlog_stmt_cache_size #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: Numeric #
+# Default Value: 32768 #
+# Range: 4096 - 4294967295 #
+# #
+# #
+# Creation Date: 2010-10-12 #
+# Author: Alfranio Correia #
+# #
+# Description: Test Cases of Dynamic System Variable "binlog_stmt_cache_size" #
+# that checks behavior of this variable in the following ways #
+# * Default Value #
+# * Valid & Invalid values #
+# * Scope & Access method #
+# * Data Integrity . #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.5/en/ #
+# server-system-variables.html#option_mysqld_binlog_stmt_cache_size #
+# #
+################################################################################
+
+#################################################################
+# START OF binlog_stmt_cache_size TESTS #
+#################################################################
+
+#########################################################################
+# Saving initial value of binlog_stmt_cache_size in a temporary variable #
+#########################################################################
+
+SET @start_value = @@global.binlog_stmt_cache_size;
+SELECT @start_value;
+
+--echo '#--------------------FN_DYNVARS_006_01------------------------#'
+#########################################################################
+# Display the DEFAULT value of binlog_stmt_cache_size #
+#########################################################################
+
+SET @@global.binlog_stmt_cache_size = 100;
+SET @@global.binlog_stmt_cache_size = DEFAULT;
+SELECT @@global.binlog_stmt_cache_size;
+
+
+--echo '#---------------------FN_DYNVARS_006_02-------------------------#'
+###############################################
+# Verify default value of variable #
+###############################################
+
+SET @@global.binlog_stmt_cache_size = @start_value;
+SELECT @@global.binlog_stmt_cache_size = 32768;
+
+
+--echo '#--------------------FN_DYNVARS_006_03------------------------#'
+#########################################################################
+# Change the value of binlog_stmt_cache_size to a valid value #
+#########################################################################
+
+SET @@global.binlog_stmt_cache_size = 4096;
+SELECT @@global.binlog_stmt_cache_size;
+SET @@global.binlog_stmt_cache_size = 4294967295;
+SELECT @@global.binlog_stmt_cache_size;
+SET @@global.binlog_stmt_cache_size = 10000;
+SELECT @@global.binlog_stmt_cache_size;
+SET @@global.binlog_stmt_cache_size = 21221204;
+SELECT @@global.binlog_stmt_cache_size;
+echo 'Bug: Invalid values are coming in variable on assigning valid values';
+
+
+--echo '#--------------------FN_DYNVARS_006_04-------------------------#'
+############################################################################
+# Change the value of binlog_stmt_cache_size to invalid value #
+############################################################################
+
+SET @@global.binlog_stmt_cache_size = 1024;
+SELECT @@global.binlog_stmt_cache_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.binlog_stmt_cache_size = 10000.01;
+SET @@global.binlog_stmt_cache_size = -1024;
+SELECT @@global.binlog_stmt_cache_size;
+SET @@global.binlog_stmt_cache_size = 42949672950;
+SELECT @@global.binlog_stmt_cache_size;
+echo 'Bug: Errors are not coming on assigning invalid values to variable';
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.binlog_stmt_cache_size = ON;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.binlog_stmt_cache_size = 'test';
+
+
+--echo '#-------------------FN_DYNVARS_006_05----------------------------#'
+############################################################################
+# Test if accessing session binlog_stmt_cache_size gives error #
+############################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.binlog_stmt_cache_size = 0;
+
+
+--echo '#----------------------FN_DYNVARS_006_06------------------------#'
+##############################################################################
+# Check if the value in GLOBAL Tables matches values in variable #
+##############################################################################
+
+SELECT @@global.binlog_stmt_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_stmt_cache_size';
+
+--echo '#---------------------FN_DYNVARS_006_07----------------------#'
+###################################################################
+# Check if TRUE and FALSE values can be used on variable #
+###################################################################
+
+SET @@global.binlog_stmt_cache_size = TRUE;
+SELECT @@global.binlog_stmt_cache_size;
+SET @@global.binlog_stmt_cache_size = FALSE;
+SELECT @@global.binlog_stmt_cache_size;
+echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
+
+--echo '#---------------------FN_DYNVARS_006_08----------------------#'
+###############################################################################
+# Check if accessing variable without SCOPE points to same global variable #
+###############################################################################
+
+SET @@global.binlog_stmt_cache_size = 1;
+SELECT @@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size;
+
+--echo '#---------------------FN_DYNVARS_006_09----------------------#'
+###########################################################################
+# Check if binlog_stmt_cache_size can be accessed with and without @@ sign#
+###########################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET binlog_stmt_cache_size = 1;
+--Error ER_PARSE_ERROR
+SET global.binlog_stmt_cache_size = 1;
+--Error ER_UNKNOWN_TABLE
+SELECT global.binlog_stmt_cache_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT binlog_stmt_cache_size = @@session.binlog_stmt_cache_size;
+
+
+##############################
+# Restore initial value #
+##############################
+
+SET @@global.binlog_stmt_cache_size = @start_value;
+SELECT @@global.binlog_stmt_cache_size;
+
+
+###########################################################
+# END OF binlog_stmt_cache_size TESTS #
+###########################################################
diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result
index 0f741ff930a..af05e3bc393 100644
--- a/mysql-test/suite/sys_vars/r/all_vars.result
+++ b/mysql-test/suite/sys_vars/r/all_vars.result
@@ -3,6 +3,7 @@ create table t2 (variable_name text);
load data infile "MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1;
insert into t2 select variable_name from information_schema.global_variables;
insert into t2 select variable_name from information_schema.session_variables;
+delete from t2 where variable_name='innodb_change_buffering_debug';
update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_");
select variable_name as `There should be *no* long test name listed below:` from t2
where length(variable_name) > 50;
diff --git a/mysql-test/suite/sys_vars/r/autocommit_func2.result b/mysql-test/suite/sys_vars/r/autocommit_func2.result
new file mode 100644
index 00000000000..5fcb50526f2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/autocommit_func2.result
@@ -0,0 +1,46 @@
+CREATE TABLE t1
+(
+id INT NOT NULL auto_increment,
+PRIMARY KEY (id),
+name varchar(30)
+) ENGINE = INNODB;
+SELECT @@global.autocommit;
+@@global.autocommit
+1
+SELECT @@autocommit;
+@@autocommit
+1
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+id name
+1 Record_1
+2 Record_2
+ROLLBACK;
+SELECT * from t1;
+id name
+1 Record_1
+2 Record_2
+set @@global.autocommit = 1-@@global.autocommit;
+set @@autocommit = 1-@@autocommit;
+SELECT @@global.autocommit;
+@@global.autocommit
+0
+SELECT @@autocommit;
+@@autocommit
+0
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+id name
+1 Record_1
+2 Record_2
+3 Record_1
+4 Record_2
+ROLLBACK;
+SELECT * from t1;
+id name
+1 Record_1
+2 Record_2
+DROP TABLE t1;
+set @@global.autocommit = 1-@@global.autocommit;
diff --git a/mysql-test/suite/sys_vars/r/autocommit_func3.result b/mysql-test/suite/sys_vars/r/autocommit_func3.result
new file mode 100644
index 00000000000..6807c594cb1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/autocommit_func3.result
@@ -0,0 +1,42 @@
+CREATE TABLE t1
+(
+id INT NOT NULL auto_increment,
+PRIMARY KEY (id),
+name varchar(30)
+) ENGINE = INNODB;
+SELECT @@global.autocommit;
+@@global.autocommit
+0
+SELECT @@autocommit;
+@@autocommit
+0
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+id name
+1 Record_1
+2 Record_2
+ROLLBACK;
+SELECT * from t1;
+id name
+set @@global.autocommit = 1-@@global.autocommit;
+set @@autocommit = 1-@@autocommit;
+SELECT @@global.autocommit;
+@@global.autocommit
+1
+SELECT @@autocommit;
+@@autocommit
+1
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+id name
+3 Record_1
+4 Record_2
+ROLLBACK;
+SELECT * from t1;
+id name
+3 Record_1
+4 Record_2
+DROP TABLE t1;
+set @@global.autocommit = 1-@@global.autocommit;
diff --git a/mysql-test/suite/sys_vars/r/autocommit_func4.result b/mysql-test/suite/sys_vars/r/autocommit_func4.result
new file mode 100644
index 00000000000..5fcb50526f2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/autocommit_func4.result
@@ -0,0 +1,46 @@
+CREATE TABLE t1
+(
+id INT NOT NULL auto_increment,
+PRIMARY KEY (id),
+name varchar(30)
+) ENGINE = INNODB;
+SELECT @@global.autocommit;
+@@global.autocommit
+1
+SELECT @@autocommit;
+@@autocommit
+1
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+id name
+1 Record_1
+2 Record_2
+ROLLBACK;
+SELECT * from t1;
+id name
+1 Record_1
+2 Record_2
+set @@global.autocommit = 1-@@global.autocommit;
+set @@autocommit = 1-@@autocommit;
+SELECT @@global.autocommit;
+@@global.autocommit
+0
+SELECT @@autocommit;
+@@autocommit
+0
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+id name
+1 Record_1
+2 Record_2
+3 Record_1
+4 Record_2
+ROLLBACK;
+SELECT * from t1;
+id name
+1 Record_1
+2 Record_2
+DROP TABLE t1;
+set @@global.autocommit = 1-@@global.autocommit;
diff --git a/mysql-test/suite/sys_vars/r/autocommit_func5.result b/mysql-test/suite/sys_vars/r/autocommit_func5.result
new file mode 100644
index 00000000000..6807c594cb1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/autocommit_func5.result
@@ -0,0 +1,42 @@
+CREATE TABLE t1
+(
+id INT NOT NULL auto_increment,
+PRIMARY KEY (id),
+name varchar(30)
+) ENGINE = INNODB;
+SELECT @@global.autocommit;
+@@global.autocommit
+0
+SELECT @@autocommit;
+@@autocommit
+0
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+id name
+1 Record_1
+2 Record_2
+ROLLBACK;
+SELECT * from t1;
+id name
+set @@global.autocommit = 1-@@global.autocommit;
+set @@autocommit = 1-@@autocommit;
+SELECT @@global.autocommit;
+@@global.autocommit
+1
+SELECT @@autocommit;
+@@autocommit
+1
+INSERT into t1(name) values('Record_1');
+INSERT into t1(name) values('Record_2');
+SELECT * from t1;
+id name
+3 Record_1
+4 Record_2
+ROLLBACK;
+SELECT * from t1;
+id name
+3 Record_1
+4 Record_2
+DROP TABLE t1;
+set @@global.autocommit = 1-@@global.autocommit;
diff --git a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result
new file mode 100644
index 00000000000..604f671d5a4
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_32.result
@@ -0,0 +1,108 @@
+SET @start_value = @@global.binlog_stmt_cache_size;
+SELECT @start_value;
+@start_value
+32768
+'#--------------------FN_DYNVARS_006_01------------------------#'
+SET @@global.binlog_stmt_cache_size = 100;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '100'
+SET @@global.binlog_stmt_cache_size = DEFAULT;
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+32768
+'#---------------------FN_DYNVARS_006_02-------------------------#'
+SET @@global.binlog_stmt_cache_size = @start_value;
+SELECT @@global.binlog_stmt_cache_size = 32768;
+@@global.binlog_stmt_cache_size = 32768
+1
+'#--------------------FN_DYNVARS_006_03------------------------#'
+SET @@global.binlog_stmt_cache_size = 4096;
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '4294967295'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4294963200
+SET @@global.binlog_stmt_cache_size = 10000;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '10000'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+8192
+SET @@global.binlog_stmt_cache_size = 21221204;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '21221204'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+21217280
+'Bug: Invalid values are coming in variable on assigning valid values'
+'#--------------------FN_DYNVARS_006_04-------------------------#'
+SET @@global.binlog_stmt_cache_size = 1024;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1024'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size'
+SET @@global.binlog_stmt_cache_size = -1024;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '-1024'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = 42949672950;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '42949672950'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4294963200
+'Bug: Errors are not coming on assigning invalid values to variable'
+SET @@global.binlog_stmt_cache_size = ON;
+ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size'
+SET @@global.binlog_stmt_cache_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size'
+'#-------------------FN_DYNVARS_006_05----------------------------#'
+SET @@session.binlog_stmt_cache_size = 0;
+ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+'#----------------------FN_DYNVARS_006_06------------------------#'
+SELECT @@global.binlog_stmt_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_stmt_cache_size';
+@@global.binlog_stmt_cache_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_006_07----------------------#'
+SET @@global.binlog_stmt_cache_size = TRUE;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = FALSE;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '0'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+'Bug: Errors are not coming on assigning TRUE/FALSE to variable'
+'#---------------------FN_DYNVARS_006_08----------------------#'
+SET @@global.binlog_stmt_cache_size = 1;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1'
+SELECT @@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size;
+@@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size
+1
+'#---------------------FN_DYNVARS_006_09----------------------#'
+SET binlog_stmt_cache_size = 1;
+ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SET global.binlog_stmt_cache_size = 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 'binlog_stmt_cache_size = 1' at line 1
+SELECT global.binlog_stmt_cache_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT binlog_stmt_cache_size = @@session.binlog_stmt_cache_size;
+ERROR 42S22: Unknown column 'binlog_stmt_cache_size' in 'field list'
+SET @@global.binlog_stmt_cache_size = @start_value;
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+32768
diff --git a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result
new file mode 100644
index 00000000000..7cb553e48ee
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_basic_64.result
@@ -0,0 +1,108 @@
+SET @start_value = @@global.binlog_stmt_cache_size;
+SELECT @start_value;
+@start_value
+32768
+'#--------------------FN_DYNVARS_006_01------------------------#'
+SET @@global.binlog_stmt_cache_size = 100;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '100'
+SET @@global.binlog_stmt_cache_size = DEFAULT;
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+32768
+'#---------------------FN_DYNVARS_006_02-------------------------#'
+SET @@global.binlog_stmt_cache_size = @start_value;
+SELECT @@global.binlog_stmt_cache_size = 32768;
+@@global.binlog_stmt_cache_size = 32768
+1
+'#--------------------FN_DYNVARS_006_03------------------------#'
+SET @@global.binlog_stmt_cache_size = 4096;
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '4294967295'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4294963200
+SET @@global.binlog_stmt_cache_size = 10000;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '10000'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+8192
+SET @@global.binlog_stmt_cache_size = 21221204;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '21221204'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+21217280
+'Bug: Invalid values are coming in variable on assigning valid values'
+'#--------------------FN_DYNVARS_006_04-------------------------#'
+SET @@global.binlog_stmt_cache_size = 1024;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1024'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size'
+SET @@global.binlog_stmt_cache_size = -1024;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '-1024'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = 42949672950;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '42949672950'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+42949668864
+'Bug: Errors are not coming on assigning invalid values to variable'
+SET @@global.binlog_stmt_cache_size = ON;
+ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size'
+SET @@global.binlog_stmt_cache_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'binlog_stmt_cache_size'
+'#-------------------FN_DYNVARS_006_05----------------------------#'
+SET @@session.binlog_stmt_cache_size = 0;
+ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+'#----------------------FN_DYNVARS_006_06------------------------#'
+SELECT @@global.binlog_stmt_cache_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='binlog_stmt_cache_size';
+@@global.binlog_stmt_cache_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_006_07----------------------#'
+SET @@global.binlog_stmt_cache_size = TRUE;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+SET @@global.binlog_stmt_cache_size = FALSE;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '0'
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+4096
+'Bug: Errors are not coming on assigning TRUE/FALSE to variable'
+'#---------------------FN_DYNVARS_006_08----------------------#'
+SET @@global.binlog_stmt_cache_size = 1;
+Warnings:
+Warning 1292 Truncated incorrect binlog_stmt_cache_size value: '1'
+SELECT @@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size;
+@@binlog_stmt_cache_size = @@global.binlog_stmt_cache_size
+1
+'#---------------------FN_DYNVARS_006_09----------------------#'
+SET binlog_stmt_cache_size = 1;
+ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SET global.binlog_stmt_cache_size = 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 'binlog_stmt_cache_size = 1' at line 1
+SELECT global.binlog_stmt_cache_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT binlog_stmt_cache_size = @@session.binlog_stmt_cache_size;
+ERROR 42S22: Unknown column 'binlog_stmt_cache_size' in 'field list'
+SET @@global.binlog_stmt_cache_size = @start_value;
+SELECT @@global.binlog_stmt_cache_size;
+@@global.binlog_stmt_cache_size
+32768
diff --git a/mysql-test/suite/sys_vars/r/external_user_basic.result b/mysql-test/suite/sys_vars/r/external_user_basic.result
new file mode 100644
index 00000000000..7cb85fb612d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/external_user_basic.result
@@ -0,0 +1,3 @@
+SELECT @@SESSION.EXTERNAL_USER FROM DUAL;
+@@SESSION.EXTERNAL_USER
+NULL
diff --git a/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result b/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result
index 9b1736541c1..398a2a76eb8 100644
--- a/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result
+++ b/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result
@@ -26,7 +26,7 @@ INSERT INTO t2 values (20,22);
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`b`) REFERENCES `t1` (`a`))
'---Check when foreign_key_checks is disabled---'
TRUNCATE t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`b`) REFERENCES `t1` (`a`))
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`b`) REFERENCES `test`.`t1` (`a`))
SET @@session.foreign_key_checks = 0;
TRUNCATE t1;
TRUNCATE t2;
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result
index 41369038cf6..58e009ea705 100644
--- a/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_file_format_basic.result
@@ -1,28 +1,28 @@
SET @start_global_value = @@global.innodb_file_format;
SELECT @start_global_value;
@start_global_value
-Barracuda
+Antelope
Valid values are 'Antelope' and 'Barracuda'
select @@global.innodb_file_format in ('Antelope', 'Barracuda');
@@global.innodb_file_format in ('Antelope', 'Barracuda')
1
select @@global.innodb_file_format;
@@global.innodb_file_format
-Barracuda
+Antelope
select @@session.innodb_file_format;
ERROR HY000: Variable 'innodb_file_format' is a GLOBAL variable
show global variables like 'innodb_file_format';
Variable_name Value
-innodb_file_format Barracuda
+innodb_file_format Antelope
show session variables like 'innodb_file_format';
Variable_name Value
-innodb_file_format Barracuda
+innodb_file_format Antelope
select * from information_schema.global_variables where variable_name='innodb_file_format';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT Barracuda
+INNODB_FILE_FORMAT Antelope
select * from information_schema.session_variables where variable_name='innodb_file_format';
VARIABLE_NAME VARIABLE_VALUE
-INNODB_FILE_FORMAT Barracuda
+INNODB_FILE_FORMAT Antelope
set global innodb_file_format='Antelope';
select @@global.innodb_file_format;
@@global.innodb_file_format
@@ -56,4 +56,4 @@ ERROR 42000: Variable 'innodb_file_format' can't be set to the value of 'Salmon'
SET @@global.innodb_file_format = @start_global_value;
SELECT @@global.innodb_file_format;
@@global.innodb_file_format
-Barracuda
+Antelope
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result
index baf06092126..55de5adbc33 100644
--- a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result
+++ b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result
@@ -64,12 +64,12 @@ SET last = pct;
END IF;
END WHILE;
END//
-CREATE PROCEDURE check_pct(IN num DECIMAL)
+CREATE PROCEDURE check_pct(IN success_on_wait BOOLEAN)
BEGIN
-IF (dirty_pct() < num) THEN
+IF (success_on_wait > 0) THEN
SELECT 'BELOW_MAX' AS PCT_VALUE;
ELSE
-SELECT 'ABOVE_MAX' AS PCT_VALUE;
+SELECT 'ABOVE_MAX or TimeOut Of The Test' AS PCT_VALUE;
END IF;
END//
CREATE TABLE t1(
@@ -83,7 +83,7 @@ CALL add_until(10);
FLUSH TABLES;
CALL add_records(500);
'We expect dirty pages pct to be BELOW_MAX after some time depending on performance'
-CALL check_pct(10);
+CALL check_pct(1);
PCT_VALUE
BELOW_MAX
DROP PROCEDURE add_records;
diff --git a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
index 32048a7cfb0..ffa43415bd3 100644
--- a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
@@ -7,6 +7,7 @@ SET @@global.max_allowed_packet = DEFAULT;
SET @@global.max_allowed_packet = 1000;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '1000'
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SET @@global.max_allowed_packet = DEFAULT;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
@@ -25,12 +26,15 @@ SELECT @@global.max_allowed_packet = 1048576;
1
'#--------------------FN_DYNVARS_070_03-------------------------#'
SET @@global.max_allowed_packet = 1024;
+Warnings:
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
SET @@global.max_allowed_packet = 1025;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '1025'
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
@@ -74,18 +78,21 @@ SELECT @@session.max_allowed_packet;
SET @@global.max_allowed_packet = 0;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '0'
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
SET @@global.max_allowed_packet = -1024;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '-1024'
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
SET @@global.max_allowed_packet = 1023;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '1023'
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
@@ -148,17 +155,21 @@ WHERE VARIABLE_NAME='max_allowed_packet';
SET @@global.max_allowed_packet = TRUE;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '1'
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
SET @@global.max_allowed_packet = FALSE;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '0'
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
'#---------------------FN_DYNVARS_070_09----------------------#'
SET @@global.max_allowed_packet = 2048;
+Warnings:
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SELECT @@max_allowed_packet = @@global.max_allowed_packet;
@@max_allowed_packet = @@global.max_allowed_packet
0
diff --git a/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result
index 0d682b65aea..1e20776973c 100644
--- a/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result
+++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result
@@ -23,6 +23,8 @@ SELECT @@session.net_buffer_length;
'#--------------------FN_DYNVARS_070_02-------------------------#'
## Setting value of max_allowed packet and net_buffer_length to 1024 ##
SET @@global.max_allowed_packet = 1024;
+Warnings:
+Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SET @@global.net_buffer_length = 1024;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result
new file mode 100644
index 00000000000..f2229a0090b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_basic.result
@@ -0,0 +1,152 @@
+SET @start_value = @@global.max_binlog_stmt_cache_size;
+SELECT @start_value;
+@start_value
+18446744073709547520
+'#--------------------FN_DYNVARS_072_01------------------------#'
+SET @@global.max_binlog_stmt_cache_size = 5000;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '5000'
+SET @@global.max_binlog_stmt_cache_size = DEFAULT;
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+18446744073709547520
+'#---------------------FN_DYNVARS_072_02-------------------------#'
+SET @@global.max_binlog_stmt_cache_size = @start_value;
+SELECT @@global.max_binlog_stmt_cache_size = 4294967295;
+@@global.max_binlog_stmt_cache_size = 4294967295
+0
+'#--------------------FN_DYNVARS_072_03------------------------#'
+SET @@global.max_binlog_stmt_cache_size = 4096;
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = 4294967295;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4294967295'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4294963200
+SET @@global.max_binlog_stmt_cache_size = 4294967294;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4294967294'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4294963200
+SET @@global.max_binlog_stmt_cache_size = 4097;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4097'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = 65535;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '65535'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+61440
+'#--------------------FN_DYNVARS_072_04-------------------------#'
+SET @@global.max_binlog_stmt_cache_size = -1;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '-1'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = 100000000000;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '100000000000'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+99999997952
+SET @@global.max_binlog_stmt_cache_size = 10000.01;
+ERROR 42000: Incorrect argument type to variable 'max_binlog_stmt_cache_size'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+99999997952
+SET @@global.max_binlog_stmt_cache_size = -1024;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '-1024'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = 1024;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '1024'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = 4294967296;
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4294967296
+SET @@global.max_binlog_stmt_cache_size = 4095;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '4095'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = ON;
+ERROR 42000: Incorrect argument type to variable 'max_binlog_stmt_cache_size'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = 'test';
+ERROR 42000: Incorrect argument type to variable 'max_binlog_stmt_cache_size'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+'#-------------------FN_DYNVARS_072_05----------------------------#'
+SET @@session.max_binlog_stmt_cache_size = 4096;
+ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@session.max_binlog_stmt_cache_size;
+ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable
+'#----------------------FN_DYNVARS_072_06------------------------#'
+SELECT @@global.max_binlog_stmt_cache_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='max_binlog_stmt_cache_size';
+@@global.max_binlog_stmt_cache_size = VARIABLE_VALUE
+1
+SELECT @@max_binlog_stmt_cache_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='max_binlog_stmt_cache_size';
+@@max_binlog_stmt_cache_size = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_072_07----------------------#'
+SET @@global.max_binlog_stmt_cache_size = TRUE;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '1'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+SET @@global.max_binlog_stmt_cache_size = FALSE;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '0'
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+4096
+'#---------------------FN_DYNVARS_072_08----------------------#'
+SET @@global.max_binlog_stmt_cache_size = 5000;
+Warnings:
+Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '5000'
+SELECT @@max_binlog_stmt_cache_size = @@global.max_binlog_stmt_cache_size;
+@@max_binlog_stmt_cache_size = @@global.max_binlog_stmt_cache_size
+1
+'#---------------------FN_DYNVARS_072_09----------------------#'
+SET max_binlog_stmt_cache_size = 6000;
+ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
+SELECT @@max_binlog_stmt_cache_size;
+@@max_binlog_stmt_cache_size
+4096
+SET local.max_binlog_stmt_cache_size = 7000;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_stmt_cache_size = 7000' at line 1
+SELECT local.max_binlog_stmt_cache_size;
+ERROR 42S02: Unknown table 'local' in field list
+SET global.max_binlog_stmt_cache_size = 8000;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'max_binlog_stmt_cache_size = 8000' at line 1
+SELECT global.max_binlog_stmt_cache_size;
+ERROR 42S02: Unknown table 'global' in field list
+SELECT max_binlog_stmt_cache_size = @@session.max_binlog_stmt_cache_size;
+ERROR 42S22: Unknown column 'max_binlog_stmt_cache_size' in 'field list'
+SET @@global.max_binlog_stmt_cache_size = @start_value;
+SELECT @@global.max_binlog_stmt_cache_size;
+@@global.max_binlog_stmt_cache_size
+18446744073709547520
diff --git a/mysql-test/suite/sys_vars/r/max_long_data_size_basic.result b/mysql-test/suite/sys_vars/r/max_long_data_size_basic.result
new file mode 100644
index 00000000000..679a0d3611f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_long_data_size_basic.result
@@ -0,0 +1,14 @@
+select @@global.max_long_data_size=20;
+@@global.max_long_data_size=20
+0
+select @@session.max_long_data_size;
+ERROR HY000: Variable 'max_long_data_size' is a GLOBAL variable
+SELECT @@global.max_long_data_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='max_long_data_size';
+@@global.max_long_data_size = VARIABLE_VALUE
+1
+set global max_long_data_size=1;
+ERROR HY000: Variable 'max_long_data_size' is a read only variable
+set session max_long_data_size=1;
+ERROR HY000: Variable 'max_long_data_size' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
index cab81890503..4ed63abbc3d 100644
--- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
+++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
@@ -60,6 +60,13 @@ set session optimizer_switch="index_merge";
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'index_merge'
set session optimizer_switch="foobar";
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'foobar'
+#
+# Bug#59894 set optimizer_switch to e or d causes invalid
+# memory writes/valgrind warnings
+
+set global optimizer_switch = 'd';
+set global optimizer_switch = 'e';
+ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'e'
SET @@global.optimizer_switch = @start_global_value;
SELECT @@global.optimizer_switch;
@@global.optimizer_switch
diff --git a/mysql-test/suite/sys_vars/r/proxy_user_basic.result b/mysql-test/suite/sys_vars/r/proxy_user_basic.result
new file mode 100644
index 00000000000..7cc62bd9665
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/proxy_user_basic.result
@@ -0,0 +1,3 @@
+SELECT @@SESSION.PROXY_USER FROM DUAL;
+@@SESSION.PROXY_USER
+NULL
diff --git a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
index 36b467696be..3563ecbfe0a 100644
--- a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
+++ b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
connection slave
SET @start_max_connections= @@global.max_connections;
SET @start_init_slave= @@global.init_slave;
@@ -30,6 +26,7 @@ STOP SLAVE;
RESET MASTER;
RESET SLAVE;
START SLAVE;
+include/wait_for_slave_to_start.inc
SELECT @@global.max_connections = @start_max_connections + 1;
@@global.max_connections = @start_max_connections + 1
1
@@ -39,6 +36,7 @@ STOP SLAVE;
RESET MASTER;
RESET SLAVE;
START SLAVE;
+include/wait_for_slave_to_start.inc
SHOW VARIABLES LIKE 'init_slave';
Variable_name Value
init_slave SET @a=5
@@ -48,3 +46,4 @@ NULL
Expect NULL
SET @@global.max_connections= @start_max_connections;
SET @@global.init_slave= @start_init_slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/r/secure_file_priv2.result b/mysql-test/suite/sys_vars/r/secure_file_priv2.result
new file mode 100644
index 00000000000..ec91b6037d0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/secure_file_priv2.result
@@ -0,0 +1,6 @@
+CREATE TABLE t1 (c1 INT);
+LOAD DATA INFILE "t1.MYI" into table t1;
+ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+LOAD DATA INFILE "/test" into table t1;
+ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/shared_memory_base_name_basic.result b/mysql-test/suite/sys_vars/r/shared_memory_base_name_basic.result
index a94a906e121..356b3c9e879 100644
--- a/mysql-test/suite/sys_vars/r/shared_memory_base_name_basic.result
+++ b/mysql-test/suite/sys_vars/r/shared_memory_base_name_basic.result
@@ -1,20 +1,20 @@
select @@global.shared_memory_base_name;
@@global.shared_memory_base_name
-MYSQLTEST_VARDIR/tmp/mysqld.1.sock
+MYSQL_TMP_DIR/mysqld.1.sock
select @@session.shared_memory_base_name;
ERROR HY000: Variable 'shared_memory_base_name' is a GLOBAL variable
show global variables like 'shared_memory_base_name';
Variable_name Value
-shared_memory_base_name MYSQLTEST_VARDIR/tmp/mysqld.1.sock
+shared_memory_base_name MYSQL_TMP_DIR/mysqld.1.sock
show session variables like 'shared_memory_base_name';
Variable_name Value
-shared_memory_base_name MYSQLTEST_VARDIR/tmp/mysqld.1.sock
+shared_memory_base_name MYSQL_TMP_DIR/mysqld.1.sock
select * from information_schema.global_variables where variable_name='shared_memory_base_name';
VARIABLE_NAME VARIABLE_VALUE
-SHARED_MEMORY_BASE_NAME MYSQLTEST_VARDIR/tmp/mysqld.1.sock
+SHARED_MEMORY_BASE_NAME MYSQL_TMP_DIR/mysqld.1.sock
select * from information_schema.session_variables where variable_name='shared_memory_base_name';
VARIABLE_NAME VARIABLE_VALUE
-SHARED_MEMORY_BASE_NAME MYSQLTEST_VARDIR/tmp/mysqld.1.sock
+SHARED_MEMORY_BASE_NAME MYSQL_TMP_DIR/mysqld.1.sock
set global shared_memory_base_name=1;
ERROR HY000: Variable 'shared_memory_base_name' is a read only variable
set session shared_memory_base_name=1;
diff --git a/mysql-test/suite/sys_vars/t/all_vars.test b/mysql-test/suite/sys_vars/t/all_vars.test
index 74430787c26..d432aff7cc6 100644
--- a/mysql-test/suite/sys_vars/t/all_vars.test
+++ b/mysql-test/suite/sys_vars/t/all_vars.test
@@ -14,6 +14,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--source include/not_embedded.inc
+--source include/not_threadpool.inc
#
# load everything we want to include in the testing
@@ -61,6 +62,9 @@ eval load data infile "$MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t
insert into t2 select variable_name from information_schema.global_variables;
insert into t2 select variable_name from information_schema.session_variables;
+# This is only present in debug builds.
+delete from t2 where variable_name='innodb_change_buffering_debug';
+
# Performance schema variables are too long for files named
# 'mysql-test/suite/sys_vars/t/' ...
# ... 'performance_schema_events_waits_history_long_size_basic-master.opt'
diff --git a/mysql-test/suite/sys_vars/t/autocommit_func2-master.opt b/mysql-test/suite/sys_vars/t/autocommit_func2-master.opt
new file mode 100644
index 00000000000..85e5d17d5e8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/autocommit_func2-master.opt
@@ -0,0 +1 @@
+--autocommit=1
diff --git a/mysql-test/suite/sys_vars/t/autocommit_func2.test b/mysql-test/suite/sys_vars/t/autocommit_func2.test
new file mode 100644
index 00000000000..9bb4c26d5d5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/autocommit_func2.test
@@ -0,0 +1 @@
+--source suite/sys_vars/inc/autocommit_func2.inc
diff --git a/mysql-test/suite/sys_vars/t/autocommit_func3-master.opt b/mysql-test/suite/sys_vars/t/autocommit_func3-master.opt
new file mode 100644
index 00000000000..e0fa81e6eeb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/autocommit_func3-master.opt
@@ -0,0 +1 @@
+--autocommit=0
diff --git a/mysql-test/suite/sys_vars/t/autocommit_func3.test b/mysql-test/suite/sys_vars/t/autocommit_func3.test
new file mode 100644
index 00000000000..9bb4c26d5d5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/autocommit_func3.test
@@ -0,0 +1 @@
+--source suite/sys_vars/inc/autocommit_func2.inc
diff --git a/mysql-test/suite/sys_vars/t/autocommit_func4-master.opt b/mysql-test/suite/sys_vars/t/autocommit_func4-master.opt
new file mode 100644
index 00000000000..788990274dd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/autocommit_func4-master.opt
@@ -0,0 +1 @@
+--autocommit=on
diff --git a/mysql-test/suite/sys_vars/t/autocommit_func4.test b/mysql-test/suite/sys_vars/t/autocommit_func4.test
new file mode 100644
index 00000000000..9bb4c26d5d5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/autocommit_func4.test
@@ -0,0 +1 @@
+--source suite/sys_vars/inc/autocommit_func2.inc
diff --git a/mysql-test/suite/sys_vars/t/autocommit_func5-master.opt b/mysql-test/suite/sys_vars/t/autocommit_func5-master.opt
new file mode 100644
index 00000000000..409cb3ec891
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/autocommit_func5-master.opt
@@ -0,0 +1 @@
+--autocommit=off
diff --git a/mysql-test/suite/sys_vars/t/autocommit_func5.test b/mysql-test/suite/sys_vars/t/autocommit_func5.test
new file mode 100644
index 00000000000..9bb4c26d5d5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/autocommit_func5.test
@@ -0,0 +1 @@
+--source suite/sys_vars/inc/autocommit_func2.inc
diff --git a/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test
new file mode 100644
index 00000000000..fe8f89ccc16
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_32.test
@@ -0,0 +1,7 @@
+################################################################################
+# Wrapper for 32 bit machines #
+################################################################################
+
+--source include/have_32bit.inc
+--source suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test
new file mode 100644
index 00000000000..c4a2c95d42b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/binlog_stmt_cache_size_basic_64.test
@@ -0,0 +1,7 @@
+################################################################################
+# Wrapper for 64 bit machines #
+################################################################################
+
+--source include/have_64bit.inc
+--source suite/sys_vars/inc/binlog_stmt_cache_size_basic.inc
+
diff --git a/mysql-test/suite/sys_vars/t/disabled.def b/mysql-test/suite/sys_vars/t/disabled.def
index ba9f819f96b..1cabae00b6f 100644
--- a/mysql-test/suite/sys_vars/t/disabled.def
+++ b/mysql-test/suite/sys_vars/t/disabled.def
@@ -9,10 +9,9 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-query_cache_size_basic_32 : Bug#36747: Allocating a large query cache is not deterministic
-query_cache_size_basic_64 : Bug#36747: Allocating a large query cache is not deterministic
-transaction_prealloc_size_basic_32 : Bug#36747
-transaction_prealloc_size_basic_64 : Bug#36747
-#thread_cache_size_func : Bug#40575: 2008-11-07 joro main.thread_cache_size_func fails in pushbuild when run with pool of threads
-multi_range_count_basic_32 : no such variable
-multi_range_count_basic_64 : no such variable
+query_cache_size_basic_32 : Bug#11748572: Allocating a large query cache is not deterministic
+query_cache_size_basic_64 : Bug#11748572: Allocating a large query cache is not deterministic
+transaction_prealloc_size_basic_32 : Bug#11748572
+transaction_prealloc_size_basic_64 : Bug#11748572
+#thread_cache_size_func : Bug#11750172: 2008-11-07 joro main.thread_cache_size_func fails in pushbuild when run with pool of threads
+
diff --git a/mysql-test/suite/sys_vars/t/external_user_basic.test b/mysql-test/suite/sys_vars/t/external_user_basic.test
new file mode 100644
index 00000000000..3ba4c2d65a3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/external_user_basic.test
@@ -0,0 +1 @@
+SELECT @@SESSION.EXTERNAL_USER FROM DUAL;
diff --git a/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test b/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test
index 5786b9283be..14134a5fb95 100644
--- a/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test
+++ b/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test
@@ -76,7 +76,7 @@ INSERT INTO t2 values (20,22);
--echo '---Check when foreign_key_checks is disabled---'
#===========================================================
---Error ER_ROW_IS_REFERENCED_2
+--Error ER_TRUNCATE_ILLEGAL_FK
TRUNCATE t1;
SET @@session.foreign_key_checks = 0;
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
index b577ae5fcc4..c7a9e567e69 100644
--- a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
+++ b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
@@ -117,12 +117,12 @@ BEGIN
END WHILE;
END//
-CREATE PROCEDURE check_pct(IN num DECIMAL)
+CREATE PROCEDURE check_pct(IN success_on_wait BOOLEAN)
BEGIN
- IF (dirty_pct() < num) THEN
+ IF (success_on_wait > 0) THEN
SELECT 'BELOW_MAX' AS PCT_VALUE;
ELSE
- SELECT 'ABOVE_MAX' AS PCT_VALUE;
+ SELECT 'ABOVE_MAX or TimeOut Of The Test' AS PCT_VALUE;
END IF;
END//
@@ -155,7 +155,8 @@ let $wait_condition= SELECT (dirty_pct() <= @@global.innodb_max_dirty_pages_pct)
--source include/wait_condition.inc
--echo 'We expect dirty pages pct to be BELOW_MAX after some time depending on performance'
-CALL check_pct(10);
+# Value For $sucess will be set from include/wait_condition.inc file. It can have values 1 or 0. It will be 1 if dirty_pct() <= @@global.innodb_max_dirty_pages_pct else it will be 0.
+eval CALL check_pct($success);
DROP PROCEDURE add_records;
DROP PROCEDURE add_until;
DROP PROCEDURE check_pct;
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt b/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt
deleted file mode 100644
index 2cadd0c7b3f..00000000000
--- a/mysql-test/suite/sys_vars/t/max_binlog_cache_size_func-master.opt
+++ /dev/null
@@ -1,2 +0,0 @@
---log-bin
---loose-innodb
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test
new file mode 100644
index 00000000000..07a030c35a7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_binlog_stmt_cache_size_basic.test
@@ -0,0 +1,184 @@
+############ mysql-test\t\max_binlog_stmt_cache_size_basic.test ###############
+# #
+# Variable Name: max_binlog_stmt_cache_size #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: numeric #
+# Default Value:4294967295 #
+# Range: 4096-4294967295 #
+# #
+# #
+# #
+# #
+# #
+# Creation Date: 2010-11-05 #
+# Author: Alfranio #
+# #
+# Description: Test Cases of Dynamic System Variable #
+# max_binlog_stmt_cache_size that checks #
+# the behavior of this variable in the following ways #
+# * Default Value #
+# * Valid & Invalid values #
+# * Scope & Access method #
+# * Data Integrity #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.5/en/ #
+# server-system-variables.html #
+# #
+###############################################################################
+
+--source include/load_sysvars.inc
+
+##########################################################################
+# START OF max_binlog_stmt_cache_size TESTS #
+##########################################################################
+
+
+##############################################################################
+# Saving initial value of max_binlog_stmt_cache_size in a temporary variable #
+##############################################################################
+
+SET @start_value = @@global.max_binlog_stmt_cache_size;
+SELECT @start_value;
+
+
+--echo '#--------------------FN_DYNVARS_072_01------------------------#'
+########################################################################
+# Display the DEFAULT value of max_binlog_stmt_cache_size #
+########################################################################
+
+SET @@global.max_binlog_stmt_cache_size = 5000;
+SET @@global.max_binlog_stmt_cache_size = DEFAULT;
+SELECT @@global.max_binlog_stmt_cache_size;
+
+
+--echo '#---------------------FN_DYNVARS_072_02-------------------------#'
+###############################################
+# Verify default value of variable #
+###############################################
+
+SET @@global.max_binlog_stmt_cache_size = @start_value;
+SELECT @@global.max_binlog_stmt_cache_size = 4294967295;
+
+--echo '#--------------------FN_DYNVARS_072_03------------------------#'
+########################################################################
+# Change the value of max_binlog_stmt_cache_size to a valid value #
+########################################################################
+
+SET @@global.max_binlog_stmt_cache_size = 4096;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 4294967295;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 4294967294;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 4097;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 65535;
+SELECT @@global.max_binlog_stmt_cache_size;
+
+
+--echo '#--------------------FN_DYNVARS_072_04-------------------------#'
+###########################################################################
+# Change the value of max_binlog_stmt_cache_size to invalid value #
+###########################################################################
+
+SET @@global.max_binlog_stmt_cache_size = -1;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 100000000000;
+SELECT @@global.max_binlog_stmt_cache_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_binlog_stmt_cache_size = 10000.01;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = -1024;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 1024;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 4294967296;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = 4095;
+SELECT @@global.max_binlog_stmt_cache_size;
+
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_binlog_stmt_cache_size = ON;
+SELECT @@global.max_binlog_stmt_cache_size;
+--Error ER_WRONG_TYPE_FOR_VAR
+SET @@global.max_binlog_stmt_cache_size = 'test';
+SELECT @@global.max_binlog_stmt_cache_size;
+
+
+--echo '#-------------------FN_DYNVARS_072_05----------------------------#'
+###########################################################################
+# Test if accessing session max_binlog_stmt_cache_size gives error #
+###########################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET @@session.max_binlog_stmt_cache_size = 4096;
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.max_binlog_stmt_cache_size;
+
+
+--echo '#----------------------FN_DYNVARS_072_06------------------------#'
+##############################################################################
+# Check if the value in GLOBAL & SESSION Tables matches values in variable #
+##############################################################################
+
+SELECT @@global.max_binlog_stmt_cache_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='max_binlog_stmt_cache_size';
+
+SELECT @@max_binlog_stmt_cache_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='max_binlog_stmt_cache_size';
+
+
+--echo '#---------------------FN_DYNVARS_072_07----------------------#'
+###################################################################
+# Check if TRUE and FALSE values can be used on variable #
+###################################################################
+
+SET @@global.max_binlog_stmt_cache_size = TRUE;
+SELECT @@global.max_binlog_stmt_cache_size;
+SET @@global.max_binlog_stmt_cache_size = FALSE;
+SELECT @@global.max_binlog_stmt_cache_size;
+
+
+--echo '#---------------------FN_DYNVARS_072_08----------------------#'
+########################################################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
+########################################################################################################
+
+SET @@global.max_binlog_stmt_cache_size = 5000;
+SELECT @@max_binlog_stmt_cache_size = @@global.max_binlog_stmt_cache_size;
+
+
+--echo '#---------------------FN_DYNVARS_072_09----------------------#'
+################################################################################
+# Check if max_binlog_stmt_cache_size can be accessed with and without @@ sign #
+################################################################################
+
+--Error ER_GLOBAL_VARIABLE
+SET max_binlog_stmt_cache_size = 6000;
+SELECT @@max_binlog_stmt_cache_size;
+--Error ER_PARSE_ERROR
+SET local.max_binlog_stmt_cache_size = 7000;
+--Error ER_UNKNOWN_TABLE
+SELECT local.max_binlog_stmt_cache_size;
+--Error ER_PARSE_ERROR
+SET global.max_binlog_stmt_cache_size = 8000;
+--Error ER_UNKNOWN_TABLE
+SELECT global.max_binlog_stmt_cache_size;
+--Error ER_BAD_FIELD_ERROR
+SELECT max_binlog_stmt_cache_size = @@session.max_binlog_stmt_cache_size;
+
+
+##############################
+# Restore initial value #
+##############################
+
+SET @@global.max_binlog_stmt_cache_size = @start_value;
+SELECT @@global.max_binlog_stmt_cache_size;
+
+
+########################################################################
+# END OF max_binlog_stmt_cache_size TESTS #
+########################################################################
diff --git a/mysql-test/suite/sys_vars/t/max_long_data_size_basic.test b/mysql-test/suite/sys_vars/t/max_long_data_size_basic.test
new file mode 100644
index 00000000000..eefa61bd4b7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_long_data_size_basic.test
@@ -0,0 +1,17 @@
+select @@global.max_long_data_size=20;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.max_long_data_size;
+
+# Show that value of the variable matches the value in the GLOBAL I_S table
+SELECT @@global.max_long_data_size = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='max_long_data_size';
+
+#
+# show that it's read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global max_long_data_size=1;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set session max_long_data_size=1;
+
diff --git a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
index 4267b3726aa..df1a3511fa1 100644
--- a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
+++ b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
@@ -46,5 +46,13 @@ set session optimizer_switch="index_merge";
--error ER_WRONG_VALUE_FOR_VAR
set session optimizer_switch="foobar";
+--echo #
+--echo # Bug#59894 set optimizer_switch to e or d causes invalid
+--echo # memory writes/valgrind warnings
+--echo
+set global optimizer_switch = 'd'; # means default
+--error ER_WRONG_VALUE_FOR_VAR
+set global optimizer_switch = 'e';
+
SET @@global.optimizer_switch = @start_global_value;
SELECT @@global.optimizer_switch;
diff --git a/mysql-test/suite/sys_vars/t/proxy_user_basic.test b/mysql-test/suite/sys_vars/t/proxy_user_basic.test
new file mode 100644
index 00000000000..8c7e2d0d8a3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/proxy_user_basic.test
@@ -0,0 +1 @@
+SELECT @@SESSION.PROXY_USER FROM DUAL;
diff --git a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
index fa9cb66db04..ffa88941f07 100644
--- a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
+++ b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
@@ -105,3 +105,4 @@ SET @@global.init_slave= @start_init_slave;
# End of functionality Testing for init_slave #
##################################################
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv2-master.opt b/mysql-test/suite/sys_vars/t/secure_file_priv2-master.opt
new file mode 100644
index 00000000000..1d9a49c8f75
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/secure_file_priv2-master.opt
@@ -0,0 +1 @@
+--secure_file_priv=$SECURE_LOAD_PATH
diff --git a/mysql-test/suite/sys_vars/t/secure_file_priv2.test b/mysql-test/suite/sys_vars/t/secure_file_priv2.test
new file mode 100644
index 00000000000..0ca0a1839e1
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/secure_file_priv2.test
@@ -0,0 +1,23 @@
+#
+# Bug58747 breaks secure_file_priv+not secure yet+still accesses other folders
+#
+CREATE TABLE t1 (c1 INT);
+#
+# Before the patch this statement failed with
+# Linux:
+# -> errno 13: 'Can't get stat of '
+# Windows:
+# -> Warning 1366 Incorrect integer value: '■■☺' for
+# -> column 'c1' at row 1
+# Now it should consistently fail with ER_OPTION_PREVENTS_STATEMENT
+# on all platforms.
+--error ER_OPTION_PREVENTS_STATEMENT
+LOAD DATA INFILE "t1.MYI" into table t1;
+
+#
+# The following test makes the assuption that /test isn't a valid path in any
+# operating system running the test suite.
+--error ER_OPTION_PREVENTS_STATEMENT
+LOAD DATA INFILE "/test" into table t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/t/shared_memory_base_name_basic.test b/mysql-test/suite/sys_vars/t/shared_memory_base_name_basic.test
index 24418a78687..da165564791 100644
--- a/mysql-test/suite/sys_vars/t/shared_memory_base_name_basic.test
+++ b/mysql-test/suite/sys_vars/t/shared_memory_base_name_basic.test
@@ -3,17 +3,17 @@
#
# only global
#
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
select @@global.shared_memory_base_name;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.shared_memory_base_name;
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
show global variables like 'shared_memory_base_name';
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
show session variables like 'shared_memory_base_name';
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
select * from information_schema.global_variables where variable_name='shared_memory_base_name';
---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
select * from information_schema.session_variables where variable_name='shared_memory_base_name';
#
diff --git a/mysql-test/suite/sys_vars/t/slow_launch_time_func.test b/mysql-test/suite/sys_vars/t/slow_launch_time_func.test
index c9a7d28bb8a..c9fc357b10f 100644
--- a/mysql-test/suite/sys_vars/t/slow_launch_time_func.test
+++ b/mysql-test/suite/sys_vars/t/slow_launch_time_func.test
@@ -31,6 +31,7 @@
#
--source include/not_embedded.inc
+--source include/not_threadpool.inc
SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;
@@ -84,7 +85,7 @@ let $value_before=
CONNECT (conn2,localhost,root,,);
let $value_after=
query_get_value(show status like 'slow_launch_threads', Value, 1);
-if (!`SELECT $value_after = $value_before`)
+if ($value_after != $value_before)
{
--echo ERROR: Subtest FN_DYNVARS_124_02 failed
--echo A new connect must not be counted as 'slow_launch_thread' if
diff --git a/mysql-test/suite/sys_vars/t/thread_cache_size_func.test b/mysql-test/suite/sys_vars/t/thread_cache_size_func.test
index fe9f4242c0d..9bffa32ca2b 100644
--- a/mysql-test/suite/sys_vars/t/thread_cache_size_func.test
+++ b/mysql-test/suite/sys_vars/t/thread_cache_size_func.test
@@ -28,6 +28,7 @@
#
--source include/not_embedded.inc
+--source include/not_threadpool.inc
SET @global_thread_cache_size = @@GLOBAL.thread_cache_size;
diff --git a/mysql-test/suite/sys_vars/t/wait_timeout_func.test b/mysql-test/suite/sys_vars/t/wait_timeout_func.test
index e33c39016cc..313d9e8191d 100644
--- a/mysql-test/suite/sys_vars/t/wait_timeout_func.test
+++ b/mysql-test/suite/sys_vars/t/wait_timeout_func.test
@@ -22,6 +22,7 @@
###############################################################################
--source include/not_embedded.inc
+--source include/not_threadpool.inc
SET @start_value= @@global.wait_timeout;
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index c60ca592580..15b037a0294 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -1171,3 +1171,35 @@ INSERT INTO t1 VALUES (1, 1), (2, 2);
ALTER TABLE t1 CHANGE a id INT;
--disable_info
DROP TABLE t1;
+
+
+--echo #
+--echo # Bug#11754461 CANNOT ALTER TABLE WHEN KEY PREFIX TOO LONG
+--echo #
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+--enable_warnings
+
+CREATE DATABASE db1 CHARACTER SET utf8;
+CREATE TABLE db1.t1 (bar TINYTEXT, KEY (bar(100)));
+ALTER TABLE db1.t1 ADD baz INT;
+
+DROP DATABASE db1;
+
+
+--echo #
+--echo # Bug#11938039 RE-EXECUTION OF FRM-ONLY ALTER TABLE WITH RENAME
+--echo # CLAUSE FAILS OR ABORTS SERVER.
+--echo #
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int);
+prepare stmt1 from 'alter table t1 alter column a set default 1, rename to t2';
+execute stmt1;
+rename table t2 to t1;
+--echo # The below statement should succeed and not emit error or abort server.
+execute stmt1;
+deallocate prepare stmt1;
+drop table t2;
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index c3ce805789f..9167dbf86e6 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1723,3 +1723,26 @@ INSERT INTO t1 VALUES (2);
SELECT * FROM t1 ORDER BY a;
SHOW CREATE TABLE t1;
DROP TABLE t1;
+
+--echo #
+--echo # BUG#58205 - Valgrind failure in fn_format when called from
+--echo # archive_discover
+--echo #
+CREATE TABLE `a/../`(a INT) ENGINE=ARCHIVE;
+remove_file $MYSQLD_DATADIR/test/a@002f@002e@002e@002f.frm;
+DROP TABLE `a/../`;
+
+--echo #
+--echo # BUG#57162 - valgrind errors, random data when returning
+--echo # ordered data from archive tables
+--echo #
+SET sort_buffer_size=32804;
+CREATE TABLE t1(a INT, b CHAR(255), c CHAR(255), d CHAR(255),
+ e CHAR(255), f INT) ENGINE=ARCHIVE DEFAULT CHARSET utf8;
+INSERT INTO t1 VALUES(-1,'b','c','d','e',1);
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT t1.* FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6;
+SELECT * FROM t1 ORDER BY f LIMIT 1;
+DROP TABLE t1;
+SET sort_buffer_size=DEFAULT;
diff --git a/mysql-test/t/archive_debug.test b/mysql-test/t/archive_debug.test
new file mode 100644
index 00000000000..9cece254140
--- /dev/null
+++ b/mysql-test/t/archive_debug.test
@@ -0,0 +1,13 @@
+--source include/have_archive.inc
+--source include/have_debug.inc
+
+--echo #
+--echo # BUG#12402794 - 60976: CRASH, VALGRIND WARNING AND MEMORY LEAK
+--echo # WITH PARTITIONED ARCHIVE TABLES
+--echo #
+CREATE TABLE t1(a INT) ENGINE=ARCHIVE;
+INSERT INTO t1 VALUES(1);
+SET SESSION debug='d,simulate_archive_open_failure';
+CHECK TABLE t1;
+SET SESSION debug=DEFAULT;
+DROP TABLE t1;
diff --git a/mysql-test/t/archive_plugin.test b/mysql-test/t/archive_plugin.test
index 567a0a58ce7..7d9b0ea065f 100644
--- a/mysql-test/t/archive_plugin.test
+++ b/mysql-test/t/archive_plugin.test
@@ -20,6 +20,14 @@ CREATE TABLE t1(a int) ENGINE=ARCHIVE;
DROP TABLE t1;
+# This dummy statement is required for --ps-protocol mode.
+# The thing is that last prepared statement is "cached" in mysqltest.cc
+# (unless "reconnect" is enabled, and that's not the case here).
+# This statement forces mysqltest.cc to close prepared "DROP TABLE t1".
+# Otherwise, the plugin can not be uninstalled because there is an active
+# prepared statement using it.
+SELECT 1;
+
UNINSTALL PLUGIN archive;
--error ER_SP_DOES_NOT_EXIST
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test
index 42751b8ce06..2854f503034 100644
--- a/mysql-test/t/auto_increment.test
+++ b/mysql-test/t/auto_increment.test
@@ -342,3 +342,41 @@ SELECT a FROM t2;
DROP TABLE t1, t2;
+--echo #
+--echo # Bug#39828 autoinc wraps around when offset and increment > 1
+--echo #
+
+CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) engine=MyISAM;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t1 VALUES (18446744073709551601);
+
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=10;
+
+SELECT @@SESSION.AUTO_INCREMENT_OFFSET;
+--error ER_WARN_DATA_OUT_OF_RANGE
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+SELECT * FROM t1;
+
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=default;
+SET @@SESSION.AUTO_INCREMENT_OFFSET=default;
+
+DROP TABLE t1;
+
+--echo End of 5.1 tests
+
+--echo #
+--echo # Bug#50619 assert in handler::update_auto_increment
+--echo #
+
+CREATE TABLE t1 (pk INT AUTO_INCREMENT, PRIMARY KEY (pk));
+# This triggered the assert
+INSERT INTO t1 VALUES (NULL), (-1), (NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# Check that that true overflow still gives error
+CREATE TABLE t1 (pk BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY (pk));
+--error ER_AUTOINC_READ_FAILED
+INSERT INTO t1 VALUES (NULL), (18446744073709551615-1), (NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/blackhole_plugin.test b/mysql-test/t/blackhole_plugin.test
index 1de5b2d0499..448104bed2b 100644
--- a/mysql-test/t/blackhole_plugin.test
+++ b/mysql-test/t/blackhole_plugin.test
@@ -20,6 +20,14 @@ CREATE TABLE t1(a int) ENGINE=BLACKHOLE;
DROP TABLE t1;
+# This dummy statement is required for --ps-protocol mode.
+# The thing is that last prepared statement is "cached" in mysqltest.cc
+# (unless "reconnect" is enabled, and that's not the case here).
+# This statement forces mysqltest.cc to close prepared "DROP TABLE t1".
+# Otherwise, the plugin can not be uninstalled because there is an active
+# prepared statement using it.
+SELECT 1;
+
UNINSTALL PLUGIN blackhole;
--error ER_SP_DOES_NOT_EXIST
UNINSTALL PLUGIN blackhole;
diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test
index d5bb2f42273..2a293ed844b 100644
--- a/mysql-test/t/bootstrap.test
+++ b/mysql-test/t/bootstrap.test
@@ -48,3 +48,15 @@ remove_file $MYSQLTEST_VARDIR/tmp/long_query.sql;
set global max_allowed_packet=@my_max_allowed_packet;
drop table t1;
+--echo End of 5.1 tests
+
+--echo #
+--echo # Bug #11766306: 59393: HAVE_INNODB=YES WHEN MYSQLD
+--echo # STARTED WITH --SKIP-INNODB
+--echo #
+
+# need the --skip-innodb option present for the test to succeed
+SHOW VARIABLES LIKE 'have_innodb';
+SELECT SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb';
+
+--echo End of 5.5 tests
diff --git a/mysql-test/t/bug58669-master.opt b/mysql-test/t/bug58669-master.opt
new file mode 100644
index 00000000000..6d909680527
--- /dev/null
+++ b/mysql-test/t/bug58669-master.opt
@@ -0,0 +1 @@
+--read-only
diff --git a/mysql-test/t/bug58669.test b/mysql-test/t/bug58669.test
new file mode 100644
index 00000000000..332c104cfea
--- /dev/null
+++ b/mysql-test/t/bug58669.test
@@ -0,0 +1,22 @@
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug#58669: read_only not enforced on 5.5.x
+--echo #
+
+CREATE USER user1@localhost;
+CREATE DATABASE db1;
+GRANT ALL PRIVILEGES ON db1.* TO user1@localhost;
+CREATE TABLE db1.t1(a INT);
+
+connect (con1,localhost,user1,,);
+connection con1;
+SELECT CURRENT_USER();
+SHOW VARIABLES LIKE "%read_only%";
+--error ER_OPTION_PREVENTS_STATEMENT
+INSERT INTO db1.t1 VALUES (1);
+
+connection default;
+disconnect con1;
+DROP DATABASE db1;
+DROP USER user1@localhost;
diff --git a/mysql-test/t/cache_innodb.test b/mysql-test/t/cache_innodb.test
index 33a328d1d6c..f7102627506 100644
--- a/mysql-test/t/cache_innodb.test
+++ b/mysql-test/t/cache_innodb.test
@@ -14,3 +14,18 @@ let $engine_type= InnoDB;
let $test_foreign_keys= 1;
--source include/query_cache.inc
+
+#
+# Bug#56452 Assertion failed: thd->transaction.stmt.is_empty() ||
+# thd->in_sub_stmt
+#
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+BEGIN;
+ INSERT INTO t1 VALUES(1);
+ROLLBACK WORK AND CHAIN NO RELEASE;
+SELECT a FROM t1;
+ROLLBACK WORK AND CHAIN NO RELEASE;
+SELECT a FROM t1;
+ROLLBACK;
+DROP TABLE t1;
+
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index f5426f8d631..a922cc9aaf7 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -280,5 +280,19 @@ SELECT 1 FROM
) AS s LIMIT 1;
DROP TABLE t1;
+--echo #
+--echo # Bug #11765023: 57934: DOS POSSIBLE SINCE BINARY CASTING
+--echo # DOESN'T ADHERE TO MAX_ALLOWED_PACKET
+
+SET @@GLOBAL.max_allowed_packet=2048;
+# reconnect to make the new max packet size take effect
+--connect (newconn, localhost, root,,)
+
+SELECT CONVERT('a', BINARY(2049));
+SELECT CONVERT('a', CHAR(2049));
+
+connection default;
+disconnect newconn;
+SET @@GLOBAL.max_allowed_packet=default;
--echo End of 5.1 tests
diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test
index b4ac526a80e..659354e9c48 100644
--- a/mysql-test/t/change_user.test
+++ b/mysql-test/t/change_user.test
@@ -131,7 +131,7 @@ let $before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_select',Value,1);
let $after= query_get_value(SHOW GLOBAL STATUS LIKE 'com_select',Value,1);
-if (`select $after != $before`){
+if ($after != $before){
SHOW GLOBAL STATUS LIKE 'com_select';
die The value of com_select changed during change_user;
}
diff --git a/mysql-test/t/check.test b/mysql-test/t/check.test
index 78644523976..966d41adfbd 100644
--- a/mysql-test/t/check.test
+++ b/mysql-test/t/check.test
@@ -55,5 +55,29 @@ REPAIR TABLE t1;
DROP TABLE t1;
+--echo #
+--echo # Bug#56422 CHECK TABLE run when the table is locked reports corruption
+--echo # along with timeout
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1(a INT);
+LOCK TABLE t1 WRITE;
+
+--echo # Connection con1
+connect(con1, localhost, root);
+SET lock_wait_timeout= 1;
+CHECK TABLE t1;
+
+--echo # Connection default
+connection default;
+UNLOCK TABLES;
+DROP TABLE t1;
+disconnect con1;
+
+
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/crash_commit_before.test b/mysql-test/t/crash_commit_before.test
index e7d8a373647..f99690777c9 100644
--- a/mysql-test/t/crash_commit_before.test
+++ b/mysql-test/t/crash_commit_before.test
@@ -1,6 +1,8 @@
-- source include/not_embedded.inc
# Don't test this under valgrind, memory leaks will occur
--source include/not_valgrind.inc
+# Avoid CrashReporter popup on Mac
+--source include/not_crashrep.inc
# Binary must be compiled with debug for crash to occur
--source include/have_debug.inc
diff --git a/mysql-test/t/csv_not_null.test b/mysql-test/t/csv_not_null.test
index 03ed566fb22..bebea53b2f7 100644
--- a/mysql-test/t/csv_not_null.test
+++ b/mysql-test/t/csv_not_null.test
@@ -55,10 +55,8 @@ INSERT INTO t1 VALUES();
SELECT * FROM t1;
-- disable_warnings
-# NOTE - Test disabled due to enum crash for this INSERT
-# See Bug#33717 - INSERT...(default) fails for enum.
-# Crashes CSV tables, loads spaces for MyISAM
-#INSERT INTO t1 VALUES(default,default,default,default,default,default);
+# Bug#33717 - INSERT...(default) fails for enum.
+INSERT INTO t1 VALUES(default,default,default,default,default,default);
-- enable_warnings
SELECT * FROM t1;
diff --git a/mysql-test/t/ctype_cp1250_ch.test b/mysql-test/t/ctype_cp1250_ch.test
index 1fb656f2a01..a4c59f494a7 100644
--- a/mysql-test/t/ctype_cp1250_ch.test
+++ b/mysql-test/t/ctype_cp1250_ch.test
@@ -72,3 +72,13 @@ select a from t1 where a like "abcdefghá";
drop table t1;
# End of 4.1 tests
+
+#
+# Bug #48053 String::c_ptr has a race and/or does an invalid
+# memory reference
+# (triggered by Valgrind tests)
+# (see also ctype_eucjpms.test, ctype_cp1250.test, ctype_cp1251.test)
+#
+--error 1649
+set global LC_MESSAGES=convert((@@global.log_bin_trust_function_creators)
+ using cp1250);
diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test
index cfe9adf6e1e..ab260f0c7e8 100644
--- a/mysql-test/t/ctype_cp1251.test
+++ b/mysql-test/t/ctype_cp1251.test
@@ -61,11 +61,41 @@ DROP TABLE t1;
# End of 4.1 tests
--echo #
+--echo # Start of 5.1 tests
+--echo #
+
+--source include/ctype_8bit.inc
+
+#
+# Bug #48053 String::c_ptr has a race and/or does an invalid
+# memory reference
+# (triggered by Valgrind tests)
+# (see also ctype_eucjpms.test, ctype_cp1250.test, ctype_cp1251.test)
+#
+--error 1649
+set global LC_TIME_NAMES=convert((-8388608) using cp1251);
+
+
+--echo #
+--echo # End of 5.1 tests
+--echo #
+
+--echo #
--echo # Start of 5.5 tests
--echo #
--source include/ctype_numconv.inc
--echo #
+--echo # Bug#60101 COALESCE with cp1251 tables causes [Err] 1267 - Illegal mix of collations
+--echo #
+CREATE TABLE t1 (test1 INT, test2 VARCHAR(255));
+SHOW CREATE TABLE t1;
+SELECT COALESCE(IF(test1=1, 1, NULL), test2) FROM t1;
+SELECT COALESCE(IF(test1=1, NULL, 1), test2) FROM t1;
+DROP TABLE t1;
+
+
+--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/t/ctype_eucjpms.test b/mysql-test/t/ctype_eucjpms.test
index a330925327c..fea48061c69 100644
--- a/mysql-test/t/ctype_eucjpms.test
+++ b/mysql-test/t/ctype_eucjpms.test
@@ -382,6 +382,16 @@ select hex(convert(_eucjpms 0xA5FE41 using ucs2));
select hex(convert(_eucjpms 0x8FABF841 using ucs2));
+#
+# Bug #48053 String::c_ptr has a race and/or does an invalid
+# memory reference
+# (triggered by Valgrind tests)
+# (see also ctype_eucjpms.test, ctype_cp1250.test, ctype_cp1251.test)
+#
+--error 1649
+set global LC_TIME_NAMES=convert((convert((0x63) using eucjpms)) using utf8);
+
+
--echo #
--echo # Start of 5.5 tests
--echo #
diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test
index 1733ee299d1..5d1acf107d7 100644
--- a/mysql-test/t/ctype_latin1.test
+++ b/mysql-test/t/ctype_latin1.test
@@ -128,6 +128,14 @@ select hex(cast(_ascii 0x7f as char(1) character set latin1));
--echo End of 5.0 tests
+
+--echo #
+--echo # Bug#58022 ... like ... escape export_set ( ... ) crashes when export_set returns warnings
+--echo #
+SELECT '' LIKE '' ESCAPE EXPORT_SET(1, 1, 1, 1, '');
+
+--echo End of 5.1 tests
+
--echo #
--echo # Start of 5.5 tests
@@ -136,5 +144,20 @@ select hex(cast(_ascii 0x7f as char(1) character set latin1));
--source include/ctype_numconv.inc
--echo #
+--echo # Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters
+--echo #
+# Test latin1 client erroneously started with --default-character-set=utf8
+# EXPLAIN output should still be pretty readable.
+# We're using 'ó' (\xC3\xB3) as a magic sequence:
+# - it's "LATIN CAPITAL LETTER A WITH TILDE ABOVE + SUPERSCRIPT 3" in latin1
+# - it's "LATIN SMALL LETTER O WITH ACUTE ABOVE" in utf8.
+SET NAMES utf8;
+EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó';
+# Test normal latin1
+SET NAMES latin1;
+EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó';
+
+
+--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/t/ctype_like_range.test b/mysql-test/t/ctype_like_range.test
new file mode 100644
index 00000000000..34a7637222b
--- /dev/null
+++ b/mysql-test/t/ctype_like_range.test
@@ -0,0 +1,87 @@
+--source include/have_debug.inc
+--source include/have_ucs2.inc
+--source include/have_utf16.inc
+--source include/have_utf32.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP VIEW IF EXISTS v1;
+--enable_warnings
+
+CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a VARBINARY(32));
+INSERT INTO t1 (a) VALUES (''),('_'),('%'),('\_'),('\%'),('\\');
+INSERT INTO t1 (a) VALUES ('a'),('c');
+INSERT INTO t1 (a) VALUES ('a_'),('c_');
+INSERT INTO t1 (a) VALUES ('a%'),('c%');
+INSERT INTO t1 (a) VALUES ('aa'),('cc'),('ch');
+INSERT INTO t1 (a) VALUES ('aa_'),('cc_'),('ch_');
+INSERT INTO t1 (a) VALUES ('aa%'),('cc%'),('ch%');
+INSERT INTO t1 (a) VALUES ('aaa'),('ccc'),('cch');
+INSERT INTO t1 (a) VALUES ('aaa_'),('ccc_'),('cch_');
+INSERT INTO t1 (a) VALUES ('aaa%'),('ccc%'),('cch%');
+INSERT INTO t1 (a) VALUES ('aaaaaaaaaaaaaaaaaaaa');
+
+CREATE VIEW v1 AS
+ SELECT id, 'a' AS name, a AS val FROM t1
+UNION
+ SELECT id, 'mn', HEX(LIKE_RANGE_MIN(a, 16)) AS min FROM t1
+UNION
+ SELECT id, 'mx', HEX(LIKE_RANGE_MAX(a, 16)) AS max FROM t1
+UNION
+ SELECT id, 'sp', REPEAT('-', 32) AS sep FROM t1
+ORDER BY id, name;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET latin1;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_czech_ci;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_danish_ci;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_czech_ci;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_danish_ci;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_ci;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_czech_ci;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_danish_ci;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_ci;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_czech_ci;
+SELECT * FROM v1;
+
+ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_danish_ci;
+SELECT * FROM v1;
+
+DROP VIEW v1;
+DROP TABLE t1;
diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test
index 67726c53585..060cf9fcf92 100644
--- a/mysql-test/t/ctype_many.test
+++ b/mysql-test/t/ctype_many.test
@@ -217,6 +217,25 @@ DROP TABLE t1;
--echo #
+--echo # Start of 5.1 tests
+--echo #
+
+--echo #
+--echo # Bug#58371 Assertion failed: !s.uses_buffer_owned_by(this) with format string function
+--echo #
+
+SET NAMES latin1;
+DO CONVERT(CAST(SUBSTRING_INDEX(FORMAT(1,'1111'), FORMAT('','Zpq'),1)
+ AS BINARY(0)) USING utf8);
+--echo #
+--echo # End of 5.1 tests
+--echo #
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+--echo #
--echo # WL#1213 Implement 4-byte UTF8, UTF16 and UTF32
--echo # Testing that only utf8mb4 is superset for utf8
--echo # No other Unicode character set pairs have superset/subset relations
@@ -284,3 +303,19 @@ SELECT CHARSET(CONCAT(utf32, utf8mb4)) FROM t1;
SELECT CHARSET(CONCAT(utf32, utf16)) FROM t1;
DROP TABLE t1;
+
+--echo #
+--echo # Bug#58321 No warning when characters outside BMP0 is converted to UCS2
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32);
+CREATE TABLE t2 (a VARCHAR(10) CHARACTER SET ucs2);
+INSERT INTO t1 VALUES (0x10082), (0x12345);
+INSERT INTO t2 SELECT * FROM t1;
+SELECT HEX(a) FROM t2;
+DROP TABLE t1;
+DROP TABLE t2;
+
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test
index 103039d0323..f45e6ab9b54 100644
--- a/mysql-test/t/ctype_sjis.test
+++ b/mysql-test/t/ctype_sjis.test
@@ -92,6 +92,14 @@ INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);
SELECT hex(a), hex(lower(a)), hex(upper(a)) FROM t1 ORDER BY binary(a);
DROP TABLE t1;
+--echo #
+--echo # Bug#11766519 - Bug#59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED.
+--echo #
+# In the below string backslash (0x5C) is a part of a multi-byte
+# character, so it should not be quoted.
+SELECT QUOTE('ƒ\');
+
+
--echo # End of 5.1 tests
diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test
index 96831c8c915..dd1e95ef960 100644
--- a/mysql-test/t/ctype_uca.test
+++ b/mysql-test/t/ctype_uca.test
@@ -547,3 +547,19 @@ set collation_connection=ucs2_unicode_ci;
set names utf8;
-- echo End for 5.0 tests
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+#
+# Test my_like_range and contractions
+#
+SET collation_connection=utf8_czech_ci;
+--source include/ctype_czech.inc
+--source include/ctype_like_ignorable.inc
+SET collation_connection=ucs2_czech_ci;
+--source include/ctype_czech.inc
+--source include/ctype_like_ignorable.inc
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index 199dddaac02..e93a2ab0fbf 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -741,6 +741,12 @@ WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1'));
DROP VIEW v1;
DROP TABLE t1;
+--echo #
+--echo # Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
+--echo #
+SELECT HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850));
+SELECT CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED);
+
--echo End of 5.0 tests
--echo #
diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test
index 78701127ec3..4e1ee55e019 100644
--- a/mysql-test/t/ctype_ujis.test
+++ b/mysql-test/t/ctype_ujis.test
@@ -1209,6 +1209,13 @@ DROP PROCEDURE sp1;
DROP TABLE t1;
DROP TABLE t2;
+--echo #
+--echo # Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
+--echo #
+SET NAMES utf8;
+SELECT CONVERT(REPLACE(EXPORT_SET('a','a','a','','a'),'00','') USING ujis);
+
+
set names default;
set character_set_database=default;
set character_set_server=default;
diff --git a/mysql-test/t/ctype_utf16.test b/mysql-test/t/ctype_utf16.test
index 513dfb4e03f..c748e7148bf 100644
--- a/mysql-test/t/ctype_utf16.test
+++ b/mysql-test/t/ctype_utf16.test
@@ -747,6 +747,15 @@ CREATE TABLE t2 AS SELECT CONCAT(s1) FROM t1;
SHOW CREATE TABLE t2;
DROP TABLE t1, t2;
+--echo #
+--echo # Bug#11753363 (Bug#44793) Character sets: case clause, ucs2 or utf32, failure
+--echo #
+SELECT CASE _latin1'a' WHEN _utf16'a' THEN 'A' END;
+SELECT CASE _utf16'a' WHEN _latin1'a' THEN 'A' END;
+CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf16);
+INSERT INTO t1 VALUES ('a');
+SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1;
+DROP TABLE t1;
#
## TODO: add tests for all engines
diff --git a/mysql-test/t/ctype_utf16_uca.test b/mysql-test/t/ctype_utf16_uca.test
index 5314777c6f4..a6295c82dec 100644
--- a/mysql-test/t/ctype_utf16_uca.test
+++ b/mysql-test/t/ctype_utf16_uca.test
@@ -284,6 +284,13 @@ DROP TABLE IF EXISTS t1;
set collation_connection=utf16_unicode_ci;
--source include/ctype_regex.inc
+#
+# Test my_like_range and contractions
+#
+SET collation_connection=utf16_czech_ci;
+--source include/ctype_czech.inc
+--source include/ctype_like_ignorable.inc
+
--echo #
--echo # End of 5.5 tests
diff --git a/mysql-test/t/ctype_utf32.test b/mysql-test/t/ctype_utf32.test
index 89e4499d0b1..945646087aa 100644
--- a/mysql-test/t/ctype_utf32.test
+++ b/mysql-test/t/ctype_utf32.test
@@ -833,5 +833,15 @@ SELECT * FROM t1 WHERE b BETWEEN 'a' AND 'z';
DROP TABLE t1;
--echo #
+--echo # Bug#11753363 (Bug#44793) Character sets: case clause, ucs2 or utf32, failure
+--echo #
+SELECT CASE _latin1'a' WHEN _utf32'a' THEN 'A' END;
+SELECT CASE _utf32'a' WHEN _latin1'a' THEN 'A' END;
+CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf32);
+INSERT INTO t1 VALUES ('a');
+SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1;
+DROP TABLE t1;
+
+--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/t/ctype_utf32_uca.test b/mysql-test/t/ctype_utf32_uca.test
index 9386cc9e65e..a62ffbf95c7 100644
--- a/mysql-test/t/ctype_utf32_uca.test
+++ b/mysql-test/t/ctype_utf32_uca.test
@@ -286,6 +286,14 @@ set collation_connection=utf32_unicode_ci;
--source include/ctype_regex.inc
+#
+# Test my_like_range and contractions
+#
+SET collation_connection=utf32_czech_ci;
+--source include/ctype_czech.inc
+--source include/ctype_like_ignorable.inc
+
+
--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 957c2e9a7b4..2c7b27c63bb 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1448,6 +1448,26 @@ DROP TABLE t1;
--echo End of 5.0 tests
+#
+# Bug #57272: crash in rpad() when using utf8
+#
+SELECT LENGTH(RPAD(0.0115E88, 61297, _utf8'ÑÑÑŽÑ'));
+SELECT LENGTH(RPAD(0.0115E88, 61297, _utf8'йцуÑ'));
+SELECT HEX(RPAD(0x20, 2, _utf8 0xD18F));
+SELECT HEX(RPAD(0x20, 4, _utf8 0xD18F));
+SELECT HEX(LPAD(0x20, 2, _utf8 0xD18F));
+SELECT HEX(LPAD(0x20, 4, _utf8 0xD18F));
+
+SELECT HEX(RPAD(_utf8 0xD18F, 3, 0x20));
+SELECT HEX(LPAD(_utf8 0xD18F, 3, 0x20));
+
+SELECT HEX(INSERT(_utf8 0xD18F, 2, 1, 0x20));
+SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20));
+
+
+--echo End of 5.1 tests
+
+
--echo Start of 5.4 tests
#
@@ -1486,6 +1506,15 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES (19, x'E0B696'), (30, x'E0B69AE0B798'), (61, x'E0B6AF'), (93, x'E0B799'), (52, x'E0B6A6'), (73, x'E0B6BBE0B78AE2808D'), (3, x'E0B686'), (56, x'E0B6AA'), (55, x'E0B6A9'), (70, x'E0B6B9'), (94, x'E0B79A'), (80, x'E0B785'), (25, x'E0B69AE0B791'), (48, x'E0B6A2'), (13, x'E0B690'), (86, x'E0B793'), (91, x'E0B79F'), (81, x'E0B786'), (79, x'E0B784'), (14, x'E0B691'), (99, x'E0B78A'), (8, x'E0B68B'), (68, x'E0B6B7'), (22, x'E0B69A'), (16, x'E0B693'), (33, x'E0B69AE0B7B3'), (38, x'E0B69AE0B79D'), (21, x'E0B683'), (11, x'E0B68E'), (77, x'E0B782'), (40, x'E0B69AE0B78A'), (101, x'E0B78AE2808DE0B6BB'), (35, x'E0B69AE0B79A'), (1, x'E0B7B4'), (9, x'E0B68C'), (96, x'E0B79C'), (6, x'E0B689'), (95, x'E0B79B'), (88, x'E0B796'), (64, x'E0B6B3'), (26, x'E0B69AE0B792'), (82, x'E0B78F'), (28, x'E0B69AE0B794'), (39, x'E0B69AE0B79E'), (97, x'E0B79D'), (2, x'E0B685'), (75, x'E0B780'), (34, x'E0B69AE0B799'), (69, x'E0B6B8'), (83, x'E0B790'), (18, x'E0B695'), (90, x'E0B7B2'), (17, x'E0B694'), (72, x'E0B6BB'), (66, x'E0B6B5'), (59, x'E0B6AD'), (44, x'E0B69E'), (15, x'E0B692'), (23, x'E0B69AE0B78F'), (65, x'E0B6B4'), (42, x'E0B69C'), (63, x'E0B6B1'), (85, x'E0B792'), (47, x'E0B6A1'), (49, x'E0B6A3'), (92, x'E0B7B3'), (78, x'E0B783'), (36, x'E0B69AE0B79B'), (4, x'E0B687'), (24, x'E0B69AE0B790'), (87, x'E0B794'), (37, x'E0B69AE0B79C'), (32, x'E0B69AE0B79F'), (29, x'E0B69AE0B796'), (43, x'E0B69D'), (62, x'E0B6B0'), (100, x'E0B78AE2808DE0B6BA'), (60, x'E0B6AE'), (45, x'E0B69F'), (12, x'E0B68F'), (46, x'E0B6A0'), (50, x'E0B6A5'), (51, x'E0B6A4'), (5, x'E0B688'), (76, x'E0B781'), (89, x'E0B798'), (74, x'E0B6BD'), (10, x'E0B68D'), (57, x'E0B6AB'), (71, x'E0B6BA'), (58, x'E0B6AC'), (27, x'E0B69AE0B793'), (54, x'E0B6A8'), (84, x'E0B791'), (31, x'E0B69AE0B7B2'), (98, x'E0B79E'), (53, x'E0B6A7'), (41, x'E0B69B'), (67, x'E0B6B6'), (7, x'E0B68A'), (20, x'E0B682');
SELECT predicted_order, hex(utf8_encoding) FROM t1 ORDER BY utf8_encoding COLLATE utf8_sinhala_ci;
DROP TABLE t1;
+#
+# Postfix for Bug#26474
+#
+SET NAMES utf8 COLLATE utf8_sinhala_ci;
+CREATE TABLE t1 (s1 VARCHAR(10) COLLATE utf8_sinhala_ci);
+INSERT INTO t1 VALUES ('a'),('ae'),('af');
+SELECT s1,hex(s1) FROM t1 ORDER BY s1;
+SELECT * FROM t1 ORDER BY s1;
+DROP TABLE t1;
--echo End of 5.4 tests
@@ -1518,6 +1547,28 @@ DROP TABLE t1, t2;
SET NAMES utf8;
--source include/ctype_numconv.inc
+--echo #
+--echo # Bug#57687 crash when reporting duplicate group_key error and utf8
+--echo # Make sure to modify this when Bug#58081 is fixed.
+--echo #
+SET NAMES utf8;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (0), (0), (1), (0), (0);
+--error ER_DUP_ENTRY
+SELECT COUNT(*) FROM t1, t1 t2
+GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size));
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters
+--echo #
+# Emulate utf8 client erroneously started with --default-character-set=latin1,
+# as in the bug report. EXPLAIN output should still be pretty readable
+SET NAMES latin1;
+EXPLAIN EXTENDED SELECT 'abcdÃÂÃÄÅ', _latin1'abcdÃÂÃÄÅ', _utf8'abcdÃÂÃÄÅ' AS u;
+# Test normal utf8
+SET NAMES utf8;
+EXPLAIN EXTENDED SELECT 'abcdÃÂÃÄÅ', _latin1'abcdÃÂÃÄÅ', _utf8'abcdÃÂÃÄÅ';
--echo #
--echo # End of 5.5 tests
diff --git a/mysql-test/t/ctype_utf8mb4_ndb.test b/mysql-test/t/ctype_utf8mb4_ndb.test
deleted file mode 100644
index fba0ae918a1..00000000000
--- a/mysql-test/t/ctype_utf8mb4_ndb.test
+++ /dev/null
@@ -1,7 +0,0 @@
---source include/have_utf8mb4.inc
---source include/have_ndb.inc
-
-let $engine= ndb;
-let $is_ndb= 1;
---source include/ctype_utf8mb4.inc
-
diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test
index a83e18c44d9..669a66bc6c5 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -354,3 +354,19 @@ SELECT DATE_FORMAT("0000-02-28",'%W %d %M %Y') as valid_date;
SELECT DATE_FORMAT("2009-01-01",'%W %d %M %Y') as valid_date;
--echo "End of 5.0 tests"
+
+
+--echo #
+--echo # Start of 5.1 tests
+--echo #
+
+--echo #
+--echo # Bug#58005 utf8 + get_format causes failed assertion: !str || str != Ptr'
+--echo #
+SET NAMES utf8;
+SELECT LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535)));
+SET NAMES latin1;
+
+--echo #
+--echo # End of 5.1 tests
+--echo #
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index 6b6cdaabcdf..1898d1a4691 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -552,6 +552,21 @@ connection con1;
--echo # Reaping: INSERT DELAYED INTO t1 VALUES (5)
--reap
+--echo # Connection default
+connection default;
+
+--echo # Test 5: LOCK TABLES + INSERT DELAYED in one connection.
+--echo # This test has triggered some asserts in metadata locking
+--echo # subsystem at some point in time..
+LOCK TABLE t1 WRITE;
+INSERT DELAYED INTO t2 VALUES (7);
+UNLOCK TABLES;
+SET AUTOCOMMIT= 0;
+LOCK TABLE t1 WRITE;
+INSERT DELAYED INTO t2 VALUES (8);
+UNLOCK TABLES;
+SET AUTOCOMMIT= 1;
+
--echo # Connection con2
connection con2;
disconnect con2;
@@ -565,3 +580,52 @@ disconnect con1;
connection default;
DROP TABLE t1, t2, t3;
--enable_ps_protocol
+
+
+--echo #
+--echo # Test for bug #56251 "Deadlock with INSERT DELAYED and MERGE tables".
+--echo #
+connect (con1,localhost,root,,);
+connection default;
+--disable_warnings
+drop table if exists t1, t2, tm;
+--enable_warnings
+create table t1(a int);
+create table t2(a int);
+create table tm(a int) engine=merge union=(t1, t2);
+begin;
+select * from t1;
+
+--echo # Connection 'con1'.
+connection con1;
+--echo # Sending:
+--send alter table t1 comment 'test'
+
+--echo # Connection 'default'.
+connection default;
+--echo # Wait until ALTER TABLE blocks and starts waiting
+--echo # for connection 'default'. It should wait with a
+--echo # pending SNW lock on 't1'.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table metadata lock" and
+ info = "alter table t1 comment 'test'";
+--source include/wait_condition.inc
+--echo # Attempt to perform delayed insert into 'tm' should not lead
+--echo # to a deadlock. Instead error ER_DELAYED_NOT_SUPPORTED should
+--echo # be emitted.
+--error ER_DELAYED_NOT_SUPPORTED
+insert delayed into tm values (1);
+--echo # Unblock ALTER TABLE.
+commit;
+
+--echo # Connection 'con1'.
+connection con1;
+--echo # Reaping ALTER TABLE:
+--reap
+
+disconnect con1;
+--source include/wait_until_disconnected.inc
+--echo # Connection 'default'.
+connection default;
+drop tables tm, t1, t2;
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index 15aade73ab7..6a72ae9c38b 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -554,3 +554,29 @@ DELETE FROM t1.*, test.t2.*, a.* USING t1, t2, t3 AS a;
DROP TABLE t1, t2, t3;
--echo End of 5.1 tests
+
+
+--echo #
+--echo # Bug#51099 Assertion in mysql_multi_delete_prepare()
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+DROP VIEW IF EXISTS v1, v2;
+--enable_warnings
+
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(b INT);
+CREATE VIEW v1 AS SELECT a, b FROM t1, t2;
+CREATE VIEW v2 AS SELECT a FROM v1;
+
+# This is a normal delete
+--error ER_VIEW_DELETE_MERGE_VIEW
+DELETE FROM v2;
+# This is a multi table delete, check that we get the same error
+# This caused the assertion.
+--error ER_VIEW_DELETE_MERGE_VIEW
+DELETE v2 FROM v2;
+
+DROP VIEW v2, v1;
+DROP TABLE t1, t2;
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index c3d4a7657f3..a2681b82d26 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -303,4 +303,37 @@ SELECT 0 FROM
(SELECT 0) t56, (SELECT 0) t57, (SELECT 0) t58, (SELECT 0) t59, (SELECT 0) t60,
(SELECT 0) t61; # 61 == MAX_TABLES
+--echo #
+--echo # A nested materialized derived table is used before being populated.
+--echo # (addon for bug#19077)
+--echo #
+
+CREATE TABLE t1 (i INT, j BIGINT);
+INSERT INTO t1 VALUES (1, 2), (2, 2), (3, 2);
+SELECT * FROM (SELECT MIN(i) FROM t1
+WHERE j = SUBSTRING('12', (SELECT * FROM (SELECT MIN(j) FROM t1) t2))) t3;
+DROP TABLE t1;
+
--echo # End of 5.0 tests
+
+
+--echo #
+--echo # Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table,
+--echo # temptable views
+--echo #
+
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT, KEY (b));
+INSERT INTO t1 VALUES (1),(1);
+INSERT INTO t2 VALUES (1),(1);
+
+CREATE algorithm=temptable VIEW v1 AS
+ SELECT 1 FROM t1 LEFT JOIN t1 t3 ON 1 > (SELECT 1 FROM t1);
+CREATE algorithm=temptable VIEW v2 AS SELECT 1 FROM t2;
+
+# This caused the assert to be triggered.
+--error ER_SUBQUERY_NO_1_ROW
+EXPLAIN SELECT 1 FROM t1 JOIN v1 ON 1 > (SELECT 1 FROM v2);
+
+DROP TABLE t1, t2;
+DROP VIEW v1, v2;
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index bd1817b20ec..a2a91fab680 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -9,13 +9,13 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
-lowercase_table3 : Bug#54845 2010-06-30 alik main.lowercase_table3 on Mac OSX
-mysqlhotcopy_myisam : Bug#54129 2010-08-31 alik mysqlhotcopy* fails
-mysqlhotcopy_archive : Bug#54129 2010-08-31 alik mysqlhotcopy* fails
-partition_innodb_plugin : Bug#53307 2010-04-30 VasilDimov valgrind warnings
-query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
-sp_sync : Bug#48157 2010-02-06 5.5-m3 demands a differnt solution
-ctype_utf8mb4_ndb : Bug#55799, Bug#51907, disabled by Konstantin 2010-08-06
main.events_time_zone : Test is not predictable as it depends on precise timing.
table_elim : sergeyp to reapply 2643.26.4 in Item_sum::update_used_tables
+lowercase_table3 : Bug#11762269 2010-06-30 alik main.lowercase_table3 on Mac OSX
+read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists
+sum_distinct-big : Bug#11764126 2010-11-15 mattiasj was not tested
+alter_table-big : Bug#11748731 2010-11-15 mattiasj was not tested
+create-big : Bug#11748731 2010-11-15 mattiasj was not tested
+archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc
+log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists
+mysql_embedded : Bug#12561297 2011-06-15 New test failing on all platforms
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index bf4c23562cf..84073d15109 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -614,3 +614,16 @@ SET @@sort_buffer_size = @old_sort_buffer_size;
SET @@max_heap_table_size = @old_max_heap_table_size;
--echo End of 5.1 tests
+
+
+--echo #
+--echo # Bug #11744875: 4082: integer lengths cause truncation with distinct concat and innodb
+--echo #
+
+CREATE TABLE t1 (a INT(1), b INT(1));
+INSERT INTO t1 VALUES (1111, 2222), (3333, 4444);
+SELECT DISTINCT CONCAT(a,b) AS c FROM t1 ORDER BY 1;
+DROP TABLE t1;
+
+
+--echo End of 5.5 tests
diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test
index f308c340645..82822c87e89 100644
--- a/mysql-test/t/errors.test
+++ b/mysql-test/t/errors.test
@@ -155,3 +155,19 @@ INSERT INTO t1 VALUES ('abc\0\0');
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES ('abc\0\0');
DROP TABLE t1;
+
+--echo #
+--echo # Bug#57882: Item_func_conv_charset::val_str(String*):
+--echo # Assertion `fixed == 1' failed
+--echo #
+
+--error ER_DATA_OUT_OF_RANGE
+SELECT (CONVERT('0' USING latin1) IN (CHAR(COT('v') USING utf8),''));
+
+SET NAMES utf8 COLLATE utf8_latvian_ci ;
+--error ER_DATA_OUT_OF_RANGE
+SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null);
+
+--echo #
+--echo # End Bug#57882
+--echo #
diff --git a/mysql-test/t/events_1.test b/mysql-test/t/events_1.test
index ccdeb70d291..7f31e3fc881 100644
--- a/mysql-test/t/events_1.test
+++ b/mysql-test/t/events_1.test
@@ -4,6 +4,8 @@
# Can't test with embedded server that doesn't support grants
-- source include/not_embedded.inc
+call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
+
--disable_warnings
drop database if exists events_test;
drop database if exists db_x;
@@ -270,23 +272,28 @@ SHOW EVENTS;
--echo Try to alter mysql.event: the server should fail to load
--echo event information after mysql.event was tampered with.
--echo
---echo First, let's add a column to the end and make sure everything
---echo works as before
+--echo First, let's add a column to the end and check the error is emitted.
--echo
ALTER TABLE mysql.event ADD dummy INT;
---replace_column 8 # 9 #
+--error ER_EVENT_OPEN_TABLE_FAILED
SHOW EVENTS;
+--error ER_EVENT_OPEN_TABLE_FAILED
SELECT event_name FROM INFORMATION_SCHEMA.events;
---replace_regex /STARTS '[^']+'/STARTS '#'/
+--error ER_EVENT_OPEN_TABLE_FAILED
SHOW CREATE EVENT intact_check;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT no_such_event;
+--error ER_EVENT_OPEN_TABLE_FAILED
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
+--error ER_EVENT_OPEN_TABLE_FAILED
ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
+--error ER_EVENT_OPEN_TABLE_FAILED
ALTER EVENT intact_check_1 RENAME TO intact_check_2;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check_1;
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check_2;
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check;
DROP DATABASE IF EXISTS mysqltest_no_such_database;
CREATE DATABASE mysqltest_db2;
@@ -296,6 +303,7 @@ SHOW VARIABLES LIKE 'event_scheduler';
SET GLOBAL event_scheduler=OFF;
# Clean up
ALTER TABLE mysql.event DROP dummy;
+DROP EVENT intact_check;
CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing";
--echo
--echo Now let's add a column to the first position: the server
@@ -303,24 +311,26 @@ CREATE EVENT intact_check ON SCHEDULE EVERY 10 HOUR DO SELECT "nothing";
--echo
ALTER TABLE mysql.event ADD dummy INT FIRST;
--error ER_CANNOT_LOAD_FROM_TABLE
+--error ER_EVENT_OPEN_TABLE_FAILED
SHOW EVENTS;
--error ER_CANNOT_LOAD_FROM_TABLE
+--error ER_EVENT_OPEN_TABLE_FAILED
SELECT event_name FROM INFORMATION_SCHEMA.events;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
SHOW CREATE EVENT intact_check;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT no_such_event;
---error ER_EVENT_STORE_FAILED
+--error ER_EVENT_OPEN_TABLE_FAILED
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
ALTER EVENT intact_check_1 RENAME TO intact_check_2;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check_1;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check_2;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check;
# Should work OK
DROP DATABASE IF EXISTS mysqltest_no_such_database;
@@ -341,25 +351,25 @@ INSERT INTO event_like SELECT * FROM mysql.event;
--echo
--echo
ALTER TABLE mysql.event DROP comment, DROP starts;
---error ER_CANNOT_LOAD_FROM_TABLE
+--error ER_EVENT_OPEN_TABLE_FAILED
SHOW EVENTS;
---error ER_CANNOT_LOAD_FROM_TABLE
+--error ER_EVENT_OPEN_TABLE_FAILED
SELECT event_name FROM INFORMATION_SCHEMA.EVENTS;
---error ER_CANNOT_LOAD_FROM_TABLE
+--error ER_EVENT_OPEN_TABLE_FAILED
SHOW CREATE EVENT intact_check;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT no_such_event;
---error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED
+--error ER_EVENT_OPEN_TABLE_FAILED
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
ALTER EVENT intact_check_1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
ALTER EVENT intact_check_1 RENAME TO intact_check_2;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check_1;
---error ER_EVENT_DOES_NOT_EXIST
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check_2;
-# Should succeed
+--error ER_EVENT_OPEN_TABLE_FAILED
DROP EVENT intact_check;
DROP DATABASE IF EXISTS mysqltest_no_such_database;
CREATE DATABASE mysqltest_db2;
@@ -407,9 +417,54 @@ CREATE TABLE mysql.event like event_like;
DROP TABLE event_like;
--replace_column 8 # 9 #
SHOW EVENTS;
-#
-# End of tests
-#
+
+--echo
+--echo #
+--echo # Bug#12394306: the sever may crash if mysql.event is corrupted
+--echo #
+
+--echo
+CREATE EVENT ev1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
+ALTER EVENT ev1 ON SCHEDULE EVERY 8 HOUR DO SELECT 8;
+
+--echo
+CREATE TABLE event_original LIKE mysql.event;
+INSERT INTO event_original SELECT * FROM mysql.event;
+
+--echo
+ALTER TABLE mysql.event MODIFY modified CHAR(1);
+
+--echo
+--error ER_EVENT_OPEN_TABLE_FAILED
+SHOW EVENTS;
+
+--echo
+--error ER_EVENT_OPEN_TABLE_FAILED
+SELECT event_name, created, last_altered FROM information_schema.events;
+
+--echo
+--error ER_EVENT_OPEN_TABLE_FAILED
+CREATE EVENT ev2 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
+
+--echo
+--error ER_EVENT_OPEN_TABLE_FAILED
+ALTER EVENT ev1 ON SCHEDULE EVERY 9 HOUR DO SELECT 9;
+
+--echo
+DROP TABLE mysql.event;
+RENAME TABLE event_original TO mysql.event;
+
+--echo
+DROP EVENT ev1;
+
+--echo
+SHOW EVENTS;
+
+
+--echo
+--echo #
+--echo # End of tests
+--echo #
let $wait_condition=
select count(*) = 0 from information_schema.processlist
diff --git a/mysql-test/t/events_2.test b/mysql-test/t/events_2.test
index 08412d2f5b0..3d609654b21 100644
--- a/mysql-test/t/events_2.test
+++ b/mysql-test/t/events_2.test
@@ -212,15 +212,15 @@ lock table t1 read;
--replace_regex /STARTS '[^']+'/STARTS '#'/
show create event e1;
select event_name from information_schema.events;
---error ER_TABLE_NOT_LOCKED
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
create event e2 on schedule every 10 hour do select 1;
---error ER_TABLE_NOT_LOCKED
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
alter event e2 disable;
---error ER_TABLE_NOT_LOCKED
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
alter event e2 rename to e3;
---error ER_TABLE_NOT_LOCKED
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
drop event e2;
---error ER_TABLE_NOT_LOCKED
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
drop event e1;
unlock tables;
#
@@ -229,15 +229,15 @@ lock table t1 write;
--replace_regex /STARTS '[^']+'/STARTS '#'/
show create event e1;
select event_name from information_schema.events;
---error ER_TABLE_NOT_LOCKED
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
create event e2 on schedule every 10 hour do select 1;
---error ER_TABLE_NOT_LOCKED
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
alter event e2 disable;
---error ER_TABLE_NOT_LOCKED
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
alter event e2 rename to e3;
---error ER_TABLE_NOT_LOCKED
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
drop event e2;
---error ER_TABLE_NOT_LOCKED
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
drop event e1;
unlock tables;
#
@@ -246,15 +246,15 @@ lock table t1 read, mysql.event read;
--replace_regex /STARTS '[^']+'/STARTS '#'/
show create event e1;
select event_name from information_schema.events;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
create event e2 on schedule every 10 hour do select 1;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
alter event e2 disable;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
alter event e2 rename to e3;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
drop event e2;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
drop event e1;
unlock tables;
#
@@ -263,15 +263,15 @@ lock table t1 write, mysql.event read;
--replace_regex /STARTS '[^']+'/STARTS '#'/
show create event e1;
select event_name from information_schema.events;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
create event e2 on schedule every 10 hour do select 1;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
alter event e2 disable;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
alter event e2 rename to e3;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
drop event e2;
---error ER_TABLE_NOT_LOCKED_FOR_WRITE
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
drop event e1;
unlock tables;
#
@@ -285,12 +285,18 @@ lock table mysql.event write;
--replace_regex /STARTS '[^']+'/STARTS '#'/
show create event e1;
select event_name from information_schema.events;
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
create event e2 on schedule every 10 hour do select 1;
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
alter event e2 disable;
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
alter event e2 rename to e3;
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
drop event e3;
+--error ER_LOCK_OR_ACTIVE_TRANSACTION
drop event e1;
unlock tables;
+drop event e1;
--echo Make sure we have left no events
select event_name from information_schema.events;
--echo
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index 6fd03f4d8dc..dc31556998a 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -857,6 +857,7 @@ DROP EVENT e2;
DROP EVENT e1;
SET TIME_ZONE=@save_time_zone;
+SET TIMESTAMP=DEFAULT;
#
# START - BUG#28666 CREATE EVENT ... EVERY 0 SECOND let server crash
@@ -1219,6 +1220,87 @@ SELECT event_name, originator FROM INFORMATION_SCHEMA.EVENTS;
DROP EVENT ev1;
SET GLOBAL server_id = @old_server_id;
+#
+# Bug#11751148: show events shows events in other schema
+#
+
+CREATE DATABASE event_test12;
+USE event_test12;
+CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
+CREATE DATABASE event_test1;
+USE event_test1;
+# Following show events should not show ev1
+SHOW EVENTS;
+DROP DATABASE event_test1;
+DROP DATABASE event_test12;
+
+--echo #
+--echo # Bug#12546938 (formerly known as bug#61005):
+--echo # CREATE IF NOT EXIST EVENT WILL CREATE MULTIPLE RUNNING EVENTS
+--echo #
+USE events_test;
+SET GLOBAL event_scheduler = ON;
+
+--disable_warnings
+DROP TABLE IF EXISTS table_bug12546938;
+DROP EVENT IF EXISTS event_Bug12546938;
+--enable_warnings
+CREATE TABLE table_bug12546938 (i INT);
+
+delimiter |;
+
+--echo # Create an event which will be executed with a small delay
+--echo # and won't be automatically dropped after that.
+CREATE EVENT event_Bug12546938
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
+ENABLE DO
+BEGIN
+ INSERT INTO table_bug12546938 VALUES(1);
+END
+|
+
+--echo # Now try to create the same event using CREATE EVENT IF NOT EXISTS.
+--echo # A warning should be emitted. A new event should not be created nor
+--echo # the old event should be re-executed.
+CREATE EVENT IF NOT EXISTS event_bug12546938
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND ON COMPLETION PRESERVE
+ENABLE DO
+BEGIN
+ INSERT INTO table_bug12546938 VALUES (1);
+END
+|
+
+delimiter ;|
+
+--echo # Wait until at least one instance of event is executed.
+let $wait_condition= SELECT COUNT(*) FROM table_bug12546938;
+--source include/wait_condition.inc
+
+--echo # Check that only one instance of our event was executed.
+SELECT COUNT(*) FROM table_bug12546938;
+
+--echo # Clean-up.
+DROP EVENT IF EXISTS event_Bug12546938;
+DROP TABLE table_bug12546938;
+SET GLOBAL EVENT_SCHEDULER = OFF;
+
+#
+# Bug#11764334 - 57156: ALTER EVENT CHANGES THE EVENT STATUS
+#
+--disable_warnings
+DROP DATABASE IF EXISTS event_test11764334;
+--enable_warnings
+CREATE DATABASE event_test11764334;
+USE event_test11764334;
+CREATE EVENT ev1 ON SCHEDULE EVERY 3 SECOND DISABLE DO SELECT 1;
+--replace_column 9 # 10 #
+SHOW EVENTS IN event_test11764334 WHERE NAME='ev1';
+ALTER EVENT ev1 ON SCHEDULE EVERY 4 SECOND;
+--replace_column 9 # 10 #
+SHOW EVENTS IN event_test11764334 WHERE NAME='ev1';
+DROP EVENT ev1;
+DROP DATABASE event_test11764334;
+USE test;
###########################################################################
#
# End of tests
diff --git a/mysql-test/t/events_restart.test b/mysql-test/t/events_restart.test
index e155fe2ea16..facf2912087 100644
--- a/mysql-test/t/events_restart.test
+++ b/mysql-test/t/events_restart.test
@@ -1,6 +1,8 @@
# Can't test with embedded server that doesn't support grants
-- source include/not_embedded.inc
+call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
+
#
# Test that when the server is restarted, it checks mysql.event table,
# and disables the scheduler if it's not up to date.
diff --git a/mysql-test/t/execution_constants.test b/mysql-test/t/execution_constants.test
index e61d79f5249..92b1deb9921 100644
--- a/mysql-test/t/execution_constants.test
+++ b/mysql-test/t/execution_constants.test
@@ -49,7 +49,7 @@ while ($i)
let $i = 1//
# Check that mysql_errno is 1436
- if (`select $mysql_errno != 1436`)
+ if ($mysql_errno != 1436)
{
die Wrong error triggered, expected 1436 but got $mysql_errno//
}
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index 60108b3b038..8376fdf1ad1 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -1,5 +1,5 @@
#
-# Test of different EXPLAIN's
+# Test of different EXPLAINs
--disable_warnings
drop table if exists t1;
@@ -238,4 +238,61 @@ EXPLAIN SELECT c1 FROM t1 WHERE c2 = 1 AND c4 = 1 AND c5 = 1;
DROP TABLE t1;
+--echo #
+--echo # Bug#56814 Explain + subselect + fulltext crashes server
+--echo #
+
+CREATE TABLE t1(f1 VARCHAR(6) NOT NULL,
+FULLTEXT KEY(f1),UNIQUE(f1));
+INSERT INTO t1 VALUES ('test');
+
+EXPLAIN SELECT 1 FROM t1
+WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a ON (MATCH(t1.f1) AGAINST (""))
+WHERE t1.f1 GROUP BY t1.f1));
+
+PREPARE stmt FROM
+'EXPLAIN SELECT 1 FROM t1
+ WHERE 1 > ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a
+ ON (MATCH(t1.f1) AGAINST (""))
+ WHERE t1.f1 GROUP BY t1.f1))';
+
+EXECUTE stmt;
+EXECUTE stmt;
+
+DEALLOCATE PREPARE stmt;
+
+PREPARE stmt FROM
+'EXPLAIN SELECT 1 FROM t1
+ WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a
+ ON (MATCH(t1.f1) AGAINST (""))
+ WHERE t1.f1 GROUP BY t1.f1))';
+
+EXECUTE stmt;
+EXECUTE stmt;
+
+DEALLOCATE PREPARE stmt;
+
+DROP TABLE t1;
+
--echo End of 5.1 tests.
+
+--echo #
+--echo # Bug#11829785 EXPLAIN EXTENDED CRASH WITH RIGHT OUTER JOIN, SUBQUERIES
+--echo #
+
+CREATE TABLE t1(a INT);
+
+INSERT INTO t1 VALUES (0), (0);
+
+PREPARE s FROM
+'EXPLAIN EXTENDED
+SELECT SUBSTRING(1, (SELECT 1 FROM t1 a1 RIGHT OUTER JOIN t1 ON 0)) AS d
+FROM t1 WHERE 0 > ANY (SELECT @a FROM t1)';
+
+--error ER_SUBQUERY_NO_1_ROW
+EXECUTE s;
+
+DEALLOCATE PREPARE s;
+DROP TABLE t1;
+
+--echo #
diff --git a/mysql-test/t/file_contents.test b/mysql-test/t/file_contents.test
new file mode 100644
index 00000000000..33cd65fb2b4
--- /dev/null
+++ b/mysql-test/t/file_contents.test
@@ -0,0 +1,68 @@
+#
+# Testing files that were built to be packaged, both for existence and for contents
+#
+
+#
+# Bug #42969: Create MANIFEST files
+#
+# Use a Perl script to verify that files "docs/INFO_BIN" and "docs/INFO_SRC" do exist
+# and have the expected contents.
+
+--perl
+print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n";
+$dir_bin = $ENV{'MYSQL_BINDIR'};
+if ($dir_bin =~ m|/usr/|) {
+ # RPM package
+ $dir_docs = $dir_bin;
+ $dir_docs =~ s|/lib|/share/doc|;
+ if(-d "$dir_docs/packages/MySQL-server") {
+ # SuSE
+ $dir_docs = "$dir_docs/packages/MySQL-server";
+ } else {
+ # RedHat: version number in directory name
+ $dir_docs = glob "$dir_docs/MySQL-server*";
+ }
+} elsif ($dir_bin =~ m|/usr$|) {
+ # RPM build during development
+ $dir_docs = "$dir_bin/share/doc";
+ if(-d "$dir_docs/packages/MySQL-server") {
+ # SuSE
+ $dir_docs = "$dir_docs/packages/MySQL-server";
+ } else {
+ # RedHat: version number in directory name
+ $dir_docs = glob "$dir_docs/MySQL-server*";
+ }
+} else {
+ # tar.gz package, Windows, or developer work (in BZR)
+ $dir_docs = $dir_bin;
+ $dir_docs =~ s|/lib||;
+ if(-d "$dir_docs/docs") {
+ $dir_docs = "$dir_docs/docs"; # package
+ } else {
+ $dir_docs = "$dir_docs/Docs"; # development tree
+ }
+}
+$found_version = "No line 'MySQL source #.#.#'";
+$found_revision = "No line 'revision-id: .....'";
+open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs' (starting from bindir '$dir_bin')\n";
+while(defined ($line = <I_SRC>)) {
+ if ($line =~ m|^MySQL source \d\.\d\.\d+|) {$found_version = "Found MySQL version number";}
+ if ($line =~ m|^revision-id: .*@.*-2\d{13}-\w+$|) {$found_revision = "Found BZR revision id";}
+}
+close I_SRC;
+print "INFO_SRC: $found_version / $found_revision\n";
+$found_compiler = "No line about compiler information";
+$found_features = "No line 'Feature flags'";
+open(I_BIN,"<","$dir_docs/INFO_BIN") or print "Cannot open 'INFO_BIN' in '$dir_docs' (starting from bindir '$dir_bin')\n";
+while(defined ($line = <I_BIN>)) {
+ # "generator" on Windows, "flags" on Unix:
+ if (($line =~ m| Compiler / generator used: |) ||
+ ($line =~ m| Compiler flags used |)) {$found_compiler = "Found 'Compiler ... used' line";}
+ if ($line =~ m| Feature flags used:|) {$found_features = "Found 'Feature flags' line";}
+}
+close I_BIN;
+print "INFO_BIN: $found_compiler / $found_features\n";
+EOF
+
+--echo
+--echo End of tests
diff --git a/mysql-test/t/filesort_debug.test b/mysql-test/t/filesort_debug.test
new file mode 100644
index 00000000000..724ebc90368
--- /dev/null
+++ b/mysql-test/t/filesort_debug.test
@@ -0,0 +1,59 @@
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
+--source include/count_sessions.inc
+
+SET @old_debug= @@session.debug;
+
+--echo #
+--echo # Bug#36022 please log more information about "Sort aborted" queries
+--echo #
+
+CREATE TABLE t1(f0 int auto_increment primary key, f1 int);
+INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);
+
+SET session debug= '+d,make_char_array_fail';
+CALL mtr.add_suppression("Out of sort memory");
+--error ER_OUT_OF_SORTMEMORY
+SELECT * FROM t1 ORDER BY f1 ASC, f0;
+SET session debug= @old_debug;
+
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+--error ER_SP_WRONG_NO_OF_ARGS
+DELETE FROM t1 ORDER BY (f1(10)) LIMIT 1;
+
+DROP TABLE t1;
+DROP FUNCTION f1;
+
+--echo #
+--echo # Bug #11747102
+--echo # 30771: LOG MORE INFO ABOUT THREADS KILL'D AND SORT ABORTED MESSAGES
+--echo #
+
+connect (con1, localhost, root);
+connect (con2, localhost, root);
+
+--echo # connection 1
+connection con1;
+CREATE TABLE t1(f0 int auto_increment primary key, f1 int);
+INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);
+
+let $ID= `SELECT @id := CONNECTION_ID()`;
+
+SET DEBUG_SYNC='filesort_start SIGNAL filesort_started WAIT_FOR filesort_killed';
+--echo # Sending: (not reaped since connection is killed later)
+--send SELECT * FROM t1 ORDER BY f1 ASC, f0
+
+--echo # connection 2
+connection con2;
+let $ignore= `SELECT @id := $ID`;
+SET DEBUG_SYNC='now WAIT_FOR filesort_started';
+KILL @id;
+SET DEBUG_SYNC='now SIGNAL filesort_killed';
+
+--echo # connection default
+connection default;
+disconnect con1;
+disconnect con2;
+--source include/wait_until_count_sessions.inc
+SET DEBUG_SYNC= "RESET";
+DROP TABLE t1;
diff --git a/mysql-test/t/fix_priv_tables.test b/mysql-test/t/fix_priv_tables.test
index eeda9bc8d15..f68c8b518c8 100644
--- a/mysql-test/t/fix_priv_tables.test
+++ b/mysql-test/t/fix_priv_tables.test
@@ -3,7 +3,7 @@
# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set
# to the location of mysql_fix_privilege_tables.sql
-if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
+if (!$MYSQL_FIX_PRIVILEGE_TABLES)
{
skip Test need MYSQL_FIX_PRIVILEGE_TABLES;
}
diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test
index d4c3533847d..52ee6d2cf87 100644
--- a/mysql-test/t/flush.test
+++ b/mysql-test/t/flush.test
@@ -546,3 +546,125 @@ disconnect con2;
connection default;
drop table t1;
+
+--echo #
+--echo # Test for bug #55273 "FLUSH TABLE tm WITH READ LOCK for Merge table
+--echo # causes assert failure".
+--echo #
+--disable_warnings
+drop table if exists t1, t2, tm;
+--enable_warnings
+create table t1 (i int);
+create table t2 (i int);
+create table tm (i int) engine=merge union=(t1, t2);
+insert into t1 values (1), (2);
+insert into t2 values (3), (4);
+--echo # The below statement should succeed and lock merge
+--echo # table for read. Only merge table gets flushed and
+--echo # not underlying tables.
+flush tables tm with read lock;
+select * from tm;
+--echo # Check that underlying tables are locked.
+select * from t1;
+select * from t2;
+unlock tables;
+--echo # This statement should succeed as well and flush
+--echo # all tables in the list.
+flush tables tm, t1, t2 with read lock;
+select * from tm;
+--echo # Naturally, underlying tables should be locked in this case too.
+select * from t1;
+select * from t2;
+unlock tables;
+drop tables tm, t1, t2;
+
+
+--echo #
+--echo # Test for bug #57006 "Deadlock between HANDLER and
+--echo # FLUSH TABLES WITH READ LOCK".
+--echo #
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+connection default;
+create table t1 (i int);
+create table t2 (i int);
+handler t1 open;
+
+--echo # Switching to connection 'con1'.
+connection con1;
+--echo # Sending:
+--send flush tables with read lock
+
+--echo # Switching to connection 'con2'.
+connection con2;
+--echo # Wait until FTWRL starts waiting for 't1' to be closed.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table flush"
+ and info = "flush tables with read lock";
+--source include/wait_condition.inc
+
+--echo # Switching to connection 'default'.
+connection default;
+--echo # The below statement should not cause deadlock.
+--echo # Sending:
+--send insert into t2 values (1)
+
+--echo # Switching to connection 'con2'.
+connection con2;
+--echo # Wait until INSERT starts to wait for FTWRL to go away.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for global read lock"
+ and info = "insert into t2 values (1)";
+--source include/wait_condition.inc
+
+--echo # Switching to connection 'con1'.
+connection con1;
+--echo # FTWRL should be able to continue now.
+--echo # Reap FTWRL.
+--reap
+unlock tables;
+
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap INSERT.
+--reap
+handler t1 close;
+
+--echo # Cleanup.
+connection con1;
+disconnect con1;
+--source include/wait_until_disconnected.inc
+connection con2;
+disconnect con2;
+--source include/wait_until_disconnected.inc
+connection default;
+drop tables t1, t2;
+
+
+--echo #
+--echo # Bug#57649 FLUSH TABLES under FLUSH TABLES <list> WITH READ LOCK leads
+--echo # to assert failure.
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT);
+FLUSH TABLES t1 WITH READ LOCK;
+
+# All these triggered the assertion
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+FLUSH TABLES;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a= 1;
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+ALTER TABLE t1 COMMENT 'test';
+
+UNLOCK TABLES;
+DROP TABLE t1;
diff --git a/mysql-test/t/flush_block_commit.test b/mysql-test/t/flush_block_commit.test
index 0b3bede1684..90443dc9242 100644
--- a/mysql-test/t/flush_block_commit.test
+++ b/mysql-test/t/flush_block_commit.test
@@ -39,7 +39,7 @@ connection con2;
--echo # Wait until COMMIT gets blocked.
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for release of readlock" and info = "COMMIT";
+ where state = "Waiting for commit lock" and info = "COMMIT";
--source include/wait_condition.inc
--echo # Verify that 'con1' was blocked and data did not move.
SELECT * FROM t1;
diff --git a/mysql-test/t/flush_block_commit_notembedded.test b/mysql-test/t/flush_block_commit_notembedded.test
index 7e3f4838ffb..fe9dbf7c19e 100644
--- a/mysql-test/t/flush_block_commit_notembedded.test
+++ b/mysql-test/t/flush_block_commit_notembedded.test
@@ -53,7 +53,7 @@ begin;
connection con1;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for release of readlock" and
+ where state = "Waiting for global read lock" and
info = "insert into t1 values (1)";
--source include/wait_condition.inc
unlock tables;
diff --git a/mysql-test/t/flush_read_lock.test b/mysql-test/t/flush_read_lock.test
new file mode 100644
index 00000000000..9da93dd40a1
--- /dev/null
+++ b/mysql-test/t/flush_read_lock.test
@@ -0,0 +1,2192 @@
+#
+# Test coverage for various aspects of FLUSH TABLES WITH READ LOCK
+# functionality.
+#
+
+# We need InnoDB for COMMIT/ROLLBACK related tests.
+--source include/have_innodb.inc
+# We need the Debug Sync Facility.
+--source include/have_debug_sync.inc
+# Parts of this test use DDL on events, BINLOG statement and
+# other statements which are not supported in embedded server.
+-- source include/not_embedded.inc
+# Save the initial number of concurrent sessions.
+--source include/count_sessions.inc
+
+--echo # FTWRL takes two global metadata locks -- a global shared
+--echo # metadata lock and the commit blocker lock.
+--echo # The first lock prevents DDL from taking place.
+--echo # Let's say that all DDL statements that take metadata
+--echo # locks form class #1 -- incompatible with FTWRL because
+--echo # take incompatible MDL table locks.
+--echo # The first global lock doesn't, however, prevent standalone
+--echo # COMMITs (or implicit COMMITs) from taking place, since a
+--echo # COMMIT doesn't take table locks. It doesn't prevent
+--echo # DDL on temporary tables either, since they don't
+--echo # take any table locks either.
+--echo # Most DDL statements do not perform an implicit commit
+--echo # if operate on a temporary table. Examples are CREATE
+--echo # TEMPORARY TABLE and DROP TEMPORARY TABLE.
+--echo # Thus, these DDL statements can go through in presence
+--echo # of FTWRL. This is class #2 -- compatible because
+--echo # do not take incompatible MDL locks and do not issue
+--echo # implicit commit..
+--echo # (Although these operations do not commit, their effects
+--echo # cannot be rolled back either.)
+--echo # ALTER TABLE, ANALYZE, OPTIMIZE and some others always
+--echo # issue an implicit commit, even if its argument is a
+--echo # temporary table.
+--echo # *Howewer* an implicit commit is a no-op if all engines
+--echo # used since the start of transactiona are non-
+--echo # transactional. Thus, for non-transactional engines,
+--echo # these operations are not blocked by FTWRL.
+--echo # This is class #3 -- compatible because do not take
+--echo # MDL table locks and are non-transactional.
+--echo # On the contrary, for transactional engines, there
+--echo # is always a commit, regardless of whether a table
+--echo # is temporary or not. Thus, for example, ALTER TABLE
+--echo # for a transactional engine will wait for FTWRL,
+--echo # even if the subject table is temporary.
+--echo # Thus ALTER TABLE <temporary> is incompatible
+--echo # with FTWRL. This is class #4 -- incompatible
+--echo # becuase issue implicit COMMIT which is not a no-op.
+--echo # Finally, there are administrative statements (such as
+--echo # RESET SLAVE) that do not take any locks and do not
+--echo # issue COMMIT.
+--echo # This is class #5.
+--echo # The goal of this coverage is to test statements
+--echo # of all classes.
+--echo # @todo: documents the effects of @@autocommit,
+--echo # DML and temporary transactional tables.
+
+--echo # Use MyISAM engine for the most of the tables
+--echo # used in this test in order to be able to
+--echo # check that DDL statements on temporary tables
+--echo # are compatible with FTRWL.
+--disable_warnings
+drop tables if exists t1_base, t2_base, t3_trans;
+drop tables if exists tm_base, tm_base_temp;
+drop database if exists mysqltest1;
+--echo # We're going to test ALTER DATABASE UPGRADE
+drop database if exists `#mysql50#mysqltest-2`;
+drop procedure if exists p1;
+drop function if exists f1;
+drop view if exists v1;
+drop procedure if exists p2;
+drop function if exists f2_base;
+drop function if exists f2_temp;
+drop event if exists e1;
+drop event if exists e2;
+--enable_warnings
+create table t1_base(i int) engine=myisam;
+create table t2_base(j int) engine=myisam;
+create table t3_trans(i int) engine=innodb;
+create temporary table t1_temp(i int) engine=myisam;
+create temporary table t2_temp(j int) engine=myisam;
+create temporary table t3_temp_trans(i int) engine=innodb;
+create database mysqltest1;
+create database `#mysql50#mysqltest-2`;
+create procedure p1() begin end;
+create function f1() returns int return 0;
+create view v1 as select 1 as i;
+create procedure p2(i int) begin end;
+delimiter |;
+create function f2_base() returns int
+begin
+ insert into t1_base values (1);
+ return 0;
+end|
+create function f2_temp() returns int
+begin
+ insert into t1_temp values (1);
+ return 0;
+end|
+delimiter ;|
+create event e1 on schedule every 1 minute do begin end;
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+connect (con3,localhost,root,,);
+connection default;
+
+--echo #
+--echo # Test compatibility of FLUSH TABLES WITH READ LOCK
+--echo # with various statements.
+--echo #
+--echo # These tests don't cover some classes of statements:
+--echo # - Replication-related - CHANGE MASTER TO, START/STOP SLAVE and etc
+--echo # (all compatible with FTWRL).
+--echo # - Plugin-related - INSTALL/UNINSTALL (incompatible with FTWRL,
+--echo # require plugin support).
+
+let $con_aux1=con1;
+let $con_aux2=con2;
+let $cleanup_stmt2= ;
+let $skip_3rd_check= ;
+
+--echo #
+--echo # 1) ALTER variants.
+--echo #
+--echo # 1.1) ALTER TABLE
+--echo #
+--echo # 1.1.a) For base table should be incompatible with FTWRL.
+--echo #
+let $statement= alter table t1_base add column c1 int;
+let $cleanup_stmt1= alter table t1_base drop column c1;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 1.1.b) For a temporary table should be compatible with FTWRL.
+--echo #
+let $statement= alter table t1_temp add column c1 int;
+let $cleanup_stmt= alter table t1_temp drop column c1;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 1.2) ALTER DATABASE should be incompatible with FTWRL.
+--echo #
+let $statement= alter database mysqltest1 default character set utf8;
+let $cleanup_stmt1= alter database mysqltest1 default character set latin1;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 1.3) ALTER DATABASE UPGRADE DATA DIRECTORY NAME should be
+--echo # incompatible with FTWRL.
+--echo #
+let $statement= alter database `#mysql50#mysqltest-2` upgrade data directory name;
+let $cleanup_stmt1= drop database `mysqltest-2`;
+let $cleanup_stmt2= create database `#mysql50#mysqltest-2`;
+--source include/check_ftwrl_incompatible.inc
+let $cleanup_stmt2= ;
+
+--echo #
+--echo # 1.4) ALTER PROCEDURE should be incompatible with FTWRL.
+--echo #
+let $statement= alter procedure p1 comment 'a';
+let $cleanup_stmt1= alter procedure p1 comment '';
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 1.5) ALTER FUNCTION should be incompatible with FTWRL.
+--echo #
+let $statement= alter function f1 comment 'a';
+let $cleanup_stmt1= alter function f1 comment '';
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 1.6) ALTER VIEW should be incompatible with FTWRL.
+--echo #
+let $statement= alter view v1 as select 2 as j;
+let $cleanup_stmt1= alter view v1 as select 1 as i;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 1.7) ALTER EVENT should be incompatible with FTWRL.
+--echo #
+let $statement= alter event e1 comment 'test';
+let $cleanup_stmt1= alter event e1 comment '';
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 1.x) The rest of ALTER statements (ALTER TABLESPACE,
+--echo # ALTER LOGFILE GROUP and ALTER SERVER) are too
+--echo # special to be tested here.
+--echo #
+
+
+--echo #
+--echo # 2) ANALYZE TABLE statement is compatible with FTWRL.
+--echo # See Bug#43336 ANALYZE and OPTIMIZE do not honour
+--echo # --read-only for a discussion why.
+--echo #
+let $statement= analyze table t1_base;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 3) BEGIN, ROLLBACK and COMMIT statements.
+--echo # BEGIN and ROLLBACK are compatible with FTWRL.
+--echo # COMMIT is not.
+--echo #
+--echo # We need a special test for these statements as
+--echo # FTWRL commits a transaction and because COMMIT
+--echo # is handled in a special way.
+flush tables with read lock;
+begin;
+--echo # ROLLBACK is allowed under FTWRL although there
+--echo # no much sense in it. FTWRL commits any previous
+--echo # changes and doesn't allows any DML after it.
+--echo # So such a ROLLBACK is always a no-op.
+rollback;
+--echo # Although COMMIT is incompatible with FTWRL in
+--echo # other senses it is still allowed under FTWRL.
+--echo # This fact relied upon by some versions of
+--echo # innobackup tool.
+--echo # Similarly to ROLLBACK it is a no-op in this situation.
+commit;
+unlock tables;
+--echo # Check that BEGIN/ROLLBACK are not blocked and
+--echo # COMMIT is blocked by active FTWRL in another
+--echo # connection.
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+begin;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Do some work so ROLLBACK is not a no-op.
+insert into t3_trans values (1);
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+rollback;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+begin;
+--echo # Do some work so COMMIT is not a no-op.
+insert into t3_trans values (1);
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Send:
+--send commit
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Wait until COMMIT is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for commit lock" and
+ info = "commit";
+--source include/wait_condition.inc
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap COMMIT.
+--reap
+delete from t3_trans;
+--echo #
+--echo # Check that COMMIT blocks FTWRL in another connection.
+begin;
+insert into t3_trans values (1);
+set debug_sync='RESET';
+set debug_sync='ha_commit_trans_after_acquire_commit_lock SIGNAL parked WAIT_FOR go';
+--send commit
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+set debug_sync='now WAIT_FOR parked';
+--send flush tables with read lock
+--echo # Switching to connection '$con_aux2'.
+connection $con_aux2;
+--echo # Wait until FTWRL is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for commit lock" and
+ info = "flush tables with read lock";
+--source include/wait_condition.inc
+set debug_sync='now SIGNAL go';
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap COMMIT.
+--reap
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Reap FTWRL.
+--reap
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+delete from t3_trans;
+set debug_sync= "RESET";
+--echo # We don't run similar test for BEGIN and ROLLBACK as
+--echo # they release metadata locks in non-standard place.
+
+
+--echo #
+--echo # 4) BINLOG statement should be incompatible with FTWRL.
+--echo #
+--echo #
+--echo # Provide format description BINLOG statement first.
+BINLOG '
+MfmqTA8BAAAAZwAAAGsAAAABAAQANS41LjctbTMtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAx+apMEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
+';
+--echo # Now test compatibility for BINLOG statement which is
+--echo # equivalent to INSERT INTO t1_base VALUES (1).
+let $statement= BINLOG '
+MfmqTBMBAAAALgAAAN0AAAAAACgAAAAAAAEABHRlc3QAB3QxX2Jhc2UAAQMAAQ==
+MfmqTBcBAAAAIgAAAP8AAAAAACgAAAAAAAEAAf/+AQAAAA==
+';
+let $cleanup_stmt1= delete from t1_base where i = 1 limit 1;
+--echo # Skip last part of compatibility testing as this statement
+--echo # releases metadata locks in non-standard place.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_incompatible.inc
+let $skip_3rd_check= ;
+
+
+--echo #
+--echo # 5) CALL statement. This statement uses resources in two
+--echo # ways: through expressions used as parameters and through
+--echo # sub-statements. This test covers only usage through
+--echo # parameters as sub-statements do locking individually.
+--echo #
+--echo # 5.a) In simple cases a parameter expression should be
+--echo # compatible with FTWRL.
+let $statement= call p2((select count(*) from t1_base));
+let $cleanup_stmt1= ;
+--echo # Skip last part of compatibility testing as this statement
+--echo # releases metadata locks in non-standard place.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_compatible.inc
+let $skip_3rd_check= ;
+
+--echo #
+--echo # 5.b) In case when an expression uses function which updates
+--echo # base tables CALL should be incompatible with FTWRL.
+--echo #
+let $statement= call p2(f2_base());
+let $cleanup_stmt1= ;
+--echo # Skip last part of compatibility testing as this statement
+--echo # releases metadata locks in non-standard place.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_incompatible.inc
+let $skip_3rd_check= ;
+
+--echo #
+--echo # 5.c) If function used as argument updates temporary tables
+--echo # CALL statement should be compatible with FTWRL.
+--echo #
+let $statement= call p2(f2_temp());
+let $cleanup_stmt1= ;
+--echo # Skip last part of compatibility testing as this statement
+--echo # releases metadata locks in non-standard place.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_compatible.inc
+let $skip_3rd_check= ;
+
+
+--echo #
+--echo # 6) CHECK TABLE statement is compatible with FTWRL.
+--echo #
+let $statement= check table t1_base;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 7) CHECKSUM TABLE statement is compatible with FTWRL.
+--echo #
+let $statement= checksum table t1_base;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 8) CREATE variants.
+--echo #
+--echo # 8.1) CREATE TABLE statement.
+--echo #
+--echo # 8.1.a) CREATE TABLE is incompatible with FTWRL when
+--echo # base table is created.
+let $statement= create table t3_base(i int);
+let $cleanup_stmt1= drop table t3_base;
+--source include/check_ftwrl_incompatible.inc
+
+--echo # 8.1.b) CREATE TABLE is compatible with FTWRL when
+--echo # temporary table is created.
+let $statement= create temporary table t3_temp(i int);
+let $cleanup_stmt= drop temporary tables t3_temp;
+--source include/check_ftwrl_compatible.inc
+
+--echo # 8.1.c) CREATE TABLE LIKE is incompatible with FTWRL when
+--echo # base table is created.
+let $statement= create table t3_base like t1_temp;
+let $cleanup_stmt1= drop table t3_base;
+--source include/check_ftwrl_incompatible.inc
+
+--echo # 8.1.d) CREATE TABLE LIKE is compatible with FTWRL when
+--echo # temporary table is created.
+let $statement= create temporary table t3_temp like t1_base;
+let $cleanup_stmt= drop temporary table t3_temp;
+--source include/check_ftwrl_compatible.inc
+
+--echo # 8.1.e) CREATE TABLE SELECT is incompatible with FTWRL when
+--echo # base table is created.
+let $statement= create table t3_base select 1 as i;
+let $cleanup_stmt1= drop table t3_base;
+--source include/check_ftwrl_incompatible.inc
+
+--echo # 8.1.f) CREATE TABLE SELECT is compatible with FTWRL when
+--echo # temporary table is created.
+let $statement= create temporary table t3_temp select 1 as i;
+let $cleanup_stmt= drop temporary table t3_temp;
+--source include/check_ftwrl_compatible.inc
+
+--echo # 8.2) CREATE INDEX statement.
+--echo #
+--echo # 8.2.a) CREATE INDEX is incompatible with FTWRL when
+--echo # applied to base table.
+let $statement= create index i on t1_base (i);
+let $cleanup_stmt1= drop index i on t1_base;
+--source include/check_ftwrl_incompatible.inc
+
+--echo # 8.2.b) CREATE INDEX is compatible with FTWRL when
+--echo # applied to temporary table.
+let $statement= create index i on t1_temp (i);
+let $cleanup_stmt= drop index i on t1_temp;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 8.3) CREATE DATABASE is incompatible with FTWRL.
+--echo #
+let $statement= create database mysqltest2;
+let $cleanup_stmt1= drop database mysqltest2;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 8.4) CREATE VIEW is incompatible with FTWRL.
+--echo #
+let $statement= create view v2 as select 1 as j;
+let $cleanup_stmt1= drop view v2;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 8.5) CREATE TRIGGER is incompatible with FTWRL.
+--echo #
+let $statement= create trigger t1_bi before insert on t1_base for each row begin end;
+let $cleanup_stmt1= drop trigger t1_bi;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 8.6) CREATE FUNCTION is incompatible with FTWRL.
+--echo #
+let $statement= create function f2() returns int return 0;
+let $cleanup_stmt1= drop function f2;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 8.7) CREATE PROCEDURE is incompatible with FTWRL.
+--echo #
+let $statement= create procedure p3() begin end;
+let $cleanup_stmt1= drop procedure p3;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 8.8) CREATE EVENT should be incompatible with FTWRL.
+--echo #
+let $statement= create event e2 on schedule every 1 minute do begin end;
+let $cleanup_stmt1= drop event e2;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 8.9) CREATE USER should be incompatible with FTWRL.
+--echo #
+let $statement= create user mysqltest_u1;
+let $cleanup_stmt1= drop user mysqltest_u1;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 8.x) The rest of CREATE variants (CREATE LOGFILE GROUP,
+--echo # CREATE TABLESPACE and CREATE SERVER) are too special
+--echo # to test here.
+--echo #
+
+
+--echo #
+--echo # 9) PREPARE, EXECUTE and DEALLOCATE PREPARE statements.
+--echo #
+--echo # 9.1) PREPARE statement is compatible with FTWRL as it
+--echo # doesn't change any data.
+--echo #
+--echo # 9.1.a) Prepare of simple INSERT statement.
+--echo #
+let $statement= prepare stmt1 from 'insert into t1_base values (1)';
+let $cleanup_stmt= deallocate prepare stmt1;
+--echo # Skip last part of compatibility testing as this statement
+--echo # releases metadata locks in non-standard place.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_compatible.inc
+let $skip_3rd_check= ;
+
+--echo #
+--echo # 9.1.b) Prepare of multi-UPDATE. At some point such statements
+--echo # tried to acquire thr_lock.c locks during prepare phase.
+--echo # This no longer happens and thus it is compatible with
+--echo # FTWRL.
+let $statement= prepare stmt1 from 'update t1_base, t2_base set t1_base.i= 1 where t1_base.i = t2_base.j';
+let $cleanup_stmt= deallocate prepare stmt1;
+--echo # Skip last part of compatibility testing as this statement
+--echo # releases metadata locks in non-standard place.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_compatible.inc
+let $skip_3rd_check= ;
+
+--echo #
+--echo # 9.1.c) Prepare of multi-DELETE. Again PREPARE of such
+--echo # statement should be compatible with FTWRL.
+let $statement= prepare stmt1 from 'delete t1_base from t1_base, t2_base where t1_base.i = t2_base.j';
+let $cleanup_stmt= deallocate prepare stmt1;
+--echo # Skip last part of compatibility testing as this statement
+--echo # releases metadata locks in non-standard place.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_compatible.inc
+let $skip_3rd_check= ;
+
+--echo #
+--echo # 9.2) Compatibility of EXECUTE statement depends on statement
+--echo # to be executed.
+--echo #
+--echo # 9.2.a) EXECUTE for statement which is itself compatible with
+--echo # FTWRL should be compatible.
+prepare stmt1 from 'select * from t1_base';
+let $statement= execute stmt1;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+deallocate prepare stmt1;
+
+call mtr.add_suppression("Slave SQL.*Can.t execute the query because you have a conflicting read lock., Error_code: 1223");
+
+--echo #
+--echo # 9.2.b) EXECUTE for statement which is incompatible with FTWRL
+--echo # should be also incompatible.
+--echo #
+--echo # Check that EXECUTE is not allowed under FTWRL.
+prepare stmt1 from 'insert into t1_base values (1)';
+flush tables with read lock;
+--error ER_CANT_UPDATE_WITH_READLOCK
+execute stmt1;
+unlock tables;
+--echo # Check that active FTWRL in another connection
+--echo # blocks EXECUTE which changes data.
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+--send execute stmt1
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Check that EXECUTE is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for global read lock" and
+ info = "insert into t1_base values (1)";
+--source include/wait_condition.inc
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap EXECUTE.
+--reap
+set debug_sync='RESET';
+set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+--send execute stmt1;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+set debug_sync='now WAIT_FOR parked';
+--send flush tables with read lock
+--echo # Switching to connection '$con_aux2'.
+connection $con_aux2;
+--echo # Wait until FTWRL is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for global read lock" and
+ info = "flush tables with read lock";
+--source include/wait_condition.inc
+set debug_sync='now SIGNAL go';
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap EXECUTE.
+--reap
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Reap FTWRL.
+--reap
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+set debug_sync= "RESET";
+delete from t1_base;
+deallocate prepare stmt1;
+
+--echo #
+--echo # 9.3) DEALLOCATE PREPARE is compatible with FTWRL.
+--echo #
+prepare stmt1 from 'insert into t1_base values (1)';
+let $statement= deallocate prepare stmt1;
+let $cleanup_stmt= prepare stmt1 from 'insert into t1_base values (1)';
+--source include/check_ftwrl_compatible.inc
+deallocate prepare stmt1;
+
+
+--echo #
+--echo # 10) DELETE variations.
+--echo #
+--echo # 10.1) Simple DELETE.
+--echo #
+--echo # 10.1.a) Simple DELETE on base table is incompatible with FTWRL.
+let $statement= delete from t1_base;
+let $cleanup_stmt1= ;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 10.1.b) Simple DELETE on temporary table is compatible with FTWRL.
+let $statement= delete from t1_temp;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 10.2) Multi DELETE.
+--echo #
+--echo # 10.2.a) Multi DELETE on base tables is incompatible with FTWRL.
+let $statement= delete t1_base from t1_base, t2_base where t1_base.i = t2_base.j;
+let $cleanup_stmt1= ;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 10.2.b) Multi DELETE on temporary tables is compatible with FTWRL.
+let $statement= delete t1_temp from t1_temp, t2_temp where t1_temp.i = t2_temp.j;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 11) DESCRIBE should be compatible with FTWRL.
+--echo #
+let $statement= describe t1_base;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 12) Compatibility of DO statement with FTWRL depends on its
+--echo # expression.
+--echo #
+--echo # 12.a) DO with expression which does not change base table
+--echo # should be compatible with FTWRL.
+let $statement= do (select count(*) from t1_base);
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 12.b) DO which calls SF updating base table should be
+--echo # incompatible with FTWRL.
+let $statement= do f2_base();
+let $cleanup_stmt1= delete from t1_base limit 1;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 12.c) DO which calls SF updating temporary table should be
+--echo # compatible with FTWRL.
+let $statement= do f2_temp();
+let $cleanup_stmt= delete from t1_temp limit 1;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 13) DROP variants.
+--echo #
+--echo # 13.1) DROP TABLES.
+--echo #
+--echo # 13.1.a) DROP TABLES which affects base tables is incompatible
+--echo # with FTWRL.
+let $statement= drop table t2_base;
+let $cleanup_stmt1= create table t2_base(j int);
+--source include/check_ftwrl_incompatible.inc
+
+--echo # 13.1.b) DROP TABLES which affects only temporary tables
+--echo # in theory can be compatible with FTWRL.
+--echo # In practice it is not yet.
+let $statement= drop table t2_temp;
+let $cleanup_stmt1= create temporary table t2_temp(j int);
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 13.1.c) DROP TEMPORARY TABLES should be compatible with FTWRL.
+let $statement= drop temporary table t2_temp;
+let $cleanup_stmt= create temporary table t2_temp(j int);
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 13.2) DROP INDEX.
+--echo #
+--echo # 13.2.a) DROP INDEX on a base table is incompatible with FTWRL.
+create index i on t1_base (i);
+let $statement= drop index i on t1_base;
+let $cleanup_stmt1= create index i on t1_base (i);
+--source include/check_ftwrl_incompatible.inc
+drop index i on t1_base;
+
+--echo #
+--echo # 13.2.b) DROP INDEX on a temporary table is compatible with FTWRL.
+create index i on t1_temp (i);
+let $statement= drop index i on t1_temp;
+let $cleanup_stmt= create index i on t1_temp (i);
+--source include/check_ftwrl_compatible.inc
+drop index i on t1_temp;
+
+--echo #
+--echo # 13.3) DROP DATABASE is incompatible with FTWRL
+--echo #
+let $statement= drop database mysqltest1;
+let $cleanup_stmt1= create database mysqltest1;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 13.4) DROP FUNCTION is incompatible with FTWRL.
+--echo #
+let $statement= drop function f1;
+let $cleanup_stmt1= create function f1() returns int return 0;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 13.5) DROP PROCEDURE is incompatible with FTWRL.
+--echo #
+let $statement= drop procedure p1;
+let $cleanup_stmt1= create procedure p1() begin end;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 13.6) DROP USER should be incompatible with FTWRL.
+--echo #
+create user mysqltest_u1;
+let $statement= drop user mysqltest_u1;
+let $cleanup_stmt1= create user mysqltest_u1;
+--source include/check_ftwrl_incompatible.inc
+drop user mysqltest_u1;
+
+--echo #
+--echo # 13.7) DROP VIEW should be incompatible with FTWRL.
+--echo #
+let $statement= drop view v1;
+let $cleanup_stmt1= create view v1 as select 1 as i;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 13.8) DROP EVENT should be incompatible with FTWRL.
+--echo #
+let $statement= drop event e1;
+let $cleanup_stmt1= create event e1 on schedule every 1 minute do begin end;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 13.9) DROP TRIGGER is incompatible with FTWRL.
+--echo #
+create trigger t1_bi before insert on t1_base for each row begin end;
+let $statement= drop trigger t1_bi;
+let $cleanup_stmt1= create trigger t1_bi before insert on t1_base for each row begin end;
+--source include/check_ftwrl_incompatible.inc
+drop trigger t1_bi;
+
+--echo #
+--echo # 13.x) The rest of DROP variants (DROP TABLESPACE, DROP LOGFILE
+--echo # GROUP and DROP SERVER) are too special to test here.
+--echo #
+
+
+--echo #
+--echo # 14) FLUSH variants.
+--echo #
+--echo # Test compatibility of _some_ important FLUSH variants with FTWRL.
+--echo #
+--echo # 14.1) FLUSH TABLES WITH READ LOCK is compatible with itself.
+--echo #
+--echo # Check that FTWRL statements can be run while FTWRL
+--echo # is active in another connection.
+--echo #
+--echo # Switching to connection '$con_aux1'.
+flush tables with read lock;
+--echo # The second FTWRL in a row is allowed at the moment.
+--echo # It does not make much sense as it does only flush.
+flush tables with read lock;
+unlock tables;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+flush tables with read lock;
+unlock tables;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+
+--echo #
+--echo # 14.2) FLUSH TABLES <list> WITH READ LOCK is not blocked by
+--echo # active FTWRL. But since the latter keeps tables open
+--echo # FTWRL is blocked by FLUSH TABLES <list> WITH READ LOCK.
+flush tables with read lock;
+--echo # FT <list> WRL is allowed under FTWRL at the moment.
+--echo # It does not make much sense though.
+flush tables t1_base, t2_base with read lock;
+unlock tables;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+flush tables t1_base, t2_base with read lock;
+unlock tables;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+flush tables t1_base, t2_base with read lock;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--send flush tables with read lock
+--echo # Switching to connection '$con_aux2'.
+connection $con_aux2;
+--echo # Wait until FTWRL is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table flush" and
+ info = "flush tables with read lock";
+--source include/wait_condition.inc
+--echo # Switching to connection 'default'.
+connection default;
+unlock tables;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Reap FTWRL.
+--reap
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+
+
+--echo #
+--echo # 14.3) FLUSH TABLES is compatible with FTWRL.
+let $statement= flush tables;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 14.4) FLUSH TABLES <list> is compatible with FTWRL.
+let $statement= flush table t1_base, t2_base;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 14.5) FLUSH PRIVILEGES is compatible with FTWRL.
+let $statement= flush privileges;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 15) GRANT statement should be incompatible with FTWRL.
+--echo #
+let $statement= grant all privileges on t1_base to mysqltest_u1;
+let $cleanup_stmt1= revoke all privileges on t1_base from mysqltest_u1;
+--source include/check_ftwrl_incompatible.inc
+drop user mysqltest_u1;
+
+
+--echo #
+--echo # 16) All HANDLER variants are half-compatible with FTWRL.
+--echo # I.e. they are not blocked by active FTWRL. But since open
+--echo # HANDLER means open table instance FTWRL is blocked while
+--echo # HANDLER is not closed.
+--echo #
+--echo # Check that HANDLER statements succeed under FTWRL.
+flush tables with read lock;
+handler t1_base open;
+handler t1_base read first;
+handler t1_base close;
+unlock tables;
+--echo # Check that HANDLER statements can be run while FTWRL
+--echo # is active in another connection.
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+handler t1_base open;
+handler t1_base read first;
+handler t1_base close;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+
+
+--echo #
+--echo # 17) HELP statement is compatible with FTWRL.
+--echo #
+let $statement= help no_such_topic;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 18) INSERT statement.
+--echo #
+--echo # 18.a) Ordinary INSERT into base table is incompatible with FTWRL.
+let $statement= insert into t1_base values (1);
+let $cleanup_stmt1= delete from t1_base limit 1;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 18.b) Ordinary INSERT into temp table is compatible with FTWRL.
+let $statement= insert into t1_temp values (1);
+let $cleanup_stmt= delete from t1_temp limit 1;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 18.c) INSERT DELAYED is incompatible with FTWRL.
+let $statement= insert delayed into t1_base values (1);
+let $cleanup_stmt1= ;
+--source include/check_ftwrl_incompatible.inc
+delete from t1_base;
+
+--echo #
+--echo # 18.d) INSERT SELECT into base table is incompatible with FTWRL.
+let $statement= insert into t1_base select * from t1_temp;
+let $cleanup_stmt1= ;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 18.e) INSERT SELECT into temp table is compatible with FTWRL.
+let $statement= insert into t1_temp select * from t1_base;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 19) KILL statement is compatible with FTWRL.
+--echo #
+--echo # Check that KILL can be run under FTWRL.
+flush tables with read lock;
+set @id:= connection_id();
+--error ER_QUERY_INTERRUPTED
+kill query @id;
+unlock tables;
+--echo # Check that KILL statements can be run while FTWRL
+--echo # is active in another connection.
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+--error ER_QUERY_INTERRUPTED
+kill query @id;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Finally check that KILL doesn't block FTWRL
+set debug_sync='RESET';
+set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+--send kill query @id
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+set debug_sync='now WAIT_FOR parked';
+flush tables with read lock;
+unlock tables;
+set debug_sync='now SIGNAL go';
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap KILL.
+--error ER_QUERY_INTERRUPTED
+--reap
+set debug_sync='RESET';
+
+
+--echo #
+--echo # 20) LOAD DATA statement.
+--echo #
+--echo # 20.a) LOAD DATA into base table is incompatible with FTWRL.
+let $statement= load data infile '../../std_data/rpl_loaddata.dat' into table t1_base (@dummy, i);
+let $cleanup_stmt1= delete from t1_base;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 20.b) LOAD DATA into temporary table is compatible with FTWRL.
+let $statement= load data infile '../../std_data/rpl_loaddata.dat' into table t1_temp (@dummy, i);
+let $cleanup_stmt= delete from t1_temp;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 21) LOCK/UNLOCK TABLES statements.
+--echo #
+--echo # LOCK TABLES statement always (almost) blocks FTWRL as it
+--echo # keeps tables open until UNLOCK TABLES.
+--echo # Active FTWRL on the other hand blocks only those
+--echo # LOCK TABLES which allow updating of base tables.
+--echo #
+--echo # 21.a) LOCK TABLES READ is allowed under FTWRL and
+--echo # is not blocked by active FTWRL.
+flush tables with read lock;
+lock tables t1_base read;
+unlock tables;
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+lock tables t1_base read;
+unlock tables;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+
+--echo #
+--echo # 21.b) LOCK TABLES WRITE on a base table is disallowed
+--echo # under FTWRL and should be blocked by active FTWRL.
+flush tables with read lock;
+--error ER_CANT_UPDATE_WITH_READLOCK
+lock tables t1_base write;
+unlock tables;
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+--send lock tables t1_base write
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Check that LOCK TABLES WRITE is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for global read lock" and
+ info = "lock tables t1_base write";
+--source include/wait_condition.inc
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap LOCK TABLES WRITE
+--reap
+unlock tables;
+
+--echo #
+--echo # 21.c) LOCK TABLES WRITE on temporary table doesn't
+--echo # make much sense but is allowed under FTWRL
+--echo # and should not be blocked by active FTWRL.
+flush tables with read lock;
+lock tables t1_temp write;
+unlock tables;
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+lock tables t1_temp write;
+unlock tables;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+
+
+--echo #
+--echo # 22) OPTIMIZE TABLE statement.
+--echo #
+--echo # 22.a) OPTIMIZE TABLE of base table is incompatible with FTWRL.
+flush tables with read lock;
+--echo # OPTIMIZE statement returns errors as part of result-set.
+optimize table t1_base;
+unlock tables;
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+--send optimize table t1_base
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Check that OPTIMIZE TABLE is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for global read lock" and
+ info = "optimize table t1_base";
+--source include/wait_condition.inc
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap OPTIMIZE TABLE
+--reap
+--echo # We don't check that active OPTIMIZE TABLE blocks
+--echo # FTWRL as this one of statements releasing metadata
+--echo # locks in non-standard place.
+
+--echo #
+--echo # 22.b) OPTIMIZE TABLE of temporary table is compatible with FTWRL.
+let $statement= optimize table t1_temp;
+let $cleanup_stmt= ;
+--echo # Skip last part of compatibility testing as this statement
+--echo # releases metadata locks in non-standard place.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_compatible.inc
+let $skip_3rd_check= ;
+
+
+--echo #
+--echo # 23) CACHE statement is compatible with FTWRL.
+--echo #
+let $statement= cache index t1_base in default;
+let $cleanup_stmt= ;
+--echo # Skip last part of compatibility testing as this statement
+--echo # releases metadata locks in non-standard place.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_compatible.inc
+let $skip_3rd_check= ;
+
+
+--echo #
+--echo # 24) LOAD INDEX statement is compatible with FTWRL.
+--echo #
+let $statement= load index into cache t1_base;
+let $cleanup_stmt= ;
+--echo # Skip last part of compatibility testing as this statement
+--echo # releases metadata locks in non-standard place.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_compatible.inc
+let $skip_3rd_check= ;
+
+
+--echo #
+--echo # 25) SAVEPOINT/RELEASE SAVEPOINT/ROLLBACK TO SAVEPOINT are
+--echo # compatible with FTWRL.
+--echo #
+--echo # Since manipulations on savepoint have to be done
+--echo # inside transaction and FTWRL commits transaction we
+--echo # need a special test for these statements.
+flush tables with read lock;
+begin;
+savepoint sv1;
+rollback to savepoint sv1;
+release savepoint sv1;
+unlock tables;
+commit;
+--echo # Check that these statements are not blocked by
+--echo # active FTWRL in another connection.
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+begin;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Do some changes to avoid SAVEPOINT and friends
+--echo # being almost no-ops.
+insert into t3_trans values (1);
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+savepoint sv1;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+insert into t3_trans values (2);
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+rollback to savepoint sv1;
+release savepoint sv1;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+rollback;
+--echo # Check that these statements don't block FTWRL in
+--echo # another connection.
+begin;
+--echo # Do some changes to avoid SAVEPOINT and friends
+--echo # being almost no-ops.
+insert into t3_trans values (1);
+set debug_sync='RESET';
+set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+--send savepoint sv1
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+set debug_sync='now WAIT_FOR parked';
+flush tables with read lock;
+unlock tables;
+set debug_sync='now SIGNAL go';
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap SAVEPOINT
+--reap
+insert into t3_trans values (2);
+set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+--send rollback to savepoint sv1
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+set debug_sync='now WAIT_FOR parked';
+flush tables with read lock;
+unlock tables;
+set debug_sync='now SIGNAL go';
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap ROLLBACK TO SAVEPOINT
+--reap
+set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+--send release savepoint sv1
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+set debug_sync='now WAIT_FOR parked';
+flush tables with read lock;
+unlock tables;
+set debug_sync='now SIGNAL go';
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap RELEASE SAVEPOINT
+--reap
+rollback;
+set debug_sync= "RESET";
+
+
+--echo #
+--echo # 26) RENAME variants.
+--echo #
+--echo # 26.1) RENAME TABLES is incompatible with FTWRL.
+let $statement= rename table t1_base to t3_base;
+let $cleanup_stmt1= rename table t3_base to t1_base;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 26.2) RENAME USER is incompatible with FTWRL.
+create user mysqltest_u1;
+let $statement= rename user mysqltest_u1 to mysqltest_u2;
+let $cleanup_stmt1= rename user mysqltest_u2 to mysqltest_u1;
+--source include/check_ftwrl_incompatible.inc
+drop user mysqltest_u1;
+
+
+--echo #
+--echo # 27) REPAIR TABLE statement.
+--echo #
+--echo # 27.a) REPAIR TABLE of base table is incompatible with FTWRL.
+flush tables with read lock;
+--echo # REPAIR statement returns errors as part of result-set.
+repair table t1_base;
+unlock tables;
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+--send repair table t1_base
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Check that REPAIR TABLE is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for global read lock" and
+ info = "repair table t1_base";
+--source include/wait_condition.inc
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap REPAIR TABLE
+--reap
+--echo # We don't check that active REPAIR TABLE blocks
+--echo # FTWRL as this one of statements releasing metadata
+--echo # locks in non-standard place.
+
+--echo #
+--echo # 27.b) REPAIR TABLE of temporary table is compatible with FTWRL.
+let $statement= repair table t1_temp;
+let $cleanup_stmt= ;
+--echo # Skip last part of compatibility testing as this statement
+--echo # releases metadata locks in non-standard place.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_compatible.inc
+let $skip_3rd_check= ;
+
+
+--echo #
+--echo # 28) REPLACE statement.
+--echo #
+--echo # 28.a) Ordinary REPLACE into base table is incompatible with FTWRL.
+let $statement= replace into t1_base values (1);
+let $cleanup_stmt1= delete from t1_base limit 1;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 28.b) Ordinary REPLACE into temp table is compatible with FTWRL.
+let $statement= replace into t1_temp values (1);
+let $cleanup_stmt= delete from t1_temp limit 1;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 28.c) REPLACE SELECT into base table is incompatible with FTWRL.
+let $statement= replace into t1_base select * from t1_temp;
+let $cleanup_stmt1= ;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 28.d) REPLACE SELECT into temp table is compatible with FTWRL.
+let $statement= replace into t1_temp select * from t1_base;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 29) REVOKE variants.
+--echo #
+--echo # 29.1) REVOKE privileges is incompatible with FTWRL.
+grant all privileges on t1_base to mysqltest_u1;
+let $statement= revoke all privileges on t1_base from mysqltest_u1;
+let $cleanup_stmt1= grant all privileges on t1_base to mysqltest_u1;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 29.2) REVOKE ALL PRIVILEGES, GRANT OPTION is incompatible with FTWRL.
+let $statement= revoke all privileges, grant option from mysqltest_u1;
+let $cleanup_stmt1= grant all privileges on t1_base to mysqltest_u1;
+--source include/check_ftwrl_incompatible.inc
+drop user mysqltest_u1;
+
+
+--echo #
+--echo # 30) Compatibility of SELECT statement with FTWRL depends on
+--echo # locking mode used and on functions being invoked by it.
+--echo #
+--echo # 30.a) Simple SELECT which does not change tables should be
+--echo # compatible with FTWRL.
+let $statement= select count(*) from t1_base;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+--echo # 30.b) SELECT ... FOR UPDATE is incompatible with FTWRL.
+let $statement= select count(*) from t1_base for update;
+let $cleanup_stmt1= ;
+--source include/check_ftwrl_incompatible.inc
+
+--echo # 30.c) SELECT ... LOCK IN SHARE MODE is compatible with FTWRL.
+let $statement= select count(*) from t1_base lock in share mode;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 30.d) SELECT which calls SF updating base table should be
+--echo # incompatible with FTWRL.
+let $statement= select f2_base();
+let $cleanup_stmt1= delete from t1_base limit 1;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 30.e) SELECT which calls SF updating temporary table should be
+--echo # compatible with FTWRL.
+let $statement= select f2_temp();
+let $cleanup_stmt= delete from t1_temp limit 1;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 31) Compatibility of SET statement with FTWRL depends on its
+--echo # expression and on whether it is a special SET statement.
+--echo #
+--echo # 31.a) Ordinary SET with expression which does not
+--echo # changes base table should be compatible with FTWRL.
+let $statement= set @a:= (select count(*) from t1_base);
+let $cleanup_stmt= ;
+--echo # Skip last part of compatibility testing as our helper debug
+--echo # sync-point doesn't work for SET statements.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_compatible.inc
+let $skip_3rd_check= ;
+
+--echo #
+--echo # 31.b) Ordinary SET which calls SF updating base table should
+--echo # be incompatible with FTWRL.
+let $statement= set @a:= f2_base();
+let $cleanup_stmt1= delete from t1_base limit 1;
+--echo # Skip last part of compatibility testing as our helper debug
+--echo # sync-point doesn't work for SET statements.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_incompatible.inc
+let $skip_3rd_check= ;
+
+--echo #
+--echo # 31.c) Ordinary SET which calls SF updating temporary table
+--echo # should be compatible with FTWRL.
+let $statement= set @a:= f2_temp();
+let $cleanup_stmt= delete from t1_temp limit 1;
+--echo # Skip last part of compatibility testing as our helper debug
+--echo # sync-point doesn't work for SET statements.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_compatible.inc
+let $skip_3rd_check= ;
+
+--echo #
+--echo # 31.d) Special SET variants have different compatibility with FTWRL.
+--echo #
+--echo # 31.d.I) SET PASSWORD is incompatible with FTWRL as it changes data.
+create user mysqltest_u1;
+let $statement= set password for 'mysqltest_u1' = password('');
+let $cleanup_stmt1= ;
+--echo # Skip last part of compatibility testing as our helper debug
+--echo # sync-point doesn't work for SET statements.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_incompatible.inc
+let $skip_3rd_check= ;
+drop user mysqltest_u1;
+--echo #
+--echo # 31.d.II) SET READ_ONLY is compatible with FTWRL (but has no
+--echo # effect when executed under it).
+let $statement= set global read_only= 1;
+let $cleanup_stmt= set global read_only= 0;
+--echo # Skip last part of compatibility testing as our helper debug
+--echo # sync-point doesn't work for SET statements.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_compatible.inc
+let $skip_3rd_check= ;
+--echo #
+--echo # 31.d.III) Situation with SET AUTOCOMMIT is complex.
+--echo # Turning auto-commit off is always compatible with FTWRL.
+--echo # Turning auto-commit on causes implicit commit and so
+--echo # is incompatible with FTWRL if there are changes to be
+--echo # committed.
+flush tables with read lock;
+set autocommit= 0;
+--echo # Turning auto-commit on causes implicit commit so can
+--echo # be incompatible with FTWRL if there is something to
+--echo # commit. But since even in this case we allow commits
+--echo # under active FTWRL such statement should always succeed.
+insert into t3_temp_trans values (1);
+set autocommit= 1;
+unlock tables;
+delete from t3_temp_trans;
+--echo # Check that SET AUTOCOMMIT=0 is not blocked and
+--echo # SET AUTOCOMMIT=1 is blocked by active FTWRL in
+--echo # another connection.
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+set autocommit= 0;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Do some work so implicit commit in SET AUTOCOMMIT=1
+--echo # is not a no-op.
+insert into t3_trans values (1);
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Send:
+--send set autocommit= 1
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Wait until SET AUTOCOMMIT=1 is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for commit lock" and
+ info = "set autocommit= 1";
+--source include/wait_condition.inc
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap SET AUTOCOMMIT=1.
+--reap
+delete from t3_trans;
+--echo #
+--echo # Check that SET AUTOCOMMIT=1 blocks FTWRL in another connection.
+set autocommit= 0;
+insert into t3_trans values (1);
+set debug_sync='RESET';
+set debug_sync='ha_commit_trans_after_acquire_commit_lock SIGNAL parked WAIT_FOR go';
+--send set autocommit= 1
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+set debug_sync='now WAIT_FOR parked';
+--send flush tables with read lock
+--echo # Switching to connection '$con_aux2'.
+connection $con_aux2;
+--echo # Wait until FTWRL is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for commit lock" and
+ info = "flush tables with read lock";
+--source include/wait_condition.inc
+set debug_sync='now SIGNAL go';
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap SET AUTOCOMMIT=1.
+--reap
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Reap FTWRL.
+--reap
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+delete from t3_trans;
+set debug_sync= "RESET";
+
+
+--echo #
+--echo # 32) SHOW statements are compatible with FTWRL.
+--echo # Let us test _some_ of them.
+--echo #
+--echo # 32.1) SHOW TABLES.
+let $statement= show tables from test;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 32.1) SHOW TABLES.
+let $statement= show tables from test;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 32.2) SHOW EVENTS.
+let $statement= show events from test;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 32.3) SHOW GRANTS.
+create user mysqltest_u1;
+let $statement= show grants for mysqltest_u1;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+drop user mysqltest_u1;
+
+--echo #
+--echo # 32.4) SHOW CREATE TABLE.
+let $statement= show create table t1_base;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 32.5) SHOW CREATE FUNCTION.
+let $statement= show create function f1;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 33) SIGNAL statement is compatible with FTWRL.
+--echo #
+--echo # Note that we don't cover RESIGNAL as it requires
+--echo # active handler context.
+let $statement= signal sqlstate '01000';
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 34) TRUNCATE TABLE statement.
+--echo #
+--echo # 34.a) TRUNCATE of base table is incompatible with FTWRL.
+let $statement= truncate table t1_base;
+let $cleanup_stmt1= ;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 34.b) TRUNCATE of temporary table is compatible with FTWRL.
+let $statement= truncate table t1_temp;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 35) UPDATE variants.
+--echo #
+--echo # 35.1) Simple UPDATE.
+--echo #
+--echo # 35.1.a) Simple UPDATE on base table is incompatible with FTWRL.
+let $statement= update t1_base set i= 1 where i = 0;
+let $cleanup_stmt1= ;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 35.1.b) Simple UPDATE on temporary table is compatible with FTWRL.
+let $statement= update t1_temp set i= 1 where i = 0;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 35.2) Multi UPDATE.
+--echo #
+--echo # 35.2.a) Multi UPDATE on base tables is incompatible with FTWRL.
+let $statement= update t1_base, t2_base set t1_base.i= 1 where t1_base.i = t2_base.j;
+let $cleanup_stmt1= ;
+--source include/check_ftwrl_incompatible.inc
+
+--echo #
+--echo # 35.2.b) Multi UPDATE on temporary tables is compatible with FTWRL.
+let $statement= update t1_temp, t2_temp set t1_temp.i= 1 where t1_temp.i = t2_temp.j;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 36) USE statement is compatible with FTWRL.
+--echo #
+let $statement= use mysqltest1;
+let $cleanup_stmt= use test;
+--source include/check_ftwrl_compatible.inc
+
+
+--echo #
+--echo # 37) XA statements.
+--echo #
+--echo # XA statements are similar to BEGIN/COMMIT/ROLLBACK.
+--echo #
+--echo # XA BEGIN, END, PREPARE, ROLLBACK and RECOVER are compatible
+--echo # with FTWRL. XA COMMIT is not.
+flush tables with read lock;
+--echo # Although all below statements are allowed under FTWRL they
+--echo # are almost no-ops as FTWRL does commit and does not allows
+--echo # any non-temporary DML under it.
+xa start 'test1';
+xa end 'test1';
+xa prepare 'test1';
+xa rollback 'test1';
+xa start 'test1';
+xa end 'test1';
+xa prepare 'test1';
+xa commit 'test1';
+--disable_result_log
+xa recover;
+--enable_result_log
+unlock tables;
+--echo # Check that XA non-COMMIT statements are not and COMMIT is
+--echo # blocked by active FTWRL in another connection
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+xa start 'test1';
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+insert into t3_trans values (1);
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+xa end 'test1';
+xa prepare 'test1';
+xa rollback 'test1';
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+xa start 'test1';
+insert into t3_trans values (1);
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+connection default;
+xa end 'test1';
+xa prepare 'test1';
+--echo # Send:
+--send xa commit 'test1';
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Wait until XA COMMIT is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for commit lock" and
+ info = "xa commit 'test1'";
+--source include/wait_condition.inc
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap XA COMMIT.
+--reap
+delete from t3_trans;
+--echo #
+--echo # Check that XA COMMIT blocks FTWRL in another connection.
+xa start 'test1';
+insert into t3_trans values (1);
+xa end 'test1';
+xa prepare 'test1';
+set debug_sync='RESET';
+set debug_sync='trans_xa_commit_after_acquire_commit_lock SIGNAL parked WAIT_FOR go';
+--send xa commit 'test1'
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+set debug_sync='now WAIT_FOR parked';
+--send flush tables with read lock
+--echo # Switching to connection '$con_aux2'.
+connection $con_aux2;
+--echo # Wait until FTWRL is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for commit lock" and
+ info = "flush tables with read lock";
+--source include/wait_condition.inc
+set debug_sync='now SIGNAL go';
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap XA COMMIT.
+--reap
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Reap FTWRL.
+--reap
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+delete from t3_trans;
+set debug_sync= "RESET";
+
+
+--echo #
+--echo # 38) Test effect of auto-commit mode for DML on transactional
+--echo # temporary tables.
+--echo #
+--echo # 38.1) When auto-commit is on each such a statement ends with commit
+--echo # of changes to temporary tables. But since transactions doing
+--echo # such changes are considered read only [sic!/QQ] this commit
+--echo # is compatible with FTWRL.
+--echo #
+--echo # Let us demostrate this fact for some common DML statements.
+let $statement= delete from t3_temp_trans;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+let $statement= insert into t3_temp_trans values (1);
+let $cleanup_stmt= delete from t3_temp_trans limit 1;
+--source include/check_ftwrl_compatible.inc
+
+let $statement= update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+--echo #
+--echo # 38.2) When auto-commit is off DML on transaction temporary tables
+--echo # is compatible with FTWRL.
+--echo #
+set autocommit= 0;
+let $statement= delete from t3_temp_trans;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+
+let $statement= insert into t3_temp_trans values (1);
+let $cleanup_stmt= delete from t3_temp_trans limit 1;
+--source include/check_ftwrl_compatible.inc
+
+let $statement= update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+set autocommit= 1;
+
+
+--echo #
+--echo # 39) Test effect of DDL on transactional tables.
+--echo #
+--echo # 39.1) Due to implicit commit at the end of statement some of DDL
+--echo # statements which are compatible with FTWRL in non-transactional
+--echo # case are not compatible in case of transactional tables.
+--echo #
+--echo # 39.1.a) ANALYZE TABLE for transactional table is incompatible with
+--echo # FTWRL.
+flush tables with read lock;
+--echo # Implicit commits are allowed under FTWRL.
+analyze table t3_trans;
+unlock tables;
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+--send analyze table t3_trans
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Check that ANALYZE TABLE is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for commit lock" and
+ info = "analyze table t3_trans";
+--source include/wait_condition.inc
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap ANALYZE TABLE
+--reap
+
+--echo #
+--echo # 39.1.b) CHECK TABLE for transactional table is compatible with FTWRL.
+--echo # Although it does implicit commit at the end of statement it
+--echo # is considered to be read-only operation.
+let $statement= check table t3_trans;
+let $cleanup_stmt= ;
+--echo # Skip last part of compatibility testing as this statement
+--echo # releases metadata locks in non-standard place.
+let $skip_3rd_check= 1;
+--source include/check_ftwrl_compatible.inc
+let $skip_3rd_check= ;
+
+--echo #
+--echo # 39.2) Situation with DDL on temporary transactional tables is
+--echo # complex.
+--echo #
+--echo # 39.2.a) Some statements compatible with FTWRL since they don't
+--echo # do implicit commit.
+--echo #
+--echo # For example, CREATE TEMPORARY TABLE:
+let $statement= create temporary table t4_temp_trans(i int) engine=innodb;
+let $cleanup_stmt= drop temporary tables t4_temp_trans;
+--source include/check_ftwrl_compatible.inc
+--echo #
+--echo # Or DROP TEMPORARY TABLE:
+let $statement= drop temporary tables t3_temp_trans;
+let $cleanup_stmt= create temporary table t3_temp_trans(i int) engine=innodb;
+--source include/check_ftwrl_compatible.inc
+--echo #
+--echo # 39.2.b) Some statements do implicit commit but are considered
+--echo # read-only and so are compatible with FTWRL.
+--echo #
+--echo # For example, REPAIR TABLE:
+let $statement= repair table t3_temp_trans;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+--echo #
+--echo # And ANALYZE TABLE:
+let $statement= analyze table t3_temp_trans;
+let $cleanup_stmt= ;
+--source include/check_ftwrl_compatible.inc
+--echo #
+--echo # 39.2.c) Some statements do implicit commit and not
+--echo # considered read-only. As result they are
+--echo # not compatible with FTWRL.
+--echo #
+flush tables with read lock;
+--echo # Implicit commits are allowed under FTWRL.
+alter table t3_temp_trans add column c1 int;
+unlock tables;
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+--send alter table t3_temp_trans drop column c1
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Check that ALTER TABLE is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for commit lock" and
+ info = "alter table t3_temp_trans drop column c1";
+--source include/wait_condition.inc
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap ALTER TABLE
+--reap
+
+
+--echo #
+--echo # 40) Test effect of implicit commit for DDL which is otherwise
+--echo # compatible with FTWRL. Implicit commit at the start of DDL
+--echo # statement can make it incompatible with FTWRL if there are
+--echo # some changes to be commited even in case when DDL statement
+--echo # itself is compatible with FTWRL.
+--echo #
+--echo # For example CHECK TABLE for base non-transactional tables and
+--echo # ALTER TABLE for temporary non-transactional tables are affected.
+begin;
+insert into t3_trans values (1);
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+--send check table t1_base
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Check that CHECK TABLE is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for commit lock" and
+ info = "check table t1_base";
+--source include/wait_condition.inc
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap CHECK TABLE
+--reap
+begin;
+delete from t3_trans;
+--echo #
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+--send alter table t1_temp add column c1 int
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Check that ALTER TABLE is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for commit lock" and
+ info = "alter table t1_temp add column c1 int";
+--source include/wait_condition.inc
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap ALTER TABLE
+--reap
+alter table t1_temp drop column c1;
+
+
+--echo #
+--echo # Check that FLUSH TABLES WITH READ LOCK is blocked by individual
+--echo # statements and is not blocked in the presence of transaction which
+--echo # has done some changes earlier but is idle now (or does only reads).
+--echo # This allows to use this statement even on systems which has long
+--echo # running transactions.
+--echo #
+begin;
+insert into t1_base values (1);
+insert into t3_trans values (1);
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # The below FTWRL should not be blocked by transaction in 'default'.
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Transaction still is able to read even with FTWRL active in another
+--echo # connection.
+select * from t1_base;
+select * from t2_base;
+select * from t3_trans;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+commit;
+delete from t1_base;
+delete from t3_trans;
+
+
+--echo #
+--echo # Check that impending FTWRL blocks new DML statements and
+--echo # so can't be starved by a constant flow of DML.
+--echo # (a.k.a. test for bug #54673 "It takes too long to get
+--echo # readlock for 'FLUSH TABLES WITH READ LOCK'").
+--echo #
+set debug_sync='RESET';
+set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
+--send insert into t1_base values (1)
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+set debug_sync='now WAIT_FOR parked';
+--send flush tables with read lock
+--echo # Switching to connection '$con_aux2'.
+connection $con_aux2;
+--echo # Wait until FTWRL is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for global read lock" and
+ info = "flush tables with read lock";
+--source include/wait_condition.inc
+--echo # Try to run another INSERT and see that it is blocked.
+--send insert into t2_base values (1);
+--echo # Switching to connection 'con3'.
+connection con3;
+--echo # Wait until new INSERT is blocked.
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for global read lock" and
+ info = "insert into t2_base values (1)";
+--echo # Unblock INSERT in the first connection.
+set debug_sync='now SIGNAL go';
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Reap first INSERT.
+--reap
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # Reap FTWRL.
+--reap
+unlock tables;
+--echo # Switching to connection '$con_aux2'.
+connection $con_aux2;
+--echo # Reap second INSERT.
+--reap
+--echo # Switching to connection 'default'.
+connection default;
+set debug_sync= "RESET";
+delete from t1_base;
+delete from t2_base;
+
+--echo
+--echo # Check that COMMIT thas is issued after
+--echo # FLUSH TABLES WITH READ LOCK is not blocked by
+--echo # FLUSH TABLES WITH READ LOCK from another connection.
+--echo # This scenario is used in innobackup.pl. The COMMIT goes
+--echo # through because the transaction started by FTWRL does
+--echo # not modify any tables, and the commit blocker lock is
+--echo # only taken when there were such modifications.
+--echo
+flush tables with read lock;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+--echo # The below FTWRL should not be blocked by transaction in 'default'.
+flush tables with read lock;
+--echo # Switching to connection 'default'.
+connection default;
+select * from t1_base;
+select * from t3_trans;
+commit;
+--echo # Switching to connection '$con_aux1'.
+connection $con_aux1;
+select * from t1_base;
+select * from t3_trans;
+commit;
+unlock tables;
+--echo # Switching to connection 'default'.
+connection default;
+unlock tables;
+
+
+--echo #
+--echo # Check how FLUSH TABLE WITH READ LOCK is handled for MERGE tables.
+--echo # As usual there are tricky cases related to this type of tables.
+--echo #
+--echo #
+--echo # 1) Most typical case - base MERGE table with base underlying tables.
+--echo #
+--echo # 1.a) DML statements which change data should be incompatible with FTWRL.
+create table tm_base (i int) engine=merge union=(t1_base) insert_method=last;
+let $statement= insert into tm_base values (1);
+let $cleanup_stmt1= delete from tm_base;
+--source include/check_ftwrl_incompatible.inc
+--echo #
+--echo # 1.b) DDL statement on such table should be incompatible with FTWRL as well.
+let $statement= alter table tm_base insert_method=first;
+let $cleanup_stmt1= alter table tm_base insert_method=last;
+--source include/check_ftwrl_incompatible.inc
+drop table tm_base;
+
+--echo #
+--echo # 2) Temporary MERGE table with base underlying tables.
+--echo #
+--echo # 2.a) DML statements which change data should be incompatible with FTWRL
+--echo # as they affect base tables.
+create temporary table tm_temp_base (i int) engine=merge union=(t1_base) insert_method=last;
+let $statement= insert into tm_temp_base values (1);
+let $cleanup_stmt1= delete from tm_temp_base;
+--source include/check_ftwrl_incompatible.inc
+--echo #
+--echo # 2.b) Some of DDL statements on such table can be compatible with FTWRL
+--echo # as they don't affect base tables.
+let $statement= drop temporary tables tm_temp_base;
+let $cleanup_stmt= create temporary table tm_temp_base (i int) engine=merge union=(t1_base) insert_method=last;
+--source include/check_ftwrl_compatible.inc
+--echo #
+--echo # 2.c) ALTER statement is incompatible with FTWRL. Even though it does
+--echo # not change data in base table it still acquires strong metadata
+--echo # locks on them.
+let $statement= alter table tm_temp_base insert_method=first;
+let $cleanup_stmt1= alter table tm_temp_base insert_method=last;
+--source include/check_ftwrl_incompatible.inc
+drop table tm_temp_base;
+
+--echo #
+--echo # 3) Temporary MERGE table with temporary underlying tables.
+--echo #
+--echo # 3.a) DML statements should be compatible with FTWRL as
+--echo # no base table is going to be affected.
+create temporary table tm_temp_temp (i int) engine=merge union=(t1_temp) insert_method=last;
+let $statement= insert into tm_temp_temp values (1);
+let $cleanup_stmt= delete from tm_temp_temp;
+--source include/check_ftwrl_compatible.inc
+--echo #
+--echo # 3.b) DDL statements should be compatible with FTWRL as well
+--echo # as no base table is going to be affected too.
+let $statement= alter table tm_temp_temp union=(t1_temp) insert_method=first;
+let $cleanup_stmt= alter table tm_temp_temp union=(t1_temp) insert_method=last;
+--source include/check_ftwrl_compatible.inc
+drop table tm_temp_temp;
+
+--echo #
+--echo # 4) For the sake of completeness let us check that base MERGE tables
+--echo # with temporary underlying tables are not functional.
+create table tm_base_temp (i int) engine=merge union=(t1_temp) insert_method=last;
+--error ER_WRONG_MRG_TABLE
+select * from tm_base_temp;
+drop table tm_base_temp;
+
+
+--echo #
+--echo # Clean-up.
+--echo #
+drop event e1;
+drop function f2_temp;
+drop function f2_base;
+drop procedure p2;
+drop view v1;
+drop function f1;
+drop procedure p1;
+drop database `#mysql50#mysqltest-2`;
+drop database mysqltest1;
+drop temporary tables t1_temp, t2_temp;
+drop tables t1_base, t2_base, t3_trans;
+disconnect con1;
+disconnect con2;
+disconnect con3;
+
+# Check that all connections opened by test cases in this file are really
+# gone so execution of other tests won't be affected by their presence.
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/flush_read_lock_kill-master.opt b/mysql-test/t/flush_read_lock_kill-master.opt
deleted file mode 100644
index 61e2b242351..00000000000
--- a/mysql-test/t/flush_read_lock_kill-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-debug=+d,make_global_read_lock_block_commit_loop
diff --git a/mysql-test/t/flush_read_lock_kill.test b/mysql-test/t/flush_read_lock_kill.test
index 2d359383949..a672fa5dfc5 100644
--- a/mysql-test/t/flush_read_lock_kill.test
+++ b/mysql-test/t/flush_read_lock_kill.test
@@ -2,24 +2,19 @@
# for running commits to finish (in the past it could not)
# This will not be a meaningful test on non-debug servers so will be
# skipped.
-# If running mysql-test-run --debug, the --debug added by
-# mysql-test-run to the mysqld command line will override the one of
-# -master.opt. But this test is designed to still pass then (though it
-# won't test anything interesting).
# This also won't work with the embedded server test
--source include/not_embedded.inc
--source include/have_debug.inc
+# This test needs transactional engine as otherwise COMMIT
+# won't block FLUSH TABLES WITH GLOBAL READ LOCK.
+--source include/have_innodb.inc
+
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
-# Disable concurrent inserts to avoid test failures when reading the
-# connection id which was inserted into a table by another thread.
-SET @old_concurrent_insert= @@global.concurrent_insert;
-SET @@global.concurrent_insert= 0;
-
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connection con1;
@@ -27,47 +22,64 @@ connection con1;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
-CREATE TABLE t1 (kill_id INT);
+SET DEBUG_SYNC= 'RESET';
+CREATE TABLE t1 (kill_id INT) engine = InnoDB;
+INSERT INTO t1 VALUES(connection_id());
+
+--echo # Switching to connection 'default'.
+connection default;
+--echo # Start transaction.
+BEGIN;
INSERT INTO t1 VALUES(connection_id());
+--echo # Ensure that COMMIT will pause once it acquires protection
+--echo # against its global read lock.
+SET DEBUG_SYNC='ha_commit_trans_after_acquire_commit_lock SIGNAL acquired WAIT_FOR go';
-# Thanks to the parameter we passed to --debug, this FLUSH will
-# block on a debug build running with our --debug=make_global... It
-# will block until killed. In other cases (non-debug build or other
-# --debug) it will succeed immediately
+--echo # Sending:
+--send COMMIT
+--echo # Switching to 'con1'.
connection con1;
+--echo # Wait till COMMIT acquires protection against global read
+--echo # lock and pauses.
+SET DEBUG_SYNC='now WAIT_FOR acquired';
+--echo # Sending:
send FLUSH TABLES WITH READ LOCK;
-# kill con1
+--echo # Switching to 'con2'.
connection con2;
-SELECT ((@id := kill_id) - kill_id) FROM t1;
+SELECT ((@id := kill_id) - kill_id) FROM t1 LIMIT 1;
-# Wait for the debug sync point, test won't run on non-debug
-# builds anyway.
+--echo # Wait till FLUSH TABLES WITH READ LOCK blocks due
+--echo # to active COMMIT
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for all running commits to finish"
+ where state = "Waiting for commit lock"
and info = "flush tables with read lock";
--source include/wait_condition.inc
+--echo # Kill connection 'con1'.
KILL CONNECTION @id;
+--echo # Switching to 'con1'.
connection con1;
-# On debug builds it will be error 1053 (killed); on non-debug, or
-# debug build running without our --debug=make_global..., will be
-# error 0 (no error). The only important thing to test is that on
-# debug builds with our --debug=make_global... we don't hang forever.
---error 0,1317,2013
+--echo # Try to reap FLUSH TABLES WITH READ LOCK,
+--echo # it fail due to killed statement and connection.
+--error 1317,2013
reap;
+--echo # Switching to 'con2'.
connection con2;
-DROP TABLE t1;
+--echo # Resume COMMIT.
+SET DEBUG_SYNC='now SIGNAL go';
+--echo # Switching to 'default'.
connection default;
+--echo # Reaping COMMIT.
+--reap
disconnect con2;
-
-# Restore global concurrent_insert value
-SET @@global.concurrent_insert= @old_concurrent_insert;
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index f62b715d955..e49970047a2 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -606,4 +606,41 @@ REPAIR TABLE t1;
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
DROP TABLE t1;
+--echo #
+--echo # Bug#54484 explain + prepared statement: crash and Got error -1 from storage engine
+--echo #
+
+CREATE TABLE t1(f1 VARCHAR(6) NOT NULL, FULLTEXT KEY(f1), UNIQUE(f1));
+INSERT INTO t1 VALUES ('test');
+--disable_warnings
+SELECT 1 FROM t1 WHERE 1 >
+ ALL((SELECT 1 FROM t1 JOIN t1 a
+ ON (MATCH(t1.f1) against (""))
+ WHERE t1.f1 GROUP BY t1.f1)) xor f1;
+
+PREPARE stmt FROM
+'SELECT 1 FROM t1 WHERE 1 >
+ ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a
+ ON (MATCH(t1.f1) against (""))
+ WHERE t1.f1 GROUP BY t1.f1)) xor f1';
+
+EXECUTE stmt;
+EXECUTE stmt;
+
+DEALLOCATE PREPARE stmt;
+
+PREPARE stmt FROM
+'SELECT 1 FROM t1 WHERE 1 >
+ ALL((SELECT 1 FROM t1 JOIN t1 a
+ ON (MATCH(t1.f1) against (""))
+ WHERE t1.f1 GROUP BY t1.f1))';
+
+EXECUTE stmt;
+EXECUTE stmt;
+
+DEALLOCATE PREPARE stmt;
+--enable_warnings
+
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/func_analyse.test b/mysql-test/t/func_analyse.test
index 05f739bfd69..c77967a0cc9 100644
--- a/mysql-test/t/func_analyse.test
+++ b/mysql-test/t/func_analyse.test
@@ -1,6 +1,7 @@
#
# Test of procedure analyse
#
+-- source include/have_innodb.inc
--disable_warnings
drop table if exists t1,t2;
@@ -133,3 +134,26 @@ DROP TABLE t1;
--echo End of 5.0 tests
+
+--echo #
+--echo # Bug#11765202: Dbug_violation_helper::~Dbug_violation_helper(): Assertion `!_entered' failed.
+--echo #
+
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a VARCHAR(2) CHARSET UTF8 NOT NULL);
+INSERT INTO t1 VALUES ('e'),('e'),('e-');
+SELECT * FROM t1 PROCEDURE ANALYSE();
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#11756242 48137: PROCEDURE ANALYSE() LEAKS MEMORY WHEN RETURNING NULL
+--echo #
+
+CREATE TABLE t1(f1 INT) ENGINE=MYISAM;
+CREATE TABLE t2(f2 INT) ENGINE=INNODB;
+INSERT INTO t2 VALUES (1);
+SELECT DISTINCTROW f1 FROM t1 NATURAL RIGHT OUTER JOIN t2 PROCEDURE ANALYSE();
+SELECT * FROM t2 LIMIT 1 PROCEDURE ANALYSE();
+DROP TABLE t1, t2;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/func_encrypt_ucs2.test b/mysql-test/t/func_encrypt_ucs2.test
new file mode 100644
index 00000000000..8b4cd44d354
--- /dev/null
+++ b/mysql-test/t/func_encrypt_ucs2.test
@@ -0,0 +1,12 @@
+-- source include/have_ssl_crypto_functs.inc
+-- source include/have_ucs2.inc
+
+--echo #
+--echo # Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed.
+--echo #
+
+SELECT CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2)));
+SELECT CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED);
+
+SELECT CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2)));
+SELECT CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED);
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 36a8542f9eb..e4a1206fa9c 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -738,9 +738,30 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+--echo #
+--echo # Bug#57194 group_concat cause crash and/or invalid memory reads with type errors
+--echo #
---echo End of 5.1 tests
+CREATE TABLE t1(f1 int);
+INSERT INTO t1 values (0),(0);
+--disable_ps_protocol
+--error ER_ILLEGAL_VALUE_FOR_TYPE
+SELECT POLYGON((SELECT 1 FROM (SELECT 1 IN (GROUP_CONCAT(t1.f1)) FROM t1, t1 t GROUP BY t.f1 ) d));
+--enable_ps_protocol
+DROP TABLE t1;
+--echo #
+--echo # Bug#58396 group_concat and explain extended are still crashy
+--echo #
+
+CREATE TABLE t1(a INT);
+--error ER_UNKNOWN_ERROR
+EXPLAIN EXTENDED SELECT UPDATEXML('1', a, '1')
+FROM t1 ORDER BY (SELECT GROUP_CONCAT(1) FROM t1);
+SHOW WARNINGS;
+DROP TABLE t1;
+
+--echo End of 5.1 tests
#
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 6d128be7f34..e8309d68830 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -1097,8 +1097,62 @@ SELECT MAX((SELECT 1 FROM t1 ORDER BY @var LIMIT 1)) m FROM t1 t2, t1
DROP TABLE t1;
--echo #
+--echo # Bug#58030 crash in Item_func_geometry_from_text::val_str
+--echo #
+
+--disable_result_log
+
+SELECT MAX(TIMESTAMP(RAND(0)));
+SELECT MIN(TIMESTAMP(RAND(0)));
+
+--echo #
+--echo # Bug#58177 crash and valgrind warnings in decimal and protocol sending functions...
+--echo #
+
+SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND()));
+SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND()));
+SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND()));
+SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND()));
+SELECT RELEASE_LOCK('aaaaaaaaaaaaaaaaa');
+
+--enable_result_log
+
+
+--echo #
+--echo # Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS
+--echo #
+
+CREATE TABLE t1 (a BIGINT UNSIGNED);
+INSERT INTO t1 VALUES (18446668621106209655);
+SELECT MAX(LENGTH(a)), LENGTH(MAX(a)), MIN(a), MAX(a), CONCAT(MIN(a)), CONCAT(MAX(a)) FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # Bug #11766270 59343: YEAR(4): INCORRECT RESULT AND VALGRIND WARNINGS WITH MIN/MAX, UNION
+--echo #
+
+CREATE TABLE t1(f1 YEAR(4));
+INSERT INTO t1 VALUES (0000),(2001);
+--enable_metadata
+(SELECT MAX(f1) FROM t1) UNION (SELECT MAX(f1) FROM t1);
+--disable_metadata
+DROP TABLE t1;
+
+
+--echo #
--echo End of 5.1 tests
+###
+--echo #
+--echo # Bug#52123 Assertion failed: aggregator == aggr->Aggrtype(),
+--echo # file .\item_sum.cc, line 587
+--echo #
+
+CREATE TABLE t1(a int, KEY(a));
+INSERT INTO t1 VALUES (1), (2);
+SELECT 1 FROM t1 ORDER BY AVG(DISTINCT a);
+DROP TABLE t1;
+
--echo #
--echo # Bug#55648: Server crash on MIN/MAX on maximum time value
--echo #
@@ -1118,3 +1172,14 @@ SELECT MAX(c1),MIN(c1) FROM t1;
DROP TABLE t1;
--echo # End of the bug#56120
+--echo #
+--echo # Bug#57932 "query with AVG(DISTINCT) returns NULL if last
+--echo # aggregated value was NULL"
+--echo #
+CREATE TABLE t1 (col_int_nokey int(11));
+INSERT INTO t1 VALUES (7),(8),(NULL);
+SELECT AVG(DISTINCT col_int_nokey) FROM t1;
+SELECT AVG(DISTINCT outr.col_int_nokey) FROM t1 AS outr LEFT JOIN t1 AS outr2 ON
+outr.col_int_nokey = outr2.col_int_nokey;
+DROP TABLE t1;
+--echo # End of the bug#57932
diff --git a/mysql-test/t/func_group_innodb.test b/mysql-test/t/func_group_innodb.test
index 1bdfd8f54bb..bbc576b0fc7 100644
--- a/mysql-test/t/func_group_innodb.test
+++ b/mysql-test/t/func_group_innodb.test
@@ -83,3 +83,53 @@ explain select count(*), min(7), max(7) from t2m, t1i;
select count(*), min(7), max(7) from t2m, t1i;
drop table t1m, t1i, t2m, t2i;
+
+
+--echo #
+--echo # Bug #57954: BIT_AND function returns incorrect results when
+--echo # semijoin=on
+
+CREATE TABLE c (
+ pk INT,
+ col_varchar_key VARCHAR(1),
+ PRIMARY KEY (pk),
+ KEY col_varchar_key (col_varchar_key)
+) ENGINE=InnoDB;
+INSERT INTO c VALUES (11,NULL);
+INSERT INTO c VALUES (16,'c');
+CREATE TABLE bb (
+ pk INT,
+ col_varchar_key VARCHAR(1),
+ PRIMARY KEY (pk),
+ KEY col_varchar_key (col_varchar_key)
+) ENGINE=InnoDB;
+INSERT INTO bb VALUES (10,NULL);
+
+SELECT straight_join BIT_AND(c.pk)
+FROM
+ bb, c
+ WHERE c.col_varchar_key='ABC'
+ORDER BY c.pk;
+
+DROP TABLE c,bb;
+
+--echo #
+--echo # Bug #58050: BIT_OR and BIT_XOR return incorrect results when
+--echo # semijoin=on
+--echo #
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, b INT, c INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, 1, 1);
+
+CREATE TABLE t2 (pk INT PRIMARY KEY, b INT, c INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1, 1, NULL);
+
+SELECT t1.* FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+SELECT BIT_OR(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+SELECT BIT_AND(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+SELECT BIT_XOR(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+
+DROP TABLE t1, t2;
+
+
+--echo End of 5.5 tests
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index 6efeb2866e6..08469b37967 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -555,5 +555,11 @@ SELECT CASE a WHEN a THEN a END FROM t1 GROUP BY a WITH ROLLUP;
DROP TABLE t1;
--echo #
+--echo # Bug #11766212 59270: NOT IN (YEAR( ... ), ... ) PRODUCES MANY VALGRIND WARNINGS
+--echo #
+
+SELECT 1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1);
+
+--echo #
--echo End of 5.1 tests
diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test
index 1204d04d9a0..f1fe52274b2 100644
--- a/mysql-test/t/func_like.test
+++ b/mysql-test/t/func_like.test
@@ -126,5 +126,10 @@ INSERT INTO t2 VALUES (1), (2), (3);
SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a;
DROP TABLE t1, t2;
+--echo #
+--echo # Bug#59149 valgrind warnings with "like .. escape .." function
+--echo #
+--error ER_WRONG_ARGUMENTS
+SELECT '' LIKE '1' ESCAPE COUNT(1);
--echo End of 5.1 tests
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index 44af2f5ad3f..0d59f98a313 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -316,6 +316,14 @@ SELECT RAND(i) FROM t1;
DROP TABLE t1;
--echo #
+--echo # Bug#57477 SIGFPE when dividing a huge number a negative number
+--echo #
+--error ER_DATA_OUT_OF_RANGE
+SELECT -9999999999999999991 DIV -1;
+--error ER_DATA_OUT_OF_RANGE
+SELECT -9223372036854775808 DIV -1;
+SELECT -9223372036854775808 MOD -1;
+SELECT -9223372036854775808999 MOD -1;
#
# Bug #8457: Precision math:
@@ -328,6 +336,46 @@ select 123456789012345678901234567890.123456789012345678901234567890 div 1 as x;
select "123456789012345678901234567890.123456789012345678901234567890" div 1 as x;
SHOW WARNINGS;
+--echo #
+--echo # Bug#57810 case/when/then : Assertion failed: length || !scale
+--echo #
+
+SELECT CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END;
+CREATE TABLE t1 SELECT CAST((CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END) AS CHAR) as C;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION > 0 && SCALE <= PR
+--echo #
+
+CREATE TABLE t1 SELECT CEIL(LINESTRINGFROMWKB(1) DIV NULL);
+DROP TABLE t1;
+CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL);
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#11765923 58937: MANY VALGRIND ERRORS AFTER GROUPING BY RESULT OF DECIMAL COLUMN FUNCTION
+--echo #
+
+CREATE TABLE t1(f1 DECIMAL(22,1));
+INSERT INTO t1 VALUES (0),(1);
+SELECT ROUND(f1, f1) FROM t1;
+SELECT ROUND(f1, f1) FROM t1 GROUP BY 1;
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#11764671 57533: UNINITIALISED VALUES IN COPY_AND_CONVERT (SQL_STRING.CC) WITH CERTAIN CHA
+--echo #
+
+SELECT ROUND(LEAST(15, -4939092, 0.2704), STDDEV('a'));
+
+--echo #
+--echo # Bug#12392636 ASSERTION FAILED: SCALE >= 0 && PRECISION > 0 && SCALE <= PRECISION
+--echo #
+
+SELECT SUM(DISTINCT (TRUNCATE((.1), NULL)));
+
--echo End of 5.1 tests
--echo #
@@ -458,3 +506,33 @@ SELECT 2 DIV -2;
SELECT -(1 DIV 0);
# Crashed the server with SIGFPE before the bugfix
SELECT -9223372036854775808 MOD -1;
+
+--echo #
+--echo # Bug #57209 valgrind + Assertion failed: dst > buf
+--echo #
+SELECT floor(log10(format(concat_ws(5445796E25, 5306463, 30837), -358821)))
+as foo;
+
+--echo #
+--echo # Bug #58137 char(0) column cause:
+--echo # my_gcvt: Assertion `width > 0 && to != ((void *)0)' failed
+--echo #
+CREATE TABLE t1(a char(0));
+INSERT INTO t1 (SELECT -pi());
+DROP TABLE t1;
+
+--echo #
+--echo # Bug #59241 invalid memory read
+--echo # in do_div_mod with doubly assigned variables
+--echo #
+SELECT ((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa')));
+
+--echo #
+--echo # Bug #59498 div function broken in mysql-trunk
+--echo #
+SELECT 1 div null;
+
+--echo #
+--echo # Bug #11792200 - DIVIDING LARGE NUMBERS CAUSES STACK CORRUPTIONS
+--echo #
+select (1.175494351E-37 div 1.7976931348623157E+308);
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index d5941661d45..1f221ce9878 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -292,6 +292,13 @@ SELECT DISTINCT GREATEST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1;
DROP TABLE t1;
+#
+# Bug #57283: inet_ntoa() crashes
+#
+SELECT INET_NTOA(0);
+SELECT '1' IN ('1', INET_NTOA(0));
+
+
--echo #
--echo # Bug #52165: Assertion failed: file .\dtoa.c, line 465
--echo #
@@ -304,4 +311,48 @@ SELECT COALESCE(a) = COALESCE(b) FROM t1;
DROP TABLE t1;
---echo End of tests
+--echo #
+--echo # Bug #54461: crash with longblob and union or update with subquery
+--echo #
+
+CREATE TABLE t1 (a INT, b LONGBLOB);
+INSERT INTO t1 VALUES (1, '2'), (2, '3'), (3, '2');
+
+SELECT DISTINCT LEAST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1;
+SELECT DISTINCT GREATEST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1;
+
+DROP TABLE t1;
+
+
+#
+# Bug #57283: inet_ntoa() crashes
+#
+SELECT INET_NTOA(0);
+SELECT '1' IN ('1', INET_NTOA(0));
+
+
+--echo #
+--echo # End of 5.1 tests
+--echo #
+
+
+--echo #
+--echo # Bug #58199: name_const in the having clause crashes
+--echo #
+
+CREATE TABLE t1 (a INT);
+
+# NAME_CONST() would seg.fault when used wrongly in a HAVING clause
+--error ER_WRONG_ARGUMENTS
+SELECT 1 from t1 HAVING NAME_CONST('', a);
+
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
+
+--echo #
+--echo # End of tests
+--echo #
diff --git a/mysql-test/t/func_set.test b/mysql-test/t/func_set.test
index 294efa8caf1..3531864c860 100644
--- a/mysql-test/t/func_set.test
+++ b/mysql-test/t/func_set.test
@@ -97,3 +97,25 @@ SELECT CONVERT( a USING latin1 ) FROM t1;
SELECT CONVERT( a USING latin1 ) FROM t2;
DROP TABLE t1, t2;
+
+--echo #
+--echo # BUG#59405: FIND_IN_SET won't work normaly after upgrade from 5.1 to 5.5
+--echo #
+
+CREATE TABLE t1(days set('1','2','3','4','5','6','7'));
+INSERT INTO t1 VALUES('1,2,3,4,5,6,7'), (NULL), ('1,2,3,4,5,6,7');
+
+--echo
+SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days);
+SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days) IS UNKNOWN;
+SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL);
+SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL) IS UNKNOWN;
+SELECT * FROM t1 WHERE FIND_IN_SET(7, days);
+SELECT * FROM t1 WHERE FIND_IN_SET(8, days);
+SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days);
+SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days) IS UNKNOWN;
+SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL);
+SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL) IS UNKNOWN;
+
+--echo
+DROP TABLE t1;
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 7b7bffd0bbc..9a9a8110a74 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1363,6 +1363,24 @@ SELECT 1 FROM t1, t1 t2
ORDER BY QUOTE(t1.a);
DROP TABLE t1;
+--echo #
+--echo # Bug#57913 large negative number to string conversion functions crash
+--echo # Bug#57810 case/when/then : Assertion failed: length || !scale
+--echo #
+SELECT '1' IN ('1', SUBSTRING(-9223372036854775809, 1));
+SELECT CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3));
+
+--echo #
+--echo # Bug#58165: "my_empty_string" gets modified and causes LOAD DATA to fail
+--echo # and other crashes
+--echo #
+CREATE TABLE t1 ( a TEXT );
+SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'bug58165.txt';
+SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' );
+LOAD DATA INFILE 'bug58165.txt' INTO TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
--echo End of 5.1 tests
--echo Start of 5.4 tests
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index a15461e4611..a9980a0c8eb 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -802,6 +802,26 @@ select LAST_DAY('2007-12-06 08:59:19.05') - INTERVAL 1 SECOND;
select date_add('1000-01-01 00:00:00', interval '1.03:02:01.05' day_microsecond);
select date_add('1000-01-01 00:00:00', interval '1.02' day_microsecond);
+
+--echo #
+--echo # Bug #52315 part 2 : utc_date() crashes when system time > year 2037
+--echo #
+
+--disable_result_log
+SET TIMESTAMP=-147490000; SELECT UTC_TIMESTAMP();
+--error ER_WRONG_VALUE_FOR_VAR
+SET TIMESTAMP=2147483648; SELECT UTC_TIMESTAMP();
+SET TIMESTAMP=2147483646; SELECT UTC_TIMESTAMP();
+SET TIMESTAMP=2147483647; SELECT UTC_TIMESTAMP();
+SET TIMESTAMP=0; SELECT UTC_TIMESTAMP();
+SET TIMESTAMP=-1; SELECT UTC_TIMESTAMP();
+SET TIMESTAMP=1; SELECT UTC_TIMESTAMP();
+--enable_result_log
+
+#reset back the timestamp value
+SET TIMESTAMP=0;
+
+
--echo End of 5.0 tests
#
@@ -832,4 +852,95 @@ INSERT INTO t1 VALUES (0),(9.216e-096);
SELECT 1 FROM t1 ORDER BY @x:=makedate(a,a);
DROP TABLE t1;
+--echo #
+--echo # Bug #52160: crash and inconsistent results when grouping
+--echo # by a function and column
+--echo #
+
+CREATE TABLE t1(a CHAR(10) NOT NULL);
+INSERT INTO t1 VALUES (''),('');
+SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a);
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#11766112 59151:UNINITIALIZED VALUES IN EXTRACT_DATE_TIME WITH STR_TO_DATE(SPACE(..) ...
+--echo #
+
+SELECT STR_TO_DATE(SPACE(2),'1');
+
+--echo #
+--echo # Bug#11765216 58154: UNINITIALIZED VARIABLE FORMAT IN STR_TO_DATE FUNCTION
+--echo #
+
+SET GLOBAL SQL_MODE='';
+DO STR_TO_DATE((''), FROM_DAYS(@@GLOBAL.SQL_MODE));
+SET GLOBAL SQL_MODE=DEFAULT;
+
+--echo #
+--echo # Bug#11766087 59125: VALGRIND UNINITIALISED VALUE WARNING IN ULL2DEC, LONGLONG2DECIMAL
+--echo #
+
+SELECT FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1);
+
+--echo #
+--echo # Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING
+--echo #
+
+SELECT CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025));
+
+--echo #
+--echo # Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME
+--echo #
+
+SELECT ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR);
+
+--echo #
+--echo # Bug#11889186 60503: CRASH IN MAKE_DATE_TIME WITH DATE_FORMAT / STR_TO_DATE COMBINATION
+--echo #
+
+SELECT DATE_FORMAT('0000-00-11', '%W');
+SELECT DATE_FORMAT('0000-00-11', '%a');
+SELECT DATE_FORMAT('0000-00-11', '%w');
+
+--echo #
+--echo # Bug#12403504 AFTER FIX FOR #11889186 : ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0
+--echo #
+
+SELECT MAKEDATE(11111111,1);
+SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1);
+
--echo End of 5.1 tests
+
+--echo #
+--echo # Bug#57039: constant subtime expression returns incorrect result.
+--echo #
+CREATE TABLE t1 (`date_date` datetime NOT NULL);
+INSERT INTO t1 VALUES ('2008-01-03 00:00:00'), ('2008-01-03 00:00:00');
+SELECT * FROM t1 WHERE date_date >= subtime(now(), "00:30:00");
+SELECT * FROM t1 WHERE date_date <= addtime(date_add("2000-1-1", INTERVAL "1:1:1" HOUR_SECOND), "00:20:00");
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#57512 str_to_date crash...
+--echo #
+
+SELECT WEEK(STR_TO_DATE(NULL,0));
+SELECT SUBDATE(STR_TO_DATE(NULL,0), INTERVAL 1 HOUR);
+
+--echo #
+--echo # BUG#59895 - setting storage engine to null segfaults mysqld
+--echo #
+SELECT MONTHNAME(0), MONTHNAME(0) IS NULL, MONTHNAME(0) + 1;
+--error ER_WRONG_VALUE_FOR_VAR
+SET storage_engine=NULL;
+
+--echo #
+--echo # Bug #59686 crash in String::copy() with time data type
+--echo #
+
+SELECT min(timestampadd(month, 1>'', from_days('%Z')));
+
+create table t1(a time);
+insert into t1 values ('00:00:00'),('00:01:00');
+select 1 from t1 where 1 < some (select cast(a as datetime) from t1);
+drop table t1;
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index 9e6002a1faf..b99d35ecd48 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -940,3 +940,31 @@ DROP TABLE t1;
--echo End of 5.0 tests.
+
+
+--echo #
+--echo # Bug #57323/11764487: myisam corruption with insert ignore
+--echo # and invalid spatial data
+--echo #
+
+CREATE TABLE t1(a LINESTRING NOT NULL, b GEOMETRY NOT NULL,
+ SPATIAL KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(GEOMFROMTEXT("point (0 0)"), GEOMFROMTEXT("point (1 1)"));
+--error ER_CANT_CREATE_GEOMETRY_OBJECT
+INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=GEOMFROMTEXT("error");
+--error ER_CANT_CREATE_GEOMETRY_OBJECT
+INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=NULL;
+SELECT ASTEXT(a), ASTEXT(b) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(a INT NOT NULL, b GEOMETRY NOT NULL,
+ KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES(0, GEOMFROMTEXT("point (1 1)"));
+--error ER_CANT_CREATE_GEOMETRY_OBJECT
+INSERT IGNORE INTO t1 SET a=0, b=GEOMFROMTEXT("error");
+--error ER_CANT_CREATE_GEOMETRY_OBJECT
+INSERT IGNORE INTO t1 SET a=1, b=NULL;
+SELECT a, ASTEXT(b) FROM t1;
+DROP TABLE t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 4aad3f80b68..2a800140d1f 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -361,7 +361,7 @@ t1 where object_id=85998;
# Expected result is 36.3310176346905, but IA64 returns 36.3310176346904
# due to fused multiply-add instructions.
---replace_result 36.3310176346904 36.3310176346905
+--replace_result 36.3310176346904 36.3310176346905 -114.87787186923326 -114.87787186923313 36.33101763469053 36.33101763469059 36.33101763469043 36.33101763469059
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1 where object_id=85984;
@@ -747,12 +747,40 @@ SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000
SET @a=POLYFROMWKB(@a);
+#
+# Bug #57321 crashes and valgrind errors from spatial types
+#
+
+create table t1(a polygon NOT NULL)engine=myisam;
+insert into t1 values (geomfromtext("point(0 1)"));
+insert into t1 values (geomfromtext("point(1 0)"));
+select * from (select polygon(t1.a) as p from t1 order by t1.a) d;
+drop table t1;
+
+
+--echo #
+--echo # Test for bug #59888 "debug assertion when attempt to create spatial index
+--echo # on char > 31 bytes".
+--echo #
+create table t1(a char(32) not null) engine=myisam;
+--error ER_SPATIAL_MUST_HAVE_GEOM_COL
+create spatial index i on t1 (a);
+drop table t1;
+
+
--echo End of 5.1 tests
#
# Bug #50574 5.5.x allows spatial indexes on non-spatial
# columns, causing crashes!
+# Bug#11767480 SPATIAL INDEXES ON NON-SPATIAL COLUMNS
+# CAUSE CRASHES.
#
+CREATE TABLE t0 (a BINARY(32) NOT NULL);
+--error ER_SPATIAL_MUST_HAVE_GEOM_COL
+CREATE SPATIAL INDEX i on t0 (a);
+INSERT INTO t0 VALUES (1);
+
--error ER_SPATIAL_MUST_HAVE_GEOM_COL
CREATE TABLE t1(
col0 BINARY NOT NULL,
@@ -790,6 +818,7 @@ CREATE TABLE t3 (
);
# cleanup
-DROP TABLE t1;
-DROP TABLE t2;
+DROP TABLE t0, t1, t2;
+
+--echo End of 5.5 tests
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index b1cd9145e42..20284ec9ae9 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -29,7 +29,7 @@ flush privileges;
grant select on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
show grants for mysqltest_1@localhost;
grant delete on mysqltest.* to mysqltest_1@localhost;
-select * from mysql.user where user="mysqltest_1";
+query_vertical select * from mysql.user where user="mysqltest_1";
show grants for mysqltest_1@localhost;
revoke delete on mysqltest.* from mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
@@ -48,10 +48,10 @@ flush privileges;
delete from mysql.user where user='mysqltest_1';
flush privileges;
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10;
-select * from mysql.user where user="mysqltest_1";
+query_vertical select * from mysql.user where user="mysqltest_1";
show grants for mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30;
-select * from mysql.user where user="mysqltest_1";
+query_vertical select * from mysql.user where user="mysqltest_1";
show grants for mysqltest_1@localhost;
# This is just to double check that one won't ignore results of selects
flush privileges;
@@ -1295,6 +1295,284 @@ SELECT CURRENT_USER();
SET PASSWORD FOR CURRENT_USER() = PASSWORD("admin");
SET PASSWORD FOR CURRENT_USER() = PASSWORD("");
+#
+# Bug#57952: privilege change is not taken into account by EXECUTE.
+#
+
+--echo
+--echo # Bug#57952
+--echo
+
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+DROP DATABASE IF EXISTS mysqltest2;
+--enable_warnings
+
+CREATE DATABASE mysqltest1;
+CREATE DATABASE mysqltest2;
+
+use mysqltest1;
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 1);
+
+CREATE TABLE t2(a INT);
+INSERT INTO t2 VALUES (2);
+
+CREATE TABLE mysqltest2.t3(a INT);
+INSERT INTO mysqltest2.t3 VALUES (4);
+
+CREATE USER testuser@localhost;
+GRANT CREATE ROUTINE, EXECUTE ON mysqltest1.* TO testuser@localhost;
+GRANT SELECT(b) ON t1 TO testuser@localhost;
+GRANT SELECT ON t2 TO testuser@localhost;
+GRANT SELECT ON mysqltest2.* TO testuser@localhost;
+
+--echo
+--echo # Connection: bug57952_con1 (testuser@localhost, db: mysqltest1)
+--connect (bug57952_con1,localhost,testuser,,mysqltest1)
+PREPARE s1 FROM 'SELECT b FROM t1';
+PREPARE s2 FROM 'SELECT a FROM t2';
+PREPARE s3 FROM 'SHOW TABLES FROM mysqltest2';
+
+CREATE PROCEDURE p1() SELECT b FROM t1;
+CREATE PROCEDURE p2() SELECT a FROM t2;
+CREATE PROCEDURE p3() SHOW TABLES FROM mysqltest2;
+
+CALL p1;
+CALL p2;
+CALL p3;
+
+--echo
+--echo # Connection: default
+--connection default
+REVOKE SELECT ON t1 FROM testuser@localhost;
+GRANT SELECT(a) ON t1 TO testuser@localhost;
+REVOKE SELECT ON t2 FROM testuser@localhost;
+REVOKE SELECT ON mysqltest2.* FROM testuser@localhost;
+
+--echo
+--echo # Connection: bug57952_con1 (testuser@localhost, db: mysqltest1)
+--connection bug57952_con1
+--echo # - Check column-level privileges...
+--error ER_COLUMNACCESS_DENIED_ERROR
+EXECUTE s1;
+
+--error ER_COLUMNACCESS_DENIED_ERROR
+SELECT b FROM t1;
+
+--error ER_COLUMNACCESS_DENIED_ERROR
+EXECUTE s1;
+
+--error ER_COLUMNACCESS_DENIED_ERROR
+CALL p1;
+
+--echo # - Check table-level privileges...
+--error ER_TABLEACCESS_DENIED_ERROR
+SELECT a FROM t2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+EXECUTE s2;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+CALL p2;
+
+--echo # - Check database-level privileges...
+--error ER_DBACCESS_DENIED_ERROR
+SHOW TABLES FROM mysqltest2;
+
+--error ER_DBACCESS_DENIED_ERROR
+EXECUTE s3;
+
+--error ER_DBACCESS_DENIED_ERROR
+CALL p3;
+
+--echo
+--echo # Connection: default
+--connection default
+--disconnect bug57952_con1
+DROP DATABASE mysqltest1;
+DROP DATABASE mysqltest2;
+DROP USER testuser@localhost;
+use test;
+--echo
+
+
+--echo #
+--echo # Test for bug #36544 "DROP USER does not remove stored function
+--echo # privileges".
+--echo #
+create database mysqltest1;
+create function mysqltest1.f1() returns int return 0;
+create procedure mysqltest1.p1() begin end;
+--echo #
+--echo # 1) Check that DROP USER properly removes privileges on both
+--echo # stored procedures and functions.
+--echo #
+create user mysqluser1@localhost;
+grant execute on function mysqltest1.f1 to mysqluser1@localhost;
+grant execute on procedure mysqltest1.p1 to mysqluser1@localhost;
+
+--echo # Quick test that granted privileges are properly reflected
+--echo # in privilege tables and in in-memory structures.
+show grants for mysqluser1@localhost;
+select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
+--echo #
+--echo # Create connection 'bug_36544_con1' as 'mysqluser1@localhost'.
+--connect (bug36544_con1,localhost,mysqluser1,,)
+call mysqltest1.p1();
+select mysqltest1.f1();
+
+--echo #
+--echo # Switch to connection 'default'.
+--connection default
+drop user mysqluser1@localhost;
+
+--echo #
+--echo # Test that dropping of user is properly reflected in
+--echo # both privilege tables and in in-memory structures.
+--echo #
+--echo # Switch to connection 'bug36544_con1'.
+--connection bug36544_con1
+--echo # The connection cold be alive but should not be able to
+--echo # access to any of the stored routines.
+--error ER_PROCACCESS_DENIED_ERROR
+call mysqltest1.p1();
+--error ER_PROCACCESS_DENIED_ERROR
+select mysqltest1.f1();
+--disconnect bug36544_con1
+
+--echo #
+--echo # Switch to connection 'default'.
+--connection default
+--echo #
+--echo # Now create user with the same name and check that he
+--echo # has not inherited privileges.
+create user mysqluser1@localhost;
+show grants for mysqluser1@localhost;
+select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
+--echo #
+--echo # Create connection 'bug_36544_con2' as 'mysqluser1@localhost'.
+--connect (bug36544_con2,localhost,mysqluser1,,)
+--echo # Newly created user should not be able to access any of the routines.
+--error ER_PROCACCESS_DENIED_ERROR
+call mysqltest1.p1();
+--error ER_PROCACCESS_DENIED_ERROR
+select mysqltest1.f1();
+--echo #
+--echo # Switch to connection 'default'.
+--connection default
+
+--echo #
+--echo # 2) Check that RENAME USER properly updates privileges on both
+--echo # stored procedures and functions.
+--echo #
+grant execute on function mysqltest1.f1 to mysqluser1@localhost;
+grant execute on procedure mysqltest1.p1 to mysqluser1@localhost;
+--echo #
+--echo # Create one more user to make in-memory hashes non-trivial.
+--echo # User names 'mysqluser11' and 'mysqluser10' were selected
+--echo # to trigger bug discovered during code inspection.
+create user mysqluser11@localhost;
+grant execute on function mysqltest1.f1 to mysqluser11@localhost;
+grant execute on procedure mysqltest1.p1 to mysqluser11@localhost;
+--echo # Also create a couple of tables to test for another bug
+--echo # discovered during code inspection (again table names were
+--echo # chosen especially to trigger the bug).
+create table mysqltest1.t11 (i int);
+create table mysqltest1.t22 (i int);
+grant select on mysqltest1.t22 to mysqluser1@localhost;
+grant select on mysqltest1.t11 to mysqluser1@localhost;
+
+--echo # Quick test that granted privileges are properly reflected
+--echo # in privilege tables and in in-memory structures.
+show grants for mysqluser1@localhost;
+select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
+select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost';
+--echo #
+--echo # Switch to connection 'bug36544_con2'.
+--connection bug36544_con2
+call mysqltest1.p1();
+select mysqltest1.f1();
+select * from mysqltest1.t11;
+select * from mysqltest1.t22;
+
+--echo #
+--echo # Switch to connection 'default'.
+--connection default
+rename user mysqluser1@localhost to mysqluser10@localhost;
+
+--echo #
+--echo # Test that there are no privileges left for mysqluser1.
+--echo #
+--echo # Switch to connection 'bug36544_con2'.
+--connection bug36544_con2
+--echo # The connection cold be alive but should not be able to
+--echo # access to any of the stored routines or tables.
+--error ER_PROCACCESS_DENIED_ERROR
+call mysqltest1.p1();
+--error ER_PROCACCESS_DENIED_ERROR
+select mysqltest1.f1();
+--error ER_TABLEACCESS_DENIED_ERROR
+select * from mysqltest1.t11;
+--error ER_TABLEACCESS_DENIED_ERROR
+select * from mysqltest1.t22;
+--disconnect bug36544_con2
+
+--echo #
+--echo # Switch to connection 'default'.
+--connection default
+--echo #
+--echo # Now create user with the old name and check that he
+--echo # has not inherited privileges.
+create user mysqluser1@localhost;
+show grants for mysqluser1@localhost;
+select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
+select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost';
+--echo #
+--echo # Create connection 'bug_36544_con3' as 'mysqluser1@localhost'.
+--connect (bug36544_con3,localhost,mysqluser1,,)
+--echo # Newly created user should not be able to access to any of the
+--echo # stored routines or tables.
+--error ER_PROCACCESS_DENIED_ERROR
+call mysqltest1.p1();
+--error ER_PROCACCESS_DENIED_ERROR
+select mysqltest1.f1();
+--error ER_TABLEACCESS_DENIED_ERROR
+select * from mysqltest1.t11;
+--error ER_TABLEACCESS_DENIED_ERROR
+select * from mysqltest1.t22;
+--disconnect bug36544_con3
+
+--echo #
+--echo # Switch to connection 'default'.
+--connection default
+--echo #
+--echo # Now check that privileges became associated with a new user
+--echo # name - mysqluser10.
+--echo #
+show grants for mysqluser10@localhost;
+select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser10' and host='localhost';
+select db, table_name, table_priv from mysql.tables_priv where user='mysqluser10' and host='localhost';
+--echo #
+--echo # Create connection 'bug_36544_con4' as 'mysqluser10@localhost'.
+--connect (bug36544_con4,localhost,mysqluser10,,)
+call mysqltest1.p1();
+select mysqltest1.f1();
+select * from mysqltest1.t11;
+select * from mysqltest1.t22;
+--disconnect bug36544_con4
+
+--echo #
+--echo # Switch to connection 'default'.
+--connection default
+--echo #
+--echo # Clean-up.
+drop user mysqluser1@localhost;
+drop user mysqluser10@localhost;
+drop user mysqluser11@localhost;
+drop database mysqltest1;
+
+
--echo End of 5.0 tests
#
@@ -1419,11 +1697,6 @@ GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost';
connect (connbug33464, localhost, userbug33464, , dbbug33464);
--source suite/funcs_1/include/show_connection.inc
---disable_warnings
-DROP PROCEDURE IF EXISTS sp3;
-DROP FUNCTION IF EXISTS fn1;
---enable_warnings
-
delimiter //;
CREATE PROCEDURE sp3(v1 char(20))
BEGIN
@@ -1578,6 +1851,16 @@ DROP TABLE db2.t1;
DROP DATABASE db1;
DROP DATABASE db2;
+--echo #
+--echo # Bug #36742
+--echo #
+grant usage on Foo.* to myuser@Localhost identified by 'foo';
+grant select on Foo.* to myuser@localhost;
+select host,user from mysql.user where User='myuser';
+revoke select on Foo.* from myuser@localhost;
+delete from mysql.user where User='myuser';
+flush privileges;
+
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index 447848013f9..6c2ba0dd6fc 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -31,7 +31,7 @@ create user mysqltest_2@localhost;
connect (user_a,localhost,mysqltest_1,,);
connection user_a;
grant select on `my\_1`.* to mysqltest_2@localhost;
---error ER_PASSWORD_NOT_ALLOWED
+--error ER_DBACCESS_DENIED_ERROR
grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass';
disconnect user_a;
connection default;
@@ -405,7 +405,7 @@ drop database mysqltest_1;
# But anonymous users can't change their password
connect (n5,localhost,test,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection n5;
---error ER_DBACCESS_DENIED_ERROR
+--error ER_PASSWORD_NO_MATCH
set password = password("changed");
disconnect n5;
connection default;
diff --git a/mysql-test/t/grant3.test b/mysql-test/t/grant3.test
index 437fc9a278f..d24b2de17eb 100644
--- a/mysql-test/t/grant3.test
+++ b/mysql-test/t/grant3.test
@@ -64,6 +64,7 @@ SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
DROP USER CUser@localhost;
+--error ER_CANNOT_USER
DROP USER CUser@LOCALHOST;
#### table grants
@@ -88,6 +89,7 @@ SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
DROP USER CUser@localhost;
+--error ER_CANNOT_USER
DROP USER CUser@LOCALHOST;
### column grants
@@ -112,6 +114,7 @@ SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
DROP USER CUser@localhost;
+--error ER_CANNOT_USER
DROP USER CUser@LOCALHOST;
drop table t1;
@@ -131,6 +134,7 @@ flush privileges;
SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
+--error ER_NONEXISTING_GRANT
REVOKE SELECT ON test.* FROM 'CUser2'@'localhost';
flush privileges;
@@ -138,6 +142,7 @@ SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
DROP USER CUser2@localhost;
+--error ER_CANNOT_USER
DROP USER CUser2@LOCALHOST;
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index f22255d362f..7f227398a95 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1253,6 +1253,54 @@ SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a;
SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a;
DROP TABLE t1;
+--echo #
+--echo # Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field
+--echo #
+
+CREATE TABLE t1(f1 INT NOT NULL);
+INSERT INTO t1 VALUES (16777214),(0);
+
+SELECT COUNT(*) FROM t1 LEFT JOIN t1 t2
+ON 1 WHERE t2.f1 > 1 GROUP BY t2.f1;
+
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#59839: Aggregation followed by subquery yields wrong result
+--echo #
+
+CREATE TABLE t1 (
+ a INT,
+ b INT,
+ c INT,
+ KEY (a, b)
+);
+
+INSERT INTO t1 VALUES
+ ( 1, 1, 1 ),
+ ( 1, 2, 2 ),
+ ( 1, 3, 3 ),
+ ( 1, 4, 6 ),
+ ( 1, 5, 5 ),
+ ( 1, 9, 13 ),
+
+ ( 2, 1, 6 ),
+ ( 2, 2, 7 ),
+ ( 2, 3, 8 );
+
+EXPLAIN
+SELECT a, AVG(t1.b),
+(SELECT t11.c FROM t1 t11 WHERE t11.a = t1.a AND t11.b = AVG(t1.b)) AS t11c,
+(SELECT t12.c FROM t1 t12 WHERE t12.a = t1.a AND t12.b = AVG(t1.b)) AS t12c
+FROM t1 GROUP BY a;
+
+SELECT a, AVG(t1.b),
+(SELECT t11.c FROM t1 t11 WHERE t11.a = t1.a AND t11.b = AVG(t1.b)) AS t11c,
+(SELECT t12.c FROM t1 t12 WHERE t12.a = t1.a AND t12.b = AVG(t1.b)) AS t12c
+FROM t1 GROUP BY a;
+
+DROP TABLE t1;
+
--echo # End of 5.1 tests
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index c808e747523..2ed8b40b858 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -564,4 +564,30 @@ HAVING field1 < 7;
DROP TABLE t1,t2;
+--echo #
+--echo # Bug#48916 Server incorrectly processing HAVING clauses with an ORDER BY clause
+--echo #
+
+CREATE TABLE t1 (f1 INT, f2 INT);
+INSERT INTO t1 VALUES (1, 0), (2, 1), (3, 2);
+CREATE TABLE t2 (f1 INT, f2 INT);
+
+SELECT t1.f1
+FROM t1
+HAVING (3, 2) IN (SELECT f1, f2 FROM t2) AND t1.f1 >= 0
+ORDER BY t1.f1;
+
+SELECT t1.f1
+FROM t1
+HAVING (3, 2) IN (SELECT 4, 2) AND t1.f1 >= 0
+ORDER BY t1.f1;
+
+SELECT t1.f1
+FROM t1
+HAVING 2 IN (SELECT f2 FROM t2) AND t1.f1 >= 0
+ORDER BY t1.f1;
+
+DROP TABLE t1,t2;
+
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/implicit_char_to_num_conversion.test b/mysql-test/t/implicit_char_to_num_conversion.test
new file mode 100644
index 00000000000..f3da83ff2c1
--- /dev/null
+++ b/mysql-test/t/implicit_char_to_num_conversion.test
@@ -0,0 +1,174 @@
+########### implicit_char_to_num_conversion.test #######################
+# #
+# This test aims at using string/char literal in comparison operators #
+# without explicit type-cast. This is a bug test for Bug#11766521 #
+# - Incorrect result is returned if string/char literal is used with #
+# comparision operator and bit data type column. Test is extended to #
+# include numeric data type comparison with string/char literal #
+# #
+# #
+# Creation: #
+# 2011-05-10 vfisrekar Implement this test as part of Bug#11766521 #
+# #
+########################################################################
+
+--disable_warnings
+DROP TABLE IF EXISTS t5;
+--enable_warnings
+
+let $default_engine = `select @@SESSION.default_storage_engine`;
+
+# Bug#11766521 - BIT Datatype comparison in where clause return incorrect
+# result for '=' , '<=>' operators
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 BIT(2) PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (0), (1), (2);
+SELECT HEX(c1) FROM t5 ORDER BY c1;
+# Enable Following two select after Bug#11766521 fix
+# SELECT HEX(c1) FROM t5 WHERE c1 = '1' ORDER BY c1;
+# SELECT HEX(c1) FROM t5 WHERE c1 <=> '1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 = b'1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 <=> b'1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 != b'1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 >= '1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 <= '1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 < '1' ORDER BY c1;
+SELECT HEX(c1) FROM t5 WHERE c1 > '0' ORDER BY c1;
+DROP TABLE t5;
+
+# FLOAT Data-type
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 FLOAT(5,2) PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (95.95), (-10.10), (1), (0);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+# Following two queries does not return result may be due to Bug#11766521.
+# Enable them after Bug#11766521 fix.
+# SELECT c1 FROM t5 WHERE c1 = '10.10' ORDER BY c1;
+# SELECT c1 FROM t5 WHERE c2 <=> '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '10.10' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '1' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '1' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '0' ORDER BY c1;
+DROP TABLE t5;
+
+# TINYINT Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 TINYINT PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (95), (10),(11),(-8);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '10' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '10' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '-8' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '10' ORDER BY c1;
+DROP TABLE t5;
+
+# SMALLINT Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 SMALLINT PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (395), (-200), (100), (111);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '100' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '100' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '395' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '-200' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '100' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '111' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '111' ORDER BY c1;
+DROP TABLE t5;
+
+# MEDIUMINT Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 MEDIUMINT PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (-8388607), (311),(215),(88608);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '311' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '311' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '215' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '88608' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '-8388607' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '215' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '215' ORDER BY c1;
+DROP TABLE t5;
+
+# INT Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 INT PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (-2147483647), (1011),(15),(9388607);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '9388607' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '9388607' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '15' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '1011' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '-2147483647' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '15' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '15' ORDER BY c1;
+DROP TABLE t5;
+
+# BIGINT Data-type
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 BIGINT PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (-9223372036854775807), (12011),(500),(3372036854775808);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '-9223372036854775807' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '-9223372036854775807' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '12011' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '500' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '3372036854775808' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '12011' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '12011' ORDER BY c1;
+DROP TABLE t5;
+
+# DOUBLE Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 DOUBLE(5,2) PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
+DROP TABLE t5;
+
+# NUMERIC Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 NUMERIC(5,2) PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
+DROP TABLE t5;
+
+# DECIMAL Datatype
+--replace_result $default_engine <default_engine>
+eval CREATE TABLE t5(c1 DECIMAL(5,2) PRIMARY KEY) ENGINE = $default_engine;
+INSERT INTO t5 VALUES (95.95), (11.11),(5),(-908.92);
+SELECT c1 FROM t5 ORDER BY c1;
+# Compare with string literal
+SELECT c1 FROM t5 WHERE c1 = '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <=> '11.11' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 >= '5' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 <= '95.95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 != '-908.92' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 < '95.95' ORDER BY c1;
+SELECT c1 FROM t5 WHERE c1 > '-908.92' ORDER BY c1;
+DROP TABLE t5;
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 4461004c79c..698bf67b927 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -1,6 +1,9 @@
# This test uses grants, which can't get tested for embedded server
-- source include/not_embedded.inc
+#Don't run this test when thread_pool active
+--source include/not_threadpool.inc
+
# check that CSV engine was compiled in, as the result of the test depends
# on the presence of the log tables (which are CSV-based).
--source include/have_csv.inc
@@ -1552,3 +1555,56 @@ WHERE COLUMNS.TABLE_SCHEMA = 'test'
AND COLUMNS.TABLE_NAME = 't1';
+--echo #
+--echo # A test case for Bug#56540 "Exception (crash) in sql_show.cc
+--echo # during rqg_info_schema test on Windows"
+--echo # Ensure that we never access memory of a closed table,
+--echo # in particular, never access table->field[] array.
+--echo # Before the fix, the below test case, produced
+--echo # valgrind errors.
+--echo #
+
+--disable_warnings
+drop table if exists t1;
+drop view if exists v1;
+--enable_warnings
+
+create table t1 (a int, b int);
+create view v1 as select t1.a, t1.b from t1;
+alter table t1 change b c int;
+lock table t1 read;
+connect(con1, localhost, root,,);
+--echo # --> connection con1
+connection con1;
+send flush tables;
+--echo # --> connection default
+connection default;
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for table flush" and
+ info = "flush tables";
+--source include/wait_condition.inc
+--vertical_results
+select * from information_schema.views;
+--horizontal_results
+unlock tables;
+
+--echo #
+--echo # Cleanup.
+--echo #
+
+--echo # --> connection con1
+connection con1;
+--echo # Reaping 'flush tables'
+reap;
+disconnect con1;
+--source include/wait_until_disconnected.inc
+--echo # --> connection default
+connection default;
+drop table t1;
+drop view v1;
+
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/t/information_schema_db.test b/mysql-test/t/information_schema_db.test
index 28133bd3f5d..a2a32a4fac5 100644
--- a/mysql-test/t/information_schema_db.test
+++ b/mysql-test/t/information_schema_db.test
@@ -2,6 +2,9 @@
# in the embedded server by default). So skip the test in embedded-server mode.
-- source include/not_embedded.inc
+#Don't run this test when thread_pool active
+--source include/not_threadpool.inc
+
-- source include/testdb_only.inc
--disable_warnings
diff --git a/mysql-test/t/init_file.test b/mysql-test/t/init_file.test
index 343f320550c..573396f625d 100644
--- a/mysql-test/t/init_file.test
+++ b/mysql-test/t/init_file.test
@@ -33,4 +33,4 @@ drop table t1, t2;
# MTR will restart server anyway, but by forcing it we avoid being warned
# about the apparent side effect
-call mtr.force_restart();
+--source include/force_restart.inc
diff --git a/mysql-test/t/innodb_mysql_lock.test b/mysql-test/t/innodb_mysql_lock.test
index 975444a44b1..629da27660e 100644
--- a/mysql-test/t/innodb_mysql_lock.test
+++ b/mysql-test/t/innodb_mysql_lock.test
@@ -279,6 +279,42 @@ disconnect con2;
disconnect con3;
+--echo #
+--echo # Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY
+--echo # KEY NO 0 FOR TABLE IN ERROR LOG
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--connect (con1,localhost,root)
+
+--echo # Connection default
+connection default;
+CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1, 12345);
+START TRANSACTION;
+SELECT * FROM t1;
+
+--echo # Connection con1
+--connection con1
+SET lock_wait_timeout=1;
+# Test with two timeouts, as the first version of this patch
+# only worked with one timeout.
+--error ER_LOCK_WAIT_TIMEOUT
+ALTER TABLE t1 ADD INDEX idx(value);
+--error ER_LOCK_WAIT_TIMEOUT
+ALTER TABLE t1 ADD INDEX idx(value);
+
+--echo # Connection default
+--connection default
+SELECT * FROM t1;
+COMMIT;
+DROP TABLE t1;
+disconnect con1;
+
+
# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/innodb_mysql_sync.test b/mysql-test/t/innodb_mysql_sync.test
index 07f75afec40..ec8fa55fc5c 100644
--- a/mysql-test/t/innodb_mysql_sync.test
+++ b/mysql-test/t/innodb_mysql_sync.test
@@ -2,6 +2,7 @@
# Test file for InnoDB tests that require the debug sync facility
#
--source include/have_innodb.inc
+--source include/have_debug.inc
--source include/have_debug_sync.inc
# Save the initial number of concurrent sessions.
--source include/count_sessions.inc
@@ -104,6 +105,203 @@ SELECT ((@id := id) - id) FROM t2;
KILL @id;
SET DEBUG_SYNC= "now SIGNAL killed";
DROP TABLE t1, t2;
+disconnect con1;
+--source include/wait_until_count_sessions.inc
+SET DEBUG_SYNC= "RESET";
+
+
+--echo #
+--echo # Bug#58933 Assertion `thd- >is_error()' fails on shutdown with ongoing
+--echo # OPTIMIZE TABLE
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1), (2);
+
+--echo # Connection con1
+connect (con1,localhost,root);
+let $ID= `SELECT connection_id()`;
+SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL waiting WAIT_FOR killed';
+--echo # Sending:
+--send OPTIMIZE TABLE t1
+
+--echo # Connection default
+connection default;
+SET DEBUG_SYNC= 'now WAIT_FOR waiting';
+--replace_result $ID ID
+eval KILL QUERY $ID;
+SET DEBUG_SYNC= 'now SIGNAL killed';
+
+--echo # Connection con1
+connection con1;
+--echo # Reaping: OPTIMIZE TABLE t1
+--reap
+
+--echo # Connection default
+connection default;
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+disconnect con1;
+
+
+--echo #
+--echo # Bug#42230 during add index, cannot do queries on storage engines
+--echo # that implement add_index
+--echo #
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+connect(con1,localhost,root);
+connect(con2,localhost,root);
+
+--echo # Test 1: Secondary index, should not block reads (original test case).
+
+--echo # Connection default
+connection default;
+CREATE DATABASE db1;
+CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb;
+INSERT INTO db1.t1(value) VALUES (1), (2);
+SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
+--echo # Sending:
+--send ALTER TABLE db1.t1 ADD INDEX(value)
+
+--echo # Connection con1
+connection con1;
+SET DEBUG_SYNC= "now WAIT_FOR manage";
+# Neither of these two statements should be blocked
+USE db1;
+SELECT * FROM t1;
+SET DEBUG_SYNC= "now SIGNAL query";
+
+--echo # Connection default
+connection default;
+--echo # Reaping: ALTER TABLE db1.t1 ADD INDEX(value)
+--reap
+DROP DATABASE db1;
+
+--echo # Test 2: Primary index (implicit), should block reads.
+
+CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
+SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
+--echo # Sending:
+--send ALTER TABLE t1 ADD UNIQUE INDEX(a)
+
+--echo # Connection con1
+connection con1;
+SET DEBUG_SYNC= "now WAIT_FOR manage";
+USE test;
+--echo # Sending:
+--send SELECT * FROM t1
+
+--echo # Connection con2
+connection con2;
+--echo # Waiting for SELECT to be blocked by the metadata lock on t1
+let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
+ WHERE state= 'Waiting for table metadata lock'
+ AND info='SELECT * FROM t1';
+--source include/wait_condition.inc
+SET DEBUG_SYNC= "now SIGNAL query";
+
+--echo # Connection default
+connection default;
+--echo # Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a)
+--reap
+
+--echo # Connection con1
+connection con1;
+--echo # Reaping: SELECT * FROM t1
+--reap
+
+--echo # Test 3: Primary index (explicit), should block reads.
+
+--echo # Connection default
+connection default;
+ALTER TABLE t1 DROP INDEX a;
+SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
+--echo # Sending:
+--send ALTER TABLE t1 ADD PRIMARY KEY (a)
+
+--echo # Connection con1
+connection con1;
+SET DEBUG_SYNC= "now WAIT_FOR manage";
+--echo # Sending:
+--send SELECT * FROM t1
+
+--echo # Connection con2
+connection con2;
+--echo # Waiting for SELECT to be blocked by the metadata lock on t1
+let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
+ WHERE state= 'Waiting for table metadata lock'
+ AND info='SELECT * FROM t1';
+--source include/wait_condition.inc
+SET DEBUG_SYNC= "now SIGNAL query";
+
+--echo # Connection default
+connection default;
+--echo # Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a)
+--reap
+
+--echo # Connection con1
+connection con1;
+--echo # Reaping: SELECT * FROM t1
+--reap
+
+--echo # Test 4: Secondary unique index, should not block reads.
+
+--echo # Connection default
+connection default;
+SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query";
+--echo # Sending:
+--send ALTER TABLE t1 ADD UNIQUE (b)
+
+--echo # Connection con1
+connection con1;
+SET DEBUG_SYNC= "now WAIT_FOR manage";
+SELECT * FROM t1;
+SET DEBUG_SYNC= "now SIGNAL query";
+
+--echo # Connection default
+connection default;
+--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b)
+--reap
+
+disconnect con1;
+disconnect con2;
+SET DEBUG_SYNC= "RESET";
+DROP TABLE t1;
+
+
+--echo #
+--echo # Bug#11853126 RE-ENABLE CONCURRENT READS WHILE CREATING SECONDARY INDEX
+--echo # IN INNODB
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
+INSERT INTO t1 VALUES (1, 12345), (2, 23456);
+
+--echo # Connection con1
+--connect (con1,localhost,root)
+SET SESSION debug= "+d,alter_table_rollback_new_index";
+--error ER_UNKNOWN_ERROR
+ALTER TABLE t1 ADD PRIMARY KEY(a);
+SELECT * FROM t1;
+
+--echo # Connection default
+--connection default
+SELECT * FROM t1;
+DROP TABLE t1;
+disconnect con1;
# Check that all connections opened by test cases in this file are really
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index d740445fb4d..b2f3c14aa13 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -412,8 +412,8 @@ SET GLOBAL myisam_data_pointer_size = 2;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
-call mtr.add_suppression("mysqld: The table '.*#sql.*' is full");
---error 0,ER_RECORD_FILE_FULL,ER_RECORD_FILE_FULL
+call mtr.add_suppression("mysqld.*: The table '.*#sql.*' is full");
+--error ER_RECORD_FILE_FULL,ER_RECORD_FILE_FULL
INSERT IGNORE INTO t1 SELECT t1.a FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6,t1 t7;
# Cleanup
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index b14d9a40300..3a6c09f9ba7 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -983,6 +983,241 @@ EXPLAIN EXTENDED SELECT STRAIGHT_JOIN jt1.f1 FROM t1 AS jt1
DROP TABLE t1;
--echo #
+--echo # Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field
+--echo #
+
+CREATE TABLE t1 (f1 INT NOT NULL, PRIMARY KEY (f1));
+CREATE TABLE t2 (f1 INT NOT NULL, f2 INT NOT NULL, PRIMARY KEY (f1, f2));
+
+INSERT INTO t1 VALUES (4);
+INSERT INTO t2 VALUES (3, 3);
+INSERT INTO t2 VALUES (7, 7);
+
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4
+GROUP BY t2.f1, t2.f2;
+
+SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4
+GROUP BY t2.f1, t2.f2;
+
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
+GROUP BY t2.f1, t2.f2;
+
+SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
+WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
+GROUP BY t2.f1, t2.f2;
+
+DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug#57034 incorrect OUTER JOIN result when joined on unique key
+--echo #
+
+CREATE TABLE t1 (pk INT PRIMARY KEY,
+ col_int INT,
+ col_int_unique INT UNIQUE KEY);
+INSERT INTO t1 VALUES (1,NULL,2), (2,0,0);
+
+CREATE TABLE t2 (pk INT PRIMARY KEY,
+ col_int INT,
+ col_int_unique INT UNIQUE KEY);
+INSERT INTO t2 VALUES (1,0,1), (2,0,2);
+
+EXPLAIN
+SELECT * FROM t1 LEFT JOIN t2
+ ON t1.col_int_unique = t2.col_int_unique AND t1.col_int = t2.col_int
+ WHERE t1.pk=1;
+
+SELECT * FROM t1 LEFT JOIN t2
+ ON t1.col_int_unique = t2.col_int_unique AND t1.col_int = t2.col_int
+ WHERE t1.pk=1;
+
+DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug#48046 Server incorrectly processing JOINs on NULL values
+--echo #
+
+# bug#48046 is a duplicate of bug#57034
+
+CREATE TABLE `BB` (
+ `pk` int(11) NOT NULL AUTO_INCREMENT,
+ `time_key` time DEFAULT NULL,
+ `varchar_key` varchar(1) DEFAULT NULL,
+ `varchar_nokey` varchar(1) DEFAULT NULL,
+ PRIMARY KEY (`pk`),
+ KEY `time_key` (`time_key`),
+ KEY `varchar_key` (`varchar_key`)
+) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
+
+INSERT INTO `BB` VALUES (10,'18:27:58',NULL,NULL);
+
+SELECT table1.time_key AS field1, table2.pk
+FROM BB table1 LEFT JOIN BB table2
+ ON table2.varchar_nokey = table1.varchar_key
+ HAVING field1;
+
+DROP TABLE BB;
+
+--echo #
+--echo # Bug#49600 Server incorrectly processing RIGHT JOIN with
+--echo # constant WHERE clause and no index
+--echo #
+
+# bug#49600 is a duplicate of bug#57034
+
+CREATE TABLE `BB` (
+ `col_datetime_key` datetime DEFAULT NULL,
+ `col_varchar_key` varchar(1) DEFAULT NULL,
+ `col_varchar_nokey` varchar(1) DEFAULT NULL,
+ KEY `col_datetime_key` (`col_datetime_key`),
+ KEY `col_varchar_key` (`col_varchar_key`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+INSERT INTO `BB` VALUES ('1900-01-01 00:00:00',NULL,NULL);
+
+SELECT table1.col_datetime_key
+FROM BB table1 RIGHT JOIN BB table2
+ ON table2 .col_varchar_nokey = table1.col_varchar_key
+ WHERE 7;
+
+# Disable keys, and we get incorrect result for the same query
+ALTER TABLE BB DISABLE KEYS;
+
+SELECT table1.col_datetime_key
+FROM BB table1 RIGHT JOIN BB table2
+ ON table2 .col_varchar_nokey = table1.col_varchar_key
+ WHERE 7;
+
+DROP TABLE BB;
+
+
+--echo #
+--echo # Bug#58490: Incorrect result in multi level OUTER JOIN
+--echo # in combination with IS NULL
+--echo #
+
+CREATE TABLE t1 (i INT NOT NULL);
+INSERT INTO t1 VALUES (0), (2),(3),(4);
+CREATE TABLE t2 (i INT NOT NULL);
+INSERT INTO t2 VALUES (0),(1), (3),(4);
+CREATE TABLE t3 (i INT NOT NULL);
+INSERT INTO t3 VALUES (0),(1),(2), (4);
+CREATE TABLE t4 (i INT NOT NULL);
+INSERT INTO t4 VALUES (0),(1),(2),(3) ;
+
+SELECT * FROM
+ t1 LEFT JOIN
+ ( t2 LEFT JOIN
+ ( t3 LEFT JOIN
+ t4
+ ON t4.i = t3.i
+ )
+ ON t3.i = t2.i
+ )
+ ON t2.i = t1.i
+ ;
+
+SELECT * FROM
+ t1 LEFT JOIN
+ ( t2 LEFT JOIN
+ ( t3 LEFT JOIN
+ t4
+ ON t4.i = t3.i
+ )
+ ON t3.i = t2.i
+ )
+ ON t2.i = t1.i
+ WHERE t4.i IS NULL;
+
+
+# Most simplified testcase to reproduce the bug.
+# (Has to be at least a two level nested outer join)
+SELECT * FROM
+ t1 LEFT JOIN
+ ( ( t2 LEFT JOIN
+ t3
+ ON t3.i = t2.i
+ )
+ )
+ ON t2.i = t1.i
+ WHERE t3.i IS NULL;
+
+
+# Extended testing:
+# We then add some equi-join inside the query above:
+# (There Used to be some problems here with first
+# proposed patch for this bug)
+SELECT * FROM
+ t1 LEFT JOIN
+ ( ( t2 LEFT JOIN
+ t3
+ ON t3.i = t2.i
+ )
+ JOIN t4
+ ON t4.i=t2.i
+ )
+ ON t2.i = t1.i
+ WHERE t3.i IS NULL;
+
+SELECT * FROM
+ t1 LEFT JOIN
+ ( ( t2 LEFT JOIN
+ t3
+ ON t3.i = t2.i
+ )
+ JOIN (t4 AS t4a JOIN t4 AS t4b ON t4a.i=t4b.i)
+ ON t4a.i=t2.i
+ )
+ ON t2.i = t1.i
+ WHERE t3.i IS NULL;
+
+SELECT * FROM
+ t1 LEFT JOIN
+ ( ( t2 LEFT JOIN
+ t3
+ ON t3.i = t2.i
+ )
+ JOIN (t4 AS t4a, t4 AS t4b)
+ ON t4a.i=t2.i
+ )
+ ON t2.i = t1.i
+ WHERE t3.i IS NULL;
+
+
+DROP TABLE t1,t2,t3,t4;
+
+## Bug#49322 & bug#58490 are duplicates. However, we include testcases
+## for both.
+--echo #
+--echo # Bug#49322(Duplicate): Server is adding extra NULL row
+--echo # on processing a WHERE clause
+--echo #
+
+CREATE TABLE h (pk INT NOT NULL, col_int_key INT);
+INSERT INTO h VALUES (1,NULL),(4,2),(5,2),(3,4),(2,8);
+
+CREATE TABLE m (pk INT NOT NULL, col_int_key INT);
+INSERT INTO m VALUES (1,2),(2,7),(3,5),(4,7),(5,5),(6,NULL),(7,NULL),(8,9);
+CREATE TABLE k (pk INT NOT NULL, col_int_key INT);
+INSERT INTO k VALUES (1,9),(2,2),(3,5),(4,2),(5,7),(6,0),(7,5);
+
+# Baseline query wo/ 'WHERE ... IS NULL' - was correct
+SELECT TABLE1.pk FROM k TABLE1
+RIGHT JOIN h TABLE2 ON TABLE1.col_int_key=TABLE2.col_int_key
+RIGHT JOIN m TABLE4 ON TABLE2.col_int_key=TABLE4.col_int_key;
+
+# Adding 'WHERE ... IS NULL' -> incorrect result
+SELECT TABLE1.pk FROM k TABLE1
+RIGHT JOIN h TABLE2 ON TABLE1.col_int_key=TABLE2.col_int_key
+RIGHT JOIN m TABLE4 ON TABLE2.col_int_key=TABLE4.col_int_key
+WHERE TABLE1.pk IS NULL;
+
+DROP TABLE h,m,k;
+
+--echo #
--echo # Bug#49600: outer join of two single-row tables with joining attributes
--echo # evaluated to nulls
diff --git a/mysql-test/t/join_outer_innodb.test b/mysql-test/t/join_outer_innodb.test
index 40add7f488f..0d47c4ea57b 100644
--- a/mysql-test/t/join_outer_innodb.test
+++ b/mysql-test/t/join_outer_innodb.test
@@ -24,3 +24,40 @@ SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
WHERE t1.name LIKE 'A%' OR FALSE;
DROP TABLE t1,t2;
+
+--echo #
+--echo # BUG#58456: Assertion 0 in QUICK_INDEX_MERGE_SELECT::need_sorted_output
+--echo # in opt_range.h
+--echo #
+
+CREATE TABLE t1 (
+ col_int INT,
+ col_int_key INT,
+ pk INT NOT NULL,
+ PRIMARY KEY (pk),
+ KEY col_int_key (col_int_key)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (NULL,1,1), (6,2,2), (5,3,3), (NULL,4,4);
+INSERT INTO t1 VALUES (1,NULL,6), (8,5,7), (NULL,8,8), (8,NULL,5);
+
+CREATE TABLE t2 (
+ pk INT PRIMARY KEY
+) ENGINE=InnoDB;
+
+let $query=
+SELECT t1.pk
+FROM t2 LEFT JOIN t1 ON t2.pk = t1.col_int
+WHERE t1.col_int_key BETWEEN 5 AND 6
+ AND t1.pk IS NULL OR t1.pk IN (5)
+ORDER BY pk;
+
+--echo
+--eval EXPLAIN $query
+--echo
+--eval $query
+--echo
+
+DROP TABLE t1,t2;
+
+--echo # End BUG#58456
diff --git a/mysql-test/t/key_cache-master.opt b/mysql-test/t/key_cache-master.opt
index 66e19c18a8a..6398e3e0a26 100644
--- a/mysql-test/t/key_cache-master.opt
+++ b/mysql-test/t/key_cache-master.opt
@@ -1 +1,2 @@
--key_buffer_size=2M --small.key_buffer_size=256K --small.key_buffer_size=128K
+--force-restart
diff --git a/mysql-test/t/keywords.test b/mysql-test/t/keywords.test
index 3080c4847b4..08016313ca7 100644
--- a/mysql-test/t/keywords.test
+++ b/mysql-test/t/keywords.test
@@ -62,5 +62,103 @@ call p1();
drop procedure p1;
drop table t1;
-
# End of 5.0 tests
+
+#
+# BUG#57899: Certain reserved words should not be reserved
+#
+
+#
+# We are looking for SYNTAX ERRORS here, so no need to
+# log the queries
+#
+
+CREATE TABLE slow (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
+INSERT INTO slow(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
+INSERT INTO slow(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
+INSERT INTO slow(slow, general) VALUES (1,2), (5,6);
+INSERT INTO slow(slow) VALUES (1), (5);
+SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM slow ORDER BY slow;
+SELECT slow, general, master_heartbeat_period FROM slow ORDER BY slow;
+SELECT slow, master_heartbeat_period FROM slow ORDER BY slow;
+SELECT slow FROM slow ORDER BY slow;
+DROP TABLE slow;
+CREATE TABLE general (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
+INSERT INTO general(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
+INSERT INTO general(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
+INSERT INTO general(slow, general) VALUES (1,2), (5,6);
+INSERT INTO general(slow) VALUES (1), (5);
+SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM general ORDER BY slow;
+SELECT slow, general, master_heartbeat_period FROM general ORDER BY slow;
+SELECT slow, master_heartbeat_period FROM general ORDER BY slow;
+SELECT slow FROM general ORDER BY slow;
+DROP TABLE general;
+CREATE TABLE master_heartbeat_period (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
+INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
+INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
+INSERT INTO master_heartbeat_period(slow, general) VALUES (1,2), (5,6);
+INSERT INTO master_heartbeat_period(slow) VALUES (1), (5);
+SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM master_heartbeat_period ORDER BY slow;
+SELECT slow, general, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow;
+SELECT slow, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow;
+SELECT slow FROM master_heartbeat_period ORDER BY slow;
+DROP TABLE master_heartbeat_period;
+CREATE TABLE ignore_server_ids (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
+INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
+INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
+INSERT INTO ignore_server_ids(slow, general) VALUES (1,2), (5,6);
+INSERT INTO ignore_server_ids(slow) VALUES (1), (5);
+SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM ignore_server_ids ORDER BY slow;
+SELECT slow, general, master_heartbeat_period FROM ignore_server_ids ORDER BY slow;
+SELECT slow, master_heartbeat_period FROM ignore_server_ids ORDER BY slow;
+SELECT slow FROM ignore_server_ids ORDER BY slow;
+DROP TABLE ignore_server_ids;
+
+CREATE TABLE t1 (slow INT, general INT, ignore_server_ids INT, master_heartbeat_period INT);
+INSERT INTO t1 VALUES (1,2,3,4);
+DELIMITER |;
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE slow INT;
+ DECLARE general INT;
+ DECLARE ignore_server_ids INT;
+ DECLARE master_heartbeat_period INT;
+
+ SELECT max(t1.slow) INTO slow FROM t1;
+ SELECT max(t1.general) INTO general FROM t1;
+ SELECT max(t1.ignore_server_ids) INTO ignore_server_ids FROM t1;
+ SELECT max(t1.master_heartbeat_period) INTO master_heartbeat_period FROM t1;
+
+ SELECT slow, general, ignore_server_ids, master_heartbeat_period;
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+
+ DECLARE n INT DEFAULT 2;
+ general: WHILE n > 0 DO
+ SET n = n -1;
+ END WHILE general;
+
+ SET n = 2;
+ slow: WHILE n > 0 DO
+ SET n = n -1;
+ END WHILE slow;
+
+ SET n = 2;
+ ignore_server_ids: WHILE n > 0 DO
+ SET n = n -1;
+ END WHILE ignore_server_ids;
+
+ SET n = 2;
+ master_heartbeat_period: WHILE n > 0 DO
+ SET n = n -1;
+ END WHILE master_heartbeat_period;
+
+END|
+DELIMITER ;|
+CALL p1();
+call p2();
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TABLE t1;
diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test
index 4b40039ce45..4aa765caa8c 100644
--- a/mysql-test/t/kill.test
+++ b/mysql-test/t/kill.test
@@ -1,270 +1,284 @@
-# This test doesn't work with the embedded version as this code
-# assumes that one query is running while we are doing queries on
-# a second connection.
-# This would work if mysqltest run would be threaded and handle each
-# connection in a separate thread.
#
+# Test KILL and KILL QUERY statements.
+#
+# Killing a connection in an embedded server does not work like in a normal
+# server, if it is waiting for a new statement. In an embedded server, the
+# connection does not read() from a socket, but returns control to the
+# application. 'mysqltest' does not handle the kill request.
+#
+
-- source include/not_embedded.inc
+-- source include/have_debug_sync.inc
+-- source include/not_threadpool.inc
-# Disable concurrent inserts to avoid test failures when reading the
-# connection id which was inserted into a table by another thread.
-set @old_concurrent_insert= @@global.concurrent_insert;
-set @@global.concurrent_insert= 0;
+--disable_warnings
+SET DEBUG_SYNC = 'RESET';
+DROP TABLE IF EXISTS t1, t2, t3;
+DROP FUNCTION IF EXISTS MY_KILL;
+--enable_warnings
+
+delimiter |;
+# Helper function used to repeatedly kill a session.
+CREATE FUNCTION MY_KILL(tid INT) RETURNS INT
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ KILL tid;
+ RETURN (SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = tid);
+END|
+delimiter ;|
connect (con1, localhost, root,,);
connect (con2, localhost, root,,);
-#remember id of con1
+# Save id of con1
connection con1;
---disable_warnings
-drop table if exists t1, t2, t3;
---enable_warnings
-
--disable_reconnect
-create table t1 (kill_id int);
-insert into t1 values(connection_id());
+let $ID= `SELECT @id := CONNECTION_ID()`;
+connection con2;
+let $ignore= `SELECT @id := $ID`;
+connection con1;
+# Signal when this connection is terminating.
+SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
+# See if we can kill read().
+# Run into read() immediately after hitting 'before_do_command_net_read'.
+SET DEBUG_SYNC= 'before_do_command_net_read SIGNAL con1_read';
-#kill con1
+# Kill con1
connection con2;
-select ((@id := kill_id) - kill_id) from t1;
-kill @id;
+SET DEBUG_SYNC='now WAIT_FOR con1_read';
+# At this point we have no way to figure out, when con1 is blocked in
+# reading from the socket. Sending KILL to early would not terminate
+# con1. So we repeat KILL until con1 terminates.
+let $wait_condition= SELECT MY_KILL(@id);
+--source include/wait_condition.inc
+# If KILL missed the read(), sync point wait will time out.
+SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
+SET DEBUG_SYNC = 'RESET';
connection con1;
---sleep 2
-
---disable_query_log
---disable_result_log
-# One of the following statements should fail
---error 0,2006,2013
-select 1;
---error 0,2006,2013
-select 1;
---enable_query_log
---enable_result_log
+--error 1053,2006,2013
+SELECT 1;
--enable_reconnect
# this should work, and we should have a new connection_id()
-select ((@id := kill_id) - kill_id) from t1;
-select @id != connection_id();
+SELECT 1;
+let $ignore= `SELECT @id := $ID`;
+SELECT @id != CONNECTION_ID();
#make sure the server is still alive
connection con2;
-select 4;
-drop table t1;
+SELECT 4;
connection default;
--error ER_NOT_SUPPORTED_YET
-kill (select count(*) from mysql.user);
+KILL (SELECT COUNT(*) FROM mysql.user);
+
+connection con1;
+let $ID= `SELECT @id := CONNECTION_ID()`;
+connection con2;
+let $ignore= `SELECT @id := $ID`;
+connection con1;
+disable_reconnect;
+# Signal when this connection is terminating.
+SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
+# See if we can kill the sync point itself.
+# Wait in 'before_do_command_net_read' until killed.
+# It doesn't wait for a signal 'kill' but for to be killed.
+# The signal name doesn't matter here.
+SET DEBUG_SYNC= 'before_do_command_net_read SIGNAL con1_read WAIT_FOR kill';
+connection con2;
+SET DEBUG_SYNC= 'now WAIT_FOR con1_read';
+# Repeat KILL until con1 terminates.
+let $wait_condition= SELECT MY_KILL(@id);
+--source include/wait_condition.inc
+SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
+SET DEBUG_SYNC = 'RESET';
+
+connection con1;
+--error 1053,2006,2013
+SELECT 1;
+enable_reconnect;
+SELECT 1;
+let $ignore= `SELECT @id := $ID`;
+SELECT @id != CONNECTION_ID();
+connection con2;
+SELECT 4;
+connection default;
#
# BUG#14851: killing long running subquery processed via a temporary table.
#
-create table t1 (id int primary key);
-create table t2 (id int unsigned not null);
-connect (conn1, localhost, root,,);
-connection conn1;
-
--- disable_result_log
--- disable_query_log
-begin;
-let $1 = 4096;
-while ($1)
-{
- eval insert into t1 values ($1);
- dec $1;
-}
-commit;
--- enable_query_log
--- enable_result_log
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT);
+CREATE TABLE t2 (id INT UNSIGNED NOT NULL);
-insert into t2 select id from t1;
+INSERT INTO t1 VALUES
+(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0),
+(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0),
+(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0),
+(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0);
+INSERT t1 SELECT 0 FROM t1 AS a1, t1 AS a2 LIMIT 4032;
-create table t3 (kill_id int);
-insert into t3 values(connection_id());
+INSERT INTO t2 SELECT id FROM t1;
-connect (conn2, localhost, root,,);
-connection conn2;
+connection con1;
+let $ID= `SELECT @id := CONNECTION_ID()`;
+connection con2;
+let $ignore= `SELECT @id := $ID`;
-connection conn1;
--- disable_result_log
-# 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 con1;
+SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
+SET DEBUG_SYNC= 'before_acos_function SIGNAL in_sync';
+# 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 ACOS(1/a.id), b.id, c.id, d.id
+ HAVING a.id BETWEEN 10 AND 20);
-connection conn2;
-select ((@id := kill_id) - kill_id) from t3;
--- sleep 1
-kill @id;
+connection con2;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL @id;
+SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
-connection conn1;
--- error 1317,2013
+connection con1;
+--error 1317,1053,2006,2013
reap;
+SELECT 1;
connection default;
-
-drop table t1, t2, t3;
-
-# End of 4.1 tests
+SET DEBUG_SYNC = 'RESET';
+DROP TABLE t1, t2;
#
-# test of blocking of sending ERROR after OK or EOF
+# Test of blocking of sending ERROR after OK or EOF
#
connection con1;
-select get_lock("a", 10);
+let $ID= `SELECT @id := CONNECTION_ID()`;
connection con2;
-let $ID= `select connection_id()`;
-send select get_lock("a", 10);
-real_sleep 2;
+let $ignore= `SELECT @id := $ID`;
connection con1;
-disable_query_log;
-eval kill query $ID;
-enable_query_log;
+SET DEBUG_SYNC= 'before_acos_function SIGNAL in_sync WAIT_FOR kill';
+send SELECT ACOS(0);
connection con2;
-reap;
-select 1;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
connection con1;
-select RELEASE_LOCK("a");
+reap;
+SELECT 1;
+SELECT @id = CONNECTION_ID();
+connection default;
+SET DEBUG_SYNC = 'RESET';
#
# Bug#27563: Stored functions and triggers wasn't throwing an error when killed.
#
-create table t1(f1 int);
+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|
+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 DEBUG_SYNC= 'now SIGNAL in_sync WAIT_FOR kill';
+ RETURN 1;
+END|
delimiter ;|
# Test stored functions
# Test INSERT
connection con1;
-select get_lock("lock27563",10);
+let $ID= `SELECT @id := CONNECTION_ID()`;
connection con2;
-let $ID= `select connection_id()`;
-send insert into t1 values (bug27563());
-real_sleep 2;
+let $ignore= `SELECT @id := $ID`;
connection con1;
-disable_query_log;
-eval kill query $ID;
-enable_query_log;
+send INSERT INTO t1 VALUES (bug27563());
connection con2;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
+connection con1;
--error 1317
reap;
-select @a;
-connection con1;
-select * from t1;
+SELECT * FROM t1;
+connection default;
+SET DEBUG_SYNC = 'RESET';
# Test UPDATE
-insert into t1 values(0);
-connection con2;
-send update t1 set f1= bug27563();
-real_sleep 2;
+INSERT INTO t1 VALUES(0);
connection con1;
-disable_query_log;
-eval kill query $ID;
-enable_query_log;
+send UPDATE t1 SET f1= bug27563();
connection con2;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
+connection con1;
--error 1317
reap;
-select @a;
-connection con1;
-select * from t1;
+SELECT * FROM t1;
+connection default;
+SET DEBUG_SYNC = 'RESET';
# Test DELETE
-insert into t1 values(1);
-connection con2;
-send delete from t1 where bug27563() is null;
-real_sleep 2;
+INSERT INTO t1 VALUES(1);
connection con1;
-disable_query_log;
-eval kill query $ID;
-enable_query_log;
+send DELETE FROM t1 WHERE bug27563() IS NULL;
connection con2;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
+connection con1;
--error 1317
reap;
-select @a;
-connection con1;
-select * from t1;
+SELECT * FROM t1;
+connection default;
+SET DEBUG_SYNC = 'RESET';
# 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;
+send SELECT * FROM t1 WHERE f1= bug27563();
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;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
connection con1;
-disable_query_log;
-eval kill query $ID;
-enable_query_log;
-connection con2;
--error 1317
reap;
-select @a;
+SELECT * FROM t1;
+connection default;
+SET DEBUG_SYNC = 'RESET';
+DROP FUNCTION bug27563;
# Test TRIGGERS
-connection con2;
-create table t2 (f2 int);
+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|
+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';
+ INSERT INTO t2 VALUES(0);
+ SET DEBUG_SYNC= 'now SIGNAL in_sync WAIT_FOR kill';
+ 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;
+send INSERT INTO t1 VALUES(2),(3);
connection con2;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
+connection con1;
--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;
+SELECT * FROM t1;
+SELECT * FROM t2;
+connection default;
+SET DEBUG_SYNC = 'RESET';
+DROP TABLE t1, t2;
#
# Bug#28598: mysqld crash when killing a long-running explain query.
#
---disable_query_log
connection con1;
-let $ID= `select connection_id()`;
+let $ID= `SELECT @id := CONNECTION_ID()`;
+connection con2;
+let $ignore= `SELECT @id := $ID`;
+connection con1;
+--disable_query_log
let $tab_count= 40;
--disable_query_log
@@ -272,42 +286,48 @@ begin;
let $i= $tab_count;
while ($i)
{
- eval CREATE TABLE t$i (a$i int, KEY(a$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 ;
}
+
commit;
--enable_query_log
-set session optimizer_search_depth=0;
+
+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;
+ 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
+SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync';
eval PREPARE stmt FROM 'EXPLAIN SELECT * $from $where';
send EXECUTE stmt;
---disable_query_log
connection con2;
-real_sleep 2;
-eval kill query $ID;
+SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
+KILL QUERY @id;
+connection con1;
+--error 1317
+reap;
+--disable_query_log
let $i= $tab_count;
while ($i)
{
@@ -315,8 +335,8 @@ while ($i)
dec $i ;
}
--enable_query_log
-
-###########################################################################
+connection default;
+SET DEBUG_SYNC = 'RESET';
--echo #
--echo # Bug#19723: kill of active connection yields different error code
@@ -324,16 +344,27 @@ while ($i)
--echo #
--echo
---echo # Connection: con2.
---connection con2
-
-KILL CONNECTION_ID();
+--echo # Connection: con1.
+--connection con1
+let $ID= `SELECT @id := CONNECTION_ID()`;
+SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
+--disable_reconnect
+--error ER_QUERY_INTERRUPTED
+KILL @id;
---echo # CR_SERVER_LOST, CR_SERVER_GONE_ERROR, depending on the timing
---echo # of close of the connection socket
---error 2013, 2006
+connection con2;
+SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
+connection con1;
+--echo # ER_SERVER_SHUTDOWN, CR_SERVER_GONE_ERROR, CR_SERVER_LOST,
+--echo # depending on the timing of close of the connection socket
+--error 1053,2006,2013
+SELECT 1;
+--enable_reconnect
SELECT 1;
---connection default
+let $ignore= `SELECT @id := $ID`;
+SELECT @id != CONNECTION_ID();
+connection default;
+SET DEBUG_SYNC = 'RESET';
--echo #
--echo # Additional test for WL#3726 "DDL locking for all metadata objects"
@@ -495,28 +526,26 @@ connection ddl;
--echo # Switching to connection 'blocker'
connection blocker;
unlock tables;
-drop table t2;
-create table t2 (k int);
lock tables t1 read;
--echo # Switching to connection 'ddl'
connection ddl;
# Let us add pending exclusive metadata lock on t2
---send rename tables t1 to t3, t2 to t1
+--send truncate table t1
--echo # Switching to connection 'dml'
connection dml;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for table metadata lock" and
- info = "rename tables t1 to t3, t2 to t1";
+ info = "truncate table t1";
--source include/wait_condition.inc
let $ID2= `select connection_id()`;
---send insert into t2 values (1)
+--send insert into t1 values (1)
--echo # Switching to connection 'default'
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for table metadata lock" and
- info = "insert into t2 values (1)";
+ info = "insert into t1 values (1)";
--source include/wait_condition.inc
--replace_result $ID2 ID2
eval kill query $ID2;
@@ -570,10 +599,10 @@ connection ddl;
--echo # Cleanup.
--echo # Switching to connection 'default'
connection default;
-drop table t3;
drop table t1;
+drop table t2;
###########################################################################
-# Restore global concurrent_insert value. Keep in the end of the test file.
-set @@global.concurrent_insert= @old_concurrent_insert;
+SET DEBUG_SYNC = 'RESET';
+DROP FUNCTION MY_KILL;
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 03fc99f8500..f9181f91a89 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -603,5 +603,33 @@ DROP TABLE t1;
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/tmpp2.txt;
+--echo #
+--echo # Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
+--echo #
+
+CREATE TABLE t1(f1 INT);
+EVAL SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
+--disable_warnings
+LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
+--enable_warnings
+
+DROP TABLE t1;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/test/t1.dat;
+
+--echo #
+--echo # Bug#11765141 - 58072: LOAD DATA INFILE: LEAKS IO CACHE MEMORY
+--echo # WHEN ERROR OCCURS
+--echo #
+
+--let $file=$MYSQLTEST_VARDIR/tmp/bug11735141.txt
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--eval SELECT '1\n' INTO DUMPFILE '$file'
+
+create table t1(a point);
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--error ER_CANT_CREATE_GEOMETRY_OBJECT
+--eval LOAD DATA INFILE '$file' INTO TABLE t1
+drop table t1;
--echo End of 5.1 tests
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index 6bdb235903d..5bab5e647ab 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -228,7 +228,7 @@ connection writer;
# Sleep a bit till the flush of connection locker is in work and hangs
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global metadata lock" and
+ where state = "Waiting for global read lock" and
info = "FLUSH TABLES WITH READ LOCK";
--source include/wait_condition.inc
# This must not block.
@@ -260,7 +260,7 @@ connection writer;
# Sleep a bit till the flush of connection locker is in work and hangs
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global metadata lock" and
+ where state = "Waiting for global read lock" and
info = "FLUSH TABLES WITH READ LOCK";
--source include/wait_condition.inc
--error ER_TABLE_NOT_LOCKED
@@ -296,10 +296,11 @@ DROP DATABASE mysqltest_1;
# With bug in place: try to acquire LOCK_mysql_create_table...
# When fixed: Reject dropping db because of the read lock.
connection con1;
-# Wait a bit so that the session con2 is in state "Waiting for release of readlock"
+# Wait a bit so that the session con2 is in state
+# "Waiting for global read lock"
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for release of readlock"
+ where state = "Waiting for global read lock"
and info = "DROP DATABASE mysqltest_1";
--source include/wait_condition.inc
--error ER_CANT_UPDATE_WITH_READLOCK
@@ -376,7 +377,7 @@ connection con5;
--echo # con5
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global metadata lock" and
+ where state = "Waiting for global read lock" and
info = "flush tables with read lock";
--source include/wait_condition.inc
--echo # global read lock is taken
@@ -384,10 +385,11 @@ connection con3;
--echo # con3
send select * from t2 for update;
connection con5;
-let $show_statement= SHOW PROCESSLIST;
-let $field= State;
-let $condition= = 'Waiting for release of readlock';
---source include/wait_show_condition.inc
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for global read lock" and
+ info = "select * from t2 for update";
+--source include/wait_condition.inc
--echo # waiting for release of read lock
connection con4;
--echo # con4
@@ -433,10 +435,11 @@ connection con1;
send update t2 set a = 1;
connection default;
--echo # default
-let $show_statement= SHOW PROCESSLIST;
-let $field= State;
-let $condition= = 'Waiting for release of readlock';
---source include/wait_show_condition.inc
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for global read lock" and
+ info = "update t2 set a = 1";
+--source include/wait_condition.inc
--echo # statement is waiting for release of read lock
connection con2;
--echo # con2
@@ -460,10 +463,11 @@ connection con1;
send lock tables t2 write;
connection default;
--echo # default
-let $show_statement= SHOW PROCESSLIST;
-let $field= State;
-let $condition= = 'Waiting for release of readlock';
---source include/wait_show_condition.inc
+let $wait_condition=
+ select count(*) = 1 from information_schema.processlist
+ where state = "Waiting for global read lock" and
+ info = "lock tables t2 write";
+--source include/wait_condition.inc
--echo # statement is waiting for release of read lock
connection con2;
--echo # con2
@@ -571,7 +575,8 @@ connection default;
--echo connection: default
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global metadata lock";
+ where state = "Waiting for global read lock" and
+ info = "flush tables with read lock";
--source include/wait_condition.inc
alter table t1 add column j int;
connect (insert,localhost,root,,test,,);
@@ -579,14 +584,16 @@ connection insert;
--echo connection: insert
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global metadata lock";
+ where state = "Waiting for global read lock" and
+ info = "flush tables with read lock";
--source include/wait_condition.inc
--send insert into t1 values (1,2);
--echo connection: default
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for release of readlock";
+ where state = "Waiting for global read lock" and
+ info = "insert into t1 values (1,2)";
--source include/wait_condition.inc
unlock tables;
connection flush;
@@ -594,7 +601,8 @@ connection flush;
--reap
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for release of readlock";
+ where state = "Waiting for global read lock" and
+ info = "insert into t1 values (1,2)";
--source include/wait_condition.inc
select * from t1;
unlock tables;
@@ -629,12 +637,12 @@ connection default;
--echo connection: default
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global metadata lock";
+ where state = "Waiting for global read lock";
--source include/wait_condition.inc
flush tables;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global metadata lock";
+ where state = "Waiting for global read lock";
--source include/wait_condition.inc
unlock tables;
connection flush;
@@ -698,12 +706,12 @@ connection default;
--echo connection: default
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global metadata lock";
+ where state = "Waiting for global read lock";
--source include/wait_condition.inc
flush tables;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global metadata lock";
+ where state = "Waiting for global read lock";
--source include/wait_condition.inc
drop table t1;
connection flush;
diff --git a/mysql-test/t/lock_sync.test b/mysql-test/t/lock_sync.test
index 49f8f59ec5a..d5ad7becd7d 100644
--- a/mysql-test/t/lock_sync.test
+++ b/mysql-test/t/lock_sync.test
@@ -1023,6 +1023,120 @@ DROP EVENT e2;
SET DEBUG_SYNC="RESET";
+--echo #
+--echo # Bug#55930 Assertion `thd->transaction.stmt.is_empty() ||
+--echo # thd->in_sub_stmt || (thd->state..
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1(a INT) engine=InnoDB;
+INSERT INTO t1 VALUES (1), (2);
+
+connect (con1, localhost, root);
+connect (con2, localhost, root);
+
+--echo # Connection con1
+connection con1;
+SET SESSION lock_wait_timeout= 1;
+SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL opti_recreate WAIT_FOR opti_analyze';
+--echo # Sending:
+--send OPTIMIZE TABLE t1
+
+--echo # Connection con2
+connection con2;
+SET DEBUG_SYNC= 'now WAIT_FOR opti_recreate';
+SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL thrlock WAIT_FOR release_thrlock';
+--echo # Sending:
+--send INSERT INTO t1 VALUES (3)
+
+--echo # Connection default
+connection default;
+SET DEBUG_SYNC= 'now WAIT_FOR thrlock';
+SET DEBUG_SYNC= 'now SIGNAL opti_analyze';
+
+--echo # Connection con1
+connection con1;
+--echo # Reaping: OPTIMIZE TABLE t1
+--reap
+SET DEBUG_SYNC= 'now SIGNAL release_thrlock';
+disconnect con1;
+--source include/wait_until_disconnected.inc
+
+--echo # Connection con2
+connection con2;
+--echo # Reaping: INSERT INTO t1 VALUES (3)
+--reap
+disconnect con2;
+--source include/wait_until_disconnected.inc
+
+--echo # Connection default
+connection default;
+DROP TABLE t1;
+SET DEBUG_SYNC= 'RESET';
+
+
+--echo #
+--echo # Bug#57130 crash in Item_field::print during SHOW CREATE TABLE or VIEW
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP VIEW IF EXISTS v1;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+
+CREATE TABLE t1(a INT);
+CREATE FUNCTION f1() RETURNS INTEGER RETURN 1;
+CREATE VIEW v1 AS SELECT * FROM t1 WHERE f1() = 1;
+DROP FUNCTION f1;
+connect(con2, localhost, root);
+
+--echo # Connection con1
+connect (con1, localhost, root);
+# Need to trigger this sync point at least twice in order to
+# get valgrind test failures without the patch
+SET DEBUG_SYNC= 'open_tables_after_open_and_process_table SIGNAL opened WAIT_FOR dropped EXECUTE 2';
+--echo # Sending:
+--send SHOW CREATE VIEW v1
+
+--echo # Connection con2
+connection con2;
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+SET DEBUG_SYNC= 'now SIGNAL dropped';
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+--echo # Sending:
+--send FLUSH TABLES
+
+--echo # Connection default
+connection default;
+--echo # Waiting for FLUSH TABLES to be blocked.
+let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist
+ WHERE state= 'Waiting for table flush' AND info= 'FLUSH TABLES';
+--source include/wait_condition.inc
+SET DEBUG_SYNC= 'now SIGNAL dropped';
+
+--echo # Connection con1
+connection con1;
+--echo # Reaping: SHOW CREATE VIEW v1
+--reap
+
+--echo # Connection con2
+connection con2;
+--echo # Reaping: FLUSH TABLES
+--reap
+
+--echo # Connection default
+connection default;
+SET DEBUG_SYNC= 'RESET';
+DROP VIEW v1;
+DROP TABLE t1;
+disconnect con1;
+disconnect con2;
+
+
# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test
index 5275b8e7db3..5b6be217d9d 100644
--- a/mysql-test/t/log_tables.test
+++ b/mysql-test/t/log_tables.test
@@ -1034,6 +1034,25 @@ DROP TABLE t1;
TRUNCATE TABLE mysql.slow_log;
+#
+# Bug #47924 main.log_tables times out sporadically
+#
+
+use mysql;
+# Should result in error
+--disable_warnings
+drop table if exists renamed_general_log;
+drop table if exists renamed_slow_log;
+--enable_warnings
+--error ER_CANT_RENAME_LOG_TABLE
+RENAME TABLE general_log TO renamed_general_log;
+--error ER_CANT_RENAME_LOG_TABLE
+RENAME TABLE slow_log TO renamed_slow_log;
+
+use test;
+flush tables with read lock;
+unlock tables;
+
SET @@session.long_query_time= @old_long_query_time;
SET @@global.log_output= @old_log_output;
diff --git a/mysql-test/t/lowercase_fs_off.test b/mysql-test/t/lowercase_fs_off.test
index 86d1e084c29..1be0351f9bc 100644
--- a/mysql-test/t/lowercase_fs_off.test
+++ b/mysql-test/t/lowercase_fs_off.test
@@ -91,3 +91,14 @@ DROP DATABASE db1;
use test;
# End of 5.0 tests
+
+
+--echo #
+--echo # Extra test coverage for Bug#56595 RENAME TABLE causes assert on OS X
+--echo #
+
+CREATE TABLE t1(a INT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a= 1;
+RENAME TABLE t1 TO T1;
+ALTER TABLE T1 RENAME t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test
index d8aa4e97fb3..30433d15be4 100644
--- a/mysql-test/t/lowercase_table2.test
+++ b/mysql-test/t/lowercase_table2.test
@@ -151,6 +151,41 @@ where TABLE_SCHEMA ='mysqltest_LC2';
use test;
drop database mysqltest_LC2;
+
+--echo #
+--echo # Bug #11758687: 50924: object names not resolved correctly
+--echo # on lctn2 systems
+--echo #
+
+CREATE DATABASE BUP_XPFM_COMPAT_DB2;
+
+CREATE TABLE BUP_XPFM_COMPAT_DB2.TABLE2 (c13 INT) DEFAULT CHARSET latin1;
+CREATE TABLE BUP_XPFM_COMPAT_DB2.table1 (c13 INT) DEFAULT CHARSET latin1;
+CREATE TABLE bup_xpfm_compat_db2.table3 (c13 INT) DEFAULT CHARSET latin1;
+
+delimiter |;
+#
+CREATE TRIGGER BUP_XPFM_COMPAT_DB2.trigger1 AFTER INSERT
+ ON BUP_XPFM_COMPAT_DB2.table1 FOR EACH ROW
+ update BUP_XPFM_COMPAT_DB2.table1 set c13=12;
+|
+CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TRIGGER2 AFTER INSERT
+ ON BUP_XPFM_COMPAT_DB2.TABLE2 FOR EACH ROW
+ update BUP_XPFM_COMPAT_DB2.table1 set c13=12;
+|
+CREATE TRIGGER BUP_XPFM_COMPAT_DB2.TrigGer3 AFTER INSERT
+ ON BUP_XPFM_COMPAT_DB2.TaBle3 FOR EACH ROW
+ update BUP_XPFM_COMPAT_DB2.table1 set c13=12;
+|
+delimiter ;|
+
+SELECT trigger_schema, trigger_name, event_object_table FROM
+INFORMATION_SCHEMA.TRIGGERS
+ WHERE trigger_schema COLLATE utf8_bin = 'BUP_XPFM_COMPAT_DB2'
+ ORDER BY trigger_schema, trigger_name;
+
+DROP DATABASE BUP_XPFM_COMPAT_DB2;
+
--echo # End of 5.1 tests
diff --git a/mysql-test/t/lowercase_table4-master.opt b/mysql-test/t/lowercase_table4-master.opt
new file mode 100755
index 00000000000..c0a1981fa7c
--- /dev/null
+++ b/mysql-test/t/lowercase_table4-master.opt
@@ -0,0 +1 @@
+--lower-case-table-names=2
diff --git a/mysql-test/t/lowercase_table4.test b/mysql-test/t/lowercase_table4.test
new file mode 100755
index 00000000000..783a4fcae51
--- /dev/null
+++ b/mysql-test/t/lowercase_table4.test
@@ -0,0 +1,108 @@
+--source include/have_case_insensitive_file_system.inc
+--source include/have_innodb.inc
+
+--echo #
+--echo # Bug#46941 crash with lower_case_table_names=2 and
+--echo # foreign data dictionary confusion
+--echo #
+
+CREATE DATABASE XY;
+USE XY;
+
+#
+# Logs are disabled, since the number of creates tables
+# and subsequent select statements may vary between
+# versions
+#
+--disable_query_log
+--disable_result_log
+
+let $tcs = `SELECT @@table_open_cache + 1`;
+
+let $i = $tcs;
+
+while ($i)
+{
+ eval CREATE TABLE XY.T_$i (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT,
+ primary key(a, b), unique(b)) ENGINE=InnoDB;
+ dec $i;
+}
+
+eval ALTER TABLE XY.T_$tcs ADD INDEX I1 (c, b),
+ ADD CONSTRAINT C1 FOREIGN KEY (c, b) REFERENCES XY.T_1 (a, b);
+
+eval ALTER TABLE XY.T_$tcs ADD INDEX I2 (b),
+ ADD CONSTRAINT C2 FOREIGN KEY (b) REFERENCES XY.T_1(a);
+
+let $i = $tcs;
+while ($i)
+{
+ eval SELECT * FROM XY.T_$i LIMIT 1;
+ dec $i;
+}
+
+DROP DATABASE XY;
+CREATE DATABASE XY;
+USE XY;
+eval CREATE TABLE XY.T_$tcs (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT,
+ PRIMARY KEY(a, b), UNIQUE(b)) ENGINE=InnoDB;
+#
+# The bug causes this SELECT to err
+eval SELECT * FROM XY.T_$tcs LIMIT 1;
+
+--enable_query_log
+--enable_result_log
+DROP DATABASE XY;
+USE TEST;
+
+--echo #
+--echo # Bug55222 Mysqldump table names case bug in REFERENCES clause
+--echo # InnoDB did not handle lower_case_table_names=2 for
+--echo # foreign_table_names and referenced_table_names.
+--echo #
+
+SHOW VARIABLES LIKE 'lower_case_table_names';
+
+--disable_warnings
+DROP TABLE IF EXISTS `Table2`;
+DROP TABLE IF EXISTS `Table1`;
+--disable_warnings
+
+CREATE TABLE `Table1`(c1 INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE `Table2`(c1 INT PRIMARY KEY, c2 INT) ENGINE=InnoDB;
+ALTER TABLE `Table2` ADD CONSTRAINT fk1 FOREIGN KEY(c2) REFERENCES `Table1`(c1);
+query_vertical SHOW CREATE TABLE `Table2`;
+query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
+DROP TABLE `Table2`;
+DROP TABLE `Table1`;
+
+--disable_warnings
+DROP TABLE IF EXISTS Product_Order;
+DROP TABLE IF EXISTS Product;
+DROP TABLE IF EXISTS Customer;
+--enable_warnings
+
+CREATE TABLE Product (Category INT NOT NULL, Id INT NOT NULL,
+ Price DECIMAL, PRIMARY KEY(Category, Id)) ENGINE=InnoDB;
+CREATE TABLE Customer (Id INT NOT NULL, PRIMARY KEY (Id)) ENGINE=InnoDB;
+CREATE TABLE Product_Order (No INT NOT NULL AUTO_INCREMENT,
+ Product_Category INT NOT NULL,
+ Product_Id INT NOT NULL,
+ Customer_Id INT NOT NULL,
+ PRIMARY KEY(No),
+ INDEX (Product_Category, Product_Id),
+ FOREIGN KEY (Product_Category, Product_Id)
+ REFERENCES Product(Category, Id) ON UPDATE CASCADE ON DELETE RESTRICT,
+ INDEX (Customer_Id),
+ FOREIGN KEY (Customer_Id)
+ REFERENCES Customer(Id)
+ ) ENGINE=INNODB;
+
+query_vertical SHOW CREATE TABLE Product_Order;
+query_vertical SHOW CREATE TABLE Product;
+query_vertical SHOW CREATE TABLE Customer;
+query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS;
+DROP TABLE Product_Order;
+DROP TABLE Product;
+DROP TABLE Customer;
+
diff --git a/mysql-test/t/mdl_sync.test b/mysql-test/t/mdl_sync.test
index 55c04d7870b..197cad536e4 100644
--- a/mysql-test/t/mdl_sync.test
+++ b/mysql-test/t/mdl_sync.test
@@ -3661,7 +3661,7 @@ connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
--echo # Check that FLUSH must wait to get the GRL
--echo # and let CREATE PROCEDURE continue
-SET DEBUG_SYNC= 'wait_lock_global_read_lock SIGNAL grlwait';
+SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait';
--send FLUSH TABLES WITH READ LOCK
--echo # Connection 1
@@ -3689,15 +3689,22 @@ connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
--echo # Check that FLUSH must wait to get the GRL
--echo # and let DROP PROCEDURE continue
-SET DEBUG_SYNC= 'wait_lock_global_read_lock SIGNAL grlwait';
+SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait';
--send FLUSH TABLES WITH READ LOCK
--echo # Connection 1
connection default;
+--echo # Once FLUSH TABLES WITH READ LOCK starts waiting
+--echo # DROP PROCEDURE will be waked up and will drop
+--echo # procedure. Global read lock will be granted after
+--echo # this statement ends.
+--echo #
+--echo # Reaping DROP PROCEDURE.
--reap
--echo # Connection 2
connection con2;
+--echo # Reaping FTWRL.
--reap
UNLOCK TABLES;
@@ -3969,7 +3976,8 @@ INSERT INTO t1 VALUES (1),(2),(3);
--echo # Connection: con1
connection con1;
-SET debug_sync='lock_table_for_truncate SIGNAL parked_truncate WAIT_FOR go_truncate';
+LOCK TABLES t1 WRITE;
+SET debug_sync='upgrade_lock_for_truncate SIGNAL parked_truncate WAIT_FOR go_truncate';
send TRUNCATE TABLE t1;
connection default;
@@ -3994,15 +4002,17 @@ connection default;
--echo # Connection: default
SET debug_sync='now WAIT_FOR parked_flush';
SET debug_sync='now SIGNAL go_truncate';
+--echo # Ensure that truncate waits for a exclusive lock
+let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
+ WHERE state='Waiting for table metadata lock' AND info='TRUNCATE TABLE t1';
+--source include/wait_condition.inc
+SET debug_sync= 'now SIGNAL go_show';
connection con1;
---echo # Connection: con1
+--echo # Connection: con1 (TRUNCATE)
--echo # Reaping...
reap;
-
-connection default;
---echo # Connection: default
-SET debug_sync= 'now SIGNAL go_show';
+UNLOCK TABLES;
connection con2;
--echo # Connection: con2 (SHOW FIELDS FROM t1)
@@ -4482,7 +4492,7 @@ connection con2;
--echo # Connection default
connection default;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
- WHERE state='Waiting for release of readlock'
+ WHERE state='Waiting for global read lock'
AND info='CREATE TABLE db1.t2(a INT)';
--source include/wait_condition.inc
UNLOCK TABLES;
@@ -4504,7 +4514,7 @@ connection con2;
--echo # Connection default
connection default;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
- WHERE state='Waiting for release of readlock'
+ WHERE state='Waiting for global read lock'
AND info='ALTER DATABASE db1 DEFAULT CHARACTER SET utf8';
--source include/wait_condition.inc
UNLOCK TABLES;
@@ -4532,6 +4542,68 @@ disconnect con2;
disconnect con3;
+--echo #
+--echo # Bug#56292 Deadlock with ALTER TABLE and MERGE tables
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, m1;
+--enable_warnings
+
+CREATE TABLE t1(a INT) engine=MyISAM;
+CREATE TABLE t2(a INT) engine=MyISAM;
+CREATE TABLE m1(a INT) engine=MERGE UNION=(t1, t2);
+
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (3), (4);
+
+connect(con1, localhost, root);
+connect(con2, localhost, root);
+
+--echo # Connection con1
+connection con1;
+SET DEBUG_SYNC= 'mdl_upgrade_shared_lock_to_exclusive SIGNAL upgrade WAIT_FOR continue';
+--echo # Sending:
+--send ALTER TABLE m1 engine=MERGE UNION=(t2, t1)
+
+--echo # Connection con2
+connection con2;
+--echo # Waiting for ALTER TABLE to try lock upgrade
+SET DEBUG_SYNC= 'now WAIT_FOR upgrade';
+--echo # Sending:
+--send DELETE FROM t2 WHERE a = 3
+
+--echo # Connection default
+connection default;
+--echo # Check that DELETE is waiting on a metadata lock and not a table lock.
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM information_schema.processlist
+ WHERE state = "Waiting for table metadata lock" AND
+ info = "DELETE FROM t2 WHERE a = 3";
+--source include/wait_condition.inc
+--echo # Now that DELETE blocks on a metadata lock, we should be able to do
+--echo # SELECT * FROM m1 here. SELECT used to be blocked by a DELETE table
+--echo # lock request.
+SELECT * FROM m1;
+--echo # Resuming ALTER TABLE
+SET DEBUG_SYNC= 'now SIGNAL continue';
+
+--echo # Connection con1
+connection con1;
+--echo # Reaping: ALTER TABLE m1 engine=MERGE UNION=(t2, t1)
+--reap
+--echo # Connection con2
+connection con2;
+--echo # Reaping: DELETE FROM t2 WHERE a = 3
+--reap
+--echo # Connection default
+connection default;
+DROP TABLE m1, t1, t2;
+SET DEBUG_SYNC= 'RESET';
+disconnect con1;
+disconnect con2;
+
+
# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index c52adfedc65..e45813ff616 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -2,6 +2,9 @@
# Test of MERGE TABLES
#
+# Save the initial number of concurrent sessions.
+--source include/count_sessions.inc
+
# MERGE tables require MyISAM tables
let $default=`select @@global.storage_engine`;
set global storage_engine=myisam;
@@ -1757,6 +1760,84 @@ t2 WHERE b SOUNDS LIKE e AND d = 1;
DROP TABLE t2, t1;
+--echo #
+--echo # Bug#46339 - crash on REPAIR TABLE merge table USE_FRM
+--echo #
+--disable_warnings
+DROP TABLE IF EXISTS m1, t1;
+--enable_warnings
+#
+# Test derived from a proposal of Shane Bester.
+#
+CREATE TABLE t1 (c1 INT) ENGINE=MYISAM;
+CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1) INSERT_METHOD=LAST;
+#
+# REPAIR ... USE_FRM with LOCK TABLES.
+#
+LOCK TABLE m1 READ;
+REPAIR TABLE m1 USE_FRM;
+UNLOCK TABLES;
+#
+# REPAIR ... USE_FRM without LOCK TABLES.
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+DROP TABLE m1,t1;
+#
+# Test derived from a proposal of Matthias Leich.
+#
+# Base table is missing.
+#
+CREATE TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+# Create base table.
+#
+CREATE TABLE t1 (f1 BIGINT) ENGINE = MyISAM;
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+# Normal repair as reference.
+#
+REPAIR TABLE m1;
+#
+# Cleanup.
+#
+DROP TABLE m1, t1;
+#
+# Same with temporary tables.
+#
+# Base table is missing.
+#
+CREATE TEMPORARY TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+# Create base table.
+#
+CREATE TEMPORARY TABLE t1 (f1 BIGINT) ENGINE=MyISAM;
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+# Normal repair as reference.
+#
+REPAIR TABLE m1;
+#
+# Cleanup.
+#
+DROP TABLE m1, t1;
+
--echo End of 5.1 tests
--echo #
@@ -2545,7 +2626,7 @@ UNLOCK TABLES;
DROP TABLE m1, t1;
--echo #
---echo # If children are to be altered, they need an explicit lock.
+--echo # Locking the merge table won't implicitly lock children.
--echo #
CREATE TABLE t1 (c1 INT);
CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1);
@@ -2691,6 +2772,58 @@ drop view v1;
drop temporary table tmp;
drop table t1, t2, t3, m1, m2;
+
+--echo #
+--echo # Bug#56494 Segfault in upgrade_shared_lock_to_exclusive() for
+--echo # REPAIR of merge table
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, t_not_exists;
+--enable_warnings
+
+CREATE TABLE t1(a INT);
+ALTER TABLE t1 engine= MERGE UNION (t_not_exists);
+# This caused the segfault
+ANALYZE TABLE t1;
+CHECK TABLE t1;
+CHECKSUM TABLE t1;
+OPTIMIZE TABLE t1;
+REPAIR TABLE t1;
+
+# This caused an assert
+REPAIR TABLE t1 USE_FRM;
+
+DROP TABLE t1;
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT) engine= MERGE UNION (t1);
+# This caused an assert
+REPAIR TABLE t2 USE_FRM;
+
+DROP TABLE t1, t2;
+
+
+--echo #
+--echo # Bug#57002 Assert in upgrade_shared_lock_to_exclusive()
+--echo # for ALTER TABLE + MERGE tables
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, m1;
+--enable_warnings
+
+CREATE TABLE t1(a INT) engine=myisam;
+CREATE TABLE m1(a INT) engine=merge UNION(t1);
+LOCK TABLES t1 READ, m1 WRITE;
+
+# This caused an assert
+--error ER_TABLE_NOT_LOCKED_FOR_WRITE
+ALTER TABLE t1 engine=myisam;
+
+UNLOCK TABLES;
+DROP TABLE m1, t1;
+
+
--echo End of 6.0 tests
--disable_result_log
@@ -2698,3 +2831,7 @@ drop table t1, t2, t3, m1, m2;
eval set global storage_engine=$default;
--enable_result_log
--enable_query_log
+
+# Check that all connections opened by test cases in this file are really
+# gone so execution of other tests won't be affected by their presence.
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index a198fa59277..1af5f5fa423 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -676,4 +676,81 @@ SET t3.a = 0;
DROP TABLE t1, t2, t3;
SET SESSION sql_safe_updates = DEFAULT;
---echo end of tests
+--echo #
+--echo # Bug#52157 various crashes and assertions with multi-table update, stored function
+--echo #
+
+CREATE FUNCTION f1 () RETURNS BLOB RETURN 1;
+CREATE TABLE t1 (f1 DATE);
+INSERT INTO t1 VALUES('2001-01-01');
+UPDATE (SELECT 1 FROM t1 WHERE f1 = (SELECT f1() FROM t1)) x, t1 SET f1 = 1;
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+--echo #
+--echo # BUG#57373: Multi update+InnoDB reports ER_KEY_NOT_FOUND if a
+--echo # table is updated twice
+--echo #
+
+# Results differ between storage engines.
+# See multi_update_innodb.test for the InnoDB variant of this test
+CREATE TABLE t1(
+ pk INT,
+ a INT,
+ PRIMARY KEY (pk)
+) ENGINE=MyISAM;
+
+INSERT INTO t1 VALUES (0,0);
+UPDATE t1 AS A, t1 AS B SET A.pk = 1, B.a = 2;
+--echo
+--echo # Should be (1,2)
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # BUG#11882110: UPDATE REPORTS ER_KEY_NOT_FOUND IF TABLE IS
+--echo # UPDATED TWICE
+--echo #
+
+# Results differ between storage engines. This test is to verify that
+# the bugfix did NOT change behavior for MyISAM.
+# See multi_update_innodb.test for the InnoDB variant of this test
+CREATE TABLE t1 (
+ col_int_key int,
+ pk int,
+ col_int int,
+ key(col_int_key),
+ primary key (pk)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,2,3);
+
+--echo
+CREATE TABLE t2 (
+ col_int_key int,
+ pk_1 int,
+ pk_2 int,
+ col_int int,
+ key(col_int_key),
+ primary key (pk_1,pk_2)
+) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,2,3,4);
+
+--echo
+UPDATE t1 AS A NATURAL JOIN t1 B SET A.pk=5,B.pk=7;
+
+--echo
+SELECT * FROM t1;
+
+--echo
+UPDATE t2 AS A NATURAL JOIN t2 B SET A.pk_1=5,B.pk_1=7;
+--echo
+UPDATE t2 AS A NATURAL JOIN t2 B SET A.pk_2=10,B.pk_2=11;
+
+--echo
+SELECT * FROM t2;
+
+DROP TABLE t1,t2;
+
+
+
+
diff --git a/mysql-test/t/multi_update_innodb.test b/mysql-test/t/multi_update_innodb.test
new file mode 100644
index 00000000000..51757c29553
--- /dev/null
+++ b/mysql-test/t/multi_update_innodb.test
@@ -0,0 +1,77 @@
+--source include/have_innodb.inc
+
+--echo #
+--echo # BUG#57373: Multi update+InnoDB reports ER_KEY_NOT_FOUND if a
+--echo # table is updated twice
+--echo #
+
+# Results differ between storage engines.
+# See multi_update.test for the MyISAM variant of this test
+CREATE TABLE t1(
+ pk INT,
+ a INT,
+ b INT,
+ PRIMARY KEY (pk)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (0,0,0);
+--error ER_MULTI_UPDATE_KEY_CONFLICT
+UPDATE t1 AS A, t1 AS B SET A.pk = 1, B.a = 2;
+SELECT * FROM t1;
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+--error ER_MULTI_UPDATE_KEY_CONFLICT
+UPDATE v1 AS A, t1 AS B SET A.pk = 1, B.a = 2;
+SELECT * FROM t1;
+
+UPDATE t1 AS A, t1 AS B SET A.a = 1, B.b = 2;
+--echo # Should be (0,1,2)
+SELECT * FROM t1;
+
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo #
+--echo # BUG#11882110: UPDATE REPORTS ER_KEY_NOT_FOUND IF TABLE IS
+--echo # UPDATED TWICE
+--echo #
+
+# Results differ between storage engines.
+# See multi_update.test for the MyISAM variant of this test
+CREATE TABLE t1 (
+ col_int_key int,
+ pk int,
+ col_int int,
+ key(col_int_key),
+ primary key (pk)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,2,3);
+
+--echo
+CREATE TABLE t2 (
+ col_int_key int,
+ pk_1 int,
+ pk_2 int,
+ col_int int,
+ key(col_int_key),
+ primary key (pk_1,pk_2)
+) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1,2,3,4);
+
+--echo
+--error ER_MULTI_UPDATE_KEY_CONFLICT
+UPDATE t1 AS A NATURAL JOIN t1 B SET A.pk=5,B.pk=7;
+--echo
+SELECT * FROM t1;
+
+--echo
+--error ER_MULTI_UPDATE_KEY_CONFLICT
+UPDATE t2 AS A NATURAL JOIN t2 B SET A.pk_1=5,B.pk_1=7;
+--echo
+--error ER_MULTI_UPDATE_KEY_CONFLICT
+UPDATE t2 AS A NATURAL JOIN t2 B SET A.pk_2=10,B.pk_2=11;
+
+--echo
+SELECT * FROM t2;
+
+DROP TABLE t1,t2;
diff --git a/mysql-test/t/myisam_crash_before_flush_keys.test b/mysql-test/t/myisam_crash_before_flush_keys.test
index 0b0491098cd..a9f36f40d10 100644
--- a/mysql-test/t/myisam_crash_before_flush_keys.test
+++ b/mysql-test/t/myisam_crash_before_flush_keys.test
@@ -10,6 +10,8 @@
call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:");
call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table");
+# Avoid CrashReporter popup on Mac
+--source include/not_crashrep.inc
let $MYSQLD_DATADIR= `select @@datadir`;
SET GLOBAL delay_key_write=ALL;
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index c6c3ad42dcb..52d9b52b26e 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -426,5 +426,154 @@ drop table t1;
--echo
--exec $MYSQL --skip-column-names --vertical test -e "select 1 as a"
+#
+# Bug#57450: mysql client enter in an infinite loop if the standard input is a directory
+#
+--error 1
+--exec $MYSQL < .
+
+--echo
+
+--echo #
+--echo # Bug #54899: --one-database option cannot handle DROP/CREATE DATABASE
+--echo # commands.
+--echo #
+--write_file $MYSQLTEST_VARDIR/tmp/bug54899.sql
+DROP DATABASE connected_db;
+CREATE DATABASE connected_db;
+USE connected_db;
+CREATE TABLE `table_in_connected_db`(a INT);
+EOF
+
+CREATE DATABASE connected_db;
+--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/bug54899.sql
+USE connected_db;
+SHOW TABLES;
+DROP DATABASE connected_db;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug54899.sql
+
+--echo
+
+--echo #
+--echo # Testing --one-database option
+--echo #
+--write_file $MYSQLTEST_VARDIR/tmp/one_db.sql
+CREATE TABLE t1 (i INT);
+CREATE TABLE test.t1 (i INT);
+USE test;
+# Following statements should be filtered.
+CREATE TABLE connected_db.t2 (i INT);
+CREATE TABLE t2 (i INT);
+EOF
+
+CREATE DATABASE connected_db;
+--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/one_db.sql
+SHOW TABLES IN connected_db;
+SHOW TABLES IN test;
+USE test;
+DROP TABLE t1;
+DROP DATABASE connected_db;
+--remove_file $MYSQLTEST_VARDIR/tmp/one_db.sql
+
+--echo
+--write_file $MYSQLTEST_VARDIR/tmp/one_db.sql
+CREATE DATABASE test1;
+USE test1;
+USE test1;
+# Following statements should be filtered.
+CREATE TABLE connected_db.t1 (i INT);
+EOF
+
+--exec $MYSQL --one-database test < $MYSQLTEST_VARDIR/tmp/one_db.sql
+SHOW TABLES IN test;
+SHOW TABLES IN test1;
+DROP DATABASE test1;
+--remove_file $MYSQLTEST_VARDIR/tmp/one_db.sql
+
+--echo
+
+--echo #
+--echo # Checking --one-database option followed by the execution of
+--echo # connect command.
+--echo #
+--write_file $MYSQLTEST_VARDIR/tmp/one_db.sql
+CREATE TABLE t1 (i INT);
+CREATE TABLE test.t1 (i INT);
+CONNECT test;
+CREATE TABLE connected_db.t2 (i INT);
+CREATE TABLE t2 (i INT);
+USE connected_db;
+# Following statements should be filtered.
+CREATE TABLE connected_db.t3 (i INT);
+CREATE TABLE t3 (i INT);
+EOF
+
+CREATE DATABASE connected_db;
+--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/one_db.sql
+SHOW TABLES IN connected_db;
+SHOW TABLES IN test;
+DROP TABLE test.t1;
+DROP TABLE test.t2;
+DROP DATABASE connected_db;
+--remove_file $MYSQLTEST_VARDIR/tmp/one_db.sql
+
+--echo
+
+--echo #
+--echo # Checking --one-database option with no database specified
+--echo # at command-line.
+--echo #
+--write_file $MYSQLTEST_VARDIR/tmp/one_db.sql
+# All following statements should be filtered.
+CREATE TABLE t1 (i INT);
+CREATE TABLE test.t1 (i INT);
+USE test;
+CREATE TABLE test.t2 (i INT);
+CREATE TABLE t2 (i INT);
+EOF
+
+--exec $MYSQL --one-database < $MYSQLTEST_VARDIR/tmp/one_db.sql
+SHOW TABLES IN test;
+--remove_file $MYSQLTEST_VARDIR/tmp/one_db.sql
+
+--echo
+
+--echo #
+--echo # Checking --one-database option with non_existent_db
+--echo # specified with USE command
+--echo #
+
+# CASE 1 : When 'connected_db' database exists and passed at commandline.
+--write_file $MYSQLTEST_VARDIR/tmp/one_db_1.sql
+CREATE TABLE `table_in_connected_db`(i INT);
+USE non_existent_db;
+# Following statement should be filtered out.
+CREATE TABLE `table_in_non_existent_db`(i INT);
+EOF
+
+# CASE 2 : When 'connected_db' database exists but dropped and recreated in
+# load file.
+--write_file $MYSQLTEST_VARDIR/tmp/one_db_2.sql
+DROP DATABASE connected_db;
+CREATE DATABASE connected_db;
+USE non_existent_db;
+# Following statements should be filtered out.
+CREATE TABLE `table_in_non_existent_db`(i INT);
+USE connected_db;
+# Following statements should not be filtered out.
+CREATE TABLE `table_in_connected_db`(i INT);
+EOF
+
+CREATE DATABASE connected_db;
+--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/one_db_1.sql
+SHOW TABLES IN connected_db;
+--echo
+--exec $MYSQL --one-database connected_db < $MYSQLTEST_VARDIR/tmp/one_db_2.sql
+SHOW TABLES IN connected_db;
+DROP DATABASE connected_db;
+
+--remove_file $MYSQLTEST_VARDIR/tmp/one_db_1.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/one_db_2.sql
+
--echo
--echo End of tests
diff --git a/mysql-test/t/mysql_client_test-master.opt b/mysql-test/t/mysql_client_test-master.opt
index 4c683f7f0a2..3dfaf15666f 100644
--- a/mysql-test/t/mysql_client_test-master.opt
+++ b/mysql-test/t/mysql_client_test-master.opt
@@ -1 +1,4 @@
---log=$MYSQLTEST_VARDIR/log/master.log --log-output=FILE,TABLE
+--log=$MYSQLTEST_VARDIR/log/master.log
+--log-output=FILE,TABLE
+$PLUGIN_AUTH_OPT
+$PLUGIN_AUTH_LOAD
diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test
index 2c19671d11b..529d60517c0 100644
--- a/mysql-test/t/mysql_client_test.test
+++ b/mysql-test/t/mysql_client_test.test
@@ -1,5 +1,7 @@
# This test should work in embedded server after we fix mysqltest
-- source include/not_embedded.inc
+# need to have the dynamic loading turned on for the client plugin tests
+--source include/have_plugin_auth.inc
SET @old_general_log= @@global.general_log;
SET @old_slow_query_log= @@global.slow_query_log;
@@ -12,7 +14,7 @@ SET @old_slow_query_log= @@global.slow_query_log;
# var/log/mysql_client_test.trace
--exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
---exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
+--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M $PLUGIN_AUTH_CLIENT_OPT >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
# End of 4.1 tests
echo ok;
diff --git a/mysql-test/t/mysql_embedded.test b/mysql-test/t/mysql_embedded.test
new file mode 100644
index 00000000000..b4c8c6be05f
--- /dev/null
+++ b/mysql-test/t/mysql_embedded.test
@@ -0,0 +1,6 @@
+--echo #
+--echo # Bug#12561297 : LIBMYSQLD/EXAMPLE/MYSQL_EMBEDDED IS ABORTING.
+--echo #
+
+--source include/is_embedded.inc
+--exec $MYSQL_TEST_DIR/../libmysqld/examples/mysql_embedded -e 'select 1'
diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test
index eb59e60eefe..4811c5fdbc6 100644
--- a/mysql-test/t/mysqladmin.test
+++ b/mysql-test/t/mysqladmin.test
@@ -33,3 +33,29 @@ EOF
--exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf;
+
+--echo #
+--echo # Bug#58221 : mysqladmin --sleep=x --count=x keeps looping
+--echo #
+
+--echo # Executing mysqladmin with --sleep=1 and --count=2.
+--exec $MYSQLADMIN -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --sleep=1 --count=2 ping > $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp
+--echo # Done.
+--echo # Displaying the output :
+--cat_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp
+
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp
+
+--echo #
+--echo # BUG#11766184 - 59234: cmdline clients crash --defaults-extra-file
+--echo # with no .cnf or .ini extension.
+--echo #
+
+--echo # Creating an empty file 'cnf_file'
+--write_file $MYSQLTEST_VARDIR/tmp/cnf_file
+EOF
+
+--echo # Using --defaults-extra-file option with 'cnf_file'.
+--exec $MYSQLADMIN --defaults-extra-file=$MYSQLTEST_VARDIR/tmp/cnf_file -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT ping 2>&1
+
+--remove_file $MYSQLTEST_VARDIR/tmp/cnf_file
diff --git a/mysql-test/t/mysqlbinlog-master.opt b/mysql-test/t/mysqlbinlog-master.opt
index ac1a87c73b3..a9f4a6010d8 100644
--- a/mysql-test/t/mysqlbinlog-master.opt
+++ b/mysql-test/t/mysqlbinlog-master.opt
@@ -1 +1,2 @@
--max-binlog-size=4096
+--force-restart
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 3a9dae35476..f64d8b502ae 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -487,3 +487,63 @@ diff_files $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn $MYSQLTEST_VARDIR/tmp/mysqlbin
# Cleanup for this part of test
remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn.empty;
remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn;
+
+#
+# WL#5625: Deprecate mysqlbinlog options --base64-output=always and --base64-output
+#
+--echo # Expect deprecation warning.
+--exec $MYSQL_BINLOG --base64-output=always std_data/master-bin.000001 > /dev/null 2> $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
+--cat_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
+
+--echo # Expect deprecation warning again.
+--exec $MYSQL_BINLOG --base64-output std_data/master-bin.000001 > /dev/null 2> $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
+--cat_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
+
+# Clean up this part of the test.
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn
+
+# BUG#50914
+# This test verifies if the approach of the mysqlbinlog prints
+# "use $database" statements to its output stream will cause
+# "No Database Selected" error when dropping and recreating
+# that database.
+#
+RESET MASTER;
+CREATE DATABASE test1;
+USE test1;
+CREATE TABLE t1(id int);
+DROP DATABASE test1;
+CREATE DATABASE test1;
+USE test1;
+CREATE TABLE t1(id int);
+DROP TABLE t1;
+DROP DATABASE test1;
+let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
+FLUSH LOGS;
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+exec $MYSQL_BINLOG $MYSQLD_DATADIR/$master_binlog | $MYSQL test 2>&1;
+
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+source include/show_binlog_events.inc;
+
+#
+# BUG#11766427 BUG#59530: Filter by server id in mysqlbinlog fails
+# This test checks that the format description log event is not
+# filtered out by the --server-id option.
+#
+RESET MASTER;
+USE test;
+CREATE TABLE t1 (a INT);
+--let $old_server_id= `SELECT @@GLOBAL.SERVER_ID`
+SET GLOBAL SERVER_ID = 2;
+DROP TABLE t1;
+--let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+FLUSH LOGS;
+# The following should only create t1, not drop it.
+--exec $MYSQL_BINLOG --server-id=1 $MYSQLD_DATADIR/$master_binlog | $MYSQL
+SHOW TABLES IN test;
+# The following should only drop t1, not create it.
+--exec $MYSQL_BINLOG --server-id=2 $MYSQLD_DATADIR/$master_binlog | $MYSQL
+SHOW TABLES IN test;
+eval SET GLOBAL SERVER_ID = $old_server_id;
diff --git a/mysql-test/t/mysqlbinlog_base64.test b/mysql-test/t/mysqlbinlog_base64.test
index fb21e28fdcb..3d3444cea1c 100644
--- a/mysql-test/t/mysqlbinlog_base64.test
+++ b/mysql-test/t/mysqlbinlog_base64.test
@@ -71,3 +71,32 @@ select count(*) from t2;
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
drop table t1;
drop table t2;
+
+#
+# BUG#12354268
+#
+# This test verifies that using --start-position with DECODE-ROWS
+# does not make mysqlbinlog to output an error stating that it
+# does not contain any FD event.
+#
+
+RESET MASTER;
+USE test;
+SET @old_binlog_format= @@binlog_format;
+SET SESSION binlog_format=ROW;
+CREATE TABLE t1(c1 INT);
+--let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+--let $MYSQLD_DATADIR= `SELECT @@datadir`
+
+INSERT INTO t1 VALUES (1);
+
+FLUSH LOGS;
+
+--disable_result_log
+--exec $MYSQL_BINLOG --base64-output=DECODE-ROWS --start-position=$master_pos -v $MYSQLD_DATADIR/$master_binlog
+--enable_result_log
+
+DROP TABLE t1;
+SET SESSION binlog_format= @old_binlog_format;
+RESET MASTER;
diff --git a/mysql-test/t/mysqlbinlog_row_big.test b/mysql-test/t/mysqlbinlog_row_big.test
index 75f3b90269f..ffd1b79af34 100644
--- a/mysql-test/t/mysqlbinlog_row_big.test
+++ b/mysql-test/t/mysqlbinlog_row_big.test
@@ -79,8 +79,8 @@ eval CREATE TABLE t1 (
--echo # Insert some big rows.
--echo #
---echo 256MB
-INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 16777216));
+--echo 64MB
+INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 4194304));
--echo 32MB
INSERT INTO t1 VALUES (REPEAT('ManyMegaByteBlck', 2097152));
diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test
index 831aba72fb5..8f93ac7b864 100644
--- a/mysql-test/t/mysqlcheck.test
+++ b/mysql-test/t/mysqlcheck.test
@@ -2,6 +2,8 @@
# Embedded server doesn't support external clients
--source include/not_embedded.inc
+--source include/have_innodb.inc
+
# check that CSV engine was compiled in, as the result of the test
# depends on the presence of the log tables (which are CSV-based).
--source include/have_csv.inc
@@ -23,28 +25,33 @@ drop database if exists client_test_db;
# Bug #13783 mysqlcheck tries to optimize and analyze information_schema
#
--replace_result 'Table is already up to date' OK
---exec $MYSQL_CHECK --all-databases --analyze --optimize
+--exec $MYSQL_CHECK --all-databases --analyze
+--exec $MYSQL_CHECK --all-databases --optimize
--replace_result 'Table is already up to date' OK
---exec $MYSQL_CHECK --analyze --optimize --databases test information_schema mysql
---exec $MYSQL_CHECK --analyze --optimize information_schema schemata
+--exec $MYSQL_CHECK --analyze --databases test information_schema mysql
+--exec $MYSQL_CHECK --optimize --databases test information_schema mysql
+--exec $MYSQL_CHECK --analyze information_schema schemata
+--exec $MYSQL_CHECK --optimize information_schema schemata
#
# Bug #16502: mysqlcheck tries to check views
#
-create table t1 (a int);
+create table t1 (a int) engine=myisam;
create view v1 as select * from t1;
--replace_result 'Table is already up to date' OK
---exec $MYSQL_CHECK --analyze --optimize --databases test
+--exec $MYSQL_CHECK --analyze --databases test
+--exec $MYSQL_CHECK --optimize --databases test
--replace_result 'Table is already up to date' OK
---exec $MYSQL_CHECK --all-in-1 --analyze --optimize --databases test
+--exec $MYSQL_CHECK --all-in-1 --analyze --databases test
+--exec $MYSQL_CHECK --all-in-1 --optimize --databases test
drop view v1;
drop table t1;
#
# Bug #30654: mysqlcheck fails during upgrade of tables whose names include backticks
#
-create table `t``1`(a int);
-create table `t 1`(a int);
+create table `t``1`(a int) engine=myisam;
+create table `t 1`(a int) engine=myisam;
--replace_result 'Table is already up to date' OK
--exec $MYSQL_CHECK --databases test
drop table `t``1`, `t 1`;
@@ -54,7 +61,7 @@ drop table `t``1`, `t 1`;
#
create database d_bug25347;
use d_bug25347;
-create table t_bug25347 (a int);
+create table t_bug25347 (a int) engine=myisam;
create view v_bug25347 as select * from t_bug25347;
insert into t_bug25347 values (1),(2),(3);
flush tables;
@@ -86,8 +93,8 @@ drop view v1;
# Bug#37527: mysqlcheck fails to report entire database
# when frm file corruption
#
-CREATE TABLE t1(a INT);
-CREATE TABLE t2(a INT);
+CREATE TABLE t1(a INT) engine=myisam;
+CREATE TABLE t2(a INT) engine=myisam;
# backup then null t1.frm
--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t1.frm.bak
--remove_file $MYSQLD_DATADIR/test/t1.frm
@@ -107,13 +114,14 @@ DROP TABLE t1, t2;
#
# Bug #30679: 5.1 name encoding not performed for views during upgrade
#
-create table t1(a int);
+create table t1(a int) engine=myisam;
create view v1 as select * from t1;
show tables;
let $MYSQLD_DATADIR= `select @@datadir`;
--copy_file $MYSQLD_DATADIR/test/v1.frm $MYSQLD_DATADIR/test/v-1.frm
show tables;
---exec $MYSQL_CHECK --check-upgrade --fix-table-names --databases test
+--exec $MYSQL_CHECK --check-upgrade --databases test
+--exec $MYSQL_CHECK --fix-table-names --databases test
show tables;
drop view v1, `v-1`;
drop table t1;
@@ -125,7 +133,7 @@ drop table t1;
# triggers
#
SET NAMES utf8;
-CREATE TABLE `#mysql50#@` (a INT);
+CREATE TABLE `#mysql50#@` (a INT) engine=myisam;
SHOW TABLES;
SET NAMES DEFAULT;
--echo mysqlcheck --fix-table-names --databases test
@@ -134,7 +142,7 @@ SET NAMES utf8;
SHOW TABLES;
DROP TABLE `@`;
-CREATE TABLE `Ñ` (a INT);
+CREATE TABLE `Ñ` (a INT) engine=myisam;
SET NAMES DEFAULT;
--echo mysqlcheck --default-character-set="latin1" --databases test
# Error returned depends on platform, replace it with "Table doesn't exist"
@@ -148,8 +156,8 @@ SET NAMES DEFAULT;
CREATE DATABASE `#mysql50#a@b`;
USE `#mysql50#a@b`;
-CREATE TABLE `#mysql50#c@d` (a INT);
-CREATE TABLE t1 (a INT);
+CREATE TABLE `#mysql50#c@d` (a INT) engine=myisam;
+CREATE TABLE t1 (a INT) engine=myisam;
# Create 5.0 like triggers
let $MYSQLTEST_VARDIR= `select @@datadir`;
@@ -201,14 +209,105 @@ USE test;
drop table if exists `#mysql50#t1-1`;
--enable_warnings
-create table `#mysql50#t1-1` (a int);
+create table `#mysql50#t1-1` (a int) engine=myisam;
--exec $MYSQL_CHECK --all-in-1 --fix-table-names --databases test
show tables like 't1-1';
drop table `t1-1`;
-create table `#mysql50#t1-1` (a int);
+create table `#mysql50#t1-1` (a int) engine=myisam;
--exec $MYSQL_CHECK --all-in-1 --fix-table-names test "#mysql50#t1-1"
show tables like 't1-1';
drop table `t1-1`;
--echo End of 5.1 tests
+
+
+--echo #
+--echo # Bug #35269: mysqlcheck behaves different depending on order of parameters
+--echo #
+
+--error 13
+--exec $MYSQL_CHECK -a --fix-table-names test "#mysql50#t1-1"
+--error 1
+--exec $MYSQL_CHECK -aoc test "#mysql50#t1-1"
+
+
+--echo #
+--echo # Bug#11755431 47205: MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR
+--echo # ENGINES NOT SUPPORTING NATIVE
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS bug47205;
+--enable_warnings
+
+--echo #
+--echo # Test 1: Check that ALTER TABLE ... rebuilds the table
+
+CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY)
+ DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb;
+
+INSERT INTO bug47205 VALUES ("foobar");
+FLUSH TABLE bug47205;
+
+--echo # Replace the FRM with a 5.0 FRM that will require upgrade
+let $MYSQLD_DATADIR= `select @@datadir`;
+--remove_file $MYSQLD_DATADIR/test/bug47205.frm
+--copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm
+
+--echo # Should indicate that ALTER TABLE ... FORCE is needed
+CHECK TABLE bug47205 FOR UPGRADE;
+
+--echo # ALTER TABLE ... FORCE should rebuild the table
+--echo # and therefore output "affected rows: 1"
+--enable_info
+ALTER TABLE bug47205 FORCE;
+--disable_info
+
+--echo # Table should now be ok
+CHECK TABLE bug47205 FOR UPGRADE;
+
+DROP TABLE bug47205;
+
+--echo #
+--echo # Test 2: InnoDB - REPAIR not supported
+
+CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY)
+ DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb;
+
+FLUSH TABLE bug47205;
+
+--echo # Replace the FRM with a 5.0 FRM that will require upgrade
+let $MYSQLD_DATADIR= `select @@datadir`;
+--remove_file $MYSQLD_DATADIR/test/bug47205.frm
+--copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm
+
+--echo # Should indicate that ALTER TABLE .. FORCE is needed
+CHECK TABLE bug47205 FOR UPGRADE;
+
+--echo # Running mysqlcheck to check and upgrade
+--exec $MYSQL_CHECK --check-upgrade --auto-repair test
+
+--echo # Table should now be ok
+CHECK TABLE bug47205 FOR UPGRADE;
+
+DROP TABLE bug47205;
+
+--echo #
+--echo # Test 3: MyISAM - REPAIR supported
+
+--echo # Use an old FRM that will require upgrade
+--copy_file std_data/bug36055.frm $MYSQLD_DATADIR/test/bug47205.frm
+--copy_file std_data/bug36055.MYD $MYSQLD_DATADIR/test/bug47205.MYD
+--copy_file std_data/bug36055.MYI $MYSQLD_DATADIR/test/bug47205.MYI
+
+--echo # Should indicate that REPAIR TABLE is needed
+CHECK TABLE bug47205 FOR UPGRADE;
+
+--echo # Running mysqlcheck to check and upgrade
+--exec $MYSQL_CHECK --check-upgrade --auto-repair test
+
+--echo # Table should now be ok
+CHECK TABLE bug47205 FOR UPGRADE;
+
+DROP TABLE bug47205;
diff --git a/mysql-test/t/mysqld--defaults-file.test b/mysql-test/t/mysqld--defaults-file.test
new file mode 100644
index 00000000000..065436c38aa
--- /dev/null
+++ b/mysql-test/t/mysqld--defaults-file.test
@@ -0,0 +1,47 @@
+# BUG#58455
+# Starting mysqld with defaults file without extension cause
+# segmentation fault
+
+source include/not_embedded.inc;
+source include/not_windows.inc;
+
+# We need to use a plain "mysqld" without any other options to trigger
+# the bug. In particular, it seems that passing --bootstrap does not
+# trigger the bug. To do that, we extract the "command name" from the
+# MYSQLD_BOOTSTRAP_CMD variable and store that in a file, which we
+# then load into the test case.
+
+perl;
+ my ($mysqld)= split " ", $ENV{MYSQLD_BOOTSTRAP_CMD};
+ open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/mysqld.inc") or die;
+ print FILE "let \$MYSQLD= $mysqld;\n";
+ close FILE;
+EOF
+
+source $MYSQL_TMP_DIR/mysqld.inc;
+
+# All these tests refer to configuration files that do not exist
+
+--error 1
+exec $MYSQLD --defaults-file=/path/with/no/extension --print-defaults 2>&1;
+
+--error 1
+exec $MYSQLD --defaults-file=/path/with.ext --print-defaults 2>&1;
+
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--error 1
+exec $MYSQLD --defaults-file=relative/path/with.ext --print-defaults 2>&1;
+
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--error 1
+exec $MYSQLD --defaults-file=relative/path/without/extension --print-defaults 2>&1;
+
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--error 1
+exec $MYSQLD --defaults-file=with.ext --print-defaults 2>&1;
+
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--error 1
+exec $MYSQLD --defaults-file=no_extension --print-defaults 2>&1;
+
+remove_file $MYSQL_TMP_DIR/mysqld.inc;
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index d0168e3d166..3d0e2d47617 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -2172,9 +2172,51 @@ SELECT LENGTH(a) FROM t2;
DROP TABLE t1, t2;
###########################################################################
+
+--echo #
+--echo # Bug #13618 : mysqldump --xml ommit comment on table field
+--echo #
+
+CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT';
+--exec $MYSQL_DUMP --compact --skip-create --xml test
+DROP TABLE `comment_table`;
+
+--echo #
+--echo # BUG#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH ("-") IN
+--echo # DATABASE NAMES IN ALTER DATABASE
+--echo #
+
+CREATE DATABASE `test-database`;
+USE `test-database`;
+CREATE TABLE `test` (`c1` VARCHAR(10)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+
+DELIMITER |;
+CREATE TRIGGER `trig` BEFORE INSERT ON `test` FOR EACH ROW BEGIN
+END |
+DELIMITER ;|
+
+ALTER DATABASE `test-database` CHARACTER SET latin1 COLLATE latin1_swedish_ci;
+ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+
+--exec $MYSQL_DUMP --quote-names --compact test-database
+
+DROP DATABASE `test-database`;
+# Switching back to test database.
+USE test;
+
--echo #
--echo # End of 5.1 tests
--echo #
+--echo #
+--echo # Verify that two modes can be given in --compatible;
+--echo # and are reflected in SET SQL_MODE in the mysqldump output.
+--echo # Also verify that a prefix of the mode's name is enough.
+--echo #
+CREATE TABLE t1 (a INT);
+# no_t = no_table_options; no_f = no_field_options
+--exec $MYSQL_DUMP --compatible=no_t,no_f --skip-comments test
+DROP TABLE t1;
+
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/mysqlshow.test b/mysql-test/t/mysqlshow.test
index 06ba562ac49..105e03c841b 100644
--- a/mysql-test/t/mysqlshow.test
+++ b/mysql-test/t/mysqlshow.test
@@ -2,6 +2,8 @@
-- source include/not_embedded.inc
# Test lists tables in Information_schema, and InnoDB adds some
-- source include/have_innodb.inc
+# Don't test when thread_pool active
+--source include/not_threadpool.inc
--disable_warnings
DROP TABLE IF EXISTS t1,t2,test1,test2;
diff --git a/mysql-test/t/mysqlslap.test b/mysql-test/t/mysqlslap.test
index 28042f62fe6..757d2813483 100644
--- a/mysql-test/t/mysqlslap.test
+++ b/mysql-test/t/mysqlslap.test
@@ -53,3 +53,18 @@ CREATE PROCEDURE p1() SELECT 1;
--exec $MYSQL_SLAP --create-schema=test --delimiter=";" --query="CALL p1; SELECT 1;" --silent 2>&1
DROP PROCEDURE p1;
+
+
+--echo #
+--echo # Bug #11765157 - 58090: mysqlslap drops schema specified in
+--echo # create_schema if auto-generate-sql also set.
+--echo #
+
+--exec $MYSQL_SLAP --silent --create-schema=bug58090 --concurrency=5 --iterations=20 --auto-generate-sql
+--echo # 'bug58090' database should not be present.
+SHOW DATABASES;
+--exec $MYSQL_SLAP --silent --create-schema=bug58090 --no-drop --auto-generate-sql
+--echo # 'bug58090' database should be present.
+SHOW DATABASES;
+DROP DATABASE bug58090;
+
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index ca19de75d4b..6f12c6d4d11 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -339,7 +339,7 @@ eval select $mysql_errno as "after_!errno_masked_error" ;
--exec illegal_command
--cat_file does_not_exist
--perl
- exit(1);
+ exit(2);
EOF
# ----------------------------------------------------------------------------
@@ -862,6 +862,19 @@ let $var2= `failing query`;
echo $var2;
EOF
+create table t1 (a varchar(100));
+insert into t1 values ('`select 42`');
+let $a= `select * from t1`;
+# This should output `select 42`, not evaluate it again to 42
+echo $a;
+insert into t1 values ('$dollar');
+# These should also output the string without evaluating it.
+let $a= query_get_value(select * from t1 order by a, a, 1);
+echo $a;
+let $a= query_get_value(select * from t1 order by a, a, 2);
+echo $a;
+drop table t1;
+
--error 1
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/let.sql 2>&1
@@ -1014,16 +1027,13 @@ EOF
# ----------------------------------------------------------------------------
# Test inc
# ----------------------------------------------------------------------------
-inc $i;
-echo $i;
+let $i= 0;
inc $i;
echo $i;
let $i=100;
inc $i;
echo $i;
-
-let $i=hej;
-echo $i;
+let $i= -100;
inc $i;
echo $i;
@@ -1032,7 +1042,13 @@ echo $i;
--error 1
--exec echo "inc i;" | $MYSQL_TEST 2>&1
--error 1
+--exec echo "inc \$i;" | $MYSQL_TEST 2>&1
+--error 1
--exec echo "let \$i=100; inc \$i 1000; echo \$i;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "let \$i=text; inc \$i; echo \$i;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "let \$i=10cc; inc \$i; echo \$i;" | $MYSQL_TEST 2>&1
inc $i; inc $i; inc $i; --echo $i
echo $i;
@@ -1042,25 +1058,25 @@ echo $i;
# Test dec
# ----------------------------------------------------------------------------
-dec $d;
-echo $d;
+let $d= 0;
dec $d;
echo $d;
let $d=100;
dec $d;
echo $d;
-let $d=hej;
-echo $d;
-dec $d;
-echo $d;
-
--error 1
--exec echo "dec;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "dec i;" | $MYSQL_TEST 2>&1
--error 1
+--exec echo "dec \$i;" | $MYSQL_TEST 2>&1
+--error 1
--exec echo "let \$i=100; dec \$i 1000; echo \$i;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "let \$i=text; dec \$i; echo \$i;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "let \$i=10cc; dec \$i; echo \$i;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
@@ -1139,6 +1155,11 @@ if (!$counter)
{
echo Counter is not 0, (counter=10);
}
+if (! $counter)
+{
+ let $counter=5;
+}
+echo Counter should still be 10, is $counter;
let $counter=0;
if($counter)
{
@@ -1148,6 +1169,10 @@ if (!$counter)
{
echo Counter is not 0, (counter=0);
}
+if (! $counter)
+{
+ echo Not space var works;
+}
# ----------------------------------------------------------------------------
# Test if with some non-numerics
@@ -1168,10 +1193,11 @@ if ($counter)
{
echo oops, -0 is true;
}
-if (beta)
-{
- echo Beta is true;
-}
+# This is no longer allowed, as a precaution against mistyped conditionals
+# if (beta)
+# {
+# echo Beta is true;
+# }
let $counter=gamma;
while ($counter)
{
@@ -1180,6 +1206,196 @@ while ($counter)
}
# ----------------------------------------------------------------------------
+# Test if with compare conditions
+# ----------------------------------------------------------------------------
+
+let $ifvar= 5;
+let $ifvar2= 6;
+
+if ($ifvar < 7)
+{
+ echo 5<7;
+}
+if ($ifvar< 7)
+{
+ echo 5<7 again;
+}
+if ($ifvar<7)
+{
+ echo 5<7 still;
+}
+if ($ifvar < $ifvar2)
+{
+ echo 5<6;
+}
+if ($ifvar <= 4)
+{
+ echo 5<=4;
+}
+if ($ifvar >= 5)
+{
+ echo 5>=5;
+}
+if ($ifvar>=5)
+{
+ echo 5>=5 again;
+}
+if ($ifvar > 3)
+{
+ echo 5>3;
+}
+if ($ifvar == 4)
+{
+ echo 5==4;
+}
+if ($ifvar == 5)
+{
+ echo 5==5;
+}
+if ($ifvar != 8)
+{
+ echo 5!=8;
+}
+# Any number should compare unequal to any string
+if ($ifvar != five)
+{
+ echo 5!=five;
+}
+if ($ifvar == `SELECT 3+2`)
+{
+ echo 5==3+2;
+}
+if ($ifvar == 5)
+{
+ echo 5 == 5;
+}
+let $ifvar= hello;
+if ($ifvar == hello there)
+{
+ echo hello == hello there;
+}
+if ($ifvar == hello)
+{
+ echo hello == hello;
+}
+if ($ifvar == hell)
+{
+ echo hello == hell;
+}
+if ($ifvar == hello)
+{
+ echo hello == hello;
+}
+if ($ifvar != goodbye)
+{
+ echo hello != goodbye;
+}
+let $ifvar= 'quoted';
+if ($ifvar == ''quoted'')
+{
+ echo 'quoted' == ''quoted'';
+}
+let $ifvar= two words;
+if ($ifvar == two words)
+{
+ echo two words;
+}
+if ($ifvar == 'two words')
+{
+ echo 'two words';
+}
+if ($ifvar == "two words")
+{
+ echo "two words";
+}
+if ($ifvar == `SELECT 'two words'`)
+{
+ echo two words are two words;
+}
+if (42)
+{
+ echo right answer;
+}
+if (0)
+{
+ echo wrong answer;
+}
+# Non-empty string treated as 'true'
+if (`SELECT 'something'`)
+{
+ echo anything goes;
+}
+# Make sure 0 and string compare right
+let $ifvar= 0;
+if ($ifvar == string)
+{
+ echo 0 == string;
+}
+if ($ifvar != string)
+{
+ echo 0 != string;
+}
+--write_file $MYSQL_TMP_DIR/mysqltest.sql
+let $var= 5;
+if ($var >= four)
+{
+ echo 5>=four;
+}
+EOF
+--error 1
+--exec $MYSQL_TEST < $MYSQL_TMP_DIR/mysqltest.sql 2>&1
+remove_file $MYSQL_TMP_DIR/mysqltest.sql;
+
+--write_file $MYSQL_TMP_DIR/mysqltest.sql
+let $var= 5;
+if ($var ~= 6)
+{
+ echo 5~=6;
+}
+EOF
+--error 1
+--exec $MYSQL_TEST < $MYSQL_TMP_DIR/mysqltest.sql 2>&1
+remove_file $MYSQL_TMP_DIR/mysqltest.sql;
+
+--write_file $MYSQL_TMP_DIR/mysqltest.sql
+let $var= text;
+if (var == text)
+{
+ echo Oops I forgot the $;
+}
+EOF
+--error 1
+--exec $MYSQL_TEST < $MYSQL_TMP_DIR/mysqltest.sql 2>&1
+remove_file $MYSQL_TMP_DIR/mysqltest.sql;
+
+--error 1
+--exec echo "if (\$var ==) {" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "if (\$var > ) {" | $MYSQL_TEST 2>&1
+
+# ----------------------------------------------------------------------------
+# Test while with compare conditions
+# ----------------------------------------------------------------------------
+
+let $counter= 2;
+
+while ($counter < 5)
+{
+ echo counter is $counter;
+ inc $counter;
+}
+let $ifvar=;
+while ($ifvar != stop)
+{
+ if ($counter >= 7)
+ {
+ let $ifvar= stop;
+ }
+ echo counter is $counter;
+ inc $counter;
+}
+
+# ----------------------------------------------------------------------------
# Test while, { and }
# ----------------------------------------------------------------------------
@@ -1932,6 +2148,7 @@ EOF
cat_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
+--replace_regex /my_errno=[0-9]*/(my_errno)/
--error 1
--exec echo "cat_file non_existing_file;" | $MYSQL_TEST 2>&1
@@ -2451,15 +2668,15 @@ let $count= 0;
while ($run)
{
let $Field= query_get_value($show_statement, Field, $rowno);
- if (`SELECT '$Field' = 'No such row'`)
+ if ($Field == No such row)
{
let $run= 0;
}
- if (`SELECT '$Field' <> 'No such row'`)
+ if ($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'`)
+ if ($Null == YES)
{
inc $count;
}
@@ -2512,6 +2729,8 @@ write_file $MYSQLTEST_VARDIR/tmp/testdir/file1.txt;
hello
EOF
+# Verify that --replace_result also work on list_files
+--replace_result file REPLACED_FILE
list_files $MYSQLTEST_VARDIR/tmp/testdir;
# list_files gets the directory list before creating the new file
list_files_write_file $MYSQLTEST_VARDIR/tmp/testdir/file2.txt $MYSQLTEST_VARDIR/tmp/testdir *;
@@ -2542,26 +2761,6 @@ rmdir $MYSQLTEST_VARDIR/tmp/testdir;
--replace_result c:\\a.txt z
SELECT 'c:\\a.txt' AS col;
-#
-# Bug#32307 mysqltest - does not detect illegal if syntax
-#
-
-let $test= 1;
-if ($test){
- echo hej;
-}
-
---write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
-if ($mysql_errno != 1436)
-{
- echo ^ Should not be allowed!
-}
-EOF
---error 1
---exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
-remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
-
-
# ----------------------------------------------------------------------------
# Test that -- is not allowed as comment, only as mysqltest builtin command
# ----------------------------------------------------------------------------
diff --git a/mysql-test/t/named_pipe.test b/mysql-test/t/named_pipe.test
index e88fd8e1ef8..23a11d61222 100644
--- a/mysql-test/t/named_pipe.test
+++ b/mysql-test/t/named_pipe.test
@@ -3,9 +3,12 @@
# other platforms
--source include/windows.inc
+# thread pool causes different results
+-- source include/not_threadpool.inc
+
# Only run this test if named pipe is avaliable
let $nmp= query_get_value("SHOW VARIABLES LIKE 'named_pipe'", Value, 1);
-if (`SELECT '$nmp' != 'ON'`){
+if ($nmp != ON){
skip No named pipe support;
}
diff --git a/mysql-test/t/no-threads.test b/mysql-test/t/no-threads.test
index fd8365e5678..c2b326897f8 100644
--- a/mysql-test/t/no-threads.test
+++ b/mysql-test/t/no-threads.test
@@ -1,3 +1,4 @@
+--source include/not_threadpool.inc
#
# Test the --thread-handler=no-threads option
#
diff --git a/mysql-test/t/not_embedded_server.test b/mysql-test/t/not_embedded_server.test
index f8de1504225..5b99c37ee29 100644
--- a/mysql-test/t/not_embedded_server.test
+++ b/mysql-test/t/not_embedded_server.test
@@ -4,31 +4,7 @@
-- source include/not_embedded.inc
-# The following fails sporadically because 'check-testcase' runs
-# queries before this test and there is no way to guarantee that any
-# previous process finishes. The purpose of the test is not clearly
-# stated, there is no reference to any bug report, and "select from
-# I_S from prepared statement" doesn't look like something that's
-# really imporant to test. I'm commenting out this for now. If
-# anyone wants to keep this, please fix the race and motivate why we
-# need to test this. If you see this comment and it is after mid-2009
-# or so, feel free to remove this test from the file. /Sven
-#
-#
-## Show full process list with prepare
-## To not show other connections, this must be the first test and we must
-## have a server restart before this one
-##
-## We don't have any 4.1 tests as we use I_S to query the PROCESSLIST to
-## exclude system threads that may/may not be active in the server
-## (namely the ndb injector thread)
-##
-## End of 4.1 tests
-#
-#prepare stmt1 from ' SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!=\'Daemon\' ';
-#--replace_column 1 number 6 time 3 localhost 9 time_ms
-#execute stmt1;
-#deallocate prepare stmt1;
+# End of 4.1 tests
call mtr.add_suppression("Can't open and lock privilege tables: Table 'host' was not locked with LOCK TABLES");
@@ -38,6 +14,16 @@ call mtr.add_suppression("Can't open and lock privilege tables: Table 'host' was
SHOW VARIABLES like 'slave_skip_errors';
+--echo #
+--echo # Bug#58026: massive recursion and crash in regular expression handling
+--echo #
+
+--disable_result_log
+--error ER_STACK_OVERRUN_NEED_MORE
+SELECT '1' RLIKE RPAD('1', 10000, '(');
+--enable_result_log
+
+
# End of 5.1 tests
--echo #
@@ -46,11 +32,75 @@ SHOW VARIABLES like 'slave_skip_errors';
--echo # FLUSH PRIVILEGES should not implicitly unlock locked tables.
--echo #
--disable_warnings
-drop table if exists t1;
+DROP TABLE IF EXISTS t1;
--enable_warnings
-create table t1 (c1 int);
-lock tables t1 read;
+CREATE TABLE t1 (c1 INT);
+LOCK TABLES t1 READ;
--error ER_TABLE_NOT_LOCKED
-flush privileges;
-unlock tables;
-drop table t1;
+FLUSH PRIVILEGES;
+UNLOCK TABLES;
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN
+--echo #
+
+CREATE USER nopriv_user@localhost;
+
+connection default;
+--echo connection: default
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3;
+DROP FUNCTION IF EXISTS f;
+--enable_warnings
+
+CREATE TABLE t1 (key1 INT PRIMARY KEY);
+CREATE TABLE t2 (key2 INT);
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE FUNCTION f() RETURNS INT RETURN 1;
+
+GRANT FILE ON *.* TO 'nopriv_user'@'localhost';
+
+FLUSH PRIVILEGES;
+
+connect (con1,localhost,nopriv_user,,);
+connection con1;
+--echo connection: con1
+
+let outfile=$MYSQLTEST_VARDIR/tmp/mytest;
+--error 0,1
+--remove_file $outfile
+--replace_result $outfile <outfile>
+--error ER_PROCACCESS_DENIED_ERROR
+eval SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE '$outfile';
+# A removal of the outfile is necessary, at least today (2010-12-07), because
+# the outfile is created even if the SELECT statement fails.
+# If the server is improved in the future this may not happen.
+# ==> Do not fail if the outfile does not exist.
+--error 0,1
+--remove_file $outfile
+
+--error ER_PROCACCESS_DENIED_ERROR
+INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1;
+
+--error ER_PROCACCESS_DENIED_ERROR
+SELECT MAX(key1) INTO @dummy FROM t1 WHERE f() < 1;
+
+--error ER_PROCACCESS_DENIED_ERROR
+CREATE TABLE t3 (i INT) AS SELECT MAX(key1) FROM t1 WHERE f() < 1;
+
+disconnect con1;
+--source include/wait_until_disconnected.inc
+
+connection default;
+--echo connection: default
+
+DROP TABLE t1,t2;
+DROP FUNCTION f;
+DROP USER nopriv_user@localhost;
+
+--echo #
+--echo # End Bug#54812
+--echo #
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index 3e235d24c2e..12673314c11 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -849,11 +849,11 @@ create table t1(a int, b tinytext);
insert into t1 values (1,2),(3,2);
set session sort_buffer_size= 30000;
set session max_sort_length= 2180;
---error 1038
+CALL mtr.add_suppression("Out of sort memory");
+--error ER_OUT_OF_SORTMEMORY
select * from t1 order by b;
drop table t1;
-
-
+call mtr.add_suppression("Out of sort memory; increase server sort buffer size");
--echo #
--echo # Bug #39844: Query Crash Mysql Server 5.0.67
--echo #
@@ -1498,6 +1498,23 @@ LIMIT 2;
DROP TABLE t1, t2;
+--echo #
+--echo # Bug #59110: Memory leak of QUICK_SELECT_I allocated memory
+--echo # and
+--echo # Bug #59308: Incorrect result for
+--echo SELECT DISTINCT <col>... ORDER BY <col> DESC
+--echo
+--echo # Use Valgrind to detect #59110!
+--echo #
+
+CREATE TABLE t1 (a INT,KEY (a));
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+EXPLAIN SELECT DISTINCT a,1 FROM t1 WHERE a <> 1 ORDER BY a DESC;
+SELECT DISTINCT a,1 FROM t1 WHERE a <> 1 ORDER BY a DESC;
+
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index d7aede3d71a..e5861322213 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -15,6 +15,98 @@ drop table if exists t1, t2;
--enable_warnings
--echo #
+--echo # Bug#11765667: bug#58655: ASSERTION FAILED,
+--echo # SERVER CRASHES WITH MYSQLD GOT SIGNAL 6
+--echo #
+CREATE TABLE t1 (
+ id MEDIUMINT NOT NULL AUTO_INCREMENT,
+ dt DATE, st VARCHAR(255), uid INT,
+ id2nd LONGBLOB, filler VARCHAR(255), PRIMARY KEY(id, dt)
+);
+INSERT INTO t1 (dt, st, uid, id2nd, filler) VALUES
+ ('1991-03-14', 'Initial Insert', 200, 1234567, 'No Data'),
+ ('1991-02-26', 'Initial Insert', 201, 1234567, 'No Data'),
+ ('1992-03-16', 'Initial Insert', 234, 1234567, 'No Data'),
+ ('1992-07-02', 'Initial Insert', 287, 1234567, 'No Data'),
+ ('1991-05-26', 'Initial Insert', 256, 1234567, 'No Data'),
+ ('1991-04-25', 'Initial Insert', 222, 1234567, 'No Data'),
+ ('1993-03-12', 'Initial Insert', 267, 1234567, 'No Data'),
+ ('1993-03-14', 'Initial Insert', 291, 1234567, 'No Data'),
+ ('1991-12-20', 'Initial Insert', 298, 1234567, 'No Data'),
+ ('1994-10-31', 'Initial Insert', 220, 1234567, 'No Data');
+ALTER TABLE t1 PARTITION BY LIST (YEAR(dt)) (
+ PARTITION d1 VALUES IN (1991, 1994),
+ PARTITION d2 VALUES IN (1993),
+ PARTITION d3 VALUES IN (1992, 1995, 1996)
+);
+INSERT INTO t1 (dt, st, uid, id2nd, filler) VALUES
+ ('1991-07-14', 'After Partitioning Insert', 299, 1234567, 'Insert row');
+UPDATE t1 SET filler='Updating the row' WHERE uid=298;
+
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#59297: Can't find record in 'tablename' on update inner join
+--echo #
+
+CREATE TABLE t1 (
+a char(2) NOT NULL,
+b char(2) NOT NULL,
+c int(10) unsigned NOT NULL,
+d varchar(255) DEFAULT NULL,
+e varchar(1000) DEFAULT NULL,
+PRIMARY KEY (a, b, c),
+KEY (a),
+KEY (a, b)
+)
+/*!50100 PARTITION BY KEY (a)
+PARTITIONS 20 */;
+
+INSERT INTO t1 (a, b, c, d, e) VALUES
+('07', '03', 343, '1', '07_03_343'),
+('01', '04', 343, '2', '01_04_343'),
+('01', '06', 343, '3', '01_06_343'),
+('01', '07', 343, '4', '01_07_343'),
+('01', '08', 343, '5', '01_08_343'),
+('01', '09', 343, '6', '01_09_343'),
+('03', '03', 343, '7', '03_03_343'),
+('03', '06', 343, '8', '03_06_343'),
+('03', '07', 343, '9', '03_07_343'),
+('04', '03', 343, '10', '04_03_343'),
+('04', '06', 343, '11', '04_06_343'),
+('05', '03', 343, '12', '05_03_343'),
+('11', '03', 343, '13', '11_03_343'),
+('11', '04', 343, '14', '11_04_343')
+;
+
+UPDATE t1 AS A,
+(SELECT '03' AS a, '06' AS b, 343 AS c, 'last' AS d) AS B
+SET A.e = B.d
+WHERE A.a = '03'
+AND A.b = '06'
+AND A.c = 343;
+
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#57778: failed primary key add to partitioned innodb table
+--echo # inconsistent and crashes
+--echo #
+CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL)
+PARTITION BY KEY (a) PARTITIONS 2;
+INSERT INTO t1 VALUES (0,1), (0,2);
+--error ER_DUP_ENTRY
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+UPDATE t1 SET a = 1, b = 1 WHERE a = 0 AND b = 2;
+ALTER TABLE t1 ADD PRIMARY KEY (a);
+SELECT * FROM t1;
+ALTER TABLE t1 DROP PRIMARY KEY;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
--echo # Bug#57113: ha_partition::extra(ha_extra_function):
--echo # Assertion `m_extra_cache' failed
CREATE TABLE t1
@@ -135,10 +227,16 @@ INSERT INTO t1 VALUES ('2009-07-14 17:35:55', 'pmax');
INSERT INTO t1 VALUES ('2009-09-21 17:31:42', 'pmax');
SELECT * FROM t1;
+SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01';
+EXPLAIN PARTITIONS SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01';
+EXPLAIN PARTITIONS SELECT * FROM t1 where a = '2007-07-30 17:35:48';
ALTER TABLE t1 REORGANIZE PARTITION pmax INTO (
PARTITION p3 VALUES LESS THAN (1247688000),
PARTITION pmax VALUES LESS THAN MAXVALUE);
SELECT * FROM t1;
+SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01';
+EXPLAIN PARTITIONS SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01';
+EXPLAIN PARTITIONS SELECT * FROM t1 where a = '2007-07-30 17:35:48';
SHOW CREATE TABLE t1;
DROP TABLE t1;
@@ -480,12 +578,12 @@ drop table t1;
#
# BUG 16002: Handle unsigned integer functions properly
#
---error ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
+--error ER_VALUES_IS_NOT_INT_TYPE_ERROR
create table t1 (a bigint)
partition by range (a)
(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
partition p1 values less than (10));
---error ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
+--error ER_VALUES_IS_NOT_INT_TYPE_ERROR
create table t1 (a bigint)
partition by list (a)
(partition p0 values in (0xFFFFFFFFFFFFFFFF),
@@ -1882,15 +1980,16 @@ commit;
drop table t1;
#
-# BUG#32272: partition crash 1: enum column
+# BUG#32772: partition crash 1: enum column
#
+# Note that month(int_col) is disallowed after bug#54483.
create table t1 (
c0 int,
c1 bigint,
c2 set('sweet'),
key (c2,c1,c0),
key(c0)
-) engine=myisam partition by hash (month(c0)) partitions 5;
+) engine=myisam partition by hash (c0) partitions 5;
--disable_warnings
insert ignore into t1 set c0 = -6502262, c1 = 3992917, c2 = 35019;
@@ -2252,3 +2351,53 @@ DROP TABLE t1;
SET GLOBAL myisam_use_mmap=default;
--echo End of 5.1 tests
+
+--echo #
+--echo # BUG#55385: UPDATE statement throws an error, but still updates
+--echo # the table entries
+
+CREATE TABLE t1_part (
+ partkey int,
+ nokey int
+) PARTITION BY LINEAR HASH(partkey) PARTITIONS 3;
+
+INSERT INTO t1_part VALUES (1, 1) , (10, 10);
+CREATE VIEW v1 AS SELECT * FROM t1_part;
+
+--echo
+--echo # Should be (1,1),(10,10)
+SELECT * FROM t1_part;
+
+--echo
+--echo # Case 1
+--echo # Update is refused because partitioning key is updated
+--error ER_MULTI_UPDATE_KEY_CONFLICT
+UPDATE t1_part AS A NATURAL JOIN t1_part B SET A.partkey = 2, B.nokey = 3;
+--error ER_MULTI_UPDATE_KEY_CONFLICT
+UPDATE t1_part AS A NATURAL JOIN t1_part B SET A.nokey = 2, B.partkey = 3;
+
+--echo
+--echo # Case 2
+--echo # Like 1, but partition accessed through a view
+--error ER_MULTI_UPDATE_KEY_CONFLICT
+UPDATE t1_part AS A NATURAL JOIN v1 as B SET A.nokey = 2 , B.partkey = 3;
+--error ER_MULTI_UPDATE_KEY_CONFLICT
+UPDATE v1 AS A NATURAL JOIN t1_part as B SET A.nokey = 2 , B.partkey = 3;
+
+--echo
+--echo # Should be (1,1),(10,10)
+SELECT * FROM t1_part;
+
+--echo
+--echo # Case 3
+--echo # Update is accepted because partitioning key is not updated
+UPDATE t1_part AS A NATURAL JOIN t1_part B SET A.nokey = 2 , B.nokey = 3;
+
+--echo
+--echo # Should be (1,3),(10,3)
+SELECT * FROM t1_part;
+
+--echo
+# Cleanup
+DROP VIEW v1;
+DROP TABLE t1_part;
diff --git a/mysql-test/t/partition_binlog.test b/mysql-test/t/partition_binlog.test
new file mode 100644
index 00000000000..c1f618b794f
--- /dev/null
+++ b/mysql-test/t/partition_binlog.test
@@ -0,0 +1,42 @@
+--source include/have_log_bin.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+--echo #
+--echo # Bug#58147: ALTER TABLE w/ TRUNCATE PARTITION fails
+--echo # but the statement is written to binlog
+--echo #
+
+CREATE TABLE t1(id INT)
+PARTITION BY RANGE (id)
+(PARTITION p0 VALUES LESS THAN (100),
+ PARTITION pmax VALUES LESS THAN (MAXVALUE));
+
+INSERT INTO t1 VALUES (1), (10), (100), (1000);
+
+--let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1)
+--let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1)
+
+--error ER_WRONG_PARTITION_NAME
+ALTER TABLE t1 TRUNCATE PARTITION p1;
+--error ER_DROP_PARTITION_NON_EXISTENT
+ALTER TABLE t1 DROP PARTITION p1;
+
+--echo # No error returned, output in table format instead:
+ALTER TABLE t1 ANALYZE PARTITION p1;
+ALTER TABLE t1 CHECK PARTITION p1;
+ALTER TABLE t1 OPTIMIZE PARTITION p1;
+ALTER TABLE t1 REPAIR PARTITION p1;
+
+ALTER TABLE t1 ANALYZE PARTITION p0;
+ALTER TABLE t1 CHECK PARTITION p0;
+ALTER TABLE t1 OPTIMIZE PARTITION p0;
+ALTER TABLE t1 REPAIR PARTITION p0;
+ALTER TABLE t1 TRUNCATE PARTITION p0;
+ALTER TABLE t1 DROP PARTITION p0;
+
+--source include/show_binlog_events.inc
+
+DROP TABLE t1;
diff --git a/mysql-test/t/partition_datatype.test b/mysql-test/t/partition_datatype.test
index 0a9fae15354..967e1cddb4e 100644
--- a/mysql-test/t/partition_datatype.test
+++ b/mysql-test/t/partition_datatype.test
@@ -7,6 +7,7 @@
# BUG#48164 limited size to 3072 bytes
#
-- source include/have_partition.inc
+-- source include/have_innodb.inc
--disable_warnings
drop table if exists t1;
@@ -233,3 +234,312 @@ show create table t1;
insert into t1 values (1),(4),(7),(10),(13),(16),(19),(22),(25),(28),(31),(34);
select hex(a) from t1 where a = 7;
drop table t1;
+
+--echo #
+--echo # Bug#28928: UNIX_TIMESTAMP() should be considered unary monotonic
+--echo # by partition pruning
+SET @old_time_zone= @@session.time_zone;
+SET @@session.time_zone = 'UTC';
+--echo # Using MyISAM to get stable values on TABLE_ROWS in I_S.PARTITIONS
+CREATE TABLE t1
+(a TIMESTAMP NULL,
+ tz varchar(16))
+ENGINE = MyISAM;
+CREATE TABLE t2 LIKE t1;
+ALTER TABLE t2 PARTITION BY RANGE (UNIX_TIMESTAMP(a))
+(PARTITION `p0` VALUES LESS THAN (0),
+ PARTITION `p-2000` VALUES LESS THAN (UNIX_TIMESTAMP('2000-01-01')),
+ PARTITION `p-2011-MSK` VALUES LESS THAN (UNIX_TIMESTAMP('2011-03-26 23:00:00')),
+ PARTITION `p-2011-MSD-1` VALUES LESS THAN (UNIX_TIMESTAMP('2011-10-29 22:00:00')),
+ PARTITION `p-2011-MSD-2` VALUES LESS THAN (UNIX_TIMESTAMP('2011-10-29 23:00:00')),
+ PARTITION `p-2012-MSK-1` VALUES LESS THAN (UNIX_TIMESTAMP('2011-10-30 00:00:00')),
+ PARTITION `p-2012-MSK-2` VALUES LESS THAN (UNIX_TIMESTAMP('2012-03-24 23:00:00')),
+ PARTITION `pEnd` VALUES LESS THAN (UNIX_TIMESTAMP('2038-01-19 03:14:07')),
+ PARTITION `pMax` VALUES LESS THAN MAXVALUE);
+
+
+--echo # Test 'odd' values
+INSERT INTO t1 VALUES (NULL, 'UTC');
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00', 'UTC');
+--echo # Test invalid values
+INSERT INTO t1 VALUES ('1901-01-01 00:00:00', 'UTCI');
+INSERT INTO t1 VALUES ('1969-12-31 23:59:59', 'UTCI');
+INSERT INTO t1 VALUES ('2038-01-19 03:14:08', 'UTCI');
+INSERT INTO t1 VALUES ('1970-01-01 00:00:00', 'UTCI');
+--echo # Test start range
+INSERT INTO t1 VALUES ('1970-01-01 00:00:01', 'UTC');
+INSERT INTO t1 VALUES ('1974-02-05 21:28:16', 'UTC');
+--echo # Test end range
+INSERT INTO t1 VALUES ('2038-01-19 03:14:06', 'UTC');
+INSERT INTO t1 VALUES ('2038-01-19 03:14:07', 'UTC');
+--echo # Test Daylight saving shift
+INSERT INTO t1 VALUES ('2011-03-26 22:59:59', 'UTC');
+INSERT INTO t1 VALUES ('2011-03-26 23:00:00', 'UTC');
+INSERT INTO t1 VALUES ('2011-03-26 23:00:01', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 21:59:59', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 22:00:00', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 22:00:01', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 22:59:59', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 23:00:00', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 23:00:01', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-29 23:59:59', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-30 00:00:00', 'UTC');
+INSERT INTO t1 VALUES ('2011-10-30 00:00:01', 'UTC');
+
+SET @@session.time_zone = 'Europe/Moscow';
+
+--echo # Test 'odd' values
+INSERT INTO t1 VALUES (NULL, 'Moscow');
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00', 'Moscow');
+--echo # Test invalid values
+INSERT INTO t1 VALUES ('0000-00-00 03:00:00', 'MoscowI');
+INSERT INTO t1 VALUES ('1901-01-01 00:00:00', 'MoscowI');
+INSERT INTO t1 VALUES ('1969-12-31 23:59:59', 'MoscowI');
+INSERT INTO t1 VALUES ('1970-01-01 02:29:29', 'MoscowI');
+INSERT INTO t1 VALUES ('2038-01-19 06:14:08', 'MoscowI');
+INSERT INTO t1 VALUES ('1970-01-01 03:00:00', 'MoscowI');
+--echo # values truncated to 03:00:00 due to daylight saving shift
+INSERT INTO t1 VALUES ('2011-03-27 02:00:00', 'MoscowI');
+INSERT INTO t1 VALUES ('2011-03-27 02:00:01', 'MoscowI');
+INSERT INTO t1 VALUES ('2011-03-27 02:59:59', 'MoscowI');
+--echo # Test start range
+INSERT INTO t1 VALUES ('1970-01-01 03:00:01', 'Moscow');
+INSERT INTO t1 VALUES ('1974-02-05 21:28:16', 'Moscow');
+--echo # Test end range
+INSERT INTO t1 VALUES ('2038-01-19 06:14:06', 'Moscow');
+INSERT INTO t1 VALUES ('2038-01-19 06:14:07', 'Moscow');
+--echo # Test Daylight saving shift
+INSERT INTO t1 VALUES ('2011-03-27 01:59:59', 'Moscow');
+INSERT INTO t1 VALUES ('2011-03-27 03:00:00', 'Moscow');
+INSERT INTO t1 VALUES ('2011-03-27 03:00:01', 'Moscow');
+INSERT INTO t1 VALUES ('2011-10-30 01:59:59', 'Moscow');
+--echo # All values between 02:00 and 02:59:59 will be interpretated as DST
+INSERT INTO t1 VALUES ('2011-10-30 02:00:00', 'MoscowD');
+INSERT INTO t1 VALUES ('2011-10-30 02:00:01', 'MoscowD');
+INSERT INTO t1 VALUES ('2011-10-30 02:59:59', 'MoscowD');
+INSERT INTO t1 VALUES ('2011-10-30 03:00:00', 'Moscow');
+INSERT INTO t1 VALUES ('2011-10-30 03:00:01', 'Moscow');
+
+
+SET @@session.time_zone = 'UTC';
+
+INSERT INTO t2 SELECT * FROM t1;
+
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't2';
+
+SELECT * FROM t1 ORDER BY a, tz;
+SELECT * FROM t2 ORDER BY a, tz;
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-26 23:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-26 23:00:00' ORDER BY a, tz;
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-26 22:59:59' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-26 22:59:59' ORDER BY a, tz;
+
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 22:59:59' and '2011-03-28 00:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 22:59:59' and '2011-03-28 00:00:00' ORDER BY a, tz;
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 23:00:00' and '2011-03-28 00:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 23:00:00' and '2011-03-28 00:00:00' ORDER BY a, tz;
+
+
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 23:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 23:00:00' ORDER BY a, tz;
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 22:59:59' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 22:59:59' ORDER BY a, tz;
+
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 22:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 22:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz;
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 23:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 23:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz;
+
+
+--echo # Test end range changes
+DELETE FROM t2 WHERE a = 0;
+INSERT INTO t2 VALUES ('1970-01-01 00:00:00', 'UTC');
+SELECT COUNT(*) FROM t2;
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+SELECT * FROM t2 ORDER BY a, tz LIMIT 3;
+SELECT * FROM t2 ORDER BY a DESC, tz LIMIT 3;
+UPDATE t2 SET a = TIMESTAMPADD(SECOND, 1, a);
+SELECT MIN(a), MAX(a) FROM t2;
+SELECT COUNT(*) FROM t2;
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't2';
+SELECT * FROM t2 ORDER BY a, tz;
+
+--echo # Test start range changes
+INSERT INTO t2 VALUES ('1970-01-01 00:00:00', 'UTC');
+SELECT COUNT(*) FROM t2;
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+SELECT * FROM t2 ORDER BY a, tz LIMIT 3;
+SELECT * FROM t2 ORDER BY a DESC, tz LIMIT 3;
+UPDATE t2 SET a = TIMESTAMPADD(SECOND, -1, a);
+SELECT MIN(a), MAX(a) FROM t2;
+SELECT COUNT(*) FROM t2;
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't2';
+SELECT * FROM t2 ORDER BY a, tz;
+
+SHOW CREATE TABLE t2;
+TRUNCATE TABLE t2;
+
+SET @@session.time_zone = 'Europe/Moscow';
+
+INSERT INTO t2 SELECT * FROM t1;
+
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't2';
+
+SELECT * FROM t1 ORDER BY a, tz;
+SELECT * FROM t2 ORDER BY a, tz;
+
+--echo # Testing the leap from 01:59:59 to 03:00:00
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-27 03:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-27 03:00:00' ORDER BY a, tz;
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-27 01:59:59' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-01 00:00:00' and '2011-03-27 01:59:59' ORDER BY a, tz;
+
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 01:59:59' and '2011-03-28 00:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 01:59:59' and '2011-03-28 00:00:00' ORDER BY a, tz;
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 03:00:00' and '2011-03-28 00:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-03-26 03:00:00' and '2011-03-28 00:00:00' ORDER BY a, tz;
+
+
+
+--echo # Testing the leap from 02:59:59 to 02:00:00
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 02:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 02:00:00' ORDER BY a, tz;
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 02:59:59' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 02:59:59' ORDER BY a, tz;
+
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 03:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 03:00:00' ORDER BY a, tz;
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 01:59:59' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-01 00:00:00' and '2011-10-29 01:59:59' ORDER BY a, tz;
+
+
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 02:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 02:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz;
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 02:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 02:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz;
+
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 03:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 03:00:00' and '2011-10-31 00:00:00' ORDER BY a, tz;
+
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 01:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz;
+EXPLAIN PARTITIONS
+SELECT * FROM t2
+WHERE a BETWEEN '2011-10-29 01:59:59' and '2011-10-31 00:00:00' ORDER BY a, tz;
+
+
+
+--echo # Test end range changes
+DELETE FROM t2 WHERE a = 0;
+INSERT INTO t2 VALUES ('1970-01-01 00:00:00', 'Moscow');
+SELECT COUNT(*) FROM t2;
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+SELECT * FROM t2 ORDER BY a, tz LIMIT 3;
+SELECT * FROM t2 ORDER BY a DESC, tz LIMIT 3;
+UPDATE t2 SET a = TIMESTAMPADD(SECOND, 1, a);
+SELECT MIN(a), MAX(a) FROM t2;
+SELECT COUNT(*) FROM t2;
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't2';
+SELECT * FROM t2 ORDER BY a, tz;
+
+--echo # Test start range changes
+INSERT INTO t2 VALUES ('1970-01-01 00:00:00', 'Moscow');
+SELECT COUNT(*) FROM t2;
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+SELECT * FROM t2 ORDER BY a, tz LIMIT 3;
+SELECT * FROM t2 ORDER BY a DESC, tz LIMIT 3;
+UPDATE t2 SET a = TIMESTAMPADD(SECOND, -1, a);
+SELECT MIN(a), MAX(a) FROM t2;
+SELECT COUNT(*) FROM t2;
+SELECT COUNT(*) FROM t2 WHERE a = 0;
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS
+WHERE TABLE_NAME = 't2';
+SELECT * FROM t2 ORDER BY a, tz;
+
+SHOW CREATE TABLE t2;
+TRUNCATE TABLE t2;
+
+DROP TABLE t1, t2;
+SET @@session.time_zone= @old_time_zone;
diff --git a/mysql-test/t/partition_debug_sync.test b/mysql-test/t/partition_debug_sync.test
index cde94856ae6..448cec652d7 100644
--- a/mysql-test/t/partition_debug_sync.test
+++ b/mysql-test/t/partition_debug_sync.test
@@ -38,7 +38,7 @@ connection default;
--echo # Con default
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning';
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_alter';
-SET DEBUG_SYNC= 'rm_table_part2_before_delete_table WAIT_FOR partitioning_removed';
+SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table WAIT_FOR partitioning_removed';
DROP TABLE IF EXISTS t1;
--echo # Con 1
connection con1;
@@ -70,12 +70,12 @@ SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done';
--send ALTER TABLE t2 REMOVE PARTITIONING
connection default;
--echo # Con default
-SET SESSION debug= "+d,sleep_before_part2_delete_table";
+SET SESSION debug= "+d,sleep_before_no_locks_delete_table";
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
-SET DEBUG_SYNC= 'rm_table_part2_before_delete_table SIGNAL waiting_for_alter';
-SET DEBUG_SYNC= 'rm_table_part2_before_binlog SIGNAL delete_done';
+SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter';
+SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done';
DROP TABLE IF EXISTS t2;
-SET SESSION debug= "-d,sleep_before_part2_delete_table";
+SET SESSION debug= "-d,sleep_before_no_locks_delete_table";
--echo # Con 1
connection con1;
--error ER_NO_SUCH_TABLE
diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test
index c764cf4e408..536935420a4 100644
--- a/mysql-test/t/partition_error.test
+++ b/mysql-test/t/partition_error.test
@@ -5,28 +5,744 @@
-- source include/have_partition.inc
--disable_warnings
-drop table if exists t1;
+drop table if exists t1, t2;
--enable_warnings
let $MYSQLD_DATADIR= `SELECT @@datadir`;
--echo #
---echo # Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
+--echo # Bug#57924: crash when creating partitioned table with
+--echo # multiple columns in the partition key
--echo #
-CREATE TABLE t1 (a INT) PARTITION BY HASH (a);
-FLUSH TABLES;
---remove_file $MYSQLD_DATADIR/test/t1.par
---replace_result $MYSQLD_DATADIR ./
-CHECK TABLE t1;
---error ER_FAILED_READ_FROM_PAR_FILE
+--error ER_SAME_NAME_PARTITION_FIELD
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
+PARTITION BY KEY(a, b, a);
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
+PARTITION BY KEY(A, b);
+DROP TABLE t1;
+--error ER_SAME_NAME_PARTITION_FIELD
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
+PARTITION BY KEY(a, b, A);
+
+
+--echo #
+--echo # Bug#54483: valgrind errors when making warnings for multiline inserts
+--echo # into partition
+--echo #
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARBINARY(10))
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a CHAR(10))
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIMESTAMP)
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+CREATE TABLE t1 (a DATE)
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+INSERT INTO t1 VALUES ('test'),('a'),('5');
+SHOW WARNINGS;
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+INSERT INTO t1 VALUES ('test'),('a'),('5');
+SHOW WARNINGS;
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY RANGE (DAYOFWEEK(a))
+(PARTITION a1 VALUES LESS THAN (60));
+SHOW WARNINGS;
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (TO_DAYS(a));
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (TO_DAYS(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (TO_DAYS(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (TO_DAYS(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (TO_DAYS(a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (DAYOFMONTH(a));
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (DAYOFMONTH(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (DAYOFMONTH(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (DAYOFMONTH(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (DAYOFMONTH(a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (MONTH(a));
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (MONTH(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (MONTH(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (MONTH(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (MONTH(a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (DAYOFYEAR(a));
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (DAYOFYEAR(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (DAYOFYEAR(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (DAYOFYEAR(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (DAYOFYEAR(a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (HOUR(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (HOUR(a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (HOUR(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (HOUR(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (HOUR(a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (MINUTE(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (MINUTE(a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (MINUTE(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (MINUTE(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (MINUTE(a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (QUARTER(a));
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (QUARTER(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (QUARTER(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (QUARTER(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (QUARTER(a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (SECOND(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (SECOND(a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (SECOND(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (SECOND(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (SECOND(a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (YEARWEEK(a));
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (YEARWEEK(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (YEARWEEK(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (YEARWEEK(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (YEARWEEK(a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (WEEKDAY(a));
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (WEEKDAY(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (WEEKDAY(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (WEEKDAY(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (WEEKDAY(a));
+
+--echo # TO_SECONDS() is added in 5.5.
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (TO_SECONDS(a));
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (TO_SECONDS(a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (TO_SECONDS(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (TO_SECONDS(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (TO_SECONDS(a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (TIME_TO_SEC(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (TIME_TO_SEC(a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (TIME_TO_SEC(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (TIME_TO_SEC(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (TIME_TO_SEC(a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (FROM_DAYS(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (FROM_DAYS(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (FROM_DAYS(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (TO_DAYS(FROM_DAYS(a)));
+--error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (FROM_DAYS(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (TO_DAYS(FROM_DAYS(a)));
+--error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (FROM_DAYS(a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (MICROSECOND(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (MICROSECOND(a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (MICROSECOND(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (MICROSECOND(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (MICROSECOND(a));
+--echo # Bug#57071
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1
+(`date` date,
+ `extracted_week` int,
+ `yearweek` int,
+ `week` int,
+ `default_week_format` int)
+PARTITION BY LIST (EXTRACT(WEEK FROM date) % 3)
+(PARTITION p0 VALUES IN (0),
+ PARTITION p1 VALUES IN (1),
+ PARTITION p2 VALUES IN (2));
+CREATE TABLE t1
+(`date` date,
+ `extracted_week` int,
+ `yearweek` int,
+ `week` int,
+ `default_week_format` int);
+SET @old_default_week_format := @@default_week_format;
+SET default_week_format = 0;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 1;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 2;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 3;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 4;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 5;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 6;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
+SET default_week_format = 7;
+INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
SELECT * FROM t1;
---echo # Note that it is currently impossible to drop a partitioned table
---echo # without the .par file
---error ER_BAD_TABLE_ERROR
+SET default_week_format = @old_default_week_format;
+DROP TABLE t1;
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(YEAR FROM a));
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(YEAR FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(YEAR FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(YEAR FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(YEAR FROM a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(QUARTER FROM a));
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(QUARTER FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(QUARTER FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(QUARTER FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(QUARTER FROM a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(MONTH FROM a));
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(MONTH FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(MONTH FROM a));
DROP TABLE t1;
---remove_file $MYSQLD_DATADIR/test/t1.frm
---remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI
---remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYD
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(MONTH FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(MONTH FROM a));
+
+--echo # EXTRACT(WEEK...) is disallowed, see bug#57071.
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(WEEK FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(WEEK FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(WEEK FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(WEEK FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(WEEK FROM a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(DAY FROM a));
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(DAY FROM a));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(DAY FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(DAY FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(DAY FROM a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(HOUR FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(HOUR FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(HOUR FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(HOUR FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(HOUR FROM a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(MINUTE FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(MINUTE FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(MINUTE FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(MINUTE FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(MINUTE FROM a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(SECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(SECOND FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(SECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(SECOND FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(SECOND FROM a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
+
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a TIME, b DATE)
+PARTITION BY HASH (DATEDIFF(a, b));
+CREATE TABLE t1 (a DATE, b DATETIME)
+PARTITION BY HASH (DATEDIFF(a, b));
+DROP TABLE t1;
+CREATE TABLE t1 (a DATETIME, b DATE)
+PARTITION BY HASH (DATEDIFF(a, b));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE, b VARCHAR(10))
+PARTITION BY HASH (DATEDIFF(a, b));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT, b DATETIME)
+PARTITION BY HASH (DATEDIFF(a, b));
+
+CREATE TABLE t1 (a TIME)
+PARTITION BY HASH (TIME_TO_SEC(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a DATE)
+PARTITION BY HASH (TIME_TO_SEC(a));
+CREATE TABLE t1 (a DATETIME)
+PARTITION BY HASH (TIME_TO_SEC(a));
+DROP TABLE t1;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a VARCHAR(10))
+PARTITION BY HASH (TIME_TO_SEC(a));
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (TIME_TO_SEC(a));
+
+--echo #
+--echo # Bug#50036: Inconsistent errors when using TIMESTAMP
+--echo # columns/expressions
+
+--echo # 1. correct and appropriate errors in light of
+--echo # the fix for BUG#42849:
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+CREATE TABLE t1 (c TIMESTAMP)
+PARTITION BY RANGE (TO_DAYS(c))
+(PARTITION p0 VALUES LESS THAN (10000),
+ PARTITION p1 VALUES LESS THAN (MAXVALUE));
+CREATE TABLE t2 (c TIMESTAMP);
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+ALTER TABLE t2
+PARTITION BY RANGE (TO_DAYS(c))
+(PARTITION p0 VALUES LESS THAN (10000),
+ PARTITION p1 VALUES LESS THAN (MAXVALUE));
+
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (c TIMESTAMP)
+PARTITION BY RANGE COLUMNS(c)
+(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
+ PARTITION p1 VALUES LESS THAN (MAXVALUE));
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+ALTER TABLE t2 PARTITION BY RANGE COLUMNS(c)
+(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
+ PARTITION p1 VALUES LESS THAN (MAXVALUE));
+DROP TABLE t2;
+
+--echo # 2. These errors where questionable before the fix:
+
+--echo # VALUES clause are checked first, clearified the error message.
+--error ER_VALUES_IS_NOT_INT_TYPE_ERROR
+CREATE TABLE t1 (c TIMESTAMP)
+PARTITION BY RANGE (c)
+(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
+ PARTITION p1 VALUES LESS THAN (MAXVALUE));
+
+--echo # TIMESTAMP is not INT (e.g. UNIX_TIMESTAMP).
+--error ER_VALUES_IS_NOT_INT_TYPE_ERROR
+CREATE TABLE t1 (c TIMESTAMP)
+PARTITION BY RANGE (UNIX_TIMESTAMP(c))
+(PARTITION p0 VALUES LESS THAN ('2000-01-01 00:00:00'),
+ PARTITION p1 VALUES LESS THAN (MAXVALUE));
+
+CREATE TABLE t1 (c TIMESTAMP)
+PARTITION BY RANGE (UNIX_TIMESTAMP(c))
+(PARTITION p0 VALUES LESS THAN (UNIX_TIMESTAMP('2000-01-01 00:00:00')),
+ PARTITION p1 VALUES LESS THAN (MAXVALUE));
+DROP TABLE t1;
+
+--echo # Changed error from ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
+CREATE TABLE t1 (c TIMESTAMP)
+PARTITION BY HASH (c) PARTITIONS 4;
+
+--echo # Moved to partition_myisam, since it was MyISAM specific
+--echo # Added test with existing TIMESTAMP partitioning (when it was allowed).
--echo #
--echo # Bug#49477: Assertion `0' failed in ha_partition.cc:5530
@@ -48,6 +764,7 @@ SUBPARTITION BY HASH(TO_DAYS(purchased))
(PARTITION p0 VALUES LESS THAN MAXVALUE
DATA DIRECTORY = '/tmp/not-existing'
INDEX DIRECTORY = '/tmp/not-existing');
+--replace_result MyISAM <curr_engine> InnoDB <curr_engine>
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (id INT, purchased DATE)
@@ -58,6 +775,7 @@ SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2
DATA DIRECTORY = '/tmp/not-existing'
INDEX DIRECTORY = '/tmp/not-existing',
SUBPARTITION sp1));
+--replace_result MyISAM <curr_engine> InnoDB <curr_engine>
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (id INT, purchased DATE)
@@ -65,34 +783,11 @@ PARTITION BY RANGE(YEAR(purchased))
(PARTITION p0 VALUES LESS THAN MAXVALUE
DATA DIRECTORY = '/tmp/not-existing'
INDEX DIRECTORY = '/tmp/not-existing');
+--replace_result MyISAM <curr_engine> InnoDB <curr_engine>
SHOW CREATE TABLE t1;
DROP TABLE t1;
SET @@sql_mode= @org_mode;
---echo #
---echo # Bug#50392: insert_id is not reset for partitioned tables
---echo # auto_increment on duplicate entry
-CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);
-SET INSERT_ID= 13;
-INSERT INTO t1 VALUES (NULL);
-SET INSERT_ID= 12;
---error ER_DUP_ENTRY
-INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
-SHOW CREATE TABLE t1;
-INSERT INTO t1 VALUES (NULL);
-SELECT * FROM t1;
-DROP TABLE t1;
-CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) PARTITION BY KEY(a);
-SET INSERT_ID= 13;
-INSERT INTO t1 VALUES (NULL);
-SET INSERT_ID= 12;
---error ER_DUP_ENTRY
-INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
-SHOW CREATE TABLE t1;
-INSERT INTO t1 VALUES (NULL);
-SELECT * FROM t1;
-DROP TABLE t1;
-
#
# Bug#38719: Partitioning returns a different error code for a
# duplicate key error
@@ -107,24 +802,6 @@ INSERT INTO t1 VALUES (1),(1);
DROP TABLE t1;
#
-# Bug#31931: Mix of handlers error message
-#
---error ER_MIX_HANDLER_ERROR
-CREATE TABLE t1 (a INT)
-PARTITION BY HASH (a)
-( PARTITION p0 ENGINE=MyISAM,
- PARTITION p1);
---error ER_MIX_HANDLER_ERROR
-CREATE TABLE t1 (a INT)
-PARTITION BY LIST (a)
-SUBPARTITION BY HASH (a)
-( PARTITION p0 VALUES IN (0)
-( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2),
- PARTITION p1 VALUES IN (1)
-( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM));
-
-
-#
# Bug 29368:
# Incorrect error, 1467, for syntax error when creating partition
--error ER_PARTITION_REQUIRES_VALUES_ERROR
@@ -140,7 +817,7 @@ PARTITION BY RANGE (a)
#
# Partition by key stand-alone error
#
---error 1064
+--error ER_PARSE_ERROR
partition by list (a)
partitions 3
(partition x1 values in (1,2,9,4) tablespace ts1,
@@ -177,7 +854,7 @@ partitions 3
#
# Partition by key, partition function not allowed
#
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -192,7 +869,7 @@ partitions 3
#
# Partition by key, no partition name
#
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -223,7 +900,7 @@ select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Partition by hash, invalid field in function
#
---error 1054
+--error ER_BAD_FIELD_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -253,7 +930,7 @@ partitions 3
#
# Partition by key specified 3 partitions but only defined 2 => error
#
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -266,7 +943,7 @@ partitions 3
#
# Partition by hash, random function
#
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -279,7 +956,7 @@ partitions 2
#
# Partition by range, random function
#
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -292,7 +969,7 @@ partitions 2
#
# Partition by list, random function
#
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -428,7 +1105,7 @@ select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by hash, no partitions defined, wrong subpartition function
#
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -455,7 +1132,7 @@ select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Subpartition by hash, no partitions defined, wrong subpartition function
#
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -496,7 +1173,7 @@ subpartition by hash (3+4);
#
# Subpartition by hash, no partitions defined, wrong subpartition function
#
---error 1054
+--error ER_BAD_FIELD_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -522,7 +1199,7 @@ select load_file('$MYSQLD_DATADIR/test/t1.par');
#
# Partition by range, invalid field in function
#
---error 1054
+--error ER_BAD_FIELD_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -536,7 +1213,7 @@ partitions 2
#
# Partition by range, inconsistent partition function and constants
#
---error ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
+--error ER_VALUES_IS_NOT_INT_TYPE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -676,7 +1353,7 @@ partitions 2
#
# Subpartition by hash, wrong number of subpartitions
#
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -696,7 +1373,7 @@ subpartitions 3
#
# Subpartition by hash, wrong number of subpartitions
#
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -716,7 +1393,7 @@ subpartition by hash (a+b)
#
# Subpartition by list => error
#
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -735,7 +1412,7 @@ subpartition by list (a+b)
#
# Subpartition by list => error
#
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -779,7 +1456,7 @@ partitions 2
#
# Partition by list, invalid field in function
#
---error 1054
+--error ER_BAD_FIELD_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -849,7 +1526,7 @@ partitions 2
#
# Partition by list, wrong constant result type (not INT)
#
---error ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR
+--error ER_VALUES_IS_NOT_INT_TYPE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -863,7 +1540,7 @@ partitions 2
#
# Partition by list, missing parenthesis
#
---error 1064
+--error ER_PARSE_ERROR
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -877,7 +1554,7 @@ partitions 2
#
# Bug #13439: Crash when LESS THAN (non-literal)
#
---error 1054
+--error ER_BAD_FIELD_ERROR
CREATE TABLE t1 (a int)
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (x1));
@@ -904,13 +1581,13 @@ partition by range (ascii(v))
(partition p0 values less than (10));
#drop table t1;
--- error 1064
+-- error ER_PARSE_ERROR
create table t1 (a int)
partition by hash (rand(a));
--- error 1064
+-- error ER_PARSE_ERROR
create table t1 (a int)
partition by hash(CURTIME() + a);
--- error 1064
+-- error ER_PARSE_ERROR
create table t1 (a int)
partition by hash (NOW()+a);
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
@@ -939,13 +1616,13 @@ PARTITION pmax VALUES LESS THAN MAXVALUE);
# Check that allowed arithmetic/math functions involving TIMESTAMP values result
# in ER_PARTITION_FUNC_NOT_ALLOWED_ERROR when used as a partitioning function
---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
PARTITION BY RANGE (a) (
PARTITION p VALUES LESS THAN (20080819),
PARTITION pmax VALUES LESS THAN MAXVALUE);
---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
+--error ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
ALTER TABLE old
PARTITION BY RANGE (a) (
PARTITION p VALUES LESS THAN (20080819),
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test
index abf543ad53a..28a9c6e2e64 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -2,6 +2,9 @@
--source include/have_partition.inc
--source include/have_innodb.inc
+set global default_storage_engine='innodb';
+set session default_storage_engine='innodb';
+
--disable_warnings
drop table if exists t1, t2;
--enable_warnings
@@ -9,6 +12,32 @@ drop table if exists t1, t2;
let $MYSQLD_DATADIR= `SELECT @@datadir`;
--echo #
+--echo # Bug#56287: crash when using Partition datetime in sub in query
+--echo #
+
+CREATE TABLE t1
+(c1 bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ c2 varchar(40) not null default '',
+ c3 datetime not NULL,
+ PRIMARY KEY (c1,c3),
+ KEY partidx(c3))
+ENGINE=InnoDB
+PARTITION BY RANGE (TO_DAYS(c3))
+(PARTITION p200912 VALUES LESS THAN (to_days('2010-01-01')),
+ PARTITION p201103 VALUES LESS THAN (to_days('2011-04-01')),
+ PARTITION p201912 VALUES LESS THAN MAXVALUE);
+
+insert into t1(c2,c3) values ("Test row",'2010-01-01 00:00:00');
+
+SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
+SELECT count(*) FROM t1 p where c3 in
+(select c3 from t1 t where t.c3 < date '2011-04-26 19:19:44'
+ and t.c3 > date '2011-04-26 19:18:44') ;
+
+DROP TABLE t1;
+
+
+--echo #
--echo # Bug#54747: Deadlock between REORGANIZE PARTITION and
--echo # SELECT is not detected
--echo #
@@ -16,9 +45,6 @@ let $MYSQLD_DATADIR= `SELECT @@datadir`;
SET @old_innodb_thread_concurrency:= @@innodb_thread_concurrency;
SET GLOBAL innodb_thread_concurrency = 1;
-set global default_storage_engine='innodb';
-set session default_storage_engine='innodb';
-
CREATE TABLE t1
(user_num BIGINT,
hours SMALLINT,
@@ -112,6 +138,7 @@ SELECT * FROM t1;
COMMIT;
DROP TABLE t1;
+
--echo #
--echo # Bug#51830: Incorrect partition pruning on range partition (regression)
--echo #
@@ -555,6 +582,20 @@ connection default;
SELECT * FROM t1;
COMMIT;
DROP TABLE t1;
+
+#
+# Bug #55146 Assertion `m_part_spec.start_part == m_part_spec.end_part' in index_read_idx_map
+#
+
+CREATE TABLE t1 (i1 int NOT NULL primary key, f1 int) ENGINE = InnoDB
+ PARTITION BY HASH(i1) PARTITIONS 2;
+
+INSERT INTO t1 VALUES (1,1), (2,2);
+
+SELECT * FROM t1 WHERE i1 = ( SELECT i1 FROM t1 WHERE f1=0 LIMIT 1 );
+
+DROP TABLE t1;
+
--enable_parsing
--echo #
@@ -573,5 +614,24 @@ OPTIMIZE TABLE t1;
SET SESSION sql_mode = @old_mode;
DROP TABLE t1;
-set global default_storage_engine=default;
+--echo #
+--echo # Bug#57985 "ONLINE/FAST ALTER PARTITION can fail and leave the
+--echo # table unusable".
+--echo #
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TABLE t1 (a bigint not null, b int not null, PRIMARY KEY (a))
+ ENGINE = InnoDB PARTITION BY KEY(a) PARTITIONS 2;
+INSERT INTO t1 values (0,1), (1,2);
+--echo # The below ALTER should fail. It should leave the
+--echo # table in its original, non-corrupted, usable state.
+--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
+ALTER TABLE t1 ADD UNIQUE KEY (b);
+--echo # The below statements should succeed, as ALTER should
+--echo # have left table intact.
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+set global default_storage_engine=default;
diff --git a/mysql-test/t/partition_innodb_plugin.test b/mysql-test/t/partition_innodb_plugin.test
index 04c72127394..e8b73687177 100644
--- a/mysql-test/t/partition_innodb_plugin.test
+++ b/mysql-test/t/partition_innodb_plugin.test
@@ -1,6 +1,73 @@
--source include/have_partition.inc
--source include/have_innodb.inc
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+
+call mtr.add_suppression("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB internal");
+--echo #
+--echo # Bug#55091: Server crashes on ADD PARTITION after a failed attempt
+--echo #
+SET @old_innodb_file_format_max = @@global.innodb_file_format_max;
+SET @old_innodb_file_format = @@global.innodb_file_format;
+SET @old_innodb_file_per_table = @@global.innodb_file_per_table;
+SET @old_innodb_strict_mode = @@global.innodb_strict_mode;
+SET @@global.innodb_file_format = Barracuda,
+@@global.innodb_file_per_table = ON,
+@@global.innodb_strict_mode = ON;
+
+--echo # Connection con1
+--connect(con1,localhost,root,,)
+
+CREATE TABLE t1 (id INT NOT NULL
+PRIMARY KEY,
+user_num CHAR(10)
+) ENGINE = InnoDB
+KEY_BLOCK_SIZE=4
+PARTITION BY HASH(id) PARTITIONS 1;
+
+--replace_result #p# #P#
+--list_files $MYSQLD_DATADIR/test
+SHOW CREATE TABLE t1;
+
+SET GLOBAL innodb_file_per_table = OFF;
+
+--disconnect con1
+--connect(con2,localhost,root,,)
+--echo # Connection con2
+
+LOCK TABLE t1 WRITE;
+
+--echo # ALTER fails because COMPRESSED/KEY_BLOCK_SIZE
+--echo # are incompatible with innodb_file_per_table = OFF;
+
+--error ER_GET_ERRNO
+ALTER TABLE t1 ADD PARTITION PARTITIONS 1;
+
+--replace_result #p# #P#
+--list_files $MYSQLD_DATADIR/test
+--echo # This SET is not needed to reproduce the bug,
+--echo # it is here just to make the test case more realistic
+SET innodb_strict_mode = OFF;
+
+ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
+--replace_result #p# #P#
+--list_files $MYSQLD_DATADIR/test
+
+# really bug#56172
+ALTER TABLE t1 REBUILD PARTITION p0;
+
+UNLOCK TABLES;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--disconnect con2
+--connection default
+--echo # Connection default
+SET @@global.innodb_strict_mode = @old_innodb_strict_mode;
+SET @@global.innodb_file_format = @old_innodb_file_format;
+SET @@global.innodb_file_per_table = @old_innodb_file_per_table;
+SET @@global.innodb_file_format_max = @old_innodb_file_format_max;
+
#
# Bug#32430 - show engine innodb status causes errors
#
diff --git a/mysql-test/t/partition_myisam.test b/mysql-test/t/partition_myisam.test
new file mode 100644
index 00000000000..c3766430275
--- /dev/null
+++ b/mysql-test/t/partition_myisam.test
@@ -0,0 +1,182 @@
+--source include/have_partition.inc
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+# These tests is only useful when running on MyISAM,
+# due to DATA/INDEX directory, non transactional behavior, tests with MyISAM
+# files etc.
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+
+
+--echo #
+--echo # Bug#50036: Inconsistent errors when using TIMESTAMP
+--echo # columns/expressions
+
+--echo # Added test with existing TIMESTAMP partitioning (when it was allowed).
+CREATE TABLE t1 (a TIMESTAMP)
+ENGINE = MyISAM
+PARTITION BY HASH (UNIX_TIMESTAMP(a));
+INSERT INTO t1 VALUES ('2000-01-02 03:04:05');
+--sorted_result
+SELECT * FROM t1;
+FLUSH TABLES;
+--echo # replacing t1.frm with TO_DAYS(a) which was allowed earlier.
+--remove_file $MYSQLD_DATADIR/test/t1.frm
+--copy_file std_data/parts/t1TIMESTAMP.frm $MYSQLD_DATADIR/test/t1.frm
+--echo # Disable warnings, since the result would differ when running with
+--echo # --ps-protocol (only for the 'SELECT * FROM t1' statement).
+--disable_warnings
+--sorted_result
+SELECT * FROM t1;
+--enable_warnings
+--replace_result MyISAM <curr_engine> InnoDB <curr_engine>
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('2001-02-03 04:05:06');
+--sorted_result
+SELECT * FROM t1;
+ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
+--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
+ALTER TABLE t1
+PARTITION BY RANGE (TO_DAYS(a))
+(PARTITION p0 VALUES LESS THAN (10000),
+ PARTITION p1 VALUES LESS THAN (MAXVALUE));
+SHOW CREATE TABLE t1;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+CREATE TABLE t2 SELECT * FROM t1;
+DROP TABLE t2;
+ALTER TABLE t1 PARTITION BY HASH (UNIX_TIMESTAMP(a));
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
+SHOW CREATE TABLE t1;
+--sorted_result
+SELECT * FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Bug#31931: Mix of handlers error message
+--echo #
+--error ER_MIX_HANDLER_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY HASH (a)
+( PARTITION p0 ENGINE=MyISAM,
+ PARTITION p1);
+--error ER_MIX_HANDLER_ERROR
+CREATE TABLE t1 (a INT)
+PARTITION BY LIST (a)
+SUBPARTITION BY HASH (a)
+( PARTITION p0 VALUES IN (0)
+( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2),
+ PARTITION p1 VALUES IN (1)
+( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM));
+
+--echo #
+--echo # Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
+--echo #
+CREATE TABLE t1 (a INT)
+ENGINE = MyISAM
+PARTITION BY HASH (a);
+FLUSH TABLES;
+--remove_file $MYSQLD_DATADIR/test/t1.par
+--replace_result $MYSQLD_DATADIR ./
+CHECK TABLE t1;
+--error ER_FAILED_READ_FROM_PAR_FILE
+SELECT * FROM t1;
+--echo # Note that it is currently impossible to drop a partitioned table
+--echo # without the .par file
+--error ER_BAD_TABLE_ERROR
+DROP TABLE t1;
+--remove_file $MYSQLD_DATADIR/test/t1.frm
+--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYI
+--remove_file $MYSQLD_DATADIR/test/t1#P#p0.MYD
+
+--echo #
+--echo # Bug#50392: insert_id is not reset for partitioned tables
+--echo # auto_increment on duplicate entry
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY)
+ENGINE = MyISAM;
+SET INSERT_ID= 13;
+INSERT INTO t1 VALUES (NULL);
+SET INSERT_ID= 12;
+--echo # For transactional engines, 12 will not be inserted, since the failing
+--echo # statement is rolled back.
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+--echo # NOTE: 12 exists only in non transactional engines!
+SELECT * FROM t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY)
+ENGINE = MyISAM
+PARTITION BY KEY(a);
+SET INSERT_ID= 13;
+INSERT INTO t1 VALUES (NULL);
+SET INSERT_ID= 12;
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1;
+DROP TABLE t1;
+#
+# Bug#30102: rename table does corrupt tables with partition files on failure
+#
+--echo # Bug#30102 test
+CREATE TABLE t1 (a INT)
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (6),
+ PARTITION `p1....................` VALUES LESS THAN (9),
+ PARTITION p2 VALUES LESS THAN MAXVALUE);
+# partition p1 is 't1#P#p1' + @002e * 20 = 107 characters + file ending
+# total path lenght of './test/t1#P#p1@002e@002e<...>@002e.MY[ID]' is 118 chars
+--echo # List of files in database `test`, all original t1-files here
+--list_files $MYSQLD_DATADIR/test t1*
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+--echo # Renaming to a file name where the first partition is 250 chars
+--echo # and the second partition is 350 chars
+# 7,7 avoids the error message, which is not deterministic.
+--error 7,7
+RENAME TABLE t1 TO `t2_new..............................................end`;
+# 1234567890123456789012345678901234567890123456
+--echo # List of files in database `test`, should not be any t2-files here
+--list_files $MYSQLD_DATADIR/test t2*
+--echo # List of files in database `test`, should be all t1-files here
+--list_files $MYSQLD_DATADIR/test t1*
+--sorted_result
+SELECT * FROM t1;
+--echo # List of files in database `test`, should be all t1-files here
+--list_files $MYSQLD_DATADIR/test t1*
+--echo # Renaming to a file name where the first partition is 156 chars
+--echo # and the second partition is 256 chars
+# 7,7 avoids the error message, which is not deterministic.
+--error 7,7
+RENAME TABLE t1 TO `t2_............................_end`;
+# 1234567890123456789012345678
+# 7 + 4 + 5 + 28 * 5 = 16 + 140 = 156
+--echo # List of files in database `test`, should not be any t2-files here
+--list_files $MYSQLD_DATADIR/test t2*
+--echo # List of files in database `test`, should be all t1-files here
+--list_files $MYSQLD_DATADIR/test t1*
+--sorted_result
+SELECT * FROM t1;
+DROP TABLE t1;
+--echo # Should not be any files left here
+--list_files $MYSQLD_DATADIR/test t1*
+--list_files $MYSQLD_DATADIR/test t2*
+--echo # End of bug#30102 test.
+
+--echo # Test of post-push fix for bug#11766249/59316
+CREATE TABLE t1 (a INT, b VARCHAR(255), PRIMARY KEY (a))
+ENGINE = MyISAM
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (0) MAX_ROWS=100,
+ PARTITION p1 VALUES LESS THAN (100) MAX_ROWS=100,
+ PARTITION pMax VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (1, "Partition p1, first row");
+DROP TABLE t1;
diff --git a/mysql-test/t/partition_not_embedded.test b/mysql-test/t/partition_not_embedded.test
deleted file mode 100644
index 5c512085a9e..00000000000
--- a/mysql-test/t/partition_not_embedded.test
+++ /dev/null
@@ -1,53 +0,0 @@
--- source include/have_partition.inc
--- source include/not_embedded.inc
---disable_warnings
-DROP TABLE IF EXISTS t1, t2;
---enable_warnings
-let $MYSQLD_DATADIR= `SELECT @@datadir`;
-
-#
-# Bug#30102: rename table does corrupt tables with partition files on failure
-#
---echo # Bug#30102 test
-CREATE TABLE t1 (a INT)
-PARTITION BY RANGE (a)
-(PARTITION p0 VALUES LESS THAN (6),
- PARTITION `p1....................` VALUES LESS THAN (9),
- PARTITION p2 VALUES LESS THAN MAXVALUE);
-# partition p1 is 't1#P#p1' + @002e * 20 = 107 characters + file ending
-# total path lenght of './test/t1#P#p1@002e@002e<...>@002e.MY[ID]' is 118 chars
---echo # List of files in database `test`, all original t1-files here
---list_files $MYSQLD_DATADIR/test t1*
-INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
---echo # Renaming to a file name where the first partition is 250 chars
---echo # and the second partition is 350 chars
-# 7,7 avoids the error message, which is not deterministic.
---error 7,7
-RENAME TABLE t1 TO `t2_new..............................................end`;
-# 1234567890123456789012345678901234567890123456
---echo # List of files in database `test`, should not be any t2-files here
---list_files $MYSQLD_DATADIR/test t2*
---echo # List of files in database `test`, should be all t1-files here
---list_files $MYSQLD_DATADIR/test t1*
---sorted_result
-SELECT * FROM t1;
---echo # List of files in database `test`, should be all t1-files here
---list_files $MYSQLD_DATADIR/test t1*
---echo # Renaming to a file name where the first partition is 156 chars
---echo # and the second partition is 256 chars
-# 7,7 avoids the error message, which is not deterministic.
---error 7,7
-RENAME TABLE t1 TO `t2_............................_end`;
-# 1234567890123456789012345678
-# 7 + 4 + 5 + 28 * 5 = 16 + 140 = 156
---echo # List of files in database `test`, should not be any t2-files here
---list_files $MYSQLD_DATADIR/test t2*
---echo # List of files in database `test`, should be all t1-files here
---list_files $MYSQLD_DATADIR/test t1*
---sorted_result
-SELECT * FROM t1;
-DROP TABLE t1;
---echo # Should not be any files left here
---list_files $MYSQLD_DATADIR/test t1*
---list_files $MYSQLD_DATADIR/test t2*
---echo # End of bug#30102 test.
diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test
index 4e2c1b98a70..3ff03248d88 100644
--- a/mysql-test/t/partition_range.test
+++ b/mysql-test/t/partition_range.test
@@ -30,8 +30,8 @@ DROP TABLE t1;
#
#BUG#49591, Add proper version number to SHOW CREATE TABLE
#
-create table t1 (a int)
-partition by range (a)
+create table t1 (a DATETIME)
+partition by range (TO_DAYS(a))
subpartition by hash(to_seconds(a))
(partition p0 values less than (1));
show create table t1;
diff --git a/mysql-test/t/partition_symlink.test b/mysql-test/t/partition_symlink.test
index 4147d2c6e89..5fdde8e0abc 100644
--- a/mysql-test/t/partition_symlink.test
+++ b/mysql-test/t/partition_symlink.test
@@ -1,5 +1,6 @@
# Test that must have symlink. eg. using DATA/INDEX DIR
# (DATA/INDEX DIR requires symlinks)
+# This test is only useful for MyISAM, since no other engine supports DATA DIR
-- source include/have_partition.inc
-- source include/have_symlink.inc
# remove the not_windows line after fixing bug#33687
@@ -33,13 +34,14 @@ DROP DATABASE IF EXISTS mysqltest2;
CREATE USER mysqltest_1@localhost;
CREATE DATABASE mysqltest2;
USE mysqltest2;
- CREATE TABLE t1 (a INT);
+ CREATE TABLE t1 (a INT) ENGINE = MyISAM;
INSERT INTO t1 VALUES (0);
connect(con1,localhost,mysqltest_1,,);
-- echo # user mysqltest_1:
USE test;
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 (a INT)
+ ENGINE = MyISAM
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp'
@@ -82,6 +84,7 @@ connection default;
USE mysqltest2;
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 (a INT)
+ ENGINE = MyISAM
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp'
@@ -96,6 +99,7 @@ connection con1;
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- error 1,1
eval CREATE TABLE t1 (a INT)
+ ENGINE = MyISAM
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp'
@@ -107,6 +111,7 @@ connection con1;
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- error 1,1
eval CREATE TABLE t1 (a INT)
+ ENGINE = MyISAM
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (0)
DATA DIRECTORY '$MYSQLTEST_VARDIR/tmp'
@@ -128,6 +133,7 @@ connection default;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create table t2 (i int )
+ENGINE = MyISAM
partition by range (i)
(
partition p01 values less than (1000)
@@ -139,6 +145,7 @@ set @org_mode=@@sql_mode;
set @@sql_mode='NO_DIR_IN_CREATE';
select @@sql_mode;
create table t1 (i int )
+ENGINE = MyISAM
partition by range (i)
(
partition p01 values less than (1000)
@@ -157,6 +164,7 @@ set @@sql_mode=@org_mode;
# Added ER_WRONG_TABLE_NAME and reported bug#39045
-- error ER_WRONG_ARGUMENTS, ER_WRONG_TABLE_NAME
create table t1 (a int)
+ENGINE = MyISAM
partition by key (a)
(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
@@ -167,6 +175,7 @@ partition by key (a)
# Added ER_WRONG_TABLE_NAME and reported bug#39045
--error ER_WRONG_ARGUMENTS, ER_WRONG_TABLE_NAME
create table t1 (a int)
+ENGINE = MyISAM
partition by key (a)
(partition p0,
partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
diff --git a/mysql-test/t/plugin_auth-master.opt b/mysql-test/t/plugin_auth-master.opt
new file mode 100644
index 00000000000..3536d102387
--- /dev/null
+++ b/mysql-test/t/plugin_auth-master.opt
@@ -0,0 +1,2 @@
+$PLUGIN_AUTH_OPT
+$PLUGIN_AUTH_LOAD
diff --git a/mysql-test/t/plugin_auth.test b/mysql-test/t/plugin_auth.test
new file mode 100644
index 00000000000..a81cf4e4783
--- /dev/null
+++ b/mysql-test/t/plugin_auth.test
@@ -0,0 +1,515 @@
+--source include/have_plugin_auth.inc
+--source include/not_embedded.inc
+--source include/mysql_upgrade_preparation.inc
+
+query_vertical SELECT PLUGIN_STATUS, PLUGIN_TYPE, PLUGIN_DESCRIPTION
+ FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='test_plugin_server';
+
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+
+SELECT plugin,authentication_string FROM mysql.user WHERE User='plug';
+
+--echo ## test plugin auth
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR : this should fail : no grant
+connect(plug_con,localhost,plug,plug_dest);
+--enable_query_log
+
+GRANT PROXY ON plug_dest TO plug;
+--echo test proxies_priv columns
+--replace_column 1 xx 7 xx
+SELECT * FROM mysql.proxies_priv;
+--echo test mysql.proxies_priv;
+SHOW CREATE TABLE mysql.proxies_priv;
+
+connect(plug_con,localhost,plug,plug_dest);
+
+connection plug_con;
+select USER(),CURRENT_USER();
+
+--echo ## test SET PASSWORD
+#--error ER_SET_PASSWORD_AUTH_PLUGIN
+SET PASSWORD = PASSWORD('plug_dest');
+
+connection default;
+disconnect plug_con;
+
+--echo ## test bad credentials
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect(plug_con,localhost,plug,bad_credentials);
+--enable_query_log
+
+--echo ## test bad default plugin : should get CR_AUTH_PLUGIN_CANNOT_LOAD
+--disable_result_log
+--disable_query_log
+--error 2059
+connect(plug_con_wrongp,localhost,plug,plug_dest,,,,,wrong_plugin_name);
+--enable_query_log
+--enable_result_log
+
+--echo ## test correct default plugin
+connect(plug_con_rightp,localhost,plug,plug_dest,,,,,auth_test_plugin);
+connection plug_con_rightp;
+select USER(),CURRENT_USER();
+connection default;
+disconnect plug_con_rightp;
+
+--echo ## test no_auto_create_user sql mode with plugin users
+SET @@sql_mode=no_auto_create_user;
+GRANT INSERT ON TEST.* TO grant_user IDENTIFIED WITH 'test_plugin_server';
+SET @@sql_mode=default;
+DROP USER grant_user;
+
+--echo ## test utf-8 user name
+CREATE USER `Ÿ` IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+
+GRANT PROXY ON plug_dest TO `Ÿ`;
+
+connect(non_ascii,localhost,Ÿ,plug_dest);
+connection non_ascii;
+select USER(),CURRENT_USER();
+
+connection default;
+disconnect non_ascii;
+DROP USER `Ÿ`;
+
+--echo ## test GRANT ... IDENTIFIED WITH/BY ...
+
+CREATE DATABASE test_grant_db;
+
+--echo # create new user via GRANT WITH
+GRANT ALL PRIVILEGES ON test_grant_db.* TO new_grant_user
+ IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+
+GRANT PROXY ON plug_dest TO new_grant_user;
+
+connect(plug_con_grant,localhost,new_grant_user,plug_dest);
+connection plug_con_grant;
+select USER(),CURRENT_USER();
+USE test_grant_db;
+CREATE TABLE t1 (a INT);
+DROP TABLE t1;
+connection default;
+disconnect plug_con_grant;
+REVOKE ALL PRIVILEGES ON test_grant_db.* FROM new_grant_user;
+
+--echo # try re-create existing user via GRANT IDENTIFIED BY
+GRANT ALL PRIVILEGES ON test_grant_db.* TO new_grant_user
+ IDENTIFIED BY 'unused_password';
+
+--echo # make sure password doesn't take precendence
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect(plug_con_grant_deny,localhost,new_grant_user,unused_password);
+--enable_query_log
+
+--echo #make sure plugin auth still available
+connect(plug_con_grant,localhost,new_grant_user,plug_dest);
+connection plug_con_grant;
+select USER(),CURRENT_USER();
+USE test_grant_db;
+CREATE TABLE t1 (a INT);
+DROP TABLE t1;
+connection default;
+disconnect plug_con_grant;
+
+DROP USER new_grant_user;
+
+--echo # try re-create existing user via GRANT IDENTIFIED WITH
+
+--error ER_GRANT_PLUGIN_USER_EXISTS
+GRANT ALL PRIVILEGES ON test_grant_db.* TO plug
+ IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+
+--error ER_GRANT_PLUGIN_USER_EXISTS
+GRANT ALL PRIVILEGES ON test_grant_db.* TO plug_dest
+ IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+
+--error ER_PARSE_ERROR
+REVOKE SELECT on test_grant_db.* FROM joro
+ INDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+
+--error ER_PARSE_ERROR
+REVOKE SELECT on test_grant_db.* FROM joro
+ INDENTIFIED BY 'plug_dest_passwd';
+
+--error ER_PARSE_ERROR
+REVOKE SELECT on test_grant_db.* FROM joro
+ INDENTIFIED BY PASSWORD 'plug_dest_passwd';
+
+DROP DATABASE test_grant_db;
+
+--echo ## GRANT PROXY tests
+
+CREATE USER grant_plug IDENTIFIED WITH 'test_plugin_server'
+ AS 'grant_plug_dest';
+CREATE USER grant_plug_dest IDENTIFIED BY 'grant_plug_dest_passwd';
+CREATE USER grant_plug_dest2 IDENTIFIED BY 'grant_plug_dest_passwd2';
+
+--echo # ALL PRIVILEGES doesn't include PROXY
+GRANT ALL PRIVILEGES ON *.* TO grant_plug;
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR : this should fail : no grant
+connect(grant_plug_con,localhost,grant_plug,grant_plug_dest);
+--enable_query_log
+
+--error ER_PARSE_ERROR : this should fail : can't combine PROXY
+GRANT ALL PRIVILEGES,PROXY ON grant_plug_dest TO grant_plug;
+
+--echo this should fail : can't combine PROXY
+--error ER_PARSE_ERROR
+GRANT ALL SELECT,PROXY ON grant_plug_dest TO grant_plug;
+
+--echo # this should fail : no such grant
+--error ER_NONEXISTING_GRANT
+REVOKE PROXY ON grant_plug_dest FROM grant_plug;
+
+connect(grant_plug_dest_con,localhost,grant_plug_dest,grant_plug_dest_passwd);
+connection grant_plug_dest_con;
+--echo in grant_plug_dest_con
+
+--echo ## testing what an ordinary user can grant
+--echo this should fail : no rights to grant all
+--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
+GRANT PROXY ON ''@'' TO grant_plug;
+
+--echo this should fail : not the same user
+--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
+GRANT PROXY ON grant_plug TO grant_plug_dest;
+
+--echo this should fail : same user, but on a different host
+--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
+GRANT PROXY ON grant_plug_dest TO grant_plug;
+
+--echo this should work : same user
+GRANT PROXY ON grant_plug_dest@localhost TO grant_plug_dest2;
+REVOKE PROXY ON grant_plug_dest@localhost FROM grant_plug_dest2;
+
+--echo this should work : same user
+GRANT PROXY ON grant_plug_dest@localhost TO grant_plug WITH GRANT OPTION;
+REVOKE PROXY ON grant_plug_dest@localhost FROM grant_plug;
+
+--echo this should fail : can't create users
+--error ER_CANT_CREATE_USER_WITH_GRANT
+GRANT PROXY ON grant_plug_dest@localhost TO grant_plug@localhost;
+
+connection default;
+--echo in default connection
+disconnect grant_plug_dest_con;
+
+--echo # test what root can grant
+
+--echo should work : root has PROXY to all users
+GRANT PROXY ON ''@'' TO grant_plug;
+REVOKE PROXY ON ''@'' FROM grant_plug;
+
+--echo should work : root has PROXY to all users
+GRANT PROXY ON ''@'' TO proxy_admin IDENTIFIED BY 'test'
+ WITH GRANT OPTION;
+
+--echo need USAGE : PROXY doesn't contain it.
+GRANT USAGE on *.* TO proxy_admin;
+
+connect (proxy_admin_con,localhost,proxy_admin,test);
+connection proxy_admin_con;
+--echo in proxy_admin_con;
+
+--echo should work : proxy_admin has proxy to ''@''
+GRANT PROXY ON future_user TO grant_plug;
+
+connection default;
+--echo in default connection
+disconnect proxy_admin_con;
+
+SHOW GRANTS FOR grant_plug;
+REVOKE PROXY ON future_user FROM grant_plug;
+SHOW GRANTS FOR grant_plug;
+
+--echo ## testing drop user
+CREATE USER test_drop@localhost;
+GRANT PROXY ON future_user TO test_drop@localhost;
+SHOW GRANTS FOR test_drop@localhost;
+DROP USER test_drop@localhost;
+SELECT * FROM mysql.proxies_priv WHERE Host = 'test_drop' AND User = 'localhost';
+
+DROP USER proxy_admin;
+
+DROP USER grant_plug,grant_plug_dest,grant_plug_dest2;
+
+--echo ## END GRANT PROXY tests
+
+--echo ## cleanup
+DROP USER plug;
+DROP USER plug_dest;
+
+--echo ## @@proxy_user tests
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug;
+
+SELECT USER(),CURRENT_USER(),@@LOCAL.proxy_user;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@GLOBAL.proxy_user;
+SELECT @@LOCAL.proxy_user;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL proxy_user = 'test';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET LOCAL proxy_user = 'test';
+SELECT @@LOCAL.proxy_user;
+
+connect(plug_con,localhost,plug,plug_dest);
+connection plug_con;
+--echo # in connection plug_con
+SELECT @@LOCAL.proxy_user;
+connection default;
+--echo # in connection default
+disconnect plug_con;
+
+--echo ## cleanup
+DROP USER plug;
+DROP USER plug_dest;
+--echo ## END @@proxy_user tests
+
+--echo ## @@external_user tests
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug;
+SELECT USER(),CURRENT_USER(),@@LOCAL.external_user;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@GLOBAL.external_user;
+SELECT @@LOCAL.external_user;
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL external_user = 'test';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET LOCAL external_user = 'test';
+SELECT @@LOCAL.external_user;
+
+connect(plug_con,localhost,plug,plug_dest);
+connection plug_con;
+--echo # in connection plug_con
+SELECT @@LOCAL.external_user;
+connection default;
+--echo # in connection default
+disconnect plug_con;
+
+--echo ## cleanup
+DROP USER plug;
+DROP USER plug_dest;
+--echo ## END @@external_user tests
+
+--echo #
+--echo # Bug #56798 : Wrong credentials assigned when using a proxy user.
+--echo #
+
+GRANT ALL PRIVILEGES ON *.* TO power_user;
+GRANT USAGE ON anonymous_db.* TO ''@''
+ IDENTIFIED WITH 'test_plugin_server' AS 'power_user';
+GRANT PROXY ON power_user TO ''@'';
+CREATE DATABASE confidential_db;
+
+connect(plug_con,localhost, test_login_user, power_user, confidential_db);
+SELECT user(),current_user(),@@proxy_user;
+
+connection default;
+disconnect plug_con;
+
+DROP USER power_user;
+DROP USER ''@'';
+DROP DATABASE confidential_db;
+
+--echo # Test case #2 (crash with double grant proxy)
+
+CREATE USER ''@'' IDENTIFIED WITH 'test_plugin_server' AS 'standard_user';
+CREATE USER standard_user;
+CREATE DATABASE shared;
+GRANT ALL PRIVILEGES ON shared.* TO standard_user;
+GRANT PROXY ON standard_user TO ''@'';
+--echo #should not crash
+GRANT PROXY ON standard_user TO ''@'';
+
+DROP USER ''@'';
+DROP USER standard_user;
+DROP DATABASE shared;
+
+
+--echo #
+--echo # Bug #57551 : Live upgrade fails between 5.1.52 -> 5.5.7-rc
+--echo #
+
+CALL mtr.add_suppression("Missing system table mysql.proxies_priv.");
+
+DROP TABLE mysql.proxies_priv;
+
+--echo # Must come back with mysql.proxies_priv absent.
+--source include/restart_mysqld.inc
+
+--error ER_NO_SUCH_TABLE
+SELECT * FROM mysql.proxies_priv;
+
+CREATE USER u1@localhost;
+GRANT ALL PRIVILEGES ON *.* TO u1@localhost;
+REVOKE ALL PRIVILEGES ON *.* FROM u1@localhost;
+GRANT ALL PRIVILEGES ON *.* TO u1@localhost;
+
+CREATE USER u2@localhost;
+GRANT ALL PRIVILEGES ON *.* TO u2@localhost;
+
+--echo # access denied because of no privileges to root
+--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
+GRANT PROXY ON u2@localhost TO u1@localhost;
+
+--echo # access denied because of no privileges to root
+--error ER_ACCESS_DENIED_NO_PASSWORD_ERROR
+REVOKE PROXY ON u2@localhost FROM u1@localhost;
+
+--echo # go try graning proxy on itself, so that it will need the table
+connect(proxy_granter_con,localhost,u2,);
+connection proxy_granter_con;
+
+--error ER_NO_SUCH_TABLE
+GRANT PROXY ON u2@localhost TO u1@localhost;
+--error ER_NO_SUCH_TABLE
+REVOKE PROXY ON u2@localhost FROM u1@localhost;
+
+connection default;
+disconnect proxy_granter_con;
+
+--echo # test if REVOKE works without the proxies_priv table
+REVOKE ALL PRIVILEGES ON *.* FROM u1@localhost, u2@localhost;
+
+--echo # test if DROP USER work without the proxies_priv table
+DROP USER u1@localhost,u2@localhost;
+
+--echo # test if FLUSH PRIVILEGES works without the proxies_priv table
+FLUSH PRIVILEGES;
+
+--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
+--query_vertical SELECT Host,User,Proxied_host,Proxied_user,With_grant FROM mysql.proxies_priv
+
+FLUSH PRIVILEGES;
+
+--echo #
+--echo # Bug#58139 : default-auth option not recognized in MySQL standard
+--echo # command line clients
+--echo #
+
+--echo # Executing 'mysql'
+--exec $MYSQL -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-auth=auth_test_plugin $PLUGIN_AUTH_OPT -e "SELECT 1"
+
+--echo # Executing 'mysqladmin'
+--exec $MYSQLADMIN -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-auth=auth_test_plugin $PLUGIN_AUTH_OPT ping
+
+--echo # Executing 'mysqldump'
+--exec $MYSQL_DUMP -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --compact --default-auth=auth_test_plugin $PLUGIN_AUTH_OPT test
+
+--echo # Executing 'mysql_upgrade'
+--exec $MYSQL_UPGRADE -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-auth=auth_test_plugin $PLUGIN_AUTH_OPT --skip-verbose --force --upgrade-system-tables
+
+--echo #
+--echo # Bug #59657: Move the client authentication_pam plugin into the
+--echo # server repository
+--echo #
+
+CREATE USER uplain@localhost IDENTIFIED WITH 'cleartext_plugin_server'
+ AS 'cleartext_test';
+
+--echo ## test plugin auth
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR : this should fail : no grant
+connect(cleartext_fail_con,localhost,uplain,cleartext_test2);
+--enable_query_log
+
+connect(cleartext_con,localhost,uplain,cleartext_test);
+connection cleartext_con;
+select USER(),CURRENT_USER();
+
+connection default;
+disconnect cleartext_con;
+DROP USER uplain@localhost;
+
+--echo #
+--echo # Bug #59038 : mysql.user.authentication_string column
+--echo # causes configuration wizard to fail
+
+INSERT INTO mysql.user(
+ Host,
+ User,
+ Password,
+ Select_priv,
+ Insert_priv,
+ Update_priv,
+ Delete_priv,
+ Create_priv,
+ Drop_priv,
+ Reload_priv,
+ Shutdown_priv,
+ Process_priv,
+ File_priv,
+ Grant_priv,
+ References_priv,
+ Index_priv,
+ Alter_priv,
+ Show_db_priv,
+ Super_priv,
+ Create_tmp_table_priv,
+ Lock_tables_priv,
+ Execute_priv,
+ Repl_slave_priv,
+ Repl_client_priv,
+ /*!50001
+ Create_view_priv,
+ Show_view_priv,
+ Create_routine_priv,
+ Alter_routine_priv,
+ Create_user_priv,
+ */
+ ssl_type,
+ ssl_cipher,
+ x509_issuer,
+ x509_subject,
+ max_questions,
+ max_updates,
+ max_connections)
+VALUES (
+ 'localhost',
+ 'inserttest', '',
+ 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
+ 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
+ /*!50001 'Y', 'Y', 'Y', 'Y', 'Y', */'', '', '', '', '0', '0', '0');
+FLUSH PRIVILEGES;
+DROP USER inserttest@localhost;
+SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE
+ COLUMN_NAME IN ('authentication_string', 'plugin') AND
+ TABLE_NAME='user' AND
+ TABLE_SCHEMA='mysql'
+ORDER BY COLUMN_NAME;
+
+
+--echo #
+--echo # Bug #11936829: diff. between mysql.user (authentication_string)
+--echo # in fresh and upgraded 5.5.11
+--echo #
+
+SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND
+ COLUMN_NAME IN ('plugin', 'authentication_string')
+ ORDER BY COLUMN_NAME;
+ALTER TABLE mysql.user MODIFY plugin char(64) DEFAULT '' NOT NULL;
+ALTER TABLE mysql.user MODIFY authentication_string TEXT NOT NULL;
+
+--echo Run mysql_upgrade on a 5.5.10 external authentication column layout
+--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
+
+SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND
+ COLUMN_NAME IN ('plugin', 'authentication_string')
+ ORDER BY COLUMN_NAME;
+
+
+--echo End of 5.5 tests
diff --git a/mysql-test/t/plugin_auth_qa-master.opt b/mysql-test/t/plugin_auth_qa-master.opt
new file mode 100644
index 00000000000..3536d102387
--- /dev/null
+++ b/mysql-test/t/plugin_auth_qa-master.opt
@@ -0,0 +1,2 @@
+$PLUGIN_AUTH_OPT
+$PLUGIN_AUTH_LOAD
diff --git a/mysql-test/t/plugin_auth_qa.test b/mysql-test/t/plugin_auth_qa.test
new file mode 100644
index 00000000000..0961c1dfef5
--- /dev/null
+++ b/mysql-test/t/plugin_auth_qa.test
@@ -0,0 +1,338 @@
+# The numbers represent test cases of the test plan.
+
+--source include/have_plugin_auth.inc
+--source include/not_embedded.inc
+
+CREATE DATABASE test_user_db;
+
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+--echo ========== test 1.1 ======================================================
+# without '', without AS part
+CREATE USER plug IDENTIFIED WITH test_plugin_server;
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server;
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug;
+DROP USER plug;
+# with '', without AS part
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug;
+DROP USER plug;
+# without '', AS part empty
+CREATE USER plug IDENTIFIED WITH test_plugin_server AS '';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS '';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug;
+DROP USER plug;
+# with '', AS part empty without ''
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS ;
+--error ER_PARSE_ERROR
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS;
+# without '', AS part without ''
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED WITH test_plugin_server AS plug_dest;
+--error ER_PARSE_ERROR
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS plug_dest;
+--echo ========== test 1.1 syntax errors ========================================
+# without auth_name
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED WITH AS plug_dest;
+--error ER_PARSE_ERROR
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH AS plug_dest;
+# without auth_name and AS part
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED WITH;
+--error ER_PARSE_ERROR
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH;
+# without auth_name but AS part
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED AS '';
+--error ER_PARSE_ERROR
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED AS '';
+# with 2 auth_name parts
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' IDENTIFIED WITH 'test_plugin_server';
+--error ER_PARSE_ERROR
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug
+ IDENTIFIED WITH 'test_plugin_server' IDENTIFIED WITH 'test_plugin_server';
+# with 2 AS parts
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS '' AS 'plug_dest';
+--error ER_PARSE_ERROR
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug AS '' AS 'plug_dest';
+# with 2 complete WITH parts
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS ''
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+--error ER_PARSE_ERROR
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS ''
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+# with BY and WITH part
+--error ER_PARSE_ERROR
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'
+ IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+--error ER_PARSE_ERROR
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd'
+ IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+# with WITH part and BY part
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
+ USER plug_dest IDENTIFIED by 'plug_dest_pwd';
+--error ER_PARSE_ERROR
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
+ USER plug_dest IDENTIFIED by 'plug_dest_pwd';
+# with WITH part and BY part
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
+ plug_dest IDENTIFIED by 'plug_dest_pwd';
+--error ER_PARSE_ERROR
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
+ plug_dest IDENTIFIED by 'plug_dest_pwd';
+# with WITH part and BY part
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
+ IDENTIFIED by 'plug_dest_pwd';
+--error ER_PARSE_ERROR
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'
+ IDENTIFIED by 'plug_dest_pwd';
+
+--echo ========== test 1.1 combinations ==========================
+# CREATE...WITH/CREATE...BY
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+--echo ========== test 1.1.1.6/1.1.2.5 ============================
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug, plug_dest;
+#
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug;
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug_dest;
+# GRANT...WITH/CREATE...BY
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug, plug_dest;
+#
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug;
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug_dest;
+# CREATE...WITH/GRANT...BY
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug, plug_dest;
+#
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug_dest;
+#
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+--error 1700
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+--error 1700
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server';
+DROP USER plug;
+#
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+--error ER_CANNOT_USER
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+--error ER_CANNOT_USER
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server';
+DROP USER plug;
+#
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+--sorted_result
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+DROP USER plug;
+#
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+--error ER_CANNOT_USER
+CREATE USER plug IDENTIFIED BY 'plug_dest_passwd';
+DROP USER plug;
+#
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+--sorted_result
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+DROP USER plug,plug_dest;
+#
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
+--sorted_result
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+--sorted_result
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+DROP USER plug,plug_dest;
+#
+
+--echo ========== test 1.1.1.1/1.1.2.1/1.1.1.5 ====================
+
+SET NAMES utf8;
+#
+CREATE USER plüg IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plüg;
+CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plüg_dest;
+
+SET NAMES ascii;
+#
+CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER 'plüg';
+CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER 'plüg_dest';
+
+SET NAMES latin1;
+#
+--echo ========== test 1.1.1.5 ====================================
+--error ER_PLUGIN_IS_NOT_LOADED
+CREATE USER 'plüg' IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest';
+CREATE USER 'plug' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER 'plug';
+CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER 'plüg_dest';
+
+SET NAMES utf8;
+#
+--error ER_PLUGIN_IS_NOT_LOADED
+CREATE USER plüg IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest';
+CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER 'plüg';
+CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER 'plüg_dest';
+
+CREATE USER plüg IDENTIFIED WITH test_plugin_server AS 'plüg_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plüg;
+CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plüg_dest;
+
+--echo ========== test 1.1.1.2/1.1.2.2=============================
+
+SET @auth_name= 'test_plugin_server';
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED WITH @auth_name AS 'plug_dest';
+
+SET @auth_string= 'plug_dest';
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED WITH test_plugin_server AS @auth_string;
+
+--echo ========== test 1.1.1.3/1.1.2.3=============================
+
+--error ER_PLUGIN_IS_NOT_LOADED
+CREATE USER plug IDENTIFIED WITH 'hh''s_test_plugin_server' AS 'plug_dest';
+
+CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'hh''s_plug_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug;
+CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER 'hh''s_plug_dest';
+
+--echo ========== test 1.1.1.4 ====================================
+
+--error ER_PARSE_ERROR
+CREATE USER plug IDENTIFIED WITH hh''s_test_plugin_server AS 'plug_dest';
+
+--echo ========== test 1.1.3.1 ====================================
+
+GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+CREATE USER plug_dest;
+DROP USER plug_dest;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest;
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER grant_user,plug_dest;
+#
+set @save_sql_mode= @@sql_mode;
+SET @@sql_mode=no_auto_create_user;
+GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+CREATE USER plug_dest;
+DROP USER plug_dest;
+--error ER_PASSWORD_NO_MATCH
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest;
+DROP USER grant_user;
+#
+GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+DROP USER plug_dest;
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_user_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+DROP USER grant_user,plug_dest;
+set @@sql_mode= @save_sql_mode;
+#
+DROP DATABASE test_user_db;
+--exit
+
diff --git a/mysql-test/t/plugin_auth_qa_1-master.opt b/mysql-test/t/plugin_auth_qa_1-master.opt
new file mode 100644
index 00000000000..3536d102387
--- /dev/null
+++ b/mysql-test/t/plugin_auth_qa_1-master.opt
@@ -0,0 +1,2 @@
+$PLUGIN_AUTH_OPT
+$PLUGIN_AUTH_LOAD
diff --git a/mysql-test/t/plugin_auth_qa_1.test b/mysql-test/t/plugin_auth_qa_1.test
new file mode 100644
index 00000000000..06908935b01
--- /dev/null
+++ b/mysql-test/t/plugin_auth_qa_1.test
@@ -0,0 +1,340 @@
+# The numbers represent test cases of the test plan.
+
+--source include/have_plugin_auth.inc
+--source include/not_embedded.inc
+
+CREATE DATABASE test_user_db;
+
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+
+--echo ========== test 1.1.3.2 ====================================
+
+# CREATE...WITH/CREATE...BY/GRANT
+CREATE USER plug_user IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug_user;
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
+REVOKE PROXY ON plug_dest FROM plug_user;
+--error 1
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
+DROP USER plug_user,plug_dest;
+#
+# GRANT...WITH
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug_user;
+
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+--echo 1)
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
+REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_user'
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+--echo 2)
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
+REVOKE PROXY ON plug_dest FROM plug_user;
+--echo 3)
+--error 1
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
+DROP USER plug_user,plug_dest;
+#
+# GRANT...WITH/CREATE...BY
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+--echo 1)
+--error 1
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
+GRANT PROXY ON plug_dest TO plug_user;
+--echo 2)
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1
+REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_user'
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+#REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_dest'
+# IDENTIFIED BY 'plug_dest_passwd';
+DROP USER plug_user,plug_dest;
+
+--echo ========== test 1.2 ========================================
+
+# GRANT...WITH/CREATE...BY
+GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug_user;
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1
+RENAME USER plug_dest TO new_dest;
+--error 1
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1
+GRANT PROXY ON new_dest TO plug_user;
+--error 1
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=new_dest -e "SELECT current_user();SELECT user();" 2>&1
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug_user,new_dest;
+
+# CREATE...WITH/CREATE...BY
+CREATE USER plug_user
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+--error 1
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1
+GRANT PROXY ON plug_dest TO plug_user;
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1
+RENAME USER plug_dest TO new_dest;
+--error 1
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1
+GRANT PROXY ON new_dest TO plug_user;
+--error 1
+--exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=new_dest -e "SELECT current_user();SELECT user();" 2>&1
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug_user,new_dest;
+# CREATE...WITH
+CREATE USER plug_user
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug_user;
+--echo connect(plug_user,localhost,plug_user,plug_dest);
+connect(plug_user,localhost,plug_user,plug_dest);
+select USER(),CURRENT_USER();
+--echo connection default;
+connection default;
+--echo disconnect plug_user;
+disconnect plug_user;
+RENAME USER plug_user TO new_user;
+--echo connect(plug_user,localhost,new_user,plug_dest);
+connect(plug_user,localhost,new_user,plug_dest);
+select USER(),CURRENT_USER();
+--echo connection default;
+connection default;
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+--echo disconnect plug_user;
+disconnect plug_user;
+UPDATE mysql.user SET user='plug_user' WHERE user='new_user';
+FLUSH PRIVILEGES;
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+DROP USER plug_dest,plug_user;
+--echo ========== test 1.3 ========================================
+
+#
+CREATE USER plug_user
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug_user;
+--echo connect(plug_user,localhost,plug_user,plug_dest);
+connect(plug_user,localhost,plug_user,plug_dest);
+select USER(),CURRENT_USER();
+--echo connection default;
+connection default;
+--echo disconnect plug_user;
+disconnect plug_user;
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+UPDATE mysql.user SET user='new_user' WHERE user='plug_user';
+FLUSH PRIVILEGES;
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+UPDATE mysql.user SET authentication_string='new_dest' WHERE user='new_user';
+FLUSH PRIVILEGES;
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+UPDATE mysql.user SET plugin='new_plugin_server' WHERE user='new_user';
+FLUSH PRIVILEGES;
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+--echo connect(plug_user,localhost,new_user,new_dest);
+--disable_query_log
+--error ER_PLUGIN_IS_NOT_LOADED
+connect(plug_user,localhost,new_user,new_dest);
+--enable_query_log
+UPDATE mysql.user SET plugin='test_plugin_server' WHERE user='new_user';
+UPDATE mysql.user SET USER='new_dest' WHERE user='plug_dest';
+FLUSH PRIVILEGES;
+GRANT PROXY ON new_dest TO new_user;
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+--echo connect(plug_user,localhost,new_user,new_dest);
+connect(plug_user,localhost,new_user,new_dest);
+select USER(),CURRENT_USER();
+--echo connection default;
+connection default;
+--echo disconnect plug_user;
+disconnect plug_user;
+UPDATE mysql.user SET USER='plug_dest' WHERE user='new_dest';
+FLUSH PRIVILEGES;
+CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+GRANT ALL PRIVILEGES ON test.* TO new_user;
+--echo connect(plug_user,localhost,new_dest,new_dest_passwd);
+connect(plug_user,localhost,new_dest,new_dest_passwd);
+select USER(),CURRENT_USER();
+--echo connection default;
+connection default;
+--echo disconnect plug_user;
+disconnect plug_user;
+DROP USER new_user,new_dest,plug_dest;
+
+--echo ========== test 2, 2.1, 2.2 ================================
+
+CREATE USER ''@'' IDENTIFIED WITH test_plugin_server AS 'proxied_user';
+CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+--echo connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+SELECT USER(),CURRENT_USER();
+--echo ========== test 2.2.1 ======================================
+SELECT @@proxy_user;
+--echo connection default;
+connection default;
+--echo disconnect proxy_con;
+disconnect proxy_con;
+--echo connect(proxy_con,localhost,proxy_user,proxied_user);
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR : this should fail : no grant
+connect(proxy_con,localhost,proxy_user,proxied_user);
+--enable_query_log
+GRANT PROXY ON proxied_user TO ''@'';
+--echo connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+SELECT USER(),CURRENT_USER();
+--echo connection default;
+connection default;
+--echo disconnect proxy_con;
+disconnect proxy_con;
+--echo connect(proxy_con,localhost,proxy_user,proxied_user);
+connect(proxy_con,localhost,proxy_user,proxied_user);
+SELECT USER(),CURRENT_USER();
+--echo ========== test 2.2.1 ======================================
+SELECT @@proxy_user;
+--echo connection default;
+connection default;
+--echo disconnect proxy_con;
+disconnect proxy_con;
+DROP USER ''@'',proxied_user;
+#
+GRANT ALL PRIVILEGES ON test_user_db.* TO ''@''
+ IDENTIFIED WITH test_plugin_server AS 'proxied_user';
+CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+--echo connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+SELECT USER(),CURRENT_USER();
+SELECT @@proxy_user;
+--echo connection default;
+connection default;
+--echo disconnect proxy_con;
+disconnect proxy_con;
+--echo connect(proxy_con,localhost,proxy_user,proxied_user);
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR : this should fail : no grant
+connect(proxy_con,localhost,proxy_user,proxied_user);
+--enable_query_log
+GRANT PROXY ON proxied_user TO ''@'';
+--echo connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+SELECT USER(),CURRENT_USER();
+--echo connection default;
+connection default;
+--echo disconnect proxy_con;
+disconnect proxy_con;
+--echo connect(proxy_con,localhost,proxy_user,proxied_user);
+connect(proxy_con,localhost,proxy_user,proxied_user);
+SELECT USER(),CURRENT_USER();
+SELECT @@proxy_user;
+--echo connection default;
+connection default;
+--echo disconnect proxy_con;
+disconnect proxy_con;
+DROP USER ''@'',proxied_user;
+#
+CREATE USER ''@'' IDENTIFIED WITH test_plugin_server AS 'proxied_user';
+CREATE USER proxied_user_1 IDENTIFIED BY 'proxied_user_1_pwd';
+CREATE USER proxied_user_2 IDENTIFIED BY 'proxied_user_2_pwd';
+CREATE USER proxied_user_3 IDENTIFIED BY 'proxied_user_3_pwd';
+CREATE USER proxied_user_4 IDENTIFIED BY 'proxied_user_4_pwd';
+CREATE USER proxied_user_5 IDENTIFIED BY 'proxied_user_5_pwd';
+GRANT PROXY ON proxied_user_1 TO ''@'';
+GRANT PROXY ON proxied_user_2 TO ''@'';
+GRANT PROXY ON proxied_user_3 TO ''@'';
+GRANT PROXY ON proxied_user_4 TO ''@'';
+GRANT PROXY ON proxied_user_5 TO ''@'';
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+--echo connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd');
+connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd');
+--echo connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd);
+connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd);
+--echo connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd);
+connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd);
+--echo connect(proxy_con_4,localhost,proxied_user_4,proxied_user_4_pwd);
+connect(proxy_con_4,localhost,proxied_user_4,proxied_user_4_pwd);
+--echo connect(proxy_con_5,localhost,proxied_user_5,proxied_user_5_pwd);
+connect(proxy_con_5,localhost,proxied_user_5,proxied_user_5_pwd);
+--echo connection proxy_con_1;
+connection proxy_con_1;
+SELECT USER(),CURRENT_USER();
+SELECT @@proxy_user;
+--echo connection proxy_con_2;
+connection proxy_con_2;
+SELECT USER(),CURRENT_USER();
+SELECT @@proxy_user;
+--echo connection proxy_con_3;
+connection proxy_con_3;
+SELECT USER(),CURRENT_USER();
+SELECT @@proxy_user;
+--echo connection proxy_con_4;
+connection proxy_con_4;
+SELECT USER(),CURRENT_USER();
+SELECT @@proxy_user;
+--echo connection proxy_con_5;
+connection proxy_con_5;
+SELECT USER(),CURRENT_USER();
+SELECT @@proxy_user;
+--echo connection default;
+connection default;
+--echo disconnect proxy_con_1;
+disconnect proxy_con_1;
+--echo disconnect proxy_con_2;
+disconnect proxy_con_2;
+--echo disconnect proxy_con_3;
+disconnect proxy_con_3;
+--echo disconnect proxy_con_4;
+disconnect proxy_con_4;
+--echo disconnect proxy_con_5;
+disconnect proxy_con_5;
+DROP USER ''@'',proxied_user_1,proxied_user_2,proxied_user_3,proxied_user_4,proxied_user_5;
+
+--echo ========== test 3 ==========================================
+
+GRANT ALL PRIVILEGES ON *.* TO plug_user
+ IDENTIFIED WITH test_plugin_server AS 'plug_dest';
+CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
+GRANT PROXY ON plug_dest TO plug_user;
+FLUSH PRIVILEGES;
+
+# Not working with the patch.
+
+#--replace_result $MYSQLADMIN MYSQLADMIN $MASTER_MYPORT MYPORT $MASTER_MYSOCK MYSOCK
+#--exec $MYSQLADMIN $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -S $MASTER_MYSOCK -u plug_user --password=plug_dest ping 2>&1
+#--replace_result $MYSQL_CHECK MYSQL_CHECK $MASTER_MYPORT MYPORT
+#--exec $MYSQL_CHECK $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u plug_user --password=plug_dest test
+#--replace_result $MYSQL_DUMP MYSQL_DUMP $MASTER_MYPORT MYPORT
+#--exec $MYSQL_DUMP -h localhost -P $MASTER_MYPORT $PLUGIN_AUTH_OPT -u plug_user --password=plug_dest test
+#--replace_result $MYSQL_SHOW MYSQL_SHOW $MASTER_MYPORT MYPORT
+#--exec $MYSQL_SHOW $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --plugin_dir=../plugin/auth -u plug_user --password=plug_dest 2>&1
+DROP USER plug_user, plug_dest;
+DROP DATABASE test_user_db;
+--exit
diff --git a/mysql-test/t/plugin_auth_qa_2-master.opt b/mysql-test/t/plugin_auth_qa_2-master.opt
new file mode 100644
index 00000000000..354907b9366
--- /dev/null
+++ b/mysql-test/t/plugin_auth_qa_2-master.opt
@@ -0,0 +1,2 @@
+$PLUGIN_AUTH_INTERFACE_OPT
+$PLUGIN_AUTH_INTERFACE_LOAD
diff --git a/mysql-test/t/plugin_auth_qa_2.test b/mysql-test/t/plugin_auth_qa_2.test
new file mode 100644
index 00000000000..e265690dc7d
--- /dev/null
+++ b/mysql-test/t/plugin_auth_qa_2.test
@@ -0,0 +1,153 @@
+# Horst Hunger
+# Created: 2010-10-06
+#
+# Test of the authentification interface. The plugin checks the expected values set
+# by this application and the application checks the values set the the plugin.
+--source include/have_plugin_interface.inc
+--source include/not_embedded.inc
+
+CREATE DATABASE test_user_db;
+
+--echo ========== test 1.1.3.2 ====================================
+--echo === check contens of components of info ====================
+
+CREATE USER qa_test_1_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_1_dest';
+CREATE USER qa_test_1_dest IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_1_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_1_dest TO qa_test_1_user;
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+SELECT @@proxy_user;
+SELECT @@external_user;
+
+--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_1_user --password=qa_test_1_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u qa_test_1_user --password=qa_test_1_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+
+DROP USER qa_test_1_user;
+DROP USER qa_test_1_dest;
+
+--echo === Assign values to components of info ====================
+
+CREATE USER qa_test_2_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_2_dest';
+CREATE USER qa_test_2_dest IDENTIFIED BY 'dest_passwd';
+CREATE USER authenticated_as IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_2_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_2_dest TO qa_test_2_user;
+GRANT PROXY ON authenticated_as TO qa_test_2_user;
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+SELECT @@proxy_user;
+SELECT @@external_user;
+
+--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
+
+DROP USER qa_test_2_user;
+DROP USER qa_test_2_dest;
+DROP USER authenticated_as;
+
+--echo === Assign too high values for *length, which should have no effect ====
+
+CREATE USER qa_test_3_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_3_dest';
+CREATE USER qa_test_3_dest IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_3_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_3_dest TO qa_test_3_user;
+
+--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+
+DROP USER qa_test_3_user;
+DROP USER qa_test_3_dest;
+
+--echo === Assign too low values for *length, which should have no effect ====
+
+CREATE USER qa_test_4_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_4_dest';
+CREATE USER qa_test_4_dest IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_4_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_4_dest TO qa_test_4_user;
+
+--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+
+DROP USER qa_test_4_user;
+DROP USER qa_test_4_dest;
+
+--echo === Assign empty string especially to authenticated_as (in plugin) ====
+
+CREATE USER qa_test_5_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_5_dest';
+CREATE USER qa_test_5_dest IDENTIFIED BY 'dest_passwd';
+CREATE USER ''@'localhost' IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_5_dest identified by 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO ''@'localhost' identified by 'dest_passwd';
+GRANT PROXY ON qa_test_5_dest TO qa_test_5_user;
+GRANT PROXY ON qa_test_5_dest TO ''@'localhost';
+
+--sorted_result
+SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root';
+
+--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+--error 1
+--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+
+DROP USER qa_test_5_user;
+DROP USER qa_test_5_dest;
+DROP USER ''@'localhost';
+
+--echo === Assign 'root' especially to authenticated_as (in plugin) ====
+
+CREATE USER qa_test_6_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest';
+CREATE USER qa_test_6_dest IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_6_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_6_dest TO qa_test_6_user;
+
+--sorted_result
+SELECT user,plugin,authentication_string,password FROM mysql.user;
+
+--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+--error 1
+--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+
+GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest';
+--sorted_result
+SELECT user,plugin,authentication_string,password FROM mysql.user;
+
+--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+--error 1
+--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+
+REVOKE PROXY ON qa_test_6_dest FROM root;
+--sorted_result
+SELECT user,plugin,authentication_string FROM mysql.user;
+
+--echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+--error 1
+--exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+
+DROP USER qa_test_6_user;
+DROP USER qa_test_6_dest;
+DELETE FROM mysql.user WHERE user='root' AND plugin='qa_auth_interface';
+--sorted_result
+SELECT user,plugin,authentication_string,password FROM mysql.user;
+
+
+--echo === Test of the --default_auth option for clients ====
+
+CREATE USER qa_test_11_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_11_dest';
+CREATE USER qa_test_11_dest IDENTIFIED BY 'dest_passwd';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_11_dest TO qa_test_11_user;
+
+--echo exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+--error 1
+--exec $MYSQL $PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P $MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+
+DROP USER qa_test_11_user, qa_test_11_dest;
+DROP DATABASE test_user_db;
+
+--exit
diff --git a/mysql-test/t/plugin_auth_qa_3-master.opt b/mysql-test/t/plugin_auth_qa_3-master.opt
new file mode 100644
index 00000000000..e1754862a4d
--- /dev/null
+++ b/mysql-test/t/plugin_auth_qa_3-master.opt
@@ -0,0 +1,2 @@
+$PLUGIN_AUTH_SERVER_OPT
+$PLUGIN_AUTH_SERVER_LOAD
diff --git a/mysql-test/t/plugin_auth_qa_3.test b/mysql-test/t/plugin_auth_qa_3.test
new file mode 100644
index 00000000000..f7d90226332
--- /dev/null
+++ b/mysql-test/t/plugin_auth_qa_3.test
@@ -0,0 +1,25 @@
+# Horst Hunger
+# Created: 2010-10-06
+#
+# Test of the authentification interface. The plugin checks the expected values set
+# by this application and the application checks the values set the the plugin.
+--source include/have_plugin_server.inc
+--source include/not_embedded.inc
+
+CREATE DATABASE test_user_db;
+
+CREATE USER qa_test_11_user IDENTIFIED WITH qa_auth_server AS 'qa_test_11_dest';
+GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_passwd';
+GRANT PROXY ON qa_test_11_dest TO qa_test_11_user;
+
+--echo exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+--exec $MYSQL $PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P $MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+
+--echo exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+--error 1
+--exec $MYSQL $PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P $MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
+
+DROP USER qa_test_11_user, qa_test_11_dest;
+DROP DATABASE test_user_db;
+
+--exit
diff --git a/mysql-test/t/plugin_load_option-master.opt b/mysql-test/t/plugin_load_option-master.opt
new file mode 100644
index 00000000000..e22ecb4ff3a
--- /dev/null
+++ b/mysql-test/t/plugin_load_option-master.opt
@@ -0,0 +1,3 @@
+$EXAMPLE_PLUGIN_OPT
+$EXAMPLE_PLUGIN_LOAD
+--loose-plugin-example=FORCE_PLUS_PERMANENT
diff --git a/mysql-test/t/plugin_load_option.test b/mysql-test/t/plugin_load_option.test
new file mode 100644
index 00000000000..e49b693b5be
--- /dev/null
+++ b/mysql-test/t/plugin_load_option.test
@@ -0,0 +1,8 @@
+--source include/not_windows_embedded.inc
+--source include/have_example_plugin.inc
+
+--error ER_PLUGIN_IS_PERMANENT
+UNINSTALL PLUGIN example;
+
+SELECT PLUGIN_NAME, PLUGIN_STATUS, LOAD_OPTION FROM INFORMATION_SCHEMA.PLUGINS
+WHERE PLUGIN_NAME IN ('MyISAM', 'EXAMPLE');
diff --git a/mysql-test/t/plugin_not_embedded.test b/mysql-test/t/plugin_not_embedded.test
index 11350e8c896..f183d1f0ffe 100644
--- a/mysql-test/t/plugin_not_embedded.test
+++ b/mysql-test/t/plugin_not_embedded.test
@@ -18,3 +18,15 @@ UNINSTALL PLUGIN example;
disconnect con1;
connection default;
DROP USER bug51770@localhost;
+
+#
+# BUG#58246: INSTALL PLUGIN not secure & crashable
+#
+# The bug consisted of not recognizing / on Windows, so checking / on
+# all platforms should cover this case.
+
+let $path = `select CONCAT_WS('/', '..', '$EXAMPLE_PLUGIN')`;
+--replace_regex /\.dll/.so/
+--error ER_UDF_NO_PATHS
+eval INSTALL PLUGIN example SONAME '$path';
+
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index a2ff40b7896..f53e72defcd 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -3108,6 +3108,7 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+--echo
--echo End of 5.1 tests.
###########################################################################
@@ -3302,6 +3303,12 @@ SELECT @a;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
+###########################################################################
+
+--source t/wl4435_generated.inc
+
+###########################################################################
+
--echo
--echo # End of WL#4435.
@@ -3344,7 +3351,21 @@ connection default;
DROP TABLE t1;
disconnect con1;
+--echo
+--echo #
+--echo # Bug#56115: invalid memory reads when PS selecting from
+--echo # information_schema tables
+--echo # Bug#58701: crash in Field::make_field, cursor-protocol
+--echo #
+--echo # NOTE: MTR should be run both with --ps-protocol and --cursor-protocol.
+--echo #
+--echo
+
+SELECT *
+FROM (SELECT 1 UNION SELECT 2) t;
+
+
--echo #
---echo # End of 6.0 tests.
+--echo # End of 5.5 tests.
###########################################################################
diff --git a/mysql-test/t/query_cache_28249.test b/mysql-test/t/query_cache_28249.test
index 21768b27c2e..b1be7c57343 100644
--- a/mysql-test/t/query_cache_28249.test
+++ b/mysql-test/t/query_cache_28249.test
@@ -30,7 +30,7 @@ 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;
+SET GLOBAL query_cache_size= 102400;
FLUSH TABLES;
--disable_warnings
@@ -58,18 +58,18 @@ connection user3;
# Typical information_schema.processlist content after sufficient sleep time
# ID USER COMMAND TIME STATE INFO
# ....
-# 2 root Query 5 Waiting for table level lock SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
+# 2 root Query 5 Waiting for table metadata lock SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
# ....
# XXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# The values marked with 'X' must be reached.
--echo # Poll till the select of connection user1 is blocked by the write lock on t1.
let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist
-WHERE state = 'Waiting for table level lock'
+WHERE state = 'Waiting for table metadata lock'
AND info = '$select_for_qc';
--source include/wait_condition.inc
eval
SELECT user,command,state,info FROM information_schema.processlist
-WHERE state = 'Waiting for table level lock'
+WHERE state = 'Waiting for table metadata lock'
AND info = '$select_for_qc';
INSERT INTO t1 VALUES (4);
diff --git a/mysql-test/t/query_cache_debug.test b/mysql-test/t/query_cache_debug.test
index c2cd4d796aa..70b3c81168d 100644
--- a/mysql-test/t/query_cache_debug.test
+++ b/mysql-test/t/query_cache_debug.test
@@ -1,6 +1,6 @@
--source include/not_embedded.inc
--source include/have_query_cache.inc
---source include/have_debug.inc
+--source include/have_debug_sync.inc
#
# Bug #30887 Server crashes on SET GLOBAL query_cache_size=0
@@ -18,12 +18,11 @@ connect (bug30887con2, localhost, root, ,test);
connection bug30887con1;
--echo Activate debug hook and attempt to retrieve the statement from the cache.
-set session debug='+d,foobar,wait_in_query_cache_insert';
+set debug_sync="wait_in_query_cache_insert SIGNAL parked WAIT_FOR go";
--send select SQL_CACHE * from t1;
connection default;
-let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'wait_in_query_cache_insert';
---source include/wait_condition.inc
+set debug_sync="now WAIT_FOR parked";
connection bug30887con2;
--echo On a second connection; clear the query cache.
@@ -32,14 +31,18 @@ set global query_cache_size= 0;
connection default;
--echo Signal the debug hook to release the lock.
-select id from information_schema.processlist where state='wait_in_query_cache_insert' into @thread_id;
-kill query @thread_id;
+set debug_sync="now SIGNAL go";
--echo Show query cache status.
show status like 'Qcache_queries_in_cache';
+connection bug30887con1;
+--reap
+
disconnect bug30887con1;
disconnect bug30887con2;
+connection default;
+set debug_sync= 'RESET';
set global query_cache_size= 0;
use test;
drop table t1;
@@ -67,18 +70,14 @@ connect(con2,localhost,root,,test,,);
connection con1;
--echo # Switch to connection con1
-SET SESSION debug='+d,foobar,wait_after_query_cache_invalidate';
+SET DEBUG_SYNC = "wait_after_query_cache_invalidate SIGNAL parked WAIT_FOR go";
--echo # Send concurrent insert, will wait in the query cache table invalidate
--send INSERT INTO t1 VALUES (4)
connection default;
--echo # Switch to connection default
--echo # Wait for concurrent insert to reach the debug point
-let $wait_condition=
- SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
- WHERE STATE = "wait_after_query_cache_invalidate" AND
- INFO = "INSERT INTO t1 VALUES (4)";
---source include/wait_condition.inc
+SET DEBUG_SYNC = "now WAIT_FOR parked";
connection con2;
--echo # Switch to connection con2
@@ -88,9 +87,7 @@ SELECT * FROM t1;
connection default;
--echo # Switch to connection default
--echo # Notify the concurrent insert to proceed
-SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
- WHERE STATE = 'wait_after_query_cache_invalidate' INTO @thread_id;
-KILL QUERY @thread_id;
+SET DEBUG_SYNC = "now SIGNAL go";
connection con1;
--echo # Switch to connection con1
@@ -107,6 +104,7 @@ disconnect con2;
connection default;
--echo # Restore defaults
+SET DEBUG_SYNC= 'RESET';
RESET QUERY CACHE;
DROP TABLE t1,t2;
SET GLOBAL concurrent_insert= DEFAULT;
@@ -157,15 +155,14 @@ SELECT SQL_CACHE * FROM t1;
--echo ** before the mutex lock in invalidate_table_internal.
--echo ** This will allow new result sets to be written into the QC.
--echo **
-SET SESSION debug='+d,foobar,wait_in_query_cache_invalidate1';
-SET SESSION debug='+d,foobar,wait_in_query_cache_invalidate2';
+SET DEBUG_SYNC="wait_in_query_cache_invalidate1 SIGNAL parked1_1 WAIT_FOR go1_1";
+SET DEBUG_SYNC="wait_in_query_cache_invalidate2 SIGNAL parked1_2 WAIT_FOR go1_2";
--send DELETE FROM t1 WHERE a like '%a%';
connection default;
--echo =================================== Connection default
--echo ** Assert that the expect process status is obtained.
-LET $wait_condition= SELECT SQL_NO_CACHE COUNT(*)= 1 FROM information_schema.processlist WHERE state= 'wait_in_query_cache_invalidate1';
---source include/wait_condition.inc
+SET DEBUG_SYNC="now WAIT_FOR parked1_1";
-- echo **
connection thd2;
@@ -173,32 +170,36 @@ connection thd2;
--echo ** On THD2: Insert a result into the cache. This attempt will be blocked
--echo ** because of a debug hook placed just before the mutex lock after which
--echo ** the first part of the result set is written.
-SET SESSION debug='+d,foobar,wait_in_query_cache_insert';
+SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked2 WAIT_FOR go2 EXECUTE 1";
--send SELECT SQL_CACHE * FROM t2 UNION SELECT * FROM t3
+connection default;
+--echo =================================== Connection default
+--echo ** Assert that the SELECT-stmt thread reaches the sync point.
+SET DEBUG_SYNC="now WAIT_FOR parked2";
+--echo **
+--echo **
+
connection thd3;
--echo =================================== Connection thd3
--echo ** On THD3: Insert another result into the cache and block on the same
--echo ** debug hook.
-SET SESSION debug='+d,foobar,wait_in_query_cache_insert';
---send SELECT SQL_CACHE * FROM t4 UNION SELECT * FROM t5;
+SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked3 WAIT_FOR go3 EXECUTE 1";
+--send SELECT SQL_CACHE * FROM t4 UNION SELECT * FROM t5
connection default;
--echo =================================== Connection default
---echo ** Assert that the two SELECT-stmt threads to reach the hook.
-LET $wait_condition= SELECT SQL_NO_CACHE COUNT(*)= 2 FROM information_schema.processlist WHERE state='wait_in_query_cache_insert';
---source include/wait_condition.inc
+--echo ** Assert that the SELECT-stmt thread reaches the sync point.
+SET DEBUG_SYNC="now WAIT_FOR parked3";
--echo **
--echo **
--echo ** Signal the DELETE thread, THD1, to continue. It will enter the mutex
--echo ** lock and set query cache status to TABLE_FLUSH_IN_PROGRESS and then
--echo ** unlock the mutex before stopping on the next debug hook.
-SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_invalidate1' LIMIT 1 INTO @flush_thread_id;
-KILL QUERY @flush_thread_id;
+SET DEBUG_SYNC="now SIGNAL go1_1";
--echo ** Assert that we reach the next debug hook.
-LET $wait_condition= SELECT SQL_NO_CACHE COUNT(*)= 1 FROM information_schema.processlist WHERE state='wait_in_query_cache_invalidate2';
---source include/wait_condition.inc
+SET DEBUG_SYNC="now WAIT_FOR parked1_2";
--echo **
--echo ** Signal the remaining debug hooks blocking THD2 and THD3.
@@ -206,10 +207,18 @@ LET $wait_condition= SELECT SQL_NO_CACHE COUNT(*)= 1 FROM information_schema.pro
--echo ** and finally release the mutex. The threads will continue to wait
--echo ** until a broadcast signal reaches them causing both threads to
--echo ** come alive and check the condition.
-SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' ORDER BY id ASC LIMIT 1 INTO @thread_id;
-KILL QUERY @thread_id;
-SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' ORDER BY id DESC LIMIT 1 INTO @thread_id;
-KILL QUERY @thread_id;
+SET DEBUG_SYNC="now SIGNAL go2";
+--echo ** Wait for thd2 to receive the signal
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM information_schema.processlist
+ WHERE state = "Waiting for query cache lock";
+--source include/wait_condition.inc
+SET DEBUG_SYNC="now SIGNAL go3";
+--echo ** Wait for thd3 to receive the signal
+let $wait_condition=
+ SELECT COUNT(*) = 2 FROM information_schema.processlist
+ WHERE state = "Waiting for query cache lock";
+--source include/wait_condition.inc
--echo **
--echo ** Finally signal the DELETE statement on THD1 one last time.
@@ -218,11 +227,7 @@ KILL QUERY @thread_id;
--echo ** One signal will be sent to the thread group waiting for executing
--echo ** invalidations and a broadcast signal will be sent to the thread
--echo ** group holding result set writers.
-SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_invalidate2' LIMIT 1 INTO @flush_thread_id;
-KILL QUERY @flush_thread_id;
-
-LET $wait_condition= SELECT SQL_NO_CACHE COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE Id = @flush_thread_id AND Command = 'Sleep';
---source include/wait_condition.inc
+SET DEBUG_SYNC="now SIGNAL go1_2";
--echo **
--echo *************************************************************************
@@ -250,6 +255,7 @@ connection default;
disconnect thd1;
disconnect thd2;
disconnect thd3;
+SET DEBUG_SYNC= 'RESET';
SET GLOBAL query_cache_size= 0;
connection default;
@@ -259,4 +265,66 @@ FLUSH STATUS;
DROP TABLE t1,t2,t3,t4,t5;
SET GLOBAL query_cache_size= DEFAULT;
SET GLOBAL query_cache_type= DEFAULT;
-exit;
+
+--echo #
+--echo # Bug#56822: Add a thread state for sessions waiting on the query cache lock
+--echo #
+
+SET @old_query_cache_size= @@GLOBAL.query_cache_size;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+
+SET GLOBAL concurrent_insert= 1;
+SET GLOBAL query_cache_size= 1024*512;
+SET GLOBAL query_cache_type= ON;
+
+connect(con1,localhost,root,,test,,);
+connect(con2,localhost,root,,test,,);
+
+connection con1;
+--echo # Switch to connection con1
+SET DEBUG_SYNC = "wait_in_query_cache_invalidate2 SIGNAL parked WAIT_FOR go";
+--echo # Send INSERT, will wait in the query cache table invalidation
+--send INSERT INTO t1 VALUES (4);
+
+connection default;
+--echo # Switch to connection default
+--echo # Wait for insert to reach the debug point
+SET DEBUG_SYNC = "now WAIT_FOR parked";
+
+connection con2;
+--echo # Switch to connection con2
+--echo # Send a query that should wait on the query cache lock
+--send RESET QUERY CACHE
+
+connection default;
+--echo # Switch to connection default
+--echo # Wait for the state to be reflected in the processlist
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM information_schema.processlist
+ WHERE state = "Waiting for query cache lock" AND info = "RESET QUERY CACHE";
+--source include/wait_condition.inc
+--echo # Signal that the query cache can be unlocked
+SET DEBUG_SYNC="now SIGNAL go";
+
+connection con1;
+--echo # Reap con1 and disconnect
+--reap
+disconnect con1;
+
+connection con2;
+--echo # Reap con2 and disconnect
+--reap
+disconnect con2;
+
+connection default;
+--echo # Restore defaults
+SET DEBUG_SYNC= 'RESET';
+RESET QUERY CACHE;
+DROP TABLE t1;
+SET GLOBAL query_cache_size= DEFAULT;
+SET GLOBAL query_cache_type= DEFAULT;
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 0ad3d3e8504..6c9320b708a 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -1325,4 +1325,71 @@ SELECT * FROM t1 WHERE 2 NOT BETWEEN c_notkey AND c_key;
DROP TABLE t1;
+--echo #
+--echo # Bug #57030: 'BETWEEN' evaluation is incorrect
+--echo #
+
+# Test some BETWEEN predicates which does *not* follow the
+# 'normal' pattern of <field> BETWEEN <low const> AND <high const>
+
+CREATE TABLE t1(pk INT PRIMARY KEY, i4 INT);
+CREATE UNIQUE INDEX i4_uq ON t1(i4);
+
+INSERT INTO t1 VALUES (1,10), (2,20), (3,30);
+
+EXPLAIN
+SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 10;
+SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 10;
+
+EXPLAIN
+SELECT * FROM t1 WHERE 10 BETWEEN i4 AND i4;
+SELECT * FROM t1 WHERE 10 BETWEEN i4 AND i4;
+
+EXPLAIN
+SELECT * FROM t1 WHERE 10 BETWEEN 10 AND i4;
+SELECT * FROM t1 WHERE 10 BETWEEN 10 AND i4;
+
+EXPLAIN
+SELECT * FROM t1 WHERE 10 BETWEEN i4 AND 10;
+SELECT * FROM t1 WHERE 10 BETWEEN i4 AND 10;
+
+EXPLAIN
+SELECT * FROM t1 WHERE 10 BETWEEN 10 AND 10;
+SELECT * FROM t1 WHERE 10 BETWEEN 10 AND 10;
+
+EXPLAIN
+SELECT * FROM t1 WHERE 10 BETWEEN 11 AND 11;
+SELECT * FROM t1 WHERE 10 BETWEEN 11 AND 11;
+
+EXPLAIN
+SELECT * FROM t1 WHERE 10 BETWEEN 100 AND 0;
+SELECT * FROM t1 WHERE 10 BETWEEN 100 AND 0;
+
+EXPLAIN
+SELECT * FROM t1 WHERE i4 BETWEEN 100 AND 0;
+SELECT * FROM t1 WHERE i4 BETWEEN 100 AND 0;
+
+EXPLAIN
+SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 99999999999999999;
+SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 99999999999999999;
+
+EXPLAIN
+SELECT * FROM t1 WHERE i4 BETWEEN 999999999999999 AND 30;
+SELECT * FROM t1 WHERE i4 BETWEEN 999999999999999 AND 30;
+
+EXPLAIN
+SELECT * FROM t1 WHERE i4 BETWEEN 10 AND '20';
+SELECT * FROM t1 WHERE i4 BETWEEN 10 AND '20';
+
+#Should detect the EQ_REF 't2.pk=t1.i4'
+EXPLAIN
+SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4;
+SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4;
+
+EXPLAIN
+SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk;
+SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk;
+
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/rpl_mysqldump_slave.test b/mysql-test/t/rpl_mysqldump_slave.test
index 8f27646ba08..3f39fe19c0a 100644
--- a/mysql-test/t/rpl_mysqldump_slave.test
+++ b/mysql-test/t/rpl_mysqldump_slave.test
@@ -1,4 +1,4 @@
-source include/master-slave.inc;
+--source include/master-slave.inc
--echo #
--echo # New --dump-slave, --apply-slave-statements functionality
@@ -26,3 +26,5 @@ connection slave;
--replace_result $MASTER_MYPORT MASTER_MYPORT
# Execute mysqldump with --dump-slave ,--apply-slave-statements and --include-master-host-port
--exec $MYSQL_DUMP_SLAVE --compact --dump-slave --apply-slave-statements --include-master-host-port test
+
+--source include/rpl_end.inc
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 96510bdcf7e..ab0487e6acf 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -4124,6 +4124,76 @@ SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci;
DROP TABLE t1;
+
+--echo #
+--echo # Bug #58422: Incorrect result when OUTER JOIN'ing
+--echo # with an empty table
+--echo #
+
+CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM;
+CREATE TABLE t1(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM;
+INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
+CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM;
+INSERT INTO t2 VALUES (1,1), (2,2), (3,3);
+
+EXPLAIN
+SELECT *
+ FROM
+ t1
+ LEFT OUTER JOIN
+ (t2 INNER JOIN t_empty ON TRUE)
+ ON t1.pk=t2.pk
+ WHERE t2.pk <> 2;
+
+SELECT *
+ FROM
+ t1
+ LEFT OUTER JOIN
+ (t2 INNER JOIN t_empty ON TRUE)
+ ON t1.pk=t2.pk
+ WHERE t2.pk <> 2;
+
+
+EXPLAIN
+SELECT *
+ FROM
+ t1
+ LEFT OUTER JOIN
+ (t2 CROSS JOIN t_empty)
+ ON t1.pk=t2.pk
+ WHERE t2.pk <> 2;
+
+SELECT *
+ FROM
+ t1
+ LEFT OUTER JOIN
+ (t2 CROSS JOIN t_empty)
+ ON t1.pk=t2.pk
+ WHERE t2.pk <> 2;
+
+
+EXPLAIN
+SELECT *
+ FROM
+ t1
+ LEFT OUTER JOIN
+ (t2 INNER JOIN t_empty ON t_empty.i=t2.i)
+ ON t1.pk=t2.pk
+ WHERE t2.pk <> 2;
+
+SELECT *
+ FROM
+ t1
+ LEFT OUTER JOIN
+ (t2 INNER JOIN t_empty ON t_empty.i=t2.i)
+ ON t1.pk=t2.pk
+ WHERE t2.pk <> 2;
+
+
+
+DROP TABLE t1,t2,t_empty;
+
+
--echo End of 5.1 tests
--echo #
@@ -4148,3 +4218,22 @@ DROP VIEW view_t1;
DROP TABLE t1;
--echo # End of test BUG#54515
+
+--echo #
+--echo # Bug #57203 Assertion `field_length <= 255' failed.
+--echo #
+
+SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)")))))
+UNION ALL
+SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)")))))
+AS foo
+;
+
+CREATE table t1(a text);
+INSERT INTO t1 VALUES (''), ('');
+SELECT avg(distinct(t1.a)) FROM t1, t1 t2
+GROUP BY t2.a ORDER BY t1.a;
+
+DROP TABLE t1;
+
+--echo # End of test BUG#57203
diff --git a/mysql-test/t/shm.test b/mysql-test/t/shm.test
index 567caa4989a..4c765c43c1b 100644
--- a/mysql-test/t/shm.test
+++ b/mysql-test/t/shm.test
@@ -2,9 +2,12 @@
# to optimize things we skip this test on all other platforms
--source include/windows.inc
+# thread pool causes different results
+-- source include/not_threadpool.inc
+
# Only run this test if shared memory is avaliable
let $shm= query_get_value("SHOW VARIABLES LIKE 'shared_memory'", Value, 1);
-if (`SELECT '$shm' != 'ON'`){
+if ($shm != ON){
skip No shm support;
}
let $shm_name= query_get_value("SHOW GLOBAL VARIABLES LIKE 'shared_memory_base_name'", Value, 1);
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index fa9dc7472fe..bc5ac8ac63f 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -1,3 +1,33 @@
+# Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# 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
+#
+
+################################################################################
+#
+# NOTICE:
+#
+# This file unfortunately contains characters in various different encodings.
+# Be careful when editing this file to ensure that you (or your editor) do
+# not change things (such as encodings) on lines that you did not mean to
+# modify.
+#
+################################################################################
+
+
# Uses GRANT commands that usually disabled in embedded server
-- source include/not_embedded.inc
@@ -5,9 +35,6 @@
# depends on the presence of the log tables (which are CSV-based).
--source include/have_csv.inc
-# Save the initial number of concurrent sessions
---source include/count_sessions.inc
-
#
# Test of some show commands
#
@@ -53,7 +80,7 @@ optimize table t1;
optimize table t1;
drop table t1;
-#show variables;
+# 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
@@ -226,14 +253,6 @@ CREATE TABLE """a" (i INT);
SHOW CREATE TABLE """a";
DROP TABLE """a";
-# Bug#4374 SHOW TABLE STATUS FROM ignores collation_connection
-#set names latin1;
-#create database `ä`;
-#create table `ä`.`ä` (a int) engine=heap;
-#--replace_column 7 # 8 # 9 #
-#show table status from `ä` LIKE 'ä';
-#drop database `ä`;
-
# to test quotes around keywords.. :
SET sql_mode= '';
@@ -332,6 +351,7 @@ drop table t1;
--error ER_DBACCESS_DENIED_ERROR
drop database mysqltest;
disconnect con1;
+--source include/wait_until_disconnected.inc
connect (con2,localhost,mysqltest_2,,test);
connection con2;
@@ -344,6 +364,7 @@ drop table mysqltest.t1;
--error ER_DBACCESS_DENIED_ERROR
drop database mysqltest;
disconnect con2;
+--source include/wait_until_disconnected.inc
connect (con3,localhost,mysqltest_3,,test);
connection con3;
@@ -353,6 +374,7 @@ show create database mysqltest;
drop table mysqltest.t1;
drop database mysqltest;
disconnect con3;
+--source include/wait_until_disconnected.inc
connection default;
set names binary;
@@ -362,15 +384,6 @@ delete from mysql.db
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
flush privileges;
-# This test fails on MAC OSX, so it is temporary disabled.
-# This needs WL#1324 to be done.
-#set names latin1;
-#create database `ä`;
-#create table `ä`.`ä` (a int) engine=heap;
-#--replace_column 7 # 8 # 9 #
-#show table status from `ä` LIKE 'ä';
-#drop database `ä`;
-
# Test that USING <keytype> is always shown in SHOW CREATE TABLE when it was
# specified during table creation, but not otherwise. (Bug#7235)
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
@@ -900,10 +913,12 @@ CREATE TABLE t1(ËÏÌÏÎËÁ1 INT);
--let $outfile1=$MYSQLTEST_VARDIR/tmp/show_check.mysqltest1.sql
+--source include/count_sessions.inc
--echo
--echo ---> Dumping mysqltest1 to outfile1
-
--exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $outfile1
+# Take care that the additional session caused by MYSQL_DUMP has disappeared.
+--source include/wait_until_count_sessions.inc
# - Clean mysqltest1;
@@ -917,9 +932,12 @@ DROP DATABASE mysqltest1;
--echo
--echo
+--source include/count_sessions.inc
--echo ---> Restoring mysqltest1...
--exec $MYSQL test < $outfile1
--remove_file $outfile1
+# Take care that the additional session caused by MYSQL has disappeared.
+--source include/wait_until_count_sessions.inc
# - Check definition of the table.
@@ -989,14 +1007,14 @@ grant select on `mysqltest`.`t1` to mysqltest_4@localhost;
connect (con4,localhost,mysqltest_4,,mysqltest);
connection con4;
show create database mysqltest;
+disconnect con4;
+--source include/wait_until_disconnected.inc
connection default;
delete from mysql.user where user='mysqltest_4';
delete from mysql.db where user='mysqltest_4';
delete from mysql.tables_priv where user='mysqltest_4';
flush privileges;
drop database mysqltest;
-connection default;
-disconnect con4;
#
# Ensure that show plugin code is tested
@@ -1048,11 +1066,23 @@ show full tables;
drop table `été`;
set names latin1;
+--echo #
+--echo # Bug#4374 SHOW TABLE STATUS FROM ignores collation_connection
+--echo # Character set: Latin-1 (ISO-8859-1)
+--echo #
+SET NAMES latin1;
+CREATE DATABASE `ä`;
+CREATE TABLE `ä`.`ä` (a int) ENGINE=Memory;
+--replace_column 6 # 7 # 8 # 9 #
+SHOW TABLE STATUS FROM `ä` LIKE 'ä';
+DROP DATABASE `ä`;
+
#
# Bug#26402 Server crashes with old-style named table
#
--error ER_NO_SUCH_TABLE,ER_FILE_NOT_FOUND
show columns from `#mysql50#????????`;
+call mtr.add_suppression("Can.t find file: '.\\\\test\\\\\\?{8}.frm'");
#
# SHOW CREATE TRIGGER test.
@@ -1192,6 +1222,7 @@ SHOW ENGINE MYISAM STATUS;
--enable_result_log
disconnect conn1;
+--source include/wait_until_disconnected.inc
connection default;
DROP USER test_u@localhost;
@@ -1214,8 +1245,9 @@ CONNECTION con1;
--error ER_QUERY_INTERRUPTED
SHOW CREATE TABLE non_existent;
-CONNECTION default;
DISCONNECT con1;
+--source include/wait_until_disconnected.inc
+CONNECTION default;
--echo End of 5.1 tests
@@ -1239,9 +1271,11 @@ connection con1;
--echo # This statement used to be blocked.
SHOW CREATE TABLE t1;
+disconnect con1;
+--source include/wait_until_disconnected.inc
+
--echo # Switching to connection 'default'.
connection default;
-disconnect con1;
UNLOCK TABLES;
DROP TABLE t1;
@@ -1317,14 +1351,41 @@ connection con1;
# Should not block.
ALTER TABLE t1 CHARACTER SET = utf8;
+disconnect con1;
+--source include/wait_until_disconnected.inc
+
--echo # Connection default
connection default;
COMMIT;
DROP TRIGGER t1_bi;
DROP TABLE t1;
-disconnect con1;
-# Wait till all disconnects are completed
---source include/wait_until_count_sessions.inc
+--echo #
+--echo # Bug#57306 SHOW PROCESSLIST does not display string literals well.
+--echo #
+
+SET NAMES latin1;
+SELECT GET_LOCK('t', 1000);
+--connect (con1,localhost,root,,)
+--connection con1
+SET NAMES latin1;
+--send SELECT GET_LOCK('t',1000) AS 'óóóó';
+--connection default
+# Make sure con1 has switched from "SET NAMES" to "SELECT GET_LOCK"
+let $wait_timeout= 10;
+let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%GET_LOCK%' AND ID != CONNECTION_ID();
+--source include/wait_condition.inc
+--replace_column 1 ### 3 ### 6 ### 7 ###
+SHOW PROCESSLIST;
+SET NAMES utf8;
+--replace_column 1 ### 3 ### 6 ### 7 ###
+SHOW PROCESSLIST;
+SELECT RELEASE_LOCK('t');
+--connection con1
+--reap
+--disconnect con1
+--source include/wait_until_disconnected.inc
+--connection default
+SET NAMES latin1;
diff --git a/mysql-test/t/sp-bugs.test b/mysql-test/t/sp-bugs.test
index 8aa0791e265..fe52632c784 100644
--- a/mysql-test/t/sp-bugs.test
+++ b/mysql-test/t/sp-bugs.test
@@ -101,4 +101,41 @@ CALL p1 ();
DROP TABLE t1;
DROP PROCEDURE p1;
+--echo #
+--echo # Bug#54375: Error in stored procedure leaves connection
+--echo # in different default schema
+--echo #
+
+--disable_warnings
+SET @@SQL_MODE = 'STRICT_ALL_TABLES';
+DROP DATABASE IF EXISTS db1;
+CREATE DATABASE db1;
+USE db1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 int NOT NULL PRIMARY KEY);
+INSERT INTO t1 VALUES (1);
+DELIMITER $$;
+CREATE FUNCTION f1 (
+ some_value int
+)
+RETURNS smallint
+DETERMINISTIC
+BEGIN
+ INSERT INTO t1 SET c1 = some_value;
+ RETURN(LAST_INSERT_ID());
+END$$
+DELIMITER ;$$
+DROP DATABASE IF EXISTS db2;
+CREATE DATABASE db2;
+--enable_warnings
+USE db2;
+SELECT DATABASE();
+--error ER_DUP_ENTRY
+SELECT db1.f1(1);
+SELECT DATABASE();
+USE test;
+DROP FUNCTION db1.f1;
+DROP TABLE db1.t1;
+DROP DATABASE db1;
+DROP DATABASE db2;
--echo End of 5.1 tests
diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test
index 0313535f2ab..75eeda8e289 100644
--- a/mysql-test/t/sp-destruct.test
+++ b/mysql-test/t/sp-destruct.test
@@ -14,6 +14,7 @@
# Supress warnings written to the log file
call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted");
+call mtr.add_suppression("Stored routine .test...bug14233_[123].: invalid value in column mysql.proc");
# Backup proc table
let $MYSQLD_DATADIR= `select @@datadir`;
@@ -253,3 +254,30 @@ drop table mysql.proc;
--remove_file $MYSQLTEST_VARDIR/tmp/proc.frm
--remove_file $MYSQLTEST_VARDIR/tmp/proc.MYD
--remove_file $MYSQLTEST_VARDIR/tmp/proc.MYI
+
+
+--echo #
+--echo # Bug#58414 mysql_upgrade fails on dump upgrade between 5.1.53 -> 5.5.8
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS proc_backup;
+DROP DATABASE IF EXISTS db1;
+--enable_warnings
+
+--echo # Backup the proc table
+RENAME TABLE mysql.proc TO proc_backup;
+CREATE TABLE mysql.proc LIKE proc_backup;
+
+CREATE DATABASE db1;
+CREATE PROCEDURE db1.p1() SET @foo = 10;
+
+--echo # Modify a field of the table.
+ALTER TABLE mysql.proc MODIFY comment CHAR (32);
+
+# This should not fail even if mysql.proc is invalid.
+DROP DATABASE db1;
+
+--echo # Restore mysql.proc
+DROP TABLE mysql.proc;
+RENAME TABLE proc_backup TO mysql.proc;
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index 13ca55a0127..6175fc53adf 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -2719,10 +2719,6 @@ DROP PROCEDURE p1;
--echo # Bug#5889: Exit handler for a warning doesn't hide the warning in trigger
--echo #
---echo
---echo # - Case 1
---echo
-
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1 VALUES (1, 2);
@@ -2747,36 +2743,6 @@ SELECT * FROM t1;
DROP TRIGGER t1_bu;
DROP TABLE t1;
---echo
---echo # - Case 2
---echo
-
-CREATE TABLE t1(a INT);
-CREATE TABLE t2(b CHAR(1));
-
-delimiter |;
-
-CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
-BEGIN
- INSERT INTO t2 VALUES('ab'); # Produces a warning.
-
- INSERT INTO t2 VALUES('b'); # Does not produce a warning,
- # previous warning should be cleared.
-END|
-
-delimiter ;|
-
-INSERT INTO t1 VALUES(0);
-
-SHOW WARNINGS;
-
-SELECT * FROM t1;
-SELECT * FROM t2;
-
-DROP TRIGGER t1_bi;
-DROP TABLE t1;
-DROP TABLE t2;
-
--echo #
--echo # Bug#9857: Stored procedures: handler for sqlwarning ignored
--echo #
@@ -2813,3 +2779,83 @@ SHOW WARNINGS;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
SET sql_mode = @sql_mode_saved;
+
+--echo #
+--echo # Bug#55850: Trigger warnings not cleared.
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+CREATE TABLE t1(x SMALLINT, y SMALLINT, z SMALLINT);
+CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT,
+ d SMALLINT, e SMALLINT, f SMALLINT);
+
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+ INSERT INTO t2(a, b, c) VALUES(99999, 99999, 99999);
+
+CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW
+ INSERT INTO t2(d, e, f) VALUES(99999, 99999, 99999);
+
+CREATE PROCEDURE p1()
+ INSERT INTO t1 VALUES(99999, 99999, 99999);
+
+# What happened before the patch was:
+# - INSERT INTO t1 added 3 warnings about overflow in 'x', 'y' and 'z' columns;
+# - t1_bi run and added 3 warnings about overflow in 'a', 'b' and 'c' columns;
+# - t1_ai run and added 3 warnings about overflow in 'd', 'e' and 'f' columns;
+# => we had 9 warnings.
+#
+# Now what happens is:
+# - INSERT INTO t1 adds 3 warnings about overflow in 'x', 'y' and 'z' columns;
+# - t1_bi adds 3 warnings about overflow in 'a', 'b' and 'c' columns;
+# - The warnings added by triggers are cleared;
+# - t1_ai run and added 3 warnings about overflow in 'd', 'e' and 'f' columns;
+# - The warnings added by triggers are cleared;
+# => we have 3 warnings.
+
+--echo
+CALL p1();
+
+--echo
+SHOW WARNINGS;
+
+--echo
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+
+--echo # ----------------------------------------------------------------------
+
+CREATE TABLE t1(x SMALLINT, y SMALLINT, z SMALLINT);
+CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT NOT NULL);
+
+delimiter |;
+
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+ INSERT INTO t2 VALUES(
+ CAST('111111 ' AS SIGNED),
+ CAST('222222 ' AS SIGNED),
+ NULL);
+END|
+
+delimiter ;|
+
+CREATE PROCEDURE p1()
+ INSERT INTO t1 VALUES(99999, 99999, 99999);
+
+--echo
+--error ER_BAD_NULL_ERROR
+CALL p1();
+
+--echo
+SHOW WARNINGS;
+
+--echo
+DROP TABLE t1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
diff --git a/mysql-test/t/sp-lock.test b/mysql-test/t/sp-lock.test
index be8369d6994..6284169eb9b 100644
--- a/mysql-test/t/sp-lock.test
+++ b/mysql-test/t/sp-lock.test
@@ -972,5 +972,170 @@ DROP PROCEDURE p1;
--echo #
+--echo # Bug#57663 Concurrent statement using stored function and DROP DATABASE
+--echo # breaks SBR
+--echo #
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+
+connect(con1, localhost, root);
+connect(con2, localhost, root);
+
+--echo # Test 1: Check that DROP DATABASE block if a function is used
+--echo # by an active transaction.
+
+--echo # Connection default
+connection default;
+CREATE DATABASE db1;
+CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
+START TRANSACTION;
+SELECT db1.f1();
+
+--echo # Connection con1
+connection con1;
+--echo # Sending:
+--send DROP DATABASE db1
+
+--echo # Connection default
+connection default;
+--echo # Waiting for DROP DATABASE to be blocked by the lock on f1()
+let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
+ WHERE state= 'Waiting for stored function metadata lock'
+ AND info='DROP DATABASE db1';
+--source include/wait_condition.inc
+COMMIT;
+
+--echo # Connection con1
+connection con1;
+--echo # Reaping: DROP DATABASE db1
+--reap
+
+--echo # Test 2: Check that DROP DATABASE blocks if a procedure is
+--echo # used by an active transaction.
+
+--echo # Connection default
+connection default;
+CREATE DATABASE db1;
+CREATE PROCEDURE db1.p1() BEGIN END;
+delimiter |;
+CREATE FUNCTION f1() RETURNS INTEGER
+BEGIN
+ CALL db1.p1();
+ RETURN 1;
+END|
+delimiter ;|
+START TRANSACTION;
+SELECT f1();
+
+--echo # Connection con1
+connection con1;
+--echo # Sending:
+--send DROP DATABASE db1
+
+--echo # Connection default
+connection default;
+--echo # Waiting for DROP DATABASE to be blocked by the lock on p1()
+let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
+ WHERE state= 'Waiting for stored procedure metadata lock'
+ AND info='DROP DATABASE db1';
+--source include/wait_condition.inc
+COMMIT;
+
+--echo # Connection con1
+connection con1;
+--echo # Reaping: DROP DATABASE db1
+--reap
+
+--echo # Test 3: Check that DROP DATABASE is not selected as a victim if a
+--echo # deadlock is discovered with DML statements.
+
+--echo # Connection default
+connection default;
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (a INT);
+CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
+START TRANSACTION;
+# DROP DATABASE will lock tables (t1) before functions (f1)
+SELECT db1.f1();
+
+--echo # Connection con1
+connection con1;
+--echo # Sending:
+--send DROP DATABASE db1
+
+--echo # Connection default
+connection default;
+--echo # Waiting for DROP DATABASE to be blocked by the lock on f1()
+let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
+ WHERE state= 'Waiting for stored function metadata lock'
+ AND info='DROP DATABASE db1';
+--source include/wait_condition.inc
+--error ER_LOCK_DEADLOCK
+SELECT * FROM db1.t1;
+COMMIT;
+
+--echo # Connection con1
+connection con1;
+--echo # Reaping: DROP DATABASE db1
+--reap
+
+--echo # Test 4: Check that active DROP DATABASE blocks stored routine DDL.
+
+--echo # Connection default
+connection default;
+CREATE DATABASE db1;
+CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
+CREATE FUNCTION db1.f2() RETURNS INTEGER RETURN 2;
+START TRANSACTION;
+SELECT db1.f2();
+
+--echo # Connection con1
+connection con1;
+--echo # Sending:
+--send DROP DATABASE db1
+
+--echo # Connection con2
+connection con2;
+--echo # Waiting for DROP DATABASE to be blocked by the lock on f2()
+let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
+ WHERE state= 'Waiting for stored function metadata lock'
+ AND info='DROP DATABASE db1';
+--source include/wait_condition.inc
+--echo # Sending:
+--send ALTER FUNCTION db1.f1 COMMENT "test"
+
+--echo # Connection default
+connection default;
+--echo # Waiting for ALTER FUNCTION to be blocked by the schema lock on db1
+let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
+ WHERE state= 'Waiting for schema metadata lock'
+ AND info='ALTER FUNCTION db1.f1 COMMENT "test"';
+--source include/wait_condition.inc
+COMMIT;
+
+--echo # Connection con1
+connection con1;
+--echo # Reaping: DROP DATABASE db1
+--reap
+disconnect con1;
+--source include/wait_until_disconnected.inc
+
+--echo # Connection con2
+connection con2;
+--echo # Reaping: ALTER FUNCTION f1 COMMENT 'test'
+--error ER_SP_DOES_NOT_EXIST
+--reap
+disconnect con2;
+--source include/wait_until_disconnected.inc
+
+--echo # Connection default
+connection default;
+DROP FUNCTION f1;
+
+
+--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index 96f82c92248..d7ea829bf50 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -82,7 +82,7 @@ select * from db1_secret.t1;
# ...and not this
--error ER_DBACCESS_DENIED_ERROR
create procedure db1_secret.dummy() begin end;
---error ER_SP_DOES_NOT_EXIST
+--error ER_PROCACCESS_DENIED_ERROR
drop procedure db1_secret.dummy;
--error ER_PROCACCESS_DENIED_ERROR
drop procedure db1_secret.stamp;
@@ -106,7 +106,7 @@ select * from db1_secret.t1;
# ...and not this
--error ER_DBACCESS_DENIED_ERROR
create procedure db1_secret.dummy() begin end;
---error ER_SP_DOES_NOT_EXIST
+--error ER_PROCACCESS_DENIED_ERROR
drop procedure db1_secret.dummy;
--error ER_PROCACCESS_DENIED_ERROR
drop procedure db1_secret.stamp;
@@ -926,6 +926,39 @@ DROP DATABASE B48872;
--echo End of 5.0 tests.
+
+--echo #
+--echo # Test for bug#57061 "User without privilege on routine can discover
+--echo # its existence."
+--echo #
+--disable_warnings
+drop database if exists mysqltest_db;
+--enable_warnings
+create database mysqltest_db;
+--echo # Create user with no privileges on mysqltest_db database.
+create user bug57061_user@localhost;
+create function mysqltest_db.f1() returns int return 0;
+create procedure mysqltest_db.p1() begin end;
+--echo # Connect as user 'bug57061_user@localhost'
+connect (conn1, localhost, bug57061_user,,);
+--echo # Attempt to drop routine on which user doesn't have privileges
+--echo # should result in the same 'access denied' type of error whether
+--echo # routine exists or not.
+--error ER_PROCACCESS_DENIED_ERROR
+drop function if exists mysqltest_db.f_does_not_exist;
+--error ER_PROCACCESS_DENIED_ERROR
+drop procedure if exists mysqltest_db.p_does_not_exist;
+--error ER_PROCACCESS_DENIED_ERROR
+drop function if exists mysqltest_db.f1;
+--error ER_PROCACCESS_DENIED_ERROR
+drop procedure if exists mysqltest_db.p1;
+--echo # Connection 'default'.
+connection default;
+disconnect conn1;
+drop user bug57061_user@localhost;
+drop database mysqltest_db;
+
+
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 0a323a134c5..eea16d5d174 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -8712,4 +8712,69 @@ call p1(3, 2);
drop table t1;
drop procedure p1;
+
+--echo #
+--echo # BUG#11766234: 59299: ASSERT (TABLE_REF->TABLE || TABLE_REF->VIEW)
+--echo # FAILS IN SET_FIELD_ITERATOR
+--echo #
+
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+CREATE VIEW v1 AS SELECT a FROM t2;
+CREATE PROCEDURE proc() SELECT * FROM t1 NATURAL JOIN v1;
+ALTER TABLE t2 CHANGE COLUMN a b CHAR;
+
+--echo
+--error ER_VIEW_INVALID
+CALL proc();
+--error ER_VIEW_INVALID
+CALL proc();
+
+--echo
+DROP TABLE t1,t2;
+DROP VIEW v1;
+DROP PROCEDURE proc;
+
+
+--echo
+--echo # --
+--echo # -- Bug 11765684 - 58674: SP-cache does not detect changes in
+--echo # -- pre-locking list caused by triggers
+--echo # ---
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+CREATE TABLE t3(a INT);
+
+CREATE PROCEDURE p1()
+ INSERT INTO t1(a) VALUES (1);
+
+--echo
+CREATE TRIGGER t1_ai AFTER INSERT ON t1
+ FOR EACH ROW
+ INSERT INTO t2(a) VALUES (new.a);
+
+--echo
+CALL p1();
+
+--echo
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1
+ FOR EACH ROW
+ INSERT INTO t3(a) VALUES (new.a);
+
+--echo
+CALL p1();
+
+--echo
+DROP TABLE t1, t2, t3;
+DROP PROCEDURE p1;
+--echo
+
--echo # End of 5.5 test
diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test
index 12e6478d19a..87de5063d00 100644
--- a/mysql-test/t/sp_notembedded.test
+++ b/mysql-test/t/sp_notembedded.test
@@ -325,16 +325,6 @@ DELETE FROM mysql.user WHERE User='mysqltest_1';
FLUSH PRIVILEGES;
-#
-# Restore global concurrent_insert value. Keep in the end of the test file.
-#
-
-set @@global.concurrent_insert= @old_concurrent_insert;
-
-# Wait till all disconnects are completed
---source include/wait_until_count_sessions.inc
-
-
--echo #
--echo # Bug#44521 Prepared Statement: CALL p() - crashes: `! thd->main_da.is_sent' failed et.al.
--echo #
@@ -403,7 +393,47 @@ DROP FUNCTION f1;
--disconnect con1
--disconnect con2
-
--echo # ------------------------------------------------------------------
--echo # -- End of 5.1 tests
--echo # ------------------------------------------------------------------
+
+--echo #
+--echo # Test for bug#11763757 "56510: ERROR 42000: FUNCTION DOES NOT EXIST
+--echo # IF NOT-PRIV USER RECONNECTS ".
+--echo #
+--echo # The real problem was that server was unable handle properly stored
+--echo # functions in databases which names contained dot.
+--echo #
+
+connection default;
+
+--disable_warnings
+DROP DATABASE IF EXISTS `my.db`;
+--enable_warnings
+
+create database `my.db`;
+use `my.db`;
+
+CREATE FUNCTION f1(a int) RETURNS INT RETURN a;
+
+--echo # Create new connection.
+connect (addcon, localhost, root,,);
+connection addcon;
+USE `my.db`;
+SELECT f1(1);
+SELECT `my.db`.f1(2);
+
+--echo # Switching to default connection.
+connection default;
+disconnect addcon;
+DROP DATABASE `my.db`;
+
+#
+# Restore global concurrent_insert value. Keep in the end of the test file.
+#
+
+set @@global.concurrent_insert= @old_concurrent_insert;
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
+
diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test
index c4915bdb87a..c114d397e43 100644
--- a/mysql-test/t/sp_trans.test
+++ b/mysql-test/t/sp_trans.test
@@ -636,6 +636,30 @@ UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()|
DROP TABLE t1_aux, t1_not_null|
DROP FUNCTION f1_two_inserts|
+--echo #
+--echo # Bug#49938: Failing assertion: inode or deadlock in fsp/fsp0fsp.c
+--echo #
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1|
+DROP TABLE IF EXISTS t1|
+--enable_warnings
+
+CREATE TABLE t1 (a INT) ENGINE=INNODB|
+
+CREATE PROCEDURE p1()
+BEGIN
+ TRUNCATE TABLE t1;
+END|
+
+LOCK TABLES t1 WRITE|
+CALL p1()|
+FLUSH TABLES;
+UNLOCK TABLES|
+CALL p1()|
+
+DROP PROCEDURE p1|
+DROP TABLE t1|
#
# BUG#NNNN: New bug synopsis
diff --git a/mysql-test/t/ssl_and_innodb.test b/mysql-test/t/ssl_and_innodb.test
new file mode 100644
index 00000000000..4966f05b37b
--- /dev/null
+++ b/mysql-test/t/ssl_and_innodb.test
@@ -0,0 +1,11 @@
+-- source include/have_innodb.inc
+-- source include/have_ssl_crypto_functs.inc
+
+CREATE TABLE t1(a int) engine=innodb;
+INSERT INTO t1 VALUES (1);
+
+SELECT DISTINCT
+convert((SELECT des_decrypt(2,1) AS a FROM t1 WHERE @a:=1), signed) as d
+FROM t1 ;
+
+DROP TABLE t1;
diff --git a/mysql-test/t/ssl_cipher-master.opt b/mysql-test/t/ssl_cipher-master.opt
new file mode 100644
index 00000000000..9525c238c40
--- /dev/null
+++ b/mysql-test/t/ssl_cipher-master.opt
@@ -0,0 +1 @@
+--ssl-cipher=AES128-SHA
diff --git a/mysql-test/t/ssl_cipher.test b/mysql-test/t/ssl_cipher.test
new file mode 100644
index 00000000000..5346968175c
--- /dev/null
+++ b/mysql-test/t/ssl_cipher.test
@@ -0,0 +1,23 @@
+# Turn on ssl between the client and server
+# and run a number of tests
+
+--echo #
+--echo # BUG#11760210 - SSL_CIPHER_LIST NOT SET OR RETURNED FOR "SHOW STATUS LIKE 'SSL_CIPHER_LIST'"
+--echo #
+
+-- source include/have_ssl.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+connect (ssl_con,localhost,root,,,,,SSL);
+
+# Check Cipher Name and Cipher List
+SHOW STATUS LIKE 'Ssl_cipher';
+SHOW STATUS LIKE 'Ssl_cipher_list';
+
+connection default;
+disconnect ssl_con;
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test
index 9965875af55..26c7a89bf5c 100644
--- a/mysql-test/t/status.test
+++ b/mysql-test/t/status.test
@@ -354,21 +354,6 @@ DROP FUNCTION f1;
# End of 5.1 tests
-#
-# Bug#17954 Threads_connected > Threads_created
-#
-
---disable_warnings
-DROP VIEW IF EXISTS v1;
---enable_warnings
-
-CREATE VIEW v1 AS SELECT VARIABLE_NAME AS NAME, CONVERT(VARIABLE_VALUE, UNSIGNED) AS VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
-
-SELECT VALUE INTO @tc FROM v1 WHERE NAME = 'Threads_connected';
-SELECT NAME FROM v1 WHERE NAME = 'Threads_created' AND VALUE < @tc;
-
-DROP VIEW v1;
-
# Restore global concurrent_insert value. Keep in the end of the test file.
--connection default
set @@global.concurrent_insert= @old_concurrent_insert;
diff --git a/mysql-test/t/status_bug17954.test b/mysql-test/t/status_bug17954.test
new file mode 100644
index 00000000000..36430cceeff
--- /dev/null
+++ b/mysql-test/t/status_bug17954.test
@@ -0,0 +1,54 @@
+# This test requires that --log-output includes 'table', and the general
+# log is on
+
+# embedded server causes different stat
+-- source include/not_embedded.inc
+
+# thread pool causes different results
+-- source include/not_threadpool.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+# Disable concurrent inserts to avoid sporadic test failures as it might
+# affect the the value of variables used throughout the test case.
+set @old_concurrent_insert= @@global.concurrent_insert;
+set @@global.concurrent_insert= 0;
+
+# Disable logging to table, since this will also cause table locking and unlocking, which will
+# show up in SHOW STATUS and may cause sporadic failures
+
+SET @old_log_output = @@global.log_output;
+SET GLOBAL LOG_OUTPUT = 'FILE';
+
+# PS causes different statistics
+--disable_ps_protocol
+
+flush status;
+
+#
+# Bug#17954 Threads_connected > Threads_created
+#
+
+--disable_warnings
+DROP VIEW IF EXISTS v1;
+--enable_warnings
+
+CREATE VIEW v1 AS SELECT VARIABLE_NAME AS NAME, CONVERT(VARIABLE_VALUE, UNSIGNED) AS VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
+
+SELECT VALUE INTO @tc FROM v1 WHERE NAME = 'Threads_connected';
+SELECT NAME FROM v1 WHERE NAME = 'Threads_created' AND VALUE < @tc;
+#SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS where variable_name like '%thread%';
+#SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
+#SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES;
+
+DROP VIEW v1;
+
+# Restore global concurrent_insert value. Keep in the end of the test file.
+--connection default
+set @@global.concurrent_insert= @old_concurrent_insert;
+SET GLOBAL log_output = @old_log_output;
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
+
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index b816237d433..9fdedd3cdec 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -4430,9 +4430,96 @@ SELECT * FROM t2 UNION SELECT * FROM t2
DROP TABLE t1,t2;
--enable_result_log
+--echo #
+--echo # Bug #58818: Incorrect result for IN/ANY subquery
+--echo # with HAVING condition
+--echo #
+
+CREATE TABLE t1(i INT);
+INSERT INTO t1 VALUES (1), (2), (3);
+CREATE TABLE t1s(i INT);
+INSERT INTO t1s VALUES (10), (20), (30);
+CREATE TABLE t2s(i INT);
+INSERT INTO t2s VALUES (100), (200), (300);
+
+SELECT * FROM t1
+WHERE t1.i NOT IN
+(
+ SELECT STRAIGHT_JOIN t2s.i
+ FROM
+ t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
+ HAVING t2s.i = 999
+);
+
+SELECT * FROM t1
+WHERE t1.I IN
+(
+ SELECT STRAIGHT_JOIN t2s.i
+ FROM
+ t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
+ HAVING t2s.i = 999
+) IS UNKNOWN;
+
+SELECT * FROM t1
+WHERE NOT t1.I = ANY
+(
+ SELECT STRAIGHT_JOIN t2s.i
+ FROM
+ t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
+ HAVING t2s.i = 999
+);
+
+SELECT * FROM t1
+ WHERE t1.i = ANY (
+ SELECT STRAIGHT_JOIN t2s.i
+ FROM
+ t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i
+ HAVING t2s.i = 999
+ ) IS UNKNOWN;
+
+DROP TABLE t1,t1s,t2s;
+
--echo End of 5.1 tests
--echo #
+--echo # Bug #11765713 58705:
+--echo # OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES
+--echo # CREATED BY OPT_SUM_QUERY
+--echo #
+
+CREATE TABLE t1(a INT NOT NULL, KEY (a));
+INSERT INTO t1 VALUES (0), (1);
+
+--error ER_SUBQUERY_NO_1_ROW
+SELECT 1 as foo FROM t1 WHERE a < SOME
+ (SELECT a FROM t1 WHERE a <=>
+ (SELECT a FROM t1)
+ );
+
+SELECT 1 as foo FROM t1 WHERE a < SOME
+ (SELECT a FROM t1 WHERE a <=>
+ (SELECT a FROM t1 where a is null)
+ );
+
+DROP TABLE t1;
+
+--echo #
+--echo # Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool):
+--echo # Assertion `file' failed.
+--echo #
+
+CREATE TABLE t1 (a INT);
+
+--error ER_OPERAND_COLUMNS
+SELECT 1 FROM
+ (SELECT ROW(
+ (SELECT 1 FROM t1 RIGHT JOIN
+ (SELECT 1 FROM t1, t1 t2) AS d ON 1),
+ 1) FROM t1) AS e;
+
+DROP TABLE t1;
+
+--echo #
--echo # No BUG#, a case brought from 5.2's innodb_mysql_lock.test
--echo #
diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test
index f4d99d23f4c..c480fc9b0d2 100644
--- a/mysql-test/t/subselect4.test
+++ b/mysql-test/t/subselect4.test
@@ -161,6 +161,16 @@ SELECT * FROM t1 WHERE NULL NOT IN ( SELECT c FROM t2 WHERE c = 1 AND c <> 1 );
DROP TABLE t1, t2, t3, t4, t5;
--echo #
+--echo # Bug#58207: invalid memory reads when using default column value and
+--echo # tmptable needed
+--echo #
+CREATE TABLE t(a VARCHAR(245) DEFAULT
+'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
+INSERT INTO t VALUES (''),(''),(''),(''),(''),(''),(''),(''),(''),(''),('');
+SELECT * FROM (SELECT default(a) FROM t GROUP BY a) d;
+DROP TABLE t;
+
+--echo #
--echo # End of 5.1 tests.
--echo #
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test
index 573fe0c1810..73491417e0c 100644
--- a/mysql-test/t/subselect_innodb.test
+++ b/mysql-test/t/subselect_innodb.test
@@ -238,3 +238,12 @@ call p1();
call p1();
drop procedure p1;
drop tables t1,t2,t3;
+
+--echo #
+--echo # Bug#60085 crash in Item::save_in_field() with time data type
+--echo #
+
+CREATE TABLE t1(a date, b int, unique(b), unique(a), key(b)) engine=innodb;
+INSERT INTO t1 VALUES ('2011-05-13', 0);
+SELECT * FROM t1 WHERE b < (SELECT CAST(a as date) FROM t1 GROUP BY a);
+DROP TABLE t1;
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 7472c9c0d26..02c3b219a06 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -39,7 +39,8 @@ drop table t2;
#
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-eval create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp" index directory="$MYSQLTEST_VARDIR/run";
+eval create table t9 (a int not null auto_increment, b char(16) not null, primary key (a))
+engine=myisam data directory="$MYSQLTEST_VARDIR/tmp" index directory="$MYSQLTEST_VARDIR/run";
insert into t9 select * from t1;
check table t9;
@@ -71,21 +72,25 @@ SHOW CREATE TABLE t9;
create database mysqltest;
--error 1,1
-create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="/this-dir-does-not-exist";
+create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a))
+engine=myisam index directory="/this-dir-does-not-exist";
# temporarily disabled as it returns different result in the embedded server
-# --error ER_WRONG_ARGUMENTS, ER_WRONG_ARGUMENTS
-# create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="not-hard-path";
+--error ER_WRONG_TABLE_NAME
+create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a))
+engine=myisam index directory="not-hard-path";
# Should fail becasue the file t9.MYI already exist in 'run'
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---error 1,156
-eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQLTEST_VARDIR/run";
+--error 1,ER_UNKNOWN_ERROR
+eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a))
+engine=myisam index directory="$MYSQLTEST_VARDIR/run";
# Should fail becasue the file t9.MYD already exist in 'tmp'
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1,1
-eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp";
+eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a))
+engine=myisam data directory="$MYSQLTEST_VARDIR/tmp";
# Check moving table t9 from default database to mysqltest;
# In this case the symlinks should be removed.
@@ -272,3 +277,24 @@ SELECT * FROM mysql.user;
--remove_file $MYSQL_TMP_DIR/mysql
--echo End of 5.1 tests
+
+
+--echo #
+--echo # Test for bug #11759990 - "52354: 'CREATE TABLE .. LIKE ... '
+--echo # STATEMENTS FAIL".
+--echo #
+--disable_warnings
+drop table if exists t1, t2;
+--enable_warnings
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval create table t1 (a int primary key) engine=myisam
+ data directory="$MYSQLTEST_VARDIR/tmp"
+ index directory="$MYSQLTEST_VARDIR/run";
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show create table t1;
+--echo # CREATE TABLE LIKE statement on table with INDEX/DATA DIRECTORY
+--echo # options should not fail. Per documentation newly created table
+--echo # should not inherit value of these options from the original table.
+create table t2 like t1;
+show create table t2;
+drop tables t1, t2;
diff --git a/mysql-test/t/system_mysql_db_fix40123.test b/mysql-test/t/system_mysql_db_fix40123.test
index 818993e5f27..7a96f22e0d1 100644
--- a/mysql-test/t/system_mysql_db_fix40123.test
+++ b/mysql-test/t/system_mysql_db_fix40123.test
@@ -3,7 +3,7 @@
# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set
# to the location of mysql_fix_privilege_tables.sql
-if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
+if (!$MYSQL_FIX_PRIVILEGE_TABLES)
{
skip Test need MYSQL_FIX_PRIVILEGE_TABLES;
}
@@ -72,7 +72,7 @@ CREATE TABLE time_zone_leap_second ( Transition_time bigint signed NOT NULL,
-- 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;
+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, proxies_priv;
-- enable_query_log
diff --git a/mysql-test/t/system_mysql_db_fix50030.test b/mysql-test/t/system_mysql_db_fix50030.test
index 45084177570..8adf0a09b22 100644
--- a/mysql-test/t/system_mysql_db_fix50030.test
+++ b/mysql-test/t/system_mysql_db_fix50030.test
@@ -3,7 +3,7 @@
# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set
# to the location of mysql_fix_privilege_tables.sql
-if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
+if (!$MYSQL_FIX_PRIVILEGE_TABLES)
{
skip Test needs MYSQL_FIX_PRIVILEGE_TABLES;
}
@@ -78,7 +78,7 @@ INSERT INTO servers VALUES ('test','localhost','test','root','', 0,'','mysql','r
-- 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;
+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, proxies_priv;
-- enable_query_log
diff --git a/mysql-test/t/system_mysql_db_fix50117.test b/mysql-test/t/system_mysql_db_fix50117.test
index bed00239081..9aeb654716c 100644
--- a/mysql-test/t/system_mysql_db_fix50117.test
+++ b/mysql-test/t/system_mysql_db_fix50117.test
@@ -3,7 +3,7 @@
# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set
# to the location of mysql_fix_privilege_tables.sql
-if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
+if (!$MYSQL_FIX_PRIVILEGE_TABLES)
{
skip Test needs MYSQL_FIX_PRIVILEGE_TABLES;
}
@@ -97,7 +97,7 @@ CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL,
-- 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;
+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, proxies_priv;
-- enable_query_log
diff --git a/mysql-test/t/tablespace.test b/mysql-test/t/tablespace.test
new file mode 100644
index 00000000000..9f3cf6255ac
--- /dev/null
+++ b/mysql-test/t/tablespace.test
@@ -0,0 +1,122 @@
+#
+# BUG#60111 storage type for table not saved in .frm
+#
+
+#
+# Check that the table options for TABLESPACE and STORAGE
+# are printed in SHOW CREATE TABLE
+#
+
+# TABLESPACE only
+CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# TABLESPACE + STORAGE DISK
+CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# TABLESPACE + STORAGE MEMORY
+CREATE TABLE t1(a int) TABLESPACE ts STORAGE MEMORY ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# STORAGE MEMORY only
+CREATE TABLE t1(a int) STORAGE MEMORY ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# STORAGE DISK only
+CREATE TABLE t1(a int) STORAGE DISK ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+#
+# Check that the table options for TABLESPACE and STORAGE
+# are kept in an ALTER
+#
+
+# TABLESPACE only
+CREATE TABLE t1(a int) TABLESPACE ts ENGINE=MyISAM;
+ALTER TABLE t1 ADD COLUMN b int;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# TABLESPACE and STORAGE DISK
+CREATE TABLE t1(a int) TABLESPACE ts STORAGE DISK ENGINE=MyISAM;
+ALTER TABLE t1 ADD COLUMN b int;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+#
+# Check that the table options for TABLESPACE and STORAGE
+# can be changed with an ALTER
+#
+
+# TABLESPACE only
+CREATE TABLE t1(a int) ENGINE=MyISAM;
+
+ALTER TABLE t1 TABLESPACE ts;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 TABLESPACE ts2;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
+# STORAGE only
+CREATE TABLE t1(a int) ENGINE=MyISAM;
+
+ALTER TABLE t1 STORAGE MEMORY;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 STORAGE DISK;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
+# TABLESPACE and STORAGE
+CREATE TABLE t1(a int) ENGINE=MyISAM;
+
+ALTER TABLE t1 STORAGE MEMORY TABLESPACE ts;
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 STORAGE DISK TABLESPACE ts2;
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
+#
+# Check that it's possible to read a .frm fle created
+# by MySQL Cluster 7.0(which introduced the new "format
+# section) with this statement:
+#
+# CREATE TABLE cluster_7022_table
+# (
+# a int primary key,
+# b int,
+# c int STORAGE DISK,
+# d int STORAGE MEMORY NOT NULL,
+# e int COLUMN_FORMAT DYNAMIC,
+# f int COLUMN_FORMAT FIXED,
+# g int COLUMN_FORMAT DEFAULT,
+# h int STORAGE DISK COLUMN_FORMAT DYNAMIC NOT NULL,
+# i int STORAGE MEMORY COLUMN_FORMAT DYNAMIC,
+# j int STORAGE DISK COLUMN_FORMAT FIXED,
+# k int STORAGE MEMORY COLUMN_FORMAT FIXED
+# ) STORAGE DISK TABLESPACE the_tablespacename ENGINE=MyISAM;
+#
+# NOTE! The column level properties will not yet show up
+# in SHOW CREATE TABLE of MySQL Server(although they are
+# visible in .trace file)
+#
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+copy_file std_data/cluster_7022_table.frm $MYSQLD_DATADIR/test/t1.frm;
+copy_file std_data/cluster_7022_table.MYD $MYSQLD_DATADIR/test/t1.MYD;
+copy_file std_data/cluster_7022_table.MYI $MYSQLD_DATADIR/test/t1.MYI;
+
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
diff --git a/mysql-test/t/trigger-compat.test b/mysql-test/t/trigger-compat.test
index 2cc86692d0d..8b360d16b98 100644
--- a/mysql-test/t/trigger-compat.test
+++ b/mysql-test/t/trigger-compat.test
@@ -106,4 +106,184 @@ DROP TABLE t2;
DROP USER mysqltest_dfn@localhost;
DROP USER mysqltest_inv@localhost;
DROP DATABASE mysqltest_db1;
+USE test;
+
+--echo #
+--echo # Bug#45235: 5.1 does not support 5.0-only syntax triggers in any way
+--echo #
+let $MYSQLD_DATADIR=`SELECT @@datadir`;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2, t3;
+--enable_warnings
+
+CREATE TABLE t1 ( a INT );
+CREATE TABLE t2 ( a INT );
+CREATE TABLE t3 ( a INT );
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (1), (2), (3);
+INSERT INTO t3 VALUES (1), (2), (3);
+
+--echo # We simulate importing a trigger from 5.0 by writing a .TRN file for
+--echo # each trigger plus a .TRG file the way MySQL 5.0 would have done it,
+--echo # with syntax allowed in 5.0 only.
+--echo #
+--echo # Note that in 5.0 the following lines are missing from t1.TRG:
+--echo #
+--echo # client_cs_names='latin1'
+--echo # connection_cl_names='latin1_swedish_ci'
+--echo # db_cl_names='latin1_swedish_ci'
+
+--write_file $MYSQLD_DATADIR/test/tr11.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr12.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr13.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr14.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr15.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/t1.TRG
+TYPE=TRIGGERS
+triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr11 BEFORE INSERT ON t1 FOR EACH ROW DELETE FROM t3' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr12 AFTER INSERT ON t1 FOR EACH ROW DELETE FROM t3' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr13 BEFORE DELETE ON t1 FOR EACH ROW DELETE FROM t1 a USING t1 a' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr14 AFTER DELETE ON t1 FOR EACH ROW DELETE FROM non_existing_table' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr15 BEFORE UPDATE ON t1 FOR EACH ROW DELETE FROM non_existing_table a USING non_existing_table a'
+sql_modes=0 0 0 0 0
+definers='root@localhost' 'root@localhost' 'root@localhost' 'root@localhost' 'root@localhost'
+EOF
+
+--write_file $MYSQLD_DATADIR/test/t2.TRG
+TYPE=TRIGGERS
+triggers='Not allowed syntax here, and trigger name cant be extracted either.'
+sql_modes=0
+definers='root@localhost'
+EOF
+
+FLUSH TABLE t1;
+FLUSH TABLE t2;
+
+--echo # We will get parse errors for most DDL and DML statements when the table
+--echo # has broken triggers. The parse error refers to the first broken
+--echo # trigger.
+--error ER_PARSE_ERROR
+CREATE TRIGGER tr16 AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO t1 VALUES (1);
+--error ER_PARSE_ERROR
+CREATE TRIGGER tr22 BEFORE INSERT ON t2 FOR EACH ROW DELETE FROM non_existing_table;
+SHOW TRIGGERS;
+--error ER_PARSE_ERROR
+INSERT INTO t1 VALUES (1);
+--error ER_PARSE_ERROR
+INSERT INTO t2 VALUES (1);
+--error ER_PARSE_ERROR
+DELETE FROM t1;
+--error ER_PARSE_ERROR
+UPDATE t1 SET a = 1 WHERE a = 1;
+SELECT * FROM t1;
+--error ER_PARSE_ERROR
+RENAME TABLE t1 TO t1_2;
+SHOW TRIGGERS;
+
+DROP TRIGGER tr11;
+DROP TRIGGER tr12;
+DROP TRIGGER tr13;
+DROP TRIGGER tr14;
+DROP TRIGGER tr15;
+
+SHOW TRIGGERS;
+
+--echo # Make sure there is no trigger file left.
+--list_files $MYSQLD_DATADIR/test/ tr*
+
+--echo # We write the same trigger files one more time to test DROP TABLE.
+--write_file $MYSQLD_DATADIR/test/tr11.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr12.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr13.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr14.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr15.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/t1.TRG
+TYPE=TRIGGERS
+triggers='CREATE DEFINER=`root`@`localhost` TRIGGER tr11 BEFORE INSERT ON t1 FOR EACH ROW DELETE FROM t3' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr12 AFTER INSERT ON t1 FOR EACH ROW DELETE FROM t3' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr13 BEFORE DELETE ON t1 FOR EACH ROW DELETE FROM t1 a USING t1 a' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr14 AFTER DELETE ON t1 FOR EACH ROW DELETE FROM non_existing_table' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr15 BEFORE UPDATE ON t1 FOR EACH ROW DELETE FROM non_existing_table a USING non_existing_table a'
+sql_modes=0 0 0 0 0
+definers='root@localhost' 'root@localhost' 'root@localhost' 'root@localhost' 'root@localhost'
+EOF
+
+FLUSH TABLE t1;
+FLUSH TABLE t2;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+--echo # Make sure there is no trigger file left.
+
+--list_files $MYSQLD_DATADIR/test/ tr*
+
+CREATE TABLE t1 ( a INT );
+CREATE TABLE t2 ( a INT );
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (1), (2), (3);
+
+--echo # We write three trigger files. First trigger is syntaxically incorrect, next trigger is correct
+--echo # and last trigger is broken.
+--echo # Next we try to execute SHOW CREATE TRGGIR command for broken trigger and then try to drop one.
+--write_file $MYSQLD_DATADIR/test/tr11.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/tr12.TRN
+TYPE=TRIGGERNAME
+trigger_table=t1
+EOF
+
+--write_file $MYSQLD_DATADIR/test/t1.TRG
+TYPE=TRIGGERS
+triggers='CREATE the wrongest trigger_in_the_world' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr11 BEFORE DELETE ON t1 FOR EACH ROW DELETE FROM t1 a USING t1 a' 'CREATE DEFINER=`root`@`localhost` TRIGGER tr12 BEFORE INSERT ON t1 FOR EACH ROW DELETE FROM t2'
+sql_modes=0 0 0
+definers='root@localhost' 'root@localhost' 'root@localhost'
+EOF
+
+FLUSH TABLE t1;
+
+SHOW CREATE TRIGGER tr12;
+SHOW CREATE TRIGGER tr11;
+DROP TRIGGER tr12;
+DROP TRIGGER tr11;
+
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/t/trigger-trans.test b/mysql-test/t/trigger-trans.test
index 4d6e82dedcb..82bee7aa224 100644
--- a/mysql-test/t/trigger-trans.test
+++ b/mysql-test/t/trigger-trans.test
@@ -148,10 +148,15 @@ CREATE TRIGGER t1_ad AFTER DELETE ON t1 FOR EACH ROW SET @b = 1;
SET @a = 0;
SET @b = 0;
+--error ER_TRUNCATE_ILLEGAL_FK
TRUNCATE t1;
SELECT @a, @b;
+DELETE FROM t1;
+
+SELECT @a, @b;
+
INSERT INTO t1 VALUES (1);
DELETE FROM t1;
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index 65b5e92e08c..85cf01a607f 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -998,10 +998,6 @@ 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;
-# Until we implement proper mechanism for invalidation of SP statements
-# invoked whenever a table used in SP changes, this statement will fail with
-# 'Table ... does not exist' error.
---error ER_NO_SUCH_TABLE
call p1();
deallocate prepare stmt1;
drop procedure p1;
@@ -2525,4 +2521,32 @@ select trigger_name from information_schema.triggers
drop temporary table t1;
drop table t1;
---echo End of 6.0 tests.
+
+--echo
+--echo #
+--echo # Bug #12362125: SP INOUT HANDLING IS BROKEN FOR TEXT TYPE.
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1(c TEXT);
+
+delimiter |;
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+ DECLARE v TEXT;
+ SET v = 'aaa';
+ SET NEW.c = v;
+END|
+delimiter ;|
+
+INSERT INTO t1 VALUES('qazwsxedc');
+
+SELECT c FROM t1;
+
+DROP TABLE t1;
+
+--echo
+--echo End of 5.5 tests.
diff --git a/mysql-test/t/trigger_notembedded.test b/mysql-test/t/trigger_notembedded.test
index d619afab176..b4ce183e114 100644
--- a/mysql-test/t/trigger_notembedded.test
+++ b/mysql-test/t/trigger_notembedded.test
@@ -969,7 +969,7 @@ connection default;
--echo connection: default
let $wait_condition=
select count(*) = 1 from information_schema.processlist
- where state = "Waiting for global metadata lock";
+ where state = "Waiting for global read lock";
--source include/wait_condition.inc
create trigger t1_bi before insert on t1 for each row begin end;
unlock tables;
diff --git a/mysql-test/t/truncate_coverage.test b/mysql-test/t/truncate_coverage.test
index c9c4bd90ca4..135935b53b3 100644
--- a/mysql-test/t/truncate_coverage.test
+++ b/mysql-test/t/truncate_coverage.test
@@ -172,3 +172,57 @@ UNLOCK TABLES;
DROP TABLE t1;
SET DEBUG_SYNC='RESET';
+--echo #
+--echo # Bug#57659 Segfault in Query_cache::invalidate_data for TRUNCATE TABLE
+--echo #
+
+--echo # Note that this test case only reproduces the problem
+--echo # when it is run with valgrind.
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, m1;
+--enable_warnings
+
+CREATE TABLE t1(a INT) engine=memory;
+CREATE TABLE m1(a INT) engine=merge UNION(t1);
+connect(con2, localhost, root);
+
+--echo # Connection con1
+connect(con1, localhost, root);
+SET DEBUG_SYNC= 'open_tables_after_open_and_process_table SIGNAL opened WAIT_FOR dropped';
+--echo # Sending:
+--send TRUNCATE TABLE m1
+
+--echo # Connection con2
+connection con2;
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+--echo # Sending:
+--send FLUSH TABLES
+
+--echo # Connection default
+connection default;
+--echo # Waiting for FLUSH TABLES to be blocked.
+let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist
+ WHERE state= 'Waiting for table flush' AND info= 'FLUSH TABLES';
+--source include/wait_condition.inc
+SET DEBUG_SYNC= 'now SIGNAL dropped';
+
+--echo # Connection con1
+connection con1;
+--echo # Reaping: TRUNCATE TABLE m1
+--error ER_WRONG_MRG_TABLE
+--reap
+disconnect con1;
+--source include/wait_until_disconnected.inc
+
+--echo # Connection con2
+connection con2;
+--echo # Reaping: FLUSH TABLES
+--reap
+disconnect con2;
+--source include/wait_until_disconnected.inc
+
+--echo # Connection default
+connection default;
+SET DEBUG_SYNC= 'RESET';
+DROP TABLE m1, t1;
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index c06d8ac97e0..fa67afa48e8 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -617,4 +617,17 @@ SELECT LENGTH(c) FROM t2;
DROP TABLE t1, t2;
+--echo # Bug #52160: crash and inconsistent results when grouping
+--echo # by a function and column
+
+CREATE FUNCTION f1() RETURNS TINYBLOB RETURN 1;
+
+CREATE TABLE t1(a CHAR(1));
+INSERT INTO t1 VALUES ('0'), ('0');
+
+SELECT COUNT(*) FROM t1 GROUP BY f1(), a;
+
+DROP FUNCTION f1;
+DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 11f2b68804a..9a21d8b370d 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -266,6 +266,18 @@ SELECT * FROM t1 JOIN v1 ON addtime( t1.the_date, t1.the_time ) =
DROP TABLE t1;
DROP VIEW v1;
+--echo #
+--echo # Bug#59685 crash in String::length with date types
+--echo #
+
+CREATE TABLE t1(a DATE, b YEAR, KEY(a));
+INSERT INTO t1 VALUES ('2011-01-01',2011);
+
+SELECT b = (SELECT CONVERT(a, DATE) FROM t1 GROUP BY a) FROM t1;
+SELECT b = CONVERT((SELECT CONVERT(a, DATE) FROM t1 GROUP BY a), DATE) FROM t1;
+
+DROP TABLE t1;
+
--echo End of 5.1 tests
--echo #
@@ -284,4 +296,12 @@ DROP TABLE t1;
--echo #
+--echo #
+--echo # Bug#57278: Crash on min/max + with date out of range.
+--echo #
+set @a=(select min(makedate('111','1'))) ;
+select @a;
+--echo #
+
+
--echo End of 6.0 tests
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index 6e40c9ccfa0..81e032751ca 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -445,6 +445,17 @@ SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS
# show we truncate microseconds from the right
SELECT CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7));
+--echo #
+--echo # Bug#59173: Failure to handle DATE(TIME) values where Year, Month or
+--echo # Day is ZERO
+--echo #
+CREATE TABLE t1 (dt1 DATETIME);
+INSERT INTO t1 (dt1) VALUES ('0000-00-01 00:00:01');
+DELETE FROM t1 WHERE dt1 = '0000-00-01 00:00:01';
+--echo # Should be empty
+SELECT * FROM t1;
+DROP TABLE t1;
+
--echo End of 5.1 tests
--echo #
@@ -485,5 +496,45 @@ explain select * from t2 where f1=STR_TO_DATE('4/1/2010', '%m/%d/%Y');
DROP TABLE t1,t2;
--echo #
+--echo # Bug#57095: Wrongly chosen expression cache type led to a wrong
+--echo # result.
+--echo #
+CREATE TABLE t1 (`b` datetime );
+INSERT INTO t1 VALUES ('2010-01-01 00:00:00'), ('2010-01-01 00:00:00');
+SELECT * FROM t1 WHERE b <= coalesce(NULL, now());
+DROP TABLE t1;
+--echo #
+
+--echo #
+--echo # BUG#12561818: RERUN OF STORED FUNCTION GIVES ERROR 1172:
+--echo # RESULT CONSISTED OF MORE THAN ONE ROW
+--echo #
+
+CREATE TABLE t1 (a DATE NOT NULL, b INT);
+INSERT INTO t1 VALUES ('0000-00-00',1), ('1999-05-10',2);
+
+CREATE TABLE t2 (a DATETIME NOT NULL, b INT);
+INSERT INTO t2 VALUES ('0000-00-00 00:00:00',1), ('1999-05-10 00:00:00',2);
+
+--echo
+SELECT * FROM t1 WHERE a IS NULL;
+SELECT * FROM t2 WHERE a IS NULL;
+SELECT * FROM t1 LEFT JOIN t1 AS t1_2 ON 1 WHERE t1_2.a IS NULL;
+SELECT * FROM t2 LEFT JOIN t2 AS t2_2 ON 1 WHERE t2_2.a IS NULL;
+SELECT * FROM t1 JOIN t1 AS t1_2 ON 1 WHERE t1_2.a IS NULL;
+SELECT * FROM t2 JOIN t2 AS t2_2 ON 1 WHERE t2_2.a IS NULL;
+
+--echo
+PREPARE stmt1 FROM
+ 'SELECT *
+ FROM t1 LEFT JOIN t1 AS t1_2 ON 1
+ WHERE t1_2.a IS NULL AND t1_2.b < 2';
+EXECUTE stmt1;
+EXECUTE stmt1;
+
+DEALLOCATE PREPARE stmt1;
+DROP TABLE t1,t2;
+
+--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index bd70e64b1ad..f1eeabbd924 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1519,4 +1519,19 @@ SELECT AVG(DISTINCT a) FROM t1;
SELECT SUM(DISTINCT a) FROM t1;
DROP TABLE t1;
+--echo #
+--echo # Bug#55436: buffer overflow in debug binary of dbug_buff in
+--echo # Field_new_decimal::store_value
+--echo #
+
+# this threw memory warnings on Windows. Also make sure future changes
+# don't change these results, as per usual.
+SET SQL_MODE='';
+CREATE TABLE t1(f1 DECIMAL(44,24)) ENGINE=MYISAM;
+INSERT INTO t1 SET f1 = -64878E-85;
+SELECT f1 FROM t1;
+DROP TABLE IF EXISTS t1;
+
+
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test
index dfac6f93b7d..cd4ba18455b 100644
--- a/mysql-test/t/type_timestamp.test
+++ b/mysql-test/t/type_timestamp.test
@@ -362,6 +362,53 @@ SELECT a FROM t1 WHERE a >= '20000101000000';
DROP TABLE t1;
+--echo #
+--echo # Bug#50774: failed to get the correct resultset when timestamp values
+--echo # are appended with .0
+--echo #
+CREATE TABLE t1 ( a TIMESTAMP, KEY ( a ) );
+
+INSERT INTO t1 VALUES( '2010-02-01 09:31:01' );
+INSERT INTO t1 VALUES( '2010-02-01 09:31:02' );
+INSERT INTO t1 VALUES( '2010-02-01 09:31:03' );
+INSERT INTO t1 VALUES( '2010-02-01 09:31:04' );
+
+SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
+SELECT * FROM t1 WHERE '2010-02-01 09:31:02.0' <= a;
+SELECT * FROM t1 WHERE a <= '2010-02-01 09:31:02.0';
+SELECT * FROM t1 WHERE '2010-02-01 09:31:02.0' >= a;
+
+--replace_column 1 x 2 x 3 x 5 x 6 x 7 x 8 x 9 x 10 x
+EXPLAIN
+SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
+SELECT * FROM t1 WHERE a >= '2010-02-01 09:31:02.0';
+
+CREATE TABLE t2 ( a TIMESTAMP, KEY ( a DESC ) );
+
+INSERT INTO t2 VALUES( '2010-02-01 09:31:01' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:02' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:03' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:04' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:05' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:06' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:07' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:08' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:09' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:10' );
+INSERT INTO t2 VALUES( '2010-02-01 09:31:11' );
+
+--echo # The bug would cause the range optimizer's comparison to use an open
+--echo # interval here. This reveals itself only in the number of reads
+--echo # performed.
+FLUSH STATUS;
+--replace_column 1 x 2 x 3 x 5 x 6 x 7 x 8 x 9 x 10 x
+EXPLAIN
+SELECT * FROM t2 WHERE a < '2010-02-01 09:31:02.0';
+SELECT * FROM t2 WHERE a < '2010-02-01 09:31:02.0';
+SHOW STATUS LIKE 'Handler_read_next';
+
+DROP TABLE t1, t2;
+
--echo End of 5.1 tests
--echo
@@ -377,3 +424,21 @@ SELECT a FROM t1;
DROP TABLE t1;
--echo End of Bug#50888
+
+--echo #
+--echo # Bug59330: Incorrect result when comparing an aggregate
+--echo # function with TIMESTAMP
+--echo #
+CREATE TABLE t1 (dt DATETIME, ts TIMESTAMP);
+INSERT INTO t1 VALUES('2011-01-06 12:34:30', '2011-01-06 12:34:30');
+SELECT MAX(dt), MAX(ts) FROM t1;
+SELECT MAX(ts) < '2010-01-01 00:00:00' FROM t1;
+SELECT MAX(dt) < '2010-01-01 00:00:00' FROM t1;
+SELECT MAX(ts) > '2010-01-01 00:00:00' FROM t1;
+SELECT MAX(dt) > '2010-01-01 00:00:00' FROM t1;
+SELECT MAX(ts) = '2011-01-06 12:34:30' FROM t1;
+SELECT MAX(dt) = '2011-01-06 12:34:30' FROM t1;
+DROP TABLE t1;
+
+--echo End of 5.5 tests
+
diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test
index d8da4ccc82c..1a9e66478e1 100644
--- a/mysql-test/t/type_year.test
+++ b/mysql-test/t/type_year.test
@@ -150,5 +150,15 @@ SELECT ta.y AS ta_y, ta.s, tb.y AS tb_y, tb.s FROM t1 ta, t1 tb HAVING ta_y = tb
DROP TABLE t1;
--echo #
+--echo # Bug #59211: Select Returns Different Value for min(year) Function
+--echo #
+
+CREATE TABLE t1(c1 YEAR(4));
+INSERT INTO t1 VALUES (1901),(2155),(0000);
+SELECT * FROM t1;
+SELECT COUNT(*) AS total_rows, MIN(c1) AS min_value, MAX(c1) FROM t1;
+DROP TABLE t1;
+
+--echo #
--echo End of 5.1 tests
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 93dc4cad50c..c6599517e90 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -1062,7 +1062,7 @@ SELECT ( SELECT a UNION SELECT a ) INTO OUTFILE 'union.out.file3' FROM t1;
SELECT ( SELECT a UNION SELECT a ) INTO DUMPFILE 'union.out.file4' FROM t1;
DROP TABLE t1;
-
+remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.1/data/test union.out.fil*;
--echo #
--echo # Bug #49734: Crash on EXPLAIN EXTENDED UNION ... ORDER BY
@@ -1117,3 +1117,70 @@ DROP TABLE t1,t2;
--echo End of 5.1 tests
+
+--echo #
+--echo # Bug#57986 ORDER BY clause is not used after a UNION,
+--echo # if embedded in a SELECT
+--echo #
+
+CREATE TABLE t1 (c1 VARCHAR(10) NOT NULL, c2 INT NOT NULL);
+CREATE TABLE t2 (c1 VARCHAR(10) NOT NULL, c2 INT NOT NULL);
+
+
+INSERT INTO t1 (c1, c2) VALUES ('t1a', 1), ('t1a', 2), ('t1a', 3), ('t1b', 2), ('t1b', 1);
+INSERT INTO t2 (c1, c2) VALUES ('t2a', 1), ('t2a', 2), ('t2a', 3), ('t2b', 2), ('t2b', 1);
+
+SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY c2, c1;
+SELECT * FROM t1 UNION (SELECT * FROM t2) ORDER BY c2, c1;
+SELECT * FROM t1 UNION (SELECT * FROM t2 ORDER BY c2, c1);
+
+SELECT c1, c2 FROM (
+ SELECT c1, c2 FROM t1
+ UNION
+ (SELECT c1, c2 FROM t2)
+ ORDER BY c2, c1
+) AS res;
+
+SELECT c1, c2 FROM (
+ SELECT c1, c2 FROM t1
+ UNION
+ (SELECT c1, c2 FROM t2)
+ ORDER BY c2 DESC, c1 LIMIT 1
+) AS res;
+
+SELECT c1, c2 FROM (
+ SELECT c1, c2 FROM t1
+ UNION
+ (SELECT c1, c2 FROM t2 ORDER BY c2 DESC, c1 LIMIT 1)
+) AS res;
+
+SELECT c1, c2 FROM (
+ SELECT c1, c2 FROM t1
+ UNION
+ SELECT c1, c2 FROM t2
+ ORDER BY c2 DESC, c1 DESC LIMIT 1
+) AS res;
+
+SELECT c1, c2 FROM (
+ (
+ (SELECT c1, c2 FROM t1)
+ UNION
+ (SELECT c1, c2 FROM t2)
+ )
+ ORDER BY c2 DESC, c1 ASC LIMIT 1
+) AS res;
+
+DROP TABLE t1, t2;
+
+--echo #
+--echo # Bug #58970 Problem Subquery (without referencing a table)
+--echo # and Order By
+--echo #
+
+SELECT(SELECT 0 AS a UNION SELECT 1 AS a ORDER BY a ASC LIMIT 1) AS dev;
+SELECT(SELECT 0 AS a UNION SELECT 1 AS a ORDER BY a DESC LIMIT 1) AS dev;
+SELECT(SELECT 0 AS a FROM dual UNION SELECT 1 AS a FROM dual ORDER BY a ASC LIMIT 1) AS dev;
+SELECT(SELECT 0 AS a FROM dual UNION SELECT 1 AS a FROM dual ORDER BY a DESC LIMIT 1) AS dev;
+SELECT(SELECT 1 AS a ORDER BY a) AS dev;
+SELECT(SELECT 1 AS a LIMIT 1) AS dev;
+SELECT(SELECT 1 AS a FROM dual ORDER BY a DESC LIMIT 1) AS dev;
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index 06508c43766..6a64343b609 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -344,6 +344,25 @@ FROM t1 GROUP BY a LIMIT 1;
DROP TABLE t1;
+#
+# BUG#56138 "valgrind errors about overlapping memory when
+# double-assigning same variable"
+#
+
+select @v:=@v:=sum(1) from dual;
+
+#
+# Bug #57187: more user variable fun with multiple assignments and
+# comparison in query
+#
+
+CREATE TABLE t1(a DECIMAL(31,21));
+INSERT INTO t1 VALUES (0);
+
+SELECT (@v:=a) <> (@v:=1) FROM t1;
+
+DROP TABLE t1;
+
--echo End of 5.1 tests
#
diff --git a/mysql-test/t/variables-big.test b/mysql-test/t/variables-big.test
index 67a8d9fe86d..15cbe27c759 100644
--- a/mysql-test/t/variables-big.test
+++ b/mysql-test/t/variables-big.test
@@ -34,28 +34,31 @@
# There is a significant probablitity that this tests fails with testcase
# timeout if the testing box is not powerful enough.
#
+SET @def_var= @@session.transaction_prealloc_size;
--disable_warnings
SET SESSION transaction_prealloc_size=1024*1024*1024*1;
---replace_column 1 <Id> 6 <Time>
# Embedded server is hardcoded to show "Writing to net" as STATE.
--replace_result "Writing to net" "NULL"
+--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*2;
---replace_column 1 <Id> 6 <Time>
--replace_result "Writing to net" "NULL"
+--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*3;
---replace_column 1 <Id> 6 <Time>
--replace_result "Writing to net" "NULL"
+--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*4;
---replace_column 1 <Id> 6 <Time>
--replace_result "Writing to net" "NULL"
+--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
SET SESSION transaction_prealloc_size=1024*1024*1024*5;
---replace_column 1 <Id> 6 <Time>
--replace_result "Writing to net" "NULL"
+--replace_column 1 <Id> 3 <Host> 6 <Time>
SHOW PROCESSLIST;
--enable_warnings
+SET @@session.transaction_prealloc_size= @def_var;
+
diff --git a/mysql-test/t/variables-notembedded.test b/mysql-test/t/variables-notembedded.test
index 7cc068c68c7..b440cfa47b0 100644
--- a/mysql-test/t/variables-notembedded.test
+++ b/mysql-test/t/variables-notembedded.test
@@ -109,3 +109,30 @@ SET @@session.slave_skip_errors= 7;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.slave_skip_errors= 7;
#
+
+--echo #
+--echo # Bug #11766769 : 59959: SMALL VALUES OF --MAX-ALLOWED-PACKET
+--echo # ARE NOT BEING HONORED
+--echo #
+
+CREATE TABLE t1 (a MEDIUMTEXT);
+
+SET GLOBAL max_allowed_packet=2048;
+SET GLOBAL net_buffer_length=4096;
+CONNECT (con1,localhost,root,,test);
+SHOW SESSION VARIABLES LIKE 'max_allowed_packet';
+SHOW SESSION VARIABLES LIKE 'net_buffer_length';
+--disable_query_log
+--error ER_NET_PACKET_TOO_LARGE
+INSERT INTO t1 VALUES ('123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890');
+--enable_query_log
+
+CONNECTION default;
+DISCONNECT con1;
+SELECT LENGTH(a) FROM t1;
+
+SET GLOBAL max_allowed_packet=default;
+SET GLOBAL net_buffer_length=default;
+DROP TABLE t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index e2027e445a0..5d38be1dd54 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -772,7 +772,7 @@ SET @@myisam_mmap_size= 500M;
--echo # Bug #52315: utc_date() crashes when system time > year 2037
--echo #
---error 0, ER_UNKNOWN_ERROR
+--error 0, ER_WRONG_VALUE_FOR_VAR
SET TIMESTAMP=2*1024*1024*1024;
--echo #Should not crash
--disable_result_log
@@ -1235,6 +1235,69 @@ SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size;
SELECT @@skip_name_resolve;
SHOW VARIABLES LIKE 'skip_name_resolve';
+--echo #
+--echo # Bug #43233 : Some server variables are clipped during "update,"
+--echo # not "check" stage
+--echo #
+
+SET @kbs=@@global.key_buffer_size;
+SET @kcbs=@@global.key_cache_block_size;
+
+--echo throw errors in STRICT mode
+SET SQL_MODE=STRICT_ALL_TABLES;
+
+# sys_var_ulonglong_ptr: sys_max_binlog_cache_size
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.max_binlog_cache_size=-1;
+
+# sys_var_thd_ha_rows: "max_join_size" et al.
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.max_join_size=0;
+
+# sys_var_key_buffer_size: "key_buffer_size"
+--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
+SET @@global.key_buffer_size=0;
+
+# sys_var_key_cache_long: "key_cache_block_size" et al.
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.key_cache_block_size=0;
+
+--echo throw warnings in default mode
+SET SQL_MODE=DEFAULT;
+
+SET @@global.max_binlog_cache_size=-1;
+SET @@global.max_join_size=0;
+# this is an exception. since this is a new error/warning, let's stay
+# compatible with the upcoming 5.6.
+--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
+SET @@global.key_buffer_size=0;
+SET @@global.key_cache_block_size=0;
+
+#
+# Bug#56976: added new start-up parameter
+#
+select @@max_long_data_size;
+
+--echo #
+--echo # Bug#11766424 59527: DECIMAL_BIN_SIZE: ASSERTION `SCALE >= 0 && PRECISION > 0 && SCALE <= PRE
+--echo #
+
+CREATE TABLE t1(f1 DECIMAL(1,1) UNSIGNED);
+INSERT INTO t1 VALUES (0.2),(0.1);
+SELECT 1 FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE @a=f1);
+DROP TABLE t1;
+
+CREATE TABLE t1 AS SELECT @a:= CAST(1 AS UNSIGNED) AS a;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+# cleanup
+SET @@global.max_binlog_cache_size=DEFAULT;
+SET @@global.max_join_size=DEFAULT;
+SET @@global.key_buffer_size=@kbs;
+SET @@global.key_cache_block_size=@kcbs;
+
+
--echo End of 5.1 tests
###########################################################################
@@ -1426,3 +1489,29 @@ drop function t1_max;
###########################################################################
+
+
+--echo #
+--echo # Bug #59884: setting charset to 2048 crashes
+--echo #
+
+--error ER_UNKNOWN_CHARACTER_SET
+set session character_set_results = 2048;
+--error ER_UNKNOWN_CHARACTER_SET
+set session character_set_client=2048;
+--error ER_UNKNOWN_CHARACTER_SET
+set session character_set_connection=2048;
+--error ER_UNKNOWN_CHARACTER_SET
+set session character_set_server=2048;
+--error ER_UNKNOWN_COLLATION
+set session collation_server=2048;
+--error ER_UNKNOWN_CHARACTER_SET
+set session character_set_filesystem=2048;
+--error ER_UNKNOWN_CHARACTER_SET
+set session character_set_database=2048;
+--error ER_UNKNOWN_COLLATION
+set session collation_connection=2048;
+--error ER_UNKNOWN_COLLATION
+set session collation_database=2048;
+
+--echo End of 5.5 tests
diff --git a/mysql-test/t/variables_debug.test b/mysql-test/t/variables_debug.test
index 640ffbb5619..6a3bc749b2a 100644
--- a/mysql-test/t/variables_debug.test
+++ b/mysql-test/t/variables_debug.test
@@ -49,3 +49,78 @@ SELECT @@debug;
SET @@debug = @old_local_debug;
--echo End of 5.1 tests
+
+
+--echo #
+--echo # Bug#46165 server crash in dbug
+--echo #
+
+SET @old_globaldebug = @@global.debug;
+SET @old_sessiondebug= @@session.debug;
+
+--echo # Test 1 - Bug test case, single connection
+SET GLOBAL debug= '+O,../../log/bug46165.1.trace';
+SET SESSION debug= '-d:-t:-i';
+
+SET GLOBAL debug= '';
+SET SESSION debug= '';
+
+--echo # Test 2 - Bug test case, two connections
+--echo # Connection default
+connection default;
+SET GLOBAL debug= '+O,../../log/bug46165.2.trace';
+SET SESSION debug= '-d:-t:-i';
+
+--echo # Connection con1
+connect (con1, localhost, root);
+SET GLOBAL debug= '';
+
+--echo # Connection default
+connection default;
+SET SESSION debug= '';
+--echo # Connection con1
+connection con1;
+disconnect con1;
+--source include/wait_until_disconnected.inc
+--echo # Connection default
+connection default;
+SET GLOBAL debug= '';
+
+--echo # Test 3 - Active session trace file on disconnect
+--echo # Connection con1
+connect (con1, localhost, root);
+SET GLOBAL debug= '+O,../../log/bug46165.3.trace';
+SET SESSION debug= '-d:-t:-i';
+SET GLOBAL debug= '';
+disconnect con1;
+--source include/wait_until_disconnected.inc
+
+--echo # Test 4 - Active session trace file on two connections
+--echo # Connection default
+connection default;
+SET GLOBAL debug= '+O,../../log/bug46165.4.trace';
+SET SESSION debug= '-d:-t:-i';
+
+--echo # Connection con1
+connect (con1, localhost, root);
+SET SESSION debug= '-d:-t:-i';
+SET GLOBAL debug= '';
+SET SESSION debug= '';
+
+--echo # Connection default
+connection default;
+SET SESSION debug= '';
+--echo # Connection con1
+connection con1;
+disconnect con1;
+--source include/wait_until_disconnected.inc
+--echo # Connection default
+connection default;
+
+--echo # Test 5 - Different trace files
+SET SESSION debug= '+O,../../log/bug46165.5.trace';
+SET SESSION debug= '+O,../../log/bug46165.6.trace';
+SET SESSION debug= '-O';
+
+SET GLOBAL debug= @old_globaldebug;
+SET SESSION debug= @old_sessiondebug;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 32d21965cd2..0fc64e26217 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3963,6 +3963,34 @@ WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1'));
DROP VIEW v1;
DROP TABLE t1;
+--echo #
+--echo # Bug#57703 create view cause Assertion failed: 0, file .\item_subselect.cc, line 846
+--echo #
+
+CREATE TABLE t1(a int);
+CREATE VIEW v1 AS SELECT 1 FROM t1 GROUP BY
+SUBSTRING(1 FROM (SELECT 3 FROM t1 WHERE a >= ANY(SELECT 1)));
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo #
+--echo # Bug#57352 valgrind warnings when creating view
+--echo #
+CREATE VIEW v1 AS SELECT 1 IN (1 LIKE 2,0) AS f;
+DROP VIEW v1;
+
+--echo #
+--echo # Bug 11829681 - 60295: ERROR 1356 ON VIEW THAT EXECUTES FINE AS A QUERY
+--echo #
+
+CREATE TABLE t1 (a INT);
+CREATE VIEW v1 AS SELECT s.* FROM t1 s, t1 b HAVING a;
+
+SELECT * FROM v1;
+
+DROP VIEW v1;
+DROP TABLE t1;
+
--echo # -----------------------------------------------------------------
--echo # -- End of 5.1 tests.
--echo # -----------------------------------------------------------------
diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test
index 3ccef94d7ea..5896e25feda 100644
--- a/mysql-test/t/view_grant.test
+++ b/mysql-test/t/view_grant.test
@@ -1503,8 +1503,6 @@ SHOW CREATE VIEW v1;
DROP TABLE t1;
DROP VIEW v1;
-# Wait till we reached the initial number of concurrent sessions
---source include/wait_until_count_sessions.inc
--echo #
--echo # Bug #46019: ERROR 1356 When selecting from within another
@@ -1546,3 +1544,145 @@ CREATE DEFINER=`unknown`@`unknown` SQL SECURITY DEFINER VIEW v1 AS SELECT 1;
--error ER_NO_SUCH_USER
LOCK TABLES v1 READ;
DROP VIEW v1;
+
+
+--echo #
+--echo # Bug #58499 "DEFINER-security view selecting from INVOKER-security view
+--echo # access check wrong".
+--echo #
+--echo # Check that we correctly handle privileges for various combinations
+--echo # of INVOKER and DEFINER-security views using each other.
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest1;
+--enable_warnings
+CREATE DATABASE mysqltest1;
+USE mysqltest1;
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 (j INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2);
+--echo #
+--echo # 1) DEFINER-security view uses INVOKER-security view (covers
+--echo # scenario originally described in the bug report).
+CREATE SQL SECURITY INVOKER VIEW v1_uses_t1 AS SELECT * FROM t1;
+CREATE SQL SECURITY INVOKER VIEW v1_uses_t2 AS SELECT * FROM t2;
+CREATE USER 'mysqluser1'@'%';
+GRANT CREATE VIEW ON mysqltest1.* TO 'mysqluser1'@'%';
+GRANT SELECT ON t1 TO 'mysqluser1'@'%';
+--echo # To be able create 'v2_uses_t2' we also need select on t2.
+GRANT SELECT ON t2 TO 'mysqluser1'@'%';
+GRANT SELECT ON v1_uses_t1 TO 'mysqluser1'@'%';
+GRANT SELECT ON v1_uses_t2 TO 'mysqluser1'@'%';
+--echo #
+--echo # Connection 'mysqluser1'.
+--connect (mysqluser1, localhost, mysqluser1,,mysqltest1)
+CREATE SQL SECURITY DEFINER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
+CREATE SQL SECURITY DEFINER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
+--echo #
+--echo # Connection 'default'.
+--connection default
+CREATE USER 'mysqluser2'@'%';
+GRANT SELECT ON v2_uses_t1 TO 'mysqluser2'@'%';
+GRANT SELECT ON v2_uses_t2 TO 'mysqluser2'@'%';
+GRANT SELECT ON t2 TO 'mysqluser2'@'%';
+GRANT CREATE VIEW ON mysqltest1.* TO 'mysqluser2'@'%';
+--echo # Make 'mysqluser1' unable to access t2.
+REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
+--echo #
+--echo # Connection 'mysqluser2'.
+--connect (mysqluser2, localhost, mysqluser2,,mysqltest1)
+--echo # The below statement should succeed thanks to suid nature of v2_uses_t1.
+SELECT * FROM v2_uses_t1;
+--echo # The below statement should fail due to suid nature of v2_uses_t2.
+--error ER_VIEW_INVALID
+SELECT * FROM v2_uses_t2;
+--echo #
+--echo # 2) INVOKER-security view uses INVOKER-security view.
+--echo #
+--echo # Connection 'default'.
+--connection default
+DROP VIEW v2_uses_t1, v2_uses_t2;
+CREATE SQL SECURITY INVOKER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
+CREATE SQL SECURITY INVOKER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
+GRANT SELECT ON v2_uses_t1 TO 'mysqluser1'@'%';
+GRANT SELECT ON v2_uses_t2 TO 'mysqluser1'@'%';
+GRANT SELECT ON v1_uses_t1 TO 'mysqluser2'@'%';
+GRANT SELECT ON v1_uses_t2 TO 'mysqluser2'@'%';
+--echo #
+--echo # Connection 'mysqluser1'.
+--connection mysqluser1
+--echo # For both versions of 'v2' 'mysqluser1' privileges should be used.
+SELECT * FROM v2_uses_t1;
+--error ER_VIEW_INVALID
+SELECT * FROM v2_uses_t2;
+--echo #
+--echo # Connection 'mysqluser2'.
+--connection mysqluser2
+--echo # And now for both versions of 'v2' 'mysqluser2' privileges should
+--echo # be used.
+--error ER_VIEW_INVALID
+SELECT * FROM v2_uses_t1;
+SELECT * FROM v2_uses_t2;
+--echo #
+--echo # 3) INVOKER-security view uses DEFINER-security view.
+--echo #
+--echo # Connection 'default'.
+--connection default
+DROP VIEW v1_uses_t1, v1_uses_t2;
+--echo # To be able create 'v1_uses_t2' we also need select on t2.
+GRANT SELECT ON t2 TO 'mysqluser1'@'%';
+--echo #
+--echo # Connection 'mysqluser1'.
+--connection mysqluser1
+CREATE SQL SECURITY DEFINER VIEW v1_uses_t1 AS SELECT * FROM t1;
+CREATE SQL SECURITY DEFINER VIEW v1_uses_t2 AS SELECT * FROM t2;
+--echo #
+--echo # Connection 'default'.
+--connection default
+--echo # Make 'mysqluser1' unable to access t2.
+REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
+--echo #
+--echo # Connection 'mysqluser2'.
+--connection mysqluser2
+--echo # Due to suid nature of v1_uses_t1 and v1_uses_t2 the first
+--echo # select should succeed and the second select should fail.
+SELECT * FROM v2_uses_t1;
+--error ER_VIEW_INVALID
+SELECT * FROM v2_uses_t2;
+--echo #
+--echo # 4) DEFINER-security view uses DEFINER-security view.
+--echo #
+--echo # Connection 'default'.
+--connection default
+DROP VIEW v2_uses_t1, v2_uses_t2;
+--echo # To be able create 'v2_uses_t2' we also need select on t2.
+GRANT SELECT ON t2 TO 'mysqluser1'@'%';
+--echo #
+--echo # Connection 'mysqluser2'.
+--connection mysqluser2
+CREATE SQL SECURITY DEFINER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
+CREATE SQL SECURITY DEFINER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
+--echo #
+--echo # Connection 'default'.
+--connection default
+--echo # Make 'mysqluser1' unable to access t2.
+REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
+--echo #
+--echo # Connection 'mysqluser2'.
+--connection mysqluser2
+--echo # Again privileges of creator of innermost views should apply.
+SELECT * FROM v2_uses_t1;
+--error ER_VIEW_INVALID
+SELECT * FROM v2_uses_t2;
+
+--disconnect mysqluser1
+--disconnect mysqluser2
+--connection default
+USE test;
+DROP DATABASE mysqltest1;
+DROP USER 'mysqluser1'@'%';
+DROP USER 'mysqluser2'@'%';
+
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/wait_timeout.test b/mysql-test/t/wait_timeout.test
index 6947e346675..eb86cf17ebb 100644
--- a/mysql-test/t/wait_timeout.test
+++ b/mysql-test/t/wait_timeout.test
@@ -53,7 +53,7 @@ while (!`select @aborted_clients`)
dec $retries;
if (!$retries)
{
- Failed to detect that client has been aborted;
+ die Failed to detect that client has been aborted;
}
}
--enable_query_log
@@ -108,7 +108,7 @@ while (!`select @aborted_clients`)
dec $retries;
if (!$retries)
{
- Failed to detect that client has been aborted;
+ die Failed to detect that client has been aborted;
}
}
--enable_query_log
diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test
index b3999e75dab..29714438835 100644
--- a/mysql-test/t/warnings.test
+++ b/mysql-test/t/warnings.test
@@ -241,3 +241,43 @@ insert into t1 values (1),(-1),(0),(-2);
drop table t1;
--echo End of 5.1 tests
+
+#
+# Bug#55847: SHOW WARNINGS returns empty result set when SQLEXCEPTION is active
+#
+
+--echo
+--echo -- Bug#55847
+--echo
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP FUNCTION IF EXISTS f1;
+--enable_warnings
+
+CREATE TABLE t1(a INT UNIQUE);
+
+delimiter |;
+
+CREATE FUNCTION f1(x INT) RETURNS INT
+BEGIN
+ INSERT INTO t1 VALUES(x);
+ INSERT INTO t1 VALUES(x);
+ RETURN x;
+END|
+
+delimiter ;|
+
+--echo
+
+--error ER_DUP_ENTRY
+SHOW TABLES WHERE f1(11) = 11;
+
+--echo
+
+SHOW WARNINGS;
+
+--echo
+
+DROP TABLE t1;
+DROP FUNCTION f1;
diff --git a/mysql-test/t/wl4435_generated.inc b/mysql-test/t/wl4435_generated.inc
new file mode 100644
index 00000000000..5ea05a89402
--- /dev/null
+++ b/mysql-test/t/wl4435_generated.inc
@@ -0,0 +1,588 @@
+
+###########################################################################
+
+--echo
+--echo TINYINT
+--echo
+
+CREATE PROCEDURE p1(OUT v TINYINT)
+ SET v = 127;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 127;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo SMALLINT
+--echo
+
+CREATE PROCEDURE p1(OUT v SMALLINT)
+ SET v = 32767;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 32767;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo MEDIUMINT
+--echo
+
+CREATE PROCEDURE p1(OUT v MEDIUMINT)
+ SET v = 8388607;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 8388607;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo INT
+--echo
+
+CREATE PROCEDURE p1(OUT v INT)
+ SET v = 2147483647;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 2147483647;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo BIGINT
+--echo
+
+CREATE PROCEDURE p1(OUT v BIGINT)
+ SET v = 9223372036854775807;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 9223372036854775807;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo BIT(11)
+--echo
+
+CREATE PROCEDURE p1(OUT v BIT(11))
+ SET v = b'10100100101';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = b'10100100101';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo TIMESTAMP
+--echo
+
+CREATE PROCEDURE p1(OUT v TIMESTAMP)
+ SET v = '2007-11-18 15:01:02';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = '2007-11-18 15:01:02';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo DATETIME
+--echo
+
+CREATE PROCEDURE p1(OUT v DATETIME)
+ SET v = '1234-11-12 12:34:59';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = '1234-11-12 12:34:59';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo TIME
+--echo
+
+CREATE PROCEDURE p1(OUT v TIME)
+ SET v = '123:45:01';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = '123:45:01';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo DATE
+--echo
+
+CREATE PROCEDURE p1(OUT v DATE)
+ SET v = '1234-11-12';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = '1234-11-12';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo YEAR
+--echo
+
+CREATE PROCEDURE p1(OUT v YEAR)
+ SET v = 2010;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 2010;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo FLOAT(7, 4)
+--echo
+
+CREATE PROCEDURE p1(OUT v FLOAT(7, 4))
+ SET v = 123.4567;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a - 123.4567 < 0.00001;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo DOUBLE(8, 5)
+--echo
+
+CREATE PROCEDURE p1(OUT v DOUBLE(8, 5))
+ SET v = 123.45678;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a - 123.45678 < 0.000001;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo DECIMAL(9, 6)
+--echo
+
+CREATE PROCEDURE p1(OUT v DECIMAL(9, 6))
+ SET v = 123.456789;
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 123.456789;
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo CHAR(32)
+--echo
+
+CREATE PROCEDURE p1(OUT v CHAR(32))
+ SET v = REPEAT('a', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('a', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo VARCHAR(32)
+--echo
+
+CREATE PROCEDURE p1(OUT v VARCHAR(32))
+ SET v = REPEAT('b', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('b', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo TINYTEXT
+--echo
+
+CREATE PROCEDURE p1(OUT v TINYTEXT)
+ SET v = REPEAT('c', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('c', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo TEXT
+--echo
+
+CREATE PROCEDURE p1(OUT v TEXT)
+ SET v = REPEAT('d', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('d', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo MEDIUMTEXT
+--echo
+
+CREATE PROCEDURE p1(OUT v MEDIUMTEXT)
+ SET v = REPEAT('e', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('e', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo LONGTEXT
+--echo
+
+CREATE PROCEDURE p1(OUT v LONGTEXT)
+ SET v = REPEAT('f', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('f', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo BINARY(32)
+--echo
+
+CREATE PROCEDURE p1(OUT v BINARY(32))
+ SET v = REPEAT('g', 32);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('g', 32);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo VARBINARY(32)
+--echo
+
+CREATE PROCEDURE p1(OUT v VARBINARY(32))
+ SET v = REPEAT('h', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('h', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo TINYBLOB
+--echo
+
+CREATE PROCEDURE p1(OUT v TINYBLOB)
+ SET v = REPEAT('i', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('i', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo BLOB
+--echo
+
+CREATE PROCEDURE p1(OUT v BLOB)
+ SET v = REPEAT('j', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('j', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo MEDIUMBLOB
+--echo
+
+CREATE PROCEDURE p1(OUT v MEDIUMBLOB)
+ SET v = REPEAT('k', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('k', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo LONGBLOB
+--echo
+
+CREATE PROCEDURE p1(OUT v LONGBLOB)
+ SET v = REPEAT('l', 16);
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = REPEAT('l', 16);
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo SET('aaa', 'bbb')
+--echo
+
+CREATE PROCEDURE p1(OUT v SET('aaa', 'bbb'))
+ SET v = 'aaa';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 'aaa';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo ENUM('aaa', 'bbb')
+--echo
+
+CREATE PROCEDURE p1(OUT v ENUM('aaa', 'bbb'))
+ SET v = 'aaa';
+
+PREPARE stmt1 FROM 'CALL p1(?)';
+EXECUTE stmt1 USING @a;
+
+CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1;
+
+SHOW CREATE TABLE tmp1;
+
+SELECT @a, @a = 'aaa';
+
+DROP TEMPORARY TABLE tmp1;
+DROP PROCEDURE p1;
diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test
index fe36af60c27..8ce9ce52960 100644
--- a/mysql-test/t/xa.test
+++ b/mysql-test/t/xa.test
@@ -3,6 +3,8 @@
#
-- source include/have_innodb.inc
+--source include/not_embedded.inc
+
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
@@ -228,6 +230,157 @@ XA ROLLBACK 'xid1';
disconnect con1;
DROP TABLE t1;
+
+--echo #
+--echo # Bug#56448 Assertion failed: ! is_set() with second xa end
+--echo #
+
+XA START 'x';
+XA END 'x';
+# Second XA END caused an assertion.
+--error ER_XAER_RMFAIL
+XA END 'x';
+XA PREPARE 'x';
+# Second XA PREPARE also caused an assertion.
+--error ER_XAER_RMFAIL
+XA PREPARE 'x';
+XA ROLLBACK 'x';
+
+
+--echo #
+--echo # Bug#59986 Assert in Diagnostics_area::set_ok_status() for XA COMMIT
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a)) engine=InnoDB;
+INSERT INTO t1 VALUES (1, 1), (2, 2);
+
+--echo # Connection con1
+connect (con1, localhost, root);
+XA START 'a';
+UPDATE t1 SET b= 3 WHERE a=1;
+
+--echo # Connection default
+connection default;
+XA START 'b';
+UPDATE t1 SET b=4 WHERE a=2;
+--echo # Sending:
+--send UPDATE t1 SET b=5 WHERE a=1
+
+--echo # Connection con1
+connection con1;
+--sleep 1
+--error ER_LOCK_DEADLOCK
+UPDATE t1 SET b=6 WHERE a=2;
+# This used to trigger the assert
+--error ER_XA_RBDEADLOCK
+XA COMMIT 'a';
+
+--echo # Connection default
+connection default;
+--echo # Reaping: UPDATE t1 SET b=5 WHERE a=1
+--reap
+XA END 'b';
+XA ROLLBACK 'b';
+DROP TABLE t1;
+disconnect con1;
+
+
+--echo #
+--echo # Bug#11766752 59936: multiple xa assertions - transactional
+--echo # statement fuzzer
+--echo #
+
+CREATE TABLE t1 (a INT) engine=InnoDB;
+XA START 'a';
+INSERT INTO t1 VALUES (1);
+
+--error ER_XAER_RMFAIL
+SAVEPOINT savep;
+
+XA END 'a';
+--error ER_XAER_RMFAIL
+SELECT * FROM t1;
+--error ER_XAER_RMFAIL
+INSERT INTO t1 VALUES (2);
+--error ER_XAER_RMFAIL
+SAVEPOINT savep;
+--error ER_XAER_RMFAIL
+SET @a=(SELECT * FROM t1);
+
+XA PREPARE 'a';
+--error ER_XAER_RMFAIL
+SELECT * FROM t1; # used to cause InnoDB assert
+--error ER_XAER_RMFAIL
+INSERT INTO t1 VALUES (2); # used to cause InnoDB assert
+--error ER_XAER_RMFAIL
+SAVEPOINT savep;
+--error ER_XAER_RMFAIL
+SET @a=(SELECT * FROM t1); # used to cause InnoDB assert
+--error ER_XAER_RMFAIL
+UPDATE t1 SET a=1 WHERE a=2;
+
+XA COMMIT 'a';
+SELECT * FROM t1;
+DROP TABLE t1;
+
+
+--echo #
+--echo # Bug#12352846 - TRANS_XA_START(THD*):
+--echo # ASSERTION THD->TRANSACTION.XID_STATE.XID.IS_NULL()
+--echo # FAILED
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (a INT);
+
+START TRANSACTION;
+INSERT INTO t1 VALUES (1);
+
+--echo # Connection con2
+--connect (con2,localhost,root)
+XA START 'xid1';
+--echo # Sending:
+--send INSERT INTO t2 SELECT a FROM t1
+
+--echo # Connection default
+--connection default
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM information_schema.processlist
+ WHERE state = "Sending data"
+ AND info = "INSERT INTO t2 SELECT a FROM t1";
+--echo # Waiting until INSERT ... is blocked
+--source include/wait_condition.inc
+DELETE FROM t1;
+COMMIT;
+
+--echo # Connection con2
+--connection con2
+--echo # Reaping: INSERT INTO t2 SELECT a FROM t1
+--error ER_LOCK_DEADLOCK
+--reap
+--error ER_XA_RBDEADLOCK
+XA COMMIT 'xid1';
+# This caused the assert to be triggered
+XA START 'xid1';
+
+XA END 'xid1';
+XA PREPARE 'xid1';
+XA ROLLBACK 'xid1';
+
+--echo # Connection default
+connection default;
+DROP TABLE t1, t2;
+disconnect con2;
+
+
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test
index 6e7d38cdfca..89c0b8992b1 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -617,4 +617,53 @@ FROM t1 ORDER BY t1.id;
DROP TABLE t1;
+
+--echo #
+--echo # Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
+--echo #
+SET NAMES utf8;
+SELECT REPLACE(EXTRACTVALUE('1', '/a'),'ds','');
+
+
+--echo #
+--echo # Bug #57820 extractvalue crashes
+--echo #
+SELECT AVG(DISTINCT EXTRACTVALUE((''),('$@k')));
+
+
+--echo #
+--echo # Bug#57279 updatexml dies with: Assertion failed: str_arg[length] == 0
+--echo #
+
+--error ER_ILLEGAL_VALUE_FOR_TYPE
+SELECT UPDATEXML(NULL, (LPAD(0.1111E-15, '2011', 1)), 1);
+--error ER_ILLEGAL_VALUE_FOR_TYPE
+SELECT EXTRACTVALUE('', LPAD(0.1111E-15, '2011', 1));
+
+--echo #
+--echo # Bug #44332 my_xml_scan reads behind the end of buffer
+--echo #
+SELECT UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1');
+SELECT UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1');
+
+--echo #
+--echo # Bug#11766725 (bug#59901): EXTRACTVALUE STILL BROKEN AFTER FIX FOR BUG #44332
+--echo #
+SELECT ExtractValue(CONVERT('<\"', BINARY(10)), 1);
+
--echo End of 5.1 tests
+
+
+--echo #
+--echo # Start of 5.5 tests
+--echo #
+
+--echo #
+--echo # Bug#58175 xml functions read initialized bytes when conversions happen
+--echo #
+SET NAMES latin1;
+SELECT UPDATEXML(CONVERT('' USING swe7), TRUNCATE('',1), 0);
+
+--echo #
+--echo # End of 5.5 tests
+--echo #
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index ec2c2e1296b..8e1e7385081 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -1,3 +1,20 @@
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library 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
+
+#
# Suppress some common (not fatal) errors in system libraries found by valgrind
#
@@ -1100,13 +1117,92 @@
fun:lf_hash_insert
}
+#
+# Note that initialize_bucket() is reccursive,
+# can't provide more stack context.
+#
{
missing shutdown_performance_schema 3
Memcheck:Leak
fun:malloc
fun:my_malloc
fun:initialize_bucket
+}
+
+{
+ missing shutdown_performance_schema 4
+ Memcheck:Leak
+ fun:malloc
+ fun:my_malloc
+ fun:_lf_dynarray_lvalue
+ fun:_lf_pinbox_get_pins
+}
+
+{
+ missing shutdown_performance_schema 5
+ Memcheck:Leak
+ fun:malloc
+ fun:my_malloc
+ fun:_lf_dynarray_lvalue
+ fun:lf_hash_insert
+}
+
+{
+ missing shutdown_performance_schema 6
+ Memcheck:Leak
+ fun:malloc
+ fun:my_malloc
+ fun:_lf_dynarray_lvalue
+ fun:lf_hash_delete
+}
+
+{
+ missing shutdown_performance_schema 7
+ Memcheck:Leak
+ fun:malloc
+ fun:my_malloc
+ fun:_lf_dynarray_lvalue
fun:lf_hash_search
- fun:_Z19find_or_create_fileP10PFS_threadP14PFS_file_classPKcj
}
+{
+ Bug 59874 Valgrind warning in InnoDB compression code
+ Memcheck:Cond
+ fun:*
+ fun:*
+ fun:deflate
+ fun:btr_store_big_rec_extern_fields_func
+ fun:row_ins_index_entry_low
+ fun:row_ins_index_entry
+ fun:row_ins_index_entry_step
+ fun:row_ins
+ fun:row_ins_step
+ fun:row_insert_for_mysql
+}
+
+{
+ In page0zip.c we have already checked that the memory is initialized before calling deflate()
+ Memcheck:Cond
+ fun:*
+ fun:*
+ fun:deflate
+ fun:page_zip_compress
+}
+
+{
+ In page0zip.c we have already checked that the memory is initialized before calling deflate()
+ Memcheck:Cond
+ fun:*
+ fun:*
+ fun:deflate
+ fun:page_zip_compress_deflate
+}
+
+{
+ Bug 59875 Valgrind warning in buf0buddy.c
+ Memcheck:Addr1
+ fun:mach_read_from_4
+ fun:buf_buddy_relocate
+ fun:buf_buddy_free_low
+ fun:buf_buddy_free
+}
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index c3c4d6b5246..e32a722ff05 100644
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -23,8 +23,8 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c
mf_tempfile.c mf_unixpath.c mf_wcomp.c mulalloc.c my_access.c
my_aes.c my_alloc.c my_bit.c my_bitmap.c my_chsize.c
my_compress.c my_copy.c my_create.c my_delete.c
- my_div.c my_error.c my_file.c my_fopen.c my_fstream.c my_gethostbyname.c
- my_gethwaddr.c my_getopt.c my_getsystime.c my_getwd.c my_handler.c my_init.c
+ my_div.c my_error.c my_file.c my_fopen.c my_fstream.c
+ my_gethwaddr.c my_getopt.c my_getsystime.c my_getwd.c my_compare.c my_init.c
my_lib.c my_lock.c my_malloc.c my_mess.c
my_mkdir.c my_mmap.c my_once.c my_open.c my_pread.c my_pthread.c
my_quick.c my_read.c my_redel.c my_rename.c my_seek.c my_sleep.c
@@ -65,11 +65,6 @@ IF(HAVE_MLOCK)
SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_lockmem.c)
ENDIF()
-IF(UNIX)
- # some workarounds
- SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_port.c)
-ENDIF()
-
ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES})
TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY}
${LIBNSL} ${LIBM} ${LIBRT})
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
deleted file mode 100644
index da5a2fa0b3b..00000000000
--- a/mysys/Makefile.am
+++ /dev/null
@@ -1,170 +0,0 @@
-# Copyright (C) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# 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
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-INCLUDES = @ZLIB_INCLUDES@ @RDTSC_SPARC_ASSEMBLY@ \
- -I$(top_builddir)/include \
- -I$(top_srcdir)/include -I$(srcdir)
-pkglib_LIBRARIES = libmysys.a
-LDADD = libmysys.a $(top_builddir)/strings/libmystrings.a $(top_builddir)/dbug/libdbug.a
-noinst_HEADERS = mysys_priv.h my_static.h my_handler_errors.h \
- my_safehash.h
-libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
- mf_path.c mf_loadpath.c my_file.c \
- my_open.c my_create.c my_seek.c my_read.c \
- my_pread.c my_write.c my_getpagesize.c \
- my_crc32.c \
- mf_iocache.c mf_iocache2.c mf_cache.c mf_tempfile.c \
- mf_tempdir.c my_lock.c mf_brkhant.c my_alarm.c \
- my_malloc.c my_once.c mulalloc.c \
- my_alloc.c my_new.cc my_atomic.c lf_hash.c \
- lf_dynarray.c lf_alloc-pin.c \
- my_fopen.c my_fstream.c my_getsystime.c \
- my_error.c errors.c my_div.c my_mess.c \
- mf_format.c mf_same.c mf_dirname.c mf_fn_ext.c \
- my_symlink.c my_symlink2.c \
- mf_pack.c mf_unixpath.c mf_arr_appstr.c \
- mf_wcomp.c my_gethwaddr.c \
- mf_qsort.c mf_qsort2.c mf_sort.c \
- ptr_cmp.c mf_radix.c queues.c my_getncpus.c \
- tree.c list.c hash.c array.c string.c typelib.c \
- my_copy.c my_lib.c \
- my_delete.c my_rename.c my_redel.c \
- my_chsize.c my_quick.c my_lockmem.c my_static.c \
- my_sync.c my_getopt.c my_mkdir.c \
- default.c my_compress.c checksum.c \
- my_port.c my_sleep.c \
- charset.c charset-def.c my_bitmap.c my_bit.c md5.c \
- my_safehash.c my_rnd.c my_uuid.c my_chmod.c wqueue.c \
- my_gethostbyname.c rijndael.c my_aes.c sha1.c \
- my_handler.c my_largepage.c \
- my_memmem.c stacktrace.c \
- my_windac.c my_access.c base64.c my_libwrap.c \
- my_rdtsc.c
-
-if NEED_THREAD
-# mf_keycache is used only in the server, so it is safe to leave the file
-# out of the non-threaded library.
-# In fact, it will currently not compile without thread support.
-libmysys_a_SOURCES += mf_keycache.c mf_keycaches.c
-endif
-
-EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
- thr_mutex.c thr_rwlock.c waiting_threads.c \
- CMakeLists.txt mf_soundex.c \
- my_conio.c my_wincond.c my_winthread.c my_winerr.c \
- my_winfile.c \
- my_timer_cycles.il
-libmysys_a_LIBADD = @THREAD_LOBJECTS@
-# test_dir_DEPENDENCIES= $(LIBRARIES)
-# testhash_DEPENDENCIES= $(LIBRARIES)
-# test_charset_DEPENDENCIES= $(LIBRARIES)
-# charset2html_DEPENDENCIES= $(LIBRARIES)
-DEFS = -DDEFAULT_BASEDIR='"$(prefix)"' \
- -DMYSQL_DATADIR='"$(MYSQLDATAdir)"' \
- -DDEFAULT_CHARSET_HOME='"$(MYSQLBASEdir)"' \
- -DSHAREDIR'="$(MYSQLSHAREdir)"' \
- -DDEFAULT_HOME_ENV=MYSQL_HOME \
- -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \
- -DDEFAULT_SYSCONFDIR='"$(sysconfdir)"' \
- @DEFS@
-
-libmysys_a_DEPENDENCIES= @THREAD_LOBJECTS@
-
-# I hope this always does the right thing. Otherwise this is only test programs
-FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @NOINST_LDFLAGS@
-
-#CLEANFILES = test_bitmap$(EXEEXT) test_priority_queue$(EXEEXT) \
-# test_thr_alarm$(EXEEXT) test_thr_lock$(EXEEXT) \
-# test_vsnprintf$(EXEEXT) test_io_cache$(EXEEXT) \
-# test_dir$(EXEEXT) test_charset$(EXEEXT) \
-# testhash$(EXEEXT) test_gethwaddr$(EXEEXT) \
-# test_base64$(EXEEXT) test_thr_mutex$(EXEEXT)
-
-#
-# The CP .. RM stuff is to avoid problems with some compilers (like alpha ccc)
-# which automaticly removes the object files you use to compile a final program
-#
-
-test_bitmap$(EXEEXT): my_bitmap.c $(LIBRARIES)
- $(LINK) $(FLAGS) -DMAIN ./my_bitmap.c $(LDADD) $(LIBS)
-
-test_priority_queue$(EXEEXT): queues.c $(LIBRARIES)
- $(LINK) $(FLAGS) -DMAIN ./queues.c $(LDADD) $(LIBS)
-
-test_thr_alarm$(EXEEXT): thr_alarm.c $(LIBRARIES)
- $(CP) $(srcdir)/thr_alarm.c ./test_thr_alarm.c
- $(LINK) $(FLAGS) -DMAIN ./test_thr_alarm.c $(LDADD) $(LIBS)
- $(RM) -f ./test_thr_alarm.c
-
-test_thr_lock$(EXEEXT): thr_lock.c $(LIBRARIES)
- $(CP) $(srcdir)/thr_lock.c test_thr_lock.c
- $(LINK) $(FLAGS) -DMAIN ./test_thr_lock.c $(LDADD) $(LIBS)
- $(RM) -f ./test_thr_lock.c
-
-test_vsnprintf$(EXEEXT): my_vsnprintf.c $(LIBRARIES)
- $(CP) $(srcdir)/my_vsnprintf.c test_vsnprintf.c
- $(LINK) $(FLAGS) -DMAIN ./test_vsnprintf.c $(LDADD) $(LIBS)
- $(RM) -f test_vsnprintf.c
-
-test_io_cache$(EXEEXT): mf_iocache.c $(LIBRARIES)
- $(CP) $(srcdir)/mf_iocache.c test_io_cache.c
- $(LINK) $(FLAGS) -DMAIN ./test_io_cache.c $(LDADD) $(LIBS)
- $(RM) -f test_io_cache.c
-
-test_dir$(EXEEXT): test_dir.c $(LIBRARIES)
- $(LINK) $(FLAGS) -DMAIN $(srcdir)/test_dir.c $(LDADD) $(LIBS)
-
-test_charset$(EXEEXT): test_charset.c $(LIBRARIES)
- $(LINK) $(FLAGS) -DMAIN $(srcdir)/test_charset.c $(LDADD) $(LIBS)
-
-testhash$(EXEEXT): testhash.c $(LIBRARIES)
- $(LINK) $(FLAGS) -DMAIN $(srcdir)/testhash.c $(LDADD) $(LIBS)
-
-test_gethwaddr$(EXEEXT): my_gethwaddr.c $(LIBRARIES)
- $(CP) $(srcdir)/my_gethwaddr.c ./test_gethwaddr.c
- $(LINK) $(FLAGS) -DMAIN ./test_gethwaddr.c $(LDADD) $(LIBS)
- $(RM) -f ./test_gethwaddr.c
-
-test_base64$(EXEEXT): base64.c $(LIBRARIES)
- $(CP) $(srcdir)/base64.c ./test_base64.c
- $(LINK) $(FLAGS) -DMAIN ./test_base64.c $(LDADD) $(LIBS)
- $(RM) -f ./test_base64.c
-
-test_thr_mutex$(EXEEXT): test_thr_mutex.c $(LIBRARIES)
- $(LINK) $(FLAGS) $(srcdir)/test_thr_mutex.c $(LDADD) $(LIBS)
-
-if HAVE_DTRACE_DASH_G
-libmysys_a_LIBADD += probes_mysql.o
-libmysys_a_DEPENDENCIES += probes_mysql.o dtrace_files dtrace_providers
-CLEANFILES = probes_mysql.o dtrace_files dtrace_providers
-DTRACEFILES = mf_keycache.o
-DTRACEPROVIDER = probes_mysql.d
-CLEANFILES += $(DTRACEPROVIDER) dtrace_sources
-
-dtrace_files:
- echo $(DTRACEFILES) > $@
-dtrace_providers: probes_mysql.d
- echo $(DTRACEPROVIDER) > $@
-probes_mysql.d:
- -$(RM) -f probes_mysql.d
- $(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d
- echo timestamp > dtrace_sources
-
-probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES)
- $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACEFILES) -o $@
-endif
diff --git a/mysys/charset.c b/mysys/charset.c
index 7f414fbad97..f859ceae394 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -415,6 +415,7 @@ CHARSET_INFO *default_charset_info = &my_charset_latin1;
void add_compiled_collation(struct charset_info_st *cs)
{
+ DBUG_ASSERT(cs->number < array_elements(all_charsets));
all_charsets[cs->number]= cs;
cs->state|= MY_CS_AVAILABLE;
}
@@ -526,14 +527,17 @@ uint get_charset_number(const char *charset_name, uint cs_flags)
const char *get_charset_name(uint charset_number)
{
- CHARSET_INFO *cs;
my_pthread_once(&charsets_initialized, init_available_charsets);
- cs=all_charsets[charset_number];
- if (cs && (cs->number == charset_number) && cs->name )
- return (char*) cs->name;
+ if (charset_number < array_elements(all_charsets))
+ {
+ CHARSET_INFO *cs= all_charsets[charset_number];
+
+ if (cs && (cs->number == charset_number) && cs->name)
+ return (char*) cs->name;
+ }
- return (char*) "?"; /* this mimics find_type() */
+ return "?"; /* this mimics find_type() */
}
@@ -542,6 +546,8 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
char buf[FN_REFLEN];
struct charset_info_st *cs;
+ DBUG_ASSERT(cs_number < array_elements(all_charsets));
+
if ((cs= (struct charset_info_st*) all_charsets[cs_number]))
{
if (cs->state & MY_CS_READY) /* if CS is already initialized */
@@ -586,8 +592,8 @@ CHARSET_INFO *get_charset(uint cs_number, myf flags)
return default_charset_info;
my_pthread_once(&charsets_initialized, init_available_charsets);
-
- if (!cs_number || cs_number > array_elements(all_charsets))
+
+ if (cs_number >= array_elements(all_charsets))
return NULL;
cs=get_internal_charset(cs_number, flags);
diff --git a/mysys/default.c b/mysys/default.c
index 0e0883e1fcf..fe070f42748 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -61,12 +61,31 @@
check the pointer, use "----args-separator----" here to ease debug
if someone misused it.
+ The args seprator will only be added when
+ my_getopt_use_args_seprator is set to TRUE before calling
+ load_defaults();
+
See BUG#25192
*/
-const char *args_separator= "----args-separator----";
+static const char *args_separator= "----args-separator----";
+inline static void set_args_separator(char** arg)
+{
+ DBUG_ASSERT(my_getopt_use_args_separator);
+ *arg= (char*)args_separator;
+}
+my_bool my_getopt_use_args_separator= FALSE;
+my_bool my_getopt_is_args_separator(const char* arg)
+{
+ return (arg == args_separator);
+}
const char *my_defaults_file=0;
const char *my_defaults_group_suffix=0;
-char *my_defaults_extra_file=0;
+const char *my_defaults_extra_file=0;
+
+static char my_defaults_file_buffer[FN_REFLEN];
+static char my_defaults_extra_file_buffer[FN_REFLEN];
+
+static my_bool defaults_already_read= FALSE;
/* Which directories are searched for options (and in which order) */
@@ -121,7 +140,7 @@ static int search_default_file_with_ext(Process_option_func func,
- Unix: /etc/
- Unix: /etc/mysql/
- Unix: --sysconfdir=<path> (compile-time option)
- - ALL: getenv(DEFAULT_HOME_ENV)
+ - ALL: getenv("MYSQL_HOME")
- ALL: --defaults-extra-file=<path> (run-time option)
- Unix: ~/
@@ -140,6 +159,33 @@ static char *remove_end_comment(char *ptr);
/*
+ Expand a file name so that the current working directory is added if
+ the name is relative.
+
+ RETURNS
+ 0 All OK
+ 2 Out of memory or path to long
+ 3 Not able to get working directory
+ */
+
+static int
+fn_expand(const char *filename, char *result_buf)
+{
+ char dir[FN_REFLEN];
+ const int flags= MY_UNPACK_FILENAME | MY_SAFE_PATH | MY_RELATIVE_PATH;
+ DBUG_ENTER("fn_expand");
+ DBUG_PRINT("enter", ("filename: %s, result_buf: 0x%lx",
+ filename, (unsigned long) result_buf));
+ if (my_getwd(dir, sizeof(dir), MYF(0)))
+ DBUG_RETURN(3);
+ DBUG_PRINT("debug", ("dir: %s", dir));
+ if (fn_format(result_buf, filename, dir, "", flags) == NULL)
+ DBUG_RETURN(2);
+ DBUG_PRINT("return", ("result: %s", result_buf));
+ DBUG_RETURN(0);
+}
+
+/*
Process config files in default directories.
SYNOPSIS
@@ -167,6 +213,7 @@ static char *remove_end_comment(char *ptr);
0 ok
1 given cinf_file doesn't exist
2 out of memory
+ 3 Can't get current working directory
The global variable 'my_defaults_group_suffix' is updated with value for
--defaults_group_suffix
@@ -189,11 +236,23 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv,
if (! my_defaults_group_suffix)
my_defaults_group_suffix= getenv(STRINGIFY_ARG(DEFAULT_GROUP_SUFFIX_ENV));
- if (forced_extra_defaults)
- my_defaults_extra_file= (char *) forced_extra_defaults;
-
- if (forced_default_file)
- my_defaults_file= forced_default_file;
+ if (forced_extra_defaults && !defaults_already_read)
+ {
+ int error= fn_expand(forced_extra_defaults, my_defaults_extra_file_buffer);
+ if (error)
+ DBUG_RETURN(error);
+ my_defaults_extra_file= my_defaults_extra_file_buffer;
+ }
+
+ if (forced_default_file && !defaults_already_read)
+ {
+ int error= fn_expand(forced_default_file, my_defaults_file_buffer);
+ if (error)
+ DBUG_RETURN(error);
+ my_defaults_file= my_defaults_file_buffer;
+ }
+
+ defaults_already_read= TRUE;
/*
We can only handle 'defaults-group-suffix' if we are called from
@@ -236,15 +295,15 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv,
group->type_names[group->count]= 0;
}
- if (forced_default_file)
+ if (my_defaults_file)
{
if ((error= search_default_file_with_ext(func, func_ctx, "", "",
- forced_default_file, 0)) < 0)
+ my_defaults_file, 0)) < 0)
goto err;
if (error > 0)
{
fprintf(stderr, "Could not open required defaults file: %s\n",
- forced_default_file);
+ my_defaults_file);
goto err;
}
}
@@ -317,7 +376,7 @@ static int handle_default_option(void *in_ctx, const char *group_name,
if (!option)
return 0;
- if (find_type((char *)group_name, ctx->group, 3))
+ if (find_type((char *)group_name, ctx->group, FIND_TYPE_NO_PREFIX))
{
if (!(tmp= alloc_root(ctx->alloc, strlen(option) + 1)))
return 1;
@@ -458,6 +517,7 @@ int my_load_defaults(const char *conf_file, const char **groups,
char *ptr,**res;
struct handle_option_ctx ctx;
const char **dirs;
+ uint args_sep= my_getopt_use_args_separator ? 1 : 0;
DBUG_ENTER("load_defaults");
init_alloc_root(&alloc,512,0);
@@ -470,17 +530,28 @@ int my_load_defaults(const char *conf_file, const char **groups,
if (*argc >= 2 && !strcmp(argv[0][1],"--no-defaults"))
{
/* remove the --no-defaults argument and return only the other arguments */
- uint i;
+ uint i, j;
if (!(ptr=(char*) alloc_root(&alloc,sizeof(alloc)+
(*argc + 1)*sizeof(char*))))
goto err;
res= (char**) (ptr+sizeof(alloc));
res[0]= **argv; /* Copy program name */
- /* set arguments separator */
- res[1]= (char *)args_separator;
- for (i=2 ; i < (uint) *argc ; i++)
- res[i]=argv[0][i];
- res[i]=0; /* End pointer */
+ j= 1; /* Start from 1 for the reset result args */
+ if (my_getopt_use_args_separator)
+ {
+ /* set arguments separator */
+ set_args_separator(&res[1]);
+ j++;
+ }
+ for (i=2 ; i < (uint) *argc ; i++, j++)
+ res[j]=argv[0][i];
+ res[j]=0; /* End pointer */
+ /*
+ Update the argc, if have not added args separator, then we have
+ to decrease argc because we have removed the "--no-defaults".
+ */
+ if (!my_getopt_use_args_separator)
+ (*argc)--;
*argv=res;
*(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */
if (default_directories)
@@ -514,7 +585,7 @@ int my_load_defaults(const char *conf_file, const char **groups,
or a forced default file
*/
if (!(ptr=(char*) alloc_root(&alloc,sizeof(alloc)+
- (args.elements + *argc + 1 + 1) *sizeof(char*))))
+ (args.elements + *argc + 1 + args_sep) *sizeof(char*))))
goto err;
res= (char**) (ptr+sizeof(alloc));
@@ -535,16 +606,19 @@ int my_load_defaults(const char *conf_file, const char **groups,
--*argc; ++*argv; /* skip argument */
}
- /* set arguments separator for arguments from config file and
- command line */
- res[args.elements+1]= (char *)args_separator;
+ if (my_getopt_use_args_separator)
+ {
+ /* set arguments separator for arguments from config file and
+ command line */
+ set_args_separator(&res[args.elements+1]);
+ }
if (*argc)
- memcpy((uchar*) (res+1+args.elements+1), (char*) ((*argv)+1),
+ memcpy((uchar*) (res+1+args.elements+args_sep), (char*) ((*argv)+1),
(*argc-1)*sizeof(char*));
- res[args.elements+ *argc+1]=0; /* last null */
+ res[args.elements+ *argc+args_sep]=0; /* last null */
- (*argc)+=args.elements+1;
+ (*argc)+=args.elements+args_sep;
*argv= (char**) res;
*(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */
delete_dynamic(&args);
@@ -554,7 +628,7 @@ int my_load_defaults(const char *conf_file, const char **groups,
printf("%s would have been started with the following arguments:\n",
**argv);
for (i=1 ; i < *argc ; i++)
- if ((*argv)[i] != args_separator) /* skip arguments separator */
+ if (!my_getopt_is_args_separator((*argv)[i])) /* skip arguments separator */
printf("%s ", (*argv)[i]);
puts("");
exit(0);
@@ -1158,7 +1232,7 @@ static const char **init_default_directories(MEM_ROOT *alloc)
#endif
- if ((env= getenv(STRINGIFY_ARG(DEFAULT_HOME_ENV))))
+ if ((env= getenv("MYSQL_HOME")))
errors += add_directory(alloc, env, dirs);
/* Placeholder for --defaults-extra-file=<path> */
diff --git a/mysys/errors.c b/mysys/errors.c
index 5c8afff6395..2a9b3e770d2 100644
--- a/mysys/errors.c
+++ b/mysys/errors.c
@@ -52,8 +52,8 @@ const char *globerrs[GLOBERRS]=
"File '%s' (fileno: %d) was not closed",
"Can't change ownership of the file '%s' (Errcode: %d)",
"Can't change permissions of the file '%s' (Errcode: %d)",
+ "Can't seek in file '%s' (Errcode: %d)"
"Can't change mode for file '%s' to 0x%lx (Error: %d)",
- "Can't do seek on file '%s' (Errcode: %d)",
"Warning: Can't copy ownership for file '%s' (Error: %d)"
};
@@ -97,8 +97,8 @@ void init_glob_errs()
EE(EE_FILE_NOT_CLOSED) = "File '%s' (fileno: %d) was not closed";
EE(EE_CHANGE_OWNERSHIP) = "Can't change ownership of the file '%s' (Errcode: %d)";
EE(EE_CHANGE_PERMISSIONS) = "Can't change permissions of the file '%s' (Errcode: %d)";
+ EE(EE_CANT_SEEK) = "Can't seek in file '%s' (Errcode: %d)";
EE(EE_CANT_CHMOD) = "Can't change mode for file '%s' to 0x%lx (Error: %d)";
- EE(EE_CANT_SEEK) = "Can't do seek on file '%s' (Errcode: %d)";
EE(EE_CANT_COPY_OWNERSHIP)= "Warning: Can't copy ownership for file '%s' (Error: %d)";
}
#endif
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c
index 3eec91236c5..ab88828d2f6 100644
--- a/mysys/lf_alloc-pin.c
+++ b/mysys/lf_alloc-pin.c
@@ -146,6 +146,7 @@ void lf_pinbox_destroy(LF_PINBOX *pinbox)
*/
LF_PINS *_lf_pinbox_get_pins(LF_PINBOX *pinbox)
{
+ struct st_my_thread_var *var;
uint32 pins, next, top_ver;
LF_PINS *el;
/*
@@ -188,7 +189,12 @@ LF_PINS *_lf_pinbox_get_pins(LF_PINBOX *pinbox)
el->link= pins;
el->purgatory_count= 0;
el->pinbox= pinbox;
- el->stack_ends_here= & my_thread_var->stack_ends_here;
+ var= my_thread_var;
+ /*
+ Threads that do not call my_thread_init() should still be
+ able to use the LF_HASH.
+ */
+ el->stack_ends_here= (var ? & var->stack_ends_here : NULL);
return el;
}
@@ -327,34 +333,36 @@ static int match_pins(LF_PINS *el, void *addr)
*/
static void _lf_pinbox_real_free(LF_PINS *pins)
{
- int npins, alloca_size;
- void *list, **addr;
+ int npins;
+ void *list;
+ void **addr= NULL;
void *first= NULL, *last= NULL;
LF_PINBOX *pinbox= pins->pinbox;
npins= pinbox->pins_in_array+1;
#ifdef HAVE_ALLOCA
- alloca_size= sizeof(void *)*LF_PINBOX_PINS*npins;
- /* create a sorted list of pinned addresses, to speed up searches */
- if (available_stack_size(&pinbox, *pins->stack_ends_here) > alloca_size)
+ if (pins->stack_ends_here != NULL)
{
- struct st_harvester hv;
- addr= (void **) alloca(alloca_size);
- hv.granary= addr;
- hv.npins= npins;
- /* scan the dynarray and accumulate all pinned addresses */
- _lf_dynarray_iterate(&pinbox->pinarray,
- (lf_dynarray_func)harvest_pins, &hv);
-
- npins= hv.granary-addr;
- /* and sort them */
- if (npins)
- qsort(addr, npins, sizeof(void *), (qsort_cmp)ptr_cmp);
+ int alloca_size= sizeof(void *)*LF_PINBOX_PINS*npins;
+ /* create a sorted list of pinned addresses, to speed up searches */
+ if (available_stack_size(&pinbox, *pins->stack_ends_here) > alloca_size)
+ {
+ struct st_harvester hv;
+ addr= (void **) alloca(alloca_size);
+ hv.granary= addr;
+ hv.npins= npins;
+ /* scan the dynarray and accumulate all pinned addresses */
+ _lf_dynarray_iterate(&pinbox->pinarray,
+ (lf_dynarray_func)harvest_pins, &hv);
+
+ npins= hv.granary-addr;
+ /* and sort them */
+ if (npins)
+ qsort(addr, npins, sizeof(void *), (qsort_cmp)ptr_cmp);
+ }
}
- else
#endif
- addr= 0;
list= pins->purgatory;
pins->purgatory= 0;
diff --git a/mysys/mf_brkhant.c b/mysys/mf_brkhant.c
deleted file mode 100644
index 3573b9973b2..00000000000
--- a/mysys/mf_brkhant.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (C) 2000 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 */
-
-/* Dont let the user break when you are doing something important */
-/* Remembers if it got 'SIGINT' and executes it on allow_break */
-/* A static buffer is used; don't call dont_break() twice in a row */
-
-#include "mysys_priv.h"
-#include "my_static.h"
-
- /* Set variable that we can't break */
-
-#if !defined(THREAD)
-void dont_break(void)
-{
- my_dont_interrupt=1;
- return;
-} /* dont_break */
-
-void allow_break(void)
-{
- {
- reg1 int index;
-
- my_dont_interrupt=0;
- if (_my_signals)
- {
- if (_my_signals > MAX_SIGNALS)
- _my_signals=MAX_SIGNALS;
- for (index=0 ; index < _my_signals ; index++)
- {
- if (_my_sig_remember[index].func) /* Safequard */
- {
- (*_my_sig_remember[index].func)(_my_sig_remember[index].number);
- _my_sig_remember[index].func=0;
- }
- }
- _my_signals=0;
- }
- }
-} /* dont_break */
-#endif
-
- /* Set old status */
-
-#if !defined(THREAD)
-void my_remember_signal(int signal_number, sig_handler (*func) (int))
-{
-#ifndef __WIN__
- reg1 int index;
-
- index=_my_signals++; /* Nobody can break a ++ ? */
- if (index < MAX_SIGNALS)
- {
- _my_sig_remember[index].number=signal_number;
- _my_sig_remember[index].func=func;
- }
-#endif /* __WIN__ */
-} /* my_remember_signal */
-#endif /* THREAD */
diff --git a/mysys/mf_format.c b/mysys/mf_format.c
index 6afa2938fa3..74f114a966f 100644
--- a/mysys/mf_format.c
+++ b/mysys/mf_format.c
@@ -31,6 +31,8 @@ char * fn_format(char * to, const char *name, const char *dir,
reg1 size_t length;
size_t dev_length;
DBUG_ENTER("fn_format");
+ DBUG_ASSERT(name != NULL);
+ DBUG_ASSERT(extension != NULL);
DBUG_PRINT("enter",("name: %s dir: %s extension: %s flag: %d",
name,dir,extension,flag));
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index aa7e4be03eb..4a548fe330f 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -55,15 +55,10 @@ static void my_aiowait(my_aio_result *result);
#endif
#include <errno.h>
-#ifdef THREAD
#define lock_append_buffer(info) \
mysql_mutex_lock(&(info)->append_buffer_lock)
#define unlock_append_buffer(info) \
mysql_mutex_unlock(&(info)->append_buffer_lock)
-#else
-#define lock_append_buffer(info)
-#define unlock_append_buffer(info)
-#endif
#define IO_ROUND_UP(X) (((X)+IO_SIZE-1) & ~(IO_SIZE-1))
#define IO_ROUND_DN(X) ( (X) & ~(IO_SIZE-1))
@@ -116,11 +111,7 @@ init_functions(IO_CACHE* info)
info->write_function = 0; /* Force a core if used */
break;
default:
- info->read_function =
-#ifdef THREAD
- info->share ? _my_b_read_r :
-#endif
- _my_b_read;
+ info->read_function = info->share ? _my_b_read_r : _my_b_read;
info->write_function = _my_b_write;
}
@@ -173,7 +164,7 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
if (file >= 0)
{
- pos= my_tell(file, MYF(0));
+ pos= mysql_file_tell(file, MYF(0));
if ((pos == (my_off_t) -1) && (my_errno == ESPIPE))
{
/*
@@ -193,9 +184,7 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
}
info->disk_writes= 0;
-#ifdef THREAD
info->share=0;
-#endif
if (!cachesize && !(cachesize= my_default_record_cache_size))
DBUG_RETURN(1); /* No cache requested */
@@ -205,7 +194,7 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
if (!(cache_myflags & MY_DONT_CHECK_FILESIZE))
{
/* Calculate end of file to avoid allocating oversized buffers */
- end_of_file=my_seek(file,0L,MY_SEEK_END,MYF(0));
+ end_of_file= mysql_file_seek(file, 0L, MY_SEEK_END, MYF(0));
/* Need to reset seek_not_done now that we just did a seek. */
info->seek_not_done= end_of_file == seek_offset ? 0 : 1;
if (end_of_file < seek_offset)
@@ -263,12 +252,10 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
{
info->append_read_pos = info->write_pos = info->write_buffer;
info->write_end = info->write_buffer + info->buffer_length;
-#ifdef THREAD
mysql_mutex_init(key_IO_CACHE_append_buffer_lock,
&info->append_buffer_lock, MY_MUTEX_INIT_FAST);
-#endif
}
-#if defined(SAFE_MUTEX) && defined(THREAD)
+#if defined(SAFE_MUTEX)
else
{
/* Clear mutex so that safe_mutex will notice that it's not initialized */
@@ -485,7 +472,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
*/
if (info->seek_not_done)
{
- if ((my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0))
+ if ((mysql_file_seek(info->file, pos_in_file, MY_SEEK_SET, MYF(0))
!= MY_FILEPOS_ERROR))
{
/* No error, reset seek_not_done flag. */
@@ -529,7 +516,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
end aligned with a block.
*/
length=(Count & (size_t) ~(IO_SIZE-1))-diff_length;
- if ((read_length= my_read(info->file,Buffer, length, info->myflags))
+ if ((read_length= mysql_file_read(info->file,Buffer, length, info->myflags))
!= length)
{
/*
@@ -572,7 +559,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
}
length=0; /* Didn't read any chars */
}
- else if ((length= my_read(info->file,info->buffer, max_length,
+ else if ((length= mysql_file_read(info->file,info->buffer, max_length,
info->myflags)) < Count ||
length == (size_t) -1)
{
@@ -601,7 +588,6 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
}
-#ifdef THREAD
/*
Prepare IO_CACHE for shared use.
@@ -1056,7 +1042,7 @@ int _my_b_read_r(register IO_CACHE *cache, uchar *Buffer, size_t Count)
*/
if (cache->seek_not_done)
{
- if (my_seek(cache->file, pos_in_file, MY_SEEK_SET, MYF(0))
+ if (mysql_file_seek(cache->file, pos_in_file, MY_SEEK_SET, MYF(0))
== MY_FILEPOS_ERROR)
{
cache->error= -1;
@@ -1064,7 +1050,7 @@ int _my_b_read_r(register IO_CACHE *cache, uchar *Buffer, size_t Count)
DBUG_RETURN(1);
}
}
- len= my_read(cache->file, cache->buffer, length, cache->myflags);
+ len= mysql_file_read(cache->file, cache->buffer, length, cache->myflags);
}
DBUG_PRINT("io_cache_share", ("read %lu bytes", (ulong) len));
@@ -1162,7 +1148,6 @@ static void copy_to_read_buffer(IO_CACHE *write_cache,
write_length-= copy_length;
}
}
-#endif /*THREAD*/
/*
@@ -1203,7 +1188,7 @@ int _my_b_seq_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
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 (mysql_file_seek(info->file, pos_in_file, MY_SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR)
{
info->error= -1;
unlock_append_buffer(info);
@@ -1220,8 +1205,8 @@ int _my_b_seq_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
size_t read_length;
length=(Count & (size_t) ~(IO_SIZE-1))-diff_length;
- if ((read_length= my_read(info->file,Buffer, length,
- info->myflags)) == (size_t) -1)
+ if ((read_length= mysql_file_read(info->file,Buffer, length,
+ info->myflags)) == (size_t) -1)
{
info->error= -1;
unlock_append_buffer(info);
@@ -1254,7 +1239,7 @@ int _my_b_seq_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
}
else
{
- length= my_read(info->file,info->buffer, max_length, info->myflags);
+ length= mysql_file_read(info->file,info->buffer, max_length, info->myflags);
if (length == (size_t) -1)
{
info->error= -1;
@@ -1431,7 +1416,7 @@ int _my_b_async_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
return 1;
}
- if (my_seek(info->file,next_pos_in_file,MY_SEEK_SET,MYF(0))
+ if (mysql_file_seek(info->file, next_pos_in_file, MY_SEEK_SET, MYF(0))
== MY_FILEPOS_ERROR)
{
info->error= -1;
@@ -1441,8 +1426,8 @@ int _my_b_async_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
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)) == (size_t) -1)
+ if ((read_length=mysql_file_read(info->file,info->request_pos,
+ 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);
@@ -1462,7 +1447,7 @@ int _my_b_async_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
}
else
{ /* Big block, don't cache it */
- if ((read_length= my_read(info->file,Buffer, Count,info->myflags))
+ if ((read_length= mysql_file_read(info->file, Buffer, Count,info->myflags))
!= Count)
{
info->error= read_length == (size_t) -1 ? -1 : read_length+left_length;
@@ -1569,17 +1554,16 @@ int _my_b_write(register IO_CACHE *info, const uchar *Buffer, size_t Count)
"seek_not_done" to indicate this to other functions operating
on the IO_CACHE.
*/
- if (my_seek(info->file,info->pos_in_file,MY_SEEK_SET,MYF(0)))
+ if (mysql_file_seek(info->file, info->pos_in_file, MY_SEEK_SET, MYF(0)))
{
info->error= -1;
return (1);
}
info->seek_not_done=0;
}
- if (my_write(info->file, Buffer, length, info->myflags | MY_NABP))
+ if (mysql_file_write(info->file, Buffer, length, info->myflags | MY_NABP))
return info->error= -1;
-#ifdef THREAD
/*
In case of a shared I/O cache with a writer we normally do direct
write cache to read cache copy. Simulate this here by direct
@@ -1593,7 +1577,6 @@ int _my_b_write(register IO_CACHE *info, const uchar *Buffer, size_t Count)
*/
if (info->share)
copy_to_read_buffer(info, Buffer, length);
-#endif
Count-=length;
Buffer+=length;
@@ -1615,13 +1598,11 @@ int my_b_append(register IO_CACHE *info, const uchar *Buffer, size_t Count)
{
size_t rest_length,length;
-#ifdef THREAD
/*
Assert that we cannot come here with a shared cache. If we do one
day, we might need to add a call to copy_to_read_buffer().
*/
DBUG_ASSERT(!info->share);
-#endif
lock_append_buffer(info);
rest_length= (size_t) (info->write_end - info->write_pos);
@@ -1639,7 +1620,7 @@ int my_b_append(register IO_CACHE *info, const uchar *Buffer, size_t Count)
if (Count >= IO_SIZE)
{ /* Fill first intern buffer */
length=Count & (size_t) ~(IO_SIZE-1);
- if (my_write(info->file,Buffer, length, info->myflags | MY_NABP))
+ if (mysql_file_write(info->file,Buffer, length, info->myflags | MY_NABP))
{
unlock_append_buffer(info);
return info->error= -1;
@@ -1683,23 +1664,21 @@ int my_block_write(register IO_CACHE *info, const uchar *Buffer, size_t Count,
size_t length;
int error=0;
-#ifdef THREAD
/*
Assert that we cannot come here with a shared cache. If we do one
day, we might need to add a call to copy_to_read_buffer().
*/
DBUG_ASSERT(!info->share);
-#endif
if (pos < info->pos_in_file)
{
/* Of no overlap, write everything without buffering */
if (pos + Count <= info->pos_in_file)
- return (int) my_pwrite(info->file, Buffer, Count, pos,
- info->myflags | MY_NABP);
+ return (int)mysql_file_pwrite(info->file, Buffer, Count, pos,
+ info->myflags | MY_NABP);
/* 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))
+ if (mysql_file_pwrite(info->file, Buffer, length, pos, info->myflags | MY_NABP))
info->error= error= -1;
Buffer+=length;
pos+= length;
@@ -1735,16 +1714,10 @@ int my_block_write(register IO_CACHE *info, const uchar *Buffer, size_t Count,
/* Flush write cache */
-#ifdef THREAD
#define LOCK_APPEND_BUFFER if (need_append_buffer_lock) \
lock_append_buffer(info);
#define UNLOCK_APPEND_BUFFER if (need_append_buffer_lock) \
unlock_append_buffer(info);
-#else
-#define LOCK_APPEND_BUFFER
-#define UNLOCK_APPEND_BUFFER
-#endif
-
int my_b_flush_io_cache(IO_CACHE *info,
int need_append_buffer_lock __attribute__((unused)))
@@ -1755,10 +1728,8 @@ int my_b_flush_io_cache(IO_CACHE *info,
DBUG_ENTER("my_b_flush_io_cache");
DBUG_PRINT("enter", ("cache: 0x%lx", (long) info));
-#ifdef THREAD
if (!append_cache)
need_append_buffer_lock= 0;
-#endif
if (info->type == WRITE_CACHE || append_cache)
{
@@ -1771,7 +1742,6 @@ int my_b_flush_io_cache(IO_CACHE *info,
if ((length=(size_t) (info->write_pos - info->write_buffer)))
{
-#ifdef THREAD
/*
In case of a shared I/O cache with a writer we do direct write
cache to read cache copy. Do it before the write here so that
@@ -1780,7 +1750,6 @@ int my_b_flush_io_cache(IO_CACHE *info,
*/
if (info->share)
copy_to_read_buffer(info, info->write_buffer, length);
-#endif
pos_in_file=info->pos_in_file;
/*
@@ -1789,7 +1758,7 @@ int my_b_flush_io_cache(IO_CACHE *info,
*/
if (!append_cache && info->seek_not_done)
{ /* File touched, do seek */
- if (my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) ==
+ if (mysql_file_seek(info->file, pos_in_file, MY_SEEK_SET, MYF(0)) ==
MY_FILEPOS_ERROR)
{
UNLOCK_APPEND_BUFFER;
@@ -1803,7 +1772,7 @@ int my_b_flush_io_cache(IO_CACHE *info,
info->write_end= (info->write_buffer+info->buffer_length-
((pos_in_file+length) & (IO_SIZE-1)));
- if (my_write(info->file,info->write_buffer,length,
+ if (mysql_file_write(info->file,info->write_buffer,length,
info->myflags | MY_NABP))
info->error= -1;
else
@@ -1815,7 +1784,7 @@ int my_b_flush_io_cache(IO_CACHE *info,
else
{
info->end_of_file+=(info->write_pos-info->append_read_pos);
- DBUG_ASSERT(info->end_of_file == my_tell(info->file,MYF(0)));
+ DBUG_ASSERT(info->end_of_file == mysql_file_tell(info->file, MYF(0)));
}
info->append_read_pos=info->write_pos=info->write_buffer;
@@ -1859,13 +1828,11 @@ int end_io_cache(IO_CACHE *info)
DBUG_ENTER("end_io_cache");
DBUG_PRINT("enter",("cache: 0x%lx", (ulong) info));
-#ifdef THREAD
/*
Every thread must call remove_io_thread(). The last one destroys
the share elements.
*/
DBUG_ASSERT(!info->share || !info->share->total_threads);
-#endif
if ((pre_close=info->pre_close))
{
@@ -1884,9 +1851,7 @@ int end_io_cache(IO_CACHE *info)
{
/* Destroy allocated mutex */
info->type= TYPE_NOT_SET;
-#ifdef THREAD
mysql_mutex_destroy(&info->append_buffer_lock);
-#endif
}
#ifdef THREAD
info->share= 0;
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index c74504e4fa8..85631e9741b 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -90,9 +90,8 @@ my_off_t my_b_append_tell(IO_CACHE* info)
from messing with the variables that we need in order to provide the
answer to the question.
*/
-#ifdef THREAD
mysql_mutex_lock(&info->append_buffer_lock);
-#endif
+
#ifndef DBUG_OFF
/*
Make sure EOF is where we think it is. Note that we cannot just use
@@ -112,9 +111,7 @@ my_off_t my_b_append_tell(IO_CACHE* info)
}
#endif
res = info->end_of_file + (info->write_pos-info->append_read_pos);
-#ifdef THREAD
mysql_mutex_unlock(&info->append_buffer_lock);
-#endif
return res;
}
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 41b93517655..80111b3245d 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -318,16 +318,11 @@ KEY_CACHE *dflt_key_cache= &dflt_key_cache_var;
static int flush_all_key_blocks(SIMPLE_KEY_CACHE_CB *keycache);
static void end_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, my_bool cleanup);
-#ifdef THREAD
static void wait_on_queue(KEYCACHE_WQUEUE *wqueue,
mysql_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(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block);
-#if !defined(DBUG_OFF)
+#ifndef DBUG_OFF
static void test_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
const char *where, my_bool lock);
#endif
@@ -379,7 +374,6 @@ static void keycache_debug_print(const char *fmt,...);
#endif /* defined(KEYCACHE_DEBUG_LOG) && defined(KEYCACHE_DEBUG) */
#if defined(KEYCACHE_DEBUG) || !defined(DBUG_OFF)
-#ifdef THREAD
static long keycache_thread_id;
#define KEYCACHE_THREAD_TRACE(l) \
KEYCACHE_DBUG_PRINT(l,("|thread %ld",keycache_thread_id))
@@ -391,11 +385,6 @@ static long keycache_thread_id;
#define KEYCACHE_THREAD_TRACE_END(l) \
KEYCACHE_DBUG_PRINT(l,("]thread %ld",keycache_thread_id))
-#else /* THREAD */
-#define KEYCACHE_THREAD_TRACE(l) KEYCACHE_DBUG_PRINT(l,(""))
-#define KEYCACHE_THREAD_TRACE_BEGIN(l) KEYCACHE_DBUG_PRINT(l,(""))
-#define KEYCACHE_THREAD_TRACE_END(l) KEYCACHE_DBUG_PRINT(l,(""))
-#endif /* THREAD */
#else
#define KEYCACHE_THREAD_TRACE_BEGIN(l)
#define KEYCACHE_THREAD_TRACE_END(l)
@@ -685,7 +674,6 @@ int prepare_resize_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
keycache_pthread_mutex_lock(&keycache->cache_lock);
-#ifdef 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
@@ -698,7 +686,6 @@ int prepare_resize_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
wait_on_queue(&keycache->resize_queue, &keycache->cache_lock);
/* purecov: end */
}
-#endif
/*
Mark the operation in progress. This blocks other threads from doing
@@ -727,7 +714,6 @@ int prepare_resize_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
keycache->resize_in_flush= 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,
@@ -741,9 +727,6 @@ int prepare_resize_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
*/
while (keycache->cnt_for_resize_op)
wait_on_queue(&keycache->waiting_for_resize_cnt, &keycache->cache_lock);
-#else
- KEYCACHE_DBUG_ASSERT(keycache->cnt_for_resize_op == 0);
-#endif
end_simple_key_cache(keycache, 0);
@@ -1022,8 +1005,6 @@ void end_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, my_bool cleanup)
} /* end_key_cache */
-#ifdef THREAD
-
/*
Link a thread into double-linked queue of waiting threads.
@@ -1203,8 +1184,6 @@ static void release_whole_queue(KEYCACHE_WQUEUE *wqueue)
wqueue->last_thread= NULL;
}
-#endif /* THREAD */
-
/*
Unlink a block from the chain of dirty/clean blocks
@@ -1376,7 +1355,6 @@ static void link_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block,
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)
{
/* Signal that in the LRU warm sub-chain an available block has appeared */
@@ -1436,10 +1414,6 @@ static void link_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block,
#endif
return;
}
-#else /* THREAD */
- KEYCACHE_DBUG_ASSERT(! (!hot && keycache->waiting_for_block.last_thread));
- /* Condition not transformed using DeMorgan, to keep the text identical */
-#endif /* THREAD */
pins= hot ? &keycache->used_ins : &keycache->used_last;
ins= *pins;
if (ins)
@@ -1662,12 +1636,8 @@ static void remove_reader(BLOCK_LINK *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);
-#else
- --block->hash_link->requests;
-#endif
}
@@ -1679,7 +1649,6 @@ static void remove_reader(BLOCK_LINK *block)
static void wait_for_readers(SIMPLE_KEY_CACHE_CB *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_IN_FLUSH | BLOCK_CHANGED)));
@@ -1701,9 +1670,6 @@ static void wait_for_readers(SIMPLE_KEY_CACHE_CB *keycache,
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
block->condvar= NULL;
}
-#else
- KEYCACHE_DBUG_ASSERT(block->hash_link->requests == 0);
-#endif
}
@@ -1733,7 +1699,6 @@ static void unlink_hash(SIMPLE_KEY_CACHE_CB *keycache, HASH_LINK *hash_link)
if ((*hash_link->prev= hash_link->next))
hash_link->next->prev= hash_link->prev;
hash_link->block= NULL;
-#ifdef THREAD
if (keycache->waiting_for_hash_link.last_thread)
{
/* Signal that a free hash link has appeared */
@@ -1769,9 +1734,6 @@ static void unlink_hash(SIMPLE_KEY_CACHE_CB *keycache, HASH_LINK *hash_link)
hash_link);
return;
}
-#else /* THREAD */
- KEYCACHE_DBUG_ASSERT(! (keycache->waiting_for_hash_link.last_thread));
-#endif /* THREAD */
hash_link->next= keycache->free_hash_list;
keycache->free_hash_list= hash_link;
}
@@ -1836,7 +1798,6 @@ restart:
}
else
{
-#ifdef THREAD
/* Wait for a free hash link */
struct st_my_thread_var *thread= my_thread_var;
KEYCACHE_PAGE page;
@@ -1850,9 +1811,6 @@ restart:
keycache_pthread_cond_wait(&thread->suspend,
&keycache->cache_lock);
thread->opt_info= NULL;
-#else
- KEYCACHE_DBUG_ASSERT(0);
-#endif
goto restart;
}
hash_link->file= file;
@@ -1972,7 +1930,6 @@ restart:
- block assigned but not yet read from file (invalid data).
*/
-#ifdef THREAD
if (keycache->in_resize)
{
/* This is a request during a resize operation */
@@ -2214,9 +2171,6 @@ restart:
}
DBUG_RETURN(0);
}
-#else /* THREAD */
- DBUG_ASSERT(!keycache->in_resize);
-#endif
if (page_status == PAGE_READ &&
(block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH |
@@ -2346,7 +2300,6 @@ restart:
from the LRU ring.
*/
-#ifdef THREAD
if (! keycache->used_last)
{
/*
@@ -2379,9 +2332,6 @@ restart:
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
@@ -2868,11 +2818,6 @@ uchar *simple_key_cache_read(SIMPLE_KEY_CACHE_CB *keycache,
set_if_smaller(read_length, keycache->key_cache_block_size-offset);
KEYCACHE_DBUG_ASSERT(read_length > 0);
-#ifndef THREAD
- if (block_length > keycache->key_cache_block_size || offset)
- return_buffer=0;
-#endif
-
/* Request the cache block that matches file/pos. */
keycache->global_cache_r_requests++;
@@ -2931,9 +2876,6 @@ uchar *simple_key_cache_read(SIMPLE_KEY_CACHE_CB *keycache,
/* block status may have added BLOCK_ERROR in the above 'if'. */
if (!(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)
@@ -2972,20 +2914,6 @@ uchar *simple_key_cache_read(SIMPLE_KEY_CACHE_CB *keycache,
break;
}
-#ifndef THREAD
- /* This is only true if we where able to read everything in one block */
- if (return_buffer)
- {
- if (MYSQL_KEYCACHE_READ_DONE_ENABLED())
- {
- MYSQL_KEYCACHE_READ_DONE((ulong) (keycache->blocks_used *
- keycache->key_cache_block_size),
- (ulong) (keycache->blocks_unused *
- keycache->key_cache_block_size));
- }
- DBUG_RETURN(block->buffer);
- }
-#endif
next_block:
buff+= read_length;
filepos+= read_length+offset;
@@ -4262,17 +4190,11 @@ restart:
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;
-
- LINT_INIT(next_hash_link);
- LINT_INIT(next_diskpos);
- LINT_INIT(next_file);
- LINT_INIT(next_status);
- LINT_INIT(hash_requests);
+ struct st_hash_link *UNINIT_VAR(next_hash_link);
+ my_off_t UNINIT_VAR(next_diskpos);
+ File UNINIT_VAR(next_file);
+ uint UNINIT_VAR(next_status);
+ uint UNINIT_VAR(hash_requests);
total_found++;
found++;
@@ -5488,10 +5410,6 @@ uchar *partitioned_key_cache_read(PARTITIONED_KEY_CACHE_CB *keycache,
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
(uint) file, (ulong) filepos, length));
-#ifndef THREAD
- if (block_length > keycache->key_cache_block_size || offset)
- return_buffer=0;
-#endif
/* Read data in key_cache_block_size increments */
do
@@ -5507,11 +5425,6 @@ uchar *partitioned_key_cache_read(PARTITIONED_KEY_CACHE_CB *keycache,
block_length, return_buffer);
if (ret_buff == 0)
DBUG_RETURN(0);
-#ifndef THREAD
- /* This is only true if we were able to read everything in one block */
- if (return_buffer)
- DBUG_RETURN(ret_buff);
-#endif
filepos+= r_length;
buff+= r_length;
offset= 0;
diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c
index c6e6a3a429e..790936461a4 100644
--- a/mysys/mf_pack.c
+++ b/mysys/mf_pack.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
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
@@ -192,7 +192,8 @@ size_t cleanup_dirname(register char *to, const char *from)
end_parentdir=pos;
while (pos >= start && *pos != FN_LIBCHAR) /* remove prev dir */
pos--;
- if (pos[1] == FN_HOMELIB || memcmp(pos,parent,length) == 0)
+ if (pos[1] == FN_HOMELIB ||
+ (pos >= start && memcmp(pos, parent, length) == 0))
{ /* Don't remove ~user/ */
pos=strmov(end_parentdir+1,parent);
*pos=FN_LIBCHAR;
diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c
index 22199758112..be39ac50731 100644
--- a/mysys/my_bitmap.c
+++ b/mysys/my_bitmap.c
@@ -21,17 +21,13 @@
* the internal size is a set of 32 bit words
* the number of bits specified in creation can be any number > 0
- * there are THREAD safe versions of most calls called bitmap_lock_*
- many of those are not used and not compiled normally but the code
- already exist for them in an #ifdef:ed part. These can only be used
- if THREAD was specified in bitmap_init
TODO:
- Make assembler THREAD safe versions of these using test-and-set instructions
+ Make assembler thread safe versions of these using test-and-set instructions
Original version created by Sergei Golubchik 2001 - 2004.
New version written and test program added and some changes to the interface
- was made by Mikael Ronström 2005, with assistance of Tomas Ulin and Mats
+ was made by Mikael Ronstrom 2005, with assistance of Tomas Ulin and Mats
Kindahl.
*/
@@ -100,18 +96,14 @@ void create_last_word_mask(MY_BITMAP *map)
static inline void bitmap_lock(MY_BITMAP *map __attribute__((unused)))
{
-#ifdef THREAD
if (map->mutex)
mysql_mutex_lock(map->mutex);
-#endif
}
static inline void bitmap_unlock(MY_BITMAP *map __attribute__((unused)))
{
-#ifdef THREAD
if (map->mutex)
mysql_mutex_unlock(map->mutex);
-#endif
}
@@ -123,30 +115,24 @@ my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
{
uint size_in_bytes= bitmap_buffer_size(n_bits);
uint extra= 0;
-#ifdef THREAD
if (thread_safe)
{
size_in_bytes= ALIGN_SIZE(size_in_bytes);
extra= sizeof(mysql_mutex_t);
}
map->mutex= 0;
-#endif
if (!(buf= (my_bitmap_map*) my_malloc(size_in_bytes+extra, MYF(MY_WME))))
DBUG_RETURN(1);
-#ifdef THREAD
if (thread_safe)
{
map->mutex= (mysql_mutex_t *) ((char*) buf + size_in_bytes);
mysql_mutex_init(key_BITMAP_mutex, map->mutex, MY_MUTEX_INIT_FAST);
}
-#endif
}
-#ifdef THREAD
else
{
DBUG_ASSERT(thread_safe == 0);
}
-#endif
map->bitmap= buf;
map->n_bits= n_bits;
@@ -161,10 +147,8 @@ void bitmap_free(MY_BITMAP *map)
DBUG_ENTER("bitmap_free");
if (map->bitmap)
{
-#ifdef THREAD
if (map->mutex)
mysql_mutex_destroy(map->mutex);
-#endif
my_free(map->bitmap);
map->bitmap=0;
}
diff --git a/mysys/my_compare.c b/mysys/my_compare.c
new file mode 100644
index 00000000000..4629a3bae18
--- /dev/null
+++ b/mysys/my_compare.c
@@ -0,0 +1,642 @@
+/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include <my_global.h>
+#include <m_ctype.h>
+#include <my_base.h>
+#include <my_compare.h>
+#include <my_sys.h>
+
+int ha_compare_text(CHARSET_INFO *charset_info, const uchar *a, uint a_length,
+ const uchar *b, uint b_length, my_bool part_key,
+ my_bool skip_end_space)
+{
+ if (!part_key)
+ return charset_info->coll->strnncollsp(charset_info, a, a_length,
+ b, b_length, (my_bool)!skip_end_space);
+ return charset_info->coll->strnncoll(charset_info, a, a_length,
+ b, b_length, part_key);
+}
+
+
+static int compare_bin(const uchar *a, uint a_length,
+ const uchar *b, uint b_length,
+ my_bool part_key, my_bool skip_end_space)
+{
+ uint length= min(a_length,b_length);
+ const uchar *end= a+ length;
+ int flag;
+
+ while (a < end)
+ if ((flag= (int) *a++ - (int) *b++))
+ return flag;
+ if (part_key && b_length < a_length)
+ return 0;
+ if (skip_end_space && a_length != b_length)
+ {
+ int swap= 1;
+ /*
+ We are using space compression. We have to check if longer key
+ has next character < ' ', in which case it's less than the shorter
+ key that has an implicite space afterwards.
+
+ This code is identical to the one in
+ strings/ctype-simple.c:my_strnncollsp_simple
+ */
+ if (a_length < b_length)
+ {
+ /* put shorter key in a */
+ a_length= b_length;
+ a= b;
+ swap= -1; /* swap sign of result */
+ }
+ for (end= a + a_length-length; a < end ; a++)
+ {
+ if (*a != ' ')
+ return (*a < ' ') ? -swap : swap;
+ }
+ return 0;
+ }
+ return (int) (a_length-b_length);
+}
+
+
+/*
+ Compare two keys
+
+ SYNOPSIS
+ ha_key_cmp()
+ keyseg Array of key segments of key to compare
+ a First key to compare, in format from _mi_pack_key()
+ This is always from the row
+ b Second key to compare. This is from the row or the user
+ key_length Length of key to compare, based on key b. This can be shorter
+ than b to just compare sub keys
+ next_flag How keys should be compared
+ If bit SEARCH_FIND is not set the keys includes the row
+ position and this should also be compared
+ If SEARCH_PAGE_KEY_HAS_TRANSID is set then 'a' has transid
+ If SEARCH_USER_KEY_HAS_TRANSID is set then 'b' has transid
+ diff_pos OUT Number of first keypart where values differ, counting
+ from one.
+ diff_pos[1] OUT (b + diff_pos[1]) points to first value in tuple b
+ that is different from corresponding value in tuple a.
+
+ EXAMPLES
+ Example1: if the function is called for tuples
+ ('aaa','bbb') and ('eee','fff'), then
+ diff_pos[0] = 1 (as 'aaa' != 'eee')
+ diff_pos[1] = 0 (offset from beggining of tuple b to 'eee' keypart).
+
+ Example2: if the index function is called for tuples
+ ('aaa','bbb') and ('aaa','fff'),
+ diff_pos[0] = 2 (as 'aaa' != 'eee')
+ diff_pos[1] = 3 (offset from beggining of tuple b to 'fff' keypart,
+ here we assume that first key part is CHAR(3) NOT NULL)
+
+ NOTES
+ Number-keys can't be splited
+
+ RETURN VALUES
+ <0 If a < b
+ 0 If a == b
+ >0 If a > b
+*/
+
+#define FCMP(A,B) ((int) (A) - (int) (B))
+
+int ha_key_cmp(HA_KEYSEG *keyseg, const uchar *a,
+ const uchar *b, uint key_length, uint32 nextflag,
+ uint *diff_pos)
+{
+ int flag;
+ int16 s_1,s_2;
+ int32 l_1,l_2;
+ uint32 u_1,u_2;
+ float f_1,f_2;
+ double d_1,d_2;
+ uint next_key_length;
+ const uchar *orig_b= b;
+
+ *diff_pos=0;
+ for ( ; (int) key_length >0 ; key_length=next_key_length, keyseg++)
+ {
+ const uchar *end;
+ uint piks=! (keyseg->flag & HA_NO_SORT);
+ (*diff_pos)++;
+ diff_pos[1]= (uint)(b - orig_b);
+
+ /* Handle NULL part */
+ if (keyseg->null_bit)
+ {
+ key_length--;
+ if (*a != *b && piks)
+ {
+ flag = (int) *a - (int) *b;
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ }
+ b++;
+ if (!*a++) /* If key was NULL */
+ {
+ if ((nextflag & (SEARCH_FIND | SEARCH_UPDATE | SEARCH_INSERT |
+ SEARCH_NULL_ARE_EQUAL)) ==
+ (SEARCH_FIND | SEARCH_UPDATE | SEARCH_INSERT))
+ {
+ /* Allow duplicate keys */
+ nextflag= (nextflag & ~(SEARCH_FIND | SEARCH_UPDATE)) | SEARCH_SAME;
+ }
+ else if (nextflag & SEARCH_NULL_ARE_NOT_EQUAL)
+ {
+ /*
+ This is only used from mi_check() to calculate cardinality.
+ It can't be used when searching for a key as this would cause
+ compare of (a,b) and (b,a) to return the same value.
+ */
+ return -1;
+ }
+ next_key_length=key_length;
+ continue; /* To next key part */
+ }
+ }
+ end= a+ min(keyseg->length,key_length);
+ next_key_length=key_length-keyseg->length;
+
+ switch ((enum ha_base_keytype) keyseg->type) {
+ case HA_KEYTYPE_TEXT: /* Ascii; Key is converted */
+ if (keyseg->flag & HA_SPACE_PACK)
+ {
+ int a_length,b_length,pack_length;
+ get_key_length(a_length,a);
+ get_key_pack_length(b_length,pack_length,b);
+ next_key_length=key_length-b_length-pack_length;
+
+ if (piks &&
+ (flag=ha_compare_text(keyseg->charset,a,a_length,b,b_length,
+ (my_bool) ((nextflag & SEARCH_PREFIX) &&
+ next_key_length <= 0),
+ (my_bool)!(nextflag & SEARCH_PREFIX))))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a+=a_length;
+ b+=b_length;
+ break;
+ }
+ else
+ {
+ uint length=(uint) (end-a), a_length=length, b_length=length;
+ if (piks &&
+ (flag= ha_compare_text(keyseg->charset, a, a_length, b, b_length,
+ (my_bool) ((nextflag & SEARCH_PREFIX) &&
+ next_key_length <= 0),
+ (my_bool)!(nextflag & SEARCH_PREFIX))))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a=end;
+ b+=length;
+ }
+ break;
+ case HA_KEYTYPE_BINARY:
+ case HA_KEYTYPE_BIT:
+ if (keyseg->flag & HA_SPACE_PACK)
+ {
+ int a_length,b_length,pack_length;
+ get_key_length(a_length,a);
+ get_key_pack_length(b_length,pack_length,b);
+ next_key_length=key_length-b_length-pack_length;
+
+ if (piks &&
+ (flag=compare_bin(a,a_length,b,b_length,
+ (my_bool) ((nextflag & SEARCH_PREFIX) &&
+ next_key_length <= 0),1)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a+=a_length;
+ b+=b_length;
+ break;
+ }
+ else
+ {
+ uint length=keyseg->length;
+ if (piks &&
+ (flag=compare_bin(a,length,b,length,
+ (my_bool) ((nextflag & SEARCH_PREFIX) &&
+ next_key_length <= 0),0)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a+=length;
+ b+=length;
+ }
+ break;
+ case HA_KEYTYPE_VARTEXT1:
+ case HA_KEYTYPE_VARTEXT2:
+ {
+ int a_length,b_length,pack_length;
+ get_key_length(a_length,a);
+ get_key_pack_length(b_length,pack_length,b);
+ next_key_length=key_length-b_length-pack_length;
+
+ if (piks &&
+ (flag= ha_compare_text(keyseg->charset,a,a_length,b,b_length,
+ (my_bool) ((nextflag & SEARCH_PREFIX) &&
+ next_key_length <= 0),
+ (my_bool) ((nextflag & (SEARCH_FIND |
+ SEARCH_UPDATE)) ==
+ SEARCH_FIND &&
+ ! (keyseg->flag &
+ HA_END_SPACE_ARE_EQUAL)))))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a+= a_length;
+ b+= b_length;
+ break;
+ }
+ break;
+ case HA_KEYTYPE_VARBINARY1:
+ case HA_KEYTYPE_VARBINARY2:
+ {
+ int a_length,b_length,pack_length;
+ get_key_length(a_length,a);
+ get_key_pack_length(b_length,pack_length,b);
+ next_key_length=key_length-b_length-pack_length;
+
+ if (piks &&
+ (flag=compare_bin(a,a_length,b,b_length,
+ (my_bool) ((nextflag & SEARCH_PREFIX) &&
+ next_key_length <= 0), 0)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a+=a_length;
+ b+=b_length;
+ }
+ break;
+ case HA_KEYTYPE_INT8:
+ {
+ int i_1= (int) *((signed char*) a);
+ int i_2= (int) *((signed char*) b);
+ if (piks && (flag = CMP_NUM(i_1,i_2)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a= end;
+ b++;
+ break;
+ }
+ case HA_KEYTYPE_SHORT_INT:
+ s_1= mi_sint2korr(a);
+ s_2= mi_sint2korr(b);
+ if (piks && (flag = CMP_NUM(s_1,s_2)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a= end;
+ b+= 2; /* sizeof(short int); */
+ break;
+ case HA_KEYTYPE_USHORT_INT:
+ {
+ uint16 us_1,us_2;
+ us_1= mi_sint2korr(a);
+ us_2= mi_sint2korr(b);
+ if (piks && (flag = CMP_NUM(us_1,us_2)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a= end;
+ b+=2; /* sizeof(short int); */
+ break;
+ }
+ case HA_KEYTYPE_LONG_INT:
+ l_1= mi_sint4korr(a);
+ l_2= mi_sint4korr(b);
+ if (piks && (flag = CMP_NUM(l_1,l_2)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a= end;
+ b+= 4; /* sizeof(long int); */
+ break;
+ case HA_KEYTYPE_ULONG_INT:
+ u_1= mi_sint4korr(a);
+ u_2= mi_sint4korr(b);
+ if (piks && (flag = CMP_NUM(u_1,u_2)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a= end;
+ b+= 4; /* sizeof(long int); */
+ break;
+ case HA_KEYTYPE_INT24:
+ l_1=mi_sint3korr(a);
+ l_2=mi_sint3korr(b);
+ if (piks && (flag = CMP_NUM(l_1,l_2)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a= end;
+ b+= 3;
+ break;
+ case HA_KEYTYPE_UINT24:
+ l_1=mi_uint3korr(a);
+ l_2=mi_uint3korr(b);
+ if (piks && (flag = CMP_NUM(l_1,l_2)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a= end;
+ b+= 3;
+ break;
+ case HA_KEYTYPE_FLOAT:
+ mi_float4get(f_1,a);
+ mi_float4get(f_2,b);
+ /*
+ The following may give a compiler warning about floating point
+ comparison not being safe, but this is ok in this context as
+ we are bascily doing sorting
+ */
+ if (piks && (flag = CMP_NUM(f_1,f_2)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a= end;
+ b+= 4; /* sizeof(float); */
+ break;
+ case HA_KEYTYPE_DOUBLE:
+ mi_float8get(d_1,a);
+ mi_float8get(d_2,b);
+ /*
+ The following may give a compiler warning about floating point
+ comparison not being safe, but this is ok in this context as
+ we are bascily doing sorting
+ */
+ if (piks && (flag = CMP_NUM(d_1,d_2)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a= end;
+ b+= 8; /* sizeof(double); */
+ break;
+ case HA_KEYTYPE_NUM: /* Numeric key */
+ {
+ int swap_flag= 0;
+ int alength,blength;
+
+ if (keyseg->flag & HA_REVERSE_SORT)
+ {
+ swap_variables(const uchar*, a, b);
+ swap_flag=1; /* Remember swap of a & b */
+ end= a+ (int) (end-b);
+ }
+ if (keyseg->flag & HA_SPACE_PACK)
+ {
+ alength= *a++; blength= *b++;
+ end=a+alength;
+ next_key_length=key_length-blength-1;
+ }
+ else
+ {
+ alength= (int) (end-a);
+ blength=keyseg->length;
+ /* remove pre space from keys */
+ for ( ; alength && *a == ' ' ; a++, alength--) ;
+ for ( ; blength && *b == ' ' ; b++, blength--) ;
+ }
+ if (piks)
+ {
+ if (*a == '-')
+ {
+ if (*b != '-')
+ return -1;
+ a++; b++;
+ swap_variables(const uchar*, a, b);
+ swap_variables(int, alength, blength);
+ swap_flag=1-swap_flag;
+ alength--; blength--;
+ end=a+alength;
+ }
+ else if (*b == '-')
+ return 1;
+ while (alength && (*a == '+' || *a == '0'))
+ {
+ a++; alength--;
+ }
+ while (blength && (*b == '+' || *b == '0'))
+ {
+ b++; blength--;
+ }
+ if (alength != blength)
+ return (alength < blength) ? -1 : 1;
+ while (a < end)
+ if (*a++ != *b++)
+ return ((int) a[-1] - (int) b[-1]);
+ }
+ else
+ {
+ b+=(end-a);
+ a=end;
+ }
+
+ if (swap_flag) /* Restore pointers */
+ swap_variables(const uchar*, a, b);
+ break;
+ }
+#ifdef HAVE_LONG_LONG
+ case HA_KEYTYPE_LONGLONG:
+ {
+ longlong ll_a,ll_b;
+ ll_a= mi_sint8korr(a);
+ ll_b= mi_sint8korr(b);
+ if (piks && (flag = CMP_NUM(ll_a,ll_b)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a= end;
+ b+= 8;
+ break;
+ }
+ case HA_KEYTYPE_ULONGLONG:
+ {
+ ulonglong ll_a,ll_b;
+ ll_a= mi_uint8korr(a);
+ ll_b= mi_uint8korr(b);
+ if (piks && (flag = CMP_NUM(ll_a,ll_b)))
+ return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+ a= end;
+ b+= 8;
+ break;
+ }
+#endif
+ case HA_KEYTYPE_END: /* Ready */
+ goto end; /* diff_pos is incremented */
+ }
+ }
+ (*diff_pos)++;
+end:
+ if (!(nextflag & SEARCH_FIND))
+ {
+ /*
+ Compare rowid and possible transid
+ This happens in the following case:
+ - INSERT, UPDATE, DELETE when we have not unique keys or
+ are using versioning
+ - SEARCH_NEXT, SEARCH_PREVIOUS when we need to restart search
+
+ The logic for comparing transid are as follows:
+ Keys with have a transid have lowest bit in the rowidt. This means that
+ if we are comparing a key with a transid with another key that doesn't
+ have a tranid, we must reset the lowest bit for both keys.
+
+ When we have transid, the keys are compared in transid order.
+ A key without a transid is regared to be smaller than a key with
+ a transid.
+ */
+
+ uint i;
+ uchar key_mask, tmp_a, tmp_b;
+
+ if (nextflag & (SEARCH_NO_FIND | SEARCH_LAST)) /* Find record after key */
+ return (nextflag & (SEARCH_BIGGER | SEARCH_LAST)) ? -1 : 1;
+ key_mask= (uchar) 255;
+
+ if (!(nextflag & (SEARCH_USER_KEY_HAS_TRANSID |
+ SEARCH_PAGE_KEY_HAS_TRANSID)))
+ {
+ /*
+ Neither key has a trid. Only compare row id's and don't
+ try to store rows in trid order
+ */
+ key_length= keyseg->length;
+ nextflag&= ~SEARCH_INSERT;
+ }
+ else
+ {
+ /*
+ Set key_mask so that we reset the last bit in the rowid before
+ we compare it. This is needed as the lowest bit in the rowid is
+ used to mark if the key has a transid or not.
+ */
+ key_mask= (uchar) 254;
+ if (!test_all_bits(nextflag, (SEARCH_USER_KEY_HAS_TRANSID |
+ SEARCH_PAGE_KEY_HAS_TRANSID)))
+ {
+ /*
+ No transaction id for user key or for key on page
+ Ignore transid as at least one of the keys are visible for all
+ */
+ key_length= keyseg->length;
+ }
+ else
+ {
+ /*
+ Both keys have trids. No need of special handling of incomplete
+ trids below.
+ */
+ nextflag&= ~SEARCH_INSERT;
+ }
+ }
+ DBUG_ASSERT(key_length > 0);
+
+ for (i= key_length-1 ; (int) i-- > 0 ; )
+ {
+ if (*a++ != *b++)
+ {
+ flag= FCMP(a[-1],b[-1]);
+ goto found;
+ }
+ }
+ tmp_a= *a & key_mask;
+ tmp_b= *b & key_mask;
+ flag= FCMP(tmp_a, tmp_b);
+
+ if (flag == 0 && (nextflag & SEARCH_INSERT))
+ {
+ /*
+ Ensure that on insert we get rows stored in trid order.
+ If one of the parts doesn't have a trid, this should be regarded
+ as smaller than the other
+ */
+ return (nextflag & SEARCH_USER_KEY_HAS_TRANSID) ? -1 : 1;
+ }
+found:
+ if (nextflag & SEARCH_SAME)
+ return (flag); /* read same */
+ if (nextflag & SEARCH_BIGGER)
+ return (flag <= 0 ? -1 : 1); /* read next */
+ return (flag < 0 ? -1 : 1); /* read previous */
+ }
+ return 0;
+} /* ha_key_cmp */
+
+/*
+ Find the first NULL value in index-suffix values tuple
+
+ SYNOPSIS
+ ha_find_null()
+ keyseg Array of keyparts for key suffix
+ a Key suffix value tuple
+
+ DESCRIPTION
+ Find the first NULL value in index-suffix values tuple.
+
+ TODO
+ Consider optimizing this function or its use so we don't search for
+ NULL values in completely NOT NULL index suffixes.
+
+ RETURN
+ First key part that has NULL as value in values tuple, or the last key
+ part (with keyseg->type==HA_TYPE_END) if values tuple doesn't contain
+ NULLs.
+*/
+
+HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, const uchar *a)
+{
+ for (; (enum ha_base_keytype) keyseg->type != HA_KEYTYPE_END; keyseg++)
+ {
+ const uchar *end;
+ if (keyseg->null_bit)
+ {
+ if (!*a++)
+ return keyseg;
+ }
+ end= a+ keyseg->length;
+
+ switch ((enum ha_base_keytype) keyseg->type) {
+ case HA_KEYTYPE_TEXT:
+ case HA_KEYTYPE_BINARY:
+ case HA_KEYTYPE_BIT:
+ if (keyseg->flag & HA_SPACE_PACK)
+ {
+ int a_length;
+ get_key_length(a_length, a);
+ a += a_length;
+ break;
+ }
+ else
+ a= end;
+ break;
+ case HA_KEYTYPE_VARTEXT1:
+ case HA_KEYTYPE_VARTEXT2:
+ case HA_KEYTYPE_VARBINARY1:
+ case HA_KEYTYPE_VARBINARY2:
+ {
+ int a_length;
+ get_key_length(a_length, a);
+ a+= a_length;
+ break;
+ }
+ case HA_KEYTYPE_NUM:
+ if (keyseg->flag & HA_SPACE_PACK)
+ {
+ int alength= *a++;
+ end= a+alength;
+ }
+ a= end;
+ break;
+ case HA_KEYTYPE_INT8:
+ case HA_KEYTYPE_SHORT_INT:
+ case HA_KEYTYPE_USHORT_INT:
+ case HA_KEYTYPE_LONG_INT:
+ case HA_KEYTYPE_ULONG_INT:
+ case HA_KEYTYPE_INT24:
+ case HA_KEYTYPE_UINT24:
+#ifdef HAVE_LONG_LONG
+ case HA_KEYTYPE_LONGLONG:
+ case HA_KEYTYPE_ULONGLONG:
+#endif
+ case HA_KEYTYPE_FLOAT:
+ case HA_KEYTYPE_DOUBLE:
+ a= end;
+ break;
+ case HA_KEYTYPE_END: /* purecov: inspected */
+ /* keep compiler happy */
+ DBUG_ASSERT(0);
+ break;
+ }
+ }
+ return keyseg;
+}
+
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c
index ebe5c7ddf80..9bc740c80fd 100644
--- a/mysys/my_fopen.c
+++ b/mysys/my_fopen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,6 +18,10 @@
#include <errno.h>
#include "mysys_err.h"
+#if defined(__FreeBSD__)
+extern int getosreldate(void);
+#endif
+
static void make_ftype(char * to,int flag);
/*
@@ -89,7 +93,135 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags)
} /* my_fopen */
- /* Close a stream */
+#if defined(_WIN32)
+
+static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream)
+{
+ int handle_fd, fd= _fileno(stream);
+ HANDLE osfh;
+
+ DBUG_ASSERT(path && stream);
+
+ /* Services don't have stdout/stderr on Windows, so _fileno returns -1. */
+ if (fd < 0)
+ {
+ if (!freopen(path, mode, stream))
+ return NULL;
+
+ fd= _fileno(stream);
+ }
+
+ if ((osfh= CreateFile(path, GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE |
+ FILE_SHARE_DELETE, NULL,
+ OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL,
+ NULL)) == INVALID_HANDLE_VALUE)
+ return NULL;
+
+ if ((handle_fd= _open_osfhandle((intptr_t)osfh,
+ _O_APPEND | _O_TEXT)) == -1)
+ {
+ CloseHandle(osfh);
+ return NULL;
+ }
+
+ if (_dup2(handle_fd, fd) < 0)
+ {
+ CloseHandle(osfh);
+ return NULL;
+ }
+
+ _close(handle_fd);
+
+ return stream;
+}
+
+#elif defined(__FreeBSD__)
+
+/* No close operation hook. */
+
+static int no_close(void *cookie __attribute__((unused)))
+{
+ return 0;
+}
+
+/*
+ A hack around a race condition in the implementation of freopen.
+
+ The race condition steams from the fact that the current fd of
+ the stream is closed before its number is used to duplicate the
+ new file descriptor. This defeats the desired atomicity of the
+ close and duplicate of dup2().
+
+ See PR number 79887 for reference:
+ http://www.freebsd.org/cgi/query-pr.cgi?pr=79887
+*/
+
+static FILE *my_freebsd_freopen(const char *path, const char *mode, FILE *stream)
+{
+ int old_fd;
+ FILE *result;
+
+ flockfile(stream);
+
+ old_fd= fileno(stream);
+
+ /* Use a no operation close hook to avoid having the fd closed. */
+ stream->_close= no_close;
+
+ /* Relies on the implicit dup2 to close old_fd. */
+ result= freopen(path, mode, stream);
+
+ /* If successful, the _close hook was replaced. */
+
+ if (result == NULL)
+ close(old_fd);
+ else
+ funlockfile(result);
+
+ return result;
+}
+
+#endif
+
+
+/**
+ Change the file associated with a file stream.
+
+ @param path Path to file.
+ @param mode Mode of the stream.
+ @param stream File stream.
+
+ @note
+ This function is used to redirect stdout and stderr to a file and
+ subsequently to close and reopen that file for log rotation.
+
+ @retval A FILE pointer on success. Otherwise, NULL.
+*/
+
+FILE *my_freopen(const char *path, const char *mode, FILE *stream)
+{
+ FILE *result;
+
+#if defined(_WIN32)
+ result= my_win_freopen(path, mode, stream);
+#elif defined(__FreeBSD__)
+ /*
+ XXX: Once the fix is ported to the stable releases, this should
+ be dependent upon the specific FreeBSD versions. Check at:
+ http://www.freebsd.org/cgi/query-pr.cgi?pr=79887
+ */
+ if (getosreldate() > 900027)
+ result= freopen(path, mode, stream);
+ else
+ result= my_freebsd_freopen(path, mode, stream);
+#else
+ result= freopen(path, mode, stream);
+#endif
+
+ return result;
+}
+
/* Close a stream */
int my_fclose(FILE *fd, myf MyFlags)
diff --git a/mysys/my_fstream.c b/mysys/my_fstream.c
index 0c7e4ef7aa3..83cb0d261c0 100644
--- a/mysys/my_fstream.c
+++ b/mysys/my_fstream.c
@@ -124,10 +124,9 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags)
}
#endif
#if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM)
-#ifdef THREAD
if (my_thread_var->abort)
MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */
-#endif
+
if ((errno == ENOSPC || errno == EDQUOT) &&
(MyFlags & MY_WAIT_IF_FULL))
{
diff --git a/mysys/my_gethostbyname.c b/mysys/my_gethostbyname.c
deleted file mode 100644
index 3962de21fc0..00000000000
--- a/mysys/my_gethostbyname.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Copyright (C) 2002, 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; version 2
- of the License.
-
- This library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA */
-
-/* Thread safe version of gethostbyname_r() */
-
-#include "mysys_priv.h"
-#if !defined(__WIN__)
-#include <netdb.h>
-#endif
-#include <my_net.h>
-
-/* This file is not needed if my_gethostbyname_r is a macro */
-#if !defined(my_gethostbyname_r)
-
-/*
- Emulate SOLARIS style calls, not because it's better, but just to make the
- usage of getbostbyname_r simpler.
-*/
-
-#if defined(HAVE_GETHOSTBYNAME_R)
-
-#if defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
-
-struct hostent *my_gethostbyname_r(const char *name,
- struct hostent *result, char *buffer,
- int buflen, int *h_errnop)
-{
- struct hostent *hp;
- DBUG_ASSERT((size_t) buflen >= sizeof(*result));
- if (gethostbyname_r(name,result, buffer, (size_t) buflen, &hp, h_errnop))
- return 0;
- return hp;
-}
-
-#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT)
-
-struct hostent *my_gethostbyname_r(const char *name,
- struct hostent *result, char *buffer,
- int buflen, int *h_errnop)
-{
- if (gethostbyname_r(name,result,(struct hostent_data *) buffer) == -1)
- {
- *h_errnop= errno;
- return 0;
- }
- return result;
-}
-
-#else
-
-/* gethostbyname_r with similar interface as gethostbyname() */
-
-struct hostent *my_gethostbyname_r(const char *name,
- struct hostent *result, char *buffer,
- int buflen, int *h_errnop)
-{
- struct hostent *hp;
- DBUG_ASSERT(buflen >= sizeof(struct hostent_data));
- hp= gethostbyname_r(name,result,(struct hostent_data *) buffer);
- *h_errnop= errno;
- return hp;
-}
-#endif /* GLIBC2_STYLE_GETHOSTBYNAME_R */
-
-#else /* !HAVE_GETHOSTBYNAME_R */
-
-#ifdef THREAD
-extern mysql_mutex_t LOCK_gethostbyname_r;
-#endif
-
-/*
- No gethostbyname_r() function exists.
- In this case we have to keep a mutex over the call to ensure that no
- other thread is going to reuse the internal memory.
-
- The user is responsible to call my_gethostbyname_r_free() when he
- is finished with the structure.
-*/
-
-struct hostent *
-my_gethostbyname_r(const char *name,
- struct hostent *result __attribute__((unused)),
- char *buffer __attribute__((unused)),
- int buflen __attribute__((unused)),
- int *h_errnop)
-{
- struct hostent *hp;
- mysql_mutex_lock(&LOCK_gethostbyname_r);
- hp= gethostbyname(name);
- *h_errnop= h_errno;
- return hp;
-}
-
-void my_gethostbyname_r_free()
-{
- mysql_mutex_unlock(&LOCK_gethostbyname_r);
-}
-
-#endif /* !HAVE_GETHOSTBYNAME_R */
-#endif /* !my_gethostbyname_r */
diff --git a/mysys/my_gethwaddr.c b/mysys/my_gethwaddr.c
index d14087d061e..ab44bac43d3 100644
--- a/mysys/my_gethwaddr.c
+++ b/mysys/my_gethwaddr.c
@@ -21,18 +21,6 @@
#ifndef MAIN
-#if defined(__FreeBSD__) || defined(__linux__)
-static my_bool memcpy_and_test(uchar *to, uchar *from, uint len)
-{
- uint i, res=1;
-
- for (i=0; i < len; i++)
- if ((*to++= *from++))
- res=0;
- return res;
-}
-#endif /* FreeBSD || linux */
-
#ifdef __FreeBSD__
#include <net/ethernet.h>
@@ -44,10 +32,11 @@ static my_bool memcpy_and_test(uchar *to, uchar *from, uint len)
my_bool my_gethwaddr(uchar *to)
{
size_t len;
- uchar *buf, *next, *end, *addr;
+ char *buf, *next, *end;
struct if_msghdr *ifm;
struct sockaddr_dl *sdl;
int res=1, mib[6]={CTL_NET, AF_ROUTE, 0, AF_LINK, NET_RT_IFLIST, 0};
+ char zero_array[ETHER_ADDR_LEN] = {0};
if (sysctl(mib, 6, NULL, &len, NULL, 0) == -1)
goto err;
@@ -63,9 +52,9 @@ my_bool my_gethwaddr(uchar *to)
ifm = (struct if_msghdr *)next;
if (ifm->ifm_type == RTM_IFINFO)
{
- sdl = (struct sockaddr_dl *)(ifm + 1);
- addr=(uchar *)LLADDR(sdl);
- res=memcpy_and_test(to, addr, ETHER_ADDR_LEN);
+ sdl= (struct sockaddr_dl *)(ifm + 1);
+ memcpy(to, LLADDR(sdl), ETHER_ADDR_LEN);
+ res= memcmp(to, zero_array, ETHER_ADDR_LEN) ? 0 : 1;
}
}
@@ -81,8 +70,9 @@ err:
my_bool my_gethwaddr(uchar *to)
{
- int fd, res=1;
+ int fd, res= 1;
struct ifreq ifr;
+ char zero_array[ETHER_ADDR_LEN] = {0};
fd = socket(AF_INET, SOCK_DGRAM, 0);
if (fd < 0)
@@ -91,9 +81,13 @@ my_bool my_gethwaddr(uchar *to)
bzero(&ifr, sizeof(ifr));
strnmov(ifr.ifr_name, "eth0", sizeof(ifr.ifr_name) - 1);
- do {
+ do
+ {
if (ioctl(fd, SIOCGIFHWADDR, &ifr) >= 0)
- res=memcpy_and_test(to, (uchar *)&ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN);
+ {
+ memcpy(to, &ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN);
+ res= memcmp(to, zero_array, ETHER_ADDR_LEN) ? 0 : 1;
+ }
} while (res && (errno == 0 || errno == ENODEV) && ifr.ifr_name[3]++ < '6');
close(fd);
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 74c0d6b5ba3..fff8fda581c 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -176,7 +176,7 @@ int handle_options(int *argc, char ***argv,
*/
for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++)
{
- if (*pos == args_separator)
+ if (my_getopt_is_args_separator(*pos))
{
is_cmdline_arg= 0;
break;
@@ -188,7 +188,7 @@ int handle_options(int *argc, char ***argv,
char **first= pos;
char *cur_arg= *pos;
opt_found= 0;
- if (!is_cmdline_arg && (cur_arg == args_separator))
+ if (!is_cmdline_arg && (my_getopt_is_args_separator(cur_arg)))
{
is_cmdline_arg= 1;
@@ -360,14 +360,6 @@ int handle_options(int *argc, char ***argv,
}
return EXIT_OPTION_DISABLED;
}
- if (must_be_var && optp->arg_type == NO_ARG)
- {
- if (my_getopt_print_errors)
- my_getopt_error_reporter(ERROR_LEVEL,
- "%s: option '%s' cannot take an argument",
- my_progname, optp->name);
- return EXIT_NO_ARGUMENT_ALLOWED;
- }
error= 0;
value= optp->var_type & GET_ASK_ADDR ?
(*getopt_get_addr)(key_name, (uint) strlen(key_name), optp, &error) :
@@ -377,6 +369,11 @@ int handle_options(int *argc, char ***argv,
if (optp->arg_type == NO_ARG)
{
+ /*
+ Due to historical reasons GET_BOOL var_types still accepts arguments
+ despite the NO_ARG arg_type attribute. This can seems a bit unintuitive
+ and care should be taken when refactoring this code.
+ */
if (optend && (optp->var_type & GET_TYPE_MASK) != GET_BOOL)
{
if (my_getopt_print_errors)
@@ -391,7 +388,7 @@ int handle_options(int *argc, char ***argv,
Set bool to 1 if no argument or if the user has used
--enable-'option-name'.
*optend was set to '0' if one used --disable-option
- */
+ */
(*argc)--;
if (!optend || *optend == '1' ||
!my_strcasecmp(&my_charset_latin1, optend, "true"))
@@ -418,10 +415,9 @@ int handle_options(int *argc, char ***argv,
else if (optp->arg_type == REQUIRED_ARG && !optend)
{
/* Check if there are more arguments after this one,
-
- Note: options loaded from config file that requires value
- should always be in the form '--option=value'.
- */
+ Note: options loaded from config file that requires value
+ should always be in the form '--option=value'.
+ */
if (!is_cmdline_arg || !*++pos)
{
if (my_getopt_print_errors)
@@ -607,6 +603,32 @@ static char *check_struct_option(char *cur_arg, char *key_name)
}
}
+/**
+ Parse a boolean command line argument
+
+ "ON", "TRUE" and "1" will return true,
+ other values will return false.
+
+ @param[in] argument The value argument
+ @return boolean value
+*/
+static my_bool get_bool_argument(const struct my_option *opts,
+ const char *argument)
+{
+ if (!my_strcasecmp(&my_charset_latin1, argument, "true") ||
+ !my_strcasecmp(&my_charset_latin1, argument, "on") ||
+ !my_strcasecmp(&my_charset_latin1, argument, "1"))
+ return 1;
+ else if (!my_strcasecmp(&my_charset_latin1, argument, "false") ||
+ !my_strcasecmp(&my_charset_latin1, argument, "off") ||
+ !my_strcasecmp(&my_charset_latin1, argument, "0"))
+ return 0;
+ my_getopt_error_reporter(WARNING_LEVEL,
+ "option '%s': boolean value '%s' wasn't recognized. Set to OFF.",
+ opts->name, argument);
+ return 0;
+}
+
/*
function: setval
@@ -634,7 +656,7 @@ static int setval(const struct my_option *opts, void *value, char *argument,
switch ((opts->var_type & GET_TYPE_MASK)) {
case GET_BOOL: /* If argument differs from 0, enable option, else disable */
- *((my_bool*) value)= (my_bool) atoi(argument) != 0;
+ *((my_bool*) value)= get_bool_argument(opts, argument);
break;
case GET_INT:
*((int*) value)= (int) getopt_ll(argument, opts, &err);
@@ -674,7 +696,7 @@ static int setval(const struct my_option *opts, void *value, char *argument,
break;
case GET_ENUM:
{
- int type= find_type(argument, opts->typelib, 2);
+ int type= find_type(argument, opts->typelib, FIND_TYPE_BASIC);
if (type == 0)
{
/*
diff --git a/mysys/my_handler.c b/mysys/my_handler.c
deleted file mode 100644
index 2cbe65bebba..00000000000
--- a/mysys/my_handler.c
+++ /dev/null
@@ -1,681 +0,0 @@
-/* Copyright (C) 2002-2006 MySQL AB
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; version 2
- of the License.
-
- This library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA */
-
-#include <my_global.h>
-#include <m_ctype.h>
-#include <my_base.h>
-#include <my_handler.h>
-#include <my_sys.h>
-#include "my_handler_errors.h"
-
-int ha_compare_text(CHARSET_INFO *charset_info, const uchar *a, uint a_length,
- const uchar *b, uint b_length, my_bool part_key,
- my_bool skip_end_space)
-{
- if (!part_key)
- return charset_info->coll->strnncollsp(charset_info, a, a_length,
- b, b_length,
- (my_bool)!skip_end_space);
- return charset_info->coll->strnncoll(charset_info, a, a_length,
- b, b_length, part_key);
-}
-
-
-static int compare_bin(const uchar *a, uint a_length,
- const uchar *b, uint b_length,
- my_bool part_key, my_bool skip_end_space)
-{
- uint length= min(a_length,b_length);
- const uchar *end= a+ length;
- int flag;
-
- while (a < end)
- if ((flag= (int) *a++ - (int) *b++))
- return flag;
- if (part_key && b_length < a_length)
- return 0;
- if (skip_end_space && a_length != b_length)
- {
- int swap= 1;
- /*
- We are using space compression. We have to check if longer key
- has next character < ' ', in which case it's less than the shorter
- key that has an implicite space afterwards.
-
- This code is identical to the one in
- strings/ctype-simple.c:my_strnncollsp_simple
- */
- if (a_length < b_length)
- {
- /* put shorter key in a */
- a_length= b_length;
- a= b;
- swap= -1; /* swap sign of result */
- }
- for (end= a + a_length-length; a < end ; a++)
- {
- if (*a != ' ')
- return (*a < ' ') ? -swap : swap;
- }
- return 0;
- }
- return (int) (a_length-b_length);
-}
-
-
-/*
- Compare two keys
-
- SYNOPSIS
- ha_key_cmp()
- keyseg Array of key segments of key to compare
- a First key to compare, in format from _mi_pack_key()
- This is always from the row
- b Second key to compare. This is from the row or the user
- key_length Length of key to compare, based on key b. This can be shorter
- than b to just compare sub keys
- next_flag How keys should be compared
- If bit SEARCH_FIND is not set the keys includes the row
- position and this should also be compared
- If SEARCH_PAGE_KEY_HAS_TRANSID is set then 'a' has transid
- If SEARCH_USER_KEY_HAS_TRANSID is set then 'b' has transid
- diff_pos OUT Number of first keypart where values differ, counting
- from one.
- diff_pos[1] OUT (b + diff_pos[1]) points to first value in tuple b
- that is different from corresponding value in tuple a.
-
- EXAMPLES
- Example1: if the function is called for tuples
- ('aaa','bbb') and ('eee','fff'), then
- diff_pos[0] = 1 (as 'aaa' != 'eee')
- diff_pos[1] = 0 (offset from beggining of tuple b to 'eee' keypart).
-
- Example2: if the index function is called for tuples
- ('aaa','bbb') and ('aaa','fff'),
- diff_pos[0] = 2 (as 'aaa' != 'eee')
- diff_pos[1] = 3 (offset from beggining of tuple b to 'fff' keypart,
- here we assume that first key part is CHAR(3) NOT NULL)
-
- NOTES
- Number-keys can't be splited
-
- RETURN VALUES
- <0 If a < b
- 0 If a == b
- >0 If a > b
-*/
-
-#define FCMP(A,B) ((int) (A) - (int) (B))
-
-int ha_key_cmp(register HA_KEYSEG *keyseg, register const uchar *a,
- register const uchar *b, uint key_length, uint32 nextflag,
- uint *diff_pos)
-{
- int flag;
- int16 s_1,s_2;
- int32 l_1,l_2;
- uint32 u_1,u_2;
- float f_1,f_2;
- double d_1,d_2;
- uint next_key_length;
- const uchar *orig_b= b;
-
- *diff_pos=0;
- for ( ; (int) key_length >0 ; key_length=next_key_length, keyseg++)
- {
- const uchar *end;
- uint piks=! (keyseg->flag & HA_NO_SORT);
- (*diff_pos)++;
- diff_pos[1]= (uint)(b - orig_b);
-
- /* Handle NULL part */
- if (keyseg->null_bit)
- {
- key_length--;
- if (*a != *b && piks)
- {
- flag = (int) *a - (int) *b;
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- }
- b++;
- if (!*a++) /* If key was NULL */
- {
- if ((nextflag & (SEARCH_FIND | SEARCH_UPDATE | SEARCH_INSERT |
- SEARCH_NULL_ARE_EQUAL)) ==
- (SEARCH_FIND | SEARCH_UPDATE | SEARCH_INSERT))
- {
- /* Allow duplicate keys */
- nextflag= (nextflag & ~(SEARCH_FIND | SEARCH_UPDATE)) | SEARCH_SAME;
- }
- else if (nextflag & SEARCH_NULL_ARE_NOT_EQUAL)
- {
- /*
- This is only used from mi_check() to calculate cardinality.
- It can't be used when searching for a key as this would cause
- compare of (a,b) and (b,a) to return the same value.
- */
- return -1;
- }
- next_key_length=key_length;
- continue; /* To next key part */
- }
- }
- end= a+ min(keyseg->length,key_length);
- next_key_length=key_length-keyseg->length;
-
- switch ((enum ha_base_keytype) keyseg->type) {
- case HA_KEYTYPE_TEXT: /* Ascii; Key is converted */
- if (keyseg->flag & HA_SPACE_PACK)
- {
- int a_length,b_length,pack_length;
- get_key_length(a_length,a);
- get_key_pack_length(b_length,pack_length,b);
- next_key_length=key_length-b_length-pack_length;
-
- if (piks &&
- (flag=ha_compare_text(keyseg->charset,a,a_length,b,b_length,
- (my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0),
- (my_bool)!(nextflag & SEARCH_PREFIX))))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a+=a_length;
- b+=b_length;
- break;
- }
- else
- {
- uint length=(uint) (end-a), a_length=length, b_length=length;
- if (piks &&
- (flag= ha_compare_text(keyseg->charset, a, a_length, b, b_length,
- (my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0),
- (my_bool)!(nextflag & SEARCH_PREFIX))))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a=end;
- b+=length;
- }
- break;
- case HA_KEYTYPE_BINARY:
- case HA_KEYTYPE_BIT:
- if (keyseg->flag & HA_SPACE_PACK)
- {
- int a_length,b_length,pack_length;
- get_key_length(a_length,a);
- get_key_pack_length(b_length,pack_length,b);
- next_key_length=key_length-b_length-pack_length;
-
- if (piks &&
- (flag=compare_bin(a,a_length,b,b_length,
- (my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0),1)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a+=a_length;
- b+=b_length;
- break;
- }
- else
- {
- uint length=keyseg->length;
- if (piks &&
- (flag=compare_bin(a,length,b,length,
- (my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0),0)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a+=length;
- b+=length;
- }
- break;
- case HA_KEYTYPE_VARTEXT1:
- case HA_KEYTYPE_VARTEXT2:
- {
- int a_length,b_length,pack_length;
- get_key_length(a_length,a);
- get_key_pack_length(b_length,pack_length,b);
- next_key_length=key_length-b_length-pack_length;
-
- if (piks &&
- (flag= ha_compare_text(keyseg->charset,a,a_length,b,b_length,
- (my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0),
- (my_bool) ((nextflag & (SEARCH_FIND |
- SEARCH_UPDATE)) ==
- SEARCH_FIND &&
- ! (keyseg->flag &
- HA_END_SPACE_ARE_EQUAL)))))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a+= a_length;
- b+= b_length;
- break;
- }
- break;
- case HA_KEYTYPE_VARBINARY1:
- case HA_KEYTYPE_VARBINARY2:
- {
- int a_length,b_length,pack_length;
- get_key_length(a_length,a);
- get_key_pack_length(b_length,pack_length,b);
- next_key_length=key_length-b_length-pack_length;
-
- if (piks &&
- (flag=compare_bin(a,a_length,b,b_length,
- (my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0), 0)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a+=a_length;
- b+=b_length;
- }
- break;
- case HA_KEYTYPE_INT8:
- {
- int i_1= (int) *((signed char*) a);
- int i_2= (int) *((signed char*) b);
- if (piks && (flag = CMP_NUM(i_1,i_2)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a= end;
- b++;
- break;
- }
- case HA_KEYTYPE_SHORT_INT:
- s_1= mi_sint2korr(a);
- s_2= mi_sint2korr(b);
- if (piks && (flag = CMP_NUM(s_1,s_2)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a= end;
- b+= 2; /* sizeof(short int); */
- break;
- case HA_KEYTYPE_USHORT_INT:
- {
- uint16 us_1,us_2;
- us_1= mi_sint2korr(a);
- us_2= mi_sint2korr(b);
- if (piks && (flag = CMP_NUM(us_1,us_2)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a= end;
- b+=2; /* sizeof(short int); */
- break;
- }
- case HA_KEYTYPE_LONG_INT:
- l_1= mi_sint4korr(a);
- l_2= mi_sint4korr(b);
- if (piks && (flag = CMP_NUM(l_1,l_2)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a= end;
- b+= 4; /* sizeof(long int); */
- break;
- case HA_KEYTYPE_ULONG_INT:
- u_1= mi_sint4korr(a);
- u_2= mi_sint4korr(b);
- if (piks && (flag = CMP_NUM(u_1,u_2)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a= end;
- b+= 4; /* sizeof(long int); */
- break;
- case HA_KEYTYPE_INT24:
- l_1=mi_sint3korr(a);
- l_2=mi_sint3korr(b);
- if (piks && (flag = CMP_NUM(l_1,l_2)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a= end;
- b+= 3;
- break;
- case HA_KEYTYPE_UINT24:
- l_1=mi_uint3korr(a);
- l_2=mi_uint3korr(b);
- if (piks && (flag = CMP_NUM(l_1,l_2)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a= end;
- b+= 3;
- break;
- case HA_KEYTYPE_FLOAT:
- mi_float4get(f_1,a);
- mi_float4get(f_2,b);
- /*
- The following may give a compiler warning about floating point
- comparison not being safe, but this is ok in this context as
- we are bascily doing sorting
- */
- if (piks && (flag = CMP_NUM(f_1,f_2)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a= end;
- b+= 4; /* sizeof(float); */
- break;
- case HA_KEYTYPE_DOUBLE:
- mi_float8get(d_1,a);
- mi_float8get(d_2,b);
- /*
- The following may give a compiler warning about floating point
- comparison not being safe, but this is ok in this context as
- we are bascily doing sorting
- */
- if (piks && (flag = CMP_NUM(d_1,d_2)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a= end;
- b+= 8; /* sizeof(double); */
- break;
- case HA_KEYTYPE_NUM: /* Numeric key */
- {
- int swap_flag= 0;
- int alength,blength;
-
- if (keyseg->flag & HA_REVERSE_SORT)
- {
- swap_variables(const uchar*, a, b);
- swap_flag=1; /* Remember swap of a & b */
- end= a+ (int) (end-b);
- }
- if (keyseg->flag & HA_SPACE_PACK)
- {
- alength= *a++; blength= *b++;
- end=a+alength;
- next_key_length=key_length-blength-1;
- }
- else
- {
- alength= (int) (end-a);
- blength=keyseg->length;
- /* remove pre space from keys */
- for ( ; alength && *a == ' ' ; a++, alength--) ;
- for ( ; blength && *b == ' ' ; b++, blength--) ;
- }
- if (piks)
- {
- if (*a == '-')
- {
- if (*b != '-')
- return -1;
- a++; b++;
- swap_variables(const uchar*, a, b);
- swap_variables(int, alength, blength);
- swap_flag=1-swap_flag;
- alength--; blength--;
- end=a+alength;
- }
- else if (*b == '-')
- return 1;
- while (alength && (*a == '+' || *a == '0'))
- {
- a++; alength--;
- }
- while (blength && (*b == '+' || *b == '0'))
- {
- b++; blength--;
- }
- if (alength != blength)
- return (alength < blength) ? -1 : 1;
- while (a < end)
- if (*a++ != *b++)
- return ((int) a[-1] - (int) b[-1]);
- }
- else
- {
- b+=(end-a);
- a=end;
- }
-
- if (swap_flag) /* Restore pointers */
- swap_variables(const uchar*, a, b);
- break;
- }
-#ifdef HAVE_LONG_LONG
- case HA_KEYTYPE_LONGLONG:
- {
- longlong ll_a,ll_b;
- ll_a= mi_sint8korr(a);
- ll_b= mi_sint8korr(b);
- if (piks && (flag = CMP_NUM(ll_a,ll_b)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a= end;
- b+= 8;
- break;
- }
- case HA_KEYTYPE_ULONGLONG:
- {
- ulonglong ll_a,ll_b;
- ll_a= mi_uint8korr(a);
- ll_b= mi_uint8korr(b);
- if (piks && (flag = CMP_NUM(ll_a,ll_b)))
- return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a= end;
- b+= 8;
- break;
- }
-#endif
- case HA_KEYTYPE_END: /* Ready */
- goto end; /* diff_pos is incremented */
- }
- }
- (*diff_pos)++;
-end:
- if (!(nextflag & SEARCH_FIND))
- {
- /*
- Compare rowid and possible transid
- This happens in the following case:
- - INSERT, UPDATE, DELETE when we have not unique keys or
- are using versioning
- - SEARCH_NEXT, SEARCH_PREVIOUS when we need to restart search
-
- The logic for comparing transid are as follows:
- Keys with have a transid have lowest bit in the rowidt. This means that
- if we are comparing a key with a transid with another key that doesn't
- have a tranid, we must reset the lowest bit for both keys.
-
- When we have transid, the keys are compared in transid order.
- A key without a transid is regared to be smaller than a key with
- a transid.
- */
-
- uint i;
- uchar key_mask, tmp_a, tmp_b;
-
- if (nextflag & (SEARCH_NO_FIND | SEARCH_LAST)) /* Find record after key */
- return (nextflag & (SEARCH_BIGGER | SEARCH_LAST)) ? -1 : 1;
- key_mask= (uchar) 255;
-
- if (!(nextflag & (SEARCH_USER_KEY_HAS_TRANSID |
- SEARCH_PAGE_KEY_HAS_TRANSID)))
- {
- /*
- Neither key has a trid. Only compare row id's and don't
- try to store rows in trid order
- */
- key_length= keyseg->length;
- nextflag&= ~SEARCH_INSERT;
- }
- else
- {
- /*
- Set key_mask so that we reset the last bit in the rowid before
- we compare it. This is needed as the lowest bit in the rowid is
- used to mark if the key has a transid or not.
- */
- key_mask= (uchar) 254;
- if (!test_all_bits(nextflag, (SEARCH_USER_KEY_HAS_TRANSID |
- SEARCH_PAGE_KEY_HAS_TRANSID)))
- {
- /*
- No transaction id for user key or for key on page
- Ignore transid as at least one of the keys are visible for all
- */
- key_length= keyseg->length;
- }
- else
- {
- /*
- Both keys have trids. No need of special handling of incomplete
- trids below.
- */
- nextflag&= ~SEARCH_INSERT;
- }
- }
- DBUG_ASSERT(key_length > 0);
-
- for (i= key_length-1 ; (int) i-- > 0 ; )
- {
- if (*a++ != *b++)
- {
- flag= FCMP(a[-1],b[-1]);
- goto found;
- }
- }
- tmp_a= *a & key_mask;
- tmp_b= *b & key_mask;
- flag= FCMP(tmp_a, tmp_b);
-
- if (flag == 0 && (nextflag & SEARCH_INSERT))
- {
- /*
- Ensure that on insert we get rows stored in trid order.
- If one of the parts doesn't have a trid, this should be regarded
- as smaller than the other
- */
- return (nextflag & SEARCH_USER_KEY_HAS_TRANSID) ? -1 : 1;
- }
-found:
- if (nextflag & SEARCH_SAME)
- return (flag); /* read same */
- if (nextflag & SEARCH_BIGGER)
- return (flag <= 0 ? -1 : 1); /* read next */
- return (flag < 0 ? -1 : 1); /* read previous */
- }
- return 0;
-} /* ha_key_cmp */
-
-
-/*
- Find the first NULL value in index-suffix values tuple
-
- SYNOPSIS
- ha_find_null()
- keyseg Array of keyparts for key suffix
- a Key suffix value tuple
-
- DESCRIPTION
- Find the first NULL value in index-suffix values tuple.
-
- TODO
- Consider optimizing this function or its use so we don't search for
- NULL values in completely NOT NULL index suffixes.
-
- RETURN
- First key part that has NULL as value in values tuple, or the last key
- part (with keyseg->type==HA_TYPE_END) if values tuple doesn't contain
- NULLs.
-*/
-
-HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, const uchar *a)
-{
- for (; (enum ha_base_keytype) keyseg->type != HA_KEYTYPE_END; keyseg++)
- {
- const uchar *end;
- if (keyseg->null_bit)
- {
- if (!*a++)
- return keyseg;
- }
- end= a+ keyseg->length;
-
- switch ((enum ha_base_keytype) keyseg->type) {
- case HA_KEYTYPE_TEXT:
- case HA_KEYTYPE_BINARY:
- case HA_KEYTYPE_BIT:
- if (keyseg->flag & HA_SPACE_PACK)
- {
- int a_length;
- get_key_length(a_length, a);
- a += a_length;
- break;
- }
- else
- a= end;
- break;
- case HA_KEYTYPE_VARTEXT1:
- case HA_KEYTYPE_VARTEXT2:
- case HA_KEYTYPE_VARBINARY1:
- case HA_KEYTYPE_VARBINARY2:
- {
- int a_length;
- get_key_length(a_length, a);
- a+= a_length;
- break;
- }
- case HA_KEYTYPE_NUM:
- if (keyseg->flag & HA_SPACE_PACK)
- {
- int alength= *a++;
- end= a+alength;
- }
- a= end;
- break;
- case HA_KEYTYPE_INT8:
- case HA_KEYTYPE_SHORT_INT:
- case HA_KEYTYPE_USHORT_INT:
- case HA_KEYTYPE_LONG_INT:
- case HA_KEYTYPE_ULONG_INT:
- case HA_KEYTYPE_INT24:
- case HA_KEYTYPE_UINT24:
-#ifdef HAVE_LONG_LONG
- case HA_KEYTYPE_LONGLONG:
- case HA_KEYTYPE_ULONGLONG:
-#endif
- case HA_KEYTYPE_FLOAT:
- case HA_KEYTYPE_DOUBLE:
- a= end;
- break;
- case HA_KEYTYPE_END: /* purecov: inspected */
- /* keep compiler happy */
- DBUG_ASSERT(0);
- break;
- }
- }
- return keyseg;
-}
-
-
-/*
- Register handler error messages for usage with my_error()
-
- NOTES
- This is safe to call multiple times as my_error_register()
- will ignore calls to register already registered error numbers.
-*/
-
-static const char **get_handler_error_messages()
-{
- return handler_error_messages;
-}
-
-void my_handler_error_register(void)
-{
- /*
- If you got compilation error here about compile_time_assert array, check
- that every HA_ERR_xxx constant has a corresponding error message in
- handler_error_messages[] list (check mysys/ma_handler_errors.h and
- include/my_base.h).
- */
- compile_time_assert(HA_ERR_FIRST + array_elements(handler_error_messages) ==
- HA_ERR_LAST + 1);
- my_error_register(get_handler_error_messages, HA_ERR_FIRST,
- HA_ERR_FIRST+ array_elements(handler_error_messages)-1);
-}
-
-
-void my_handler_error_unregister(void)
-{
- my_error_unregister(HA_ERR_FIRST,
- HA_ERR_FIRST+ array_elements(handler_error_messages)-1);
-}
diff --git a/mysys/my_handler_errors.h b/mysys/my_handler_errors.h
index e5cb06fba63..97282503967 100644
--- a/mysys/my_handler_errors.h
+++ b/mysys/my_handler_errors.h
@@ -66,7 +66,12 @@ static const char *handler_error_messages[]=
"File too short; Expected more data in file",
"Read page with wrong checksum",
"Too many active concurrent transactions",
+ "Index column length exceeds limit"
"Row is not visible by the current transaction"
};
+extern void my_handler_error_register(void);
+extern void my_handler_error_unregister(void);
+
+
#endif /* MYSYS_MY_HANDLER_ERRORS_INCLUDED */
diff --git a/mysys/my_init.c b/mysys/my_init.c
index ae4aa5bb5b7..8cf1af2f8ee 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011 Oracle and/or its affiliates. All rights reserved.
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
@@ -37,8 +37,6 @@ static my_bool win32_init_tcp_ip();
#define SCALE_USEC 10000
my_bool my_init_done= 0;
-/** True if @c my_basic_init() has been called. */
-my_bool my_basic_init_done= 0;
uint mysys_usage_id= 0; /* Incremented for each my_init() */
ulong my_thread_stack_size= (sizeof(void*) <= 4)? 65536: ((256-16)*1024);
@@ -57,23 +55,22 @@ static ulong atoi_octal(const char *str)
MYSQL_FILE *mysql_stdin= NULL;
static MYSQL_FILE instrumented_stdin;
+
/**
- Perform a limited initialisation of mysys.
- This initialisation is sufficient to:
- - allocate memory,
- - read configuration files,
- - parse command lines arguments.
- To complete the mysys initialisation,
- call my_init().
- @return 0 on success
+ Initialize my_sys functions, resources and variables
+
+ @return Initialization result
+ @retval 0 Success
+ @retval 1 Error. Couldn't initialize environment
*/
-my_bool my_basic_init(void)
+my_bool my_init(void)
{
- char * str;
+ char *str;
- if (my_basic_init_done)
+ if (my_init_done)
return 0;
- my_basic_init_done= 1;
+
+ my_init_done= 1;
mysys_usage_id++;
my_umask= 0660; /* Default umask for new files */
@@ -96,52 +93,20 @@ my_bool my_basic_init(void)
if (my_progname)
my_progname_short= my_progname + dirname_length(my_progname);
-#if defined(THREAD)
/* Initalize our mutex handling */
my_mutex_init();
if (my_thread_global_init())
return 1;
+
#if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */
#endif
- if (my_thread_basic_global_init())
- return 1;
-#endif
/* $HOME is needed early to parse configuration files located in ~/ */
if ((home_dir= getenv("HOME")) != 0)
home_dir= intern_filename(home_dir_buff, home_dir);
- return 0;
-}
-
-
-/*
- Init my_sys functions and my_sys variabels
-
- SYNOPSIS
- my_init()
-
- RETURN
- 0 ok
- 1 Couldn't initialize environment
-*/
-
-my_bool my_init(void)
-{
- if (my_init_done)
- return 0;
-
- my_init_done= 1;
-
- if (my_basic_init())
- return 1;
-
-#ifdef THREAD
- if (my_thread_global_init())
- return 1;
-#endif /* THREAD */
{
DBUG_ENTER("my_init");
DBUG_PROCESS((char*) (my_progname ? my_progname : "unknown"));
@@ -240,7 +205,7 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
{
DBUG_END(); /* Must be done before my_thread_end */
}
-#ifdef THREAD
+
my_thread_end();
my_thread_global_end();
my_mutex_end();
@@ -252,7 +217,6 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
safe_mutex_end((infoflag & (MY_GIVE_INFO | MY_CHECK_ERROR)) ? stderr :
(FILE *) 0);
#endif /* defined(SAFE_MUTEX) */
-#endif /* THREAD */
#ifdef __WIN__
if (have_tcpip)
@@ -260,7 +224,6 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
#endif /* __WIN__ */
my_init_done=0;
- my_basic_init_done= 0;
} /* my_end */
#ifndef DBUG_OFF
@@ -319,6 +282,89 @@ int handle_rtc_failure(int err_type, const char *file, int line,
#pragma runtime_checks("", restore)
#endif
+#define OFFSET_TO_EPOC ((__int64) 134774 * 24 * 60 * 60 * 1000 * 1000 * 10)
+#define MS 10000000
+
+static void win_init_time(void)
+{
+ /* The following is used by time functions */
+ FILETIME ft;
+ LARGE_INTEGER li, t_cnt;
+
+ DBUG_ASSERT(sizeof(LARGE_INTEGER) == sizeof(query_performance_frequency));
+
+ if (QueryPerformanceFrequency((LARGE_INTEGER *)&query_performance_frequency) == 0)
+ 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);
+ }
+}
+
+
+/*
+ Open HKEY_LOCAL_MACHINE\SOFTWARE\MySQL and set any strings found
+ there as environment variables
+*/
+static void win_init_registry(void)
+{
+ HKEY key_handle;
+
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, (LPCTSTR)"SOFTWARE\\MySQL",
+ 0, KEY_READ, &key_handle) == ERROR_SUCCESS)
+ {
+ LONG ret;
+ DWORD index= 0;
+ DWORD type;
+ char key_name[256], key_data[1024];
+ DWORD key_name_len= sizeof(key_name) - 1;
+ DWORD key_data_len= sizeof(key_data) - 1;
+
+ while ((ret= RegEnumValue(key_handle, index++,
+ key_name, &key_name_len,
+ NULL, &type, (LPBYTE)&key_data,
+ &key_data_len)) != ERROR_NO_MORE_ITEMS)
+ {
+ char env_string[sizeof(key_name) + sizeof(key_data) + 2];
+
+ if (ret == ERROR_MORE_DATA)
+ {
+ /* Registry value larger than 'key_data', skip it */
+ DBUG_PRINT("error", ("Skipped registry value that was too large"));
+ }
+ else if (ret == ERROR_SUCCESS)
+ {
+ if (type == REG_SZ)
+ {
+ strxmov(env_string, key_name, "=", key_data, NullS);
+
+ /* variable for putenv must be allocated ! */
+ putenv(strdup(env_string)) ;
+ }
+ }
+ else
+ {
+ /* Unhandled error, break out of loop */
+ break;
+ }
+
+ key_name_len= sizeof(key_name) - 1;
+ key_data_len= sizeof(key_data) - 1;
+ }
+
+ RegCloseKey(key_handle);
+ }
+}
+
static void my_win_init(void)
{
@@ -326,17 +372,18 @@ static void my_win_init(void)
#if defined(_MSC_VER)
#if _MSC_VER < 1300
- /*
+ /*
Clear the OS system variable TZ and avoid the 100% CPU usage
Only for old versions of Visual C++
*/
- _putenv( "TZ=" );
-#endif
+ _putenv("TZ=");
+#endif
#if _MSC_VER >= 1400
/* this is required to make crt functions return -1 appropriately */
_set_invalid_parameter_handler(my_parameter_handler);
#endif
-#endif
+#endif
+
#ifdef __MSVC_RUNTIME_CHECKS
/*
Install handler to send RTC (Runtime Error Check) warnings
@@ -347,106 +394,10 @@ static void my_win_init(void)
_tzset();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /* 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) == 0)
- 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);
- }
- }
-
- {
- /*
- Open HKEY_LOCAL_MACHINE\SOFTWARE\MySQL and set any strings found
- there as environment variables
- */
- HKEY key_handle;
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, (LPCTSTR)"SOFTWARE\\MySQL",
- 0, KEY_READ, &key_handle) == ERROR_SUCCESS)
- {
- LONG ret;
- DWORD index= 0;
- DWORD type;
- char key_name[256], key_data[1024];
- DWORD key_name_len= sizeof(key_name) - 1;
- DWORD key_data_len= sizeof(key_data) - 1;
-
- while ((ret= RegEnumValue(key_handle, index++,
- key_name, &key_name_len,
- NULL, &type, (LPBYTE)&key_data,
- &key_data_len)) != ERROR_NO_MORE_ITEMS)
- {
- char env_string[sizeof(key_name) + sizeof(key_data) + 2];
+ win_init_time();
+ win_init_registry();
- if (ret == ERROR_MORE_DATA)
- {
- /* Registry value larger than 'key_data', skip it */
- DBUG_PRINT("error", ("Skipped registry value that was too large"));
- }
- else if (ret == ERROR_SUCCESS)
- {
- if (type == REG_SZ)
- {
- strxmov(env_string, key_name, "=", key_data, NullS);
-
- /* variable for putenv must be allocated ! */
- putenv(strdup(env_string)) ;
- }
- }
- else
- {
- /* Unhandled error, break out of loop */
- break;
- }
-
- key_name_len= sizeof(key_name) - 1;
- key_data_len= sizeof(key_data) - 1;
- }
-
- RegCloseKey(key_handle) ;
- }
- }
- DBUG_VOID_RETURN ;
+ DBUG_VOID_RETURN;
}
@@ -524,29 +475,22 @@ PSI_mutex_key key_my_file_info_mutex;
PSI_mutex_key key_LOCK_localtime_r;
#endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */
-#ifndef HAVE_GETHOSTBYNAME_R
-PSI_mutex_key key_LOCK_gethostbyname_r;
-#endif /* HAVE_GETHOSTBYNAME_R */
-
PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock,
key_IO_CACHE_SHARE_mutex, key_KEY_CACHE_cache_lock, key_LOCK_alarm,
key_my_thread_var_mutex, key_THR_LOCK_charset, key_THR_LOCK_heap,
key_THR_LOCK_isam, key_THR_LOCK_lock, key_THR_LOCK_malloc,
key_THR_LOCK_mutex, key_THR_LOCK_myisam, key_THR_LOCK_net,
- key_THR_LOCK_open, key_THR_LOCK_threads, key_THR_LOCK_time,
+ key_THR_LOCK_open, key_THR_LOCK_threads,
key_TMPDIR_mutex, key_THR_LOCK_myisam_mmap;
static PSI_mutex_info all_mysys_mutexes[]=
{
-#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
+#if !defined(HAVE_PREAD) && !defined(_WIN32)
{ &key_my_file_info_mutex, "st_my_file_info:mutex", 0},
#endif /* !defined(HAVE_PREAD) && !defined(_WIN32) */
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
{ &key_LOCK_localtime_r, "LOCK_localtime_r", PSI_FLAG_GLOBAL},
#endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */
-#ifndef HAVE_GETHOSTBYNAME_R
- { &key_LOCK_gethostbyname_r, "LOCK_gethostbyname_r", PSI_FLAG_GLOBAL},
-#endif /* HAVE_GETHOSTBYNAME_R */
{ &key_BITMAP_mutex, "BITMAP::mutex", 0},
{ &key_IO_CACHE_append_buffer_lock, "IO_CACHE::append_buffer_lock", 0},
{ &key_IO_CACHE_SHARE_mutex, "IO_CACHE::SHARE_mutex", 0},
@@ -563,7 +507,6 @@ static PSI_mutex_info all_mysys_mutexes[]=
{ &key_THR_LOCK_net, "THR_LOCK_net", PSI_FLAG_GLOBAL},
{ &key_THR_LOCK_open, "THR_LOCK_open", PSI_FLAG_GLOBAL},
{ &key_THR_LOCK_threads, "THR_LOCK_threads", PSI_FLAG_GLOBAL},
- { &key_THR_LOCK_time, "THR_LOCK_time", PSI_FLAG_GLOBAL},
{ &key_TMPDIR_mutex, "TMPDIR_mutex", PSI_FLAG_GLOBAL},
{ &key_THR_LOCK_myisam_mmap, "THR_LOCK_myisam_mmap", PSI_FLAG_GLOBAL}
};
diff --git a/mysys/my_lib.c b/mysys/my_lib.c
index 890ff0b5dd1..06f9521a664 100644
--- a/mysys/my_lib.c
+++ b/mysys/my_lib.c
@@ -41,7 +41,7 @@
# endif
#endif
-#if defined(THREAD) && defined(HAVE_READDIR_R)
+#if defined(HAVE_READDIR_R)
#define READDIR(A,B,C) ((errno=readdir_r(A,B,&C)) != 0 || !C)
#else
#define READDIR(A,B,C) (!(C=readdir(A)))
@@ -97,13 +97,12 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
DIR *dirp;
struct dirent *dp;
char tmp_path[FN_REFLEN+1],*tmp_file;
-#ifdef THREAD
char dirent_tmp[sizeof(struct dirent)+_POSIX_PATH_MAX+1];
-#endif
+
DBUG_ENTER("my_dir");
DBUG_PRINT("my",("path: '%s' MyFlags: %d",path,MyFlags));
-#if defined(THREAD) && !defined(HAVE_READDIR_R)
+#if !defined(HAVE_READDIR_R)
mysql_mutex_lock(&THR_LOCK_open);
#endif
@@ -135,11 +134,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
tmp_file=strend(tmp_path);
-#ifdef THREAD
dp= (struct dirent*) dirent_tmp;
-#else
- dp=0;
-#endif
while (!(READDIR(dirp,(struct dirent*) dirent_tmp,dp)))
{
@@ -166,7 +161,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
}
(void) closedir(dirp);
-#if defined(THREAD) && !defined(HAVE_READDIR_R)
+#if !defined(HAVE_READDIR_R)
mysql_mutex_unlock(&THR_LOCK_open);
#endif
result->dir_entry= (FILEINFO *)dir_entries_storage->buffer;
@@ -178,7 +173,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
DBUG_RETURN(result);
error:
-#if defined(THREAD) && !defined(HAVE_READDIR_R)
+#if !defined(HAVE_READDIR_R)
mysql_mutex_unlock(&THR_LOCK_open);
#endif
my_errno=errno;
diff --git a/mysys/my_open.c b/mysys/my_open.c
index 8f34ce1c6dc..2aef97b3e34 100644
--- a/mysys/my_open.c
+++ b/mysys/my_open.c
@@ -89,7 +89,7 @@ int my_close(File fd, myf MyFlags)
if ((uint) fd < my_file_limit && my_file_info[fd].type != UNOPEN)
{
my_free(my_file_info[fd].name);
-#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
+#if !defined(HAVE_PREAD) && !defined(_WIN32)
mysql_mutex_destroy(&my_file_info[fd].mutex);
#endif
my_file_info[fd].type = UNOPEN;
@@ -125,7 +125,7 @@ File my_register_filename(File fd, const char *FileName, enum file_type
{
if ((uint) fd >= my_file_limit)
{
-#if defined(THREAD) && !defined(HAVE_PREAD)
+#if !defined(HAVE_PREAD)
my_errno= EMFILE;
#else
thread_safe_increment(my_file_opened,&THR_LOCK_open);
@@ -140,7 +140,7 @@ File my_register_filename(File fd, const char *FileName, enum file_type
my_file_opened++;
my_file_total_opened++;
my_file_info[fd].type = type_of_file;
-#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
+#if !defined(HAVE_PREAD) && !defined(_WIN32)
mysql_mutex_init(key_my_file_info_mutex, &my_file_info[fd].mutex,
MY_MUTEX_INIT_FAST);
#endif
diff --git a/mysys/my_port.c b/mysys/my_port.c
deleted file mode 100644
index 9ad333421ca..00000000000
--- a/mysys/my_port.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 2002 MySQL AB
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; version 2
- of the License.
-
- This library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA */
-
-/*
- Small functions to make code portable
-*/
-
-#include "mysys_priv.h"
-
-#ifdef _AIX
-
-/*
- On AIX, at least with gcc 3.1, the expression
- '(double) (ulonglong) var' doesn't always work for big unsigned
- integers like '18446744073709551615'. The end result is that the
- high bit is simply dropped. (probably bug in gcc optimizations)
- Handling the conversion in a sub function seems to work.
-*/
-
-
-
-double my_ulonglong2double(unsigned long long nr)
-{
- return (double) nr;
-}
-#endif /* _AIX */
diff --git a/mysys/my_pread.c b/mysys/my_pread.c
index d0a0ddaec66..e006360c11b 100644
--- a/mysys/my_pread.c
+++ b/mysys/my_pread.c
@@ -85,14 +85,14 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset,
DBUG_PRINT("warning",("Read only %d bytes off %u from %d, errno: %d",
(int) readbytes, (uint) Count,Filedes,my_errno));
-#ifdef THREAD
+
if ((readbytes == 0 || readbytes == (size_t) -1) && errno == EINTR)
{
DBUG_PRINT("debug", ("my_pread() was interrupted and returned %d",
(int) readbytes));
continue; /* Interrupted */
}
-#endif
+
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
{
if (readbytes == (size_t) -1)
@@ -173,10 +173,10 @@ size_t my_pwrite(File Filedes, const uchar *Buffer, size_t Count,
}
DBUG_PRINT("error",("Write only %u bytes", (uint) writtenbytes));
#ifndef NO_BACKGROUND
-#ifdef THREAD
+
if (my_thread_var->abort)
MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */
-#endif
+
if ((my_errno == ENOSPC || my_errno == EDQUOT) &&
(MyFlags & MY_WAIT_IF_FULL))
{
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index a13cd9b3545..f0b3b1e8aef 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -18,7 +18,6 @@
#define DONT_REMAP_PTHREAD_FUNCTIONS
#include "mysys_priv.h"
-#ifdef THREAD
#include <signal.h>
#include <m_string.h>
#include <thr_alarm.h>
@@ -470,4 +469,3 @@ int pthread_dummy(int ret)
{
return ret;
}
-#endif /* THREAD */
diff --git a/mysys/my_rdtsc.c b/mysys/my_rdtsc.c
index c8ef38efbdc..2afe3ec31dd 100644
--- a/mysys/my_rdtsc.c
+++ b/mysys/my_rdtsc.c
@@ -868,14 +868,8 @@ void my_timer_init(MY_TIMER_INFO *mti)
clock() -- We don't use because it would overflow frequently.
- clock_gettime() -- Often we don't use this even when it exists.
- In configure.in, we use AC_CHECK_FUNCS(clock_gettime). Not
- AC_CHECK_LIB(rc,clock_gettime)
- AC_CHECK_FUNCS(clock_gettime)
- If we had the above lines in configure.in, we'd have to use
- /usr/lib/librt.so or /usr/lib64/librt.so when linking, and
- the size of librt.so is 40KB. In tests, clock_gettime often
- had resolution = 1000.
+ clock_gettime() -- In tests, clock_gettime often had
+ resolution = 1000.
ftime() -- A "man ftime" says: "This function is obsolete.
Don't use it." On every platform that we tested, if ftime()
diff --git a/mysys/my_read.c b/mysys/my_read.c
index 75f9dd64f1d..dbe9006a1d3 100644
--- a/mysys/my_read.c
+++ b/mysys/my_read.c
@@ -59,14 +59,14 @@ size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags)
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 %ld",
(long) readbytes));
continue; /* Interrupted */
}
-#endif
+
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
{
if (readbytes == (size_t) -1)
diff --git a/mysys/my_seek.c b/mysys/my_seek.c
index 63337c636a4..ca12a2e95d1 100644
--- a/mysys/my_seek.c
+++ b/mysys/my_seek.c
@@ -65,7 +65,7 @@ my_off_t my_seek(File fd, my_off_t pos, int whence, myf MyFlags)
my_errno= errno;
if (MyFlags & MY_WME)
my_error(EE_CANT_SEEK, MYF(0), my_filename(fd), my_errno);
- DBUG_PRINT("error",("lseek: %llu errno: %d", (ulonglong) newpos,errno));
+ DBUG_PRINT("error", ("lseek: %llu errno: %d", (ulonglong) newpos, errno));
DBUG_RETURN(MY_FILEPOS_ERROR);
}
if ((my_off_t) newpos != pos)
@@ -95,6 +95,7 @@ my_off_t my_tell(File fd, myf MyFlags)
my_errno= errno;
if (MyFlags & MY_WME)
my_error(EE_CANT_SEEK, MYF(0), my_filename(fd), my_errno);
+ DBUG_PRINT("error", ("tell: %llu errno: %d", (ulonglong) pos, my_errno));
}
DBUG_PRINT("exit",("pos: %llu", (ulonglong) pos));
DBUG_RETURN((my_off_t) pos);
diff --git a/mysys/my_static.c b/mysys/my_static.c
index c6bf3c0ef0f..ac0ad2467f7 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -32,9 +32,7 @@ char curr_dir[FN_REFLEN]= {0},
ulong my_stream_opened=0,my_file_opened=0, my_tmp_file_created=0;
ulong my_file_total_opened= 0;
int my_umask=0664, my_umask_dir=0777;
-#ifndef THREAD
-int my_errno=0;
-#endif
+
struct st_my_file_info my_file_info_default[MY_NFILE];
uint my_file_limit= MY_NFILE;
struct st_my_file_info *my_file_info= my_file_info_default;
diff --git a/mysys/my_symlink.c b/mysys/my_symlink.c
index 33f45a882e1..9657ea6bf58 100644
--- a/mysys/my_symlink.c
+++ b/mysys/my_symlink.c
@@ -113,7 +113,6 @@ int my_is_symlink(const char *filename __attribute__((unused)))
#endif
}
-
/*
Resolve all symbolic links in path
'to' may be equal to 'filename'
@@ -122,8 +121,7 @@ int my_is_symlink(const char *filename __attribute__((unused)))
(including the end \0)
*/
-int my_realpath(char *to, const char *filename,
- myf MyFlags __attribute__((unused)))
+int my_realpath(char *to, const char *filename, myf MyFlags)
{
#if defined(HAVE_REALPATH) && !defined(HAVE_BROKEN_REALPATH)
int result=0;
@@ -150,7 +148,23 @@ int my_realpath(char *to, const char *filename,
}
DBUG_RETURN(result);
#else
+#ifdef _WIN32
+ int ret= GetFullPathName(filename,FN_REFLEN,
+ to,
+ NULL);
+ if (ret == 0 || ret > FN_REFLEN)
+ {
+ if (ret > FN_REFLEN)
+ my_errno= ENAMETOOLONG;
+ else
+ my_errno= EACCES;
+ if (MyFlags & MY_WME)
+ my_error(EE_REALPATH, MYF(0), filename, my_errno);
+ return -1;
+ }
+#else
my_load_path(to, filename, NullS);
+#endif
return 0;
#endif
}
diff --git a/mysys/my_sync.c b/mysys/my_sync.c
index 7dfd365326c..f39b10253dd 100644
--- a/mysys/my_sync.c
+++ b/mysys/my_sync.c
@@ -17,8 +17,19 @@
#include "mysys_err.h"
#include <errno.h>
+
ulong my_sync_count; /* Count number of sync calls */
+static void (*before_sync_wait)(void)= 0;
+static void (*after_sync_wait)(void)= 0;
+
+void thr_set_sync_wait_callback(void (*before_wait)(void),
+ void (*after_wait)(void))
+{
+ before_sync_wait= before_wait;
+ after_sync_wait= after_wait;
+}
+
/*
Sync data in file to disk
@@ -46,12 +57,19 @@ int my_sync(File fd, myf my_flags)
{
int res;
DBUG_ENTER("my_sync");
+
DBUG_PRINT("my",("fd: %d my_flags: %d", fd, my_flags));
if (my_disable_sync)
DBUG_RETURN(0);
statistic_increment(my_sync_count,&THR_LOCK_open);
+
+ DBUG_PRINT("my",("Fd: %d my_flags: %d", fd, my_flags));
+
+ if (before_sync_wait)
+ (*before_sync_wait)();
+
do
{
#if defined(F_FULLFSYNC)
@@ -64,7 +82,7 @@ int my_sync(File fd, myf my_flags)
/* Some file systems don't support F_FULLFSYNC and fail above: */
DBUG_PRINT("info",("fcntl(F_FULLFSYNC) failed, falling back"));
#endif
-#if defined(HAVE_FDATASYNC)
+#if defined(HAVE_FDATASYNC) && HAVE_DECL_FDATASYNC
res= fdatasync(fd);
#elif defined(HAVE_FSYNC)
res= fsync(fd);
@@ -83,6 +101,8 @@ int my_sync(File fd, myf my_flags)
int er= errno;
if (!(my_errno= er))
my_errno= -1; /* Unknown error */
+ if (after_sync_wait)
+ (*after_sync_wait)();
if ((my_flags & MY_IGNORE_BADFD) &&
(er == EBADF || er == EINVAL || er == EROFS))
{
@@ -92,11 +112,18 @@ int my_sync(File fd, myf my_flags)
else if (my_flags & MY_WME)
my_error(EE_SYNC, MYF(ME_BELL+ME_WAITTANG), my_filename(fd), my_errno);
}
+ else
+ {
+ if (after_sync_wait)
+ (*after_sync_wait)();
+ }
DBUG_RETURN(res);
} /* my_sync */
static const char cur_dir_name[]= {FN_CURLIB, 0};
+
+
/*
Force directory information to disk.
@@ -108,7 +135,9 @@ static const char cur_dir_name[]= {FN_CURLIB, 0};
RETURN
0 if ok, !=0 if error
*/
+
#ifdef NEED_EXPLICIT_SYNC_DIR
+
int my_sync_dir(const char *dir_name, myf my_flags)
{
File dir_fd;
@@ -133,12 +162,15 @@ int my_sync_dir(const char *dir_name, myf my_flags)
res= 1;
DBUG_RETURN(res);
}
+
#else /* NEED_EXPLICIT_SYNC_DIR */
+
int my_sync_dir(const char *dir_name __attribute__((unused)),
- myf my_flags __attribute__((unused)))
+ myf my_flags __attribute__((unused)))
{
return 0;
}
+
#endif /* NEED_EXPLICIT_SYNC_DIR */
@@ -153,7 +185,9 @@ int my_sync_dir(const char *dir_name __attribute__((unused)),
RETURN
0 if ok, !=0 if error
*/
+
#ifdef NEED_EXPLICIT_SYNC_DIR
+
int my_sync_dir_by_file(const char *file_name, myf my_flags)
{
char dir_name[FN_REFLEN];
@@ -161,10 +195,14 @@ int my_sync_dir_by_file(const char *file_name, myf my_flags)
dirname_part(dir_name, file_name, &dir_name_length);
return my_sync_dir(dir_name, my_flags);
}
+
#else /* NEED_EXPLICIT_SYNC_DIR */
+
int my_sync_dir_by_file(const char *file_name __attribute__((unused)),
- myf my_flags __attribute__((unused)))
+ myf my_flags __attribute__((unused)))
{
return 0;
}
+
#endif /* NEED_EXPLICIT_SYNC_DIR */
+
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index a2d89c79b4e..146a223a9e3 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011 Oracle and/or its affiliates. All rights reserved.
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
@@ -22,11 +22,10 @@
#include <m_string.h>
#include <signal.h>
-#ifdef THREAD
pthread_key(struct st_my_thread_var*, THR_KEY_mysys);
mysql_mutex_t THR_LOCK_malloc, THR_LOCK_open,
THR_LOCK_lock, THR_LOCK_isam, THR_LOCK_myisam, THR_LOCK_heap,
- THR_LOCK_net, THR_LOCK_charset, THR_LOCK_threads, THR_LOCK_time,
+ THR_LOCK_net, THR_LOCK_charset, THR_LOCK_threads,
THR_LOCK_myisam_mmap;
mysql_cond_t THR_COND_threads;
@@ -35,9 +34,6 @@ uint my_thread_end_wait_time= 5;
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
mysql_mutex_t LOCK_localtime_r;
#endif
-#ifndef HAVE_GETHOSTBYNAME_R
-mysql_mutex_t LOCK_gethostbyname_r;
-#endif
#ifdef _MSC_VER
static void install_sigabrt_handler();
#endif
@@ -61,62 +57,40 @@ nptl_pthread_exit_hack_handler(void *arg __attribute((unused)))
static uint get_thread_lib(void);
-/** True if @c my_thread_basic_global_init() has been called. */
-static my_bool my_thread_basic_global_init_done= 0;
-
-/**
- Perform a minimal initialisation of mysys, when compiled with threads.
- The initialisation performed is sufficient to:
- - allocate memory
- - perform file operations
- - use charsets
- - use my_errno
- @sa my_basic_init
- @sa my_thread_basic_global_reinit
-*/
-my_bool my_thread_basic_global_init(void)
-{
- int pth_ret;
-
- if (my_thread_basic_global_init_done)
- return 0;
- my_thread_basic_global_init_done= 1;
-
- mysql_mutex_init(key_THR_LOCK_malloc, &THR_LOCK_malloc, MY_MUTEX_INIT_FAST);
- mysql_mutex_init(key_THR_LOCK_open, &THR_LOCK_open, MY_MUTEX_INIT_FAST);
- mysql_mutex_init(key_THR_LOCK_charset, &THR_LOCK_charset, MY_MUTEX_INIT_FAST);
- mysql_mutex_init(key_THR_LOCK_threads, &THR_LOCK_threads, MY_MUTEX_INIT_FAST);
-
- if ((pth_ret= pthread_key_create(&THR_KEY_mysys, NULL)) != 0)
- {
- fprintf(stderr, "Can't initialize threads: error %d\n", pth_ret);
- return 1;
- }
-
- if (my_thread_init())
- return 1;
+/** True if @c my_thread_global_init() has been called. */
+static my_bool my_thread_global_init_done= 0;
- return 0;
-}
/**
- Re-initialize components initialized early with @c my_thread_basic_global_init.
+ Re-initialize components initialized early with @c my_thread_global_init.
Some mutexes were initialized before the instrumentation.
Destroy + create them again, now that the instrumentation
is in place.
This is safe, since this function() is called before creating new threads,
so the mutexes are not in use.
*/
-void my_thread_basic_global_reinit(void)
+void my_thread_global_reinit(void)
{
struct st_my_thread_var *tmp;
- DBUG_ASSERT(my_thread_basic_global_init_done);
+ DBUG_ASSERT(my_thread_global_init_done);
#ifdef HAVE_PSI_INTERFACE
my_init_mysys_psi_keys();
#endif
+ mysql_mutex_destroy(&THR_LOCK_isam);
+ mysql_mutex_init(key_THR_LOCK_isam, &THR_LOCK_isam, MY_MUTEX_INIT_SLOW);
+
+ mysql_mutex_destroy(&THR_LOCK_heap);
+ mysql_mutex_init(key_THR_LOCK_heap, &THR_LOCK_heap, MY_MUTEX_INIT_FAST);
+
+ mysql_mutex_destroy(&THR_LOCK_net);
+ mysql_mutex_init(key_THR_LOCK_net, &THR_LOCK_net, MY_MUTEX_INIT_FAST);
+
+ mysql_mutex_destroy(&THR_LOCK_myisam);
+ mysql_mutex_init(key_THR_LOCK_myisam, &THR_LOCK_myisam, MY_MUTEX_INIT_SLOW);
+
mysql_mutex_destroy(&THR_LOCK_malloc);
mysql_mutex_init(key_THR_LOCK_malloc, &THR_LOCK_malloc, MY_MUTEX_INIT_FAST);
@@ -129,6 +103,9 @@ void my_thread_basic_global_reinit(void)
mysql_mutex_destroy(&THR_LOCK_threads);
mysql_mutex_init(key_THR_LOCK_threads, &THR_LOCK_threads, MY_MUTEX_INIT_FAST);
+ mysql_cond_destroy(&THR_COND_threads);
+ mysql_cond_init(key_THR_COND_threads, &THR_COND_threads, NULL);
+
tmp= my_pthread_getspecific(struct st_my_thread_var*, THR_KEY_mysys);
DBUG_ASSERT(tmp);
@@ -152,7 +129,24 @@ void my_thread_basic_global_reinit(void)
my_bool my_thread_global_init(void)
{
- if (my_thread_basic_global_init())
+ int pth_ret;
+
+ if (my_thread_global_init_done)
+ return 0;
+ my_thread_global_init_done= 1;
+
+ if ((pth_ret= pthread_key_create(&THR_KEY_mysys, NULL)) != 0)
+ {
+ fprintf(stderr, "Can't initialize threads: error %d\n", pth_ret);
+ return 1;
+ }
+
+ mysql_mutex_init(key_THR_LOCK_malloc, &THR_LOCK_malloc, MY_MUTEX_INIT_FAST);
+ mysql_mutex_init(key_THR_LOCK_open, &THR_LOCK_open, MY_MUTEX_INIT_FAST);
+ mysql_mutex_init(key_THR_LOCK_charset, &THR_LOCK_charset, MY_MUTEX_INIT_FAST);
+ mysql_mutex_init(key_THR_LOCK_threads, &THR_LOCK_threads, MY_MUTEX_INIT_FAST);
+
+ if (my_thread_init())
return 1;
thd_lib_detected= get_thread_lib();
@@ -190,26 +184,16 @@ my_bool my_thread_global_init(void)
mysql_mutex_init(key_THR_LOCK_myisam_mmap, &THR_LOCK_myisam_mmap, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_THR_LOCK_heap, &THR_LOCK_heap, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_THR_LOCK_net, &THR_LOCK_net, MY_MUTEX_INIT_FAST);
- mysql_mutex_init(key_THR_LOCK_time, &THR_LOCK_time, MY_MUTEX_INIT_FAST);
mysql_cond_init(key_THR_COND_threads, &THR_COND_threads, NULL);
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
mysql_mutex_init(key_LOCK_localtime_r, &LOCK_localtime_r, MY_MUTEX_INIT_SLOW);
#endif
-#ifndef HAVE_GETHOSTBYNAME_R
- mysql_mutex_init(key_LOCK_gethostbyname_r,
- &LOCK_gethostbyname_r, MY_MUTEX_INIT_SLOW);
-#endif
#ifdef _MSC_VER
install_sigabrt_handler();
#endif
- if (my_thread_init())
- {
- my_thread_global_end(); /* Clean up */
- return 1;
- }
return 0;
}
@@ -253,7 +237,6 @@ void my_thread_global_end(void)
mysql_mutex_destroy(&THR_LOCK_myisam_mmap);
mysql_mutex_destroy(&THR_LOCK_heap);
mysql_mutex_destroy(&THR_LOCK_net);
- mysql_mutex_destroy(&THR_LOCK_time);
mysql_mutex_destroy(&THR_LOCK_charset);
if (all_threads_killed)
{
@@ -263,11 +246,8 @@ void my_thread_global_end(void)
#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R)
mysql_mutex_destroy(&LOCK_localtime_r);
#endif
-#ifndef HAVE_GETHOSTBYNAME_R
- mysql_mutex_destroy(&LOCK_gethostbyname_r);
-#endif
- my_thread_basic_global_init_done= 0;
+ my_thread_global_init_done= 0;
}
static my_thread_id thread_id= 0;
@@ -498,4 +478,3 @@ static void install_sigabrt_handler(void)
}
#endif
-#endif /* THREAD */
diff --git a/mysys/my_wincond.c b/mysys/my_wincond.c
index ad1636011db..58c09e332d6 100644
--- a/mysys/my_wincond.c
+++ b/mysys/my_wincond.c
@@ -24,7 +24,108 @@
#include <process.h>
#include <sys/timeb.h>
-int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
+
+/*
+ Windows native condition variables. We use runtime loading / function
+ pointers, because they are not available on XP
+*/
+
+/* Prototypes and function pointers for condition variable functions */
+typedef VOID (WINAPI * InitializeConditionVariableProc)
+ (PCONDITION_VARIABLE ConditionVariable);
+
+typedef BOOL (WINAPI * SleepConditionVariableCSProc)
+ (PCONDITION_VARIABLE ConditionVariable,
+ PCRITICAL_SECTION CriticalSection,
+ DWORD dwMilliseconds);
+
+typedef VOID (WINAPI * WakeAllConditionVariableProc)
+ (PCONDITION_VARIABLE ConditionVariable);
+
+typedef VOID (WINAPI * WakeConditionVariableProc)
+ (PCONDITION_VARIABLE ConditionVariable);
+
+static InitializeConditionVariableProc my_InitializeConditionVariable;
+static SleepConditionVariableCSProc my_SleepConditionVariableCS;
+static WakeAllConditionVariableProc my_WakeAllConditionVariable;
+static WakeConditionVariableProc my_WakeConditionVariable;
+
+
+/**
+ Indicates if we have native condition variables,
+ initialized first time pthread_cond_init is called.
+*/
+
+static BOOL have_native_conditions= FALSE;
+
+
+/**
+ Check if native conditions can be used, load function pointers
+*/
+
+static void check_native_cond_availability(void)
+{
+ HMODULE module= GetModuleHandle("kernel32");
+
+ my_InitializeConditionVariable= (InitializeConditionVariableProc)
+ GetProcAddress(module, "InitializeConditionVariable");
+ my_SleepConditionVariableCS= (SleepConditionVariableCSProc)
+ GetProcAddress(module, "SleepConditionVariableCS");
+ my_WakeAllConditionVariable= (WakeAllConditionVariableProc)
+ GetProcAddress(module, "WakeAllConditionVariable");
+ my_WakeConditionVariable= (WakeConditionVariableProc)
+ GetProcAddress(module, "WakeConditionVariable");
+
+ if (my_InitializeConditionVariable)
+ have_native_conditions= TRUE;
+}
+
+
+
+/**
+ Convert abstime to milliseconds
+*/
+
+static DWORD get_milliseconds(const struct timespec *abstime)
+{
+ long long millis;
+ union ft64 now;
+
+ if (abstime == NULL)
+ return INFINITE;
+
+ GetSystemTimeAsFileTime(&now.ft);
+
+ /*
+ Calculate time left to abstime
+ - subtract start time from current time(values are in 100ns units)
+ - convert to millisec by dividing with 10000
+ */
+ millis= (abstime->tv.i64 - now.i64) / 10000;
+
+ /* Don't allow the timeout to be negative */
+ if (millis < 0)
+ return 0;
+
+ /*
+ Make sure the calculated timeout does not exceed original timeout
+ value which could cause "wait for ever" if system time changes
+ */
+ if (millis > abstime->max_timeout_msec)
+ millis= abstime->max_timeout_msec;
+
+ if (millis > UINT_MAX)
+ millis= UINT_MAX;
+
+ return (DWORD)millis;
+}
+
+
+/*
+ Old (pre-vista) implementation using events
+*/
+
+static int legacy_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
{
cond->waiting= 0;
InitializeCriticalSection(&cond->lock_waiting);
@@ -53,7 +154,8 @@ int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
return 0;
}
-int pthread_cond_destroy(pthread_cond_t *cond)
+
+static int legacy_cond_destroy(pthread_cond_t *cond)
{
DeleteCriticalSection(&cond->lock_waiting);
@@ -65,48 +167,13 @@ int pthread_cond_destroy(pthread_cond_t *cond)
}
-int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
-{
- return pthread_cond_timedwait(cond,mutex,NULL);
-}
-
-
-int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
+static int legacy_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
struct timespec *abstime)
{
int result;
- long timeout;
- union ft64 now;
-
- if( abstime != NULL )
- {
- GetSystemTimeAsFileTime(&now.ft);
-
- /*
- Calculate time left to abstime
- - subtract start time from current time(values are in 100ns units)
- - convert to millisec by dividing with 10000
- */
- timeout= (long)((abstime->tv.i64 - now.i64) / 10000);
-
- /* Don't allow the timeout to be negative */
- if (timeout < 0)
- timeout= 0L;
-
- /*
- Make sure the calucated timeout does not exceed original timeout
- value which could cause "wait for ever" if system time changes
- */
- if (timeout > abstime->max_timeout_msec)
- timeout= abstime->max_timeout_msec;
-
- }
- else
- {
- /* No time specified; don't expire */
- timeout= INFINITE;
- }
+ DWORD timeout;
+ timeout= get_milliseconds(abstime);
/*
Block access if previous broadcast hasn't finished.
This is just for safety and should normally not
@@ -142,7 +209,7 @@ int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
return result == WAIT_TIMEOUT ? ETIMEDOUT : 0;
}
-int pthread_cond_signal(pthread_cond_t *cond)
+static int legacy_cond_signal(pthread_cond_t *cond)
{
EnterCriticalSection(&cond->lock_waiting);
@@ -155,7 +222,7 @@ int pthread_cond_signal(pthread_cond_t *cond)
}
-int pthread_cond_broadcast(pthread_cond_t *cond)
+static int legacy_cond_broadcast(pthread_cond_t *cond)
{
EnterCriticalSection(&cond->lock_waiting);
/*
@@ -177,6 +244,87 @@ int pthread_cond_broadcast(pthread_cond_t *cond)
}
+/*
+ Posix API functions. Just choose between native and legacy implementation.
+*/
+
+int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
+{
+ /*
+ Once initialization is used here rather than in my_init(), to
+ 1) avoid my_init() pitfalls- undefined order in which initialization should
+ run
+ 2) be potentially useful C++ (in static constructors that run before main())
+ 3) just to simplify the API.
+ Also, the overhead of my_pthread_once is very small.
+ */
+ static my_pthread_once_t once_control= MY_PTHREAD_ONCE_INIT;
+ my_pthread_once(&once_control, check_native_cond_availability);
+
+ if (have_native_conditions)
+ {
+ my_InitializeConditionVariable(&cond->native_cond);
+ return 0;
+ }
+ else
+ return legacy_cond_init(cond, attr);
+}
+
+
+int pthread_cond_destroy(pthread_cond_t *cond)
+{
+ if (have_native_conditions)
+ return 0; /* no destroy function */
+ else
+ return legacy_cond_destroy(cond);
+}
+
+
+int pthread_cond_broadcast(pthread_cond_t *cond)
+{
+ if (have_native_conditions)
+ {
+ my_WakeAllConditionVariable(&cond->native_cond);
+ return 0;
+ }
+ else
+ return legacy_cond_broadcast(cond);
+}
+
+
+int pthread_cond_signal(pthread_cond_t *cond)
+{
+ if (have_native_conditions)
+ {
+ my_WakeConditionVariable(&cond->native_cond);
+ return 0;
+ }
+ else
+ return legacy_cond_signal(cond);
+}
+
+
+int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
+ struct timespec *abstime)
+{
+ if (have_native_conditions)
+ {
+ DWORD timeout= get_milliseconds(abstime);
+ if (!my_SleepConditionVariableCS(&cond->native_cond, mutex, timeout))
+ return ETIMEDOUT;
+ return 0;
+ }
+ else
+ return legacy_cond_timedwait(cond, mutex, abstime);
+}
+
+
+int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
+{
+ return pthread_cond_timedwait(cond, mutex, NULL);
+}
+
+
int pthread_attr_init(pthread_attr_t *connect_att)
{
connect_att->dwStackSize = 0;
diff --git a/mysys/my_winfile.c b/mysys/my_winfile.c
index 6c0b191ca2c..4d80d774dad 100644
--- a/mysys/my_winfile.c
+++ b/mysys/my_winfile.c
@@ -97,7 +97,7 @@ HANDLE my_get_osfhandle(File fd)
static int my_get_open_flags(File fd)
{
- DBUG_ENTER("my_get_osfhandle");
+ DBUG_ENTER("my_get_open_flags");
DBUG_ASSERT(fd >= MY_FILE_MIN && fd < (int)my_file_limit);
DBUG_RETURN(my_file_info[fd].oflag);
}
@@ -321,7 +321,7 @@ size_t my_win_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset)
if(lastError == ERROR_HANDLE_EOF || lastError == ERROR_BROKEN_PIPE)
DBUG_RETURN(0); /*return 0 at EOF*/
my_osmaperr(lastError);
- DBUG_RETURN(-1);
+ DBUG_RETURN((size_t)-1);
}
DBUG_RETURN(nBytesRead);
}
@@ -352,7 +352,7 @@ size_t my_win_read(File Filedes, uchar *Buffer, size_t Count)
if(lastError == ERROR_HANDLE_EOF || lastError == ERROR_BROKEN_PIPE)
DBUG_RETURN(0); /*return 0 at EOF*/
my_osmaperr(lastError);
- DBUG_RETURN(-1);
+ DBUG_RETURN((size_t)-1);
}
DBUG_RETURN(nBytesRead);
}
@@ -386,7 +386,7 @@ size_t my_win_pwrite(File Filedes, const uchar *Buffer, size_t Count,
if(!WriteFile(hFile, Buffer, (DWORD)Count, &nBytesWritten, &ov))
{
my_osmaperr(GetLastError());
- DBUG_RETURN(-1);
+ DBUG_RETURN((size_t)-1);
}
else
DBUG_RETURN(nBytesWritten);
@@ -427,6 +427,15 @@ size_t my_win_write(File fd, const uchar *Buffer, size_t Count)
DBUG_ENTER("my_win_write");
DBUG_PRINT("my",("Filedes: %d, Buffer: %p, Count %llu", fd, Buffer,
(ulonglong)Count));
+
+ if(!Count)
+ DBUG_RETURN(0);
+
+#ifdef _WIN64
+ if(Count > UINT_MAX)
+ Count= UINT_MAX;
+#endif
+
if(my_get_open_flags(fd) & _O_APPEND)
{
/*
@@ -442,10 +451,10 @@ size_t my_win_write(File fd, const uchar *Buffer, size_t Count)
hFile= my_get_osfhandle(fd);
if(!WriteFile(hFile, Buffer, (DWORD)Count, &nWritten, pov))
{
- nWritten= (size_t)-1;
my_osmaperr(GetLastError());
+ DBUG_RETURN((size_t)-1);
}
- DBUG_RETURN((size_t)nWritten);
+ DBUG_RETURN(nWritten);
}
diff --git a/mysys/my_winthread.c b/mysys/my_winthread.c
index 19d4a707062..54b8463fe0b 100644
--- a/mysys/my_winthread.c
+++ b/mysys/my_winthread.c
@@ -156,8 +156,19 @@ int pthread_cancel(pthread_t thread)
int my_pthread_once(my_pthread_once_t *once_control,
void (*init_routine)(void))
{
- LONG state= InterlockedCompareExchange(once_control, MY_PTHREAD_ONCE_INPROGRESS,
- MY_PTHREAD_ONCE_INIT);
+ LONG state;
+
+ /*
+ Do "dirty" read to find out if initialization is already done, to
+ save an interlocked operation in common case. Memory barriers are ensured by
+ Visual C++ volatile implementation.
+ */
+ if (*once_control == MY_PTHREAD_ONCE_DONE)
+ return 0;
+
+ state= InterlockedCompareExchange(once_control, MY_PTHREAD_ONCE_INPROGRESS,
+ MY_PTHREAD_ONCE_INIT);
+
switch(state)
{
case MY_PTHREAD_ONCE_INIT:
diff --git a/mysys/my_write.c b/mysys/my_write.c
index 3eac1364f46..64f7546620f 100644
--- a/mysys/my_write.c
+++ b/mysys/my_write.c
@@ -52,10 +52,9 @@ size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
DBUG_PRINT("error",("Write only %ld bytes, error: %d",
(long) writtenbytes, my_errno));
#ifndef NO_BACKGROUND
-#ifdef THREAD
if (my_thread_var->abort)
MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */
-#endif
+
if ((my_errno == ENOSPC || my_errno == EDQUOT) &&
(MyFlags & MY_WAIT_IF_FULL))
{
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index 772e0346016..af7939376a6 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -24,7 +24,6 @@
#include <sys/resource.h>
#endif
-#ifdef THREAD
#include <my_pthread.h>
#ifdef HAVE_PSI_INTERFACE
@@ -37,16 +36,12 @@ extern PSI_mutex_key key_my_file_info_mutex;
extern PSI_mutex_key key_LOCK_localtime_r;
#endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */
-#ifndef HAVE_GETHOSTBYNAME_R
-extern PSI_mutex_key key_LOCK_gethostbyname_r;
-#endif /* HAVE_GETHOSTBYNAME_R */
-
extern PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock,
key_IO_CACHE_SHARE_mutex, key_KEY_CACHE_cache_lock, key_LOCK_alarm,
key_my_thread_var_mutex, key_THR_LOCK_charset, key_THR_LOCK_heap,
key_THR_LOCK_isam, key_THR_LOCK_lock, key_THR_LOCK_malloc,
key_THR_LOCK_mutex, key_THR_LOCK_myisam, key_THR_LOCK_net,
- key_THR_LOCK_open, key_THR_LOCK_threads, key_THR_LOCK_time,
+ key_THR_LOCK_open, key_THR_LOCK_threads,
key_TMPDIR_mutex, key_THR_LOCK_myisam_mmap;
extern PSI_cond_key key_COND_alarm, key_IO_CACHE_SHARE_cond,
@@ -61,10 +56,7 @@ extern PSI_thread_key key_thread_alarm;
extern mysql_mutex_t THR_LOCK_malloc, THR_LOCK_open, THR_LOCK_keycache;
extern mysql_mutex_t THR_LOCK_lock, THR_LOCK_isam, THR_LOCK_net;
-extern mysql_mutex_t THR_LOCK_charset, THR_LOCK_time;
-#else /* THREAD */
-#include <my_no_pthread.h>
-#endif /* THREAD */
+extern mysql_mutex_t THR_LOCK_charset;
#include <mysql/psi/mysql_file.h>
diff --git a/mysys/ptr_cmp.c b/mysys/ptr_cmp.c
index 2005e3eb2b7..dcafe13291d 100644
--- a/mysys/ptr_cmp.c
+++ b/mysys/ptr_cmp.c
@@ -22,7 +22,7 @@
#include "mysys_priv.h"
#include <myisampack.h>
-#ifdef TARGET_OS_SOLARIS
+#ifdef __sun
/*
* On Solaris, memcmp() is normally faster than the unrolled ptr_compare_N
* functions, as memcmp() is usually a platform-specific implementation
@@ -39,22 +39,25 @@ static int native_compare(size_t *length, unsigned char **a, unsigned char **b)
return memcmp(*a, *b, *length);
}
-#else /* TARGET_OS_SOLARIS */
+#else /* __sun */
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);
-#endif /* TARGET_OS_SOLARIS */
+#endif /* __sun */
/* Get a pointer to a optimal byte-compare function for a given size */
-qsort2_cmp get_ptr_compare (size_t size)
+#ifdef __sun
+qsort2_cmp get_ptr_compare (size_t size __attribute__((unused)))
{
-#ifdef TARGET_OS_SOLARIS
return (qsort2_cmp) native_compare;
+}
#else
+qsort2_cmp get_ptr_compare (size_t size)
+{
if (size < 4)
return (qsort2_cmp) ptr_compare;
switch (size & 3) {
@@ -64,8 +67,8 @@ qsort2_cmp get_ptr_compare (size_t size)
case 3: return (qsort2_cmp) ptr_compare_3;
}
return 0; /* Impossible */
-#endif /* TARGET_OS_SOLARIS */
}
+#endif /* __sun */
/*
@@ -75,6 +78,8 @@ qsort2_cmp get_ptr_compare (size_t size)
#define cmp(N) if (first[N] != last[N]) return (int) first[N] - (int) last[N]
+#ifndef __sun
+
static int ptr_compare(size_t *compare_length, uchar **a, uchar **b)
{
reg3 int length= *compare_length;
@@ -177,6 +182,8 @@ static int ptr_compare_3(size_t *compare_length,uchar **a, uchar **b)
return (0);
}
+#endif /* !__sun */
+
void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos)
{
switch (pack_length) {
diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c
index ba62062ebc0..e4999dbbe81 100644
--- a/mysys/stacktrace.c
+++ b/mysys/stacktrace.c
@@ -24,6 +24,11 @@
#include <unistd.h>
#include <strings.h>
+#ifdef __linux__
+#include <ctype.h> /* isprint */
+#include <sys/syscall.h> /* SYS_gettid */
+#endif
+
#if HAVE_EXECINFO_H
#include <execinfo.h>
#endif
@@ -43,10 +48,99 @@ void my_init_stacktrace()
#endif
}
-void my_safe_print_str(const char* name, const char* val, int max_len)
+#ifdef __linux__
+
+static void print_buffer(char *buffer, size_t count)
+{
+ for (; count && *buffer; --count)
+ {
+ int c= (int) *buffer++;
+ fputc(isprint(c) ? c : ' ', stderr);
+ }
+}
+
+/**
+ Access the pages of this process through /proc/self/task/<tid>/mem
+ in order to safely print the contents of a memory address range.
+
+ @param addr The address at the start of the memory region.
+ @param max_len The length of the memory region.
+
+ @return Zero on success.
+*/
+static int safe_print_str(const char *addr, int max_len)
{
- char *heap_end= (char*) sbrk(0);
- fprintf(stderr, "%s at %p ", name, val);
+ int fd;
+ pid_t tid;
+ off_t offset;
+ ssize_t nbytes= 0;
+ size_t total, count;
+ char buf[256];
+
+ tid= (pid_t) syscall(SYS_gettid);
+
+ sprintf(buf, "/proc/self/task/%d/mem", tid);
+
+ if ((fd= open(buf, O_RDONLY)) < 0)
+ return -1;
+
+ /* Ensure that off_t can hold a pointer. */
+ compile_time_assert(sizeof(off_t) >= sizeof(intptr));
+
+ total= max_len;
+ offset= (intptr) addr;
+
+ /* Read up to the maximum number of bytes. */
+ while (total)
+ {
+ count= min(sizeof(buf), total);
+
+ if ((nbytes= pread(fd, buf, count, offset)) < 0)
+ {
+ /* Just in case... */
+ if (errno == EINTR)
+ continue;
+ else
+ break;
+ }
+
+ /* Advance offset into memory. */
+ total-= nbytes;
+ offset+= nbytes;
+ addr+= nbytes;
+
+ /* Output the printable characters. */
+ print_buffer(buf, nbytes);
+
+ /* Break if less than requested... */
+ if ((count - nbytes))
+ break;
+ }
+
+ /* Output a new line if something was printed. */
+ if (total != (size_t) max_len)
+ fputc('\n', stderr);
+
+ if (nbytes == -1)
+ fprintf(stderr, "Can't read from address %p: %m.\n", addr);
+
+ close(fd);
+
+ return 0;
+}
+
+#endif
+
+void my_safe_print_str(const char* val, int max_len)
+{
+ char *heap_end;
+
+#ifdef __linux__
+ if (!safe_print_str(val, max_len))
+ return;
+#endif
+
+ heap_end= (char*) sbrk(0);
if (!PTR_SANE(val))
{
@@ -54,7 +148,6 @@ void my_safe_print_str(const char* name, const char* val, int max_len)
return;
}
- fprintf(stderr, "= ");
for (; max_len && PTR_SANE(val) && *val; --max_len)
fputc(*val++, stderr);
fputc('\n', stderr);
@@ -315,6 +408,9 @@ end:
/* Produce a core for the thread */
void my_write_core(int sig)
{
+#ifdef HAVE_gcov
+ extern void __gcov_flush(void);
+#endif
signal(sig, SIG_DFL);
#ifdef HAVE_gcov
/*
@@ -322,7 +418,6 @@ void my_write_core(int sig)
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);
@@ -605,16 +700,15 @@ void my_write_core(int unused)
}
-void my_safe_print_str(const char *name, const char *val, int len)
+void my_safe_print_str(const char *val, int len)
{
- fprintf(stderr,"%s at %p", name, val);
- __try
+ __try
{
- fprintf(stderr,"=%.*s\n", len, val);
+ fprintf(stderr, "%.*s\n", len, val);
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
- fprintf(stderr,"is an invalid string pointer\n");
+ fprintf(stderr, "is an invalid string pointer\n");
}
}
#endif /*__WIN__*/
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index 9742861db08..725b32fa4a6 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -18,7 +18,7 @@
#include "mysys_priv.h"
#include <my_global.h>
-#if defined(THREAD) && !defined(DONT_USE_THR_ALARM)
+#if !defined(DONT_USE_THR_ALARM)
#include <errno.h>
#include <my_pthread.h>
#include <signal.h>
@@ -674,15 +674,14 @@ void resize_thr_alarm(uint max_alarms)
#endif /* __WIN__ */
-#endif /* THREAD */
-
+#endif
/****************************************************************************
Handling of test case (when compiled with -DMAIN)
***************************************************************************/
#ifdef MAIN
-#if defined(THREAD) && !defined(DONT_USE_THR_ALARM)
+#if !defined(DONT_USE_THR_ALARM)
static mysql_cond_t COND_thread_count;
static mysql_mutex_t LOCK_thread_count;
@@ -936,17 +935,13 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
return 0;
}
-#else /* THREAD */
+#else /* !defined(DONT_USE_ALARM_THREAD) */
int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
{
-#ifndef THREAD
- printf("thr_alarm disabled because we are not using threads\n");
-#else
printf("thr_alarm disabled with DONT_USE_THR_ALARM\n");
-#endif
exit(1);
}
-#endif /* THREAD */
+#endif /* !defined(DONT_USE_ALARM_THREAD) */
#endif /* MAIN */
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index b22823ae33e..8034e6d30a8 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -85,7 +85,6 @@ be any number of TL_WRITE_CONCURRENT_INSERT locks aktive at the same time.
#include "mysys_priv.h"
-#ifdef THREAD
#include "thr_lock.h"
#include <m_string.h>
#include <errno.h>
@@ -1515,7 +1514,6 @@ void thr_print_locks(void)
mysql_mutex_unlock(&THR_LOCK_lock);
}
-#endif /* THREAD */
/*****************************************************************************
** Test of thread locks
@@ -1523,8 +1521,6 @@ void thr_print_locks(void)
#ifdef MAIN
-#ifdef THREAD
-
struct st_test {
uint lock_nr;
enum thr_lock_type lock_type;
@@ -1754,13 +1750,4 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
return 0;
}
-#else /* THREAD */
-
-int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
-{
- printf("thr_lock disabled because we are not using threads\n");
- exit(1);
-}
-
-#endif /* THREAD */
#endif /* MAIN */
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index b5548662679..fdc25b67049 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -19,12 +19,12 @@
#if defined(TARGET_OS_LINUX) && !defined (__USE_UNIX98)
#define __USE_UNIX98 /* To get rw locks under Linux */
#endif
+
#ifdef SAFE_MUTEX
#define SAFE_MUTEX_DEFINED
+#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */
#endif
-#if defined(THREAD)
-#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */
#include "mysys_priv.h"
#include "my_static.h"
#include <m_string.h>
@@ -525,7 +525,7 @@ int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp, const char *file,
int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
- struct timespec *abstime,
+ const struct timespec *abstime,
const char *file, uint line)
{
int error;
@@ -929,4 +929,3 @@ void fastmutex_global_init(void)
}
#endif /* defined(MY_PTHREAD_FASTMUTEX) */
-#endif /* THREAD */
diff --git a/mysys/thr_rwlock.c b/mysys/thr_rwlock.c
index ecd12849822..bad80b43eef 100644
--- a/mysys/thr_rwlock.c
+++ b/mysys/thr_rwlock.c
@@ -16,10 +16,122 @@
/* Synchronization - readers / writer thread locks */
#include "mysys_priv.h"
-#if defined(THREAD)
#if defined(NEED_MY_RW_LOCK)
#include <errno.h>
+#ifdef _WIN32
+
+static BOOL have_srwlock= FALSE;
+/* Prototypes and function pointers for windows functions */
+typedef VOID (WINAPI* srw_func) (PSRWLOCK SRWLock);
+typedef BOOL (WINAPI* srw_bool_func) (PSRWLOCK SRWLock);
+
+static srw_func my_InitializeSRWLock;
+static srw_func my_AcquireSRWLockExclusive;
+static srw_func my_ReleaseSRWLockExclusive;
+static srw_func my_AcquireSRWLockShared;
+static srw_func my_ReleaseSRWLockShared;
+
+static srw_bool_func my_TryAcquireSRWLockExclusive;
+static srw_bool_func my_TryAcquireSRWLockShared;
+
+/**
+ Check for presence of Windows slim reader writer lock function.
+ Load function pointers.
+*/
+
+static void check_srwlock_availability(void)
+{
+ HMODULE module= GetModuleHandle("kernel32");
+
+ my_InitializeSRWLock= (srw_func) GetProcAddress(module,
+ "InitializeSRWLock");
+ my_AcquireSRWLockExclusive= (srw_func) GetProcAddress(module,
+ "AcquireSRWLockExclusive");
+ my_AcquireSRWLockShared= (srw_func) GetProcAddress(module,
+ "AcquireSRWLockShared");
+ my_ReleaseSRWLockExclusive= (srw_func) GetProcAddress(module,
+ "ReleaseSRWLockExclusive");
+ my_ReleaseSRWLockShared= (srw_func) GetProcAddress(module,
+ "ReleaseSRWLockShared");
+ my_TryAcquireSRWLockExclusive= (srw_bool_func) GetProcAddress(module,
+ "TryAcquireSRWLockExclusive");
+ my_TryAcquireSRWLockShared= (srw_bool_func) GetProcAddress(module,
+ "TryAcquireSRWLockShared");
+
+ /*
+ We currently require TryAcquireSRWLockExclusive. This API is missing on
+ Vista, this means SRWLock are only used starting with Win7.
+
+ If "trylock" usage for rwlocks is eliminated from server codebase (it is used
+ in a single place currently, in query cache), then SRWLock can be enabled on
+ Vista too. In this case condition below needs to be changed to e.g check
+ for my_InitializeSRWLock.
+ */
+
+ if (my_TryAcquireSRWLockExclusive)
+ have_srwlock= TRUE;
+
+}
+
+
+static int srw_init(my_rw_lock_t *rwp)
+{
+ my_InitializeSRWLock(&rwp->srwlock);
+ rwp->have_exclusive_srwlock = FALSE;
+ return 0;
+}
+
+
+static int srw_rdlock(my_rw_lock_t *rwp)
+{
+ my_AcquireSRWLockShared(&rwp->srwlock);
+ return 0;
+}
+
+
+static int srw_tryrdlock(my_rw_lock_t *rwp)
+{
+
+ if (!my_TryAcquireSRWLockShared(&rwp->srwlock))
+ return EBUSY;
+ return 0;
+}
+
+
+static int srw_wrlock(my_rw_lock_t *rwp)
+{
+ my_AcquireSRWLockExclusive(&rwp->srwlock);
+ rwp->have_exclusive_srwlock= TRUE;
+ return 0;
+}
+
+
+static int srw_trywrlock(my_rw_lock_t *rwp)
+{
+ if (!my_TryAcquireSRWLockExclusive(&rwp->srwlock))
+ return EBUSY;
+ rwp->have_exclusive_srwlock= TRUE;
+ return 0;
+}
+
+
+static int srw_unlock(my_rw_lock_t *rwp)
+{
+ if (rwp->have_exclusive_srwlock)
+ {
+ rwp->have_exclusive_srwlock= FALSE;
+ my_ReleaseSRWLockExclusive(&rwp->srwlock);
+ }
+ else
+ {
+ my_ReleaseSRWLockShared(&rwp->srwlock);
+ }
+ return 0;
+}
+
+#endif /*_WIN32 */
+
/*
Source base from Sun Microsystems SPILT, simplified for MySQL use
-- Joshua Chamas
@@ -59,10 +171,26 @@
* Mountain View, California 94043
*/
-int my_rw_init(my_rw_lock_t *rwp, my_bool *prefer_readers_attr)
+int my_rw_init(my_rw_lock_t *rwp)
{
pthread_condattr_t cond_attr;
+#ifdef _WIN32
+ /*
+ Once initialization is used here rather than in my_init(), in order to
+ - avoid my_init() pitfalls- (undefined order in which initialization should
+ run)
+ - be potentially useful C++ (static constructors)
+ - just to simplify the API.
+ Also, the overhead is of my_pthread_once is very small.
+ */
+ static my_pthread_once_t once_control= MY_PTHREAD_ONCE_INIT;
+ my_pthread_once(&once_control, check_srwlock_availability);
+
+ if (have_srwlock)
+ return srw_init(rwp);
+#endif
+
pthread_mutex_init( &rwp->lock, MY_MUTEX_INIT_FAST);
pthread_condattr_init( &cond_attr );
pthread_cond_init( &rwp->readers, &cond_attr );
@@ -74,8 +202,6 @@ int my_rw_init(my_rw_lock_t *rwp, my_bool *prefer_readers_attr)
#ifdef SAFE_MUTEX
rwp->write_thread = 0;
#endif
- /* If attribute argument is NULL use default value - prefer writers. */
- rwp->prefer_readers= prefer_readers_attr ? *prefer_readers_attr : FALSE;
return(0);
}
@@ -83,6 +209,10 @@ int my_rw_init(my_rw_lock_t *rwp, my_bool *prefer_readers_attr)
int my_rw_destroy(my_rw_lock_t *rwp)
{
+#ifdef _WIN32
+ if (have_srwlock)
+ return 0; /* no destroy function */
+#endif
DBUG_ASSERT(rwp->state == 0);
pthread_mutex_destroy( &rwp->lock );
pthread_cond_destroy( &rwp->readers );
@@ -93,11 +223,15 @@ int my_rw_destroy(my_rw_lock_t *rwp)
int my_rw_rdlock(my_rw_lock_t *rwp)
{
+#ifdef _WIN32
+ if (have_srwlock)
+ return srw_rdlock(rwp);
+#endif
+
pthread_mutex_lock(&rwp->lock);
/* active or queued writers */
- while (( rwp->state < 0 ) ||
- (rwp->waiters && ! rwp->prefer_readers))
+ while (( rwp->state < 0 ) || rwp->waiters)
pthread_cond_wait( &rwp->readers, &rwp->lock);
rwp->state++;
@@ -108,9 +242,14 @@ int my_rw_rdlock(my_rw_lock_t *rwp)
int my_rw_tryrdlock(my_rw_lock_t *rwp)
{
int res;
+
+#ifdef _WIN32
+ if (have_srwlock)
+ return srw_tryrdlock(rwp);
+#endif
+
pthread_mutex_lock(&rwp->lock);
- if ((rwp->state < 0 ) ||
- (rwp->waiters && ! rwp->prefer_readers))
+ if ((rwp->state < 0 ) || rwp->waiters)
res= EBUSY; /* Can't get lock */
else
{
@@ -124,6 +263,11 @@ int my_rw_tryrdlock(my_rw_lock_t *rwp)
int my_rw_wrlock(my_rw_lock_t *rwp)
{
+#ifdef _WIN32
+ if (have_srwlock)
+ return srw_wrlock(rwp);
+#endif
+
pthread_mutex_lock(&rwp->lock);
rwp->waiters++; /* another writer queued */
@@ -144,6 +288,12 @@ int my_rw_wrlock(my_rw_lock_t *rwp)
int my_rw_trywrlock(my_rw_lock_t *rwp)
{
int res;
+
+#ifdef _WIN32
+ if (have_srwlock)
+ return srw_trywrlock(rwp);
+#endif
+
pthread_mutex_lock(&rwp->lock);
if (rwp->state)
res= EBUSY; /* Can't get lock */
@@ -162,6 +312,11 @@ int my_rw_trywrlock(my_rw_lock_t *rwp)
int my_rw_unlock(my_rw_lock_t *rwp)
{
+#ifdef _WIN32
+ if (have_srwlock)
+ return srw_unlock(rwp);
+#endif
+
DBUG_PRINT("rw_unlock",
("state: %d waiters: %d", rwp->state, rwp->waiters));
pthread_mutex_lock(&rwp->lock);
@@ -192,30 +347,126 @@ int my_rw_unlock(my_rw_lock_t *rwp)
return(0);
}
+#endif /* defined(NEED_MY_RW_LOCK) */
+
-int rw_pr_init(struct st_my_rw_lock_t *rwlock)
+int rw_pr_init(rw_pr_lock_t *rwlock)
{
- my_bool prefer_readers_attr= TRUE;
- return my_rw_init(rwlock, &prefer_readers_attr);
+ pthread_mutex_init(&rwlock->lock, NULL);
+ pthread_cond_init(&rwlock->no_active_readers, NULL);
+ rwlock->active_readers= 0;
+ rwlock->writers_waiting_readers= 0;
+ rwlock->active_writer= FALSE;
+#ifdef SAFE_MUTEX
+ rwlock->writer_thread= 0;
+#endif
+ return 0;
}
-#else
-/*
- We are on system which has native read/write locks which support
- preferring of readers.
-*/
+int rw_pr_destroy(rw_pr_lock_t *rwlock)
+{
+ pthread_cond_destroy(&rwlock->no_active_readers);
+ pthread_mutex_destroy(&rwlock->lock);
+ return 0;
+}
-int rw_pr_init(rw_pr_lock_t *rwlock)
+
+int rw_pr_rdlock(rw_pr_lock_t *rwlock)
+{
+ pthread_mutex_lock(&rwlock->lock);
+ /*
+ The fact that we were able to acquire 'lock' mutex means
+ that there are no active writers and we can acquire rd-lock.
+ Increment active readers counter to prevent requests for
+ wr-lock from succeeding and unlock mutex.
+ */
+ rwlock->active_readers++;
+ pthread_mutex_unlock(&rwlock->lock);
+ return 0;
+}
+
+
+int rw_pr_wrlock(rw_pr_lock_t *rwlock)
{
- pthread_rwlockattr_t rwlock_attr;
+ pthread_mutex_lock(&rwlock->lock);
+
+ if (rwlock->active_readers != 0)
+ {
+ /* There are active readers. We have to wait until they are gone. */
+ rwlock->writers_waiting_readers++;
+
+ while (rwlock->active_readers != 0)
+ pthread_cond_wait(&rwlock->no_active_readers, &rwlock->lock);
- pthread_rwlockattr_init(&rwlock_attr);
- pthread_rwlockattr_setkind_np(&rwlock_attr, PTHREAD_RWLOCK_PREFER_READER_NP);
- pthread_rwlock_init(rwlock, NULL);
- pthread_rwlockattr_destroy(&rwlock_attr);
+ rwlock->writers_waiting_readers--;
+ }
+
+ /*
+ We own 'lock' mutex so there is no active writers.
+ Also there are no active readers.
+ This means that we can grant wr-lock.
+ Not releasing 'lock' mutex until unlock will block
+ both requests for rd and wr-locks.
+ Set 'active_writer' flag to simplify unlock.
+
+ Thanks to the fact wr-lock/unlock in the absence of
+ contention from readers is essentially mutex lock/unlock
+ with a few simple checks make this rwlock implementation
+ wr-lock optimized.
+ */
+ rwlock->active_writer= TRUE;
+#ifdef SAFE_MUTEX
+ rwlock->writer_thread= pthread_self();
+#endif
return 0;
}
-#endif /* defined(NEED_MY_RW_LOCK) */
-#endif /* defined(THREAD) */
+
+int rw_pr_unlock(rw_pr_lock_t *rwlock)
+{
+ if (rwlock->active_writer)
+ {
+ /* We are unlocking wr-lock. */
+#ifdef SAFE_MUTEX
+ rwlock->writer_thread= 0;
+#endif
+ rwlock->active_writer= FALSE;
+ if (rwlock->writers_waiting_readers)
+ {
+ /*
+ Avoid expensive cond signal in case when there is no contention
+ or it is wr-only.
+
+ Note that from view point of performance it would be better to
+ signal on the condition variable after unlocking mutex (as it
+ reduces number of contex switches).
+
+ Unfortunately this would mean that such rwlock can't be safely
+ used by MDL subsystem, which relies on the fact that it is OK
+ to destroy rwlock once it is in unlocked state.
+ */
+ pthread_cond_signal(&rwlock->no_active_readers);
+ }
+ pthread_mutex_unlock(&rwlock->lock);
+ }
+ else
+ {
+ /* We are unlocking rd-lock. */
+ pthread_mutex_lock(&rwlock->lock);
+ rwlock->active_readers--;
+ if (rwlock->active_readers == 0 &&
+ rwlock->writers_waiting_readers)
+ {
+ /*
+ If we are last reader and there are waiting
+ writers wake them up.
+ */
+ pthread_cond_signal(&rwlock->no_active_readers);
+ }
+ pthread_mutex_unlock(&rwlock->lock);
+ }
+ return 0;
+}
+
+
diff --git a/mysys/typelib.c b/mysys/typelib.c
index aec203becc0..463d3ba53a5 100644
--- a/mysys/typelib.c
+++ b/mysys/typelib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -27,7 +27,7 @@ int find_type_with_warning(const char *x, TYPELIB *typelib, const char *option)
int res;
const char **ptr;
- if ((res= find_type((char *) x, typelib, 2)) <= 0)
+ if ((res= find_type((char *) x, typelib, FIND_TYPE_BASIC)) <= 0)
{
ptr= typelib->type_names;
if (!*x)
@@ -56,16 +56,13 @@ uint find_type_or_exit(const char *x, TYPELIB *typelib, const char *option)
Search after a string in a list of strings. Endspace in x is not compared.
@param x String to find
- @param lib TYPELIB (struct of pointer to values + count)
- @param full_name bitmap of what to do
- 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
-
- @note
- If part, uniq field is found and full_name == 0 then x is expanded
- to full field.
+ @param typelib TYPELIB (struct of pointer to values + count)
+ @param flags flags to tune behaviour: a combination of
+ FIND_TYPE_NO_PREFIX
+ FIND_TYPE_ALLOW_NUMBER
+ FIND_TYPE_COMMA_TERM.
+ FIND_TYPE_NO_OVERWRITE can be passed but is
+ superfluous (is always implicitely on).
@retval
-1 Too many matching values
@@ -76,15 +73,17 @@ uint find_type_or_exit(const char *x, TYPELIB *typelib, const char *option)
*/
-int find_type(char *x, const TYPELIB *typelib, uint full_name)
+int find_type(const char *x, const TYPELIB *typelib, uint flags)
{
int find,pos;
int UNINIT_VAR(findpos); /* guarded by find */
- reg1 char * i;
- reg2 const char *j;
+ const char *i;
+ const char *j;
DBUG_ENTER("find_type");
DBUG_PRINT("enter",("x: '%s' lib: 0x%lx", x, (long) typelib));
+ DBUG_ASSERT(!(flags & ~(FIND_TYPE_NO_PREFIX | FIND_TYPE_ALLOW_NUMBER |
+ FIND_TYPE_NO_OVERWRITE | FIND_TYPE_COMMA_TERM)));
if (!typelib->count)
{
DBUG_PRINT("exit",("no count"));
@@ -94,24 +93,26 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name)
for (pos=0 ; (j=typelib->type_names[pos]) ; pos++)
{
for (i=x ;
- *i && (!(full_name & 8) || !is_field_separator(*i)) &&
+ *i && (!(flags & FIND_TYPE_COMMA_TERM) || !is_field_separator(*i)) &&
my_toupper(&my_charset_latin1,*i) ==
my_toupper(&my_charset_latin1,*j) ; i++, j++) ;
if (! *j)
{
while (*i == ' ')
i++; /* skip_end_space */
- if (! *i || ((full_name & 8) && is_field_separator(*i)))
+ if (! *i || ((flags & FIND_TYPE_COMMA_TERM) && is_field_separator(*i)))
DBUG_RETURN(pos+1);
}
- if ((!*i && (!(full_name & 8) || !is_field_separator(*i))) &&
- (!*j || !(full_name & 1)))
+ if ((!*i &&
+ (!(flags & FIND_TYPE_COMMA_TERM) || !is_field_separator(*i))) &&
+ (!*j || !(flags & FIND_TYPE_NO_PREFIX)))
{
find++;
findpos=pos;
}
}
- if (find == 0 && (full_name & 4) && x[0] == '#' && strend(x)[-1] == '#' &&
+ if (find == 0 && (flags & FIND_TYPE_ALLOW_NUMBER) && x[0] == '#' &&
+ strend(x)[-1] == '#' &&
(findpos=atoi(x+1)-1) >= 0 && (uint) findpos < typelib->count)
find=1;
else if (find == 0 || ! x[0])
@@ -119,13 +120,11 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name)
DBUG_PRINT("exit",("Couldn't find type"));
DBUG_RETURN(0);
}
- else if (find != 1 || (full_name & 1))
+ else if (find != 1 || (flags & FIND_TYPE_NO_PREFIX))
{
DBUG_PRINT("exit",("Too many possybilities"));
DBUG_RETURN(-1);
}
- if (!(full_name & 2))
- (void) strmov(x,typelib->type_names[findpos]);
DBUG_RETURN(findpos+1);
} /* find_type */
@@ -200,7 +199,7 @@ my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err)
x++;
if (x[0] && x[1]) /* skip separator if found */
x++;
- if ((find= find_type(i, lib, 2 | 8) - 1) < 0)
+ if ((find= find_type(i, lib, FIND_TYPE_COMMA_TERM) - 1) < 0)
DBUG_RETURN(0);
result|= (ULL(1) << find);
}
@@ -284,7 +283,7 @@ static TYPELIB on_off_default_typelib= {array_elements(on_off_default_names)-1,
static uint parse_name(const TYPELIB *lib, const char **strpos, const char *end)
{
const char *pos= *strpos;
- uint find= find_type((char*)pos, lib, 8);
+ uint find= find_type(pos, lib, FIND_TYPE_COMMA_TERM);
for (; pos != end && *pos != '=' && *pos !=',' ; pos++);
*strpos= pos;
return find;
diff --git a/packaging/Makefile.am b/packaging/Makefile.am
deleted file mode 100644
index 3e6a79367b6..00000000000
--- a/packaging/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-EXTRA_DIST = \
- WiX/AdminBackground.jpg \
- WiX/AdminHeader.jpg \
- WiX/CMakeLists.txt \
- WiX/extra.wxs.in \
- WiX/CPackWixConfig.cmake \
- WiX/create_msi.cmake.in \
- WiX/custom_ui.wxs \
- WiX/MySQLServer.ico \
- WiX/mysql_server.wxs.in \
- WiX/ca/CMakeLists.txt \
- WiX/ca/CustomAction.cpp \
- WiX/ca/CustomAction.def \
- WiX/ca/CustomAction.rc
diff --git a/packaging/WiX/CMakeLists.txt b/packaging/WiX/CMakeLists.txt
index 052887f10a1..4048273fc03 100644
--- a/packaging/WiX/CMakeLists.txt
+++ b/packaging/WiX/CMakeLists.txt
@@ -63,7 +63,12 @@ FIND_PROGRAM(LIGHT_EXECUTABLE light ${WIX_DIR})
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.rtf")
SET(COPYING_RTF "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.rtf")
ELSE()
- FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../COPYING" CONTENTS)
+ IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../LICENSE.mysql")
+ SET(LICENSE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../../LICENSE.mysql")
+ ELSE()
+ SET(LICENSE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../../COPYING")
+ ENDIF()
+ FILE(READ ${LICENSE_FILE} CONTENTS)
STRING(REGEX REPLACE "\n" "\\\\par\n" CONTENTS "${CONTENTS}")
STRING(REGEX REPLACE "\t" "\\\\tab" CONTENTS "${CONTENTS}")
FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/COPYING.rtf" "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\\viewkind4\\uc1\\pard\\lang1031\\f0\\fs15")
diff --git a/packaging/WiX/ca/CMakeLists.txt b/packaging/WiX/ca/CMakeLists.txt
index c74b51284c7..6872dc99d94 100644
--- a/packaging/WiX/ca/CMakeLists.txt
+++ b/packaging/WiX/ca/CMakeLists.txt
@@ -13,15 +13,43 @@
# 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(${WIX_DIR}/../SDK/inc)
-LINK_DIRECTORIES(${WIX_DIR}/../SDK/lib)
+INCLUDE_DIRECTORIES(${WIX_DIR}/../SDK/inc ${WIX_DIR}/SDK/inc)
+LINK_DIRECTORIES(${WIX_DIR}/../SDK/lib ${WIX_DIR}/SDK/lib)
-SET(WIXCA_SOURCES CustomAction.cpp CustomAction.rc CustomAction.def)
+SET(WIXCA_SOURCES CustomAction.cpp CustomAction.def)
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
- LINK_LIBRARIES(wcautil_x64 dutil_x64 msi version)
+ SET(WIX_ARCH_SUFFIX "_x64")
ELSE()
- LINK_LIBRARIES(wcautil dutil msi version)
+ SET(WIX_ARCH_SUFFIX)
ENDIF()
-
-ADD_LIBRARY(wixca SHARED ${WIXCA_SOURCES})
+
+IF(MSVC_VERSION EQUAL 1400)
+ SET(WIX35_MSVC_SUFFIX "_2005")
+ELSEIF(MSVC_VERSION EQUAL 1500)
+ SET(WIX35_MSVC_SUFFIX "_2008")
+ELSEIF(MSVC_VERSION EQUAL 1600)
+ SET(WIX35_MSVC_SUFFIX "_2010")
+ELSE()
+ # When next VS is out, add the correct version here
+ MESSAGE(FATAL_ERROR "Unknown VS version")
+ENDIF()
+
+MESSAGE(STATUS "Searching for wcautil${WIX_ARCH_SUFFIX} or wcautil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX} in ${WIX_DIR}/../SDK/lib ${WIX_DIR}/SDK/lib")
+MESSAGE(STATUS "Searching for dutil${WIX_ARCH_SUFFIX} or dutil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX} in ${WIX_DIR}/../SDK/lib ${WIX_DIR}/SDK/lib")
+
+FIND_LIBRARY(WIX_WCAUTIL_LIBRARY
+ NAMES wcautil${WIX_ARCH_SUFFIX} wcautil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
+ HINTS ${WIX_DIR}/../SDK/lib ${WIX_DIR}/SDK/lib)
+
+FIND_LIBRARY(WIX_DUTIL_LIBRARY
+ NAMES dutil${WIX_ARCH_SUFFIX} dutil${WIX35_MSVC_SUFFIX}${WIX_ARCH_SUFFIX}
+ PATHS ${WIX_DIR}/../SDK/lib ${WIX_DIR}/SDK/lib)
+
+MESSAGE(STATUS "Found: ${WIX_WCAUTIL_LIBRARY}")
+MESSAGE(STATUS "Found: ${WIX_DUTIL_LIBRARY}")
+
+ADD_VERSION_INFO(wixca SHARED WIXCA_SOURCES)
+ADD_LIBRARY(wixca SHARED EXCLUDE_FROM_ALL ${WIXCA_SOURCES})
+TARGET_LINK_LIBRARIES(wixca ${WIX_WCAUTIL_LIBRARY} ${WIX_DUTIL_LIBRARY}
+ msi version )
diff --git a/packaging/WiX/ca/CustomAction.rc b/packaging/WiX/ca/CustomAction.rc
deleted file mode 100644
index 3f37126ee77..00000000000
--- a/packaging/WiX/ca/CustomAction.rc
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "afxres.h"
-#undef APSTUDIO_READONLY_SYMBOLS
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x17L
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x0L
- FILESUBTYPE 0x0L
-BEGIN
-END
-
diff --git a/packaging/WiX/create_msi.cmake.in b/packaging/WiX/create_msi.cmake.in
index adc3cf4c4dd..dd2e9fd9d85 100644
--- a/packaging/WiX/create_msi.cmake.in
+++ b/packaging/WiX/create_msi.cmake.in
@@ -7,7 +7,7 @@ SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@")
SET(VERSION "@VERSION@")
SET(MAJOR_VERSION "@MAJOR_VERSION@")
SET(MINOR_VERSION "@MINOR_VERSION@")
-SET(PATCH "@PATCH@")
+SET(PATCH_VERSION "@PATCH_VERSION@")
SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@)
SET(MANUFACTURER "@MANUFACTURER@")
SET(WIXCA_LOCATION "@WIXCA_LOCATION@")
@@ -15,6 +15,28 @@ SET(COPYING_RTF "@COPYING_RTF@")
SET(CPACK_WIX_CONFIG "@CPACK_WIX_CONFIG@")
SET(CPACK_WIX_INCLUDE "@CPACK_WIX_INCLUDE@")
+LIST(APPEND EXCLUDE_DIRS
+ bin/debug
+ data/test
+ lib/plugin/debug
+ mysql-test
+ scripts
+ sql-bench
+)
+
+LIST(APPEND EXCLUDE_FILES
+ bin/echo.exe
+ bin/mysql_client_test_embedded.exe
+ bin/mysqld-debug.exe
+ bin/mysqltest_embedded.exe
+ bin/replace.exe
+ lib/debug/mysqlserver.lib
+ lib/libmysqld.dll
+ lib/libmysqld.lib
+ lib/mysqlserver.lib
+ lib/mysqlservices.lib
+)
+
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(Win64 " Win64='yes'")
SET(Platform x64)
@@ -27,6 +49,12 @@ ENDIF()
SET(ENV{VS_UNICODE_OUTPUT})
+# Switch off the monolithic install
+EXECUTE_PROCESS(
+ COMMAND ${CMAKE_COMMAND} -DCPACK_MONOLITHIC_INSTALL=0 ${CMAKE_BINARY_DIR}
+ OUTPUT_QUIET
+)
+
INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig.cmake)
IF(CPACK_WIX_CONFIG)
@@ -191,11 +219,18 @@ ENDMACRO()
FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root)
+ FILE(RELATIVE_PATH dir_rel ${topdir} ${dir})
+ IF(dir_rel)
+ LIST(FIND EXCLUDE_DIRS ${dir_rel} TO_EXCLUDE)
+ IF(NOT TO_EXCLUDE EQUAL -1)
+ MESSAGE(STATUS "excluding directory: ${dir_rel}")
+ RETURN()
+ ENDIF()
+ ENDIF()
FILE(GLOB all_files ${dir}/*)
IF(NOT all_files)
RETURN()
ENDIF()
- FILE(RELATIVE_PATH dir_rel ${topdir} ${dir})
IF(dir_rel)
MAKE_DIRECTORY(${dir_root}/${dir_rel})
MAKE_WIX_IDENTIFIER("${dir_rel}" id)
@@ -209,18 +244,31 @@ FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root)
FOREACH(f ${all_files})
IF(NOT IS_DIRECTORY ${f})
FILE(RELATIVE_PATH rel ${topdir} ${f})
- MAKE_WIX_IDENTIFIER("${rel}" id)
- FILE(TO_NATIVE_PATH ${f} f_native)
- GET_FILENAME_COMPONENT(f_ext "${f}" EXT)
- # According to MSDN each DLL or EXE should be in the own component
- IF(f_ext MATCHES ".exe" OR f_ext MATCHES ".dll")
-
- FILE(APPEND ${file} " <Component Id='C.${id}' Guid='*' ${Win64}>\n")
- FILE(APPEND ${file} " <File Id='F.${id}' KeyPath='yes' Source='${f_native}'/>\n")
- FILE(APPEND ${file} " </Component>\n")
- FILE(APPEND ${file_comp} " <ComponentRef Id='C.${id}'/>\n")
- ELSE()
- SET(NONEXEFILES "${NONEXEFILES}\n<File Id='F.${id}' Source='${f_native}'/>" )
+ SET(TO_EXCLUDE)
+ IF(rel MATCHES "\\.pdb$")
+ SET(TO_EXCLUDE TRUE)
+ ELSE()
+ LIST(FIND EXCLUDE_FILES ${rel} RES)
+ IF(NOT RES EQUAL -1)
+ SET(TO_EXCLUDE TRUE)
+ ENDIF()
+ ENDIF()
+ IF(TO_EXCLUDE)
+ MESSAGE(STATUS "excluding file: ${rel}")
+ ELSE()
+ MAKE_WIX_IDENTIFIER("${rel}" id)
+ FILE(TO_NATIVE_PATH ${f} f_native)
+ GET_FILENAME_COMPONENT(f_ext "${f}" EXT)
+ # According to MSDN each DLL or EXE should be in the own component
+ IF(f_ext MATCHES ".exe" OR f_ext MATCHES ".dll")
+
+ FILE(APPEND ${file} " <Component Id='C.${id}' Guid='*' ${Win64}>\n")
+ FILE(APPEND ${file} " <File Id='F.${id}' KeyPath='yes' Source='${f_native}'/>\n")
+ FILE(APPEND ${file} " </Component>\n")
+ FILE(APPEND ${file_comp} " <ComponentRef Id='C.${id}'/>\n")
+ ELSE()
+ SET(NONEXEFILES "${NONEXEFILES}\n<File Id='F.${id}' Source='${f_native}'/>" )
+ ENDIF()
ENDIF()
ENDIF()
ENDFOREACH()
@@ -241,18 +289,18 @@ ENDFUNCTION()
FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix)
FILE(RELATIVE_PATH rel ${topdir} ${dir})
- IF(rel AND IS_DIRECTORY "${f}")
+ IF(rel)
MAKE_WIX_IDENTIFIER("${rel}" id)
GET_FILENAME_COMPONENT(name ${dir} NAME)
FILE(APPEND ${file} "${prefix}<Directory Id='D.${id}' Name='${name}'>\n")
ENDIF()
FILE(GLOB all_files ${dir}/*)
- FOREACH(f ${all_files})
+ FOREACH(f ${all_files})
IF(IS_DIRECTORY ${f})
TRAVERSE_DIRECTORIES(${f} ${topdir} ${file} "${prefix} ")
ENDIF()
ENDFOREACH()
- IF(rel AND IS_DIRECTORY "${f}")
+ IF(rel)
FILE(APPEND ${file} "${prefix}</Directory>\n")
ENDIF()
ENDFUNCTION()
@@ -311,10 +359,25 @@ ENDIF()
FILE(REMOVE mysql_server.wixobj)
EXECUTE_PROCESS(
COMMAND ${CANDLE_EXECUTABLE} -ext WixUtilExtension mysql_server.wxs ${EXTRA_CANDLE_ARGS}
+ RESULT_VARIABLE CANDLE_RESULT
)
+
+IF(CANDLE_RESULT)
+ MESSAGE(FATAL_ERROR "ERROR: can't run candle")
+ENDIF()
+
EXECUTE_PROCESS(
COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension -ext WixUtilExtension
mysql_server.wixobj -out ${CPACK_PACKAGE_FILE_NAME}.msi
${EXTRA_LIGHT_ARGS}
+ RESULT_VARIABLE LIGHT_RESULT
)
+IF(LIGHT_RESULT)
+ MESSAGE(FATAL_ERROR "ERROR: can't run light")
+ENDIF()
+
+# Switch monolithic install on again
+EXECUTE_PROCESS(
+ COMMAND ${CMAKE_COMMAND} -DCPACK_MONOLITHIC_INSTALL=1 ${CMAKE_BINARY_DIR}
+)
diff --git a/packaging/WiX/custom_ui.wxs b/packaging/WiX/custom_ui.wxs
index 90db5c416fe..1dc1ef28e4f 100644
--- a/packaging/WiX/custom_ui.wxs
+++ b/packaging/WiX/custom_ui.wxs
@@ -1,7 +1,22 @@
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
- <WixVariable Id="WixUICostingPopupOptOut" Value="1" Overridable="yes" />
<UI Id="WixUI_Mondo_Custom">
+ <Dialog Id="CustomWelcomeDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
+ <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
+ <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
+ </Control>
+ <Control Id="Next" Type="PushButton" X="220" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
+ <Publish Event="NewDialog" Value="LicenseAgreementDlg">NOT OLDERVERSIONBEINGUPGRADED</Publish>
+ <Publish Event="NewDialog" Value="UpgradeDlg">OLDERVERSIONBEINGUPGRADED</Publish>
+ </Control>
+ <Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" Disabled="yes" />
+ <Control Id="Description" Type="Text" X="135" Y="80" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgDescription)" />
+ <Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgTitle)" />
+ <Control Id="CopyrightText" Type="Text" X="135" Y="200" Width="220" Height="40" Transparent="yes" Text="Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved." />
+ <Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeDlgBitmap)" />
+ <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
+ </Dialog>
+
<Dialog Id="UpgradeDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes" Text="Upgrade">
<Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
@@ -47,10 +62,7 @@
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
- <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg" Order="1">NOT OLDERVERSIONBEINGUPGRADED</Publish>
- <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="UpgradeDlg" Order="2">OLDERVERSIONBEINGUPGRADED</Publish>
-
- <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
+ <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="CustomWelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="SetupTypeDlg" Order="2">LicenseAccepted = "1"</Publish>
<Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
@@ -74,7 +86,11 @@
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
- <Publish Dialog="UpgradeDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
+ <Publish Dialog="UpgradeDlg" Control="Back" Event="NewDialog" Value="CustomWelcomeDlg">1</Publish>
+
+ <InstallUISequence>
+ <Show Dialog="CustomWelcomeDlg" Before="ProgressDlg">NOT Installed</Show>
+ </InstallUISequence>
</UI>
<UIRef Id="WixUI_Common" />
diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in
index 59cc817a302..43a30538384 100644
--- a/packaging/WiX/mysql_server.wxs.in
+++ b/packaging/WiX/mysql_server.wxs.in
@@ -4,7 +4,7 @@
Id="*"
UpgradeCode="49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3"
Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@"
- Version="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@"
+ Version="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"
Language="1033"
Manufacturer="@MANUFACTURER@">
@@ -25,12 +25,12 @@
<UpgradeVersion
Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.0"
IncludeMinimum="yes"
- Maximum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@"
+ Maximum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"
Property="OLDERVERSIONBEINGUPGRADED"
MigrateFeatures="yes"
/>
<UpgradeVersion
- Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@"
+ Minimum="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@"
OnlyDetect="yes"
Property="NEWERVERSIONDETECTED" />
</Upgrade>
@@ -128,10 +128,10 @@
Impersonate="no"
Return="check" />
<InstallExecuteSequence>
- <Custom Action="UnregisterProperty" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE</Custom>
- <Custom Action="UnregisterPropertySilent" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE</Custom>
- <Custom Action="UnregisterService" After="UnregisterProperty">Installed And Not UPGRADINGPRODUCTCODE And UILevel&gt;4</Custom>
- <Custom Action="UnregisterServiceSilently" After="UnregisterPropertySilent">Installed And Not UPGRADINGPRODUCTCODE And UILevel&lt;=4</Custom>
+ <Custom Action="UnregisterProperty" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL"</Custom>
+ <Custom Action="UnregisterPropertySilent" After="InstallInitialize">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL"</Custom>
+ <Custom Action="UnregisterService" After="UnregisterProperty">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel&gt;4</Custom>
+ <Custom Action="UnregisterServiceSilently" After="UnregisterPropertySilent">Installed And Not UPGRADINGPRODUCTCODE And REMOVE="ALL" And UILevel&lt;=4</Custom>
</InstallExecuteSequence>
<!-- Installation root-->
@@ -160,4 +160,4 @@
@CPACK_WIX_INCLUDES@
</Product>
-</Wix> \ No newline at end of file
+</Wix>
diff --git a/plugin/Makefile.am b/plugin/Makefile.am
deleted file mode 100644
index d5f0651d4bc..00000000000
--- a/plugin/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2005-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-# Process this file with automake to create Makefile.in
-
-AUTOMAKE_OPTIONS = foreign
-
-# extra plugin example files are listed here, to
-# keep its Makefile.am cleaner as a template
-EXTRA_DIST = fulltext/configure.in
-
-SUBDIRS = @mysql_pg_dirs@
-DIST_SUBDIRS = @mysql_pg_distdirs@
-
diff --git a/plugin/audit_null/Makefile.am b/plugin/audit_null/Makefile.am
deleted file mode 100644
index 4408c3f7c47..00000000000
--- a/plugin/audit_null/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#Makefile.am example for a plugin
-
-pkgplugindir= $(pkglibdir)/plugin
-
-AM_CPPFLAGS = -I$(top_srcdir)/include
-
-EXTRA_LTLIBRARIES= adt_null.la
-pkgplugin_LTLIBRARIES= @plugin_audit_null_shared_target@
-adt_null_la_LDFLAGS= -module -rpath $(pkgplugindir)
-adt_null_la_CPPFLAGS= $(AM_CPPFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-adt_null_la_SOURCES= audit_null.c
-
-EXTRA_LIBRARIES= libadtnull.a
-noinst_LIBRARIES= @plugin_audit_null_static_target@
-libadtnull_a_SOURCES= audit_null.c
-
-EXTRA_DIST= plug.in CMakeLists.txt
diff --git a/plugin/audit_null/audit_null.c b/plugin/audit_null/audit_null.c
index 4d231d3e39b..161bd1cea70 100644
--- a/plugin/audit_null/audit_null.c
+++ b/plugin/audit_null/audit_null.c
@@ -81,11 +81,12 @@ static int audit_null_plugin_deinit(void *arg __attribute__((unused)))
*/
static void audit_null_notify(MYSQL_THD thd __attribute__((unused)),
- const struct mysql_event *event)
+ unsigned int event_class,
+ const void *event)
{
/* prone to races, oh well */
number_of_calls++;
- if (event->event_class == MYSQL_AUDIT_GENERAL_CLASS)
+ if (event_class == MYSQL_AUDIT_GENERAL_CLASS)
{
const struct mysql_event_general *event_general=
(const struct mysql_event_general *) event;
diff --git a/plugin/audit_null/plug.in b/plugin/audit_null/plug.in
deleted file mode 100644
index 15b1a48b408..00000000000
--- a/plugin/audit_null/plug.in
+++ /dev/null
@@ -1,4 +0,0 @@
-MYSQL_PLUGIN(audit_null, [NULL Audit Plug-in],
- [Simple black-hole Audit example plug-in])
-MYSQL_PLUGIN_DYNAMIC(audit_null, [adt_null.la])
-MYSQL_PLUGIN_STATIC(audit_null, [libadtnull.a])
diff --git a/plugin/auth/CMakeLists.txt b/plugin/auth/CMakeLists.txt
index cc842f69441..6a9c31f82ce 100644
--- a/plugin/auth/CMakeLists.txt
+++ b/plugin/auth/CMakeLists.txt
@@ -1,4 +1,30 @@
-MYSQL_ADD_PLUGIN(auth dialog.c
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# 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
+
+MYSQL_ADD_PLUGIN(auth dialog.c
+ MODULE_ONLY)
+MYSQL_ADD_PLUGIN(auth_test_plugin test_plugin.c
+ MODULE_ONLY)
+MYSQL_ADD_PLUGIN(qa_auth_interface qa_auth_interface.c
+ MODULE_ONLY)
+
+MYSQL_ADD_PLUGIN(qa_auth_server qa_auth_server.c
+ MODULE_ONLY)
+
+MYSQL_ADD_PLUGIN(qa_auth_client qa_auth_client.c
MODULE_ONLY)
CHECK_CXX_SOURCE_COMPILES(
@@ -12,4 +38,4 @@ int main() {
IF(HAVE_PEERCRED)
MYSQL_ADD_PLUGIN(auth_socket auth_socket.c
MODULE_ONLY)
-ENDIF(HAVE_PEERCRED)
+ENDIF()
diff --git a/plugin/auth/Makefile.am b/plugin/auth/Makefile.am
deleted file mode 100644
index acca98e26f8..00000000000
--- a/plugin/auth/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-pkgplugindir=$(pkglibdir)/plugin
-
-AM_LDFLAGS=-module -rpath $(pkgplugindir)
-AM_CPPFLAGS=-DMYSQL_DYNAMIC_PLUGIN -I$(top_srcdir)/include
-
-pkgplugin_LTLIBRARIES= dialog.la
-dialog_la_SOURCES= dialog.c
-
-if HAVE_PEERCRED
-pkgplugin_LTLIBRARIES+= auth_socket.la
-auth_socket_la_SOURCES= auth_socket.c
-endif
-
-EXTRA_DIST= plug.in
-
diff --git a/plugin/auth/auth_socket.c b/plugin/auth/auth_socket.c
index cc406dac331..00e86bb25cf 100644
--- a/plugin/auth/auth_socket.c
+++ b/plugin/auth/auth_socket.c
@@ -1,22 +1,24 @@
/* Copyright (C) 2010 Sergei Golubchik and Monty Program 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 */
+ Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+
+ 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 */
/**
@file
- socket_peercred authentication plugin.
+ auth_socket authentication plugin.
Authentication is successful if the connection is done via a unix socket and
the owner of the client process matches the user name that was used when
@@ -54,7 +56,7 @@ static int socket_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
return CR_ERROR;
}
- info->password_used = 0;
+ info->password_used= PASSWORD_USED_NO_MENTION;
vio->info(vio, &vio_info);
if (vio_info.protocol != MYSQL_VIO_SOCKET)
@@ -87,7 +89,7 @@ mysql_declare_plugin(socket_auth)
{
MYSQL_AUTHENTICATION_PLUGIN,
&socket_auth_handler,
- "socket_peercred",
+ "auth_socket",
"Sergei Golubchik",
"Unix Socket based authentication",
PLUGIN_LICENSE_GPL,
@@ -103,7 +105,7 @@ maria_declare_plugin(socket_auth)
{
MYSQL_AUTHENTICATION_PLUGIN,
&socket_auth_handler,
- "socket_peercred",
+ "auth_socket",
"Sergei Golubchik",
"Unix Socket based authentication",
PLUGIN_LICENSE_GPL,
diff --git a/plugin/auth/dialog.c b/plugin/auth/dialog.c
index 72c6364f49a..f496d454256 100644
--- a/plugin/auth/dialog.c
+++ b/plugin/auth/dialog.c
@@ -1,17 +1,19 @@
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
+ Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- 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 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.
+ 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 */
+ 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 */
/**
@file
@@ -33,7 +35,9 @@
a correct password. It shows the situation when a number of questions
is not known in advance.
*/
-#define _GNU_SOURCE /* for RTLD_DEFAULT */
+#if defined (WIN32) && !defined (RTLD_DEFAULT)
+# define RTLD_DEFAULT GetModuleHandle(NULL)
+#endif
#include <mysql/plugin_auth.h>
#include <mysql/client_plugin.h>
@@ -41,9 +45,13 @@
#include <stdio.h>
#include <stdlib.h>
+#if !defined (_GNU_SOURCE)
+# define _GNU_SOURCE /* for RTLD_DEFAULT */
+#endif
+
/**
first byte of the question string is the question "type".
- It can be a "ordinary" or a "password" question.
+ It can be an "ordinary" or a "password" question.
The last bit set marks a last question in the authentication exchange.
*/
#define ORDINARY_QUESTION "\2"
@@ -51,14 +59,11 @@
#define PASSWORD_QUESTION "\4"
#define LAST_PASSWORD "\5"
-typedef unsigned char uchar;
-
/********************* SERVER SIDE ****************************************/
/**
- dialog demo with two questions, one password and one ordinary.
+ dialog demo with two questions, one password and one, the last, ordinary.
*/
-
static int two_questions(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
{
unsigned char *pkt;
@@ -66,7 +71,7 @@ static int two_questions(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
/* send a password question */
if (vio->write_packet(vio,
- (const uchar*) (PASSWORD_QUESTION "Password, please:"),
+ (const unsigned char *) PASSWORD_QUESTION "Password, please:",
18))
return CR_ERROR;
@@ -74,15 +79,16 @@ static int two_questions(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
if ((pkt_len= vio->read_packet(vio, &pkt)) < 0)
return CR_ERROR;
- info->password_used = 1;
+ info->password_used= PASSWORD_USED_YES;
/* fail if the password is wrong */
- if (strcmp((char*) pkt, info->auth_string))
+ if (strcmp((const char *) pkt, info->auth_string))
return CR_ERROR;
/* send the last, ordinary, question */
if (vio->write_packet(vio,
- (const uchar*) (LAST_QUESTION "Are you sure ?"), 15))
+ (const unsigned char *) LAST_QUESTION "Are you sure ?",
+ 15))
return CR_ERROR;
/* read the answer */
@@ -90,7 +96,7 @@ static int two_questions(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
return CR_ERROR;
/* check the reply */
- return strcmp((char*) pkt, "yes, of course") ? CR_ERROR : CR_OK;
+ return strcmp((const char *) pkt, "yes, of course") ? CR_ERROR : CR_OK;
}
static struct st_mysql_auth two_handler=
@@ -100,11 +106,7 @@ static struct st_mysql_auth two_handler=
two_questions
};
-
-/**
- dialog demo where the number of questions is not known in advance
-*/
-
+/* dialog demo where the number of questions is not known in advance */
static int three_attempts(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
{
unsigned char *pkt;
@@ -113,21 +115,21 @@ static int three_attempts(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
for (i= 0; i < 3; i++)
{
/* send the prompt */
- if (vio->write_packet(vio,
- (const uchar*) (PASSWORD_QUESTION "Password, please:"), 18))
+ if (vio->write_packet(vio,
+ (const unsigned char *) PASSWORD_QUESTION "Password, please:", 18))
return CR_ERROR;
/* read the password */
if ((pkt_len= vio->read_packet(vio, &pkt)) < 0)
return CR_ERROR;
- info->password_used = 1;
+ info->password_used= PASSWORD_USED_YES;
/*
finish, if the password is correct.
note, that we did not mark the prompt packet as "last"
*/
- if (strcmp((char*) pkt, info->auth_string) == 0)
+ if (strcmp((const char *) pkt, info->auth_string) == 0)
return CR_OK;
}
@@ -171,50 +173,18 @@ mysql_declare_plugin(dialog)
NULL
}
mysql_declare_plugin_end;
-maria_declare_plugin(dialog)
-{
- MYSQL_AUTHENTICATION_PLUGIN,
- &two_handler,
- "two_questions",
- "Sergei Golubchik",
- "Dialog plugin demo 1",
- PLUGIN_LICENSE_GPL,
- NULL,
- NULL,
- 0x0100,
- NULL,
- NULL,
- "1.0",
- MariaDB_PLUGIN_MATURITY_BETA
-},
-{
- MYSQL_AUTHENTICATION_PLUGIN,
- &three_handler,
- "three_attempts",
- "Sergei Golubchik",
- "Dialog plugin demo 2",
- PLUGIN_LICENSE_GPL,
- NULL,
- NULL,
- 0x0100,
- NULL,
- NULL,
- "1.0",
- MariaDB_PLUGIN_MATURITY_BETA
-}
-maria_declare_plugin_end;
/********************* CLIENT SIDE ***************************************/
/*
This plugin performs a dialog with the user, asking questions and
reading answers. Depending on the client it may be desirable to do it
using GUI, or console, with or without curses, or read answers
- from a smardcard, for example.
+ from a smartcard, for example.
To support all this variety, the dialog plugin has a callback function
"authentication_dialog_ask". If the client has a function of this name
dialog plugin will use it for communication with the user. Otherwise
- a default gets() based implementation will be used.
+ a default fgets() based implementation will be used.
*/
#include <mysql.h>
#include <dlfcn.h>
@@ -226,21 +196,17 @@ static char *builtin_ask(MYSQL *mysql __attribute__((unused)),
const char *prompt,
char *buf, int buf_len)
{
- int len;
-
+ char *ptr;
fputs(prompt, stdout);
fputc(' ', stdout);
- if (fgets(buf, buf_len, stdin) == 0)
- return 0;
-
- len= strlen(buf);
- if (len && buf[len-1]=='\n')
- buf[len-1]=0;
+ if (fgets(buf, buf_len, stdin) == NULL)
+ return NULL;
+ if ((ptr= strchr(buf, '\n')))
+ *ptr= 0;
return buf;
}
-
/**
The main function of the dialog plugin.
@@ -257,7 +223,6 @@ static char *builtin_ask(MYSQL *mysql __attribute__((unused)),
and whether the input is a password (not echoed).
3. the prompt is expected to be sent zero-terminated
*/
-
static int perform_dialog(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
{
unsigned char *pkt, cmd= 0;
@@ -277,7 +242,7 @@ static int perform_dialog(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
in mysql_change_user() the client sends the first packet, so
the first vio->read_packet() does nothing (pkt == 0).
- We send the "password", assuming the client knows what its doing.
+ We send the "password", assuming the client knows what it's doing.
(in other words, the dialog plugin should be only set as a default
authentication plugin on the client if the first question
asks for a password - which will be sent in clear text, by the way)
@@ -299,12 +264,14 @@ static int perform_dialog(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
if ((cmd >> 1) == 2 && *pkt == 0)
reply= mysql->passwd;
else
- reply= ask(mysql, cmd >> 1, (char*) pkt, reply_buf, sizeof(reply_buf));
+ reply= ask(mysql, cmd >> 1, (const char *) pkt,
+ reply_buf, sizeof(reply_buf));
if (!reply)
return CR_ERROR;
}
/* send the reply to the server */
- res= vio->write_packet(vio, (uchar*) reply, strlen(reply)+1);
+ res= vio->write_packet(vio, (const unsigned char *) reply,
+ strlen(reply)+1);
if (reply != mysql->passwd && reply != reply_buf)
free(reply);
@@ -319,7 +286,6 @@ static int perform_dialog(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
return CR_OK;
}
-
/**
initialization function of the dialog plugin
@@ -327,10 +293,13 @@ static int perform_dialog(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
or fall back to the default implementation.
*/
-static int init_dialog()
+static int init_dialog(char *unused1 __attribute__((unused)),
+ size_t unused2 __attribute__((unused)),
+ int unused3 __attribute__((unused)),
+ va_list unused4 __attribute__((unused)))
{
void *sym= dlsym(RTLD_DEFAULT, "mysql_authentication_dialog_ask");
- ask= sym ? (mysql_authentication_dialog_ask_t)sym : builtin_ask;
+ ask= sym ? (mysql_authentication_dialog_ask_t) sym : builtin_ask;
return 0;
}
@@ -339,8 +308,11 @@ mysql_declare_client_plugin(AUTHENTICATION)
"Sergei Golubchik",
"Dialog Client Authentication Plugin",
{0,1,0},
+ "GPL",
+ NULL,
init_dialog,
NULL,
+ NULL,
perform_dialog
mysql_end_client_plugin;
diff --git a/plugin/auth/plug.in b/plugin/auth/plug.in
deleted file mode 100644
index ce31465b056..00000000000
--- a/plugin/auth/plug.in
+++ /dev/null
@@ -1,15 +0,0 @@
-MYSQL_PLUGIN(auth, [Collection of Authentication Plugins],
- [Collection of Authentication Plugins])
-MYSQL_PLUGIN_DYNAMIC(auth, [dialog.la])
-MYSQL_PLUGIN_ACTIONS(auth,[
-AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#define _GNU_SOURCE
-#include <sys/socket.h>
-]],[[
- struct ucred cred;
- getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, 0);
-]])],have_peercred=yes)
-AM_CONDITIONAL(HAVE_PEERCRED, test x$have_peercred = xyes)
-])
-AM_CONDITIONAL(HAVE_PEERCRED, false)
diff --git a/plugin/auth/qa_auth_client.c b/plugin/auth/qa_auth_client.c
new file mode 100644
index 00000000000..da7bfc14a73
--- /dev/null
+++ b/plugin/auth/qa_auth_client.c
@@ -0,0 +1,127 @@
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+
+ 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 <mysql/plugin_auth.h>
+#include <mysql/client_plugin.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/**
+ first byte of the question string is the question "type".
+ It can be a "ordinary" or a "password" question.
+ The last bit set marks a last question in the authentication exchange.
+*/
+#define ORDINARY_QUESTION "\2"
+#define LAST_QUESTION "\3"
+#define LAST_PASSWORD "\4"
+#define PASSWORD_QUESTION "\5"
+
+/********************* CLIENT SIDE ***************************************/
+/*
+ client plugin used for testing the plugin API
+*/
+#include <mysql.h>
+
+/**
+ The main function of the test plugin.
+
+ Reads the prompt, check if the handshake is done and if the prompt is a
+ password request and returns the password. Otherwise return error.
+
+ @note
+ 1. this plugin shows how a client authentication plugin
+ may read a MySQL protocol OK packet internally - which is important
+ where a number of packets is not known in advance.
+ 2. the first byte of the prompt is special. it is not
+ shown to the user, but signals whether it is the last question
+ (prompt[0] & 1 == 1) or not last (prompt[0] & 1 == 0),
+ and whether the input is a password (not echoed).
+ 3. the prompt is expected to be sent zero-terminated
+*/
+static int test_plugin_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
+{
+ unsigned char *pkt, cmd= 0;
+ int pkt_len, res;
+ char *reply;
+
+ do
+ {
+ /* read the prompt */
+ pkt_len= vio->read_packet(vio, &pkt);
+ if (pkt_len < 0)
+ return CR_ERROR;
+
+ if (pkt == 0)
+ {
+ /*
+ in mysql_change_user() the client sends the first packet, so
+ the first vio->read_packet() does nothing (pkt == 0).
+
+ We send the "password", assuming the client knows what its doing.
+ (in other words, the dialog plugin should be only set as a default
+ authentication plugin on the client if the first question
+ asks for a password - which will be sent in cleat text, by the way)
+ */
+ reply= mysql->passwd;
+ }
+ else
+ {
+ cmd= *pkt++;
+
+ /* is it MySQL protocol (0=OK or 254=need old password) packet ? */
+ if (cmd == 0 || cmd == 254)
+ return CR_OK_HANDSHAKE_COMPLETE; /* yes. we're done */
+
+ /*
+ asking for a password with an empty prompt means mysql->password
+ otherwise return an error
+ */
+ if ((cmd == LAST_PASSWORD[0] || cmd == PASSWORD_QUESTION[0]) && *pkt == 0)
+ reply= mysql->passwd;
+ else
+ return CR_ERROR;
+ }
+ if (!reply)
+ return CR_ERROR;
+ /* send the reply to the server */
+ res= vio->write_packet(vio, (const unsigned char *) reply,
+ strlen(reply) + 1);
+
+ if (res)
+ return CR_ERROR;
+
+ /* repeat unless it was the last question */
+ } while (cmd != LAST_QUESTION[0] && cmd != PASSWORD_QUESTION[0]);
+
+ /* the job of reading the ok/error packet is left to the server */
+ return CR_OK;
+}
+
+
+mysql_declare_client_plugin(AUTHENTICATION)
+ "qa_auth_client",
+ "Horst Hunger",
+ "Dialog Client Authentication Plugin",
+ {0,1,0},
+ "GPL",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ test_plugin_client
+mysql_end_client_plugin;
diff --git a/plugin/auth/qa_auth_interface.c b/plugin/auth/qa_auth_interface.c
new file mode 100644
index 00000000000..0aa6c9ce20c
--- /dev/null
+++ b/plugin/auth/qa_auth_interface.c
@@ -0,0 +1,262 @@
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+
+ 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 <mysql/plugin_auth.h>
+#include <mysql/client_plugin.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/**
+ first byte of the question string is the question "type".
+ It can be a "ordinary" or a "password" question.
+ The last bit set marks a last question in the authentication exchange.
+*/
+#define ORDINARY_QUESTION "\2"
+#define LAST_QUESTION "\3"
+#define LAST_PASSWORD "\4"
+#define PASSWORD_QUESTION "\5"
+
+/********************* SERVER SIDE ****************************************/
+
+static int qa_auth_interface (MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
+{
+ unsigned char *pkt;
+ int pkt_len, err= CR_OK;
+
+ /* send a password question */
+ if (vio->write_packet(vio, (const unsigned char *) PASSWORD_QUESTION, 1))
+ return CR_ERROR;
+
+ /* read the answer */
+ if ((pkt_len= vio->read_packet(vio, &pkt)) < 0)
+ return CR_ERROR;
+
+ info->password_used= PASSWORD_USED_YES;
+
+ /* fail if the password is wrong */
+ if (strcmp((const char *) pkt, info->auth_string))
+ return CR_ERROR;
+
+/* Check the contens of components of info */
+ if (strcmp(info->user_name, "qa_test_1_user")== 0)
+ {
+ if (info->user_name_length != 14)
+ err= CR_ERROR;
+ if (strcmp(info->auth_string, "qa_test_1_dest"))
+ err= CR_ERROR;
+ if (info->auth_string_length != 14)
+ err= CR_ERROR;
+/* To be set by the plugin */
+// if (strcmp(info->authenticated_as, "qa_test_1_user"))
+// err= CR_ERROR;
+/* To be set by the plugin */
+// if (strcmp(info->external_user, ""))
+// err= CR_ERROR;
+ if (info->password_used != PASSWORD_USED_YES)
+ err= CR_ERROR;
+ if (strcmp(info->host_or_ip, "localhost"))
+ err= CR_ERROR;
+ if (info->host_or_ip_length != 9)
+ err= CR_ERROR;
+ }
+/* Assign values to the components of info even if not intended and watch the effect */
+ else if (strcmp(info->user_name, "qa_test_2_user")== 0)
+ {
+ /* Overwriting not intended, but with effect on USER() */
+ strcpy(info->user_name, "user_name");
+ info->user_name_length= 9;
+ /* Overwriting not intended, effect not visible */
+ strcpy((char *)info->auth_string, "auth_string");
+ info->auth_string_length= 11;
+ /* Assign with account for authorization, effect on CURRENT_USER() */
+ strcpy(info->authenticated_as, "authenticated_as");
+ /* Assign with an external account, effect on @@local.EXTERNAL_USER */
+ strcpy(info->external_user, "externaluser");
+ /* Overwriting will cause a core dump */
+// strcpy(info->host_or_ip, "host_or_ip");
+// info->host_or_ip_length= 10;
+ }
+/* Invalid, means too high values for length */
+ else if (strcmp(info->user_name, "qa_test_3_user")== 0)
+ {
+/* Original value is 14. Test runs also with higher value. Changes have no effect.*/
+ info->user_name_length= 28;
+ strcpy((char *)info->auth_string, "qa_test_3_dest");
+/* Original value is 14. Test runs also with higher value. Changes have no effect.*/
+ info->auth_string_length= 28;
+ strcpy(info->authenticated_as, info->auth_string);
+ strcpy(info->external_user, info->auth_string);
+ }
+/* Invalid, means too low values for length */
+ else if (strcmp(info->user_name, "qa_test_4_user")== 0)
+ {
+/* Original value is 14. Test runs also with lower value. Changes have no effect.*/
+ info->user_name_length= 8;
+ strcpy((char *)info->auth_string, "qa_test_4_dest");
+/* Original value is 14. Test runs also with lower value. Changes have no effect.*/
+ info->auth_string_length= 8;
+ strcpy(info->authenticated_as, info->auth_string);
+ strcpy(info->external_user, info->auth_string);
+ }
+/* Overwrite with empty values */
+ else if (strcmp(info->user_name, "qa_test_5_user")== 0)
+ {
+/* This assignment has no effect.*/
+ strcpy(info->user_name, "");
+ info->user_name_length= 0;
+/* This assignment has no effect.*/
+ strcpy((char *)info->auth_string, "");
+ info->auth_string_length= 0;
+/* This assignment caused an error or an "empty" user */
+ strcpy(info->authenticated_as, "");
+/* This assignment has no effect.*/
+ strcpy(info->external_user, "");
+ /* Overwriting will cause a core dump */
+// strcpy(info->host_or_ip, "");
+// info->host_or_ip_length= 0;
+ }
+/* Set to 'root' */
+ else if (strcmp(info->user_name, "qa_test_6_user")== 0)
+ {
+ strcpy(info->authenticated_as, "root");
+ }
+ else
+ {
+ err= CR_ERROR;
+ }
+ return err;
+}
+
+static struct st_mysql_auth qa_auth_test_handler=
+{
+ MYSQL_AUTHENTICATION_INTERFACE_VERSION,
+ "qa_auth_interface", /* requires test_plugin client's plugin */
+ qa_auth_interface
+};
+
+mysql_declare_plugin(test_plugin)
+{
+ MYSQL_AUTHENTICATION_PLUGIN,
+ &qa_auth_test_handler,
+ "qa_auth_interface",
+ "Horst Hunger",
+ "plugin API test plugin",
+ PLUGIN_LICENSE_GPL,
+ NULL,
+ NULL,
+ 0x0100,
+ NULL,
+ NULL,
+ NULL
+}
+mysql_declare_plugin_end;
+
+/********************* CLIENT SIDE ***************************************/
+/*
+ client plugin used for testing the plugin API
+*/
+#include <mysql.h>
+
+/**
+ The main function of the test plugin.
+
+ Reads the prompt, check if the handshake is done and if the prompt is a
+ password request and returns the password. Otherwise return error.
+
+ @note
+ 1. this plugin shows how a client authentication plugin
+ may read a MySQL protocol OK packet internally - which is important
+ where a number of packets is not known in advance.
+ 2. the first byte of the prompt is special. it is not
+ shown to the user, but signals whether it is the last question
+ (prompt[0] & 1 == 1) or not last (prompt[0] & 1 == 0),
+ and whether the input is a password (not echoed).
+ 3. the prompt is expected to be sent zero-terminated
+*/
+static int test_plugin_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
+{
+ unsigned char *pkt, cmd= 0;
+ int pkt_len, res;
+ char *reply;
+
+ do
+ {
+ /* read the prompt */
+ pkt_len= vio->read_packet(vio, &pkt);
+ if (pkt_len < 0)
+ return CR_ERROR;
+
+ if (pkt == 0)
+ {
+ /*
+ in mysql_change_user() the client sends the first packet, so
+ the first vio->read_packet() does nothing (pkt == 0).
+
+ We send the "password", assuming the client knows what its doing.
+ (in other words, the dialog plugin should be only set as a default
+ authentication plugin on the client if the first question
+ asks for a password - which will be sent in cleat text, by the way)
+ */
+ reply= mysql->passwd;
+ }
+ else
+ {
+ cmd= *pkt++;
+
+ /* is it MySQL protocol (0=OK or 254=need old password) packet ? */
+ if (cmd == 0 || cmd == 254)
+ return CR_OK_HANDSHAKE_COMPLETE; /* yes. we're done */
+
+ /*
+ asking for a password with an empty prompt means mysql->password
+ otherwise return an error
+ */
+ if ((cmd == LAST_PASSWORD[0] || cmd == PASSWORD_QUESTION[0]) && *pkt == 0)
+ reply= mysql->passwd;
+ else
+ return CR_ERROR;
+ }
+ if (!reply)
+ return CR_ERROR;
+ /* send the reply to the server */
+ res= vio->write_packet(vio, (const unsigned char *) reply,
+ strlen(reply) + 1);
+
+ if (res)
+ return CR_ERROR;
+
+ /* repeat unless it was the last question */
+ } while (cmd != LAST_QUESTION[0] && cmd != PASSWORD_QUESTION[0]);
+
+ /* the job of reading the ok/error packet is left to the server */
+ return CR_OK;
+}
+
+
+mysql_declare_client_plugin(AUTHENTICATION)
+ "qa_auth_interface",
+ "Horst Hunger",
+ "Dialog Client Authentication Plugin",
+ {0,1,0},
+ "GPL",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ test_plugin_client
+mysql_end_client_plugin;
diff --git a/plugin/auth/qa_auth_server.c b/plugin/auth/qa_auth_server.c
new file mode 100644
index 00000000000..17171610200
--- /dev/null
+++ b/plugin/auth/qa_auth_server.c
@@ -0,0 +1,87 @@
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+
+ 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 <mysql/plugin_auth.h>
+#include <mysql/client_plugin.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/**
+ first byte of the question string is the question "type".
+ It can be a "ordinary" or a "password" question.
+ The last bit set marks a last question in the authentication exchange.
+*/
+#define ORDINARY_QUESTION "\2"
+#define LAST_QUESTION "\3"
+#define LAST_PASSWORD "\4"
+#define PASSWORD_QUESTION "\5"
+
+/********************* SERVER SIDE ****************************************/
+
+static int qa_auth_interface (MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
+{
+ unsigned char *pkt;
+ int pkt_len, err= CR_OK;
+
+ /* send a password question */
+ if (vio->write_packet(vio, (const unsigned char *) PASSWORD_QUESTION, 1))
+ return CR_ERROR;
+
+ /* read the answer */
+ if ((pkt_len= vio->read_packet(vio, &pkt)) < 0)
+ return CR_ERROR;
+
+ info->password_used= PASSWORD_USED_YES;
+
+ /* fail if the password is wrong */
+ if (strcmp((const char *) pkt, info->auth_string))
+ return CR_ERROR;
+
+/* Test of default_auth */
+ if (strcmp(info->user_name, "qa_test_11_user")== 0)
+ {
+ strcpy(info->authenticated_as, "qa_test_11_dest");
+ }
+ else
+ err= CR_ERROR;
+ return err;
+}
+
+static struct st_mysql_auth qa_auth_test_handler=
+{
+ MYSQL_AUTHENTICATION_INTERFACE_VERSION,
+ "qa_auth_interface", /* requires test_plugin client's plugin */
+ qa_auth_interface
+};
+
+mysql_declare_plugin(test_plugin)
+{
+ MYSQL_AUTHENTICATION_PLUGIN,
+ &qa_auth_test_handler,
+ "qa_auth_server",
+ "Horst Hunger",
+ "plugin API test plugin",
+ PLUGIN_LICENSE_GPL,
+ NULL,
+ NULL,
+ 0x0100,
+ NULL,
+ NULL,
+ NULL
+}
+mysql_declare_plugin_end;
diff --git a/plugin/auth/test_plugin.c b/plugin/auth/test_plugin.c
new file mode 100644
index 00000000000..d38b2782285
--- /dev/null
+++ b/plugin/auth/test_plugin.c
@@ -0,0 +1,240 @@
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+
+ 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 */
+
+/**
+ @file
+
+ Test driver for the mysql-test/t/plugin_auth.test
+
+ This is a set of test plugins used to test the external authentication
+ implementation.
+ See the above test file for more details.
+ This test plugin is based on the dialog plugin example.
+*/
+
+#include <my_global.h>
+#include <mysql/plugin_auth.h>
+#include <mysql/client_plugin.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/**
+ first byte of the question string is the question "type".
+ It can be a "ordinary" or a "password" question.
+ The last bit set marks a last question in the authentication exchange.
+*/
+#define ORDINARY_QUESTION "\2"
+#define LAST_QUESTION "\3"
+#define LAST_PASSWORD "\4"
+#define PASSWORD_QUESTION "\5"
+
+/********************* SERVER SIDE ****************************************/
+
+/**
+ dialog test plugin mimicking the ordinary auth mechanism. Used to test the auth plugin API
+*/
+static int auth_test_plugin(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
+{
+ unsigned char *pkt;
+ int pkt_len;
+
+ /* send a password question */
+ if (vio->write_packet(vio, (const unsigned char *) PASSWORD_QUESTION, 1))
+ return CR_ERROR;
+
+ /* read the answer */
+ if ((pkt_len= vio->read_packet(vio, &pkt)) < 0)
+ return CR_ERROR;
+
+ info->password_used= PASSWORD_USED_YES;
+
+ /* fail if the password is wrong */
+ if (strcmp((const char *) pkt, info->auth_string))
+ return CR_ERROR;
+
+ /* copy auth string as a destination name to check it */
+ strcpy (info->authenticated_as, info->auth_string);
+
+ /* copy something into the external user name */
+ strcpy (info->external_user, info->auth_string);
+
+ return CR_OK;
+}
+
+static struct st_mysql_auth auth_test_handler=
+{
+ MYSQL_AUTHENTICATION_INTERFACE_VERSION,
+ "auth_test_plugin", /* requires test_plugin client's plugin */
+ auth_test_plugin
+};
+
+/**
+ dialog test plugin mimicking the ordinary auth mechanism. Used to test the clear text plugin API
+*/
+static int auth_cleartext_plugin(MYSQL_PLUGIN_VIO *vio,
+ MYSQL_SERVER_AUTH_INFO *info)
+{
+ unsigned char *pkt;
+ int pkt_len;
+
+ /* read the password */
+ if ((pkt_len= vio->read_packet(vio, &pkt)) < 0)
+ return CR_ERROR;
+
+ info->password_used= PASSWORD_USED_YES;
+
+ /* fail if the password is wrong */
+ if (strcmp((const char *) pkt, info->auth_string))
+ return CR_ERROR;
+
+ return CR_OK;
+}
+
+
+static struct st_mysql_auth auth_cleartext_handler=
+{
+ MYSQL_AUTHENTICATION_INTERFACE_VERSION,
+ "mysql_clear_password", /* requires the clear text plugin */
+ auth_cleartext_plugin
+};
+
+mysql_declare_plugin(test_plugin)
+{
+ MYSQL_AUTHENTICATION_PLUGIN,
+ &auth_test_handler,
+ "test_plugin_server",
+ "Georgi Kodinov",
+ "plugin API test plugin",
+ PLUGIN_LICENSE_GPL,
+ NULL,
+ NULL,
+ 0x0100,
+ NULL,
+ NULL,
+ NULL
+},
+{
+ MYSQL_AUTHENTICATION_PLUGIN,
+ &auth_cleartext_handler,
+ "cleartext_plugin_server",
+ "Georgi Kodinov",
+ "cleartext plugin API test plugin",
+ PLUGIN_LICENSE_GPL,
+ NULL,
+ NULL,
+ 0x0100,
+ NULL,
+ NULL,
+ NULL
+}
+mysql_declare_plugin_end;
+
+
+/********************* CLIENT SIDE ***************************************/
+/*
+ client plugin used for testing the plugin API
+*/
+#include <mysql.h>
+
+/**
+ The main function of the test plugin.
+
+ Reads the prompt, check if the handshake is done and if the prompt is a
+ password request and returns the password. Otherwise return error.
+
+ @note
+ 1. this plugin shows how a client authentication plugin
+ may read a MySQL protocol OK packet internally - which is important
+ where a number of packets is not known in advance.
+ 2. the first byte of the prompt is special. it is not
+ shown to the user, but signals whether it is the last question
+ (prompt[0] & 1 == 1) or not last (prompt[0] & 1 == 0),
+ and whether the input is a password (not echoed).
+ 3. the prompt is expected to be sent zero-terminated
+*/
+static int test_plugin_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
+{
+ unsigned char *pkt, cmd= 0;
+ int pkt_len, res;
+ char *reply;
+
+ do
+ {
+ /* read the prompt */
+ pkt_len= vio->read_packet(vio, &pkt);
+ if (pkt_len < 0)
+ return CR_ERROR;
+
+ if (pkt == 0)
+ {
+ /*
+ in mysql_change_user() the client sends the first packet, so
+ the first vio->read_packet() does nothing (pkt == 0).
+
+ We send the "password", assuming the client knows what it's doing.
+ (in other words, the dialog plugin should be only set as a default
+ authentication plugin on the client if the first question
+ asks for a password - which will be sent in clear text, by the way)
+ */
+ reply= mysql->passwd;
+ }
+ else
+ {
+ cmd= *pkt++;
+
+ /* is it MySQL protocol (0=OK or 254=need old password) packet ? */
+ if (cmd == 0 || cmd == 254)
+ return CR_OK_HANDSHAKE_COMPLETE; /* yes. we're done */
+
+ /*
+ asking for a password with an empty prompt means mysql->password
+ otherwise return an error
+ */
+ if ((cmd == LAST_PASSWORD[0] || cmd == PASSWORD_QUESTION[0]) && *pkt == 0)
+ reply= mysql->passwd;
+ else
+ return CR_ERROR;
+ }
+ if (!reply)
+ return CR_ERROR;
+ /* send the reply to the server */
+ res= vio->write_packet(vio, (const unsigned char *) reply,
+ strlen(reply) + 1);
+
+ if (res)
+ return CR_ERROR;
+
+ /* repeat unless it was the last question */
+ } while (cmd != LAST_QUESTION[0] && cmd != PASSWORD_QUESTION[0]);
+
+ /* the job of reading the ok/error packet is left to the server */
+ return CR_OK;
+}
+
+
+mysql_declare_client_plugin(AUTHENTICATION)
+ "auth_test_plugin",
+ "Georgi Kodinov",
+ "Dialog Client Authentication Plugin",
+ {0,1,0},
+ "GPL",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ test_plugin_client
+mysql_end_client_plugin;
diff --git a/plugin/daemon_example/Makefile.am b/plugin/daemon_example/Makefile.am
deleted file mode 100644
index 82278b4685f..00000000000
--- a/plugin/daemon_example/Makefile.am
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#Makefile.am example for a daemon
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(pkglibdir)/plugin
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/sql \
- -I$(srcdir) @ZLIB_INCLUDES@
-
-EXTRA_LTLIBRARIES = libdaemon_example.la
-pkgplugin_LTLIBRARIES = @plugin_daemon_example_shared_target@
-libdaemon_example_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
-libdaemon_example_la_CXXFLAGS= -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-libdaemon_example_la_SOURCES = daemon_example.cc
-
-EXTRA_LIBRARIES = libdaemon_example.a
-noinst_LIBRARIES = @plugin_daemon_example_static_target@
-libdaemon_example_a_CXXFLAGS = $(AM_CXXFLAGS)
-libdaemon_example_a_SOURCES= daemon_example.cc
-EXTRA_DIST = CMakeLists.txt
diff --git a/plugin/daemon_example/configure.in b/plugin/daemon_example/configure.in
deleted file mode 100644
index 8924b7f5bc4..00000000000
--- a/plugin/daemon_example/configure.in
+++ /dev/null
@@ -1,9 +0,0 @@
-# configure.in example for a daemon
-
-AC_INIT(daemon_example, 0.1)
-AM_INIT_AUTOMAKE
-AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-
diff --git a/plugin/daemon_example/plug.in b/plugin/daemon_example/plug.in
deleted file mode 100644
index 72e87a70f59..00000000000
--- a/plugin/daemon_example/plug.in
+++ /dev/null
@@ -1,3 +0,0 @@
-MYSQL_PLUGIN(daemon_example,[Daemon Example Plugin],
- [This is an example plugin daemon.])
-MYSQL_PLUGIN_DYNAMIC(daemon_example, [libdaemon_example.la])
diff --git a/plugin/fulltext/Makefile.am b/plugin/fulltext/Makefile.am
deleted file mode 100644
index 096800d0d30..00000000000
--- a/plugin/fulltext/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2005-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#Makefile.am example for a plugin
-
-pkgplugindir=$(pkglibdir)/plugin
-INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include
-#noinst_LTLIBRARIES= mypluglib.la
-pkgplugin_LTLIBRARIES= mypluglib.la
-mypluglib_la_SOURCES= plugin_example.c
-mypluglib_la_LDFLAGS= -module -rpath $(pkgplugindir)
-mypluglib_la_CFLAGS= -shared -DMYSQL_DYNAMIC_PLUGIN
-EXTRA_DIST= CMakeLists.txt
diff --git a/plugin/fulltext/configure.in b/plugin/fulltext/configure.in
deleted file mode 100644
index 2fefa68727c..00000000000
--- a/plugin/fulltext/configure.in
+++ /dev/null
@@ -1,9 +0,0 @@
-# configure.in example for a plugin
-
-AC_INIT(plugin_example, 0.1)
-AM_INIT_AUTOMAKE
-AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-
diff --git a/plugin/fulltext/plug.in b/plugin/fulltext/plug.in
deleted file mode 100644
index 5bfc401f805..00000000000
--- a/plugin/fulltext/plug.in
+++ /dev/null
@@ -1,3 +0,0 @@
-MYSQL_PLUGIN(ftexample, [Simple Parser],
- [Simple full-text parser plugin])
-MYSQL_PLUGIN_DYNAMIC(ftexample, [mypluglib.la])
diff --git a/plugin/fulltext/plugin_example.c b/plugin/fulltext/plugin_example.c
index e00de3f8118..117e44e584e 100644
--- a/plugin/fulltext/plugin_example.c
+++ b/plugin/fulltext/plugin_example.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -259,7 +259,7 @@ mysql_declare_plugin(ftexample)
MYSQL_FTPARSER_PLUGIN, /* type */
&simple_parser_descriptor, /* descriptor */
"simple_parser", /* name */
- "MySQL AB", /* author */
+ "Oracle Corp", /* author */
"Simple Full-Text Parser", /* description */
PLUGIN_LICENSE_GPL,
simple_parser_plugin_init, /* init function (when loaded) */
diff --git a/plugin/semisync/Makefile.am b/plugin/semisync/Makefile.am
deleted file mode 100644
index ec1ecee46a2..00000000000
--- a/plugin/semisync/Makefile.am
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-## Makefile.am for semi-synchronous replication
-
-pkgplugindir = $(pkglibdir)/plugin
-INCLUDES = -I$(top_srcdir)/include \
- -I$(top_srcdir)/sql \
- -I$(top_srcdir)/regex \
- -I$(srcdir)
-
-noinst_HEADERS = semisync.h semisync_master.h semisync_slave.h
-
-pkgplugin_LTLIBRARIES = semisync_master.la semisync_slave.la
-
-semisync_master_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
-semisync_master_la_CXXFLAGS= $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-semisync_master_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-semisync_master_la_SOURCES = semisync.cc semisync_master.cc semisync_master_plugin.cc
-
-semisync_slave_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
-semisync_slave_la_CXXFLAGS= $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-semisync_slave_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-semisync_slave_la_SOURCES = semisync.cc semisync_slave.cc semisync_slave_plugin.cc
-
-EXTRA_DIST= CMakeLists.txt plug.in
diff --git a/plugin/semisync/configure.in b/plugin/semisync/configure.in
deleted file mode 100644
index 894251258db..00000000000
--- a/plugin/semisync/configure.in
+++ /dev/null
@@ -1,9 +0,0 @@
-# configure.in for semi-synchronous replication
-
-AC_INIT(mysql-semi-sync-plugin, 0.2)
-AM_INIT_AUTOMAKE
-AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-
diff --git a/plugin/semisync/plug.in b/plugin/semisync/plug.in
deleted file mode 100644
index 82bd9772644..00000000000
--- a/plugin/semisync/plug.in
+++ /dev/null
@@ -1,3 +0,0 @@
-MYSQL_PLUGIN(semisync,[Semi-synchronous Replication Plugin],
- [Semi-synchronous replication plugin.])
-MYSQL_PLUGIN_DYNAMIC(semisync, [semisync_master.la semisync_slave.la])
diff --git a/plugin/semisync/semisync_slave_plugin.cc b/plugin/semisync/semisync_slave_plugin.cc
index 5aa32cdfd5f..cfb04bdd276 100644
--- a/plugin/semisync/semisync_slave_plugin.cc
+++ b/plugin/semisync/semisync_slave_plugin.cc
@@ -53,7 +53,6 @@ int repl_semi_slave_request_dump(Binlog_relay_IO_param *param,
if (mysql_real_query(mysql, query, strlen(query)) ||
!(res= mysql_store_result(mysql)))
{
- mysql_free_result(mysql_store_result(mysql));
sql_print_error("Execution failed on master: %s", query);
return 1;
}
@@ -65,8 +64,10 @@ int repl_semi_slave_request_dump(Binlog_relay_IO_param *param,
sql_print_warning("Master server does not support semi-sync, "
"fallback to asynchronous replication");
rpl_semi_sync_slave_status= 0;
+ mysql_free_result(res);
return 0;
}
+ mysql_free_result(res);
/*
Tell master dump thread that we want to do semi-sync
@@ -76,7 +77,6 @@ int repl_semi_slave_request_dump(Binlog_relay_IO_param *param,
if (mysql_real_query(mysql, query, strlen(query)))
{
sql_print_error("Set 'rpl_semi_sync_slave=1' on master failed");
- mysql_free_result(mysql_store_result(mysql));
return 1;
}
mysql_free_result(mysql_store_result(mysql));
diff --git a/pstack/Makefile.am b/pstack/Makefile.am
deleted file mode 100644
index 25feadf9d06..00000000000
--- a/pstack/Makefile.am
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (C) 2000-2003, 2005 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-#
-# As pstack doesn't work on all configurations, we have to use
-# the USE_PSTACK hack to get all files into distribution
-#
-
-SUBDIRS = aout
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
-
-pkglib_LIBRARIES = libpstack.a
-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
diff --git a/pstack/aout/Makefile.am b/pstack/aout/Makefile.am
deleted file mode 100644
index 0b02cb7b643..00000000000
--- a/pstack/aout/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-noinst_HEADERS = aout64.h stab.def stab_gnu.h
diff --git a/pstack/aout/aout64.h b/pstack/aout/aout64.h
deleted file mode 100644
index 76f1140b682..00000000000
--- a/pstack/aout/aout64.h
+++ /dev/null
@@ -1,475 +0,0 @@
-/* `a.out' object-file definitions, including extensions to 64-bit fields */
-
-#ifndef __A_OUT_64_H__
-#define __A_OUT_64_H__
-
-/* This is the layout on disk of the 32-bit or 64-bit exec header. */
-
-#ifndef external_exec
-struct external_exec
-{
- bfd_byte e_info[4]; /* magic number and stuff */
- bfd_byte e_text[BYTES_IN_WORD]; /* length of text section in bytes */
- bfd_byte e_data[BYTES_IN_WORD]; /* length of data section in bytes */
- bfd_byte e_bss[BYTES_IN_WORD]; /* length of bss area in bytes */
- bfd_byte e_syms[BYTES_IN_WORD]; /* length of symbol table in bytes */
- bfd_byte e_entry[BYTES_IN_WORD]; /* start address */
- bfd_byte e_trsize[BYTES_IN_WORD]; /* length of text relocation info */
- bfd_byte e_drsize[BYTES_IN_WORD]; /* length of data relocation info */
-};
-
-#define EXEC_BYTES_SIZE (4 + BYTES_IN_WORD * 7)
-
-/* Magic numbers for a.out files */
-
-#if ARCH_SIZE==64
-#define OMAGIC 0x1001 /* Code indicating object file */
-#define ZMAGIC 0x1002 /* Code indicating demand-paged executable. */
-#define NMAGIC 0x1003 /* Code indicating pure executable. */
-
-/* There is no 64-bit QMAGIC as far as I know. */
-
-#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \
- && N_MAGIC(x) != NMAGIC \
- && N_MAGIC(x) != ZMAGIC)
-#else
-#define OMAGIC 0407 /* ...object file or impure executable. */
-#define NMAGIC 0410 /* Code indicating pure executable. */
-#define ZMAGIC 0413 /* Code indicating demand-paged executable. */
-#define BMAGIC 0415 /* Used by a b.out object. */
-
-/* This indicates a demand-paged executable with the header in the text.
- It is used by 386BSD (and variants) and Linux, at least. */
-#ifndef QMAGIC
-#define QMAGIC 0314
-#endif
-# ifndef N_BADMAG
-# define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \
- && N_MAGIC(x) != NMAGIC \
- && N_MAGIC(x) != ZMAGIC \
- && N_MAGIC(x) != QMAGIC)
-# endif /* N_BADMAG */
-#endif
-
-#endif
-
-#ifdef QMAGIC
-#define N_IS_QMAGIC(x) (N_MAGIC (x) == QMAGIC)
-#else
-#define N_IS_QMAGIC(x) (0)
-#endif
-
-/* The difference between TARGET_PAGE_SIZE and N_SEGSIZE is that TARGET_PAGE_SIZE is
- the finest granularity at which you can page something, thus it
- controls the padding (if any) before the text segment of a ZMAGIC
- file. N_SEGSIZE is the resolution at which things can be marked as
- read-only versus read/write, so it controls the padding between the
- text segment and the data segment (in memory; on disk the padding
- between them is TARGET_PAGE_SIZE). TARGET_PAGE_SIZE and N_SEGSIZE are the same
- for most machines, but different for sun3. */
-
-/* By default, segment size is constant. But some machines override this
- to be a function of the a.out header (e.g. machine type). */
-
-#ifndef N_SEGSIZE
-#define N_SEGSIZE(x) SEGMENT_SIZE
-#endif
-
-/* Virtual memory address of the text section.
- This is getting very complicated. A good reason to discard a.out format
- for something that specifies these fields explicitly. But til then...
-
- * OMAGIC and NMAGIC files:
- (object files: text for "relocatable addr 0" right after the header)
- start at 0, offset is EXEC_BYTES_SIZE, size as stated.
- * The text address, offset, and size of ZMAGIC files depend
- on the entry point of the file:
- * entry point below TEXT_START_ADDR:
- (hack for SunOS shared libraries)
- start at 0, offset is 0, size as stated.
- * If N_HEADER_IN_TEXT(x) is true (which defaults to being the
- case when the entry point is EXEC_BYTES_SIZE or further into a page):
- no padding is needed; text can start after exec header. Sun
- considers the text segment of such files to include the exec header;
- for BFD's purposes, we don't, which makes more work for us.
- start at TEXT_START_ADDR + EXEC_BYTES_SIZE, offset is EXEC_BYTES_SIZE,
- size as stated minus EXEC_BYTES_SIZE.
- * If N_HEADER_IN_TEXT(x) is false (which defaults to being the case when
- the entry point is less than EXEC_BYTES_SIZE into a page (e.g. page
- aligned)): (padding is needed so that text can start at a page boundary)
- start at TEXT_START_ADDR, offset TARGET_PAGE_SIZE, size as stated.
-
- Specific configurations may want to hardwire N_HEADER_IN_TEXT,
- for efficiency or to allow people to play games with the entry point.
- In that case, you would #define N_HEADER_IN_TEXT(x) as 1 for sunos,
- and as 0 for most other hosts (Sony News, Vax Ultrix, etc).
- (Do this in the appropriate bfd target file.)
- (The default is a heuristic that will break if people try changing
- the entry point, perhaps with the ld -e flag.)
-
- * QMAGIC is always like a ZMAGIC for which N_HEADER_IN_TEXT is true,
- and for which the starting address is TARGET_PAGE_SIZE (or should this be
- SEGMENT_SIZE?) (TEXT_START_ADDR only applies to ZMAGIC, not to QMAGIC).
- */
-
-/* This macro is only relevant for ZMAGIC files; QMAGIC always has the header
- in the text. */
-#ifndef N_HEADER_IN_TEXT
-#define N_HEADER_IN_TEXT(x) (((x).a_entry & (TARGET_PAGE_SIZE-1)) >= EXEC_BYTES_SIZE)
-#endif
-
-/* Sun shared libraries, not linux. This macro is only relevant for ZMAGIC
- files. */
-#ifndef N_SHARED_LIB
-#define N_SHARED_LIB(x) ((x).a_entry < TEXT_START_ADDR)
-#endif
-
-/* Returning 0 not TEXT_START_ADDR for OMAGIC and NMAGIC is based on
- the assumption that we are dealing with a .o file, not an
- executable. This is necessary for OMAGIC (but means we don't work
- right on the output from ld -N); more questionable for NMAGIC. */
-
-#ifndef N_TXTADDR
-#define N_TXTADDR(x) \
- (/* The address of a QMAGIC file is always one page in, */ \
- /* with the header in the text. */ \
- N_IS_QMAGIC (x) ? TARGET_PAGE_SIZE + EXEC_BYTES_SIZE : \
- N_MAGIC(x) != ZMAGIC ? 0 : /* object file or NMAGIC */\
- N_SHARED_LIB(x) ? 0 : \
- N_HEADER_IN_TEXT(x) ? \
- TEXT_START_ADDR + EXEC_BYTES_SIZE : /* no padding */\
- TEXT_START_ADDR /* a page of padding */\
- )
-#endif
-
-/* If N_HEADER_IN_TEXT is not true for ZMAGIC, there is some padding
- to make the text segment start at a certain boundary. For most
- systems, this boundary is TARGET_PAGE_SIZE. But for Linux, in the
- time-honored tradition of crazy ZMAGIC hacks, it is 1024 which is
- not what TARGET_PAGE_SIZE needs to be for QMAGIC. */
-
-#ifndef ZMAGIC_DISK_BLOCK_SIZE
-#define ZMAGIC_DISK_BLOCK_SIZE TARGET_PAGE_SIZE
-#endif
-
-#define N_DISK_BLOCK_SIZE(x) \
- (N_MAGIC(x) == ZMAGIC ? ZMAGIC_DISK_BLOCK_SIZE : TARGET_PAGE_SIZE)
-
-/* Offset in an a.out of the start of the text section. */
-#ifndef N_TXTOFF
-#define N_TXTOFF(x) \
- (/* For {O,N,Q}MAGIC, no padding. */ \
- N_MAGIC(x) != ZMAGIC ? EXEC_BYTES_SIZE : \
- N_SHARED_LIB(x) ? 0 : \
- N_HEADER_IN_TEXT(x) ? \
- EXEC_BYTES_SIZE : /* no padding */\
- ZMAGIC_DISK_BLOCK_SIZE /* a page of padding */\
- )
-#endif
-/* Size of the text section. It's always as stated, except that we
- offset it to `undo' the adjustment to N_TXTADDR and N_TXTOFF
- for ZMAGIC files that nominally include the exec header
- as part of the first page of text. (BFD doesn't consider the
- exec header to be part of the text segment.) */
-#ifndef N_TXTSIZE
-#define N_TXTSIZE(x) \
- (/* For QMAGIC, we don't consider the header part of the text section. */\
- N_IS_QMAGIC (x) ? (x).a_text - EXEC_BYTES_SIZE : \
- (N_MAGIC(x) != ZMAGIC || N_SHARED_LIB(x)) ? (x).a_text : \
- N_HEADER_IN_TEXT(x) ? \
- (x).a_text - EXEC_BYTES_SIZE: /* no padding */\
- (x).a_text /* a page of padding */\
- )
-#endif
-/* The address of the data segment in virtual memory.
- It is the text segment address, plus text segment size, rounded
- up to a N_SEGSIZE boundary for pure or pageable files. */
-#ifndef N_DATADDR
-#define N_DATADDR(x) \
- (N_MAGIC(x)==OMAGIC? (N_TXTADDR(x)+N_TXTSIZE(x)) \
- : (N_SEGSIZE(x) + ((N_TXTADDR(x)+N_TXTSIZE(x)-1) & ~(N_SEGSIZE(x)-1))))
-#endif
-/* The address of the BSS segment -- immediately after the data segment. */
-
-#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
-
-/* Offsets of the various portions of the file after the text segment. */
-
-/* For {Q,Z}MAGIC, there is padding to make the data segment start on
- a page boundary. Most of the time the a_text field (and thus
- N_TXTSIZE) already contains this padding. It is possible that for
- BSDI and/or 386BSD it sometimes doesn't contain the padding, and
- perhaps we should be adding it here. But this seems kind of
- questionable and probably should be BSDI/386BSD-specific if we do
- do it.
-
- For NMAGIC (at least for hp300 BSD, probably others), there is
- padding in memory only, not on disk, so we must *not* ever pad here
- for NMAGIC. */
-
-#ifndef N_DATOFF
-#define N_DATOFF(x) \
- (N_TXTOFF(x) + N_TXTSIZE(x))
-#endif
-
-#ifndef N_TRELOFF
-#define N_TRELOFF(x) ( N_DATOFF(x) + (x).a_data )
-#endif
-#ifndef N_DRELOFF
-#define N_DRELOFF(x) ( N_TRELOFF(x) + (x).a_trsize )
-#endif
-#ifndef N_SYMOFF
-#define N_SYMOFF(x) ( N_DRELOFF(x) + (x).a_drsize )
-#endif
-#ifndef N_STROFF
-#define N_STROFF(x) ( N_SYMOFF(x) + (x).a_syms )
-#endif
-
-/* Symbols */
-#ifndef external_nlist
-struct external_nlist {
- bfd_byte e_strx[BYTES_IN_WORD]; /* index into string table of name */
- bfd_byte e_type[1]; /* type of symbol */
- bfd_byte e_other[1]; /* misc info (usually empty) */
- bfd_byte e_desc[2]; /* description field */
- bfd_byte e_value[BYTES_IN_WORD]; /* value of symbol */
-};
-#define EXTERNAL_NLIST_SIZE (BYTES_IN_WORD+4+BYTES_IN_WORD)
-#endif
-
-struct internal_nlist {
- unsigned long n_strx; /* index into string table of name */
- unsigned char n_type; /* type of symbol */
- unsigned char n_other; /* misc info (usually empty) */
- unsigned short n_desc; /* description field */
- bfd_vma n_value; /* value of symbol */
-};
-
-/* The n_type field is the symbol type, containing: */
-
-#define N_UNDF 0 /* Undefined symbol */
-#define N_ABS 2 /* Absolute symbol -- defined at particular addr */
-#define N_TEXT 4 /* Text sym -- defined at offset in text seg */
-#define N_DATA 6 /* Data sym -- defined at offset in data seg */
-#define N_BSS 8 /* BSS sym -- defined at offset in zero'd seg */
-#define N_COMM 0x12 /* Common symbol (visible after shared lib dynlink) */
-#define N_FN 0x1f /* File name of .o file */
-#define N_FN_SEQ 0x0C /* N_FN from Sequent compilers (sigh) */
-/* Note: N_EXT can only be usefully OR-ed with N_UNDF, N_ABS, N_TEXT,
- N_DATA, or N_BSS. When the low-order bit of other types is set,
- (e.g. N_WARNING versus N_FN), they are two different types. */
-#define N_EXT 1 /* External symbol (as opposed to local-to-this-file) */
-#define N_TYPE 0x1e
-#define N_STAB 0xe0 /* If any of these bits are on, it's a debug symbol */
-
-#define N_INDR 0x0a
-
-/* The following symbols refer to set elements.
- All the N_SET[ATDB] symbols with the same name form one set.
- Space is allocated for the set in the text section, and each set
- elements value is stored into one word of the space.
- The first word of the space is the length of the set (number of elements).
-
- The address of the set is made into an N_SETV symbol
- whose name is the same as the name of the set.
- This symbol acts like a N_DATA global symbol
- in that it can satisfy undefined external references. */
-
-/* These appear as input to LD, in a .o file. */
-#define N_SETA 0x14 /* Absolute set element symbol */
-#define N_SETT 0x16 /* Text set element symbol */
-#define N_SETD 0x18 /* Data set element symbol */
-#define N_SETB 0x1A /* Bss set element symbol */
-
-/* This is output from LD. */
-#define N_SETV 0x1C /* Pointer to set vector in data area. */
-
-/* Warning symbol. The text gives a warning message, the next symbol
- in the table will be undefined. When the symbol is referenced, the
- message is printed. */
-
-#define N_WARNING 0x1e
-
-/* Weak symbols. These are a GNU extension to the a.out format. The
- semantics are those of ELF weak symbols. Weak symbols are always
- externally visible. The N_WEAK? values are squeezed into the
- available slots. The value of a N_WEAKU symbol is 0. The values
- of the other types are the definitions. */
-#define N_WEAKU 0x0d /* Weak undefined symbol. */
-#define N_WEAKA 0x0e /* Weak absolute symbol. */
-#define N_WEAKT 0x0f /* Weak text symbol. */
-#define N_WEAKD 0x10 /* Weak data symbol. */
-#define N_WEAKB 0x11 /* Weak bss symbol. */
-
-/* Relocations
-
- There are two types of relocation flavours for a.out systems,
- standard and extended. The standard form is used on systems where the
- instruction has room for all the bits of an offset to the operand, whilst
- the extended form is used when an address operand has to be split over n
- instructions. Eg, on the 68k, each move instruction can reference
- the target with a displacement of 16 or 32 bits. On the sparc, move
- instructions use an offset of 14 bits, so the offset is stored in
- the reloc field, and the data in the section is ignored.
-*/
-
-/* This structure describes a single relocation to be performed.
- The text-relocation section of the file is a vector of these structures,
- all of which apply to the text section.
- Likewise, the data-relocation section applies to the data section. */
-
-struct reloc_std_external {
- bfd_byte r_address[BYTES_IN_WORD]; /* offset of of data to relocate */
- bfd_byte r_index[3]; /* symbol table index of symbol */
- bfd_byte r_type[1]; /* relocation type */
-};
-
-#define RELOC_STD_BITS_PCREL_BIG ((unsigned int) 0x80)
-#define RELOC_STD_BITS_PCREL_LITTLE ((unsigned int) 0x01)
-
-#define RELOC_STD_BITS_LENGTH_BIG ((unsigned int) 0x60)
-#define RELOC_STD_BITS_LENGTH_SH_BIG 5
-#define RELOC_STD_BITS_LENGTH_LITTLE ((unsigned int) 0x06)
-#define RELOC_STD_BITS_LENGTH_SH_LITTLE 1
-
-#define RELOC_STD_BITS_EXTERN_BIG ((unsigned int) 0x10)
-#define RELOC_STD_BITS_EXTERN_LITTLE ((unsigned int) 0x08)
-
-#define RELOC_STD_BITS_BASEREL_BIG ((unsigned int) 0x08)
-#define RELOC_STD_BITS_BASEREL_LITTLE ((unsigned int) 0x10)
-
-#define RELOC_STD_BITS_JMPTABLE_BIG ((unsigned int) 0x04)
-#define RELOC_STD_BITS_JMPTABLE_LITTLE ((unsigned int) 0x20)
-
-#define RELOC_STD_BITS_RELATIVE_BIG ((unsigned int) 0x02)
-#define RELOC_STD_BITS_RELATIVE_LITTLE ((unsigned int) 0x40)
-
-#define RELOC_STD_SIZE (BYTES_IN_WORD + 3 + 1) /* Bytes per relocation entry */
-
-struct reloc_std_internal
-{
- bfd_vma r_address; /* Address (within segment) to be relocated. */
- /* The meaning of r_symbolnum depends on r_extern. */
- unsigned int r_symbolnum:24;
- /* Nonzero means value is a pc-relative offset
- and it should be relocated for changes in its own address
- as well as for changes in the symbol or section specified. */
- unsigned int r_pcrel:1;
- /* Length (as exponent of 2) of the field to be relocated.
- Thus, a value of 2 indicates 1<<2 bytes. */
- unsigned int r_length:2;
- /* 1 => relocate with value of symbol.
- r_symbolnum is the index of the symbol
- in files the symbol table.
- 0 => relocate with the address of a segment.
- r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS
- (the N_EXT bit may be set also, but signifies nothing). */
- unsigned int r_extern:1;
- /* The next three bits are for SunOS shared libraries, and seem to
- be undocumented. */
- unsigned int r_baserel:1; /* Linkage table relative */
- unsigned int r_jmptable:1; /* pc-relative to jump table */
- unsigned int r_relative:1; /* "relative relocation" */
- /* unused */
- unsigned int r_pad:1; /* Padding -- set to zero */
-};
-
-
-/* EXTENDED RELOCS */
-
-struct reloc_ext_external {
- bfd_byte r_address[BYTES_IN_WORD]; /* offset of of data to relocate */
- bfd_byte r_index[3]; /* symbol table index of symbol */
- bfd_byte r_type[1]; /* relocation type */
- bfd_byte r_addend[BYTES_IN_WORD]; /* datum addend */
-};
-
-#define RELOC_EXT_BITS_EXTERN_BIG ((unsigned int) 0x80)
-#define RELOC_EXT_BITS_EXTERN_LITTLE ((unsigned int) 0x01)
-
-#define RELOC_EXT_BITS_TYPE_BIG ((unsigned int) 0x1F)
-#define RELOC_EXT_BITS_TYPE_SH_BIG 0
-#define RELOC_EXT_BITS_TYPE_LITTLE ((unsigned int) 0xF8)
-#define RELOC_EXT_BITS_TYPE_SH_LITTLE 3
-
-/* Bytes per relocation entry */
-#define RELOC_EXT_SIZE (BYTES_IN_WORD + 3 + 1 + BYTES_IN_WORD)
-
-enum reloc_type
-{
- /* simple relocations */
- RELOC_8, /* data[0:7] = addend + sv */
- RELOC_16, /* data[0:15] = addend + sv */
- RELOC_32, /* data[0:31] = addend + sv */
- /* pc-rel displacement */
- RELOC_DISP8, /* data[0:7] = addend - pc + sv */
- RELOC_DISP16, /* data[0:15] = addend - pc + sv */
- RELOC_DISP32, /* data[0:31] = addend - pc + sv */
- /* Special */
- RELOC_WDISP30, /* data[0:29] = (addend + sv - pc)>>2 */
- RELOC_WDISP22, /* data[0:21] = (addend + sv - pc)>>2 */
- RELOC_HI22, /* data[0:21] = (addend + sv)>>10 */
- RELOC_22, /* data[0:21] = (addend + sv) */
- RELOC_13, /* data[0:12] = (addend + sv) */
- RELOC_LO10, /* data[0:9] = (addend + sv) */
- RELOC_SFA_BASE,
- RELOC_SFA_OFF13,
- /* P.I.C. (base-relative) */
- RELOC_BASE10, /* Not sure - maybe we can do this the */
- RELOC_BASE13, /* right way now */
- RELOC_BASE22,
- /* for some sort of pc-rel P.I.C. (?) */
- RELOC_PC10,
- RELOC_PC22,
- /* P.I.C. jump table */
- RELOC_JMP_TBL,
- /* reputedly for shared libraries somehow */
- RELOC_SEGOFF16,
- RELOC_GLOB_DAT,
- RELOC_JMP_SLOT,
- RELOC_RELATIVE,
-
- RELOC_11,
- RELOC_WDISP2_14,
- RELOC_WDISP19,
- RELOC_HHI22, /* data[0:21] = (addend + sv) >> 42 */
- RELOC_HLO10, /* data[0:9] = (addend + sv) >> 32 */
-
- /* 29K relocation types */
- RELOC_JUMPTARG,
- RELOC_CONST,
- RELOC_CONSTH,
-
- /* All the new ones I can think of, for sparc v9 */
-
- RELOC_64, /* data[0:63] = addend + sv */
- RELOC_DISP64, /* data[0:63] = addend - pc + sv */
- RELOC_WDISP21, /* data[0:20] = (addend + sv - pc)>>2 */
- RELOC_DISP21, /* data[0:20] = addend - pc + sv */
- RELOC_DISP14, /* data[0:13] = addend - pc + sv */
- /* Q .
- What are the other ones,
- Since this is a clean slate, can we throw away the ones we dont
- understand ? Should we sort the values ? What about using a
- microcode format like the 68k ?
- */
- NO_RELOC
- };
-
-
-struct reloc_internal {
- bfd_vma r_address; /* offset of of data to relocate */
- long r_index; /* symbol table index of symbol */
- enum reloc_type r_type; /* relocation type */
- bfd_vma r_addend; /* datum addend */
-};
-
-/* Q.
- Should the length of the string table be 4 bytes or 8 bytes ?
-
- Q.
- What about archive indexes ?
-
- */
-
-#endif /* __A_OUT_64_H__ */
diff --git a/pstack/aout/stab.def b/pstack/aout/stab.def
deleted file mode 100644
index 3c6b456d3a9..00000000000
--- a/pstack/aout/stab.def
+++ /dev/null
@@ -1,264 +0,0 @@
-/* Table of DBX symbol codes for the GNU system.
- Copyright (C) 1988, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-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. */
-
-/* New stab from Solaris 2. This uses an n_type of 0, which in a.out files
- overlaps the N_UNDF used for ordinary symbols. In ELF files, the
- debug information is in a different file section, so there is no conflict.
- This symbol's n_value gives the size of the string section associated
- with this file. The symbol's n_strx (relative to the just-updated
- string section start address) gives the name of the source file,
- e.g. "foo.c", without any path information. The symbol's n_desc gives
- the count of upcoming symbols associated with this file (not including
- this one). */
-/* __define_stab (N_UNDF, 0x00, "UNDF") */
-
-/* Global variable. Only the name is significant.
- To find the address, look in the corresponding external symbol. */
-__define_stab (N_GSYM, 0x20, "GSYM")
-
-/* Function name for BSD Fortran. Only the name is significant.
- To find the address, look in the corresponding external symbol. */
-__define_stab (N_FNAME, 0x22, "FNAME")
-
-/* Function name or text-segment variable for C. Value is its address.
- Desc is supposedly starting line number, but GCC doesn't set it
- and DBX seems not to miss it. */
-__define_stab (N_FUN, 0x24, "FUN")
-
-/* Data-segment variable with internal linkage. Value is its address.
- "Static Sym". */
-__define_stab (N_STSYM, 0x26, "STSYM")
-
-/* BSS-segment variable with internal linkage. Value is its address. */
-__define_stab (N_LCSYM, 0x28, "LCSYM")
-
-/* Name of main routine. Only the name is significant. */
-__define_stab (N_MAIN, 0x2a, "MAIN")
-
-/* Solaris2: Read-only data symbols. */
-__define_stab (N_ROSYM, 0x2c, "ROSYM")
-
-/* Global symbol in Pascal.
- Supposedly the value is its line number; I'm skeptical. */
-__define_stab (N_PC, 0x30, "PC")
-
-/* Number of symbols: 0, files,,funcs,lines according to Ultrix V4.0. */
-__define_stab (N_NSYMS, 0x32, "NSYMS")
-
-/* "No DST map for sym: name, ,0,type,ignored" according to Ultrix V4.0. */
-__define_stab (N_NOMAP, 0x34, "NOMAP")
-
-/* New stab from Solaris 2. Like N_SO, but for the object file. Two in
- a row provide the build directory and the relative path of the .o from it.
- Solaris2 uses this to avoid putting the stabs info into the linked
- executable; this stab goes into the ".stab.index" section, and the debugger
- reads the real stabs directly from the .o files instead. */
-__define_stab (N_OBJ, 0x38, "OBJ")
-
-/* New stab from Solaris 2. Options for the debugger, related to the
- source language for this module. E.g. whether to use ANSI
- integral promotions or traditional integral promotions. */
-__define_stab (N_OPT, 0x3c, "OPT")
-
-/* Register variable. Value is number of register. */
-__define_stab (N_RSYM, 0x40, "RSYM")
-
-/* Modula-2 compilation unit. Can someone say what info it contains? */
-__define_stab (N_M2C, 0x42, "M2C")
-
-/* Line number in text segment. Desc is the line number;
- value is corresponding address. On Solaris2, the line number is
- relative to the start of the current function. */
-__define_stab (N_SLINE, 0x44, "SLINE")
-
-/* Similar, for data segment. */
-__define_stab (N_DSLINE, 0x46, "DSLINE")
-
-/* Similar, for bss segment. */
-__define_stab (N_BSLINE, 0x48, "BSLINE")
-
-/* Sun's source-code browser stabs. ?? Don't know what the fields are.
- Supposedly the field is "path to associated .cb file". THIS VALUE
- OVERLAPS WITH N_BSLINE! */
-__define_stab_duplicate (N_BROWS, 0x48, "BROWS")
-
-/* GNU Modula-2 definition module dependency. Value is the modification time
- of the definition file. Other is non-zero if it is imported with the
- GNU M2 keyword %INITIALIZE. Perhaps N_M2C can be used if there
- are enough empty fields? */
-__define_stab(N_DEFD, 0x4a, "DEFD")
-
-/* New in Solaris2. Function start/body/end line numbers. */
-__define_stab(N_FLINE, 0x4C, "FLINE")
-
-/* THE FOLLOWING TWO STAB VALUES CONFLICT. Happily, one is for Modula-2
- and one is for C++. Still,... */
-/* GNU C++ exception variable. Name is variable name. */
-__define_stab (N_EHDECL, 0x50, "EHDECL")
-/* Modula2 info "for imc": name,,0,0,0 according to Ultrix V4.0. */
-__define_stab_duplicate (N_MOD2, 0x50, "MOD2")
-
-/* GNU C++ `catch' clause. Value is its address. Desc is nonzero if
- this entry is immediately followed by a CAUGHT stab saying what exception
- was caught. Multiple CAUGHT stabs means that multiple exceptions
- can be caught here. If Desc is 0, it means all exceptions are caught
- here. */
-__define_stab (N_CATCH, 0x54, "CATCH")
-
-/* Structure or union element. Value is offset in the structure. */
-__define_stab (N_SSYM, 0x60, "SSYM")
-
-/* Solaris2: Last stab emitted for module. */
-__define_stab (N_ENDM, 0x62, "ENDM")
-
-/* Name of main source file.
- Value is starting text address of the compilation.
- If multiple N_SO's appear, the first to contain a trailing / is the
- compilation directory. The first to not contain a trailing / is the
- source file name, relative to the compilation directory. Others (perhaps
- resulting from cfront) are ignored.
- On Solaris2, value is undefined, but desc is a source-language code. */
-
-__define_stab (N_SO, 0x64, "SO")
-
-/* Automatic variable in the stack. Value is offset from frame pointer.
- Also used for type descriptions. */
-__define_stab (N_LSYM, 0x80, "LSYM")
-
-/* Beginning of an include file. Only Sun uses this.
- In an object file, only the name is significant.
- The Sun linker puts data into some of the other fields. */
-__define_stab (N_BINCL, 0x82, "BINCL")
-
-/* Name of sub-source file (#include file).
- Value is starting text address of the compilation. */
-__define_stab (N_SOL, 0x84, "SOL")
-
-/* Parameter variable. Value is offset from argument pointer.
- (On most machines the argument pointer is the same as the frame pointer. */
-__define_stab (N_PSYM, 0xa0, "PSYM")
-
-/* End of an include file. No name.
- This and N_BINCL act as brackets around the file's output.
- In an object file, there is no significant data in this entry.
- The Sun linker puts data into some of the fields. */
-__define_stab (N_EINCL, 0xa2, "EINCL")
-
-/* Alternate entry point. Value is its address. */
-__define_stab (N_ENTRY, 0xa4, "ENTRY")
-
-/* Beginning of lexical block.
- The desc is the nesting level in lexical blocks.
- The value is the address of the start of the text for the block.
- The variables declared inside the block *precede* the N_LBRAC symbol.
- On Solaris2, the value is relative to the start of the current function. */
-__define_stab (N_LBRAC, 0xc0, "LBRAC")
-
-/* Place holder for deleted include file. Replaces a N_BINCL and everything
- up to the corresponding N_EINCL. The Sun linker generates these when
- it finds multiple identical copies of the symbols from an include file.
- This appears only in output from the Sun linker. */
-__define_stab (N_EXCL, 0xc2, "EXCL")
-
-/* Modula-2 scope information. Can someone say what info it contains? */
-__define_stab (N_SCOPE, 0xc4, "SCOPE")
-
-/* End of a lexical block. Desc matches the N_LBRAC's desc.
- The value is the address of the end of the text for the block.
- On Solaris2, the value is relative to the start of the current function. */
-__define_stab (N_RBRAC, 0xe0, "RBRAC")
-
-/* Begin named common block. Only the name is significant. */
-__define_stab (N_BCOMM, 0xe2, "BCOMM")
-
-/* End named common block. Only the name is significant
- (and it should match the N_BCOMM). */
-__define_stab (N_ECOMM, 0xe4, "ECOMM")
-
-/* Member of a common block; value is offset within the common block.
- This should occur within a BCOMM/ECOMM pair. */
-__define_stab (N_ECOML, 0xe8, "ECOML")
-
-/* Solaris2: Pascal "with" statement: type,,0,0,offset */
-__define_stab (N_WITH, 0xea, "WITH")
-
-/* These STAB's are used on Gould systems for Non-Base register symbols
- or something like that. FIXME. I have assigned the values at random
- since I don't have a Gould here. Fixups from Gould folk welcome... */
-__define_stab (N_NBTEXT, 0xF0, "NBTEXT")
-__define_stab (N_NBDATA, 0xF2, "NBDATA")
-__define_stab (N_NBBSS, 0xF4, "NBBSS")
-__define_stab (N_NBSTS, 0xF6, "NBSTS")
-__define_stab (N_NBLCS, 0xF8, "NBLCS")
-
-/* Second symbol entry containing a length-value for the preceding entry.
- The value is the length. */
-__define_stab (N_LENG, 0xfe, "LENG")
-
-/* The above information, in matrix format.
-
- STAB MATRIX
- _________________________________________________
- | 00 - 1F are not dbx stab symbols |
- | In most cases, the low bit is the EXTernal bit|
-
- | 00 UNDEF | 02 ABS | 04 TEXT | 06 DATA |
- | 01 |EXT | 03 |EXT | 05 |EXT | 07 |EXT |
-
- | 08 BSS | 0A INDR | 0C FN_SEQ | 0E WEAKA |
- | 09 |EXT | 0B | 0D WEAKU | 0F WEAKT |
-
- | 10 WEAKD | 12 COMM | 14 SETA | 16 SETT |
- | 11 WEAKB | 13 | 15 | 17 |
-
- | 18 SETD | 1A SETB | 1C SETV | 1E WARNING|
- | 19 | 1B | 1D | 1F FN |
-
- |_______________________________________________|
- | Debug entries with bit 01 set are unused. |
- | 20 GSYM | 22 FNAME | 24 FUN | 26 STSYM |
- | 28 LCSYM | 2A MAIN | 2C ROSYM | 2E |
- | 30 PC | 32 NSYMS | 34 NOMAP | 36 |
- | 38 OBJ | 3A | 3C OPT | 3E |
- | 40 RSYM | 42 M2C | 44 SLINE | 46 DSLINE |
- | 48 BSLINE*| 4A DEFD | 4C FLINE | 4E |
- | 50 EHDECL*| 52 | 54 CATCH | 56 |
- | 58 | 5A | 5C | 5E |
- | 60 SSYM | 62 ENDM | 64 SO | 66 |
- | 68 | 6A | 6C | 6E |
- | 70 | 72 | 74 | 76 |
- | 78 | 7A | 7C | 7E |
- | 80 LSYM | 82 BINCL | 84 SOL | 86 |
- | 88 | 8A | 8C | 8E |
- | 90 | 92 | 94 | 96 |
- | 98 | 9A | 9C | 9E |
- | A0 PSYM | A2 EINCL | A4 ENTRY | A6 |
- | A8 | AA | AC | AE |
- | B0 | B2 | B4 | B6 |
- | B8 | BA | BC | BE |
- | C0 LBRAC | C2 EXCL | C4 SCOPE | C6 |
- | C8 | CA | CC | CE |
- | D0 | D2 | D4 | D6 |
- | D8 | DA | DC | DE |
- | E0 RBRAC | E2 BCOMM | E4 ECOMM | E6 |
- | E8 ECOML | EA WITH | EC | EE |
- | F0 | F2 | F4 | F6 |
- | F8 | FA | FC | FE LENG |
- +-----------------------------------------------+
- * 50 EHDECL is also MOD2.
- * 48 BSLINE is also BROWS.
- */
diff --git a/pstack/aout/stab_gnu.h b/pstack/aout/stab_gnu.h
deleted file mode 100644
index 7d18e14a263..00000000000
--- a/pstack/aout/stab_gnu.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef __GNU_STAB__
-
-/* Indicate the GNU stab.h is in use. */
-
-#define __GNU_STAB__
-
-#define __define_stab(NAME, CODE, STRING) NAME=CODE,
-#define __define_stab_duplicate(NAME, CODE, STRING) NAME=CODE,
-
-enum __stab_debug_code
-{
-#include "aout/stab.def"
-LAST_UNUSED_STAB_CODE
-};
-
-#undef __define_stab
-
-/* Definitions of "desc" field for N_SO stabs in Solaris2. */
-
-#define N_SO_AS 1
-#define N_SO_C 2
-#define N_SO_ANSI_C 3
-#define N_SO_CC 4 /* C++ */
-#define N_SO_FORTRAN 5
-#define N_SO_PASCAL 6
-
-/* Solaris2: Floating point type values in basic types. */
-
-#define NF_NONE 0
-#define NF_SINGLE 1 /* IEEE 32-bit */
-#define NF_DOUBLE 2 /* IEEE 64-bit */
-#define NF_COMPLEX 3 /* Fortran complex */
-#define NF_COMPLEX16 4 /* Fortran double complex */
-#define NF_COMPLEX32 5 /* Fortran complex*16 */
-#define NF_LDOUBLE 6 /* Long double (whatever that is) */
-
-#endif /* __GNU_STAB_ */
diff --git a/pstack/bucomm.c b/pstack/bucomm.c
deleted file mode 100644
index d3231e71747..00000000000
--- a/pstack/bucomm.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/* bucomm.c -- Bin Utils COMmon code.
- Copyright (C) 1991, 92, 93, 94, 95, 1997 Free Software Foundation, Inc.
-
- This file is part of GNU Binutils.
-
- 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; either version 2 of the License, or
- (at your option) any later version.
-
- 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. */
-
-/* We might put this in a library someday so it could be dynamically
- loaded, but for now it's not necessary. */
-
-#include <bfd.h>
-#include <libiberty.h>
-#include "bucomm.h"
-
-#include <sys/stat.h>
-#include <time.h> /* ctime, maybe time_t */
-
-#ifdef ANSI_PROTOTYPES
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-/* Error reporting */
-
-char *program_name;
-
-void
-bfd_nonfatal (string)
- CONST char *string;
-{
- CONST char *errmsg = bfd_errmsg (bfd_get_error ());
-
- if (string)
- fprintf (stderr, "%s: %s: %s\n", program_name, string, errmsg);
- else
- fprintf (stderr, "%s: %s\n", program_name, errmsg);
-}
-
-void
-bfd_fatal (string)
- CONST char *string;
-{
- bfd_nonfatal (string);
- xexit (1);
-}
-
-#ifdef ANSI_PROTOTYPES
-void
-fatal (const char *format, ...)
-{
- va_list args;
-
- fprintf (stderr, "%s: ", program_name);
- va_start (args, format);
- vfprintf (stderr, format, args);
- va_end (args);
- putc ('\n', stderr);
- xexit (1);
-}
-#else
-void
-fatal (va_alist)
- va_dcl
-{
- char *Format;
- va_list args;
-
- fprintf (stderr, "%s: ", program_name);
- va_start (args);
- Format = va_arg (args, char *);
- vfprintf (stderr, Format, args);
- va_end (args);
- putc ('\n', stderr);
- xexit (1);
-}
-#endif
-
-/* Set the default BFD target based on the configured target. Doing
- this permits the binutils to be configured for a particular target,
- and linked against a shared BFD library which was configured for a
- different target. */
-
-#define TARGET "elf32-i386" /* FIXME: hard-coded! */
-void
-set_default_bfd_target ()
-{
- /* The macro TARGET is defined by Makefile. */
- const char *target = TARGET;
-
- if (! bfd_set_default_target (target))
- {
- char *errmsg;
-
- errmsg = (char *) xmalloc (100 + strlen (target));
- sprintf (errmsg, "can't set BFD default target to `%s'", target);
- bfd_fatal (errmsg);
- }
-}
-
-/* After a false return from bfd_check_format_matches with
- bfd_get_error () == bfd_error_file_ambiguously_recognized, print
- the possible matching targets. */
-
-void
-list_matching_formats (p)
- char **p;
-{
- fprintf(stderr, "%s: Matching formats:", program_name);
- while (*p)
- fprintf(stderr, " %s", *p++);
- fprintf(stderr, "\n");
-}
-
-/* List the supported targets. */
-
-void
-list_supported_targets (name, f)
- const char *name;
- FILE *f;
-{
- extern bfd_target *bfd_target_vector[];
- int t;
-
- if (name == NULL)
- fprintf (f, "Supported targets:");
- else
- fprintf (f, "%s: supported targets:", name);
- for (t = 0; bfd_target_vector[t] != NULL; t++)
- fprintf (f, " %s", bfd_target_vector[t]->name);
- fprintf (f, "\n");
-}
-
-/* Display the archive header for an element as if it were an ls -l listing:
-
- Mode User\tGroup\tSize\tDate Name */
-
-void
-print_arelt_descr (file, abfd, verbose)
- FILE *file;
- bfd *abfd;
- boolean verbose;
-{
- struct stat buf;
-
- if (verbose)
- {
- if (bfd_stat_arch_elt (abfd, &buf) == 0)
- {
- char modebuf[11];
- char timebuf[40];
- time_t when = buf.st_mtime;
- CONST char *ctime_result = (CONST char *) ctime (&when);
-
- /* POSIX format: skip weekday and seconds from ctime output. */
- sprintf (timebuf, "%.12s %.4s", ctime_result + 4, ctime_result + 20);
-
- mode_string (buf.st_mode, modebuf);
- modebuf[10] = '\0';
- /* POSIX 1003.2/D11 says to skip first character (entry type). */
- fprintf (file, "%s %ld/%ld %6ld %s ", modebuf + 1,
- (long) buf.st_uid, (long) buf.st_gid,
- (long) buf.st_size, timebuf);
- }
- }
-
- fprintf (file, "%s\n", bfd_get_filename (abfd));
-}
-
-/* Return the name of a temporary file in the same directory as FILENAME. */
-
-char *
-make_tempname (filename)
- char *filename;
-{
- static char template[] = "stXXXXXX";
- char *tmpname;
- char *slash = strrchr (filename, '/');
-
-#if defined (__DJGPP__) || defined (__GO32__) || defined (_WIN32)
- if (slash == NULL)
- slash = strrchr (filename, '\\');
-#endif
-
- if (slash != (char *) NULL)
- {
- char c;
-
- c = *slash;
- *slash = 0;
- tmpname = xmalloc (strlen (filename) + sizeof (template) + 1);
- strcpy (tmpname, filename);
- strcat (tmpname, "/");
- strcat (tmpname, template);
- mkstemp (tmpname);
- *slash = c;
- }
- else
- {
- tmpname = xmalloc (sizeof (template));
- strcpy (tmpname, template);
- mkstemp (tmpname);
- }
- return tmpname;
-}
-
-/* Parse a string into a VMA, with a fatal error if it can't be
- parsed. */
-
-bfd_vma
-parse_vma (s, arg)
- const char *s;
- const char *arg;
-{
- bfd_vma ret;
- const char *end;
-
- ret = bfd_scan_vma (s, &end, 0);
- if (*end != '\0')
- {
- fprintf (stderr, "%s: %s: bad number: %s\n", program_name, arg, s);
- exit (1);
- }
- return ret;
-}
diff --git a/pstack/bucomm.h b/pstack/bucomm.h
deleted file mode 100644
index 6b3633d8d63..00000000000
--- a/pstack/bucomm.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* bucomm.h -- binutils common include file.
- Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
-
-This file is part of GNU Binutils.
-
-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; either version 2 of the License, or
-(at your option) any later version.
-
-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 _BUCOMM_H
-#define _BUCOMM_H
-
-#include "ansidecl.h"
-#include <stdio.h>
-#include <sys/types.h>
-
-#include <errno.h>
-#include <unistd.h>
-
-#include <string.h>
-
-#include <stdlib.h>
-
-#include <fcntl.h>
-
-#ifdef __GNUC__
-# undef alloca
-# define alloca __builtin_alloca
-#else
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-# if !defined (__STDC__) && !defined (__hpux)
-char *alloca ();
-# else
-void *alloca ();
-# endif /* __STDC__, __hpux */
-# endif /* alloca */
-# endif /* HAVE_ALLOCA_H */
-#endif
-
-#ifndef BFD_TRUE_FALSE
-#define boolean bfd_boolean
-#define true TRUE
-#define false FALSE
-#endif
-
-/* bucomm.c */
-void bfd_nonfatal PARAMS ((CONST char *));
-
-void bfd_fatal PARAMS ((CONST char *));
-
-void fatal PARAMS ((CONST char *, ...));
-
-void set_default_bfd_target PARAMS ((void));
-
-void list_matching_formats PARAMS ((char **p));
-
-void list_supported_targets PARAMS ((const char *, FILE *));
-
-void print_arelt_descr PARAMS ((FILE *file, bfd *abfd, boolean verbose));
-
-char *make_tempname PARAMS ((char *));
-
-bfd_vma parse_vma PARAMS ((const char *, const char *));
-
-extern char *program_name;
-
-/* filemode.c */
-void mode_string PARAMS ((unsigned long mode, char *buf));
-
-/* version.c */
-extern void print_version PARAMS ((const char *));
-
-/* libiberty */
-PTR xmalloc PARAMS ((size_t));
-
-PTR xrealloc PARAMS ((PTR, size_t));
-
-#endif /* _BUCOMM_H */
diff --git a/pstack/budbg.h b/pstack/budbg.h
deleted file mode 100644
index 9f0203ad5e7..00000000000
--- a/pstack/budbg.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* budbg.c -- Interfaces to the generic debugging information routines.
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Written by Ian Lance Taylor <ian@cygnus.com>.
-
- This file is part of GNU Binutils.
-
- 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; either version 2 of the License, or
- (at your option) any later version.
-
- 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 BUDBG_H
-#define BUDBG_H
-
-#include <stdio.h>
-
-#ifndef BFD_TRUE_FALSE
-#define boolean bfd_boolean
-#define true TRUE
-#define false FALSE
-#endif
-
-/* Routine used to read generic debugging information. */
-
-extern PTR read_debugging_info PARAMS ((bfd *, asymbol **, long));
-
-/* Routine used to print generic debugging information. */
-
-extern boolean print_debugging_info PARAMS ((FILE *, PTR));
-
-/* Routines used to read and write stabs information. */
-
-extern PTR start_stab PARAMS ((PTR, bfd *, boolean, asymbol **, long));
-
-extern boolean finish_stab PARAMS ((PTR, PTR));
-
-extern boolean parse_stab PARAMS ((PTR, PTR, int, int, bfd_vma, const char *));
-
-extern boolean write_stabs_in_sections_debugging_info
- PARAMS ((bfd *, PTR, bfd_byte **, bfd_size_type *, bfd_byte **,
- bfd_size_type *));
-
-/* Routines used to read and write IEEE debugging information. */
-
-extern boolean parse_ieee
- PARAMS ((PTR, bfd *, const bfd_byte *, bfd_size_type));
-
-extern boolean write_ieee_debugging_info PARAMS ((bfd *, PTR));
-
-/* Routine used to read COFF debugging information. */
-
-extern boolean parse_coff PARAMS ((bfd *, asymbol **, long, PTR));
-
-#endif
diff --git a/pstack/debug.c b/pstack/debug.c
deleted file mode 100644
index 73412ae3f03..00000000000
--- a/pstack/debug.c
+++ /dev/null
@@ -1,3509 +0,0 @@
-/* debug.c -- Handle generic debugging information.
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Written by Ian Lance Taylor <ian@cygnus.com>.
-
- This file is part of GNU Binutils.
-
- 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; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
-
-/* This file implements a generic debugging format. We may eventually
- have readers which convert different formats into this generic
- format, and writers which write it out. The initial impetus for
- this was writing a convertor from stabs to HP IEEE-695 debugging
- format. */
-
-#include <stdio.h>
-#include <assert.h>
-
-#include <bfd.h>
-#include "bucomm.h"
-#include <libiberty.h>
-#include "debug.h"
-
-/* Global information we keep for debugging. A pointer to this
- structure is the debugging handle passed to all the routines. */
-
-struct debug_handle
-{
- /* A linked list of compilation units. */
- struct debug_unit *units;
- /* The current compilation unit. */
- struct debug_unit *current_unit;
- /* The current source file. */
- struct debug_file *current_file;
- /* The current function. */
- struct debug_function *current_function;
- /* The current block. */
- struct debug_block *current_block;
- /* The current line number information for the current unit. */
- struct debug_lineno *current_lineno;
- /* Mark. This is used by debug_write. */
- unsigned int mark;
- /* A struct/class ID used by debug_write. */
- unsigned int class_id;
- /* The base for class_id for this call to debug_write. */
- unsigned int base_id;
- /* The current line number in debug_write. */
- struct debug_lineno *current_write_lineno;
- unsigned int current_write_lineno_index;
- /* A list of classes which have assigned ID's during debug_write.
- This is linked through the next_id field of debug_class_type. */
- struct debug_class_id *id_list;
- /* A list used to avoid recursion during debug_type_samep. */
- struct debug_type_compare_list *compare_list;
-};
-
-/* Information we keep for a single compilation unit. */
-
-struct debug_unit
-{
- /* The next compilation unit. */
- struct debug_unit *next;
- /* A list of files included in this compilation unit. The first
- file is always the main one, and that is where the main file name
- is stored. */
- struct debug_file *files;
- /* Line number information for this compilation unit. This is not
- stored by function, because assembler code may have line number
- information without function information. */
- struct debug_lineno *linenos;
-};
-
-/* Information kept for a single source file. */
-
-struct debug_file
-{
- /* The next source file in this compilation unit. */
- struct debug_file *next;
- /* The name of the source file. */
- const char *filename;
- /* Global functions, variables, types, etc. */
- struct debug_namespace *globals;
-};
-
-/* A type. */
-
-struct debug_type
-{
- /* Kind of type. */
- enum debug_type_kind kind;
- /* Size of type (0 if not known). */
- unsigned int size;
- /* Type which is a pointer to this type. */
- debug_type pointer;
- /* Tagged union with additional information about the type. */
- union
- {
- /* DEBUG_KIND_INDIRECT. */
- struct debug_indirect_type *kindirect;
- /* DEBUG_KIND_INT. */
- /* Whether the integer is unsigned. */
- boolean kint;
- /* DEBUG_KIND_STRUCT, DEBUG_KIND_UNION, DEBUG_KIND_CLASS,
- DEBUG_KIND_UNION_CLASS. */
- struct debug_class_type *kclass;
- /* DEBUG_KIND_ENUM. */
- struct debug_enum_type *kenum;
- /* DEBUG_KIND_POINTER. */
- struct debug_type *kpointer;
- /* DEBUG_KIND_FUNCTION. */
- struct debug_function_type *kfunction;
- /* DEBUG_KIND_REFERENCE. */
- struct debug_type *kreference;
- /* DEBUG_KIND_RANGE. */
- struct debug_range_type *krange;
- /* DEBUG_KIND_ARRAY. */
- struct debug_array_type *karray;
- /* DEBUG_KIND_SET. */
- struct debug_set_type *kset;
- /* DEBUG_KIND_OFFSET. */
- struct debug_offset_type *koffset;
- /* DEBUG_KIND_METHOD. */
- struct debug_method_type *kmethod;
- /* DEBUG_KIND_CONST. */
- struct debug_type *kconst;
- /* DEBUG_KIND_VOLATILE. */
- struct debug_type *kvolatile;
- /* DEBUG_KIND_NAMED, DEBUG_KIND_TAGGED. */
- struct debug_named_type *knamed;
- } u;
-};
-
-/* Information kept for an indirect type. */
-
-struct debug_indirect_type
-{
- /* Slot where the final type will appear. */
- debug_type *slot;
- /* Tag. */
- const char *tag;
-};
-
-/* Information kept for a struct, union, or class. */
-
-struct debug_class_type
-{
- /* NULL terminated array of fields. */
- debug_field *fields;
- /* A mark field which indicates whether the struct has already been
- printed. */
- unsigned int mark;
- /* This is used to uniquely identify unnamed structs when printing. */
- unsigned int id;
- /* The remaining fields are only used for DEBUG_KIND_CLASS and
- DEBUG_KIND_UNION_CLASS. */
- /* NULL terminated array of base classes. */
- debug_baseclass *baseclasses;
- /* NULL terminated array of methods. */
- debug_method *methods;
- /* The type of the class providing the virtual function table for
- this class. This may point to the type itself. */
- debug_type vptrbase;
-};
-
-/* Information kept for an enum. */
-
-struct debug_enum_type
-{
- /* NULL terminated array of names. */
- const char **names;
- /* Array of corresponding values. */
- bfd_signed_vma *values;
-};
-
-/* Information kept for a function. FIXME: We should be able to
- record the parameter types. */
-
-struct debug_function_type
-{
- /* Return type. */
- debug_type return_type;
- /* NULL terminated array of argument types. */
- debug_type *arg_types;
- /* Whether the function takes a variable number of arguments. */
- boolean varargs;
-};
-
-/* Information kept for a range. */
-
-struct debug_range_type
-{
- /* Range base type. */
- debug_type type;
- /* Lower bound. */
- bfd_signed_vma lower;
- /* Upper bound. */
- bfd_signed_vma upper;
-};
-
-/* Information kept for an array. */
-
-struct debug_array_type
-{
- /* Element type. */
- debug_type element_type;
- /* Range type. */
- debug_type range_type;
- /* Lower bound. */
- bfd_signed_vma lower;
- /* Upper bound. */
- bfd_signed_vma upper;
- /* Whether this array is really a string. */
- boolean stringp;
-};
-
-/* Information kept for a set. */
-
-struct debug_set_type
-{
- /* Base type. */
- debug_type type;
- /* Whether this set is really a bitstring. */
- boolean bitstringp;
-};
-
-/* Information kept for an offset type (a based pointer). */
-
-struct debug_offset_type
-{
- /* The type the pointer is an offset from. */
- debug_type base_type;
- /* The type the pointer points to. */
- debug_type target_type;
-};
-
-/* Information kept for a method type. */
-
-struct debug_method_type
-{
- /* The return type. */
- debug_type return_type;
- /* The object type which this method is for. */
- debug_type domain_type;
- /* A NULL terminated array of argument types. */
- debug_type *arg_types;
- /* Whether the method takes a variable number of arguments. */
- boolean varargs;
-};
-
-/* Information kept for a named type. */
-
-struct debug_named_type
-{
- /* Name. */
- struct debug_name *name;
- /* Real type. */
- debug_type type;
-};
-
-/* A field in a struct or union. */
-
-struct debug_field
-{
- /* Name of the field. */
- const char *name;
- /* Type of the field. */
- struct debug_type *type;
- /* Visibility of the field. */
- enum debug_visibility visibility;
- /* Whether this is a static member. */
- boolean static_member;
- union
- {
- /* If static_member is false. */
- struct
- {
- /* Bit position of the field in the struct. */
- unsigned int bitpos;
- /* Size of the field in bits. */
- unsigned int bitsize;
- } f;
- /* If static_member is true. */
- struct
- {
- const char *physname;
- } s;
- } u;
-};
-
-/* A base class for an object. */
-
-struct debug_baseclass
-{
- /* Type of the base class. */
- struct debug_type *type;
- /* Bit position of the base class in the object. */
- unsigned int bitpos;
- /* Whether the base class is virtual. */
- boolean virtual;
- /* Visibility of the base class. */
- enum debug_visibility visibility;
-};
-
-/* A method of an object. */
-
-struct debug_method
-{
- /* The name of the method. */
- const char *name;
- /* A NULL terminated array of different types of variants. */
- struct debug_method_variant **variants;
-};
-
-/* The variants of a method function of an object. These indicate
- which method to run. */
-
-struct debug_method_variant
-{
- /* The physical name of the function. */
- const char *physname;
- /* The type of the function. */
- struct debug_type *type;
- /* The visibility of the function. */
- enum debug_visibility visibility;
- /* Whether the function is const. */
- boolean constp;
- /* Whether the function is volatile. */
- boolean volatilep;
- /* The offset to the function in the virtual function table. */
- bfd_vma voffset;
- /* If voffset is VOFFSET_STATIC_METHOD, this is a static method. */
-#define VOFFSET_STATIC_METHOD ((bfd_vma) -1)
- /* Context of a virtual method function. */
- struct debug_type *context;
-};
-
-/* A variable. This is the information we keep for a variable object.
- This has no name; a name is associated with a variable in a
- debug_name structure. */
-
-struct debug_variable
-{
- /* Kind of variable. */
- enum debug_var_kind kind;
- /* Type. */
- debug_type type;
- /* Value. The interpretation of the value depends upon kind. */
- bfd_vma val;
-};
-
-/* A function. This has no name; a name is associated with a function
- in a debug_name structure. */
-
-struct debug_function
-{
- /* Return type. */
- debug_type return_type;
- /* Parameter information. */
- struct debug_parameter *parameters;
- /* Block information. The first structure on the list is the main
- block of the function, and describes function local variables. */
- struct debug_block *blocks;
-};
-
-/* A function parameter. */
-
-struct debug_parameter
-{
- /* Next parameter. */
- struct debug_parameter *next;
- /* Name. */
- const char *name;
- /* Type. */
- debug_type type;
- /* Kind. */
- enum debug_parm_kind kind;
- /* Value (meaning depends upon kind). */
- bfd_vma val;
-};
-
-/* A typed constant. */
-
-struct debug_typed_constant
-{
- /* Type. */
- debug_type type;
- /* Value. FIXME: We may eventually need to support non-integral
- values. */
- bfd_vma val;
-};
-
-/* Information about a block within a function. */
-
-struct debug_block
-{
- /* Next block with the same parent. */
- struct debug_block *next;
- /* Parent block. */
- struct debug_block *parent;
- /* List of child blocks. */
- struct debug_block *children;
- /* Start address of the block. */
- bfd_vma start;
- /* End address of the block. */
- bfd_vma end;
- /* Local variables. */
- struct debug_namespace *locals;
-};
-
-/* Line number information we keep for a compilation unit. FIXME:
- This structure is easy to create, but can be very space
- inefficient. */
-
-struct debug_lineno
-{
- /* More line number information for this block. */
- struct debug_lineno *next;
- /* Source file. */
- struct debug_file *file;
- /* Line numbers, terminated by a -1 or the end of the array. */
-#define DEBUG_LINENO_COUNT 10
- unsigned long linenos[DEBUG_LINENO_COUNT];
- /* Addresses for the line numbers. */
- bfd_vma addrs[DEBUG_LINENO_COUNT];
-};
-
-/* A namespace. This is a mapping from names to objects. FIXME: This
- should be implemented as a hash table. */
-
-struct debug_namespace
-{
- /* List of items in this namespace. */
- struct debug_name *list;
- /* Pointer to where the next item in this namespace should go. */
- struct debug_name **tail;
-};
-
-/* Kinds of objects that appear in a namespace. */
-
-enum debug_object_kind
-{
- /* A type. */
- DEBUG_OBJECT_TYPE,
- /* A tagged type (really a different sort of namespace). */
- DEBUG_OBJECT_TAG,
- /* A variable. */
- DEBUG_OBJECT_VARIABLE,
- /* A function. */
- DEBUG_OBJECT_FUNCTION,
- /* An integer constant. */
- DEBUG_OBJECT_INT_CONSTANT,
- /* A floating point constant. */
- DEBUG_OBJECT_FLOAT_CONSTANT,
- /* A typed constant. */
- DEBUG_OBJECT_TYPED_CONSTANT
-};
-
-/* Linkage of an object that appears in a namespace. */
-
-enum debug_object_linkage
-{
- /* Local variable. */
- DEBUG_LINKAGE_AUTOMATIC,
- /* Static--either file static or function static, depending upon the
- namespace is. */
- DEBUG_LINKAGE_STATIC,
- /* Global. */
- DEBUG_LINKAGE_GLOBAL,
- /* No linkage. */
- DEBUG_LINKAGE_NONE
-};
-
-/* A name in a namespace. */
-
-struct debug_name
-{
- /* Next name in this namespace. */
- struct debug_name *next;
- /* Name. */
- const char *name;
- /* Mark. This is used by debug_write. */
- unsigned int mark;
- /* Kind of object. */
- enum debug_object_kind kind;
- /* Linkage of object. */
- enum debug_object_linkage linkage;
- /* Tagged union with additional information about the object. */
- union
- {
- /* DEBUG_OBJECT_TYPE. */
- struct debug_type *type;
- /* DEBUG_OBJECT_TAG. */
- struct debug_type *tag;
- /* DEBUG_OBJECT_VARIABLE. */
- struct debug_variable *variable;
- /* DEBUG_OBJECT_FUNCTION. */
- struct debug_function *function;
- /* DEBUG_OBJECT_INT_CONSTANT. */
- bfd_vma int_constant;
- /* DEBUG_OBJECT_FLOAT_CONSTANT. */
- double float_constant;
- /* DEBUG_OBJECT_TYPED_CONSTANT. */
- struct debug_typed_constant *typed_constant;
- } u;
-};
-
-/* During debug_write, a linked list of these structures is used to
- keep track of ID numbers that have been assigned to classes. */
-
-struct debug_class_id
-{
- /* Next ID number. */
- struct debug_class_id *next;
- /* The type with the ID. */
- struct debug_type *type;
- /* The tag; NULL if no tag. */
- const char *tag;
-};
-
-/* During debug_type_samep, a linked list of these structures is kept
- on the stack to avoid infinite recursion. */
-
-struct debug_type_compare_list
-{
- /* Next type on list. */
- struct debug_type_compare_list *next;
- /* The types we are comparing. */
- struct debug_type *t1;
- struct debug_type *t2;
-};
-
-/* Local functions. */
-
-static void debug_error PARAMS ((const char *));
-static struct debug_name *debug_add_to_namespace
- PARAMS ((struct debug_handle *, struct debug_namespace **, const char *,
- enum debug_object_kind, enum debug_object_linkage));
-static struct debug_name *debug_add_to_current_namespace
- PARAMS ((struct debug_handle *, const char *, enum debug_object_kind,
- enum debug_object_linkage));
-static struct debug_type *debug_make_type
- PARAMS ((struct debug_handle *, enum debug_type_kind, unsigned int));
-static struct debug_type *debug_get_real_type PARAMS ((PTR, debug_type));
-static boolean debug_write_name
- PARAMS ((struct debug_handle *, const struct debug_write_fns *, PTR,
- struct debug_name *));
-static boolean debug_write_type
- PARAMS ((struct debug_handle *, const struct debug_write_fns *, PTR,
- struct debug_type *, struct debug_name *));
-static boolean debug_write_class_type
- PARAMS ((struct debug_handle *, const struct debug_write_fns *, PTR,
- struct debug_type *, const char *));
-static boolean debug_write_function
- PARAMS ((struct debug_handle *, const struct debug_write_fns *, PTR,
- const char *, enum debug_object_linkage, struct debug_function *));
-static boolean debug_write_block
- PARAMS ((struct debug_handle *, const struct debug_write_fns *, PTR,
- struct debug_block *));
-static boolean debug_write_linenos
- PARAMS ((struct debug_handle *, const struct debug_write_fns *, PTR,
- bfd_vma));
-static boolean debug_set_class_id
- PARAMS ((struct debug_handle *, const char *, struct debug_type *));
-static boolean debug_type_samep
- PARAMS ((struct debug_handle *, struct debug_type *, struct debug_type *));
-static boolean debug_class_type_samep
- PARAMS ((struct debug_handle *, struct debug_type *, struct debug_type *));
-
-/* Issue an error message. */
-
-static void
-debug_error (message)
- const char *message;
-{
- fprintf (stderr, "%s\n", message);
-}
-
-/* Add an object to a namespace. */
-
-static struct debug_name *
-debug_add_to_namespace (info, nsp, name, kind, linkage)
- struct debug_handle *info;
- struct debug_namespace **nsp;
- const char *name;
- enum debug_object_kind kind;
- enum debug_object_linkage linkage;
-{
- struct debug_name *n;
- struct debug_namespace *ns;
-
- n = (struct debug_name *) xmalloc (sizeof *n);
- memset (n, 0, sizeof *n);
-
- n->name = name;
- n->kind = kind;
- n->linkage = linkage;
-
- ns = *nsp;
- if (ns == NULL)
- {
- ns = (struct debug_namespace *) xmalloc (sizeof *ns);
- memset (ns, 0, sizeof *ns);
-
- ns->tail = &ns->list;
-
- *nsp = ns;
- }
-
- *ns->tail = n;
- ns->tail = &n->next;
-
- return n;
-}
-
-/* Add an object to the current namespace. */
-
-static struct debug_name *
-debug_add_to_current_namespace (info, name, kind, linkage)
- struct debug_handle *info;
- const char *name;
- enum debug_object_kind kind;
- enum debug_object_linkage linkage;
-{
- struct debug_namespace **nsp;
-
- if (info->current_unit == NULL
- || info->current_file == NULL)
- {
- debug_error ("debug_add_to_current_namespace: no current file");
- return NULL;
- }
-
- if (info->current_block != NULL)
- nsp = &info->current_block->locals;
- else
- nsp = &info->current_file->globals;
-
- return debug_add_to_namespace (info, nsp, name, kind, linkage);
-}
-
-/* Return a handle for debugging information. */
-
-PTR
-debug_init ()
-{
- struct debug_handle *ret;
-
- ret = (struct debug_handle *) xmalloc (sizeof *ret);
- memset (ret, 0, sizeof *ret);
- return (PTR) ret;
-}
-
-/* Set the source filename. This implicitly starts a new compilation
- unit. */
-
-boolean
-debug_set_filename (handle, name)
- PTR handle;
- const char *name;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_file *nfile;
- struct debug_unit *nunit;
-
- if (name == NULL)
- name = "";
-
- nfile = (struct debug_file *) xmalloc (sizeof *nfile);
- memset (nfile, 0, sizeof *nfile);
-
- nfile->filename = name;
-
- nunit = (struct debug_unit *) xmalloc (sizeof *nunit);
- memset (nunit, 0, sizeof *nunit);
-
- nunit->files = nfile;
- info->current_file = nfile;
-
- if (info->current_unit != NULL)
- info->current_unit->next = nunit;
- else
- {
- assert (info->units == NULL);
- info->units = nunit;
- }
-
- info->current_unit = nunit;
-
- info->current_function = NULL;
- info->current_block = NULL;
- info->current_lineno = NULL;
-
- return true;
-}
-
-/* Change source files to the given file name. This is used for
- include files in a single compilation unit. */
-
-boolean
-debug_start_source (handle, name)
- PTR handle;
- const char *name;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_file *f, **pf;
-
- if (name == NULL)
- name = "";
-
- if (info->current_unit == NULL)
- {
- debug_error ("debug_start_source: no debug_set_filename call");
- return false;
- }
-
- for (f = info->current_unit->files; f != NULL; f = f->next)
- {
- if (f->filename[0] == name[0]
- && f->filename[1] == name[1]
- && strcmp (f->filename, name) == 0)
- {
- info->current_file = f;
- return true;
- }
- }
-
- f = (struct debug_file *) xmalloc (sizeof *f);
- memset (f, 0, sizeof *f);
-
- f->filename = name;
-
- for (pf = &info->current_file->next;
- *pf != NULL;
- pf = &(*pf)->next)
- ;
- *pf = f;
-
- info->current_file = f;
-
- return true;
-}
-
-/* Record a function definition. This implicitly starts a function
- block. The debug_type argument is the type of the return value.
- The boolean indicates whether the function is globally visible.
- The bfd_vma is the address of the start of the function. Currently
- the parameter types are specified by calls to
- debug_record_parameter. FIXME: There is no way to specify nested
- functions. */
-
-boolean
-debug_record_function (handle, name, return_type, global, addr)
- PTR handle;
- const char *name;
- debug_type return_type;
- boolean global;
- bfd_vma addr;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_function *f;
- struct debug_block *b;
- struct debug_name *n;
-
- if (name == NULL)
- name = "";
- if (return_type == NULL)
- return false;
-
- if (info->current_unit == NULL)
- {
- debug_error ("debug_record_function: no debug_set_filename call");
- return false;
- }
-
- f = (struct debug_function *) xmalloc (sizeof *f);
- memset (f, 0, sizeof *f);
-
- f->return_type = return_type;
-
- b = (struct debug_block *) xmalloc (sizeof *b);
- memset (b, 0, sizeof *b);
-
- b->start = addr;
- b->end = (bfd_vma) -1;
-
- f->blocks = b;
-
- info->current_function = f;
- info->current_block = b;
-
- /* FIXME: If we could handle nested functions, this would be the
- place: we would want to use a different namespace. */
- n = debug_add_to_namespace (info,
- &info->current_file->globals,
- name,
- DEBUG_OBJECT_FUNCTION,
- (global
- ? DEBUG_LINKAGE_GLOBAL
- : DEBUG_LINKAGE_STATIC));
- if (n == NULL)
- return false;
-
- n->u.function = f;
-
- return true;
-}
-
-/* Record a parameter for the current function. */
-
-boolean
-debug_record_parameter (handle, name, type, kind, val)
- PTR handle;
- const char *name;
- debug_type type;
- enum debug_parm_kind kind;
- bfd_vma val;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_parameter *p, **pp;
-
- if (name == NULL || type == NULL)
- return false;
-
- if (info->current_unit == NULL
- || info->current_function == NULL)
- {
- debug_error ("debug_record_parameter: no current function");
- return false;
- }
-
- p = (struct debug_parameter *) xmalloc (sizeof *p);
- memset (p, 0, sizeof *p);
-
- p->name = name;
- p->type = type;
- p->kind = kind;
- p->val = val;
-
- for (pp = &info->current_function->parameters;
- *pp != NULL;
- pp = &(*pp)->next)
- ;
- *pp = p;
-
- return true;
-}
-
-/* End a function. FIXME: This should handle function nesting. */
-
-boolean
-debug_end_function (handle, addr)
- PTR handle;
- bfd_vma addr;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
-
- if (info->current_unit == NULL
- || info->current_block == NULL
- || info->current_function == NULL)
- {
- debug_error ("debug_end_function: no current function");
- return false;
- }
-
- if (info->current_block->parent != NULL)
- {
- debug_error ("debug_end_function: some blocks were not closed");
- return false;
- }
-
- info->current_block->end = addr;
-
- info->current_function = NULL;
- info->current_block = NULL;
-
- return true;
-}
-
-/* Start a block in a function. All local information will be
- recorded in this block, until the matching call to debug_end_block.
- debug_start_block and debug_end_block may be nested. The bfd_vma
- argument is the address at which this block starts. */
-
-boolean
-debug_start_block (handle, addr)
- PTR handle;
- bfd_vma addr;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_block *b, **pb;
-
- /* We must always have a current block: debug_record_function sets
- one up. */
- if (info->current_unit == NULL
- || info->current_block == NULL)
- {
- debug_error ("debug_start_block: no current block");
- return false;
- }
-
- b = (struct debug_block *) xmalloc (sizeof *b);
- memset (b, 0, sizeof *b);
-
- b->parent = info->current_block;
- b->start = addr;
- b->end = (bfd_vma) -1;
-
- /* This new block is a child of the current block. */
- for (pb = &info->current_block->children;
- *pb != NULL;
- pb = &(*pb)->next)
- ;
- *pb = b;
-
- info->current_block = b;
-
- return true;
-}
-
-/* Finish a block in a function. This matches the call to
- debug_start_block. The argument is the address at which this block
- ends. */
-
-boolean
-debug_end_block (handle, addr)
- PTR handle;
- bfd_vma addr;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_block *parent;
-
- if (info->current_unit == NULL
- || info->current_block == NULL)
- {
- debug_error ("debug_end_block: no current block");
- return false;
- }
-
- parent = info->current_block->parent;
- if (parent == NULL)
- {
- debug_error ("debug_end_block: attempt to close top level block");
- return false;
- }
-
- info->current_block->end = addr;
-
- info->current_block = parent;
-
- return true;
-}
-
-/* Associate a line number in the current source file and function
- with a given address. */
-
-boolean
-debug_record_line (handle, lineno, addr)
- PTR handle;
- unsigned long lineno;
- bfd_vma addr;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_lineno *l;
- unsigned int i;
-
- if (info->current_unit == NULL)
- {
- debug_error ("debug_record_line: no current unit");
- return false;
- }
-
- l = info->current_lineno;
- if (l != NULL && l->file == info->current_file)
- {
- for (i = 0; i < DEBUG_LINENO_COUNT; i++)
- {
- if (l->linenos[i] == (unsigned long) -1)
- {
- l->linenos[i] = lineno;
- l->addrs[i] = addr;
- return true;
- }
- }
- }
-
- /* If we get here, then either 1) there is no current_lineno
- structure, which means this is the first line number in this
- compilation unit, 2) the current_lineno structure is for a
- different file, or 3) the current_lineno structure is full.
- Regardless, we want to allocate a new debug_lineno structure, put
- it in the right place, and make it the new current_lineno
- structure. */
-
- l = (struct debug_lineno *) xmalloc (sizeof *l);
- memset (l, 0, sizeof *l);
-
- l->file = info->current_file;
- l->linenos[0] = lineno;
- l->addrs[0] = addr;
- for (i = 1; i < DEBUG_LINENO_COUNT; i++)
- l->linenos[i] = (unsigned long) -1;
-
- if (info->current_lineno != NULL)
- info->current_lineno->next = l;
- else
- info->current_unit->linenos = l;
-
- info->current_lineno = l;
-
- return true;
-}
-
-/* Start a named common block. This is a block of variables that may
- move in memory. */
-
-boolean
-debug_start_common_block (handle, name)
- PTR handle;
- const char *name;
-{
- /* FIXME */
- debug_error ("debug_start_common_block: not implemented");
- return false;
-}
-
-/* End a named common block. */
-
-boolean
-debug_end_common_block (handle, name)
- PTR handle;
- const char *name;
-{
- /* FIXME */
- debug_error ("debug_end_common_block: not implemented");
- return false;
-}
-
-/* Record a named integer constant. */
-
-boolean
-debug_record_int_const (handle, name, val)
- PTR handle;
- const char *name;
- bfd_vma val;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_name *n;
-
- if (name == NULL)
- return false;
-
- n = debug_add_to_current_namespace (info, name, DEBUG_OBJECT_INT_CONSTANT,
- DEBUG_LINKAGE_NONE);
- if (n == NULL)
- return false;
-
- n->u.int_constant = val;
-
- return true;
-}
-
-/* Record a named floating point constant. */
-
-boolean
-debug_record_float_const (handle, name, val)
- PTR handle;
- const char *name;
- double val;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_name *n;
-
- if (name == NULL)
- return false;
-
- n = debug_add_to_current_namespace (info, name, DEBUG_OBJECT_FLOAT_CONSTANT,
- DEBUG_LINKAGE_NONE);
- if (n == NULL)
- return false;
-
- n->u.float_constant = val;
-
- return true;
-}
-
-/* Record a typed constant with an integral value. */
-
-boolean
-debug_record_typed_const (handle, name, type, val)
- PTR handle;
- const char *name;
- debug_type type;
- bfd_vma val;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_name *n;
- struct debug_typed_constant *tc;
-
- if (name == NULL || type == NULL)
- return false;
-
- n = debug_add_to_current_namespace (info, name, DEBUG_OBJECT_TYPED_CONSTANT,
- DEBUG_LINKAGE_NONE);
- if (n == NULL)
- return false;
-
- tc = (struct debug_typed_constant *) xmalloc (sizeof *tc);
- memset (tc, 0, sizeof *tc);
-
- tc->type = type;
- tc->val = val;
-
- n->u.typed_constant = tc;
-
- return true;
-}
-
-/* Record a label. */
-
-boolean
-debug_record_label (handle, name, type, addr)
- PTR handle;
- const char *name;
- debug_type type;
- bfd_vma addr;
-{
- /* FIXME. */
- debug_error ("debug_record_label not implemented");
- return false;
-}
-
-/* Record a variable. */
-
-boolean
-debug_record_variable (handle, name, type, kind, val)
- PTR handle;
- const char *name;
- debug_type type;
- enum debug_var_kind kind;
- bfd_vma val;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_namespace **nsp;
- enum debug_object_linkage linkage;
- struct debug_name *n;
- struct debug_variable *v;
-
- if (name == NULL || type == NULL)
- return false;
-
- if (info->current_unit == NULL
- || info->current_file == NULL)
- {
- debug_error ("debug_record_variable: no current file");
- return false;
- }
-
- if (kind == DEBUG_GLOBAL || kind == DEBUG_STATIC)
- {
- nsp = &info->current_file->globals;
- if (kind == DEBUG_GLOBAL)
- linkage = DEBUG_LINKAGE_GLOBAL;
- else
- linkage = DEBUG_LINKAGE_STATIC;
- }
- else
- {
- if (info->current_block == NULL)
- {
- debug_error ("debug_record_variable: no current block");
- return false;
- }
- nsp = &info->current_block->locals;
- linkage = DEBUG_LINKAGE_AUTOMATIC;
- }
-
- n = debug_add_to_namespace (info, nsp, name, DEBUG_OBJECT_VARIABLE, linkage);
- if (n == NULL)
- return false;
-
- v = (struct debug_variable *) xmalloc (sizeof *v);
- memset (v, 0, sizeof *v);
-
- v->kind = kind;
- v->type = type;
- v->val = val;
-
- n->u.variable = v;
-
- return true;
-}
-
-/* Make a type with a given kind and size. */
-
-/*ARGSUSED*/
-static struct debug_type *
-debug_make_type (info, kind, size)
- struct debug_handle *info;
- enum debug_type_kind kind;
- unsigned int size;
-{
- struct debug_type *t;
-
- t = (struct debug_type *) xmalloc (sizeof *t);
- memset (t, 0, sizeof *t);
-
- t->kind = kind;
- t->size = size;
-
- return t;
-}
-
-/* Make an indirect type which may be used as a placeholder for a type
- which is referenced before it is defined. */
-
-debug_type
-debug_make_indirect_type (handle, slot, tag)
- PTR handle;
- debug_type *slot;
- const char *tag;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
- struct debug_indirect_type *i;
-
- t = debug_make_type (info, DEBUG_KIND_INDIRECT, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- i = (struct debug_indirect_type *) xmalloc (sizeof *i);
- memset (i, 0, sizeof *i);
-
- i->slot = slot;
- i->tag = tag;
-
- t->u.kindirect = i;
-
- return t;
-}
-
-/* Make a void type. There is only one of these. */
-
-debug_type
-debug_make_void_type (handle)
- PTR handle;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
-
- return debug_make_type (info, DEBUG_KIND_VOID, 0);
-}
-
-/* Make an integer type of a given size. The boolean argument is true
- if the integer is unsigned. */
-
-debug_type
-debug_make_int_type (handle, size, unsignedp)
- PTR handle;
- unsigned int size;
- boolean unsignedp;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
-
- t = debug_make_type (info, DEBUG_KIND_INT, size);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- t->u.kint = unsignedp;
-
- return t;
-}
-
-/* Make a floating point type of a given size. FIXME: On some
- platforms, like an Alpha, you probably need to be able to specify
- the format. */
-
-debug_type
-debug_make_float_type (handle, size)
- PTR handle;
- unsigned int size;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
-
- return debug_make_type (info, DEBUG_KIND_FLOAT, size);
-}
-
-/* Make a boolean type of a given size. */
-
-debug_type
-debug_make_bool_type (handle, size)
- PTR handle;
- unsigned int size;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
-
- return debug_make_type (info, DEBUG_KIND_BOOL, size);
-}
-
-/* Make a complex type of a given size. */
-
-debug_type
-debug_make_complex_type (handle, size)
- PTR handle;
- unsigned int size;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
-
- return debug_make_type (info, DEBUG_KIND_COMPLEX, size);
-}
-
-/* Make a structure type. The second argument is true for a struct,
- false for a union. The third argument is the size of the struct.
- The fourth argument is a NULL terminated array of fields. */
-
-debug_type
-debug_make_struct_type (handle, structp, size, fields)
- PTR handle;
- boolean structp;
- bfd_vma size;
- debug_field *fields;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
- struct debug_class_type *c;
-
- t = debug_make_type (info,
- structp ? DEBUG_KIND_STRUCT : DEBUG_KIND_UNION,
- size);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- c = (struct debug_class_type *) xmalloc (sizeof *c);
- memset (c, 0, sizeof *c);
-
- c->fields = fields;
-
- t->u.kclass = c;
-
- return t;
-}
-
-/* Make an object type. The first three arguments after the handle
- are the same as for debug_make_struct_type. The next arguments are
- a NULL terminated array of base classes, a NULL terminated array of
- methods, the type of the object holding the virtual function table
- if it is not this object, and a boolean which is true if this
- object has its own virtual function table. */
-
-debug_type
-debug_make_object_type (handle, structp, size, fields, baseclasses,
- methods, vptrbase, ownvptr)
- PTR handle;
- boolean structp;
- bfd_vma size;
- debug_field *fields;
- debug_baseclass *baseclasses;
- debug_method *methods;
- debug_type vptrbase;
- boolean ownvptr;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
- struct debug_class_type *c;
-
- t = debug_make_type (info,
- structp ? DEBUG_KIND_CLASS : DEBUG_KIND_UNION_CLASS,
- size);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- c = (struct debug_class_type *) xmalloc (sizeof *c);
- memset (c, 0, sizeof *c);
-
- c->fields = fields;
- c->baseclasses = baseclasses;
- c->methods = methods;
- if (ownvptr)
- c->vptrbase = t;
- else
- c->vptrbase = vptrbase;
-
- t->u.kclass = c;
-
- return t;
-}
-
-/* Make an enumeration type. The arguments are a null terminated
- array of strings, and an array of corresponding values. */
-
-debug_type
-debug_make_enum_type (handle, names, values)
- PTR handle;
- const char **names;
- bfd_signed_vma *values;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
- struct debug_enum_type *e;
-
- t = debug_make_type (info, DEBUG_KIND_ENUM, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- e = (struct debug_enum_type *) xmalloc (sizeof *e);
- memset (e, 0, sizeof *e);
-
- e->names = names;
- e->values = values;
-
- t->u.kenum = e;
-
- return t;
-}
-
-/* Make a pointer to a given type. */
-
-debug_type
-debug_make_pointer_type (handle, type)
- PTR handle;
- debug_type type;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
-
- if (type == NULL)
- return DEBUG_TYPE_NULL;
-
- if (type->pointer != DEBUG_TYPE_NULL)
- return type->pointer;
-
- t = debug_make_type (info, DEBUG_KIND_POINTER, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- t->u.kpointer = type;
-
- type->pointer = t;
-
- return t;
-}
-
-/* Make a function returning a given type. FIXME: We should be able
- to record the parameter types. */
-
-debug_type
-debug_make_function_type (handle, type, arg_types, varargs)
- PTR handle;
- debug_type type;
- debug_type *arg_types;
- boolean varargs;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
- struct debug_function_type *f;
-
- if (type == NULL)
- return DEBUG_TYPE_NULL;
-
- t = debug_make_type (info, DEBUG_KIND_FUNCTION, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- f = (struct debug_function_type *) xmalloc (sizeof *f);
- memset (f, 0, sizeof *f);
-
- f->return_type = type;
- f->arg_types = arg_types;
- f->varargs = varargs;
-
- t->u.kfunction = f;
-
- return t;
-}
-
-/* Make a reference to a given type. */
-
-debug_type
-debug_make_reference_type (handle, type)
- PTR handle;
- debug_type type;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
-
- if (type == NULL)
- return DEBUG_TYPE_NULL;
-
- t = debug_make_type (info, DEBUG_KIND_REFERENCE, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- t->u.kreference = type;
-
- return t;
-}
-
-/* Make a range of a given type from a lower to an upper bound. */
-
-debug_type
-debug_make_range_type (handle, type, lower, upper)
- PTR handle;
- debug_type type;
- bfd_signed_vma lower;
- bfd_signed_vma upper;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
- struct debug_range_type *r;
-
- if (type == NULL)
- return DEBUG_TYPE_NULL;
-
- t = debug_make_type (info, DEBUG_KIND_RANGE, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- r = (struct debug_range_type *) xmalloc (sizeof *r);
- memset (r, 0, sizeof *r);
-
- r->type = type;
- r->lower = lower;
- r->upper = upper;
-
- t->u.krange = r;
-
- return t;
-}
-
-/* Make an array type. The second argument is the type of an element
- of the array. The third argument is the type of a range of the
- array. The fourth and fifth argument are the lower and upper
- bounds, respectively. The sixth argument is true if this array is
- actually a string, as in C. */
-
-debug_type
-debug_make_array_type (handle, element_type, range_type, lower, upper,
- stringp)
- PTR handle;
- debug_type element_type;
- debug_type range_type;
- bfd_signed_vma lower;
- bfd_signed_vma upper;
- boolean stringp;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
- struct debug_array_type *a;
-
- if (element_type == NULL || range_type == NULL)
- return DEBUG_TYPE_NULL;
-
- t = debug_make_type (info, DEBUG_KIND_ARRAY, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- a = (struct debug_array_type *) xmalloc (sizeof *a);
- memset (a, 0, sizeof *a);
-
- a->element_type = element_type;
- a->range_type = range_type;
- a->lower = lower;
- a->upper = upper;
- a->stringp = stringp;
-
- t->u.karray = a;
-
- return t;
-}
-
-/* Make a set of a given type. For example, a Pascal set type. The
- boolean argument is true if this set is actually a bitstring, as in
- CHILL. */
-
-debug_type
-debug_make_set_type (handle, type, bitstringp)
- PTR handle;
- debug_type type;
- boolean bitstringp;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
- struct debug_set_type *s;
-
- if (type == NULL)
- return DEBUG_TYPE_NULL;
-
- t = debug_make_type (info, DEBUG_KIND_SET, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- s = (struct debug_set_type *) xmalloc (sizeof *s);
- memset (s, 0, sizeof *s);
-
- s->type = type;
- s->bitstringp = bitstringp;
-
- t->u.kset = s;
-
- return t;
-}
-
-/* Make a type for a pointer which is relative to an object. The
- second argument is the type of the object to which the pointer is
- relative. The third argument is the type that the pointer points
- to. */
-
-debug_type
-debug_make_offset_type (handle, base_type, target_type)
- PTR handle;
- debug_type base_type;
- debug_type target_type;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
- struct debug_offset_type *o;
-
- if (base_type == NULL || target_type == NULL)
- return DEBUG_TYPE_NULL;
-
- t = debug_make_type (info, DEBUG_KIND_OFFSET, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- o = (struct debug_offset_type *) xmalloc (sizeof *o);
- memset (o, 0, sizeof *o);
-
- o->base_type = base_type;
- o->target_type = target_type;
-
- t->u.koffset = o;
-
- return t;
-}
-
-/* Make a type for a method function. The second argument is the
- return type, the third argument is the domain, and the fourth
- argument is a NULL terminated array of argument types. */
-
-debug_type
-debug_make_method_type (handle, return_type, domain_type, arg_types, varargs)
- PTR handle;
- debug_type return_type;
- debug_type domain_type;
- debug_type *arg_types;
- boolean varargs;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
- struct debug_method_type *m;
-
- if (return_type == NULL)
- return DEBUG_TYPE_NULL;
-
- t = debug_make_type (info, DEBUG_KIND_METHOD, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- m = (struct debug_method_type *) xmalloc (sizeof *m);
- memset (m, 0, sizeof *m);
-
- m->return_type = return_type;
- m->domain_type = domain_type;
- m->arg_types = arg_types;
- m->varargs = varargs;
-
- t->u.kmethod = m;
-
- return t;
-}
-
-/* Make a const qualified version of a given type. */
-
-debug_type
-debug_make_const_type (handle, type)
- PTR handle;
- debug_type type;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
-
- if (type == NULL)
- return DEBUG_TYPE_NULL;
-
- t = debug_make_type (info, DEBUG_KIND_CONST, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- t->u.kconst = type;
-
- return t;
-}
-
-/* Make a volatile qualified version of a given type. */
-
-debug_type
-debug_make_volatile_type (handle, type)
- PTR handle;
- debug_type type;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
-
- if (type == NULL)
- return DEBUG_TYPE_NULL;
-
- t = debug_make_type (info, DEBUG_KIND_VOLATILE, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- t->u.kvolatile = type;
-
- return t;
-}
-
-/* Make an undefined tagged type. For example, a struct which has
- been mentioned, but not defined. */
-
-debug_type
-debug_make_undefined_tagged_type (handle, name, kind)
- PTR handle;
- const char *name;
- enum debug_type_kind kind;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
-
- if (name == NULL)
- return DEBUG_TYPE_NULL;
-
- switch (kind)
- {
- case DEBUG_KIND_STRUCT:
- case DEBUG_KIND_UNION:
- case DEBUG_KIND_CLASS:
- case DEBUG_KIND_UNION_CLASS:
- case DEBUG_KIND_ENUM:
- break;
-
- default:
- debug_error ("debug_make_undefined_type: unsupported kind");
- return DEBUG_TYPE_NULL;
- }
-
- t = debug_make_type (info, kind, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- return debug_tag_type (handle, name, t);
-}
-
-/* Make a base class for an object. The second argument is the base
- class type. The third argument is the bit position of this base
- class in the object (always 0 unless doing multiple inheritance).
- The fourth argument is whether this is a virtual class. The fifth
- argument is the visibility of the base class. */
-
-/*ARGSUSED*/
-debug_baseclass
-debug_make_baseclass (handle, type, bitpos, virtual, visibility)
- PTR handle;
- debug_type type;
- bfd_vma bitpos;
- boolean virtual;
- enum debug_visibility visibility;
-{
- struct debug_baseclass *b;
-
- b = (struct debug_baseclass *) xmalloc (sizeof *b);
- memset (b, 0, sizeof *b);
-
- b->type = type;
- b->bitpos = bitpos;
- b->virtual = virtual;
- b->visibility = visibility;
-
- return b;
-}
-
-/* Make a field for a struct. The second argument is the name. The
- third argument is the type of the field. The fourth argument is
- the bit position of the field. The fifth argument is the size of
- the field (it may be zero). The sixth argument is the visibility
- of the field. */
-
-/*ARGSUSED*/
-debug_field
-debug_make_field (handle, name, type, bitpos, bitsize, visibility)
- PTR handle;
- const char *name;
- debug_type type;
- bfd_vma bitpos;
- bfd_vma bitsize;
- enum debug_visibility visibility;
-{
- struct debug_field *f;
-
- f = (struct debug_field *) xmalloc (sizeof *f);
- memset (f, 0, sizeof *f);
-
- f->name = name;
- f->type = type;
- f->static_member = false;
- f->u.f.bitpos = bitpos;
- f->u.f.bitsize = bitsize;
- f->visibility = visibility;
-
- return f;
-}
-
-/* Make a static member of an object. The second argument is the
- name. The third argument is the type of the member. The fourth
- argument is the physical name of the member (i.e., the name as a
- global variable). The fifth argument is the visibility of the
- member. */
-
-/*ARGSUSED*/
-debug_field
-debug_make_static_member (handle, name, type, physname, visibility)
- PTR handle;
- const char *name;
- debug_type type;
- const char *physname;
- enum debug_visibility visibility;
-{
- struct debug_field *f;
-
- f = (struct debug_field *) xmalloc (sizeof *f);
- memset (f, 0, sizeof *f);
-
- f->name = name;
- f->type = type;
- f->static_member = true;
- f->u.s.physname = physname;
- f->visibility = visibility;
-
- return f;
-}
-
-/* Make a method. The second argument is the name, and the third
- argument is a NULL terminated array of method variants. */
-
-/*ARGSUSED*/
-debug_method
-debug_make_method (handle, name, variants)
- PTR handle;
- const char *name;
- debug_method_variant *variants;
-{
- struct debug_method *m;
-
- m = (struct debug_method *) xmalloc (sizeof *m);
- memset (m, 0, sizeof *m);
-
- m->name = name;
- m->variants = variants;
-
- return m;
-}
-
-/* Make a method argument. The second argument is the real name of
- the function. The third argument is the type of the function. The
- fourth argument is the visibility. The fifth argument is whether
- this is a const function. The sixth argument is whether this is a
- volatile function. The seventh argument is the offset in the
- virtual function table, if any. The eighth argument is the virtual
- function context. FIXME: Are the const and volatile arguments
- necessary? Could we just use debug_make_const_type? */
-
-/*ARGSUSED*/
-debug_method_variant
-debug_make_method_variant (handle, physname, type, visibility, constp,
- volatilep, voffset, context)
- PTR handle;
- const char *physname;
- debug_type type;
- enum debug_visibility visibility;
- boolean constp;
- boolean volatilep;
- bfd_vma voffset;
- debug_type context;
-{
- struct debug_method_variant *m;
-
- m = (struct debug_method_variant *) xmalloc (sizeof *m);
- memset (m, 0, sizeof *m);
-
- m->physname = physname;
- m->type = type;
- m->visibility = visibility;
- m->constp = constp;
- m->volatilep = volatilep;
- m->voffset = voffset;
- m->context = context;
-
- return m;
-}
-
-/* Make a static method argument. The arguments are the same as for
- debug_make_method_variant, except that the last two are omitted
- since a static method can not also be virtual. */
-
-debug_method_variant
-debug_make_static_method_variant (handle, physname, type, visibility,
- constp, volatilep)
- PTR handle;
- const char *physname;
- debug_type type;
- enum debug_visibility visibility;
- boolean constp;
- boolean volatilep;
-{
- struct debug_method_variant *m;
-
- m = (struct debug_method_variant *) xmalloc (sizeof *m);
- memset (m, 0, sizeof *m);
-
- m->physname = physname;
- m->type = type;
- m->visibility = visibility;
- m->constp = constp;
- m->volatilep = volatilep;
- m->voffset = VOFFSET_STATIC_METHOD;
-
- return m;
-}
-
-/* Name a type. */
-
-debug_type
-debug_name_type (handle, name, type)
- PTR handle;
- const char *name;
- debug_type type;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
- struct debug_named_type *n;
- struct debug_name *nm;
-
- if (name == NULL || type == NULL)
- return DEBUG_TYPE_NULL;
-
- if (info->current_unit == NULL
- || info->current_file == NULL)
- {
- debug_error ("debug_name_type: no current file");
- return DEBUG_TYPE_NULL;
- /* return false; */
- }
-
- t = debug_make_type (info, DEBUG_KIND_NAMED, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- n = (struct debug_named_type *) xmalloc (sizeof *n);
- memset (n, 0, sizeof *n);
-
- n->type = type;
-
- t->u.knamed = n;
-
- /* We always add the name to the global namespace. This is probably
- wrong in some cases, but it seems to be right for stabs. FIXME. */
-
- nm = debug_add_to_namespace (info, &info->current_file->globals, name,
- DEBUG_OBJECT_TYPE, DEBUG_LINKAGE_NONE);
- if (nm == NULL)
- return DEBUG_TYPE_NULL;
-
- nm->u.type = t;
-
- n->name = nm;
-
- return t;
-}
-
-/* Tag a type. */
-
-debug_type
-debug_tag_type (handle, name, type)
- PTR handle;
- const char *name;
- debug_type type;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_type *t;
- struct debug_named_type *n;
- struct debug_name *nm;
-
- if (name == NULL || type == NULL)
- return DEBUG_TYPE_NULL;
-
- if (info->current_file == NULL)
- {
- debug_error ("debug_tag_type: no current file");
- return DEBUG_TYPE_NULL;
- }
-
- if (type->kind == DEBUG_KIND_TAGGED)
- {
- if (strcmp (type->u.knamed->name->name, name) == 0)
- return type;
- debug_error ("debug_tag_type: extra tag attempted");
- return DEBUG_TYPE_NULL;
- }
-
- t = debug_make_type (info, DEBUG_KIND_TAGGED, 0);
- if (t == NULL)
- return DEBUG_TYPE_NULL;
-
- n = (struct debug_named_type *) xmalloc (sizeof *n);
- memset (n, 0, sizeof *n);
-
- n->type = type;
-
- t->u.knamed = n;
-
- /* We keep a global namespace of tags for each compilation unit. I
- don't know if that is the right thing to do. */
-
- nm = debug_add_to_namespace (info, &info->current_file->globals, name,
- DEBUG_OBJECT_TAG, DEBUG_LINKAGE_NONE);
- if (nm == NULL)
- return DEBUG_TYPE_NULL;
-
- nm->u.tag = t;
-
- n->name = nm;
-
- return t;
-}
-
-/* Record the size of a given type. */
-
-/*ARGSUSED*/
-boolean
-debug_record_type_size (handle, type, size)
- PTR handle;
- debug_type type;
- unsigned int size;
-{
-#if 0
- if (type->size != 0 && type->size != size)
- fprintf (stderr, "Warning: changing type size from %d to %d\n",
- type->size, size);
-#endif
-
- type->size = size;
-
- return true;
-}
-
-/* Find a named type. */
-
-debug_type
-debug_find_named_type (handle, name)
- PTR handle;
- const char *name;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_block *b;
- struct debug_file *f;
-
- /* We only search the current compilation unit. I don't know if
- this is right or not. */
-
- if (info->current_unit == NULL)
- {
- debug_error ("debug_find_named_type: no current compilation unit");
- return DEBUG_TYPE_NULL;
- }
-
- for (b = info->current_block; b != NULL; b = b->parent)
- {
- if (b->locals != NULL)
- {
- struct debug_name *n;
-
- for (n = b->locals->list; n != NULL; n = n->next)
- {
- if (n->kind == DEBUG_OBJECT_TYPE
- && n->name[0] == name[0]
- && strcmp (n->name, name) == 0)
- return n->u.type;
- }
- }
- }
-
- for (f = info->current_unit->files; f != NULL; f = f->next)
- {
- if (f->globals != NULL)
- {
- struct debug_name *n;
-
- for (n = f->globals->list; n != NULL; n = n->next)
- {
- if (n->kind == DEBUG_OBJECT_TYPE
- && n->name[0] == name[0]
- && strcmp (n->name, name) == 0)
- return n->u.type;
- }
- }
- }
-
- return DEBUG_TYPE_NULL;
-}
-
-/* Find a tagged type. */
-
-debug_type
-debug_find_tagged_type (handle, name, kind)
- PTR handle;
- const char *name;
- enum debug_type_kind kind;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_unit *u;
-
- /* We search the globals of all the compilation units. I don't know
- if this is correct or not. It would be easy to change. */
-
- for (u = info->units; u != NULL; u = u->next)
- {
- struct debug_file *f;
-
- for (f = u->files; f != NULL; f = f->next)
- {
- struct debug_name *n;
-
- if (f->globals != NULL)
- {
- for (n = f->globals->list; n != NULL; n = n->next)
- {
- if (n->kind == DEBUG_OBJECT_TAG
- && (kind == DEBUG_KIND_ILLEGAL
- || n->u.tag->kind == kind)
- && n->name[0] == name[0]
- && strcmp (n->name, name) == 0)
- return n->u.tag;
- }
- }
- }
- }
-
- return DEBUG_TYPE_NULL;
-}
-
-/* Get a base type. */
-
-static struct debug_type *
-debug_get_real_type (handle, type)
- PTR handle;
- debug_type type;
-{
- switch (type->kind)
- {
- default:
- return type;
- case DEBUG_KIND_INDIRECT:
- if (*type->u.kindirect->slot != NULL)
- return debug_get_real_type (handle, *type->u.kindirect->slot);
- return type;
- case DEBUG_KIND_NAMED:
- case DEBUG_KIND_TAGGED:
- return debug_get_real_type (handle, type->u.knamed->type);
- }
- /*NOTREACHED*/
-}
-
-/* Get the kind of a type. */
-
-enum debug_type_kind
-debug_get_type_kind (handle, type)
- PTR handle;
- debug_type type;
-{
- if (type == NULL)
- return DEBUG_KIND_ILLEGAL;
- type = debug_get_real_type (handle, type);
- return type->kind;
-}
-
-/* Get the name of a type. */
-
-const char *
-debug_get_type_name (handle, type)
- PTR handle;
- debug_type type;
-{
- if (type->kind == DEBUG_KIND_INDIRECT)
- {
- if (*type->u.kindirect->slot != NULL)
- return debug_get_type_name (handle, *type->u.kindirect->slot);
- return type->u.kindirect->tag;
- }
- if (type->kind == DEBUG_KIND_NAMED
- || type->kind == DEBUG_KIND_TAGGED)
- return type->u.knamed->name->name;
- return NULL;
-}
-
-/* Get the size of a type. */
-
-bfd_vma
-debug_get_type_size (handle, type)
- PTR handle;
- debug_type type;
-{
- if (type == NULL)
- return 0;
-
- /* We don't call debug_get_real_type, because somebody might have
- called debug_record_type_size on a named or indirect type. */
-
- if (type->size != 0)
- return type->size;
-
- switch (type->kind)
- {
- default:
- return 0;
- case DEBUG_KIND_INDIRECT:
- if (*type->u.kindirect->slot != NULL)
- return debug_get_type_size (handle, *type->u.kindirect->slot);
- return 0;
- case DEBUG_KIND_NAMED:
- case DEBUG_KIND_TAGGED:
- return debug_get_type_size (handle, type->u.knamed->type);
- }
- /*NOTREACHED*/
-}
-
-/* Get the return type of a function or method type. */
-
-debug_type
-debug_get_return_type (handle, type)
- PTR handle;
- debug_type type;
-{
- if (type == NULL)
- return DEBUG_TYPE_NULL;
- type = debug_get_real_type (handle, type);
- switch (type->kind)
- {
- default:
- return DEBUG_TYPE_NULL;
- case DEBUG_KIND_FUNCTION:
- return type->u.kfunction->return_type;
- case DEBUG_KIND_METHOD:
- return type->u.kmethod->return_type;
- }
- /*NOTREACHED*/
-}
-
-/* Get the parameter types of a function or method type (except that
- we don't currently store the parameter types of a function). */
-
-const debug_type *
-debug_get_parameter_types (handle, type, pvarargs)
- PTR handle;
- debug_type type;
- boolean *pvarargs;
-{
- if (type == NULL)
- return NULL;
- type = debug_get_real_type (handle, type);
- switch (type->kind)
- {
- default:
- return NULL;
- case DEBUG_KIND_FUNCTION:
- *pvarargs = type->u.kfunction->varargs;
- return type->u.kfunction->arg_types;
- case DEBUG_KIND_METHOD:
- *pvarargs = type->u.kmethod->varargs;
- return type->u.kmethod->arg_types;
- }
- /*NOTREACHED*/
-}
-
-/* Get the target type of a type. */
-
-debug_type
-debug_get_target_type (handle, type)
- PTR handle;
- debug_type type;
-{
- if (type == NULL)
- return NULL;
- type = debug_get_real_type (handle, type);
- switch (type->kind)
- {
- default:
- return NULL;
- case DEBUG_KIND_POINTER:
- return type->u.kpointer;
- case DEBUG_KIND_REFERENCE:
- return type->u.kreference;
- case DEBUG_KIND_CONST:
- return type->u.kconst;
- case DEBUG_KIND_VOLATILE:
- return type->u.kvolatile;
- }
- /*NOTREACHED*/
-}
-
-/* Get the NULL terminated array of fields for a struct, union, or
- class. */
-
-const debug_field *
-debug_get_fields (handle, type)
- PTR handle;
- debug_type type;
-{
- if (type == NULL)
- return NULL;
- type = debug_get_real_type (handle, type);
- switch (type->kind)
- {
- default:
- return NULL;
- case DEBUG_KIND_STRUCT:
- case DEBUG_KIND_UNION:
- case DEBUG_KIND_CLASS:
- case DEBUG_KIND_UNION_CLASS:
- return type->u.kclass->fields;
- }
- /*NOTREACHED*/
-}
-
-/* Get the type of a field. */
-
-/*ARGSUSED*/
-debug_type
-debug_get_field_type (handle, field)
- PTR handle;
- debug_field field;
-{
- if (field == NULL)
- return NULL;
- return field->type;
-}
-
-/* Get the name of a field. */
-
-/*ARGSUSED*/
-const char *
-debug_get_field_name (handle, field)
- PTR handle;
- debug_field field;
-{
- if (field == NULL)
- return NULL;
- return field->name;
-}
-
-/* Get the bit position of a field. */
-
-/*ARGSUSED*/
-bfd_vma
-debug_get_field_bitpos (handle, field)
- PTR handle;
- debug_field field;
-{
- if (field == NULL || field->static_member)
- return (bfd_vma) -1;
- return field->u.f.bitpos;
-}
-
-/* Get the bit size of a field. */
-
-/*ARGSUSED*/
-bfd_vma
-debug_get_field_bitsize (handle, field)
- PTR handle;
- debug_field field;
-{
- if (field == NULL || field->static_member)
- return (bfd_vma) -1;
- return field->u.f.bitsize;
-}
-
-/* Get the visibility of a field. */
-
-/*ARGSUSED*/
-enum debug_visibility
-debug_get_field_visibility (handle, field)
- PTR handle;
- debug_field field;
-{
- if (field == NULL)
- return DEBUG_VISIBILITY_IGNORE;
- return field->visibility;
-}
-
-/* Get the physical name of a field. */
-
-const char *
-debug_get_field_physname (handle, field)
- PTR handle;
- debug_field field;
-{
- if (field == NULL || ! field->static_member)
- return NULL;
- return field->u.s.physname;
-}
-
-/* Write out the debugging information. This is given a handle to
- debugging information, and a set of function pointers to call. */
-
-boolean
-debug_write (handle, fns, fhandle)
- PTR handle;
- const struct debug_write_fns *fns;
- PTR fhandle;
-{
- struct debug_handle *info = (struct debug_handle *) handle;
- struct debug_unit *u;
-
- /* We use a mark to tell whether we have already written out a
- particular name. We use an integer, so that we don't have to
- clear the mark fields if we happen to write out the same
- information more than once. */
- ++info->mark;
-
- /* The base_id field holds an ID value which will never be used, so
- that we can tell whether we have assigned an ID during this call
- to debug_write. */
- info->base_id = info->class_id;
-
- /* We keep a linked list of classes for which was have assigned ID's
- during this call to debug_write. */
- info->id_list = NULL;
-
- for (u = info->units; u != NULL; u = u->next)
- {
- struct debug_file *f;
- boolean first_file;
-
- info->current_write_lineno = u->linenos;
- info->current_write_lineno_index = 0;
-
- if (! (*fns->start_compilation_unit) (fhandle, u->files->filename))
- return false;
-
- first_file = true;
- for (f = u->files; f != NULL; f = f->next)
- {
- struct debug_name *n;
-
- if (first_file)
- first_file = false;
- else
- {
- if (! (*fns->start_source) (fhandle, f->filename))
- return false;
- }
-
- if (f->globals != NULL)
- {
- for (n = f->globals->list; n != NULL; n = n->next)
- {
- if (! debug_write_name (info, fns, fhandle, n))
- return false;
- }
- }
- }
-
- /* Output any line number information which hasn't already been
- handled. */
- if (! debug_write_linenos (info, fns, fhandle, (bfd_vma) -1))
- return false;
- }
-
- return true;
-}
-
-/* Write out an element in a namespace. */
-
-static boolean
-debug_write_name (info, fns, fhandle, n)
- struct debug_handle *info;
- const struct debug_write_fns *fns;
- PTR fhandle;
- struct debug_name *n;
-{
- switch (n->kind)
- {
- case DEBUG_OBJECT_TYPE:
- if (! debug_write_type (info, fns, fhandle, n->u.type, n)
- || ! (*fns->typdef) (fhandle, n->name))
- return false;
- return true;
- case DEBUG_OBJECT_TAG:
- if (! debug_write_type (info, fns, fhandle, n->u.tag, n))
- return false;
- return (*fns->tag) (fhandle, n->name);
- case DEBUG_OBJECT_VARIABLE:
- if (! debug_write_type (info, fns, fhandle, n->u.variable->type,
- (struct debug_name *) NULL))
- return false;
- return (*fns->variable) (fhandle, n->name, n->u.variable->kind,
- n->u.variable->val);
- case DEBUG_OBJECT_FUNCTION:
- return debug_write_function (info, fns, fhandle, n->name,
- n->linkage, n->u.function);
- case DEBUG_OBJECT_INT_CONSTANT:
- return (*fns->int_constant) (fhandle, n->name, n->u.int_constant);
- case DEBUG_OBJECT_FLOAT_CONSTANT:
- return (*fns->float_constant) (fhandle, n->name, n->u.float_constant);
- case DEBUG_OBJECT_TYPED_CONSTANT:
- if (! debug_write_type (info, fns, fhandle, n->u.typed_constant->type,
- (struct debug_name *) NULL))
- return false;
- return (*fns->typed_constant) (fhandle, n->name,
- n->u.typed_constant->val);
- default:
- abort ();
- return false;
- }
- /*NOTREACHED*/
-}
-
-/* Write out a type. If the type is DEBUG_KIND_NAMED or
- DEBUG_KIND_TAGGED, then the name argument is the name for which we
- are about to call typedef or tag. If the type is anything else,
- then the name argument is a tag from a DEBUG_KIND_TAGGED type which
- points to this one. */
-
-static boolean
-debug_write_type (info, fns, fhandle, type, name)
- struct debug_handle *info;
- const struct debug_write_fns *fns;
- PTR fhandle;
- struct debug_type *type;
- struct debug_name *name;
-{
- unsigned int i;
- int is;
- const char *tag;
-
- /* If we have a name for this type, just output it. We only output
- typedef names after they have been defined. We output type tags
- whenever we are not actually defining them. */
- if ((type->kind == DEBUG_KIND_NAMED
- || type->kind == DEBUG_KIND_TAGGED)
- && (type->u.knamed->name->mark == info->mark
- || (type->kind == DEBUG_KIND_TAGGED
- && type->u.knamed->name != name)))
- {
- if (type->kind == DEBUG_KIND_NAMED)
- return (*fns->typedef_type) (fhandle, type->u.knamed->name->name);
- else
- {
- struct debug_type *real;
- unsigned int id;
-
- real = debug_get_real_type ((PTR) info, type);
- id = 0;
- if ((real->kind == DEBUG_KIND_STRUCT
- || real->kind == DEBUG_KIND_UNION
- || real->kind == DEBUG_KIND_CLASS
- || real->kind == DEBUG_KIND_UNION_CLASS)
- && real->u.kclass != NULL)
- {
- if (real->u.kclass->id <= info->base_id)
- {
- if (! debug_set_class_id (info,
- type->u.knamed->name->name,
- real))
- return false;
- }
- id = real->u.kclass->id;
- }
-
- return (*fns->tag_type) (fhandle, type->u.knamed->name->name, id,
- real->kind);
- }
- }
-
- /* Mark the name after we have already looked for a known name, so
- that we don't just define a type in terms of itself. We need to
- mark the name here so that a struct containing a pointer to
- itself will work. */
- if (name != NULL)
- name->mark = info->mark;
-
- tag = NULL;
- if (name != NULL
- && type->kind != DEBUG_KIND_NAMED
- && type->kind != DEBUG_KIND_TAGGED)
- {
- assert (name->kind == DEBUG_OBJECT_TAG);
- tag = name->name;
- }
-
- switch (type->kind)
- {
- case DEBUG_KIND_ILLEGAL:
- debug_error ("debug_write_type: illegal type encountered");
- return false;
- case DEBUG_KIND_INDIRECT:
- if (*type->u.kindirect->slot == DEBUG_TYPE_NULL)
- return (*fns->empty_type) (fhandle);
- return debug_write_type (info, fns, fhandle, *type->u.kindirect->slot,
- name);
- case DEBUG_KIND_VOID:
- return (*fns->void_type) (fhandle);
- case DEBUG_KIND_INT:
- return (*fns->int_type) (fhandle, type->size, type->u.kint);
- case DEBUG_KIND_FLOAT:
- return (*fns->float_type) (fhandle, type->size);
- case DEBUG_KIND_COMPLEX:
- return (*fns->complex_type) (fhandle, type->size);
- case DEBUG_KIND_BOOL:
- return (*fns->bool_type) (fhandle, type->size);
- case DEBUG_KIND_STRUCT:
- case DEBUG_KIND_UNION:
- if (type->u.kclass != NULL)
- {
- if (type->u.kclass->id <= info->base_id)
- {
- if (! debug_set_class_id (info, tag, type))
- return false;
- }
-
- if (info->mark == type->u.kclass->mark)
- {
- /* We are currently outputting this struct, or we have
- already output it. I don't know if this can happen,
- but it can happen for a class. */
- assert (type->u.kclass->id > info->base_id);
- return (*fns->tag_type) (fhandle, tag, type->u.kclass->id,
- type->kind);
- }
- type->u.kclass->mark = info->mark;
- }
-
- if (! (*fns->start_struct_type) (fhandle, tag,
- (type->u.kclass != NULL
- ? type->u.kclass->id
- : 0),
- type->kind == DEBUG_KIND_STRUCT,
- type->size))
- return false;
- if (type->u.kclass != NULL
- && type->u.kclass->fields != NULL)
- {
- for (i = 0; type->u.kclass->fields[i] != NULL; i++)
- {
- struct debug_field *f;
-
- f = type->u.kclass->fields[i];
- if (! debug_write_type (info, fns, fhandle, f->type,
- (struct debug_name *) NULL)
- || ! (*fns->struct_field) (fhandle, f->name, f->u.f.bitpos,
- f->u.f.bitsize, f->visibility))
- return false;
- }
- }
- return (*fns->end_struct_type) (fhandle);
- case DEBUG_KIND_CLASS:
- case DEBUG_KIND_UNION_CLASS:
- return debug_write_class_type (info, fns, fhandle, type, tag);
- case DEBUG_KIND_ENUM:
- if (type->u.kenum == NULL)
- return (*fns->enum_type) (fhandle, tag, (const char **) NULL,
- (bfd_signed_vma *) NULL);
- return (*fns->enum_type) (fhandle, tag, type->u.kenum->names,
- type->u.kenum->values);
- case DEBUG_KIND_POINTER:
- if (! debug_write_type (info, fns, fhandle, type->u.kpointer,
- (struct debug_name *) NULL))
- return false;
- return (*fns->pointer_type) (fhandle);
- case DEBUG_KIND_FUNCTION:
- if (! debug_write_type (info, fns, fhandle,
- type->u.kfunction->return_type,
- (struct debug_name *) NULL))
- return false;
- if (type->u.kfunction->arg_types == NULL)
- is = -1;
- else
- {
- for (is = 0; type->u.kfunction->arg_types[is] != NULL; is++)
- if (! debug_write_type (info, fns, fhandle,
- type->u.kfunction->arg_types[is],
- (struct debug_name *) NULL))
- return false;
- }
- return (*fns->function_type) (fhandle, is,
- type->u.kfunction->varargs);
- case DEBUG_KIND_REFERENCE:
- if (! debug_write_type (info, fns, fhandle, type->u.kreference,
- (struct debug_name *) NULL))
- return false;
- return (*fns->reference_type) (fhandle);
- case DEBUG_KIND_RANGE:
- if (! debug_write_type (info, fns, fhandle, type->u.krange->type,
- (struct debug_name *) NULL))
- return false;
- return (*fns->range_type) (fhandle, type->u.krange->lower,
- type->u.krange->upper);
- case DEBUG_KIND_ARRAY:
- if (! debug_write_type (info, fns, fhandle, type->u.karray->element_type,
- (struct debug_name *) NULL)
- || ! debug_write_type (info, fns, fhandle,
- type->u.karray->range_type,
- (struct debug_name *) NULL))
- return false;
- return (*fns->array_type) (fhandle, type->u.karray->lower,
- type->u.karray->upper,
- type->u.karray->stringp);
- case DEBUG_KIND_SET:
- if (! debug_write_type (info, fns, fhandle, type->u.kset->type,
- (struct debug_name *) NULL))
- return false;
- return (*fns->set_type) (fhandle, type->u.kset->bitstringp);
- case DEBUG_KIND_OFFSET:
- if (! debug_write_type (info, fns, fhandle, type->u.koffset->base_type,
- (struct debug_name *) NULL)
- || ! debug_write_type (info, fns, fhandle,
- type->u.koffset->target_type,
- (struct debug_name *) NULL))
- return false;
- return (*fns->offset_type) (fhandle);
- case DEBUG_KIND_METHOD:
- if (! debug_write_type (info, fns, fhandle,
- type->u.kmethod->return_type,
- (struct debug_name *) NULL))
- return false;
- if (type->u.kmethod->arg_types == NULL)
- is = -1;
- else
- {
- for (is = 0; type->u.kmethod->arg_types[is] != NULL; is++)
- if (! debug_write_type (info, fns, fhandle,
- type->u.kmethod->arg_types[is],
- (struct debug_name *) NULL))
- return false;
- }
- if (type->u.kmethod->domain_type != NULL)
- {
- if (! debug_write_type (info, fns, fhandle,
- type->u.kmethod->domain_type,
- (struct debug_name *) NULL))
- return false;
- }
- return (*fns->method_type) (fhandle,
- type->u.kmethod->domain_type != NULL,
- is,
- type->u.kmethod->varargs);
- case DEBUG_KIND_CONST:
- if (! debug_write_type (info, fns, fhandle, type->u.kconst,
- (struct debug_name *) NULL))
- return false;
- return (*fns->const_type) (fhandle);
- case DEBUG_KIND_VOLATILE:
- if (! debug_write_type (info, fns, fhandle, type->u.kvolatile,
- (struct debug_name *) NULL))
- return false;
- return (*fns->volatile_type) (fhandle);
- case DEBUG_KIND_NAMED:
- return debug_write_type (info, fns, fhandle, type->u.knamed->type,
- (struct debug_name *) NULL);
- case DEBUG_KIND_TAGGED:
- return debug_write_type (info, fns, fhandle, type->u.knamed->type,
- type->u.knamed->name);
- default:
- abort ();
- return false;
- }
-}
-
-/* Write out a class type. */
-
-static boolean
-debug_write_class_type (info, fns, fhandle, type, tag)
- struct debug_handle *info;
- const struct debug_write_fns *fns;
- PTR fhandle;
- struct debug_type *type;
- const char *tag;
-{
- unsigned int i;
- unsigned int id;
- struct debug_type *vptrbase;
-
- if (type->u.kclass == NULL)
- {
- id = 0;
- vptrbase = NULL;
- }
- else
- {
- if (type->u.kclass->id <= info->base_id)
- {
- if (! debug_set_class_id (info, tag, type))
- return false;
- }
-
- if (info->mark == type->u.kclass->mark)
- {
- /* We are currently outputting this class, or we have
- already output it. This can happen when there are
- methods for an anonymous class. */
- assert (type->u.kclass->id > info->base_id);
- return (*fns->tag_type) (fhandle, tag, type->u.kclass->id,
- type->kind);
- }
- type->u.kclass->mark = info->mark;
- id = type->u.kclass->id;
-
- vptrbase = type->u.kclass->vptrbase;
- if (vptrbase != NULL && vptrbase != type)
- {
- if (! debug_write_type (info, fns, fhandle, vptrbase,
- (struct debug_name *) NULL))
- return false;
- }
- }
-
- if (! (*fns->start_class_type) (fhandle, tag, id,
- type->kind == DEBUG_KIND_CLASS,
- type->size,
- vptrbase != NULL,
- vptrbase == type))
- return false;
-
- if (type->u.kclass != NULL)
- {
- if (type->u.kclass->fields != NULL)
- {
- for (i = 0; type->u.kclass->fields[i] != NULL; i++)
- {
- struct debug_field *f;
-
- f = type->u.kclass->fields[i];
- if (! debug_write_type (info, fns, fhandle, f->type,
- (struct debug_name *) NULL))
- return false;
- if (f->static_member)
- {
- if (! (*fns->class_static_member) (fhandle, f->name,
- f->u.s.physname,
- f->visibility))
- return false;
- }
- else
- {
- if (! (*fns->struct_field) (fhandle, f->name, f->u.f.bitpos,
- f->u.f.bitsize, f->visibility))
- return false;
- }
- }
- }
-
- if (type->u.kclass->baseclasses != NULL)
- {
- for (i = 0; type->u.kclass->baseclasses[i] != NULL; i++)
- {
- struct debug_baseclass *b;
-
- b = type->u.kclass->baseclasses[i];
- if (! debug_write_type (info, fns, fhandle, b->type,
- (struct debug_name *) NULL))
- return false;
- if (! (*fns->class_baseclass) (fhandle, b->bitpos, b->virtual,
- b->visibility))
- return false;
- }
- }
-
- if (type->u.kclass->methods != NULL)
- {
- for (i = 0; type->u.kclass->methods[i] != NULL; i++)
- {
- struct debug_method *m;
- unsigned int j;
-
- m = type->u.kclass->methods[i];
- if (! (*fns->class_start_method) (fhandle, m->name))
- return false;
- for (j = 0; m->variants[j] != NULL; j++)
- {
- struct debug_method_variant *v;
-
- v = m->variants[j];
- if (v->context != NULL)
- {
- if (! debug_write_type (info, fns, fhandle, v->context,
- (struct debug_name *) NULL))
- return false;
- }
- if (! debug_write_type (info, fns, fhandle, v->type,
- (struct debug_name *) NULL))
- return false;
- if (v->voffset != VOFFSET_STATIC_METHOD)
- {
- if (! (*fns->class_method_variant) (fhandle, v->physname,
- v->visibility,
- v->constp,
- v->volatilep,
- v->voffset,
- v->context != NULL))
- return false;
- }
- else
- {
- if (! (*fns->class_static_method_variant) (fhandle,
- v->physname,
- v->visibility,
- v->constp,
- v->volatilep))
- return false;
- }
- }
- if (! (*fns->class_end_method) (fhandle))
- return false;
- }
- }
- }
-
- return (*fns->end_class_type) (fhandle);
-}
-
-/* Write out information for a function. */
-
-static boolean
-debug_write_function (info, fns, fhandle, name, linkage, function)
- struct debug_handle *info;
- const struct debug_write_fns *fns;
- PTR fhandle;
- const char *name;
- enum debug_object_linkage linkage;
- struct debug_function *function;
-{
- struct debug_parameter *p;
- struct debug_block *b;
-
- if (! debug_write_linenos (info, fns, fhandle, function->blocks->start))
- return false;
-
- if (! debug_write_type (info, fns, fhandle, function->return_type,
- (struct debug_name *) NULL))
- return false;
-
- if (! (*fns->start_function) (fhandle, name,
- linkage == DEBUG_LINKAGE_GLOBAL))
- return false;
-
- for (p = function->parameters; p != NULL; p = p->next)
- {
- if (! debug_write_type (info, fns, fhandle, p->type,
- (struct debug_name *) NULL)
- || ! (*fns->function_parameter) (fhandle, p->name, p->kind, p->val))
- return false;
- }
-
- for (b = function->blocks; b != NULL; b = b->next)
- {
- if (! debug_write_block (info, fns, fhandle, b))
- return false;
- }
-
- return (*fns->end_function) (fhandle);
-}
-
-/* Write out information for a block. */
-
-static boolean
-debug_write_block (info, fns, fhandle, block)
- struct debug_handle *info;
- const struct debug_write_fns *fns;
- PTR fhandle;
- struct debug_block *block;
-{
- struct debug_name *n;
- struct debug_block *b;
-
- if (! debug_write_linenos (info, fns, fhandle, block->start))
- return false;
-
- /* I can't see any point to writing out a block with no local
- variables, so we don't bother, except for the top level block. */
- if (block->locals != NULL || block->parent == NULL)
- {
- if (! (*fns->start_block) (fhandle, block->start))
- return false;
- }
-
- if (block->locals != NULL)
- {
- for (n = block->locals->list; n != NULL; n = n->next)
- {
- if (! debug_write_name (info, fns, fhandle, n))
- return false;
- }
- }
-
- for (b = block->children; b != NULL; b = b->next)
- {
- if (! debug_write_block (info, fns, fhandle, b))
- return false;
- }
-
- if (! debug_write_linenos (info, fns, fhandle, block->end))
- return false;
-
- if (block->locals != NULL || block->parent == NULL)
- {
- if (! (*fns->end_block) (fhandle, block->end))
- return false;
- }
-
- return true;
-}
-
-/* Write out line number information up to ADDRESS. */
-
-static boolean
-debug_write_linenos (info, fns, fhandle, address)
- struct debug_handle *info;
- const struct debug_write_fns *fns;
- PTR fhandle;
- bfd_vma address;
-{
- while (info->current_write_lineno != NULL)
- {
- struct debug_lineno *l;
-
- l = info->current_write_lineno;
-
- while (info->current_write_lineno_index < DEBUG_LINENO_COUNT)
- {
- if (l->linenos[info->current_write_lineno_index]
- == (unsigned long) -1)
- break;
-
- if (l->addrs[info->current_write_lineno_index] >= address)
- return true;
-
- if (! (*fns->lineno) (fhandle, l->file->filename,
- l->linenos[info->current_write_lineno_index],
- l->addrs[info->current_write_lineno_index]))
- return false;
-
- ++info->current_write_lineno_index;
- }
-
- info->current_write_lineno = l->next;
- info->current_write_lineno_index = 0;
- }
-
- return true;
-}
-
-/* Get the ID number for a class. If during the same call to
- debug_write we find a struct with the same definition with the same
- name, we use the same ID. This type of things happens because the
- same struct will be defined by multiple compilation units. */
-
-static boolean
-debug_set_class_id (info, tag, type)
- struct debug_handle *info;
- const char *tag;
- struct debug_type *type;
-{
- struct debug_class_type *c;
- struct debug_class_id *l;
-
- assert (type->kind == DEBUG_KIND_STRUCT
- || type->kind == DEBUG_KIND_UNION
- || type->kind == DEBUG_KIND_CLASS
- || type->kind == DEBUG_KIND_UNION_CLASS);
-
- c = type->u.kclass;
-
- if (c->id > info->base_id)
- return true;
-
- for (l = info->id_list; l != NULL; l = l->next)
- {
- if (l->type->kind != type->kind)
- continue;
-
- if (tag == NULL)
- {
- if (l->tag != NULL)
- continue;
- }
- else
- {
- if (l->tag == NULL
- || l->tag[0] != tag[0]
- || strcmp (l->tag, tag) != 0)
- continue;
- }
-
- if (debug_type_samep (info, l->type, type))
- {
- c->id = l->type->u.kclass->id;
- return true;
- }
- }
-
- /* There are no identical types. Use a new ID, and add it to the
- list. */
- ++info->class_id;
- c->id = info->class_id;
-
- l = (struct debug_class_id *) xmalloc (sizeof *l);
- memset (l, 0, sizeof *l);
-
- l->type = type;
- l->tag = tag;
-
- l->next = info->id_list;
- info->id_list = l;
-
- return true;
-}
-
-/* See if two types are the same. At this point, we don't care about
- tags and the like. */
-
-static boolean
-debug_type_samep (info, t1, t2)
- struct debug_handle *info;
- struct debug_type *t1;
- struct debug_type *t2;
-{
- struct debug_type_compare_list *l;
- struct debug_type_compare_list top;
- boolean ret;
-
- if (t1 == NULL)
- return t2 == NULL;
- if (t2 == NULL)
- return false;
-
- while (t1->kind == DEBUG_KIND_INDIRECT)
- {
- t1 = *t1->u.kindirect->slot;
- if (t1 == NULL)
- return false;
- }
- while (t2->kind == DEBUG_KIND_INDIRECT)
- {
- t2 = *t2->u.kindirect->slot;
- if (t2 == NULL)
- return false;
- }
-
- if (t1 == t2)
- return true;
-
- /* As a special case, permit a typedef to match a tag, since C++
- debugging output will sometimes add a typedef where C debugging
- output will not. */
- if (t1->kind == DEBUG_KIND_NAMED
- && t2->kind == DEBUG_KIND_TAGGED)
- return debug_type_samep (info, t1->u.knamed->type, t2);
- else if (t1->kind == DEBUG_KIND_TAGGED
- && t2->kind == DEBUG_KIND_NAMED)
- return debug_type_samep (info, t1, t2->u.knamed->type);
-
- if (t1->kind != t2->kind
- || t1->size != t2->size)
- return false;
-
- /* Get rid of the trivial cases first. */
- switch (t1->kind)
- {
- default:
- break;
- case DEBUG_KIND_VOID:
- case DEBUG_KIND_FLOAT:
- case DEBUG_KIND_COMPLEX:
- case DEBUG_KIND_BOOL:
- return true;
- case DEBUG_KIND_INT:
- return t1->u.kint == t2->u.kint;
- }
-
- /* We have to avoid an infinite recursion. We do this by keeping a
- list of types which we are comparing. We just keep the list on
- the stack. If we encounter a pair of types we are currently
- comparing, we just assume that they are equal. */
- for (l = info->compare_list; l != NULL; l = l->next)
- {
- if (l->t1 == t1 && l->t2 == t2)
- return true;
- }
-
- top.t1 = t1;
- top.t2 = t2;
- top.next = info->compare_list;
- info->compare_list = &top;
-
- switch (t1->kind)
- {
- default:
- abort ();
- ret = false;
- break;
-
- case DEBUG_KIND_STRUCT:
- case DEBUG_KIND_UNION:
- case DEBUG_KIND_CLASS:
- case DEBUG_KIND_UNION_CLASS:
- if (t1->u.kclass == NULL)
- ret = t2->u.kclass == NULL;
- else if (t2->u.kclass == NULL)
- ret = false;
- else if (t1->u.kclass->id > info->base_id
- && t1->u.kclass->id == t2->u.kclass->id)
- ret = true;
- else
- ret = debug_class_type_samep (info, t1, t2);
- break;
-
- case DEBUG_KIND_ENUM:
- if (t1->u.kenum == NULL)
- ret = t2->u.kenum == NULL;
- else if (t2->u.kenum == NULL)
- ret = false;
- else
- {
- const char **pn1, **pn2;
- bfd_signed_vma *pv1, *pv2;
-
- pn1 = t1->u.kenum->names;
- pn2 = t2->u.kenum->names;
- pv1 = t1->u.kenum->values;
- pv2 = t2->u.kenum->values;
- while (*pn1 != NULL && *pn2 != NULL)
- {
- if (**pn1 != **pn2
- || *pv1 != *pv2
- || strcmp (*pn1, *pn2) != 0)
- break;
- ++pn1;
- ++pn2;
- ++pv1;
- ++pv2;
- }
- ret = *pn1 == NULL && *pn2 == NULL;
- }
- break;
-
- case DEBUG_KIND_POINTER:
- ret = debug_type_samep (info, t1->u.kpointer, t2->u.kpointer);
- break;
-
- case DEBUG_KIND_FUNCTION:
- if (t1->u.kfunction->varargs != t2->u.kfunction->varargs
- || ! debug_type_samep (info, t1->u.kfunction->return_type,
- t2->u.kfunction->return_type)
- || ((t1->u.kfunction->arg_types == NULL)
- != (t2->u.kfunction->arg_types == NULL)))
- ret = false;
- else if (t1->u.kfunction->arg_types == NULL)
- ret = true;
- else
- {
- struct debug_type **a1, **a2;
-
- a1 = t1->u.kfunction->arg_types;
- a2 = t2->u.kfunction->arg_types;
- while (*a1 != NULL && *a2 != NULL)
- if (! debug_type_samep (info, *a1, *a2))
- break;
- ret = *a1 == NULL && *a2 == NULL;
- }
- break;
-
- case DEBUG_KIND_REFERENCE:
- ret = debug_type_samep (info, t1->u.kreference, t2->u.kreference);
- break;
-
- case DEBUG_KIND_RANGE:
- ret = (t1->u.krange->lower == t2->u.krange->lower
- && t1->u.krange->upper == t2->u.krange->upper
- && debug_type_samep (info, t1->u.krange->type,
- t2->u.krange->type));
-
- case DEBUG_KIND_ARRAY:
- ret = (t1->u.karray->lower == t2->u.karray->lower
- && t1->u.karray->upper == t2->u.karray->upper
- && t1->u.karray->stringp == t2->u.karray->stringp
- && debug_type_samep (info, t1->u.karray->element_type,
- t2->u.karray->element_type));
- break;
-
- case DEBUG_KIND_SET:
- ret = (t1->u.kset->bitstringp == t2->u.kset->bitstringp
- && debug_type_samep (info, t1->u.kset->type, t2->u.kset->type));
- break;
-
- case DEBUG_KIND_OFFSET:
- ret = (debug_type_samep (info, t1->u.koffset->base_type,
- t2->u.koffset->base_type)
- && debug_type_samep (info, t1->u.koffset->target_type,
- t2->u.koffset->target_type));
- break;
-
- case DEBUG_KIND_METHOD:
- if (t1->u.kmethod->varargs != t2->u.kmethod->varargs
- || ! debug_type_samep (info, t1->u.kmethod->return_type,
- t2->u.kmethod->return_type)
- || ! debug_type_samep (info, t1->u.kmethod->domain_type,
- t2->u.kmethod->domain_type)
- || ((t1->u.kmethod->arg_types == NULL)
- != (t2->u.kmethod->arg_types == NULL)))
- ret = false;
- else if (t1->u.kmethod->arg_types == NULL)
- ret = true;
- else
- {
- struct debug_type **a1, **a2;
-
- a1 = t1->u.kmethod->arg_types;
- a2 = t2->u.kmethod->arg_types;
- while (*a1 != NULL && *a2 != NULL)
- if (! debug_type_samep (info, *a1, *a2))
- break;
- ret = *a1 == NULL && *a2 == NULL;
- }
- break;
-
- case DEBUG_KIND_CONST:
- ret = debug_type_samep (info, t1->u.kconst, t2->u.kconst);
- break;
-
- case DEBUG_KIND_VOLATILE:
- ret = debug_type_samep (info, t1->u.kvolatile, t2->u.kvolatile);
- break;
-
- case DEBUG_KIND_NAMED:
- case DEBUG_KIND_TAGGED:
- ret = (strcmp (t1->u.knamed->name->name, t2->u.knamed->name->name) == 0
- && debug_type_samep (info, t1->u.knamed->type,
- t2->u.knamed->type));
- break;
- }
-
- info->compare_list = top.next;
-
- return ret;
-}
-
-/* See if two classes are the same. This is a subroutine of
- debug_type_samep. */
-
-static boolean
-debug_class_type_samep (info, t1, t2)
- struct debug_handle *info;
- struct debug_type *t1;
- struct debug_type *t2;
-{
- struct debug_class_type *c1, *c2;
-
- c1 = t1->u.kclass;
- c2 = t2->u.kclass;
-
- if ((c1->fields == NULL) != (c2->fields == NULL)
- || (c1->baseclasses == NULL) != (c2->baseclasses == NULL)
- || (c1->methods == NULL) != (c2->methods == NULL)
- || (c1->vptrbase == NULL) != (c2->vptrbase == NULL))
- return false;
-
- if (c1->fields != NULL)
- {
- struct debug_field **pf1, **pf2;
-
- for (pf1 = c1->fields, pf2 = c2->fields;
- *pf1 != NULL && *pf2 != NULL;
- pf1++, pf2++)
- {
- struct debug_field *f1, *f2;
-
- f1 = *pf1;
- f2 = *pf2;
- if (f1->name[0] != f2->name[0]
- || f1->visibility != f2->visibility
- || f1->static_member != f2->static_member)
- return false;
- if (f1->static_member)
- {
- if (strcmp (f1->u.s.physname, f2->u.s.physname) != 0)
- return false;
- }
- else
- {
- if (f1->u.f.bitpos != f2->u.f.bitpos
- || f1->u.f.bitsize != f2->u.f.bitsize)
- return false;
- }
- /* We do the checks which require function calls last. We
- don't require that the types of fields have the same
- names, since that sometimes fails in the presence of
- typedefs and we really don't care. */
- if (strcmp (f1->name, f2->name) != 0
- || ! debug_type_samep (info,
- debug_get_real_type ((PTR) info,
- f1->type),
- debug_get_real_type ((PTR) info,
- f2->type)))
- return false;
- }
- if (*pf1 != NULL || *pf2 != NULL)
- return false;
- }
-
- if (c1->vptrbase != NULL)
- {
- if (! debug_type_samep (info, c1->vptrbase, c2->vptrbase))
- return false;
- }
-
- if (c1->baseclasses != NULL)
- {
- struct debug_baseclass **pb1, **pb2;
-
- for (pb1 = c1->baseclasses, pb2 = c2->baseclasses;
- *pb1 != NULL && *pb2 != NULL;
- ++pb1, ++pb2)
- {
- struct debug_baseclass *b1, *b2;
-
- b1 = *pb1;
- b2 = *pb2;
- if (b1->bitpos != b2->bitpos
- || b1->virtual != b2->virtual
- || b1->visibility != b2->visibility
- || ! debug_type_samep (info, b1->type, b2->type))
- return false;
- }
- if (*pb1 != NULL || *pb2 != NULL)
- return false;
- }
-
- if (c1->methods != NULL)
- {
- struct debug_method **pm1, **pm2;
-
- for (pm1 = c1->methods, pm2 = c2->methods;
- *pm1 != NULL && *pm2 != NULL;
- ++pm1, ++pm2)
- {
- struct debug_method *m1, *m2;
-
- m1 = *pm1;
- m2 = *pm2;
- if (m1->name[0] != m2->name[0]
- || strcmp (m1->name, m2->name) != 0
- || (m1->variants == NULL) != (m2->variants == NULL))
- return false;
- if (m1->variants == NULL)
- {
- struct debug_method_variant **pv1, **pv2;
-
- for (pv1 = m1->variants, pv2 = m2->variants;
- *pv1 != NULL && *pv2 != NULL;
- ++pv1, ++pv2)
- {
- struct debug_method_variant *v1, *v2;
-
- v1 = *pv1;
- v2 = *pv2;
- if (v1->physname[0] != v2->physname[0]
- || v1->visibility != v2->visibility
- || v1->constp != v2->constp
- || v1->volatilep != v2->volatilep
- || v1->voffset != v2->voffset
- || (v1->context == NULL) != (v2->context == NULL)
- || strcmp (v1->physname, v2->physname) != 0
- || ! debug_type_samep (info, v1->type, v2->type))
- return false;
- if (v1->context != NULL)
- {
- if (! debug_type_samep (info, v1->context,
- v2->context))
- return false;
- }
- }
- if (*pv1 != NULL || *pv2 != NULL)
- return false;
- }
- }
- if (*pm1 != NULL || *pm2 != NULL)
- return false;
- }
-
- return true;
-}
diff --git a/pstack/debug.h b/pstack/debug.h
deleted file mode 100644
index a4d3d8306cd..00000000000
--- a/pstack/debug.h
+++ /dev/null
@@ -1,798 +0,0 @@
-/* debug.h -- Describe generic debugging information.
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
- Written by Ian Lance Taylor <ian@cygnus.com>.
-
- This file is part of GNU Binutils.
-
- 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; either version 2 of the License, or
- (at your option) any later version.
-
- 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 DEBUG_H
-#define DEBUG_H
-
-/* This header file describes a generic debugging information format.
- We may eventually have readers which convert different formats into
- this generic format, and writers which write it out. The initial
- impetus for this was writing a convertor from stabs to HP IEEE-695
- debugging format. */
-
-/* Different kinds of types. */
-
-enum debug_type_kind
-{
- /* Not used. */
- DEBUG_KIND_ILLEGAL,
- /* Indirect via a pointer. */
- DEBUG_KIND_INDIRECT,
- /* Void. */
- DEBUG_KIND_VOID,
- /* Integer. */
- DEBUG_KIND_INT,
- /* Floating point. */
- DEBUG_KIND_FLOAT,
- /* Complex. */
- DEBUG_KIND_COMPLEX,
- /* Boolean. */
- DEBUG_KIND_BOOL,
- /* Struct. */
- DEBUG_KIND_STRUCT,
- /* Union. */
- DEBUG_KIND_UNION,
- /* Class. */
- DEBUG_KIND_CLASS,
- /* Union class (can this really happen?). */
- DEBUG_KIND_UNION_CLASS,
- /* Enumeration type. */
- DEBUG_KIND_ENUM,
- /* Pointer. */
- DEBUG_KIND_POINTER,
- /* Function. */
- DEBUG_KIND_FUNCTION,
- /* Reference. */
- DEBUG_KIND_REFERENCE,
- /* Range. */
- DEBUG_KIND_RANGE,
- /* Array. */
- DEBUG_KIND_ARRAY,
- /* Set. */
- DEBUG_KIND_SET,
- /* Based pointer. */
- DEBUG_KIND_OFFSET,
- /* Method. */
- DEBUG_KIND_METHOD,
- /* Const qualified type. */
- DEBUG_KIND_CONST,
- /* Volatile qualified type. */
- DEBUG_KIND_VOLATILE,
- /* Named type. */
- DEBUG_KIND_NAMED,
- /* Tagged type. */
- DEBUG_KIND_TAGGED
-};
-
-/* Different kinds of variables. */
-
-enum debug_var_kind
-{
- /* Not used. */
- DEBUG_VAR_ILLEGAL,
- /* A global variable. */
- DEBUG_GLOBAL,
- /* A static variable. */
- DEBUG_STATIC,
- /* A local static variable. */
- DEBUG_LOCAL_STATIC,
- /* A local variable. */
- DEBUG_LOCAL,
- /* A register variable. */
- DEBUG_REGISTER
-};
-
-/* Different kinds of function parameters. */
-
-enum debug_parm_kind
-{
- /* Not used. */
- DEBUG_PARM_ILLEGAL,
- /* A stack based parameter. */
- DEBUG_PARM_STACK,
- /* A register parameter. */
- DEBUG_PARM_REG,
- /* A stack based reference parameter. */
- DEBUG_PARM_REFERENCE,
- /* A register reference parameter. */
- DEBUG_PARM_REF_REG
-};
-
-/* Different kinds of visibility. */
-
-enum debug_visibility
-{
- /* A public field (e.g., a field in a C struct). */
- DEBUG_VISIBILITY_PUBLIC,
- /* A protected field. */
- DEBUG_VISIBILITY_PROTECTED,
- /* A private field. */
- DEBUG_VISIBILITY_PRIVATE,
- /* A field which should be ignored. */
- DEBUG_VISIBILITY_IGNORE
-};
-
-/* A type. */
-
-typedef struct debug_type *debug_type;
-
-#define DEBUG_TYPE_NULL ((debug_type) NULL)
-
-/* A field in a struct or union. */
-
-typedef struct debug_field *debug_field;
-
-#define DEBUG_FIELD_NULL ((debug_field) NULL)
-
-/* A base class for an object. */
-
-typedef struct debug_baseclass *debug_baseclass;
-
-#define DEBUG_BASECLASS_NULL ((debug_baseclass) NULL)
-
-/* A method of an object. */
-
-typedef struct debug_method *debug_method;
-
-#define DEBUG_METHOD_NULL ((debug_method) NULL)
-
-/* The arguments to a method function of an object. These indicate
- which method to run. */
-
-typedef struct debug_method_variant *debug_method_variant;
-
-#define DEBUG_METHOD_VARIANT_NULL ((debug_method_variant) NULL)
-
-/* This structure is passed to debug_write. It holds function
- pointers that debug_write will call based on the accumulated
- debugging information. */
-
-struct debug_write_fns
-{
- /* This is called at the start of each new compilation unit with the
- name of the main file in the new unit. */
- boolean (*start_compilation_unit) PARAMS ((PTR, const char *));
-
- /* This is called at the start of each source file within a
- compilation unit, before outputting any global information for
- that file. The argument is the name of the file. */
- boolean (*start_source) PARAMS ((PTR, const char *));
-
- /* Each writer must keep a stack of types. */
-
- /* Push an empty type onto the type stack. This type can appear if
- there is a reference to a type which is never defined. */
- boolean (*empty_type) PARAMS ((PTR));
-
- /* Push a void type onto the type stack. */
- boolean (*void_type) PARAMS ((PTR));
-
- /* Push an integer type onto the type stack, given the size and
- whether it is unsigned. */
- boolean (*int_type) PARAMS ((PTR, unsigned int, boolean));
-
- /* Push a floating type onto the type stack, given the size. */
- boolean (*float_type) PARAMS ((PTR, unsigned int));
-
- /* Push a complex type onto the type stack, given the size. */
- boolean (*complex_type) PARAMS ((PTR, unsigned int));
-
- /* Push a boolean type onto the type stack, given the size. */
- boolean (*bool_type) PARAMS ((PTR, unsigned int));
-
- /* Push an enum type onto the type stack, given the tag, a NULL
- terminated array of names and the associated values. If there is
- no tag, the tag argument will be NULL. If this is an undefined
- enum, the names and values arguments will be NULL. */
- boolean (*enum_type) PARAMS ((PTR, const char *, const char **,
- bfd_signed_vma *));
-
- /* Pop the top type on the type stack, and push a pointer to that
- type onto the type stack. */
- boolean (*pointer_type) PARAMS ((PTR));
-
- /* Push a function type onto the type stack. The second argument
- indicates the number of argument types that have been pushed onto
- the stack. If the number of argument types is passed as -1, then
- the argument types of the function are unknown, and no types have
- been pushed onto the stack. The third argument is true if the
- function takes a variable number of arguments. The return type
- of the function is pushed onto the type stack below the argument
- types, if any. */
- boolean (*function_type) PARAMS ((PTR, int, boolean));
-
- /* Pop the top type on the type stack, and push a reference to that
- type onto the type stack. */
- boolean (*reference_type) PARAMS ((PTR));
-
- /* Pop the top type on the type stack, and push a range of that type
- with the given lower and upper bounds onto the type stack. */
- boolean (*range_type) PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma));
-
- /* Push an array type onto the type stack. The top type on the type
- stack is the range, and the next type on the type stack is the
- element type. These should be popped before the array type is
- pushed. The arguments are the lower bound, the upper bound, and
- whether the array is a string. */
- boolean (*array_type) PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma,
- boolean));
-
- /* Pop the top type on the type stack, and push a set of that type
- onto the type stack. The argument indicates whether this set is
- a bitstring. */
- boolean (*set_type) PARAMS ((PTR, boolean));
-
- /* Push an offset type onto the type stack. The top type on the
- type stack is the target type, and the next type on the type
- stack is the base type. These should be popped before the offset
- type is pushed. */
- boolean (*offset_type) PARAMS ((PTR));
-
- /* Push a method type onto the type stack. If the second argument
- is true, the top type on the stack is the class to which the
- method belongs; otherwise, the class must be determined by the
- class to which the method is attached. The third argument is the
- number of argument types; these are pushed onto the type stack in
- reverse order (the first type popped is the last argument to the
- method). A value of -1 for the third argument means that no
- argument information is available. The fourth argument is true
- if the function takes a variable number of arguments. The next
- type on the type stack below the domain and the argument types is
- the return type of the method. All these types must be popped,
- and then the method type must be pushed. */
- boolean (*method_type) PARAMS ((PTR, boolean, int, boolean));
-
- /* Pop the top type off the type stack, and push a const qualified
- version of that type onto the type stack. */
- boolean (*const_type) PARAMS ((PTR));
-
- /* Pop the top type off the type stack, and push a volatile
- qualified version of that type onto the type stack. */
- boolean (*volatile_type) PARAMS ((PTR));
-
- /* Start building a struct. This is followed by calls to the
- struct_field function, and finished by a call to the
- end_struct_type function. The second argument is the tag; this
- will be NULL if there isn't one. If the second argument is NULL,
- the third argument is a constant identifying this struct for use
- with tag_type. The fourth argument is true for a struct, false
- for a union. The fifth argument is the size. If this is an
- undefined struct or union, the size will be 0 and struct_field
- will not be called before end_struct_type is called. */
- boolean (*start_struct_type) PARAMS ((PTR, const char *, unsigned int,
- boolean, unsigned int));
-
- /* Add a field to the struct type currently being built. The type
- of the field should be popped off the type stack. The arguments
- are the name, the bit position, the bit size (may be zero if the
- field is not packed), and the visibility. */
- boolean (*struct_field) PARAMS ((PTR, const char *, bfd_vma, bfd_vma,
- enum debug_visibility));
-
- /* Finish building a struct, and push it onto the type stack. */
- boolean (*end_struct_type) PARAMS ((PTR));
-
- /* Start building a class. This is followed by calls to several
- functions: struct_field, class_static_member, class_baseclass,
- class_start_method, class_method_variant,
- class_static_method_variant, and class_end_method. The class is
- finished by a call to end_class_type. The first five arguments
- are the same as for start_struct_type. The sixth argument is
- true if there is a virtual function table; if there is, the
- seventh argument is true if the virtual function table can be
- found in the type itself, and is false if the type of the object
- holding the virtual function table should be popped from the type
- stack. */
- boolean (*start_class_type) PARAMS ((PTR, const char *, unsigned int,
- boolean, unsigned int, boolean,
- boolean));
-
- /* Add a static member to the class currently being built. The
- arguments are the field name, the physical name, and the
- visibility. The type must be popped off the type stack. */
- boolean (*class_static_member) PARAMS ((PTR, const char *, const char *,
- enum debug_visibility));
-
- /* Add a baseclass to the class currently being built. The type of
- the baseclass must be popped off the type stack. The arguments
- are the bit position, whether the class is virtual, and the
- visibility. */
- boolean (*class_baseclass) PARAMS ((PTR, bfd_vma, boolean,
- enum debug_visibility));
-
- /* Start adding a method to the class currently being built. This
- is followed by calls to class_method_variant and
- class_static_method_variant to describe different variants of the
- method which take different arguments. The method is finished
- with a call to class_end_method. The argument is the method
- name. */
- boolean (*class_start_method) PARAMS ((PTR, const char *));
-
- /* Describe a variant to the class method currently being built.
- The type of the variant must be popped off the type stack. The
- second argument is the physical name of the function. The
- following arguments are the visibility, whether the variant is
- const, whether the variant is volatile, the offset in the virtual
- function table, and whether the context is on the type stack
- (below the variant type). */
- boolean (*class_method_variant) PARAMS ((PTR, const char *,
- enum debug_visibility,
- boolean, boolean,
- bfd_vma, boolean));
-
- /* Describe a static variant to the class method currently being
- built. The arguments are the same as for class_method_variant,
- except that the last two arguments are omitted. The type of the
- variant must be popped off the type stack. */
- boolean (*class_static_method_variant) PARAMS ((PTR, const char *,
- enum debug_visibility,
- boolean, boolean));
-
- /* Finish describing a class method. */
- boolean (*class_end_method) PARAMS ((PTR));
-
- /* Finish describing a class, and push it onto the type stack. */
- boolean (*end_class_type) PARAMS ((PTR));
-
- /* Push a type on the stack which was given a name by an earlier
- call to typdef. */
- boolean (*typedef_type) PARAMS ((PTR, const char *));
-
- /* Push a tagged type on the stack which was defined earlier. If
- the second argument is not NULL, the type was defined by a call
- to tag. If the second argument is NULL, the type was defined by
- a call to start_struct_type or start_class_type with a tag of
- NULL and the number of the third argument. Either way, the
- fourth argument is the tag kind. Note that this may be called
- for a struct (class) being defined, in between the call to
- start_struct_type (start_class_type) and the call to
- end_struct_type (end_class_type). */
- boolean (*tag_type) PARAMS ((PTR, const char *, unsigned int,
- enum debug_type_kind));
-
- /* Pop the type stack, and typedef it to the given name. */
- boolean (*typdef) PARAMS ((PTR, const char *));
-
- /* Pop the type stack, and declare it as a tagged struct or union or
- enum or whatever. The tag passed down here is redundant, since
- was also passed when enum_type, start_struct_type, or
- start_class_type was called. */
- boolean (*tag) PARAMS ((PTR, const char *));
-
- /* This is called to record a named integer constant. */
- boolean (*int_constant) PARAMS ((PTR, const char *, bfd_vma));
-
- /* This is called to record a named floating point constant. */
- boolean (*float_constant) PARAMS ((PTR, const char *, double));
-
- /* This is called to record a typed integer constant. The type is
- popped off the type stack. */
- boolean (*typed_constant) PARAMS ((PTR, const char *, bfd_vma));
-
- /* This is called to record a variable. The type is popped off the
- type stack. */
- boolean (*variable) PARAMS ((PTR, const char *, enum debug_var_kind,
- bfd_vma));
-
- /* Start writing out a function. The return type must be popped off
- the stack. The boolean is true if the function is global. This
- is followed by calls to function_parameter, followed by block
- information. */
- boolean (*start_function) PARAMS ((PTR, const char *, boolean));
-
- /* Record a function parameter for the current function. The type
- must be popped off the stack. */
- boolean (*function_parameter) PARAMS ((PTR, const char *,
- enum debug_parm_kind, bfd_vma));
-
- /* Start writing out a block. There is at least one top level block
- per function. Blocks may be nested. The argument is the
- starting address of the block. */
- boolean (*start_block) PARAMS ((PTR, bfd_vma));
-
- /* Finish writing out a block. The argument is the ending address
- of the block. */
- boolean (*end_block) PARAMS ((PTR, bfd_vma));
-
- /* Finish writing out a function. */
- boolean (*end_function) PARAMS ((PTR));
-
- /* Record line number information for the current compilation unit. */
- boolean (*lineno) PARAMS ((PTR, const char *, unsigned long, bfd_vma));
-};
-
-/* Exported functions. */
-
-/* The first argument to most of these functions is a handle. This
- handle is returned by the debug_init function. The purpose of the
- handle is to permit the debugging routines to not use static
- variables, and hence to be reentrant. This would be useful for a
- program which wanted to handle two executables simultaneously. */
-
-/* Return a debugging handle. */
-
-extern PTR debug_init PARAMS ((void));
-
-/* Set the source filename. This implicitly starts a new compilation
- unit. */
-
-extern boolean debug_set_filename PARAMS ((PTR, const char *));
-
-/* Change source files to the given file name. This is used for
- include files in a single compilation unit. */
-
-extern boolean debug_start_source PARAMS ((PTR, const char *));
-
-/* Record a function definition. This implicitly starts a function
- block. The debug_type argument is the type of the return value.
- The boolean indicates whether the function is globally visible.
- The bfd_vma is the address of the start of the function. Currently
- the parameter types are specified by calls to
- debug_record_parameter. */
-
-extern boolean debug_record_function
- PARAMS ((PTR, const char *, debug_type, boolean, bfd_vma));
-
-/* Record a parameter for the current function. */
-
-extern boolean debug_record_parameter
- PARAMS ((PTR, const char *, debug_type, enum debug_parm_kind, bfd_vma));
-
-/* End a function definition. The argument is the address where the
- function ends. */
-
-extern boolean debug_end_function PARAMS ((PTR, bfd_vma));
-
-/* Start a block in a function. All local information will be
- recorded in this block, until the matching call to debug_end_block.
- debug_start_block and debug_end_block may be nested. The argument
- is the address at which this block starts. */
-
-extern boolean debug_start_block PARAMS ((PTR, bfd_vma));
-
-/* Finish a block in a function. This matches the call to
- debug_start_block. The argument is the address at which this block
- ends. */
-
-extern boolean debug_end_block PARAMS ((PTR, bfd_vma));
-
-/* Associate a line number in the current source file with a given
- address. */
-
-extern boolean debug_record_line PARAMS ((PTR, unsigned long, bfd_vma));
-
-/* Start a named common block. This is a block of variables that may
- move in memory. */
-
-extern boolean debug_start_common_block PARAMS ((PTR, const char *));
-
-/* End a named common block. */
-
-extern boolean debug_end_common_block PARAMS ((PTR, const char *));
-
-/* Record a named integer constant. */
-
-extern boolean debug_record_int_const PARAMS ((PTR, const char *, bfd_vma));
-
-/* Record a named floating point constant. */
-
-extern boolean debug_record_float_const PARAMS ((PTR, const char *, double));
-
-/* Record a typed constant with an integral value. */
-
-extern boolean debug_record_typed_const
- PARAMS ((PTR, const char *, debug_type, bfd_vma));
-
-/* Record a label. */
-
-extern boolean debug_record_label
- PARAMS ((PTR, const char *, debug_type, bfd_vma));
-
-/* Record a variable. */
-
-extern boolean debug_record_variable
- PARAMS ((PTR, const char *, debug_type, enum debug_var_kind, bfd_vma));
-
-/* Make an indirect type. The first argument is a pointer to the
- location where the real type will be placed. The second argument
- is the type tag, if there is one; this may be NULL; the only
- purpose of this argument is so that debug_get_type_name can return
- something useful. This function may be used when a type is
- referenced before it is defined. */
-
-extern debug_type debug_make_indirect_type
- PARAMS ((PTR, debug_type *, const char *));
-
-/* Make a void type. */
-
-extern debug_type debug_make_void_type PARAMS ((PTR));
-
-/* Make an integer type of a given size. The boolean argument is true
- if the integer is unsigned. */
-
-extern debug_type debug_make_int_type PARAMS ((PTR, unsigned int, boolean));
-
-/* Make a floating point type of a given size. FIXME: On some
- platforms, like an Alpha, you probably need to be able to specify
- the format. */
-
-extern debug_type debug_make_float_type PARAMS ((PTR, unsigned int));
-
-/* Make a boolean type of a given size. */
-
-extern debug_type debug_make_bool_type PARAMS ((PTR, unsigned int));
-
-/* Make a complex type of a given size. */
-
-extern debug_type debug_make_complex_type PARAMS ((PTR, unsigned int));
-
-/* Make a structure type. The second argument is true for a struct,
- false for a union. The third argument is the size of the struct.
- The fourth argument is a NULL terminated array of fields. */
-
-extern debug_type debug_make_struct_type
- PARAMS ((PTR, boolean, bfd_vma, debug_field *));
-
-/* Make an object type. The first three arguments after the handle
- are the same as for debug_make_struct_type. The next arguments are
- a NULL terminated array of base classes, a NULL terminated array of
- methods, the type of the object holding the virtual function table
- if it is not this object, and a boolean which is true if this
- object has its own virtual function table. */
-
-extern debug_type debug_make_object_type
- PARAMS ((PTR, boolean, bfd_vma, debug_field *, debug_baseclass *,
- debug_method *, debug_type, boolean));
-
-/* Make an enumeration type. The arguments are a null terminated
- array of strings, and an array of corresponding values. */
-
-extern debug_type debug_make_enum_type
- PARAMS ((PTR, const char **, bfd_signed_vma *));
-
-/* Make a pointer to a given type. */
-
-extern debug_type debug_make_pointer_type
- PARAMS ((PTR, debug_type));
-
-/* Make a function type. The second argument is the return type. The
- third argument is a NULL terminated array of argument types. The
- fourth argument is true if the function takes a variable number of
- arguments. If the third argument is NULL, then the argument types
- are unknown. */
-
-extern debug_type debug_make_function_type
- PARAMS ((PTR, debug_type, debug_type *, boolean));
-
-/* Make a reference to a given type. */
-
-extern debug_type debug_make_reference_type PARAMS ((PTR, debug_type));
-
-/* Make a range of a given type from a lower to an upper bound. */
-
-extern debug_type debug_make_range_type
- PARAMS ((PTR, debug_type, bfd_signed_vma, bfd_signed_vma));
-
-/* Make an array type. The second argument is the type of an element
- of the array. The third argument is the type of a range of the
- array. The fourth and fifth argument are the lower and upper
- bounds, respectively (if the bounds are not known, lower should be
- 0 and upper should be -1). The sixth argument is true if this
- array is actually a string, as in C. */
-
-extern debug_type debug_make_array_type
- PARAMS ((PTR, debug_type, debug_type, bfd_signed_vma, bfd_signed_vma,
- boolean));
-
-/* Make a set of a given type. For example, a Pascal set type. The
- boolean argument is true if this set is actually a bitstring, as in
- CHILL. */
-
-extern debug_type debug_make_set_type PARAMS ((PTR, debug_type, boolean));
-
-/* Make a type for a pointer which is relative to an object. The
- second argument is the type of the object to which the pointer is
- relative. The third argument is the type that the pointer points
- to. */
-
-extern debug_type debug_make_offset_type
- PARAMS ((PTR, debug_type, debug_type));
-
-/* Make a type for a method function. The second argument is the
- return type. The third argument is the domain. The fourth
- argument is a NULL terminated array of argument types. The fifth
- argument is true if the function takes a variable number of
- arguments, in which case the array of argument types indicates the
- types of the first arguments. The domain and the argument array
- may be NULL, in which case this is a stub method and that
- information is not available. Stabs debugging uses this, and gets
- the argument types from the mangled name. */
-
-extern debug_type debug_make_method_type
- PARAMS ((PTR, debug_type, debug_type, debug_type *, boolean));
-
-/* Make a const qualified version of a given type. */
-
-extern debug_type debug_make_const_type PARAMS ((PTR, debug_type));
-
-/* Make a volatile qualified version of a given type. */
-
-extern debug_type debug_make_volatile_type PARAMS ((PTR, debug_type));
-
-/* Make an undefined tagged type. For example, a struct which has
- been mentioned, but not defined. */
-
-extern debug_type debug_make_undefined_tagged_type
- PARAMS ((PTR, const char *, enum debug_type_kind));
-
-/* Make a base class for an object. The second argument is the base
- class type. The third argument is the bit position of this base
- class in the object. The fourth argument is whether this is a
- virtual class. The fifth argument is the visibility of the base
- class. */
-
-extern debug_baseclass debug_make_baseclass
- PARAMS ((PTR, debug_type, bfd_vma, boolean, enum debug_visibility));
-
-/* Make a field for a struct. The second argument is the name. The
- third argument is the type of the field. The fourth argument is
- the bit position of the field. The fifth argument is the size of
- the field (it may be zero). The sixth argument is the visibility
- of the field. */
-
-extern debug_field debug_make_field
- PARAMS ((PTR, const char *, debug_type, bfd_vma, bfd_vma,
- enum debug_visibility));
-
-/* Make a static member of an object. The second argument is the
- name. The third argument is the type of the member. The fourth
- argument is the physical name of the member (i.e., the name as a
- global variable). The fifth argument is the visibility of the
- member. */
-
-extern debug_field debug_make_static_member
- PARAMS ((PTR, const char *, debug_type, const char *,
- enum debug_visibility));
-
-/* Make a method. The second argument is the name, and the third
- argument is a NULL terminated array of method variants. Each
- method variant is a method with this name but with different
- argument types. */
-
-extern debug_method debug_make_method
- PARAMS ((PTR, const char *, debug_method_variant *));
-
-/* Make a method variant. The second argument is the physical name of
- the function. The third argument is the type of the function,
- probably constructed by debug_make_method_type. The fourth
- argument is the visibility. The fifth argument is whether this is
- a const function. The sixth argument is whether this is a volatile
- function. The seventh argument is the index in the virtual
- function table, if any. The eighth argument is the virtual
- function context. */
-
-extern debug_method_variant debug_make_method_variant
- PARAMS ((PTR, const char *, debug_type, enum debug_visibility, boolean,
- boolean, bfd_vma, debug_type));
-
-/* Make a static method argument. The arguments are the same as for
- debug_make_method_variant, except that the last two are omitted
- since a static method can not also be virtual. */
-
-extern debug_method_variant debug_make_static_method_variant
- PARAMS ((PTR, const char *, debug_type, enum debug_visibility, boolean,
- boolean));
-
-/* Name a type. This returns a new type with an attached name. */
-
-extern debug_type debug_name_type PARAMS ((PTR, const char *, debug_type));
-
-/* Give a tag to a type, such as a struct or union. This returns a
- new type with an attached tag. */
-
-extern debug_type debug_tag_type PARAMS ((PTR, const char *, debug_type));
-
-/* Record the size of a given type. */
-
-extern boolean debug_record_type_size PARAMS ((PTR, debug_type, unsigned int));
-
-/* Find a named type. */
-
-extern debug_type debug_find_named_type PARAMS ((PTR, const char *));
-
-/* Find a tagged type. */
-
-extern debug_type debug_find_tagged_type
- PARAMS ((PTR, const char *, enum debug_type_kind));
-
-/* Get the kind of a type. */
-
-extern enum debug_type_kind debug_get_type_kind PARAMS ((PTR, debug_type));
-
-/* Get the name of a type. */
-
-extern const char *debug_get_type_name PARAMS ((PTR, debug_type));
-
-/* Get the size of a type. */
-
-extern bfd_vma debug_get_type_size PARAMS ((PTR, debug_type));
-
-/* Get the return type of a function or method type. */
-
-extern debug_type debug_get_return_type PARAMS ((PTR, debug_type));
-
-/* Get the NULL terminated array of parameter types for a function or
- method type (actually, parameter types are not currently stored for
- function types). This may be used to determine whether a method
- type is a stub method or not. The last argument points to a
- boolean which is set to true if the function takes a variable
- number of arguments. */
-
-extern const debug_type *debug_get_parameter_types PARAMS ((PTR,
- debug_type,
- boolean *));
-
-/* Get the target type of a pointer or reference or const or volatile
- type. */
-
-extern debug_type debug_get_target_type PARAMS ((PTR, debug_type));
-
-/* Get the NULL terminated array of fields for a struct, union, or
- class. */
-
-extern const debug_field *debug_get_fields PARAMS ((PTR, debug_type));
-
-/* Get the type of a field. */
-
-extern debug_type debug_get_field_type PARAMS ((PTR, debug_field));
-
-/* Get the name of a field. */
-
-extern const char *debug_get_field_name PARAMS ((PTR, debug_field));
-
-/* Get the bit position of a field within the containing structure.
- If the field is a static member, this will return (bfd_vma) -1. */
-
-extern bfd_vma debug_get_field_bitpos PARAMS ((PTR, debug_field));
-
-/* Get the bit size of a field. If the field is a static member, this
- will return (bfd_vma) -1. */
-
-extern bfd_vma debug_get_field_bitsize PARAMS ((PTR, debug_field));
-
-/* Get the visibility of a field. */
-
-extern enum debug_visibility debug_get_field_visibility
- PARAMS ((PTR, debug_field));
-
-/* Get the physical name of a field, if it is a static member. If the
- field is not a static member, this will return NULL. */
-
-extern const char *debug_get_field_physname PARAMS ((PTR, debug_field));
-
-/* Write out the recorded debugging information. This takes a set of
- function pointers which are called to do the actual writing. The
- first PTR is the debugging handle. The second PTR is a handle
- which is passed to the functions. */
-
-extern boolean debug_write PARAMS ((PTR, const struct debug_write_fns *, PTR));
-
-#endif /* DEBUG_H */
diff --git a/pstack/demangle.h b/pstack/demangle.h
deleted file mode 100644
index a961436ca77..00000000000
--- a/pstack/demangle.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Defs for interface to demanglers.
- Copyright 1992, 1995, 1996 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-
-#if !defined (DEMANGLE_H)
-#define DEMANGLE_H
-
-#ifdef IN_GCC
-#include "gansidecl.h"
-#define PARAMS(ARGS) PROTO(ARGS)
-#else /* ! IN_GCC */
-#include <ansidecl.h>
-#endif /* IN_GCC */
-
-/* Options passed to cplus_demangle (in 2nd parameter). */
-
-#define DMGL_NO_OPTS 0 /* For readability... */
-#define DMGL_PARAMS (1 << 0) /* Include function args */
-#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
-#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
-
-#define DMGL_AUTO (1 << 8)
-#define DMGL_GNU (1 << 9)
-#define DMGL_LUCID (1 << 10)
-#define DMGL_ARM (1 << 11)
-/* If none of these are set, use 'current_demangling_style' as the default. */
-#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM)
-
-/* Enumeration of possible demangling styles.
-
- Lucid and ARM styles are still kept logically distinct, even though
- they now both behave identically. The resulting style is actual the
- union of both. I.E. either style recognizes both "__pt__" and "__rf__"
- for operator "->", even though the first is lucid style and the second
- is ARM style. (FIXME?) */
-
-extern enum demangling_styles
-{
- unknown_demangling = 0,
- auto_demangling = DMGL_AUTO,
- gnu_demangling = DMGL_GNU,
- lucid_demangling = DMGL_LUCID,
- arm_demangling = DMGL_ARM
-} current_demangling_style;
-
-/* Define string names for the various demangling styles. */
-
-#define AUTO_DEMANGLING_STYLE_STRING "auto"
-#define GNU_DEMANGLING_STYLE_STRING "gnu"
-#define LUCID_DEMANGLING_STYLE_STRING "lucid"
-#define ARM_DEMANGLING_STYLE_STRING "arm"
-
-/* Some macros to test what demangling style is active. */
-
-#define CURRENT_DEMANGLING_STYLE current_demangling_style
-#define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
-#define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
-#define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
-#define ARM_DEMANGLING (CURRENT_DEMANGLING_STYLE & DMGL_ARM)
-
-extern char *
-cplus_demangle PARAMS ((const char *mangled, int options));
-
-extern int
-cplus_demangle_opname PARAMS ((const char *opname, char *result, int options));
-
-extern const char *
-cplus_mangle_opname PARAMS ((const char *opname, int options));
-
-/* Note: This sets global state. FIXME if you care about multi-threading. */
-
-extern void
-set_cplus_marker_for_demangling PARAMS ((int ch));
-
-#endif /* DEMANGLE_H */
diff --git a/pstack/filemode.c b/pstack/filemode.c
deleted file mode 100644
index 58b52ba7489..00000000000
--- a/pstack/filemode.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/* filemode.c -- make a string describing file modes
- Copyright (C) 1985, 90, 91, 94, 95, 1997 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- 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 "bfd.h"
-#include "bucomm.h"
-
-static char ftypelet PARAMS ((unsigned long));
-static void setst PARAMS ((unsigned long, char *));
-
-/* filemodestring - fill in string STR with an ls-style ASCII
- representation of the st_mode field of file stats block STATP.
- 10 characters are stored in STR; no terminating null is added.
- The characters stored in STR are:
-
- 0 File type. 'd' for directory, 'c' for character
- special, 'b' for block special, 'm' for multiplex,
- 'l' for symbolic link, 's' for socket, 'p' for fifo,
- '-' for any other file type
-
- 1 'r' if the owner may read, '-' otherwise.
-
- 2 'w' if the owner may write, '-' otherwise.
-
- 3 'x' if the owner may execute, 's' if the file is
- set-user-id, '-' otherwise.
- 'S' if the file is set-user-id, but the execute
- bit isn't set.
-
- 4 'r' if group members may read, '-' otherwise.
-
- 5 'w' if group members may write, '-' otherwise.
-
- 6 'x' if group members may execute, 's' if the file is
- set-group-id, '-' otherwise.
- 'S' if it is set-group-id but not executable.
-
- 7 'r' if any user may read, '-' otherwise.
-
- 8 'w' if any user may write, '-' otherwise.
-
- 9 'x' if any user may execute, 't' if the file is "sticky"
- (will be retained in swap space after execution), '-'
- otherwise.
- 'T' if the file is sticky but not executable. */
-
-#if 0
-
-/* This is not used; only mode_string is used. */
-
-void
-filemodestring (statp, str)
- struct stat *statp;
- char *str;
-{
- mode_string ((unsigned long) statp->st_mode, str);
-}
-
-#endif
-
-/* Get definitions for the file permission bits. */
-
-#ifndef S_IRWXU
-#define S_IRWXU 0700
-#endif
-#ifndef S_IRUSR
-#define S_IRUSR 0400
-#endif
-#ifndef S_IWUSR
-#define S_IWUSR 0200
-#endif
-#ifndef S_IXUSR
-#define S_IXUSR 0100
-#endif
-
-#ifndef S_IRWXG
-#define S_IRWXG 0070
-#endif
-#ifndef S_IRGRP
-#define S_IRGRP 0040
-#endif
-#ifndef S_IWGRP
-#define S_IWGRP 0020
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP 0010
-#endif
-
-#ifndef S_IRWXO
-#define S_IRWXO 0007
-#endif
-#ifndef S_IROTH
-#define S_IROTH 0004
-#endif
-#ifndef S_IWOTH
-#define S_IWOTH 0002
-#endif
-#ifndef S_IXOTH
-#define S_IXOTH 0001
-#endif
-
-/* Like filemodestring, but only the relevant part of the `struct stat'
- is given as an argument. */
-
-void
-mode_string (mode, str)
- unsigned long mode;
- char *str;
-{
- str[0] = ftypelet ((unsigned long) mode);
- str[1] = (mode & S_IRUSR) != 0 ? 'r' : '-';
- str[2] = (mode & S_IWUSR) != 0 ? 'w' : '-';
- str[3] = (mode & S_IXUSR) != 0 ? 'x' : '-';
- str[4] = (mode & S_IRGRP) != 0 ? 'r' : '-';
- str[5] = (mode & S_IWGRP) != 0 ? 'w' : '-';
- str[6] = (mode & S_IXGRP) != 0 ? 'x' : '-';
- str[7] = (mode & S_IROTH) != 0 ? 'r' : '-';
- str[8] = (mode & S_IWOTH) != 0 ? 'w' : '-';
- str[9] = (mode & S_IXOTH) != 0 ? 'x' : '-';
- setst ((unsigned long) mode, str);
-}
-
-/* Return a character indicating the type of file described by
- file mode BITS:
- 'd' for directories
- 'b' for block special files
- 'c' for character special files
- 'm' for multiplexor files
- 'l' for symbolic links
- 's' for sockets
- 'p' for fifos
- '-' for any other file type. */
-
-#ifndef S_ISDIR
-#ifdef S_IFDIR
-#define S_ISDIR(i) (((i) & S_IFMT) == S_IFDIR)
-#else /* ! defined (S_IFDIR) */
-#define S_ISDIR(i) (((i) & 0170000) == 040000)
-#endif /* ! defined (S_IFDIR) */
-#endif /* ! defined (S_ISDIR) */
-
-#ifndef S_ISBLK
-#ifdef S_IFBLK
-#define S_ISBLK(i) (((i) & S_IFMT) == S_IFBLK)
-#else /* ! defined (S_IFBLK) */
-#define S_ISBLK(i) 0
-#endif /* ! defined (S_IFBLK) */
-#endif /* ! defined (S_ISBLK) */
-
-#ifndef S_ISCHR
-#ifdef S_IFCHR
-#define S_ISCHR(i) (((i) & S_IFMT) == S_IFCHR)
-#else /* ! defined (S_IFCHR) */
-#define S_ISCHR(i) 0
-#endif /* ! defined (S_IFCHR) */
-#endif /* ! defined (S_ISCHR) */
-
-#ifndef S_ISFIFO
-#ifdef S_IFIFO
-#define S_ISFIFO(i) (((i) & S_IFMT) == S_IFIFO)
-#else /* ! defined (S_IFIFO) */
-#define S_ISFIFO(i) 0
-#endif /* ! defined (S_IFIFO) */
-#endif /* ! defined (S_ISFIFO) */
-
-#ifndef S_ISSOCK
-#ifdef S_IFSOCK
-#define S_ISSOCK(i) (((i) & S_IFMT) == S_IFSOCK)
-#else /* ! defined (S_IFSOCK) */
-#define S_ISSOCK(i) 0
-#endif /* ! defined (S_IFSOCK) */
-#endif /* ! defined (S_ISSOCK) */
-
-#ifndef S_ISLNK
-#ifdef S_IFLNK
-#define S_ISLNK(i) (((i) & S_IFMT) == S_IFLNK)
-#else /* ! defined (S_IFLNK) */
-#define S_ISLNK(i) 0
-#endif /* ! defined (S_IFLNK) */
-#endif /* ! defined (S_ISLNK) */
-
-static char
-ftypelet (bits)
- unsigned long bits;
-{
- if (S_ISDIR (bits))
- return 'd';
- if (S_ISLNK (bits))
- return 'l';
- if (S_ISBLK (bits))
- return 'b';
- if (S_ISCHR (bits))
- return 'c';
- if (S_ISSOCK (bits))
- return 's';
- if (S_ISFIFO (bits))
- return 'p';
-
-#ifdef S_IFMT
-#ifdef S_IFMPC
- if ((bits & S_IFMT) == S_IFMPC
- || (bits & S_IFMT) == S_IFMPB)
- return 'm';
-#endif
-#ifdef S_IFNWK
- if ((bits & S_IFMT) == S_IFNWK)
- return 'n';
-#endif
-#endif
-
- return '-';
-}
-
-/* Set the 's' and 't' flags in file attributes string CHARS,
- according to the file mode BITS. */
-
-static void
-setst (bits, chars)
- unsigned long bits;
- char *chars;
-{
-#ifdef S_ISUID
- if (bits & S_ISUID)
- {
- if (chars[3] != 'x')
- /* Set-uid, but not executable by owner. */
- chars[3] = 'S';
- else
- chars[3] = 's';
- }
-#endif
-#ifdef S_ISGID
- if (bits & S_ISGID)
- {
- if (chars[6] != 'x')
- /* Set-gid, but not executable by group. */
- chars[6] = 'S';
- else
- chars[6] = 's';
- }
-#endif
-#ifdef S_ISVTX
- if (bits & S_ISVTX)
- {
- if (chars[9] != 'x')
- /* Sticky, but not executable by others. */
- chars[9] = 'T';
- else
- chars[9] = 't';
- }
-#endif
-}
diff --git a/pstack/ieee.c b/pstack/ieee.c
deleted file mode 100644
index 8084656a5ef..00000000000
--- a/pstack/ieee.c
+++ /dev/null
@@ -1,7602 +0,0 @@
-/* ieee.c -- Read and write IEEE-695 debugging information.
- Copyright (C) 1996 Free Software Foundation, Inc.
- Written by Ian Lance Taylor <ian@cygnus.com>.
-
- This file is part of GNU Binutils.
-
- 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; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
-
-/* This file reads and writes IEEE-695 debugging information. */
-
-#include <stdio.h>
-#include <assert.h>
-
-#include <bfd.h>
-#include "ieee.h"
-#include "bucomm.h"
-#include <libiberty.h>
-#include "debug.h"
-#include "budbg.h"
-
-/* This structure holds an entry on the block stack. */
-
-struct ieee_block
-{
- /* The kind of block. */
- int kind;
- /* The source file name, for a BB5 block. */
- const char *filename;
- /* The index of the function type, for a BB4 or BB6 block. */
- unsigned int fnindx;
- /* True if this function is being skipped. */
- boolean skip;
-};
-
-/* This structure is the block stack. */
-
-#define BLOCKSTACK_SIZE (16)
-
-struct ieee_blockstack
-{
- /* The stack pointer. */
- struct ieee_block *bsp;
- /* The stack. */
- struct ieee_block stack[BLOCKSTACK_SIZE];
-};
-
-/* This structure holds information for a variable. */
-
-struct ieee_var
-{
- /* Start of name. */
- const char *name;
- /* Length of name. */
- unsigned long namlen;
- /* Type. */
- debug_type type;
- /* Slot if we make an indirect type. */
- debug_type *pslot;
- /* Kind of variable or function. */
- enum
- {
- IEEE_UNKNOWN,
- IEEE_EXTERNAL,
- IEEE_GLOBAL,
- IEEE_STATIC,
- IEEE_LOCAL,
- IEEE_FUNCTION
- } kind;
-};
-
-/* This structure holds all the variables. */
-
-struct ieee_vars
-{
- /* Number of slots allocated. */
- unsigned int alloc;
- /* Variables. */
- struct ieee_var *vars;
-};
-
-/* This structure holds information for a type. We need this because
- we don't want to represent bitfields as real types. */
-
-struct ieee_type
-{
- /* Type. */
- debug_type type;
- /* Slot if this is type is referenced before it is defined. */
- debug_type *pslot;
- /* Slots for arguments if we make indirect types for them. */
- debug_type *arg_slots;
- /* If this is a bitfield, this is the size in bits. If this is not
- a bitfield, this is zero. */
- unsigned long bitsize;
-};
-
-/* This structure holds all the type information. */
-
-struct ieee_types
-{
- /* Number of slots allocated. */
- unsigned int alloc;
- /* Types. */
- struct ieee_type *types;
- /* Builtin types. */
-#define BUILTIN_TYPE_COUNT (60)
- debug_type builtins[BUILTIN_TYPE_COUNT];
-};
-
-/* This structure holds a linked last of structs with their tag names,
- so that we can convert them to C++ classes if necessary. */
-
-struct ieee_tag
-{
- /* Next tag. */
- struct ieee_tag *next;
- /* This tag name. */
- const char *name;
- /* The type of the tag. */
- debug_type type;
- /* The tagged type is an indirect type pointing at this slot. */
- debug_type slot;
- /* This is an array of slots used when a field type is converted
- into a indirect type, in case it needs to be later converted into
- a reference type. */
- debug_type *fslots;
-};
-
-/* This structure holds the information we pass around to the parsing
- functions. */
-
-struct ieee_info
-{
- /* The debugging handle. */
- PTR dhandle;
- /* The BFD. */
- bfd *abfd;
- /* The start of the bytes to be parsed. */
- const bfd_byte *bytes;
- /* The end of the bytes to be parsed. */
- const bfd_byte *pend;
- /* The block stack. */
- struct ieee_blockstack blockstack;
- /* Whether we have seen a BB1 or BB2. */
- boolean saw_filename;
- /* The variables. */
- struct ieee_vars vars;
- /* The global variables, after a global typedef block. */
- struct ieee_vars *global_vars;
- /* The types. */
- struct ieee_types types;
- /* The global types, after a global typedef block. */
- struct ieee_types *global_types;
- /* The list of tagged structs. */
- struct ieee_tag *tags;
-};
-
-/* Basic builtin types, not including the pointers. */
-
-enum builtin_types
-{
- builtin_unknown = 0,
- builtin_void = 1,
- builtin_signed_char = 2,
- builtin_unsigned_char = 3,
- builtin_signed_short_int = 4,
- builtin_unsigned_short_int = 5,
- builtin_signed_long = 6,
- builtin_unsigned_long = 7,
- builtin_signed_long_long = 8,
- builtin_unsigned_long_long = 9,
- builtin_float = 10,
- builtin_double = 11,
- builtin_long_double = 12,
- builtin_long_long_double = 13,
- builtin_quoted_string = 14,
- builtin_instruction_address = 15,
- builtin_int = 16,
- builtin_unsigned = 17,
- builtin_unsigned_int = 18,
- builtin_char = 19,
- builtin_long = 20,
- builtin_short = 21,
- builtin_unsigned_short = 22,
- builtin_short_int = 23,
- builtin_signed_short = 24,
- builtin_bcd_float = 25
-};
-
-/* These are the values found in the derivation flags of a 'b'
- component record of a 'T' type extension record in a C++ pmisc
- record. These are bitmasks. */
-
-/* Set for a private base class, clear for a public base class.
- Protected base classes are not supported. */
-#define BASEFLAGS_PRIVATE (0x1)
-/* Set for a virtual base class. */
-#define BASEFLAGS_VIRTUAL (0x2)
-/* Set for a friend class, clear for a base class. */
-#define BASEFLAGS_FRIEND (0x10)
-
-/* These are the values found in the specs flags of a 'd', 'm', or 'v'
- component record of a 'T' type extension record in a C++ pmisc
- record. The same flags are used for a 'M' record in a C++ pmisc
- record. */
-
-/* The lower two bits hold visibility information. */
-#define CXXFLAGS_VISIBILITY (0x3)
-/* This value in the lower two bits indicates a public member. */
-#define CXXFLAGS_VISIBILITY_PUBLIC (0x0)
-/* This value in the lower two bits indicates a private member. */
-#define CXXFLAGS_VISIBILITY_PRIVATE (0x1)
-/* This value in the lower two bits indicates a protected member. */
-#define CXXFLAGS_VISIBILITY_PROTECTED (0x2)
-/* Set for a static member. */
-#define CXXFLAGS_STATIC (0x4)
-/* Set for a virtual override. */
-#define CXXFLAGS_OVERRIDE (0x8)
-/* Set for a friend function. */
-#define CXXFLAGS_FRIEND (0x10)
-/* Set for a const function. */
-#define CXXFLAGS_CONST (0x20)
-/* Set for a volatile function. */
-#define CXXFLAGS_VOLATILE (0x40)
-/* Set for an overloaded function. */
-#define CXXFLAGS_OVERLOADED (0x80)
-/* Set for an operator function. */
-#define CXXFLAGS_OPERATOR (0x100)
-/* Set for a constructor or destructor. */
-#define CXXFLAGS_CTORDTOR (0x400)
-/* Set for a constructor. */
-#define CXXFLAGS_CTOR (0x200)
-/* Set for an inline function. */
-#define CXXFLAGS_INLINE (0x800)
-
-/* Local functions. */
-
-static void ieee_error
- PARAMS ((struct ieee_info *, const bfd_byte *, const char *));
-static void ieee_eof PARAMS ((struct ieee_info *));
-static char *savestring PARAMS ((const char *, unsigned long));
-static boolean ieee_read_number
- PARAMS ((struct ieee_info *, const bfd_byte **, bfd_vma *));
-static boolean ieee_read_optional_number
- PARAMS ((struct ieee_info *, const bfd_byte **, bfd_vma *, boolean *));
-static boolean ieee_read_id
- PARAMS ((struct ieee_info *, const bfd_byte **, const char **,
- unsigned long *));
-static boolean ieee_read_optional_id
- PARAMS ((struct ieee_info *, const bfd_byte **, const char **,
- unsigned long *, boolean *));
-static boolean ieee_read_expression
- PARAMS ((struct ieee_info *, const bfd_byte **, bfd_vma *));
-static debug_type ieee_builtin_type
- PARAMS ((struct ieee_info *, const bfd_byte *, unsigned int));
-static boolean ieee_alloc_type
- PARAMS ((struct ieee_info *, unsigned int, boolean));
-static boolean ieee_read_type_index
- PARAMS ((struct ieee_info *, const bfd_byte **, debug_type *));
-static int ieee_regno_to_genreg PARAMS ((bfd *, int));
-static int ieee_genreg_to_regno PARAMS ((bfd *, int));
-static boolean parse_ieee_bb PARAMS ((struct ieee_info *, const bfd_byte **));
-static boolean parse_ieee_be PARAMS ((struct ieee_info *, const bfd_byte **));
-static boolean parse_ieee_nn PARAMS ((struct ieee_info *, const bfd_byte **));
-static boolean parse_ieee_ty PARAMS ((struct ieee_info *, const bfd_byte **));
-static boolean parse_ieee_atn PARAMS ((struct ieee_info *, const bfd_byte **));
-static boolean ieee_read_cxx_misc
- PARAMS ((struct ieee_info *, const bfd_byte **, unsigned long));
-static boolean ieee_read_cxx_class
- PARAMS ((struct ieee_info *, const bfd_byte **, unsigned long));
-static boolean ieee_read_cxx_defaults
- PARAMS ((struct ieee_info *, const bfd_byte **, unsigned long));
-static boolean ieee_read_reference
- PARAMS ((struct ieee_info *, const bfd_byte **));
-static boolean ieee_require_asn
- PARAMS ((struct ieee_info *, const bfd_byte **, bfd_vma *));
-static boolean ieee_require_atn65
- PARAMS ((struct ieee_info *, const bfd_byte **, const char **,
- unsigned long *));
-
-/* Report an error in the IEEE debugging information. */
-
-static void
-ieee_error (info, p, s)
- struct ieee_info *info;
- const bfd_byte *p;
- const char *s;
-{
- if (p != NULL)
- fprintf (stderr, "%s: 0x%lx: %s (0x%x)\n", bfd_get_filename (info->abfd),
- (unsigned long) (p - info->bytes), s, *p);
- else
- fprintf (stderr, "%s: %s\n", bfd_get_filename (info->abfd), s);
-}
-
-/* Report an unexpected EOF in the IEEE debugging information. */
-
-static void
-ieee_eof (info)
- struct ieee_info *info;
-{
- ieee_error (info, (const bfd_byte *) NULL,
- "unexpected end of debugging information");
-}
-
-/* Save a string in memory. */
-
-static char *
-savestring (start, len)
- const char *start;
- unsigned long len;
-{
- char *ret;
-
- ret = (char *) xmalloc (len + 1);
- memcpy (ret, start, len);
- ret[len] = '\0';
- return ret;
-}
-
-/* Read a number which must be present in an IEEE file. */
-
-static boolean
-ieee_read_number (info, pp, pv)
- struct ieee_info *info;
- const bfd_byte **pp;
- bfd_vma *pv;
-{
- return ieee_read_optional_number (info, pp, pv, (boolean *) NULL);
-}
-
-/* Read a number in an IEEE file. If ppresent is not NULL, the number
- need not be there. */
-
-static boolean
-ieee_read_optional_number (info, pp, pv, ppresent)
- struct ieee_info *info;
- const bfd_byte **pp;
- bfd_vma *pv;
- boolean *ppresent;
-{
- ieee_record_enum_type b;
-
- if (*pp >= info->pend)
- {
- if (ppresent != NULL)
- {
- *ppresent = false;
- return true;
- }
- ieee_eof (info);
- return false;
- }
-
- b = (ieee_record_enum_type) **pp;
- ++*pp;
-
- if (b <= ieee_number_end_enum)
- {
- *pv = (bfd_vma) b;
- if (ppresent != NULL)
- *ppresent = true;
- return true;
- }
-
- if (b >= ieee_number_repeat_start_enum && b <= ieee_number_repeat_end_enum)
- {
- unsigned int i;
-
- i = (int) b - (int) ieee_number_repeat_start_enum;
- if (*pp + i - 1 >= info->pend)
- {
- ieee_eof (info);
- return false;
- }
-
- *pv = 0;
- for (; i > 0; i--)
- {
- *pv <<= 8;
- *pv += **pp;
- ++*pp;
- }
-
- if (ppresent != NULL)
- *ppresent = true;
-
- return true;
- }
-
- if (ppresent != NULL)
- {
- --*pp;
- *ppresent = false;
- return true;
- }
-
- ieee_error (info, *pp - 1, "invalid number");
- return false;
-}
-
-/* Read a required string from an IEEE file. */
-
-static boolean
-ieee_read_id (info, pp, pname, pnamlen)
- struct ieee_info *info;
- const bfd_byte **pp;
- const char **pname;
- unsigned long *pnamlen;
-{
- return ieee_read_optional_id (info, pp, pname, pnamlen, (boolean *) NULL);
-}
-
-/* Read a string from an IEEE file. If ppresent is not NULL, the
- string is optional. */
-
-static boolean
-ieee_read_optional_id (info, pp, pname, pnamlen, ppresent)
- struct ieee_info *info;
- const bfd_byte **pp;
- const char **pname;
- unsigned long *pnamlen;
- boolean *ppresent;
-{
- bfd_byte b;
- unsigned long len;
-
- if (*pp >= info->pend)
- {
- ieee_eof (info);
- return false;
- }
-
- b = **pp;
- ++*pp;
-
- if (b <= 0x7f)
- len = b;
- else if ((ieee_record_enum_type) b == ieee_extension_length_1_enum)
- {
- len = **pp;
- ++*pp;
- }
- else if ((ieee_record_enum_type) b == ieee_extension_length_2_enum)
- {
- len = (**pp << 8) + (*pp)[1];
- *pp += 2;
- }
- else
- {
- if (ppresent != NULL)
- {
- --*pp;
- *ppresent = false;
- return true;
- }
- ieee_error (info, *pp - 1, "invalid string length");
- return false;
- }
-
- if ((unsigned long) (info->pend - *pp) < len)
- {
- ieee_eof (info);
- return false;
- }
-
- *pname = (const char *) *pp;
- *pnamlen = len;
- *pp += len;
-
- if (ppresent != NULL)
- *ppresent = true;
-
- return true;
-}
-
-/* Read an expression from an IEEE file. Since this code is only used
- to parse debugging information, I haven't bothered to write a full
- blown IEEE expression parser. I've only thrown in the things I've
- seen in debugging information. This can be easily extended if
- necessary. */
-
-static boolean
-ieee_read_expression (info, pp, pv)
- struct ieee_info *info;
- const bfd_byte **pp;
- bfd_vma *pv;
-{
- const bfd_byte *expr_start;
-#define EXPR_STACK_SIZE (10)
- bfd_vma expr_stack[EXPR_STACK_SIZE];
- bfd_vma *esp;
-
- expr_start = *pp;
-
- esp = expr_stack;
-
- while (1)
- {
- const bfd_byte *start;
- bfd_vma val;
- boolean present;
- ieee_record_enum_type c;
-
- start = *pp;
-
- if (! ieee_read_optional_number (info, pp, &val, &present))
- return false;
-
- if (present)
- {
- if (esp - expr_stack >= EXPR_STACK_SIZE)
- {
- ieee_error (info, start, "expression stack overflow");
- return false;
- }
- *esp++ = val;
- continue;
- }
-
- c = (ieee_record_enum_type) **pp;
-
- if (c >= ieee_module_beginning_enum)
- break;
-
- ++*pp;
-
- if (c == ieee_comma)
- break;
-
- switch (c)
- {
- default:
- ieee_error (info, start, "unsupported IEEE expression operator");
- break;
-
- case ieee_variable_R_enum:
- {
- bfd_vma indx;
- asection *s;
-
- if (! ieee_read_number (info, pp, &indx))
- return false;
- for (s = info->abfd->sections; s != NULL; s = s->next)
- if ((bfd_vma) s->target_index == indx)
- break;
- if (s == NULL)
- {
- ieee_error (info, start, "unknown section");
- return false;
- }
-
- if (esp - expr_stack >= EXPR_STACK_SIZE)
- {
- ieee_error (info, start, "expression stack overflow");
- return false;
- }
-
- *esp++ = bfd_get_section_vma (info->abfd, s);
- }
- break;
-
- case ieee_function_plus_enum:
- case ieee_function_minus_enum:
- {
- bfd_vma v1, v2;
-
- if (esp - expr_stack < 2)
- {
- ieee_error (info, start, "expression stack underflow");
- return false;
- }
-
- v1 = *--esp;
- v2 = *--esp;
- *esp++ = v1 + v2;
- }
- break;
- }
- }
-
- if (esp - 1 != expr_stack)
- {
- ieee_error (info, expr_start, "expression stack mismatch");
- return false;
- }
-
- *pv = *--esp;
-
- return true;
-}
-
-/* Return an IEEE builtin type. */
-
-static debug_type
-ieee_builtin_type (info, p, indx)
- struct ieee_info *info;
- const bfd_byte *p;
- unsigned int indx;
-{
- PTR dhandle;
- debug_type type;
- const char *name;
-
- if (indx < BUILTIN_TYPE_COUNT
- && info->types.builtins[indx] != DEBUG_TYPE_NULL)
- return info->types.builtins[indx];
-
- dhandle = info->dhandle;
-
- if (indx >= 32 && indx < 64)
- {
- type = debug_make_pointer_type (dhandle,
- ieee_builtin_type (info, p, indx - 32));
- assert (indx < BUILTIN_TYPE_COUNT);
- info->types.builtins[indx] = type;
- return type;
- }
-
- switch ((enum builtin_types) indx)
- {
- default:
- ieee_error (info, p, "unknown builtin type");
- return NULL;
-
- case builtin_unknown:
- type = debug_make_void_type (dhandle);
- name = NULL;
- break;
-
- case builtin_void:
- type = debug_make_void_type (dhandle);
- name = "void";
- break;
-
- case builtin_signed_char:
- type = debug_make_int_type (dhandle, 1, false);
- name = "signed char";
- break;
-
- case builtin_unsigned_char:
- type = debug_make_int_type (dhandle, 1, true);
- name = "unsigned char";
- break;
-
- case builtin_signed_short_int:
- type = debug_make_int_type (dhandle, 2, false);
- name = "signed short int";
- break;
-
- case builtin_unsigned_short_int:
- type = debug_make_int_type (dhandle, 2, true);
- name = "unsigned short int";
- break;
-
- case builtin_signed_long:
- type = debug_make_int_type (dhandle, 4, false);
- name = "signed long";
- break;
-
- case builtin_unsigned_long:
- type = debug_make_int_type (dhandle, 4, true);
- name = "unsigned long";
- break;
-
- case builtin_signed_long_long:
- type = debug_make_int_type (dhandle, 8, false);
- name = "signed long long";
- break;
-
- case builtin_unsigned_long_long:
- type = debug_make_int_type (dhandle, 8, true);
- name = "unsigned long long";
- break;
-
- case builtin_float:
- type = debug_make_float_type (dhandle, 4);
- name = "float";
- break;
-
- case builtin_double:
- type = debug_make_float_type (dhandle, 8);
- name = "double";
- break;
-
- case builtin_long_double:
- /* FIXME: The size for this type should depend upon the
- processor. */
- type = debug_make_float_type (dhandle, 12);
- name = "long double";
- break;
-
- case builtin_long_long_double:
- type = debug_make_float_type (dhandle, 16);
- name = "long long double";
- break;
-
- case builtin_quoted_string:
- type = debug_make_array_type (dhandle,
- ieee_builtin_type (info, p,
- ((unsigned int)
- builtin_char)),
- ieee_builtin_type (info, p,
- ((unsigned int)
- builtin_int)),
- 0, -1, true);
- name = "QUOTED STRING";
- break;
-
- case builtin_instruction_address:
- /* FIXME: This should be a code address. */
- type = debug_make_int_type (dhandle, 4, true);
- name = "instruction address";
- break;
-
- case builtin_int:
- /* FIXME: The size for this type should depend upon the
- processor. */
- type = debug_make_int_type (dhandle, 4, false);
- name = "int";
- break;
-
- case builtin_unsigned:
- /* FIXME: The size for this type should depend upon the
- processor. */
- type = debug_make_int_type (dhandle, 4, true);
- name = "unsigned";
- break;
-
- case builtin_unsigned_int:
- /* FIXME: The size for this type should depend upon the
- processor. */
- type = debug_make_int_type (dhandle, 4, true);
- name = "unsigned int";
- break;
-
- case builtin_char:
- type = debug_make_int_type (dhandle, 1, false);
- name = "char";
- break;
-
- case builtin_long:
- type = debug_make_int_type (dhandle, 4, false);
- name = "long";
- break;
-
- case builtin_short:
- type = debug_make_int_type (dhandle, 2, false);
- name = "short";
- break;
-
- case builtin_unsigned_short:
- type = debug_make_int_type (dhandle, 2, true);
- name = "unsigned short";
- break;
-
- case builtin_short_int:
- type = debug_make_int_type (dhandle, 2, false);
- name = "short int";
- break;
-
- case builtin_signed_short:
- type = debug_make_int_type (dhandle, 2, false);
- name = "signed short";
- break;
-
- case builtin_bcd_float:
- ieee_error (info, p, "BCD float type not supported");
- return DEBUG_TYPE_NULL;
- }
-
- if (name != NULL)
- type = debug_name_type (dhandle, name, type);
-
- assert (indx < BUILTIN_TYPE_COUNT);
-
- info->types.builtins[indx] = type;
-
- return type;
-}
-
-/* Allocate more space in the type table. If ref is true, this is a
- reference to the type; if it is not already defined, we should set
- up an indirect type. */
-
-static boolean
-ieee_alloc_type (info, indx, ref)
- struct ieee_info *info;
- unsigned int indx;
- boolean ref;
-{
- unsigned int nalloc;
- register struct ieee_type *t;
- struct ieee_type *tend;
-
- if (indx >= info->types.alloc)
- {
- nalloc = info->types.alloc;
- if (nalloc == 0)
- nalloc = 4;
- while (indx >= nalloc)
- nalloc *= 2;
-
- info->types.types = ((struct ieee_type *)
- xrealloc (info->types.types,
- nalloc * sizeof *info->types.types));
-
- memset (info->types.types + info->types.alloc, 0,
- (nalloc - info->types.alloc) * sizeof *info->types.types);
-
- tend = info->types.types + nalloc;
- for (t = info->types.types + info->types.alloc; t < tend; t++)
- t->type = DEBUG_TYPE_NULL;
-
- info->types.alloc = nalloc;
- }
-
- if (ref)
- {
- t = info->types.types + indx;
- if (t->type == NULL)
- {
- t->pslot = (debug_type *) xmalloc (sizeof *t->pslot);
- *t->pslot = DEBUG_TYPE_NULL;
- t->type = debug_make_indirect_type (info->dhandle, t->pslot,
- (const char *) NULL);
- if (t->type == NULL)
- return false;
- }
- }
-
- return true;
-}
-
-/* Read a type index and return the corresponding type. */
-
-static boolean
-ieee_read_type_index (info, pp, ptype)
- struct ieee_info *info;
- const bfd_byte **pp;
- debug_type *ptype;
-{
- const bfd_byte *start;
- bfd_vma indx;
-
- start = *pp;
-
- if (! ieee_read_number (info, pp, &indx))
- return false;
-
- if (indx < 256)
- {
- *ptype = ieee_builtin_type (info, start, indx);
- if (*ptype == NULL)
- return false;
- return true;
- }
-
- indx -= 256;
- if (! ieee_alloc_type (info, indx, true))
- return false;
-
- *ptype = info->types.types[indx].type;
-
- return true;
-}
-
-/* Parse IEEE debugging information for a file. This is passed the
- bytes which compose the Debug Information Part of an IEEE file. */
-
-boolean
-parse_ieee (dhandle, abfd, bytes, len)
- PTR dhandle;
- bfd *abfd;
- const bfd_byte *bytes;
- bfd_size_type len;
-{
- struct ieee_info info;
- unsigned int i;
- const bfd_byte *p, *pend;
-
- info.dhandle = dhandle;
- info.abfd = abfd;
- info.bytes = bytes;
- info.pend = bytes + len;
- info.blockstack.bsp = info.blockstack.stack;
- info.saw_filename = false;
- info.vars.alloc = 0;
- info.vars.vars = NULL;
- info.types.alloc = 0;
- info.types.types = NULL;
- info.tags = NULL;
- for (i = 0; i < BUILTIN_TYPE_COUNT; i++)
- info.types.builtins[i] = DEBUG_TYPE_NULL;
-
- p = bytes;
- pend = info.pend;
- while (p < pend)
- {
- const bfd_byte *record_start;
- ieee_record_enum_type c;
-
- record_start = p;
-
- c = (ieee_record_enum_type) *p++;
-
- if (c == ieee_at_record_enum)
- c = (ieee_record_enum_type) (((unsigned int) c << 8) | *p++);
-
- if (c <= ieee_number_repeat_end_enum)
- {
- ieee_error (&info, record_start, "unexpected number");
- return false;
- }
-
- switch (c)
- {
- default:
- ieee_error (&info, record_start, "unexpected record type");
- return false;
-
- case ieee_bb_record_enum:
- if (! parse_ieee_bb (&info, &p))
- return false;
- break;
-
- case ieee_be_record_enum:
- if (! parse_ieee_be (&info, &p))
- return false;
- break;
-
- case ieee_nn_record:
- if (! parse_ieee_nn (&info, &p))
- return false;
- break;
-
- case ieee_ty_record_enum:
- if (! parse_ieee_ty (&info, &p))
- return false;
- break;
-
- case ieee_atn_record_enum:
- if (! parse_ieee_atn (&info, &p))
- return false;
- break;
- }
- }
-
- if (info.blockstack.bsp != info.blockstack.stack)
- {
- ieee_error (&info, (const bfd_byte *) NULL,
- "blocks left on stack at end");
- return false;
- }
-
- return true;
-}
-
-/* Handle an IEEE BB record. */
-
-static boolean
-parse_ieee_bb (info, pp)
- struct ieee_info *info;
- const bfd_byte **pp;
-{
- const bfd_byte *block_start;
- bfd_byte b;
- bfd_vma size;
- const char *name;
- unsigned long namlen;
- char *namcopy = NULL;
- unsigned int fnindx;
- boolean skip;
-
- block_start = *pp;
-
- b = **pp;
- ++*pp;
-
- if (! ieee_read_number (info, pp, &size)
- || ! ieee_read_id (info, pp, &name, &namlen))
- return false;
-
- fnindx = (unsigned int) -1;
- skip = false;
-
- switch (b)
- {
- case 1:
- /* BB1: Type definitions local to a module. */
- namcopy = savestring (name, namlen);
- if (namcopy == NULL)
- return false;
- if (! debug_set_filename (info->dhandle, namcopy))
- return false;
- info->saw_filename = true;
-
- /* Discard any variables or types we may have seen before. */
- if (info->vars.vars != NULL)
- free (info->vars.vars);
- info->vars.vars = NULL;
- info->vars.alloc = 0;
- if (info->types.types != NULL)
- free (info->types.types);
- info->types.types = NULL;
- info->types.alloc = 0;
-
- /* Initialize the types to the global types. */
- if (info->global_types != NULL)
- {
- info->types.alloc = info->global_types->alloc;
- info->types.types = ((struct ieee_type *)
- xmalloc (info->types.alloc
- * sizeof (*info->types.types)));
- memcpy (info->types.types, info->global_types->types,
- info->types.alloc * sizeof (*info->types.types));
- }
-
- break;
-
- case 2:
- /* BB2: Global type definitions. The name is supposed to be
- empty, but we don't check. */
- if (! debug_set_filename (info->dhandle, "*global*"))
- return false;
- info->saw_filename = true;
- break;
-
- case 3:
- /* BB3: High level module block begin. We don't have to do
- anything here. The name is supposed to be the same as for
- the BB1, but we don't check. */
- break;
-
- case 4:
- /* BB4: Global function. */
- {
- bfd_vma stackspace, typindx, offset;
- debug_type return_type;
-
- if (! ieee_read_number (info, pp, &stackspace)
- || ! ieee_read_number (info, pp, &typindx)
- || ! ieee_read_expression (info, pp, &offset))
- return false;
-
- /* We have no way to record the stack space. FIXME. */
-
- if (typindx < 256)
- {
- return_type = ieee_builtin_type (info, block_start, typindx);
- if (return_type == DEBUG_TYPE_NULL)
- return false;
- }
- else
- {
- typindx -= 256;
- if (! ieee_alloc_type (info, typindx, true))
- return false;
- fnindx = typindx;
- return_type = info->types.types[typindx].type;
- if (debug_get_type_kind (info->dhandle, return_type)
- == DEBUG_KIND_FUNCTION)
- return_type = debug_get_return_type (info->dhandle,
- return_type);
- }
-
- namcopy = savestring (name, namlen);
- if (namcopy == NULL)
- return false;
- if (! debug_record_function (info->dhandle, namcopy, return_type,
- true, offset))
- return false;
- }
- break;
-
- case 5:
- /* BB5: File name for source line numbers. */
- {
- unsigned int i;
-
- /* We ignore the date and time. FIXME. */
- for (i = 0; i < 6; i++)
- {
- bfd_vma ignore;
- boolean present;
-
- if (! ieee_read_optional_number (info, pp, &ignore, &present))
- return false;
- if (! present)
- break;
- }
-
- namcopy = savestring (name, namlen);
- if (namcopy == NULL)
- return false;
- if (! debug_start_source (info->dhandle, namcopy))
- return false;
- }
- break;
-
- case 6:
- /* BB6: Local function or block. */
- {
- bfd_vma stackspace, typindx, offset;
-
- if (! ieee_read_number (info, pp, &stackspace)
- || ! ieee_read_number (info, pp, &typindx)
- || ! ieee_read_expression (info, pp, &offset))
- return false;
-
- /* We have no way to record the stack space. FIXME. */
-
- if (namlen == 0)
- {
- if (! debug_start_block (info->dhandle, offset))
- return false;
- /* Change b to indicate that this is a block
- rather than a function. */
- b = 0x86;
- }
- else
- {
- /* The MRI C++ compiler will output a fake function named
- __XRYCPP to hold C++ debugging information. We skip
- that function. This is not crucial, but it makes
- converting from IEEE to other debug formats work
- better. */
- if (strncmp (name, "__XRYCPP", namlen) == 0)
- skip = true;
- else
- {
- debug_type return_type;
-
- if (typindx < 256)
- {
- return_type = ieee_builtin_type (info, block_start,
- typindx);
- if (return_type == NULL)
- return false;
- }
- else
- {
- typindx -= 256;
- if (! ieee_alloc_type (info, typindx, true))
- return false;
- fnindx = typindx;
- return_type = info->types.types[typindx].type;
- if (debug_get_type_kind (info->dhandle, return_type)
- == DEBUG_KIND_FUNCTION)
- return_type = debug_get_return_type (info->dhandle,
- return_type);
- }
-
- namcopy = savestring (name, namlen);
- if (namcopy == NULL)
- return false;
- if (! debug_record_function (info->dhandle, namcopy,
- return_type, false, offset))
- return false;
- }
- }
- }
- break;
-
- case 10:
- /* BB10: Assembler module scope. In the normal case, we
- completely ignore all this information. FIXME. */
- {
- const char *inam, *vstr;
- unsigned long inamlen, vstrlen;
- bfd_vma tool_type;
- boolean present;
- unsigned int i;
-
- if (! info->saw_filename)
- {
- namcopy = savestring (name, namlen);
- if (namcopy == NULL)
- return false;
- if (! debug_set_filename (info->dhandle, namcopy))
- return false;
- info->saw_filename = true;
- }
-
- if (! ieee_read_id (info, pp, &inam, &inamlen)
- || ! ieee_read_number (info, pp, &tool_type)
- || ! ieee_read_optional_id (info, pp, &vstr, &vstrlen, &present))
- return false;
- for (i = 0; i < 6; i++)
- {
- bfd_vma ignore;
-
- if (! ieee_read_optional_number (info, pp, &ignore, &present))
- return false;
- if (! present)
- break;
- }
- }
- break;
-
- case 11:
- /* BB11: Module section. We completely ignore all this
- information. FIXME. */
- {
- bfd_vma sectype, secindx, offset, map;
- boolean present;
-
- if (! ieee_read_number (info, pp, &sectype)
- || ! ieee_read_number (info, pp, &secindx)
- || ! ieee_read_expression (info, pp, &offset)
- || ! ieee_read_optional_number (info, pp, &map, &present))
- return false;
- }
- break;
-
- default:
- ieee_error (info, block_start, "unknown BB type");
- return false;
- }
-
-
- /* Push this block on the block stack. */
-
- if (info->blockstack.bsp >= info->blockstack.stack + BLOCKSTACK_SIZE)
- {
- ieee_error (info, (const bfd_byte *) NULL, "stack overflow");
- return false;
- }
-
- info->blockstack.bsp->kind = b;
- if (b == 5)
- info->blockstack.bsp->filename = namcopy;
- info->blockstack.bsp->fnindx = fnindx;
- info->blockstack.bsp->skip = skip;
- ++info->blockstack.bsp;
-
- return true;
-}
-
-/* Handle an IEEE BE record. */
-
-static boolean
-parse_ieee_be (info, pp)
- struct ieee_info *info;
- const bfd_byte **pp;
-{
- bfd_vma offset;
-
- if (info->blockstack.bsp <= info->blockstack.stack)
- {
- ieee_error (info, *pp, "stack underflow");
- return false;
- }
- --info->blockstack.bsp;
-
- switch (info->blockstack.bsp->kind)
- {
- case 2:
- /* When we end the global typedefs block, we copy out the the
- contents of info->vars. This is because the variable indices
- may be reused in the local blocks. However, we need to
- preserve them so that we can locate a function returning a
- reference variable whose type is named in the global typedef
- block. */
- info->global_vars = ((struct ieee_vars *)
- xmalloc (sizeof *info->global_vars));
- info->global_vars->alloc = info->vars.alloc;
- info->global_vars->vars = ((struct ieee_var *)
- xmalloc (info->vars.alloc
- * sizeof (*info->vars.vars)));
- memcpy (info->global_vars->vars, info->vars.vars,
- info->vars.alloc * sizeof (*info->vars.vars));
-
- /* We also copy out the non builtin parts of info->types, since
- the types are discarded when we start a new block. */
- info->global_types = ((struct ieee_types *)
- xmalloc (sizeof *info->global_types));
- info->global_types->alloc = info->types.alloc;
- info->global_types->types = ((struct ieee_type *)
- xmalloc (info->types.alloc
- * sizeof (*info->types.types)));
- memcpy (info->global_types->types, info->types.types,
- info->types.alloc * sizeof (*info->types.types));
- memset (info->global_types->builtins, 0,
- sizeof (info->global_types->builtins));
-
- break;
-
- case 4:
- case 6:
- if (! ieee_read_expression (info, pp, &offset))
- return false;
- if (! info->blockstack.bsp->skip)
- {
- if (! debug_end_function (info->dhandle, offset + 1))
- return false;
- }
- break;
-
- case 0x86:
- /* This is BE6 when BB6 started a block rather than a local
- function. */
- if (! ieee_read_expression (info, pp, &offset))
- return false;
- if (! debug_end_block (info->dhandle, offset + 1))
- return false;
- break;
-
- case 5:
- /* When we end a BB5, we look up the stack for the last BB5, if
- there is one, so that we can call debug_start_source. */
- if (info->blockstack.bsp > info->blockstack.stack)
- {
- struct ieee_block *bl;
-
- bl = info->blockstack.bsp;
- do
- {
- --bl;
- if (bl->kind == 5)
- {
- if (! debug_start_source (info->dhandle, bl->filename))
- return false;
- break;
- }
- }
- while (bl != info->blockstack.stack);
- }
- break;
-
- case 11:
- if (! ieee_read_expression (info, pp, &offset))
- return false;
- /* We just ignore the module size. FIXME. */
- break;
-
- default:
- /* Other block types do not have any trailing information. */
- break;
- }
-
- return true;
-}
-
-/* Parse an NN record. */
-
-static boolean
-parse_ieee_nn (info, pp)
- struct ieee_info *info;
- const bfd_byte **pp;
-{
- const bfd_byte *nn_start;
- bfd_vma varindx;
- const char *name;
- unsigned long namlen;
-
- nn_start = *pp;
-
- if (! ieee_read_number (info, pp, &varindx)
- || ! ieee_read_id (info, pp, &name, &namlen))
- return false;
-
- if (varindx < 32)
- {
- ieee_error (info, nn_start, "illegal variable index");
- return false;
- }
- varindx -= 32;
-
- if (varindx >= info->vars.alloc)
- {
- unsigned int alloc;
-
- alloc = info->vars.alloc;
- if (alloc == 0)
- alloc = 4;
- while (varindx >= alloc)
- alloc *= 2;
- info->vars.vars = ((struct ieee_var *)
- xrealloc (info->vars.vars,
- alloc * sizeof *info->vars.vars));
- memset (info->vars.vars + info->vars.alloc, 0,
- (alloc - info->vars.alloc) * sizeof *info->vars.vars);
- info->vars.alloc = alloc;
- }
-
- info->vars.vars[varindx].name = name;
- info->vars.vars[varindx].namlen = namlen;
-
- return true;
-}
-
-/* Parse a TY record. */
-
-static boolean
-parse_ieee_ty (info, pp)
- struct ieee_info *info;
- const bfd_byte **pp;
-{
- const bfd_byte *ty_start, *ty_var_start, *ty_code_start;
- bfd_vma typeindx, varindx, tc;
- PTR dhandle;
- boolean tag, typdef;
- debug_type *arg_slots;
- unsigned long type_bitsize;
- debug_type type;
-
- ty_start = *pp;
-
- if (! ieee_read_number (info, pp, &typeindx))
- return false;
-
- if (typeindx < 256)
- {
- ieee_error (info, ty_start, "illegal type index");
- return false;
- }
-
- typeindx -= 256;
- if (! ieee_alloc_type (info, typeindx, false))
- return false;
-
- if (**pp != 0xce)
- {
- ieee_error (info, *pp, "unknown TY code");
- return false;
- }
- ++*pp;
-
- ty_var_start = *pp;
-
- if (! ieee_read_number (info, pp, &varindx))
- return false;
-
- if (varindx < 32)
- {
- ieee_error (info, ty_var_start, "illegal variable index");
- return false;
- }
- varindx -= 32;
-
- if (varindx >= info->vars.alloc || info->vars.vars[varindx].name == NULL)
- {
- ieee_error (info, ty_var_start, "undefined variable in TY");
- return false;
- }
-
- ty_code_start = *pp;
-
- if (! ieee_read_number (info, pp, &tc))
- return false;
-
- dhandle = info->dhandle;
-
- tag = false;
- typdef = false;
- arg_slots = NULL;
- type_bitsize = 0;
- switch (tc)
- {
- default:
- ieee_error (info, ty_code_start, "unknown TY code");
- return false;
-
- case '!':
- /* Unknown type, with size. We treat it as int. FIXME. */
- {
- bfd_vma size;
-
- if (! ieee_read_number (info, pp, &size))
- return false;
- type = debug_make_int_type (dhandle, size, false);
- }
- break;
-
- case 'A': /* Array. */
- case 'a': /* FORTRAN array in column/row order. FIXME: Not
- distinguished from normal array. */
- {
- debug_type ele_type;
- bfd_vma lower, upper;
-
- if (! ieee_read_type_index (info, pp, &ele_type)
- || ! ieee_read_number (info, pp, &lower)
- || ! ieee_read_number (info, pp, &upper))
- return false;
- type = debug_make_array_type (dhandle, ele_type,
- ieee_builtin_type (info, ty_code_start,
- ((unsigned int)
- builtin_int)),
- (bfd_signed_vma) lower,
- (bfd_signed_vma) upper,
- false);
- }
- break;
-
- case 'E':
- /* Simple enumeration. */
- {
- bfd_vma size;
- unsigned int alloc;
- const char **names;
- unsigned int c;
- bfd_signed_vma *vals;
- unsigned int i;
-
- if (! ieee_read_number (info, pp, &size))
- return false;
- /* FIXME: we ignore the enumeration size. */
-
- alloc = 10;
- names = (const char **) xmalloc (alloc * sizeof *names);
- memset (names, 0, alloc * sizeof *names);
- c = 0;
- while (1)
- {
- const char *name;
- unsigned long namlen;
- boolean present;
-
- if (! ieee_read_optional_id (info, pp, &name, &namlen, &present))
- return false;
- if (! present)
- break;
-
- if (c + 1 >= alloc)
- {
- alloc += 10;
- names = ((const char **)
- xrealloc (names, alloc * sizeof *names));
- }
-
- names[c] = savestring (name, namlen);
- if (names[c] == NULL)
- return false;
- ++c;
- }
-
- names[c] = NULL;
-
- vals = (bfd_signed_vma *) xmalloc (c * sizeof *vals);
- for (i = 0; i < c; i++)
- vals[i] = i;
-
- type = debug_make_enum_type (dhandle, names, vals);
- tag = true;
- }
- break;
-
- case 'G':
- /* Struct with bit fields. */
- {
- bfd_vma size;
- unsigned int alloc;
- debug_field *fields;
- unsigned int c;
-
- if (! ieee_read_number (info, pp, &size))
- return false;
-
- alloc = 10;
- fields = (debug_field *) xmalloc (alloc * sizeof *fields);
- c = 0;
- while (1)
- {
- const char *name;
- unsigned long namlen;
- boolean present;
- debug_type ftype;
- bfd_vma bitpos, bitsize;
-
- if (! ieee_read_optional_id (info, pp, &name, &namlen, &present))
- return false;
- if (! present)
- break;
- if (! ieee_read_type_index (info, pp, &ftype)
- || ! ieee_read_number (info, pp, &bitpos)
- || ! ieee_read_number (info, pp, &bitsize))
- return false;
-
- if (c + 1 >= alloc)
- {
- alloc += 10;
- fields = ((debug_field *)
- xrealloc (fields, alloc * sizeof *fields));
- }
-
- fields[c] = debug_make_field (dhandle, savestring (name, namlen),
- ftype, bitpos, bitsize,
- DEBUG_VISIBILITY_PUBLIC);
- if (fields[c] == NULL)
- return false;
- ++c;
- }
-
- fields[c] = NULL;
-
- type = debug_make_struct_type (dhandle, true, size, fields);
- tag = true;
- }
- break;
-
- case 'N':
- /* Enumeration. */
- {
- unsigned int alloc;
- const char **names;
- bfd_signed_vma *vals;
- unsigned int c;
-
- alloc = 10;
- names = (const char **) xmalloc (alloc * sizeof *names);
- vals = (bfd_signed_vma *) xmalloc (alloc * sizeof *names);
- c = 0;
- while (1)
- {
- const char *name;
- unsigned long namlen;
- boolean present;
- bfd_vma val;
-
- if (! ieee_read_optional_id (info, pp, &name, &namlen, &present))
- return false;
- if (! present)
- break;
- if (! ieee_read_number (info, pp, &val))
- return false;
-
- /* If the length of the name is zero, then the value is
- actually the size of the enum. We ignore this
- information. FIXME. */
- if (namlen == 0)
- continue;
-
- if (c + 1 >= alloc)
- {
- alloc += 10;
- names = ((const char **)
- xrealloc (names, alloc * sizeof *names));
- vals = ((bfd_signed_vma *)
- xrealloc (vals, alloc * sizeof *vals));
- }
-
- names[c] = savestring (name, namlen);
- if (names[c] == NULL)
- return false;
- vals[c] = (bfd_signed_vma) val;
- ++c;
- }
-
- names[c] = NULL;
-
- type = debug_make_enum_type (dhandle, names, vals);
- tag = true;
- }
- break;
-
- case 'O': /* Small pointer. We don't distinguish small and large
- pointers. FIXME. */
- case 'P': /* Large pointer. */
- {
- debug_type t;
-
- if (! ieee_read_type_index (info, pp, &t))
- return false;
- type = debug_make_pointer_type (dhandle, t);
- }
- break;
-
- case 'R':
- /* Range. */
- {
- bfd_vma low, high, signedp, size;
-
- if (! ieee_read_number (info, pp, &low)
- || ! ieee_read_number (info, pp, &high)
- || ! ieee_read_number (info, pp, &signedp)
- || ! ieee_read_number (info, pp, &size))
- return false;
-
- type = debug_make_range_type (dhandle,
- debug_make_int_type (dhandle, size,
- ! signedp),
- (bfd_signed_vma) low,
- (bfd_signed_vma) high);
- }
- break;
-
- case 'S': /* Struct. */
- case 'U': /* Union. */
- {
- bfd_vma size;
- unsigned int alloc;
- debug_field *fields;
- unsigned int c;
-
- if (! ieee_read_number (info, pp, &size))
- return false;
-
- alloc = 10;
- fields = (debug_field *) xmalloc (alloc * sizeof *fields);
- c = 0;
- while (1)
- {
- const char *name;
- unsigned long namlen;
- boolean present;
- bfd_vma tindx;
- bfd_vma offset;
- debug_type ftype;
- bfd_vma bitsize;
-
- if (! ieee_read_optional_id (info, pp, &name, &namlen, &present))
- return false;
- if (! present)
- break;
- if (! ieee_read_number (info, pp, &tindx)
- || ! ieee_read_number (info, pp, &offset))
- return false;
-
- if (tindx < 256)
- {
- ftype = ieee_builtin_type (info, ty_code_start, tindx);
- bitsize = 0;
- offset *= 8;
- }
- else
- {
- struct ieee_type *t;
-
- tindx -= 256;
- if (! ieee_alloc_type (info, tindx, true))
- return false;
- t = info->types.types + tindx;
- ftype = t->type;
- bitsize = t->bitsize;
- if (bitsize == 0)
- offset *= 8;
- }
-
- if (c + 1 >= alloc)
- {
- alloc += 10;
- fields = ((debug_field *)
- xrealloc (fields, alloc * sizeof *fields));
- }
-
- fields[c] = debug_make_field (dhandle, savestring (name, namlen),
- ftype, offset, bitsize,
- DEBUG_VISIBILITY_PUBLIC);
- if (fields[c] == NULL)
- return false;
- ++c;
- }
-
- fields[c] = NULL;
-
- type = debug_make_struct_type (dhandle, tc == 'S', size, fields);
- tag = true;
- }
- break;
-
- case 'T':
- /* Typedef. */
- if (! ieee_read_type_index (info, pp, &type))
- return false;
- typdef = true;
- break;
-
- case 'X':
- /* Procedure. FIXME: This is an extern declaration, which we
- have no way of representing. */
- {
- bfd_vma attr;
- debug_type rtype;
- bfd_vma nargs;
- boolean present;
- struct ieee_var *pv;
-
- /* FIXME: We ignore the attribute and the argument names. */
-
- if (! ieee_read_number (info, pp, &attr)
- || ! ieee_read_type_index (info, pp, &rtype)
- || ! ieee_read_number (info, pp, &nargs))
- return false;
- do
- {
- const char *name;
- unsigned long namlen;
-
- if (! ieee_read_optional_id (info, pp, &name, &namlen, &present))
- return false;
- }
- while (present);
-
- pv = info->vars.vars + varindx;
- pv->kind = IEEE_EXTERNAL;
- if (pv->namlen > 0
- && debug_get_type_kind (dhandle, rtype) == DEBUG_KIND_POINTER)
- {
- /* Set up the return type as an indirect type pointing to
- the variable slot, so that we can change it to a
- reference later if appropriate. */
- pv->pslot = (debug_type *) xmalloc (sizeof *pv->pslot);
- *pv->pslot = rtype;
- rtype = debug_make_indirect_type (dhandle, pv->pslot,
- (const char *) NULL);
- }
-
- type = debug_make_function_type (dhandle, rtype, (debug_type *) NULL,
- false);
- }
- break;
-
- case 'V':
- /* Void. This is not documented, but the MRI compiler emits it. */
- type = debug_make_void_type (dhandle);
- break;
-
- case 'Z':
- /* Array with 0 lower bound. */
- {
- debug_type etype;
- bfd_vma high;
-
- if (! ieee_read_type_index (info, pp, &etype)
- || ! ieee_read_number (info, pp, &high))
- return false;
-
- type = debug_make_array_type (dhandle, etype,
- ieee_builtin_type (info, ty_code_start,
- ((unsigned int)
- builtin_int)),
- 0, (bfd_signed_vma) high, false);
- }
- break;
-
- case 'c': /* Complex. */
- case 'd': /* Double complex. */
- {
- const char *name;
- unsigned long namlen;
-
- /* FIXME: I don't know what the name means. */
-
- if (! ieee_read_id (info, pp, &name, &namlen))
- return false;
-
- type = debug_make_complex_type (dhandle, tc == 'c' ? 4 : 8);
- }
- break;
-
- case 'f':
- /* Pascal file name. FIXME. */
- ieee_error (info, ty_code_start, "Pascal file name not supported");
- return false;
-
- case 'g':
- /* Bitfield type. */
- {
- bfd_vma signedp, bitsize, dummy;
- const bfd_byte *hold;
- boolean present;
-
- if (! ieee_read_number (info, pp, &signedp)
- || ! ieee_read_number (info, pp, &bitsize))
- return false;
-
- /* I think the documentation says that there is a type index,
- but some actual files do not have one. */
- hold = *pp;
- if (! ieee_read_optional_number (info, pp, &dummy, &present))
- return false;
- if (! present)
- {
- /* FIXME: This is just a guess. */
- type = debug_make_int_type (dhandle, 4,
- signedp ? false : true);
- }
- else
- {
- *pp = hold;
- if (! ieee_read_type_index (info, pp, &type))
- return false;
- }
- type_bitsize = bitsize;
- }
- break;
-
- case 'n':
- /* Qualifier. */
- {
- bfd_vma kind;
- debug_type t;
-
- if (! ieee_read_number (info, pp, &kind)
- || ! ieee_read_type_index (info, pp, &t))
- return false;
-
- switch (kind)
- {
- default:
- ieee_error (info, ty_start, "unsupported qualifer");
- return false;
-
- case 1:
- type = debug_make_const_type (dhandle, t);
- break;
-
- case 2:
- type = debug_make_volatile_type (dhandle, t);
- break;
- }
- }
- break;
-
- case 's':
- /* Set. */
- {
- bfd_vma size;
- debug_type etype;
-
- if (! ieee_read_number (info, pp, &size)
- || ! ieee_read_type_index (info, pp, &etype))
- return false;
-
- /* FIXME: We ignore the size. */
-
- type = debug_make_set_type (dhandle, etype, false);
- }
- break;
-
- case 'x':
- /* Procedure with compiler dependencies. */
- {
- struct ieee_var *pv;
- bfd_vma attr, frame_type, push_mask, nargs, level, father;
- debug_type rtype;
- debug_type *arg_types;
- boolean varargs;
- boolean present;
-
- /* FIXME: We ignore some of this information. */
-
- pv = info->vars.vars + varindx;
-
- if (! ieee_read_number (info, pp, &attr)
- || ! ieee_read_number (info, pp, &frame_type)
- || ! ieee_read_number (info, pp, &push_mask)
- || ! ieee_read_type_index (info, pp, &rtype)
- || ! ieee_read_number (info, pp, &nargs))
- return false;
- if (nargs == (bfd_vma) -1)
- {
- arg_types = NULL;
- varargs = false;
- }
- else
- {
- unsigned int i;
-
- arg_types = ((debug_type *)
- xmalloc ((nargs + 1) * sizeof *arg_types));
- for (i = 0; i < nargs; i++)
- if (! ieee_read_type_index (info, pp, arg_types + i))
- return false;
-
- /* If the last type is pointer to void, this is really a
- varargs function. */
- varargs = false;
- if (nargs > 0)
- {
- debug_type last;
-
- last = arg_types[nargs - 1];
- if (debug_get_type_kind (dhandle, last) == DEBUG_KIND_POINTER
- && (debug_get_type_kind (dhandle,
- debug_get_target_type (dhandle,
- last))
- == DEBUG_KIND_VOID))
- {
- --nargs;
- varargs = true;
- }
- }
-
- /* If there are any pointer arguments, turn them into
- indirect types in case we later need to convert them to
- reference types. */
- for (i = 0; i < nargs; i++)
- {
- if (debug_get_type_kind (dhandle, arg_types[i])
- == DEBUG_KIND_POINTER)
- {
- if (arg_slots == NULL)
- {
- arg_slots = ((debug_type *)
- xmalloc (nargs * sizeof *arg_slots));
- memset (arg_slots, 0, nargs * sizeof *arg_slots);
- }
- arg_slots[i] = arg_types[i];
- arg_types[i] =
- debug_make_indirect_type (dhandle,
- arg_slots + i,
- (const char *) NULL);
- }
- }
-
- arg_types[nargs] = DEBUG_TYPE_NULL;
- }
- if (! ieee_read_number (info, pp, &level)
- || ! ieee_read_optional_number (info, pp, &father, &present))
- return false;
-
- /* We can't distinguish between a global function and a static
- function. */
- pv->kind = IEEE_FUNCTION;
-
- if (pv->namlen > 0
- && debug_get_type_kind (dhandle, rtype) == DEBUG_KIND_POINTER)
- {
- /* Set up the return type as an indirect type pointing to
- the variable slot, so that we can change it to a
- reference later if appropriate. */
- pv->pslot = (debug_type *) xmalloc (sizeof *pv->pslot);
- *pv->pslot = rtype;
- rtype = debug_make_indirect_type (dhandle, pv->pslot,
- (const char *) NULL);
- }
-
- type = debug_make_function_type (dhandle, rtype, arg_types, varargs);
- }
- break;
- }
-
- /* Record the type in the table. */
-
- if (type == DEBUG_TYPE_NULL)
- return false;
-
- info->vars.vars[varindx].type = type;
-
- if ((tag || typdef)
- && info->vars.vars[varindx].namlen > 0)
- {
- const char *name;
-
- name = savestring (info->vars.vars[varindx].name,
- info->vars.vars[varindx].namlen);
- if (typdef)
- type = debug_name_type (dhandle, name, type);
- else if (tc == 'E' || tc == 'N')
- type = debug_tag_type (dhandle, name, type);
- else
- {
- struct ieee_tag *it;
-
- /* We must allocate all struct tags as indirect types, so
- that if we later see a definition of the tag as a C++
- record we can update the indirect slot and automatically
- change all the existing references. */
- it = (struct ieee_tag *) xmalloc (sizeof *it);
- memset (it, 0, sizeof *it);
- it->next = info->tags;
- info->tags = it;
- it->name = name;
- it->slot = type;
-
- type = debug_make_indirect_type (dhandle, &it->slot, name);
- type = debug_tag_type (dhandle, name, type);
-
- it->type = type;
- }
- if (type == NULL)
- return false;
- }
-
- info->types.types[typeindx].type = type;
- info->types.types[typeindx].arg_slots = arg_slots;
- info->types.types[typeindx].bitsize = type_bitsize;
-
- /* We may have already allocated type as an indirect type pointing
- to slot. It does no harm to replace the indirect type with the
- real type. Filling in slot as well handles the indirect types
- which are already hanging around. */
- if (info->types.types[typeindx].pslot != NULL)
- *info->types.types[typeindx].pslot = type;
-
- return true;
-}
-
-/* Parse an ATN record. */
-
-static boolean
-parse_ieee_atn (info, pp)
- struct ieee_info *info;
- const bfd_byte **pp;
-{
- const bfd_byte *atn_start, *atn_code_start;
- bfd_vma varindx;
- struct ieee_var *pvar;
- debug_type type;
- bfd_vma atn_code;
- PTR dhandle;
- bfd_vma v, v2, v3, v4, v5;
- const char *name;
- unsigned long namlen;
- char *namcopy;
- boolean present;
- int blocktype;
-
- atn_start = *pp;
-
- if (! ieee_read_number (info, pp, &varindx)
- || ! ieee_read_type_index (info, pp, &type))
- return false;
-
- atn_code_start = *pp;
-
- if (! ieee_read_number (info, pp, &atn_code))
- return false;
-
- if (varindx == 0)
- {
- pvar = NULL;
- name = "";
- namlen = 0;
- }
- else if (varindx < 32)
- {
- ieee_error (info, atn_start, "illegal variable index");
- return false;
- }
- else
- {
- varindx -= 32;
- if (varindx >= info->vars.alloc
- || info->vars.vars[varindx].name == NULL)
- {
- /* The MRI compiler or linker sometimes omits the NN record
- for a pmisc record. */
- if (atn_code == 62)
- {
- if (varindx >= info->vars.alloc)
- {
- unsigned int alloc;
-
- alloc = info->vars.alloc;
- if (alloc == 0)
- alloc = 4;
- while (varindx >= alloc)
- alloc *= 2;
- info->vars.vars = ((struct ieee_var *)
- xrealloc (info->vars.vars,
- (alloc
- * sizeof *info->vars.vars)));
- memset (info->vars.vars + info->vars.alloc, 0,
- ((alloc - info->vars.alloc)
- * sizeof *info->vars.vars));
- info->vars.alloc = alloc;
- }
-
- pvar = info->vars.vars + varindx;
- pvar->name = "";
- pvar->namlen = 0;
- }
- else
- {
- ieee_error (info, atn_start, "undefined variable in ATN");
- return false;
- }
- }
-
- pvar = info->vars.vars + varindx;
-
- pvar->type = type;
-
- name = pvar->name;
- namlen = pvar->namlen;
- }
-
- dhandle = info->dhandle;
-
- /* If we are going to call debug_record_variable with a pointer
- type, change the type to an indirect type so that we can later
- change it to a reference type if we encounter a C++ pmisc 'R'
- record. */
- if (pvar != NULL
- && type != DEBUG_TYPE_NULL
- && debug_get_type_kind (dhandle, type) == DEBUG_KIND_POINTER)
- {
- switch (atn_code)
- {
- case 1:
- case 2:
- case 3:
- case 5:
- case 8:
- case 10:
- pvar->pslot = (debug_type *) xmalloc (sizeof *pvar->pslot);
- *pvar->pslot = type;
- type = debug_make_indirect_type (dhandle, pvar->pslot,
- (const char *) NULL);
- pvar->type = type;
- break;
- }
- }
-
- switch (atn_code)
- {
- default:
- ieee_error (info, atn_code_start, "unknown ATN type");
- return false;
-
- case 1:
- /* Automatic variable. */
- if (! ieee_read_number (info, pp, &v))
- return false;
- namcopy = savestring (name, namlen);
- if (type == NULL)
- type = debug_make_void_type (dhandle);
- if (pvar != NULL)
- pvar->kind = IEEE_LOCAL;
- return debug_record_variable (dhandle, namcopy, type, DEBUG_LOCAL, v);
-
- case 2:
- /* Register variable. */
- if (! ieee_read_number (info, pp, &v))
- return false;
- namcopy = savestring (name, namlen);
- if (type == NULL)
- type = debug_make_void_type (dhandle);
- if (pvar != NULL)
- pvar->kind = IEEE_LOCAL;
- return debug_record_variable (dhandle, namcopy, type, DEBUG_REGISTER,
- ieee_regno_to_genreg (info->abfd, v));
-
- case 3:
- /* Static variable. */
- if (! ieee_require_asn (info, pp, &v))
- return false;
- namcopy = savestring (name, namlen);
- if (type == NULL)
- type = debug_make_void_type (dhandle);
- if (info->blockstack.bsp <= info->blockstack.stack)
- blocktype = 0;
- else
- blocktype = info->blockstack.bsp[-1].kind;
- if (pvar != NULL)
- {
- if (blocktype == 4 || blocktype == 6)
- pvar->kind = IEEE_LOCAL;
- else
- pvar->kind = IEEE_STATIC;
- }
- return debug_record_variable (dhandle, namcopy, type,
- (blocktype == 4 || blocktype == 6
- ? DEBUG_LOCAL_STATIC
- : DEBUG_STATIC),
- v);
-
- case 4:
- /* External function. We don't currently record these. FIXME. */
- if (pvar != NULL)
- pvar->kind = IEEE_EXTERNAL;
- return true;
-
- case 5:
- /* External variable. We don't currently record these. FIXME. */
- if (pvar != NULL)
- pvar->kind = IEEE_EXTERNAL;
- return true;
-
- case 7:
- if (! ieee_read_number (info, pp, &v)
- || ! ieee_read_number (info, pp, &v2)
- || ! ieee_read_optional_number (info, pp, &v3, &present))
- return false;
- if (present)
- {
- if (! ieee_read_optional_number (info, pp, &v4, &present))
- return false;
- }
-
- /* We just ignore the two optional fields in v3 and v4, since
- they are not defined. */
-
- if (! ieee_require_asn (info, pp, &v3))
- return false;
-
- /* We have no way to record the column number. FIXME. */
-
- return debug_record_line (dhandle, v, v3);
-
- case 8:
- /* Global variable. */
- if (! ieee_require_asn (info, pp, &v))
- return false;
- namcopy = savestring (name, namlen);
- if (type == NULL)
- type = debug_make_void_type (dhandle);
- if (pvar != NULL)
- pvar->kind = IEEE_GLOBAL;
- return debug_record_variable (dhandle, namcopy, type, DEBUG_GLOBAL, v);
-
- case 9:
- /* Variable lifetime information. */
- if (! ieee_read_number (info, pp, &v))
- return false;
-
- /* We have no way to record this information. FIXME. */
- return true;
-
- case 10:
- /* Locked register. The spec says that there are two required
- fields, but at least on occasion the MRI compiler only emits
- one. */
- if (! ieee_read_number (info, pp, &v)
- || ! ieee_read_optional_number (info, pp, &v2, &present))
- return false;
-
- /* I think this means a variable that is both in a register and
- a frame slot. We ignore the frame slot. FIXME. */
-
- namcopy = savestring (name, namlen);
- if (type == NULL)
- type = debug_make_void_type (dhandle);
- if (pvar != NULL)
- pvar->kind = IEEE_LOCAL;
- return debug_record_variable (dhandle, namcopy, type, DEBUG_REGISTER, v);
-
- case 11:
- /* Reserved for FORTRAN common. */
- ieee_error (info, atn_code_start, "unsupported ATN11");
-
- /* Return true to keep going. */
- return true;
-
- case 12:
- /* Based variable. */
- v3 = 0;
- v4 = 0x80;
- v5 = 0;
- if (! ieee_read_number (info, pp, &v)
- || ! ieee_read_number (info, pp, &v2)
- || ! ieee_read_optional_number (info, pp, &v3, &present))
- return false;
- if (present)
- {
- if (! ieee_read_optional_number (info, pp, &v4, &present))
- return false;
- if (present)
- {
- if (! ieee_read_optional_number (info, pp, &v5, &present))
- return false;
- }
- }
-
- /* We have no way to record this information. FIXME. */
-
- ieee_error (info, atn_code_start, "unsupported ATN12");
-
- /* Return true to keep going. */
- return true;
-
- case 16:
- /* Constant. The description of this that I have is ambiguous,
- so I'm not going to try to implement it. */
- if (! ieee_read_number (info, pp, &v)
- || ! ieee_read_optional_number (info, pp, &v2, &present))
- return false;
- if (present)
- {
- if (! ieee_read_optional_number (info, pp, &v2, &present))
- return false;
- if (present)
- {
- if (! ieee_read_optional_id (info, pp, &name, &namlen, &present))
- return false;
- }
- }
-
- if ((ieee_record_enum_type) **pp == ieee_e2_first_byte_enum)
- {
- if (! ieee_require_asn (info, pp, &v3))
- return false;
- }
-
- return true;
-
- case 19:
- /* Static variable from assembler. */
- v2 = 0;
- if (! ieee_read_number (info, pp, &v)
- || ! ieee_read_optional_number (info, pp, &v2, &present)
- || ! ieee_require_asn (info, pp, &v3))
- return false;
- namcopy = savestring (name, namlen);
- /* We don't really handle this correctly. FIXME. */
- return debug_record_variable (dhandle, namcopy,
- debug_make_void_type (dhandle),
- v2 != 0 ? DEBUG_GLOBAL : DEBUG_STATIC,
- v3);
-
- case 62:
- /* Procedure miscellaneous information. */
- case 63:
- /* Variable miscellaneous information. */
- case 64:
- /* Module miscellaneous information. */
- if (! ieee_read_number (info, pp, &v)
- || ! ieee_read_number (info, pp, &v2)
- || ! ieee_read_optional_id (info, pp, &name, &namlen, &present))
- return false;
-
- if (atn_code == 62 && v == 80)
- {
- if (present)
- {
- ieee_error (info, atn_code_start,
- "unexpected string in C++ misc");
- return false;
- }
- return ieee_read_cxx_misc (info, pp, v2);
- }
-
- /* We just ignore all of this stuff. FIXME. */
-
- for (; v2 > 0; --v2)
- {
- switch ((ieee_record_enum_type) **pp)
- {
- default:
- ieee_error (info, *pp, "bad misc record");
- return false;
-
- case ieee_at_record_enum:
- if (! ieee_require_atn65 (info, pp, &name, &namlen))
- return false;
- break;
-
- case ieee_e2_first_byte_enum:
- if (! ieee_require_asn (info, pp, &v3))
- return false;
- break;
- }
- }
-
- return true;
- }
-
- /*NOTREACHED*/
-}
-
-/* Handle C++ debugging miscellaneous records. This is called for
- procedure miscellaneous records of type 80. */
-
-static boolean
-ieee_read_cxx_misc (info, pp, count)
- struct ieee_info *info;
- const bfd_byte **pp;
- unsigned long count;
-{
- const bfd_byte *start;
- bfd_vma category;
-
- start = *pp;
-
- /* Get the category of C++ misc record. */
- if (! ieee_require_asn (info, pp, &category))
- return false;
- --count;
-
- switch (category)
- {
- default:
- ieee_error (info, start, "unrecognized C++ misc record");
- return false;
-
- case 'T':
- if (! ieee_read_cxx_class (info, pp, count))
- return false;
- break;
-
- case 'M':
- {
- bfd_vma flags;
- const char *name;
- unsigned long namlen;
-
- /* The IEEE spec indicates that the 'M' record only has a
- flags field. The MRI compiler also emits the name of the
- function. */
-
- if (! ieee_require_asn (info, pp, &flags))
- return false;
- if (*pp < info->pend
- && (ieee_record_enum_type) **pp == ieee_at_record_enum)
- {
- if (! ieee_require_atn65 (info, pp, &name, &namlen))
- return false;
- }
-
- /* This is emitted for method functions, but I don't think we
- care very much. It might help if it told us useful
- information like the class with which this function is
- associated, but it doesn't, so it isn't helpful. */
- }
- break;
-
- case 'B':
- if (! ieee_read_cxx_defaults (info, pp, count))
- return false;
- break;
-
- case 'z':
- {
- const char *name, *mangled, *class;
- unsigned long namlen, mangledlen, classlen;
- bfd_vma control;
-
- /* Pointer to member. */
-
- if (! ieee_require_atn65 (info, pp, &name, &namlen)
- || ! ieee_require_atn65 (info, pp, &mangled, &mangledlen)
- || ! ieee_require_atn65 (info, pp, &class, &classlen)
- || ! ieee_require_asn (info, pp, &control))
- return false;
-
- /* FIXME: We should now track down name and change its type. */
- }
- break;
-
- case 'R':
- if (! ieee_read_reference (info, pp))
- return false;
- break;
- }
-
- return true;
-}
-
-/* Read a C++ class definition. This is a pmisc type 80 record of
- category 'T'. */
-
-static boolean
-ieee_read_cxx_class (info, pp, count)
- struct ieee_info *info;
- const bfd_byte **pp;
- unsigned long count;
-{
- const bfd_byte *start;
- bfd_vma class;
- const char *tag;
- unsigned long taglen;
- struct ieee_tag *it;
- PTR dhandle;
- debug_field *fields;
- unsigned int field_count, field_alloc;
- debug_baseclass *baseclasses;
- unsigned int baseclasses_count, baseclasses_alloc;
- const debug_field *structfields;
- struct ieee_method
- {
- const char *name;
- unsigned long namlen;
- debug_method_variant *variants;
- unsigned count;
- unsigned int alloc;
- } *methods;
- unsigned int methods_count, methods_alloc;
- debug_type vptrbase;
- boolean ownvptr;
- debug_method *dmethods;
-
- start = *pp;
-
- if (! ieee_require_asn (info, pp, &class))
- return false;
- --count;
-
- if (! ieee_require_atn65 (info, pp, &tag, &taglen))
- return false;
- --count;
-
- /* Find the C struct with this name. */
- for (it = info->tags; it != NULL; it = it->next)
- if (it->name[0] == tag[0]
- && strncmp (it->name, tag, taglen) == 0
- && strlen (it->name) == taglen)
- break;
- if (it == NULL)
- {
- ieee_error (info, start, "undefined C++ object");
- return false;
- }
-
- dhandle = info->dhandle;
-
- fields = NULL;
- field_count = 0;
- field_alloc = 0;
- baseclasses = NULL;
- baseclasses_count = 0;
- baseclasses_alloc = 0;
- methods = NULL;
- methods_count = 0;
- methods_alloc = 0;
- vptrbase = DEBUG_TYPE_NULL;
- ownvptr = false;
-
- structfields = debug_get_fields (dhandle, it->type);
-
- while (count > 0)
- {
- bfd_vma id;
- const bfd_byte *spec_start;
-
- spec_start = *pp;
-
- if (! ieee_require_asn (info, pp, &id))
- return false;
- --count;
-
- switch (id)
- {
- default:
- ieee_error (info, spec_start, "unrecognized C++ object spec");
- return false;
-
- case 'b':
- {
- bfd_vma flags, cinline;
- const char *basename, *fieldname;
- unsigned long baselen, fieldlen;
- char *basecopy;
- debug_type basetype;
- bfd_vma bitpos;
- boolean virtualp;
- enum debug_visibility visibility;
- debug_baseclass baseclass;
-
- /* This represents a base or friend class. */
-
- if (! ieee_require_asn (info, pp, &flags)
- || ! ieee_require_atn65 (info, pp, &basename, &baselen)
- || ! ieee_require_asn (info, pp, &cinline)
- || ! ieee_require_atn65 (info, pp, &fieldname, &fieldlen))
- return false;
- count -= 4;
-
- /* We have no way of recording friend information, so we
- just ignore it. */
- if ((flags & BASEFLAGS_FRIEND) != 0)
- break;
-
- /* I assume that either all of the members of the
- baseclass are included in the object, starting at the
- beginning of the object, or that none of them are
- included. */
-
- if ((fieldlen == 0) == (cinline == 0))
- {
- ieee_error (info, start, "unsupported C++ object type");
- return false;
- }
-
- basecopy = savestring (basename, baselen);
- basetype = debug_find_tagged_type (dhandle, basecopy,
- DEBUG_KIND_ILLEGAL);
- free (basecopy);
- if (basetype == DEBUG_TYPE_NULL)
- {
- ieee_error (info, start, "C++ base class not defined");
- return false;
- }
-
- if (fieldlen == 0)
- bitpos = 0;
- else
- {
- const debug_field *pf;
-
- if (structfields == NULL)
- {
- ieee_error (info, start, "C++ object has no fields");
- return false;
- }
-
- for (pf = structfields; *pf != DEBUG_FIELD_NULL; pf++)
- {
- const char *fname;
-
- fname = debug_get_field_name (dhandle, *pf);
- if (fname == NULL)
- return false;
- if (fname[0] == fieldname[0]
- && strncmp (fname, fieldname, fieldlen) == 0
- && strlen (fname) == fieldlen)
- break;
- }
- if (*pf == DEBUG_FIELD_NULL)
- {
- ieee_error (info, start,
- "C++ base class not found in container");
- return false;
- }
-
- bitpos = debug_get_field_bitpos (dhandle, *pf);
- }
-
- if ((flags & BASEFLAGS_VIRTUAL) != 0)
- virtualp = true;
- else
- virtualp = false;
- if ((flags & BASEFLAGS_PRIVATE) != 0)
- visibility = DEBUG_VISIBILITY_PRIVATE;
- else
- visibility = DEBUG_VISIBILITY_PUBLIC;
-
- baseclass = debug_make_baseclass (dhandle, basetype, bitpos,
- virtualp, visibility);
- if (baseclass == DEBUG_BASECLASS_NULL)
- return false;
-
- if (baseclasses_count + 1 >= baseclasses_alloc)
- {
- baseclasses_alloc += 10;
- baseclasses = ((debug_baseclass *)
- xrealloc (baseclasses,
- (baseclasses_alloc
- * sizeof *baseclasses)));
- }
-
- baseclasses[baseclasses_count] = baseclass;
- ++baseclasses_count;
- baseclasses[baseclasses_count] = DEBUG_BASECLASS_NULL;
- }
- break;
-
- case 'd':
- {
- bfd_vma flags;
- const char *fieldname, *mangledname;
- unsigned long fieldlen, mangledlen;
- char *fieldcopy;
- boolean staticp;
- debug_type ftype;
- const debug_field *pf = NULL;
- enum debug_visibility visibility;
- debug_field field;
-
- /* This represents a data member. */
-
- if (! ieee_require_asn (info, pp, &flags)
- || ! ieee_require_atn65 (info, pp, &fieldname, &fieldlen)
- || ! ieee_require_atn65 (info, pp, &mangledname, &mangledlen))
- return false;
- count -= 3;
-
- fieldcopy = savestring (fieldname, fieldlen);
-
- staticp = (flags & CXXFLAGS_STATIC) != 0 ? true : false;
-
- if (staticp)
- {
- struct ieee_var *pv, *pvend;
-
- /* See if we can find a definition for this variable. */
- pv = info->vars.vars;
- pvend = pv + info->vars.alloc;
- for (; pv < pvend; pv++)
- if (pv->namlen == mangledlen
- && strncmp (pv->name, mangledname, mangledlen) == 0)
- break;
- if (pv < pvend)
- ftype = pv->type;
- else
- {
- /* This can happen if the variable is never used. */
- ftype = ieee_builtin_type (info, start,
- (unsigned int) builtin_void);
- }
- }
- else
- {
- unsigned int findx;
-
- if (structfields == NULL)
- {
- ieee_error (info, start, "C++ object has no fields");
- return false;
- }
-
- for (pf = structfields, findx = 0;
- *pf != DEBUG_FIELD_NULL;
- pf++, findx++)
- {
- const char *fname;
-
- fname = debug_get_field_name (dhandle, *pf);
- if (fname == NULL)
- return false;
- if (fname[0] == mangledname[0]
- && strncmp (fname, mangledname, mangledlen) == 0
- && strlen (fname) == mangledlen)
- break;
- }
- if (*pf == DEBUG_FIELD_NULL)
- {
- ieee_error (info, start,
- "C++ data member not found in container");
- return false;
- }
-
- ftype = debug_get_field_type (dhandle, *pf);
-
- if (debug_get_type_kind (dhandle, ftype) == DEBUG_KIND_POINTER)
- {
- /* We might need to convert this field into a
- reference type later on, so make it an indirect
- type. */
- if (it->fslots == NULL)
- {
- unsigned int fcnt;
- const debug_field *pfcnt;
-
- fcnt = 0;
- for (pfcnt = structfields;
- *pfcnt != DEBUG_FIELD_NULL;
- pfcnt++)
- ++fcnt;
- it->fslots = ((debug_type *)
- xmalloc (fcnt * sizeof *it->fslots));
- memset (it->fslots, 0,
- fcnt * sizeof *it->fslots);
- }
-
- if (ftype == DEBUG_TYPE_NULL)
- return false;
- it->fslots[findx] = ftype;
- ftype = debug_make_indirect_type (dhandle,
- it->fslots + findx,
- (const char *) NULL);
- }
- }
- if (ftype == DEBUG_TYPE_NULL)
- return false;
-
- switch (flags & CXXFLAGS_VISIBILITY)
- {
- default:
- ieee_error (info, start, "unknown C++ visibility");
- return false;
-
- case CXXFLAGS_VISIBILITY_PUBLIC:
- visibility = DEBUG_VISIBILITY_PUBLIC;
- break;
-
- case CXXFLAGS_VISIBILITY_PRIVATE:
- visibility = DEBUG_VISIBILITY_PRIVATE;
- break;
-
- case CXXFLAGS_VISIBILITY_PROTECTED:
- visibility = DEBUG_VISIBILITY_PROTECTED;
- break;
- }
-
- if (staticp)
- {
- char *mangledcopy;
-
- mangledcopy = savestring (mangledname, mangledlen);
-
- field = debug_make_static_member (dhandle, fieldcopy,
- ftype, mangledcopy,
- visibility);
- }
- else
- {
- bfd_vma bitpos, bitsize;
-
- bitpos = debug_get_field_bitpos (dhandle, *pf);
- bitsize = debug_get_field_bitsize (dhandle, *pf);
- if (bitpos == (bfd_vma) -1 || bitsize == (bfd_vma) -1)
- {
- ieee_error (info, start, "bad C++ field bit pos or size");
- return false;
- }
- field = debug_make_field (dhandle, fieldcopy, ftype, bitpos,
- bitsize, visibility);
- }
-
- if (field == DEBUG_FIELD_NULL)
- return false;
-
- if (field_count + 1 >= field_alloc)
- {
- field_alloc += 10;
- fields = ((debug_field *)
- xrealloc (fields, field_alloc * sizeof *fields));
- }
-
- fields[field_count] = field;
- ++field_count;
- fields[field_count] = DEBUG_FIELD_NULL;
- }
- break;
-
- case 'm':
- case 'v':
- {
- bfd_vma flags, voffset, control;
- const char *name, *mangled;
- unsigned long namlen, mangledlen;
- struct ieee_var *pv, *pvend;
- debug_type type;
- enum debug_visibility visibility;
- boolean constp, volatilep;
- char *mangledcopy;
- debug_method_variant mv;
- struct ieee_method *meth;
- unsigned int im;
-
- if (! ieee_require_asn (info, pp, &flags)
- || ! ieee_require_atn65 (info, pp, &name, &namlen)
- || ! ieee_require_atn65 (info, pp, &mangled, &mangledlen))
- return false;
- count -= 3;
- if (id != 'v')
- voffset = 0;
- else
- {
- if (! ieee_require_asn (info, pp, &voffset))
- return false;
- --count;
- }
- if (! ieee_require_asn (info, pp, &control))
- return false;
- --count;
-
- /* We just ignore the control information. */
-
- /* We have no way to represent friend information, so we
- just ignore it. */
- if ((flags & CXXFLAGS_FRIEND) != 0)
- break;
-
- /* We should already have seen a type for the function. */
- pv = info->vars.vars;
- pvend = pv + info->vars.alloc;
- for (; pv < pvend; pv++)
- if (pv->namlen == mangledlen
- && strncmp (pv->name, mangled, mangledlen) == 0)
- break;
-
- if (pv >= pvend)
- {
- /* We won't have type information for this function if
- it is not included in this file. We don't try to
- handle this case. FIXME. */
- type = (debug_make_function_type
- (dhandle,
- ieee_builtin_type (info, start,
- (unsigned int) builtin_void),
- (debug_type *) NULL,
- false));
- }
- else
- {
- debug_type return_type;
- const debug_type *arg_types;
- boolean varargs;
-
- if (debug_get_type_kind (dhandle, pv->type)
- != DEBUG_KIND_FUNCTION)
- {
- ieee_error (info, start,
- "bad type for C++ method function");
- return false;
- }
-
- return_type = debug_get_return_type (dhandle, pv->type);
- arg_types = debug_get_parameter_types (dhandle, pv->type,
- &varargs);
- if (return_type == DEBUG_TYPE_NULL || arg_types == NULL)
- {
- ieee_error (info, start,
- "no type information for C++ method function");
- return false;
- }
-
- type = debug_make_method_type (dhandle, return_type, it->type,
- (debug_type *) arg_types,
- varargs);
- }
- if (type == DEBUG_TYPE_NULL)
- return false;
-
- switch (flags & CXXFLAGS_VISIBILITY)
- {
- default:
- ieee_error (info, start, "unknown C++ visibility");
- return false;
-
- case CXXFLAGS_VISIBILITY_PUBLIC:
- visibility = DEBUG_VISIBILITY_PUBLIC;
- break;
-
- case CXXFLAGS_VISIBILITY_PRIVATE:
- visibility = DEBUG_VISIBILITY_PRIVATE;
- break;
-
- case CXXFLAGS_VISIBILITY_PROTECTED:
- visibility = DEBUG_VISIBILITY_PROTECTED;
- break;
- }
-
- constp = (flags & CXXFLAGS_CONST) != 0 ? true : false;
- volatilep = (flags & CXXFLAGS_VOLATILE) != 0 ? true : false;
-
- mangledcopy = savestring (mangled, mangledlen);
-
- if ((flags & CXXFLAGS_STATIC) != 0)
- {
- if (id == 'v')
- {
- ieee_error (info, start, "C++ static virtual method");
- return false;
- }
- mv = debug_make_static_method_variant (dhandle, mangledcopy,
- type, visibility,
- constp, volatilep);
- }
- else
- {
- debug_type vcontext;
-
- if (id != 'v')
- vcontext = DEBUG_TYPE_NULL;
- else
- {
- /* FIXME: How can we calculate this correctly? */
- vcontext = it->type;
- }
- mv = debug_make_method_variant (dhandle, mangledcopy, type,
- visibility, constp,
- volatilep, voffset,
- vcontext);
- }
- if (mv == DEBUG_METHOD_VARIANT_NULL)
- return false;
-
- for (meth = methods, im = 0; im < methods_count; meth++, im++)
- if (meth->namlen == namlen
- && strncmp (meth->name, name, namlen) == 0)
- break;
- if (im >= methods_count)
- {
- if (methods_count >= methods_alloc)
- {
- methods_alloc += 10;
- methods = ((struct ieee_method *)
- xrealloc (methods,
- methods_alloc * sizeof *methods));
- }
- methods[methods_count].name = name;
- methods[methods_count].namlen = namlen;
- methods[methods_count].variants = NULL;
- methods[methods_count].count = 0;
- methods[methods_count].alloc = 0;
- meth = methods + methods_count;
- ++methods_count;
- }
-
- if (meth->count + 1 >= meth->alloc)
- {
- meth->alloc += 10;
- meth->variants = ((debug_method_variant *)
- xrealloc (meth->variants,
- (meth->alloc
- * sizeof *meth->variants)));
- }
-
- meth->variants[meth->count] = mv;
- ++meth->count;
- meth->variants[meth->count] = DEBUG_METHOD_VARIANT_NULL;
- }
- break;
-
- case 'o':
- {
- bfd_vma spec;
-
- /* We have no way to store this information, so we just
- ignore it. */
- if (! ieee_require_asn (info, pp, &spec))
- return false;
- --count;
- if ((spec & 4) != 0)
- {
- const char *filename;
- unsigned long filenamlen;
- bfd_vma lineno;
-
- if (! ieee_require_atn65 (info, pp, &filename, &filenamlen)
- || ! ieee_require_asn (info, pp, &lineno))
- return false;
- count -= 2;
- }
- else if ((spec & 8) != 0)
- {
- const char *mangled;
- unsigned long mangledlen;
-
- if (! ieee_require_atn65 (info, pp, &mangled, &mangledlen))
- return false;
- --count;
- }
- else
- {
- ieee_error (info, start,
- "unrecognized C++ object overhead spec");
- return false;
- }
- }
- break;
-
- case 'z':
- {
- const char *vname, *basename;
- unsigned long vnamelen, baselen;
- bfd_vma vsize, control;
-
- /* A virtual table pointer. */
-
- if (! ieee_require_atn65 (info, pp, &vname, &vnamelen)
- || ! ieee_require_asn (info, pp, &vsize)
- || ! ieee_require_atn65 (info, pp, &basename, &baselen)
- || ! ieee_require_asn (info, pp, &control))
- return false;
- count -= 4;
-
- /* We just ignore the control number. We don't care what
- the virtual table name is. We have no way to store the
- virtual table size, and I don't think we care anyhow. */
-
- /* FIXME: We can't handle multiple virtual table pointers. */
-
- if (baselen == 0)
- ownvptr = true;
- else
- {
- char *basecopy;
-
- basecopy = savestring (basename, baselen);
- vptrbase = debug_find_tagged_type (dhandle, basecopy,
- DEBUG_KIND_ILLEGAL);
- free (basecopy);
- if (vptrbase == DEBUG_TYPE_NULL)
- {
- ieee_error (info, start, "undefined C++ vtable");
- return false;
- }
- }
- }
- break;
- }
- }
-
- /* Now that we have seen all the method variants, we can call
- debug_make_method for each one. */
-
- if (methods_count == 0)
- dmethods = NULL;
- else
- {
- unsigned int i;
-
- dmethods = ((debug_method *)
- xmalloc ((methods_count + 1) * sizeof *dmethods));
- for (i = 0; i < methods_count; i++)
- {
- char *namcopy;
-
- namcopy = savestring (methods[i].name, methods[i].namlen);
- dmethods[i] = debug_make_method (dhandle, namcopy,
- methods[i].variants);
- if (dmethods[i] == DEBUG_METHOD_NULL)
- return false;
- }
- dmethods[i] = DEBUG_METHOD_NULL;
- free (methods);
- }
-
- /* The struct type was created as an indirect type pointing at
- it->slot. We update it->slot to automatically update all
- references to this struct. */
- it->slot = debug_make_object_type (dhandle,
- class != 'u',
- debug_get_type_size (dhandle,
- it->slot),
- fields, baseclasses, dmethods,
- vptrbase, ownvptr);
- if (it->slot == DEBUG_TYPE_NULL)
- return false;
-
- return true;
-}
-
-/* Read C++ default argument value and reference type information. */
-
-static boolean
-ieee_read_cxx_defaults (info, pp, count)
- struct ieee_info *info;
- const bfd_byte **pp;
- unsigned long count;
-{
- const bfd_byte *start;
- const char *fnname;
- unsigned long fnlen;
- bfd_vma defcount;
-
- start = *pp;
-
- /* Giving the function name before the argument count is an addendum
- to the spec. The function name is demangled, though, so this
- record must always refer to the current function. */
-
- if (info->blockstack.bsp <= info->blockstack.stack
- || info->blockstack.bsp[-1].fnindx == (unsigned int) -1)
- {
- ieee_error (info, start, "C++ default values not in a function");
- return false;
- }
-
- if (! ieee_require_atn65 (info, pp, &fnname, &fnlen)
- || ! ieee_require_asn (info, pp, &defcount))
- return false;
- count -= 2;
-
- while (defcount-- > 0)
- {
- bfd_vma type, val;
- const char *strval;
- unsigned long strvallen;
-
- if (! ieee_require_asn (info, pp, &type))
- return false;
- --count;
-
- switch (type)
- {
- case 0:
- case 4:
- break;
-
- case 1:
- case 2:
- if (! ieee_require_asn (info, pp, &val))
- return false;
- --count;
- break;
-
- case 3:
- case 7:
- if (! ieee_require_atn65 (info, pp, &strval, &strvallen))
- return false;
- --count;
- break;
-
- default:
- ieee_error (info, start, "unrecognized C++ default type");
- return false;
- }
-
- /* We have no way to record the default argument values, so we
- just ignore them. FIXME. */
- }
-
- /* Any remaining arguments are indices of parameters that are really
- reference type. */
- if (count > 0)
- {
- PTR dhandle;
- debug_type *arg_slots;
-
- dhandle = info->dhandle;
- arg_slots = info->types.types[info->blockstack.bsp[-1].fnindx].arg_slots;
- while (count-- > 0)
- {
- bfd_vma indx;
- debug_type target;
-
- if (! ieee_require_asn (info, pp, &indx))
- return false;
- /* The index is 1 based. */
- --indx;
- if (arg_slots == NULL
- || arg_slots[indx] == DEBUG_TYPE_NULL
- || (debug_get_type_kind (dhandle, arg_slots[indx])
- != DEBUG_KIND_POINTER))
- {
- ieee_error (info, start, "reference parameter is not a pointer");
- return false;
- }
-
- target = debug_get_target_type (dhandle, arg_slots[indx]);
- arg_slots[indx] = debug_make_reference_type (dhandle, target);
- if (arg_slots[indx] == DEBUG_TYPE_NULL)
- return false;
- }
- }
-
- return true;
-}
-
-/* Read a C++ reference definition. */
-
-static boolean
-ieee_read_reference (info, pp)
- struct ieee_info *info;
- const bfd_byte **pp;
-{
- const bfd_byte *start;
- bfd_vma flags;
- const char *class, *name;
- unsigned long classlen, namlen;
- debug_type *pslot;
- debug_type target;
-
- start = *pp;
-
- if (! ieee_require_asn (info, pp, &flags))
- return false;
-
- /* Giving the class name before the member name is in an addendum to
- the spec. */
- if (flags == 3)
- {
- if (! ieee_require_atn65 (info, pp, &class, &classlen))
- return false;
- }
-
- if (! ieee_require_atn65 (info, pp, &name, &namlen))
- return false;
-
- pslot = NULL;
- if (flags != 3)
- {
- int pass;
-
- /* We search from the last variable indices to the first in
- hopes of finding local variables correctly. We search the
- local variables on the first pass, and the global variables
- on the second. FIXME: This probably won't work in all cases.
- On the other hand, I don't know what will. */
- for (pass = 0; pass < 2; pass++)
- {
- struct ieee_vars *vars;
- int i;
- struct ieee_var *pv = NULL;
-
- if (pass == 0)
- vars = &info->vars;
- else
- {
- vars = info->global_vars;
- if (vars == NULL)
- break;
- }
-
- for (i = (int) vars->alloc - 1; i >= 0; i--)
- {
- boolean found;
-
- pv = vars->vars + i;
-
- if (pv->pslot == NULL
- || pv->namlen != namlen
- || strncmp (pv->name, name, namlen) != 0)
- continue;
-
- found = false;
- switch (flags)
- {
- default:
- ieee_error (info, start,
- "unrecognized C++ reference type");
- return false;
-
- case 0:
- /* Global variable or function. */
- if (pv->kind == IEEE_GLOBAL
- || pv->kind == IEEE_EXTERNAL
- || pv->kind == IEEE_FUNCTION)
- found = true;
- break;
-
- case 1:
- /* Global static variable or function. */
- if (pv->kind == IEEE_STATIC
- || pv->kind == IEEE_FUNCTION)
- found = true;
- break;
-
- case 2:
- /* Local variable. */
- if (pv->kind == IEEE_LOCAL)
- found = true;
- break;
- }
-
- if (found)
- break;
- }
-
- if (i >= 0)
- {
- pslot = pv->pslot;
- break;
- }
- }
- }
- else
- {
- struct ieee_tag *it;
-
- for (it = info->tags; it != NULL; it = it->next)
- {
- if (it->name[0] == class[0]
- && strncmp (it->name, class, classlen) == 0
- && strlen (it->name) == classlen)
- {
- if (it->fslots != NULL)
- {
- const debug_field *pf;
- unsigned int findx;
-
- pf = debug_get_fields (info->dhandle, it->type);
- if (pf == NULL)
- {
- ieee_error (info, start,
- "C++ reference in class with no fields");
- return false;
- }
-
- for (findx = 0; *pf != DEBUG_FIELD_NULL; pf++, findx++)
- {
- const char *fname;
-
- fname = debug_get_field_name (info->dhandle, *pf);
- if (fname == NULL)
- return false;
- if (strncmp (fname, name, namlen) == 0
- && strlen (fname) == namlen)
- {
- pslot = it->fslots + findx;
- break;
- }
- }
- }
-
- break;
- }
- }
- }
-
- if (pslot == NULL)
- {
- ieee_error (info, start, "C++ reference not found");
- return false;
- }
-
- /* We allocated the type of the object as an indirect type pointing
- to *pslot, which we can now update to be a reference type. */
- if (debug_get_type_kind (info->dhandle, *pslot) != DEBUG_KIND_POINTER)
- {
- ieee_error (info, start, "C++ reference is not pointer");
- return false;
- }
-
- target = debug_get_target_type (info->dhandle, *pslot);
- *pslot = debug_make_reference_type (info->dhandle, target);
- if (*pslot == DEBUG_TYPE_NULL)
- return false;
-
- return true;
-}
-
-/* Require an ASN record. */
-
-static boolean
-ieee_require_asn (info, pp, pv)
- struct ieee_info *info;
- const bfd_byte **pp;
- bfd_vma *pv;
-{
- const bfd_byte *start;
- ieee_record_enum_type c;
- bfd_vma varindx;
-
- start = *pp;
-
- c = (ieee_record_enum_type) **pp;
- if (c != ieee_e2_first_byte_enum)
- {
- ieee_error (info, start, "missing required ASN");
- return false;
- }
- ++*pp;
-
- c = (ieee_record_enum_type) (((unsigned int) c << 8) | **pp);
- if (c != ieee_asn_record_enum)
- {
- ieee_error (info, start, "missing required ASN");
- return false;
- }
- ++*pp;
-
- /* Just ignore the variable index. */
- if (! ieee_read_number (info, pp, &varindx))
- return false;
-
- return ieee_read_expression (info, pp, pv);
-}
-
-/* Require an ATN65 record. */
-
-static boolean
-ieee_require_atn65 (info, pp, pname, pnamlen)
- struct ieee_info *info;
- const bfd_byte **pp;
- const char **pname;
- unsigned long *pnamlen;
-{
- const bfd_byte *start;
- ieee_record_enum_type c;
- bfd_vma name_indx, type_indx, atn_code;
-
- start = *pp;
-
- c = (ieee_record_enum_type) **pp;
- if (c != ieee_at_record_enum)
- {
- ieee_error (info, start, "missing required ATN65");
- return false;
- }
- ++*pp;
-
- c = (ieee_record_enum_type) (((unsigned int) c << 8) | **pp);
- if (c != ieee_atn_record_enum)
- {
- ieee_error (info, start, "missing required ATN65");
- return false;
- }
- ++*pp;
-
- if (! ieee_read_number (info, pp, &name_indx)
- || ! ieee_read_number (info, pp, &type_indx)
- || ! ieee_read_number (info, pp, &atn_code))
- return false;
-
- /* Just ignore name_indx. */
-
- if (type_indx != 0 || atn_code != 65)
- {
- ieee_error (info, start, "bad ATN65 record");
- return false;
- }
-
- return ieee_read_id (info, pp, pname, pnamlen);
-}
-
-/* Convert a register number in IEEE debugging information into a
- generic register number. */
-
-static int
-ieee_regno_to_genreg (abfd, r)
- bfd *abfd;
- int r;
-{
- switch (bfd_get_arch (abfd))
- {
- case bfd_arch_m68k:
- /* For some reasons stabs adds 2 to the floating point register
- numbers. */
- if (r >= 16)
- r += 2;
- break;
-
- case bfd_arch_i960:
- /* Stabs uses 0 to 15 for r0 to r15, 16 to 31 for g0 to g15, and
- 32 to 35 for fp0 to fp3. */
- --r;
- break;
-
- default:
- break;
- }
-
- return r;
-}
-
-/* Convert a generic register number to an IEEE specific one. */
-
-static int
-ieee_genreg_to_regno (abfd, r)
- bfd *abfd;
- int r;
-{
- switch (bfd_get_arch (abfd))
- {
- case bfd_arch_m68k:
- /* For some reason stabs add 2 to the floating point register
- numbers. */
- if (r >= 18)
- r -= 2;
- break;
-
- case bfd_arch_i960:
- /* Stabs uses 0 to 15 for r0 to r15, 16 to 31 for g0 to g15, and
- 32 to 35 for fp0 to fp3. */
- ++r;
- break;
-
- default:
- break;
- }
-
- return r;
-}
-
-/* These routines build IEEE debugging information out of the generic
- debugging information. */
-
-/* We build the IEEE debugging information byte by byte. Rather than
- waste time copying data around, we use a linked list of buffers to
- hold the data. */
-
-#define IEEE_BUFSIZE (490)
-
-struct ieee_buf
-{
- /* Next buffer. */
- struct ieee_buf *next;
- /* Number of data bytes in this buffer. */
- unsigned int c;
- /* Bytes. */
- bfd_byte buf[IEEE_BUFSIZE];
-};
-
-/* A list of buffers. */
-
-struct ieee_buflist
-{
- /* Head of list. */
- struct ieee_buf *head;
- /* Tail--last buffer on list. */
- struct ieee_buf *tail;
-};
-
-/* In order to generate the BB11 blocks required by the HP emulator,
- we keep track of ranges of addresses which correspond to a given
- compilation unit. */
-
-struct ieee_range
-{
- /* Next range. */
- struct ieee_range *next;
- /* Low address. */
- bfd_vma low;
- /* High address. */
- bfd_vma high;
-};
-
-/* This structure holds information for a class on the type stack. */
-
-struct ieee_type_class
-{
- /* The name index in the debugging information. */
- unsigned int indx;
- /* The pmisc records for the class. */
- struct ieee_buflist pmiscbuf;
- /* The number of pmisc records. */
- unsigned int pmisccount;
- /* The name of the class holding the virtual table, if not this
- class. */
- const char *vclass;
- /* Whether this class holds its own virtual table. */
- boolean ownvptr;
- /* The largest virtual table offset seen so far. */
- bfd_vma voffset;
- /* The current method. */
- const char *method;
- /* Additional pmisc records used to record fields of reference type. */
- struct ieee_buflist refs;
-};
-
-/* This is how we store types for the writing routines. Most types
- are simply represented by a type index. */
-
-struct ieee_write_type
-{
- /* Type index. */
- unsigned int indx;
- /* The size of the type, if known. */
- unsigned int size;
- /* The name of the type, if any. */
- const char *name;
- /* If this is a function or method type, we build the type here, and
- only add it to the output buffers if we need it. */
- struct ieee_buflist fndef;
- /* If this is a struct, this is where the struct definition is
- built. */
- struct ieee_buflist strdef;
- /* If this is a class, this is where the class information is built. */
- struct ieee_type_class *classdef;
- /* Whether the type is unsigned. */
- unsigned int unsignedp : 1;
- /* Whether this is a reference type. */
- unsigned int referencep : 1;
- /* Whether this is in the local type block. */
- unsigned int localp : 1;
- /* Whether this is a duplicate struct definition which we are
- ignoring. */
- unsigned int ignorep : 1;
-};
-
-/* This is the type stack used by the debug writing routines. FIXME:
- We could generate more efficient output if we remembered when we
- have output a particular type before. */
-
-struct ieee_type_stack
-{
- /* Next entry on stack. */
- struct ieee_type_stack *next;
- /* Type information. */
- struct ieee_write_type type;
-};
-
-/* This is a list of associations between a name and some types.
- These are used for typedefs and tags. */
-
-struct ieee_name_type
-{
- /* Next type for this name. */
- struct ieee_name_type *next;
- /* ID number. For a typedef, this is the index of the type to which
- this name is typedefed. */
- unsigned int id;
- /* Type. */
- struct ieee_write_type type;
- /* If this is a tag which has not yet been defined, this is the
- kind. If the tag has been defined, this is DEBUG_KIND_ILLEGAL. */
- enum debug_type_kind kind;
-};
-
-/* We use a hash table to associate names and types. */
-
-struct ieee_name_type_hash_table
-{
- struct bfd_hash_table root;
-};
-
-struct ieee_name_type_hash_entry
-{
- struct bfd_hash_entry root;
- /* Information for this name. */
- struct ieee_name_type *types;
-};
-
-/* This is a list of enums. */
-
-struct ieee_defined_enum
-{
- /* Next enum. */
- struct ieee_defined_enum *next;
- /* Type index. */
- unsigned int indx;
- /* Whether this enum has been defined. */
- boolean defined;
- /* Tag. */
- const char *tag;
- /* Names. */
- const char **names;
- /* Values. */
- bfd_signed_vma *vals;
-};
-
-/* We keep a list of modified versions of types, so that we don't
- output them more than once. */
-
-struct ieee_modified_type
-{
- /* Pointer to this type. */
- unsigned int pointer;
- /* Function with unknown arguments returning this type. */
- unsigned int function;
- /* Const version of this type. */
- unsigned int const_qualified;
- /* Volatile version of this type. */
- unsigned int volatile_qualified;
- /* List of arrays of this type of various bounds. */
- struct ieee_modified_array_type *arrays;
-};
-
-/* A list of arrays bounds. */
-
-struct ieee_modified_array_type
-{
- /* Next array bounds. */
- struct ieee_modified_array_type *next;
- /* Type index with these bounds. */
- unsigned int indx;
- /* Low bound. */
- bfd_signed_vma low;
- /* High bound. */
- bfd_signed_vma high;
-};
-
-/* This is a list of pending function parameter information. We don't
- output them until we see the first block. */
-
-struct ieee_pending_parm
-{
- /* Next pending parameter. */
- struct ieee_pending_parm *next;
- /* Name. */
- const char *name;
- /* Type index. */
- unsigned int type;
- /* Whether the type is a reference. */
- boolean referencep;
- /* Kind. */
- enum debug_parm_kind kind;
- /* Value. */
- bfd_vma val;
-};
-
-/* This is the handle passed down by debug_write. */
-
-struct ieee_handle
-{
- /* BFD we are writing to. */
- bfd *abfd;
- /* Whether we got an error in a subroutine called via traverse or
- map_over_sections. */
- boolean error;
- /* Current data buffer list. */
- struct ieee_buflist *current;
- /* Current data buffer. */
- struct ieee_buf *curbuf;
- /* Filename of current compilation unit. */
- const char *filename;
- /* Module name of current compilation unit. */
- const char *modname;
- /* List of buffer for global types. */
- struct ieee_buflist global_types;
- /* List of finished data buffers. */
- struct ieee_buflist data;
- /* List of buffers for typedefs in the current compilation unit. */
- struct ieee_buflist types;
- /* List of buffers for variables and functions in the current
- compilation unit. */
- struct ieee_buflist vars;
- /* List of buffers for C++ class definitions in the current
- compilation unit. */
- struct ieee_buflist cxx;
- /* List of buffers for line numbers in the current compilation unit. */
- struct ieee_buflist linenos;
- /* Ranges for the current compilation unit. */
- struct ieee_range *ranges;
- /* Ranges for all debugging information. */
- struct ieee_range *global_ranges;
- /* Nested pending ranges. */
- struct ieee_range *pending_ranges;
- /* Type stack. */
- struct ieee_type_stack *type_stack;
- /* Next unallocated type index. */
- unsigned int type_indx;
- /* Next unallocated name index. */
- unsigned int name_indx;
- /* Typedefs. */
- struct ieee_name_type_hash_table typedefs;
- /* Tags. */
- struct ieee_name_type_hash_table tags;
- /* Enums. */
- struct ieee_defined_enum *enums;
- /* Modified versions of types. */
- struct ieee_modified_type *modified;
- /* Number of entries allocated in modified. */
- unsigned int modified_alloc;
- /* 4 byte complex type. */
- unsigned int complex_float_index;
- /* 8 byte complex type. */
- unsigned int complex_double_index;
- /* The depth of block nesting. This is 0 outside a function, and 1
- just after start_function is called. */
- unsigned int block_depth;
- /* The name of the current function. */
- const char *fnname;
- /* List of buffers for the type of the function we are currently
- writing out. */
- struct ieee_buflist fntype;
- /* List of buffers for the parameters of the function we are
- currently writing out. */
- struct ieee_buflist fnargs;
- /* Number of arguments written to fnargs. */
- unsigned int fnargcount;
- /* Pending function parameters. */
- struct ieee_pending_parm *pending_parms;
- /* Current line number filename. */
- const char *lineno_filename;
- /* Line number name index. */
- unsigned int lineno_name_indx;
- /* Filename of pending line number. */
- const char *pending_lineno_filename;
- /* Pending line number. */
- unsigned long pending_lineno;
- /* Address of pending line number. */
- bfd_vma pending_lineno_addr;
- /* Highest address seen at end of procedure. */
- bfd_vma highaddr;
-};
-
-static boolean ieee_init_buffer
- PARAMS ((struct ieee_handle *, struct ieee_buflist *));
-static boolean ieee_change_buffer
- PARAMS ((struct ieee_handle *, struct ieee_buflist *));
-static boolean ieee_append_buffer
- PARAMS ((struct ieee_handle *, struct ieee_buflist *,
- struct ieee_buflist *));
-static boolean ieee_real_write_byte PARAMS ((struct ieee_handle *, int));
-static boolean ieee_write_2bytes PARAMS ((struct ieee_handle *, int));
-static boolean ieee_write_number PARAMS ((struct ieee_handle *, bfd_vma));
-static boolean ieee_write_id PARAMS ((struct ieee_handle *, const char *));
-static boolean ieee_write_asn
- PARAMS ((struct ieee_handle *, unsigned int, bfd_vma));
-static boolean ieee_write_atn65
- PARAMS ((struct ieee_handle *, unsigned int, const char *));
-static boolean ieee_push_type
- PARAMS ((struct ieee_handle *, unsigned int, unsigned int, boolean,
- boolean));
-static unsigned int ieee_pop_type PARAMS ((struct ieee_handle *));
-static void ieee_pop_unused_type PARAMS ((struct ieee_handle *));
-static unsigned int ieee_pop_type_used
- PARAMS ((struct ieee_handle *, boolean));
-static boolean ieee_add_range
- PARAMS ((struct ieee_handle *, boolean, bfd_vma, bfd_vma));
-static boolean ieee_start_range PARAMS ((struct ieee_handle *, bfd_vma));
-static boolean ieee_end_range PARAMS ((struct ieee_handle *, bfd_vma));
-static boolean ieee_define_type
- PARAMS ((struct ieee_handle *, unsigned int, boolean, boolean));
-static boolean ieee_define_named_type
- PARAMS ((struct ieee_handle *, const char *, unsigned int, unsigned int,
- boolean, boolean, struct ieee_buflist *));
-static struct ieee_modified_type *ieee_get_modified_info
- PARAMS ((struct ieee_handle *, unsigned int));
-static struct bfd_hash_entry *ieee_name_type_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static boolean ieee_write_undefined_tag
- PARAMS ((struct ieee_name_type_hash_entry *, PTR));
-static boolean ieee_finish_compilation_unit PARAMS ((struct ieee_handle *));
-static void ieee_add_bb11_blocks PARAMS ((bfd *, asection *, PTR));
-static boolean ieee_add_bb11
- PARAMS ((struct ieee_handle *, asection *, bfd_vma, bfd_vma));
-static boolean ieee_output_pending_parms PARAMS ((struct ieee_handle *));
-static unsigned int ieee_vis_to_flags PARAMS ((enum debug_visibility));
-static boolean ieee_class_method_var
- PARAMS ((struct ieee_handle *, const char *, enum debug_visibility, boolean,
- boolean, boolean, bfd_vma, boolean));
-
-static boolean ieee_start_compilation_unit PARAMS ((PTR, const char *));
-static boolean ieee_start_source PARAMS ((PTR, const char *));
-static boolean ieee_empty_type PARAMS ((PTR));
-static boolean ieee_void_type PARAMS ((PTR));
-static boolean ieee_int_type PARAMS ((PTR, unsigned int, boolean));
-static boolean ieee_float_type PARAMS ((PTR, unsigned int));
-static boolean ieee_complex_type PARAMS ((PTR, unsigned int));
-static boolean ieee_bool_type PARAMS ((PTR, unsigned int));
-static boolean ieee_enum_type
- PARAMS ((PTR, const char *, const char **, bfd_signed_vma *));
-static boolean ieee_pointer_type PARAMS ((PTR));
-static boolean ieee_function_type PARAMS ((PTR, int, boolean));
-static boolean ieee_reference_type PARAMS ((PTR));
-static boolean ieee_range_type PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma));
-static boolean ieee_array_type
- PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma, boolean));
-static boolean ieee_set_type PARAMS ((PTR, boolean));
-static boolean ieee_offset_type PARAMS ((PTR));
-static boolean ieee_method_type PARAMS ((PTR, boolean, int, boolean));
-static boolean ieee_const_type PARAMS ((PTR));
-static boolean ieee_volatile_type PARAMS ((PTR));
-static boolean ieee_start_struct_type
- PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int));
-static boolean ieee_struct_field
- PARAMS ((PTR, const char *, bfd_vma, bfd_vma, enum debug_visibility));
-static boolean ieee_end_struct_type PARAMS ((PTR));
-static boolean ieee_start_class_type
- PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int, boolean,
- boolean));
-static boolean ieee_class_static_member
- PARAMS ((PTR, const char *, const char *, enum debug_visibility));
-static boolean ieee_class_baseclass
- PARAMS ((PTR, bfd_vma, boolean, enum debug_visibility));
-static boolean ieee_class_start_method PARAMS ((PTR, const char *));
-static boolean ieee_class_method_variant
- PARAMS ((PTR, const char *, enum debug_visibility, boolean, boolean,
- bfd_vma, boolean));
-static boolean ieee_class_static_method_variant
- PARAMS ((PTR, const char *, enum debug_visibility, boolean, boolean));
-static boolean ieee_class_end_method PARAMS ((PTR));
-static boolean ieee_end_class_type PARAMS ((PTR));
-static boolean ieee_typedef_type PARAMS ((PTR, const char *));
-static boolean ieee_tag_type
- PARAMS ((PTR, const char *, unsigned int, enum debug_type_kind));
-static boolean ieee_typdef PARAMS ((PTR, const char *));
-static boolean ieee_tag PARAMS ((PTR, const char *));
-static boolean ieee_int_constant PARAMS ((PTR, const char *, bfd_vma));
-static boolean ieee_float_constant PARAMS ((PTR, const char *, double));
-static boolean ieee_typed_constant PARAMS ((PTR, const char *, bfd_vma));
-static boolean ieee_variable
- PARAMS ((PTR, const char *, enum debug_var_kind, bfd_vma));
-static boolean ieee_start_function PARAMS ((PTR, const char *, boolean));
-static boolean ieee_function_parameter
- PARAMS ((PTR, const char *, enum debug_parm_kind, bfd_vma));
-static boolean ieee_start_block PARAMS ((PTR, bfd_vma));
-static boolean ieee_end_block PARAMS ((PTR, bfd_vma));
-static boolean ieee_end_function PARAMS ((PTR));
-static boolean ieee_lineno
- PARAMS ((PTR, const char *, unsigned long, bfd_vma));
-
-static const struct debug_write_fns ieee_fns =
-{
- ieee_start_compilation_unit,
- ieee_start_source,
- ieee_empty_type,
- ieee_void_type,
- ieee_int_type,
- ieee_float_type,
- ieee_complex_type,
- ieee_bool_type,
- ieee_enum_type,
- ieee_pointer_type,
- ieee_function_type,
- ieee_reference_type,
- ieee_range_type,
- ieee_array_type,
- ieee_set_type,
- ieee_offset_type,
- ieee_method_type,
- ieee_const_type,
- ieee_volatile_type,
- ieee_start_struct_type,
- ieee_struct_field,
- ieee_end_struct_type,
- ieee_start_class_type,
- ieee_class_static_member,
- ieee_class_baseclass,
- ieee_class_start_method,
- ieee_class_method_variant,
- ieee_class_static_method_variant,
- ieee_class_end_method,
- ieee_end_class_type,
- ieee_typedef_type,
- ieee_tag_type,
- ieee_typdef,
- ieee_tag,
- ieee_int_constant,
- ieee_float_constant,
- ieee_typed_constant,
- ieee_variable,
- ieee_start_function,
- ieee_function_parameter,
- ieee_start_block,
- ieee_end_block,
- ieee_end_function,
- ieee_lineno
-};
-
-/* Initialize a buffer to be empty. */
-
-/*ARGSUSED*/
-static boolean
-ieee_init_buffer (info, buflist)
- struct ieee_handle *info;
- struct ieee_buflist *buflist;
-{
- buflist->head = NULL;
- buflist->tail = NULL;
- return true;
-}
-
-/* See whether a buffer list has any data. */
-
-#define ieee_buffer_emptyp(buflist) ((buflist)->head == NULL)
-
-/* Change the current buffer to a specified buffer chain. */
-
-static boolean
-ieee_change_buffer (info, buflist)
- struct ieee_handle *info;
- struct ieee_buflist *buflist;
-{
- if (buflist->head == NULL)
- {
- struct ieee_buf *buf;
-
- buf = (struct ieee_buf *) xmalloc (sizeof *buf);
- buf->next = NULL;
- buf->c = 0;
- buflist->head = buf;
- buflist->tail = buf;
- }
-
- info->current = buflist;
- info->curbuf = buflist->tail;
-
- return true;
-}
-
-/* Append a buffer chain. */
-
-/*ARGSUSED*/
-static boolean
-ieee_append_buffer (info, mainbuf, newbuf)
- struct ieee_handle *info;
- struct ieee_buflist *mainbuf;
- struct ieee_buflist *newbuf;
-{
- if (newbuf->head != NULL)
- {
- if (mainbuf->head == NULL)
- mainbuf->head = newbuf->head;
- else
- mainbuf->tail->next = newbuf->head;
- mainbuf->tail = newbuf->tail;
- }
- return true;
-}
-
-/* Write a byte into the buffer. We use a macro for speed and a
- function for the complex cases. */
-
-#define ieee_write_byte(info, b) \
- ((info)->curbuf->c < IEEE_BUFSIZE \
- ? ((info)->curbuf->buf[(info)->curbuf->c++] = (b), true) \
- : ieee_real_write_byte ((info), (b)))
-
-static boolean
-ieee_real_write_byte (info, b)
- struct ieee_handle *info;
- int b;
-{
- if (info->curbuf->c >= IEEE_BUFSIZE)
- {
- struct ieee_buf *n;
-
- n = (struct ieee_buf *) xmalloc (sizeof *n);
- n->next = NULL;
- n->c = 0;
- if (info->current->head == NULL)
- info->current->head = n;
- else
- info->current->tail->next = n;
- info->current->tail = n;
- info->curbuf = n;
- }
-
- info->curbuf->buf[info->curbuf->c] = b;
- ++info->curbuf->c;
-
- return true;
-}
-
-/* Write out two bytes. */
-
-static boolean
-ieee_write_2bytes (info, i)
- struct ieee_handle *info;
- int i;
-{
- return (ieee_write_byte (info, i >> 8)
- && ieee_write_byte (info, i & 0xff));
-}
-
-/* Write out an integer. */
-
-static boolean
-ieee_write_number (info, v)
- struct ieee_handle *info;
- bfd_vma v;
-{
- bfd_vma t;
- bfd_byte ab[20];
- bfd_byte *p;
- unsigned int c;
-
- if (v <= (bfd_vma) ieee_number_end_enum)
- return ieee_write_byte (info, (int) v);
-
- t = v;
- p = ab + sizeof ab;
- while (t != 0)
- {
- *--p = t & 0xff;
- t >>= 8;
- }
- c = (ab + 20) - p;
-
- if (c > (unsigned int) (ieee_number_repeat_end_enum
- - ieee_number_repeat_start_enum))
- {
- fprintf (stderr, "IEEE numeric overflow: 0x");
- fprintf_vma (stderr, v);
- fprintf (stderr, "\n");
- return false;
- }
-
- if (! ieee_write_byte (info, (int) ieee_number_repeat_start_enum + c))
- return false;
- for (; c > 0; --c, ++p)
- {
- if (! ieee_write_byte (info, *p))
- return false;
- }
-
- return true;
-}
-
-/* Write out a string. */
-
-static boolean
-ieee_write_id (info, s)
- struct ieee_handle *info;
- const char *s;
-{
- unsigned int len;
-
- len = strlen (s);
- if (len <= 0x7f)
- {
- if (! ieee_write_byte (info, len))
- return false;
- }
- else if (len <= 0xff)
- {
- if (! ieee_write_byte (info, (int) ieee_extension_length_1_enum)
- || ! ieee_write_byte (info, len))
- return false;
- }
- else if (len <= 0xffff)
- {
- if (! ieee_write_byte (info, (int) ieee_extension_length_2_enum)
- || ! ieee_write_2bytes (info, len))
- return false;
- }
- else
- {
- fprintf (stderr, "IEEE string length overflow: %u\n", len);
- return false;
- }
-
- for (; *s != '\0'; s++)
- if (! ieee_write_byte (info, *s))
- return false;
-
- return true;
-}
-
-/* Write out an ASN record. */
-
-static boolean
-ieee_write_asn (info, indx, val)
- struct ieee_handle *info;
- unsigned int indx;
- bfd_vma val;
-{
- return (ieee_write_2bytes (info, (int) ieee_asn_record_enum)
- && ieee_write_number (info, indx)
- && ieee_write_number (info, val));
-}
-
-/* Write out an ATN65 record. */
-
-static boolean
-ieee_write_atn65 (info, indx, s)
- struct ieee_handle *info;
- unsigned int indx;
- const char *s;
-{
- return (ieee_write_2bytes (info, (int) ieee_atn_record_enum)
- && ieee_write_number (info, indx)
- && ieee_write_number (info, 0)
- && ieee_write_number (info, 65)
- && ieee_write_id (info, s));
-}
-
-/* Push a type index onto the type stack. */
-
-static boolean
-ieee_push_type (info, indx, size, unsignedp, localp)
- struct ieee_handle *info;
- unsigned int indx;
- unsigned int size;
- boolean unsignedp;
- boolean localp;
-{
- struct ieee_type_stack *ts;
-
- ts = (struct ieee_type_stack *) xmalloc (sizeof *ts);
- memset (ts, 0, sizeof *ts);
-
- ts->type.indx = indx;
- ts->type.size = size;
- ts->type.unsignedp = unsignedp;
- ts->type.localp = localp;
-
- ts->next = info->type_stack;
- info->type_stack = ts;
-
- return true;
-}
-
-/* Pop a type index off the type stack. */
-
-static unsigned int
-ieee_pop_type (info)
- struct ieee_handle *info;
-{
- return ieee_pop_type_used (info, true);
-}
-
-/* Pop an unused type index off the type stack. */
-
-static void
-ieee_pop_unused_type (info)
- struct ieee_handle *info;
-{
- (void) ieee_pop_type_used (info, false);
-}
-
-/* Pop a used or unused type index off the type stack. */
-
-static unsigned int
-ieee_pop_type_used (info, used)
- struct ieee_handle *info;
- boolean used;
-{
- struct ieee_type_stack *ts;
- unsigned int ret;
-
- ts = info->type_stack;
- assert (ts != NULL);
-
- /* If this is a function type, and we need it, we need to append the
- actual definition to the typedef block now. */
- if (used && ! ieee_buffer_emptyp (&ts->type.fndef))
- {
- struct ieee_buflist *buflist;
-
- if (ts->type.localp)
- {
- /* Make sure we have started the types block. */
- if (ieee_buffer_emptyp (&info->types))
- {
- if (! ieee_change_buffer (info, &info->types)
- || ! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 1)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, info->modname))
- return false;
- }
- buflist = &info->types;
- }
- else
- {
- /* Make sure we started the global type block. */
- if (ieee_buffer_emptyp (&info->global_types))
- {
- if (! ieee_change_buffer (info, &info->global_types)
- || ! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 2)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, ""))
- return false;
- }
- buflist = &info->global_types;
- }
-
- if (! ieee_append_buffer (info, buflist, &ts->type.fndef))
- return false;
- }
-
- ret = ts->type.indx;
- info->type_stack = ts->next;
- free (ts);
- return ret;
-}
-
-/* Add a range of bytes included in the current compilation unit. */
-
-static boolean
-ieee_add_range (info, global, low, high)
- struct ieee_handle *info;
- boolean global;
- bfd_vma low;
- bfd_vma high;
-{
- struct ieee_range **plist, *r, **pr;
-
- if (low == (bfd_vma) -1 || high == (bfd_vma) -1 || low == high)
- return true;
-
- if (global)
- plist = &info->global_ranges;
- else
- plist = &info->ranges;
-
- for (r = *plist; r != NULL; r = r->next)
- {
- if (high >= r->low && low <= r->high)
- {
- /* The new range overlaps r. */
- if (low < r->low)
- r->low = low;
- if (high > r->high)
- r->high = high;
- pr = &r->next;
- while (*pr != NULL && (*pr)->low <= r->high)
- {
- struct ieee_range *n;
-
- if ((*pr)->high > r->high)
- r->high = (*pr)->high;
- n = (*pr)->next;
- free (*pr);
- *pr = n;
- }
- return true;
- }
- }
-
- r = (struct ieee_range *) xmalloc (sizeof *r);
- memset (r, 0, sizeof *r);
-
- r->low = low;
- r->high = high;
-
- /* Store the ranges sorted by address. */
- for (pr = plist; *pr != NULL; pr = &(*pr)->next)
- if ((*pr)->low > high)
- break;
- r->next = *pr;
- *pr = r;
-
- return true;
-}
-
-/* Start a new range for which we only have the low address. */
-
-static boolean
-ieee_start_range (info, low)
- struct ieee_handle *info;
- bfd_vma low;
-{
- struct ieee_range *r;
-
- r = (struct ieee_range *) xmalloc (sizeof *r);
- memset (r, 0, sizeof *r);
- r->low = low;
- r->next = info->pending_ranges;
- info->pending_ranges = r;
- return true;
-}
-
-/* Finish a range started by ieee_start_range. */
-
-static boolean
-ieee_end_range (info, high)
- struct ieee_handle *info;
- bfd_vma high;
-{
- struct ieee_range *r;
- bfd_vma low;
-
- assert (info->pending_ranges != NULL);
- r = info->pending_ranges;
- low = r->low;
- info->pending_ranges = r->next;
- free (r);
- return ieee_add_range (info, false, low, high);
-}
-
-/* Start defining a type. */
-
-static boolean
-ieee_define_type (info, size, unsignedp, localp)
- struct ieee_handle *info;
- unsigned int size;
- boolean unsignedp;
- boolean localp;
-{
- return ieee_define_named_type (info, (const char *) NULL,
- (unsigned int) -1, size, unsignedp,
- localp, (struct ieee_buflist *) NULL);
-}
-
-/* Start defining a named type. */
-
-static boolean
-ieee_define_named_type (info, name, indx, size, unsignedp, localp, buflist)
- struct ieee_handle *info;
- const char *name;
- unsigned int indx;
- unsigned int size;
- boolean unsignedp;
- boolean localp;
- struct ieee_buflist *buflist;
-{
- unsigned int type_indx;
- unsigned int name_indx;
-
- if (indx != (unsigned int) -1)
- type_indx = indx;
- else
- {
- type_indx = info->type_indx;
- ++info->type_indx;
- }
-
- name_indx = info->name_indx;
- ++info->name_indx;
-
- if (name == NULL)
- name = "";
-
- /* If we were given a buffer, use it; otherwise, use either the
- local or the global type information, and make sure that the type
- block is started. */
- if (buflist != NULL)
- {
- if (! ieee_change_buffer (info, buflist))
- return false;
- }
- else if (localp)
- {
- if (! ieee_buffer_emptyp (&info->types))
- {
- if (! ieee_change_buffer (info, &info->types))
- return false;
- }
- else
- {
- if (! ieee_change_buffer (info, &info->types)
- || ! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 1)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, info->modname))
- return false;
- }
- }
- else
- {
- if (! ieee_buffer_emptyp (&info->global_types))
- {
- if (! ieee_change_buffer (info, &info->global_types))
- return false;
- }
- else
- {
- if (! ieee_change_buffer (info, &info->global_types)
- || ! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 2)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, ""))
- return false;
- }
- }
-
- /* Push the new type on the type stack, write out an NN record, and
- write out the start of a TY record. The caller will then finish
- the TY record. */
- if (! ieee_push_type (info, type_indx, size, unsignedp, localp))
- return false;
-
- return (ieee_write_byte (info, (int) ieee_nn_record)
- && ieee_write_number (info, name_indx)
- && ieee_write_id (info, name)
- && ieee_write_byte (info, (int) ieee_ty_record_enum)
- && ieee_write_number (info, type_indx)
- && ieee_write_byte (info, 0xce)
- && ieee_write_number (info, name_indx));
-}
-
-/* Get an entry to the list of modified versions of a type. */
-
-static struct ieee_modified_type *
-ieee_get_modified_info (info, indx)
- struct ieee_handle *info;
- unsigned int indx;
-{
- if (indx >= info->modified_alloc)
- {
- unsigned int nalloc;
-
- nalloc = info->modified_alloc;
- if (nalloc == 0)
- nalloc = 16;
- while (indx >= nalloc)
- nalloc *= 2;
- info->modified = ((struct ieee_modified_type *)
- xrealloc (info->modified,
- nalloc * sizeof *info->modified));
- memset (info->modified + info->modified_alloc, 0,
- (nalloc - info->modified_alloc) * sizeof *info->modified);
- info->modified_alloc = nalloc;
- }
-
- return info->modified + indx;
-}
-
-/* Routines for the hash table mapping names to types. */
-
-/* Initialize an entry in the hash table. */
-
-static struct bfd_hash_entry *
-ieee_name_type_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
-{
- struct ieee_name_type_hash_entry *ret =
- (struct ieee_name_type_hash_entry *) entry;
-
- /* Allocate the structure if it has not already been allocated by a
- subclass. */
- if (ret == NULL)
- ret = ((struct ieee_name_type_hash_entry *)
- bfd_hash_allocate (table, sizeof *ret));
- if (ret == NULL)
- return NULL;
-
- /* Call the allocation method of the superclass. */
- ret = ((struct ieee_name_type_hash_entry *)
- bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
- if (ret)
- {
- /* Set local fields. */
- ret->types = NULL;
- }
-
- return (struct bfd_hash_entry *) ret;
-}
-
-/* Look up an entry in the hash table. */
-
-#define ieee_name_type_hash_lookup(table, string, create, copy) \
- ((struct ieee_name_type_hash_entry *) \
- bfd_hash_lookup (&(table)->root, (string), (create), (copy)))
-
-/* Traverse the hash table. */
-
-#define ieee_name_type_hash_traverse(table, func, info) \
- (bfd_hash_traverse \
- (&(table)->root, \
- (boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) (func), \
- (info)))
-
-/* The general routine to write out IEEE debugging information. */
-
-boolean
-write_ieee_debugging_info (abfd, dhandle)
- bfd *abfd;
- PTR dhandle;
-{
- struct ieee_handle info;
- asection *s;
- const char *err;
- struct ieee_buf *b;
-
- memset (&info, 0, sizeof info);
- info.abfd = abfd;
- info.type_indx = 256;
- info.name_indx = 32;
-
- if (! bfd_hash_table_init (&info.typedefs.root, ieee_name_type_newfunc)
- || ! bfd_hash_table_init (&info.tags.root, ieee_name_type_newfunc))
- return false;
-
- if (! ieee_init_buffer (&info, &info.global_types)
- || ! ieee_init_buffer (&info, &info.data)
- || ! ieee_init_buffer (&info, &info.types)
- || ! ieee_init_buffer (&info, &info.vars)
- || ! ieee_init_buffer (&info, &info.cxx)
- || ! ieee_init_buffer (&info, &info.linenos)
- || ! ieee_init_buffer (&info, &info.fntype)
- || ! ieee_init_buffer (&info, &info.fnargs))
- return false;
-
- if (! debug_write (dhandle, &ieee_fns, (PTR) &info))
- return false;
-
- if (info.filename != NULL)
- {
- if (! ieee_finish_compilation_unit (&info))
- return false;
- }
-
- /* Put any undefined tags in the global typedef information. */
- info.error = false;
- ieee_name_type_hash_traverse (&info.tags,
- ieee_write_undefined_tag,
- (PTR) &info);
- if (info.error)
- return false;
-
- /* Prepend the global typedef information to the other data. */
- if (! ieee_buffer_emptyp (&info.global_types))
- {
- /* The HP debugger seems to have a bug in which it ignores the
- last entry in the global types, so we add a dummy entry. */
- if (! ieee_change_buffer (&info, &info.global_types)
- || ! ieee_write_byte (&info, (int) ieee_nn_record)
- || ! ieee_write_number (&info, info.name_indx)
- || ! ieee_write_id (&info, "")
- || ! ieee_write_byte (&info, (int) ieee_ty_record_enum)
- || ! ieee_write_number (&info, info.type_indx)
- || ! ieee_write_byte (&info, 0xce)
- || ! ieee_write_number (&info, info.name_indx)
- || ! ieee_write_number (&info, 'P')
- || ! ieee_write_number (&info, (int) builtin_void + 32)
- || ! ieee_write_byte (&info, (int) ieee_be_record_enum))
- return false;
-
- if (! ieee_append_buffer (&info, &info.global_types, &info.data))
- return false;
- info.data = info.global_types;
- }
-
- /* Make sure that we have declare BB11 blocks for each range in the
- file. They are added to info->vars. */
- info.error = false;
- if (! ieee_init_buffer (&info, &info.vars))
- return false;
- bfd_map_over_sections (abfd, ieee_add_bb11_blocks, (PTR) &info);
- if (info.error)
- return false;
- if (! ieee_buffer_emptyp (&info.vars))
- {
- if (! ieee_change_buffer (&info, &info.vars)
- || ! ieee_write_byte (&info, (int) ieee_be_record_enum))
- return false;
-
- if (! ieee_append_buffer (&info, &info.data, &info.vars))
- return false;
- }
-
- /* Now all the data is in info.data. Write it out to the BFD. We
- normally would need to worry about whether all the other sections
- are set up yet, but the IEEE backend will handle this particular
- case correctly regardless. */
- if (ieee_buffer_emptyp (&info.data))
- {
- /* There is no debugging information. */
- return true;
- }
- err = NULL;
- s = bfd_make_section (abfd, ".debug");
- if (s == NULL)
- err = "bfd_make_section";
- if (err == NULL)
- {
- if (! bfd_set_section_flags (abfd, s, SEC_DEBUGGING | SEC_HAS_CONTENTS))
- err = "bfd_set_section_flags";
- }
- if (err == NULL)
- {
- bfd_size_type size;
-
- size = 0;
- for (b = info.data.head; b != NULL; b = b->next)
- size += b->c;
- if (! bfd_set_section_size (abfd, s, size))
- err = "bfd_set_section_size";
- }
- if (err == NULL)
- {
- file_ptr offset;
-
- offset = 0;
- for (b = info.data.head; b != NULL; b = b->next)
- {
- if (! bfd_set_section_contents (abfd, s, b->buf, offset, b->c))
- {
- err = "bfd_set_section_contents";
- break;
- }
- offset += b->c;
- }
- }
-
- if (err != NULL)
- {
- fprintf (stderr, "%s: %s: %s\n", bfd_get_filename (abfd), err,
- bfd_errmsg (bfd_get_error ()));
- return false;
- }
-
- bfd_hash_table_free (&info.typedefs.root);
- bfd_hash_table_free (&info.tags.root);
-
- return true;
-}
-
-/* Write out information for an undefined tag. This is called via
- ieee_name_type_hash_traverse. */
-
-static boolean
-ieee_write_undefined_tag (h, p)
- struct ieee_name_type_hash_entry *h;
- PTR p;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- struct ieee_name_type *nt;
-
- for (nt = h->types; nt != NULL; nt = nt->next)
- {
- unsigned int name_indx;
- char code;
-
- if (nt->kind == DEBUG_KIND_ILLEGAL)
- continue;
-
- if (ieee_buffer_emptyp (&info->global_types))
- {
- if (! ieee_change_buffer (info, &info->global_types)
- || ! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 2)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, ""))
- {
- info->error = true;
- return false;
- }
- }
- else
- {
- if (! ieee_change_buffer (info, &info->global_types))
- {
- info->error = true;
- return false;
- }
- }
-
- name_indx = info->name_indx;
- ++info->name_indx;
- if (! ieee_write_byte (info, (int) ieee_nn_record)
- || ! ieee_write_number (info, name_indx)
- || ! ieee_write_id (info, nt->type.name)
- || ! ieee_write_byte (info, (int) ieee_ty_record_enum)
- || ! ieee_write_number (info, nt->type.indx)
- || ! ieee_write_byte (info, 0xce)
- || ! ieee_write_number (info, name_indx))
- {
- info->error = true;
- return false;
- }
-
- switch (nt->kind)
- {
- default:
- abort ();
- info->error = true;
- return false;
- case DEBUG_KIND_STRUCT:
- case DEBUG_KIND_CLASS:
- code = 'S';
- break;
- case DEBUG_KIND_UNION:
- case DEBUG_KIND_UNION_CLASS:
- code = 'U';
- break;
- case DEBUG_KIND_ENUM:
- code = 'E';
- break;
- }
- if (! ieee_write_number (info, code)
- || ! ieee_write_number (info, 0))
- {
- info->error = true;
- return false;
- }
- }
-
- return true;
-}
-
-/* Start writing out information for a compilation unit. */
-
-static boolean
-ieee_start_compilation_unit (p, filename)
- PTR p;
- const char *filename;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- const char *modname;
- char *c, *s;
- unsigned int nindx;
-
- if (info->filename != NULL)
- {
- if (! ieee_finish_compilation_unit (info))
- return false;
- }
-
- info->filename = filename;
- modname = strrchr (filename, '/');
- if (modname != NULL)
- ++modname;
- else
- {
- modname = strrchr (filename, '\\');
- if (modname != NULL)
- ++modname;
- else
- modname = filename;
- }
- c = xstrdup (modname);
- s = strrchr (c, '.');
- if (s != NULL)
- *s = '\0';
- info->modname = c;
-
- if (! ieee_init_buffer (info, &info->types)
- || ! ieee_init_buffer (info, &info->vars)
- || ! ieee_init_buffer (info, &info->cxx)
- || ! ieee_init_buffer (info, &info->linenos))
- return false;
- info->ranges = NULL;
-
- /* Always include a BB1 and a BB3 block. That is what the output of
- the MRI linker seems to look like. */
- if (! ieee_change_buffer (info, &info->types)
- || ! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 1)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, info->modname))
- return false;
-
- nindx = info->name_indx;
- ++info->name_indx;
- if (! ieee_change_buffer (info, &info->vars)
- || ! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 3)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, info->modname))
- return false;
-
- return true;
-}
-
-/* Finish up a compilation unit. */
-
-static boolean
-ieee_finish_compilation_unit (info)
- struct ieee_handle *info;
-{
- struct ieee_range *r;
-
- if (! ieee_buffer_emptyp (&info->types))
- {
- if (! ieee_change_buffer (info, &info->types)
- || ! ieee_write_byte (info, (int) ieee_be_record_enum))
- return false;
- }
-
- if (! ieee_buffer_emptyp (&info->cxx))
- {
- /* Append any C++ information to the global function and
- variable information. */
- assert (! ieee_buffer_emptyp (&info->vars));
- if (! ieee_change_buffer (info, &info->vars))
- return false;
-
- /* We put the pmisc records in a dummy procedure, just as the
- MRI compiler does. */
- if (! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 6)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, "__XRYCPP")
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, info->highaddr - 1)
- || ! ieee_append_buffer (info, &info->vars, &info->cxx)
- || ! ieee_change_buffer (info, &info->vars)
- || ! ieee_write_byte (info, (int) ieee_be_record_enum)
- || ! ieee_write_number (info, info->highaddr - 1))
- return false;
- }
-
- if (! ieee_buffer_emptyp (&info->vars))
- {
- if (! ieee_change_buffer (info, &info->vars)
- || ! ieee_write_byte (info, (int) ieee_be_record_enum))
- return false;
- }
-
- if (info->pending_lineno_filename != NULL)
- {
- /* Force out the pending line number. */
- if (! ieee_lineno ((PTR) info, (const char *) NULL, 0, (bfd_vma) -1))
- return false;
- }
- if (! ieee_buffer_emptyp (&info->linenos))
- {
- if (! ieee_change_buffer (info, &info->linenos)
- || ! ieee_write_byte (info, (int) ieee_be_record_enum))
- return false;
- if (strcmp (info->filename, info->lineno_filename) != 0)
- {
- /* We were not in the main file. We just closed the
- included line number block, and now we must close the
- main line number block. */
- if (! ieee_write_byte (info, (int) ieee_be_record_enum))
- return false;
- }
- }
-
- if (! ieee_append_buffer (info, &info->data, &info->types)
- || ! ieee_append_buffer (info, &info->data, &info->vars)
- || ! ieee_append_buffer (info, &info->data, &info->linenos))
- return false;
-
- /* Build BB10/BB11 blocks based on the ranges we recorded. */
- if (! ieee_change_buffer (info, &info->data))
- return false;
-
- if (! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 10)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, info->modname)
- || ! ieee_write_id (info, "")
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, "GNU objcopy"))
- return false;
-
- for (r = info->ranges; r != NULL; r = r->next)
- {
- bfd_vma low, high;
- asection *s;
- int kind;
-
- low = r->low;
- high = r->high;
-
- /* Find the section corresponding to this range. */
- for (s = info->abfd->sections; s != NULL; s = s->next)
- {
- if (bfd_get_section_vma (info->abfd, s) <= low
- && high <= (bfd_get_section_vma (info->abfd, s)
- + bfd_section_size (info->abfd, s)))
- break;
- }
-
- if (s == NULL)
- {
- /* Just ignore this range. */
- continue;
- }
-
- /* Coalesce ranges if it seems reasonable. */
- while (r->next != NULL
- && high + 0x1000 >= r->next->low
- && (r->next->high
- <= (bfd_get_section_vma (info->abfd, s)
- + bfd_section_size (info->abfd, s))))
- {
- r = r->next;
- high = r->high;
- }
-
- if ((s->flags & SEC_CODE) != 0)
- kind = 1;
- else if ((s->flags & SEC_READONLY) != 0)
- kind = 3;
- else
- kind = 2;
-
- if (! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 11)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, "")
- || ! ieee_write_number (info, kind)
- || ! ieee_write_number (info, s->index + IEEE_SECTION_NUMBER_BASE)
- || ! ieee_write_number (info, low)
- || ! ieee_write_byte (info, (int) ieee_be_record_enum)
- || ! ieee_write_number (info, high - low))
- return false;
-
- /* Add this range to the list of global ranges. */
- if (! ieee_add_range (info, true, low, high))
- return false;
- }
-
- if (! ieee_write_byte (info, (int) ieee_be_record_enum))
- return false;
-
- return true;
-}
-
-/* Add BB11 blocks describing each range that we have not already
- described. */
-
-static void
-ieee_add_bb11_blocks (abfd, sec, data)
- bfd *abfd;
- asection *sec;
- PTR data;
-{
- struct ieee_handle *info = (struct ieee_handle *) data;
- bfd_vma low, high;
- struct ieee_range *r;
-
- low = bfd_get_section_vma (abfd, sec);
- high = low + bfd_section_size (abfd, sec);
-
- /* Find the first range at or after this section. The ranges are
- sorted by address. */
- for (r = info->global_ranges; r != NULL; r = r->next)
- if (r->high > low)
- break;
-
- while (low < high)
- {
- if (r == NULL || r->low >= high)
- {
- if (! ieee_add_bb11 (info, sec, low, high))
- info->error = true;
- return;
- }
-
- if (low < r->low
- && r->low - low > 0x100)
- {
- if (! ieee_add_bb11 (info, sec, low, r->low))
- {
- info->error = true;
- return;
- }
- }
- low = r->high;
-
- r = r->next;
- }
-}
-
-/* Add a single BB11 block for a range. We add it to info->vars. */
-
-static boolean
-ieee_add_bb11 (info, sec, low, high)
- struct ieee_handle *info;
- asection *sec;
- bfd_vma low;
- bfd_vma high;
-{
- int kind;
-
- if (! ieee_buffer_emptyp (&info->vars))
- {
- if (! ieee_change_buffer (info, &info->vars))
- return false;
- }
- else
- {
- const char *filename, *modname;
- char *c, *s;
-
- /* Start the enclosing BB10 block. */
- filename = bfd_get_filename (info->abfd);
- modname = strrchr (filename, '/');
- if (modname != NULL)
- ++modname;
- else
- {
- modname = strrchr (filename, '\\');
- if (modname != NULL)
- ++modname;
- else
- modname = filename;
- }
- c = xstrdup (modname);
- s = strrchr (c, '.');
- if (s != NULL)
- *s = '\0';
-
- if (! ieee_change_buffer (info, &info->vars)
- || ! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 10)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, c)
- || ! ieee_write_id (info, "")
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, "GNU objcopy"))
- return false;
-
- free (c);
- }
-
- if ((sec->flags & SEC_CODE) != 0)
- kind = 1;
- else if ((sec->flags & SEC_READONLY) != 0)
- kind = 3;
- else
- kind = 2;
-
- if (! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 11)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, "")
- || ! ieee_write_number (info, kind)
- || ! ieee_write_number (info, sec->index + IEEE_SECTION_NUMBER_BASE)
- || ! ieee_write_number (info, low)
- || ! ieee_write_byte (info, (int) ieee_be_record_enum)
- || ! ieee_write_number (info, high - low))
- return false;
-
- return true;
-}
-
-/* Start recording information from a particular source file. This is
- used to record which file defined which types, variables, etc. It
- is not used for line numbers, since the lineno entry point passes
- down the file name anyhow. IEEE debugging information doesn't seem
- to store this information anywhere. */
-
-/*ARGSUSED*/
-static boolean
-ieee_start_source (p, filename)
- PTR p;
- const char *filename;
-{
- return true;
-}
-
-/* Make an empty type. */
-
-static boolean
-ieee_empty_type (p)
- PTR p;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- return ieee_push_type (info, (int) builtin_unknown, 0, false, false);
-}
-
-/* Make a void type. */
-
-static boolean
-ieee_void_type (p)
- PTR p;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- return ieee_push_type (info, (int) builtin_void, 0, false, false);
-}
-
-/* Make an integer type. */
-
-static boolean
-ieee_int_type (p, size, unsignedp)
- PTR p;
- unsigned int size;
- boolean unsignedp;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- unsigned int indx;
-
- switch (size)
- {
- case 1:
- indx = (int) builtin_signed_char;
- break;
- case 2:
- indx = (int) builtin_signed_short_int;
- break;
- case 4:
- indx = (int) builtin_signed_long;
- break;
- case 8:
- indx = (int) builtin_signed_long_long;
- break;
- default:
- fprintf (stderr, "IEEE unsupported integer type size %u\n", size);
- return false;
- }
-
- if (unsignedp)
- ++indx;
-
- return ieee_push_type (info, indx, size, unsignedp, false);
-}
-
-/* Make a floating point type. */
-
-static boolean
-ieee_float_type (p, size)
- PTR p;
- unsigned int size;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- unsigned int indx;
-
- switch (size)
- {
- case 4:
- indx = (int) builtin_float;
- break;
- case 8:
- indx = (int) builtin_double;
- break;
- case 12:
- /* FIXME: This size really depends upon the processor. */
- indx = (int) builtin_long_double;
- break;
- case 16:
- indx = (int) builtin_long_long_double;
- break;
- default:
- fprintf (stderr, "IEEE unsupported float type size %u\n", size);
- return false;
- }
-
- return ieee_push_type (info, indx, size, false, false);
-}
-
-/* Make a complex type. */
-
-static boolean
-ieee_complex_type (p, size)
- PTR p;
- unsigned int size;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- char code;
-
- switch (size)
- {
- case 4:
- if (info->complex_float_index != 0)
- return ieee_push_type (info, info->complex_float_index, size * 2,
- false, false);
- code = 'c';
- break;
- case 12:
- case 16:
- /* These cases can be output by gcc -gstabs. Outputting the
- wrong type is better than crashing. */
- case 8:
- if (info->complex_double_index != 0)
- return ieee_push_type (info, info->complex_double_index, size * 2,
- false, false);
- code = 'd';
- break;
- default:
- fprintf (stderr, "IEEE unsupported complex type size %u\n", size);
- return false;
- }
-
- /* FIXME: I don't know what the string is for. */
- if (! ieee_define_type (info, size * 2, false, false)
- || ! ieee_write_number (info, code)
- || ! ieee_write_id (info, ""))
- return false;
-
- if (size == 4)
- info->complex_float_index = info->type_stack->type.indx;
- else
- info->complex_double_index = info->type_stack->type.indx;
-
- return true;
-}
-
-/* Make a boolean type. IEEE doesn't support these, so we just make
- an integer type instead. */
-
-static boolean
-ieee_bool_type (p, size)
- PTR p;
- unsigned int size;
-{
- return ieee_int_type (p, size, true);
-}
-
-/* Make an enumeration. */
-
-static boolean
-ieee_enum_type (p, tag, names, vals)
- PTR p;
- const char *tag;
- const char **names;
- bfd_signed_vma *vals;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- struct ieee_defined_enum *e;
- boolean localp, simple;
- unsigned int indx;
- int i = 0;
-
- localp = false;
- indx = (unsigned int) -1;
- for (e = info->enums; e != NULL; e = e->next)
- {
- if (tag == NULL)
- {
- if (e->tag != NULL)
- continue;
- }
- else
- {
- if (e->tag == NULL
- || tag[0] != e->tag[0]
- || strcmp (tag, e->tag) != 0)
- continue;
- }
-
- if (! e->defined)
- {
- /* This enum tag has been seen but not defined. */
- indx = e->indx;
- break;
- }
-
- if (names != NULL && e->names != NULL)
- {
- for (i = 0; names[i] != NULL && e->names[i] != NULL; i++)
- {
- if (names[i][0] != e->names[i][0]
- || vals[i] != e->vals[i]
- || strcmp (names[i], e->names[i]) != 0)
- break;
- }
- }
-
- if ((names == NULL && e->names == NULL)
- || (names != NULL
- && e->names != NULL
- && names[i] == NULL
- && e->names[i] == NULL))
- {
- /* We've seen this enum before. */
- return ieee_push_type (info, e->indx, 0, true, false);
- }
-
- if (tag != NULL)
- {
- /* We've already seen an enum of the same name, so we must make
- sure to output this one locally. */
- localp = true;
- break;
- }
- }
-
- /* If this is a simple enumeration, in which the values start at 0
- and always increment by 1, we can use type E. Otherwise we must
- use type N. */
-
- simple = true;
- if (names != NULL)
- {
- for (i = 0; names[i] != NULL; i++)
- {
- if (vals[i] != i)
- {
- simple = false;
- break;
- }
- }
- }
-
- if (! ieee_define_named_type (info, tag, indx, 0, true, localp,
- (struct ieee_buflist *) NULL)
- || ! ieee_write_number (info, simple ? 'E' : 'N'))
- return false;
- if (simple)
- {
- /* FIXME: This is supposed to be the enumeration size, but we
- don't store that. */
- if (! ieee_write_number (info, 4))
- return false;
- }
- if (names != NULL)
- {
- for (i = 0; names[i] != NULL; i++)
- {
- if (! ieee_write_id (info, names[i]))
- return false;
- if (! simple)
- {
- if (! ieee_write_number (info, vals[i]))
- return false;
- }
- }
- }
-
- if (! localp)
- {
- if (indx == (unsigned int) -1)
- {
- e = (struct ieee_defined_enum *) xmalloc (sizeof *e);
- memset (e, 0, sizeof *e);
- e->indx = info->type_stack->type.indx;
- e->tag = tag;
-
- e->next = info->enums;
- info->enums = e;
- }
-
- e->names = names;
- e->vals = vals;
- e->defined = true;
- }
-
- return true;
-}
-
-/* Make a pointer type. */
-
-static boolean
-ieee_pointer_type (p)
- PTR p;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- boolean localp;
- unsigned int indx;
- struct ieee_modified_type *m = NULL;
-
- localp = info->type_stack->type.localp;
- indx = ieee_pop_type (info);
-
- /* A pointer to a simple builtin type can be obtained by adding 32.
- FIXME: Will this be a short pointer, and will that matter? */
- if (indx < 32)
- return ieee_push_type (info, indx + 32, 0, true, false);
-
- if (! localp)
- {
- m = ieee_get_modified_info (p, indx);
- if (m == NULL)
- return false;
-
- /* FIXME: The size should depend upon the architecture. */
- if (m->pointer > 0)
- return ieee_push_type (info, m->pointer, 4, true, false);
- }
-
- if (! ieee_define_type (info, 4, true, localp)
- || ! ieee_write_number (info, 'P')
- || ! ieee_write_number (info, indx))
- return false;
-
- if (! localp)
- m->pointer = info->type_stack->type.indx;
-
- return true;
-}
-
-/* Make a function type. This will be called for a method, but we
- don't want to actually add it to the type table in that case. We
- handle this by defining the type in a private buffer, and only
- adding that buffer to the typedef block if we are going to use it. */
-
-static boolean
-ieee_function_type (p, argcount, varargs)
- PTR p;
- int argcount;
- boolean varargs;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- boolean localp;
- unsigned int *args = NULL;
- int i;
- unsigned int retindx;
- struct ieee_buflist fndef;
- struct ieee_modified_type *m;
-
- localp = false;
-
- if (argcount > 0)
- {
- args = (unsigned int *) xmalloc (argcount * sizeof *args);
- for (i = argcount - 1; i >= 0; i--)
- {
- if (info->type_stack->type.localp)
- localp = true;
- args[i] = ieee_pop_type (info);
- }
- }
- else if (argcount < 0)
- varargs = false;
-
- if (info->type_stack->type.localp)
- localp = true;
- retindx = ieee_pop_type (info);
-
- m = NULL;
- if (argcount < 0 && ! localp)
- {
- m = ieee_get_modified_info (p, retindx);
- if (m == NULL)
- return false;
-
- if (m->function > 0)
- return ieee_push_type (info, m->function, 0, true, false);
- }
-
- /* An attribute of 0x41 means that the frame and push mask are
- unknown. */
- if (! ieee_init_buffer (info, &fndef)
- || ! ieee_define_named_type (info, (const char *) NULL,
- (unsigned int) -1, 0, true, localp,
- &fndef)
- || ! ieee_write_number (info, 'x')
- || ! ieee_write_number (info, 0x41)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, retindx)
- || ! ieee_write_number (info, (bfd_vma) argcount + (varargs ? 1 : 0)))
- return false;
- if (argcount > 0)
- {
- for (i = 0; i < argcount; i++)
- if (! ieee_write_number (info, args[i]))
- return false;
- free (args);
- }
- if (varargs)
- {
- /* A varargs function is represented by writing out the last
- argument as type void *, although this makes little sense. */
- if (! ieee_write_number (info, (bfd_vma) builtin_void + 32))
- return false;
- }
-
- if (! ieee_write_number (info, 0))
- return false;
-
- /* We wrote the information into fndef, in case we don't need it.
- It will be appended to info->types by ieee_pop_type. */
- info->type_stack->type.fndef = fndef;
-
- if (m != NULL)
- m->function = info->type_stack->type.indx;
-
- return true;
-}
-
-/* Make a reference type. */
-
-static boolean
-ieee_reference_type (p)
- PTR p;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- /* IEEE appears to record a normal pointer type, and then use a
- pmisc record to indicate that it is really a reference. */
-
- if (! ieee_pointer_type (p))
- return false;
- info->type_stack->type.referencep = true;
- return true;
-}
-
-/* Make a range type. */
-
-static boolean
-ieee_range_type (p, low, high)
- PTR p;
- bfd_signed_vma low;
- bfd_signed_vma high;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- unsigned int size;
- boolean unsignedp, localp;
-
- size = info->type_stack->type.size;
- unsignedp = info->type_stack->type.unsignedp;
- localp = info->type_stack->type.localp;
- ieee_pop_unused_type (info);
- return (ieee_define_type (info, size, unsignedp, localp)
- && ieee_write_number (info, 'R')
- && ieee_write_number (info, (bfd_vma) low)
- && ieee_write_number (info, (bfd_vma) high)
- && ieee_write_number (info, unsignedp ? 0 : 1)
- && ieee_write_number (info, size));
-}
-
-/* Make an array type. */
-
-/*ARGSUSED*/
-static boolean
-ieee_array_type (p, low, high, stringp)
- PTR p;
- bfd_signed_vma low;
- bfd_signed_vma high;
- boolean stringp;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- unsigned int eleindx;
- boolean localp;
- unsigned int size;
- struct ieee_modified_type *m = NULL;
- struct ieee_modified_array_type *a;
-
- /* IEEE does not store the range, so we just ignore it. */
- ieee_pop_unused_type (info);
- localp = info->type_stack->type.localp;
- size = info->type_stack->type.size;
- eleindx = ieee_pop_type (info);
-
- /* If we don't know the range, treat the size as exactly one
- element. */
- if (low < high)
- size *= (high - low) + 1;
-
- if (! localp)
- {
- m = ieee_get_modified_info (info, eleindx);
- if (m == NULL)
- return false;
-
- for (a = m->arrays; a != NULL; a = a->next)
- {
- if (a->low == low && a->high == high)
- return ieee_push_type (info, a->indx, size, false, false);
- }
- }
-
- if (! ieee_define_type (info, size, false, localp)
- || ! ieee_write_number (info, low == 0 ? 'Z' : 'C')
- || ! ieee_write_number (info, eleindx))
- return false;
- if (low != 0)
- {
- if (! ieee_write_number (info, low))
- return false;
- }
-
- if (! ieee_write_number (info, high + 1))
- return false;
-
- if (! localp)
- {
- a = (struct ieee_modified_array_type *) xmalloc (sizeof *a);
- memset (a, 0, sizeof *a);
-
- a->indx = info->type_stack->type.indx;
- a->low = low;
- a->high = high;
-
- a->next = m->arrays;
- m->arrays = a;
- }
-
- return true;
-}
-
-/* Make a set type. */
-
-static boolean
-ieee_set_type (p, bitstringp)
- PTR p;
- boolean bitstringp;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- boolean localp;
- unsigned int eleindx;
-
- localp = info->type_stack->type.localp;
- eleindx = ieee_pop_type (info);
-
- /* FIXME: We don't know the size, so we just use 4. */
-
- return (ieee_define_type (info, 0, true, localp)
- && ieee_write_number (info, 's')
- && ieee_write_number (info, 4)
- && ieee_write_number (info, eleindx));
-}
-
-/* Make an offset type. */
-
-static boolean
-ieee_offset_type (p)
- PTR p;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- unsigned int targetindx, baseindx;
-
- targetindx = ieee_pop_type (info);
- baseindx = ieee_pop_type (info);
-
- /* FIXME: The MRI C++ compiler does not appear to generate any
- useful type information about an offset type. It just records a
- pointer to member as an integer. The MRI/HP IEEE spec does
- describe a pmisc record which can be used for a pointer to
- member. Unfortunately, it does not describe the target type,
- which seems pretty important. I'm going to punt this for now. */
-
- return ieee_int_type (p, 4, true);
-}
-
-/* Make a method type. */
-
-static boolean
-ieee_method_type (p, domain, argcount, varargs)
- PTR p;
- boolean domain;
- int argcount;
- boolean varargs;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- /* FIXME: The MRI/HP IEEE spec defines a pmisc record to use for a
- method, but the definition is incomplete. We just output an 'x'
- type. */
-
- if (domain)
- ieee_pop_unused_type (info);
-
- return ieee_function_type (p, argcount, varargs);
-}
-
-/* Make a const qualified type. */
-
-static boolean
-ieee_const_type (p)
- PTR p;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- unsigned int size;
- boolean unsignedp, localp;
- unsigned int indx;
- struct ieee_modified_type *m = NULL;
-
- size = info->type_stack->type.size;
- unsignedp = info->type_stack->type.unsignedp;
- localp = info->type_stack->type.localp;
- indx = ieee_pop_type (info);
-
- if (! localp)
- {
- m = ieee_get_modified_info (info, indx);
- if (m == NULL)
- return false;
-
- if (m->const_qualified > 0)
- return ieee_push_type (info, m->const_qualified, size, unsignedp,
- false);
- }
-
- if (! ieee_define_type (info, size, unsignedp, localp)
- || ! ieee_write_number (info, 'n')
- || ! ieee_write_number (info, 1)
- || ! ieee_write_number (info, indx))
- return false;
-
- if (! localp)
- m->const_qualified = info->type_stack->type.indx;
-
- return true;
-}
-
-/* Make a volatile qualified type. */
-
-static boolean
-ieee_volatile_type (p)
- PTR p;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- unsigned int size;
- boolean unsignedp, localp;
- unsigned int indx;
- struct ieee_modified_type *m = NULL;
-
- size = info->type_stack->type.size;
- unsignedp = info->type_stack->type.unsignedp;
- localp = info->type_stack->type.localp;
- indx = ieee_pop_type (info);
-
- if (! localp)
- {
- m = ieee_get_modified_info (info, indx);
- if (m == NULL)
- return false;
-
- if (m->volatile_qualified > 0)
- return ieee_push_type (info, m->volatile_qualified, size, unsignedp,
- false);
- }
-
- if (! ieee_define_type (info, size, unsignedp, localp)
- || ! ieee_write_number (info, 'n')
- || ! ieee_write_number (info, 2)
- || ! ieee_write_number (info, indx))
- return false;
-
- if (! localp)
- m->volatile_qualified = info->type_stack->type.indx;
-
- return true;
-}
-
-/* Convert an enum debug_visibility into a CXXFLAGS value. */
-
-static unsigned int
-ieee_vis_to_flags (visibility)
- enum debug_visibility visibility;
-{
- switch (visibility)
- {
- default:
- abort ();
- case DEBUG_VISIBILITY_PUBLIC:
- return CXXFLAGS_VISIBILITY_PUBLIC;
- case DEBUG_VISIBILITY_PRIVATE:
- return CXXFLAGS_VISIBILITY_PRIVATE;
- case DEBUG_VISIBILITY_PROTECTED:
- return CXXFLAGS_VISIBILITY_PROTECTED;
- }
- /*NOTREACHED*/
-}
-
-/* Start defining a struct type. We build it in the strdef field on
- the stack, to avoid confusing type definitions required by the
- fields with the struct type itself. */
-
-static boolean
-ieee_start_struct_type (p, tag, id, structp, size)
- PTR p;
- const char *tag;
- unsigned int id;
- boolean structp;
- unsigned int size;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- boolean localp, ignorep;
- boolean copy;
- char ab[20];
- const char *look;
- struct ieee_name_type_hash_entry *h;
- struct ieee_name_type *nt, *ntlook;
- struct ieee_buflist strdef;
-
- localp = false;
- ignorep = false;
-
- /* We need to create a tag for internal use even if we don't want
- one for external use. This will let us refer to an anonymous
- struct. */
- if (tag != NULL)
- {
- look = tag;
- copy = false;
- }
- else
- {
- sprintf (ab, "__anon%u", id);
- look = ab;
- copy = true;
- }
-
- /* If we already have references to the tag, we must use the
- existing type index. */
- h = ieee_name_type_hash_lookup (&info->tags, look, true, copy);
- if (h == NULL)
- return false;
-
- nt = NULL;
- for (ntlook = h->types; ntlook != NULL; ntlook = ntlook->next)
- {
- if (ntlook->id == id)
- nt = ntlook;
- else if (! ntlook->type.localp)
- {
- /* We are creating a duplicate definition of a globally
- defined tag. Force it to be local to avoid
- confusion. */
- localp = true;
- }
- }
-
- if (nt != NULL)
- {
- assert (localp == nt->type.localp);
- if (nt->kind == DEBUG_KIND_ILLEGAL && ! localp)
- {
- /* We've already seen a global definition of the type.
- Ignore this new definition. */
- ignorep = true;
- }
- }
- else
- {
- nt = (struct ieee_name_type *) xmalloc (sizeof *nt);
- memset (nt, 0, sizeof *nt);
- nt->id = id;
- nt->type.name = h->root.string;
- nt->next = h->types;
- h->types = nt;
- nt->type.indx = info->type_indx;
- ++info->type_indx;
- }
-
- nt->kind = DEBUG_KIND_ILLEGAL;
-
- if (! ieee_init_buffer (info, &strdef)
- || ! ieee_define_named_type (info, tag, nt->type.indx, size, true,
- localp, &strdef)
- || ! ieee_write_number (info, structp ? 'S' : 'U')
- || ! ieee_write_number (info, size))
- return false;
-
- if (! ignorep)
- {
- const char *hold;
-
- /* We never want nt->type.name to be NULL. We want the rest of
- the type to be the object set up on the type stack; it will
- have a NULL name if tag is NULL. */
- hold = nt->type.name;
- nt->type = info->type_stack->type;
- nt->type.name = hold;
- }
-
- info->type_stack->type.name = tag;
- info->type_stack->type.strdef = strdef;
- info->type_stack->type.ignorep = ignorep;
-
- return true;
-}
-
-/* Add a field to a struct. */
-
-static boolean
-ieee_struct_field (p, name, bitpos, bitsize, visibility)
- PTR p;
- const char *name;
- bfd_vma bitpos;
- bfd_vma bitsize;
- enum debug_visibility visibility;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- unsigned int size;
- boolean unsignedp;
- boolean referencep;
- boolean localp;
- unsigned int indx;
- bfd_vma offset;
-
- assert (info->type_stack != NULL
- && info->type_stack->next != NULL
- && ! ieee_buffer_emptyp (&info->type_stack->next->type.strdef));
-
- /* If we are ignoring this struct definition, just pop and ignore
- the type. */
- if (info->type_stack->next->type.ignorep)
- {
- ieee_pop_unused_type (info);
- return true;
- }
-
- size = info->type_stack->type.size;
- unsignedp = info->type_stack->type.unsignedp;
- referencep = info->type_stack->type.referencep;
- localp = info->type_stack->type.localp;
- indx = ieee_pop_type (info);
-
- if (localp)
- info->type_stack->type.localp = true;
-
- if (info->type_stack->type.classdef != NULL)
- {
- unsigned int flags;
- unsigned int nindx;
-
- /* This is a class. We must add a description of this field to
- the class records we are building. */
-
- flags = ieee_vis_to_flags (visibility);
- nindx = info->type_stack->type.classdef->indx;
- if (! ieee_change_buffer (info,
- &info->type_stack->type.classdef->pmiscbuf)
- || ! ieee_write_asn (info, nindx, 'd')
- || ! ieee_write_asn (info, nindx, flags)
- || ! ieee_write_atn65 (info, nindx, name)
- || ! ieee_write_atn65 (info, nindx, name))
- return false;
- info->type_stack->type.classdef->pmisccount += 4;
-
- if (referencep)
- {
- unsigned int nindx;
-
- /* We need to output a record recording that this field is
- really of reference type. We put this on the refs field
- of classdef, so that it can be appended to the C++
- records after the class is defined. */
-
- nindx = info->name_indx;
- ++info->name_indx;
-
- if (! ieee_change_buffer (info,
- &info->type_stack->type.classdef->refs)
- || ! ieee_write_byte (info, (int) ieee_nn_record)
- || ! ieee_write_number (info, nindx)
- || ! ieee_write_id (info, "")
- || ! ieee_write_2bytes (info, (int) ieee_atn_record_enum)
- || ! ieee_write_number (info, nindx)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, 62)
- || ! ieee_write_number (info, 80)
- || ! ieee_write_number (info, 4)
- || ! ieee_write_asn (info, nindx, 'R')
- || ! ieee_write_asn (info, nindx, 3)
- || ! ieee_write_atn65 (info, nindx, info->type_stack->type.name)
- || ! ieee_write_atn65 (info, nindx, name))
- return false;
- }
- }
-
- /* If the bitsize doesn't match the expected size, we need to output
- a bitfield type. */
- if (size == 0 || bitsize == 0 || bitsize == size * 8)
- offset = bitpos / 8;
- else
- {
- if (! ieee_define_type (info, 0, unsignedp,
- info->type_stack->type.localp)
- || ! ieee_write_number (info, 'g')
- || ! ieee_write_number (info, unsignedp ? 0 : 1)
- || ! ieee_write_number (info, bitsize)
- || ! ieee_write_number (info, indx))
- return false;
- indx = ieee_pop_type (info);
- offset = bitpos;
- }
-
- /* Switch to the struct we are building in order to output this
- field definition. */
- return (ieee_change_buffer (info, &info->type_stack->type.strdef)
- && ieee_write_id (info, name)
- && ieee_write_number (info, indx)
- && ieee_write_number (info, offset));
-}
-
-/* Finish up a struct type. */
-
-static boolean
-ieee_end_struct_type (p)
- PTR p;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- struct ieee_buflist *pb;
-
- assert (info->type_stack != NULL
- && ! ieee_buffer_emptyp (&info->type_stack->type.strdef));
-
- /* If we were ignoring this struct definition because it was a
- duplicate defintion, just through away whatever bytes we have
- accumulated. Leave the type on the stack. */
- if (info->type_stack->type.ignorep)
- return true;
-
- /* If this is not a duplicate definition of this tag, then localp
- will be false, and we can put it in the global type block.
- FIXME: We should avoid outputting duplicate definitions which are
- the same. */
- if (! info->type_stack->type.localp)
- {
- /* Make sure we have started the global type block. */
- if (ieee_buffer_emptyp (&info->global_types))
- {
- if (! ieee_change_buffer (info, &info->global_types)
- || ! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 2)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, ""))
- return false;
- }
- pb = &info->global_types;
- }
- else
- {
- /* Make sure we have started the types block. */
- if (ieee_buffer_emptyp (&info->types))
- {
- if (! ieee_change_buffer (info, &info->types)
- || ! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 1)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, info->modname))
- return false;
- }
- pb = &info->types;
- }
-
- /* Append the struct definition to the types. */
- if (! ieee_append_buffer (info, pb, &info->type_stack->type.strdef)
- || ! ieee_init_buffer (info, &info->type_stack->type.strdef))
- return false;
-
- /* Leave the struct on the type stack. */
-
- return true;
-}
-
-/* Start a class type. */
-
-static boolean
-ieee_start_class_type (p, tag, id, structp, size, vptr, ownvptr)
- PTR p;
- const char *tag;
- unsigned int id;
- boolean structp;
- unsigned int size;
- boolean vptr;
- boolean ownvptr;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- const char *vclass;
- struct ieee_buflist pmiscbuf;
- unsigned int indx;
- struct ieee_type_class *classdef;
-
- /* A C++ class is output as a C++ struct along with a set of pmisc
- records describing the class. */
-
- /* We need to have a name so that we can associate the struct and
- the class. */
- if (tag == NULL)
- {
- char *t;
-
- t = (char *) xmalloc (20);
- sprintf (t, "__anon%u", id);
- tag = t;
- }
-
- /* We can't write out the virtual table information until we have
- finished the class, because we don't know the virtual table size.
- We get the size from the largest voffset we see. */
- vclass = NULL;
- if (vptr && ! ownvptr)
- {
- vclass = info->type_stack->type.name;
- assert (vclass != NULL);
- /* We don't call ieee_pop_unused_type, since the class should
- get defined. */
- (void) ieee_pop_type (info);
- }
-
- if (! ieee_start_struct_type (p, tag, id, structp, size))
- return false;
-
- indx = info->name_indx;
- ++info->name_indx;
-
- /* We write out pmisc records into the classdef field. We will
- write out the pmisc start after we know the number of records we
- need. */
- if (! ieee_init_buffer (info, &pmiscbuf)
- || ! ieee_change_buffer (info, &pmiscbuf)
- || ! ieee_write_asn (info, indx, 'T')
- || ! ieee_write_asn (info, indx, structp ? 'o' : 'u')
- || ! ieee_write_atn65 (info, indx, tag))
- return false;
-
- classdef = (struct ieee_type_class *) xmalloc (sizeof *classdef);
- memset (classdef, 0, sizeof *classdef);
-
- classdef->indx = indx;
- classdef->pmiscbuf = pmiscbuf;
- classdef->pmisccount = 3;
- classdef->vclass = vclass;
- classdef->ownvptr = ownvptr;
-
- info->type_stack->type.classdef = classdef;
-
- return true;
-}
-
-/* Add a static member to a class. */
-
-static boolean
-ieee_class_static_member (p, name, physname, visibility)
- PTR p;
- const char *name;
- const char *physname;
- enum debug_visibility visibility;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- unsigned int flags;
- unsigned int nindx;
-
- /* We don't care about the type. Hopefully there will be a call to
- ieee_variable declaring the physical name and the type, since
- that is where an IEEE consumer must get the type. */
- ieee_pop_unused_type (info);
-
- assert (info->type_stack != NULL
- && info->type_stack->type.classdef != NULL);
-
- flags = ieee_vis_to_flags (visibility);
- flags |= CXXFLAGS_STATIC;
-
- nindx = info->type_stack->type.classdef->indx;
-
- if (! ieee_change_buffer (info, &info->type_stack->type.classdef->pmiscbuf)
- || ! ieee_write_asn (info, nindx, 'd')
- || ! ieee_write_asn (info, nindx, flags)
- || ! ieee_write_atn65 (info, nindx, name)
- || ! ieee_write_atn65 (info, nindx, physname))
- return false;
- info->type_stack->type.classdef->pmisccount += 4;
-
- return true;
-}
-
-/* Add a base class to a class. */
-
-static boolean
-ieee_class_baseclass (p, bitpos, virtual, visibility)
- PTR p;
- bfd_vma bitpos;
- boolean virtual;
- enum debug_visibility visibility;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- const char *bname;
- boolean localp;
- unsigned int bindx;
- char *fname;
- unsigned int flags;
- unsigned int nindx;
-
- assert (info->type_stack != NULL
- && info->type_stack->type.name != NULL
- && info->type_stack->next != NULL
- && info->type_stack->next->type.classdef != NULL
- && ! ieee_buffer_emptyp (&info->type_stack->next->type.strdef));
-
- bname = info->type_stack->type.name;
- localp = info->type_stack->type.localp;
- bindx = ieee_pop_type (info);
-
- /* We are currently defining both a struct and a class. We must
- write out a field definition in the struct which holds the base
- class. The stabs debugging reader will create a field named
- _vb$CLASS for a virtual base class, so we just use that. FIXME:
- we should not depend upon a detail of stabs debugging. */
- if (virtual)
- {
- fname = (char *) xmalloc (strlen (bname) + sizeof "_vb$");
- sprintf (fname, "_vb$%s", bname);
- flags = BASEFLAGS_VIRTUAL;
- }
- else
- {
- if (localp)
- info->type_stack->type.localp = true;
-
- fname = (char *) xmalloc (strlen (bname) + sizeof "_b$");
- sprintf (fname, "_b$%s", bname);
-
- if (! ieee_change_buffer (info, &info->type_stack->type.strdef)
- || ! ieee_write_id (info, fname)
- || ! ieee_write_number (info, bindx)
- || ! ieee_write_number (info, bitpos / 8))
- return false;
- flags = 0;
- }
-
- if (visibility == DEBUG_VISIBILITY_PRIVATE)
- flags |= BASEFLAGS_PRIVATE;
-
- nindx = info->type_stack->type.classdef->indx;
-
- if (! ieee_change_buffer (info, &info->type_stack->type.classdef->pmiscbuf)
- || ! ieee_write_asn (info, nindx, 'b')
- || ! ieee_write_asn (info, nindx, flags)
- || ! ieee_write_atn65 (info, nindx, bname)
- || ! ieee_write_asn (info, nindx, 0)
- || ! ieee_write_atn65 (info, nindx, fname))
- return false;
- info->type_stack->type.classdef->pmisccount += 5;
-
- free (fname);
-
- return true;
-}
-
-/* Start building a method for a class. */
-
-static boolean
-ieee_class_start_method (p, name)
- PTR p;
- const char *name;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- assert (info->type_stack != NULL
- && info->type_stack->type.classdef != NULL
- && info->type_stack->type.classdef->method == NULL);
-
- info->type_stack->type.classdef->method = name;
-
- return true;
-}
-
-/* Define a new method variant, either static or not. */
-
-static boolean
-ieee_class_method_var (info, physname, visibility, staticp, constp,
- volatilep, voffset, context)
- struct ieee_handle *info;
- const char *physname;
- enum debug_visibility visibility;
- boolean staticp;
- boolean constp;
- boolean volatilep;
- bfd_vma voffset;
- boolean context;
-{
- unsigned int flags;
- unsigned int nindx;
- boolean virtual;
-
- /* We don't need the type of the method. An IEEE consumer which
- wants the type must track down the function by the physical name
- and get the type from that. */
- ieee_pop_unused_type (info);
-
- /* We don't use the context. FIXME: We probably ought to use it to
- adjust the voffset somehow, but I don't really know how. */
- if (context)
- ieee_pop_unused_type (info);
-
- assert (info->type_stack != NULL
- && info->type_stack->type.classdef != NULL
- && info->type_stack->type.classdef->method != NULL);
-
- flags = ieee_vis_to_flags (visibility);
-
- /* FIXME: We never set CXXFLAGS_OVERRIDE, CXXFLAGS_OPERATOR,
- CXXFLAGS_CTORDTOR, CXXFLAGS_CTOR, or CXXFLAGS_INLINE. */
-
- if (staticp)
- flags |= CXXFLAGS_STATIC;
- if (constp)
- flags |= CXXFLAGS_CONST;
- if (volatilep)
- flags |= CXXFLAGS_VOLATILE;
-
- nindx = info->type_stack->type.classdef->indx;
-
- virtual = context || voffset > 0;
-
- if (! ieee_change_buffer (info,
- &info->type_stack->type.classdef->pmiscbuf)
- || ! ieee_write_asn (info, nindx, virtual ? 'v' : 'm')
- || ! ieee_write_asn (info, nindx, flags)
- || ! ieee_write_atn65 (info, nindx,
- info->type_stack->type.classdef->method)
- || ! ieee_write_atn65 (info, nindx, physname))
- return false;
-
- if (virtual)
- {
- if (voffset > info->type_stack->type.classdef->voffset)
- info->type_stack->type.classdef->voffset = voffset;
- if (! ieee_write_asn (info, nindx, voffset))
- return false;
- ++info->type_stack->type.classdef->pmisccount;
- }
-
- if (! ieee_write_asn (info, nindx, 0))
- return false;
-
- info->type_stack->type.classdef->pmisccount += 5;
-
- return true;
-}
-
-/* Define a new method variant. */
-
-static boolean
-ieee_class_method_variant (p, physname, visibility, constp, volatilep,
- voffset, context)
- PTR p;
- const char *physname;
- enum debug_visibility visibility;
- boolean constp;
- boolean volatilep;
- bfd_vma voffset;
- boolean context;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- return ieee_class_method_var (info, physname, visibility, false, constp,
- volatilep, voffset, context);
-}
-
-/* Define a new static method variant. */
-
-static boolean
-ieee_class_static_method_variant (p, physname, visibility, constp, volatilep)
- PTR p;
- const char *physname;
- enum debug_visibility visibility;
- boolean constp;
- boolean volatilep;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- return ieee_class_method_var (info, physname, visibility, true, constp,
- volatilep, 0, false);
-}
-
-/* Finish up a method. */
-
-static boolean
-ieee_class_end_method (p)
- PTR p;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- assert (info->type_stack != NULL
- && info->type_stack->type.classdef != NULL
- && info->type_stack->type.classdef->method != NULL);
-
- info->type_stack->type.classdef->method = NULL;
-
- return true;
-}
-
-/* Finish up a class. */
-
-static boolean
-ieee_end_class_type (p)
- PTR p;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- unsigned int nindx;
-
- assert (info->type_stack != NULL
- && info->type_stack->type.classdef != NULL);
-
- /* If we were ignoring this class definition because it was a
- duplicate definition, just through away whatever bytes we have
- accumulated. Leave the type on the stack. */
- if (info->type_stack->type.ignorep)
- return true;
-
- nindx = info->type_stack->type.classdef->indx;
-
- /* If we have a virtual table, we can write out the information now. */
- if (info->type_stack->type.classdef->vclass != NULL
- || info->type_stack->type.classdef->ownvptr)
- {
- if (! ieee_change_buffer (info,
- &info->type_stack->type.classdef->pmiscbuf)
- || ! ieee_write_asn (info, nindx, 'z')
- || ! ieee_write_atn65 (info, nindx, "")
- || ! ieee_write_asn (info, nindx,
- info->type_stack->type.classdef->voffset))
- return false;
- if (info->type_stack->type.classdef->ownvptr)
- {
- if (! ieee_write_atn65 (info, nindx, ""))
- return false;
- }
- else
- {
- if (! ieee_write_atn65 (info, nindx,
- info->type_stack->type.classdef->vclass))
- return false;
- }
- if (! ieee_write_asn (info, nindx, 0))
- return false;
- info->type_stack->type.classdef->pmisccount += 5;
- }
-
- /* Now that we know the number of pmisc records, we can write out
- the atn62 which starts the pmisc records, and append them to the
- C++ buffers. */
-
- if (! ieee_change_buffer (info, &info->cxx)
- || ! ieee_write_byte (info, (int) ieee_nn_record)
- || ! ieee_write_number (info, nindx)
- || ! ieee_write_id (info, "")
- || ! ieee_write_2bytes (info, (int) ieee_atn_record_enum)
- || ! ieee_write_number (info, nindx)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, 62)
- || ! ieee_write_number (info, 80)
- || ! ieee_write_number (info,
- info->type_stack->type.classdef->pmisccount))
- return false;
-
- if (! ieee_append_buffer (info, &info->cxx,
- &info->type_stack->type.classdef->pmiscbuf))
- return false;
- if (! ieee_buffer_emptyp (&info->type_stack->type.classdef->refs))
- {
- if (! ieee_append_buffer (info, &info->cxx,
- &info->type_stack->type.classdef->refs))
- return false;
- }
-
- return ieee_end_struct_type (p);
-}
-
-/* Push a previously seen typedef onto the type stack. */
-
-static boolean
-ieee_typedef_type (p, name)
- PTR p;
- const char *name;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- struct ieee_name_type_hash_entry *h;
- struct ieee_name_type *nt;
-
- h = ieee_name_type_hash_lookup (&info->typedefs, name, false, false);
-
- /* h should never be NULL, since that would imply that the generic
- debugging code has asked for a typedef which it has not yet
- defined. */
- assert (h != NULL);
-
- /* We always use the most recently defined type for this name, which
- will be the first one on the list. */
-
- nt = h->types;
- if (! ieee_push_type (info, nt->type.indx, nt->type.size,
- nt->type.unsignedp, nt->type.localp))
- return false;
-
- /* Copy over any other type information we may have. */
- info->type_stack->type = nt->type;
-
- return true;
-}
-
-/* Push a tagged type onto the type stack. */
-
-static boolean
-ieee_tag_type (p, name, id, kind)
- PTR p;
- const char *name;
- unsigned int id;
- enum debug_type_kind kind;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- boolean localp;
- boolean copy;
- char ab[20];
- struct ieee_name_type_hash_entry *h;
- struct ieee_name_type *nt;
-
- if (kind == DEBUG_KIND_ENUM)
- {
- struct ieee_defined_enum *e;
-
- if (name == NULL)
- abort ();
- for (e = info->enums; e != NULL; e = e->next)
- if (e->tag != NULL && strcmp (e->tag, name) == 0)
- return ieee_push_type (info, e->indx, 0, true, false);
-
- e = (struct ieee_defined_enum *) xmalloc (sizeof *e);
- memset (e, 0, sizeof *e);
-
- e->indx = info->type_indx;
- ++info->type_indx;
- e->tag = name;
- e->defined = false;
-
- e->next = info->enums;
- info->enums = e;
-
- return ieee_push_type (info, e->indx, 0, true, false);
- }
-
- localp = false;
-
- copy = false;
- if (name == NULL)
- {
- sprintf (ab, "__anon%u", id);
- name = ab;
- copy = true;
- }
-
- h = ieee_name_type_hash_lookup (&info->tags, name, true, copy);
- if (h == NULL)
- return false;
-
- for (nt = h->types; nt != NULL; nt = nt->next)
- {
- if (nt->id == id)
- {
- if (! ieee_push_type (info, nt->type.indx, nt->type.size,
- nt->type.unsignedp, nt->type.localp))
- return false;
- /* Copy over any other type information we may have. */
- info->type_stack->type = nt->type;
- return true;
- }
-
- if (! nt->type.localp)
- {
- /* This is a duplicate of a global type, so it must be
- local. */
- localp = true;
- }
- }
-
- nt = (struct ieee_name_type *) xmalloc (sizeof *nt);
- memset (nt, 0, sizeof *nt);
-
- nt->id = id;
- nt->type.name = h->root.string;
- nt->type.indx = info->type_indx;
- nt->type.localp = localp;
- ++info->type_indx;
- nt->kind = kind;
-
- nt->next = h->types;
- h->types = nt;
-
- if (! ieee_push_type (info, nt->type.indx, 0, false, localp))
- return false;
-
- info->type_stack->type.name = h->root.string;
-
- return true;
-}
-
-/* Output a typedef. */
-
-static boolean
-ieee_typdef (p, name)
- PTR p;
- const char *name;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- struct ieee_write_type type;
- unsigned int indx;
- boolean found;
- boolean localp;
- struct ieee_name_type_hash_entry *h;
- struct ieee_name_type *nt;
-
- type = info->type_stack->type;
- indx = type.indx;
-
- /* If this is a simple builtin type using a builtin name, we don't
- want to output the typedef itself. We also want to change the
- type index to correspond to the name being used. We recognize
- names used in stabs debugging output even if they don't exactly
- correspond to the names used for the IEEE builtin types. */
- found = false;
- if (indx <= (unsigned int) builtin_bcd_float)
- {
- switch ((enum builtin_types) indx)
- {
- default:
- break;
-
- case builtin_void:
- if (strcmp (name, "void") == 0)
- found = true;
- break;
-
- case builtin_signed_char:
- case builtin_char:
- if (strcmp (name, "signed char") == 0)
- {
- indx = (unsigned int) builtin_signed_char;
- found = true;
- }
- else if (strcmp (name, "char") == 0)
- {
- indx = (unsigned int) builtin_char;
- found = true;
- }
- break;
-
- case builtin_unsigned_char:
- if (strcmp (name, "unsigned char") == 0)
- found = true;
- break;
-
- case builtin_signed_short_int:
- case builtin_short:
- case builtin_short_int:
- case builtin_signed_short:
- if (strcmp (name, "signed short int") == 0)
- {
- indx = (unsigned int) builtin_signed_short_int;
- found = true;
- }
- else if (strcmp (name, "short") == 0)
- {
- indx = (unsigned int) builtin_short;
- found = true;
- }
- else if (strcmp (name, "short int") == 0)
- {
- indx = (unsigned int) builtin_short_int;
- found = true;
- }
- else if (strcmp (name, "signed short") == 0)
- {
- indx = (unsigned int) builtin_signed_short;
- found = true;
- }
- break;
-
- case builtin_unsigned_short_int:
- case builtin_unsigned_short:
- if (strcmp (name, "unsigned short int") == 0
- || strcmp (name, "short unsigned int") == 0)
- {
- indx = builtin_unsigned_short_int;
- found = true;
- }
- else if (strcmp (name, "unsigned short") == 0)
- {
- indx = builtin_unsigned_short;
- found = true;
- }
- break;
-
- case builtin_signed_long:
- case builtin_int: /* FIXME: Size depends upon architecture. */
- case builtin_long:
- if (strcmp (name, "signed long") == 0)
- {
- indx = builtin_signed_long;
- found = true;
- }
- else if (strcmp (name, "int") == 0)
- {
- indx = builtin_int;
- found = true;
- }
- else if (strcmp (name, "long") == 0
- || strcmp (name, "long int") == 0)
- {
- indx = builtin_long;
- found = true;
- }
- break;
-
- case builtin_unsigned_long:
- case builtin_unsigned: /* FIXME: Size depends upon architecture. */
- case builtin_unsigned_int: /* FIXME: Like builtin_unsigned. */
- if (strcmp (name, "unsigned long") == 0
- || strcmp (name, "long unsigned int") == 0)
- {
- indx = builtin_unsigned_long;
- found = true;
- }
- else if (strcmp (name, "unsigned") == 0)
- {
- indx = builtin_unsigned;
- found = true;
- }
- else if (strcmp (name, "unsigned int") == 0)
- {
- indx = builtin_unsigned_int;
- found = true;
- }
- break;
-
- case builtin_signed_long_long:
- if (strcmp (name, "signed long long") == 0
- || strcmp (name, "long long int") == 0)
- found = true;
- break;
-
- case builtin_unsigned_long_long:
- if (strcmp (name, "unsigned long long") == 0
- || strcmp (name, "long long unsigned int") == 0)
- found = true;
- break;
-
- case builtin_float:
- if (strcmp (name, "float") == 0)
- found = true;
- break;
-
- case builtin_double:
- if (strcmp (name, "double") == 0)
- found = true;
- break;
-
- case builtin_long_double:
- if (strcmp (name, "long double") == 0)
- found = true;
- break;
-
- case builtin_long_long_double:
- if (strcmp (name, "long long double") == 0)
- found = true;
- break;
- }
-
- if (found)
- type.indx = indx;
- }
-
- h = ieee_name_type_hash_lookup (&info->typedefs, name, true, false);
- if (h == NULL)
- return false;
-
- /* See if we have already defined this type with this name. */
- localp = type.localp;
- for (nt = h->types; nt != NULL; nt = nt->next)
- {
- if (nt->id == indx)
- {
- /* If this is a global definition, then we don't need to
- do anything here. */
- if (! nt->type.localp)
- {
- ieee_pop_unused_type (info);
- return true;
- }
- }
- else
- {
- /* This is a duplicate definition, so make this one local. */
- localp = true;
- }
- }
-
- /* We need to add a new typedef for this type. */
-
- nt = (struct ieee_name_type *) xmalloc (sizeof *nt);
- memset (nt, 0, sizeof *nt);
- nt->id = indx;
- nt->type = type;
- nt->type.name = name;
- nt->type.localp = localp;
- nt->kind = DEBUG_KIND_ILLEGAL;
-
- nt->next = h->types;
- h->types = nt;
-
- if (found)
- {
- /* This is one of the builtin typedefs, so we don't need to
- actually define it. */
- ieee_pop_unused_type (info);
- return true;
- }
-
- indx = ieee_pop_type (info);
-
- if (! ieee_define_named_type (info, name, (unsigned int) -1, type.size,
- type.unsignedp, localp,
- (struct ieee_buflist *) NULL)
- || ! ieee_write_number (info, 'T')
- || ! ieee_write_number (info, indx))
- return false;
-
- /* Remove the type we just added to the type stack. This should not
- be ieee_pop_unused_type, since the type is used, we just don't
- need it now. */
- (void) ieee_pop_type (info);
-
- return true;
-}
-
-/* Output a tag for a type. We don't have to do anything here. */
-
-static boolean
-ieee_tag (p, name)
- PTR p;
- const char *name;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- /* This should not be ieee_pop_unused_type, since we want the type
- to be defined. */
- (void) ieee_pop_type (info);
- return true;
-}
-
-/* Output an integer constant. */
-
-static boolean
-ieee_int_constant (p, name, val)
- PTR p;
- const char *name;
- bfd_vma val;
-{
- /* FIXME. */
- return true;
-}
-
-/* Output a floating point constant. */
-
-static boolean
-ieee_float_constant (p, name, val)
- PTR p;
- const char *name;
- double val;
-{
- /* FIXME. */
- return true;
-}
-
-/* Output a typed constant. */
-
-static boolean
-ieee_typed_constant (p, name, val)
- PTR p;
- const char *name;
- bfd_vma val;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- /* FIXME. */
- ieee_pop_unused_type (info);
- return true;
-}
-
-/* Output a variable. */
-
-static boolean
-ieee_variable (p, name, kind, val)
- PTR p;
- const char *name;
- enum debug_var_kind kind;
- bfd_vma val;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- unsigned int name_indx;
- unsigned int size;
- boolean referencep;
- unsigned int type_indx;
- boolean asn;
- int refflag;
-
- size = info->type_stack->type.size;
- referencep = info->type_stack->type.referencep;
- type_indx = ieee_pop_type (info);
-
- assert (! ieee_buffer_emptyp (&info->vars));
- if (! ieee_change_buffer (info, &info->vars))
- return false;
-
- name_indx = info->name_indx;
- ++info->name_indx;
-
- /* Write out an NN and an ATN record for this variable. */
- if (! ieee_write_byte (info, (int) ieee_nn_record)
- || ! ieee_write_number (info, name_indx)
- || ! ieee_write_id (info, name)
- || ! ieee_write_2bytes (info, (int) ieee_atn_record_enum)
- || ! ieee_write_number (info, name_indx)
- || ! ieee_write_number (info, type_indx))
- return false;
- switch (kind)
- {
- default:
- abort ();
- return false;
- case DEBUG_GLOBAL:
- if (! ieee_write_number (info, 8)
- || ! ieee_add_range (info, false, val, val + size))
- return false;
- refflag = 0;
- asn = true;
- break;
- case DEBUG_STATIC:
- if (! ieee_write_number (info, 3)
- || ! ieee_add_range (info, false, val, val + size))
- return false;
- refflag = 1;
- asn = true;
- break;
- case DEBUG_LOCAL_STATIC:
- if (! ieee_write_number (info, 3)
- || ! ieee_add_range (info, false, val, val + size))
- return false;
- refflag = 2;
- asn = true;
- break;
- case DEBUG_LOCAL:
- if (! ieee_write_number (info, 1)
- || ! ieee_write_number (info, val))
- return false;
- refflag = 2;
- asn = false;
- break;
- case DEBUG_REGISTER:
- if (! ieee_write_number (info, 2)
- || ! ieee_write_number (info,
- ieee_genreg_to_regno (info->abfd, val)))
- return false;
- refflag = 2;
- asn = false;
- break;
- }
-
- if (asn)
- {
- if (! ieee_write_asn (info, name_indx, val))
- return false;
- }
-
- /* If this is really a reference type, then we just output it with
- pointer type, and must now output a C++ record indicating that it
- is really reference type. */
- if (referencep)
- {
- unsigned int nindx;
-
- nindx = info->name_indx;
- ++info->name_indx;
-
- /* If this is a global variable, we want to output the misc
- record in the C++ misc record block. Otherwise, we want to
- output it just after the variable definition, which is where
- the current buffer is. */
- if (refflag != 2)
- {
- if (! ieee_change_buffer (info, &info->cxx))
- return false;
- }
-
- if (! ieee_write_byte (info, (int) ieee_nn_record)
- || ! ieee_write_number (info, nindx)
- || ! ieee_write_id (info, "")
- || ! ieee_write_2bytes (info, (int) ieee_atn_record_enum)
- || ! ieee_write_number (info, nindx)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, 62)
- || ! ieee_write_number (info, 80)
- || ! ieee_write_number (info, 3)
- || ! ieee_write_asn (info, nindx, 'R')
- || ! ieee_write_asn (info, nindx, refflag)
- || ! ieee_write_atn65 (info, nindx, name))
- return false;
- }
-
- return true;
-}
-
-/* Start outputting information for a function. */
-
-static boolean
-ieee_start_function (p, name, global)
- PTR p;
- const char *name;
- boolean global;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- boolean referencep;
- unsigned int retindx, typeindx;
-
- referencep = info->type_stack->type.referencep;
- retindx = ieee_pop_type (info);
-
- /* Besides recording a BB4 or BB6 block, we record the type of the
- function in the BB1 typedef block. We can't write out the full
- type until we have seen all the parameters, so we accumulate it
- in info->fntype and info->fnargs. */
- if (! ieee_buffer_emptyp (&info->fntype))
- {
- /* FIXME: This might happen someday if we support nested
- functions. */
- abort ();
- }
-
- info->fnname = name;
-
- /* An attribute of 0x40 means that the push mask is unknown. */
- if (! ieee_define_named_type (info, name, (unsigned int) -1, 0, false, true,
- &info->fntype)
- || ! ieee_write_number (info, 'x')
- || ! ieee_write_number (info, 0x40)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, retindx))
- return false;
-
- typeindx = ieee_pop_type (info);
-
- if (! ieee_init_buffer (info, &info->fnargs))
- return false;
- info->fnargcount = 0;
-
- /* If the function return value is actually a reference type, we
- must add a record indicating that. */
- if (referencep)
- {
- unsigned int nindx;
-
- nindx = info->name_indx;
- ++info->name_indx;
- if (! ieee_change_buffer (info, &info->cxx)
- || ! ieee_write_byte (info, (int) ieee_nn_record)
- || ! ieee_write_number (info, nindx)
- || ! ieee_write_id (info, "")
- || ! ieee_write_2bytes (info, (int) ieee_atn_record_enum)
- || ! ieee_write_number (info, nindx)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, 62)
- || ! ieee_write_number (info, 80)
- || ! ieee_write_number (info, 3)
- || ! ieee_write_asn (info, nindx, 'R')
- || ! ieee_write_asn (info, nindx, global ? 0 : 1)
- || ! ieee_write_atn65 (info, nindx, name))
- return false;
- }
-
- assert (! ieee_buffer_emptyp (&info->vars));
- if (! ieee_change_buffer (info, &info->vars))
- return false;
-
- /* The address is written out as the first block. */
-
- ++info->block_depth;
-
- return (ieee_write_byte (info, (int) ieee_bb_record_enum)
- && ieee_write_byte (info, global ? 4 : 6)
- && ieee_write_number (info, 0)
- && ieee_write_id (info, name)
- && ieee_write_number (info, 0)
- && ieee_write_number (info, typeindx));
-}
-
-/* Add a function parameter. This will normally be called before the
- first block, so we postpone them until we see the block. */
-
-static boolean
-ieee_function_parameter (p, name, kind, val)
- PTR p;
- const char *name;
- enum debug_parm_kind kind;
- bfd_vma val;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
- struct ieee_pending_parm *m, **pm;
-
- assert (info->block_depth == 1);
-
- m = (struct ieee_pending_parm *) xmalloc (sizeof *m);
- memset (m, 0, sizeof *m);
-
- m->next = NULL;
- m->name = name;
- m->referencep = info->type_stack->type.referencep;
- m->type = ieee_pop_type (info);
- m->kind = kind;
- m->val = val;
-
- for (pm = &info->pending_parms; *pm != NULL; pm = &(*pm)->next)
- ;
- *pm = m;
-
- /* Add the type to the fnargs list. */
- if (! ieee_change_buffer (info, &info->fnargs)
- || ! ieee_write_number (info, m->type))
- return false;
- ++info->fnargcount;
-
- return true;
-}
-
-/* Output pending function parameters. */
-
-static boolean
-ieee_output_pending_parms (info)
- struct ieee_handle *info;
-{
- struct ieee_pending_parm *m;
- unsigned int refcount;
-
- refcount = 0;
- for (m = info->pending_parms; m != NULL; m = m->next)
- {
- enum debug_var_kind vkind;
-
- switch (m->kind)
- {
- default:
- abort ();
- return false;
- case DEBUG_PARM_STACK:
- case DEBUG_PARM_REFERENCE:
- vkind = DEBUG_LOCAL;
- break;
- case DEBUG_PARM_REG:
- case DEBUG_PARM_REF_REG:
- vkind = DEBUG_REGISTER;
- break;
- }
-
- if (! ieee_push_type (info, m->type, 0, false, false))
- return false;
- info->type_stack->type.referencep = m->referencep;
- if (m->referencep)
- ++refcount;
- if (! ieee_variable ((PTR) info, m->name, vkind, m->val))
- return false;
- }
-
- /* If there are any reference parameters, we need to output a
- miscellaneous record indicating them. */
- if (refcount > 0)
- {
- unsigned int nindx, varindx;
-
- /* FIXME: The MRI compiler outputs the demangled function name
- here, but we are outputting the mangled name. */
- nindx = info->name_indx;
- ++info->name_indx;
- if (! ieee_change_buffer (info, &info->vars)
- || ! ieee_write_byte (info, (int) ieee_nn_record)
- || ! ieee_write_number (info, nindx)
- || ! ieee_write_id (info, "")
- || ! ieee_write_2bytes (info, (int) ieee_atn_record_enum)
- || ! ieee_write_number (info, nindx)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, 62)
- || ! ieee_write_number (info, 80)
- || ! ieee_write_number (info, refcount + 3)
- || ! ieee_write_asn (info, nindx, 'B')
- || ! ieee_write_atn65 (info, nindx, info->fnname)
- || ! ieee_write_asn (info, nindx, 0))
- return false;
- for (m = info->pending_parms, varindx = 1;
- m != NULL;
- m = m->next, varindx++)
- {
- if (m->referencep)
- {
- if (! ieee_write_asn (info, nindx, varindx))
- return false;
- }
- }
- }
-
- m = info->pending_parms;
- while (m != NULL)
- {
- struct ieee_pending_parm *next;
-
- next = m->next;
- free (m);
- m = next;
- }
-
- info->pending_parms = NULL;
-
- return true;
-}
-
-/* Start a block. If this is the first block, we output the address
- to finish the BB4 or BB6, and then output the function parameters. */
-
-static boolean
-ieee_start_block (p, addr)
- PTR p;
- bfd_vma addr;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- if (! ieee_change_buffer (info, &info->vars))
- return false;
-
- if (info->block_depth == 1)
- {
- if (! ieee_write_number (info, addr)
- || ! ieee_output_pending_parms (info))
- return false;
- }
- else
- {
- if (! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 6)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, "")
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, addr))
- return false;
- }
-
- if (! ieee_start_range (info, addr))
- return false;
-
- ++info->block_depth;
-
- return true;
-}
-
-/* End a block. */
-
-static boolean
-ieee_end_block (p, addr)
- PTR p;
- bfd_vma addr;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- /* The address we are given is the end of the block, but IEEE seems
- to want to the address of the last byte in the block, so we
- subtract one. */
- if (! ieee_change_buffer (info, &info->vars)
- || ! ieee_write_byte (info, (int) ieee_be_record_enum)
- || ! ieee_write_number (info, addr - 1))
- return false;
-
- if (! ieee_end_range (info, addr))
- return false;
-
- --info->block_depth;
-
- if (addr > info->highaddr)
- info->highaddr = addr;
-
- return true;
-}
-
-/* End a function. */
-
-static boolean
-ieee_end_function (p)
- PTR p;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- assert (info->block_depth == 1);
-
- --info->block_depth;
-
- /* Now we can finish up fntype, and add it to the typdef section.
- At this point, fntype is the 'x' type up to the argument count,
- and fnargs is the argument types. We must add the argument
- count, and we must add the level. FIXME: We don't record varargs
- functions correctly. In fact, stabs debugging does not give us
- enough information to do so. */
- if (! ieee_change_buffer (info, &info->fntype)
- || ! ieee_write_number (info, info->fnargcount)
- || ! ieee_change_buffer (info, &info->fnargs)
- || ! ieee_write_number (info, 0))
- return false;
-
- /* Make sure the typdef block has been started. */
- if (ieee_buffer_emptyp (&info->types))
- {
- if (! ieee_change_buffer (info, &info->types)
- || ! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 1)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, info->modname))
- return false;
- }
-
- if (! ieee_append_buffer (info, &info->types, &info->fntype)
- || ! ieee_append_buffer (info, &info->types, &info->fnargs))
- return false;
-
- info->fnname = NULL;
- if (! ieee_init_buffer (info, &info->fntype)
- || ! ieee_init_buffer (info, &info->fnargs))
- return false;
- info->fnargcount = 0;
-
- return true;
-}
-
-/* Record line number information. */
-
-static boolean
-ieee_lineno (p, filename, lineno, addr)
- PTR p;
- const char *filename;
- unsigned long lineno;
- bfd_vma addr;
-{
- struct ieee_handle *info = (struct ieee_handle *) p;
-
- assert (info->filename != NULL);
-
- /* The HP simulator seems to get confused when more than one line is
- listed for the same address, at least if they are in different
- files. We handle this by always listing the last line for a
- given address, since that seems to be the one that gdb uses. */
- if (info->pending_lineno_filename != NULL
- && addr != info->pending_lineno_addr)
- {
- /* Make sure we have a line number block. */
- if (! ieee_buffer_emptyp (&info->linenos))
- {
- if (! ieee_change_buffer (info, &info->linenos))
- return false;
- }
- else
- {
- info->lineno_name_indx = info->name_indx;
- ++info->name_indx;
- if (! ieee_change_buffer (info, &info->linenos)
- || ! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 5)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, info->filename)
- || ! ieee_write_byte (info, (int) ieee_nn_record)
- || ! ieee_write_number (info, info->lineno_name_indx)
- || ! ieee_write_id (info, ""))
- return false;
- info->lineno_filename = info->filename;
- }
-
- if (strcmp (info->pending_lineno_filename, info->lineno_filename) != 0)
- {
- if (strcmp (info->filename, info->lineno_filename) != 0)
- {
- /* We were not in the main file. Close the block for the
- included file. */
- if (! ieee_write_byte (info, (int) ieee_be_record_enum))
- return false;
- if (strcmp (info->filename, info->pending_lineno_filename) == 0)
- {
- /* We need a new NN record, and we aren't about to
- output one. */
- info->lineno_name_indx = info->name_indx;
- ++info->name_indx;
- if (! ieee_write_byte (info, (int) ieee_nn_record)
- || ! ieee_write_number (info, info->lineno_name_indx)
- || ! ieee_write_id (info, ""))
- return false;
- }
- }
- if (strcmp (info->filename, info->pending_lineno_filename) != 0)
- {
- /* We are not changing to the main file. Open a block for
- the new included file. */
- info->lineno_name_indx = info->name_indx;
- ++info->name_indx;
- if (! ieee_write_byte (info, (int) ieee_bb_record_enum)
- || ! ieee_write_byte (info, 5)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_id (info, info->pending_lineno_filename)
- || ! ieee_write_byte (info, (int) ieee_nn_record)
- || ! ieee_write_number (info, info->lineno_name_indx)
- || ! ieee_write_id (info, ""))
- return false;
- }
- info->lineno_filename = info->pending_lineno_filename;
- }
-
- if (! ieee_write_2bytes (info, (int) ieee_atn_record_enum)
- || ! ieee_write_number (info, info->lineno_name_indx)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_number (info, 7)
- || ! ieee_write_number (info, info->pending_lineno)
- || ! ieee_write_number (info, 0)
- || ! ieee_write_asn (info, info->lineno_name_indx,
- info->pending_lineno_addr))
- return false;
- }
-
- info->pending_lineno_filename = filename;
- info->pending_lineno = lineno;
- info->pending_lineno_addr = addr;
-
- return true;
-}
diff --git a/pstack/ieee.h b/pstack/ieee.h
deleted file mode 100644
index 56634b2819a..00000000000
--- a/pstack/ieee.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/* IEEE Standard 695-1980 "Universal Format for Object Modules" header file
- Contributed by Cygnus Support. */
-
-#define N_W_VARIABLES 8
-#define Module_Beginning 0xe0
-
-typedef struct ieee_module {
- char *processor;
- char *module_name;
-} ieee_module_begin_type;
-
-#define Address_Descriptor 0xec
-typedef struct ieee_address {
-bfd_vma number_of_bits_mau;
- bfd_vma number_of_maus_in_address;
-
- unsigned char byte_order;
-#define IEEE_LITTLE 0xcc
-#define IEEE_BIG 0xcd
-} ieee_address_descriptor_type;
-
-typedef union ieee_w_variable {
- file_ptr offset[N_W_VARIABLES];
- struct {
- file_ptr extension_record;
- file_ptr environmental_record;
- file_ptr section_part;
- file_ptr external_part;
- file_ptr debug_information_part;
- file_ptr data_part;
- file_ptr trailer_part;
- file_ptr me_record;
- } r;
-} ieee_w_variable_type;
-
-
-
-
-
-typedef enum ieee_record
-{
- ieee_number_start_enum = 0x00,
- ieee_number_end_enum=0x7f,
- ieee_number_repeat_start_enum = 0x80,
- ieee_number_repeat_end_enum = 0x88,
- ieee_number_repeat_4_enum = 0x84,
- ieee_number_repeat_3_enum = 0x83,
- ieee_number_repeat_2_enum = 0x82,
- ieee_number_repeat_1_enum = 0x81,
- ieee_module_beginning_enum = 0xe0,
- ieee_module_end_enum = 0xe1,
- ieee_extension_length_1_enum = 0xde,
- ieee_extension_length_2_enum = 0xdf,
- ieee_section_type_enum = 0xe6,
- ieee_section_alignment_enum = 0xe7,
- ieee_external_symbol_enum = 0xe8,
- ieee_comma = 0x90,
- ieee_external_reference_enum = 0xe9,
- ieee_set_current_section_enum = 0xe5,
- ieee_address_descriptor_enum = 0xec,
- ieee_load_constant_bytes_enum = 0xed,
- ieee_load_with_relocation_enum = 0xe4,
-
- ieee_variable_A_enum = 0xc1,
- ieee_variable_B_enum = 0xc2,
- ieee_variable_C_enum = 0xc3,
- ieee_variable_D_enum = 0xc4,
- ieee_variable_E_enum = 0xc5,
- ieee_variable_F_enum = 0xc6,
- ieee_variable_G_enum = 0xc7,
- ieee_variable_H_enum = 0xc8,
- ieee_variable_I_enum = 0xc9,
- ieee_variable_J_enum = 0xca,
- ieee_variable_K_enum = 0xcb,
- ieee_variable_L_enum = 0xcc,
- ieee_variable_M_enum = 0xcd,
- ieee_variable_N_enum = 0xce,
- ieee_variable_O_enum = 0xcf,
- ieee_variable_P_enum = 0xd0,
- ieee_variable_Q_enum = 0xd1,
- ieee_variable_R_enum = 0xd2,
- ieee_variable_S_enum = 0xd3,
- ieee_variable_T_enum = 0xd4,
- ieee_variable_U_enum = 0xd5,
- ieee_variable_V_enum = 0xd6,
- ieee_variable_W_enum = 0xd7,
- ieee_variable_X_enum = 0xd8,
- ieee_variable_Y_enum = 0xd9,
- ieee_variable_Z_enum = 0xda,
- ieee_function_plus_enum = 0xa5,
- ieee_function_minus_enum = 0xa6,
- ieee_function_signed_open_b_enum = 0xba,
- ieee_function_signed_close_b_enum = 0xbb,
-
- ieee_function_unsigned_open_b_enum = 0xbc,
- ieee_function_unsigned_close_b_enum = 0xbd,
-
- ieee_function_either_open_b_enum = 0xbe,
- ieee_function_either_close_b_enum = 0xbf,
- ieee_record_seperator_enum = 0xdb,
-
- ieee_e2_first_byte_enum = 0xe2,
- ieee_section_size_enum = 0xe2d3,
- ieee_physical_region_size_enum = 0xe2c1,
- ieee_region_base_address_enum = 0xe2c2,
- ieee_mau_size_enum = 0xe2c6,
- ieee_m_value_enum = 0xe2cd,
- ieee_section_base_address_enum = 0xe2cc,
- ieee_asn_record_enum = 0xe2ce,
- ieee_section_offset_enum = 0xe2d2,
- ieee_value_starting_address_enum = 0xe2c7,
- ieee_assign_value_to_variable_enum = 0xe2d7,
- ieee_set_current_pc_enum = 0xe2d0,
- ieee_value_record_enum = 0xe2c9,
- ieee_nn_record = 0xf0,
- ieee_at_record_enum = 0xf1,
- ieee_ty_record_enum = 0xf2,
- ieee_attribute_record_enum = 0xf1c9,
- ieee_atn_record_enum = 0xf1ce,
- ieee_external_reference_info_record_enum = 0xf1d8,
- ieee_weak_external_reference_enum= 0xf4,
- ieee_repeat_data_enum = 0xf7,
- ieee_bb_record_enum = 0xf8,
- ieee_be_record_enum = 0xf9
-} ieee_record_enum_type;
-
-
-typedef struct ieee_section {
- unsigned int section_index;
- unsigned int section_type;
- char *section_name;
- unsigned int parent_section_index;
- unsigned int sibling_section_index;
- unsigned int context_index;
-} ieee_section_type;
-#define IEEE_REFERENCE_BASE 11
-#define IEEE_PUBLIC_BASE 32
-#define IEEE_SECTION_NUMBER_BASE 1
diff --git a/pstack/libiberty.h b/pstack/libiberty.h
deleted file mode 100644
index ca0043d31c6..00000000000
--- a/pstack/libiberty.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/* Function declarations for libiberty.
- Written by Cygnus Support, 1994.
-
- The libiberty library provides a number of functions which are
- missing on some operating systems. We do not declare those here,
- to avoid conflicts with the system header files on operating
- systems that do support those functions. In this file we only
- declare those functions which are specific to libiberty. */
-
-#ifndef LIBIBERTY_H
-#define LIBIBERTY_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "ansidecl.h"
-
-/* Build an argument vector from a string. Allocates memory using
- malloc. Use freeargv to free the vector. */
-
-extern char **buildargv PARAMS ((char *));
-
-/* Free a vector returned by buildargv. */
-
-extern void freeargv PARAMS ((char **));
-
-/* Duplicate an argument vector. Allocates memory using malloc. Use
- freeargv to free the vector. */
-
-extern char **dupargv PARAMS ((char **));
-
-
-/* Return the last component of a path name. Note that we can't use a
- prototype here because the parameter is declared inconsistently
- across different systems, sometimes as "char *" and sometimes as
- "const char *" */
-
-#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__)
-extern char *basename PARAMS ((const char *));
-#else
-extern char *basename ();
-#endif
-
-/* Concatenate an arbitrary number of strings, up to (char *) NULL.
- Allocates memory using xmalloc. */
-
-extern char *concat PARAMS ((const char *, ...));
-
-/* Check whether two file descriptors refer to the same file. */
-
-extern int fdmatch PARAMS ((int fd1, int fd2));
-
-/* Get the amount of time the process has run, in microseconds. */
-
-extern long get_run_time PARAMS ((void));
-
-/* Choose a temporary directory to use for scratch files. */
-
-extern char *choose_temp_base PARAMS ((void));
-
-/* Allocate memory filled with spaces. Allocates using malloc. */
-
-extern const char *spaces PARAMS ((int count));
-
-/* Return the maximum error number for which strerror will return a
- string. */
-
-extern int errno_max PARAMS ((void));
-
-/* Return the name of an errno value (e.g., strerrno (EINVAL) returns
- "EINVAL"). */
-
-extern const char *strerrno PARAMS ((int));
-
-/* Given the name of an errno value, return the value. */
-
-extern int strtoerrno PARAMS ((const char *));
-
-/* ANSI's strerror(), but more robust. */
-
-extern char *xstrerror PARAMS ((int));
-
-/* Return the maximum signal number for which strsignal will return a
- string. */
-
-extern int signo_max PARAMS ((void));
-
-/* Return a signal message string for a signal number
- (e.g., strsignal (SIGHUP) returns something like "Hangup"). */
-/* This is commented out as it can conflict with one in system headers.
- We still document its existence though. */
-
-/*extern const char *strsignal PARAMS ((int));*/
-
-/* Return the name of a signal number (e.g., strsigno (SIGHUP) returns
- "SIGHUP"). */
-
-extern const char *strsigno PARAMS ((int));
-
-/* Given the name of a signal, return its number. */
-
-extern int strtosigno PARAMS ((const char *));
-
-/* Register a function to be run by xexit. Returns 0 on success. */
-
-extern int xatexit PARAMS ((void (*fn) (void)));
-
-/* Exit, calling all the functions registered with xatexit. */
-
-#ifndef __GNUC__
-extern void xexit PARAMS ((int status));
-#else
-void xexit PARAMS ((int status)) __attribute__ ((noreturn));
-#endif
-
-/* Set the program name used by xmalloc. */
-
-extern void xmalloc_set_program_name PARAMS ((const char *));
-
-/* Allocate memory without fail. If malloc fails, this will print a
- message to stderr (using the name set by xmalloc_set_program_name,
- if any) and then call xexit. */
-
-#ifdef ANSI_PROTOTYPES
-/* Get a definition for size_t. */
-#include <stddef.h>
-#endif
-extern PTR xmalloc PARAMS ((size_t));
-
-/* Reallocate memory without fail. This works like xmalloc.
-
- FIXME: We do not declare the parameter types for the same reason as
- xmalloc. */
-
-extern PTR xrealloc PARAMS ((PTR, size_t));
-
-/* Allocate memory without fail and set it to zero. This works like
- xmalloc. */
-
-extern PTR xcalloc PARAMS ((size_t, size_t));
-
-/* Copy a string into a memory buffer without fail. */
-
-extern char *xstrdup PARAMS ((const char *));
-
-/* hex character manipulation routines */
-
-#define _hex_array_size 256
-#define _hex_bad 99
-extern char _hex_value[_hex_array_size];
-extern void hex_init PARAMS ((void));
-#define hex_p(c) (hex_value (c) != _hex_bad)
-/* If you change this, note well: Some code relies on side effects in
- the argument being performed exactly once. */
-#define hex_value(c) (_hex_value[(unsigned char) (c)])
-
-/* Definitions used by the pexecute routine. */
-
-#define PEXECUTE_FIRST 1
-#define PEXECUTE_LAST 2
-#define PEXECUTE_ONE (PEXECUTE_FIRST + PEXECUTE_LAST)
-#define PEXECUTE_SEARCH 4
-#define PEXECUTE_VERBOSE 8
-
-/* Execute a program. */
-
-extern int pexecute PARAMS ((const char *, char * const *, const char *,
- const char *, char **, char **, int));
-
-/* Wait for pexecute to finish. */
-
-extern int pwait PARAMS ((int, int *, int));
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* ! defined (LIBIBERTY_H) */
diff --git a/pstack/linuxthreads.c b/pstack/linuxthreads.c
deleted file mode 100644
index 8624bd21782..00000000000
--- a/pstack/linuxthreads.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* $Header$ */
-
-/*
- * LinuxThreads specific stuff.
- */
-
-#include <sys/types.h>
-
-#include <assert.h>
-#include <limits.h> /* PTHREAD_THREADS_MAX */
-#include <pthread.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sched.h>
-
-#include "linuxthreads.h"
-
-#define AT_INT(intval) *((int32_t*)(intval))
-
-/*
- * Internal LinuxThreads variables.
- * Official interface exposed to GDB.
- */
-#if 1
-extern volatile int __pthread_threads_debug;
-extern volatile char __pthread_handles;
-extern char __pthread_initial_thread;
-/*extern volatile Elf32_Sym* __pthread_manager_thread;*/
-extern const int __pthread_sizeof_handle;
-extern const int __pthread_offsetof_descr;
-extern const int __pthread_offsetof_pid;
-extern volatile int __pthread_handles_num;
-#endif /* 0 */
-
-/*
- * Notify others.
- */
-int
-linuxthreads_notify_others( const int signotify)
-{
- const pid_t mypid = getpid();
- //const pthread_t mytid = pthread_self();
- int i;
- int threadcount = 0;
- int threads[PTHREAD_THREADS_MAX];
- int pid;
-
- TRACE_FPRINTF((stderr, "theadcount:%d\n", __pthread_handles_num));
- if (__pthread_handles_num==2) {
- /* no threads beside the initial thread */
- return 0;
- }
- /*assert(maxthreads>=3);
- assert(maxthreads>=__pthread_handles_num+2);*/
-
- // take the initial thread with us
- pid = AT_INT(&__pthread_initial_thread + __pthread_offsetof_pid);
- if (pid!=mypid && pid!=0)
- threads[threadcount++] = pid;
- // don't know why, but always handles[0]==handles[1]
- for (i=1; i<__pthread_handles_num; ++i) {
- const int descr = AT_INT(&__pthread_handles+i*__pthread_sizeof_handle+__pthread_offsetof_descr);
- assert(descr!=0);
- pid = AT_INT(descr+__pthread_offsetof_pid);
- if (pid!=mypid && pid!=0)
- threads[threadcount++] = pid;
- }
- /* TRACE_FPRINTF((stderr, "Stopping threads...")); */
- //for (i=0; i<threadcount; ++i) {
- // /* TRACE_FPRINTF((stderr, "%d ", threads[i])); */
- // fflush(stdout);
- // kill(threads[i], SIGSTOP); /* Tell thread to stop */
- //}
- /* TRACE_FPRINTF((stderr, " done!\n")); */
- for (i=0; i<threadcount; ++i) {
- TRACE_FPRINTF((stderr, "--- NOTIFYING %d\n", threads[i]));
- kill(threads[i], signotify); /* Tell to print stack trace */
- /* TRACE_FPRINTF((stderr, "--- WAITING FOR %d\n", threads[i])); */
- /*pause(); Wait for confirmation. */
- }
- for (i=0; i<threadcount; ++i)
- sched_yield();
- for (i=0; i<threadcount; ++i) {
- TRACE_FPRINTF((stderr, "--- KILLING %d\n", threads[i]));
- kill(threads[i], SIGKILL); /* Tell thread die :) */
- }
- return __pthread_handles_num;
-}
-
diff --git a/pstack/linuxthreads.h b/pstack/linuxthreads.h
deleted file mode 100644
index f5eb0f652d8..00000000000
--- a/pstack/linuxthreads.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* $Header$ */
-
-/*
- * LinuxThreads specific stuff.
- */
-
-#ifndef pstack_linuxthreads_h_
-#define pstack_linuxthreads_h_
-
-#include <pthread.h>
-#include "pstacktrace.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Tell other threads to dump stacks...
- */
-int
-linuxthreads_notify_others( const int signotify);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* pstack_linuxthreads_h_ */
-
diff --git a/pstack/pstack.c b/pstack/pstack.c
deleted file mode 100644
index 4cdd80d68b5..00000000000
--- a/pstack/pstack.c
+++ /dev/null
@@ -1,2746 +0,0 @@
-/*
- pstack.c -- asynchronous stack trace of a running process
- Copyright (c) 1999 Ross Thompson
- Author: Ross Thompson <ross@whatsis.com>
- Critical bug fix: Tim Waugh
-*/
-
-/*
- This file 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; either version 2 of the License, or
- (at your option) any later version.
-
- 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.
-*/
-
-/* RESTRICTIONS:
-
- pstack currently works only on Linux, only on an x86 machine running
- 32 bit ELF binaries (64 bit not supported). Also, for symbolic
- information, you need to use a GNU compiler to generate your
- program, and you can't strip symbols from the binaries. For thread
- information to be dumped, you have to use the debug-aware version
- of libpthread.so. (To check, run 'nm' on your libpthread.so, and
- make sure that the symbol "__pthread_threads_debug" is defined.)
-
- The details of pulling stuff out of ELF files and running through
- program images is very platform specific, and I don't want to
- try to support modes or machine types I can't test in or on.
- If someone wants to generalize this to other architectures, I would
- be happy to help and coordinate the activity. Please send me whatever
- changes you make to support these machines, so that I can own the
- central font of all truth (at least as regards this program).
-
- Thanks
-*/
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <sys/ptrace.h>
-#include <asm/ptrace.h>
-
-#include <assert.h>
-#include <fcntl.h>
-#include <link.h>
-#include <malloc.h>
-#include <string.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <signal.h>
-#include <pthread.h>
-#include <limits.h> /* PTHREAD_THREADS_MAX */
-
-
-#include <bfd.h>
-
-#include "libiberty.h"
-
-#include "pstack.h" /* just one function */
-#include "budbg.h" /* binutils stuff related to debugging symbols. */
-#include "bucomm.h" /* some common stuff */
-#include "debug.h" /* and more binutils stuff... */
-#include "budbg.h"
-#include "linuxthreads.h" /* LinuxThreads specific stuff... */
-
-
-/*
- * fprintf for file descriptors :) NOTE: we have to use fixed-size buffer :)(
- * due to malloc's unavalaibility.
- */
-int
-fdprintf( int fd,
- const char* fmt,...)
-{
- char xbuf[2048];// FIXME: enough?
- va_list ap;
- int r;
- if (fd<0)
- return -1;
- va_start(ap, fmt);
- r = vsnprintf(xbuf, sizeof(xbuf), fmt, ap);
- va_end(ap);
- return write(fd, xbuf, r);
-}
-
-int
-fdputc( char c,
- int fd)
-{
- if (fd<0)
- return -1;
- return write(fd, &c, sizeof(c));
-}
-
-int
-fdputs( const char* s,
- int fd)
-{
- if (fd<0)
- return -1;
- return write(fd, s, strlen(s));
-}
-
-/*
- * Use this function to open log file.
- * Flags: truncate on opening.
- */
-static const char* path_format = "stack-trace-on-segv-%d.txt";
-static int
-open_log_file( const pthread_t tid,
- const pid_t pid)
-{
- char fname[PATH_MAX];
- int r;
- snprintf(fname, sizeof(fname), path_format, tid, pid);
- r = open(fname, O_WRONLY|O_CREAT|O_TRUNC,
- S_IRUSR|S_IWUSR);
- if (r<0)
- perror("open");
- return r;
-}
-/*
- * Add additional debugging information for functions.
- */
-
-/*
- * Lineno
- */
-typedef struct {
- int lineno;
- bfd_vma addr;
-} debug_lineno_t;
-
-/*
- * Block - a {} pair.
- */
-typedef struct debug_block_st {
- bfd_vma begin_addr; /* where did it start */
- bfd_vma end_addr; /* where did it end */
- struct debug_block_st* parent;
- struct debug_block_st* childs;
- int childs_count;
-} debug_block_t;
-
-/*
- * Function parameter.
- */
-typedef struct {
- bfd_vma offset; /* Offset in the stack */
- const char* name; /* And name. */
-} debug_parameter_t;
-
-/*
- * Extra information about functions.
- */
-typedef struct {
- asymbol* symbol; /* mangled function name, addr */
- debug_lineno_t* lines;
- int lines_count;
- int max_lines_count;
- const char* name;
- const char* filename;/* a file name it occured in... */
- debug_block_t* block; /* each function has a block, or not, you know */
- debug_parameter_t* argv; /* argument types. */
- int argc;
- int max_argc;
-} debug_function_t;
-
-/* This is the structure we use as a handle for these routines. */
-struct pr_handle
-{
- /* File to print information to. */
- FILE *f;
- /* Current indentation level. */
- unsigned int indent;
- /* Type stack. */
- struct pr_stack *stack;
- /* Parameter number we are about to output. */
- int parameter;
- debug_block_t* block; /* current block */
- debug_function_t* function; /* current function */
- debug_function_t* functions; /* all functions */
- int functions_size; /* current size */
- int functions_maxsize; /* maximum size */
-};
-
-/* The type stack. */
-
-struct pr_stack
-{
- /* Next element on the stack. */
- struct pr_stack *next;
- /* This element. */
- char *type;
- /* Current visibility of fields if this is a class. */
- enum debug_visibility visibility;
- /* Name of the current method we are handling. */
- const char *method;
-};
-
-static void indent PARAMS ((struct pr_handle *));
-static boolean push_type PARAMS ((struct pr_handle *, const char *));
-static boolean prepend_type PARAMS ((struct pr_handle *, const char *));
-static boolean append_type PARAMS ((struct pr_handle *, const char *));
-static boolean substitute_type PARAMS ((struct pr_handle *, const char *));
-static boolean indent_type PARAMS ((struct pr_handle *));
-static char *pop_type PARAMS ((struct pr_handle *));
-static void print_vma PARAMS ((bfd_vma, char *, boolean, boolean));
-static boolean pr_fix_visibility
- PARAMS ((struct pr_handle *, enum debug_visibility));
-
-static boolean pr_start_compilation_unit PARAMS ((PTR, const char *));
-static boolean pr_start_source PARAMS ((PTR, const char *));
-static boolean pr_empty_type PARAMS ((PTR));
-static boolean pr_void_type PARAMS ((PTR));
-static boolean pr_int_type PARAMS ((PTR, unsigned int, boolean));
-static boolean pr_float_type PARAMS ((PTR, unsigned int));
-static boolean pr_complex_type PARAMS ((PTR, unsigned int));
-static boolean pr_bool_type PARAMS ((PTR, unsigned int));
-static boolean pr_enum_type
- PARAMS ((PTR, const char *, const char **, bfd_signed_vma *));
-static boolean pr_pointer_type PARAMS ((PTR));
-static boolean pr_function_type PARAMS ((PTR, int, boolean));
-static boolean pr_reference_type PARAMS ((PTR));
-static boolean pr_range_type PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma));
-static boolean pr_array_type
- PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma, boolean));
-static boolean pr_set_type PARAMS ((PTR, boolean));
-static boolean pr_offset_type PARAMS ((PTR));
-static boolean pr_method_type PARAMS ((PTR, boolean, int, boolean));
-static boolean pr_const_type PARAMS ((PTR));
-static boolean pr_volatile_type PARAMS ((PTR));
-static boolean pr_start_struct_type
- PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int));
-static boolean pr_struct_field
- PARAMS ((PTR, const char *, bfd_vma, bfd_vma, enum debug_visibility));
-static boolean pr_end_struct_type PARAMS ((PTR));
-static boolean pr_start_class_type
- PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int, boolean,
- boolean));
-static boolean pr_class_static_member
- PARAMS ((PTR, const char *, const char *, enum debug_visibility));
-static boolean pr_class_baseclass
- PARAMS ((PTR, bfd_vma, boolean, enum debug_visibility));
-static boolean pr_class_start_method PARAMS ((PTR, const char *));
-static boolean pr_class_method_variant
- PARAMS ((PTR, const char *, enum debug_visibility, boolean, boolean,
- bfd_vma, boolean));
-static boolean pr_class_static_method_variant
- PARAMS ((PTR, const char *, enum debug_visibility, boolean, boolean));
-static boolean pr_class_end_method PARAMS ((PTR));
-static boolean pr_end_class_type PARAMS ((PTR));
-static boolean pr_typedef_type PARAMS ((PTR, const char *));
-static boolean pr_tag_type
- PARAMS ((PTR, const char *, unsigned int, enum debug_type_kind));
-static boolean pr_typdef PARAMS ((PTR, const char *));
-static boolean pr_tag PARAMS ((PTR, const char *));
-static boolean pr_int_constant PARAMS ((PTR, const char *, bfd_vma));
-static boolean pr_float_constant PARAMS ((PTR, const char *, double));
-static boolean pr_typed_constant PARAMS ((PTR, const char *, bfd_vma));
-static boolean pr_variable
- PARAMS ((PTR, const char *, enum debug_var_kind, bfd_vma));
-static boolean pr_start_function PARAMS ((PTR, const char *, boolean));
-static boolean pr_function_parameter
- PARAMS ((PTR, const char *, enum debug_parm_kind, bfd_vma));
-static boolean pr_start_block PARAMS ((PTR, bfd_vma));
-static boolean pr_end_block PARAMS ((PTR, bfd_vma));
-static boolean pr_end_function PARAMS ((PTR));
-static boolean pr_lineno PARAMS ((PTR, const char *, unsigned long, bfd_vma));
-
-static const struct debug_write_fns pr_fns =
-{
- pr_start_compilation_unit,
- pr_start_source,
- pr_empty_type,
- pr_void_type,
- pr_int_type,
- pr_float_type,
- pr_complex_type,
- pr_bool_type,
- pr_enum_type,
- pr_pointer_type,
- pr_function_type,
- pr_reference_type,
- pr_range_type,
- pr_array_type,
- pr_set_type,
- pr_offset_type,
- pr_method_type,
- pr_const_type,
- pr_volatile_type,
- pr_start_struct_type,
- pr_struct_field,
- pr_end_struct_type,
- pr_start_class_type,
- pr_class_static_member,
- pr_class_baseclass,
- pr_class_start_method,
- pr_class_method_variant,
- pr_class_static_method_variant,
- pr_class_end_method,
- pr_end_class_type,
- pr_typedef_type,
- pr_tag_type,
- pr_typdef,
- pr_tag,
- pr_int_constant,
- pr_float_constant,
- pr_typed_constant,
- pr_variable,
- pr_start_function,
- pr_function_parameter,
- pr_start_block,
- pr_end_block,
- pr_end_function,
- pr_lineno
-};
-
-
-/* Indent to the current indentation level. */
-
-static void
-indent (info)
- struct pr_handle *info;
-{
- unsigned int i;
-
- for (i = 0; i < info->indent; i++)
- TRACE_PUTC ((' ', info->f));
-}
-
-/* Push a type on the type stack. */
-
-static boolean
-push_type (info, type)
- struct pr_handle *info;
- const char *type;
-{
- struct pr_stack *n;
-
- if (type == NULL)
- return false;
-
- n = (struct pr_stack *) xmalloc (sizeof *n);
- memset (n, 0, sizeof *n);
-
- n->type = xstrdup (type);
- n->visibility = DEBUG_VISIBILITY_IGNORE;
- n->method = NULL;
- n->next = info->stack;
- info->stack = n;
-
- return true;
-}
-
-/* Prepend a string onto the type on the top of the type stack. */
-
-static boolean
-prepend_type (info, s)
- struct pr_handle *info;
- const char *s;
-{
- char *n;
-
- assert (info->stack != NULL);
-
- n = (char *) xmalloc (strlen (s) + strlen (info->stack->type) + 1);
- sprintf (n, "%s%s", s, info->stack->type);
- free (info->stack->type);
- info->stack->type = n;
-
- return true;
-}
-
-/* Append a string to the type on the top of the type stack. */
-
-static boolean
-append_type (info, s)
- struct pr_handle *info;
- const char *s;
-{
- unsigned int len;
-
- if (s == NULL)
- return false;
-
- assert (info->stack != NULL);
-
- len = strlen (info->stack->type);
- info->stack->type = (char *) xrealloc (info->stack->type,
- len + strlen (s) + 1);
- strcpy (info->stack->type + len, s);
-
- return true;
-}
-
-/* We use an underscore to indicate where the name should go in a type
- string. This function substitutes a string for the underscore. If
- there is no underscore, the name follows the type. */
-
-static boolean
-substitute_type (info, s)
- struct pr_handle *info;
- const char *s;
-{
- char *u;
-
- assert (info->stack != NULL);
-
- u = strchr (info->stack->type, '|');
- if (u != NULL)
- {
- char *n;
-
- n = (char *) xmalloc (strlen (info->stack->type) + strlen (s));
-
- memcpy (n, info->stack->type, u - info->stack->type);
- strcpy (n + (u - info->stack->type), s);
- strcat (n, u + 1);
-
- free (info->stack->type);
- info->stack->type = n;
-
- return true;
- }
-
- if (strchr (s, '|') != NULL
- && (strchr (info->stack->type, '{') != NULL
- || strchr (info->stack->type, '(') != NULL))
- {
- if (! prepend_type (info, "(")
- || ! append_type (info, ")"))
- return false;
- }
-
- if (*s == '\0')
- return true;
-
- return (append_type (info, " ")
- && append_type (info, s));
-}
-
-/* Indent the type at the top of the stack by appending spaces. */
-
-static boolean
-indent_type (info)
- struct pr_handle *info;
-{
- unsigned int i;
-
- for (i = 0; i < info->indent; i++)
- {
- if (! append_type (info, " "))
- return false;
- }
-
- return true;
-}
-
-/* Pop a type from the type stack. */
-
-static char *
-pop_type (info)
- struct pr_handle *info;
-{
- struct pr_stack *o;
- char *ret;
-
- assert (info->stack != NULL);
-
- o = info->stack;
- info->stack = o->next;
- ret = o->type;
- free (o);
-
- return ret;
-}
-
-/* Print a VMA value into a string. */
-
-static void
-print_vma (vma, buf, unsignedp, hexp)
- bfd_vma vma;
- char *buf;
- boolean unsignedp;
- boolean hexp;
-{
- if (sizeof (vma) <= sizeof (unsigned long))
- {
- if (hexp)
- sprintf (buf, "0x%lx", (unsigned long) vma);
- else if (unsignedp)
- sprintf (buf, "%lu", (unsigned long) vma);
- else
- sprintf (buf, "%ld", (long) vma);
- }
- else
- {
- buf[0] = '0';
- buf[1] = 'x';
- sprintf_vma (buf + 2, vma);
- }
-}
-
-/* Start a new compilation unit. */
-
-static boolean
-pr_start_compilation_unit (p, filename)
- PTR p;
- const char *filename;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
- assert (info->indent == 0);
-/*
- TRACE_FPRINTF( (info->f, "%s:\n", filename));
-*/
- return true;
-}
-
-/* Start a source file within a compilation unit. */
-
-static boolean
-pr_start_source (p, filename)
- PTR p;
- const char *filename;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
- assert (info->indent == 0);
-/*
- TRACE_FPRINTF( (info->f, " %s:\n", filename));
-*/
- return true;
-}
-
-/* Push an empty type onto the type stack. */
-
-static boolean
-pr_empty_type (p)
- PTR p;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
- return push_type (info, "<undefined>");
-}
-
-/* Push a void type onto the type stack. */
-
-static boolean
-pr_void_type (p)
- PTR p;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
- return push_type (info, "void");
-}
-
-/* Push an integer type onto the type stack. */
-
-static boolean
-pr_int_type (p, size, unsignedp)
- PTR p;
- unsigned int size;
- boolean unsignedp;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char ab[10];
-
- sprintf (ab, "%sint%d", unsignedp ? "u" : "", size * 8);
- return push_type (info, ab);
-}
-
-/* Push a floating type onto the type stack. */
-
-static boolean
-pr_float_type (p, size)
- PTR p;
- unsigned int size;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char ab[10];
-
- if (size == 4)
- return push_type (info, "float");
- else if (size == 8)
- return push_type (info, "double");
-
- sprintf (ab, "float%d", size * 8);
- return push_type (info, ab);
-}
-
-/* Push a complex type onto the type stack. */
-
-static boolean
-pr_complex_type (p, size)
- PTR p;
- unsigned int size;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
- if (! pr_float_type (p, size))
- return false;
-
- return prepend_type (info, "complex ");
-}
-
-/* Push a boolean type onto the type stack. */
-
-static boolean
-pr_bool_type (p, size)
- PTR p;
- unsigned int size;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char ab[10];
-
- sprintf (ab, "bool%d", size * 8);
-
- return push_type (info, ab);
-}
-
-/* Push an enum type onto the type stack. */
-
-static boolean
-pr_enum_type (p, tag, names, values)
- PTR p;
- const char *tag;
- const char **names;
- bfd_signed_vma *values;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- unsigned int i;
- bfd_signed_vma val;
-
- if (! push_type (info, "enum "))
- return false;
- if (tag != NULL)
- {
- if (! append_type (info, tag)
- || ! append_type (info, " "))
- return false;
- }
- if (! append_type (info, "{ "))
- return false;
-
- if (names == NULL)
- {
- if (! append_type (info, "/* undefined */"))
- return false;
- }
- else
- {
- val = 0;
- for (i = 0; names[i] != NULL; i++)
- {
- if (i > 0)
- {
- if (! append_type (info, ", "))
- return false;
- }
-
- if (! append_type (info, names[i]))
- return false;
-
- if (values[i] != val)
- {
- char ab[20];
-
- print_vma (values[i], ab, false, false);
- if (! append_type (info, " = ")
- || ! append_type (info, ab))
- return false;
- val = values[i];
- }
-
- ++val;
- }
- }
-
- return append_type (info, " }");
-}
-
-/* Turn the top type on the stack into a pointer. */
-
-static boolean
-pr_pointer_type (p)
- PTR p;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *s;
-
- assert (info->stack != NULL);
-
- s = strchr (info->stack->type, '|');
- if (s != NULL && s[1] == '[')
- return substitute_type (info, "(*|)");
- return substitute_type (info, "*|");
-}
-
-/* Turn the top type on the stack into a function returning that type. */
-
-static boolean
-pr_function_type (p, argcount, varargs)
- PTR p;
- int argcount;
- boolean varargs;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char **arg_types;
- unsigned int len;
- char *s;
-
- assert (info->stack != NULL);
-
- len = 10;
-
- if (argcount <= 0)
- {
- arg_types = NULL;
- len += 15;
- }
- else
- {
- int i;
-
- arg_types = (char **) xmalloc (argcount * sizeof *arg_types);
- for (i = argcount - 1; i >= 0; i--)
- {
- if (! substitute_type (info, ""))
- return false;
- arg_types[i] = pop_type (info);
- if (arg_types[i] == NULL)
- return false;
- len += strlen (arg_types[i]) + 2;
- }
- if (varargs)
- len += 5;
- }
-
- /* Now the return type is on the top of the stack. */
-
- s = (char *) xmalloc (len);
- strcpy (s, "(|) (");
-
- if (argcount < 0)
- {
-#if 0
- /* Turn off unknown arguments. */
- strcat (s, "/* unknown */");
-#endif
- }
- else
- {
- int i;
-
- for (i = 0; i < argcount; i++)
- {
- if (i > 0)
- strcat (s, ", ");
- strcat (s, arg_types[i]);
- }
- if (varargs)
- {
- if (i > 0)
- strcat (s, ", ");
- strcat (s, "...");
- }
- if (argcount > 0)
- free (arg_types);
- }
-
- strcat (s, ")");
-
- if (! substitute_type (info, s))
- return false;
-
- free (s);
-
- return true;
-}
-
-/* Turn the top type on the stack into a reference to that type. */
-
-static boolean
-pr_reference_type (p)
- PTR p;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
- assert (info->stack != NULL);
-
- return substitute_type (info, "&|");
-}
-
-/* Make a range type. */
-
-static boolean
-pr_range_type (p, lower, upper)
- PTR p;
- bfd_signed_vma lower;
- bfd_signed_vma upper;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char abl[20], abu[20];
-
- assert (info->stack != NULL);
-
- if (! substitute_type (info, ""))
- return false;
-
- print_vma (lower, abl, false, false);
- print_vma (upper, abu, false, false);
-
- return (prepend_type (info, "range (")
- && append_type (info, "):")
- && append_type (info, abl)
- && append_type (info, ":")
- && append_type (info, abu));
-}
-
-/* Make an array type. */
-
-/*ARGSUSED*/
-static boolean
-pr_array_type (p, lower, upper, stringp)
- PTR p;
- bfd_signed_vma lower;
- bfd_signed_vma upper;
- boolean stringp;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *range_type;
- char abl[20], abu[20], ab[50];
-
- range_type = pop_type (info);
- if (range_type == NULL)
- return false;
-
- if (lower == 0)
- {
- if (upper == -1)
- sprintf (ab, "|[]");
- else
- {
- print_vma (upper + 1, abu, false, false);
- sprintf (ab, "|[%s]", abu);
- }
- }
- else
- {
- print_vma (lower, abl, false, false);
- print_vma (upper, abu, false, false);
- sprintf (ab, "|[%s:%s]", abl, abu);
- }
-
- if (! substitute_type (info, ab))
- return false;
-
- if (strcmp (range_type, "int") != 0)
- {
- if (! append_type (info, ":")
- || ! append_type (info, range_type))
- return false;
- }
-
- if (stringp)
- {
- if (! append_type (info, " /* string */"))
- return false;
- }
-
- return true;
-}
-
-/* Make a set type. */
-
-/*ARGSUSED*/
-static boolean
-pr_set_type (p, bitstringp)
- PTR p;
- boolean bitstringp;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
- if (! substitute_type (info, ""))
- return false;
-
- if (! prepend_type (info, "set { ")
- || ! append_type (info, " }"))
- return false;
-
- if (bitstringp)
- {
- if (! append_type (info, "/* bitstring */"))
- return false;
- }
-
- return true;
-}
-
-/* Make an offset type. */
-
-static boolean
-pr_offset_type (p)
- PTR p;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *t;
-
- if (! substitute_type (info, ""))
- return false;
-
- t = pop_type (info);
- if (t == NULL)
- return false;
-
- return (substitute_type (info, "")
- && prepend_type (info, " ")
- && prepend_type (info, t)
- && append_type (info, "::|"));
-}
-
-/* Make a method type. */
-
-static boolean
-pr_method_type (p, domain, argcount, varargs)
- PTR p;
- boolean domain;
- int argcount;
- boolean varargs;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- unsigned int len;
- char *domain_type;
- char **arg_types;
- char *s;
-
- len = 10;
-
- if (! domain)
- domain_type = NULL;
- else
- {
- if (! substitute_type (info, ""))
- return false;
- domain_type = pop_type (info);
- if (domain_type == NULL)
- return false;
- if (strncmp (domain_type, "class ", sizeof "class " - 1) == 0
- && strchr (domain_type + sizeof "class " - 1, ' ') == NULL)
- domain_type += sizeof "class " - 1;
- else if (strncmp (domain_type, "union class ",
- sizeof "union class ") == 0
- && (strchr (domain_type + sizeof "union class " - 1, ' ')
- == NULL))
- domain_type += sizeof "union class " - 1;
- len += strlen (domain_type);
- }
-
- if (argcount <= 0)
- {
- arg_types = NULL;
- len += 15;
- }
- else
- {
- int i;
-
- arg_types = (char **) xmalloc (argcount * sizeof *arg_types);
- for (i = argcount - 1; i >= 0; i--)
- {
- if (! substitute_type (info, ""))
- return false;
- arg_types[i] = pop_type (info);
- if (arg_types[i] == NULL)
- return false;
- len += strlen (arg_types[i]) + 2;
- }
- if (varargs)
- len += 5;
- }
-
- /* Now the return type is on the top of the stack. */
-
- s = (char *) xmalloc (len);
- if (! domain)
- *s = '\0';
- else
- strcpy (s, domain_type);
- strcat (s, "::| (");
-
- if (argcount < 0)
- strcat (s, "/* unknown */");
- else
- {
- int i;
-
- for (i = 0; i < argcount; i++)
- {
- if (i > 0)
- strcat (s, ", ");
- strcat (s, arg_types[i]);
- }
- if (varargs)
- {
- if (i > 0)
- strcat (s, ", ");
- strcat (s, "...");
- }
- if (argcount > 0)
- free (arg_types);
- }
-
- strcat (s, ")");
-
- if (! substitute_type (info, s))
- return false;
-
- free (s);
-
- return true;
-}
-
-/* Make a const qualified type. */
-
-static boolean
-pr_const_type (p)
- PTR p;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
- return substitute_type (info, "const |");
-}
-
-/* Make a volatile qualified type. */
-
-static boolean
-pr_volatile_type (p)
- PTR p;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
- return substitute_type (info, "volatile |");
-}
-
-/* Start accumulating a struct type. */
-
-static boolean
-pr_start_struct_type (p, tag, id, structp, size)
- PTR p;
- const char *tag;
- unsigned int id;
- boolean structp;
- unsigned int size;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
- info->indent += 2;
-
- if (! push_type (info, structp ? "struct " : "union "))
- return false;
- if (tag != NULL)
- {
- if (! append_type (info, tag))
- return false;
- }
- else
- {
- char idbuf[20];
-
- sprintf (idbuf, "%%anon%u", id);
- if (! append_type (info, idbuf))
- return false;
- }
-
- if (! append_type (info, " {"))
- return false;
- if (size != 0 || tag != NULL)
- {
- char ab[30];
-
- if (! append_type (info, " /*"))
- return false;
-
- if (size != 0)
- {
- sprintf (ab, " size %u", size);
- if (! append_type (info, ab))
- return false;
- }
- if (tag != NULL)
- {
- sprintf (ab, " id %u", id);
- if (! append_type (info, ab))
- return false;
- }
- if (! append_type (info, " */"))
- return false;
- }
- if (! append_type (info, "\n"))
- return false;
-
- info->stack->visibility = DEBUG_VISIBILITY_PUBLIC;
-
- return indent_type (info);
-}
-
-/* Output the visibility of a field in a struct. */
-
-static boolean
-pr_fix_visibility (info, visibility)
- struct pr_handle *info;
- enum debug_visibility visibility;
-{
- const char *s;
- char *t;
- unsigned int len;
-
- assert (info->stack != NULL);
-
- if (info->stack->visibility == visibility)
- return true;
-
- assert (info->stack->visibility != DEBUG_VISIBILITY_IGNORE);
-
- switch (visibility)
- {
- case DEBUG_VISIBILITY_PUBLIC:
- s = "public";
- break;
- case DEBUG_VISIBILITY_PRIVATE:
- s = "private";
- break;
- case DEBUG_VISIBILITY_PROTECTED:
- s = "protected";
- break;
- case DEBUG_VISIBILITY_IGNORE:
- s = "/* ignore */";
- break;
- default:
- abort ();
- return false;
- }
-
- /* Trim off a trailing space in the struct string, to make the
- output look a bit better, then stick on the visibility string. */
-
- t = info->stack->type;
- len = strlen (t);
- assert (t[len - 1] == ' ');
- t[len - 1] = '\0';
-
- if (! append_type (info, s)
- || ! append_type (info, ":\n")
- || ! indent_type (info))
- return false;
-
- info->stack->visibility = visibility;
-
- return true;
-}
-
-/* Add a field to a struct type. */
-
-static boolean
-pr_struct_field (p, name, bitpos, bitsize, visibility)
- PTR p;
- const char *name;
- bfd_vma bitpos;
- bfd_vma bitsize;
- enum debug_visibility visibility;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char ab[20];
- char *t;
-
- if (! substitute_type (info, name))
- return false;
-
- if (! append_type (info, "; /* "))
- return false;
-
- if (bitsize != 0)
- {
- print_vma (bitsize, ab, true, false);
- if (! append_type (info, "bitsize ")
- || ! append_type (info, ab)
- || ! append_type (info, ", "))
- return false;
- }
-
- print_vma (bitpos, ab, true, false);
- if (! append_type (info, "bitpos ")
- || ! append_type (info, ab)
- || ! append_type (info, " */\n")
- || ! indent_type (info))
- return false;
-
- t = pop_type (info);
- if (t == NULL)
- return false;
-
- if (! pr_fix_visibility (info, visibility))
- return false;
-
- return append_type (info, t);
-}
-
-/* Finish a struct type. */
-
-static boolean
-pr_end_struct_type (p)
- PTR p;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *s;
-
- assert (info->stack != NULL);
- assert (info->indent >= 2);
-
- info->indent -= 2;
-
- /* Change the trailing indentation to have a close brace. */
- s = info->stack->type + strlen (info->stack->type) - 2;
- assert (s[0] == ' ' && s[1] == ' ' && s[2] == '\0');
-
- *s++ = '}';
- *s = '\0';
-
- return true;
-}
-
-/* Start a class type. */
-
-static boolean
-pr_start_class_type (p, tag, id, structp, size, vptr, ownvptr)
- PTR p;
- const char *tag;
- unsigned int id;
- boolean structp;
- unsigned int size;
- boolean vptr;
- boolean ownvptr;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *tv = NULL;
-
- info->indent += 2;
-
- if (vptr && ! ownvptr)
- {
- tv = pop_type (info);
- if (tv == NULL)
- return false;
- }
-
- if (! push_type (info, structp ? "class " : "union class "))
- return false;
- if (tag != NULL)
- {
- if (! append_type (info, tag))
- return false;
- }
- else
- {
- char idbuf[20];
-
- sprintf (idbuf, "%%anon%u", id);
- if (! append_type (info, idbuf))
- return false;
- }
-
- if (! append_type (info, " {"))
- return false;
- if (size != 0 || vptr || ownvptr || tag != NULL)
- {
- if (! append_type (info, " /*"))
- return false;
-
- if (size != 0)
- {
- char ab[20];
-
- sprintf (ab, "%u", size);
- if (! append_type (info, " size ")
- || ! append_type (info, ab))
- return false;
- }
-
- if (vptr)
- {
- if (! append_type (info, " vtable "))
- return false;
- if (ownvptr)
- {
- if (! append_type (info, "self "))
- return false;
- }
- else
- {
- if (! append_type (info, tv)
- || ! append_type (info, " "))
- return false;
- }
- }
-
- if (tag != NULL)
- {
- char ab[30];
-
- sprintf (ab, " id %u", id);
- if (! append_type (info, ab))
- return false;
- }
-
- if (! append_type (info, " */"))
- return false;
- }
-
- info->stack->visibility = DEBUG_VISIBILITY_PRIVATE;
-
- return (append_type (info, "\n")
- && indent_type (info));
-}
-
-/* Add a static member to a class. */
-
-static boolean
-pr_class_static_member (p, name, physname, visibility)
- PTR p;
- const char *name;
- const char *physname;
- enum debug_visibility visibility;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *t;
-
- if (! substitute_type (info, name))
- return false;
-
- if (! prepend_type (info, "static ")
- || ! append_type (info, "; /* ")
- || ! append_type (info, physname)
- || ! append_type (info, " */\n")
- || ! indent_type (info))
- return false;
-
- t = pop_type (info);
- if (t == NULL)
- return false;
-
- if (! pr_fix_visibility (info, visibility))
- return false;
-
- return append_type (info, t);
-}
-
-/* Add a base class to a class. */
-
-static boolean
-pr_class_baseclass (p, bitpos, virtual, visibility)
- PTR p;
- bfd_vma bitpos;
- boolean virtual;
- enum debug_visibility visibility;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *t;
- const char *prefix;
- char ab[20];
- char *s, *l, *n;
-
- assert (info->stack != NULL && info->stack->next != NULL);
-
- if (! substitute_type (info, ""))
- return false;
-
- t = pop_type (info);
- if (t == NULL)
- return false;
-
- if (strncmp (t, "class ", sizeof "class " - 1) == 0)
- t += sizeof "class " - 1;
-
- /* Push it back on to take advantage of the prepend_type and
- append_type routines. */
- if (! push_type (info, t))
- return false;
-
- if (virtual)
- {
- if (! prepend_type (info, "virtual "))
- return false;
- }
-
- switch (visibility)
- {
- case DEBUG_VISIBILITY_PUBLIC:
- prefix = "public ";
- break;
- case DEBUG_VISIBILITY_PROTECTED:
- prefix = "protected ";
- break;
- case DEBUG_VISIBILITY_PRIVATE:
- prefix = "private ";
- break;
- default:
- prefix = "/* unknown visibility */ ";
- break;
- }
-
- if (! prepend_type (info, prefix))
- return false;
-
- if (bitpos != 0)
- {
- print_vma (bitpos, ab, true, false);
- if (! append_type (info, " /* bitpos ")
- || ! append_type (info, ab)
- || ! append_type (info, " */"))
- return false;
- }
-
- /* Now the top of the stack is something like "public A / * bitpos
- 10 * /". The next element on the stack is something like "class
- xx { / * size 8 * /\n...". We want to substitute the top of the
- stack in before the {. */
- s = strchr (info->stack->next->type, '{');
- assert (s != NULL);
- --s;
-
- /* If there is already a ':', then we already have a baseclass, and
- we must append this one after a comma. */
- for (l = info->stack->next->type; l != s; l++)
- if (*l == ':')
- break;
- if (! prepend_type (info, l == s ? " : " : ", "))
- return false;
-
- t = pop_type (info);
- if (t == NULL)
- return false;
-
- n = (char *) xmalloc (strlen (info->stack->type) + strlen (t) + 1);
- memcpy (n, info->stack->type, s - info->stack->type);
- strcpy (n + (s - info->stack->type), t);
- strcat (n, s);
-
- free (info->stack->type);
- info->stack->type = n;
-
- free (t);
-
- return true;
-}
-
-/* Start adding a method to a class. */
-
-static boolean
-pr_class_start_method (p, name)
- PTR p;
- const char *name;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
- assert (info->stack != NULL);
- info->stack->method = name;
- return true;
-}
-
-/* Add a variant to a method. */
-
-static boolean
-pr_class_method_variant (p, physname, visibility, constp, volatilep, voffset,
- context)
- PTR p;
- const char *physname;
- enum debug_visibility visibility;
- boolean constp;
- boolean volatilep;
- bfd_vma voffset;
- boolean context;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *method_type;
- char *context_type;
-
- assert (info->stack != NULL);
- assert (info->stack->next != NULL);
-
- /* Put the const and volatile qualifiers on the type. */
- if (volatilep)
- {
- if (! append_type (info, " volatile"))
- return false;
- }
- if (constp)
- {
- if (! append_type (info, " const"))
- return false;
- }
-
- /* Stick the name of the method into its type. */
- if (! substitute_type (info,
- (context
- ? info->stack->next->next->method
- : info->stack->next->method)))
- return false;
-
- /* Get the type. */
- method_type = pop_type (info);
- if (method_type == NULL)
- return false;
-
- /* Pull off the context type if there is one. */
- if (! context)
- context_type = NULL;
- else
- {
- context_type = pop_type (info);
- if (context_type == NULL)
- return false;
- }
-
- /* Now the top of the stack is the class. */
-
- if (! pr_fix_visibility (info, visibility))
- return false;
-
- if (! append_type (info, method_type)
- || ! append_type (info, " /* ")
- || ! append_type (info, physname)
- || ! append_type (info, " "))
- return false;
- if (context || voffset != 0)
- {
- char ab[20];
-
- if (context)
- {
- if (! append_type (info, "context ")
- || ! append_type (info, context_type)
- || ! append_type (info, " "))
- return false;
- }
- print_vma (voffset, ab, true, false);
- if (! append_type (info, "voffset ")
- || ! append_type (info, ab))
- return false;
- }
-
- return (append_type (info, " */;\n")
- && indent_type (info));
-}
-
-/* Add a static variant to a method. */
-
-static boolean
-pr_class_static_method_variant (p, physname, visibility, constp, volatilep)
- PTR p;
- const char *physname;
- enum debug_visibility visibility;
- boolean constp;
- boolean volatilep;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *method_type;
-
- assert (info->stack != NULL);
- assert (info->stack->next != NULL);
- assert (info->stack->next->method != NULL);
-
- /* Put the const and volatile qualifiers on the type. */
- if (volatilep)
- {
- if (! append_type (info, " volatile"))
- return false;
- }
- if (constp)
- {
- if (! append_type (info, " const"))
- return false;
- }
-
- /* Mark it as static. */
- if (! prepend_type (info, "static "))
- return false;
-
- /* Stick the name of the method into its type. */
- if (! substitute_type (info, info->stack->next->method))
- return false;
-
- /* Get the type. */
- method_type = pop_type (info);
- if (method_type == NULL)
- return false;
-
- /* Now the top of the stack is the class. */
-
- if (! pr_fix_visibility (info, visibility))
- return false;
-
- return (append_type (info, method_type)
- && append_type (info, " /* ")
- && append_type (info, physname)
- && append_type (info, " */;\n")
- && indent_type (info));
-}
-
-/* Finish up a method. */
-
-static boolean
-pr_class_end_method (p)
- PTR p;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
- info->stack->method = NULL;
- return true;
-}
-
-/* Finish up a class. */
-
-static boolean
-pr_end_class_type (p)
- PTR p;
-{
- return pr_end_struct_type (p);
-}
-
-/* Push a type on the stack using a typedef name. */
-
-static boolean
-pr_typedef_type (p, name)
- PTR p;
- const char *name;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
- return push_type (info, name);
-}
-
-/* Push a type on the stack using a tag name. */
-
-static boolean
-pr_tag_type (p, name, id, kind)
- PTR p;
- const char *name;
- unsigned int id;
- enum debug_type_kind kind;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- const char *t, *tag;
- char idbuf[30];
-
- switch (kind)
- {
- case DEBUG_KIND_STRUCT:
- t = "struct ";
- break;
- case DEBUG_KIND_UNION:
- t = "union ";
- break;
- case DEBUG_KIND_ENUM:
- t = "enum ";
- break;
- case DEBUG_KIND_CLASS:
- t = "class ";
- break;
- case DEBUG_KIND_UNION_CLASS:
- t = "union class ";
- break;
- default:
- abort ();
- return false;
- }
-
- if (! push_type (info, t))
- return false;
- if (name != NULL)
- tag = name;
- else
- {
- sprintf (idbuf, "%%anon%u", id);
- tag = idbuf;
- }
-
- if (! append_type (info, tag))
- return false;
- if (name != NULL && kind != DEBUG_KIND_ENUM)
- {
- sprintf (idbuf, " /* id %u */", id);
- if (! append_type (info, idbuf))
- return false;
- }
-
- return true;
-}
-
-/* Output a typedef. */
-
-static boolean
-pr_typdef (p, name)
- PTR p;
- const char *name;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *s;
-
- if (! substitute_type (info, name))
- return false;
-
- s = pop_type (info);
- if (s == NULL)
- return false;
-/*
- indent (info);
- TRACE_FPRINTF( (info->f, "typedef %s;\n", s));
-*/
- free (s);
-
- return true;
-}
-
-/* Output a tag. The tag should already be in the string on the
- stack, so all we have to do here is print it out. */
-
-/*ARGSUSED*/
-static boolean
-pr_tag (p, name)
- PTR p;
- const char *name;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *t;
-
- t = pop_type (info);
- if (t == NULL)
- return false;
-/*
- indent (info);
- TRACE_FPRINTF( (info->f, "%s;\n", t));
-*/
- free (t);
-
- return true;
-}
-
-/* Output an integer constant. */
-
-static boolean
-pr_int_constant (p, name, val)
- PTR p;
- const char *name;
- bfd_vma val;
-{
-/*
- struct pr_handle *info = (struct pr_handle *) p;
- char ab[20];
- indent (info);
- print_vma (val, ab, false, false);
- TRACE_FPRINTF( (info->f, "const int %s = %s;\n", name, ab));
- */
- return true;
-}
-
-/* Output a floating point constant. */
-
-static boolean
-pr_float_constant (p, name, val)
- PTR p;
- const char *name;
- double val;
-{
-/*
- struct pr_handle *info = (struct pr_handle *) p;
- indent (info);
- TRACE_FPRINTF( (info->f, "const double %s = %g;\n", name, val));
- */
- return true;
-}
-
-/* Output a typed constant. */
-
-static boolean
-pr_typed_constant (p, name, val)
- PTR p;
- const char *name;
- bfd_vma val;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *t;
-
- t = pop_type (info);
- if (t == NULL)
- return false;
-/*
- char ab[20];
- indent (info);
- print_vma (val, ab, false, false);
- TRACE_FPRINTF( (info->f, "const %s %s = %s;\n", t, name, ab));
-*/
- free (t);
-
- return true;
-}
-
-/* Output a variable. */
-
-static boolean
-pr_variable (p, name, kind, val)
- PTR p;
- const char *name;
- enum debug_var_kind kind;
- bfd_vma val;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *t;
- char ab[20];
- (void)ab;
-
- if (! substitute_type (info, name))
- return false;
-
- t = pop_type (info);
- if (t == NULL)
- return false;
-
-#if 0
- indent (info);
- switch (kind)
- {
- case DEBUG_STATIC:
- case DEBUG_LOCAL_STATIC:
- TRACE_FPRINTF( (info->f, "static "));
- break;
- case DEBUG_REGISTER:
- TRACE_FPRINTF( (info->f, "register "));
- break;
- default:
- break;
- }
- print_vma (val, ab, true, true);
- TRACE_FPRINTF( (info->f, "%s /* %s */;\n", t, ab));
-#else /* 0 */
-#if 0
- if (kind==DEBUG_STATIC || kind==DEBUG_LOCAL_STATIC) {
- print_vma (val, ab, true, true);
- TRACE_FPRINTF( (info->f, "STATIC_VAR: %s /* %s */;\n", t, ab));
- }
-#endif /* 0 */
-#endif /* !0 */
-
- free (t);
-
- return true;
-}
-
-/* Start outputting a function. */
-
-static boolean
-pr_start_function (p, name, global)
- PTR p;
- const char *name;
- boolean global;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char *t;
-
- if (! substitute_type (info, name))
- return false;
-
- t = pop_type (info);
- if (t == NULL)
- return false;
-
-#if 0
- indent (info);
- if (! global)
- TRACE_FPRINTF( (info->f, "static "));
- TRACE_FPRINTF( (info->f, "%s (", t));
- info->parameter = 1;
-#else /* 0 */
- if (info->functions_size==info->functions_maxsize) {
- info->functions_maxsize *= 2;
- info->functions = xrealloc(info->functions,
- info->functions_maxsize*sizeof(debug_function_t));
- assert(info->functions!=0);
- }
- /* info->functions[info->functions_size] = xmalloc(sizeof(debug_function_t)); */
- info->function = &info->functions[info->functions_size];
- ++info->functions_size;
- info->function->symbol = NULL;
- info->function->lines = NULL;
- info->function->lines_count = 0;
- info->function->max_lines_count = 0;
- info->function->name = t;
- info->function->filename = NULL;
- info->function->block = NULL;
- info->function->argv = NULL;
- info->function->argc = 0;
- info->function->max_argc = 0;
-#endif /* !0 */
- return true;
-}
-
-/* Output a function parameter. */
-
-static boolean
-pr_function_parameter (p, name, kind, val)
- PTR p;
- const char *name;
- enum debug_parm_kind kind;
- bfd_vma val;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- debug_function_t* f = info->function;
- char *t;
- char ab[20];
- (void)ab;
-
- if (kind == DEBUG_PARM_REFERENCE
- || kind == DEBUG_PARM_REF_REG)
- {
- if (! pr_reference_type (p))
- return false;
- }
-
- if (! substitute_type (info, name))
- return false;
-
- t = pop_type (info);
- if (t == NULL)
- return false;
-
-#if 0
- if (info->parameter != 1)
- TRACE_FPRINTF( (info->f, ", "));
-
- if (kind == DEBUG_PARM_REG || kind == DEBUG_PARM_REF_REG)
- TRACE_FPRINTF( (info->f, "register "));
-
- print_vma (val, ab, true, true);
- TRACE_FPRINTF( (info->f, "%s /* %s */", t, ab));
- free (t);
- ++info->parameter;
-#else /* 0 */
- assert(f!=NULL);
- if (f->argv==NULL) {
- f->max_argc = 7; /* rarely anyone has more than that many args... */
- f->argv = xmalloc(sizeof(debug_parameter_t)*f->max_argc);
- } else if (f->argc==f->max_argc) {
- f->max_argc *= 2;
- f->argv = realloc(f->argv,sizeof(debug_parameter_t)*f->max_argc);
- }
- f->argv[f->argc].offset = val;
- f->argv[f->argc].name = t;
- ++f->argc;
-#endif /* !0 */
- return true;
-}
-
-/* Start writing out a block. */
-
-static boolean
-pr_start_block (p, addr)
- PTR p;
- bfd_vma addr;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char ab[20];
- debug_block_t* block = 0;
- (void)ab;
-#if 0
- if (info->parameter > 0)
- {
- TRACE_FPRINTF( (info->f, ")\n"));
- info->parameter = 0;
- }
- indent (info);
- print_vma (addr, ab, true, true);
- TRACE_FPRINTF( (info->f, "{ /* %s */\n", ab));
- info->indent += 2;
-#else
- if (info->block) {
- if (info->block->childs_count==0)
- info->block->childs = xmalloc(sizeof(debug_block_t));
- else
- info->block->childs = xrealloc(info->block->childs,
- info->block->childs_count*sizeof(debug_block_t));
- block = &info->block->childs[info->block->childs_count];
- } else {
- block = xmalloc(sizeof(debug_block_t));
- info->function->block = block;
- }
- block->begin_addr = addr;
- block->end_addr = 0;
- block->parent = info->block;
- block->childs = NULL;
- block->childs_count = 0;
- info->block = block;
-#endif
- return true;
-}
-
-/* Write out line number information. */
-
-static boolean
-pr_lineno (p, filename, lineno, addr)
- PTR p;
- const char *filename;
- unsigned long lineno;
- bfd_vma addr;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- char ab[20];
- debug_function_t* f = info->function;
- (void)ab;
-
-#if 0
- indent (info);
- print_vma (addr, ab, true, true);
- TRACE_FPRINTF( (info->f, "/* file %s line %lu addr %s */\n", filename, lineno, ab));
-#else /* 0 */
- if (f==NULL) /* FIXME: skips junk silently. */
- return true;
- /* assert(f!=NULL); */
- if (f->filename==NULL) {
- f->filename = filename;
- assert(f->lines==0);
- f->max_lines_count = 4;
- f->lines = xmalloc(sizeof(debug_lineno_t)*f->max_lines_count);
- }
- if (f->lines_count==f->max_lines_count) {
- f->max_lines_count *= 2;
- f->lines = xrealloc(f->lines, sizeof(debug_lineno_t)*f->max_lines_count);
- }
- f->lines[f->lines_count].lineno = lineno;
- f->lines[f->lines_count].addr = addr;
- ++f->lines_count;
-#endif /* !0 */
-
- return true;
-}
-
-/* Finish writing out a block. */
-
-static boolean
-pr_end_block (p, addr)
- PTR p;
- bfd_vma addr;
-{
- struct pr_handle *info = (struct pr_handle *) p;
-
-#if 0
- char ab[20];
-
- info->indent -= 2;
- indent (info);
- print_vma (addr, ab, true, true);
- TRACE_FPRINTF( (info->f, "} /* %s */\n", ab));
-#else /* 0 */
- assert(info->block!=0);
- info->block->end_addr = addr;
- info->block = info->block->parent;
-#endif /* !0 */
-
- return true;
-}
-
-/* Finish writing out a function. */
-
-/*ARGSUSED*/
-static boolean
-pr_end_function (p)
- PTR p;
-{
- struct pr_handle *info = (struct pr_handle *) p;
- assert(info->block==0);
- info->function = NULL;
- return true;
-}
-
-/* third parameter to segv_action. */
-/* Got it after a bit of head scratching and stack dumping. */
-typedef struct {
- u_int32_t foo1; /* +0x00 */
- u_int32_t foo2;
- u_int32_t foo3;
- u_int32_t foo4; /* usually 2 */
- u_int32_t foo5; /* +0x10 */
- u_int32_t xgs; /* always zero */
- u_int32_t xfs; /* always zero */
- u_int32_t xes; /* always es=ds=ss */
- u_int32_t xds; /* +0x20 */
- u_int32_t edi;
- u_int32_t esi;
- u_int32_t ebp;
- u_int32_t esp; /* +0x30 */
- u_int32_t ebx;
- u_int32_t edx;
- u_int32_t ecx;
- u_int32_t eax; /* +0x40 */
- u_int32_t foo11; /* usually 0xe */
- u_int32_t foo12; /* usually 0x6 */
- u_int32_t eip; /* instruction pointer */
- u_int32_t xcs; /* +0x50 */
- u_int32_t foo21; /* usually 0x2 */
- u_int32_t foo22; /* second stack pointer?! Probably. */
- u_int32_t xss;
- u_int32_t foo31; /* +0x60 */ /* usually 0x0 */
- u_int32_t foo32; /* usually 0x2 */
- u_int32_t fault_addr; /* Address which caused a fault */
- u_int32_t foo41; /* usually 0x2 */
-} signal_regs_t;
-
-signal_regs_t* ptrace_regs = 0; /* Tells my_ptrace to "ptrace" current process" */
-/*
- * my_ptrace: small wrapper around ptrace.
- * Act as normal ptrace if ptrace_regs==0.
- * Read data from current process if ptrace_regs!=0.
- */
-static int
-my_ptrace( int request,
- int pid,
- int addr,
- int data)
-{
- if (ptrace_regs==0)
- return ptrace(request, pid, addr, data);
- /* we are tracing ourselves! */
- switch (request) {
- case PTRACE_ATTACH: return 0;
- case PTRACE_CONT: return 0;
- case PTRACE_DETACH: return 0;
- case PTRACE_PEEKUSER:
- switch (addr / 4) {
- case EIP: return ptrace_regs->eip;
- case EBP: return ptrace_regs->ebp;
- default: assert(0);
- }
- case PTRACE_PEEKTEXT: /* FALLTHROUGH */
- case PTRACE_PEEKDATA: return *(int*)(addr);
- default: assert(0);
- }
- errno = 1; /* what to do here? */
- return 1; /* failed?! */
-}
-
-#define MAXARGS 6
-
-/*
- * To minimize the number of parameters.
- */
-typedef struct {
- asymbol** syms; /* Sorted! */
- int symcount;
- debug_function_t** functions;
- int functions_size;
-} symbol_data_t;
-
-/*
- * Perform a search. A binary search for a symbol.
- */
-static void
-decode_symbol( symbol_data_t* symbol_data,
- const unsigned long addr,
- char* buf,
- const int bufsize)
-{
- asymbol** syms = symbol_data->syms;
- const int symcount = symbol_data->symcount;
- int bottom = 0;
- int top = symcount - 1;
- int i;
- if (symcount==0) {
- sprintf(buf, "????");
- return;
- }
- while (top>bottom+1) {
- i = (top+bottom) / 2;
- if (bfd_asymbol_value(syms[i])==addr) {
- sprintf(buf, "%s", syms[i]->name);
- return;
- } else if (bfd_asymbol_value(syms[i]) > addr)
- top = i;
- else
- bottom = i;
- }
- i = bottom;
- if (addr<bfd_asymbol_value(syms[i]) || addr>(syms[i]->section->vma+syms[i]->section->_cooked_size))
- sprintf(buf, "????");
- else
- sprintf(buf, "%s + 0x%lx", syms[i]->name, addr-bfd_asymbol_value(syms[i]));
-}
-
-/*
- * 1. Perform a binary search for an debug_function_t.
- * 2. Fill buf/bufsize with name, parameters and lineno, if found
- * Or with '????' otherwise.
- */
-static debug_function_t*
-find_debug_function_t( symbol_data_t* symbol_data,
- const pid_t pid,
- const unsigned long fp, /* frame pointer */
- const unsigned long addr,
- char* buf, /* string buffer */
- const int bufsize)/* FIXME: not used! */
-{
- debug_function_t** syms = symbol_data->functions;
- debug_function_t* f = NULL;
- debug_block_t* block = NULL;
- debug_lineno_t* lineno = NULL;
- const int symcount = symbol_data->functions_size;
- int bottom = 0;
- int top = symcount - 1;
- int i;
- char* bufptr = buf;
-
- if (symcount==0) {
- sprintf(buf, "????");
- return NULL;
- }
- while (top>bottom+1) {
- i = (top+bottom) / 2;
- if (syms[i]->block->begin_addr==addr) {
- f = syms[i];
- break;
- } else if (syms[i]->block->begin_addr > addr)
- top = i;
- else
- if (syms[i]->block->end_addr >= addr) {
- f = syms[i];
- break;
- } else
- bottom = i;
- }
- i = bottom;
- if (f!=0)
- block = f->block;
- else {
- block = syms[i]->block;
- if (block->begin_addr>=addr && block->end_addr<=addr)
- f = syms[i];
- }
- if (f==0)
- sprintf(buf, "????");
- else {
- /*
- * Do the backtrace the GDB way...
- */
- unsigned long arg;
- /* assert(f->lines_count>0); */
- if (f->lines_count>0) {
- lineno = &f->lines[f->lines_count-1];
- for (i=1; i<f->lines_count; ++i)
- if (f->lines[i].addr>addr) {
- lineno = &f->lines[i-1];
- break;
- }
- }
- bufptr[0] = 0;
- bufptr += sprintf(bufptr, "%s+0x%lx (", f->name, addr-block->begin_addr);
- for (i=0; i<f->argc; ++i) {
- bufptr += sprintf(bufptr, "%s = ", f->argv[i].name);
- /* FIXME: better parameter printing */
- errno = 0;
- arg = my_ptrace(PTRACE_PEEKDATA, pid, fp+f->argv[i].offset, 0);
- assert(errno==0);
- bufptr += sprintf(bufptr, "0x%x", arg);
- if (i!=f->argc-1)
- bufptr += sprintf(bufptr, ", ");
- }
- if (lineno!=0)
- bufptr += sprintf(bufptr, ") at %s:%d", f->filename, lineno->lineno);
- }
- return f;
-}
-
-/*
- * Advance through the stacks and display frames as needed.
- */
-static int
-my_crawl( int pid,
- symbol_data_t* symbol_data,
- int fout)
-{
- unsigned long pc = 0;
- unsigned long fp = 0;
- unsigned long nextfp;
- unsigned long nargs;
- unsigned long i;
- unsigned long arg;
- char buf[8096]; // FIXME: enough?
- debug_function_t* f = 0;
-
- errno = 0;
-
- pc = my_ptrace(PTRACE_PEEKUSER, pid, EIP * 4, 0);
- if (!errno)
- fp = my_ptrace(PTRACE_PEEKUSER, pid, EBP * 4, 0);
-
- if (!errno) {
-#if 1
- f = find_debug_function_t(symbol_data, pid, fp, pc, buf, sizeof(buf));
- fdprintf(fout,"0x%08lx: %s", pc, buf);
- for ( ; !errno && fp; ) {
- nextfp = my_ptrace(PTRACE_PEEKDATA, pid, fp, 0);
- if (errno)
- break;
-
- if (f==0) {
- nargs = (nextfp - fp - 8) / 4;
- if (nargs > MAXARGS)
- nargs = MAXARGS;
- if (nargs > 0) {
- fdputs(" (", fout);
- for (i = 1; i <= nargs; i++) {
- arg = my_ptrace(PTRACE_PEEKDATA, pid, fp + 4 * (i + 1), 0);
- if (errno)
- break;
- fdprintf(fout,"%lx", arg);
- if (i < nargs)
- fdputs(", ", fout);
- }
- fdputc(')', fout);
- nargs = nextfp - fp - 8 - (4 * nargs);
- if (!errno && nargs > 0)
- fdprintf(fout," + %lx\n", nargs);
- else
- fdputc('\n', fout);
- } else
- fdputc('\n', fout);
- } else
- fdputc('\n', fout);
-
- if (errno || !nextfp)
- break;
- pc = my_ptrace(PTRACE_PEEKDATA, pid, fp + 4, 0);
- fp = nextfp;
- if (errno)
- break;
- f = find_debug_function_t(symbol_data, pid, fp, pc, buf, sizeof(buf));
- fdprintf(fout,"0x%08lx: %s", pc, buf);
- }
-#else /* 1 */
- decode_symbol(symbol_data, pc, buf, sizeof(buf));
- fdprintf(fout,"0x%08lx: %s", pc, buf);
- for ( ; !errno && fp; ) {
- nextfp = my_ptrace(PTRACE_PEEKDATA, pid, fp, 0);
- if (errno)
- break;
-
- nargs = (nextfp - fp - 8) / 4;
- if (nargs > MAXARGS)
- nargs = MAXARGS;
- if (nargs > 0) {
- fputs(" (", fout);
- for (i = 1; i <= nargs; i++) {
- arg = my_ptrace(PTRACE_PEEKDATA, pid, fp + 4 * (i + 1), 0);
- if (errno)
- break;
- fdprintf(fout,"%lx", arg);
- if (i < nargs)
- fputs(", ", fout);
- }
- fdputc(')', fout);
- nargs = nextfp - fp - 8 - (4 * nargs);
- if (!errno && nargs > 0)
- fdprintf(fout," + %lx\n", nargs);
- else
- fdputc('\n', fout);
- } else
- fdputc('\n', fout);
-
- if (errno || !nextfp)
- break;
- pc = my_ptrace(PTRACE_PEEKDATA, pid, fp + 4, 0);
- fp = nextfp;
- if (errno)
- break;
- decode_symbol(symbol_data, pc, buf, sizeof(buf));
- fdprintf(fout,"0x%08lx: %s", pc, buf);
- }
-#endif /* !1 */
- }
- if (errno)
- perror("my_crawl");
- return errno;
-}
-
-/* layout from /usr/src/linux/arch/i386/kernel/process.c */
-static void
-show_regs( signal_regs_t* regs,
- int fd)
-{
- /* long cr0 = 0L, cr2 = 0L, cr3 = 0L; */
-
- fdprintf(fd,"\n");
- fdprintf(fd,"FAULT ADDR: %08x\n", regs->fault_addr);
- fdprintf(fd,"EIP: %04x:[<%08x>]",0xffff & regs->xcs,regs->eip);
- if (regs->xcs & 3)
- fdprintf(fd," ESP: %04x:%08x",0xffff & regs->xss,regs->esp);
- /*fdprintf(fd," EFLAGS: %08lx\n",regs->eflags); */
- fdprintf(fd, "\n");
- fdprintf(fd,"EAX: %08x EBX: %08x ECX: %08x EDX: %08x\n",
- regs->eax,regs->ebx,regs->ecx,regs->edx);
- fdprintf(fd,"ESI: %08x EDI: %08x EBP: %08x",
- regs->esi, regs->edi, regs->ebp);
- fdprintf(fd," DS: %04x ES: %04x\n",
- 0xffff & regs->xds,0xffff & regs->xes);
- /*
- __asm__("movl %%cr0, %0": "=r" (cr0));
- __asm__("movl %%cr2, %0": "=r" (cr2));
- __asm__("movl %%cr3, %0": "=r" (cr3));
- fprintf(stderr,"CR0: %08lx CR2: %08lx CR3: %08lx\n", cr0, cr2, cr3); */
-}
-
-/*
- * Load a BFD for an executable based on PID. Return 0 on failure.
- */
-static bfd*
-load_bfd( const int pid)
-{
- char filename[512];
- bfd* abfd = 0;
-
- /* Get the contents from procfs. */
-#if 1
- sprintf(filename, "/proc/%d/exe", pid);
-#else
- sprintf(filename, "crashing");
-#endif
-
- if ((abfd = bfd_openr (filename, 0))== NULL)
- bfd_nonfatal (filename);
- else {
- char** matching;
- assert(bfd_check_format(abfd, bfd_archive)!=true);
-
- /*
- * There is no indication in BFD documentation that it should be done.
- * God knows why...
- */
- if (!bfd_check_format_matches (abfd, bfd_object, &matching)) {
- bfd_nonfatal (bfd_get_filename (abfd));
- if (bfd_get_error () == bfd_error_file_ambiguously_recognized) {
- list_matching_formats (matching);
- free (matching);
- }
- }
- }
- return abfd;
-}
-
-/*
- * Those are for qsort. We need only function addresses, so all the others don't count.
- */
-/*
- * Compare two BFD::asymbol-s.
- */
-static int
-compare_symbols(const void* ap,
- const void* bp)
-{
- const asymbol *a = *(const asymbol **)ap;
- const asymbol *b = *(const asymbol **)bp;
- if (bfd_asymbol_value (a) > bfd_asymbol_value (b))
- return 1;
- else if (bfd_asymbol_value (a) < bfd_asymbol_value (b))
- return -1;
- return 0;
-}
-
-/*
- * Compare two debug_asymbol_t-s.
- */
-static int
-compare_debug_function_t(const void* ap,
- const void* bp)
-{
- const debug_function_t *a = *(const debug_function_t **)ap;
- const debug_function_t *b = *(const debug_function_t **)bp;
- assert(a->block!=0);
- assert(b->block!=0);
- {
- const bfd_vma addr1 = a->block->begin_addr;
- const bfd_vma addr2 = b->block->begin_addr;
- if (addr1 > addr2)
- return 1;
- else if (addr2 > addr1)
- return -1;
- }
- return 0;
-}
-
-/*
- * Filter out (in place) symbols that are useless for stack tracing.
- * COUNT is the number of elements in SYMBOLS.
- * Return the number of useful symbols.
- */
-
-static long
-remove_useless_symbols( asymbol** symbols,
- long count)
-{
- asymbol** in_ptr = symbols;
- asymbol** out_ptr = symbols;
-
- while (--count >= 0) {
- asymbol *sym = *in_ptr++;
-
- if (sym->name == NULL || sym->name[0] == '\0' || sym->value==0)
- continue;
- if (sym->flags & (BSF_DEBUGGING))
- continue;
- if (bfd_is_und_section (sym->section) || bfd_is_com_section (sym->section))
- continue;
- *out_ptr++ = sym;
- }
- return out_ptr - symbols;
-}
-
-/*
- * Debugging information.
- */
-static bfd* abfd = 0;
-static PTR dhandle = 0;
-static asymbol** syms = 0;
-static long symcount = 0;
-static asymbol** sorted_syms = 0;
-static long sorted_symcount = 0;
-static debug_function_t** functions = 0;
-static int functions_size = 0;
-static int sigreport = SIGUSR1;
-static pthread_t segv_tid; /* What thread did SEGV? */
-static pid_t segv_pid;
-
-/*
- * We'll get here after a SIGSEGV. But you can install it on other signals, too :)
- * Because we are in the middle of the SIGSEGV, we are on our own. We can't do
- * any malloc(), any fopen(), nothing. The last is actually a sin. We event can't
- * fprintf(stderr,...)!!!
- */
-static void
-segv_action(int signo, siginfo_t* siginfo, void* ptr)
-{
- symbol_data_t symbol_data;
- int fd = -1;
-
- segv_pid = getpid();
- segv_tid = pthread_self();
- fd = open_log_file(segv_tid, segv_pid);
- /* signal(SIGSEGV, SIG_DFL); */
- ptrace_regs = (signal_regs_t*)ptr;
- assert(ptrace_regs!=0);
-
- /* Show user how guilty we are. */
- fdprintf(fd,"--------- SEGV in PROCESS %d, THREAD %d ---------------\n", segv_pid, pthread_self());
- show_regs(ptrace_regs, fd);
-
- /* Some form of stack trace, too. */
- fdprintf(fd, "STACK TRACE:\n");
-
- symbol_data.syms = sorted_syms;
- symbol_data.symcount = sorted_symcount;
- symbol_data.functions = functions;
- symbol_data.functions_size = functions_size;
- my_crawl(segv_pid, &symbol_data, fd);
- //fflush(stdout);
- close(fd);
- linuxthreads_notify_others(sigreport);
-}
-
-
-static void
-report_action(int signo, siginfo_t* siginfo, void* ptr)
-{
- const int pid = getpid();
- pthread_t tid = pthread_self();
- symbol_data_t symbol_data;
- int fd;
- if (pthread_equal(tid, segv_tid)) {
- /* We have already printed our stack trace... */
- return;
- }
-
- fd = open_log_file(tid, pid);
- fdprintf(fd, "REPORT: CURRENT PROCESS:%d, THREAD:%d\n", getpid(), pthread_self());
- /* signal(SIGSEGV, SIG_DFL); */
- ptrace_regs = (signal_regs_t*)ptr;
- assert(ptrace_regs!=0);
-
- /* Show user how guilty we are. */
- fdprintf(fd,"--------- STACK TRACE FOR PROCESS %d, THREAD %d ---------------\n", pid, pthread_self());
- show_regs(ptrace_regs, fd);
-
- /* Some form of stack trace, too. */
- fdprintf(fd, "STACK TRACE:\n");
-
- symbol_data.syms = sorted_syms;
- symbol_data.symcount = sorted_symcount;
- symbol_data.functions = functions;
- symbol_data.functions_size = functions_size;
- my_crawl(pid, &symbol_data, fd);
- //fflush(stdout);
- close(fd);
- /* Tell segv_thread to proceed after pause(). */
- /*pthread_kill(segv_tid, sigreport);
- kill(segv_pid, sigreport);
- pthread_cancel(tid); */
-}
-
-/*
- * Main library routine. Just call it on your program.
- */
-int
-pstack_install_segv_action( const char* path_format_)
-{
- const int pid = getpid();
- struct sigaction act;
-
- /* Store what we have to for later usage. */
- path_format = path_format_;
-
- /* We need a signal action for SIGSEGV and sigreport ! */
- sigreport = SIGUSR1;
- act.sa_handler = 0;
- sigemptyset(&act.sa_mask);
- act.sa_flags = SA_SIGINFO|SA_ONESHOT; /* Just one SIGSEGV. */
- act.sa_sigaction = segv_action;
- act.sa_restorer = NULL;
- if (sigaction(SIGSEGV, &act, NULL)!=0) {
- perror("sigaction");
- return 1;
- }
- act.sa_sigaction = report_action;
- act.sa_flags = SA_SIGINFO; /* But many sigreports. */
- if (sigaction(sigreport, &act, NULL)!=0) {
- perror("sigaction");
- return 1;
- }
-
- /* And a little setup for libiberty. */
- program_name = "crashing";
- xmalloc_set_program_name (program_name);
-
- /* Umm, and initialize BFD, too */
- bfd_init();
-#if 0
- list_supported_targets(0, stdout);
- set_default_bfd_target();
-#endif /* 0 */
-
- if ((abfd = load_bfd(pid))==0)
- fprintf(stderr, "BFD load failed..\n");
- else {
- long storage_needed= (bfd_get_file_flags(abfd) & HAS_SYMS) ?
- bfd_get_symtab_upper_bound (abfd) : 0;
- long i;
- (void)i;
-
- if (storage_needed < 0)
- fprintf(stderr, "Symbol table size estimation failure.\n");
- else if (storage_needed > 0) {
- syms = (asymbol **) xmalloc (storage_needed);
- symcount = bfd_canonicalize_symtab (abfd, syms);
-
- TRACE_FPRINTF((stderr, "TOTAL: %ld SYMBOLS.\n", symcount));
- /* We need debugging info, too! */
- if (symcount==0 || (dhandle = read_debugging_info (abfd, syms, symcount))==0)
- fprintf(stderr, "NO DEBUGGING INFORMATION FOUND.\n");
-
- /* We make a copy of syms to sort. We don't want to sort syms
- because that will screw up the relocs. */
- sorted_syms = (asymbol **) xmalloc (symcount * sizeof (asymbol *));
- memcpy (sorted_syms, syms, symcount * sizeof (asymbol *));
-
-#if 0
- for (i=0; i<symcount; ++i)
- if (syms[i]->name!=0 && strlen(syms[i]->name)>0 && syms[i]->value!=0)
- printf("%08lx T %s\n", syms[i]->section->vma + syms[i]->value, syms[i]->name);
-#endif
- sorted_symcount = remove_useless_symbols (sorted_syms, symcount);
- TRACE_FPRINTF((stderr, "SORTED: %ld SYMBOLS.\n", sorted_symcount));
-
- /* Sort the symbols into section and symbol order */
- qsort (sorted_syms, sorted_symcount, sizeof (asymbol *), compare_symbols);
-#if 0
- for (i=0; i<sorted_symcount; ++i)
- if (sorted_syms[i]->name!=0 && strlen(sorted_syms[i]->name)>0 && sorted_syms[i]->value!=0)
- printf("%08lx T %s\n", sorted_syms[i]->section->vma + sorted_syms[i]->value, sorted_syms[i]->name);
-#endif
- /* We have symbols, we need debugging info somehow sorted out. */
- if (dhandle==0) {
- fprintf(stderr, "STACK TRACE WILL BE UNCOMFORTABLE.\n");
- } else {
- /* Start collecting the debugging information.... */
- struct pr_handle info;
-
- info.f = stdout;
- info.indent = 0;
- info.stack = NULL;
- info.parameter = 0;
- info.block = NULL;
- info.function = NULL;
- info.functions_size = 0;
- info.functions_maxsize = 1000;
- info.functions = (debug_function_t*)xmalloc(sizeof(debug_function_t)*info.functions_maxsize);
- debug_write (dhandle, &pr_fns, (PTR) &info);
- TRACE_FPRINTF((stdout, "\n%d DEBUG SYMBOLS\n", info.functions_size));
- assert(info.functions_size!=0);
- functions = xmalloc(sizeof(debug_function_t*)*info.functions_size);
- functions_size = info.functions_size;
- for (i=0; i<functions_size; ++i)
- functions[i] = &info.functions[i];
- /* Sort the symbols into section and symbol order */
- qsort (functions, functions_size, sizeof(debug_function_t*),
- compare_debug_function_t);
-#if 0
- for (i=0; i<info.functions_size; ++i)
- fprintf(stdout, "%08lx T %s\n", info.functions[i].block->begin_addr, info.functions[i].name);
-#endif
- fflush(stdout);
- }
- } else /* storage_needed == 0 */
- fprintf(stderr, "NO SYMBOLS FOUND.\n");
- }
- return 0;
-}
-
-/*********************************************************************/
-/*********************************************************************/
-/*********************************************************************/
diff --git a/pstack/pstack.h b/pstack/pstack.h
deleted file mode 100644
index 4c4fad7e754..00000000000
--- a/pstack/pstack.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* $Header$ */
-
-#ifndef pstack_pstack_h_
-#define pstack_pstack_h_
-
-#include "pstacktrace.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Install the stack-trace-on-SEGV handler....
- */
-extern int
-pstack_install_segv_action( const char* path_format);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* pstack_pstack_h_ */
-
diff --git a/pstack/pstacktrace.h b/pstack/pstacktrace.h
deleted file mode 100644
index c884bcb9f87..00000000000
--- a/pstack/pstacktrace.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* $Header$ */
-
-/*
- * Debugging macros.
- */
-
-#ifndef pstacktrace_h_
-#define pstacktrace_h_
-
-#define PSTACK_DEBUG 1
-#undef PSTACK_DEBUG
-
-#ifdef PSTACK_DEBUG
-# define TRACE_PUTC(a) putc a
-# define TRACE_FPUTS(a) fputs a
-# define TRACE_FPRINTF(a) fprintf a
-#else /* PSTACK_DEBUG */
-# define TRACE_PUTC(a) (void)0
-# define TRACE_FPUTS(a) (void)0
-# define TRACE_FPRINTF(a) (void)0
-#endif /* !PSTACK_DEBUG */
-
-#endif /* pstacktrace_h_ */
-
diff --git a/pstack/rddbg.c b/pstack/rddbg.c
deleted file mode 100644
index be3dfc21c57..00000000000
--- a/pstack/rddbg.c
+++ /dev/null
@@ -1,462 +0,0 @@
-/* rddbg.c -- Read debugging information into a generic form.
- Copyright (C) 1995, 96, 1997 Free Software Foundation, Inc.
- Written by Ian Lance Taylor <ian@cygnus.com>.
-
- This file is part of GNU Binutils.
-
- 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; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
-
-/* This file reads debugging information into a generic form. This
- file knows how to dig the debugging information out of an object
- file. */
-
-#include <bfd.h>
-#include "bucomm.h"
-#include <libiberty.h>
-#include "debug.h"
-#include "budbg.h"
-
-static boolean read_section_stabs_debugging_info
- PARAMS ((bfd *, asymbol **, long, PTR, boolean *));
-static boolean read_symbol_stabs_debugging_info
- PARAMS ((bfd *, asymbol **, long, PTR, boolean *));
-static boolean read_ieee_debugging_info PARAMS ((bfd *, PTR, boolean *));
-static void save_stab PARAMS ((int, int, bfd_vma, const char *));
-static void stab_context PARAMS ((void));
-static void free_saved_stabs PARAMS ((void));
-
-/* Read debugging information from a BFD. Returns a generic debugging
- pointer. */
-
-PTR
-read_debugging_info (abfd, syms, symcount)
- bfd *abfd;
- asymbol **syms;
- long symcount;
-{
- PTR dhandle;
- boolean found;
-
- dhandle = debug_init ();
- if (dhandle == NULL)
- return NULL;
-
- if (! read_section_stabs_debugging_info (abfd, syms, symcount, dhandle,
- &found))
- return NULL;
-
- if (bfd_get_flavour (abfd) == bfd_target_aout_flavour)
- {
- if (! read_symbol_stabs_debugging_info (abfd, syms, symcount, dhandle,
- &found))
- return NULL;
- }
-
- if (bfd_get_flavour (abfd) == bfd_target_ieee_flavour)
- {
- if (! read_ieee_debugging_info (abfd, dhandle, &found))
- return NULL;
- }
-
- /* Try reading the COFF symbols if we didn't find any stabs in COFF
- sections. */
- if (! found
- && bfd_get_flavour (abfd) == bfd_target_coff_flavour
- && symcount > 0)
- {
-#if 0
-/*
- * JZ: Do we need coff?
- */
- if (! parse_coff (abfd, syms, symcount, dhandle))
-#else
- fprintf (stderr, "%s: COFF support temporarily disabled\n",
- bfd_get_filename (abfd));
- return NULL;
-#endif
- return NULL;
- found = true;
- }
-
- if (! found)
- {
- fprintf (stderr, "%s: no recognized debugging information\n",
- bfd_get_filename (abfd));
- return NULL;
- }
-
- return dhandle;
-}
-
-/* Read stabs in sections debugging information from a BFD. */
-
-static boolean
-read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound)
- bfd *abfd;
- asymbol **syms;
- long symcount;
- PTR dhandle;
- boolean *pfound;
-{
- static struct
- {
- const char *secname;
- const char *strsecname;
- } names[] = { { ".stab", ".stabstr" } };
- unsigned int i;
- PTR shandle;
-
- *pfound = false;
- shandle = NULL;
-
- for (i = 0; i < sizeof names / sizeof names[0]; i++)
- {
- asection *sec, *strsec;
-
- sec = bfd_get_section_by_name (abfd, names[i].secname);
- strsec = bfd_get_section_by_name (abfd, names[i].strsecname);
- if (sec != NULL && strsec != NULL)
- {
- bfd_size_type stabsize, strsize;
- bfd_byte *stabs, *strings;
- bfd_byte *stab;
- bfd_size_type stroff, next_stroff;
-
- stabsize = bfd_section_size (abfd, sec);
- stabs = (bfd_byte *) xmalloc (stabsize);
- if (! bfd_get_section_contents (abfd, sec, stabs, 0, stabsize))
- {
- fprintf (stderr, "%s: %s: %s\n",
- bfd_get_filename (abfd), names[i].secname,
- bfd_errmsg (bfd_get_error ()));
- return false;
- }
-
- strsize = bfd_section_size (abfd, strsec);
- strings = (bfd_byte *) xmalloc (strsize);
- if (! bfd_get_section_contents (abfd, strsec, strings, 0, strsize))
- {
- fprintf (stderr, "%s: %s: %s\n",
- bfd_get_filename (abfd), names[i].strsecname,
- bfd_errmsg (bfd_get_error ()));
- return false;
- }
-
- if (shandle == NULL)
- {
- shandle = start_stab (dhandle, abfd, true, syms, symcount);
- if (shandle == NULL)
- return false;
- }
-
- *pfound = true;
-
- stroff = 0;
- next_stroff = 0;
- for (stab = stabs; stab < stabs + stabsize; stab += 12)
- {
- bfd_size_type strx;
- int type;
- int other;
- int desc;
- bfd_vma value;
-
- /* This code presumes 32 bit values. */
-
- strx = bfd_get_32 (abfd, stab);
- type = bfd_get_8 (abfd, stab + 4);
- other = bfd_get_8 (abfd, stab + 5);
- desc = bfd_get_16 (abfd, stab + 6);
- value = bfd_get_32 (abfd, stab + 8);
-
- if (type == 0)
- {
- /* Special type 0 stabs indicate the offset to the
- next string table. */
- stroff = next_stroff;
- next_stroff += value;
- }
- else
- {
- char *f, *s;
-
- f = NULL;
- s = (char *) strings + stroff + strx;
- while (s[strlen (s) - 1] == '\\'
- && stab + 12 < stabs + stabsize)
- {
- char *p;
-
- stab += 12;
- p = s + strlen (s) - 1;
- *p = '\0';
- s = concat (s,
- ((char *) strings
- + stroff
- + bfd_get_32 (abfd, stab)),
- (const char *) NULL);
-
- /* We have to restore the backslash, because, if
- the linker is hashing stabs strings, we may
- see the same string more than once. */
- *p = '\\';
-
- if (f != NULL)
- free (f);
- f = s;
- }
-
- save_stab (type, desc, value, s);
-
- if (! parse_stab (dhandle, shandle, type, desc, value, s))
- {
-#if 0
-/*
- * JZ: skip the junk.
- */
- stab_context ();
- free_saved_stabs ();
- return false;
-#endif
- }
-
- /* Don't free f, since I think the stabs code
- expects strings to hang around. This should be
- straightened out. FIXME. */
- }
- }
-
- free_saved_stabs ();
- free (stabs);
-
- /* Don't free strings, since I think the stabs code expects
- the strings to hang around. This should be straightened
- out. FIXME. */
- }
- }
-
- if (shandle != NULL)
- {
- if (! finish_stab (dhandle, shandle))
- return false;
- }
-
- return true;
-}
-
-/* Read stabs in the symbol table. */
-
-static boolean
-read_symbol_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound)
- bfd *abfd;
- asymbol **syms;
- long symcount;
- PTR dhandle;
- boolean *pfound;
-{
- PTR shandle;
- asymbol **ps, **symend;
-
- shandle = NULL;
- symend = syms + symcount;
- for (ps = syms; ps < symend; ps++)
- {
- symbol_info i;
-
- bfd_get_symbol_info (abfd, *ps, &i);
-
- if (i.type == '-')
- {
- const char *s;
- char *f;
-
- if (shandle == NULL)
- {
- shandle = start_stab (dhandle, abfd, false, syms, symcount);
- if (shandle == NULL)
- return false;
- }
-
- *pfound = true;
-
- s = i.name;
- f = NULL;
- while (s[strlen (s) - 1] == '\\'
- && ps + 1 < symend)
- {
- char *sc, *n;
-
- ++ps;
- sc = xstrdup (s);
- sc[strlen (sc) - 1] = '\0';
- n = concat (sc, bfd_asymbol_name (*ps), (const char *) NULL);
- free (sc);
- if (f != NULL)
- free (f);
- f = n;
- s = n;
- }
-
- save_stab (i.stab_type, i.stab_desc, i.value, s);
-
- if (! parse_stab (dhandle, shandle, i.stab_type, i.stab_desc,
- i.value, s))
- {
- stab_context ();
- free_saved_stabs ();
- return false;
- }
-
- /* Don't free f, since I think the stabs code expects
- strings to hang around. This should be straightened out.
- FIXME. */
- }
- }
-
- free_saved_stabs ();
-
- if (shandle != NULL)
- {
- if (! finish_stab (dhandle, shandle))
- return false;
- }
-
- return true;
-}
-
-/* Read IEEE debugging information. */
-
-static boolean
-read_ieee_debugging_info (abfd, dhandle, pfound)
- bfd *abfd;
- PTR dhandle;
- boolean *pfound;
-{
- asection *dsec;
- bfd_size_type size;
- bfd_byte *contents;
-
- /* The BFD backend puts the debugging information into a section
- named .debug. */
-
- dsec = bfd_get_section_by_name (abfd, ".debug");
- if (dsec == NULL)
- return true;
-
- size = bfd_section_size (abfd, dsec);
- contents = (bfd_byte *) xmalloc (size);
- if (! bfd_get_section_contents (abfd, dsec, contents, 0, size))
- return false;
-
- if (! parse_ieee (dhandle, abfd, contents, size))
- return false;
-
- free (contents);
-
- *pfound = true;
-
- return true;
-}
-
-/* Record stabs strings, so that we can give some context for errors. */
-
-#define SAVE_STABS_COUNT (16)
-
-struct saved_stab
-{
- int type;
- int desc;
- bfd_vma value;
- char *string;
-};
-
-static struct saved_stab saved_stabs[SAVE_STABS_COUNT];
-static int saved_stabs_index;
-
-/* Save a stabs string. */
-
-static void
-save_stab (type, desc, value, string)
- int type;
- int desc;
- bfd_vma value;
- const char *string;
-{
- if (saved_stabs[saved_stabs_index].string != NULL)
- free (saved_stabs[saved_stabs_index].string);
- saved_stabs[saved_stabs_index].type = type;
- saved_stabs[saved_stabs_index].desc = desc;
- saved_stabs[saved_stabs_index].value = value;
- saved_stabs[saved_stabs_index].string = xstrdup (string);
- saved_stabs_index = (saved_stabs_index + 1) % SAVE_STABS_COUNT;
-}
-
-/* Provide context for an error. */
-
-static void
-stab_context ()
-{
- int i;
-
- fprintf (stderr, "Last stabs entries before error:\n");
- fprintf (stderr, "n_type n_desc n_value string\n");
-
- i = saved_stabs_index;
- do
- {
- struct saved_stab *stabp;
-
- stabp = saved_stabs + i;
- if (stabp->string != NULL)
- {
- const char *s;
-
- s = bfd_get_stab_name (stabp->type);
- if (s != NULL)
- fprintf (stderr, "%-6s", s);
- else if (stabp->type == 0)
- fprintf (stderr, "HdrSym");
- else
- fprintf (stderr, "%-6d", stabp->type);
- fprintf (stderr, " %-6d ", stabp->desc);
- fprintf_vma (stderr, stabp->value);
- if (stabp->type != 0)
- fprintf (stderr, " %s", stabp->string);
- fprintf (stderr, "\n");
- }
- i = (i + 1) % SAVE_STABS_COUNT;
- }
- while (i != saved_stabs_index);
-}
-
-/* Free the saved stab strings. */
-
-static void
-free_saved_stabs ()
-{
- int i;
-
- for (i = 0; i < SAVE_STABS_COUNT; i++)
- {
- if (saved_stabs[i].string != NULL)
- {
- free (saved_stabs[i].string);
- saved_stabs[i].string = NULL;
- }
- }
-
- saved_stabs_index = 0;
-}
diff --git a/pstack/stabs.c b/pstack/stabs.c
deleted file mode 100644
index 076231d19cb..00000000000
--- a/pstack/stabs.c
+++ /dev/null
@@ -1,5082 +0,0 @@
-/* stabs.c -- Parse stabs debugging information
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- Written by Ian Lance Taylor <ian@cygnus.com>.
-
- This file is part of GNU Binutils.
-
- 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; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
-
-/* This file contains code which parses stabs debugging information.
- The organization of this code is based on the gdb stabs reading
- code. The job it does is somewhat different, because it is not
- trying to identify the correct address for anything. */
-
-#include <stdio.h>
-#include <ctype.h>
-
-#include <bfd.h>
-#include "bucomm.h"
-#include <libiberty.h>
-#include "demangle.h"
-#include "debug.h"
-#include "budbg.h"
-
-/* Meaningless definition needs by aout64.h. FIXME. */
-#define BYTES_IN_WORD 4
-
-#include "aout/aout64.h"
-#include "aout/stab_gnu.h"
-
-/* The number of predefined XCOFF types. */
-
-#define XCOFF_TYPE_COUNT 34
-
-/* This structure is used as a handle so that the stab parsing doesn't
- need to use any static variables. */
-
-struct stab_handle
-{
- /* The BFD. */
- bfd *abfd;
- /* True if this is stabs in sections. */
- boolean sections;
- /* The symbol table. */
- asymbol **syms;
- /* The number of symbols. */
- long symcount;
- /* The accumulated file name string. */
- char *so_string;
- /* The value of the last N_SO symbol. */
- bfd_vma so_value;
- /* The value of the start of the file, so that we can handle file
- relative N_LBRAC and N_RBRAC symbols. */
- bfd_vma file_start_offset;
- /* The offset of the start of the function, so that we can handle
- function relative N_LBRAC and N_RBRAC symbols. */
- bfd_vma function_start_offset;
- /* The version number of gcc which compiled the current compilation
- unit, 0 if not compiled by gcc. */
- int gcc_compiled;
- /* Whether an N_OPT symbol was seen that was not generated by gcc,
- so that we can detect the SunPRO compiler. */
- boolean n_opt_found;
- /* The main file name. */
- char *main_filename;
- /* A stack of unfinished N_BINCL files. */
- struct bincl_file *bincl_stack;
- /* A list of finished N_BINCL files. */
- struct bincl_file *bincl_list;
- /* Whether we are inside a function or not. */
- boolean within_function;
- /* The address of the end of the function, used if we have seen an
- N_FUN symbol while in a function. This is -1 if we have not seen
- an N_FUN (the normal case). */
- bfd_vma function_end;
- /* The depth of block nesting. */
- int block_depth;
- /* List of pending variable definitions. */
- struct stab_pending_var *pending;
- /* Number of files for which we have types. */
- unsigned int files;
- /* Lists of types per file. */
- struct stab_types **file_types;
- /* Predefined XCOFF types. */
- debug_type xcoff_types[XCOFF_TYPE_COUNT];
- /* Undefined tags. */
- struct stab_tag *tags;
-};
-
-/* A list of these structures is used to hold pending variable
- definitions seen before the N_LBRAC of a block. */
-
-struct stab_pending_var
-{
- /* Next pending variable definition. */
- struct stab_pending_var *next;
- /* Name. */
- const char *name;
- /* Type. */
- debug_type type;
- /* Kind. */
- enum debug_var_kind kind;
- /* Value. */
- bfd_vma val;
-};
-
-/* A list of these structures is used to hold the types for a single
- file. */
-
-struct stab_types
-{
- /* Next set of slots for this file. */
- struct stab_types *next;
- /* Types indexed by type number. */
-#define STAB_TYPES_SLOTS (16)
- debug_type types[STAB_TYPES_SLOTS];
-};
-
-/* We keep a list of undefined tags that we encounter, so that we can
- fill them in if the tag is later defined. */
-
-struct stab_tag
-{
- /* Next undefined tag. */
- struct stab_tag *next;
- /* Tag name. */
- const char *name;
- /* Type kind. */
- enum debug_type_kind kind;
- /* Slot to hold real type when we discover it. If we don't, we fill
- in an undefined tag type. */
- debug_type slot;
- /* Indirect type we have created to point at slot. */
- debug_type type;
-};
-
-static char *savestring PARAMS ((const char *, int));
-static bfd_vma parse_number PARAMS ((const char **, boolean *));
-static void bad_stab PARAMS ((const char *));
-static void warn_stab PARAMS ((const char *, const char *));
-static boolean parse_stab_string
- PARAMS ((PTR, struct stab_handle *, int, int, bfd_vma, const char *));
-static debug_type parse_stab_type
- PARAMS ((PTR, struct stab_handle *, const char *, const char **,
- debug_type **));
-static boolean parse_stab_type_number
- PARAMS ((const char **, int *));
-static debug_type parse_stab_range_type
- PARAMS ((PTR, struct stab_handle *, const char *, const char **,
- const int *));
-static debug_type parse_stab_sun_builtin_type PARAMS ((PTR, const char **));
-static debug_type parse_stab_sun_floating_type
- PARAMS ((PTR, const char **));
-static debug_type parse_stab_enum_type PARAMS ((PTR, const char **));
-static debug_type parse_stab_struct_type
- PARAMS ((PTR, struct stab_handle *, const char *, const char **, boolean,
- const int *));
-static boolean parse_stab_baseclasses
- PARAMS ((PTR, struct stab_handle *, const char **, debug_baseclass **));
-static boolean parse_stab_struct_fields
- PARAMS ((PTR, struct stab_handle *, const char **, debug_field **,
- boolean *));
-static boolean parse_stab_cpp_abbrev
- PARAMS ((PTR, struct stab_handle *, const char **, debug_field *));
-static boolean parse_stab_one_struct_field
- PARAMS ((PTR, struct stab_handle *, const char **, const char *,
- debug_field *, boolean *));
-static boolean parse_stab_members
- PARAMS ((PTR, struct stab_handle *, const char *, const char **,
- const int *, debug_method **));
-static debug_type parse_stab_argtypes
- PARAMS ((PTR, struct stab_handle *, debug_type, const char *, const char *,
- debug_type, const char *, boolean, boolean, const char **));
-static boolean parse_stab_tilde_field
- PARAMS ((PTR, struct stab_handle *, const char **, const int *,
- debug_type *, boolean *));
-static debug_type parse_stab_array_type
- PARAMS ((PTR, struct stab_handle *, const char **, boolean));
-static void push_bincl PARAMS ((struct stab_handle *, const char *, bfd_vma));
-static const char *pop_bincl PARAMS ((struct stab_handle *));
-static boolean find_excl
- PARAMS ((struct stab_handle *, const char *, bfd_vma));
-static boolean stab_record_variable
- PARAMS ((PTR, struct stab_handle *, const char *, debug_type,
- enum debug_var_kind, bfd_vma));
-static boolean stab_emit_pending_vars PARAMS ((PTR, struct stab_handle *));
-static debug_type *stab_find_slot
- PARAMS ((struct stab_handle *, const int *));
-static debug_type stab_find_type
- PARAMS ((PTR, struct stab_handle *, const int *));
-static boolean stab_record_type
- PARAMS ((PTR, struct stab_handle *, const int *, debug_type));
-static debug_type stab_xcoff_builtin_type
- PARAMS ((PTR, struct stab_handle *, int));
-static debug_type stab_find_tagged_type
- PARAMS ((PTR, struct stab_handle *, const char *, int,
- enum debug_type_kind));
-static debug_type *stab_demangle_argtypes
- PARAMS ((PTR, struct stab_handle *, const char *, boolean *));
-
-/* Save a string in memory. */
-
-static char *
-savestring (start, len)
- const char *start;
- int len;
-{
- char *ret;
-
- ret = (char *) xmalloc (len + 1);
- memcpy (ret, start, len);
- ret[len] = '\0';
- return ret;
-}
-
-/* Read a number from a string. */
-
-static bfd_vma
-parse_number (pp, poverflow)
- const char **pp;
- boolean *poverflow;
-{
- unsigned long ul;
- const char *orig;
-
- if (poverflow != NULL)
- *poverflow = false;
-
- orig = *pp;
-
- errno = 0;
- ul = strtoul (*pp, (char **) pp, 0);
- if (ul + 1 != 0 || errno == 0)
- return (bfd_vma) ul;
-
- /* Note that even though strtoul overflowed, it should have set *pp
- to the end of the number, which is where we want it. */
-
- if (sizeof (bfd_vma) > sizeof (unsigned long))
- {
- const char *p;
- boolean neg;
- int base;
- bfd_vma over, lastdig;
- boolean overflow;
- bfd_vma v;
-
- /* Our own version of strtoul, for a bfd_vma. */
-
- p = orig;
-
- neg = false;
- if (*p == '+')
- ++p;
- else if (*p == '-')
- {
- neg = true;
- ++p;
- }
-
- base = 10;
- if (*p == '0')
- {
- if (p[1] == 'x' || p[1] == 'X')
- {
- base = 16;
- p += 2;
- }
- else
- {
- base = 8;
- ++p;
- }
- }
-
- over = ((bfd_vma) (bfd_signed_vma) -1) / (bfd_vma) base;
- lastdig = ((bfd_vma) (bfd_signed_vma) -1) % (bfd_vma) base;
-
- overflow = false;
- v = 0;
- while (1)
- {
- int d;
-
- d = *p++;
- if (isdigit ((unsigned char) d))
- d -= '0';
- else if (isupper ((unsigned char) d))
- d -= 'A';
- else if (islower ((unsigned char) d))
- d -= 'a';
- else
- break;
-
- if (d >= base)
- break;
-
- if (v > over || (v == over && (bfd_vma) d > lastdig))
- {
- overflow = true;
- break;
- }
- }
-
- if (! overflow)
- {
- if (neg)
- v = - v;
- return v;
- }
- }
-
- /* If we get here, the number is too large to represent in a
- bfd_vma. */
-
- if (poverflow != NULL)
- *poverflow = true;
- else
- warn_stab (orig, "numeric overflow");
-
- return 0;
-}
-
-/* Give an error for a bad stab string. */
-
-static void
-bad_stab (p)
- const char *p;
-{
- fprintf (stderr, "Bad stab: %s\n", p);
-}
-
-/* Warn about something in a stab string. */
-
-static void
-warn_stab (p, err)
- const char *p;
- const char *err;
-{
- fprintf (stderr, "Warning: %s: %s\n", err, p);
-}
-
-/* Create a handle to parse stabs symbols with. */
-
-/*ARGSUSED*/
-PTR
-start_stab (dhandle, abfd, sections, syms, symcount)
- PTR dhandle;
- bfd *abfd;
- boolean sections;
- asymbol **syms;
- long symcount;
-{
- struct stab_handle *ret;
-
- ret = (struct stab_handle *) xmalloc (sizeof *ret);
- memset (ret, 0, sizeof *ret);
- ret->abfd = abfd;
- ret->sections = sections;
- ret->syms = syms;
- ret->symcount = symcount;
- ret->files = 1;
- ret->file_types = (struct stab_types **) xmalloc (sizeof *ret->file_types);
- ret->file_types[0] = NULL;
- ret->function_end = (bfd_vma) -1;
- return (PTR) ret;
-}
-
-/* When we have processed all the stabs information, we need to go
- through and fill in all the undefined tags. */
-
-boolean
-finish_stab (dhandle, handle)
- PTR dhandle;
- PTR handle;
-{
- struct stab_handle *info = (struct stab_handle *) handle;
- struct stab_tag *st;
-
- if (info->within_function)
- {
- if (! stab_emit_pending_vars (dhandle, info)
- || ! debug_end_function (dhandle, info->function_end))
- return false;
- info->within_function = false;
- info->function_end = (bfd_vma) -1;
- }
-
- for (st = info->tags; st != NULL; st = st->next)
- {
- enum debug_type_kind kind;
-
- kind = st->kind;
- if (kind == DEBUG_KIND_ILLEGAL)
- kind = DEBUG_KIND_STRUCT;
- st->slot = debug_make_undefined_tagged_type (dhandle, st->name, kind);
- if (st->slot == DEBUG_TYPE_NULL)
- return false;
- }
-
- return true;
-}
-
-/* Handle a single stabs symbol. */
-
-boolean
-parse_stab (dhandle, handle, type, desc, value, string)
- PTR dhandle;
- PTR handle;
- int type;
- int desc;
- bfd_vma value;
- const char *string;
-{
- struct stab_handle *info = (struct stab_handle *) handle;
-
- /* gcc will emit two N_SO strings per compilation unit, one for the
- directory name and one for the file name. We just collect N_SO
- strings as we see them, and start the new compilation unit when
- we see a non N_SO symbol. */
- if (info->so_string != NULL
- && (type != N_SO || *string == '\0' || value != info->so_value))
- {
- if (! debug_set_filename (dhandle, info->so_string))
- return false;
- info->main_filename = info->so_string;
-
- info->gcc_compiled = 0;
- info->n_opt_found = false;
-
- /* Generally, for stabs in the symbol table, the N_LBRAC and
- N_RBRAC symbols are relative to the N_SO symbol value. */
- if (! info->sections)
- info->file_start_offset = info->so_value;
-
- /* We need to reset the mapping from type numbers to types. We
- can't free the old mapping, because of the use of
- debug_make_indirect_type. */
- info->files = 1;
- info->file_types = ((struct stab_types **)
- xmalloc (sizeof *info->file_types));
- info->file_types[0] = NULL;
-
- info->so_string = NULL;
-
- /* Now process whatever type we just got. */
- }
-
- switch (type)
- {
- case N_FN:
- case N_FN_SEQ:
- break;
-
- case N_LBRAC:
- /* Ignore extra outermost context from SunPRO cc and acc. */
- if (info->n_opt_found && desc == 1)
- break;
-
- if (! info->within_function)
- {
- fprintf (stderr, "N_LBRAC not within function\n");
- return false;
- }
-
- /* Start an inner lexical block. */
- if (! debug_start_block (dhandle,
- (value
- + info->file_start_offset
- + info->function_start_offset)))
- return false;
-
- /* Emit any pending variable definitions. */
- if (! stab_emit_pending_vars (dhandle, info))
- return false;
-
- ++info->block_depth;
- break;
-
- case N_RBRAC:
- /* Ignore extra outermost context from SunPRO cc and acc. */
- if (info->n_opt_found && desc == 1)
- break;
-
- /* We shouldn't have any pending variable definitions here, but,
- if we do, we probably need to emit them before closing the
- block. */
- if (! stab_emit_pending_vars (dhandle, info))
- return false;
-
- /* End an inner lexical block. */
- if (! debug_end_block (dhandle,
- (value
- + info->file_start_offset
- + info->function_start_offset)))
- return false;
-
- --info->block_depth;
- if (info->block_depth < 0)
- {
- fprintf (stderr, "Too many N_RBRACs\n");
- return false;
- }
- break;
-
- case N_SO:
- /* This always ends a function. */
- if (info->within_function)
- {
- bfd_vma endval;
-
- endval = value;
- if (*string != '\0'
- && info->function_end != (bfd_vma) -1
- && info->function_end < endval)
- endval = info->function_end;
- if (! stab_emit_pending_vars (dhandle, info)
- || ! debug_end_function (dhandle, endval))
- return false;
- info->within_function = false;
- info->function_end = (bfd_vma) -1;
- }
-
- /* An empty string is emitted by gcc at the end of a compilation
- unit. */
- if (*string == '\0')
- return true;
-
- /* Just accumulate strings until we see a non N_SO symbol. If
- the string starts with '/', we discard the previously
- accumulated strings. */
- if (info->so_string == NULL)
- info->so_string = xstrdup (string);
- else
- {
- char *f;
-
- f = info->so_string;
- if (*string == '/')
- info->so_string = xstrdup (string);
- else
- info->so_string = concat (info->so_string, string,
- (const char *) NULL);
- free (f);
- }
-
- info->so_value = value;
-
- break;
-
- case N_SOL:
- /* Start an include file. */
- if (! debug_start_source (dhandle, string))
- return false;
- break;
-
- case N_BINCL:
- /* Start an include file which may be replaced. */
- push_bincl (info, string, value);
- if (! debug_start_source (dhandle, string))
- return false;
- break;
-
- case N_EINCL:
- /* End an N_BINCL include. */
- if (! debug_start_source (dhandle, pop_bincl (info)))
- return false;
- break;
-
- case N_EXCL:
- /* This is a duplicate of a header file named by N_BINCL which
- was eliminated by the linker. */
- if (! find_excl (info, string, value))
- return false;
- break;
-
- case N_SLINE:
- if (! debug_record_line (dhandle, desc,
- value + info->function_start_offset))
- return false;
- break;
-
- case N_BCOMM:
- if (! debug_start_common_block (dhandle, string))
- return false;
- break;
-
- case N_ECOMM:
- if (! debug_end_common_block (dhandle, string))
- return false;
- break;
-
- case N_FUN:
- if (*string == '\0')
- {
- if (info->within_function)
- {
- /* This always marks the end of a function; we don't
- need to worry about info->function_end. */
- if (info->sections)
- value += info->function_start_offset;
- if (! stab_emit_pending_vars (dhandle, info)
- || ! debug_end_function (dhandle, value))
- return false;
- info->within_function = false;
- info->function_end = (bfd_vma) -1;
- }
- break;
- }
-
- /* A const static symbol in the .text section will have an N_FUN
- entry. We need to use these to mark the end of the function,
- in case we are looking at gcc output before it was changed to
- always emit an empty N_FUN. We can't call debug_end_function
- here, because it might be a local static symbol. */
- if (info->within_function
- && (info->function_end == (bfd_vma) -1
- || value < info->function_end))
- info->function_end = value;
-
- /* Fall through. */
- /* FIXME: gdb checks the string for N_STSYM, N_LCSYM or N_ROSYM
- symbols, and if it does not start with :S, gdb relocates the
- value to the start of the section. gcc always seems to use
- :S, so we don't worry about this. */
- /* Fall through. */
- default:
- {
- const char *colon;
-
- colon = strchr (string, ':');
- if (colon != NULL
- && (colon[1] == 'f' || colon[1] == 'F'))
- {
- if (info->within_function)
- {
- bfd_vma endval;
-
- endval = value;
- if (info->function_end != (bfd_vma) -1
- && info->function_end < endval)
- endval = info->function_end;
- if (! stab_emit_pending_vars (dhandle, info)
- || ! debug_end_function (dhandle, endval))
- return false;
- info->function_end = (bfd_vma) -1;
- }
- /* For stabs in sections, line numbers and block addresses
- are offsets from the start of the function. */
- if (info->sections)
- info->function_start_offset = value;
- info->within_function = true;
- }
-
- if (! parse_stab_string (dhandle, info, type, desc, value, string))
- return false;
- }
- break;
-
- case N_OPT:
- if (string != NULL && strcmp (string, "gcc2_compiled.") == 0)
- info->gcc_compiled = 2;
- else if (string != NULL && strcmp (string, "gcc_compiled.") == 0)
- info->gcc_compiled = 1;
- else
- info->n_opt_found = true;
- break;
-
- case N_OBJ:
- case N_ENDM:
- case N_MAIN:
- break;
- }
-
- return true;
-}
-
-/* Parse the stabs string. */
-
-static boolean
-parse_stab_string (dhandle, info, stabtype, desc, value, string)
- PTR dhandle;
- struct stab_handle *info;
- int stabtype;
- int desc;
- bfd_vma value;
- const char *string;
-{
- const char *p;
- char *name;
- int type;
- debug_type dtype;
- boolean synonym;
- unsigned int lineno;
- debug_type *slot;
-
- p = strchr (string, ':');
- if (p == NULL)
- return true;
-
- while (p[1] == ':')
- {
- p += 2;
- p = strchr (p, ':');
- if (p == NULL)
- {
- bad_stab (string);
- return false;
- }
- }
-
- /* GCC 2.x puts the line number in desc. SunOS apparently puts in
- the number of bytes occupied by a type or object, which we
- ignore. */
- if (info->gcc_compiled >= 2)
- lineno = desc;
- else
- lineno = 0;
-
- /* FIXME: Sometimes the special C++ names start with '.'. */
- name = NULL;
- if (string[0] == '$')
- {
- switch (string[1])
- {
- case 't':
- name = "this";
- break;
- case 'v':
- /* Was: name = "vptr"; */
- break;
- case 'e':
- name = "eh_throw";
- break;
- case '_':
- /* This was an anonymous type that was never fixed up. */
- break;
- case 'X':
- /* SunPRO (3.0 at least) static variable encoding. */
- break;
- default:
- warn_stab (string, "unknown C++ encoded name");
- break;
- }
- }
-
- if (name == NULL)
- {
- if (p == string || (string[0] == ' ' && p == string + 1))
- name = NULL;
- else
- name = savestring (string, p - string);
- }
-
- ++p;
- if (isdigit ((unsigned char) *p) || *p == '(' || *p == '-')
- type = 'l';
- else
- type = *p++;
-
- switch (type)
- {
- case 'c':
- /* c is a special case, not followed by a type-number.
- SYMBOL:c=iVALUE for an integer constant symbol.
- SYMBOL:c=rVALUE for a floating constant symbol.
- SYMBOL:c=eTYPE,INTVALUE for an enum constant symbol.
- e.g. "b:c=e6,0" for "const b = blob1"
- (where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
- if (*p != '=')
- {
- bad_stab (string);
- return false;
- }
- ++p;
- switch (*p++)
- {
- case 'r':
- /* Floating point constant. */
- if (! debug_record_float_const (dhandle, name, atof (p)))
- return false;
- break;
- case 'i':
- /* Integer constant. */
- /* Defining integer constants this way is kind of silly,
- since 'e' constants allows the compiler to give not only
- the value, but the type as well. C has at least int,
- long, unsigned int, and long long as constant types;
- other languages probably should have at least unsigned as
- well as signed constants. */
- if (! debug_record_int_const (dhandle, name, atoi (p)))
- return false;
- break;
- case 'e':
- /* SYMBOL:c=eTYPE,INTVALUE for a constant symbol whose value
- can be represented as integral.
- e.g. "b:c=e6,0" for "const b = blob1"
- (where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
- dtype = parse_stab_type (dhandle, info, (const char *) NULL,
- &p, (debug_type **) NULL);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (*p != ',')
- {
- bad_stab (string);
- return false;
- }
- if (! debug_record_typed_const (dhandle, name, dtype, atoi (p)))
- return false;
- break;
- default:
- bad_stab (string);
- return false;
- }
-
- break;
-
- case 'C':
- /* The name of a caught exception. */
- dtype = parse_stab_type (dhandle, info, (const char *) NULL,
- &p, (debug_type **) NULL);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (! debug_record_label (dhandle, name, dtype, value))
- return false;
- break;
-
- case 'f':
- case 'F':
- /* A function definition. */
- dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (! debug_record_function (dhandle, name, dtype, type == 'F', value))
- return false;
-
- /* Sun acc puts declared types of arguments here. We don't care
- about their actual types (FIXME -- we should remember the whole
- function prototype), but the list may define some new types
- that we have to remember, so we must scan it now. */
- while (*p == ';')
- {
- ++p;
- if (parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL)
- == DEBUG_TYPE_NULL)
- return false;
- }
-
- break;
-
- case 'G':
- {
- char leading;
- long c;
- asymbol **ps;
-
- /* A global symbol. The value must be extracted from the
- symbol table. */
- dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- leading = bfd_get_symbol_leading_char (info->abfd);
- for (c = info->symcount, ps = info->syms; c > 0; --c, ++ps)
- {
- const char *n;
-
- n = bfd_asymbol_name (*ps);
- if (leading != '\0' && *n == leading)
- ++n;
- if (*n == *name && strcmp (n, name) == 0)
- break;
- }
- if (c > 0)
- value = bfd_asymbol_value (*ps);
- if (! stab_record_variable (dhandle, info, name, dtype, DEBUG_GLOBAL,
- value))
- return false;
- }
- break;
-
- /* This case is faked by a conditional above, when there is no
- code letter in the dbx data. Dbx data never actually
- contains 'l'. */
- case 'l':
- case 's':
- dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (! stab_record_variable (dhandle, info, name, dtype, DEBUG_LOCAL,
- value))
- return false;
- break;
-
- case 'p':
- /* A function parameter. */
- if (*p != 'F')
- dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL);
- else
- {
- /* pF is a two-letter code that means a function parameter in
- Fortran. The type-number specifies the type of the return
- value. Translate it into a pointer-to-function type. */
- ++p;
- dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL);
- if (dtype != DEBUG_TYPE_NULL)
- {
- debug_type ftype;
-
- ftype = debug_make_function_type (dhandle, dtype,
- (debug_type *) NULL, false);
- dtype = debug_make_pointer_type (dhandle, ftype);
- }
- }
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (! debug_record_parameter (dhandle, name, dtype, DEBUG_PARM_STACK,
- value))
- return false;
-
- /* FIXME: At this point gdb considers rearranging the parameter
- address on a big endian machine if it is smaller than an int.
- We have no way to do that, since we don't really know much
- about the target. */
-
- break;
-
- case 'P':
- if (stabtype == N_FUN)
- {
- /* Prototype of a function referenced by this file. */
- while (*p == ';')
- {
- ++p;
- if (parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL)
- == DEBUG_TYPE_NULL)
- return false;
- }
- break;
- }
- /* Fall through. */
- case 'R':
- /* Parameter which is in a register. */
- dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (! debug_record_parameter (dhandle, name, dtype, DEBUG_PARM_REG,
- value))
- return false;
- break;
-
- case 'r':
- /* Register variable (either global or local). */
- dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (! stab_record_variable (dhandle, info, name, dtype, DEBUG_REGISTER,
- value))
- return false;
-
- /* FIXME: At this point gdb checks to combine pairs of 'p' and
- 'r' stabs into a single 'P' stab. */
-
- break;
-
- case 'S':
- /* Static symbol at top level of file */
- dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (! stab_record_variable (dhandle, info, name, dtype, DEBUG_STATIC,
- value))
- return false;
- break;
-
- case 't':
- /* A typedef. */
- dtype = parse_stab_type (dhandle, info, name, &p, &slot);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (name == NULL)
- {
- /* A nameless type. Nothing to do. */
- return true;
- }
-
- dtype = debug_name_type (dhandle, name, dtype);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
-
- if (slot != NULL)
- *slot = dtype;
-
- break;
-
- case 'T':
- /* Struct, union, or enum tag. For GNU C++, this can be be followed
- by 't' which means we are typedef'ing it as well. */
- if (*p != 't')
- {
- synonym = false;
- /* FIXME: gdb sets synonym to true if the current language
- is C++. */
- }
- else
- {
- synonym = true;
- ++p;
- }
-
- dtype = parse_stab_type (dhandle, info, name, &p, &slot);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (name == NULL)
- return true;
-
- dtype = debug_tag_type (dhandle, name, dtype);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (slot != NULL)
- *slot = dtype;
-
- /* See if we have a cross reference to this tag which we can now
- fill in. */
- {
- register struct stab_tag **pst;
-
- for (pst = &info->tags; *pst != NULL; pst = &(*pst)->next)
- {
- if ((*pst)->name[0] == name[0]
- && strcmp ((*pst)->name, name) == 0)
- {
- (*pst)->slot = dtype;
- *pst = (*pst)->next;
- break;
- }
- }
- }
-
- if (synonym)
- {
- dtype = debug_name_type (dhandle, name, dtype);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
-
- if (slot != NULL)
- *slot = dtype;
- }
-
- break;
-
- case 'V':
- /* Static symbol of local scope */
- dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- /* FIXME: gdb checks os9k_stabs here. */
- if (! stab_record_variable (dhandle, info, name, dtype,
- DEBUG_LOCAL_STATIC, value))
- return false;
- break;
-
- case 'v':
- /* Reference parameter. */
- dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (! debug_record_parameter (dhandle, name, dtype, DEBUG_PARM_REFERENCE,
- value))
- return false;
- break;
-
- case 'a':
- /* Reference parameter which is in a register. */
- dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (! debug_record_parameter (dhandle, name, dtype, DEBUG_PARM_REF_REG,
- value))
- return false;
- break;
-
- case 'X':
- /* This is used by Sun FORTRAN for "function result value".
- Sun claims ("dbx and dbxtool interfaces", 2nd ed)
- that Pascal uses it too, but when I tried it Pascal used
- "x:3" (local symbol) instead. */
- dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p,
- (debug_type **) NULL);
- if (dtype == DEBUG_TYPE_NULL)
- return false;
- if (! stab_record_variable (dhandle, info, name, dtype, DEBUG_LOCAL,
- value))
- return false;
- break;
-
- default:
- bad_stab (string);
- return false;
- }
-
- /* FIXME: gdb converts structure values to structure pointers in a
- couple of cases, depending upon the target. */
-
- return true;
-}
-
-/* Parse a stabs type. The typename argument is non-NULL if this is a
- typedef or a tag definition. The pp argument points to the stab
- string, and is updated. The slotp argument points to a place to
- store the slot used if the type is being defined. */
-
-static debug_type
-parse_stab_type (dhandle, info, typename, pp, slotp)
- PTR dhandle;
- struct stab_handle *info;
- const char *typename;
- const char **pp;
- debug_type **slotp;
-{
- const char *orig;
- int typenums[2];
- int size;
- boolean stringp;
- int descriptor;
- debug_type dtype;
-
- if (slotp != NULL)
- *slotp = NULL;
-
- orig = *pp;
-
- size = -1;
- stringp = false;
-
- /* Read type number if present. The type number may be omitted.
- for instance in a two-dimensional array declared with type
- "ar1;1;10;ar1;1;10;4". */
- if (! isdigit ((unsigned char) **pp) && **pp != '(' && **pp != '-')
- {
- /* 'typenums=' not present, type is anonymous. Read and return
- the definition, but don't put it in the type vector. */
- typenums[0] = typenums[1] = -1;
- }
- else
- {
- if (! parse_stab_type_number (pp, typenums))
- return DEBUG_TYPE_NULL;
-
- if (**pp != '=')
- {
- /* Type is not being defined here. Either it already
- exists, or this is a forward reference to it. */
- return stab_find_type (dhandle, info, typenums);
- }
-
- /* Only set the slot if the type is being defined. This means
- that the mapping from type numbers to types will only record
- the name of the typedef which defines a type. If we don't do
- this, then something like
- typedef int foo;
- int i;
- will record that i is of type foo. Unfortunately, stabs
- information is ambiguous about variable types. For this code,
- typedef int foo;
- int i;
- foo j;
- the stabs information records both i and j as having the same
- type. This could be fixed by patching the compiler. */
- if (slotp != NULL && typenums[0] >= 0 && typenums[1] >= 0)
- *slotp = stab_find_slot (info, typenums);
-
- /* Type is being defined here. */
- /* Skip the '='. */
- ++*pp;
-
- while (**pp == '@')
- {
- const char *p = *pp + 1;
- const char *attr;
-
- if (isdigit ((unsigned char) *p) || *p == '(' || *p == '-')
- {
- /* Member type. */
- break;
- }
-
- /* Type attributes. */
- attr = p;
-
- for (; *p != ';'; ++p)
- {
- if (*p == '\0')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- }
- *pp = p + 1;
-
- switch (*attr)
- {
- case 's':
- size = atoi (attr + 1);
- if (size <= 0)
- size = -1;
- break;
-
- case 'S':
- stringp = true;
- break;
-
- default:
- /* Ignore unrecognized type attributes, so future
- compilers can invent new ones. */
- break;
- }
- }
- }
-
- descriptor = **pp;
- ++*pp;
-
- switch (descriptor)
- {
- case 'x':
- {
- enum debug_type_kind code;
- const char *q1, *q2, *p;
-
- /* A cross reference to another type. */
-
- switch (**pp)
- {
- case 's':
- code = DEBUG_KIND_STRUCT;
- break;
- case 'u':
- code = DEBUG_KIND_UNION;
- break;
- case 'e':
- code = DEBUG_KIND_ENUM;
- break;
- default:
- /* Complain and keep going, so compilers can invent new
- cross-reference types. */
- warn_stab (orig, "unrecognized cross reference type");
- code = DEBUG_KIND_STRUCT;
- break;
- }
- ++*pp;
-
- q1 = strchr (*pp, '<');
- p = strchr (*pp, ':');
- if (p == NULL)
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- while (q1 != NULL && p > q1 && p[1] == ':')
- {
- q2 = strchr (q1, '>');
- if (q2 == NULL || q2 < p)
- break;
- p += 2;
- p = strchr (p, ':');
- if (p == NULL)
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- }
-
- dtype = stab_find_tagged_type (dhandle, info, *pp, p - *pp, code);
-
- *pp = p + 1;
- }
- break;
-
- case '-':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case '(':
- {
- const char *hold;
- int xtypenums[2];
-
- /* This type is defined as another type. */
-
- (*pp)--;
- hold = *pp;
-
- /* Peek ahead at the number to detect void. */
- if (! parse_stab_type_number (pp, xtypenums))
- return DEBUG_TYPE_NULL;
-
- if (typenums[0] == xtypenums[0] && typenums[1] == xtypenums[1])
- {
- /* This type is being defined as itself, which means that
- it is void. */
- dtype = debug_make_void_type (dhandle);
- }
- else
- {
- *pp = hold;
-
- /* Go back to the number and have parse_stab_type get it.
- This means that we can deal with something like
- t(1,2)=(3,4)=... which the Lucid compiler uses. */
- dtype = parse_stab_type (dhandle, info, (const char *) NULL,
- pp, (debug_type **) NULL);
- if (dtype == DEBUG_TYPE_NULL)
- return DEBUG_TYPE_NULL;
- }
-
- if (typenums[0] != -1)
- {
- if (! stab_record_type (dhandle, info, typenums, dtype))
- return DEBUG_TYPE_NULL;
- }
-
- break;
- }
-
- case '*':
- dtype = debug_make_pointer_type (dhandle,
- parse_stab_type (dhandle, info,
- (const char *) NULL,
- pp,
- (debug_type **) NULL));
- break;
-
- case '&':
- /* Reference to another type. */
- dtype = (debug_make_reference_type
- (dhandle,
- parse_stab_type (dhandle, info, (const char *) NULL, pp,
- (debug_type **) NULL)));
- break;
-
- case 'f':
- /* Function returning another type. */
- /* FIXME: gdb checks os9k_stabs here. */
- dtype = (debug_make_function_type
- (dhandle,
- parse_stab_type (dhandle, info, (const char *) NULL, pp,
- (debug_type **) NULL),
- (debug_type *) NULL, false));
- break;
-
- case 'k':
- /* Const qualifier on some type (Sun). */
- /* FIXME: gdb accepts 'c' here if os9k_stabs. */
- dtype = debug_make_const_type (dhandle,
- parse_stab_type (dhandle, info,
- (const char *) NULL,
- pp,
- (debug_type **) NULL));
- break;
-
- case 'B':
- /* Volatile qual on some type (Sun). */
- /* FIXME: gdb accepts 'i' here if os9k_stabs. */
- dtype = (debug_make_volatile_type
- (dhandle,
- parse_stab_type (dhandle, info, (const char *) NULL, pp,
- (debug_type **) NULL)));
- break;
-
- case '@':
- /* Offset (class & variable) type. This is used for a pointer
- relative to an object. */
- {
- debug_type domain;
- debug_type memtype;
-
- /* Member type. */
-
- domain = parse_stab_type (dhandle, info, (const char *) NULL, pp,
- (debug_type **) NULL);
- if (domain == DEBUG_TYPE_NULL)
- return DEBUG_TYPE_NULL;
-
- if (**pp != ',')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
-
- memtype = parse_stab_type (dhandle, info, (const char *) NULL, pp,
- (debug_type **) NULL);
- if (memtype == DEBUG_TYPE_NULL)
- return DEBUG_TYPE_NULL;
-
- dtype = debug_make_offset_type (dhandle, domain, memtype);
- }
- break;
-
- case '#':
- /* Method (class & fn) type. */
- if (**pp == '#')
- {
- debug_type return_type;
-
- ++*pp;
- return_type = parse_stab_type (dhandle, info, (const char *) NULL,
- pp, (debug_type **) NULL);
- if (return_type == DEBUG_TYPE_NULL)
- return DEBUG_TYPE_NULL;
- if (**pp != ';')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
- dtype = debug_make_method_type (dhandle, return_type,
- DEBUG_TYPE_NULL,
- (debug_type *) NULL, false);
- }
- else
- {
- debug_type domain;
- debug_type return_type;
- debug_type *args;
- unsigned int n;
- unsigned int alloc;
- boolean varargs;
-
- domain = parse_stab_type (dhandle, info, (const char *) NULL,
- pp, (debug_type **) NULL);
- if (domain == DEBUG_TYPE_NULL)
- return DEBUG_TYPE_NULL;
-
- if (**pp != ',')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
-
- return_type = parse_stab_type (dhandle, info, (const char *) NULL,
- pp, (debug_type **) NULL);
- if (return_type == DEBUG_TYPE_NULL)
- return DEBUG_TYPE_NULL;
-
- alloc = 10;
- args = (debug_type *) xmalloc (alloc * sizeof *args);
- n = 0;
- while (**pp != ';')
- {
- if (**pp != ',')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
-
- if (n + 1 >= alloc)
- {
- alloc += 10;
- args = ((debug_type *)
- xrealloc ((PTR) args, alloc * sizeof *args));
- }
-
- args[n] = parse_stab_type (dhandle, info, (const char *) NULL,
- pp, (debug_type **) NULL);
- if (args[n] == DEBUG_TYPE_NULL)
- return DEBUG_TYPE_NULL;
- ++n;
- }
- ++*pp;
-
- /* If the last type is not void, then this function takes a
- variable number of arguments. Otherwise, we must strip
- the void type. */
- if (n == 0
- || debug_get_type_kind (dhandle, args[n - 1]) != DEBUG_KIND_VOID)
- varargs = true;
- else
- {
- --n;
- varargs = false;
- }
-
- args[n] = DEBUG_TYPE_NULL;
-
- dtype = debug_make_method_type (dhandle, return_type, domain, args,
- varargs);
- }
- break;
-
- case 'r':
- /* Range type. */
- dtype = parse_stab_range_type (dhandle, info, typename, pp, typenums);
- break;
-
- case 'b':
- /* FIXME: gdb checks os9k_stabs here. */
- /* Sun ACC builtin int type. */
- dtype = parse_stab_sun_builtin_type (dhandle, pp);
- break;
-
- case 'R':
- /* Sun ACC builtin float type. */
- dtype = parse_stab_sun_floating_type (dhandle, pp);
- break;
-
- case 'e':
- /* Enumeration type. */
- dtype = parse_stab_enum_type (dhandle, pp);
- break;
-
- case 's':
- case 'u':
- /* Struct or union type. */
- dtype = parse_stab_struct_type (dhandle, info, typename, pp,
- descriptor == 's', typenums);
- break;
-
- case 'a':
- /* Array type. */
- if (**pp != 'r')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
-
- dtype = parse_stab_array_type (dhandle, info, pp, stringp);
- break;
-
- case 'S':
- dtype = debug_make_set_type (dhandle,
- parse_stab_type (dhandle, info,
- (const char *) NULL,
- pp,
- (debug_type **) NULL),
- stringp);
- break;
-
- default:
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
-
- if (dtype == DEBUG_TYPE_NULL)
- return DEBUG_TYPE_NULL;
-
- if (typenums[0] != -1)
- {
- if (! stab_record_type (dhandle, info, typenums, dtype))
- return DEBUG_TYPE_NULL;
- }
-
- if (size != -1)
- {
- if (! debug_record_type_size (dhandle, dtype, (unsigned int) size))
- return DEBUG_TYPE_NULL;
- }
-
- return dtype;
-}
-
-/* Read a number by which a type is referred to in dbx data, or
- perhaps read a pair (FILENUM, TYPENUM) in parentheses. Just a
- single number N is equivalent to (0,N). Return the two numbers by
- storing them in the vector TYPENUMS. */
-
-static boolean
-parse_stab_type_number (pp, typenums)
- const char **pp;
- int *typenums;
-{
- const char *orig;
-
- orig = *pp;
-
- if (**pp != '(')
- {
- typenums[0] = 0;
- typenums[1] = (int) parse_number (pp, (boolean *) NULL);
- }
- else
- {
- ++*pp;
- typenums[0] = (int) parse_number (pp, (boolean *) NULL);
- if (**pp != ',')
- {
- bad_stab (orig);
- return false;
- }
- ++*pp;
- typenums[1] = (int) parse_number (pp, (boolean *) NULL);
- if (**pp != ')')
- {
- bad_stab (orig);
- return false;
- }
- ++*pp;
- }
-
- return true;
-}
-
-/* Parse a range type. */
-
-static debug_type
-parse_stab_range_type (dhandle, info, typename, pp, typenums)
- PTR dhandle;
- struct stab_handle *info;
- const char *typename;
- const char **pp;
- const int *typenums;
-{
- const char *orig;
- int rangenums[2];
- boolean self_subrange;
- debug_type index_type;
- const char *s2, *s3;
- bfd_signed_vma n2, n3;
- boolean ov2, ov3;
-
- orig = *pp;
-
- index_type = DEBUG_TYPE_NULL;
-
- /* First comes a type we are a subrange of.
- In C it is usually 0, 1 or the type being defined. */
- if (! parse_stab_type_number (pp, rangenums))
- return DEBUG_TYPE_NULL;
-
- self_subrange = (rangenums[0] == typenums[0]
- && rangenums[1] == typenums[1]);
-
- if (**pp == '=')
- {
- *pp = orig;
- index_type = parse_stab_type (dhandle, info, (const char *) NULL,
- pp, (debug_type **) NULL);
- if (index_type == DEBUG_TYPE_NULL)
- return DEBUG_TYPE_NULL;
- }
-
- if (**pp == ';')
- ++*pp;
-
- /* The remaining two operands are usually lower and upper bounds of
- the range. But in some special cases they mean something else. */
- s2 = *pp;
- n2 = parse_number (pp, &ov2);
- if (**pp != ';')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
-
- s3 = *pp;
- n3 = parse_number (pp, &ov3);
- if (**pp != ';')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
-
- if (ov2 || ov3)
- {
- /* gcc will emit range stabs for long long types. Handle this
- as a special case. FIXME: This needs to be more general. */
-#define LLLOW "01000000000000000000000;"
-#define LLHIGH "0777777777777777777777;"
-#define ULLHIGH "01777777777777777777777;"
- if (index_type == DEBUG_TYPE_NULL)
- {
- if (strncmp (s2, LLLOW, sizeof LLLOW - 1) == 0
- && strncmp (s3, LLHIGH, sizeof LLHIGH - 1) == 0)
- return debug_make_int_type (dhandle, 8, false);
- if (! ov2
- && n2 == 0
- && strncmp (s3, ULLHIGH, sizeof ULLHIGH - 1) == 0)
- return debug_make_int_type (dhandle, 8, true);
- }
-
- warn_stab (orig, "numeric overflow");
- }
-
- if (index_type == DEBUG_TYPE_NULL)
- {
- /* A type defined as a subrange of itself, with both bounds 0,
- is void. */
- if (self_subrange && n2 == 0 && n3 == 0)
- return debug_make_void_type (dhandle);
-
- /* A type defined as a subrange of itself, with n2 positive and
- n3 zero, is a complex type, and n2 is the number of bytes. */
- if (self_subrange && n3 == 0 && n2 > 0)
- return debug_make_complex_type (dhandle, n2);
-
- /* If n3 is zero and n2 is positive, this is a floating point
- type, and n2 is the number of bytes. */
- if (n3 == 0 && n2 > 0)
- return debug_make_float_type (dhandle, n2);
-
- /* If the upper bound is -1, this is an unsigned int. */
- if (n2 == 0 && n3 == -1)
- {
- /* When gcc is used with -gstabs, but not -gstabs+, it will emit
- long long int:t6=r1;0;-1;
- long long unsigned int:t7=r1;0;-1;
- We hack here to handle this reasonably. */
- if (typename != NULL)
- {
- if (strcmp (typename, "long long int") == 0)
- return debug_make_int_type (dhandle, 8, false);
- else if (strcmp (typename, "long long unsigned int") == 0)
- return debug_make_int_type (dhandle, 8, true);
- }
- /* FIXME: The size here really depends upon the target. */
- return debug_make_int_type (dhandle, 4, true);
- }
-
- /* A range of 0 to 127 is char. */
- if (self_subrange && n2 == 0 && n3 == 127)
- return debug_make_int_type (dhandle, 1, false);
-
- /* FIXME: gdb checks for the language CHILL here. */
-
- if (n2 == 0)
- {
- if (n3 < 0)
- return debug_make_int_type (dhandle, - n3, true);
- else if (n3 == 0xff)
- return debug_make_int_type (dhandle, 1, true);
- else if (n3 == 0xffff)
- return debug_make_int_type (dhandle, 2, true);
- /* -1 is used for the upper bound of (4 byte) "unsigned int"
- and "unsigned long", and we already checked for that, so
- don't need to test for it here. */
- }
- else if (n3 == 0
- && n2 < 0
- && (self_subrange || n2 == -8))
- return debug_make_int_type (dhandle, - n2, true);
- else if (n2 == - n3 - 1)
- {
- if (n3 == 0x7f)
- return debug_make_int_type (dhandle, 1, false);
- else if (n3 == 0x7fff)
- return debug_make_int_type (dhandle, 2, false);
- else if (n3 == 0x7fffffff)
- return debug_make_int_type (dhandle, 4, false);
- }
- }
-
- /* At this point I don't have the faintest idea how to deal with a
- self_subrange type; I'm going to assume that this is used as an
- idiom, and that all of them are special cases. So . . . */
- if (self_subrange)
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
-
- index_type = stab_find_type (dhandle, info, rangenums);
- if (index_type == DEBUG_TYPE_NULL)
- {
- /* Does this actually ever happen? Is that why we are worrying
- about dealing with it rather than just calling error_type? */
- warn_stab (orig, "missing index type");
- index_type = debug_make_int_type (dhandle, 4, false);
- }
-
- return debug_make_range_type (dhandle, index_type, n2, n3);
-}
-
-/* Sun's ACC uses a somewhat saner method for specifying the builtin
- typedefs in every file (for int, long, etc):
-
- type = b <signed> <width>; <offset>; <nbits>
- signed = u or s. Possible c in addition to u or s (for char?).
- offset = offset from high order bit to start bit of type.
- width is # bytes in object of this type, nbits is # bits in type.
-
- The width/offset stuff appears to be for small objects stored in
- larger ones (e.g. `shorts' in `int' registers). We ignore it for now,
- FIXME. */
-
-static debug_type
-parse_stab_sun_builtin_type (dhandle, pp)
- PTR dhandle;
- const char **pp;
-{
- const char *orig;
- boolean unsignedp;
- bfd_vma bits;
-
- orig = *pp;
-
- switch (**pp)
- {
- case 's':
- unsignedp = false;
- break;
- case 'u':
- unsignedp = true;
- break;
- default:
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
-
- /* For some odd reason, all forms of char put a c here. This is strange
- because no other type has this honor. We can safely ignore this because
- we actually determine 'char'acterness by the number of bits specified in
- the descriptor. */
- if (**pp == 'c')
- ++*pp;
-
- /* The first number appears to be the number of bytes occupied
- by this type, except that unsigned short is 4 instead of 2.
- Since this information is redundant with the third number,
- we will ignore it. */
- (void) parse_number (pp, (boolean *) NULL);
- if (**pp != ';')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
-
- /* The second number is always 0, so ignore it too. */
- (void) parse_number (pp, (boolean *) NULL);
- if (**pp != ';')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
-
- /* The third number is the number of bits for this type. */
- bits = parse_number (pp, (boolean *) NULL);
-
- /* The type *should* end with a semicolon. If it are embedded
- in a larger type the semicolon may be the only way to know where
- the type ends. If this type is at the end of the stabstring we
- can deal with the omitted semicolon (but we don't have to like
- it). Don't bother to complain(), Sun's compiler omits the semicolon
- for "void". */
- if (**pp == ';')
- ++*pp;
-
- if (bits == 0)
- return debug_make_void_type (dhandle);
-
- return debug_make_int_type (dhandle, bits / 8, unsignedp);
-}
-
-/* Parse a builtin floating type generated by the Sun compiler. */
-
-static debug_type
-parse_stab_sun_floating_type (dhandle, pp)
- PTR dhandle;
- const char **pp;
-{
- const char *orig;
- bfd_vma details;
- bfd_vma bytes;
-
- orig = *pp;
-
- /* The first number has more details about the type, for example
- FN_COMPLEX. */
- details = parse_number (pp, (boolean *) NULL);
- if (**pp != ';')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
-
- /* The second number is the number of bytes occupied by this type */
- bytes = parse_number (pp, (boolean *) NULL);
- if (**pp != ';')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
-
- if (details == NF_COMPLEX
- || details == NF_COMPLEX16
- || details == NF_COMPLEX32)
- return debug_make_complex_type (dhandle, bytes);
-
- return debug_make_float_type (dhandle, bytes);
-}
-
-/* Handle an enum type. */
-
-static debug_type
-parse_stab_enum_type (dhandle, pp)
- PTR dhandle;
- const char **pp;
-{
- const char *orig;
- const char **names;
- bfd_signed_vma *values;
- unsigned int n;
- unsigned int alloc;
-
- orig = *pp;
-
- /* FIXME: gdb checks os9k_stabs here. */
-
- /* The aix4 compiler emits an extra field before the enum members;
- my guess is it's a type of some sort. Just ignore it. */
- if (**pp == '-')
- {
- while (**pp != ':')
- ++*pp;
- ++*pp;
- }
-
- /* Read the value-names and their values.
- The input syntax is NAME:VALUE,NAME:VALUE, and so on.
- A semicolon or comma instead of a NAME means the end. */
- alloc = 10;
- names = (const char **) xmalloc (alloc * sizeof *names);
- values = (bfd_signed_vma *) xmalloc (alloc * sizeof *values);
- n = 0;
- while (**pp != '\0' && **pp != ';' && **pp != ',')
- {
- const char *p;
- char *name;
- bfd_signed_vma val;
-
- p = *pp;
- while (*p != ':')
- ++p;
-
- name = savestring (*pp, p - *pp);
-
- *pp = p + 1;
- val = (bfd_signed_vma) parse_number (pp, (boolean *) NULL);
- if (**pp != ',')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
-
- if (n + 1 >= alloc)
- {
- alloc += 10;
- names = ((const char **)
- xrealloc ((PTR) names, alloc * sizeof *names));
- values = ((bfd_signed_vma *)
- xrealloc ((PTR) values, alloc * sizeof *values));
- }
-
- names[n] = name;
- values[n] = val;
- ++n;
- }
-
- names[n] = NULL;
- values[n] = 0;
-
- if (**pp == ';')
- ++*pp;
-
- return debug_make_enum_type (dhandle, names, values);
-}
-
-/* Read the description of a structure (or union type) and return an object
- describing the type.
-
- PP points to a character pointer that points to the next unconsumed token
- in the the stabs string. For example, given stabs "A:T4=s4a:1,0,32;;",
- *PP will point to "4a:1,0,32;;". */
-
-static debug_type
-parse_stab_struct_type (dhandle, info, tagname, pp, structp, typenums)
- PTR dhandle;
- struct stab_handle *info;
- const char *tagname;
- const char **pp;
- boolean structp;
- const int *typenums;
-{
- const char *orig;
- bfd_vma size;
- debug_baseclass *baseclasses;
- debug_field *fields;
- boolean statics;
- debug_method *methods;
- debug_type vptrbase;
- boolean ownvptr;
-
- orig = *pp;
-
- /* Get the size. */
- size = parse_number (pp, (boolean *) NULL);
-
- /* Get the other information. */
- if (! parse_stab_baseclasses (dhandle, info, pp, &baseclasses)
- || ! parse_stab_struct_fields (dhandle, info, pp, &fields, &statics)
- || ! parse_stab_members (dhandle, info, tagname, pp, typenums, &methods)
- || ! parse_stab_tilde_field (dhandle, info, pp, typenums, &vptrbase,
- &ownvptr))
- return DEBUG_TYPE_NULL;
-
- if (! statics
- && baseclasses == NULL
- && methods == NULL
- && vptrbase == DEBUG_TYPE_NULL
- && ! ownvptr)
- return debug_make_struct_type (dhandle, structp, size, fields);
-
- return debug_make_object_type (dhandle, structp, size, fields, baseclasses,
- methods, vptrbase, ownvptr);
-}
-
-/* The stabs for C++ derived classes contain baseclass information which
- is marked by a '!' character after the total size. This function is
- called when we encounter the baseclass marker, and slurps up all the
- baseclass information.
-
- Immediately following the '!' marker is the number of base classes that
- the class is derived from, followed by information for each base class.
- For each base class, there are two visibility specifiers, a bit offset
- to the base class information within the derived class, a reference to
- the type for the base class, and a terminating semicolon.
-
- A typical example, with two base classes, would be "!2,020,19;0264,21;".
- ^^ ^ ^ ^ ^ ^ ^
- Baseclass information marker __________________|| | | | | | |
- Number of baseclasses __________________________| | | | | | |
- Visibility specifiers (2) ________________________| | | | | |
- Offset in bits from start of class _________________| | | | |
- Type number for base class ___________________________| | | |
- Visibility specifiers (2) _______________________________| | |
- Offset in bits from start of class ________________________| |
- Type number of base class ____________________________________|
-
- Return true for success, false for failure. */
-
-static boolean
-parse_stab_baseclasses (dhandle, info, pp, retp)
- PTR dhandle;
- struct stab_handle *info;
- const char **pp;
- debug_baseclass **retp;
-{
- const char *orig;
- unsigned int c, i;
- debug_baseclass *classes;
-
- *retp = NULL;
-
- orig = *pp;
-
- if (**pp != '!')
- {
- /* No base classes. */
- return true;
- }
- ++*pp;
-
- c = (unsigned int) parse_number (pp, (boolean *) NULL);
-
- if (**pp != ',')
- {
- bad_stab (orig);
- return false;
- }
- ++*pp;
-
- classes = (debug_baseclass *) xmalloc ((c + 1) * sizeof (**retp));
-
- for (i = 0; i < c; i++)
- {
- boolean virtual;
- enum debug_visibility visibility;
- bfd_vma bitpos;
- debug_type type;
-
- switch (**pp)
- {
- case '0':
- virtual = false;
- break;
- case '1':
- virtual = true;
- break;
- default:
- warn_stab (orig, "unknown virtual character for baseclass");
- virtual = false;
- break;
- }
- ++*pp;
-
- switch (**pp)
- {
- case '0':
- visibility = DEBUG_VISIBILITY_PRIVATE;
- break;
- case '1':
- visibility = DEBUG_VISIBILITY_PROTECTED;
- break;
- case '2':
- visibility = DEBUG_VISIBILITY_PUBLIC;
- break;
- default:
- warn_stab (orig, "unknown visibility character for baseclass");
- visibility = DEBUG_VISIBILITY_PUBLIC;
- break;
- }
- ++*pp;
-
- /* The remaining value is the bit offset of the portion of the
- object corresponding to this baseclass. Always zero in the
- absence of multiple inheritance. */
- bitpos = parse_number (pp, (boolean *) NULL);
- if (**pp != ',')
- {
- bad_stab (orig);
- return false;
- }
- ++*pp;
-
- type = parse_stab_type (dhandle, info, (const char *) NULL, pp,
- (debug_type **) NULL);
- if (type == DEBUG_TYPE_NULL)
- return false;
-
- classes[i] = debug_make_baseclass (dhandle, type, bitpos, virtual,
- visibility);
- if (classes[i] == DEBUG_BASECLASS_NULL)
- return false;
-
- if (**pp != ';')
- return false;
- ++*pp;
- }
-
- classes[i] = DEBUG_BASECLASS_NULL;
-
- *retp = classes;
-
- return true;
-}
-
-/* Read struct or class data fields. They have the form:
-
- NAME : [VISIBILITY] TYPENUM , BITPOS , BITSIZE ;
-
- At the end, we see a semicolon instead of a field.
-
- In C++, this may wind up being NAME:?TYPENUM:PHYSNAME; for
- a static field.
-
- The optional VISIBILITY is one of:
-
- '/0' (VISIBILITY_PRIVATE)
- '/1' (VISIBILITY_PROTECTED)
- '/2' (VISIBILITY_PUBLIC)
- '/9' (VISIBILITY_IGNORE)
-
- or nothing, for C style fields with public visibility.
-
- Returns 1 for success, 0 for failure. */
-
-static boolean
-parse_stab_struct_fields (dhandle, info, pp, retp, staticsp)
- PTR dhandle;
- struct stab_handle *info;
- const char **pp;
- debug_field **retp;
- boolean *staticsp;
-{
- const char *orig;
- const char *p;
- debug_field *fields;
- unsigned int c;
- unsigned int alloc;
-
- *retp = NULL;
- *staticsp = false;
-
- orig = *pp;
-
- c = 0;
- alloc = 10;
- fields = (debug_field *) xmalloc (alloc * sizeof *fields);
- while (**pp != ';')
- {
- /* FIXME: gdb checks os9k_stabs here. */
-
- p = *pp;
-
- /* Add 1 to c to leave room for NULL pointer at end. */
- if (c + 1 >= alloc)
- {
- alloc += 10;
- fields = ((debug_field *)
- xrealloc ((PTR) fields, alloc * sizeof *fields));
- }
-
- /* If it starts with CPLUS_MARKER it is a special abbreviation,
- unless the CPLUS_MARKER is followed by an underscore, in
- which case it is just the name of an anonymous type, which we
- should handle like any other type name. We accept either '$'
- or '.', because a field name can never contain one of these
- characters except as a CPLUS_MARKER. */
-
- if ((*p == '$' || *p == '.') && p[1] != '_')
- {
- ++*pp;
- if (! parse_stab_cpp_abbrev (dhandle, info, pp, fields + c))
- return false;
- ++c;
- continue;
- }
-
- /* Look for the ':' that separates the field name from the field
- values. Data members are delimited by a single ':', while member
- functions are delimited by a pair of ':'s. When we hit the member
- functions (if any), terminate scan loop and return. */
-
- p = strchr (p, ':');
- if (p == NULL)
- {
- bad_stab (orig);
- return false;
- }
-
- if (p[1] == ':')
- break;
-
- if (! parse_stab_one_struct_field (dhandle, info, pp, p, fields + c,
- staticsp))
- return false;
-
- ++c;
- }
-
- fields[c] = DEBUG_FIELD_NULL;
-
- *retp = fields;
-
- return true;
-}
-
-/* Special GNU C++ name. */
-
-static boolean
-parse_stab_cpp_abbrev (dhandle, info, pp, retp)
- PTR dhandle;
- struct stab_handle *info;
- const char **pp;
- debug_field *retp;
-{
- const char *orig;
- int cpp_abbrev;
- debug_type context;
- const char *name;
- const char *typename;
- debug_type type;
- bfd_vma bitpos;
-
- *retp = DEBUG_FIELD_NULL;
-
- orig = *pp;
-
- if (**pp != 'v')
- {
- bad_stab (*pp);
- return false;
- }
- ++*pp;
-
- cpp_abbrev = **pp;
- ++*pp;
-
- /* At this point, *pp points to something like "22:23=*22...", where
- the type number before the ':' is the "context" and everything
- after is a regular type definition. Lookup the type, find it's
- name, and construct the field name. */
-
- context = parse_stab_type (dhandle, info, (const char *) NULL, pp,
- (debug_type **) NULL);
- if (context == DEBUG_TYPE_NULL)
- return false;
-
- switch (cpp_abbrev)
- {
- case 'f':
- /* $vf -- a virtual function table pointer. */
- name = "_vptr$";
- break;
- case 'b':
- /* $vb -- a virtual bsomethingorother */
- typename = debug_get_type_name (dhandle, context);
- if (typename == NULL)
- {
- warn_stab (orig, "unnamed $vb type");
- typename = "FOO";
- }
- name = concat ("_vb$", typename, (const char *) NULL);
- break;
- default:
- warn_stab (orig, "unrecognized C++ abbreviation");
- name = "INVALID_CPLUSPLUS_ABBREV";
- break;
- }
-
- if (**pp != ':')
- {
- bad_stab (orig);
- return false;
- }
- ++*pp;
-
- type = parse_stab_type (dhandle, info, (const char *) NULL, pp,
- (debug_type **) NULL);
- if (**pp != ',')
- {
- bad_stab (orig);
- return false;
- }
- ++*pp;
-
- bitpos = parse_number (pp, (boolean *) NULL);
- if (**pp != ';')
- {
- bad_stab (orig);
- return false;
- }
- ++*pp;
-
- *retp = debug_make_field (dhandle, name, type, bitpos, 0,
- DEBUG_VISIBILITY_PRIVATE);
- if (*retp == DEBUG_FIELD_NULL)
- return false;
-
- return true;
-}
-
-/* Parse a single field in a struct or union. */
-
-static boolean
-parse_stab_one_struct_field (dhandle, info, pp, p, retp, staticsp)
- PTR dhandle;
- struct stab_handle *info;
- const char **pp;
- const char *p;
- debug_field *retp;
- boolean *staticsp;
-{
- const char *orig;
- char *name;
- enum debug_visibility visibility;
- debug_type type;
- bfd_vma bitpos;
- bfd_vma bitsize;
-
- orig = *pp;
-
- /* FIXME: gdb checks ARM_DEMANGLING here. */
-
- name = savestring (*pp, p - *pp);
-
- *pp = p + 1;
-
- if (**pp != '/')
- visibility = DEBUG_VISIBILITY_PUBLIC;
- else
- {
- ++*pp;
- switch (**pp)
- {
- case '0':
- visibility = DEBUG_VISIBILITY_PRIVATE;
- break;
- case '1':
- visibility = DEBUG_VISIBILITY_PROTECTED;
- break;
- case '2':
- visibility = DEBUG_VISIBILITY_PUBLIC;
- break;
- default:
- warn_stab (orig, "unknown visibility character for field");
- visibility = DEBUG_VISIBILITY_PUBLIC;
- break;
- }
- ++*pp;
- }
-
- type = parse_stab_type (dhandle, info, (const char *) NULL, pp,
- (debug_type **) NULL);
- if (type == DEBUG_TYPE_NULL)
- return false;
-
- if (**pp == ':')
- {
- char *varname;
-
- /* This is a static class member. */
- ++*pp;
- p = strchr (*pp, ';');
- if (p == NULL)
- {
- bad_stab (orig);
- return false;
- }
-
- varname = savestring (*pp, p - *pp);
-
- *pp = p + 1;
-
- *retp = debug_make_static_member (dhandle, name, type, varname,
- visibility);
- *staticsp = true;
-
- return true;
- }
-
- if (**pp != ',')
- {
- bad_stab (orig);
- return false;
- }
- ++*pp;
-
- bitpos = parse_number (pp, (boolean *) NULL);
- if (**pp != ',')
- {
- bad_stab (orig);
- return false;
- }
- ++*pp;
-
- bitsize = parse_number (pp, (boolean *) NULL);
- if (**pp != ';')
- {
- bad_stab (orig);
- return false;
- }
- ++*pp;
-
- if (bitpos == 0 && bitsize == 0)
- {
- /* This can happen in two cases: (1) at least for gcc 2.4.5 or
- so, it is a field which has been optimized out. The correct
- stab for this case is to use VISIBILITY_IGNORE, but that is a
- recent invention. (2) It is a 0-size array. For example
- union { int num; char str[0]; } foo. Printing "<no value>"
- for str in "p foo" is OK, since foo.str (and thus foo.str[3])
- will continue to work, and a 0-size array as a whole doesn't
- have any contents to print.
-
- I suspect this probably could also happen with gcc -gstabs
- (not -gstabs+) for static fields, and perhaps other C++
- extensions. Hopefully few people use -gstabs with gdb, since
- it is intended for dbx compatibility. */
- visibility = DEBUG_VISIBILITY_IGNORE;
- }
-
- /* FIXME: gdb does some stuff here to mark fields as unpacked. */
-
- *retp = debug_make_field (dhandle, name, type, bitpos, bitsize, visibility);
-
- return true;
-}
-
-/* Read member function stabs info for C++ classes. The form of each member
- function data is:
-
- NAME :: TYPENUM[=type definition] ARGS : PHYSNAME ;
-
- An example with two member functions is:
-
- afunc1::20=##15;:i;2A.;afunc2::20:i;2A.;
-
- For the case of overloaded operators, the format is op$::*.funcs, where
- $ is the CPLUS_MARKER (usually '$'), `*' holds the place for an operator
- name (such as `+=') and `.' marks the end of the operator name. */
-
-static boolean
-parse_stab_members (dhandle, info, tagname, pp, typenums, retp)
- PTR dhandle;
- struct stab_handle *info;
- const char *tagname;
- const char **pp;
- const int *typenums;
- debug_method **retp;
-{
- const char *orig;
- debug_method *methods;
- unsigned int c;
- unsigned int alloc;
-
- *retp = NULL;
-
- orig = *pp;
-
- alloc = 0;
- methods = NULL;
- c = 0;
-
- while (**pp != ';')
- {
- const char *p;
- char *name;
- debug_method_variant *variants;
- unsigned int cvars;
- unsigned int allocvars;
- debug_type look_ahead_type;
-
- p = strchr (*pp, ':');
- if (p == NULL || p[1] != ':')
- break;
-
- /* FIXME: Some systems use something other than '$' here. */
- if ((*pp)[0] != 'o' || (*pp)[1] != 'p' || (*pp)[2] != '$')
- {
- name = savestring (*pp, p - *pp);
- *pp = p + 2;
- }
- else
- {
- /* This is a completely wierd case. In order to stuff in the
- names that might contain colons (the usual name delimiter),
- Mike Tiemann defined a different name format which is
- signalled if the identifier is "op$". In that case, the
- format is "op$::XXXX." where XXXX is the name. This is
- used for names like "+" or "=". YUUUUUUUK! FIXME! */
- *pp = p + 2;
- for (p = *pp; *p != '.' && *p != '\0'; p++)
- ;
- if (*p != '.')
- {
- bad_stab (orig);
- return false;
- }
- name = savestring (*pp, p - *pp);
- *pp = p + 1;
- }
-
- allocvars = 10;
- variants = ((debug_method_variant *)
- xmalloc (allocvars * sizeof *variants));
- cvars = 0;
-
- look_ahead_type = DEBUG_TYPE_NULL;
-
- do
- {
- debug_type type;
- boolean stub;
- char *argtypes;
- enum debug_visibility visibility;
- boolean constp, volatilep, staticp;
- bfd_vma voffset;
- debug_type context;
- const char *physname;
- boolean varargs;
-
- if (look_ahead_type != DEBUG_TYPE_NULL)
- {
- /* g++ version 1 kludge */
- type = look_ahead_type;
- look_ahead_type = DEBUG_TYPE_NULL;
- }
- else
- {
- type = parse_stab_type (dhandle, info, (const char *) NULL, pp,
- (debug_type **) NULL);
- if (type == DEBUG_TYPE_NULL)
- return false;
- if (**pp != ':')
- {
- bad_stab (orig);
- return false;
- }
- }
-
- ++*pp;
- p = strchr (*pp, ';');
- if (p == NULL)
- {
- bad_stab (orig);
- return false;
- }
-
- stub = false;
- if (debug_get_type_kind (dhandle, type) == DEBUG_KIND_METHOD
- && debug_get_parameter_types (dhandle, type, &varargs) == NULL)
- stub = true;
-
- argtypes = savestring (*pp, p - *pp);
- *pp = p + 1;
-
- switch (**pp)
- {
- case '0':
- visibility = DEBUG_VISIBILITY_PRIVATE;
- break;
- case '1':
- visibility = DEBUG_VISIBILITY_PROTECTED;
- break;
- default:
- visibility = DEBUG_VISIBILITY_PUBLIC;
- break;
- }
- ++*pp;
-
- constp = false;
- volatilep = false;
- switch (**pp)
- {
- case 'A':
- /* Normal function. */
- ++*pp;
- break;
- case 'B':
- /* const member function. */
- constp = true;
- ++*pp;
- break;
- case 'C':
- /* volatile member function. */
- volatilep = true;
- ++*pp;
- break;
- case 'D':
- /* const volatile member function. */
- constp = true;
- volatilep = true;
- ++*pp;
- break;
- case '*':
- case '?':
- case '.':
- /* File compiled with g++ version 1; no information. */
- break;
- default:
- warn_stab (orig, "const/volatile indicator missing");
- break;
- }
-
- staticp = false;
- switch (**pp)
- {
- case '*':
- /* virtual member function, followed by index. The sign
- bit is supposedly set to distinguish
- pointers-to-methods from virtual function indicies. */
- ++*pp;
- voffset = parse_number (pp, (boolean *) NULL);
- if (**pp != ';')
- {
- bad_stab (orig);
- return false;
- }
- ++*pp;
- voffset &= 0x7fffffff;
-
- if (**pp == ';' || *pp == '\0')
- {
- /* Must be g++ version 1. */
- context = DEBUG_TYPE_NULL;
- }
- else
- {
- /* Figure out from whence this virtual function
- came. It may belong to virtual function table of
- one of its baseclasses. */
- look_ahead_type = parse_stab_type (dhandle, info,
- (const char *) NULL,
- pp,
- (debug_type **) NULL);
- if (**pp == ':')
- {
- /* g++ version 1 overloaded methods. */
- context = DEBUG_TYPE_NULL;
- }
- else
- {
- context = look_ahead_type;
- look_ahead_type = DEBUG_TYPE_NULL;
- if (**pp != ';')
- {
- bad_stab (orig);
- return false;
- }
- ++*pp;
- }
- }
- break;
-
- case '?':
- /* static member function. */
- ++*pp;
- staticp = true;
- voffset = 0;
- context = DEBUG_TYPE_NULL;
- if (strncmp (argtypes, name, strlen (name)) != 0)
- stub = true;
- break;
-
- default:
- warn_stab (orig, "member function type missing");
- voffset = 0;
- context = DEBUG_TYPE_NULL;
- break;
-
- case '.':
- ++*pp;
- voffset = 0;
- context = DEBUG_TYPE_NULL;
- break;
- }
-
- /* If the type is not a stub, then the argtypes string is
- the physical name of the function. Otherwise the
- argtypes string is the mangled form of the argument
- types, and the full type and the physical name must be
- extracted from them. */
- if (! stub)
- physname = argtypes;
- else
- {
- debug_type class_type, return_type;
-
- class_type = stab_find_type (dhandle, info, typenums);
- if (class_type == DEBUG_TYPE_NULL)
- return false;
- return_type = debug_get_return_type (dhandle, type);
- if (return_type == DEBUG_TYPE_NULL)
- {
- bad_stab (orig);
- return false;
- }
- type = parse_stab_argtypes (dhandle, info, class_type, name,
- tagname, return_type, argtypes,
- constp, volatilep, &physname);
- if (type == DEBUG_TYPE_NULL)
- return false;
- }
-
- if (cvars + 1 >= allocvars)
- {
- allocvars += 10;
- variants = ((debug_method_variant *)
- xrealloc ((PTR) variants,
- allocvars * sizeof *variants));
- }
-
- if (! staticp)
- variants[cvars] = debug_make_method_variant (dhandle, physname,
- type, visibility,
- constp, volatilep,
- voffset, context);
- else
- variants[cvars] = debug_make_static_method_variant (dhandle,
- physname,
- type,
- visibility,
- constp,
- volatilep);
- if (variants[cvars] == DEBUG_METHOD_VARIANT_NULL)
- return false;
-
- ++cvars;
- }
- while (**pp != ';' && **pp != '\0');
-
- variants[cvars] = DEBUG_METHOD_VARIANT_NULL;
-
- if (**pp != '\0')
- ++*pp;
-
- if (c + 1 >= alloc)
- {
- alloc += 10;
- methods = ((debug_method *)
- xrealloc ((PTR) methods, alloc * sizeof *methods));
- }
-
- methods[c] = debug_make_method (dhandle, name, variants);
-
- ++c;
- }
-
- if (methods != NULL)
- methods[c] = DEBUG_METHOD_NULL;
-
- *retp = methods;
-
- return true;
-}
-
-/* Parse a string representing argument types for a method. Stabs
- tries to save space by packing argument types into a mangled
- string. This string should give us enough information to extract
- both argument types and the physical name of the function, given
- the tag name. */
-
-static debug_type
-parse_stab_argtypes (dhandle, info, class_type, fieldname, tagname,
- return_type, argtypes, constp, volatilep, pphysname)
- PTR dhandle;
- struct stab_handle *info;
- debug_type class_type;
- const char *fieldname;
- const char *tagname;
- debug_type return_type;
- const char *argtypes;
- boolean constp;
- boolean volatilep;
- const char **pphysname;
-{
- boolean is_full_physname_constructor;
- boolean is_constructor;
- boolean is_destructor;
- debug_type *args;
- boolean varargs;
-
- /* Constructors are sometimes handled specially. */
- is_full_physname_constructor = ((argtypes[0] == '_'
- && argtypes[1] == '_'
- && (isdigit ((unsigned char) argtypes[2])
- || argtypes[2] == 'Q'
- || argtypes[2] == 't'))
- || strncmp (argtypes, "__ct", 4) == 0);
-
- is_constructor = (is_full_physname_constructor
- || (tagname != NULL
- && strcmp (fieldname, tagname) == 0));
- is_destructor = ((argtypes[0] == '_'
- && (argtypes[1] == '$' || argtypes[1] == '.')
- && argtypes[2] == '_')
- || strncmp (argtypes, "__dt", 4) == 0);
-
- if (is_destructor || is_full_physname_constructor)
- *pphysname = argtypes;
- else
- {
- unsigned int len;
- const char *const_prefix;
- const char *volatile_prefix;
- char buf[20];
- unsigned int mangled_name_len;
- char *physname;
-
- len = tagname == NULL ? 0 : strlen (tagname);
- const_prefix = constp ? "C" : "";
- volatile_prefix = volatilep ? "V" : "";
-
- if (len == 0)
- sprintf (buf, "__%s%s", const_prefix, volatile_prefix);
- else if (tagname != NULL && strchr (tagname, '<') != NULL)
- {
- /* Template methods are fully mangled. */
- sprintf (buf, "__%s%s", const_prefix, volatile_prefix);
- tagname = NULL;
- len = 0;
- }
- else
- sprintf (buf, "__%s%s%d", const_prefix, volatile_prefix, len);
-
- mangled_name_len = ((is_constructor ? 0 : strlen (fieldname))
- + strlen (buf)
- + len
- + strlen (argtypes)
- + 1);
-
- if (fieldname[0] == 'o'
- && fieldname[1] == 'p'
- && (fieldname[2] == '$' || fieldname[2] == '.'))
- {
- const char *opname;
-
- opname = cplus_mangle_opname (fieldname + 3, 0);
- if (opname == NULL)
- {
- fprintf (stderr, "No mangling for \"%s\"\n", fieldname);
- return DEBUG_TYPE_NULL;
- }
- mangled_name_len += strlen (opname);
- physname = (char *) xmalloc (mangled_name_len);
- strncpy (physname, fieldname, 3);
- strcpy (physname + 3, opname);
- }
- else
- {
- physname = (char *) xmalloc (mangled_name_len);
- if (is_constructor)
- physname[0] = '\0';
- else
- strcpy (physname, fieldname);
- }
-
- strcat (physname, buf);
- if (tagname != NULL)
- strcat (physname, tagname);
- strcat (physname, argtypes);
-
- *pphysname = physname;
- }
-
- if (*argtypes == '\0' || is_destructor)
- {
- args = (debug_type *) xmalloc (sizeof *args);
- *args = NULL;
- return debug_make_method_type (dhandle, return_type, class_type, args,
- false);
- }
-
- args = stab_demangle_argtypes (dhandle, info, *pphysname, &varargs);
- if (args == NULL)
- return DEBUG_TYPE_NULL;
-
- return debug_make_method_type (dhandle, return_type, class_type, args,
- varargs);
-}
-
-/* The tail end of stabs for C++ classes that contain a virtual function
- pointer contains a tilde, a %, and a type number.
- The type number refers to the base class (possibly this class itself) which
- contains the vtable pointer for the current class.
-
- This function is called when we have parsed all the method declarations,
- so we can look for the vptr base class info. */
-
-static boolean
-parse_stab_tilde_field (dhandle, info, pp, typenums, retvptrbase, retownvptr)
- PTR dhandle;
- struct stab_handle *info;
- const char **pp;
- const int *typenums;
- debug_type *retvptrbase;
- boolean *retownvptr;
-{
- const char *orig;
- const char *hold;
- int vtypenums[2];
-
- *retvptrbase = DEBUG_TYPE_NULL;
- *retownvptr = false;
-
- orig = *pp;
-
- /* If we are positioned at a ';', then skip it. */
- if (**pp == ';')
- ++*pp;
-
- if (**pp != '~')
- return true;
-
- ++*pp;
-
- if (**pp == '=' || **pp == '+' || **pp == '-')
- {
- /* Obsolete flags that used to indicate the presence of
- constructors and/or destructors. */
- ++*pp;
- }
-
- if (**pp != '%')
- return true;
-
- ++*pp;
-
- hold = *pp;
-
- /* The next number is the type number of the base class (possibly
- our own class) which supplies the vtable for this class. */
- if (! parse_stab_type_number (pp, vtypenums))
- return false;
-
- if (vtypenums[0] == typenums[0]
- && vtypenums[1] == typenums[1])
- *retownvptr = true;
- else
- {
- debug_type vtype;
- const char *p;
-
- *pp = hold;
-
- vtype = parse_stab_type (dhandle, info, (const char *) NULL, pp,
- (debug_type **) NULL);
- for (p = *pp; *p != ';' && *p != '\0'; p++)
- ;
- if (*p != ';')
- {
- bad_stab (orig);
- return false;
- }
-
- *retvptrbase = vtype;
-
- *pp = p + 1;
- }
-
- return true;
-}
-
-/* Read a definition of an array type. */
-
-static debug_type
-parse_stab_array_type (dhandle, info, pp, stringp)
- PTR dhandle;
- struct stab_handle *info;
- const char **pp;
- boolean stringp;
-{
- const char *orig;
- const char *p;
- int typenums[2];
- debug_type index_type;
- boolean adjustable;
- bfd_signed_vma lower, upper;
- debug_type element_type;
-
- /* Format of an array type:
- "ar<index type>;lower;upper;<array_contents_type>".
- OS9000: "arlower,upper;<array_contents_type>".
-
- Fortran adjustable arrays use Adigits or Tdigits for lower or upper;
- for these, produce a type like float[][]. */
-
- orig = *pp;
-
- /* FIXME: gdb checks os9k_stabs here. */
-
- /* If the index type is type 0, we take it as int. */
- p = *pp;
- if (! parse_stab_type_number (&p, typenums))
- return DEBUG_TYPE_NULL;
- if (typenums[0] == 0 && typenums[1] == 0 && **pp != '=')
- {
- index_type = debug_find_named_type (dhandle, "int");
- if (index_type == DEBUG_TYPE_NULL)
- {
- index_type = debug_make_int_type (dhandle, 4, false);
- if (index_type == DEBUG_TYPE_NULL)
- return DEBUG_TYPE_NULL;
- }
- *pp = p;
- }
- else
- {
- index_type = parse_stab_type (dhandle, info, (const char *) NULL, pp,
- (debug_type **) NULL);
- }
-
- if (**pp != ';')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
-
- adjustable = false;
-
- if (! isdigit ((unsigned char) **pp) && **pp != '-')
- {
- ++*pp;
- adjustable = true;
- }
-
- lower = (bfd_signed_vma) parse_number (pp, (boolean *) NULL);
- if (**pp != ';')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
-
- if (! isdigit ((unsigned char) **pp) && **pp != '-')
- {
- ++*pp;
- adjustable = true;
- }
-
- upper = (bfd_signed_vma) parse_number (pp, (boolean *) NULL);
- if (**pp != ';')
- {
- bad_stab (orig);
- return DEBUG_TYPE_NULL;
- }
- ++*pp;
-
- element_type = parse_stab_type (dhandle, info, (const char *) NULL, pp,
- (debug_type **) NULL);
- if (element_type == DEBUG_TYPE_NULL)
- return DEBUG_TYPE_NULL;
-
- if (adjustable)
- {
- lower = 0;
- upper = -1;
- }
-
- return debug_make_array_type (dhandle, element_type, index_type, lower,
- upper, stringp);
-}
-
-/* This struct holds information about files we have seen using
- N_BINCL. */
-
-struct bincl_file
-{
- /* The next N_BINCL file. */
- struct bincl_file *next;
- /* The next N_BINCL on the stack. */
- struct bincl_file *next_stack;
- /* The file name. */
- const char *name;
- /* The hash value. */
- bfd_vma hash;
- /* The file index. */
- unsigned int file;
- /* The list of types defined in this file. */
- struct stab_types *file_types;
-};
-
-/* Start a new N_BINCL file, pushing it onto the stack. */
-
-static void
-push_bincl (info, name, hash)
- struct stab_handle *info;
- const char *name;
- bfd_vma hash;
-{
- struct bincl_file *n;
-
- n = (struct bincl_file *) xmalloc (sizeof *n);
- n->next = info->bincl_list;
- n->next_stack = info->bincl_stack;
- n->name = name;
- n->hash = hash;
- n->file = info->files;
- n->file_types = NULL;
- info->bincl_list = n;
- info->bincl_stack = n;
-
- ++info->files;
- info->file_types = ((struct stab_types **)
- xrealloc ((PTR) info->file_types,
- (info->files
- * sizeof *info->file_types)));
- info->file_types[n->file] = NULL;
-}
-
-/* Finish an N_BINCL file, at an N_EINCL, popping the name off the
- stack. */
-
-static const char *
-pop_bincl (info)
- struct stab_handle *info;
-{
- struct bincl_file *o;
-
- o = info->bincl_stack;
- if (o == NULL)
- return info->main_filename;
- info->bincl_stack = o->next_stack;
-
- o->file_types = info->file_types[o->file];
-
- if (info->bincl_stack == NULL)
- return info->main_filename;
- return info->bincl_stack->name;
-}
-
-/* Handle an N_EXCL: get the types from the corresponding N_BINCL. */
-
-static boolean
-find_excl (info, name, hash)
- struct stab_handle *info;
- const char *name;
- bfd_vma hash;
-{
- struct bincl_file *l;
-
- ++info->files;
- info->file_types = ((struct stab_types **)
- xrealloc ((PTR) info->file_types,
- (info->files
- * sizeof *info->file_types)));
-
- for (l = info->bincl_list; l != NULL; l = l->next)
- if (l->hash == hash && strcmp (l->name, name) == 0)
- break;
- if (l == NULL)
- {
- warn_stab (name, "Undefined N_EXCL");
- info->file_types[info->files - 1] = NULL;
- return true;
- }
-
- info->file_types[info->files - 1] = l->file_types;
-
- return true;
-}
-
-/* Handle a variable definition. gcc emits variable definitions for a
- block before the N_LBRAC, so we must hold onto them until we see
- it. The SunPRO compiler emits variable definitions after the
- N_LBRAC, so we can call debug_record_variable immediately. */
-
-static boolean
-stab_record_variable (dhandle, info, name, type, kind, val)
- PTR dhandle;
- struct stab_handle *info;
- const char *name;
- debug_type type;
- enum debug_var_kind kind;
- bfd_vma val;
-{
- struct stab_pending_var *v;
-
- if ((kind == DEBUG_GLOBAL || kind == DEBUG_STATIC)
- || ! info->within_function
- || (info->gcc_compiled == 0 && info->n_opt_found))
- return debug_record_variable (dhandle, name, type, kind, val);
-
- v = (struct stab_pending_var *) xmalloc (sizeof *v);
- memset (v, 0, sizeof *v);
-
- v->next = info->pending;
- v->name = name;
- v->type = type;
- v->kind = kind;
- v->val = val;
- info->pending = v;
-
- return true;
-}
-
-/* Emit pending variable definitions. This is called after we see the
- N_LBRAC that starts the block. */
-
-static boolean
-stab_emit_pending_vars (dhandle, info)
- PTR dhandle;
- struct stab_handle *info;
-{
- struct stab_pending_var *v;
-
- v = info->pending;
- while (v != NULL)
- {
- struct stab_pending_var *next;
-
- if (! debug_record_variable (dhandle, v->name, v->type, v->kind, v->val))
- return false;
-
- next = v->next;
- free (v);
- v = next;
- }
-
- info->pending = NULL;
-
- return true;
-}
-
-/* Find the slot for a type in the database. */
-
-static debug_type *
-stab_find_slot (info, typenums)
- struct stab_handle *info;
- const int *typenums;
-{
- int filenum;
- int index;
- struct stab_types **ps;
-
- filenum = typenums[0];
- index = typenums[1];
-
- if (filenum < 0 || (unsigned int) filenum >= info->files)
- {
- fprintf (stderr, "Type file number %d out of range\n", filenum);
- return NULL;
- }
- if (index < 0)
- {
- fprintf (stderr, "Type index number %d out of range\n", index);
- return NULL;
- }
-
- ps = info->file_types + filenum;
-
- while (index >= STAB_TYPES_SLOTS)
- {
- if (*ps == NULL)
- {
- *ps = (struct stab_types *) xmalloc (sizeof **ps);
- memset (*ps, 0, sizeof **ps);
- }
- ps = &(*ps)->next;
- index -= STAB_TYPES_SLOTS;
- }
- if (*ps == NULL)
- {
- *ps = (struct stab_types *) xmalloc (sizeof **ps);
- memset (*ps, 0, sizeof **ps);
- }
-
- return (*ps)->types + index;
-}
-
-/* Find a type given a type number. If the type has not been
- allocated yet, create an indirect type. */
-
-static debug_type
-stab_find_type (dhandle, info, typenums)
- PTR dhandle;
- struct stab_handle *info;
- const int *typenums;
-{
- debug_type *slot;
-
- if (typenums[0] == 0 && typenums[1] < 0)
- {
- /* A negative type number indicates an XCOFF builtin type. */
- return stab_xcoff_builtin_type (dhandle, info, typenums[1]);
- }
-
- slot = stab_find_slot (info, typenums);
- if (slot == NULL)
- return DEBUG_TYPE_NULL;
-
- if (*slot == DEBUG_TYPE_NULL)
- return debug_make_indirect_type (dhandle, slot, (const char *) NULL);
-
- return *slot;
-}
-
-/* Record that a given type number refers to a given type. */
-
-static boolean
-stab_record_type (dhandle, info, typenums, type)
- PTR dhandle;
- struct stab_handle *info;
- const int *typenums;
- debug_type type;
-{
- debug_type *slot;
-
- slot = stab_find_slot (info, typenums);
- if (slot == NULL)
- return false;
-
- /* gdb appears to ignore type redefinitions, so we do as well. */
-
- *slot = type;
-
- return true;
-}
-
-/* Return an XCOFF builtin type. */
-
-static debug_type
-stab_xcoff_builtin_type (dhandle, info, typenum)
- PTR dhandle;
- struct stab_handle *info;
- int typenum;
-{
- debug_type rettype;
- const char *name;
-
- if (typenum >= 0 || typenum < -XCOFF_TYPE_COUNT)
- {
- fprintf (stderr, "Unrecognized XCOFF type %d\n", typenum);
- return DEBUG_TYPE_NULL;
- }
- if (info->xcoff_types[-typenum] != NULL)
- return info->xcoff_types[-typenum];
-
- switch (-typenum)
- {
- case 1:
- /* The size of this and all the other types are fixed, defined
- by the debugging format. */
- name = "int";
- rettype = debug_make_int_type (dhandle, 4, false);
- break;
- case 2:
- name = "char";
- rettype = debug_make_int_type (dhandle, 1, false);
- break;
- case 3:
- name = "short";
- rettype = debug_make_int_type (dhandle, 2, false);
- break;
- case 4:
- name = "long";
- rettype = debug_make_int_type (dhandle, 4, false);
- break;
- case 5:
- name = "unsigned char";
- rettype = debug_make_int_type (dhandle, 1, true);
- break;
- case 6:
- name = "signed char";
- rettype = debug_make_int_type (dhandle, 1, false);
- break;
- case 7:
- name = "unsigned short";
- rettype = debug_make_int_type (dhandle, 2, true);
- break;
- case 8:
- name = "unsigned int";
- rettype = debug_make_int_type (dhandle, 4, true);
- break;
- case 9:
- name = "unsigned";
- rettype = debug_make_int_type (dhandle, 4, true);
- case 10:
- name = "unsigned long";
- rettype = debug_make_int_type (dhandle, 4, true);
- break;
- case 11:
- name = "void";
- rettype = debug_make_void_type (dhandle);
- break;
- case 12:
- /* IEEE single precision (32 bit). */
- name = "float";
- rettype = debug_make_float_type (dhandle, 4);
- break;
- case 13:
- /* IEEE double precision (64 bit). */
- name = "double";
- rettype = debug_make_float_type (dhandle, 8);
- break;
- case 14:
- /* This is an IEEE double on the RS/6000, and different machines
- with different sizes for "long double" should use different
- negative type numbers. See stabs.texinfo. */
- name = "long double";
- rettype = debug_make_float_type (dhandle, 8);
- break;
- case 15:
- name = "integer";
- rettype = debug_make_int_type (dhandle, 4, false);
- break;
- case 16:
- name = "boolean";
- rettype = debug_make_bool_type (dhandle, 4);
- break;
- case 17:
- name = "short real";
- rettype = debug_make_float_type (dhandle, 4);
- break;
- case 18:
- name = "real";
- rettype = debug_make_float_type (dhandle, 8);
- break;
- case 19:
- /* FIXME */
- name = "stringptr";
- rettype = NULL;
- break;
- case 20:
- /* FIXME */
- name = "character";
- rettype = debug_make_int_type (dhandle, 1, true);
- break;
- case 21:
- name = "logical*1";
- rettype = debug_make_bool_type (dhandle, 1);
- break;
- case 22:
- name = "logical*2";
- rettype = debug_make_bool_type (dhandle, 2);
- break;
- case 23:
- name = "logical*4";
- rettype = debug_make_bool_type (dhandle, 4);
- break;
- case 24:
- name = "logical";
- rettype = debug_make_bool_type (dhandle, 4);
- break;
- case 25:
- /* Complex type consisting of two IEEE single precision values. */
- name = "complex";
- rettype = debug_make_complex_type (dhandle, 8);
- break;
- case 26:
- /* Complex type consisting of two IEEE double precision values. */
- name = "double complex";
- rettype = debug_make_complex_type (dhandle, 16);
- break;
- case 27:
- name = "integer*1";
- rettype = debug_make_int_type (dhandle, 1, false);
- break;
- case 28:
- name = "integer*2";
- rettype = debug_make_int_type (dhandle, 2, false);
- break;
- case 29:
- name = "integer*4";
- rettype = debug_make_int_type (dhandle, 4, false);
- break;
- case 30:
- /* FIXME */
- name = "wchar";
- rettype = debug_make_int_type (dhandle, 2, false);
- break;
- case 31:
- name = "long long";
- rettype = debug_make_int_type (dhandle, 8, false);
- break;
- case 32:
- name = "unsigned long long";
- rettype = debug_make_int_type (dhandle, 8, true);
- break;
- case 33:
- name = "logical*8";
- rettype = debug_make_bool_type (dhandle, 8);
- break;
- case 34:
- name = "integer*8";
- rettype = debug_make_int_type (dhandle, 8, false);
- break;
- default:
- abort ();
- }
-
- rettype = debug_name_type (dhandle, name, rettype);
-
- info->xcoff_types[-typenum] = rettype;
-
- return rettype;
-}
-
-/* Find or create a tagged type. */
-
-static debug_type
-stab_find_tagged_type (dhandle, info, p, len, kind)
- PTR dhandle;
- struct stab_handle *info;
- const char *p;
- int len;
- enum debug_type_kind kind;
-{
- char *name;
- debug_type dtype;
- struct stab_tag *st;
-
- name = savestring (p, len);
-
- /* We pass DEBUG_KIND_ILLEGAL because we want all tags in the same
- namespace. This is right for C, and I don't know how to handle
- other languages. FIXME. */
- dtype = debug_find_tagged_type (dhandle, name, DEBUG_KIND_ILLEGAL);
- if (dtype != DEBUG_TYPE_NULL)
- {
- free (name);
- return dtype;
- }
-
- /* We need to allocate an entry on the undefined tag list. */
- for (st = info->tags; st != NULL; st = st->next)
- {
- if (st->name[0] == name[0]
- && strcmp (st->name, name) == 0)
- {
- if (st->kind == DEBUG_KIND_ILLEGAL)
- st->kind = kind;
- free (name);
- break;
- }
- }
- if (st == NULL)
- {
- st = (struct stab_tag *) xmalloc (sizeof *st);
- memset (st, 0, sizeof *st);
-
- st->next = info->tags;
- st->name = name;
- st->kind = kind;
- st->slot = DEBUG_TYPE_NULL;
- st->type = debug_make_indirect_type (dhandle, &st->slot, name);
- info->tags = st;
- }
-
- return st->type;
-}
-
-/* In order to get the correct argument types for a stubbed method, we
- need to extract the argument types from a C++ mangled string.
- Since the argument types can refer back to the return type, this
- means that we must demangle the entire physical name. In gdb this
- is done by calling cplus_demangle and running the results back
- through the C++ expression parser. Since we have no expression
- parser, we must duplicate much of the work of cplus_demangle here.
-
- We assume that GNU style demangling is used, since this is only
- done for method stubs, and only g++ should output that form of
- debugging information. */
-
-/* This structure is used to hold a pointer to type information which
- demangling a string. */
-
-struct stab_demangle_typestring
-{
- /* The start of the type. This is not null terminated. */
- const char *typestring;
- /* The length of the type. */
- unsigned int len;
-};
-
-/* This structure is used to hold information while demangling a
- string. */
-
-struct stab_demangle_info
-{
- /* The debugging information handle. */
- PTR dhandle;
- /* The stab information handle. */
- struct stab_handle *info;
- /* The array of arguments we are building. */
- debug_type *args;
- /* Whether the method takes a variable number of arguments. */
- boolean varargs;
- /* The array of types we have remembered. */
- struct stab_demangle_typestring *typestrings;
- /* The number of typestrings. */
- unsigned int typestring_count;
- /* The number of typestring slots we have allocated. */
- unsigned int typestring_alloc;
-};
-
-static void stab_bad_demangle PARAMS ((const char *));
-static unsigned int stab_demangle_count PARAMS ((const char **));
-static boolean stab_demangle_get_count
- PARAMS ((const char **, unsigned int *));
-static boolean stab_demangle_prefix
- PARAMS ((struct stab_demangle_info *, const char **));
-static boolean stab_demangle_function_name
- PARAMS ((struct stab_demangle_info *, const char **, const char *));
-static boolean stab_demangle_signature
- PARAMS ((struct stab_demangle_info *, const char **));
-static boolean stab_demangle_qualified
- PARAMS ((struct stab_demangle_info *, const char **, debug_type *));
-static boolean stab_demangle_template
- PARAMS ((struct stab_demangle_info *, const char **));
-static boolean stab_demangle_class
- PARAMS ((struct stab_demangle_info *, const char **, const char **));
-static boolean stab_demangle_args
- PARAMS ((struct stab_demangle_info *, const char **, debug_type **,
- boolean *));
-static boolean stab_demangle_arg
- PARAMS ((struct stab_demangle_info *, const char **, debug_type **,
- unsigned int *, unsigned int *));
-static boolean stab_demangle_type
- PARAMS ((struct stab_demangle_info *, const char **, debug_type *));
-static boolean stab_demangle_fund_type
- PARAMS ((struct stab_demangle_info *, const char **, debug_type *));
-static boolean stab_demangle_remember_type
- PARAMS ((struct stab_demangle_info *, const char *, int));
-
-/* Warn about a bad demangling. */
-
-static void
-stab_bad_demangle (s)
- const char *s;
-{
- fprintf (stderr, "bad mangled name `%s'\n", s);
-}
-
-/* Get a count from a stab string. */
-
-static unsigned int
-stab_demangle_count (pp)
- const char **pp;
-{
- unsigned int count;
-
- count = 0;
- while (isdigit ((unsigned char) **pp))
- {
- count *= 10;
- count += **pp - '0';
- ++*pp;
- }
- return count;
-}
-
-/* Require a count in a string. The count may be multiple digits, in
- which case it must end in an underscore. */
-
-static boolean
-stab_demangle_get_count (pp, pi)
- const char **pp;
- unsigned int *pi;
-{
- if (! isdigit ((unsigned char) **pp))
- return false;
-
- *pi = **pp - '0';
- ++*pp;
- if (isdigit ((unsigned char) **pp))
- {
- unsigned int count;
- const char *p;
-
- count = *pi;
- p = *pp;
- do
- {
- count *= 10;
- count += *p - '0';
- ++p;
- }
- while (isdigit ((unsigned char) *p));
- if (*p == '_')
- {
- *pp = p + 1;
- *pi = count;
- }
- }
-
- return true;
-}
-
-/* This function demangles a physical name, returning a NULL
- terminated array of argument types. */
-
-static debug_type *
-stab_demangle_argtypes (dhandle, info, physname, pvarargs)
- PTR dhandle;
- struct stab_handle *info;
- const char *physname;
- boolean *pvarargs;
-{
- struct stab_demangle_info minfo;
-
- minfo.dhandle = dhandle;
- minfo.info = info;
- minfo.args = NULL;
- minfo.varargs = false;
- minfo.typestring_alloc = 10;
- minfo.typestrings = ((struct stab_demangle_typestring *)
- xmalloc (minfo.typestring_alloc
- * sizeof *minfo.typestrings));
- minfo.typestring_count = 0;
-
- /* cplus_demangle checks for special GNU mangled forms, but we can't
- see any of them in mangled method argument types. */
-
- if (! stab_demangle_prefix (&minfo, &physname))
- goto error_return;
-
- if (*physname != '\0')
- {
- if (! stab_demangle_signature (&minfo, &physname))
- goto error_return;
- }
-
- free (minfo.typestrings);
- minfo.typestrings = NULL;
-
- if (minfo.args == NULL)
- fprintf (stderr, "no argument types in mangled string\n");
-
- *pvarargs = minfo.varargs;
- return minfo.args;
-
- error_return:
- if (minfo.typestrings != NULL)
- free (minfo.typestrings);
- return NULL;
-}
-
-/* Demangle the prefix of the mangled name. */
-
-static boolean
-stab_demangle_prefix (minfo, pp)
- struct stab_demangle_info *minfo;
- const char **pp;
-{
- const char *scan;
- unsigned int i;
-
- /* cplus_demangle checks for global constructors and destructors,
- but we can't see them in mangled argument types. */
-
- /* Look for `__'. */
- scan = *pp;
- do
- {
- scan = strchr (scan, '_');
- }
- while (scan != NULL && *++scan != '_');
-
- if (scan == NULL)
- {
- stab_bad_demangle (*pp);
- return false;
- }
-
- --scan;
-
- /* We found `__'; move ahead to the last contiguous `__' pair. */
- i = strspn (scan, "_");
- if (i > 2)
- scan += i - 2;
-
- if (scan == *pp
- && (isdigit ((unsigned char) scan[2])
- || scan[2] == 'Q'
- || scan[2] == 't'))
- {
- /* This is a GNU style constructor name. */
- *pp = scan + 2;
- return true;
- }
- else if (scan == *pp
- && ! isdigit ((unsigned char) scan[2])
- && scan[2] != 't')
- {
- /* Look for the `__' that separates the prefix from the
- signature. */
- while (*scan == '_')
- ++scan;
- scan = strstr (scan, "__");
- if (scan == NULL || scan[2] == '\0')
- {
- stab_bad_demangle (*pp);
- return false;
- }
-
- return stab_demangle_function_name (minfo, pp, scan);
- }
- else if (scan[2] != '\0')
- {
- /* The name doesn't start with `__', but it does contain `__'. */
- return stab_demangle_function_name (minfo, pp, scan);
- }
- else
- {
- stab_bad_demangle (*pp);
- return false;
- }
- /*NOTREACHED*/
-}
-
-/* Demangle a function name prefix. The scan argument points to the
- double underscore which separates the function name from the
- signature. */
-
-static boolean
-stab_demangle_function_name (minfo, pp, scan)
- struct stab_demangle_info *minfo;
- const char **pp;
- const char *scan;
-{
- const char *name;
-
- /* The string from *pp to scan is the name of the function. We
- don't care about the name, since we just looking for argument
- types. However, for conversion operators, the name may include a
- type which we must remember in order to handle backreferences. */
-
- name = *pp;
- *pp = scan + 2;
-
- if (*pp - name >= 5
- && strncmp (name, "type", 4) == 0
- && (name[4] == '$' || name[4] == '.'))
- {
- const char *tem;
-
- /* This is a type conversion operator. */
- tem = name + 5;
- if (! stab_demangle_type (minfo, &tem, (debug_type *) NULL))
- return false;
- }
- else if (name[0] == '_'
- && name[1] == '_'
- && name[2] == 'o'
- && name[3] == 'p')
- {
- const char *tem;
-
- /* This is a type conversion operator. */
- tem = name + 4;
- if (! stab_demangle_type (minfo, &tem, (debug_type *) NULL))
- return false;
- }
-
- return true;
-}
-
-/* Demangle the signature. This is where the argument types are
- found. */
-
-static boolean
-stab_demangle_signature (minfo, pp)
- struct stab_demangle_info *minfo;
- const char **pp;
-{
- const char *orig;
- boolean expect_func, func_done;
- const char *hold;
-
- orig = *pp;
-
- expect_func = false;
- func_done = false;
- hold = NULL;
-
- while (**pp != '\0')
- {
- switch (**pp)
- {
- case 'Q':
- hold = *pp;
- if (! stab_demangle_qualified (minfo, pp, (debug_type *) NULL)
- || ! stab_demangle_remember_type (minfo, hold, *pp - hold))
- return false;
- expect_func = true;
- hold = NULL;
- break;
-
- case 'S':
- /* Static member function. FIXME: Can this happen? */
- if (hold == NULL)
- hold = *pp;
- ++*pp;
- break;
-
- case 'C':
- /* Const member function. */
- if (hold == NULL)
- hold = *pp;
- ++*pp;
- break;
-
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- if (hold == NULL)
- hold = *pp;
- if (! stab_demangle_class (minfo, pp, (const char **) NULL)
- || ! stab_demangle_remember_type (minfo, hold, *pp - hold))
- return false;
- expect_func = true;
- hold = NULL;
- break;
-
- case 'F':
- /* Function. I don't know if this actually happens with g++
- output. */
- hold = NULL;
- func_done = true;
- ++*pp;
- if (! stab_demangle_args (minfo, pp, &minfo->args, &minfo->varargs))
- return false;
- break;
-
- case 't':
- /* Template. */
- if (hold == NULL)
- hold = *pp;
- if (! stab_demangle_template (minfo, pp)
- || ! stab_demangle_remember_type (minfo, hold, *pp - hold))
- return false;
- hold = NULL;
- expect_func = true;
- break;
-
- case '_':
- /* At the outermost level, we cannot have a return type
- specified, so if we run into another '_' at this point we
- are dealing with a mangled name that is either bogus, or
- has been mangled by some algorithm we don't know how to
- deal with. So just reject the entire demangling. */
- stab_bad_demangle (orig);
- return false;
-
- default:
- /* Assume we have stumbled onto the first outermost function
- argument token, and start processing args. */
- func_done = true;
- if (! stab_demangle_args (minfo, pp, &minfo->args, &minfo->varargs))
- return false;
- break;
- }
-
- if (expect_func)
- {
- func_done = true;
- if (! stab_demangle_args (minfo, pp, &minfo->args, &minfo->varargs))
- return false;
- }
- }
-
- if (! func_done)
- {
- /* With GNU style demangling, bar__3foo is 'foo::bar(void)', and
- bar__3fooi is 'foo::bar(int)'. We get here when we find the
- first case, and need to ensure that the '(void)' gets added
- to the current declp. */
- if (! stab_demangle_args (minfo, pp, &minfo->args, &minfo->varargs))
- return false;
- }
-
- return true;
-}
-
-/* Demangle a qualified name, such as "Q25Outer5Inner" which is the
- mangled form of "Outer::Inner". */
-
-static boolean
-stab_demangle_qualified (minfo, pp, ptype)
- struct stab_demangle_info *minfo;
- const char **pp;
- debug_type *ptype;
-{
- const char *orig;
- const char *p;
- unsigned int qualifiers;
- debug_type context;
-
- orig = *pp;
-
- switch ((*pp)[1])
- {
- case '_':
- /* GNU mangled name with more than 9 classes. The count is
- preceded by an underscore (to distinguish it from the <= 9
- case) and followed by an underscore. */
- p = *pp + 2;
- if (! isdigit ((unsigned char) *p) || *p == '0')
- {
- stab_bad_demangle (orig);
- return false;
- }
- qualifiers = atoi (p);
- while (isdigit ((unsigned char) *p))
- ++p;
- if (*p != '_')
- {
- stab_bad_demangle (orig);
- return false;
- }
- *pp = p + 1;
- break;
-
- case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- qualifiers = (*pp)[1] - '0';
- /* Skip an optional underscore after the count. */
- if ((*pp)[2] == '_')
- ++*pp;
- *pp += 2;
- break;
-
- case '0':
- default:
- stab_bad_demangle (orig);
- return false;
- }
-
- context = DEBUG_TYPE_NULL;
-
- /* Pick off the names. */
- while (qualifiers-- > 0)
- {
- if (**pp == '_')
- ++*pp;
- if (**pp == 't')
- {
- /* FIXME: I don't know how to handle the ptype != NULL case
- here. */
- if (! stab_demangle_template (minfo, pp))
- return false;
- }
- else
- {
- unsigned int len;
-
- len = stab_demangle_count (pp);
- if (strlen (*pp) < len)
- {
- stab_bad_demangle (orig);
- return false;
- }
-
- if (ptype != NULL)
- {
- const debug_field *fields;
-
- fields = NULL;
- if (context != DEBUG_TYPE_NULL)
- fields = debug_get_fields (minfo->dhandle, context);
-
- context = DEBUG_TYPE_NULL;
-
- if (fields != NULL)
- {
- char *name;
-
- /* Try to find the type by looking through the
- fields of context until we find a field with the
- same type. This ought to work for a class
- defined within a class, but it won't work for,
- e.g., an enum defined within a class. stabs does
- not give us enough information to figure out the
- latter case. */
-
- name = savestring (*pp, len);
-
- for (; *fields != DEBUG_FIELD_NULL; fields++)
- {
- debug_type ft;
- const char *dn;
-
- ft = debug_get_field_type (minfo->dhandle, *fields);
- if (ft == NULL)
- return false;
- dn = debug_get_type_name (minfo->dhandle, ft);
- if (dn != NULL && strcmp (dn, name) == 0)
- {
- context = ft;
- break;
- }
- }
-
- free (name);
- }
-
- if (context == DEBUG_TYPE_NULL)
- {
- /* We have to fall back on finding the type by name.
- If there are more types to come, then this must
- be a class. Otherwise, it could be anything. */
-
- if (qualifiers == 0)
- {
- char *name;
-
- name = savestring (*pp, len);
- context = debug_find_named_type (minfo->dhandle,
- name);
- free (name);
- }
-
- if (context == DEBUG_TYPE_NULL)
- {
- context = stab_find_tagged_type (minfo->dhandle,
- minfo->info,
- *pp, len,
- (qualifiers == 0
- ? DEBUG_KIND_ILLEGAL
- : DEBUG_KIND_CLASS));
- if (context == DEBUG_TYPE_NULL)
- return false;
- }
- }
- }
-
- *pp += len;
- }
- }
-
- if (ptype != NULL)
- *ptype = context;
-
- return true;
-}
-
-/* Demangle a template. */
-
-static boolean
-stab_demangle_template (minfo, pp)
- struct stab_demangle_info *minfo;
- const char **pp;
-{
- const char *orig;
- unsigned int r, i;
-
- orig = *pp;
-
- ++*pp;
-
- /* Skip the template name. */
- r = stab_demangle_count (pp);
- if (r == 0 || strlen (*pp) < r)
- {
- stab_bad_demangle (orig);
- return false;
- }
- *pp += r;
-
- /* Get the size of the parameter list. */
- if (stab_demangle_get_count (pp, &r) == 0)
- {
- stab_bad_demangle (orig);
- return false;
- }
-
- for (i = 0; i < r; i++)
- {
- if (**pp == 'Z')
- {
- /* This is a type parameter. */
- ++*pp;
- if (! stab_demangle_type (minfo, pp, (debug_type *) NULL))
- return false;
- }
- else
- {
- const char *old_p;
- boolean pointerp, realp, integralp, charp, boolp;
- boolean done;
-
- old_p = *pp;
- pointerp = false;
- realp = false;
- integralp = false;
- charp = false;
- boolp = false;
- done = false;
-
- /* This is a value parameter. */
-
- if (! stab_demangle_type (minfo, pp, (debug_type *) NULL))
- return false;
-
- while (*old_p != '\0' && ! done)
- {
- switch (*old_p)
- {
- case 'P':
- case 'p':
- case 'R':
- pointerp = true;
- done = true;
- break;
- case 'C': /* Const. */
- case 'S': /* Signed. */
- case 'U': /* Unsigned. */
- case 'V': /* Volatile. */
- case 'F': /* Function. */
- case 'M': /* Member function. */
- case 'O': /* ??? */
- ++old_p;
- break;
- case 'Q': /* Qualified name. */
- integralp = true;
- done = true;
- break;
- case 'T': /* Remembered type. */
- abort ();
- case 'v': /* Void. */
- abort ();
- case 'x': /* Long long. */
- case 'l': /* Long. */
- case 'i': /* Int. */
- case 's': /* Short. */
- case 'w': /* Wchar_t. */
- integralp = true;
- done = true;
- break;
- case 'b': /* Bool. */
- boolp = true;
- done = true;
- break;
- case 'c': /* Char. */
- charp = true;
- done = true;
- break;
- case 'r': /* Long double. */
- case 'd': /* Double. */
- case 'f': /* Float. */
- realp = true;
- done = true;
- break;
- default:
- /* Assume it's a user defined integral type. */
- integralp = true;
- done = true;
- break;
- }
- }
-
- if (integralp)
- {
- if (**pp == 'm')
- ++*pp;
- while (isdigit ((unsigned char) **pp))
- ++*pp;
- }
- else if (charp)
- {
- unsigned int val;
-
- if (**pp == 'm')
- ++*pp;
- val = stab_demangle_count (pp);
- if (val == 0)
- {
- stab_bad_demangle (orig);
- return false;
- }
- }
- else if (boolp)
- {
- unsigned int val;
-
- val = stab_demangle_count (pp);
- if (val != 0 && val != 1)
- {
- stab_bad_demangle (orig);
- return false;
- }
- }
- else if (realp)
- {
- if (**pp == 'm')
- ++*pp;
- while (isdigit ((unsigned char) **pp))
- ++*pp;
- if (**pp == '.')
- {
- ++*pp;
- while (isdigit ((unsigned char) **pp))
- ++*pp;
- }
- if (**pp == 'e')
- {
- ++*pp;
- while (isdigit ((unsigned char) **pp))
- ++*pp;
- }
- }
- else if (pointerp)
- {
- unsigned int len;
-
- if (! stab_demangle_get_count (pp, &len))
- {
- stab_bad_demangle (orig);
- return false;
- }
- *pp += len;
- }
- }
- }
-
- return true;
-}
-
-/* Demangle a class name. */
-
-static boolean
-stab_demangle_class (minfo, pp, pstart)
- struct stab_demangle_info *minfo;
- const char **pp;
- const char **pstart;
-{
- const char *orig;
- unsigned int n;
-
- orig = *pp;
-
- n = stab_demangle_count (pp);
- if (strlen (*pp) < n)
- {
- stab_bad_demangle (orig);
- return false;
- }
-
- if (pstart != NULL)
- *pstart = *pp;
-
- *pp += n;
-
- return true;
-}
-
-/* Demangle function arguments. If the pargs argument is not NULL, it
- is set to a NULL terminated array holding the arguments. */
-
-static boolean
-stab_demangle_args (minfo, pp, pargs, pvarargs)
- struct stab_demangle_info *minfo;
- const char **pp;
- debug_type **pargs;
- boolean *pvarargs;
-{
- const char *orig;
- unsigned int alloc, count;
-
- orig = *pp;
-
- alloc = 10;
- if (pargs != NULL)
- {
- *pargs = (debug_type *) xmalloc (alloc * sizeof **pargs);
- *pvarargs = false;
- }
- count = 0;
-
- while (**pp != '_' && **pp != '\0' && **pp != 'e')
- {
- if (**pp == 'N' || **pp == 'T')
- {
- char temptype;
- unsigned int r, t;
-
- temptype = **pp;
- ++*pp;
-
- if (temptype == 'T')
- r = 1;
- else
- {
- if (! stab_demangle_get_count (pp, &r))
- {
- stab_bad_demangle (orig);
- return false;
- }
- }
-
- if (! stab_demangle_get_count (pp, &t))
- {
- stab_bad_demangle (orig);
- return false;
- }
-
- if (t >= minfo->typestring_count)
- {
- stab_bad_demangle (orig);
- return false;
- }
- while (r-- > 0)
- {
- const char *tem;
-
- tem = minfo->typestrings[t].typestring;
- if (! stab_demangle_arg (minfo, &tem, pargs, &count, &alloc))
- return false;
- }
- }
- else
- {
- if (! stab_demangle_arg (minfo, pp, pargs, &count, &alloc))
- return false;
- }
- }
-
- if (pargs != NULL)
- (*pargs)[count] = DEBUG_TYPE_NULL;
-
- if (**pp == 'e')
- {
- if (pargs != NULL)
- *pvarargs = true;
- ++*pp;
- }
-
- return true;
-}
-
-/* Demangle a single argument. */
-
-static boolean
-stab_demangle_arg (minfo, pp, pargs, pcount, palloc)
- struct stab_demangle_info *minfo;
- const char **pp;
- debug_type **pargs;
- unsigned int *pcount;
- unsigned int *palloc;
-{
- const char *start;
- debug_type type;
-
- start = *pp;
- if (! stab_demangle_type (minfo, pp,
- pargs == NULL ? (debug_type *) NULL : &type)
- || ! stab_demangle_remember_type (minfo, start, *pp - start))
- return false;
-
- if (pargs != NULL)
- {
- if (type == DEBUG_TYPE_NULL)
- return false;
-
- if (*pcount + 1 >= *palloc)
- {
- *palloc += 10;
- *pargs = ((debug_type *)
- xrealloc (*pargs, *palloc * sizeof **pargs));
- }
- (*pargs)[*pcount] = type;
- ++*pcount;
- }
-
- return true;
-}
-
-/* Demangle a type. If the ptype argument is not NULL, *ptype is set
- to the newly allocated type. */
-
-static boolean
-stab_demangle_type (minfo, pp, ptype)
- struct stab_demangle_info *minfo;
- const char **pp;
- debug_type *ptype;
-{
- const char *orig;
-
- orig = *pp;
-
- switch (**pp)
- {
- case 'P':
- case 'p':
- /* A pointer type. */
- ++*pp;
- if (! stab_demangle_type (minfo, pp, ptype))
- return false;
- if (ptype != NULL)
- *ptype = debug_make_pointer_type (minfo->dhandle, *ptype);
- break;
-
- case 'R':
- /* A reference type. */
- ++*pp;
- if (! stab_demangle_type (minfo, pp, ptype))
- return false;
- if (ptype != NULL)
- *ptype = debug_make_reference_type (minfo->dhandle, *ptype);
- break;
-
- case 'A':
- /* An array. */
- {
- unsigned long high;
-
- ++*pp;
- high = 0;
- while (**pp != '\0' && **pp != '_')
- {
- if (! isdigit ((unsigned char) **pp))
- {
- stab_bad_demangle (orig);
- return false;
- }
- high *= 10;
- high += **pp - '0';
- ++*pp;
- }
- if (**pp != '_')
- {
- stab_bad_demangle (orig);
- return false;
- }
- ++*pp;
-
- if (! stab_demangle_type (minfo, pp, ptype))
- return false;
- if (ptype != NULL)
- {
- debug_type int_type;
-
- int_type = debug_find_named_type (minfo->dhandle, "int");
- if (int_type == NULL)
- int_type = debug_make_int_type (minfo->dhandle, 4, false);
- *ptype = debug_make_array_type (minfo->dhandle, *ptype, int_type,
- 0, high, false);
- }
- }
- break;
-
- case 'T':
- /* A back reference to a remembered type. */
- {
- unsigned int i;
- const char *p;
-
- ++*pp;
- if (! stab_demangle_get_count (pp, &i))
- {
- stab_bad_demangle (orig);
- return false;
- }
- if (i >= minfo->typestring_count)
- {
- stab_bad_demangle (orig);
- return false;
- }
- p = minfo->typestrings[i].typestring;
- if (! stab_demangle_type (minfo, &p, ptype))
- return false;
- }
- break;
-
- case 'F':
- /* A function. */
- {
- debug_type *args;
- boolean varargs;
-
- ++*pp;
- if (! stab_demangle_args (minfo, pp,
- (ptype == NULL
- ? (debug_type **) NULL
- : &args),
- (ptype == NULL
- ? (boolean *) NULL
- : &varargs)))
- return false;
- if (**pp != '_')
- {
- /* cplus_demangle will accept a function without a return
- type, but I don't know when that will happen, or what
- to do if it does. */
- stab_bad_demangle (orig);
- return false;
- }
- ++*pp;
- if (! stab_demangle_type (minfo, pp, ptype))
- return false;
- if (ptype != NULL)
- *ptype = debug_make_function_type (minfo->dhandle, *ptype, args,
- varargs);
-
- }
- break;
-
- case 'M':
- case 'O':
- {
- boolean memberp, constp, volatilep;
- debug_type *args;
- boolean varargs;
- unsigned int n;
- const char *name;
-
- memberp = **pp == 'M';
- constp = false;
- volatilep = false;
- args = NULL;
- varargs = false;
-
- ++*pp;
- if (! isdigit ((unsigned char) **pp))
- {
- stab_bad_demangle (orig);
- return false;
- }
- n = stab_demangle_count (pp);
- if (strlen (*pp) < n)
- {
- stab_bad_demangle (orig);
- return false;
- }
- name = *pp;
- *pp += n;
-
- if (memberp)
- {
- if (**pp == 'C')
- {
- constp = true;
- ++*pp;
- }
- else if (**pp == 'V')
- {
- volatilep = true;
- ++*pp;
- }
- if (**pp != 'F')
- {
- stab_bad_demangle (orig);
- return false;
- }
- ++*pp;
- if (! stab_demangle_args (minfo, pp,
- (ptype == NULL
- ? (debug_type **) NULL
- : &args),
- (ptype == NULL
- ? (boolean *) NULL
- : &varargs)))
- return false;
- }
-
- if (**pp != '_')
- {
- stab_bad_demangle (orig);
- return false;
- }
- ++*pp;
-
- if (! stab_demangle_type (minfo, pp, ptype))
- return false;
-
- if (ptype != NULL)
- {
- debug_type class_type;
-
- class_type = stab_find_tagged_type (minfo->dhandle, minfo->info,
- name, (int) n,
- DEBUG_KIND_CLASS);
- if (class_type == DEBUG_TYPE_NULL)
- return false;
-
- if (! memberp)
- *ptype = debug_make_offset_type (minfo->dhandle, class_type,
- *ptype);
- else
- {
- /* FIXME: We have no way to record constp or
- volatilep. */
- *ptype = debug_make_method_type (minfo->dhandle, *ptype,
- class_type, args, varargs);
- }
- }
- }
- break;
-
- case 'G':
- ++*pp;
- if (! stab_demangle_type (minfo, pp, ptype))
- return false;
- break;
-
- case 'C':
- ++*pp;
- if (! stab_demangle_type (minfo, pp, ptype))
- return false;
- if (ptype != NULL)
- *ptype = debug_make_const_type (minfo->dhandle, *ptype);
- break;
-
- case 'Q':
- {
- const char *hold;
-
- hold = *pp;
- if (! stab_demangle_qualified (minfo, pp, ptype))
- return false;
- }
- break;
-
- default:
- if (! stab_demangle_fund_type (minfo, pp, ptype))
- return false;
- break;
- }
-
- return true;
-}
-
-/* Demangle a fundamental type. If the ptype argument is not NULL,
- *ptype is set to the newly allocated type. */
-
-static boolean
-stab_demangle_fund_type (minfo, pp, ptype)
- struct stab_demangle_info *minfo;
- const char **pp;
- debug_type *ptype;
-{
- const char *orig;
- boolean constp, volatilep, unsignedp, signedp;
- boolean done;
-
- orig = *pp;
-
- constp = false;
- volatilep = false;
- unsignedp = false;
- signedp = false;
-
- done = false;
- while (! done)
- {
- switch (**pp)
- {
- case 'C':
- constp = true;
- ++*pp;
- break;
-
- case 'U':
- unsignedp = true;
- ++*pp;
- break;
-
- case 'S':
- signedp = true;
- ++*pp;
- break;
-
- case 'V':
- volatilep = true;
- ++*pp;
- break;
-
- default:
- done = true;
- break;
- }
- }
-
- switch (**pp)
- {
- case '\0':
- case '_':
- /* cplus_demangle permits this, but I don't know what it means. */
- stab_bad_demangle (orig);
- break;
-
- case 'v': /* void */
- if (ptype != NULL)
- {
- *ptype = debug_find_named_type (minfo->dhandle, "void");
- if (*ptype == DEBUG_TYPE_NULL)
- *ptype = debug_make_void_type (minfo->dhandle);
- }
- ++*pp;
- break;
-
- case 'x': /* long long */
- if (ptype != NULL)
- {
- *ptype = debug_find_named_type (minfo->dhandle,
- (unsignedp
- ? "long long unsigned int"
- : "long long int"));
- if (*ptype == DEBUG_TYPE_NULL)
- *ptype = debug_make_int_type (minfo->dhandle, 8, unsignedp);
- }
- ++*pp;
- break;
-
- case 'l': /* long */
- if (ptype != NULL)
- {
- *ptype = debug_find_named_type (minfo->dhandle,
- (unsignedp
- ? "long unsigned int"
- : "long int"));
- if (*ptype == DEBUG_TYPE_NULL)
- *ptype = debug_make_int_type (minfo->dhandle, 4, unsignedp);
- }
- ++*pp;
- break;
-
- case 'i': /* int */
- if (ptype != NULL)
- {
- *ptype = debug_find_named_type (minfo->dhandle,
- (unsignedp
- ? "unsigned int"
- : "int"));
- if (*ptype == DEBUG_TYPE_NULL)
- *ptype = debug_make_int_type (minfo->dhandle, 4, unsignedp);
- }
- ++*pp;
- break;
-
- case 's': /* short */
- if (ptype != NULL)
- {
- *ptype = debug_find_named_type (minfo->dhandle,
- (unsignedp
- ? "short unsigned int"
- : "short int"));
- if (*ptype == DEBUG_TYPE_NULL)
- *ptype = debug_make_int_type (minfo->dhandle, 2, unsignedp);
- }
- ++*pp;
- break;
-
- case 'b': /* bool */
- if (ptype != NULL)
- {
- *ptype = debug_find_named_type (minfo->dhandle, "bool");
- if (*ptype == DEBUG_TYPE_NULL)
- *ptype = debug_make_bool_type (minfo->dhandle, 4);
- }
- ++*pp;
- break;
-
- case 'c': /* char */
- if (ptype != NULL)
- {
- *ptype = debug_find_named_type (minfo->dhandle,
- (unsignedp
- ? "unsigned char"
- : (signedp
- ? "signed char"
- : "char")));
- if (*ptype == DEBUG_TYPE_NULL)
- *ptype = debug_make_int_type (minfo->dhandle, 1, unsignedp);
- }
- ++*pp;
- break;
-
- case 'w': /* wchar_t */
- if (ptype != NULL)
- {
- *ptype = debug_find_named_type (minfo->dhandle, "__wchar_t");
- if (*ptype == DEBUG_TYPE_NULL)
- *ptype = debug_make_int_type (minfo->dhandle, 2, true);
- }
- ++*pp;
- break;
-
- case 'r': /* long double */
- if (ptype != NULL)
- {
- *ptype = debug_find_named_type (minfo->dhandle, "long double");
- if (*ptype == DEBUG_TYPE_NULL)
- *ptype = debug_make_float_type (minfo->dhandle, 8);
- }
- ++*pp;
- break;
-
- case 'd': /* double */
- if (ptype != NULL)
- {
- *ptype = debug_find_named_type (minfo->dhandle, "double");
- if (*ptype == DEBUG_TYPE_NULL)
- *ptype = debug_make_float_type (minfo->dhandle, 8);
- }
- ++*pp;
- break;
-
- case 'f': /* float */
- if (ptype != NULL)
- {
- *ptype = debug_find_named_type (minfo->dhandle, "float");
- if (*ptype == DEBUG_TYPE_NULL)
- *ptype = debug_make_float_type (minfo->dhandle, 4);
- }
- ++*pp;
- break;
-
- case 'G':
- ++*pp;
- if (! isdigit ((unsigned char) **pp))
- {
- stab_bad_demangle (orig);
- return false;
- }
- /* Fall through. */
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- {
- const char *hold;
-
- if (! stab_demangle_class (minfo, pp, &hold))
- return false;
- if (ptype != NULL)
- {
- char *name;
-
- name = savestring (hold, *pp - hold);
- *ptype = debug_find_named_type (minfo->dhandle, name);
- if (*ptype == DEBUG_TYPE_NULL)
- {
- /* FIXME: It is probably incorrect to assume that
- undefined types are tagged types. */
- *ptype = stab_find_tagged_type (minfo->dhandle, minfo->info,
- hold, *pp - hold,
- DEBUG_KIND_ILLEGAL);
- }
- free (name);
- }
- }
- break;
-
- case 't':
- if (! stab_demangle_template (minfo, pp))
- return false;
- if (ptype != NULL)
- {
- debug_type t;
-
- /* FIXME: I really don't know how a template should be
- represented in the current type system. Perhaps the
- template should be demangled into a string, and the type
- should be represented as a named type. However, I don't
- know what the base type of the named type should be. */
- t = debug_make_void_type (minfo->dhandle);
- t = debug_make_pointer_type (minfo->dhandle, t);
- t = debug_name_type (minfo->dhandle, "TEMPLATE", t);
- *ptype = t;
- }
- break;
-
- default:
- stab_bad_demangle (orig);
- return false;
- }
-
- if (ptype != NULL)
- {
- if (constp)
- *ptype = debug_make_const_type (minfo->dhandle, *ptype);
- if (volatilep)
- *ptype = debug_make_volatile_type (minfo->dhandle, *ptype);
- }
-
- return true;
-}
-
-/* Remember a type string in a demangled string. */
-
-static boolean
-stab_demangle_remember_type (minfo, p, len)
- struct stab_demangle_info *minfo;
- const char *p;
- int len;
-{
- if (minfo->typestring_count >= minfo->typestring_alloc)
- {
- minfo->typestring_alloc += 10;
- minfo->typestrings = ((struct stab_demangle_typestring *)
- xrealloc (minfo->typestrings,
- (minfo->typestring_alloc
- * sizeof *minfo->typestrings)));
- }
-
- minfo->typestrings[minfo->typestring_count].typestring = p;
- minfo->typestrings[minfo->typestring_count].len = (unsigned int) len;
- ++minfo->typestring_count;
-
- return true;
-}
diff --git a/regex/Makefile.am b/regex/Makefile.am
deleted file mode 100644
index 0fd62a777f6..00000000000
--- a/regex/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2000-2003, 2005-2006 MySQL AB
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include
-noinst_LIBRARIES = libregex.a
-LDADD= libregex.a $(top_builddir)/strings/libmystrings.a
-noinst_HEADERS = cclass.h cname.h regex2.h utils.h engine.c my_regex.h
-libregex_a_SOURCES = regerror.c regcomp.c regexec.c regfree.c reginit.c
-noinst_PROGRAMS = re
-re_SOURCES = split.c debug.c main.c
-re_LDFLAGS= @NOINST_LDFLAGS@
-EXTRA_DIST = tests CHANGES COPYRIGHT WHATSNEW regexp.c \
- debug.ih engine.ih main.ih regcomp.ih regerror.ih \
- regex.3 regex.7 CMakeLists.txt
-
-test: re tests
- ./re < tests
- ./re -el < tests
- ./re -er < tests
diff --git a/regex/main.c b/regex/main.c
index e8277053382..f5b591907cf 100644
--- a/regex/main.c
+++ b/regex/main.c
@@ -17,7 +17,7 @@ regoff_t startoff = 0;
regoff_t endoff = 0;
-extern int split(char *string, char **fields, int nfields, const char *sep);
+extern int split(char *string, char *fields[], int nfields, char *sep);
extern void regprint(my_regex_t *r, FILE *d);
/*
@@ -145,7 +145,7 @@ FILE *in;
inbuf[strlen(inbuf)-1] = '\0'; /* get rid of stupid \n */
if (debug)
fprintf(stdout, "%d:\n", line);
- nf = split(inbuf, f, MAXF, "\t\t");
+ nf = split(inbuf, f, MAXF, (char*) "\t\t");
if (nf < 3) {
fprintf(stderr, "bad input, line %d\n", line);
exit(1);
@@ -288,7 +288,7 @@ int opts; /* may not match f1 */
for (i = 1; i < NSHOULD; i++)
should[i] = NULL;
- nshould = split(f4, should+1, NSHOULD-1, ",");
+ nshould = split(f4, should+1, NSHOULD-1, (char*) ",");
if (nshould == 0) {
nshould = 1;
should[1] = (char*) "";
diff --git a/regex/my_regex.h b/regex/my_regex.h
index 0d1cedf5430..30896e29b91 100644
--- a/regex/my_regex.h
+++ b/regex/my_regex.h
@@ -28,6 +28,7 @@ typedef struct {
/* === regcomp.c === */
+typedef int (*my_regex_stack_check_t)();
extern int my_regcomp(my_regex_t *, const char *, int, CHARSET_INFO *charset);
#define REG_BASIC 0000
#define REG_EXTENDED 0001
@@ -76,7 +77,8 @@ extern void my_regfree(my_regex_t *);
/* === reginit.c === */
-extern void my_regex_init(CHARSET_INFO *cs); /* Should be called for multithread progs */
+/* Should be called for multithread progs */
+extern void my_regex_init(CHARSET_INFO *cs, my_regex_stack_check_t func);
extern void my_regex_end(void); /* If one wants a clean end */
#ifdef __cplusplus
diff --git a/regex/regcomp.c b/regex/regcomp.c
index b41a1ae6da9..6e2d2511fc1 100644
--- a/regex/regcomp.c
+++ b/regex/regcomp.c
@@ -31,6 +31,9 @@ struct parse {
CHARSET_INFO *charset; /* for ctype things */
};
+/* Check if there is enough stack space for recursion. */
+my_regex_stack_check_t my_regex_enough_mem_in_stack= NULL;
+
#include "regcomp.ih"
static char nuls[10]; /* place to point scanner in event of error */
@@ -117,7 +120,7 @@ CHARSET_INFO *charset;
# define GOODFLAGS(f) ((f)&~REG_DUMP)
#endif
- my_regex_init(charset); /* Init cclass if neaded */
+ my_regex_init(charset, NULL); /* Init cclass if neaded */
preg->charset=charset;
cflags = GOODFLAGS(cflags);
if ((cflags&REG_EXTENDED) && (cflags&REG_NOSPEC))
@@ -222,7 +225,15 @@ int stop; /* character this ERE should end at */
/* do a bunch of concatenated expressions */
conc = HERE();
while (MORE() && (c = PEEK()) != '|' && c != stop)
- p_ere_exp(p);
+ {
+ if (my_regex_enough_mem_in_stack &&
+ my_regex_enough_mem_in_stack())
+ {
+ SETERROR(REG_ESPACE);
+ return;
+ }
+ p_ere_exp(p);
+ }
if(REQUIRE(HERE() != conc, REG_EMPTY)) {}/* require nonempty */
if (!EAT('|'))
diff --git a/regex/regexec.c b/regex/regexec.c
index 338c1bfa7fe..c0d03335b41 100644
--- a/regex/regexec.c
+++ b/regex/regexec.c
@@ -117,6 +117,7 @@ size_t nmatch;
my_regmatch_t pmatch[];
int eflags;
{
+ char *pstr = (char *) str;
register struct re_guts *g = preg->re_g;
#ifdef REDEBUG
# define GOODFLAGS(f) (f)
@@ -133,7 +134,7 @@ int eflags;
if ((size_t) g->nstates <= CHAR_BIT*sizeof(states1) &&
!(eflags&REG_LARGE))
- return(smatcher(preg->charset, g, (char *)str, nmatch, pmatch, eflags));
+ return(smatcher(preg->charset, g, pstr, nmatch, pmatch, eflags));
else
- return(lmatcher(preg->charset, g, (char *)str, nmatch, pmatch, eflags));
+ return(lmatcher(preg->charset, g, pstr, nmatch, pmatch, eflags));
}
diff --git a/regex/reginit.c b/regex/reginit.c
index 5980de24030..3d2cd64d1e7 100644
--- a/regex/reginit.c
+++ b/regex/reginit.c
@@ -4,10 +4,12 @@
#include <m_ctype.h>
#include <m_string.h>
#include "cclass.h"
+#include "my_regex.h"
static my_bool regex_inited=0;
+extern my_regex_stack_check_t my_regex_enough_mem_in_stack;
-void my_regex_init(CHARSET_INFO *cs)
+void my_regex_init(CHARSET_INFO *cs, my_regex_stack_check_t func)
{
char buff[CCLASS_LAST][256];
int count[CCLASS_LAST];
@@ -16,6 +18,7 @@ void my_regex_init(CHARSET_INFO *cs)
if (!regex_inited)
{
regex_inited=1;
+ my_regex_enough_mem_in_stack= func;
bzero((uchar*) &count,sizeof(count));
for (i=1 ; i<= 255; i++)
@@ -74,6 +77,7 @@ void my_regex_end()
int i;
for (i=0; i < CCLASS_LAST ; i++)
free((char*) cclasses[i].chars);
+ my_regex_enough_mem_in_stack= NULL;
regex_inited=0;
}
}
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index 0c9177c79c5..56b7f779bb0 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -81,12 +81,9 @@ INSTALL(FILES
)
# TCMalloc hacks
-IF($ENV{MALLOC_LIB})
- SET(MALLOC_LIB $ENV{MALLOC_LIB} CACHE STRING "malloc library")
-ENDIF()
-
IF(MALLOC_LIB)
- INSTALL(FILES ${MALLOC_LIB} DESTINATION lib OPTIONAL)
+ MESSAGE("Using tcmalloc '${MALLOC_LIB}'")
+ INSTALL(FILES ${MALLOC_LIB} DESTINATION ${INSTALL_LIBDIR} OPTIONAL)
ENDIF()
IF(CMAKE_GENERATOR MATCHES "Makefiles")
@@ -313,7 +310,7 @@ IF(WIN32)
FOREACH(file ${SH_FILES})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh
${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY)
- INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT ${${file}_COMPONENT})
+ INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT Server_Scripts)
ENDFOREACH()
ELSE()
# On Unix, most of the files end up in the bin directory
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
deleted file mode 100644
index 879996d8d9e..00000000000
--- a/scripts/Makefile.am
+++ /dev/null
@@ -1,196 +0,0 @@
-# Copyright (C) 2000-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-## Process this file with automake to create Makefile.in
-
-BUILT_SOURCES = mysql_fix_privilege_tables.sql \
- mysql_fix_privilege_tables_sql.c
-
-EXTRA_PROGRAMS = comp_sql
-
-bin_SCRIPTS = @server_scripts@ \
- msql2mysql \
- mysql_config \
- mysql_fix_extensions \
- mysql_setpermission \
- mysql_secure_installation \
- mysql_zap \
- mysqlaccess \
- mysqlbug \
- mysql_convert_table_format \
- mysql_find_rows \
- mysqlhotcopy \
- mysqldumpslow \
- mysqld_multi
-
-noinst_SCRIPTS = make_binary_distribution \
- make_sharedlib_distribution \
- dheadgen.pl
- convert-debug-for-diff
-
-EXTRA_SCRIPTS = make_binary_distribution.sh \
- make_sharedlib_distribution.sh \
- msql2mysql.sh \
- mysql_config.sh \
- mysql_config.pl.in \
- mysql_fix_extensions.sh \
- mysql_install_db.sh \
- mysql_install_db.pl.in \
- mysql_setpermission.sh \
- mysql_secure_installation.sh \
- mysql_secure_installation.pl.in \
- mysql_zap.sh \
- mysqlaccess.sh \
- mysqlbug.sh \
- mysql_convert_table_format.sh \
- mysql_find_rows.sh \
- mysqlhotcopy.sh \
- mysqldumpslow.sh \
- mysqld_multi.sh \
- mysqld_safe.sh \
- dheadgen.pl
- convert-debug-for-diff.sh
-
-EXTRA_DIST = $(EXTRA_SCRIPTS) \
- mysqlaccess.conf \
- mysqlbug \
- make_win_bin_dist \
- mysql_fix_privilege_tables_sql.c \
- mysql_system_tables_fix.sql \
- CMakeLists.txt
-
-dist_pkgdata_DATA = fill_help_tables.sql \
- mysql_fix_privilege_tables.sql \
- mysql_system_tables.sql \
- mysql_system_tables_data.sql \
- mysql_test_data_timezone.sql
-
-CLEANFILES = @server_scripts@ \
- make_binary_distribution \
- make_sharedlib_distribution \
- msql2mysql \
- mysql_config \
- mysql_fix_extensions \
- mysql_setpermission \
- mysql_secure_installation \
- mysql_zap \
- mysqlaccess \
- mysql_convert_table_format \
- mysql_find_rows \
- mysqlhotcopy \
- mysqldumpslow \
- mysqld_multi \
- convert-debug-for-diff \
- $(EXTRA_PROGRAMS)
-
-pkgplugindir = $(pkglibdir)/plugin
-
-# 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
-
-# We want the right version and configure comand line in mysqlbug
-mysqlbug: ${top_builddir}/config.status mysqlbug.sh
-
-# Build mysql_fix_privilege_tables.sql from the files that contain
-# the system tables for this version of MySQL plus any commands
-# needed to upgrade the system tables from an older version
-mysql_fix_privilege_tables.sql: mysql_system_tables.sql \
- mysql_system_tables_fix.sql
- @echo "Building $@";
- @cat mysql_system_tables.sql mysql_system_tables_fix.sql > $@
-
-#
-# Build mysql_fix_privilege_tables_sql.c from
-# mysql_fix_privileges_tables.sql using comp_sql
-# The "sleep" ensures the generated file has a younger timestamp than its source
-# (which may have been generated in this very same "make" run).
-#
-mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql
- $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT)
- sleep 2
- $(top_builddir)/scripts/comp_sql$(EXEEXT) \
- mysql_fix_privilege_tables \
- $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@
-
-
-SUFFIXES = .sh
-
-.sh:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''bindir''@!$(bindir)!g' \
- -e 's!@''sbindir''@!$(sbindir)!g' \
- -e 's!@''scriptdir''@!$(bindir)!g' \
- -e 's!@''prefix''@!$(prefix)!g' \
- -e 's!@''datadir''@!$(datadir)!g' \
- -e 's!@''localstatedir''@!$(localstatedir)!g' \
- -e 's!@''libexecdir''@!$(libexecdir)!g' \
- -e 's!@''pkglibdir''@!$(pkglibdir)!g' \
- -e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \
- -e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \
- -e 's!@''pkgplugindir''@!$(pkgplugindir)!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@!'\
- -e 's!@''SAVE_CC''@!@SAVE_CC@!'\
- -e 's!@''SAVE_CXX''@!@SAVE_CXX@!'\
- -e 's!@''CC_VERSION''@!@CC_VERSION@!'\
- -e 's!@''CXX_VERSION''@!@CXX_VERSION@!'\
- -e 's!@''PERL''@!@PERL@!' \
- -e 's!@''SAVE_ASFLAGS''@!@SAVE_ASFLAGS@!'\
- -e 's!@''SAVE_CFLAGS''@!@SAVE_CFLAGS@!'\
- -e 's!@''SAVE_CXXFLAGS''@!@SAVE_CXXFLAGS@!'\
- -e 's!@''SAVE_LDFLAGS''@!@SAVE_LDFLAGS@!'\
- -e 's!@''ASFLAGS''@!@ASFLAGS@!'\
- -e 's!@''CFLAGS''@!@CFLAGS@!'\
- -e 's!@''CXXFLAGS''@!@CXXFLAGS@!'\
- -e 's!@''LDFLAGS''@!@LDFLAGS@!'\
- -e 's!@''LIBDL''@!@LIBDL@!'\
- -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \
- -e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \
- -e 's!@''LIBS''@!@LIBS@!' \
- -e 's!@''WRAPLIBS''@!@WRAPLIBS@!' \
- -e 's!@''openssl_libs''@!@openssl_libs@!' \
- -e 's!@''VERSION''@!@VERSION@!' \
- -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
- -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \
- -e 's!@''COMPILATION_COMMENT''@!@COMPILATION_COMMENT@!' \
- -e 's!@''MACHINE_TYPE''@!@MACHINE_TYPE@!' \
- -e 's!@''HOSTNAME''@!@HOSTNAME@!' \
- -e 's!@''SYSTEM_TYPE''@!@SYSTEM_TYPE@!' \
- -e 's!@''CHECK_PID''@!@CHECK_PID@!' \
- -e 's!@''FIND_PROC''@!@FIND_PROC@!' \
- -e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \
- -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
- -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
- -e 's!@''MYSQL_TCP_PORT_DEFAULT''@!@MYSQL_TCP_PORT_DEFAULT@!' \
- -e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \
- -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \
- -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \
- -e 's!@''STATIC_NSS_FLAGS''@!@STATIC_NSS_FLAGS@!' \
- -e 's!@''NON_THREADED_LIBS''@!@NON_THREADED_LIBS@!' \
- -e 's!@''ZLIB_DEPS''@!@ZLIB_DEPS@!' \
- -e "s!@MAKE@!$(MAKE)!" \
- $< > $@-t
- @CHMOD@ +x $@-t
- @MV@ $@-t $@
diff --git a/scripts/fill_help_tables.sql b/scripts/fill_help_tables.sql
index e3c230bfaca..2a0124afce9 100644
--- a/scripts/fill_help_tables.sql
+++ b/scripts/fill_help_tables.sql
@@ -1,4 +1,5 @@
-- Copyright (c) 2003, &year, Oracle and/or its affiliates. All rights reserved.
+-- Copyright (C) 2011 Monty Program 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
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 34bd1a7ef24..8d0795dbd76 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2000-2006 MySQL AB
+# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -311,8 +311,8 @@ fi
# Copy readme and license files
cp README Docs/INSTALL-BINARY $DEST/
-if [ -f COPYING -a -f EXCEPTIONS-CLIENT ] ; then
- cp COPYING EXCEPTIONS-CLIENT $DEST/
+if [ -f COPYING ] ; then
+ cp COPYING $DEST/
elif [ -f LICENSE.mysql ] ; then
cp LICENSE.mysql $DEST/
else
diff --git a/scripts/make_sharedlib_distribution.sh b/scripts/make_sharedlib_distribution.sh
deleted file mode 100644
index f6669788233..00000000000
--- a/scripts/make_sharedlib_distribution.sh
+++ /dev/null
@@ -1,136 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2003-2004, 2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-# The default path should be /usr/local
-
-# Get some info from configure
-# chmod +x ./scripts/setsomevars
-
-machine=@MACHINE_TYPE@
-system=@SYSTEM_TYPE@
-version=@VERSION@
-export machine system version
-SOURCE=`pwd`
-CP="cp -p"
-MV="mv"
-
-STRIP=1
-DEBUG=0
-SILENT=0
-TMP=/tmp
-SUFFIX=""
-
-parse_arguments() {
- 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 ;;
- --silent) SILENT=1 ;;
- *)
- echo "Unknown argument '$arg'"
- exit 1
- ;;
- esac
- done
-}
-
-parse_arguments "$@"
-
-BASE=$TMP/my_dist$SUFFIX
-
-if [ -d $BASE ] ; then
- rm -r -f $BASE
-fi
-
-mkdir -p $BASE/lib
-
-for i in \
- libmysql/.libs/libmysqlclient.so* \
- libmysql/.libs/libmysqlclient.sl* \
- libmysql/.libs/libmysqlclient*.dylib \
- libmysql_r/.libs/libmysqlclient_r.so* \
- libmysql_r/.libs/libmysqlclient_r.sl* \
- libmysql_r/.libs/libmysqlclient_r*.dylib
-do
- if [ -f $i ]
- then
- $CP $i $BASE/lib
- fi
-done
-
-# Change the distribution to a long descriptive name
-NEW_NAME=mysql-shared-$version-$system-$machine$SUFFIX
-BASE2=$TMP/$NEW_NAME
-rm -r -f $BASE2
-mv $BASE $BASE2
-BASE=$BASE2
-
-#if we are debugging, do not do tar/gz
-if [ x$DEBUG = x1 ] ; then
- exit
-fi
-
-# This is needed to prefer 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 test -x $file -a ! -d $file
- then
- echo $file
- exit 0
- fi
- done
- done
- done
- exit 1
-}
-
-#
-# Create the result tar file
-#
-
-tar=`which_1 gnutar gtar`
-if test "$?" = "1" -o "$tar" = ""
-then
- tar=tar
-fi
-
-echo "Using $tar to create archive"
-cd $TMP
-
-OPT=cvf
-if [ x$SILENT = x1 ] ; then
- OPT=cf
-fi
-
-$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME
-cd $SOURCE
-echo "Compressing archive"
-gzip -9 $NEW_NAME.tar
-echo "Removing temporary directory"
-rm -r -f $BASE
-
-echo "$NEW_NAME.tar.gz created"
diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist
index 27cff817715..6dd9d29d12c 100755
--- a/scripts/make_win_bin_dist
+++ b/scripts/make_win_bin_dist
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2006 MySQL AB
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -198,10 +198,11 @@ cp Docs/INSTALL-BINARY $DESTDIR/Docs/
cp Docs/manual.chm $DESTDIR/Docs/ || /bin/true
cp ChangeLog $DESTDIR/Docs/ || /bin/true
cp support-files/my-*.ini $DESTDIR/
+cp README $DESTDIR/
if [ -f COPYING ] ; then
- cp COPYING EXCEPTIONS-CLIENT $DESTDIR/
- cp COPYING $DESTDIR/Docs/
+ cp COPYING $DESTDIR/
+ cp COPYING $DESTDIR/Docs/
fi
# ----------------------------------------------------------------------
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
index b3f482bb136..6463b3bf099 100644
--- a/scripts/mysql_config.sh
+++ b/scripts/mysql_config.sh
@@ -92,7 +92,11 @@ plugindir_rel=`echo $plugindir | sed -e "s;^$basedir/;;"`
fix_path plugindir $plugindir_rel lib/mysql/plugin lib/plugin
pkgincludedir='@pkgincludedir@'
-fix_path pkgincludedir include/mysql include
+if [ -f "$basedir/include/mysql/mysql.h" ]; then
+ pkgincludedir="$basedir/include/mysql"
+elif [ -f "$basedir/include/mysql.h" ]; then
+ pkgincludedir="$basedir/include"
+fi
version='@VERSION@'
socket='@MYSQL_UNIX_ADDR@'
diff --git a/scripts/mysql_fix_extensions.sh b/scripts/mysql_fix_extensions.sh
index 6d4e017f678..74a47fdf4a1 100644
--- a/scripts/mysql_fix_extensions.sh
+++ b/scripts/mysql_fix_extensions.sh
@@ -1,4 +1,22 @@
#!/usr/bin/perl
+
+# Copyright (C) 2001 MySQL AB, 2009 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
# This is a utility for MySQL. It is not needed by any standard part
# of MySQL.
diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh
index 5fa6b969e39..433f30dfabb 100644
--- a/scripts/mysql_setpermission.sh
+++ b/scripts/mysql_setpermission.sh
@@ -1,5 +1,23 @@
#!/usr/bin/perl
## Emacs, this is -*- perl -*- mode? :-)
+
+# Copyright (C) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
##
## Permission setter for MySQL
##
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index 99c9c478532..6e03791b5a7 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -27,7 +27,7 @@ set @had_db_table= @@warning_count != 0;
CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges';
-CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(60) CHARACTER SET latin1 DEFAULT '' NOT NULL, auth_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
+CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) unsigned DEFAULT 0 NOT NULL, plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL, authentication_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
-- Remember for later if user table already existed
set @had_user_table= @@warning_count != 0;
@@ -169,7 +169,7 @@ set @have_pfs= (select count(engine) from information_schema.engines where engin
-- TABLE COND_INSTANCES
--
-SET @l1="CREATE TABLE performance_schema.COND_INSTANCES(";
+SET @l1="CREATE TABLE performance_schema.cond_instances(";
SET @l2="NAME VARCHAR(128) not null,";
SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null";
SET @l4=")ENGINE=PERFORMANCE_SCHEMA;";
@@ -185,7 +185,7 @@ DROP PREPARE stmt;
-- TABLE EVENTS_WAITS_CURRENT
--
-SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_CURRENT(";
+SET @l1="CREATE TABLE performance_schema.events_waits_current(";
SET @l2="THREAD_ID INTEGER not null,";
SET @l3="EVENT_ID BIGINT unsigned not null,";
SET @l4="EVENT_NAME VARCHAR(128) not null,";
@@ -215,7 +215,7 @@ DROP PREPARE stmt;
-- TABLE EVENTS_WAITS_HISTORY
--
-SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_HISTORY(";
+SET @l1="CREATE TABLE performance_schema.events_waits_history(";
-- lines 2 to 18 are unchanged from EVENTS_WAITS_CURRENT
SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9,@l10,@l11,@l12,@l13,@l14,@l15,@l16,@l17,@l18);
@@ -229,7 +229,7 @@ DROP PREPARE stmt;
-- TABLE EVENTS_WAITS_HISTORY_LONG
--
-SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG(";
+SET @l1="CREATE TABLE performance_schema.events_waits_history_long(";
-- lines 2 to 18 are unchanged from EVENTS_WAITS_CURRENT
SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9,@l10,@l11,@l12,@l13,@l14,@l15,@l16,@l17,@l18);
@@ -243,7 +243,7 @@ DROP PREPARE stmt;
-- TABLE EVENTS_WAITS_SUMMARY_BY_INSTANCE
--
-SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE(";
+SET @l1="CREATE TABLE performance_schema.events_waits_summary_by_instance(";
SET @l2="EVENT_NAME VARCHAR(128) not null,";
SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null,";
SET @l4="COUNT_STAR BIGINT unsigned not null,";
@@ -264,7 +264,7 @@ DROP PREPARE stmt;
-- TABLE EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
--
-SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME(";
+SET @l1="CREATE TABLE performance_schema.events_waits_summary_by_thread_by_event_name(";
SET @l2="THREAD_ID INTEGER not null,";
SET @l3="EVENT_NAME VARCHAR(128) not null,";
SET @l4="COUNT_STAR BIGINT unsigned not null,";
@@ -285,7 +285,7 @@ DROP PREPARE stmt;
-- TABLE EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
--
-SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME(";
+SET @l1="CREATE TABLE performance_schema.events_waits_summary_global_by_event_name(";
SET @l2="EVENT_NAME VARCHAR(128) not null,";
SET @l3="COUNT_STAR BIGINT unsigned not null,";
SET @l4="SUM_TIMER_WAIT BIGINT unsigned not null,";
@@ -305,7 +305,7 @@ DROP PREPARE stmt;
-- TABLE FILE_INSTANCES
--
-SET @l1="CREATE TABLE performance_schema.FILE_INSTANCES(";
+SET @l1="CREATE TABLE performance_schema.file_instances(";
SET @l2="FILE_NAME VARCHAR(512) not null,";
SET @l3="EVENT_NAME VARCHAR(128) not null,";
SET @l4="OPEN_COUNT INTEGER unsigned not null";
@@ -322,7 +322,7 @@ DROP PREPARE stmt;
-- TABLE FILE_SUMMARY_BY_EVENT_NAME
--
-SET @l1="CREATE TABLE performance_schema.FILE_SUMMARY_BY_EVENT_NAME(";
+SET @l1="CREATE TABLE performance_schema.file_summary_by_event_name(";
SET @l2="EVENT_NAME VARCHAR(128) not null,";
SET @l3="COUNT_READ BIGINT unsigned not null,";
SET @l4="COUNT_WRITE BIGINT unsigned not null,";
@@ -341,7 +341,7 @@ DROP PREPARE stmt;
-- TABLE FILE_SUMMARY_BY_INSTANCE
--
-SET @l1="CREATE TABLE performance_schema.FILE_SUMMARY_BY_INSTANCE(";
+SET @l1="CREATE TABLE performance_schema.file_summary_by_instance(";
SET @l2="FILE_NAME VARCHAR(512) not null,";
SET @l3="EVENT_NAME VARCHAR(128) not null,";
SET @l4="COUNT_READ BIGINT unsigned not null,";
@@ -361,7 +361,7 @@ DROP PREPARE stmt;
-- TABLE MUTEX_INSTANCES
--
-SET @l1="CREATE TABLE performance_schema.MUTEX_INSTANCES(";
+SET @l1="CREATE TABLE performance_schema.mutex_instances(";
SET @l2="NAME VARCHAR(128) not null,";
SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null,";
SET @l4="LOCKED_BY_THREAD_ID INTEGER";
@@ -378,7 +378,7 @@ DROP PREPARE stmt;
-- TABLE PERFORMANCE_TIMERS
--
-SET @l1="CREATE TABLE performance_schema.PERFORMANCE_TIMERS(";
+SET @l1="CREATE TABLE performance_schema.performance_timers(";
SET @l2="TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null,";
SET @l3="TIMER_FREQUENCY BIGINT,";
SET @l4="TIMER_RESOLUTION BIGINT,";
@@ -396,7 +396,7 @@ DROP PREPARE stmt;
-- TABLE RWLOCK_INSTANCES
--
-SET @l1="CREATE TABLE performance_schema.RWLOCK_INSTANCES(";
+SET @l1="CREATE TABLE performance_schema.rwlock_instances(";
SET @l2="NAME VARCHAR(128) not null,";
SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null,";
SET @l4="WRITE_LOCKED_BY_THREAD_ID INTEGER,";
@@ -414,7 +414,7 @@ DROP PREPARE stmt;
-- TABLE SETUP_CONSUMERS
--
-SET @l1="CREATE TABLE performance_schema.SETUP_CONSUMERS(";
+SET @l1="CREATE TABLE performance_schema.setup_consumers(";
SET @l2="NAME VARCHAR(64) not null,";
SET @l3="ENABLED ENUM ('YES', 'NO') not null";
SET @l4=")ENGINE=PERFORMANCE_SCHEMA;";
@@ -430,7 +430,7 @@ DROP PREPARE stmt;
-- TABLE SETUP_INSTRUMENTS
--
-SET @l1="CREATE TABLE performance_schema.SETUP_INSTRUMENTS(";
+SET @l1="CREATE TABLE performance_schema.setup_instruments(";
SET @l2="NAME VARCHAR(128) not null,";
SET @l3="ENABLED ENUM ('YES', 'NO') not null,";
SET @l4="TIMED ENUM ('YES', 'NO') not null";
@@ -447,7 +447,7 @@ DROP PREPARE stmt;
-- TABLE SETUP_TIMERS
--
-SET @l1="CREATE TABLE performance_schema.SETUP_TIMERS(";
+SET @l1="CREATE TABLE performance_schema.setup_timers(";
SET @l2="NAME VARCHAR(64) not null,";
SET @l3="TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null";
SET @l4=")ENGINE=PERFORMANCE_SCHEMA;";
@@ -463,10 +463,10 @@ DROP PREPARE stmt;
-- TABLE THREADS
--
-SET @l1="CREATE TABLE performance_schema.THREADS(";
+SET @l1="CREATE TABLE performance_schema.threads(";
SET @l2="THREAD_ID INTEGER not null,";
-SET @l3="ID INTEGER not null,";
-SET @l4="NAME VARCHAR(64) not null";
+SET @l3="PROCESSLIST_ID INTEGER,";
+SET @l4="NAME VARCHAR(128) not null";
SET @l5=")ENGINE=PERFORMANCE_SCHEMA;";
SET @cmd=concat(@l1,@l2,@l3,@l4,@l5);
@@ -476,3 +476,7 @@ PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;
+CREATE TABLE IF NOT EXISTS proxies_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_host char(60) binary DEFAULT '' NOT NULL, Proxied_user char(16) binary DEFAULT '' NOT NULL, With_grant BOOL DEFAULT 0 NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY Host (Host,User,Proxied_host,Proxied_user), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User proxy privileges';
+
+-- Remember for later if proxies_priv table already existed
+set @had_proxies_priv_table= @@warning_count != 0;
diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql
index ab771d7389d..0d6127d2173 100644
--- a/scripts/mysql_system_tables_data.sql
+++ b/scripts/mysql_system_tables_data.sql
@@ -1,3 +1,18 @@
+-- Copyright (C) 2007, 2008 MySQL AB
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; version 2 of the License.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
--
-- The inital data for system tables of MySQL Server
--
@@ -29,3 +44,9 @@ INSERT INTO tmp_user (host,user) VALUES ('localhost','');
INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' FROM dual WHERE LOWER(@current_hostname ) != 'localhost';
INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
DROP TABLE tmp_user;
+
+CREATE TEMPORARY TABLE tmp_proxies_priv LIKE proxies_priv;
+INSERT INTO tmp_proxies_priv VALUES ('localhost', 'root', '', '', TRUE, '', now());
+REPLACE INTO tmp_proxies_priv SELECT @current_hostname, 'root', '', '', TRUE, '', now() FROM DUAL WHERE LOWER (@current_hostname) != 'localhost';
+INSERT INTO proxies_priv SELECT * FROM tmp_proxies_priv WHERE @had_proxies_priv_table=0;
+DROP TABLE tmp_proxies_priv;
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index 71a2e84223a..d133a081e52 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -1,4 +1,4 @@
--- Copyright (C) 2008, 2010 Oracle and/or its affiliates. All rights reserved.
+-- Copyright (C) 2003, 2010 Oracle and/or its affiliates. All rights reserved.
--
-- 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
@@ -643,6 +643,19 @@ DROP PREPARE stmt;
drop procedure mysql.die;
+ALTER TABLE user ADD plugin char(64) DEFAULT '', ADD authentication_string TEXT;
+ALTER TABLE user MODIFY plugin char(64) DEFAULT '';
+ALTER TABLE user MODIFY authentication_string TEXT;
+
+-- Need to pre-fill mysql.proxies_priv with access for root even when upgrading from
+-- older versions
+
+CREATE TEMPORARY TABLE tmp_proxies_priv LIKE proxies_priv;
+INSERT INTO tmp_proxies_priv VALUES ('localhost', 'root', '', '', TRUE, '', now());
+INSERT INTO proxies_priv SELECT * FROM tmp_proxies_priv WHERE @had_proxies_priv_table=0;
+DROP TABLE tmp_proxies_priv;
+
+
# Activate the new, possible modified privilege tables
# This should not be needed, but gives us some extra testing that the above
# changes was correct
diff --git a/scripts/mysql_test_data_timezone.sql b/scripts/mysql_test_data_timezone.sql
index e52df2149f2..6bf28148e5e 100644
--- a/scripts/mysql_test_data_timezone.sql
+++ b/scripts/mysql_test_data_timezone.sql
@@ -1,3 +1,18 @@
+-- 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
+
INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4), ('Japan', 5);
INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');
INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES (1, -1693706400, 0) ,(1, -1680483600, 1) ,(1, -1663455600, 2) ,(1, -1650150000, 3) ,(1, -1632006000, 2) ,(1, -1618700400, 3) ,(1, -938905200, 2) ,(1, -857257200, 3) ,(1, -844556400, 2) ,(1, -828226800, 3) ,(1, -812502000, 2) ,(1, -796777200, 3) ,(1, 228877200, 2) ,(1, 243997200, 3) ,(1, 260326800, 2) ,(1, 276051600, 3) ,(1, 291776400, 2) ,(1, 307501200, 3) ,(1, 323830800, 2) ,(1, 338950800, 3) ,(1, 354675600, 2) ,(1, 370400400, 3) ,(1, 386125200, 2) ,(1, 401850000, 3) ,(1, 417574800, 2) ,(1, 433299600, 3) ,(1, 449024400, 2) ,(1, 465354000, 3) ,(1, 481078800, 2) ,(1, 496803600, 3) ,(1, 512528400, 2) ,(1, 528253200, 3) ,(1, 543978000, 2) ,(1, 559702800, 3) ,(1, 575427600, 2) ,(1, 591152400, 3) ,(1, 606877200, 2) ,(1, 622602000, 3) ,(1, 638326800, 2) ,(1, 654656400, 3) ,(1, 670381200, 2) ,(1, 686106000, 3) ,(1, 701830800, 2) ,(1, 717555600, 3) ,(1, 733280400, 2) ,(1, 749005200, 3) ,(1, 764730000, 2) ,(1, 780454800, 3) ,(1, 796179600, 2) ,(1, 811904400, 3) ,(1, 828234000, 2) ,(1, 846378000, 3) ,(1, 859683600, 2) ,(1, 877827600, 3) ,(1, 891133200, 2) ,(1, 909277200, 3) ,(1, 922582800, 2) ,(1, 941331600, 3) ,(1, 954032400, 2) ,(1, 972781200, 3) ,(1, 985482000, 2) ,(1, 1004230800, 3) ,(1, 1017536400, 2) ,(1, 1035680400, 3) ,(1, 1048986000, 2) ,(1, 1067130000, 3) ,(1, 1080435600, 2) ,(1, 1099184400, 3) ,(1, 1111885200, 2) ,(1, 1130634000, 3) ,(1, 1143334800, 2) ,(1, 1162083600, 3) ,(1, 1174784400, 2) ,(1, 1193533200, 3) ,(1, 1206838800, 2) ,(1, 1224982800, 3) ,(1, 1238288400, 2) ,(1, 1256432400, 3) ,(1, 1269738000, 2) ,(1, 1288486800, 3) ,(1, 1301187600, 2) ,(1, 1319936400, 3) ,(1, 1332637200, 2) ,(1, 1351386000, 3) ,(1, 1364691600, 2) ,(1, 1382835600, 3) ,(1, 1396141200, 2) ,(1, 1414285200, 3) ,(1, 1427590800, 2) ,(1, 1445734800, 3) ,(1, 1459040400, 2) ,(1, 1477789200, 3) ,(1, 1490490000, 2) ,(1, 1509238800, 3) ,(1, 1521939600, 2) ,(1, 1540688400, 3) ,(1, 1553994000, 2) ,(1, 1572138000, 3) ,(1, 1585443600, 2) ,(1, 1603587600, 3) ,(1, 1616893200, 2) ,(1, 1635642000, 3) ,(1, 1648342800, 2) ,(1, 1667091600, 3) ,(1, 1679792400, 2) ,(1, 1698541200, 3) ,(1, 1711846800, 2) ,(1, 1729990800, 3) ,(1, 1743296400, 2) ,(1, 1761440400, 3) ,(1, 1774746000, 2) ,(1, 1792890000, 3) ,(1, 1806195600, 2) ,(1, 1824944400, 3) ,(1, 1837645200, 2) ,(1, 1856394000, 3) ,(1, 1869094800, 2) ,(1, 1887843600, 3) ,(1, 1901149200, 2) ,(1, 1919293200, 3) ,(1, 1932598800, 2) ,(1, 1950742800, 3) ,(1, 1964048400, 2) ,(1, 1982797200, 3) ,(1, 1995498000, 2) ,(1, 2014246800, 3) ,(1, 2026947600, 2) ,(1, 2045696400, 3) ,(1, 2058397200, 2) ,(1, 2077146000, 3) ,(1, 2090451600, 2) ,(1, 2108595600, 3) ,(1, 2121901200, 2) ,(1, 2140045200, 3) ,(3, -1688265000, 2) ,(3, -1656819048, 1) ,(3, -1641353448, 2) ,(3, -1627965048, 3) ,(3, -1618716648, 1) ,(3, -1596429048, 3) ,(3, -1593829848, 5) ,(3, -1589860800, 4) ,(3, -1542427200, 5) ,(3, -1539493200, 6) ,(3, -1525323600, 5) ,(3, -1522728000, 4) ,(3, -1491188400, 7) ,(3, -1247536800, 4) ,(3, 354920400, 5) ,(3, 370728000, 4) ,(3, 386456400, 5) ,(3, 402264000, 4) ,(3, 417992400, 5) ,(3, 433800000, 4) ,(3, 449614800, 5) ,(3, 465346800, 8) ,(3, 481071600, 9) ,(3, 496796400, 8) ,(3, 512521200, 9) ,(3, 528246000, 8) ,(3, 543970800, 9) ,(3, 559695600, 8) ,(3, 575420400, 9) ,(3, 591145200, 8) ,(3, 606870000, 9) ,(3, 622594800, 8) ,(3, 638319600, 9) ,(3, 654649200, 8) ,(3, 670374000, 10) ,(3, 686102400, 11) ,(3, 695779200, 8) ,(3, 701812800, 5) ,(3, 717534000, 4) ,(3, 733273200, 9) ,(3, 748998000, 8) ,(3, 764722800, 9) ,(3, 780447600, 8) ,(3, 796172400, 9) ,(3, 811897200, 8) ,(3, 828226800, 9) ,(3, 846370800, 8) ,(3, 859676400, 9) ,(3, 877820400, 8) ,(3, 891126000, 9) ,(3, 909270000, 8) ,(3, 922575600, 9) ,(3, 941324400, 8) ,(3, 954025200, 9) ,(3, 972774000, 8) ,(3, 985474800, 9) ,(3, 1004223600, 8) ,(3, 1017529200, 9) ,(3, 1035673200, 8) ,(3, 1048978800, 9) ,(3, 1067122800, 8) ,(3, 1080428400, 9) ,(3, 1099177200, 8) ,(3, 1111878000, 9) ,(3, 1130626800, 8) ,(3, 1143327600, 9) ,(3, 1162076400, 8) ,(3, 1174777200, 9) ,(3, 1193526000, 8) ,(3, 1206831600, 9) ,(3, 1224975600, 8) ,(3, 1238281200, 9) ,(3, 1256425200, 8) ,(3, 1269730800, 9) ,(3, 1288479600, 8) ,(3, 1301180400, 9) ,(3, 1319929200, 8) ,(3, 1332630000, 9) ,(3, 1351378800, 8) ,(3, 1364684400, 9) ,(3, 1382828400, 8) ,(3, 1396134000, 9) ,(3, 1414278000, 8) ,(3, 1427583600, 9) ,(3, 1445727600, 8) ,(3, 1459033200, 9) ,(3, 1477782000, 8) ,(3, 1490482800, 9) ,(3, 1509231600, 8) ,(3, 1521932400, 9) ,(3, 1540681200, 8) ,(3, 1553986800, 9) ,(3, 1572130800, 8) ,(3, 1585436400, 9) ,(3, 1603580400, 8) ,(3, 1616886000, 9) ,(3, 1635634800, 8) ,(3, 1648335600, 9) ,(3, 1667084400, 8) ,(3, 1679785200, 9) ,(3, 1698534000, 8) ,(3, 1711839600, 9) ,(3, 1729983600, 8) ,(3, 1743289200, 9) ,(3, 1761433200, 8) ,(3, 1774738800, 9) ,(3, 1792882800, 8) ,(3, 1806188400, 9) ,(3, 1824937200, 8) ,(3, 1837638000, 9) ,(3, 1856386800, 8) ,(3, 1869087600, 9) ,(3, 1887836400, 8) ,(3, 1901142000, 9) ,(3, 1919286000, 8) ,(3, 1932591600, 9) ,(3, 1950735600, 8) ,(3, 1964041200, 9) ,(3, 1982790000, 8) ,(3, 1995490800, 9) ,(3, 2014239600, 8) ,(3, 2026940400, 9) ,(3, 2045689200, 8) ,(3, 2058390000, 9) ,(3, 2077138800, 8) ,(3, 2090444400, 9) ,(3, 2108588400, 8) ,(3, 2121894000, 9) ,(3, 2140038000, 8) ,(4, -1688265000, 2) ,(4, -1656819048, 1) ,(4, -1641353448, 2) ,(4, -1627965048, 3) ,(4, -1618716648, 1) ,(4, -1596429048, 3) ,(4, -1593829848, 5) ,(4, -1589860800, 4) ,(4, -1542427200, 5) ,(4, -1539493200, 6) ,(4, -1525323600, 5) ,(4, -1522728000, 4) ,(4, -1491188400, 7) ,(4, -1247536800, 4) ,(4, 354920409, 5) ,(4, 370728010, 4) ,(4, 386456410, 5) ,(4, 402264011, 4) ,(4, 417992411, 5) ,(4, 433800012, 4) ,(4, 449614812, 5) ,(4, 465346812, 8) ,(4, 481071612, 9) ,(4, 496796413, 8) ,(4, 512521213, 9) ,(4, 528246013, 8) ,(4, 543970813, 9) ,(4, 559695613, 8) ,(4, 575420414, 9) ,(4, 591145214, 8) ,(4, 606870014, 9) ,(4, 622594814, 8) ,(4, 638319615, 9) ,(4, 654649215, 8) ,(4, 670374016, 10) ,(4, 686102416, 11) ,(4, 695779216, 8) ,(4, 701812816, 5) ,(4, 717534017, 4) ,(4, 733273217, 9) ,(4, 748998018, 8) ,(4, 764722818, 9) ,(4, 780447619, 8) ,(4, 796172419, 9) ,(4, 811897219, 8) ,(4, 828226820, 9) ,(4, 846370820, 8) ,(4, 859676420, 9) ,(4, 877820421, 8) ,(4, 891126021, 9) ,(4, 909270021, 8) ,(4, 922575622, 9) ,(4, 941324422, 8) ,(4, 954025222, 9) ,(4, 972774022, 8) ,(4, 985474822, 9) ,(4, 1004223622, 8) ,(4, 1017529222, 9) ,(4, 1035673222, 8) ,(4, 1048978822, 9) ,(4, 1067122822, 8) ,(4, 1080428422, 9) ,(4, 1099177222, 8) ,(4, 1111878022, 9) ,(4, 1130626822, 8) ,(4, 1143327622, 9) ,(4, 1162076422, 8) ,(4, 1174777222, 9) ,(4, 1193526022, 8) ,(4, 1206831622, 9) ,(4, 1224975622, 8) ,(4, 1238281222, 9) ,(4, 1256425222, 8) ,(4, 1269730822, 9) ,(4, 1288479622, 8) ,(4, 1301180422, 9) ,(4, 1319929222, 8) ,(4, 1332630022, 9) ,(4, 1351378822, 8) ,(4, 1364684422, 9) ,(4, 1382828422, 8) ,(4, 1396134022, 9) ,(4, 1414278022, 8) ,(4, 1427583622, 9) ,(4, 1445727622, 8) ,(4, 1459033222, 9) ,(4, 1477782022, 8) ,(4, 1490482822, 9) ,(4, 1509231622, 8) ,(4, 1521932422, 9) ,(4, 1540681222, 8) ,(4, 1553986822, 9) ,(4, 1572130822, 8) ,(4, 1585436422, 9) ,(4, 1603580422, 8) ,(4, 1616886022, 9) ,(4, 1635634822, 8) ,(4, 1648335622, 9) ,(4, 1667084422, 8) ,(4, 1679785222, 9) ,(4, 1698534022, 8) ,(4, 1711839622, 9) ,(4, 1729983622, 8) ,(4, 1743289222, 9) ,(4, 1761433222, 8) ,(4, 1774738822, 9) ,(4, 1792882822, 8) ,(4, 1806188422, 9) ,(4, 1824937222, 8) ,(4, 1837638022, 9) ,(4, 1856386822, 8) ,(4, 1869087622, 9) ,(4, 1887836422, 8) ,(4, 1901142022, 9) ,(4, 1919286022, 8) ,(4, 1932591622, 9) ,(4, 1950735622, 8) ,(4, 1964041222, 9) ,(4, 1982790022, 8) ,(4, 1995490822, 9) ,(4, 2014239622, 8) ,(4, 2026940422, 9) ,(4, 2045689222, 8) ,(4, 2058390022, 9) ,(4, 2077138822, 8) ,(4, 2090444422, 9) ,(4, 2108588422, 8) ,(4, 2121894022, 9) ,(4, 2140038022, 8) ,(5, -1009875600, 1);
diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh
index 0153a3afa7c..4e208e6c16e 100644
--- a/scripts/mysqlaccess.sh
+++ b/scripts/mysqlaccess.sh
@@ -1,4 +1,22 @@
#!/usr/bin/perl
+
+# Copyright (C) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
# ****************************
package MySQLaccess;
#use strict;
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index 588c48fae4c..bab076b019b 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -1,5 +1,22 @@
#!/usr/bin/perl
+# Copyright (C) 2000, 2007 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
use Getopt::Long;
use POSIX qw(strftime getcwd);
diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh
index 8580b8e6203..9ec3802a2e4 100644
--- a/scripts/mysqldumpslow.sh
+++ b/scripts/mysqldumpslow.sh
@@ -1,4 +1,22 @@
#!/usr/bin/perl
+
+# Copyright (C) 2000, 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
# mysqldumpslow - parse and summarize the MySQL slow query log
# Original version by Tim Bunce, sometime in 2000.
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index a08db77ac56..5ceaebfbae2 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -1,5 +1,22 @@
#!/usr/bin/perl
+# Copyright (C) 2000, 2008 MySQL AB, 2009 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
use strict;
use Getopt::Long;
use Data::Dumper;
diff --git a/sql-bench/CMakeLists.txt b/sql-bench/CMakeLists.txt
index f8be18c6653..ae05d30530d 100644
--- a/sql-bench/CMakeLists.txt
+++ b/sql-bench/CMakeLists.txt
@@ -26,13 +26,13 @@ ELSE()
ENDIF()
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Data/ATIS
- DESTINATION ${prefix}sql-bench/Data)
+ DESTINATION ${prefix}sql-bench/Data COMPONENT SqlBench)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Data/Wisconsin
- DESTINATION ${prefix}sql-bench/Data)
+ DESTINATION ${prefix}sql-bench/Data COMPONENT SqlBench)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/limits
- DESTINATION ${prefix}sql-bench)
+ DESTINATION ${prefix}sql-bench COMPONENT SqlBench)
FILE(GLOB all_files ${CMAKE_CURRENT_SOURCE_DIR}/*)
@@ -54,10 +54,10 @@ FOREACH(file ${all_files})
CONFIGURE_FILE(${file} ${target} COPYONLY)
IF (ext MATCHES ".bat")
IF(WIN32)
- INSTALL(FILES ${target} DESTINATION ${prefix}sql-bench)
+ INSTALL(FILES ${target} DESTINATION ${prefix}sql-bench COMPONENT SqlBench)
ENDIF()
ELSE()
- INSTALL(FILES ${target} DESTINATION ${prefix}sql-bench)
+ INSTALL(FILES ${target} DESTINATION ${prefix}sql-bench COMPONENT SqlBench)
ENDIF()
ENDIF()
ENDFOREACH()
diff --git a/sql-bench/Makefile.am b/sql-bench/Makefile.am
deleted file mode 100644
index a7a2975ea87..00000000000
--- a/sql-bench/Makefile.am
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright (C) 2000-2003, 2005 MySQL AB
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-## Process this file with automake to create Makefile.in
-
-benchdir_root= $(prefix)
-benchdir = $(benchdir_root)/sql-bench
-bench_SCRIPTS = test-ATIS test-connect test-create test-insert \
- test-big-tables test-select test-wisconsin \
- test-alter-table test-transactions \
- graph-compare-results \
- bench-init.pl compare-results run-all-tests \
- server-cfg crash-me copy-db innotest1 innotest1a \
- innotest1b innotest2 innotest2a innotest2b \
- bench-count-distinct
-CLEANFILES = $(bench_SCRIPTS)
-EXTRA_SCRIPTS = test-ATIS.sh test-connect.sh test-create.sh \
- test-insert.sh test-big-tables.sh test-select.sh \
- test-alter-table.sh test-wisconsin.sh \
- test-transactions.sh \
- bench-init.pl.sh compare-results.sh server-cfg.sh \
- run-all-tests.sh crash-me.sh copy-db.sh \
- graph-compare-results.sh innotest1.sh innotest1a.sh \
- innotest1b.sh innotest2.sh innotest2a.sh innotest2b.sh \
- bench-count-distinct.sh
-EXTRA_DIST = $(EXTRA_SCRIPTS) CMakeLists.txt
-
-dist-hook:
- mkdir -p $(distdir)/Data/ATIS $(distdir)/Data/Wisconsin \
- $(distdir)/limits $(distdir)/Comments
- for i in $(srcdir)/Data/ATIS/*.* ; do $(INSTALL_DATA) $$i $(distdir)/Data/ATIS ; done
- for i in $(srcdir)/Data/Wisconsin/*.* ; do $(INSTALL_DATA) $$i $(distdir)/Data/Wisconsin ; done
- for i in $(srcdir)/limits/*.* ; do $(INSTALL_DATA) $$i $(distdir)/limits; done
- for i in $(srcdir)/Comments/*.* ; do $(INSTALL_DATA) $$i $(distdir)/Comments; done
-
-install-data-local:
- $(mkinstalldirs) \
- $(DESTDIR)$(benchdir)/Data \
- $(DESTDIR)$(benchdir)/Data/ATIS \
- $(DESTDIR)$(benchdir)/Data/Wisconsin \
- $(DESTDIR)$(benchdir)/limits \
- $(DESTDIR)$(benchdir)/Comments
- $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(benchdir)
- for i in $(srcdir)/Data/ATIS/*.* ; do $(INSTALL_DATA) $$i $(DESTDIR)$(benchdir)/Data/ATIS ; done
- for i in $(srcdir)/Data/Wisconsin/*.* ; do $(INSTALL_DATA) $$i $(DESTDIR)$(benchdir)/Data/Wisconsin ; done
- for i in $(srcdir)/limits/*.* ; do $(INSTALL_DATA) $$i $(DESTDIR)$(benchdir)/limits; done
- for i in $(srcdir)/Comments/*.* ; do $(INSTALL_DATA) $$i $(DESTDIR)$(benchdir)/Comments; done
-
-uninstall-local:
- @RM@ -f -r $(DESTDIR)$(benchdir)
-
-SUFFIXES = .sh
-
-.sh:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''benchdir''@!$(benchdir)!g' \
- -e 's!@''bindir''@!$(bindir)!g' \
- -e 's!@''scriptdir''@!$(bindir)!g' \
- -e 's!@''prefix''@!$(prefix)!g' \
- -e 's!@''datadir''@!$(datadir)!g' \
- -e 's!@''localstatedir''@!$(localstatedir)!g' \
- -e 's!@''libexecdir''@!$(libexecdir)!g' \
- -e 's!@''PERL''@!@PERL@!' \
- -e 's!@''VERSION''@!@VERSION@!' \
- -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \
- $< > $@-t
- @CHMOD@ +x $@-t
- @MV@ $@-t $@
diff --git a/sql-common/Makefile.am b/sql-common/Makefile.am
deleted file mode 100644
index 2f5a049085f..00000000000
--- a/sql-common/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2003-2004, 2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-## Process this file with automake to create Makefile.in
-EXTRA_DIST = client.c pack.c my_time.c my_user.c client_plugin.c
diff --git a/sql-common/client.c b/sql-common/client.c
index 6b5f04f2bff..21f41e4da0b 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -24,7 +24,6 @@
mysql_real_connect()
- Support for reading local file with LOAD DATA LOCAL
- SHARED memory handling
- - Protection against sigpipe
- Prepared statements
- Things that only works for the server
@@ -70,9 +69,9 @@ my_bool net_flush(NET *net);
#include "mysqld_error.h"
#include "errmsg.h"
#include <violite.h>
-#if defined(THREAD) && !defined(__WIN__)
+#if !defined(__WIN__)
#include <my_pthread.h> /* because of signal() */
-#endif /* defined(THREAD) && !defined(__WIN__) */
+#endif /* !defined(__WIN__) */
#include <sys/stat.h>
#include <signal.h>
@@ -287,7 +286,7 @@ static int wait_for_data(my_socket fd, uint timeout)
{
tv.tv_sec = (long) timeout;
tv.tv_usec = 0;
-#if defined(HPUX10) && defined(THREAD)
+#if defined(HPUX10)
if ((res = select(fd+1, NULL, (int*) &sfds, NULL, &tv)) > 0)
break;
#else
@@ -731,13 +730,9 @@ cli_safe_read(MYSQL *mysql)
{
NET *net= &mysql->net;
ulong len=0;
- init_sigpipe_variables
- /* Don't give sigpipe errors if the client doesn't want them */
- set_sigpipe(mysql);
if (net->vio != 0)
len=my_net_read(net);
- reset_sigpipe(mysql);
if (len == packet_error || len == 0)
{
@@ -817,13 +812,9 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
{
NET *net= &mysql->net;
my_bool result= 1;
- init_sigpipe_variables
my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE;
DBUG_ENTER("cli_advanced_command");
- /* Don't give sigpipe errors if the client doesn't want them */
- set_sigpipe(mysql);
-
if (mysql->net.vio == 0)
{ /* Do reconnect if possible */
if (mysql_reconnect(mysql) || stmt_skip)
@@ -872,7 +863,6 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
result= ((mysql->packet_length=cli_safe_read(mysql)) == packet_error ?
1 : 0);
end:
- reset_sigpipe(mysql);
DBUG_PRINT("exit",("result: %d", result));
DBUG_RETURN(result);
}
@@ -1089,14 +1079,11 @@ void end_server(MYSQL *mysql)
DBUG_ENTER("end_server");
if (mysql->net.vio != 0)
{
- init_sigpipe_variables
DBUG_PRINT("info",("Net: %s", vio_description(mysql->net.vio)));
#ifdef MYSQL_SERVER
slave_io_thread_detach_vio();
#endif
- set_sigpipe(mysql);
vio_delete(mysql->net.vio);
- reset_sigpipe(mysql);
mysql->net.vio= 0; /* Marker */
mysql_prune_stmt_list(mysql);
}
@@ -1161,6 +1148,7 @@ enum option_id {
OPT_ssl_cipher, OPT_max_allowed_packet, OPT_protocol, OPT_shared_memory_base_name,
OPT_multi_results, OPT_multi_statements, OPT_multi_queries, OPT_secure_auth,
OPT_report_data_truncation, OPT_plugin_dir, OPT_default_auth,
+ OPT_keep_this_one_last
};
static TYPELIB option_types={array_elements(default_options)-1,
@@ -1192,7 +1180,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
return 0;
}
-#define extension_set_string(OPTS, X, STR) \
+#define EXTENSION_SET_STRING(OPTS, X, STR) \
if ((OPTS)->extension) \
my_free((OPTS)->extension->X); \
else \
@@ -1210,6 +1198,9 @@ void mysql_read_default_options(struct st_mysql_options *options,
DBUG_ENTER("mysql_read_default_options");
DBUG_PRINT("enter",("file: %s group: %s",filename,group ? group :"NULL"));
+ compile_time_assert(OPT_keep_this_one_last ==
+ array_elements(default_options));
+
argc=1; argv=argv_buff; argv_buff[0]= (char*) "client";
groups[0]= (char*) "client"; groups[1]= (char*) group; groups[2]=0;
@@ -1219,7 +1210,7 @@ void mysql_read_default_options(struct st_mysql_options *options,
char **option=argv;
while (*++option)
{
- if (option[0] == args_separator) /* skip arguments separator */
+ if (my_getopt_is_args_separator(option[0])) /* skip arguments separator */
continue;
/* DBUG_PRINT("info",("option: %s",option[0])); */
if (option[0][0] == '-' && option[0][1] == '-')
@@ -1234,7 +1225,7 @@ void mysql_read_default_options(struct st_mysql_options *options,
/* Change all '_' in variable name to '-' */
for (end= *option ; *(end= strcend(end,'_')) ; )
*end= '-';
- switch (find_type(*option+2,&option_types,2)) {
+ switch (find_type(*option + 2, &option_types, FIND_TYPE_BASIC)) {
case OPT_port:
if (opt_arg)
options->port=atoi(opt_arg);
@@ -1250,7 +1241,7 @@ void mysql_read_default_options(struct st_mysql_options *options,
options->compress=1;
options->client_flag|= CLIENT_COMPRESS;
break;
- case OPT_password:
+ case OPT_password:
if (opt_arg)
{
my_free(options->password);
@@ -1296,7 +1287,7 @@ void mysql_read_default_options(struct st_mysql_options *options,
case OPT_return_found_rows:
options->client_flag|=CLIENT_FOUND_ROWS;
break;
-#ifdef HAVE_OPENSSL
+#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
case OPT_ssl_key:
my_free(options->ssl_key);
options->ssl_key = my_strdup(opt_arg, MYF(MY_WME));
@@ -1324,8 +1315,8 @@ void mysql_read_default_options(struct st_mysql_options *options,
case OPT_ssl_capath:
case OPT_ssl_cipher:
break;
-#endif /* HAVE_OPENSSL */
- case OPT_character_sets_dir:
+#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */
+ case OPT_character_sets_dir:
my_free(options->charset_dir);
options->charset_dir = my_strdup(opt_arg, MYF(MY_WME));
break;
@@ -1350,8 +1341,8 @@ void mysql_read_default_options(struct st_mysql_options *options,
options->max_allowed_packet= atoi(opt_arg);
break;
case OPT_protocol:
- if ((options->protocol= find_type(opt_arg,
- &sql_protocol_typelib,0)) <= 0)
+ if ((options->protocol= find_type(opt_arg, &sql_protocol_typelib,
+ FIND_TYPE_BASIC)) <= 0)
{
fprintf(stderr, "Unknown option to protocol: %s\n", opt_arg);
exit(1);
@@ -1378,10 +1369,22 @@ void mysql_read_default_options(struct st_mysql_options *options,
options->report_data_truncation= opt_arg ? test(atoi(opt_arg)) : 1;
break;
case OPT_plugin_dir:
- extension_set_string(options, plugin_dir, opt_arg);
+ {
+ char buff[FN_REFLEN], buff2[FN_REFLEN];
+ if (strlen(opt_arg) >= FN_REFLEN)
+ opt_arg[FN_REFLEN]= '\0';
+ if (my_realpath(buff, opt_arg, 0))
+ {
+ DBUG_PRINT("warning",("failed to normalize the plugin path: %s",
+ opt_arg));
+ break;
+ }
+ convert_dirname(buff, buff2, NULL);
+ EXTENSION_SET_STRING(options, plugin_dir, buff2);
+ }
break;
case OPT_default_auth:
- extension_set_string(options, default_auth, opt_arg);
+ EXTENSION_SET_STRING(options, default_auth, opt_arg);
break;
default:
DBUG_PRINT("warning",("unknown option: %s",option[0]));
@@ -1842,6 +1845,8 @@ mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
ssl_verify_server_cert()
vio pointer to a SSL connected vio
server_hostname name of the server that we connected to
+ errptr if we fail, we'll return (a pointer to a string
+ describing) the reason here
RETURN VALUES
0 Success
@@ -1851,7 +1856,7 @@ mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
-static int ssl_verify_server_cert(Vio *vio, const char* server_hostname)
+static int ssl_verify_server_cert(Vio *vio, const char* server_hostname, const char **errptr)
{
SSL *ssl;
X509 *server_cert;
@@ -1862,19 +1867,19 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname)
if (!(ssl= (SSL*)vio->ssl_arg))
{
- DBUG_PRINT("error", ("No SSL pointer found"));
+ *errptr= "No SSL pointer found";
DBUG_RETURN(1);
}
if (!server_hostname)
{
- DBUG_PRINT("error", ("No server hostname supplied"));
+ *errptr= "No server hostname supplied";
DBUG_RETURN(1);
}
if (!(server_cert= SSL_get_peer_certificate(ssl)))
{
- DBUG_PRINT("error", ("Could not get server certificate"));
+ *errptr= "Could not get server certificate";
DBUG_RETURN(1);
}
@@ -1903,7 +1908,7 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname)
DBUG_RETURN(0);
}
}
- DBUG_PRINT("error", ("SSL certificate validation failure"));
+ *errptr= "SSL certificate validation failure";
DBUG_RETURN(1);
}
@@ -2266,6 +2271,7 @@ typedef struct st_mysql_client_plugin_AUTHENTICATION auth_plugin_t;
static int client_mpvio_write_packet(struct st_plugin_vio*, const uchar*, int);
static int native_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql);
static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql);
+static int clear_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql);
static auth_plugin_t native_password_client_plugin=
{
@@ -2275,6 +2281,9 @@ static auth_plugin_t native_password_client_plugin=
"R.J.Silk, Sergei Golubchik",
"Native MySQL authentication",
{1, 0, 0},
+ "GPL",
+ NULL,
+ NULL,
NULL,
NULL,
native_password_auth_client
@@ -2288,15 +2297,42 @@ static auth_plugin_t old_password_client_plugin=
"R.J.Silk, Sergei Golubchik",
"Old MySQL-3.23 authentication",
{1, 0, 0},
+ "GPL",
+ NULL,
+ NULL,
NULL,
NULL,
old_password_auth_client
};
+static auth_plugin_t clear_password_client_plugin=
+{
+ MYSQL_CLIENT_AUTHENTICATION_PLUGIN,
+ MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION,
+ "mysql_clear_password",
+ "Georgi Kodinov",
+ "Clear password authentication plugin",
+ {0,1,0},
+ "GPL",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ clear_password_auth_client
+};
+
+#ifdef AUTHENTICATION_WIN
+extern auth_plugin_t win_auth_client_plugin;
+#endif
+
struct st_mysql_client_plugin *mysql_client_builtins[]=
{
(struct st_mysql_client_plugin *)&native_password_client_plugin,
(struct st_mysql_client_plugin *)&old_password_client_plugin,
+ (struct st_mysql_client_plugin *)&clear_password_client_plugin,
+#ifdef AUTHENTICATION_WIN
+ (struct st_mysql_client_plugin *)&win_auth_client_plugin,
+#endif
0
};
@@ -2309,15 +2345,15 @@ typedef struct {
void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info);
/* -= end of MYSQL_PLUGIN_VIO =- */
MYSQL *mysql;
- auth_plugin_t *plugin; /**< what plugin we're under */
+ auth_plugin_t *plugin; /**< what plugin we're under */
const char *db;
struct {
- uchar *pkt; /**< pointer into NET::buff */
+ uchar *pkt; /**< pointer into NET::buff */
uint pkt_len;
} cached_server_reply;
- uint packets_read, packets_written; /**< counters for send/received packets */
- my_bool mysql_change_user; /**< if it's mysql_change_user() */
- int last_read_packet_len; /**< the length of the last *read* packet */
+ int packets_read, packets_written; /**< counters for send/received packets */
+ int mysql_change_user; /**< if it's mysql_change_user() */
+ int last_read_packet_len; /**< the length of the last *read* packet */
} MCPVIO_EXT;
/**
@@ -2339,7 +2375,6 @@ typedef struct {
@retval 0 ok
@retval 1 error
*/
-
static int send_change_user_packet(MCPVIO_EXT *mpvio,
const uchar *data, int data_len)
{
@@ -2423,7 +2458,6 @@ error:
@retval 0 ok
@retval 1 error
*/
-
static int send_client_reply_packet(MCPVIO_EXT *mpvio,
const uchar *data, int data_len)
{
@@ -2481,7 +2515,9 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
/* Do the SSL layering. */
struct st_mysql_options *options= &mysql->options;
struct st_VioSSLFd *ssl_fd;
- char error_string[1024];
+ enum enum_ssl_init_error ssl_init_error;
+ const char *cert_error;
+ unsigned long ssl_error;
/*
Send mysql->client_flag, max_packet_size - unencrypted otherwise
@@ -2501,32 +2537,36 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
options->ssl_cert,
options->ssl_ca,
options->ssl_capath,
- options->ssl_cipher)))
+ options->ssl_cipher,
+ &ssl_init_error)))
{
- set_mysql_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate);
+ set_mysql_extended_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate,
+ ER(CR_SSL_CONNECTION_ERROR), sslGetErrString(ssl_init_error));
goto error;
}
- mysql->connector_fd= (void*)ssl_fd;
+ mysql->connector_fd= (unsigned char *) ssl_fd;
/* Connect to the server */
DBUG_PRINT("info", ("IO layer change in progress..."));
if (sslconnect(ssl_fd, net->vio,
- (long) (mysql->options.connect_timeout),
- error_string))
- {
- set_mysql_extended_error(mysql, CR_SSL_CONNECTION_ERROR,
- unknown_sqlstate, "SSL error: %s",
- error_string[0] ? error_string :
- ER(CR_SSL_CONNECTION_ERROR));
+ (long) (mysql->options.connect_timeout), &ssl_error))
+ {
+ char buf[512];
+ ERR_error_string_n(ssl_error, buf, 512);
+ buf[511]= 0;
+ set_mysql_extended_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate,
+ ER(CR_SSL_CONNECTION_ERROR),
+ buf);
goto error;
}
DBUG_PRINT("info", ("IO layer change done!"));
/* Verify server cert */
if ((mysql->client_flag & CLIENT_SSL_VERIFY_SERVER_CERT) &&
- ssl_verify_server_cert(net->vio, mysql->host))
+ ssl_verify_server_cert(net->vio, mysql->host, &cert_error))
{
- set_mysql_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate);
+ set_mysql_extended_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate,
+ ER(CR_SSL_CONNECTION_ERROR), cert_error);
goto error;
}
}
@@ -2599,7 +2639,6 @@ error:
This function is called by a client authentication plugin, when it wants
to read data from the server.
*/
-
static int client_mpvio_read_packet(struct st_plugin_vio *mpv, uchar **buf)
{
MCPVIO_EXT *mpvio= (MCPVIO_EXT*)mpv;
@@ -2662,7 +2701,6 @@ static int client_mpvio_read_packet(struct st_plugin_vio *mpv, uchar **buf)
It transparently wraps the data into a change user or authentication
handshake packet, if neccessary.
*/
-
static int client_mpvio_write_packet(struct st_plugin_vio *mpv,
const uchar *pkt, int pkt_len)
{
@@ -2698,7 +2736,6 @@ static int client_mpvio_write_packet(struct st_plugin_vio *mpv,
fills MYSQL_PLUGIN_VIO_INFO structure with the information about the
connection
*/
-
void mpvio_info(Vio *vio, MYSQL_PLUGIN_VIO_INFO *info)
{
bzero(info, sizeof(*info));
@@ -2729,7 +2766,9 @@ void mpvio_info(Vio *vio, MYSQL_PLUGIN_VIO_INFO *info)
return;
case VIO_TYPE_SHARED_MEMORY:
info->protocol= MYSQL_VIO_MEMORY;
+#ifdef HAVE_SMEM
info->handle= vio->handle_file_map; /* or what ? */
+#endif
return;
#endif
default: DBUG_ASSERT(0);
@@ -2761,7 +2800,6 @@ static void client_mpvio_info(MYSQL_PLUGIN_VIO *vio,
@retval 0 ok
@retval 1 error
*/
-
int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
const char *data_plugin, const char *db)
{
@@ -2771,6 +2809,7 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
ulong pkt_length;
int res;
+ DBUG_ENTER ("run_plugin_auth");
/* determine the default/initial plugin to use */
if (mysql->options.extension && mysql->options.extension->default_auth &&
mysql->server_capabilities & CLIENT_PLUGIN_AUTH)
@@ -2778,7 +2817,7 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
auth_plugin_name= mysql->options.extension->default_auth;
if (!(auth_plugin= (auth_plugin_t*) mysql_client_find_plugin(mysql,
auth_plugin_name, MYSQL_CLIENT_AUTHENTICATION_PLUGIN)))
- return 1; /* oops, not found */
+ DBUG_RETURN (1); /* oops, not found */
}
else
{
@@ -2787,6 +2826,8 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
auth_plugin_name= auth_plugin->name;
}
+ DBUG_PRINT ("info", ("using plugin %s", auth_plugin_name));
+
mysql->net.last_errno= 0; /* just in case */
if (data_plugin && strcmp(data_plugin, auth_plugin_name))
@@ -2808,6 +2849,11 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
mpvio.plugin= auth_plugin;
res= auth_plugin->authenticate_user((struct st_plugin_vio *)&mpvio, mysql);
+ DBUG_PRINT ("info", ("authenticate_user returned %s",
+ res == CR_OK ? "CR_OK" :
+ res == CR_ERROR ? "CR_ERROR" :
+ res == CR_OK_HANDSHAKE_COMPLETE ?
+ "CR_OK_HANDSHAKE_COMPLETE" : "error"));
compile_time_assert(CR_OK == -1);
compile_time_assert(CR_ERROR == 0);
@@ -2818,12 +2864,13 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
unless the error code is CR_ERROR and mysql->net.last_errno
is already set (the plugin has done it)
*/
+ DBUG_PRINT ("info", ("res=%d", res));
if (res > CR_ERROR)
set_mysql_error(mysql, res, unknown_sqlstate);
else
if (!mysql->net.last_errno)
set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate);
- return 1;
+ DBUG_RETURN (1);
}
/* read the OK packet (or use the cached value in mysql->net.read_pos */
@@ -2832,6 +2879,7 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
else /* res == CR_OK_HANDSHAKE_COMPLETE */
pkt_length= mpvio.last_read_packet_len;
+ DBUG_PRINT ("info", ("OK packet length=%lu", pkt_length));
if (pkt_length == packet_error)
{
if (mysql->net.last_errno == CR_SERVER_LOST)
@@ -2839,7 +2887,7 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
ER(CR_SERVER_LOST_EXTENDED),
"reading authorization packet",
errno);
- return 1;
+ DBUG_RETURN (1);
}
if (mysql->net.read_pos[0] == 254)
@@ -2848,6 +2896,7 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
if (pkt_length == 1)
{
/* old "use short scramble" packet */
+ DBUG_PRINT ("info", ("old use short scramble packet from server"));
auth_plugin_name= old_password_plugin_name;
mpvio.cached_server_reply.pkt= (uchar*)mysql->scramble;
mpvio.cached_server_reply.pkt_len= SCRAMBLE_LENGTH + 1;
@@ -2860,15 +2909,22 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
len= strlen(auth_plugin_name); /* safe as my_net_read always appends \0 */
mpvio.cached_server_reply.pkt_len= pkt_length - len - 2;
mpvio.cached_server_reply.pkt= mysql->net.read_pos + len + 2;
+ DBUG_PRINT ("info", ("change plugin packet from server for plugin %s",
+ auth_plugin_name));
}
if (!(auth_plugin= (auth_plugin_t *) mysql_client_find_plugin(mysql,
auth_plugin_name, MYSQL_CLIENT_AUTHENTICATION_PLUGIN)))
- return 1;
+ DBUG_RETURN (1);
mpvio.plugin= auth_plugin;
res= auth_plugin->authenticate_user((struct st_plugin_vio *)&mpvio, mysql);
+ DBUG_PRINT ("info", ("second authenticate_user returned %s",
+ res == CR_OK ? "CR_OK" :
+ res == CR_ERROR ? "CR_ERROR" :
+ res == CR_OK_HANDSHAKE_COMPLETE ?
+ "CR_OK_HANDSHAKE_COMPLETE" : "error"));
if (res > CR_OK)
{
if (res > CR_ERROR)
@@ -2876,7 +2932,7 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
else
if (!mysql->net.last_errno)
set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate);
- return 1;
+ DBUG_RETURN (1);
}
if (res != CR_OK_HANDSHAKE_COMPLETE)
@@ -2889,7 +2945,7 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
ER(CR_SERVER_LOST_EXTENDED),
"reading final connect information",
errno);
- return 1;
+ DBUG_RETURN (1);
}
}
}
@@ -2897,7 +2953,7 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
net->read_pos[0] should always be 0 here if the server implements
the protocol correctly
*/
- return mysql->net.read_pos[0] != 0;
+ DBUG_RETURN (mysql->net.read_pos[0] != 0);
}
@@ -2907,8 +2963,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
uint port, const char *unix_socket,ulong client_flag)
{
char buff[NAME_LEN+USERNAME_LENGTH+100];
- int scramble_data_len, pkt_scramble_len;
- char *end, *host_info=0, *server_version_end, *pkt_end;
+ int scramble_data_len, pkt_scramble_len= 0;
+ char *end,*host_info= 0, *server_version_end, *pkt_end;
char *scramble_data;
const char *scramble_plugin;
ulong pkt_length;
@@ -2923,7 +2979,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
#ifdef HAVE_SYS_UN_H
struct sockaddr_un UNIXaddr;
#endif
- init_sigpipe_variables
DBUG_ENTER("mysql_real_connect");
LINT_INIT(pkt_scramble_len);
@@ -2939,8 +2994,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
DBUG_RETURN(0);
}
- /* Don't give sigpipe errors if the client doesn't want them */
- set_sigpipe(mysql);
mysql->methods= &client_methods;
net->vio = 0; /* If something goes wrong */
mysql->client_flag=0; /* For handshake */
@@ -3451,11 +3504,9 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
#endif
DBUG_PRINT("exit", ("Mysql handler: 0x%lx", (long) mysql));
- reset_sigpipe(mysql);
DBUG_RETURN(mysql);
error:
- reset_sigpipe(mysql);
DBUG_PRINT("error",("message: %u/%s (%s)",
net->last_errno,
net->sqlstate,
@@ -4076,10 +4127,10 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
mysql->options.client_flag&= ~CLIENT_SSL_VERIFY_SERVER_CERT;
break;
case MYSQL_PLUGIN_DIR:
- extension_set_string(&mysql->options, plugin_dir, arg);
+ EXTENSION_SET_STRING(&mysql->options, plugin_dir, arg);
break;
case MYSQL_DEFAULT_AUTH:
- extension_set_string(&mysql->options, default_auth, arg);
+ EXTENSION_SET_STRING(&mysql->options, default_auth, arg);
break;
default:
DBUG_RETURN(1);
@@ -4188,6 +4239,123 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, const char *cs_name)
return mysql->net.last_errno;
}
+/**
+ client authentication plugin that does native MySQL authentication
+ using a 20-byte (4.1+) scramble
+*/
+static int native_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
+{
+ int pkt_len;
+ uchar *pkt;
+
+ DBUG_ENTER("native_password_auth_client");
+
+
+ if (((MCPVIO_EXT *)vio)->mysql_change_user)
+ {
+ /*
+ in mysql_change_user() the client sends the first packet.
+ we use the old scramble.
+ */
+ pkt= (uchar*)mysql->scramble;
+ pkt_len= SCRAMBLE_LENGTH + 1;
+ }
+ else
+ {
+ /* read the scramble */
+ if ((pkt_len= vio->read_packet(vio, &pkt)) < 0)
+ DBUG_RETURN(CR_ERROR);
+
+ if (pkt_len != SCRAMBLE_LENGTH + 1)
+ DBUG_RETURN(CR_SERVER_HANDSHAKE_ERR);
+
+ /* save it in MYSQL */
+ memcpy(mysql->scramble, pkt, SCRAMBLE_LENGTH);
+ mysql->scramble[SCRAMBLE_LENGTH] = 0;
+ }
+
+ if (mysql->passwd[0])
+ {
+ char scrambled[SCRAMBLE_LENGTH + 1];
+ DBUG_PRINT("info", ("sending scramble"));
+ scramble(scrambled, (char*)pkt, mysql->passwd);
+ if (vio->write_packet(vio, (uchar*)scrambled, SCRAMBLE_LENGTH))
+ DBUG_RETURN(CR_ERROR);
+ }
+ else
+ {
+ DBUG_PRINT("info", ("no password"));
+ if (vio->write_packet(vio, 0, 0)) /* no password */
+ DBUG_RETURN(CR_ERROR);
+ }
+
+ DBUG_RETURN(CR_OK);
+}
+
+/**
+ client authentication plugin that does old MySQL authentication
+ using an 8-byte (4.0-) scramble
+*/
+static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
+{
+ uchar *pkt;
+ int pkt_len;
+
+ DBUG_ENTER("old_password_auth_client");
+
+ if (((MCPVIO_EXT *)vio)->mysql_change_user)
+ {
+ /*
+ in mysql_change_user() the client sends the first packet.
+ we use the old scramble.
+ */
+ pkt= (uchar*)mysql->scramble;
+ pkt_len= SCRAMBLE_LENGTH_323 + 1;
+ }
+ else
+ {
+ /* read the scramble */
+ if ((pkt_len= vio->read_packet(vio, &pkt)) < 0)
+ DBUG_RETURN(CR_ERROR);
+
+ if (pkt_len != SCRAMBLE_LENGTH_323 + 1 &&
+ pkt_len != SCRAMBLE_LENGTH + 1)
+ DBUG_RETURN(CR_SERVER_HANDSHAKE_ERR);
+
+ /* save it in MYSQL */
+ memcpy(mysql->scramble, pkt, pkt_len);
+ mysql->scramble[pkt_len] = 0;
+ }
+
+ if (mysql->passwd[0])
+ {
+ char scrambled[SCRAMBLE_LENGTH_323 + 1];
+ scramble_323(scrambled, (char*)pkt, mysql->passwd);
+ if (vio->write_packet(vio, (uchar*)scrambled, SCRAMBLE_LENGTH_323 + 1))
+ DBUG_RETURN(CR_ERROR);
+ }
+ else
+ if (vio->write_packet(vio, 0, 0)) /* no password */
+ DBUG_RETURN(CR_ERROR);
+
+ DBUG_RETURN(CR_OK);
+}
+
+/**
+ The main function of the mysql_clear_password authentication plugin.
+*/
+
+static int clear_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
+{
+ int res;
+
+ /* send password in clear text */
+ res= vio->write_packet(vio, (const unsigned char *) mysql->passwd,
+ strlen(mysql->passwd) + 1);
+
+ return res ? CR_ERROR : CR_OK;
+}
+
/**
client authentication plugin that does native MySQL authentication
diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c
index 71c305fdb2a..53d283d98ce 100644
--- a/sql-common/client_plugin.c
+++ b/sql-common/client_plugin.c
@@ -1,4 +1,5 @@
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
+ Copyright (C) 2010 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,11 +32,7 @@
#include "mysql.h"
#include <my_sys.h>
#include <m_string.h>
-#ifdef THREAD
#include <my_pthread.h>
-#else
-#include <my_no_pthread.h>
-#endif
#include <sql_common.h>
#include "errmsg.h"
@@ -67,9 +64,7 @@ static uint plugin_version[MYSQL_CLIENT_MAX_PLUGINS]=
loading the same plugin twice in parallel.
*/
struct st_client_plugin_int *plugin_list[MYSQL_CLIENT_MAX_PLUGINS];
-#ifdef THREAD
static pthread_mutex_t LOCK_load_client_plugin;
-#endif
static int is_not_initialized(MYSQL *mysql, const char *name)
{
@@ -82,7 +77,6 @@ static int is_not_initialized(MYSQL *mysql, const char *name)
return 1;
}
-
/**
finds a plugin in the list
@@ -93,8 +87,8 @@ static int is_not_initialized(MYSQL *mysql, const char *name)
@retval a pointer to a found plugin or 0
*/
-
-static struct st_mysql_client_plugin *find_plugin(const char *name, int type)
+static struct st_mysql_client_plugin *
+find_plugin(const char *name, int type)
{
struct st_client_plugin_int *p;
@@ -111,7 +105,6 @@ static struct st_mysql_client_plugin *find_plugin(const char *name, int type)
return NULL;
}
-
/**
verifies the plugin and adds it to the list
@@ -124,7 +117,6 @@ static struct st_mysql_client_plugin *find_plugin(const char *name, int type)
@retval a pointer to an installed plugin or 0
*/
-
static struct st_mysql_client_plugin *
add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle,
int argc, va_list args)
@@ -172,6 +164,7 @@ add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle,
p->next= plugin_list[plugin->type];
plugin_list[plugin->type]= p;
+ net_clear_error(&mysql->net);
return plugin;
@@ -179,15 +172,14 @@ err2:
if (plugin->deinit)
plugin->deinit();
err1:
- if (dlhandle)
- dlclose(dlhandle);
set_mysql_extended_error(mysql, CR_AUTH_PLUGIN_CANNOT_LOAD, unknown_sqlstate,
ER(CR_AUTH_PLUGIN_CANNOT_LOAD), plugin->name,
errmsg);
+ if (dlhandle)
+ dlclose(dlhandle);
return NULL;
}
-
/**
Loads plugins which are specified in the environment variable
LIBMYSQL_PLUGINS.
@@ -203,7 +195,6 @@ err1:
or
LIBMYSQL_PLUGINS="plugin1=int:param1,str:param2;plugin2;..."
*/
-
static void load_env_plugins(MYSQL *mysql)
{
char *plugs, *free_env, *s= getenv("LIBMYSQL_PLUGINS");
@@ -234,7 +225,6 @@ static void load_env_plugins(MYSQL *mysql)
@retval 0 successful
@retval != 0 error occured
*/
-
int mysql_client_plugin_init()
{
MYSQL mysql;
@@ -264,13 +254,11 @@ int mysql_client_plugin_init()
return 0;
}
-
/**
Deinitializes the client plugin layer.
Unloades all client plugins and frees any associated resources.
*/
-
void mysql_client_plugin_deinit()
{
int i;
@@ -321,7 +309,6 @@ mysql_client_register_plugin(MYSQL *mysql,
return plugin;
}
-
/* see <mysql/client_plugin.h> for a full description */
struct st_mysql_client_plugin *
mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
@@ -332,8 +319,13 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
void *sym, *dlhandle;
struct st_mysql_client_plugin *plugin;
+ DBUG_ENTER ("mysql_load_plugin_v");
+ DBUG_PRINT ("entry", ("name=%s type=%d int argc=%d", name, type, argc));
if (is_not_initialized(mysql, name))
- return NULL;
+ {
+ DBUG_PRINT ("leave", ("mysql not initialized"));
+ DBUG_RETURN (NULL);
+ }
pthread_mutex_lock(&LOCK_load_client_plugin);
@@ -350,9 +342,11 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
mysql->options.extension->plugin_dir : PLUGINDIR, "/",
name, SO_EXT, NullS);
+ DBUG_PRINT ("info", ("dlopeninig %s", dlpath));
/* Open new dll handle */
if (!(dlhandle= dlopen(dlpath, RTLD_NOW)))
{
+ DBUG_PRINT ("info", ("failed to dlopen"));
errmsg= dlerror();
goto err;
}
@@ -388,16 +382,17 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
pthread_mutex_unlock(&LOCK_load_client_plugin);
- return plugin;
+ DBUG_PRINT ("leave", ("plugin loaded ok"));
+ DBUG_RETURN (plugin);
err:
pthread_mutex_unlock(&LOCK_load_client_plugin);
+ DBUG_PRINT ("leave", ("plugin load error : %s", errmsg));
set_mysql_extended_error(mysql, CR_AUTH_PLUGIN_CANNOT_LOAD, unknown_sqlstate,
ER(CR_AUTH_PLUGIN_CANNOT_LOAD), name, errmsg);
- return NULL;
+ DBUG_RETURN (NULL);
}
-
/* see <mysql/client_plugin.h> for a full description */
struct st_mysql_client_plugin *
mysql_load_plugin(MYSQL *mysql, const char *name, int type, int argc, ...)
@@ -410,15 +405,16 @@ mysql_load_plugin(MYSQL *mysql, const char *name, int type, int argc, ...)
return p;
}
-
/* see <mysql/client_plugin.h> for a full description */
struct st_mysql_client_plugin *
mysql_client_find_plugin(MYSQL *mysql, const char *name, int type)
{
struct st_mysql_client_plugin *p;
+ DBUG_ENTER ("mysql_client_find_plugin");
+ DBUG_PRINT ("entry", ("name=%s, type=%d", name, type));
if (is_not_initialized(mysql, name))
- return NULL;
+ DBUG_RETURN (NULL);
if (type < 0 || type >= MYSQL_CLIENT_MAX_PLUGINS)
{
@@ -428,9 +424,26 @@ mysql_client_find_plugin(MYSQL *mysql, const char *name, int type)
}
if ((p= find_plugin(name, type)))
- return p;
+ {
+ DBUG_PRINT ("leave", ("found %p", p));
+ DBUG_RETURN (p);
+ }
/* not found, load it */
- return mysql_load_plugin(mysql, name, type, 0);
+ p= mysql_load_plugin(mysql, name, type, 0);
+ DBUG_PRINT ("leave", ("loaded %p", p));
+ DBUG_RETURN (p);
}
+
+/* see <mysql/client_plugin.h> for a full description */
+int mysql_plugin_options(struct st_mysql_client_plugin *plugin,
+ const char *option,
+ const void *value)
+{
+ DBUG_ENTER("mysql_plugin_options");
+ /* does the plugin support options call? */
+ if (!plugin || !plugin->options)
+ DBUG_RETURN(1);
+ DBUG_RETURN(plugin->options(option, value));
+}
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 0a09e945022..f5ac64b2d80 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -772,7 +772,7 @@ long calc_daynr(uint year,uint month,uint day)
int y= year; /* may be < 0 temporarily */
DBUG_ENTER("calc_daynr");
- if (y == 0 && month == 0 && day == 0)
+ if (y == 0 && month == 0)
DBUG_RETURN(0); /* Skip errors */
/* Cast to int to be able to handle month == 0 */
delsum= (long) (365 * y + 31 *((int) month - 1) + (int) day);
@@ -783,6 +783,7 @@ long calc_daynr(uint year,uint month,uint day)
temp=(int) ((y/100+1)*3)/4;
DBUG_PRINT("exit",("year: %d month: %d day: %d -> daynr: %ld",
y+(month <= 2),month,day,delsum+y/4-temp));
+ DBUG_ASSERT(delsum+(int) y/4-temp > 0);
DBUG_RETURN(delsum+(int) y/4-temp);
} /* calc_daynr */
@@ -992,7 +993,7 @@ my_system_gmt_sec(const MYSQL_TIME *t_src, long *my_timezone,
with unsigned time_t tmp+= shift*86400L might result in a number,
larger then TIMESTAMP_MAX_VALUE, so another check will work.
*/
- if ((tmp < TIMESTAMP_MIN_VALUE) || (tmp > TIMESTAMP_MAX_VALUE))
+ if (!IS_TIME_T_VALID_FOR_TIMESTAMP(tmp))
tmp= 0;
return (my_time_t) tmp;
@@ -1136,7 +1137,12 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
nr= (nr+19000000L)*1000000L; /* YYMMDD, year: 1970-1999 */
goto ok;
}
- if (nr < 10000101L)
+ /*
+ Though officially we support DATE values from 1000-01-01 only, one can
+ easily insert a value like 1-1-1. So, for consistency reasons such dates
+ are allowed when TIME_FUZZY_DATE is set.
+ */
+ if (nr < 10000101L && !(flags & TIME_FUZZY_DATE))
goto err;
if (nr <= 99991231L)
{
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 9a808b62f24..966522b5aa3 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -50,7 +50,8 @@ SET (SQL_SOURCE
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 keycaches.cc
- ../sql-common/client_plugin.c create_options.cc
+ ../sql-common/client_plugin.c
+ create_options.cc
multi_range_read.cc opt_index_cond_pushdown.cc
opt_subselect.cc opt_table_elimination.cc
sql_expression_cache.cc sql_join_cache.cc
@@ -135,7 +136,7 @@ IF(NOT WITHOUT_DYNAMIC_PLUGINS)
ENDIF()
SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
-TARGET_LINK_LIBRARIES(mysqld sql)
+TARGET_LINK_LIBRARIES(mysqld sql mysys)
# Provide plugins with minimal set of libraries
SET(INTERFACE_LIBS ${LIBRT})
@@ -286,7 +287,11 @@ IF(WIN32 AND MYSQLD_EXECUTABLE)
COMPONENT DataFiles PATTERN "initdb.dep" EXCLUDE PATTERN "bootstrap.sql" EXCLUDE)
ELSE()
# Not windows or cross compiling, just install an empty directory
- INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql)
+ INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql COMPONENT DataFiles)
ENDIF()
ENDIF()
+ADD_CUSTOM_TARGET(show-dist-name
+ COMMAND ${CMAKE_COMMAND} -E echo "${CPACK_PACKAGE_FILE_NAME}"
+)
+
diff --git a/sql/Makefile.am b/sql/Makefile.am
deleted file mode 100644
index 2bc0d386935..00000000000
--- a/sql/Makefile.am
+++ /dev/null
@@ -1,287 +0,0 @@
-# Copyright (C) 2000-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-#called from the top level Makefile
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(pkglibdir)/plugin
-INCLUDES = @ZLIB_INCLUDES@ \
- -I$(top_builddir)/include -I$(top_srcdir)/include \
- -I$(top_srcdir)/regex -I$(srcdir) $(openssl_includes) \
- $(libevent_includes)
-WRAPLIBS= @WRAPLIBS@
-SUBDIRS = share
-libexec_PROGRAMS = mysqld
-EXTRA_PROGRAMS = gen_lex_hash
-bin_PROGRAMS = mysql_tzinfo_to_sql
-DTRACEFILES = filesort.o \
- .libs/libndb_la-ha_ndbcluster.o \
- handler.o \
- mysqld.o \
- net_serv.o \
- scheduler.o \
- sp_head.o \
- sql_cache.o \
- sql_connect.o \
- sql_cursor.o \
- sql_delete.o \
- sql_truncate.o \
- sql_reload.o \
- sql_insert.o \
- datadict.o \
- sql_parse.o \
- sql_prepare.o \
- sql_select.o \
- sql_update.o
-
-DTRACEFILES_DEPEND = filesort.o \
- libndb_la-ha_ndbcluster.lo \
- handler.o \
- mysqld.o \
- net_serv.o \
- scheduler.o \
- sp_head.o \
- sql_cache.o \
- sql_connect.o \
- sql_cursor.o \
- sql_delete.o \
- sql_truncate.o \
- sql_reload.o \
- sql_insert.o \
- datadict.o \
- sql_parse.o \
- sql_prepare.o \
- sql_select.o \
- sql_update.o
-
-
-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) libndb.la
-LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@
-mysqld_LDADD = libndb.la \
- @MYSQLD_EXTRA_LDFLAGS@ \
- @pstack_libs@ $(libevent_libs) \
- @mysql_plugin_libs@ \
- $(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \
- $(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 \
- item_xmlfunc.h sql_plugin_services.h \
- item_create.h item_subselect.h item_row.h \
- sql_priv.h item_geofunc.h sql_bitmap.h \
- procedure.h sql_class.h sql_lex.h sql_list.h \
- sql_string.h unireg.h \
- sql_error.h field.h handler.h mysqld_suffix.h \
- sql_profile.h mysqld.h sql_help.h frm_crypt.h \
- ha_ndbcluster.h ha_ndbcluster_cond.h \
- ha_ndbcluster_binlog.h ha_ndbcluster_tables.h \
- ha_partition.h rpl_constants.h \
- debug_sync.h \
- opt_range.h protocol.h rpl_tblmap.h rpl_utility.h \
- rpl_reporting.h sql_locale.h sql_parse.h \
- log.h sql_show.h rpl_rli.h rpl_mi.h \
- opt_subselect.h log_slow.h multi_range_read.h \
- create_options.h sql_expression_cache.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 sql_base.h \
- sql_table.h key.h lock.h thr_malloc.h strfunc.h \
- sql_delete.h sql_insert.h sql_update.h sql_db.h \
- sql_connect.h sql_rename.h sql_time.h sql_tablespace.h \
- hostname.h sql_test.h records.h filesort.h \
- sql_derived.h sql_load.h sql_handler.h init.h \
- derror.h sql_union.h des_key_file.h sql_binlog.h \
- discover.h sql_manager.h sql_do.h \
- sql_repl.h slave.h rpl_filter.h rpl_injector.h \
- log_event.h rpl_record.h sql_const.h \
- log_event_old.h rpl_record_old.h \
- sql_sort.h sql_cache.h set_var.h sys_vars_shared.h \
- spatial.h gstream.h client_settings.h tzfile.h \
- tztime.h my_decimal.h keycaches.h \
- sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \
- parse_file.h sql_view.h sql_trigger.h \
- sql_array.h sql_cursor.h events.h scheduler.h \
- event_db_repository.h event_queue.h \
- sql_plugin.h authors.h event_parse_data.h \
- event_data_objects.h event_scheduler.h \
- sql_partition.h partition_info.h partition_element.h \
- sql_audit.h sql_alter.h sql_partition_admin.h \
- contributors.h sql_servers.h sql_signal.h records.h \
- sql_prepare.h rpl_handler.h replication.h mdl.h \
- sql_plist.h transaction.h sys_vars.h sql_truncate.h \
- sql_admin.h sql_reload.h datadict.h
-
-mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
- item.cc item_sum.cc item_buff.cc item_func.cc \
- item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \
- thr_malloc.cc item_create.cc item_subselect.cc \
- item_row.cc item_geofunc.cc item_xmlfunc.cc \
- field.cc strfunc.cc key.cc sql_class.cc sql_list.cc \
- net_serv.cc protocol.cc sql_state.c \
- lock.cc sql_string.cc sql_manager.cc \
- main.cc mysqld.cc password.c hash_filo.cc hostname.cc \
- sql_connect.cc scheduler.cc sql_parse.cc \
- keycaches.cc set_var.cc sql_yacc.yy sys_vars.cc \
- sql_join_cache.cc opt_subselect.cc create_options.cc \
- opt_table_elimination.cc multi_range_read.cc \
- opt_index_cond_pushdown.cc sql_expression_cache.cc \
- sql_base.cc table.cc sql_select.cc sql_insert.cc \
- sql_reload.cc datadict.cc sql_profile.cc \
- sql_prepare.cc sql_error.cc sql_locale.cc \
- sql_update.cc sql_delete.cc uniques.cc sql_do.cc \
- procedure.cc sql_test.cc sql_admin.cc \
- sql_truncate.cc \
- log.cc init.cc derror.cc sql_acl.cc \
- unireg.cc des_key_file.cc \
- log_event.cc rpl_record.cc \
- log_event_old.cc rpl_record_old.cc \
- discover.cc sql_time.cc opt_range.cc opt_sum.cc \
- records.cc filesort.cc handler.cc \
- ha_partition.cc \
- debug_sync.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 \
- sql_client.cc \
- repl_failsafe.h repl_failsafe.cc sql_view.cc \
- gstream.cc spatial.cc sql_help.cc sql_cursor.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 \
- event_queue.cc event_db_repository.cc events.cc \
- sql_plugin.cc sql_binlog.cc \
- sql_builtin.cc sql_tablespace.cc partition_info.cc \
- sql_servers.cc event_parse_data.cc sql_signal.cc \
- rpl_handler.cc mdl.cc transaction.cc sql_audit.cc \
- sql_alter.cc sql_partition_admin.cc sha2.cc
-
-nodist_mysqld_SOURCES = mini_client_errors.c pack.c client.c my_time.c my_user.c client_plugin.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@
-
-mysql_tzinfo_to_sql_SOURCES = tztime.cc
-mysql_tzinfo_to_sql_CXXFLAGS= -DTZINFO2SQL
-
-DEFS = -DMYSQL_SERVER \
- -DDEFAULT_MYSQL_HOME='"$(MYSQLBASEdir)"' \
- -DMYSQL_DATADIR='"$(MYSQLDATAdir)"' \
- -DSHAREDIR='"$(MYSQLSHAREdir)"' \
- -DPLUGINDIR='"$(pkgplugindir)"' \
- -DHAVE_EVENT_SCHEDULER \
- @DEFS@
-
-BUILT_MAINT_SRC = sql_yacc.cc sql_yacc.h
-BUILT_SOURCES = $(BUILT_MAINT_SRC) lex_hash.h link_sources
-EXTRA_DIST = udf_example.c udf_example.def $(BUILT_MAINT_SRC) \
- nt_servc.cc nt_servc.h \
- message.mc message.h message.rc MSG00001.bin \
- CMakeLists.txt opt_range_mrr.cc
-
-CLEANFILES = lex_hash.h sql_yacc.output link_sources
-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
- rm -f pack.c
- @LN_CP_F@ $(top_srcdir)/sql-common/pack.c pack.c
- rm -f client.c
- @LN_CP_F@ $(top_srcdir)/sql-common/client.c client.c
- rm -f client_plugin.c
- @LN_CP_F@ $(top_srcdir)/sql-common/client_plugin.c client_plugin.c
- rm -f my_time.c
- @LN_CP_F@ $(top_srcdir)/sql-common/my_time.c my_time.c
- rm -f my_user.c
- @LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c
- echo timestamp > link_sources
-
-# This generates lex_hash.h
-# NOTE Built sources should depend on their sources not the tool
-# this avoid the rebuild of the built files in a source dist
-lex_hash.h: gen_lex_hash.cc lex.h
- $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT)
- ./gen_lex_hash$(EXEEXT) > $@-t
- $(MV) $@-t $@
-
-# For testing of udf_example.so
-udf_example_la_SOURCES= udf_example.c
-udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
-
-# We might have some stuff not built in this build, but that we want to install
-install-exec-hook:
- $(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(pkglibdir)
- test ! -x mysqld-debug$(EXEEXT) || $(INSTALL_PROGRAM) mysqld-debug$(EXEEXT) $(DESTDIR)$(libexecdir)
- test ! -f mysqld-debug.sym.gz || $(INSTALL_DATA) mysqld-debug.sym.gz $(DESTDIR)$(pkglibdir)
- test ! -f mysqld.sym.gz || $(INSTALL_DATA) mysqld.sym.gz $(DESTDIR)$(pkglibdir)
-
-if HAVE_DTRACE_DASH_G
-libndb_la_LIBADD = probes_libndb.o
-libndb_la_DEPENDENCIES = dtrace_files dtrace_providers probes_libndb.o
-mysqld_LDADD += probes_all.o
-mysqld_DEPENDENCIES += dtrace_files dtrace_providers probes_all.o
-CLEANFILES += dtrace_files dtrace_providers probes_all.o
-DTRACEPROVIDER = probes_mysql.d
-CLEANFILES += $(DTRACEPROVIDER)
-
-dtrace_files:
- echo $(DTRACEFILES) > $@
-dtrace_providers: probes_mysql.d
- echo $(DTRACEPROVIDER) > $@
-probes_mysql.d:
- -$(RM) -f probes_mysql.d
- $(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d
-
-DTRACEDIRS = . ../mysys $(patsubst %,$(top_builddir)/storage/%,@mysql_se_dirs@)
-
-probes_all.o: probes_mysql.d $(DTRACEFILES_DEPEND)
- providers=`(for i in $(DTRACEDIRS); do cat $$i/dtrace_providers 2>/dev/null; done) | tr " " "\n" | sort | uniq | sed -e '/^$$/d' -e 's/^/-s /'`; \
- objects=`for i in $(DTRACEDIRS); do f=\`cat $$i/dtrace_files 2>/dev/null\`; for j in $$f; do test -f $$i/$$j && echo "$$i/$$j "; done; done`; \
- $(DTRACE) $(DTRACEFLAGS) -G $$providers $$objects -o $@
-
-# Can't depend directly on .libs/*.o, because there is no generated rule for
-# that in the Makefile; it is a byproduct of *.lo
-probes_libndb.o: probes_mysql.d libndb_la-ha_ndbcluster.lo
- if test -f .libs/libndb_la-ha_ndbcluster.o ; then \
- $(DTRACE) $(DTRACEFLAGS) -G -s probes_mysql.d .libs/libndb_la-ha_ndbcluster.o -o $@; \
- fi; \
- if test -f libndb_la-ha_ndbcluster.o ; then \
- $(DTRACE) $(DTRACEFLAGS) -G -s probes_mysql.d libndb_la-ha_ndbcluster.o -o $@; \
- fi
-
-endif
diff --git a/sql/client_settings.h b/sql/client_settings.h
index 3152bc47845..0a61c12b64a 100644
--- a/sql/client_settings.h
+++ b/sql/client_settings.h
@@ -27,9 +27,6 @@
CLIENT_SECURE_CONNECTION | CLIENT_TRANSACTIONS | \
CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION)
-#define init_sigpipe_variables
-#define set_sigpipe(mysql)
-#define reset_sigpipe(mysql)
#define read_user_name(A) {}
#undef _CUSTOMCONFIG_
diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc
index 74e5b2c70f3..7f69ae54037 100644
--- a/sql/debug_sync.cc
+++ b/sql/debug_sync.cc
@@ -1691,7 +1691,7 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action)
if (action->execute)
{
- const char *old_proc_info;
+ const char *UNINIT_VAR(old_proc_info);
action->execute--;
@@ -1745,11 +1745,20 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action)
We don't use enter_cond()/exit_cond(). They do not save old
mutex and cond. This would prohibit the use of DEBUG_SYNC
between other places of enter_cond() and exit_cond().
+
+ We need to check for existence of thd->mysys_var to also make
+ it possible to use DEBUG_SYNC framework in scheduler when this
+ variable has been set to NULL.
*/
- old_mutex= thd->mysys_var->current_mutex;
- old_cond= thd->mysys_var->current_cond;
- thd->mysys_var->current_mutex= &debug_sync_global.ds_mutex;
- thd->mysys_var->current_cond= &debug_sync_global.ds_cond;
+ if (thd->mysys_var)
+ {
+ old_mutex= thd->mysys_var->current_mutex;
+ old_cond= thd->mysys_var->current_cond;
+ thd->mysys_var->current_mutex= &debug_sync_global.ds_mutex;
+ thd->mysys_var->current_cond= &debug_sync_global.ds_cond;
+ }
+ else
+ old_mutex= NULL;
set_timespec(abstime, action->timeout);
DBUG_EXECUTE("debug_sync_exec", {
@@ -1804,11 +1813,16 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action)
is locked. (See comment in THD::exit_cond().)
*/
mysql_mutex_unlock(&debug_sync_global.ds_mutex);
- mysql_mutex_lock(&thd->mysys_var->mutex);
- thd->mysys_var->current_mutex= old_mutex;
- thd->mysys_var->current_cond= old_cond;
- thd_proc_info(thd, old_proc_info);
- mysql_mutex_unlock(&thd->mysys_var->mutex);
+ if (old_mutex)
+ {
+ mysql_mutex_lock(&thd->mysys_var->mutex);
+ thd->mysys_var->current_mutex= old_mutex;
+ thd->mysys_var->current_cond= old_cond;
+ thd_proc_info(thd, old_proc_info);
+ mysql_mutex_unlock(&thd->mysys_var->mutex);
+ }
+ else
+ thd_proc_info(thd, old_proc_info);
}
else
{
diff --git a/sql/debug_sync.h b/sql/debug_sync.h
index 9ac7da39d4d..ba3739e8ad5 100644
--- a/sql/debug_sync.h
+++ b/sql/debug_sync.h
@@ -39,7 +39,7 @@ class THD;
} while (0)
/* Command line option --debug-sync-timeout. See mysqld.cc. */
-extern uint opt_debug_sync_timeout;
+extern MYSQL_PLUGIN_IMPORT uint opt_debug_sync_timeout;
/* Default WAIT_FOR timeout if command line option is given without argument. */
#define DEBUG_SYNC_DEFAULT_WAIT_TIMEOUT 300
diff --git a/sql/derror.cc b/sql/derror.cc
index db9cd3c0c58..2b4cc13073e 100644
--- a/sql/derror.cc
+++ b/sql/derror.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,8 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -108,7 +107,6 @@ bool read_texts(const char *file_name, const char *language,
char lang_path[FN_REFLEN];
uchar *buff;
uchar head[32],*pos;
- const char *errmsg;
DBUG_ENTER("read_texts");
LINT_INIT(buff);
@@ -185,18 +183,9 @@ Check that the above file is the right version for this program!",
DBUG_RETURN(0);
err:
- switch (funktpos) {
- case 2:
- errmsg= "Not enough memory for messagefile '%s'";
- break;
- case 1:
- errmsg= "Can't read from messagefile '%s'";
- break;
- default:
- errmsg= "Can't find messagefile '%s'";
- break;
- }
- sql_print_error(errmsg, name);
+ sql_print_error((funktpos == 2) ? "Not enough memory for messagefile '%s'" :
+ ((funktpos == 1) ? "Can't read from messagefile '%s'" :
+ "Can't find messagefile '%s'"), name);
if (file != FERR)
(void) mysql_file_close(file, MYF(MY_WME));
DBUG_RETURN(1);
diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc
index 5a1844d730e..6d00d6fd74a 100644
--- a/sql/event_data_objects.cc
+++ b/sql/event_data_objects.cc
@@ -290,7 +290,6 @@ Event_basic::load_time_zone(THD *thd, const LEX_STRING tz_name)
*/
Event_queue_element::Event_queue_element():
- status_changed(FALSE), last_executed_changed(FALSE),
on_completion(Event_parse_data::ON_COMPLETION_DROP),
status(Event_parse_data::ENABLED), expression(0), dropped(FALSE),
execution_count(0)
@@ -539,7 +538,6 @@ Event_queue_element::load_from_row(THD *thd, TABLE *table)
TIME_NO_ZERO_DATE);
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)
DBUG_RETURN(TRUE);
@@ -934,7 +932,6 @@ Event_queue_element::compute_next_execution_time()
DBUG_PRINT("info",("One-time event will be dropped: %d.", dropped));
status= Event_parse_data::DISABLED;
- status_changed= TRUE;
}
goto ret;
}
@@ -954,7 +951,6 @@ Event_queue_element::compute_next_execution_time()
dropped= TRUE;
DBUG_PRINT("info", ("Dropped: %d", dropped));
status= Event_parse_data::DISABLED;
- status_changed= TRUE;
goto ret;
}
@@ -1017,7 +1013,6 @@ Event_queue_element::compute_next_execution_time()
if (on_completion == Event_parse_data::ON_COMPLETION_DROP)
dropped= TRUE;
status= Event_parse_data::DISABLED;
- status_changed= TRUE;
}
else
{
@@ -1107,7 +1102,6 @@ Event_queue_element::compute_next_execution_time()
execute_at= 0;
execute_at_null= TRUE;
status= Event_parse_data::DISABLED;
- status_changed= TRUE;
if (on_completion == Event_parse_data::ON_COMPLETION_DROP)
dropped= TRUE;
}
@@ -1143,50 +1137,11 @@ void
Event_queue_element::mark_last_executed(THD *thd)
{
last_executed= (my_time_t) thd->query_start();
- last_executed_changed= TRUE;
execution_count++;
}
-/*
- Saves status and last_executed_at to the disk if changed.
-
- SYNOPSIS
- Event_queue_element::update_timing_fields()
- thd - thread context
-
- RETURN VALUE
- FALSE OK
- TRUE Error while opening mysql.event for writing or during
- write on disk
-*/
-
-bool
-Event_queue_element::update_timing_fields(THD *thd)
-{
- Event_db_repository *db_repository= Events::get_db_repository();
- int ret;
-
- DBUG_ENTER("Event_queue_element::update_timing_fields");
-
- DBUG_PRINT("enter", ("name: %*s", (int) name.length, name.str));
-
- /* No need to update if nothing has changed */
- if (!(status_changed || last_executed_changed))
- DBUG_RETURN(0);
-
- ret= db_repository->update_timing_fields_for_event(thd,
- dbname, name,
- last_executed_changed,
- last_executed,
- status_changed,
- (ulonglong) status);
- last_executed_changed= status_changed= FALSE;
- DBUG_RETURN(ret);
-}
-
-
static
void
append_datetime(String *buf, Time_zone *time_zone, my_time_t secs,
@@ -1524,7 +1479,7 @@ end:
thd->end_statement();
thd->cleanup_after_query();
/* Avoid races with SHOW PROCESSLIST */
- thd->set_query(NULL, 0);
+ thd->reset_query();
DBUG_PRINT("info", ("EXECUTED %s.%s ret: %d", dbname.str, name.str, ret));
diff --git a/sql/event_data_objects.h b/sql/event_data_objects.h
index a70d38f2a9d..2c693e5ec43 100644
--- a/sql/event_data_objects.h
+++ b/sql/event_data_objects.h
@@ -82,10 +82,6 @@ protected:
class Event_queue_element : public Event_basic
{
-protected:
- bool status_changed;
- bool last_executed_changed;
-
public:
int on_completion;
int status;
@@ -117,9 +113,6 @@ public:
void
mark_last_executed(THD *thd);
-
- bool
- update_timing_fields(THD *thd);
};
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index 961f7966a12..83a9fdd083d 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -236,9 +236,16 @@ mysql_event_fill_row(THD *thd,
if (fields[f_num= ET_FIELD_NAME]->store(et->name.str, et->name.length, scs))
goto err_truncate;
- /* both ON_COMPLETION and STATUS are NOT NULL thus not calling set_notnull()*/
+ /* ON_COMPLETION field is NOT NULL thus not calling set_notnull()*/
rs|= fields[ET_FIELD_ON_COMPLETION]->store((longlong)et->on_completion, TRUE);
- rs|= fields[ET_FIELD_STATUS]->store((longlong)et->status, TRUE);
+
+ /*
+ Set STATUS value unconditionally in case of CREATE EVENT.
+ For ALTER EVENT set it only if value of this field was changed.
+ Since STATUS field is NOT NULL call to set_notnull() is not needed.
+ */
+ if (!is_update || et->status_changed)
+ rs|= fields[ET_FIELD_STATUS]->store((longlong)et->status, TRUE);
rs|= fields[ET_FIELD_ORIGINATOR]->store((longlong)et->originator, TRUE);
/*
@@ -435,7 +442,7 @@ Event_db_repository::index_read_for_db_for_i_s(THD *thd, TABLE *schema_table,
if (!(ret= event_table->file->ha_index_read_map(event_table->record[0],
key_buf,
(key_part_map)1,
- HA_READ_PREFIX)))
+ HA_READ_KEY_EXACT)))
{
DBUG_PRINT("info",("Found rows. Let's retrieve them. ret=%d", ret));
do
@@ -537,6 +544,13 @@ Event_db_repository::fill_schema_events(THD *thd, TABLE_LIST *i_s_table,
if (open_system_tables_for_read(thd, &event_table, &open_tables_backup))
DBUG_RETURN(TRUE);
+ if (table_intact.check(event_table.table, &event_table_def))
+ {
+ close_system_tables(thd, &open_tables_backup);
+ my_error(ER_EVENT_OPEN_TABLE_FAILED, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+
/*
1. SELECT I_S => use table scan. I_S.EVENTS does not guarantee order
thus we won't order it. OTOH, SHOW EVENTS will be
@@ -594,6 +608,14 @@ Event_db_repository::open_event_table(THD *thd, enum thr_lock_type lock_type,
*table= tables.table;
tables.table->use_all_columns();
+
+ if (table_intact.check(*table, &event_table_def))
+ {
+ close_thread_tables(thd);
+ my_error(ER_EVENT_OPEN_TABLE_FAILED, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+
DBUG_RETURN(FALSE);
}
@@ -608,23 +630,32 @@ 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 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
-
+ @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
+ @param[out] event_already_exists When method is completed successfully
+ set to true if event already exists else
+ set to false
@retval FALSE success
@retval TRUE error
*/
bool
Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
- bool create_if_not)
+ bool create_if_not,
+ bool *event_already_exists)
{
int ret= 1;
TABLE *table= NULL;
sp_head *sp= thd->lex->sphead;
ulong saved_mode= thd->variables.sql_mode;
+ /*
+ Take a savepoint to release only the lock on mysql.event
+ table at the end but keep the global read lock and
+ possible other locks taken by the caller.
+ */
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
DBUG_ENTER("Event_db_repository::create_event");
@@ -645,6 +676,7 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
{
if (create_if_not)
{
+ *event_already_exists= true;
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_EVENT_ALREADY_EXISTS, ER(ER_EVENT_ALREADY_EXISTS),
parse_data->name.str);
@@ -652,8 +684,10 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
}
else
my_error(ER_EVENT_ALREADY_EXISTS, MYF(0), parse_data->name.str);
+
goto end;
- }
+ } else
+ *event_already_exists= false;
DBUG_PRINT("info", ("non-existent, go forward"));
@@ -692,8 +726,6 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
if (mysql_event_fill_row(thd, table, parse_data, sp, saved_mode, FALSE))
goto end;
- table->field[ET_FIELD_STATUS]->store((longlong)parse_data->status, TRUE);
-
if ((ret= table->file->ha_write_row(table->record[0])))
{
table->file->print_error(ret, MYF(0));
@@ -702,8 +734,8 @@ Event_db_repository::create_event(THD *thd, Event_parse_data *parse_data,
ret= 0;
end:
- if (table)
- close_mysql_tables(thd);
+ close_thread_tables(thd);
+ thd->mdl_context.rollback_to_savepoint(mdl_savepoint);
thd->variables.sql_mode= saved_mode;
DBUG_RETURN(test(ret));
@@ -737,6 +769,12 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data,
TABLE *table= NULL;
sp_head *sp= thd->lex->sphead;
ulong saved_mode= thd->variables.sql_mode;
+ /*
+ Take a savepoint to release only the lock on mysql.event
+ table at the end but keep the global read lock and
+ possible other locks taken by the caller.
+ */
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
int ret= 1;
DBUG_ENTER("Event_db_repository::update_event");
@@ -814,8 +852,8 @@ Event_db_repository::update_event(THD *thd, Event_parse_data *parse_data,
ret= 0;
end:
- if (table)
- close_mysql_tables(thd);
+ close_thread_tables(thd);
+ thd->mdl_context.rollback_to_savepoint(mdl_savepoint);
thd->variables.sql_mode= saved_mode;
DBUG_RETURN(test(ret));
@@ -841,6 +879,12 @@ Event_db_repository::drop_event(THD *thd, LEX_STRING db, LEX_STRING name,
bool drop_if_exists)
{
TABLE *table= NULL;
+ /*
+ Take a savepoint to release only the lock on mysql.event
+ table at the end but keep the global read lock and
+ possible other locks taken by the caller.
+ */
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
int ret= 1;
DBUG_ENTER("Event_db_repository::drop_event");
@@ -869,8 +913,8 @@ Event_db_repository::drop_event(THD *thd, LEX_STRING db, LEX_STRING name,
ret= 0;
end:
- if (table)
- close_mysql_tables(thd);
+ close_thread_tables(thd);
+ thd->mdl_context.rollback_to_savepoint(mdl_savepoint);
DBUG_RETURN(test(ret));
}
@@ -944,7 +988,7 @@ Event_db_repository::drop_schema_events(THD *thd, LEX_STRING schema)
TABLE *table= NULL;
READ_RECORD read_record_info;
enum enum_events_table_field field= ET_FIELD_DB;
- MDL_ticket *mdl_savepoint= thd->mdl_context.mdl_savepoint();
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
DBUG_ENTER("Event_db_repository::drop_schema_events");
DBUG_PRINT("enter", ("field=%d schema=%s", field, schema.str));
@@ -1025,6 +1069,13 @@ Event_db_repository::load_named_event(THD *thd, LEX_STRING dbname,
*/
if (!(ret= open_system_tables_for_read(thd, &event_table, &open_tables_backup)))
{
+ if (table_intact.check(event_table.table, &event_table_def))
+ {
+ close_system_tables(thd, &open_tables_backup);
+ my_error(ER_EVENT_OPEN_TABLE_FAILED, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+
if ((ret= find_named_event(dbname, name, event_table.table)))
my_error(ER_EVENT_DOES_NOT_EXIST, MYF(0), name.str);
else if ((ret= etn->load_from_row(thd, event_table.table)))
@@ -1050,15 +1101,14 @@ Event_db_repository::
update_timing_fields_for_event(THD *thd,
LEX_STRING event_db_name,
LEX_STRING event_name,
- bool update_last_executed,
my_time_t last_executed,
- bool update_status,
ulonglong status)
{
TABLE *table= NULL;
Field **fields;
int ret= 1;
bool save_binlog_row_based;
+ MYSQL_TIME time;
DBUG_ENTER("Event_db_repository::update_timing_fields_for_event");
@@ -1083,20 +1133,12 @@ update_timing_fields_for_event(THD *thd,
/* Don't update create on row update. */
table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
- if (update_last_executed)
- {
- MYSQL_TIME time;
- my_tz_OFFSET0->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, MYSQL_TIMESTAMP_DATETIME);
- fields[ET_FIELD_LAST_EXECUTED]->set_notnull();
- fields[ET_FIELD_LAST_EXECUTED]->store_time(&time,
- MYSQL_TIMESTAMP_DATETIME);
- }
- if (update_status)
- {
- fields[ET_FIELD_STATUS]->set_notnull();
- fields[ET_FIELD_STATUS]->store(status, TRUE);
- }
+ fields[ET_FIELD_STATUS]->set_notnull();
+ fields[ET_FIELD_STATUS]->store(status, TRUE);
if ((ret= table->file->ha_update_row(table->record[1], table->record[0])))
{
diff --git a/sql/event_db_repository.h b/sql/event_db_repository.h
index 4f1a6a28e4a..162ec5d1243 100644
--- a/sql/event_db_repository.h
+++ b/sql/event_db_repository.h
@@ -73,7 +73,8 @@ public:
Event_db_repository(){}
bool
- create_event(THD *thd, Event_parse_data *parse_data, bool create_if_not);
+ create_event(THD *thd, Event_parse_data *parse_data, bool create_if_not,
+ bool *event_already_exists);
bool
update_event(THD *thd, Event_parse_data *parse_data, LEX_STRING *new_dbname,
@@ -101,9 +102,7 @@ public:
update_timing_fields_for_event(THD *thd,
LEX_STRING event_db_name,
LEX_STRING event_name,
- bool update_last_executed,
my_time_t last_executed,
- bool update_status,
ulonglong status);
public:
static bool
diff --git a/sql/event_parse_data.cc b/sql/event_parse_data.cc
index c36567fc8e1..d8c9847d0a0 100644
--- a/sql/event_parse_data.cc
+++ b/sql/event_parse_data.cc
@@ -48,9 +48,8 @@ Event_parse_data::new_instance(THD *thd)
Event_parse_data::Event_parse_data()
:on_completion(Event_parse_data::ON_COMPLETION_DEFAULT),
- status(Event_parse_data::ENABLED),
- do_not_create(FALSE),
- body_changed(FALSE),
+ status(Event_parse_data::ENABLED), status_changed(false),
+ do_not_create(FALSE), 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)
@@ -142,6 +141,7 @@ Event_parse_data::check_if_in_the_past(THD *thd, my_time_t ltime_utc)
else if (status == Event_parse_data::ENABLED)
{
status= Event_parse_data::DISABLED;
+ status_changed= true;
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_EVENT_EXEC_TIME_IN_THE_PAST,
ER(ER_EVENT_EXEC_TIME_IN_THE_PAST));
@@ -571,7 +571,10 @@ void Event_parse_data::check_originator_id(THD *thd)
DBUG_PRINT("info", ("Invoked object status set to SLAVESIDE_DISABLED."));
if ((status == Event_parse_data::ENABLED) ||
(status == Event_parse_data::DISABLED))
- status = Event_parse_data::SLAVESIDE_DISABLED;
+ {
+ status= Event_parse_data::SLAVESIDE_DISABLED;
+ status_changed= true;
+ }
originator = thd->server_id;
}
else
diff --git a/sql/event_parse_data.h b/sql/event_parse_data.h
index b8cf4954195..85c620760cb 100644
--- a/sql/event_parse_data.h
+++ b/sql/event_parse_data.h
@@ -55,6 +55,7 @@ public:
int on_completion;
int status;
+ bool status_changed;
longlong originator;
/*
do_not_create will be set if STARTS time is in the past and
diff --git a/sql/event_queue.cc b/sql/event_queue.cc
index 7e49c9888ad..781f7fc4c4a 100644
--- a/sql/event_queue.cc
+++ b/sql/event_queue.cc
@@ -17,6 +17,8 @@
#include "unireg.h"
#include "event_queue.h"
#include "event_data_objects.h"
+#include "event_db_repository.h"
+#include "events.h"
#include "sql_audit.h"
#include "tztime.h" // my_tz_find, my_tz_OFFSET0, struct Time_zone
#include "log.h" // sql_print_error
@@ -451,7 +453,6 @@ Event_queue::recalculate_activation_times(THD *thd)
i++)
{
((Event_queue_element*)queue_element(&queue, i))->compute_next_execution_time();
- ((Event_queue_element*)queue_element(&queue, i))->update_timing_fields(thd);
}
queue_fix(&queue);
/*
@@ -581,6 +582,8 @@ Event_queue::get_top_for_execution_if_time(THD *thd,
{
bool ret= FALSE;
*event_name= NULL;
+ my_time_t UNINIT_VAR(last_executed);
+ int UNINIT_VAR(status);
DBUG_ENTER("Event_queue::get_top_for_execution_if_time");
LOCK_QUEUE_DATA();
@@ -646,8 +649,14 @@ Event_queue::get_top_for_execution_if_time(THD *thd,
top->execution_count++;
(*event_name)->dropped= top->dropped;
+ /*
+ Save new values of last_executed timestamp and event status on stack
+ in order to be able to update event description in system table once
+ QUEUE_DATA lock is released.
+ */
+ last_executed= top->last_executed;
+ status= top->status;
- top->update_timing_fields(thd);
if (top->status == Event_parse_data::DISABLED)
{
DBUG_PRINT("info", ("removing from the queue"));
@@ -670,9 +679,16 @@ end:
ret, (long) *event_name));
if (*event_name)
+ {
DBUG_PRINT("info", ("db: %s name: %s",
(*event_name)->dbname.str, (*event_name)->name.str));
+ Event_db_repository *db_repository= Events::get_db_repository();
+ (void) db_repository->update_timing_fields_for_event(thd,
+ (*event_name)->dbname, (*event_name)->name,
+ last_executed, (ulonglong) status);
+ }
+
DBUG_RETURN(ret);
}
@@ -755,11 +771,13 @@ Event_queue::cond_wait(THD *thd, struct timespec *abstime, const char* msg,
thd->enter_cond(&COND_queue_state, &LOCK_event_queue, msg);
- DBUG_PRINT("info", ("mysql_cond_%swait", abstime? "timed":""));
- if (!abstime)
- mysql_cond_wait(&COND_queue_state, &LOCK_event_queue);
- else
- mysql_cond_timedwait(&COND_queue_state, &LOCK_event_queue, abstime);
+ if (!thd->killed)
+ {
+ if (!abstime)
+ mysql_cond_wait(&COND_queue_state, &LOCK_event_queue);
+ else
+ mysql_cond_timedwait(&COND_queue_state, &LOCK_event_queue, abstime);
+ }
mutex_last_locked_in_func= func;
mutex_last_locked_at_line= line;
diff --git a/sql/events.cc b/sql/events.cc
index 9361242c570..789d4414e75 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -30,6 +30,7 @@
#include "event_scheduler.h"
#include "sp_head.h" // for Stored_program_creation_ctx
#include "set_var.h"
+#include "lock.h" // lock_object_name
/**
@addtogroup Event_Scheduler
@@ -77,7 +78,6 @@ Event_queue *Events::event_queue;
Event_scheduler *Events::scheduler;
Event_db_repository *Events::db_repository;
ulong Events::opt_event_scheduler= Events::EVENTS_OFF;
-mysql_mutex_t Events::LOCK_event_metadata;
bool Events::check_system_tables_error= FALSE;
@@ -283,6 +283,7 @@ create_query_string(THD *thd, String *buf)
return 0;
}
+
/**
Create a new event.
@@ -303,8 +304,8 @@ bool
Events::create_event(THD *thd, Event_parse_data *parse_data,
bool if_not_exists)
{
- int ret;
- bool save_binlog_row_based;
+ bool ret;
+ bool save_binlog_row_based, event_already_exists;
DBUG_ENTER("Events::create_event");
if (check_if_system_tables_error())
@@ -339,31 +340,37 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
thd->clear_current_stmt_binlog_format_row();
- mysql_mutex_lock(&LOCK_event_metadata);
+ if (lock_object_name(thd, MDL_key::EVENT,
+ parse_data->dbname.str, parse_data->name.str))
+ DBUG_RETURN(TRUE);
/* On error conditions my_error() is called so no need to handle here */
- if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists)))
+ if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists,
+ &event_already_exists)))
{
Event_queue_element *new_element;
bool dropped= 0;
- if (!(new_element= new Event_queue_element()))
- ret= TRUE; // OOM
- else if ((ret= db_repository->load_named_event(thd, parse_data->dbname,
- parse_data->name,
- new_element)))
- {
- if (!db_repository->drop_event(thd, parse_data->dbname, parse_data->name,
- TRUE))
- dropped= 1;
- delete new_element;
- }
- else
+ if (!event_already_exists)
{
- /* TODO: do not ignore the out parameter and a possible OOM error! */
- bool created;
- if (event_queue)
- event_queue->create_event(thd, new_element, &created);
+ if (!(new_element= new Event_queue_element()))
+ ret= TRUE; // OOM
+ else if ((ret= db_repository->load_named_event(thd, parse_data->dbname,
+ parse_data->name,
+ new_element)))
+ {
+ if (!db_repository->drop_event(thd, parse_data->dbname, parse_data->name,
+ TRUE))
+ dropped= 1;
+ delete new_element;
+ }
+ else
+ {
+ /* TODO: do not ignore the out parameter and a possible OOM error! */
+ bool created;
+ if (event_queue)
+ event_queue->create_event(thd, new_element, &created);
+ }
}
/*
binlog the create event unless it's been successfully dropped
@@ -377,17 +384,16 @@ Events::create_event(THD *thd, Event_parse_data *parse_data,
{
sql_print_error("Event Error: An error occurred while creating query string, "
"before writing it into binary log.");
- ret= TRUE;
+ ret= true;
}
else
- {
- /* If the definer is not set or set to CURRENT_USER, the value of CURRENT_USER
- will be written into the binary log as the definer for the SQL thread. */
+ /*
+ If the definer is not set or set to CURRENT_USER, the value of CURRENT_USER
+ will be written into the binary log as the definer for the SQL thread.
+ */
ret= write_bin_log(thd, TRUE, log_query.c_ptr(), log_query.length());
- }
}
}
- mysql_mutex_unlock(&LOCK_event_metadata);
/* Restore the state of binlog format */
DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row());
if (save_binlog_row_based)
@@ -443,7 +449,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
!sortcmp_lex_string(parse_data->name, *new_name,
system_charset_info))
{
- my_error(ER_EVENT_SAME_NAME, MYF(0), parse_data->name.str);
+ my_error(ER_EVENT_SAME_NAME, MYF(0));
DBUG_RETURN(TRUE);
}
@@ -471,7 +477,9 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
thd->clear_current_stmt_binlog_format_row();
- mysql_mutex_lock(&LOCK_event_metadata);
+ if (lock_object_name(thd, MDL_key::EVENT,
+ parse_data->dbname.str, parse_data->name.str))
+ DBUG_RETURN(TRUE);
/* On error conditions my_error() is called so no need to handle here */
if (!(ret= db_repository->update_event(thd, parse_data,
@@ -484,10 +492,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
ret= TRUE; // OOM
else if ((ret= db_repository->load_named_event(thd, dbname, name,
new_element)))
- {
- DBUG_ASSERT(ret == OP_LOAD_ERROR);
delete new_element;
- }
else
{
/*
@@ -504,7 +509,6 @@ Events::update_event(THD *thd, Event_parse_data *parse_data,
ret= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
}
}
- mysql_mutex_unlock(&LOCK_event_metadata);
/* Restore the state of binlog format */
DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row());
if (save_binlog_row_based)
@@ -558,7 +562,9 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
thd->clear_current_stmt_binlog_format_row();
- mysql_mutex_lock(&LOCK_event_metadata);
+ if (lock_object_name(thd, MDL_key::EVENT,
+ dbname.str, name.str))
+ DBUG_RETURN(TRUE);
/* On error conditions my_error() is called so no need to handle here */
if (!(ret= db_repository->drop_event(thd, dbname, name, if_exists)))
{
@@ -568,7 +574,6 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists)
DBUG_ASSERT(thd->query() && thd->query_length());
ret= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
}
- mysql_mutex_unlock(&LOCK_event_metadata);
/* Restore the state of binlog format */
DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row());
if (save_binlog_row_based)
@@ -597,15 +602,12 @@ Events::drop_schema_events(THD *thd, char *db)
DBUG_PRINT("enter", ("dropping events from %s", db));
/*
- sic: no check if the scheduler is disabled or system tables
+ Sic: no check if the scheduler is disabled or system tables
are damaged, as intended.
*/
-
- mysql_mutex_lock(&LOCK_event_metadata);
if (event_queue)
event_queue->drop_schema_events(thd, db_lex);
db_repository->drop_schema_events(thd, db_lex);
- mysql_mutex_unlock(&LOCK_event_metadata);
DBUG_VOID_RETURN;
}
@@ -917,12 +919,11 @@ Events::deinit()
}
#ifdef HAVE_PSI_INTERFACE
-PSI_mutex_key key_LOCK_event_metadata, key_LOCK_event_queue,
+PSI_mutex_key key_LOCK_event_queue,
key_event_scheduler_LOCK_scheduler_state;
static PSI_mutex_info all_events_mutexes[]=
{
- { &key_LOCK_event_metadata, "LOCK_event_metadata", PSI_FLAG_GLOBAL},
{ &key_LOCK_event_queue, "LOCK_event_queue", PSI_FLAG_GLOBAL},
{ &key_event_scheduler_LOCK_scheduler_state, "Event_scheduler::LOCK_scheduler_state", PSI_FLAG_GLOBAL}
};
@@ -976,23 +977,6 @@ Events::init_mutexes()
#ifdef HAVE_PSI_INTERFACE
init_events_psi_keys();
#endif
-
- mysql_mutex_init(key_LOCK_event_metadata,
- &LOCK_event_metadata, MY_MUTEX_INIT_FAST);
-}
-
-
-/*
- Destroys Events mutexes
-
- SYNOPSIS
- Events::destroy_mutexes()
-*/
-
-void
-Events::destroy_mutexes()
-{
- mysql_mutex_destroy(&LOCK_event_metadata);
}
diff --git a/sql/events.h b/sql/events.h
index 4cb93ce8415..a94fbc17135 100644
--- a/sql/events.h
+++ b/sql/events.h
@@ -26,8 +26,7 @@
*/
#ifdef HAVE_PSI_INTERFACE
-extern PSI_mutex_key key_LOCK_event_metadata,
- key_event_scheduler_LOCK_scheduler_state;
+extern PSI_mutex_key key_event_scheduler_LOCK_scheduler_state;
extern PSI_cond_key key_event_scheduler_COND_state;
extern PSI_thread_key key_thread_event_scheduler, key_thread_event_worker;
#endif /* HAVE_PSI_INTERFACE */
@@ -43,19 +42,6 @@ struct TABLE_LIST;
class THD;
typedef class Item COND;
-/* Return codes */
-enum enum_events_error_code
-{
- OP_OK= 0,
- OP_NOT_RUNNING,
- OP_CANT_KILL,
- OP_CANT_INIT,
- OP_DISABLED_EVENT,
- OP_LOAD_ERROR,
- OP_ALREADY_EXISTS
-};
-
-
int
sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs);
@@ -91,7 +77,6 @@ public:
enum enum_opt_event_scheduler { EVENTS_OFF, EVENTS_ON, EVENTS_DISABLED };
/* Protected using LOCK_global_system_variables only. */
static ulong opt_event_scheduler;
- static mysql_mutex_t LOCK_event_metadata;
static bool check_if_system_tables_error();
static bool start();
static bool stop();
diff --git a/sql/field.cc b/sql/field.cc
index 26f3e0452c8..e6caaf947b1 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,8 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -2615,7 +2614,7 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value)
DBUG_ENTER("Field_new_decimal::store_value");
#ifndef DBUG_OFF
{
- char dbug_buff[DECIMAL_MAX_STR_LENGTH+1];
+ char dbug_buff[DECIMAL_MAX_STR_LENGTH+2];
DBUG_PRINT("enter", ("value: %s", dbug_decimal_as_string(dbug_buff, decimal_value)));
}
#endif
@@ -2630,7 +2629,7 @@ bool Field_new_decimal::store_value(const my_decimal *decimal_value)
}
#ifndef DBUG_OFF
{
- char dbug_buff[DECIMAL_MAX_STR_LENGTH+1];
+ char dbug_buff[DECIMAL_MAX_STR_LENGTH+2];
DBUG_PRINT("info", ("saving with precision %d scale: %d value %s",
(int)precision, (int)dec,
dbug_decimal_as_string(dbug_buff, decimal_value)));
@@ -2699,7 +2698,7 @@ int Field_new_decimal::store(const char *from, uint length,
}
#ifndef DBUG_OFF
- char dbug_buff[DECIMAL_MAX_STR_LENGTH+1];
+ char dbug_buff[DECIMAL_MAX_STR_LENGTH+2];
DBUG_PRINT("enter", ("value: %s",
dbug_decimal_as_string(dbug_buff, &decimal_value)));
#endif
@@ -4196,7 +4195,7 @@ String *Field_float::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
- DBUG_ASSERT(field_length <= MAX_FIELD_CHARLENGTH);
+ DBUG_ASSERT(!zerofill || field_length <= MAX_FIELD_CHARLENGTH);
float nr;
#ifdef WORDS_BIGENDIAN
if (table->s->db_low_byte_first)
@@ -4519,7 +4518,7 @@ String *Field_double::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
- DBUG_ASSERT(field_length <= MAX_FIELD_CHARLENGTH);
+ DBUG_ASSERT(!zerofill || field_length <= MAX_FIELD_CHARLENGTH);
double nr;
#ifdef WORDS_BIGENDIAN
if (table->s->db_low_byte_first)
@@ -5389,6 +5388,7 @@ double Field_year::val_real(void)
longlong Field_year::val_int(void)
{
ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(field_length == 2 || field_length == 4);
int tmp= (int) ptr[0];
if (field_length != 4)
tmp%=100; // Return last 2 char
@@ -5401,6 +5401,7 @@ longlong Field_year::val_int(void)
String *Field_year::val_str(String *val_buffer,
String *val_ptr __attribute__((unused)))
{
+ DBUG_ASSERT(field_length < 5);
val_buffer->alloc(5);
val_buffer->length(field_length);
char *to=(char*) val_buffer->ptr();
@@ -6334,10 +6335,13 @@ int Field_str::store(double nr)
ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED;
char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
uint local_char_length= field_length / charset()->mbmaxlen;
- size_t length;
- my_bool error;
+ size_t length= 0;
+ my_bool error= (local_char_length == 0);
+
+ // my_gcvt() requires width > 0, and we may have a CHAR(0) column.
+ if (!error)
+ length= my_gcvt(nr, MY_GCVT_ARG_DOUBLE, local_char_length, buff, &error);
- length= my_gcvt(nr, MY_GCVT_ARG_DOUBLE, local_char_length, buff, &error);
if (error)
{
if (table->in_use->abort_on_warning)
@@ -7731,12 +7735,6 @@ void Field_blob::sql_type(String &res) const
uchar *Field_blob::pack(uchar *to, const uchar *from,
uint max_length, bool low_byte_first)
{
- DBUG_ENTER("Field_blob::pack");
- DBUG_PRINT("enter", ("to: 0x%lx; from: 0x%lx;"
- " max_length: %u; low_byte_first: %d",
- (ulong) to, (ulong) from,
- max_length, low_byte_first));
- DBUG_DUMP("record", from, table->s->reclength);
uchar *save= ptr;
ptr= (uchar*) from;
uint32 length=get_length(); // Length of from string
@@ -7757,8 +7755,7 @@ uchar *Field_blob::pack(uchar *to, const uchar *from,
memcpy(to+packlength, from,length);
}
ptr=save; // Restore org row pointer
- DBUG_DUMP("packed", to, packlength + length);
- DBUG_RETURN(to+packlength+length);
+ return to+packlength+length;
}
@@ -8402,6 +8399,54 @@ uint Field_enum::is_equal(Create_field *new_field)
}
+uchar *Field_enum::pack(uchar *to, const uchar *from,
+ uint max_length, bool low_byte_first)
+{
+ DBUG_ENTER("Field_enum::pack");
+ DBUG_PRINT("debug", ("packlength: %d", packlength));
+ DBUG_DUMP("from", from, packlength);
+
+ switch (packlength)
+ {
+ case 1:
+ *to = *from;
+ DBUG_RETURN(to + 1);
+ case 2: DBUG_RETURN(pack_int16(to, from, low_byte_first));
+ case 3: DBUG_RETURN(pack_int24(to, from, low_byte_first));
+ case 4: DBUG_RETURN(pack_int32(to, from, low_byte_first));
+ case 8: DBUG_RETURN(pack_int64(to, from, low_byte_first));
+ default:
+ DBUG_ASSERT(0);
+ }
+ MY_ASSERT_UNREACHABLE();
+ DBUG_RETURN(NULL);
+}
+
+const uchar *Field_enum::unpack(uchar *to, const uchar *from,
+ uint param_data, bool low_byte_first)
+{
+ DBUG_ENTER("Field_enum::unpack");
+ DBUG_PRINT("debug", ("packlength: %d", packlength));
+ DBUG_DUMP("from", from, packlength);
+
+ switch (packlength)
+ {
+ case 1:
+ *to = *from;
+ DBUG_RETURN(from + 1);
+
+ case 2: DBUG_RETURN(unpack_int16(to, from, low_byte_first));
+ case 3: DBUG_RETURN(unpack_int24(to, from, low_byte_first));
+ case 4: DBUG_RETURN(unpack_int32(to, from, low_byte_first));
+ case 8: DBUG_RETURN(unpack_int64(to, from, low_byte_first));
+ default:
+ DBUG_ASSERT(0);
+ }
+ MY_ASSERT_UNREACHABLE();
+ DBUG_RETURN(NULL);
+}
+
+
/**
@return
returns 1 if the fields are equally defined
@@ -9037,6 +9082,7 @@ void Create_field::create_length_to_internal_length(void)
case MYSQL_TYPE_MEDIUM_BLOB:
case MYSQL_TYPE_LONG_BLOB:
case MYSQL_TYPE_BLOB:
+ case MYSQL_TYPE_GEOMETRY:
case MYSQL_TYPE_VAR_STRING:
case MYSQL_TYPE_STRING:
case MYSQL_TYPE_VARCHAR:
@@ -9236,7 +9282,7 @@ bool Create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
if (decimals >= NOT_FIXED_DEC)
{
my_error(ER_TOO_BIG_SCALE, MYF(0), decimals, fld_name,
- NOT_FIXED_DEC-1);
+ static_cast<ulong>(NOT_FIXED_DEC - 1));
DBUG_RETURN(TRUE);
}
@@ -9333,8 +9379,8 @@ bool Create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
my_decimal_trim(&length, &decimals);
if (length > DECIMAL_MAX_PRECISION)
{
- my_error(ER_TOO_BIG_PRECISION, MYF(0), length, fld_name,
- DECIMAL_MAX_PRECISION);
+ my_error(ER_TOO_BIG_PRECISION, MYF(0), static_cast<int>(length),
+ fld_name, static_cast<ulong>(DECIMAL_MAX_PRECISION));
DBUG_RETURN(TRUE);
}
if (length < decimals)
@@ -9558,7 +9604,7 @@ bool Create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
if (length > MAX_BIT_FIELD_LENGTH)
{
my_error(ER_TOO_BIG_DISPLAYWIDTH, MYF(0), fld_name,
- MAX_BIT_FIELD_LENGTH);
+ static_cast<ulong>(MAX_BIT_FIELD_LENGTH));
DBUG_RETURN(TRUE);
}
pack_length= (length + 7) / 8;
diff --git a/sql/field.h b/sql/field.h
index a7718df604a..0282deb9a3d 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -635,6 +635,48 @@ private:
{ return 0; }
protected:
+ static void handle_int16(uchar *to, const uchar *from,
+ bool low_byte_first_from, bool low_byte_first_to)
+ {
+ int16 val;
+#ifdef WORDS_BIGENDIAN
+ if (low_byte_first_from)
+ val = sint2korr(from);
+ else
+#endif
+ shortget(val, from);
+
+#ifdef WORDS_BIGENDIAN
+ if (low_byte_first_to)
+ int2store(to, val);
+ else
+#endif
+ shortstore(to, val);
+ }
+
+ static void handle_int24(uchar *to, const uchar *from,
+ bool low_byte_first_from, bool low_byte_first_to)
+ {
+ int32 val;
+#ifdef WORDS_BIGENDIAN
+ if (low_byte_first_from)
+ val = sint3korr(from);
+ else
+#endif
+ val= (from[0] << 16) + (from[1] << 8) + from[2];
+
+#ifdef WORDS_BIGENDIAN
+ if (low_byte_first_to)
+ int2store(to, val);
+ else
+#endif
+ {
+ to[0]= 0xFF & (val >> 16);
+ to[1]= 0xFF & (val >> 8);
+ to[2]= 0xFF & val;
+ }
+ }
+
/*
Helper function to pack()/unpack() int32 values
*/
@@ -679,6 +721,32 @@ protected:
longlongstore(to, val);
}
+ uchar *pack_int16(uchar *to, const uchar *from, bool low_byte_first_to)
+ {
+ handle_int16(to, from, table->s->db_low_byte_first, low_byte_first_to);
+ return to + sizeof(int16);
+ }
+
+ const uchar *unpack_int16(uchar* to, const uchar *from,
+ bool low_byte_first_from)
+ {
+ handle_int16(to, from, low_byte_first_from, table->s->db_low_byte_first);
+ return from + sizeof(int16);
+ }
+
+ uchar *pack_int24(uchar *to, const uchar *from, bool low_byte_first_to)
+ {
+ handle_int24(to, from, table->s->db_low_byte_first, low_byte_first_to);
+ return to + 3;
+ }
+
+ const uchar *unpack_int24(uchar* to, const uchar *from,
+ bool low_byte_first_from)
+ {
+ handle_int24(to, from, low_byte_first_from, table->s->db_low_byte_first);
+ return from + 3;
+ }
+
uchar *pack_int32(uchar *to, const uchar *from, bool low_byte_first_to)
{
handle_int32(to, from, table->s->db_low_byte_first, low_byte_first_to);
@@ -759,6 +827,17 @@ public:
uchar null_bit_arg, utype unireg_check_arg,
const char *field_name_arg, CHARSET_INFO *charset);
Item_result result_type () const { return STRING_RESULT; }
+ /*
+ match_collation_to_optimize_range() is to distinguish in
+ range optimizer (see opt_range.cc) between real string types:
+ CHAR, VARCHAR, TEXT
+ and the other string-alike types with result_type() == STRING_RESULT:
+ DATE, TIME, DATETIME, TIMESTAMP
+ We need it to decide whether to test if collation of the operation
+ matches collation of the field (needed only for real string types).
+ QQ: shouldn't DATE/TIME types have their own XXX_RESULT types eventually?
+ */
+ virtual bool match_collation_to_optimize_range() const=0;
uint decimals() const { return NOT_FIXED_DEC; }
int store(double nr);
int store(longlong nr, bool unsigned_val)=0;
@@ -999,41 +1078,13 @@ public:
virtual uchar *pack(uchar* to, const uchar *from,
uint max_length, bool low_byte_first)
{
- int16 val;
-#ifdef WORDS_BIGENDIAN
- if (table->s->db_low_byte_first)
- val = sint2korr(from);
- else
-#endif
- shortget(val, from);
-
-#ifdef WORDS_BIGENDIAN
- if (low_byte_first)
- int2store(to, val);
- else
-#endif
- shortstore(to, val);
- return to + sizeof(val);
+ return pack_int16(to, from, low_byte_first);
}
virtual const uchar *unpack(uchar* to, const uchar *from,
uint param_data, bool low_byte_first)
{
- int16 val;
-#ifdef WORDS_BIGENDIAN
- if (low_byte_first)
- val = sint2korr(from);
- else
-#endif
- shortget(val, from);
-
-#ifdef WORDS_BIGENDIAN
- if (table->s->db_low_byte_first)
- int2store(to, val);
- else
-#endif
- shortstore(to, val);
- return from + sizeof(val);
+ return unpack_int16(to, from, low_byte_first);
}
};
@@ -1268,6 +1319,7 @@ public:
unireg_check_arg, field_name_arg, cs)
{}
enum_field_types type() const { return MYSQL_TYPE_NULL;}
+ bool match_collation_to_optimize_range() const { return FALSE; }
int store(const char *to, uint length, CHARSET_INFO *cs)
{ null[0]=1; return 0; }
int store(double nr) { null[0]=1; return 0; }
@@ -1297,6 +1349,7 @@ public:
Field_timestamp(bool maybe_null_arg, const char *field_name_arg,
CHARSET_INFO *cs);
enum_field_types type() const { return MYSQL_TYPE_TIMESTAMP;}
+ bool match_collation_to_optimize_range() const { return FALSE; }
enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
enum Item_result cmp_type () const { return INT_RESULT; }
enum Derivation derivation(void) const { return DERIVATION_NUMERIC; }
@@ -1401,6 +1454,7 @@ public:
:Field_str((uchar*) 0, MAX_DATE_WIDTH, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg, cs) { flags|= BINARY_FLAG; }
enum_field_types type() const { return MYSQL_TYPE_DATE;}
+ bool match_collation_to_optimize_range() const { return FALSE; }
enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
enum Item_result cmp_type () const { return INT_RESULT; }
enum Derivation derivation(void) const { return DERIVATION_NUMERIC; }
@@ -1450,6 +1504,7 @@ public:
NONE, field_name_arg, cs) { flags|= BINARY_FLAG; }
enum_field_types type() const { return MYSQL_TYPE_DATE;}
enum_field_types real_type() const { return MYSQL_TYPE_NEWDATE; }
+ bool match_collation_to_optimize_range() const { return FALSE; }
enum ha_base_keytype key_type() const { return HA_KEYTYPE_UINT24; }
enum Item_result cmp_type () const { return INT_RESULT; }
enum Derivation derivation(void) const { return DERIVATION_NUMERIC; }
@@ -1489,6 +1544,7 @@ public:
:Field_str((uchar*) 0,8, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg, cs) { flags|= BINARY_FLAG; }
enum_field_types type() const { return MYSQL_TYPE_TIME;}
+ bool match_collation_to_optimize_range() const { return FALSE; }
enum ha_base_keytype key_type() const { return HA_KEYTYPE_INT24; }
enum Item_result cmp_type () const { return INT_RESULT; }
enum Derivation derivation(void) const { return DERIVATION_NUMERIC; }
@@ -1528,6 +1584,7 @@ public:
:Field_str((uchar*) 0, MAX_DATETIME_WIDTH, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg, cs) { flags|= BINARY_FLAG; }
enum_field_types type() const { return MYSQL_TYPE_DATETIME;}
+ bool match_collation_to_optimize_range() const { return FALSE; }
#ifdef HAVE_LONG_LONG
enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; }
#endif
@@ -1596,6 +1653,7 @@ public:
orig_table->s->frm_version < FRM_VER_TRUE_VARCHAR ?
MYSQL_TYPE_VAR_STRING : MYSQL_TYPE_STRING);
}
+ bool match_collation_to_optimize_range() const { return TRUE; }
enum ha_base_keytype key_type() const
{ return binary() ? HA_KEYTYPE_BINARY : HA_KEYTYPE_TEXT; }
bool zero_pack() const { return 0; }
@@ -1676,6 +1734,7 @@ public:
}
enum_field_types type() const { return MYSQL_TYPE_VARCHAR; }
+ bool match_collation_to_optimize_range() const { return TRUE; }
enum ha_base_keytype key_type() const;
uint row_pack_length() { return field_length; }
bool zero_pack() const { return 0; }
@@ -1771,6 +1830,7 @@ public:
:Field_longstr((uchar*) 0, 0, (uchar*) "", 0, NONE, "temp", system_charset_info),
packlength(packlength_arg) {}
enum_field_types type() const { return MYSQL_TYPE_BLOB;}
+ bool match_collation_to_optimize_range() const { return TRUE; }
enum ha_base_keytype key_type() const
{ return binary() ? HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2; }
int store(const char *to,uint length,CHARSET_INFO *charset);
@@ -1920,6 +1980,7 @@ public:
{ geom_type= geom_type_arg; }
enum ha_base_keytype key_type() const { return HA_KEYTYPE_VARBINARY2; }
enum_field_types type() const { return MYSQL_TYPE_GEOMETRY; }
+ bool match_collation_to_optimize_range() const { return FALSE; }
void sql_type(String &str) const;
int store(const char *to, uint length, CHARSET_INFO *charset);
int store(double nr);
@@ -1951,6 +2012,7 @@ public:
}
Field *new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type);
enum_field_types type() const { return MYSQL_TYPE_STRING; }
+ bool match_collation_to_optimize_range() const { return FALSE; }
enum Item_result cmp_type () const { return INT_RESULT; }
enum Item_result cast_to_int_type () const { return INT_RESULT; }
enum ha_base_keytype key_type() const;
@@ -1976,6 +2038,12 @@ public:
bool has_charset(void) const { return TRUE; }
/* enum and set are sorted as integers */
CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; }
+
+ virtual uchar *pack(uchar *to, const uchar *from,
+ uint max_length, bool low_byte_first);
+ virtual const uchar *unpack(uchar *to, const uchar *from,
+ uint param_data, bool low_byte_first);
+
private:
int do_save_field_metadata(uchar *first_byte);
uint is_equal(Create_field *new_field);
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index a27b471442b..2f6d84c999b 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -784,11 +784,8 @@ int field_conv(Field *to,Field *from)
((Field_varstring*)from)->length_bytes ==
((Field_varstring*)to)->length_bytes))
{ // Identical fields
-#ifdef HAVE_valgrind
- /* This may happen if one does 'UPDATE ... SET x=x' */
- if (to->ptr != from->ptr)
-#endif
- memcpy(to->ptr,from->ptr,to->pack_length());
+ // to->ptr==from->ptr may happen if one does 'UPDATE ... SET x=x'
+ memmove(to->ptr, from->ptr, to->pack_length());
return 0;
}
}
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 69df42da95f..a70f6cbd2ed 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -33,11 +33,7 @@
#include "sql_test.h" // TEST_filesort
#include "opt_range.h" // SQL_SELECT
#include "log_slow.h"
-#include "sql_base.h"
-
-#ifndef THREAD
-#define SKIP_DBUG_IN_FILESORT
-#endif
+#include "debug_sync.h"
/// How to write record_ref.
#define WRITE_REF(file,from) \
@@ -129,6 +125,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
Item_subselect *subselect= tab ? tab->containing_subselect() : 0;
MYSQL_FILESORT_START(table->s->db.str, table->s->table_name.str);
+ DEBUG_SYNC(thd, "filesort_start");
/*
Release InnoDB's adaptive hash index latch (if holding) before
@@ -332,8 +329,25 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
}
}
if (error)
- my_message(ER_FILSORT_ABORT, ER(ER_FILSORT_ABORT),
- MYF(ME_ERROR+ME_WAITTANG));
+ {
+ int kill_errno= thd->killed_errno();
+ DBUG_ASSERT(thd->is_error() || kill_errno);
+ my_printf_error(ER_FILSORT_ABORT,
+ "%s: %s",
+ MYF(ME_ERROR + ME_WAITTANG),
+ ER_THD(thd, ER_FILSORT_ABORT),
+ kill_errno ? ER(kill_errno) : thd->stmt_da->message());
+
+ if (global_system_variables.log_warnings > 1)
+ {
+ sql_print_warning("%s, host: %s, user: %s, thread: %lu, query: %-.4096s",
+ ER_THD(thd, ER_FILSORT_ABORT),
+ thd->security_ctx->host_or_ip,
+ &thd->security_ctx->priv_user[0],
+ (ulong) thd->thread_id,
+ thd->query());
+ }
+ }
else
statistic_add(thd->status_var.filesort_rows,
(ulong) records, &LOCK_status);
@@ -377,6 +391,9 @@ static char **make_char_array(char **old_pos, register uint fields,
char *char_pos;
DBUG_ENTER("make_char_array");
+ DBUG_EXECUTE_IF("make_char_array_fail",
+ DBUG_SET("+d,simulate_out_of_memory"););
+
if (old_pos ||
(old_pos= (char**) my_malloc((uint) fields*(length+sizeof(char*)),
my_flag)))
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index a9c03f7e2a7..d442d029ba0 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (C) 2000-2007 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -375,7 +375,7 @@ int main(int argc,char **argv)
printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n");
printf("\
-/* Copyright 2001-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n\
+/* Copyright (C) 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\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\
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index e90c3ac3e6a..773b6155c68 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,8 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -6436,9 +6435,8 @@ void ha_ndbcluster::get_auto_increment(ulonglong offset, ulonglong increment,
{
Ndb_tuple_id_range_guard g(m_share);
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))
+ 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)
@@ -7383,38 +7381,35 @@ int ndbcluster_find_files(handlerton *hton, THD *thd,
}
/*
+ Delete old files.
+
ndbcluster_find_files() may be called from I_S code and ndbcluster_binlog
thread in situations when some tables are already open. This means that
code below will try to obtain exclusive metadata lock on some table
- while holding shared meta-data lock on other tables. This might lead to
- a deadlock, and therefore is disallowed by assertions of the metadata
- locking subsystem. This is violation of metadata
- locking protocol which has to be closed ASAP.
+ while holding shared meta-data lock on other tables. This might lead to a
+ deadlock but such a deadlock should be detected by MDL deadlock detector.
+
XXX: the scenario described above is not covered with any test.
*/
- if (!global_read_lock)
- {
- // Delete old files
- List_iterator_fast<char> it3(delete_list);
- while ((file_name_str= it3++))
- {
- DBUG_PRINT("info", ("Remove table %s/%s", db, file_name_str));
- // Delete the table and all related files
- TABLE_LIST table_list;
- table_list.init_one_table(db, strlen(db), file_name_str,
- strlen(file_name_str), file_name_str,
- TL_WRITE);
- table_list.mdl_request.set_type(MDL_EXCLUSIVE);
- (void)mysql_rm_table_part2(thd, &table_list,
- FALSE, /* if_exists */
- FALSE, /* drop_temporary */
- FALSE, /* drop_view */
- TRUE /* dont_log_query*/);
- trans_commit_implicit(thd); /* Safety, should be unnecessary. */
- thd->mdl_context.release_transactional_locks();
- /* Clear error message that is returned when table is deleted */
- thd->clear_error();
- }
+ List_iterator_fast<char> it3(delete_list);
+ while ((file_name_str= it3++))
+ {
+ DBUG_PRINT("info", ("Remove table %s/%s", db, file_name_str));
+ /* Delete the table and all related files. */
+ TABLE_LIST table_list;
+ table_list.init_one_table(db, strlen(db), file_name_str,
+ strlen(file_name_str), file_name_str,
+ TL_WRITE);
+ table_list.mdl_request.set_type(MDL_EXCLUSIVE);
+ (void)mysql_rm_table_part2(thd, &table_list,
+ FALSE, /* if_exists */
+ FALSE, /* drop_temporary */
+ FALSE, /* drop_view */
+ TRUE /* dont_log_query*/);
+ trans_commit_implicit(thd); /* Safety, should be unnecessary. */
+ thd->mdl_context.release_transactional_locks();
+ /* Clear error message that is returned when table is deleted */
+ thd->clear_error();
}
/* Lock mutex before creating .FRM files. */
@@ -8703,7 +8698,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
DBUG_PRINT("error", ("get_share: failed to alloc share"));
if (!have_lock)
mysql_mutex_unlock(&ndbcluster_mutex);
- my_error(ER_OUTOFMEMORY, MYF(0), sizeof(*share));
+ my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(sizeof(*share)));
DBUG_RETURN(0);
}
}
@@ -10275,10 +10270,8 @@ bool ha_ndbcluster::check_if_incompatible_data(HA_CREATE_INFO *create_info,
{
Field *field= table->field[i];
const NDBCOL *col= tab->getColumn(i);
- if ((col->getStorageType() == NDB_STORAGETYPE_MEMORY &&
- create_info->storage_media != HA_SM_MEMORY) ||
- (col->getStorageType() == NDB_STORAGETYPE_DISK &&
- create_info->storage_media != HA_SM_DISK))
+ if ((col->getStorageType() == NDB_STORAGETYPE_MEMORY && create_info->storage_media != HA_SM_MEMORY) ||
+ (col->getStorageType() == NDB_STORAGETYPE_DISK && create_info->storage_media != HA_SM_DISK))
{
DBUG_PRINT("info", ("Column storage media is changed"));
DBUG_RETURN(COMPATIBLE_DATA_NO);
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index e46b6b25f9c..c4b71bf32cf 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,8 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
@@ -1225,12 +1224,14 @@ ndbcluster_update_slock(THD *thd,
}
if (ndb_error)
+ {
+ char buf[1024];
+ my_snprintf(buf, sizeof(buf), "Could not release lock on '%s.%s'",
+ db, table_name);
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
- ndb_error->code,
- ndb_error->message,
- "Could not release lock on '%s.%s'",
- db, table_name);
+ ndb_error->code, ndb_error->message, buf);
+ }
if (trans)
ndb->closeTransaction(trans);
ndb->setDatabaseName(save_db);
diff --git a/sql/ha_ndbcluster_cond.cc b/sql/ha_ndbcluster_cond.cc
index 8a96ae41453..9ab7fb6208d 100644
--- a/sql/ha_ndbcluster_cond.cc
+++ b/sql/ha_ndbcluster_cond.cc
@@ -1472,4 +1472,4 @@ int ha_ndbcluster_cond::generate_scan_filter_from_key(NdbScanOperation *op,
DBUG_RETURN(0);
}
-#endif /* HAVE_NDBCLUSTER_DB */
+#endif
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index b0f50c0ca58..b35a6cb7bf3 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -1,4 +1,4 @@
-/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
This handler was developed by Mikael Ronstrom for version 5.1 of MySQL.
@@ -163,8 +163,7 @@ const uint ha_partition::NO_CURRENT_PART_ID= 0xFFFFFFFF;
*/
ha_partition::ha_partition(handlerton *hton, TABLE_SHARE *share)
- :handler(hton, share), m_part_info(NULL), m_create_handler(FALSE),
- m_is_sub_partitioned(0)
+ :handler(hton, share)
{
DBUG_ENTER("ha_partition::ha_partition(table)");
init_handler_variables();
@@ -184,15 +183,44 @@ ha_partition::ha_partition(handlerton *hton, TABLE_SHARE *share)
*/
ha_partition::ha_partition(handlerton *hton, partition_info *part_info)
- :handler(hton, NULL), m_part_info(part_info), m_create_handler(TRUE),
- m_is_sub_partitioned(m_part_info->is_sub_partitioned())
+ :handler(hton, NULL)
{
DBUG_ENTER("ha_partition::ha_partition(part_info)");
+ DBUG_ASSERT(part_info);
init_handler_variables();
- DBUG_ASSERT(m_part_info);
+ m_part_info= part_info;
+ m_create_handler= TRUE;
+ m_is_sub_partitioned= m_part_info->is_sub_partitioned();
DBUG_VOID_RETURN;
}
+/**
+ ha_partition constructor method used by ha_partition::clone()
+
+ @param hton Handlerton (partition_hton)
+ @param share Table share object
+ @param part_info_arg partition_info to use
+ @param clone_arg ha_partition to clone
+ @param clme_mem_root_arg MEM_ROOT to use
+
+ @return New partition handler
+*/
+
+ha_partition::ha_partition(handlerton *hton, TABLE_SHARE *share,
+ partition_info *part_info_arg,
+ ha_partition *clone_arg,
+ MEM_ROOT *clone_mem_root_arg)
+ :handler(hton, share)
+{
+ DBUG_ENTER("ha_partition::ha_partition(clone)");
+ init_handler_variables();
+ m_part_info= part_info_arg;
+ m_create_handler= TRUE;
+ m_is_sub_partitioned= m_part_info->is_sub_partitioned();
+ m_is_clone_of= clone_arg;
+ m_clone_mem_root= clone_mem_root_arg;
+ DBUG_VOID_RETURN;
+}
/*
Initialize handler object
@@ -244,7 +272,6 @@ void ha_partition::init_handler_variables()
m_rec0= 0;
m_curr_key_info[0]= NULL;
m_curr_key_info[1]= NULL;
- is_clone= FALSE,
m_part_func_monotonicity_info= NON_MONOTONIC;
auto_increment_lock= FALSE;
auto_increment_safe_stmt_log_lock= FALSE;
@@ -252,6 +279,11 @@ void ha_partition::init_handler_variables()
this allows blackhole to work properly
*/
m_num_locks= 0;
+ m_part_info= NULL;
+ m_create_handler= FALSE;
+ m_is_sub_partitioned= 0;
+ m_is_clone_of= NULL;
+ m_clone_mem_root= NULL;
#ifdef DONT_HAVE_TO_BE_INITALIZED
m_start_key.flag= 0;
@@ -359,7 +391,8 @@ bool ha_partition::initialize_partition(MEM_ROOT *mem_root)
*/
DBUG_RETURN(0);
}
- else if (get_from_handler_file(table_share->normalized_path.str, mem_root))
+ else if (get_from_handler_file(table_share->normalized_path.str,
+ mem_root, false))
{
my_error(ER_FAILED_READ_FROM_PAR_FILE, MYF(0));
DBUG_RETURN(1);
@@ -1037,6 +1070,10 @@ static int handle_opt_part(THD *thd, HA_CHECK_OPT *check_opt,
static bool print_admin_msg(THD* thd, const char* msg_type,
const char* db_name, const char* table_name,
const char* op_name, const char *fmt, ...)
+ ATTRIBUTE_FORMAT(printf, 6, 7);
+static bool print_admin_msg(THD* thd, const char* msg_type,
+ const char* db_name, const char* table_name,
+ const char* op_name, const char *fmt, ...)
{
va_list args;
Protocol *protocol= thd->protocol;
@@ -1891,7 +1928,7 @@ uint ha_partition::del_ren_cre_table(const char *from,
DBUG_RETURN(TRUE);
}
- if (get_from_handler_file(from, ha_thd()->mem_root))
+ if (get_from_handler_file(from, ha_thd()->mem_root, false))
DBUG_RETURN(TRUE);
DBUG_ASSERT(m_file_buffer);
DBUG_PRINT("enter", ("from: (%s) to: (%s)", from, to ? to : "(nil)"));
@@ -2108,18 +2145,16 @@ static uint name_add(char *dest, const char *first_name, const char *sec_name)
}
-/*
+/**
Create the special .par file
- SYNOPSIS
- create_handler_file()
- name Full path of table name
+ @param name Full path of table name
- RETURN VALUE
- >0 Error code
- 0 Success
+ @return Operation status
+ @retval FALSE Error code
+ @retval TRUE Success
- DESCRIPTION
+ @note
Method used to create handler file with names of partitions, their
engine types and the number of partitions.
*/
@@ -2183,19 +2218,22 @@ bool ha_partition::create_handler_file(const char *name)
Array of engine types n * 4 bytes where
n = (m_tot_parts + 3)/4
Length of name part in bytes 4 bytes
+ (Names in filename format)
Name part m * 4 bytes where
m = ((length_name_part + 3)/4)*4
All padding bytes are zeroed
*/
- tot_partition_words= (tot_parts + 3) / 4;
- tot_name_words= (tot_name_len + 3) / 4;
+ tot_partition_words= (tot_parts + PAR_WORD_SIZE - 1) / PAR_WORD_SIZE;
+ tot_name_words= (tot_name_len + PAR_WORD_SIZE - 1) / PAR_WORD_SIZE;
+ /* 4 static words (tot words, checksum, tot partitions, name length) */
tot_len_words= 4 + tot_partition_words + tot_name_words;
- tot_len_byte= 4 * tot_len_words;
+ tot_len_byte= PAR_WORD_SIZE * tot_len_words;
if (!(file_buffer= (uchar *) my_malloc(tot_len_byte, MYF(MY_ZEROFILL))))
DBUG_RETURN(TRUE);
- engine_array= (file_buffer + 12);
- name_buffer_ptr= (char*) (file_buffer + ((4 + tot_partition_words) * 4));
+ engine_array= (file_buffer + PAR_ENGINES_OFFSET);
+ name_buffer_ptr= (char*) (engine_array + tot_partition_words * PAR_WORD_SIZE
+ + PAR_WORD_SIZE);
part_it.rewind();
for (i= 0; i < num_parts; i++)
{
@@ -2233,13 +2271,15 @@ bool ha_partition::create_handler_file(const char *name)
}
chksum= 0;
int4store(file_buffer, tot_len_words);
- int4store(file_buffer + 8, tot_parts);
- int4store(file_buffer + 12 + (tot_partition_words * 4), tot_name_len);
+ int4store(file_buffer + PAR_NUM_PARTS_OFFSET, tot_parts);
+ int4store(file_buffer + PAR_ENGINES_OFFSET +
+ (tot_partition_words * PAR_WORD_SIZE),
+ tot_name_len);
for (i= 0; i < tot_len_words; i++)
- chksum^= uint4korr(file_buffer + 4 * i);
- int4store(file_buffer + 4, chksum);
+ chksum^= uint4korr(file_buffer + PAR_WORD_SIZE * i);
+ int4store(file_buffer + PAR_CHECKSUM_OFFSET, chksum);
/*
- Remove .frm extension and replace with .par
+ Add .par extension to the file name.
Create and write and close file
to be used at open, delete_table and rename_table
*/
@@ -2258,14 +2298,9 @@ bool ha_partition::create_handler_file(const char *name)
DBUG_RETURN(result);
}
-/*
- Clear handler variables and free some memory
-
- SYNOPSIS
- clear_handler_file()
- RETURN VALUE
- NONE
+/**
+ Clear handler variables and free some memory
*/
void ha_partition::clear_handler_file()
@@ -2278,16 +2313,15 @@ void ha_partition::clear_handler_file()
m_engine_array= NULL;
}
-/*
+
+/**
Create underlying handler objects
- SYNOPSIS
- create_handlers()
- mem_root Allocate memory through this
+ @param mem_root Allocate memory through this
- RETURN VALUE
- TRUE Error
- FALSE Success
+ @return Operation status
+ @retval TRUE Error
+ @retval FALSE Success
*/
bool ha_partition::create_handlers(MEM_ROOT *mem_root)
@@ -2325,6 +2359,7 @@ bool ha_partition::create_handlers(MEM_ROOT *mem_root)
DBUG_RETURN(FALSE);
}
+
/*
Create underlying handler objects from partition info
@@ -2396,101 +2431,165 @@ error_end:
}
-/*
- Get info about partition engines and their names from the .par file
+/**
+ Read the .par file to get the partitions engines and names
- SYNOPSIS
- get_from_handler_file()
- name Full path of table name
- mem_root Allocate memory through this
+ @param name Name of table file (without extention)
- RETURN VALUE
- TRUE Error
- FALSE Success
+ @return Operation status
+ @retval true Failure
+ @retval false Success
- DESCRIPTION
- Open handler file to get partition names, engine types and number of
- partitions.
+ @note On success, m_file_buffer is allocated and must be
+ freed by the caller. m_name_buffer_ptr and m_tot_parts is also set.
*/
-bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root)
+bool ha_partition::read_par_file(const char *name)
{
- char buff[FN_REFLEN], *address_tot_name_len;
+ char buff[FN_REFLEN], *tot_name_len_offset;
File file;
- char *file_buffer, *name_buffer_ptr;
- handlerton **engine_array;
+ char *file_buffer;
uint i, len_bytes, len_words, tot_partition_words, tot_name_words, chksum;
- DBUG_ENTER("ha_partition::get_from_handler_file");
+ DBUG_ENTER("ha_partition::read_par_file");
DBUG_PRINT("enter", ("table name: '%s'", name));
if (m_file_buffer)
- DBUG_RETURN(FALSE);
+ DBUG_RETURN(false);
fn_format(buff, name, "", ha_par_ext, MY_APPEND_EXT);
/* Following could be done with mysql_file_stat to read in whole file */
if ((file= mysql_file_open(key_file_partition,
buff, O_RDONLY | O_SHARE, MYF(0))) < 0)
DBUG_RETURN(TRUE);
- if (mysql_file_read(file, (uchar *) &buff[0], 8, MYF(MY_NABP)))
+ if (mysql_file_read(file, (uchar *) &buff[0], PAR_WORD_SIZE, MYF(MY_NABP)))
goto err1;
len_words= uint4korr(buff);
- len_bytes= 4 * len_words;
+ len_bytes= PAR_WORD_SIZE * len_words;
+ if (mysql_file_seek(file, 0, MY_SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR)
+ goto err1;
if (!(file_buffer= (char*) my_malloc(len_bytes, MYF(0))))
goto err1;
- mysql_file_seek(file, 0, MY_SEEK_SET, MYF(0));
if (mysql_file_read(file, (uchar *) file_buffer, len_bytes, MYF(MY_NABP)))
goto err2;
chksum= 0;
for (i= 0; i < len_words; i++)
- chksum ^= uint4korr((file_buffer) + 4 * i);
+ chksum ^= uint4korr((file_buffer) + PAR_WORD_SIZE * i);
if (chksum)
goto err2;
- m_tot_parts= uint4korr((file_buffer) + 8);
+ m_tot_parts= uint4korr((file_buffer) + PAR_NUM_PARTS_OFFSET);
DBUG_PRINT("info", ("No of parts = %u", m_tot_parts));
- tot_partition_words= (m_tot_parts + 3) / 4;
+ tot_partition_words= (m_tot_parts + PAR_WORD_SIZE - 1) / PAR_WORD_SIZE;
+
+ tot_name_len_offset= file_buffer + PAR_ENGINES_OFFSET +
+ PAR_WORD_SIZE * tot_partition_words;
+ tot_name_words= (uint4korr(tot_name_len_offset) + PAR_WORD_SIZE - 1) /
+ PAR_WORD_SIZE;
+ /*
+ Verify the total length = tot size word, checksum word, num parts word +
+ engines array + name length word + name array.
+ */
+ if (len_words != (tot_partition_words + tot_name_words + 4))
+ goto err2;
+ (void) mysql_file_close(file, MYF(0));
+ m_file_buffer= file_buffer; // Will be freed in clear_handler_file()
+ m_name_buffer_ptr= tot_name_len_offset + PAR_WORD_SIZE;
+
+ DBUG_RETURN(false);
+
+err2:
+ my_free(file_buffer);
+err1:
+ (void) mysql_file_close(file, MYF(0));
+ DBUG_RETURN(true);
+}
+
+
+/**
+ Setup m_engine_array
+
+ @param mem_root MEM_ROOT to use for allocating new handlers
+
+ @return Operation status
+ @retval false Success
+ @retval true Failure
+*/
+
+bool ha_partition::setup_engine_array(MEM_ROOT *mem_root)
+{
+ uint i;
+ uchar *buff;
+ handlerton **engine_array;
+
+ DBUG_ASSERT(!m_file);
+ DBUG_ENTER("ha_partition::setup_engine_array");
engine_array= (handlerton **) my_alloca(m_tot_parts * sizeof(handlerton*));
+ if (!engine_array)
+ DBUG_RETURN(true);
+
+ buff= (uchar *) (m_file_buffer + PAR_ENGINES_OFFSET);
for (i= 0; i < m_tot_parts; i++)
{
engine_array[i]= ha_resolve_by_legacy_type(ha_thd(),
(enum legacy_db_type)
- *(uchar *) ((file_buffer) +
- 12 + i));
+ *(buff + i));
if (!engine_array[i])
- goto err3;
+ goto err;
}
- 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 err3;
- name_buffer_ptr= file_buffer + 16 + 4 * tot_partition_words;
- (void) mysql_file_close(file, MYF(0));
- m_file_buffer= file_buffer; // Will be freed in clear_handler_file()
- m_name_buffer_ptr= name_buffer_ptr;
-
if (!(m_engine_array= (plugin_ref*)
my_malloc(m_tot_parts * sizeof(plugin_ref), MYF(MY_WME))))
- goto err3;
+ goto err;
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))
+ if (create_handlers(mem_root))
{
clear_handler_file();
- DBUG_RETURN(TRUE);
+ DBUG_RETURN(true);
}
- DBUG_RETURN(FALSE);
-err3:
+ DBUG_RETURN(false);
+
+err:
my_afree((gptr) engine_array);
-err2:
- my_free(file_buffer);
-err1:
- (void) mysql_file_close(file, MYF(0));
- DBUG_RETURN(TRUE);
+ DBUG_RETURN(true);
+}
+
+
+/**
+ Get info about partition engines and their names from the .par file
+
+ @param name Full path of table name
+ @param mem_root Allocate memory through this
+ @param is_clone If it is a clone, don't create new handlers
+
+ @return Operation status
+ @retval true Error
+ @retval false Success
+
+ @note Open handler file to get partition names, engine types and number of
+ partitions.
+*/
+
+bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root,
+ bool is_clone)
+{
+ DBUG_ENTER("ha_partition::get_from_handler_file");
+ DBUG_PRINT("enter", ("table name: '%s'", name));
+
+ if (m_file_buffer)
+ DBUG_RETURN(false);
+
+ if (read_par_file(name))
+ DBUG_RETURN(true);
+
+ if (!is_clone && setup_engine_array(mem_root))
+ DBUG_RETURN(true);
+
+ DBUG_RETURN(false);
}
@@ -2536,13 +2635,13 @@ void ha_data_partition_destroy(HA_DATA_PARTITION* ha_part_data)
int ha_partition::open(const char *name, int mode, uint test_if_locked)
{
- char *name_buffer_ptr= m_name_buffer_ptr;
- int error;
+ char *name_buffer_ptr;
+ int error= HA_ERR_INITIALIZATION;
uint alloc_len;
handler **file;
char name_buff[FN_REFLEN];
bool is_not_tmp_table= (table_share->tmp_table == NO_TMP_TABLE);
- ulonglong check_table_flags= 0;
+ ulonglong check_table_flags;
DBUG_ENTER("ha_partition::open");
DBUG_ASSERT(table->s == table_share);
@@ -2550,8 +2649,9 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
m_mode= mode;
m_open_test_lock= test_if_locked;
m_part_field_array= m_part_info->full_part_field_array;
- if (get_from_handler_file(name, &table->mem_root))
- DBUG_RETURN(1);
+ if (get_from_handler_file(name, &table->mem_root, test(m_is_clone_of)))
+ DBUG_RETURN(error);
+ name_buffer_ptr= m_name_buffer_ptr;
m_start_key.length= 0;
m_rec0= table->record[0];
m_rec_length= table_share->stored_rec_length;
@@ -2561,7 +2661,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
{
if (!(m_ordered_rec_buffer= (uchar*)my_malloc(alloc_len, MYF(MY_WME))))
{
- DBUG_RETURN(1);
+ DBUG_RETURN(error);
}
{
/*
@@ -2584,48 +2684,84 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
/* Initialize the bitmap we use to minimize ha_start_bulk_insert calls */
if (bitmap_init(&m_bulk_insert_started, NULL, m_tot_parts + 1, FALSE))
- DBUG_RETURN(1);
+ DBUG_RETURN(error);
bitmap_clear_all(&m_bulk_insert_started);
/* Initialize the bitmap we use to determine what partitions are used */
- if (!is_clone)
+ if (!m_is_clone_of)
{
+ DBUG_ASSERT(!m_clone_mem_root);
if (bitmap_init(&(m_part_info->used_partitions), NULL, m_tot_parts, TRUE))
{
bitmap_free(&m_bulk_insert_started);
- DBUG_RETURN(1);
+ DBUG_RETURN(error);
}
bitmap_set_all(&(m_part_info->used_partitions));
}
+ if (m_is_clone_of)
+ {
+ uint i;
+ DBUG_ASSERT(m_clone_mem_root);
+ /* Allocate an array of handler pointers for the partitions handlers. */
+ alloc_len= (m_tot_parts + 1) * sizeof(handler*);
+ if (!(m_file= (handler **) alloc_root(m_clone_mem_root, alloc_len)))
+ goto err_alloc;
+ memset(m_file, 0, alloc_len);
+ /*
+ Populate them by cloning the original partitions. This also opens them.
+ Note that file->ref is allocated too.
+ */
+ file= m_is_clone_of->m_file;
+ for (i= 0; i < m_tot_parts; i++)
+ {
+ create_partition_name(name_buff, name, name_buffer_ptr, NORMAL_PART_NAME,
+ FALSE);
+ if (!(m_file[i]= file[i]->clone(name_buff, m_clone_mem_root)))
+ {
+ error= HA_ERR_INITIALIZATION;
+ file= &m_file[i];
+ goto err_handler;
+ }
+ name_buffer_ptr+= strlen(name_buffer_ptr) + 1;
+ }
+ }
+ else
+ {
+ file= m_file;
+ do
+ {
+ create_partition_name(name_buff, name, name_buffer_ptr, NORMAL_PART_NAME,
+ FALSE);
+ if ((error= (*file)->ha_open(table, name_buff, mode, test_if_locked)))
+ goto err_handler;
+ m_num_locks+= (*file)->lock_count();
+ name_buffer_ptr+= strlen(name_buffer_ptr) + 1;
+ } while (*(++file));
+ }
+
file= m_file;
- do
+ ref_length= (*file)->ref_length;
+ check_table_flags= (((*file)->ha_table_flags() &
+ ~(PARTITION_DISABLED_TABLE_FLAGS)) |
+ (PARTITION_ENABLED_TABLE_FLAGS));
+ while (*(++file))
{
- create_partition_name(name_buff, name, name_buffer_ptr, NORMAL_PART_NAME,
- FALSE);
- if ((error= (*file)->ha_open(table, (const char*) name_buff, mode,
- test_if_locked)))
- goto err_handler;
- m_num_locks+= (*file)->lock_count();
- name_buffer_ptr+= strlen(name_buffer_ptr) + 1;
+ /* MyISAM can have smaller ref_length for partitions with MAX_ROWS set */
set_if_bigger(ref_length, ((*file)->ref_length));
/*
Verify that all partitions have the same set of table flags.
Mask all flags that partitioning enables/disables.
*/
- if (!check_table_flags)
- {
- check_table_flags= (((*file)->ha_table_flags() &
- ~(PARTITION_DISABLED_TABLE_FLAGS)) |
- (PARTITION_ENABLED_TABLE_FLAGS));
- }
- else if (check_table_flags != (((*file)->ha_table_flags() &
- ~(PARTITION_DISABLED_TABLE_FLAGS)) |
- (PARTITION_ENABLED_TABLE_FLAGS)))
+ if (check_table_flags != (((*file)->ha_table_flags() &
+ ~(PARTITION_DISABLED_TABLE_FLAGS)) |
+ (PARTITION_ENABLED_TABLE_FLAGS)))
{
error= HA_ERR_INITIALIZATION;
+ /* set file to last handler, so all of them is closed */
+ file = &m_file[m_tot_parts - 1];
goto err_handler;
}
- } while (*(++file));
+ }
key_used_on_scan= m_file[0]->key_used_on_scan;
implicit_emptied= m_file[0]->implicit_emptied;
/*
@@ -2634,6 +2770,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
*/
ref_length+= PARTITION_BYTES_IN_POS;
m_ref_length= ref_length;
+
/*
Release buffer read from .par file. It will not be reused again after
being opened once.
@@ -2693,25 +2830,54 @@ err_handler:
DEBUG_SYNC(ha_thd(), "partition_open_error");
while (file-- != m_file)
(*file)->close();
+err_alloc:
bitmap_free(&m_bulk_insert_started);
- if (!is_clone)
+ if (!m_is_clone_of)
bitmap_free(&(m_part_info->used_partitions));
DBUG_RETURN(error);
}
-handler *ha_partition::clone(MEM_ROOT *mem_root)
+
+/**
+ Clone the open and locked partitioning handler.
+
+ @param mem_root MEM_ROOT to use.
+
+ @return Pointer to the successfully created clone or NULL
+
+ @details
+ This function creates a new ha_partition handler as a clone/copy. The
+ original (this) must already be opened and locked. The clone will use
+ the originals m_part_info.
+ It also allocates memory for ref + ref_dup.
+ In ha_partition::open() it will clone its original handlers partitions
+ which will allocate then on the correct MEM_ROOT and also open them.
+*/
+
+handler *ha_partition::clone(const char *name, MEM_ROOT *mem_root)
{
- 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,
- table->s->normalized_path.str,
- table->db_stat,
- HA_OPEN_IGNORE_IF_LOCKED))
- return new_handler;
- return NULL;
+ ha_partition *new_handler;
+
+ DBUG_ENTER("ha_partition::clone");
+ new_handler= new (mem_root) ha_partition(ht, table_share, m_part_info,
+ this, mem_root);
+ /*
+ Allocate new_handler->ref here because otherwise ha_open will allocate it
+ on this->table->mem_root and we will not be able to reclaim that memory
+ when the clone handler object is destroyed.
+ */
+ if (new_handler &&
+ !(new_handler->ref= (uchar*) alloc_root(mem_root,
+ ALIGN_SIZE(m_ref_length)*2)))
+ new_handler= NULL;
+
+ if (new_handler &&
+ new_handler->ha_open(table, name,
+ table->db_stat, HA_OPEN_IGNORE_IF_LOCKED))
+ new_handler= NULL;
+
+ DBUG_RETURN((handler*) new_handler);
}
@@ -2742,7 +2908,7 @@ int ha_partition::close(void)
DBUG_ASSERT(table->s == table_share);
delete_queue(&m_queue);
bitmap_free(&m_bulk_insert_started);
- if (!is_clone)
+ if (!m_is_clone_of)
bitmap_free(&(m_part_info->used_partitions));
file= m_file;
@@ -3096,7 +3262,9 @@ int ha_partition::write_row(uchar * buf)
bool have_auto_increment= table->next_number_field && buf == table->record[0];
my_bitmap_map *old_map;
THD *thd= ha_thd();
- timestamp_auto_set_type orig_timestamp_type= table->timestamp_field_type;
+ timestamp_auto_set_type saved_timestamp_type= table->timestamp_field_type;
+ ulong saved_sql_mode= thd->variables.sql_mode;
+ bool saved_auto_inc_field_not_null= table->auto_increment_field_not_null;
#ifdef NOT_NEEDED
uchar *rec0= m_rec0;
#endif
@@ -3132,6 +3300,22 @@ int ha_partition::write_row(uchar * buf)
*/
if (error)
goto exit;
+
+ /*
+ Don't allow generation of auto_increment value the partitions handler.
+ If a partitions handler would change the value, then it might not
+ match the partition any longer.
+ This can occur if 'SET INSERT_ID = 0; INSERT (NULL)',
+ So allow this by adding 'MODE_NO_AUTO_VALUE_ON_ZERO' to sql_mode.
+ The partitions handler::next_insert_id must always be 0. Otherwise
+ we need to forward release_auto_increment, or reset it for all
+ partitions.
+ */
+ if (table->next_number_field->val_int() == 0)
+ {
+ table->auto_increment_field_not_null= TRUE;
+ thd->variables.sql_mode|= MODE_NO_AUTO_VALUE_ON_ZERO;
+ }
}
old_map= dbug_tmp_use_all_columns(table, table->read_set);
@@ -3165,7 +3349,9 @@ int ha_partition::write_row(uchar * buf)
set_auto_increment_if_higher(table->next_number_field);
reenable_binlog(thd);
exit:
- table->timestamp_field_type= orig_timestamp_type;
+ thd->variables.sql_mode= saved_sql_mode;
+ table->auto_increment_field_not_null= saved_auto_inc_field_not_null;
+ table->timestamp_field_type= saved_timestamp_type;
DBUG_RETURN(error);
}
@@ -3232,11 +3418,24 @@ int ha_partition::update_row(const uchar *old_data, uchar *new_data)
}
else
{
+ Field *saved_next_number_field= table->next_number_field;
+ /*
+ Don't allow generation of auto_increment value for update.
+ table->next_number_field is never set on UPDATE.
+ But is set for INSERT ... ON DUPLICATE KEY UPDATE,
+ and since update_row() does not generate or update an auto_inc value,
+ we cannot have next_number_field set when moving a row
+ to another partition with write_row(), since that could
+ generate/update the auto_inc value.
+ This gives the same behavior for partitioned vs non partitioned tables.
+ */
+ table->next_number_field= NULL;
DBUG_PRINT("info", ("Update from partition %d to partition %d",
old_part_id, new_part_id));
tmp_disable_binlog(thd); /* Do not replicate the low-level changes. */
error= m_file[new_part_id]->ha_write_row(new_data);
reenable_binlog(thd);
+ table->next_number_field= saved_next_number_field;
if (error)
goto exit;
@@ -3260,9 +3459,13 @@ exit:
index)
mysql_update does not set table->next_number_field, so we use
table->found_next_number_field instead.
+ Also checking that the field is marked in the write set.
*/
- if (table->found_next_number_field && new_data == table->record[0] &&
- !table->s->next_number_keypart)
+ if (table->found_next_number_field &&
+ new_data == table->record[0] &&
+ !table->s->next_number_keypart &&
+ bitmap_is_set(table->write_set,
+ table->found_next_number_field->field_index))
{
if (!table_share->ha_part_data->auto_inc_initialized)
info(HA_STATUS_AUTO);
@@ -3340,113 +3543,128 @@ int ha_partition::delete_row(const uchar *buf)
Called from sql_delete.cc by mysql_delete().
Called from sql_select.cc by JOIN::reinit().
Called from sql_union.cc by st_select_lex_unit::exec().
-
- Also used for handle ALTER TABLE t TRUNCATE PARTITION ...
- NOTE: auto increment value will be truncated in that partition as well!
*/
int ha_partition::delete_all_rows()
{
int error;
- bool truncate= FALSE;
handler **file;
- THD *thd= ha_thd();
DBUG_ENTER("ha_partition::delete_all_rows");
- if (thd->lex->sql_command == SQLCOM_TRUNCATE)
+ file= m_file;
+ do
{
- Alter_info *alter_info= &thd->lex->alter_info;
- /* TRUNCATE also means resetting auto_increment */
- lock_auto_increment();
- table_share->ha_part_data->next_auto_inc_val= 0;
- table_share->ha_part_data->auto_inc_initialized= FALSE;
- unlock_auto_increment();
- if (alter_info->flags & ALTER_ADMIN_PARTITION)
- {
- /* ALTER TABLE t TRUNCATE PARTITION ... */
- List_iterator<partition_element> part_it(m_part_info->partitions);
- int saved_error= 0;
- uint num_parts= m_part_info->num_parts;
- uint num_subparts= m_part_info->num_subparts;
- uint i= 0;
- uint num_parts_set= alter_info->partition_names.elements;
- uint num_parts_found= set_part_state(alter_info, m_part_info,
- PART_ADMIN);
- if (num_parts_set != num_parts_found &&
- (!(alter_info->flags & ALTER_ALL_PARTITION)))
- DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
+ if ((error= (*file)->ha_delete_all_rows()))
+ DBUG_RETURN(error);
+ } while (*(++file));
+ DBUG_RETURN(0);
+}
+
+
+/**
+ Manually truncate the table.
+
+ @retval 0 Success.
+ @retval > 0 Error code.
+*/
+
+int ha_partition::truncate()
+{
+ int error;
+ handler **file;
+ DBUG_ENTER("ha_partition::truncate");
+
+ /*
+ TRUNCATE also means resetting auto_increment. Hence, reset
+ it so that it will be initialized again at the next use.
+ */
+ lock_auto_increment();
+ table_share->ha_part_data->next_auto_inc_val= 0;
+ table_share->ha_part_data->auto_inc_initialized= FALSE;
+ unlock_auto_increment();
- /*
- Cannot return HA_ERR_WRONG_COMMAND here without correct pruning
- since that whould delete the whole table row by row in sql_delete.cc
- */
- bitmap_clear_all(&m_part_info->used_partitions);
- do
- {
- partition_element *part_elem= part_it++;
- if (part_elem->part_state == PART_ADMIN)
- {
- if (m_is_sub_partitioned)
- {
- List_iterator<partition_element>
- subpart_it(part_elem->subpartitions);
- partition_element *sub_elem;
- uint j= 0, part;
- do
- {
- sub_elem= subpart_it++;
- part= i * num_subparts + j;
- bitmap_set_bit(&m_part_info->used_partitions, part);
- if (!saved_error)
- {
- DBUG_PRINT("info", ("truncate subpartition %u (%s)",
- part, sub_elem->partition_name));
- if ((error= m_file[part]->ha_delete_all_rows()))
- saved_error= error;
- /* If not reset_auto_increment is supported, just accept it */
- if (!saved_error &&
- (error= m_file[part]->ha_reset_auto_increment(0)) &&
- error != HA_ERR_WRONG_COMMAND)
- saved_error= error;
- }
- } while (++j < num_subparts);
- }
- else
- {
- DBUG_PRINT("info", ("truncate partition %u (%s)", i,
- part_elem->partition_name));
- bitmap_set_bit(&m_part_info->used_partitions, i);
- if (!saved_error)
- {
- if ((error= m_file[i]->ha_delete_all_rows()) && !saved_error)
- saved_error= error;
- /* If not reset_auto_increment is supported, just accept it */
- if (!saved_error &&
- (error= m_file[i]->ha_reset_auto_increment(0)) &&
- error != HA_ERR_WRONG_COMMAND)
- saved_error= error;
- }
- }
- part_elem->part_state= PART_NORMAL;
- }
- } while (++i < num_parts);
- DBUG_RETURN(saved_error);
- }
- truncate= TRUE;
- }
file= m_file;
do
{
- if ((error= (*file)->ha_delete_all_rows()))
+ if ((error= (*file)->ha_truncate()))
DBUG_RETURN(error);
- /* Ignore the error */
- if (truncate)
- (void) (*file)->ha_reset_auto_increment(0);
} while (*(++file));
DBUG_RETURN(0);
}
+/**
+ Truncate a set of specific partitions.
+
+ @remark Auto increment value will be truncated in that partition as well!
+
+ ALTER TABLE t TRUNCATE PARTITION ...
+*/
+
+int ha_partition::truncate_partition(Alter_info *alter_info, bool *binlog_stmt)
+{
+ int error= 0;
+ List_iterator<partition_element> part_it(m_part_info->partitions);
+ uint num_parts= m_part_info->num_parts;
+ uint num_subparts= m_part_info->num_subparts;
+ uint i= 0;
+ uint num_parts_set= alter_info->partition_names.elements;
+ uint num_parts_found= set_part_state(alter_info, m_part_info,
+ PART_ADMIN);
+ DBUG_ENTER("ha_partition::truncate_partition");
+
+ /* Only binlog when it starts any call to the partitions handlers */
+ *binlog_stmt= false;
+
+ /*
+ TRUNCATE also means resetting auto_increment. Hence, reset
+ it so that it will be initialized again at the next use.
+ */
+ lock_auto_increment();
+ table_share->ha_part_data->next_auto_inc_val= 0;
+ table_share->ha_part_data->auto_inc_initialized= FALSE;
+ unlock_auto_increment();
+
+ if (num_parts_set != num_parts_found &&
+ (!(alter_info->flags & ALTER_ALL_PARTITION)))
+ DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
+
+ *binlog_stmt= true;
+
+ do
+ {
+ partition_element *part_elem= part_it++;
+ if (part_elem->part_state == PART_ADMIN)
+ {
+ if (m_is_sub_partitioned)
+ {
+ List_iterator<partition_element>
+ subpart_it(part_elem->subpartitions);
+ partition_element *sub_elem;
+ uint j= 0, part;
+ do
+ {
+ sub_elem= subpart_it++;
+ part= i * num_subparts + j;
+ DBUG_PRINT("info", ("truncate subpartition %u (%s)",
+ part, sub_elem->partition_name));
+ if ((error= m_file[part]->ha_truncate()))
+ break;
+ } while (++j < num_subparts);
+ }
+ else
+ {
+ DBUG_PRINT("info", ("truncate partition %u (%s)", i,
+ part_elem->partition_name));
+ error= m_file[i]->ha_truncate();
+ }
+ part_elem->part_state= PART_NORMAL;
+ }
+ } while (!error && (++i < num_parts));
+ DBUG_RETURN(error);
+}
+
+
/*
Start a large batch of insert rows
@@ -3883,19 +4101,16 @@ end_dont_reset_start_part:
void ha_partition::position(const uchar *record)
{
handler *file= m_file[m_last_part];
+ uint pad_length;
DBUG_ENTER("ha_partition::position");
file->position(record);
int2store(ref, m_last_part);
- memcpy((ref + PARTITION_BYTES_IN_POS), file->ref,
- (ref_length - PARTITION_BYTES_IN_POS));
-
-#ifdef SUPPORTING_PARTITION_OVER_DIFFERENT_ENGINES
-#ifdef HAVE_valgrind
- bzero(ref + PARTITION_BYTES_IN_POS + ref_length,
- max_ref_length-ref_length);
-#endif /* HAVE_valgrind */
-#endif
+ memcpy((ref + PARTITION_BYTES_IN_POS), file->ref, file->ref_length);
+ pad_length= m_ref_length - PARTITION_BYTES_IN_POS - file->ref_length;
+ if (pad_length)
+ memset((ref + PARTITION_BYTES_IN_POS + file->ref_length), 0, pad_length);
+
DBUG_VOID_RETURN;
}
@@ -3903,6 +4118,7 @@ void ha_partition::position(const uchar *record)
void ha_partition::column_bitmaps_signal()
{
handler::column_bitmaps_signal();
+ /* Must read all partition fields to make position() call possible */
bitmap_union(table->read_set, &m_part_info->full_part_field_set);
}
@@ -4357,8 +4573,12 @@ int ha_partition::index_read_idx_map(uchar *buf, uint index,
get_partition_set(table, buf, index, &m_start_key, &m_part_spec);
- /* How can it be more than one partition with the current use? */
- DBUG_ASSERT(m_part_spec.start_part == m_part_spec.end_part);
+ /*
+ We have either found exactly 1 partition
+ (in which case start_part == end_part)
+ or no matching partitions (start_part > end_part)
+ */
+ DBUG_ASSERT(m_part_spec.start_part >= m_part_spec.end_part);
for (part= m_part_spec.start_part; part <= m_part_spec.end_part; part++)
{
@@ -4371,6 +4591,8 @@ int ha_partition::index_read_idx_map(uchar *buf, uint index,
break;
}
}
+ if (part <= m_part_spec.end_part)
+ m_last_part= part;
}
else
{
@@ -4596,6 +4818,7 @@ int ha_partition::partition_scan_set_up(uchar * buf, bool idx_read_flag)
key not found.
*/
DBUG_PRINT("info", ("scan with no partition to scan"));
+ table->status= STATUS_NOT_FOUND;
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
if (m_part_spec.start_part == m_part_spec.end_part)
@@ -4620,6 +4843,7 @@ int ha_partition::partition_scan_set_up(uchar * buf, bool idx_read_flag)
if (start_part == MY_BIT_NONE)
{
DBUG_PRINT("info", ("scan with no partition to scan"));
+ table->status= STATUS_NOT_FOUND;
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
if (start_part > m_part_spec.start_part)
@@ -5129,6 +5353,8 @@ int ha_partition::handle_ordered_prev(uchar *buf)
int ha_partition::info(uint flag)
{
+ uint no_lock_flag= flag & HA_STATUS_NO_LOCK;
+ uint extra_var_flag= flag & HA_STATUS_VARIABLE_EXTRA;
DBUG_ENTER("ha_partition::info");
if (flag & HA_STATUS_AUTO)
@@ -5160,7 +5386,7 @@ int ha_partition::info(uint flag)
do
{
file= *file_array;
- file->info(HA_STATUS_AUTO);
+ file->info(HA_STATUS_AUTO | no_lock_flag);
set_if_bigger(auto_increment_value,
file->stats.auto_increment_value);
} while (*(++file_array));
@@ -5214,7 +5440,7 @@ int ha_partition::info(uint flag)
if (bitmap_is_set(&(m_part_info->used_partitions), (file_array - m_file)))
{
file= *file_array;
- file->info(HA_STATUS_VARIABLE);
+ file->info(HA_STATUS_VARIABLE | no_lock_flag | extra_var_flag);
stats.records+= file->stats.records;
stats.deleted+= file->stats.deleted;
stats.data_file_length+= file->stats.data_file_length;
@@ -5296,7 +5522,7 @@ int ha_partition::info(uint flag)
if (!(flag & HA_STATUS_VARIABLE) ||
!bitmap_is_set(&(m_part_info->used_partitions),
(file_array - m_file)))
- file->info(HA_STATUS_VARIABLE);
+ file->info(HA_STATUS_VARIABLE | no_lock_flag | extra_var_flag);
if (file->stats.records > max_records)
{
max_records= file->stats.records;
@@ -5306,7 +5532,7 @@ int ha_partition::info(uint flag)
} while (*(++file_array));
file= m_file[handler_instance];
- file->info(HA_STATUS_CONST);
+ file->info(HA_STATUS_CONST | no_lock_flag);
stats.block_size= file->stats.block_size;
stats.create_time= file->stats.create_time;
ref_length= m_ref_length;
@@ -5322,7 +5548,7 @@ int ha_partition::info(uint flag)
Note: all engines does not support HA_STATUS_ERRKEY, so set errkey.
*/
file->errkey= errkey;
- file->info(HA_STATUS_ERRKEY);
+ file->info(HA_STATUS_ERRKEY | no_lock_flag);
errkey= file->errkey;
}
if (flag & HA_STATUS_TIME)
@@ -5339,7 +5565,7 @@ int ha_partition::info(uint flag)
do
{
file= *file_array;
- file->info(HA_STATUS_TIME);
+ file->info(HA_STATUS_TIME | no_lock_flag);
if (file->stats.update_time > stats.update_time)
stats.update_time= file->stats.update_time;
} while (*(++file_array));
@@ -5353,7 +5579,7 @@ void ha_partition::get_dynamic_partition_info(PARTITION_STATS *stat_info,
{
handler *file= m_file[part_id];
file->info(HA_STATUS_CONST | HA_STATUS_TIME | HA_STATUS_VARIABLE |
- HA_STATUS_NO_LOCK);
+ HA_STATUS_VARIABLE_EXTRA | HA_STATUS_NO_LOCK);
stat_info->records= file->stats.records;
stat_info->mean_rec_length= file->stats.mean_rec_length;
@@ -6337,14 +6563,21 @@ void ha_partition::print_error(int error, myf errflag)
/* Should probably look for my own errors first */
DBUG_PRINT("enter", ("error: %d", error));
- if (error == HA_ERR_NO_PARTITION_FOUND &&
- thd->lex->sql_command != SQLCOM_TRUNCATE)
+ if ((error == HA_ERR_NO_PARTITION_FOUND) &&
+ ! (thd->lex->alter_info.flags & ALTER_TRUNCATE_PARTITION))
m_part_info->print_no_partition_found(table);
else
{
/* In case m_file has not been initialized, like in bug#42438 */
if (m_file)
+ {
+ if (m_last_part >= m_tot_parts)
+ {
+ DBUG_ASSERT(0);
+ m_last_part= 0;
+ }
m_file[m_last_part]->print_error(error, errflag);
+ }
else
handler::print_error(error, errflag);
}
@@ -6375,9 +6608,42 @@ bool ha_partition::get_error_message(int error, String *buf)
*/
uint ha_partition::alter_table_flags(uint flags)
{
+ uint flags_to_return, flags_to_check;
DBUG_ENTER("ha_partition::alter_table_flags");
- DBUG_RETURN(ht->alter_table_flags(flags) |
- m_file[0]->alter_table_flags(flags));
+
+ flags_to_return= ht->alter_table_flags(flags);
+ flags_to_return|= m_file[0]->alter_table_flags(flags);
+
+ /*
+ If one partition fails we must be able to revert the change for the other,
+ already altered, partitions. So both ADD and DROP can only be supported in
+ pairs.
+ */
+ flags_to_check= HA_INPLACE_ADD_INDEX_NO_READ_WRITE;
+ flags_to_check|= HA_INPLACE_DROP_INDEX_NO_READ_WRITE;
+ if ((flags_to_return & flags_to_check) != flags_to_check)
+ flags_to_return&= ~flags_to_check;
+ flags_to_check= HA_INPLACE_ADD_UNIQUE_INDEX_NO_READ_WRITE;
+ flags_to_check|= HA_INPLACE_DROP_UNIQUE_INDEX_NO_READ_WRITE;
+ if ((flags_to_return & flags_to_check) != flags_to_check)
+ flags_to_return&= ~flags_to_check;
+ flags_to_check= HA_INPLACE_ADD_PK_INDEX_NO_READ_WRITE;
+ flags_to_check|= HA_INPLACE_DROP_PK_INDEX_NO_READ_WRITE;
+ if ((flags_to_return & flags_to_check) != flags_to_check)
+ flags_to_return&= ~flags_to_check;
+ flags_to_check= HA_INPLACE_ADD_INDEX_NO_WRITE;
+ flags_to_check|= HA_INPLACE_DROP_INDEX_NO_WRITE;
+ if ((flags_to_return & flags_to_check) != flags_to_check)
+ flags_to_return&= ~flags_to_check;
+ flags_to_check= HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE;
+ flags_to_check|= HA_INPLACE_DROP_UNIQUE_INDEX_NO_WRITE;
+ if ((flags_to_return & flags_to_check) != flags_to_check)
+ flags_to_return&= ~flags_to_check;
+ flags_to_check= HA_INPLACE_ADD_PK_INDEX_NO_WRITE;
+ flags_to_check|= HA_INPLACE_DROP_PK_INDEX_NO_WRITE;
+ if ((flags_to_return & flags_to_check) != flags_to_check)
+ flags_to_return&= ~flags_to_check;
+ DBUG_RETURN(flags_to_return);
}
@@ -6405,25 +6671,89 @@ bool ha_partition::check_if_incompatible_data(HA_CREATE_INFO *create_info,
/**
- Support of fast or online add/drop index
+ Support of in-place add/drop index
*/
-int ha_partition::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys)
+int ha_partition::add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys,
+ handler_add_index **add)
{
handler **file;
int ret= 0;
+ DBUG_ENTER("ha_partition::add_index");
+ *add= new handler_add_index(table, key_info, num_of_keys);
/*
There has already been a check in fix_partition_func in mysql_alter_table
before this call, which checks for unique/primary key violations of the
partitioning function. So no need for extra check here.
*/
for (file= m_file; *file; file++)
- if ((ret= (*file)->add_index(table_arg, key_info, num_of_keys)))
- break;
- return ret;
+ {
+ handler_add_index *add_index;
+ if ((ret= (*file)->add_index(table_arg, key_info, num_of_keys, &add_index)))
+ goto err;
+ if ((ret= (*file)->final_add_index(add_index, true)))
+ goto err;
+ }
+ DBUG_RETURN(ret);
+err:
+ if (file > m_file)
+ {
+ uint *key_numbers= (uint*) ha_thd()->alloc(sizeof(uint) * num_of_keys);
+ uint old_num_of_keys= table_arg->s->keys;
+ uint i;
+ /* The newly created keys have the last id's */
+ for (i= 0; i < num_of_keys; i++)
+ key_numbers[i]= i + old_num_of_keys;
+ if (!table_arg->key_info)
+ table_arg->key_info= key_info;
+ while (--file >= m_file)
+ {
+ (void) (*file)->prepare_drop_index(table_arg, key_numbers, num_of_keys);
+ (void) (*file)->final_drop_index(table_arg);
+ }
+ if (table_arg->key_info == key_info)
+ table_arg->key_info= NULL;
+ }
+ DBUG_RETURN(ret);
}
+/**
+ Second phase of in-place add index.
+
+ @note If commit is false, index changes are rolled back by dropping the
+ added indexes. If commit is true, nothing is done as the indexes
+ were already made active in ::add_index()
+ */
+
+int ha_partition::final_add_index(handler_add_index *add, bool commit)
+{
+ DBUG_ENTER("ha_partition::final_add_index");
+ // Rollback by dropping indexes.
+ if (!commit)
+ {
+ TABLE *table_arg= add->table;
+ uint num_of_keys= add->num_of_keys;
+ handler **file;
+ uint *key_numbers= (uint*) ha_thd()->alloc(sizeof(uint) * num_of_keys);
+ uint old_num_of_keys= table_arg->s->keys;
+ uint i;
+ /* The newly created keys have the last id's */
+ for (i= 0; i < num_of_keys; i++)
+ key_numbers[i]= i + old_num_of_keys;
+ if (!table_arg->key_info)
+ table_arg->key_info= add->key_info;
+ for (file= m_file; *file; file++)
+ {
+ (void) (*file)->prepare_drop_index(table_arg, key_numbers, num_of_keys);
+ (void) (*file)->final_drop_index(table_arg);
+ }
+ if (table_arg->key_info == add->key_info)
+ table_arg->key_info= NULL;
+ }
+ DBUG_RETURN(0);
+}
+
int ha_partition::prepare_drop_index(TABLE *table_arg, uint *key_num,
uint num_of_keys)
{
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index efd0707252e..c2bdd23a256 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -36,6 +36,16 @@ enum partition_keywords
HA_DUPLICATE_POS | \
HA_CAN_SQL_HANDLER | \
HA_CAN_INSERT_DELAYED)
+
+/* First 4 bytes in the .par file is the number of 32-bit words in the file */
+#define PAR_WORD_SIZE 4
+/* offset to the .par file checksum */
+#define PAR_CHECKSUM_OFFSET 4
+/* offset to the total number of partitions */
+#define PAR_NUM_PARTS_OFFSET 8
+/* offset to the engines array */
+#define PAR_ENGINES_OFFSET 12
+
class ha_partition :public handler
{
private:
@@ -51,7 +61,7 @@ private:
/* Data for the partition handler */
int m_mode; // Open mode
uint m_open_test_lock; // Open test_if_locked
- char *m_file_buffer; // Buffer with names
+ char *m_file_buffer; // Content of the .par file
char *m_name_buffer_ptr; // Pointer to first partition name
plugin_ref *m_engine_array; // Array of types of the handlers
handler **m_file; // Array of references to handler inst.
@@ -113,6 +123,13 @@ private:
bool m_is_sub_partitioned; // Is subpartitioned
bool m_ordered_scan_ongoing;
+ /*
+ If set, this object was created with ha_partition::clone and doesn't
+ "own" the m_part_info structure.
+ */
+ ha_partition *m_is_clone_of;
+ MEM_ROOT *m_clone_mem_root;
+
/*
We keep track if all underlying handlers are MyISAM since MyISAM has a
great number of extra flags not needed by other handlers.
@@ -146,11 +163,6 @@ private:
*/
THR_LOCK_DATA lock; /* MySQL lock */
- /*
- TRUE <=> this object was created with ha_partition::clone and doesn't
- "own" the m_part_info structure.
- */
- bool is_clone;
bool auto_increment_lock; /**< lock reading/updating auto_inc */
/**
Flag to keep the auto_increment lock through out the statement.
@@ -163,7 +175,7 @@ private:
/** used for prediction of start_bulk_insert rows */
enum_monotonicity_info m_part_func_monotonicity_info;
public:
- handler *clone(MEM_ROOT *mem_root);
+ handler *clone(const char *name, MEM_ROOT *mem_root);
virtual void set_part_info(partition_info *part_info)
{
m_part_info= part_info;
@@ -182,6 +194,10 @@ public:
*/
ha_partition(handlerton *hton, TABLE_SHARE * table);
ha_partition(handlerton *hton, partition_info * part_info);
+ ha_partition(handlerton *hton, TABLE_SHARE *share,
+ partition_info *part_info_arg,
+ ha_partition *clone_arg,
+ MEM_ROOT *clone_mem_root_arg);
~ha_partition();
/*
A partition handler has no characteristics in itself. It only inherits
@@ -253,7 +269,10 @@ private:
And one method to read it in.
*/
bool create_handler_file(const char *name);
- bool get_from_handler_file(const char *name, MEM_ROOT *mem_root);
+ bool setup_engine_array(MEM_ROOT *mem_root);
+ bool read_par_file(const char *name);
+ bool get_from_handler_file(const char *name, MEM_ROOT *mem_root,
+ bool is_clone);
bool new_handlers_from_part_info(MEM_ROOT *mem_root);
bool create_handlers(MEM_ROOT *mem_root);
void clear_handler_file();
@@ -345,6 +364,7 @@ public:
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 int truncate();
virtual void start_bulk_insert(ha_rows rows);
virtual int end_bulk_insert();
private:
@@ -353,6 +373,15 @@ private:
long estimate_read_buffer_size(long original_size);
public:
+ /*
+ Method for truncating a specific partition.
+ (i.e. ALTER TABLE t1 TRUNCATE PARTITION p).
+
+ @remark This method is a partitioning-specific hook
+ and thus not a member of the general SE API.
+ */
+ int truncate_partition(Alter_info *, bool *binlog_stmt);
+
virtual bool is_fatal_error(int error, uint flags)
{
if (!handler::is_fatal_error(error, flags) ||
@@ -1023,7 +1052,9 @@ public:
They are used for on-line/fast alter table add/drop index:
-------------------------------------------------------------------------
*/
- virtual int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys);
+ virtual int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys,
+ handler_add_index **add);
+ virtual int final_add_index(handler_add_index *add, bool commit);
virtual int prepare_drop_index(TABLE *table_arg, uint *key_num,
uint num_of_keys);
virtual int final_drop_index(TABLE *table_arg);
diff --git a/sql/handler.cc b/sql/handler.cc
index 1737d5554b9..41bac077e3b 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1,4 +1,5 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011 Monty Program 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
@@ -29,8 +30,6 @@
#include "sql_cache.h" // query_cache, query_cache_*
#include "key.h" // key_copy, key_unpack, key_cmp_if_same, key_cmp
#include "sql_table.h" // build_table_filename
-#include "lock.h" // wait_if_global_read_lock,
- // start_waiting_global_read_lock
#include "sql_parse.h" // check_stack_overrun
#include "sql_acl.h" // SUPER_ACL
#include "sql_base.h" // free_io_cache
@@ -42,7 +41,7 @@
#include "transaction.h"
#include "myisam.h"
#include "probes_mysql.h"
-#include "sql_connect.h"
+#include "debug_sync.h" // DEBUG_SYNC
#ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h"
@@ -279,7 +278,7 @@ handler *get_ha_partition(partition_info *part_info)
}
else
{
- my_error(ER_OUTOFMEMORY, MYF(0), sizeof(ha_partition));
+ my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(sizeof(ha_partition)));
}
DBUG_RETURN(((handler*) partition));
}
@@ -358,6 +357,7 @@ int ha_init_errors(void)
SETMSG(HA_ERR_AUTOINC_READ_FAILED, ER_DEFAULT(ER_AUTOINC_READ_FAILED));
SETMSG(HA_ERR_AUTOINC_ERANGE, ER_DEFAULT(ER_WARN_DATA_OUT_OF_RANGE));
SETMSG(HA_ERR_TOO_MANY_CONCURRENT_TRXS, ER_DEFAULT(ER_TOO_MANY_CONCURRENT_TRXS));
+ SETMSG(HA_ERR_INDEX_COL_TOO_LONG, ER_DEFAULT(ER_INDEX_COLUMN_TOO_LONG));
/* Register the error messages for use with my_error(). */
return my_error_register(get_handler_errmsgs, HA_ERR_FIRST, HA_ERR_LAST);
@@ -1168,8 +1168,9 @@ int ha_commit_trans(THD *thd, bool all)
{
uint rw_ha_count;
bool rw_trans;
+ MDL_request mdl_request;
- DBUG_EXECUTE_IF("crash_commit_before", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_commit_before", DBUG_SUICIDE(););
/* Close all cursors that can not survive COMMIT */
if (is_real_trans) /* not a statement commit */
@@ -1179,11 +1180,27 @@ int ha_commit_trans(THD *thd, bool all)
/* rw_trans is TRUE when we in a transaction changing data */
rw_trans= is_real_trans && (rw_ha_count > 0);
- if (rw_trans &&
- thd->global_read_lock.wait_if_global_read_lock(thd, FALSE, FALSE))
+ if (rw_trans)
{
- ha_rollback_trans(thd, all);
- DBUG_RETURN(1);
+ /*
+ Acquire a metadata lock which will ensure that COMMIT is blocked
+ by an active FLUSH TABLES WITH READ LOCK (and vice versa:
+ COMMIT in progress blocks FTWRL).
+
+ We allow the owner of FTWRL to COMMIT; we assume that it knows
+ what it does.
+ */
+ mdl_request.init(MDL_key::COMMIT, "", "", MDL_INTENTION_EXCLUSIVE,
+ MDL_EXPLICIT);
+
+ if (thd->mdl_context.acquire_lock(&mdl_request,
+ thd->variables.lock_wait_timeout))
+ {
+ ha_rollback_trans(thd, all);
+ DBUG_RETURN(1);
+ }
+
+ DEBUG_SYNC(thd, "ha_commit_trans_after_acquire_commit_lock");
}
if (rw_trans &&
@@ -1221,7 +1238,7 @@ int ha_commit_trans(THD *thd, bool all)
}
status_var_increment(thd->status_var.ha_prepare_count);
}
- DBUG_EXECUTE_IF("crash_commit_after_prepare", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_commit_after_prepare", DBUG_SUICIDE(););
if (error || (is_real_trans && xid &&
(error= !(cookie= tc_log->log_xid(thd, xid)))))
{
@@ -1229,17 +1246,29 @@ int ha_commit_trans(THD *thd, bool all)
error= 1;
goto end;
}
- DBUG_EXECUTE_IF("crash_commit_after_log", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_commit_after_log", DBUG_SUICIDE(););
}
error=ha_commit_one_phase(thd, all) ? (cookie ? 2 : 1) : 0;
- DBUG_EXECUTE_IF("crash_commit_before_unlog", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_commit_before_unlog", DBUG_SUICIDE(););
if (cookie)
- tc_log->unlog(cookie, xid);
- DBUG_EXECUTE_IF("crash_commit_after", DBUG_ABORT(););
+ if(tc_log->unlog(cookie, xid))
+ {
+ error= 2;
+ goto end;
+ }
+ DBUG_EXECUTE_IF("crash_commit_after", DBUG_SUICIDE(););
RUN_HOOK(transaction, after_commit, (thd, FALSE));
end:
- if (rw_trans)
- thd->global_read_lock.start_waiting_global_read_lock(thd);
+ if (rw_trans && mdl_request.ticket)
+ {
+ /*
+ We do not always immediately release transactional locks
+ after ha_commit_trans() (see uses of ha_enable_transaction()),
+ thus we release the commit blocker lock as soon as it's
+ not needed.
+ */
+ thd->mdl_context.release_lock(mdl_request.ticket);
+ }
}
/* Free resources and perform other cleanup even for 'empty' transactions. */
else if (is_real_trans)
@@ -1614,7 +1643,8 @@ int ha_recover(HASH *commit_list)
}
if (!info.list)
{
- sql_print_error(ER(ER_OUTOFMEMORY), info.len*sizeof(XID));
+ sql_print_error(ER(ER_OUTOFMEMORY),
+ static_cast<int>(info.len*sizeof(XID)));
DBUG_RETURN(1);
}
@@ -2052,26 +2082,28 @@ int ha_delete_table(THD *thd, handlerton *table_type, const char *path,
/****************************************************************************
** General handler functions
****************************************************************************/
-handler *handler::clone(MEM_ROOT *mem_root)
+handler *handler::clone(const char *name, MEM_ROOT *mem_root)
{
- handler *new_handler= get_new_handler(table->s, mem_root, table->s->db_type());
-
- if (!new_handler)
- return NULL;
-
+ handler *new_handler= get_new_handler(table->s, mem_root, ht);
/*
Allocate handler->ref here because otherwise ha_open will allocate it
on this->table->mem_root and we will not be able to reclaim that memory
when the clone handler object is destroyed.
*/
- if (!(new_handler->ref= (uchar*) alloc_root(mem_root, ALIGN_SIZE(ref_length)*2)))
- return NULL;
- if (new_handler->ha_open(table,
- table->s->normalized_path.str,
- table->db_stat,
- HA_OPEN_IGNORE_IF_LOCKED))
- return NULL;
- new_handler->cloned= 1; // Marker for debugging
+ if (new_handler &&
+ !(new_handler->ref= (uchar*) alloc_root(mem_root,
+ ALIGN_SIZE(ref_length)*2)))
+ new_handler= NULL;
+ /*
+ TODO: Implement a more efficient way to have more than one index open for
+ the same table instance. The ha_open call is not cachable for clone.
+ */
+ if (new_handler && new_handler->ha_open(table,
+ name,
+ table->db_stat,
+ HA_OPEN_IGNORE_IF_LOCKED))
+ new_handler= NULL;
+
return new_handler;
}
@@ -2217,7 +2249,8 @@ int handler::read_first_row(uchar * buf, uint primary_key)
computes the lowest number
- strictly greater than "nr"
- of the form: auto_increment_offset + N * auto_increment_increment
-
+ If overflow happened then return MAX_ULONGLONG value as an
+ indication of overflow.
In most cases increment= offset= 1, in which case we get:
@verbatim 1,2,3,4,5,... @endverbatim
If increment=10 and offset=5 and previous number is 1, we get:
@@ -2226,13 +2259,23 @@ int handler::read_first_row(uchar * buf, uint primary_key)
inline ulonglong
compute_next_insert_id(ulonglong nr,struct system_variables *variables)
{
+ const ulonglong save_nr= nr;
+
if (variables->auto_increment_increment == 1)
- return (nr+1); // optimization of the formula below
- nr= (((nr+ variables->auto_increment_increment -
- variables->auto_increment_offset)) /
- (ulonglong) variables->auto_increment_increment);
- return (nr* (ulonglong) variables->auto_increment_increment +
- variables->auto_increment_offset);
+ nr= nr + 1; // optimization of the formula below
+ else
+ {
+ nr= (((nr+ variables->auto_increment_increment -
+ variables->auto_increment_offset)) /
+ (ulonglong) variables->auto_increment_increment);
+ nr= (nr* (ulonglong) variables->auto_increment_increment +
+ variables->auto_increment_offset);
+ }
+
+ if (unlikely(nr <= save_nr))
+ return ULONGLONG_MAX;
+
+ return nr;
}
@@ -2443,7 +2486,7 @@ int handler::update_auto_increment()
variables->auto_increment_increment,
nb_desired_values, &nr,
&nb_reserved_values);
- if (nr == ~(ulonglong) 0)
+ if (nr == ULONGLONG_MAX)
DBUG_RETURN(HA_ERR_AUTOINC_READ_FAILED); // Mark failure
/*
@@ -2474,6 +2517,9 @@ int handler::update_auto_increment()
}
}
+ if (unlikely(nr == ULONGLONG_MAX))
+ DBUG_RETURN(HA_ERR_AUTOINC_ERANGE);
+
DBUG_PRINT("info",("auto_increment: %lu", (ulong) nr));
if (unlikely(table->next_number_field->store((longlong) nr, TRUE)))
@@ -2701,6 +2747,7 @@ void handler::print_error(int error, myf errflag)
break;
case HA_ERR_KEY_NOT_FOUND:
case HA_ERR_NO_ACTIVE_RECORD:
+ case HA_ERR_RECORD_DELETED:
case HA_ERR_END_OF_FILE:
/*
This errors is not not normally fatal (for example for reads). However
@@ -2868,6 +2915,9 @@ void handler::print_error(int error, myf errflag)
case HA_ERR_TOO_MANY_CONCURRENT_TRXS:
textno= ER_TOO_MANY_CONCURRENT_TRXS;
break;
+ case HA_ERR_INDEX_COL_TOO_LONG:
+ textno= ER_INDEX_COLUMN_TOO_LONG;
+ break;
default:
{
/* The error was "unknown" to this function.
@@ -3235,9 +3285,13 @@ int handler::ha_repair(THD* thd, HA_CHECK_OPT* check_opt)
mark_trx_read_write();
- if ((result= repair(thd, check_opt)))
- return result;
- return update_frm_version(table);
+ result= repair(thd, check_opt);
+ DBUG_ASSERT(result == HA_ADMIN_NOT_IMPLEMENTED ||
+ ha_table_flags() & HA_CAN_REPAIR);
+
+ if (result == HA_ADMIN_OK)
+ result= update_frm_version(table);
+ return result;
}
@@ -3273,6 +3327,21 @@ handler::ha_delete_all_rows()
/**
+ Truncate table: public interface.
+
+ @sa handler::truncate()
+*/
+
+int
+handler::ha_truncate()
+{
+ mark_trx_read_write();
+
+ return truncate();
+}
+
+
+/**
Reset auto increment: public interface.
@sa handler::reset_auto_increment()
@@ -4807,6 +4876,7 @@ int handler::ha_reset()
free_io_cache(table);
/* reset the bitmaps to point to defaults */
table->default_column_bitmaps();
+ pushed_cond= NULL;
DBUG_RETURN(reset());
}
diff --git a/sql/handler.h b/sql/handler.h
index 656c9403b8c..8524ecfd695 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -1,19 +1,22 @@
#ifndef HANDLER_INCLUDED
#define HANDLER_INCLUDED
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010-2011 Monty Program 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 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
+ 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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA */
/* Definitions for parameters to do with handler-routines */
@@ -28,7 +31,7 @@
#include "sql_cache.h"
#include "structs.h" /* SHOW_COMP_OPTION */
-#include <my_handler.h>
+#include <my_compare.h>
#include <ft_global.h>
#include <keycache.h>
@@ -63,7 +66,7 @@
a table with rnd_next()
- We will see all rows (including deleted ones)
- Row positions are 'table->s->db_record_offset' apart
- If this flag is not set, filesort will do a postion() call for each matched
+ If this flag is not set, filesort will do a position() call for each matched
row to be able to find the row later.
*/
#define HA_REC_NOT_IN_SEQ (1 << 3)
@@ -157,10 +160,18 @@
ordered.
*/
#define HA_DUPLICATE_KEY_NOT_IN_ORDER (LL(1) << 36)
+
+/*
+ Engine supports REPAIR TABLE. Used by CHECK TABLE FOR UPGRADE if an
+ incompatible table is detected. If this flag is set, CHECK TABLE FOR UPGRADE
+ will report ER_TABLE_NEEDS_UPGRADE, otherwise ER_TABLE_NEED_REBUILD.
+*/
+#define HA_CAN_REPAIR (LL(1) << 37)
+
/* Has automatic checksums and uses the new checksum format */
-#define HA_HAS_NEW_CHECKSUM (LL(1) << 37)
+#define HA_HAS_NEW_CHECKSUM (LL(1) << 38)
-#define HA_MRR_CANT_SORT (LL(1) << 38)
+#define HA_MRR_CANT_SORT (LL(1) << 39)
/*
Set of all binlog flags. Currently only contain the capabilities
@@ -189,26 +200,31 @@
bits in alter_table_flags:
*/
/*
- These bits are set if different kinds of indexes can be created
- off-line without re-create of the table (but with a table lock).
+ These bits are set if different kinds of indexes can be created or dropped
+ in-place without re-creating the table using a temporary table.
+ NO_READ_WRITE indicates that the handler needs concurrent reads and writes
+ of table data to be blocked.
+ Partitioning needs both ADD and DROP to be supported by its underlying
+ handlers, due to error handling, see bug#57778.
*/
-#define HA_ONLINE_ADD_INDEX_NO_WRITES (1L << 0) /*add index w/lock*/
-#define HA_ONLINE_DROP_INDEX_NO_WRITES (1L << 1) /*drop index w/lock*/
-#define HA_ONLINE_ADD_UNIQUE_INDEX_NO_WRITES (1L << 2) /*add unique w/lock*/
-#define HA_ONLINE_DROP_UNIQUE_INDEX_NO_WRITES (1L << 3) /*drop uniq. w/lock*/
-#define HA_ONLINE_ADD_PK_INDEX_NO_WRITES (1L << 4) /*add prim. w/lock*/
-#define HA_ONLINE_DROP_PK_INDEX_NO_WRITES (1L << 5) /*drop prim. w/lock*/
+#define HA_INPLACE_ADD_INDEX_NO_READ_WRITE (1L << 0)
+#define HA_INPLACE_DROP_INDEX_NO_READ_WRITE (1L << 1)
+#define HA_INPLACE_ADD_UNIQUE_INDEX_NO_READ_WRITE (1L << 2)
+#define HA_INPLACE_DROP_UNIQUE_INDEX_NO_READ_WRITE (1L << 3)
+#define HA_INPLACE_ADD_PK_INDEX_NO_READ_WRITE (1L << 4)
+#define HA_INPLACE_DROP_PK_INDEX_NO_READ_WRITE (1L << 5)
/*
- These are set if different kinds of indexes can be created on-line
- (without a table lock). If a handler is capable of one or more of
- these, it should also set the corresponding *_NO_WRITES bit(s).
+ These are set if different kinds of indexes can be created or dropped
+ in-place while still allowing concurrent reads (but not writes) of table
+ data. If a handler is capable of one or more of these, it should also set
+ the corresponding *_NO_READ_WRITE bit(s).
*/
-#define HA_ONLINE_ADD_INDEX (1L << 6) /*add index online*/
-#define HA_ONLINE_DROP_INDEX (1L << 7) /*drop index online*/
-#define HA_ONLINE_ADD_UNIQUE_INDEX (1L << 8) /*add unique online*/
-#define HA_ONLINE_DROP_UNIQUE_INDEX (1L << 9) /*drop uniq. online*/
-#define HA_ONLINE_ADD_PK_INDEX (1L << 10)/*add prim. online*/
-#define HA_ONLINE_DROP_PK_INDEX (1L << 11)/*drop prim. online*/
+#define HA_INPLACE_ADD_INDEX_NO_WRITE (1L << 6)
+#define HA_INPLACE_DROP_INDEX_NO_WRITE (1L << 7)
+#define HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE (1L << 8)
+#define HA_INPLACE_DROP_UNIQUE_INDEX_NO_WRITE (1L << 9)
+#define HA_INPLACE_ADD_PK_INDEX_NO_WRITE (1L << 10)
+#define HA_INPLACE_DROP_PK_INDEX_NO_WRITE (1L << 11)
/*
HA_PARTITION_FUNCTION_SUPPORTED indicates that the function is
supported at all.
@@ -1102,7 +1118,7 @@ typedef struct st_ha_create_information
{
CHARSET_INFO *table_charset, *default_table_charset;
LEX_STRING connect_string;
- const char *password, *tablespace;
+ const char *password;
LEX_STRING comment;
const char *data_file_name, *index_file_name;
const char *alias;
@@ -1131,7 +1147,6 @@ typedef struct st_ha_create_information
enum ha_choice transactional;
bool frm_only; ///< 1 if no ha_create_table()
bool varchar; ///< 1 if table has a VARCHAR
- enum ha_storage_media storage_media; ///< DEFAULT, DISK or MEMORY
enum ha_choice page_checksum; ///< If we have page_checksums
engine_option_value *option_list; ///< list of table create options
/* the following three are only for ALTER TABLE, check_if_incompatible_data() */
@@ -1464,6 +1479,27 @@ uint calculate_key_len(TABLE *, uint, const uchar *, key_part_map);
*/
#define make_prev_keypart_map(N) (((key_part_map)1 << (N)) - 1)
+
+/**
+ Index creation context.
+ Created by handler::add_index() and freed by handler::final_add_index().
+*/
+
+class handler_add_index
+{
+public:
+ /* Table where the indexes are added */
+ TABLE* const table;
+ /* Indexes being created */
+ KEY* const key_info;
+ /* Size of key_info[] */
+ const uint num_of_keys;
+ handler_add_index(TABLE *table_arg, KEY *key_info_arg, uint num_of_keys_arg)
+ : table (table_arg), key_info (key_info_arg), num_of_keys (num_of_keys_arg)
+ {}
+ virtual ~handler_add_index() {}
+};
+
/**
The handler class is the interface for dynamically loadable
storage engines. Do not add ifdefs and take care when adding or
@@ -1522,7 +1558,6 @@ public:
bool locked;
bool implicit_emptied; /* Can be !=0 only if HEAP */
bool mark_trx_done;
- bool cloned; /* 1 if this was created with clone */
const COND *pushed_cond;
/**
next_insert_id is the next value which should be inserted into the
@@ -1584,7 +1619,7 @@ public:
in_range_check_pushed_down(FALSE),
ref_length(sizeof(my_off_t)),
ft_handler(0), inited(NONE),
- locked(FALSE), implicit_emptied(0), mark_trx_done(FALSE), cloned(0),
+ locked(FALSE), implicit_emptied(0), mark_trx_done(FALSE),
pushed_cond(0), next_insert_id(0), insert_id_for_cur_row(0),
pushed_idx_cond(NULL),
pushed_idx_cond_keyno(MAX_KEY),
@@ -1598,7 +1633,7 @@ public:
DBUG_ASSERT(locked == FALSE);
DBUG_ASSERT(inited == NONE);
}
- virtual handler *clone(MEM_ROOT *mem_root);
+ virtual handler *clone(const char *name, MEM_ROOT *mem_root);
/** This is called after create to allow us to set up cached variables */
void init()
{
@@ -1690,6 +1725,7 @@ public:
int ha_bulk_update_row(const uchar *old_data, uchar *new_data,
uint *dup_key_found);
int ha_delete_all_rows();
+ int ha_truncate();
int ha_reset_auto_increment(ulonglong value);
int ha_optimize(THD* thd, HA_CHECK_OPT* check_opt);
int ha_analyze(THD* thd, HA_CHECK_OPT* check_opt);
@@ -2049,8 +2085,33 @@ public:
{ return(NULL);} /* gets tablespace name from handler */
/** used in ALTER TABLE; 1 if changing storage engine is allowed */
virtual bool can_switch_engines() { return 1; }
- /** used in REPLACE; is > 0 if table is referred by a FOREIGN KEY */
- virtual int get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
+ /**
+ Get the list of foreign keys in this table.
+
+ @remark Returns the set of foreign keys where this table is the
+ dependent or child table.
+
+ @param thd The thread handle.
+ @param f_key_list[out] The list of foreign keys.
+
+ @return The handler error code or zero for success.
+ */
+ virtual int
+ get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
+ { return 0; }
+ /**
+ Get the list of foreign keys referencing this table.
+
+ @remark Returns the set of foreign keys where this table is the
+ referenced or parent table.
+
+ @param thd The thread handle.
+ @param f_key_list[out] The list of foreign keys.
+
+ @return The handler error code or zero for success.
+ */
+ virtual int
+ get_parent_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
{ return 0; }
virtual uint referenced_by_foreign_key() { return 0;}
virtual void init_table_handle_for_HANDLER()
@@ -2084,8 +2145,36 @@ public:
virtual ulong index_flags(uint idx, uint part, bool all_parts) const =0;
- virtual int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys)
+/**
+ First phase of in-place add index.
+ Handlers are supposed to create new indexes here but not make them
+ visible.
+
+ @param table_arg Table to add index to
+ @param key_info Information about new indexes
+ @param num_of_key Number of new indexes
+ @param add[out] Context of handler specific information needed
+ for final_add_index().
+
+ @note This function can be called with less than exclusive metadata
+ lock depending on which flags are listed in alter_table_flags.
+*/
+ virtual int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys,
+ handler_add_index **add)
{ return (HA_ERR_WRONG_COMMAND); }
+
+/**
+ Second and last phase of in-place add index.
+ Commit or rollback pending new indexes.
+
+ @param add Context of handler specific information from add_index().
+ @param commit If true, commit. If false, rollback index changes.
+
+ @note This function is called with exclusive metadata lock.
+*/
+ virtual int final_add_index(handler_add_index *add, bool commit)
+ { return (HA_ERR_WRONG_COMMAND); }
+
virtual int prepare_drop_index(TABLE *table_arg, uint *key_num,
uint num_of_keys)
{ return (HA_ERR_WRONG_COMMAND); }
@@ -2411,7 +2500,10 @@ private:
upon the table.
*/
virtual int repair(THD* thd, HA_CHECK_OPT* check_opt)
- { return HA_ADMIN_NOT_IMPLEMENTED; }
+ {
+ DBUG_ASSERT(!(ha_table_flags() & HA_CAN_REPAIR));
+ return HA_ADMIN_NOT_IMPLEMENTED;
+ }
virtual void start_bulk_insert(ha_rows rows) {}
virtual int end_bulk_insert() { return 0; }
virtual int index_read(uchar * buf, const uchar * key, uint key_len,
@@ -2440,16 +2532,34 @@ private:
This is called to delete all rows in a table
If the handler don't support this, then this function will
return HA_ERR_WRONG_COMMAND and MySQL will delete the rows one
- by one. It should reset auto_increment if
- thd->lex->sql_command == SQLCOM_TRUNCATE.
+ by one.
*/
virtual int delete_all_rows()
{ return (my_errno=HA_ERR_WRONG_COMMAND); }
/**
+ Quickly remove all rows from a table.
+
+ @remark This method is responsible for implementing MySQL's TRUNCATE
+ TABLE statement, which is a DDL operation. As such, a engine
+ can bypass certain integrity checks and in some cases avoid
+ fine-grained locking (e.g. row locks) which would normally be
+ required for a DELETE statement.
+
+ @remark Typically, truncate is not used if it can result in integrity
+ violation. For example, truncate is not used when a foreign
+ key references the table, but it might be used if foreign key
+ checks are disabled.
+
+ @remark Engine is responsible for resetting the auto-increment counter.
+
+ @remark The table is locked in exclusive mode.
+ */
+ virtual int truncate()
+ { return HA_ERR_WRONG_COMMAND; }
+ /**
Reset the auto-increment counter to the given value, i.e. the next row
- inserted will get the given value. This is called e.g. after TRUNCATE
- is emulated by doing a 'DELETE FROM t'. HA_ERR_WRONG_COMMAND is
- returned by storage engines that don't support this operation.
+ inserted will get the given value. HA_ERR_WRONG_COMMAND is returned by
+ storage engines that don't support this operation.
*/
virtual int reset_auto_increment(ulonglong value)
{ return HA_ERR_WRONG_COMMAND; }
diff --git a/sql/hostname.cc b/sql/hostname.cc
index 5311d9ada73..d34df68587c 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -366,41 +366,35 @@ bool ip_to_hostname(struct sockaddr_storage *ip_storage,
err_code= vio_getnameinfo(ip, hostname_buffer, NI_MAXHOST, NULL, 0,
NI_NAMEREQD);
- if (err_code == EAI_NONAME)
+ if (err_code)
{
- /*
- There is no reverse address mapping for the IP address. A host name
- can not be resolved.
- */
+ // NOTE: gai_strerror() returns a string ending by a dot.
- DBUG_PRINT("error", ("IP address '%s' could not be resolved: "
- "no reverse address mapping.",
- (const char *) ip_key));
+ DBUG_PRINT("error", ("IP address '%s' could not be resolved: %s",
+ (const char *) ip_key,
+ (const char *) gai_strerror(err_code)));
- sql_print_warning("IP address '%s' could not be resolved: "
- "no reverse address mapping.",
- (const char *) ip_key);
+ sql_print_warning("IP address '%s' could not be resolved: %s",
+ (const char *) ip_key,
+ (const char *) gai_strerror(err_code));
- err_status= add_hostname(ip_key, NULL);
+ if (vio_is_no_name_error(err_code))
+ {
+ /*
+ The no-name error means that there is no reverse address mapping
+ for the IP address. A host name can not be resolved.
- *hostname= NULL;
- *connect_errors= 0; /* New IP added to the cache. */
+ If it is not the no-name error, we should not cache the hostname
+ (or rather its absence), because the failure might be transient.
+ */
- DBUG_RETURN(err_status);
- }
- else if (err_code)
- {
- DBUG_PRINT("error", ("IP address '%s' could not be resolved: "
- "getnameinfo() returned %d.",
- (const char *) ip_key,
- (int) err_code));
+ add_hostname(ip_key, NULL);
- sql_print_warning("IP address '%s' could not be resolved: "
- "getnameinfo() returned error (code: %d).",
- (const char *) ip_key,
- (int) err_code);
+ *hostname= NULL;
+ *connect_errors= 0; /* New IP added to the cache. */
+ }
- DBUG_RETURN(TRUE);
+ DBUG_RETURN(FALSE);
}
DBUG_PRINT("info", ("IP '%s' resolved to '%s'.",
diff --git a/sql/item.cc b/sql/item.cc
index f2e9e8202c5..41228e532d5 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -230,8 +230,6 @@ bool Item::val_bool()
*/
String *Item::val_str_ascii(String *str)
{
- DBUG_ASSERT(fixed == 1);
-
if (!(collation.collation->state & MY_CS_NONASCII))
return val_str(str);
@@ -588,7 +586,7 @@ void Item::rename(char *new_name)
Item* Item::transform(Item_transformer transformer, uchar *arg)
{
- DBUG_ASSERT(!current_thd->is_stmt_prepare());
+ DBUG_ASSERT(!current_thd->stmt_arena->is_stmt_prepare());
return (this->*transformer)(arg);
}
@@ -1061,8 +1059,12 @@ bool Item::get_date(MYSQL_TIME *ltime,uint fuzzydate)
}
else
{
- longlong value= val_int();
int was_cut;
+ longlong value= val_int();
+
+ if (null_value)
+ goto err;
+
if (number_to_datetime(value, ltime, fuzzydate, &was_cut) == LL(-1))
{
char buff[22], *end;
@@ -1123,7 +1125,9 @@ int Item::save_in_field_no_warnings(Field *field, bool no_conversions)
ulonglong sql_mode= thd->variables.sql_mode;
thd->variables.sql_mode&= ~(MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE);
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
+
res= save_in_field(field, no_conversions);
+
thd->count_cuted_fields= tmp;
dbug_tmp_restore_column_map(table->write_set, old_map);
thd->variables.sql_mode= sql_mode;
@@ -1806,7 +1810,8 @@ bool agg_item_collations(DTCollation &c, const char *fname,
}
/* If all arguments where numbers, reset to @@collation_connection */
- if (c.derivation == DERIVATION_NUMERIC)
+ if (flags & MY_COLL_ALLOW_NUMERIC_CONV &&
+ c.derivation == DERIVATION_NUMERIC)
c.set(Item::default_charset(), DERIVATION_COERCIBLE, MY_REPERTOIRE_NUMERIC);
return FALSE;
@@ -1840,15 +1845,17 @@ bool agg_item_set_converter(DTCollation &coll, const char *fname,
}
THD *thd= current_thd;
- Query_arena *arena, backup;
bool res= FALSE;
uint i;
+
/*
In case we're in statement prepare, create conversion item
in its memory: it will be reused on each execute.
*/
- arena= thd->is_stmt_prepare() ? thd->activate_stmt_arena_if_needed(&backup)
- : NULL;
+ Query_arena backup;
+ Query_arena *arena= thd->stmt_arena->is_stmt_prepare() ?
+ thd->activate_stmt_arena_if_needed(&backup) :
+ NULL;
for (i= 0, arg= args; i < nargs; i++, arg+= item_sep)
{
@@ -1879,6 +1886,7 @@ bool agg_item_set_converter(DTCollation &coll, const char *fname,
if (!(conv= (*arg)->safe_charset_converter(coll.collation)) &&
((*arg)->collation.repertoire == MY_REPERTOIRE_ASCII))
+#if 0
{
/*
We should disable const subselect item evaluation because
@@ -1892,6 +1900,8 @@ bool agg_item_set_converter(DTCollation &coll, const char *fname,
thd->lex->view_prepare_mode) ? FALSE : TRUE;
conv= new Item_func_conv_charset(*arg, coll.collation, resolve_const);
}
+#endif
+ conv= new Item_func_conv_charset(*arg, coll.collation, 1);
if (!conv)
{
@@ -1917,15 +1927,16 @@ bool agg_item_set_converter(DTCollation &coll, const char *fname,
been created in prepare. In this case register the change for
rollback.
*/
- if (thd->is_stmt_prepare())
+ if (thd->stmt_arena->is_stmt_prepare())
*arg= conv;
else
thd->change_item_tree(arg, conv);
- /*
- We do not check conv->fixed, because Item_func_conv_charset which can
- be return by safe_charset_converter can't be fixed at creation
- */
- conv->fix_fields(thd, arg);
+
+ if (conv->fix_fields(thd, arg))
+ {
+ res= TRUE;
+ break; // we cannot return here, we need to restore "arena".
+ }
}
if (arena)
thd->restore_active_arena(arena, &backup);
@@ -2079,6 +2090,61 @@ Item_field::Item_field(THD *thd, Item_field *item)
collation.set(DERIVATION_IMPLICIT);
}
+
+/**
+ Calculate the max column length not taking into account the
+ limitations over integer types.
+
+ When storing data into fields the server currently just ignores the
+ limits specified on integer types, e.g. 1234 can safely be stored in
+ an int(2) and will not cause an error.
+ Thus when creating temporary tables and doing transformations
+ we must adjust the maximum field length to reflect this fact.
+ We take the un-restricted maximum length and adjust it similarly to
+ how the declared length is adjusted wrt unsignedness etc.
+ TODO: this all needs to go when we disable storing 1234 in int(2).
+
+ @param field_par Original field the use to calculate the lengths
+ @param max_length Item's calculated explicit max length
+ @return The adjusted max length
+*/
+
+inline static uint32
+adjust_max_effective_column_length(Field *field_par, uint32 max_length)
+{
+ uint32 new_max_length= field_par->max_display_length();
+ uint32 sign_length= (field_par->flags & UNSIGNED_FLAG) ? 0 : 1;
+
+ switch (field_par->type())
+ {
+ case MYSQL_TYPE_INT24:
+ /*
+ Compensate for MAX_MEDIUMINT_WIDTH being 1 too long (8)
+ compared to the actual number of digits that can fit into
+ the column.
+ */
+ new_max_length+= 1;
+ /* fall through */
+ case MYSQL_TYPE_LONG:
+ case MYSQL_TYPE_TINY:
+ case MYSQL_TYPE_SHORT:
+
+ /* Take out the sign and add a conditional sign */
+ new_max_length= new_max_length - 1 + sign_length;
+ break;
+
+ /* BINGINT is always 20 no matter the sign */
+ case MYSQL_TYPE_LONGLONG:
+ /* make gcc happy */
+ default:
+ break;
+ }
+
+ /* Adjust only if the actual precision based one is bigger than specified */
+ return new_max_length > max_length ? new_max_length : max_length;
+}
+
+
void Item_field::set_field(Field *field_par)
{
field=result_field=field_par; // for easy coding with fields
@@ -2092,6 +2158,9 @@ void Item_field::set_field(Field *field_par)
collation.set(field_par->charset(), field_par->derivation(),
field_par->repertoire());
fix_char_length(field_par->char_length());
+
+ max_length= adjust_max_effective_column_length(field_par, max_length);
+
fixed= 1;
if (field->table->s->tmp_table == SYSTEM_TMP_TABLE)
any_privileges= 0;
@@ -2625,7 +2694,9 @@ my_decimal *Item_float::val_decimal(my_decimal *decimal_value)
void Item_string::print(String *str, enum_query_type query_type)
{
- if (query_type == QT_ORDINARY && is_cs_specified())
+ const bool print_introducer=
+ !(query_type & QT_WITHOUT_INTRODUCERS) && is_cs_specified();
+ if (print_introducer)
{
str->append('_');
str->append(collation.collation->csname);
@@ -2633,27 +2704,52 @@ void Item_string::print(String *str, enum_query_type query_type)
str->append('\'');
- if (query_type == QT_ORDINARY ||
- my_charset_same(str_value.charset(), system_charset_info))
+ if (query_type & QT_TO_SYSTEM_CHARSET)
{
- str_value.print(str);
- }
- else
- {
- THD *thd= current_thd;
- LEX_STRING utf8_lex_str;
+ if (print_introducer)
+ {
+ /*
+ Because we wrote an introducer, we must print str_value in its
+ charset, and the resulting bytes must not be changed until they
+ reach the end client.
+ But the caller is asking for system_charset_info, and may later
+ convert into character_set_results. That means two conversions: we
+ must ensure that they don't change our printed bytes.
+ So we print str_value in the least common denominator of the three
+ charsets involved: ASCII. Non-ASCII characters are printed as \xFF
+ sequences (which is ASCII too). This way, our bytes will not be
+ changed.
+ */
+ ErrConvString tmp(str_value.ptr(), str_value.length(), &my_charset_bin);
+ str->append(tmp.ptr());
+ }
+ else
+ {
+ if (my_charset_same(str_value.charset(), system_charset_info))
+ str_value.print(str); // already in system_charset_info
+ else // need to convert
+ {
+ THD *thd= current_thd;
+ LEX_STRING utf8_lex_str;
- thd->convert_string(&utf8_lex_str,
- system_charset_info,
- str_value.c_ptr_safe(),
- str_value.length(),
- str_value.charset());
+ thd->convert_string(&utf8_lex_str,
+ system_charset_info,
+ str_value.c_ptr_safe(),
+ str_value.length(),
+ str_value.charset());
- String utf8_str(utf8_lex_str.str,
- utf8_lex_str.length,
- system_charset_info);
+ String utf8_str(utf8_lex_str.str,
+ utf8_lex_str.length,
+ system_charset_info);
- utf8_str.print(str);
+ utf8_str.print(str);
+ }
+ }
+ }
+ else
+ {
+ // Caller wants a result in the charset of str_value.
+ str_value.print(str);
}
str->append('\'');
@@ -2969,6 +3065,16 @@ bool Item_param::set_longdata(const char *str, ulong length)
(here), and first have to concatenate all pieces together,
write query to the binary log and only then perform conversion.
*/
+ if (str_value.length() + length > max_long_data_size)
+ {
+ my_message(ER_UNKNOWN_ERROR,
+ "Parameter of prepared statement which is set through "
+ "mysql_send_long_data() is longer than "
+ "'max_long_data_size' bytes",
+ MYF(0));
+ DBUG_RETURN(true);
+ }
+
if (str_value.append(str, length, &my_charset_bin))
DBUG_RETURN(TRUE);
state= LONG_DATA_VALUE;
@@ -3559,19 +3665,16 @@ Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it)
str_value.charset());
collation.set(str_value.charset(), DERIVATION_COERCIBLE);
decimals= 0;
- param_type= MYSQL_TYPE_STRING;
break;
}
case REAL_RESULT:
set_double(arg->val_real());
- param_type= MYSQL_TYPE_DOUBLE;
break;
case INT_RESULT:
set_int(arg->val_int(), arg->max_length);
- param_type= MYSQL_TYPE_LONG;
break;
case DECIMAL_RESULT:
@@ -3583,8 +3686,6 @@ Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it)
return TRUE;
set_decimal(dv);
- param_type= MYSQL_TYPE_NEWDECIMAL;
-
break;
}
@@ -3616,6 +3717,7 @@ void
Item_param::set_out_param_info(Send_field *info)
{
m_out_param_info= info;
+ param_type= m_out_param_info->type;
}
@@ -3661,6 +3763,7 @@ void Item_param::make_field(Send_field *field)
field->org_table_name= m_out_param_info->org_table_name;
field->col_name= m_out_param_info->col_name;
field->org_col_name= m_out_param_info->org_col_name;
+
field->length= m_out_param_info->length;
field->charsetnr= m_out_param_info->charsetnr;
field->flags= m_out_param_info->flags;
@@ -5679,17 +5782,43 @@ static uint nr_of_decimals(const char *str, const char *end)
break;
}
decimal_point= str;
- for (; my_isdigit(system_charset_info, *str) ; str++)
+ for ( ; str < end && my_isdigit(system_charset_info, *str) ; str++)
;
- if (*str == 'e' || *str == 'E')
+ if (str < end && (*str == 'e' || *str == 'E'))
return NOT_FIXED_DEC;
+ /*
+ QQ:
+ The number of decimal digist in fact should be (str - decimal_point - 1).
+ But it seems the result of nr_of_decimals() is never used!
+
+ In case of 'e' and 'E' nr_of_decimals returns NOT_FIXED_DEC.
+ In case if there is no 'e' or 'E' parser code in sql_yacc.yy
+ never calls Item_float::Item_float() - it creates Item_decimal instead.
+
+ The only piece of code where we call Item_float::Item_float(str, len)
+ without having 'e' or 'E' is item_xmlfunc.cc, but this Item_float
+ never appears in metadata itself. Changing the code to return
+ (str - decimal_point - 1) does not make any changes in the test results.
+
+ This should be addressed somehow.
+ Looks like a reminder from before real DECIMAL times.
+ */
return (uint) (str - decimal_point);
}
/**
- This function is only called during parsing. We will signal an error if
- value is not a true double value (overflow)
+ This function is only called during parsing:
+ - when parsing SQL query from sql_yacc.yy
+ - when parsing XPath query from item_xmlfunc.cc
+ We will signal an error if value is not a true double value (overflow):
+ eng: Illegal %s '%-.192s' value found during parsing
+
+ Note: the string is NOT null terminated when called from item_xmlfunc.cc,
+ so this->name will contain some SQL query tail behind the "length" bytes.
+ This is Ok for now, as this Item is never seen in SHOW,
+ or EXPLAIN, or anywhere else in metadata.
+ Item->name should be fixed to use LEX_STRING eventually.
*/
Item_float::Item_float(const char *str_arg, uint length)
@@ -5700,12 +5829,9 @@ Item_float::Item_float(const char *str_arg, uint length)
&error);
if (error)
{
- /*
- Note that we depend on that str_arg is null terminated, which is true
- when we are in the parser
- */
- DBUG_ASSERT(str_arg[length] == 0);
- my_error(ER_ILLEGAL_VALUE_FOR_TYPE, MYF(0), "double", (char*) str_arg);
+ char tmp[NAME_LEN + 1];
+ my_snprintf(tmp, sizeof(tmp), "%.*s", length, str_arg);
+ my_error(ER_ILLEGAL_VALUE_FOR_TYPE, MYF(0), "double", tmp);
}
presentation= name=(char*) str_arg;
decimals=(uint8) nr_of_decimals(str_arg, str_arg+length);
@@ -5977,6 +6103,10 @@ bool Item::send(Protocol *protocol, String *buffer)
String *res;
if ((res=val_str(buffer)))
result= protocol->store(res->ptr(),res->length(),res->charset());
+ else
+ {
+ DBUG_ASSERT(null_value);
+ }
break;
}
case MYSQL_TYPE_TINY:
@@ -6626,7 +6756,7 @@ void Item_ref::print(String *str, enum_query_type query_type)
{
THD *thd= current_thd;
append_identifier(thd, str, (*ref)->real_item()->name,
- (*ref)->real_item()->name_length);
+ strlen((*ref)->real_item()->name));
}
else
(*ref)->print(str, query_type);
@@ -7574,7 +7704,7 @@ int Item_default_value::save_in_field(Field *field_arg, bool no_conversions)
Item *Item_default_value::transform(Item_transformer transformer, uchar *args)
{
- DBUG_ASSERT(!current_thd->is_stmt_prepare());
+ DBUG_ASSERT(!current_thd->stmt_arena->is_stmt_prepare());
/*
If the value of arg is NULL, then this object represents a constant,
@@ -7740,8 +7870,26 @@ bool Item_trigger_field::set_value(THD *thd, sp_rcontext * /*ctx*/, Item **it)
{
Item *item= sp_prepare_func_item(thd, it);
- return (!item || (!fixed && fix_fields(thd, 0)) ||
- (item->save_in_field(field, 0) < 0));
+ if (!item)
+ return true;
+
+ if (!fixed)
+ {
+ if (fix_fields(thd, NULL))
+ return true;
+ }
+
+ // NOTE: field->table->copy_blobs should be false here, but let's
+ // remember the value at runtime to avoid subtle bugs.
+ bool copy_blobs_saved= field->table->copy_blobs;
+
+ field->table->copy_blobs= true;
+
+ int err_code= item->save_in_field(field, 0);
+
+ field->table->copy_blobs= copy_blobs_saved;
+
+ return err_code < 0;
}
@@ -8022,9 +8170,10 @@ Item_cache* Item_cache::get_cache(const Item *item, const Item_result type)
case DECIMAL_RESULT:
return new Item_cache_decimal();
case STRING_RESULT:
- if (item->field_type() == MYSQL_TYPE_DATE ||
- item->field_type() == MYSQL_TYPE_DATETIME ||
- item->field_type() == MYSQL_TYPE_TIME)
+ /* Not all functions that return DATE/TIME are actually DATE/TIME funcs. */
+ if ((item->is_datetime() ||
+ item->field_type() == MYSQL_TYPE_TIME) &&
+ (const_cast<Item*>(item))->result_as_longlong())
return new Item_cache_datetime(item->field_type());
return new Item_cache_str(item);
case ROW_RESULT:
@@ -8081,7 +8230,7 @@ String *Item_cache_int::val_str(String *str)
DBUG_ASSERT(fixed == 1);
if (!has_value())
return NULL;
- str->set(value, default_charset());
+ str->set_int(value, unsigned_flag, default_charset());
return str;
}
@@ -8114,16 +8263,43 @@ longlong Item_cache_int::val_int()
bool Item_cache_datetime::cache_value_int()
{
if (!example)
- return FALSE;
+ return false;
- value_cached= TRUE;
+ value_cached= true;
// Mark cached string value obsolete
- str_value_cached= FALSE;
- /* Assume here that the underlying item will do correct conversion.*/
- int_value= example->val_int_result();
+ str_value_cached= false;
+
+ MYSQL_TIME ltime;
+ const bool eval_error=
+ (field_type() == MYSQL_TYPE_TIME) ?
+ example->get_time(&ltime) :
+ example->get_date(&ltime, TIME_FUZZY_DATE);
+
+ if (eval_error)
+ int_value= 0;
+ else
+ {
+ switch(field_type())
+ {
+ case MYSQL_TYPE_DATETIME:
+ case MYSQL_TYPE_TIMESTAMP:
+ int_value= TIME_to_ulonglong_datetime(&ltime);
+ break;
+ case MYSQL_TYPE_TIME:
+ int_value= TIME_to_ulonglong_time(&ltime);
+ break;
+ default:
+ int_value= TIME_to_ulonglong_date(&ltime);
+ break;
+ }
+ if (ltime.neg)
+ int_value= -int_value;
+ }
+
null_value= example->null_value;
unsigned_flag= example->unsigned_flag;
- return TRUE;
+
+ return true;
}
@@ -8158,9 +8334,19 @@ void Item_cache_datetime::store(Item *item, longlong val_arg)
}
+void Item_cache_datetime::store(Item *item)
+{
+ Item_cache::store(item);
+ str_value_cached= FALSE;
+}
+
String *Item_cache_datetime::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
+
+ if ((value_cached || str_value_cached) && null_value)
+ return NULL;
+
if (!str_value_cached)
{
/*
@@ -8174,6 +8360,8 @@ String *Item_cache_datetime::val_str(String *str)
if (value_cached)
{
MYSQL_TIME ltime;
+ /* Return NULL in case of OOM/conversion error. */
+ null_value= TRUE;
if (str_value.alloc(MAX_DATE_STRING_REP_LENGTH))
return NULL;
if (cached_field_type == MYSQL_TYPE_TIME)
@@ -8196,13 +8384,14 @@ String *Item_cache_datetime::val_str(String *str)
{
int was_cut;
longlong res;
- res= number_to_datetime(val_int(), &ltime, TIME_FUZZY_DATE, &was_cut);
+ res= number_to_datetime(int_value, &ltime, TIME_FUZZY_DATE, &was_cut);
if (res == -1)
return NULL;
}
str_value.length(my_TIME_to_str(&ltime,
const_cast<char*>(str_value.ptr())));
str_value_cached= TRUE;
+ null_value= FALSE;
}
else if (!cache_value())
return NULL;
@@ -8223,7 +8412,7 @@ my_decimal *Item_cache_datetime::val_decimal(my_decimal *decimal_val)
double Item_cache_datetime::val_real()
{
DBUG_ASSERT(fixed == 1);
- if (!value_cached && !cache_value_int())
+ if ((!value_cached && !cache_value_int()) || null_value)
return 0.0;
return (double) int_value;
}
@@ -8231,7 +8420,7 @@ double Item_cache_datetime::val_real()
longlong Item_cache_datetime::val_int()
{
DBUG_ASSERT(fixed == 1);
- if (!value_cached && !cache_value_int())
+ if ((!value_cached && !cache_value_int()) || null_value)
return 0;
return int_value;
}
diff --git a/sql/item.h b/sql/item.h
index 26ee946f147..b13438b248f 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1,7 +1,7 @@
#ifndef SQL_ITEM_INCLUDED
#define SQL_ITEM_INCLUDED
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -70,6 +70,8 @@ char_to_byte_length_safe(uint32 char_length_arg, uint32 mbmaxlen_arg)
(i.e. constant).
MY_COLL_ALLOW_CONV - allow any kind of conversion
(combination of the above two)
+ MY_COLL_ALLOW_NUMERIC_CONV - if all items were numbers, convert to
+ @@character_set_connection
MY_COLL_DISALLOW_NONE - don't allow return DERIVATION_NONE
(e.g. when aggregating for comparison)
MY_COLL_CMP_CONV - combination of MY_COLL_ALLOW_CONV
@@ -79,6 +81,7 @@ char_to_byte_length_safe(uint32 char_length_arg, uint32 mbmaxlen_arg)
#define MY_COLL_ALLOW_SUPERSET_CONV 1
#define MY_COLL_ALLOW_COERCIBLE_CONV 2
#define MY_COLL_DISALLOW_NONE 4
+#define MY_COLL_ALLOW_NUMERIC_CONV 8
#define MY_COLL_ALLOW_CONV (MY_COLL_ALLOW_SUPERSET_CONV | MY_COLL_ALLOW_COERCIBLE_CONV)
#define MY_COLL_CMP_CONV (MY_COLL_ALLOW_CONV | MY_COLL_DISALLOW_NONE)
@@ -568,6 +571,10 @@ public:
*/
Item *next;
uint32 max_length; /* Maximum length, in bytes */
+ /*
+ TODO: convert name and name_length fields into String to keep them in sync
+ (see bug #11829681/60295 etc).
+ */
uint name_length; /* Length of name */
int8 marker;
uint8 decimals;
@@ -1188,11 +1195,11 @@ public:
virtual bool set_no_const_sub(uchar *arg) { return FALSE; }
virtual Item *replace_equal_field(uchar * arg) { return this; }
/*
- Check if an expression value depends on the current timezone. Used by
- partitioning code to reject timezone-dependent expressions in a
- (sub)partitioning function.
+ Check if an expression value has allowed arguments, like DATE/DATETIME
+ for date functions. Also used by partitioning code to reject
+ timezone-dependent expressions in a (sub)partitioning function.
*/
- virtual bool is_timezone_dependent_processor(uchar *bool_arg)
+ virtual bool check_valid_arguments_processor(uchar *bool_arg)
{
return FALSE;
}
@@ -1353,7 +1360,7 @@ public:
maybe_null= 1;
}
else
- max_length= max_result_length;
+ max_length= (uint32) max_result_length;
}
void fix_length_and_charset_datetime(uint32 max_char_length_arg)
{
@@ -1708,7 +1715,8 @@ agg_item_charsets_for_string_result(DTCollation &c, const char *name,
int item_sep= 1)
{
uint flags= MY_COLL_ALLOW_SUPERSET_CONV |
- MY_COLL_ALLOW_COERCIBLE_CONV;
+ MY_COLL_ALLOW_COERCIBLE_CONV |
+ MY_COLL_ALLOW_NUMERIC_CONV;
return agg_item_charsets(c, name, items, nitems, flags, item_sep);
}
inline bool
@@ -1721,6 +1729,19 @@ agg_item_charsets_for_comparison(DTCollation &c, const char *name,
MY_COLL_DISALLOW_NONE;
return agg_item_charsets(c, name, items, nitems, flags, item_sep);
}
+inline bool
+agg_item_charsets_for_string_result_with_comparison(DTCollation &c,
+ const char *name,
+ Item **items, uint nitems,
+ int item_sep= 1)
+{
+ uint flags= MY_COLL_ALLOW_SUPERSET_CONV |
+ MY_COLL_ALLOW_COERCIBLE_CONV |
+ MY_COLL_ALLOW_NUMERIC_CONV |
+ MY_COLL_DISALLOW_NONE;
+ return agg_item_charsets(c, name, items, nitems, flags, item_sep);
+}
+
class Item_num: public Item_basic_constant
{
@@ -1816,6 +1837,8 @@ public:
String *val_str(String *str) { return field->val_str(str); }
my_decimal *val_decimal(my_decimal *dec) { return field->val_decimal(dec); }
void make_field(Send_field *tmp_field);
+ CHARSET_INFO *charset_for_protocol(void) const
+ { return field->charset_for_protocol(); }
};
@@ -2785,7 +2808,7 @@ public:
DBUG_ASSERT(fixed);
return (*ref)->get_time(ltime);
}
- virtual bool basic_const_item() const { return (*ref)->basic_const_item(); }
+ virtual bool basic_const_item() const { return ref && (*ref)->basic_const_item(); }
bool is_outer_field() const
{
DBUG_ASSERT(fixed);
@@ -3564,11 +3587,10 @@ class Item_cache: public Item_basic_constant
protected:
Item *example;
table_map used_table_map;
- /*
- Field that this object will get value from. This is set/used by
+ /**
+ Field that this object will get value from. This is used by
index-based subquery engines to detect and remove the equality injected
by IN->EXISTS transformation.
- For all other uses of Item_cache, cached_field doesn't matter.
*/
Field *cached_field;
enum enum_field_types cached_field_type;
@@ -3642,6 +3664,14 @@ public:
{
return (value_cached || cache_value()) && !null_value;
}
+
+ /**
+ If this item caches a field value, return pointer to underlying field.
+
+ @return Pointer to field, or NULL if this is not a cache for a field value.
+ */
+ Field* field() { return cached_field; }
+
virtual void store(Item *item);
virtual bool cache_value()= 0;
bool basic_const_item() const
@@ -3809,7 +3839,7 @@ class Item_cache_datetime: public Item_cache
{
protected:
String str_value;
- ulonglong int_value;
+ longlong int_value;
bool str_value_cached;
public:
Item_cache_datetime(enum_field_types field_type_arg):
@@ -3818,8 +3848,8 @@ public:
cmp_context= STRING_RESULT;
}
- virtual void store(Item *item) { Item_cache::store(item); }
void store(Item *item, longlong val_arg);
+ void store(Item *item);
double val_real();
longlong val_int();
String* val_str(String *str);
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index e8cf6e97a28..b0c2dac7b74 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -403,7 +403,7 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
Field *field= field_item->field;
int result= 0;
- if (!(*item)->with_subselect && (*item)->const_item())
+ if ((*item)->const_item())
{
TABLE *table= field->table;
ulonglong orig_sql_mode= thd->variables.sql_mode;
@@ -499,7 +499,7 @@ void Item_bool_func2::fix_length_and_dec()
}
thd= current_thd;
- if (!thd->is_context_analysis_only())
+ if (!thd->lex->is_ps_or_view_context_analysis())
{
if (args[0]->real_item()->type() == FIELD_ITEM)
{
@@ -803,7 +803,7 @@ Arg_comparator::can_compare_as_dates(Item *a, Item *b, ulonglong *const_value)
confuse storage engines since in context analysis mode tables
aren't locked.
*/
- if (!thd->is_context_analysis_only() &&
+ if (!thd->lex->is_ps_or_view_context_analysis() &&
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))
@@ -923,7 +923,7 @@ int Arg_comparator::set_cmp_func(Item_result_field *owner_arg,
*/
Query_arena backup;
Query_arena *save_arena= thd->switch_to_arena_for_cached_items(&backup);
- Item_cache_int *cache= new Item_cache_int();
+ Item_cache_int *cache= new Item_cache_int(MYSQL_TYPE_DATETIME);
if (save_arena)
thd->set_query_arena(save_arena);
@@ -1044,7 +1044,7 @@ Item** Arg_comparator::cache_converted_constant(THD *thd_arg, Item **value,
Item_result type)
{
/* Don't need cache if doing context analysis only. */
- if (!thd_arg->is_context_analysis_only() &&
+ if (!thd->lex->is_ps_or_view_context_analysis() &&
(*value)->const_item() && type != (*value)->result_type())
{
Item_cache *cache= Item_cache::get_cache(*value, type);
@@ -1221,9 +1221,12 @@ get_year_value(THD *thd, Item ***item_arg, Item **cache_arg,
value of 2000.
*/
Item *real_item= item->real_item();
- if (!(real_item->type() == Item::FIELD_ITEM &&
- ((Item_field *)real_item)->field->type() == MYSQL_TYPE_YEAR &&
- ((Item_field *)real_item)->field->field_length == 4))
+ Field *field= NULL;
+ if (real_item->type() == Item::FIELD_ITEM)
+ field= ((Item_field *)real_item)->field;
+ else if (real_item->type() == Item::CACHE_ITEM)
+ field= ((Item_cache *)real_item)->field();
+ if (!(field && field->type() == MYSQL_TYPE_YEAR && field->field_length == 4))
{
if (value < 70)
value+= 100;
@@ -2211,7 +2214,6 @@ void Item_func_interval::fix_length_and_dec()
if (dec != &range->dec)
{
range->dec= *dec;
- range->dec.fix_buffer_pointer();
}
}
else
@@ -2763,7 +2765,7 @@ Item_func_if::fix_length_and_dec()
if (null1)
{
cached_result_type= arg2_type;
- collation.set(args[2]->collation.collation);
+ collation.set(args[2]->collation);
cached_field_type= args[2]->field_type();
max_length= args[2]->max_length;
return;
@@ -2772,7 +2774,7 @@ Item_func_if::fix_length_and_dec()
if (null2)
{
cached_result_type= arg1_type;
- collation.set(args[1]->collation.collation);
+ collation.set(args[1]->collation);
cached_field_type= args[1]->field_type();
max_length= args[1]->max_length;
return;
@@ -3154,6 +3156,14 @@ void Item_func_case::fix_length_and_dec()
{
if (agg_arg_charsets_for_string_result(collation, agg, nagg))
return;
+ /*
+ Copy all THEN and ELSE items back to args[] array.
+ Some of the items might have been changed to Item_func_conv_charset.
+ */
+ for (nagg= 0 ; nagg < ncases / 2 ; nagg++)
+ args[nagg * 2 + 1]= agg[nagg];
+ if (else_expr_num != -1)
+ args[else_expr_num]= agg[nagg++];
}
else
collation.set_numeric();
@@ -3169,20 +3179,53 @@ void Item_func_case::fix_length_and_dec()
agg[0]= args[first_expr_num];
left_result_type= agg[0]->result_type();
+ /*
+ As the first expression and WHEN expressions
+ are intermixed in args[] array THEN and ELSE items,
+ extract the first expression and all WHEN expressions into
+ a temporary array, to process them easier.
+ */
for (nagg= 0; nagg < ncases/2 ; nagg++)
agg[nagg+1]= args[nagg*2];
nagg++;
if (!(found_types= collect_cmp_types(agg, nagg)))
return;
- if (with_sum_func || current_thd->lex->current_select->group_list.elements)
+ if (found_types & (1 << STRING_RESULT))
{
/*
- See TODO commentary in the setup_copy_fields function:
- item in a group may be wrapped with an Item_copy_string item.
- That item has a STRING_RESULT result type, so we need
- to take this type into account.
+ If we'll do string comparison, we also need to aggregate
+ character set and collation for first/WHEN items and
+ install converters for some of them to cmp_collation when necessary.
+ This is done because cmp_item compatators cannot compare
+ strings in two different character sets.
+ Some examples when we install converters:
+
+ 1. Converter installed for the first expression:
+
+ CASE latin1_item WHEN utf16_item THEN ... END
+
+ is replaced to:
+
+ CASE CONVERT(latin1_item USING utf16) WHEN utf16_item THEN ... END
+
+ 2. Converter installed for the left WHEN item:
+
+ CASE utf16_item WHEN latin1_item THEN ... END
+
+ is replaced to:
+
+ CASE utf16_item WHEN CONVERT(latin1_item USING utf16) THEN ... END
*/
- found_types |= (1 << item_cmp_type(left_result_type, STRING_RESULT));
+ if (agg_arg_charsets_for_comparison(cmp_collation, agg, nagg))
+ return;
+ /*
+ Now copy first expression and all WHEN expressions back to args[]
+ arrray, because some of the items might have been changed to converters
+ (e.g. Item_func_conv_charset, or Item_string for constants).
+ */
+ args[first_expr_num]= agg[0];
+ for (nagg= 0; nagg < ncases / 2; nagg++)
+ args[nagg * 2]= agg[nagg + 1];
}
for (i= 0; i <= (uint)DECIMAL_RESULT; i++)
@@ -3190,9 +3233,6 @@ void Item_func_case::fix_length_and_dec()
if (found_types & (1 << i) && !cmp_items[i])
{
DBUG_ASSERT((Item_result)i != ROW_RESULT);
- if ((Item_result)i == STRING_RESULT &&
- agg_arg_charsets_for_comparison(cmp_collation, agg, nagg))
- return;
if (!(cmp_items[i]=
cmp_item::get_comparator((Item_result)i,
cmp_collation.collation)))
@@ -4154,13 +4194,11 @@ void Item_func_in::fix_length_and_dec()
uint j=0;
for (uint i=1 ; i < arg_count ; i++)
{
- if (!args[i]->null_value) // Skip NULL values
- {
- array->set(j,args[i]);
- j++;
- }
- else
- have_null= 1;
+ array->set(j,args[i]);
+ if (!args[i]->null_value) // Skip NULL values
+ j++;
+ else
+ have_null= 1;
}
if ((array->used_count= j))
array->sort();
@@ -4470,7 +4508,7 @@ bool Item_cond::walk(Item_processor processor, bool walk_subquery, uchar *arg)
Item *Item_cond::transform(Item_transformer transformer, uchar *arg)
{
- DBUG_ASSERT(!current_thd->is_stmt_prepare());
+ DBUG_ASSERT(!current_thd->stmt_arena->is_stmt_prepare());
List_iterator<Item> li(list);
Item *item;
@@ -4878,12 +4916,13 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
return TRUE;
}
- if (escape_item->const_item() && !thd->lex->view_prepare_mode)
+ if (escape_item->const_item())
{
/* If we are on execution stage */
String *escape_str= escape_item->val_str(&cmp.value1);
if (escape_str)
{
+ const char *escape_str_ptr= escape_str->ptr();
if (escape_used_in_parsing && (
(((thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
escape_str->numchars() != 1) ||
@@ -4898,9 +4937,9 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
CHARSET_INFO *cs= escape_str->charset();
my_wc_t wc;
int rc= cs->cset->mb_wc(cs, &wc,
- (const uchar*) escape_str->ptr(),
- (const uchar*) escape_str->ptr() +
- escape_str->length());
+ (const uchar*) escape_str_ptr,
+ (const uchar*) escape_str_ptr +
+ escape_str->length());
escape= (int) (rc > 0 ? wc : '\\');
}
else
@@ -4917,13 +4956,13 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
{
char ch;
uint errors;
- uint32 cnvlen= copy_and_convert(&ch, 1, cs, escape_str->ptr(),
+ uint32 cnvlen= copy_and_convert(&ch, 1, cs, escape_str_ptr,
escape_str->length(),
escape_str->charset(), &errors);
escape= cnvlen ? ch : '\\';
}
else
- escape= *(escape_str->ptr());
+ escape= escape_str_ptr ? *escape_str_ptr : '\\';
}
}
else
@@ -5780,21 +5819,23 @@ longlong Item_equal::val_int()
return 0;
List_iterator_fast<Item_field> it(fields);
Item *item= const_item ? const_item : it++;
- if ((null_value= item->is_null()))
- return 0;
eval_item->store_value(item);
+ if ((null_value= item->null_value))
+ return 0;
while ((item_field= it++))
{
/* Skip fields of non-const tables. They haven't been read yet */
if (item_field->field->table->const_table)
{
- if ((null_value= item_field->is_null()) || eval_item->cmp(item_field))
+ int res= eval_item->cmp(item_field);
+ if ((null_value= item_field->null_value) || res)
return 0;
}
}
return 1;
}
+
void Item_equal::fix_length_and_dec()
{
Item *item= get_first(NULL);
@@ -5816,7 +5857,7 @@ bool Item_equal::walk(Item_processor processor, bool walk_subquery, uchar *arg)
Item *Item_equal::transform(Item_transformer transformer, uchar *arg)
{
- DBUG_ASSERT(!current_thd->is_stmt_prepare());
+ DBUG_ASSERT(!current_thd->stmt_arena->is_stmt_prepare());
List_iterator<Item_field> it(fields);
Item *item;
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index fd136cfbe0d..69b22fd66d5 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1,7 +1,7 @@
#ifndef ITEM_CMPFUNC_INCLUDED
#define ITEM_CMPFUNC_INCLUDED
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 6cb45f05efc..d0f1ab54eca 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -1330,6 +1330,34 @@ protected:
};
+#ifndef DBUG_OFF
+class Create_func_like_range_min : public Create_func_arg2
+{
+public:
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+
+ static Create_func_like_range_min s_singleton;
+
+protected:
+ Create_func_like_range_min() {}
+ virtual ~Create_func_like_range_min() {}
+};
+
+
+class Create_func_like_range_max : public Create_func_arg2
+{
+public:
+ virtual Item *create(THD *thd, Item *arg1, Item *arg2);
+
+ static Create_func_like_range_max s_singleton;
+
+protected:
+ Create_func_like_range_max() {}
+ virtual ~Create_func_like_range_max() {}
+};
+#endif
+
+
class Create_func_ln : public Create_func_arg1
{
public:
@@ -3836,6 +3864,26 @@ Create_func_length::create_1_arg(THD *thd, Item *arg1)
}
+#ifndef DBUG_OFF
+Create_func_like_range_min Create_func_like_range_min::s_singleton;
+
+Item*
+Create_func_like_range_min::create(THD *thd, Item *arg1, Item *arg2)
+{
+ return new (thd->mem_root) Item_func_like_range_min(arg1, arg2);
+}
+
+
+Create_func_like_range_max Create_func_like_range_max::s_singleton;
+
+Item*
+Create_func_like_range_max::create(THD *thd, Item *arg1, Item *arg2)
+{
+ return new (thd->mem_root) Item_func_like_range_max(arg1, arg2);
+}
+#endif
+
+
Create_func_ln Create_func_ln::s_singleton;
Item*
@@ -4927,6 +4975,10 @@ static Native_func_registry func_array[] =
{ { 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)},
+#ifndef DBUG_OFF
+ { { C_STRING_WITH_LEN("LIKE_RANGE_MIN") }, BUILDER(Create_func_like_range_min)},
+ { { C_STRING_WITH_LEN("LIKE_RANGE_MAX") }, BUILDER(Create_func_like_range_max)},
+#endif
{ { 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)},
@@ -5166,8 +5218,8 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type,
decoded_size= strtoul(c_len, NULL, 10);
if (errno != 0)
{
- my_error(ER_TOO_BIG_PRECISION, MYF(0), c_len, a->name,
- DECIMAL_MAX_PRECISION);
+ my_error(ER_TOO_BIG_PRECISION, MYF(0), INT_MAX, a->name,
+ static_cast<ulong>(DECIMAL_MAX_PRECISION));
return NULL;
}
len= decoded_size;
@@ -5180,8 +5232,8 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type,
decoded_size= strtoul(c_dec, NULL, 10);
if ((errno != 0) || (decoded_size > UINT_MAX))
{
- my_error(ER_TOO_BIG_SCALE, MYF(0), c_dec, a->name,
- DECIMAL_MAX_SCALE);
+ my_error(ER_TOO_BIG_SCALE, MYF(0), INT_MAX, a->name,
+ static_cast<ulong>(DECIMAL_MAX_SCALE));
return NULL;
}
dec= decoded_size;
@@ -5194,14 +5246,14 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type,
}
if (len > DECIMAL_MAX_PRECISION)
{
- my_error(ER_TOO_BIG_PRECISION, MYF(0), len, a->name,
- DECIMAL_MAX_PRECISION);
+ my_error(ER_TOO_BIG_PRECISION, MYF(0), static_cast<int>(len), a->name,
+ static_cast<ulong>(DECIMAL_MAX_PRECISION));
return 0;
}
if (dec > DECIMAL_MAX_SCALE)
{
my_error(ER_TOO_BIG_SCALE, MYF(0), dec, a->name,
- DECIMAL_MAX_SCALE);
+ static_cast<ulong>(DECIMAL_MAX_SCALE));
return 0;
}
res= new (thd->mem_root) Item_decimal_typecast(a, len, dec);
diff --git a/sql/item_func.cc b/sql/item_func.cc
index fb4883ec393..7eea131e648 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,8 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -52,6 +51,8 @@
#include "sp.h"
#include "set_var.h"
#include "debug_sync.h"
+#include <mysql/plugin.h>
+#include <mysql/service_thd_wait.h>
#ifdef NO_EMBEDDED_ACCESS_CHECKS
#define sp_restore_security_context(A,B) while (0) {}
@@ -180,7 +181,14 @@ Item_func::fix_fields(THD *thd, Item **ref)
used_tables_cache= not_null_tables_cache= 0;
const_item_cache=1;
- if (check_stack_overrun(thd, STACK_MIN_SIZE, buff))
+ /*
+ Use stack limit of STACK_MIN_SIZE * 2 since
+ on some platforms a recursive call to fix_fields
+ requires more than STACK_MIN_SIZE bytes (e.g. for
+ MIPS, it takes about 22kB to make one recursive
+ call to Item_func::fix_fields())
+ */
+ if (check_stack_overrun(thd, STACK_MIN_SIZE * 2, buff))
return TRUE; // Fatal error if flag is set!
if (arg_count)
{ // Print purify happy
@@ -311,7 +319,7 @@ void Item_func::traverse_cond(Cond_traverser traverser,
Item *Item_func::transform(Item_transformer transformer, uchar *argument)
{
- DBUG_ASSERT(!current_thd->is_stmt_prepare());
+ DBUG_ASSERT(!current_thd->stmt_arena->is_stmt_prepare());
if (arg_count)
{
@@ -522,7 +530,10 @@ bool Item_func::is_expensive_processor(uchar *arg)
my_decimal *Item_func::val_decimal(my_decimal *decimal_value)
{
DBUG_ASSERT(fixed);
- int2my_decimal(E_DEC_FATAL_ERROR, val_int(), unsigned_flag, decimal_value);
+ longlong nr= val_int();
+ if (null_value)
+ return 0; /* purecov: inspected */
+ int2my_decimal(E_DEC_FATAL_ERROR, nr, unsigned_flag, decimal_value);
return decimal_value;
}
@@ -883,7 +894,7 @@ longlong Item_func_numhybrid::val_int()
return 0;
char *end= (char*) res->ptr() + res->length();
- CHARSET_INFO *cs= str_value.charset();
+ CHARSET_INFO *cs= res->charset();
return (*(cs->cset->strtoll10))(cs, res->ptr(), &end, &err_not_used);
}
default:
@@ -1108,7 +1119,7 @@ err:
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_OUT_OF_RANGE,
ER(ER_WARN_DATA_OUT_OF_RANGE),
- name, 1);
+ name, 1L);
return dec;
}
@@ -1560,9 +1571,14 @@ void Item_func_div::fix_length_and_dec()
{
decimals=max(args[0]->decimals,args[1]->decimals)+prec_increment;
set_if_smaller(decimals, NOT_FIXED_DEC);
- max_length=args[0]->max_length - args[0]->decimals + decimals;
uint tmp=float_length(decimals);
- set_if_smaller(max_length,tmp);
+ if (decimals == NOT_FIXED_DEC)
+ max_length= tmp;
+ else
+ {
+ max_length=args[0]->max_length - args[0]->decimals + decimals;
+ set_if_smaller(max_length,tmp);
+ }
break;
}
case INT_RESULT:
@@ -1593,24 +1609,27 @@ longlong Item_func_int_div::val_int()
if (args[0]->result_type() != INT_RESULT ||
args[1]->result_type() != INT_RESULT)
{
- my_decimal value0, value1, tmp;
- my_decimal *val0, *val1;
- longlong res;
- int err;
+ my_decimal tmp;
+ my_decimal *val0p= args[0]->val_decimal(&tmp);
+ if ((null_value= args[0]->null_value))
+ return 0;
+ my_decimal val0= *val0p;
- val0= args[0]->val_decimal(&value0);
- val1= args[1]->val_decimal(&value1);
- if ((null_value= (args[0]->null_value || args[1]->null_value)))
+ my_decimal *val1p= args[1]->val_decimal(&tmp);
+ if ((null_value= args[1]->null_value))
return 0;
+ my_decimal val1= *val1p;
+ int err;
if ((err= my_decimal_div(E_DEC_FATAL_ERROR & ~E_DEC_DIV_ZERO, &tmp,
- val0, val1, 0)) > 3)
+ &val0, &val1, 0)) > 3)
{
if (err == E_DEC_DIV_ZERO)
signal_divide_by_null();
return 0;
}
+ longlong res;
if (my_decimal2int(E_DEC_FATAL_ERROR, &tmp, unsigned_flag, &res) &
E_DEC_OVERFLOW)
raise_integer_overflow();
@@ -2097,9 +2116,10 @@ void Item_func_integer::fix_length_and_dec()
void Item_func_int_val::fix_num_length_and_dec()
{
- max_length= args[0]->max_length - (args[0]->decimals ?
- args[0]->decimals + 1 :
- 0) + 2;
+ ulonglong tmp_max_length= (ulonglong ) args[0]->max_length -
+ (args[0]->decimals ? args[0]->decimals + 1 : 0) + 2;
+ max_length= tmp_max_length > (ulonglong) 4294967295U ?
+ (uint32) 4294967295U : (uint32) tmp_max_length;
uint tmp= float_length(decimals);
set_if_smaller(max_length,tmp);
decimals= 0;
@@ -2263,6 +2283,9 @@ void Item_func_round::fix_length_and_dec()
}
val1= args[1]->val_int();
+ if ((null_value= args[1]->is_null()))
+ return;
+
val1_unsigned= args[1]->unsigned_flag;
if (val1 < 0)
decimals_to_set= val1_unsigned ? INT_MAX : 0;
@@ -2414,10 +2437,7 @@ my_decimal *Item_func_round::decimal_op(my_decimal *decimal_value)
if (!(null_value= (args[0]->null_value || args[1]->null_value ||
my_decimal_round(E_DEC_FATAL_ERROR, value, (int) dec,
truncate, decimal_value) > 1)))
- {
- decimal_value->frac= decimals;
return decimal_value;
- }
return 0;
}
@@ -2544,7 +2564,8 @@ void Item_func_min_max::fix_length_and_dec()
}
if (cmp_type == STRING_RESULT)
{
- agg_arg_charsets_for_comparison(collation, args, arg_count);
+ agg_arg_charsets_for_string_result_with_comparison(collation,
+ args, arg_count);
if (datetime_found)
{
thd= current_thd;
@@ -3014,6 +3035,8 @@ void Item_func_find_in_set::fix_length_and_dec()
String *find=args[0]->val_str(&value);
if (find)
{
+ // find is not NULL pointer so args[0] is not a null-value
+ DBUG_ASSERT(!args[0]->null_value);
enum_value= find_type(((Field_enum*) field)->typelib,find->ptr(),
find->length(), 0);
enum_bit=0;
@@ -3032,11 +3055,22 @@ longlong Item_func_find_in_set::val_int()
DBUG_ASSERT(fixed == 1);
if (enum_value)
{
- ulonglong tmp=(ulonglong) args[1]->val_int();
- if (!(null_value=args[1]->null_value || args[0]->null_value))
+ // enum_value is set iff args[0]->const_item() in fix_length_and_dec().
+ DBUG_ASSERT(args[0]->const_item());
+
+ ulonglong tmp= (ulonglong) args[1]->val_int();
+ null_value= args[1]->null_value;
+ /*
+ No need to check args[0]->null_value since enum_value is set iff
+ args[0] is a non-null const item. Note: no DBUG_ASSERT on
+ args[0]->null_value here because args[0] may have been replaced
+ by an Item_cache on which val_int() has not been called. See
+ BUG#11766317
+ */
+ if (!null_value)
{
if (tmp & enum_bit)
- return enum_value;
+ return enum_value;
}
return 0L;
}
@@ -3147,7 +3181,7 @@ udf_handler::fix_fields(THD *thd, Item_result_field *func,
if (!tmp_udf)
{
- my_error(ER_CANT_FIND_UDF, MYF(0), u_d->name.str, errno);
+ my_error(ER_CANT_FIND_UDF, MYF(0), u_d->name.str);
DBUG_RETURN(TRUE);
}
u_d=tmp_udf;
@@ -3734,48 +3768,92 @@ longlong Item_master_pos_wait::val_int()
}
+/**
+ Enables a session to wait on a condition until a timeout or a network
+ disconnect occurs.
+
+ @remark The connection is polled every m_interrupt_interval nanoseconds.
+*/
+
+class Interruptible_wait
+{
+ THD *m_thd;
+ struct timespec m_abs_timeout;
+ static const ulonglong m_interrupt_interval;
+
+ public:
+ Interruptible_wait(THD *thd)
+ : m_thd(thd) {}
+
+ ~Interruptible_wait() {}
+
+ public:
+ /**
+ Set the absolute timeout.
+
+ @param timeout The amount of time in nanoseconds to wait
+ */
+ void set_timeout(ulonglong timeout)
+ {
+ /*
+ Calculate the absolute system time at the start so it can
+ be controlled in slices. It relies on the fact that once
+ the absolute time passes, the timed wait call will fail
+ automatically with a timeout error.
+ */
+ set_timespec_nsec(m_abs_timeout, timeout);
+ }
+
+ /** The timed wait. */
+ int wait(mysql_cond_t *, mysql_mutex_t *);
+};
+
+
+/** Time to wait before polling the connection status. */
+const ulonglong Interruptible_wait::m_interrupt_interval= 5 * ULL(1000000000);
+
/**
- Wait for a given condition to be signaled within the specified timeout.
+ Wait for a given condition to be signaled.
+
+ @param cond The condition variable to wait on.
+ @param mutex The associated mutex.
- @param cond the condition variable to wait on
- @param lock the associated mutex
- @param abstime the amount of time in seconds to wait
+ @remark The absolute timeout is preserved across calls.
@retval return value from mysql_cond_timedwait
*/
-#define INTERRUPT_INTERVAL (5 * ULL(1000000000))
-
-static int interruptible_wait(THD *thd, mysql_cond_t *cond,
- mysql_mutex_t *lock, double time)
+int Interruptible_wait::wait(mysql_cond_t *cond, mysql_mutex_t *mutex)
{
int error;
- struct timespec abstime;
- ulonglong slice, timeout= (ulonglong) (time * 1000000000.0);
+ struct timespec timeout;
- do
+ while (1)
{
/* Wait for a fixed interval. */
- if (timeout > INTERRUPT_INTERVAL)
- slice= INTERRUPT_INTERVAL;
- else
- slice= timeout;
+ set_timespec_nsec(timeout, m_interrupt_interval);
- timeout-= slice;
- set_timespec_nsec(abstime, slice);
- error= mysql_cond_timedwait(cond, lock, &abstime);
+ /* But only if not past the absolute timeout. */
+ if (cmp_timespec(timeout, m_abs_timeout) > 0)
+ timeout= m_abs_timeout;
+
+ error= mysql_cond_timedwait(cond, mutex, &timeout);
if (error == ETIMEDOUT || error == ETIME)
{
/* Return error if timed out or connection is broken. */
- if (!timeout || !thd->is_connected())
+ if (!cmp_timespec(timeout, m_abs_timeout) || !m_thd->is_connected())
break;
}
- } while (error && timeout);
+ /* Otherwise, propagate status to the caller. */
+ else
+ break;
+ }
return error;
}
+
/**
Get a user level lock. If the thread has an old lock this is first released.
@@ -3791,10 +3869,11 @@ longlong Item_func_get_lock::val_int()
{
DBUG_ASSERT(fixed == 1);
String *res=args[0]->val_str(&value);
- double timeout= args[1]->val_real();
+ ulonglong timeout= args[1]->val_int();
THD *thd=current_thd;
User_level_lock *ull;
int error;
+ Interruptible_wait timed_cond(thd);
DBUG_ENTER("Item_func_get_lock::val_int");
/*
@@ -3855,11 +3934,14 @@ longlong Item_func_get_lock::val_int()
thd->mysys_var->current_mutex= &LOCK_user_locks;
thd->mysys_var->current_cond= &ull->cond;
+ timed_cond.set_timeout(timeout * ULL(1000000000));
+
error= 0;
+ thd_wait_begin(thd, THD_WAIT_USER_LOCK);
while (ull->locked && !thd->killed)
{
DBUG_PRINT("info", ("waiting on lock"));
- error= interruptible_wait(thd, &ull->cond, &LOCK_user_locks, timeout);
+ error= timed_cond.wait(&ull->cond, &LOCK_user_locks);
if (error == ETIMEDOUT || error == ETIME)
{
DBUG_PRINT("info", ("lock wait timeout"));
@@ -3867,6 +3949,7 @@ longlong Item_func_get_lock::val_int()
}
error= 0;
}
+ thd_wait_end(thd);
if (ull->locked)
{
@@ -4054,6 +4137,7 @@ void Item_func_benchmark::print(String *str, enum_query_type query_type)
longlong Item_func_sleep::val_int()
{
THD *thd= current_thd;
+ Interruptible_wait timed_cond(thd);
mysql_cond_t cond;
double timeout;
int error;
@@ -4073,6 +4157,8 @@ longlong Item_func_sleep::val_int()
if (timeout < 0.00001)
return 0;
+ timed_cond.set_timeout((ulonglong) (timeout * 1000000000.0));
+
mysql_cond_init(key_item_func_sleep_cond, &cond, NULL);
mysql_mutex_lock(&LOCK_user_locks);
@@ -4081,13 +4167,15 @@ longlong Item_func_sleep::val_int()
thd->mysys_var->current_cond= &cond;
error= 0;
+ thd_wait_begin(thd, THD_WAIT_SLEEP);
while (!thd->killed)
{
- error= interruptible_wait(thd, &cond, &LOCK_user_locks, timeout);
+ error= timed_cond.wait(&cond, &LOCK_user_locks);
if (error == ETIMEDOUT || error == ETIME)
break;
error= 0;
}
+ thd_wait_end(thd);
thd_proc_info(thd, 0);
mysql_mutex_unlock(&LOCK_user_locks);
mysql_mutex_lock(&thd->mysys_var->mutex);
@@ -4226,6 +4314,7 @@ Item_func_set_user_var::fix_length_and_dec()
fix_length_and_charset(args[0]->max_char_length(),
args[0]->collation.collation);
}
+ unsigned_flag= args[0]->unsigned_flag;
}
@@ -4337,7 +4426,7 @@ update_hash(user_var_entry *entry, bool set_null, void *ptr, uint length,
length--; // Fix length change above
entry->value[length]= 0; // Store end \0
}
- memcpy(entry->value,ptr,length);
+ memmove(entry->value, ptr, length);
if (type == DECIMAL_RESULT)
((my_decimal*)entry->value)->fix_buffer_pointer();
entry->length= length;
@@ -4477,7 +4566,7 @@ my_decimal *user_var_entry::val_decimal(bool *null_value, my_decimal *val)
int2my_decimal(E_DEC_FATAL_ERROR, *(longlong*) value, 0, val);
break;
case DECIMAL_RESULT:
- val= (my_decimal *)value;
+ my_decimal2decimal((my_decimal *) value, val);
break;
case STRING_RESULT:
str2my_decimal(E_DEC_FATAL_ERROR, value, length, collation.collation, val);
@@ -5741,7 +5830,17 @@ void Item_func_match::init_search(bool no_order)
/* Check if init_search() has been called before */
if (ft_handler)
+ {
+ /*
+ We should reset ft_handler as it is cleaned up
+ on destruction of FT_SELECT object
+ (necessary in case of re-execution of subquery).
+ TODO: FT_SELECT should not clean up ft_handler.
+ */
+ if (join_key)
+ table->file->ft_handler= ft_handler;
DBUG_VOID_RETURN;
+ }
if (key == NO_SUCH_KEY)
{
@@ -6489,7 +6588,7 @@ Item_func_sp::fix_fields(THD *thd, Item **ref)
if (res)
DBUG_RETURN(res);
- if (thd->lex->view_prepare_mode)
+ if (thd->lex->context_analysis_only & CONTEXT_ANALYSIS_ONLY_VIEW)
{
/*
Here we check privileges of the stored routine only during view
diff --git a/sql/item_func.h b/sql/item_func.h
index 5156d4d238b..c3cb3e3ba02 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -1,7 +1,7 @@
#ifndef ITEM_FUNC_INCLUDED
#define ITEM_FUNC_INCLUDED
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -166,6 +166,11 @@ public:
{
return agg_item_charsets(c, func_name(), items, nitems, flags, item_sep);
}
+ /*
+ Aggregate arguments for string result, e.g: CONCAT(a,b)
+ - convert to @@character_set_connection if all arguments are numbers
+ - allow DERIVATION_NONE
+ */
bool agg_arg_charsets_for_string_result(DTCollation &c,
Item **items, uint nitems,
int item_sep= 1)
@@ -173,6 +178,11 @@ public:
return agg_item_charsets_for_string_result(c, func_name(),
items, nitems, item_sep);
}
+ /*
+ Aggregate arguments for comparison, e.g: a=b, a LIKE b, a RLIKE b
+ - don't convert to @@character_set_connection if all arguments are numbers
+ - don't allow DERIVATION_NONE
+ */
bool agg_arg_charsets_for_comparison(DTCollation &c,
Item **items, uint nitems,
int item_sep= 1)
@@ -180,6 +190,21 @@ public:
return agg_item_charsets_for_comparison(c, func_name(),
items, nitems, item_sep);
}
+ /*
+ Aggregate arguments for string result, when some comparison
+ is involved internally, e.g: REPLACE(a,b,c)
+ - convert to @@character_set_connection if all arguments are numbers
+ - disallow DERIVATION_NONE
+ */
+ bool agg_arg_charsets_for_string_result_with_comparison(DTCollation &c,
+ Item **items,
+ uint nitems,
+ int item_sep= 1)
+ {
+ return agg_item_charsets_for_string_result_with_comparison(c, func_name(),
+ items, nitems,
+ item_sep);
+ }
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,
@@ -238,6 +263,7 @@ public:
{
return (error == E_DEC_OVERFLOW) ? raise_decimal_overflow() : error;
}
+
bool has_timestamp_args()
{
DBUG_ASSERT(fixed == TRUE);
@@ -249,6 +275,45 @@ public:
}
return FALSE;
}
+
+ bool has_date_args()
+ {
+ DBUG_ASSERT(fixed == TRUE);
+ for (uint i= 0; i < arg_count; i++)
+ {
+ if (args[i]->type() == Item::FIELD_ITEM &&
+ (args[i]->field_type() == MYSQL_TYPE_DATE ||
+ args[i]->field_type() == MYSQL_TYPE_DATETIME))
+ return TRUE;
+ }
+ return FALSE;
+ }
+
+ bool has_time_args()
+ {
+ DBUG_ASSERT(fixed == TRUE);
+ for (uint i= 0; i < arg_count; i++)
+ {
+ if (args[i]->type() == Item::FIELD_ITEM &&
+ (args[i]->field_type() == MYSQL_TYPE_TIME ||
+ args[i]->field_type() == MYSQL_TYPE_DATETIME))
+ return TRUE;
+ }
+ return FALSE;
+ }
+
+ bool has_datetime_args()
+ {
+ DBUG_ASSERT(fixed == TRUE);
+ for (uint i= 0; i < arg_count; i++)
+ {
+ if (args[i]->type() == Item::FIELD_ITEM &&
+ args[i]->field_type() == MYSQL_TYPE_DATETIME)
+ return TRUE;
+ }
+ return FALSE;
+ }
+
/*
We assume the result of any function that has a TIMESTAMP argument to be
timezone-dependent, since a TIMESTAMP value in both numeric and string
@@ -257,7 +322,7 @@ public:
representation of a TIMESTAMP argument verbatim, and thus does not depend on
the timezone.
*/
- virtual bool is_timezone_dependent_processor(uchar *bool_arg)
+ virtual bool check_valid_arguments_processor(uchar *bool_arg)
{
return has_timestamp_args();
}
@@ -1649,7 +1714,7 @@ public:
join_key(0), ft_handler(0), table(0), master(0), concat_ws(0) { }
void cleanup()
{
- DBUG_ENTER("Item_func_match");
+ DBUG_ENTER("Item_func_match::cleanup");
Item_real_func::cleanup();
if (!master && ft_handler)
ft_handler->please->close_search(ft_handler);
diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h
index 84034841ad5..c5c1eae2d39 100644
--- a/sql/item_geofunc.h
+++ b/sql/item_geofunc.h
@@ -1,7 +1,7 @@
#ifndef ITEM_GEOFUNC_INCLUDED
#define ITEM_GEOFUNC_INCLUDED
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -181,6 +181,7 @@ public:
String *val_str(String *);
void fix_length_and_dec()
{
+ Item_geometry_func::fix_length_and_dec();
for (unsigned int i= 0; i < arg_count; ++i)
{
if (args[i]->fixed && args[i]->field_type() != MYSQL_TYPE_GEOMETRY)
diff --git a/sql/item_row.cc b/sql/item_row.cc
index 27b846cd15b..9fae85518af 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -80,12 +80,8 @@ bool Item_row::fix_fields(THD *thd, Item **ref)
used_tables_cache |= item->used_tables();
const_item_cache&= item->const_item() && !with_null;
not_null_tables_cache|= item->not_null_tables();
- /*
- Some subqueries transformations aren't done in the view_prepare_mode thus
- is_null() will fail. So we skip is_null() calculation for CREATE VIEW as
- not necessary.
- */
- if (const_item_cache && !thd->lex->view_prepare_mode)
+
+ if (const_item_cache)
{
if (item->cols() > 1)
with_null|= item->null_inside();
@@ -188,7 +184,7 @@ bool Item_row::walk(Item_processor processor, bool walk_subquery, uchar *arg)
Item *Item_row::transform(Item_transformer transformer, uchar *arg)
{
- DBUG_ASSERT(!current_thd->is_stmt_prepare());
+ DBUG_ASSERT(!current_thd->stmt_arena->is_stmt_prepare());
for (uint i= 0; i < arg_count; i++)
{
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 4b87b0439ee..dbd7ed1d68f 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,8 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -56,6 +55,9 @@ C_MODE_START
#include "../mysys/my_static.h" // For soundex_map
C_MODE_END
+/**
+ @todo Remove this. It is not safe to use a shared String object.
+ */
String my_empty_string("",default_charset_info);
/*
@@ -67,7 +69,7 @@ String my_empty_string("",default_charset_info);
Normally conversion does not happen, and val_str_ascii() is immediately
returned instead.
*/
-String *Item_str_ascii_func::val_str(String *str)
+String *Item_str_func::val_str_from_val_str_ascii(String *str, String *str2)
{
DBUG_ASSERT(fixed == 1);
@@ -79,19 +81,19 @@ String *Item_str_ascii_func::val_str(String *str)
return res;
}
- DBUG_ASSERT(str != &ascii_buf);
+ DBUG_ASSERT(str != str2);
uint errors;
- String *res= val_str_ascii(&ascii_buf);
+ String *res= val_str_ascii(str);
if (!res)
return 0;
- if ((null_value= str->copy(res->ptr(), res->length(),
- &my_charset_latin1, collation.collation,
- &errors)))
+ if ((null_value= str2->copy(res->ptr(), res->length(),
+ &my_charset_latin1, collation.collation,
+ &errors)))
return 0;
- return str;
+ return str2;
}
@@ -642,7 +644,7 @@ String *Item_func_des_encrypt::val_str(String *str)
if ((null_value= args[0]->null_value))
return 0; // ENCRYPT(NULL) == NULL
if ((res_length=res->length()) == 0)
- return &my_empty_string;
+ return make_empty_result();
if (arg_count == 1)
{
/* Protect against someone doing FLUSH DES_KEY_FILE */
@@ -697,6 +699,7 @@ String *Item_func_des_encrypt::val_str(String *str)
tmp_arg[res_length-1]=tail; // save extra length
tmp_value.realloc(res_length+1);
tmp_value.length(res_length+1);
+ tmp_value.set_charset(&my_charset_bin);
tmp_value[0]=(char) (128 | key_number);
// Real encryption
bzero((char*) &ivec,sizeof(ivec));
@@ -784,6 +787,7 @@ String *Item_func_des_decrypt::val_str(String *str)
if ((tail=(uint) (uchar) tmp_value[length-2]) > 8)
goto wrong_key; // Wrong key
tmp_value.length(length-1-tail);
+ tmp_value.set_charset(&my_charset_bin);
return &tmp_value;
error:
@@ -833,7 +837,7 @@ String *Item_func_concat_ws::val_str(String *str)
}
if (i == arg_count)
- return &my_empty_string;
+ return make_empty_result();
for (i++; i < arg_count ; i++)
{
@@ -979,7 +983,7 @@ String *Item_func_reverse::val_str(String *str)
return 0;
/* An empty string is a special case as the string pointer may be null */
if (!res->length())
- return &my_empty_string;
+ return make_empty_result();
if (tmp_value.alloced_length() < res->length() &&
tmp_value.realloc(res->length()))
{
@@ -1081,9 +1085,15 @@ String *Item_func_replace::val_str(String *str)
search=res2->ptr();
search_end=search+from_length;
redo:
+ DBUG_ASSERT(res->ptr() || !offset);
ptr=res->ptr()+offset;
strend=res->ptr()+res->length();
- end=strend-from_length+1;
+ /*
+ In some cases val_str() can return empty string
+ with ptr() == NULL and length() == 0.
+ Let's check strend to avoid overflow.
+ */
+ end= strend ? strend - from_length + 1 : NULL;
while (ptr < end)
{
if (*ptr == *search)
@@ -1158,7 +1168,7 @@ void Item_func_replace::fix_length_and_dec()
char_length+= max_substrs * (uint) diff;
}
- if (agg_arg_charsets_for_comparison(collation, args, 3))
+ if (agg_arg_charsets_for_string_result_with_comparison(collation, args, 3))
return;
fix_char_length_ulonglong(char_length);
}
@@ -1185,6 +1195,20 @@ String *Item_func_insert::val_str(String *str)
if ((length < 0) || (length > res->length()))
length= res->length();
+ /*
+ There is one exception not handled (intentionaly) by the character set
+ aggregation code. If one string is strong side and is binary, and
+ another one is weak side and is a multi-byte character string,
+ then we need to operate on the second string in terms on bytes when
+ calling ::numchars() and ::charpos(), rather than in terms of characters.
+ Lets substitute its character set to binary.
+ */
+ if (collation.collation == &my_charset_bin)
+ {
+ res->set_charset(&my_charset_bin);
+ res2->set_charset(&my_charset_bin);
+ }
+
/* start and length are now sufficiently valid to pass to charpos function */
start= res->charpos((int) start);
length= res->charpos((int) length, (uint32) start);
@@ -1292,8 +1316,7 @@ String *Item_func_left::val_str(String *str)
/* if "unsigned_flag" is set, we have a *huge* positive number. */
if ((length <= 0) && (!args[1]->unsigned_flag))
- return &my_empty_string;
-
+ return make_empty_result();
if ((res->length() <= (ulonglong) length) ||
(res->length() <= (char_pos= res->charpos((int) length))))
return res;
@@ -1338,7 +1361,7 @@ String *Item_func_right::val_str(String *str)
/* if "unsigned_flag" is set, we have a *huge* positive number. */
if ((length <= 0) && (!args[1]->unsigned_flag))
- return &my_empty_string; /* purecov: inspected */
+ return make_empty_result(); /* purecov: inspected */
if (res->length() <= (ulonglong) length)
return res; /* purecov: inspected */
@@ -1378,7 +1401,7 @@ String *Item_func_substr::val_str(String *str)
/* Negative or zero length, will return empty string. */
if ((arg_count == 3) && (length <= 0) &&
(length == 0 || !args[2]->unsigned_flag))
- return &my_empty_string;
+ return make_empty_result();
/* Assumes that the maximum length of a String is < INT_MAX32. */
/* Set here so that rest of code sees out-of-bound value as such. */
@@ -1389,12 +1412,12 @@ String *Item_func_substr::val_str(String *str)
/* Assumes that the maximum length of a String is < INT_MAX32. */
if ((!args[1]->unsigned_flag && (start < INT_MIN32 || start > INT_MAX32)) ||
(args[1]->unsigned_flag && ((ulonglong) start > INT_MAX32)))
- return &my_empty_string;
+ return make_empty_result();
start= ((start < 0) ? res->numchars() + start : start - 1);
start= res->charpos((int) start);
if ((start < 0) || ((uint) start + 1 > res->length()))
- return &my_empty_string;
+ return make_empty_result();
length= res->charpos((int) length, (uint32) start);
tmp_length= res->length() - start;
@@ -1435,7 +1458,7 @@ void Item_func_substr::fix_length_and_dec()
void Item_func_substr_index::fix_length_and_dec()
{
- if (agg_arg_charsets_for_comparison(collation, args, 2))
+ if (agg_arg_charsets_for_string_result_with_comparison(collation, args, 2))
return;
fix_char_length(args[0]->max_char_length());
}
@@ -1457,7 +1480,7 @@ String *Item_func_substr_index::val_str(String *str)
null_value=0;
uint delimiter_length= delimiter->length();
if (!res->length() || !delimiter_length || !count)
- return &my_empty_string; // Wrong parameters
+ return make_empty_result(); // Wrong parameters
res->set_charset(collation.collation);
@@ -1774,7 +1797,8 @@ void Item_func_trim::fix_length_and_dec()
{
// Handle character set for args[1] and args[0].
// Note that we pass args[1] as the first item, and args[0] as the second.
- if (agg_arg_charsets_for_comparison(collation, &args[1], 2, -1))
+ if (agg_arg_charsets_for_string_result_with_comparison(collation,
+ &args[1], 2, -1))
return;
}
fix_char_length(args[0]->max_char_length());
@@ -1807,7 +1831,7 @@ String *Item_func_password::val_str_ascii(String *str)
if ((null_value=args[0]->null_value))
return 0;
if (res->length() == 0)
- return &my_empty_string;
+ return make_empty_result();
my_make_scrambled_password(tmp_value, res->ptr(), res->length());
str->set(tmp_value, SCRAMBLED_PASSWORD_CHAR_LENGTH, &my_charset_latin1);
return str;
@@ -1831,7 +1855,7 @@ String *Item_func_old_password::val_str_ascii(String *str)
if ((null_value=args[0]->null_value))
return 0;
if (res->length() == 0)
- return &my_empty_string;
+ return make_empty_result();
my_make_scrambled_password_323(tmp_value, res->ptr(), res->length());
str->set(tmp_value, SCRAMBLED_PASSWORD_CHAR_LENGTH_323, &my_charset_latin1);
return str;
@@ -1859,8 +1883,7 @@ String *Item_func_encrypt::val_str(String *str)
if ((null_value=args[0]->null_value))
return 0;
if (res->length() == 0)
- return &my_empty_string;
-
+ return make_empty_result();
if (arg_count == 1)
{ // generate random salt
time_t timestamp=current_thd->query_start();
@@ -2122,7 +2145,7 @@ String *Item_func_soundex::val_str(String *str)
for ( ; ; ) /* Skip pre-space */
{
if ((rc= cs->cset->mb_wc(cs, &wc, (uchar*) from, (uchar*) end)) <= 0)
- return &my_empty_string; /* EOL or invalid byte sequence */
+ return make_empty_result(); /* EOL or invalid byte sequence */
if (rc == 1 && cs->ctype)
{
@@ -2147,7 +2170,7 @@ String *Item_func_soundex::val_str(String *str)
{
/* Extra safety - should not really happen */
DBUG_ASSERT(false);
- return &my_empty_string;
+ return make_empty_result();
}
to+= rc;
break;
@@ -2300,7 +2323,8 @@ String *Item_func_format::val_str_ascii(String *str)
if (lc->grouping[0] > 0 &&
str_length >= dec_length + 1 + lc->grouping[0])
{
- char buf[DECIMAL_MAX_STR_LENGTH * 2]; /* 2 - in the worst case when grouping=1 */
+ /* We need space for ',' between each group of digits as well. */
+ char buf[2 * FLOATING_POINT_BUFFER];
int count;
const char *grouping= lc->grouping;
char sign_length= *str->ptr() == '-' ? 1 : 0;
@@ -2324,7 +2348,7 @@ String *Item_func_format::val_str_ascii(String *str)
count will be initialized to -1 and
we'll never get into this "if" anymore.
*/
- if (!count)
+ if (count == 0)
{
*--dst= lc->thousand_sep;
if (grouping[1])
@@ -2487,7 +2511,7 @@ String *Item_func_make_set::val_str(String *str)
else
{
if (tmp_str.copy(*res)) // Don't use 'str'
- return &my_empty_string;
+ return make_empty_result();
result= &tmp_str;
}
}
@@ -2497,11 +2521,11 @@ String *Item_func_make_set::val_str(String *str)
{ // Copy data to tmp_str
if (tmp_str.alloc(result->length()+res->length()+1) ||
tmp_str.copy(*result))
- return &my_empty_string;
+ return make_empty_result();
result= &tmp_str;
}
if (tmp_str.append(STRING_WITH_LEN(","), &my_charset_bin) || tmp_str.append(*res))
- return &my_empty_string;
+ return make_empty_result();
}
}
}
@@ -2512,7 +2536,7 @@ String *Item_func_make_set::val_str(String *str)
Item *Item_func_make_set::transform(Item_transformer transformer, uchar *arg)
{
- DBUG_ASSERT(!current_thd->is_stmt_prepare());
+ DBUG_ASSERT(!current_thd->stmt_arena->is_stmt_prepare());
Item *new_item= item->transform(transformer, arg);
if (!new_item)
@@ -2646,7 +2670,7 @@ String *Item_func_repeat::val_str(String *str)
null_value= 0;
if (count <= 0 && (count == 0 || !args[1]->unsigned_flag))
- return &my_empty_string;
+ return make_empty_result();
/* Assumes that the maximum length of a String is < INT_MAX32. */
/* Bounds check on count: If this is triggered, we will error. */
@@ -2725,6 +2749,20 @@ String *Item_func_rpad::val_str(String *str)
/* Set here so that rest of code sees out-of-bound value as such. */
if ((ulonglong) count > INT_MAX32)
count= INT_MAX32;
+ /*
+ There is one exception not handled (intentionaly) by the character set
+ aggregation code. If one string is strong side and is binary, and
+ another one is weak side and is a multi-byte character string,
+ then we need to operate on the second string in terms on bytes when
+ calling ::numchars() and ::charpos(), rather than in terms of characters.
+ Lets substitute its character set to binary.
+ */
+ if (collation.collation == &my_charset_bin)
+ {
+ res->set_charset(&my_charset_bin);
+ rpad->set_charset(&my_charset_bin);
+ }
+
if (count <= (res_char_length= res->numchars()))
{ // String to pad is big enough
res->length(res->charpos((int) count)); // Shorten result if longer
@@ -2814,6 +2852,20 @@ String *Item_func_lpad::val_str(String *str)
if ((ulonglong) count > INT_MAX32)
count= INT_MAX32;
+ /*
+ There is one exception not handled (intentionaly) by the character set
+ aggregation code. If one string is strong side and is binary, and
+ another one is weak side and is a multi-byte character string,
+ then we need to operate on the second string in terms on bytes when
+ calling ::numchars() and ::charpos(), rather than in terms of characters.
+ Lets substitute its character set to binary.
+ */
+ if (collation.collation == &my_charset_bin)
+ {
+ res->set_charset(&my_charset_bin);
+ pad->set_charset(&my_charset_bin);
+ }
+
res_char_length= res->numchars();
if (count <= res_char_length)
@@ -2900,7 +2952,7 @@ String *Item_func_conv::val_str(String *str)
ptr= longlong2str(dec, ans, to_base);
if (str->copy(ans, (uint32) (ptr-ans), default_charset()))
- return &my_empty_string;
+ return make_empty_result();
return str;
}
@@ -2910,22 +2962,16 @@ String *Item_func_conv_charset::val_str(String *str)
DBUG_ASSERT(fixed == 1);
if (use_cached_value)
return null_value ? 0 : &str_value;
- /*
- Here we don't pass 'str' as a parameter to args[0]->val_str()
- as 'str' may point to 'str_value' (e.g. see Item::save_in_field()),
- which we use below to convert string.
- Use argument's 'str_value' instead.
- */
- String *arg= args[0]->val_str(&args[0]->str_value);
+ String *arg= args[0]->val_str(str);
uint dummy_errors;
if (!arg)
{
null_value=1;
return 0;
}
- null_value= str_value.copy(arg->ptr(),arg->length(),arg->charset(),
+ null_value= tmp_value.copy(arg->ptr(), arg->length(), arg->charset(),
conv_charset, &dummy_errors);
- return null_value ? 0 : check_well_formed_result(&str_value);
+ return null_value ? 0 : check_well_formed_result(&tmp_value);
}
void Item_func_conv_charset::fix_length_and_dec()
@@ -3067,7 +3113,7 @@ String *Item_func_hex::val_str_ascii(String *str)
return 0;
ptr= longlong2str(dec,ans,16);
if (str->copy(ans,(uint32) (ptr-ans), &my_charset_numeric))
- return &my_empty_string; // End of memory
+ return make_empty_result(); // End of memory
return str;
}
@@ -3128,6 +3174,41 @@ String *Item_func_unhex::val_str(String *str)
}
+#ifndef DBUG_OFF
+String *Item_func_like_range::val_str(String *str)
+{
+ DBUG_ASSERT(fixed == 1);
+ longlong nbytes= args[1]->val_int();
+ String *res= args[0]->val_str(str);
+ size_t min_len, max_len;
+ CHARSET_INFO *cs= collation.collation;
+
+ if (!res || args[0]->null_value || args[1]->null_value ||
+ nbytes < 0 || nbytes > MAX_BLOB_WIDTH ||
+ min_str.alloc(nbytes) || max_str.alloc(nbytes))
+ goto err;
+ null_value=0;
+
+ if (cs->coll->like_range(cs, res->ptr(), res->length(),
+ '\\', '_', '%', nbytes,
+ (char*) min_str.ptr(), (char*) max_str.ptr(),
+ &min_len, &max_len))
+ goto err;
+
+ min_str.set_charset(collation.collation);
+ max_str.set_charset(collation.collation);
+ min_str.length(min_len);
+ max_str.length(max_len);
+
+ return is_min ? &min_str : &max_str;
+
+err:
+ null_value= 1;
+ return 0;
+}
+#endif
+
+
void Item_func_binary::print(String *str, enum_query_type query_type)
{
str->append(STRING_WITH_LEN("cast("));
@@ -3370,14 +3451,68 @@ String *Item_func_quote::val_str(String *str)
}
arg_length= arg->length();
- new_length= arg_length+2; /* for beginning and ending ' signs */
- for (from= (char*) arg->ptr(), end= from + arg_length; from < end; from++)
- new_length+= get_esc_bit(escmask, (uchar) *from);
+ if (collation.collation->mbmaxlen == 1)
+ {
+ new_length= arg_length + 2; /* for beginning and ending ' signs */
+ for (from= (char*) arg->ptr(), end= from + arg_length; from < end; from++)
+ new_length+= get_esc_bit(escmask, (uchar) *from);
+ }
+ else
+ {
+ new_length= (arg_length * 2) + /* For string characters */
+ (2 * collation.collation->mbmaxlen); /* For quotes */
+ }
if (tmp_value.alloc(new_length))
goto null;
+ if (collation.collation->mbmaxlen > 1)
+ {
+ CHARSET_INFO *cs= collation.collation;
+ int mblen;
+ uchar *to_end;
+ to= (char*) tmp_value.ptr();
+ to_end= (uchar*) to + new_length;
+
+ /* Put leading quote */
+ if ((mblen= cs->cset->wc_mb(cs, '\'', (uchar *) to, to_end)) <= 0)
+ goto null;
+ to+= mblen;
+
+ for (start= (char*) arg->ptr(), end= start + arg_length; start < end; )
+ {
+ my_wc_t wc;
+ bool escape;
+ if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) start, (uchar*) end)) <= 0)
+ goto null;
+ start+= mblen;
+ switch (wc) {
+ case 0: escape= 1; wc= '0'; break;
+ case '\032': escape= 1; wc= 'Z'; break;
+ case '\'': escape= 1; break;
+ case '\\': escape= 1; break;
+ default: escape= 0; break;
+ }
+ if (escape)
+ {
+ if ((mblen= cs->cset->wc_mb(cs, '\\', (uchar*) to, to_end)) <= 0)
+ goto null;
+ to+= mblen;
+ }
+ if ((mblen= cs->cset->wc_mb(cs, wc, (uchar*) to, to_end)) <= 0)
+ goto null;
+ to+= mblen;
+ }
+
+ /* Put trailing quote */
+ if ((mblen= cs->cset->wc_mb(cs, '\'', (uchar *) to, to_end)) <= 0)
+ goto null;
+ to+= mblen;
+ new_length= to - tmp_value.ptr();
+ goto ret;
+ }
+
/*
We replace characters from the end to the beginning
*/
@@ -3409,6 +3544,8 @@ String *Item_func_quote::val_str(String *str)
}
}
*to= '\'';
+
+ret:
tmp_value.length(new_length);
tmp_value.set_charset(collation.collation);
null_value= 0;
@@ -3565,7 +3702,8 @@ String *Item_func_uncompress::val_str(String *str)
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_BIG_FOR_UNCOMPRESS,
ER(ER_TOO_BIG_FOR_UNCOMPRESS),
- current_thd->variables.max_allowed_packet);
+ static_cast<int>(current_thd->variables.
+ max_allowed_packet));
goto err;
}
if (buffer.realloc((uint32)new_size))
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 8c85d1cb8fd..ef059ae1780 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -1,7 +1,7 @@
#ifndef ITEM_STRFUNC_INCLUDED
#define ITEM_STRFUNC_INCLUDED
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -27,6 +27,16 @@ class MY_LOCALE;
class Item_str_func :public Item_func
{
+protected:
+ /**
+ Sets the result value of the function an empty string, using the current
+ character set. No memory is allocated.
+ @retval A pointer to the str_value member.
+ */
+ String *make_empty_result() {
+ str_value.set("", 0, collation.collation);
+ return &str_value;
+ }
public:
Item_str_func() :Item_func() { decimals=NOT_FIXED_DEC; }
Item_str_func(Item *a) :Item_func(a) {decimals=NOT_FIXED_DEC; }
@@ -41,6 +51,7 @@ public:
enum Item_result result_type () const { return STRING_RESULT; }
void left_right_max_length();
bool fix_fields(THD *thd, Item **ref);
+ String *val_str_from_val_str_ascii(String *str, String *str2);
};
@@ -56,8 +67,10 @@ public:
Item_str_ascii_func(Item *a) :Item_str_func(a) {}
Item_str_ascii_func(Item *a,Item *b) :Item_str_func(a,b) {}
Item_str_ascii_func(Item *a,Item *b,Item *c) :Item_str_func(a,b,c) {}
- String *val_str_convert_from_ascii(String *str, String *ascii_buf);
- String *val_str(String *str);
+ String *val_str(String *str)
+ {
+ return val_str_from_val_str_ascii(str, &ascii_buf);
+ }
virtual String *val_str_ascii(String *)= 0;
};
@@ -351,7 +364,9 @@ public:
{
maybe_null=1;
/* 9 = MAX ((8- (arg_len % 8)) + 1) */
- max_length = args[0]->max_length - 9;
+ max_length= args[0]->max_length;
+ if (max_length >= 9U)
+ max_length-= 9U;
}
const char *func_name() const { return "des_decrypt"; }
};
@@ -666,6 +681,46 @@ public:
};
+#ifndef DBUG_OFF
+class Item_func_like_range :public Item_str_func
+{
+protected:
+ String min_str;
+ String max_str;
+ const bool is_min;
+public:
+ Item_func_like_range(Item *a, Item *b, bool is_min_arg)
+ :Item_str_func(a, b), is_min(is_min_arg)
+ { maybe_null= 1; }
+ String *val_str(String *);
+ void fix_length_and_dec()
+ {
+ collation.set(args[0]->collation);
+ decimals=0;
+ max_length= MAX_BLOB_WIDTH;
+ }
+};
+
+
+class Item_func_like_range_min :public Item_func_like_range
+{
+public:
+ Item_func_like_range_min(Item *a, Item *b)
+ :Item_func_like_range(a, b, true) { }
+ const char *func_name() const { return "like_range_min"; }
+};
+
+
+class Item_func_like_range_max :public Item_func_like_range
+{
+public:
+ Item_func_like_range_max(Item *a, Item *b)
+ :Item_func_like_range(a, b, false) { }
+ const char *func_name() const { return "like_range_max"; }
+};
+#endif
+
+
class Item_func_binary :public Item_str_func
{
public:
@@ -745,15 +800,17 @@ public:
String *val_str(String *);
void fix_length_and_dec()
{
- ulonglong max_result_length= (ulonglong) args[0]->max_length * 2 + 2;
- max_length= (uint32) min(max_result_length, MAX_BLOB_WIDTH);
collation.set(args[0]->collation);
+ ulonglong max_result_length= (ulonglong) args[0]->max_length * 2 +
+ 2 * collation.collation->mbmaxlen;
+ max_length= (uint32) min(max_result_length, MAX_BLOB_WIDTH);
}
};
class Item_func_conv_charset :public Item_str_func
{
bool use_cached_value;
+ String tmp_value;
public:
bool safe;
CHARSET_INFO *conv_charset; // keep it public
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index a69910da700..44436a4a467 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -133,20 +133,6 @@ void Item_subselect::cleanup()
}
-/*
- We cannot use generic Item::safe_charset_converter() because
- Subselect transformation does not happen in view_prepare_mode
- and thus we can not evaluate val_...() for const items.
-*/
-
-Item *Item_subselect::safe_charset_converter(CHARSET_INFO *tocs)
-{
- Item_func_conv_charset *conv=
- new Item_func_conv_charset(this, tocs, thd->lex->view_prepare_mode ? 0 : 1);
- return conv->safe ? conv : NULL;
-}
-
-
void Item_singlerow_subselect::cleanup()
{
DBUG_ENTER("Item_singlerow_subselect::cleanup");
@@ -471,29 +457,31 @@ bool Item_subselect::walk(Item_processor processor, bool walk_subquery,
bool Item_subselect::exec()
{
- int res;
+ DBUG_ENTER("Item_subselect::exec");
/*
Do not execute subselect in case of a fatal error
or if the query has been killed.
*/
if (thd->is_error() || thd->killed)
- return 1;
+ DBUG_RETURN(true);
+ DBUG_ASSERT(!thd->lex->context_analysis_only);
/*
Simulate a failure in sub-query execution. Used to test e.g.
out of memory or query being killed conditions.
*/
- DBUG_EXECUTE_IF("subselect_exec_fail", return 1;);
+ DBUG_EXECUTE_IF("subselect_exec_fail", DBUG_RETURN(true););
- res= engine->exec();
+ bool res= engine->exec();
if (engine_changed)
{
engine_changed= 0;
- return exec();
+ res= exec();
+ DBUG_RETURN(res);
}
- return (res);
+ DBUG_RETURN(res);
}
@@ -607,7 +595,7 @@ table_map Item_subselect::used_tables() const
bool Item_subselect::const_item() const
{
- return const_item_cache;
+ return thd->lex->context_analysis_only ? FALSE : const_item_cache;
}
Item *Item_subselect::get_tmp_table_item(THD *thd_arg)
@@ -1563,6 +1551,7 @@ Item_in_subselect::single_value_in_to_exists_transformer(JOIN * join, Comp_creat
select_lex->having= join->having= and_items(join->having, item);
if (join->having == item)
item->name= (char*)in_having_cond;
+ select_lex->having->top_level_item();
select_lex->having_fix_field= 1;
/*
we do not check join->having->fixed, because Item_and (from and_items)
@@ -2178,7 +2167,8 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref)
}
}
- if (thd_arg->lex->view_prepare_mode && left_expr && !left_expr->fixed &&
+ if ((thd_arg->lex->context_analysis_only & CONTEXT_ANALYSIS_ONLY_VIEW) &&
+ left_expr && !left_expr->fixed &&
left_expr->fix_fields(thd_arg, &left_expr))
return TRUE;
if (Item_subselect::fix_fields(thd_arg, ref))
@@ -2647,21 +2637,26 @@ int subselect_single_select_engine::exec()
DBUG_RETURN(join->error ? join->error : 1);
}
if (!select_lex->uncacheable && thd->lex->describe &&
- !(join->select_options & SELECT_DESCRIBE) &&
- join->need_tmp)
+ !(join->select_options & SELECT_DESCRIBE))
{
item->update_used_tables();
if (item->const_item())
{
/*
+ It's necessary to keep original JOIN table because
+ create_sort_index() function may overwrite original
+ JOIN_TAB::type and wrong optimization method can be
+ selected on re-execution.
+ */
+ select_lex->uncacheable|= UNCACHEABLE_EXPLAIN;
+ select_lex->master_unit()->uncacheable|= UNCACHEABLE_EXPLAIN;
+ /*
Force join->join_tmp creation, because this subquery will be replaced
by a simple select from the materialization temp table by optimize()
called by EXPLAIN and we need to preserve the initial query structure
so we can display it.
*/
- select_lex->uncacheable|= UNCACHEABLE_EXPLAIN;
- select_lex->master_unit()->uncacheable|= UNCACHEABLE_EXPLAIN;
- if (join->init_save_join_tab())
+ if (join->need_tmp && join->init_save_join_tab())
DBUG_RETURN(1); /* purecov: inspected */
}
}
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index e4a49fe032d..f85067c56fa 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -200,7 +200,6 @@ public:
{
return trace_unsupported_by_check_vcol_func_processor("subselect");
}
- Item *safe_charset_converter(CHARSET_INFO *tocs);
/**
Get the SELECT_LEX structure associated with this Item.
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 4a7f2a54659..c3835c7536c 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
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
@@ -557,24 +557,27 @@ Item *Item_sum::set_arg(uint i, THD *thd, Item *new_val)
int Item_sum::set_aggregator(Aggregator::Aggregator_type aggregator)
{
- if (aggr)
+ /*
+ Dependent subselects may be executed multiple times, making
+ set_aggregator to be called multiple times. The aggregator type
+ will be the same, but it needs to be reset so that it is
+ reevaluated with the new dependent data.
+ This function may also be called multiple times during query optimization.
+ In this case, the type may change, so we delete the old aggregator,
+ and create a new one.
+ */
+ if (aggr && aggregator == aggr->Aggrtype())
{
- /*
- Dependent subselects may be executed multiple times, making
- set_aggregator to be called multiple times. The aggregator type
- will be the same, but it needs to be reset so that it is
- reevaluated with the new dependent data.
- */
- DBUG_ASSERT(aggregator == aggr->Aggrtype());
aggr->clear();
return FALSE;
}
+
+ delete aggr;
switch (aggregator)
{
case Aggregator::DISTINCT_AGGREGATOR:
aggr= new Aggregator_distinct(this);
break;
-
case Aggregator::SIMPLE_AGGREGATOR:
aggr= new Aggregator_simple(this);
break;
@@ -1143,17 +1146,13 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref)
switch (hybrid_type= item->result_type()) {
case INT_RESULT:
- max_length= 20;
- break;
case DECIMAL_RESULT:
+ case STRING_RESULT:
max_length= item->max_length;
break;
case REAL_RESULT:
max_length= float_length(decimals);
break;
- case STRING_RESULT:
- max_length= item->max_length;
- break;
case ROW_RESULT:
default:
DBUG_ASSERT(0);
@@ -1197,8 +1196,10 @@ void Item_sum_hybrid::setup_hybrid(Item *item, Item *value_arg)
value= Item_cache::get_cache(item);
value->setup(item);
value->store(value_arg);
+ arg_cache= Item_cache::get_cache(item);
+ arg_cache->setup(item);
cmp= new Arg_comparator();
- cmp->set_cmp_func(this, args, (Item**)&value, FALSE);
+ cmp->set_cmp_func(this, (Item**)&arg_cache, (Item**)&value, FALSE);
collation.set(item->collation);
}
@@ -1326,27 +1327,11 @@ void Item_sum_sum::fix_length_and_dec()
bool Item_sum_sum::add()
{
DBUG_ENTER("Item_sum_sum::add");
- bool arg_is_null;
if (hybrid_type == DECIMAL_RESULT)
{
- my_decimal value, *val;
- if (aggr->use_distinct_values)
- {
- /*
- We are aggregating distinct rows. Get the value from the distinct
- table pointer
- */
- Aggregator_distinct *daggr= (Aggregator_distinct *)aggr;
- val= daggr->table->field[0]->val_decimal (&value);
- arg_is_null= daggr->table->field[0]->is_null();
- }
- else
- {
- /* non-distinct aggregation */
- val= args[0]->val_decimal(&value);
- arg_is_null= args[0]->null_value;
- }
- if (!arg_is_null)
+ my_decimal value;
+ const my_decimal *val= aggr->arg_val_decimal(&value);
+ if (!aggr->arg_is_null())
{
my_decimal_add(E_DEC_FATAL_ERROR, dec_buffs + (curr_dec_buff^1),
val, dec_buffs + curr_dec_buff);
@@ -1356,25 +1341,8 @@ bool Item_sum_sum::add()
}
else
{
- double val;
- if (aggr->use_distinct_values)
- {
- /*
- We are aggregating distinct rows. Get the value from the distinct
- table pointer
- */
- Aggregator_distinct *daggr= (Aggregator_distinct *)aggr;
- val= daggr->table->field[0]->val_real ();
- arg_is_null= daggr->table->field[0]->is_null();
- }
- else
- {
- /* non-distinct aggregation */
- val= args[0]->val_real();
- arg_is_null= args[0]->null_value;
- }
- sum+= val;
- if (!arg_is_null)
+ sum+= aggr->arg_val_real();
+ if (!aggr->arg_is_null())
null_value= 0;
}
DBUG_RETURN(0);
@@ -1472,6 +1440,45 @@ Aggregator_distinct::~Aggregator_distinct()
}
+my_decimal *Aggregator_simple::arg_val_decimal(my_decimal *value)
+{
+ return item_sum->args[0]->val_decimal(value);
+}
+
+
+double Aggregator_simple::arg_val_real()
+{
+ return item_sum->args[0]->val_real();
+}
+
+
+bool Aggregator_simple::arg_is_null()
+{
+ return item_sum->args[0]->null_value;
+}
+
+
+my_decimal *Aggregator_distinct::arg_val_decimal(my_decimal * value)
+{
+ return use_distinct_values ? table->field[0]->val_decimal(value) :
+ item_sum->args[0]->val_decimal(value);
+}
+
+
+double Aggregator_distinct::arg_val_real()
+{
+ return use_distinct_values ? table->field[0]->val_real() :
+ item_sum->args[0]->val_real();
+}
+
+
+bool Aggregator_distinct::arg_is_null()
+{
+ return use_distinct_values ? table->field[0]->is_null() :
+ item_sum->args[0]->null_value;
+}
+
+
Item *Item_sum_count::copy_or_same(THD* thd)
{
return new (thd->mem_root) Item_sum_count(thd, this);
@@ -1577,7 +1584,7 @@ bool Item_sum_avg::add()
{
if (Item_sum_sum::add())
return TRUE;
- if (!args[0]->null_value)
+ if (!aggr->arg_is_null())
count++;
return FALSE;
}
@@ -1893,7 +1900,10 @@ double Item_sum_hybrid::val_real()
DBUG_ASSERT(fixed == 1);
if (null_value)
return 0.0;
- return value->val_real();
+ double retval= value->val_real();
+ if ((null_value= value->null_value))
+ DBUG_ASSERT(retval == 0.0);
+ return retval;
}
longlong Item_sum_hybrid::val_int()
@@ -1901,7 +1911,10 @@ longlong Item_sum_hybrid::val_int()
DBUG_ASSERT(fixed == 1);
if (null_value)
return 0;
- return value->val_int();
+ longlong retval= value->val_int();
+ if ((null_value= value->null_value))
+ DBUG_ASSERT(retval == 0);
+ return retval;
}
@@ -1910,7 +1923,10 @@ my_decimal *Item_sum_hybrid::val_decimal(my_decimal *val)
DBUG_ASSERT(fixed == 1);
if (null_value)
return 0;
- return value->val_decimal(val);
+ my_decimal *retval= value->val_decimal(val);
+ if ((null_value= value->null_value))
+ DBUG_ASSERT(retval == NULL);
+ return retval;
}
@@ -1920,7 +1936,10 @@ Item_sum_hybrid::val_str(String *str)
DBUG_ASSERT(fixed == 1);
if (null_value)
return 0;
- return value->val_str(str);
+ String *retval= value->val_str(str);
+ if ((null_value= value->null_value))
+ DBUG_ASSERT(retval == NULL);
+ return retval;
}
@@ -1975,11 +1994,11 @@ Item *Item_sum_min::copy_or_same(THD* thd)
bool Item_sum_min::add()
{
/* args[0] < value */
- int res= cmp->compare();
- if (!args[0]->null_value &&
- (null_value || res < 0))
+ arg_cache->cache_value();
+ if (!arg_cache->null_value &&
+ (null_value || cmp->compare() < 0))
{
- value->store(args[0]);
+ value->store(arg_cache);
value->cache_value();
null_value= 0;
}
@@ -1998,11 +2017,11 @@ Item *Item_sum_max::copy_or_same(THD* thd)
bool Item_sum_max::add()
{
/* args[0] > value */
- int res= cmp->compare();
- if (!args[0]->null_value &&
- (null_value || res > 0))
+ arg_cache->cache_value();
+ if (!arg_cache->null_value &&
+ (null_value || cmp->compare() > 0))
{
- value->store(args[0]);
+ value->store(arg_cache);
value->cache_value();
null_value= 0;
}
@@ -2244,7 +2263,7 @@ void Item_sum_avg::reset_field()
void Item_sum_bit::reset_field()
{
- reset();
+ reset_and_add();
int8store(result_field->ptr, bits);
}
@@ -3057,6 +3076,7 @@ Item_func_group_concat(Name_resolution_context *context_arg,
order_item->item= arg_ptr++;
}
}
+ memcpy(orig_args, args, sizeof(Item*) * arg_count);
}
@@ -3267,7 +3287,6 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref)
if (check_sum_func(thd, ref))
return TRUE;
- memcpy (orig_args, args, sizeof (Item *) * arg_count);
fixed= 1;
return FALSE;
}
@@ -3423,8 +3442,6 @@ String* Item_func_group_concat::val_str(String* str)
void Item_func_group_concat::print(String *str, enum_query_type query_type)
{
- /* orig_args is not filled with valid values until fix_fields() */
- Item **pargs= fixed ? orig_args : args;
str->append(STRING_WITH_LEN("group_concat("));
if (distinct)
str->append(STRING_WITH_LEN("distinct "));
@@ -3432,7 +3449,7 @@ void Item_func_group_concat::print(String *str, enum_query_type query_type)
{
if (i)
str->append(',');
- pargs[i]->print(str, query_type);
+ orig_args[i]->print(str, query_type);
}
if (arg_count_order)
{
@@ -3441,7 +3458,7 @@ void Item_func_group_concat::print(String *str, enum_query_type query_type)
{
if (i)
str->append(',');
- pargs[i + arg_count_field]->print(str, query_type);
+ orig_args[i + arg_count_field]->print(str, query_type);
if (order[i]->asc)
str->append(STRING_WITH_LEN(" ASC"));
else
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 9e017aa98d5..cf5a08ca271 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -101,6 +101,15 @@ public:
*/
virtual void endup() = 0;
+ /** Decimal value of being-aggregated argument */
+ virtual my_decimal *arg_val_decimal(my_decimal * value) = 0;
+ /** Floating point value of being-aggregated argument */
+ virtual double arg_val_real() = 0;
+ /**
+ NULLness of being-aggregated argument; can be called only after
+ arg_val_decimal() or arg_val_real().
+ */
+ virtual bool arg_is_null() = 0;
};
@@ -304,6 +313,7 @@ class st_select_lex;
class Item_sum :public Item_result_field
{
friend class Aggregator_distinct;
+ friend class Aggregator_simple;
protected:
/**
@@ -402,14 +412,22 @@ public:
Item_sum(THD *thd, Item_sum *item);
enum Type type() const { return SUM_FUNC_ITEM; }
virtual enum Sumfunctype sum_func () const=0;
- inline bool reset() { aggregator_clear(); return aggregator_add(); };
+ /**
+ Resets the aggregate value to its default and aggregates the current
+ value of its attribute(s).
+ */
+ inline bool reset_and_add()
+ {
+ aggregator_clear();
+ return aggregator_add();
+ };
/*
Called when new group is started and results are being saved in
- a temporary table. Similar to reset(), but must also store value in
- result_field. Like reset() it is supposed to reset start value to
- default.
- This set of methods (reult_field(), reset_field, update_field()) of
+ a temporary table. Similarly to reset_and_add() it resets the
+ value to its default and aggregates the value of its
+ attribute(s), but must also store it in result_field.
+ This set of methods (result_item(), reset_field, update_field()) of
Item_sum is used only if quick_group is not null. Otherwise
copy_or_same() is used to obtain a copy of this item.
*/
@@ -442,6 +460,7 @@ public:
forced_const= TRUE;
}
virtual bool const_item() const { return forced_const; }
+ virtual bool const_during_execution() const { return false; }
virtual void print(String *str, enum_query_type query_type);
void fix_num_length_and_dec();
@@ -457,11 +476,10 @@ public:
*/
virtual void no_rows_in_result()
{
- if (!aggr)
- set_aggregator(with_distinct ?
- Aggregator::DISTINCT_AGGREGATOR :
- Aggregator::SIMPLE_AGGREGATOR);
- reset();
+ set_aggregator(with_distinct ?
+ Aggregator::DISTINCT_AGGREGATOR :
+ Aggregator::SIMPLE_AGGREGATOR);
+ aggregator_clear();
}
virtual void make_unique() { force_copy_fields= TRUE; }
Item *get_tmp_table_item(THD *thd);
@@ -511,11 +529,10 @@ public:
quick_group= with_distinct ? 0 : 1;
}
- /**
+ /*
Set the type of aggregation : DISTINCT or not.
- Called when the final determination is done about the aggregation
- type and the object is about to be used.
+ May be called multiple times.
*/
int set_aggregator(Aggregator::Aggregator_type aggregator);
@@ -619,6 +636,9 @@ public:
void clear();
bool add();
void endup();
+ virtual my_decimal *arg_val_decimal(my_decimal * value);
+ virtual double arg_val_real();
+ virtual bool arg_is_null();
bool unique_walk_function(void *element);
static int composite_key_cmp(void* arg, uchar* key1, uchar* key2);
@@ -642,6 +662,9 @@ public:
void clear() { item_sum->clear(); }
bool add() { return item_sum->add(); }
void endup() {};
+ virtual my_decimal *arg_val_decimal(my_decimal * value);
+ virtual double arg_val_real();
+ virtual bool arg_is_null();
};
@@ -997,7 +1020,7 @@ class Item_cache;
class Item_sum_hybrid :public Item_sum
{
protected:
- Item_cache *value;
+ Item_cache *value, *arg_cache;
Arg_comparator *cmp;
Item_result hybrid_type;
enum_field_types hybrid_field_type;
@@ -1007,14 +1030,14 @@ protected:
public:
Item_sum_hybrid(Item *item_par,int sign)
- :Item_sum(item_par), value(0), cmp(0),
+ :Item_sum(item_par), value(0), arg_cache(0), cmp(0),
hybrid_type(INT_RESULT), hybrid_field_type(MYSQL_TYPE_LONGLONG),
cmp_sign(sign), was_values(TRUE)
{ collation.set(&my_charset_bin); }
Item_sum_hybrid(THD *thd, Item_sum_hybrid *item)
- :Item_sum(thd, item), value(item->value), hybrid_type(item->hybrid_type),
- hybrid_field_type(item->hybrid_field_type), cmp_sign(item->cmp_sign),
- was_values(item->was_values)
+ :Item_sum(thd, item), value(item->value), arg_cache(0),
+ hybrid_type(item->hybrid_type), hybrid_field_type(item->hybrid_field_type),
+ cmp_sign(item->cmp_sign), was_values(item->was_values)
{ }
bool fix_fields(THD *, Item **);
void setup_hybrid(Item *item, Item *value_arg);
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 6a5260ac235..d7cd2d459f4 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -315,8 +315,8 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
for (; ptr != end && val != val_end; ptr++)
{
/* Skip pre-space between each argument */
- while (val != val_end && my_isspace(cs, *val))
- val++;
+ if ((val+= cs->cset->scan(cs, val, val_end, MY_SEQ_SPACES)) >= val_end)
+ break;
if (*ptr == '%' && ptr+1 != end)
{
@@ -670,7 +670,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
system_charset_info);
break;
case 'W':
- if (type == MYSQL_TIMESTAMP_TIME)
+ if (type == MYSQL_TIMESTAMP_TIME || !(l_time->month || l_time->year))
return 1;
weekday= calc_weekday(calc_daynr(l_time->year,l_time->month,
l_time->day),0);
@@ -679,7 +679,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
system_charset_info);
break;
case 'a':
- if (type == MYSQL_TIMESTAMP_TIME)
+ if (type == MYSQL_TIMESTAMP_TIME || !(l_time->month || l_time->year))
return 1;
weekday=calc_weekday(calc_daynr(l_time->year,l_time->month,
l_time->day),0);
@@ -844,7 +844,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
}
break;
case 'w':
- if (type == MYSQL_TIMESTAMP_TIME)
+ if (type == MYSQL_TIMESTAMP_TIME || !(l_time->month || l_time->year))
return 1;
weekday=calc_weekday(calc_daynr(l_time->year,l_time->month,
l_time->day),1);
@@ -1140,16 +1140,13 @@ String* Item_func_monthname::val_str(String* str)
{
DBUG_ASSERT(fixed == 1);
const char *month_name;
- uint month= (uint) val_int();
uint err;
+ MYSQL_TIME ltime;
- if (null_value || !month)
- {
- null_value=1;
- return (String*) 0;
- }
- null_value=0;
- month_name= locale->month_names->type_names[month-1];
+ if ((null_value= (get_arg0_date(&ltime, TIME_FUZZY_DATE) || !ltime.month)))
+ return (String *) 0;
+
+ month_name= locale->month_names->type_names[ltime.month - 1];
str->copy(month_name, (uint) strlen(month_name), &my_charset_utf8_bin,
collation.collation, &err);
return str;
@@ -1398,6 +1395,26 @@ longlong Item_func_unix_timestamp::val_int()
return (longlong) TIME_to_timestamp(current_thd, &ltime, &not_used);
}
+enum_monotonicity_info Item_func_unix_timestamp::get_monotonicity_info() const
+{
+ if (args[0]->type() == Item::FIELD_ITEM &&
+ (args[0]->field_type() == MYSQL_TYPE_TIMESTAMP))
+ return MONOTONIC_INCREASING;
+ return NON_MONOTONIC;
+}
+
+
+longlong Item_func_unix_timestamp::val_int_endpoint(bool left_endp, bool *incl_endp)
+{
+ DBUG_ASSERT(fixed == 1);
+ DBUG_ASSERT(arg_count == 1 &&
+ args[0]->type() == Item::FIELD_ITEM &&
+ args[0]->field_type() == MYSQL_TYPE_TIMESTAMP);
+ Field *field=((Item_field*) args[0])->field;
+ /* Leave the incl_endp intact */
+ return ((Field_timestamp*) field)->get_timestamp(&null_value);
+}
+
longlong Item_func_time_to_sec::val_int()
{
@@ -1601,6 +1618,11 @@ bool Item_func_from_days::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
return 1;
bzero(ltime, sizeof(MYSQL_TIME));
get_date_from_daynr((long) value, &ltime->year, &ltime->month, &ltime->day);
+
+ if ((null_value= (fuzzy_date & TIME_NO_ZERO_DATE) &&
+ (ltime->year == 0 || ltime->month == 0 || ltime->day == 0)))
+ return TRUE;
+
ltime->time_type= MYSQL_TIMESTAMP_DATE;
return 0;
}
@@ -2212,8 +2234,6 @@ void Item_date_add_interval::fix_length_and_dec()
enum_field_types arg0_field_type;
maybe_null=1;
- fix_length_and_charset_datetime(MAX_DATETIME_FULL_WIDTH);
- value.alloc(max_length);
/*
The field type for the result of an Item_date function is defined as
@@ -2238,6 +2258,21 @@ void Item_date_add_interval::fix_length_and_dec()
else
cached_field_type= MYSQL_TYPE_DATETIME;
}
+
+ if (cached_field_type == MYSQL_TYPE_STRING)
+ {
+ /* Behave as a usual string function when return type is VARCHAR. */
+ fix_length_and_charset(MAX_DATETIME_FULL_WIDTH, default_charset());
+ }
+ else
+ {
+ /*
+ Follow the "Number-to-string conversion" rules as in WorkLog 2649
+ when return type is DATE or DATETIME.
+ */
+ fix_length_and_charset_datetime(MAX_DATETIME_FULL_WIDTH);
+ }
+ value.alloc(max_length);
}
@@ -2260,7 +2295,7 @@ bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
}
-String *Item_date_add_interval::val_str(String *str)
+String *Item_date_add_interval::val_str_ascii(String *str)
{
DBUG_ASSERT(fixed == 1);
MYSQL_TIME ltime;
@@ -2521,6 +2556,19 @@ String *Item_char_typecast::val_str(String *str)
String *res;
uint32 length;
+ if (cast_length >= 0 &&
+ ((unsigned) cast_length) > current_thd->variables.max_allowed_packet)
+ {
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_ALLOWED_PACKET_OVERFLOWED,
+ ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
+ cast_cs == &my_charset_bin ?
+ "cast_as_binary" : func_name(),
+ current_thd->variables.max_allowed_packet);
+ null_value= 1;
+ return 0;
+ }
+
if (!charset_conversion)
{
if (!(res= args[0]->val_str(str)))
@@ -2533,14 +2581,14 @@ String *Item_char_typecast::val_str(String *str)
{
// Convert character set if differ
uint dummy_errors;
- if (!(res= args[0]->val_str(&tmp_value)) ||
- str->copy(res->ptr(), res->length(), from_cs,
- cast_cs, &dummy_errors))
+ if (!(res= args[0]->val_str(str)) ||
+ tmp_value.copy(res->ptr(), res->length(), from_cs,
+ cast_cs, &dummy_errors))
{
null_value= 1;
return 0;
}
- res= str;
+ res= &tmp_value;
}
res->set_charset(cast_cs);
@@ -2575,9 +2623,9 @@ String *Item_char_typecast::val_str(String *str)
{
if (res->alloced_length() < (uint) cast_length)
{
- str->alloc(cast_length);
- str->copy(*res);
- res= str;
+ str_value.alloc(cast_length);
+ str_value.copy(*res);
+ res= &str_value;
}
bzero((char*) res->ptr() + res->length(),
(uint) cast_length - res->length());
@@ -2763,7 +2811,7 @@ String *Item_func_makedate::val_str(String *str)
long days;
if (args[0]->null_value || args[1]->null_value ||
- year < 0 || daynr <= 0)
+ year < 0 || year > 9999 || daynr <= 0)
goto err;
if (year < 100)
@@ -2806,7 +2854,7 @@ longlong Item_func_makedate::val_int()
long days;
if (args[0]->null_value || args[1]->null_value ||
- year < 0 || daynr <= 0)
+ year < 0 || year > 9999 || daynr <= 0)
goto err;
if (year < 100)
@@ -2864,10 +2912,11 @@ void Item_func_add_time::fix_length_and_dec()
Result: Time value or datetime value
*/
-String *Item_func_add_time::val_str(String *str)
+MYSQL_TIME *Item_func_add_time::val_datetime(MYSQL_TIME *time,
+ date_time_format_types *format)
{
DBUG_ASSERT(fixed == 1);
- MYSQL_TIME l_time1, l_time2, l_time3;
+ MYSQL_TIME l_time1, l_time2;
bool is_time= 0;
long days, microseconds;
longlong seconds;
@@ -2893,41 +2942,38 @@ String *Item_func_add_time::val_str(String *str)
if (l_time1.neg != l_time2.neg)
l_sign= -l_sign;
- bzero((char *)&l_time3, sizeof(l_time3));
+ bzero((char *)time, sizeof(MYSQL_TIME));
- l_time3.neg= calc_time_diff(&l_time1, &l_time2, -l_sign,
- &seconds, &microseconds);
+ time->neg= calc_time_diff(&l_time1, &l_time2, -l_sign,
+ &seconds, &microseconds);
/*
If first argument was negative and diff between arguments
is non-zero we need to swap sign to get proper result.
*/
if (l_time1.neg && (seconds || microseconds))
- l_time3.neg= 1-l_time3.neg; // Swap sign of result
+ time->neg= 1 - time->neg; // Swap sign of result
- if (!is_time && l_time3.neg)
+ if (!is_time && time->neg)
goto null_date;
days= (long)(seconds/86400L);
- calc_time_from_sec(&l_time3, (long)(seconds%86400L), microseconds);
+ calc_time_from_sec(time, (long)(seconds%86400L), microseconds);
if (!is_time)
{
- get_date_from_daynr(days,&l_time3.year,&l_time3.month,&l_time3.day);
- if (l_time3.day &&
- !make_datetime(l_time1.second_part || l_time2.second_part ?
- DATE_TIME_MICROSECOND : DATE_TIME,
- &l_time3, str))
- return str;
+ get_date_from_daynr(days, &time->year, &time->month, &time->day);
+ *format= l_time1.second_part || l_time2.second_part ?
+ DATE_TIME_MICROSECOND : DATE_TIME;
+ if (time->day)
+ return time;
goto null_date;
}
-
- l_time3.hour+= days*24;
- if (!make_datetime_with_warn(l_time1.second_part || l_time2.second_part ?
- TIME_MICROSECOND : TIME_ONLY,
- &l_time3, str))
- return str;
+ *format= l_time1.second_part || l_time2.second_part ?
+ TIME_MICROSECOND : TIME_ONLY;
+ time->hour+= days*24;
+ return time;
null_date:
null_value=1;
@@ -2935,6 +2981,38 @@ null_date:
}
+String *Item_func_add_time::val_str(String *str)
+{
+ MYSQL_TIME ltime;
+ date_time_format_types format;
+
+ val_datetime(&ltime, &format);
+
+ if (null_value)
+ return 0;
+
+ if (!make_datetime_with_warn(format, &ltime, str))
+ return str;
+
+ null_value= 1;
+ return 0;
+}
+
+
+longlong Item_func_add_time::val_int()
+{
+ MYSQL_TIME ltime;
+ date_time_format_types format;
+
+ val_datetime(&ltime, &format);
+
+ if (null_value)
+ return 0;
+
+ return TIME_to_ulonglong_datetime(&ltime);
+}
+
+
void Item_func_add_time::print(String *str, enum_query_type query_type)
{
if (is_date)
@@ -3372,6 +3450,7 @@ void Item_func_str_to_date::fix_length_and_dec()
{
maybe_null= 1;
decimals=0;
+ cached_format_type= DATE_TIME;
cached_field_type= MYSQL_TYPE_DATETIME;
max_length= MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
cached_timestamp_type= MYSQL_TIMESTAMP_NONE;
@@ -3442,7 +3521,7 @@ bool Item_func_str_to_date::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
return 0;
null_date:
- if (fuzzy_date & TIME_NO_ZERO_DATE)
+ if (val && (fuzzy_date & TIME_NO_ZERO_DATE))
{
char buff[128];
strmake(buff, val->ptr(), min(val->length(), sizeof(buff)-1));
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index c4c8fe39933..c6e081df182 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -1,7 +1,7 @@
#ifndef ITEM_TIMEFUNC_INCLUDED
#define ITEM_TIMEFUNC_INCLUDED
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -76,6 +76,10 @@ public:
longlong val_int_endpoint(bool left_endp, bool *incl_endp);
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_date_args();
+ }
};
@@ -103,6 +107,12 @@ public:
*input_version= output_version;
return 0;
}
+
+ /* Only meaningful with date part and optional time part */
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_date_args();
+ }
};
@@ -120,6 +130,10 @@ public:
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_date_args();
+ }
};
@@ -132,8 +146,11 @@ public:
{ DBUG_ASSERT(fixed == 1); return (double) Item_func_month::val_int(); }
String *val_str(String *str)
{
- str->set(val_int(), collation.collation);
- return null_value ? 0 : str;
+ longlong nr= val_int();
+ if (null_value)
+ return 0;
+ str->set(nr, collation.collation);
+ return str;
}
const char *func_name() const { return "month"; }
enum Item_result result_type () const { return INT_RESULT; }
@@ -145,20 +162,27 @@ public:
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_date_args();
+ }
};
-class Item_func_monthname :public Item_func_month
+class Item_func_monthname :public Item_str_func
{
MY_LOCALE *locale;
public:
- Item_func_monthname(Item *a) :Item_func_month(a) {}
+ Item_func_monthname(Item *a) :Item_str_func(a) {}
const char *func_name() const { return "monthname"; }
String *val_str(String *str);
- enum Item_result result_type () const { return STRING_RESULT; }
void fix_length_and_dec();
bool check_partition_func_processor(uchar *int_arg) {return TRUE;}
bool check_vcol_func_processor(uchar *int_arg) {return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_date_args();
+ }
};
@@ -176,6 +200,10 @@ public:
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_date_args();
+ }
};
@@ -193,6 +221,10 @@ public:
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_time_args();
+ }
};
@@ -210,6 +242,10 @@ public:
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_time_args();
+ }
};
@@ -227,6 +263,10 @@ public:
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_date_args();
+ }
};
@@ -244,6 +284,10 @@ public:
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_time_args();
+ }
};
@@ -275,6 +319,10 @@ public:
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_date_args();
+ }
};
@@ -294,6 +342,10 @@ public:
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_date_args();
+ }
};
@@ -324,6 +376,10 @@ public:
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_date_args();
+ }
};
class Item_func_dayname :public Item_func_weekday
@@ -348,13 +404,15 @@ public:
Item_func_unix_timestamp(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "unix_timestamp"; }
+ enum_monotonicity_info get_monotonicity_info() const;
+ longlong val_int_endpoint(bool left_endp, bool *incl_endp);
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
/*
UNIX_TIMESTAMP() depends on the current timezone
(and thus may not be used as a partitioning function)
when its argument is NOT of the TIMESTAMP type.
*/
- bool is_timezone_dependent_processor(uchar *int_arg)
+ bool check_valid_arguments_processor(uchar *int_arg)
{
return !has_timestamp_args();
}
@@ -382,11 +440,16 @@ public:
const char *func_name() const { return "time_to_sec"; }
void fix_length_and_dec()
{
+ maybe_null= TRUE;
decimals=0;
max_length=10*MY_CHARSET_BIN_MB_MAXLEN;
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_time_args();
+ }
};
@@ -655,6 +718,10 @@ public:
bool get_date(MYSQL_TIME *res, uint fuzzy_date);
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return has_date_args() || has_time_args();
+ }
};
@@ -749,16 +816,32 @@ class Item_date_add_interval :public Item_date_func
{
String value;
enum_field_types cached_field_type;
-
+ String ascii_buf;
public:
const interval_type int_type; // keep it public
const bool date_sub_interval; // keep it public
Item_date_add_interval(Item *a,Item *b,interval_type type_arg,bool neg_arg)
:Item_date_func(a,b),int_type(type_arg), date_sub_interval(neg_arg) {}
- String *val_str(String *);
+ String *val_str_ascii(String *str);
+ String *val_str(String *str)
+ {
+ return val_str_from_val_str_ascii(str, &ascii_buf);
+ }
const char *func_name() const { return "date_add_interval"; }
void fix_length_and_dec();
enum_field_types field_type() const { return cached_field_type; }
+ CHARSET_INFO *charset_for_protocol(void) const
+ {
+ /*
+ DATE_ADD() can return DATE, DATETIME or VARCHAR depending on arguments.
+ Send using "binary" when DATE or DATETIME,
+ or using collation.collation when VARCHAR
+ (which was fixed from @collation_connection in fix_length_and_dec).
+ */
+ DBUG_ASSERT(fixed == 1);
+ return cached_field_type == MYSQL_TYPE_STRING ?
+ collation.collation : &my_charset_bin;
+ }
longlong val_int();
bool get_date(MYSQL_TIME *res, uint fuzzy_date);
bool eq(const Item *item, bool binary_cmp) const;
@@ -781,6 +864,42 @@ class Item_extract :public Item_int_func
virtual void print(String *str, enum_query_type query_type);
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ switch (int_type) {
+ case INTERVAL_YEAR:
+ case INTERVAL_YEAR_MONTH:
+ case INTERVAL_QUARTER:
+ case INTERVAL_MONTH:
+ /* case INTERVAL_WEEK: Not allowed as partitioning function, bug#57071 */
+ case INTERVAL_DAY:
+ return !has_date_args();
+ case INTERVAL_DAY_HOUR:
+ case INTERVAL_DAY_MINUTE:
+ case INTERVAL_DAY_SECOND:
+ case INTERVAL_DAY_MICROSECOND:
+ return !has_datetime_args();
+ case INTERVAL_HOUR:
+ case INTERVAL_HOUR_MINUTE:
+ case INTERVAL_HOUR_SECOND:
+ case INTERVAL_MINUTE:
+ case INTERVAL_MINUTE_SECOND:
+ case INTERVAL_SECOND:
+ case INTERVAL_MICROSECOND:
+ case INTERVAL_HOUR_MICROSECOND:
+ case INTERVAL_MINUTE_MICROSECOND:
+ case INTERVAL_SECOND_MICROSECOND:
+ return !has_time_args();
+ default:
+ /*
+ INTERVAL_LAST is only an end marker,
+ INTERVAL_WEEK depends on default_week_format which is a session
+ variable and cannot be used for partitioning. See bug#57071.
+ */
+ break;
+ }
+ return true;
+ }
};
@@ -984,6 +1103,8 @@ public:
return save_date_in_field(field);
return Item_str_func::save_in_field(field, no_conversions);
}
+ longlong val_int();
+ MYSQL_TIME *val_datetime(MYSQL_TIME *time, date_time_format_types *format);
};
class Item_func_timediff :public Item_str_timefunc
@@ -1025,6 +1146,10 @@ public:
}
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
bool check_vcol_func_processor(uchar *int_arg) { return FALSE;}
+ bool check_valid_arguments_processor(uchar *int_arg)
+ {
+ return !has_time_args();
+ }
};
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index 792008ba35e..183c07c1781 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -2807,12 +2807,12 @@ String *Item_func_xml_extractvalue::val_str(String *str)
null_value= 0;
if (!nodeset_func ||
!(res= args[0]->val_str(str)) ||
- !parse_xml(res, &pxml))
+ !parse_xml(res, &pxml) ||
+ !(res= nodeset_func->val_str(&tmp_value)))
{
null_value= 1;
return 0;
}
- res= nodeset_func->val_str(&tmp_value);
return res;
}
diff --git a/sql/key.cc b/sql/key.cc
index 8c7eab2a688..819b79879e8 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -360,12 +360,10 @@ void key_unpack(String *to,TABLE *table,uint idx)
if (field->binary() && field->type() == MYSQL_TYPE_STRING && tmp.length())
{
const char *tmp_end= tmp.ptr() + tmp.length();
- while (tmp_end > tmp.ptr() && !*--tmp_end);
+ while (tmp_end > tmp.ptr() && !*--tmp_end) ;
tmp.length(tmp_end - tmp.ptr() + 1);
}
- if (cs->mbmaxlen > 1 &&
- table->field[key_part->fieldnr - 1]->field_length !=
- key_part->length)
+ if (cs->mbmaxlen > 1 && (key_part->key_part_flag & HA_PART_KEY_SEG))
{
/*
Prefix key, multi-byte charset.
diff --git a/sql/lex.h b/sql/lex.h
index b1c23e81748..982034c31af 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -427,8 +427,9 @@ static SYMBOL symbols[] = {
{ "PROCEDURE", SYM(PROCEDURE_SYM)},
{ "PROCESS" , SYM(PROCESS)},
{ "PROCESSLIST", SYM(PROCESSLIST_SYM)},
- { "PROFILE", SYM(PROFILE_SYM)},
- { "PROFILES", SYM(PROFILES_SYM)},
+ { "PROFILE", SYM(PROFILE_SYM)},
+ { "PROFILES", SYM(PROFILES_SYM)},
+ { "PROXY", SYM(PROXY_SYM)},
{ "PURGE", SYM(PURGE)},
{ "QUARTER", SYM(QUARTER_SYM)},
{ "QUERY", SYM(QUERY_SYM)},
diff --git a/sql/lock.cc b/sql/lock.cc
index 26a8a1ba35b..e88fa252517 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -806,8 +806,11 @@ bool lock_schema_name(THD *thd, const char *db)
return TRUE;
}
- global_request.init(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE);
- mdl_request.init(MDL_key::SCHEMA, db, "", MDL_EXCLUSIVE);
+ if (thd->global_read_lock.can_acquire_protection())
+ return TRUE;
+ global_request.init(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE,
+ MDL_STATEMENT);
+ mdl_request.init(MDL_key::SCHEMA, db, "", MDL_EXCLUSIVE, MDL_TRANSACTION);
mdl_requests.push_front(&mdl_request);
mdl_requests.push_front(&global_request);
@@ -822,13 +825,13 @@ bool lock_schema_name(THD *thd, const char *db)
/**
- Obtain an exclusive metadata lock on the stored routine name.
+ Obtain an exclusive metadata lock on an object name.
@param thd Thread handle.
- @param is_function Stored routine type (only functions or procedures
- are name-locked.
- @param db The schema the routine belongs to.
- @param name Routine name.
+ @param mdl_type Object type (currently functions, procedures
+ and events can be name-locked).
+ @param db The schema the object belongs to.
+ @param name Object name in the schema.
This function assumes that no metadata locks were acquired
before calling it. Additionally, it cannot be called while
@@ -844,12 +847,9 @@ bool lock_schema_name(THD *thd, const char *db)
or this connection was killed.
*/
-bool lock_routine_name(THD *thd, bool is_function,
+bool lock_object_name(THD *thd, MDL_key::enum_mdl_namespace mdl_type,
const char *db, const char *name)
{
- MDL_key::enum_mdl_namespace mdl_type= (is_function ?
- MDL_key::FUNCTION :
- MDL_key::PROCEDURE);
MDL_request_list mdl_requests;
MDL_request global_request;
MDL_request schema_request;
@@ -865,9 +865,13 @@ bool lock_routine_name(THD *thd, bool is_function,
DBUG_ASSERT(name);
DEBUG_SYNC(thd, "before_wait_locked_pname");
- global_request.init(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE);
- schema_request.init(MDL_key::SCHEMA, db, "", MDL_INTENTION_EXCLUSIVE);
- mdl_request.init(mdl_type, db, name, MDL_EXCLUSIVE);
+ if (thd->global_read_lock.can_acquire_protection())
+ return TRUE;
+ global_request.init(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE,
+ MDL_STATEMENT);
+ schema_request.init(MDL_key::SCHEMA, db, "", MDL_INTENTION_EXCLUSIVE,
+ MDL_TRANSACTION);
+ mdl_request.init(mdl_type, db, name, MDL_EXCLUSIVE, MDL_TRANSACTION);
mdl_requests.push_front(&mdl_request);
mdl_requests.push_front(&schema_request);
@@ -917,45 +921,24 @@ static void print_lock_error(int error, const char *table)
/****************************************************************************
Handling of global read locks
+ Global read lock is implemented using metadata lock infrastructure.
+
Taking the global read lock is TWO steps (2nd step is optional; without
it, COMMIT of existing transactions will be allowed):
lock_global_read_lock() THEN make_global_read_lock_block_commit().
- The global locks are handled through the global variables:
- global_read_lock
- count of threads which have the global read lock (i.e. have completed at
- least the first step above)
- global_read_lock_blocks_commit
- count of threads which have the global read lock and block
- commits (i.e. are in or have completed the second step above)
- waiting_for_read_lock
- count of threads which want to take a global read lock but cannot
- protect_against_global_read_lock
- count of threads which have set protection against global read lock.
-
- access to them is protected with a mutex LOCK_global_read_lock
-
- (XXX: one should never take LOCK_open if LOCK_global_read_lock is
- taken, otherwise a deadlock may occur. Other mutexes could be a
- problem too - grep the code for global_read_lock if you want to use
- any other mutex here) Also one must not hold LOCK_open when calling
- wait_if_global_read_lock(). When the thread with the global read lock
- tries to close its tables, it needs to take LOCK_open in
- close_thread_table().
-
How blocking of threads by global read lock is achieved: that's
- advisory. Any piece of code which should be blocked by global read lock must
- be designed like this:
- - call to wait_if_global_read_lock(). When this returns 0, no global read
- lock is owned; if argument abort_on_refresh was 0, none can be obtained.
- - job
- - if abort_on_refresh was 0, call to start_waiting_global_read_lock() to
- allow other threads to get the global read lock. I.e. removal of the
- protection.
- (Note: it's a bit like an implementation of rwlock).
-
- [ I am sorry to mention some SQL syntaxes below I know I shouldn't but found
- no better descriptive way ]
+ semi-automatic. We assume that any statement which should be blocked
+ by global read lock will either open and acquires write-lock on tables
+ or acquires metadata locks on objects it is going to modify. For any
+ such statement global IX metadata lock is automatically acquired for
+ its duration (in case of LOCK TABLES until end of LOCK TABLES mode).
+ And lock_global_read_lock() simply acquires global S metadata lock
+ and thus prohibits execution of statements which modify data (unless
+ they modify only temporary tables). If deadlock happens it is detected
+ by MDL subsystem and resolved in the standard fashion (by backing-off
+ metadata locks acquired so far and restarting open tables process
+ if possible).
Why does FLUSH TABLES WITH READ LOCK need to block COMMIT: because it's used
to read a non-moving SHOW MASTER STATUS, and a COMMIT writes to the binary
@@ -989,11 +972,6 @@ static void print_lock_error(int error, const char *table)
****************************************************************************/
-volatile uint global_read_lock=0;
-volatile uint global_read_lock_blocks_commit=0;
-static volatile uint protect_against_global_read_lock=0;
-static volatile uint waiting_for_read_lock=0;
-
/**
Take global read lock, wait if there is protection against lock.
@@ -1014,85 +992,17 @@ bool Global_read_lock::lock_global_read_lock(THD *thd)
if (!m_state)
{
MDL_request mdl_request;
- const char *old_message;
- const char *new_message= "Waiting to get readlock";
- (void) mysql_mutex_lock(&LOCK_global_read_lock);
-
-#if defined(ENABLED_DEBUG_SYNC)
- /*
- The below sync point fires if we have to wait for
- protect_against_global_read_lock.
-
- WARNING: Beware to use WAIT_FOR with this sync point. We hold
- LOCK_global_read_lock here.
-
- Call the sync point before calling enter_cond() as it does use
- enter_cond() and exit_cond() itself if a WAIT_FOR action is
- executed in spite of the above warning.
-
- Pre-set proc_info so that it is available immediately after the
- sync point sends a SIGNAL. This makes tests more reliable.
- */
- if (protect_against_global_read_lock)
- {
- thd_proc_info(thd, new_message);
- DEBUG_SYNC(thd, "wait_lock_global_read_lock");
- }
-#endif /* defined(ENABLED_DEBUG_SYNC) */
-
- old_message=thd->enter_cond(&COND_global_read_lock, &LOCK_global_read_lock,
- new_message);
- DBUG_PRINT("info",
- ("waiting_for: %d protect_against: %d",
- waiting_for_read_lock, protect_against_global_read_lock));
-
- waiting_for_read_lock++;
- while (protect_against_global_read_lock && !thd->killed)
- mysql_cond_wait(&COND_global_read_lock, &LOCK_global_read_lock);
- waiting_for_read_lock--;
- if (thd->killed)
- {
- thd->exit_cond(old_message);
- DBUG_RETURN(1);
- }
- m_state= GRL_ACQUIRED;
- global_read_lock++;
- thd->exit_cond(old_message); // this unlocks LOCK_global_read_lock
- /*
- When we perform FLUSH TABLES or ALTER TABLE under LOCK TABLES,
- tables being reopened are protected only by meta-data locks at
- some point. To avoid sneaking in with our global read lock at
- this moment we have to take global shared meta data lock.
-
- TODO: We should change this code to acquire global shared metadata
- lock before acquiring global read lock. But in order to do
- this we have to get rid of all those places in which
- wait_if_global_read_lock() is called before acquiring
- metadata locks first. Also long-term we should get rid of
- redundancy between metadata locks, global read lock and DDL
- blocker (see WL#4399 and WL#4400).
- */
DBUG_ASSERT(! thd->mdl_context.is_lock_owner(MDL_key::GLOBAL, "", "",
MDL_SHARED));
- mdl_request.init(MDL_key::GLOBAL, "", "", MDL_SHARED);
+ mdl_request.init(MDL_key::GLOBAL, "", "", MDL_SHARED, MDL_EXPLICIT);
if (thd->mdl_context.acquire_lock(&mdl_request,
thd->variables.lock_wait_timeout))
- {
- /* Our thread was killed -- return back to initial state. */
- mysql_mutex_lock(&LOCK_global_read_lock);
- if (!(--global_read_lock))
- {
- DBUG_PRINT("signal", ("Broadcasting COND_global_read_lock"));
- mysql_cond_broadcast(&COND_global_read_lock);
- }
- mysql_mutex_unlock(&LOCK_global_read_lock);
- m_state= GRL_NONE;
DBUG_RETURN(1);
- }
- thd->mdl_context.move_ticket_after_trans_sentinel(mdl_request.ticket);
+
m_mdl_global_shared_lock= mdl_request.ticket;
+ m_state= GRL_ACQUIRED;
}
/*
We DON'T set global_read_lock_blocks_commit now, it will be set after
@@ -1118,166 +1028,22 @@ bool Global_read_lock::lock_global_read_lock(THD *thd)
void Global_read_lock::unlock_global_read_lock(THD *thd)
{
- uint tmp;
DBUG_ENTER("unlock_global_read_lock");
- DBUG_PRINT("info",
- ("global_read_lock: %u global_read_lock_blocks_commit: %u",
- global_read_lock, global_read_lock_blocks_commit));
DBUG_ASSERT(m_mdl_global_shared_lock && m_state);
- thd->mdl_context.release_lock(m_mdl_global_shared_lock);
- m_mdl_global_shared_lock= NULL;
-
- mysql_mutex_lock(&LOCK_global_read_lock);
- tmp= --global_read_lock;
- if (m_state == GRL_ACQUIRED_AND_BLOCKS_COMMIT)
- --global_read_lock_blocks_commit;
- mysql_mutex_unlock(&LOCK_global_read_lock);
- /* Send the signal outside the mutex to avoid a context switch */
- if (!tmp)
+ if (m_mdl_blocks_commits_lock)
{
- DBUG_PRINT("signal", ("Broadcasting COND_global_read_lock"));
- mysql_cond_broadcast(&COND_global_read_lock);
+ thd->mdl_context.release_lock(m_mdl_blocks_commits_lock);
+ m_mdl_blocks_commits_lock= NULL;
}
+ thd->mdl_context.release_lock(m_mdl_global_shared_lock);
+ m_mdl_global_shared_lock= NULL;
m_state= GRL_NONE;
DBUG_VOID_RETURN;
}
-/**
- Wait if the global read lock is set, and optionally seek protection against
- global read lock.
-
- See also "Handling of global read locks" above.
-
- @param thd Reference to thread.
- @param abort_on_refresh If True, abort waiting if a refresh occurs,
- do NOT seek protection against GRL.
- If False, wait until the GRL is released and seek
- protection against GRL.
- @param is_not_commit If False, called from a commit operation,
- wait only if commit blocking is also enabled.
-
- @retval False Success, protection against global read lock is set
- (if !abort_on_refresh)
- @retval True Failure, wait was aborted or thread was killed.
-*/
-
-#define must_wait (global_read_lock && \
- (is_not_commit || \
- global_read_lock_blocks_commit))
-
-bool Global_read_lock::
-wait_if_global_read_lock(THD *thd, bool abort_on_refresh,
- bool is_not_commit)
-{
- const char *UNINIT_VAR(old_message);
- bool result= 0, need_exit_cond;
- DBUG_ENTER("wait_if_global_read_lock");
-
- /*
- If we already have protection against global read lock,
- just increment the counter.
- */
- if (unlikely(m_protection_count > 0))
- {
- if (!abort_on_refresh)
- m_protection_count++;
- DBUG_RETURN(FALSE);
- }
- /*
- Assert that we do not own LOCK_open. If we would own it, other
- threads could not close their tables. This would make a pretty
- deadlock.
- */
- mysql_mutex_assert_not_owner(&LOCK_open);
-
- mysql_mutex_lock(&LOCK_global_read_lock);
- if ((need_exit_cond= must_wait))
- {
- if (m_state) // This thread had the read locks
- {
- if (is_not_commit)
- my_message(ER_CANT_UPDATE_WITH_READLOCK,
- ER(ER_CANT_UPDATE_WITH_READLOCK), MYF(0));
- mysql_mutex_unlock(&LOCK_global_read_lock);
- /*
- We allow FLUSHer to COMMIT; we assume FLUSHer knows what it does.
- This allowance is needed to not break existing versions of innobackup
- which do a BEGIN; INSERT; FLUSH TABLES WITH READ LOCK; COMMIT.
- */
- DBUG_RETURN(is_not_commit);
- }
- old_message=thd->enter_cond(&COND_global_read_lock, &LOCK_global_read_lock,
- "Waiting for release of readlock");
- while (must_wait && ! thd->killed &&
- (!abort_on_refresh || !thd->open_tables ||
- thd->open_tables->s->version == refresh_version))
- {
- DBUG_PRINT("signal", ("Waiting for COND_global_read_lock"));
- mysql_cond_wait(&COND_global_read_lock, &LOCK_global_read_lock);
- DBUG_PRINT("signal", ("Got COND_global_read_lock"));
- }
- if (thd->killed)
- result=1;
- }
- if (!abort_on_refresh && !result)
- {
- m_protection_count++;
- protect_against_global_read_lock++;
- DBUG_PRINT("sql_lock", ("protect_against_global_read_lock incr: %u",
- protect_against_global_read_lock));
- }
- /*
- The following is only true in case of a global read locks (which is rare)
- and if old_message is set
- */
- if (unlikely(need_exit_cond))
- thd->exit_cond(old_message); // this unlocks LOCK_global_read_lock
- else
- mysql_mutex_unlock(&LOCK_global_read_lock);
- DBUG_RETURN(result);
-}
-
-
-/**
- Release protection against global read lock and restart
- global read lock waiters.
-
- Should only be called if we have protection against global read lock.
-
- See also "Handling of global read locks" above.
-
- @param thd Reference to thread.
-*/
-
-void Global_read_lock::start_waiting_global_read_lock(THD *thd)
-{
- bool tmp;
- DBUG_ENTER("start_waiting_global_read_lock");
- /*
- Ignore request if we do not have protection against global read lock.
- (Note that this is a violation of the interface contract, hence the assert).
- */
- DBUG_ASSERT(m_protection_count > 0);
- if (unlikely(m_protection_count == 0))
- DBUG_VOID_RETURN;
- /* Decrement local read lock protection counter, return if we still have it */
- if (unlikely(--m_protection_count > 0))
- DBUG_VOID_RETURN;
- if (unlikely(m_state))
- DBUG_VOID_RETURN;
- mysql_mutex_lock(&LOCK_global_read_lock);
- DBUG_ASSERT(protect_against_global_read_lock);
- tmp= (!--protect_against_global_read_lock &&
- (waiting_for_read_lock || global_read_lock_blocks_commit));
- mysql_mutex_unlock(&LOCK_global_read_lock);
- if (tmp)
- mysql_cond_broadcast(&COND_global_read_lock);
- DBUG_VOID_RETURN;
-}
-
/**
Make global read lock also block commits.
@@ -1296,8 +1062,7 @@ void Global_read_lock::start_waiting_global_read_lock(THD *thd)
bool Global_read_lock::make_global_read_lock_block_commit(THD *thd)
{
- bool error;
- const char *old_message;
+ MDL_request mdl_request;
DBUG_ENTER("make_global_read_lock_block_commit");
/*
If we didn't succeed lock_global_read_lock(), or if we already suceeded
@@ -1305,42 +1070,32 @@ bool Global_read_lock::make_global_read_lock_block_commit(THD *thd)
*/
if (m_state != GRL_ACQUIRED)
DBUG_RETURN(0);
- mysql_mutex_lock(&LOCK_global_read_lock);
- /* increment this BEFORE waiting on cond (otherwise race cond) */
- global_read_lock_blocks_commit++;
- /* For testing we set up some blocking, to see if we can be killed */
- DBUG_EXECUTE_IF("make_global_read_lock_block_commit_loop",
- protect_against_global_read_lock++;);
- old_message= thd->enter_cond(&COND_global_read_lock, &LOCK_global_read_lock,
- "Waiting for all running commits to finish");
- while (protect_against_global_read_lock && !thd->killed)
- mysql_cond_wait(&COND_global_read_lock, &LOCK_global_read_lock);
- DBUG_EXECUTE_IF("make_global_read_lock_block_commit_loop",
- protect_against_global_read_lock--;);
- if ((error= test(thd->killed)))
- global_read_lock_blocks_commit--; // undo what we did
- else
- m_state= GRL_ACQUIRED_AND_BLOCKS_COMMIT;
- thd->exit_cond(old_message); // this unlocks LOCK_global_read_lock
- DBUG_RETURN(error);
+
+ mdl_request.init(MDL_key::COMMIT, "", "", MDL_SHARED, MDL_EXPLICIT);
+
+ if (thd->mdl_context.acquire_lock(&mdl_request,
+ thd->variables.lock_wait_timeout))
+ DBUG_RETURN(TRUE);
+
+ m_mdl_blocks_commits_lock= mdl_request.ticket;
+ m_state= GRL_ACQUIRED_AND_BLOCKS_COMMIT;
+
+ DBUG_RETURN(FALSE);
}
/**
- Broadcast COND_global_read_lock.
-
- TODO/FIXME: Dmitry thinks that we broadcast on COND_global_read_lock
- when old instance of table is closed to avoid races
- between incrementing refresh_version and
- wait_if_global_read_lock(thd, TRUE, FALSE) call.
- Once global read lock implementation starts using MDL
- infrastructure this will became unnecessary and should
- be removed.
+ Set explicit duration for metadata locks which are used to implement GRL.
+
+ @param thd Reference to thread.
*/
-void broadcast_refresh(void)
+void Global_read_lock::set_explicit_lock_duration(THD *thd)
{
- mysql_cond_broadcast(&COND_global_read_lock);
+ if (m_mdl_global_shared_lock)
+ thd->mdl_context.set_lock_duration(m_mdl_global_shared_lock, MDL_EXPLICIT);
+ if (m_mdl_blocks_commits_lock)
+ thd->mdl_context.set_lock_duration(m_mdl_blocks_commits_lock, MDL_EXPLICIT);
}
/**
diff --git a/sql/lock.h b/sql/lock.h
index c097c8d269e..6f779595af8 100644
--- a/sql/lock.h
+++ b/sql/lock.h
@@ -2,6 +2,7 @@
#define LOCK_INCLUDED
#include "thr_lock.h" /* thr_lock_type */
+#include "mdl.h"
// Forward declarations
struct TABLE;
@@ -18,11 +19,10 @@ void mysql_lock_remove(THD *thd, MYSQL_LOCK *locked,TABLE *table);
void mysql_lock_abort(THD *thd, TABLE *table, bool upgrade_lock);
bool mysql_lock_abort_for_thread(THD *thd, TABLE *table);
MYSQL_LOCK *mysql_lock_merge(MYSQL_LOCK *a,MYSQL_LOCK *b);
-void broadcast_refresh(void);
/* Lock based on name */
bool lock_schema_name(THD *thd, const char *db);
/* Lock based on stored routine name */
-bool lock_routine_name(THD *thd, bool is_function, const char *db,
- const char *name);
+bool lock_object_name(THD *thd, MDL_key::enum_mdl_namespace mdl_type,
+ const char *db, const char *name);
#endif /* LOCK_INCLUDED */
diff --git a/sql/log.cc b/sql/log.cc
index a9452ed1c26..e3d42a41e10 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -210,11 +210,11 @@ class binlog_cache_data
{
public:
binlog_cache_data(): m_pending(0), before_stmt_pos(MY_OFF_T_UNDEF),
- incident(FALSE), changes_to_non_trans_temp_table_flag(FALSE)
- {
- cache_log.end_of_file= max_binlog_cache_size;
- }
-
+ incident(FALSE), changes_to_non_trans_temp_table_flag(FALSE),
+ saved_max_binlog_cache_size(0), ptr_binlog_cache_use(0),
+ ptr_binlog_cache_disk_use(0)
+ { }
+
~binlog_cache_data()
{
DBUG_ASSERT(empty());
@@ -258,11 +258,19 @@ public:
void reset()
{
+ compute_statistics();
truncate(0);
changes_to_non_trans_temp_table_flag= FALSE;
incident= FALSE;
before_stmt_pos= MY_OFF_T_UNDEF;
- cache_log.end_of_file= max_binlog_cache_size;
+ /*
+ The truncate function calls reinit_io_cache that calls my_b_flush_io_cache
+ which may increase disk_writes. This breaks the disk_writes use by the
+ binary log which aims to compute the ratio between in-memory cache usage
+ and disk cache usage. To avoid this undesirable behavior, we reset the
+ variable after truncating the cache.
+ */
+ cache_log.disk_writes= 0;
DBUG_ASSERT(empty());
}
@@ -293,6 +301,36 @@ public:
before_stmt_pos= MY_OFF_T_UNDEF;
}
+ void set_binlog_cache_info(ulong param_max_binlog_cache_size,
+ ulong *param_ptr_binlog_cache_use,
+ ulong *param_ptr_binlog_cache_disk_use)
+ {
+ /*
+ The assertions guarantee that the set_binlog_cache_info is
+ called just once and information passed as parameters are
+ never zero.
+
+ This is done while calling the constructor binlog_cache_mngr.
+ We cannot set informaton in the constructor binlog_cache_data
+ because the space for binlog_cache_mngr is allocated through
+ a placement new.
+
+ In the future, we can refactor this and change it to avoid
+ the set_binlog_info.
+ */
+ DBUG_ASSERT(saved_max_binlog_cache_size == 0 &&
+ param_max_binlog_cache_size != 0 &&
+ ptr_binlog_cache_use == 0 &&
+ param_ptr_binlog_cache_use != 0 &&
+ ptr_binlog_cache_disk_use == 0 &&
+ param_ptr_binlog_cache_disk_use != 0);
+
+ saved_max_binlog_cache_size= param_max_binlog_cache_size;
+ ptr_binlog_cache_use= param_ptr_binlog_cache_use;
+ ptr_binlog_cache_disk_use= param_ptr_binlog_cache_disk_use;
+ cache_log.end_of_file= saved_max_binlog_cache_size;
+ }
+
/*
Cache to store data before copying it to the binary log.
*/
@@ -322,6 +360,40 @@ private:
*/
bool changes_to_non_trans_temp_table_flag;
+ /**
+ This function computes binlog cache and disk usage.
+ */
+ void compute_statistics()
+ {
+ if (!empty())
+ {
+ statistic_increment(*ptr_binlog_cache_use, &LOCK_status);
+ if (cache_log.disk_writes != 0)
+ statistic_increment(*ptr_binlog_cache_disk_use, &LOCK_status);
+ }
+ }
+
+ /*
+ Stores the values of maximum size of the cache allowed when this cache
+ is configured. This corresponds to either
+ . max_binlog_cache_size or max_binlog_stmt_cache_size.
+ */
+ ulong saved_max_binlog_cache_size;
+
+ /*
+ Stores a pointer to the status variable that keeps track of the in-memory
+ cache usage. This corresponds to either
+ . binlog_cache_use or binlog_stmt_cache_use.
+ */
+ ulong *ptr_binlog_cache_use;
+
+ /*
+ Stores a pointer to the status variable that keeps track of the disk
+ cache usage. This corresponds to either
+ . binlog_cache_disk_use or binlog_stmt_cache_disk_use.
+ */
+ ulong *ptr_binlog_cache_disk_use;
+
/*
It truncates the cache to a certain position. This includes deleting the
pending event.
@@ -335,7 +407,7 @@ private:
set_pending(0);
}
reinit_io_cache(&cache_log, WRITE_CACHE, pos, 0, 0);
- cache_log.end_of_file= max_binlog_cache_size;
+ cache_log.end_of_file= saved_max_binlog_cache_size;
}
binlog_cache_data& operator=(const binlog_cache_data& info);
@@ -344,7 +416,20 @@ private:
class binlog_cache_mngr {
public:
- binlog_cache_mngr() {}
+ binlog_cache_mngr(ulong param_max_binlog_stmt_cache_size,
+ ulong param_max_binlog_cache_size,
+ ulong *param_ptr_binlog_stmt_cache_use,
+ ulong *param_ptr_binlog_stmt_cache_disk_use,
+ ulong *param_ptr_binlog_cache_use,
+ ulong *param_ptr_binlog_cache_disk_use)
+ {
+ stmt_cache.set_binlog_cache_info(param_max_binlog_stmt_cache_size,
+ param_ptr_binlog_stmt_cache_use,
+ param_ptr_binlog_stmt_cache_disk_use);
+ trx_cache.set_binlog_cache_info(param_max_binlog_cache_size,
+ param_ptr_binlog_cache_use,
+ param_ptr_binlog_cache_disk_use);
+ }
void reset_cache(binlog_cache_data* cache_data)
{
@@ -1374,7 +1459,7 @@ void LOGGER::deactivate_log_handler(THD *thd, uint log_type)
file_log= file_log_handler->get_mysql_log();
break;
default:
- assert(0); // Impossible
+ MY_ASSERT_UNREACHABLE();
}
if (!(*tmp_opt))
@@ -1518,57 +1603,122 @@ static int binlog_close_connection(handlerton *hton, THD *thd)
}
/**
- This function flushes a transactional cache upon commit/rollback.
+ This function flushes a cache upon commit/rollback.
- @param thd The thread whose transaction should be flushed
- @param cache_mngr Pointer to the cache data to be flushed
- @param end_ev The end event either commit/rollback.
+ @param thd The thread whose transaction should be flushed
+ @param cache_data Pointer to the cache
+ @param end_ev The end event either commit/rollback
+ @param is_transactional The type of the cache: transactional or
+ non-transactional
@return
- nonzero if an error pops up when flushing the transactional cache.
+ nonzero if an error pops up when flushing the cache.
*/
-static int
-binlog_flush_trx_cache(THD *thd, binlog_cache_mngr *cache_mngr,
- Log_event *end_ev)
+static inline int
+binlog_flush_cache(THD *thd, binlog_cache_data* cache_data, Log_event *end_evt,
+ bool is_transactional)
{
- DBUG_ENTER("binlog_flush_trx_cache");
- int error=0;
- IO_CACHE *cache_log= &cache_mngr->trx_cache.cache_log;
-
- /*
- This function handles transactional changes and as such
- this flag equals to true.
- */
- bool const is_transactional= TRUE;
-
- if (thd->binlog_flush_pending_rows_event(TRUE, is_transactional))
- DBUG_RETURN(1);
- /*
- Doing a commit or a rollback including non-transactional tables,
- i.e., ending a transaction where we might write the transaction
- cache to the binary log.
-
- We can always end the statement when ending a transaction since
- transactions are not allowed inside stored functions. If they
- were, we would have to ensure that we're not ending a statement
- inside a stored function.
- */
- error= mysql_bin_log.write(thd, &cache_mngr->trx_cache.cache_log, end_ev,
- cache_mngr->trx_cache.has_incident());
- cache_mngr->reset_cache(&cache_mngr->trx_cache);
+ DBUG_ENTER("binlog_flush_cache");
+ int error= 0;
- statistic_increment(binlog_cache_use, &LOCK_status);
- if (cache_log->disk_writes != 0)
+ if (!cache_data->empty())
{
- statistic_increment(binlog_cache_disk_use, &LOCK_status);
- cache_log->disk_writes= 0;
+ if (thd->binlog_flush_pending_rows_event(TRUE, is_transactional))
+ DBUG_RETURN(1);
+ /*
+ Doing a commit or a rollback including non-transactional tables,
+ i.e., ending a transaction where we might write the transaction
+ cache to the binary log.
+
+ We can always end the statement when ending a transaction since
+ transactions are not allowed inside stored functions. If they
+ were, we would have to ensure that we're not ending a statement
+ inside a stored function.
+ */
+ error= mysql_bin_log.write(thd, &cache_data->cache_log, end_evt,
+ cache_data->has_incident());
}
+ cache_data->reset();
- DBUG_ASSERT(cache_mngr->trx_cache.empty());
+ DBUG_ASSERT(cache_data->empty());
DBUG_RETURN(error);
}
/**
+ This function flushes the stmt-cache upon commit.
+
+ @param thd The thread whose transaction should be flushed
+ @param cache_mngr Pointer to the cache manager
+
+ @return
+ nonzero if an error pops up when flushing the cache.
+*/
+static inline int
+binlog_commit_flush_stmt_cache(THD *thd,
+ binlog_cache_mngr *cache_mngr)
+{
+ Query_log_event end_evt(thd, STRING_WITH_LEN("COMMIT"),
+ FALSE, FALSE, TRUE, 0);
+ return (binlog_flush_cache(thd, &cache_mngr->stmt_cache, &end_evt,
+ FALSE));
+}
+
+/**
+ This function flushes the trx-cache upon commit.
+
+ @param thd The thread whose transaction should be flushed
+ @param cache_mngr Pointer to the cache manager
+
+ @return
+ nonzero if an error pops up when flushing the cache.
+*/
+static inline int
+binlog_commit_flush_trx_cache(THD *thd, binlog_cache_mngr *cache_mngr)
+{
+ Query_log_event end_evt(thd, STRING_WITH_LEN("COMMIT"),
+ TRUE, FALSE, TRUE, 0);
+ return (binlog_flush_cache(thd, &cache_mngr->trx_cache, &end_evt,
+ TRUE));
+}
+
+/**
+ This function flushes the trx-cache upon rollback.
+
+ @param thd The thread whose transaction should be flushed
+ @param cache_mngr Pointer to the cache manager
+
+ @return
+ nonzero if an error pops up when flushing the cache.
+*/
+static inline int
+binlog_rollback_flush_trx_cache(THD *thd, binlog_cache_mngr *cache_mngr)
+{
+ Query_log_event end_evt(thd, STRING_WITH_LEN("ROLLBACK"),
+ TRUE, FALSE, TRUE, 0);
+ return (binlog_flush_cache(thd, &cache_mngr->trx_cache, &end_evt,
+ TRUE));
+}
+
+/**
+ This function flushes the trx-cache upon commit.
+
+ @param thd The thread whose transaction should be flushed
+ @param cache_mngr Pointer to the cache manager
+ @param xid Transaction Id
+
+ @return
+ nonzero if an error pops up when flushing the cache.
+*/
+static inline int
+binlog_commit_flush_trx_cache(THD *thd, binlog_cache_mngr *cache_mngr,
+ my_xid xid)
+{
+ Xid_log_event end_evt(thd, xid);
+ return (binlog_flush_cache(thd, &cache_mngr->trx_cache, &end_evt,
+ TRUE));
+}
+
+/**
This function truncates the transactional cache upon committing or rolling
back either a transaction or a statement.
@@ -1591,23 +1741,24 @@ binlog_truncate_trx_cache(THD *thd, binlog_cache_mngr *cache_mngr, bool all)
*/
bool const is_transactional= TRUE;
- DBUG_PRINT("info", ("thd->options={ %s%s}, transaction: %s",
+ DBUG_PRINT("info", ("thd->options={ %s %s}, transaction: %s",
FLAGSTR(thd->variables.option_bits, OPTION_NOT_AUTOCOMMIT),
FLAGSTR(thd->variables.option_bits, OPTION_BEGIN),
all ? "all" : "stmt"));
+
+ thd->binlog_remove_pending_rows_event(TRUE, is_transactional);
/*
If rolling back an entire transaction or a single statement not
inside a transaction, we reset the transaction cache.
*/
- thd->binlog_remove_pending_rows_event(TRUE, is_transactional);
if (ending_trans(thd, all))
{
if (cache_mngr->trx_cache.has_incident())
error= mysql_bin_log.write_incident(thd, TRUE);
- cache_mngr->reset_cache(&cache_mngr->trx_cache);
-
thd->clear_binlog_table_maps();
+
+ cache_mngr->reset_cache(&cache_mngr->trx_cache);
}
/*
If rolling back a statement in a transaction, we truncate the
@@ -1632,51 +1783,6 @@ static int binlog_prepare(handlerton *hton, THD *thd, bool all)
}
/**
- This function flushes the non-transactional to the binary log upon
- committing or rolling back a statement.
-
- @param thd The thread whose transaction should be flushed
- @param cache_mngr Pointer to the cache data to be flushed
-
- @return
- nonzero if an error pops up when flushing the non-transactional cache.
-*/
-static int
-binlog_flush_stmt_cache(THD *thd, binlog_cache_mngr *cache_mngr)
-{
- int error= 0;
- DBUG_ENTER("binlog_flush_stmt_cache");
- /*
- If we are flushing the statement cache, it means that the changes get
- through otherwise the cache is empty and this routine should not be called.
- */
- DBUG_ASSERT(cache_mngr->stmt_cache.has_incident() == FALSE);
- /*
- This function handles non-transactional changes and as such this flag equals
- to false.
- */
- bool const is_transactional= FALSE;
- IO_CACHE *cache_log= &cache_mngr->stmt_cache.cache_log;
-
- if (thd->binlog_flush_pending_rows_event(TRUE, is_transactional))
- DBUG_RETURN(1);
-
- Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE, TRUE, 0);
- if ((error= mysql_bin_log.write(thd, cache_log, &qev,
- cache_mngr->stmt_cache.has_incident())))
- DBUG_RETURN(error);
- cache_mngr->reset_cache(&cache_mngr->stmt_cache);
-
- statistic_increment(binlog_cache_use, &LOCK_status);
- if (cache_log->disk_writes != 0)
- {
- statistic_increment(binlog_cache_disk_use, &LOCK_status);
- cache_log->disk_writes= 0;
- }
- DBUG_RETURN(error);
-}
-
-/**
This function is called once after each statement.
It has the responsibility to flush the caches to the binary log on commits.
@@ -1704,7 +1810,7 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all)
if (!cache_mngr->stmt_cache.empty())
{
- binlog_flush_stmt_cache(thd, cache_mngr);
+ error= binlog_commit_flush_stmt_cache(thd, cache_mngr);
}
if (cache_mngr->trx_cache.empty())
@@ -1713,7 +1819,7 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all)
we're here because cache_log was flushed in MYSQL_BIN_LOG::log_xid()
*/
cache_mngr->reset_cache(&cache_mngr->trx_cache);
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
}
/*
@@ -1722,17 +1828,15 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all)
- We are in a transaction and a full transaction is committed.
Otherwise, we accumulate the changes.
*/
- if (ending_trans(thd, all))
- {
- Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE, TRUE, 0);
- error= binlog_flush_trx_cache(thd, cache_mngr, &qev);
- }
+ if (!error && ending_trans(thd, all))
+ error= binlog_commit_flush_trx_cache(thd, cache_mngr);
/*
This is part of the stmt rollback.
*/
if (!all)
cache_mngr->trx_cache.set_prev_position(MY_OFF_T_UNDEF);
+
DBUG_RETURN(error);
}
@@ -1749,7 +1853,7 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all)
static int binlog_rollback(handlerton *hton, THD *thd, bool all)
{
DBUG_ENTER("binlog_rollback");
- int error=0;
+ int error= 0;
binlog_cache_mngr *const cache_mngr=
(binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);
@@ -1769,16 +1873,16 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
}
else if (!cache_mngr->stmt_cache.empty())
{
- binlog_flush_stmt_cache(thd, cache_mngr);
+ error= binlog_commit_flush_stmt_cache(thd, cache_mngr);
}
if (cache_mngr->trx_cache.empty())
{
- /*
+ /*
we're here because cache_log was flushed in MYSQL_BIN_LOG::log_xid()
*/
cache_mngr->reset_cache(&cache_mngr->trx_cache);
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
}
if (mysql_bin_log.check_write_error(thd))
@@ -1794,9 +1898,9 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
We reach this point if the effect of a statement did not properly get into
a cache and need to be rolled back.
*/
- error= binlog_truncate_trx_cache(thd, cache_mngr, all);
+ error |= binlog_truncate_trx_cache(thd, cache_mngr, all);
}
- else
+ else if (!error)
{
/*
We flush the cache wrapped in a beging/rollback if:
@@ -1808,7 +1912,6 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
. the format is MIXED, non-trans table was updated and
aborting a single statement transaction;
*/
-
if (ending_trans(thd, all) &&
((thd->variables.option_bits & OPTION_KEEP_LOG) ||
(trans_has_updated_non_trans_table(thd) &&
@@ -1818,10 +1921,7 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
(trans_has_updated_non_trans_table(thd) &&
ending_single_stmt_trans(thd,all) &&
thd->variables.binlog_format == BINLOG_FORMAT_MIXED)))
- {
- Query_log_event qev(thd, STRING_WITH_LEN("ROLLBACK"), TRUE, FALSE, TRUE, 0);
- error= binlog_flush_trx_cache(thd, cache_mngr, &qev);
- }
+ error= binlog_rollback_flush_trx_cache(thd, cache_mngr);
/*
Truncate the cache if:
. aborting a single or multi-statement transaction or;
@@ -1844,11 +1944,12 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all)
This is part of the stmt rollback.
*/
if (!all)
- cache_mngr->trx_cache.set_prev_position(MY_OFF_T_UNDEF);
+ cache_mngr->trx_cache.set_prev_position(MY_OFF_T_UNDEF);
+
DBUG_RETURN(error);
}
-void MYSQL_BIN_LOG::set_write_error(THD *thd)
+void MYSQL_BIN_LOG::set_write_error(THD *thd, bool is_transactional)
{
DBUG_ENTER("MYSQL_BIN_LOG::set_write_error");
@@ -1858,9 +1959,20 @@ void MYSQL_BIN_LOG::set_write_error(THD *thd)
DBUG_VOID_RETURN;
if (my_errno == EFBIG)
- my_message(ER_TRANS_CACHE_FULL, ER(ER_TRANS_CACHE_FULL), MYF(MY_WME));
+ {
+ if (is_transactional)
+ {
+ my_message(ER_TRANS_CACHE_FULL, ER(ER_TRANS_CACHE_FULL), MYF(MY_WME));
+ }
+ else
+ {
+ my_message(ER_STMT_CACHE_FULL, ER(ER_STMT_CACHE_FULL), MYF(MY_WME));
+ }
+ }
else
+ {
my_error(ER_ERROR_ON_WRITE, MYF(MY_WME), name, errno);
+ }
DBUG_VOID_RETURN;
}
@@ -1877,6 +1989,7 @@ bool MYSQL_BIN_LOG::check_write_error(THD *thd)
switch (thd->stmt_da->sql_errno())
{
case ER_TRANS_CACHE_FULL:
+ case ER_STMT_CACHE_FULL:
case ER_ERROR_ON_WRITE:
case ER_BINLOG_LOGGING_IMPOSSIBLE:
checked= TRUE;
@@ -2085,7 +2198,8 @@ static int find_uniq_filename(char *name)
*end='.';
length= (size_t) (end - start + 1);
- if (!(dir_info= my_dir(buff,MYF(MY_DONT_SORT))))
+ if ((DBUG_EVALUATE_IF("error_unique_log_filename", 1,
+ !(dir_info= my_dir(buff,MYF(MY_DONT_SORT))))))
{ // This shouldn't happen
strmov(end,".1"); // use name+1
DBUG_RETURN(1);
@@ -2112,7 +2226,11 @@ updating the index files.", max_found);
}
next= max_found + 1;
- sprintf(ext_buf, "%06lu", next);
+ if (sprintf(ext_buf, "%06lu", next)<0)
+ {
+ error= 1;
+ goto end;
+ }
*end++='.';
/*
@@ -2129,7 +2247,11 @@ index files.", name, ext_buf, (strlen(ext_buf) + (end - name)));
goto end;
}
- sprintf(end, "%06lu", next);
+ if (sprintf(end, "%06lu", next)<0)
+ {
+ error= 1;
+ goto end;
+ }
/* print warning if reaching the end of available extensions. */
if ((next > (MAX_LOG_UNIQUE_FN_EXT - LOG_WARN_UNIQUE_FN_EXT_LEFT)))
@@ -2190,7 +2312,11 @@ bool MYSQL_LOG::init_and_set_log_file_name(const char *log_name,
1 error
*/
-bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
+bool MYSQL_LOG::open(
+#ifdef HAVE_PSI_INTERFACE
+ PSI_file_key log_file_key,
+#endif
+ const char *log_name, enum_log_type log_type_arg,
const char *new_name, enum cache_type io_cache_type_arg)
{
char buff[FN_REFLEN];
@@ -2218,7 +2344,12 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
db[0]= 0;
- if ((file= mysql_file_open(key_file_MYSQL_LOG,
+#ifdef HAVE_PSI_INTERFACE
+ /* Keep the key for reopen */
+ m_log_file_key= log_file_key;
+#endif
+
+ if ((file= mysql_file_open(log_file_key,
log_file_name, open_flags,
MYF(MY_WME | ME_WAITTANG))) < 0 ||
init_io_cache(&log_file, file, IO_SIZE, io_cache_type,
@@ -2353,13 +2484,8 @@ int MYSQL_LOG::generate_new_name(char *new_name, const char *log_name)
{
if (find_uniq_filename(new_name))
{
- /*
- This should be treated as error once propagation of error further
- up in the stack gets proper handling.
- */
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_NO_UNIQUE_LOGFILE, ER(ER_NO_UNIQUE_LOGFILE),
- log_name);
+ my_printf_error(ER_NO_UNIQUE_LOGFILE, ER(ER_NO_UNIQUE_LOGFILE),
+ MYF(ME_FATALERROR), log_name);
sql_print_error(ER(ER_NO_UNIQUE_LOGFILE), log_name);
return 1;
}
@@ -2402,7 +2528,11 @@ void MYSQL_QUERY_LOG::reopen_file()
Note that at this point, log_state != LOG_CLOSED (important for is_open()).
*/
- open(save_name, log_type, 0, io_cache_type);
+ open(
+#ifdef HAVE_PSI_INTERFACE
+ m_log_file_key,
+#endif
+ save_name, log_type, 0, io_cache_type);
my_free(save_name);
mysql_mutex_unlock(&LOCK_log);
@@ -2764,11 +2894,9 @@ void MYSQL_BIN_LOG::init(bool no_auto_events_arg, ulong max_size_arg)
void MYSQL_BIN_LOG::init_pthread_objects()
{
- DBUG_ASSERT(inited == 0);
- inited= 1;
- mysql_mutex_init(key_LOG_LOCK_log, &LOCK_log, MY_MUTEX_INIT_SLOW);
- mysql_mutex_init(key_BINLOG_LOCK_index, &LOCK_index, MY_MUTEX_INIT_SLOW);
- mysql_cond_init(key_BINLOG_update_cond, &update_cond, 0);
+ MYSQL_LOG::init_pthread_objects();
+ mysql_mutex_init(m_key_LOCK_index, &LOCK_index, MY_MUTEX_INIT_SLOW);
+ mysql_cond_init(m_key_update_cond, &update_cond, 0);
}
@@ -2791,7 +2919,7 @@ bool MYSQL_BIN_LOG::open_index_file(const char *index_file_name_arg,
}
fn_format(index_file_name, index_file_name_arg, mysql_data_home,
".index", opt);
- if ((index_file_nr= mysql_file_open(key_file_binlog_index,
+ if ((index_file_nr= mysql_file_open(m_key_file_log_index,
index_file_name,
O_RDWR | O_CREAT | O_BINARY,
MYF(MY_WME))) < 0 ||
@@ -2879,17 +3007,37 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
sync_purge_index_file() ||
DBUG_EVALUATE_IF("fault_injection_registering_index", 1, 0))
{
+ /**
+ TODO: although this was introduced to appease valgrind
+ when injecting emulated faults using fault_injection_registering_index
+ it may be good to consider what actually happens when
+ open_purge_index_file succeeds but register or sync fails.
+
+ Perhaps we might need the code below in MYSQL_LOG_BIN::cleanup
+ for "real life" purposes as well?
+ */
+ DBUG_EXECUTE_IF("fault_injection_registering_index", {
+ if (my_b_inited(&purge_index_file))
+ {
+ end_io_cache(&purge_index_file);
+ my_close(purge_index_file.file, MYF(0));
+ }
+ });
+
sql_print_error("MSYQL_BIN_LOG::open failed to sync the index file.");
DBUG_RETURN(1);
}
- DBUG_EXECUTE_IF("crash_create_non_critical_before_update_index", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_create_non_critical_before_update_index", DBUG_SUICIDE(););
#endif
write_error= 0;
/* open the main log file */
- if (MYSQL_LOG::open(log_name, log_type_arg, new_name,
- io_cache_type_arg))
+ if (MYSQL_LOG::open(
+#ifdef HAVE_PSI_INTERFACE
+ m_key_file_log,
+#endif
+ log_name, log_type_arg, new_name, io_cache_type_arg))
{
#ifdef HAVE_REPLICATION
close_purge_index_file();
@@ -2979,7 +3127,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
if (write_file_name_to_index_file)
{
#ifdef HAVE_REPLICATION
- DBUG_EXECUTE_IF("crash_create_critical_before_update_index", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_create_critical_before_update_index", DBUG_SUICIDE(););
#endif
DBUG_ASSERT(my_b_inited(&index_file) != 0);
@@ -2998,7 +3146,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
goto err;
#ifdef HAVE_REPLICATION
- DBUG_EXECUTE_IF("crash_create_after_update_index", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_create_after_update_index", DBUG_SUICIDE(););
#endif
}
}
@@ -3257,12 +3405,6 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd)
DBUG_ENTER("reset_logs");
ha_reset_logs(thd);
- /*
- We need to get both locks to be sure that no one is trying to
- write to the index log file.
- */
- mysql_mutex_lock(&LOCK_log);
- mysql_mutex_lock(&LOCK_index);
/*
The following mutex is needed to ensure that no threads call
@@ -3272,6 +3414,13 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd)
*/
mysql_mutex_lock(&LOCK_thread_count);
+ /*
+ We need to get both locks to be sure that no one is trying to
+ write to the index log file.
+ */
+ mysql_mutex_lock(&LOCK_log);
+ mysql_mutex_lock(&LOCK_index);
+
/* Save variables so that we can reopen the log */
save_name=name;
name=0; // Protect against free
@@ -3328,7 +3477,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd)
}
/* Start logging with a new file */
- close(LOG_CLOSE_INDEX);
+ close(LOG_CLOSE_INDEX | LOG_CLOSE_TO_BE_OPENED);
if ((error= my_delete_allow_opened(index_file_name, MYF(0)))) // Reset (open will update)
{
if (my_errno == ENOENT)
@@ -3357,7 +3506,8 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd)
if (!thd->slave_thread)
need_start_event=1;
if (!open_index_file(index_file_name, 0, FALSE))
- open(save_name, log_type, 0, io_cache_type, no_auto_events, max_size, 0, FALSE);
+ if ((error= open(save_name, log_type, 0, io_cache_type, no_auto_events, max_size, 0, FALSE)))
+ goto err;
my_free((void *) save_name);
err:
@@ -3461,7 +3611,7 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
/* Store where we are in the new file for the execution thread */
flush_relay_log_info(rli);
- DBUG_EXECUTE_IF("crash_before_purge_logs", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_before_purge_logs", DBUG_SUICIDE(););
mysql_mutex_lock(&rli->log_space_lock);
rli->relay_log.purge_logs(to_purge_if_included, included,
@@ -3589,7 +3739,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
break;
}
- DBUG_EXECUTE_IF("crash_purge_before_update_index", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_purge_before_update_index", DBUG_SUICIDE(););
if ((error= sync_purge_index_file()))
{
@@ -3604,7 +3754,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
goto err;
}
- DBUG_EXECUTE_IF("crash_purge_critical_after_update_index", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_purge_critical_after_update_index", DBUG_SUICIDE(););
err:
/* Read each entry from purge_index_file and delete the file. */
@@ -3614,7 +3764,7 @@ err:
" that would be purged.");
close_purge_index_file();
- DBUG_EXECUTE_IF("crash_purge_non_critical_after_update_index", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("crash_purge_non_critical_after_update_index", DBUG_SUICIDE(););
if (need_mutex)
mysql_mutex_unlock(&LOCK_index);
@@ -3756,7 +3906,7 @@ int MYSQL_BIN_LOG::purge_index_entry(THD *thd, ulonglong *decrease_log_space,
/* Get rid of the trailing '\n' */
log_info.log_file_name[length-1]= 0;
- if (!mysql_file_stat(key_file_binlog, log_info.log_file_name, &s, MYF(0)))
+ if (!mysql_file_stat(m_key_file_log, log_info.log_file_name, &s, MYF(0)))
{
if (my_errno == ENOENT)
{
@@ -3931,7 +4081,7 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time)
!is_active(log_info.log_file_name) &&
!log_in_use(log_info.log_file_name))
{
- if (!mysql_file_stat(key_file_binlog,
+ if (!mysql_file_stat(m_key_file_log,
log_info.log_file_name, &stat_area, MYF(0)))
{
if (my_errno == ENOENT)
@@ -4022,17 +4172,23 @@ bool MYSQL_BIN_LOG::is_active(const char *log_file_name_arg)
incapsulation 3) allows external access to the class without
a lock (which is not possible with private new_file_without_locking
method).
+
+ @retval
+ nonzero - error
*/
-void MYSQL_BIN_LOG::new_file()
+int MYSQL_BIN_LOG::new_file()
{
- new_file_impl(1);
+ return new_file_impl(1);
}
-
-void MYSQL_BIN_LOG::new_file_without_locking()
+/*
+ @retval
+ nonzero - error
+ */
+int MYSQL_BIN_LOG::new_file_without_locking()
{
- new_file_impl(0);
+ return new_file_impl(0);
}
@@ -4041,19 +4197,23 @@ void MYSQL_BIN_LOG::new_file_without_locking()
@param need_lock Set to 1 if caller has not locked LOCK_log
+ @retval
+ nonzero - error
+
@note
The new file name is stored last in the index file
*/
-void MYSQL_BIN_LOG::new_file_impl(bool need_lock)
+int MYSQL_BIN_LOG::new_file_impl(bool need_lock)
{
- char new_name[FN_REFLEN], *new_name_ptr, *old_name;
+ int error= 0, close_on_error= FALSE;
+ char new_name[FN_REFLEN], *new_name_ptr, *old_name, *file_to_open;
DBUG_ENTER("MYSQL_BIN_LOG::new_file_impl");
if (!is_open())
{
DBUG_PRINT("info",("log is closed"));
- DBUG_VOID_RETURN;
+ DBUG_RETURN(error);
}
if (need_lock)
@@ -4091,7 +4251,7 @@ void MYSQL_BIN_LOG::new_file_impl(bool need_lock)
We have to do this here and not in open as we want to store the
new file name in the current binary log file.
*/
- if (generate_new_name(new_name, name))
+ if ((error= generate_new_name(new_name, name)))
goto end;
new_name_ptr=new_name;
@@ -4105,7 +4265,14 @@ void MYSQL_BIN_LOG::new_file_impl(bool need_lock)
*/
Rotate_log_event r(new_name+dirname_length(new_name),
0, LOG_EVENT_OFFSET, is_relay_log ? Rotate_log_event::RELAY_LOG : 0);
- r.write(&log_file);
+ if(DBUG_EVALUATE_IF("fault_injection_new_file_rotate_event", (error=close_on_error=TRUE), FALSE) ||
+ (error= r.write(&log_file)))
+ {
+ DBUG_EXECUTE_IF("fault_injection_new_file_rotate_event", errno=2;);
+ close_on_error= TRUE;
+ my_printf_error(ER_ERROR_ON_WRITE, ER(ER_CANT_OPEN_FILE), MYF(ME_FATALERROR), name, errno);
+ goto end;
+ }
bytes_written += r.data_written;
}
/*
@@ -4133,17 +4300,56 @@ void MYSQL_BIN_LOG::new_file_impl(bool need_lock)
*/
/* reopen index binlog file, BUG#34582 */
- if (!open_index_file(index_file_name, 0, FALSE))
- open(old_name, log_type, new_name_ptr,
- io_cache_type, no_auto_events, max_size, 1, FALSE);
+ file_to_open= index_file_name;
+ error= open_index_file(index_file_name, 0, FALSE);
+ if (!error)
+ {
+ /* reopen the binary log file. */
+ file_to_open= new_name_ptr;
+ error= open(old_name, log_type, new_name_ptr, io_cache_type,
+ no_auto_events, max_size, 1, FALSE);
+ }
+
+ /* handle reopening errors */
+ if (error)
+ {
+ my_printf_error(ER_CANT_OPEN_FILE, ER(ER_CANT_OPEN_FILE),
+ MYF(ME_FATALERROR), file_to_open, error);
+ close_on_error= TRUE;
+ }
+
my_free(old_name);
end:
+
+ if (error && close_on_error /* rotate or reopen failed */)
+ {
+ /*
+ Close whatever was left opened.
+
+ We are keeping the behavior as it exists today, ie,
+ we disable logging and move on (see: BUG#51014).
+
+ TODO: as part of WL#1790 consider other approaches:
+ - kill mysql (safety);
+ - try multiple locations for opening a log file;
+ - switch server to protected/readonly mode
+ - ...
+ */
+ close(LOG_CLOSE_INDEX);
+ sql_print_error("Could not open %s for logging (error %d). "
+ "Turning logging off for the whole duration "
+ "of the MySQL server process. To turn it on "
+ "again: fix the cause, shutdown the MySQL "
+ "server and restart it.",
+ new_name_ptr, errno);
+ }
+
if (need_lock)
mysql_mutex_unlock(&LOCK_log);
mysql_mutex_unlock(&LOCK_index);
- DBUG_VOID_RETURN;
+ DBUG_RETURN(error);
}
@@ -4168,8 +4374,7 @@ bool MYSQL_BIN_LOG::append(Log_event* ev)
if (flush_and_sync(0))
goto err;
if ((uint) my_b_append_tell(&log_file) > max_size)
- new_file_without_locking();
-
+ error= new_file_without_locking();
err:
mysql_mutex_unlock(&LOCK_log);
signal_update(); // Safe as we don't call close
@@ -4200,8 +4405,7 @@ bool MYSQL_BIN_LOG::appendv(const char* buf, uint len,...)
if (flush_and_sync(0))
goto err;
if ((uint) my_b_append_tell(&log_file) > max_size)
- new_file_without_locking();
-
+ error= new_file_without_locking();
err:
if (!error)
signal_update();
@@ -4390,7 +4594,7 @@ int THD::binlog_setup_trx_data()
cache_mngr= (binlog_cache_mngr*) my_malloc(sizeof(binlog_cache_mngr), MYF(MY_ZEROFILL));
if (!cache_mngr ||
open_cached_file(&cache_mngr->stmt_cache.cache_log, mysql_tmpdir,
- LOG_PREFIX, binlog_cache_size, MYF(MY_WME)) ||
+ LOG_PREFIX, binlog_stmt_cache_size, MYF(MY_WME)) ||
open_cached_file(&cache_mngr->trx_cache.cache_log, mysql_tmpdir,
LOG_PREFIX, binlog_cache_size, MYF(MY_WME)))
{
@@ -4399,8 +4603,13 @@ int THD::binlog_setup_trx_data()
}
thd_set_ha_data(this, binlog_hton, cache_mngr);
- cache_mngr= new (thd_get_ha_data(this, binlog_hton)) binlog_cache_mngr;
-
+ cache_mngr= new (thd_get_ha_data(this, binlog_hton))
+ binlog_cache_mngr(max_binlog_stmt_cache_size,
+ max_binlog_cache_size,
+ &binlog_stmt_cache_use,
+ &binlog_stmt_cache_disk_use,
+ &binlog_cache_use,
+ &binlog_cache_disk_use);
DBUG_RETURN(0);
}
@@ -4652,7 +4861,7 @@ MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd,
*/
if (pending->write(file))
{
- set_write_error(thd);
+ set_write_error(thd, is_transactional);
if (check_write_error(thd) && cache_data &&
stmt_has_updated_non_trans_table(thd))
cache_data->set_incident();
@@ -4677,6 +4886,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
bool error= 1;
DBUG_ENTER("MYSQL_BIN_LOG::write(Log_event *)");
binlog_cache_data *cache_data= 0;
+ bool is_trans_cache= FALSE;
if (thd->binlog_evt_union.do_union)
{
@@ -4739,7 +4949,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
binlog_cache_mngr *const cache_mngr=
(binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);
- bool is_trans_cache= use_trans_cache(thd, event_info->use_trans_cache());
+ is_trans_cache= use_trans_cache(thd, event_info->use_trans_cache());
file= cache_mngr->get_binlog_cache_log(is_trans_cache);
cache_data= cache_mngr->get_binlog_cache_data(is_trans_cache);
@@ -4819,7 +5029,6 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
goto err;
error= 0;
-
err:
if (event_info->use_direct_logging())
{
@@ -4848,7 +5057,7 @@ unlock:
if (error)
{
- set_write_error(thd);
+ set_write_error(thd, is_trans_cache);
if (check_write_error(thd) && cache_data &&
stmt_has_updated_non_trans_table(thd))
cache_data->set_incident();
@@ -4928,8 +5137,19 @@ bool general_log_write(THD *thd, enum enum_server_command command,
return FALSE;
}
-void MYSQL_BIN_LOG::rotate_and_purge(uint flags)
+/**
+ @note
+ If rotation fails, for instance the server was unable
+ to create a new log file, we still try to write an
+ incident event to the current log.
+
+ @retval
+ nonzero - error
+*/
+int MYSQL_BIN_LOG::rotate_and_purge(uint flags)
{
+ int error= 0;
+ DBUG_ENTER("MYSQL_BIN_LOG::rotate_and_purge");
#ifdef HAVE_REPLICATION
bool check_purge= false;
#endif
@@ -4938,26 +5158,38 @@ void MYSQL_BIN_LOG::rotate_and_purge(uint flags)
if ((flags & RP_FORCE_ROTATE) ||
(my_b_tell(&log_file) >= (my_off_t) max_size))
{
- new_file_without_locking();
+ if ((error= new_file_without_locking()))
+ /**
+ Be conservative... There are possible lost events (eg,
+ failing to log the Execute_load_query_log_event
+ on a LOAD DATA while using a non-transactional
+ table)!
+
+ We give it a shot and try to write an incident event anyway
+ to the current log.
+ */
+ if (!write_incident(current_thd, FALSE))
+ flush_and_sync(0);
+
#ifdef HAVE_REPLICATION
check_purge= true;
#endif
}
if (!(flags & RP_LOCK_LOG_IS_ALREADY_LOCKED))
mysql_mutex_unlock(&LOCK_log);
-
#ifdef HAVE_REPLICATION
/*
NOTE: Run purge_logs wo/ holding LOCK_log
as it otherwise will deadlock in ndbcluster_binlog_index_purge_file
*/
- if (check_purge && expire_logs_days)
+ if (!error && check_purge && expire_logs_days)
{
time_t purge_time= my_time(0) - expire_logs_days*24*60*60;
if (purge_time >= 0)
purge_logs_before_date(purge_time);
}
#endif
+ DBUG_RETURN(error);
}
uint MYSQL_BIN_LOG::next_file_id()
@@ -5148,6 +5380,10 @@ bool MYSQL_BIN_LOG::write_incident(THD *thd, bool lock)
{
uint error= 0;
DBUG_ENTER("MYSQL_BIN_LOG::write_incident");
+
+ if (!is_open())
+ DBUG_RETURN(error);
+
LEX_STRING const write_error_msg=
{ C_STRING_WITH_LEN("error writing to the binary log") };
Incident incident= INCIDENT_LOST_EVENTS;
@@ -5161,7 +5397,7 @@ bool MYSQL_BIN_LOG::write_incident(THD *thd, bool lock)
if (!error && !(error= flush_and_sync(0)))
{
signal_update();
- rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);
+ error= rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);
}
mysql_mutex_unlock(&LOCK_log);
}
@@ -5225,7 +5461,7 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event,
DBUG_PRINT("info", ("error writing binlog cache: %d",
write_error));
DBUG_PRINT("info", ("crashing before writing xid"));
- DBUG_ABORT();
+ DBUG_SUICIDE();
});
if ((write_error= write_cache(thd, cache, FALSE, FALSE)))
@@ -5245,7 +5481,7 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event,
bool synced= 0;
if (flush_and_sync(&synced))
goto err;
- DBUG_EXECUTE_IF("half_binlogged_transaction", DBUG_ABORT(););
+ DBUG_EXECUTE_IF("half_binlogged_transaction", DBUG_SUICIDE(););
if (cache->error) // Error on read
{
sql_print_error(ER(ER_ERROR_ON_READ), cache->file_name, errno);
@@ -5279,7 +5515,8 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event,
mysql_mutex_unlock(&LOCK_prep_xids);
}
else
- rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);
+ if (rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED))
+ goto err;
}
mysql_mutex_unlock(&LOCK_log);
@@ -5501,80 +5738,26 @@ void sql_perror(const char *message)
}
-#ifdef __WIN__
+/*
+ Change the file associated with two output streams. Used to
+ redirect stdout and stderr to a file. The streams are reopened
+ only for appending (writing at end of file).
+*/
extern "C" my_bool reopen_fstreams(const char *filename,
FILE *outstream, FILE *errstream)
{
- int handle_fd;
- int err_fd, out_fd;
- HANDLE osfh;
-
- DBUG_ASSERT(filename && errstream);
-
- // Services don't have stdout/stderr on Windows, so _fileno returns -1.
- err_fd= _fileno(errstream);
- if (err_fd < 0)
- {
- if (!freopen(filename, "a+", errstream))
- return TRUE;
-
- setbuf(errstream, NULL);
- err_fd= _fileno(errstream);
- }
-
- if (outstream)
- {
- out_fd= _fileno(outstream);
- if (out_fd < 0)
- {
- if (!freopen(filename, "a+", outstream))
- return TRUE;
- out_fd= _fileno(outstream);
- }
- }
-
- if ((osfh= CreateFile(filename, GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE |
- FILE_SHARE_DELETE, NULL,
- OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL,
- NULL)) == INVALID_HANDLE_VALUE)
- return TRUE;
-
- if ((handle_fd= _open_osfhandle((intptr_t)osfh,
- _O_APPEND | _O_TEXT)) == -1)
- {
- CloseHandle(osfh);
- return TRUE;
- }
-
- if (_dup2(handle_fd, err_fd) < 0)
- {
- CloseHandle(osfh);
- return TRUE;
- }
-
- if (outstream && _dup2(handle_fd, out_fd) < 0)
- {
- CloseHandle(osfh);
+ if (outstream && !my_freopen(filename, "a", outstream))
return TRUE;
- }
- _close(handle_fd);
- return FALSE;
-}
-#else
-extern "C" my_bool reopen_fstreams(const char *filename,
- FILE *outstream, FILE *errstream)
-{
- if (outstream && !freopen(filename, "a+", outstream))
+ if (errstream && !my_freopen(filename, "a", errstream))
return TRUE;
- if (errstream && !freopen(filename, "a+", errstream))
- return TRUE;
+ /* The error stream must be unbuffered. */
+ if (errstream)
+ setbuf(errstream, NULL);
return FALSE;
}
-#endif
/*
@@ -5865,7 +6048,7 @@ int TC_LOG_MMAP::open(const char *opt_name)
{
pg->next=pg+1;
pg->waiters=0;
- pg->state=POOL;
+ pg->state=PS_POOL;
mysql_mutex_init(key_PAGE_lock, &pg->lock, MY_MUTEX_INIT_FAST);
mysql_cond_init(key_PAGE_cond, &pg->cond, 0);
pg->ptr= pg->start=(my_xid *)(data + i*tc_log_page_size);
@@ -6047,7 +6230,7 @@ int TC_LOG_MMAP::log_xid(THD *thd, my_xid xid)
cookie= (ulong)((uchar *)p->ptr - data); // can never be zero
*p->ptr++= xid;
p->free--;
- p->state= DIRTY;
+ p->state= PS_DIRTY;
mysql_mutex_unlock(&p->lock);
mysql_mutex_lock(&LOCK_sync);
@@ -6058,7 +6241,7 @@ int TC_LOG_MMAP::log_xid(THD *thd, my_xid xid)
p->waiters++;
for (;;)
{
- int not_dirty = p->state != DIRTY;
+ int not_dirty = p->state != PS_DIRTY;
mysql_mutex_unlock(&p->lock);
if (not_dirty || !syncing)
break;
@@ -6066,8 +6249,8 @@ int TC_LOG_MMAP::log_xid(THD *thd, my_xid xid)
mysql_mutex_lock(&p->lock);
}
p->waiters--;
- err= p->state == ERROR;
- if (p->state != DIRTY) // page was synced
+ err= p->state == PS_ERROR;
+ if (p->state != PS_DIRTY) // page was synced
{
mysql_mutex_unlock(&LOCK_sync);
if (p->waiters == 0)
@@ -6116,7 +6299,7 @@ int TC_LOG_MMAP::sync()
pool_last->next=syncing;
pool_last=syncing;
syncing->next=0;
- syncing->state= err ? ERROR : POOL;
+ syncing->state= err ? PS_ERROR : PS_POOL;
mysql_cond_signal(&COND_pool); // in case somebody's waiting
mysql_mutex_unlock(&LOCK_pool);
@@ -6143,7 +6326,7 @@ int TC_LOG_MMAP::sync()
cookie points directly to the memory where xid was logged.
*/
-void TC_LOG_MMAP::unlog(ulong cookie, my_xid xid)
+int TC_LOG_MMAP::unlog(ulong cookie, my_xid xid)
{
PAGE *p=pages+(cookie/tc_log_page_size);
my_xid *x=(my_xid *)(data+cookie);
@@ -6161,6 +6344,7 @@ void TC_LOG_MMAP::unlog(ulong cookie, my_xid xid)
if (p->waiters == 0) // the page is in pool and ready to rock
mysql_cond_signal(&COND_pool); // ping ... for overflow()
mysql_mutex_unlock(&p->lock);
+ return 0;
}
void TC_LOG_MMAP::close()
@@ -6393,27 +6577,30 @@ void TC_LOG_BINLOG::close()
int TC_LOG_BINLOG::log_xid(THD *thd, my_xid xid)
{
DBUG_ENTER("TC_LOG_BINLOG::log");
- Xid_log_event xle(thd, xid);
binlog_cache_mngr *cache_mngr=
(binlog_cache_mngr*) 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.
*/
- DBUG_RETURN(!binlog_flush_stmt_cache(thd, cache_mngr) &&
- !binlog_flush_trx_cache(thd, cache_mngr, &xle));
+ DBUG_RETURN(!binlog_commit_flush_stmt_cache(thd, cache_mngr) &&
+ !binlog_commit_flush_trx_cache(thd, cache_mngr, xid));
}
-void TC_LOG_BINLOG::unlog(ulong cookie, my_xid xid)
+int TC_LOG_BINLOG::unlog(ulong cookie, my_xid xid)
{
+ DBUG_ENTER("TC_LOG_BINLOG::unlog");
mysql_mutex_lock(&LOCK_prep_xids);
- DBUG_ASSERT(prepared_xids > 0);
- if (--prepared_xids == 0) {
+ // prepared_xids can be 0 if the transaction had ignorable errors.
+ DBUG_ASSERT(prepared_xids >= 0);
+ if (prepared_xids > 0)
+ prepared_xids--;
+ if (prepared_xids == 0) {
DBUG_PRINT("info", ("prepared_xids=%lu", prepared_xids));
mysql_cond_signal(&COND_prep_xids);
}
mysql_mutex_unlock(&LOCK_prep_xids);
- rotate_and_purge(0); // as ::write() did not rotate
+ DBUG_RETURN(rotate_and_purge(0)); // as ::write() did not rotate
}
int TC_LOG_BINLOG::recover(IO_CACHE *log, Format_description_log_event *fdle)
diff --git a/sql/log.h b/sql/log.h
index aeecc80a928..402c90034c7 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef LOG_H
#define LOG_H
@@ -45,7 +45,7 @@ class TC_LOG
virtual int open(const char *opt_name)=0;
virtual void close()=0;
virtual int log_xid(THD *thd, my_xid xid)=0;
- virtual void unlog(ulong cookie, my_xid xid)=0;
+ virtual int unlog(ulong cookie, my_xid xid)=0;
};
class TC_LOG_DUMMY: public TC_LOG // use it to disable the logging
@@ -55,7 +55,7 @@ public:
int open(const char *opt_name) { return 0; }
void close() { }
int log_xid(THD *thd, my_xid xid) { return 1; }
- void unlog(ulong cookie, my_xid xid) { }
+ int unlog(ulong cookie, my_xid xid) { return 0; }
};
#ifdef HAVE_MMAP
@@ -63,9 +63,9 @@ class TC_LOG_MMAP: public TC_LOG
{
public: // only to keep Sun Forte on sol9x86 happy
typedef enum {
- POOL, // page is in pool
- ERROR, // last sync failed
- DIRTY // new xids added since last sync
+ PS_POOL, // page is in pool
+ PS_ERROR, // last sync failed
+ PS_DIRTY // new xids added since last sync
} PAGE_STATE;
private:
@@ -100,7 +100,7 @@ class TC_LOG_MMAP: public TC_LOG
int open(const char *opt_name);
void close();
int log_xid(THD *thd, my_xid xid);
- void unlog(ulong cookie, my_xid xid);
+ int unlog(ulong cookie, my_xid xid);
int recover();
private:
@@ -196,7 +196,11 @@ public:
MYSQL_LOG();
void init_pthread_objects();
void cleanup();
- bool open(const char *log_name,
+ bool open(
+#ifdef HAVE_PSI_INTERFACE
+ PSI_file_key log_file_key,
+#endif
+ const char *log_name,
enum_log_type log_type,
const char *new_name,
enum cache_type io_cache_type_arg);
@@ -223,6 +227,10 @@ public:
volatile enum_log_state log_state;
enum cache_type io_cache_type;
friend class Log_event;
+#ifdef HAVE_PSI_INTERFACE
+ /** Instrumentation key to use for file io in @c log_file */
+ PSI_file_key m_log_file_key;
+#endif
};
class MYSQL_QUERY_LOG: public MYSQL_LOG
@@ -241,14 +249,22 @@ public:
bool open_slow_log(const char *log_name)
{
char buf[FN_REFLEN];
- return open(generate_name(log_name, "-slow.log", 0, buf), LOG_NORMAL, 0,
- WRITE_CACHE);
+ return open(
+#ifdef HAVE_PSI_INTERFACE
+ key_file_slow_log,
+#endif
+ generate_name(log_name, "-slow.log", 0, buf),
+ LOG_NORMAL, 0, WRITE_CACHE);
}
bool open_query_log(const char *log_name)
{
char buf[FN_REFLEN];
- return open(generate_name(log_name, ".log", 0, buf), LOG_NORMAL, 0,
- WRITE_CACHE);
+ return open(
+#ifdef HAVE_PSI_INTERFACE
+ key_file_query_log,
+#endif
+ generate_name(log_name, ".log", 0, buf),
+ LOG_NORMAL, 0, WRITE_CACHE);
}
private:
@@ -258,6 +274,16 @@ private:
class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
{
private:
+#ifdef HAVE_PSI_INTERFACE
+ /** The instrumentation key to use for @ LOCK_index. */
+ PSI_mutex_key m_key_LOCK_index;
+ /** The instrumentation key to use for @ update_cond. */
+ PSI_cond_key m_key_update_cond;
+ /** The instrumentation key to use for opening the log file. */
+ PSI_file_key m_key_file_log;
+ /** The instrumentation key to use for opening the log index file. */
+ PSI_file_key m_key_file_log_index;
+#endif
/* LOCK_log and LOCK_index are inited by init_pthread_objects() */
mysql_mutex_t LOCK_index;
mysql_mutex_t LOCK_prep_xids;
@@ -318,8 +344,8 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
new_file() is locking. new_file_without_locking() does not acquire
LOCK_log.
*/
- void new_file_without_locking();
- void new_file_impl(bool need_lock);
+ int new_file_without_locking();
+ int new_file_impl(bool need_lock);
public:
MYSQL_LOG::generate_name;
@@ -346,10 +372,23 @@ public:
on exit() - but only during the correct shutdown process
*/
+#ifdef HAVE_PSI_INTERFACE
+ void set_psi_keys(PSI_mutex_key key_LOCK_index,
+ PSI_cond_key key_update_cond,
+ PSI_file_key key_file_log,
+ PSI_file_key key_file_log_index)
+ {
+ m_key_LOCK_index= key_LOCK_index;
+ m_key_update_cond= key_update_cond;
+ m_key_file_log= key_file_log;
+ m_key_file_log_index= key_file_log_index;
+ }
+#endif
+
int open(const char *opt_name);
void close();
int log_xid(THD *thd, my_xid xid);
- void unlog(ulong cookie, my_xid xid);
+ int unlog(ulong cookie, my_xid xid);
int recover(IO_CACHE *log, Format_description_log_event *fdle);
#if !defined(MYSQL_CLIENT)
@@ -392,14 +431,14 @@ public:
bool open_index_file(const char *index_file_name_arg,
const char *log_name, bool need_mutex);
/* Use this to start writing a new log file */
- void new_file();
+ int new_file();
bool write(Log_event* event_info); // binary log write
bool write(THD *thd, IO_CACHE *cache, Log_event *commit_event, bool incident);
bool write_incident(THD *thd, bool lock);
int write_cache(THD *thd, IO_CACHE *cache, bool lock_log,
bool flush_and_sync);
- void set_write_error(THD *thd);
+ void set_write_error(THD *thd, bool is_transactional);
bool check_write_error(THD *thd);
void start_union_events(THD *thd, query_id_t query_id_param);
@@ -416,7 +455,7 @@ public:
void make_log_name(char* buf, const char* log_ident);
bool is_active(const char* log_file_name);
int update_log_index(LOG_INFO* linfo, bool need_update_threads);
- void rotate_and_purge(uint flags);
+ int rotate_and_purge(uint flags);
/**
Flush binlog cache and synchronize to disk.
@@ -648,7 +687,7 @@ 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);
+ ATTRIBUTE_FORMAT_FPTR(printf, 1, 2);
extern sql_print_message_func sql_print_message_handlers[];
int error_log_print(enum loglevel level, const char *format,
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 6f83e5f4db2..c5935b86df9 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -158,16 +158,21 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
" %s, Error_code: %d;", err->get_message_text(),
err->get_sql_errno());
}
-
- rli->report(level, thd->is_error()? thd->stmt_da->sql_errno() : 0,
- "Could not execute %s event on table %s.%s;"
- "%s handler error %s; "
- "the event's master log %s, end_log_pos %lu",
- type, table->s->db.str,
- table->s->table_name.str,
- buff,
- handler_error == NULL? "<unknown>" : handler_error,
- log_name, pos);
+
+ if (ha_error != 0)
+ rli->report(level, thd->is_error() ? thd->stmt_da->sql_errno() : 0,
+ "Could not execute %s event on table %s.%s;"
+ "%s handler error %s; "
+ "the event's master log %s, end_log_pos %lu",
+ type, table->s->db.str, table->s->table_name.str,
+ buff, handler_error == NULL ? "<unknown>" : handler_error,
+ log_name, pos);
+ else
+ rli->report(level, thd->is_error() ? thd->stmt_da->sql_errno() : 0,
+ "Could not execute %s event on table %s.%s;"
+ "%s the event's master log %s, end_log_pos %lu",
+ type, table->s->db.str, table->s->table_name.str,
+ buff, log_name, pos);
}
#endif
@@ -1238,7 +1243,7 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
break;
#ifdef HAVE_REPLICATION
case SLAVE_EVENT: /* can never happen (unused event) */
- ev = new Slave_log_event(buf, event_len);
+ ev = new Slave_log_event(buf, event_len, description_event);
break;
#endif /* HAVE_REPLICATION */
case CREATE_FILE_EVENT:
@@ -1326,8 +1331,10 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
(because constructor is "void") ; so instead we leave the pointer we
wanted to allocate (e.g. 'query') to 0 and we test it in is_valid().
Same for Format_description_log_event, member 'post_header_len'.
+
+ SLAVE_EVENT is never used, so it should not be read ever.
*/
- if (!ev || !ev->is_valid())
+ if (!ev || !ev->is_valid() || (event_type == SLAVE_EVENT))
{
DBUG_PRINT("error",("Found invalid event in binary log"));
@@ -2324,7 +2331,7 @@ bool Query_log_event::write(IO_CACHE* file)
start+= 4;
}
- if (thd && thd->is_current_user_used())
+ if (thd && thd->need_binlog_invoker())
{
LEX_STRING user;
LEX_STRING host;
@@ -2961,7 +2968,12 @@ void Query_log_event::print_query_header(IO_CACHE* file,
error_code);
}
- if (!(flags & LOG_EVENT_SUPPRESS_USE_F) && db)
+ if ((flags & LOG_EVENT_SUPPRESS_USE_F))
+ {
+ if (!is_trans_keyword())
+ print_event_info->db[0]= '\0';
+ }
+ else if (db)
{
different_db= memcmp(print_event_info->db, db, db_len + 1);
if (different_db)
@@ -3233,7 +3245,8 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
if (is_trans_keyword() || rpl_filter->db_ok(thd->db))
{
thd->set_time((time_t)when);
- thd->set_query_and_id((char*)query_arg, q_len_arg, next_query_id());
+ thd->set_query_and_id((char*)query_arg, q_len_arg,
+ thd->charset(), next_query_id());
thd->variables.pseudo_thread_id= thread_id; // for temp tables
DBUG_PRINT("query",("%s", thd->query()));
@@ -3285,6 +3298,18 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
goto compare_errors;
}
thd->update_charset(); // for the charset change to take effect
+ /*
+ Reset thd->query_string.cs to the newly set value.
+ Note, there is a small flaw here. For a very short time frame
+ if the new charset is different from the old charset and
+ if another thread executes "SHOW PROCESSLIST" after
+ the above thd->set_query_and_id() and before this thd->set_query(),
+ and if the current query has some non-ASCII characters,
+ the another thread may see some '?' marks in the PROCESSLIST
+ result. This should be acceptable now. This is a reminder
+ to fix this if any refactoring happens here sometime.
+ */
+ thd->set_query((char*) query_arg, q_len_arg, thd->charset());
}
}
if (time_zone_len)
@@ -3345,6 +3370,8 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
if (!parser_state.init(thd, thd->query(), thd->query_length()))
{
mysql_parse(thd, thd->query(), thd->query_length(), &parser_state);
+ /* Finalize server status flags after executing a statement. */
+ thd->update_server_status();
log_slow_statement(thd);
}
@@ -3419,7 +3446,8 @@ compare_errors:
rli->report(ERROR_LEVEL, 0,
"\
Query caused different errors on master and slave. \
-Error on master: '%s' (%d), Error on slave: '%s' (%d). \
+Error on master: message (format)='%s' error code=%d ; \
+Error on slave: actual message='%s', error code=%d. \
Default database: '%s'. Query: '%s'",
ER_SAFE(expected_error),
expected_error,
@@ -3505,7 +3533,7 @@ end:
*/
thd->catalog= 0;
thd->set_db(NULL, 0); /* will free the current database */
- thd->set_query(NULL, 0);
+ thd->reset_query();
DBUG_PRINT("info", ("end: query= 0"));
/*
As a disk space optimization, future masters will not log an event for
@@ -4742,7 +4770,7 @@ int Load_log_event::do_apply_event(NET* net, Relay_log_info const *rli,
new_db.str= (char *) rpl_filter->get_rewrite_db(db, &new_db.length);
thd->set_db(new_db.str, new_db.length);
DBUG_ASSERT(thd->query() == 0);
- thd->set_query_inner(NULL, 0); // Should not be needed
+ thd->reset_query_inner(); // Should not be needed
thd->is_slave_error= 0;
clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
@@ -4936,7 +4964,7 @@ error:
const char *remember_db= thd->db;
thd->catalog= 0;
thd->set_db(NULL, 0); /* will free the current database */
- thd->set_query(NULL, 0);
+ thd->reset_query();
thd->stmt_da->can_overwrite_status= TRUE;
thd->is_error() ? trans_rollback_stmt(thd) : trans_commit_stmt(thd);
thd->stmt_da->can_overwrite_status= FALSE;
@@ -4953,6 +4981,8 @@ error:
*/
if (! thd->in_multi_stmt_transaction_mode())
thd->mdl_context.release_transactional_locks();
+ else
+ thd->mdl_context.release_statement_locks();
DBUG_EXECUTE_IF("LOAD_DATA_INFILE_has_fatal_error",
thd->is_slave_error= 0; thd->is_fatal_error= 1;);
@@ -6111,8 +6141,12 @@ void Slave_log_event::init_from_mem_pool(int data_size)
/** This code is not used, so has not been updated to be format-tolerant. */
-Slave_log_event::Slave_log_event(const char* buf, uint event_len)
- :Log_event(buf,0) /*unused event*/ ,mem_pool(0),master_host(0)
+/* We are using description_event so that slave does not crash on Log_event
+ constructor */
+Slave_log_event::Slave_log_event(const char* buf,
+ uint event_len,
+ const Format_description_log_event* description_event)
+ :Log_event(buf,description_event),mem_pool(0),master_host(0)
{
if (event_len < LOG_EVENT_HEADER_LEN)
return;
@@ -7711,6 +7745,14 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
// Do event specific preparations
error= do_before_row_operations(rli);
+ /*
+ Bug#56662 Assertion failed: next_insert_id == 0, file handler.cc
+ Don't allow generation of auto_increment value when processing
+ rows event by setting 'MODE_NO_AUTO_VALUE_ON_ZERO'.
+ */
+ ulong saved_sql_mode= thd->variables.sql_mode;
+ thd->variables.sql_mode= MODE_NO_AUTO_VALUE_ON_ZERO;
+
// row processing loop
while (error == 0 && m_curr_row < m_rows_end)
@@ -7773,6 +7815,11 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
thd->transaction.stmt.modified_non_trans_table= TRUE;
} // row processing loop
+ /*
+ Restore the sql_mode after the rows event is processed.
+ */
+ thd->variables.sql_mode= saved_sql_mode;
+
{/**
The following failure injecion works in cooperation with tests
setting @@global.debug= 'd,stop_slave_middle_group'.
@@ -7811,19 +7858,16 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
/Sven
*/
thd->reset_current_stmt_binlog_format_row();
- const_cast<Relay_log_info*>(rli)->cleanup_context(thd, error);
thd->is_slave_error= 1;
DBUG_RETURN(error);
}
- if (get_flags(STMT_END_F))
- if ((error= rows_event_stmt_cleanup(rli, thd)))
- 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);
-
+ if (get_flags(STMT_END_F) && (error= rows_event_stmt_cleanup(rli, thd)))
+ slave_rows_error_report(ERROR_LEVEL,
+ thd->is_error() ? 0 : error,
+ rli, thd, table,
+ get_type_str(),
+ RPL_LOG_NAME, (ulong) log_pos);
DBUG_RETURN(error);
}
@@ -8502,6 +8546,8 @@ int Table_map_log_event::do_apply_event(Relay_log_info const *rli)
m_field_metadata, m_field_metadata_size,
m_null_bits, m_flags);
table_list->m_tabledef_valid= TRUE;
+ table_list->m_conv_table= NULL;
+ table_list->open_type= OT_BASE_ONLY;
/*
We record in the slave's information that the table should be
@@ -8606,7 +8652,7 @@ void Table_map_log_event::pack_info(Protocol *protocol)
#ifdef MYSQL_CLIENT
-void Table_map_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info)
+void Table_map_log_event::print(FILE *, PRINT_EVENT_INFO *print_event_info)
{
if (!print_event_info->short_form)
{
@@ -8843,16 +8889,11 @@ Rows_log_event::write_row(const Relay_log_info *const rli,
int UNINIT_VAR(keynum);
auto_afree_ptr<char> key(NULL);
- /* fill table->record[0] with default values */
- bool abort_on_warnings= (rli->sql_thd->variables.sql_mode &
- (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES));
- if ((error= prepare_record(table, m_width,
- table->file->ht->db_type != DB_TYPE_NDBCLUSTER,
- abort_on_warnings, m_curr_row == m_rows_buf)))
- DBUG_RETURN(error);
-
+ prepare_record(table, m_width,
+ table->file->ht->db_type != DB_TYPE_NDBCLUSTER);
+
/* unpack row into table->record[0] */
- if ((error= unpack_current_row(rli, abort_on_warnings)))
+ if ((error= unpack_current_row(rli)))
DBUG_RETURN(error);
if (m_curr_row == m_rows_buf)
@@ -9117,7 +9158,19 @@ static bool record_compare(TABLE *table)
}
}
- if (table->s->blob_fields + table->s->varchar_fields == 0)
+ /**
+ Compare full record only if:
+ - there are no blob fields (otherwise we would also need
+ to compare blobs contents as well);
+ - there are no varchar fields (otherwise we would also need
+ to compare varchar contents as well);
+ - there are no null fields, otherwise NULLed fields
+ contents (i.e., the don't care bytes) may show arbitrary
+ values, depending on how each engine handles internally.
+ */
+ if ((table->s->blob_fields +
+ table->s->varchar_fields +
+ table->s->null_fields) == 0)
{
result= cmp_record(table,record[1]);
goto record_compare_exit;
@@ -9132,13 +9185,22 @@ static bool record_compare(TABLE *table)
goto record_compare_exit;
}
- /* Compare updated fields */
+ /* Compare fields */
for (Field **ptr=table->field ; *ptr ; ptr++)
{
- if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length))
+
+ /**
+ We only compare field contents that are not null.
+ NULL fields (i.e., their null bits) were compared
+ earlier.
+ */
+ if (!(*(ptr))->is_null())
{
- result= TRUE;
- goto record_compare_exit;
+ if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length))
+ {
+ result= TRUE;
+ goto record_compare_exit;
+ }
}
}
@@ -9703,11 +9765,9 @@ Update_rows_log_event::do_exec_row(const Relay_log_info *const rli)
store_record(m_table,record[1]);
- bool abort_on_warnings= (rli->sql_thd->variables.sql_mode &
- (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES));
m_curr_row= m_curr_row_end;
/* this also updates m_curr_row_end */
- if ((error= unpack_current_row(rli, abort_on_warnings)))
+ if ((error= unpack_current_row(rli)))
return error;
/*
diff --git a/sql/log_event.h b/sql/log_event.h
index d900ddd36e6..e57115432ec 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -1039,7 +1039,7 @@ public:
return (void*) my_malloc((uint)size, MYF(MY_WME|MY_FAE));
}
- static void operator delete(void *ptr, size_t size)
+ static void operator delete(void *ptr, size_t)
{
my_free(ptr);
}
@@ -1858,7 +1858,9 @@ public:
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Slave_log_event(const char* buf, uint event_len);
+ Slave_log_event(const char* buf,
+ uint event_len,
+ const Format_description_log_event *description_event);
~Slave_log_event();
int get_data_size();
bool is_valid() const { return master_host != 0; }
@@ -2516,7 +2518,7 @@ class Xid_log_event: public Log_event
my_xid xid;
#ifdef MYSQL_SERVER
- Xid_log_event(THD* thd_arg, my_xid x): Log_event(thd_arg,0,0), xid(x) {}
+ Xid_log_event(THD* thd_arg, my_xid x): Log_event(thd_arg, 0, TRUE), xid(x) {}
#ifdef HAVE_REPLICATION
void pack_info(Protocol* protocol);
#endif /* HAVE_REPLICATION */
@@ -3679,16 +3681,13 @@ protected:
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,
- const bool abort_on_warning= TRUE)
- {
+ int unpack_current_row(const Relay_log_info *const rli)
+ {
DBUG_ASSERT(m_table);
- bool first_row= (m_curr_row == m_rows_buf);
ASSERT_OR_RETURN_ERROR(m_curr_row < m_rows_end, HA_ERR_CORRUPT_EVENT);
int const result= ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols,
- &m_curr_row_end, &m_master_reclength,
- abort_on_warning, first_row);
+ &m_curr_row_end, &m_master_reclength);
if (m_curr_row_end > m_rows_end)
my_error(ER_SLAVE_CORRUPT_EVENT, MYF(0));
ASSERT_OR_RETURN_ERROR(m_curr_row_end <= m_rows_end, HA_ERR_CORRUPT_EVENT);
diff --git a/sql/mdl.cc b/sql/mdl.cc
index aa7c2a4b7f2..21410db2d22 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -18,6 +18,8 @@
#include "debug_sync.h"
#include <hash.h>
#include <mysqld_error.h>
+#include <mysql/plugin.h>
+#include <mysql/service_thd_wait.h>
#ifdef HAVE_PSI_INTERFACE
static PSI_mutex_key key_MDL_map_mutex;
@@ -68,8 +70,6 @@ static void init_mdl_psi_keys(void)
}
#endif /* HAVE_PSI_INTERFACE */
-void notify_shared_lock(THD *thd, MDL_ticket *conflicting_ticket);
-
/**
Thread state names to be used in case when we have to wait on resource
@@ -78,12 +78,14 @@ void notify_shared_lock(THD *thd, MDL_ticket *conflicting_ticket);
const char *MDL_key::m_namespace_to_wait_state_name[NAMESPACE_END]=
{
- "Waiting for global metadata lock",
+ "Waiting for global read lock",
"Waiting for schema metadata lock",
"Waiting for table metadata lock",
"Waiting for stored function metadata lock",
"Waiting for stored procedure metadata lock",
- NULL
+ "Waiting for trigger metadata lock",
+ "Waiting for event metadata lock",
+ "Waiting for commit lock"
};
static bool mdl_initialized= 0;
@@ -100,7 +102,6 @@ class MDL_map
public:
void init();
void destroy();
- MDL_lock *find(const MDL_key *key);
MDL_lock *find_or_insert(const MDL_key *key);
void remove(MDL_lock *lock);
private:
@@ -110,6 +111,10 @@ private:
HASH m_locks;
/* Protects access to m_locks hash. */
mysql_mutex_t m_mutex;
+ /** Pre-allocated MDL_lock object for GLOBAL namespace. */
+ MDL_lock *m_global_lock;
+ /** Pre-allocated MDL_lock object for COMMIT namespace. */
+ MDL_lock *m_commit_lock;
};
@@ -124,6 +129,7 @@ public:
Deadlock_detection_visitor(MDL_context *start_node_arg)
: m_start_node(start_node_arg),
m_victim(NULL),
+ m_current_search_depth(0),
m_found_deadlock(FALSE)
{}
virtual bool enter_node(MDL_context *node);
@@ -132,8 +138,6 @@ public:
virtual bool inspect_edge(MDL_context *dest);
MDL_context *get_victim() const { return m_victim; }
-
- void abort_traversal(MDL_context *node);
private:
/**
Change the deadlock victim to a new one if it has lower deadlock
@@ -148,6 +152,13 @@ private:
MDL_context *m_start_node;
/** If a deadlock is found, the context that identifies the victim. */
MDL_context *m_victim;
+ /** Set to the 0 at start. Increased whenever
+ we descend into another MDL context (aka traverse to the next
+ wait-for graph node). When MAX_SEARCH_DEPTH is reached, we
+ assume that a deadlock is found, even if we have not found a
+ loop.
+ */
+ uint m_current_search_depth;
/** TRUE if we found a deadlock. */
bool m_found_deadlock;
/**
@@ -181,7 +192,7 @@ private:
bool Deadlock_detection_visitor::enter_node(MDL_context *node)
{
- m_found_deadlock= m_current_search_depth >= MAX_SEARCH_DEPTH;
+ m_found_deadlock= ++m_current_search_depth >= MAX_SEARCH_DEPTH;
if (m_found_deadlock)
{
DBUG_ASSERT(! m_victim);
@@ -201,6 +212,7 @@ bool Deadlock_detection_visitor::enter_node(MDL_context *node)
void Deadlock_detection_visitor::leave_node(MDL_context *node)
{
+ --m_current_search_depth;
if (m_found_deadlock)
opt_change_victim_to(node);
}
@@ -245,21 +257,6 @@ Deadlock_detection_visitor::opt_change_victim_to(MDL_context *new_victim)
/**
- Abort traversal of a wait-for graph and report a deadlock.
-
- @param node Node which we were about to visit when abort
- was initiated.
-*/
-
-void Deadlock_detection_visitor::abort_traversal(MDL_context *node)
-{
- DBUG_ASSERT(! m_victim);
- m_found_deadlock= TRUE;
- opt_change_victim_to(node);
-}
-
-
-/**
Get a bit corresponding to enum_mdl_type value in a granted/waiting bitmaps
and compatibility matrices.
*/
@@ -362,18 +359,6 @@ public:
inline static MDL_lock *create(const MDL_key *key);
- void notify_shared_locks(MDL_context *ctx)
- {
- Ticket_iterator it(m_granted);
- MDL_ticket *conflicting_ticket;
-
- while ((conflicting_ticket= it++))
- {
- if (conflicting_ticket->get_ctx() != ctx)
- notify_shared_lock(ctx->get_thd(), conflicting_ticket);
- }
- }
-
void reschedule_waiters();
void remove_ticket(Ticket_list MDL_lock::*queue, MDL_ticket *ticket);
@@ -381,6 +366,9 @@ public:
bool visit_subgraph(MDL_ticket *waiting_ticket,
MDL_wait_for_graph_visitor *gvisitor);
+ virtual bool needs_notification(const MDL_ticket *ticket) const = 0;
+ virtual void notify_conflicting_locks(MDL_context *ctx) = 0;
+
/** List of granted tickets for this lock. */
Ticket_list m_granted;
/** Tickets for contexts waiting to acquire a lock. */
@@ -450,6 +438,11 @@ public:
{
return m_waiting_incompatible;
}
+ virtual bool needs_notification(const MDL_ticket *ticket) const
+ {
+ return (ticket->get_type() == MDL_SHARED);
+ }
+ virtual void notify_conflicting_locks(MDL_context *ctx);
private:
static const bitmap_t m_granted_incompatible[MDL_TYPE_END];
@@ -477,6 +470,11 @@ public:
{
return m_waiting_incompatible;
}
+ virtual bool needs_notification(const MDL_ticket *ticket) const
+ {
+ return ticket->is_upgradable_or_exclusive();
+ }
+ virtual void notify_conflicting_locks(MDL_context *ctx);
private:
static const bitmap_t m_granted_incompatible[MDL_TYPE_END];
@@ -544,9 +542,14 @@ void mdl_destroy()
void MDL_map::init()
{
+ MDL_key global_lock_key(MDL_key::GLOBAL, "", "");
+ MDL_key commit_lock_key(MDL_key::COMMIT, "", "");
+
mysql_mutex_init(key_MDL_map_mutex, &m_mutex, NULL);
my_hash_init(&m_locks, &my_charset_bin, 16 /* FIXME */, 0, 0,
mdl_locks_key, 0, 0);
+ m_global_lock= MDL_lock::create(&global_lock_key);
+ m_commit_lock= MDL_lock::create(&commit_lock_key);
}
@@ -560,6 +563,8 @@ void MDL_map::destroy()
DBUG_ASSERT(!m_locks.records);
mysql_mutex_destroy(&m_mutex);
my_hash_free(&m_locks);
+ MDL_lock::destroy(m_global_lock);
+ MDL_lock::destroy(m_commit_lock);
}
@@ -577,43 +582,28 @@ MDL_lock* MDL_map::find_or_insert(const MDL_key *mdl_key)
MDL_lock *lock;
my_hash_value_type hash_value;
- hash_value= my_calc_hash(&m_locks, mdl_key->ptr(), mdl_key->length());
-
-retry:
- mysql_mutex_lock(&m_mutex);
- if (!(lock= (MDL_lock*) my_hash_search_using_hash_value(&m_locks,
- hash_value,
- mdl_key->ptr(),
- mdl_key->length())))
+ if (mdl_key->mdl_namespace() == MDL_key::GLOBAL ||
+ mdl_key->mdl_namespace() == MDL_key::COMMIT)
{
- lock= MDL_lock::create(mdl_key);
- if (!lock || my_hash_insert(&m_locks, (uchar*)lock))
- {
- mysql_mutex_unlock(&m_mutex);
- MDL_lock::destroy(lock);
- return NULL;
- }
- }
+ /*
+ Avoid locking m_mutex when lock for GLOBAL or COMMIT namespace is
+ requested. Return pointer to pre-allocated MDL_lock instance instead.
+ Such an optimization allows to save one mutex lock/unlock for any
+ statement changing data.
- if (move_from_hash_to_lock_mutex(lock))
- goto retry;
+ It works since these namespaces contain only one element so keys
+ for them look like '<namespace-id>\0\0'.
+ */
+ DBUG_ASSERT(mdl_key->length() == 3);
- return lock;
-}
+ lock= (mdl_key->mdl_namespace() == MDL_key::GLOBAL) ? m_global_lock :
+ m_commit_lock;
+ mysql_prlock_wrlock(&lock->m_rwlock);
-/**
- Find MDL_lock object corresponding to the key.
-
- @retval non-NULL - MDL_lock instance for the key with locked
- MDL_lock::m_rwlock.
- @retval NULL - There was no MDL_lock for the key.
-*/
+ return lock;
+ }
-MDL_lock* MDL_map::find(const MDL_key *mdl_key)
-{
- MDL_lock *lock;
- my_hash_value_type hash_value;
hash_value= my_calc_hash(&m_locks, mdl_key->ptr(), mdl_key->length());
@@ -624,8 +614,13 @@ retry:
mdl_key->ptr(),
mdl_key->length())))
{
- mysql_mutex_unlock(&m_mutex);
- return NULL;
+ lock= MDL_lock::create(mdl_key);
+ if (!lock || my_hash_insert(&m_locks, (uchar*)lock))
+ {
+ mysql_mutex_unlock(&m_mutex);
+ MDL_lock::destroy(lock);
+ return NULL;
+ }
}
if (move_from_hash_to_lock_mutex(lock))
@@ -692,6 +687,17 @@ void MDL_map::remove(MDL_lock *lock)
{
uint ref_usage, ref_release;
+ if (lock->key.mdl_namespace() == MDL_key::GLOBAL ||
+ lock->key.mdl_namespace() == MDL_key::COMMIT)
+ {
+ /*
+ Never destroy pre-allocated MDL_lock objects for GLOBAL and
+ COMMIT namespaces.
+ */
+ mysql_prlock_unlock(&lock->m_rwlock);
+ return;
+ }
+
/*
Destroy the MDL_lock object, but ensure that anyone that is
holding a reference to the object is not remaining, if so he
@@ -727,8 +733,7 @@ void MDL_map::remove(MDL_lock *lock)
*/
MDL_context::MDL_context()
- :m_trans_sentinel(NULL),
- m_thd(NULL),
+ : m_thd(NULL),
m_needs_thr_lock_abort(FALSE),
m_waiting_for(NULL)
{
@@ -750,7 +755,9 @@ MDL_context::MDL_context()
void MDL_context::destroy()
{
- DBUG_ASSERT(m_tickets.is_empty());
+ DBUG_ASSERT(m_tickets[MDL_STATEMENT].is_empty() &&
+ m_tickets[MDL_TRANSACTION].is_empty() &&
+ m_tickets[MDL_EXPLICIT].is_empty());
mysql_prlock_destroy(&m_LOCK_waiting_for);
}
@@ -779,10 +786,12 @@ void MDL_context::destroy()
void MDL_request::init(MDL_key::enum_mdl_namespace mdl_namespace,
const char *db_arg,
const char *name_arg,
- enum enum_mdl_type mdl_type_arg)
+ enum_mdl_type mdl_type_arg,
+ enum_mdl_duration mdl_duration_arg)
{
key.mdl_key_init(mdl_namespace, db_arg, name_arg);
type= mdl_type_arg;
+ duration= mdl_duration_arg;
ticket= NULL;
}
@@ -797,49 +806,17 @@ void MDL_request::init(MDL_key::enum_mdl_namespace mdl_namespace,
*/
void MDL_request::init(const MDL_key *key_arg,
- enum enum_mdl_type mdl_type_arg)
+ enum_mdl_type mdl_type_arg,
+ enum_mdl_duration mdl_duration_arg)
{
key.mdl_key_init(key_arg);
type= mdl_type_arg;
+ duration= mdl_duration_arg;
ticket= NULL;
}
/**
- Allocate and initialize one lock request.
-
- Same as mdl_init_lock(), but allocates the lock and the key buffer
- on a memory root. Necessary to lock ad-hoc tables, e.g.
- mysql.* tables of grant and data dictionary subsystems.
-
- @param mdl_namespace Id of namespace of object to be locked
- @param db Name of database to which object belongs
- @param name Name of of object
- @param root MEM_ROOT on which object should be allocated
-
- @note The allocated lock request will have MDL_SHARED type.
-
- @retval 0 Error if out of memory
- @retval non-0 Pointer to an object representing a lock request
-*/
-
-MDL_request *
-MDL_request::create(MDL_key::enum_mdl_namespace mdl_namespace, const char *db,
- const char *name, enum_mdl_type mdl_type,
- MEM_ROOT *root)
-{
- MDL_request *mdl_request;
-
- if (!(mdl_request= (MDL_request*) alloc_root(root, sizeof(MDL_request))))
- return NULL;
-
- mdl_request->init(mdl_namespace, db, name, mdl_type);
-
- return mdl_request;
-}
-
-
-/**
Auxiliary functions needed for creation/destruction of MDL_lock objects.
@note Also chooses an MDL_lock descendant appropriate for object namespace.
@@ -854,6 +831,7 @@ inline MDL_lock *MDL_lock::create(const MDL_key *mdl_key)
{
case MDL_key::GLOBAL:
case MDL_key::SCHEMA:
+ case MDL_key::COMMIT:
return new MDL_scoped_lock(mdl_key);
default:
return new MDL_object_lock(mdl_key);
@@ -875,9 +853,17 @@ void MDL_lock::destroy(MDL_lock *lock)
on memory allocation by reusing released objects.
*/
-MDL_ticket *MDL_ticket::create(MDL_context *ctx_arg, enum_mdl_type type_arg)
+MDL_ticket *MDL_ticket::create(MDL_context *ctx_arg, enum_mdl_type type_arg
+#ifndef DBUG_OFF
+ , enum_mdl_duration duration_arg
+#endif
+ )
{
- return new MDL_ticket(ctx_arg, type_arg);
+ return new MDL_ticket(ctx_arg, type_arg
+#ifndef DBUG_OFF
+ , duration_arg
+#endif
+ );
}
@@ -989,10 +975,14 @@ MDL_wait::timed_wait(THD *thd, struct timespec *abs_timeout,
old_msg= thd_enter_cond(thd, &m_COND_wait_status, &m_LOCK_wait_status,
wait_state_name);
+ thd_wait_begin(thd, THD_WAIT_META_DATA_LOCK);
while (!m_wait_status && !thd_killed(thd) &&
wait_result != ETIMEDOUT && wait_result != ETIME)
+ {
wait_result= mysql_cond_timedwait(&m_COND_wait_status, &m_LOCK_wait_status,
abs_timeout);
+ }
+ thd_wait_end(thd);
if (m_wait_status == EMPTY)
{
@@ -1446,13 +1436,11 @@ bool MDL_ticket::is_incompatible_when_waiting(enum_mdl_type type) const
/**
Check whether the context already holds a compatible lock ticket
on an object.
- Start searching the transactional locks. If not
- found in the list of transactional locks, look at LOCK TABLES
- and HANDLER locks.
+ Start searching from list of locks for the same duration as lock
+ being requested. If not look at lists for other durations.
@param mdl_request Lock request object for lock to be acquired
- @param[out] is_transactional FALSE if we pass beyond m_trans_sentinel
- while searching for ticket, otherwise TRUE.
+ @param[out] result_duration Duration of lock which was found.
@note Tickets which correspond to lock types "stronger" than one
being requested are also considered compatible.
@@ -1462,24 +1450,28 @@ bool MDL_ticket::is_incompatible_when_waiting(enum_mdl_type type) const
MDL_ticket *
MDL_context::find_ticket(MDL_request *mdl_request,
- bool *is_transactional)
+ enum_mdl_duration *result_duration)
{
MDL_ticket *ticket;
- Ticket_iterator it(m_tickets);
+ int i;
- *is_transactional= TRUE;
-
- while ((ticket= it++))
+ for (i= 0; i < MDL_DURATION_END; i++)
{
- if (ticket == m_trans_sentinel)
- *is_transactional= FALSE;
+ enum_mdl_duration duration= (enum_mdl_duration)((mdl_request->duration+i) %
+ MDL_DURATION_END);
+ Ticket_iterator it(m_tickets[duration]);
- if (mdl_request->key.is_equal(&ticket->m_lock->key) &&
- ticket->has_stronger_or_equal_type(mdl_request->type))
- break;
+ while ((ticket= it++))
+ {
+ if (mdl_request->key.is_equal(&ticket->m_lock->key) &&
+ ticket->has_stronger_or_equal_type(mdl_request->type))
+ {
+ *result_duration= duration;
+ return ticket;
+ }
+ }
}
-
- return ticket;
+ return NULL;
}
@@ -1557,7 +1549,7 @@ MDL_context::try_acquire_lock_impl(MDL_request *mdl_request,
MDL_lock *lock;
MDL_key *key= &mdl_request->key;
MDL_ticket *ticket;
- bool is_transactional;
+ enum_mdl_duration found_duration;
DBUG_ASSERT(mdl_request->type != MDL_EXCLUSIVE ||
is_lock_owner(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE));
@@ -1571,7 +1563,7 @@ MDL_context::try_acquire_lock_impl(MDL_request *mdl_request,
Check whether the context already holds a shared lock on the object,
and if so, grant the request.
*/
- if ((ticket= find_ticket(mdl_request, &is_transactional)))
+ if ((ticket= find_ticket(mdl_request, &found_duration)))
{
DBUG_ASSERT(ticket->m_lock);
DBUG_ASSERT(ticket->has_stronger_or_equal_type(mdl_request->type));
@@ -1593,7 +1585,9 @@ MDL_context::try_acquire_lock_impl(MDL_request *mdl_request,
a different alias.
*/
mdl_request->ticket= ticket;
- if (!is_transactional && clone_ticket(mdl_request))
+ if ((found_duration != mdl_request->duration ||
+ mdl_request->duration == MDL_EXPLICIT) &&
+ clone_ticket(mdl_request))
{
/* Clone failed. */
mdl_request->ticket= NULL;
@@ -1602,7 +1596,11 @@ MDL_context::try_acquire_lock_impl(MDL_request *mdl_request,
return FALSE;
}
- if (!(ticket= MDL_ticket::create(this, mdl_request->type)))
+ if (!(ticket= MDL_ticket::create(this, mdl_request->type
+#ifndef DBUG_OFF
+ , mdl_request->duration
+#endif
+ )))
return TRUE;
/* The below call implicitly locks MDL_lock::m_rwlock on success. */
@@ -1620,7 +1618,7 @@ MDL_context::try_acquire_lock_impl(MDL_request *mdl_request,
mysql_prlock_unlock(&lock->m_rwlock);
- m_tickets.push_front(ticket);
+ m_tickets[mdl_request->duration].push_front(ticket);
mdl_request->ticket= ticket;
}
@@ -1655,7 +1653,11 @@ MDL_context::clone_ticket(MDL_request *mdl_request)
we effectively downgrade the cloned lock to the level of
the request.
*/
- if (!(ticket= MDL_ticket::create(this, mdl_request->type)))
+ if (!(ticket= MDL_ticket::create(this, mdl_request->type
+#ifndef DBUG_OFF
+ , mdl_request->duration
+#endif
+ )))
return TRUE;
/* clone() is not supposed to be used to get a stronger lock. */
@@ -1668,36 +1670,74 @@ MDL_context::clone_ticket(MDL_request *mdl_request)
ticket->m_lock->m_granted.add_ticket(ticket);
mysql_prlock_unlock(&ticket->m_lock->m_rwlock);
- m_tickets.push_front(ticket);
+ m_tickets[mdl_request->duration].push_front(ticket);
return FALSE;
}
/**
- Notify a thread holding a shared metadata lock which
- conflicts with a pending exclusive lock.
+ Notify threads holding a shared metadata locks on object which
+ conflict with a pending X, SNW or SNRW lock.
- @param thd Current thread context
- @param conflicting_ticket Conflicting metadata lock
+ @param ctx MDL_context for current thread.
*/
-void notify_shared_lock(THD *thd, MDL_ticket *conflicting_ticket)
+void MDL_object_lock::notify_conflicting_locks(MDL_context *ctx)
{
- /* Only try to abort locks on which we back off. */
- if (conflicting_ticket->get_type() < MDL_SHARED_NO_WRITE)
+ Ticket_iterator it(m_granted);
+ MDL_ticket *conflicting_ticket;
+
+ while ((conflicting_ticket= it++))
{
- MDL_context *conflicting_ctx= conflicting_ticket->get_ctx();
- THD *conflicting_thd= conflicting_ctx->get_thd();
- DBUG_ASSERT(thd != conflicting_thd); /* Self-deadlock */
+ /* Only try to abort locks on which we back off. */
+ if (conflicting_ticket->get_ctx() != ctx &&
+ conflicting_ticket->get_type() < MDL_SHARED_NO_WRITE)
- /*
- If thread which holds conflicting lock is waiting on table-level
- lock or some other non-MDL resource we might need to wake it up
- by calling code outside of MDL.
- */
- mysql_notify_thread_having_shared_lock(thd, conflicting_thd,
- conflicting_ctx->get_needs_thr_lock_abort());
+ {
+ MDL_context *conflicting_ctx= conflicting_ticket->get_ctx();
+
+ /*
+ If thread which holds conflicting lock is waiting on table-level
+ lock or some other non-MDL resource we might need to wake it up
+ by calling code outside of MDL.
+ */
+ mysql_notify_thread_having_shared_lock(ctx->get_thd(),
+ conflicting_ctx->get_thd(),
+ conflicting_ctx->get_needs_thr_lock_abort());
+ }
+ }
+}
+
+
+/**
+ Notify threads holding scoped IX locks which conflict with a pending S lock.
+
+ @param ctx MDL_context for current thread.
+*/
+
+void MDL_scoped_lock::notify_conflicting_locks(MDL_context *ctx)
+{
+ Ticket_iterator it(m_granted);
+ MDL_ticket *conflicting_ticket;
+
+ while ((conflicting_ticket= it++))
+ {
+ if (conflicting_ticket->get_ctx() != ctx &&
+ conflicting_ticket->get_type() == MDL_INTENTION_EXCLUSIVE)
+
+ {
+ MDL_context *conflicting_ctx= conflicting_ticket->get_ctx();
+
+ /*
+ Thread which holds global IX lock can be a handler thread for
+ insert delayed. We need to kill such threads in order to get
+ global shared lock. We do this my calling code outside of MDL.
+ */
+ mysql_notify_thread_having_shared_lock(ctx->get_thd(),
+ conflicting_ctx->get_thd(),
+ conflicting_ctx->get_needs_thr_lock_abort());
+ }
}
}
@@ -1755,8 +1795,8 @@ MDL_context::acquire_lock(MDL_request *mdl_request, ulong lock_wait_timeout)
*/
m_wait.reset_status();
- if (ticket->is_upgradable_or_exclusive())
- lock->notify_shared_locks(this);
+ if (lock->needs_notification(ticket))
+ lock->notify_conflicting_locks(this);
mysql_prlock_unlock(&lock->m_rwlock);
@@ -1767,7 +1807,7 @@ MDL_context::acquire_lock(MDL_request *mdl_request, ulong lock_wait_timeout)
find_deadlock();
- if (ticket->is_upgradable_or_exclusive())
+ if (lock->needs_notification(ticket))
{
struct timespec abs_shortwait;
set_timespec(abs_shortwait, 1);
@@ -1783,7 +1823,7 @@ MDL_context::acquire_lock(MDL_request *mdl_request, ulong lock_wait_timeout)
break;
mysql_prlock_wrlock(&lock->m_rwlock);
- lock->notify_shared_locks(this);
+ lock->notify_conflicting_locks(this);
mysql_prlock_unlock(&lock->m_rwlock);
set_timespec(abs_shortwait, 1);
}
@@ -1826,7 +1866,7 @@ MDL_context::acquire_lock(MDL_request *mdl_request, ulong lock_wait_timeout)
*/
DBUG_ASSERT(wait_status == MDL_wait::GRANTED);
- m_tickets.push_front(ticket);
+ m_tickets[mdl_request->duration].push_front(ticket);
mdl_request->ticket= ticket;
@@ -1867,7 +1907,7 @@ bool MDL_context::acquire_locks(MDL_request_list *mdl_requests,
{
MDL_request_list::Iterator it(*mdl_requests);
MDL_request **sort_buf, **p_req;
- MDL_ticket *mdl_svp= mdl_savepoint();
+ MDL_savepoint mdl_svp= mdl_savepoint();
ssize_t req_count= static_cast<ssize_t>(mdl_requests->elements());
if (req_count == 0)
@@ -1936,7 +1976,7 @@ MDL_context::upgrade_shared_lock_to_exclusive(MDL_ticket *mdl_ticket,
ulong lock_wait_timeout)
{
MDL_request mdl_xlock_request;
- MDL_ticket *mdl_svp= mdl_savepoint();
+ MDL_savepoint mdl_svp= mdl_savepoint();
bool is_new_ticket;
DBUG_ENTER("MDL_ticket::upgrade_shared_lock_to_exclusive");
@@ -1953,7 +1993,8 @@ MDL_context::upgrade_shared_lock_to_exclusive(MDL_ticket *mdl_ticket,
DBUG_ASSERT(mdl_ticket->m_type == MDL_SHARED_NO_WRITE ||
mdl_ticket->m_type == MDL_SHARED_NO_READ_WRITE);
- mdl_xlock_request.init(&mdl_ticket->m_lock->key, MDL_EXCLUSIVE);
+ mdl_xlock_request.init(&mdl_ticket->m_lock->key, MDL_EXCLUSIVE,
+ MDL_TRANSACTION);
if (acquire_lock(&mdl_xlock_request, lock_wait_timeout))
DBUG_RETURN(TRUE);
@@ -1977,7 +2018,7 @@ MDL_context::upgrade_shared_lock_to_exclusive(MDL_ticket *mdl_ticket,
if (is_new_ticket)
{
- m_tickets.remove(mdl_xlock_request.ticket);
+ m_tickets[MDL_TRANSACTION].remove(mdl_xlock_request.ticket);
MDL_ticket::destroy(mdl_xlock_request.ticket);
}
@@ -2064,13 +2105,8 @@ bool MDL_lock::visit_subgraph(MDL_ticket *waiting_ticket,
are visiting it but this is OK: in the worst case we might do some
extra work and one more context might be chosen as a victim.
*/
- ++gvisitor->m_current_search_depth;
-
if (gvisitor->enter_node(src_ctx))
- {
- --gvisitor->m_current_search_depth;
goto end;
- }
/*
We do a breadth-first search first -- that is, inspect all
@@ -2127,7 +2163,6 @@ bool MDL_lock::visit_subgraph(MDL_ticket *waiting_ticket,
end_leave_node:
gvisitor->leave_node(src_ctx);
- --gvisitor->m_current_search_depth;
end:
mysql_prlock_unlock(&m_rwlock);
@@ -2244,10 +2279,12 @@ void MDL_context::find_deadlock()
/**
Release lock.
- @param ticket Ticket for lock to be released.
+ @param duration Lock duration.
+ @param ticket Ticket for lock to be released.
+
*/
-void MDL_context::release_lock(MDL_ticket *ticket)
+void MDL_context::release_lock(enum_mdl_duration duration, MDL_ticket *ticket)
{
MDL_lock *lock= ticket->m_lock;
DBUG_ENTER("MDL_context::release_lock");
@@ -2257,12 +2294,9 @@ void MDL_context::release_lock(MDL_ticket *ticket)
DBUG_ASSERT(this == ticket->get_ctx());
mysql_mutex_assert_not_owner(&LOCK_open);
- if (ticket == m_trans_sentinel)
- m_trans_sentinel= ++Ticket_list::Iterator(m_tickets, ticket);
-
lock->remove_ticket(&MDL_lock::m_granted, ticket);
- m_tickets.remove(ticket);
+ m_tickets[duration].remove(ticket);
MDL_ticket::destroy(ticket);
DBUG_VOID_RETURN;
@@ -2270,50 +2304,56 @@ void MDL_context::release_lock(MDL_ticket *ticket)
/**
+ Release lock with explicit duration.
+
+ @param ticket Ticket for lock to be released.
+
+*/
+
+void MDL_context::release_lock(MDL_ticket *ticket)
+{
+ DBUG_ASSERT(ticket->m_duration == MDL_EXPLICIT);
+
+ release_lock(MDL_EXPLICIT, ticket);
+}
+
+
+/**
Release all locks associated with the context. If the sentinel
is not NULL, do not release locks stored in the list after and
including the sentinel.
- Transactional locks are added to the beginning of the list, i.e.
- stored in reverse temporal order. This allows to employ this
- function to:
+ Statement and transactional locks are added to the beginning of
+ the corresponding lists, i.e. stored in reverse temporal order.
+ This allows to employ this function to:
- back off in case of a lock conflict.
- - release all locks in the end of a transaction
+ - release all locks in the end of a statment or transaction
- rollback to a savepoint.
-
- The sentinel semantics is used to support LOCK TABLES
- mode and HANDLER statements: locks taken by these statements
- survive COMMIT, ROLLBACK, ROLLBACK TO SAVEPOINT.
*/
-void MDL_context::release_locks_stored_before(MDL_ticket *sentinel)
+void MDL_context::release_locks_stored_before(enum_mdl_duration duration,
+ MDL_ticket *sentinel)
{
MDL_ticket *ticket;
- Ticket_iterator it(m_tickets);
+ Ticket_iterator it(m_tickets[duration]);
DBUG_ENTER("MDL_context::release_locks_stored_before");
- if (m_tickets.is_empty())
+ if (m_tickets[duration].is_empty())
DBUG_VOID_RETURN;
while ((ticket= it++) && ticket != sentinel)
{
DBUG_PRINT("info", ("found lock to release ticket=%p", ticket));
- release_lock(ticket);
+ release_lock(duration, ticket);
}
- /*
- If all locks were released, then the sentinel was not present
- in the list. It must never happen because the sentinel was
- bogus, i.e. pointed to a ticket that no longer exists.
- */
- DBUG_ASSERT(! m_tickets.is_empty() || sentinel == NULL);
DBUG_VOID_RETURN;
}
/**
- Release all locks in the context which correspond to the same name/
- object as this lock request.
+ Release all explicit locks in the context which correspond to the
+ same name/object as this lock request.
@param ticket One of the locks for the name/object for which all
locks should be released.
@@ -2326,17 +2366,13 @@ void MDL_context::release_all_locks_for_name(MDL_ticket *name)
/* Remove matching lock tickets from the context. */
MDL_ticket *ticket;
- Ticket_iterator it_ticket(m_tickets);
+ Ticket_iterator it_ticket(m_tickets[MDL_EXPLICIT]);
while ((ticket= it_ticket++))
{
DBUG_ASSERT(ticket->m_lock);
- /*
- We rarely have more than one ticket in this loop,
- let's not bother saving on pthread_cond_broadcast().
- */
if (ticket->m_lock == lock)
- release_lock(ticket);
+ release_lock(MDL_EXPLICIT, ticket);
}
}
@@ -2391,9 +2427,10 @@ MDL_context::is_lock_owner(MDL_key::enum_mdl_namespace mdl_namespace,
enum_mdl_type mdl_type)
{
MDL_request mdl_request;
- bool is_transactional_unused;
- mdl_request.init(mdl_namespace, db, name, mdl_type);
- MDL_ticket *ticket= find_ticket(&mdl_request, &is_transactional_unused);
+ enum_mdl_duration not_unused;
+ /* We don't care about exact duration of lock here. */
+ mdl_request.init(mdl_namespace, db, name, mdl_type, MDL_TRANSACTION);
+ MDL_ticket *ticket= find_ticket(&mdl_request, &not_unused);
DBUG_ASSERT(ticket == NULL || ticket->m_lock);
@@ -2422,18 +2459,15 @@ bool MDL_ticket::has_pending_conflicting_lock() const
@note It's safe to iterate and unlock any locks after taken after this
savepoint because other statements that take other special locks
cause a implicit commit (ie LOCK TABLES).
-
- @param mdl_savepont The last acquired MDL lock when the
- savepoint was set.
*/
-void MDL_context::rollback_to_savepoint(MDL_ticket *mdl_savepoint)
+void MDL_context::rollback_to_savepoint(const MDL_savepoint &mdl_savepoint)
{
DBUG_ENTER("MDL_context::rollback_to_savepoint");
/* If savepoint is NULL, it is from the start of the transaction. */
- release_locks_stored_before(mdl_savepoint ?
- mdl_savepoint : m_trans_sentinel);
+ release_locks_stored_before(MDL_STATEMENT, mdl_savepoint.m_stmt_ticket);
+ release_locks_stored_before(MDL_TRANSACTION, mdl_savepoint.m_trans_ticket);
DBUG_VOID_RETURN;
}
@@ -2451,65 +2485,150 @@ void MDL_context::rollback_to_savepoint(MDL_ticket *mdl_savepoint)
void MDL_context::release_transactional_locks()
{
DBUG_ENTER("MDL_context::release_transactional_locks");
- release_locks_stored_before(m_trans_sentinel);
+ release_locks_stored_before(MDL_STATEMENT, NULL);
+ release_locks_stored_before(MDL_TRANSACTION, NULL);
+ DBUG_VOID_RETURN;
+}
+
+
+void MDL_context::release_statement_locks()
+{
+ DBUG_ENTER("MDL_context::release_transactional_locks");
+ release_locks_stored_before(MDL_STATEMENT, NULL);
DBUG_VOID_RETURN;
}
/**
Does this savepoint have this lock?
-
- @retval TRUE The ticket is older than the savepoint and
- is not LT, HA or GLR ticket. Thus it belongs
- to the savepoint.
- @retval FALSE The ticket is newer than the savepoint
- or is an LT, HA or GLR ticket.
+
+ @retval TRUE The ticket is older than the savepoint or
+ is an LT, HA or GLR ticket. Thus it belongs
+ to the savepoint or has explicit duration.
+ @retval FALSE The ticket is newer than the savepoint.
+ and is not an LT, HA or GLR ticket.
*/
-bool MDL_context::has_lock(MDL_ticket *mdl_savepoint,
+bool MDL_context::has_lock(const MDL_savepoint &mdl_savepoint,
MDL_ticket *mdl_ticket)
{
MDL_ticket *ticket;
/* Start from the beginning, most likely mdl_ticket's been just acquired. */
- MDL_context::Ticket_iterator it(m_tickets);
- bool found_savepoint= FALSE;
+ MDL_context::Ticket_iterator s_it(m_tickets[MDL_STATEMENT]);
+ MDL_context::Ticket_iterator t_it(m_tickets[MDL_TRANSACTION]);
- while ((ticket= it++) && ticket != m_trans_sentinel)
+ while ((ticket= s_it++) && ticket != mdl_savepoint.m_stmt_ticket)
{
- /*
- First met the savepoint. The ticket must be
- somewhere after it.
- */
- if (ticket == mdl_savepoint)
- found_savepoint= TRUE;
- /*
- Met the ticket. If we haven't yet met the savepoint,
- the ticket is newer than the savepoint.
- */
if (ticket == mdl_ticket)
- return found_savepoint;
+ return FALSE;
}
- /* Reached m_trans_sentinel. The ticket must be LT, HA or GRL ticket. */
- return FALSE;
+
+ while ((ticket= t_it++) && ticket != mdl_savepoint.m_trans_ticket)
+ {
+ if (ticket == mdl_ticket)
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+/**
+ Change lock duration for transactional lock.
+
+ @param ticket Ticket representing lock.
+ @param duration Lock duration to be set.
+
+ @note This method only supports changing duration of
+ transactional lock to some other duration.
+*/
+
+void MDL_context::set_lock_duration(MDL_ticket *mdl_ticket,
+ enum_mdl_duration duration)
+{
+ DBUG_ASSERT(mdl_ticket->m_duration == MDL_TRANSACTION &&
+ duration != MDL_TRANSACTION);
+
+ m_tickets[MDL_TRANSACTION].remove(mdl_ticket);
+ m_tickets[duration].push_front(mdl_ticket);
+#ifndef DBUG_OFF
+ mdl_ticket->m_duration= duration;
+#endif
}
/**
- Rearrange the ticket to reside in the part of the list that's
- beyond m_trans_sentinel. This effectively changes the ticket
- life cycle, from automatic to manual: i.e. the ticket is no
- longer released by MDL_context::release_transactional_locks() or
- MDL_context::rollback_to_savepoint(), it must be released manually.
+ Set explicit duration for all locks in the context.
*/
-void MDL_context::move_ticket_after_trans_sentinel(MDL_ticket *mdl_ticket)
+void MDL_context::set_explicit_duration_for_all_locks()
{
- m_tickets.remove(mdl_ticket);
- if (m_trans_sentinel == NULL)
+ int i;
+ MDL_ticket *ticket;
+
+ /*
+ In the most common case when this function is called list
+ of transactional locks is bigger than list of locks with
+ explicit duration. So we start by swapping these two lists
+ and then move elements from new list of transactional
+ locks and list of statement locks to list of locks with
+ explicit duration.
+ */
+
+ m_tickets[MDL_EXPLICIT].swap(m_tickets[MDL_TRANSACTION]);
+
+ for (i= 0; i < MDL_EXPLICIT; i++)
{
- m_trans_sentinel= mdl_ticket;
- m_tickets.push_back(mdl_ticket);
+ Ticket_iterator it_ticket(m_tickets[i]);
+
+ while ((ticket= it_ticket++))
+ {
+ m_tickets[i].remove(ticket);
+ m_tickets[MDL_EXPLICIT].push_front(ticket);
+ }
}
- else
- m_tickets.insert_after(m_trans_sentinel, mdl_ticket);
+
+#ifndef DBUG_OFF
+ Ticket_iterator exp_it(m_tickets[MDL_EXPLICIT]);
+
+ while ((ticket= exp_it++))
+ ticket->m_duration= MDL_EXPLICIT;
+#endif
+}
+
+
+/**
+ Set transactional duration for all locks in the context.
+*/
+
+void MDL_context::set_transaction_duration_for_all_locks()
+{
+ MDL_ticket *ticket;
+
+ /*
+ In the most common case when this function is called list
+ of explicit locks is bigger than two other lists (in fact,
+ list of statement locks is always empty). So we start by
+ swapping list of explicit and transactional locks and then
+ move contents of new list of explicit locks to list of
+ locks with transactional duration.
+ */
+
+ DBUG_ASSERT(m_tickets[MDL_STATEMENT].is_empty());
+
+ m_tickets[MDL_TRANSACTION].swap(m_tickets[MDL_EXPLICIT]);
+
+ Ticket_iterator it_ticket(m_tickets[MDL_EXPLICIT]);
+
+ while ((ticket= it_ticket++))
+ {
+ m_tickets[MDL_EXPLICIT].remove(ticket);
+ m_tickets[MDL_TRANSACTION].push_front(ticket);
+ }
+
+#ifndef DBUG_OFF
+ Ticket_iterator trans_it(m_tickets[MDL_TRANSACTION]);
+
+ while ((ticket= trans_it++))
+ ticket->m_duration= MDL_TRANSACTION;
+#endif
}
diff --git a/sql/mdl.h b/sql/mdl.h
index b9dad0597da..2fa89ea2f55 100644
--- a/sql/mdl.h
+++ b/sql/mdl.h
@@ -151,6 +151,15 @@ enum enum_mdl_type {
MDL_TYPE_END};
+/** Duration of metadata lock. */
+
+enum enum_mdl_duration { MDL_STATEMENT= 0,
+ MDL_TRANSACTION,
+ MDL_EXPLICIT,
+ /* This should be the last ! */
+ MDL_DURATION_END };
+
+
/** Maximal length of key for metadata locking subsystem. */
#define MAX_MDLKEY_LENGTH (1 + NAME_LEN + 1 + NAME_LEN + 1)
@@ -168,13 +177,16 @@ class MDL_key
{
public:
/**
- Object namespaces
+ Object namespaces.
+ Sic: when adding a new member to this enum make sure to
+ update m_namespace_to_wait_state_name array in mdl.cc!
Different types of objects exist in different namespaces
- TABLE is for tables and views.
- FUNCTION is for stored functions.
- PROCEDURE is for stored procedures.
- TRIGGER is for triggers.
+ - EVENT is for event scheduler events
Note that although there isn't metadata locking on triggers,
it's necessary to have a separate namespace for them since
MDL_key is also used outside of the MDL subsystem.
@@ -185,6 +197,8 @@ public:
FUNCTION,
PROCEDURE,
TRIGGER,
+ EVENT,
+ COMMIT,
/* This should be the last ! */
NAMESPACE_END };
@@ -239,7 +253,7 @@ public:
character set is utf-8, we can safely assume that no
character starts with a zero byte.
*/
- return memcmp(m_ptr, rhs->m_ptr, min(m_length, rhs->m_length)+1);
+ return memcmp(m_ptr, rhs->m_ptr, min(m_length, rhs->m_length));
}
MDL_key(const MDL_key *rhs)
@@ -273,21 +287,6 @@ private:
};
-
-/**
- Hook class which via its methods specifies which members
- of T should be used for participating in MDL lists.
-*/
-
-template <typename T, T* T::*next, T** T::*prev>
-struct I_P_List_adapter
-{
- static inline T **next_ptr(T *el) { return &(el->*next); }
-
- static inline T ***prev_ptr(T *el) { return &(el->*prev); }
-};
-
-
/**
A pending metadata lock request.
@@ -306,6 +305,8 @@ class MDL_request
public:
/** Type of metadata lock. */
enum enum_mdl_type type;
+ /** Duration for requested lock. */
+ enum enum_mdl_duration duration;
/**
Pointers for participating in the list of lock requests for this context.
@@ -328,17 +329,16 @@ public:
void init(MDL_key::enum_mdl_namespace namespace_arg,
const char *db_arg, const char *name_arg,
- enum_mdl_type mdl_type_arg);
- void init(const MDL_key *key_arg, enum_mdl_type mdl_type_arg);
+ enum_mdl_type mdl_type_arg,
+ enum_mdl_duration mdl_duration_arg);
+ void init(const MDL_key *key_arg, enum_mdl_type mdl_type_arg,
+ enum_mdl_duration mdl_duration_arg);
/** Set type of lock request. Can be only applied to pending locks. */
inline void set_type(enum_mdl_type type_arg)
{
DBUG_ASSERT(ticket == NULL);
type= type_arg;
}
- static MDL_request *create(MDL_key::enum_mdl_namespace mdl_namespace,
- const char *db, const char *name,
- enum_mdl_type mdl_type, MEM_ROOT *root);
/*
This is to work around the ugliness of TABLE_LIST
@@ -364,6 +364,7 @@ public:
MDL_request(const MDL_request *rhs)
:type(rhs->type),
+ duration(rhs->duration),
ticket(NULL),
key(&rhs->key)
{}
@@ -386,10 +387,7 @@ public:
virtual bool inspect_edge(MDL_context *dest) = 0;
virtual ~MDL_wait_for_graph_visitor();
- MDL_wait_for_graph_visitor() :m_lock_open_count(0),
- m_current_search_depth(0)
- { }
- virtual void abort_traversal(MDL_context *node) = 0;
+ MDL_wait_for_graph_visitor() :m_lock_open_count(0) {}
public:
/**
XXX, hack: During deadlock search, we may need to
@@ -400,17 +398,6 @@ public:
LOCK_open since it has significant performance impacts.
*/
uint m_lock_open_count;
- /**
- Set to the 0 at start. Increased whenever
- we descend into another MDL context (aka traverse to the next
- wait-for graph node). When MAX_SEARCH_DEPTH is reached, we
- assume that a deadlock is found, even if we have not found a
- loop.
-
- XXX: This member belongs to this class only temporarily until
- bug #56405 is fixed.
- */
- uint m_current_search_depth;
};
/**
@@ -499,17 +486,35 @@ public:
private:
friend class MDL_context;
- MDL_ticket(MDL_context *ctx_arg, enum_mdl_type type_arg)
+ MDL_ticket(MDL_context *ctx_arg, enum_mdl_type type_arg
+#ifndef DBUG_OFF
+ , enum_mdl_duration duration_arg
+#endif
+ )
: m_type(type_arg),
+#ifndef DBUG_OFF
+ m_duration(duration_arg),
+#endif
m_ctx(ctx_arg),
m_lock(NULL)
{}
- static MDL_ticket *create(MDL_context *ctx_arg, enum_mdl_type type_arg);
+ static MDL_ticket *create(MDL_context *ctx_arg, enum_mdl_type type_arg
+#ifndef DBUG_OFF
+ , enum_mdl_duration duration_arg
+#endif
+ );
static void destroy(MDL_ticket *ticket);
private:
/** Type of metadata lock. Externally accessible. */
enum enum_mdl_type m_type;
+#ifndef DBUG_OFF
+ /**
+ Duration of lock represented by this ticket.
+ Context private. Debug-only.
+ */
+ enum_mdl_duration m_duration;
+#endif
/**
Context of the owner of the metadata lock ticket. Externally accessible.
*/
@@ -527,6 +532,39 @@ private:
/**
+ Savepoint for MDL context.
+
+ Doesn't include metadata locks with explicit duration as
+ they are not released during rollback to savepoint.
+*/
+
+class MDL_savepoint
+{
+public:
+ MDL_savepoint() {};
+
+private:
+ MDL_savepoint(MDL_ticket *stmt_ticket, MDL_ticket *trans_ticket)
+ : m_stmt_ticket(stmt_ticket), m_trans_ticket(trans_ticket)
+ {}
+
+ friend class MDL_context;
+
+private:
+ /**
+ Pointer to last lock with statement duration which was taken
+ before creation of savepoint.
+ */
+ MDL_ticket *m_stmt_ticket;
+ /**
+ Pointer to last lock with transaction duration which was taken
+ before creation of savepoint.
+ */
+ MDL_ticket *m_trans_ticket;
+};
+
+
+/**
A reliable way to wait on an MDL lock.
*/
@@ -574,9 +612,7 @@ public:
typedef I_P_List<MDL_ticket,
I_P_List_adapter<MDL_ticket,
&MDL_ticket::next_in_context,
- &MDL_ticket::prev_in_context>,
- I_P_List_null_counter,
- I_P_List_fast_push_back<MDL_ticket> >
+ &MDL_ticket::prev_in_context> >
Ticket_list;
typedef Ticket_list::Iterator Ticket_iterator;
@@ -599,37 +635,28 @@ public:
const char *db, const char *name,
enum_mdl_type mdl_type);
- bool has_lock(MDL_ticket *mdl_savepoint, MDL_ticket *mdl_ticket);
+ bool has_lock(const MDL_savepoint &mdl_savepoint, MDL_ticket *mdl_ticket);
inline bool has_locks() const
{
- return !m_tickets.is_empty();
+ return !(m_tickets[MDL_STATEMENT].is_empty() &&
+ m_tickets[MDL_TRANSACTION].is_empty() &&
+ m_tickets[MDL_EXPLICIT].is_empty());
}
- MDL_ticket *mdl_savepoint()
+ MDL_savepoint mdl_savepoint()
{
- /*
- NULL savepoint represents the start of the transaction.
- Checking for m_trans_sentinel also makes sure we never
- return a pointer to HANDLER ticket as a savepoint.
- */
- return m_tickets.front() == m_trans_sentinel ? NULL : m_tickets.front();
+ return MDL_savepoint(m_tickets[MDL_STATEMENT].front(),
+ m_tickets[MDL_TRANSACTION].front());
}
- void set_trans_sentinel()
- {
- m_trans_sentinel= m_tickets.front();
- }
- MDL_ticket *trans_sentinel() const { return m_trans_sentinel; }
-
- void reset_trans_sentinel(MDL_ticket *sentinel_arg)
- {
- m_trans_sentinel= sentinel_arg;
- }
- void move_ticket_after_trans_sentinel(MDL_ticket *mdl_ticket);
+ void set_explicit_duration_for_all_locks();
+ void set_transaction_duration_for_all_locks();
+ void set_lock_duration(MDL_ticket *mdl_ticket, enum_mdl_duration duration);
+ void release_statement_locks();
void release_transactional_locks();
- void rollback_to_savepoint(MDL_ticket *mdl_savepoint);
+ void rollback_to_savepoint(const MDL_savepoint &mdl_savepoint);
inline THD *get_thd() const { return m_thd; }
@@ -670,46 +697,43 @@ public:
MDL_wait m_wait;
private:
/**
- All MDL tickets acquired by this connection.
-
- The order of tickets in m_tickets list.
- ---------------------------------------
- The entire set of locks acquired by a connection
- can be separated in two subsets: transactional and
- non-transactional locks.
-
- Transactional locks are locks with automatic scope. They
- are accumulated in the course of a transaction, and
- released only on COMMIT, ROLLBACK or ROLLBACK TO SAVEPOINT.
- They must not be (and never are) released manually,
+ Lists of all MDL tickets acquired by this connection.
+
+ Lists of MDL tickets:
+ ---------------------
+ The entire set of locks acquired by a connection can be separated
+ in three subsets according to their: locks released at the end of
+ statement, at the end of transaction and locks are released
+ explicitly.
+
+ Statement and transactional locks are locks with automatic scope.
+ They are accumulated in the course of a transaction, and released
+ either at the end of uppermost statement (for statement locks) or
+ on COMMIT, ROLLBACK or ROLLBACK TO SAVEPOINT (for transactional
+ locks). They must not be (and never are) released manually,
i.e. with release_lock() call.
- Non-transactional locks are taken for locks that span
+ Locks with explicit duration are taken for locks that span
multiple transactions or savepoints.
These are: HANDLER SQL locks (HANDLER SQL is
transaction-agnostic), LOCK TABLES locks (you can COMMIT/etc
under LOCK TABLES, and the locked tables stay locked), and
- SET GLOBAL READ_ONLY=1 global shared lock.
+ locks implementing "global read lock".
- Transactional locks are always prepended to the beginning
- of the list. In other words, they are stored in reverse
- temporal order. Thus, when we rollback to a savepoint,
- we start popping and releasing tickets from the front
- until we reach the last ticket acquired after the
- savepoint.
+ Statement/transactional locks are always prepended to the
+ beginning of the appropriate list. In other words, they are
+ stored in reverse temporal order. Thus, when we rollback to
+ a savepoint, we start popping and releasing tickets from the
+ front until we reach the last ticket acquired after the savepoint.
- Non-transactional locks are always stored after
- transactional ones, and among each other can be
- split into three sets:
+ Locks with explicit duration stored are not stored in any
+ particular order, and among each other can be split into
+ three sets:
[LOCK TABLES locks] [HANDLER locks] [GLOBAL READ LOCK locks]
The following is known about these sets:
- * we can never have both HANDLER and LOCK TABLES locks
- together -- HANDLER statements are prohibited under LOCK
- TABLES, entering LOCK TABLES implicitly closes all open
- HANDLERs.
* GLOBAL READ LOCK locks are always stored after LOCK TABLES
locks and after HANDLER locks. This is because one can't say
SET GLOBAL read_only=1 or FLUSH TABLES WITH READ LOCK
@@ -724,14 +748,9 @@ private:
However, one can open a few HANDLERs after entering the
read only mode.
* LOCK TABLES locks include intention exclusive locks on
- involved schemas.
- */
- Ticket_list m_tickets;
- /**
- Separates transactional and non-transactional locks
- in m_tickets list, @sa m_tickets.
+ involved schemas and global intention exclusive lock.
*/
- MDL_ticket *m_trans_sentinel;
+ Ticket_list m_tickets[MDL_DURATION_END];
THD *m_thd;
/**
TRUE - if for this context we will break protocol and try to
@@ -762,8 +781,9 @@ private:
MDL_wait_for_subgraph *m_waiting_for;
private:
MDL_ticket *find_ticket(MDL_request *mdl_req,
- bool *is_transactional);
- void release_locks_stored_before(MDL_ticket *sentinel);
+ enum_mdl_duration *duration);
+ void release_locks_stored_before(enum_mdl_duration duration, MDL_ticket *sentinel);
+ void release_lock(enum_mdl_duration duration, MDL_ticket *ticket);
bool try_acquire_lock_impl(MDL_request *mdl_request,
MDL_ticket **out_ticket);
diff --git a/sql/message.h b/sql/message.h
index 97d039352b4..102d38091e7 100644
--- a/sql/message.h
+++ b/sql/message.h
@@ -1,5 +1,19 @@
#ifndef MESSAGE_INCLUDED
#define MESSAGE_INCLUDED
+/* Copyright 2008 Sun Microsystems, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
To change or add messages mysqld writes to the Windows error log, run
diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc
index 72505054902..318cdfd10c4 100644
--- a/sql/my_decimal.cc
+++ b/sql/my_decimal.cc
@@ -13,6 +13,7 @@
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 "sql_priv.h"
#include <time.h>
@@ -98,10 +99,11 @@ int my_decimal2string(uint mask, const my_decimal *d,
UNSIGNED. Hence the buffer for a ZEROFILLed value is the length
the user requested, plus one for a possible decimal point, plus
one if the user only wanted decimal places, but we force a leading
- zero on them. Because the type is implicitly UNSIGNED, we do not
- need to reserve a character for the sign. For all other cases,
- fixed_prec will be 0, and my_decimal_string_length() will be called
- instead to calculate the required size of the buffer.
+ zero on them, plus one for the '\0' terminator. Because the type
+ is implicitly UNSIGNED, we do not need to reserve a character for
+ the sign. For all other cases, fixed_prec will be 0, and
+ my_decimal_string_length() will be called instead to calculate the
+ required size of the buffer.
*/
int length= (fixed_prec
? (fixed_prec + ((fixed_prec == fixed_dec) ? 1 : 0) + 1)
@@ -331,7 +333,7 @@ print_decimal_buff(const my_decimal *dec, const uchar* ptr, int length)
const char *dbug_decimal_as_string(char *buff, const my_decimal *val)
{
- int length= DECIMAL_MAX_STR_LENGTH;
+ int length= DECIMAL_MAX_STR_LENGTH + 1; /* minimum size for buff */
if (!val)
return "NULL";
(void)decimal2string((decimal_t*) val, buff, &length, 0,0,0);
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index 330ded0c272..f566cbe6f26 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2006 MySQL AB
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -62,7 +62,7 @@ typedef struct st_mysql_time MYSQL_TIME;
/**
maximum length of string representation (number of maximum decimal
- digits + 1 position for sign + 1 position for decimal point)
+ digits + 1 position for sign + 1 position for decimal point, no terminator)
*/
#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_POSSIBLE_PRECISION + 2)
@@ -102,6 +102,24 @@ class my_decimal :public decimal_t
public:
+ my_decimal(const my_decimal &rhs) : decimal_t(rhs)
+ {
+ for (uint i= 0; i < DECIMAL_BUFF_LENGTH; i++)
+ buffer[i]= rhs.buffer[i];
+ fix_buffer_pointer();
+ }
+
+ my_decimal& operator=(const my_decimal &rhs)
+ {
+ if (this == &rhs)
+ return *this;
+ decimal_t::operator=(rhs);
+ for (uint i= 0; i < DECIMAL_BUFF_LENGTH; i++)
+ buffer[i]= rhs.buffer[i];
+ fix_buffer_pointer();
+ return *this;
+ }
+
void init()
{
len= DECIMAL_BUFF_LENGTH;
@@ -160,7 +178,7 @@ void max_my_decimal(my_decimal *to, int precision, int frac)
{
DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION)&&
(frac <= DECIMAL_MAX_SCALE));
- max_decimal(precision, frac, (decimal_t*) to);
+ max_decimal(precision, frac, to);
}
inline void max_internal_decimal(my_decimal *to)
@@ -225,6 +243,7 @@ inline uint32 my_decimal_precision_to_length(uint precision, uint8 scale,
inline
int my_decimal_string_length(const my_decimal *d)
{
+ /* length of string representation including terminating '\0' */
return decimal_string_size(d);
}
@@ -248,7 +267,6 @@ inline
void my_decimal2decimal(const my_decimal *from, my_decimal *to)
{
*to= *from;
- to->fix_buffer_pointer();
}
@@ -260,14 +278,19 @@ inline
int binary2my_decimal(uint mask, const uchar *bin, my_decimal *d, int prec,
int scale)
{
- return check_result(mask, bin2decimal(bin, (decimal_t*) d, prec, scale));
+ return check_result(mask, bin2decimal(bin, d, prec, scale));
}
inline
int my_decimal_set_zero(my_decimal *d)
{
- decimal_make_zero(((decimal_t*) d));
+ /*
+ We need the up-cast here, since my_decimal has sign() member functions,
+ which conflicts with decimal_t::size
+ (and decimal_make_zero is a macro, rather than a funcion).
+ */
+ decimal_make_zero(static_cast<decimal_t*>(d));
return 0;
}
@@ -275,7 +298,7 @@ int my_decimal_set_zero(my_decimal *d)
inline
bool my_decimal_is_zero(const my_decimal *decimal_value)
{
- return decimal_is_zero((decimal_t*) decimal_value);
+ return decimal_is_zero(decimal_value);
}
@@ -283,7 +306,7 @@ inline
int my_decimal_round(uint mask, const my_decimal *from, int scale,
bool truncate, my_decimal *to)
{
- return check_result(mask, decimal_round((decimal_t*) from, to, scale,
+ return check_result(mask, decimal_round(from, to, scale,
(truncate ? TRUNCATE : HALF_UP)));
}
@@ -291,14 +314,14 @@ int my_decimal_round(uint mask, const my_decimal *from, int scale,
inline
int my_decimal_floor(uint mask, const my_decimal *from, my_decimal *to)
{
- return check_result(mask, decimal_round((decimal_t*) from, to, 0, FLOOR));
+ return check_result(mask, decimal_round(from, to, 0, FLOOR));
}
inline
int my_decimal_ceiling(uint mask, const my_decimal *from, my_decimal *to)
{
- return check_result(mask, decimal_round((decimal_t*) from, to, 0, CEILING));
+ return check_result(mask, decimal_round(from, to, 0, CEILING));
}
@@ -320,7 +343,7 @@ int my_decimal2int(uint mask, const my_decimal *d, my_bool unsigned_flag,
{
my_decimal rounded;
/* decimal_round can return only E_DEC_TRUNCATED */
- decimal_round((decimal_t*)d, &rounded, 0, HALF_UP);
+ decimal_round(d, &rounded, 0, HALF_UP);
return check_result(mask, (unsigned_flag ?
decimal2ulonglong(&rounded, (ulonglong *)l) :
decimal2longlong(&rounded, l)));
@@ -328,18 +351,17 @@ int my_decimal2int(uint mask, const my_decimal *d, my_bool unsigned_flag,
inline
-int my_decimal2double(uint mask, const my_decimal *d, double *result)
+int my_decimal2double(uint, const my_decimal *d, double *result)
{
/* No need to call check_result as this will always succeed */
- return decimal2double((decimal_t*) d, result);
+ return decimal2double(d, result);
}
inline
int str2my_decimal(uint mask, const char *str, my_decimal *d, char **end)
{
- return check_result_and_overflow(mask, string2decimal(str,(decimal_t*)d,end),
- d);
+ return check_result_and_overflow(mask, string2decimal(str, d, end), d);
}
@@ -362,7 +384,7 @@ my_decimal *date2my_decimal(MYSQL_TIME *ltime, my_decimal *dec);
inline
int double2my_decimal(uint mask, double val, my_decimal *d)
{
- return check_result_and_overflow(mask, double2decimal(val, (decimal_t*)d), d);
+ return check_result_and_overflow(mask, double2decimal(val, d), d);
}
@@ -392,7 +414,7 @@ int my_decimal_add(uint mask, my_decimal *res, const my_decimal *a,
const my_decimal *b)
{
return check_result_and_overflow(mask,
- decimal_add((decimal_t*)a,(decimal_t*)b,res),
+ decimal_add(a, b, res),
res);
}
@@ -402,7 +424,7 @@ int my_decimal_sub(uint mask, my_decimal *res, const my_decimal *a,
const my_decimal *b)
{
return check_result_and_overflow(mask,
- decimal_sub((decimal_t*)a,(decimal_t*)b,res),
+ decimal_sub(a, b, res),
res);
}
@@ -412,7 +434,7 @@ int my_decimal_mul(uint mask, my_decimal *res, const my_decimal *a,
const my_decimal *b)
{
return check_result_and_overflow(mask,
- decimal_mul((decimal_t*)a,(decimal_t*)b,res),
+ decimal_mul(a, b, res),
res);
}
@@ -422,8 +444,7 @@ int my_decimal_div(uint mask, my_decimal *res, const my_decimal *a,
const my_decimal *b, int div_scale_inc)
{
return check_result_and_overflow(mask,
- decimal_div((decimal_t*)a,(decimal_t*)b,res,
- div_scale_inc),
+ decimal_div(a, b, res, div_scale_inc),
res);
}
@@ -433,7 +454,7 @@ int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a,
const my_decimal *b)
{
return check_result_and_overflow(mask,
- decimal_mod((decimal_t*)a,(decimal_t*)b,res),
+ decimal_mod(a, b, res),
res);
}
@@ -445,14 +466,14 @@ int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a,
inline
int my_decimal_cmp(const my_decimal *a, const my_decimal *b)
{
- return decimal_cmp((decimal_t*) a, (decimal_t*) b);
+ return decimal_cmp(a, b);
}
inline
int my_decimal_intg(const my_decimal *a)
{
- return decimal_intg((decimal_t*) a);
+ return decimal_intg(a);
}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 5d581920a21..61f6c55bbdf 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
- 2009-2010 Monty Program Ab
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009-2011 Monty Program 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
@@ -62,6 +62,7 @@
#include "rpl_filter.h"
#include "client_settings.h"
#include "repl_failsafe.h"
+#include <sql_common.h>
#include <my_stacktrace.h>
#include "mysqld_suffix.h"
#include "mysys_err.h"
@@ -102,13 +103,6 @@
#define mysqld_charset &my_charset_latin1
-/* stack traces are only supported on linux intel */
-#if defined(__linux__) && defined(__i386__) && defined(USE_PSTACK)
-#define HAVE_STACK_TRACE_ON_SEGV
-#include "../pstack/pstack.h"
-char pstack_file_name[80];
-#endif /* __linux__ */
-
/* We have HAVE_valgrind below as this speeds up the shutdown of MySQL */
#if defined(HAVE_DEC_3_2_THREADS) || defined(SIGNALS_DONT_BREAK_READ) || defined(HAVE_valgrind) && defined(__linux__)
@@ -174,12 +168,12 @@ extern int memcntl(caddr_t, size_t, int, caddr_t, int, int);
int initgroups(const char *,unsigned int);
#endif
-#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H)
+#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H) && !defined(HAVE_FEDISABLEEXCEPT)
#include <ieeefp.h>
#ifdef HAVE_FP_EXCEPT // Fix type conflict
typedef fp_except fp_except_t;
#endif
-#endif /* __FreeBSD__ && HAVE_IEEEFP_H */
+#endif /* __FreeBSD__ && HAVE_IEEEFP_H && !HAVE_FEDISABLEEXCEPT */
#ifdef HAVE_SYS_FPU_H
/* for IRIX to use set_fpc_csr() */
#include <sys/fpu.h>
@@ -209,19 +203,24 @@ extern "C" my_bool reopen_fstreams(const char *filename,
inline void setup_fpu()
{
-#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H)
+#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H) && !defined(HAVE_FEDISABLEEXCEPT)
/* We can't handle floating point exceptions with threads, so disable
this on freebsd
- Don't fall for overflow, underflow,divide-by-zero or loss of precision
+ Don't fall for overflow, underflow,divide-by-zero or loss of precision.
+ fpsetmask() is deprecated in favor of fedisableexcept() in C99.
*/
-#if defined(__i386__)
+#if defined(FP_X_DNML)
fpsetmask(~(FP_X_INV | FP_X_DNML | FP_X_OFL | FP_X_UFL | FP_X_DZ |
FP_X_IMP));
#else
fpsetmask(~(FP_X_INV | FP_X_OFL | FP_X_UFL | FP_X_DZ |
FP_X_IMP));
-#endif /* __i386__ */
-#endif /* __FreeBSD__ && HAVE_IEEEFP_H */
+#endif /* FP_X_DNML */
+#endif /* __FreeBSD__ && HAVE_IEEEFP_H && !HAVE_FEDISABLEEXCEPT */
+
+#ifdef HAVE_FEDISABLEEXCEPT
+ fedisableexcept(FE_ALL_EXCEPT);
+#endif
#ifdef HAVE_FESETROUND
/* Set FPU rounding mode to "round-to-nearest" */
@@ -260,11 +259,7 @@ inline void setup_fpu()
#define MYSQL_KILL_SIGNAL SIGTERM
-#ifdef HAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
-#include <sys/types.h>
-#else
#include <my_pthread.h> // For thr_setconcurency()
-#endif
#ifdef SOLARIS
extern "C" int gethostname(char *name, int namelen);
@@ -280,6 +275,8 @@ extern "C" sig_handler handle_segfault(int sig);
/* Constants */
+#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
+
const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"};
static const char *tc_heuristic_recover_names[]=
@@ -296,6 +293,7 @@ const char *first_keyword= "first", *binary_keyword= "BINARY";
const char *my_localhost= "localhost", *delayed_user= "DELAYED";
bool opt_large_files= sizeof(my_off_t) > 4;
+static my_bool opt_autocommit; ///< for --autocommit command-line option
/*
Used with --help for detailed option
@@ -336,8 +334,10 @@ static PSI_rwlock_key key_rwlock_openssl;
/* the default log output is log tables */
static bool lower_case_table_names_used= 0;
+static bool max_long_data_size_used= false;
static bool volatile select_thread_in_use, signal_thread_in_use;
-static bool volatile ready_to_exit;
+/* See Bug#56666 and Bug#56760 */;
+volatile bool ready_to_exit;
static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0;
static my_bool opt_short_log_format= 0;
static my_bool opt_sync= 0;
@@ -421,7 +421,8 @@ handlerton *heap_hton;
handlerton *myisam_hton;
handlerton *partition_hton;
-my_bool opt_readonly= 0, use_temp_pool, relay_log_purge;
+my_bool read_only= 0, opt_readonly= 0;
+my_bool use_temp_pool, relay_log_purge;
my_bool relay_log_recovery;
my_bool opt_sync_frm, opt_allow_suspicious_udfs;
my_bool opt_secure_auth= 0;
@@ -434,7 +435,7 @@ my_bool opt_super_large_pages= 0;
my_bool opt_myisam_use_mmap= 0;
uint opt_large_page_size= 0;
#if defined(ENABLED_DEBUG_SYNC)
-uint opt_debug_sync_timeout= 0;
+MYSQL_PLUGIN_IMPORT uint opt_debug_sync_timeout= 0;
#endif /* defined(ENABLED_DEBUG_SYNC) */
my_bool opt_old_style_user_limits= 0, trust_function_creators= 0;
/*
@@ -473,6 +474,8 @@ ulonglong slave_type_conversions_options;
ulong thread_cache_size=0;
ulong binlog_cache_size=0;
ulonglong max_binlog_cache_size=0;
+ulong binlog_stmt_cache_size=0;
+ulonglong max_binlog_stmt_cache_size=0;
ulong query_cache_size=0;
ulong refresh_version; /* Increments on each reload */
query_id_t global_query_id;
@@ -484,9 +487,17 @@ ulong delayed_insert_threads, delayed_insert_writes, delayed_rows_in_use;
ulong delayed_insert_errors,flush_time;
ulong specialflag=0;
ulong binlog_cache_use= 0, binlog_cache_disk_use= 0;
+ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0;
ulong max_connections, max_connect_errors;
ulong extra_max_connections;
ulonglong denied_connections;
+
+/*
+ Maximum length of parameter value which can be set through
+ mysql_send_long_data() call.
+*/
+ulong max_long_data_size;
+
/**
Limit of the total number of prepared statements in the server.
Is necessary to protect the server against out-of-memory attacks.
@@ -619,8 +630,7 @@ pthread_key(MEM_ROOT**,THR_MALLOC);
pthread_key(THD*, THR_THD);
mysql_mutex_t LOCK_thread_count;
mysql_mutex_t
- LOCK_status, LOCK_global_read_lock,
- LOCK_error_log, LOCK_uuid_generator,
+ LOCK_status, LOCK_error_log, LOCK_uuid_generator,
LOCK_delayed_insert, LOCK_delayed_status, LOCK_delayed_create,
LOCK_crypt,
LOCK_global_system_variables,
@@ -644,7 +654,6 @@ mysql_mutex_t LOCK_des_key_file;
mysql_rwlock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
mysql_rwlock_t LOCK_system_variables_hash;
mysql_cond_t COND_thread_count;
-mysql_cond_t COND_global_read_lock;
pthread_t signal_thread;
pthread_attr_t connection_attrib;
mysql_mutex_t LOCK_server_started;
@@ -665,9 +674,6 @@ char *opt_logname, *opt_slow_logname;
/* Static variables */
static bool kill_in_progress, segfaulted;
-#ifdef HAVE_STACK_TRACE_ON_SEGV
-static my_bool opt_do_pstack;
-#endif /* HAVE_STACK_TRACE_ON_SEGV */
static my_bool opt_bootstrap, opt_myisam_log;
static int cleanup_done;
static ulong opt_specialflag;
@@ -1161,7 +1167,7 @@ static void close_connections(void)
tmp->thread_id,
(tmp->main_security_ctx.user ?
tmp->main_security_ctx.user : ""));
- close_connection(tmp,0,0);
+ close_connection(tmp);
}
#endif
DBUG_PRINT("quit",("Unlocking LOCK_thread_count"));
@@ -1311,10 +1317,10 @@ static void __cdecl kill_server(int sig_ptr)
else
sql_print_error(ER_DEFAULT(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */
-#if defined(HAVE_SMEM) && defined(__WIN__)
+#ifdef HAVE_SMEM
/*
- Send event to smem_event_connect_request for aborting
- */
+ Send event to smem_event_connect_request for aborting
+ */
if (opt_enable_shared_memory)
{
if (!SetEvent(smem_event_connect_request))
@@ -1602,7 +1608,6 @@ static void clean_up_mutexes()
mysql_mutex_destroy(&LOCK_global_user_client_stats);
mysql_mutex_destroy(&LOCK_global_table_stats);
mysql_mutex_destroy(&LOCK_global_index_stats);
- Events::destroy_mutexes();
#ifdef HAVE_OPENSSL
mysql_mutex_destroy(&LOCK_des_key_file);
#ifndef HAVE_YASSL
@@ -1620,12 +1625,10 @@ static void clean_up_mutexes()
mysql_rwlock_destroy(&LOCK_sys_init_slave);
mysql_mutex_destroy(&LOCK_global_system_variables);
mysql_rwlock_destroy(&LOCK_system_variables_hash);
- mysql_mutex_destroy(&LOCK_global_read_lock);
mysql_mutex_destroy(&LOCK_uuid_generator);
mysql_mutex_destroy(&LOCK_prepared_stmt_count);
mysql_mutex_destroy(&LOCK_error_messages);
mysql_cond_destroy(&COND_thread_count);
- mysql_cond_destroy(&COND_global_read_lock);
mysql_cond_destroy(&COND_thread_cache);
mysql_cond_destroy(&COND_flush_thread_cache);
mysql_cond_destroy(&COND_manager);
@@ -2063,38 +2066,28 @@ static void network_init(void)
/**
Close a connection.
- @param thd Thread handle
- @param errcode Error code to print to console
- @param lock 1 if we have have to lock LOCK_thread_count
+ @param thd Thread handle.
+ @param sql_errno The error code to send before disconnect.
@note
For the connection that is doing shutdown, this is called twice
*/
-void close_connection(THD *thd, uint errcode, bool lock)
+void close_connection(THD *thd, uint sql_errno)
{
- st_vio *vio;
DBUG_ENTER("close_connection");
- DBUG_PRINT("enter",("fd: %s error: '%s'",
- thd->net.vio ? vio_description(thd->net.vio) :
- "(not connected)",
- errcode ? ER_DEFAULT(errcode) : ""));
- if (lock)
- mysql_mutex_lock(&LOCK_thread_count);
- thd->killed= THD::KILL_CONNECTION;
- if ((vio= thd->net.vio) != 0)
- {
- if (errcode)
- net_send_error(thd, errcode,
- ER_DEFAULT(errcode), NULL); /* purecov: inspected */
- vio_close(vio); /* vio is freed in delete thd */
- }
- if (lock)
- mysql_mutex_unlock(&LOCK_thread_count);
- MYSQL_CONNECTION_DONE((int) errcode, thd->thread_id);
+
+ if (sql_errno)
+ net_send_error(thd, sql_errno, ER_DEFAULT(sql_errno), NULL);
+
+ thd->disconnect();
+
+ MYSQL_CONNECTION_DONE((int) sql_errno, thd->thread_id);
+
if (MYSQL_CONNECTION_DONE_ENABLED())
{
sleep(0); /* Workaround to avoid tailcall optimisation */
}
+ MYSQL_AUDIT_NOTIFY_CONNECTION_DISCONNECT(thd, sql_errno);
DBUG_VOID_RETURN;
}
#endif /* EMBEDDED_LIBRARY */
@@ -2113,6 +2106,49 @@ extern "C" sig_handler end_mysqld_signal(int sig __attribute__((unused)))
/*
+ Cleanup THD object
+
+ SYNOPSIS
+ thd_cleanup()
+ thd Thread handler
+*/
+
+void thd_cleanup(THD *thd)
+{
+ thd->cleanup();
+}
+
+/*
+ Decrease number of connections
+
+ SYNOPSIS
+ dec_connection_count()
+*/
+
+void dec_connection_count()
+{
+ mysql_mutex_lock(&LOCK_connection_count);
+ (*thd->scheduler->connection_count)--;
+ mysql_mutex_unlock(&LOCK_connection_count);
+}
+
+
+/*
+ Delete the THD object and decrease number of threads
+
+ SYNOPSIS
+ delete_thd()
+ thd Thread handler
+*/
+
+void delete_thd(THD *thd)
+{
+ thread_count--;
+ delete thd;
+}
+
+
+/*
Unlink thd from global list of available connections and free thd
SYNOPSIS
@@ -2127,15 +2163,17 @@ void unlink_thd(THD *thd)
{
DBUG_ENTER("unlink_thd");
DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd));
- thd->cleanup();
-
- mysql_mutex_lock(&LOCK_connection_count);
- (*thd->scheduler->connection_count)--;
- mysql_mutex_unlock(&LOCK_connection_count);
+ thd_cleanup(thd);
+ dec_connection_count();
mysql_mutex_lock(&LOCK_thread_count);
- thread_count--;
- delete thd;
+ /*
+ Used by binlog_reset_master. It would be cleaner to use
+ DEBUG_SYNC here, but that's not possible because the THD's debug
+ sync feature has been shut down at this point.
+ */
+ DBUG_EXECUTE_IF("sleep_after_lock_thread_count_before_delete_thd", sleep(5););
+ delete_thd(thd);
DBUG_VOID_RETURN;
}
@@ -2535,7 +2573,7 @@ the thread stack. Please read http://dev.mysql.com/doc/mysql/en/linux.html\n\n",
if (!(test_flags & TEST_NO_STACKTRACE))
{
- fprintf(stderr, "thd: 0x%lx\n",(long) thd);
+ fprintf(stderr, "Thread pointer: 0x%lx\n", (long) thd);
fprintf(stderr, "Attempting backtrace. You can use the following "
"information to find out\nwhere mysqld died. If "
"you see no messages after this, something went\n"
@@ -2563,11 +2601,13 @@ the thread stack. Please read http://dev.mysql.com/doc/mysql/en/linux.html\n\n",
kreason= "KILLED_NO_VALUE";
break;
}
- fprintf(stderr, "Trying to get some variables.\n\
-Some pointers may be invalid and cause the dump to abort...\n");
- my_safe_print_str("thd->query", thd->query(), 1024);
- fprintf(stderr, "thd->thread_id=%lu\n", (ulong) thd->thread_id);
- fprintf(stderr, "thd->killed=%s\n", kreason);
+ fprintf(stderr, "\nTrying to get some variables.\n"
+ "Some pointers may be invalid and cause the dump to abort.\n");
+ fprintf(stderr, "Query (%p): ", thd->query());
+ my_safe_print_str(thd->query(), min(1024, thd->query_length()));
+ fprintf(stderr, "Connection ID (thread ID): %lu\n", (ulong) thd->thread_id);
+ fprintf(stderr, "Status: %s\n", kreason);
+ fputc('\n', stderr);
}
fprintf(stderr, "\
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains\n\
@@ -2789,14 +2829,6 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
if (!opt_bootstrap)
create_pid_file();
-#ifdef HAVE_STACK_TRACE_ON_SEGV
- if (opt_do_pstack)
- {
- sprintf(pstack_file_name,"mysqld-%lu-%%d-%%d.backtrace", (ulong)getpid());
- pstack_install_segv_action(pstack_file_name);
- }
-#endif /* HAVE_STACK_TRACE_ON_SEGV */
-
/*
signal to start_signal_handler that we are ready
This works by waiting for start_signal_handler to free mutex,
@@ -2861,7 +2893,7 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused)))
case SIGHUP:
if (!abort_loop)
{
- bool not_used;
+ int not_used;
mysql_print_status(); // Print some debug info
reload_acl_and_cache((THD*) 0,
(REFRESH_LOG | REFRESH_TABLES | REFRESH_FAST |
@@ -3005,6 +3037,19 @@ sizeof(load_default_groups)/sizeof(load_default_groups[0]);
#endif
+#ifndef EMBEDDED_LIBRARY
+static
+int
+check_enough_stack_size()
+{
+ uchar stack_top;
+
+ return check_stack_overrun(current_thd, STACK_MIN_SIZE,
+ &stack_top);
+}
+#endif
+
+
/**
Initialize one of the global date/time format variables.
@@ -3143,7 +3188,6 @@ SHOW_VAR com_status_vars[]= {
{"show_keys", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_KEYS]), SHOW_LONG_STATUS},
{"show_index_statistics", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_INDEX_STATS]), SHOW_LONG_STATUS},
{"show_master_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_MASTER_STAT]), SHOW_LONG_STATUS},
- {"show_new_master", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_NEW_MASTER]), SHOW_LONG_STATUS},
{"show_open_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_OPEN_TABLES]), SHOW_LONG_STATUS},
{"show_plugins", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PLUGINS]), SHOW_LONG_STATUS},
{"show_privileges", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PRIVILEGES]), SHOW_LONG_STATUS},
@@ -3210,12 +3254,6 @@ static int init_common_variables()
max_system_variables.pseudo_thread_id= (ulong)~0;
server_start_time= flush_status_time= my_time(0);
- /* TODO: remove this when my_time_t is 64 bit compatible */
- if (server_start_time >= (time_t) MY_TIME_T_MAX)
- {
- sql_print_error("This MySQL server doesn't support dates later then 2038");
- return 1;
- }
rpl_filter= new Rpl_filter;
binlog_filter= new Rpl_filter;
@@ -3246,6 +3284,18 @@ static int init_common_variables()
*/
global_system_variables.time_zone= my_tz_SYSTEM;
+#ifdef HAVE_PSI_INTERFACE
+ /*
+ Complete the mysql_bin_log initialization.
+ Instrumentation keys are known only after the performance schema initialization,
+ and can not be set in the MYSQL_BIN_LOG constructor (called before main()).
+ */
+ mysql_bin_log.set_psi_keys(key_BINLOG_LOCK_index,
+ key_BINLOG_update_cond,
+ key_file_binlog,
+ key_file_binlog_index);
+#endif
+
/*
Init mutexes for the global MYSQL_BIN_LOG objects.
As safe_mutex depends on what MY_INIT() does, we can't init the mutexes of
@@ -3254,6 +3304,13 @@ static int init_common_variables()
*/
mysql_bin_log.init_pthread_objects();
+ /* TODO: remove this when my_time_t is 64 bit compatible */
+ if (!IS_TIME_T_VALID_FOR_TIMESTAMP(server_start_time))
+ {
+ sql_print_error("This MySQL server doesn't support dates later then 2038");
+ return 1;
+ }
+
if (gethostname(glob_hostname,sizeof(glob_hostname)) < 0)
{
strmake(glob_hostname, STRING_WITH_LEN("localhost"));
@@ -3325,6 +3382,11 @@ static int init_common_variables()
return 1;
set_server_version();
+#ifndef EMBEDDED_LIBRARY
+ if (opt_help && !opt_verbose)
+ unireg_abort(0);
+#endif /*!EMBEDDED_LIBRARY*/
+
DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname,
server_version, SYSTEM_TYPE,MACHINE_TYPE));
@@ -3362,20 +3424,19 @@ static int init_common_variables()
desired page sizes.
*/
int nelem;
- int max_desired_page_size;
- int max_page_size;
+ size_t max_desired_page_size;
if (opt_super_large_pages)
- max_page_size= SUPER_LARGE_PAGESIZE;
+ max_desired_page_size= SUPER_LARGE_PAGESIZE;
else
- max_page_size= LARGE_PAGESIZE;
+ max_desired_page_size= LARGE_PAGESIZE;
nelem = getpagesizes(NULL, 0);
if (nelem > 0)
{
size_t *pagesize = (size_t *) malloc(sizeof(size_t) * nelem);
if (pagesize != NULL && getpagesizes(pagesize, nelem) > 0)
{
- size_t i, max_page_size= 0;
- for (i= 0; i < nelem; i++)
+ size_t max_page_size= 0;
+ for (int i= 0; i < nelem; i++)
{
if (pagesize[i] > max_page_size &&
pagesize[i] <= max_desired_page_size)
@@ -3462,12 +3523,16 @@ static int init_common_variables()
if (init_errmessage()) /* Read error messages from file */
return 1;
init_client_errs();
- mysql_library_init(never,never,never); /* for replication */
+ mysql_library_init(unused,unused,unused); /* for replication */
lex_init();
if (item_create_init())
return 1;
item_init();
- my_regex_init(&my_charset_latin1);
+#ifndef EMBEDDED_LIBRARY
+ my_regex_init(&my_charset_latin1, check_enough_stack_size);
+#else
+ my_regex_init(&my_charset_latin1, NULL);
+#endif
/*
Process a comma-separated character set list and choose
the first available character set. This is mostly for
@@ -3644,8 +3709,6 @@ static int init_thread_environment()
&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);
mysql_rwlock_init(key_rwlock_LOCK_system_variables_hash,
&LOCK_system_variables_hash);
- mysql_mutex_init(key_LOCK_global_read_lock,
- &LOCK_global_read_lock, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_LOCK_prepared_stmt_count,
&LOCK_prepared_stmt_count, MY_MUTEX_INIT_FAST);
mysql_mutex_init(key_LOCK_error_messages,
@@ -3681,7 +3744,6 @@ static int init_thread_environment()
mysql_rwlock_init(key_rwlock_LOCK_sys_init_slave, &LOCK_sys_init_slave);
mysql_rwlock_init(key_rwlock_LOCK_grant, &LOCK_grant);
mysql_cond_init(key_COND_thread_count, &COND_thread_count, NULL);
- mysql_cond_init(key_COND_global_read_lock, &COND_global_read_lock, NULL);
mysql_cond_init(key_COND_thread_cache, &COND_thread_cache, NULL);
mysql_cond_init(key_COND_flush_thread_cache, &COND_flush_thread_cache, NULL);
mysql_cond_init(key_COND_manager, &COND_manager, NULL);
@@ -3910,12 +3972,12 @@ static int init_server_components()
unireg_abort(1);
}
- /* initialize delegates for extension observers */
+ /*
+ initialize delegates for extension observers, errors have already
+ been reported in the function
+ */
if (delegates_init())
- {
- sql_print_error("Initialize extension delegates failed");
unireg_abort(1);
- }
/* need to configure logging before initializing storage engines */
if (opt_log_slave_updates && !opt_bin_log)
@@ -4349,16 +4411,21 @@ int mysqld_main(int argc, char **argv)
to be able to read defaults files and parse options.
*/
my_progname= argv[0];
- if (my_basic_init())
+#ifndef _WIN32
+ // For windows, my_init() is called from the win specific mysqld_main
+ if (my_init()) // init my_sys library & pthreads
{
- fprintf(stderr, "my_basic_init() failed.");
+ fprintf(stderr, "my_init() failed.");
return 1;
}
+#endif
orig_argc= argc;
orig_argv= argv;
+ my_getopt_use_args_separator= TRUE;
if (load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv))
return 1;
+ my_getopt_use_args_separator= FALSE;
defaults_argc= argc;
defaults_argv= argv;
remaining_argc= argc;
@@ -4450,11 +4517,10 @@ int mysqld_main(int argc, char **argv)
recreate objects which were initialised early,
so that they are instrumented as well.
*/
- my_thread_basic_global_reinit();
+ my_thread_global_reinit();
}
#endif /* HAVE_PSI_INTERFACE */
- my_init(); // init my_sys library & pthreads
init_error_log_mutex();
/* Initialize audit interface globals. Audit plugins are inited later. */
@@ -4770,10 +4836,15 @@ int mysqld_main(int argc, char **argv)
#if defined(__WIN__) && !defined(EMBEDDED_LIBRARY)
int mysql_service(void *p)
{
+ if (my_thread_init())
+ return 1;
+
if (use_opt_args)
win_main(opt_argc, opt_argv);
else
win_main(Service.my_argc, Service.my_argv);
+
+ my_thread_end();
return 0;
}
@@ -4873,6 +4944,12 @@ int mysqld_main(int argc, char **argv)
/* Must be initialized early for comparison of service name */
system_charset_info= &my_charset_utf8_general_ci;
+ if (my_init())
+ {
+ fprintf(stderr, "my_init() failed.");
+ return 1;
+ }
+
if (Service.GetOS()) /* true NT family */
{
char file_path[FN_REFLEN];
@@ -5022,6 +5099,14 @@ static bool read_init_file(char *file_name)
}
+/**
+ Increment number of created threads
+*/
+void inc_thread_created(void)
+{
+ thread_created++;
+}
+
#ifndef EMBEDDED_LIBRARY
/*
@@ -5087,10 +5172,10 @@ void create_thread_to_handle_connection(THD *thd)
statistic_increment(aborted_connects,&LOCK_status);
/* Can't use my_error() since store_globals has not been called. */
my_snprintf(error_message_buff, sizeof(error_message_buff),
- ER(ER_CANT_CREATE_THREAD), error);
+ ER_THD(thd, ER_CANT_CREATE_THREAD), error);
net_send_error(thd, ER_CANT_CREATE_THREAD, error_message_buff, NULL);
+ close_connection(thd);
mysql_mutex_lock(&LOCK_thread_count);
- close_connection(thd,0,0);
delete thd;
mysql_mutex_unlock(&LOCK_thread_count);
return;
@@ -5132,7 +5217,7 @@ static void create_new_thread(THD *thd)
mysql_mutex_unlock(&LOCK_connection_count);
DBUG_PRINT("error",("Too many connections"));
- close_connection(thd, ER_CON_COUNT_ERROR, 1);
+ close_connection(thd, ER_CON_COUNT_ERROR);
statistic_increment(denied_connections, &LOCK_status);
delete thd;
DBUG_VOID_RETURN;
@@ -5513,7 +5598,7 @@ pthread_handler_t handle_connections_namedpipes(void *arg)
if (!(thd->net.vio= vio_new_win32pipe(hConnectedPipe)) ||
my_net_init(&thd->net, thd->net.vio))
{
- close_connection(thd, ER_OUT_OF_RESOURCES, 1);
+ close_connection(thd, ER_OUT_OF_RESOURCES);
delete thd;
continue;
}
@@ -5708,7 +5793,7 @@ pthread_handler_t handle_connections_shared_memory(void *arg)
event_conn_closed)) ||
my_net_init(&thd->net, thd->net.vio))
{
- close_connection(thd, ER_OUT_OF_RESOURCES, 1);
+ close_connection(thd, ER_OUT_OF_RESOURCES);
errmsg= 0;
goto errorconn;
}
@@ -5801,6 +5886,13 @@ struct my_option my_long_options[]=
{"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},
+ /*
+ Because Sys_var_bit does not support command-line options, we need to
+ explicitely add one for --autocommit
+ */
+ {"autocommit", 0, "Set default value for autocommit (0 or 1)",
+ &opt_autocommit, &opt_autocommit, 0,
+ GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, NULL},
{"bind-address", OPT_BIND_ADDRESS, "IP address to bind to.",
&my_bind_addr_str, &my_bind_addr_str, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -5870,11 +5962,6 @@ struct my_option my_long_options[]=
&disconnect_slave_event_count, &disconnect_slave_event_count,
0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif /* HAVE_REPLICATION */
-#ifdef HAVE_STACK_TRACE_ON_SEGV
- {"enable-pstack", 0, "Print a symbolic stack trace on failure.",
- &opt_do_pstack, &opt_do_pstack, 0, GET_BOOL, NO_ARG, 0, 0,
- 0, 0, 0, 0},
-#endif /* HAVE_STACK_TRACE_ON_SEGV */
{"exit-info", 'T', "Used for debugging. Use at your own risk.", 0, 0, 0,
GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -6592,6 +6679,8 @@ SHOW_VAR status_vars[]= {
{"Access_denied_errors", (char*) offsetof(STATUS_VAR, access_denied_errors), SHOW_LONG_STATUS},
{"Binlog_cache_disk_use", (char*) &binlog_cache_disk_use, SHOW_LONG},
{"Binlog_cache_use", (char*) &binlog_cache_use, SHOW_LONG},
+ {"Binlog_stmt_cache_disk_use",(char*) &binlog_stmt_cache_disk_use, SHOW_LONG},
+ {"Binlog_stmt_cache_use", (char*) &binlog_stmt_cache_use, SHOW_LONG},
{"Busy_time", (char*) offsetof(STATUS_VAR, busy_time), SHOW_DOUBLE_STATUS},
{"Bytes_received", (char*) offsetof(STATUS_VAR, bytes_received), SHOW_LONGLONG_STATUS},
{"Bytes_sent", (char*) offsetof(STATUS_VAR, bytes_sent), SHOW_LONGLONG_STATUS},
@@ -6792,13 +6881,8 @@ static void usage(void)
if (!default_collation_name)
default_collation_name= (char*) default_charset_info->name;
print_version();
- puts("\
-Copyright (C) 2000-2008 MySQL AB, by Monty and others.\n\
-Copyright (C) 2008,2009 Sun Microsystems, Inc.\n\
-This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
-and you are welcome to modify and redistribute it under the GPL license\n\n\
-Starts the MySQL database server.\n");
-
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
+ puts("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.");
@@ -7325,6 +7409,10 @@ mysqld_get_one_option(int optid,
if (argument == NULL) /* no argument */
log_error_file_ptr= const_cast<char*>("");
break;
+ case OPT_MAX_LONG_DATA_SIZE:
+ max_long_data_size_used= true;
+ WARN_DEPRECATED(NULL, 5, 6, "--max_long_data_size", "'--max_allowed_packet'");
+ break;
}
return 0;
}
@@ -7440,6 +7528,14 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
opt_log_slow_slave_statements) &&
!opt_slow_log)
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 (global_system_variables.net_buffer_length >
+ global_system_variables.max_allowed_packet)
+ {
+ sql_print_warning("net_buffer_length (%lu) is set to be larger "
+ "than max_allowed_packet (%lu). Please rectify.",
+ global_system_variables.net_buffer_length,
+ global_system_variables.max_allowed_packet);
+ }
if (log_error_file_ptr != disabled_my_option)
opt_error_log= 1;
@@ -7478,10 +7574,12 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
else
global_system_variables.option_bits&= ~OPTION_BIG_SELECTS;
- if (global_system_variables.option_bits & OPTION_AUTOCOMMIT)
- global_system_variables.option_bits&= ~OPTION_NOT_AUTOCOMMIT;
- else
- global_system_variables.option_bits|= OPTION_NOT_AUTOCOMMIT;
+ // Synchronize @@global.autocommit on --autocommit
+ const ulonglong turn_bit_on= opt_autocommit ?
+ OPTION_AUTOCOMMIT : OPTION_NOT_AUTOCOMMIT;
+ global_system_variables.option_bits=
+ (global_system_variables.option_bits &
+ ~(OPTION_NOT_AUTOCOMMIT | OPTION_AUTOCOMMIT)) | turn_bit_on;
global_system_variables.sql_mode=
expand_sql_mode(global_system_variables.sql_mode);
@@ -7558,6 +7656,15 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
test(global_system_variables.optimizer_switch &
OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN);
+ opt_readonly= read_only;
+
+ /*
+ If max_long_data_size is not specified explicitly use
+ value of max_allowed_packet.
+ */
+ if (!max_long_data_size_used)
+ max_long_data_size= global_system_variables.max_allowed_packet;
+
return 0;
}
@@ -7876,8 +7983,8 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids,
key_delayed_insert_mutex, key_hash_filo_lock, key_LOCK_active_mi,
key_LOCK_connection_count, key_LOCK_crypt, key_LOCK_delayed_create,
key_LOCK_delayed_insert, key_LOCK_delayed_status, key_LOCK_error_log,
- key_LOCK_gdl, key_LOCK_global_read_lock, key_LOCK_global_system_variables,
- key_LOCK_manager,
+ key_LOCK_gdl, key_LOCK_global_system_variables,
+ key_LOCK_manager,
key_LOCK_prepared_stmt_count,
key_LOCK_rpl_status, key_LOCK_server_started, key_LOCK_status,
key_LOCK_system_variables_hash, key_LOCK_table_share, key_LOCK_thd_data,
@@ -7888,6 +7995,7 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids,
key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data,
key_LOCK_error_messages, key_LOG_INFO_lock, key_LOCK_thread_count,
key_PARTITION_LOCK_auto_inc;
+PSI_mutex_key key_RELAYLOG_LOCK_index;
PSI_mutex_key key_LOCK_stats,
key_LOCK_global_user_client_stats, key_LOCK_global_table_stats,
@@ -7908,6 +8016,7 @@ static PSI_mutex_info all_server_mutexes[]=
{ &key_BINLOG_LOCK_index, "MYSQL_BIN_LOG::LOCK_index", 0},
{ &key_BINLOG_LOCK_prep_xids, "MYSQL_BIN_LOG::LOCK_prep_xids", 0},
+ { &key_RELAYLOG_LOCK_index, "MYSQL_RELAY_LOG::LOCK_index", 0},
{ &key_delayed_insert_mutex, "Delayed_insert::mutex", 0},
{ &key_hash_filo_lock, "hash_filo::lock", 0},
{ &key_LOCK_active_mi, "LOCK_active_mi", PSI_FLAG_GLOBAL},
@@ -7918,7 +8027,6 @@ static PSI_mutex_info all_server_mutexes[]=
{ &key_LOCK_delayed_status, "LOCK_delayed_status", PSI_FLAG_GLOBAL},
{ &key_LOCK_error_log, "LOCK_error_log", PSI_FLAG_GLOBAL},
{ &key_LOCK_gdl, "LOCK_gdl", PSI_FLAG_GLOBAL},
- { &key_LOCK_global_read_lock, "LOCK_global_read_lock", PSI_FLAG_GLOBAL},
{ &key_LOCK_global_system_variables, "LOCK_global_system_variables", PSI_FLAG_GLOBAL},
{ &key_LOCK_manager, "LOCK_manager", PSI_FLAG_GLOBAL},
{ &key_LOCK_prepared_stmt_count, "LOCK_prepared_stmt_count", PSI_FLAG_GLOBAL},
@@ -7971,7 +8079,7 @@ PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool;
#endif /* HAVE_MMAP */
PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
- key_COND_cache_status_changed, key_COND_global_read_lock, key_COND_manager,
+ key_COND_cache_status_changed, key_COND_manager,
key_COND_rpl_status, key_COND_server_started,
key_delayed_insert_cond, key_delayed_insert_cond_client,
key_item_func_sleep_cond, key_master_info_data_cond,
@@ -7980,6 +8088,7 @@ PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
key_relay_log_info_start_cond, key_relay_log_info_stop_cond,
key_TABLE_SHARE_cond, key_user_level_lock_cond,
key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache;
+PSI_cond_key key_RELAYLOG_update_cond;
static PSI_cond_info all_server_conds[]=
{
@@ -7993,8 +8102,8 @@ static PSI_cond_info all_server_conds[]=
#endif /* HAVE_MMAP */
{ &key_BINLOG_COND_prep_xids, "MYSQL_BIN_LOG::COND_prep_xids", 0},
{ &key_BINLOG_update_cond, "MYSQL_BIN_LOG::update_cond", 0},
+ { &key_RELAYLOG_update_cond, "MYSQL_RELAY_LOG::update_cond", 0},
{ &key_COND_cache_status_changed, "Query_cache::COND_cache_status_changed", 0},
- { &key_COND_global_read_lock, "COND_global_read_lock", PSI_FLAG_GLOBAL},
{ &key_COND_manager, "COND_manager", PSI_FLAG_GLOBAL},
{ &key_COND_rpl_status, "COND_rpl_status", PSI_FLAG_GLOBAL},
{ &key_COND_server_started, "COND_server_started", PSI_FLAG_GLOBAL},
@@ -8053,9 +8162,11 @@ PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest,
key_file_dbopt, key_file_des_key_file, key_file_ERRMSG, key_select_to_file,
key_file_fileparser, key_file_frm, key_file_global_ddl_log, key_file_load,
key_file_loadfile, key_file_log_event_data, key_file_log_event_info,
- key_file_master_info, key_file_misc, key_file_MYSQL_LOG, key_file_partition,
+ key_file_master_info, key_file_misc, key_file_partition,
key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog,
key_file_trg, key_file_trn, key_file_init;
+PSI_file_key key_file_query_log, key_file_slow_log;
+PSI_file_key key_file_relaylog, key_file_relaylog_index;
static PSI_file_info all_server_files[]=
{
@@ -8064,6 +8175,8 @@ static PSI_file_info all_server_files[]=
#endif /* HAVE_MMAP */
{ &key_file_binlog, "binlog", 0},
{ &key_file_binlog_index, "binlog_index", 0},
+ { &key_file_relaylog, "relaylog", 0},
+ { &key_file_relaylog_index, "relaylog_index", 0},
{ &key_file_casetest, "casetest", 0},
{ &key_file_dbopt, "dbopt", 0},
{ &key_file_des_key_file, "des_key_file", 0},
@@ -8078,11 +8191,12 @@ static PSI_file_info all_server_files[]=
{ &key_file_log_event_info, "log_event_info", 0},
{ &key_file_master_info, "master_info", 0},
{ &key_file_misc, "misc", 0},
- { &key_file_MYSQL_LOG, "MYSQL_LOG", 0},
{ &key_file_partition, "partition", 0},
{ &key_file_pid, "pid", 0},
+ { &key_file_query_log, "query_log", 0},
{ &key_file_relay_log_info, "relay_log_info", 0},
{ &key_file_send_file, "send_file", 0},
+ { &key_file_slow_log, "slow_log", 0},
{ &key_file_tclog, "tclog", 0},
{ &key_file_trg, "trigger_name", 0},
{ &key_file_trn, "trigger", 0},
diff --git a/sql/mysqld.h b/sql/mysqld.h
index a4482b655ee..4ede06f09a6 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -54,7 +54,7 @@ typedef Bitmap<((MAX_INDEXES+7)/8*8)> key_map; /* Used for finding keys */
some places */
/* Function prototypes */
void kill_mysql(void);
-void close_connection(THD *thd, uint errcode, bool lock);
+void close_connection(THD *thd, uint sql_errno= 0);
void handle_connection_in_main_thread(THD *thd);
void create_thread_to_handle_connection(THD *thd);
void unlink_thd(THD *thd);
@@ -63,7 +63,7 @@ void flush_thread_cache();
void refresh_status(THD *thd);
bool is_secure_file_path(char *path);
-extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *system_charset_info;
+extern "C" MYSQL_PLUGIN_IMPORT CHARSET_INFO *system_charset_info;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *files_charset_info ;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *national_charset_info;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *table_alias_charset;
@@ -90,14 +90,15 @@ extern bool opt_ignore_builtin_innodb;
extern my_bool opt_character_set_client_handshake;
extern bool volatile abort_loop;
extern bool in_bootstrap;
-extern uint volatile thread_count, global_read_lock;
+extern uint volatile thread_count;
extern uint connection_count;
extern my_bool opt_safe_user_create;
extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap;
extern my_bool opt_slave_compressed_protocol, use_temp_pool;
extern ulong slave_exec_mode_options;
extern ulonglong slave_type_conversions_options;
-extern my_bool opt_readonly, lower_case_file_system;
+extern my_bool read_only, opt_readonly;
+extern my_bool 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;
@@ -115,6 +116,7 @@ extern char *default_storage_engine;
extern bool opt_endinfo, using_udf_functions;
extern my_bool locked_in_memory;
extern bool opt_using_transactions;
+extern ulong max_long_data_size;
extern ulong current_pid;
extern ulong expire_logs_days;
extern my_bool relay_log_recovery;
@@ -142,6 +144,7 @@ extern ulonglong keybuff_size;
extern ulonglong thd_startup_options;
extern ulong thread_id;
extern ulong binlog_cache_use, binlog_cache_disk_use;
+extern ulong binlog_stmt_cache_use, binlog_stmt_cache_disk_use;
extern ulong aborted_threads,aborted_connects;
extern ulong delayed_insert_timeout;
extern ulong delayed_insert_limit, delayed_queue_size;
@@ -161,14 +164,16 @@ extern uint slave_net_timeout;
extern uint max_user_connections;
extern ulong what_to_log,flush_time;
extern ulong max_prepared_stmt_count, prepared_stmt_count;
-extern ulong binlog_cache_size, open_files_limit;
-extern ulonglong max_binlog_cache_size;
+extern ulong open_files_limit;
+extern ulong binlog_cache_size, binlog_stmt_cache_size;
+extern ulonglong max_binlog_cache_size, max_binlog_stmt_cache_size;
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;
extern ulong back_log;
extern char language[FN_REFLEN];
-extern ulong server_id, concurrency;
+extern "C" MYSQL_PLUGIN_IMPORT ulong server_id;
+extern ulong concurrency;
extern time_t server_start_time, flush_status_time;
extern char *opt_mysql_tmpdir, mysql_charsets_dir[];
extern int mysql_unpacked_real_data_home_len;
@@ -189,8 +194,8 @@ extern handlerton *heap_hton;
extern const char *load_default_groups[];
extern struct my_option my_long_options[];
extern int mysqld_server_started;
-extern int orig_argc;
-extern char **orig_argv;
+extern "C" MYSQL_PLUGIN_IMPORT int orig_argc;
+extern "C" MYSQL_PLUGIN_IMPORT char **orig_argv;
extern pthread_attr_t connection_attrib;
extern MYSQL_FILE *bootstrap_file;
extern my_bool old_mode;
@@ -201,6 +206,10 @@ extern char err_shared_dir[];
extern TYPELIB thread_handling_typelib;
extern my_decimal decimal_zero;
+/*
+ THR_MALLOC is a key which will be used to set/get MEM_ROOT** for a thread,
+ using my_pthread_setspecific_ptr()/my_thread_getspecific_ptr().
+*/
extern pthread_key(MEM_ROOT**,THR_MALLOC);
#ifdef HAVE_PSI_INTERFACE
@@ -217,7 +226,7 @@ extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids,
key_delayed_insert_mutex, key_hash_filo_lock, key_LOCK_active_mi,
key_LOCK_connection_count, key_LOCK_crypt, key_LOCK_delayed_create,
key_LOCK_delayed_insert, key_LOCK_delayed_status, key_LOCK_error_log,
- key_LOCK_gdl, key_LOCK_global_read_lock, key_LOCK_global_system_variables,
+ key_LOCK_gdl, key_LOCK_global_system_variables,
key_LOCK_logger, key_LOCK_manager,
key_LOCK_prepared_stmt_count,
key_LOCK_rpl_status, key_LOCK_server_started, key_LOCK_status,
@@ -228,6 +237,7 @@ extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids,
key_relay_log_info_log_space_lock, key_relay_log_info_run_lock,
key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data,
key_LOCK_error_messages, key_LOCK_thread_count, key_PARTITION_LOCK_auto_inc;
+extern PSI_mutex_key key_RELAYLOG_LOCK_index;
extern PSI_mutex_key key_LOCK_stats,
key_LOCK_global_user_client_stats, key_LOCK_global_table_stats,
@@ -242,7 +252,7 @@ extern PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool;
#endif /* HAVE_MMAP */
extern PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
- key_COND_cache_status_changed, key_COND_global_read_lock, key_COND_manager,
+ key_COND_cache_status_changed, key_COND_manager,
key_COND_rpl_status, key_COND_server_started,
key_delayed_insert_cond, key_delayed_insert_cond_client,
key_item_func_sleep_cond, key_master_info_data_cond,
@@ -251,6 +261,7 @@ extern PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
key_relay_log_info_start_cond, key_relay_log_info_stop_cond,
key_TABLE_SHARE_cond, key_user_level_lock_cond,
key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache;
+extern PSI_cond_key key_RELAYLOG_update_cond;
extern PSI_thread_key key_thread_bootstrap, key_thread_delayed_insert,
key_thread_handle_manager, key_thread_kill_server, key_thread_main,
@@ -264,9 +275,11 @@ extern PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest,
key_file_dbopt, key_file_des_key_file, key_file_ERRMSG, key_select_to_file,
key_file_fileparser, key_file_frm, key_file_global_ddl_log, key_file_load,
key_file_loadfile, key_file_log_event_data, key_file_log_event_info,
- key_file_master_info, key_file_misc, key_file_MYSQL_LOG, key_file_partition,
+ key_file_master_info, key_file_misc, key_file_partition,
key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog,
key_file_trg, key_file_trn, key_file_init;
+extern PSI_file_key key_file_query_log, key_file_slow_log;
+extern PSI_file_key key_file_relaylog, key_file_relaylog_index;
void init_server_psi_keys();
#endif /* HAVE_PSI_INTERFACE */
@@ -296,7 +309,7 @@ extern uint mysql_real_data_home_len;
extern const char *mysql_real_data_home_ptr;
extern ulong thread_handling;
extern MYSQL_PLUGIN_IMPORT char *mysql_data_home;
-extern char server_version[SERVER_VERSION_LENGTH];
+extern "C" MYSQL_PLUGIN_IMPORT char server_version[SERVER_VERSION_LENGTH];
extern MYSQL_PLUGIN_IMPORT char mysql_real_data_home[];
extern char mysql_unpacked_real_data_home[];
extern MYSQL_PLUGIN_IMPORT struct system_variables global_system_variables;
@@ -314,7 +327,7 @@ extern mysql_mutex_t
LOCK_user_locks, LOCK_status,
LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator,
LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
- LOCK_slave_list, LOCK_active_mi, LOCK_manager, LOCK_global_read_lock,
+ LOCK_slave_list, LOCK_active_mi, LOCK_manager,
LOCK_global_system_variables, LOCK_user_conn,
LOCK_prepared_stmt_count, LOCK_error_messages, LOCK_connection_count;
extern MYSQL_PLUGIN_IMPORT mysql_mutex_t LOCK_thread_count;
@@ -327,7 +340,6 @@ extern mysql_rwlock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
extern mysql_rwlock_t LOCK_system_variables_hash;
extern mysql_cond_t COND_thread_count;
extern mysql_cond_t COND_manager;
-extern mysql_cond_t COND_global_read_lock;
extern int32 thread_running;
extern my_atomic_rwlock_t thread_running_lock;
@@ -387,21 +399,22 @@ enum options_mysqld
OPT_UPDATE_LOG,
OPT_WANT_CORE,
OPT_ENGINE_CONDITION_PUSHDOWN,
- OPT_LOG_ERROR
+ OPT_LOG_ERROR,
+ OPT_MAX_LONG_DATA_SIZE
};
#endif
/**
- Query type constants.
-
- QT_ORDINARY -- ordinary SQL query.
- QT_IS -- SQL query to be shown in INFORMATION_SCHEMA (in utf8 and without
- character set introducers).
+ Query type constants (usable as bitmap flags).
*/
enum enum_query_type
{
- QT_ORDINARY,
- QT_IS
+ /// Nothing specific, ordinary SQL query.
+ QT_ORDINARY= 0,
+ /// In utf8.
+ QT_TO_SYSTEM_CHARSET= (1 << 0),
+ /// Without character set introducers.
+ QT_WITHOUT_INTRODUCERS= (1 << 1)
};
/* query_id */
@@ -490,6 +503,10 @@ get_thread_running()
extern "C" THD *_current_thd_noinline();
#define _current_thd() _current_thd_noinline()
#else
+/*
+ THR_THD is a key which will be used to set/get THD* for a thread,
+ using my_pthread_setspecific_ptr()/my_thread_getspecific_ptr().
+*/
extern pthread_key(THD*, THR_THD);
inline THD *_current_thd(void)
{
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 5f7f0b25fc1..974bc122d14 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -157,17 +157,7 @@ my_bool net_realloc(NET *net, size_t length)
DBUG_ENTER("net_realloc");
DBUG_PRINT("enter",("length: %lu", (ulong) length));
- /*
- When compression is off, net->where_b is always 0.
- With compression turned on, net->where_b may indicate
- that we still have a piece of the previous logical
- packet in the buffer, unprocessed. Take it into account
- when checking that max_allowed_packet is not exceeded.
- This ensures that the client treats max_allowed_packet
- limit identically, regardless of compression being on
- or off.
- */
- if (length >= (net->max_packet_size + net->where_b))
+ if (length >= net->max_packet_size)
{
DBUG_PRINT("error", ("Packet too large. Max size: %lu",
net->max_packet_size));
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index ed39c632735..e0505e2d65c 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
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
@@ -1429,7 +1429,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
}
thd= head->in_use;
- if (!(file= head->file->clone(thd->mem_root)))
+ if (!(file= head->file->clone(head->s->normalized_path.str, thd->mem_root)))
{
/*
Manually set the error flag. Note: there seems to be quite a few
@@ -5813,6 +5813,7 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
*/
if (field->result_type() == STRING_RESULT &&
+ ((Field_str*) field)->match_collation_to_optimize_range() &&
value->result_type() == STRING_RESULT &&
key_part->image_type == Field::itRAW &&
((Field_str*)field)->charset() != conf_func->compare_collation() &&
@@ -8149,7 +8150,7 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_and_merge()
if (unique == NULL)
{
- DBUG_EXECUTE_IF("index_merge_may_not_create_a_Unique", abort(); );
+ DBUG_EXECUTE_IF("index_merge_may_not_create_a_Unique", DBUG_ABORT(); );
DBUG_EXECUTE_IF("only_one_Unique_may_be_created",
DBUG_SET("+d,index_merge_may_not_create_a_Unique"); );
@@ -11223,7 +11224,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::update_min_result()
min_functions_it->rewind();
while ((min_func= (*min_functions_it)++))
- min_func->reset();
+ min_func->reset_and_add();
}
@@ -11255,7 +11256,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::update_max_result()
max_functions_it->rewind();
while ((max_func= (*max_functions_it)++))
- max_func->reset();
+ max_func->reset_and_add();
}
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 585f655aeac..1340f0a5525 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -288,6 +288,7 @@ public:
virtual bool reverse_sorted() = 0;
virtual bool unique_key_range() { return false; }
+ virtual bool clustered_pk_range() { return false; }
/*
Request that this quick select produces sorted output. Not all quick
@@ -350,6 +351,13 @@ public:
*/
virtual bool is_keys_used(const MY_BITMAP *fields);
+ /**
+ Simple sanity check that the quick select has been set up
+ correctly. Function is overridden by quick selects that merge
+ indices.
+ */
+ virtual bool is_valid() { return index != MAX_KEY; };
+
/*
rowid of last row retrieved by this quick select. This is used only when
doing ROR-index_merge selects
@@ -595,6 +603,24 @@ public:
THD *thd;
int read_keys_and_merge();
+ bool clustered_pk_range() { return test(pk_quick_select); }
+
+ virtual bool is_valid()
+ {
+ List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
+ QUICK_RANGE_SELECT *quick;
+ bool valid= true;
+ while ((quick= it++))
+ {
+ if (!quick->is_valid())
+ {
+ valid= false;
+ break;
+ }
+ }
+ return valid;
+ }
+
/* used to get rows collected in Unique */
READ_RECORD read_record;
};
@@ -648,6 +674,22 @@ public:
*/
List<QUICK_RANGE_SELECT> quick_selects;
+ virtual bool is_valid()
+ {
+ List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
+ QUICK_RANGE_SELECT *quick;
+ bool valid= true;
+ while ((quick= it++))
+ {
+ if (!quick->is_valid())
+ {
+ valid= false;
+ break;
+ }
+ }
+ return valid;
+ }
+
/*
Merged quick select that uses Clustered PK, if there is one. This quick
select is not used for row retrieval, it is used for row retrieval.
@@ -699,6 +741,22 @@ public:
List<QUICK_SELECT_I> quick_selects; /* Merged quick selects */
+ virtual bool is_valid()
+ {
+ List_iterator_fast<QUICK_SELECT_I> it(quick_selects);
+ QUICK_SELECT_I *quick;
+ bool valid= true;
+ while ((quick= it++))
+ {
+ if (!quick->is_valid())
+ {
+ valid= false;
+ break;
+ }
+ }
+ return valid;
+ }
+
QUEUE queue; /* Priority queue for merge operation */
MEM_ROOT alloc; /* Memory pool for this and merged quick selects data. */
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index a4e626e90cd..38fc52c830d 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -83,7 +83,7 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
TODO: for PS, make the whole block execute only on the first execution
*/
Item_subselect *subselect;
- if (!thd->lex->view_prepare_mode && // (1)
+ if (!(thd->lex->context_analysis_only & CONTEXT_ANALYSIS_ONLY_VIEW) && // (1)
(subselect= select_lex->master_unit()->item)) // (2)
{
Item_in_subselect *in_subs= NULL;
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index d94777787fc..381dd1ab21c 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -212,6 +212,7 @@ static int get_index_max_value(TABLE *table, TABLE_REF *ref, uint range_fl)
/**
Substitutes constants for some COUNT(), MIN() and MAX() functions.
+ @param thd thread handler
@param tables list of leaves of join table tree
@param all_fields All fields to be returned
@param conds WHERE clause
@@ -229,9 +230,12 @@ static int get_index_max_value(TABLE *table, TABLE_REF *ref, uint range_fl)
HA_ERR_KEY_NOT_FOUND on impossible conditions
@retval
HA_ERR_... if a deadlock or a lock wait timeout happens, for example
+ @retval
+ ER_... e.g. ER_SUBQUERY_NO_1_ROW
*/
-int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
+int opt_sum_query(THD *thd,
+ TABLE_LIST *tables, List<Item> &all_fields, COND *conds)
{
List_iterator_fast<Item> it(all_fields);
int const_result= 1;
@@ -243,6 +247,8 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
Item *item;
int error;
+ DBUG_ENTER("opt_sum_query");
+
if (conds)
where_tables= conds->used_tables();
@@ -270,7 +276,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
WHERE t2.field IS NULL;
*/
if (tl->table->map & where_tables)
- return 0;
+ DBUG_RETURN(0);
}
else
used_tables|= tl->table->map;
@@ -297,7 +303,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
if(error)
{
tl->table->file->print_error(error, MYF(ME_FATALERROR));
- return error;
+ DBUG_RETURN(error);
}
count*= tl->table->file->stats.records;
}
@@ -389,10 +395,10 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
if (error)
{
if (error == HA_ERR_KEY_NOT_FOUND || error == HA_ERR_END_OF_FILE)
- return HA_ERR_KEY_NOT_FOUND; // No rows matching WHERE
+ DBUG_RETURN(HA_ERR_KEY_NOT_FOUND); // No rows matching WHERE
/* HA_ERR_LOCK_DEADLOCK or some other error */
table->file->print_error(error, MYF(0));
- return(error);
+ DBUG_RETURN(error);
}
removed_tables|= table->map;
}
@@ -423,7 +429,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
item_sum->aggregator_clear();
}
else
- item_sum->reset();
+ item_sum->reset_and_add();
item_sum->make_const();
recalc_const_item= 1;
break;
@@ -441,6 +447,10 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
const_result= 0;
}
}
+
+ if (thd->is_error())
+ DBUG_RETURN(thd->stmt_da->sql_errno());
+
/*
If we have a where clause, we can only ignore searching in the
tables if MIN/MAX optimisation replaced all used tables
@@ -450,7 +460,7 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
*/
if (removed_tables && used_tables != removed_tables)
const_result= 0; // We didn't remove all tables
- return const_result;
+ DBUG_RETURN(const_result);
}
@@ -736,6 +746,12 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo,
if (is_null || (is_null_safe_eq && args[1]->is_null()))
{
+ /*
+ If we have a non-nullable index, we cannot use it,
+ since set_null will be ignored, and we will compare uninitialized data.
+ */
+ if (!part->field->real_maybe_null())
+ DBUG_RETURN(false);
part->field->set_null();
*key_ptr= (uchar) 1;
}
@@ -806,8 +822,9 @@ static bool matching_cond(bool max_fl, TABLE_REF *ref, KEY *keyinfo,
@param[out] prefix_len Length of prefix for the search range
@note
- This function may set table->key_read to 1, which must be reset after
- index is used! (This can only happen when function returns 1)
+ This function may set field->table->key_read to true,
+ which must be reset after index is used!
+ (This can only happen when function returns 1)
@retval
0 Index can not be used to optimize MIN(field)/MAX(field)
@@ -822,7 +839,9 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
uint *range_fl, uint *prefix_len)
{
if (!(field->flags & PART_KEY_FLAG))
- return 0; // Not key field
+ return false; // Not key field
+
+ DBUG_ENTER("find_key_for_maxmin");
TABLE *table= field->table;
uint idx= 0;
@@ -847,7 +866,7 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
part++, jdx++, key_part_to_use= (key_part_to_use << 1) | 1)
{
if (!(table->file->index_flags(idx, jdx, 0) & HA_READ_ORDER))
- return 0;
+ DBUG_RETURN(false);
/* Check whether the index component is partial */
Field *part_field= table->field[part->fieldnr-1];
@@ -896,12 +915,12 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
*/
if (field->part_of_key.is_set(idx))
table->enable_keyread();
- return 1;
+ DBUG_RETURN(true);
}
}
}
}
- return 0;
+ DBUG_RETURN(false);
}
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 00c03806f77..baea5c2c086 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -742,7 +742,6 @@ bool partition_info::check_range_constants(THD *thd)
longlong part_range_value;
bool signed_flag= !part_expr->unsigned_flag;
- part_result_type= INT_RESULT;
range_int_array= (longlong*)sql_alloc(num_parts * sizeof(longlong));
if (unlikely(range_int_array == NULL))
{
@@ -917,7 +916,6 @@ bool partition_info::check_list_constants(THD *thd)
List_iterator<partition_element> list_func_it(partitions);
DBUG_ENTER("partition_info::check_list_constants");
- part_result_type= INT_RESULT;
num_list_values= 0;
/*
We begin by calculating the number of list values that have been
@@ -1608,6 +1606,52 @@ id_err:
return 1;
}
+
+/**
+ Check what kind of error to report
+
+ @param use_subpart_expr Use the subpart_expr instead of part_expr
+ @param part_str Name of partition to report error (or NULL)
+*/
+void partition_info::report_part_expr_error(bool use_subpart_expr)
+{
+ Item *expr= part_expr;
+ DBUG_ENTER("partition_info::report_part_expr_error");
+ if (use_subpart_expr)
+ expr= subpart_expr;
+
+ if (expr->type() == Item::FIELD_ITEM)
+ {
+ partition_type type= part_type;
+ bool list_of_fields= list_of_part_fields;
+ Item_field *item_field= (Item_field*) expr;
+ /*
+ The expression consists of a single field.
+ It must be of integer type unless KEY or COLUMNS partitioning.
+ */
+ if (use_subpart_expr)
+ {
+ type= subpart_type;
+ list_of_fields= list_of_subpart_fields;
+ }
+ if (!column_list &&
+ item_field->field &&
+ item_field->field->result_type() != INT_RESULT &&
+ !(type == HASH_PARTITION && list_of_fields))
+ {
+ my_error(ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD, MYF(0),
+ item_field->name);
+ DBUG_VOID_RETURN;
+ }
+ }
+ if (use_subpart_expr)
+ my_error(ER_PARTITION_FUNC_NOT_ALLOWED_ERROR, MYF(0), "SUBPARTITION");
+ else
+ my_error(ER_PARTITION_FUNC_NOT_ALLOWED_ERROR, MYF(0), "PARTITION");
+ DBUG_VOID_RETURN;
+}
+
+
/*
Create a new column value in current list with maxvalue
Called from parser
@@ -1891,7 +1935,7 @@ int partition_info::reorganize_into_single_field_col_val()
code.
SYNOPSIS
- fix_func_partition()
+ fix_partition_values()
thd Thread object
col_val Array of one value
part_elem The partition instance
@@ -1901,13 +1945,13 @@ int partition_info::reorganize_into_single_field_col_val()
TRUE Failure
FALSE Success
*/
-int partition_info::fix_func_partition(THD *thd,
- part_elem_value *val,
- partition_element *part_elem,
- uint part_id)
+int partition_info::fix_partition_values(THD *thd,
+ part_elem_value *val,
+ partition_element *part_elem,
+ uint part_id)
{
part_column_list_val *col_val= val->col_val_array;
- DBUG_ENTER("partition_info::fix_func_partition");
+ DBUG_ENTER("partition_info::fix_partition_values");
if (col_val->fixed)
{
@@ -1953,7 +1997,8 @@ int partition_info::fix_func_partition(THD *thd,
}
else if (item_expr->result_type() != INT_RESULT)
{
- my_error(ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR, MYF(0));
+ my_error(ER_VALUES_IS_NOT_INT_TYPE_ERROR, MYF(0),
+ part_elem->partition_name);
DBUG_RETURN(TRUE);
}
if (part_type == RANGE_PARTITION)
@@ -2168,7 +2213,7 @@ int partition_info::fix_parser_data(THD *thd)
}
else
{
- if (fix_func_partition(thd, val, part_elem, i))
+ if (fix_partition_values(thd, val, part_elem, i))
{
DBUG_RETURN(TRUE);
}
diff --git a/sql/partition_info.h b/sql/partition_info.h
index b196d0b59a2..6ae210d9574 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -166,7 +166,6 @@ public:
key_map some_fields_in_PF;
handlerton *default_engine_type;
- Item_result part_result_type;
partition_type part_type;
partition_type subpart_type;
@@ -226,7 +225,6 @@ public:
curr_part_elem(NULL), current_partition(NULL),
curr_list_object(0), num_columns(0),
default_engine_type(NULL),
- part_result_type(INT_RESULT),
part_type(NOT_A_PARTITION), subpart_type(NOT_A_PARTITION),
part_info_len(0),
part_func_len(0), subpart_func_len(0),
@@ -279,10 +277,10 @@ public:
void print_no_partition_found(TABLE *table);
void print_debug(const char *str, uint*);
Item* get_column_item(Item *item, Field *field);
- int fix_func_partition(THD *thd,
- part_elem_value *val,
- partition_element *part_elem,
- uint part_id);
+ int fix_partition_values(THD *thd,
+ part_elem_value *val,
+ partition_element *part_elem,
+ uint part_id);
bool fix_column_value_functions(THD *thd,
part_elem_value *val,
uint part_id);
@@ -299,6 +297,7 @@ public:
bool init_column_part();
bool add_column_list_value(THD *thd, Item *item);
void set_show_version_string(String *packet);
+ void report_part_expr_error(bool use_subpart_expr);
private:
static int list_part_cmp(const void* a, const void* b);
bool set_up_default_partitions(handler *file, HA_CREATE_INFO *info,
diff --git a/sql/password.c b/sql/password.c
index 0e2b454ff4d..1b3aa8f356d 100644
--- a/sql/password.c
+++ b/sql/password.c
@@ -176,21 +176,16 @@ void scramble_323(char *to, const char *message, const char *password)
}
-/*
- Check scrambled message
- Used in pre 4.1 password handling
- SYNOPSIS
- check_scramble_323()
- scrambled scrambled message to check.
- message original random message which was used for scrambling; must
- be exactly SCRAMBLED_LENGTH_323 bytes long and
- NULL-terminated.
- hash_pass password which should be used for scrambling
- All params are IN.
+/**
+ Check scrambled message. Used in pre 4.1 password handling.
- RETURN VALUE
- 0 - password correct
- !0 - password invalid
+ @param scrambled Scrambled message to check.
+ @param message Original random message which was used for scrambling.
+ @param hash_pass Password which should be used for scrambling.
+
+ @remark scrambled and message must be SCRAMBLED_LENGTH_323 bytes long.
+
+ @return FALSE if password is correct, TRUE otherwise.
*/
my_bool
@@ -199,9 +194,16 @@ check_scramble_323(const unsigned char *scrambled, const char *message,
{
struct my_rnd_struct rand_st;
ulong hash_message[2];
- uchar buff[16],*to,extra; /* Big enough for check */
+ /* Big enough for checks. */
+ uchar buff[16], scrambled_buff[SCRAMBLE_LENGTH_323 + 1];
+ uchar *to, extra;
const uchar *pos;
+ /* Ensure that the scrambled message is null-terminated. */
+ memcpy(scrambled_buff, scrambled, SCRAMBLE_LENGTH_323);
+ scrambled_buff[SCRAMBLE_LENGTH_323]= '\0';
+ scrambled= scrambled_buff;
+
hash_password(hash_message, message, SCRAMBLE_LENGTH_323);
my_rnd_init(&rand_st,hash_pass[0] ^ hash_message[0],
hash_pass[1] ^ hash_message[1]);
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 1b5eaafbe7f..0c68df91121 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011 Oracle and/or its affiliates. All rights reserved.
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
@@ -504,11 +504,11 @@ void Protocol::end_statement()
thd->stmt_da->get_sqlstate());
break;
case Diagnostics_area::DA_EOF:
- error= send_eof(thd->stmt_da->server_status(),
+ error= send_eof(thd->server_status,
thd->stmt_da->statement_warn_count());
break;
case Diagnostics_area::DA_OK:
- error= send_ok(thd->stmt_da->server_status(),
+ error= send_ok(thd->server_status,
thd->stmt_da->statement_warn_count(),
thd->stmt_da->affected_rows(),
thd->stmt_da->last_insert_id(),
@@ -541,9 +541,10 @@ bool Protocol::send_ok(uint server_status, uint statement_warn_count,
const char *message)
{
DBUG_ENTER("Protocol::send_ok");
-
- DBUG_RETURN(net_send_ok(thd, server_status, statement_warn_count,
- affected_rows, last_insert_id, message));
+ const bool retval=
+ net_send_ok(thd, server_status, statement_warn_count,
+ affected_rows, last_insert_id, message);
+ DBUG_RETURN(retval);
}
@@ -556,8 +557,8 @@ bool Protocol::send_ok(uint server_status, uint statement_warn_count,
bool Protocol::send_eof(uint server_status, uint statement_warn_count)
{
DBUG_ENTER("Protocol::send_eof");
-
- DBUG_RETURN(net_send_eof(thd, server_status, statement_warn_count));
+ const bool retval= net_send_eof(thd, server_status, statement_warn_count);
+ DBUG_RETURN(retval);
}
@@ -571,8 +572,8 @@ bool Protocol::send_error(uint sql_errno, const char *err_msg,
const char *sql_state)
{
DBUG_ENTER("Protocol::send_error");
-
- DBUG_RETURN(net_send_error_packet(thd, sql_errno, err_msg, sql_state));
+ const bool retval= net_send_error_packet(thd, sql_errno, err_msg, sql_state);
+ DBUG_RETURN(retval);
}
diff --git a/sql/records.cc b/sql/records.cc
index ed1edcaf487..5709eaf1df2 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -207,6 +207,15 @@ bool init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
if (select && my_b_inited(&select->file))
tempfile= &select->file;
+ else if (select && select->quick && select->quick->clustered_pk_range())
+ {
+ /*
+ In case of QUICK_INDEX_MERGE_SELECT with clustered pk range we have to
+ use its own access method(i.e QUICK_INDEX_MERGE_SELECT::get_next()) as
+ sort file does not contain rowids which satisfy clustered pk range.
+ */
+ tempfile= 0;
+ }
else
tempfile= table->sort.io_cache;
if (tempfile && my_b_inited(tempfile) &&
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 47eb2f7031d..bc710616a4c 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -41,7 +41,7 @@
#define SLAVE_ERRMSG_SIZE (FN_REFLEN+64)
-RPL_STATUS rpl_status=RPL_NULL;
+ulong rpl_status=RPL_NULL;
mysql_mutex_t LOCK_rpl_status;
mysql_cond_t COND_rpl_status;
HASH slave_list;
@@ -56,10 +56,6 @@ const char* rpl_status_type[]=
"RECOVERY_CAPTAIN","NULL",NullS
};
-static Slave_log_event* find_slave_event(IO_CACHE* log,
- const char* log_file_name,
- char* errmsg);
-
/*
All of the functions defined in this file which are not used (the ones to
handle failsafe) are not used; their code has not been updated for more than
@@ -68,7 +64,7 @@ static Slave_log_event* find_slave_event(IO_CACHE* log,
functions like register_slave()) are working.
*/
-void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status)
+void change_rpl_status(ulong from_status, ulong to_status)
{
mysql_mutex_lock(&LOCK_rpl_status);
if (rpl_status == from_status || rpl_status == RPL_ANY)
@@ -91,13 +87,6 @@ void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status)
}\
-static inline int cmp_master_pos(Slave_log_event* sev, LEX_MASTER_INFO* mi)
-{
- return cmp_master_pos(sev->master_log, sev->master_pos, mi->log_file_name,
- mi->pos);
-}
-
-
void unregister_slave(THD* thd, bool only_mine, bool need_mutex)
{
if (thd->server_id)
@@ -228,361 +217,6 @@ void end_slave_list()
}
}
-static int find_target_pos(LEX_MASTER_INFO *mi, IO_CACHE *log, char *errmsg)
-{
- my_off_t log_pos = (my_off_t) mi->pos;
- uint32 target_server_id = mi->server_id;
-
- for (;;)
- {
- Log_event* ev;
- if (!(ev= Log_event::read_log_event(log, (mysql_mutex_t*) 0, 0)))
- {
- if (log->error > 0)
- strmov(errmsg, "Binary log truncated in the middle of event");
- else if (log->error < 0)
- strmov(errmsg, "I/O error reading binary log");
- else
- strmov(errmsg, "Could not find target event in the binary log");
- return 1;
- }
-
- if (ev->log_pos >= log_pos && ev->server_id == target_server_id)
- {
- delete ev;
- mi->pos = my_b_tell(log);
- return 0;
- }
- delete ev;
- }
- /* Impossible */
-}
-
-/**
- @details
- Before 4.0.15 we had a member of THD called log_pos, it was meant for
- failsafe replication code in repl_failsafe.cc which is disabled until
- it is reworked. Event's log_pos used to be preserved through
- log-slave-updates to make code in repl_failsafe.cc work (this
- function, SHOW NEW MASTER); but on the other side it caused unexpected
- values in Exec_Master_Log_Pos in A->B->C replication setup,
- synchronization problems in master_pos_wait(), ... So we
- (Dmitri & Guilhem) removed it.
-
- So for now this function is broken.
-*/
-
-int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg)
-{
- LOG_INFO linfo;
- char last_log_name[FN_REFLEN];
- IO_CACHE log;
- File file = -1, last_file = -1;
- mysql_mutex_t *log_lock;
- const char* errmsg_p;
- Slave_log_event* sev = 0;
- my_off_t last_pos = 0;
- int error = 1;
- int cmp_res;
- LINT_INIT(cmp_res);
- DBUG_ENTER("translate_master");
-
- if (!mysql_bin_log.is_open())
- {
- strmov(errmsg,"Binary log is not open");
- DBUG_RETURN(1);
- }
-
- if (!server_id_supplied)
- {
- strmov(errmsg, "Misconfigured master - server id was not set");
- DBUG_RETURN(1);
- }
-
- if (mysql_bin_log.find_log_pos(&linfo, NullS, 1))
- {
- strmov(errmsg,"Could not find first log");
- DBUG_RETURN(1);
- }
- thd->current_linfo = &linfo;
-
- bzero((char*) &log,sizeof(log));
- log_lock = mysql_bin_log.get_log_lock();
- mysql_mutex_lock(log_lock);
-
- for (;;)
- {
- if ((file=open_binlog(&log, linfo.log_file_name, &errmsg_p)) < 0)
- {
- strmov(errmsg, errmsg_p);
- goto err;
- }
-
- if (!(sev = find_slave_event(&log, linfo.log_file_name, errmsg)))
- goto err;
-
- cmp_res = cmp_master_pos(sev, mi);
- delete sev;
-
- if (!cmp_res)
- {
- /* Copy basename */
- fn_format(mi->log_file_name, linfo.log_file_name, "","",1);
- mi->pos = my_b_tell(&log);
- goto mi_inited;
- }
- else if (cmp_res > 0)
- {
- if (!last_pos)
- {
- strmov(errmsg,
- "Slave event in first log points past the target position");
- goto err;
- }
- end_io_cache(&log);
- mysql_file_close(file, MYF(MY_WME));
- if (init_io_cache(&log, (file = last_file), IO_SIZE, READ_CACHE, 0, 0,
- MYF(MY_WME)))
- {
- errmsg[0] = 0;
- goto err;
- }
- break;
- }
-
- strmov(last_log_name, linfo.log_file_name);
- last_pos = my_b_tell(&log);
-
- switch (mysql_bin_log.find_next_log(&linfo, 1)) {
- case LOG_INFO_EOF:
- if (last_file >= 0)
- mysql_file_close(last_file, MYF(MY_WME));
- last_file = -1;
- goto found_log;
- case 0:
- break;
- default:
- strmov(errmsg, "Error reading log index");
- goto err;
- }
-
- end_io_cache(&log);
- if (last_file >= 0)
- mysql_file_close(last_file, MYF(MY_WME));
- last_file = file;
- }
-
-found_log:
- my_b_seek(&log, last_pos);
- if (find_target_pos(mi,&log,errmsg))
- goto err;
- fn_format(mi->log_file_name, last_log_name, "","",1); /* Copy basename */
-
-mi_inited:
- error = 0;
-err:
- mysql_mutex_unlock(log_lock);
- end_io_cache(&log);
- mysql_mutex_lock(&LOCK_thread_count);
- thd->current_linfo = 0;
- mysql_mutex_unlock(&LOCK_thread_count);
- if (file >= 0)
- mysql_file_close(file, MYF(MY_WME));
- if (last_file >= 0 && last_file != file)
- mysql_file_close(last_file, MYF(MY_WME));
-
- DBUG_RETURN(error);
-}
-
-
-/**
- Caller must delete result when done.
-*/
-
-static Slave_log_event* find_slave_event(IO_CACHE* log,
- const char* log_file_name,
- char* errmsg)
-{
- Log_event* ev;
- int i;
- bool slave_event_found = 0;
- LINT_INIT(ev);
-
- for (i = 0; i < 2; i++)
- {
- if (!(ev= Log_event::read_log_event(log, (mysql_mutex_t*)0, 0)))
- {
- my_snprintf(errmsg, SLAVE_ERRMSG_SIZE,
- "Error reading event in log '%s'",
- (char*)log_file_name);
- return 0;
- }
- if (ev->get_type_code() == SLAVE_EVENT)
- {
- slave_event_found = 1;
- break;
- }
- delete ev;
- }
- if (!slave_event_found)
- {
- my_snprintf(errmsg, SLAVE_ERRMSG_SIZE,
- "Could not find slave event in log '%s'",
- (char*)log_file_name);
- return 0;
- }
-
- return (Slave_log_event*)ev;
-}
-
-/**
- This function is broken now.
-
- @seealso translate_master()
-*/
-
-bool show_new_master(THD* thd)
-{
- Protocol *protocol= thd->protocol;
- DBUG_ENTER("show_new_master");
- List<Item> field_list;
- char errmsg[SLAVE_ERRMSG_SIZE];
- LEX_MASTER_INFO* lex_mi= &thd->lex->mi;
-
- errmsg[0]=0; // Safety
- if (translate_master(thd, lex_mi, errmsg))
- {
- if (errmsg[0])
- my_error(ER_ERROR_WHEN_EXECUTING_COMMAND, MYF(0),
- "SHOW NEW MASTER", errmsg);
- DBUG_RETURN(TRUE);
- }
- else
- {
- field_list.push_back(new Item_empty_string("Log_name", 20));
- field_list.push_back(new Item_return_int("Log_pos", 10,
- MYSQL_TYPE_LONGLONG));
- if (protocol->send_result_set_metadata(&field_list,
- Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
- DBUG_RETURN(TRUE);
- protocol->prepare_for_resend();
- protocol->store(lex_mi->log_file_name, &my_charset_bin);
- protocol->store((ulonglong) lex_mi->pos);
- if (protocol->write())
- DBUG_RETURN(TRUE);
- my_eof(thd);
- DBUG_RETURN(FALSE);
- }
-}
-
-/**
- Asks the master for the list of its other connected slaves.
-
- This is for failsafe replication:
- in order for failsafe replication to work, the servers involved in
- replication must know of each other. We accomplish this by having each
- slave report to the master how to reach it, and on connection, each
- slave receives information about where the other slaves are.
-
- @param mysql pre-existing connection to the master
- @param mi master info
-
- @note
- mi is used only to give detailed error messages which include the
- hostname/port of the master, the username used by the slave to connect to
- the master.
- If the user used by the slave to connect to the master does not have the
- REPLICATION SLAVE privilege, it will pop in this function because
- SHOW SLAVE HOSTS will fail on the master.
-
- @retval
- 1 error
- @retval
- 0 success
-*/
-
-int update_slave_list(MYSQL* mysql, Master_info* mi)
-{
- MYSQL_RES* res=0;
- MYSQL_ROW row;
- const char* error=0;
- bool have_auth_info;
- int port_ind;
- DBUG_ENTER("update_slave_list");
-
- if (mysql_real_query(mysql, STRING_WITH_LEN("SHOW SLAVE HOSTS")) ||
- !(res = mysql_store_result(mysql)))
- {
- error= mysql_error(mysql);
- goto err;
- }
-
- switch (mysql_num_fields(res)) {
- case 5:
- have_auth_info = 0;
- port_ind=2;
- break;
- case 7:
- have_auth_info = 1;
- port_ind=4;
- break;
- default:
- error= "the master returned an invalid number of fields for SHOW SLAVE \
-HOSTS";
- goto err;
- }
-
- mysql_mutex_lock(&LOCK_slave_list);
-
- while ((row= mysql_fetch_row(res)))
- {
- uint32 log_server_id;
- SLAVE_INFO* si, *old_si;
- log_server_id = atoi(row[0]);
- if ((old_si= (SLAVE_INFO*)my_hash_search(&slave_list,
- (uchar*)&log_server_id,4)))
- si = old_si;
- else
- {
- if (!(si = (SLAVE_INFO*)my_malloc(sizeof(SLAVE_INFO), MYF(MY_WME))))
- {
- error= "the slave is out of memory";
- mysql_mutex_unlock(&LOCK_slave_list);
- goto err;
- }
- si->server_id = log_server_id;
- if (my_hash_insert(&slave_list, (uchar*)si))
- {
- error= "the slave is out of memory";
- mysql_mutex_unlock(&LOCK_slave_list);
- goto err;
- }
- }
- strmake(si->host, row[1], sizeof(si->host)-1);
- si->port = atoi(row[port_ind]);
- si->rpl_recovery_rank = atoi(row[port_ind+1]);
- si->master_id = atoi(row[port_ind+2]);
- if (have_auth_info)
- {
- strmake(si->user, row[2], sizeof(si->user)-1);
- strmake(si->password, row[3], sizeof(si->password)-1);
- }
- }
- mysql_mutex_unlock(&LOCK_slave_list);
-
-err:
- if (res)
- mysql_free_result(res);
- if (error)
- {
- sql_print_error("While trying to obtain the list of slaves from the master "
- "'%s:%d', user '%s' got the following error: '%s'",
- mi->host, mi->port, mi->user, error);
- DBUG_RETURN(1);
- }
- DBUG_RETURN(0);
-}
-
/**
Execute a SHOW SLAVE HOSTS statement.
diff --git a/sql/repl_failsafe.h b/sql/repl_failsafe.h
index c6d00de47cb..2ba1f25c591 100644
--- a/sql/repl_failsafe.h
+++ b/sql/repl_failsafe.h
@@ -26,26 +26,19 @@ typedef enum {RPL_AUTH_MASTER=0,RPL_IDLE_SLAVE,RPL_ACTIVE_SLAVE,
RPL_LOST_SOLDIER,RPL_TROOP_SOLDIER,
RPL_RECOVERY_CAPTAIN,RPL_NULL /* inactive */,
RPL_ANY /* wild card used by change_rpl_status */ } RPL_STATUS;
-extern RPL_STATUS rpl_status;
+extern ulong rpl_status;
extern mysql_mutex_t LOCK_rpl_status;
extern mysql_cond_t COND_rpl_status;
extern TYPELIB rpl_role_typelib;
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);
+void change_rpl_status(ulong from_status, ulong to_status);
int find_recovery_captain(THD* thd, MYSQL* mysql);
-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);
-
-bool show_new_master(THD* thd);
bool show_slave_hosts(THD* thd);
-int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg);
void init_slave_list();
void end_slave_list();
int register_slave(THD* thd, uchar* packet, uint packet_length);
diff --git a/sql/rpl_handler.cc b/sql/rpl_handler.cc
index 9e59c4fe5fd..1b1b91c63e9 100644
--- a/sql/rpl_handler.cc
+++ b/sql/rpl_handler.cc
@@ -105,12 +105,20 @@ int delegates_init()
transaction_delegate= new (place_trans_mem) Trans_delegate;
if (!transaction_delegate->is_inited())
+ {
+ sql_print_error("Initialization of transaction delegates failed. "
+ "Please report a bug.");
return 1;
+ }
binlog_storage_delegate= new (place_storage_mem) Binlog_storage_delegate;
if (!binlog_storage_delegate->is_inited())
+ {
+ sql_print_error("Initialization binlog storage delegates failed. "
+ "Please report a bug.");
return 1;
+ }
#ifdef HAVE_REPLICATION
void *place_transmit_mem= transmit_mem.data;
@@ -119,16 +127,29 @@ int delegates_init()
binlog_transmit_delegate= new (place_transmit_mem) Binlog_transmit_delegate;
if (!binlog_transmit_delegate->is_inited())
+ {
+ sql_print_error("Initialization of binlog transmit delegates failed. "
+ "Please report a bug.");
return 1;
+ }
binlog_relay_io_delegate= new (place_relay_io_mem) Binlog_relay_IO_delegate;
if (!binlog_relay_io_delegate->is_inited())
+ {
+ sql_print_error("Initialization binlog relay IO delegates failed. "
+ "Please report a bug.");
return 1;
+ }
#endif
if (pthread_key_create(&RPL_TRANS_BINLOG_INFO, NULL))
+ {
+ sql_print_error("Error while creating pthread specific data key for replication. "
+ "Please report a bug.");
return 1;
+ }
+
return 0;
}
diff --git a/sql/rpl_handler.h b/sql/rpl_handler.h
index bf207e53e2d..9a181250efc 100644
--- a/sql/rpl_handler.h
+++ b/sql/rpl_handler.h
@@ -73,7 +73,10 @@ public:
while (info && info->observer != observer)
info= iter++;
if (info)
+ {
iter.remove();
+ delete info;
+ }
else
ret= TRUE;
unlock();
diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc
index 43f8ddbaf43..8f1f494b35a 100644
--- a/sql/rpl_injector.cc
+++ b/sql/rpl_injector.cc
@@ -238,8 +238,7 @@ int injector::record_incident(THD *thd, Incident incident)
Incident_log_event ev(thd, incident);
if (int error= mysql_bin_log.write(&ev))
return error;
- mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE);
- return 0;
+ return mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE);
}
int injector::record_incident(THD *thd, Incident incident, LEX_STRING const message)
@@ -247,6 +246,5 @@ int injector::record_incident(THD *thd, Incident incident, LEX_STRING const mess
Incident_log_event ev(thd, incident, message);
if (int error= mysql_bin_log.write(&ev))
return error;
- mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE);
- return 0;
+ return mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE);
}
diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc
index 8219f70727e..5a7984430ea 100644
--- a/sql/rpl_record.cc
+++ b/sql/rpl_record.cc
@@ -78,8 +78,6 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
unsigned int null_mask= 1U;
for ( ; (field= *p_field) ; p_field++)
{
- DBUG_PRINT("debug", ("null_mask=%d; null_ptr=%p; row_data=%p; null_byte_count=%d",
- null_mask, null_ptr, row_data, null_byte_count));
if (bitmap_is_set(cols, p_field - table->field))
{
my_ptrdiff_t offset;
@@ -110,6 +108,7 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
field->field_name, field->real_type(),
(ulong) old_pack_ptr, (ulong) pack_ptr,
(int) (pack_ptr - old_pack_ptr)));
+ DBUG_DUMP("packed_data", old_pack_ptr, pack_ptr - old_pack_ptr);
}
null_mask <<= 1;
@@ -186,8 +185,7 @@ int
unpack_row(Relay_log_info const *rli,
TABLE *table, uint const colcnt,
uchar const *const row_data, MY_BITMAP const *cols,
- uchar const **const row_end, ulong *const master_reclength,
- const bool abort_on_warning, const bool first_row)
+ uchar const **const row_end, ulong *const master_reclength)
{
DBUG_ENTER("unpack_row");
DBUG_ASSERT(row_data);
@@ -286,22 +284,9 @@ unpack_row(Relay_log_info const *rli,
}
else
{
- MYSQL_ERROR::enum_warning_level error_type=
- MYSQL_ERROR::WARN_LEVEL_NOTE;
- if (abort_on_warning && (table->file->has_transactions() ||
- first_row))
- {
- error = HA_ERR_ROWS_EVENT_APPLY;
- error_type= MYSQL_ERROR::WARN_LEVEL_ERROR;
- }
- else
- {
- f->set_default();
- error_type= MYSQL_ERROR::WARN_LEVEL_WARN;
- }
- push_warning_printf(current_thd, error_type,
- ER_BAD_NULL_ERROR,
- ER(ER_BAD_NULL_ERROR),
+ f->set_default();
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_BAD_NULL_ERROR, ER(ER_BAD_NULL_ERROR),
f->field_name);
}
}
@@ -380,8 +365,11 @@ unpack_row(Relay_log_info const *rli,
}
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);
+ if (!((null_bits & null_mask) && tabledef->maybe_null(i))) {
+ uint32 len= tabledef->calc_field_size(i, (uchar *) pack_ptr);
+ DBUG_DUMP("field_data", pack_ptr, len);
+ pack_ptr+= len;
+ }
null_mask <<= 1;
}
}
@@ -418,20 +406,13 @@ unpack_row(Relay_log_info const *rli,
@param skip Number of columns for which default/nullable check
should be skipped.
@param check Specifies if lack of default error needs checking.
- @param abort_on_warning
- Controls how to react on lack of a field's default.
- The parameter mimics the master side one for
- @c check_that_all_fields_are_given_values.
-
+
@returns 0 on success or a handler level error code
*/
-int prepare_record(TABLE *const table,
- const uint skip, const bool check,
- const bool abort_on_warning, const bool first_row)
+int prepare_record(TABLE *const table, const uint skip, const bool check)
{
DBUG_ENTER("prepare_record");
- int error= 0;
restore_record(table, s->default_values);
/*
@@ -454,28 +435,16 @@ int prepare_record(TABLE *const table,
if ((f->flags & NO_DEFAULT_VALUE_FLAG) &&
(f->real_type() != MYSQL_TYPE_ENUM))
{
-
- MYSQL_ERROR::enum_warning_level error_type=
- MYSQL_ERROR::WARN_LEVEL_NOTE;
- if (abort_on_warning && (table->file->has_transactions() ||
- first_row))
- {
- error= HA_ERR_ROWS_EVENT_APPLY;
- error_type= MYSQL_ERROR::WARN_LEVEL_ERROR;
- }
- else
- {
- f->set_default();
- error_type= MYSQL_ERROR::WARN_LEVEL_WARN;
- }
- push_warning_printf(current_thd, error_type,
+ f->set_default();
+ push_warning_printf(current_thd,
+ MYSQL_ERROR::WARN_LEVEL_WARN,
ER_NO_DEFAULT_FOR_FIELD,
ER(ER_NO_DEFAULT_FOR_FIELD),
f->field_name);
}
}
- DBUG_RETURN(error);
+ DBUG_RETURN(0);
}
#endif // HAVE_REPLICATION
diff --git a/sql/rpl_record.h b/sql/rpl_record.h
index 9b3829a435e..104d77738f1 100644
--- a/sql/rpl_record.h
+++ b/sql/rpl_record.h
@@ -32,13 +32,10 @@ size_t pack_row(TABLE* table, MY_BITMAP const* cols,
int unpack_row(Relay_log_info const *rli,
TABLE *table, uint const colcnt,
uchar const *const row_data, MY_BITMAP const *cols,
- uchar const **const row_end, ulong *const master_reclength,
- const bool abort_on_warning= TRUE, const bool first_row= TRUE);
+ uchar const **const row_end, ulong *const master_reclength);
// Fill table's record[0] with default values.
-int prepare_record(TABLE *const table, const uint skip, const bool check,
- const bool abort_on_warning= TRUE,
- const bool first_row= TRUE);
+int prepare_record(TABLE *const table, const uint skip, const bool check);
#endif
#endif
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 41550e96377..61cf39a3e86 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -26,6 +26,8 @@
#include "rpl_utility.h"
#include "transaction.h"
#include "sql_parse.h" // end_trans, ROLLBACK
+#include <mysql/plugin.h>
+#include <mysql/service_thd_wait.h>
static int count_relay_log_space(Relay_log_info* rli);
@@ -54,6 +56,13 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery)
{
DBUG_ENTER("Relay_log_info::Relay_log_info");
+#ifdef HAVE_PSI_INTERFACE
+ relay_log.set_psi_keys(key_RELAYLOG_LOCK_index,
+ key_RELAYLOG_update_cond,
+ key_file_relaylog,
+ key_file_relaylog_index);
+#endif
+
group_relay_log_name[0]= event_relay_log_name[0]=
group_master_log_name[0]= 0;
until_log_name[0]= ign_master_log_name_end[0]= 0;
@@ -356,7 +365,7 @@ static inline int add_relay_log(Relay_log_info* rli,LOG_INFO* linfo)
{
MY_STAT s;
DBUG_ENTER("add_relay_log");
- if (!mysql_file_stat(key_file_binlog,
+ if (!mysql_file_stat(key_file_relaylog,
linfo->log_file_name, &s, MYF(0)))
{
sql_print_error("log %s listed in the index, but failed to stat",
@@ -792,6 +801,7 @@ int Relay_log_info::wait_for_pos(THD* thd, String* log_name,
We are going to mysql_cond_(timed)wait(); if the SQL thread stops it
will wake us up.
*/
+ thd_wait_begin(thd, THD_WAIT_BINLOG);
if (timeout > 0)
{
/*
@@ -809,6 +819,7 @@ int Relay_log_info::wait_for_pos(THD* thd, String* log_name,
}
else
mysql_cond_wait(&data_cond, &data_lock);
+ thd_wait_end(thd);
DBUG_PRINT("info",("Got signal of master update or timed out"));
if (error == ETIMEDOUT || error == ETIME)
{
@@ -1247,6 +1258,16 @@ void Relay_log_info::clear_tables_to_lock()
tables_to_lock->m_tabledef.table_def::~table_def();
tables_to_lock->m_tabledef_valid= FALSE;
}
+
+ /*
+ If blob fields were used during conversion of field values
+ from the master table into the slave table, then we need to
+ free the memory used temporarily to store their values before
+ copying into the slave's table.
+ */
+ if (tables_to_lock->m_conv_table)
+ free_blobs(tables_to_lock->m_conv_table);
+
tables_to_lock=
static_cast<RPL_TABLE_LIST*>(tables_to_lock->next_global);
tables_to_lock_count--;
@@ -1274,6 +1295,9 @@ void Relay_log_info::slave_close_thread_tables(THD *thd)
*/
if (! thd->in_multi_stmt_transaction_mode())
thd->mdl_context.release_transactional_locks();
+ else
+ thd->mdl_context.release_statement_locks();
+
clear_tables_to_lock();
}
#endif
diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h
index c3cfe1cf4a9..681832a4c36 100644
--- a/sql/rpl_rli.h
+++ b/sql/rpl_rli.h
@@ -97,6 +97,16 @@ public:
*/
MYSQL_BIN_LOG relay_log;
LOG_INFO linfo;
+
+ /*
+ cur_log
+ Pointer that either points at relay_log.get_log_file() or
+ &rli->cache_buf, depending on whether the log is hot or there was
+ the need to open a cold relay_log.
+
+ cache_buf
+ IO_CACHE used when opening cold relay logs.
+ */
IO_CACHE cache_buf,*cur_log;
/*
diff --git a/sql/scheduler.cc b/sql/scheduler.cc
index a9146682da6..b1083083c38 100644
--- a/sql/scheduler.cc
+++ b/sql/scheduler.cc
@@ -46,18 +46,32 @@ static bool no_threads_end(THD *thd, bool put_in_cache)
*/
/**@{*/
-static void scheduler_wait_begin(void) {
+extern "C"
+{
+static void scheduler_wait_lock_begin(void) {
+ THD *thd=current_thd;
+ scheduler_functions *func= thd->scheduler;
+ MYSQL_CALLBACK(func, thd_wait_begin, (thd, THD_WAIT_ROW_TABLE_LOCK));
+}
+
+static void scheduler_wait_lock_end(void) {
THD *thd=current_thd;
scheduler_functions *func= thd->scheduler;
- MYSQL_CALLBACK(func,
- thd_wait_begin, (thd, THD_WAIT_ROW_TABLE_LOCK));
+ MYSQL_CALLBACK(func, thd_wait_end, (thd));
+}
+
+static void scheduler_wait_sync_begin(void) {
+ THD *thd=current_thd;
+ scheduler_functions *func= thd->scheduler;
+ MYSQL_CALLBACK(func, thd_wait_begin, (thd, THD_WAIT_TABLE_LOCK));
}
-static void scheduler_wait_end(void) {
+static void scheduler_wait_sync_end(void) {
THD *thd=current_thd;
scheduler_functions *func= thd->scheduler;
MYSQL_CALLBACK(func, thd_wait_end, (thd));
}
+};
/**@}*/
/**
@@ -68,7 +82,10 @@ static void scheduler_wait_end(void) {
mysqld.cc, so this init function will always be called.
*/
static void scheduler_init() {
- thr_set_lock_wait_callback(scheduler_wait_begin, scheduler_wait_end);
+ thr_set_lock_wait_callback(scheduler_wait_lock_begin,
+ scheduler_wait_lock_end);
+ thr_set_sync_wait_callback(scheduler_wait_sync_begin,
+ scheduler_wait_sync_end);
}
/*
@@ -119,10 +136,6 @@ void one_thread_scheduler(scheduler_functions *func)
thd_scheduler::thd_scheduler()
: m_psi(NULL), logged_in(FALSE), io_event(NULL), thread_attached(FALSE)
{
-#ifndef DBUG_OFF
- dbug_explain[0]= '\0';
- set_explain= FALSE;
-#endif
}
diff --git a/sql/scheduler.h b/sql/scheduler.h
index cb7568b566a..247c98515ac 100644
--- a/sql/scheduler.h
+++ b/sql/scheduler.h
@@ -58,6 +58,13 @@ struct scheduler_functions
*/
enum scheduler_types
{
+ /*
+ The default of --thread-handling is the first one in the
+ thread_handling_names array, this array has to be consistent with
+ the order in this array, so to change default one has to change
+ the first entry in this enum and the first entry in the
+ thread_handling_names array.
+ */
SCHEDULER_ONE_THREAD_PER_CONNECTION=0,
SCHEDULER_NO_THREADS,
SCHEDULER_TYPES_COUNT
@@ -67,11 +74,6 @@ void one_thread_per_connection_scheduler(scheduler_functions *func,
ulong *arg_max_connections, uint *arg_connection_count);
void one_thread_scheduler(scheduler_functions *func);
-enum pool_command_op
-{
- NOT_IN_USE_OP= 0, NORMAL_OP= 1, CONNECT_OP, KILL_OP, DIE_OP
-};
-
#if defined(HAVE_LIBEVENT) && !defined(EMBEDDED_LIBRARY)
#define HAVE_POOL_OF_THREADS 1
@@ -98,11 +100,6 @@ public:
LIST list;
bool thread_attached; /* Indicates if THD is attached to the OS thread */
-# ifndef DBUG_OFF
- char dbug_explain[512];
- bool set_explain;
-# endif
-
thd_scheduler();
~thd_scheduler();
bool init(THD* parent_thd);
@@ -122,4 +119,11 @@ class thd_scheduler
#endif
+void *thd_get_scheduler_data(THD *thd);
+void thd_set_scheduler_data(THD *thd, void *data);
+PSI_thread* thd_get_psi(THD *thd);
+void thd_set_psi(THD *thd, PSI_thread *psi);
+
+extern scheduler_functions *thread_scheduler;
+
#endif
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 34b66dea319..8e48e0213f0 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
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
@@ -117,7 +117,8 @@ void sys_var_end()
sys_var constructor
@param chain variables are linked into chain for mysql_add_sys_var_chain()
- @param name_arg the name of the variable. @sa my_option::name
+ @param name_arg the name of the variable. Must be 0-terminated and exist
+ for the liftime of the sys_var object. @sa my_option::name
@param comment shown in mysqld --help, @sa my_option::comment
@param flags_arg or'ed flag_enum values
@param off offset of the global variable value from the
@@ -164,8 +165,8 @@ sys_var::sys_var(sys_var_chain *chain, const char *name_arg,
*/
DBUG_ASSERT(parse_flag == PARSE_NORMAL || getopt_id <= 0 || getopt_id >= 255);
- name.str= name_arg;
- name.length= strlen(name_arg);
+ name.str= name_arg; // ER_NO_DEFAULT relies on 0-termination of name_arg
+ name.length= strlen(name_arg); // and so does this.
DBUG_ASSERT(name.length <= NAME_CHAR_LEN);
bzero(&option, sizeof(option));
@@ -746,9 +747,9 @@ int set_var_password::check(THD *thd)
}
if (!user->user.str)
{
- DBUG_ASSERT(thd->security_ctx->priv_user);
- user->user.str= (char *) thd->security_ctx->priv_user;
- user->user.length= strlen(thd->security_ctx->priv_user);
+ DBUG_ASSERT(thd->security_ctx->user);
+ user->user.str= (char *) thd->security_ctx->user;
+ user->user.length= strlen(thd->security_ctx->user);
}
/* Returns 1 as the function sends error to client */
return check_change_password(thd, user->host.str, user->user.str,
@@ -776,7 +777,7 @@ int set_var_password::update(THD *thd)
int set_var_collation_client::check(THD *thd)
{
/* Currently, UCS-2 cannot be used as a client character set */
- if (character_set_client->mbminlen > 1)
+ if (!is_supported_parser_charset(character_set_client))
{
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "character_set_client",
character_set_client->csname);
diff --git a/sql/set_var.h b/sql/set_var.h
index 17792a689d2..acfc1d54aa4 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -1,6 +1,6 @@
#ifndef SET_VAR_INCLUDED
#define SET_VAR_INCLUDED
-/* Copyright (C) 2000-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/sql/share/Makefile.am b/sql/share/Makefile.am
deleted file mode 100644
index 73f2ca13bb6..00000000000
--- a/sql/share/Makefile.am
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright (C) 2000 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
-
-## Process this file with automake to create Makefile.in
-
-EXTRA_DIST= errmsg-utf8.txt \
- CMakeLists.txt
-
-dist-hook:
- for dir in charsets @AVAILABLE_LANGUAGES@; do \
- test -d $(distdir)/$$dir || mkdir $(distdir)/$$dir; \
- $(INSTALL_DATA) $(srcdir)/$$dir/*.* $(distdir)/$$dir; \
- done; \
- sleep 1 ; touch $(srcdir)/*/errmsg.sys
- $(INSTALL_DATA) $(srcdir)/charsets/README $(distdir)/charsets
- $(INSTALL_DATA) $(srcdir)/charsets/Index.xml $(distdir)/charsets
-
-all-local: english/errmsg.sys
-
-# Use the english errmsg.sys as a flag that all errmsg.sys needs to be
-# created. Normally these are created by extra/Makefile
-
-english/errmsg.sys: errmsg-utf8.txt
- rm -f $(top_builddir)/include/mysqld_error.h
- (cd $(top_builddir)/extra && $(MAKE))
-
-install-data-local:
- for lang in @AVAILABLE_LANGUAGES@; \
- do \
- $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$$lang; \
- $(INSTALL_DATA) $(srcdir)/$$lang/errmsg.sys \
- $(DESTDIR)$(pkgdatadir)/$$lang/errmsg.sys; \
- done
- $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/charsets
- $(INSTALL_DATA) $(srcdir)/errmsg-utf8.txt \
- $(DESTDIR)$(pkgdatadir)/errmsg-utf8.txt; \
- $(INSTALL_DATA) $(srcdir)/charsets/README $(DESTDIR)$(pkgdatadir)/charsets/README
- $(INSTALL_DATA) $(srcdir)/charsets/*.xml $(DESTDIR)$(pkgdatadir)/charsets
-
-# FIXME maybe shouldn't remove, could be needed by other installation?
-uninstall-local:
- @RM@ -f -r $(DESTDIR)$(pkgdatadir)
-
-distclean-local:
- @RM@ -f */errmsg.sys
-
-# Do nothing
-link_sources:
diff --git a/sql/share/charsets/cp1251.xml b/sql/share/charsets/cp1251.xml
index b80db9f8ec0..06ba8a5a4b9 100644
--- a/sql/share/charsets/cp1251.xml
+++ b/sql/share/charsets/cp1251.xml
@@ -98,7 +98,7 @@
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 007F
- 0402 0403 201A 0453 201E 2026 2020 2021 0000 2030 0409 2039 040A 040C 040B 040F
+ 0402 0403 201A 0453 201E 2026 2020 2021 20AC 2030 0409 2039 040A 040C 040B 040F
0452 2018 2019 201C 201D 2022 2013 2014 0000 2122 0459 203A 045A 045C 045B 045F
00A0 040E 045E 0408 00A4 0490 00A6 00A7 0401 00A9 0404 00AB 00AC 00AD 00AE 0407
00B0 00B1 0406 0456 0491 00B5 00B6 00B7 0451 2116 0454 00BB 0458 0405 0455 0457
diff --git a/sql/share/charsets/languages.html b/sql/share/charsets/languages.html
index 6d1a8aafc5c..76af973113e 100644
--- a/sql/share/charsets/languages.html
+++ b/sql/share/charsets/languages.html
@@ -1,4 +1,20 @@
#!/bin/sh
+
+# 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
+
#<pre>
(
echo "DROP TABLE lang;"
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 06f8ca5e507..c86451b89e9 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -897,7 +897,7 @@ ER_OUT_OF_SORTMEMORY HY001 S1001
cze "M-Bálo paměti pro třídění. Zvyšte velikost třídícího bufferu"
dan "Ikke mere sorteringshukommelse. Øg sorteringshukommelse (sort buffer size) for serveren"
nla "Geen geheugen om te sorteren. Verhoog de server sort buffer size"
- eng "Out of sort memory; increase server sort buffer size"
+ eng "Out of sort memory, consider increasing server sort buffer size"
jps "Out of sort memory. sort buffer size ãŒè¶³ã‚Šãªã„よã†ã§ã™.",
est "Mälu sai sorteerimisel otsa. Suurenda MySQL-i sorteerimispuhvrit"
fre "Manque de mémoire pour le tri. Augmentez-la."
@@ -907,10 +907,10 @@ ER_OUT_OF_SORTMEMORY HY001 S1001
ita "Memoria per gli ordinamenti esaurita. Incrementare il 'sort_buffer' al demone"
jpn "Out of sort memory. sort buffer size ãŒè¶³ã‚Šãªã„よã†ã§ã™."
kor "Out of sort memory. daemon sort bufferì˜ í¬ê¸°ë¥¼ ì¦ê°€ì‹œí‚¤ì„¸ìš”"
- nor "Ikke mer sorteringsminne. Øk sorteringsminnet (sort buffer size) for tjenesten"
- norwegian-ny "Ikkje meir sorteringsminne. Auk sorteringsminnet (sorteringsbffer storleik) for tenesten"
+ nor "Ikke mer sorteringsminne. Vurder å øke sorteringsminnet (sort buffer size) for tjenesten"
+ norwegian-ny "Ikkje meir sorteringsminne. Vurder å auke sorteringsminnet (sorteringsbuffer storleik) for tenesten"
pol "Zbyt mało pamięci dla sortowania. Zwiększ wielko?ć bufora demona dla sortowania"
- por "Sem memória para ordenação. Aumente tamanho do 'buffer' de ordenação"
+ por "Não há memória suficiente para ordenação. Considere aumentar o tamanho do retentor (buffer) de ordenação."
rum "Out of memory pentru sortare. Largeste marimea buffer-ului pentru sortare in daemon (sort buffer size)"
rus "ÐедоÑтаточно памÑти Ð´Ð»Ñ Ñортировки. Увеличьте размер буфера Ñортировки на Ñервере"
serbian "Nema memorije za sortiranje. Povećajte veliÄinu sort buffer-a MySQL server-u"
@@ -6152,7 +6152,7 @@ ER_WARN_ENGINE_TRANSACTION_ROLLBACK
ER_SLAVE_HEARTBEAT_FAILURE
eng "Unexpected master's heartbeat data: %s"
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE
- eng "The requested value for the heartbeat period %s %s"
+ eng "The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%s seconds)."
ER_NDB_REPLICATION_SCHEMA_ERROR
eng "Bad schema for mysql.ndb_replication table. Message: %-.64s"
@@ -6347,6 +6347,74 @@ ER_FAILED_READ_FROM_PAR_FILE
eng "Failed to read from the .par file"
swe "Misslyckades läsa från .par filen"
+ER_VALUES_IS_NOT_INT_TYPE_ERROR
+ eng "VALUES value for partition '%-.64s' must have type INT"
+ swe "Värden i VALUES för partition '%-.64s' måste ha typen INT"
+
+ER_ACCESS_DENIED_NO_PASSWORD_ERROR 28000
+ cze "P-Břístup pro uživatele '%-.48s'@'%-.64s'"
+ dan "Adgang nægtet bruger: '%-.48s'@'%-.64s'"
+ nla "Toegang geweigerd voor gebruiker: '%-.48s'@'%-.64s'"
+ eng "Access denied for user '%-.48s'@'%-.64s'"
+ est "Ligipääs keelatud kasutajale '%-.48s'@'%-.64s'"
+ fre "Accès refusé pour l'utilisateur: '%-.48s'@'@%-.64s'"
+ ger "Benutzer '%-.48s'@'%-.64s' hat keine Zugriffsberechtigung"
+ greek "Δεν επιτέÏεται η Ï€Ïόσβαση στο χÏήστη: '%-.48s'@'%-.64s'"
+ hun "A(z) '%-.48s'@'%-.64s' felhasznalo szamara tiltott eleres."
+ ita "Accesso non consentito per l'utente: '%-.48s'@'%-.64s'"
+ kor "'%-.48s'@'%-.64s' 사용ìžëŠ” ì ‘ê·¼ì´ ê±°ë¶€ ë˜ì—ˆìŠµë‹ˆë‹¤."
+ nor "Tilgang nektet for bruker: '%-.48s'@'%-.64s'"
+ norwegian-ny "Tilgang ikke tillate for brukar: '%-.48s'@'%-.64s'"
+ por "Acesso negado para o usuário '%-.48s'@'%-.64s'"
+ rum "Acces interzis pentru utilizatorul: '%-.48s'@'%-.64s'"
+ rus "ДоÑтуп закрыт Ð´Ð»Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ '%-.48s'@'%-.64s'"
+ serbian "Pristup je zabranjen korisniku '%-.48s'@'%-.64s'"
+ slo "Zakázaný prístup pre užívateľa: '%-.48s'@'%-.64s'"
+ spa "Acceso negado para usuario: '%-.48s'@'%-.64s'"
+ swe "Användare '%-.48s'@'%-.64s' är ej berättigad att logga in"
+ ukr "ДоÑтуп заборонено Ð´Ð»Ñ ÐºÐ¾Ñ€Ð¸Ñтувача: '%-.48s'@'%-.64s'"
+
+ER_SET_PASSWORD_AUTH_PLUGIN
+ eng "SET PASSWORD has no significance for users authenticating via plugins"
+
+ER_GRANT_PLUGIN_USER_EXISTS
+ eng "GRANT with IDENTIFIED WITH is illegal because the user %-.*s already exists"
+
+ER_TRUNCATE_ILLEGAL_FK 42000
+ eng "Cannot truncate a table referenced in a foreign key constraint (%.192s)"
+
+ER_PLUGIN_IS_PERMANENT
+ eng "Plugin '%s' is force_plus_permanent and can not be unloaded"
+
+ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN
+ eng "The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled."
+
+ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX
+ eng "The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout."
+
+ER_STMT_CACHE_FULL
+ eng "Multi-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage; increase this mysqld variable and try again"
+
+ER_MULTI_UPDATE_KEY_CONFLICT
+ eng "Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'."
+
+# When translating this error message make sure to include "ALTER TABLE" in the
+# message as mysqlcheck parses the error message looking for ALTER TABLE.
+ER_TABLE_NEEDS_REBUILD
+ eng "Table rebuild required. Please do \"ALTER TABLE `%-.32s` FORCE\" or dump/reload to fix it!"
+
+WARN_OPTION_BELOW_LIMIT
+ eng "The value of '%s' should be no less than the value of '%s'"
+
+ER_INDEX_COLUMN_TOO_LONG
+ eng "Index column size too large. The maximum column size is %lu bytes."
+
+ER_ERROR_IN_TRIGGER_BODY
+ eng "Trigger '%-.64s' has an error in its body: '%-.256s'"
+
+ER_ERROR_IN_UNKNOWN_TRIGGER_BODY
+ eng "Unknown trigger has an error in its body: '%-.256s'"
+
ER_VCOL_BASED_ON_VCOL
eng "A computed column cannot be based on a computed column"
ER_VIRTUAL_COLUMN_FUNCTION_IS_NOT_ALLOWED
@@ -6372,4 +6440,3 @@ ER_UNKNOWN_OPTION
eng "Unknown option '%-.64s'"
ER_BAD_OPTION_VALUE
eng "Incorrect value '%-.64s' for option '%-.64s'"
-
diff --git a/sql/slave.cc b/sql/slave.cc
index ec693964726..1d99d2b606b 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -113,7 +113,7 @@ static const char *reconnect_messages[SLAVE_RECON_ACT_MAX][SLAVE_RECON_MSG_MAX]=
registration on master",
"Reconnecting after a failed registration on master",
"failed registering on master, reconnecting to try again, \
-log '%s' at postion %s",
+log '%s' at position %s",
"COM_REGISTER_SLAVE",
"Slave I/O thread killed during or after reconnect"
},
@@ -121,7 +121,7 @@ log '%s' at postion %s",
"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",
+ "failed dump request, reconnecting to try again, log '%s' at position %s",
"COM_BINLOG_DUMP",
"Slave I/O thread killed during or after reconnect"
},
@@ -130,7 +130,7 @@ log '%s' at postion %s",
"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",
+log '%s' at position %s",
"",
"Slave I/O thread killed during or after a reconnect done to recover from \
failed read"
@@ -504,53 +504,54 @@ int terminate_slave_threads(Master_info* mi,int thread_mask,bool skip_lock)
mysql_mutex_t *sql_lock = &mi->rli.run_lock, *io_lock = &mi->run_lock;
mysql_mutex_t *log_lock= mi->rli.relay_log.get_log_lock();
- if (thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL))
+ if (thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL))
{
- DBUG_PRINT("info",("Terminating IO thread"));
- mi->abort_slave=1;
- if ((error=terminate_slave_thread(mi->io_thd, io_lock,
- &mi->stop_cond,
- &mi->slave_running,
+ DBUG_PRINT("info",("Terminating SQL thread"));
+ mi->rli.abort_slave=1;
+ if ((error=terminate_slave_thread(mi->rli.sql_thd, sql_lock,
+ &mi->rli.stop_cond,
+ &mi->rli.slave_running,
skip_lock)) &&
!force_all)
DBUG_RETURN(error);
mysql_mutex_lock(log_lock);
- DBUG_PRINT("info",("Flushing relay log and master info file."));
+ DBUG_PRINT("info",("Flushing relay-log info file."));
if (current_thd)
- thd_proc_info(current_thd, "Flushing relay log and master info files.");
- if (flush_master_info(mi, TRUE, FALSE))
- DBUG_RETURN(ER_ERROR_DURING_FLUSH_LOGS);
-
- if (my_sync(mi->rli.relay_log.get_log_file()->file, MYF(MY_WME)))
+ thd_proc_info(current_thd, "Flushing relay-log info file.");
+ if (flush_relay_log_info(&mi->rli))
DBUG_RETURN(ER_ERROR_DURING_FLUSH_LOGS);
-
- if (my_sync(mi->fd, MYF(MY_WME)))
+
+ if (my_sync(mi->rli.info_fd, MYF(MY_WME)))
DBUG_RETURN(ER_ERROR_DURING_FLUSH_LOGS);
mysql_mutex_unlock(log_lock);
}
- if (thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL))
+ if (thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL))
{
- DBUG_PRINT("info",("Terminating SQL thread"));
- mi->rli.abort_slave=1;
- if ((error=terminate_slave_thread(mi->rli.sql_thd, sql_lock,
- &mi->rli.stop_cond,
- &mi->rli.slave_running,
+ DBUG_PRINT("info",("Terminating IO thread"));
+ mi->abort_slave=1;
+ if ((error=terminate_slave_thread(mi->io_thd, io_lock,
+ &mi->stop_cond,
+ &mi->slave_running,
skip_lock)) &&
!force_all)
DBUG_RETURN(error);
mysql_mutex_lock(log_lock);
- DBUG_PRINT("info",("Flushing relay-log info file."));
+ DBUG_PRINT("info",("Flushing relay log and master info file."));
if (current_thd)
- thd_proc_info(current_thd, "Flushing relay-log info file.");
- if (flush_relay_log_info(&mi->rli))
+ thd_proc_info(current_thd, "Flushing relay log and master info files.");
+ if (flush_master_info(mi, TRUE, FALSE))
DBUG_RETURN(ER_ERROR_DURING_FLUSH_LOGS);
-
- if (my_sync(mi->rli.info_fd, MYF(MY_WME)))
+
+ if (mi->rli.relay_log.is_open() &&
+ my_sync(mi->rli.relay_log.get_log_file()->file, MYF(MY_WME)))
+ DBUG_RETURN(ER_ERROR_DURING_FLUSH_LOGS);
+
+ if (my_sync(mi->fd, MYF(MY_WME)))
DBUG_RETURN(ER_ERROR_DURING_FLUSH_LOGS);
mysql_mutex_unlock(log_lock);
@@ -721,9 +722,17 @@ int start_slave_thread(
while (start_id == *slave_run_id)
{
DBUG_PRINT("sleep",("Waiting for slave thread to start"));
- const char* old_msg = thd->enter_cond(start_cond,cond_lock,
- "Waiting for slave thread to start");
- mysql_cond_wait(start_cond, cond_lock);
+ const char *old_msg= thd->enter_cond(start_cond, cond_lock,
+ "Waiting for slave thread to start");
+ /*
+ It is not sufficient to test this at loop bottom. We must test
+ it after registering the mutex in enter_cond(). If the kill
+ happens after testing of thd->killed and before the mutex is
+ registered, we could otherwise go waiting though thd->killed is
+ set.
+ */
+ if (!thd->killed)
+ mysql_cond_wait(start_cond, cond_lock);
thd->exit_cond(old_msg);
mysql_mutex_lock(cond_lock); // re-acquire it as exit_cond() released
if (thd->killed)
@@ -881,21 +890,31 @@ static bool sql_slave_killed(THD* thd, Relay_log_info* rli)
DBUG_ASSERT(rli->slave_running == 1);// tracking buffer overrun
if (abort_loop || thd->killed || rli->abort_slave)
{
- if (thd->transaction.all.modified_non_trans_table && rli->is_in_group())
+ /*
+ The transaction should always be binlogged if OPTION_KEEP_LOG is set
+ (it implies that something can not be rolled back). And such case
+ should be regarded similarly as modifing a non-transactional table
+ because retrying of the transaction will lead to an error or inconsistency
+ as well.
+ Example: OPTION_KEEP_LOG is set if a temporary table is created or dropped.
+ */
+ if ((thd->transaction.all.modified_non_trans_table ||
+ (thd->variables.option_bits & OPTION_KEEP_LOG))
+ && rli->is_in_group())
{
char msg_stopped[]=
- "... The slave SQL is stopped, leaving the current group "
- "of events unfinished with a non-transaction table changed. "
- "If the group consists solely of Row-based events, you can try "
- "restarting the slave with --slave-exec-mode=IDEMPOTENT, which "
+ "... Slave SQL Thread stopped with incomplete event group "
+ "having non-transactional changes. "
+ "If the group consists solely of row-based events, you can try "
+ "to restart the slave with --slave-exec-mode=IDEMPOTENT, which "
"ignores duplicate key, key not found, and similar errors (see "
"documentation for details).";
if (rli->abort_slave)
{
- DBUG_PRINT("info", ("Slave SQL thread is being stopped in the middle of"
- " a group having updated a non-trans table, giving"
- " it some grace period"));
+ DBUG_PRINT("info", ("Request to stop slave SQL Thread received while "
+ "applying a group that has non-transactional "
+ "changes; waiting for completion of the group ... "));
/*
Slave sql thread shutdown in face of unfinished group modified
@@ -919,9 +938,9 @@ static bool sql_slave_killed(THD* thd, Relay_log_info* rli)
if (ret == 0)
{
rli->report(WARNING_LEVEL, 0,
- "slave SQL thread is being stopped in the middle "
- "of applying of a group having updated a non-transaction "
- "table; waiting for the group completion ... ");
+ "Request to stop slave SQL Thread received while "
+ "applying a group that has non-transactional "
+ "changes; waiting for completion of the group ... ");
}
else
{
@@ -2512,8 +2531,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
if (slave_trans_retries)
{
- int temp_err;
- LINT_INIT(temp_err);
+ int UNINIT_VAR(temp_err);
if (exec_res && (temp_err= has_temporary_error(thd)))
{
const char *errmsg;
@@ -2544,9 +2562,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
else
{
exec_res= 0;
- trans_rollback(thd);
- close_thread_tables(thd);
- thd->mdl_context.release_transactional_locks();
+ rli->cleanup_context(thd, 1);
/* chance for concurrent connection to get more locks */
safe_sleep(thd, min(rli->trans_retries, MAX_SLAVE_RETRY_PAUSE),
(CHECK_KILLED_FUNC)sql_slave_killed, (void*)rli);
@@ -3013,7 +3029,7 @@ err:
sql_print_information("Slave I/O thread exiting, read up to log '%s', position %s",
IO_RPL_LOG_NAME, llstr(mi->master_log_pos,llbuff));
RUN_HOOK(binlog_relay_io, thread_stop, (thd, mi));
- thd->set_query(NULL, 0);
+ thd->reset_query();
thd->reset_db(NULL, 0);
if (mysql)
{
@@ -3396,6 +3412,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
request is detected only by the present function, not by events), so we
must "proactively" clear playgrounds:
*/
+ thd->clear_error();
rli->cleanup_context(thd, 1);
/*
Some extra safety, which should not been needed (normally, event deletion
@@ -3403,7 +3420,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
variables is supposed to set them to 0 before terminating)).
*/
thd->catalog= 0;
- thd->set_query(NULL, 0);
+ thd->reset_query();
thd->reset_db(NULL, 0);
thd_proc_info(thd, "Waiting for slave mutex on exit");
mysql_mutex_lock(&rli->run_lock);
@@ -3626,8 +3643,7 @@ static int process_io_rotate(Master_info *mi, Rotate_log_event *rev)
Rotate the relay log makes binlog format detection easier (at next slave
start or mysqlbinlog)
*/
- rotate_relay_log(mi); /* will take the right mutexes */
- DBUG_RETURN(0);
+ DBUG_RETURN(rotate_relay_log(mi) /* will take the right mutexes */);
}
/*
@@ -4739,12 +4755,66 @@ static Log_event* next_event(Relay_log_info* rli)
DBUG_ASSERT(rli->cur_log_fd == -1);
/*
- Read pointer has to be at the start since we are the only
- reader.
- We must keep the LOCK_log to read the 4 first bytes, as this is a hot
- log (same as when we call read_log_event() above: for a hot log we
- take the mutex).
+ When the SQL thread is [stopped and] (re)started the
+ following may happen:
+
+ 1. Log was hot at stop time and remains hot at restart
+
+ SQL thread reads again from hot_log (SQL thread was
+ reading from the active log when it was stopped and the
+ very same log is still active on SQL thread restart).
+
+ In this case, my_b_seek is performed on cur_log, while
+ cur_log points to relay_log.get_log_file();
+
+ 2. Log was hot at stop time but got cold before restart
+
+ The log was hot when SQL thread stopped, but it is not
+ anymore when the SQL thread restarts.
+
+ In this case, the SQL thread reopens the log, using
+ cache_buf, ie, cur_log points to &cache_buf, and thence
+ its coordinates are reset.
+
+ 3. Log was already cold at stop time
+
+ The log was not hot when the SQL thread stopped, and, of
+ course, it will not be hot when it restarts.
+
+ In this case, the SQL thread opens the cold log again,
+ using cache_buf, ie, cur_log points to &cache_buf, and
+ thence its coordinates are reset.
+
+ 4. Log was hot at stop time, DBA changes to previous cold
+ log and restarts SQL thread
+
+ The log was hot when the SQL thread was stopped, but the
+ user changed the coordinates of the SQL thread to
+ restart from a previous cold log.
+
+ In this case, at start time, cur_log points to a cold
+ log, opened using &cache_buf as cache, and coordinates
+ are reset. However, as it moves on to the next logs, it
+ will eventually reach the hot log. If the hot log is the
+ same at the time the SQL thread was stopped, then
+ coordinates were not reset - the cur_log will point to
+ relay_log.get_log_file(), and not a freshly opened
+ IO_CACHE through cache_buf. For this reason we need to
+ deploy a my_b_seek before calling check_binlog_magic at
+ this point of the code (see: BUG#55263 for more
+ details).
+
+ NOTES:
+ - We must keep the LOCK_log to read the 4 first bytes, as
+ this is a hot log (same as when we call read_log_event()
+ above: for a hot log we take the mutex).
+
+ - Because of scenario #4 above, we need to have a
+ my_b_seek here. Otherwise, we might hit the assertion
+ inside check_binlog_magic.
*/
+
+ my_b_seek(cur_log, (my_off_t) 0);
if (check_binlog_magic(cur_log,&errmsg))
{
if (!hot_log)
@@ -4811,12 +4881,13 @@ err:
is void).
*/
-void rotate_relay_log(Master_info* mi)
+int rotate_relay_log(Master_info* mi)
{
DBUG_ENTER("rotate_relay_log");
Relay_log_info* rli= &mi->rli;
+ int error= 0;
- DBUG_EXECUTE_IF("crash_before_rotate_relaylog", abort(););
+ DBUG_EXECUTE_IF("crash_before_rotate_relaylog", DBUG_SUICIDE(););
/*
We need to test inited because otherwise, new_file() will attempt to lock
@@ -4829,7 +4900,8 @@ void rotate_relay_log(Master_info* mi)
}
/* If the relay log is closed, new_file() will do nothing. */
- rli->relay_log.new_file();
+ if ((error= rli->relay_log.new_file()))
+ goto end;
/*
We harvest now, because otherwise BIN_LOG_HEADER_SIZE will not immediately
@@ -4846,7 +4918,7 @@ void rotate_relay_log(Master_info* mi)
*/
rli->relay_log.harvest_bytes_written(&rli->log_space_total);
end:
- DBUG_VOID_RETURN;
+ DBUG_RETURN(error);
}
diff --git a/sql/slave.h b/sql/slave.h
index 737e23c6cdc..814d52f84fd 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -211,7 +211,7 @@ 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);
+int rotate_relay_log(Master_info* mi);
int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli);
pthread_handler_t handle_slave_io(void *arg);
diff --git a/sql/sp.cc b/sql/sp.cc
index e6cf43c73a8..283db3539c9 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -27,7 +27,7 @@
#include "sql_acl.h" // SUPER_ACL
#include "sp_head.h"
#include "sp_cache.h"
-#include "lock.h" // lock_routine_name
+#include "lock.h" // lock_object_name
#include <my_user.h>
@@ -441,7 +441,7 @@ static TABLE *open_proc_table_for_update(THD *thd)
{
TABLE_LIST table_list;
TABLE *table;
- MDL_ticket *mdl_savepoint= thd->mdl_context.mdl_savepoint();
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
DBUG_ENTER("open_proc_table_for_update");
table_list.init_one_table("mysql", 5, "proc", 4, "proc", TL_WRITE);
@@ -924,6 +924,8 @@ sp_create_routine(THD *thd, int type, sp_head *sp)
TABLE *table;
char definer[USER_HOST_BUFF_SIZE];
ulong saved_mode= thd->variables.sql_mode;
+ MDL_key::enum_mdl_namespace mdl_type= type == TYPE_ENUM_FUNCTION ?
+ MDL_key::FUNCTION : MDL_key::PROCEDURE;
CHARSET_INFO *db_cs= get_default_db_collation(thd, sp->m_db.str);
@@ -943,8 +945,7 @@ sp_create_routine(THD *thd, int type, sp_head *sp)
type == TYPE_ENUM_FUNCTION);
/* Grab an exclusive MDL lock. */
- if (lock_routine_name(thd, type == TYPE_ENUM_FUNCTION,
- sp->m_db.str, sp->m_name.str))
+ if (lock_object_name(thd, mdl_type, sp->m_db.str, sp->m_name.str))
DBUG_RETURN(SP_OPEN_TABLE_FAILED);
/* Reset sql_mode during data dictionary operations. */
@@ -1192,6 +1193,8 @@ sp_drop_routine(THD *thd, int type, sp_name *name)
TABLE *table;
int ret;
bool save_binlog_row_based;
+ MDL_key::enum_mdl_namespace mdl_type= type == TYPE_ENUM_FUNCTION ?
+ MDL_key::FUNCTION : MDL_key::PROCEDURE;
DBUG_ENTER("sp_drop_routine");
DBUG_PRINT("enter", ("type: %d name: %.*s",
type, (int) name->m_name.length, name->m_name.str));
@@ -1200,8 +1203,7 @@ sp_drop_routine(THD *thd, int type, sp_name *name)
type == TYPE_ENUM_FUNCTION);
/* Grab an exclusive MDL lock. */
- if (lock_routine_name(thd, type == TYPE_ENUM_FUNCTION,
- name->m_db.str, name->m_name.str))
+ if (lock_object_name(thd, mdl_type, name->m_db.str, name->m_name.str))
DBUG_RETURN(SP_DELETE_ROW_FAILED);
if (!(table= open_proc_table_for_update(thd)))
@@ -1272,6 +1274,8 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
TABLE *table;
int ret;
bool save_binlog_row_based;
+ MDL_key::enum_mdl_namespace mdl_type= type == TYPE_ENUM_FUNCTION ?
+ MDL_key::FUNCTION : MDL_key::PROCEDURE;
DBUG_ENTER("sp_update_routine");
DBUG_PRINT("enter", ("type: %d name: %.*s",
type, (int) name->m_name.length, name->m_name.str));
@@ -1280,8 +1284,7 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
type == TYPE_ENUM_FUNCTION);
/* Grab an exclusive MDL lock. */
- if (lock_routine_name(thd, type == TYPE_ENUM_FUNCTION,
- name->m_db.str, name->m_name.str))
+ if (lock_object_name(thd, mdl_type, name->m_db.str, name->m_name.str))
DBUG_RETURN(SP_OPEN_TABLE_FAILED);
if (!(table= open_proc_table_for_update(thd)))
@@ -1357,6 +1360,108 @@ err:
/**
+ This internal handler is used to trap errors from opening mysql.proc.
+*/
+
+class Lock_db_routines_error_handler : public Internal_error_handler
+{
+public:
+ bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl)
+ {
+ if (sql_errno == ER_NO_SUCH_TABLE ||
+ sql_errno == ER_CANNOT_LOAD_FROM_TABLE ||
+ sql_errno == ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE ||
+ sql_errno == ER_COL_COUNT_DOESNT_MATCH_CORRUPTED)
+ return true;
+ return false;
+ }
+};
+
+
+/**
+ Acquires exclusive metadata lock on all stored routines in the
+ given database.
+
+ @note Will also return false (=success) if mysql.proc can't be opened
+ or is outdated. This allows DROP DATABASE to continue in these
+ cases.
+ */
+
+bool lock_db_routines(THD *thd, char *db)
+{
+ TABLE *table;
+ uint key_len;
+ int nxtres= 0;
+ Open_tables_backup open_tables_state_backup;
+ MDL_request_list mdl_requests;
+ Lock_db_routines_error_handler err_handler;
+ DBUG_ENTER("lock_db_routines");
+
+ /*
+ mysql.proc will be re-opened during deletion, so we can ignore
+ errors when opening the table here. The error handler is
+ used to avoid getting the same warning twice.
+ */
+ thd->push_internal_handler(&err_handler);
+ table= open_proc_table_for_read(thd, &open_tables_state_backup);
+ thd->pop_internal_handler();
+ if (!table)
+ {
+ /*
+ DROP DATABASE should not fail even if mysql.proc does not exist
+ or is outdated. We therefore only abort mysql_rm_db() if we
+ have errors not handled by the error handler.
+ */
+ DBUG_RETURN(thd->is_error() || thd->killed);
+ }
+
+ table->field[MYSQL_PROC_FIELD_DB]->store(db, strlen(db), system_charset_info);
+ key_len= table->key_info->key_part[0].store_length;
+ table->file->ha_index_init(0, 1);
+
+ if (! table->file->index_read_map(table->record[0],
+ table->field[MYSQL_PROC_FIELD_DB]->ptr,
+ (key_part_map)1, HA_READ_KEY_EXACT))
+ {
+ do
+ {
+ char *sp_name= get_field(thd->mem_root,
+ table->field[MYSQL_PROC_FIELD_NAME]);
+ longlong sp_type= table->field[MYSQL_PROC_MYSQL_TYPE]->val_int();
+ MDL_request *mdl_request= new (thd->mem_root) MDL_request;
+ mdl_request->init(sp_type == TYPE_ENUM_FUNCTION ?
+ MDL_key::FUNCTION : MDL_key::PROCEDURE,
+ db, sp_name, MDL_EXCLUSIVE, MDL_TRANSACTION);
+ mdl_requests.push_front(mdl_request);
+ } while (! (nxtres= table->file->index_next_same(table->record[0],
+ table->field[MYSQL_PROC_FIELD_DB]->ptr,
+ key_len)));
+ }
+ table->file->ha_index_end();
+ if (nxtres != 0 && nxtres != HA_ERR_END_OF_FILE)
+ {
+ table->file->print_error(nxtres, MYF(0));
+ close_system_tables(thd, &open_tables_state_backup);
+ DBUG_RETURN(true);
+ }
+ close_system_tables(thd, &open_tables_state_backup);
+
+ /* We should already hold a global IX lock and a schema X lock. */
+ DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::GLOBAL, "", "",
+ MDL_INTENTION_EXCLUSIVE) &&
+ thd->mdl_context.is_lock_owner(MDL_key::SCHEMA, db, "",
+ MDL_EXCLUSIVE));
+ DBUG_RETURN(thd->mdl_context.acquire_locks(&mdl_requests,
+ thd->variables.lock_wait_timeout));
+}
+
+
+/**
Drop all routines in database 'db'
@note Close the thread tables, the calling code might want to
@@ -1369,7 +1474,7 @@ sp_drop_db_routines(THD *thd, char *db)
TABLE *table;
int ret;
uint key_len;
- MDL_ticket *mdl_savepoint= thd->mdl_context.mdl_savepoint();
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
uchar keybuf[MAX_KEY_LENGTH];
DBUG_ENTER("sp_drop_db_routines");
DBUG_PRINT("enter", ("db: %s", db));
@@ -1640,38 +1745,6 @@ sp_exist_routines(THD *thd, TABLE_LIST *routines, bool any)
}
-/**
- Check if a routine exists in the mysql.proc table, without actually
- parsing the definition. (Used for dropping).
-
- @param thd thread context
- @param name name of procedure
-
- @retval
- 0 Success
- @retval
- non-0 Error; SP_OPEN_TABLE_FAILED or SP_KEY_NOT_FOUND
-*/
-
-int
-sp_routine_exists_in_table(THD *thd, int type, sp_name *name)
-{
- TABLE *table;
- int ret;
- Open_tables_backup open_tables_state_backup;
-
- if (!(table= open_proc_table_for_read(thd, &open_tables_state_backup)))
- ret= SP_OPEN_TABLE_FAILED;
- else
- {
- if ((ret= db_find_routine_aux(thd, type, name, table)) != SP_OK)
- ret= SP_KEY_NOT_FOUND;
- close_system_tables(thd, &open_tables_state_backup);
- }
- return ret;
-}
-
-
extern "C" uchar* sp_sroutine_key(const uchar *ptr, size_t *plen,
my_bool first)
{
@@ -1727,7 +1800,7 @@ bool sp_add_used_routine(Query_tables_list *prelocking_ctx, Query_arena *arena,
(Sroutine_hash_entry *)arena->alloc(sizeof(Sroutine_hash_entry));
if (!rn) // OOM. Error will be reported using fatal_error().
return FALSE;
- rn->mdl_request.init(key, MDL_SHARED);
+ rn->mdl_request.init(key, MDL_SHARED, MDL_TRANSACTION);
if (my_hash_insert(&prelocking_ctx->sroutines, (uchar *)rn))
return FALSE;
prelocking_ctx->sroutines_list.link_in_list(rn, &rn->next);
diff --git a/sql/sp.h b/sql/sp.h
index 10e70261b86..68c45768857 100644
--- a/sql/sp.h
+++ b/sql/sp.h
@@ -84,6 +84,18 @@ enum
int
sp_drop_db_routines(THD *thd, char *db);
+/**
+ Acquires exclusive metadata lock on all stored routines in the
+ given database.
+
+ @param thd Thread handler
+ @param db Database name
+
+ @retval false Success
+ @retval true Failure
+ */
+bool lock_db_routines(THD *thd, char *db);
+
sp_head *
sp_find_routine(THD *thd, int type, sp_name *name,
sp_cache **cp, bool cache_only);
@@ -100,9 +112,6 @@ sp_cache_routine(THD *thd, int type, sp_name *name,
bool
sp_exist_routines(THD *thd, TABLE_LIST *procs, bool any);
-int
-sp_routine_exists_in_table(THD *thd, int type, sp_name *name);
-
bool
sp_show_create_routine(THD *thd, int type, sp_name *name);
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 750ddee49c3..df258d49c0a 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1,4 +1,4 @@
-/* Copyright 2002-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
#include "sql_priv.h"
@@ -237,7 +237,6 @@ sp_get_flags_for_command(LEX *lex)
case SQLCOM_SHOW_EVENTS:
case SQLCOM_SHOW_KEYS:
case SQLCOM_SHOW_MASTER_STAT:
- case SQLCOM_SHOW_NEW_MASTER:
case SQLCOM_SHOW_OPEN_TABLES:
case SQLCOM_SHOW_PRIVILEGES:
case SQLCOM_SHOW_PROCESSLIST:
@@ -551,7 +550,7 @@ sp_head::operator delete(void *ptr, size_t size) throw()
sp_head::sp_head()
- :Query_arena(&main_mem_root, INITIALIZED_FOR_SP),
+ :Query_arena(&main_mem_root, STMT_INITIALIZED_FOR_SP),
m_flags(0),
m_sp_cache_version(0),
unsafe_flags(0),
@@ -1069,7 +1068,7 @@ void sp_head::recursion_level_error(THD *thd)
if (m_type == TYPE_ENUM_PROCEDURE)
{
my_error(ER_SP_RECURSION_LIMIT, MYF(0),
- thd->variables.max_sp_recursion_depth,
+ static_cast<int>(thd->variables.max_sp_recursion_depth),
m_name.str);
}
else
@@ -1178,10 +1177,17 @@ find_handler_after_execution(THD *thd, sp_rcontext *ctx)
/**
Execute the routine. The main instruction jump loop is there.
Assume the parameters already set.
+
+ @param thd Thread context.
+ @param merge_da_on_success Flag specifying if Warning Info should be
+ propagated to the caller on Completion
+ Condition or not.
+
@todo
- Will write this SP statement into binlog separately
(TODO: consider changing the condition to "not inside event union")
+ @return Error status.
@retval
FALSE on success
@retval
@@ -1189,7 +1195,7 @@ find_handler_after_execution(THD *thd, sp_rcontext *ctx)
*/
bool
-sp_head::execute(THD *thd)
+sp_head::execute(THD *thd, bool merge_da_on_success)
{
DBUG_ENTER("sp_head::execute");
char saved_cur_db_name_buf[SAFE_NAME_LEN+1];
@@ -1204,7 +1210,7 @@ sp_head::execute(THD *thd)
Query_arena *old_arena;
/* per-instruction arena */
MEM_ROOT execute_mem_root;
- Query_arena execute_arena(&execute_mem_root, INITIALIZED_FOR_SP),
+ Query_arena execute_arena(&execute_mem_root, STMT_INITIALIZED_FOR_SP),
backup_arena;
query_id_t old_query_id;
TABLE *old_derived_tables;
@@ -1213,9 +1219,33 @@ sp_head::execute(THD *thd)
String old_packet;
Reprepare_observer *save_reprepare_observer= thd->m_reprepare_observer;
Object_creation_ctx *saved_creation_ctx;
- Warning_info *saved_warning_info, warning_info(thd->warning_info->warn_id());
+ Warning_info *saved_warning_info;
+ Warning_info warning_info(thd->warning_info->warn_id(), false);
- /* Use some extra margin for possible SP recursion and functions */
+ /*
+ Just reporting a stack overrun error
+ (@sa check_stack_overrun()) requires stack memory for error
+ message buffer. Thus, we have to put the below check
+ relatively close to the beginning of the execution stack,
+ where available stack margin is still big. As long as the check
+ has to be fairly high up the call stack, the amount of memory
+ we "book" for has to stay fairly high as well, and hence
+ not very accurate. The number below has been calculated
+ by trial and error, and reflects the amount of memory necessary
+ to execute a single stored procedure instruction, be it either
+ an SQL statement, or, heaviest of all, a CALL, which involves
+ parsing and loading of another stored procedure into the cache
+ (@sa db_load_routine() and Bug#10100).
+ At the time of measuring, a recursive SP invocation required
+ 3232 bytes of stack on 32 bit Linux, 6016 bytes on 64 bit Mac
+ and 11152 on 64 bit Solaris sparc.
+ The same with db_load_routine() required circa 7k bytes and
+ 14k bytes accordingly. Hence, here we book the stack with some
+ reasonable margin.
+
+ Reverting back to 8 * STACK_MIN_SIZE until further fix.
+ 8 * STACK_MIN_SIZE is required on some exotic platforms.
+ */
if (check_stack_overrun(thd, 8 * STACK_MIN_SIZE, (uchar*)&old_packet))
DBUG_RETURN(TRUE);
@@ -1461,10 +1491,17 @@ sp_head::execute(THD *thd)
thd->m_reprepare_observer= save_reprepare_observer;
thd->stmt_arena= old_arena;
- state= EXECUTED;
+ state= STMT_EXECUTED;
- /* Restore the caller's original warning information area. */
- saved_warning_info->merge_with_routine_info(thd, thd->warning_info);
+ /*
+ Restore the caller's original warning information area:
+ - warnings generated during trigger execution should not be
+ propagated to the caller on success;
+ - if there was an exception during execution, warning info should be
+ propagated to the caller in any case.
+ */
+ if (err_status || merge_da_on_success)
+ saved_warning_info->merge_with_routine_info(thd, thd->warning_info);
thd->warning_info= saved_warning_info;
done:
@@ -1478,7 +1515,7 @@ 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 (cur_db_changed && !thd->killed)
+ if (cur_db_changed && thd->killed != THD::KILL_CONNECTION)
{
/*
Force switching back to the saved current database, because it may be
@@ -1612,7 +1649,7 @@ sp_head::execute_trigger(THD *thd,
sp_rcontext *nctx = NULL;
bool err_status= FALSE;
MEM_ROOT call_mem_root;
- Query_arena call_arena(&call_mem_root, Query_arena::INITIALIZED_FOR_SP);
+ Query_arena call_arena(&call_mem_root, Query_arena::STMT_INITIALIZED_FOR_SP);
Query_arena backup_arena;
DBUG_ENTER("sp_head::execute_trigger");
@@ -1686,7 +1723,7 @@ sp_head::execute_trigger(THD *thd,
thd->spcont= nctx;
- err_status= execute(thd);
+ err_status= execute(thd, FALSE);
err_with_cleanup:
thd->restore_active_arena(&call_arena, &backup_arena);
@@ -1753,7 +1790,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
String binlog_buf(buf, sizeof(buf), &my_charset_bin);
bool err_status= FALSE;
MEM_ROOT call_mem_root;
- Query_arena call_arena(&call_mem_root, Query_arena::INITIALIZED_FOR_SP);
+ Query_arena call_arena(&call_mem_root, Query_arena::STMT_INITIALIZED_FOR_SP);
Query_arena backup_arena;
DBUG_ENTER("sp_head::execute_function");
DBUG_PRINT("info", ("function %s", m_name.str));
@@ -1903,7 +1940,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
*/
thd->set_n_backup_active_arena(&call_arena, &backup_arena);
- err_status= execute(thd);
+ err_status= execute(thd, TRUE);
thd->restore_active_arena(&call_arena, &backup_arena);
@@ -2109,6 +2146,8 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
if (! thd->in_sub_stmt && ! thd->in_multi_stmt_transaction_mode())
thd->mdl_context.release_transactional_locks();
+ else if (! thd->in_sub_stmt)
+ thd->mdl_context.release_statement_locks();
thd->rollback_item_tree_changes();
@@ -2137,7 +2176,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
#endif
if (!err_status)
- err_status= execute(thd);
+ err_status= execute(thd, TRUE);
if (save_log_general)
thd->variables.option_bits &= ~OPTION_LOG_OFF;
@@ -2509,9 +2548,24 @@ void
sp_head::restore_thd_mem_root(THD *thd)
{
DBUG_ENTER("sp_head::restore_thd_mem_root");
- Item *flist= free_list; // The old list
+
+ /*
+ In some cases our parser detects a syntax error and calls
+ LEX::cleanup_lex_after_parse_error() method only after
+ finishing parsing the whole routine. In such a situation
+ sp_head::restore_thd_mem_root() will be called twice - the
+ first time as part of normal parsing process and the second
+ time by cleanup_lex_after_parse_error().
+ To avoid ruining active arena/mem_root state in this case we
+ skip restoration of old arena/mem_root if this method has been
+ already called for this routine.
+ */
+ if (!m_thd)
+ DBUG_VOID_RETURN;
+
+ Item *flist= free_list; // The old list
set_query_arena(thd); // Get new free_list and mem_root
- state= INITIALIZED_FOR_SP;
+ state= STMT_INITIALIZED_FOR_SP;
DBUG_PRINT("info", ("mem_root 0x%lx returned from thd mem root 0x%lx",
(ulong) &mem_root, (ulong) &thd->mem_root));
@@ -2946,6 +3000,8 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
if (! thd->in_sub_stmt && ! thd->in_multi_stmt_transaction_mode())
thd->mdl_context.release_transactional_locks();
+ else if (! thd->in_sub_stmt)
+ thd->mdl_context.release_statement_locks();
}
if (m_lex->query_tables_own_last)
@@ -2973,7 +3029,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
(thd->stmt_da->sql_errno() != ER_CANT_REOPEN_TABLE &&
thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE &&
thd->stmt_da->sql_errno() != ER_UPDATE_TABLE_USED))
- thd->stmt_arena->state= Query_arena::EXECUTED;
+ thd->stmt_arena->state= Query_arena::STMT_EXECUTED;
/*
Merge here with the saved parent's values
@@ -3033,14 +3089,11 @@ int sp_instr::exec_core(THD *thd, uint *nextp)
int
sp_instr_stmt::execute(THD *thd, uint *nextp)
{
- char *query;
- uint32 query_length;
int res;
DBUG_ENTER("sp_instr_stmt::execute");
DBUG_PRINT("info", ("command: %d", m_lex_keeper.sql_command()));
- query= thd->query();
- query_length= thd->query_length();
+ const CSET_STRING query_backup= thd->query_string;
#if defined(ENABLED_PROFILING)
/* This s-p instr is profilable and will be captured. */
thd->profiling.set_query_source(m_query.str, m_query.length);
@@ -3061,7 +3114,12 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
res= m_lex_keeper.reset_lex_and_exec_core(thd, nextp, FALSE, this);
if (thd->stmt_da->is_eof())
+ {
+ /* Finalize server status flags after executing a statement. */
+ thd->update_server_status();
+
thd->protocol->end_statement();
+ }
query_cache_end_of_result(thd);
@@ -3070,7 +3128,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
}
else
*nextp= m_ip+1;
- thd->set_query(query, query_length);
+ thd->set_query(query_backup);
thd->query_name_consts= 0;
if (!thd->is_error())
@@ -3118,7 +3176,7 @@ sp_instr_stmt::exec_core(THD *thd, uint *nextp)
MYSQL_QUERY_EXEC_START(thd->query(),
thd->thread_id,
(char *) (thd->db ? thd->db : ""),
- thd->security_ctx->priv_user,
+ &thd->security_ctx->priv_user[0],
(char *)thd->security_ctx->host_or_ip,
3);
int res= mysql_execute_command(thd);
@@ -4141,7 +4199,8 @@ sp_head::add_used_tables_to_table_list(THD *thd,
*/
table->mdl_request.init(MDL_key::TABLE, table->db, table->table_name,
table->lock_type >= TL_WRITE_ALLOW_WRITE ?
- MDL_SHARED_WRITE : MDL_SHARED_READ);
+ MDL_SHARED_WRITE : MDL_SHARED_READ,
+ MDL_TRANSACTION);
/* Everyting else should be zeroed */
@@ -4185,7 +4244,7 @@ sp_add_to_query_tables(THD *thd, LEX *lex,
table->select_lex= lex->current_select;
table->cacheable_table= 1;
table->mdl_request.init(MDL_key::TABLE, table->db, table->table_name,
- mdl_type);
+ mdl_type, MDL_TRANSACTION);
lex->add_to_query_tables(table);
return table;
diff --git a/sql/sp_head.h b/sql/sp_head.h
index b2446c8f680..4d5e2dd95ab 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -42,6 +42,7 @@
#define TYPE_ENUM_FUNCTION 1
#define TYPE_ENUM_PROCEDURE 2
#define TYPE_ENUM_TRIGGER 3
+#define TYPE_ENUM_PROXY 4
Item_result
sp_map_result_type(enum enum_field_types type);
@@ -526,7 +527,7 @@ private:
HASH m_sptabs;
bool
- execute(THD *thd);
+ execute(THD *thd, bool merge_da_on_success);
/**
Perform a forward flow analysis in the generated code.
@@ -559,7 +560,7 @@ public:
/// Should give each a name or type code for debugging purposes?
sp_instr(uint ip, sp_pcontext *ctx)
- :Query_arena(0, INITIALIZED_FOR_SP), marked(0), m_ip(ip), m_ctx(ctx)
+ :Query_arena(0, STMT_INITIALIZED_FOR_SP), marked(0), m_ip(ip), m_ctx(ctx)
{}
virtual ~sp_instr()
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index e11361c3d6a..95b865be491 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -220,6 +220,7 @@ private:
during execution.
*/
bool m_return_value_set;
+
/**
TRUE if the context is created for a sub-statement.
*/
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 41163ee629e..77c467b7dcf 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -44,11 +44,11 @@
#include "transaction.h"
#include "lock.h" // MYSQL_LOCK_IGNORE_TIMEOUT
#include "records.h" // init_read_record, end_read_record
-#include "hostname.h"
-#include "sql_db.h"
-#include "sql_connect.h"
#include <sql_common.h>
#include <mysql/plugin_auth.h>
+#include "sql_connect.h"
+#include "hostname.h"
+#include "sql_db.h"
bool mysql_user_table_is_in_short_password_format= false;
@@ -180,17 +180,17 @@ static LEX_STRING old_password_plugin_name= {
/// @todo make it configurable
LEX_STRING *default_auth_plugin_name= &native_password_plugin_name;
-static plugin_ref native_password_plugin;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
static plugin_ref old_password_plugin;
#endif
+static plugin_ref native_password_plugin;
/* Classes */
struct acl_host_and_ip
{
char *hostname;
- long ip,ip_mask; // Used with masked ip:s
+ long ip, ip_mask; // Used with masked ip:s
};
class ACL_ACCESS {
@@ -215,7 +215,7 @@ public:
uint hostname_length;
USER_RESOURCES user_resource;
char *user;
- uint8 salt[SCRAMBLE_LENGTH+1]; // scrambled password in binary form
+ uint8 salt[SCRAMBLE_LENGTH + 1]; // scrambled password in binary form
uint8 salt_len; // 0 - no password, 4 - 3.20, 8 - 4.0, 20 - 4.1.1
enum SSL_type ssl_type;
const char *ssl_cipher, *x509_issuer, *x509_subject;
@@ -224,7 +224,7 @@ public:
ACL_USER *copy(MEM_ROOT *root)
{
- ACL_USER *dst= (ACL_USER *)alloc_root(root, sizeof(ACL_USER));
+ ACL_USER *dst= (ACL_USER *) alloc_root(root, sizeof(ACL_USER));
if (!dst)
return 0;
*dst= *this;
@@ -237,7 +237,7 @@ public:
dst->plugin= plugin;
else
dst->plugin.str= strmake_root(root, plugin.str, plugin.length);
- dst->auth_string.str = safe_strdup_root(root, auth_string.str);
+ dst->auth_string.str= safe_strdup_root(root, auth_string.str);
dst->host.hostname= safe_strdup_root(root, host.hostname);
return dst;
}
@@ -250,7 +250,253 @@ public:
char *user,*db;
};
+
#ifndef NO_EMBEDDED_ACCESS_CHECKS
+static void update_hostname(acl_host_and_ip *host, const char *hostname);
+static ulong get_sort(uint count,...);
+static bool compare_hostname(const acl_host_and_ip *host, const char *hostname,
+ const char *ip);
+static bool show_proxy_grants (THD *thd, LEX_USER *user,
+ char *buff, size_t buffsize);
+
+class ACL_PROXY_USER :public ACL_ACCESS
+{
+ acl_host_and_ip host;
+ const char *user;
+ acl_host_and_ip proxied_host;
+ const char *proxied_user;
+ bool with_grant;
+
+ typedef enum {
+ MYSQL_PROXIES_PRIV_HOST,
+ MYSQL_PROXIES_PRIV_USER,
+ MYSQL_PROXIES_PRIV_PROXIED_HOST,
+ MYSQL_PROXIES_PRIV_PROXIED_USER,
+ MYSQL_PROXIES_PRIV_WITH_GRANT,
+ MYSQL_PROXIES_PRIV_GRANTOR,
+ MYSQL_PROXIES_PRIV_TIMESTAMP } old_acl_proxy_users;
+public:
+ ACL_PROXY_USER () {};
+
+ void init(const char *host_arg, const char *user_arg,
+ const char *proxied_host_arg, const char *proxied_user_arg,
+ bool with_grant_arg)
+ {
+ user= (user_arg && *user_arg) ? user_arg : NULL;
+ update_hostname (&host,
+ (host_arg && *host_arg) ? host_arg : NULL);
+ proxied_user= (proxied_user_arg && *proxied_user_arg) ?
+ proxied_user_arg : NULL;
+ update_hostname (&proxied_host,
+ (proxied_host_arg && *proxied_host_arg) ?
+ proxied_host_arg : NULL);
+ with_grant= with_grant_arg;
+ sort= get_sort(4, host.hostname, user,
+ proxied_host.hostname, proxied_user);
+ }
+
+ void init(MEM_ROOT *mem, const char *host_arg, const char *user_arg,
+ const char *proxied_host_arg, const char *proxied_user_arg,
+ bool with_grant_arg)
+ {
+ init ((host_arg && *host_arg) ? strdup_root (mem, host_arg) : NULL,
+ (user_arg && *user_arg) ? strdup_root (mem, user_arg) : NULL,
+ (proxied_host_arg && *proxied_host_arg) ?
+ strdup_root (mem, proxied_host_arg) : NULL,
+ (proxied_user_arg && *proxied_user_arg) ?
+ strdup_root (mem, proxied_user_arg) : NULL,
+ with_grant_arg);
+ }
+
+ void init(TABLE *table, MEM_ROOT *mem)
+ {
+ init (get_field(mem, table->field[MYSQL_PROXIES_PRIV_HOST]),
+ get_field(mem, table->field[MYSQL_PROXIES_PRIV_USER]),
+ get_field(mem, table->field[MYSQL_PROXIES_PRIV_PROXIED_HOST]),
+ get_field(mem, table->field[MYSQL_PROXIES_PRIV_PROXIED_USER]),
+ table->field[MYSQL_PROXIES_PRIV_WITH_GRANT]->val_int() != 0);
+ }
+
+ bool get_with_grant() { return with_grant; }
+ const char *get_user() { return user; }
+ const char *get_host() { return host.hostname; }
+ const char *get_proxied_user() { return proxied_user; }
+ const char *get_proxied_host() { return proxied_host.hostname; }
+ void set_user(MEM_ROOT *mem, const char *user_arg)
+ {
+ user= user_arg && *user_arg ? strdup_root(mem, user_arg) : NULL;
+ }
+ void set_host(MEM_ROOT *mem, const char *host_arg)
+ {
+ update_hostname(&host,
+ (host_arg && *host_arg) ?
+ strdup_root(mem, host_arg) : NULL);
+ }
+
+ bool check_validity(bool check_no_resolve)
+ {
+ if (check_no_resolve &&
+ (hostname_requires_resolving(host.hostname) ||
+ hostname_requires_resolving(proxied_host.hostname)))
+ {
+ sql_print_warning("'proxies_priv' entry '%s@%s %s@%s' "
+ "ignored in --skip-name-resolve mode.",
+ proxied_user ? proxied_user : "",
+ proxied_host.hostname ? proxied_host.hostname : "",
+ user ? user : "",
+ host.hostname ? host.hostname : "");
+ return TRUE;
+ }
+ return FALSE;
+ }
+
+ bool matches(const char *host_arg, const char *user_arg, const char *ip_arg,
+ const char *proxied_user_arg)
+ {
+ DBUG_ENTER("ACL_PROXY_USER::matches");
+ DBUG_PRINT("info", ("compare_hostname(%s,%s,%s) &&"
+ "compare_hostname(%s,%s,%s) &&"
+ "wild_compare (%s,%s) &&"
+ "wild_compare (%s,%s)",
+ host.hostname ? host.hostname : "<NULL>",
+ host_arg ? host_arg : "<NULL>",
+ ip_arg ? ip_arg : "<NULL>",
+ proxied_host.hostname ? proxied_host.hostname : "<NULL>",
+ host_arg ? host_arg : "<NULL>",
+ ip_arg ? ip_arg : "<NULL>",
+ user_arg ? user_arg : "<NULL>",
+ user ? user : "<NULL>",
+ proxied_user_arg ? proxied_user_arg : "<NULL>",
+ proxied_user ? proxied_user : "<NULL>"));
+ DBUG_RETURN(compare_hostname(&host, host_arg, ip_arg) &&
+ compare_hostname(&proxied_host, host_arg, ip_arg) &&
+ (!user ||
+ (user_arg && !wild_compare(user_arg, user, TRUE))) &&
+ (!proxied_user ||
+ (proxied_user && !wild_compare(proxied_user_arg,
+ proxied_user, TRUE))));
+ }
+
+
+ inline static bool auth_element_equals(const char *a, const char *b)
+ {
+ return (a == b || (a != NULL && b != NULL && !strcmp(a,b)));
+ }
+
+
+ bool pk_equals(ACL_PROXY_USER *grant)
+ {
+ DBUG_ENTER("pk_equals");
+ DBUG_PRINT("info", ("strcmp(%s,%s) &&"
+ "strcmp(%s,%s) &&"
+ "wild_compare (%s,%s) &&"
+ "wild_compare (%s,%s)",
+ user ? user : "<NULL>",
+ grant->user ? grant->user : "<NULL>",
+ proxied_user ? proxied_user : "<NULL>",
+ grant->proxied_user ? grant->proxied_user : "<NULL>",
+ host.hostname ? host.hostname : "<NULL>",
+ grant->host.hostname ? grant->host.hostname : "<NULL>",
+ proxied_host.hostname ? proxied_host.hostname : "<NULL>",
+ grant->proxied_host.hostname ?
+ grant->proxied_host.hostname : "<NULL>"));
+
+ DBUG_RETURN(auth_element_equals(user, grant->user) &&
+ auth_element_equals(proxied_user, grant->proxied_user) &&
+ auth_element_equals(host.hostname, grant->host.hostname) &&
+ auth_element_equals(proxied_host.hostname,
+ grant->proxied_host.hostname));
+ }
+
+
+ bool granted_on(const char *host_arg, const char *user_arg)
+ {
+ return (((!user && (!user_arg || !user_arg[0])) ||
+ (user && user_arg && !strcmp(user, user_arg))) &&
+ ((!host.hostname && (!host_arg || !host_arg[0])) ||
+ (host.hostname && host_arg && !strcmp(host.hostname, host_arg))));
+ }
+
+
+ void print_grant(String *str)
+ {
+ str->append(STRING_WITH_LEN("GRANT PROXY ON '"));
+ if (proxied_user)
+ str->append(proxied_user, strlen(proxied_user));
+ str->append(STRING_WITH_LEN("'@'"));
+ if (proxied_host.hostname)
+ str->append(proxied_host.hostname, strlen(proxied_host.hostname));
+ str->append(STRING_WITH_LEN("' TO '"));
+ if (user)
+ str->append(user, strlen(user));
+ str->append(STRING_WITH_LEN("'@'"));
+ if (host.hostname)
+ str->append(host.hostname, strlen(host.hostname));
+ str->append(STRING_WITH_LEN("'"));
+ if (with_grant)
+ str->append(STRING_WITH_LEN(" WITH GRANT OPTION"));
+ }
+
+ void set_data(ACL_PROXY_USER *grant)
+ {
+ with_grant= grant->with_grant;
+ }
+
+ static int store_pk(TABLE *table,
+ const LEX_STRING *host,
+ const LEX_STRING *user,
+ const LEX_STRING *proxied_host,
+ const LEX_STRING *proxied_user)
+ {
+ DBUG_ENTER("ACL_PROXY_USER::store_pk");
+ DBUG_PRINT("info", ("host=%s, user=%s, proxied_host=%s, proxied_user=%s",
+ host->str ? host->str : "<NULL>",
+ user->str ? user->str : "<NULL>",
+ proxied_host->str ? proxied_host->str : "<NULL>",
+ proxied_user->str ? proxied_user->str : "<NULL>"));
+ if (table->field[MYSQL_PROXIES_PRIV_HOST]->store(host->str,
+ host->length,
+ system_charset_info))
+ DBUG_RETURN(TRUE);
+ if (table->field[MYSQL_PROXIES_PRIV_USER]->store(user->str,
+ user->length,
+ system_charset_info))
+ DBUG_RETURN(TRUE);
+ if (table->field[MYSQL_PROXIES_PRIV_PROXIED_HOST]->store(proxied_host->str,
+ proxied_host->length,
+ system_charset_info))
+ DBUG_RETURN(TRUE);
+ if (table->field[MYSQL_PROXIES_PRIV_PROXIED_USER]->store(proxied_user->str,
+ proxied_user->length,
+ system_charset_info))
+ DBUG_RETURN(TRUE);
+
+ DBUG_RETURN(FALSE);
+ }
+
+ static int store_data_record(TABLE *table,
+ const LEX_STRING *host,
+ const LEX_STRING *user,
+ const LEX_STRING *proxied_host,
+ const LEX_STRING *proxied_user,
+ bool with_grant,
+ const char *grantor)
+ {
+ DBUG_ENTER("ACL_PROXY_USER::store_pk");
+ if (store_pk(table, host, user, proxied_host, proxied_user))
+ DBUG_RETURN(TRUE);
+ DBUG_PRINT("info", ("with_grant=%s", with_grant ? "TRUE" : "FALSE"));
+ if (table->field[MYSQL_PROXIES_PRIV_WITH_GRANT]->store(with_grant ? 1 : 0,
+ TRUE))
+ DBUG_RETURN(TRUE);
+ if (table->field[MYSQL_PROXIES_PRIV_GRANTOR]->store(grantor,
+ strlen(grantor),
+ system_charset_info))
+ DBUG_RETURN(TRUE);
+
+ DBUG_RETURN(FALSE);
+ }
+};
#define FIRST_NON_YN_FIELD 26
@@ -270,17 +516,18 @@ static uchar* acl_entry_get_key(acl_entry *entry, size_t *length,
return (uchar*) entry->key;
}
-#define IP_ADDR_STRLEN (3+1+3+1+3+1+3)
-#define ACL_KEY_LENGTH (IP_ADDR_STRLEN+1+NAME_LEN+1+USERNAME_LENGTH+1)
+#define IP_ADDR_STRLEN (3 + 1 + 3 + 1 + 3 + 1 + 3)
+#define ACL_KEY_LENGTH (IP_ADDR_STRLEN + 1 + NAME_LEN + \
+ 1 + USERNAME_LENGTH + 1)
#if defined(HAVE_OPENSSL)
/*
Without SSL the handshake consists of one packet. This packet
- has both client capabilites and scrambled password.
+ has both client capabilities and scrambled password.
With SSL the handshake might consist of two packets. If the first
packet (client capabilities) has CLIENT_SSL flag set, we have to
switch to SSL and read the second packet. The scrambled password
- is in the second packet and client_capabilites field will be ignored.
+ is in the second packet and client_capabilities field will be ignored.
Maybe it is better to accept flags other than CLIENT_SSL from the
second packet?
*/
@@ -291,7 +538,7 @@ static uchar* acl_entry_get_key(acl_entry *entry, size_t *length,
#define MIN_HANDSHAKE_SIZE 6
#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */
-static DYNAMIC_ARRAY acl_hosts,acl_users,acl_dbs;
+static DYNAMIC_ARRAY acl_hosts, acl_users, acl_dbs, acl_proxy_users;
static MEM_ROOT mem, memex;
static bool initialized=0;
static bool allow_all_hosts=1;
@@ -306,11 +553,9 @@ static void init_check_host(void);
static void rebuild_check_host(void);
static ACL_USER *find_acl_user(const char *host, const char *user,
my_bool exact);
-static bool update_user_table(THD *, TABLE *, const char *, const char *,
- const char *, uint);
-static void update_hostname(acl_host_and_ip *host, const char *hostname);
-static bool compare_hostname(const acl_host_and_ip *host,const char *hostname,
- const char *ip);
+static bool update_user_table(THD *thd, TABLE *table, const char *host,
+ const char *user, const char *new_password,
+ uint new_password_len);
static my_bool acl_load(THD *thd, TABLE_LIST *tables);
static my_bool grant_load(THD *thd, TABLE_LIST *tables);
static inline void get_grantor(THD *thd, char* grantor);
@@ -445,6 +690,37 @@ my_bool acl_init(bool dont_read_acl_tables)
DBUG_RETURN(return_val);
}
+/**
+ Choose from either native or old password plugins when assigning a password
+*/
+
+static bool
+set_user_plugin (ACL_USER *user, int password_len)
+{
+ switch (password_len)
+ {
+ case 0: /* no password */
+ case SCRAMBLED_PASSWORD_CHAR_LENGTH:
+ user->plugin= native_password_plugin_name;
+ return FALSE;
+ case SCRAMBLED_PASSWORD_CHAR_LENGTH_323:
+ user->plugin= old_password_plugin_name;
+ return FALSE;
+ case 45: /* 4.1: to be removed */
+ sql_print_warning("Found 4.1.0 style password for user '%s@%s'. "
+ "Ignoring user. "
+ "You should change password for this user.",
+ user->user ? user->user : "",
+ user->host.hostname ? user->host.hostname : "");
+ return TRUE;
+ default:
+ sql_print_warning("Found invalid password for user: '%s@%s'; "
+ "Ignoring user", user->user ? user->user : "",
+ user->host.hostname ? user->host.hostname : "");
+ return TRUE;
+ }
+}
+
/*
Initialize structures responsible for user/db-level privilege checking
@@ -582,9 +858,6 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
while (!(read_record_info.read_record(&read_record_info)))
{
ACL_USER user;
- char *password;
- uint password_len;
-
bzero(&user, sizeof(user));
update_hostname(&user.host, get_field(&mem, table->field[0]));
user.user= get_field(&mem, table->field[1]);
@@ -597,33 +870,14 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
continue;
}
- password= get_field(&mem, table->field[2]);
- password_len= password ? strlen(password) : 0;
+ char *password= get_field(&mem, table->field[2]);
+ uint password_len= password ? strlen(password) : 0;
user.auth_string.str= password ? password : const_cast<char*>("");
user.auth_string.length= password_len;
set_user_salt(&user, password, password_len);
- switch (password_len) {
- case 0: /* no password */
- case SCRAMBLED_PASSWORD_CHAR_LENGTH:
- user.plugin= native_password_plugin_name;
- break;
- case SCRAMBLED_PASSWORD_CHAR_LENGTH_323:
- user.plugin= old_password_plugin_name;
- break;
- case 45: /* 4.1: to be removed */
- sql_print_warning("Found 4.1.0 style password for user '%s@%s'. "
- "Ignoring user. "
- "You should change password for this user.",
- user.user ? user.user : "",
- user.host.hostname ? user.host.hostname : "");
- continue;
- default:
- sql_print_warning("Found invalid password for user: '%s@%s'; "
- "Ignoring user", user.user ? user.user : "",
- user.host.hostname ? user.host.hostname : "");
+ if (set_user_plugin(&user, password_len))
continue;
- }
{
uint next_field;
@@ -816,6 +1070,38 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
sizeof(ACL_DB),(qsort_cmp) acl_compare);
end_read_record(&read_record_info);
freeze_size(&acl_dbs);
+
+ (void) my_init_dynamic_array(&acl_proxy_users, sizeof(ACL_PROXY_USER),
+ 50, 100);
+ if (tables[3].table)
+ {
+ init_read_record(&read_record_info, thd, table= tables[3].table, NULL, 1,
+ 0, FALSE);
+ table->use_all_columns();
+ while (!(read_record_info.read_record(&read_record_info)))
+ {
+ ACL_PROXY_USER proxy;
+ proxy.init(table, &mem);
+ if (proxy.check_validity(check_no_resolve))
+ continue;
+ if (push_dynamic(&acl_proxy_users, (uchar*) &proxy))
+ {
+ end_read_record(&read_record_info);
+ goto end;
+ }
+ }
+ my_qsort((uchar*) dynamic_element(&acl_proxy_users, 0, ACL_PROXY_USER*),
+ acl_proxy_users.elements,
+ sizeof(ACL_PROXY_USER), (qsort_cmp) acl_compare);
+ end_read_record(&read_record_info);
+ }
+ else
+ {
+ sql_print_error("Missing system table mysql.proxies_priv; "
+ "please run mysql_upgrade to create it");
+ }
+ freeze_size(&acl_proxy_users);
+
init_check_host();
initialized=1;
@@ -834,6 +1120,7 @@ void acl_free(bool end)
delete_dynamic(&acl_users);
delete_dynamic(&acl_dbs);
delete_dynamic(&acl_wild_hosts);
+ delete_dynamic(&acl_proxy_users);
my_hash_free(&acl_check_hosts);
plugin_unlock(0, native_password_plugin);
plugin_unlock(0, old_password_plugin);
@@ -868,8 +1155,8 @@ void acl_free(bool end)
my_bool acl_reload(THD *thd)
{
- TABLE_LIST tables[3];
- DYNAMIC_ARRAY old_acl_hosts,old_acl_users,old_acl_dbs;
+ TABLE_LIST tables[4];
+ DYNAMIC_ARRAY old_acl_hosts, old_acl_users, old_acl_dbs, old_acl_proxy_users;
MEM_ROOT old_mem;
bool old_initialized;
my_bool return_val= TRUE;
@@ -885,9 +1172,15 @@ my_bool acl_reload(THD *thd)
C_STRING_WITH_LEN("user"), "user", TL_READ);
tables[2].init_one_table(C_STRING_WITH_LEN("mysql"),
C_STRING_WITH_LEN("db"), "db", TL_READ);
- tables[0].next_local= tables[0].next_global= tables+1;
- tables[1].next_local= tables[1].next_global= tables+2;
- tables[0].open_type= tables[1].open_type= tables[2].open_type= OT_BASE_ONLY;
+ tables[3].init_one_table(C_STRING_WITH_LEN("mysql"),
+ C_STRING_WITH_LEN("proxies_priv"),
+ "proxies_priv", TL_READ);
+ tables[0].next_local= tables[0].next_global= tables + 1;
+ tables[1].next_local= tables[1].next_global= tables + 2;
+ tables[2].next_local= tables[2].next_global= tables + 3;
+ tables[0].open_type= tables[1].open_type= tables[2].open_type=
+ tables[3].open_type= OT_BASE_ONLY;
+ tables[3].open_strategy= TABLE_LIST::OPEN_IF_EXISTS;
if (open_and_lock_tables(thd, tables, FALSE, MYSQL_LOCK_IGNORE_TIMEOUT))
{
@@ -904,10 +1197,11 @@ my_bool acl_reload(THD *thd)
if ((old_initialized=initialized))
mysql_mutex_lock(&acl_cache->lock);
- old_acl_hosts=acl_hosts;
- old_acl_users=acl_users;
- old_acl_dbs=acl_dbs;
- old_mem=mem;
+ old_acl_hosts= acl_hosts;
+ old_acl_users= acl_users;
+ old_acl_proxy_users= acl_proxy_users;
+ old_acl_dbs= acl_dbs;
+ old_mem= mem;
delete_dynamic(&acl_wild_hosts);
my_hash_free(&acl_check_hosts);
@@ -915,10 +1209,11 @@ my_bool acl_reload(THD *thd)
{ // Error. Revert to old list
DBUG_PRINT("error",("Reverting to old privileges"));
acl_free(); /* purecov: inspected */
- acl_hosts=old_acl_hosts;
- acl_users=old_acl_users;
- acl_dbs=old_acl_dbs;
- mem=old_mem;
+ acl_hosts= old_acl_hosts;
+ acl_users= old_acl_users;
+ acl_proxy_users= old_acl_proxy_users;
+ acl_dbs= old_acl_dbs;
+ mem= old_mem;
init_check_host();
}
else
@@ -926,6 +1221,7 @@ my_bool acl_reload(THD *thd)
free_root(&old_mem,MYF(0));
delete_dynamic(&old_acl_hosts);
delete_dynamic(&old_acl_users);
+ delete_dynamic(&old_acl_proxy_users);
delete_dynamic(&old_acl_dbs);
}
if (old_initialized)
@@ -1172,6 +1468,7 @@ static void acl_update_user(const char *user, const char *host,
if (fix_user_plugin_ptr(acl_user))
acl_user->plugin.str= strmake_root(&mem, plugin->str, plugin->length);
}
+#if 0
else
if (password)
{
@@ -1179,6 +1476,7 @@ static void acl_update_user(const char *user, const char *host,
acl_user->auth_string.length= password_len;
set_user_salt(acl_user, password, password_len);
}
+#endif
acl_user->access=privileges;
if (mqh->specified_limits & USER_RESOURCES::QUERIES_PER_HOUR)
acl_user->user_resource.questions=mqh->questions;
@@ -1198,6 +1496,8 @@ static void acl_update_user(const char *user, const char *host,
acl_user->x509_subject= (x509_subject ?
strdup_root(&mem,x509_subject) : 0);
}
+ if (password)
+ set_user_salt(acl_user, password, password_len);
/* search complete: */
break;
}
@@ -1238,7 +1538,6 @@ static void acl_insert_user(const char *user, const char *host,
old_password_plugin_name : native_password_plugin_name;
acl_user.auth_string.str= strmake_root(&mem, password, password_len);
acl_user.auth_string.length= password_len;
- set_user_salt(&acl_user, password, password_len);
}
acl_user.access=privileges;
@@ -1251,6 +1550,8 @@ static void acl_insert_user(const char *user, const char *host,
acl_user.x509_issuer= x509_issuer ? strdup_root(&mem,x509_issuer) : 0;
acl_user.x509_subject=x509_subject ? strdup_root(&mem,x509_subject) : 0;
+ set_user_salt(&acl_user, password, password_len);
+
(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]))
@@ -1635,6 +1936,7 @@ bool change_password(THD *thd, const char *host, const char *user,
my_message(ER_PASSWORD_NO_MATCH, ER(ER_PASSWORD_NO_MATCH), MYF(0));
goto end;
}
+
/* update loaded acl entry: */
if (acl_user->plugin.str == native_password_plugin_name.str ||
acl_user->plugin.str == old_password_plugin_name.str)
@@ -1642,7 +1944,11 @@ bool change_password(THD *thd, const char *host, const char *user,
acl_user->auth_string.str= strmake_root(&mem, new_password, new_password_len);
acl_user->auth_string.length= new_password_len;
set_user_salt(acl_user, new_password, new_password_len);
+ set_user_plugin(acl_user, new_password_len);
}
+ else
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_SET_PASSWORD_AUTH_PLUGIN, ER(ER_SET_PASSWORD_AUTH_PLUGIN));
if (update_user_table(thd, table,
acl_user->host.hostname ? acl_user->host.hostname : "",
@@ -2024,15 +2330,14 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
see also test_if_create_new_users()
*/
- else if (!password_len && no_auto_create)
+ else if (!password_len && !combo.plugin.length && no_auto_create)
{
- my_error(ER_PASSWORD_NO_MATCH, MYF(0), combo.user.str, combo.host.str);
+ my_error(ER_PASSWORD_NO_MATCH, MYF(0));
goto end;
}
else if (!can_create_user)
{
- my_error(ER_CANT_CREATE_USER_WITH_GRANT, MYF(0),
- thd->security_ctx->user, thd->security_ctx->host_or_ip);
+ my_error(ER_CANT_CREATE_USER_WITH_GRANT, MYF(0));
goto end;
}
else if (combo.plugin.str[0])
@@ -2057,6 +2362,15 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
{
old_row_exists = 1;
store_record(table,record[1]); // Save copy for update
+#if 0
+ /* what == 'N' means revoke */
+ if (combo.plugin.length && what != 'N')
+ {
+ my_error(ER_GRANT_PLUGIN_USER_EXISTS, MYF(0),
+ static_cast<int>(combo.user.length), combo.user.str);
+ goto end;
+ }
+#endif
if (combo.password.str) // If password given
table->field[2]->store(password, password_len, system_charset_info);
else if (!rights && !revoke_grant &&
@@ -2139,13 +2453,15 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
table->field[next_field+3]->store((longlong) mqh.user_conn, TRUE);
mqh_used= mqh_used || mqh.questions || mqh.updates || mqh.conn_per_hour;
- next_field+=4;
+ next_field+= 4;
if (table->s->fields >= 41 && combo.plugin.str[0])
{
table->field[next_field]->store(combo.plugin.str, combo.plugin.length,
- system_charset_info);
- table->field[next_field+1]->store(combo.auth.str, combo.auth.length,
- system_charset_info);
+ system_charset_info);
+ table->field[next_field]->set_notnull();
+ table->field[next_field + 1]->store(combo.auth.str, combo.auth.length,
+ system_charset_info);
+ table->field[next_field + 1]->set_notnull();
}
}
@@ -2319,6 +2635,164 @@ abort:
}
+static void
+acl_update_proxy_user(ACL_PROXY_USER *new_value, bool is_revoke)
+{
+ mysql_mutex_assert_owner(&acl_cache->lock);
+
+ DBUG_ENTER("acl_update_proxy_user");
+ for (uint i= 0; i < acl_proxy_users.elements; i++)
+ {
+ ACL_PROXY_USER *acl_user=
+ dynamic_element(&acl_proxy_users, i, ACL_PROXY_USER *);
+
+ if (acl_user->pk_equals(new_value))
+ {
+ if (is_revoke)
+ {
+ DBUG_PRINT("info", ("delting ACL_PROXY_USER"));
+ delete_dynamic_element(&acl_proxy_users, i);
+ }
+ else
+ {
+ DBUG_PRINT("info", ("updating ACL_PROXY_USER"));
+ acl_user->set_data(new_value);
+ }
+ break;
+ }
+ }
+ DBUG_VOID_RETURN;
+}
+
+
+static void
+acl_insert_proxy_user(ACL_PROXY_USER *new_value)
+{
+ DBUG_ENTER("acl_insert_proxy_user");
+ mysql_mutex_assert_owner(&acl_cache->lock);
+ (void) push_dynamic(&acl_proxy_users, (uchar *) new_value);
+ my_qsort((uchar*) dynamic_element(&acl_proxy_users, 0, ACL_PROXY_USER *),
+ acl_proxy_users.elements,
+ sizeof(ACL_PROXY_USER), (qsort_cmp) acl_compare);
+ DBUG_VOID_RETURN;
+}
+
+
+static int
+replace_proxies_priv_table(THD *thd, TABLE *table, const LEX_USER *user,
+ const LEX_USER *proxied_user, bool with_grant_arg,
+ bool revoke_grant)
+{
+ bool old_row_exists= 0;
+ int error;
+ uchar user_key[MAX_KEY_LENGTH];
+ ACL_PROXY_USER new_grant;
+ char grantor[USER_HOST_BUFF_SIZE];
+
+ DBUG_ENTER("replace_proxies_priv_table");
+
+ if (!initialized)
+ {
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
+ DBUG_RETURN(-1);
+ }
+
+ /* Check if there is such a user in user table in memory? */
+ if (!find_acl_user(user->host.str,user->user.str, FALSE))
+ {
+ my_message(ER_PASSWORD_NO_MATCH, ER(ER_PASSWORD_NO_MATCH), MYF(0));
+ DBUG_RETURN(-1);
+ }
+
+ table->use_all_columns();
+ ACL_PROXY_USER::store_pk (table, &user->host, &user->user,
+ &proxied_user->host, &proxied_user->user);
+
+ key_copy(user_key, table->record[0], table->key_info,
+ table->key_info->key_length);
+
+ get_grantor(thd, grantor);
+
+ table->file->ha_index_init(0, 1);
+ if (table->file->index_read_map(table->record[0], user_key,
+ HA_WHOLE_KEY,
+ HA_READ_KEY_EXACT))
+ {
+ DBUG_PRINT ("info", ("Row not found"));
+ if (revoke_grant)
+ { // no row, no revoke
+ my_error(ER_NONEXISTING_GRANT, MYF(0), user->user.str, user->host.str);
+ goto abort;
+ }
+ old_row_exists= 0;
+ restore_record(table, s->default_values);
+ ACL_PROXY_USER::store_data_record(table, &user->host, &user->user,
+ &proxied_user->host,
+ &proxied_user->user,
+ with_grant_arg,
+ grantor);
+ }
+ else
+ {
+ DBUG_PRINT("info", ("Row found"));
+ old_row_exists= 1;
+ store_record(table, record[1]);
+ }
+
+ if (old_row_exists)
+ {
+ /* update old existing row */
+ if (!revoke_grant)
+ {
+ if ((error= table->file->ha_update_row(table->record[1],
+ table->record[0])) &&
+ error != HA_ERR_RECORD_IS_THE_SAME)
+ goto table_error; /* purecov: inspected */
+ }
+ else
+ {
+ if ((error= table->file->ha_delete_row(table->record[1])))
+ goto table_error; /* purecov: inspected */
+ }
+ }
+ else if ((error= table->file->ha_write_row(table->record[0])))
+ {
+ DBUG_PRINT("info", ("error inserting the row"));
+ if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
+ goto table_error; /* purecov: inspected */
+ }
+
+ acl_cache->clear(1); // Clear privilege cache
+ if (old_row_exists)
+ {
+ new_grant.init(user->host.str, user->user.str,
+ proxied_user->host.str, proxied_user->user.str,
+ with_grant_arg);
+ acl_update_proxy_user(&new_grant, revoke_grant);
+ }
+ else
+ {
+ new_grant.init(&mem, user->host.str, user->user.str,
+ proxied_user->host.str, proxied_user->user.str,
+ with_grant_arg);
+ acl_insert_proxy_user(&new_grant);
+ }
+
+ table->file->ha_index_end();
+ DBUG_RETURN(0);
+
+ /* This could only happen if the grant tables got corrupted */
+table_error:
+ DBUG_PRINT("info", ("table error"));
+ table->file->print_error(error, MYF(0)); /* purecov: inspected */
+
+abort:
+ DBUG_PRINT("info", ("aborting replace_proxies_priv_table"));
+ table->file->ha_index_end();
+ DBUG_RETURN(-1);
+}
+
+
class GRANT_COLUMN :public Sql_alloc
{
public:
@@ -3221,6 +3695,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
{ // Should never happen
/* Restore the state of binlog format */
DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row());
+ thd->lex->restore_backup_query_tables_list(&backup);
if (save_binlog_row_based)
thd->set_current_stmt_binlog_format_row();
DBUG_RETURN(TRUE); /* purecov: deadcode */
@@ -3535,10 +4010,10 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc,
bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
- ulong rights, bool revoke_grant)
+ ulong rights, bool revoke_grant, bool is_proxy)
{
List_iterator <LEX_USER> str_list (list);
- LEX_USER *Str, *tmp_Str;
+ LEX_USER *Str, *tmp_Str, *proxied_user= NULL;
char tmp_db[SAFE_NAME_LEN+1];
bool create_new_users=0;
TABLE_LIST tables[2];
@@ -3558,11 +4033,26 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
db=tmp_db;
}
- /* open the mysql.user and mysql.db tables */
+ if (is_proxy)
+ {
+ DBUG_ASSERT(!db);
+ proxied_user= str_list++;
+ }
+
+ /* open the mysql.user and mysql.db or mysql.proxies_priv tables */
tables[0].init_one_table(C_STRING_WITH_LEN("mysql"),
C_STRING_WITH_LEN("user"), "user", TL_WRITE);
- tables[1].init_one_table(C_STRING_WITH_LEN("mysql"),
- C_STRING_WITH_LEN("db"), "db", TL_WRITE);
+ if (is_proxy)
+
+ tables[1].init_one_table(C_STRING_WITH_LEN("mysql"),
+ C_STRING_WITH_LEN("proxies_priv"),
+ "proxies_priv",
+ TL_WRITE);
+ else
+ tables[1].init_one_table(C_STRING_WITH_LEN("mysql"),
+ C_STRING_WITH_LEN("db"),
+ "db",
+ TL_WRITE);
tables[0].next_local= tables[0].next_global= tables+1;
/*
@@ -3648,6 +4138,13 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
result= -1;
}
}
+ else if (is_proxy)
+ {
+ if (replace_proxies_priv_table (thd, tables[1].table, Str, proxied_user,
+ rights & GRANT_ACL ? TRUE : FALSE,
+ revoke_grant))
+ result= -1;
+ }
}
mysql_mutex_unlock(&acl_cache->lock);
@@ -4070,7 +4567,8 @@ end:
bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
bool any_combination_will_do, uint number, bool no_errors)
{
- TABLE_LIST *table, *first_not_own_table= thd->lex->first_not_own_table();
+ TABLE_LIST *tl;
+ TABLE_LIST *first_not_own_table= thd->lex->first_not_own_table();
Security_context *sctx= thd->security_ctx;
uint i;
ulong orig_want_access= want_access;
@@ -4087,34 +4585,32 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
the given table list refers to the list for prelocking (contains tables
of other queries). For simple queries first_not_own_table is 0.
*/
- for (i= 0, table= tables;
- i < number && table != first_not_own_table;
- table= table->next_global, i++)
+ for (i= 0, tl= tables;
+ i < number && tl != first_not_own_table;
+ tl= tl->next_global, i++)
{
/*
Save a copy of the privileges without the SHOW_VIEW_ACL attribute.
It will be checked during making view.
*/
- table->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL);
+ tl->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL);
}
mysql_rwlock_rdlock(&LOCK_grant);
- for (table= tables;
- table && number-- && table != first_not_own_table;
- table= table->next_global)
+ for (tl= tables;
+ tl && number-- && tl != first_not_own_table;
+ tl= tl->next_global)
{
- GRANT_TABLE *grant_table;
- sctx = test(table->security_ctx) ?
- table->security_ctx : thd->security_ctx;
+ sctx = test(tl->security_ctx) ? tl->security_ctx : thd->security_ctx;
- const ACL_internal_table_access *access;
- access= get_cached_table_access(&table->grant.m_internal,
- table->get_db_name(),
- table->get_table_name());
+ const ACL_internal_table_access *access=
+ get_cached_table_access(&tl->grant.m_internal,
+ tl->get_db_name(),
+ tl->get_table_name());
if (access)
{
- switch(access->check(orig_want_access, &table->grant.privilege))
+ switch(access->check(orig_want_access, &tl->grant.privilege))
{
case ACL_INTERNAL_ACCESS_GRANTED:
/*
@@ -4138,29 +4634,33 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
if (!want_access)
continue; // ok
- if (!(~table->grant.privilege & want_access) ||
- table->is_anonymous_derived_table() || table->schema_table)
+ if (!(~tl->grant.privilege & want_access) ||
+ tl->is_anonymous_derived_table() || tl->schema_table)
{
/*
- It is subquery in the FROM clause. VIEW set table->derived after
+ It is subquery in the FROM clause. VIEW set tl->derived after
table opening, but this function always called before table opening.
*/
- if (!table->referencing_view)
+ if (!tl->referencing_view)
{
/*
If it's a temporary table created for a subquery in the FROM
clause, or an INFORMATION_SCHEMA table, drop the request for
a privilege.
*/
- table->grant.want_privilege= 0;
+ tl->grant.want_privilege= 0;
}
continue;
}
- if (!(grant_table= table_hash_search(sctx->host, sctx->ip,
- table->get_db_name(), sctx->priv_user,
- table->get_table_name(), FALSE)))
+ GRANT_TABLE *grant_table= table_hash_search(sctx->host, sctx->ip,
+ tl->get_db_name(),
+ sctx->priv_user,
+ tl->get_table_name(),
+ FALSE);
+
+ if (!grant_table)
{
- want_access &= ~table->grant.privilege;
+ want_access &= ~tl->grant.privilege;
goto err; // No grants
}
@@ -4171,18 +4671,17 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
if (any_combination_will_do)
continue;
- table->grant.grant_table=grant_table; // Remember for column test
- table->grant.version=grant_version;
- table->grant.privilege|= grant_table->privs;
- table->grant.want_privilege= ((want_access & COL_ACLS)
- & ~table->grant.privilege);
+ tl->grant.grant_table= grant_table; // Remember for column test
+ tl->grant.version= grant_version;
+ tl->grant.privilege|= grant_table->privs;
+ tl->grant.want_privilege= ((want_access & COL_ACLS) & ~tl->grant.privilege);
- if (!(~table->grant.privilege & want_access))
+ if (!(~tl->grant.privilege & want_access))
continue;
- if (want_access & ~(grant_table->cols | table->grant.privilege))
+ if (want_access & ~(grant_table->cols | tl->grant.privilege))
{
- want_access &= ~(grant_table->cols | table->grant.privilege);
+ want_access &= ~(grant_table->cols | tl->grant.privilege);
goto err; // impossible
}
}
@@ -4201,7 +4700,7 @@ err:
command,
sctx->priv_user,
sctx->host_or_ip,
- table ? table->get_table_name() : "unknown");
+ tl ? tl->get_table_name() : "unknown");
}
DBUG_RETURN(TRUE);
}
@@ -5093,6 +5592,12 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user)
goto end;
}
+ if (show_proxy_grants(thd, lex_user, buff, sizeof(buff)))
+ {
+ error= -1;
+ goto end;
+ }
+
end:
mysql_mutex_unlock(&acl_cache->lock);
mysql_rwlock_unlock(&LOCK_grant);
@@ -5250,7 +5755,7 @@ void get_mqh(const char *user, const char *host, USER_CONN *uc)
< 0 Error.
*/
-#define GRANT_TABLES 5
+#define GRANT_TABLES 6
int open_grant_tables(THD *thd, TABLE_LIST *tables)
{
DBUG_ENTER("open_grant_tables");
@@ -5274,10 +5779,16 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
(tables+4)->init_one_table(C_STRING_WITH_LEN("mysql"),
C_STRING_WITH_LEN("procs_priv"),
"procs_priv", TL_WRITE);
- tables->next_local= tables->next_global= tables+1;
- (tables+1)->next_local= (tables+1)->next_global= tables+2;
- (tables+2)->next_local= (tables+2)->next_global= tables+3;
- (tables+3)->next_local= (tables+3)->next_global= tables+4;
+ (tables+5)->init_one_table(C_STRING_WITH_LEN("mysql"),
+ C_STRING_WITH_LEN("proxies_priv"),
+ "proxies_priv", TL_WRITE);
+ tables[5].open_strategy= TABLE_LIST::OPEN_IF_EXISTS;
+
+ tables->next_local= tables->next_global= tables + 1;
+ (tables+1)->next_local= (tables+1)->next_global= tables + 2;
+ (tables+2)->next_local= (tables+2)->next_global= tables + 3;
+ (tables+3)->next_local= (tables+3)->next_global= tables + 4;
+ (tables+4)->next_local= (tables+4)->next_global= tables + 5;
#ifdef HAVE_REPLICATION
/*
@@ -5290,12 +5801,12 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
The tables must be marked "updating" so that tables_ok() takes them into
account in tests.
*/
- tables[0].updating=tables[1].updating=tables[2].updating=
- tables[3].updating=tables[4].updating=1;
+ tables[0].updating= tables[1].updating= tables[2].updating=
+ tables[3].updating= tables[4].updating= tables[5].updating= 1;
if (!(thd->spcont || rpl_filter->tables_ok(0, tables)))
DBUG_RETURN(1);
- tables[0].updating=tables[1].updating=tables[2].updating=
- tables[3].updating=tables[4].updating=0;;
+ tables[0].updating= tables[1].updating= tables[2].updating=
+ tables[3].updating= tables[4].updating= tables[5].updating= 0;
}
#endif
@@ -5424,7 +5935,7 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop,
int error;
TABLE *table= tables[table_no].table;
Field *host_field= table->field[0];
- Field *user_field= table->field[table_no ? 2 : 1];
+ Field *user_field= table->field[table_no && table_no != 5 ? 2 : 1];
char *host_str= user_from->host.str;
char *user_str= user_from->user.str;
const char *host;
@@ -5507,12 +6018,15 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop,
user= "";
#ifdef EXTRA_DEBUG
- DBUG_PRINT("loop",("scan fields: '%s'@'%s' '%s' '%s' '%s'",
- user, host,
- get_field(thd->mem_root, table->field[1]) /*db*/,
- get_field(thd->mem_root, table->field[3]) /*table*/,
- get_field(thd->mem_root,
- table->field[4]) /*column*/));
+ if (table_no != 5)
+ {
+ DBUG_PRINT("loop",("scan fields: '%s'@'%s' '%s' '%s' '%s'",
+ user, host,
+ get_field(thd->mem_root, table->field[1]) /*db*/,
+ get_field(thd->mem_root, table->field[3]) /*table*/,
+ get_field(thd->mem_root,
+ table->field[4]) /*column*/));
+ }
#endif
if (strcmp(user_str, user) ||
my_strcasecmp(system_charset_info, host_str, host))
@@ -5535,18 +6049,15 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop,
}
-/*
+/**
Handle an in-memory privilege structure.
- SYNOPSIS
- handle_grant_struct()
- struct_no The number of the structure to handle (0..3).
- drop If user_from is to be dropped.
- user_from The the user to be searched/dropped/renamed.
- user_to The new name for the user if to be renamed,
- NULL otherwise.
+ @param struct_no The number of the structure to handle (0..5).
+ @param drop If user_from is to be dropped.
+ @param user_from The the user to be searched/dropped/renamed.
+ @param user_to The new name for the user if to be renamed, NULL otherwise.
- DESCRIPTION
+ @note
Scan through all elements in an in-memory grant structure and apply
the requested operation.
Delete from grant structure if drop is true.
@@ -5556,12 +6067,13 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop,
0 acl_users
1 acl_dbs
2 column_priv_hash
- 3 procs_priv_hash
+ 3 proc_priv_hash
+ 4 func_priv_hash
+ 5 acl_proxy_users
- RETURN
- > 0 At least one element matched.
- 0 OK, but no element matched.
- -1 Wrong arguments to function
+ @retval > 0 At least one element matched.
+ @retval 0 OK, but no element matched.
+ @retval -1 Wrong arguments to function.
*/
static int handle_grant_struct(uint struct_no, bool drop,
@@ -5574,7 +6086,9 @@ static int handle_grant_struct(uint struct_no, bool drop,
const char *host;
ACL_USER *acl_user= NULL;
ACL_DB *acl_db= NULL;
+ ACL_PROXY_USER *acl_proxy_user= NULL;
GRANT_NAME *grant_name= NULL;
+ HASH *grant_name_hash= NULL;
DBUG_ENTER("handle_grant_struct");
DBUG_PRINT("info",("scan struct: %u search: '%s'@'%s'",
struct_no, user_from->user.str, user_from->host.str));
@@ -5594,9 +6108,18 @@ static int handle_grant_struct(uint struct_no, bool drop,
break;
case 2:
elements= column_priv_hash.records;
+ grant_name_hash= &column_priv_hash;
break;
case 3:
elements= proc_priv_hash.records;
+ grant_name_hash= &proc_priv_hash;
+ break;
+ case 4:
+ elements= func_priv_hash.records;
+ grant_name_hash= &func_priv_hash;
+ break;
+ case 5:
+ elements= acl_proxy_users.elements;
break;
default:
return -1;
@@ -5626,16 +6149,19 @@ static int handle_grant_struct(uint struct_no, bool drop,
break;
case 2:
- grant_name= (GRANT_NAME*) my_hash_element(&column_priv_hash, idx);
+ case 3:
+ case 4:
+ grant_name= (GRANT_NAME*) my_hash_element(grant_name_hash, idx);
user= grant_name->user;
host= grant_name->host.hostname;
break;
- case 3:
- grant_name= (GRANT_NAME*) my_hash_element(&proc_priv_hash, idx);
- user= grant_name->user;
- host= grant_name->host.hostname;
+ case 5:
+ acl_proxy_user= dynamic_element(&acl_proxy_users, idx, ACL_PROXY_USER*);
+ user= acl_proxy_user->get_user();
+ host= acl_proxy_user->get_host();
break;
+
default:
DBUG_ASSERT(0);
}
@@ -5665,14 +6191,30 @@ static int handle_grant_struct(uint struct_no, bool drop,
break;
case 2:
- my_hash_delete(&column_priv_hash, (uchar*) grant_name);
- break;
-
case 3:
- my_hash_delete(&proc_priv_hash, (uchar*) grant_name);
+ case 4:
+ my_hash_delete(grant_name_hash, (uchar*) grant_name);
break;
+
+ case 5:
+ delete_dynamic_element(&acl_proxy_users, idx);
+ break;
+
}
elements--;
+ /*
+ - If we are iterating through an array then we just have moved all
+ elements after the current element one position closer to its head.
+ This means that we have to take another look at the element at
+ current position as it is a new element from the array's tail.
+ - If we are iterating through a hash the current element was replaced
+ with one of elements from the tail. So we also have to take a look
+ at the new element in current position.
+ Note that in our HASH implementation hash_delete() won't move any
+ elements with position after current one to position before the
+ current (i.e. from the tail to the head), so it is safe to continue
+ iteration without re-starting.
+ */
idx--;
}
else if ( user_to )
@@ -5690,22 +6232,47 @@ static int handle_grant_struct(uint struct_no, bool drop,
case 2:
case 3:
- /*
- Update the grant structure with the new user name and
- host name
- */
- grant_name->set_user_details(user_to->host.str, grant_name->db,
- user_to->user.str, grant_name->tname,
- TRUE);
+ case 4:
+ {
+ /*
+ Save old hash key and its length to be able properly update
+ element position in hash.
+ */
+ char *old_key= grant_name->hash_key;
+ size_t old_key_length= grant_name->key_length;
+
+ /*
+ Update the grant structure with the new user name and host name.
+ */
+ grant_name->set_user_details(user_to->host.str, grant_name->db,
+ user_to->user.str, grant_name->tname,
+ TRUE);
+
+ /*
+ Since username is part of the hash key, when the user name
+ is renamed, the hash key is changed. Update the hash to
+ ensure that the position matches the new hash key value
+ */
+ my_hash_update(grant_name_hash, (uchar*) grant_name, (uchar*) old_key,
+ old_key_length);
+ /*
+ hash_update() operation could have moved element from the tail
+ of the hash to the current position. So we need to take a look
+ at the element in current position once again.
+ Thanks to the fact that hash_update() for our HASH implementation
+ won't move any elements from the tail of the hash to the positions
+ before the current one (a.k.a. head) it is safe to continue
+ iteration without restarting.
+ */
+ idx--;
+ break;
+ }
+
+ case 5:
+ acl_proxy_user->set_user (&mem, user_to->user.str);
+ acl_proxy_user->set_host (&mem, user_to->host.str);
+ break;
- /*
- Since username is part of the hash key, when the user name
- is renamed, the hash key is changed. Update the hash to
- ensure that the position matches the new hash key value
- */
- my_hash_update(&column_priv_hash, (uchar*) grant_name,
- (uchar*) grant_name->hash_key, grant_name->key_length);
- break;
}
}
else
@@ -5791,7 +6358,7 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop,
}
}
- /* Handle procedures table. */
+ /* Handle stored routines table. */
if ((found= handle_grant_table(tables, 4, drop, user_from, user_to)) < 0)
{
/* Handle of table failed, don't touch in-memory array. */
@@ -5808,6 +6375,15 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop,
if (! drop && ! user_to)
goto end;
}
+ /* Handle funcs array. */
+ if (((handle_grant_struct(4, drop, user_from, user_to) && ! result) ||
+ found) && ! result)
+ {
+ result= 1; /* At least one record/element found. */
+ /* If search is requested, we do not need to search further. */
+ if (! drop && ! user_to)
+ goto end;
+ }
}
/* Handle tables table. */
@@ -5840,6 +6416,23 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop,
result= 1; /* At least one record/element found. */
}
}
+
+ /* Handle proxies_priv table. */
+ if (tables[5].table)
+ {
+ if ((found= handle_grant_table(tables, 5, drop, user_from, user_to)) < 0)
+ {
+ /* Handle of table failed, don't touch the in-memory array. */
+ result= -1;
+ }
+ else
+ {
+ /* Handle proxies_priv array. */
+ if ((handle_grant_struct(5, drop, user_from, user_to) && !result) ||
+ found)
+ result= 1; /* At least one record/element found. */
+ }
+ }
end:
DBUG_RETURN(result);
}
@@ -6596,6 +7189,129 @@ template class List<LEX_COLUMN>;
template class List<LEX_USER>;
#endif
+/**
+ Validate if a user can proxy as another user
+
+ @thd current thread
+ @param user the logged in user (proxy user)
+ @param authenticated_as the effective user a plugin is trying to
+ impersonate as (proxied user)
+ @return proxy user definition
+ @retval NULL proxy user definition not found or not applicable
+ @retval non-null the proxy user data
+*/
+
+static ACL_PROXY_USER *
+acl_find_proxy_user(const char *user, const char *host, const char *ip,
+ const char *authenticated_as, bool *proxy_used)
+{
+ uint i;
+ /* if the proxied and proxy user are the same return OK */
+ DBUG_ENTER("acl_find_proxy_user");
+ DBUG_PRINT("info", ("user=%s host=%s ip=%s authenticated_as=%s",
+ user, host, ip, authenticated_as));
+
+ if (!strcmp(authenticated_as, user))
+ {
+ DBUG_PRINT ("info", ("user is the same as authenticated_as"));
+ DBUG_RETURN (NULL);
+ }
+
+ *proxy_used= TRUE;
+ for (i=0; i < acl_proxy_users.elements; i++)
+ {
+ ACL_PROXY_USER *proxy= dynamic_element(&acl_proxy_users, i,
+ ACL_PROXY_USER *);
+ if (proxy->matches(host, user, ip, authenticated_as))
+ DBUG_RETURN(proxy);
+ }
+
+ DBUG_RETURN(NULL);
+}
+
+
+bool
+acl_check_proxy_grant_access(THD *thd, const char *host, const char *user,
+ bool with_grant)
+{
+ DBUG_ENTER("acl_check_proxy_grant_access");
+ DBUG_PRINT("info", ("user=%s host=%s with_grant=%d", user, host,
+ (int) with_grant));
+ if (!initialized)
+ {
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
+ DBUG_RETURN(1);
+ }
+
+ /* replication slave thread can do anything */
+ if (thd->slave_thread)
+ {
+ DBUG_PRINT("info", ("replication slave"));
+ DBUG_RETURN(FALSE);
+ }
+
+ /* one can grant proxy to himself to others */
+ if (!strcmp(thd->security_ctx->user, user) &&
+ !my_strcasecmp(system_charset_info, host,
+ thd->security_ctx->host))
+ {
+ DBUG_PRINT("info", ("strcmp (%s, %s) my_casestrcmp (%s, %s) equal",
+ thd->security_ctx->user, user,
+ host, thd->security_ctx->host));
+ DBUG_RETURN(FALSE);
+ }
+
+ /* check for matching WITH PROXY rights */
+ for (uint i=0; i < acl_proxy_users.elements; i++)
+ {
+ ACL_PROXY_USER *proxy= dynamic_element(&acl_proxy_users, i,
+ ACL_PROXY_USER *);
+ if (proxy->matches(thd->security_ctx->host,
+ thd->security_ctx->user,
+ thd->security_ctx->ip,
+ user) &&
+ proxy->get_with_grant())
+ {
+ DBUG_PRINT("info", ("found"));
+ DBUG_RETURN(FALSE);
+ }
+ }
+
+ my_error(ER_ACCESS_DENIED_NO_PASSWORD_ERROR, MYF(0),
+ thd->security_ctx->user,
+ thd->security_ctx->host_or_ip);
+ DBUG_RETURN(TRUE);
+}
+
+
+static bool
+show_proxy_grants(THD *thd, LEX_USER *user, char *buff, size_t buffsize)
+{
+ Protocol *protocol= thd->protocol;
+ int error= 0;
+
+ for (uint i=0; i < acl_proxy_users.elements; i++)
+ {
+ ACL_PROXY_USER *proxy= dynamic_element(&acl_proxy_users, i,
+ ACL_PROXY_USER *);
+ if (proxy->granted_on(user->host.str, user->user.str))
+ {
+ String global(buff, buffsize, system_charset_info);
+ global.length(0);
+ proxy->print_grant(&global);
+ protocol->prepare_for_resend();
+ protocol->store(global.ptr(), global.length(), global.charset());
+ if (protocol->write())
+ {
+ error= -1;
+ break;
+ }
+ }
+ }
+ return error;
+}
+
+
#endif /*NO_EMBEDDED_ACCESS_CHECKS */
@@ -7183,18 +7899,17 @@ get_cached_table_access(GRANT_INTERNAL_INFO *grant_internal_info,
#ifndef HAVE_OPENSSL
#define ssl_acceptor_fd 0
#define sslaccept(A,B,C,D) 1
-#define NORMAL_HANDSHAKE_SIZE 6
#endif
/**
The internal version of what plugins know as MYSQL_PLUGIN_VIO,
basically the context of the authentication session
*/
-struct MPVIO_EXT : public MYSQL_PLUGIN_VIO
+struct MPVIO_EXT :public MYSQL_PLUGIN_VIO
{
MYSQL_SERVER_AUTH_INFO auth_info;
THD *thd;
- ACL_USER *acl_user; ///< a copy, independent from acl_users array
+ const ACL_USER *acl_user; ///< a copy, independent from acl_users array
plugin_ref plugin; ///< what plugin we're under
LEX_STRING db; ///< db name from the handshake packet
/** when restarting a plugin this caches the last client reply */
@@ -7213,18 +7928,16 @@ struct MPVIO_EXT : public MYSQL_PLUGIN_VIO
enum { SUCCESS, FAILURE, RESTART } status;
};
-
/**
a helper function to report an access denied error in all the proper places
*/
-
-static void login_failed_error(THD *thd, bool passwd_used)
+static void login_failed_error(THD *thd, int passwd_used)
{
- my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
+ my_error(access_denied_error_code(passwd_used), MYF(0),
thd->main_security_ctx.user,
thd->main_security_ctx.host_or_ip,
passwd_used ? ER(ER_YES) : ER(ER_NO));
- general_log_print(thd, COM_CONNECT, ER(ER_ACCESS_DENIED_ERROR),
+ general_log_print(thd, COM_CONNECT, ER(access_denied_error_code(passwd_used)),
thd->main_security_ctx.user,
thd->main_security_ctx.host_or_ip,
passwd_used ? ER(ER_YES) : ER(ER_NO));
@@ -7236,14 +7949,13 @@ static void login_failed_error(THD *thd, bool passwd_used)
*/
if (global_system_variables.log_warnings > 1)
{
- sql_print_warning(ER(ER_ACCESS_DENIED_ERROR),
+ sql_print_warning(ER(access_denied_error_code(passwd_used)),
thd->main_security_ctx.user,
thd->main_security_ctx.host_or_ip,
passwd_used ? ER(ER_YES) : ER(ER_NO));
}
}
-
/**
sends a server handshake initialization packet, the very first packet
after the connection was established
@@ -7269,7 +7981,6 @@ static void login_failed_error(THD *thd, bool passwd_used)
@retval 0 ok
@retval 1 error
*/
-
static bool send_server_handshake_packet(MPVIO_EXT *mpvio,
const char *data, uint data_len)
{
@@ -7277,14 +7988,26 @@ static bool send_server_handshake_packet(MPVIO_EXT *mpvio,
DBUG_ASSERT(data_len <= 255);
THD *thd= mpvio->thd;
- char *buff= (char *)my_alloca(1 + SERVER_VERSION_LENGTH + 1 + data_len + 64);
+ char *buff= (char *) my_alloca(1 + SERVER_VERSION_LENGTH + 1 + data_len + 64);
char scramble_buf[SCRAMBLE_LENGTH];
char *end= buff;
+ DBUG_ENTER("send_server_handshake_packet");
*end++= protocol_version;
thd->client_capabilities= CLIENT_BASIC_FLAGS;
+ if (opt_using_transactions)
+ thd->client_capabilities|= CLIENT_TRANSACTIONS;
+
+ thd->client_capabilities|= CAN_CLIENT_COMPRESS;
+
+ if (ssl_acceptor_fd)
+ {
+ thd->client_capabilities |= CLIENT_SSL;
+ thd->client_capabilities |= CLIENT_SSL_VERIFY_SERVER_CERT;
+ }
+
if (data_len)
{
mpvio->cached_server_packet.pkt= (char*)thd->memdup(data, data_len);
@@ -7294,12 +8017,13 @@ static bool send_server_handshake_packet(MPVIO_EXT *mpvio,
if (data_len < SCRAMBLE_LENGTH)
{
if (data_len)
- { /*
+ {
+ /*
the first packet *must* have at least 20 bytes of a scramble.
if a plugin provided less, we pad it to 20 with zeros
*/
memcpy(scramble_buf, data, data_len);
- bzero(scramble_buf+data_len, SCRAMBLE_LENGTH-data_len);
+ bzero(scramble_buf + data_len, SCRAMBLE_LENGTH - data_len);
data= scramble_buf;
}
else
@@ -7319,17 +8043,6 @@ static bool send_server_handshake_packet(MPVIO_EXT *mpvio,
data_len= SCRAMBLE_LENGTH;
}
- if (opt_using_transactions)
- thd->client_capabilities|= CLIENT_TRANSACTIONS;
-
- thd->client_capabilities|= CAN_CLIENT_COMPRESS;
-
- if (ssl_acceptor_fd)
- {
- thd->client_capabilities |= CLIENT_SSL;
- thd->client_capabilities |= CLIENT_SSL_VERIFY_SERVER_CERT;
- }
-
end= strnmov(end, server_version, SERVER_VERSION_LENGTH) + 1;
int4store((uchar*) end, mpvio->thd->thread_id);
end+= 4;
@@ -7339,29 +8052,30 @@ static bool send_server_handshake_packet(MPVIO_EXT *mpvio,
tail: that's why first part of the scramble is placed here, and second
part at the end of packet.
*/
- end= (char*)memcpy(end, data, SCRAMBLE_LENGTH_323);
+ end= (char*) memcpy(end, data, SCRAMBLE_LENGTH_323);
end+= SCRAMBLE_LENGTH_323;
*end++= 0;
int2store(end, thd->client_capabilities);
/* write server characteristics: up to 16 bytes allowed */
- end[2]=(char) default_charset_info->number;
+ end[2]= (char) default_charset_info->number;
int2store(end+3, mpvio->thd->server_status);
int2store(end+5, thd->client_capabilities >> 16);
end[7]= data_len;
- bzero(end+8, 10);
+ bzero(end + 8, 10);
end+= 18;
/* write scramble tail */
- end= (char*)memcpy(end, data + SCRAMBLE_LENGTH_323,
- data_len - SCRAMBLE_LENGTH_323);
+ end= (char*) memcpy(end, data + SCRAMBLE_LENGTH_323,
+ data_len - SCRAMBLE_LENGTH_323);
end+= data_len - SCRAMBLE_LENGTH_323;
end= strmake(end, plugin_name(mpvio->plugin)->str,
plugin_name(mpvio->plugin)->length);
- int res= my_net_write(&mpvio->thd->net, (uchar*) buff, (size_t) (end-buff)) ||
+ int res= my_net_write(&mpvio->thd->net, (uchar*) buff,
+ (size_t) (end - buff + 1)) ||
net_flush(&mpvio->thd->net);
my_afree(buff);
- return res;
+ DBUG_RETURN (res);
}
static bool secure_auth(THD *thd)
@@ -7411,7 +8125,6 @@ static bool secure_auth(THD *thd)
@retval 0 ok
@retval 1 error
*/
-
static bool send_plugin_request_packet(MPVIO_EXT *mpvio,
const uchar *data, uint data_len)
{
@@ -7419,12 +8132,12 @@ static bool send_plugin_request_packet(MPVIO_EXT *mpvio,
DBUG_ASSERT(mpvio->packets_read == 1);
NET *net= &mpvio->thd->net;
static uchar switch_plugin_request_buf[]= { 254 };
-
+ DBUG_ENTER("send_plugin_request_packet");
mpvio->status= MPVIO_EXT::FAILURE; // the status is no longer RESTART
const char *client_auth_plugin=
- ((st_mysql_auth *)(plugin_decl(mpvio->plugin)->info))->client_auth_plugin;
+ ((st_mysql_auth *) (plugin_decl(mpvio->plugin)->info))->client_auth_plugin;
DBUG_ASSERT(client_auth_plugin);
DBUG_ASSERT(my_strcasecmp(system_charset_info, client_auth_plugin,
@@ -7444,9 +8157,9 @@ static bool send_plugin_request_packet(MPVIO_EXT *mpvio,
client_auth_plugin == old_password_plugin_name.str;
if (switch_from_long_to_short_scramble)
- return secure_auth(mpvio->thd) ||
- my_net_write(net, switch_plugin_request_buf, 1) ||
- net_flush(net);
+ DBUG_RETURN (secure_auth(mpvio->thd) ||
+ my_net_write(net, switch_plugin_request_buf, 1) ||
+ net_flush(net));
/*
We never request a client to switch from a short to long scramble.
@@ -7461,16 +8174,17 @@ static bool send_plugin_request_packet(MPVIO_EXT *mpvio,
{
my_error(ER_NOT_SUPPORTED_AUTH_MODE, MYF(0));
general_log_print(mpvio->thd, COM_CONNECT, ER(ER_NOT_SUPPORTED_AUTH_MODE));
- return 1;
+ DBUG_RETURN (1);
}
- return net_write_command(net, switch_plugin_request_buf[0],
- (uchar*)client_auth_plugin,
- strlen(client_auth_plugin)+1,
- (uchar*)data, data_len);
+ DBUG_PRINT("info", ("requesting client to use the %s plugin",
+ client_auth_plugin));
+ DBUG_RETURN(net_write_command(net, switch_plugin_request_buf[0],
+ (uchar*) client_auth_plugin,
+ strlen(client_auth_plugin) + 1,
+ (uchar*) data, data_len));
}
-
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/**
Finds acl entry in user database for authentication purposes.
@@ -7484,15 +8198,16 @@ static bool send_plugin_request_packet(MPVIO_EXT *mpvio,
@retval 0 found
@retval 1 not found
*/
-
-static bool find_mpvio_user(MPVIO_EXT *mpvio, Security_context *sctx)
+static bool find_mpvio_user(MPVIO_EXT *mpvio)
{
+ Security_context *sctx= mpvio->thd->security_ctx;
+ DBUG_ENTER("find_mpvio_user");
DBUG_ASSERT(mpvio->acl_user == 0);
mysql_mutex_lock(&acl_cache->lock);
- for (uint i=0 ; i < acl_users.elements ; i++)
+ for (uint i=0; i < acl_users.elements; i++)
{
- ACL_USER *acl_user_tmp= dynamic_element(&acl_users,i,ACL_USER*);
+ ACL_USER *acl_user_tmp= dynamic_element(&acl_users, i, ACL_USER*);
if ((!acl_user_tmp->user || !strcmp(sctx->user, acl_user_tmp->user)) &&
compare_hostname(&acl_user_tmp->host, sctx->host, sctx->ip))
{
@@ -7505,7 +8220,7 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio, Security_context *sctx)
if (!mpvio->acl_user)
{
login_failed_error(mpvio->thd, 0);
- return 1;
+ DBUG_RETURN (1);
}
/* user account requires non-default plugin and the client is too old */
@@ -7519,19 +8234,27 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio, Security_context *sctx)
old_password_plugin_name.str));
my_error(ER_NOT_SUPPORTED_AUTH_MODE, MYF(0));
general_log_print(mpvio->thd, COM_CONNECT, ER(ER_NOT_SUPPORTED_AUTH_MODE));
- return 1;
+ DBUG_RETURN (1);
}
mpvio->auth_info.user_name= sctx->user;
+ mpvio->auth_info.user_name_length= user_len;
mpvio->auth_info.auth_string= mpvio->acl_user->auth_string.str;
+ mpvio->auth_info.auth_string_length=
+ (unsigned long) mpvio->acl_user->auth_string.length;
strmake(mpvio->auth_info.authenticated_as, mpvio->acl_user->user ?
mpvio->acl_user->user : "", USERNAME_LENGTH);
- return 0;
+ DBUG_PRINT("info", ("exit: user=%s, auth_string=%s, authenticated as=%s"
+ "plugin=%s",
+ mpvio->auth_info.user_name,
+ mpvio->auth_info.auth_string,
+ mpvio->auth_info.authenticated_as,
+ mpvio->acl_user->plugin.str));
+ DBUG_RETURN(0);
}
#endif
-
/* the packet format is described in send_change_user_packet() */
static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length)
{
@@ -7542,17 +8265,18 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length)
char *user= (char*) net->read_pos;
char *end= user + packet_length;
/* Safe because there is always a trailing \0 at the end of the packet */
- char *passwd= strend(user)+1;
+ char *passwd= strend(user) + 1;
uint user_len= passwd - user - 1;
char *db= passwd;
char db_buff[SAFE_NAME_LEN + 1]; // buffer to store db in utf8
char user_buff[USERNAME_LENGTH + 1]; // buffer to store user in utf8
uint dummy_errors;
+ DBUG_ENTER ("parse_com_change_user_packet");
if (passwd >= end)
{
my_message(ER_UNKNOWN_COM_ERROR, ER(ER_UNKNOWN_COM_ERROR), MYF(0));
- return 1;
+ DBUG_RETURN (1);
}
/*
@@ -7566,7 +8290,7 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length)
*passwd > 127 and become 2**32-127+ after casting to uint.
*/
uint passwd_len= (thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
- (uchar)(*passwd++) : strlen(passwd));
+ (uchar) (*passwd++) : strlen(passwd));
db+= passwd_len + 1;
/*
@@ -7576,37 +8300,37 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length)
if (db >= end)
{
my_message(ER_UNKNOWN_COM_ERROR, ER(ER_UNKNOWN_COM_ERROR), MYF(0));
- return 1;
+ DBUG_RETURN (1);
}
uint db_len= strlen(db);
char *ptr= db + db_len + 1;
- if (ptr+1 < end)
+ if (ptr + 1 < end)
{
- uint cs_number= uint2korr(ptr);
- thd_init_client_charset(thd, cs_number);
+ if (thd_init_client_charset(thd, uint2korr(ptr)))
+ DBUG_RETURN(1);
thd->update_charset();
}
/* Convert database and user names to utf8 */
- db_len= copy_and_convert(db_buff, sizeof(db_buff)-1, system_charset_info,
+ db_len= copy_and_convert(db_buff, sizeof(db_buff) - 1, system_charset_info,
db, db_len, thd->charset(), &dummy_errors);
- user_len= copy_and_convert(user_buff, sizeof(user_buff)-1,
+ user_len= copy_and_convert(user_buff, sizeof(user_buff) - 1,
system_charset_info, user, user_len,
thd->charset(), &dummy_errors);
if (!(sctx->user= my_strndup(user_buff, user_len, MYF(MY_WME))))
- return 1;
+ DBUG_RETURN(1);
/* Clear variables that are allocated */
thd->user_connect= 0;
strmake(sctx->priv_user, sctx->user, USERNAME_LENGTH);
if (thd->make_lex_string(&mpvio->db, db_buff, db_len, 0) == 0)
- return 1; /* The error is set by make_lex_string(). */
+ DBUG_RETURN(1); /* The error is set by make_lex_string(). */
/*
Clear thd->db as it points to something, that will be freed when
@@ -7619,12 +8343,12 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length)
{
// if mysqld's been started with --skip-grant-tables option
mpvio->status= MPVIO_EXT::SUCCESS;
- return 0;
+ DBUG_RETURN(0);
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (find_mpvio_user(mpvio, sctx))
- return 1;
+ if (find_mpvio_user(mpvio))
+ DBUG_RETURN(1);
char *client_plugin;
if (thd->client_capabilities & CLIENT_PLUGIN_AUTH)
@@ -7633,7 +8357,7 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length)
if (client_plugin >= end)
{
my_message(ER_UNKNOWN_COM_ERROR, ER(ER_UNKNOWN_COM_ERROR), MYF(0));
- return 1;
+ DBUG_RETURN(1);
}
client_plugin= fix_plugin_ptr(client_plugin);
}
@@ -7654,15 +8378,19 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length)
mpvio->acl_user->plugin= old_password_plugin_name;
}
}
-
- /* remember the data part of the packet, to present it to plugin in read_packet() */
+
+ DBUG_PRINT("info", ("client_plugin=%s, restart", client_plugin));
+ /*
+ Remember the data part of the packet, to present it to plugin in
+ read_packet()
+ */
mpvio->cached_client_reply.pkt= passwd;
mpvio->cached_client_reply.pkt_len= passwd_len;
mpvio->cached_client_reply.plugin= client_plugin;
mpvio->status= MPVIO_EXT::RESTART;
#endif
- return 0;
+ DBUG_RETURN (0);
}
@@ -7686,36 +8414,34 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
ulong client_capabilities= uint2korr(net->read_pos);
if (client_capabilities & CLIENT_PROTOCOL_41)
{
- client_capabilities|= ((ulong) uint2korr(net->read_pos+2)) << 16;
- thd->max_client_packet_length= uint4korr(net->read_pos+4);
+ client_capabilities|= ((ulong) uint2korr(net->read_pos + 2)) << 16;
+ thd->max_client_packet_length= uint4korr(net->read_pos + 4);
DBUG_PRINT("info", ("client_character_set: %d", (uint) net->read_pos[8]));
- thd_init_client_charset(thd, (uint) net->read_pos[8]);
+ if (thd_init_client_charset(thd, (uint) net->read_pos[8]))
+ return packet_error;
thd->update_charset();
- end= (char*) net->read_pos+32;
+ end= (char*) net->read_pos + 32;
}
else
{
- thd->max_client_packet_length= uint3korr(net->read_pos+2);
- end= (char*) net->read_pos+5;
+ mpvio->max_client_packet_length= uint3korr(net->read_pos + 2);
+ end= (char*) net->read_pos + 5;
}
/* Disable those bits which are not supported by the client. */
thd->client_capabilities&= client_capabilities;
- if (thd->client_capabilities & CLIENT_IGNORE_SPACE)
- thd->variables.sql_mode|= MODE_IGNORE_SPACE;
-
DBUG_PRINT("info", ("client capabilities: %lu", thd->client_capabilities));
if (thd->client_capabilities & CLIENT_SSL)
{
- char error_string[1024] __attribute__((unused));
+ unsigned long errptr __attribute__((unused));
/* Do the SSL layering. */
if (!ssl_acceptor_fd)
return packet_error;
DBUG_PRINT("info", ("IO layer change in progress..."));
- if (sslaccept(ssl_acceptor_fd, net->vio, net->read_timeout, error_string))
+ if (sslaccept(ssl_acceptor_fd, net->vio, net->read_timeout, &errptr))
{
DBUG_PRINT("error", ("Failed to accept new SSL connection"));
return packet_error;
@@ -7731,11 +8457,14 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
}
}
+ if (thd->client_capabilities & CLIENT_IGNORE_SPACE)
+ thd->variables.sql_mode|= MODE_IGNORE_SPACE;
+ if (thd->client_capabilities & CLIENT_INTERACTIVE)
+ thd->variables.net_wait_timeout= thd->variables.net_interactive_timeout;
+
if (end >= (char*) net->read_pos+ pkt_len +2)
return packet_error;
- if (thd->client_capabilities & CLIENT_INTERACTIVE)
- thd->variables.net_wait_timeout= thd->variables.net_interactive_timeout;
if ((thd->client_capabilities & CLIENT_TRANSACTIONS) &&
opt_using_transactions)
net->return_status= &thd->server_status;
@@ -7781,12 +8510,12 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
/* Since 4.1 all database names are stored in utf8 */
if (db)
{
- db_len= copy_and_convert(db_buff, sizeof(db_buff)-1, system_charset_info,
+ db_len= copy_and_convert(db_buff, sizeof(db_buff) - 1, system_charset_info,
db, db_len, thd->charset(), &dummy_errors);
db= db_buff;
}
- user_len= copy_and_convert(user_buff, sizeof(user_buff)-1,
+ user_len= copy_and_convert(user_buff, sizeof(user_buff) - 1,
system_charset_info, user, user_len,
thd->charset(), &dummy_errors);
user= user_buff;
@@ -7806,6 +8535,7 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
if (!(sctx->user= my_strndup(user, user_len, MYF(MY_WME))))
return packet_error; /* The error is set by my_strdup(). */
+
/*
Clear thd->db as it points to something, that will be freed when
connection is closed. We don't want to accidentally free a wrong
@@ -7820,7 +8550,7 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
return packet_error;
}
- if (find_mpvio_user(mpvio, sctx))
+ if (find_mpvio_user(mpvio))
return packet_error;
if (thd->client_capabilities & CLIENT_PLUGIN_AUTH)
@@ -7874,22 +8604,22 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
doesn't need to know.
*/
const char *client_auth_plugin=
- ((st_mysql_auth *)(plugin_decl(mpvio->plugin)->info))->client_auth_plugin;
+ ((st_mysql_auth *) (plugin_decl(mpvio->plugin)->info))->client_auth_plugin;
if (client_auth_plugin &&
my_strcasecmp(system_charset_info, client_plugin, client_auth_plugin))
{
mpvio->cached_client_reply.plugin= client_plugin;
if (send_plugin_request_packet(mpvio,
- (uchar*)mpvio->cached_server_packet.pkt,
+ (uchar*) mpvio->cached_server_packet.pkt,
mpvio->cached_server_packet.pkt_len))
return packet_error;
passwd_len= my_net_read(&mpvio->thd->net);
- passwd = (char*)mpvio->thd->net.read_pos;
+ passwd= (char*)mpvio->thd->net.read_pos;
}
- *buff= (uchar*)passwd;
+ *buff= (uchar*) passwd;
return passwd_len;
#else
return 0;
@@ -7907,18 +8637,19 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
and handles plugin negotiation with the client. If necessary,
it escapes the plugin data, if it starts with a mysql protocol packet byte.
*/
-
static int server_mpvio_write_packet(MYSQL_PLUGIN_VIO *param,
const uchar *packet, int packet_len)
{
- MPVIO_EXT *mpvio= (MPVIO_EXT*)param;
+ MPVIO_EXT *mpvio= (MPVIO_EXT *) param;
int res;
+ DBUG_ENTER("server_mpvio_write_packet");
/* reset cached_client_reply */
mpvio->cached_client_reply.pkt= 0;
+
/* for the 1st packet we wrap plugin data into the handshake packet */
if (mpvio->packets_written == 0)
- res= send_server_handshake_packet(mpvio, (char*)packet, packet_len);
+ res= send_server_handshake_packet(mpvio, (char*) packet, packet_len);
else if (mpvio->status == MPVIO_EXT::RESTART)
res= send_plugin_request_packet(mpvio, packet, packet_len);
else if (packet_len > 0 && (*packet == 1 || *packet == 255 || *packet == 254))
@@ -7938,10 +8669,9 @@ static int server_mpvio_write_packet(MYSQL_PLUGIN_VIO *param,
net_flush(&mpvio->thd->net);
}
mpvio->packets_written++;
- return res;
+ DBUG_RETURN(res);
}
-
/**
vio->read_packet() callback method for server authentication plugins
@@ -7952,12 +8682,11 @@ static int server_mpvio_write_packet(MYSQL_PLUGIN_VIO *param,
a client authentication handshake packet, and handles plugin negotiation
with the client, if necessary.
*/
-
static int server_mpvio_read_packet(MYSQL_PLUGIN_VIO *param, uchar **buf)
{
- MPVIO_EXT *mpvio= (MPVIO_EXT*)param;
+ MPVIO_EXT *mpvio= (MPVIO_EXT *) param;
ulong pkt_len;
-
+ DBUG_ENTER("server_mpvio_read_packet");
if (mpvio->packets_written == 0)
{
/*
@@ -7969,8 +8698,7 @@ static int server_mpvio_read_packet(MYSQL_PLUGIN_VIO *param, uchar **buf)
else
pkt_len= my_net_read(&mpvio->thd->net);
}
- else
- if (mpvio->cached_client_reply.pkt)
+ else if (mpvio->cached_client_reply.pkt)
{
DBUG_ASSERT(mpvio->status == MPVIO_EXT::RESTART);
DBUG_ASSERT(mpvio->packets_read > 0);
@@ -7981,17 +8709,18 @@ static int server_mpvio_read_packet(MYSQL_PLUGIN_VIO *param, uchar **buf)
cached data straight away and avoid one round trip.
*/
const char *client_auth_plugin=
- ((st_mysql_auth *)(plugin_decl(mpvio->plugin)->info))->client_auth_plugin;
+ ((st_mysql_auth *) (plugin_decl(mpvio->plugin)->info))->client_auth_plugin;
if (client_auth_plugin == 0 ||
my_strcasecmp(system_charset_info, mpvio->cached_client_reply.plugin,
client_auth_plugin) == 0)
{
mpvio->status= MPVIO_EXT::FAILURE;
- *buf= (uchar*)mpvio->cached_client_reply.pkt;
+ *buf= (uchar*) mpvio->cached_client_reply.pkt;
mpvio->cached_client_reply.pkt= 0;
mpvio->packets_read++;
- return (int)mpvio->cached_client_reply.pkt_len;
+ DBUG_RETURN ((int) mpvio->cached_client_reply.pkt_len);
}
+
/*
But if the client has used the wrong plugin, the cached data are
useless. Furthermore, we have to send a "change plugin" request
@@ -8021,39 +8750,36 @@ static int server_mpvio_read_packet(MYSQL_PLUGIN_VIO *param, uchar **buf)
goto err;
}
else
- *buf = mpvio->thd->net.read_pos;
+ *buf= mpvio->thd->net.read_pos;
- return (int)pkt_len;
+ DBUG_RETURN((int)pkt_len);
err:
- if (mpvio->status == MPVIO_EXT::FAILURE && !mpvio->thd->is_error())
+ if (mpvio->status == MPVIO_EXT::FAILURE)
{
- inc_host_errors(mpvio->thd->main_security_ctx.ip);
- my_error(ER_HANDSHAKE_ERROR, MYF(0),
- mpvio->thd->security_ctx->host_or_ip);
+ inc_host_errors(mpvio->thd->security_ctx.ip);
+ if (!mpvio->thd->is_error())
+ my_error(ER_HANDSHAKE_ERROR, MYF(0));
}
- return -1;
+ DBUG_RETURN(-1);
}
-
/**
fills MYSQL_PLUGIN_VIO_INFO structure with the information about the
connection
*/
-
static void server_mpvio_info(MYSQL_PLUGIN_VIO *vio,
MYSQL_PLUGIN_VIO_INFO *info)
{
- MPVIO_EXT *mpvio= (MPVIO_EXT*)vio;
+ MPVIO_EXT *mpvio= (MPVIO_EXT *) vio;
mpvio_info(mpvio->thd->net.vio, info);
}
-
-static bool acl_check_ssl(THD *thd, ACL_USER *acl_user)
+static bool acl_check_ssl(THD *thd, const ACL_USER *acl_user)
{
-#if defined(HAVE_OPENSSL)
- Vio *vio=thd->net.vio;
- SSL *ssl= (SSL*) vio->ssl_arg;
+#ifdef HAVE_OPENSSL
+ Vio *vio= thd->net.vio;
+ SSL *ssl= (SSL *) vio->ssl_arg;
X509 *cert;
#endif
@@ -8067,7 +8793,7 @@ static bool acl_check_ssl(THD *thd, ACL_USER *acl_user)
case SSL_TYPE_NOT_SPECIFIED: // Impossible
case SSL_TYPE_NONE: // SSL is not required
return 0;
-#if defined(HAVE_OPENSSL)
+#ifdef HAVE_OPENSSL
case SSL_TYPE_ANY: // Any kind of SSL is ok
return vio_type(vio) != VIO_TYPE_SSL;
case SSL_TYPE_X509: /* Client should have any valid certificate. */
@@ -8093,9 +8819,9 @@ static bool acl_check_ssl(THD *thd, ACL_USER *acl_user)
return 1;
if (acl_user->ssl_cipher)
{
- DBUG_PRINT("info",("comparing ciphers: '%s' and '%s'",
- acl_user->ssl_cipher,SSL_get_cipher(ssl)));
- if (strcmp(acl_user->ssl_cipher,SSL_get_cipher(ssl)))
+ DBUG_PRINT("info", ("comparing ciphers: '%s' and '%s'",
+ acl_user->ssl_cipher, SSL_get_cipher(ssl)));
+ if (strcmp(acl_user->ssl_cipher, SSL_get_cipher(ssl)))
{
if (global_system_variables.log_warnings)
sql_print_information("X509 ciphers mismatch: should be '%s' but is '%s'",
@@ -8109,8 +8835,8 @@ static bool acl_check_ssl(THD *thd, ACL_USER *acl_user)
/* If X509 issuer is specified, we check it... */
if (acl_user->x509_issuer)
{
- char *ptr = X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0);
- DBUG_PRINT("info",("comparing issuers: '%s' and '%s'",
+ char *ptr= X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0);
+ DBUG_PRINT("info", ("comparing issuers: '%s' and '%s'",
acl_user->x509_issuer, ptr));
if (strcmp(acl_user->x509_issuer, ptr))
{
@@ -8127,9 +8853,9 @@ static bool acl_check_ssl(THD *thd, ACL_USER *acl_user)
if (acl_user->x509_subject)
{
char *ptr= X509_NAME_oneline(X509_get_subject_name(cert), 0, 0);
- DBUG_PRINT("info",("comparing subjects: '%s' and '%s'",
+ DBUG_PRINT("info", ("comparing subjects: '%s' and '%s'",
acl_user->x509_subject, ptr));
- if (strcmp(acl_user->x509_subject,ptr))
+ if (strcmp(acl_user->x509_subject, ptr))
{
if (global_system_variables.log_warnings)
sql_print_information("X509 subject mismatch: should be '%s' but is '%s'",
@@ -8154,18 +8880,17 @@ static bool acl_check_ssl(THD *thd, ACL_USER *acl_user)
return 1;
}
-static int do_auth_once(THD *thd, LEX_STRING *auth_plugin_name,
+
+static int do_auth_once(THD *thd, const LEX_STRING *auth_plugin_name,
MPVIO_EXT *mpvio)
{
int res= CR_OK, old_status= MPVIO_EXT::FAILURE;
bool unlock_plugin= false;
- plugin_ref plugin;
+ plugin_ref plugin= NULL;
-#ifdef EMBEDDED_LIBRARY
- plugin= native_password_plugin;
-#else
if (auth_plugin_name->str == native_password_plugin_name.str)
plugin= native_password_plugin;
+#ifndef EMBEDDED_LIBRARY
else if (auth_plugin_name->str == old_password_plugin_name.str)
plugin= old_password_plugin;
else if ((plugin= my_plugin_lock_by_name(thd, auth_plugin_name,
@@ -8178,7 +8903,7 @@ static int do_auth_once(THD *thd, LEX_STRING *auth_plugin_name,
if (plugin)
{
- st_mysql_auth *auth= (st_mysql_auth*)plugin_decl(plugin)->info;
+ st_mysql_auth *auth= (st_mysql_auth *) plugin_decl(plugin)->info;
res= auth->authenticate_user(mpvio, &mpvio->auth_info);
if (unlock_plugin)
@@ -8205,6 +8930,7 @@ static int do_auth_once(THD *thd, LEX_STRING *auth_plugin_name,
return res;
}
+
/**
Perform the handshake, authorize the client and update thd sctx variables.
@@ -8219,12 +8945,12 @@ static int do_auth_once(THD *thd, LEX_STRING *auth_plugin_name,
@retval 0 success, thd is updated.
@retval 1 error
*/
-
-bool acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_len)
+bool acl_authenticate(THD *thd, uint connect_errors,
+ uint com_change_user_pkt_len)
{
int res= CR_OK;
MPVIO_EXT mpvio;
- LEX_STRING *auth_plugin_name= default_auth_plugin_name;
+ const LEX_STRING *auth_plugin_name= default_auth_plugin_name;
enum enum_server_command command= com_change_user_pkt_len ? COM_CHANGE_USER
: COM_CONNECT;
DBUG_ENTER("acl_authenticate");
@@ -8239,6 +8965,8 @@ bool acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_le
mpvio.connect_errors= connect_errors;
mpvio.status= MPVIO_EXT::FAILURE;
+ DBUG_PRINT("info", ("com_change_user_pkt_len=%u", com_change_user_pkt_len));
+
if (command == COM_CHANGE_USER)
{
mpvio.packets_written++; // pretend that a server handshake packet was sent
@@ -8261,7 +8989,8 @@ bool acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_le
with a user name, and performs the authentication if everyone has used
the correct plugin.
*/
- res= do_auth_once(thd, auth_plugin_name, &mpvio);
+
+ res= do_auth_once(thd, auth_plugin_name, &mpvio);
}
/*
@@ -8279,7 +9008,7 @@ bool acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_le
}
Security_context *sctx= thd->security_ctx;
- ACL_USER *acl_user= mpvio.acl_user;
+ const ACL_USER *acl_user= mpvio.acl_user;
thd->password= mpvio.auth_info.password_used; // remember for error messages
@@ -8313,12 +9042,59 @@ bool acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_le
DBUG_RETURN(1);
}
+ sctx->proxy_user[0]= 0;
+
if (initialized) // if not --skip-grant-tables
{
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ bool is_proxy_user= FALSE;
+ const char *auth_user = acl_user->user ? acl_user->user : "";
+ ACL_PROXY_USER *proxy_user;
+ /* check if the user is allowed to proxy as another user */
+ proxy_user= acl_find_proxy_user(auth_user, sctx->host, sctx->ip,
+ mpvio.auth_info.authenticated_as,
+ &is_proxy_user);
+ if (is_proxy_user)
+ {
+ ACL_USER *acl_proxy_user;
+
+ /* we need to find the proxy user, but there was none */
+ if (!proxy_user)
+ {
+ if (!thd->is_error())
+ login_failed_error(&mpvio, mpvio.auth_info.password_used);
+ DBUG_RETURN(1);
+ }
+
+ my_snprintf(sctx->proxy_user, sizeof(sctx->proxy_user) - 1,
+ "'%s'@'%s'", auth_user,
+ acl_user->host.hostname ? acl_user->host.hostname : "");
+
+ /* we're proxying : find the proxy user definition */
+ mysql_mutex_lock(&acl_cache->lock);
+ acl_proxy_user= find_acl_user(proxy_user->get_proxied_host() ?
+ proxy_user->get_proxied_host() : "",
+ mpvio.auth_info.authenticated_as, TRUE);
+ if (!acl_proxy_user)
+ {
+ if (!thd->is_error())
+ login_failed_error(&mpvio, mpvio.auth_info.password_used);
+ mysql_mutex_unlock(&acl_cache->lock);
+ DBUG_RETURN(1);
+ }
+ acl_user= acl_proxy_user->copy(thd->mem_root);
+ mysql_mutex_unlock(&acl_cache->lock);
+ }
+#endif
+
sctx->master_access= acl_user->access;
- strmake(sctx->priv_user, mpvio.auth_info.authenticated_as, USERNAME_LENGTH);
+ if (acl_user->user)
+ strmake(sctx->priv_user, acl_user->user, USERNAME_LENGTH - 1);
+ else
+ *sctx->priv_user= 0;
+
if (acl_user->host.hostname)
- strmake(sctx->priv_host, acl_user->host.hostname, MAX_HOSTNAME);
+ strmake(sctx->priv_host, acl_user->host.hostname, MAX_HOSTNAME - 1);
else
*sctx->priv_host= 0;
@@ -8405,6 +9181,9 @@ bool acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_le
thd->net.net_skip_rest_factor= 2; // skip at most 2*max_packet_size
+ if (mpvio.auth_info.external_user[0])
+ sctx->external_user= my_strdup(mpvio.auth_info.external_user, MYF(0));
+
if (res == CR_OK_HANDSHAKE_COMPLETE)
thd->stmt_da->disable_status();
else
@@ -8414,7 +9193,6 @@ bool acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_le
DBUG_RETURN(0);
}
-
/**
MySQL Server Password Authentication Plugin
@@ -8423,14 +9201,14 @@ bool acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_le
2. client sends the encrypted password back to the server
3. the server checks the password.
*/
-
-static int native_password_authenticate(MYSQL_PLUGIN_VIO *vio,
+static int native_password_authenticate(MYSQL_PLUGIN_VIO *vio,
MYSQL_SERVER_AUTH_INFO *info)
{
uchar *pkt;
int pkt_len;
- MPVIO_EXT *mpvio=(MPVIO_EXT*)vio;
+ MPVIO_EXT *mpvio= (MPVIO_EXT *) vio;
THD *thd=mpvio->thd;
+ DBUG_ENTER("native_password_authenticate");
/* generate the scramble, or reuse the old one */
if (thd->scramble[SCRAMBLE_LENGTH])
@@ -8480,33 +9258,37 @@ static int native_password_authenticate(MYSQL_PLUGIN_VIO *vio,
/* read the reply with the encrypted password */
if ((pkt_len= mpvio->read_packet(mpvio, &pkt)) < 0)
- return CR_ERROR;
+ DBUG_RETURN(CR_ERROR);
+ DBUG_PRINT("info", ("reply read : pkt_len=%d", pkt_len));
#ifdef NO_EMBEDDED_ACCESS_CHECKS
- return CR_OK;
+ DBUG_RETURN(CR_OK);
#endif
if (pkt_len == 0) /* no password */
- return info->auth_string[0] ? CR_ERROR : CR_OK;
+ DBUG_RETURN(info->auth_string[0] ? CR_ERROR : CR_OK);
- info->password_used = 1;
+ info->password_used= PASSWORD_USED_YES;
if (pkt_len == SCRAMBLE_LENGTH)
- return info->auth_string[0] == 0 ||
- check_scramble(pkt, thd->scramble, mpvio->acl_user->salt) ?
- CR_ERROR : CR_OK;
+ {
+ if (!mpvio->acl_user->salt_len)
+ DBUG_RETURN(CR_ERROR);
+
+ DBUG_RETURN(check_scramble(pkt, thd->scramble, mpvio->acl_user->salt) ?
+ CR_ERROR : CR_OK);
+ }
inc_host_errors(mpvio->thd->main_security_ctx.ip);
- my_error(ER_HANDSHAKE_ERROR, MYF(0), thd->main_security_ctx.host_or_ip);
- return CR_ERROR;
+ my_error(ER_HANDSHAKE_ERROR, MYF(0));
+ DBUG_RETURN(CR_ERROR);
}
-
static int old_password_authenticate(MYSQL_PLUGIN_VIO *vio,
MYSQL_SERVER_AUTH_INFO *info)
{
uchar *pkt;
int pkt_len;
- MPVIO_EXT *mpvio=(MPVIO_EXT*)vio;
+ MPVIO_EXT *mpvio= (MPVIO_EXT *) vio;
THD *thd=mpvio->thd;
/* generate the scramble, or reuse the old one */
@@ -8531,7 +9313,7 @@ static int old_password_authenticate(MYSQL_PLUGIN_VIO *vio,
the password is sent \0-terminated, the pkt_len is always 9 bytes.
We need to figure out the correct scramble length here.
*/
- if (pkt_len == SCRAMBLE_LENGTH_323+1)
+ if (pkt_len == SCRAMBLE_LENGTH_323 + 1)
pkt_len= strnlen((char*)pkt, pkt_len);
if (pkt_len == 0) /* no password */
@@ -8540,15 +9322,20 @@ static int old_password_authenticate(MYSQL_PLUGIN_VIO *vio,
if (secure_auth(thd))
return CR_ERROR;
- info->password_used = 1;
+ info->password_used= PASSWORD_USED_YES;
if (pkt_len == SCRAMBLE_LENGTH_323)
- return info->auth_string[0] == 0 ||
- check_scramble_323(pkt, thd->scramble,
- (ulong *)mpvio->acl_user->salt) ? CR_ERROR : CR_OK;
+ {
+ if (!mpvio->acl_user->salt_len)
+ return CR_ERROR;
+
+ return check_scramble_323(pkt, thd->scramble,
+ (ulong *) mpvio->acl_user->salt) ?
+ CR_ERROR : CR_OK;
+ }
inc_host_errors(mpvio->thd->main_security_ctx.ip);
- my_error(ER_HANDSHAKE_ERROR, MYF(0), thd->main_security_ctx.host_or_ip);
+ my_error(ER_HANDSHAKE_ERROR, MYF(0));
return CR_ERROR;
}
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index 2a62b605678..3079f376bee 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -173,6 +173,14 @@ enum mysql_db_table_field
extern const TABLE_FIELD_DEF mysql_db_table_def;
extern bool mysql_user_table_is_in_short_password_format;
+
+static inline int access_denied_error_code(int passwd_used)
+{
+ return passwd_used == 2 ? ER_ACCESS_DENIED_NO_PASSWORD_ERROR
+ : ER_ACCESS_DENIED_ERROR;
+}
+
+
/* prototypes */
bool hostname_requires_resolving(const char *hostname);
@@ -190,7 +198,7 @@ int check_change_password(THD *thd, const char *host, const char *user,
bool change_password(THD *thd, const char *host, const char *user,
char *password);
bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &user_list,
- ulong rights, bool revoke);
+ ulong rights, bool revoke, bool is_proxy);
int mysql_table_grant(THD *thd, TABLE_LIST *table, List <LEX_USER> &user_list,
List <LEX_COLUMN> &column_list, ulong rights,
bool revoke);
@@ -372,4 +380,6 @@ get_cached_table_access(GRANT_INTERNAL_INFO *grant_internal_info,
const char *schema_name,
const char *table_name);
+bool acl_check_proxy_grant_access (THD *thd, const char *host, const char *user,
+ bool with_grant);
#endif /* SQL_ACL_INCLUDED */
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 874e91c4040..709d1b9a701 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved.
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
@@ -114,7 +114,7 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list,
key_length= create_table_def_key(thd, key, table_list, 0);
table_list->mdl_request.init(MDL_key::TABLE,
table_list->db, table_list->table_name,
- MDL_EXCLUSIVE);
+ MDL_EXCLUSIVE, MDL_TRANSACTION);
if (lock_table_names(thd, table_list, table_list->next_global,
thd->variables.lock_wait_timeout,
@@ -140,9 +140,6 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list,
table= &tmp_table;
}
- /* A MERGE table must not come here. */
- DBUG_ASSERT(table->file->ht->db_type != DB_TYPE_MRG_MYISAM);
-
/*
REPAIR TABLE ... USE_FRM for temporary tables makes little sense.
*/
@@ -180,6 +177,9 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list,
if (!ext[0] || !ext[1])
goto end; // No data file
+ /* A MERGE table must not come here. */
+ DBUG_ASSERT(table->file->ht->db_type != DB_TYPE_MRG_MYISAM);
+
// Name of data file
strxmov(from, table->s->normalized_path.str, ext[1], NullS);
if (!mysql_file_stat(key_file_misc, from, &stat_info, MYF(0)))
@@ -260,6 +260,26 @@ end:
}
+/**
+ Check if a given error is something that could occur during
+ open_and_lock_tables() that does not indicate table corruption.
+
+ @param sql_errno Error number to check.
+
+ @retval TRUE Error does not indicate table corruption.
+ @retval FALSE Error could indicate table corruption.
+*/
+
+static inline bool table_not_corrupt_error(uint sql_errno)
+{
+ return (sql_errno == ER_NO_SUCH_TABLE ||
+ sql_errno == ER_FILE_NOT_FOUND ||
+ sql_errno == ER_LOCK_WAIT_TIMEOUT ||
+ sql_errno == ER_LOCK_DEADLOCK ||
+ sql_errno == ER_CANT_LOCK_LOG_TABLE ||
+ sql_errno == ER_OPEN_AS_READONLY);
+}
+
/*
RETURN VALUES
@@ -272,7 +292,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
const char *operator_name,
thr_lock_type lock_type,
bool open_for_modify,
- bool no_warnings_for_error,
+ bool repair_table_use_frm,
uint extra_open_options,
int (*prepare_func)(THD *, TABLE_LIST *,
HA_CHECK_OPT *),
@@ -341,15 +361,54 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
lex->query_tables= table;
lex->query_tables_last= &table->next_global;
lex->query_tables_own_last= 0;
- thd->no_warnings_for_error= no_warnings_for_error;
+
if (view_operator_func == NULL)
table->required_type=FRMTYPE_TABLE;
- open_error= open_and_lock_tables(thd, table, TRUE, 0);
- thd->no_warnings_for_error= 0;
+ if (!thd->locked_tables_mode && repair_table_use_frm)
+ {
+ /*
+ If we're not under LOCK TABLES and we're executing REPAIR TABLE
+ USE_FRM, we need to ignore errors from open_and_lock_tables().
+ REPAIR TABLE USE_FRM is a heavy weapon used when a table is
+ critically damaged, so open_and_lock_tables() will most likely
+ report errors. Those errors are not interesting for the user
+ because it's already known that the table is badly damaged.
+ */
+
+ Warning_info wi(thd->query_id, false);
+ Warning_info *wi_saved= thd->warning_info;
+
+ thd->warning_info= &wi;
+
+ open_error= open_and_lock_tables(thd, table, TRUE, 0);
+
+ thd->warning_info= wi_saved;
+ }
+ else
+ {
+ /*
+ It's assumed that even if it is REPAIR TABLE USE_FRM, the table
+ can be opened if we're under LOCK TABLES (otherwise LOCK TABLES
+ would fail). Thus, the only errors we could have from
+ open_and_lock_tables() are logical ones, like incorrect locking
+ mode. It does make sense for the user to see such errors.
+ */
+
+ open_error= open_and_lock_tables(thd, table, TRUE, 0);
+ }
+
table->next_global= save_next_global;
table->next_local= save_next_local;
thd->open_options&= ~extra_open_options;
+
+ /*
+ If open_and_lock_tables() failed, close_thread_tables() will close
+ the table and table->table can therefore be invalid.
+ */
+ if (open_error)
+ table->table= NULL;
+
/*
Under locked tables, we know that the table can be opened,
so any errors opening the table are logical errors.
@@ -448,9 +507,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_VIEW_CHECKSUM, ER(ER_VIEW_CHECKSUM));
if (thd->stmt_da->is_error() &&
- (thd->stmt_da->sql_errno() == ER_NO_SUCH_TABLE ||
- thd->stmt_da->sql_errno() == ER_FILE_NOT_FOUND))
- /* A missing table is just issued as a failed command */
+ table_not_corrupt_error(thd->stmt_da->sql_errno()))
result_code= HA_ADMIN_FAILED;
else
/* Default failure code is corrupt table */
@@ -706,7 +763,7 @@ send_result_message:
protocol->store(operator_name, system_charset_info);
if (result_code) // either mysql_recreate_table or analyze failed
{
- DBUG_ASSERT(thd->is_error());
+ DBUG_ASSERT(thd->is_error() || thd->killed);
if (thd->is_error())
{
const char *err_msg= thd->stmt_da->message();
@@ -749,8 +806,12 @@ send_result_message:
size_t length;
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
- length=my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE),
- table->table_name);
+ if (table->table->file->ha_table_flags() & HA_CAN_REPAIR)
+ length= my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE),
+ table->table_name);
+ else
+ length= my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_REBUILD),
+ table->table_name);
protocol->store(buf, length, system_charset_info);
fatal_error=1;
break;
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index 046e09b20a3..5af01523aa7 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -13,8 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include "sql_parse.h" // check_access,
- // check_merge_table_access
+#include "sql_parse.h" // check_access
#include "sql_table.h" // mysql_alter_table,
// mysql_exchange_partition
#include "sql_alter.h"
@@ -60,11 +59,15 @@ bool Alter_table_statement::execute(THD *thd)
check_access(thd, INSERT_ACL | CREATE_ACL, select_lex->db,
&priv,
NULL, /* Don't use first_tab->grant with sel_lex->db */
- 0, 0) ||
- check_merge_table_access(thd, first_table->db,
- create_info.merge_list.first))
+ 0, 0))
DBUG_RETURN(TRUE); /* purecov: inspected */
+ /* If it is a merge table, check privileges for merge children. */
+ if (create_info.merge_list.first &&
+ check_table_access(thd, SELECT_ACL | UPDATE_ACL | DELETE_ACL,
+ create_info.merge_list.first, FALSE, UINT_MAX, FALSE))
+ DBUG_RETURN(TRUE);
+
if (check_grant(thd, priv_needed, first_table, FALSE, UINT_MAX, FALSE))
DBUG_RETURN(TRUE); /* purecov: inspected */
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index 6dccd594588..3e83aceb03b 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -242,7 +242,7 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
if (str == end)
{
info->is_float = 1; // we can't use variable decimals here
- return 1;
+ DBUG_RETURN(1);
}
DBUG_RETURN(0);
}
@@ -522,9 +522,6 @@ void field_decimal::add()
{
found = 1;
min_arg = max_arg = sum[0] = *dec;
- min_arg.fix_buffer_pointer();
- max_arg.fix_buffer_pointer();
- sum[0].fix_buffer_pointer();
my_decimal_mul(E_DEC_FATAL_ERROR, sum_sqr, dec, dec);
cur_sum= 0;
min_length = max_length = length;
@@ -546,12 +543,10 @@ void field_decimal::add()
if (my_decimal_cmp(dec, &min_arg) < 0)
{
min_arg= *dec;
- min_arg.fix_buffer_pointer();
}
if (my_decimal_cmp(dec, &max_arg) > 0)
{
max_arg= *dec;
- max_arg.fix_buffer_pointer();
}
}
}
diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc
index 3f5c96ef9ff..be837ec51ba 100644
--- a/sql/sql_audit.cc
+++ b/sql/sql_audit.cc
@@ -21,11 +21,18 @@ extern int finalize_audit_plugin(st_plugin_int *plugin);
#ifndef EMBEDDED_LIBRARY
+struct st_mysql_event_generic
+{
+ unsigned int event_class;
+ const void *event;
+};
+
unsigned long mysql_global_audit_mask[MYSQL_AUDIT_CLASS_MASK_SIZE];
static mysql_mutex_t LOCK_audit_mask;
-static void event_class_dispatch(THD *thd, const struct mysql_event *event);
+static void event_class_dispatch(THD *thd, unsigned int event_class,
+ const void *event);
static inline
@@ -64,7 +71,6 @@ typedef void (*audit_handler_t)(THD *thd, uint event_subtype, va_list ap);
static void general_class_handler(THD *thd, uint event_subtype, va_list ap)
{
mysql_event_general event;
- event.event_class= MYSQL_AUDIT_GENERAL_CLASS;
event.event_subclass= event_subtype;
event.general_error_code= va_arg(ap, int);
event.general_thread_id= thd ? thd->thread_id : 0;
@@ -77,13 +83,37 @@ static void general_class_handler(THD *thd, uint event_subtype, va_list ap)
event.general_query_length= va_arg(ap, unsigned int);
event.general_charset= va_arg(ap, struct charset_info_st *);
event.general_rows= (unsigned long long) va_arg(ap, ha_rows);
- event_class_dispatch(thd, (const mysql_event*) &event);
+ event_class_dispatch(thd, MYSQL_AUDIT_GENERAL_CLASS, &event);
+}
+
+
+static void connection_class_handler(THD *thd, uint event_subclass, va_list ap)
+{
+ mysql_event_connection event;
+ event.event_subclass= event_subclass;
+ event.status= va_arg(ap, int);
+ event.thread_id= va_arg(ap, unsigned long);
+ event.user= va_arg(ap, const char *);
+ event.user_length= va_arg(ap, unsigned int);
+ event.priv_user= va_arg(ap, const char *);
+ event.priv_user_length= va_arg(ap, unsigned int);
+ event.external_user= va_arg(ap, const char *);
+ event.external_user_length= va_arg(ap, unsigned int);
+ event.proxy_user= va_arg(ap, const char *);
+ event.proxy_user_length= va_arg(ap, unsigned int);
+ event.host= va_arg(ap, const char *);
+ event.host_length= va_arg(ap, unsigned int);
+ event.ip= va_arg(ap, const char *);
+ event.ip_length= va_arg(ap, unsigned int);
+ event.database= va_arg(ap, const char *);
+ event.database_length= va_arg(ap, unsigned int);
+ event_class_dispatch(thd, MYSQL_AUDIT_CONNECTION_CLASS, &event);
}
static audit_handler_t audit_handlers[] =
{
- general_class_handler
+ general_class_handler, connection_class_handler
};
static const uint audit_handlers_count=
@@ -408,18 +438,19 @@ int finalize_audit_plugin(st_plugin_int *plugin)
static my_bool plugins_dispatch(THD *thd, plugin_ref plugin, void *arg)
{
- const struct mysql_event *event= (const struct mysql_event *) arg;
+ const struct st_mysql_event_generic *event_generic=
+ (const struct st_mysql_event_generic *) arg;
unsigned long event_class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE];
st_mysql_audit *data= plugin_data(plugin, struct st_mysql_audit *);
- set_audit_mask(event_class_mask, event->event_class);
+ set_audit_mask(event_class_mask, event_generic->event_class);
/* Check to see if the plugin is interested in this event */
if (check_audit_mask(data->class_mask, event_class_mask))
return 0;
/* Actually notify the plugin */
- data->event_notify(thd, event);
+ data->event_notify(thd, event_generic->event_class, event_generic->event);
return 0;
}
@@ -432,15 +463,19 @@ static my_bool plugins_dispatch(THD *thd, plugin_ref plugin, void *arg)
@param[in] event
*/
-static void event_class_dispatch(THD *thd, const struct mysql_event *event)
+static void event_class_dispatch(THD *thd, unsigned int event_class,
+ const void *event)
{
+ struct st_mysql_event_generic event_generic;
+ event_generic.event_class= event_class;
+ event_generic.event= event;
/*
Check if we are doing a slow global dispatch. This event occurs when
thd == NULL as it is not associated with any particular thread.
*/
if (unlikely(!thd))
{
- plugin_foreach(thd, plugins_dispatch, MYSQL_AUDIT_PLUGIN, (void*) event);
+ plugin_foreach(thd, plugins_dispatch, MYSQL_AUDIT_PLUGIN, &event_generic);
}
else
{
@@ -451,7 +486,7 @@ static void event_class_dispatch(THD *thd, const struct mysql_event *event)
plugins_last= plugins + thd->audit_class_plugins.elements;
for (; plugins < plugins_last; plugins++)
- plugins_dispatch(thd, *plugins, (void*) event);
+ plugins_dispatch(thd, *plugins, &event_generic);
}
}
diff --git a/sql/sql_audit.h b/sql/sql_audit.h
index 953e41f1f06..da44c4a023b 100644
--- a/sql/sql_audit.h
+++ b/sql/sql_audit.h
@@ -17,6 +17,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <my_global.h>
+
#include <mysql/plugin_audit.h>
#include "sql_class.h"
@@ -32,8 +34,12 @@ extern void mysql_audit_free_thd(THD *thd);
extern void mysql_audit_acquire_plugins(THD *thd, uint event_class);
+#ifndef EMBEDDED_LIBRARY
extern void mysql_audit_notify(THD *thd, uint event_class,
uint event_subtype, ...);
+#else
+#define mysql_audit_notify(...)
+#endif
extern void mysql_audit_release(THD *thd);
#define MAX_USER_HOST_SIZE 512
@@ -41,7 +47,7 @@ static inline uint make_user_name(THD *thd, char *buf)
{
Security_context *sctx= thd->security_ctx;
return strxnmov(buf, MAX_USER_HOST_SIZE,
- sctx->priv_user ? sctx->priv_user : "", "[",
+ sctx->priv_user[0] ? sctx->priv_user : "", "[",
sctx->user ? sctx->user : "", "] @ ",
sctx->host ? sctx->host : "", " [",
sctx->ip ? sctx->ip : "", "]", NullS) - buf;
@@ -84,6 +90,7 @@ void mysql_audit_general_log(THD *thd, time_t time,
event_subtype should be set to one of:
MYSQL_AUDIT_GENERAL_ERROR
MYSQL_AUDIT_GENERAL_RESULT
+ MYSQL_AUDIT_GENERAL_STATUS
@param[in] thd
@param[in] event_subtype Type of general audit event.
@@ -99,35 +106,68 @@ void mysql_audit_general(THD *thd, uint event_subtype,
{
time_t time= my_time(0);
uint msglen= msg ? strlen(msg) : 0;
- const char *query, *user;
- uint querylen, userlen;
+ const char *user;
+ uint userlen;
char user_buff[MAX_USER_HOST_SIZE];
- CHARSET_INFO *clientcs;
+ CSET_STRING query;
ha_rows rows;
if (thd)
{
- query= thd->query();
- querylen= thd->query_length();
+ query= thd->query_string;
user= user_buff;
userlen= make_user_name(thd, user_buff);
- clientcs= thd->variables.character_set_client;
rows= thd->warning_info->current_row_for_warning();
}
else
{
- query= user= 0;
- querylen= userlen= 0;
- clientcs= global_system_variables.character_set_client;
+ user= 0;
+ userlen= 0;
rows= 0;
}
mysql_audit_notify(thd, MYSQL_AUDIT_GENERAL_CLASS, event_subtype,
error_code, time, user, userlen, msg, msglen,
- query, querylen, clientcs, rows);
+ query.str(), query.length(), query.charset(), rows);
}
#endif
}
+#define MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT(thd) mysql_audit_notify(\
+ (thd), MYSQL_AUDIT_CONNECTION_CLASS, MYSQL_AUDIT_CONNECTION_CONNECT,\
+ (thd)->stmt_da->is_error() ? (thd)->stmt_da->sql_errno() : 0,\
+ (thd)->thread_id, (thd)->security_ctx->user,\
+ (thd)->security_ctx->user ? strlen((thd)->security_ctx->user) : 0,\
+ (thd)->security_ctx->priv_user, strlen((thd)->security_ctx->priv_user),\
+ (thd)->security_ctx->external_user,\
+ (thd)->security_ctx->external_user ?\
+ strlen((thd)->security_ctx->external_user) : 0,\
+ (thd)->security_ctx->proxy_user, strlen((thd)->security_ctx->proxy_user),\
+ (thd)->security_ctx->host,\
+ (thd)->security_ctx->host ? strlen((thd)->security_ctx->host) : 0,\
+ (thd)->security_ctx->ip,\
+ (thd)->security_ctx->ip ? strlen((thd)->security_ctx->ip) : 0,\
+ (thd)->db, (thd)->db ? strlen((thd)->db) : 0)
+
+#define MYSQL_AUDIT_NOTIFY_CONNECTION_DISCONNECT(thd, errcode)\
+ mysql_audit_notify(\
+ (thd), MYSQL_AUDIT_CONNECTION_CLASS, MYSQL_AUDIT_CONNECTION_DISCONNECT,\
+ (errcode), (thd)->thread_id, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
+
+#define MYSQL_AUDIT_NOTIFY_CONNECTION_CHANGE_USER(thd) mysql_audit_notify(\
+ (thd), MYSQL_AUDIT_CONNECTION_CLASS, MYSQL_AUDIT_CONNECTION_CHANGE_USER,\
+ (thd)->stmt_da->is_error() ? (thd)->stmt_da->sql_errno() : 0,\
+ (thd)->thread_id, (thd)->security_ctx->user,\
+ (thd)->security_ctx->user ? strlen((thd)->security_ctx->user) : 0,\
+ (thd)->security_ctx->priv_user, strlen((thd)->security_ctx->priv_user),\
+ (thd)->security_ctx->external_user,\
+ (thd)->security_ctx->external_user ?\
+ strlen((thd)->security_ctx->external_user) : 0,\
+ (thd)->security_ctx->proxy_user, strlen((thd)->security_ctx->proxy_user),\
+ (thd)->security_ctx->host,\
+ (thd)->security_ctx->host ? strlen((thd)->security_ctx->host) : 0,\
+ (thd)->security_ctx->ip,\
+ (thd)->security_ctx->ip ? strlen((thd)->security_ctx->ip) : 0,\
+ (thd)->db, (thd)->db ? strlen((thd)->db) : 0)
#endif /* SQL_AUDIT_INCLUDED */
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 7116d046a8c..7e0d17d1b0e 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -21,7 +21,7 @@
#include "sql_priv.h"
#include "unireg.h"
#include "debug_sync.h"
-#include "lock.h" // broadcast_refresh, mysql_lock_remove,
+#include "lock.h" // mysql_lock_remove,
// mysql_unlock_tables,
// mysql_lock_have_duplicate
#include "sql_show.h" // append_identifier
@@ -101,14 +101,11 @@ bool No_such_table_error_handler::safely_trapped_errors()
TABLE_SHAREs, refresh_version and the table id counter.
*/
mysql_mutex_t LOCK_open;
-mysql_mutex_t LOCK_dd_owns_lock_open;
-uint dd_owns_lock_open= 0;
#ifdef HAVE_PSI_INTERFACE
-static PSI_mutex_key key_LOCK_open, key_LOCK_dd_owns_lock_open;
+static PSI_mutex_key key_LOCK_open;
static PSI_mutex_info all_tdc_mutexes[]= {
- { &key_LOCK_open, "LOCK_open", PSI_FLAG_GLOBAL },
- { &key_LOCK_dd_owns_lock_open, "LOCK_dd_owns_lock_open", PSI_FLAG_GLOBAL }
+ { &key_LOCK_open, "LOCK_open", PSI_FLAG_GLOBAL }
};
/**
@@ -251,7 +248,8 @@ static void check_unused(void)
Length of key
*/
-uint create_table_def_key(THD *thd, char *key, TABLE_LIST *table_list,
+uint create_table_def_key(THD *thd, char *key,
+ const TABLE_LIST *table_list,
bool tmp_table)
{
char *db_end= strnmov(key, table_list->db, MAX_DBKEY_LENGTH - 2);
@@ -306,8 +304,6 @@ bool table_def_init(void)
init_tdc_psi_keys();
#endif
mysql_mutex_init(key_LOCK_open, &LOCK_open, MY_MUTEX_INIT_FAST);
- mysql_mutex_init(key_LOCK_dd_owns_lock_open, &LOCK_dd_owns_lock_open,
- MY_MUTEX_INIT_FAST);
oldest_unused_share= &end_of_unused_share;
end_of_unused_share.prev= &oldest_unused_share;
@@ -351,7 +347,6 @@ void table_def_free(void)
table_def_inited= 0;
/* Free table definitions. */
my_hash_free(&table_def_cache);
- mysql_mutex_destroy(&LOCK_dd_owns_lock_open);
mysql_mutex_destroy(&LOCK_open);
}
DBUG_VOID_RETURN;
@@ -1036,7 +1031,7 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables,
table_list= table_list->next_global)
{
/* A check that the table was locked for write is done by the caller. */
- TABLE *table= find_table_for_mdl_upgrade(thd->open_tables, table_list->db,
+ TABLE *table= find_table_for_mdl_upgrade(thd, table_list->db,
table_list->table_name, TRUE);
/* May return NULL if this table has already been closed via an alias. */
@@ -1295,20 +1290,12 @@ static void mark_used_tables_as_free_for_reuse(THD *thd, TABLE *table)
static void close_open_tables(THD *thd)
{
- bool found_old_table= 0;
-
mysql_mutex_assert_not_owner(&LOCK_open);
DBUG_PRINT("info", ("thd->open_tables: 0x%lx", (long) thd->open_tables));
while (thd->open_tables)
- found_old_table|= close_thread_table(thd, &thd->open_tables);
-
- if (found_old_table)
- {
- /* Tell threads waiting for refresh that something has happened */
- broadcast_refresh();
- }
+ (void) close_thread_table(thd, &thd->open_tables);
}
@@ -1376,11 +1363,6 @@ close_all_tables_for_name(THD *thd, TABLE_SHARE *share,
/* Remove the table share from the cache. */
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, db, table_name,
FALSE);
- /*
- There could be a FLUSH thread waiting
- on the table to go away. Wake it up.
- */
- broadcast_refresh();
}
@@ -2014,39 +1996,60 @@ void update_non_unique_table_error(TABLE_LIST *update,
}
+/**
+ Find temporary table specified by database and table names in the
+ THD::temporary_tables list.
+
+ @return TABLE instance if a temporary table has been found; NULL otherwise.
+*/
+
TABLE *find_temporary_table(THD *thd, const char *db, const char *table_name)
{
- TABLE_LIST table_list;
+ TABLE_LIST tl;
- table_list.db= (char*) db;
- table_list.table_name= (char*) table_name;
- return find_temporary_table(thd, &table_list);
+ tl.db= (char*) db;
+ tl.table_name= (char*) table_name;
+
+ return find_temporary_table(thd, &tl);
}
-TABLE *find_temporary_table(THD *thd, TABLE_LIST *table_list)
+/**
+ Find a temporary table specified by TABLE_LIST instance in the
+ THD::temporary_tables list.
+
+ @return TABLE instance if a temporary table has been found; NULL otherwise.
+*/
+
+TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl)
{
- char key[MAX_DBKEY_LENGTH];
- uint key_length;
- TABLE *table;
- DBUG_ENTER("find_temporary_table");
- DBUG_PRINT("enter", ("table: '%s'.'%s'",
- table_list->db, table_list->table_name));
+ char key[MAX_DBKEY_LENGTH];
+ uint key_length= create_table_def_key(thd, key, tl, 1);
- key_length= create_table_def_key(thd, key, table_list, 1);
- for (table=thd->temporary_tables ; table ; table= table->next)
+ return find_temporary_table(thd, key, key_length);
+}
+
+
+/**
+ Find a temporary table specified by a key in the THD::temporary_tables list.
+
+ @return TABLE instance if a temporary table has been found; NULL otherwise.
+*/
+
+TABLE *find_temporary_table(THD *thd,
+ const char *table_key,
+ uint table_key_length)
+{
+ for (TABLE *table= thd->temporary_tables; table; table= table->next)
{
- if (table->s->table_cache_key.length == key_length &&
- !memcmp(table->s->table_cache_key.str, key, key_length))
+ if (table->s->table_cache_key.length == table_key_length &&
+ !memcmp(table->s->table_cache_key.str, table_key, table_key_length))
{
- DBUG_PRINT("info",
- ("Found table. server_id: %u pseudo_thread_id: %lu",
- (uint) thd->server_id,
- (ulong) thd->variables.pseudo_thread_id));
- DBUG_RETURN(table);
+ return table;
}
}
- DBUG_RETURN(0); // Not a temporary table
+
+ return NULL;
}
@@ -2474,7 +2477,8 @@ open_table_get_mdl_lock(THD *thd, Open_table_context *ot_ctx,
mdl_request_shared.init(&mdl_request->key,
(flags & MYSQL_OPEN_FORCE_SHARED_MDL) ?
- MDL_SHARED : MDL_SHARED_HIGH_PRIO);
+ MDL_SHARED : MDL_SHARED_HIGH_PRIO,
+ MDL_TRANSACTION);
mdl_request= &mdl_request_shared;
}
@@ -2639,32 +2643,6 @@ bool open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
TMP_TABLE_KEY_EXTRA);
/*
- We need this to work for all tables, including temporary
- tables, for backwards compatibility. But not under LOCK
- TABLES, since under LOCK TABLES one can't use a non-prelocked
- table. This code only works for updates done inside DO/SELECT
- f1() statements, normal DML is handled by means of
- sql_command_flags.
- */
- if (global_read_lock && table_list->lock_type >= TL_WRITE_ALLOW_WRITE &&
- ! (flags & MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK) &&
- ! thd->locked_tables_mode)
- {
- /*
- Someone has issued FLUSH TABLES WITH READ LOCK and we want
- a write lock. Wait until the lock is gone.
- */
- if (thd->global_read_lock.wait_if_global_read_lock(thd, 1, 1))
- DBUG_RETURN(TRUE);
-
- if (thd->open_tables && thd->open_tables->s->version != refresh_version)
- {
- (void)ot_ctx->request_backoff_action(Open_table_context::OT_REOPEN_TABLES,
- NULL);
- DBUG_RETURN(TRUE);
- }
- }
- /*
Unless requested otherwise, try to resolve this table in the list
of temporary tables of this thread. In MySQL temporary tables
are always thread-local and "shadow" possible base tables with the
@@ -2835,6 +2813,59 @@ bool open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
if (! (flags & MYSQL_OPEN_HAS_MDL_LOCK))
{
+ /*
+ We are not under LOCK TABLES and going to acquire write-lock/
+ modify the base table. We need to acquire protection against
+ global read lock until end of this statement in order to have
+ this statement blocked by active FLUSH TABLES WITH READ LOCK.
+
+ We don't block acquire this protection under LOCK TABLES as
+ such protection already acquired at LOCK TABLES time and
+ not released until UNLOCK TABLES.
+
+ We don't block statements which modify only temporary tables
+ as these tables are not preserved by backup by any form of
+ backup which uses FLUSH TABLES WITH READ LOCK.
+
+ TODO: The fact that we sometimes acquire protection against
+ GRL only when we encounter table to be write-locked
+ slightly increases probability of deadlock.
+ This problem will be solved once Alik pushes his
+ temporary table refactoring patch and we can start
+ pre-acquiring metadata locks at the beggining of
+ open_tables() call.
+ */
+ if (table_list->mdl_request.type >= MDL_SHARED_WRITE &&
+ ! (flags & (MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK |
+ MYSQL_OPEN_FORCE_SHARED_MDL |
+ MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL |
+ MYSQL_OPEN_SKIP_SCOPED_MDL_LOCK)) &&
+ ! ot_ctx->has_protection_against_grl())
+ {
+ MDL_request protection_request;
+ MDL_deadlock_handler mdl_deadlock_handler(ot_ctx);
+
+ if (thd->global_read_lock.can_acquire_protection())
+ DBUG_RETURN(TRUE);
+
+ protection_request.init(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE,
+ MDL_STATEMENT);
+
+ /*
+ Install error handler which if possible will convert deadlock error
+ into request to back-off and restart process of opening tables.
+ */
+ thd->push_internal_handler(&mdl_deadlock_handler);
+ bool result= thd->mdl_context.acquire_lock(&protection_request,
+ ot_ctx->get_timeout());
+ thd->pop_internal_handler();
+
+ if (result)
+ DBUG_RETURN(TRUE);
+
+ ot_ctx->set_has_protection_against_grl();
+ }
+
if (open_table_get_mdl_lock(thd, ot_ctx, &table_list->mdl_request,
flags, &mdl_ticket) ||
mdl_ticket == NULL)
@@ -2913,8 +2944,12 @@ retry_share:
*/
if (check_and_update_table_version(thd, table_list, share))
goto err_unlock;
- if (table_list->i_s_requested_object & OPEN_TABLE_ONLY)
+ if (table_list->i_s_requested_object & OPEN_TABLE_ONLY)
+ {
+ my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db,
+ table_list->table_name);
goto err_unlock;
+ }
/* Open view */
if (open_new_frm(thd, share, alias,
@@ -2942,7 +2977,11 @@ retry_share:
*/
if (table_list->i_s_requested_object & OPEN_VIEW_ONLY)
+ {
+ my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db,
+ table_list->table_name);
goto err_unlock;
+ }
if (!(flags & MYSQL_OPEN_IGNORE_FLUSH))
{
@@ -3056,47 +3095,16 @@ retry_share:
table->reginfo.lock_type=TL_READ; /* Assume read */
reset:
- DBUG_ASSERT(table->s->ref_count > 0 || table->s->tmp_table != NO_TMP_TABLE);
-
- if (thd->lex->need_correct_ident())
- table->alias_name_used= my_strcasecmp(table_alias_charset,
- table->s->table_name.str, alias);
- /* Fix alias if table name changes */
- if (strcmp(table->alias, alias))
- {
- uint length=(uint) strlen(alias)+1;
- table->alias= (char*) my_realloc((char*) table->alias, length,
- MYF(MY_WME));
- memcpy((char*) table->alias, alias, length);
- }
- table->tablenr=thd->current_tablenr++;
- table->used_fields=0;
- table->const_table=0;
- table->null_row= 0;
- table->maybe_null= 0;
- table->force_index= table->force_index_order= table->force_index_group= 0;
- table->status=STATUS_NO_RECORD;
- table->insert_values= 0;
- table->fulltext_searched= 0;
- table->file->ha_start_of_new_statement();
- table->reginfo.impossible_range= 0;
- /* Catch wrong handling of the auto_increment_field_not_null. */
- DBUG_ASSERT(!table->auto_increment_field_not_null);
- table->auto_increment_field_not_null= FALSE;
- if (table->timestamp_field)
- table->timestamp_field_type= table->timestamp_field->get_auto_set_type();
- table->pos_in_table_list= table_list;
- table_list->updatable= 1; // It is not derived table nor non-updatable VIEW
- table->clear_column_bitmaps();
- table_list->table= table;
/*
- Fill record with random values to find bugs where we access fields
- without first reading them.
+ Check that there is no reference to a condition from an earlier query
+ (cf. Bug#58553).
*/
- TRASH(table->record[0], table->s->reclength);
- DBUG_ASSERT(table->key_read == 0);
- /* Tables may be reused in a sub statement. */
- DBUG_ASSERT(! table->file->extra(HA_EXTRA_IS_ATTACHED_CHILDREN));
+ DBUG_ASSERT(table->file->pushed_cond == NULL);
+ table_list->updatable= 1; // It is not derived table nor non-updatable VIEW
+ table_list->table= table;
+
+ table->init(thd, table_list);
+
DBUG_RETURN(FALSE);
err_lock:
@@ -3139,22 +3147,26 @@ TABLE *find_locked_table(TABLE *list, const char *db, const char *table_name)
lock from the list of open tables, emit error if no such table
found.
- @param list List of TABLE objects to be searched
+ @param thd Thread context
@param db Database name.
@param table_name Name of table.
@param no_error Don't emit error if no suitable TABLE
instance were found.
+ @note This function checks if the connection holds a global IX
+ metadata lock. If no such lock is found, it is not safe to
+ upgrade the lock and ER_TABLE_NOT_LOCKED_FOR_WRITE will be
+ reported.
+
@return Pointer to TABLE instance with MDL_SHARED_NO_WRITE,
MDL_SHARED_NO_READ_WRITE, or MDL_EXCLUSIVE metadata
lock, NULL otherwise.
*/
-TABLE *find_table_for_mdl_upgrade(TABLE *list, const char *db,
- const char *table_name,
- bool no_error)
+TABLE *find_table_for_mdl_upgrade(THD *thd, const char *db,
+ const char *table_name, bool no_error)
{
- TABLE *tab= find_locked_table(list, db, table_name);
+ TABLE *tab= find_locked_table(thd->open_tables, db, table_name);
if (!tab)
{
@@ -3162,19 +3174,29 @@ TABLE *find_table_for_mdl_upgrade(TABLE *list, const char *db,
my_error(ER_TABLE_NOT_LOCKED, MYF(0), table_name);
return NULL;
}
- else
+
+ /*
+ It is not safe to upgrade the metadata lock without a global IX lock.
+ This can happen with FLUSH TABLES <list> WITH READ LOCK as we in these
+ cases don't take a global IX lock in order to be compatible with
+ global read lock.
+ */
+ if (!thd->mdl_context.is_lock_owner(MDL_key::GLOBAL, "", "",
+ MDL_INTENTION_EXCLUSIVE))
{
- while (tab->mdl_ticket != NULL &&
- !tab->mdl_ticket->is_upgradable_or_exclusive() &&
- (tab= find_locked_table(tab->next, db, table_name)))
- continue;
- if (!tab)
- {
- if (!no_error)
- my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), table_name);
- return 0;
- }
+ if (!no_error)
+ my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), table_name);
+ return NULL;
}
+
+ while (tab->mdl_ticket != NULL &&
+ !tab->mdl_ticket->is_upgradable_or_exclusive() &&
+ (tab= find_locked_table(tab->next, db, table_name)))
+ continue;
+
+ if (!tab && !no_error)
+ my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), table_name);
+
return tab;
}
@@ -3418,7 +3440,6 @@ unlink_all_closed_tables(THD *thd, MYSQL_LOCK *lock, size_t reopen_count)
close_thread_table(thd, &thd->open_tables);
}
- broadcast_refresh();
}
/* Exclude all closed tables from the LOCK TABLES list. */
for (TABLE_LIST *table_list= m_locked_tables; table_list; table_list=
@@ -3860,7 +3881,7 @@ static bool auto_repair_table(THD *thd, TABLE_LIST *table_list)
{
/* Give right error message */
thd->clear_error();
- my_error(ER_NOT_KEYFILE, MYF(0), share->table_name.str, my_errno);
+ my_error(ER_NOT_KEYFILE, MYF(0), share->table_name.str);
sql_print_error("Couldn't repair table: %s.%s", share->db.str,
share->table_name.str);
if (entry->file)
@@ -3895,7 +3916,8 @@ Open_table_context::Open_table_context(THD *thd, uint flags)
LONG_TIMEOUT : thd->variables.lock_wait_timeout),
m_flags(flags),
m_action(OT_NO_ACTION),
- m_has_locks(thd->mdl_context.has_locks())
+ m_has_locks(thd->mdl_context.has_locks()),
+ m_has_protection_against_grl(FALSE)
{}
@@ -4052,6 +4074,12 @@ recover_from_failed_open(THD *thd)
for safety.
*/
m_failed_table= NULL;
+ /*
+ Reset flag indicating that we have already acquired protection
+ against GRL. It is no longer valid as the corresponding lock was
+ released by close_tables_for_reopen().
+ */
+ m_has_protection_against_grl= FALSE;
/* Prepare for possible another back-off. */
m_action= OT_NO_ACTION;
return result;
@@ -4569,13 +4597,15 @@ lock_table_names(THD *thd,
! (flags & MYSQL_OPEN_SKIP_TEMPORARY) &&
find_temporary_table(thd, table))))
{
- if (schema_set.insert(table))
+ if (! (flags & MYSQL_OPEN_SKIP_SCOPED_MDL_LOCK) &&
+ schema_set.insert(table))
return TRUE;
mdl_requests.push_front(&table->mdl_request);
}
}
- if (! mdl_requests.is_empty())
+ if (! (flags & MYSQL_OPEN_SKIP_SCOPED_MDL_LOCK) &&
+ ! mdl_requests.is_empty())
{
/*
Scoped locks: Take intention exclusive locks on all involved
@@ -4588,11 +4618,20 @@ lock_table_names(THD *thd,
if (schema_request == NULL)
return TRUE;
schema_request->init(MDL_key::SCHEMA, table->db, "",
- MDL_INTENTION_EXCLUSIVE);
+ MDL_INTENTION_EXCLUSIVE,
+ MDL_TRANSACTION);
mdl_requests.push_front(schema_request);
}
- /* Take the global intention exclusive lock. */
- global_request.init(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE);
+
+ /*
+ Protect this statement against concurrent global read lock
+ by acquiring global intention exclusive lock with statement
+ duration.
+ */
+ if (thd->global_read_lock.can_acquire_protection())
+ return TRUE;
+ global_request.init(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE,
+ MDL_STATEMENT);
mdl_requests.push_front(&global_request);
}
@@ -4655,8 +4694,7 @@ open_tables_check_upgradable_mdl(THD *thd, TABLE_LIST *tables_start,
Note that find_table_for_mdl_upgrade() will report an error if
no suitable ticket is found.
*/
- if (!find_table_for_mdl_upgrade(thd->open_tables, table->db,
- table->table_name, FALSE))
+ if (!find_table_for_mdl_upgrade(thd, table->db, table->table_name, false))
return TRUE;
}
}
@@ -4713,6 +4751,14 @@ bool open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags,
bool has_prelocking_list;
DBUG_ENTER("open_tables");
+ /* Accessing data in XA_IDLE or XA_PREPARED is not allowed. */
+ enum xa_states xa_state= thd->transaction.xid_state.xa_state;
+ if (*start && (xa_state == XA_IDLE || xa_state == XA_PREPARED))
+ {
+ my_error(ER_XAER_RMFAIL, MYF(0), xa_state_names[xa_state]);
+ DBUG_RETURN(true);
+ }
+
/*
temporary mem_root for new .frm parsing.
TODO: variables for size
@@ -5210,6 +5256,8 @@ static bool check_lock_and_start_stmt(THD *thd,
@param[in] lock_type lock to use for table
@param[in] flags options to be used while opening and locking
table (see open_table(), mysql_lock_tables())
+ @param[in] prelocking_strategy Strategy which specifies how prelocking
+ algorithm should work for this statement.
@return table
@retval != NULL OK, opened table returned
@@ -5235,7 +5283,8 @@ static bool check_lock_and_start_stmt(THD *thd,
*/
TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l,
- thr_lock_type lock_type, uint flags)
+ thr_lock_type lock_type, uint flags,
+ Prelocking_strategy *prelocking_strategy)
{
TABLE_LIST *save_next_global;
DBUG_ENTER("open_n_lock_single_table");
@@ -5251,7 +5300,8 @@ TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l,
table_l->required_type= FRMTYPE_TABLE;
/* Open the table. */
- if (open_and_lock_tables(thd, table_l, FALSE, flags))
+ if (open_and_lock_tables(thd, table_l, FALSE, flags,
+ prelocking_strategy))
table_l->table= NULL; /* Just to be sure. */
/* Restore list. */
@@ -5360,7 +5410,11 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type,
end:
if (table == NULL)
+ {
+ if (!thd->in_sub_stmt)
+ trans_rollback_stmt(thd);
close_thread_tables(thd);
+ }
thd_proc_info(thd, 0);
DBUG_RETURN(table);
}
@@ -5391,7 +5445,7 @@ bool open_and_lock_tables(THD *thd, TABLE_LIST *tables,
Prelocking_strategy *prelocking_strategy)
{
uint counter;
- MDL_ticket *mdl_savepoint= thd->mdl_context.mdl_savepoint();
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
DBUG_ENTER("open_and_lock_tables");
DBUG_PRINT("enter", ("derived handling: %d", derived));
@@ -5407,11 +5461,19 @@ bool open_and_lock_tables(THD *thd, TABLE_LIST *tables,
if (lock_tables(thd, tables, counter, flags))
goto err;
- if (derived &&
- (mysql_handle_derived(thd->lex, &mysql_derived_prepare) ||
- (thd->fill_derived_tables() &&
- mysql_handle_derived(thd->lex, &mysql_derived_filling))))
- goto err;
+ if (derived)
+ {
+ if (mysql_handle_derived(thd->lex, &mysql_derived_prepare))
+ goto err;
+ if (thd->fill_derived_tables() &&
+ mysql_handle_derived(thd->lex, &mysql_derived_filling))
+ {
+ mysql_handle_derived(thd->lex, &mysql_derived_cleanup);
+ goto err;
+ }
+ if (!thd->lex->describe)
+ mysql_handle_derived(thd->lex, &mysql_derived_cleanup);
+ }
DBUG_RETURN(FALSE);
err:
@@ -5448,7 +5510,7 @@ bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags)
{
DML_prelocking_strategy prelocking_strategy;
uint counter;
- MDL_ticket *mdl_savepoint= thd->mdl_context.mdl_savepoint();
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
DBUG_ENTER("open_normal_and_derived_tables");
DBUG_ASSERT(!thd->fill_derived_tables());
if (open_tables(thd, &tables, &counter, flags, &prelocking_strategy) ||
@@ -5705,7 +5767,7 @@ bool lock_tables(THD *thd, TABLE_LIST *tables, uint count,
*/
void close_tables_for_reopen(THD *thd, TABLE_LIST **tables,
- MDL_ticket *start_of_statement_svp)
+ const MDL_savepoint &start_of_statement_svp)
{
TABLE_LIST *first_not_own_table= thd->lex->first_not_own_table();
TABLE_LIST *tmp;
@@ -5743,35 +5805,37 @@ void close_tables_for_reopen(THD *thd, TABLE_LIST **tables,
}
-/*
- Open a single table without table caching and don't set it in open_list
-
- SYNPOSIS
- open_temporary_table()
- thd Thread object
- path Path (without .frm)
- db database
- table_name Table name
- link_in_list 1 if table should be linked into thd->temporary_tables
-
- NOTES:
- Used by alter_table to open a temporary table and when creating
- a temporary table with CREATE TEMPORARY ...
-
- RETURN
- 0 Error
- # TABLE object
+/**
+ Open a single table without table caching and don't add it to
+ THD::open_tables. Depending on the 'add_to_temporary_tables_list' value,
+ the opened TABLE instance will be addded to THD::temporary_tables list.
+
+ @param thd Thread context.
+ @param path Path (without .frm)
+ @param db Database name.
+ @param table_name Table name.
+ @param add_to_temporary_tables_list Specifies if the opened TABLE
+ instance should be linked into
+ THD::temporary_tables list.
+
+ @note This function is used:
+ - by alter_table() to open a temporary table;
+ - when creating a temporary table with CREATE TEMPORARY TABLE.
+
+ @return TABLE instance for opened table.
+ @retval NULL on error.
*/
-TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
- const char *table_name, bool link_in_list)
+TABLE *open_table_uncached(THD *thd, const char *path, const char *db,
+ const char *table_name,
+ bool add_to_temporary_tables_list)
{
TABLE *tmp_table;
TABLE_SHARE *share;
char cache_key[MAX_DBKEY_LENGTH], *saved_cache_key, *tmp_path;
uint key_length;
TABLE_LIST table_list;
- DBUG_ENTER("open_temporary_table");
+ DBUG_ENTER("open_table_uncached");
DBUG_PRINT("enter",
("table: '%s'.'%s' path: '%s' server_id: %u "
"pseudo_thread_id: %lu",
@@ -5814,7 +5878,7 @@ TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
share->tmp_table= (tmp_table->file->has_transactions() ?
TRANSACTIONAL_TMP_TABLE : NON_TRANSACTIONAL_TMP_TABLE);
- if (link_in_list)
+ if (add_to_temporary_tables_list)
{
/* growing temp list at the head */
tmp_table->next= thd->temporary_tables;
@@ -6144,6 +6208,8 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name,
/*
Find field by name in a base table or a view with temp table algorithm.
+ The caller is expected to check column-level privileges.
+
SYNOPSIS
find_field_in_table()
thd thread handler
@@ -6251,6 +6317,8 @@ find_field_in_table(THD *thd, TABLE *table, const char *name, uint length,
This procedure detects the type of the table reference 'table_list'
and calls the corresponding search routine.
+ The routine checks column-level privieleges for the found field.
+
RETURN
0 field is not found
view_ref_found found value in VIEW (real result is in *ref)
@@ -6526,8 +6594,16 @@ find_field_in_tables(THD *thd, Item_ident *item,
when table_ref->field_translation != NULL.
*/
if (table_ref->table && !table_ref->view)
+ {
found= find_field_in_table(thd, table_ref->table, name, length,
TRUE, &(item->cached_field_index));
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ /* Check if there are sufficient access rights to the found field. */
+ if (found && check_privileges &&
+ check_column_grant_in_table_ref(thd, table_ref, name, length))
+ found= WRONG_GRANT;
+#endif
+ }
else
found= find_field_in_table_ref(thd, table_ref, name, length, item->name,
NULL, NULL, ref, check_privileges,
@@ -7567,9 +7643,10 @@ static bool setup_natural_join_row_types(THD *thd,
List<TABLE_LIST> *from_clause,
Name_resolution_context *context)
{
+ DBUG_ENTER("setup_natural_join_row_types");
thd->where= "from clause";
if (from_clause->elements == 0)
- return FALSE; /* We come here in the case of UNIONs. */
+ DBUG_RETURN(false); /* We come here in the case of UNIONs. */
List_iterator_fast<TABLE_LIST> table_ref_it(*from_clause);
TABLE_LIST *table_ref; /* Current table reference. */
@@ -7577,10 +7654,6 @@ static bool setup_natural_join_row_types(THD *thd,
TABLE_LIST *left_neighbor;
/* Table reference to the right of the current. */
TABLE_LIST *right_neighbor= NULL;
- bool save_first_natural_join_processing=
- context->select_lex->first_natural_join_processing;
-
- context->select_lex->first_natural_join_processing= FALSE;
/* Note that tables in the list are in reversed order */
for (left_neighbor= table_ref_it++; left_neighbor ; )
@@ -7592,12 +7665,11 @@ static bool setup_natural_join_row_types(THD *thd,
1) for stored procedures,
2) for multitable update after lock failure and table reopening.
*/
- if (save_first_natural_join_processing)
+ if (context->select_lex->first_natural_join_processing)
{
- context->select_lex->first_natural_join_processing= FALSE;
if (store_top_level_join_columns(thd, table_ref,
left_neighbor, right_neighbor))
- return TRUE;
+ DBUG_RETURN(true);
if (left_neighbor)
{
TABLE_LIST *first_leaf_on_the_right;
@@ -7617,8 +7689,9 @@ static bool setup_natural_join_row_types(THD *thd,
DBUG_ASSERT(right_neighbor);
context->first_name_resolution_table=
right_neighbor->first_leaf_for_name_resolution();
+ context->select_lex->first_natural_join_processing= false;
- return FALSE;
+ DBUG_RETURN (false);
}
@@ -7892,7 +7965,7 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
}
if (tablenr > MAX_TABLES)
{
- my_error(ER_TOO_MANY_TABLES,MYF(0),MAX_TABLES);
+ my_error(ER_TOO_MANY_TABLES,MYF(0), static_cast<int>(MAX_TABLES));
DBUG_RETURN(1);
}
for (table_list= tables;
diff --git a/sql/sql_base.h b/sql/sql_base.h
index 2f365771416..a79c1a28e39 100644
--- a/sql/sql_base.h
+++ b/sql/sql_base.h
@@ -1,4 +1,4 @@
-/* Copyright 2006-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -17,7 +17,6 @@
#define SQL_BASE_INCLUDED
#include "unireg.h" // REQUIRED: for other includes
-#include "table.h" /* open_table_mode */
#include "sql_trigger.h" /* trg_event_type */
#include "sql_class.h" /* enum_mark_columns */
#include "mysqld.h" /* key_map */
@@ -71,8 +70,6 @@ enum enum_tdc_remove_table_type {TDC_RT_REMOVE_ALL, TDC_RT_REMOVE_NOT_OWN,
bool check_dup(const char *db, const char *name, TABLE_LIST *tables);
extern mysql_mutex_t LOCK_open;
-extern mysql_mutex_t LOCK_dd_owns_lock_open;
-extern uint dd_owns_lock_open;
bool table_cache_init(void);
void table_cache_free(void);
bool table_def_init(void);
@@ -81,7 +78,8 @@ void table_def_start_shutdown(void);
void assign_new_table_id(TABLE_SHARE *share);
uint cached_open_tables(void);
uint cached_table_definitions(void);
-uint create_table_def_key(THD *thd, char *key, TABLE_LIST *table_list,
+uint create_table_def_key(THD *thd, char *key,
+ const TABLE_LIST *table_list,
bool tmp_table);
TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key,
uint key_length, uint db_flags, int *error,
@@ -124,6 +122,11 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type update,
(LONG_TIMEOUT = 1 year) rather than the user-supplied timeout value.
*/
#define MYSQL_LOCK_IGNORE_TIMEOUT 0x0800
+/**
+ When acquiring "strong" (SNW, SNRW, X) metadata locks on tables to
+ be open do not acquire global and schema-scope IX locks.
+*/
+#define MYSQL_OPEN_SKIP_SCOPED_MDL_LOCK 0x1000
/** Please refer to the internals manual. */
#define MYSQL_OPEN_REOPEN (MYSQL_OPEN_IGNORE_FLUSH |\
@@ -143,8 +146,9 @@ bool open_new_frm(THD *thd, TABLE_SHARE *share, const char *alias,
bool get_key_map_from_key_list(key_map *map, TABLE *table,
List<String> *index_list);
-TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
- const char *table_name, bool link_in_list);
+TABLE *open_table_uncached(THD *thd, const char *path, const char *db,
+ const char *table_name,
+ bool add_to_temporary_tables_list);
TABLE *find_locked_table(TABLE *list, const char *db, const char *table_name);
TABLE *find_write_locked_table(TABLE *list, const char *db,
const char *table_name);
@@ -155,13 +159,15 @@ thr_lock_type read_lock_type_for_table(THD *thd,
my_bool mysql_rm_tmp_tables(void);
bool rm_temporary_table(handlerton *base, char *path);
void close_tables_for_reopen(THD *thd, TABLE_LIST **tables,
- MDL_ticket *start_of_statement_svp);
+ const MDL_savepoint &start_of_statement_svp);
TABLE_LIST *find_table_in_list(TABLE_LIST *table,
TABLE_LIST *TABLE_LIST::*link,
const char *db_name,
const char *table_name);
TABLE *find_temporary_table(THD *thd, const char *db, const char *table_name);
-TABLE *find_temporary_table(THD *thd, TABLE_LIST *table_list);
+TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl);
+TABLE *find_temporary_table(THD *thd, const char *table_key,
+ uint table_key_length);
void close_thread_tables(THD *thd);
bool fill_record_n_invoke_before_triggers(THD *thd, List<Item> &fields,
List<Item> &values,
@@ -237,10 +243,10 @@ bool open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags,
bool open_and_lock_tables(THD *thd, TABLE_LIST *tables,
bool derived, uint flags,
Prelocking_strategy *prelocking_strategy);
-int open_and_lock_tables_derived(THD *thd, TABLE_LIST *tables, bool derived);
/* simple open_and_lock_tables without derived handling for single table */
TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l,
- thr_lock_type lock_type, uint flags);
+ thr_lock_type lock_type, uint flags,
+ Prelocking_strategy *prelocking_strategy);
bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags);
bool lock_tables(THD *thd, TABLE_LIST *tables, uint counter, uint flags);
int decide_logging_format(THD *thd, TABLE_LIST *tables);
@@ -284,7 +290,7 @@ bool tdc_open_view(THD *thd, TABLE_LIST *table_list, const char *alias,
char *cache_key, uint cache_key_length,
MEM_ROOT *mem_root, uint flags);
void tdc_flush_unused_tables();
-TABLE *find_table_for_mdl_upgrade(TABLE *list, const char *db,
+TABLE *find_table_for_mdl_upgrade(THD *thd, const char *db,
const char *table_name,
bool no_error);
void mark_tmp_table_for_reuse(TABLE *table);
@@ -450,6 +456,16 @@ open_tables(THD *thd, TABLE_LIST **tables, uint *counter, uint flags)
}
+inline TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l,
+ thr_lock_type lock_type, uint flags)
+{
+ DML_prelocking_strategy prelocking_strategy;
+
+ return open_n_lock_single_table(thd, table_l, lock_type, flags,
+ &prelocking_strategy);
+}
+
+
/* open_and_lock_tables with derived handling */
inline bool open_and_lock_tables(THD *thd, TABLE_LIST *tables,
bool derived, uint flags)
@@ -492,7 +508,7 @@ public:
the statement, so that we can rollback to it before waiting on
locks.
*/
- MDL_ticket *start_of_statement_svp() const
+ const MDL_savepoint &start_of_statement_svp() const
{
return m_start_of_statement_svp;
}
@@ -503,6 +519,21 @@ public:
}
uint get_flags() const { return m_flags; }
+
+ /**
+ Set flag indicating that we have already acquired metadata lock
+ protecting this statement against GRL while opening tables.
+ */
+ void set_has_protection_against_grl()
+ {
+ m_has_protection_against_grl= TRUE;
+ }
+
+ bool has_protection_against_grl() const
+ {
+ return m_has_protection_against_grl;
+ }
+
private:
/**
For OT_DISCOVER and OT_REPAIR actions, the table list element for
@@ -510,7 +541,7 @@ private:
should be repaired.
*/
TABLE_LIST *m_failed_table;
- MDL_ticket *m_start_of_statement_svp;
+ MDL_savepoint m_start_of_statement_svp;
/**
Lock timeout in seconds. Initialized to LONG_TIMEOUT when opening system
tables or to the "lock_wait_timeout" system variable for regular tables.
@@ -526,6 +557,11 @@ private:
and we can't safely do back-off (and release them).
*/
bool m_has_locks;
+ /**
+ Indicates that in the process of opening tables we have acquired
+ protection against global read lock.
+ */
+ bool m_has_protection_against_grl;
};
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index 76c6e0e058a..f08125ca22f 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2006 MySQL AB
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -61,6 +61,13 @@ void mysql_client_binlog_statement(THD* thd)
size_t decoded_len= base64_needed_decoded_length(coded_len);
/*
+ option_bits will be changed when applying the event. But we don't expect
+ it be changed permanently after BINLOG statement, so backup it first.
+ It will be restored at the end of this function.
+ */
+ ulonglong thd_options= thd->variables.option_bits;
+
+ /*
Allocation
*/
@@ -235,7 +242,7 @@ void mysql_client_binlog_statement(THD* thd)
TODO: Maybe a better error message since the BINLOG statement
now contains several events.
*/
- my_error(ER_UNKNOWN_ERROR, MYF(0), "Error executing BINLOG statement");
+ my_error(ER_UNKNOWN_ERROR, MYF(0));
goto end;
}
}
@@ -246,6 +253,7 @@ void mysql_client_binlog_statement(THD* thd)
my_ok(thd);
end:
+ thd->variables.option_bits= thd_options;
rli->slave_close_thread_tables(thd);
my_free(buf);
DBUG_VOID_RETURN;
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 30dd835e9eb..feb9614efe7 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -334,6 +334,7 @@ TODO list:
#include "tztime.h" // struct Time_zone
#include "sql_acl.h" // SELECT_ACL
#include "sql_base.h" // TMP_TABLE_KEY_EXTRA
+#include "debug_sync.h" // DEBUG_SYNC
#ifdef HAVE_QUERY_CACHE
#include <m_ctype.h>
#include <my_dir.h>
@@ -342,6 +343,7 @@ TODO list:
#include "../storage/myisammrg/myrg_def.h"
#include "probes_mysql.h"
#include "log_slow.h"
+#include "transaction.h"
#ifdef EMBEDDED_LIBRARY
#include "emb_qcache.h"
@@ -371,42 +373,6 @@ TODO list:
__LINE__,(ulong)(B)));B->query()->unlock_reading();}
#define DUMP(C) DBUG_EXECUTE("qcache", {\
(C)->cache_dump(); (C)->queries_dump();(C)->tables_dump();})
-
-
-/**
- Causes the thread to wait in a spin lock for a query kill signal.
- This function is used by the test frame work to identify race conditions.
-
- The signal is caught and ignored and the thread is not killed.
-*/
-
-static void debug_wait_for_kill(const char *info)
-{
- const char *prev_info;
- THD *thd;
- char buff[1024];
- DBUG_ENTER("debug_wait_for_kill");
-
- thd= current_thd;
- prev_info= thd->proc_info;
- thd->proc_info= info;
- sql_print_information("%s", info);
- while(!thd->killed)
- my_sleep(1000);
- thd->killed= THD::NOT_KILLED;
- /*
- Remove the set debug variable, to ensure we don't get stuck on it again
- This is needed as for MyISAM, invalidate_table() may be called twice
- (Once from mysql_delete() and once from mi_update_status())
- */
- sprintf(buff, "-d,%s", info);
- DBUG_SET(buff);
- sql_print_information("Exit debug_wait_for_kill");
- thd->proc_info= prev_info;
-
- DBUG_VOID_RETURN;
-}
-
#else
#define RW_WLOCK(M) mysql_rwlock_wrlock(M)
#define RW_RLOCK(M) mysql_rwlock_rdlock(M)
@@ -418,6 +384,52 @@ static void debug_wait_for_kill(const char *info)
#define DUMP(C)
#endif
+
+/**
+ Macro that executes the requested action at a synchronization point
+ only if the thread has a associated THD session.
+*/
+#if defined(ENABLED_DEBUG_SYNC)
+#define QC_DEBUG_SYNC(name) \
+ do { \
+ THD *thd= current_thd; \
+ if (thd) \
+ DEBUG_SYNC(thd, name); \
+ } while (0)
+#else
+#define QC_DEBUG_SYNC(name)
+#endif
+
+
+/**
+ Thread state to be used when the query cache lock needs to be acquired.
+ Sets the thread state name in the constructor, resets on destructor.
+*/
+
+struct Query_cache_wait_state
+{
+ THD *m_thd;
+ const char *m_proc_info;
+
+ Query_cache_wait_state(THD *thd, const char *func,
+ const char *file, unsigned int line)
+ : m_thd(thd),
+ m_proc_info(NULL)
+ {
+ if (m_thd)
+ m_proc_info= set_thd_proc_info(m_thd,
+ "Waiting for query cache lock",
+ func, file, line);
+ }
+
+ ~Query_cache_wait_state()
+ {
+ if (m_thd)
+ set_thd_proc_info(m_thd, m_proc_info, NULL, NULL, 0);
+ }
+};
+
+
/**
Serialize access to the query cache.
If the lock cannot be granted the thread hangs in a conditional wait which
@@ -439,6 +451,8 @@ static void debug_wait_for_kill(const char *info)
bool Query_cache::try_lock(bool use_timeout)
{
bool interrupt= FALSE;
+ THD *thd= current_thd;
+ Query_cache_wait_state wait_state(thd, __func__, __FILE__, __LINE__);
DBUG_ENTER("Query_cache::try_lock");
mysql_mutex_lock(&structure_guard_mutex);
@@ -448,7 +462,6 @@ bool Query_cache::try_lock(bool use_timeout)
{
m_cache_lock_status= Query_cache::LOCKED;
#ifndef DBUG_OFF
- THD *thd= current_thd;
if (thd)
m_cache_lock_thread_id= thd->thread_id;
#endif
@@ -507,6 +520,8 @@ bool Query_cache::try_lock(bool use_timeout)
void Query_cache::lock_and_suspend(void)
{
+ THD *thd= current_thd;
+ Query_cache_wait_state wait_state(thd, __func__, __FILE__, __LINE__);
DBUG_ENTER("Query_cache::lock_and_suspend");
mysql_mutex_lock(&structure_guard_mutex);
@@ -514,7 +529,6 @@ void Query_cache::lock_and_suspend(void)
mysql_cond_wait(&COND_cache_status_changed, &structure_guard_mutex);
m_cache_lock_status= Query_cache::LOCKED_NO_WAIT;
#ifndef DBUG_OFF
- THD *thd= current_thd;
if (thd)
m_cache_lock_thread_id= thd->thread_id;
#endif
@@ -535,6 +549,8 @@ void Query_cache::lock_and_suspend(void)
void Query_cache::lock(void)
{
+ THD *thd= current_thd;
+ Query_cache_wait_state wait_state(thd, __func__, __FILE__, __LINE__);
DBUG_ENTER("Query_cache::lock");
mysql_mutex_lock(&structure_guard_mutex);
@@ -542,7 +558,6 @@ void Query_cache::lock(void)
mysql_cond_wait(&COND_cache_status_changed, &structure_guard_mutex);
m_cache_lock_status= Query_cache::LOCKED;
#ifndef DBUG_OFF
- THD *thd= current_thd;
if (thd)
m_cache_lock_thread_id= thd->thread_id;
#endif
@@ -882,9 +897,7 @@ Query_cache::insert(Query_cache_tls *query_cache_tls,
if (is_disabled() || query_cache_tls->first_query_block == NULL)
DBUG_VOID_RETURN;
- DBUG_EXECUTE_IF("wait_in_query_cache_insert",
- debug_wait_for_kill("wait_in_query_cache_insert"); );
-
+ QC_DEBUG_SYNC("wait_in_query_cache_insert");
if (try_lock())
DBUG_VOID_RETURN;
@@ -1695,6 +1708,8 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
}
else
thd->lex->safe_to_cache_query= 0; // Don't try to cache this
+ /* End the statement transaction potentially started by engine. */
+ trans_rollback_stmt(thd);
goto err_unlock; // Parse query
}
else
@@ -1737,6 +1752,14 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d",
thd->limit_found_rows = query->found_rows();
thd->status_var.last_query_cost= 0.0;
thd->query_plan_flags= (thd->query_plan_flags & ~QPLAN_QC_NO) | QPLAN_QC;
+
+ /*
+ End the statement transaction potentially started by an
+ engine callback. We ignore the return value for now,
+ since as long as EOF packet is part of the query cache
+ response, we can't handle it anyway.
+ */
+ (void) trans_commit_stmt(thd);
if (!thd->stmt_da->is_set())
thd->stmt_da->disable_status();
@@ -1786,8 +1809,7 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used,
invalidate_table(thd, tables_used);
}
- DBUG_EXECUTE_IF("wait_after_query_cache_invalidate",
- debug_wait_for_kill("wait_after_query_cache_invalidate"););
+ DEBUG_SYNC(thd, "wait_after_query_cache_invalidate");
DBUG_VOID_RETURN;
}
@@ -1978,8 +2000,7 @@ void Query_cache::flush()
if (is_disabled())
DBUG_VOID_RETURN;
- DBUG_EXECUTE_IF("wait_in_query_cache_flush1",
- debug_wait_for_kill("wait_in_query_cache_flush1"););
+ QC_DEBUG_SYNC("wait_in_query_cache_flush1");
lock_and_suspend();
if (query_cache_size > 0)
@@ -2319,9 +2340,7 @@ void Query_cache::free_cache()
void Query_cache::flush_cache()
{
-
- DBUG_EXECUTE_IF("wait_in_query_cache_flush2",
- debug_wait_for_kill("wait_in_query_cache_flush2"););
+ QC_DEBUG_SYNC("wait_in_query_cache_flush2");
my_hash_reset(&queries);
while (queries_blocks != 0)
@@ -2767,8 +2786,7 @@ void Query_cache::invalidate_table(THD *thd, TABLE *table)
void Query_cache::invalidate_table(THD *thd, uchar * key, uint32 key_length)
{
- DBUG_EXECUTE_IF("wait_in_query_cache_invalidate1",
- debug_wait_for_kill("wait_in_query_cache_invalidate1"); );
+ DEBUG_SYNC(thd, "wait_in_query_cache_invalidate1");
/*
Lock the query cache and queue all invalidation attempts to avoid
@@ -2776,9 +2794,7 @@ void Query_cache::invalidate_table(THD *thd, uchar * key, uint32 key_length)
*/
lock();
- DBUG_EXECUTE_IF("wait_in_query_cache_invalidate2",
- debug_wait_for_kill("wait_in_query_cache_invalidate2"); );
-
+ DEBUG_SYNC(thd, "wait_in_query_cache_invalidate2");
if (query_cache_size > 0)
invalidate_table_internal(thd, key, key_length);
@@ -2828,7 +2844,6 @@ Query_cache::invalidate_query_block_list(THD *thd,
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););
}
}
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 7638cf8f8f6..84adfddc4ac 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*****************************************************************************
@@ -273,6 +273,252 @@ bool Foreign_key::validate(List<Create_field> &table_fields)
** Thread specific functions
****************************************************************************/
+/**
+ Get reference to scheduler data object
+
+ @param thd THD object
+
+ @retval Scheduler data object on THD
+*/
+void *thd_get_scheduler_data(THD *thd)
+{
+ return thd->scheduler.data;
+}
+
+/**
+ Set reference to Scheduler data object for THD object
+
+ @param thd THD object
+ @param psi Scheduler data object to set on THD
+*/
+void thd_set_scheduler_data(THD *thd, void *data)
+{
+ thd->scheduler.data= data;
+}
+
+/**
+ Get reference to Performance Schema object for THD object
+
+ @param thd THD object
+
+ @retval Performance schema object for thread on THD
+*/
+PSI_thread *thd_get_psi(THD *thd)
+{
+ return thd->scheduler.m_psi;
+}
+
+/**
+ Set reference to Performance Schema object for THD object
+
+ @param thd THD object
+ @param psi Performance schema object for thread
+*/
+void thd_set_psi(THD *thd, PSI_thread *psi)
+{
+ thd->scheduler.m_psi= psi;
+}
+
+/**
+ Set the state on connection to killed
+
+ @param thd THD object
+*/
+void thd_set_killed(THD *thd)
+{
+ thd->killed= THD::KILL_CONNECTION;
+}
+
+/**
+ Clear errors from the previous THD
+
+ @param thd THD object
+*/
+void thd_clear_errors(THD *thd)
+{
+ my_errno= 0;
+ thd->mysys_var->abort= 0;
+}
+
+/**
+ Set thread stack in THD object
+
+ @param thd Thread object
+ @param stack_start Start of stack to set in THD object
+*/
+void thd_set_thread_stack(THD *thd, char *stack_start)
+{
+ thd->thread_stack= stack_start;
+}
+
+/**
+ Lock connection data for the set of connections this connection
+ belongs to
+
+ @param thd THD object
+*/
+void thd_lock_thread_count(THD *)
+{
+ mysql_mutex_lock(&LOCK_thread_count);
+}
+
+/**
+ Lock connection data for the set of connections this connection
+ belongs to
+
+ @param thd THD object
+*/
+void thd_unlock_thread_count(THD *)
+{
+ mysql_cond_broadcast(&COND_thread_count);
+ mysql_mutex_unlock(&LOCK_thread_count);
+}
+
+/**
+ Close the socket used by this connection
+
+ @param thd THD object
+*/
+void thd_close_connection(THD *thd)
+{
+ if (thd->net.vio)
+ vio_close(thd->net.vio);
+}
+
+/**
+ Get current THD object from thread local data
+
+ @retval The THD object for the thread, NULL if not connection thread
+*/
+THD *thd_get_current_thd()
+{
+ return current_thd;
+}
+
+/**
+ Set up various THD data for a new connection
+
+ thd_new_connection_setup
+
+ @param thd THD object
+ @param stack_start Start of stack for connection
+*/
+void thd_new_connection_setup(THD *thd, char *stack_start)
+{
+#ifdef HAVE_PSI_INTERFACE
+ if (PSI_server)
+ thd_set_psi(thd,
+ PSI_server->new_thread(key_thread_one_connection,
+ thd,
+ thd_get_thread_id((MYSQL_THD)thd)));
+#endif
+ thd->set_time();
+ thd->prior_thr_create_utime= thd->thr_create_utime= thd->start_utime=
+ my_micro_time();
+ threads.append(thd);
+ thd_unlock_thread_count(thd);
+ DBUG_PRINT("info", ("init new connection. thd: 0x%lx fd: %d",
+ (ulong)thd, thd->net.vio->sd));
+ thd_set_thread_stack(thd, stack_start);
+}
+
+/**
+ Lock data that needs protection in THD object
+
+ @param thd THD object
+*/
+void thd_lock_data(THD *thd)
+{
+ mysql_mutex_lock(&thd->LOCK_thd_data);
+}
+
+/**
+ Unlock data that needs protection in THD object
+
+ @param thd THD object
+*/
+void thd_unlock_data(THD *thd)
+{
+ mysql_mutex_unlock(&thd->LOCK_thd_data);
+}
+
+/**
+ Support method to check if connection has already started transcaction
+
+ @param client_cntx Low level client context
+
+ @retval TRUE if connection already started transaction
+*/
+bool thd_is_transaction_active(THD *thd)
+{
+ return thd->transaction.is_active();
+}
+
+/**
+ Check if there is buffered data on the socket representing the connection
+
+ @param thd THD object
+*/
+int thd_connection_has_data(THD *thd)
+{
+ Vio *vio= thd->net.vio;
+ return vio->has_data(vio);
+}
+
+/**
+ Set reading/writing on socket, used by SHOW PROCESSLIST
+
+ @param thd THD object
+ @param val Value to set it to (0 or 1)
+*/
+void thd_set_net_read_write(THD *thd, uint val)
+{
+ thd->net.reading_or_writing= val;
+}
+
+/**
+ Set reference to mysys variable in THD object
+
+ @param thd THD object
+ @param mysys_var Reference to set
+*/
+void thd_set_mysys_var(THD *thd, st_my_thread_var *mysys_var)
+{
+ thd->set_mysys_var(mysys_var);
+}
+
+/**
+ Get socket file descriptor for this connection
+
+ @param thd THD object
+
+ @retval Socket of the connection
+*/
+my_socket thd_get_fd(THD *thd)
+{
+ return thd->net.vio->sd;
+}
+
+/**
+ Get thread attributes for connection threads
+
+ @retval Reference to thread attribute for connection threads
+*/
+pthread_attr_t *get_connection_attrib(void)
+{
+ return &connection_attrib;
+}
+
+/**
+ Get max number of connections
+
+ @retval Max number of connections for MySQL Server
+*/
+ulong get_max_connections(void)
+{
+ return max_connections;
+}
+
/*
The following functions form part of the C plugin API
*/
@@ -328,9 +574,11 @@ const char *set_thd_proc_info(void *thd_arg, const char *info,
thd= current_thd;
const char *old_info= thd->proc_info;
- DBUG_PRINT("proc_info", ("%s:%d %s", calling_file, calling_line, info));
+ const char *basename= calling_file ? base_name(calling_file) : NULL;
+ DBUG_PRINT("proc_info", ("%s:%d %s", basename, calling_line, info));
+
#if defined(ENABLED_PROFILING)
- thd->profiling.status_change(info, calling_function, calling_file, calling_line);
+ thd->profiling.status_change(info, calling_function, basename, calling_line);
#endif
thd->proc_info= info;
return old_info;
@@ -548,7 +796,7 @@ bool Drop_table_error_handler::handle_condition(THD *thd,
THD::THD()
- :Statement(&main_lex, &main_mem_root, CONVENTIONAL_EXECUTION,
+ :Statement(&main_lex, &main_mem_root, STMT_CONVENTIONAL_EXECUTION,
/* statement id */ 0),
rli_fake(0),
user_time(0), in_sub_stmt(0),
@@ -576,7 +824,7 @@ THD::THD()
#if defined(ENABLED_DEBUG_SYNC)
debug_sync_control(0),
#endif /* defined(ENABLED_DEBUG_SYNC) */
- main_warning_info(0)
+ main_warning_info(0, false)
{
ulong tmp;
@@ -594,7 +842,8 @@ THD::THD()
catalog= (char*)"std"; // the only catalog we have for now
main_security_ctx.init();
security_ctx= &main_security_ctx;
- no_errors=password= 0;
+ no_errors= 0;
+ password= 0;
query_start_used= 0;
count_cuted_fields= CHECK_FIELD_IGNORE;
killed= NOT_KILLED;
@@ -637,7 +886,7 @@ THD::THD()
client_capabilities= 0; // minimalistic client
ull=0;
system_thread= NON_SYSTEM_THREAD;
- cleanup_done= abort_on_warning= no_warnings_for_error= 0;
+ cleanup_done= abort_on_warning= 0;
peer_port= 0; // For SHOW PROCESSLIST
transaction.m_pending_rows_event= 0;
transaction.on= 1;
@@ -692,8 +941,8 @@ THD::THD()
thr_lock_info_init(&lock_info); /* safety: will be reset after start */
m_internal_handler= NULL;
+ m_binlog_invoker= FALSE;
arena_for_cached_items= 0;
- current_user_used= FALSE;
memset(&invoker_user, 0, sizeof(invoker_user));
memset(&invoker_host, 0, sizeof(invoker_host));
}
@@ -917,10 +1166,6 @@ MYSQL_ERROR* THD::raise_condition(uint sql_errno,
query_cache_abort(&query_cache_tls);
- /* FIXME: broken special case */
- if (no_warnings_for_error && (level == MYSQL_ERROR::WARN_LEVEL_ERROR))
- DBUG_RETURN(NULL);
-
/* When simulating OOM, skip writing to error log to avoid mtr errors */
DBUG_EXECUTE_IF("simulate_out_of_memory", DBUG_RETURN(NULL););
@@ -1313,36 +1558,70 @@ void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var,
#endif
+/**
+ Awake a thread.
+
+ @param[in] state_to_set value for THD::killed
+
+ This is normally called from another thread's THD object.
+
+ @note Do always call this while holding LOCK_thd_data.
+*/
+
void THD::awake(THD::killed_state state_to_set)
{
DBUG_ENTER("THD::awake");
- DBUG_PRINT("enter", ("this: 0x%lx", (long) this));
+ DBUG_PRINT("enter", ("this: %p current_thd: %p", this, current_thd));
THD_CHECK_SENTRY(this);
mysql_mutex_assert_owner(&LOCK_thd_data);
+ /* Set the 'killed' flag of 'this', which is the target THD object. */
killed= state_to_set;
+
if (state_to_set != THD::KILL_QUERY)
{
- thr_alarm_kill(thread_id);
- if (!slave_thread)
- MYSQL_CALLBACK(scheduler, post_kill_notification, (this));
#ifdef SIGNAL_WITH_VIO_CLOSE
if (this != current_thd)
{
/*
- In addition to a signal, let's close the socket of the thread that
- is being killed. This is to make sure it does not block if the
- signal is lost. This needs to be done only on platforms where
- signals are not a reliable interruption mechanism.
-
- If we're killing ourselves, we know that we're not blocked, so this
- hack is not used.
+ Before sending a signal, let's close the socket of the thread
+ that is being killed ("this", which is not the current thread).
+ This is to make sure it does not block if the signal is lost.
+ This needs to be done only on platforms where signals are not
+ a reliable interruption mechanism.
+
+ Note that the downside of this mechanism is that we could close
+ the connection while "this" target thread is in the middle of
+ sending a result to the application, thus violating the client-
+ server protocol.
+
+ On the other hand, without closing the socket we have a race
+ condition. If "this" target thread passes the check of
+ thd->killed, and then the current thread runs through
+ THD::awake(), sets the 'killed' flag and completes the
+ signaling, and then the target thread runs into read(), it will
+ block on the socket. As a result of the discussions around
+ Bug#37780, it has been decided that we accept the race
+ condition. A second KILL awakes the target from read().
+
+ If we are killing ourselves, we know that we are not blocked.
+ We also know that we will check thd->killed before we go for
+ reading the next statement.
*/
close_active_vio();
}
-#endif
+#endif
+
+ /* Mark the target thread's alarm request expired, and signal alarm. */
+ thr_alarm_kill(thread_id);
+
+ /* Send an event to the scheduler that a thread should be killed. */
+ if (!slave_thread)
+ MYSQL_CALLBACK(scheduler, post_kill_notification, (this));
}
+
+ /* Broadcast a condition to kick the target if it is waiting on it. */
if (mysys_var)
{
mysql_mutex_lock(&mysys_var->mutex);
@@ -1366,6 +1645,11 @@ void THD::awake(THD::killed_state state_to_set)
we issue a second KILL or the status it's waiting for happens).
It's true that we have set its thd->killed but it may not
see it immediately and so may have time to reach the cond_wait().
+
+ However, where possible, we test for killed once again after
+ enter_cond(). This should make the signaling as safe as possible.
+ However, there is still a small chance of failure on platforms with
+ instruction or memory write reordering.
*/
if (mysys_var->current_cond && mysys_var->current_mutex)
{
@@ -1378,6 +1662,40 @@ void THD::awake(THD::killed_state state_to_set)
DBUG_VOID_RETURN;
}
+
+/**
+ Close the Vio associated this session.
+
+ @remark LOCK_thd_data is taken due to the fact that
+ the Vio might be disassociated concurrently.
+*/
+
+void THD::disconnect()
+{
+ Vio *vio= NULL;
+
+ mysql_mutex_lock(&LOCK_thd_data);
+
+ killed= THD::KILL_CONNECTION;
+
+#ifdef SIGNAL_WITH_VIO_CLOSE
+ /*
+ Since a active vio might might have not been set yet, in
+ any case save a reference to avoid closing a inexistent
+ one or closing the vio twice if there is a active one.
+ */
+ vio= active_vio;
+ close_active_vio();
+#endif
+
+ /* Disconnect even if a active vio is not associated. */
+ if (net.vio != vio)
+ vio_close(net.vio);
+
+ mysql_mutex_unlock(&LOCK_thd_data);
+}
+
+
/*
Remember the location of thread info, the structure needed for
sql_alloc() and the structure for the net buffer
@@ -1422,7 +1740,6 @@ bool THD::store_globals()
return 0;
}
-
/**
Untie THD from current thread
@@ -1434,6 +1751,11 @@ void THD::reset_globals()
mysql_mutex_lock(&LOCK_thd_data);
mysys_var= 0;
mysql_mutex_unlock(&LOCK_thd_data);
+
+ /* Undocking the thread specific data. */
+ my_pthread_setspecific_ptr(THR_THD, NULL);
+ my_pthread_setspecific_ptr(THR_MALLOC, NULL);
+
}
/*
@@ -1486,7 +1808,7 @@ void THD::cleanup_after_query()
where= THD::DEFAULT_WHERE;
/* reset table map for multi-table update */
table_map_for_update= 0;
- clean_current_user_used();
+ m_binlog_invoker= FALSE;
}
@@ -1505,7 +1827,7 @@ LEX_STRING *THD::make_lex_string(LEX_STRING *lex_str,
bool allocate_lex_string)
{
if (allocate_lex_string)
- if (!(lex_str= (LEX_STRING *)alloc(sizeof(LEX_STRING))))
+ if (!(lex_str= (LEX_STRING *)alloc_root(mem_root, sizeof(LEX_STRING))))
return 0;
if (!(lex_str->str= strmake_root(mem_root, str, length)))
return 0;
@@ -1983,8 +2305,9 @@ void select_to_file::send_error(uint errcode,const char *err)
bool select_to_file::send_eof()
{
int error= test(end_io_cache(&cache));
- if (mysql_file_close(file, MYF(MY_WME)))
- error= 1;
+ if (mysql_file_close(file, MYF(MY_WME)) || thd->is_error())
+ error= true;
+
if (!error)
{
::my_ok(thd,row_count);
@@ -2262,7 +2585,7 @@ bool select_export::send_data(List<Item> &items)
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD,
ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD),
"string", printable_buff,
- item->name, (ulong) row_count);
+ item->name, static_cast<long>(row_count));
}
else if (from_end_pos < res->ptr() + res->length())
{
@@ -2271,7 +2594,7 @@ bool select_export::send_data(List<Item> &items)
*/
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
WARN_DATA_TRUNCATED, ER(WARN_DATA_TRUNCATED),
- item->full_name(), row_count);
+ item->full_name(), static_cast<long>(row_count));
}
cvt_str.length(bytes);
res= &cvt_str;
@@ -2725,8 +3048,6 @@ Statement::Statement(LEX *lex_arg, MEM_ROOT *mem_root_arg,
db(NULL),
db_length(0)
{
- query_string.length= 0;
- query_string.str= NULL;
name.str= NULL;
}
@@ -2765,15 +3086,6 @@ void Statement::restore_backup_statement(Statement *stmt, Statement *backup)
}
-/** Assign a new value to thd->query. */
-
-void Statement::set_query_inner(char *query_arg, uint32 query_length_arg)
-{
- query_string.str= query_arg;
- query_string.length= query_length_arg;
-}
-
-
void THD::end_statement()
{
/* Cleanup SQL processing state to reuse this statement in next query. */
@@ -3024,6 +3336,13 @@ bool select_dumpvar::send_eof()
if (! row_count)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_SP_FETCH_NO_DATA, ER(ER_SP_FETCH_NO_DATA));
+ /*
+ Don't send EOF if we're in error condition (which implies we've already
+ sent or are sending an error)
+ */
+ if (thd->is_error())
+ return true;
+
::my_ok(thd,row_count);
return 0;
}
@@ -3157,9 +3476,9 @@ void THD::set_status_var_init()
void Security_context::init()
{
- host= user= ip= 0;
+ host= user= ip= external_user= 0;
host_or_ip= "connecting host";
- priv_user[0]= priv_host[0]= '\0';
+ priv_user[0]= priv_host[0]= proxy_user[0]= '\0';
master_access= 0;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
db_access= NO_ACCESS;
@@ -3181,6 +3500,12 @@ void Security_context::destroy()
user= NULL;
}
+ if (external_user)
+ {
+ my_free(external_user);
+ user= NULL;
+ }
+
my_free(ip);
ip= NULL;
}
@@ -3375,7 +3700,7 @@ extern "C" const struct charset_info_st *thd_charset(MYSQL_THD thd)
*/
extern "C" char **thd_query(MYSQL_THD thd)
{
- return(&thd->query_string.str);
+ return (&thd->query_string.string.str);
}
/**
@@ -3386,7 +3711,7 @@ extern "C" char **thd_query(MYSQL_THD thd)
*/
extern "C" LEX_STRING * thd_query_string (MYSQL_THD thd)
{
- return(&thd->query_string);
+ return(&thd->query_string.string);
}
extern "C" int thd_slave_thread(const MYSQL_THD thd)
@@ -3447,7 +3772,7 @@ extern "C" void thd_pool_wait_end(MYSQL_THD thd);
thd_wait_end MUST be called immediately after waking up again.
*/
-extern "C" void thd_wait_begin(MYSQL_THD thd, thd_wait_type wait_type)
+extern "C" void thd_wait_begin(MYSQL_THD thd, int wait_type)
{
MYSQL_CALLBACK(thd->scheduler, thd_wait_begin, (thd, wait_type));
}
@@ -3463,7 +3788,7 @@ extern "C" void thd_wait_end(MYSQL_THD thd)
MYSQL_CALLBACK(thd->scheduler, thd_wait_end, (thd));
}
#else
-extern "C" void thd_wait_begin(MYSQL_THD thd, thd_wait_type wait_type)
+extern "C" void thd_wait_begin(MYSQL_THD thd, int wait_type)
{
/* do NOTHING for the embedded library */
return;
@@ -3633,20 +3958,21 @@ void THD::set_statement(Statement *stmt)
/** Assign a new value to thd->query. */
-void THD::set_query(char *query_arg, uint32 query_length_arg)
+void THD::set_query(const CSET_STRING &string_arg)
{
mysql_mutex_lock(&LOCK_thd_data);
- set_query_inner(query_arg, query_length_arg);
+ set_query_inner(string_arg);
mysql_mutex_unlock(&LOCK_thd_data);
}
/** Assign a new value to thd->query and thd->query_id. */
void THD::set_query_and_id(char *query_arg, uint32 query_length_arg,
+ CHARSET_INFO *cs,
query_id_t new_query_id)
{
mysql_mutex_lock(&LOCK_thd_data);
- set_query_inner(query_arg, query_length_arg);
+ set_query_inner(query_arg, query_length_arg, cs);
query_id= new_query_id;
mysql_mutex_unlock(&LOCK_thd_data);
}
@@ -3676,16 +4002,20 @@ void THD::set_mysys_var(struct st_my_thread_var *new_mysys_var)
void THD::leave_locked_tables_mode()
{
locked_tables_mode= LTM_NONE;
- /* Make sure we don't release the global read lock when leaving LTM. */
- mdl_context.reset_trans_sentinel(global_read_lock.global_shared_lock());
+ mdl_context.set_transaction_duration_for_all_locks();
+ /*
+ Make sure we don't release the global read lock and commit blocker
+ when leaving LTM.
+ */
+ global_read_lock.set_explicit_lock_duration(this);
/* Also ensure that we don't release metadata locks for open HANDLERs. */
if (handler_tables_hash.records)
- mysql_ha_move_tickets_after_trans_sentinel(this);
+ mysql_ha_set_explicit_lock_duration(this);
}
void THD::get_definer(LEX_USER *definer)
{
- set_current_user_used();
+ binlog_invoker();
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
if (slave_thread && has_invoker())
{
@@ -3814,6 +4144,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;
+ xs->rm_error=0;
res=my_hash_insert(&xid_cache, (uchar*)xs);
}
mysql_mutex_unlock(&LOCK_xid_cache);
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 05082a8e8fe..9280fbd0640 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -111,6 +111,41 @@ extern MYSQL_PLUGIN_IMPORT const char **errmesg;
extern bool volatile shutdown_in_progress;
+extern "C" LEX_STRING * thd_query_string (MYSQL_THD thd);
+extern "C" char **thd_query(MYSQL_THD thd);
+
+/**
+ @class CSET_STRING
+ @brief Character set armed LEX_STRING
+*/
+class CSET_STRING
+{
+private:
+ LEX_STRING string;
+ CHARSET_INFO *cs;
+public:
+ CSET_STRING() : cs(&my_charset_bin)
+ {
+ string.str= NULL;
+ string.length= 0;
+ }
+ CSET_STRING(char *str_arg, size_t length_arg, CHARSET_INFO *cs_arg) :
+ cs(cs_arg)
+ {
+ DBUG_ASSERT(cs_arg != NULL);
+ string.str= str_arg;
+ string.length= length_arg;
+ }
+
+ inline char *str() const { return string.str; }
+ inline uint32 length() const { return string.length; }
+ CHARSET_INFO *charset() const { return cs; }
+
+ friend LEX_STRING * thd_query_string (MYSQL_THD thd);
+ friend char **thd_query(MYSQL_THD thd);
+};
+
+
#define TC_LOG_PAGE_SIZE 8192
#define TC_LOG_MIN_SIZE (3*TC_LOG_PAGE_SIZE)
@@ -630,14 +665,14 @@ public:
/*
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.
+ Prepared statement: STMT_INITIALIZED -> STMT_PREPARED -> STMT_EXECUTED.
+ Stored procedure: STMT_INITIALIZED_FOR_SP -> STMT_EXECUTED.
+ Other statements: STMT_CONVENTIONAL_EXECUTION never changes.
*/
enum enum_state
{
- INITIALIZED= 0, INITIALIZED_FOR_SP= 1, PREPARED= 2,
- CONVENTIONAL_EXECUTION= 3, EXECUTED= 4, ERROR= -1
+ STMT_INITIALIZED= 0, STMT_INITIALIZED_FOR_SP= 1, STMT_PREPARED= 2,
+ STMT_CONVENTIONAL_EXECUTION= 3, STMT_EXECUTED= 4, STMT_ERROR= -1
};
enum_state state;
@@ -660,18 +695,13 @@ public:
virtual Type type() const;
virtual ~Query_arena() {};
- inline bool is_stmt_prepare() const { return state == INITIALIZED; }
- inline bool is_first_sp_execute() const
- { return state == INITIALIZED_FOR_SP; }
+ inline bool is_stmt_prepare() const { return state == STMT_INITIALIZED; }
inline bool is_stmt_prepare_or_first_sp_execute() const
- { return (int)state < (int)PREPARED; }
+ { return (int)state < (int)STMT_PREPARED; }
inline bool is_stmt_prepare_or_first_stmt_execute() const
- { return (int)state <= (int)PREPARED; }
- inline bool is_first_stmt_execute() const { return state == PREPARED; }
- inline bool is_stmt_execute() const
- { return state == PREPARED || state == EXECUTED; }
+ { return (int)state <= (int)STMT_PREPARED; }
inline bool is_conventional() const
- { return state == CONVENTIONAL_EXECUTION; }
+ { return state == STMT_CONVENTIONAL_EXECUTION; }
inline void* alloc(size_t size) { return alloc_root(mem_root,size); }
inline void* calloc(size_t size)
@@ -763,12 +793,24 @@ public:
This printing is needed at least in SHOW PROCESSLIST and SHOW
ENGINE INNODB STATUS.
*/
- LEX_STRING query_string;
-
- inline char *query() { return query_string.str; }
- inline uint32 query_length() { return query_string.length; }
- void set_query_inner(char *query_arg, uint32 query_length_arg);
+ CSET_STRING query_string;
+ inline char *query() const { return query_string.str(); }
+ inline uint32 query_length() const { return query_string.length(); }
+ CHARSET_INFO *query_charset() const { return query_string.charset(); }
+ void set_query_inner(const CSET_STRING &string_arg)
+ {
+ query_string= string_arg;
+ }
+ void set_query_inner(char *query_arg, uint32 query_length_arg,
+ CHARSET_INFO *cs_arg)
+ {
+ set_query_inner(CSET_STRING(query_arg, query_length_arg, cs_arg));
+ }
+ void reset_query_inner()
+ {
+ set_query_inner(CSET_STRING());
+ }
/**
Name of the current (default) database.
@@ -863,8 +905,8 @@ struct st_savepoint {
char *name;
uint length;
Ha_trx_info *ha_list;
- /** Last acquired lock before this savepoint was set. */
- MDL_ticket *mdl_savepoint;
+ /** State of metadata locks before this savepoint was set. */
+ MDL_savepoint mdl_savepoint;
};
enum xa_states {XA_NOTR=0, XA_ACTIVE, XA_IDLE, XA_PREPARED, XA_ROLLBACK_ONLY};
@@ -905,8 +947,11 @@ public:
*/
char *host, *user, *ip;
char priv_user[USERNAME_LENGTH];
+ char proxy_user[USERNAME_LENGTH + MAX_HOSTNAME + 5];
/* The host privilege we are using */
char priv_host[MAX_HOSTNAME];
+ /* The external user (if available) */
+ char *external_user;
/* points to host if host is available, otherwise points to ip */
const char *host_or_ip;
ulong master_access; /* Global privileges from mysql.user */
@@ -1096,12 +1141,12 @@ class Open_tables_backup: public Open_tables_state
public:
/**
When we backup the open tables state to open a system
- table or tables, points at the last metadata lock
- acquired before the backup. Is used to release
- metadata locks on system tables after they are
+ table or tables, we want to save state of metadata
+ locks which were acquired before the backup. It is used
+ to release metadata locks on system tables after they are
no longer used.
*/
- MDL_ticket *mdl_system_tables_svp;
+ MDL_savepoint mdl_system_tables_svp;
};
/**
@@ -1376,26 +1421,43 @@ public:
};
Global_read_lock()
- :m_protection_count(0), m_state(GRL_NONE), m_mdl_global_shared_lock(NULL)
+ : m_state(GRL_NONE),
+ m_mdl_global_shared_lock(NULL),
+ m_mdl_blocks_commits_lock(NULL)
{}
bool lock_global_read_lock(THD *thd);
void unlock_global_read_lock(THD *thd);
- bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh,
- bool is_not_commit);
- void start_waiting_global_read_lock(THD *thd);
+ /**
+ Check if this connection can acquire protection against GRL and
+ emit error if otherwise.
+ */
+ bool can_acquire_protection() const
+ {
+ if (m_state)
+ {
+ my_error(ER_CANT_UPDATE_WITH_READLOCK, MYF(0));
+ return TRUE;
+ }
+ return FALSE;
+ }
bool make_global_read_lock_block_commit(THD *thd);
bool is_acquired() const { return m_state != GRL_NONE; }
- bool has_protection() const { return m_protection_count > 0; }
- MDL_ticket *global_shared_lock() const { return m_mdl_global_shared_lock; }
+ void set_explicit_lock_duration(THD *thd);
private:
- uint m_protection_count; // GRL protection count
+ enum_grl_state m_state;
/**
In order to acquire the global read lock, the connection must
- acquire a global shared metadata lock, to prohibit all DDL.
+ acquire shared metadata lock in GLOBAL namespace, to prohibit
+ all DDL.
*/
- enum_grl_state m_state;
MDL_ticket *m_mdl_global_shared_lock;
+ /**
+ Also in order to acquire the global read lock, the connection
+ must acquire a shared metadata lock in COMMIT namespace, to
+ prohibit commits.
+ */
+ MDL_ticket *m_mdl_blocks_commits_lock;
};
@@ -1410,6 +1472,19 @@ extern "C" void my_message_sql(uint error, const char *str, myf MyFlags);
class THD :public Statement,
public Open_tables_state
{
+private:
+ inline bool is_stmt_prepare() const
+ { DBUG_ASSERT(0); return Statement::is_stmt_prepare(); }
+
+ inline bool is_stmt_prepare_or_first_sp_execute() const
+ { DBUG_ASSERT(0); return Statement::is_stmt_prepare_or_first_sp_execute(); }
+
+ inline bool is_stmt_prepare_or_first_stmt_execute() const
+ { DBUG_ASSERT(0); return Statement::is_stmt_prepare_or_first_stmt_execute(); }
+
+ inline bool is_conventional() const
+ { DBUG_ASSERT(0); return Statement::is_conventional(); }
+
public:
MDL_context mdl_context;
@@ -2008,6 +2083,12 @@ public:
DYNAMIC_ARRAY user_var_events; /* For user variables replication */
MEM_ROOT *user_var_events_alloc; /* Allocate above array elements here */
+ /*
+ If checking this in conjunction with a wait condition, please
+ include a check after enter_cond() if you want to avoid a race
+ condition. For details see the implementation of awake(),
+ especially the "broadcast" part.
+ */
enum killed_state
{
NOT_KILLED=0,
@@ -2025,6 +2106,9 @@ public:
bool no_errors, password;
bool extra_port; /* If extra connection */
+ bool no_errors;
+ uint8 password;
+
/**
Set to TRUE if execution of the current compound statement
can not continue. In particular, disables activation of
@@ -2075,7 +2159,6 @@ public:
bool enable_slow_log; /* enable slow log for current statement */
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() */
/* set during loop of derived table processing */
bool derived_tables_processing;
bool tablespace_op; /* This is TRUE in DISCARD/IMPORT TABLESPACE */
@@ -2213,6 +2296,9 @@ public:
#endif
void awake(THD::killed_state state_to_set);
+ /** Disconnect the associated communication endpoint. */
+ void disconnect();
+
#ifndef MYSQL_CLIENT
enum enum_binlog_query_type {
/* The query can be logged in row format or in statement format. */
@@ -2281,10 +2367,24 @@ public:
/*TODO: this will be obsolete when we have support for 64 bit my_time_t */
inline bool is_valid_time()
{
- return (start_time < (time_t) MY_TIME_T_MAX);
+ return (IS_TIME_T_VALID_FOR_TIMESTAMP(start_time));
}
void set_time_after_lock() { utime_after_lock= my_micro_time(); }
ulonglong current_utime() { return my_micro_time(); }
+ /**
+ Update server status after execution of a top level statement.
+
+ Currently only checks if a query was slow, and assigns
+ the status accordingly.
+ Evaluate the current time, and if it exceeds the long-query-time
+ setting, mark the query as slow.
+ */
+ void update_server_status()
+ {
+ ulonglong end_utime_of_query= current_utime();
+ if (end_utime_of_query > utime_after_lock + variables.long_query_time)
+ server_status|= SERVER_QUERY_WAS_SLOW;
+ }
inline ulonglong found_rows(void)
{
return limit_found_rows;
@@ -2493,8 +2593,6 @@ public:
(variables.sql_mode & MODE_STRICT_ALL_TABLES)));
}
void set_status_var_init();
- bool is_context_analysis_only()
- { return stmt_arena->is_stmt_prepare() || lex->view_prepare_mode; }
void reset_n_backup_open_tables_state(Open_tables_backup *backup);
void restore_backup_open_tables_state(Open_tables_backup *backup);
void reset_sub_statement_state(Sub_statement_state *backup, uint new_state);
@@ -2750,9 +2848,20 @@ public:
Assign a new value to thd->query and thd->query_id and mysys_var.
Protected with LOCK_thd_data mutex.
*/
- void set_query(char *query_arg, uint32 query_length_arg);
+ void set_query(char *query_arg, uint32 query_length_arg,
+ CHARSET_INFO *cs_arg)
+ {
+ set_query(CSET_STRING(query_arg, query_length_arg, cs_arg));
+ }
+ void set_query(char *query_arg, uint32 query_length_arg) /*Mutex protected*/
+ {
+ set_query(CSET_STRING(query_arg, query_length_arg, charset()));
+ }
+ void set_query(const CSET_STRING &str); /* Mutex protected */
+ void reset_query() /* Mutex protected */
+ { set_query(CSET_STRING()); }
void set_query_and_id(char *query_arg, uint32 query_length_arg,
- query_id_t new_query_id);
+ CHARSET_INFO *cs, query_id_t new_query_id);
void set_query_id(query_id_t new_query_id);
void set_open_tables(TABLE *open_tables_arg)
{
@@ -2765,14 +2874,13 @@ public:
{
DBUG_ASSERT(locked_tables_mode == LTM_NONE);
- mdl_context.set_trans_sentinel();
+ mdl_context.set_explicit_duration_for_all_locks();
locked_tables_mode= mode_arg;
}
void leave_locked_tables_mode();
int decide_logging_format(TABLE_LIST *tables);
- void set_current_user_used() { current_user_used= TRUE; }
- bool is_current_user_used() { return current_user_used; }
- void clean_current_user_used() { current_user_used= FALSE; }
+ void binlog_invoker() { m_binlog_invoker= TRUE; }
+ bool need_binlog_invoker() { return m_binlog_invoker; }
void get_definer(LEX_USER *definer);
void set_invoker(const LEX_STRING *user, const LEX_STRING *host)
{
@@ -2807,6 +2915,7 @@ private:
/** The current internal error handler for this thread, or NULL. */
Internal_error_handler *m_internal_handler;
+
/**
The lex to hold the parsed tree of conventional (non-prepared) queries.
Whereas for prepared and stored procedure statements we use an own lex
@@ -2834,7 +2943,7 @@ private:
Current user will be binlogged into Query_log_event if current_user_used
is TRUE; It will be stored into invoker_host and invoker_user by SQL thread.
*/
- bool current_user_used;
+ bool m_binlog_invoker;
/**
It points to the invoker in the Query_log_event.
@@ -3738,20 +3847,10 @@ public:
#define CF_DIAGNOSTIC_STMT (1U << 8)
/**
- SQL statements that must be protected against impending global read lock
- to prevent deadlock. This deadlock could otherwise happen if the statement
- starts waiting for the GRL to go away inside mysql_lock_tables while at the
- same time having "old" opened tables. The thread holding the GRL can be
- waiting for these "old" opened tables to be closed, causing a deadlock
- (FLUSH TABLES WITH READ LOCK).
- */
-#define CF_PROTECT_AGAINST_GRL (1U << 10)
-
-/**
Identifies statements that may generate row events
and that may end up in the binary log.
*/
-#define CF_CAN_GENERATE_ROW_EVENTS (1U << 11)
+#define CF_CAN_GENERATE_ROW_EVENTS (1U << 9)
/* Bits in server_command_flags */
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 0fe43fb5ebb..c0646e6cec7 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,8 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Functions to autenticate and handle reqests for a connection
@@ -52,7 +51,7 @@ static HASH hash_user_connections;
int get_or_create_user_conn(THD *thd, const char *user,
const char *host,
- USER_RESOURCES *mqh)
+ const USER_RESOURCES *mqh)
{
int return_val= 0;
size_t temp_len, user_len;
@@ -278,7 +277,6 @@ end:
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
-
/*
Check for maximum allowable user connections, if the mysqld server is
started with corresponding variable that is greater then 0.
@@ -801,8 +799,23 @@ void update_global_user_stats(THD *thd, bool create_user, time_t now)
}
-void thd_init_client_charset(THD *thd, uint cs_number)
+/**
+ Set thread character set variables from the given ID
+
+ @param thd thread handle
+ @param cs_number character set and collation ID
+
+ @retval 0 OK; character_set_client, collation_connection and
+ character_set_results are set to the new value,
+ or to the default global values.
+
+ @retval 1 error, e.g. the given ID is not supported by parser.
+ Corresponding SQL error is sent.
+*/
+
+bool thd_init_client_charset(THD *thd, uint cs_number)
{
+ CHARSET_INFO *cs;
/*
Use server character set and collation if
- opt_character_set_client_handshake is not set
@@ -811,10 +824,10 @@ void thd_init_client_charset(THD *thd, uint cs_number)
- client character set doesn't exists in server
*/
if (!opt_character_set_client_handshake ||
- !(thd->variables.character_set_client= get_charset(cs_number, MYF(0))) ||
+ !(cs= get_charset(cs_number, MYF(0))) ||
!my_strcasecmp(&my_charset_latin1,
global_system_variables.character_set_client->name,
- thd->variables.character_set_client->name))
+ cs->name))
{
thd->variables.character_set_client=
global_system_variables.character_set_client;
@@ -825,10 +838,18 @@ void thd_init_client_charset(THD *thd, uint cs_number)
}
else
{
+ if (!is_supported_parser_charset(cs))
+ {
+ /* Disallow non-supported parser character sets: UCS2, UTF16, UTF32 */
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "character_set_client",
+ cs->csname);
+ return true;
+ }
thd->variables.character_set_results=
thd->variables.collation_connection=
- thd->variables.character_set_client;
+ thd->variables.character_set_client= cs;
}
+ return false;
}
@@ -874,7 +895,7 @@ static int check_connection(THD *thd)
if (vio_peer_addr(net->vio, ip, &thd->peer_port, NI_MAXHOST))
{
- my_error(ER_BAD_HOST_ERROR, MYF(0), thd->main_security_ctx.host_or_ip);
+ my_error(ER_BAD_HOST_ERROR, MYF(0));
return 1;
}
if (!(thd->main_security_ctx.ip= my_strdup(ip,MYF(MY_WME))))
@@ -885,7 +906,7 @@ static int check_connection(THD *thd)
if (ip_to_hostname(&net->vio->remote, thd->main_security_ctx.ip,
&thd->main_security_ctx.host, &connect_errors))
{
- my_error(ER_BAD_HOST_ERROR, MYF(0), ip);
+ my_error(ER_BAD_HOST_ERROR, MYF(0));
return 1;
}
@@ -949,7 +970,7 @@ bool setup_connection_thread_globals(THD *thd)
{
if (thd->store_globals())
{
- close_connection(thd, ER_OUT_OF_RESOURCES, 1);
+ close_connection(thd, ER_OUT_OF_RESOURCES);
statistic_increment(aborted_connects,&LOCK_status);
MYSQL_CALLBACK(thd->scheduler, end_thread, (thd, 0));
return 1; // Error
@@ -1124,6 +1145,32 @@ pthread_handler_t handle_one_connection(void *arg)
return 0;
}
+bool thd_prepare_connection(THD *thd)
+{
+ bool rc;
+ lex_start(thd);
+ rc= login_connection(thd);
+ MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT(thd);
+ if (rc)
+ return rc;
+
+ MYSQL_CONNECTION_START(thd->thread_id, &thd->security_ctx->priv_user[0],
+ (char *) thd->security_ctx->host_or_ip);
+
+ prepare_new_connection_state(thd);
+ return FALSE;
+}
+
+bool thd_is_connection_alive(THD *thd)
+{
+ NET *net= &thd->net;
+ if (!net->error &&
+ net->vio != 0 &&
+ !(thd->killed == THD::KILL_CONNECTION))
+ return TRUE;
+ return FALSE;
+}
+
void do_handle_one_connection(THD *thd_arg)
{
THD *thd= thd_arg;
@@ -1132,7 +1179,7 @@ void do_handle_one_connection(THD *thd_arg)
if (MYSQL_CALLBACK_ELSE(&thread_scheduler, init_new_connection_thread, (), 0))
{
- close_connection(thd, ER_OUT_OF_RESOURCES, 1);
+ close_connection(thd, ER_OUT_OF_RESOURCES);
statistic_increment(aborted_connects,&LOCK_status);
MYSQL_CALLBACK(thd->scheduler, end_thread, (thd, 0));
return;
@@ -1166,23 +1213,15 @@ void do_handle_one_connection(THD *thd_arg)
for (;;)
{
- NET *net= &thd->net;
bool create_user= TRUE;
- lex_start(thd);
- if (login_connection(thd))
+ if (thd_prepare_connection(thd))
{
create_user= FALSE;
goto end_thread;
}
- MYSQL_CONNECTION_START(thd->thread_id, thd->security_ctx->priv_user,
- (char *) thd->security_ctx->host_or_ip);
-
- prepare_new_connection_state(thd);
-
- while (!net->error && net->vio != 0 &&
- !(thd->killed == THD::KILL_CONNECTION))
+ while (thd_is_connection_alive(thd))
{
mysql_audit_release(thd);
if (do_command(thd))
@@ -1191,7 +1230,7 @@ void do_handle_one_connection(THD *thd_arg)
end_connection(thd);
end_thread:
- close_connection(thd, 0, 1);
+ close_connection(thd);
if (thd->userstat_running)
update_global_user_stats(thd, create_user, time(NULL));
diff --git a/sql/sql_connect.h b/sql/sql_connect.h
index 18dd2b31305..2f3096b496a 100644
--- a/sql/sql_connect.h
+++ b/sql/sql_connect.h
@@ -41,15 +41,17 @@ void reset_mqh(LEX_USER *lu, bool get_them);
bool check_mqh(THD *thd, uint check_command);
void time_out_user_resource_limits(THD *thd, USER_CONN *uc);
void decrease_user_connections(USER_CONN *uc);
-void thd_init_client_charset(THD *thd, uint cs_number);
+bool thd_init_client_charset(THD *thd, uint cs_number);
bool setup_connection_thread_globals(THD *thd);
+bool thd_prepare_connection(THD *thd);
+bool thd_is_connection_alive(THD *thd);
bool login_connection(THD *thd);
void prepare_new_connection_state(THD* thd);
void end_connection(THD *thd);
void update_global_user_stats(THD* thd, bool create_user, time_t now);
int get_or_create_user_conn(THD *thd, const char *user,
- const char *host, USER_RESOURCES *mqh);
+ const char *host, const USER_RESOURCES *mqh);
int check_for_max_user_connections(THD *thd, USER_CONN *uc);
extern HASH global_user_stats;
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index 5bd5f9df680..96a2d50538b 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2006 MySQL AB
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -46,7 +46,7 @@ class Materialized_cursor: public Server_side_cursor
public:
Materialized_cursor(select_result *result, TABLE *table);
- int fill_item_list(THD *thd, List<Item> &send_result_set_metadata);
+ int send_result_set_metadata(THD *thd, List<Item> &send_result_set_metadata);
virtual bool is_open() const { return table != 0; }
virtual int open(JOIN *join __attribute__((unused)));
virtual void fetch(ulong num_rows);
@@ -111,7 +111,7 @@ int mysql_open_cursor(THD *thd, select_result *result,
MYSQL_QUERY_EXEC_START(thd->query(),
thd->thread_id,
(char *) (thd->db ? thd->db : ""),
- thd->security_ctx->priv_user,
+ &thd->security_ctx->priv_user[0],
(char *) thd->security_ctx->host_or_ip,
2);
rc= mysql_execute_command(thd);
@@ -133,7 +133,13 @@ int mysql_open_cursor(THD *thd, select_result *result,
if (rc)
{
if (result_materialize->materialized_cursor)
+ {
+ /* Rollback metadata in the client-server protocol. */
+ result_materialize->abort_result_set();
+
delete result_materialize->materialized_cursor;
+ }
+
goto end;
}
@@ -142,6 +148,12 @@ int mysql_open_cursor(THD *thd, select_result *result,
Materialized_cursor *materialized_cursor=
result_materialize->materialized_cursor;
+ /*
+ NOTE: close_thread_tables() has been called in
+ mysql_execute_command(), so all tables except from the cursor
+ temporary table have been closed.
+ */
+
if ((rc= materialized_cursor->open(0)))
{
delete materialized_cursor;
@@ -202,14 +214,16 @@ Materialized_cursor::Materialized_cursor(select_result *result_arg,
/**
- Preserve the original metadata that would be sent to the client.
+ Preserve the original metadata to be sent to the client.
+ Initiate sending of the original metadata to the client
+ (call Protocol::send_result_set_metadata()).
@param thd Thread identifier.
@param send_result_set_metadata List of fields that would be sent.
*/
-int Materialized_cursor::fill_item_list(THD *thd,
- List<Item> &send_result_set_metadata)
+int Materialized_cursor::send_result_set_metadata(
+ THD *thd, List<Item> &send_result_set_metadata)
{
Query_arena backup_arena;
int rc;
@@ -241,6 +255,14 @@ int Materialized_cursor::fill_item_list(THD *thd,
ident->db_name= thd->strdup(send_field.db_name);
ident->table_name= thd->strdup(send_field.table_name);
}
+
+ /*
+ Original metadata result set should be sent here. After
+ mysql_execute_command() is finished, item_list can not be used for
+ sending metadata, because it references closed table.
+ */
+ rc= result->send_result_set_metadata(item_list, Protocol::SEND_NUM_ROWS);
+
end:
thd->restore_active_arena(this, &backup_arena);
/* Check for thd->is_error() in case of OOM */
@@ -253,32 +275,29 @@ int Materialized_cursor::open(JOIN *join __attribute__((unused)))
THD *thd= fake_unit.thd;
int rc;
Query_arena backup_arena;
+
thd->set_n_backup_active_arena(this, &backup_arena);
- /* Create a list of fields and start sequential scan */
+
+ /* Create a list of fields and start sequential scan. */
+
rc= result->prepare(item_list, &fake_unit);
- if (!rc && !(rc= table->file->ha_rnd_init_with_error(TRUE)))
- is_rnd_inited= 1;
+ rc= !rc && table->file->ha_rnd_init_with_error(TRUE);
+ is_rnd_inited= !rc;
thd->restore_active_arena(this, &backup_arena);
- if (rc == 0)
+
+ /* Commit or rollback metadata in the client-server protocol. */
+
+ if (!rc)
{
- /*
- Now send the result set metadata to the client. We need to
- do it here, as in Select_materialize::send_result_set_metadata the items
- for column types are not yet created (send_result_set_metadata requires
- a list of items). The new types may differ from the original
- ones sent at prepare if some of them were altered by MySQL
- HEAP tables mechanism -- used when create_tmp_field_from_item
- may alter the original column type.
-
- We can't simply supply SEND_EOF flag to send_result_set_metadata, because
- send_result_set_metadata doesn't flush the network buffer.
- */
- rc= result->send_result_set_metadata(item_list, Protocol::SEND_NUM_ROWS);
thd->server_status|= SERVER_STATUS_CURSOR_EXISTS;
result->send_eof();
- thd->server_status&= ~SERVER_STATUS_CURSOR_EXISTS;
}
+ else
+ {
+ result->abort_result_set();
+ }
+
return rc;
}
@@ -318,12 +337,10 @@ void Materialized_cursor::fetch(ulong num_rows)
case 0:
thd->server_status|= SERVER_STATUS_CURSOR_EXISTS;
result->send_eof();
- thd->server_status&= ~SERVER_STATUS_CURSOR_EXISTS;
break;
case HA_ERR_END_OF_FILE:
thd->server_status|= SERVER_STATUS_LAST_ROW_SENT;
result->send_eof();
- thd->server_status&= ~SERVER_STATUS_LAST_ROW_SENT;
close();
break;
default:
@@ -375,13 +392,14 @@ bool Select_materialize::send_result_set_metadata(List<Item> &list, uint flags)
materialized_cursor= new (&table->mem_root)
Materialized_cursor(result, table);
- if (! materialized_cursor)
+ if (!materialized_cursor)
{
free_tmp_table(table->in_use, table);
table= 0;
return TRUE;
}
- if (materialized_cursor->fill_item_list(unit->thd, list))
+
+ if (materialized_cursor->send_result_set_metadata(unit->thd, list))
{
delete materialized_cursor;
table= 0;
diff --git a/sql/sql_cursor.h b/sql/sql_cursor.h
index ed7bfac821a..d19d14fa167 100644
--- a/sql/sql_cursor.h
+++ b/sql/sql_cursor.h
@@ -46,7 +46,7 @@ protected:
select_result *result;
public:
Server_side_cursor(MEM_ROOT *mem_root_arg, select_result *result_arg)
- :Query_arena(mem_root_arg, INITIALIZED), result(result_arg)
+ :Query_arena(mem_root_arg, STMT_INITIALIZED), result(result_arg)
{}
virtual bool is_open() const= 0;
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 8b92259573e..56dd266acb9 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -28,6 +28,8 @@
#include "sql_acl.h" // SELECT_ACL, DB_ACLS,
// acl_get, check_grant_db
#include "log_event.h" // Query_log_event
+#include "sql_base.h" // lock_table_names, tdc_remove_table
+#include "sql_handler.h" // mysql_ha_rm_tables
#include <mysys_err.h>
#include "sp.h"
#include "events.h"
@@ -44,10 +46,12 @@ const char *del_exts[]= {".frm", ".BAK", ".TMD",".opt", NullS};
static TYPELIB deletable_extentions=
{array_elements(del_exts)-1,"del_exts", del_exts, NULL};
-static long mysql_rm_known_files(THD *thd, MY_DIR *dirp,
- const char *db, const char *path, uint level,
- TABLE_LIST **dropped_tables);
-
+static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp,
+ const char *db,
+ const char *path,
+ TABLE_LIST **tables,
+ bool *found_other_files);
+
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,
@@ -736,36 +740,37 @@ exit:
}
-/*
- Drop all tables in a database and the database itself
-
- SYNOPSIS
- mysql_rm_db()
- thd Thread handle
- db Database name in the case given by user
- It's already validated and set to lower case
- (if needed) when we come here
- if_exists Don't give error if database doesn't exists
- silent Don't generate errors
-
- RETURN
- FALSE ok (Database dropped)
- ERROR Error
+/**
+ Drop all tables, routines and events in a database and the database itself.
+
+ @param thd Thread handle
+ @param db Database name in the case given by user
+ It's already validated and set to lower case
+ (if needed) when we come here
+ @param if_exists Don't give error if database doesn't exists
+ @param silent Don't write the statement to the binary log and don't
+ send ok packet to the client
+
+ @retval false OK (Database dropped)
+ @retval true Error
*/
bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
{
- long deleted=0;
- int error= 0;
+ ulong deleted_tables= 0;
+ bool error= true;
char path[FN_REFLEN+16];
MY_DIR *dirp;
uint length;
- TABLE_LIST* dropped_tables= 0;
+ bool found_other_files= false;
+ TABLE_LIST *tables= NULL;
+ TABLE_LIST *table;
+ Drop_table_error_handler err_handler;
DBUG_ENTER("mysql_rm_db");
if (lock_schema_name(thd, db))
- DBUG_RETURN(TRUE);
+ DBUG_RETURN(true);
length= build_table_filename(path, sizeof(path) - 1, db, "", "", 0);
strmov(path+length, MY_DB_OPT_FILE); // Append db option file name
@@ -777,20 +782,61 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
{
if (!if_exists)
{
- error= -1;
my_error(ER_DB_DROP_EXISTS, MYF(0), db);
- goto exit;
+ DBUG_RETURN(true);
}
else
+ {
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_DB_DROP_EXISTS, ER(ER_DB_DROP_EXISTS), db);
+ error= false;
+ goto update_binlog;
+ }
}
- else
+
+ if (find_db_tables_and_rm_known_files(thd, dirp, db, path, &tables,
+ &found_other_files))
+ goto exit;
+
+ /*
+ Disable drop of enabled log tables, must be done before name locking.
+ This check is only needed if we are dropping the "mysql" database.
+ */
+ if ((my_strcasecmp(system_charset_info, MYSQL_SCHEMA_NAME.str, db) == 0))
{
- Drop_table_error_handler err_handler;
- thd->push_internal_handler(&err_handler);
+ for (table= tables; table; table= table->next_local)
+ {
+ if (check_if_log_table(table->db_length, table->db,
+ table->table_name_length, table->table_name, true))
+ {
+ my_error(ER_BAD_LOG_STATEMENT, MYF(0), "DROP");
+ goto exit;
+ }
+ }
+ }
+
+ /* Lock all tables and stored routines about to be dropped. */
+ if (lock_table_names(thd, tables, NULL, thd->variables.lock_wait_timeout,
+ MYSQL_OPEN_SKIP_TEMPORARY) ||
+ lock_db_routines(thd, db))
+ goto exit;
+
+ /* mysql_ha_rm_tables() requires a non-null TABLE_LIST. */
+ if (tables)
+ mysql_ha_rm_tables(thd, tables);
- error= -1;
+ for (table= tables; table; table= table->next_local)
+ {
+ tdc_remove_table(thd, TDC_RT_REMOVE_ALL, table->db, table->table_name,
+ false);
+ deleted_tables++;
+ }
+
+ thd->push_internal_handler(&err_handler);
+ if (!thd->killed &&
+ !(tables &&
+ mysql_rm_table_no_locks(thd, tables, true, false, true, true)))
+ {
/*
We temporarily disable the binary log while dropping the objects
in the database. Since the DROP DATABASE statement is always
@@ -808,23 +854,30 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
ha_drop_database(), since NDB otherwise detects the binary log
as disabled and will not log the drop database statement on any
other connected server.
- */
- if ((deleted= mysql_rm_known_files(thd, dirp, db, path, 0,
- &dropped_tables)) >= 0)
- {
- ha_drop_database(path);
- tmp_disable_binlog(thd);
- query_cache_invalidate1(db);
- (void) sp_drop_db_routines(thd, db); /* @todo Do not ignore errors */
+ */
+
+ ha_drop_database(path);
+ tmp_disable_binlog(thd);
+ query_cache_invalidate1(db);
+ (void) sp_drop_db_routines(thd, db); /* @todo Do not ignore errors */
#ifdef HAVE_EVENT_SCHEDULER
- Events::drop_schema_events(thd, db);
+ Events::drop_schema_events(thd, db);
#endif
- error = 0;
- reenable_binlog(thd);
- }
- thd->pop_internal_handler();
+ reenable_binlog(thd);
+
+ /*
+ If the directory is a symbolic link, remove the link first, then
+ remove the directory the symbolic link pointed at
+ */
+ if (found_other_files)
+ my_error(ER_DB_DROP_RMDIR, MYF(0), path, EEXIST);
+ else
+ error= rm_dir_w_symlink(path, true);
}
- if (!silent && deleted>=0)
+ thd->pop_internal_handler();
+
+update_binlog:
+ if (!silent && !error)
{
const char *query;
ulong query_length;
@@ -859,16 +912,15 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
*/
if (mysql_bin_log.write(&qinfo))
{
- error= -1;
+ error= true;
goto exit;
}
}
thd->clear_error();
thd->server_status|= SERVER_STATUS_DB_DROPPED;
- my_ok(thd, (ulong) deleted);
- thd->server_status&= ~SERVER_STATUS_DB_DROPPED;
+ my_ok(thd, deleted_tables);
}
- else if (mysql_bin_log.is_open())
+ else if (mysql_bin_log.is_open() && !silent)
{
char *query, *query_pos, *query_end, *query_data_start;
TABLE_LIST *tbl;
@@ -880,9 +932,19 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
query_end= query + MAX_DROP_TABLE_Q_LEN;
db_len= strlen(db);
- for (tbl= dropped_tables; tbl; tbl= tbl->next_local)
+ for (tbl= tables; tbl; tbl= tbl->next_local)
{
uint tbl_name_len;
+ bool exists;
+
+ // Only write drop table to the binlog for tables that no longer exist.
+ if (check_if_table_exists(thd, tbl, &exists))
+ {
+ error= true;
+ goto exit;
+ }
+ if (exists)
+ continue;
/* 3 for the quotes and the comma*/
tbl_name_len= strlen(tbl->table_name) + 3;
@@ -894,7 +956,7 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
*/
if (write_to_binlog(thd, query, query_pos -1 - query, db, db_len))
{
- error= -1;
+ error= true;
goto exit;
}
query_pos= query_data_start;
@@ -914,7 +976,7 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
*/
if (write_to_binlog(thd, query, query_pos -1 - query, db, db_len))
{
- error= -1;
+ error= true;
goto exit;
}
}
@@ -927,28 +989,23 @@ exit:
SELECT DATABASE() in the future). For this we free() thd->db and set
it to 0.
*/
- if (thd->db && !strcmp(thd->db, db) && error == 0)
+ if (thd->db && !strcmp(thd->db, db) && !error)
mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server);
+ my_dirend(dirp);
DBUG_RETURN(error);
}
-/*
- Removes files with known extensions plus all found subdirectories that
- are 2 hex digits (raid directories).
- thd MUST be set when calling this function!
-*/
-static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
- const char *org_path, uint level,
- TABLE_LIST **dropped_tables)
+static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp,
+ const char *db,
+ const char *path,
+ TABLE_LIST **tables,
+ bool *found_other_files)
{
- long deleted=0;
- ulong found_other_files=0;
char filePath[FN_REFLEN];
TABLE_LIST *tot_list=0, **tot_list_next_local, **tot_list_next_global;
- List<String> raid_dirs;
- DBUG_ENTER("mysql_rm_known_files");
- DBUG_PRINT("enter",("path: %s", org_path));
+ DBUG_ENTER("find_db_tables_and_rm_known_files");
+ DBUG_PRINT("enter",("path: %s", path));
tot_list_next_local= tot_list_next_global= &tot_list;
@@ -965,36 +1022,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
(file->name[1] == '.' && !file->name[2])))
continue;
- /* Check if file is a raid directory */
- if ((my_isdigit(system_charset_info, file->name[0]) ||
- (file->name[0] >= 'a' && file->name[0] <= 'f')) &&
- (my_isdigit(system_charset_info, file->name[1]) ||
- (file->name[1] >= 'a' && file->name[1] <= 'f')) &&
- !file->name[2] && !level)
- {
- char newpath[FN_REFLEN], *copy_of_path;
- MY_DIR *new_dirp;
- String *dir;
- uint length;
-
- strxmov(newpath,org_path,"/",file->name,NullS);
- length= unpack_filename(newpath,newpath);
- if ((new_dirp = my_dir(newpath,MYF(MY_DONT_SORT))))
- {
- 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= (char*) thd->memdup(newpath, length+1)) ||
- !(dir= new (thd->mem_root) String(copy_of_path, length,
- &my_charset_bin)) ||
- raid_dirs.push_back(dir))
- goto err;
- continue;
- }
- found_other_files++;
- continue;
- }
- else if (file->name[0] == 'a' && file->name[1] == 'r' &&
+ if (file->name[0] == 'a' && file->name[1] == 'r' &&
file->name[2] == 'c' && file->name[3] == '\0')
{
/* .frm archive:
@@ -1003,24 +1031,24 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
*/
char newpath[FN_REFLEN];
MY_DIR *new_dirp;
- strxmov(newpath, org_path, "/", "arc", NullS);
+ strxmov(newpath, path, "/", "arc", NullS);
(void) unpack_filename(newpath, newpath);
if ((new_dirp = my_dir(newpath, MYF(MY_DONT_SORT))))
{
DBUG_PRINT("my",("Archive subdir found: %s", newpath));
if ((mysql_rm_arc_files(thd, new_dirp, newpath)) < 0)
- goto err;
+ DBUG_RETURN(true);
continue;
}
- found_other_files++;
+ *found_other_files= true;
continue;
}
if (!(extension= strrchr(file->name, '.')))
extension= strend(file->name);
- if (find_type(extension, &deletable_extentions,1+2) <= 0)
+ if (find_type(extension, &deletable_extentions, FIND_TYPE_NO_PREFIX) <= 0)
{
- if (find_type(extension, ha_known_exts(),1+2) <= 0)
- found_other_files++;
+ if (find_type(extension, ha_known_exts(), FIND_TYPE_NO_PREFIX) <= 0)
+ *found_other_files= true;
continue;
}
/* just for safety we use files_charset_info */
@@ -1036,7 +1064,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
strlen(file->name) + 1);
if (!table_list)
- goto err;
+ DBUG_RETURN(true);
table_list->db= (char*) (table_list+1);
table_list->db_length= strmov(table_list->db, db) - table_list->db;
table_list->table_name= table_list->db + table_list->db_length + 1;
@@ -1054,61 +1082,31 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
table_list->alias= table_list->table_name; // If lower_case_table_names=2
table_list->internal_tmp_table= is_prefix(file->name, tmp_file_prefix);
table_list->mdl_request.init(MDL_key::TABLE, table_list->db,
- table_list->table_name, MDL_EXCLUSIVE);
+ table_list->table_name, MDL_EXCLUSIVE,
+ MDL_TRANSACTION);
/* Link into list */
(*tot_list_next_local)= table_list;
(*tot_list_next_global)= table_list;
tot_list_next_local= &table_list->next_local;
tot_list_next_global= &table_list->next_global;
- deleted++;
}
else
{
- strxmov(filePath, org_path, "/", file->name, NullS);
- if (mysql_file_delete_with_symlink(key_file_misc, filePath, MYF(MY_WME)))
+ strxmov(filePath, path, "/", file->name, NullS);
+ /*
+ We ignore ENOENT error in order to skip files that was deleted
+ by concurrently running statement like REAPIR TABLE ...
+ */
+ if (my_delete_with_symlink(filePath, MYF(0)) &&
+ my_errno != ENOENT)
{
- goto err;
+ my_error(EE_DELETE, MYF(0), filePath, my_errno);
+ DBUG_RETURN(true);
}
}
}
- if (thd->killed ||
- (tot_list && mysql_rm_table_part2(thd, tot_list, 1, 0, 1, 1)))
- goto err;
-
- /* Remove RAID directories */
- {
- List_iterator<String> it(raid_dirs);
- String *dir;
- while ((dir= it++))
- if (rmdir(dir->c_ptr()) < 0)
- found_other_files++;
- }
- my_dirend(dirp);
-
- if (dropped_tables)
- *dropped_tables= tot_list;
-
- /*
- If the directory is a symbolic link, remove the link first, then
- remove the directory the symbolic link pointed at
- */
- if (found_other_files)
- {
- my_error(ER_DB_DROP_RMDIR, MYF(0), org_path, EEXIST);
- DBUG_RETURN(-1);
- }
- else
- {
- /* Don't give errors if we can't delete 'RAID' directory */
- if (rm_dir_w_symlink(org_path, level == 0))
- DBUG_RETURN(-1);
- }
-
- DBUG_RETURN(deleted);
-
-err:
- my_dirend(dirp);
- DBUG_RETURN(-1);
+ *tables= tot_list;
+ DBUG_RETURN(false);
}
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index d80eb4d4dfe..8dd611e4ccf 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -533,9 +533,7 @@ int mysql_multi_delete_prepare(THD *thd)
if (!(target_tbl->table= target_tbl->correspondent_table->table))
{
DBUG_ASSERT(target_tbl->correspondent_table->view &&
- target_tbl->correspondent_table->merge_underlying_list &&
- target_tbl->correspondent_table->merge_underlying_list->
- next_local);
+ target_tbl->correspondent_table->multitable_view);
my_error(ER_VIEW_DELETE_MERGE_VIEW, MYF(0),
target_tbl->correspondent_table->view_db.str,
target_tbl->correspondent_table->view_name.str);
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index a4063e0dce9..0c7ffb48935 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -151,10 +151,11 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
if (!(derived_result= new select_union))
DBUG_RETURN(TRUE); // out of memory
+ lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_DERIVED;
// st_select_lex_unit::prepare correctly work for single select
if ((res= unit->prepare(thd, derived_result, 0)))
goto exit;
-
+ lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_DERIVED;
if ((res= check_duplicate_names(unit->types, 0)))
goto exit;
@@ -307,13 +308,21 @@ bool mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
*/
if (derived_result->flush())
res= TRUE;
-
- if (!lex->describe)
- unit->cleanup();
}
- else
- unit->cleanup();
lex->current_select= save_current_select;
}
return res;
}
+
+
+/**
+ Cleans up the SELECT_LEX_UNIT for the derived table (if any).
+*/
+
+bool mysql_derived_cleanup(THD *thd, LEX *lex, TABLE_LIST *derived)
+{
+ SELECT_LEX_UNIT *unit= derived->derived;
+ if (unit)
+ unit->cleanup();
+ return false;
+}
diff --git a/sql/sql_derived.h b/sql/sql_derived.h
index 0d4eddedf22..11a6fd4105e 100644
--- a/sql/sql_derived.h
+++ b/sql/sql_derived.h
@@ -26,4 +26,16 @@ bool mysql_handle_derived(LEX *lex, bool (*processor)(THD *thd,
bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *t);
bool mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *t);
+/**
+ Cleans up the SELECT_LEX_UNIT for the derived table (if any).
+
+ @param thd Thread handler
+ @param lex LEX for this thread
+ @param derived TABLE_LIST for the derived table
+
+ @retval false Success
+ @retval true Failure
+*/
+bool mysql_derived_cleanup(THD *thd, LEX *lex, TABLE_LIST *derived);
+
#endif /* SQL_DERIVED_INCLUDED */
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 44bfe0a4f44..7988523dd3b 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -1,5 +1,4 @@
-/* Copyright (C) 1995-2002 MySQL AB,
- Copyright (C) 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -334,7 +333,6 @@ Diagnostics_area::reset_diagnostics_area()
/** Don't take chances in production */
m_message[0]= '\0';
m_sql_errno= 0;
- m_server_status= 0;
m_affected_rows= 0;
m_last_insert_id= 0;
m_statement_warn_count= 0;
@@ -365,7 +363,6 @@ Diagnostics_area::set_ok_status(THD *thd, ulonglong affected_rows_arg,
if (is_error() || is_disabled())
return;
- m_server_status= thd->server_status;
m_statement_warn_count= thd->warning_info->statement_warn_count();
m_affected_rows= affected_rows_arg;
m_last_insert_id= last_insert_id_arg;
@@ -395,7 +392,6 @@ Diagnostics_area::set_eof_status(THD *thd)
if (is_error() || is_disabled())
return;
- m_server_status= thd->server_status;
/*
If inside a stored procedure, do not return the total
number of warnings, since they are not available to the client
@@ -461,10 +457,11 @@ Diagnostics_area::disable_status()
m_status= DA_DISABLED;
}
-Warning_info::Warning_info(ulonglong warn_id_arg)
+Warning_info::Warning_info(ulonglong warn_id_arg, bool allow_unlimited_warnings)
:m_statement_warn_count(0),
m_current_row_for_warning(1),
m_warn_id(warn_id_arg),
+ m_allow_unlimited_warnings(allow_unlimited_warnings),
m_read_only(FALSE)
{
/* Initialize sub structures */
@@ -546,7 +543,8 @@ MYSQL_ERROR *Warning_info::push_warning(THD *thd,
if (! m_read_only)
{
- if (m_warn_list.elements < thd->variables.max_error_count)
+ if (m_allow_unlimited_warnings ||
+ m_warn_list.elements < thd->variables.max_error_count)
{
cond= new (& m_warn_root) MYSQL_ERROR(& m_warn_root);
if (cond)
@@ -562,6 +560,20 @@ MYSQL_ERROR *Warning_info::push_warning(THD *thd,
return cond;
}
+MYSQL_ERROR *Warning_info::push_warning(THD *thd, const MYSQL_ERROR *sql_condition)
+{
+ MYSQL_ERROR *new_condition= push_warning(thd,
+ sql_condition->get_sql_errno(),
+ sql_condition->get_sqlstate(),
+ sql_condition->get_level(),
+ sql_condition->get_message_text());
+
+ if (new_condition)
+ new_condition->copy_opt_attributes(sql_condition);
+
+ return new_condition;
+}
+
/*
Push the warning to error list if there is still room in the list
diff --git a/sql/sql_error.h b/sql/sql_error.h
index 8495a8cfa57..5b9b5ee639a 100644
--- a/sql/sql_error.h
+++ b/sql/sql_error.h
@@ -1,5 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB,
- Copyright (C) 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -12,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef SQL_ERROR_H
#define SQL_ERROR_H
@@ -79,12 +78,6 @@ public:
const char* get_sqlstate() const
{ DBUG_ASSERT(m_status == DA_ERROR); return m_sqlstate; }
- uint server_status() const
- {
- DBUG_ASSERT(m_status == DA_OK || m_status == DA_EOF);
- return m_server_status;
- }
-
ulonglong affected_rows() const
{ DBUG_ASSERT(m_status == DA_OK); return m_affected_rows; }
@@ -118,15 +111,6 @@ private:
char m_sqlstate[SQLSTATE_LENGTH+1];
/**
- Copied from thd->server_status when the diagnostics area is assigned.
- We need this member as some places in the code use the following pattern:
- thd->server_status|= ...
- my_eof(thd);
- thd->server_status&= ~...
- Assigned by OK, EOF or ERROR.
- */
- uint m_server_status;
- /**
The number of rows affected by the last statement. This is
semantically close to thd->row_count_func, but has a different
life cycle. thd->row_count_func stores the value returned by
@@ -345,10 +329,13 @@ class Warning_info
{
/** A memory root to allocate warnings and errors */
MEM_ROOT m_warn_root;
+
/** List of warnings of all severities (levels). */
List <MYSQL_ERROR> m_warn_list;
+
/** A break down of the number of warnings per severity (level). */
uint m_warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_END];
+
/**
The number of warnings of the current statement. Warning_info
life cycle differs from statement life cycle -- it may span
@@ -356,20 +343,25 @@ class Warning_info
m_statement_warn_count 0, whereas m_warn_list is not empty.
*/
uint m_statement_warn_count;
+
/*
Row counter, to print in errors and warnings. Not increased in
create_sort_index(); may differ from examined_row_count.
*/
ulong m_current_row_for_warning;
- /** Used to optionally clear warnings only once per statement. */
+
+ /** Used to optionally clear warnings only once per statement. */
ulonglong m_warn_id;
+ /** Indicates if push_warning() allows unlimited number of warnings. */
+ bool m_allow_unlimited_warnings;
+
private:
Warning_info(const Warning_info &rhs); /* Not implemented */
Warning_info& operator=(const Warning_info &rhs); /* Not implemented */
public:
- Warning_info(ulonglong warn_id_arg);
+ Warning_info(ulonglong warn_id_arg, bool allow_unlimited_warnings);
~Warning_info();
/**
@@ -406,19 +398,13 @@ public:
void append_warnings(THD *thd, List<MYSQL_ERROR> *src)
{
MYSQL_ERROR *err;
- MYSQL_ERROR *copy;
List_iterator_fast<MYSQL_ERROR> it(*src);
/*
Don't use ::push_warning() to avoid invocation of condition
handlers or escalation of warnings to errors.
*/
while ((err= it++))
- {
- copy= Warning_info::push_warning(thd, err->get_sql_errno(), err->get_sqlstate(),
- err->get_level(), err->get_message_text());
- if (copy)
- copy->copy_opt_attributes(err);
- }
+ Warning_info::push_warning(thd, err);
}
/**
@@ -484,6 +470,9 @@ public:
MYSQL_ERROR::enum_warning_level level,
const char* msg);
+ /** Add a new condition to the current list. */
+ MYSQL_ERROR *push_warning(THD *thd, const MYSQL_ERROR *sql_condition);
+
/**
Set the read only status for this statement area.
This is a privileged operation, reserved for the implementation of
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 9620b759adb..3ea378ef19c 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -55,7 +55,7 @@
#include "sql_handler.h"
#include "unireg.h" // REQUIRED: for other includes
#include "sql_base.h" // close_thread_tables
-#include "lock.h" // broadcast_refresh, mysql_unlock_tables
+#include "lock.h" // mysql_unlock_tables
#include "key.h" // key_copy
#include "sql_base.h" // insert_fields
#include "sql_select.h"
@@ -131,11 +131,7 @@ static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables)
/* Non temporary table. */
tables->table->file->ha_index_or_rnd_end();
tables->table->open_by_handler= 0;
- if (close_thread_table(thd, &tables->table))
- {
- /* Tell threads waiting for refresh that something has happened */
- broadcast_refresh();
- }
+ (void) close_thread_table(thd, &tables->table);
thd->mdl_context.release_lock(tables->mdl_request.ticket);
}
else if (tables->table)
@@ -183,7 +179,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
uint dblen, namelen, aliaslen, counter;
bool error;
TABLE *backup_open_tables;
- MDL_ticket *mdl_savepoint;
+ MDL_savepoint mdl_savepoint;
DBUG_ENTER("mysql_ha_open");
DBUG_PRINT("enter",("'%s'.'%s' as '%s' reopen: %d",
tables->db, tables->table_name, tables->alias,
@@ -252,7 +248,13 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
memcpy(hash_tables->db, tables->db, dblen);
memcpy(hash_tables->table_name, tables->table_name, namelen);
memcpy(hash_tables->alias, tables->alias, aliaslen);
- hash_tables->mdl_request.init(MDL_key::TABLE, db, name, MDL_SHARED);
+ /*
+ We can't request lock with explicit duration for this table
+ right from the start as open_tables() can't handle properly
+ back-off for such locks.
+ */
+ hash_tables->mdl_request.init(MDL_key::TABLE, db, name, MDL_SHARED,
+ MDL_TRANSACTION);
/* for now HANDLER can be used only for real TABLES */
hash_tables->required_type= FRMTYPE_TABLE;
@@ -332,8 +334,8 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
thd->set_open_tables(backup_open_tables);
if (hash_tables->mdl_request.ticket)
{
- thd->mdl_context.
- move_ticket_after_trans_sentinel(hash_tables->mdl_request.ticket);
+ thd->mdl_context.set_lock_duration(hash_tables->mdl_request.ticket,
+ MDL_EXPLICIT);
thd->mdl_context.set_needs_thr_lock_abort(TRUE);
}
@@ -611,7 +613,8 @@ retry:
if (keyname)
{
- if ((keyno=find_type(keyname, &table->s->keynames, 1+2)-1)<0)
+ if ((keyno= find_type(keyname, &table->s->keynames,
+ FIND_TYPE_NO_PREFIX) - 1) < 0)
{
my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), keyname, tables->alias);
goto err;
@@ -971,24 +974,23 @@ void mysql_ha_cleanup(THD *thd)
/**
- Move tickets for metadata locks corresponding to open HANDLERs
- after transaction sentinel in order to protect them from being
- released at the end of transaction.
+ Set explicit duration for metadata locks corresponding to open HANDLERs
+ to protect them from being released at the end of transaction.
@param thd Thread identifier.
*/
-void mysql_ha_move_tickets_after_trans_sentinel(THD *thd)
+void mysql_ha_set_explicit_lock_duration(THD *thd)
{
TABLE_LIST *hash_tables;
- DBUG_ENTER("mysql_ha_move_tickets_after_trans_sentinel");
+ DBUG_ENTER("mysql_ha_set_explicit_lock_duration");
for (uint i= 0; i < thd->handler_tables_hash.records; i++)
{
hash_tables= (TABLE_LIST*) my_hash_element(&thd->handler_tables_hash, i);
if (hash_tables->table && hash_tables->table->mdl_ticket)
- thd->mdl_context.
- move_ticket_after_trans_sentinel(hash_tables->table->mdl_ticket);
+ thd->mdl_context.set_lock_duration(hash_tables->table->mdl_ticket,
+ MDL_EXPLICIT);
}
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_handler.h b/sql/sql_handler.h
index c5da3c4d468..2eea552d7c9 100644
--- a/sql/sql_handler.h
+++ b/sql/sql_handler.h
@@ -31,6 +31,6 @@ void mysql_ha_flush(THD *thd);
void mysql_ha_flush_tables(THD *thd, TABLE_LIST *all_tables);
void mysql_ha_rm_tables(THD *thd, TABLE_LIST *tables);
void mysql_ha_cleanup(THD *thd);
-void mysql_ha_move_tickets_after_trans_sentinel(THD *thd);
+void mysql_ha_set_explicit_lock_duration(THD *thd);
#endif /* SQL_HANDLER_INCLUDED */
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index 7218d806c5f..9b2295f6fb3 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -289,10 +289,12 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations,
Field *rtopic_id, *rkey_id;
DBUG_ENTER("get_topics_for_keyword");
- if ((iindex_topic= find_type((char*) primary_key_name,
- &topics->s->keynames, 1+2)-1)<0 ||
- (iindex_relations= find_type((char*) primary_key_name,
- &relations->s->keynames, 1+2)-1)<0)
+ if ((iindex_topic=
+ find_type(primary_key_name, &topics->s->keynames,
+ FIND_TYPE_NO_PREFIX) - 1) < 0 ||
+ (iindex_relations=
+ find_type(primary_key_name, &relations->s->keynames,
+ FIND_TYPE_NO_PREFIX) - 1) < 0)
{
my_message(ER_CORRUPT_HELP_DB, ER(ER_CORRUPT_HELP_DB), MYF(0));
DBUG_RETURN(-1);
@@ -709,7 +711,7 @@ bool mysqld_help(THD *thd, const char *mask)
if (count_topics == 0)
{
- int key_id;
+ int UNINIT_VAR(key_id);
if (!(select=
prepare_select_for_name(thd,mask,mlen,tables,tables[3].table,
used_fields[help_keyword_name].field,
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 99a8378961e..d807ac36278 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,8 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Insert of records */
@@ -77,7 +76,8 @@
#include "sql_audit.h"
#ifndef EMBEDDED_LIBRARY
-static bool delayed_get_table(THD *thd, TABLE_LIST *table_list);
+static bool delayed_get_table(THD *thd, MDL_request *grl_protection_request,
+ 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);
@@ -415,9 +415,9 @@ void prepare_triggers_for_insert_stmt(TABLE *table)
downgrade the lock in handler::store_lock() method.
*/
-void upgrade_lock_type_for_insert(THD *thd, thr_lock_type *lock_type,
- enum_duplicates duplic,
- bool is_multi_insert)
+static
+void upgrade_lock_type(THD *thd, thr_lock_type *lock_type,
+ enum_duplicates duplic)
{
if (duplic == DUP_UPDATE ||
(duplic == DUP_REPLACE && *lock_type == TL_WRITE_CONCURRENT_INSERT))
@@ -466,10 +466,9 @@ void upgrade_lock_type_for_insert(THD *thd, thr_lock_type *lock_type,
return;
}
- bool log_on= (thd->variables.option_bits & OPTION_BIN_LOG ||
- ! (thd->security_ctx->master_access & SUPER_ACL));
+ bool log_on= (thd->variables.option_bits & OPTION_BIN_LOG);
if (global_system_variables.binlog_format == BINLOG_FORMAT_STMT &&
- log_on && mysql_bin_log.is_open() && is_multi_insert)
+ log_on && mysql_bin_log.is_open())
{
/*
Statement-based binary logging does not work in this case, because:
@@ -526,32 +525,28 @@ void upgrade_lock_type_for_insert(THD *thd, thr_lock_type *lock_type,
static
bool open_and_lock_for_insert_delayed(THD *thd, TABLE_LIST *table_list)
{
+ MDL_request protection_request;
DBUG_ENTER("open_and_lock_for_insert_delayed");
#ifndef EMBEDDED_LIBRARY
- if (thd->locked_tables_mode && thd->global_read_lock.is_acquired())
- {
- /*
- If this connection has the global read lock, the handler thread
- will not be able to lock the table. It will wait for the global
- read lock to go away, but this will never happen since the
- connection thread will be stuck waiting for the handler thread
- to open and lock the table.
- If we are not in locked tables mode, INSERT will seek protection
- against the global read lock (and fail), thus we will only get
- to this point in locked tables mode.
- */
- my_error(ER_CANT_UPDATE_WITH_READLOCK, MYF(0));
- DBUG_RETURN(TRUE);
- }
-
/*
In order for the deadlock detector to be able to find any deadlocks
- caused by the handler thread locking this table, we take the metadata
- lock inside the connection thread. If this goes ok, the ticket is cloned
- and added to the list of granted locks held by the handler thread.
+ caused by the handler thread waiting for GRL or this table, we acquire
+ protection against GRL (global IX metadata lock) and metadata lock on
+ table to being inserted into inside the connection thread.
+ If this goes ok, the tickets are cloned and added to the list of granted
+ locks held by the handler thread.
*/
- MDL_ticket *mdl_savepoint= thd->mdl_context.mdl_savepoint();
+ if (thd->global_read_lock.can_acquire_protection())
+ DBUG_RETURN(TRUE);
+
+ protection_request.init(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE,
+ MDL_STATEMENT);
+
+ if (thd->mdl_context.acquire_lock(&protection_request,
+ thd->variables.lock_wait_timeout))
+ DBUG_RETURN(TRUE);
+
if (thd->mdl_context.acquire_lock(&table_list->mdl_request,
thd->variables.lock_wait_timeout))
/*
@@ -561,7 +556,7 @@ bool open_and_lock_for_insert_delayed(THD *thd, TABLE_LIST *table_list)
DBUG_RETURN(TRUE);
bool error= FALSE;
- if (delayed_get_table(thd, table_list))
+ if (delayed_get_table(thd, &protection_request, table_list))
error= TRUE;
else if (table_list->table)
{
@@ -586,13 +581,13 @@ bool open_and_lock_for_insert_delayed(THD *thd, TABLE_LIST *table_list)
}
/*
- If a lock was acquired above, we should release it after
- handle_delayed_insert() has cloned the ticket. Note that acquire_lock() can
- succeed because the connection already has the lock. In this case the ticket
- will be before the mdl_savepoint and we should not release it here.
+ We can't release protection against GRL and metadata lock on the table
+ being inserted into here. These locks might be required, for example,
+ because this INSERT DELAYED calls functions which may try to update
+ this or another tables (updating the same table is of course illegal,
+ but such an attempt can be discovered only later during statement
+ execution).
*/
- if (!thd->mdl_context.has_lock(mdl_savepoint, table_list->mdl_request.ticket))
- thd->mdl_context.release_lock(table_list->mdl_request.ticket);
/*
Reset the ticket in case we end up having to use normal insert and
@@ -631,14 +626,12 @@ bool open_and_lock_for_insert_delayed(THD *thd, TABLE_LIST *table_list)
static int
create_insert_stmt_from_insert_delayed(THD *thd, String *buf)
{
- /* Append the part of thd->query before "DELAYED" keyword */
- if (buf->append(thd->query(),
- thd->lex->keyword_delayed_begin - thd->query()))
- return 1;
- /* Append the part of thd->query after "DELAYED" keyword */
- if (buf->append(thd->lex->keyword_delayed_begin + 7))
+ /* Make a copy of thd->query() and then remove the "DELAYED" keyword */
+ if (buf->append(thd->query()) ||
+ buf->replace(thd->lex->keyword_delayed_begin_offset,
+ thd->lex->keyword_delayed_end_offset -
+ thd->lex->keyword_delayed_begin_offset, 0))
return 1;
-
return 0;
}
@@ -680,8 +673,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
By default, both logs are enabled (this won't cause problems if the server
runs without --log-bin).
*/
- bool log_on= ((thd->variables.option_bits & OPTION_BIN_LOG) ||
- (!(thd->security_ctx->master_access & SUPER_ACL)));
+ bool log_on= (thd->variables.option_bits & OPTION_BIN_LOG);
#endif
thr_lock_type lock_type;
Item *unused_conds= 0;
@@ -691,8 +683,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
Upgrade lock type if the requested lock is incompatible with
the current connection mode or table operation.
*/
- upgrade_lock_type_for_insert(thd, &table_list->lock_type, duplic,
- values_list.elements > 1);
+ upgrade_lock_type(thd, &table_list->lock_type, duplic);
/*
We can't write-delayed into a table locked with LOCK TABLES:
@@ -989,7 +980,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
if (thd->transaction.stmt.modified_non_trans_table)
thd->transaction.all.modified_non_trans_table= TRUE;
- if ((changed && error <= 0) ||
+ if (error <= 0 ||
thd->transaction.stmt.modified_non_trans_table ||
was_insert_delayed)
{
@@ -1028,7 +1019,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
DBUG_ASSERT(thd->killed != THD::KILL_BAD_DATA || error > 0);
if (was_insert_delayed && table_list->lock_type == TL_WRITE)
{
- /* Binlog multi INSERT DELAYED as INSERT without DELAYED. */
+ /* Binlog INSERT DELAYED as INSERT without DELAYED. */
String log_query;
if (create_insert_stmt_from_insert_delayed(thd, &log_query))
{
@@ -1635,9 +1626,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
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 (!records_are_comparable(table) || compare_records(table))
{
if ((error=table->file->ha_update_row(table->record[1],
table->record[0])) &&
@@ -1890,10 +1879,11 @@ public:
mysql_cond_t cond, cond_client;
volatile uint tables_in_use,stacked_inserts;
volatile bool status;
- /*
+ /**
When the handler thread starts, it clones a metadata lock ticket
- for the table to be inserted. This is done to allow the deadlock
- detector to detect deadlocks resulting from this lock.
+ which protects against GRL and ticket for the table to be inserted.
+ This is done to allow the deadlock detector to detect deadlocks
+ resulting from these locks.
Before this is done, the connection thread cannot safely exit
without causing problems for clone_ticket().
Once handler_thread_initialized has been set, it is safe for the
@@ -1905,6 +1895,11 @@ public:
I_List<delayed_row> rows;
ulong group_count;
TABLE_LIST table_list; // Argument
+ /**
+ Request for IX metadata lock protecting against GRL which is
+ passed from connection thread to the handler thread.
+ */
+ MDL_request grl_protection;
Delayed_insert()
:locks_in_memory(0), table(0),tables_in_use(0),stacked_inserts(0),
@@ -1920,22 +1915,6 @@ public:
thd.lex->current_select= 0; // for my_message_sql
thd.lex->sql_command= SQLCOM_INSERT; // For innodb::store_lock()
/*
- Statement-based replication of INSERT DELAYED has problems with
- RAND() and user variables, so in mixed mode we go to row-based.
- For normal commands, the unsafe flag is set at parse time.
- However, since the flag is a member of the THD object, of which
- the delayed_insert thread has its own copy, we must set the
- statement to unsafe here and explicitly set row logging mode.
-
- @todo set_current_stmt_binlog_format_row_if_mixed should not be
- called by anything else than thd->decide_logging_format(). When
- we call set_current_blah here, none of the checks in
- decide_logging_format is made. We should probably call
- thd->decide_logging_format() directly instead. /Sven
- */
- thd.lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_INSERT_DELAYED);
- thd.set_current_stmt_binlog_format_row_if_mixed();
- /*
Prevent changes to global.lock_wait_timeout from affecting
delayed insert threads as any timeouts in delayed inserts
are not communicated to the client.
@@ -2083,7 +2062,8 @@ Delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list)
*/
static
-bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
+bool delayed_get_table(THD *thd, MDL_request *grl_protection_request,
+ TABLE_LIST *table_list)
{
int error;
Delayed_insert *di;
@@ -2116,7 +2096,8 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
mysql_mutex_unlock(&LOCK_thread_count);
di->thd.set_db(table_list->db, (uint) strlen(table_list->db));
di->thd.set_query(my_strdup(table_list->table_name,
- MYF(MY_WME | ME_FATALERROR)), 0);
+ MYF(MY_WME | ME_FATALERROR)),
+ 0, system_charset_info);
if (di->thd.db == NULL || di->thd.query() == NULL)
{
/* The error is reported */
@@ -2127,7 +2108,10 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
/* 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;
- /* We need the ticket so that it can be cloned in handle_delayed_insert */
+ /* We need the tickets so that they can be cloned in handle_delayed_insert */
+ di->grl_protection.init(MDL_key::GLOBAL, "", "",
+ MDL_INTENTION_EXCLUSIVE, MDL_STATEMENT);
+ di->grl_protection.ticket= grl_protection_request->ticket;
init_mdl_requests(&di->table_list);
di->table_list.mdl_request.ticket= table_list->mdl_request.ticket;
@@ -2516,6 +2500,65 @@ void kill_delayed_threads(void)
/**
+ A strategy for the prelocking algorithm which prevents the
+ delayed insert thread from opening tables with engines which
+ do not support delayed inserts.
+
+ Particularly it allows to abort open_tables() as soon as we
+ discover that we have opened a MERGE table, without acquiring
+ metadata locks on underlying tables.
+*/
+
+class Delayed_prelocking_strategy : public Prelocking_strategy
+{
+public:
+ virtual bool handle_routine(THD *thd, Query_tables_list *prelocking_ctx,
+ Sroutine_hash_entry *rt, sp_head *sp,
+ bool *need_prelocking);
+ virtual bool handle_table(THD *thd, Query_tables_list *prelocking_ctx,
+ TABLE_LIST *table_list, bool *need_prelocking);
+ virtual bool handle_view(THD *thd, Query_tables_list *prelocking_ctx,
+ TABLE_LIST *table_list, bool *need_prelocking);
+};
+
+
+bool Delayed_prelocking_strategy::
+handle_table(THD *thd, Query_tables_list *prelocking_ctx,
+ TABLE_LIST *table_list, bool *need_prelocking)
+{
+ DBUG_ASSERT(table_list->lock_type == TL_WRITE_DELAYED);
+
+ if (!(table_list->table->file->ha_table_flags() & HA_CAN_INSERT_DELAYED))
+ {
+ my_error(ER_DELAYED_NOT_SUPPORTED, MYF(0), table_list->table_name);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+bool Delayed_prelocking_strategy::
+handle_routine(THD *thd, Query_tables_list *prelocking_ctx,
+ Sroutine_hash_entry *rt, sp_head *sp,
+ bool *need_prelocking)
+{
+ /* LEX used by the delayed insert thread has no routines. */
+ DBUG_ASSERT(0);
+ return FALSE;
+}
+
+
+bool Delayed_prelocking_strategy::
+handle_view(THD *thd, Query_tables_list *prelocking_ctx,
+ TABLE_LIST *table_list, bool *need_prelocking)
+{
+ /* We don't open views in the delayed insert thread. */
+ DBUG_ASSERT(0);
+ return FALSE;
+}
+
+
+/**
Open and lock table for use by delayed thread and check that
this table is suitable for delayed inserts.
@@ -2525,21 +2568,21 @@ void kill_delayed_threads(void)
bool Delayed_insert::open_and_lock_table()
{
+ Delayed_prelocking_strategy prelocking_strategy;
+
+ /*
+ Use special prelocking strategy to get ER_DELAYED_NOT_SUPPORTED
+ error for tables with engines which don't support delayed inserts.
+ */
if (!(table= open_n_lock_single_table(&thd, &table_list,
TL_WRITE_DELAYED,
- MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK)))
+ MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK,
+ &prelocking_strategy)))
{
thd.fatal_error(); // Abort waiting inserts
return TRUE;
}
- if (!(table->file->ha_table_flags() & HA_CAN_INSERT_DELAYED))
- {
- /* To rollback InnoDB statement transaction. */
- trans_rollback_stmt(&thd);
- my_error(ER_DELAYED_NOT_SUPPORTED, MYF(ME_FATALERROR),
- table_list.table_name);
- return TRUE;
- }
+
if (table->triggers)
{
/*
@@ -2605,21 +2648,23 @@ pthread_handler_t handle_delayed_insert(void *arg)
}
thd->lex->sql_command= SQLCOM_INSERT; // For innodb::store_lock()
+
/*
- Statement-based replication of INSERT DELAYED has problems with RAND()
- and user vars, so in mixed mode we go to row-based.
+ INSERT DELAYED has to go to row-based format because the time
+ at which rows are inserted cannot be determined in mixed mode.
*/
- thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_INSERT_DELAYED);
thd->set_current_stmt_binlog_format_row_if_mixed();
/*
- Clone the ticket representing the lock on the target table for
- the insert and add it to the list of granted metadata locks held by
- the handler thread. This is safe since the handler thread is
- not holding nor waiting on any metadata locks.
+ Clone tickets representing protection against GRL and the lock on
+ the target table for the insert and add them to the list of granted
+ metadata locks held by the handler thread. This is safe since the
+ handler thread is not holding nor waiting on any metadata locks.
*/
- if (thd->mdl_context.clone_ticket(&di->table_list.mdl_request))
+ if (thd->mdl_context.clone_ticket(&di->grl_protection) ||
+ thd->mdl_context.clone_ticket(&di->table_list.mdl_request))
{
+ thd->mdl_context.release_transactional_locks();
di->handler_thread_initialized= TRUE;
goto err;
}
@@ -2875,6 +2920,13 @@ bool Delayed_insert::handle_inserts(void)
if (log_query)
{
/*
+ Guaranteed that the INSERT DELAYED STMT will not be here
+ in SBR when mysql binlog is enabled.
+ */
+ DBUG_ASSERT(!(mysql_bin_log.is_open() &&
+ !thd.is_current_stmt_binlog_format_row()));
+
+ /*
This is the first value of an INSERT statement.
It is the right place to clear a forced insert_id.
This is usually done after the last value of an INSERT statement,
@@ -2941,39 +2993,6 @@ bool Delayed_insert::handle_inserts(void)
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
}
- if (log_query && mysql_bin_log.is_open())
- {
- bool backup_time_zone_used = thd.time_zone_used;
- Time_zone *backup_time_zone = thd.variables.time_zone;
- if (row->time_zone != NULL)
- {
- thd.time_zone_used = true;
- thd.variables.time_zone = row->time_zone;
- }
-
- /* if the delayed insert was killed, the killed status is
- ignored while binlogging */
- int errcode= 0;
- if (thd.killed == THD::NOT_KILLED)
- errcode= query_error_code(&thd, TRUE);
-
- /*
- If the query has several rows to insert, only the first row will come
- here. In row-based binlogging, this means that the first row will be
- written to binlog as one Table_map event and one Rows event (due to an
- event flush done in binlog_query()), then all other rows of this query
- will be binlogged together as one single Table_map event and one
- single Rows event.
- */
- if (thd.binlog_query(THD::ROW_QUERY_TYPE,
- row->query.str, row->query.length,
- FALSE, FALSE, FALSE, errcode))
- goto err;
-
- thd.time_zone_used = backup_time_zone_used;
- thd.variables.time_zone = backup_time_zone;
- }
-
if (table->s->blob_fields)
free_delayed_insert_blobs(table);
thread_safe_decrement(delayed_rows_in_use,&LOCK_delayed_status);
@@ -3470,6 +3489,9 @@ bool select_insert::send_eof()
error= (thd->locked_tables_mode <= LTM_LOCK_TABLES ?
table->file->ha_end_bulk_insert() : 0);
+ if (!error && thd->is_error())
+ error= thd->stmt_da->sql_errno();
+
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
@@ -3895,7 +3917,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
if (table->s->fields < values.elements)
{
- my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), 1);
+ my_error(ER_WRONG_VALUE_COUNT_ON_ROW, MYF(0), 1L);
DBUG_RETURN(-1);
}
@@ -4022,7 +4044,7 @@ bool select_create::send_eof()
{
bool tmp=select_insert::send_eof();
if (tmp)
- abort();
+ abort_result_set();
else
{
/*
@@ -4054,7 +4076,7 @@ void select_create::abort_result_set()
DBUG_ENTER("select_create::abort_result_set");
/*
- In select_insert::abort() we roll back the statement, including
+ In select_insert::abort_result_set() we roll back the statement, including
truncating the transaction cache of the binary log. To do this, we
pretend that the statement is transactional, even though it might
be the case that it was not.
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index b24744571e6..53304d736d8 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -38,6 +38,11 @@ static int lex_one_token(void *arg, void *yythd);
sys_var *trg_new_row_fake_var= (sys_var*) 0x01;
/**
+ LEX_STRING constant for null-string to be used in parser and other places.
+*/
+const LEX_STRING null_lex_str= {NULL, 0};
+const LEX_STRING empty_lex_str= {(char *) "", 0};
+/**
@note The order of the elements of this array must correspond to
the order of elements in enum_binlog_stmt_unsafe.
*/
@@ -458,7 +463,7 @@ void lex_start(THD *thd)
lex->select_lex.group_list.empty();
lex->describe= 0;
lex->subqueries= FALSE;
- lex->view_prepare_mode= FALSE;
+ lex->context_analysis_only= 0;
lex->derived_tables= 0;
lex->safe_to_cache_query= 1;
lex->leaf_tables_insert= 0;
@@ -493,7 +498,6 @@ void lex_start(THD *thd)
lex->nest_level=0 ;
lex->allow_sum_func= 0;
lex->in_sum_func= NULL;
- lex->protect_against_global_read_lock= FALSE;
/*
ok, there must be a better solution for this, long-term
I tried "bzero" in the sql_yacc.yy code, but that for
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 94d698d4358..662b22c3ec7 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -162,7 +162,7 @@ enum enum_sql_command {
SQLCOM_SHOW_OPEN_TABLES,
SQLCOM_HA_OPEN, SQLCOM_HA_CLOSE, SQLCOM_HA_READ,
SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI,
- SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_SHOW_NEW_MASTER, SQLCOM_DO,
+ SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_DO,
SQLCOM_SHOW_WARNS, SQLCOM_EMPTY_QUERY, SQLCOM_SHOW_ERRORS,
SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES,
SQLCOM_HELP, SQLCOM_CREATE_USER, SQLCOM_DROP_USER, SQLCOM_RENAME_USER,
@@ -272,8 +272,7 @@ typedef struct st_lex_server_options
/**
- Structure to hold parameters for CHANGE MASTER or START/STOP SLAVE
- or SHOW NEW MASTER.
+ Structure to hold parameters for CHANGE MASTER, START SLAVE, and STOP SLAVE.
Remark: this should not be confused with Master_info (and perhaps
would better be renamed to st_lex_replication_info). Some fields,
@@ -962,19 +961,19 @@ inline bool st_select_lex_unit::is_union ()
#define ALTER_CHANGE_COLUMN_DEFAULT (1L << 8)
#define ALTER_KEYS_ONOFF (1L << 9)
#define ALTER_CONVERT (1L << 10)
-#define ALTER_FORCE (1L << 11)
-#define ALTER_RECREATE (1L << 12)
-#define ALTER_ADD_PARTITION (1L << 13)
-#define ALTER_DROP_PARTITION (1L << 14)
-#define ALTER_COALESCE_PARTITION (1L << 15)
-#define ALTER_REORGANIZE_PARTITION (1L << 16)
-#define ALTER_PARTITION (1L << 17)
-#define ALTER_ADMIN_PARTITION (1L << 18)
-#define ALTER_TABLE_REORG (1L << 19)
-#define ALTER_REBUILD_PARTITION (1L << 20)
-#define ALTER_ALL_PARTITION (1L << 21)
-#define ALTER_REMOVE_PARTITIONING (1L << 22)
-#define ALTER_FOREIGN_KEY (1L << 23)
+#define ALTER_RECREATE (1L << 11)
+#define ALTER_ADD_PARTITION (1L << 12)
+#define ALTER_DROP_PARTITION (1L << 13)
+#define ALTER_COALESCE_PARTITION (1L << 14)
+#define ALTER_REORGANIZE_PARTITION (1L << 15)
+#define ALTER_PARTITION (1L << 16)
+#define ALTER_ADMIN_PARTITION (1L << 17)
+#define ALTER_TABLE_REORG (1L << 18)
+#define ALTER_REBUILD_PARTITION (1L << 19)
+#define ALTER_ALL_PARTITION (1L << 20)
+#define ALTER_REMOVE_PARTITIONING (1L << 21)
+#define ALTER_FOREIGN_KEY (1L << 22)
+#define ALTER_TRUNCATE_PARTITION (1L << 23)
enum enum_alter_table_change_level
{
@@ -1064,6 +1063,8 @@ struct st_sp_chistics
enum enum_sp_data_access daccess;
};
+extern const LEX_STRING null_lex_str;
+extern const LEX_STRING empty_lex_str;
struct st_trg_chistics
{
@@ -1404,6 +1405,7 @@ public:
STMT_ACCESS_TABLE_COUNT
};
+#ifndef DBUG_OFF
static inline const char *stmt_accessed_table_string(enum_stmt_accessed_table accessed_table)
{
switch (accessed_table)
@@ -1437,7 +1439,10 @@ public:
DBUG_ASSERT(0);
break;
}
+ MY_ASSERT_UNREACHABLE();
+ return "";
}
+#endif /* DBUG */
#define BINLOG_DIRECT_ON 0xF0 /* unsafe when
--binlog-direct-non-trans-updates
@@ -2306,19 +2311,12 @@ struct LEX: public Query_tables_list
uint8 derived_tables;
uint8 create_view_algorithm;
uint8 create_view_check;
+ uint8 context_analysis_only;
bool drop_if_exists, drop_temporary, local_file, one_shot_set;
bool autocommit;
bool verbose, no_write_to_binlog;
enum enum_yes_no_unknown tx_chain, tx_release;
- /*
- Special JOIN::prepare mode: changing of query is prohibited.
- When creating a view, we need to just check its syntax omitting
- any optimizations: afterwards definition of the view will be
- reconstructed by means of ::print() methods and written to
- to an .frm file. We need this definition to stay untouched.
- */
- bool view_prepare_mode;
bool safe_to_cache_query;
bool subqueries, ignore;
st_parsing_options parsing_options;
@@ -2344,6 +2342,7 @@ struct LEX: public Query_tables_list
sp_name *spname;
bool sp_lex_in_use; /* Keep track on lex usage in SPs for error handling */
bool all_privileges;
+ bool proxy_priv;
sp_pcontext *spcont;
st_sp_chistics sp_chistics;
@@ -2382,15 +2381,19 @@ struct LEX: public Query_tables_list
This pointer is required to add possibly omitted DEFINER-clause to the
DDL-statement before dumping it to the binlog.
- keyword_delayed_begin points to the begin of the DELAYED keyword in
- INSERT DELAYED statement.
+ keyword_delayed_begin_offset is the offset to the beginning of the DELAYED
+ keyword in INSERT DELAYED statement. keyword_delayed_end_offset is the
+ offset to the character right after the DELAYED keyword.
*/
union {
const char *stmt_definition_begin;
- const char *keyword_delayed_begin;
+ uint keyword_delayed_begin_offset;
};
- const char *stmt_definition_end;
+ union {
+ const char *stmt_definition_end;
+ uint keyword_delayed_end_offset;
+ };
/**
Collects create options for Field and KEY
@@ -2414,22 +2417,6 @@ struct LEX: public Query_tables_list
bool escape_used;
bool is_lex_started; /* If lex_start() did run. For debugging. */
- /*
- Special case for SELECT .. FOR UPDATE and LOCK TABLES .. WRITE.
-
- Protect from a impending GRL as otherwise the thread might deadlock
- if it starts waiting for the GRL in mysql_lock_tables.
-
- The protection is needed because there is a race between setting
- the global read lock and waiting for all open tables to be closed.
- The problem is a circular wait where a thread holding "old" open
- tables will wait for the global read lock to be released while the
- thread holding the global read lock will wait for all "old" open
- tables to be closed -- the flush part of flush tables with read
- lock.
- */
- bool protect_against_global_read_lock;
-
LEX();
virtual ~LEX()
@@ -2439,6 +2426,13 @@ struct LEX: public Query_tables_list
delete_dynamic(&plugins);
}
+ inline bool is_ps_or_view_context_analysis()
+ {
+ return (context_analysis_only &
+ (CONTEXT_ANALYSIS_ONLY_PREPARE |
+ CONTEXT_ANALYSIS_ONLY_VIEW));
+ }
+
inline void uncacheable(uint8 cause)
{
safe_to_cache_query= 0;
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index c7c20938dc3..44c2339f462 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011 Oracle and/or its affiliates. All rights reserved.
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
@@ -363,58 +363,58 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
(void) fn_format(name, ex->file_name, mysql_real_data_home, "",
MY_RELATIVE_PATH | MY_UNPACK_FILENAME |
MY_RETURN_REAL_PATH);
-#if !defined(__WIN__)
- MY_STAT stat_info;
- if (!mysql_file_stat(key_file_load, name, &stat_info, MYF(MY_WME)))
- DBUG_RETURN(TRUE);
-
- // if we are not in slave thread, the file must be:
- if (!thd->slave_thread &&
- !((stat_info.st_mode & S_IROTH) == S_IROTH && // readable by others
- (stat_info.st_mode & S_IFLNK) != S_IFLNK && // and not a symlink
- ((stat_info.st_mode & S_IFREG) == S_IFREG ||
- (stat_info.st_mode & S_IFIFO) == S_IFIFO)))
- {
- my_error(ER_TEXTFILE_NOT_READABLE, MYF(0), name);
- DBUG_RETURN(TRUE);
- }
- if ((stat_info.st_mode & S_IFIFO) == S_IFIFO)
- is_fifo = 1;
-#endif
+ }
- if (thd->slave_thread)
- {
+ if (thd->slave_thread)
+ {
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
- if (strncmp(active_mi->rli.slave_patternload_file, name,
- active_mi->rli.slave_patternload_file_size))
- {
- /*
- LOAD DATA INFILE in the slave SQL Thread can only read from
- --slave-load-tmpdir". This should never happen. Please, report a bug.
- */
-
- sql_print_error("LOAD DATA INFILE in the slave SQL Thread can only read from --slave-load-tmpdir. " \
- "Please, report a bug.");
- my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--slave-load-tmpdir");
- DBUG_RETURN(TRUE);
- }
-#else
+ if (strncmp(active_mi->rli.slave_patternload_file, name,
+ active_mi->rli.slave_patternload_file_size))
+ {
/*
- This is impossible and should never happen.
+ LOAD DATA INFILE in the slave SQL Thread can only read from
+ --slave-load-tmpdir". This should never happen. Please, report a bug.
*/
- DBUG_ASSERT(FALSE);
-#endif
- }
- else if (!is_secure_file_path(name))
- {
- /* Read only allowed from within dir specified by secure_file_priv */
- my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--secure-file-priv");
+
+ sql_print_error("LOAD DATA INFILE in the slave SQL Thread can only read from --slave-load-tmpdir. " \
+ "Please, report a bug.");
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--slave-load-tmpdir");
DBUG_RETURN(TRUE);
}
+#else
+ /*
+ This is impossible and should never happen.
+ */
+ DBUG_ASSERT(FALSE);
+#endif
+ }
+ else if (!is_secure_file_path(name))
+ {
+ /* Read only allowed from within dir specified by secure_file_priv */
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--secure-file-priv");
+ DBUG_RETURN(TRUE);
+ }
+#if !defined(__WIN__) && ! defined(__NETWARE__)
+ MY_STAT stat_info;
+ if (!my_stat(name,&stat_info,MYF(MY_WME)))
+ DBUG_RETURN(TRUE);
+
+ // if we are not in slave thread, the file must be:
+ if (!thd->slave_thread &&
+ !((stat_info.st_mode & S_IFLNK) != S_IFLNK && // symlink
+ ((stat_info.st_mode & S_IFREG) == S_IFREG || // regular file
+ (stat_info.st_mode & S_IFIFO) == S_IFIFO))) // named pipe
+ {
+ my_error(ER_TEXTFILE_NOT_READABLE, MYF(0), name);
+ DBUG_RETURN(TRUE);
}
+ if ((stat_info.st_mode & S_IFIFO) == S_IFIFO)
+ is_fifo = 1;
+#endif
if ((file= mysql_file_open(key_file_load,
name, O_RDONLY, MYF(MY_WME))) < 0)
+
DBUG_RETURN(TRUE);
}
@@ -625,6 +625,13 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
transactional_table,
errcode);
}
+
+ /*
+ Flushing the IO CACHE while writing the execute load query log event
+ may result in error (for instance, because the max_binlog_size has been
+ reached, and rotation of the binary log failed).
+ */
+ error= error || mysql_bin_log.get_log_file()->error;
}
if (error)
goto err;
@@ -736,8 +743,7 @@ static bool write_execute_load_query_log_event(THD *thd, sql_exchange* ex,
pfields.append("`");
pfields.append(item->name);
pfields.append("`");
- pfields.append("=");
- val->print(&pfields, QT_ORDINARY);
+ pfields.append(val->name);
}
}
@@ -1294,9 +1300,10 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
String &field_term, String &line_start, String &line_term,
String &enclosed_par, int escape, bool get_it_from_net,
bool is_fifo)
- :file(file_par),buffer(0),escape_char(escape)
+ :file(file_par), buffer(NULL), buff_length(tot_length), escape_char(escape),
+ found_end_of_line(false), eof(false), need_end_io_cache(false),
+ error(false), line_cuted(false), found_null(false), read_charset(cs)
{
- read_charset= cs;
field_term_ptr=(char*) field_term.ptr();
field_term_length= field_term.length();
line_term_ptr=(char*) line_term.ptr();
@@ -1324,12 +1331,10 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
(uchar) enclosed_par[0] : INT_MAX;
field_term_char= field_term_length ? (uchar) field_term_ptr[0] : INT_MAX;
line_term_char= line_term_length ? (uchar) line_term_ptr[0] : INT_MAX;
- error=eof=found_end_of_line=found_null=line_cuted=0;
- buff_length=tot_length;
/* Set of a stack for unget if long terminators */
- uint length=max(field_term_length,line_term_length)+1;
+ uint length= max(cs->mbmaxlen, max(field_term_length, line_term_length)) + 1;
set_if_bigger(length,line_start.length());
stack=stack_pos=(int*) sql_alloc(sizeof(int)*length);
@@ -1371,10 +1376,9 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
READ_INFO::~READ_INFO()
{
- if (!error && need_end_io_cache)
+ if (need_end_io_cache)
::end_io_cache(&cache);
- if (buffer)
- my_free(buffer);
+ my_free(buffer);
List_iterator<XML_TAG> xmlit(taglist);
XML_TAG *t;
while ((t= xmlit++))
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 1a4d6d9b38d..d12b314001a 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1,4 +1,5 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011 Monty Program 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
@@ -11,19 +12,16 @@
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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#define MYSQL_LEX 1
#include "my_global.h"
#include "sql_priv.h"
#include "unireg.h" // REQUIRED: for other includes
#include "sql_parse.h" // sql_kill, *_precheck, *_prepare
-#include "lock.h" // wait_if_global_read_lock,
- // unlock_global_read_lock,
- // try_transactional_lock,
+#include "lock.h" // try_transactional_lock,
// check_transactional_lock,
// set_handler_table_locks,
- // start_waiting_global_read_lock,
// lock_global_read_lock,
// make_global_read_lock_block_commit
#include "sql_base.h" // find_temporary_tablesx
@@ -34,7 +32,7 @@
#include "sql_locale.h" // my_locale_en_US
#include "log.h" // flush_error_log
#include "sql_view.h" // mysql_create_view, mysql_drop_view
-#include "sql_delete.h" // mysql_truncate, mysql_delete
+#include "sql_delete.h" // mysql_delete
#include "sql_insert.h" // mysql_insert
#include "sql_update.h" // mysql_update, mysql_multi_update
#include "sql_partition.h" // struct partition_info
@@ -49,7 +47,6 @@
// mysql_recreate_table,
// mysql_backup_table,
// mysql_restore_table
-#include "sql_truncate.h" // mysql_truncate_table
#include "sql_reload.h" // reload_acl_and_cache
#include "sql_admin.h" // mysql_assign_to_keycache
#include "sql_connect.h" // check_user,
@@ -183,8 +180,7 @@ static bool some_non_temp_table_to_be_updated(THD *thd, TABLE_LIST *tables)
for (TABLE_LIST *table= tables; table; table= table->next_global)
{
DBUG_ASSERT(table->db && table->table_name);
- if (table->updating &&
- !find_temporary_table(thd, table->db, table->table_name))
+ if (table->updating && !find_temporary_table(thd, table))
return 1;
}
return 0;
@@ -268,21 +264,20 @@ void init_update_queries(void)
the code, in particular in the Query_log_event's constructor.
*/
sql_command_flags[SQLCOM_CREATE_TABLE]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
- CF_AUTO_COMMIT_TRANS | CF_PROTECT_AGAINST_GRL |
+ CF_AUTO_COMMIT_TRANS |
CF_CAN_GENERATE_ROW_EVENTS;
sql_command_flags[SQLCOM_CREATE_INDEX]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_ALTER_TABLE]= CF_CHANGES_DATA | CF_WRITE_LOGS_COMMAND |
- CF_AUTO_COMMIT_TRANS | CF_PROTECT_AGAINST_GRL;
+ CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_TRUNCATE]= CF_CHANGES_DATA | CF_WRITE_LOGS_COMMAND |
- CF_AUTO_COMMIT_TRANS | CF_PROTECT_AGAINST_GRL;
+ CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_DROP_TABLE]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_LOAD]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
- CF_PROTECT_AGAINST_GRL |
CF_CAN_GENERATE_ROW_EVENTS;
- sql_command_flags[SQLCOM_CREATE_DB]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS | CF_PROTECT_AGAINST_GRL;
- sql_command_flags[SQLCOM_DROP_DB]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS | CF_PROTECT_AGAINST_GRL;
- sql_command_flags[SQLCOM_ALTER_DB_UPGRADE]= CF_AUTO_COMMIT_TRANS | CF_PROTECT_AGAINST_GRL;
- sql_command_flags[SQLCOM_ALTER_DB]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS | CF_PROTECT_AGAINST_GRL;
+ sql_command_flags[SQLCOM_CREATE_DB]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_DROP_DB]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_ALTER_DB_UPGRADE]= CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_ALTER_DB]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_RENAME_TABLE]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_DROP_INDEX]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_CREATE_VIEW]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
@@ -293,26 +288,18 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_CREATE_EVENT]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_ALTER_EVENT]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_DROP_EVENT]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_CREATE_TRIGGER]= CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_DROP_TRIGGER]= CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_UPDATE]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
- CF_PROTECT_AGAINST_GRL |
CF_CAN_GENERATE_ROW_EVENTS;
sql_command_flags[SQLCOM_UPDATE_MULTI]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
- CF_PROTECT_AGAINST_GRL |
CF_CAN_GENERATE_ROW_EVENTS;
sql_command_flags[SQLCOM_INSERT]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
- CF_PROTECT_AGAINST_GRL |
CF_CAN_GENERATE_ROW_EVENTS;
sql_command_flags[SQLCOM_INSERT_SELECT]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
- CF_PROTECT_AGAINST_GRL |
CF_CAN_GENERATE_ROW_EVENTS;
sql_command_flags[SQLCOM_DELETE]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
- CF_PROTECT_AGAINST_GRL |
CF_CAN_GENERATE_ROW_EVENTS;
sql_command_flags[SQLCOM_DELETE_MULTI]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
- CF_PROTECT_AGAINST_GRL |
CF_CAN_GENERATE_ROW_EVENTS;
sql_command_flags[SQLCOM_REPLACE]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
CF_CAN_GENERATE_ROW_EVENTS;
@@ -336,7 +323,6 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_SHOW_VARIABLES]= CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
sql_command_flags[SQLCOM_SHOW_CHARSETS]= CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
sql_command_flags[SQLCOM_SHOW_COLLATIONS]= CF_STATUS_COMMAND | CF_REEXECUTION_FRAGILE;
- 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;
@@ -373,20 +359,19 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_SHOW_TABLE_STATUS]= (CF_STATUS_COMMAND | CF_SHOW_TABLE_COMMAND | CF_REEXECUTION_FRAGILE);
- sql_command_flags[SQLCOM_CREATE_USER]= CF_CHANGES_DATA | CF_PROTECT_AGAINST_GRL;
- sql_command_flags[SQLCOM_RENAME_USER]= CF_CHANGES_DATA | CF_PROTECT_AGAINST_GRL;
- sql_command_flags[SQLCOM_DROP_USER]= CF_CHANGES_DATA | CF_PROTECT_AGAINST_GRL;
+ sql_command_flags[SQLCOM_CREATE_USER]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_RENAME_USER]= CF_CHANGES_DATA;
+ sql_command_flags[SQLCOM_DROP_USER]= CF_CHANGES_DATA;
sql_command_flags[SQLCOM_GRANT]= CF_CHANGES_DATA;
sql_command_flags[SQLCOM_REVOKE]= CF_CHANGES_DATA;
- sql_command_flags[SQLCOM_REVOKE_ALL]= CF_PROTECT_AGAINST_GRL;
sql_command_flags[SQLCOM_OPTIMIZE]= CF_CHANGES_DATA;
sql_command_flags[SQLCOM_CREATE_FUNCTION]= CF_CHANGES_DATA;
- sql_command_flags[SQLCOM_CREATE_PROCEDURE]= CF_CHANGES_DATA | CF_PROTECT_AGAINST_GRL | CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_CREATE_SPFUNCTION]= CF_CHANGES_DATA | CF_PROTECT_AGAINST_GRL | CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_DROP_PROCEDURE]= CF_CHANGES_DATA | CF_PROTECT_AGAINST_GRL | CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_DROP_FUNCTION]= CF_CHANGES_DATA | CF_PROTECT_AGAINST_GRL | CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_ALTER_PROCEDURE]= CF_CHANGES_DATA | CF_PROTECT_AGAINST_GRL | CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_ALTER_FUNCTION]= CF_CHANGES_DATA | CF_PROTECT_AGAINST_GRL | CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_CREATE_PROCEDURE]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_CREATE_SPFUNCTION]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_DROP_PROCEDURE]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_DROP_FUNCTION]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_ALTER_PROCEDURE]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_ALTER_FUNCTION]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_INSTALL_PLUGIN]= CF_CHANGES_DATA;
sql_command_flags[SQLCOM_UNINSTALL_PLUGIN]= CF_CHANGES_DATA;
@@ -407,6 +392,7 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_REPAIR]= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_OPTIMIZE]|= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_ANALYZE]= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS;
+ sql_command_flags[SQLCOM_CHECK]= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_CREATE_USER]|= CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_DROP_USER]|= CF_AUTO_COMMIT_TRANS;
@@ -420,7 +406,6 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_FLUSH]= CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_RESET]= CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_CHECK]= CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_CREATE_SERVER]= CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_ALTER_SERVER]= CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_DROP_SERVER]= CF_AUTO_COMMIT_TRANS;
@@ -563,7 +548,7 @@ static void handle_bootstrap_impl(THD *thd)
query= (char *) thd->memdup_w_gap(buff, length + 1,
thd->db_length + 1 +
QUERY_CACHE_FLAGS_SIZE);
- thd->set_query_and_id(query, length, next_query_id());
+ thd->set_query_and_id(query, length, thd->charset(), next_query_id());
DBUG_PRINT("query",("%-.4096s",thd->query()));
#if defined(ENABLED_PROFILING)
thd->profiling.start_new_query();
@@ -626,7 +611,7 @@ void do_handle_bootstrap(THD *thd)
if (my_thread_init() || thd->store_globals())
{
#ifndef EMBEDDED_LIBRARY
- close_connection(thd, ER_OUT_OF_RESOURCES, 1);
+ close_connection(thd, ER_OUT_OF_RESOURCES);
#endif
thd->fatal_error();
goto end;
@@ -652,44 +637,6 @@ end:
return;
}
-/**
- @brief Check access privs for a MERGE table and fix children lock types.
-
- @param[in] thd thread handle
- @param[in] db database name
- @param[in,out] table_list list of child tables (merge_list)
- lock_type and optionally db set per table
-
- @return status
- @retval 0 OK
- @retval != 0 Error
-
- @detail
- This function is used for write access to MERGE tables only
- (CREATE TABLE, ALTER TABLE ... UNION=(...)). Set TL_WRITE for
- every child. Set 'db' for every child if not present.
-*/
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
-bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list)
-{
- int error= 0;
-
- if (table_list)
- {
- /* Check that all tables use the current database */
- TABLE_LIST *tlist;
-
- for (tlist= table_list; tlist; tlist= tlist->next_local)
- {
- if (!tlist->db || !tlist->db[0])
- tlist->db= db; /* purecov: inspected */
- }
- error= check_table_access(thd, SELECT_ACL | UPDATE_ACL | DELETE_ACL,
- table_list, FALSE, UINT_MAX, FALSE);
- }
- return error;
-}
-#endif
/* This works because items are allocated with sql_alloc() */
@@ -763,9 +710,26 @@ bool do_command(THD *thd)
net_new_transaction(net);
+
/* Save for user statistics */
thd->start_bytes_received= thd->status_var.bytes_received;
+ /*
+ Synchronization point for testing of KILL_CONNECTION.
+ This sync point can wait here, to simulate slow code execution
+ between the last test of thd->killed and blocking in read().
+
+ The goal of this test is to verify that a connection does not
+ hang, if it is killed at this point of execution.
+ (Bug#37780 - main.kill fails randomly)
+
+ Note that the sync point wait itself will be terminated by a
+ kill. In this case it consumes a condition broadcast, but does
+ not change anything else. The consumed broadcast should not
+ matter here, because the read/recv() below doesn't use it.
+ */
+ DEBUG_SYNC(thd, "before_do_command_net_read");
+
if ((packet_length= my_net_read(net)) == packet_error)
{
DBUG_PRINT("info",("Got error %d reading command from socket %s",
@@ -928,7 +892,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->profiling.start_new_query();
#endif
MYSQL_COMMAND_START(thd->thread_id, command,
- thd->security_ctx->priv_user,
+ &thd->security_ctx->priv_user[0],
(char *) thd->security_ctx->host_or_ip);
thd->command=command;
@@ -989,6 +953,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
#endif
case COM_CHANGE_USER:
{
+ bool rc;
status_var_increment(thd->status_var.com_other);
thd->change_user();
@@ -1000,7 +965,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
uint save_db_length= thd->db_length;
char *save_db= thd->db;
USER_CONN *save_user_connect= thd->user_connect;
- Security_context save_security_ctx= *thd->security_ctx;
+ Security_context save_security_ctx= *thd->security_ctx;
CHARSET_INFO *save_character_set_client=
thd->variables.character_set_client;
CHARSET_INFO *save_collation_connection=
@@ -1008,7 +973,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
CHARSET_INFO *save_character_set_results=
thd->variables.character_set_results;
- if (acl_authenticate(thd, 0, packet_length))
+ rc= acl_authenticate(thd, 0, packet_length);
+ MYSQL_AUDIT_NOTIFY_CONNECTION_CHANGE_USER(thd);
+ if (rc)
{
my_free(thd->security_ctx->user);
*thd->security_ctx= save_security_ctx;
@@ -1067,7 +1034,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break; // fatal error is set
MYSQL_QUERY_START(thd->query(), thd->thread_id,
(char *) (thd->db ? thd->db : ""),
- thd->security_ctx->priv_user,
+ &thd->security_ctx->priv_user[0],
(char *) thd->security_ctx->host_or_ip);
char *packet_end= thd->query() + thd->query_length();
general_log_write(thd, command, thd->query(), thd->query_length());
@@ -1084,17 +1051,15 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
while (!thd->killed && (parser_state.m_lip.found_semicolon != NULL) &&
! thd->is_error())
{
- char *beginning_of_next_stmt= (char*)
- parser_state.m_lip.found_semicolon;
-
/*
Multiple queries exits, execute them individually
*/
- close_thread_tables(thd);
+ char *beginning_of_next_stmt= (char*) parser_state.m_lip.found_semicolon;
+ /* Finalize server status flags after executing a statement. */
+ thd->update_server_status();
thd->protocol->end_statement();
query_cache_end_of_result(thd);
-
ulong length= (ulong)(packet_end - beginning_of_next_stmt);
log_slow_statement(thd);
@@ -1119,10 +1084,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
MYSQL_QUERY_START(beginning_of_next_stmt, thd->thread_id,
(char *) (thd->db ? thd->db : ""),
- thd->security_ctx->priv_user,
+ &thd->security_ctx->priv_user[0],
(char *) thd->security_ctx->host_or_ip);
- thd->set_query_and_id(beginning_of_next_stmt, length, next_query_id());
+ thd->set_query_and_id(beginning_of_next_stmt, length,
+ thd->charset(), next_query_id());
/*
Count each statement from the client.
*/
@@ -1152,7 +1118,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
SHOW statements should not add the used tables to the list of tables
used in a transaction.
*/
- MDL_ticket *mdl_savepoint= thd->mdl_context.mdl_savepoint();
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
status_var_increment(thd->status_var.com_stat[SQLCOM_SHOW_FIELDS]);
if (thd->copy_db_to(&db.str, &db.length))
@@ -1269,7 +1235,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
#endif
case COM_REFRESH:
{
- bool not_used;
+ int not_used;
status_var_increment(thd->status_var.com_stat[SQLCOM_FLUSH]);
ulong options= (ulong) (uchar) packet[0];
if (trans_commit_implicit(thd))
@@ -1444,16 +1410,22 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
(thd->open_tables == NULL ||
(thd->locked_tables_mode == LTM_LOCK_TABLES)));
+ /* Finalize server status flags after executing a command. */
+ thd->update_server_status();
thd->protocol->end_statement();
query_cache_end_of_result(thd);
if (!thd->is_error() && !thd->killed_errno())
mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_RESULT, 0, 0);
+ mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_STATUS,
+ thd->stmt_da->is_error() ? thd->stmt_da->sql_errno() : 0,
+ command_name[command].str);
+
log_slow_statement(thd);
thd_proc_info(thd, "cleaning up");
- thd->set_query(NULL, 0);
+ thd->reset_query();
thd->command=COM_SLEEP;
dec_thread_running();
thd_proc_info(thd, 0);
@@ -1512,8 +1484,7 @@ void log_slow_statement(THD *thd)
ulonglong end_utime_of_query= thd->current_utime();
thd_proc_info(thd, "logging slow query");
- if (((end_utime_of_query - thd->utime_after_lock) >
- thd->variables.long_query_time ||
+ if (((thd->server_status & SERVER_QUERY_WAS_SLOW) ||
((thd->server_status &
(SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
opt_log_queries_not_using_indexes &&
@@ -1819,17 +1790,68 @@ bool sp_process_definer(THD *thd)
/**
- Execute command saved in thd and lex->sql_command.
+ Auxiliary call that opens and locks tables for LOCK TABLES statement
+ and initializes the list of locked tables.
+
+ @param thd Thread context.
+ @param tables List of tables to be locked.
+
+ @return FALSE in case of success, TRUE in case of error.
+*/
+
+static bool lock_tables_open_and_lock_tables(THD *thd, TABLE_LIST *tables)
+{
+ Lock_tables_prelocking_strategy lock_tables_prelocking_strategy;
+ uint counter;
+ TABLE_LIST *table;
+
+ thd->in_lock_tables= 1;
+
+ if (open_tables(thd, &tables, &counter, 0, &lock_tables_prelocking_strategy))
+ goto err;
+
+ /*
+ We allow to change temporary tables even if they were locked for read
+ by LOCK TABLES. To avoid a discrepancy between lock acquired at LOCK
+ TABLES time and by the statement which is later executed under LOCK TABLES
+ we ensure that for temporary tables we always request a write lock (such
+ discrepancy can cause problems for the storage engine).
+ We don't set TABLE_LIST::lock_type in this case as this might result in
+ extra warnings from THD::decide_logging_format() even though binary logging
+ is totally irrelevant for LOCK TABLES.
+ */
+ for (table= tables; table; table= table->next_global)
+ if (!table->placeholder() && table->table->s->tmp_table)
+ table->table->reginfo.lock_type= TL_WRITE;
- Before every operation that can request a write lock for a table
- wait if a global read lock exists. However do not wait if this
- thread has locked tables already. No new locks can be requested
- until the other locks are released. The thread that requests the
- global read lock waits for write locked tables to become unlocked.
+ if (lock_tables(thd, tables, counter, 0) ||
+ thd->locked_tables_list.init_locked_tables(thd))
+ goto err;
+
+ thd->in_lock_tables= 0;
- Note that wait_if_global_read_lock() sets a protection against a new
- global read lock when it succeeds. This needs to be released by
- start_waiting_global_read_lock() after the operation.
+ return FALSE;
+
+err:
+ thd->in_lock_tables= 0;
+
+ trans_rollback_stmt(thd);
+ /*
+ 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
+ */
+ trans_commit_implicit(thd);
+ /* Close tables and release metadata locks. */
+ close_thread_tables(thd);
+ DBUG_ASSERT(!thd->locked_tables_mode);
+ thd->mdl_context.release_transactional_locks();
+ return TRUE;
+}
+
+
+/**
+ Execute command saved in thd and lex->sql_command.
@param thd Thread handle
@@ -1864,7 +1886,6 @@ mysql_execute_command(THD *thd)
/* have table map for update for multi-update statement (BUG#37051) */
bool have_table_map_for_update= FALSE;
#endif
- /* Saved variable value */
DBUG_ENTER("mysql_execute_command");
#ifdef WITH_PARTITION_STORAGE_ENGINE
thd->work_part_info= 0;
@@ -2056,17 +2077,6 @@ mysql_execute_command(THD *thd)
thd->mdl_context.release_transactional_locks();
}
- /*
- Check if this command needs protection against the global read lock
- to avoid deadlock. See CF_PROTECT_AGAINST_GRL.
- start_waiting_global_read_lock() is called at the end of
- mysql_execute_command().
- */
- if (((sql_command_flags[lex->sql_command] & CF_PROTECT_AGAINST_GRL) != 0) &&
- !thd->locked_tables_mode)
- if (thd->global_read_lock.wait_if_global_read_lock(thd, FALSE, TRUE))
- goto error;
-
#ifndef DBUG_OFF
if (lex->sql_command != SQLCOM_SET_OPTION)
DEBUG_SYNC(thd,"before_execute_sql_command");
@@ -2129,10 +2139,6 @@ mysql_execute_command(THD *thd)
if (res)
break;
- if (!thd->locked_tables_mode && lex->protect_against_global_read_lock &&
- thd->global_read_lock.wait_if_global_read_lock(thd, FALSE, TRUE))
- break;
-
res= execute_sqlcom_select(thd, all_tables);
break;
}
@@ -2226,20 +2232,7 @@ case SQLCOM_PREPARE:
my_error(ER_FEATURE_DISABLED, MYF(0), "SHOW PROFILES", "enable-profiling");
goto error;
#endif
- }
- break;
- case SQLCOM_SHOW_NEW_MASTER:
- {
- if (check_global_access(thd, REPL_SLAVE_ACL))
- goto error;
- /* This query don't work now. See comment in repl_failsafe.cc */
-#ifndef WORKING_NEW_MASTER
- my_error(ER_NOT_SUPPORTED_YET, MYF(0), "SHOW NEW MASTER");
- goto error;
-#else
- res = show_new_master(thd);
break;
-#endif
}
#ifdef HAVE_REPLICATION
@@ -2391,20 +2384,6 @@ case SQLCOM_PREPARE:
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
- and then create, open and write-lock the new table. If a global
- read lock steps in, we get a deadlock. The write lock waits for
- the global read lock, while the global read lock waits for the
- select table to be closed. So we wait until the global readlock is
- gone before starting both steps. Note that
- wait_if_global_read_lock() sets a protection against a new global
- read lock when it succeeds. This needs to be released by
- start_waiting_global_read_lock(). We protect the normal CREATE
- TABLE in the same way. That way we avoid that a new table is
- created during a global read lock.
- Protection against grl is covered by the CF_PROTECT_AGAINST_GRL flag.
- */
#ifdef WITH_PARTITION_STORAGE_ENGINE
{
@@ -2850,7 +2829,11 @@ end_with_restore_list:
{
Incident_log_event ev(thd, incident);
(void) mysql_bin_log.write(&ev); /* error is ignored */
- mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE);
+ if (mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE))
+ {
+ res= 1;
+ break;
+ }
}
DBUG_PRINT("debug", ("Just after generate_incident()"));
}
@@ -2876,6 +2859,15 @@ end_with_restore_list:
thd->first_successful_insert_id_in_cur_stmt=
thd->first_successful_insert_id_in_prev_stmt;
+ DBUG_EXECUTE_IF("after_mysql_insert",
+ {
+ const char act[]=
+ "now "
+ "wait_for signal.continue";
+ DBUG_ASSERT(opt_debug_sync_timeout > 0);
+ DBUG_ASSERT(!debug_sync_set_action(current_thd,
+ STRING_WITH_LEN(act)));
+ };);
break;
}
case SQLCOM_REPLACE_SELECT:
@@ -3162,36 +3154,13 @@ end_with_restore_list:
if (check_table_access(thd, LOCK_TABLES_ACL | SELECT_ACL, all_tables,
FALSE, UINT_MAX, FALSE))
goto error;
- if (lex->protect_against_global_read_lock &&
- thd->global_read_lock.wait_if_global_read_lock(thd, FALSE, TRUE))
- goto error;
thd->variables.option_bits|= OPTION_TABLE_LOCK;
- thd->in_lock_tables=1;
-
- {
- Lock_tables_prelocking_strategy lock_tables_prelocking_strategy;
- res= (open_and_lock_tables(thd, all_tables, FALSE, 0,
- &lock_tables_prelocking_strategy) ||
- thd->locked_tables_list.init_locked_tables(thd));
- }
-
- thd->in_lock_tables= 0;
+ res= lock_tables_open_and_lock_tables(thd, all_tables);
if (res)
{
- trans_rollback_stmt(thd);
- /*
- 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
- */
- trans_commit_implicit(thd);
- /* Close tables and release metadata locks. */
- close_thread_tables(thd);
- DBUG_ASSERT(!thd->locked_tables_mode);
- thd->mdl_context.release_transactional_locks();
thd->variables.option_bits&= ~(OPTION_TABLE_LOCK);
}
else
@@ -3449,6 +3418,10 @@ end_with_restore_list:
if (check_access(thd, UPDATE_ACL, "mysql", NULL, NULL, 1, 1) &&
check_global_access(thd,CREATE_USER_ACL))
break;
+
+ /* Replicate current user as grantor */
+ thd->binlog_invoker();
+
/* Conditionally writes to binlog */
if (!(res = mysql_revoke_all(thd, lex->users_list)))
my_ok(thd);
@@ -3457,16 +3430,21 @@ end_with_restore_list:
case SQLCOM_REVOKE:
case SQLCOM_GRANT:
{
- if (check_access(thd, lex->grant | lex->grant_tot_col | GRANT_ACL,
+ if (lex->type != TYPE_ENUM_PROXY &&
+ 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 : NULL,
first_table ? &first_table->grant.m_internal : NULL,
first_table ? 0 : 1, 0))
goto error;
+ /* Replicate current user as grantor */
+ thd->binlog_invoker();
+
if (thd->security_ctx->user) // If not replication
{
LEX_USER *user, *tmp_user;
+ bool first_user= TRUE;
List_iterator <LEX_USER> user_list(lex->users_list);
while ((tmp_user= user_list++))
@@ -3477,24 +3455,26 @@ end_with_restore_list:
hostname_requires_resolving(user->host.str))
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_HOSTNAME_WONT_WORK,
- ER(ER_WARN_HOSTNAME_WONT_WORK),
- user->host.str);
+ ER(ER_WARN_HOSTNAME_WONT_WORK));
// Are we trying to change a password of another user
DBUG_ASSERT(user->host.str != 0);
- if (strcmp(thd->security_ctx->user, user->user.str) ||
- my_strcasecmp(system_charset_info,
- user->host.str, thd->security_ctx->host_or_ip))
+
+ /*
+ GRANT/REVOKE PROXY has the target user as a first entry in the list.
+ */
+ if (lex->type == TYPE_ENUM_PROXY && first_user)
{
- // TODO: use check_change_password()
- if (is_acl_user(user->host.str, user->user.str) &&
- user->password.str &&
- check_access(thd, UPDATE_ACL, "mysql", NULL, NULL, 1, 1))
- {
- my_message(ER_PASSWORD_NOT_ALLOWED,
- ER(ER_PASSWORD_NOT_ALLOWED), MYF(0));
+ first_user= FALSE;
+ if (acl_check_proxy_grant_access (thd, user->host.str, user->user.str,
+ lex->grant & GRANT_ACL))
goto error;
- }
- }
+ }
+ else if (is_acl_user(user->host.str, user->user.str) &&
+ user->password.str &&
+ check_change_password (thd, user->host.str, user->user.str,
+ user->password.str,
+ user->password.length))
+ goto error;
}
}
if (first_table)
@@ -3529,16 +3509,19 @@ end_with_restore_list:
}
else
{
- if (lex->columns.elements || lex->type)
+ if (lex->columns.elements || (lex->type && lex->type != TYPE_ENUM_PROXY))
{
my_message(ER_ILLEGAL_GRANT_FOR_TABLE, ER(ER_ILLEGAL_GRANT_FOR_TABLE),
MYF(0));
goto error;
}
else
- /* Conditionally writes to binlog */
- res = mysql_grant(thd, select_lex->db, lex->users_list, lex->grant,
- lex->sql_command == SQLCOM_REVOKE);
+ {
+ /* Conditionally writes to binlog */
+ res = mysql_grant(thd, select_lex->db, lex->users_list, lex->grant,
+ lex->sql_command == SQLCOM_REVOKE,
+ lex->type == TYPE_ENUM_PROXY);
+ }
if (!res)
{
if (lex->sql_command == SQLCOM_GRANT)
@@ -3565,8 +3548,7 @@ end_with_restore_list:
lex->no_write_to_binlog= 1;
case SQLCOM_FLUSH:
{
- bool write_to_binlog;
-
+ int write_to_binlog;
if (check_global_access(thd,RELOAD_ACL))
goto error;
@@ -3595,12 +3577,22 @@ end_with_restore_list:
/*
Presumably, RESET and binlog writing doesn't require synchronization
*/
- if (!lex->no_write_to_binlog && write_to_binlog)
+
+ if (write_to_binlog > 0) // we should write
+ {
+ if (!lex->no_write_to_binlog)
+ res= write_bin_log(thd, FALSE, thd->query(), thd->query_length());
+ } else if (write_to_binlog < 0)
{
- if ((res= write_bin_log(thd, FALSE, thd->query(), thd->query_length())))
- break;
- }
- my_ok(thd);
+ /*
+ We should not write, but rather report error because
+ reload_acl_and_cache binlog interactions failed
+ */
+ res= 1;
+ }
+
+ if (!res)
+ my_ok(thd);
}
break;
@@ -3805,13 +3797,22 @@ end_with_restore_list:
Security_context *backup= NULL;
LEX_USER *definer= thd->lex->definer;
/*
- We're going to issue an implicit GRANT statement.
- It takes metadata locks and updates system tables.
- Make sure that sp_create_routine() did not leave any
- locks in the MDL context, so there is no risk to
- deadlock.
+ We're going to issue an implicit GRANT statement so we close all
+ open tables. We have to keep metadata locks as this ensures that
+ this statement is atomic against concurent FLUSH TABLES WITH READ
+ LOCK. Deadlocks which can arise due to fact that this implicit
+ statement takes metadata locks should be detected by a deadlock
+ detector in MDL subsystem and reported as errors.
+
+ No need to commit/rollback statement transaction, it's not started.
+
+ TODO: Long-term we should either ensure that implicit GRANT statement
+ is written into binary log as a separate statement or make both
+ creation of routine and implicit GRANT parts of one fully atomic
+ statement.
*/
- close_mysql_tables(thd);
+ DBUG_ASSERT(thd->transaction.stmt.is_empty());
+ close_thread_tables(thd);
/*
Check if the definer exists on slave,
then use definer privilege to insert routine privileges to mysql.procs_priv.
@@ -4059,49 +4060,48 @@ create_sp_error:
int sp_result;
int type= (lex->sql_command == SQLCOM_DROP_PROCEDURE ?
TYPE_ENUM_PROCEDURE : TYPE_ENUM_FUNCTION);
+ char *db= lex->spname->m_db.str;
+ char *name= lex->spname->m_name.str;
- /*
- @todo: here we break the metadata locking protocol by
- looking up the information about the routine without
- a metadata lock. Rewrite this piece to make sp_drop_routine
- return whether the routine existed or not.
- */
- sp_result= sp_routine_exists_in_table(thd, type, lex->spname);
- thd->warning_info->opt_clear_warning_info(thd->query_id);
- if (sp_result == SP_OK)
- {
- char *db= lex->spname->m_db.str;
- char *name= lex->spname->m_name.str;
-
- if (check_routine_access(thd, ALTER_PROC_ACL, db, name,
- lex->sql_command == SQLCOM_DROP_PROCEDURE, 0))
- goto error;
+ if (check_routine_access(thd, ALTER_PROC_ACL, db, name,
+ lex->sql_command == SQLCOM_DROP_PROCEDURE, 0))
+ goto error;
- /* Conditionally writes to binlog */
- sp_result= sp_drop_routine(thd, type, lex->spname);
+ /* Conditionally writes to binlog */
+ sp_result= sp_drop_routine(thd, type, lex->spname);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- /*
- We're going to issue an implicit REVOKE statement.
- It takes metadata locks and updates system tables.
- Make sure that sp_create_routine() did not leave any
- locks in the MDL context, so there is no risk to
- deadlock.
- */
- close_mysql_tables(thd);
+ /*
+ We're going to issue an implicit REVOKE statement so we close all
+ open tables. We have to keep metadata locks as this ensures that
+ this statement is atomic against concurent FLUSH TABLES WITH READ
+ LOCK. Deadlocks which can arise due to fact that this implicit
+ statement takes metadata locks should be detected by a deadlock
+ detector in MDL subsystem and reported as errors.
+
+ No need to commit/rollback statement transaction, it's not started.
+
+ TODO: Long-term we should either ensure that implicit REVOKE statement
+ is written into binary log as a separate statement or make both
+ dropping of routine and implicit REVOKE parts of one fully atomic
+ statement.
+ */
+ DBUG_ASSERT(thd->transaction.stmt.is_empty());
+ close_thread_tables(thd);
- if (sp_automatic_privileges && !opt_noacl &&
- sp_revoke_privileges(thd, db, name,
- lex->sql_command == SQLCOM_DROP_PROCEDURE))
- {
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_PROC_AUTO_REVOKE_FAIL,
- ER(ER_PROC_AUTO_REVOKE_FAIL));
- /* If this happens, an error should have been reported. */
- goto error;
- }
-#endif
+ if (sp_result != SP_KEY_NOT_FOUND &&
+ sp_automatic_privileges && !opt_noacl &&
+ sp_revoke_privileges(thd, db, name,
+ lex->sql_command == SQLCOM_DROP_PROCEDURE))
+ {
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_PROC_AUTO_REVOKE_FAIL,
+ ER(ER_PROC_AUTO_REVOKE_FAIL));
+ /* If this happens, an error should have been reported. */
+ goto error;
}
+#endif
+
res= sp_result;
switch (sp_result) {
case SP_OK:
@@ -4378,14 +4378,6 @@ error:
res= TRUE;
finish:
- if (thd->global_read_lock.has_protection())
- {
- /*
- Release the protection against the global read lock and wake
- everyone, who might want to set a global read lock.
- */
- thd->global_read_lock.start_waiting_global_read_lock(thd);
- }
DBUG_ASSERT(!thd->in_active_multi_stmt_transaction() ||
thd->in_multi_stmt_transaction_mode());
@@ -4421,6 +4413,11 @@ finish:
close_thread_tables(thd);
thd_proc_info(thd, 0);
+#ifndef DBUG_OFF
+ if (lex->sql_command != SQLCOM_SET_OPTION && ! thd->in_sub_stmt)
+ DEBUG_SYNC(thd, "execute_command_after_close_tables");
+#endif
+
if (stmt_causes_implicit_commit(thd, CF_IMPLICIT_COMMIT_END))
{
/* No transaction control allowed in sub-statements. */
@@ -4446,6 +4443,10 @@ finish:
*/
thd->mdl_context.release_transactional_locks();
}
+ else if (! thd->in_sub_stmt)
+ {
+ thd->mdl_context.release_statement_locks();
+ }
DBUG_RETURN(res || thd->is_error());
}
@@ -4478,12 +4479,20 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
return 1; /* purecov: inspected */
thd->send_explain_fields(result);
res= mysql_explain_union(thd, &thd->lex->unit, result);
- if (lex->describe & DESCRIBE_EXTENDED)
+ /*
+ The code which prints the extended description is not robust
+ against malformed queries, so skip it if we have an error.
+ */
+ if (!res && (lex->describe & DESCRIBE_EXTENDED))
{
char buff[1024];
String str(buff,(uint32) sizeof(buff), system_charset_info);
str.length(0);
- thd->lex->unit.print(&str, QT_ORDINARY);
+ /*
+ The warnings system requires input in utf8, @see
+ mysqld_show_warnings().
+ */
+ thd->lex->unit.print(&str, QT_TO_SYSTEM_CHARSET);
str.append('\0');
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_YES, str.ptr());
@@ -4802,7 +4811,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
if (!no_errors)
{
status_var_increment(thd->status_var.access_denied_errors);
- my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
+ my_error(access_denied_error_code(thd->password), MYF(0),
sctx->priv_user,
sctx->priv_host,
(thd->password ?
@@ -5222,10 +5231,17 @@ bool check_stack_overrun(THD *thd, long margin,
if ((stack_used=used_stack(thd->thread_stack,(char*) &stack_used)) >=
(long) (my_thread_stack_size - margin))
{
- char ebuff[MYSQL_ERRMSG_SIZE];
- my_snprintf(ebuff, sizeof(ebuff), ER(ER_STACK_OVERRUN_NEED_MORE),
- stack_used, my_thread_stack_size, margin);
- my_message(ER_STACK_OVERRUN_NEED_MORE, ebuff, MYF(ME_FATALERROR));
+ /*
+ Do not use stack for the message buffer to ensure correct
+ behaviour in cases we have close to no stack left.
+ */
+ char* ebuff= new char[MYSQL_ERRMSG_SIZE];
+ if (ebuff) {
+ my_snprintf(ebuff, MYSQL_ERRMSG_SIZE, ER(ER_STACK_OVERRUN_NEED_MORE),
+ stack_used, my_thread_stack_size, margin);
+ my_message(ER_STACK_OVERRUN_NEED_MORE, ebuff, MYF(ME_FATALERROR));
+ delete [] ebuff;
+ }
return 1;
}
#ifndef DBUG_OFF
@@ -5411,17 +5427,10 @@ mysql_new_select(LEX *lex, bool move_down)
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);
+ my_error(ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT, MYF(0));
DBUG_RETURN(1);
}
select_lex->nest_level= lex->nest_level;
- /*
- Don't evaluate this subquery during statement prepare even if
- it's a constant one. The flag is switched off in the end of
- mysqld_stmt_prepare.
- */
- if (thd->stmt_arena->is_stmt_prepare())
- select_lex->uncacheable|= UNCACHEABLE_PREPARE;
if (move_down)
{
SELECT_LEX_UNIT *unit;
@@ -5596,7 +5605,8 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
if (found_semicolon && (ulong) (found_semicolon - thd->query()))
thd->set_query_inner(thd->query(),
(uint32) (found_semicolon -
- thd->query() - 1));
+ thd->query() - 1),
+ thd->charset());
/* Actually execute the query */
if (found_semicolon)
{
@@ -5607,7 +5617,7 @@ void mysql_parse(THD *thd, char *rawbuf, uint length,
MYSQL_QUERY_EXEC_START(thd->query(),
thd->thread_id,
(char *) (thd->db ? thd->db : ""),
- thd->security_ctx->priv_user,
+ &thd->security_ctx->priv_user[0],
(char *) thd->security_ctx->host_or_ip,
0);
@@ -5992,7 +6002,8 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ptr->next_name_resolution_table= NULL;
/* Link table in global list (all used tables) */
lex->add_to_query_tables(ptr);
- ptr->mdl_request.init(MDL_key::TABLE, ptr->db, ptr->table_name, mdl_type);
+ ptr->mdl_request.init(MDL_key::TABLE, ptr->db, ptr->table_name, mdl_type,
+ MDL_TRANSACTION);
DBUG_RETURN(ptr);
}
@@ -6990,10 +7001,16 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
if (check_access(thd, want_priv, create_table->db,
&create_table->grant.privilege,
&create_table->grant.m_internal,
- 0, 0) ||
- check_merge_table_access(thd, create_table->db,
- lex->create_info.merge_list.first))
+ 0, 0))
goto err;
+
+ /* If it is a merge table, check privileges for merge children. */
+ if (lex->create_info.merge_list.first &&
+ check_table_access(thd, SELECT_ACL | UPDATE_ACL | DELETE_ACL,
+ lex->create_info.merge_list.first,
+ FALSE, UINT_MAX, FALSE))
+ goto err;
+
if (want_priv != CREATE_TMP_ACL &&
check_grant(thd, want_priv, create_table, FALSE, 1, FALSE))
goto err;
@@ -7342,10 +7359,20 @@ bool parse_sql(THD *thd,
bool mysql_parse_status= MYSQLparse(thd) != 0;
- /* Check that if MYSQLparse() failed, thd->is_error() is set. */
+ /*
+ Check that if MYSQLparse() failed either thd->is_error() is set, or an
+ internal error handler is set.
+
+ The assert will not catch a situation where parsing fails without an
+ error reported if an error handler exists. The problem is that the
+ error handler might have intercepted the error, so thd->is_error() is
+ not set. However, there is no way to be 100% sure here (the error
+ handler might be for other errors than parsing one).
+ */
DBUG_ASSERT(!mysql_parse_status ||
- (mysql_parse_status && thd->is_error()));
+ (mysql_parse_status && thd->is_error()) ||
+ (mysql_parse_status && thd->get_internal_handler()));
/* Reset parser state. */
diff --git a/sql/sql_parse.h b/sql/sql_parse.h
index 11177a9bcf7..650588c5cac 100644
--- a/sql/sql_parse.h
+++ b/sql/sql_parse.h
@@ -155,7 +155,6 @@ bool check_single_table_access(THD *thd, ulong privilege,
bool check_routine_access(THD *thd,ulong want_access,char *db,char *name,
bool is_proc, bool no_errors);
bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table);
-bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list);
bool check_some_routine_access(THD *thd, const char *db, const char *name, bool is_proc);
bool check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
GRANT_INTERNAL_INFO *grant_internal_info,
@@ -178,8 +177,6 @@ inline bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table)
table->grant.privilege= want_access;
return false;
}
-inline bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list)
-{ return false; }
inline bool check_some_routine_access(THD *thd, const char *db,
const char *name, bool is_proc)
{ return false; }
@@ -202,4 +199,10 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables,
bool check_global_access(THD *thd, ulong want_access);
+inline bool is_supported_parser_charset(CHARSET_INFO *cs)
+{
+ return test(cs->mbminlen == 1);
+}
+
+
#endif /* SQL_PARSE_INCLUDED */
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 2d15ca24733..de4ee14b3c1 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -1,4 +1,4 @@
-/* Copyright 2005-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -70,6 +70,7 @@
#ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h"
+/* TODO: Change abort() to DBUG_SUICIDE() when bug#52002 is pushed */
#define ERROR_INJECT_CRASH(code) \
DBUG_EVALUATE_IF(code, (abort(), 0), 0)
#define ERROR_INJECT_ERROR(code) \
@@ -89,7 +90,6 @@ const LEX_STRING partition_keywords[]=
{ C_STRING_WITH_LEN(" COLUMNS") }
};
static const char *part_str= "PARTITION";
-static const char *subpart_str= "SUBPARTITION";
static const char *sub_str= "SUB";
static const char *by_str= "BY";
static const char *space_str= " ";
@@ -166,12 +166,13 @@ int get_part_iter_for_interval_via_walking(partition_info *part_info,
uint min_len, uint max_len,
uint flags,
PARTITION_ITERATOR *part_iter);
+
+#ifdef WITH_PARTITION_STORAGE_ENGINE
static int cmp_rec_and_tuple(part_column_list_val *val, uint32 nvals_in_rec);
static int cmp_rec_and_tuple_prune(part_column_list_val *val,
uint32 n_vals_in_rec,
bool tail_is_min);
-#ifdef WITH_PARTITION_STORAGE_ENGINE
/*
Convert constants in VALUES definition to the character set the
corresponding field uses.
@@ -1055,12 +1056,13 @@ static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
}
/*
- We don't allow creating partitions with timezone-dependent expressions as
- a (sub)partitioning function, but we want to allow such expressions when
- opening existing tables for easier maintenance. This exception should be
- deprecated at some point in future so that we always throw an error.
+ We don't allow creating partitions with expressions with non matching
+ arguments as a (sub)partitioning function,
+ but we want to allow such expressions when opening existing tables for
+ easier maintenance. This exception should be deprecated at some point
+ in future so that we always throw an error.
*/
- if (func_expr->walk(&Item::is_timezone_dependent_processor,
+ if (func_expr->walk(&Item::check_valid_arguments_processor,
0, NULL))
{
if (is_create_table_ind)
@@ -1688,8 +1690,7 @@ bool fix_partition_func(THD *thd, TABLE *table,
goto end;
if (unlikely(part_info->subpart_expr->result_type() != INT_RESULT))
{
- my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0),
- subpart_str);
+ part_info->report_part_expr_error(TRUE);
goto end;
}
}
@@ -1716,10 +1717,9 @@ bool fix_partition_func(THD *thd, TABLE *table,
goto end;
if (unlikely(part_info->part_expr->result_type() != INT_RESULT))
{
- my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0), part_str);
+ part_info->report_part_expr_error(FALSE);
goto end;
}
- part_info->part_result_type= INT_RESULT;
}
part_info->fixed= TRUE;
}
@@ -1765,18 +1765,22 @@ bool fix_partition_func(THD *thd, TABLE *table,
if (unlikely(!part_info->column_list &&
part_info->part_expr->result_type() != INT_RESULT))
{
- my_error(ER_PARTITION_FUNC_NOT_ALLOWED_ERROR, MYF(0), part_str);
+ part_info->report_part_expr_error(FALSE);
goto end;
}
}
if (((part_info->part_type != HASH_PARTITION ||
- part_info->list_of_part_fields == FALSE) &&
- (!part_info->column_list &&
- check_part_func_fields(part_info->part_field_array, TRUE))) ||
+ part_info->list_of_part_fields == FALSE) &&
+ !part_info->column_list &&
+ check_part_func_fields(part_info->part_field_array, TRUE)) ||
(part_info->list_of_subpart_fields == FALSE &&
part_info->is_sub_partitioned() &&
check_part_func_fields(part_info->subpart_field_array, TRUE)))
{
+ /*
+ Range/List/HASH (but not KEY) and not COLUMNS or HASH subpartitioning
+ with columns in the partitioning expression using unallowed charset.
+ */
my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
goto end;
}
@@ -1920,7 +1924,7 @@ static int add_part_field_list(File fptr, List<char> field_list)
String field_string("", 0, system_charset_info);
THD *thd= current_thd;
ulonglong save_options= thd->variables.option_bits;
- thd->variables.option_bits= 0;
+ thd->variables.option_bits&= ~OPTION_QUOTE_SHOW_CREATE;
append_identifier(thd, &field_string, field_str,
strlen(field_str));
thd->variables.option_bits= save_options;
@@ -1939,8 +1943,7 @@ static int add_name_string(File fptr, const char *name)
String name_string("", 0, system_charset_info);
THD *thd= current_thd;
ulonglong save_options= thd->variables.option_bits;
-
- thd->variables.option_bits= 0;
+ thd->variables.option_bits&= ~OPTION_QUOTE_SHOW_CREATE;
append_identifier(thd, &name_string, name,
strlen(name));
thd->variables.option_bits= save_options;
@@ -3902,7 +3905,7 @@ void get_partition_set(const TABLE *table, uchar *buf, const uint index,
part_spec->start_part= 0;
part_spec->end_part= num_parts - 1;
if ((index < MAX_KEY) &&
- key_spec->flag == (uint)HA_READ_KEY_EXACT &&
+ key_spec && key_spec->flag == (uint)HA_READ_KEY_EXACT &&
part_info->some_fields_in_PF.is_set(index))
{
key_info= table->key_info+index;
@@ -4279,43 +4282,31 @@ set_engine_all_partitions(partition_info *part_info,
}
} while (++i < part_info->num_parts);
}
-/*
- SYNOPSIS
- fast_end_partition()
- thd Thread object
- out:copied Number of records copied
- out:deleted Number of records deleted
- table_list Table list with the one table in it
- empty Has nothing been done
- lpt Struct to be used by error handler
- RETURN VALUES
- FALSE Success
- TRUE Failure
- DESCRIPTION
- Support routine to handle the successful cases for partition
- management.
+/**
+ Support routine to handle the successful cases for partition management.
+
+ @param thd Thread object
+ @param copied Number of records copied
+ @param deleted Number of records deleted
+ @param table_list Table list with the one table in it
+
+ @return Operation status
+ @retval FALSE Success
+ @retval TRUE Failure
*/
static int fast_end_partition(THD *thd, ulonglong copied,
ulonglong deleted,
- TABLE_LIST *table_list, bool is_empty,
- ALTER_PARTITION_PARAM_TYPE *lpt,
- bool written_bin_log)
+ TABLE_LIST *table_list)
{
char tmp_name[80];
DBUG_ENTER("fast_end_partition");
thd->proc_info="end";
- if (!is_empty)
- query_cache_invalidate3(thd, table_list, 0);
-
- if ((!is_empty) && (!written_bin_log) &&
- (!thd->lex->no_write_to_binlog) &&
- write_bin_log(thd, FALSE, thd->query(), thd->query_length()))
- DBUG_RETURN(TRUE);
+ query_cache_invalidate3(thd, table_list, 0);
my_snprintf(tmp_name, sizeof(tmp_name), ER(ER_INSERT_INFO),
(ulong) (copied + deleted),
@@ -4437,29 +4428,25 @@ uint set_part_state(Alter_info *alter_info, partition_info *tab_part_info,
}
-/*
+/**
Prepare for ALTER TABLE of partition structure
- SYNOPSIS
- prep_alter_part_table()
- thd Thread object
- table Table object
- inout:alter_info Alter information
- inout:create_info Create info for CREATE TABLE
- old_db_type Old engine type
- out:partition_changed Boolean indicating whether partition changed
- out:fast_alter_partition Boolean indicating whether fast partition
- change is requested
+ @param[in] thd Thread object
+ @param[in] table Table object
+ @param[in,out] alter_info Alter information
+ @param[in,out] create_info Create info for CREATE TABLE
+ @param[in] old_db_type Old engine type
+ @param[out] partition_changed Boolean indicating whether partition changed
+ @param[out] fast_alter_table Internal temporary table allowing fast
+ partition change or NULL if not possible
- RETURN VALUES
- TRUE Error
- FALSE Success
- partition_changed
- fast_alter_partition
+ @return Operation status
+ @retval TRUE Error
+ @retval FALSE Success
- DESCRIPTION
+ @note
This method handles all preparations for ALTER TABLE for partitioned
- tables
+ tables.
We need to handle both partition management command such as Add Partition
and others here as well as an ALTER TABLE that completely changes the
partitioning and yet others that don't change anything at all. We start
@@ -4471,8 +4458,12 @@ 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,
- uint *fast_alter_partition)
+ char *db,
+ const char *table_name,
+ const char *path,
+ TABLE **fast_alter_table)
{
+ TABLE *new_table= NULL;
DBUG_ENTER("prep_alter_part_table");
/* Foreign keys on partitioned tables are not supported, waits for WL#148 */
@@ -4481,15 +4472,9 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
my_error(ER_FOREIGN_KEY_ON_PARTITIONED, MYF(0));
DBUG_RETURN(TRUE);
}
- /*
- We are going to manipulate the partition info on the table object
- so we need to ensure that the table instance is removed from the
- table cache.
- */
- if (table->part_info)
- table->m_needs_reopen= TRUE;
thd->work_part_info= thd->lex->part_info;
+
if (thd->work_part_info &&
!(thd->work_part_info= thd->lex->part_info->get_clone()))
DBUG_RETURN(TRUE);
@@ -4502,7 +4487,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
ALTER_COALESCE_PARTITION | ALTER_REORGANIZE_PARTITION |
ALTER_TABLE_REORG | ALTER_REBUILD_PARTITION))
{
- partition_info *tab_part_info= table->part_info;
+ partition_info *tab_part_info;
partition_info *alt_part_info= thd->work_part_info;
uint flags= 0;
bool is_last_partition_reorged= FALSE;
@@ -4510,11 +4495,32 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
part_elem_value *alt_max_elem_val= NULL;
longlong tab_max_range= 0, alt_max_range= 0;
- if (!tab_part_info)
+ if (!table->part_info)
{
my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0));
DBUG_RETURN(TRUE);
}
+
+ /*
+ Open our intermediate table, we will operate on a temporary instance
+ of the original table, to be able to skip copying all partitions.
+ Open it as a copy of the original table, and modify its partition_info
+ object to allow fast_alter_partition_table to perform the changes.
+ */
+ DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name,
+ MDL_INTENTION_EXCLUSIVE));
+ new_table= open_table_uncached(thd, path, db, table_name, 0);
+ if (!new_table)
+ DBUG_RETURN(TRUE);
+
+ /*
+ This table may be used for copy rows between partitions
+ and also read/write columns when fixing the partition_info struct.
+ */
+ new_table->use_all_columns();
+
+ tab_part_info= new_table->part_info;
+
if (alter_info->flags & ALTER_TABLE_REORG)
{
uint new_part_no, curr_part_no;
@@ -4522,9 +4528,9 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
tab_part_info->use_default_num_partitions)
{
my_error(ER_REORG_NO_PARAM_ERROR, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
- new_part_no= table->file->get_default_no_partitions(create_info);
+ new_part_no= new_table->file->get_default_no_partitions(create_info);
curr_part_no= tab_part_info->num_parts;
if (new_part_no == curr_part_no)
{
@@ -4533,7 +4539,8 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
after the change as before. Thus we can reply ok immediately
without any changes at all.
*/
- *fast_alter_partition= TRUE;
+ *fast_alter_table= new_table;
+ thd->work_part_info= tab_part_info;
DBUG_RETURN(FALSE);
}
else if (new_part_no > curr_part_no)
@@ -4555,15 +4562,15 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
alter_info->num_parts= curr_part_no - new_part_no;
}
}
- if (!(flags= table->file->alter_table_flags(alter_info->flags)))
+ if (!(flags= new_table->file->alter_table_flags(alter_info->flags)))
{
my_error(ER_PARTITION_FUNCTION_FAILURE, MYF(0));
- DBUG_RETURN(1);
+ goto err;
}
- *fast_alter_partition=
- ((flags & (HA_FAST_CHANGE_PARTITION | HA_PARTITION_ONE_PHASE)) != 0);
- DBUG_PRINT("info", ("*fast_alter_partition: %d flags: 0x%x",
- *fast_alter_partition, flags));
+ if ((flags & (HA_FAST_CHANGE_PARTITION | HA_PARTITION_ONE_PHASE)) != 0)
+ *fast_alter_table= new_table;
+ DBUG_PRINT("info", ("*fast_alter_table: %p flags: 0x%x",
+ *fast_alter_table, flags));
if ((alter_info->flags & ALTER_ADD_PARTITION) ||
(alter_info->flags & ALTER_REORGANIZE_PARTITION))
{
@@ -4574,12 +4581,12 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
if (tab_part_info->part_type == RANGE_PARTITION)
{
my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0), "RANGE");
- DBUG_RETURN(TRUE);
+ goto err;
}
else if (tab_part_info->part_type == LIST_PARTITION)
{
my_error(ER_PARTITIONS_MUST_BE_DEFINED_ERROR, MYF(0), "LIST");
- DBUG_RETURN(TRUE);
+ goto err;
}
/*
Hash partitions can be altered without parser finds out about
@@ -4610,7 +4617,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
"LIST", "IN");
}
- DBUG_RETURN(TRUE);
+ goto err;
}
}
if ((tab_part_info->column_list &&
@@ -4624,12 +4631,12 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
alt_part_info->num_columns != 0))
{
my_error(ER_PARTITION_COLUMN_LIST_ERROR, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
alt_part_info->column_list= tab_part_info->column_list;
if (alt_part_info->fix_parser_data(thd))
{
- DBUG_RETURN(TRUE);
+ goto err;
}
}
if (alter_info->flags & ALTER_ADD_PARTITION)
@@ -4652,17 +4659,17 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
tab_part_info->part_type != HASH_PARTITION)
{
my_error(ER_NO_BINLOG_ERROR, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
if (tab_part_info->defined_max_value)
{
my_error(ER_PARTITION_MAXVALUE_ERROR, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
if (num_new_partitions == 0)
{
my_error(ER_ADD_PARTITION_NO_NEW_PARTITION, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
if (tab_part_info->is_sub_partitioned())
{
@@ -4671,7 +4678,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
else if (alt_part_info->num_subparts != tab_part_info->num_subparts)
{
my_error(ER_ADD_PARTITION_SUBPART_ERROR, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
check_total_partitions= new_total_partitions*
alt_part_info->num_subparts;
@@ -4679,15 +4686,15 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
if (check_total_partitions > MAX_PARTITIONS)
{
my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
alt_part_info->part_type= tab_part_info->part_type;
alt_part_info->subpart_type= tab_part_info->subpart_type;
- if (alt_part_info->set_up_defaults_for_partitioning(table->file,
+ if (alt_part_info->set_up_defaults_for_partitioning(new_table->file,
ULL(0),
tab_part_info->num_parts))
{
- DBUG_RETURN(TRUE);
+ goto err;
}
/*
Handling of on-line cases:
@@ -4751,7 +4758,7 @@ adding and copying partitions, the second after completing the adding
and copying and finally the third line after also dropping the partitions
that are reorganised.
*/
- if (*fast_alter_partition &&
+ if (*fast_alter_table &&
tab_part_info->part_type == HASH_PARTITION)
{
uint part_no= 0, start_part= 1, start_sec_part= 1;
@@ -4856,12 +4863,12 @@ that are reorganised.
do
{
partition_element *part_elem= alt_it++;
- if (*fast_alter_partition)
+ if (*fast_alter_table)
part_elem->part_state= PART_TO_BE_ADDED;
if (tab_part_info->partitions.push_back(part_elem))
{
mem_alloc_error(1);
- DBUG_RETURN(TRUE);
+ goto err;
}
} while (++part_count < num_new_partitions);
tab_part_info->num_parts+= num_new_partitions;
@@ -4902,12 +4909,12 @@ that are reorganised.
tab_part_info->part_type == LIST_PARTITION))
{
my_error(ER_ONLY_ON_RANGE_LIST_PARTITION, MYF(0), "DROP");
- DBUG_RETURN(TRUE);
+ goto err;
}
if (num_parts_dropped >= tab_part_info->num_parts)
{
my_error(ER_DROP_LAST_PARTITION, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
do
{
@@ -4925,12 +4932,12 @@ that are reorganised.
if (num_parts_found != num_parts_dropped)
{
my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), "DROP");
- DBUG_RETURN(TRUE);
+ goto err;
}
- if (table->file->is_fk_defined_on_table_or_index(MAX_KEY))
+ if (new_table->file->is_fk_defined_on_table_or_index(MAX_KEY))
{
my_error(ER_ROW_IS_REFERENCED, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
tab_part_info->num_parts-= num_parts_dropped;
}
@@ -4943,12 +4950,12 @@ that are reorganised.
(!(alter_info->flags & ALTER_ALL_PARTITION)))
{
my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), "REBUILD");
- DBUG_RETURN(TRUE);
+ goto err;
}
- if (!(*fast_alter_partition))
+ if (!(*fast_alter_table))
{
- table->file->print_error(HA_ERR_WRONG_COMMAND, MYF(0));
- DBUG_RETURN(TRUE);
+ new_table->file->print_error(HA_ERR_WRONG_COMMAND, MYF(0));
+ goto err;
}
}
else if (alter_info->flags & ALTER_COALESCE_PARTITION)
@@ -4959,17 +4966,17 @@ that are reorganised.
if (tab_part_info->part_type != HASH_PARTITION)
{
my_error(ER_COALESCE_ONLY_ON_HASH_PARTITION, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
if (num_parts_coalesced == 0)
{
my_error(ER_COALESCE_PARTITION_NO_PARTITION, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
if (num_parts_coalesced >= tab_part_info->num_parts)
{
my_error(ER_DROP_LAST_PARTITION, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
/*
Online handling:
@@ -5008,7 +5015,7 @@ state of p1.
uint part_count= 0, start_part= 1, start_sec_part= 1;
uint end_part= 0, end_sec_part= 0;
bool all_parts= TRUE;
- if (*fast_alter_partition &&
+ if (*fast_alter_table &&
tab_part_info->linear_hash_ind)
{
uint upper_2n= tab_part_info->linear_hash_mask + 1;
@@ -5034,14 +5041,14 @@ state of p1.
do
{
partition_element *p_elem= part_it++;
- if (*fast_alter_partition &&
+ if (*fast_alter_table &&
(all_parts ||
(part_count >= start_part && part_count <= end_part) ||
(part_count >= start_sec_part && part_count <= end_sec_part)))
p_elem->part_state= PART_CHANGED;
if (++part_count > num_parts_remain)
{
- if (*fast_alter_partition)
+ if (*fast_alter_table)
p_elem->part_state= PART_REORGED_DROPPED;
else
part_it.remove();
@@ -5076,38 +5083,38 @@ state of p1.
if (num_parts_reorged > tab_part_info->num_parts)
{
my_error(ER_REORG_PARTITION_NOT_EXIST, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
if (!(tab_part_info->part_type == RANGE_PARTITION ||
tab_part_info->part_type == LIST_PARTITION) &&
(num_parts_new != num_parts_reorged))
{
my_error(ER_REORG_HASH_ONLY_ON_SAME_NO, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
if (tab_part_info->is_sub_partitioned() &&
alt_part_info->num_subparts &&
alt_part_info->num_subparts != tab_part_info->num_subparts)
{
my_error(ER_PARTITION_WRONG_NO_SUBPART_ERROR, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
check_total_partitions= tab_part_info->num_parts + num_parts_new;
check_total_partitions-= num_parts_reorged;
if (check_total_partitions > MAX_PARTITIONS)
{
my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
alt_part_info->part_type= tab_part_info->part_type;
alt_part_info->subpart_type= tab_part_info->subpart_type;
alt_part_info->num_subparts= tab_part_info->num_subparts;
DBUG_ASSERT(!alt_part_info->use_default_partitions);
- if (alt_part_info->set_up_defaults_for_partitioning(table->file,
+ if (alt_part_info->set_up_defaults_for_partitioning(new_table->file,
ULL(0),
0))
{
- DBUG_RETURN(TRUE);
+ goto err;
}
/*
Online handling:
@@ -5166,13 +5173,13 @@ the generated partition syntax in a correct manner.
}
else
tab_max_range= part_elem->range_value;
- if (*fast_alter_partition &&
+ if (*fast_alter_table &&
tab_part_info->temp_partitions.push_back(part_elem))
{
mem_alloc_error(1);
- DBUG_RETURN(TRUE);
+ goto err;
}
- if (*fast_alter_partition)
+ if (*fast_alter_table)
part_elem->part_state= PART_TO_BE_REORGED;
if (!found_first)
{
@@ -5192,7 +5199,7 @@ the generated partition syntax in a correct manner.
else
alt_max_range= alt_part_elem->range_value;
- if (*fast_alter_partition)
+ if (*fast_alter_table)
alt_part_elem->part_state= PART_TO_BE_ADDED;
if (alt_part_count == 0)
tab_it.replace(alt_part_elem);
@@ -5203,7 +5210,7 @@ the generated partition syntax in a correct manner.
else if (found_last)
{
my_error(ER_CONSECUTIVE_REORG_PARTITIONS, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
else
tab_it.remove();
@@ -5217,7 +5224,7 @@ the generated partition syntax in a correct manner.
if (drop_count != num_parts_reorged)
{
my_error(ER_DROP_PARTITION_NON_EXISTENT, MYF(0), "REORGANIZE");
- DBUG_RETURN(TRUE);
+ goto err;
}
tab_part_info->num_parts= check_total_partitions;
}
@@ -5238,9 +5245,9 @@ the generated partition syntax in a correct manner.
tab_part_info->use_default_num_subpartitions= FALSE;
}
if (tab_part_info->check_partition_info(thd, (handlerton**)NULL,
- table->file, ULL(0), TRUE))
+ new_table->file, ULL(0), TRUE))
{
- DBUG_RETURN(TRUE);
+ goto err;
}
/*
The check below needs to be performed after check_partition_info
@@ -5272,7 +5279,7 @@ the generated partition syntax in a correct manner.
to create "holes".
*/
my_error(ER_REORG_OUTSIDE_RANGE, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
}
}
@@ -5389,7 +5396,7 @@ the generated partition syntax in a correct manner.
*partition_changed= TRUE;
if (thd->work_part_info->fix_parser_data(thd))
{
- DBUG_RETURN(TRUE);
+ goto err;
}
}
/*
@@ -5410,7 +5417,7 @@ the generated partition syntax in a correct manner.
if (check_native_partitioned(create_info, &is_native_partitioned,
part_info, thd))
{
- DBUG_RETURN(TRUE);
+ goto err;
}
if (!is_native_partitioned)
{
@@ -5420,6 +5427,17 @@ the generated partition syntax in a correct manner.
}
}
DBUG_RETURN(FALSE);
+err:
+ if (new_table)
+ {
+ /*
+ Only remove the intermediate table object and its share object,
+ do not remove the .frm file, since it is the original one.
+ */
+ close_temporary(new_table, 1, 0);
+ }
+ *fast_alter_table= NULL;
+ DBUG_RETURN(TRUE);
}
@@ -5462,6 +5480,11 @@ static bool mysql_change_partitions(ALTER_PARTITION_PARAM_TYPE *lpt)
if(mysql_trans_prepare_alter_copy_data(thd))
DBUG_RETURN(TRUE);
+ if (file->ha_external_lock(thd, F_WRLCK))
+ DBUG_RETURN(TRUE);
+
+ /* TODO: test if bulk_insert would increase the performance */
+
if ((error= file->ha_change_partitions(lpt->create_info, path, &lpt->copied,
&lpt->deleted, lpt->pack_frm_data,
lpt->pack_frm_len)))
@@ -5470,7 +5493,10 @@ static bool mysql_change_partitions(ALTER_PARTITION_PARAM_TYPE *lpt)
}
if (mysql_trans_commit_alter_copy_data(thd))
- DBUG_RETURN(TRUE); /* The error has been reported */
+ error= 1; /* The error has been reported */
+
+ if (file->ha_external_lock(thd, F_UNLCK))
+ error= 1;
DBUG_RETURN(test(error));
}
@@ -6220,8 +6246,18 @@ static void alter_partition_lock_handling(ALTER_PARTITION_PARAM_TYPE *lpt)
{
THD *thd= lpt->thd;
- close_all_tables_for_name(thd, lpt->table->s, FALSE);
+ if (lpt->old_table)
+ close_all_tables_for_name(thd, lpt->old_table->s, FALSE);
+ if (lpt->table)
+ {
+ /*
+ Only remove the intermediate table object and its share object,
+ do not remove the .frm file, since it is the original one.
+ */
+ close_temporary(lpt->table, 1, 0);
+ }
lpt->table= 0;
+ lpt->old_table= 0;
lpt->table_list->table= 0;
if (thd->locked_tables_list.reopen_tables(thd))
sql_print_warning("We failed to reacquire LOCKs in ALTER TABLE");
@@ -6233,62 +6269,40 @@ static void alter_partition_lock_handling(ALTER_PARTITION_PARAM_TYPE *lpt)
SYNOPSIS
alter_close_tables()
lpt Struct carrying parameters
+ close_old Close original table too
RETURN VALUES
0
*/
-static int alter_close_tables(ALTER_PARTITION_PARAM_TYPE *lpt)
+static int alter_close_tables(ALTER_PARTITION_PARAM_TYPE *lpt, bool close_old)
{
- TABLE_SHARE *share= lpt->table->s;
- THD *thd= lpt->thd;
- TABLE *table;
DBUG_ENTER("alter_close_tables");
- /*
- We must keep LOCK_open while manipulating with thd->open_tables.
- Another thread may be working on it.
- */
- mysql_mutex_lock(&LOCK_open);
- /*
- We can safely remove locks for all tables with the same name:
- later they will all be closed anyway in
- alter_partition_lock_handling().
- */
- for (table= thd->open_tables; table ; table= table->next)
+ if (lpt->table->db_stat)
{
- if (!strcmp(table->s->table_name.str, share->table_name.str) &&
- !strcmp(table->s->db.str, share->db.str))
- {
- mysql_lock_remove(thd, thd->lock, table);
- table->file->close();
- table->db_stat= 0; // Mark file closed
- /*
- Ensure that we won't end up with a crippled table instance
- in the table cache if an error occurs before we reach
- alter_partition_lock_handling() and the table is closed
- by close_thread_tables() instead.
- */
- tdc_remove_table(thd, TDC_RT_REMOVE_UNUSED,
- table->s->db.str,
- table->s->table_name.str, TRUE);
- }
+ lpt->table->file->close();
+ lpt->table->db_stat= 0; // Mark file closed
+ }
+ if (close_old && lpt->old_table)
+ {
+ close_all_tables_for_name(lpt->thd, lpt->old_table->s, FALSE);
+ lpt->old_table= 0;
}
- mysql_mutex_unlock(&LOCK_open);
DBUG_RETURN(0);
}
-/*
- Handle errors for ALTER TABLE for partitioning
- SYNOPSIS
- handle_alter_part_error()
- lpt Struct carrying parameters
- not_completed Was request in complete phase when error occurred
- RETURN VALUES
- NONE
+/**
+ Handle errors for ALTER TABLE for partitioning.
+
+ @param lpt Struct carrying parameters
+ @param action_completed The action must be completed, NOT reverted
+ @param drop_partition Partitions has not been dropped yet
+ @param frm_install The shadow frm-file has not yet been installed
+ @param close_table Table is still open, close it before reverting
*/
void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt,
- bool not_completed,
+ bool action_completed,
bool drop_partition,
bool frm_install,
bool close_table)
@@ -6305,7 +6319,7 @@ void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt,
so we clone it first to have a copy.
*/
part_info= lpt->part_info->get_clone();
- alter_close_tables(lpt);
+ alter_close_tables(lpt, action_completed);
}
if (part_info->first_log_entry &&
@@ -6318,7 +6332,7 @@ void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt,
*/
write_log_completed(lpt, FALSE);
release_log_entries(part_info);
- if (not_completed)
+ if (!action_completed)
{
if (drop_partition)
{
@@ -6383,7 +6397,7 @@ void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt,
else
{
release_log_entries(part_info);
- if (not_completed)
+ if (!action_completed)
{
/*
We hit an error before things were completed but managed
@@ -6426,25 +6440,24 @@ static void downgrade_mdl_if_lock_tables_mode(THD *thd, MDL_ticket *ticket,
}
-/*
+/**
Actually perform the change requested by ALTER TABLE of partitions
previously prepared.
- SYNOPSIS
- fast_alter_partition_table()
- thd Thread object
- table Table object
- alter_info ALTER TABLE info
- create_info Create info for CREATE TABLE
- table_list List of the table involved
- db Database name of new table
- table_name Table name of new table
+ @param thd Thread object
+ @param table Original table object
+ @param alter_info ALTER TABLE info
+ @param create_info Create info for CREATE TABLE
+ @param table_list List of the table involved
+ @param db Database name of new table
+ @param table_name Table name of new table
+ @param fast_alter_table Prepared table object
- RETURN VALUES
- TRUE Error
- FALSE Success
+ @return Operation status
+ @retval TRUE Error
+ @retval FALSE Success
- DESCRIPTION
+ @note
Perform all ALTER TABLE operations for partitioned tables that can be
performed fast without a full copy of the original table.
*/
@@ -6455,19 +6468,20 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
TABLE_LIST *table_list,
char *db,
const char *table_name,
- uint fast_alter_partition)
+ TABLE *fast_alter_table)
{
/* Set-up struct used to write frm files */
- partition_info *part_info= table->part_info;
+ partition_info *part_info;
ALTER_PARTITION_PARAM_TYPE lpt_obj;
ALTER_PARTITION_PARAM_TYPE *lpt= &lpt_obj;
- bool written_bin_log= TRUE;
- bool not_completed= TRUE;
+ bool action_completed= FALSE;
bool close_table_on_failure= FALSE;
bool frm_install= FALSE;
MDL_ticket *mdl_ticket= table->mdl_ticket;
+ DBUG_ASSERT(fast_alter_table);
DBUG_ENTER("fast_alter_partition_table");
+ part_info= fast_alter_table->part_info;
lpt->thd= thd;
lpt->table_list= table_list;
lpt->part_info= part_info;
@@ -6476,7 +6490,8 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
lpt->db_options= create_info->table_options;
if (create_info->row_type == ROW_TYPE_DYNAMIC)
lpt->db_options|= HA_OPTION_PACK_RECORD;
- lpt->table= table;
+ lpt->table= fast_alter_table;
+ lpt->old_table= table;
lpt->key_info_buffer= 0;
lpt->key_count= 0;
lpt->db= db;
@@ -6485,12 +6500,12 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
lpt->deleted= 0;
lpt->pack_frm_data= NULL;
lpt->pack_frm_len= 0;
- thd->work_part_info= part_info;
/* Never update timestamp columns when alter */
- table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
+ lpt->table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
- if (fast_alter_partition & HA_PARTITION_ONE_PHASE)
+ if (table->file->alter_table_flags(alter_info->flags) &
+ HA_PARTITION_ONE_PHASE)
{
/*
In the case where the engine supports one phase online partition
@@ -6607,11 +6622,11 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_ERROR("fail_drop_partition_3") ||
(close_table_on_failure= TRUE, FALSE) ||
write_log_drop_partition(lpt) ||
+ (action_completed= TRUE, FALSE) ||
ERROR_INJECT_CRASH("crash_drop_partition_4") ||
ERROR_INJECT_ERROR("fail_drop_partition_4") ||
+ alter_close_tables(lpt, action_completed) ||
(close_table_on_failure= FALSE, FALSE) ||
- (not_completed= FALSE, FALSE) ||
- alter_close_tables(lpt) ||
ERROR_INJECT_CRASH("crash_drop_partition_5") ||
ERROR_INJECT_ERROR("fail_drop_partition_5") ||
((!thd->lex->no_write_to_binlog) &&
@@ -6632,7 +6647,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_ERROR("fail_drop_partition_9") ||
(alter_partition_lock_handling(lpt), FALSE))
{
- handle_alter_part_error(lpt, not_completed, TRUE, frm_install,
+ handle_alter_part_error(lpt, action_completed, TRUE, frm_install,
close_table_on_failure);
goto err;
}
@@ -6687,7 +6702,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_CRASH("crash_add_partition_5") ||
ERROR_INJECT_ERROR("fail_add_partition_5") ||
(close_table_on_failure= FALSE, FALSE) ||
- alter_close_tables(lpt) ||
+ alter_close_tables(lpt, action_completed) ||
ERROR_INJECT_CRASH("crash_add_partition_6") ||
ERROR_INJECT_ERROR("fail_add_partition_6") ||
((!thd->lex->no_write_to_binlog) &&
@@ -6696,11 +6711,12 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_CRASH("crash_add_partition_7") ||
ERROR_INJECT_ERROR("fail_add_partition_7") ||
write_log_rename_frm(lpt) ||
- (frm_install= TRUE, FALSE) ||
- (not_completed= FALSE, FALSE) ||
+ (action_completed= TRUE, FALSE) ||
ERROR_INJECT_CRASH("crash_add_partition_8") ||
ERROR_INJECT_ERROR("fail_add_partition_8") ||
+ (frm_install= TRUE, FALSE) ||
mysql_write_frm(lpt, WFRM_INSTALL_SHADOW) ||
+ (frm_install= FALSE, FALSE) ||
ERROR_INJECT_CRASH("crash_add_partition_9") ||
ERROR_INJECT_ERROR("fail_add_partition_9") ||
(write_log_completed(lpt, FALSE), FALSE) ||
@@ -6708,7 +6724,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_ERROR("fail_add_partition_10") ||
(alter_partition_lock_handling(lpt), FALSE))
{
- handle_alter_part_error(lpt, not_completed, FALSE, frm_install,
+ handle_alter_part_error(lpt, action_completed, FALSE, frm_install,
close_table_on_failure);
goto err;
}
@@ -6757,10 +6773,10 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
can release all other locks on the table and since no one can open
the table, there can be no new threads accessing the table. They
will be hanging on this exclusive lock.
- 5) Close all instances of the table and remove them from the table cache.
- 6) Log that operation is completed and log all complete actions
+ 5) Log that operation is completed and log all complete actions
needed to complete operation from here
- 7) Write bin log
+ 6) Write bin log
+ 7) Close all instances of the table and remove them from the table cache.
8) Prepare handlers for rename and delete of partitions
9) Rename and drop the reorged partitions such that they are no
longer used and rename those added to their real new names.
@@ -6784,27 +6800,28 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN) ||
ERROR_INJECT_CRASH("crash_change_partition_5") ||
ERROR_INJECT_ERROR("fail_change_partition_5") ||
- alter_close_tables(lpt) ||
- (close_table_on_failure= FALSE) ||
+ write_log_final_change_partition(lpt) ||
+ (action_completed= TRUE, FALSE) ||
ERROR_INJECT_CRASH("crash_change_partition_6") ||
ERROR_INJECT_ERROR("fail_change_partition_6") ||
- write_log_final_change_partition(lpt) ||
- (not_completed= FALSE) ||
- ERROR_INJECT_CRASH("crash_change_partition_7") ||
- ERROR_INJECT_ERROR("fail_change_partition_7") ||
((!thd->lex->no_write_to_binlog) &&
(write_bin_log(thd, FALSE,
thd->query(), thd->query_length()), FALSE)) ||
+ ERROR_INJECT_CRASH("crash_change_partition_7") ||
+ ERROR_INJECT_ERROR("fail_change_partition_7") ||
+ ((frm_install= TRUE), FALSE) ||
+ mysql_write_frm(lpt, WFRM_INSTALL_SHADOW) ||
+ (frm_install= FALSE, FALSE) ||
ERROR_INJECT_CRASH("crash_change_partition_8") ||
ERROR_INJECT_ERROR("fail_change_partition_8") ||
- mysql_write_frm(lpt, WFRM_INSTALL_SHADOW) ||
+ alter_close_tables(lpt, action_completed) ||
+ (close_table_on_failure= FALSE, FALSE) ||
ERROR_INJECT_CRASH("crash_change_partition_9") ||
ERROR_INJECT_ERROR("fail_change_partition_9") ||
mysql_drop_partitions(lpt) ||
ERROR_INJECT_CRASH("crash_change_partition_10") ||
ERROR_INJECT_ERROR("fail_change_partition_10") ||
mysql_rename_partitions(lpt) ||
- ((frm_install= TRUE), FALSE) ||
ERROR_INJECT_CRASH("crash_change_partition_11") ||
ERROR_INJECT_ERROR("fail_change_partition_11") ||
(write_log_completed(lpt, FALSE), FALSE) ||
@@ -6812,7 +6829,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_ERROR("fail_change_partition_12") ||
(alter_partition_lock_handling(lpt), FALSE))
{
- handle_alter_part_error(lpt, not_completed, FALSE, frm_install,
+ handle_alter_part_error(lpt, action_completed, FALSE, frm_install,
close_table_on_failure);
goto err;
}
@@ -6822,12 +6839,25 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
A final step is to write the query to the binlog and send ok to the
user
*/
- DBUG_RETURN(fast_end_partition(thd, lpt->copied, lpt->deleted,
- table_list, FALSE, NULL,
- written_bin_log));
+ DBUG_RETURN(fast_end_partition(thd, lpt->copied, lpt->deleted, table_list));
err:
+ if (action_completed)
+ {
+ /*
+ Although error occurred, the action was forced to retry for completion.
+ Therefore we must close+reopen all instances of the table.
+ */
+ (void) alter_partition_lock_handling(lpt);
+ }
+ else
+ {
+ /*
+ The failed action was reverted, leave the original table as is and
+ close/destroy the intermediate table object and its share.
+ */
+ close_temporary(lpt->table, 1, 0);
+ }
downgrade_mdl_if_lock_tables_mode(thd, mdl_ticket, MDL_SHARED_NO_READ_WRITE);
- table->m_needs_reopen= TRUE;
DBUG_RETURN(TRUE);
}
#endif
@@ -6920,7 +6950,7 @@ void set_key_field_ptr(KEY *key_info, const uchar *new_buf,
void mem_alloc_error(size_t size)
{
- my_error(ER_OUTOFMEMORY, MYF(0), size);
+ my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(size));
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
@@ -7381,8 +7411,8 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
PARTITION_ITERATOR *part_iter)
{
Field *field= part_info->part_field_array[0];
- uint32 max_endpoint_val;
- get_endpoint_func get_endpoint;
+ uint32 UNINIT_VAR(max_endpoint_val);
+ get_endpoint_func UNINIT_VAR(get_endpoint);
bool can_match_multiple_values; /* is not '=' */
uint field_len= field->pack_length_in_rec();
DBUG_ENTER("get_part_iter_for_interval_via_mapping");
@@ -7425,8 +7455,8 @@ int get_part_iter_for_interval_via_mapping(partition_info *part_info,
}
}
else
- assert(0);
-
+ MY_ASSERT_UNREACHABLE();
+
can_match_multiple_values= (flags || !min_value || !max_value ||
memcmp(min_value, max_value, field_len));
if (can_match_multiple_values &&
diff --git a/sql/sql_partition.h b/sql/sql_partition.h
index c644e63794c..9a9a0bd56fa 100644
--- a/sql/sql_partition.h
+++ b/sql/sql_partition.h
@@ -54,6 +54,7 @@ typedef struct st_lock_param_type
HA_CREATE_INFO *create_info;
Alter_info *alter_info;
TABLE *table;
+ TABLE *old_table;
KEY *key_info_buffer;
const char *db;
const char *table_name;
@@ -252,14 +253,17 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
TABLE_LIST *table_list,
char *db,
const char *table_name,
- uint fast_alter_partition);
+ TABLE *fast_alter_table);
uint set_part_state(Alter_info *alter_info, partition_info *tab_part_info,
enum partition_state part_state);
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,
- uint *fast_alter_partition);
+ char *db,
+ const char *table_name,
+ const char *path,
+ TABLE **fast_alter_table);
char *generate_partition_syntax(partition_info *part_info,
uint *buf_length, bool use_sql_alloc,
bool show_partition_options,
diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc
index 795760c855c..cadfc587c1c 100644
--- a/sql/sql_partition_admin.cc
+++ b/sql/sql_partition_admin.cc
@@ -15,10 +15,13 @@
#include "sql_parse.h" // check_one_table_access
#include "sql_table.h" // mysql_alter_table, etc.
-#include "sql_truncate.h" // mysql_truncate_table,
- // Truncate_statement
+#include "sql_lex.h" // Sql_statement
#include "sql_admin.h" // Analyze/Check/.._table_statement
#include "sql_partition_admin.h" // Alter_table_*_partition
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+#include "ha_partition.h" // ha_partition
+#endif
+#include "sql_base.h" // open_and_lock_tables
#ifndef WITH_PARTITION_STORAGE_ENGINE
@@ -45,7 +48,7 @@ bool Alter_table_analyze_partition_statement::execute(THD *thd)
m_lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
res= Analyze_table_statement::execute(thd);
-
+
DBUG_RETURN(res);
}
@@ -103,36 +106,88 @@ bool Alter_table_repair_partition_statement::execute(THD *thd)
bool Alter_table_truncate_partition_statement::execute(THD *thd)
{
+ int error;
+ ha_partition *partition;
+ ulong timeout= thd->variables.lock_wait_timeout;
TABLE_LIST *first_table= thd->lex->select_lex.table_list.first;
- bool res;
- enum_sql_command original_sql_command;
+ bool binlog_stmt;
DBUG_ENTER("Alter_table_truncate_partition_statement::execute");
/*
- Execute TRUNCATE PARTITION just like TRUNCATE TABLE.
- Some storage engines (InnoDB, partition) checks thd_sql_command,
- so we set it to SQLCOM_TRUNCATE during the execution.
- */
- original_sql_command= m_lex->sql_command;
- m_lex->sql_command= SQLCOM_TRUNCATE;
-
- /*
Flag that it is an ALTER command which administrates partitions, used
by ha_partition.
*/
- m_lex->alter_info.flags|= ALTER_ADMIN_PARTITION;
-
+ m_lex->alter_info.flags|= ALTER_ADMIN_PARTITION |
+ ALTER_TRUNCATE_PARTITION;
+
+ /* Fix the lock types (not the same as ordinary ALTER TABLE). */
+ first_table->lock_type= TL_WRITE;
+ first_table->mdl_request.set_type(MDL_EXCLUSIVE);
+
/*
- Fix the lock types (not the same as ordinary ALTER TABLE).
+ Check table permissions and open it with a exclusive lock.
+ Ensure it is a partitioned table and finally, upcast the
+ handler and invoke the partition truncate method. Lastly,
+ write the statement to the binary log if necessary.
*/
- first_table->lock_type= TL_WRITE;
- first_table->mdl_request.set_type(MDL_SHARED_NO_READ_WRITE);
- /* execute as a TRUNCATE TABLE */
- res= Truncate_statement::execute(thd);
+ if (check_one_table_access(thd, DROP_ACL, first_table))
+ DBUG_RETURN(TRUE);
- m_lex->sql_command= original_sql_command;
- DBUG_RETURN(res);
+ if (open_and_lock_tables(thd, first_table, FALSE, 0))
+ DBUG_RETURN(TRUE);
+
+ /*
+ TODO: Add support for TRUNCATE PARTITION for NDB and other
+ engines supporting native partitioning.
+ */
+ if (first_table->table->s->db_type() != partition_hton)
+ {
+ my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+
+ /*
+ Under locked table modes this might still not be an exclusive
+ lock. Hence, upgrade the lock since the handler truncate method
+ mandates an exclusive metadata lock.
+ */
+ MDL_ticket *ticket= first_table->table->mdl_ticket;
+ if (thd->mdl_context.upgrade_shared_lock_to_exclusive(ticket, timeout))
+ DBUG_RETURN(TRUE);
+
+ tdc_remove_table(thd, TDC_RT_REMOVE_NOT_OWN, first_table->db,
+ first_table->table_name, FALSE);
+
+ partition= (ha_partition *) first_table->table->file;
+
+ /* Invoke the handler method responsible for truncating the partition. */
+ if ((error= partition->truncate_partition(&thd->lex->alter_info,
+ &binlog_stmt)))
+ first_table->table->file->print_error(error, MYF(0));
+
+ /*
+ All effects of a truncate operation are committed even if the
+ operation fails. Thus, the query must be written to the binary
+ log. The exception is a unimplemented truncate method or failure
+ before any call to handler::truncate() is done.
+ Also, it is logged in statement format, regardless of the binlog format.
+ */
+ if (error != HA_ERR_WRONG_COMMAND && binlog_stmt)
+ error|= write_bin_log(thd, !error, thd->query(), thd->query_length());
+
+ /*
+ A locked table ticket was upgraded to a exclusive lock. After the
+ the query has been written to the binary log, downgrade the lock
+ to a shared one.
+ */
+ if (thd->locked_tables_mode)
+ ticket->downgrade_exclusive_lock(MDL_SHARED_NO_READ_WRITE);
+
+ if (! error)
+ my_ok(thd);
+
+ DBUG_RETURN(error);
}
#endif /* WITH_PARTITION_STORAGE_ENGINE */
diff --git a/sql/sql_partition_admin.h b/sql/sql_partition_admin.h
index 36bafec4202..564b8676be8 100644
--- a/sql/sql_partition_admin.h
+++ b/sql/sql_partition_admin.h
@@ -210,7 +210,7 @@ public:
/**
Class that represents the ALTER TABLE t1 TRUNCATE PARTITION p statement.
*/
-class Alter_table_truncate_partition_statement : public Truncate_statement
+class Alter_table_truncate_partition_statement : public Sql_statement
{
public:
/**
@@ -218,10 +218,10 @@ public:
@param lex the LEX structure for this statement.
*/
Alter_table_truncate_partition_statement(LEX *lex)
- : Truncate_statement(lex)
+ : Sql_statement(lex)
{}
- ~Alter_table_truncate_partition_statement()
+ virtual ~Alter_table_truncate_partition_statement()
{}
/**
diff --git a/sql/sql_plist.h b/sql/sql_plist.h
index db85266be15..b71136cd9ab 100644
--- a/sql/sql_plist.h
+++ b/sql/sql_plist.h
@@ -95,6 +95,7 @@ public:
*last= a;
*B::prev_ptr(a)= last;
I::set_last(B::next_ptr(a));
+ C::inc();
}
inline void insert_after(T *pos, T *a)
{
@@ -112,6 +113,7 @@ public:
}
else
I::set_last(B::next_ptr(a));
+ C::inc();
}
}
inline void remove(T *a)
@@ -188,6 +190,20 @@ public:
/**
+ Hook class which via its methods specifies which members
+ of T should be used for participating in a intrusive list.
+*/
+
+template <typename T, T* T::*next, T** T::*prev>
+struct I_P_List_adapter
+{
+ static inline T **next_ptr(T *el) { return &(el->*next); }
+
+ static inline T ***prev_ptr(T *el) { return &(el->*prev); }
+};
+
+
+/**
Element counting policy class for I_P_List to be used in
cases when no element counting should be done.
*/
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 066a7512eaf..d36654c4c18 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "sql_priv.h" // SHOW_MY_BOOL
#include "unireg.h"
@@ -30,6 +30,7 @@
#include <my_pthread.h>
#include <my_getopt.h>
#include "sql_audit.h"
+#include <mysql/plugin_auth.h>
#include "lock.h" // MYSQL_LOCK_IGNORE_TIMEOUT
#include <mysql/plugin_auth.h>
#define REPORT_TO_LOG 1
@@ -42,9 +43,8 @@ extern struct st_maria_plugin *mysql_mandatory_plugins[];
@note The order of the enumeration is critical.
@see construct_options
*/
-static const char *global_plugin_typelib_names[]=
- { "OFF", "ON", "FORCE", NULL };
-enum enum_plugin_load_policy {PLUGIN_OFF, PLUGIN_ON, PLUGIN_FORCE};
+const char *global_plugin_typelib_names[]=
+ { "OFF", "ON", "FORCE", "FORCE_PLUS_PERMANENT", NULL };
static TYPELIB global_plugin_typelib=
{ array_elements(global_plugin_typelib_names)-1,
"", global_plugin_typelib_names, NULL };
@@ -301,6 +301,26 @@ static void report_error(int where_to, uint error, ...)
}
}
+/**
+ Check if the provided path is valid in the sense that it does cause
+ a relative reference outside the directory.
+
+ @note Currently, this function only check if there are any
+ characters in FN_DIRSEP in the string, but it might change in the
+ future.
+
+ @code
+ check_valid_path("../foo.so") -> true
+ check_valid_path("foo.so") -> false
+ @endcode
+ */
+bool check_valid_path(const char *path, size_t len)
+{
+ size_t prefix= my_strcspn(files_charset_info, path, path + len, FN_DIRSEP);
+ return prefix < len;
+}
+
+
/****************************************************************************
Value type thunks, allows the C world to play in the C++ world
****************************************************************************/
@@ -492,7 +512,8 @@ static my_bool read_mysql_plugin_info(struct st_plugin_dl *plugin_dl,
if (!cur)
{
free_plugin_mem(plugin_dl);
- report_error(report, ER_OUTOFMEMORY, plugin_dl->dl.length);
+ report_error(report, ER_OUTOFMEMORY,
+ static_cast<int>(plugin_dl.dl.length));
DBUG_RETURN(TRUE);
}
/*
@@ -617,7 +638,8 @@ static my_bool read_maria_plugin_info(struct st_plugin_dl *plugin_dl,
if (!cur)
{
free_plugin_mem(plugin_dl);
- report_error(report, ER_OUTOFMEMORY, plugin_dl->dl.length);
+ report_error(report, ER_OUTOFMEMORY,
+ static_cast<int>(plugin_dl.dl.length));
DBUG_RETURN(TRUE);
}
/*
@@ -648,13 +670,15 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
struct st_plugin_dl *tmp, plugin_dl;
void *sym;
DBUG_ENTER("plugin_dl_add");
+ DBUG_PRINT("enter", ("dl->str: '%s', dl->length: %d",
+ dl->str, (int) dl->length));
plugin_dir_len= strlen(opt_plugin_dir);
/*
Ensure that the dll doesn't have a path.
This is done to ensure that only approved libraries from the
plugin directory are used (to make this even remotely secure).
*/
- if (my_strchr(files_charset_info, dl->str, dl->str + dl->length, FN_LIBCHAR) ||
+ if (check_valid_path(dl->str, dl->length) ||
check_string_char_length((LEX_STRING *) dl, "", NAME_CHAR_LEN,
system_charset_info, 1) ||
plugin_dir_len + dl->length + 1 >= FN_REFLEN)
@@ -729,7 +753,8 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
if (! (plugin_dl.dl.str= (char*) my_malloc(plugin_dl.dl.length, MYF(0))))
{
free_plugin_mem(&plugin_dl);
- report_error(report, ER_OUTOFMEMORY, plugin_dl.dl.length);
+ report_error(report, ER_OUTOFMEMORY,
+ static_cast<int>(plugin_dl.dl.length));
DBUG_RETURN(0);
}
plugin_dl.dl.length= copy_and_convert(plugin_dl.dl.str, plugin_dl.dl.length,
@@ -740,7 +765,8 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
if (! (tmp= plugin_dl_insert_or_reuse(&plugin_dl)))
{
free_plugin_mem(&plugin_dl);
- report_error(report, ER_OUTOFMEMORY, sizeof(struct st_plugin_dl));
+ report_error(report, ER_OUTOFMEMORY,
+ static_cast<int>(sizeof(struct st_plugin_dl)));
DBUG_RETURN(0);
}
DBUG_RETURN(tmp);
@@ -1014,6 +1040,7 @@ static bool plugin_add(MEM_ROOT *tmp_root,
tmp.name.length= name_len;
tmp.ref_count= 0;
tmp.state= PLUGIN_IS_UNINITIALIZED;
+ tmp.load_option= PLUGIN_ON;
if (test_plugin_options(tmp_root, &tmp, argc, argv))
tmp.state= PLUGIN_IS_DISABLED;
@@ -1460,7 +1487,7 @@ int plugin_init(int *argc, char **argv, int flags)
tmp.name.str= (char *)plugin->name;
tmp.name.length= strlen(plugin->name);
tmp.state= 0;
- tmp.is_mandatory= mandatory;
+ tmp.load_option= mandatory ? PLUGIN_FORCE : PLUGIN_ON;
/*
If the performance schema is compiled in,
@@ -1479,7 +1506,7 @@ int plugin_init(int *argc, char **argv, int flags)
to work, by using '--skip-performance-schema' (the plugin)
*/
if (!my_strcasecmp(&my_charset_latin1, plugin->name, "PERFORMANCE_SCHEMA"))
- tmp.is_mandatory= true;
+ tmp.load_option= PLUGIN_FORCE;
free_root(&tmp_root, MYF(MY_MARK_BLOCKS_FREE));
if (test_plugin_options(&tmp_root, &tmp, argc, argv))
@@ -1557,7 +1584,8 @@ int plugin_init(int *argc, char **argv, int flags)
while ((plugin_ptr= *(--reap)))
{
mysql_mutex_unlock(&LOCK_plugin);
- if (plugin_ptr->is_mandatory)
+ if (plugin_ptr->load_option == PLUGIN_FORCE ||
+ plugin_ptr->load_option == PLUGIN_FORCE_PLUS_PERMANENT)
reaped_mandatory_plugin= TRUE;
plugin_deinitialize(plugin_ptr, true);
mysql_mutex_lock(&LOCK_plugin);
@@ -1961,7 +1989,11 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl
mysql_mutex_lock(&LOCK_plugin);
mysql_rwlock_wrlock(&LOCK_system_variables_hash);
- my_load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv, NULL);
+ if (my_load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv, NULL))
+ {
+ report_error(REPORT_TO_USER, ER_PLUGIN_IS_NOT_LOADED, name->str);
+ goto err;
+ }
error= plugin_add(thd->mem_root, name, dl, &argc, argv, REPORT_TO_USER);
if (argv)
free_defaults(argv);
@@ -2073,6 +2105,11 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "PLUGIN", name->str);
goto err;
}
+ if (plugin->load_option == PLUGIN_FORCE_PLUS_PERMANENT)
+ {
+ my_error(ER_PLUGIN_IS_PERMANENT, MYF(0), name->str);
+ goto err;
+ }
plugin->state= PLUGIN_IS_DELETED;
if (plugin->ref_count)
@@ -3283,7 +3320,8 @@ static int construct_options(MEM_ROOT *mem_root, struct st_plugin_int *tmp,
plugin_dash.length + 1);
strxmov(plugin_name_with_prefix_ptr, plugin_dash.str, plugin_name_ptr, NullS);
- if (!tmp->is_mandatory)
+ if (tmp->load_option != PLUGIN_FORCE &&
+ tmp->load_option != PLUGIN_FORCE_PLUS_PERMANENT)
{
/* support --skip-plugin-foo syntax */
options[0].name= plugin_name_ptr;
@@ -3543,7 +3581,8 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
{
struct sys_var_chain chain= { NULL, NULL };
bool disable_plugin;
- enum_plugin_load_policy plugin_load_policy= tmp->is_mandatory ? PLUGIN_FORCE : PLUGIN_ON;
+ enum_plugin_load_option plugin_load_option= tmp->load_option;
+
MEM_ROOT *mem_root= alloc_root_inited(&tmp->mem_root) ?
&tmp->mem_root : &plugin_mem_root;
st_mysql_sys_var **opt;
@@ -3557,13 +3596,11 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
DBUG_ENTER("test_plugin_options");
DBUG_ASSERT(tmp->plugin && tmp->name.str);
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
/*
The 'ndbcluster' storage engines is always disabled by default.
*/
if (!my_strcasecmp(&my_charset_latin1, tmp->name.str, "ndbcluster"))
- plugin_load_policy= PLUGIN_OFF;
-#endif
+ plugin_load_option= PLUGIN_OFF;
for (opt= tmp->plugin->system_vars; opt && *opt; opt++)
count+= 2; /* --{plugin}-{optname} and --plugin-{plugin}-{optname} */
@@ -3587,8 +3624,9 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
We adjust the default value to account for the hardcoded exceptions
we have set for the federated and ndbcluster storage engines.
*/
- if (!tmp->is_mandatory)
- opts[0].def_value= opts[1].def_value= plugin_load_policy;
+ if (tmp->load_option != PLUGIN_FORCE &&
+ tmp->load_option != PLUGIN_FORCE_PLUS_PERMANENT)
+ opts[0].def_value= opts[1].def_value= plugin_load_option;
error= handle_options(argc, &argv, opts, NULL);
(*argc)++; /* add back one for the program name */
@@ -3603,12 +3641,13 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
Set plugin loading policy from option value. First element in the option
list is always the <plugin name> option value.
*/
- if (!tmp->is_mandatory)
- plugin_load_policy= (enum_plugin_load_policy)*(ulong*)opts[0].value;
+ if (tmp->load_option != PLUGIN_FORCE &&
+ tmp->load_option != PLUGIN_FORCE_PLUS_PERMANENT)
+ plugin_load_option= (enum_plugin_load_option) *(ulong*) opts[0].value;
}
- disable_plugin= (plugin_load_policy == PLUGIN_OFF);
- tmp->is_mandatory= (plugin_load_policy == PLUGIN_FORCE);
+ disable_plugin= (plugin_load_option == PLUGIN_OFF);
+ tmp->load_option= plugin_load_option;
/*
If the plugin is disabled it should not be initialized.
diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h
index 478bc787d40..ee1d43e8a2f 100644
--- a/sql/sql_plugin.h
+++ b/sql/sql_plugin.h
@@ -16,6 +16,8 @@
#ifndef _sql_plugin_h
#define _sql_plugin_h
+#include <my_global.h>
+
/*
the following #define adds server-only members to enum_mysql_show_type,
that is defined in plugin.h
@@ -32,6 +34,9 @@
class sys_var;
enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED};
+enum enum_plugin_load_option { PLUGIN_OFF, PLUGIN_ON, PLUGIN_FORCE,
+ PLUGIN_FORCE_PLUS_PERMANENT };
+extern const char *global_plugin_typelib_names[];
#include <my_sys.h>
@@ -96,7 +101,7 @@ struct st_plugin_int
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 */
- bool is_mandatory; /* If true then plugin must not fail to load */
+ enum enum_plugin_load_option load_option; /* OFF, ON, FORCE, F+PERMANENT */
};
@@ -113,6 +118,7 @@ typedef struct st_plugin_int *plugin_ref;
#define plugin_data(pi,cast) ((cast)((pi)->data))
#define plugin_name(pi) (&((pi)->name))
#define plugin_state(pi) ((pi)->state)
+#define plugin_load_option(pi) ((pi)->load_option)
#define plugin_equals(p1,p2) ((p1) == (p2))
#else
typedef struct st_plugin_int **plugin_ref;
@@ -123,6 +129,7 @@ typedef struct st_plugin_int **plugin_ref;
#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_load_option(pi) ((pi)[0]->load_option)
#define plugin_equals(p1,p2) ((p1) && (p2) && (p1)[0] == (p2)[0])
#endif
@@ -156,6 +163,7 @@ extern bool plugin_register_builtin(struct st_mysql_plugin *plugin);
extern void plugin_thdvar_init(THD *thd);
extern void plugin_thdvar_cleanup(THD *thd);
extern SHOW_COMP_OPTION plugin_status(const char *name, int len, size_t type);
+extern bool check_valid_path(const char *path, size_t length);
typedef my_bool (plugin_foreach_func)(THD *thd,
plugin_ref plugin,
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index c57c9dacceb..da1334ed0bf 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2002 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
@@ -1185,7 +1185,7 @@ static bool insert_params_from_vars_with_log(Prepared_statement *stmt,
uint32 length= 0;
THD *thd= stmt->thd;
- DBUG_ENTER("insert_params_from_vars");
+ DBUG_ENTER("insert_params_from_vars_with_log");
if (query->copy(stmt->query(), stmt->query_length(), default_charset_info))
DBUG_RETURN(1);
@@ -1469,7 +1469,7 @@ static int mysql_test_select(Prepared_statement *stmt,
if (!lex->result && !(lex->result= new (stmt->mem_root) select_send))
{
- my_error(ER_OUTOFMEMORY, MYF(0), sizeof(select_send));
+ my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(sizeof(select_send)));
goto error;
}
@@ -1783,7 +1783,7 @@ static bool mysql_test_create_view(Prepared_statement *stmt)
if (open_normal_and_derived_tables(thd, tables, MYSQL_OPEN_FORCE_SHARED_MDL))
goto err;
- lex->view_prepare_mode= 1;
+ lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VIEW;
res= select_like_stmt_test(stmt, 0, 0);
err:
@@ -2295,19 +2295,6 @@ end:
}
-/** Init PS/SP specific parse tree members. */
-
-static void init_stmt_after_parse(LEX *lex)
-{
- SELECT_LEX *sl= lex->all_selects_list;
- /*
- Switch off a temporary flag that prevents evaluation of
- subqueries in statement prepare.
- */
- for (; sl; sl= sl->next_select_in_list())
- sl->uncacheable&= ~UNCACHEABLE_PREPARE;
-}
-
/**
SQLCOM_PREPARE implementation.
@@ -2559,7 +2546,7 @@ void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
if (!(stmt= find_prepared_statement(thd, stmt_id)))
{
char llbuf[22];
- my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf),
+ my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), static_cast<int>(sizeof(llbuf)),
llstr(stmt_id, llbuf), "mysqld_stmt_execute");
DBUG_VOID_RETURN;
}
@@ -2613,7 +2600,7 @@ void mysql_sql_stmt_execute(THD *thd)
if (!(stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name)))
{
my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0),
- name->length, name->str, "EXECUTE");
+ static_cast<int>(name->length), name->str, "EXECUTE");
DBUG_VOID_RETURN;
}
@@ -2656,7 +2643,7 @@ void mysqld_stmt_fetch(THD *thd, char *packet, uint packet_length)
if (!(stmt= find_prepared_statement(thd, stmt_id)))
{
char llbuf[22];
- my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf),
+ my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), static_cast<int>(sizeof(llbuf)),
llstr(stmt_id, llbuf), "mysqld_stmt_fetch");
DBUG_VOID_RETURN;
}
@@ -2716,7 +2703,7 @@ void mysqld_stmt_reset(THD *thd, char *packet)
if (!(stmt= find_prepared_statement(thd, stmt_id)))
{
char llbuf[22];
- my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), sizeof(llbuf),
+ my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), static_cast<int>(sizeof(llbuf)),
llstr(stmt_id, llbuf), "mysqld_stmt_reset");
DBUG_VOID_RETURN;
}
@@ -2729,7 +2716,7 @@ void mysqld_stmt_reset(THD *thd, char *packet)
*/
reset_stmt_params(stmt);
- stmt->state= Query_arena::PREPARED;
+ stmt->state= Query_arena::STMT_PREPARED;
general_log_print(thd, thd->command, NullS);
@@ -2791,7 +2778,7 @@ void mysql_sql_stmt_close(THD *thd)
if (! (stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name)))
my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0),
- name->length, name->str, "DEALLOCATE PREPARE");
+ static_cast<int>(name->length), name->str, "DEALLOCATE PREPARE");
else if (stmt->is_in_use())
my_error(ER_PS_NO_RECURSION, MYF(0));
else
@@ -2801,6 +2788,7 @@ void mysql_sql_stmt_close(THD *thd)
}
}
+
/**
Handle long data in pieces from client.
@@ -2847,7 +2835,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
if (param_number >= stmt->param_count)
{
/* Error will be sent in execute call */
- stmt->state= Query_arena::ERROR;
+ stmt->state= Query_arena::STMT_ERROR;
stmt->last_errno= ER_WRONG_ARGUMENTS;
sprintf(stmt->last_error, ER(ER_WRONG_ARGUMENTS),
"mysqld_stmt_send_long_data");
@@ -2857,16 +2845,26 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
param= stmt->param_array[param_number];
+ Diagnostics_area new_stmt_da, *save_stmt_da= thd->stmt_da;
+ Warning_info new_warnning_info(thd->query_id, false);
+ Warning_info *save_warinig_info= thd->warning_info;
+
+ thd->stmt_da= &new_stmt_da;
+ thd->warning_info= &new_warnning_info;
+
#ifndef EMBEDDED_LIBRARY
- if (param->set_longdata(packet, (ulong) (packet_end - packet)))
+ param->set_longdata(packet, (ulong) (packet_end - packet));
#else
- if (param->set_longdata(thd->extra_data, thd->extra_length))
+ param->set_longdata(thd->extra_data, thd->extra_length);
#endif
+ if (thd->stmt_da->is_error())
{
- stmt->state= Query_arena::ERROR;
- stmt->last_errno= ER_OUTOFMEMORY;
- sprintf(stmt->last_error, ER(ER_OUTOFMEMORY), 0);
+ stmt->state= Query_arena::STMT_ERROR;
+ stmt->last_errno= thd->stmt_da->sql_errno();
+ strncpy(stmt->last_error, thd->stmt_da->message(), MYSQL_ERRMSG_SIZE);
}
+ thd->stmt_da= save_stmt_da;
+ thd->warning_info= save_warinig_info;
general_log_print(thd, thd->command, NullS);
@@ -2902,8 +2900,15 @@ bool Select_fetch_protocol_binary::send_result_set_metadata(List<Item> &list, ui
bool Select_fetch_protocol_binary::send_eof()
{
+ /*
+ Don't send EOF if we're in error condition (which implies we've already
+ sent or are sending an error)
+ */
+ if (thd->is_error())
+ return true;
+
::my_eof(thd);
- return FALSE;
+ return false;
}
@@ -3009,7 +3014,7 @@ end:
Prepared_statement::Prepared_statement(THD *thd_arg)
:Statement(NULL, &main_mem_root,
- INITIALIZED, ++thd_arg->statement_id_counter),
+ STMT_INITIALIZED, ++thd_arg->statement_id_counter),
thd(thd_arg),
result(thd_arg),
param_array(0),
@@ -3176,7 +3181,6 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
bool error;
Statement stmt_backup;
Query_arena *old_stmt_arena;
- MDL_ticket *mdl_savepoint= NULL;
DBUG_ENTER("Prepared_statement::prepare");
/*
If this is an SQLCOM_PREPARE, we also increase Com_prepare_sql.
@@ -3221,6 +3225,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
parser_state.m_lip.multi_statements= FALSE;
lex_start(thd);
+ lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_PREPARE;
error= parse_sql(thd, & parser_state, NULL) ||
thd->is_error() ||
@@ -3248,7 +3253,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
Marker used to release metadata locks acquired while the prepared
statement is being checked.
*/
- mdl_savepoint= thd->mdl_context.mdl_savepoint();
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
/*
The only case where we should have items in the thd->free_list is
@@ -3281,8 +3286,8 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
if (error == 0)
{
setup_set_params();
- init_stmt_after_parse(lex);
- state= Query_arena::PREPARED;
+ lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_PREPARE;
+ state= Query_arena::STMT_PREPARED;
flags&= ~ (uint) IS_IN_USE;
/*
@@ -3399,6 +3404,13 @@ Prepared_statement::execute_loop(String *expanded_query,
bool error;
int reprepare_attempt= 0;
+ /* Check if we got an error when sending long data */
+ if (state == Query_arena::STMT_ERROR)
+ {
+ my_message(last_errno, last_error, MYF(0));
+ return TRUE;
+ }
+
if (set_parameters(expanded_query, packet, packet_end))
return TRUE;
@@ -3456,7 +3468,7 @@ Prepared_statement::execute_server_runnable(Server_runnable *server_runnable)
Item_change_list save_change_list;
thd->change_list.move_elements_to(&save_change_list);
- state= CONVENTIONAL_EXECUTION;
+ state= STMT_CONVENTIONAL_EXECUTION;
if (!(lex= new (mem_root) st_lex_local))
return TRUE;
@@ -3666,12 +3678,6 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
status_var_increment(thd->status_var.com_stmt_execute);
- /* Check if we got an error when sending long data */
- if (state == Query_arena::ERROR)
- {
- my_message(last_errno, last_error, MYF(0));
- return TRUE;
- }
if (flags & (uint) IS_IN_USE)
{
my_error(ER_PS_NO_RECURSION, MYF(0));
@@ -3739,7 +3745,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
to point at it even after we restore from backup. This is ok, as
expanded query was allocated in thd->mem_root.
*/
- stmt_backup.set_query_inner(thd->query(), thd->query_length());
+ stmt_backup.set_query_inner(thd->query_string);
/*
At first execution of prepared statement we may perform logical
@@ -3769,7 +3775,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
MYSQL_QUERY_EXEC_START(thd->query(),
thd->thread_id,
(char *) (thd->db ? thd->db : ""),
- thd->security_ctx->priv_user,
+ &thd->security_ctx->priv_user[0],
(char *) thd->security_ctx->host_or_ip,
1);
error= mysql_execute_command(thd);
@@ -3797,8 +3803,8 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
thd->set_statement(&stmt_backup);
thd->stmt_arena= old_stmt_arena;
- if (state == Query_arena::PREPARED)
- state= Query_arena::EXECUTED;
+ if (state == Query_arena::STMT_PREPARED)
+ state= Query_arena::STMT_EXECUTED;
if (error == 0 && this->lex->sql_command == SQLCOM_CALL)
{
@@ -3899,7 +3905,7 @@ Ed_result_set::Ed_result_set(List<Ed_row> *rows_arg,
*/
Ed_connection::Ed_connection(THD *thd)
- :m_warning_info(thd->query_id),
+ :m_warning_info(thd->query_id, false),
m_thd(thd),
m_rsets(0),
m_current_rset(0)
diff --git a/sql/sql_priv.h b/sql/sql_priv.h
index d36f62ebc5c..a85dea8b273 100644
--- a/sql/sql_priv.h
+++ b/sql/sql_priv.h
@@ -144,6 +144,12 @@
*/
#define OPTION_MASTER_SQL_ERROR (1ULL << 35)
+/*
+ Dont report errors for individual rows,
+ But just report error on commit (or read ofcourse)
+ Note! Reserved for use in MySQL Cluster
+*/
+#define OPTION_ALLOW_BATCH (ULL(1) << 36) // THD, intern (slave)
/* The rest of the file is included in the server only */
#ifndef MYSQL_CLIENT
@@ -198,17 +204,42 @@
*/
+/*
+ Flags below are set when we perform
+ context analysis of the statement and make
+ subqueries non-const. It prevents subquery
+ evaluation at context analysis stage.
+*/
+
+/*
+ Don't evaluate this subquery during statement prepare even if
+ it's a constant one. The flag is switched off in the end of
+ mysqld_stmt_prepare.
+*/
+#define CONTEXT_ANALYSIS_ONLY_PREPARE 1
+/*
+ Special JOIN::prepare mode: changing of query is prohibited.
+ When creating a view, we need to just check its syntax omitting
+ any optimizations: afterwards definition of the view will be
+ reconstructed by means of ::print() methods and written to
+ to an .frm file. We need this definition to stay untouched.
+*/
+#define CONTEXT_ANALYSIS_ONLY_VIEW 2
+/*
+ Don't evaluate this subquery during derived table prepare even if
+ it's a constant one.
+*/
+#define CONTEXT_ANALYSIS_ONLY_DERIVED 4
+
// uncachable cause
#define UNCACHEABLE_DEPENDENT 1
#define UNCACHEABLE_RAND 2
#define UNCACHEABLE_SIDEEFFECT 4
/// forcing to save JOIN for explain
#define UNCACHEABLE_EXPLAIN 8
-/** Don't evaluate subqueries in prepare even if they're not correlated */
-#define UNCACHEABLE_PREPARE 16
/* For uncorrelated SELECT in an UNION with some correlated SELECTs */
-#define UNCACHEABLE_UNITED 32
-#define UNCACHEABLE_CHECKOPTION 64
+#define UNCACHEABLE_UNITED 16
+#define UNCACHEABLE_CHECKOPTION 32
/* Used to check GROUP BY list in the MODE_ONLY_FULL_GROUP_BY mode */
#define UNDEF_POS (-1)
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc
index ea4f53187f9..64d484c0390 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -33,7 +33,11 @@
@param thd Thread handler (can be NULL!)
@param options What should be reset/reloaded (tables, privileges, slave...)
@param tables Tables to flush (if any)
- @param write_to_binlog True if we can write to the binlog.
+ @param write_to_binlog < 0 if there was an error while interacting with the binary log inside
+ reload_acl_and_cache,
+ 0 if we should not write to the binary log,
+ > 0 if we can write to the binlog.
+
@note Depending on 'options', it may be very bad to write the
query to the binlog (e.g. FLUSH SLAVE); this is a
@@ -47,11 +51,11 @@
*/
bool reload_acl_and_cache(THD *thd, unsigned long options,
- TABLE_LIST *tables, bool *write_to_binlog)
+ TABLE_LIST *tables, int *write_to_binlog)
{
bool result=0;
select_errors=0; /* Write if more errors */
- bool tmp_write_to_binlog= 1;
+ int tmp_write_to_binlog= *write_to_binlog= 1;
DBUG_ASSERT(!thd || !thd->in_sub_stmt);
@@ -82,7 +86,7 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
When an error is returned, my_message may have not been called and
the client will hang waiting for a response.
*/
- my_error(ER_UNKNOWN_ERROR, MYF(0), "FLUSH PRIVILEGES failed");
+ my_error(ER_UNKNOWN_ERROR, MYF(0));
}
}
@@ -136,13 +140,17 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
*/
tmp_write_to_binlog= 0;
if (mysql_bin_log.is_open())
- mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE);
+ {
+ if (mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE))
+ *write_to_binlog= -1;
+ }
}
if (options & REFRESH_RELAY_LOG)
{
#ifdef HAVE_REPLICATION
mysql_mutex_lock(&LOCK_active_mi);
- rotate_relay_log(active_mi);
+ if (rotate_relay_log(active_mi))
+ *write_to_binlog= -1;
mysql_mutex_unlock(&LOCK_active_mi);
#endif
}
@@ -212,12 +220,26 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
if (tables)
{
for (TABLE_LIST *t= tables; t; t= t->next_local)
- if (!find_table_for_mdl_upgrade(thd->open_tables, t->db,
- t->table_name, FALSE))
+ if (!find_table_for_mdl_upgrade(thd, t->db, t->table_name, false))
return 1;
}
else
{
+ /*
+ It is not safe to upgrade the metadata lock without GLOBAL IX lock.
+ This can happen with FLUSH TABLES <list> WITH READ LOCK as we in these
+ cases don't take a GLOBAL IX lock in order to be compatible with
+ global read lock.
+ */
+ if (thd->open_tables &&
+ !thd->mdl_context.is_lock_owner(MDL_key::GLOBAL, "", "",
+ MDL_INTENTION_EXCLUSIVE))
+ {
+ my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0),
+ thd->open_tables->s->table_name.str);
+ return true;
+ }
+
for (TABLE *tab= thd->open_tables; tab; tab= tab->next)
{
if (! tab->mdl_ticket->is_upgradable_or_exclusive())
@@ -303,7 +325,8 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
}
mysql_mutex_unlock(&LOCK_global_user_client_stats);
}
- *write_to_binlog= tmp_write_to_binlog;
+ if (*write_to_binlog != -1)
+ *write_to_binlog= tmp_write_to_binlog;
/*
If the query was killed then this function must fail.
*/
@@ -357,7 +380,6 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
-------------------------------------
- you can't flush WITH READ LOCK a non-existent table
- you can't flush WITH READ LOCK under LOCK TABLES
- - currently incompatible with the GRL (@todo: fix)
Effect on views and temporary tables.
------------------------------------
@@ -367,6 +389,13 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
if there is a base table, it's used, otherwise ER_NO_SUCH_TABLE
is returned.
+ Handling of MERGE tables
+ ------------------------
+ For MERGE table this statement will open and lock child tables
+ for read (it is impossible to lock parent table without it).
+ Child tables won't be flushed unless they are explicitly present
+ in the statement's table list.
+
Implicit commit
---------------
This statement causes an implicit commit before and
@@ -383,7 +412,6 @@ bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)
{
Lock_tables_prelocking_strategy lock_tables_prelocking_strategy;
TABLE_LIST *table_list;
- MDL_request_list mdl_requests;
/*
This is called from SQLCOM_FLUSH, the transaction has
@@ -397,17 +425,13 @@ bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)
}
/*
- Acquire SNW locks on tables to be flushed. We can't use
- lock_table_names() here as this call will also acquire global IX
- and database-scope IX locks on the tables, and this will make
+ Acquire SNW locks on tables to be flushed. Don't acquire global
+ IX and database-scope IX locks on the tables as this will make
this statement incompatible with FLUSH TABLES WITH READ LOCK.
*/
- for (table_list= all_tables; table_list;
- table_list= table_list->next_global)
- mdl_requests.push_front(&table_list->mdl_request);
-
- if (thd->mdl_context.acquire_locks(&mdl_requests,
- thd->variables.lock_wait_timeout))
+ if (lock_table_names(thd, all_tables, NULL,
+ thd->variables.lock_wait_timeout,
+ MYSQL_OPEN_SKIP_SCOPED_MDL_LOCK))
goto error;
DEBUG_SYNC(thd,"flush_tables_with_read_lock_after_acquire_locks");
@@ -419,21 +443,24 @@ bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)
tdc_remove_table(thd, TDC_RT_REMOVE_UNUSED,
table_list->db,
table_list->table_name, FALSE);
-
- /* Skip views and temporary tables. */
- table_list->required_type= FRMTYPE_TABLE; /* Don't try to flush views. */
- table_list->open_type= OT_BASE_ONLY; /* Ignore temporary tables. */
+ /* Reset ticket to satisfy asserts in open_tables(). */
+ table_list->mdl_request.ticket= NULL;
}
/*
Before opening and locking tables the below call also waits
for old shares to go away, so the fact that we don't pass
MYSQL_LOCK_IGNORE_FLUSH flag to it is important.
+ Also we don't pass MYSQL_OPEN_HAS_MDL_LOCK flag as we want
+ to open underlying tables if merge table is flushed.
+ For underlying tables of the merge the below call has to
+ acquire SNW locks to ensure that they can be locked for
+ read without further waiting.
*/
- if (open_and_lock_tables(thd, all_tables, FALSE,
- MYSQL_OPEN_HAS_MDL_LOCK,
- &lock_tables_prelocking_strategy) ||
- thd->locked_tables_list.init_locked_tables(thd))
+ if (open_and_lock_tables(thd, all_tables, FALSE,
+ MYSQL_OPEN_SKIP_SCOPED_MDL_LOCK,
+ &lock_tables_prelocking_strategy) ||
+ thd->locked_tables_list.init_locked_tables(thd))
{
goto error;
}
diff --git a/sql/sql_reload.h b/sql/sql_reload.h
index 0df5485c907..ebb3d78c003 100644
--- a/sql/sql_reload.h
+++ b/sql/sql_reload.h
@@ -19,7 +19,7 @@ class THD;
struct TABLE_LIST;
bool reload_acl_and_cache(THD *thd, unsigned long options,
- TABLE_LIST *tables, bool *write_to_binlog);
+ TABLE_LIST *tables, int *write_to_binlog);
bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables);
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 97f8e46d052..6a7b0b0b3ad 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -24,8 +24,7 @@
#include "sql_table.h" // build_table_filename
#include "sql_view.h" // mysql_frm_type, mysql_rename_view
#include "sql_trigger.h"
-#include "lock.h" // wait_if_global_read_lock
- // start_waiting_global_read_lock
+#include "lock.h" // MYSQL_OPEN_SKIP_TEMPORARY
#include "sql_base.h" // tdc_remove_table, lock_table_names,
#include "sql_handler.h" // mysql_ha_rm_tables
#include "datadict.h"
@@ -63,9 +62,6 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
mysql_ha_rm_tables(thd, table_list);
- if (thd->global_read_lock.wait_if_global_read_lock(thd, FALSE, TRUE))
- DBUG_RETURN(1);
-
if (logger.is_log_table_enabled(QUERY_LOG_GENERAL) ||
logger.is_log_table_enabled(QUERY_LOG_SLOW))
{
@@ -108,7 +104,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
*/
my_error(ER_CANT_RENAME_LOG_TABLE, MYF(0), ren_table->table_name,
ren_table->table_name);
- DBUG_RETURN(1);
+ goto err;
}
}
else
@@ -121,7 +117,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
*/
my_error(ER_CANT_RENAME_LOG_TABLE, MYF(0), ren_table->table_name,
ren_table->table_name);
- DBUG_RETURN(1);
+ goto err;
}
else
{
@@ -139,7 +135,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
else
my_error(ER_CANT_RENAME_LOG_TABLE, MYF(0), rename_log_table[1],
rename_log_table[1]);
- DBUG_RETURN(1);
+ goto err;
}
}
@@ -189,7 +185,6 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent)
query_cache_invalidate3(thd, table_list, 0);
err:
- thd->global_read_lock.start_waiting_global_read_lock(thd);
DBUG_RETURN(error || binlog_error);
}
@@ -285,6 +280,7 @@ do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db, char *new_table_name,
{
if ((rc= Table_triggers_list::change_table_name(thd, ren_table->db,
old_alias,
+ ren_table->table_name,
new_db,
new_alias)))
{
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index ee9f1b5066f..7bea6e41184 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB & Sasha, 2008-2009 Sun Microsystems, Inc
+/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -25,6 +25,7 @@
#include "rpl_filter.h"
#include <my_dir.h>
#include "rpl_handler.h"
+#include "debug_sync.h"
int max_binlog_dump_events = 0; // unlimited
my_bool opt_sporadic_binlog_dump_fail = 0;
@@ -675,8 +676,11 @@ impossible position";
file */
if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
goto err;
+
+ my_off_t prev_pos= pos;
while (!(error = Log_event::read_log_event(&log, packet, log_lock)))
{
+ prev_pos= my_b_tell(&log);
#ifndef DBUG_OFF
if (max_binlog_dump_events && !left_events--)
{
@@ -693,6 +697,19 @@ impossible position";
coord->pos= uint4korr(packet->ptr() + ev_offset + LOG_POS_OFFSET);
event_type= (Log_event_type)((*packet)[LOG_EVENT_OFFSET+ev_offset]);
+ DBUG_EXECUTE_IF("dump_thread_wait_before_send_xid",
+ {
+ if (event_type == XID_EVENT)
+ {
+ net_flush(net);
+ const char act[]=
+ "now "
+ "wait_for signal.continue";
+ DBUG_ASSERT(opt_debug_sync_timeout > 0);
+ DBUG_ASSERT(!debug_sync_set_action(current_thd,
+ STRING_WITH_LEN(act)));
+ }
+ });
if (event_type == FORMAT_DESCRIPTION_EVENT)
{
binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+ev_offset] &
@@ -718,6 +735,14 @@ impossible position";
goto err;
}
+ DBUG_EXECUTE_IF("dump_thread_wait_before_send_xid",
+ {
+ if (event_type == XID_EVENT)
+ {
+ net_flush(net);
+ }
+ });
+
DBUG_PRINT("info", ("log event code %d", event_type));
if (event_type == LOAD_EVENT)
{
@@ -745,8 +770,13 @@ impossible position";
here we were reading binlog that was not closed properly (as a result
of a crash ?). treat any corruption as EOF
*/
- if (binlog_can_be_corrupted && error != LOG_READ_MEM)
+ if (binlog_can_be_corrupted &&
+ error != LOG_READ_MEM && error != LOG_READ_EOF)
+ {
+ my_b_seek(&log, prev_pos);
error=LOG_READ_EOF;
+ }
+
/*
TODO: now that we are logging the offset, check to make sure
the recorded offset and the actual match.
@@ -1460,7 +1490,7 @@ bool change_master(THD* thd, Master_info* mi)
get_dynamic(&lex_mi->repl_ignore_server_ids, (uchar*) &s_id, i);
if (s_id == ::server_id && replicate_same_server_id)
{
- my_error(ER_SLAVE_IGNORE_SERVER_IDS, MYF(0), s_id);
+ my_error(ER_SLAVE_IGNORE_SERVER_IDS, MYF(0), static_cast<int>(s_id));
ret= TRUE;
goto err;
}
@@ -1664,23 +1694,6 @@ int reset_master(THD* thd)
return 0;
}
-int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
- const char* log_file_name2, ulonglong log_pos2)
-{
- int res;
- size_t log_file_name1_len= strlen(log_file_name1);
- size_t log_file_name2_len= strlen(log_file_name2);
-
- // We assume that both log names match up to '.'
- if (log_file_name1_len == log_file_name2_len)
- {
- if ((res= strcmp(log_file_name1, log_file_name2)))
- return res;
- return (log_pos1 < log_pos2) ? -1 : (log_pos1 == log_pos2) ? 0 : 1;
- }
- return ((log_file_name1_len < log_file_name2_len) ? -1 : 1);
-}
-
/**
Execute a SHOW BINLOG EVENTS statement.
@@ -1925,7 +1938,7 @@ bool show_binlogs(THD* thd)
if (!mysql_bin_log.is_open())
{
- my_message(ER_NO_BINARY_LOGGING, ER(ER_NO_BINARY_LOGGING), MYF(0));
+ my_error(ER_NO_BINARY_LOGGING, MYF(0));
DBUG_RETURN(TRUE);
}
diff --git a/sql/sql_repl.h b/sql/sql_repl.h
index 4d3b0b8d62c..dfe41d8e688 100644
--- a/sql/sql_repl.h
+++ b/sql/sql_repl.h
@@ -43,8 +43,6 @@ 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_master(THD* thd);
bool purge_master_logs(THD* thd, const char* to_log);
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 171e9a7f7a5..34c61dc2c2b 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
- Copyright (c) 2009-2010 Monty Program Ab
+/* Copyright (c) 2000, 2011 Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009-2011 Monty Program 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
@@ -51,6 +51,7 @@
#include "opt_subselect.h"
#include "log_slow.h"
+#include "debug_sync.h" // DEBUG_SYNC
#include <m_ctype.h>
#include <my_bit.h>
#include <hash.h>
@@ -309,57 +310,60 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
}
-/*
+/**
Fix fields referenced from inner selects.
- SYNOPSIS
- fix_inner_refs()
- thd Thread handle
- all_fields List of all fields used in select
- select Current select
- ref_pointer_array Array of references to Items used in current select
- group_list GROUP BY list (is NULL by default)
+ @param thd Thread handle
+ @param all_fields List of all fields used in select
+ @param select Current select
+ @param ref_pointer_array Array of references to Items used in current select
+ @param group_list GROUP BY list (is NULL by default)
- DESCRIPTION
- The function serves 3 purposes - adds fields referenced from inner
- selects to the current select list, resolves which class to use
- to access referenced item (Item_ref of Item_direct_ref) and fixes
- references (Item_ref objects) to these fields.
+ @details
+ The function serves 3 purposes
+
+ - adds fields referenced from inner query blocks to the current select list
- If a field isn't already in the select list and the ref_pointer_array
+ - Decides which class to use to reference the items (Item_ref or
+ Item_direct_ref)
+
+ - fixes references (Item_ref objects) to these fields.
+
+ If a field isn't already on the select list and the ref_pointer_array
is provided then it is added to the all_fields list and the pointer to
it is saved in the ref_pointer_array.
The class to access the outer field is determined by the following rules:
- 1. If the outer field isn't used under an aggregate function
- then the Item_ref class should be used.
- 2. If the outer field is used under an aggregate function and this
- function is aggregated in the select where the outer field was
- resolved or in some more inner select then the Item_direct_ref
- class should be used.
- It used used also if we are grouping by a subquery that refers
- this outer field.
+
+ -#. If the outer field isn't used under an aggregate function then the
+ Item_ref class should be used.
+
+ -#. If the outer field is used under an aggregate function and this
+ function is, in turn, aggregated in the query block where the outer
+ field was resolved or some query nested therein, then the
+ Item_direct_ref class should be used. Also it should be used if we are
+ grouping by a subquery that references this outer field.
+
The resolution is done here and not at the fix_fields() stage as
- it can be done only after sum functions are fixed and pulled up to
- selects where they are have to be aggregated.
+ it can be done only after aggregate functions are fixed and pulled up to
+ selects where they are to be aggregated.
+
When the class is chosen it substitutes the original field in the
Item_outer_ref object.
After this we proceed with fixing references (Item_outer_ref objects) to
this field from inner subqueries.
- RETURN
- TRUE an error occured
- FALSE ok
-*/
+ @return Status
+ @retval true An error occured.
+ @retval false OK.
+ */
bool
fix_inner_refs(THD *thd, List<Item> &all_fields, SELECT_LEX *select,
Item **ref_pointer_array)
{
Item_outer_ref *ref;
- bool res= FALSE;
- bool direct_ref= FALSE;
/*
Mark the references from the inner_refs_list that are occurred in
@@ -376,6 +380,7 @@ fix_inner_refs(THD *thd, List<Item> &all_fields, SELECT_LEX *select,
while ((ref= ref_it++))
{
+ bool direct_ref= false;
Item *item= ref->outer_ref;
Item **item_ref= ref->ref;
Item_ref *new_ref;
@@ -434,7 +439,7 @@ fix_inner_refs(THD *thd, List<Item> &all_fields, SELECT_LEX *select,
return TRUE;
thd->used_tables|= item->used_tables();
}
- return res;
+ return false;
}
/**
@@ -765,6 +770,7 @@ JOIN::optimize()
if (optimized)
DBUG_RETURN(0);
optimized= 1;
+ DEBUG_SYNC(thd, "before_join_optimize");
thd_proc_info(thd, "optimizing");
@@ -903,7 +909,7 @@ JOIN::optimize()
If all items were resolved by opt_sum_query, there is no need to
open any tables.
*/
- if ((res=opt_sum_query(select_lex->leaf_tables, all_fields, conds)))
+ if ((res=opt_sum_query(thd, select_lex->leaf_tables, all_fields, conds)))
{
if (res == HA_ERR_KEY_NOT_FOUND)
{
@@ -1727,6 +1733,10 @@ JOIN::reinit()
while ((item= it++))
item->restore_to_before_no_rows_in_result();
}
+
+ if (!(select_options & SELECT_DESCRIBE))
+ init_ftfuncs(thd, select_lex, test(order));
+
DBUG_RETURN(0);
}
@@ -1938,7 +1948,11 @@ JOIN::exec()
JOIN_TAB *first_tab= curr_join->join_tab + curr_join->const_tables;
first_tab->sorted= test(first_tab->loosescan_match_tab);
}
- if ((tmp_error= do_select(curr_join, (List<Item> *) 0, curr_tmp_table, 0)))
+
+ Procedure *save_proc= curr_join->procedure;
+ tmp_error= do_select(curr_join, (List<Item> *) 0, curr_tmp_table, 0);
+ curr_join->procedure= save_proc;
+ if (tmp_error)
{
error= tmp_error;
DBUG_VOID_RETURN;
@@ -2504,6 +2518,13 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
{
DBUG_RETURN(TRUE);
}
+ /*
+ Original join tabs might be overwritten at first
+ subselect execution. So we need to restore them.
+ */
+ Item_subselect *subselect= select_lex->master_unit()->item;
+ if (subselect && subselect->is_uncacheable() && join->reinit())
+ DBUG_RETURN(TRUE);
}
else
{
@@ -3499,26 +3520,7 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond,
eq_func is NEVER true when num_values > 1
*/
if (!eq_func)
- {
- /*
- Additional optimization: if we're processing
- "t.key BETWEEN c1 AND c1" then proceed as if we were processing
- "t.key = c1".
- TODO: This is a very limited fix. A more generic fix is possible.
- There are 2 options:
- A) Make equality propagation code be able to handle BETWEEN
- (including cases like t1.key BETWEEN t2.key AND t3.key)
- B) Make range optimizer to infer additional "t.key = c" equalities
- and use them in equality propagation process (see details in
- OptimizerKBAndTodo)
- */
- if ((cond->functype() != Item_func::BETWEEN) ||
- ((Item_func_between*) cond)->negated ||
- !value[0]->eq(value[1], field->binary()))
- return;
- eq_func= TRUE;
- }
-
+ return;
if (field->result_type() == STRING_RESULT)
{
if ((*value)->result_type() != STRING_RESULT)
@@ -3741,9 +3743,65 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
case Item_func::OPTIMIZE_KEY:
{
Item **values;
- // BETWEEN, IN, NE
- if (is_local_field (cond_func->key_item()) &&
- !(cond_func->used_tables() & OUTER_REF_TABLE_BIT))
+ /*
+ Build list of possible keys for 'a BETWEEN low AND high'.
+ It is handled similar to the equivalent condition
+ 'a >= low AND a <= high':
+ */
+ if (cond_func->functype() == Item_func::BETWEEN)
+ {
+ Item_field *field_item;
+ bool equal_func= FALSE;
+ uint num_values= 2;
+ values= cond_func->arguments();
+
+ bool binary_cmp= (values[0]->real_item()->type() == Item::FIELD_ITEM)
+ ? ((Item_field*)values[0]->real_item())->field->binary()
+ : TRUE;
+
+ /*
+ Additional optimization: If 'low = high':
+ Handle as if the condition was "t.key = low".
+ */
+ if (!((Item_func_between*)cond_func)->negated &&
+ values[1]->eq(values[2], binary_cmp))
+ {
+ equal_func= TRUE;
+ num_values= 1;
+ }
+
+ /*
+ Append keys for 'field <cmp> value[]' if the
+ condition is of the form::
+ '<field> BETWEEN value[1] AND value[2]'
+ */
+ if (is_local_field (values[0]))
+ {
+ field_item= (Item_field *) (values[0]->real_item());
+ add_key_equal_fields(key_fields, *and_level, cond_func,
+ field_item, equal_func, &values[1],
+ num_values, usable_tables, sargables);
+ }
+ /*
+ Append keys for 'value[0] <cmp> field' if the
+ condition is of the form:
+ 'value[0] BETWEEN field1 AND field2'
+ */
+ for (uint i= 1; i <= num_values; i++)
+ {
+ if (is_local_field (values[i]))
+ {
+ field_item= (Item_field *) (values[i]->real_item());
+ add_key_equal_fields(key_fields, *and_level, cond_func,
+ field_item, equal_func, values,
+ 1, usable_tables, sargables);
+ }
+ }
+ } // if ( ... Item_func::BETWEEN)
+
+ // IN, NE
+ else if (is_local_field (cond_func->key_item()) &&
+ !(cond_func->used_tables() & OUTER_REF_TABLE_BIT))
{
values= cond_func->arguments()+1;
if (cond_func->functype() == Item_func::NE_FUNC &&
@@ -3757,21 +3815,6 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
cond_func->argument_count()-1,
usable_tables, sargables);
}
- if (cond_func->functype() == Item_func::BETWEEN)
- {
- values= cond_func->arguments();
- for (uint i= 1 ; i < cond_func->argument_count() ; i++)
- {
- Item_field *field_item;
- if (is_local_field (cond_func->arguments()[i]))
- {
- field_item= (Item_field *) (cond_func->arguments()[i]->real_item());
- add_key_equal_fields(key_fields, *and_level, cond_func,
- field_item, 0, values, 1, usable_tables,
- sargables);
- }
- }
- }
break;
}
case Item_func::OPTIMIZE_OP:
@@ -4239,8 +4282,12 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
continue;
}
-#ifdef HAVE_valgrind
- /* Valgrind complains about overlapped memcpy when save_pos==use. */
+#if defined(__GNUC__) && !MY_GNUC_PREREQ(4,4)
+ /*
+ Old gcc used a memcpy(), which is undefined if save_pos==use:
+ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19410
+ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39480
+ */
if (save_pos != use)
#endif
*save_pos= *use;
@@ -6894,9 +6941,9 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
tab->set_select_cond(tmp, __LINE__);
/* Push condition to storage engine if this is enabled
and the condition is not guarded */
- tab->table->file->pushed_cond= NULL;
- if ((thd->variables.optimizer_switch &
- OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN) && !first_inner_tab)
+ if (tab->table && (thd->variables.optimizer_switch &
+ OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN) &&
+ !first_inner_tab)
{
COND *push_cond=
make_cond_for_table(tmp, current_map, current_map, FALSE);
@@ -6920,10 +6967,12 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
{
/* Use quick key read if it's a constant and it's not used
with key reading */
- if (tab->needed_reg.is_clear_all() && tab->type != JT_EQ_REF
- && tab->type != JT_FT && (tab->type != JT_REF ||
- (uint) tab->ref.key == tab->quick->index))
- {
+ if (tab->needed_reg.is_clear_all() && tab->type != JT_EQ_REF &&
+ tab->type != JT_FT &&
+ ((tab->type != JT_CONST && tab->type != JT_REF) ||
+ (uint)tab->ref.key == tab->quick->index))
+ {
+ DBUG_ASSERT(tab->quick->is_valid());
sel->quick=tab->quick; // Use value from get_quick_...
sel->quick_keys.clear_all();
sel->needed_reg.clear_all();
@@ -10670,24 +10719,41 @@ internal_remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
Field *field=((Item_field*) args[0])->field;
/* fix to replace 'NULL' dates with '0' (shreeve@uci.edu) */
/*
- datetime_field IS NULL has to be modified to
- datetime_field == 0
+ See BUG#12594011
+ Documentation says that
+ SELECT datetime_notnull d FROM t1 WHERE d IS NULL
+ shall return rows where d=='0000-00-00'
+
+ Thus, for DATE and DATETIME columns defined as NOT NULL,
+ "date_notnull IS NULL" has to be modified to
+ "date_notnull IS NULL OR date_notnull == 0" (if outer join)
+ "date_notnull == 0" (otherwise)
+
*/
if (((field->type() == MYSQL_TYPE_DATE) ||
(field->type() == MYSQL_TYPE_DATETIME)) &&
- (field->flags & NOT_NULL_FLAG) && !field->table->maybe_null)
+ (field->flags & NOT_NULL_FLAG))
{
- COND *new_cond;
- if ((new_cond= new Item_func_eq(args[0],new Item_int("0", 0, 2))))
- {
- cond=new_cond;
- /*
- Item_func_eq can't be fixed after creation so we do not check
- cond->fixed, also it do not need tables so we use 0 as second
- argument.
- */
- cond->fix_fields(thd, &cond);
- }
+ Item *item0= new(thd->mem_root) Item_int((longlong)0, 1);
+ Item *eq_cond= new(thd->mem_root) Item_func_eq(args[0], item0);
+ if (!eq_cond)
+ return cond;
+
+ if (field->table->pos_in_table_list->outer_join)
+ {
+ // outer join: transform "col IS NULL" to "col IS NULL or col=0"
+ Item *or_cond= new(thd->mem_root) Item_cond_or(eq_cond, cond);
+ if (!or_cond)
+ return cond;
+ cond= or_cond;
+ }
+ else
+ {
+ // not outer join: transform "col IS NULL" to "col=0"
+ cond= eq_cond;
+ }
+
+ cond->fix_fields(thd, &cond);
}
}
if (cond->const_item())
@@ -11235,7 +11301,12 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
convert_blob_length);
if (orig_type == Item::REF_ITEM && orig_modify)
((Item_ref*)orig_item)->set_result_field(result);
- if (field->field->eq_def(result))
+ /*
+ Fields that are used as arguments to the DEFAULT() function already have
+ their data pointers set to the default value during name resulotion. See
+ Item_default_value::fix_fields.
+ */
+ if (orig_type != Item::DEFAULT_VALUE_ITEM && field->field->eq_def(result))
*default_field= field->field;
return result;
}
@@ -11939,6 +12010,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
(ha_base_keytype) key_part_info->type == HA_KEYTYPE_VARTEXT1 ||
(ha_base_keytype) key_part_info->type == HA_KEYTYPE_VARTEXT2) ?
0 : FIELDFLAG_BINARY;
+ key_part_info->key_part_flag= 0;
if (!using_unique_constraint)
{
cur_group->buff=(char*) group_buff;
@@ -13462,7 +13534,6 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
condition is true => a match is found.
*/
bool found= 1;
- bool use_not_exists_opt= 0;
while (join_tab->first_unmatched && found)
{
/*
@@ -13478,17 +13549,29 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
first_unmatched->found= 1;
for (JOIN_TAB *tab= first_unmatched; tab <= join_tab; tab++)
{
- if (tab->table->reginfo.not_exists_optimize)
- use_not_exists_opt= 1;
/* Check all predicates that has just been activated. */
/*
Actually all predicates non-guarded by first_unmatched->found
will be re-evaluated again. It could be fixed, but, probably,
it's not worth doing now.
*/
+ /*
+ not_exists_optimize has been created from a
+ select_cond containing 'is_null'. This 'is_null'
+ predicate is still present on any 'tab' with
+ 'not_exists_optimize'. Furthermore, the usual rules
+ for condition guards also applies for
+ 'not_exists_optimize' -> When 'is_null==false' we
+ know all cond. guards are open and we can apply
+ the 'not_exists_optimize'.
+ */
+ DBUG_ASSERT(!(tab->table->reginfo.not_exists_optimize &&
+ !tab->select_cond));
+
if (tab->select_cond && !tab->select_cond->val_int())
{
/* The condition attached to table tab is false */
+
if (tab == join_tab)
found= 0;
else
@@ -13498,6 +13581,20 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
not to the last table of the current nest level.
*/
join->return_tab= tab;
+ }
+
+ if (tab->table->reginfo.not_exists_optimize)
+ {
+ /*
+ When not_exists_optimize is set: No need to further
+ explore more rows of 'tab' for this partial result.
+ Any found 'tab' matches are known to evaluate to 'false'.
+ Returning .._NO_MORE_ROWS will skip rem. 'tab' rows.
+ */
+ DBUG_RETURN(NESTED_LOOP_NO_MORE_ROWS);
+ }
+ else if (tab != join_tab)
+ {
DBUG_RETURN(NESTED_LOOP_OK);
}
}
@@ -13512,8 +13609,6 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
join_tab->first_unmatched= first_unmatched;
}
- if (use_not_exists_opt)
- DBUG_RETURN(NESTED_LOOP_NO_MORE_ROWS);
JOIN_TAB *return_tab= join->return_tab;
join_tab->found_match= TRUE;
@@ -13727,7 +13822,7 @@ join_read_const_table(JOIN_TAB *tab, POSITION *pos)
/* Mark for EXPLAIN that the row was not found */
pos->records_read=0.0;
pos->ref_depend_map= 0;
- if (!table->maybe_null || error > 0)
+ if (!table->pos_in_table_list->outer_join || error > 0)
DBUG_RETURN(error);
}
/*
@@ -13753,7 +13848,7 @@ join_read_const_table(JOIN_TAB *tab, POSITION *pos)
/* Mark for EXPLAIN that the row was not found */
pos->records_read=0.0;
pos->ref_depend_map= 0;
- if (!table->maybe_null || error > 0)
+ if (!table->pos_in_table_list->outer_join || error > 0)
DBUG_RETURN(error);
}
}
@@ -14342,10 +14437,14 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
}
if (join->having && join->having->val_int() == 0)
DBUG_RETURN(NESTED_LOOP_OK); // Didn't match having
- error=0;
if (join->procedure)
- error=join->procedure->send_row(join->procedure_fields_list);
- else if (join->do_send_rows)
+ {
+ if (join->procedure->send_row(join->procedure_fields_list))
+ DBUG_RETURN(NESTED_LOOP_ERROR);
+ DBUG_RETURN(NESTED_LOOP_OK);
+ }
+ error=0;
+ if (join->do_send_rows)
error=join->result->send_data(*join->fields);
if (error)
DBUG_RETURN(NESTED_LOOP_ERROR); /* purecov: inspected */
@@ -14841,6 +14940,42 @@ bool test_if_ref(Item *root_cond, Item_field *left_item,Item *right_item)
return 0; // keep test
}
+/**
+ Extract a condition that can be checked after reading given table
+
+ @param cond Condition to analyze
+ @param tables Tables for which "current field values" are available
+ @param used_table Table that we're extracting the condition for (may
+ also include PSEUDO_TABLE_BITS, and may be zero)
+ @param exclude_expensive_cond Do not push expensive conditions
+
+ @retval <>NULL Generated condition
+ @retval =NULL Already checked, OR error
+
+ @details
+ Extract the condition that can be checked after reading the table
+ specified in 'used_table', given that current-field values for tables
+ specified in 'tables' bitmap are available.
+ If 'used_table' is 0
+ - extract conditions for all tables in 'tables'.
+ - extract conditions are unrelated to any tables
+ in the same query block/level(i.e. conditions
+ which have used_tables == 0).
+
+ The function assumes that
+ - Constant parts of the condition has already been checked.
+ - Condition that could be checked for tables in 'tables' has already
+ been checked.
+
+ The function takes into account that some parts of the condition are
+ guaranteed to be true by employed 'ref' access methods (the code that
+ does this is located at the end, search down for "EQ_FUNC").
+
+ @note
+ Make sure to keep the implementations of make_cond_for_table() and
+ make_cond_after_sjm() synchronized.
+ make_cond_for_info_schema() uses similar algorithm as well.
+*/
/*
@@ -15060,7 +15195,7 @@ make_cond_after_sjm(Item *root_cond, Item *cond, table_map tables,
new_cond->argument_list()->push_back(fix);
}
/*
- Item_cond_and do not need fix_fields for execution, its parameters
+ Item_cond_or do not need fix_fields for execution, its parameters
are fixed or do not need fix_fields, too
*/
new_cond->quick_fix_field();
@@ -15384,6 +15519,8 @@ static bool
list_contains_unique_index(TABLE *table,
bool (*find_func) (Field *, void *), void *data)
{
+ if (table->pos_in_table_list->outer_join)
+ return 0;
for (uint keynr= 0; keynr < table->s->keys; keynr++)
{
if (keynr == table->s->primary_key ||
@@ -15397,7 +15534,7 @@ list_contains_unique_index(TABLE *table,
key_part < key_part_end;
key_part++)
{
- if (key_part->field->maybe_null() ||
+ if (key_part->field->real_maybe_null() ||
!find_func(key_part->field, data))
break;
}
@@ -15503,13 +15640,15 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
{
int ref_key;
uint ref_key_parts;
- int order_direction;
+ int order_direction= 0;
uint used_key_parts;
TABLE *table=tab->table;
SQL_SELECT *select=tab->select;
key_map usable_keys;
QUICK_SELECT_I *save_quick= 0;
COND *orig_select_cond= 0;
+ int best_key= -1;
+
DBUG_ENTER("test_if_skip_sort_order");
LINT_INIT(ref_key_parts);
@@ -15619,6 +15758,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
new_ref_key_map.clear_all(); // Force the creation of quick select
new_ref_key_map.set_bit(new_ref_key); // only for new_ref_key.
+ select->quick= 0;
if (select->test_quick_select(tab->join->thd, new_ref_key_map, 0,
(tab->join->select_options &
OPTION_FOUND_ROWS) ?
@@ -15640,8 +15780,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
{
uint UNINIT_VAR(best_key_parts);
uint saved_best_key_parts= 0;
- int UNINIT_VAR(best_key_direction);
- int best_key= -1;
+ int best_key_direction= 0;
JOIN *join= tab->join;
ha_rows table_records= table->file->stats.records;
@@ -15661,84 +15800,21 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
tab->join->tables > tab->join->const_tables + 1) &&
((unsigned) best_key != table->s->primary_key ||
!table->file->primary_key_is_clustered()))
- DBUG_RETURN(0);
+ goto use_filesort;
if (best_key >= 0)
{
- bool quick_created= FALSE;
if (table->quick_keys.is_set(best_key) && best_key != ref_key)
{
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,
- TRUE, FALSE) > 0;
- }
- if (!no_changes)
- {
- /*
- If ref_key used index tree reading only ('Using index' in EXPLAIN),
- and best_key doesn't, then revert the decision.
- */
- if (!table->covering_keys.is_set(best_key))
- table->disable_keyread();
- if (!quick_created)
- {
- 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 (select && select->quick)
- {
- delete select->quick;
- select->quick= 0;
- }
- if (table->covering_keys.is_set(best_key) && ! table->key_read)
- table->enable_keyread();
- if (tab->pre_idx_push_select_cond)
- {
- COND *tmp_cond= tab->pre_idx_push_select_cond;
- if (orig_select_cond)
- {
- tmp_cond= and_conds(tmp_cond, orig_select_cond);
- tmp_cond->quick_fix_field();
- }
- tab->set_cond(tmp_cond);
- /* orig_select_cond was merged, no need to restore original one. */
- orig_select_cond= 0;
- }
- table->file->ha_index_or_rnd_end();
- if (join->select_options & SELECT_DESCRIBE)
- {
- tab->ref.key= -1;
- tab->ref.key_parts= 0;
- if (select_limit < table_records)
- tab->limit= select_limit;
- }
- }
- else if (tab->type != JT_ALL)
- {
- /*
- We're about to use a quick access to the table.
- We need to change the access method so as the quick access
- method is actually used.
- */
- DBUG_ASSERT(tab->select->quick);
- tab->type=JT_ALL;
- tab->use_quick=1;
- tab->ref.key= -1;
- tab->ref.key_parts=0; // Don't use ref key.
- tab->read_first_record= join_init_read_record;
- if (tab->is_using_loose_index_scan())
- join->tmp_table_param.precomputed_group_by= TRUE;
- /*
- TODO: update the number of records in join->best_positions[tablenr]
- */
- }
+ select->quick= 0;
+ select->test_quick_select(join->thd, map, 0,
+ join->select_options & OPTION_FOUND_ROWS ?
+ HA_POS_ERROR :
+ join->unit->select_limit_cnt,
+ TRUE, FALSE) > 0;
}
order_direction= best_key_direction;
/*
@@ -15751,10 +15827,12 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
saved_best_key_parts : best_key_parts;
}
else
- goto use_filesort;
+ goto use_filesort;
}
check_reverse_order:
+ DBUG_ASSERT(order_direction != 0);
+
if (order_direction == -1) // If ORDER BY ... DESC
{
if (select && select->quick)
@@ -15763,9 +15841,10 @@ check_reverse_order:
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())
+ if (select->quick->reverse_sorted())
+ goto skipped_filesort;
+ else
{
- QUICK_SELECT_I *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 ||
@@ -15773,40 +15852,141 @@ check_reverse_order:
quick_type == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX)
{
tab->limit= 0;
- select->quick= save_quick;
- goto use_filesort; // Use filesort
+ goto use_filesort; // Use filesort
}
-
- /* ORDER BY range_key DESC */
- tmp= select->quick->make_reverse(used_key_parts);
- if (!tmp)
- {
- select->quick= save_quick;
- tab->limit= 0;
- goto use_filesort; // Reverse sort not supported
- }
- select->set_quick(tmp);
}
}
- else if (tab->type != JT_NEXT && tab->type != JT_REF_OR_NULL &&
- tab->ref.key >= 0 && tab->ref.key_parts <= used_key_parts)
+ }
+
+ /*
+ Update query plan with access pattern for doing
+ ordered access according to what we have decided
+ above.
+ */
+ if (!no_changes) // We are allowed to update QEP
+ {
+ if (best_key >= 0)
{
- /*
- SELECT * FROM t1 WHERE a=1 ORDER BY a DESC,b DESC
+ bool quick_created=
+ (select && select->quick && select->quick!=save_quick);
- Use a traversal function that starts by reading the last row
- with key part (A) and then traverse the index backwards.
+ /*
+ If ref_key used index tree reading only ('Using index' in EXPLAIN),
+ and best_key doesn't, then revert the decision.
*/
- tab->read_first_record= join_read_last_key;
- tab->read_record.read_record= join_read_prev_same;
+ if (!table->covering_keys.is_set(best_key))
+ table->disable_keyread();
+ if (!quick_created)
+ {
+ if (select) // Throw any existing quick select
+ select->quick= 0; // Cleanup either reset to save_quick,
+ // or 'delete save_quick'
+ tab->index= best_key;
+ tab->read_first_record= order_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)
+ table->enable_keyread();
+ if (tab->pre_idx_push_select_cond)
+ {
+ COND *tmp_cond= tab->pre_idx_push_select_cond;
+ if (orig_select_cond)
+ {
+ tmp_cond= and_conds(tmp_cond, orig_select_cond);
+ tmp_cond->quick_fix_field();
+ }
+ tab->set_cond(tmp_cond);
+ /* orig_select_cond was merged, no need to restore original one. */
+ orig_select_cond= 0;
+ }
+ table->file->ha_index_or_rnd_end();
+ if (tab->join->select_options & SELECT_DESCRIBE)
+ {
+ tab->ref.key= -1;
+ tab->ref.key_parts= 0;
+ if (select_limit < table->file->stats.records)
+ tab->limit= select_limit;
+ }
+ }
+ else if (tab->type != JT_ALL)
+ {
+ /*
+ We're about to use a quick access to the table.
+ We need to change the access method so as the quick access
+ method is actually used.
+ */
+ DBUG_ASSERT(tab->select->quick);
+ tab->type=JT_ALL;
+ tab->use_quick=1;
+ tab->ref.key= -1;
+ tab->ref.key_parts=0; // Don't use ref key.
+ tab->read_first_record= join_init_read_record;
+ if (tab->is_using_loose_index_scan())
+ tab->join->tmp_table_param.precomputed_group_by= TRUE;
+ /*
+ TODO: update the number of records in join->best_positions[tablenr]
+ */
+ }
+ } // best_key >= 0
+
+ if (order_direction == -1) // If ORDER BY ... DESC
+ {
+ if (select && select->quick)
+ {
+ /* ORDER BY range_key DESC */
+ QUICK_SELECT_I *tmp= select->quick->make_reverse(used_key_parts);
+ if (!tmp)
+ {
+ tab->limit= 0;
+ goto use_filesort; // Reverse sort failed -> filesort
+ }
+ if (select->quick == save_quick)
+ save_quick= 0; // make_reverse() consumed it
+ select->set_quick(tmp);
+ }
+ else if (tab->type != JT_NEXT && tab->type != JT_REF_OR_NULL &&
+ 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;
+ }
}
+ else if (select && select->quick)
+ select->quick->need_sorted_output();
+
+ } // QEP has been modified
+
+ /*
+ Cleanup:
+ We may have both a 'select->quick' and 'save_quick' (original)
+ at this point. Delete the one that we wan't use.
+ */
+
+skipped_filesort:
+ // Keep current (ordered) select->quick
+ if (select && save_quick != select->quick)
+ {
+ delete save_quick;
+ save_quick= NULL;
}
- else if (select && select->quick)
- select->quick->need_sorted_output();
if (orig_select_cond)
tab->set_cond(orig_select_cond);
DBUG_RETURN(1);
+
use_filesort:
+ // Restore original save_quick
+ if (select && select->quick != save_quick)
+ {
+ delete select->quick;
+ select->quick= save_quick;
+ }
if (orig_select_cond)
tab->set_cond(orig_select_cond);
DBUG_RETURN(0);
@@ -15819,7 +15999,7 @@ use_filesort:
SYNOPSIS
create_sort_index()
thd Thread handler
- tab Table to sort (in join structure)
+ join Join with table to sort
order How table should be sorted
filesort_limit Max number of rows that needs to be sorted
select_limit Max number of rows in final output
@@ -15829,8 +16009,8 @@ use_filesort:
IMPLEMENTATION
- - If there is an index that can be used, 'tab' is modified to use
- this index.
+ - If there is an index that can be used, the first non-const join_tab in
+ 'join' is modified to use this index.
- If no index, create with filesort() an index file that can be used to
retrieve rows in order (should be done with 'read_record').
The sorted data is stored in tab->table and will be freed when calling
@@ -16966,6 +17146,8 @@ calc_group_buffer(JOIN *join,ORDER *group)
{
key_length+= 8;
}
+ else if (type == MYSQL_TYPE_BLOB)
+ key_length+= MAX_BLOB_WIDTH; // Can't be used as a key
else
{
/*
@@ -17612,7 +17794,7 @@ init_sum_functions(Item_sum **func_ptr, Item_sum **end_ptr)
{
for (; func_ptr != end_ptr ;func_ptr++)
{
- if ((*func_ptr)->reset())
+ if ((*func_ptr)->reset_and_add())
return 1;
}
/* If rollup, calculate the upper sum levels */
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 8d487021a04..696cec99192 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -1,7 +1,7 @@
#ifndef SQL_SELECT_INCLUDED
#define SQL_SELECT_INCLUDED
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
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
@@ -1785,7 +1785,8 @@ bool is_indexed_agg_distinct(JOIN *join, List<Item_field> *out_args);
/* functions from opt_sum.cc */
bool simple_pred(Item_func *func_item, Item **args, bool *inv_order);
-int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds);
+int opt_sum_query(THD* thd,
+ TABLE_LIST *tables, List<Item> &all_fields, COND *conds);
/* from sql_delete.cc, used by opt_range.cc */
extern "C" int refpos_order_cmp(void* arg, const void *a,const void *b);
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index ea17cd73e1c..2d06f383612 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -30,6 +30,8 @@
#include "repl_failsafe.h"
#include "sql_parse.h" // check_access, check_table_access
#include "sql_partition.h" // partition_element
+#include "sql_derived.h" // mysql_derived_prepare,
+ // mysql_handle_derived,
#include "sql_db.h" // check_db_dir_existence, load_db_opt_by_name
#include "sql_time.h" // interval_type_to_name
#include "tztime.h" // struct Time_zone
@@ -104,11 +106,13 @@ static const char *ha_choice_values[] = {"", "0", "1"};
static void store_key_options(THD *thd, String *packet, TABLE *table,
KEY *key_info);
+#ifdef WITH_PARTITION_STORAGE_ENGINE
static void get_cs_converted_string_value(THD *thd,
String *input_str,
String *output_str,
CHARSET_INFO *cs,
bool use_hex);
+#endif
static void
append_algorithm(TABLE_LIST *table, String *buff);
@@ -224,27 +228,27 @@ static my_bool show_plugins(THD *thd, plugin_ref plugin,
strlen(PLUGIN_LICENSE_PROPRIETARY_STRING), cs);
break;
}
- table->field[9]->set_notnull();
- if ((uint) plug->maturity <= MariaDB_PLUGIN_MATURITY_STABLE)
- table->field[10]->store(maturity_name[plug->maturity].str,
+ table->field[10]->store(
+ global_plugin_typelib_names[plugin_load_option(plugin)],
+ strlen(global_plugin_typelib_names[plugin_load_option(plugin)]),
+ cs);
+
+ if (plug->maturity <= MariaDB_PLUGIN_MATURITY_STABLE)
+ table->field[11]->store(maturity_name[plug->maturity].str,
maturity_name[plug->maturity].length,
cs);
else
- {
- DBUG_ASSERT(0);
- table->field[10]->store("Unknown", 7, cs);
- }
- table->field[10]->set_notnull();
+ table->field[11]->store("Unknown", 7, cs);
if (plug->version_info)
{
- table->field[11]->store(plug->version_info,
+ table->field[12]->store(plug->version_info,
strlen(plug->version_info), cs);
- table->field[11]->set_notnull();
+ table->field[12]->set_notnull();
}
else
- table->field[11]->set_null();
+ table->field[12]->set_null();
return schema_table_store_record(thd, table);
}
@@ -362,6 +366,7 @@ static struct show_privileges_st sys_privileges[]=
{"Insert", "Tables", "To insert data into tables"},
{"Lock tables","Databases","To use LOCK TABLES (together with SELECT privilege)"},
{"Process", "Server Admin", "To view the plain text of currently executing queries"},
+ {"Proxy", "Server Admin", "To make proxy user possible"},
{"References", "Databases,Tables", "To have references on tables"},
{"Reload", "Server Admin", "To reload or refresh tables, logs and privileges"},
{"Replication client","Server Admin","To ask where the slave or master servers are"},
@@ -506,12 +511,6 @@ find_files(THD *thd, List<LEX_STRING> *files, const char *db,
else if (wild_compare(uname, wild, 0))
continue;
}
- if (!(file_name=
- thd->make_lex_string(file_name, uname, file_name_len, TRUE)))
- {
- my_dirend(dirp);
- DBUG_RETURN(FIND_FILES_OOM);
- }
}
else
{
@@ -628,11 +627,11 @@ public:
return m_view_access_denied_message_ptr;
}
- bool handle_condition(THD *thd, uint sql_errno, const char */* sqlstate */,
+ bool handle_condition(THD *thd, uint sql_errno, const char * /* sqlstate */,
MYSQL_ERROR::enum_warning_level level,
- const char *message, MYSQL_ERROR **/* cond_hdl */)
+ const char *message, MYSQL_ERROR ** /* cond_hdl */)
{
- /*
+ /*
The handler does not handle the errors raised by itself.
At this point we know if top_view is really a view.
*/
@@ -642,7 +641,7 @@ public:
m_handling= TRUE;
bool is_handled;
-
+
switch (sql_errno)
{
case ER_TABLEACCESS_DENIED_ERROR:
@@ -703,17 +702,24 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
Metadata locks taken during SHOW CREATE should be released when
the statmement completes as it is an information statement.
*/
- MDL_ticket *mdl_savepoint= thd->mdl_context.mdl_savepoint();
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
/* We want to preserve the tree for views. */
- thd->lex->view_prepare_mode= TRUE;
+ thd->lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VIEW;
{
+ /*
+ Use open_tables() directly rather than open_normal_and_derived_tables().
+ This ensures that close_thread_tables() is not called if open tables fails
+ and the error is ignored. This allows us to handle broken views nicely.
+ */
+ uint counter;
Show_create_error_handler view_error_suppressor(thd, table_list);
thd->push_internal_handler(&view_error_suppressor);
bool open_error=
- open_normal_and_derived_tables(thd, table_list,
- MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL);
+ open_tables(thd, &table_list, &counter,
+ MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL) ||
+ mysql_handle_derived(thd->lex, &mysql_derived_prepare);
thd->pop_internal_handler();
if (open_error && (thd->killed || thd->is_error()))
goto exit;
@@ -1444,18 +1450,6 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
if (!(thd->variables.sql_mode & MODE_NO_TABLE_OPTIONS) && !foreign_db_mode)
{
show_table_options= TRUE;
- /*
- Get possible table space definitions and append them
- to the CREATE TABLE statement
- */
-
- if ((for_str= file->get_tablespace_name(thd,0,0)))
- {
- packet->append(STRING_WITH_LEN(" /*!50100 TABLESPACE "));
- packet->append(for_str, strlen(for_str));
- packet->append(STRING_WITH_LEN(" STORAGE DISK */"));
- my_free(for_str);
- }
/*
IF check_create_info
@@ -1813,7 +1807,7 @@ public:
time_t start_time;
uint command;
const char *user,*host,*db,*proc_info,*state_info;
- char *query;
+ CSET_STRING query_string;
};
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
@@ -1910,12 +1904,14 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
if (mysys_var)
mysql_mutex_unlock(&mysys_var->mutex);
- thd_info->query=0;
/* Lock THD mutex that protects its data when looking at it. */
if (tmp->query())
{
uint length= min(max_query_length, tmp->query_length());
- thd_info->query= (char*) thd->strmake(tmp->query(),length);
+ char *q= thd->strmake(tmp->query(),length);
+ /* Safety: in case strmake failed, we set length to 0. */
+ thd_info->query_string=
+ CSET_STRING(q, q ? length : 0, tmp->query_charset());
}
mysql_mutex_unlock(&tmp->LOCK_thd_data);
thd_info->start_time= tmp->start_time;
@@ -1943,7 +1939,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
else
protocol->store_null();
protocol->store(thd_info->state_info, system_charset_info);
- protocol->store(thd_info->query, system_charset_info);
+ protocol->store(thd_info->query_string.str(),
+ thd_info->query_string.charset());
if (protocol->write())
break; /* purecov: inspected */
}
@@ -2780,12 +2777,11 @@ bool schema_table_store_record(THD *thd, TABLE *table)
}
-int make_table_list(THD *thd, SELECT_LEX *sel,
- LEX_STRING *db_name, LEX_STRING *table_name)
+static int make_table_list(THD *thd, SELECT_LEX *sel,
+ LEX_STRING *db_name, LEX_STRING *table_name)
{
Table_ident *table_ident;
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, MDL_SHARED_READ))
return 1;
return 0;
@@ -3355,91 +3351,190 @@ make_table_name_list(THD *thd, List<LEX_STRING> *table_names, LEX *lex,
/**
- @brief Fill I_S table for SHOW COLUMNS|INDEX commands
+ Fill I_S table with data obtained by performing full-blown table open.
+
+ @param thd Thread handler.
+ @param is_show_fields_or_keys Indicates whether it is a legacy SHOW
+ COLUMNS or SHOW KEYS statement.
+ @param table TABLE object for I_S table to be filled.
+ @param schema_table I_S table description structure.
+ @param orig_db_name Database name.
+ @param orig_table_name Table name.
+ @param open_tables_state_backup Open_tables_state object which is used
+ to save/restore original status of
+ variables related to open tables state.
+ @param can_deadlock Indicates that deadlocks are possible
+ due to metadata locks, so to avoid
+ them we should not wait in case if
+ conflicting lock is present.
+
+ @retval FALSE - Success.
+ @retval TRUE - Failure.
+*/
+static bool
+fill_schema_table_by_open(THD *thd, bool is_show_fields_or_keys,
+ TABLE *table, ST_SCHEMA_TABLE *schema_table,
+ LEX_STRING *orig_db_name,
+ LEX_STRING *orig_table_name,
+ Open_tables_backup *open_tables_state_backup,
+ bool can_deadlock)
+{
+ Query_arena i_s_arena(thd->mem_root,
+ Query_arena::STMT_CONVENTIONAL_EXECUTION),
+ backup_arena, *old_arena;
+ LEX *old_lex= thd->lex, temp_lex, *lex;
+ LEX_STRING db_name, table_name;
+ TABLE_LIST *table_list;
+ bool result= true;
+
+ DBUG_ENTER("fill_schema_table_by_open");
+ /*
+ When a view is opened its structures are allocated on a permanent
+ statement arena and linked into the LEX tree for the current statement
+ (this happens even in cases when view is handled through TEMPTABLE
+ algorithm).
- @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] can_deadlock Indicates that deadlocks are possible
- due to metadata locks, so to avoid
- them we should not wait in case if
- conflicting lock is present.
- @param[in] open_tables_state_backup pointer to Open_tables_backup object
- which is used to save|restore original
- status of variables related to
- open tables state
+ To prevent this process from unnecessary hogging of memory in the permanent
+ arena of our I_S query and to avoid damaging its LEX we use temporary
+ arena and LEX for table/view opening.
- @return Operation status
- @retval 0 success
- @retval 1 error
-*/
+ Use temporary arena instead of statement permanent arena. Also make
+ it active arena and save original one for successive restoring.
+ */
+ old_arena= thd->stmt_arena;
+ thd->stmt_arena= &i_s_arena;
+ thd->set_n_backup_active_arena(&i_s_arena, &backup_arena);
-static int
-fill_schema_show_cols_or_idxs(THD *thd, TABLE_LIST *tables,
- ST_SCHEMA_TABLE *schema_table,
- bool can_deadlock,
- Open_tables_backup *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= tables->schema_select_lex->table_list.first;
- TABLE *table= tables->table;
- int error= 1;
- DBUG_ENTER("fill_schema_show");
+ /* Prepare temporary LEX. */
+ thd->lex= lex= &temp_lex;
+ lex_start(thd);
+
+ /* Disable constant subquery evaluation as we won't be locking tables. */
+ lex->context_analysis_only= CONTEXT_ANALYSIS_ONLY_VIEW;
+
+ /*
+ Some of process_table() functions rely on wildcard being passed from
+ old LEX (or at least being initialized).
+ */
+ lex->wild= old_lex->wild;
- 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.
+ Since make_table_list() might change database and table name passed
+ to it we create copies of orig_db_name and orig_table_name here.
+ These copies are used for make_table_list() while unaltered values
+ are passed to process_table() functions.
*/
- thd->temporary_tables= open_tables_state_backup->temporary_tables;
+ if (!thd->make_lex_string(&db_name, orig_db_name->str,
+ orig_db_name->length, FALSE) ||
+ !thd->make_lex_string(&table_name, orig_table_name->str,
+ orig_table_name->length, FALSE))
+ goto end;
+
+ /*
+ Create table list element for table to be open. Link it with the
+ temporary LEX. The latter is required to correctly open views and
+ produce table describing their structure.
+ */
+ if (make_table_list(thd, &lex->select_lex, &db_name, &table_name))
+ goto end;
+
+ table_list= lex->select_lex.table_list.first;
+
+ if (is_show_fields_or_keys)
+ {
+ /*
+ 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;
+ }
+ else
+ {
+ /*
+ Apply optimization flags for table opening which are relevant for
+ this I_S table. We can't do this for SHOW COLUMNS/KEYS because of
+ backward compatibility.
+ */
+ table_list->i_s_requested_object= schema_table->i_s_requested_object;
+ }
+
/*
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()'
+ 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_OPEN_IGNORE_FLUSH |
- MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL |
- (can_deadlock ?
- MYSQL_OPEN_FAIL_ON_MDL_CONFLICT : 0)));
- lex->sql_command= save_sql_command;
+ result= open_normal_and_derived_tables(thd, table_list,
+ (MYSQL_OPEN_IGNORE_FLUSH |
+ MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL |
+ (can_deadlock ?
+ MYSQL_OPEN_FAIL_ON_MDL_CONFLICT : 0)));
+ /*
+ Restore old value of sql_command back as it is being looked at in
+ process_table() function.
+ */
+ lex->sql_command= old_lex->sql_command;
DEBUG_SYNC(thd, "after_open_table_ignore_flush");
/*
- 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).
+ XXX: show_table_list has a flag i_is_requested,
+ and when it's set, open_normal_and_derived_tables()
+ can return an error without setting an error message
+ in THD, which is a hack. This is why we have to
+ check for res, then for thd->is_error() and only then
+ for thd->main_da.sql_errno().
+
+ Again we don't do this for SHOW COLUMNS/KEYS because
+ of backward compatibility.
*/
- 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;
+ if (!is_show_fields_or_keys && result && thd->is_error() &&
+ thd->stmt_da->sql_errno() == ER_NO_SUCH_TABLE)
+ {
+ /*
+ Hide error for a non-existing table.
+ For example, this error can occur when we use a where condition
+ with a db name and table, but the table does not exist.
+ */
+ result= false;
+ thd->clear_error();
+ }
+ else
+ {
+ result= schema_table->process_table(thd, table_list,
+ table, result,
+ orig_db_name,
+ orig_table_name);
+ }
+
+
+end:
+ lex->unit.cleanup();
+
+ /* Restore original LEX value, statement's arena and THD arena values. */
+ lex_end(thd->lex);
+
+ if (i_s_arena.free_list)
+ i_s_arena.free_items();
+
+ /*
+ For safety reset list of open temporary tables before closing
+ all tables open within this Open_tables_state.
+ */
+ thd->temporary_tables= NULL;
+ close_thread_tables(thd);
+ thd->mdl_context.rollback_to_savepoint(open_tables_state_backup->mdl_system_tables_svp);
+
+ thd->lex= old_lex;
+ thd->stmt_arena= old_arena;
+ thd->restore_active_arena(&i_s_arena, &backup_arena);
- 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,
- open_tables_state_backup->mdl_system_tables_svp);
- DBUG_RETURN(error);
+ DBUG_RETURN(result);
}
@@ -3579,7 +3674,7 @@ try_acquire_high_prio_shared_mdl_lock(THD *thd, TABLE_LIST *table,
{
bool error;
table->mdl_request.init(MDL_key::TABLE, table->db, table->table_name,
- MDL_SHARED_HIGH_PRIO);
+ MDL_SHARED_HIGH_PRIO, MDL_TRANSACTION);
if (can_deadlock)
{
@@ -3789,6 +3884,45 @@ end:
/**
+ Trigger_error_handler is intended to intercept and silence SQL conditions
+ that might happen during trigger loading for SHOW statements.
+ The potential SQL conditions are:
+
+ - ER_PARSE_ERROR -- this error is thrown if a trigger definition file
+ is damaged or contains invalid CREATE TRIGGER statement. That should
+ not happen in normal life.
+
+ - ER_TRG_NO_DEFINER -- this warning is thrown when we're loading a
+ trigger created/imported in/from the version of MySQL, which does not
+ support trigger definers.
+
+ - ER_TRG_NO_CREATION_CTX -- this warning is thrown when we're loading a
+ trigger created/imported in/from the version of MySQL, which does not
+ support trigger creation contexts.
+*/
+
+class Trigger_error_handler : public Internal_error_handler
+{
+public:
+ bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* msg,
+ MYSQL_ERROR ** cond_hdl)
+ {
+ if (sql_errno == ER_PARSE_ERROR ||
+ sql_errno == ER_TRG_NO_DEFINER ||
+ sql_errno == ER_TRG_NO_CREATION_CTX)
+ return true;
+
+ return false;
+ }
+};
+
+
+
+/**
@brief Fill I_S tables whose data are retrieved
from frm files and storage engine
@@ -3811,10 +3945,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
{
LEX *lex= thd->lex;
TABLE *table= tables->table;
- SELECT_LEX *old_all_select_lex= lex->all_selects_list;
SELECT_LEX *lsel= tables->schema_select_lex;
ST_SCHEMA_TABLE *schema_table= tables->schema_table;
- SELECT_LEX sel;
LOOKUP_FIELD_VALUES lookup_field_vals;
LEX_STRING *db_name, *table_name;
bool with_i_schema;
@@ -3822,11 +3954,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *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;
Open_tables_backup 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
@@ -3845,15 +3974,6 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
*/
can_deadlock= thd->mdl_context.has_locks();
- lex->view_prepare_mode= TRUE;
- lex->reset_n_backup_query_tables_list(&query_tables_list_backup);
- /*
- Restore Query_tables_list::sql_command value, which was reset
- above, as ST_SCHEMA_TABLE::process_table() functions often rely
- that this value reflects which SHOW statement is executed.
- */
- lex->sql_command= query_tables_list_backup.sql_command;
-
/*
We should not introduce deadlocks even if we already have some
tables open and locked, since we won't lock tables which we will
@@ -3873,9 +3993,19 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
*/
if (lsel && lsel->table_list.first)
{
- error= fill_schema_show_cols_or_idxs(thd, tables, schema_table,
- can_deadlock,
- &open_tables_state_backup);
+ LEX_STRING db_name, table_name;
+
+ db_name.str= lsel->table_list.first->db;
+ db_name.length= lsel->table_list.first->db_length;
+
+ table_name.str= lsel->table_list.first->table_name;
+ table_name.length= lsel->table_list.first->table_name_length;
+
+ error= fill_schema_table_by_open(thd, TRUE,
+ table, schema_table,
+ &db_name, &table_name,
+ &open_tables_state_backup,
+ can_deadlock);
goto err;
}
@@ -3937,7 +4067,6 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str, 0))
#endif
{
- thd->no_warnings_for_error= 1;
List<LEX_STRING> table_names;
int res= make_table_name_list(thd, &table_names, lex,
&lookup_field_vals,
@@ -3986,77 +4115,34 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
if (!(table_open_method & ~OPEN_FRM_ONLY) &&
!with_i_schema)
{
- if (!fill_schema_table_from_frm(thd, tables, schema_table, db_name,
- table_name, schema_table_idx,
- can_deadlock))
+ /*
+ Here we need to filter out warnings, which can happen
+ during loading of triggers in fill_schema_table_from_frm(),
+ because we don't need those warnings to pollute output of
+ SELECT from I_S / SHOW-statements.
+ */
+
+ Trigger_error_handler err_handler;
+ thd->push_internal_handler(&err_handler);
+
+ int res= fill_schema_table_from_frm(thd, tables, schema_table,
+ db_name, table_name,
+ schema_table_idx,
+ can_deadlock);
+
+ thd->pop_internal_handler();
+
+ if (!res)
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;
- /* 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= 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;
DEBUG_SYNC(thd, "before_open_in_get_all_tables");
- res= open_normal_and_derived_tables(thd, show_table_list,
- (MYSQL_OPEN_IGNORE_FLUSH |
- MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL |
- (can_deadlock ? MYSQL_OPEN_FAIL_ON_MDL_CONFLICT : 0)));
- lex->sql_command= query_tables_list_backup.sql_command;
- /*
- XXX: show_table_list has a flag i_is_requested,
- and when it's set, open_normal_and_derived_tables()
- can return an error without setting an error message
- in THD, which is a hack. This is why we have to
- check for res, then for thd->is_error() only then
- for thd->stmt_da->sql_errno().
- */
- if (res && thd->is_error() &&
- thd->stmt_da->sql_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();
- }
- else
- {
- /*
- 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.
- */
- 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_db_name,
- &tmp_lex_string);
- close_tables_for_reopen(thd, &show_table_list,
- open_tables_state_backup.mdl_system_tables_svp);
- }
- DBUG_ASSERT(!lex->query_tables_own_last);
- if (res)
+
+ if (fill_schema_table_by_open(thd, FALSE,
+ table, schema_table,
+ db_name, table_name,
+ &open_tables_state_backup,
+ can_deadlock))
goto err;
}
}
@@ -4072,10 +4158,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
error= 0;
err:
thd->restore_backup_open_tables_state(&open_tables_state_backup);
- lex->restore_backup_query_tables_list(&query_tables_list_backup);
- lex->derived_tables= derived_tables;
- lex->all_selects_list= old_all_select_lex;
- lex->view_prepare_mode= save_view_prepare_mode;
+
DBUG_RETURN(error);
}
@@ -4171,6 +4254,7 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
{
const char *tmp_buff;
MYSQL_TIME time;
+ int info_error= 0;
CHARSET_INFO *cs= system_charset_info;
DBUG_ENTER("get_schema_tables_record");
@@ -4178,22 +4262,21 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
table->field[0]->store(STRING_WITH_LEN("def"), cs);
table->field[1]->store(db_name->str, db_name->length, cs);
table->field[2]->store(table_name->str, table_name->length, cs);
+
if (res)
{
- /*
- there was errors during opening tables
- */
- const char *error= thd->is_error() ? thd->stmt_da->message() : "";
+ /* There was a table open error, so set the table type and return */
if (tables->view)
table->field[3]->store(STRING_WITH_LEN("VIEW"), cs);
else if (tables->schema_table)
table->field[3]->store(STRING_WITH_LEN("SYSTEM VIEW"), cs);
else
table->field[3]->store(STRING_WITH_LEN("BASE TABLE"), cs);
- table->field[20]->store(error, strlen(error), cs);
- thd->clear_error();
+
+ goto err;
}
- else if (tables->view)
+
+ if (tables->view)
{
table->field[3]->store(STRING_WITH_LEN("VIEW"), cs);
table->field[20]->store(STRING_WITH_LEN("VIEW"), cs);
@@ -4209,6 +4292,7 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
#ifdef WITH_PARTITION_STORAGE_ENGINE
bool is_partitioned= FALSE;
#endif
+
if (share->tmp_table == SYSTEM_TMP_TABLE)
table->field[3]->store(STRING_WITH_LEN("SYSTEM VIEW"), cs);
else if (share->tmp_table)
@@ -4222,6 +4306,9 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
continue;
table->field[i]->set_notnull();
}
+
+ /* Collect table info from the table share */
+
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (share->db_type() == partition_hton &&
share->partition_info_str_len)
@@ -4230,73 +4317,96 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
is_partitioned= TRUE;
}
#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);
str.length(0);
+
if (share->min_rows)
{
str.qs_append(STRING_WITH_LEN(" min_rows="));
str.qs_append(share->min_rows);
}
+
if (share->max_rows)
{
str.qs_append(STRING_WITH_LEN(" max_rows="));
str.qs_append(share->max_rows);
}
+
if (share->avg_row_length)
{
str.qs_append(STRING_WITH_LEN(" avg_row_length="));
str.qs_append(share->avg_row_length);
}
+
if (share->db_create_options & HA_OPTION_PACK_KEYS)
str.qs_append(STRING_WITH_LEN(" pack_keys=1"));
+
if (share->db_create_options & HA_OPTION_NO_PACK_KEYS)
str.qs_append(STRING_WITH_LEN(" pack_keys=0"));
+
/* We use CHECKSUM, instead of TABLE_CHECKSUM, for backward compability */
if (share->db_create_options & HA_OPTION_CHECKSUM)
str.qs_append(STRING_WITH_LEN(" checksum=1"));
+
if (share->page_checksum != HA_CHOICE_UNDEF)
{
str.qs_append(STRING_WITH_LEN(" page_checksum="));
str.qs_append(ha_choice_values[(uint) share->page_checksum]);
}
+
if (share->db_create_options & HA_OPTION_DELAY_KEY_WRITE)
str.qs_append(STRING_WITH_LEN(" delay_key_write=1"));
+
if (share->row_type != ROW_TYPE_DEFAULT)
{
str.qs_append(STRING_WITH_LEN(" row_format="));
str.qs_append(ha_row_type[(uint) share->row_type]);
}
+
if (share->key_block_size)
{
str.qs_append(STRING_WITH_LEN(" key_block_size="));
str.qs_append(share->key_block_size);
}
+
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (is_partitioned)
str.qs_append(STRING_WITH_LEN(" partitioned"));
#endif
+
if (share->transactional != HA_CHOICE_UNDEF)
{
str.qs_append(STRING_WITH_LEN(" transactional="));
str.qs_append(ha_choice_values[(uint) share->transactional]);
}
append_create_options(thd, &str, share->option_list);
+
if (str.length())
table->field[19]->store(str.ptr()+1, str.length()-1, cs);
tmp_buff= (share->table_charset ?
share->table_charset->name : "default");
+
table->field[17]->store(tmp_buff, strlen(tmp_buff), cs);
if (share->comment.str)
table->field[20]->store(share->comment.str, share->comment.length, cs);
+ /* Collect table info from the storage engine */
+
if(file)
{
- file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO);
+ /* If info() fails, then there's nothing else to do */
+ if ((info_error= file->info(HA_STATUS_VARIABLE |
+ HA_STATUS_TIME |
+ HA_STATUS_VARIABLE_EXTRA |
+ HA_STATUS_AUTO)) != 0)
+ goto err;
+
enum row_type row_type = file->get_row_type();
switch (row_type) {
case ROW_TYPE_NOT_USED:
@@ -4325,7 +4435,9 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
tmp_buff= "Page";
break;
}
+
table->field[6]->store(tmp_buff, strlen(tmp_buff), cs);
+
if (!tables->schema_table)
{
table->field[7]->store((longlong) file->stats.records, TRUE);
@@ -4374,6 +4486,26 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
}
}
}
+
+err:
+ if (res || info_error)
+ {
+ /*
+ If an error was encountered, push a warning, set the TABLE COMMENT
+ column with the error text, and clear the error so that the operation
+ can continue.
+ */
+ const char *error= thd->is_error() ? thd->stmt_da->message() : "";
+ table->field[20]->store(error, strlen(error), cs);
+
+ if (thd->is_error())
+ {
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ thd->stmt_da->sql_errno(), thd->stmt_da->message());
+ thd->clear_error();
+ }
+ }
+
DBUG_RETURN(schema_table_store_record(thd, table));
}
@@ -5337,18 +5469,29 @@ static int get_schema_views_record(THD *thd, TABLE_LIST *tables,
else
table->field[4]->store(STRING_WITH_LEN("NONE"), cs);
- if (table->pos_in_table_list->table_open_method &
- OPEN_FULL_TABLE)
+ /*
+ Only try to fill in the information about view updatability
+ if it is requested as part of the top-level query (i.e.
+ it's select * from i_s.views, as opposed to, say, select
+ security_type from i_s.views). Do not try to access the
+ underlying tables if there was an error when opening the
+ view: all underlying tables are released back to the table
+ definition cache on error inside open_normal_and_derived_tables().
+ If a field is not assigned explicitly, it defaults to NULL.
+ */
+ if (res == FALSE &&
+ table->pos_in_table_list->table_open_method & OPEN_FULL_TABLE)
{
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.
+ 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);
@@ -5471,8 +5614,8 @@ static int get_schema_constraints_record(THD *thd, TABLE_LIST *tables,
while ((f_key_info=it++))
{
if (store_constraints(thd, table, db_name, table_name,
- f_key_info->forein_id->str,
- strlen(f_key_info->forein_id->str),
+ f_key_info->foreign_id->str,
+ strlen(f_key_info->foreign_id->str),
"FOREIGN KEY", 11))
DBUG_RETURN(1);
}
@@ -5671,8 +5814,8 @@ static int get_schema_key_column_usage_record(THD *thd,
f_idx++;
restore_record(table, s->default_values);
store_key_column_usage(table, db_name, table_name,
- f_key_info->forein_id->str,
- f_key_info->forein_id->length,
+ f_key_info->foreign_id->str,
+ f_key_info->foreign_id->length,
f_info->str, f_info->length,
(longlong) f_idx);
table->field[8]->store((longlong) f_idx, TRUE);
@@ -5832,12 +5975,9 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table,
strlen(part_elem->tablespace_name), cs);
else
{
- char *ts= showing_table->file->get_tablespace_name(thd,0,0);
+ char *ts= showing_table->s->tablespace;
if(ts)
- {
table->field[24]->store(ts, strlen(ts), cs);
- my_free(ts);
- }
else
table->field[24]->set_null();
}
@@ -6461,8 +6601,8 @@ get_referential_constraints_record(THD *thd, TABLE_LIST *tables,
table->field[0]->store(STRING_WITH_LEN("def"), cs);
table->field[1]->store(db_name->str, db_name->length, cs);
table->field[9]->store(table_name->str, table_name->length, cs);
- table->field[2]->store(f_key_info->forein_id->str,
- f_key_info->forein_id->length, cs);
+ table->field[2]->store(f_key_info->foreign_id->str,
+ f_key_info->foreign_id->length, cs);
table->field[3]->store(STRING_WITH_LEN("def"), cs);
table->field[4]->store(f_key_info->referenced_db->str,
f_key_info->referenced_db->length, cs);
@@ -7086,6 +7226,92 @@ int make_schema_select(THD *thd, SELECT_LEX *sel,
}
+/**
+ Fill INFORMATION_SCHEMA-table, leave correct Diagnostics_area /
+ Warning_info state after itself.
+
+ This function is a wrapper around ST_SCHEMA_TABLE::fill_table(), which
+ may "partially silence" some errors. The thing is that during
+ fill_table() many errors might be emitted. These errors stem from the
+ nature of fill_table().
+
+ For example, SELECT ... FROM INFORMATION_SCHEMA.xxx WHERE TABLE_NAME = 'xxx'
+ results in a number of 'Table <db name>.xxx does not exist' errors,
+ because fill_table() tries to open the 'xxx' table in every possible
+ database.
+
+ Those errors are cleared (the error status is cleared from
+ Diagnostics_area) inside fill_table(), but they remain in Warning_info
+ (Warning_info is not cleared because it may contain useful warnings).
+
+ This function is responsible for making sure that Warning_info does not
+ contain warnings corresponding to the cleared errors.
+
+ @note: THD::no_warnings_for_error used to be set before calling
+ fill_table(), thus those errors didn't go to Warning_info. This is not
+ the case now (THD::no_warnings_for_error was eliminated as a hack), so we
+ need to take care of those warnings here.
+
+ @param thd Thread context.
+ @param table_list I_S table.
+ @param join_table JOIN/SELECT table.
+
+ @return Error status.
+ @retval TRUE Error.
+ @retval FALSE Success.
+*/
+static bool do_fill_table(THD *thd,
+ TABLE_LIST *table_list,
+ JOIN_TAB *join_table)
+{
+ // NOTE: fill_table() may generate many "useless" warnings, which will be
+ // ignored afterwards. On the other hand, there might be "useful"
+ // warnings, which should be presented to the user. Warning_info usually
+ // stores no more than THD::variables.max_error_count warnings.
+ // The problem is that "useless warnings" may occupy all the slots in the
+ // Warning_info, so "useful warnings" get rejected. In order to avoid
+ // that problem we create a Warning_info instance, which is capable of
+ // storing "unlimited" number of warnings.
+ Warning_info wi(thd->query_id, true);
+ Warning_info *wi_saved= thd->warning_info;
+
+ thd->warning_info= &wi;
+
+ bool res= table_list->schema_table->fill_table(
+ thd, table_list, join_table->select_cond);
+
+ thd->warning_info= wi_saved;
+
+ // Pass an error if any.
+
+ if (thd->stmt_da->is_error())
+ {
+ thd->warning_info->push_warning(thd,
+ thd->stmt_da->sql_errno(),
+ thd->stmt_da->get_sqlstate(),
+ MYSQL_ERROR::WARN_LEVEL_ERROR,
+ thd->stmt_da->message());
+ }
+
+ // Pass warnings (if any).
+ //
+ // Filter out warnings with WARN_LEVEL_ERROR level, because they
+ // correspond to the errors which were filtered out in fill_table().
+
+
+ List_iterator_fast<MYSQL_ERROR> it(wi.warn_list());
+ MYSQL_ERROR *err;
+
+ while ((err= it++))
+ {
+ if (err->get_level() != MYSQL_ERROR::WARN_LEVEL_ERROR)
+ thd->warning_info->push_warning(thd, err);
+ }
+
+ return res;
+}
+
+
/*
Fill temporary schema tables before SELECT
@@ -7108,7 +7334,6 @@ bool get_schema_tables_result(JOIN *join,
bool result= 0;
DBUG_ENTER("get_schema_tables_result");
- thd->no_warnings_for_error= 1;
for (JOIN_TAB *tab= join->join_tab; tab < tmp_join_tab; tab++)
{
if (!tab->table || !tab->table->pos_in_table_list)
@@ -7159,8 +7384,7 @@ bool get_schema_tables_result(JOIN *join,
else
table_list->table->file->stats.records= 0;
- if (table_list->schema_table->fill_table(thd, table_list,
- tab->select_cond))
+ if (do_fill_table(thd, table_list, tab))
{
result= 1;
join->error= 1;
@@ -7172,7 +7396,6 @@ bool get_schema_tables_result(JOIN *join,
table_list->schema_table_state= executed_place;
}
}
- thd->no_warnings_for_error= 0;
DBUG_RETURN(result);
}
@@ -7789,8 +8012,9 @@ ST_FIELD_INFO plugin_fields_info[]=
{"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},
- {"PLUGIN_MATURITY", 12, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"PLUGIN_LICENSE", 80, MYSQL_TYPE_STRING, 0, 0, "License", SKIP_OPEN_TABLE},
+ {"LOAD_OPTION", 64, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
+ {"PLUGIN_MATURITY", 12, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"PLUGIN_AUTH_VERSION", 80, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
@@ -8349,7 +8573,7 @@ bool show_create_trigger(THD *thd, const sp_name *trg_name)
Metadata locks taken during SHOW CREATE TRIGGER should be released when
the statement completes as it is an information statement.
*/
- MDL_ticket *mdl_savepoint= thd->mdl_context.mdl_savepoint();
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
/*
Open the table by name in order to load Table_triggers_list object.
@@ -8450,6 +8674,7 @@ void initialize_information_schema_acl()
&is_internal_schema_access);
}
+#ifdef WITH_PARTITION_STORAGE_ENGINE
/*
Convert a string in character set in column character set format
to utf8 character set if possible, the utf8 character set string
@@ -8541,3 +8766,4 @@ static void get_cs_converted_string_value(THD *thd,
}
return;
}
+#endif
diff --git a/sql/sql_show.h b/sql/sql_show.h
index d1323ede8c1..de8f2525baa 100644
--- a/sql/sql_show.h
+++ b/sql/sql_show.h
@@ -104,7 +104,6 @@ bool mysqld_show_storage_engines(THD *thd);
bool mysqld_show_authors(THD *thd);
bool mysqld_show_contributors(THD *thd);
bool mysqld_show_privileges(THD *thd);
-bool mysqld_show_column_types(THD *thd);
char *make_backup_log_name(char *buff, const char *name, const char* log_ext);
void calc_sum_of_all_status(STATUS_VAR *to);
void append_definer(THD *thd, String *buffer, const LEX_STRING *definer_user,
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index c5544164dbf..f6025390cb2 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -54,11 +54,33 @@ bool String::real_alloc(uint32 length)
}
-/*
-** Check that string is big enough. Set string[alloc_length] to 0
-** (for C functions)
-*/
+/**
+ Allocates a new buffer on the heap for this String.
+
+ - If the String's internal buffer is privately owned and heap allocated,
+ one of the following is performed.
+
+ - If the requested length is greater than what fits in the buffer, a new
+ buffer is allocated, data moved and the old buffer freed.
+
+ - If the requested length is less or equal to what fits in the buffer, a
+ null character is inserted at the appropriate position.
+ - If the String does not keep a private buffer on the heap, such a buffer
+ will be allocated and the string copied accoring to its length, as found
+ in String::length().
+
+ For C compatibility, the new string buffer is null terminated.
+
+ @param alloc_length The requested string size in characters, excluding any
+ null terminator.
+
+ @retval false Either the copy operation is complete or, if the size of the
+ new buffer is smaller than the currently allocated buffer (if one exists),
+ no allocation occured.
+
+ @retval true An error occured when attempting to allocate memory.
+*/
bool String::realloc(uint32 alloc_length)
{
if (Alloced_length <= alloc_length)
@@ -131,6 +153,17 @@ bool String::copy()
return FALSE;
}
+/**
+ Copies the internal buffer from str. If this String has a private heap
+ allocated buffer where new data does not fit, a new buffer is allocated
+ before copying and the old buffer freed. Character set information is also
+ copied.
+
+ @param str The string whose internal buffer is to be copied.
+
+ @retval false Success.
+ @retval true Memory allocation failed.
+*/
bool String::copy(const String &str)
{
if (alloc(str.str_length))
@@ -222,8 +255,8 @@ bool String::copy_aligned(const char *str,uint32 arg_length, uint32 offset,
CHARSET_INFO *cs)
{
/* How many bytes are in incomplete character */
- offset= cs->mbmaxlen - offset; /* How many zeros we should prepend */
- DBUG_ASSERT(offset && offset != cs->mbmaxlen);
+ offset= cs->mbminlen - offset; /* How many zeros we should prepend */
+ DBUG_ASSERT(offset && offset != cs->mbminlen);
uint32 aligned_length= arg_length + offset;
if (alloc(aligned_length))
diff --git a/sql/sql_string.h b/sql/sql_string.h
index c25a9cd8214..e5e7bfb1e0c 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -99,9 +99,13 @@ public:
}
static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
{ return (void*) alloc_root(mem_root, (uint) size); }
- static void operator delete(void *ptr_arg,size_t size)
- { TRASH(ptr_arg, size); }
- static void operator delete(void *ptr_arg, MEM_ROOT *mem_root)
+ static void operator delete(void *ptr_arg, size_t size)
+ {
+ (void) ptr_arg;
+ (void) size;
+ TRASH(ptr_arg, size);
+ }
+ static void operator delete(void *, MEM_ROOT *)
{ /* never called */ }
~String() { free(); }
@@ -117,6 +121,9 @@ public:
inline const char *ptr() const { return Ptr; }
inline char *c_ptr()
{
+ DBUG_ASSERT(!alloced || !Ptr || !Alloced_length ||
+ (Alloced_length >= (str_length + 1)));
+
if (!Ptr || Ptr[str_length]) /* Should be safe */
(void) realloc(str_length);
return Ptr;
@@ -152,6 +159,16 @@ public:
Alloced_length=0;
str_charset=str.str_charset;
}
+
+
+ /**
+ Points the internal buffer to the supplied one. The old buffer is freed.
+ @param str Pointer to the new buffer.
+ @param arg_length Length of the new buffer in characters, excluding any
+ null character.
+ @param cs Character set to use for interpreting string data.
+ @note The new buffer will not be null terminated.
+ */
inline void set(char *str,uint32 arg_length, CHARSET_INFO *cs)
{
free();
@@ -273,8 +290,12 @@ public:
CHARSET_INFO *csto, uint *errors);
bool append(const String &s);
bool append(const char *s);
- bool append(const char *s,uint32 arg_length);
- bool append(const char *s,uint32 arg_length, CHARSET_INFO *cs);
+ bool append(LEX_STRING *ls)
+ {
+ return append(ls->str, ls->length);
+ }
+ bool append(const char *s, uint32 arg_length);
+ bool append(const char *s, uint32 arg_length, CHARSET_INFO *cs);
bool append_ulonglong(ulonglong val);
bool append(IO_CACHE* file, uint32 arg_length);
bool append_with_prefill(const char *s, uint32 arg_length,
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 1a7162313f5..7d59598d606 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -22,10 +22,8 @@
#include "sql_rename.h" // do_rename
#include "sql_parse.h" // test_if_data_home_dir
#include "sql_cache.h" // query_cache_*
-#include "sql_base.h" // open_temporary_table, lock_table_names
-#include "lock.h" // wait_if_global_read_lock
- // start_waiting_global_read_lock,
- // mysql_unlock_tables
+#include "sql_base.h" // open_table_uncached, lock_table_names
+#include "lock.h" // mysql_unlock_tables
#include "strfunc.h" // find_type2, find_set
#include "sql_view.h" // view_checksum
#include "sql_truncate.h" // regenerate_locked_table
@@ -368,7 +366,11 @@ uint explain_filename(THD* thd,
Table name length.
*/
-uint filename_to_tablename(const char *from, char *to, uint to_length)
+uint filename_to_tablename(const char *from, char *to, uint to_length
+#ifndef DBUG_OFF
+ , bool stay_quiet
+#endif /* DBUG_OFF */
+ )
{
uint errors;
size_t res;
@@ -388,7 +390,13 @@ uint filename_to_tablename(const char *from, char *to, uint to_length)
{
res= (strxnmov(to, to_length, MYSQL50_TABLE_NAME_PREFIX, from, NullS) -
to);
- sql_print_error("Invalid (old?) table or database name '%s'", from);
+#ifndef DBUG_OFF
+ if (!stay_quiet) {
+#endif /* DBUG_OFF */
+ sql_print_error("Invalid (old?) table or database name '%s'", from);
+#ifndef DBUG_OFF
+ }
+#endif /* DBUG_OFF */
/*
TODO: add a stored procedure for fix table and database names,
and mention its name in error log.
@@ -1720,8 +1728,6 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
CHF_DELETE_FLAG, NULL) ||
deactivate_ddl_log_entry(part_info->frm_log_entry->entry_pos) ||
(sync_ddl_log(), FALSE) ||
-#endif
-#ifdef WITH_PARTITION_STORAGE_ENGINE
mysql_file_rename(key_file_frm,
shadow_frm_name, frm_name, MYF(MY_WME)) ||
lpt->table->file->ha_create_handler_files(path, shadow_path,
@@ -1848,64 +1854,117 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists,
{
bool error;
Drop_table_error_handler err_handler;
+ TABLE_LIST *table;
DBUG_ENTER("mysql_rm_table");
- /* mark for close and remove all cached entries */
+ /* Disable drop of enabled log tables, must be done before name locking */
+ for (table= tables; table; table= table->next_local)
+ {
+ if (check_if_log_table(table->db_length, table->db,
+ table->table_name_length, table->table_name, true))
+ {
+ my_error(ER_BAD_LOG_STATEMENT, MYF(0), "DROP");
+ DBUG_RETURN(true);
+ }
+ }
+
+ mysql_ha_rm_tables(thd, tables);
if (!drop_temporary)
{
- if (!thd->locked_tables_mode &&
- thd->global_read_lock.wait_if_global_read_lock(thd, FALSE, TRUE))
- DBUG_RETURN(TRUE);
+ if (!thd->locked_tables_mode)
+ {
+ if (lock_table_names(thd, tables, NULL, thd->variables.lock_wait_timeout,
+ MYSQL_OPEN_SKIP_TEMPORARY))
+ DBUG_RETURN(true);
+ for (table= tables; table; table= table->next_local)
+ tdc_remove_table(thd, TDC_RT_REMOVE_ALL, table->db, table->table_name,
+ false);
+ }
+ else
+ {
+ for (table= tables; table; table= table->next_local)
+ if (table->open_type != OT_BASE_ONLY &&
+ find_temporary_table(thd, table))
+ {
+ /*
+ A temporary table.
+
+ Don't try to find a corresponding MDL lock or assign it
+ to table->mdl_request.ticket. There can't be metadata
+ locks for temporary tables: they are local to the session.
+
+ Later in this function we release the MDL lock only if
+ table->mdl_requeset.ticket is not NULL. Thus here we
+ ensure that we won't release the metadata lock on the base
+ table locked with LOCK TABLES as a side effect of temporary
+ table drop.
+ */
+ DBUG_ASSERT(table->mdl_request.ticket == NULL);
+ }
+ else
+ {
+ /*
+ Not a temporary table.
+
+ Since 'tables' list can't contain duplicates (this is ensured
+ by parser) it is safe to cache pointer to the TABLE instances
+ in its elements.
+ */
+ table->table= find_table_for_mdl_upgrade(thd, table->db,
+ table->table_name, false);
+ if (!table->table)
+ DBUG_RETURN(true);
+ table->mdl_request.ticket= table->table->mdl_ticket;
+ }
+ }
}
+ /* mark for close and remove all cached entries */
thd->push_internal_handler(&err_handler);
- error= mysql_rm_table_part2(thd, tables, if_exists, drop_temporary, 0, 0);
+ error= mysql_rm_table_no_locks(thd, tables, if_exists, drop_temporary,
+ false, false);
thd->pop_internal_handler();
- if (thd->global_read_lock.has_protection())
- thd->global_read_lock.start_waiting_global_read_lock(thd);
-
if (error)
DBUG_RETURN(TRUE);
my_ok(thd);
DBUG_RETURN(FALSE);
}
-/*
- Execute the drop of a normal or temporary table
-
- SYNOPSIS
- mysql_rm_table_part2()
- thd Thread handler
- tables Tables to drop
- if_exists If set, don't give an error if table doesn't exists.
- In this case we give an warning of level 'NOTE'
- drop_temporary Only drop temporary tables
- drop_view Allow to delete VIEW .frm
- dont_log_query Don't write query to log files. This will also not
- generate warnings if the handler files doesn't exists
-
- TODO:
- When logging to the binary log, we should log
- tmp_tables and transactional tables as separate statements if we
- are in a transaction; This is needed to get these tables into the
- cached binary log that is only written on COMMIT.
-
- The current code only writes DROP statements that only uses temporary
- tables to the cache binary log. This should be ok on most cases, but
- not all.
- RETURN
- 0 ok
- 1 Error
- -1 Thread was killed
+/**
+ Execute the drop of a normal or temporary table.
+
+ @param thd Thread handler
+ @param tables Tables to drop
+ @param if_exists If set, don't give an error if table doesn't exists.
+ In this case we give an warning of level 'NOTE'
+ @param drop_temporary Only drop temporary tables
+ @param drop_view Allow to delete VIEW .frm
+ @param dont_log_query Don't write query to log files. This will also not
+ generate warnings if the handler files doesn't exists
+
+ @retval 0 ok
+ @retval 1 Error
+ @retval -1 Thread was killed
+
+ @note This function assumes that metadata locks have already been taken.
+ It is also assumed that the tables have been removed from TDC.
+
+ @todo When logging to the binary log, we should log
+ tmp_tables and transactional tables as separate statements if we
+ are in a transaction; This is needed to get these tables into the
+ cached binary log that is only written on COMMIT.
+ The current code only writes DROP statements that only uses temporary
+ tables to the cache binary log. This should be ok on most cases, but
+ not all.
*/
-int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
- bool drop_temporary, bool drop_view,
- bool dont_log_query)
+int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
+ bool drop_temporary, bool drop_view,
+ bool dont_log_query)
{
TABLE_LIST *table;
char path[FN_REFLEN + 1], *alias= NULL;
@@ -1919,7 +1978,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
bool non_tmp_table_deleted= 0;
String built_query;
String built_trans_tmp_query, built_non_trans_tmp_query;
- DBUG_ENTER("mysql_rm_table_part2");
+ DBUG_ENTER("mysql_rm_table_no_locks");
/*
Prepares the drop statements that will be written into the binary
@@ -1973,71 +2032,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
}
}
- mysql_ha_rm_tables(thd, tables);
-
- /* Disable drop of enabled log tables, must be done before name locking */
- for (table= tables; table; table= table->next_local)
- {
- if (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");
- DBUG_RETURN(1);
- }
- }
-
- if (!drop_temporary)
- {
- if (!thd->locked_tables_mode)
- {
- if (lock_table_names(thd, tables, NULL, thd->variables.lock_wait_timeout,
- MYSQL_OPEN_SKIP_TEMPORARY))
- DBUG_RETURN(1);
- for (table= tables; table; table= table->next_local)
- {
- tdc_remove_table(thd, TDC_RT_REMOVE_ALL, table->db, table->table_name,
- FALSE);
- }
- }
- else
- {
- for (table= tables; table; table= table->next_local)
- if (table->open_type != OT_BASE_ONLY &&
- find_temporary_table(thd, table->db, table->table_name))
- {
- /*
- A temporary table.
-
- Don't try to find a corresponding MDL lock or assign it
- to table->mdl_request.ticket. There can't be metadata
- locks for temporary tables: they are local to the session.
-
- Later in this function we release the MDL lock only if
- table->mdl_requeset.ticket is not NULL. Thus here we
- ensure that we won't release the metadata lock on the base
- table locked with LOCK TABLES as a side effect of temporary
- table drop.
- */
- DBUG_ASSERT(table->mdl_request.ticket == NULL);
- }
- else
- {
- /*
- Not a temporary table.
-
- Since 'tables' list can't contain duplicates (this is ensured
- by parser) it is safe to cache pointer to the TABLE instances
- in its elements.
- */
- table->table= find_table_for_mdl_upgrade(thd->open_tables, table->db,
- table->table_name, FALSE);
- if (!table->table)
- DBUG_RETURN(1);
- table->mdl_request.ticket= table->table->mdl_ticket;
- }
- }
- }
-
for (table= tables; table; table= table->next_local)
{
bool is_trans;
@@ -2050,6 +2044,16 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
table->table ? (long) table->table->s : (long) -1));
/*
+ If we are in locked tables mode and are dropping a temporary table,
+ the ticket should be NULL to ensure that we don't release a lock
+ on a base table later.
+ */
+ DBUG_ASSERT(!(thd->locked_tables_mode &&
+ table->open_type != OT_BASE_ONLY &&
+ find_temporary_table(thd, table) &&
+ table->mdl_request.ticket != NULL));
+
+ /*
drop_temporary_table may return one of the following error codes:
. 0 - a temporary table was successfully dropped.
. 1 - a temporary table was not found.
@@ -2124,6 +2128,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
table->table= 0;
}
+ /* Check that we have an exclusive lock on the table to be dropped. */
+ DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db,
+ table->table_name,
+ MDL_EXCLUSIVE));
if (thd->killed)
{
error= -1;
@@ -2166,8 +2174,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
built_query.append("`,");
}
}
- DEBUG_SYNC(thd, "rm_table_part2_before_delete_table");
- DBUG_EXECUTE_IF("sleep_before_part2_delete_table",
+ DEBUG_SYNC(thd, "rm_table_no_locks_before_delete_table");
+ DBUG_EXECUTE_IF("sleep_before_no_locks_delete_table",
my_sleep(100000););
error= 0;
if (drop_temporary ||
@@ -2254,7 +2262,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
ER(ER_BAD_TABLE_ERROR), MYF(0),
table->table_name););
}
- DEBUG_SYNC(thd, "rm_table_part2_before_binlog");
+ DEBUG_SYNC(thd, "rm_table_no_locks_before_binlog");
thd->thread_specific_used|= (trans_tmp_table_deleted ||
non_trans_tmp_table_deleted);
error= 0;
@@ -2605,7 +2613,8 @@ int prepare_create_field(Create_field *sql_field,
MAX_FIELD_CHARLENGTH)
{
my_printf_error(ER_TOO_BIG_FIELDLENGTH, ER(ER_TOO_BIG_FIELDLENGTH),
- MYF(0), sql_field->field_name, MAX_FIELD_CHARLENGTH);
+ MYF(0), sql_field->field_name,
+ static_cast<ulong>(MAX_FIELD_CHARLENGTH));
DBUG_RETURN(1);
}
}
@@ -3648,12 +3657,12 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)))
{
my_error(ER_TOO_LONG_INDEX_COMMENT, MYF(0),
- key_info->name, (uint) INDEX_COMMENT_MAXLEN);
+ key_info->name, static_cast<ulong>(INDEX_COMMENT_MAXLEN));
DBUG_RETURN(-1);
}
char warn_buff[MYSQL_ERRMSG_SIZE];
my_snprintf(warn_buff, sizeof(warn_buff), ER(ER_TOO_LONG_INDEX_COMMENT),
- key_info->name, (uint) INDEX_COMMENT_MAXLEN);
+ key_info->name, static_cast<ulong>(INDEX_COMMENT_MAXLEN));
/* do not push duplicate warnings */
if (!check_duplicate_warning(thd, warn_buff, strlen(warn_buff)))
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -3787,7 +3796,8 @@ static bool prepare_blob_field(THD *thd, Create_field *sql_field)
MODE_STRICT_ALL_TABLES)))
{
my_error(ER_TOO_BIG_FIELDLENGTH, MYF(0), sql_field->field_name,
- MAX_FIELD_VARCHARLENGTH / sql_field->charset->mbmaxlen);
+ static_cast<ulong>(MAX_FIELD_VARCHARLENGTH /
+ sql_field->charset->mbmaxlen));
DBUG_RETURN(1);
}
sql_field->sql_type= MYSQL_TYPE_BLOB;
@@ -3865,6 +3875,46 @@ void sp_prepare_create_field(THD *thd, Create_field *sql_field)
(void) prepare_blob_field(thd, sql_field);
}
+
+/**
+ Auxiliary function which allows to check if freshly created .FRM
+ file for table can be opened.
+
+ @retval FALSE - Success.
+ @retval TRUE - Failure.
+*/
+
+static bool check_if_created_table_can_be_opened(THD *thd,
+ const char *path,
+ const char *db,
+ const char *table_name,
+ HA_CREATE_INFO *create_info,
+ handler *file)
+{
+ TABLE table;
+ TABLE_SHARE share;
+ bool result;
+
+ /*
+ It is impossible to open definition of partitioned table without .par file.
+ */
+ if (file->ha_create_handler_files(path, NULL, CHF_CREATE_FLAG, create_info))
+ return TRUE;
+
+ init_tmp_table_share(thd, &share, db, 0, table_name, path);
+
+ result= (open_table_def(thd, &share, 0) ||
+ open_table_from_share(thd, &share, "", 0, (uint) READ_ALL,
+ 0, &table, TRUE));
+ if (! result)
+ (void) closefrm(&table, 0);
+
+ free_table_share(&share);
+ (void) file->ha_create_handler_files(path, NULL, CHF_DELETE_FLAG, create_info);
+ return result;
+}
+
+
/*
Create a table
@@ -4282,9 +4332,14 @@ bool mysql_create_table_no_lock(THD *thd,
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
{
- TABLE *table= NULL;
- /* Open table and put in temporary table list */
- if (!(table= open_temporary_table(thd, path, db, table_name, 1)))
+ /*
+ Open a table (skipping table cache) and add it into
+ THD::temporary_tables list.
+ */
+
+ TABLE *table= open_table_uncached(thd, path, db, table_name, TRUE);
+
+ if (!table)
{
(void) rm_temporary_table(create_info->db_type, path);
goto err;
@@ -4295,6 +4350,29 @@ bool mysql_create_table_no_lock(THD *thd,
thd->thread_specific_used= TRUE;
}
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ else if (part_info && create_info->frm_only)
+ {
+ /*
+ For partitioned tables we can't find some problems with table
+ until table is opened. Therefore in order to disallow creation
+ of corrupted tables we have to try to open table as the part
+ of its creation process.
+ In cases when both .FRM and SE part of table are created table
+ is implicitly open in ha_create_table() call.
+ In cases when we create .FRM without SE part we have to open
+ table explicitly.
+ */
+ if (check_if_created_table_can_be_opened(thd, path, db, table_name,
+ create_info, file))
+ {
+ char frm_name[FN_REFLEN];
+ strxmov(frm_name, path, reg_ext, NullS);
+ (void) mysql_file_delete(key_file_frm, frm_name, MYF(0));
+ goto err;
+ }
+ }
+#endif
error= FALSE;
err:
@@ -4561,6 +4639,11 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
local_create_info.options|= create_info->options & HA_LEX_CREATE_TMP_TABLE;
/* Reset auto-increment counter for the new table. */
local_create_info.auto_increment_value= 0;
+ /*
+ Do not inherit values of DATA and INDEX DIRECTORY options from
+ the original table. This is documented behavior.
+ */
+ local_create_info.data_file_name= local_create_info.index_file_name= NULL;
if ((res= mysql_create_table_no_lock(thd, table->db, table->table_name,
&local_create_info, &local_alter_info,
@@ -4726,7 +4809,7 @@ err:
@details Checks if any index is being modified (present as both DROP INDEX
and ADD INDEX) in the current ALTER TABLE statement. Needed for disabling
- online ALTER TABLE.
+ in-place ALTER TABLE.
@param table The table being altered
@param alter_info The ALTER TABLE structure
@@ -4843,7 +4926,7 @@ mysql_compare_tables(TABLE *table,
like to keep mysql_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
+ to evaluate possibility of in-place ALTER TABLE, and then
destroy the copy.
*/
Alter_info tmp_alter_info(*alter_info, thd->mem_root);
@@ -4887,9 +4970,9 @@ mysql_compare_tables(TABLE *table,
There was a bug prior to mysql-4.0.25. Number of null fields was
calculated incorrectly. As a result frm and data files gets out of
- sync after fast alter table. There is no way to determine by which
+ sync after in-place alter table. There is no way to determine by which
mysql version (in 4.0 and 4.1 branches) table was created, thus we
- disable fast alter table for all tables created by mysql versions
+ disable in-place alter table for all tables created by mysql versions
prior to 5.0 branch.
See BUG#6236.
*/
@@ -4920,7 +5003,7 @@ mysql_compare_tables(TABLE *table,
DBUG_RETURN(1);
/*
- Use transformed info to evaluate possibility of fast ALTER TABLE
+ Use transformed info to evaluate possibility of in-place ALTER TABLE
but use the preserved field to persist modifications.
*/
new_field_it.init(alter_info->create_list);
@@ -5230,7 +5313,7 @@ blob_length_by_type(enum_field_types type)
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
+ perform ALTER TABLE via a temporary table -- i.e. in-place 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.
@@ -5308,17 +5391,6 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
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 + 1));
- /*
- 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_info->option_list= merge_engine_table_options(table->s->option_list,
@@ -5706,7 +5778,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
TABLE *table, *new_table= 0;
MDL_ticket *mdl_ticket;
MDL_request target_mdl_request;
- bool has_target_mdl_lock= FALSE;
int error= 0;
char tmp_name[80],old_name[32],new_name_buff[FN_REFLEN + 1];
char new_alias_buff[FN_REFLEN], *table_name, *db, *new_alias, *alias;
@@ -5717,7 +5788,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
handlerton *old_db_type, *new_db_type, *save_old_db_type;
enum_alter_table_change_level need_copy_table= ALTER_TABLE_METADATA_ONLY;
#ifdef WITH_PARTITION_STORAGE_ENGINE
- uint fast_alter_partition= 0;
+ TABLE *table_for_fast_alter_partition= NULL;
bool partition_changed= FALSE;
#endif
bool need_lock_for_indexes= TRUE;
@@ -5725,6 +5796,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
uint index_drop_count= 0;
uint *index_drop_buffer= NULL;
uint index_add_count= 0;
+ handler_add_index *add= NULL;
+ bool pending_inplace_add_index= false;
uint *index_add_buffer= NULL;
uint candidate_key_count= 0;
bool no_pk;
@@ -5872,7 +5945,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
else
{
target_mdl_request.init(MDL_key::TABLE, new_db, new_name,
- MDL_EXCLUSIVE);
+ MDL_EXCLUSIVE, MDL_TRANSACTION);
/*
Global intention exclusive lock must have been already acquired when
table to be altered was open, so there is no need to do it here.
@@ -5890,7 +5963,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
DBUG_RETURN(TRUE);
}
DEBUG_SYNC(thd, "locked_table_name");
- has_target_mdl_lock= TRUE;
/*
Table maybe does not exist, but we got an exclusive lock
on the name, now we can safely try to find out for sure.
@@ -6037,7 +6109,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
*fn_ext(new_name)=0;
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,
+ else if (Table_triggers_list::change_table_name(thd, db,
+ alias, table_name,
new_db, new_alias))
{
(void) mysql_rename_table(old_db_type, new_db, new_alias, db,
@@ -6078,10 +6151,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
along with the implicit commit.
*/
if (new_name != table_name || new_db != db)
- {
- thd->mdl_context.release_lock(target_mdl_request.ticket);
thd->mdl_context.release_all_locks_for_name(mdl_ticket);
- }
else
mdl_ticket->downgrade_exclusive_lock(MDL_SHARED_NO_READ_WRITE);
}
@@ -6092,7 +6162,9 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (prep_alter_part_table(thd, table, alter_info, create_info, old_db_type,
- &partition_changed, &fast_alter_partition))
+ &partition_changed,
+ db, table_name, path,
+ &table_for_fast_alter_partition))
goto err;
#endif
/*
@@ -6154,7 +6226,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
/*
- If there are index changes only, try to do them online. "Index
+ If there are index changes only, try to do them in-place. "Index
changes only" means also that the handler for the table does not
change. The table is open and locked. The handler can be accessed.
*/
@@ -6162,8 +6234,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
{
int pk_changed= 0;
ulong alter_flags= 0;
- ulong needed_online_flags= 0;
- ulong needed_fast_flags= 0;
+ ulong needed_inplace_with_read_flags= 0;
+ ulong needed_inplace_flags= 0;
KEY *key;
uint *idx_p;
uint *idx_end_p;
@@ -6187,8 +6259,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
{
DBUG_PRINT("info", ("Dropping primary key"));
/* Primary key. */
- needed_online_flags|= HA_ONLINE_DROP_PK_INDEX;
- needed_fast_flags|= HA_ONLINE_DROP_PK_INDEX_NO_WRITES;
+ needed_inplace_with_read_flags|= HA_INPLACE_DROP_PK_INDEX_NO_WRITE;
+ needed_inplace_flags|= HA_INPLACE_DROP_PK_INDEX_NO_READ_WRITE;
pk_changed++;
candidate_key_count--;
}
@@ -6198,8 +6270,9 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
bool is_candidate_key= true;
/* Non-primary unique key. */
- needed_online_flags|= HA_ONLINE_DROP_UNIQUE_INDEX;
- needed_fast_flags|= HA_ONLINE_DROP_UNIQUE_INDEX_NO_WRITES;
+ needed_inplace_with_read_flags|=
+ HA_INPLACE_DROP_UNIQUE_INDEX_NO_WRITE;
+ needed_inplace_flags|= HA_INPLACE_DROP_UNIQUE_INDEX_NO_READ_WRITE;
/*
Check if all fields in key are declared
@@ -6218,12 +6291,13 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
else
{
/* Non-unique key. */
- needed_online_flags|= HA_ONLINE_DROP_INDEX;
- needed_fast_flags|= HA_ONLINE_DROP_INDEX_NO_WRITES;
+ needed_inplace_with_read_flags|= HA_INPLACE_DROP_INDEX_NO_WRITE;
+ needed_inplace_flags|= HA_INPLACE_DROP_INDEX_NO_READ_WRITE;
}
}
no_pk= ((table->s->primary_key == MAX_KEY) ||
- (needed_online_flags & HA_ONLINE_DROP_PK_INDEX));
+ (needed_inplace_with_read_flags &
+ HA_INPLACE_DROP_PK_INDEX_NO_WRITE));
/* Check added indexes. */
for (idx_p= index_add_buffer, idx_end_p= idx_p + index_add_count;
idx_p < idx_end_p;
@@ -6261,57 +6335,59 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
{
DBUG_PRINT("info", ("Adding primary key"));
/* Primary key. */
- needed_online_flags|= HA_ONLINE_ADD_PK_INDEX;
- needed_fast_flags|= HA_ONLINE_ADD_PK_INDEX_NO_WRITES;
+ needed_inplace_with_read_flags|= HA_INPLACE_ADD_PK_INDEX_NO_WRITE;
+ needed_inplace_flags|= HA_INPLACE_ADD_PK_INDEX_NO_READ_WRITE;
pk_changed++;
no_pk= false;
}
else
{
/* Non-primary unique key. */
- needed_online_flags|= HA_ONLINE_ADD_UNIQUE_INDEX;
- needed_fast_flags|= HA_ONLINE_ADD_UNIQUE_INDEX_NO_WRITES;
+ needed_inplace_with_read_flags|= HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE;
+ needed_inplace_flags|= HA_INPLACE_ADD_UNIQUE_INDEX_NO_READ_WRITE;
}
}
else
{
/* Non-unique key. */
- needed_online_flags|= HA_ONLINE_ADD_INDEX;
- needed_fast_flags|= HA_ONLINE_ADD_INDEX_NO_WRITES;
+ needed_inplace_with_read_flags|= HA_INPLACE_ADD_INDEX_NO_WRITE;
+ needed_inplace_flags|= HA_INPLACE_ADD_INDEX_NO_READ_WRITE;
}
}
- if ((candidate_key_count > 0) &&
- (needed_online_flags & HA_ONLINE_DROP_PK_INDEX))
+ if ((candidate_key_count > 0) &&
+ (needed_inplace_with_read_flags & HA_INPLACE_DROP_PK_INDEX_NO_WRITE))
{
/*
Dropped primary key when there is some other unique
not null key that should be converted to primary key
*/
- needed_online_flags|= HA_ONLINE_ADD_PK_INDEX;
- needed_fast_flags|= HA_ONLINE_ADD_PK_INDEX_NO_WRITES;
+ needed_inplace_with_read_flags|= HA_INPLACE_ADD_PK_INDEX_NO_WRITE;
+ needed_inplace_flags|= HA_INPLACE_ADD_PK_INDEX_NO_READ_WRITE;
pk_changed= 2;
}
- DBUG_PRINT("info", ("needed_online_flags: 0x%lx, needed_fast_flags: 0x%lx",
- needed_online_flags, needed_fast_flags));
+ DBUG_PRINT("info",
+ ("needed_inplace_with_read_flags: 0x%lx, needed_inplace_flags: 0x%lx",
+ needed_inplace_with_read_flags, needed_inplace_flags));
/*
- Online or fast add/drop index is possible only if
+ In-place add/drop index is possible only if
the primary key is not added and dropped in the same statement.
Otherwise we have to recreate the table.
need_copy_table is no-zero at this place.
*/
if ( pk_changed < 2 )
{
- if ((alter_flags & needed_online_flags) == needed_online_flags)
+ if ((alter_flags & needed_inplace_with_read_flags) ==
+ needed_inplace_with_read_flags)
{
- /* All required online flags are present. */
+ /* All required in-place flags to allow concurrent reads are present. */
need_copy_table= ALTER_TABLE_METADATA_ONLY;
need_lock_for_indexes= FALSE;
}
- else if ((alter_flags & needed_fast_flags) == needed_fast_flags)
+ else if ((alter_flags & needed_inplace_flags) == needed_inplace_flags)
{
- /* All required fast flags are present. */
+ /* All required in-place flags are present. */
need_copy_table= ALTER_TABLE_METADATA_ONLY;
}
}
@@ -6328,12 +6404,12 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
create_info->frm_only= 1;
#ifdef WITH_PARTITION_STORAGE_ENGINE
- if (fast_alter_partition)
+ if (table_for_fast_alter_partition)
{
DBUG_RETURN(fast_alter_partition_table(thd, table, alter_info,
create_info, table_list,
db, table_name,
- fast_alter_partition));
+ table_for_fast_alter_partition));
}
#endif
@@ -6428,8 +6504,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
/* table is a normal table: Create temporary table in same directory */
build_table_filename(path, sizeof(path) - 1, new_db, tmp_name, "",
FN_IS_TMP);
- /* Open our intermediate table */
- new_table= open_temporary_table(thd, path, new_db, tmp_name, 1);
+ /* Open our intermediate table. */
+ new_table= open_table_uncached(thd, path, new_db, tmp_name, TRUE);
}
if (!new_table)
goto err_new_table_cleanup;
@@ -6465,10 +6541,18 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
else
{
+ /*
+ Ensure that we will upgrade the metadata lock if
+ handler::enable/disable_indexes() will be called.
+ */
+ if (alter_info->keys_onoff != LEAVE_AS_IS ||
+ table->file->indexes_are_disabled())
+ need_lock_for_indexes= true;
if (!table->s->tmp_table &&
wait_while_table_is_used(thd, table, extra_func))
goto err_new_table_cleanup;
thd_proc_info(thd, "manage keys");
+ DEBUG_SYNC(thd, "alter_table_manage_keys");
alter_table_manage_keys(table, table->file->indexes_are_disabled(),
alter_info->keys_onoff);
error= trans_commit_stmt(thd);
@@ -6477,6 +6561,9 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
+ if (error)
+ goto err_new_table_cleanup;
+
/* If we did not need to copy, we might still need to add/drop indexes. */
if (! new_table)
{
@@ -6508,7 +6595,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
key_part->field= table->field[key_part->fieldnr];
}
/* Add the indexes. */
- if ((error= table->file->add_index(table, key_info, index_add_count)))
+ if ((error= table->file->add_index(table, key_info, index_add_count,
+ &add)))
{
#ifdef MERGE_MONTY_ADDITION_THAT_BREAKS_5_5_TESTS
/* Only report error if handler has not already reported an error */
@@ -6526,11 +6614,27 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
goto err_new_table_cleanup;
}
+ pending_inplace_add_index= true;
}
/*end of if (index_add_count)*/
if (index_drop_count)
{
+ /* Currently we must finalize add index if we also drop indexes */
+ if (pending_inplace_add_index)
+ {
+ /* Committing index changes needs exclusive metadata lock. */
+ DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE,
+ table_list->db,
+ table_list->table_name,
+ MDL_EXCLUSIVE));
+ if ((error= table->file->final_add_index(add, true)))
+ {
+ table->file->print_error(error, MYF(0));
+ goto err_new_table_cleanup;
+ }
+ pending_inplace_add_index= false;
+ }
/* 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;
@@ -6571,11 +6675,14 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
/*end of if (! new_table) for add/drop index*/
- if (error)
- goto err_new_table_cleanup;
-
if (table->s->tmp_table != NO_TMP_TABLE)
{
+ /*
+ In-place operations are not supported for temporary tables, so
+ we don't have to call final_add_index() in this case. The assert
+ verifies that in-place add index has not been done.
+ */
+ DBUG_ASSERT(!pending_inplace_add_index);
/* Close lock if this is a transactional table */
if (thd->lock)
{
@@ -6642,8 +6749,30 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
my_casedn_str(files_charset_info, old_name);
if (wait_while_table_is_used(thd, table, HA_EXTRA_PREPARE_FOR_RENAME))
+ {
+ if (pending_inplace_add_index)
+ {
+ pending_inplace_add_index= false;
+ table->file->final_add_index(add, false);
+ }
+ // Mark this TABLE instance as stale to avoid out-of-sync index information.
+ table->m_needs_reopen= true;
goto err_new_table_cleanup;
-
+ }
+ if (pending_inplace_add_index)
+ {
+ pending_inplace_add_index= false;
+ DBUG_EXECUTE_IF("alter_table_rollback_new_index", {
+ table->file->final_add_index(add, false);
+ my_error(ER_UNKNOWN_ERROR, MYF(0));
+ goto err_new_table_cleanup;
+ });
+ if ((error= table->file->final_add_index(add, true)))
+ {
+ table->file->print_error(error, MYF(0));
+ goto err_new_table_cleanup;
+ }
+ }
close_all_tables_for_name(thd, table->s,
new_name != table_name || new_db != db);
@@ -6680,11 +6809,11 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
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 != 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,
- new_db, new_alias)))
+ (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, alias, table_name,
+ new_db, new_alias)))
{
/* Try to get everything back. */
error=1;
@@ -6711,15 +6840,15 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
NO need to tamper with MERGE tables. The real open is done later.
*/
Open_table_context ot_ctx(thd, MYSQL_OPEN_REOPEN);
- TABLE *t_table;
+ TABLE_LIST temp_table_list;
+ TABLE_LIST *t_table_list;
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->mdl_request.ticket= target_mdl_request.ticket;
+ temp_table_list.init_one_table(new_db, strlen(new_db),
+ new_name, strlen(new_name),
+ new_name, TL_READ_NO_INSERT);
+ temp_table_list.mdl_request.ticket= target_mdl_request.ticket;
+ t_table_list= &temp_table_list;
}
else
{
@@ -6729,20 +6858,21 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
to request the lock.
*/
table_list->mdl_request.ticket= mdl_ticket;
+ t_table_list= table_list;
}
- if (open_table(thd, table_list, thd->mem_root, &ot_ctx))
+ if (open_table(thd, t_table_list, thd->mem_root, &ot_ctx))
{
goto err_with_mdl;
}
- t_table= table_list->table;
/* Tell the handler that a new frm file is in place. */
- error= t_table->file->ha_create_handler_files(path, NULL, CHF_INDEX_FLAG,
- create_info);
+ error= t_table_list->table->file->ha_create_handler_files(path, NULL,
+ CHF_INDEX_FLAG,
+ create_info);
- DBUG_ASSERT(thd->open_tables == t_table);
+ DBUG_ASSERT(thd->open_tables == t_table_list->table);
close_thread_table(thd, &thd->open_tables);
- table_list->table= 0;
+ t_table_list->table= NULL;
if (error)
goto err_with_mdl;
@@ -6772,10 +6902,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
thd->locked_tables_mode == LTM_PRELOCKED_UNDER_LOCK_TABLES)
{
if ((new_name != table_name || new_db != db))
- {
- thd->mdl_context.release_lock(target_mdl_request.ticket);
thd->mdl_context.release_all_locks_for_name(mdl_ticket);
- }
else
mdl_ticket->downgrade_exclusive_lock(MDL_SHARED_NO_READ_WRITE);
}
@@ -6798,6 +6925,11 @@ err_new_table_cleanup:
create_info->frm_only ? FN_IS_TMP | FRM_ONLY : FN_IS_TMP);
err:
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ /* If prep_alter_part_table created an intermediate table, destroy it. */
+ if (table_for_fast_alter_partition)
+ close_temporary(table_for_fast_alter_partition, 1, 0);
+#endif /* WITH_PARTITION_STORAGE_ENGINE */
/*
No default value was provided for a DATE/DATETIME field, the
current sql_mode doesn't allow the '0000-00-00' value and
@@ -6831,8 +6963,6 @@ err:
alter_info->datetime_field->field_name);
thd->abort_on_warning= save_abort_on_warning;
}
- if (has_target_mdl_lock)
- thd->mdl_context.release_lock(target_mdl_request.ticket);
DBUG_RETURN(TRUE);
@@ -6844,9 +6974,6 @@ err_with_mdl:
tables and release the exclusive metadata lock.
*/
thd->locked_tables_list.unlink_all_closed_tables(thd, NULL, 0);
- if (has_target_mdl_lock)
- thd->mdl_context.release_lock(target_mdl_request.ticket);
-
thd->mdl_context.release_all_locks_for_name(mdl_ticket);
DBUG_RETURN(TRUE);
}
diff --git a/sql/sql_table.h b/sql/sql_table.h
index a2df9ee7572..9d2f246dbf5 100644
--- a/sql/sql_table.h
+++ b/sql/sql_table.h
@@ -119,7 +119,11 @@ enum enum_explain_filename_mode
#define NO_FRM_RENAME (1 << 2)
#define FRM_ONLY (1 << 3)
-uint filename_to_tablename(const char *from, char *to, uint to_length);
+uint filename_to_tablename(const char *from, char *to, uint to_length
+#ifndef DBUG_OFF
+ , bool stay_quiet = false
+#endif /* DBUG_OFF */
+ );
uint tablename_to_filename(const char *from, char *to, uint to_length);
uint check_n_cut_mysql50_prefix(const char *from, char *to, uint to_length);
bool check_mysql50_prefix(const char *name);
@@ -170,8 +174,9 @@ bool mysql_checksum_table(THD* thd, TABLE_LIST* table_list,
HA_CHECK_OPT* check_opt);
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_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
+ 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);
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 26bc59a5886..756046ebc96 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2005 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -24,14 +24,14 @@
#include "parse_file.h"
#include "sp.h"
#include "sql_base.h" // find_temporary_table
-#include "lock.h" // wait_if_global_read_lock,
- // start_waiting_global_read_lock
#include "sql_show.h" // append_definer, append_identifier
#include "sql_table.h" // build_table_filename,
// check_n_cut_mysql50_prefix
#include "sql_db.h" // get_default_db_collation
#include "sql_acl.h" // *_ACL, is_acl_user
#include "sql_handler.h" // mysql_ha_rm_tables
+#include "sp_cache.h" // sp_invalidate_cache
+#include <mysys_err.h>
/*************************************************************************/
@@ -306,6 +306,55 @@ private:
/**
+ An error handler that catches all non-OOM errors which can occur during
+ parsing of trigger body. Such errors are ignored and corresponding error
+ message is used to construct a more verbose error message which contains
+ name of problematic trigger. This error message is later emitted when
+ one tries to perform DML or some of DDL on this table.
+ Also, if possible, grabs name of the trigger being parsed so it can be
+ used to correctly drop problematic trigger.
+*/
+class Deprecated_trigger_syntax_handler : public Internal_error_handler
+{
+private:
+
+ char m_message[MYSQL_ERRMSG_SIZE];
+ LEX_STRING *m_trigger_name;
+
+public:
+
+ Deprecated_trigger_syntax_handler() : m_trigger_name(NULL) {}
+
+ virtual bool handle_condition(THD *thd,
+ uint sql_errno,
+ const char* sqlstate,
+ MYSQL_ERROR::enum_warning_level level,
+ const char* message,
+ MYSQL_ERROR ** cond_hdl)
+ {
+ if (sql_errno != EE_OUTOFMEMORY &&
+ sql_errno != ER_OUT_OF_RESOURCES)
+ {
+ if(thd->lex->spname)
+ m_trigger_name= &thd->lex->spname->m_name;
+ if (m_trigger_name)
+ my_snprintf(m_message, sizeof(m_message),
+ ER(ER_ERROR_IN_TRIGGER_BODY),
+ m_trigger_name->str, message);
+ else
+ my_snprintf(m_message, sizeof(m_message),
+ ER(ER_ERROR_IN_UNKNOWN_TRIGGER_BODY), message);
+ return true;
+ }
+ return false;
+ }
+
+ LEX_STRING *get_trigger_name() { return m_trigger_name; }
+ char *get_error_message() { return m_message; }
+};
+
+
+/**
Create or drop trigger for table.
@param thd current thread context (including trigger definition in LEX)
@@ -391,15 +440,6 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
DBUG_RETURN(TRUE);
}
- /*
- We don't want perform our operations while global read lock is held
- so we have to wait until its end and then prevent it from occurring
- again until we are done, unless we are under lock tables.
- */
- if (!thd->locked_tables_mode &&
- thd->global_read_lock.wait_if_global_read_lock(thd, FALSE, TRUE))
- DBUG_RETURN(TRUE);
-
if (!create)
{
bool if_exists= thd->lex->drop_if_exists;
@@ -458,7 +498,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
DBUG_ASSERT(tables->next_global == 0);
/* We do not allow creation of triggers on temporary tables. */
- if (create && find_temporary_table(thd, tables->db, tables->table_name))
+ if (create && find_temporary_table(thd, tables))
{
my_error(ER_TRG_ON_VIEW_OR_TEMP_TABLE, MYF(0), tables->alias);
goto end;
@@ -478,8 +518,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
if (thd->locked_tables_mode)
{
/* Under LOCK TABLES we must only accept write locked tables. */
- if (!(tables->table= find_table_for_mdl_upgrade(thd->open_tables,
- tables->db,
+ if (!(tables->table= find_table_for_mdl_upgrade(thd, tables->db,
tables->table_name,
FALSE)))
goto end;
@@ -530,6 +569,12 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
if (thd->locked_tables_list.reopen_tables(thd))
thd->clear_error();
+ /*
+ Invalidate SP-cache. That's needed because triggers may change list of
+ pre-locking tables.
+ */
+ sp_cache_invalidate();
+
end:
if (!result)
{
@@ -548,9 +593,6 @@ end:
if (!create)
thd->lex->restore_backup_query_tables_list(&backup);
- if (thd->global_read_lock.has_protection())
- thd->global_read_lock.start_waiting_global_read_lock(thd);
-
if (!result)
my_ok(thd);
@@ -600,6 +642,8 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables,
LEX_STRING *trg_connection_cl_name;
LEX_STRING *trg_db_cl_name;
+ if (check_for_broken_triggers())
+ return true;
/* Trigger must be in the same schema as target table. */
if (my_strcasecmp(table_alias_charset, table->s->db.str,
@@ -873,7 +917,7 @@ static bool rm_trigger_file(char *path, const char *db,
@param path char buffer of size FN_REFLEN to be used
for constructing path to .TRN file.
@param db trigger's database name
- @param table_name trigger's name
+ @param trigger_name trigger's name
@retval
False success
@@ -1234,13 +1278,12 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
DBUG_RETURN(1); // EOM
}
-
- if (!thd->no_warnings_for_error)
- 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);
+
+ 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)) ||
@@ -1339,12 +1382,11 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
lex_start(thd);
thd->spcont= NULL;
- if (parse_sql(thd, & parser_state, creation_ctx))
- {
- /* Currently sphead is always deleted in case of a parse error */
- DBUG_ASSERT(lex.sphead == 0);
- goto err_with_lex_cleanup;
- }
+ Deprecated_trigger_syntax_handler error_handler;
+ thd->push_internal_handler(&error_handler);
+ bool parse_error= parse_sql(thd, & parser_state, creation_ctx);
+ thd->pop_internal_handler();
+
/*
Not strictly necessary to invoke this method here, since we know
that we've parsed CREATE TRIGGER and not an
@@ -1355,6 +1397,54 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
*/
lex.set_trg_event_type_for_tables();
+ if (parse_error)
+ {
+ if (!triggers->m_has_unparseable_trigger)
+ triggers->set_parse_error_message(error_handler.get_error_message());
+ /* Currently sphead is always set to NULL in case of a parse error */
+ DBUG_ASSERT(lex.sphead == 0);
+ if (error_handler.get_trigger_name())
+ {
+ LEX_STRING *trigger_name;
+ const LEX_STRING *orig_trigger_name= error_handler.get_trigger_name();
+
+ if (!(trigger_name= alloc_lex_string(&table->mem_root)) ||
+ !(trigger_name->str= strmake_root(&table->mem_root,
+ orig_trigger_name->str,
+ orig_trigger_name->length)))
+ goto err_with_lex_cleanup;
+
+ trigger_name->length= orig_trigger_name->length;
+
+ if (triggers->names_list.push_back(trigger_name,
+ &table->mem_root))
+ goto err_with_lex_cleanup;
+ }
+ else
+ {
+ /*
+ The Table_triggers_list is not constructed as a list of
+ trigger objects as one would expect, but rather of lists of
+ properties of equal length. Thus, even if we don't get the
+ trigger name, we still fill all in all the lists with
+ placeholders as we might otherwise create a skew in the
+ lists. Obviously, this has to be refactored.
+ */
+ LEX_STRING *empty= alloc_lex_string(&table->mem_root);
+ if (!empty)
+ goto err_with_lex_cleanup;
+
+ empty->str= const_cast<char*>("");
+ empty->length= 0;
+ if (triggers->names_list.push_back(empty, &table->mem_root))
+ goto err_with_lex_cleanup;
+ }
+ lex_end(&lex);
+ continue;
+ }
+
+ lex.sphead->set_info(0, 0, &lex.sp_chistics, (ulong) *trg_sql_mode);
+
int event= lex.trg_chistics.event;
int action_time= lex.trg_chistics.action_time;
@@ -1371,12 +1461,12 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
MySQL, which does not support triggers definers. We should emit
warning here.
*/
- if (!thd->no_warnings_for_error)
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_TRG_NO_DEFINER, ER(ER_TRG_NO_DEFINER),
- (const char*) db,
- (const char*) sp->m_name.str);
-
+
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TRG_NO_DEFINER, ER(ER_TRG_NO_DEFINER),
+ (const char*) db,
+ (const char*) sp->m_name.str);
+
/*
Set definer to the '' to correct displaying in the information
schema.
@@ -1421,9 +1511,8 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
char fname[SAFE_NAME_LEN + 1];
DBUG_ASSERT((!my_strcasecmp(table_alias_charset, lex.query_tables->db, db) ||
(check_n_cut_mysql50_prefix(db, fname, sizeof(fname)) &&
- !my_strcasecmp(table_alias_charset, lex.query_tables->db, fname))) &&
- (!my_strcasecmp(table_alias_charset, lex.query_tables->table_name,
- table_name) ||
+ !my_strcasecmp(table_alias_charset, lex.query_tables->db, fname))));
+ DBUG_ASSERT((!my_strcasecmp(table_alias_charset, lex.query_tables->table_name, table_name) ||
(check_n_cut_mysql50_prefix(table_name, fname, sizeof(fname)) &&
!my_strcasecmp(table_alias_charset, lex.query_tables->table_name, fname))));
#endif
@@ -1705,6 +1794,13 @@ bool Table_triggers_list::drop_all_triggers(THD *thd, char *db, char *name)
while ((trigger= it_name++))
{
+ /*
+ Trigger, which body we failed to parse during call
+ Table_triggers_list::check_n_load(), might be missing name.
+ Such triggers have zero-length name and are skipped here.
+ */
+ if (trigger->length == 0)
+ continue;
if (rm_trigname_file(path, db, trigger->str))
{
/*
@@ -1875,6 +1971,7 @@ Table_triggers_list::change_table_name_in_trignames(const char *old_db_name,
@param[in,out] thd Thread context
@param[in] db Old database of subject table
+ @param[in] old_alias Old alias 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
@@ -1891,6 +1988,7 @@ Table_triggers_list::change_table_name_in_trignames(const char *old_db_name,
*/
bool Table_triggers_list::change_table_name(THD *thd, const char *db,
+ const char *old_alias,
const char *old_table,
const char *new_db,
const char *new_table)
@@ -1912,7 +2010,7 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
MDL_EXCLUSIVE));
DBUG_ASSERT(my_strcasecmp(table_alias_charset, db, new_db) ||
- my_strcasecmp(table_alias_charset, old_table, new_table));
+ my_strcasecmp(table_alias_charset, old_alias, new_table));
if (Table_triggers_list::check_n_load(thd, db, old_table, &table, TRUE))
{
@@ -1921,7 +2019,12 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db,
}
if (table.triggers)
{
- LEX_STRING old_table_name= { (char *) old_table, strlen(old_table) };
+ if (table.triggers->check_for_broken_triggers())
+ {
+ result= 1;
+ goto end;
+ }
+ LEX_STRING old_table_name= { (char *) old_alias, strlen(old_alias) };
LEX_STRING new_table_name= { (char *) new_table, strlen(new_table) };
/*
Since triggers should be in the same schema as their subject tables
@@ -2009,6 +2112,9 @@ bool Table_triggers_list::process_triggers(THD *thd,
sp_head *sp_trigger= bodies[event][time_type];
SELECT_LEX *save_current_select;
+ if (check_for_broken_triggers())
+ return true;
+
if (sp_trigger == NULL)
return FALSE;
@@ -2143,6 +2249,22 @@ void Table_triggers_list::mark_fields_used(trg_event_type event)
/**
+ Signals to the Table_triggers_list that a parse error has occured when
+ reading a trigger from file. This makes the Table_triggers_list enter an
+ error state flagged by m_has_unparseable_trigger == true. The error message
+ will be used whenever a statement invoking or manipulating triggers is
+ issued against the Table_triggers_list's table.
+
+ @param error_message The error message thrown by the parser.
+ */
+void Table_triggers_list::set_parse_error_message(char *error_message)
+{
+ m_has_unparseable_trigger= true;
+ strcpy(m_parse_error_message, error_message);
+}
+
+
+/**
Trigger BUG#14090 compatibility hook.
@param[in,out] unknown_key reference on the line with unknown
diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h
index 28bf0a60877..c98f5d72a58 100644
--- a/sql/sql_trigger.h
+++ b/sql/sql_trigger.h
@@ -97,6 +97,27 @@ class Table_triggers_list: public Sql_alloc
*/
GRANT_INFO subject_table_grants[TRG_EVENT_MAX][TRG_ACTION_MAX];
+ /**
+ This flag indicates that one of the triggers was not parsed successfully,
+ and as a precaution the object has entered a state where all trigger
+ access results in errors until all such triggers are dropped. It is not
+ safe to add triggers since we don't know if the broken trigger has the
+ same name or event type. Nor is it safe to invoke any trigger for the
+ aforementioned reasons. The only safe operations are drop_trigger and
+ drop_all_triggers.
+
+ @see Table_triggers_list::set_parse_error
+ */
+ bool m_has_unparseable_trigger;
+
+ /**
+ This error will be displayed when the user tries to manipulate or invoke
+ triggers on a table that has broken triggers. It will get set only once
+ per statement and thus will contain the first parse error encountered in
+ the trigger file.
+ */
+ char m_parse_error_message[MYSQL_ERRMSG_SIZE];
+
public:
/**
Field responsible for storing triggers definitions in file.
@@ -118,8 +139,9 @@ public:
/* End of character ser context. */
- Table_triggers_list(TABLE *table_arg):
- record1_field(0), trigger_table(table_arg)
+ Table_triggers_list(TABLE *table_arg)
+ :record1_field(0), trigger_table(table_arg),
+ m_has_unparseable_trigger(false)
{
bzero((char *)bodies, sizeof(bodies));
bzero((char *)trigger_fields, sizeof(trigger_fields));
@@ -157,6 +179,7 @@ public:
TABLE *table, bool names_only);
static bool drop_all_triggers(THD *thd, char *db, char *table_name);
static bool change_table_name(THD *thd, const char *db,
+ const char *old_alias,
const char *old_table,
const char *new_db,
const char *new_table);
@@ -175,6 +198,8 @@ public:
void mark_fields_used(trg_event_type event);
+ void set_parse_error_message(char *error_message);
+
friend class Item_trigger_field;
bool add_tables_and_routines_for_triggers(THD *thd,
@@ -192,6 +217,16 @@ private:
const char *new_db_name,
LEX_STRING *old_table_name,
LEX_STRING *new_table_name);
+
+ bool check_for_broken_triggers()
+ {
+ if (m_has_unparseable_trigger)
+ {
+ my_message(ER_PARSE_ERROR, m_parse_error_message, MYF(0));
+ return true;
+ }
+ return false;
+ }
};
extern const LEX_STRING trg_action_time_type_names[];
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc
index 99f3808c98e..67ed608f114 100644
--- a/sql/sql_truncate.cc
+++ b/sql/sql_truncate.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,11 +13,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#include "sql_priv.h"
-#include "transaction.h"
-#include "debug_sync.h"
-#include "records.h" // READ_RECORD
-#include "table.h" // TABLE
+#include "debug_sync.h" // DEBUG_SYNC
+#include "table.h" // TABLE, FOREIGN_KEY_INFO
#include "sql_class.h" // THD
#include "sql_base.h" // open_and_lock_tables
#include "sql_table.h" // write_bin_log
@@ -29,145 +26,212 @@
#include "sql_truncate.h"
-/*
- Delete all rows of a locked table.
+/**
+ Append a list of field names to a string.
- @param thd Thread context.
- @param table_list Table list element for the table.
- @param rows_deleted Whether rows might have been deleted.
+ @param str The string.
+ @param fields The list of field names.
- @retval FALSE Success.
- @retval TRUE Error.
+ @return TRUE on failure, FALSE otherwise.
*/
-static bool
-delete_all_rows(THD *thd, TABLE *table)
+static bool fk_info_append_fields(String *str, List<LEX_STRING> *fields)
{
- int error;
- READ_RECORD info;
- bool is_bulk_delete;
- bool some_rows_deleted= FALSE;
- bool save_binlog_row_based= thd->is_current_stmt_binlog_format_row();
- DBUG_ENTER("delete_all_rows");
-
- /* Replication of truncate table must be statement based. */
- thd->clear_current_stmt_binlog_format_row();
+ bool res= FALSE;
+ LEX_STRING *field;
+ List_iterator_fast<LEX_STRING> it(*fields);
- /*
- Update handler statistics (e.g. table->file->stats.records).
- Might be used by the storage engine to aggregate information
- necessary to allow deletion. Currently, this seems to be
- meaningful only to the archive storage engine, which uses
- the info method to set the number of records. Although
- archive does not support deletion, it becomes necessary in
- order to return a error if the table is not empty.
- */
- error= table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
- if (error && error != HA_ERR_WRONG_COMMAND)
+ while ((field= it++))
{
- table->file->print_error(error, MYF(0));
- goto end;
+ res|= str->append("`");
+ res|= str->append(field);
+ res|= str->append("`, ");
}
- /*
- Attempt to delete all rows in the table.
- If it is unsupported, switch to row by row deletion.
- */
- if (! (error= table->file->ha_delete_all_rows()))
- goto end;
+ str->chop();
+ str->chop();
- if (error != HA_ERR_WRONG_COMMAND)
- {
- /*
- If a transactional engine fails in the middle of deletion,
- we expect it to be able to roll it back. Some reasons
- for the engine to fail would be media failure or corrupted
- data dictionary (i.e. in case of a partitioned table). We
- have sufficiently strong metadata locks to rule out any
- potential deadlocks.
-
- If a non-transactional engine fails here (that would
- not be MyISAM, since MyISAM does TRUNCATE by recreate),
- and binlog is on, replication breaks, since nothing gets
- written to the binary log. (XXX: is this a bug?)
- */
- table->file->print_error(error, MYF(0));
- goto end;
- }
+ return res;
+}
+
+
+/**
+ Generate a foreign key description suitable for a error message.
+
+ @param thd Thread context.
+ @param fk_info The foreign key information.
+
+ @return A human-readable string describing the foreign key.
+*/
+
+static const char *fk_info_str(THD *thd, FOREIGN_KEY_INFO *fk_info)
+{
+ bool res= FALSE;
+ char buffer[STRING_BUFFER_USUAL_SIZE*2];
+ String str(buffer, sizeof(buffer), system_charset_info);
+
+ str.length(0);
/*
- A workaround for Bug#53696 "Performance schema engine violates the
- PSEA API by calling my_error()".
+ `db`.`tbl`, CONSTRAINT `id` FOREIGN KEY (`fk`) REFERENCES `db`.`tbl` (`fk`)
*/
- if (thd->is_error())
- goto end;
- /* Handler didn't support fast delete. Delete rows one by one. */
+ res|= str.append('`');
+ res|= str.append(fk_info->foreign_db);
+ res|= str.append("`.`");
+ res|= str.append(fk_info->foreign_table);
+ res|= str.append("`, CONSTRAINT `");
+ res|= str.append(fk_info->foreign_id);
+ res|= str.append("` FOREIGN KEY (");
+ res|= fk_info_append_fields(&str, &fk_info->foreign_fields);
+ res|= str.append(") REFERENCES `");
+ res|= str.append(fk_info->referenced_db);
+ res|= str.append("`.`");
+ res|= str.append(fk_info->referenced_table);
+ res|= str.append("` (");
+ res|= fk_info_append_fields(&str, &fk_info->referenced_fields);
+ res|= str.append(')');
+
+ return res ? NULL : thd->strmake(str.ptr(), str.length());
+}
+
- init_read_record(&info, thd, table, NULL, TRUE, TRUE, FALSE);
+/**
+ Check and emit a fatal error if the table which is going to be
+ affected by TRUNCATE TABLE is a parent table in some non-self-
+ referencing foreign key.
+
+ @remark The intention is to allow truncate only for tables that
+ are not dependent on other tables.
+
+ @param thd Thread context.
+ @param table Table handle.
+
+ @retval FALSE This table is not parent in a non-self-referencing foreign
+ key. Statement can proceed.
+ @retval TRUE This table is parent in a non-self-referencing foreign key,
+ error was emitted.
+*/
+
+static bool
+fk_truncate_illegal_if_parent(THD *thd, TABLE *table)
+{
+ FOREIGN_KEY_INFO *fk_info;
+ List<FOREIGN_KEY_INFO> fk_list;
+ List_iterator_fast<FOREIGN_KEY_INFO> it;
/*
- Start bulk delete. If the engine does not support it, go on,
- it's not an error.
+ Bail out early if the table is not referenced by a foreign key.
+ In this case, the table could only be, if at all, a child table.
*/
- is_bulk_delete= ! table->file->start_bulk_delete();
+ if (! table->file->referenced_by_foreign_key())
+ return FALSE;
- table->mark_columns_needed_for_delete();
+ /*
+ This table _is_ referenced by a foreign key. At this point, only
+ self-referencing keys are acceptable. For this reason, get the list
+ of foreign keys referencing this table in order to check the name
+ of the child (dependent) tables.
+ */
+ table->file->get_parent_foreign_key_list(thd, &fk_list);
- while (!(error= info.read_record(&info)) && !thd->killed)
+ /* Out of memory when building list. */
+ if (thd->is_error())
+ return TRUE;
+
+ it.init(fk_list);
+
+ /* Loop over the set of foreign keys for which this table is a parent. */
+ while ((fk_info= it++))
{
- if ((error= table->file->ha_delete_row(table->record[0])))
- {
- table->file->print_error(error, MYF(0));
+ DBUG_ASSERT(!my_strcasecmp(system_charset_info,
+ fk_info->referenced_db->str,
+ table->s->db.str));
+
+ DBUG_ASSERT(!my_strcasecmp(system_charset_info,
+ fk_info->referenced_table->str,
+ table->s->table_name.str));
+
+ if (my_strcasecmp(system_charset_info, fk_info->foreign_db->str,
+ table->s->db.str) ||
+ my_strcasecmp(system_charset_info, fk_info->foreign_table->str,
+ table->s->table_name.str))
break;
- }
-
- some_rows_deleted= TRUE;
}
- /* HA_ERR_END_OF_FILE */
- if (error == -1)
- error= 0;
-
- /* Close down the bulk delete. */
- if (is_bulk_delete)
+ /* Table is parent in a non-self-referencing foreign key. */
+ if (fk_info)
{
- int bulk_delete_error= table->file->end_bulk_delete();
- if (bulk_delete_error && !error)
- {
- table->file->print_error(bulk_delete_error, MYF(0));
- error= bulk_delete_error;
- }
+ my_error(ER_TRUNCATE_ILLEGAL_FK, MYF(0), fk_info_str(thd, fk_info));
+ return TRUE;
}
- end_read_record(&info);
+ return FALSE;
+}
+
+
+/*
+ Open and truncate a locked table.
+
+ @param thd Thread context.
+ @param table_ref Table list element for the table to be truncated.
+ @param is_tmp_table True if element refers to a temp table.
+
+ @retval 0 Success.
+ @retval > 0 Error code.
+*/
+
+int Truncate_statement::handler_truncate(THD *thd, TABLE_LIST *table_ref,
+ bool is_tmp_table)
+{
+ int error= 0;
+ uint flags;
+ DBUG_ENTER("Truncate_statement::handler_truncate");
/*
- Regardless of the error status, the query must be written to the
- binary log if rows of the table is non-transactional.
+ Can't recreate, the engine must mechanically delete all rows
+ in the table. Use open_and_lock_tables() to open a write cursor.
*/
- if (some_rows_deleted && !table->file->has_transactions())
+
+ /* If it is a temporary table, no need to take locks. */
+ if (is_tmp_table)
+ flags= MYSQL_OPEN_TEMPORARY_ONLY;
+ else
{
- thd->transaction.stmt.modified_non_trans_table= TRUE;
- thd->transaction.all.modified_non_trans_table= TRUE;
+ /* We don't need to load triggers. */
+ DBUG_ASSERT(table_ref->trg_event_map == 0);
+ /*
+ Our metadata lock guarantees that no transaction is reading
+ or writing into the table. Yet, to open a write cursor we need
+ a thr_lock lock. Allow to open base tables only.
+ */
+ table_ref->required_type= FRMTYPE_TABLE;
+ /*
+ Ignore pending FLUSH TABLES since we don't want to release
+ the MDL lock taken above and otherwise there is no way to
+ wait for FLUSH TABLES in deadlock-free fashion.
+ */
+ flags= MYSQL_OPEN_IGNORE_FLUSH | MYSQL_OPEN_SKIP_TEMPORARY;
+ /*
+ Even though we have an MDL lock on the table here, we don't
+ pass MYSQL_OPEN_HAS_MDL_LOCK to open_and_lock_tables
+ since to truncate a MERGE table, we must open and lock
+ merge children, and on those we don't have an MDL lock.
+ Thus clear the ticket to satisfy MDL asserts.
+ */
+ table_ref->mdl_request.ticket= NULL;
}
- if (error || thd->killed)
- goto end;
+ /* Open the table as it will handle some required preparations. */
+ if (open_and_lock_tables(thd, table_ref, FALSE, flags))
+ DBUG_RETURN(1);
- /* Truncate resets the auto-increment counter. */
- error= table->file->ha_reset_auto_increment(0);
- if (error)
- {
- if (error != HA_ERR_WRONG_COMMAND)
- table->file->print_error(error, MYF(0));
- else
- error= 0;
- }
+ /* Whether to truncate regardless of foreign keys. */
+ if (! (thd->variables.option_bits & OPTION_NO_FOREIGN_KEY_CHECKS))
+ error= fk_truncate_illegal_if_parent(thd, table_ref->table);
-end:
- if (save_binlog_row_based)
- thd->set_current_stmt_binlog_format_row();
+ if (!error && (error= table_ref->table->file->ha_truncate()))
+ table_ref->table->file->print_error(error, MYF(0));
DBUG_RETURN(error);
}
@@ -208,8 +272,8 @@ static bool recreate_temporary_table(THD *thd, TABLE *table)
ha_create_table(thd, share->normalized_path.str, share->db.str,
share->table_name.str, &create_info, 1);
- if (open_temporary_table(thd, share->path.str, share->db.str,
- share->table_name.str, 1))
+ if (open_table_uncached(thd, share->path.str, share->db.str,
+ share->table_name.str, TRUE))
{
error= FALSE;
thd->thread_specific_used= TRUE;
@@ -225,30 +289,29 @@ static bool recreate_temporary_table(THD *thd, TABLE *table)
/*
- Handle opening and locking if a base table for truncate.
+ Handle locking a base table for truncate.
@param[in] thd Thread context.
@param[in] table_ref Table list element for the table to
be truncated.
@param[out] hton_can_recreate Set to TRUE if table can be dropped
and recreated.
- @param[out] ticket_downgrade Set if a lock must be downgraded after
- truncate is done.
@retval FALSE Success.
@retval TRUE Error.
*/
-static bool open_and_lock_table_for_truncate(THD *thd, TABLE_LIST *table_ref,
- bool *hton_can_recreate,
- MDL_ticket **ticket_downgrade)
+bool Truncate_statement::lock_table(THD *thd, TABLE_LIST *table_ref,
+ bool *hton_can_recreate)
{
TABLE *table= NULL;
- handlerton *table_type;
- DBUG_ENTER("open_and_lock_table_for_truncate");
+ DBUG_ENTER("Truncate_statement::lock_table");
+ /* Lock types are set in the parser. */
DBUG_ASSERT(table_ref->lock_type == TL_WRITE);
- DBUG_ASSERT(table_ref->mdl_request.type == MDL_SHARED_NO_READ_WRITE);
+ /* The handler truncate protocol dictates a exclusive lock. */
+ DBUG_ASSERT(table_ref->mdl_request.type == MDL_EXCLUSIVE);
+
/*
Before doing anything else, acquire a metadata lock on the table,
or ensure we have one. We don't use open_and_lock_tables()
@@ -264,108 +327,49 @@ static bool open_and_lock_table_for_truncate(THD *thd, TABLE_LIST *table_ref,
*/
if (thd->locked_tables_mode)
{
- if (!(table= find_table_for_mdl_upgrade(thd->open_tables, table_ref->db,
+ if (!(table= find_table_for_mdl_upgrade(thd, table_ref->db,
table_ref->table_name, FALSE)))
DBUG_RETURN(TRUE);
- table_type= table->s->db_type();
- *hton_can_recreate= ha_check_storage_engine_flag(table_type,
+ *hton_can_recreate= ha_check_storage_engine_flag(table->s->db_type(),
HTON_CAN_RECREATE);
table_ref->mdl_request.ticket= table->mdl_ticket;
}
else
{
- /*
- Even though we could use the previous execution branch here just as
- well, we must not try to open the table:
- */
+ /* Acquire an exclusive lock. */
DBUG_ASSERT(table_ref->next_global == NULL);
if (lock_table_names(thd, table_ref, NULL,
thd->variables.lock_wait_timeout,
MYSQL_OPEN_SKIP_TEMPORARY))
DBUG_RETURN(TRUE);
- if (dd_frm_storage_engine(thd, table_ref->db, table_ref->table_name,
- &table_type))
+ if (dd_check_storage_engine_flag(thd, table_ref->db, table_ref->table_name,
+ HTON_CAN_RECREATE, hton_can_recreate))
DBUG_RETURN(TRUE);
- *hton_can_recreate= ha_check_storage_engine_flag(table_type,
- HTON_CAN_RECREATE);
}
-#ifdef WITH_PARTITION_STORAGE_ENGINE
/*
- TODO: Add support for TRUNCATE PARTITION for NDB and other engines
- supporting native partitioning.
+ A storage engine can recreate or truncate the table only if there
+ are no references to it from anywhere, i.e. no cached TABLE in the
+ table cache.
*/
- if (thd->lex->alter_info.flags & ALTER_ADMIN_PARTITION &&
- table_type != partition_hton)
- {
- my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0));
- DBUG_RETURN(TRUE);
- }
-#endif
- DEBUG_SYNC(thd, "lock_table_for_truncate");
-
- if (*hton_can_recreate)
+ if (thd->locked_tables_mode)
{
- /*
- Acquire an exclusive lock. The storage engine can recreate the
- table only if there are no references to it from anywhere, i.e.
- no cached TABLE in the table cache. To remove the table from the
- cache we need an exclusive lock.
- */
- if (thd->locked_tables_mode)
- {
- if (wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN))
- DBUG_RETURN(TRUE);
- *ticket_downgrade= table->mdl_ticket;
+ DEBUG_SYNC(thd, "upgrade_lock_for_truncate");
+ /* To remove the table from the cache we need an exclusive lock. */
+ if (wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN))
+ DBUG_RETURN(TRUE);
+ m_ticket_downgrade= table->mdl_ticket;
+ /* Close if table is going to be recreated. */
+ if (*hton_can_recreate)
close_all_tables_for_name(thd, table->s, FALSE);
- }
- else
- {
- ulong timeout= thd->variables.lock_wait_timeout;
- if (thd->mdl_context.
- upgrade_shared_lock_to_exclusive(table_ref->mdl_request.ticket,
- timeout))
- DBUG_RETURN(TRUE);
-
- tdc_remove_table(thd, TDC_RT_REMOVE_ALL, table_ref->db,
- table_ref->table_name, FALSE);
- }
}
else
{
- /*
- Can't recreate, we must mechanically delete all rows in
- the table. Our metadata lock guarantees that no transaction
- is reading or writing into the table. Yet, to open a write
- cursor we need a thr_lock lock. Use open_and_lock_tables()
- to do the necessary job.
- */
-
- /* Allow to open base tables only. */
- table_ref->required_type= FRMTYPE_TABLE;
- /* We don't need to load triggers. */
- DBUG_ASSERT(table_ref->trg_event_map == 0);
- /*
- Even though we have an MDL lock on the table here, we don't
- pass MYSQL_OPEN_HAS_MDL_LOCK to open_and_lock_tables
- since to truncate a MERGE table, we must open and lock
- merge children, and on those we don't have an MDL lock.
- Thus clear the ticket to satisfy MDL asserts.
- */
- table_ref->mdl_request.ticket= NULL;
-
- /*
- Open the table as it will handle some required preparations.
- Ignore pending FLUSH TABLES since we don't want to release
- the MDL lock taken above and otherwise there is no way to
- wait for FLUSH TABLES in deadlock-free fashion.
- */
- if (open_and_lock_tables(thd, table_ref, FALSE,
- MYSQL_OPEN_IGNORE_FLUSH |
- MYSQL_OPEN_SKIP_TEMPORARY))
- DBUG_RETURN(TRUE);
+ /* Table is already locked exclusively. Remove cached instances. */
+ tdc_remove_table(thd, TDC_RT_REMOVE_ALL, table_ref->db,
+ table_ref->table_name, FALSE);
}
DBUG_RETURN(FALSE);
@@ -386,14 +390,17 @@ static bool open_and_lock_table_for_truncate(THD *thd, TABLE_LIST *table_ref,
@retval TRUE Error.
*/
-bool mysql_truncate_table(THD *thd, TABLE_LIST *table_ref)
+bool Truncate_statement::truncate_table(THD *thd, TABLE_LIST *table_ref)
{
+ int error;
TABLE *table;
- bool error= TRUE, binlog_stmt;
- MDL_ticket *mdl_ticket= NULL;
- DBUG_ENTER("mysql_truncate_table");
+ bool binlog_stmt;
+ DBUG_ENTER("Truncate_statement::truncate_table");
+
+ /* Initialize, or reinitialize in case of reexecution (SP). */
+ m_ticket_downgrade= NULL;
- /* Remove tables from the HANDLER's hash. */
+ /* Remove table from the HANDLER's hash. */
mysql_ha_rm_tables(thd, table_ref);
/* If it is a temporary table, no need to take locks. */
@@ -414,14 +421,11 @@ bool mysql_truncate_table(THD *thd, TABLE_LIST *table_ref)
{
/*
The engine does not support truncate-by-recreate. Open the
- table and delete all rows. In such a manner this can in fact
- open several tables if it's a temporary MyISAMMRG table.
+ table and invoke the handler truncate. In such a manner this
+ can in fact open several tables if it's a temporary MyISAMMRG
+ table.
*/
- if (open_and_lock_tables(thd, table_ref, FALSE,
- MYSQL_OPEN_TEMPORARY_ONLY))
- DBUG_RETURN(TRUE);
-
- error= delete_all_rows(thd, table_ref->table);
+ error= handler_truncate(thd, table_ref, TRUE);
}
/*
@@ -435,8 +439,7 @@ bool mysql_truncate_table(THD *thd, TABLE_LIST *table_ref)
{
bool hton_can_recreate;
- if (open_and_lock_table_for_truncate(thd, table_ref,
- &hton_can_recreate, &mdl_ticket))
+ if (lock_table(thd, table_ref, &hton_can_recreate))
DBUG_RETURN(TRUE);
if (hton_can_recreate)
@@ -455,15 +458,27 @@ bool mysql_truncate_table(THD *thd, TABLE_LIST *table_ref)
}
else
{
- error= delete_all_rows(thd, table_ref->table);
+ /*
+ The engine does not support truncate-by-recreate.
+ Attempt to use the handler truncate method.
+ */
+ error= handler_truncate(thd, table_ref, FALSE);
/*
- Regardless of the error status, the query must be written to the
- binary log if rows of a non-transactional table were deleted.
+ All effects of a TRUNCATE TABLE operation are committed even if
+ truncation fails. Thus, the query must be written to the binary
+ log. The only exception is a unimplemented truncate method.
*/
- binlog_stmt= !error || thd->transaction.stmt.modified_non_trans_table;
+ binlog_stmt= !error || error != HA_ERR_WRONG_COMMAND;
}
+ /*
+ If we tried to open a MERGE table and failed due to problems with the
+ children tables, the table will have been closed and table_ref->table
+ will be invalid. Reset the pointer here in any case as
+ query_cache_invalidate does not need a valid TABLE object.
+ */
+ table_ref->table= NULL;
query_cache_invalidate3(thd, table_ref, FALSE);
}
@@ -472,49 +487,37 @@ bool mysql_truncate_table(THD *thd, TABLE_LIST *table_ref)
error|= write_bin_log(thd, !error, thd->query(), thd->query_length());
/*
- All effects of a TRUNCATE TABLE operation are rolled back if a row
- by row deletion fails. Otherwise, it is automatically committed at
- the end.
- */
- if (error)
- {
- trans_rollback_stmt(thd);
- trans_rollback(thd);
- }
-
- /*
A locked table ticket was upgraded to a exclusive lock. After the
the query has been written to the binary log, downgrade the lock
to a shared one.
*/
- if (mdl_ticket)
- mdl_ticket->downgrade_exclusive_lock(MDL_SHARED_NO_READ_WRITE);
+ if (m_ticket_downgrade)
+ m_ticket_downgrade->downgrade_exclusive_lock(MDL_SHARED_NO_READ_WRITE);
- DBUG_PRINT("exit", ("error: %d", error));
- DBUG_RETURN(test(error));
+ DBUG_RETURN(error);
}
+/**
+ Execute a TRUNCATE statement at runtime.
+
+ @param thd The current thread.
+
+ @return FALSE on success.
+*/
+
bool Truncate_statement::execute(THD *thd)
{
- TABLE_LIST *first_table= thd->lex->select_lex.table_list.first;
bool res= TRUE;
+ TABLE_LIST *first_table= thd->lex->select_lex.table_list.first;
DBUG_ENTER("Truncate_statement::execute");
if (check_one_table_access(thd, DROP_ACL, first_table))
- goto error;
- /*
- Don't allow this within a transaction because we want to use
- re-generate table
- */
- if (thd->in_active_multi_stmt_transaction())
- {
- my_message(ER_LOCK_OR_ACTIVE_TRANSACTION,
- ER(ER_LOCK_OR_ACTIVE_TRANSACTION), MYF(0));
- goto error;
- }
- if (! (res= mysql_truncate_table(thd, first_table)))
+ DBUG_RETURN(res);
+
+ if (! (res= truncate_table(thd, first_table)))
my_ok(thd);
-error:
+
DBUG_RETURN(res);
}
+
diff --git a/sql/sql_truncate.h b/sql/sql_truncate.h
index b8b1d3da53d..95a2f35df4f 100644
--- a/sql/sql_truncate.h
+++ b/sql/sql_truncate.h
@@ -18,13 +18,15 @@
class THD;
struct TABLE_LIST;
-bool mysql_truncate_table(THD *thd, TABLE_LIST *table_ref);
-
/**
Truncate_statement represents the TRUNCATE statement.
*/
class Truncate_statement : public Sql_statement
{
+private:
+ /* Set if a lock must be downgraded after truncate is done. */
+ MDL_ticket *m_ticket_downgrade;
+
public:
/**
Constructor, used to represent a ALTER TABLE statement.
@@ -34,7 +36,7 @@ public:
: Sql_statement(lex)
{}
- ~Truncate_statement()
+ virtual ~Truncate_statement()
{}
/**
@@ -43,7 +45,20 @@ public:
@return false on success.
*/
bool execute(THD *thd);
-};
+protected:
+ /** Handle locking a base table for truncate. */
+ bool lock_table(THD *, TABLE_LIST *, bool *);
+
+ /** Truncate table via the handler method. */
+ int handler_truncate(THD *, TABLE_LIST *, bool);
+
+ /**
+ Optimized delete of all rows by doing a full regenerate of the table.
+ Depending on the storage engine, it can be accomplished through a
+ drop and recreate or via the handler truncate method.
+ */
+ bool truncate_table(THD *, TABLE_LIST *);
+};
#endif
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 605b2367f48..3b3e96082cf 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -205,10 +205,7 @@ void udf_init()
On windows we must check both FN_LIBCHAR and '/'.
*/
- if (my_strchr(files_charset_info, dl_name,
- dl_name + strlen(dl_name), FN_LIBCHAR) ||
- IF_WIN(my_strchr(files_charset_info, dl_name,
- dl_name + strlen(dl_name), '/'), 0) ||
+ if (check_valid_path(dl_name, strlen(dl_name)) ||
check_string_char_length(&name, "", NAME_CHAR_LEN,
system_charset_info, 1))
{
@@ -448,13 +445,8 @@ 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_WIN(my_strchr(files_charset_info, udf->dl,
- udf->dl + strlen(udf->dl), '/'), 0))
+ if (check_valid_path(udf->dl, strlen(udf->dl)))
{
my_message(ER_UDF_NO_PATHS, ER(ER_UDF_NO_PATHS), MYF(0));
DBUG_RETURN(1);
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index faf0a81c40d..3382eba260c 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -199,7 +199,6 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
SELECT_LEX *sl, *first_sl= first_select();
select_result *tmp_result;
bool is_union_select;
- TABLE *empty_table= 0;
DBUG_ENTER("st_select_lex_unit::prepare");
describe= test(additional_options & SELECT_DESCRIBE);
@@ -301,14 +300,6 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
types= first_sl->item_list;
else if (sl == first_sl)
{
- /*
- We need to create an empty table object. It is used
- to create tmp_table fields in Item_type_holder.
- The main reason of this is that we can't create
- field object without table.
- */
- DBUG_ASSERT(!empty_table);
- empty_table= (TABLE*) thd->calloc(sizeof(TABLE));
types.empty();
List_iterator_fast<Item> it(sl->item_list);
Item *item_tmp;
@@ -466,6 +457,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
err:
thd_arg->lex->current_select= lex_select_save;
+ (void) cleanup();
DBUG_RETURN(TRUE);
}
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 76c90e40b17..bb4540b48f3 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -42,11 +42,68 @@
// mysql_handle_derived,
// mysql_derived_filling
-/* Return 0 if row hasn't changed */
-bool compare_record(TABLE *table)
+/**
+ True if the table's input and output record buffers are comparable using
+ compare_records(TABLE*).
+ */
+bool records_are_comparable(const TABLE *table) {
+ return ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) == 0) ||
+ bitmap_is_subset(table->write_set, table->read_set);
+}
+
+
+/**
+ Compares the input and outbut record buffers of the table to see if a row
+ has changed. The algorithm iterates over updated columns and if they are
+ nullable compares NULL bits in the buffer before comparing actual
+ data. Special care must be taken to compare only the relevant NULL bits and
+ mask out all others as they may be undefined. The storage engine will not
+ and should not touch them.
+
+ @param table The table to evaluate.
+
+ @return true if row has changed.
+ @return false otherwise.
+*/
+bool compare_records(const TABLE *table)
{
+ DBUG_ASSERT(records_are_comparable(table));
+
+ if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) != 0)
+ {
+ /*
+ Storage engine may not have read all columns of the record. Fields
+ (including NULL bits) not in the write_set may not have been read and
+ can therefore not be compared.
+ */
+ for (Field **ptr= table->field ; *ptr != NULL; ptr++)
+ {
+ Field *field= *ptr;
+ if (bitmap_is_set(table->write_set, field->field_index))
+ {
+ if (field->real_maybe_null())
+ {
+ uchar null_byte_index= field->null_ptr - table->record[0];
+
+ if (((table->record[0][null_byte_index]) & field->null_bit) !=
+ ((table->record[1][null_byte_index]) & field->null_bit))
+ return TRUE;
+ }
+ if (field->cmp_binary_offset(table->s->rec_buff_length))
+ return TRUE;
+ }
+ }
+ return FALSE;
+ }
+
+ /*
+ The storage engine has read all columns, so it's safe to compare all bits
+ including those not in the write_set. This is cheaper than the field-by-field
+ comparison done above.
+ */
if (table->s->can_cmp_whole_record)
+ // Fixed-size record: do bitwise comparison of the records
return cmp_record(table,record[1]);
/* Compare null bits */
if (memcmp(table->null_flags,
@@ -204,7 +261,6 @@ int mysql_update(THD *thd,
bool using_limit= limit != HA_POS_ERROR;
bool safe_update= test(thd->variables.option_bits & OPTION_SAFE_UPDATES);
bool used_key_is_modified= FALSE, transactional_table, will_batch;
- bool can_compare_record;
int res;
int error, loc_error;
uint used_index, dup_key_found;
@@ -240,11 +296,17 @@ int mysql_update(THD *thd,
if (lock_tables(thd, table_list, table_count, 0))
DBUG_RETURN(1);
- if (mysql_handle_derived(thd->lex, &mysql_derived_prepare) ||
- (thd->fill_derived_tables() &&
- mysql_handle_derived(thd->lex, &mysql_derived_filling)))
+ if (mysql_handle_derived(thd->lex, &mysql_derived_prepare))
DBUG_RETURN(1);
+ if (thd->fill_derived_tables() &&
+ mysql_handle_derived(thd->lex, &mysql_derived_filling))
+ {
+ mysql_handle_derived(thd->lex, &mysql_derived_cleanup);
+ DBUG_RETURN(1);
+ }
+ mysql_handle_derived(thd->lex, &mysql_derived_cleanup);
+
thd_proc_info(thd, "init");
table= table_list->table;
@@ -582,15 +644,6 @@ int mysql_update(THD *thd,
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
- */
- can_compare_record= (!(table->file->ha_table_flags() &
- HA_PARTIAL_COLUMN_READ) ||
- bitmap_is_subset(table->write_set, table->read_set));
-
while (!(error=info.read_record(&info)) && !thd->killed)
{
update_virtual_fields(thd, table);
@@ -608,7 +661,7 @@ int mysql_update(THD *thd,
found++;
- if (!can_compare_record || compare_record(table))
+ if (!records_are_comparable(table) || compare_records(table))
{
if ((res= table_list->view_check_option(thd, ignore)) !=
VIEW_CHECK_OK)
@@ -948,6 +1001,108 @@ static table_map get_table_map(List<Item> *items)
return map;
}
+/**
+ If one row is updated through two different aliases and the first
+ update physically moves the row, the second update will error
+ because the row is no longer located where expected. This function
+ checks if the multiple-table update is about to do that and if so
+ returns with an error.
+
+ The following update operations physically moves rows:
+ 1) Update of a column in a clustered primary key
+ 2) Update of a column used to calculate which partition the row belongs to
+
+ This function returns with an error if both of the following are
+ true:
+
+ a) A table in the multiple-table update statement is updated
+ through multiple aliases (including views)
+ b) At least one of the updates on the table from a) may physically
+ moves the row. Note: Updating a column used to calculate which
+ partition a row belongs to does not necessarily mean that the
+ row is moved. The new value may or may not belong to the same
+ partition.
+
+ @param leaves First leaf table
+ @param tables_for_update Map of tables that are updated
+
+ @return
+ true if the update is unsafe, in which case an error message is also set,
+ false otherwise.
+*/
+static
+bool unsafe_key_update(TABLE_LIST *leaves, table_map tables_for_update)
+{
+ TABLE_LIST *tl= leaves;
+
+ for (tl= leaves; tl ; tl= tl->next_leaf)
+ {
+ if (tl->table->map & tables_for_update)
+ {
+ TABLE *table1= tl->table;
+ bool primkey_clustered= (table1->file->primary_key_is_clustered() &&
+ table1->s->primary_key != MAX_KEY);
+
+ bool table_partitioned= false;
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ table_partitioned= (table1->part_info != NULL);
+#endif
+
+ if (!table_partitioned && !primkey_clustered)
+ continue;
+
+ for (TABLE_LIST* tl2= tl->next_leaf; tl2 ; tl2= tl2->next_leaf)
+ {
+ /*
+ Look at "next" tables only since all previous tables have
+ already been checked
+ */
+ TABLE *table2= tl2->table;
+ if (table2->map & tables_for_update && table1->s == table2->s)
+ {
+ // A table is updated through two aliases
+ if (table_partitioned &&
+ (partition_key_modified(table1, table1->write_set) ||
+ partition_key_modified(table2, table2->write_set)))
+ {
+ // Partitioned key is updated
+ my_error(ER_MULTI_UPDATE_KEY_CONFLICT, MYF(0),
+ tl->belong_to_view ? tl->belong_to_view->alias
+ : tl->alias,
+ tl2->belong_to_view ? tl2->belong_to_view->alias
+ : tl2->alias);
+ return true;
+ }
+
+ if (primkey_clustered)
+ {
+ // The primary key can cover multiple columns
+ KEY key_info= table1->key_info[table1->s->primary_key];
+ KEY_PART_INFO *key_part= key_info.key_part;
+ KEY_PART_INFO *key_part_end= key_part + key_info.key_parts;
+
+ for (;key_part != key_part_end; ++key_part)
+ {
+ if (bitmap_is_set(table1->write_set, key_part->fieldnr-1) ||
+ bitmap_is_set(table2->write_set, key_part->fieldnr-1))
+ {
+ // Clustered primary key is updated
+ my_error(ER_MULTI_UPDATE_KEY_CONFLICT, MYF(0),
+ tl->belong_to_view ? tl->belong_to_view->alias
+ : tl->alias,
+ tl2->belong_to_view ? tl2->belong_to_view->alias
+ : tl2->alias);
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return false;
+}
+
/*
make update specific preparation and checks after opening tables
@@ -982,9 +1137,17 @@ int mysql_multi_update_prepare(THD *thd)
/* following need for prepared statements, to run next time multi-update */
thd->lex->sql_command= SQLCOM_UPDATE_MULTI;
- /* open tables and create derived ones, but do not lock and fill them */
+ /*
+ Open tables and create derived ones, but do not lock and fill them yet.
+
+ During prepare phase acquire only S metadata locks instead of SW locks to
+ keep prepare of multi-UPDATE compatible with concurrent LOCK TABLES WRITE
+ and global read lock.
+ */
if ((original_multiupdate &&
- open_tables(thd, &table_list, &table_count, 0)) ||
+ open_tables(thd, &table_list, &table_count,
+ (thd->stmt_arena->is_stmt_prepare() ?
+ MYSQL_OPEN_FORCE_SHARED_MDL : 0))) ||
mysql_handle_derived(lex, &mysql_derived_prepare))
DBUG_RETURN(TRUE);
/*
@@ -1019,10 +1182,14 @@ int mysql_multi_update_prepare(THD *thd)
thd->table_map_for_update= tables_for_update= get_table_map(fields);
+ leaves= lex->select_lex.leaf_tables;
+
+ if (unsafe_key_update(leaves, tables_for_update))
+ DBUG_RETURN(true);
+
/*
Setup timestamp handling and locking mode
*/
- leaves= lex->select_lex.leaf_tables;
for (tl= leaves; tl; tl= tl->next_leaf)
{
TABLE *table= tl->table;
@@ -1142,7 +1309,11 @@ int mysql_multi_update_prepare(THD *thd)
if (thd->fill_derived_tables() &&
mysql_handle_derived(lex, &mysql_derived_filling))
+ {
+ mysql_handle_derived(lex, &mysql_derived_cleanup);
DBUG_RETURN(TRUE);
+ }
+ mysql_handle_derived(lex, &mysql_derived_cleanup);
DBUG_RETURN (FALSE);
}
@@ -1647,18 +1818,8 @@ bool multi_update::send_data(List<Item> &not_used_values)
if (table->status & (STATUS_NULL_ROW | STATUS_UPDATED))
continue;
- /*
- 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
- */
if (table == table_to_update)
{
- bool can_compare_record;
- can_compare_record= (!(table->file->ha_table_flags() &
- HA_PARTIAL_COLUMN_READ) ||
- bitmap_is_subset(table->write_set,
- table->read_set));
table->status|= STATUS_UPDATED;
store_record(table,record[1]);
if (fill_record_n_invoke_before_triggers(thd, *fields_for_table[offset],
@@ -1673,7 +1834,7 @@ bool multi_update::send_data(List<Item> &not_used_values)
*/
table->auto_increment_field_not_null= FALSE;
found++;
- if (!can_compare_record || compare_record(table))
+ if (!records_are_comparable(table) || compare_records(table))
{
int error;
if ((error= cur_table->view_check_option(thd, ignore)) !=
@@ -1864,7 +2025,6 @@ int multi_update::do_updates()
DBUG_RETURN(0);
for (cur_table= update_tables; cur_table; cur_table= cur_table->next_local)
{
- bool can_compare_record;
uint offset= cur_table->shared;
table = cur_table->table;
@@ -1913,11 +2073,6 @@ int multi_update::do_updates()
goto err;
}
- can_compare_record= (!(table->file->ha_table_flags() &
- HA_PARTIAL_COLUMN_READ) ||
- bitmap_is_subset(table->write_set,
- table->read_set));
-
for (;;)
{
if (thd->killed && trans_safe)
@@ -1965,7 +2120,7 @@ int multi_update::do_updates()
TRG_ACTION_BEFORE, TRUE))
goto err2;
- if (!can_compare_record || compare_record(table))
+ if (!records_are_comparable(table) || compare_records(table))
{
int error;
if ((error= cur_table->view_check_option(thd, ignore)) !=
@@ -2062,7 +2217,9 @@ bool multi_update::send_eof()
Does updates for the last n - 1 tables, returns 0 if ok;
error takes into account killed status gained in do_updates()
*/
- int local_error = (table_count) ? do_updates() : 0;
+ int local_error= thd->is_error();
+ if (!local_error)
+ local_error = (table_count) ? do_updates() : 0;
/*
if local_error is not set ON until after do_updates() then
later carried out killing should not affect binlogging.
diff --git a/sql/sql_update.h b/sql/sql_update.h
index 6bf022a171c..50ff50f025d 100644
--- a/sql/sql_update.h
+++ b/sql/sql_update.h
@@ -38,6 +38,7 @@ bool mysql_multi_update(THD *thd, TABLE_LIST *table_list,
enum enum_duplicates handle_duplicates, bool ignore,
SELECT_LEX_UNIT *unit, SELECT_LEX *select_lex,
multi_update **result);
-bool compare_record(TABLE *table);
+bool records_are_comparable(const TABLE *table);
+bool compare_records(const TABLE *table);
#endif /* SQL_UPDATE_INCLUDED */
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 3d8b9323b2a..0a8c2eac1a0 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -22,7 +22,7 @@
#include "sql_base.h" // find_table_in_global_list, lock_table_names
#include "sql_parse.h" // sql_parse
#include "sql_cache.h" // query_cache_*
-#include "lock.h" // wait_if_global_read_lock
+#include "lock.h" // MYSQL_OPEN_SKIP_TEMPORARY
#include "sql_show.h" // append_identifier
#include "sql_table.h" // build_table_filename
#include "sql_db.h" // mysql_opt_change_db, mysql_change_db
@@ -550,7 +550,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
}
/* prepare select to resolve all fields */
- lex->view_prepare_mode= 1;
+ lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VIEW;
if (unit->prepare(thd, 0, 0))
{
/*
@@ -649,13 +649,6 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
}
#endif
-
- if (thd->global_read_lock.wait_if_global_read_lock(thd, FALSE, TRUE))
- {
- res= TRUE;
- goto err;
- }
-
res= mysql_register_view(thd, view, mode);
if (mysql_bin_log.is_open())
@@ -704,7 +697,6 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
if (mode != VIEW_CREATE_NEW)
query_cache_invalidate3(thd, view, 0);
- thd->global_read_lock.start_waiting_global_read_lock(thd);
if (res)
goto err;
@@ -849,7 +841,8 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
thd->variables.sql_mode&= ~MODE_ANSI_QUOTES;
lex->unit.print(&view_query, QT_ORDINARY);
- lex->unit.print(&is_query, QT_IS);
+ lex->unit.print(&is_query,
+ enum_query_type(QT_TO_SYSTEM_CHARSET | QT_WITHOUT_INTRODUCERS));
thd->variables.sql_mode|= sql_mode;
}
@@ -1280,6 +1273,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
TABLE_LIST *view_tables= lex->query_tables;
TABLE_LIST *view_tables_tail= 0;
TABLE_LIST *tbl;
+ Security_context *security_ctx;
/*
Check rights to run commands (EXPLAIN SELECT & SHOW CREATE) which show
@@ -1426,26 +1420,39 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
if (table->view_suid)
{
/*
- Prepare a security context to check underlying objects of the view
+ For suid views prepare a security context for checking underlying
+ objects of the view.
*/
if (!(table->view_sctx= (Security_context *)
thd->stmt_arena->alloc(sizeof(Security_context))))
goto err;
- /* Assign the context to the tables referenced in the view */
- if (view_tables)
- {
- DBUG_ASSERT(view_tables_tail);
- for (tbl= view_tables; tbl != view_tables_tail->next_global;
- tbl= tbl->next_global)
- tbl->security_ctx= table->view_sctx;
- }
- /* assign security context to SELECT name resolution contexts of view */
- for(SELECT_LEX *sl= lex->all_selects_list;
- sl;
- sl= sl->next_select_in_list())
- sl->context.security_ctx= table->view_sctx;
+ security_ctx= table->view_sctx;
+ }
+ else
+ {
+ /*
+ For non-suid views inherit security context from view's table list.
+ This allows properly handle situation when non-suid view is used
+ from within suid view.
+ */
+ security_ctx= table->security_ctx;
}
+ /* Assign the context to the tables referenced in the view */
+ if (view_tables)
+ {
+ DBUG_ASSERT(view_tables_tail);
+ for (tbl= view_tables; tbl != view_tables_tail->next_global;
+ tbl= tbl->next_global)
+ tbl->security_ctx= security_ctx;
+ }
+
+ /* assign security context to SELECT name resolution contexts of view */
+ for(SELECT_LEX *sl= lex->all_selects_list;
+ sl;
+ sl= sl->next_select_in_list())
+ sl->context.security_ctx= security_ctx;
+
/*
Setup an error processor to hide error messages issued by stored
routines referenced in the view
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 9f34180662c..92209cc96f1 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011 Oracle and/or its affiliates. All rights reserved.
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
@@ -71,9 +71,6 @@
int yylex(void *yylval, void *yythd);
-const LEX_STRING null_lex_str= {0,0};
-const LEX_STRING empty_lex_str= { (char*) "", 0 };
-
#define yyoverflow(A,B,C,D,E,F) \
{ \
ulong val= *(F); \
@@ -1202,6 +1199,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token PROCESSLIST_SYM
%token PROFILE_SYM
%token PROFILES_SYM
+%token PROXY_SYM
%token PURGE
%token QUARTER_SYM
%token QUERY_SYM
@@ -1955,35 +1953,28 @@ master_def:
| MASTER_HEARTBEAT_PERIOD_SYM EQ NUM_literal
{
Lex->mi.heartbeat_period= (float) $3->val_real();
- if (Lex->mi.heartbeat_period > SLAVE_MAX_HEARTBEAT_PERIOD ||
- Lex->mi.heartbeat_period < 0.0)
- {
- const char format[]= "%d seconds";
- char buf[4*sizeof(SLAVE_MAX_HEARTBEAT_PERIOD) + sizeof(format)];
- sprintf(buf, format, SLAVE_MAX_HEARTBEAT_PERIOD);
- my_error(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
- MYF(0), " is negative or exceeds the maximum ", buf);
- MYSQL_YYABORT;
+ if (Lex->mi.heartbeat_period > SLAVE_MAX_HEARTBEAT_PERIOD ||
+ Lex->mi.heartbeat_period < 0.0)
+ {
+ const char format[]= "%d";
+ char buf[4*sizeof(SLAVE_MAX_HEARTBEAT_PERIOD) + sizeof(format)];
+ sprintf(buf, format, SLAVE_MAX_HEARTBEAT_PERIOD);
+ my_error(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE, MYF(0), buf);
+ MYSQL_YYABORT;
}
if (Lex->mi.heartbeat_period > slave_net_timeout)
{
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
- ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE),
- " exceeds the value of `slave_net_timeout' sec.",
- " A sensible value for the period should be"
- " less than the timeout.");
+ ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX,
+ ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX));
}
if (Lex->mi.heartbeat_period < 0.001)
{
if (Lex->mi.heartbeat_period != 0.0)
{
push_warning_printf(YYTHD, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
- ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE),
- " is less than 1 msec.",
- " The period is reset to zero which means"
- " no heartbeats will be sending");
+ ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN,
+ ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN));
Lex->mi.heartbeat_period= 0.0;
}
Lex->mi.heartbeat_opt= LEX_MASTER_INFO::LEX_MI_DISABLE;
@@ -2256,16 +2247,19 @@ opt_ev_status:
| ENABLE_SYM
{
Lex->event_parse_data->status= Event_parse_data::ENABLED;
+ Lex->event_parse_data->status_changed= true;
$$= 1;
}
| DISABLE_SYM ON SLAVE
{
Lex->event_parse_data->status= Event_parse_data::SLAVESIDE_DISABLED;
+ Lex->event_parse_data->status_changed= true;
$$= 1;
}
| DISABLE_SYM
{
Lex->event_parse_data->status= Event_parse_data::DISABLED;
+ Lex->event_parse_data->status_changed= true;
$$= 1;
}
;
@@ -4842,7 +4836,7 @@ part_value_expr_item:
if (!lex->safe_to_cache_query)
{
- my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0));
+ my_parse_error(ER(ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR));
MYSQL_YYABORT;
}
if (part_info->add_column_list_value(YYTHD, part_expr))
@@ -6966,7 +6960,7 @@ alter_list_item:
}
| FORCE_SYM
{
- Lex->alter_info.flags|= ALTER_FORCE;
+ Lex->alter_info.flags|= ALTER_RECREATE;
}
| alter_order_clause
{
@@ -7602,7 +7596,6 @@ select_lock_type:
LEX *lex=Lex;
lex->current_select->set_lock_for_tables(TL_WRITE);
lex->safe_to_cache_query=0;
- lex->protect_against_global_read_lock= TRUE;
}
| LOCK_SYM IN_SYM SHARE_SYM MODE_SYM
{
@@ -9614,7 +9607,7 @@ table_factor:
;
select_derived_union:
- select_derived opt_order_clause opt_limit_clause
+ select_derived opt_union_order_or_limit
| select_derived_union
UNION_SYM
union_option
@@ -9630,7 +9623,7 @@ select_derived_union:
*/
Lex->pop_context();
}
- opt_order_clause opt_limit_clause
+ opt_union_order_or_limit
;
/* The equivalent of select_init2 for nested queries. */
@@ -10660,7 +10653,10 @@ insert_lock_option:
| LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; }
| DELAYED_SYM
{
- Lex->keyword_delayed_begin= YYLIP->get_tok_start();
+ Lex->keyword_delayed_begin_offset= (uint)(YYLIP->get_tok_start() -
+ YYTHD->query());
+ Lex->keyword_delayed_end_offset= Lex->keyword_delayed_begin_offset +
+ YYLIP->yyLength() + 1;
$$= TL_WRITE_DELAYED;
}
| HIGH_PRIORITY { $$= TL_WRITE; }
@@ -10670,7 +10666,10 @@ replace_lock_option:
opt_low_priority { $$= $1; }
| DELAYED_SYM
{
- Lex->keyword_delayed_begin= YYLIP->get_tok_start();
+ Lex->keyword_delayed_begin_offset= (uint)(YYLIP->get_tok_start() -
+ YYTHD->query());
+ Lex->keyword_delayed_end_offset= Lex->keyword_delayed_begin_offset +
+ YYLIP->yyLength() + 1;
$$= TL_WRITE_DELAYED;
}
;
@@ -10976,7 +10975,7 @@ truncate:
lex->select_lex.sql_cache= SELECT_LEX::SQL_CACHE_UNSPECIFIED;
lex->select_lex.init_order();
YYPS->m_lock_type= TL_WRITE;
- YYPS->m_mdl_type= MDL_SHARED_NO_READ_WRITE;
+ YYPS->m_mdl_type= MDL_EXCLUSIVE;
}
table_name
{
@@ -11135,19 +11134,6 @@ show_param:
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;
@@ -11519,7 +11505,11 @@ opt_with_read_lock:
TABLE_LIST *tables= Lex->query_tables;
Lex->type|= REFRESH_READ_LOCK;
for (; tables; tables= tables->next_global)
+ {
tables->mdl_request.set_type(MDL_SHARED_NO_WRITE);
+ tables->required_type= FRMTYPE_TABLE; /* Don't try to flush views. */
+ tables->open_type= OT_BASE_ONLY; /* Ignore temporary tables. */
+ }
}
;
@@ -11829,7 +11819,23 @@ field_or_var:
opt_load_data_set_spec:
/* empty */ {}
- | SET insert_update_list {}
+ | SET load_data_set_list {}
+ ;
+
+load_data_set_list:
+ load_data_set_list ',' load_data_set_elem
+ | load_data_set_elem
+ ;
+
+load_data_set_elem:
+ simple_ident_nospvar equal remember_name expr_or_default remember_end
+ {
+ LEX *lex= Lex;
+ if (lex->update_list.push_back($1) ||
+ lex->value_list.push_back($4))
+ MYSQL_YYABORT;
+ $4->set_name($3, (uint) ($5 - $3), YYTHD->charset());
+ }
;
/* Common definitions */
@@ -12575,6 +12581,12 @@ user:
system_charset_info, 0) ||
check_host_name(&$$->host))
MYSQL_YYABORT;
+ /*
+ Convert hostname part of username to lowercase.
+ It's OK to use in-place lowercase as long as
+ the character set is utf8.
+ */
+ my_casedn_str(system_charset_info, $$->host.str);
}
| CURRENT_USER optional_braces
{
@@ -12734,6 +12746,7 @@ keyword_sp:
| FILE_SYM {}
| FIRST_SYM {}
| FIXED_SYM {}
+ | GENERAL {}
| GENERATED_SYM {}
| GEOMETRY_SYM {}
| GEOMETRYCOLLECTION {}
@@ -12744,6 +12757,7 @@ keyword_sp:
| HOSTS_SYM {}
| HOUR_SYM {}
| IDENTIFIED_SYM {}
+ | IGNORE_SERVER_IDS_SYM {}
| INDEX_STATS_SYM {}
| INVOKER_SYM {}
| IMPORT {}
@@ -12767,6 +12781,7 @@ keyword_sp:
| LOGS_SYM {}
| MAX_ROWS {}
| MASTER_SYM {}
+ | MASTER_HEARTBEAT_PERIOD_SYM {}
| MASTER_HOST_SYM {}
| MASTER_PORT_SYM {}
| MASTER_LOG_FILE_SYM {}
@@ -12836,6 +12851,7 @@ keyword_sp:
| PROCESSLIST_SYM {}
| PROFILE_SYM {}
| PROFILES_SYM {}
+ | PROXY_SYM {}
| QUARTER_SYM {}
| QUERY_SYM {}
| QUICK {}
@@ -12872,6 +12888,7 @@ keyword_sp:
| SIMPLE_SYM {}
| SHARE_SYM {}
| SHUTDOWN {}
+ | SLOW {}
| SNAPSHOT_SYM {}
| SOUNDS_SYM {}
| SOURCE_SYM {}
@@ -13226,7 +13243,7 @@ option_value:
if (!(user=(LEX_USER*) thd->alloc(sizeof(LEX_USER))))
MYSQL_YYABORT;
user->host=null_lex_str;
- user->user.str=thd->security_ctx->priv_user;
+ user->user.str=thd->security_ctx->user;
set_var_password *var= new set_var_password(user, $3);
if (var == NULL)
MYSQL_YYABORT;
@@ -13423,9 +13440,6 @@ table_lock:
MDL_SHARED_NO_READ_WRITE :
MDL_SHARED_READ)))
MYSQL_YYABORT;
- /* If table is to be write locked, protect from a impending GRL. */
- if (lock_for_write)
- Lex->protect_against_global_read_lock= TRUE;
}
;
@@ -13508,6 +13522,13 @@ handler:
handler_read_or_scan where_clause opt_limit_clause
{
Lex->expr_allows_subselect= TRUE;
+ /* Stored functions are not supported for HANDLER READ. */
+ if (Lex->uses_stored_routines())
+ {
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0),
+ "stored functions in HANDLER ... READ");
+ MYSQL_YYABORT;
+ }
}
;
@@ -13586,6 +13607,13 @@ revoke_command:
{
Lex->sql_command = SQLCOM_REVOKE_ALL;
}
+ | PROXY_SYM ON user FROM grant_list
+ {
+ LEX *lex= Lex;
+ lex->users_list.push_front ($3);
+ lex->sql_command= SQLCOM_REVOKE;
+ lex->type= TYPE_ENUM_PROXY;
+ }
;
grant:
@@ -13625,6 +13653,13 @@ grant_command:
lex->sql_command= SQLCOM_GRANT;
lex->type= TYPE_ENUM_PROCEDURE;
}
+ | PROXY_SYM ON user TO_SYM grant_list opt_grant_option
+ {
+ LEX *lex= Lex;
+ lex->users_list.push_front ($3);
+ lex->sql_command= SQLCOM_GRANT;
+ lex->type= TYPE_ENUM_PROXY;
+ }
;
opt_table:
@@ -13814,10 +13849,15 @@ grant_list:
}
;
+via_or_with: VIA_SYM | WITH ;
+using_or_as: USING | AS ;
+
grant_user:
user IDENTIFIED_SYM BY TEXT_STRING
{
$$=$1; $1->password=$4;
+ if (Lex->sql_command == SQLCOM_REVOKE)
+ MYSQL_YYABORT;
if ($4.length)
{
if (YYTHD->variables.old_passwords)
@@ -13843,15 +13883,24 @@ grant_user:
}
}
| user IDENTIFIED_SYM BY PASSWORD TEXT_STRING
- { $$= $1; $1->password= $5; }
- | user IDENTIFIED_SYM VIA_SYM ident_or_text
+ {
+ if (Lex->sql_command == SQLCOM_REVOKE)
+ MYSQL_YYABORT;
+ $$= $1;
+ $1->password= $5;
+ }
+ | user IDENTIFIED_SYM via_or_with ident_or_text
{
+ if (Lex->sql_command == SQLCOM_REVOKE)
+ MYSQL_YYABORT;
$$= $1;
$1->plugin= $4;
$1->auth= empty_lex_str;
}
- | user IDENTIFIED_SYM VIA_SYM ident_or_text USING TEXT_STRING_sys
+ | user IDENTIFIED_SYM via_or_with ident_or_text using_or_as TEXT_STRING_sys
{
+ if (Lex->sql_command == SQLCOM_REVOKE)
+ MYSQL_YYABORT;
$$= $1;
$1->plugin= $4;
$1->auth= $6;
@@ -13927,6 +13976,11 @@ grant_options:
| WITH grant_option_list
;
+opt_grant_option:
+ /* empty */ {}
+ | WITH GRANT OPTION { Lex->grant |= GRANT_ACL;}
+ ;
+
grant_option_list:
grant_option_list grant_option {}
| grant_option {}
@@ -14075,6 +14129,11 @@ union_opt:
| union_order_or_limit { $$= 1; }
;
+opt_union_order_or_limit:
+ /* Empty */
+ | union_order_or_limit
+ ;
+
union_order_or_limit:
{
THD *thd= YYTHD;
@@ -14122,7 +14181,7 @@ query_specification:
;
query_expression_body:
- query_specification
+ query_specification opt_union_order_or_limit
| query_expression_body
UNION_SYM union_option
{
@@ -14130,6 +14189,7 @@ query_expression_body:
MYSQL_YYABORT;
}
query_specification
+ opt_union_order_or_limit
{
Lex->pop_context();
$$= $1;
diff --git a/sql/strfunc.cc b/sql/strfunc.cc
index a0e2f39f8dc..0c0742b3805 100644
--- a/sql/strfunc.cc
+++ b/sql/strfunc.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -96,7 +96,7 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs,
/*
Function to find a string in a TYPELIB
- (Same format as mysys/typelib.c)
+ (similar to find_type() of mysys/typelib.c)
SYNOPSIS
find_type()
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 56440368acf..fceaad4eca9 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -231,14 +231,23 @@ static Sys_var_charptr Sys_basedir(
IN_FS_CHARSET, DEFAULT(0));
static Sys_var_ulong Sys_binlog_cache_size(
- "binlog_cache_size", "The size of the cache to "
- "hold the SQL statements for the binary log during a "
- "transaction. If you often use big, multi-statement "
- "transactions you can increase this to get more performance",
+ "binlog_cache_size", "The size of the transactional cache for "
+ "updates to transactional engines for the binary log. "
+ "If you often use transactions containing many statements, "
+ "you can increase this to get more performance",
GLOBAL_VAR(binlog_cache_size),
CMD_LINE(REQUIRED_ARG),
VALID_RANGE(IO_SIZE, ULONG_MAX), DEFAULT(32768), BLOCK_SIZE(IO_SIZE));
+static Sys_var_ulong Sys_binlog_stmt_cache_size(
+ "binlog_stmt_cache_size", "The size of the statement cache for "
+ "updates to non-transactional engines for the binary log. "
+ "If you often use statements updating a great number of rows, "
+ "you can increase this to get more performance",
+ GLOBAL_VAR(binlog_stmt_cache_size),
+ CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(IO_SIZE, ULONG_MAX), DEFAULT(32768), BLOCK_SIZE(IO_SIZE));
+
static bool check_has_super(sys_var *self, THD *thd, set_var *var)
{
DBUG_ASSERT(self->scope() != sys_var::GLOBAL);// don't abuse check_has_super()
@@ -684,7 +693,7 @@ static bool event_scheduler_update(sys_var *self, THD *thd, enum_var_type type)
: Events::stop();
mysql_mutex_lock(&LOCK_global_system_variables);
if (ret)
- my_error(ER_EVENT_SET_VAR_ERROR, MYF(0));
+ my_error(ER_EVENT_SET_VAR_ERROR, MYF(0), 0);
return ret;
}
@@ -1019,23 +1028,49 @@ static bool session_readonly(sys_var *self, THD *thd, set_var *var)
self->name.str, "GLOBAL");
return true;
}
+
+static bool
+check_max_allowed_packet(sys_var *self, THD *thd, set_var *var)
+{
+ longlong val;
+ if (session_readonly(self, thd, var))
+ return true;
+
+ val= var->save_result.ulonglong_value;
+ if (val < (longlong) global_system_variables.net_buffer_length)
+ {
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ WARN_OPTION_BELOW_LIMIT, ER(WARN_OPTION_BELOW_LIMIT),
+ "max_allowed_packet", "net_buffer_length");
+ }
+ return false;
+}
+
+
static Sys_var_ulong Sys_max_allowed_packet(
"max_allowed_packet",
"Max packet length to send to or receive from the server",
SESSION_VAR(max_allowed_packet), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(1024, 1024*1024*1024), DEFAULT(1024*1024),
BLOCK_SIZE(1024), NO_MUTEX_GUARD, NOT_IN_BINLOG,
- ON_CHECK(session_readonly));
+ ON_CHECK(check_max_allowed_packet));
static Sys_var_ulonglong Sys_max_binlog_cache_size(
"max_binlog_cache_size",
- "Can be used to restrict the total size used to cache a "
- "multi-transaction query",
+ "Sets the total size of the transactional cache",
GLOBAL_VAR(max_binlog_cache_size), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(IO_SIZE, ULONGLONG_MAX),
DEFAULT((ULONGLONG_MAX/IO_SIZE)*IO_SIZE),
BLOCK_SIZE(IO_SIZE));
+static Sys_var_ulonglong Sys_max_binlog_stmt_cache_size(
+ "max_binlog_stmt_cache_size",
+ "Sets the total size of the statement cache",
+ GLOBAL_VAR(max_binlog_stmt_cache_size), CMD_LINE(REQUIRED_ARG),
+ VALID_RANGE(IO_SIZE, ULONGLONG_MAX),
+ DEFAULT((ULONGLONG_MAX/IO_SIZE)*IO_SIZE),
+ BLOCK_SIZE(IO_SIZE));
+
static bool fix_max_binlog_size(sys_var *self, THD *thd, enum_var_type type)
{
mysql_bin_log.set_max_size(max_binlog_size);
@@ -1164,6 +1199,16 @@ static Sys_var_harows Sys_sql_max_join_size(
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
ON_UPDATE(fix_max_join_size), DEPRECATED(70000, 0));
+static Sys_var_ulong Sys_max_long_data_size(
+ "max_long_data_size",
+ "The maximum BLOB length to send to server from "
+ "mysql_send_long_data API. Deprecated option; "
+ "use max_allowed_packet instead.",
+ READ_ONLY GLOBAL_VAR(max_long_data_size),
+ CMD_LINE(REQUIRED_ARG, OPT_MAX_LONG_DATA_SIZE),
+ VALID_RANGE(1024, UINT_MAX32), DEFAULT(1024*1024),
+ BLOCK_SIZE(1));
+
static PolyLock_mutex PLock_prepared_stmt_count(&LOCK_prepared_stmt_count);
static Sys_var_ulong Sys_max_prepared_stmt_count(
"max_prepared_stmt_count",
@@ -1239,12 +1284,29 @@ static Sys_var_mybool Sys_named_pipe(
DEFAULT(FALSE));
#endif
+
+static bool
+check_net_buffer_length(sys_var *self, THD *thd, set_var *var)
+{
+ longlong val;
+ if (session_readonly(self, thd, var))
+ return true;
+
+ val= var->save_result.ulonglong_value;
+ if (val > (longlong) global_system_variables.max_allowed_packet)
+ {
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ WARN_OPTION_BELOW_LIMIT, ER(WARN_OPTION_BELOW_LIMIT),
+ "max_allowed_packet", "net_buffer_length");
+ }
+ return false;
+}
static Sys_var_ulong Sys_net_buffer_length(
"net_buffer_length",
"Buffer length for TCP/IP and socket communication",
SESSION_VAR(net_buffer_length), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(1024, 1024*1024), DEFAULT(16384), BLOCK_SIZE(1024),
- NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(session_readonly));
+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_net_buffer_length));
static bool fix_net_read_timeout(sys_var *self, THD *thd, enum_var_type type)
{
@@ -1428,6 +1490,14 @@ static Sys_var_uint Sys_protocol_version(
READ_ONLY GLOBAL_VAR(protocol_version), NO_CMD_LINE,
VALID_RANGE(0, ~0), DEFAULT(PROTOCOL_VERSION), BLOCK_SIZE(1));
+static Sys_var_proxy_user Sys_proxy_user(
+ "proxy_user", "The proxy user account name used when logging in",
+ IN_SYSTEM_CHARSET);
+
+static Sys_var_external_user Sys_exterenal_user(
+ "external_user", "The external user account used when logging in",
+ IN_SYSTEM_CHARSET);
+
static Sys_var_ulong Sys_read_buff_size(
"read_buffer_size",
"Each thread that does a sequential scan allocates a buffer of "
@@ -1437,7 +1507,6 @@ static Sys_var_ulong Sys_read_buff_size(
VALID_RANGE(IO_SIZE*2, INT_MAX32), DEFAULT(128*1024),
BLOCK_SIZE(IO_SIZE));
-static my_bool read_only;
static bool check_read_only(sys_var *self, THD *thd, set_var *var)
{
/* Prevent self dead-lock */
@@ -1521,6 +1590,16 @@ static bool fix_read_only(sys_var *self, THD *thd, enum_var_type type)
read_only= opt_readonly;
DBUG_RETURN(result);
}
+
+
+/**
+ The read_only boolean is always equal to the opt_readonly boolean except
+ during fix_read_only(); when that function is entered, opt_readonly is
+ the pre-update value and read_only is the post-update value.
+ fix_read_only() compares them and runs needed operations for the
+ transition (especially when transitioning from false to true) and
+ synchronizes both booleans in the end.
+*/
static Sys_var_mybool Sys_readonly(
"read_only",
"Make all non-temporary tables read-only, with the exception for "
@@ -2417,17 +2496,17 @@ static ulonglong read_timestamp(THD *thd)
static bool check_timestamp(sys_var *self, THD *thd, set_var *var)
{
- time_t val;
+ longlong val;
if (!var->value)
return FALSE;
- val= (time_t) var->save_result.ulonglong_value;
- if (val < (time_t) MY_TIME_T_MIN || val > (time_t) MY_TIME_T_MAX)
+ val= (longlong) var->save_result.ulonglong_value;
+ if (val != 0 && // this is how you set the default value
+ (val < TIMESTAMP_MIN_VALUE || val > TIMESTAMP_MAX_VALUE))
{
- my_message(ER_UNKNOWN_ERROR,
- "This version of MySQL doesn't support dates later than 2038",
- MYF(0));
+ char buf[64];
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "timestamp", llstr(val, buf));
return TRUE;
}
return FALSE;
@@ -2445,7 +2524,7 @@ static bool update_last_insert_id(THD *thd, set_var *var)
{
if (!var->value)
{
- my_error(ER_NO_DEFAULT, MYF(0), var->var->name);
+ my_error(ER_NO_DEFAULT, MYF(0), var->var->name.str);
return true;
}
thd->first_successful_insert_id_in_prev_stmt=
@@ -2494,7 +2573,7 @@ static bool update_insert_id(THD *thd, set_var *var)
{
if (!var->value)
{
- my_error(ER_NO_DEFAULT, MYF(0), var->var->name);
+ my_error(ER_NO_DEFAULT, MYF(0), var->var->name.str);
return true;
}
thd->force_one_auto_inc_interval(var->save_result.ulonglong_value);
@@ -2517,7 +2596,7 @@ static bool update_rand_seed1(THD *thd, set_var *var)
{
if (!var->value)
{
- my_error(ER_NO_DEFAULT, MYF(0), var->var->name);
+ my_error(ER_NO_DEFAULT, MYF(0), var->var->name.str);
return true;
}
thd->rand.seed1= (ulong) var->save_result.ulonglong_value;
@@ -2539,7 +2618,7 @@ static bool update_rand_seed2(THD *thd, set_var *var)
{
if (!var->value)
{
- my_error(ER_NO_DEFAULT, MYF(0), var->var->name);
+ my_error(ER_NO_DEFAULT, MYF(0), var->var->name.str);
return true;
}
thd->rand.seed2= (ulong) var->save_result.ulonglong_value;
@@ -2743,7 +2822,7 @@ static Sys_var_charptr Sys_slow_log_path(
ON_CHECK(check_log_path), ON_UPDATE(fix_slow_log_file));
/// @todo deprecate these four legacy have_PLUGIN variables and use I_S instead
-export SHOW_COMP_OPTION have_csv, have_innodb;
+export SHOW_COMP_OPTION have_csv, have_innodb= SHOW_OPTION_DISABLED;
export SHOW_COMP_OPTION have_ndbcluster, have_partitioning;
static Sys_var_have Sys_have_csv(
"have_csv", "have_csv",
@@ -2946,11 +3025,8 @@ static bool fix_slave_net_timeout(sys_var *self, THD *thd, enum_var_type type)
(active_mi? active_mi->heartbeat_period : 0.0)));
if (active_mi && slave_net_timeout < active_mi->heartbeat_period)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE,
- "The current value for master_heartbeat_period"
- " exceeds the new value of `slave_net_timeout' sec."
- " A sensible value for the period should be"
- " less than the timeout.");
+ ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX,
+ ER(ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX));
mysql_mutex_unlock(&LOCK_active_mi);
return false;
}
@@ -3072,7 +3148,7 @@ static bool check_locale(sys_var *self, THD *thd, set_var *var)
String str(buff, sizeof(buff), system_charset_info), *res;
if (!(res=var->value->val_str(&str)))
return true;
- else if (!(locale= my_locale_by_name(res->c_ptr())))
+ else if (!(locale= my_locale_by_name(res->c_ptr_safe())))
{
ErrConvString err(res);
my_error(ER_UNKNOWN_LOCALE, MYF(0), err.ptr());
diff --git a/sql/sys_vars.h b/sql/sys_vars.h
index 25ad412e62c..348fede994b 100644
--- a/sql/sys_vars.h
+++ b/sql/sys_vars.h
@@ -452,6 +452,65 @@ public:
{ return type != STRING_RESULT; }
};
+
+class Sys_var_proxy_user: public sys_var
+{
+public:
+ Sys_var_proxy_user(const char *name_arg,
+ const char *comment, enum charset_enum is_os_charset_arg)
+ : sys_var(&all_sys_vars, name_arg, comment,
+ sys_var::READONLY+sys_var::ONLY_SESSION, 0, -1,
+ NO_ARG, SHOW_CHAR, 0, NULL, VARIABLE_NOT_IN_BINLOG,
+ NULL, NULL, 0, NULL, PARSE_NORMAL)
+ {
+ is_os_charset= is_os_charset_arg == IN_FS_CHARSET;
+ option.var_type= GET_STR;
+ }
+ bool do_check(THD *thd, set_var *var)
+ {
+ DBUG_ASSERT(FALSE);
+ return true;
+ }
+ bool session_update(THD *thd, set_var *var)
+ {
+ DBUG_ASSERT(FALSE);
+ return true;
+ }
+ bool global_update(THD *thd, set_var *var)
+ {
+ DBUG_ASSERT(FALSE);
+ return false;
+ }
+ void session_save_default(THD *thd, set_var *var)
+ { DBUG_ASSERT(FALSE); }
+ void global_save_default(THD *thd, set_var *var)
+ { DBUG_ASSERT(FALSE); }
+ bool check_update_type(Item_result type)
+ { return true; }
+protected:
+ virtual uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ return thd->security_ctx->proxy_user[0] ?
+ (uchar *) &(thd->security_ctx->proxy_user[0]) : NULL;
+ }
+};
+
+class Sys_var_external_user : public Sys_var_proxy_user
+{
+public:
+ Sys_var_external_user(const char *name_arg, const char *comment_arg,
+ enum charset_enum is_os_charset_arg)
+ : Sys_var_proxy_user (name_arg, comment_arg, is_os_charset_arg)
+ {}
+
+protected:
+ virtual uchar *session_value_ptr(THD *thd, LEX_STRING *base)
+ {
+ return thd->security_ctx->proxy_user[0] ?
+ (uchar *) &(thd->security_ctx->proxy_user[0]) : NULL;
+ }
+};
+
/**
The class for string variables. Useful for strings that aren't necessarily
\0-terminated. Otherwise the same as Sys_var_charptr.
@@ -1154,7 +1213,8 @@ public:
void global_save_default(THD *thd, set_var *var)
{
LEX_STRING pname;
- pname.str= *(char**)option.def_value;
+ char **default_value= reinterpret_cast<char**>(option.def_value);
+ pname.str= *default_value;
pname.length= strlen(pname.str);
plugin_ref plugin;
@@ -1519,7 +1579,10 @@ public:
void session_save_default(THD *thd, set_var *var)
{ var->save_result.ptr= global_var(void*); }
void global_save_default(THD *thd, set_var *var)
- { var->save_result.ptr= *(void**)option.def_value; }
+ {
+ void **default_value= reinterpret_cast<void**>(option.def_value);
+ var->save_result.ptr= *default_value;
+ }
bool check_update_type(Item_result type)
{ return type != INT_RESULT && type != STRING_RESULT; }
uchar *session_value_ptr(THD *thd, LEX_STRING *base)
diff --git a/sql/table.cc b/sql/table.cc
index a7fd0715f0f..f71df6b9665 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1,4 +1,4 @@
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -434,6 +434,18 @@ void TABLE_SHARE::destroy()
info_it->flags= 0;
}
}
+ if (ha_data_destroy)
+ {
+ ha_data_destroy(ha_data);
+ ha_data_destroy= NULL;
+ }
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+ if (ha_part_data_destroy)
+ {
+ ha_part_data_destroy(ha_part_data);
+ ha_part_data_destroy= NULL;
+ }
+#endif /* WITH_PARTITION_STORAGE_ENGINE */
/*
Make a copy since the share is allocated in its own root,
and free_root() updates its argument after freeing the memory.
@@ -748,14 +760,12 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
enum legacy_db_type legacy_db_type;
my_bitmap_map *bitmaps;
bool null_bits_are_used;
- uint vcol_screen_length, options_len;
+ uint vcol_screen_length, UNINIT_VAR(options_len);
char *vcol_screen_pos;
- uchar *options, *buff= 0;
+ uchar *UNINIT_VAR(options);
+ uchar *extra_segment_buff= 0;
DBUG_ENTER("open_binary_frm");
- LINT_INIT(options);
- LINT_INIT(options_len);
-
new_field_pack_flag= head[27];
new_frm_ver= (head[2] - FRM_VER);
field_pack_length= new_frm_ver < 2 ? 11 : 17;
@@ -950,19 +960,25 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
/* Read extra data segment */
uchar *next_chunk, *buff_end;
DBUG_PRINT("info", ("extra segment size is %u bytes", n_length));
- if (!(next_chunk= buff= (uchar*) my_malloc(n_length+1, MYF(MY_WME))))
+ if (!(extra_segment_buff= (uchar*) my_malloc(n_length + 1, MYF(MY_WME))))
goto err;
- if (mysql_file_pread(file, buff, n_length, record_offset + share->reclength,
+ next_chunk= extra_segment_buff;
+ if (mysql_file_pread(file, extra_segment_buff,
+ n_length, record_offset + share->reclength,
MYF(MY_NABP)))
- goto free_and_err;
- share->connect_string.length= uint2korr(buff);
+ {
+ goto err;
+ }
+ share->connect_string.length= uint2korr(next_chunk);
if (!(share->connect_string.str= strmake_root(&share->mem_root,
(char*) next_chunk + 2,
share->connect_string.
length)))
- goto free_and_err;
+ {
+ goto err;
+ }
next_chunk+= share->connect_string.length + 2;
- buff_end= buff + n_length;
+ buff_end= extra_segment_buff + n_length;
if (next_chunk + 2 < buff_end)
{
uint str_db_type_length= uint2korr(next_chunk);
@@ -979,7 +995,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
plugin_data(tmp_plugin, handlerton *)))
{
/* bad file, legacy_db_type did not match the name */
- goto free_and_err;
+ goto err;
}
/*
tmp_plugin is locked with a local lock.
@@ -1008,7 +1024,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
error= 8;
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
"--skip-partition");
- goto free_and_err;
+ goto err;
}
plugin_unlock(NULL, share->db_plugin);
share->db_plugin= ha_lock_engine(NULL, partition_hton);
@@ -1023,7 +1039,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
error= 8;
name.str[name.length]=0;
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), name.str);
- goto free_and_err;
+ goto err;
/* purecov: end */
}
next_chunk+= str_db_type_length + 2;
@@ -1038,13 +1054,15 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
if (!(share->partition_info_str= (char*)
memdup_root(&share->mem_root, next_chunk + 4,
partition_info_str_len + 1)))
- goto free_and_err;
+ {
+ goto err;
+ }
}
#else
if (partition_info_str_len)
{
DBUG_PRINT("info", ("WITH_PARTITION_STORAGE_ENGINE is not defined"));
- goto free_and_err;
+ goto err;
}
#endif
next_chunk+= 5 + partition_info_str_len;
@@ -1068,7 +1086,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
{
DBUG_PRINT("error",
("fulltext key uses parser that is not defined in .frm"));
- goto free_and_err;
+ goto err;
}
parser_name.str= (char*) next_chunk;
parser_name.length= strlen((char*) next_chunk);
@@ -1078,7 +1096,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
if (! keyinfo->parser)
{
my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), parser_name.str);
- goto free_and_err;
+ goto err;
}
}
}
@@ -1090,16 +1108,19 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
{
DBUG_PRINT("error",
("long table comment is not defined in .frm"));
- goto free_and_err;
+ goto err;
}
share->comment.length = uint2korr(next_chunk);
if (! (share->comment.str= strmake_root(&share->mem_root,
(char*)next_chunk + 2, share->comment.length)))
- goto free_and_err;
+ {
+ goto err;
+ }
next_chunk+= 2 + share->comment.length;
}
DBUG_ASSERT(next_chunk <= buff_end);
+
if (share->db_create_options & HA_OPTION_TEXT_CREATE_OPTIONS)
{
/*
@@ -1501,8 +1522,8 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
/* Fix key->name and key_part->field */
if (key_parts)
{
- uint primary_key=(uint) (find_type((char*) primary_key_name,
- &share->keynames, 3) - 1);
+ uint primary_key=(uint) (find_type(primary_key_name, &share->keynames,
+ FIND_TYPE_NO_PREFIX) - 1);
longlong ha_option= handler_file->ha_table_flags();
keyinfo= share->key_info;
key_part= keyinfo->key_part;
@@ -1787,24 +1808,30 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
if (use_hash)
(void) my_hash_check(&share->name_hash);
#endif
+ my_free(extra_segment_buff);
DBUG_RETURN (0);
- free_and_err:
- my_free(buff);
err:
share->error= error;
share->open_errno= my_errno;
share->errarg= errarg;
my_free(disk_buff);
+ my_free(extra_segment_buff);
delete crypted;
delete handler_file;
my_hash_free(&share->name_hash);
if (share->ha_data_destroy)
+ {
share->ha_data_destroy(share->ha_data);
+ share->ha_data_destroy= NULL;
+ }
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (share->ha_part_data_destroy)
+ {
share->ha_part_data_destroy(share->ha_part_data);
-#endif
+ share->ha_data_destroy= NULL;
+ }
+#endif /* WITH_PARTITION_STORAGE_ENGINE */
open_table_error(share, error, share->open_errno, errarg);
DBUG_RETURN(error);
@@ -2315,7 +2342,8 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
Query_arena *backup_stmt_arena_ptr= thd->stmt_arena;
Query_arena backup_arena;
- Query_arena part_func_arena(&outparam->mem_root, Query_arena::INITIALIZED);
+ Query_arena part_func_arena(&outparam->mem_root,
+ Query_arena::STMT_INITIALIZED);
thd->set_n_backup_active_arena(&part_func_arena, &backup_arena);
thd->stmt_arena= &part_func_arena;
bool tmp;
@@ -2535,7 +2563,15 @@ void free_blobs(register TABLE *table)
for (ptr= table->s->blob_field, end=ptr + table->s->blob_fields ;
ptr != end ;
ptr++)
- ((Field_blob*) table->field[*ptr])->free();
+ {
+ /*
+ Reduced TABLE objects which are used by row-based replication for
+ type conversion might have some fields missing. Skip freeing BLOB
+ buffers for such missing fields.
+ */
+ if (table->field[*ptr])
+ ((Field_blob*) table->field[*ptr])->free();
+ }
}
@@ -2769,7 +2805,7 @@ void open_table_error(TABLE_SHARE *share, int error, int db_errno, int errarg)
default: /* Better wrong error than none */
case 4:
strxmov(buff, share->normalized_path.str, reg_ext, NullS);
- my_error(ER_NOT_FORM_FILE, errortype, buff, 0);
+ my_error(ER_NOT_FORM_FILE, errortype, buff);
break;
}
DBUG_VOID_RETURN;
@@ -3364,7 +3400,8 @@ Table_check_intact::check(TABLE *table, const TABLE_FIELD_DEF *table_def)
report_error(ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE,
ER(ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE),
table->alias, table_def->count, table->s->fields,
- table->s->mysql_version, MYSQL_VERSION_ID);
+ static_cast<int>(table->s->mysql_version),
+ MYSQL_VERSION_ID);
DBUG_RETURN(TRUE);
}
else if (MYSQL_VERSION_ID == table->s->mysql_version)
@@ -3519,30 +3556,7 @@ bool TABLE_SHARE::visit_subgraph(Wait_for_flush *wait_for_flush,
holding a write-lock on MDL_lock::m_rwlock.
*/
if (gvisitor->m_lock_open_count++ == 0)
- {
- /*
- To circumvent bug #56405 "Deadlock in the MDL deadlock detector"
- we don't try to lock LOCK_open mutex if some thread doing
- deadlock detection already owns it and current search depth is
- greater than 0. Instead we report a deadlock.
-
- TODO/FIXME: The proper fix for this bug is to use rwlocks for
- protection of table shares/instead of LOCK_open.
- Unfortunately it requires more effort/has significant
- performance effect.
- */
- mysql_mutex_lock(&LOCK_dd_owns_lock_open);
- if (gvisitor->m_current_search_depth > 0 && dd_owns_lock_open > 0)
- {
- mysql_mutex_unlock(&LOCK_dd_owns_lock_open);
- --gvisitor->m_lock_open_count;
- gvisitor->abort_traversal(src_ctx);
- return TRUE;
- }
- ++dd_owns_lock_open;
- mysql_mutex_unlock(&LOCK_dd_owns_lock_open);
mysql_mutex_lock(&LOCK_open);
- }
I_P_List_iterator <TABLE, TABLE_share> tables_it(used_tables);
@@ -3557,12 +3571,8 @@ bool TABLE_SHARE::visit_subgraph(Wait_for_flush *wait_for_flush,
goto end;
}
- ++gvisitor->m_current_search_depth;
if (gvisitor->enter_node(src_ctx))
- {
- --gvisitor->m_current_search_depth;
goto end;
- }
while ((table= tables_it++))
{
@@ -3585,16 +3595,10 @@ bool TABLE_SHARE::visit_subgraph(Wait_for_flush *wait_for_flush,
end_leave_node:
gvisitor->leave_node(src_ctx);
- --gvisitor->m_current_search_depth;
end:
if (gvisitor->m_lock_open_count-- == 1)
- {
mysql_mutex_unlock(&LOCK_open);
- mysql_mutex_lock(&LOCK_dd_owns_lock_open);
- --dd_owns_lock_open;
- mysql_mutex_unlock(&LOCK_dd_owns_lock_open);
- }
return result;
}
@@ -3690,6 +3694,68 @@ bool TABLE_SHARE::wait_for_old_version(THD *thd, struct timespec *abstime,
}
+/**
+ Initialize TABLE instance (newly created, or coming either from table
+ cache or THD::temporary_tables list) and prepare it for further use
+ during statement execution. Set the 'alias' attribute from the specified
+ TABLE_LIST element. Remember the TABLE_LIST element in the
+ TABLE::pos_in_table_list member.
+
+ @param thd Thread context.
+ @param tl TABLE_LIST element.
+*/
+
+void TABLE::init(THD *thd, TABLE_LIST *tl)
+{
+ DBUG_ASSERT(s->ref_count > 0 || s->tmp_table != NO_TMP_TABLE);
+
+ if (thd->lex->need_correct_ident())
+ alias_name_used= my_strcasecmp(table_alias_charset,
+ s->table_name.str,
+ tl->alias);
+ /* Fix alias if table name changes. */
+ if (strcmp(alias, tl->alias))
+ {
+ uint length= (uint) strlen(tl->alias)+1;
+ alias= (char*) my_realloc((char*) alias, length, MYF(MY_WME));
+ memcpy((char*) alias, tl->alias, length);
+ }
+
+ tablenr= thd->current_tablenr++;
+ used_fields= 0;
+ const_table= 0;
+ null_row= 0;
+ maybe_null= 0;
+ force_index= 0;
+ force_index_order= 0;
+ force_index_group= 0;
+ status= STATUS_NO_RECORD;
+ insert_values= 0;
+ fulltext_searched= 0;
+ file->ha_start_of_new_statement();
+ reginfo.impossible_range= 0;
+
+ /* Catch wrong handling of the auto_increment_field_not_null. */
+ DBUG_ASSERT(!auto_increment_field_not_null);
+ auto_increment_field_not_null= FALSE;
+
+ if (timestamp_field)
+ timestamp_field_type= timestamp_field->get_auto_set_type();
+
+ pos_in_table_list= tl;
+
+ clear_column_bitmaps();
+
+ DBUG_ASSERT(key_read == 0);
+
+ /* mark the record[0] uninitialized */
+ TRASH(table->record[0], table->s->reclength);
+
+ /* Tables may be reused in a sub statement. */
+ DBUG_ASSERT(!file->extra(HA_EXTRA_IS_ATTACHED_CHILDREN));
+}
+
+
/*
Create Item_field for each column in the table.
@@ -4501,10 +4567,15 @@ bool TABLE_LIST::prepare_view_securety_context(THD *thd)
}
else
{
- my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
- thd->security_ctx->priv_user,
- thd->security_ctx->priv_host,
- (thd->password ? ER(ER_YES) : ER(ER_NO)));
+ if (thd->password == 2)
+ my_error(ER_ACCESS_DENIED_NO_PASSWORD_ERROR, MYF(0),
+ thd->security_ctx->priv_user,
+ thd->security_ctx->priv_host);
+ else
+ my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
+ thd->security_ctx->priv_user,
+ thd->security_ctx->priv_host,
+ (thd->password ? ER(ER_YES) : ER(ER_NO)));
}
DBUG_RETURN(TRUE);
}
@@ -5840,7 +5911,8 @@ void init_mdl_requests(TABLE_LIST *table_list)
table_list->mdl_request.init(MDL_key::TABLE,
table_list->db, table_list->table_name,
table_list->lock_type >= TL_WRITE_ALLOW_WRITE ?
- MDL_SHARED_WRITE : MDL_SHARED_READ);
+ MDL_SHARED_WRITE : MDL_SHARED_READ,
+ MDL_TRANSACTION);
}
diff --git a/sql/table.h b/sql/table.h
index 5b0a74a2828..79263723744 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1,7 +1,7 @@
#ifndef TABLE_INCLUDED
#define TABLE_INCLUDED
-/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
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
@@ -83,18 +83,6 @@ enum enum_table_ref_type
};
-/**
- Opening modes for open_temporary_table and open_table_from_share
-*/
-
-enum open_table_mode
-{
- OTM_OPEN= 0,
- OTM_CREATE= 1,
- OTM_ALTER= 2
-};
-
-
/*************************************************************************/
/**
@@ -659,8 +647,8 @@ struct TABLE_SHARE
uint db_options_in_use; /* Options in use */
uint db_record_offset; /* if HA_REC_IN_SEQ */
uint rowid_field_offset; /* Field_nr +1 to rowid field */
- /* Index of auto-updated TIMESTAMP field in field array */
- uint primary_key;
+ /* Primary key index number, used in TABLE::key_info[] */
+ uint primary_key;
uint next_number_index; /* autoincrement key number */
uint next_number_key_offset; /* autoinc keypart offset in a key */
uint next_number_keypart; /* autoinc keypart number in a key */
@@ -1128,6 +1116,7 @@ public:
#endif
MDL_ticket *mdl_ticket;
+ void init(THD *thd, TABLE_LIST *tl);
bool fill_item_list(List<Item> *item_list) const;
void reset_item_list(List<Item> *item_list) const;
void clear_column_bitmaps(void);
@@ -1242,7 +1231,9 @@ enum enum_schema_table_state
typedef struct st_foreign_key_info
{
- LEX_STRING *forein_id;
+ LEX_STRING *foreign_id;
+ LEX_STRING *foreign_db;
+ LEX_STRING *foreign_table;
LEX_STRING *referenced_db;
LEX_STRING *referenced_table;
LEX_STRING *update_method;
@@ -1459,7 +1450,8 @@ struct TABLE_LIST
lock_type= lock_type_arg;
mdl_request.init(MDL_key::TABLE, db, table_name,
(lock_type >= TL_WRITE_ALLOW_WRITE) ?
- MDL_SHARED_WRITE : MDL_SHARED_READ);
+ MDL_SHARED_WRITE : MDL_SHARED_READ,
+ MDL_TRANSACTION);
}
/*
diff --git a/sql/transaction.cc b/sql/transaction.cc
index a28fba8805d..94a32200274 100644
--- a/sql/transaction.cc
+++ b/sql/transaction.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 Sun/MySQL
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -21,6 +21,7 @@
#include "sql_priv.h"
#include "transaction.h"
#include "rpl_handler.h"
+#include "debug_sync.h" // DEBUG_SYNC
/* Conditions under which the transaction state must not change. */
static bool trans_check(THD *thd)
@@ -78,6 +79,33 @@ static bool xa_trans_rolled_back(XID_STATE *xid_state)
/**
+ Rollback the active XA transaction.
+
+ @note Resets rm_error before calling ha_rollback(), so
+ the thd->transaction.xid structure gets reset
+ by ha_rollback() / THD::transaction::cleanup().
+
+ @return TRUE if the rollback failed, FALSE otherwise.
+*/
+
+static bool xa_trans_force_rollback(THD *thd)
+{
+ /*
+ We must reset rm_error before calling ha_rollback(),
+ so thd->transaction.xid structure gets reset
+ by ha_rollback()/THD::transaction::cleanup().
+ */
+ thd->transaction.xid_state.rm_error= 0;
+ if (ha_rollback_trans(thd, true))
+ {
+ my_error(ER_XAER_RMERR, MYF(0));
+ return true;
+ }
+ return false;
+}
+
+
+/**
Begin a new transaction.
@note Beginning a transaction implicitly commits any current
@@ -361,6 +389,13 @@ bool trans_savepoint(THD *thd, LEX_STRING name)
!opt_using_transactions)
DBUG_RETURN(FALSE);
+ enum xa_states xa_state= thd->transaction.xid_state.xa_state;
+ if (xa_state != XA_NOTR)
+ {
+ my_error(ER_XAER_RMFAIL, MYF(0), xa_state_names[xa_state]);
+ DBUG_RETURN(TRUE);
+ }
+
sv= find_savepoint(thd, name);
if (*sv) /* old savepoint of the same name exists */
@@ -391,15 +426,15 @@ bool trans_savepoint(THD *thd, LEX_STRING name)
thd->transaction.savepoints= newsv;
/*
- Remember the last acquired lock before the savepoint was set.
- This is used as a marker to only release locks acquired after
+ Remember locks acquired before the savepoint was set.
+ They are used as a marker to only release locks acquired after
the setting of this savepoint.
Note: this works just fine if we're under LOCK TABLES,
since mdl_savepoint() is guaranteed to be beyond
the last locked table. This allows to release some
locks acquired during LOCK TABLES.
*/
- newsv->mdl_savepoint = thd->mdl_context.mdl_savepoint();
+ newsv->mdl_savepoint= thd->mdl_context.mdl_savepoint();
DBUG_RETURN(FALSE);
}
@@ -434,6 +469,13 @@ bool trans_rollback_to_savepoint(THD *thd, LEX_STRING name)
DBUG_RETURN(TRUE);
}
+ enum xa_states xa_state= thd->transaction.xid_state.xa_state;
+ if (xa_state != XA_NOTR)
+ {
+ my_error(ER_XAER_RMFAIL, MYF(0), xa_state_names[xa_state]);
+ DBUG_RETURN(TRUE);
+ }
+
if (ha_rollback_to_savepoint(thd, sv))
res= TRUE;
else if (((thd->variables.option_bits & OPTION_KEEP_LOG) ||
@@ -565,7 +607,8 @@ bool trans_xa_end(THD *thd)
else if (!xa_trans_rolled_back(&thd->transaction.xid_state))
thd->transaction.xid_state.xa_state= XA_IDLE;
- DBUG_RETURN(thd->transaction.xid_state.xa_state != XA_IDLE);
+ DBUG_RETURN(thd->is_error() ||
+ thd->transaction.xid_state.xa_state != XA_IDLE);
}
@@ -596,7 +639,8 @@ bool trans_xa_prepare(THD *thd)
else
thd->transaction.xid_state.xa_state= XA_PREPARED;
- DBUG_RETURN(thd->transaction.xid_state.xa_state != XA_PREPARED);
+ DBUG_RETURN(thd->is_error() ||
+ thd->transaction.xid_state.xa_state != XA_PREPARED);
}
@@ -632,8 +676,8 @@ bool trans_xa_commit(THD *thd)
if (xa_trans_rolled_back(&thd->transaction.xid_state))
{
- if ((res= test(ha_rollback_trans(thd, TRUE))))
- my_error(ER_XAER_RMERR, MYF(0));
+ xa_trans_force_rollback(thd);
+ res= thd->is_error();
}
else if (xa_state == XA_IDLE && thd->lex->xa_opt == XA_ONE_PHASE)
{
@@ -643,17 +687,31 @@ bool trans_xa_commit(THD *thd)
}
else if (xa_state == XA_PREPARED && thd->lex->xa_opt == XA_NONE)
{
- if (thd->global_read_lock.wait_if_global_read_lock(thd, FALSE, FALSE))
+ MDL_request mdl_request;
+
+ /*
+ Acquire metadata lock which will ensure that COMMIT is blocked
+ by active FLUSH TABLES WITH READ LOCK (and vice versa COMMIT in
+ progress blocks FTWRL).
+
+ We allow FLUSHer to COMMIT; we assume FLUSHer knows what it does.
+ */
+ mdl_request.init(MDL_key::COMMIT, "", "", MDL_INTENTION_EXCLUSIVE,
+ MDL_TRANSACTION);
+
+ if (thd->mdl_context.acquire_lock(&mdl_request,
+ thd->variables.lock_wait_timeout))
{
ha_rollback_trans(thd, TRUE);
my_error(ER_XAER_RMERR, MYF(0));
}
else
{
+ DEBUG_SYNC(thd, "trans_xa_commit_after_acquire_commit_lock");
+
res= test(ha_commit_one_phase(thd, 1));
if (res)
my_error(ER_XAER_RMERR, MYF(0));
- thd->global_read_lock.start_waiting_global_read_lock(thd);
}
}
else
@@ -707,15 +765,7 @@ bool trans_xa_rollback(THD *thd)
DBUG_RETURN(TRUE);
}
- /*
- Resource Manager error is meaningless at this point, as we perform
- explicit rollback request by user. We must reset rm_error before
- calling ha_rollback(), so thd->transaction.xid structure gets reset
- by ha_rollback()/THD::transaction::cleanup().
- */
- thd->transaction.xid_state.rm_error= 0;
- if ((res= test(ha_rollback_trans(thd, TRUE))))
- my_error(ER_XAER_RMERR, MYF(0));
+ res= xa_trans_force_rollback(thd);
thd->variables.option_bits&= ~(OPTION_BEGIN | OPTION_KEEP_LOG);
thd->transaction.all.modified_non_trans_table= FALSE;
diff --git a/sql/unireg.cc b/sql/unireg.cc
index b4fbd2aea3e..2d75d1a6356 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,8 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Functions to create a unireg form-file from a FIELD and a fieldname-fieldinfo
@@ -244,13 +243,13 @@ bool mysql_create_frm(THD *thd, const char *file_name,
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)))
{
my_error(ER_TOO_LONG_TABLE_COMMENT, MYF(0),
- real_table_name, (uint) TABLE_COMMENT_MAXLEN);
+ real_table_name, static_cast<ulong>(TABLE_COMMENT_MAXLEN));
my_free(screen_buff);
DBUG_RETURN(1);
}
char warn_buff[MYSQL_ERRMSG_SIZE];
my_snprintf(warn_buff, sizeof(warn_buff), ER(ER_TOO_LONG_TABLE_COMMENT),
- real_table_name, (uint) TABLE_COMMENT_MAXLEN);
+ real_table_name, static_cast<ulong>(TABLE_COMMENT_MAXLEN));
/* do not push duplicate warnings */
if (!check_duplicate_warning(current_thd, warn_buff, strlen(warn_buff)))
push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -709,13 +708,14 @@ static bool pack_header(uchar *forminfo, enum legacy_db_type table_type,
if ((current_thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)))
{
- my_error(ER_TOO_LONG_FIELD_COMMENT, MYF(0),
- field->field_name, (uint) COLUMN_COMMENT_MAXLEN);
+ my_error(ER_TOO_LONG_FIELD_COMMENT, MYF(0), field->field_name,
+ static_cast<ulong>(COLUMN_COMMENT_MAXLEN));
DBUG_RETURN(1);
}
char warn_buff[MYSQL_ERRMSG_SIZE];
my_snprintf(warn_buff, sizeof(warn_buff), ER(ER_TOO_LONG_FIELD_COMMENT),
- field->field_name, (uint) COLUMN_COMMENT_MAXLEN);
+ field->field_name,
+ static_cast<ulong>(COLUMN_COMMENT_MAXLEN));
/* do not push duplicate warnings */
if (!check_duplicate_warning(current_thd, warn_buff, strlen(warn_buff)))
push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -825,7 +825,7 @@ static bool pack_header(uchar *forminfo, enum legacy_db_type table_type,
if (reclength > (ulong) file->max_record_length())
{
- my_error(ER_TOO_BIG_ROWSIZE, MYF(0), (uint) file->max_record_length());
+ my_error(ER_TOO_BIG_ROWSIZE, MYF(0), static_cast<long>(file->max_record_length()));
DBUG_RETURN(1);
}
/* Hack to avoid bugs with small static rows in MySQL */
diff --git a/sql/unireg.h b/sql/unireg.h
index 028cb0546d8..bafd9c96e47 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -1,7 +1,7 @@
#ifndef UNIREG_INCLUDED
#define UNIREG_INCLUDED
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -56,8 +56,6 @@ typedef struct st_ha_create_information HA_CREATE_INFO;
#define ER_THD_OR_DEFAULT(thd,X) ((thd) ? ER_THD(thd, X) : ER_DEFAULT(X))
-#define ERRMAPP 1 /* Errormap f|r my_error */
-
#define ME_INFO (ME_HOLDTANG+ME_OLDWIN+ME_NOREFRESH)
#define ME_ERROR (ME_BELL+ME_OLDWIN+ME_NOREFRESH)
#define MYF_RW MYF(MY_WME+MY_NABP) /* Vid my_read & my_write */
diff --git a/storage/Makefile.am b/storage/Makefile.am
deleted file mode 100644
index a188d8967be..00000000000
--- a/storage/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright (C) 2005-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-# Process this file with automake to create Makefile.in
-
-AUTOMAKE_OPTIONS = foreign
-
-# These are built from source in the Docs directory
-SUBDIRS = @mysql_se_dirs@
-DIST_SUBDIRS = @mysql_se_distdirs@
diff --git a/storage/archive/Makefile.am b/storage/archive/Makefile.am
deleted file mode 100644
index 14fcde4108b..00000000000
--- a/storage/archive/Makefile.am
+++ /dev/null
@@ -1,104 +0,0 @@
-# Copyright (C) 2005-2006 MySQL AB
-# Copyright (C) 2009 SUN Microsystems
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# 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
-
-#called from the top level Makefile
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(pkglibdir)/plugin
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/sql \
- -I$(srcdir) @ZLIB_INCLUDES@
-WRAPLIBS=
-
-LDADD =
-
-DEFS = @DEFS@
-
-noinst_HEADERS = ha_archive.h azlib.h
-noinst_PROGRAMS = archive_test archive_reader
-
-EXTRA_LTLIBRARIES = ha_archive.la
-pkgplugin_LTLIBRARIES = @plugin_archive_shared_target@
-ha_archive_la_LDFLAGS = -module -rpath $(pkgplugindir)
-ha_archive_la_CXXFLAGS= -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-ha_archive_la_CFLAGS = -shared $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-ha_archive_la_SOURCES = ha_archive.cc azio.c
-
-
-EXTRA_LIBRARIES = libarchive.a
-noinst_LIBRARIES = @plugin_archive_static_target@
-libarchive_a_CXXFLAGS = $(AM_CXXFLAGS)
-libarchive_a_CFLAGS = $(AM_CFLAGS)
-libarchive_a_SOURCES = ha_archive.cc azio.c
-
-
-archive_test_SOURCES = archive_test.c azio.c
-archive_test_CFLAGS = $(AM_CFLAGS)
-archive_test_LDADD = $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a \
- @ZLIB_LIBS@
-archive_test_LDFLAGS = @NOINST_LDFLAGS@
-
-archive_reader_SOURCES = archive_reader.c azio.c
-archive_reader_CFLAGS = $(AM_CFLAGS)
-archive_reader_LDADD = $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a \
- @ZLIB_LIBS@
-archive_reader_LDFLAGS = @NOINST_LDFLAGS@
-
-
-EXTRA_DIST = CMakeLists.txt plug.in
-
-if HAVE_DTRACE_DASH_G
-# The object for static and dynamic linking of archive differ
-# For static linkage of archive to mysqld
-
-libarchive_a_LIBADD = probes_mysql.o
-libarchive_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers
-# For archive as shared library
-ha_archive_la_LIBADD = probes_sh_mysql.o
-# Hack: We "depend" on ".libs/" but have no rule for it,
-# but it is created as a byproduct of the ".lo"
-DTRACESHAREDDEPS = ha_archive_la-ha_archive.lo
-DTRACESHAREDFILES = ha_archive_la-ha_archive.o
-DTRACEPROVIDER = probes_mysql.d
-ha_archive_la_DEPENDENCIES = probes_sh_mysql.o $(DTRACESHAREDDEPS) dtrace_providers
-
-CLEANFILES = $(DTRACEPROVIDER) dtrace_files dtrace_providers $(DTRACESHAREDFILES)
-DTRACEFILES = libarchive_a-ha_archive.o
-
-dtrace_files:
- echo $(DTRACEFILES) > $@
-dtrace_providers: probes_mysql.d
- echo $(DTRACEPROVIDER) > $@
-probes_mysql.d:
- -$(RM) -f probes_mysql.d
- $(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d
- echo timestamp > dtrace_sources
-
-probes_sh_mysql.o: $(DTRACEPROVIDER) $(DTRACESHAREDDEPS)
- $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACESHAREDFILES) -o $@
- $(CP) $(DTRACESHAREDFILES) .libs
-probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES)
- $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACEFILES) -o $@
-
-endif
diff --git a/storage/archive/azio.c b/storage/archive/azio.c
index 936a179b5b4..8fc85965cf0 100644
--- a/storage/archive/azio.c
+++ b/storage/archive/azio.c
@@ -116,6 +116,15 @@ int az_open (azio_stream *s, const char *path, int Flags, File fd)
errno = 0;
s->file = fd < 0 ? my_open(path, Flags, MYF(0)) : fd;
+ DBUG_EXECUTE_IF("simulate_archive_open_failure",
+ {
+ if (s->file >= 0)
+ {
+ my_close(s->file, MYF(0));
+ s->file= -1;
+ my_errno= EMFILE;
+ }
+ });
if (s->file < 0 )
{
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 8144ea5f319..2e001efc1dc 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -1,17 +1,19 @@
-/* Copyright (C) 2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
- 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 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.
+ 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 */
+ 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 */
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
@@ -20,6 +22,7 @@
#include "sql_priv.h"
#include "probes_mysql.h"
#include "sql_class.h" // SSV
+#include "sql_table.h"
#include <myisam.h>
#include "ha_archive.h"
@@ -256,7 +259,7 @@ int archive_discover(handlerton *hton, THD* thd, const char *db,
char *frm_ptr;
MY_STAT file_stat;
- fn_format(az_file, name, db, ARZ, MY_REPLACE_EXT | MY_UNPACK_FILENAME);
+ build_table_filename(az_file, sizeof(az_file) - 1, db, name, ARZ, 0);
if (!(my_stat(az_file, &file_stat, MYF(0))))
goto err;
@@ -934,7 +937,7 @@ int ha_archive::write_row(uchar *buf)
*/
azflush(&(share->archive_write), Z_SYNC_FLUSH);
/*
- Set the position of the local read thread to the beginning postion.
+ Set the position of the local read thread to the beginning position.
*/
if (read_data_header(&archive))
{
@@ -1190,7 +1193,7 @@ int ha_archive::unpack_row(azio_stream *file_to_read, uchar *record)
ptr+= table->s->null_bytes;
for (Field **field=table->field ; *field ; field++)
{
- if (!((*field)->is_null()))
+ if (!((*field)->is_null_in_record(record)))
{
ptr= (*field)->unpack(record + (*field)->offset(table->record[0]), ptr);
}
@@ -1670,9 +1673,9 @@ int ha_archive::end_bulk_insert()
This is done for security reasons. In a later version we will enable this by
allowing the user to select a different row format.
*/
-int ha_archive::delete_all_rows()
+int ha_archive::truncate()
{
- DBUG_ENTER("ha_archive::delete_all_rows");
+ DBUG_ENTER("ha_archive::truncate");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
}
@@ -1702,11 +1705,12 @@ int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt)
azflush(&(share->archive_write), Z_SYNC_FLUSH);
mysql_mutex_unlock(&share->mutex);
+ if (init_archive_reader())
+ DBUG_RETURN(HA_ADMIN_CORRUPT);
/*
Now we will rewind the archive file so that we are positioned at the
start of the file.
*/
- init_archive_reader();
read_data_header(&archive);
while (!(rc= get_row(&archive, table->record[0])))
count--;
diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h
index 712c1e1358d..034b759e091 100644
--- a/storage/archive/ha_archive.h
+++ b/storage/archive/ha_archive.h
@@ -90,7 +90,7 @@ public:
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_HAS_RECORDS | HA_CAN_REPAIR |
HA_FILE_BASED | HA_CAN_INSERT_DELAYED | HA_CAN_GEOMETRY);
}
ulong index_flags(uint idx, uint part, bool all_parts) const
@@ -115,7 +115,7 @@ public:
int close(void);
int write_row(uchar * buf);
int real_write_row(uchar *buf, azio_stream *writer);
- int delete_all_rows();
+ int truncate();
int rnd_init(bool scan=1);
int rnd_next(uchar *buf);
int rnd_pos(uchar * buf, uchar *pos);
diff --git a/storage/archive/plug.in b/storage/archive/plug.in
deleted file mode 100644
index 52131b12e6b..00000000000
--- a/storage/archive/plug.in
+++ /dev/null
@@ -1,4 +0,0 @@
-MYSQL_STORAGE_ENGINE(archive,, [Archive Storage Engine],
- [Archive Storage Engine], [max,max-no-ndb])
-MYSQL_PLUGIN_STATIC(archive, [libarchive.a])
-MYSQL_PLUGIN_DYNAMIC(archive, [ha_archive.la])
diff --git a/storage/blackhole/Makefile.am b/storage/blackhole/Makefile.am
deleted file mode 100644
index 7016f265365..00000000000
--- a/storage/blackhole/Makefile.am
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright (C) 2005-2006 MySQL AB, 2009 Sun Microsystems, Inc.
-# All rights reserved.
-# 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
-
-#called from the top level Makefile
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(pkglibdir)/plugin
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/sql \
- -I$(srcdir)
-WRAPLIBS=
-
-LDADD =
-
-DEFS = @DEFS@
-
-noinst_HEADERS = ha_blackhole.h
-
-EXTRA_LTLIBRARIES = ha_blackhole.la
-pkgplugin_LTLIBRARIES = @plugin_blackhole_shared_target@
-ha_blackhole_la_LDFLAGS=-module -rpath $(pkgplugindir)
-ha_blackhole_la_CXXFLAGS=-shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-ha_blackhole_la_SOURCES=ha_blackhole.cc
-
-
-EXTRA_LIBRARIES = libblackhole.a
-noinst_LIBRARIES = @plugin_blackhole_static_target@
-libblackhole_a_CXXFLAGS=$(AM_CXXFLAGS)
-libblackhole_a_SOURCES= ha_blackhole.cc
-
-
-EXTRA_DIST = CMakeLists.txt plug.in
-
-if HAVE_DTRACE_DASH_G
-# The object for static and dynamic linking of blackhole differ
-# For static linkage of blackhole to mysqld
-
-libblackhole_a_LIBADD = probes_mysql.o
-libblackhole_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers
-# For blackhole as shared library
-ha_blackhole_la_LIBADD = probes_sh_mysql.o
-# Hack: We "depend" on ".libs/" but have no rule for it,
-# but it is created as a byproduct of the ".lo"
-DTRACESHAREDDEPS = ha_blackhole_la-ha_blackhole.lo
-DTRACESHAREDFILES = ha_blackhole_la-ha_blackhole.o
-DTRACEPROVIDER = probes_mysql.d
-ha_blackhole_la_DEPENDENCIES = probes_sh_mysql.o $(DTRACESHAREDDEPS) dtrace_providers
-
-CLEANFILES = $(DTRACEPROVIDERS) dtrace_files dtrace_providers $(DTRACESHAREDDEPS)
-DTRACEFILES = libblackhole_a-ha_blackhole.o
-
-dtrace_files:
- echo $(DTRACEFILES) > $@
-dtrace_providers: probes_mysql.d
- echo $(DTRACEPROVIDER) > $@
-probes_mysql.d:
- -$(RM) -f probes_mysql.d
- $(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d
- echo timestamp > dtrace_sources
-
-probes_sh_mysql.o: $(DTRACEPROVIDER) $(DTRACESHAREDDEPS)
- $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACESHAREDFILES) -o $@
- $(CP) $(DTRACESHAREDFILES) .libs
-probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES)
- $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACEFILES) -o $@
-
-endif
diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc
index 993ba9c7cd4..14eb24eaaa3 100644
--- a/storage/blackhole/ha_blackhole.cc
+++ b/storage/blackhole/ha_blackhole.cc
@@ -87,6 +87,16 @@ int ha_blackhole::create(const char *name, TABLE *table_arg,
DBUG_RETURN(0);
}
+/*
+ Intended to support partitioning.
+ Allows a particular partition to be truncated.
+*/
+int ha_blackhole::truncate()
+{
+ DBUG_ENTER("ha_blackhole::truncate");
+ DBUG_RETURN(0);
+}
+
const char *ha_blackhole::index_type(uint key_number)
{
DBUG_ENTER("ha_blackhole::index_type");
diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h
index 9de3c22c614..17066b6edce 100644
--- a/storage/blackhole/ha_blackhole.h
+++ b/storage/blackhole/ha_blackhole.h
@@ -76,6 +76,7 @@ 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 truncate();
int rnd_init(bool scan);
int rnd_next(uchar *buf);
int rnd_pos(uchar * buf, uchar *pos);
diff --git a/storage/blackhole/plug.in b/storage/blackhole/plug.in
deleted file mode 100644
index 725db0facba..00000000000
--- a/storage/blackhole/plug.in
+++ /dev/null
@@ -1,6 +0,0 @@
-MYSQL_STORAGE_ENGINE(blackhole,,[Blackhole Storage Engine],
- [Basic Write-only Read-never tables], [max,max-no-ndb])
-MYSQL_PLUGIN_DIRECTORY(blackhole, [storage/blackhole])
-MYSQL_PLUGIN_STATIC(blackhole, [libblackhole.a])
-MYSQL_PLUGIN_DYNAMIC(blackhole, [ha_blackhole.la])
-
diff --git a/storage/csv/Makefile.am b/storage/csv/Makefile.am
deleted file mode 100644
index 76e683ec282..00000000000
--- a/storage/csv/Makefile.am
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright (C) 2005-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#called from the top level Makefile
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-INCLUDES = -I$(top_builddir)/include \
- -I$(top_srcdir)/include \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/sql \
- -I$(srcdir)
-LDADD =
-
-DEFS = @DEFS@
-noinst_HEADERS = ha_tina.h transparent_file.h
-
-EXTRA_LTLIBRARIES = ha_csv.la
-pkglib_LTLIBRARIES = @plugin_csv_shared_target@
-ha_csv_la_LDFLAGS = -module -rpath $(MYSQLLIBdir)
-ha_csv_la_CXXFLAGS = -shared $(AM_CXXFLAGS) -DMYSQL_PLUGIN
-ha_csv_la_SOURCES = transparent_file.cc ha_tina.cc
-
-EXTRA_LIBRARIES = libcsv.a
-noinst_LIBRARIES = @plugin_csv_static_target@
-libcsv_a_CXXFLAGS = $(AM_CXXFLAGS)
-libcsv_a_SOURCES = transparent_file.cc ha_tina.cc
-
-EXTRA_DIST = CMakeLists.txt plug.in
-
-if HAVE_DTRACE_DASH_G
-libcsv_a_LIBADD = probes_mysql.o
-libcsv_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers
-CLEANFILES = probes_mysql.o dtrace_files dtrace_providers
-DTRACEFILES = libcsv_a-ha_tina.o
-DTRACEPROVIDER = probes_mysql.d
-CLEANFILES += $(DTRACEPROVIDER) dtrace_sources
-
-dtrace_files:
- echo $(DTRACEFILES) > $@
-dtrace_providers: probes_mysql.d
- echo $(DTRACEPROVIDER) > $@
-probes_mysql.d:
- -$(RM) -f probes_mysql.d
- $(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d
- echo timestamp > dtrace_sources
-
-probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES)
- $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACEFILES) -o $@
-endif
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h
index dc2fc743117..a2f12443528 100644
--- a/storage/csv/ha_tina.h
+++ b/storage/csv/ha_tina.h
@@ -108,7 +108,8 @@ public:
ulonglong table_flags() const
{
return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_NO_AUTO_INCREMENT |
- HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE);
+ HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
+ HA_CAN_REPAIR);
}
ulong index_flags(uint idx, uint part, bool all_parts) const
{
diff --git a/storage/csv/plug.in b/storage/csv/plug.in
deleted file mode 100644
index bbc69680fcd..00000000000
--- a/storage/csv/plug.in
+++ /dev/null
@@ -1,5 +0,0 @@
-MYSQL_STORAGE_ENGINE(csv,, [CSV Storage Engine],
- [Stores tables in text CSV format])
-MYSQL_PLUGIN_DIRECTORY(csv, [storage/csv])
-MYSQL_PLUGIN_STATIC(csv, [libcsv.a])
-MYSQL_PLUGIN_MANDATORY(csv) dnl Used for logging
diff --git a/storage/example/Makefile.am b/storage/example/Makefile.am
deleted file mode 100644
index a8b0506e8dd..00000000000
--- a/storage/example/Makefile.am
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright (C) 2005-2006 MySQL AB, 2009 Sun Microsystems, Inc.
-# All rights reserved.
-# 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
-
-#called from the top level Makefile
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(pkglibdir)/plugin
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/sql \
- -I$(srcdir)
-WRAPLIBS=
-
-LDADD =
-
-DEFS = @DEFS@
-
-noinst_HEADERS = ha_example.h
-
-EXTRA_LTLIBRARIES = ha_example.la
-pkgplugin_LTLIBRARIES = @plugin_example_shared_target@
-ha_example_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
-ha_example_la_CXXFLAGS= -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-ha_example_la_SOURCES = ha_example.cc
-
-EXTRA_LIBRARIES = libexample.a
-noinst_LIBRARIES = @plugin_example_static_target@
-libexample_a_CXXFLAGS = $(AM_CXXFLAGS)
-libexample_a_SOURCES= ha_example.cc
-
-
-EXTRA_DIST = CMakeLists.txt plug.in
-
-if HAVE_DTRACE_DASH_G
-# The object for static and dynamic linking of example differ
-# For static linkage of example to mysqld
-# That's actually not needed as example is only dynamic loadable, but for completion
-libexample_a_LIBADD = probes_mysql.o
-libexample_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers
-# For example as shared library
-ha_example_la_LIBADD = probes_sh_mysql.o
-# Hack: We "depend" on ".libs/" but have no rule for it,
-# but it is created as a byproduct of the ".lo"
-DTRACESHAREDDEPS = ha_example_la-ha_example.lo
-DTRACESHAREDFILES = ha_example_la-ha_example.o
-DTRACEPROVIDER = probes_mysql.d
-ha_example_la_DEPENDENCIES = probes_sh_mysql.o $(DTRACESHAREDDEPS) dtrace_providers
-
-CLEANFILES = $(DTRACEPROVIDER) dtrace_files dtrace_providers $(DTRACESHAREDFILES)
-DTRACEFILES = libexample_a-ha_example.o
-
-dtrace_files:
- echo $(DTRACEFILES) > $@
-dtrace_providers: probes_mysql.d
- echo $(DTRACEPROVIDER) > $@
-probes_mysql.d:
- -$(RM) -f probes_mysql.d
- $(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d
- echo timestamp > dtrace_sources
-
-probes_sh_mysql.o: $(DTRACEPROVIDER) $(DTRACESHAREDDEPS)
- $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACESHAREDFILES) -o $@
- $(CP) $(DTRACESHAREDFILES) .libs
-probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES)
- $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACEFILES) -o $@
-
-endif
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index 2a076f0dc14..eeb9b12007b 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -439,14 +439,14 @@ int ha_example::close(void)
is happening. buf() is a byte array of data. You can use the field
information to extract the data from the native byte array type.
- @details
+ @details
Example of this would be:
- @code
+ @code
for (Field **field=table->field ; *field ; field++)
{
...
}
- @endcode
+ @endcode
See ha_tina.cc for an example of extracting all of the data as strings.
ha_berekly.cc has an example of how to store it intact by "packing" it
@@ -458,7 +458,7 @@ int ha_example::close(void)
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.
- @see
+ @see
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
*/
@@ -483,19 +483,19 @@ int ha_example::write_row(uchar *buf)
Keep in mind that the server can do updates based on ordering if an ORDER BY
clause was used. Consecutive ordering is not guaranteed.
- @details
+ @details
Currently new_data will not have an updated auto_increament record, or
and updated timestamp field. You can do these for example by doing:
- @code
+ @code
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
if (table->next_number_field && record == table->record[0])
update_auto_increment();
- @endcode
+ @endcode
Called from sql_select.cc, sql_acl.cc, sql_update.cc, and sql_insert.cc.
- @see
+ @see
sql_select.cc, sql_acl.cc, sql_update.cc and sql_insert.cc
*/
int ha_example::update_row(const uchar *old_data, uchar *new_data)
@@ -590,10 +590,10 @@ int ha_example::index_prev(uchar *buf)
@brief
index_first() asks for the first key in the index.
- @details
+ @details
Called from opt_range.cc, opt_sum.cc, sql_handler.cc, and sql_select.cc.
- @see
+ @see
opt_range.cc, opt_sum.cc, sql_handler.cc and sql_select.cc
*/
int ha_example::index_first(uchar *buf)
@@ -611,10 +611,10 @@ int ha_example::index_first(uchar *buf)
@brief
index_last() asks for the last key in the index.
- @details
+ @details
Called from opt_range.cc, opt_sum.cc, sql_handler.cc, and sql_select.cc.
- @see
+ @see
opt_range.cc, opt_sum.cc, sql_handler.cc and sql_select.cc
*/
int ha_example::index_last(uchar *buf)
@@ -634,11 +634,11 @@ int ha_example::index_last(uchar *buf)
scan. See the example in the introduction at the top of this file to see when
rnd_init() is called.
- @details
+ @details
Called from filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc,
and sql_update.cc.
- @see
+ @see
filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc and sql_update.cc
*/
int ha_example::rnd_init(bool scan)
@@ -661,11 +661,11 @@ int ha_example::rnd_end()
The Field structure for the table is the key to getting data into buf
in a manner that will allow the server to understand it.
- @details
+ @details
Called from filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc,
and sql_update.cc.
- @see
+ @see
filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc and sql_update.cc
*/
int ha_example::rnd_next(uchar *buf)
@@ -685,11 +685,11 @@ int ha_example::rnd_next(uchar *buf)
position() is called after each call to rnd_next() if the data needs
to be ordered. You can do something like the following to store
the position:
- @code
+ @code
my_store_ptr(ref, ref_length, current_position);
- @endcode
+ @endcode
- @details
+ @details
The server uses ref to store data. ref_length in the above case is
the size needed to store current_position. ref is just a byte array
that the server will maintain. If you are using offsets to mark rows, then
@@ -698,7 +698,7 @@ int ha_example::rnd_next(uchar *buf)
Called from filesort.cc, sql_select.cc, sql_delete.cc, and sql_update.cc.
- @see
+ @see
filesort.cc, sql_select.cc, sql_delete.cc and sql_update.cc
*/
void ha_example::position(const uchar *record)
@@ -715,10 +715,10 @@ void ha_example::position(const uchar *record)
ref. You can use ha_get_ptr(pos,ref_length) to retrieve whatever key
or position you saved when position() was called.
- @details
+ @details
Called from filesort.cc, records.cc, sql_insert.cc, sql_select.cc, and sql_update.cc.
- @see
+ @see
filesort.cc, records.cc, sql_insert.cc, sql_select.cc and sql_update.cc
*/
int ha_example::rnd_pos(uchar *buf, uchar *pos)
@@ -738,15 +738,15 @@ int ha_example::rnd_pos(uchar *buf, uchar *pos)
::info() is used to return information to the optimizer. See my_base.h for
the complete description.
- @details
+ @details
Currently this table handler doesn't implement most of the fields really needed.
SHOW also makes use of this data.
You will probably want to have the following in your code:
- @code
+ @code
if (records < 2)
records = 2;
- @endcode
+ @endcode
The reason is that the server will optimize for cases of only a single
record. If, in a table scan, you don't know the number of records, it
will probably be better to set records to two so you can return as many
@@ -765,7 +765,7 @@ int ha_example::rnd_pos(uchar *buf, uchar *pos)
sql_select.cc, sql_select.cc, sql_show.cc, sql_show.cc, sql_show.cc, sql_show.cc,
sql_table.cc, sql_union.cc, and sql_update.cc.
- @see
+ @see
filesort.cc, ha_heap.cc, item_sum.cc, opt_sum.cc, sql_delete.cc, sql_delete.cc,
sql_derived.cc, sql_select.cc, sql_select.cc, sql_select.cc, sql_select.cc,
sql_select.cc, sql_show.cc, sql_show.cc, sql_show.cc, sql_show.cc, sql_table.cc,
@@ -799,14 +799,14 @@ int ha_example::extra(enum ha_extra_function operation)
Used to delete all rows in a table, including cases of truncate and cases where
the optimizer realizes that all rows will be removed as a result of an SQL statement.
- @details
+ @details
Called from item_sum.cc by Item_func_group_concat::clear(),
Item_sum_count_distinct::clear(), and Item_func_group_concat::clear().
Called from sql_delete.cc by mysql_delete().
Called from sql_select.cc by JOIN::reinit().
Called from sql_union.cc by st_select_lex_unit::exec().
- @see
+ @see
Item_func_group_concat::clear(), Item_sum_count_distinct::clear() and
Item_func_group_concat::clear() in item_sum.cc;
mysql_delete() in sql_delete.cc;
@@ -822,17 +822,40 @@ int ha_example::delete_all_rows()
/**
@brief
+ Used for handler specific truncate table. The table is locked in
+ exclusive mode and handler is responsible for reseting the auto-
+ increment counter.
+
+ @details
+ Called from Truncate_statement::handler_truncate.
+ Not used if the handlerton supports HTON_CAN_RECREATE, unless this
+ engine can be used as a partition. In this case, it is invoked when
+ a particular partition is to be truncated.
+
+ @see
+ Truncate_statement in sql_truncate.cc
+ Remarks in handler::truncate.
+*/
+int ha_example::truncate()
+{
+ DBUG_ENTER("ha_example::truncate");
+ DBUG_RETURN(HA_ERR_WRONG_COMMAND);
+}
+
+
+/**
+ @brief
This create a lock on the table. If you are implementing a storage engine
that can handle transacations look at ha_berkely.cc to see how you will
want to go about doing this. Otherwise you should consider calling flock()
here. Hint: Read the section "locking functions for mysql" in lock.cc to understand
this.
- @details
+ @details
Called from lock.cc by lock_external() and unlock_external(). Also called
from sql_table.cc by copy_data_between_tables().
- @see
+ @see
lock.cc by lock_external() and unlock_external() in lock.cc;
the section "locking functions for mysql" in lock.cc;
copy_data_between_tables() in sql_table.cc.
@@ -850,7 +873,7 @@ int ha_example::external_lock(THD *thd, int lock_type)
should be needed for the table. For updates/deletes/inserts we get WRITE
locks, for SELECT... we get read locks.
- @details
+ @details
Before adding the lock into the table lock handler (see thr_lock.c),
mysqld calls store lock with the requested locks. Store lock can now
modify a write lock to a read lock (or some other lock), ignore the
@@ -873,12 +896,12 @@ int ha_example::external_lock(THD *thd, int lock_type)
Called from lock.cc by get_lock_data().
- @note
+ @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
+ @see
get_lock_data() in lock.cc
*/
THR_LOCK_DATA **ha_example::store_lock(THD *thd,
@@ -899,7 +922,7 @@ THR_LOCK_DATA **ha_example::store_lock(THD *thd,
shared references released). The variable name will just be the name of
the table. You will need to remove any files you have created at this point.
- @details
+ @details
If you do not implement this, the default delete_table() is called from
handler.cc and it will delete all files with the file extensions returned
by bas_ext().
@@ -908,7 +931,7 @@ THR_LOCK_DATA **ha_example::store_lock(THD *thd,
during create if the table_flag HA_DROP_BEFORE_CREATE was specified for
the storage engine.
- @see
+ @see
delete_table and ha_create_table() in handler.cc
*/
int ha_example::delete_table(const char *name)
@@ -1113,7 +1136,7 @@ static int show_func_example(MYSQL_THD thd, struct st_mysql_show_var *var,
var->type= SHOW_CHAR;
var->value= buf; // it's of SHOW_VAR_FUNC_BUFF_SIZE bytes
my_snprintf(buf, SHOW_VAR_FUNC_BUFF_SIZE,
- "enum_var is %u, ulong_var is %lu, %.6b", // %b is MySQL extension
+ "enum_var is %lu, ulong_var is %lu, %.6b", // %b is MySQL extension
srv_enum_var, srv_ulong_var, "really");
return 0;
}
diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h
index 27b97395544..98ef563b877 100644
--- a/storage/example/ha_example.h
+++ b/storage/example/ha_example.h
@@ -245,6 +245,7 @@ public:
int extra(enum ha_extra_function operation);
int external_lock(THD *thd, int lock_type); ///< required
int delete_all_rows(void);
+ int truncate();
ha_rows records_in_range(uint inx, key_range *min_key,
key_range *max_key);
int delete_table(const char *from);
diff --git a/storage/example/plug.in b/storage/example/plug.in
deleted file mode 100644
index ee6beaac64f..00000000000
--- a/storage/example/plug.in
+++ /dev/null
@@ -1,3 +0,0 @@
-MYSQL_STORAGE_ENGINE(example,, [Example Storage Engine],
- [Example for Storage Engines for developers], [max,max-no-ndb])
-MYSQL_PLUGIN_DYNAMIC(example, [ha_example.la])
diff --git a/storage/federated/Makefile.am b/storage/federated/Makefile.am
deleted file mode 100644
index 28b71900af2..00000000000
--- a/storage/federated/Makefile.am
+++ /dev/null
@@ -1,84 +0,0 @@
-# Copyright (C) 2005-2006 MySQL AB, 2009 Sun Microsystems, Inc.
-# All rights reserved.
-# 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
-
-#called from the top level Makefile
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(pkglibdir)/plugin
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/sql \
- -I$(srcdir)
-
-WRAPLIBS=
-
-DEFS = @DEFS@
-
-noinst_HEADERS = ha_federated.h
-
-EXTRA_LTLIBRARIES = ha_federated.la
-pkgplugin_LTLIBRARIES = @plugin_federated_shared_target@
-ha_federated_la_LDFLAGS = -module -rpath $(pkgplugindir) \
- -L$(top_builddir)/libservices -lmysqlservices
-ha_federated_la_CXXFLAGS= -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-ha_federated_la_CFLAGS = -shared $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-ha_federated_la_SOURCES = ha_federated.cc $(top_srcdir)/mysys/string.c
-
-
-EXTRA_LIBRARIES = libfederated.a
-noinst_LIBRARIES = @plugin_federated_static_target@
-libfederated_a_CXXFLAGS = $(AM_CXXFLAGS)
-libfederated_a_SOURCES= ha_federated.cc
-
-
-EXTRA_DIST = CMakeLists.txt plug.in
-
-if HAVE_DTRACE_DASH_G
-# The object for static and dynamic linking of federated differ
-# For static linkage of federated to mysqld
-
-libfederated_a_LIBADD = probes_mysql.o
-libfederated_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers
-# For federated as shared library
-ha_federated_la_LIBADD = probes_sh_mysql.o
-# Hack: We "depend" on ".libs/" but have no rule for it,
-# but it is created as a byproduct of the ".lo"
-DTRACESHAREDDEPS = ha_federated_la-ha_federated.lo
-DTRACESHAREDFILES = ha_federated_la-ha_federated.o
-DTRACEPROVIDER = probes_mysql.d
-ha_federated_la_DEPENDENCIES = probes_sh_mysql.o $(DTRACESHAREDDEPS) dtrace_providers
-
-CLEANFILES = $(DTRACEPROVIDER) dtrace_files dtrace_providers $(DTRACESHAREDFILES)
-DTRACEFILES = libfederated_a-ha_federated.o
-
-dtrace_files:
- echo $(DTRACEFILES) > $@
-dtrace_providers: probes_mysql.d
- echo $(DTRACEPROVIDER) > $@
-probes_mysql.d:
- -$(RM) -f probes_mysql.d
- $(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d
- echo timestamp > dtrace_sources
-
-probes_sh_mysql.o: $(DTRACEPROVIDER) $(DTRACESHAREDDEPS)
- $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACESHAREDFILES) -o $@
- $(CP) $(DTRACESHAREDFILES) .libs
-probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES)
- $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACEFILES) -o $@
-
-endif
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index f38f71b15ee..17412808d44 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -3044,6 +3044,16 @@ int ha_federated::delete_all_rows()
/*
+ Used to manually truncate the table via a delete of all rows in a table.
+*/
+
+int ha_federated::truncate()
+{
+ return delete_all_rows();
+}
+
+
+/*
The idea with handler::store_lock() is the following:
The statement decided which locks we should need for the table
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
index be52a54be50..ad74521042e 100644
--- a/storage/federated/ha_federated.h
+++ b/storage/federated/ha_federated.h
@@ -149,7 +149,8 @@ public:
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);
+ HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY |
+ HA_CAN_REPAIR);
}
/*
This is a bitmap of flags that says how the storage engine
@@ -248,6 +249,7 @@ public:
int optimize(THD* thd, HA_CHECK_OPT* check_opt);
int delete_all_rows(void);
+ int truncate();
int create(const char *name, TABLE *form,
HA_CREATE_INFO *create_info); //required
ha_rows records_in_range(uint inx, key_range *start_key,
diff --git a/storage/federated/plug.in b/storage/federated/plug.in
deleted file mode 100644
index 714888b2ebf..00000000000
--- a/storage/federated/plug.in
+++ /dev/null
@@ -1,5 +0,0 @@
-MYSQL_STORAGE_ENGINE(federated,,[Federated Storage Engine],
- [Connects to tables on remote MySQL servers], [])
-MYSQL_PLUGIN_STATIC(federated, [libfederated.a])
-MYSQL_PLUGIN_DYNAMIC(federated, [ha_federated.la])
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(federated, [ha_federated.cc])
diff --git a/storage/federatedx/plug.in b/storage/federatedx/plug.in
deleted file mode 100644
index 95afe270f4c..00000000000
--- a/storage/federatedx/plug.in
+++ /dev/null
@@ -1,5 +0,0 @@
-MYSQL_STORAGE_ENGINE(federatedx,,[FederatedX Storage Engine],
- [FederatedX Storage Engine], [max,max-no-ndb])
-MYSQL_PLUGIN_DYNAMIC(federatedx, [ha_federatedx.la])
-MYSQL_PLUGIN_STATIC(federatedx, [libfederatedx.a])
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(federatedx, [ha_federatedx.cc])
diff --git a/storage/heap/Makefile.am b/storage/heap/Makefile.am
deleted file mode 100644
index 677b2d60269..00000000000
--- a/storage/heap/Makefile.am
+++ /dev/null
@@ -1,73 +0,0 @@
-# Copyright (C) 2000-2002, 2005-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/sql \
- -I$(srcdir)
-WRAPLIBS=
-
-LDADD =
-
-DEFS = @DEFS@
-pkglib_LIBRARIES = libheap.a
-noinst_PROGRAMS = hp_test1 hp_test2
-noinst_LIBRARIES = libheap.a
-hp_test1_LDFLAGS = @NOINST_LDFLAGS@
-hp_test1_LDADD = libheap.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a
-hp_test2_LDFLAGS = @NOINST_LDFLAGS@
-hp_test2_LDADD = libheap.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a
-noinst_HEADERS = heapdef.h ha_heap.h
-libheap_a_SOURCES = hp_open.c hp_extra.c hp_close.c hp_panic.c hp_info.c \
- hp_rrnd.c hp_scan.c hp_update.c hp_write.c hp_delete.c \
- hp_rsame.c hp_create.c hp_rename.c hp_rfirst.c \
- hp_rnext.c hp_rlast.c hp_rprev.c hp_clear.c \
- hp_rkey.c hp_block.c \
- ha_heap.cc \
- hp_hash.c _check.c _rectest.c hp_static.c
-
-
-EXTRA_DIST = CMakeLists.txt plug.in
-
-if HAVE_DTRACE_DASH_G
-libheap_a_LIBADD = probes_mysql.o
-libheap_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers
-CLEANFILES = probes_mysql.o dtrace_files dtrace_providers
-DTRACEFILES = ha_heap.o
-DTRACEPROVIDER = probes_mysql.d
-CLEANFILES += $(DTRACEPROVIDER) dtrace_sources
-
-dtrace_files:
- echo $(DTRACEFILES) > $@
-dtrace_providers: probes_mysql.d
- echo $(DTRACEPROVIDER) > $@
-probes_mysql.d:
- -$(RM) -f probes_mysql.d
- $(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d
- echo timestamp > dtrace_sources
-
-probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES)
- $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACEFILES) -o $@
-endif
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 93bee5ad7f1..fc6e89e54e0 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -157,11 +157,11 @@ int ha_heap::close(void)
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
+ '/'-delimited path in table->s->path, while ha_heap::open() was called
with '\'-delimited path.
*/
-handler *ha_heap::clone(MEM_ROOT *mem_root)
+handler *ha_heap::clone(const char *name, 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,
@@ -455,6 +455,13 @@ int ha_heap::delete_all_rows()
}
+int ha_heap::truncate()
+{
+ int error= delete_all_rows();
+ return error ? error : reset_auto_increment(0);
+}
+
+
int ha_heap::reset_auto_increment(ulonglong value)
{
file->s->auto_increment= value;
diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h
index 7185fbc7720..cc335870f06 100644
--- a/storage/heap/ha_heap.h
+++ b/storage/heap/ha_heap.h
@@ -35,7 +35,7 @@ class ha_heap: public handler
public:
ha_heap(handlerton *hton, TABLE_SHARE *table);
~ha_heap() {}
- handler *clone(MEM_ROOT *mem_root);
+ handler *clone(const char *name, MEM_ROOT *mem_root);
const char *table_type() const
{
return (table->in_use->variables.sql_mode & MODE_MYSQL323) ?
@@ -99,6 +99,7 @@ public:
int reset();
int external_lock(THD *thd, int lock_type);
int delete_all_rows(void);
+ int truncate();
int reset_auto_increment(ulonglong value);
int disable_indexes(uint mode);
int enable_indexes(uint mode);
diff --git a/storage/heap/heapdef.h b/storage/heap/heapdef.h
index bc3c6bf7239..87866678c2f 100644
--- a/storage/heap/heapdef.h
+++ b/storage/heap/heapdef.h
@@ -17,9 +17,7 @@
#include <my_base.h> /* This includes global */
C_MODE_START
-#ifdef THREAD
#include <my_pthread.h>
-#endif
#include "heap.h" /* Structs & some defines */
#include "my_tree.h"
@@ -102,14 +100,11 @@ extern void hp_clear(HP_SHARE *info);
extern void hp_clear_keys(HP_SHARE *info);
extern uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
key_part_map keypart_map);
-#ifdef THREAD
+
extern mysql_mutex_t THR_LOCK_heap;
-#endif
#ifdef HAVE_PSI_INTERFACE
-#ifdef THREAD
extern PSI_mutex_key hp_key_mutex_HP_SHARE_intern_lock;
-#endif /* THREAD */
void init_heap_psi_keys();
#endif /* HAVE_PSI_INTERFACE */
diff --git a/storage/heap/hp_block.c b/storage/heap/hp_block.c
index 7f6cc1ef90a..41391fba060 100644
--- a/storage/heap/hp_block.c
+++ b/storage/heap/hp_block.c
@@ -86,7 +86,6 @@ int hp_get_new_block(HP_BLOCK *block, size_t *alloc_length)
}
else
{
- dont_break(); /* Dont allow SIGHUP or SIGINT */
if ((uint) i == block->levels)
{
/* Adding a new level on top of the existing ones. */
@@ -117,7 +116,6 @@ int hp_get_new_block(HP_BLOCK *block, size_t *alloc_length)
allocated bytes. Use it as a leaf block.
*/
block->level_info[0].last_blocks= root;
- allow_break(); /* Allow SIGHUP & SIGINT */
}
return 0;
}
diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c
index bbf649c5e46..67fe0b3136f 100644
--- a/storage/heap/hp_create.c
+++ b/storage/heap/hp_create.c
@@ -192,11 +192,9 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info,
my_free(share);
goto err;
}
-#ifdef THREAD
thr_lock_init(&share->lock);
mysql_mutex_init(hp_key_mutex_HP_SHARE_intern_lock,
&share->intern_lock, MY_MUTEX_INIT_FAST);
-#endif
if (!create_info->internal_table)
{
share->open_list.data= (void*) share;
@@ -301,10 +299,8 @@ void hp_free(HP_SHARE *share)
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);
mysql_mutex_destroy(&share->intern_lock);
-#endif
my_free(share->name);
my_free(share);
return;
diff --git a/storage/heap/hp_delete.c b/storage/heap/hp_delete.c
index 9e9e28da335..ceba0fcf12e 100644
--- a/storage/heap/hp_delete.c
+++ b/storage/heap/hp_delete.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2002, 2004-200 MySQL AB
+/* Copyright (C) 2000-2002, 2004-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
diff --git a/storage/heap/hp_open.c b/storage/heap/hp_open.c
index 12d9bfe1ed3..5ac4da22e0a 100644
--- a/storage/heap/hp_open.c
+++ b/storage/heap/hp_open.c
@@ -37,9 +37,7 @@ HP_INFO *heap_open_from_share(HP_SHARE *share, int mode)
DBUG_RETURN(0);
}
share->open_count++;
-#ifdef THREAD
thr_lock_data_init(&share->lock,&info->lock,NULL);
-#endif
info->s= share;
info->lastkey= (uchar*) (info + 1);
info->recbuf= (uchar*) (info->lastkey + share->max_key_length);
diff --git a/storage/heap/hp_static.c b/storage/heap/hp_static.c
index e1ca7d1f445..a58ecb8b754 100644
--- a/storage/heap/hp_static.c
+++ b/storage/heap/hp_static.c
@@ -25,7 +25,6 @@
LIST *heap_open_list=0,*heap_share_list=0;
#ifdef HAVE_PSI_INTERFACE
-#ifdef THREAD
PSI_mutex_key hp_key_mutex_HP_SHARE_intern_lock;
static PSI_mutex_info all_heap_mutexes[]=
@@ -36,11 +35,9 @@ static PSI_mutex_info all_heap_mutexes[]=
THR_LOCK_heap is part of mysys, not storage/heap.
*/
};
-#endif /* THREAD */
void init_heap_psi_keys()
{
-#ifdef THREAD
const char* category= "memory";
int count;
@@ -49,7 +46,6 @@ void init_heap_psi_keys()
count= array_elements(all_heap_mutexes);
PSI_server->register_mutex(category, all_heap_mutexes, count);
-#endif /* THREAD */
}
#endif /* HAVE_PSI_INTERFACE */
diff --git a/storage/heap/hp_test2.c b/storage/heap/hp_test2.c
index 3ee903be7ed..af388867c3c 100644
--- a/storage/heap/hp_test2.c
+++ b/storage/heap/hp_test2.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 2000-2003, 2006 MySQL AB
+/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights
+ reserved
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
@@ -656,11 +657,6 @@ static int rnd(int max_value)
static sig_handler endprog(int sig_number __attribute__((unused)))
{
-#ifndef THREAD
- if (my_dont_interrupt)
- my_remember_signal(sig_number,endprog);
- else
-#endif
{
hp_panic(HA_PANIC_CLOSE);
my_end(1);
diff --git a/storage/heap/plug.in b/storage/heap/plug.in
deleted file mode 100644
index 50f31c60f2b..00000000000
--- a/storage/heap/plug.in
+++ /dev/null
@@ -1,7 +0,0 @@
-MYSQL_STORAGE_ENGINE(heap,no, [Memory Storage Engine],
- [Volatile memory based tables])
-MYSQL_PLUGIN_DIRECTORY(heap, [storage/heap])
-MYSQL_PLUGIN_STATIC(heap, [libheap.a])
-MYSQL_PLUGIN_MANDATORY(heap) dnl Memory tables
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(heap, [ha_heap.cc])
-
diff --git a/storage/ibmdb2i/CMakeLists.txt b/storage/ibmdb2i/CMakeLists.txt
deleted file mode 100644
index 54da2b00ef2..00000000000
--- a/storage/ibmdb2i/CMakeLists.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# 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
-
-CHECK_INCLUDE_FILES(qlgusr.h HAVE_PASE_ENVIRONMENT)
-IF(HAVE_PASE_ENVIRONMENT)
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_SOURCE_DIR}/include
- ${CMAKE_BINARY_DIR}/include
- ${CMAKE_SOURCE_DIR}/regex
- ${CMAKE_SOURCE_DIR}/sql
- ${CMAKE_CURRENT_SOURCE_DIR}
- /afs/rchland.ibm.com/lande/shadow/dev2000/osxpf/v5r4m0f.xpf/cur/cmvc/base.pgm/my.xpf/apis
- /afs/rchland.ibm.com/lande/shadow/dev2000/osxpf/v5r4m0.xpf/bld/cmvc/base.pgm/lg.xpf
- /afs/rchland.ibm.com/lande/shadow/dev2000/osxpf/v5r4m0.xpf/bld/cmvc/base.pgm/tq.xpf
-)
-
-
-SET (IBMDB2I_SOURCES ha_ibmdb2i.cc db2i_ileBridge.cc db2i_conversion.cc
- db2i_blobCollection.cc db2i_file.cc db2i_charsetSupport.cc
- db2i_collationSupport.cc db2i_errors.cc db2i_constraints.cc
- db2i_rir.cc db2i_sqlStatementStream.cc db2i_ioBuffers.cc db2i_myconv.cc)
-
-
-MYSQL_ADD_PLUGIN(ibmdb2i ${IBMDB2I_SOURCES} STORAGE_ENGINE LINK_LIBRARIES iconv)
-
-ENDIF(HAVE_PASE_ENVIRONMENT)
diff --git a/storage/ibmdb2i/Makefile.am b/storage/ibmdb2i/Makefile.am
deleted file mode 100644
index a9977de895d..00000000000
--- a/storage/ibmdb2i/Makefile.am
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# Copyright (c) 2007, 2008, IBM Corporation.
-# All rights reserved.
-#
-#
-
-#called from the top level Makefile
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(pkglibdir)/plugin
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/sql \
- -I$(srcdir) \
- -I$ /afs/rchland.ibm.com/lande/shadow/dev2000/osxpf/v5r4m0f.xpf/cur/cmvc/base.pgm/my.xpf/apis \
- -I$ /afs/rchland.ibm.com/lande/shadow/dev2000/osxpf/v5r4m0.xpf/bld/cmvc/base.pgm/lg.xpf \
- -I$ /afs/rchland.ibm.com/lande/shadow/dev2000/osxpf/v5r4m0.xpf/bld/cmvc/base.pgm/tq.xpf
-WRAPLIBS=
-
-LDADD =
-
-DEFS = @DEFS@
-
-noinst_HEADERS = ha_ibmdb2i.h db2i_collationSupport.h db2i_file.h \
- db2i_ioBuffers.h db2i_blobCollection.h \
- db2i_global.h db2i_misc.h db2i_charsetSupport.h db2i_errors.h \
- db2i_iconv.h db2i_myconv.h db2i_safeString.h db2i_sqlStatementStream.h \
- db2i_ileBridge.h db2i_validatedPointer.h
-
-EXTRA_LTLIBRARIES = ha_ibmdb2i.la
-pkgplugin_LTLIBRARIES = @plugin_ibmdb2i_shared_target@
-ha_ibmdb2i_la_LIBADD = -liconv
-ha_ibmdb2i_la_LDFLAGS = -module -rpath $(MYSQLLIBdir)
-ha_ibmdb2i_la_CXXFLAGS= $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-ha_ibmdb2i_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-ha_ibmdb2i_la_SOURCES = ha_ibmdb2i.cc db2i_ileBridge.cc db2i_conversion.cc \
- db2i_blobCollection.cc db2i_file.cc db2i_charsetSupport.cc \
- db2i_collationSupport.cc db2i_errors.cc db2i_constraints.cc \
- db2i_rir.cc db2i_sqlStatementStream.cc db2i_ioBuffers.cc \
- db2i_myconv.cc
-
-EXTRA_LIBRARIES = libibmdb2i.a
-noinst_LIBRARIES = @plugin_ibmdb2i_static_target@
-libibmdb2i_a_CXXFLAGS = $(AM_CXXFLAGS)
-libibmdb2i_a_CFLAGS = $(AM_CFLAGS)
-libibmdb2i_a_SOURCES= $(ha_ibmdb2i_la_SOURCES)
-
-
-EXTRA_DIST = CMakeLists.txt plug.in
diff --git a/storage/ibmdb2i/db2i_blobCollection.cc b/storage/ibmdb2i/db2i_blobCollection.cc
deleted file mode 100644
index 17101c9c0a4..00000000000
--- a/storage/ibmdb2i/db2i_blobCollection.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#include "db2i_blobCollection.h"
-
-/**
- Return the size to use when allocating space for blob reads.
-
- @param fieldIndex The field to allocate for
- @param[out] shouldProtect Indicates whether storage protection should be
- applied to the space, because the size returned is
- smaller than the maximum possible size.
-*/
-
-uint32
-BlobCollection::getSizeToAllocate(int fieldIndex, bool& shouldProtect)
-{
- Field* field = table->getMySQLTable()->field[fieldIndex];
- uint fieldLength = field->max_display_length();
-
- if (fieldLength <= MAX_FULL_ALLOCATE_BLOB_LENGTH)
- {
- shouldProtect = false;
- return fieldLength;
- }
-
- shouldProtect = true;
-
- uint curMaxSize = table->getBlobFieldActualSize(fieldIndex);
-
- uint defaultAllocSize = min(defaultAllocation, fieldLength);
-
- return max(defaultAllocSize, curMaxSize);
-
-}
-
-void
-BlobCollection::generateBuffer(int fieldIndex)
-{
- DBUG_ASSERT(table->db2Field(fieldIndex).isBlob());
-
- bool protect;
- buffers[table->getBlobIdFromField(fieldIndex)].Malloc(getSizeToAllocate(fieldIndex, protect), protect);
-
- return;
-}
-
-/**
- Realloc the read buffer associated with a blob field.
-
- This is used when the previous allocation for a blob field is found to be
- too small (this is discovered when QMY_READ trips over the protected boundary
- page).
-
- @param fieldIndex The field to be reallocated
- @param size The size of buffer to allocate for this field.
-*/
-
-ValidatedPointer<char>&
-BlobCollection::reallocBuffer(int fieldIndex, size_t size)
-{
- ProtectedBuffer& buf = buffers[table->getBlobIdFromField(fieldIndex)];
- if (size <= buf.allocLen())
- return buf.ptr();
-
- table->updateBlobFieldActualSize(fieldIndex, size);
-
- DBUG_PRINT("BlobCollection::reallocBuffer",("PERF: reallocing %d to %d: ", fieldIndex, size));
-
- bool protect;
- buf.Free();
- buf.Malloc(getSizeToAllocate(fieldIndex, protect), protect);
- return buf.ptr();
-}
diff --git a/storage/ibmdb2i/db2i_blobCollection.h b/storage/ibmdb2i/db2i_blobCollection.h
deleted file mode 100644
index 6a60394555f..00000000000
--- a/storage/ibmdb2i/db2i_blobCollection.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#ifndef DB2I_BLOBCOLLECTION_H
-#define DB2I_BLOBCOLLECTION_H
-
-#include "db2i_global.h"
-#include "db2i_file.h"
-
-/**
- @class ProtectedBuffer
- @brief Implements memory management for (optionally) protected buffers.
-
- Buffers created with the protection option will have a guard page set on the
- page following requested allocation size. The side effect is that the actual
- allocation is up to 2*4096-1 bytes larger than the size requested by the
- using code.
-*/
-
-class ProtectedBuffer
-{
-public:
- ProtectedBuffer() : protectBuf(false)
- {;}
-
- void Malloc(size_t size, bool protect = false)
- {
- protectBuf = protect;
- bufptr.alloc(size + (protectBuf ? 0x1fff : 0x0));
- if ((void*)bufptr != NULL)
- {
- len = size;
- if (protectBuf)
- mprotect(protectedPage(), 0x1000, PROT_NONE);
-#ifndef DBUG_OFF
- // Prevents a problem with DBUG_PRINT over-reading in recent versions of
- // MySQL
- *((char*)protectedPage()-1) = 0;
-#endif
- }
- }
-
- void Free()
- {
- if ((void*)bufptr != NULL)
- {
- if (protectBuf)
- mprotect(protectedPage(), 0x1000, PROT_READ | PROT_WRITE);
- bufptr.dealloc();
- }
- }
-
- ~ProtectedBuffer()
- {
- Free();
- }
-
- ValidatedPointer<char>& ptr() {return bufptr;}
- bool isProtected() const {return protectBuf;}
- size_t allocLen() const {return len;}
-private:
- void* protectedPage()
- {
- return (void*)(((address64_t)(void*)bufptr + len + 0x1000) & ~0xfff);
- }
-
- ValidatedPointer<char> bufptr;
- size_t len;
- bool protectBuf;
-
-};
-
-
-/**
- @class BlobCollection
- @brief Manages memory allocation for reading blobs associated with a table.
-
- Allocations are done on-demand and are protected with a guard page if less
- than the max possible size is allocated.
-*/
-class BlobCollection
-{
- public:
- BlobCollection(db2i_table* db2Table, uint32 defaultAllocSize) :
- defaultAllocation(defaultAllocSize), table(db2Table)
- {
- buffers = new ProtectedBuffer[table->getBlobCount()];
- }
-
- ~BlobCollection()
- {
- delete[] buffers;
- }
-
- ValidatedPointer<char>& getBufferPtr(int fieldIndex)
- {
- int blobIndex = table->getBlobIdFromField(fieldIndex);
- if ((char*)buffers[blobIndex].ptr() == NULL)
- generateBuffer(fieldIndex);
-
- return buffers[blobIndex].ptr();
- }
-
- ValidatedPointer<char>& reallocBuffer(int fieldIndex, size_t size);
-
-
- private:
-
- uint32 getSizeToAllocate(int fieldIndex, bool& shouldProtect);
- void generateBuffer(int fieldIndex);
-
- db2i_table* table; // The table being read
- ProtectedBuffer* buffers; // The buffers
- uint32 defaultAllocation;
- /* The default size to use when first allocating a buffer */
-};
-
-#endif
diff --git a/storage/ibmdb2i/db2i_charsetSupport.cc b/storage/ibmdb2i/db2i_charsetSupport.cc
deleted file mode 100644
index f5a3a74025e..00000000000
--- a/storage/ibmdb2i/db2i_charsetSupport.cc
+++ /dev/null
@@ -1,826 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-
-#include "db2i_charsetSupport.h"
-#include "as400_types.h"
-#include "as400_protos.h"
-#include "db2i_ileBridge.h"
-#include "qlgusr.h"
-#include "db2i_errors.h"
-
-
-/*
- The following arrays define a mapping between IANA-style text descriptors and
- IBM i CCSID text descriptors. The mapping is a 1-to-1 correlation between
- corresponding array slots.
-*/
-#define MAX_IANASTRING 23
-static const char ianaStringType[MAX_IANASTRING][10] =
-{
- {"ascii"},
- {"Big5"}, //big5
- {"cp1250"},
- {"cp1251"},
- {"cp1256"},
- {"cp850"},
- {"cp852"},
- {"cp866"},
- {"IBM943"}, //cp932
- {"EUC-KR"}, //euckr
- {"IBM1381"}, //gb2312
- {"IBM1386"}, //gbk
- {"greek"},
- {"hebrew"},
- {"latin1"},
- {"latin2"},
- {"latin5"},
- {"macce"},
- {"tis620"},
- {"Shift_JIS"}, //sjis
- {"ucs2"},
- {"EUC-JP"}, //ujis
- {"utf8"}
-};
-static const char ccsidType[MAX_IANASTRING][6] =
-{
- {"367"}, //ascii
- {"950"}, //big5
- {"1250"}, //cp1250
- {"1251"}, //cp1251
- {"1256"}, //cp1256
- {"850"}, //cp850
- {"852"}, //cp852
- {"866"}, //cp866
- {"943"}, //cp932
- {"970"}, //euckr
- {"1381"}, //gb2312
- {"1386"}, //gbk
- {"813"}, //greek
- {"916"}, //hebrew
- {"923"}, //latin1
- {"912"}, //latin2
- {"920"}, //latin5
- {"1282"}, //macce
- {"874"}, //tis620
- {"943"}, //sjis
- {"13488"},//ucs2
- {"5050"}, //ujis
- {"1208"} //utf8
-};
-
-static _ILEpointer *QlgCvtTextDescToDesc_sym;
-
-/* We keep a cache of the mapping for text descriptions obtained via
- QlgTextDescToDesc. The following structures implement this cache. */
-static HASH textDescMapHash;
-static MEM_ROOT textDescMapMemroot;
-static pthread_mutex_t textDescMapHashMutex;
-struct TextDescMap
-{
- struct HashKey
- {
- int32 inType;
- int32 outType;
- char inDesc[Qlg_MaxDescSize];
- } hashKey;
- char outDesc[Qlg_MaxDescSize];
-};
-
-/* We keep a cache of the mapping for open iconv descriptors. The following
- structures implement this cache. */
-static HASH iconvMapHash;
-static MEM_ROOT iconvMapMemroot;
-static pthread_mutex_t iconvMapHashMutex;
-struct IconvMap
-{
- struct HashKey
- {
- uint32 direction; // These are uint32s to avoid garbage data in the key from compiler padding
- uint32 db2CCSID;
- const CHARSET_INFO* myCharset;
- } hashKey;
- iconv_t iconvDesc;
-};
-
-
-/**
- Initialize the static structures used by this module.
-
- This must only be called once per plugin instantiation.
-
- @return 0 if successful. Failure otherwise
-*/
-int32 initCharsetSupport()
-{
- DBUG_ENTER("initCharsetSupport");
-
- int actmark = _ILELOAD("QSYS/QLGUSR", ILELOAD_LIBOBJ);
- if ( actmark == -1 )
- {
- DBUG_PRINT("initCharsetSupport", ("conversion srvpgm activation failed"));
- DBUG_RETURN(1);
- }
-
- QlgCvtTextDescToDesc_sym = (ILEpointer*)malloc_aligned(sizeof(ILEpointer));
- if (_ILESYM(QlgCvtTextDescToDesc_sym, actmark, "QlgCvtTextDescToDesc") == -1)
- {
- DBUG_PRINT("initCharsetSupport",
- ("resolve of QlgCvtTextDescToDesc failed"));
- DBUG_RETURN(errno);
- }
-
- VOID(pthread_mutex_init(&textDescMapHashMutex,MY_MUTEX_INIT_FAST));
- my_hash_init(&textDescMapHash, &my_charset_bin, 10, offsetof(TextDescMap, hashKey), sizeof(TextDescMap::hashKey), 0, 0, HASH_UNIQUE);
-
- VOID(pthread_mutex_init(&iconvMapHashMutex,MY_MUTEX_INIT_FAST));
- my_hash_init(&iconvMapHash, &my_charset_bin, 10, offsetof(IconvMap, hashKey), sizeof(IconvMap::hashKey), 0, 0, HASH_UNIQUE);
-
- init_alloc_root(&textDescMapMemroot, 2048, 0);
- init_alloc_root(&iconvMapMemroot, 256, 0);
-
- initMyconv();
-
- DBUG_RETURN(0);
-}
-
-/**
- Cleanup the static structures used by this module.
-
- This must only be called once per plugin instantiation and only if
- initCharsetSupport() was successful.
-*/
-void doneCharsetSupport()
-{
- cleanupMyconv();
-
- free_root(&textDescMapMemroot, 0);
- free_root(&iconvMapMemroot, 0);
-
- pthread_mutex_destroy(&textDescMapHashMutex);
- my_hash_free(&textDescMapHash);
- pthread_mutex_destroy(&iconvMapHashMutex);
- my_hash_free(&iconvMapHash);
- free_aligned(QlgCvtTextDescToDesc_sym);
-}
-
-
-/**
- Convert a text description from one type to another.
-
- This function is just a wrapper for the IBM i QlgTextDescToDesc function plus
- some overrides for conversions that the API does not handle correctly and
- support for caching the computed conversion.
-
- @param inType The type of descriptor pointed to by "in".
- @param outType The type of descriptor requested for "out".
- @param in The descriptor to be convereted.
- @param[out] out The equivalent descriptor
- @param hashKey The hash key to be used for caching the conversion result.
-
- @return 0 if successful. Failure otherwise
-*/
-static int32 getNewTextDesc(const int32 inType,
- const int32 outType,
- const char* in,
- char* out,
- const TextDescMap::HashKey* hashKey)
-{
- DBUG_ENTER("db2i_charsetSupport::getNewTextDesc");
- const arg_type_t signature[] = { ARG_INT32, ARG_INT32, ARG_MEMPTR, ARG_INT32, ARG_MEMPTR, ARG_INT32, ARG_INT32, ARG_END };
- struct ArgList
- {
- ILEarglist_base base;
- int32 CRDIInType;
- int32 CRDIOutType;
- ILEpointer CRDIDesc;
- int32 CRDIDescSize;
- ILEpointer CRDODesc;
- int32 CRDODescSize;
- int32 CTDCCSID;
- } *arguments;
-
- if ((inType == Qlg_TypeIANA) && (outType == Qlg_TypeAix41))
- {
- // Override non-standard charsets
- if (unlikely(strcmp("IBM1381", in) == 0))
- {
- strcpy(out, "IBM-1381");
- DBUG_RETURN(0);
- }
- }
- else if ((inType == Qlg_TypeAS400CCSID) && (outType == Qlg_TypeAix41))
- {
- // Override non-standard charsets
- if (strcmp("1148", in) == 0)
- {
- strcpy(out, "IBM-1148");
- DBUG_RETURN(0);
- }
- else if (unlikely(strcmp("1153", in) == 0))
- {
- strcpy(out, "IBM-1153");
- DBUG_RETURN(0);
- }
- }
-
- char argBuf[sizeof(ArgList)+15];
- arguments = (ArgList*)roundToQuadWordBdy(argBuf);
-
- arguments->CRDIInType = inType;
- arguments->CRDIOutType = outType;
- arguments->CRDIDesc.s.addr = (address64_t) in;
- arguments->CRDIDescSize = Qlg_MaxDescSize;
- arguments->CRDODesc.s.addr = (address64_t) out;
- arguments->CRDODescSize = Qlg_MaxDescSize;
- arguments->CTDCCSID = 819;
- _ILECALL(QlgCvtTextDescToDesc_sym,
- &arguments->base,
- signature,
- RESULT_INT32);
- if (unlikely(arguments->base.result.s_int32.r_int32 < 0))
- {
- if (arguments->base.result.s_int32.r_int32 == Qlg_InDescriptorNotFound)
- {
- DBUG_RETURN(DB2I_ERR_UNSUPP_CHARSET);
- }
- else
- {
- getErrTxt(DB2I_ERR_ILECALL,"QlgCvtTextDescToDesc",arguments->base.result.s_int32.r_int32);
- DBUG_RETURN(DB2I_ERR_ILECALL);
- }
- }
-
- // Store the conversion information into a cache entry
- TextDescMap* mapping = (TextDescMap*)alloc_root(&textDescMapMemroot, sizeof(TextDescMap));
- if (unlikely(!mapping))
- DBUG_RETURN(HA_ERR_OUT_OF_MEM);
- memcpy(&(mapping->hashKey), hashKey, sizeof(hashKey));
- strcpy(mapping->outDesc, out);
- pthread_mutex_lock(&textDescMapHashMutex);
- my_hash_insert(&textDescMapHash, (const uchar*)mapping);
- pthread_mutex_unlock(&textDescMapHashMutex);
-
- DBUG_RETURN(0);
-}
-
-
-/**
- Convert a text description from one type to another.
-
- This function takes a text description in one representation and converts
- it into another representation. Although the OS provides some facilities for
- doing this, the support is not complete, nor does MySQL always use standard
- identifiers. Therefore, there are a lot of hardcoded overrides required.
- There is probably some room for optimization here, but this should not be
- called frequently under most circumstances.
-
- @param inType The type of descriptor pointed to by "in".
- @param outType The type of descriptor requested for "out".
- @param in The descriptor to be convereted.
- @param[out] out The equivalent descriptor
-
- @return 0 if successful. Failure otherwise
-*/
-static int32 convertTextDesc(const int32 inType, const int32 outType, const char* inDesc, char* outDesc)
-{
- DBUG_ENTER("db2i_charsetSupport::convertTextDesc");
- const char* inDescOverride;
-
- if (inType == Qlg_TypeIANA)
- {
- // Override non-standard charsets
- if (strcmp("big5", inDesc) == 0)
- inDescOverride = "Big5";
- else if (strcmp("cp932", inDesc) == 0)
- inDescOverride = "IBM943";
- else if (strcmp("euckr", inDesc) == 0)
- inDescOverride = "EUC-KR";
- else if (strcmp("gb2312", inDesc) == 0)
- inDescOverride = "IBM1381";
- else if (strcmp("gbk", inDesc) == 0)
- inDescOverride = "IBM1386";
- else if (strcmp("sjis", inDesc) == 0)
- inDescOverride = "Shift_JIS";
- else if (strcmp("ujis", inDesc) == 0)
- inDescOverride = "EUC-JP";
- else
- inDescOverride = inDesc;
-
- // Hardcode non-standard charsets
- if (outType == Qlg_TypeAix41)
- {
- if (strcmp("Big5", inDescOverride) == 0)
- {
- strcpy(outDesc,"big5");
- DBUG_RETURN(0);
- }
- else if (strcmp("IBM1386", inDescOverride) == 0)
- {
- strcpy(outDesc,"GBK");
- DBUG_RETURN(0);
- }
- else if (strcmp("Shift_JIS", inDescOverride) == 0 ||
- strcmp("IBM943", inDescOverride) == 0)
- {
- strcpy(outDesc,"IBM-943");
- DBUG_RETURN(0);
- }
- else if (strcmp("tis620", inDescOverride) == 0)
- {
- strcpy(outDesc,"TIS-620");
- DBUG_RETURN(0);
- }
- else if (strcmp("ucs2", inDescOverride) == 0)
- {
- strcpy(outDesc,"UCS-2");
- DBUG_RETURN(0);
- }
- else if (strcmp("cp1250", inDescOverride) == 0)
- {
- strcpy(outDesc,"IBM-1250");
- DBUG_RETURN(0);
- }
- else if (strcmp("cp1251", inDescOverride) == 0)
- {
- strcpy(outDesc,"IBM-1251");
- DBUG_RETURN(0);
- }
- else if (strcmp("cp1256", inDescOverride) == 0)
- {
- strcpy(outDesc,"IBM-1256");
- DBUG_RETURN(0);
- }
- else if (strcmp("macce", inDescOverride) == 0)
- {
- strcpy(outDesc,"IBM-1282");
- DBUG_RETURN(0);
- }
- }
- else if (outType == Qlg_TypeAS400CCSID)
- {
- // See if we can fast path the convert
- for (int loopCnt = 0; loopCnt < MAX_IANASTRING; ++loopCnt)
- {
- if (strcmp((char*)ianaStringType[loopCnt],inDescOverride) == 0)
- {
- strcpy(outDesc,ccsidType[loopCnt]);
- DBUG_RETURN(0);
- }
- }
- }
- }
- else
- inDescOverride = inDesc;
-
- // We call getNewTextDesc for all other conversions and cache the result.
- TextDescMap *mapping;
- TextDescMap::HashKey hashKey;
- hashKey.inType= inType;
- hashKey.outType= outType;
- uint32 len = strlen(inDescOverride);
- memcpy(hashKey.inDesc, inDescOverride, len);
- memset(hashKey.inDesc+len, 0, sizeof(hashKey.inDesc) - len);
-
- if (!(mapping=(TextDescMap *) my_hash_search(&textDescMapHash,
- (const uchar*)&hashKey,
- sizeof(hashKey))))
- {
- DBUG_RETURN(getNewTextDesc(inType, outType, inDescOverride, outDesc, &hashKey));
- }
- else
- {
- strcpy(outDesc, mapping->outDesc);
- }
- DBUG_RETURN(0);
-}
-
-
-/**
- Convert an IANA character set name into a DB2 for i CCSID value.
-
- @param parmIANADesc An IANA character set name
- @param[out] db2Ccsid The equivalent CCSID value
-
- @return 0 if successful. Failure otherwise
-*/
-int32 convertIANAToDb2Ccsid(const char* parmIANADesc, uint16* db2Ccsid)
-{
- int32 rc;
- uint16 aixCcsid;
- char aixCcsidString[Qlg_MaxDescSize];
- int aixEncodingScheme;
- int db2EncodingScheme;
- rc = convertTextDesc(Qlg_TypeIANA, Qlg_TypeAS400CCSID, parmIANADesc, aixCcsidString);
- if (unlikely(rc))
- {
- if (rc == DB2I_ERR_UNSUPP_CHARSET)
- getErrTxt(DB2I_ERR_UNSUPP_CHARSET, parmIANADesc);
-
- return rc;
- }
- aixCcsid = atoi(aixCcsidString);
- rc = getEncodingScheme(aixCcsid, aixEncodingScheme);
- if (rc != 0)
- return rc;
- switch(aixEncodingScheme) { // Select on encoding scheme
- case 0x1100: // EDCDIC SBCS
- case 0x2100: // ASCII SBCS
- case 0x4100: // AIX SBCS
- case 0x4105: // MS Windows
- case 0x5100: // ISO 7 bit ASCII
- db2EncodingScheme = 0x1100;
- break;
- case 0x1200: // EDCDIC DBCS
- case 0x2200: // ASCII DBCS
- db2EncodingScheme = 0x1200;
- break;
- case 0x1301: // EDCDIC Mixed
- case 0x2300: // ASCII Mixed
- case 0x4403: // EUC (ISO 2022)
- db2EncodingScheme = 0x1301;
- break;
- case 0x7200: // UCS2
- db2EncodingScheme = 0x7200;
- break;
- case 0x7807: // UTF-8
- db2EncodingScheme = 0x7807;
- break;
- case 0x7500: // UTF-32
- db2EncodingScheme = 0x7500;
- break;
- default: // Unknown
- {
- getErrTxt(DB2I_ERR_UNKNOWN_ENCODING,aixEncodingScheme);
- return DB2I_ERR_UNKNOWN_ENCODING;
- }
- break;
- }
- if (aixEncodingScheme == db2EncodingScheme)
- {
- *db2Ccsid = aixCcsid;
- }
- else
- {
- rc = getAssociatedCCSID(aixCcsid, db2EncodingScheme, db2Ccsid); // EDCDIC SBCS
- if (rc != 0)
- return rc;
- }
-
- return 0;
-}
-
-
-/**
- Obtain the encoding scheme of a CCSID.
-
- @param inCcsid An IBM i CCSID
- @param[out] outEncodingScheme The associated encoding scheme
-
- @return 0 if successful. Failure otherwise
-*/
-int32 getEncodingScheme(const uint16 inCcsid, int32& outEncodingScheme)
-{
- DBUG_ENTER("db2i_charsetSupport::getEncodingScheme");
-
- static bool ptrInited = FALSE;
- static char ptrSpace[sizeof(ILEpointer) + 15];
- static ILEpointer* ptrToPtr = (ILEpointer*)roundToQuadWordBdy(ptrSpace);
- int rc;
-
- if (!ptrInited)
- {
- rc = _RSLOBJ2(ptrToPtr, RSLOBJ_TS_PGM, "QTQGESP", "QSYS");
-
- if (rc)
- {
- getErrTxt(DB2I_ERR_RESOLVE_OBJ,"QTQGESP","QSYS","*PGM",errno);
- DBUG_RETURN(DB2I_ERR_RESOLVE_OBJ);
- }
- ptrInited = TRUE;
- }
-
- DBUG_ASSERT(inCcsid != 0);
-
- int GESPCCSID = inCcsid;
- int GESPLen = 32;
- int GESPNbrVal = 0;
- int32 GESPES;
- int GESPCSCPL[32];
- int GESPFB[3];
- void* ILEArgv[7];
- ILEArgv[0] = &GESPCCSID;
- ILEArgv[1] = &GESPLen;
- ILEArgv[2] = &GESPNbrVal;
- ILEArgv[3] = &GESPES;
- ILEArgv[4] = &GESPCSCPL;
- ILEArgv[5] = &GESPFB;
- ILEArgv[6] = NULL;
-
- rc = _PGMCALL(ptrToPtr, (void**)&ILEArgv, 0);
-
- if (rc)
- {
- getErrTxt(DB2I_ERR_PGMCALL,"QTQGESP","QSYS",rc);
- DBUG_RETURN(DB2I_ERR_PGMCALL);
- }
- if (GESPFB[0] != 0 ||
- GESPFB[1] != 0 ||
- GESPFB[2] != 0)
- {
- getErrTxt(DB2I_ERR_QTQGESP,GESPFB[0],GESPFB[1],GESPFB[2]);
- DBUG_RETURN(DB2I_ERR_QTQGESP);
- }
- outEncodingScheme = GESPES;
-
- DBUG_RETURN(0);
-}
-
-
-/**
- Get the best fit equivalent CCSID. (Wrapper for QTQGRDC API)
-
- @param inCcsid An IBM i CCSID
- @param inEncodingScheme The encoding scheme
- @param[out] outCcsid The equivalent CCSID
-
- @return 0 if successful. Failure otherwise
-*/
-int32 getAssociatedCCSID(const uint16 inCcsid, const int inEncodingScheme, uint16* outCcsid)
-{
- DBUG_ENTER("db2i_charsetSupport::getAssociatedCCSID");
- static bool ptrInited = FALSE;
- static char ptrSpace[sizeof(ILEpointer) + 15];
- static ILEpointer* ptrToPtr = (ILEpointer*)roundToQuadWordBdy(ptrSpace);
- int rc;
-
- // Override non-standard charsets
- if ((inCcsid == 923) && (inEncodingScheme == 0x1100))
- {
- *outCcsid = 1148;
- DBUG_RETURN(0);
- }
- else if ((inCcsid == 1250) && (inEncodingScheme == 0x1100))
- {
- *outCcsid = 1153;
- DBUG_RETURN(0);
- }
-
- if (!ptrInited)
- {
- rc = _RSLOBJ2(ptrToPtr, RSLOBJ_TS_PGM, "QTQGRDC", "QSYS");
-
- if (rc)
- {
- getErrTxt(DB2I_ERR_RESOLVE_OBJ,"QTQGRDC","QSYS","*PGM",errno);
- DBUG_RETURN(DB2I_ERR_RESOLVE_OBJ);
- }
- ptrInited = TRUE;
- }
-
- int GRDCCCSID = inCcsid;
- int GRDCES = inEncodingScheme;
- int GRDCSel = 0;
- int GRDCAssCCSID;
- int GRDCFB[3];
- void* ILEArgv[7];
- ILEArgv[0] = &GRDCCCSID;
- ILEArgv[1] = &GRDCES;
- ILEArgv[2] = &GRDCSel;
- ILEArgv[3] = &GRDCAssCCSID;
- ILEArgv[4] = &GRDCFB;
- ILEArgv[5] = NULL;
-
- rc = _PGMCALL(ptrToPtr, (void**)&ILEArgv, 0);
-
- if (rc)
- {
- getErrTxt(DB2I_ERR_PGMCALL,"QTQGRDC","QSYS",rc);
- DBUG_RETURN(DB2I_ERR_PGMCALL);
- }
- if (GRDCFB[0] != 0 ||
- GRDCFB[1] != 0 ||
- GRDCFB[2] != 0)
- {
- getErrTxt(DB2I_ERR_QTQGRDC,GRDCFB[0],GRDCFB[1],GRDCFB[2]);
- DBUG_RETURN(DB2I_ERR_QTQGRDC);
- }
-
- *outCcsid = GRDCAssCCSID;
-
- DBUG_RETURN(0);
-}
-
-/**
- Open an iconv conversion between a MySQL charset and the respective IBM i CCSID
-
- @param direction The direction of the conversion
- @param mysqlCSName Name of the MySQL character set
- @param db2CCSID The IBM i CCSID
- @param hashKey The key to use for inserting the opened conversion into the cache
- @param[out] newConversion The iconv descriptor
-
- @return 0 if successful. Failure otherwise
-*/
-static int32 openNewConversion(enum_conversionDirection direction,
- const char* mysqlCSName,
- uint16 db2CCSID,
- IconvMap::HashKey* hashKey,
- iconv_t& newConversion)
-{
- DBUG_ENTER("db2i_charsetSupport::openNewConversion");
-
- char mysqlAix41Desc[Qlg_MaxDescSize];
- char db2Aix41Desc[Qlg_MaxDescSize];
- char db2CcsidString[6] = "";
- int32 rc;
-
- /*
- First we have to convert the MySQL IANA-like name and the DB2 CCSID into
- there equivalent iconv descriptions.
- */
- rc = convertTextDesc(Qlg_TypeIANA, Qlg_TypeAix41, mysqlCSName, mysqlAix41Desc);
- if (unlikely(rc))
- {
- if (rc == DB2I_ERR_UNSUPP_CHARSET)
- getErrTxt(DB2I_ERR_UNSUPP_CHARSET, mysqlCSName);
-
- DBUG_RETURN(rc);
- }
- CHARSET_INFO *cs= &my_charset_bin;
- (uint)(cs->cset->long10_to_str)(cs,db2CcsidString,sizeof(db2CcsidString), 10, db2CCSID);
- rc = convertTextDesc(Qlg_TypeAS400CCSID, Qlg_TypeAix41, db2CcsidString, db2Aix41Desc);
- if (unlikely(rc))
- {
- if (rc == DB2I_ERR_UNSUPP_CHARSET)
- getErrTxt(DB2I_ERR_UNSUPP_CHARSET, mysqlCSName);
-
- DBUG_RETURN(rc);
- }
-
- /* Call iconv to open the conversion. */
- if (direction == toDB2)
- {
- newConversion = iconv_open(db2Aix41Desc, mysqlAix41Desc);
- }
- else
- {
- newConversion = iconv_open(mysqlAix41Desc, db2Aix41Desc);
- }
-
- if (unlikely(newConversion == (iconv_t) -1))
- {
- getErrTxt(DB2I_ERR_UNSUPP_CHARSET, mysqlCSName);
- DBUG_RETURN(DB2I_ERR_UNSUPP_CHARSET);
- }
-
- /* Insert the new conversion into the cache. */
- IconvMap* mapping = (IconvMap*)alloc_root(&iconvMapMemroot, sizeof(IconvMap));
- if (!mapping)
- {
- my_error(ER_OUTOFMEMORY, MYF(0), sizeof(IconvMap));
- DBUG_RETURN( HA_ERR_OUT_OF_MEM);
- }
- memcpy(&(mapping->hashKey), hashKey, sizeof(mapping->hashKey));
- mapping->iconvDesc = newConversion;
- pthread_mutex_lock(&iconvMapHashMutex);
- my_hash_insert(&iconvMapHash, (const uchar*)mapping);
- pthread_mutex_unlock(&iconvMapHashMutex);
-
- DBUG_RETURN(0);
-}
-
-
-/**
- Open an iconv conversion between a MySQL charset and the respective IBM i CCSID
-
- @param direction The direction of the conversion
- @param cs The MySQL character set
- @param db2CCSID The IBM i CCSID
- @param[out] newConversion The iconv descriptor
-
- @return 0 if successful. Failure otherwise
-*/
-int32 getConversion(enum_conversionDirection direction, const CHARSET_INFO* cs, uint16 db2CCSID, iconv_t& conversion)
-{
- DBUG_ENTER("db2i_charsetSupport::getConversion");
-
- int32 rc;
-
- /* Build the hash key */
- IconvMap::HashKey hashKey;
- hashKey.direction= direction;
- hashKey.myCharset= cs;
- hashKey.db2CCSID= db2CCSID;
-
- /* Look for the conversion in the cache and add it if it is not there. */
- IconvMap *mapping;
- if (!(mapping= (IconvMap *) my_hash_search(&iconvMapHash,
- (const uchar*)&hashKey,
- sizeof(hashKey))))
- {
- DBUG_PRINT("getConversion", ("Hash miss for direction=%d, cs=%s, ccsid=%d", direction, cs->name, db2CCSID));
- rc= openNewConversion(direction, cs->csname, db2CCSID, &hashKey, conversion);
- if (rc)
- DBUG_RETURN(rc);
- }
- else
- {
- conversion= mapping->iconvDesc;
- }
-
- DBUG_RETURN(0);
-}
-
-/**
- Fast-path conversion from ASCII to EBCDIC for use in converting
- identifiers to be sent to the QMY APIs.
-
- @param input ASCII data
- @param[out] ouput EBCDIC data
- @param ilen Size of input buffer and output buffer
-*/
-int convToEbcdic(const char* input, char* output, size_t ilen)
-{
- static bool inited = FALSE;
- static iconv_t ic;
-
- if (ilen == 0)
- return 0;
-
- if (!inited)
- {
- ic = iconv_open( "IBM-037", "ISO8859-1" );
- inited = TRUE;
- }
- size_t substitutedChars;
- size_t olen = ilen;
- if (iconv( ic, (char**)&input, &ilen, &output, &olen, &substitutedChars ) == -1)
- return errno;
-
- return 0;
-}
-
-
-/**
- Fast-path conversion from EBCDIC to ASCII for use in converting
- data received from the QMY APIs.
-
- @param input EBCDIC data
- @param[out] ouput ASCII data
- @param ilen Size of input buffer and output buffer
-*/
-int convFromEbcdic(const char* input, char* output, size_t ilen)
-{
- static bool inited = FALSE;
- static iconv_t ic;
-
- if (ilen == 0)
- return 0;
-
- if (!inited)
- {
- ic = iconv_open("ISO8859-1", "IBM-037");
- inited = TRUE;
- }
-
- size_t substitutedChars;
- size_t olen = ilen;
- if (iconv( ic, (char**)&input, &ilen, &output, &olen, &substitutedChars) == -1)
- return errno;
-
- return 0;
-}
diff --git a/storage/ibmdb2i/db2i_charsetSupport.h b/storage/ibmdb2i/db2i_charsetSupport.h
deleted file mode 100644
index 77051e1e0db..00000000000
--- a/storage/ibmdb2i/db2i_charsetSupport.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#ifndef DB2I_CHARSETSUPPORT_H
-#define DB2I_CHARSETSUPPORT_H
-
-#include "db2i_global.h"
-#include "mysql_priv.h"
-#include <mysql/plugin.h>
-#include "db2i_iconv.h"
-
-/**
- @enum enum_conversionDirection
-
- Conversion directions for getConversion()
-*/
-enum enum_conversionDirection
-{
- toMySQL,
- toDB2
-};
-
-int initCharsetSupport();
-void doneCharsetSupport();
-int32 convertIANAToDb2Ccsid(const char* parmIANADesc, uint16* db2Ccsid);
-int32 getEncodingScheme(const uint16 inCcsid, int32& outEncodingScheme);
-int32 getAssociatedCCSID(const uint16 inCcsid, const int inEncodingScheme, uint16* outCcsid);
-int convToEbcdic(const char* input, char* output, size_t ilen);
-int convFromEbcdic(const char* input, char* output, size_t ilen);
-int32 getConversion(enum_conversionDirection direction, const CHARSET_INFO* cs, uint16 db2CCSID, iconv_t& conversion);
-
-#endif
diff --git a/storage/ibmdb2i/db2i_collationSupport.cc b/storage/ibmdb2i/db2i_collationSupport.cc
deleted file mode 100644
index 65a17fd2452..00000000000
--- a/storage/ibmdb2i/db2i_collationSupport.cc
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#include "db2i_collationSupport.h"
-#include "db2i_errors.h"
-
-
-/*
- The following arrays define a mapping between MySQL collation names and
- corresponding IBM i sort sequences. The mapping is a 1-to-1 correlation
- between corresponding array slots but is incomplete without case-sensitivity
- markers dynamically added to the mySqlSortSequence names.
-*/
-#define MAX_COLLATION 87
-static const char* mySQLCollation[MAX_COLLATION] =
-{
- {"ascii_general"},
- {"ascii"},
- {"big5_chinese"},
- {"big5"},
- {"cp1250_croatian"},
- {"cp1250_general"},
- {"cp1250_polish"},
- {"cp1250"},
- {"cp1251_bulgarian"},
- {"cp1251_general"},
- {"cp1251"},
- {"cp1256_general"},
- {"cp1256"},
- {"cp850_general"},
- {"cp850"},
- {"cp852_general"},
- {"cp852"},
- {"cp932_japanese"},
- {"cp932"},
- {"euckr_korean"},
- {"euckr"},
- {"gb2312_chinese"},
- {"gb2312"},
- {"gbk_chinese"},
- {"gbk"},
- {"greek_general"},
- {"greek"},
- {"hebrew_general"},
- {"hebrew"},
- {"latin1_danish"},
- {"latin1_general"},
- {"latin1_german1"},
- {"latin1_spanish"},
- {"latin1_swedish"},
- {"latin1"},
- {"latin2_croatian"},
- {"latin2_general"},
- {"latin2_hungarian"},
- {"latin2"},
- {"latin5_turkish"},
- {"latin5"},
- {"macce_general"},
- {"macce"},
- {"sjis_japanese"},
- {"sjis"},
- {"tis620_thai"},
- {"tis620"},
- {"ucs2_czech"},
- {"ucs2_danish"},
- {"ucs2_esperanto"},
- {"ucs2_estonian"},
- {"ucs2_general"},
- {"ucs2_hungarian"},
- {"ucs2_icelandic"},
- {"ucs2_latvian"},
- {"ucs2_lithuanian"},
- {"ucs2_persian"},
- {"ucs2_polish"},
- {"ucs2_romanian"},
- {"ucs2_slovak"},
- {"ucs2_slovenian"},
- {"ucs2_spanish"},
- {"ucs2_swedish"},
- {"ucs2_turkish"},
- {"ucs2_unicode"},
- {"ucs2"},
- {"ujis_japanese"},
- {"ujis"},
- {"utf8_czech"},
- {"utf8_danish"},
- {"utf8_esperanto"},
- {"utf8_estonian"},
- {"utf8_general"},
- {"utf8_hungarian"},
- {"utf8_icelandic"},
- {"utf8_latvian"},
- {"utf8_lithuanian"},
- {"utf8_persian"},
- {"utf8_polish"},
- {"utf8_romanian"},
- {"utf8_slovak"},
- {"utf8_slovenian"},
- {"utf8_spanish"},
- {"utf8_swedish"},
- {"utf8_turkish"},
- {"utf8_unicode"},
- {"utf8"}
-};
-
-
-static const char* mySqlSortSequence[MAX_COLLATION] =
-{
- {"QALA101F4"},
- {"QBLA101F4"},
- {"QACHT04B0"},
- {"QBCHT04B0"},
- {"QALA20481"},
- {"QCLA20481"},
- {"QDLA20481"},
- {"QELA20481"},
- {"QACYR0401"},
- {"QBCYR0401"},
- {"QCCYR0401"},
- {"QAARA01A4"},
- {"QBARA01A4"},
- {"QCLA101F4"},
- {"QDLA101F4"},
- {"QALA20366"},
- {"QBLA20366"},
- {"QAJPN04B0"},
- {"QBJPN04B0"},
- {"QAKOR04B0"},
- {"QBKOR04B0"},
- {"QACHS04B0"},
- {"QBCHS04B0"},
- {"QCCHS04B0"},
- {"QDCHS04B0"},
- {"QAELL036B"},
- {"QBELL036B"},
- {"QAHEB01A8"},
- {"QBHEB01A8"},
- {"QALA1047C"},
- {"QBLA1047C"},
- {"QCLA1047C"},
- {"QDLA1047C"},
- {"QELA1047C"},
- {"QFLA1047C"},
- {"QCLA20366"},
- {"QELA20366"},
- {"QFLA20366"},
- {"QGLA20366"},
- {"QATRK0402"},
- {"QBTRK0402"},
- {"QHLA20366"},
- {"QILA20366"},
- {"QCJPN04B0"},
- {"QDJPN04B0"},
- {"QATHA0346"},
- {"QBTHA0346"},
- {"ACS_CZ"},
- {"ADA_DK"},
- {"AEO"},
- {"AET"},
- {"QAUCS04B0"},
- {"AHU"},
- {"AIS"},
- {"ALV"},
- {"ALT"},
- {"AFA"},
- {"APL"},
- {"ARO"},
- {"ASK"},
- {"ASL"},
- {"AES"},
- {"ASW"},
- {"ATR"},
- {"AEN"},
- {"*HEX"},
- {"QEJPN04B0"},
- {"QFJPN04B0"},
- {"ACS_CZ"},
- {"ADA_DK"},
- {"AEO"},
- {"AET"},
- {"QAUCS04B0"},
- {"AHU"},
- {"AIS"},
- {"ALV"},
- {"ALT"},
- {"AFA"},
- {"APL"},
- {"ARO"},
- {"ASK"},
- {"ASL"},
- {"AES"},
- {"ASW"},
- {"ATR"},
- {"AEN"},
- {"*HEX"}
-};
-
-
-/**
- Get the IBM i sort sequence that corresponds to the given MySQL collation.
-
- @param fieldCharSet The collated character set
- @param[out] rtnSortSequence The corresponding sort sequence
-
- @return 0 if successful. Failure otherwise
-*/
-static int32 getAssociatedSortSequence(const CHARSET_INFO *fieldCharSet, const char** rtnSortSequence)
-{
- DBUG_ENTER("ha_ibmdb2i::getAssociatedSortSequence");
-
- if (strcmp(fieldCharSet->csname,"binary") != 0)
- {
- int collationSearchLen = strlen(fieldCharSet->name);
- if (fieldCharSet->state & MY_CS_BINSORT)
- collationSearchLen -= 4;
- else
- collationSearchLen -= 3;
-
- uint16 loopCnt = 0;
- for (loopCnt; loopCnt < MAX_COLLATION; ++loopCnt)
- {
- if ((strlen(mySQLCollation[loopCnt]) == collationSearchLen) &&
- (strncmp((char*)mySQLCollation[loopCnt], fieldCharSet->name, collationSearchLen) == 0))
- break;
- }
- if (loopCnt == MAX_COLLATION) // Did not find associated sort sequence
- {
- getErrTxt(DB2I_ERR_SRTSEQ);
- DBUG_RETURN(DB2I_ERR_SRTSEQ);
- }
- *rtnSortSequence = mySqlSortSequence[loopCnt];
- }
-
- DBUG_RETURN(0);
-}
-
-
-/**
- Update sort sequence information for a key.
-
- This function accumulates information about a key as it is called for each
- field composing the key. The caller should invoke the function for each field
- and (with the exception of the charset parm) preserve the values for the
- parms across invocations, until a particular key has been evaluated. Once
- the last field in the key has been evaluated, the fileSortSequence and
- fileSortSequenceLibrary parms will contain the correct information for
- creating the corresponding DB2 key.
-
- @param charset The character set under consideration
- @param[in, out] fileSortSequenceType The type of the current key's sort seq
- @param[in, out] fileSortSequence The IBM i identifier for the DB2 sort sequence
- that corresponds
-
- @return 0 if successful. Failure otherwise
-*/
-int32 updateAssociatedSortSequence(const CHARSET_INFO* charset,
- char* fileSortSequenceType,
- char* fileSortSequence,
- char* fileSortSequenceLibrary)
-{
- DBUG_ENTER("ha_ibmdb2i::updateAssociatedSortSequence");
- DBUG_ASSERT(charset);
- if (strcmp(charset->csname,"binary") != 0)
- {
- char newSortSequence[11] = "";
- char newSortSequenceType = ' ';
- const char* foundSortSequence;
- int rc = getAssociatedSortSequence(charset, &foundSortSequence);
- if (rc) DBUG_RETURN (rc);
- switch(foundSortSequence[0])
- {
- case '*': // Binary
- strcat(newSortSequence,foundSortSequence);
- newSortSequenceType = 'B';
- break;
- case 'Q': // Non-ICU sort sequence
- strcat(newSortSequence,foundSortSequence);
- if ((charset->state & MY_CS_BINSORT) != 0)
- {
- strcat(newSortSequence,"U");
- }
- else if ((charset->state & MY_CS_CSSORT) != 0)
- {
- strcat(newSortSequence,"U");
- }
- else
- {
- strcat(newSortSequence,"S");
- }
- newSortSequenceType = 'N';
- break;
- default: // ICU sort sequence
- {
- if ((charset->state & MY_CS_CSSORT) == 0)
- {
- if (osVersion.v >= 6)
- strcat(newSortSequence,"I34"); // ICU 3.4
- else
- strcat(newSortSequence,"I26"); // ICU 2.6.1
- }
- strcat(newSortSequence,foundSortSequence);
- newSortSequenceType = 'I';
- }
- break;
- }
- if (*fileSortSequenceType == ' ') // If no sort sequence has been set yet
- {
- // Set associated sort sequence
- strcpy(fileSortSequence,newSortSequence);
- strcpy(fileSortSequenceLibrary,"QSYS");
- *fileSortSequenceType = newSortSequenceType;
- }
- else if (strcmp(fileSortSequence,newSortSequence) != 0)
- {
- // Only one sort sequence/collation is supported for each DB2 index.
- getErrTxt(DB2I_ERR_MIXED_COLLATIONS);
- DBUG_RETURN(DB2I_ERR_MIXED_COLLATIONS);
- }
- }
-
- DBUG_RETURN(0);
-}
diff --git a/storage/ibmdb2i/db2i_collationSupport.h b/storage/ibmdb2i/db2i_collationSupport.h
deleted file mode 100644
index b2ce09de1ea..00000000000
--- a/storage/ibmdb2i/db2i_collationSupport.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#ifndef DB2I_COLLATIONSUPPORT_H
-#define DB2I_COLLATIONSUPPORT_H
-
-#include "db2i_global.h"
-#include "mysql_priv.h"
-
-int32 updateAssociatedSortSequence(const CHARSET_INFO* charset,
- char* fileSortSequenceType,
- char* fileSortSequence,
- char* fileSortSequenceLibrary);
-
-#endif
diff --git a/storage/ibmdb2i/db2i_constraints.cc b/storage/ibmdb2i/db2i_constraints.cc
deleted file mode 100644
index 3afa12032d0..00000000000
--- a/storage/ibmdb2i/db2i_constraints.cc
+++ /dev/null
@@ -1,672 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-
-#include "ha_ibmdb2i.h"
-#include "db2i_safeString.h"
-
-// This function is called when building the CREATE TABLE information for
-// foreign key constraints. It converts a constraint, table, schema, or
-// field name from EBCDIC to ASCII. If the DB2 name is quoted, it removes
-// those quotes. It then adds the appropriate quotes for a MySQL identifier.
-
-static void convNameForCreateInfo(THD *thd, SafeString& info, char* fromName, int len)
-{
- int quote;
- char cquote; // Quote character
- char convName[MAX_DB2_FILENAME_LENGTH]; // Converted name
-
- memset(convName, 0, sizeof(convName));
- convFromEbcdic(fromName, convName, len);
- quote = get_quote_char_for_identifier(thd, convName, len);
- cquote = (char) quote;
- if (quote != EOF)
- info.strcat(cquote);
- if (convName[0] == '"') // If DB2 name was quoted, remove quotes
- {
- if (strstr(convName, "\"\""))
- stripExtraQuotes(convName+1, len-1);
- info.strncat((char*)(convName+1), len-2);
- }
- else // DB2 name was not quoted
- info.strncat(convName, len);
- if (quote != EOF)
- info.strcat(cquote);
-}
-
-/**
- Evaluate the parse tree to build foreign key constraint clauses
-
- @parm lex The parse tree
- @parm appendHere The DB2 string to receive the constraint clauses
- @parm path The path to the table under consideration
- @parm fields Pointer to the table's list of field pointers
- @parm[in, out] fileSortSequenceType The sort sequence type associated with the table
- @parm[in, out] fileSortSequence The sort sequence associated with the table
- @parm[in, out] fileSortSequenceLibrary The sort sequence library associated with the table
-
- @return 0 if successful; HA_ERR_CANNOT_ADD_FOREIGN otherwise
-*/
-int ha_ibmdb2i::buildDB2ConstraintString(LEX* lex,
- String& appendHere,
- const char* path,
- Field** fields,
- char* fileSortSequenceType,
- char* fileSortSequence,
- char* fileSortSequenceLibrary)
-{
- List_iterator<Key> keyIter(lex->alter_info.key_list);
- char colName[MAX_DB2_COLNAME_LENGTH+1];
-
- Key* curKey;
-
- while (curKey = keyIter++)
- {
- if (curKey->type == Key::FOREIGN_KEY)
- {
- appendHere.append(STRING_WITH_LEN(", "));
-
- Foreign_key* fk = (Foreign_key*)curKey;
-
- char db2LibName[MAX_DB2_SCHEMANAME_LENGTH+1];
- if (fk->name.str)
- {
- char db2FKName[MAX_DB2_FILENAME_LENGTH+1];
- appendHere.append(STRING_WITH_LEN("CONSTRAINT "));
- if (fk->ref_table->db.str)
- {
- convertMySQLNameToDB2Name(fk->ref_table->db.str, db2LibName, sizeof(db2LibName));
- }
- else
- {
- db2i_table::getDB2LibNameFromPath(path, db2LibName);
- }
- if (lower_case_table_names == 1)
- my_casedn_str(files_charset_info, db2LibName);
- appendHere.append(db2LibName);
-
- appendHere.append('.');
-
- convertMySQLNameToDB2Name(fk->name.str, db2FKName, sizeof(db2FKName));
- appendHere.append(db2FKName);
- }
-
- appendHere.append(STRING_WITH_LEN(" FOREIGN KEY ("));
-
- bool firstTime = true;
-
- List_iterator<Key_part_spec> column(fk->columns);
- Key_part_spec* curColumn;
-
- while (curColumn = column++)
- {
- if (!firstTime)
- {
- appendHere.append(',');
- }
- firstTime = false;
-
- convertMySQLNameToDB2Name(curColumn->field_name.str, colName, sizeof(colName));
- appendHere.append(colName);
-
- // DB2 requires that the sort sequence on the child table match the parent table's
- // sort sequence. We ensure that happens by updating the sort sequence according
- // to the constrained fields.
- Field** field = fields;
- do
- {
- if (strcmp((*field)->field_name, curColumn->field_name.str) == 0)
- {
- int rc = updateAssociatedSortSequence((*field)->charset(),
- fileSortSequenceType,
- fileSortSequence,
- fileSortSequenceLibrary);
-
- if (unlikely(rc)) return rc;
- }
- } while (*(++field));
- }
-
- firstTime = true;
-
- appendHere.append(STRING_WITH_LEN(") REFERENCES "));
-
- if (fk->ref_table->db.str)
- {
- convertMySQLNameToDB2Name(fk->ref_table->db.str, db2LibName, sizeof(db2LibName));
- }
- else
- {
- db2i_table::getDB2LibNameFromPath(path, db2LibName);
- }
- if (lower_case_table_names == 1)
- my_casedn_str(files_charset_info, db2LibName);
- appendHere.append(db2LibName);
- appendHere.append('.');
-
- char db2FileName[MAX_DB2_FILENAME_LENGTH+1];
- convertMySQLNameToDB2Name(fk->ref_table->table.str, db2FileName, sizeof(db2FileName));
- if (lower_case_table_names)
- my_casedn_str(files_charset_info, db2FileName);
- appendHere.append(db2FileName);
-
-
- if (!fk->ref_columns.is_empty())
- {
- List_iterator<Key_part_spec> ref(fk->ref_columns);
- Key_part_spec* curRef;
- appendHere.append(STRING_WITH_LEN(" ("));
-
-
- while (curRef = ref++)
- {
- if (!firstTime)
- {
- appendHere.append(',');
- }
- firstTime = false;
-
- convertMySQLNameToDB2Name(curRef->field_name.str, colName, sizeof(colName));
- appendHere.append(colName);
- }
-
- appendHere.append(STRING_WITH_LEN(") "));
- }
-
- if (fk->delete_opt != Foreign_key::FK_OPTION_UNDEF)
- {
- appendHere.append(STRING_WITH_LEN("ON DELETE "));
- switch (fk->delete_opt)
- {
- case Foreign_key::FK_OPTION_RESTRICT:
- appendHere.append(STRING_WITH_LEN("RESTRICT ")); break;
- case Foreign_key::FK_OPTION_CASCADE:
- appendHere.append(STRING_WITH_LEN("CASCADE ")); break;
- case Foreign_key::FK_OPTION_SET_NULL:
- appendHere.append(STRING_WITH_LEN("SET NULL ")); break;
- case Foreign_key::FK_OPTION_NO_ACTION:
- appendHere.append(STRING_WITH_LEN("NO ACTION ")); break;
- case Foreign_key::FK_OPTION_DEFAULT:
- appendHere.append(STRING_WITH_LEN("SET DEFAULT ")); break;
- default:
- return HA_ERR_CANNOT_ADD_FOREIGN; break;
- }
- }
-
- if (fk->update_opt != Foreign_key::FK_OPTION_UNDEF)
- {
- appendHere.append(STRING_WITH_LEN("ON UPDATE "));
- switch (fk->update_opt)
- {
- case Foreign_key::FK_OPTION_RESTRICT:
- appendHere.append(STRING_WITH_LEN("RESTRICT ")); break;
- case Foreign_key::FK_OPTION_NO_ACTION:
- appendHere.append(STRING_WITH_LEN("NO ACTION ")); break;
- default:
- return HA_ERR_CANNOT_ADD_FOREIGN; break;
- }
- }
-
- }
-
- }
-
- return 0;
-}
-
-
-/***********************************************************************
-Get the foreign key information in the form of a character string so
-that it can be inserted into a CREATE TABLE statement. This is used by
-the SHOW CREATE TABLE statement. The string will later be freed by the
-free_foreign_key_create_info() method.
-************************************************************************/
-
-char* ha_ibmdb2i::get_foreign_key_create_info(void)
-{
- DBUG_ENTER("ha_ibmdb2i::get_foreign_key_create_info");
- int rc = 0;
- char* infoBuffer = NULL; // Pointer to string returned to MySQL
- uint32 constraintSpaceLength;// Length of space passed to DB2
- ValidatedPointer<char> constraintSpace; // Space pointer passed to DB2
- uint32 neededLen; // Length returned from DB2
- uint32 cstCnt; // Number of foreign key constraints from DB2
- uint32 fld; //
- constraint_hdr* cstHdr; // Pointer to constraint header structure
- FK_constraint* FKCstDef; // Pointer to constraint definition structure
- cst_name* fieldName; // Pointer to field name structure
- char* tempPtr; // Temp pointer for traversing constraint space
- char convName[128];
-
- /* Allocate space to retrieve the DB2 constraint information. */
-
- if (!(share = get_share(table_share->path.str, table)))
- DBUG_RETURN(NULL);
-
- constraintSpaceLength = 5000; // Try allocating 5000 bytes and see if enough.
-
- initBridge();
-
- constraintSpace.alloc(constraintSpaceLength);
- rc = bridge()->expectErrors(QMY_ERR_NEED_MORE_SPACE)
- ->constraints(db2Table->dataFile()->getMasterDefnHandle(),
- constraintSpace,
- constraintSpaceLength,
- &neededLen,
- &cstCnt);
-
- if (unlikely(rc == QMY_ERR_NEED_MORE_SPACE))
- {
- constraintSpaceLength = neededLen; // Get length of space that's needed
- constraintSpace.realloc(constraintSpaceLength);
- rc = bridge()->expectErrors(QMY_ERR_NEED_MORE_SPACE)
- ->constraints(db2Table->dataFile()->getMasterDefnHandle(),
- constraintSpace,
- constraintSpaceLength,
- &neededLen,
- &cstCnt);
- }
-
- /* If constraint information was returned by DB2, build a text string */
- /* to return to MySQL. */
-
- if ((rc == 0) && (cstCnt > 0))
- {
- THD* thd = ha_thd();
- infoBuffer = (char*) my_malloc(MAX_FOREIGN_LEN + 1, MYF(MY_WME));
- if (infoBuffer == NULL)
- {
- free_share(share);
- DBUG_RETURN(NULL);
- }
-
- SafeString info(infoBuffer, MAX_FOREIGN_LEN + 1);
-
- /* Loop through the DB2 constraints and build a text string for each foreign */
- /* key constraint that is found. */
-
- tempPtr = constraintSpace;
- cstHdr = (constraint_hdr_t*)(void*)constraintSpace; // Address first constraint definition
- for (int i = 0; i < cstCnt && !info.overflowed(); ++i)
- {
- if (cstHdr->CstType[0] == QMY_CST_FK) // If this is a foreign key constraint
- {
- tempPtr = (char*)(tempPtr + cstHdr->CstDefOff);
- FKCstDef = (FK_constraint_t*)tempPtr;
-
- /* Process the constraint name. */
-
- info.strncat(STRING_WITH_LEN(",\n CONSTRAINT "));
- convNameForCreateInfo(thd, info,
- FKCstDef->CstName.Name, FKCstDef->CstName.Len);
-
- /* Process the names of the foreign keys. */
-
- info.strncat(STRING_WITH_LEN(" FOREIGN KEY ("));
- tempPtr = (char*)(tempPtr + FKCstDef->KeyColOff);
- fieldName= (cst_name_t*)tempPtr;
- for (fld = 0; fld < FKCstDef->KeyCnt; ++fld)
- {
- convNameForCreateInfo(thd, info, fieldName->Name, fieldName->Len);
- if ((fld + 1) < FKCstDef->KeyCnt)
- {
- info.strncat(STRING_WITH_LEN(", "));
- fieldName = fieldName + 1;
- }
- }
-
- /* Process the schema-name and name of the referenced table. */
-
- info.strncat(STRING_WITH_LEN(") REFERENCES "));
- convNameForCreateInfo(thd, info,
- FKCstDef->RefSchema.Name, FKCstDef->RefSchema.Len);
- info.strcat('.');
- convNameForCreateInfo(thd, info,
- FKCstDef->RefTable.Name, FKCstDef->RefTable.Len);
- info.strncat(STRING_WITH_LEN(" ("));
-
- /* Process the names of the referenced keys. */
-
- tempPtr = (char*)FKCstDef;
- tempPtr = (char*)(tempPtr + FKCstDef->RefColOff);
- fieldName= (cst_name_t*)tempPtr;
- for (fld = 0; fld < FKCstDef->RefCnt; ++fld)
- {
- convNameForCreateInfo(thd, info, fieldName->Name, fieldName->Len);
- if ((fld + 1) < FKCstDef->RefCnt)
- {
- info.strncat(STRING_WITH_LEN(", "));
- fieldName = fieldName + 1;
- }
- }
-
- /* Process the ON UPDATE and ON DELETE rules. */
-
- info.strncat(STRING_WITH_LEN(") ON UPDATE "));
- switch(FKCstDef->UpdMethod)
- {
- case QMY_NOACTION: info.strncat(STRING_WITH_LEN("NO ACTION")); break;
- case QMY_RESTRICT: info.strncat(STRING_WITH_LEN("RESTRICT")); break;
- default: break;
- }
- info.strncat(STRING_WITH_LEN(" ON DELETE "));
- switch(FKCstDef->DltMethod)
- {
- case QMY_CASCADE: info.strncat(STRING_WITH_LEN("CASCADE")); break;
- case QMY_SETDFT: info.strncat(STRING_WITH_LEN("SET DEFAULT")); break;
- case QMY_SETNULL: info.strncat(STRING_WITH_LEN("SET NULL")); break;
- case QMY_NOACTION: info.strncat(STRING_WITH_LEN("NO ACTION")); break;
- case QMY_RESTRICT: info.strncat(STRING_WITH_LEN("RESTRICT")); break;
- default: break;
- }
- }
-
- /* Address the next constraint, if any. */
-
- if ((i+1) < cstCnt)
- {
- tempPtr = (char*)cstHdr + cstHdr->CstLen;
- cstHdr = (constraint_hdr_t*)(tempPtr);
- }
- }
- }
-
- /* Cleanup and return */
- free_share(share);
-
- DBUG_RETURN(infoBuffer);
-}
-
-/***********************************************************************
-Free the foreign key create info (for a table) that was acquired by the
-get_foreign_key_create_info() method.
-***********************************************************************/
-
-void ha_ibmdb2i::free_foreign_key_create_info(char* info)
-{
- DBUG_ENTER("ha_ibmdb2i::free_foreign_key_create_info");
-
- if (info)
- {
- my_free(info);
- }
- DBUG_VOID_RETURN;
-}
-
-/***********************************************************************
-This method returns to MySQL a list, with one entry in the list describing
-each foreign key constraint.
-***********************************************************************/
-
-int ha_ibmdb2i::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
-{
- DBUG_ENTER("ha_ibmdb2i::get_foreign_key_list");
- int rc = 0;
- uint32 constraintSpaceLength; // Length of space passed to DB2
- ValidatedPointer<char> constraintSpace; // Space pointer passed to DB2
- uint16 rtnCode; // Return code from DB2
- uint32 neededLen; // Bytes needed to contain DB2 constraint info
- uint32 cstCnt; // Number of constraints returned by DB2
- uint32 fld;
- constraint_hdr* cstHdr; // Pointer to a cst header structure
- FK_constraint* FKCstDef; // Pointer to definition of foreign key constraint
- cst_name* fieldName; // Pointer to field name structure
- const char *method;
- ulong methodLen;
- char* tempPtr; // Temp pointer for traversing constraint space
- char convName[128];
-
- if (!(share = get_share(table_share->path.str, table)))
- DBUG_RETURN(0);
-
- // Allocate space to retrieve the DB2 constraint information.
- constraintSpaceLength = 5000; // Try allocating 5000 bytes and see if enough.
-
- constraintSpace.alloc(constraintSpaceLength);
- rc = bridge()->expectErrors(QMY_ERR_NEED_MORE_SPACE)
- ->constraints(db2Table->dataFile()->getMasterDefnHandle(),
- constraintSpace,
- constraintSpaceLength,
- &neededLen,
- &cstCnt);
-
- if (unlikely(rc == QMY_ERR_NEED_MORE_SPACE))
- {
- constraintSpaceLength = neededLen; // Get length of space that's needed
- constraintSpace.realloc(constraintSpaceLength);
- rc = bridge()->expectErrors(QMY_ERR_NEED_MORE_SPACE)
- ->constraints(db2Table->dataFile()->getMasterDefnHandle(),
- constraintSpace,
- constraintSpaceLength,
- &neededLen,
- &cstCnt);
- }
-
- /* If constraint information was returned by DB2, build a text string */
- /* to return to MySQL. */
- if ((rc == 0) && (cstCnt > 0))
- {
- tempPtr = constraintSpace;
- cstHdr = (constraint_hdr_t*)(void*)constraintSpace; // Address first constraint definition
- for (int i = 0; i < cstCnt; ++i)
- {
- if (cstHdr->CstType[0] == QMY_CST_FK) // If this is a foreign key constraint
- {
- FOREIGN_KEY_INFO f_key_info;
- LEX_STRING *name= 0;
- tempPtr = (char*)(tempPtr + cstHdr->CstDefOff);
- FKCstDef = (FK_constraint_t*)tempPtr;
-
- /* Process the constraint name. */
-
- convFromEbcdic(FKCstDef->CstName.Name, convName,FKCstDef->CstName.Len);
- if (convName[0] == '"') // If quoted, exclude quotes.
- f_key_info.forein_id = thd_make_lex_string(thd, 0,
- convName + 1, (uint) (FKCstDef->CstName.Len - 2), 1);
- else // Not quoted
- f_key_info.forein_id = thd_make_lex_string(thd, 0,
- convName, (uint) FKCstDef->CstName.Len, 1);
-
- /* Process the names of the foreign keys. */
-
-
- tempPtr = (char*)(tempPtr + FKCstDef->KeyColOff);
- fieldName = (cst_name_t*)tempPtr;
- for (fld = 0; fld < FKCstDef->KeyCnt; ++fld)
- {
- convFromEbcdic(fieldName->Name, convName, fieldName->Len);
- if (convName[0] == '"') // If quoted, exclude quotes.
- name = thd_make_lex_string(thd, name,
- convName + 1, (uint) (fieldName->Len - 2), 1);
- else
- name = thd_make_lex_string(thd, name, convName, (uint) fieldName->Len, 1);
- f_key_info.foreign_fields.push_back(name);
- if ((fld + 1) < FKCstDef->KeyCnt)
- fieldName = fieldName + 1;
- }
-
- /* Process the schema and name of the referenced table. */
-
- convFromEbcdic(FKCstDef->RefSchema.Name, convName, FKCstDef->RefSchema.Len);
- if (convName[0] == '"') // If quoted, exclude quotes.
- f_key_info.referenced_db = thd_make_lex_string(thd, 0,
- convName + 1, (uint) (FKCstDef->RefSchema.Len -2), 1);
- else
- f_key_info.referenced_db = thd_make_lex_string(thd, 0,
- convName, (uint) FKCstDef->RefSchema.Len, 1);
- convFromEbcdic(FKCstDef->RefTable.Name, convName, FKCstDef->RefTable.Len);
- if (convName[0] == '"') // If quoted, exclude quotes.
- f_key_info.referenced_table = thd_make_lex_string(thd, 0,
- convName +1, (uint) (FKCstDef->RefTable.Len -2), 1);
- else
- f_key_info.referenced_table = thd_make_lex_string(thd, 0,
- convName, (uint) FKCstDef->RefTable.Len, 1);
-
- /* Process the names of the referenced keys. */
-
- tempPtr = (char*)FKCstDef;
- tempPtr = (char*)(tempPtr + FKCstDef->RefColOff);
- fieldName= (cst_name_t*)tempPtr;
- for (fld = 0; fld < FKCstDef->RefCnt; ++fld)
- {
- convFromEbcdic(fieldName->Name, convName, fieldName->Len);
- if (convName[0] == '"') // If quoted, exclude quotes.
- name = thd_make_lex_string(thd, name,
- convName + 1, (uint) (fieldName->Len -2), 1);
- else
- name = thd_make_lex_string(thd, name, convName, (uint) fieldName->Len, 1);
- f_key_info.referenced_fields.push_back(name);
- if ((fld + 1) < FKCstDef->RefCnt)
- fieldName = fieldName + 1;
- }
-
- /* Process the ON UPDATE and ON DELETE rules. */
-
- switch(FKCstDef->UpdMethod)
- {
- case QMY_NOACTION:
- {
- method = "NO ACTION";
- methodLen=9;
- }
- break;
- case QMY_RESTRICT:
- {
- method = "RESTRICT";
- methodLen = 8;
- }
- break;
- default: break;
- }
- f_key_info.update_method = thd_make_lex_string(
- thd, f_key_info.update_method, method, methodLen, 1);
- switch(FKCstDef->DltMethod)
- {
- case QMY_CASCADE:
- {
- method = "CASCADE";
- methodLen = 7;
- }
- break;
- case QMY_SETDFT:
- {
- method = "SET DEFAULT";
- methodLen = 11;
- }
- break;
- case QMY_SETNULL:
- {
- method = "SET NULL";
- methodLen = 8;
- }
- break;
- case QMY_NOACTION:
- {
- method = "NO ACTION";
- methodLen = 9;
- }
- break;
- case QMY_RESTRICT:
- {
- method = "RESTRICT";
- methodLen = 8;
- }
- break;
- default: break;
- }
- f_key_info.delete_method = thd_make_lex_string(
- thd, f_key_info.delete_method, method, methodLen, 1);
- f_key_info.referenced_key_name= thd_make_lex_string(thd, 0, (char *)"", 1, 1);
- 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);
- }
-
- /* Address the next constraint, if any. */
-
- if ((i+1) < cstCnt)
- {
- tempPtr = (char*)cstHdr + cstHdr->CstLen;
- cstHdr = (constraint_hdr_t*)(tempPtr);
- }
- }
- }
-
- /* Cleanup and return. */
-
- free_share(share);
- DBUG_RETURN(0);
-}
-
-/***********************************************************************
-Checks if the table is referenced by a foreign key.
-Returns: 0 if not referenced (or error occurs),
- > 0 if is referenced
-***********************************************************************/
-
-uint ha_ibmdb2i::referenced_by_foreign_key(void)
-{
- DBUG_ENTER("ha_ibmdb2i::referenced_by_foreign_key");
-
- int rc = 0;
- FILE_HANDLE queryFile = 0;
- uint32 resultRowLen;
- uint32 count = 0;
-
- const char* libName = db2Table->getDB2LibName(db2i_table::ASCII_SQL);
- const char* fileName = db2Table->getDB2TableName(db2i_table::ASCII_SQL);
-
- String query(128);
- query.append(STRING_WITH_LEN(" SELECT COUNT(*) FROM SYSIBM.SQLFOREIGNKEYS WHERE PKTABLE_SCHEM = '"));
- query.append(libName+1, strlen(libName)-2); // parent library name
- query.append(STRING_WITH_LEN("' AND PKTABLE_NAME = '"));
- query.append(fileName+1, strlen(fileName)-2); // parent file name
- query.append(STRING_WITH_LEN("'"));
-
- SqlStatementStream sqlStream(query);
-
- rc = bridge()->prepOpen(sqlStream.getPtrToData(),
- &queryFile,
- &resultRowLen);
- if (rc == 0)
- {
- IOReadBuffer rowBuffer(1, resultRowLen);
- rc = bridge()->read(queryFile, rowBuffer.ptr(), QMY_READ_ONLY, QMY_NONE, QMY_FIRST);
- if (!rc) count = *((uint32*)rowBuffer.getRowN(0));
- bridge()->deallocateFile(queryFile);
- }
- DBUG_RETURN(count);
-}
diff --git a/storage/ibmdb2i/db2i_conversion.cc b/storage/ibmdb2i/db2i_conversion.cc
deleted file mode 100644
index 71a30802bf9..00000000000
--- a/storage/ibmdb2i/db2i_conversion.cc
+++ /dev/null
@@ -1,1459 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-
-#include "db2i_ileBridge.h"
-#include "mysql_priv.h"
-#include "db2i_charsetSupport.h"
-#include "ctype.h"
-#include "ha_ibmdb2i.h"
-#include "db2i_errors.h"
-#include "wchar.h"
-
-const char ZERO_DATETIME_VALUE[] = "0000-00-00 00:00:00";
-const char ZERO_DATETIME_VALUE_SUBST[] = "0001-01-01 00:00:00";
-const char ZERO_DATE_VALUE[] = "0000-00-00";
-const char ZERO_DATE_VALUE_SUBST[] = "0001-01-01";
-
-
-/**
- Put a BCD digit into a BCD string.
-
- @param[out] bcdString The BCD string to be modified
- @param pos The position within the string to be updated.
- @param val The value to be assigned into the string at pos.
-*/
-static inline void bcdAssign(char* bcdString, uint pos, uint val)
-{
- bcdString[pos/2] |= val << ((pos % 2) ? 0 : 4);
-}
-
-/**
- Read a BCD digit from a BCD string.
-
- @param[out] bcdString The BCD string to be read
- @param pos The position within the string to be read.
-
- @return bcdGet The value of the BCD digit at pos.
-*/
-static inline uint bcdGet(const char* bcdString, uint pos)
-{
- return (bcdString[pos/2] >> ((pos % 2) ? 0 : 4)) & 0xf;
-}
-
-/**
- In-place convert a number in ASCII represenation to EBCDIC representation.
-
- @param string The string of ASCII characters
- @param len The length of string
-*/
-static inline void convertNumericToEbcdicFast(char* string, int len)
-{
- for (int i = 0; i < len; ++i, ++string)
- {
- switch(*string)
- {
- case '-':
- *string = 0x60; break;
- case ':':
- *string = 0x7A; break;
- case '.':
- *string = 0x4B; break;
- default:
- DBUG_ASSERT(isdigit(*string));
- *string += 0xF0 - '0';
- break;
- }
- }
-}
-
-
-/**
- atoi()-like function for a 4-character EBCDIC string.
-
- @param string The EBCDIC string
- @return a4toi_ebcdic The decimal value of the EBCDIC string
-*/
-static inline uint16 a4toi_ebcdic(const uchar* string)
-{
- return ((string[0]-0xF0) * 1000 +
- (string[1]-0xF0) * 100 +
- (string[2]-0xF0) * 10 +
- (string[3]-0xF0));
-};
-
-
-/**
- atoi()-like function for a 4-character EBCDIC string.
-
- @param string The EBCDIC string
- @return a4toi_ebcdic The decimal value of the EBCDIC string
-*/
-static inline uint8 a2toi_ebcdic(const uchar* string)
-{
- return ((string[0]-0xF0) * 10 +
- (string[1]-0xF0));
-};
-
-/**
- Perform character conversion for textual field data.
-*/
-int ha_ibmdb2i::convertFieldChars(enum_conversionDirection direction,
- uint16 fieldID,
- const char* input,
- char* output,
- size_t ilen,
- size_t olen,
- size_t* outDataLen,
- bool tacitErrors,
- size_t* substChars)
-{
- DBUG_PRINT("ha_ibmdb2i::convertFieldChars",("Direction: %d; length = %d", direction, ilen));
-
- if (unlikely(ilen == 0))
- {
- if (outDataLen) *outDataLen = 0;
- return (0);
- }
-
- iconv_t& conversion = db2Table->getConversionDefinition(direction, fieldID);
-
- if (unlikely(conversion == (iconv_t)(-1)))
- {
- return (DB2I_ERR_UNSUPP_CHARSET);
- }
-
- size_t initOLen= olen;
- size_t substitutedChars = 0;
- int rc = iconv(conversion, (char**)&input, &ilen, &output, &olen, &substitutedChars );
- if (outDataLen) *outDataLen = initOLen - olen;
- if (substChars) *substChars = substitutedChars;
- if (unlikely(rc < 0))
- {
- int er = errno;
- if (er == EILSEQ)
- {
- if (!tacitErrors) getErrTxt(DB2I_ERR_ILL_CHAR, table->field[fieldID]->field_name);
- return (DB2I_ERR_ILL_CHAR);
- }
- else
- {
- if (!tacitErrors) getErrTxt(DB2I_ERR_ICONV,er);
- return (DB2I_ERR_ICONV);
- }
- }
- if (unlikely(substitutedChars) && (!tacitErrors))
- {
- warning(ha_thd(), DB2I_ERR_SUB_CHARS, table->field[fieldID]->field_name);
- }
-
- return (0);
-}
-
-/**
- Append the appropriate default value clause onto a CREATE TABLE definition
-
- This was inspired by get_field_default_value in sql/sql_show.cc.
-
- @param field The field whose value is to be obtained
- @param statement The string to receive the DEFAULT clause
- @param quoteIt Does the data type require single quotes around the value?
- @param ccsid The ccsid of the field value (if a string type); 0 if no conversion needed
-*/
-static void get_field_default_value(Field *field,
- String &statement,
- bool quoteIt,
- uint32 ccsid,
- bool substituteZeroDates)
-{
- if ((field->type() != FIELD_TYPE_BLOB &&
- !(field->flags & NO_DEFAULT_VALUE_FLAG) &&
- field->unireg_check != Field::NEXT_NUMBER))
- {
- my_ptrdiff_t old_ptr= (my_ptrdiff_t) (field->table->s->default_values - field->table->record[0]);
- field->move_field_offset(old_ptr);
-
- String defaultClause(64);
- defaultClause.length(0);
- defaultClause.append(" DEFAULT ");
- if (!field->is_null())
- {
- my_bitmap_map *old_map = tmp_use_all_columns(field->table, field->table->read_set);
- char tmp[MAX_FIELD_WIDTH];
-
- if (field->real_type() == MYSQL_TYPE_ENUM ||
- field->real_type() == MYSQL_TYPE_SET)
- {
- CHARSET_INFO *cs= &my_charset_bin;
- uint len = (uint)(cs->cset->longlong10_to_str)(cs,tmp,sizeof(tmp), 10, field->val_int());
- tmp[len]=0;
- defaultClause.append(tmp);
- }
- else
- {
- String type(tmp, sizeof(tmp), field->charset());
- field->val_str(&type);
- if (type.length())
- {
- if (field->type() == MYSQL_TYPE_DATE &&
- memcmp(type.ptr(), STRING_WITH_LEN(ZERO_DATE_VALUE)) == 0)
- {
- if (substituteZeroDates)
- type.set(STRING_WITH_LEN(ZERO_DATE_VALUE_SUBST), field->charset());
- else
- {
- warning(current_thd, DB2I_ERR_WARN_COL_ATTRS, field->field_name);
- return;
- }
- }
- else if ((field->type() == MYSQL_TYPE_DATETIME ||
- field->type() == MYSQL_TYPE_TIMESTAMP) &&
- memcmp(type.ptr(), STRING_WITH_LEN(ZERO_DATETIME_VALUE)) == 0)
- {
- if (substituteZeroDates)
- type.set(STRING_WITH_LEN(ZERO_DATETIME_VALUE_SUBST), field->charset());
- else
- {
- warning(current_thd, DB2I_ERR_WARN_COL_ATTRS, field->field_name);
- return;
- }
- }
-
-
- if (field->type() != MYSQL_TYPE_STRING &&
- field->type() != MYSQL_TYPE_VARCHAR &&
- field->type() != MYSQL_TYPE_BLOB &&
- field->type() != MYSQL_TYPE_BIT)
- {
- if (quoteIt)
- defaultClause.append('\'');
- defaultClause.append(type);
- if (quoteIt)
- defaultClause.append('\'');
- }
- else
- {
- int length;
- char* out;
-
- // If a ccsid is specified, we need to make sure that the DEFAULT
- // string is converted to that encoding.
- if (ccsid != 0)
- {
- iconv_t iconvD;
- if (getConversion(toDB2, field->charset(), ccsid, iconvD))
- {
- warning(current_thd, DB2I_ERR_WARN_COL_ATTRS, field->field_name);
- return;
- }
-
- size_t ilen = type.length();
- size_t olen = 6 * ilen;
- size_t origOlen = olen;
- const char* in = type.ptr();
- const char* tempIn = in;
- out = (char*)my_malloc(olen, MYF(MY_WME));
- char* tempOut = out;
- size_t substitutedChars;
-
- if (iconv(iconvD, (char**)&tempIn, &ilen, &tempOut, &olen, &substitutedChars) < 0)
- {
- warning(current_thd, DB2I_ERR_WARN_COL_ATTRS, field->field_name);
- my_free(out);
- return;
- }
- // Now we process the converted string to represent it as
- // hexadecimal values.
-
- length = origOlen - olen;
- }
- else
- {
- length = type.length();
- out = (char*)my_malloc(length*2, MYF(MY_WME));
- memcpy(out, (char*)type.ptr(), length);
- }
-
- if (length > 16370)
- {
- warning(current_thd, DB2I_ERR_WARN_COL_ATTRS, field->field_name);
- my_free(out);
- return;
- }
-
- if (ccsid == 1200)
- defaultClause.append("ux'");
- else if (ccsid == 13488)
- defaultClause.append("gx'");
- else if (field->charset() == &my_charset_bin)
- defaultClause.append("binary(x'");
- else
- defaultClause.append("x'");
-
- const char hexMap[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
- for (int c = length-1; c >= 0; --c)
- {
- out[c*2+1] = hexMap[out[c] & 0xF];
- out[c*2] = hexMap[out[c] >> 4];
- }
-
- defaultClause.append(out, length*2);
- defaultClause.append('\'');
- if (field->charset() == &my_charset_bin)
- defaultClause.append(")");
-
- my_free(out);
- }
- }
- else
- defaultClause.length(0);
- }
- tmp_restore_column_map(field->table->read_set, old_map);
- }
- else if (field->maybe_null())
- defaultClause.append(STRING_WITH_LEN("NULL"));
-
- if (old_ptr)
- field->move_field_offset(-old_ptr);
-
- statement.append(defaultClause);
- }
-}
-
-
-
-
-/**
- Convert a MySQL field definition into its corresponding DB2 type.
-
- The result will be appended to mapping as a DB2 SQL phrase.
-
- @param field The MySQL field to be evaluated
- @param[out] mapping The receiver for the DB2 SQL syntax
- @param timeFormat The format to be used for mapping the TIME type
-*/
-int ha_ibmdb2i::getFieldTypeMapping(Field* field,
- String& mapping,
- enum_TimeFormat timeFormat,
- enum_BlobMapping blobMapping,
- enum_ZeroDate zeroDateHandling,
- bool propagateDefaults,
- enum_YearFormat yearFormat)
-{
- char stringBuildBuffer[257];
- uint32 fieldLength;
- bool defaultNeedsQuotes = false;
- uint16 db2Ccsid = 0;
-
- CHARSET_INFO* fieldCharSet = field->charset();
- switch (field->type())
- {
- case MYSQL_TYPE_NEWDECIMAL:
- {
- uint precision= ((Field_new_decimal*)field)->precision;
- uint scale= field->decimals();
-
- if (precision <= MAX_DEC_PRECISION)
- {
- sprintf(stringBuildBuffer,"DECIMAL(%d, %d)",precision,scale);
- }
- else
- {
- if (scale > precision - MAX_DEC_PRECISION)
- {
- scale = scale - (precision - MAX_DEC_PRECISION);
- precision = MAX_DEC_PRECISION;
- sprintf(stringBuildBuffer,"DECIMAL(%d, %d)",precision,scale);
- }
- else
- {
- return HA_ERR_UNSUPPORTED;
- }
- warning(ha_thd(), DB2I_ERR_PRECISION);
- }
-
- mapping.append(stringBuildBuffer);
- }
- break;
- case MYSQL_TYPE_TINY:
- mapping.append(STRING_WITH_LEN("SMALLINT"));
- break;
- case MYSQL_TYPE_SHORT:
- if (((Field_num*)field)->unsigned_flag)
- mapping.append(STRING_WITH_LEN("INT"));
- else
- mapping.append(STRING_WITH_LEN("SMALLINT"));
- break;
- case MYSQL_TYPE_LONG:
- if (((Field_num*)field)->unsigned_flag)
- mapping.append(STRING_WITH_LEN("BIGINT"));
- else
- mapping.append(STRING_WITH_LEN("INT"));
- break;
- case MYSQL_TYPE_FLOAT:
- mapping.append(STRING_WITH_LEN("REAL"));
- break;
- case MYSQL_TYPE_DOUBLE:
- mapping.append(STRING_WITH_LEN("DOUBLE"));
- break;
- case MYSQL_TYPE_LONGLONG:
- if (((Field_num*)field)->unsigned_flag)
- mapping.append(STRING_WITH_LEN("DECIMAL(20,0)"));
- else
- mapping.append(STRING_WITH_LEN("BIGINT"));
- break;
- case MYSQL_TYPE_INT24:
- mapping.append(STRING_WITH_LEN("INTEGER"));
- break;
- case MYSQL_TYPE_DATE:
- case MYSQL_TYPE_NEWDATE:
- mapping.append(STRING_WITH_LEN("DATE"));
- defaultNeedsQuotes = true;
- break;
- case MYSQL_TYPE_TIME:
- if (timeFormat == TIME_OF_DAY)
- {
- mapping.append(STRING_WITH_LEN("TIME"));
- defaultNeedsQuotes = true;
- }
- else
- mapping.append(STRING_WITH_LEN("INTEGER"));
- break;
- case MYSQL_TYPE_DATETIME:
- mapping.append(STRING_WITH_LEN("TIMESTAMP"));
- defaultNeedsQuotes = true;
- break;
- case MYSQL_TYPE_TIMESTAMP:
- mapping.append(STRING_WITH_LEN("TIMESTAMP"));
-
- if (table_share->timestamp_field == field && propagateDefaults)
- {
- switch (((Field_timestamp*)field)->get_auto_set_type())
- {
- case TIMESTAMP_NO_AUTO_SET:
- break;
- case TIMESTAMP_AUTO_SET_ON_INSERT:
- mapping.append(STRING_WITH_LEN(" DEFAULT CURRENT_TIMESTAMP"));
- break;
- case TIMESTAMP_AUTO_SET_ON_UPDATE:
- if (osVersion.v >= 6 &&
- !field->is_null())
- {
- mapping.append(STRING_WITH_LEN(" GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP"));
- warning(ha_thd(), DB2I_ERR_WARN_COL_ATTRS, field->field_name);
- }
- else
- warning(ha_thd(), DB2I_ERR_WARN_COL_ATTRS, field->field_name);
- break;
- case TIMESTAMP_AUTO_SET_ON_BOTH:
- if (osVersion.v >= 6 &&
- !field->is_null())
- mapping.append(STRING_WITH_LEN(" GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP"));
- else
- {
- mapping.append(STRING_WITH_LEN(" DEFAULT CURRENT_TIMESTAMP"));
- warning(ha_thd(), DB2I_ERR_WARN_COL_ATTRS, field->field_name);
- }
- break;
- }
- }
- else
- defaultNeedsQuotes = true;
- break;
- case MYSQL_TYPE_YEAR:
- if (yearFormat == CHAR4)
- {
- mapping.append(STRING_WITH_LEN("CHAR(4) CCSID 1208"));
- defaultNeedsQuotes = true;
- }
- else
- {
- mapping.append(STRING_WITH_LEN("SMALLINT"));
- defaultNeedsQuotes = false;
- }
- break;
- case MYSQL_TYPE_BIT:
- sprintf(stringBuildBuffer, "BINARY(%d)", (field->max_display_length() / 8) + 1);
- mapping.append(stringBuildBuffer);
- break;
- case MYSQL_TYPE_BLOB:
- case MYSQL_TYPE_VARCHAR:
- case MYSQL_TYPE_STRING:
- {
- if (field->real_type() == MYSQL_TYPE_ENUM ||
- field->real_type() == MYSQL_TYPE_SET)
- {
- mapping.append(STRING_WITH_LEN("BIGINT"));
- }
- else
- {
- defaultNeedsQuotes = true;
-
- fieldLength = field->max_display_length(); // Get field byte length
-
- if (fieldCharSet == &my_charset_bin)
- {
- if (field->type() == MYSQL_TYPE_STRING)
- {
- sprintf(stringBuildBuffer, "BINARY(%d)", max(fieldLength, 1));
- }
- else
- {
- if (fieldLength <= MAX_VARCHAR_LENGTH)
- {
- sprintf(stringBuildBuffer, "VARBINARY(%d)", max(fieldLength, 1));
- }
- else if (blobMapping == AS_VARCHAR &&
- (field->flags & PART_KEY_FLAG))
- {
- sprintf(stringBuildBuffer, "LONG VARBINARY ");
- }
- else
- {
- fieldLength = min(MAX_BLOB_LENGTH, fieldLength);
- sprintf(stringBuildBuffer, "BLOB(%d)", max(fieldLength, 1));
- }
- }
- mapping.append(stringBuildBuffer);
- }
- else
- {
- if (field->type() == MYSQL_TYPE_STRING)
- {
- if (fieldLength > MAX_CHAR_LENGTH)
- return 1;
- if (fieldCharSet->mbmaxlen > 1)
- {
- if (memcmp(fieldCharSet->name, "ucs2_", sizeof("ucs2_")-1) == 0 ) // UCS2
- {
- sprintf(stringBuildBuffer, "GRAPHIC(%d)", max(fieldLength / fieldCharSet->mbmaxlen, 1)); // Number of characters
- db2Ccsid = 13488;
- }
- else if (memcmp(fieldCharSet->name, "utf8_", sizeof("utf8_")-1) == 0 &&
- strcmp(fieldCharSet->name, "utf8_general_ci") != 0)
- {
- sprintf(stringBuildBuffer, "CHAR(%d)", max(fieldLength, 1)); // Number of bytes
- db2Ccsid = 1208;
- }
- else
- {
- sprintf(stringBuildBuffer, "GRAPHIC(%d)", max(fieldLength / fieldCharSet->mbmaxlen, 1)); // Number of characters
- db2Ccsid = 1200;
- }
- }
- else
- {
- sprintf(stringBuildBuffer, "CHAR(%d)", max(fieldLength, 1));
- }
- mapping.append(stringBuildBuffer);
- }
- else
- {
- if (fieldLength <= MAX_VARCHAR_LENGTH)
- {
- if (fieldCharSet->mbmaxlen > 1)
- {
- if (memcmp(fieldCharSet->name, "ucs2_", sizeof("ucs2_")-1) == 0 ) // UCS2
- {
- sprintf(stringBuildBuffer, "VARGRAPHIC(%d)", max(fieldLength / fieldCharSet->mbmaxlen, 1)); // Number of characters
- db2Ccsid = 13488;
- }
- else if (memcmp(fieldCharSet->name, "utf8_", sizeof("utf8_")-1) == 0 &&
- strcmp(fieldCharSet->name, "utf8_general_ci") != 0)
- {
- sprintf(stringBuildBuffer, "VARCHAR(%d)", max(fieldLength, 1)); // Number of bytes
- db2Ccsid = 1208;
- }
- else
- {
- sprintf(stringBuildBuffer, "VARGRAPHIC(%d)", max(fieldLength / fieldCharSet->mbmaxlen, 1)); // Number of characters
- db2Ccsid = 1200;
- }
- }
- else
- {
- sprintf(stringBuildBuffer, "VARCHAR(%d)", max(fieldLength, 1));
- }
- }
- else if (blobMapping == AS_VARCHAR &&
- (field->flags & PART_KEY_FLAG))
- {
- if (fieldCharSet->mbmaxlen > 1)
- {
- if (memcmp(fieldCharSet->name, "ucs2_", sizeof("ucs2_")-1) == 0 ) // UCS2
- {
- sprintf(stringBuildBuffer, "LONG VARGRAPHIC ");
- db2Ccsid = 13488;
- }
- else if (memcmp(fieldCharSet->name, "utf8_", sizeof("utf8_")-1) == 0 &&
- strcmp(fieldCharSet->name, "utf8_general_ci") != 0)
- {
- sprintf(stringBuildBuffer, "LONG VARCHAR ");
- db2Ccsid = 1208;
- }
- else
- {
- sprintf(stringBuildBuffer, "LONG VARGRAPHIC ");
- db2Ccsid = 1200;
- }
- }
- else
- {
- sprintf(stringBuildBuffer, "LONG VARCHAR ");
- }
- }
- else
- {
- fieldLength = min(MAX_BLOB_LENGTH, fieldLength);
-
- if (fieldCharSet->mbmaxlen > 1)
- {
- if (memcmp(fieldCharSet->name, "ucs2_", sizeof("ucs2_")-1) == 0 ) // UCS2
- {
- sprintf(stringBuildBuffer, "DBCLOB(%d)", max(fieldLength / fieldCharSet->mbmaxlen, 1)); // Number of characters
- db2Ccsid = 13488;
- }
- else if (memcmp(fieldCharSet->name, "utf8_", sizeof("utf8_")-1) == 0 &&
- strcmp(fieldCharSet->name, "utf8_general_ci") != 0)
- {
- sprintf(stringBuildBuffer, "CLOB(%d)", max(fieldLength, 1)); // Number of bytes
- db2Ccsid = 1208;
- }
- else
- {
- sprintf(stringBuildBuffer, "DBCLOB(%d)", max(fieldLength / fieldCharSet->mbmaxlen, 1)); // Number of characters
- db2Ccsid = 1200;
- }
- }
- else
- {
- sprintf(stringBuildBuffer, "CLOB(%d)", max(fieldLength, 1)); // Number of characters
- }
- }
-
- mapping.append(stringBuildBuffer);
- }
- if (db2Ccsid == 0) // If not overriding CCSID
- {
- int32 rtnCode = convertIANAToDb2Ccsid(fieldCharSet->csname, &db2Ccsid);
- if (rtnCode)
- return rtnCode;
- }
-
- if (db2Ccsid != 1208 &&
- db2Ccsid != 13488)
- {
- // Check whether there is a character conversion available.
- iconv_t temp;
- int32 rc = getConversion(toDB2, fieldCharSet, db2Ccsid, temp);
- if (unlikely(rc))
- return rc;
- }
-
- sprintf(stringBuildBuffer, " CCSID %d ", db2Ccsid);
- mapping.append(stringBuildBuffer);
- }
- }
- }
- break;
-
- }
-
- if (propagateDefaults)
- get_field_default_value(field,
- mapping,
- defaultNeedsQuotes,
- db2Ccsid,
- (zeroDateHandling==SUBSTITUTE_0001_01_01));
-
- return 0;
-}
-
-
-/**
- Convert MySQL field data into the equivalent DB2 format
-
- @param field The MySQL field to be converted
- @param db2Field The corresponding DB2 field definition
- @param db2Buf The buffer to receive the converted data
- @param data NULL if field points to the correct data; otherwise,
- the data to be converted (for use with keys)
-*/
-int32 ha_ibmdb2i::convertMySQLtoDB2(Field* field, const DB2Field& db2Field, char* db2Buf, const uchar* data)
-{
- enum_field_types fieldType = field->type();
- switch (fieldType)
- {
- case MYSQL_TYPE_NEWDECIMAL:
- {
- uint precision= ((Field_new_decimal*)field)->precision;
- uint scale= field->decimals();
- uint db2Precision = min(precision, MAX_DEC_PRECISION);
- uint truncationAmount = precision - db2Precision;
-
- if (scale >= truncationAmount)
- {
- String tempString(precision+2);
-
- if (data == NULL)
- {
- field->val_str((String*)&tempString, (String*)(NULL));
- }
- else
- {
- field->val_str(&tempString, data);
- }
- const char* temp = tempString.ptr();
- char packed[32];
- memset(&packed, 0, sizeof(packed));
-
- int bcdPos = db2Precision - (db2Precision % 2 ? 1 : 0);
- bcdAssign(packed, bcdPos+1, (temp[0] == '-' ? 0xD : 0xF));
-
- int strPos=tempString.length() - 1 - truncationAmount;
-
- for (;strPos >= 0 && bcdPos >= 0; strPos--)
- {
- if (my_isdigit(&my_charset_latin1, temp[strPos]))
- {
- bcdAssign(packed, bcdPos, temp[strPos]-'0');
- --bcdPos;
- }
- }
- memcpy(db2Buf, &packed, (db2Precision/2)+1);
- }
-
- }
- break;
- case MYSQL_TYPE_TINY:
- {
- int16 temp = (data == NULL ? field->val_int() : field->val_int(data));
- memcpy(db2Buf , &temp, sizeof(temp));
- }
- break;
- case MYSQL_TYPE_SHORT:
- {
- if (((Field_num*)field)->unsigned_flag)
- {
- memset(db2Buf, 0, 2);
- memcpy(db2Buf+2, (data == NULL ? field->ptr : data), 2);
- }
- else
- {
- memcpy(db2Buf, (data == NULL ? field->ptr : data), 2);
- }
- }
- break;
- case MYSQL_TYPE_LONG:
- {
- if (((Field_num*)field)->unsigned_flag)
- {
- memset(db2Buf, 0, 4);
- memcpy(db2Buf+4, (data == NULL ? field->ptr : data), 4);
- }
- else
- {
- memcpy(db2Buf, (data == NULL ? field->ptr : data), 4);
- }
- }
- break;
- case MYSQL_TYPE_FLOAT:
- {
- memcpy(db2Buf, (data == NULL ? field->ptr : data), 4);
- }
- break;
- case MYSQL_TYPE_DOUBLE:
- {
- memcpy(db2Buf, (data == NULL ? field->ptr : data), 8);
- }
- break;
- case MYSQL_TYPE_TIMESTAMP:
- case MYSQL_TYPE_DATETIME:
- {
- String tempString(27);
- if (data == NULL)
- {
- field->val_str(&tempString, &tempString);
- }
- else
- {
- field->val_str(&tempString, data);
- }
- memset(db2Buf, '0', 26);
- memcpy(db2Buf, tempString.ptr(), tempString.length());
- if (strncmp(db2Buf,ZERO_DATETIME_VALUE,strlen(ZERO_DATETIME_VALUE)) == 0)
- {
- if (cachedZeroDateOption == SUBSTITUTE_0001_01_01)
- memcpy(db2Buf, ZERO_DATETIME_VALUE_SUBST, sizeof(ZERO_DATETIME_VALUE_SUBST));
- else
- {
- getErrTxt(DB2I_ERR_INVALID_COL_VALUE, field->field_name);
- return(DB2I_ERR_INVALID_COL_VALUE);
- }
- }
- (db2Buf)[10] = '-';
- (db2Buf)[13] = (db2Buf)[16] = (db2Buf)[19] = '.';
-
- convertNumericToEbcdicFast(db2Buf, 26);
- }
- break;
- case MYSQL_TYPE_LONGLONG:
- {
- if (((Field_num*)field)->unsigned_flag)
- {
- char temp[23];
- String tempString(temp, sizeof(temp), &my_charset_latin1);
-
- if (data == NULL)
- {
- field->val_str((String*)&tempString, (String*)(NULL));
- }
- else
- {
- field->val_str(&tempString, data);
- }
- char packed[11];
- memset(packed, 0, sizeof(packed));
- bcdAssign(packed, 21, (temp[0] == '-' ? 0xD : 0xF));
- int strPos=tempString.length()-1;
- int bcdPos=20;
-
- for (;strPos >= 0; strPos--)
- {
- if (my_isdigit(&my_charset_latin1, temp[strPos]))
- {
- bcdAssign(packed, bcdPos, temp[strPos]-'0');
- --bcdPos;
- }
- }
- memcpy(db2Buf, &packed, 11);
- }
- else
- {
- *(uint64*)db2Buf = *(uint64*)(data == NULL ? field->ptr : data);
- }
- }
- break;
- case MYSQL_TYPE_INT24:
- {
- int32 temp= (data == NULL ? field->val_int() : field->val_int(data));
- memcpy(db2Buf , &temp, sizeof(temp));
- }
- break;
- case MYSQL_TYPE_DATE:
- case MYSQL_TYPE_NEWDATE:
- {
- String tempString(11);
- if (data == NULL)
- {
- field->val_str(&tempString, (String*)NULL);
- }
- else
- {
- field->val_str(&tempString, data);
- }
- memcpy(db2Buf, tempString.ptr(), 10);
- if (strncmp(db2Buf,ZERO_DATE_VALUE,strlen(ZERO_DATE_VALUE)) == 0)
- {
- if (cachedZeroDateOption == SUBSTITUTE_0001_01_01)
- memcpy(db2Buf, ZERO_DATE_VALUE_SUBST, sizeof(ZERO_DATE_VALUE_SUBST));
- else
- {
- getErrTxt(DB2I_ERR_INVALID_COL_VALUE,field->field_name);
- return(DB2I_ERR_INVALID_COL_VALUE);
- }
- }
-
- convertNumericToEbcdicFast(db2Buf,10);
- }
- break;
- case MYSQL_TYPE_TIME:
- {
- if (db2Field.getType() == QMY_TIME)
- {
- String tempString(10);
- if (data == NULL)
- {
- field->val_str(&tempString, (String*)NULL);
- }
- else
- {
- field->val_str(&tempString, data);
- }
- memcpy(db2Buf, tempString.ptr(), 8);
- (db2Buf)[2]=(db2Buf)[5] = '.';
-
- convertNumericToEbcdicFast(db2Buf, 8);
- }
- else
- {
- int32 temp = sint3korr(data == NULL ? field->ptr : data);
- memcpy(db2Buf, &temp, sizeof(temp));
- }
- }
- break;
- case MYSQL_TYPE_YEAR:
- {
- String tempString(5);
- if (db2Field.getType() == QMY_CHAR)
- {
- if (data == NULL)
- {
- field->val_str(&tempString, (String*)NULL);
- }
- else
- {
- field->val_str(&tempString, data);
- }
- memcpy(db2Buf, tempString.ptr(), 4);
- }
- else
- {
- uint8 temp = *(uint8*)(data == NULL ? field->ptr : data);
- *(uint16*)(db2Buf) = (temp ? temp + 1900 : 0);
- }
- }
- break;
- case MYSQL_TYPE_BIT:
- {
- int bytesToCopy = db2Field.getByteLengthInRecord();
-
- if (data == NULL)
- {
- uint64 temp = field->val_int();
- memcpy(db2Buf,
- ((char*)&temp) + (sizeof(temp) - bytesToCopy),
- bytesToCopy);
- }
- else
- {
- memcpy(db2Buf,
- data,
- bytesToCopy);
- }
- }
- break;
- case MYSQL_TYPE_VARCHAR:
- case MYSQL_TYPE_STRING:
- case MYSQL_TYPE_BLOB:
- {
- if (field->real_type() == MYSQL_TYPE_ENUM ||
- field->real_type() == MYSQL_TYPE_SET)
- {
- int64 temp= (data == NULL ? field->val_int() : field->val_int(data));
- *(int64*)db2Buf = temp;
- }
- else
- {
- const uchar* dataToStore;
- uint32 bytesToStore;
- uint32 bytesToPad = 0;
- CHARSET_INFO* fieldCharSet = field->charset();
- uint32 maxDisplayLength = field->max_display_length();
- switch (fieldType)
- {
- case MYSQL_TYPE_STRING:
- {
- bytesToStore = maxDisplayLength;
- if (data == NULL)
- dataToStore = field->ptr;
- else
- dataToStore = data;
- }
- break;
- case MYSQL_TYPE_VARCHAR:
- {
-
- if (data == NULL)
- {
- bytesToStore = field->data_length();
- dataToStore = field->ptr + ((Field_varstring*)field)->length_bytes;
- }
- else
- {
- // Key lens are stored little-endian
- bytesToStore = *(uint8*)data + ((*(uint8*)(data+1)) << 8);
- dataToStore = data + 2;
- }
- bytesToPad = maxDisplayLength - bytesToStore;
- }
- break;
- case MYSQL_TYPE_BLOB:
- {
- if (data == NULL)
- {
- bytesToStore = ((Field_blob*)field)->get_length();
- bytesToPad = maxDisplayLength - bytesToStore;
- ((Field_blob*)field)->get_ptr((uchar**)&dataToStore);
- }
- else
- {
- // Key lens are stored little-endian
- bytesToStore = *(uint8*)data + ((*(uint8*)(data+1)) << 8);
- dataToStore = data + 2;
- }
- }
- break;
- }
-
- int32 rc;
- uint16 db2FieldType = db2Field.getType();
- switch(db2FieldType)
- {
- case QMY_CHAR:
- if (maxDisplayLength == 0)
- bytesToPad = 1;
- case QMY_VARCHAR:
- if (db2FieldType == QMY_VARCHAR)
- {
- db2Buf += sizeof(uint16);
- bytesToPad = 0;
- }
-
- if (bytesToStore > db2Field.getDataLengthInRecord())
- {
- bytesToStore = db2Field.getDataLengthInRecord();
- field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
- }
-
- if (fieldCharSet == &my_charset_bin) // If binary
- {
- if (bytesToStore)
- memcpy(db2Buf, dataToStore, bytesToStore);
- if (bytesToPad)
- memset(db2Buf + bytesToStore, 0x00, bytesToPad);
- }
- else if (db2Field.getCCSID() == 1208) // utf8
- {
- if (bytesToStore)
- memcpy(db2Buf, dataToStore, bytesToStore);
- if (bytesToPad)
- memset(db2Buf + bytesToStore, ' ', bytesToPad);
- }
- else // single-byte ASCII to EBCDIC
- {
- DBUG_ASSERT(fieldCharSet->mbmaxlen == 1);
- if (bytesToStore)
- {
- rc = convertFieldChars(toDB2, field->field_index, (char*)dataToStore, db2Buf, bytesToStore, bytesToStore, NULL);
- if (rc)
- return rc;
- }
- if (bytesToPad)
- memset(db2Buf + bytesToStore, 0x40, bytesToPad);
- }
-
- if (db2FieldType == QMY_VARCHAR)
- *(uint16*)(db2Buf - sizeof(uint16)) = bytesToStore;
- break;
- case QMY_VARGRAPHIC:
- db2Buf += sizeof(uint16);
- bytesToPad = 0;
- case QMY_GRAPHIC:
- if (maxDisplayLength == 0 && db2FieldType == QMY_GRAPHIC)
- bytesToPad = 2;
-
- if (db2Field.getCCSID() == 13488)
- {
- if (bytesToStore)
- memcpy(db2Buf, dataToStore, bytesToStore);
- if (bytesToPad)
- memset16((db2Buf + bytesToStore), 0x0020, bytesToPad/2);
- }
- else
- {
- size_t db2BytesToStore;
- size_t maxDb2BytesToStore;
-
- if (maxDisplayLength == 0 && db2FieldType == QMY_GRAPHIC)
- maxDb2BytesToStore = 2;
- else
- maxDb2BytesToStore = min(((bytesToStore * 2) / fieldCharSet->mbminlen),
- ((maxDisplayLength * 2) / fieldCharSet->mbmaxlen));
-
- if (bytesToStore == 0)
- db2BytesToStore = 0;
- else
- {
- rc = convertFieldChars(toDB2, field->field_index, (char*)dataToStore, db2Buf, bytesToStore, maxDb2BytesToStore, &db2BytesToStore);
- if (rc)
- return rc;
- bytesToStore = db2BytesToStore;
- }
- if (db2BytesToStore < maxDb2BytesToStore) // If need to pad
- memset16((db2Buf + db2BytesToStore), 0x0020, (maxDb2BytesToStore - db2BytesToStore)/2);
- }
-
- if (db2FieldType == QMY_VARGRAPHIC)
- *(uint16*)(db2Buf-sizeof(uint16)) = bytesToStore/2;
- break;
- case QMY_BLOBCLOB:
- case QMY_DBCLOB:
- {
- DBUG_ASSERT(data == NULL);
- DB2LobField* lobField = (DB2LobField*)(db2Buf + db2Field.calcBlobPad());
-
- if ((fieldCharSet == &my_charset_bin) || // binary or
- (db2Field.getCCSID()==13488) ||
- (db2Field.getCCSID()==1208)) // binary UTF8
- {
- }
- else
- {
- char* temp;
- int32 rc;
- size_t db2BytesToStore;
- if (fieldCharSet->mbmaxlen == 1) // single-byte ASCII to EBCDIC
- {
- temp = getCharacterConversionBuffer(field->field_index, bytesToStore);
- rc = convertFieldChars(toDB2, field->field_index, (char*)dataToStore,temp,bytesToStore, bytesToStore, NULL);
- if (rc)
- return (rc);
- }
- else // Else Far East, special UTF8 or non-special UTF8/UCS2
- {
- size_t maxDb2BytesToStore;
- maxDb2BytesToStore = min(((bytesToStore * 2) / fieldCharSet->mbminlen),
- ((maxDisplayLength * 2) / fieldCharSet->mbmaxlen));
- temp = getCharacterConversionBuffer(field->field_index, maxDb2BytesToStore);
- rc = convertFieldChars(toDB2, field->field_index, (char*)dataToStore,temp,bytesToStore, maxDb2BytesToStore, &db2BytesToStore);
- if (rc)
- return (rc);
- bytesToStore = db2BytesToStore;
- }
- dataToStore = (uchar*)temp;
- }
-
- uint16 blobID = db2Table->getBlobIdFromField(field->field_index);
- if (blobWriteBuffers[blobID] != (char*)dataToStore)
- blobWriteBuffers[blobID].reassign((char*)dataToStore);
- if ((void*)blobWriteBuffers[blobID])
- lobField->dataHandle = (ILEMemHandle)blobWriteBuffers[blobID];
- else
- lobField->dataHandle = 0;
- lobField->length = bytesToStore / (db2FieldType == QMY_DBCLOB ? 2 : 1);
- }
- break;
- }
- }
- }
- break;
- default:
- DBUG_ASSERT(0);
- break;
- }
-
- return (ha_thd()->is_error());
-}
-
-
-/**
- Convert DB2 field data into the equivalent MySQL format
-
- @param db2Field The DB2 field definition
- @param field The MySQL field to receive the converted data
- @param buf The DB2 data to be converted
-*/
-int32 ha_ibmdb2i::convertDB2toMySQL(const DB2Field& db2Field, Field* field, const char* buf)
-{
- int32 storeRC = 0; // Result of the field->store() operation
-
- const char* bufPtr = buf + db2Field.getBufferOffset();
-
- switch (field->type())
- {
- case MYSQL_TYPE_NEWDECIMAL:
- {
- uint precision= ((Field_new_decimal*)field)->precision;
- uint scale= field->decimals();
- uint db2Precision = min(precision, MAX_DEC_PRECISION);
- uint decimalPlace = precision-scale+1;
- char temp[80];
-
- if (precision <= MAX_DEC_PRECISION ||
- scale > precision - MAX_DEC_PRECISION)
- {
- uint numNibbles = db2Precision + (db2Precision % 2 ? 0 : 1);
-
- temp[0] = (bcdGet(bufPtr, numNibbles) == 0xD ? '-' : ' ');
- int strPos=1;
- int bcdPos=(db2Precision % 2 ? 0 : 1);
-
- for (;bcdPos < numNibbles; bcdPos++, strPos++)
- {
- if (strPos == decimalPlace)
- {
- temp[strPos] = '.';
- strPos++;
- }
-
- temp[strPos] = bcdGet(bufPtr, bcdPos) + '0';
- }
-
- temp[strPos] = 0;
-
- storeRC = field->store(temp, strPos, &my_charset_latin1);
- }
- }
- break;
- case MYSQL_TYPE_TINY:
- {
- storeRC = field->store(*(int16*)bufPtr, ((Field_num*)field)->unsigned_flag);
- }
- break;
- case MYSQL_TYPE_SHORT:
- {
- if (((Field_num*)field)->unsigned_flag)
- {
- storeRC = field->store(*(int32*)bufPtr, TRUE);
- }
- else
- {
- storeRC = field->store(*(int16*)bufPtr, FALSE);
- }
- }
- break;
- case MYSQL_TYPE_LONG:
- {
- if (((Field_num*)field)->unsigned_flag)
- {
- storeRC = field->store(*(int64*)bufPtr, TRUE);
- }
- else
- {
- storeRC = field->store(*(int32*)bufPtr, FALSE);
- }
- }
- break;
- case MYSQL_TYPE_FLOAT:
- {
- storeRC = field->store(*(float*)bufPtr);
- }
- break;
- case MYSQL_TYPE_DOUBLE:
- {
- storeRC = field->store(*(double*)bufPtr);
- }
- break;
- case MYSQL_TYPE_LONGLONG:
- {
- char temp[23];
- if (((Field_num*)field)->unsigned_flag)
- {
- temp[0] = (bcdGet(bufPtr, 21) == 0xD ? '-' : ' ');
- int strPos=1;
- int bcdPos=0;
-
- for (;bcdPos <= 20; bcdPos++, strPos++)
- {
- temp[strPos] = bcdGet(bufPtr, bcdPos) + '0';
- }
-
- temp[strPos] = 0;
-
- storeRC = field->store(temp, strPos, &my_charset_latin1);
- }
- else
- {
- storeRC = field->store(*(int64*)bufPtr, FALSE);
- }
- }
- break;
- case MYSQL_TYPE_INT24:
- {
- storeRC = field->store(*(int32*)bufPtr, ((Field_num*)field)->unsigned_flag);
- }
- break;
- case MYSQL_TYPE_DATE:
- case MYSQL_TYPE_NEWDATE:
- {
- longlong value= a4toi_ebcdic((uchar*)bufPtr) * 10000 +
- a2toi_ebcdic((uchar*)bufPtr+5) * 100 +
- a2toi_ebcdic((uchar*)bufPtr+8);
-
- if (cachedZeroDateOption == SUBSTITUTE_0001_01_01 &&
- value == (10000 + 100 + 1))
- value = 0;
-
- storeRC = field->store(value);
- }
- break;
- case MYSQL_TYPE_TIME:
- {
- if (db2Field.getType() == QMY_TIME)
- {
- longlong value= a2toi_ebcdic((uchar*)bufPtr) * 10000 +
- a2toi_ebcdic((uchar*)bufPtr+3) * 100 +
- a2toi_ebcdic((uchar*)bufPtr+6);
-
- storeRC = field->store(value);
- }
- else
- storeRC = field->store(*((int32*)bufPtr));
- }
- break;
- case MYSQL_TYPE_TIMESTAMP:
- case MYSQL_TYPE_DATETIME:
- {
- longlong value= (a4toi_ebcdic((uchar*)bufPtr) * 10000 +
- a2toi_ebcdic((uchar*)bufPtr+5) * 100 +
- a2toi_ebcdic((uchar*)bufPtr+8)) * 1000000LL +
- (a2toi_ebcdic((uchar*)bufPtr+11) * 10000 +
- a2toi_ebcdic((uchar*)bufPtr+14) * 100 +
- a2toi_ebcdic((uchar*)bufPtr+17));
-
- if (cachedZeroDateOption == SUBSTITUTE_0001_01_01 &&
- value == (10000 + 100 + 1) * 1000000LL)
- value = 0;
-
- storeRC = field->store(value);
- }
- break;
- case MYSQL_TYPE_YEAR:
- {
- if (db2Field.getType() == QMY_CHAR)
- {
- storeRC = field->store(bufPtr, 4, &my_charset_bin);
- }
- else
- {
- storeRC = field->store(*((uint16*)bufPtr));
- }
- }
- break;
- case MYSQL_TYPE_BIT:
- {
- uint64 temp= 0;
- int bytesToCopy= db2Field.getByteLengthInRecord();
- memcpy(((char*)&temp) + (sizeof(temp) - bytesToCopy), bufPtr, bytesToCopy);
- storeRC = field->store(temp, TRUE);
- }
- break;
- case MYSQL_TYPE_VARCHAR:
- case MYSQL_TYPE_STRING:
- case MYSQL_TYPE_BLOB:
- {
- if (field->real_type() == MYSQL_TYPE_ENUM ||
- field->real_type() == MYSQL_TYPE_SET)
- {
- storeRC = field->store(*(int64*)bufPtr);
- }
- else
- {
-
- const char* dataToStore = NULL;
- uint32 bytesToStore = 0;
- CHARSET_INFO* fieldCharSet = field->charset();
- switch(db2Field.getType())
- {
- case QMY_CHAR:
- case QMY_GRAPHIC:
- {
- bytesToStore = db2Field.getByteLengthInRecord();
- if (bytesToStore == 0)
- bytesToStore = 1;
- dataToStore = bufPtr;
- }
- break;
- case QMY_VARCHAR:
- {
- bytesToStore = *(uint16*)bufPtr;
- dataToStore = bufPtr+sizeof(uint16);
- }
- break;
- case QMY_VARGRAPHIC:
- {
- /* For VARGRAPHIC, convert the number of double-byte characters
- to the number of bytes. */
- bytesToStore = (*(uint16*)bufPtr)*2;
- dataToStore = bufPtr+sizeof(uint16);
- }
- break;
- case QMY_DBCLOB:
- case QMY_BLOBCLOB:
- {
- DB2LobField* lobField = (DB2LobField* )(bufPtr + db2Field.calcBlobPad());
- bytesToStore = lobField->length * (db2Field.getType() == QMY_DBCLOB ? 2 : 1);
- dataToStore = (char*)blobReadBuffers->getBufferPtr(field->field_index);
- }
- break;
-
- }
-
- if ((fieldCharSet != &my_charset_bin) && // not binary &
- (db2Field.getCCSID() != 13488) && // not UCS2 &
- (db2Field.getCCSID() != 1208))
- {
- char* temp;
- size_t db2BytesToStore;
- int rc;
- if (fieldCharSet->mbmaxlen > 1)
- {
- size_t maxDb2BytesToStore = ((bytesToStore / 2) * fieldCharSet->mbmaxlen); // Worst case for number of bytes
- temp = getCharacterConversionBuffer(field->field_index, maxDb2BytesToStore);
- rc = convertFieldChars(toMySQL, field->field_index, dataToStore, temp, bytesToStore, maxDb2BytesToStore, &db2BytesToStore);
- bytesToStore = db2BytesToStore;
- }
- else // single-byte ASCII to EBCDIC
- {
- temp = getCharacterConversionBuffer(field->field_index, bytesToStore);
- rc = convertFieldChars(toMySQL, field->field_index, dataToStore, temp, bytesToStore, bytesToStore, NULL);
- }
- if (rc)
- return (rc);
- dataToStore = temp;
- }
-
- if ((field)->flags & BLOB_FLAG)
- ((Field_blob*)(field))->set_ptr(bytesToStore, (uchar*)dataToStore);
- else
- storeRC = field->store(dataToStore, bytesToStore, &my_charset_bin);
- }
- }
- break;
- default:
- DBUG_ASSERT(0);
- break;
-
- }
-
- if (storeRC)
- {
- invalidDataFound = true;
- }
-
- return 0;
-}
diff --git a/storage/ibmdb2i/db2i_errors.cc b/storage/ibmdb2i/db2i_errors.cc
deleted file mode 100644
index dd50e40e61b..00000000000
--- a/storage/ibmdb2i/db2i_errors.cc
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#include "db2i_errors.h"
-#include "db2i_ileBridge.h"
-#include "db2i_charsetSupport.h"
-#include "mysql_priv.h"
-#include "stdarg.h"
-
-#define MAX_MSGSTRING 109
-
-/*
- The following strings are associated with errors that can be produced
- within the storage engine proper.
-*/
-static const char* engineErrors[MAX_MSGSTRING] =
-{
- {""},
- {"Error opening codeset conversion from %.64s to %.64s (errno = %d)"},
- {"Invalid %-.10s name '%-.128s'"},
- {"Unsupported move from '%-.128s' to '%-.128s' on RENAME TABLE statement"},
- {"The %-.64s character set is not supported."},
- {"Auto_increment is not allowed for a partitioned table"},
- {"Character set conversion error due to unknown encoding scheme %d"},
- {""},
- {"Table '%-.128s' was not found by the storage engine"},
- {"Could not resolve to %-.128s in library %-.10s type %-.10s (errno = %d)"},
- {"Error on _PGMCALL for program %-.10s in library %-.10s (error = %d)"},
- {"Error on _ILECALL for API '%.128s' (error = %d)"},
- {"Error in iconv() function during character set conversion (errno = %d)"},
- {"Error from Get Encoding Scheme (QTQGESP) API: %d, %d, %d"},
- {"Error from Get Related Default CCSID (QTQGRDC) API: %d, %d, %d"},
- {"Data out of range for column '%.192s'"},
- {"Schema name '%.128s' exceeds maximum length of %d characters"},
- {"Multiple collations not supported in a single index or constraint"},
- {"Sort sequence was not found"},
- {"One or more characters in column %.128s were substituted during conversion"},
- {"A decimal column exceeded the maximum precision. Data may be truncated."},
- {"Some data returned by DB2 for table %s could not be converted for MySQL"},
- {""},
- {"Column %.128s contains characters that cannot be converted"},
- {"An invalid name was specified for ibmdb2i_rdb_name."},
- {"A duplicate key was encountered for index '%.128s'"},
- {"A table with the same name exists but has incompatible column definitions."},
- {"The created table was discovered as an existing DB2 object."},
- {"Some attribute(s) defined for column '%.128s' may not be honored by accesses from DB2."},
-};
-
-/*
- The following strings are associated with errors that can be returned
- by the operating system via the QMY_* APIs. Most are very uncommon and
- indicate a bug somewhere.
-*/
-static const char* systemErrors[MAX_MSGSTRING] =
-{
- {"Thread ID is too long"},
- {"Error creating a SPACE memory object"},
- {"Error creating a FILE memory object"},
- {"Error creating a SPACE synchronization token"},
- {"Error creating a FILE synchronization token"},
- {"See message %-.7s in joblog for job %-.6s/%-.10s/%-.10s."},
- {"Error unlocking a synchronization token when closing a connection"},
- {"Invalid action specified for an 'object lock' request"},
- {"Invalid action specified for a savepoint request"},
- {"Partial keys are not supported with an ICU sort sequence"},
- {"Error retrieving an ICU sort key"},
- {"Error converting single-byte sort sequence to UCS-2"},
- {"An unsupported collation was specified"},
- {"Validation failed for referenced table of foreign key constraint"},
- {"Error extracting table for constraint information"},
- {"Error extracting referenced table for constraint information"},
- {"Invalid action specified for a 'commitment control' request"},
- {"Invalid commitment control isolation level specified on 'open' request"},
- {"Invalid file handle"},
- {" "},
- {"Invalid option specified for returning data on 'read' request"},
- {"Invalid orientation specified for 'read' request"},
- {"Invalid option type specified for 'read' request"},
- {"Invalid isolation level for starting commitment control"},
- {"Error unlocking a synchronization token in module QMYALC"},
- {"Length of space for returned format is not long enough"},
- {"SQL XA transactions are currently unsupported by this interface"},
- {"The associated QSQSRVR job was killed or ended unexpectedly."},
- {"Error unlocking a synchronization token in module QMYSEI"},
- {"Error unlocking a synchronization token in module QMYSPO"},
- {"Error converting input CCSID from short form to long form"},
- {" "},
- {"Error getting associated CCSID for CCSID conversion"},
- {"Error converting a string from one CCSID to another"},
- {"Error unlocking a synchronization token"},
- {"Error destroying a synchronization token"},
- {"Error locking a synchronization token"},
- {"Error recreating a synchronization token"},
- {"A space handle was not specified for a constraint request"},
- {"An SQL cursor was specified for a delete request"},
- {" "},
- {"Error on delete request because current UFCB for connection is not open"},
- {"An SQL cursor was specified for an object initialization request"},
- {"An SQL cursor was specified for an object override request"},
- {"A space handle was not specified for an object override request"},
- {"An SQL cursor was specified for an information request"},
- {"An SQL cursor was specified for an object lock request"},
- {"An SQL cursor was specified for an optimize request"},
- {"A data handle was not specified for a read request"},
- {"A row number handle was not specified for a read request"},
- {"A key handle was not specified for a read request"},
- {"An SQL cursor was specified for an row estimation request"},
- {"A space handle was not specified for a row estimation request"},
- {"An SQL cursor was specified for a release record request"},
- {"A statement handle was not specified for an 'execute immediate' request"},
- {"A statement handle was not specified for a 'prepare open' request"},
- {"An SQL cursor was specified for an update request"},
- {"The UFCB was not open for read"},
- {"Error on update request because current UFCB for connection is not open"},
- {"A data handle was not specified for an update request"},
- {"An SQL cursor was specified for a write request"},
- {"A data handle was not specified for a write request"},
- {"An unknown function was specified on a process request"},
- {"A share definition was not specified for an 'allocate share' request"},
- {"A share handle was not specified for an 'allocate share' request"},
- {"A use count handle was not specified for an 'allocate share' request"},
- {"A 'records per key' handle was not specified for an information request"},
- {"Error resolving LOB addresss"},
- {"Length of a LOB space is too small"},
- {"An unknown function was specified for a server request"},
- {"Object authorization failed. See message %-.7s in joblog for job %-.6s/%-.10s/%-.10s. for more information."},
- {" "},
- {"Error locking mutex on server"},
- {"Error unlocking mutex on server"},
- {"Error checking for RDB name in RDB Directory"},
- {"Error creating mutex on server"},
- {"A table with that name already exists"},
- {" "},
- {"Error unlocking mutex"},
- {"Error connecting to server job"},
- {"Error connecting to server job"},
- {" "},
- {"Function check occurred while registering parameter spaces. See joblog."},
- {" "},
- {" "},
- {"End of block"},
- {"The file has changed and might not be compatible with the MySQL table definition"},
- {"Error giving pipe to server job"},
- {"There are open object locks when attempting to deallocate"},
- {"There is no open lock"},
- {" "},
- {" "},
- {"The maximum value for the auto_increment data type was exceeded"},
- {"Error occurred closing the pipe "},
- {"Error occurred taking a descriptor for the pipe"},
- {"Error writing to pipe "},
- {"Server was interrupted "},
- {"No pipe descriptor exists for reuse "},
- {"Error occurred during an SQL prepare statement "},
- {"Error occurred during an SQL open "},
- {" "},
- {" "},
- {" "},
- {" "},
- {" "},
- {" "},
- {"An unspecified error was returned from the system."},
- {" "}
-};
-
-/**
- This function builds the text string for an error code, and substitutes
- a variable number of replacement variables into the string.
-*/
-void getErrTxt(int errCode, ...)
-{
- va_list args;
- va_start(args,errCode);
- char* buffer = db2i_ileBridge::getBridgeForThread()->getErrorStorage();
- const char* msg;
-
- if (errCode >= QMY_ERR_MIN && errCode <= QMY_ERR_SQ_OPEN)
- msg = systemErrors[errCode - QMY_ERR_MIN];
- else
- {
- DBUG_ASSERT(errCode >= DB2I_FIRST_ERR && errCode <= DB2I_LAST_ERR);
- msg = engineErrors[errCode - DB2I_FIRST_ERR];
- }
-
- (void) my_vsnprintf (buffer, MYSQL_ERRMSG_SIZE, msg, args);
- va_end(args);
- fprintf(stderr,"ibmdb2i error %d: %s\n",errCode,buffer);
- DBUG_PRINT("error", ("ibmdb2i error %d: %s",errCode,buffer));
-}
-
-static inline void trimSpace(char* str)
-{
- char* end = strchr(str, ' ');
- if (end) *end = 0;
-}
-
-
-/**
- Generate the error text specific to an API error returned by a QMY_* API.
-
- @parm errCode The error value
- @parm errInfo The structure containing the message and job identifiers.
-*/
-void reportSystemAPIError(int errCode, const Qmy_Error_output *errInfo)
-{
- if (errCode >= QMY_ERR_MIN && errCode <= QMY_ERR_SQ_OPEN)
- {
- switch(errCode)
- {
- case QMY_ERR_MSGID:
- case QMY_ERR_NOT_AUTH:
- {
- DBUG_ASSERT(errInfo);
- char jMsg[8]; // Error message ID
- char jName[11]; // Job name
- char jUser[11]; // Job user
- char jNbr[7]; // Job number
- memset(jMsg, 0, sizeof(jMsg));
- memset(jName, 0, sizeof(jMsg));
- memset(jUser, 0, sizeof(jMsg));
- memset(jMsg, 0, sizeof(jMsg));
-
- convFromEbcdic(errInfo->MsgId,jMsg,sizeof(jMsg)-1);
- convFromEbcdic(errInfo->JobName,jName,sizeof(jName)-1);
- trimSpace(jName);
- convFromEbcdic(errInfo->JobUser,jUser,sizeof(jUser)-1);
- trimSpace(jUser);
- convFromEbcdic(errInfo->JobNbr,jNbr,sizeof(jNbr)-1);
- getErrTxt(errCode,jMsg,jNbr,jUser,jName);
- }
- break;
- case QMY_ERR_RTNFMT:
- {
- getErrTxt(QMY_ERR_LVLID_MISMATCH);
- }
- break;
- default:
- getErrTxt(errCode);
- break;
- }
- }
-}
-
-
-/**
- Generate a warning for the specified error.
-*/
-void warning(THD *thd, int errCode, ...)
-{
- va_list args;
- va_start(args,errCode);
- char buffer[MYSQL_ERRMSG_SIZE];
- const char* msg;
-
- DBUG_ASSERT(errCode >= DB2I_FIRST_ERR && errCode <= DB2I_LAST_ERR);
- msg = engineErrors[errCode - DB2I_FIRST_ERR];
-
- (void) my_vsnprintf (buffer, MYSQL_ERRMSG_SIZE, msg, args);
- va_end(args);
- DBUG_PRINT("warning", ("ibmdb2i warning %d: %s",errCode,buffer));
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, errCode, buffer);
-}
-
-
diff --git a/storage/ibmdb2i/db2i_errors.h b/storage/ibmdb2i/db2i_errors.h
deleted file mode 100644
index b6dd314ef50..00000000000
--- a/storage/ibmdb2i/db2i_errors.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#ifndef DB2I_ERRORS_H
-#define DB2I_ERRORS_H
-
-#include "qmyse.h"
-class THD;
-
-/**
- @enum DB2I_errors
-
- @brief These are the errors that can be returned by the storage engine proper
- and that are specific to the engine. Refer to db2i_errors.cc for text
- descriptions of the errors.
-*/
-
-enum DB2I_errors
-{
- DB2I_FIRST_ERR = 2500,
- DB2I_ERR_ICONV_OPEN,
- DB2I_ERR_INVALID_NAME,
- DB2I_ERR_RENAME_MOVE,
- DB2I_ERR_UNSUPP_CHARSET,
- DB2I_ERR_PART_AUTOINC,
- DB2I_ERR_UNKNOWN_ENCODING,
- DB2I_ERR_RESERVED,
- DB2I_ERR_TABLE_NOT_FOUND,
- DB2I_ERR_RESOLVE_OBJ,
- DB2I_ERR_PGMCALL,
- DB2I_ERR_ILECALL,
- DB2I_ERR_ICONV,
- DB2I_ERR_QTQGESP,
- DB2I_ERR_QTQGRDC,
- DB2I_ERR_INVALID_COL_VALUE,
- DB2I_ERR_TOO_LONG_SCHEMA,
- DB2I_ERR_MIXED_COLLATIONS,
- DB2I_ERR_SRTSEQ,
- DB2I_ERR_SUB_CHARS,
- DB2I_ERR_PRECISION,
- DB2I_ERR_INVALID_DATA,
- DB2I_ERR_RESERVED2,
- DB2I_ERR_ILL_CHAR,
- DB2I_ERR_BAD_RDB_NAME,
- DB2I_ERR_UNKNOWN_IDX,
- DB2I_ERR_DISCOVERY_MISMATCH,
- DB2I_ERR_WARN_CREATE_DISCOVER,
- DB2I_ERR_WARN_COL_ATTRS,
- DB2I_LAST_ERR = DB2I_ERR_WARN_COL_ATTRS
-};
-
-void getErrTxt(int errcode, ...);
-void reportSystemAPIError(int errCode, const Qmy_Error_output *errInfo);
-void warning(THD *thd, int errCode, ...);
-
-const char* DB2I_SQL0350 = "\xE2\xD8\xD3\xF0\xF3\xF5\xF0"; // SQL0350 in EBCDIC
-const char* DB2I_CPF503A = "\xC3\xD7\xC6\xF5\xF0\xF3\xC1"; // CPF503A in EBCDIC
-const char* DB2I_SQL0538 = "\xE2\xD8\xD3\xF0\xF5\xF3\xF8"; // SQL0538 in EBCDIC
-
-#endif
diff --git a/storage/ibmdb2i/db2i_file.cc b/storage/ibmdb2i/db2i_file.cc
deleted file mode 100644
index 2d83248eea7..00000000000
--- a/storage/ibmdb2i/db2i_file.cc
+++ /dev/null
@@ -1,553 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-
-#include "db2i_file.h"
-#include "db2i_charsetSupport.h"
-#include "db2i_collationSupport.h"
-#include "db2i_misc.h"
-#include "db2i_errors.h"
-#include "my_dir.h"
-
-db2i_table::db2i_table(const TABLE_SHARE* myTable, const char* path) :
- mysqlTable(myTable),
- db2StartId(0),
- blobFieldCount(0),
- blobFields(NULL),
- blobFieldActualSizes(NULL),
- logicalFiles(NULL),
- physicalFile(NULL),
- db2TableNameSQLAscii(NULL),
- db2LibNameSQLAscii(NULL)
-{
- char asciiLibName[MAX_DB2_SCHEMANAME_LENGTH + 1];
- getDB2LibNameFromPath(path, asciiLibName, ASCII_NATIVE);
-
- char asciiFileName[MAX_DB2_FILENAME_LENGTH + 1];
- getDB2FileNameFromPath(path, asciiFileName, ASCII_NATIVE);
-
- size_t libNameLen = strlen(asciiLibName);
- size_t fileNameLen = strlen(asciiFileName);
-
- db2LibNameEbcdic=(char *)
- my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
- &db2LibNameEbcdic, libNameLen+1,
- &db2LibNameAscii, libNameLen+1,
- &db2LibNameSQLAscii, libNameLen*2 + 1,
- &db2TableNameEbcdic, fileNameLen+1,
- &db2TableNameAscii, fileNameLen+1,
- &db2TableNameSQLAscii, fileNameLen*2 + 1,
- NullS);
-
- if (likely(db2LibNameEbcdic))
- {
- memcpy(db2LibNameAscii, asciiLibName, libNameLen);
- convertNativeToSQLName(db2LibNameAscii, db2LibNameSQLAscii);
- convToEbcdic(db2LibNameAscii, db2LibNameEbcdic, libNameLen);
- memcpy(db2TableNameAscii, asciiFileName, fileNameLen);
- convertNativeToSQLName(db2TableNameAscii, db2TableNameSQLAscii);
- convToEbcdic(db2TableNameAscii, db2TableNameEbcdic, fileNameLen);
- }
-
- conversionDefinitions[toMySQL] = NULL;
- conversionDefinitions[toDB2] = NULL;
-
- isTemporaryTable = (strstr(mysqlTable->path.str, mysql_tmpdir) == mysqlTable->path.str);
-}
-
-
-int32 db2i_table::initDB2Objects(const char* path)
-{
- uint fileObjects = 1 + mysqlTable->keys;
- ValidatedPointer<ShrDef> fileDefnSpace(sizeof(ShrDef) * fileObjects);
-
- physicalFile = new db2i_file(this);
- physicalFile->fillILEDefn(&fileDefnSpace[0], true);
-
- logicalFileCount = mysqlTable->keys;
- if (logicalFileCount > 0)
- {
- logicalFiles = new db2i_file*[logicalFileCount];
- for (int k = 0; k < logicalFileCount; k++)
- {
- logicalFiles[k] = new db2i_file(this, k);
- logicalFiles[k]->fillILEDefn(&fileDefnSpace[k+1], false);
- }
- }
-
- ValidatedPointer<FILE_HANDLE> fileDefnHandles(sizeof(FILE_HANDLE) * fileObjects);
- size_t formatSpaceLen = sizeof(format_hdr_t) + mysqlTable->fields * sizeof(DB2Field);
- formatSpace.alloc(formatSpaceLen);
-
- int rc = db2i_ileBridge::getBridgeForThread()->
- expectErrors(QMY_ERR_RTNFMT)->
- allocateFileDefn(fileDefnSpace,
- fileDefnHandles,
- fileObjects,
- db2LibNameEbcdic,
- strlen(db2LibNameEbcdic),
- formatSpace,
- formatSpaceLen);
-
- if (rc)
- {
- // We have to handle a format space error as a special case of a FID
- // mismatch. We should only get the space error if columns have been added
- // to the DB2 table without MySQL's knowledge, which is effectively a
- // FID problem.
- if (rc == QMY_ERR_RTNFMT)
- {
- rc = QMY_ERR_LVLID_MISMATCH;
- getErrTxt(rc);
- }
- return rc;
- }
-
- convFromEbcdic(((format_hdr_t*)formatSpace)->FilLvlId, fileLevelID, sizeof(fileLevelID));
-
- if (!doFileIDsMatch(path))
- {
- getErrTxt(QMY_ERR_LVLID_MISMATCH);
- return QMY_ERR_LVLID_MISMATCH;
- }
-
- physicalFile->setMasterDefnHandle(fileDefnHandles[0]);
- for (int k = 0; k < mysqlTable->keys; k++)
- {
- logicalFiles[k]->setMasterDefnHandle(fileDefnHandles[k+1]);
- }
-
- db2StartId = (uint64)(((format_hdr_t*)formatSpace)->StartIdVal);
- db2Fields = (DB2Field*)((char*)(void*)formatSpace + ((format_hdr_t*)formatSpace)->ColDefOff);
-
- uint fields = mysqlTable->fields;
- for (int i = 0; i < fields; ++i)
- {
- if (db2Field(i).isBlob())
- {
- blobFieldCount++;
- }
- }
-
- if (blobFieldCount)
- {
- blobFieldActualSizes = (uint*)my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
- &blobFieldActualSizes, blobFieldCount * sizeof(uint),
- &blobFields, blobFieldCount * sizeof(uint16),
- NullS);
-
- int b = 0;
- for (int i = 0; i < fields; ++i)
- {
- if (db2Field(i).isBlob())
- {
- blobFields[b++] = i;
- }
- }
- }
-
- my_multi_malloc(MYF(MY_WME),
- &conversionDefinitions[toMySQL], fields * sizeof(iconv_t),
- &conversionDefinitions[toDB2], fields * sizeof(iconv_t),
- NullS);
- for (int i = 0; i < fields; ++i)
- {
- conversionDefinitions[toMySQL][i] = (iconv_t)(-1);
- conversionDefinitions[toDB2][i] = (iconv_t)(-1);
- }
-
- return 0;
-}
-
-int db2i_table::fastInitForCreate(const char* path)
-{
- ValidatedPointer<ShrDef> fileDefnSpace(sizeof(ShrDef));
-
- physicalFile = new db2i_file(this);
- physicalFile->fillILEDefn(fileDefnSpace, true);
-
- ValidatedPointer<FILE_HANDLE> fileDefnHandles(sizeof(FILE_HANDLE));
-
- size_t formatSpaceLen = sizeof(format_hdr_t) +
- mysqlTable->fields * sizeof(DB2Field);
- formatSpace.alloc(formatSpaceLen);
-
- int rc = db2i_ileBridge::getBridgeForThread()->allocateFileDefn(fileDefnSpace,
- fileDefnHandles,
- 1,
- db2LibNameEbcdic,
- strlen(db2LibNameEbcdic),
- formatSpace,
- formatSpaceLen);
-
- if (rc)
- return rc;
-
- convFromEbcdic(((format_hdr_t*)formatSpace)->FilLvlId, fileLevelID, sizeof(fileLevelID));
- doFileIDsMatch(path);
-
- return 0;
-}
-
-bool db2i_table::doFileIDsMatch(const char* path)
-{
- char name_buff[FN_REFLEN];
-
- fn_format(name_buff, path, "", FID_EXT, (MY_REPLACE_EXT | MY_UNPACK_FILENAME));
-
- File fd = my_open(name_buff, O_RDONLY, MYF(0));
-
- if (fd == -1)
- {
- if (errno == ENOENT)
- {
- fd = my_create(name_buff, 0, O_WRONLY, MYF(MY_WME));
-
- if (fd == -1)
- {
- // TODO: Report errno here
- return false;
- }
- my_write(fd, (uchar*)fileLevelID, sizeof(fileLevelID), MYF(MY_WME));
- my_close(fd, MYF(0));
- return true;
- }
- else
- {
- // TODO: Report errno here
- return false;
- }
- }
-
- char diskFID[sizeof(fileLevelID)];
-
- bool match = false;
-
- if (my_read(fd, (uchar*)diskFID, sizeof(diskFID), MYF(MY_WME)) == sizeof(diskFID) &&
- (memcmp(diskFID, fileLevelID, sizeof(diskFID)) == 0))
- match = true;
-
- my_close(fd, MYF(0));
-
- return match;
-}
-
-void db2i_table::deleteAssocFiles(const char* name)
-{
- char name_buff[FN_REFLEN];
- fn_format(name_buff, name, "", FID_EXT, (MY_REPLACE_EXT | MY_UNPACK_FILENAME));
- my_delete(name_buff, MYF(0));
-}
-
-void db2i_table::renameAssocFiles(const char* from, const char* to)
-{
- rename_file_ext(from, to, FID_EXT);
-}
-
-
-db2i_table::~db2i_table()
-{
- my_free(blobFieldActualSizes);
- my_free(conversionDefinitions[toMySQL]);
-
- if (logicalFiles)
- {
- for (int k = 0; k < logicalFileCount; ++k)
- {
- delete logicalFiles[k];
- }
-
- delete[] logicalFiles;
- }
- delete physicalFile;
-
- my_free(db2LibNameEbcdic);
-}
-
-void db2i_table::getDB2QualifiedName(char* to)
-{
- strcat(to, getDB2LibName(ASCII_SQL));
- strcat(to, ".");
- strcat(to, getDB2TableName(ASCII_SQL));
-}
-
-
-void db2i_table::getDB2QualifiedNameFromPath(const char* path, char* to)
-{
- getDB2LibNameFromPath(path, to);
- strcat(to, ".");
- getDB2FileNameFromPath(path, strend(to));
-}
-
-
-size_t db2i_table::smartFilenameToTableName(const char *in, char* out, size_t outlen)
-{
- if (strchr(in, '@') == NULL)
- {
- return filename_to_tablename(in, out, outlen);
- }
-
- char* test = (char*) my_malloc(outlen, MYF(MY_WME));
-
- filename_to_tablename(in, test, outlen);
-
- char* cur = test;
-
- while (*cur)
- {
- if ((*cur <= 0x20) || (*cur >= 0x80))
- {
- strncpy(out, in, outlen);
- my_free(test);
- return min(outlen, strlen(out));
- }
- ++cur;
- }
-
- strncpy(out, test, outlen);
- my_free(test);
- return min(outlen, strlen(out));
-}
-
-void db2i_table::filenameToTablename(const char* in, char* out, size_t outlen)
-{
- if (strchr(in, '#') == NULL)
- {
- smartFilenameToTableName(in, out, outlen);
- return;
- }
-
- char* temp = (char*)sql_alloc(outlen);
-
- const char* part1, *part2, *part3, *part4;
- part1 = in;
- part2 = strstr(part1, "#P#");
- if (part2);
- {
- part3 = part2 + 3;
- part4 = strchr(part3, '#');
- if (!part4)
- part4 = strend(in);
- }
-
- memcpy(temp, part1, min(outlen, part2 - part1));
- temp[min(outlen-1, part2-part1)] = 0;
-
- int32 accumLen = smartFilenameToTableName(temp, out, outlen);
-
- if (part2 && (accumLen + 4 < outlen))
- {
- strcat(out, "#P#");
- accumLen += 4;
-
- memset(temp, 0, min(outlen, part2-part1));
- memcpy(temp, part3, min(outlen, part4-part3));
- temp[min(outlen-1, part4-part3)] = 0;
-
- accumLen += smartFilenameToTableName(temp, strend(out), outlen-accumLen);
-
- if (part4 && (accumLen + (strend(in) - part4 + 1) < outlen))
- {
- strcat(out, part4);
- }
- }
-}
-
-void db2i_table::getDB2LibNameFromPath(const char* path, char* lib, NameFormatFlags format)
-{
- if (strstr(path, mysql_tmpdir) == path)
- {
- strcpy(lib, DB2I_TEMP_TABLE_SCHEMA);
- }
- else
- {
- const char* c = strend(path) - 1;
- while (c > path && *c != '\\' && *c != '/')
- --c;
-
- if (c != path)
- {
- const char* dbEnd = c;
- do {
- --c;
- } while (c >= path && *c != '\\' && *c != '/');
-
- if (c >= path)
- {
- const char* dbStart = c+1;
- char fileName[FN_REFLEN];
- memcpy(fileName, dbStart, dbEnd - dbStart);
- fileName[dbEnd-dbStart] = 0;
-
- char dbName[MAX_DB2_SCHEMANAME_LENGTH+1];
- filenameToTablename(fileName, dbName , sizeof(dbName));
-
- convertMySQLNameToDB2Name(dbName, lib, sizeof(dbName), true, (format==ASCII_SQL) );
- }
- else
- DBUG_ASSERT(0); // This should never happen!
- }
- }
-}
-
-void db2i_table::getDB2FileNameFromPath(const char* path, char* file, NameFormatFlags format)
-{
- const char* fileEnd = strend(path);
- const char* c = fileEnd;
- while (c > path && *c != '\\' && *c != '/')
- --c;
-
- if (c != path)
- {
- const char* fileStart = c+1;
- char fileName[FN_REFLEN];
- memcpy(fileName, fileStart, fileEnd - fileStart);
- fileName[fileEnd - fileStart] = 0;
- char db2Name[MAX_DB2_FILENAME_LENGTH+1];
- filenameToTablename(fileName, db2Name, sizeof(db2Name));
- convertMySQLNameToDB2Name(db2Name, file, sizeof(db2Name), true, (format==ASCII_SQL) );
- }
-}
-
-// Generates the DB2 index name when given the MySQL index and table names.
-int32 db2i_table::appendQualifiedIndexFileName(const char* indexName,
- const char* tableName,
- String& to,
- NameFormatFlags format,
- enum_DB2I_INDEX_TYPE type)
-{
- char generatedName[MAX_DB2_FILENAME_LENGTH+1];
- strncpy(generatedName, indexName, DB2I_INDEX_NAME_LENGTH_TO_PRESERVE);
- generatedName[DB2I_INDEX_NAME_LENGTH_TO_PRESERVE] = 0;
- char* endOfGeneratedName;
-
- if (type == typeDefault)
- {
- strcat(generatedName, DB2I_DEFAULT_INDEX_NAME_DELIMITER);
- endOfGeneratedName = strend(generatedName);
- }
- else if (type != typeNone)
- {
- strcat(generatedName, DB2I_ADDL_INDEX_NAME_DELIMITER);
- endOfGeneratedName = strend(generatedName);
- *(endOfGeneratedName-2) = char(type);
- }
-
- uint lenWithoutFile = endOfGeneratedName - generatedName;
-
- char strippedTableName[MAX_DB2_FILENAME_LENGTH+1];
- if (format == ASCII_SQL)
- {
- strcpy(strippedTableName, tableName);
- stripExtraQuotes(strippedTableName+1, sizeof(strippedTableName));
- tableName = strippedTableName;
- }
-
- if (strlen(tableName) > (MAX_DB2_FILENAME_LENGTH-lenWithoutFile))
- return -1;
-
- strncat(generatedName,
- tableName+1,
- min(strlen(tableName), (MAX_DB2_FILENAME_LENGTH-lenWithoutFile))-2 );
-
- char finalName[MAX_DB2_FILENAME_LENGTH+1];
- convertMySQLNameToDB2Name(generatedName, finalName, sizeof(finalName), true, (format==ASCII_SQL));
- to.append(finalName);
-
- return 0;
-}
-
-
-void db2i_table::findConversionDefinition(enum_conversionDirection direction, uint16 fieldID)
-{
- getConversion(direction,
- mysqlTable->field[fieldID]->charset(),
- db2Field(fieldID).getCCSID(),
- conversionDefinitions[direction][fieldID]);
-}
-
-
-db2i_file::db2i_file(db2i_table* table) : db2Table(table)
-{
- commonCtorInit();
-
- DBUG_ASSERT(table->getMySQLTable()->table_name.length <= MAX_DB2_FILENAME_LENGTH-2);
-
- db2FileName = (char*)table->getDB2TableName(db2i_table::EBCDIC_NATIVE);
-}
-
-db2i_file::db2i_file(db2i_table* table, int index) : db2Table(table)
-{
- commonCtorInit();
-
- if ((index == table->getMySQLTable()->primary_key) && !table->isTemporary())
- {
- db2FileName = (char*)table->getDB2TableName(db2i_table::EBCDIC_NATIVE);
- }
- else
- {
- // Generate the index name (in index___table form); quote and EBCDICize it.
- String qualifiedPath;
- qualifiedPath.length(0);
-
- const char* asciiFileName = table->getDB2TableName(db2i_table::ASCII_NATIVE);
-
- db2i_table::appendQualifiedIndexFileName(table->getMySQLTable()->key_info[index].name,
- asciiFileName,
- qualifiedPath,
- db2i_table::ASCII_NATIVE,
- typeDefault);
-
- db2FileName = (char*)my_malloc(qualifiedPath.length()+1, MYF(MY_WME | MY_ZEROFILL));
- convToEbcdic(qualifiedPath.ptr(), db2FileName, qualifiedPath.length());
- }
-}
-
-void db2i_file::commonCtorInit()
-{
- masterDefn = 0;
- memset(&formats, 0, maxRowFormats*sizeof(RowFormat));
-}
-
-
-void db2i_file::fillILEDefn(ShrDef* defn, bool readInArrivalSeq)
-{
- defn->ObjNamLen = strlen(db2FileName);
- DBUG_ASSERT(defn->ObjNamLen <= sizeof(defn->ObjNam));
- memcpy(defn->ObjNam, db2FileName, defn->ObjNamLen);
- defn->ArrSeq[0] = (readInArrivalSeq ? QMY_YES : QMY_NO);
-}
-
diff --git a/storage/ibmdb2i/db2i_file.h b/storage/ibmdb2i/db2i_file.h
deleted file mode 100644
index 6cc6ae8947b..00000000000
--- a/storage/ibmdb2i/db2i_file.h
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#ifndef DB2I_FILE_H
-#define DB2I_FILE_H
-
-#include "db2i_global.h"
-#include "db2i_ileBridge.h"
-#include "db2i_validatedPointer.h"
-#include "my_atomic.h"
-#include "db2i_iconv.h"
-#include "db2i_charsetSupport.h"
-
-const char FID_EXT[] = ".FID";
-
-class db2i_file;
-
-#pragma pack(1)
-struct DB2LobField
-{
- char reserved1;
- uint32 length;
- char reserved2[4];
- uint32 ordinal;
- ILEMemHandle dataHandle;
- char reserved3[8];
-};
-#pragma pack(pop)
-
-class DB2Field
-{
- public:
- uint16 getType() const { return *(uint16*)(&definition.ColType); }
- uint16 getByteLengthInRecord() const { return definition.ColLen; }
- uint16 getDataLengthInRecord() const
- {
- return (getType() == QMY_VARCHAR || getType() == QMY_VARGRAPHIC ? definition.ColLen - 2 : definition.ColLen);
- }
- uint16 getCCSID() const { return *(uint16*)(&definition.ColCCSID); }
- bool isBlob() const
- {
- uint16 type = getType();
- return (type == QMY_BLOBCLOB || type == QMY_DBCLOB);
- }
- uint16 getBufferOffset() const { return definition.ColBufOff; }
- uint16 calcBlobPad() const
- {
- DBUG_ASSERT(isBlob());
- return getByteLengthInRecord() - sizeof (DB2LobField);
- }
- DB2LobField* asBlobField(char* buf) const
- {
- DBUG_ASSERT(isBlob());
- return (DB2LobField*)(buf + getBufferOffset() + calcBlobPad());
- }
- private:
- col_def_t definition;
-};
-
-
-/**
- @class db2i_table
-
- @details
- This class describes the logical SQL table provided by DB2.
- It stores "table-scoped" information such as the name of the
- DB2 schema, BLOB descriptions, and the corresponding MySQL table definition.
- Only one instance exists per SQL table.
-*/
-class db2i_table
-{
- public:
- enum NameFormatFlags
- {
- ASCII_SQL,
- ASCII_NATIVE,
- EBCDIC_NATIVE
- };
-
- db2i_table(const TABLE_SHARE* myTable, const char* path = NULL);
-
- ~db2i_table();
-
- int32 initDB2Objects(const char* path);
-
- const TABLE_SHARE* getMySQLTable() const
- {
- return mysqlTable;
- }
-
- uint64 getStartId() const
- {
- return db2StartId;
- }
-
- void updateStartId(uint64 newStartId)
- {
- db2StartId = newStartId;
- }
-
- bool hasBlobs() const
- {
- return (blobFieldCount > 0);
- }
-
- uint16 getBlobCount() const
- {
- return blobFieldCount;
- }
-
- uint getBlobFieldActualSize(uint fieldIndex) const
- {
- return blobFieldActualSizes[getBlobIdFromField(fieldIndex)];
- }
-
- void updateBlobFieldActualSize(uint fieldIndex, uint32 newSize)
- {
- // It's OK that this isn't threadsafe, since this is just an advisory
- // value. If a race condition causes the lesser of two values to be stored,
- // that's OK.
- uint16 blobID = getBlobIdFromField(fieldIndex);
- DBUG_ASSERT(blobID < blobFieldCount);
-
- if (blobFieldActualSizes[blobID] < newSize)
- {
- blobFieldActualSizes[blobID] = newSize;
- }
- }
-
-
-
- const char* getDB2LibName(NameFormatFlags format = EBCDIC_NATIVE)
- {
- switch (format)
- {
- case EBCDIC_NATIVE:
- return db2LibNameEbcdic; break;
- case ASCII_NATIVE:
- return db2LibNameAscii; break;
- case ASCII_SQL:
- return db2LibNameSQLAscii; break;
- default:
- DBUG_ASSERT(0);
- }
- return NULL;
- }
-
- const char* getDB2TableName(NameFormatFlags format = EBCDIC_NATIVE) const
- {
- switch (format)
- {
- case EBCDIC_NATIVE:
- return db2TableNameEbcdic; break;
- case ASCII_NATIVE:
- return db2TableNameAscii; break;
- case ASCII_SQL:
- return db2TableNameAscii; break;
- break;
- default:
- DBUG_ASSERT(0);
- }
- return NULL;
- }
-
- DB2Field& db2Field(int fieldID) const { return db2Fields[fieldID]; }
- DB2Field& db2Field(const Field* field) const { return db2Field(field->field_index); }
-
- void processFormatSpace();
-
- void* getFormatSpace(size_t& spaceNeeded)
- {
- DBUG_ASSERT(formatSpace == NULL);
- spaceNeeded = sizeof(format_hdr_t) + mysqlTable->fields * sizeof(DB2Field);
- formatSpace.alloc(spaceNeeded);
- return (void*)formatSpace;
- }
-
- bool isTemporary() const
- {
- return isTemporaryTable;
- }
-
- void getDB2QualifiedName(char* to);
- static void getDB2LibNameFromPath(const char* path, char* lib, NameFormatFlags format=ASCII_SQL);
- static void getDB2FileNameFromPath(const char* path, char* file, NameFormatFlags format=ASCII_SQL);
- static void getDB2QualifiedNameFromPath(const char* path, char* to);
- static int32 appendQualifiedIndexFileName(const char* indexName,
- const char* tableName,
- String& to,
- NameFormatFlags format=ASCII_SQL,
- enum_DB2I_INDEX_TYPE type=typeDefault);
-
- uint16 getBlobIdFromField(uint16 fieldID) const
- {
- for (int i = 0; i < blobFieldCount; ++i)
- {
- if (blobFields[i] == fieldID)
- return i;
- }
- DBUG_ASSERT(0);
- return 0;
- }
-
- iconv_t& getConversionDefinition(enum_conversionDirection direction,
- uint16 fieldID)
- {
- if (conversionDefinitions[direction][fieldID] == (iconv_t)(-1))
- findConversionDefinition(direction, fieldID);
-
- return conversionDefinitions[direction][fieldID];
- }
-
- const db2i_file* dataFile() const
- {
- return physicalFile;
- }
-
- const db2i_file* indexFile(uint idx) const
- {
- return logicalFiles[idx];
- }
-
- const char* getFileLevelID() const
- {
- return fileLevelID;
- }
-
- static void deleteAssocFiles(const char* name);
- static void renameAssocFiles(const char* from, const char* to);
-
- int fastInitForCreate(const char* path);
- int initDiscoveredTable(const char* path);
-
- uint16* blobFields;
-
-private:
-
- void findConversionDefinition(enum_conversionDirection direction, uint16 fieldID);
- static void filenameToTablename(const char* in, char* out, size_t outlen);
- static size_t smartFilenameToTableName(const char *in, char* out, size_t outlen);
- void convertNativeToSQLName(const char* input,
- char* output)
- {
-
- output[0] = input[0];
-
- uint o = 1;
- uint i = 1;
- do
- {
- output[o++] = input[i];
- if (input[i] == '"' && input[i+1])
- output[o++] = '"';
- } while (input[++i]);
-
- output[o] = 0; // This isn't the most user-friendly way to handle overflows,
- // but at least its safe.
- }
-
- bool doFileIDsMatch(const char* path);
-
- ValidatedPointer<format_hdr_t> formatSpace;
- DB2Field* db2Fields;
- uint64 db2StartId; // Starting value for identity column
- uint16 blobFieldCount; // Count of LOB fields in the DB2 table
- uint* blobFieldActualSizes; // Array of LOB field lengths (actual vs. allocated).
- // This is updated as LOBs are read and will contain
- // the length of the longest known LOB in that field.
- iconv_t* conversionDefinitions[2];
-
- const TABLE_SHARE* mysqlTable;
- uint16 logicalFileCount;
- char* db2LibNameEbcdic; // Quoted and in EBCDIC
- char* db2LibNameAscii;
- char* db2TableNameEbcdic;
- char* db2TableNameAscii;
- char* db2TableNameSQLAscii;
- char* db2LibNameSQLAscii;
-
- db2i_file* physicalFile;
- db2i_file** logicalFiles;
-
- bool isTemporaryTable;
- char fileLevelID[13];
-};
-
-/**
- @class db2i_file
-
- @details This class describes a file object underlaying a particular SQL
- table. Both "physical files" (data) and "logical files" (indices) are
- described by this class. Only one instance of the class exists per DB2 file
- object. The single instance is responsible for de/allocating the multiple
- handles used by the handlers.
-*/
-class db2i_file
-{
-
-public:
- struct RowFormat
- {
- uint16 readRowLen;
- uint16 readRowNullOffset;
- uint16 writeRowLen;
- uint16 writeRowNullOffset;
- char inited;
- };
-
-public:
-
- // Construct an instance for a physical file.
- db2i_file(db2i_table* table);
-
- // Construct an instance for a logical file.
- db2i_file(db2i_table* table, int index);
-
- ~db2i_file()
- {
- if (masterDefn)
- db2i_ileBridge::getBridgeForThread()->deallocateFile(masterDefn);
-
- if (db2FileName != (char*)db2Table->getDB2TableName(db2i_table::EBCDIC_NATIVE))
- my_free(db2FileName);
- }
-
- // This is roughly equivalent to an "open". It tells ILE to allocate a descriptor
- // for the file. The associated handle is returned to the caller.
- int allocateNewInstance(FILE_HANDLE* newHandle, ILEMemHandle inuseSpace) const
- {
- int rc;
-
- rc = db2i_ileBridge::getBridgeForThread()->allocateFileInstance(masterDefn,
- inuseSpace,
- newHandle);
-
- if (rc) *newHandle = 0;
-
- return rc;
- }
-
- // This obtains the row layout associated with a particular access intent for
- // an open instance of the file.
- int obtainRowFormat(FILE_HANDLE instanceHandle,
- char intent,
- char commitLevel,
- const RowFormat** activeFormat) const
- {
- DBUG_ENTER("db2i_file::obtainRowFormat");
- RowFormat* rowFormat;
-
- if (intent == QMY_UPDATABLE)
- rowFormat = &(formats[readWrite]);
- else if (intent == QMY_READ_ONLY)
- rowFormat = &(formats[readOnly]);
-
- if (unlikely(!rowFormat->inited))
- {
- int rc = db2i_ileBridge::getBridgeForThread()->
- initFileForIO(instanceHandle,
- intent,
- commitLevel,
- &(rowFormat->writeRowLen),
- &(rowFormat->writeRowNullOffset),
- &(rowFormat->readRowLen),
- &(rowFormat->readRowNullOffset));
- if (rc) DBUG_RETURN(rc);
- rowFormat->inited = 1;
- }
-
- *activeFormat = rowFormat;
- DBUG_RETURN(0);
- }
-
- const char* getDB2FileName() const
- {
- return db2FileName;
- }
-
- void fillILEDefn(ShrDef* defn, bool readInArrivalSeq);
-
- void setMasterDefnHandle(FILE_HANDLE handle)
- {
- masterDefn = handle;
- }
-
- FILE_HANDLE getMasterDefnHandle() const
- {
- return masterDefn;
- }
-
-private:
- enum RowFormats
- {
- readOnly = 0,
- readWrite,
- maxRowFormats
- };
-
- mutable RowFormat formats[maxRowFormats];
-
- void commonCtorInit();
-
- char* db2FileName; // Quoted and in EBCDIC
-
- db2i_table* db2Table; // The logical SQL table contained by this file.
-
- bool db2CanSort;
-
- FILE_HANDLE masterDefn;
-};
-
-
-#endif
diff --git a/storage/ibmdb2i/db2i_global.h b/storage/ibmdb2i/db2i_global.h
deleted file mode 100644
index 1cf8a9a7c61..00000000000
--- a/storage/ibmdb2i/db2i_global.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#ifndef DB2I_GLOBAL_H
-#define DB2I_GLOBAL_H
-
-#define MYSQL_SERVER 1
-
-#include "my_global.h"
-#include "my_sys.h"
-
-const uint MAX_DB2_KEY_PARTS=120;
-const int MAX_DB2_V5R4_LIBNAME_LENGTH = 10;
-const int MAX_DB2_V6R1_LIBNAME_LENGTH = 30;
-const int MAX_DB2_SCHEMANAME_LENGTH=258;
-const int MAX_DB2_FILENAME_LENGTH=258;
-const int MAX_DB2_COLNAME_LENGTH=128;
-const int MAX_DB2_SAVEPOINTNAME_LENGTH=128;
-const int MAX_DB2_QUALIFIEDNAME_LENGTH=MAX_DB2_V6R1_LIBNAME_LENGTH + 1 + MAX_DB2_FILENAME_LENGTH;
-const uint32 MAX_CHAR_LENGTH = 32765;
-const uint32 MAX_VARCHAR_LENGTH = 32739;
-const uint32 MAX_DEC_PRECISION = 63;
-const uint32 MAX_BLOB_LENGTH = 2147483646;
-const uint32 MAX_BINARY_LENGTH = MAX_CHAR_LENGTH;
-const uint32 MAX_VARBINARY_LENGTH = MAX_VARCHAR_LENGTH;
-const uint32 MAX_FULL_ALLOCATE_BLOB_LENGTH = 65536;
-const uint32 MAX_FOREIGN_LEN = 64000;
-const char* DB2I_TEMP_TABLE_SCHEMA = "QTEMP";
-const char DB2I_ADDL_INDEX_NAME_DELIMITER[5] = {'_','_','_','_','_'};
-const char DB2I_DEFAULT_INDEX_NAME_DELIMITER[3] = {'_','_','_'};
-const int DB2I_INDEX_NAME_LENGTH_TO_PRESERVE = 110;
-
-enum enum_DB2I_INDEX_TYPE
-{
- typeNone = 0,
- typeDefault = 'D',
- typeHex = 'H',
- typeAscii = 'A'
-};
-
-void* roundToQuadWordBdy(void* ptr)
-{
- return (void*)(((uint64)(ptr)+0xf) & ~0xf);
-}
-
-typedef uint64_t ILEMemHandle;
-
-struct OSVersion
-{
- uint8 v;
- uint8 r;
-};
-extern OSVersion osVersion;
-
-
-/**
- Allocate 16-byte aligned space using the MySQL heap allocator
-
- @details Many of the spaces used by the QMY_* APIS are required to be
- aligned on 16 byte boundaries. The standard system malloc will do this
- alignment by default. However, in order to use the heap debug and tracking
- features of the mysql allocator, we chose to implement an aligning wrapper
- around my_malloc. Essentially, we overallocate the storage space, find the
- first aligned address in the space, store a pointer to the true malloc
- allocation in the bytes immediately preceding the aligned address, and return
- the aligned address to the caller.
-
- @parm size The size of heap storage needed
-
- @return A 16-byte aligned pointer to the storage requested.
-*/
-void* malloc_aligned(size_t size)
-{
- char* p;
- char* base;
- base = (char*)my_malloc(size + sizeof(void*) + 15, MYF(MY_WME));
- if (likely(base))
- {
- p = (char*)roundToQuadWordBdy(base + sizeof(void*));
- char** p2 = (char**)(p - sizeof(void*));
- *p2 = base;
- }
- else
- p = NULL;
-
- return p;
-}
-
-/**
- Free a 16-byte aligned space alloced by malloc_aligned
-
- @details We know that a pointer to the true malloced storage immediately
- precedes the aligned address, so we pull that out and call my_free().
-
- @parm p A 16-byte aligned pointer generated by malloc_aligned
-*/
-void free_aligned(void* p)
-{
- if (likely(p))
- {
- my_free(*(char**)((char*)p-sizeof(void*)));
- }
-}
-
-#endif
diff --git a/storage/ibmdb2i/db2i_iconv.h b/storage/ibmdb2i/db2i_iconv.h
deleted file mode 100644
index 9fc6e4ed636..00000000000
--- a/storage/ibmdb2i/db2i_iconv.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-/**
- @file
-
- @brief Used to redefine iconv symbols to the optimized "myconv" ones
-*/
-
-#ifndef DB2I_ICONV_H
-#define DB2I_ICONV_H
-
-#include "db2i_myconv.h"
-#define iconv_open(A, B) myconv_open(A, B, CONVERTER_DMAP)
-#define iconv_close myconv_close
-#define iconv myconv_dmap
-#define iconv_t myconv_t
-
-#endif
diff --git a/storage/ibmdb2i/db2i_ileBridge.cc b/storage/ibmdb2i/db2i_ileBridge.cc
deleted file mode 100644
index fac98dd7107..00000000000
--- a/storage/ibmdb2i/db2i_ileBridge.cc
+++ /dev/null
@@ -1,1342 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-
-#include "db2i_ileBridge.h"
-#include "my_dbug.h"
-#include "db2i_global.h"
-#include "db2i_charsetSupport.h"
-#include "db2i_errors.h"
-
-
-// static class member data
-ILEpointer* db2i_ileBridge::functionSymbols;
-db2i_ileBridge* db2i_ileBridge::globalBridge;
-#ifndef DBUG_OFF
-uint32 db2i_ileBridge::registeredPtrs;
-#endif
-
-pthread_key(IleParms*, THR_ILEPARMS);
-
-static void ileParmsDtor(void* parmsToFree)
-{
- if (parmsToFree)
- {
- free_aligned(parmsToFree);
- DBUG_PRINT("db2i_ileBridge", ("Freeing space for parms"));
- }
-}
-
-
-/**
- Convert a timestamp in ILE time format into a unix time_t
-*/
-static inline time_t convertILEtime(const ILE_time_t& input)
-{
- tm temp;
-
- temp.tm_sec = input.Second;
- temp.tm_min = input.Minute;
- temp.tm_hour = input.Hour;
- temp.tm_mday = input.Day;
- temp.tm_mon = input.Month-1;
- temp.tm_year = input.Year - 1900;
- temp.tm_isdst = -1;
-
- return mktime(&temp);
-}
-
-/**
- Allocate and intialize a new bridge structure
-*/
-db2i_ileBridge* db2i_ileBridge::createNewBridge(CONNECTION_HANDLE connID)
-{
- DBUG_PRINT("db2i_ileBridge::createNewBridge",("Building new bridge..."));
- db2i_ileBridge* newBridge = (db2i_ileBridge*)my_malloc(sizeof(db2i_ileBridge), MYF(MY_WME));
-
- if (unlikely(newBridge == NULL))
- return NULL;
-
- newBridge->stmtTxActive = false;
- newBridge->connErrText = NULL;
- newBridge->pendingLockedHandles.head = NULL;
- newBridge->cachedConnectionID = connID;
-
- return newBridge;
-}
-
-
-void db2i_ileBridge::destroyBridge(db2i_ileBridge* bridge)
-{
- bridge->freeErrorStorage();
- my_free(bridge);
-}
-
-
-void db2i_ileBridge::destroyBridgeForThread(const THD* thd)
-{
- void* thdData = *thd_ha_data(thd, ibmdb2i_hton);
- if (thdData != NULL)
- {
- destroyBridge((db2i_ileBridge*)thdData);
- }
-}
-
-
-void db2i_ileBridge::registerPtr(const void* ptr, ILEMemHandle* receiver)
-{
- static const arg_type_t ileSignature[] = { ARG_MEMPTR, ARG_END };
-
- if (unlikely(ptr == NULL))
- {
- *receiver = 0;
- return;
- }
-
- struct ArgList
- {
- ILEarglist_base base;
- ILEpointer ptr;
- } *arguments;
-
- char argBuf[sizeof(ArgList)+15];
- arguments = (ArgList*)roundToQuadWordBdy(argBuf);
-
- arguments->ptr.s.addr = (address64_t)(ptr);
-
- _ILECALL(&functionSymbols[funcRegisterSpace],
- &arguments->base,
- ileSignature,
- RESULT_INT64);
-
-#ifndef DBUG_OFF
- uint32 truncHandle = arguments->base.result.r_uint64;
- DBUG_PRINT("db2i_ileBridge::registerPtr",("Register 0x%p with handle %d", ptr, truncHandle));
- getBridgeForThread()->registeredPtrs++;
-#endif
-
- *receiver = arguments->base.result.r_uint64;
- return;
-}
-
-void db2i_ileBridge::unregisterPtr(ILEMemHandle handle)
-{
- static const arg_type_t ileSignature[] = { ARG_UINT64, ARG_END };
-
- if (unlikely(handle == NULL))
- return;
-
- struct ArgList
- {
- ILEarglist_base base;
- uint64 handle;
- } *arguments;
-
- char argBuf[sizeof(ArgList)+15];
- arguments = (ArgList*)roundToQuadWordBdy(argBuf);
-
- arguments->handle = (uint64)(handle);
-
- _ILECALL(&functionSymbols[funcUnregisterSpace],
- &arguments->base,
- ileSignature,
- RESULT_VOID);
-
-#ifndef DBUG_OFF
- DBUG_PRINT("db2i_ileBridge::unregisterPtr",("Unregister handle %d", (uint32)handle));
- getBridgeForThread()->registeredPtrs--;
-#endif
-}
-
-
-
-/**
- Initialize the bridge component
-
- @details Resolves srvpgm and function names of the APIs. If this fails,
- the approrpiate operating system support (PTFs) is probably not installed.
-
- WARNING:
- Must be called before any other functions in this class are used!!!!
- Can only be called by a single thread!
-*/
-int db2i_ileBridge::setup()
-{
- static const char funcNames[db2i_ileBridge::funcListEnd][32] =
- {
- {"QmyRegisterParameterSpaces"},
- {"QmyRegisterSpace"},
- {"QmyUnregisterSpace"},
- {"QmyProcessRequest"}
- };
-
- DBUG_ENTER("db2i_ileBridge::setup");
-
- int actmark = _ILELOAD("QSYS/QMYSE", ILELOAD_LIBOBJ);
- if ( actmark == -1 )
- {
- DBUG_PRINT("db2i_ileBridge::setup", ("srvpgm activation failed"));
- DBUG_RETURN(1);
- }
-
- functionSymbols = (ILEpointer*)malloc_aligned(sizeof(ILEpointer) * db2i_ileBridge::funcListEnd);
-
- for (int i = 0; i < db2i_ileBridge::funcListEnd; i++)
- {
- if (_ILESYM(&functionSymbols[i], actmark, funcNames[i]) == -1)
- {
- DBUG_PRINT("db2i_ileBridge::setup",
- ("resolve of %s failed", funcNames[i]));
- DBUG_RETURN(errno);
- }
- }
-
- pthread_key_create(&THR_ILEPARMS, &ileParmsDtor);
-
-#ifndef DBUG_OFF
- registeredPtrs = 0;
-#endif
-
- globalBridge = createNewBridge(0);
-
- DBUG_RETURN(0);
-}
-
-/**
- Cleanup any resources before shutting down plug-in
-*/
-void db2i_ileBridge::takedown()
-{
- if (globalBridge)
- destroyBridge(globalBridge);
- free_aligned(functionSymbols);
-}
-
-/**
- Call off to QmyProcessRequest to perform the API that the caller prepared
-*/
-inline int32 db2i_ileBridge::doIt()
-{
- static const arg_type_t ileSignature[] = {ARG_END};
-
- struct ArgList
- {
- ILEarglist_base base;
- } *arguments;
-
- char argBuf[sizeof(ArgList)+15];
- arguments = (ArgList*)roundToQuadWordBdy(argBuf);
-
- _ILECALL(&functionSymbols[funcProcessRequest],
- &arguments->base,
- ileSignature,
- RESULT_INT32);
-
- return translateErrorCode(arguments->base.result.s_int32.r_int32);
-}
-
-/**
- Call off to QmyProcessRequest to perform the API that the caller prepared and
- log any errors that may occur.
-*/
-inline int32 db2i_ileBridge::doItWithLog()
-{
- int32 rc = doIt();
-
- if (unlikely(rc))
- {
- // Only report errors that we weren't expecting
- if (rc != tacitErrors[0] &&
- rc != tacitErrors[1] &&
- rc != QMY_ERR_END_OF_BLOCK)
- reportSystemAPIError(rc, (Qmy_Error_output_t*)parms()->outParms);
- }
- memset(tacitErrors, 0, sizeof(tacitErrors));
-
- return rc;
-}
-
-
-/**
- Interface to QMY_ALLOCATE_SHARE API
-
- See QMY_ALLOCATE_SHARE documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::allocateFileDefn(ILEMemHandle definitionSpace,
- ILEMemHandle handleSpace,
- uint16 fileCount,
- const char* schemaName,
- uint16 schemaNameLength,
- ILEMemHandle formatSpace,
- uint32 formatSpaceLen)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
-
- IleParms* parmBlock = parms();
- Qmy_MAOS0100 *input = (Qmy_MAOS0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_ALLOCATE_SHARE;
- input->ShrDefSpcHnd = definitionSpace;
- input->ShrHndSpcHnd = handleSpace;
- input->ShrDefCnt = fileCount;
- input->FmtSpcHnd = formatSpace;
- input->FmtSpcLen = formatSpaceLen;
-
- if (schemaNameLength > sizeof(input->SchNam))
- {
- // This should never happen!
- DBUG_ASSERT(0);
- return HA_ERR_GENERIC;
- }
-
- memcpy(input->SchNam, schemaName, schemaNameLength);
- input->SchNamLen = schemaNameLength;
-
- input->CnnHnd = cachedConnectionID;
-
- int32 rc = doItWithLog();
-
- return rc;
-}
-
-
-/**
- Interface to QMY_ALLOCATE_INSTANCE API
-
- See QMY_ALLOCATE_INSTANCE documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::allocateFileInstance(FILE_HANDLE defnHandle,
- ILEMemHandle inuseSpace,
- FILE_HANDLE* instance)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
-
- IleParms* parmBlock = parms();
- Qmy_MAOI0100 *input = (Qmy_MAOI0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_ALLOCATE_INSTANCE;
- input->ShrHnd = defnHandle;
- input->CnnHnd = cachedConnectionID;
- input->UseSpcHnd = inuseSpace;
-
- int32 rc = doItWithLog();
-
- if (likely(rc == 0))
- {
- Qmy_MAOI0100_output* output = (Qmy_MAOI0100_output*)parmBlock->outParms;
- DBUG_ASSERT(instance);
- *instance = output->ObjHnd;
- }
-
- return rc;
-}
-
-
-/**
- Interface to QMY_DEALLOCATE_OBJECT API
-
- See QMY_DEALLOCATE_OBJECT documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::deallocateFile(FILE_HANDLE rfileHandle,
- bool postDropTable)
-{
- IleParms* parmBlock = parms();
- Qmy_MDLC0100 *input = (Qmy_MDLC0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_DEALLOCATE_OBJECT;
- input->ObjHnd = rfileHandle;
- input->ObjDrp[0] = (postDropTable ? QMY_YES : QMY_NO);
-
- DBUG_PRINT("db2i_ileBridge::deallocateFile", ("Deallocating %d", (uint32)rfileHandle));
-
- int32 rc = doItWithLog();
-
- return rc;
-}
-
-
-/**
- Interface to QMY_OBJECT_INITIALIZATION API
-
- See QMY_OBJECT_INITIALIZATION documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::initFileForIO(FILE_HANDLE rfileHandle,
- char accessIntent,
- char commitLevel,
- uint16* inRecSize,
- uint16* inRecNullOffset,
- uint16* outRecSize,
- uint16* outRecNullOffset)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MOIX0100 *input = (Qmy_MOIX0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_OBJECT_INITIALIZATION;
- input->CmtLvl[0] = commitLevel;
- input->Intent[0] = accessIntent;
- input->ObjHnd = rfileHandle;
- input->CnnHnd = cachedConnectionID;
-
- int32 rc = doItWithLog();
-
- if (likely(rc == 0))
- {
- Qmy_MOIX0100_output* output = (Qmy_MOIX0100_output*)parmBlock->outParms;
- *inRecSize = output->InNxtRowOff;
- *inRecNullOffset = output->InNullMapOff;
- *outRecSize = output->OutNxtRowOff;
- *outRecNullOffset = output->OutNullMapOff;
- }
-
- return rc;
-}
-
-
-/**
- Interface to QMY_READ_ROWS API for reading a row with a specific RRN.
-
- See QMY_READ_ROWS documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::readByRRN(FILE_HANDLE rfileHandle,
- ILEMemHandle buf,
- uint32 inRRN,
- char accessIntent,
- char commitLevel)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MRDX0100 *input = (Qmy_MRDX0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_READ_ROWS;
- input->CmtLvl[0] = commitLevel;
- input->ObjHnd = rfileHandle;
- input->Intent[0] = accessIntent;
- input->OutSpcHnd = (uint64)buf;
- input->RelRowNbr = inRRN;
- input->CnnHnd = cachedConnectionID;
-
- int32 rc = doItWithLog();
-
- if (rc == QMY_ERR_END_OF_BLOCK)
- {
- rc = 0;
- DBUG_PRINT("db2i_ileBridge::readByRRN", ("End of block signalled"));
- }
-
- return rc;
-}
-
-
-/**
- Interface to QMY_WRITE_ROWS API.
-
- See QMY_WRITE_ROWS documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::writeRows(FILE_HANDLE rfileHandle,
- ILEMemHandle buf,
- char commitLevel,
- int64* outIdVal,
- bool* outIdGen,
- uint32* dupKeyRRN,
- char** dupKeyName,
- uint32* dupKeyNameLen,
- uint32* outIdIncrement)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MWRT0100 *input = (Qmy_MWRT0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_WRITE_ROWS;
- input->CmtLvl[0] = commitLevel;
-
- input->ObjHnd = rfileHandle;
- input->InSpcHnd = (uint64_t) buf;
- input->CnnHnd = cachedConnectionID;
-
- int32 rc = doItWithLog();
-
- Qmy_MWRT0100_output_t* output = (Qmy_MWRT0100_output_t*)parmBlock->outParms;
- if (likely(rc == 0 || rc == HA_ERR_FOUND_DUPP_KEY))
- {
- DBUG_ASSERT(dupKeyRRN && dupKeyName && dupKeyNameLen && outIdGen && outIdIncrement && outIdVal);
- *dupKeyRRN = output->DupRRN;
- *dupKeyName = (char*)parmBlock->outParms + output->DupObjNamOff;
- *dupKeyNameLen = output->DupObjNamLen;
- *outIdGen = (output->NewIdGen[0] == QMY_YES ? TRUE : FALSE);
- if (*outIdGen == TRUE)
- {
- *outIdIncrement = output->IdIncrement;
- *outIdVal = output->NewIdVal;
- }
- }
-
- return rc;
-
-}
-
-/**
- Interface to QMY_EXECUTE_IMMEDIATE API.
-
- See QMY_EXECUTE_IMMEDIATE documentation for more information about
- parameters and return codes.
-*/
-uint32 db2i_ileBridge::execSQL(const char* statement,
- uint32 statementCount,
- uint8 commitLevel,
- bool autoCreateSchema,
- bool dropSchema,
- bool noCommit,
- FILE_HANDLE fileHandle)
-
-{
- IleParms* parmBlock = parms();
- Qmy_MSEI0100 *input = (Qmy_MSEI0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_EXECUTE_IMMEDIATE;
-
- registerPtr(statement, &input->StmtsSpcHnd);
-
- input->NbrStmts = statementCount;
- *(uint16*)(&input->StmtCCSID) = 850;
- input->AutoCrtSchema[0] = (autoCreateSchema == TRUE ? QMY_YES : QMY_NO);
- input->DropSchema[0] = (dropSchema == TRUE ? QMY_YES : QMY_NO);
- input->CmtLvl[0] = commitLevel;
- if ((commitLevel == QMY_NONE && statementCount == 1) || noCommit)
- {
- input->CmtBefore[0] = QMY_NO;
- input->CmtAfter[0] = QMY_NO;
- }
- else
- {
- input->CmtBefore[0] = QMY_YES;
- input->CmtAfter[0] = QMY_YES;
- }
- input->CnnHnd = current_thd->thread_id;
- input->ObjHnd = fileHandle;
-
- int32 rc = doItWithLog();
-
- unregisterPtr(input->StmtsSpcHnd);
-
- return rc;
-}
-
-/**
- Interface to QMY_PREPARE_OPEN_CURSOR API.
-
- See QMY_PREPARE_OPEN_CURSOR documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::prepOpen(const char* statement,
- FILE_HANDLE* rfileHandle,
- uint32* recLength)
-{
- IleParms* parmBlock = parms();
- Qmy_MSPO0100 *input = (Qmy_MSPO0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_PREPARE_OPEN_CURSOR;
-
- registerPtr(statement, &input->StmtsSpcHnd );
- *(uint16*)(&input->StmtCCSID) = 850;
- input->CnnHnd = current_thd->thread_id;
-
- int32 rc = doItWithLog();
-
- if (likely(rc == 0))
- {
- Qmy_MSPO0100_output* output = (Qmy_MSPO0100_output*)parmBlock->outParms;
- *rfileHandle = output->ObjHnd;
- *recLength = max(output->InNxtRowOff, output->OutNxtRowOff);
- }
-
-
- unregisterPtr(input->StmtsSpcHnd);
-
- return rc;
-}
-
-
-/**
- Interface to QMY_DELETE_ROW API.
-
- See QMY_DELETE_ROW documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::deleteRow(FILE_HANDLE rfileHandle,
- uint32 rrn)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MDLT0100 *input = (Qmy_MDLT0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_DELETE_ROW;
- input->ObjHnd = rfileHandle;
- input->RelRowNbr = rrn;
- input->CnnHnd = cachedConnectionID;
-
- int32 rc = doItWithLog();
-
- return rc;
-}
-
-
-/**
- Interface to QMY_UPDATE_ROW API.
-
- See QMY_UPDATE_ROW documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::updateRow(FILE_HANDLE rfileHandle,
- uint32 rrn,
- ILEMemHandle buf,
- uint32* dupKeyRRN,
- char** dupKeyName,
- uint32* dupKeyNameLen)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MUPD0100 *input = (Qmy_MUPD0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_UPDATE_ROW;
- input->ObjHnd = rfileHandle;
- input->InSpcHnd = (uint64)buf;
- input->RelRowNbr = rrn;
- input->CnnHnd = cachedConnectionID;
-
- int32 rc = doItWithLog();
-
- if (rc == HA_ERR_FOUND_DUPP_KEY)
- {
- Qmy_MUPD0100_output* output = (Qmy_MUPD0100_output*)parmBlock->outParms;
- DBUG_ASSERT(dupKeyRRN && dupKeyName && dupKeyNameLen);
- *dupKeyRRN = output->DupRRN;
- *dupKeyName = (char*)parmBlock->outParms + output->DupObjNamOff;
- *dupKeyNameLen = output->DupObjNamLen;
- }
-
- return rc;
-}
-
-/**
- Interface to QMY_DESCRIBE_RANGE API.
-
- See QMY_DESCRIBE_RANGE documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::recordsInRange(FILE_HANDLE defnHandle,
- ILEMemHandle inSpc,
- uint32 inKeyCnt,
- uint32 inLiteralCnt,
- uint32 inBoundsOff,
- uint32 inLitDefOff,
- uint32 inLiteralsOff,
- uint32 inCutoff,
- uint32 inSpcLen,
- uint16 inEndByte,
- uint64* outRecCnt,
- uint16* outRtnCode)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
-
- IleParms* parmBlock = parms();
- Qmy_MDRG0100 *input = (Qmy_MDRG0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_DESCRIBE_RANGE;
- input->ShrHnd = defnHandle;
- input->SpcHnd = (uint64)inSpc;
- input->KeyCnt = inKeyCnt;
- input->LiteralCnt = inLiteralCnt;
- input->BoundsOff = inBoundsOff;
- input->LitDefOff = inLitDefOff;
- input->LiteralsOff = inLiteralsOff;
- input->Cutoff = inCutoff;
- input->SpcLen = inSpcLen;
- input->EndByte = inEndByte;
- input->CnnHnd = cachedConnectionID;
-
- int rc = doItWithLog();
-
- if (likely(rc == 0))
- {
- Qmy_MDRG0100_output* output = (Qmy_MDRG0100_output*)parmBlock->outParms;
- DBUG_ASSERT(outRecCnt && outRtnCode);
- *outRecCnt = output->RecCnt;
- *outRtnCode = output->RtnCode;
- }
-
- return rc;
-}
-
-
-/**
- Interface to QMY_RELEASE_ROW API.
-
- See QMY_RELEASE_ROW documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::rrlslck(FILE_HANDLE rfileHandle, char accessIntent)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
-
- IleParms* parmBlock = parms();
- Qmy_MRRX0100 *input = (Qmy_MRRX0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_RELEASE_ROW;
-
- input->ObjHnd = rfileHandle;
- input->CnnHnd = cachedConnectionID;
- input->Intent[0] = accessIntent;
-
- int32 rc = doItWithLog();
-
- return rc;
-}
-
-/**
- Interface to QMY_LOCK_OBJECT API.
-
- See QMY_LOCK_OBJECT documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::lockObj(FILE_HANDLE defnHandle,
- uint64 lockVal,
- char lockAction,
- char lockType,
- char lockTimeout)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MOLX0100 *input = (Qmy_MOLX0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_LOCK_OBJECT;
- input->ShrHnd = defnHandle;
- input->LckTimeoutVal = lockVal;
- input->Action[0] = lockAction;
- input->LckTyp[0] = lockType;
- input->LckTimeout[0] = lockTimeout;
- input->CnnHnd = cachedConnectionID;
-
- int32 rc = doItWithLog();
-
- return rc;
-}
-
-/**
- Interface to QMY_DESCRIBE_CONSTRAINTS API.
-
- See QMY_DESCRIBE_CONSTRAINTS documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::constraints(FILE_HANDLE defnHandle,
- ILEMemHandle inSpc,
- uint32 inSpcLen,
- uint32* outLen,
- uint32* outCnt)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MDCT0100 *input = (Qmy_MDCT0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_DESCRIBE_CONSTRAINTS;
- input->ShrHnd = defnHandle;
- input->CstSpcHnd = (uint64)inSpc;
- input->CstSpcLen = inSpcLen;
- input->CnnHnd = cachedConnectionID;
-
- int32 rc = doItWithLog();
-
- if (likely(rc == 0))
- {
- Qmy_MDCT0100_output* output = (Qmy_MDCT0100_output*)parmBlock->outParms;
- DBUG_ASSERT(outLen && outCnt);
- *outLen = output->NeededLen;
- *outCnt = output->CstCnt;
- }
-
- return rc;
-}
-
-
-/**
- Interface to QMY_REORGANIZE_TABLE API.
-
- See QMY_REORGANIZE_TABLE documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::optimizeTable(FILE_HANDLE defnHandle)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MRGX0100 *input = (Qmy_MRGX0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_REORGANIZE_TABLE;
- input->ShrHnd = defnHandle;
- input->CnnHnd = cachedConnectionID;
-
- int32 rc = doItWithLog();
-
- return rc;
-}
-
-
-/**
- Interface to QMY_PROCESS_COMMITMENT_CONTROL API.
-
- See QMY_PROCESS_COMMITMENT_CONTROL documentation for more information about
- parameters and return codes.
-*/
-int32 db2i_ileBridge::commitmentControl(uint8 function)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MCCX0100 *input = (Qmy_MCCX0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_PROCESS_COMMITMENT_CONTROL;
- input->Function[0] = function;
- input->CnnHnd = cachedConnectionID;
-
- int32 rc = doItWithLog();
-
- return rc;
-}
-
-
-/**
- Interface to QMY_PROCESS_SAVEPOINT API.
-
- See QMY_PROCESS_SAVEPOINT documentation for more information about parameters and
- return codes.
-*/
-int32 db2i_ileBridge::savepoint(uint8 function,
- const char* savepointName)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- DBUG_PRINT("db2i_ileBridge::savepoint",("%d %s", (uint32)function, savepointName));
-
- IleParms* parmBlock = parms();
- Qmy_MSPX0100 *input = (Qmy_MSPX0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- char* savPtNam = (char*)(input+1);
-
- input->Format = QMY_PROCESS_SAVEPOINT;
-
- if (strlen(savepointName) > MAX_DB2_SAVEPOINTNAME_LENGTH)
- {
- DBUG_ASSERT(0);
- return HA_ERR_GENERIC;
- }
- strcpy(savPtNam, savepointName);
-
- input->Function[0] = function;
- input->SavPtNamOff = savPtNam - (char*)(input);
- input->SavPtNamLen = strlen(savepointName);
- input->CnnHnd = cachedConnectionID;
-
- int32 rc = doItWithLog();
-
- return rc;
-}
-
-static ILEMemHandle traceSpcHandle;
-/**
- Do initialization for the QMY_* APIs.
-
- @parm aspName The name of the relational database to use for all
- connections.
-
- @return 0 if successful; error otherwise
-*/
-int32 db2i_ileBridge::initILE(const char* aspName,
- uint16* traceCtlPtr)
-{
- // We forego the typical thread-based parms space because MySQL doesn't
- // allow us to clean it up before checking for memory leaks. As a result
- // we get a complaint about leaked memory on server shutdown.
- int32 rc;
- char inParms[db2i_ileBridge_MAX_INPARM_SIZE];
- char outParms[db2i_ileBridge_MAX_OUTPARM_SIZE];
- if (rc = registerParmSpace(inParms, outParms))
- {
- reportSystemAPIError(rc, NULL);
- return rc;
- }
-
- registerPtr(traceCtlPtr, &traceSpcHandle);
-
- struct ParmBlock
- {
- Qmy_MINI0100 parms;
- } *parmBlock = (ParmBlock*)inParms;
-
- memset(inParms, 0, sizeof(ParmBlock));
-
- parmBlock->parms.Format = QMY_INITIALIZATION;
-
- char paddedName[18];
- if (strlen(aspName) > sizeof(paddedName))
- {
- getErrTxt(DB2I_ERR_BAD_RDB_NAME);
- return DB2I_ERR_BAD_RDB_NAME;
- }
-
- memset(paddedName, ' ', sizeof(paddedName));
- memcpy(paddedName, aspName, strlen(aspName));
- convToEbcdic(paddedName, parmBlock->parms.RDBName, strlen(paddedName));
-
- parmBlock->parms.RDBNamLen = strlen(paddedName);
- parmBlock->parms.TrcSpcHnd = traceSpcHandle;
-
- rc = doIt();
-
- if (rc)
- {
- reportSystemAPIError(rc, (Qmy_Error_output_t*)outParms);
- }
-
- return rc;
-}
-
-/**
- Signal to the QMY_ APIs to perform any cleanup they need to do.
-*/
-int32 db2i_ileBridge::exitILE()
-{
- IleParms* parmBlock = parms();
- Qmy_MCLN0100 *input = (Qmy_MCLN0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_CLEANUP;
-
- int32 rc = doIt();
-
- if (rc)
- {
- reportSystemAPIError(rc, (Qmy_Error_output_t*)parmBlock->outParms);
- }
-
- unregisterPtr(traceSpcHandle);
-
- DBUG_PRINT("db2i_ileBridge::exitILE", ("Registered ptrs remaining: %d", registeredPtrs));
-#ifndef DBUG_OFF
- if (registeredPtrs != 0)
- printf("Oh no! IBMDB2I left some pointers registered. Count was %d.\n", registeredPtrs);
-#endif
-
- // This is needed to prevent SAFE_MALLOC from complaining at process termination.
- my_pthread_setspecific_ptr(THR_ILEPARMS, NULL);
- free_aligned(parmBlock);
-
- return rc;
-
-}
-
-
-/**
- Designate the specified addresses as parameter passing buffers.
-
- @parm in Input to the API will go here; format is defined by the individual API
- @parm out Output from the API will be; format is defined by the individual API
-
- @return 0 if success; error otherwise
-*/
-int db2i_ileBridge::registerParmSpace(char* in, char* out)
-{
- static const arg_type_t ileSignature[] = { ARG_MEMPTR, ARG_MEMPTR, ARG_END };
-
- struct ArgList
- {
- ILEarglist_base base;
- ILEpointer input;
- ILEpointer output;
- } *arguments;
-
- char argBuf[sizeof(ArgList)+15];
- arguments = (ArgList*)roundToQuadWordBdy(argBuf);
-
- arguments->input.s.addr = (address64_t)(in);
- arguments->output.s.addr = (address64_t)(out);
-
- _ILECALL(&functionSymbols[funcRegisterParameterSpaces],
- &arguments->base,
- ileSignature,
- RESULT_INT32);
-
- return arguments->base.result.s_int32.r_int32;
-}
-
-
-/**
- Interface to QMY_OBJECT_OVERRIDE API.
-
- See QMY_OBJECT_OVERRIDE documentation for more information about parameters and
- return codes.
-*/
-int32 db2i_ileBridge::objectOverride(FILE_HANDLE rfileHandle,
- ILEMemHandle buf,
- uint32 recordWidth)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MOOX0100 *input = (Qmy_MOOX0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_OBJECT_OVERRIDE;
- input->ObjHnd = rfileHandle;
- input->OutSpcHnd = (uint64)buf;
- input->NxtRowOff = recordWidth;
- input->CnnHnd = cachedConnectionID;
-
- int32 rc = doItWithLog();
-
- return rc;
-}
-
-/**
- Interface to QMY_DESCRIBE_OBJECT API for obtaining table stats.
-
- See QMY_DESCRIBE_OBJECT documentation for more information about parameters and
- return codes.
-*/
-int32 db2i_ileBridge::retrieveTableInfo(FILE_HANDLE defnHandle,
- uint16 dataRequested,
- ha_statistics& stats,
- ILEMemHandle inSpc)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MDSO0100 *input = (Qmy_MDSO0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_DESCRIBE_OBJECT;
- input->ShrHnd = defnHandle;
- input->CnnHnd = cachedConnectionID;
-
- if (dataRequested & objLength)
- input->RtnObjLen[0] = QMY_YES;
- if (dataRequested & rowCount)
- input->RtnRowCnt[0] = QMY_YES;
- if (dataRequested & deletedRowCount)
- input->RtnDltRowCnt[0] = QMY_YES;
- if (dataRequested & rowsPerKey)
- {
- input->RowKeyHnd = (uint64)inSpc;
- input->RtnRowKey[0] = QMY_YES;
- }
- if (dataRequested & meanRowLen)
- input->RtnMeanRowLen[0] = QMY_YES;
- if (dataRequested & lastModTime)
- input->RtnModTim[0] = QMY_YES;
- if (dataRequested & createTime)
- input->RtnCrtTim[0] = QMY_YES;
- if (dataRequested & ioCount)
- input->RtnEstIoCnt[0] = QMY_YES;
-
- int32 rc = doItWithLog();
-
- if (likely(rc == 0))
- {
- Qmy_MDSO0100_output* output = (Qmy_MDSO0100_output*)parmBlock->outParms;
- if (dataRequested & objLength)
- stats.data_file_length = output->ObjLen;
- if (dataRequested & rowCount)
- stats.records= output->RowCnt;
- if (dataRequested & deletedRowCount)
- stats.deleted = output->DltRowCnt;
- if (dataRequested & meanRowLen)
- stats.mean_rec_length = output->MeanRowLen;
- if (dataRequested & lastModTime)
- stats.update_time = convertILEtime(output->ModTim);
- if (dataRequested & createTime)
- stats.create_time = convertILEtime(output->CrtTim);
- if (dataRequested & ioCount)
- stats.data_file_length = output->EstIoCnt;
- }
-
- return rc;
-}
-
-/**
- Interface to QMY_DESCRIBE_OBJECT API for finding index size.
-
- See QMY_DESCRIBE_OBJECT documentation for more information about parameters and
- return codes.
-*/
-int32 db2i_ileBridge::retrieveIndexInfo(FILE_HANDLE defnHandle,
- uint64* outPageCnt)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MDSO0100 *input = (Qmy_MDSO0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_DESCRIBE_OBJECT;
- input->ShrHnd = defnHandle;
- input->CnnHnd = cachedConnectionID;
- input->RtnPageCnt[0] = QMY_YES;
-
- int32 rc = doItWithLog();
-
- if (likely(rc == 0))
- {
- Qmy_MDSO0100_output* output = (Qmy_MDSO0100_output*)parmBlock->outParms;
- *outPageCnt = output->PageCnt;
- }
-
- return rc;
-}
-
-
-/**
- Interface to QMY_CLOSE_CONNECTION API
-
- See QMY_CLOSE_CONNECTION documentation for more information about parameters and
- return codes.
-*/
-int32 db2i_ileBridge::closeConnection(CONNECTION_HANDLE conn)
-{
- IleParms* parmBlock = parms();
- Qmy_MCCN0100 *input = (Qmy_MCCN0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_CLOSE_CONNECTION;
- input->CnnHnd = conn;
-
- int32 rc = doItWithLog();
-
- return rc;
-}
-
-
-/**
- Interface to QMY_INTERRUPT API
-
- See QMY_INTERRUPT documentation for more information about parameters and
- return codes.
-*/
-int32 db2i_ileBridge::readInterrupt(FILE_HANDLE fileHandle)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MINT0100 *input = (Qmy_MINT0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_INTERRUPT;
- input->CnnHnd = cachedConnectionID;
- input->ObjHnd = fileHandle;
-
- int32 rc = doItWithLog();
-
- if (rc == QMY_ERR_END_OF_BLOCK)
- {
- rc = 0;
- DBUG_PRINT("db2i_ileBridge::readInterrupt", ("End of block signalled"));
- }
-
- return rc;
-}
-
-/**
- Interface to QMY_READ_ROWS API
-
- See QMY_READ_ROWS documentation for more information about parameters and
- return codes.
-*/
-int32 db2i_ileBridge::read(FILE_HANDLE rfileHandle,
- ILEMemHandle buf,
- char accessIntent,
- char commitLevel,
- char orientation,
- bool asyncRead,
- ILEMemHandle rrn,
- ILEMemHandle key,
- uint32 keylen,
- uint16 keyParts,
- int pipeFD)
-{
- DBUG_ASSERT(cachedStateIsCoherent());
- IleParms* parmBlock = parms();
- Qmy_MRDX0100 *input = (Qmy_MRDX0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_READ_ROWS;
- input->CmtLvl[0] = commitLevel;
-
- input->ObjHnd = rfileHandle;
- input->Intent[0] = accessIntent;
- input->OutSpcHnd = (uint64)buf;
- input->OutRRNSpcHnd = (uint64)rrn;
- input->RtnData[0] = QMY_RETURN_DATA;
-
- if (key)
- {
- input->KeySpcHnd = (uint64)key;
- input->KeyColsLen = keylen;
- input->KeyColsNbr = keyParts;
- }
-
- input->Async[0] = (asyncRead ? QMY_YES : QMY_NO);
- input->PipeDesc = pipeFD;
- input->Orientation[0] = orientation;
- input->CnnHnd = cachedConnectionID;
-
- int32 rc = doItWithLog();
-
- // QMY_ERR_END_OF_BLOCK is informational only, so we ignore it.
- if (rc == QMY_ERR_END_OF_BLOCK)
- {
- rc = 0;
- DBUG_PRINT("db2i_ileBridge::read", ("End of block signalled"));
- }
-
- return rc;
-}
-
-
-/**
- Interface to QMY_QUIESCE_OBJECT API
-
- See QMY_QUIESCE_OBJECT documentation for more information about parameters and
- return codes.
-*/
-int32 db2i_ileBridge::quiesceFileInstance(FILE_HANDLE rfileHandle)
-{
- IleParms* parmBlock = parms();
- Qmy_MQSC0100 *input = (Qmy_MQSC0100*)&(parmBlock->inParms);
- memset(input, 0, sizeof(*input));
-
- input->Format = QMY_QUIESCE_OBJECT;
- input->ObjHnd = rfileHandle;
-
- int32 rc = doItWithLog();
-
-#ifndef DBUG_OFF
- if (unlikely(rc))
- {
- DBUG_ASSERT(0);
- }
-#endif
-
- return rc;
-}
-
-void db2i_ileBridge::PreservedHandleList::add(const char* newname, FILE_HANDLE newhandle, IBMDB2I_SHARE* share)
-{
- NameHandlePair *newPair = (NameHandlePair*)my_malloc(sizeof(NameHandlePair), MYF(MY_WME));
-
- newPair->next = head;
- head = newPair;
-
- strcpy(newPair->name, newname);
- newPair->handle = newhandle;
- newPair->share = share;
- DBUG_PRINT("db2i_ileBridge", ("Added handle %d for %s", uint32(newhandle), newname));
-}
-
-
-FILE_HANDLE db2i_ileBridge::PreservedHandleList::findAndRemove(const char* fileName, IBMDB2I_SHARE** share)
-{
- NameHandlePair* current = head;
- NameHandlePair* prev = NULL;
-
- while (current)
- {
- NameHandlePair* next = current->next;
- if (strcmp(fileName, current->name) == 0)
- {
- FILE_HANDLE tmp = current->handle;
- *share = current->share;
- if (prev)
- prev->next = next;
- if (current == head)
- head = next;
- my_free(current);
- DBUG_PRINT("db2i_ileBridge", ("Found handle %d for %s", uint32(tmp), fileName));
- return tmp;
- }
- prev = current;
- current = next;
- }
-
- return 0;
-}
-
-
-IleParms* db2i_ileBridge::initParmsForThread()
-{
-
- IleParms* p = (IleParms*)malloc_aligned(sizeof(IleParms));
- DBUG_ASSERT((uint64)(&(p->outParms))% 16 == 0); // Guarantee that outParms are aligned correctly
-
- if (likely(p))
- {
- int32 rc = registerParmSpace((p->inParms), (p->outParms));
- if (likely(rc == 0))
- {
- my_pthread_setspecific_ptr(THR_ILEPARMS, p);
- DBUG_PRINT("db2i_ileBridge", ("Inited space for parms"));
- return p;
- }
- else
- reportSystemAPIError(rc, NULL);
- }
-
- return NULL;
-}
-
diff --git a/storage/ibmdb2i/db2i_ileBridge.h b/storage/ibmdb2i/db2i_ileBridge.h
deleted file mode 100644
index 3a3ca141f69..00000000000
--- a/storage/ibmdb2i/db2i_ileBridge.h
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#ifndef DB2I_ILEBRIDGE_H
-#define DB2I_ILEBRIDGE_H
-
-#include "db2i_global.h"
-#include "mysql_priv.h"
-#include "as400_types.h"
-#include "as400_protos.h"
-#include "qmyse.h"
-#include "db2i_errors.h"
-
-typedef uint64_t FILE_HANDLE;
-typedef my_thread_id CONNECTION_HANDLE;
-const char SAVEPOINT_NAME[] = {0xD4,0xE2,0xD7,0xC9,0xD5,0xE3,0xC5,0xD9,0xD5,0x0};
-const uint32 TACIT_ERRORS_SIZE=2;
-
-enum db2i_InfoRequestSpec
-{
- objLength = 1,
- rowCount = 2,
- deletedRowCount = 4,
- rowsPerKey = 8,
- meanRowLen = 16,
- lastModTime = 32,
- createTime = 64,
- ioCount = 128
-};
-
-extern handlerton *ibmdb2i_hton;
-struct IBMDB2I_SHARE;
-
-const uint32 db2i_ileBridge_MAX_INPARM_SIZE = 512;
-const uint32 db2i_ileBridge_MAX_OUTPARM_SIZE = 512;
-
-extern pthread_key(IleParms*, THR_ILEPARMS);
-struct IleParms
-{
- char inParms[db2i_ileBridge_MAX_INPARM_SIZE];
- char outParms[db2i_ileBridge_MAX_OUTPARM_SIZE];
-};
-
-/**
- @class db2i_ileBridge
-
- Implements a connection-based interface to the QMY_* APIs
-
- @details Each client connection that touches an IBMDB2I table has a "bridge"
- associated with it. This bridge is constructed on first use and provides a
- more C-like interface to the APIs. As well, it is reponsible for tracking
- connection scoped information such as statement transaction state and error
- message text. The bridge is destroyed when the connection ends.
-*/
-class db2i_ileBridge
-{
- enum ileFuncs
- {
- funcRegisterParameterSpaces,
- funcRegisterSpace,
- funcUnregisterSpace,
- funcProcessRequest,
- funcListEnd
- };
-
- static db2i_ileBridge* globalBridge;
-public:
-
-
- static int setup();
- static void takedown();
-
- /**
- Obtain a pointer to the bridge for the current connection.
-
- If a MySQL client connection is on the stack, we get the associated brideg.
- Otherwise, we use the globalBridge.
- */
- static db2i_ileBridge* getBridgeForThread()
- {
- THD* thd = current_thd;
- if (likely(thd))
- return getBridgeForThread(thd);
-
- return globalBridge;
- }
-
- /**
- Obtain a pointer to the bridge for the specified connection.
-
- If a bridge exists already, we return it immediately. Otherwise, prepare
- a new bridge for the connection.
- */
- static db2i_ileBridge* getBridgeForThread(const THD* thd)
- {
- void* thdData = *thd_ha_data(thd, ibmdb2i_hton);
- if (likely(thdData != NULL))
- return (db2i_ileBridge*)(thdData);
-
- db2i_ileBridge* newBridge = createNewBridge(thd->thread_id);
- *thd_ha_data(thd, ibmdb2i_hton) = (void*)newBridge;
- return newBridge;
- }
-
- static void destroyBridgeForThread(const THD* thd);
- static void registerPtr(const void* ptr, ILEMemHandle* receiver);
- static void unregisterPtr(ILEMemHandle handle);
- int32 allocateFileDefn(ILEMemHandle definitionSpace,
- ILEMemHandle handleSpace,
- uint16 fileCount,
- const char* schemaName,
- uint16 schemaNameLength,
- ILEMemHandle formatSpace,
- uint32 formatSpaceLen);
- int32 allocateFileInstance(FILE_HANDLE defnHandle,
- ILEMemHandle inuseSpace,
- FILE_HANDLE* instance);
- int32 deallocateFile(FILE_HANDLE fileHandle,
- bool postDropTable=FALSE);
- int32 read(FILE_HANDLE rfileHandle,
- ILEMemHandle buf,
- char accessIntent,
- char commitLevel,
- char orientation,
- bool asyncRead = FALSE,
- ILEMemHandle rrn = 0,
- ILEMemHandle key = 0,
- uint32 keylen = 0,
- uint16 keyParts = 0,
- int pipeFD = -1);
- int32 readByRRN(FILE_HANDLE rfileHandle,
- ILEMemHandle buf,
- uint32 inRRN,
- char accessIntent,
- char commitLevel);
- int32 writeRows(FILE_HANDLE rfileHandle,
- ILEMemHandle buf,
- char commitLevel,
- int64* outIdVal,
- bool* outIdGen,
- uint32* dupKeyRRN,
- char** dupKeyName,
- uint32* dupKeyNameLen,
- uint32* outIdIncrement);
- uint32 execSQL(const char* statement,
- uint32 statementCount,
- uint8 commitLevel,
- bool autoCreateSchema = FALSE,
- bool dropSchema = FALSE,
- bool noCommit = FALSE,
- FILE_HANDLE fileHandle = 0);
- int32 prepOpen(const char* statement,
- FILE_HANDLE* rfileHandle,
- uint32* recLength);
- int32 deleteRow(FILE_HANDLE rfileHandle,
- uint32 rrn);
- int32 updateRow(FILE_HANDLE rfileHandle,
- uint32 rrn,
- ILEMemHandle buf,
- uint32* dupKeyRRN,
- char** dupKeyName,
- uint32* dupKeyNameLen);
- int32 commitmentControl(uint8 function);
- int32 savepoint(uint8 function,
- const char* savepointName);
- int32 recordsInRange(FILE_HANDLE rfileHandle,
- ILEMemHandle inSpc,
- uint32 inKeyCnt,
- uint32 inLiteralCnt,
- uint32 inBoundsOff,
- uint32 inLitDefOff,
- uint32 inLiteralsOff,
- uint32 inCutoff,
- uint32 inSpcLen,
- uint16 inEndByte,
- uint64* outRecCnt,
- uint16* outRtnCode);
- int32 rrlslck(FILE_HANDLE rfileHandle,
- char accessIntent);
- int32 lockObj(FILE_HANDLE rfileHandle,
- uint64 inTimeoutVal,
- char inAction,
- char inLockType,
- char inTimeout);
- int32 constraints(FILE_HANDLE rfileHandle,
- ILEMemHandle inSpc,
- uint32 inSpcLen,
- uint32* outLen,
- uint32* outCnt);
- int32 optimizeTable(FILE_HANDLE rfileHandle);
- static int32 initILE(const char* aspName,
- uint16* traceCtlPtr);
- int32 initFileForIO(FILE_HANDLE rfileHandle,
- char accessIntent,
- char commitLevel,
- uint16* inRecSize,
- uint16* inRecNullOffset,
- uint16* outRecSize,
- uint16* outRecNullOffset);
- int32 readInterrupt(FILE_HANDLE fileHandle);
- static int32 exitILE();
-
- int32 objectOverride(FILE_HANDLE rfileHandle,
- ILEMemHandle buf,
- uint32 recordWidth = 0);
-
- int32 retrieveTableInfo(FILE_HANDLE rfileHandle,
- uint16 dataRequested,
- ha_statistics& stats,
- ILEMemHandle inSpc = NULL);
-
- int32 retrieveIndexInfo(FILE_HANDLE rfileHandle,
- uint64* outPageCnt);
-
- int32 closeConnection(CONNECTION_HANDLE conn);
- int32 quiesceFileInstance(FILE_HANDLE rfileHandle);
-
- /**
- Mark the beginning of a "statement transaction"
-
- @detail MySQL "statement transactions" (see sql/handler.cc) are implemented
- as DB2 savepoints having a predefined name.
-
- @return 0 if successful; error otherwise
- */
- uint32 beginStmtTx()
- {
- DBUG_ENTER("db2i_ileBridge::beginStmtTx");
- if (stmtTxActive)
- DBUG_RETURN(0);
-
- stmtTxActive = true;
-
- DBUG_RETURN(savepoint(QMY_SET_SAVEPOINT, SAVEPOINT_NAME));
- }
-
- /**
- Commit a "statement transaction"
-
- @return 0 if successful; error otherwise
- */
- uint32 commitStmtTx()
- {
- DBUG_ENTER("db2i_ileBridge::commitStmtTx");
- DBUG_ASSERT(stmtTxActive);
- stmtTxActive = false;
- DBUG_RETURN(savepoint(QMY_RELEASE_SAVEPOINT, SAVEPOINT_NAME));
- }
-
- /**
- Roll back a "statement transaction"
-
- @return 0 if successful; error otherwise
- */
- uint32 rollbackStmtTx()
- {
- DBUG_ENTER("db2i_ileBridge::rollbackStmtTx");
- DBUG_ASSERT(stmtTxActive);
- stmtTxActive = false;
- DBUG_RETURN(savepoint(QMY_ROLLBACK_SAVEPOINT, SAVEPOINT_NAME));
- }
-
-
- /**
- Provide storage for generating error messages.
-
- This storage must persist until the error message is retrieved from the
- handler instance. It is for this reason that we associate it with the bridge.
-
- @return Pointer to heap storage of MYSQL_ERRMSG_SIZE bytes
- */
- char* getErrorStorage()
- {
- if (!connErrText)
- {
- connErrText = (char*)my_malloc(MYSQL_ERRMSG_SIZE, MYF(MY_WME));
- if (connErrText) connErrText[0] = 0;
- }
-
- return connErrText;
- }
-
- /**
- Free storage for generating error messages.
- */
- void freeErrorStorage()
- {
- if (likely(connErrText))
- {
- my_free(connErrText);
- connErrText = NULL;
- }
- }
-
-
- /**
- Store a file handle for later retrieval.
-
- If deallocateFile encounters a lock when trying to perform its operation,
- the file remains allocated but must be deallocated later. This function
- provides a way for the connection to "remember" that this deallocation is
- still needed.
-
- @param newname The name of the file to be added
- @param newhandle The handle associated with newname
-
- */
- void preserveHandle(const char* newname, FILE_HANDLE newhandle, IBMDB2I_SHARE* share)
- {
- pendingLockedHandles.add(newname, newhandle, share);
- }
-
- /**
- Retrieve a file handle stored by preserveHandle().
-
- @param name The name of the file to be retrieved.
-
- @return The handle associated with name
- */
- FILE_HANDLE findAndRemovePreservedHandle(const char* name, IBMDB2I_SHARE** share)
- {
- FILE_HANDLE hdl = pendingLockedHandles.findAndRemove(name, share);
- return hdl;
- }
-
- /**
- Indicate which error messages should be suppressed on the next API call
-
- These functions are useful for ensuring that the provided error numbers
- are returned if a failure occurs but do not cause a spurious error message
- to be returned.
-
- @return A pointer to this instance
- */
- db2i_ileBridge* expectErrors(int32 er1)
- {
- tacitErrors[0]=er1;
- return this;
- }
-
- db2i_ileBridge* expectErrors(int32 er1, int32 er2)
- {
- tacitErrors[0]=er1;
- tacitErrors[1]=er2;
- return this;
- }
-
- /**
- Obtain the IBM i system message that accompanied the last API failure.
-
- @return A pointer to the 7 character message ID.
- */
- static const char* getErrorMsgID()
- {
- return ((Qmy_Error_output_t*)parms()->outParms)->MsgId;
- }
-
- /**
- Convert an API error code into the equivalent MySQL error code (if any)
-
- @param rc The QMYSE API error code
-
- @return If an equivalent exists, the MySQL error code; else rc
- */
- static int32 translateErrorCode(int32 rc)
- {
- if (likely(rc == 0))
- return 0;
-
- switch (rc)
- {
- case QMY_ERR_KEY_NOT_FOUND:
- return HA_ERR_KEY_NOT_FOUND;
- case QMY_ERR_DUP_KEY:
- return HA_ERR_FOUND_DUPP_KEY;
- case QMY_ERR_END_OF_FILE:
- return HA_ERR_END_OF_FILE;
- case QMY_ERR_LOCK_TIMEOUT:
- return HA_ERR_LOCK_WAIT_TIMEOUT;
- case QMY_ERR_CST_VIOLATION:
- return HA_ERR_NO_REFERENCED_ROW;
- case QMY_ERR_TABLE_NOT_FOUND:
- return HA_ERR_NO_SUCH_TABLE;
- case QMY_ERR_NON_UNIQUE_KEY:
- return ER_DUP_ENTRY;
- case QMY_ERR_MSGID:
- {
- if (memcmp(getErrorMsgID(), DB2I_CPF503A, 7) == 0)
- return HA_ERR_ROW_IS_REFERENCED;
- if (memcmp(getErrorMsgID(), DB2I_SQL0538, 7) == 0)
- return HA_ERR_CANNOT_ADD_FOREIGN;
- }
- }
- return rc;
- }
-
-private:
-
- static db2i_ileBridge* createNewBridge(CONNECTION_HANDLE connID);
- static void destroyBridge(db2i_ileBridge* bridge);
- static int registerParmSpace(char* in, char* out);
- static int32 doIt();
- int32 doItWithLog();
-
- static _ILEpointer *functionSymbols; ///< Array of ILE function pointers
- CONNECTION_HANDLE cachedConnectionID; ///< The associated connection
- bool stmtTxActive; ///< Inside statement transaction
- char *connErrText; ///< Storage for error message
- int32 tacitErrors[TACIT_ERRORS_SIZE]; ///< List of errors to be suppressed
-
- static IleParms* initParmsForThread();
-
- /**
- Get space for passing parameters to the QMY_* APIs
-
- @details A fixed-length parameter passing space is associated with each
- pthread. This space is allocated and registered by initParmsForThread()
- the first time a pthread works with a bridge. The space is cached away
- and remains available until the pthread ends. It became necessary to
- disassociate the parameter space from the bridge in order to support
- future enhancements to MySQL that sever the one-to-one relationship between
- pthreads and user connections. The QMY_* APIs scope a registered parameter
- space to the thread that executes the register operation.
- */
- static IleParms* parms()
- {
- IleParms* p = my_pthread_getspecific_ptr(IleParms*, THR_ILEPARMS);
- if (likely(p))
- return p;
-
- return initParmsForThread();
- }
-
- class PreservedHandleList
- {
- friend db2i_ileBridge* db2i_ileBridge::createNewBridge(CONNECTION_HANDLE);
- public:
- void add(const char* newname, FILE_HANDLE newhandle, IBMDB2I_SHARE* share);
- FILE_HANDLE findAndRemove(const char* fileName, IBMDB2I_SHARE** share);
-
- private:
- struct NameHandlePair
- {
- char name[FN_REFLEN];
- FILE_HANDLE handle;
- IBMDB2I_SHARE* share;
- NameHandlePair* next;
- }* head;
- } pendingLockedHandles;
-
-
-#ifndef DBUG_OFF
- bool cachedStateIsCoherent()
- {
- return (current_thd->thread_id == cachedConnectionID);
- }
-
- friend void db2i_ileBridge::unregisterPtr(ILEMemHandle);
- friend void db2i_ileBridge::registerPtr(const void*, ILEMemHandle*);
- static uint32 registeredPtrs;
-#endif
-};
-
-
-
-#endif
diff --git a/storage/ibmdb2i/db2i_ioBuffers.cc b/storage/ibmdb2i/db2i_ioBuffers.cc
deleted file mode 100644
index 9525a6e34b5..00000000000
--- a/storage/ibmdb2i/db2i_ioBuffers.cc
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#include "db2i_ioBuffers.h"
-
-/**
- Request another block of rows
-
- Request the next set of rows from DB2. This must only be called after
- newReadRequest().
-
- @param orientation The direction to use when reading through the table.
-*/
-void IOAsyncReadBuffer::loadNewRows(char orientation)
-{
- rewind();
- maxRows() = rowsToBlock;
-
- DBUG_PRINT("db2i_ioBuffers::loadNewRows", ("Requesting %d rows, async = %d", rowsToBlock, readIsAsync));
-
- rc = getBridge()->expectErrors(QMY_ERR_END_OF_BLOCK, QMY_ERR_LOB_SPACE_TOO_SMALL)
- ->read(file,
- ptr(),
- accessIntent,
- commitLevel,
- orientation,
- readIsAsync,
- rrnList,
- 0,
- 0,
- 0);
-
- DBUG_PRINT("db2i_ioBuffers::loadNewRows", ("recordsRead: %d, rc: %d", (uint32)rowCount(), rc));
-
-
- *releaseRowNeeded = true;
-
- if (rc == QMY_ERR_END_OF_BLOCK)
- {
- // This is really just an informational error, so we ignore it.
- rc = 0;
- DBUG_PRINT("db2i_ioBuffers::loadNewRows", ("End of block signalled"));
- }
- else if (rc == QMY_ERR_END_OF_FILE)
- {
- // If we reach EOF or end-of-key, DB2 guarantees that no rows will be locked.
- rc = HA_ERR_END_OF_FILE;
- *releaseRowNeeded = false;
- }
- else if (rc == QMY_ERR_KEY_NOT_FOUND)
- {
- rc = HA_ERR_KEY_NOT_FOUND;
- *releaseRowNeeded = false;
- }
-
- if (rc) closePipe();
-}
-
-
-/**
- Empty the message pipe to prepare for another read.
-*/
-void IOAsyncReadBuffer::drainPipe()
-{
- DBUG_ASSERT(pipeState == PendingFullBufferMsg);
- PipeRpy_t msg[32];
- int bytes;
- PipeRpy_t* lastMsg;
- while ((bytes = read(msgPipe, msg, sizeof(msg))) > 0)
- {
- DBUG_PRINT("db2i_ioBuffers::drainPipe",("Pipe returned %d bytes", bytes));
- lastMsg = &msg[bytes / (sizeof(msg[0]))-1];
- if (lastMsg->CumRowCnt == maxRows() ||
- lastMsg->RtnCod != 0)
- {
- pipeState = ConsumedFullBufferMsg;
- break;
- }
-
- }
- DBUG_PRINT("db2i_ioBuffers::drainPipe",("rc = %d, rows = %d, max = %d", lastMsg->RtnCod, lastMsg->CumRowCnt, (uint32)maxRows()));
-}
-
-
-/**
- Poll the message pipe for async read messages
-
- Only valid in async
-
- @param orientation The direction to use when reading through the table.
-*/
-void IOAsyncReadBuffer::pollNextRow(char orientation)
-{
- DBUG_ASSERT(readIsAsync);
-
- // Handle the case in which the buffer is full.
- if (rowCount() == maxRows())
- {
- // If we haven't read to the end, exit here.
- if (readCursor < rowCount())
- return;
-
- if (pipeState == PendingFullBufferMsg)
- drainPipe();
- if (pipeState == ConsumedFullBufferMsg)
- loadNewRows(orientation);
- }
-
- if (!rc)
- {
- PipeRpy_t* lastMsg = NULL;
- while (true)
- {
- PipeRpy_t msg[32];
- int bytes = read(msgPipe, msg, sizeof(msg));
- DBUG_PRINT("db2i_ioBuffers::pollNextRow",("Pipe returned %d bytes", bytes));
-
- if (unlikely(bytes < 0))
- {
- DBUG_PRINT("db2i_ioBuffers::pollNextRow", ("Error"));
- rc = errno;
- break;
- }
- else if (bytes == 0)
- break;
-
- DBUG_ASSERT(bytes % sizeof(msg[0]) == 0);
- lastMsg = &msg[bytes / (sizeof(msg[0]))-1];
-
- if (lastMsg->RtnCod || (lastMsg->CumRowCnt == usedRows()))
- {
- rc = lastMsg->RtnCod;
- break;
- }
- }
-
- *releaseRowNeeded = true;
-
- if (rc == QMY_ERR_END_OF_BLOCK)
- rc = 0;
- else if (rc == QMY_ERR_END_OF_FILE)
- {
- // If we reach EOF or end-of-key, DB2 guarantees that no rows will be locked.
- rc = HA_ERR_END_OF_FILE;
- *releaseRowNeeded = false;
- }
- else if (rc == QMY_ERR_KEY_NOT_FOUND)
- {
- rc = HA_ERR_KEY_NOT_FOUND;
- *releaseRowNeeded = false;
- }
-
- if (lastMsg)
- DBUG_PRINT("db2i_ioBuffers::pollNextRow", ("Good data: rc=%d; rows=%d; usedRows=%d", lastMsg->RtnCod, lastMsg->CumRowCnt, (uint32)usedRows()));
- if (lastMsg && likely(!rc))
- {
- if (lastMsg->CumRowCnt < maxRows())
- pipeState = PendingFullBufferMsg;
- else
- pipeState = ConsumedFullBufferMsg;
-
- DBUG_ASSERT(lastMsg->CumRowCnt <= usedRows());
-
- }
- DBUG_ASSERT(rowCount() <= getRowCapacity());
- }
- DBUG_PRINT("db2i_ioBuffers::pollNextRow", ("filledRows: %d, rc: %d", rowCount(), rc));
- if (rc) closePipe();
-}
-
-
-/**
- Prepare for the destruction of the row buffer storage.
-*/
-void IOAsyncReadBuffer::prepForFree()
-{
- interruptRead();
- rewind();
- IORowBuffer::prepForFree();
-}
-
-
-/**
- Initialize the newly allocated storage.
-
- @param sizeChanged Indicates whether the storage capacity is being changed.
-*/
-void IOAsyncReadBuffer::initAfterAllocate(bool sizeChanged)
-{
- rewind();
-
- if (sizeChanged || ((void*)rrnList == NULL))
- rrnList.realloc(getRowCapacity() * sizeof(uint32));
-}
-
-
-/**
- Send an initial read request
-
- @param infile The file (table/index) being read from
- @param orientation The orientation to use for this read request
- @param rowsToBuffer The number of rows to request each time
- @param useAsync Whether reads should be performed asynchronously.
- @param key The key to use (if any)
- @param keyLength The length of key (if any)
- @param keyParts The number of columns in the key (if any)
-
-*/
-void IOAsyncReadBuffer::newReadRequest(FILE_HANDLE infile,
- char orientation,
- uint32 rowsToBuffer,
- bool useAsync,
- ILEMemHandle key,
- int keyLength,
- int keyParts)
-{
- DBUG_ENTER("db2i_ioBuffers::newReadRequest");
- DBUG_ASSERT(rowsToBuffer <= getRowCapacity());
-#ifndef DBUG_OFF
- if (readCursor < rowCount())
- DBUG_PRINT("PERF:",("Wasting %d buffered rows!\n", rowCount() - readCursor));
-#endif
-
- int fildes[2];
- int ileDescriptor = QMY_REUSE;
-
- interruptRead();
-
- if (likely(useAsync))
- {
- if (rowsToBuffer == 1)
- {
- // Async provides little or no benefit for single row reads, so we turn it off
- DBUG_PRINT("db2i_ioBuffers::newReadRequest", ("Disabling async"));
- useAsync = false;
- }
- else
- {
- rc = pipe(fildes);
- if (rc) DBUG_VOID_RETURN;
-
- // Translate the pipe write descriptor into the equivalent ILE descriptor
- rc = fstatx(fildes[1], (struct stat*)&ileDescriptor, sizeof(ileDescriptor), STX_XPFFD_PASE);
- if (rc)
- {
- close(fildes[0]);
- close(fildes[1]);
- DBUG_VOID_RETURN;
- }
- pipeState = Untouched;
- msgPipe = fildes[0];
-
- DBUG_PRINT("db2i_ioBuffers::newReadRequest", ("Opened pipe %d", fildes[0]));
- }
- }
-
- file = infile;
- readIsAsync = useAsync;
- rowsToBlock = rowsToBuffer;
-
- rewind();
- maxRows() = 1;
- rc = getBridge()->expectErrors(QMY_ERR_END_OF_BLOCK, QMY_ERR_LOB_SPACE_TOO_SMALL)
- ->read(file,
- ptr(),
- accessIntent,
- commitLevel,
- orientation,
- useAsync,
- rrnList,
- key,
- keyLength,
- keyParts,
- ileDescriptor);
-
- // Having shared the pipe with ILE, we relinquish our claim on the write end
- // of the pipe.
- if (useAsync)
- close(fildes[1]);
-
- // If we reach EOF or end-of-key, DB2 guarantees that no rows will be locked.
- if (rc == QMY_ERR_END_OF_FILE)
- {
- rc = HA_ERR_END_OF_FILE;
- *releaseRowNeeded = false;
- }
- else if (rc == QMY_ERR_KEY_NOT_FOUND)
- {
- if (rowCount())
- rc = HA_ERR_END_OF_FILE;
- else
- rc = HA_ERR_KEY_NOT_FOUND;
- *releaseRowNeeded = false;
- }
- else
- *releaseRowNeeded = true;
-
- DBUG_VOID_RETURN;
-}
diff --git a/storage/ibmdb2i/db2i_ioBuffers.h b/storage/ibmdb2i/db2i_ioBuffers.h
deleted file mode 100644
index 350d854f055..00000000000
--- a/storage/ibmdb2i/db2i_ioBuffers.h
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-/**
- @file db2i_ioBuffers.h
-
- @brief Buffer classes used for interacting with QMYSE read/write buffers.
-
-*/
-
-
-#include "db2i_validatedPointer.h"
-#include "mysql_priv.h"
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <as400_types.h>
-
-// Needed for compilers which do not include fstatx in standard headers.
-extern "C" int fstatx(int, struct stat *, int, int);
-
-/**
- Basic row buffer
-
- Provides the basic structure and methods needed for communicating
- with QMYSE I/O APIs.
-
- @details All QMYSE I/O apis use a buffer that is structured as two integer
- row counts (max and used) and storage for some number of rows. The row counts
- are both input and output for the API, and their usage depends on the
- particular API invoked. This class encapsulates that buffer definition.
-*/
-class IORowBuffer
-{
- public:
- IORowBuffer() : allocSize(0), rowLength(0) {;}
- ~IORowBuffer() { freeBuf(); }
- ValidatedPointer<char>& ptr() { return data; }
-
- /**
- Sets up the buffer to hold the size indicated.
-
- @param rowLen length of the rows that will be stored in this buffer
- @param nullMapOffset position of null map within each row
- @param size buffer size requested
- */
- void allocBuf(uint32 rowLen, uint16 nullMapOffset, uint32 size)
- {
- nullOffset = nullMapOffset;
- uint32 newSize = size + sizeof(BufferHdr_t);
- // If the internal structure of the row is changing, we need to
- // remember this and notify the subclasses via initAfterAllocate();
- bool formatChanged = ((size/rowLen) != rowCapacity);
-
- if (newSize > allocSize)
- {
- this->freeBuf();
- data.alloc(newSize);
- if (likely((void*)data))
- allocSize = newSize;
- }
-
- if (likely((void*)data))
- {
- DBUG_ASSERT((uint64)(void*)data % 16 == 0);
- rowLength = rowLen;
- rowCapacity = size / rowLength;
- initAfterAllocate(formatChanged);
- }
- else
- {
- allocSize = 0;
- rowCapacity = 0;
- }
-
- DBUG_PRINT("db2i_ioBuffers::allocBuf",("rowCapacity = %d", rowCapacity));
- }
-
- void zeroBuf()
- {
- memset(data, 0, allocSize);
- }
-
- void freeBuf()
- {
- if (likely(allocSize))
- {
- prepForFree();
- DBUG_PRINT("IORowBuffer::freeBuf",("Freeing 0x%p", (char*)data));
- data.dealloc();
- }
- }
-
- char* getRowN(uint32 n)
- {
- if (unlikely(n >= getRowCapacity()))
- return NULL;
- return (char*)data + sizeof(BufferHdr_t) + (rowLength * n);
- };
-
- uint32 getRowCapacity() const {return rowCapacity;}
- uint32 getRowNullOffset() const {return nullOffset;}
- uint32 getRowLength() const {return rowLength;}
-
- protected:
- /**
- Called prior to freeing buffer storage so that subclasses can do
- any required cleanup
- */
- virtual void prepForFree()
- {
- allocSize = 0;
- rowCapacity = 0;
- }
-
- /**
- Called after buffer storage so that subclasses can do any required setup.
- */
- virtual void initAfterAllocate(bool sizeChanged) { return;}
-
- ValidatedPointer<char> data;
- uint32 allocSize;
- uint32 rowCapacity;
- uint32 rowLength;
- uint16 nullOffset;
- uint32& usedRows() const { return ((BufferHdr_t*)(char*)data)->UsedRowCnt; }
- uint32& maxRows() const {return ((BufferHdr_t*)(char*)data)->MaxRowCnt; }
-};
-
-
-/**
- Write buffer
-
- Implements methods for inserting data into a row buffer for use with the
- QMY_WRITE and QMY_UPDATE APIs.
-
- @details The max row count defines how many rows are in the buffer. The used
- row count is updated by QMYSE to indicate how many rows have been
- successfully written.
-*/
-class IOWriteBuffer : public IORowBuffer
-{
- public:
- bool endOfBuffer() const {return (maxRows() == getRowCapacity());}
-
- char* addRow()
- {
- return getRowN(maxRows()++);
- }
-
- void resetAfterWrite()
- {
- maxRows() = 0;
- }
-
- void deleteRow()
- {
- --maxRows();
- }
-
- uint32 rowCount() const {return maxRows();}
-
- uint32 rowsWritten() const {return usedRows()-1;}
-
- private:
- void initAfterAllocate(bool sizeChanged) {maxRows() = 0; usedRows() = 0;}
-};
-
-
-/**
- Read buffer
-
- Implements methods for reading data from and managing a row buffer for use
- with the QMY_READ APIs. This is primarily for use with metainformation queries.
-*/
-class IOReadBuffer : public IORowBuffer
-{
- public:
-
- IOReadBuffer() {;}
- IOReadBuffer(uint32 rows, uint32 rowLength)
- {
- allocBuf(rows, 0, rows * rowLength);
- maxRows() = rows;
- }
-
- uint32 rowCount() {return usedRows();}
- void setRowsToProcess(uint32 rows) { maxRows() = rows; }
-};
-
-
-/**
- Read buffer
-
- Implements methods for reading data from and managing a row buffer for use
- with the QMY_READ APIs.
-
- @details This class supports both sync and async read modes. The max row
- count defines the number of rows that are requested to be read. The used row
- count defines how many rows have been read. Sync mode is reasonably
- straightforward, but async mode has a complex system of communicating with
- QMYSE that is optimized for low latency. In async mode, the used row count is
- updated continuously by QMYSE as rows are read. At the same time, messages are
- sent to the associated pipe indicating that a row has been read. As long as
- the internal read cursor lags behind the used row count, the pipe is never
- consulted. But if the internal read cursor "catches up to" the used row count,
- then we block on the pipe until we find a message indicating that a new row
- has been read or that an error has occurred.
-*/
-class IOAsyncReadBuffer : public IOReadBuffer
-{
- public:
- IOAsyncReadBuffer() :
- file(0), readIsAsync(false), msgPipe(QMY_REUSE), bridge(NULL)
- {
- }
-
- ~IOAsyncReadBuffer()
- {
- interruptRead();
- rrnList.dealloc();
- }
-
-
- /**
- Signal read operation complete
-
- Indicates that the storage engine requires no more data from the table.
- Must be called between calls to newReadRequest().
- */
- void endRead()
- {
-#ifndef DBUG_OFF
- if (readCursor < rowCount())
- DBUG_PRINT("PERF:",("Wasting %d buffered rows!\n", rowCount() - readCursor));
-#endif
- interruptRead();
-
- file = 0;
- bridge = NULL;
- }
-
- /**
- Update data that may change on each read operation
- */
- void update(char newAccessIntent,
- bool* newReleaseRowNeeded,
- char commitLvl)
- {
- accessIntent = newAccessIntent;
- releaseRowNeeded = newReleaseRowNeeded;
- commitLevel = commitLvl;
- }
-
- /**
- Read the next row in the table.
-
- Return a pointer to the next row in the table, where "next" is defined
- by the orientation.
-
- @param orientaton
- @param[out] rrn The relative record number of the row returned. Not reliable
- if NULL is returned by this function.
-
- @return Pointer to the row. Null if no more rows are available or an error
- occurred.
- */
- char* readNextRow(char orientation, uint32& rrn)
- {
- DBUG_PRINT("db2i_ioBuffers::readNextRow", ("readCursor: %d, filledRows: %d, rc: %d", readCursor, rowCount(), rc));
-
- while (readCursor >= rowCount() && !rc)
- {
- if (!readIsAsync)
- loadNewRows(orientation);
- else
- pollNextRow(orientation);
- }
-
- if (readCursor >= rowCount())
- return NULL;
-
- rrn = rrnList[readCursor];
- return getRowN(readCursor++);
- }
-
- /**
- Retrieve the return code generated by the last operation.
-
- @return The return code, translated to the appropriate HA_ERR_*
- value if possible.
- */
- int32 lastrc()
- {
- return db2i_ileBridge::translateErrorCode(rc);
- }
-
- void rewind()
- {
- readCursor = 0;
- rc = 0;
- usedRows() = 0;
- }
-
- bool reachedEOD() { return EOD; }
-
- void newReadRequest(FILE_HANDLE infile,
- char orientation,
- uint32 rowsToBuffer,
- bool useAsync,
- ILEMemHandle key,
- int keyLength,
- int keyParts);
-
- private:
-
- /**
- End any running async read operation.
- */
- void interruptRead()
- {
- closePipe();
- if (file && readIsAsync && (rc == 0) && (rowCount() < getRowCapacity()))
- {
- DBUG_PRINT("IOReadBuffer::interruptRead", ("PERF: Interrupting %d", (uint32)file));
- getBridge()->readInterrupt(file);
- }
- }
-
- void closePipe()
- {
- if (msgPipe != QMY_REUSE)
- {
- DBUG_PRINT("db2i_ioBuffers::closePipe", ("Closing pipe %d", msgPipe));
- close(msgPipe);
- msgPipe = QMY_REUSE;
- }
- }
-
- /**
- Get a pointer to the active ILE bridge.
-
- Getting the bridge pointer is (relatively) expensive, so we cache
- it off for each operation.
- */
- db2i_ileBridge* getBridge()
- {
- if (unlikely(bridge == NULL))
- {
- bridge = db2i_ileBridge::getBridgeForThread();
- }
- return bridge;
- }
-
- void drainPipe();
- void pollNextRow(char orientation);
- void prepForFree();
- void initAfterAllocate(bool sizeChanged);
- void loadNewRows(char orientation);
-
-
- uint32 readCursor; // Read position within buffer
- int32 rc; // Last return code received
- ValidatedPointer<uint32> rrnList; // Receiver for list of rrns
- char accessIntent; // The access intent for this read
- char commitLevel; // What isolation level should be used
- char EOD; // Whether end-of-data was hit
- char readIsAsync; // Are reads to be done asynchronously?
- bool* releaseRowNeeded;
- /* Does the caller need to release the current row when finished reading */
- FILE_HANDLE file; // The file to be read
- int msgPipe;
- /* The read descriptor of the pipe used to pass messages during async reads */
- db2i_ileBridge* bridge; // Cached pointer to bridge
- uint32 rowsToBlock; // Number of rows to request
- enum
- {
- ConsumedFullBufferMsg,
- PendingFullBufferMsg,
- Untouched
- } pipeState;
- /* The state of the async read message pipe */
-};
-
diff --git a/storage/ibmdb2i/db2i_misc.h b/storage/ibmdb2i/db2i_misc.h
deleted file mode 100644
index f0b527aaad0..00000000000
--- a/storage/ibmdb2i/db2i_misc.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-#ifndef DB2I_MISC_H
-#define DB2I_MISC_H
-
-/**
- Undelimit quote-delimited DB2 names in-place
-*/
-void stripExtraQuotes(char* name, uint maxLen)
-{
- char* oldName = (char*)sql_strdup(name);
- uint i = 0;
- uint j = 0;
- do
- {
- name[j] = oldName[i];
- if (oldName[i] == '"' && oldName[i+1] == '"')
- ++i;
- } while (++j < maxLen && oldName[++i]);
-
- if (j == maxLen)
- --j;
- name[j] = 0;
-}
-
-/**
- Convert a MySQL identifier name into a DB2 compatible format
-
- @parm input The MySQL name
- @parm output The DB2 name
- @parm outlen The amount of space allocated for output
- @parm delimit Should delimiting quotes be placed around the converted name?
- @parm delimitQuotes Should quotes in the MySQL be delimited with additional quotes?
-
- @return FALSE if output was too small and name was truncated; TRUE otherwise
-*/
-bool convertMySQLNameToDB2Name(const char* input,
- char* output,
- size_t outlen,
- bool delimit = true,
- bool delimitQuotes = true)
-{
- uint o = 0;
- if (delimit)
- output[o++] = '"';
-
- uint i = 0;
- do
- {
- output[o] = input[i];
- if (delimitQuotes && input[i] == '"')
- output[++o] = '"';
- } while (++o < outlen-2 && input[++i]);
-
- if (delimit)
- output[o++] = '"';
- output[min(o, outlen-1)] = 0; // This isn't the most user-friendly way to handle overflows,
- // but at least its safe.
- return (o <= outlen-1);
-}
-
-bool isOrdinaryIdentifier(const char* s)
-{
- while (*s)
- {
- if (my_isupper(system_charset_info, *s) ||
- my_isdigit(system_charset_info, *s) ||
- (*s == '_') ||
- (*s == '@') ||
- (*s == '$') ||
- (*s == '#') ||
- (*s == '"'))
- ++s;
- else
- return false;
- }
- return true;
-}
-
-/**
- Fill memory with a 16-bit word.
-
- @param p Pointer to space to fill.
- @param v Value to fill
- @param l Length of space (in 16-bit words)
-*/
-void memset16(void* p, uint16 v, size_t l)
-{
- uint16* p2=(uint16*)p;
- while (l--)
- {
- *(p2++) = v;
- }
-}
-
-#endif
diff --git a/storage/ibmdb2i/db2i_myconv.cc b/storage/ibmdb2i/db2i_myconv.cc
deleted file mode 100644
index 7be6e1236cd..00000000000
--- a/storage/ibmdb2i/db2i_myconv.cc
+++ /dev/null
@@ -1,1498 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-/**
- @file
-
- @brief A direct map optimization of iconv and related functions
- This was show to significantly reduce character conversion cost
- for short strings when compared to calling iconv system code.
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <wchar.h>
-#include <errno.h>
-#include <iconv.h>
-#include <ctype.h>
-#include <stdarg.h>
-#include <string.h>
-#include <as400_protos.h>
-
-#include "db2i_myconv.h"
-#include "db2i_global.h"
-
-int32_t myconvDebug=0;
-
-static char szGetTimeString[20];
-static char * GetTimeString(time_t now)
-{
- struct tm * tm;
-
- now = time(&now);
- tm = (struct tm *) localtime(&now);
- sprintf(szGetTimeString, "%04d/%02d/%02d %02d:%02d:%02d",
- tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
- tm->tm_hour, tm->tm_min, tm->tm_sec);
-
- return szGetTimeString;
-}
-
-static MEM_ROOT dmapMemRoot;
-
-void initMyconv()
-{
- init_alloc_root(&dmapMemRoot, 0x200, 0);
-}
-
-void cleanupMyconv()
-{
- free_root(&dmapMemRoot,0);
-}
-
-
-#ifdef DEBUG
-/* type: */
-#define STDOUT_WITH_TIME -1 /* to stdout with time */
-#define STDERR_WITH_TIME -2 /* to stderr with time */
-#define STDOUT_WO_TIME 1 /* : to stdout */
-#define STDERR_WO_TIME 2 /* : to stderr */
-
-
-static void MyPrintf(long type,
- char * fmt, ...)
-{
- char StdoutFN[256];
- va_list ap;
- char * p;
- time_t now;
- FILE * fd=stderr;
-
- if (type < 0)
- {
- now = time(&now);
- fprintf(fd, "%s ", GetTimeString(now));
- }
- va_start(ap, fmt);
- vfprintf(fd, fmt, ap);
- va_end(ap);
-}
-#endif
-
-
-
-
-#define MAX_CONVERTER 128
-
-mycstoccsid(const char* pname)
-{
- if (strcmp(pname, "UTF-16")==0)
- return 1200;
- else if (strcmp(pname, "big5")==0)
- return 950;
- else
- return cstoccsid(pname);
-}
-#define cstoccsid mycstoccsid
-
-static struct __myconv_rec myconv_rec [MAX_CONVERTER];
-static struct __dmap_rec dmap_rec [MAX_CONVERTER];
-
-static int dmap_open(const char * to,
- const char * from,
- const int32_t idx)
-{
- if (myconvIsSBCS(from) && myconvIsSBCS(to)) {
- dmap_rec[idx].codingSchema = DMAP_S2S;
- if ((dmap_rec[idx].dmapS2S = (uchar *) alloc_root(&dmapMemRoot, 0x100)) == NULL) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d failed with malloc(), errno = %d in %s at %d\n",
- to, from, idx, DMAP_S2S, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
- memset(dmap_rec[idx].dmapS2S, 0x00, 0x100);
- myconv_rec[idx].allocatedSize=0x100;
-
- {
- char dmapSrc[0x100];
- iconv_t cd;
- int32_t i;
- size_t inBytesLeft=0x100;
- size_t outBytesLeft=0x100;
- size_t len;
- char * inBuf=dmapSrc;
- char * outBuf=(char *) dmap_rec[idx].dmapS2S;
-
- if ((cd = iconv_open(to, from)) == (iconv_t) -1) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed with iconv_open(), errno = %d in %s at %d\n",
- to, from, idx, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
-
- inBytesLeft = 0x100;
- for (i = 0; i < inBytesLeft; ++i)
- dmapSrc[i]=i;
-
- do {
- if ((len = iconv(cd, &inBuf, &inBytesLeft, &outBuf, &outBytesLeft)) != (size_t) 0) {
-#ifdef DEBUG
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d: iconv() returns %d, errno = %d in %s at %d\n",
- to, from, idx, DMAP_S2S, len, errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WITH_TIME,
- "inBytesLeft = %d, inBuf - dmapSrc = %d\n", inBytesLeft, inBuf-dmapSrc);
- MyPrintf(STDERR_WITH_TIME,
- "outBytesLeft = %d, outBuf - dmapS2S = %d\n", outBytesLeft, outBuf-(char *) dmap_rec[idx].dmapS2S);
- }
- if ((inBytesLeft == 86 || inBytesLeft == 64 || inBytesLeft == 1) &&
- memcmp(from, "IBM-1256", 9) == 0 &&
- memcmp(to, "IBM-420", 8) == 0) {
- /* Known problem for IBM-1256_IBM-420 */
- --inBytesLeft;
- ++inBuf;
- *outBuf=0x00;
- ++outBuf;
- --outBytesLeft;
- continue;
- } else if ((inBytesLeft == 173 || inBytesLeft == 172 ||
- inBytesLeft == 74 || inBytesLeft == 73 ||
- inBytesLeft == 52 || inBytesLeft == 50 ||
- inBytesLeft == 31 || inBytesLeft == 20 ||
- inBytesLeft == 6) &&
- memcmp(to, "IBM-1256", 9) == 0 &&
- memcmp(from, "IBM-420", 8) == 0) {
- /* Known problem for IBM-420_IBM-1256 */
- --inBytesLeft;
- ++inBuf;
- *outBuf=0x00;
- ++outBuf;
- --outBytesLeft;
- continue;
- } else if ((128 >= inBytesLeft) &&
- memcmp(to, "IBM-037", 8) == 0 &&
- memcmp(from, "IBM-367", 8) == 0) {
- /* Known problem for IBM-367_IBM-037 */
- --inBytesLeft;
- ++inBuf;
- *outBuf=0x00;
- ++outBuf;
- --outBytesLeft;
- continue;
- } else if (((1 <= inBytesLeft && inBytesLeft <= 4) || (97 <= inBytesLeft && inBytesLeft <= 128)) &&
- memcmp(to, "IBM-838", 8) == 0 &&
- memcmp(from, "TIS-620", 8) == 0) {
- /* Known problem for TIS-620_IBM-838 */
- --inBytesLeft;
- ++inBuf;
- *outBuf=0x00;
- ++outBuf;
- --outBytesLeft;
- continue;
- }
- iconv_close(cd);
- return -1;
-#else
- /* Tolerant to undefined conversions for any converter */
- --inBytesLeft;
- ++inBuf;
- *outBuf=0x00;
- ++outBuf;
- --outBytesLeft;
- continue;
-#endif
- }
- } while (inBytesLeft > 0);
-
- if (myconvIsISO(to))
- myconv_rec[idx].subS=0x1A;
- else if (myconvIsASCII(to))
- myconv_rec[idx].subS=0x7F;
- else if (myconvIsEBCDIC(to))
- myconv_rec[idx].subS=0x3F;
-
- if (myconvIsISO(from))
- myconv_rec[idx].srcSubS=0x1A;
- else if (myconvIsASCII(from))
- myconv_rec[idx].srcSubS=0x7F;
- else if (myconvIsEBCDIC(from))
- myconv_rec[idx].srcSubS=0x3F;
-
- iconv_close(cd);
- }
- } else if (((myconvIsSBCS(from) && myconvIsUnicode2(to)) && (dmap_rec[idx].codingSchema = DMAP_S2U)) ||
- ((myconvIsSBCS(from) && myconvIsUTF8(to)) && (dmap_rec[idx].codingSchema = DMAP_S28))) {
- int i;
-
- /* single byte mapping */
- if ((dmap_rec[idx].dmapD12U = (UniChar *) alloc_root(&dmapMemRoot, 0x100 * 2)) == NULL) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d failed with malloc(), errno = %d in %s at %d\n",
- to, from, idx, DMAP_S2U, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
- memset(dmap_rec[idx].dmapD12U, 0x00, 0x100 * 2);
- myconv_rec[idx].allocatedSize=0x100 * 2;
-
-
- {
- char dmapSrc[2];
- iconv_t cd;
- int32_t i;
- size_t inBytesLeft;
- size_t outBytesLeft;
- size_t len;
- char * inBuf;
- char * outBuf;
- char SS=0x1A;
-#ifdef support_surrogate
- if ((cd = iconv_open("UTF-16", from)) == (iconv_t) -1) {
-#else
- if ((cd = iconv_open("UCS-2", from)) == (iconv_t) -1) {
-#endif
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed with iconv_open(), errno = %d in %s at %d\n",
- to, from, idx, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
-
- for (i = 0; i < 0x100; ++i) {
- dmapSrc[0]=i;
- inBuf=dmapSrc;
- inBytesLeft=1;
- outBuf=(char *) &(dmap_rec[idx].dmapD12U[i]);
- outBytesLeft=2;
- if ((len = iconv(cd, &inBuf, &inBytesLeft, &outBuf, &outBytesLeft)) != (size_t) 0) {
- if ((errno == EILSEQ || errno == EINVAL) &&
- inBytesLeft == 1 &&
- outBytesLeft == 2) {
- continue;
- } else {
-#ifdef DEBUG
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(cd,%02x,%d,%02x%02x,%d), errno = %d in %s at %d\n",
- to, from, idx, dmapSrc[0], 1,
- (&dmap_rec[idx].dmapD12U[i])[0],(&dmap_rec[idx].dmapD12U[i])[1], 2,
- errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WITH_TIME,
- "inBytesLeft=%d, outBytesLeft=%d, %02x%02x\n",
- inBytesLeft, outBytesLeft,
- (&dmap_rec[idx].dmapD12U[i])[0],(&dmap_rec[idx].dmapD12U[i])[1]);
- }
-#endif
- iconv_close(cd);
- return -1;
- }
- dmap_rec[idx].dmapD12U[i]=0x0000;
- }
- if (dmap_rec[idx].dmapE02U[i] == 0x001A && /* pick the first one */
- myconv_rec[idx].srcSubS == 0x00) {
- myconv_rec[idx].srcSubS=i;
- }
- }
- iconv_close(cd);
- }
- myconv_rec[idx].subS=0x1A;
- myconv_rec[idx].subD=0xFFFD;
-
-
- } else if (((myconvIsUCS2(from) && myconvIsSBCS(to)) && (dmap_rec[idx].codingSchema = DMAP_U2S)) ||
- ((myconvIsUTF16(from) && myconvIsSBCS(to)) && (dmap_rec[idx].codingSchema = DMAP_T2S)) ||
- ((myconvIsUTF8(from) && myconvIsSBCS(to)) && (dmap_rec[idx].codingSchema = DMAP_82S))) {
- /* UTF-16 -> SBCS, the direct map a bit of waste of space,
- * binary search may be reasonable alternative
- */
- if ((dmap_rec[idx].dmapU2S = (uchar *) alloc_root(&dmapMemRoot, 0x10000 * 2)) == NULL) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d failed with malloc(), errno = %d in %s at %d\n",
- to, from, idx, DMAP_U2S, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
- memset(dmap_rec[idx].dmapU2S, 0x00, 0x10000);
- myconv_rec[idx].allocatedSize=(0x10000 * 2);
-
- {
- iconv_t cd;
- int32_t i;
-
-#ifdef support_surrogate
- if ((cd = iconv_open(to, "UTF-16")) == (iconv_t) -1) {
-#else
- if ((cd = iconv_open(to, "UCS-2")) == (iconv_t) -1) {
-#endif
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed with iconv_open(), errno = %d in %s at %d\n",
- to, from, idx, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
-
- for (i = 0; i < 0x100; ++i) {
- UniChar dmapSrc[0x100];
- int32_t j;
- for (j = 0; j < 0x100; ++j) {
- dmapSrc[j]=i * 0x100 + j;
- }
- char * inBuf=(char *) dmapSrc;
- char * outBuf=(char *) &(dmap_rec[idx].dmapU2S[i*0x100]);
- size_t inBytesLeft=sizeof(dmapSrc);
- size_t outBytesLeft=0x100;
- size_t len;
-
- if ((len = iconv(cd, &inBuf, &inBytesLeft, &outBuf, &outBytesLeft)) != (size_t) 0) {
- if (inBytesLeft == 0 && outBytesLeft == 0) { /* a number of substitution returns */
- continue;
- }
-#ifdef DEBUG
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(), errno = %d in %s at %d\n",
- from, to, idx, errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WITH_TIME,
- "iconv() retuns %d, errno=%d, InBytesLeft=%d, OutBytesLeft=%d\n",
- len, errno, inBytesLeft, outBytesLeft, __FILE__,__LINE__);
- }
-#endif
- iconv_close(cd);
- return -1;
- }
- }
- iconv_close(cd);
-
- myconv_rec[idx].subS = dmap_rec[idx].dmapU2S[0x1A];
- myconv_rec[idx].subD = dmap_rec[idx].dmapU2S[0xFFFD];
- myconv_rec[idx].srcSubS = 0x1A;
- myconv_rec[idx].srcSubD = 0xFFFD;
- }
-
-
-
- } else if (((myconvIsDBCS(from) && myconvIsUnicode2(to)) && (dmap_rec[idx].codingSchema = DMAP_D2U)) ||
- ((myconvIsDBCS(from) && myconvIsUTF8(to)) && (dmap_rec[idx].codingSchema = DMAP_D28))) {
- int i;
- /* single byte mapping */
- if ((dmap_rec[idx].dmapD12U = (UniChar *) alloc_root(&dmapMemRoot, 0x100 * 2)) == NULL) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d failed with malloc(), errno = %d in %s at %d\n",
- to, from, idx, DMAP_D2U, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
- memset(dmap_rec[idx].dmapD12U, 0x00, 0x100 * 2);
-
- /* double byte mapping, assume 7 bit ASCII is not use as the first byte of DBCS. */
- if ((dmap_rec[idx].dmapD22U = (UniChar *) alloc_root(&dmapMemRoot, 0x8000 * 2)) == NULL) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d failed with malloc(), errno = %d in %s at %d\n",
- to, from, idx, DMAP_D2U, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
- memset(dmap_rec[idx].dmapD22U, 0x00, 0x8000 * 2);
-
- myconv_rec[idx].allocatedSize=(0x100 + 0x8000) * 2;
-
-
- {
- char dmapSrc[2];
- iconv_t cd;
- int32_t i;
- size_t inBytesLeft;
- size_t outBytesLeft;
- size_t len;
- char * inBuf;
- char * outBuf;
- char SS=0x1A;
-
-#ifdef support_surrogate
- if ((cd = iconv_open("UTF-16", from)) == (iconv_t) -1) {
-#else
- if ((cd = iconv_open("UCS-2", from)) == (iconv_t) -1) {
-#endif
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed with iconv_open(), errno = %d in %s at %d\n",
- to, from, idx, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
-
- for (i = 0; i < 0x100; ++i) {
- dmapSrc[0]=i;
- inBuf=dmapSrc;
- inBytesLeft=1;
- outBuf=(char *) (&dmap_rec[idx].dmapD12U[i]);
- outBytesLeft=2;
- if ((len = iconv(cd, &inBuf, &inBytesLeft, &outBuf, &outBytesLeft)) != (size_t) 0) {
- if ((errno == EILSEQ || errno == EINVAL) &&
- inBytesLeft == 1 &&
- outBytesLeft == 2) {
- continue;
- } else {
-#ifdef DEBUG
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(cd,%02x,%d,%02x%02x,%d), errno = %d in %s at %d\n",
- to, from, idx, dmapSrc[0], 1,
- (&dmap_rec[idx].dmapD12U[i])[0],(&dmap_rec[idx].dmapD12U[i])[1], 2,
- errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WITH_TIME,
- "inBytesLeft=%d, outBytesLeft=%d, %02x%02x\n",
- inBytesLeft, outBytesLeft,
- (&dmap_rec[idx].dmapD12U[i])[0],(&dmap_rec[idx].dmapD12U[i])[1]);
- }
-#endif
- iconv_close(cd);
- return -1;
- }
- dmap_rec[idx].dmapD12U[i]=0x0000;
- }
- if (dmap_rec[idx].dmapD12U[i] == 0x001A && /* pick the first one */
- myconv_rec[idx].srcSubS == 0x00) {
- myconv_rec[idx].srcSubS=i;
- }
- }
-
-
- for (i = 0x80; i < 0x100; ++i) {
- int j;
- if (dmap_rec[idx].dmapD12U[i] != 0x0000)
- continue;
- for (j = 0x01; j < 0x100; ++j) {
- dmapSrc[0]=i;
- dmapSrc[1]=j;
- int offset = i-0x80;
- offset<<=8;
- offset+=j;
-
- inBuf=dmapSrc;
- inBytesLeft=2;
- outBuf=(char *) &(dmap_rec[idx].dmapD22U[offset]);
- outBytesLeft=2;
- if ((len = iconv(cd, &inBuf, &inBytesLeft, &outBuf, &outBytesLeft)) != (size_t) 0) {
- if (inBytesLeft == 2 && outBytesLeft == 2 && (errno == EILSEQ || errno == EINVAL)) {
- ; /* invalid DBCS character, dmapDD2U[offset] remains 0x0000 */
- } else {
-#ifdef DEBUG
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(cd,%p,2,%p,2), errno = %d in %s at %d\n",
- to, from, idx,
- dmapSrc, &(dmap_rec[idx].dmapD22U[offset]),
- errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WO_TIME,
- "iconv(cd,0x%02x%02x,2,0x%04x,2) returns %d, inBytesLeft=%d, outBytesLeft=%d\n",
- dmapSrc[0], dmapSrc[1],
- dmap_rec[idx].dmapD22U[offset],
- len, inBytesLeft, outBytesLeft);
- }
-#endif
- iconv_close(cd);
- return -1;
- }
- } else {
-#ifdef TRACE_DMAP
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(), rc=%d, errno=%d in %s at %d\n",
- to, from, idx, len, errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WITH_TIME,
- "%04X: src=%04X%04X, inBuf=0x%02X%02X, inBytesLeft=%d, outBuf=%02X%02X%02X, outBytesLeft=%d\n",
- i, dmapSrc[0], dmapSrc[1], inBuf[0], inBuf[1],
- inBytesLeft, outBuf[-2], outBuf[-1], outBuf[0], outBytesLeft);
- MyPrintf(STDERR_WITH_TIME,
- "&dmapSrc=%p, inBuf=%p, %p, outBuf=%p\n",
- dmapSrc, inBuf, dmap_rec[idx].dmapU2M3 + (i - 0x80) * 2, outBuf);
- }
-#endif
- }
- }
- if (dmap_rec[idx].dmapD12U[i] == 0xFFFD) { /* pick the last one */
- myconv_rec[idx].srcSubD=i* 0x100 + j;
- }
- }
- iconv_close(cd);
- }
-
- myconv_rec[idx].subS=0x1A;
- myconv_rec[idx].subD=0xFFFD;
- myconv_rec[idx].srcSubD=0xFCFC;
-
-
- } else if (((myconvIsUCS2(from) && myconvIsDBCS(to)) && (dmap_rec[idx].codingSchema = DMAP_U2D)) ||
- ((myconvIsUTF16(from) && myconvIsDBCS(to)) && (dmap_rec[idx].codingSchema = DMAP_T2D)) ||
- ((myconvIsUTF8(from) && myconvIsDBCS(to)) && (dmap_rec[idx].codingSchema = DMAP_82D))) {
- /* UTF-16 -> DBCS single/double byte */
- /* A single table will cover all characters, assuming no second byte is 0x00. */
- if ((dmap_rec[idx].dmapU2D = (uchar *) alloc_root(&dmapMemRoot, 0x10000 * 2)) == NULL) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d failed with malloc(), errno = %d in %s at %d\n",
- to, from, idx, DMAP_U2D, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
-
- memset(dmap_rec[idx].dmapU2D, 0x00, 0x10000 * 2);
- myconv_rec[idx].allocatedSize=(0x10000 * 2);
-
- {
- UniChar dmapSrc[1];
- iconv_t cd;
- int32_t i;
- size_t inBytesLeft;
- size_t outBytesLeft;
- size_t len;
- char * inBuf;
- char * outBuf;
-
-#ifdef support_surrogate
- if ((cd = iconv_open(to, "UTF-16")) == (iconv_t) -1) {
-#else
- if ((cd = iconv_open(to, "UCS-2")) == (iconv_t) -1) {
-#endif
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed with iconv_open(), errno = %d in %s at %d\n",
- to, from, idx, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
-
- /* easy implementation, convert 1 Unicode character at one time. */
- /* If the open performance is an issue, convert a chunk such as 128 chracters. */
- /* if the converted length is not the same as the original, convert one by one. */
- (dmap_rec[idx].dmapU2D)[0x0000]=0x00;
- for (i = 1; i < 0x10000; ++i) {
- dmapSrc[0]=i;
- inBuf=(char *) dmapSrc;
- inBytesLeft=2;
- outBuf=(char *) &((dmap_rec[idx].dmapU2D)[2*i]);
- outBytesLeft=2;
- do {
- if ((len = iconv(cd, &inBuf, &inBytesLeft, &outBuf, &outBytesLeft)) != (size_t) 0) {
- if (len == 1 && inBytesLeft == 0 && outBytesLeft == 1 && (dmap_rec[idx].dmapU2D)[2*i] == 0x1A) {
- /* UCS-2_TIS-620:0x0080 => 0x1A, converted to SBCS replacement character */
- (dmap_rec[idx].dmapU2D)[2*i+1]=0x00;
- break;
- } else if (len == 1 && inBytesLeft == 0 && outBytesLeft == 0) {
- break;
- }
- if (errno == EILSEQ || errno == EINVAL) {
-#ifdef DEBUG
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(), errno = %d in %s at %d\n",
- to, from, idx, errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WO_TIME,
- "iconv(cd,%04x,2,%02x%02x,2) returns inBytesLeft=%d, outBytesLeft=%d\n",
- dmapSrc[0],
- (dmap_rec[idx].dmapU2D)[2*i], (dmap_rec[idx].dmapU2D)[2*i+1],
- inBytesLeft, outBytesLeft);
- if (outBuf - (char *) dmap_rec[idx].dmapU2M2 > 1)
- MyPrintf(STDERR_WO_TIME, "outBuf[-2..2]=%02X%02X%02X%02X%02X\n", outBuf[-2],outBuf[-1],outBuf[0],outBuf[1],outBuf[2]);
- else
- MyPrintf(STDERR_WO_TIME, "outBuf[0..2]=%02X%02X%02X\n", outBuf[0],outBuf[1],outBuf[2]);
- }
-#endif
- inBuf+=2;
- inBytesLeft-=2;
- memcpy(outBuf, (char *) &(myconv_rec[idx].subD), 2);
- outBuf+=2;
- outBytesLeft-=2;
- } else {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "[%d] dmap_open(%s,%s,%d) failed to initialize with iconv(), errno = %d in %s at %d\n",
- i, to, from, idx, errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WO_TIME,
- "iconv(cd,%04x,2,%02x%02x,2) returns %d inBytesLeft=%d, outBytesLeft=%d\n",
- dmapSrc[0],
- (dmap_rec[idx].dmapU2D)[2*i],
- (dmap_rec[idx].dmapU2D)[2*i+1],
- len, inBytesLeft,outBytesLeft);
- if (i == 1) {
- MyPrintf(STDERR_WO_TIME,
- " inBuf [-1..2]=%02x%02x%02x%02x\n",
- inBuf[-1],inBuf[0],inBuf[1],inBuf[2]);
- MyPrintf(STDERR_WO_TIME,
- " outBuf [-1..2]=%02x%02x%02x%02x\n",
- outBuf[-1],outBuf[0],outBuf[1],outBuf[2]);
- } else {
- MyPrintf(STDERR_WO_TIME,
- " inBuf [-2..2]=%02x%02x%02x%02x%02x\n",
- inBuf[-2],inBuf[-1],inBuf[0],inBuf[1],inBuf[2]);
- MyPrintf(STDERR_WO_TIME,
- " outBuf [-2..2]=%02x%02x%02x%02x%02x\n",
- outBuf[-2],outBuf[-1],outBuf[0],outBuf[1],outBuf[2]);
- }
-#endif
- iconv_close(cd);
- return -1;
- }
- if (len == 0 && inBytesLeft == 0 && outBytesLeft == 1) { /* converted to SBCS */
- (dmap_rec[idx].dmapU2D)[2*i+1]=0x00;
- break;
- }
- }
- } while (inBytesLeft > 0);
- }
- iconv_close(cd);
- myconv_rec[idx].subS = dmap_rec[idx].dmapU2D[2*0x1A];
- myconv_rec[idx].subD = dmap_rec[idx].dmapU2D[2*0xFFFD] * 0x100
- + dmap_rec[idx].dmapU2D[2*0xFFFD+1];
- myconv_rec[idx].srcSubS = 0x1A;
- myconv_rec[idx].srcSubD = 0xFFFD;
- }
-
-
- } else if (((myconvIsEUC(from) && myconvIsUnicode2(to)) && (dmap_rec[idx].codingSchema = DMAP_E2U)) ||
- ((myconvIsEUC(from) && myconvIsUTF8(to)) && (dmap_rec[idx].codingSchema = DMAP_E28))) {
- int i;
- /* S0: 0x00 - 0x7F */
- if ((dmap_rec[idx].dmapE02U = (UniChar *) alloc_root(&dmapMemRoot, 0x100 * 2)) == NULL) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d failed with malloc(), errno = %d in %s at %d\n",
- to, from, idx, DMAP_E2U, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
- memset(dmap_rec[idx].dmapE02U, 0x00, 0x100 * 2);
-
- /* S1: 0xA0 - 0xFF, 0xA0 - 0xFF */
- if ((dmap_rec[idx].dmapE12U = (UniChar *) alloc_root(&dmapMemRoot, 0x60 * 0x60 * 2)) == NULL) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d failed with malloc(), errno = %d in %s at %d\n",
- to, from, idx, DMAP_E2U, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
- memset(dmap_rec[idx].dmapE12U, 0x00, 0x60 * 0x60 * 2);
-
- /* SS2: 0x8E + 0xA0 - 0xFF, 0xA0 - 0xFF */
- if ((dmap_rec[idx].dmapE22U = (UniChar *) alloc_root(&dmapMemRoot, 0x60 * 0x61 * 2)) == NULL) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d failed with malloc(), errno = %d in %s at %d\n",
- to, from, idx, DMAP_E2U, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
- memset(dmap_rec[idx].dmapE22U, 0x00, 0x60 * 0x61 * 2);
-
- /* SS3: 0x8F + 0xA0 - 0xFF, 0xA0 - 0xFF */
- if ((dmap_rec[idx].dmapE32U = (UniChar *) alloc_root(&dmapMemRoot, 0x60 * 0x61 * 2)) == NULL) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d failed with malloc(), errno = %d in %s at %d\n",
- to, from, idx, DMAP_E2U, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
- memset(dmap_rec[idx].dmapE32U, 0x00, 0x60 * 0x61 * 2);
-
- myconv_rec[idx].allocatedSize=(0x100 + 0x60 * 0x60 + 0x60 * 0x61* 2) * 2;
-
-
- {
- char dmapSrc[0x60 * 0x60 * 3];
- iconv_t cd;
- int32_t i;
- size_t inBytesLeft;
- size_t outBytesLeft;
- size_t len;
- char * inBuf;
- char * outBuf;
- char SS=0x8E;
-
-#ifdef support_surrogate
- if ((cd = iconv_open("UTF-16", from)) == (iconv_t) -1) {
-#else
- if ((cd = iconv_open("UCS-2", from)) == (iconv_t) -1) {
-#endif
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed with iconv_open(), errno = %d in %s at %d\n",
- to, from, idx, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
-
- for (i = 0; i < 0x100; ++i) {
- dmapSrc[0]=i;
- inBuf=dmapSrc;
- inBytesLeft=1;
- outBuf=(char *) (&dmap_rec[idx].dmapE02U[i]);
- outBytesLeft=2;
- if ((len = iconv(cd, &inBuf, &inBytesLeft, &outBuf, &outBytesLeft)) != (size_t) 0) {
-#ifdef DEBUG
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(), errno = %d in %s at %d\n",
- to, from, idx, errno, __FILE__,__LINE__);
- }
-#endif
- dmap_rec[idx].dmapE02U[i]=0x0000;
- }
- if (dmap_rec[idx].dmapE02U[i] == 0x001A && /* pick the first one */
- myconv_rec[idx].srcSubS == 0x00) {
- myconv_rec[idx].srcSubS=i;
- }
- }
-
-
- inBuf=dmapSrc;
- for (i = 0; i < 0x60; ++i) {
- int j;
- for (j = 0; j < 0x60; ++j) {
- *inBuf=i+0xA0;
- ++inBuf;
- *inBuf=j+0xA0;
- ++inBuf;
- }
- }
- inBuf=dmapSrc;
- inBytesLeft=0x60 * 0x60 * 2;
- outBuf=(char *) dmap_rec[idx].dmapE12U;
- outBytesLeft=0x60 * 0x60 * 2;
- do {
- if ((len = iconv(cd, &inBuf, &inBytesLeft, &outBuf, &outBytesLeft)) != (size_t) 0) {
- if (errno == EILSEQ) {
-#ifdef DEBUG
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(), errno = %d in %s at %d\n",
- to, from, idx, errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WO_TIME, "inBytesLeft=%d, outBytesLeft=%d\n", inBytesLeft, outBytesLeft);
- if (inBuf - dmapSrc > 1 && inBuf - dmapSrc <= sizeof(dmapSrc) - 2)
- MyPrintf(STDERR_WO_TIME, "inBuf[-2..2]=%02X%02X%02X%02X%02X\n", inBuf[-2],inBuf[-1],inBuf[0],inBuf[1],inBuf[2]);
- else
- MyPrintf(STDERR_WO_TIME, "inBuf[0..2]=%02X%02X%02X\n", inBuf[0],inBuf[1],inBuf[2]);
- if (outBuf - (char *) dmap_rec[idx].dmapE12U > 1)
- MyPrintf(STDERR_WO_TIME, "outBuf[-2..2]=%02X%02X%02X%02X%02X\n", outBuf[-2],outBuf[-1],outBuf[0],outBuf[1],outBuf[2]);
- else
- MyPrintf(STDERR_WO_TIME, "outBuf[0..2]=%02X%02X%02X\n", outBuf[0],outBuf[1],outBuf[2]);
- }
-#endif
- inBuf+=2;
- inBytesLeft-=2;
- outBuf[0]=0x00;
- outBuf[1]=0x00;
- outBuf+=2;
- outBytesLeft-=2;
- } else {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(), errno = %d in %s at %d\n",
- to, from, idx, errno, __FILE__,__LINE__);
-#endif
- iconv_close(cd);
- return -1;
- }
- }
- } while (inBytesLeft > 0);
-
- /* SS2: 0x8E + 1 or 2 bytes */
- /* SS3: 0x8E + 1 or 2 bytes */
- while (SS != 0x00) {
- int32_t numSuccess=0;
- for (i = 0; i < 0x60; ++i) {
- inBuf=dmapSrc;
- inBuf[0]=SS;
- inBuf[1]=i+0xA0;
- inBytesLeft=2;
- if (SS == 0x8E)
- outBuf=(char *) &(dmap_rec[idx].dmapE22U[i]);
- else
- outBuf=(char *) &(dmap_rec[idx].dmapE32U[i]);
- outBytesLeft=2;
- if ((len = iconv(cd, &inBuf, &inBytesLeft, &outBuf, &outBytesLeft)) != (size_t) 0) {
- if (SS == 0x8E)
- dmap_rec[idx].dmapE22U[i]=0x0000;
- else
- dmap_rec[idx].dmapE32U[i]=0x0000;
- } else {
- ++numSuccess;
- }
- }
- if (numSuccess == 0) { /* SS2 is 2 bytes */
- inBuf=dmapSrc;
- for (i = 0; i < 0x60; ++i) {
- int j;
- for (j = 0; j < 0x60; ++j) {
- *inBuf=SS;
- ++inBuf;
- *inBuf=i+0xA0;
- ++inBuf;
- *inBuf=j+0xA0;
- ++inBuf;
- }
- }
- inBuf=dmapSrc;
- inBytesLeft=0x60 * 0x60 * 3;
- if (SS == 0x8E)
- outBuf=(char *) &(dmap_rec[idx].dmapE22U[0x60]);
- else
- outBuf=(char *) &(dmap_rec[idx].dmapE32U[0x60]);
- outBytesLeft=0x60 * 0x60 * 2;
- do {
- if ((len = iconv(cd, &inBuf, &inBytesLeft, &outBuf, &outBytesLeft)) != (size_t) 0) {
-#ifdef DEBUG
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "%02X:dmap_open(%s,%s,%d) failed to initialize with iconv(), errno = %d in %s at %d\n",
- SS, to, from, idx, errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WO_TIME, "inBytesLeft=%d, outBytesLeft=%d\n", inBytesLeft, outBytesLeft);
- if (inBuf - dmapSrc > 1 && inBuf - dmapSrc <= sizeof(dmapSrc) - 2)
- MyPrintf(STDERR_WO_TIME, "inBuf[-2..2]=%02X%02X%02X%02X%02X\n", inBuf[-2],inBuf[-1],inBuf[0],inBuf[1],inBuf[2]);
- else
- MyPrintf(STDERR_WO_TIME, "inBuf[0..2]=%02X%02X%02X\n", inBuf[0],inBuf[1],inBuf[2]);
- }
-#endif
- if (errno == EILSEQ || errno == EINVAL) {
- inBuf+=3;
- inBytesLeft-=3;
- outBuf[0]=0x00;
- outBuf[1]=0x00;
- outBuf+=2;
- outBytesLeft-=2;
- } else {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "%02X:dmap_open(%s,%s,%d) failed to initialize with iconv(), errno = %d in %s at %d\n",
- SS, to, from, idx, errno, __FILE__,__LINE__);
-#endif
- iconv_close(cd);
- return -1;
- }
- }
- } while (inBytesLeft > 0);
- }
- if (SS == 0x8E)
- SS=0x8F;
- else
- SS = 0x00;
- }
- iconv_close(cd);
-
- myconv_rec[idx].subS=0x1A;
- myconv_rec[idx].subD=0xFFFD;
- for (i = 0; i < 0x80; ++i) {
- if (dmap_rec[idx].dmapE02U[i] == 0x001A) {
- myconv_rec[idx].srcSubS=i; /* pick the first one */
- break;
- }
- }
-
- for (i = 0; i < 0x60 * 0x60; ++i) {
- if (dmap_rec[idx].dmapE12U[i] == 0xFFFD) {
- uchar byte1=i / 0x60;
- uchar byte2=i % 0x60;
- myconv_rec[idx].srcSubD=(byte1 + 0xA0) * 0x100 + (byte2 + 0xA0); /* pick the last one */
- }
- }
-
- }
-
- } else if (((myconvIsUCS2(from) && myconvIsEUC(to)) && (dmap_rec[idx].codingSchema = DMAP_U2E)) ||
- ((myconvIsUTF16(from) && myconvIsEUC(to)) && (dmap_rec[idx].codingSchema = DMAP_T2E)) ||
- ((myconvIsUTF8(from) && myconvIsEUC(to)) && (dmap_rec[idx].codingSchema = DMAP_82E))) {
- /* S0: 0x00 - 0xFF */
- if ((dmap_rec[idx].dmapU2S = (uchar *) alloc_root(&dmapMemRoot, 0x100)) == NULL) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d failed with malloc(), errno = %d in %s at %d\n",
- to, from, idx, DMAP_U2E, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
- memset(dmap_rec[idx].dmapU2S, 0x00, 0x100);
-
- /* U0080 - UFFFF -> S1: 0xA0 - 0xFF, 0xA0 - 0xFF */
- if ((dmap_rec[idx].dmapU2M2 = (uchar *) alloc_root(&dmapMemRoot, 0xFF80 * 2)) == NULL) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d failed with malloc(), errno = %d in %s at %d\n",
- to, from, idx, DMAP_U2E, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
- memset(dmap_rec[idx].dmapU2M2, 0x00, 0xFF80 * 2);
-
- /* U0080 - UFFFF -> SS2: 0x8E + 0xA0 - 0xFF, 0xA0 - 0xFF
- * SS3: 0x8F + 0xA0 - 0xFF, 0xA0 - 0xFF */
- if ((dmap_rec[idx].dmapU2M3 = (uchar *) alloc_root(&dmapMemRoot, 0xFF80 * 3)) == NULL) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d), CS=%d failed with malloc(), errno = %d in %s at %d\n",
- to, from, idx, DMAP_U2E, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
- memset(dmap_rec[idx].dmapU2M3, 0x00, 0xFF80 * 3);
- myconv_rec[idx].allocatedSize=(0x100 + 0xFF80 * 2 + 0xFF80 * 3);
-
- {
- UniChar dmapSrc[0x80];
- iconv_t cd;
- int32_t i;
- size_t inBytesLeft;
- size_t outBytesLeft;
- size_t len;
- char * inBuf;
- char * outBuf;
-
-#ifdef support_surrogate
- if ((cd = iconv_open(to, "UTF-16")) == (iconv_t) -1) {
-#else
- if ((cd = iconv_open(to, "UCS-2")) == (iconv_t) -1) {
-#endif
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed with iconv_open(), errno = %d in %s at %d\n",
- to, from, idx, errno, __FILE__,__LINE__);
-#endif
- return -1;
- }
-
- for (i = 0; i < 0x80; ++i)
- dmapSrc[i]=i;
- inBuf=(char *) dmapSrc;
- inBytesLeft=0x80 * 2;
- outBuf=(char *) dmap_rec[idx].dmapU2S;
- outBytesLeft=0x80;
- do {
- if ((len = iconv(cd, &inBuf, &inBytesLeft, &outBuf, &outBytesLeft)) != (size_t) 0) {
-#ifdef DEBUG
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(), errno = %d in %s at %d\n",
- to, from, idx, errno, __FILE__,__LINE__);
-#endif
- iconv_close(cd);
- return -1;
- }
- } while (inBytesLeft > 0);
-
- myconv_rec[idx].srcSubS = 0x1A;
- myconv_rec[idx].srcSubD = 0xFFFD;
- myconv_rec[idx].subS = dmap_rec[idx].dmapU2S[0x1A];
-
- outBuf=(char *) &(myconv_rec[idx].subD);
- dmapSrc[0]=0xFFFD;
- inBuf=(char *) dmapSrc;
- inBytesLeft=2;
- outBytesLeft=2;
- if ((len = iconv(cd, &inBuf, &inBytesLeft, &outBuf, &outBytesLeft)) != (size_t) 0) {
-#ifdef DEBUG
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(), rc=%d, errno=%d in %s at %d\n",
- to, from, idx, len, errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WO_TIME, "iconv(0x1A,1,%p,1) returns outBuf=%p, outBytesLeft=%d\n",
- dmapSrc, outBuf, outBytesLeft);
- }
-#endif
- if (outBytesLeft == 0) {
- /* UCS-2_IBM-eucKR returns error.
- myconv(iconv) rc=1, error=0, InBytesLeft=0, OutBytesLeft=18
- myconv(iconvRev) rc=-1, error=116, InBytesLeft=2, OutBytesLeft=20
- iconv: 0xFFFD => 0xAFFE => 0x rc=1,-1 sub=0,0
- */
- ;
- } else {
- iconv_close(cd);
- return -1;
- }
- }
-
- for (i = 0x80; i < 0xFFFF; ++i) {
- uchar eucBuf[3];
- dmapSrc[0]=i;
- inBuf=(char *) dmapSrc;
- inBytesLeft=2;
- outBuf=(char *) eucBuf;
- outBytesLeft=sizeof(eucBuf);
- errno=0;
- if ((len = iconv(cd, &inBuf, &inBytesLeft, &outBuf, &outBytesLeft)) != (size_t) 0) {
- if (len == 1 && errno == 0 && inBytesLeft == 0 && outBytesLeft == 1) { /* substitution occurred. */ continue;
- }
-
- if (errno == EILSEQ) {
-#ifdef DEBUG
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(), errno = %d in %s at %d\n",
- to, from, idx, errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WO_TIME, "inBytesLeft=%d, outBytesLeft=%d\n", inBytesLeft, outBytesLeft);
- if (inBuf - (char *) dmapSrc > 1 && inBuf - (char *) dmapSrc <= sizeof(dmapSrc) - 2)
- MyPrintf(STDERR_WO_TIME, "inBuf[-2..2]=%02X%02X%02X%02X%02X\n", inBuf[-2],inBuf[-1],inBuf[0],inBuf[1],inBuf[2]);
- else
- MyPrintf(STDERR_WO_TIME, "inBuf[0..2]=%02X%02X%02X\n", inBuf[0],inBuf[1],inBuf[2]);
- if (outBuf - (char *) dmap_rec[idx].dmapU2M2 > 1)
- MyPrintf(STDERR_WO_TIME, "outBuf[-2..2]=%02X%02X%02X%02X%02X\n", outBuf[-2],outBuf[-1],outBuf[0],outBuf[1],outBuf[2]);
- else
- MyPrintf(STDERR_WO_TIME, "outBuf[0..2]=%02X%02X%02X\n", outBuf[0],outBuf[1],outBuf[2]);
- }
-#endif
- inBuf+=2;
- inBytesLeft-=2;
- memcpy(outBuf, (char *) &(myconv_rec[idx].subD), 2);
- outBuf+=2;
- outBytesLeft-=2;
- } else {
-#ifdef DEBUG
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(), rc = %d, errno = %d in %s at %d\n",
- to, from, idx, len, errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WITH_TIME,
- "%04X: src=%04X%04X, inBuf=0x%02X%02X, inBytesLeft=%d, outBuf[-2..0]=%02X%02X%02X, outBytesLeft=%d\n",
- i, dmapSrc[0], dmapSrc[1], inBuf[0], inBuf[1],
- inBytesLeft, outBuf[-2], outBuf[-1], outBuf[0], outBytesLeft);
- MyPrintf(STDERR_WITH_TIME,
- "&dmapSrc=%p, inBuf=%p, dmapU2M2 + %d = %p, outBuf=%p\n",
- dmapSrc, inBuf, (i - 0x80) * 2, dmap_rec[idx].dmapU2M2 + (i - 0x80) * 2, outBuf);
- }
-#endif
- iconv_close(cd);
- return -1;
- }
- }
- if (sizeof(eucBuf) - outBytesLeft == 1) {
- if (i < 0x100) {
- (dmap_rec[idx].dmapU2S)[i]=eucBuf[0];
- } else {
- dmap_rec[idx].dmapU2M2[(i - 0x80) * 2] = eucBuf[0];
- dmap_rec[idx].dmapU2M2[(i - 0x80) * 2 + 1] = 0x00;
- }
- } else if (sizeof(eucBuf) - outBytesLeft == 2) { /* 2 bytes */
- dmap_rec[idx].dmapU2M2[(i - 0x80) * 2] = eucBuf[0];
- dmap_rec[idx].dmapU2M2[(i - 0x80) * 2 + 1] = eucBuf[1];
- } else if (sizeof(eucBuf) - outBytesLeft == 3) { /* 3 byte SS2/SS3 */
- dmap_rec[idx].dmapU2M3[(i - 0x80) * 3] = eucBuf[0];
- dmap_rec[idx].dmapU2M3[(i - 0x80) * 3 + 1] = eucBuf[1];
- dmap_rec[idx].dmapU2M3[(i - 0x80) * 3 + 2] = eucBuf[2];
- } else {
-#ifdef DEBUG
- if (myconvDebug) {
- MyPrintf(STDERR_WITH_TIME,
- "dmap_open(%s,%s,%d) failed to initialize with iconv(), rc=%d, errno=%d in %s at %d\n",
- to, from, idx, len, errno, __FILE__,__LINE__);
- MyPrintf(STDERR_WITH_TIME,
- "%04X: src=%04X%04X, inBuf=0x%02X%02X, inBytesLeft=%d, outBuf=%02X%02X%02X, outBytesLeft=%d\n",
- i, dmapSrc[0], dmapSrc[1], inBuf[0], inBuf[1],
- inBytesLeft, outBuf[-2], outBuf[-1], outBuf[0], outBytesLeft);
- MyPrintf(STDERR_WITH_TIME,
- "&dmapSrc=%p, inBuf=%p, %p, outBuf=%p\n",
- dmapSrc, inBuf, dmap_rec[idx].dmapU2M3 + (i - 0x80) * 2, outBuf);
- }
-#endif
- return -1;
- }
-
- }
- iconv_close(cd);
- }
-
- } else if (myconvIsUTF16(from) && myconvIsUTF8(to)) {
- dmap_rec[idx].codingSchema = DMAP_T28;
-
- } else if (myconvIsUCS2(from) && myconvIsUTF8(to)) {
- dmap_rec[idx].codingSchema = DMAP_U28;
-
- } else if (myconvIsUTF8(from) && myconvIsUnicode2(to)) {
- dmap_rec[idx].codingSchema = DMAP_82U;
-
- } else if (myconvIsUnicode2(from) && myconvIsUnicode2(to)) {
- dmap_rec[idx].codingSchema = DMAP_U2U;
-
- } else {
-
- return -1;
- }
- myconv_rec[idx].cnv_dmap=&(dmap_rec[idx]);
- return 0;
-}
-
-
-
-static int bins_open(const char * to,
- const char * from,
- const int32_t idx)
-{
- return -1;
-}
-
-
-
-static int32_t dmap_close(const int32_t idx)
-{
- if (dmap_rec[idx].codingSchema == DMAP_S2S) {
- if (dmap_rec[idx].dmapS2S != NULL) {
- dmap_rec[idx].dmapS2S=NULL;
- }
- } else if (dmap_rec[idx].codingSchema = DMAP_E2U) {
- if (dmap_rec[idx].dmapE02U != NULL) {
- dmap_rec[idx].dmapE02U=NULL;
- }
- if (dmap_rec[idx].dmapE12U != NULL) {
- dmap_rec[idx].dmapE12U=NULL;
- }
- if (dmap_rec[idx].dmapE22U != NULL) {
- dmap_rec[idx].dmapE22U=NULL;
- }
- if (dmap_rec[idx].dmapE32U != NULL) {
- dmap_rec[idx].dmapE32U=NULL;
- }
- }
-
- return 0;
-}
-
-
-static int32_t bins_close(const int32_t idx)
-{
- return 0;
-}
-
-
-myconv_t myconv_open(const char * toCode,
- const char * fromCode,
- int32_t converter)
-{
- int32 i;
- for (i = 0; i < MAX_CONVERTER; ++i) {
- if (myconv_rec[i].converterType == 0)
- break;
- }
- if (i >= MAX_CONVERTER)
- return ((myconv_t) -1);
-
- myconv_rec[i].converterType = converter;
- myconv_rec[i].index=i;
- myconv_rec[i].fromCcsid=cstoccsid(fromCode);
- if (myconv_rec[i].fromCcsid == 0 && memcmp(fromCode, "big5",5) == 0)
- myconv_rec[i].fromCcsid=950;
- myconv_rec[i].toCcsid=cstoccsid(toCode);
- if (myconv_rec[i].toCcsid == 0 && memcmp(toCode, "big5",5) == 0)
- myconv_rec[i].toCcsid=950;
- strncpy(myconv_rec[i].from, fromCode, sizeof(myconv_rec[i].from)-1);
- strncpy(myconv_rec[i].to, toCode, sizeof(myconv_rec[i].to)-1);
-
- if (converter == CONVERTER_ICONV) {
- if ((myconv_rec[i].cnv_iconv=iconv_open(toCode, fromCode)) == (iconv_t) -1) {
- return ((myconv_t) -1);
- }
- myconv_rec[i].allocatedSize = -1;
- myconv_rec[i].srcSubS=myconvGetSubS(fromCode);
- myconv_rec[i].srcSubD=myconvGetSubD(fromCode);
- myconv_rec[i].subS=myconvGetSubS(toCode);
- myconv_rec[i].subD=myconvGetSubD(toCode);
- return &(myconv_rec[i]);
- } else if (converter == CONVERTER_DMAP &&
- dmap_open(toCode, fromCode, i) != -1) {
- return &(myconv_rec[i]);
- }
- return ((myconv_t) -1);
-}
-
-
-
-int32_t myconv_close(myconv_t cd)
-{
- int32_t ret=0;
-
- if (cd->converterType == CONVERTER_ICONV) {
- ret=iconv_close(cd->cnv_iconv);
- } else if (cd->converterType == CONVERTER_DMAP) {
- ret=dmap_close(cd->index);
- }
- memset(&(myconv_rec[cd->index]), 0x00, sizeof(myconv_rec[cd->index]));
- return ret;
-}
-
-
-
-
-/* reference: http://www-306.ibm.com/software/globalization/other/es.jsp */
-/* systemCL would be expensive, and myconvIsXXXXX is called frequently.
- need to cache entries */
-#define MAX_CCSID 256
-static int ccsidList [MAX_CCSID];
-static int esList [MAX_CCSID];
-int32 getEncodingScheme(const uint16 inCcsid, int32& outEncodingScheme);
-EXTERN int myconvGetES(CCSID ccsid)
-{
- /* call QtqValidateCCSID in ILE to get encoding schema */
- /* return QtqValidateCCSID(ccsid); */
- int i;
- for (i = 0; i < MAX_CCSID; ++i) {
- if (ccsidList[i] == ccsid)
- return esList[i];
- if (ccsidList[i] == 0x00)
- break;
- }
-
- if (i >= MAX_CCSID) {
- i=MAX_CCSID-1;
- }
-
- {
- ccsidList[i]=ccsid;
- getEncodingScheme(ccsid, esList[i]);
-#ifdef DEBUG_PASE
- if (myconvDebug) {
- fprintf(stderr, "CCSID=%d, ES=0x%04X\n", ccsid, esList[i]);
- }
-#endif
- return esList[i];
- }
- return 0;
-}
-
-
-EXTERN int myconvIsEBCDIC(const char * pName)
-{
- int es = myconvGetES(cstoccsid(pName));
- if (es == 0x1100 ||
- es == 0x1200 ||
- es == 0x6100 ||
- es == 0x6200 ||
- es == 0x1301 ) {
- return TRUE;
- }
- return FALSE;
-}
-
-
-EXTERN int myconvIsISO(const char * pName)
-{
- int es = myconvGetES(cstoccsid(pName));
- if (es == 0x4100 ||
- es == 0x4105 ||
- es == 0x4155 ||
- es == 0x5100 ||
- es == 0x5150 ||
- es == 0x5200 ||
- es == 0x5404 ||
- es == 0x5409 ||
- es == 0x540A ||
- es == 0x5700) {
- return TRUE;
- }
- return FALSE;
-}
-
-
-EXTERN int myconvIsASCII(const char * pName)
-{
- int es = myconvGetES(cstoccsid(pName));
- if (es == 0x2100 ||
- es == 0x3100 ||
- es == 0x8100 ||
- es == 0x2200 ||
- es == 0x3200 ||
- es == 0x9200 ||
- es == 0x2300 ||
- es == 0x2305 ||
- es == 0x3300 ||
- es == 0x2900 ||
- es == 0x2A00) {
- return TRUE;
- } else if (memcmp(pName, "big5", 5) == 0) {
- return TRUE;
- }
- return FALSE;
-}
-
-
-
-EXTERN int myconvIsUCS2(const char * pName)
-{
- if (cstoccsid(pName) == 13488) {
- return TRUE;
- }
- return FALSE;
-}
-
-
-EXTERN int myconvIsUTF16(const char * pName)
-{
- if (cstoccsid(pName) == 1200) {
- return TRUE;
- }
- return FALSE;
-}
-
-
-EXTERN int myconvIsUnicode2(const char * pName)
-{
- int es = myconvGetES(cstoccsid(pName));
- if (es == 0x7200 ||
- es == 0x720B ||
- es == 0x720F) {
- return TRUE;
- }
- return FALSE;
-}
-
-
-EXTERN int myconvIsUTF8(const char * pName)
-{
- int es = myconvGetES(cstoccsid(pName));
- if (es == 0x7807) {
- return TRUE;
- }
- return FALSE;
-}
-
-
-EXTERN int myconvIsUnicode(const char * pName)
-{
- int es = myconvGetES(cstoccsid(pName));
- if (es == 0x7200 ||
- es == 0x720B ||
- es == 0x720F ||
- es == 0x7807) {
- return TRUE;
- }
- return FALSE;
-}
-
-
-EXTERN int myconvIsEUC(const char * pName)
-{
- int es = myconvGetES(cstoccsid(pName));
- if (es == 0x4403) {
- return TRUE;
- }
- return FALSE;
-}
-
-
-EXTERN int myconvIsDBCS(const char * pName)
-{
- int es = myconvGetES(cstoccsid(pName));
- if (es == 0x1200 ||
- es == 0x2200 ||
- es == 0x2300 ||
- es == 0x2305 ||
- es == 0x2A00 ||
- es == 0x3200 ||
- es == 0x3300 ||
- es == 0x5200 ||
- es == 0x6200 ||
- es == 0x9200) {
- return TRUE;
- } else if (memcmp(pName, "big5", 5) == 0) {
- return TRUE;
- }
- return FALSE;
-}
-
-
-EXTERN int myconvIsSBCS(const char * pName)
-{
- int es = myconvGetES(cstoccsid(pName));
- if (es == 0x1100 ||
- es == 0x2100 ||
- es == 0x3100 ||
- es == 0x4100 ||
- es == 0x4105 ||
- es == 0x5100 ||
- es == 0x5150 ||
- es == 0x6100 ||
- es == 0x8100) {
- return TRUE;
- }
- return FALSE;
-}
-
-
-
-EXTERN char myconvGetSubS(const char * code)
-{
- if (myconvIsEBCDIC(code)) {
- return 0x3F;
- } else if (myconvIsASCII(code)) {
- return 0x1A;
- } else if (myconvIsISO(code)) {
- return 0x1A;
- } else if (myconvIsEUC(code)) {
- return 0x1A;
- } else if (myconvIsUCS2(code)) {
- return 0x00;
- } else if (myconvIsUTF8(code)) {
- return 0x1A;
- }
- return 0x00;
-}
-
-
-EXTERN UniChar myconvGetSubD(const char * code)
-{
- if (myconvIsEBCDIC(code)) {
- return 0xFDFD;
- } else if (myconvIsASCII(code)) {
- return 0xFCFC;
- } else if (myconvIsISO(code)) {
- return 0x00;
- } else if (myconvIsEUC(code)) {
- return 0x00;
- } else if (myconvIsUCS2(code)) {
- return 0xFFFD;
- } else if (myconvIsUTF8(code)) {
- return 0x00;
- }
- return 0x00;
-}
-
diff --git a/storage/ibmdb2i/db2i_myconv.h b/storage/ibmdb2i/db2i_myconv.h
deleted file mode 100644
index 98032748148..00000000000
--- a/storage/ibmdb2i/db2i_myconv.h
+++ /dev/null
@@ -1,3201 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-/**
- @file
-
- @brief A direct map optimization of iconv and related functions
- This was show to significantly reduce character conversion cost
- for short strings when compared to calling iconv system code.
-*/
-
-#ifndef DB2I_MYCONV_H
-#define DB2I_MYCONV_H
-
-
-#include <sys/time.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <wchar.h>
-#include <errno.h>
-#include <iconv.h>
-#include <ctype.h>
-#include <time.h>
-#include <stdarg.h>
-#include <string.h>
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifdef __cplusplus
-#define INTERN inline
-#define EXTERN extern "C"
-#else
-#define INTERN static
-#define EXTERN extern
-#endif
-
-
-/* ANSI integer data types */
-#if defined(__OS400_TGTVRM__)
-/* for DTAMDL(*P128), datamodel(P128): int/long/pointer=4/4/16 */
-/* LLP64:4/4/8 is used for teraspace ?? */
-typedef short int16_t;
-typedef unsigned short uint16_t;
-typedef int int32_t;
-typedef unsigned int uint32_t;
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-#elif defined(PASE)
-/* PASE uses IPL32: int/long/pointer=4/4/4 + long long */
-#elif defined(__64BIT__)
-/* AIX 64 bit uses LP64: int/long/pointer=4/8/8 */
-#endif
-
-#define CONVERTER_ICONV 1
-#define CONVERTER_DMAP 2
-
-#define DMAP_S2S 10
-#define DMAP_S2U 20
-#define DMAP_D2U 30
-#define DMAP_E2U 40
-#define DMAP_U2S 120
-#define DMAP_T2S 125
-#define DMAP_U2D 130
-#define DMAP_T2D 135
-#define DMAP_U2E 140
-#define DMAP_T2E 145
-#define DMAP_S28 220
-#define DMAP_D28 230
-#define DMAP_E28 240
-#define DMAP_82S 310
-#define DMAP_82D 320
-#define DMAP_82E 330
-#define DMAP_U28 410
-#define DMAP_82U 420
-#define DMAP_T28 425
-#define DMAP_U2U 510
-
-
-typedef struct __dmap_rec *dmap_t;
-
-struct __dmap_rec
-{
- uint32_t codingSchema;
- unsigned char * dmapS2S; /* SBCS -> SBCS */
- /* The following conversion needs be followed by conversion from UCS-2/UTF-16 to UTF-8 */
- UniChar * dmapD12U; /* DBCS(non-EUC) -> UCS-2/UTF-16 */
- UniChar * dmapD22U; /* DBCS(non-EUC) -> UCS-2/UTF-16 */
- UniChar * dmapE02U; /* EUC/SS0 -> UCS-2/UTF-16 */
- UniChar * dmapE12U; /* EUC/SS1 -> UCS-2/UTF-16 */
- UniChar * dmapE22U; /* EUC/0x8E + SS2 -> UCS-2/UTF-16 */
- UniChar * dmapE32U; /* EUC/0x8F + SS3 -> UCS-2/UTF-16 */
- uchar * dmapU2D; /* UCS-2 -> DBCS */
- uchar * dmapU2S; /* UCS-2 -> EUC SS0 */
- uchar * dmapU2M2; /* UCS-2 -> EUC SS1 */
- uchar * dmapU2M3; /* UCS-2 -> EUC SS2/SS3 */
- /* All of these pointers/tables are not used at the same time.
- * You may be able save some space if you consolidate them.
- */
- uchar * dmapS28; /* SBCS -> UTF-8 */
- uchar * dmapD28; /* DBCS -> UTF-8 */
-};
-
-typedef struct __myconv_rec *myconv_t;
-struct __myconv_rec
-{
- uint32_t converterType;
- uint32_t index; /* for close */
- union {
- iconv_t cnv_iconv;
- dmap_t cnv_dmap;
- };
- int32_t allocatedSize;
- int32_t fromCcsid;
- int32_t toCcsid;
- UniChar subD; /* DBCS substitution char */
- char subS; /* SBCS substitution char */
- UniChar srcSubD; /* DBCS substitution char of src codepage */
- char srcSubS; /* SBCS substitution char of src codepage */
- char from [41+1]; /* codepage name is up to 41 bytes */
- char to [41+1]; /* codepage name is up to 41 bytes */
-#ifdef __64BIT__
- char reserved[10]; /* align 128 */
-#else
- char reserved[14]; /* align 128 */
-#endif
-};
-
-
-EXTERN int32_t myconvDebug;
-
-
-
-EXTERN int myconvGetES(CCSID);
-EXTERN int myconvIsEBCDIC(const char *);
-EXTERN int myconvIsASCII(const char *);
-EXTERN int myconvIsUnicode(const char *); /* UTF-8, UTF-16, or UCS-2 */
-EXTERN int myconvIsUnicode2(const char *); /* 2 byte Unicode */
-EXTERN int myconvIsUCS2(const char *);
-EXTERN int myconvIsUTF16(const char *);
-EXTERN int myconvIsUTF8(const char *);
-EXTERN int myconvIsEUC(const char *);
-EXTERN int myconvIsISO(const char *);
-EXTERN int myconvIsSBCS(const char *);
-EXTERN int myconvIsDBCS(const char *);
-EXTERN char myconvGetSubS(const char *);
-EXTERN UniChar myconvGetSubD(const char *);
-
-
-EXTERN myconv_t myconv_open(const char*, const char*, int32_t);
-EXTERN int myconv_close(myconv_t);
-
-INTERN size_t myconv_iconv(myconv_t cd ,
- char** inBuf,
- size_t* inBytesLeft,
- char** outBuf,
- size_t* outBytesLeft,
- size_t* numSub)
-{
- return iconv(cd->cnv_iconv, inBuf, inBytesLeft, outBuf, outBytesLeft);
-}
-
-INTERN size_t myconv_dmap(myconv_t cd,
- char** inBuf,
- size_t* inBytesLeft,
- char** outBuf,
- size_t* outBytesLeft,
- size_t* numSub)
-{
- if (cd->cnv_dmap->codingSchema == DMAP_S2S) {
- register unsigned char * dmapS2S=cd->cnv_dmap->dmapS2S;
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register char subS=cd->subS;
- register size_t numS=0;
- while (0 < inLen) {
- if (pLastOutBuf < pOut)
- break;
- if (*pIn == 0x00) {
- *pOut=0x00;
- } else {
- *pOut=dmapS2S[*pIn];
- if (*pOut == 0x00) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(*inBytesLeft-inLen);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- if (*pOut == subS) {
- if ((*pOut=dmapS2S[*pIn]) == subS) {
- if (*pIn != cd->srcSubS)
- ++numS;
- }
- }
- }
- ++pIn;
- --inLen;
- ++pOut;
- }
- *outBytesLeft-=(*inBytesLeft-inLen);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_E2U) {
- /* use uchar * instead of UniChar to avoid memcpy */
- register uchar * dmapE02U=(uchar *) (cd->cnv_dmap->dmapE02U);
- register uchar * dmapE12U=(uchar *) (cd->cnv_dmap->dmapE12U);
- register uchar * dmapE22U=(uchar *) (cd->cnv_dmap->dmapE22U);
- register uchar * dmapE32U=(uchar *) (cd->cnv_dmap->dmapE32U);
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register int offset;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register size_t numS=0;
- while (0 < inLen) {
- if (pLastOutBuf < pOut)
- break;
- if (*pIn == 0x00) {
- *pOut=0x00;
- ++pOut;
- *pOut=0x00;
- ++pOut;
- ++pIn;
- --inLen;
- } else {
- if (*pIn == 0x8E) { /* SS2 */
- if (inLen < 2) {
- if (cd->fromCcsid == 33722 || /* IBM-eucJP */
- cd->fromCcsid == 964) /* IBM-eucTW */
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- ++pIn;
- if (*pIn < 0xA0) {
- if (cd->fromCcsid == 964) /* IBM-eucTW */
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- offset=(*pIn - 0xA0);
- offset<<=1;
- if (dmapE22U[offset] == 0x00 &&
- dmapE22U[offset+1] == 0x00) { /* 2 bytes */
- if (inLen < 3) {
- if (cd->fromCcsid == 964) /* IBM-eucTW */
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- offset=(*pIn - 0xA0) * 0x60 + 0x60;
- ++pIn;
- if (*pIn < 0xA0) {
- if (cd->fromCcsid == 964) /* IBM-eucTW */
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-2;
- return -1;
- }
- offset+=(*pIn - 0xA0);
- offset<<=1;
- if (dmapE22U[offset] == 0x00 &&
- dmapE22U[offset+1] == 0x00) {
- if (cd->fromCcsid == 964) /* IBM-eucTW */
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-2;
- return -1;
- }
- *pOut=dmapE22U[offset];
- ++pOut;
- *pOut=dmapE22U[offset+1];
- ++pOut;
- if (dmapE22U[offset] == 0xFF &&
- dmapE22U[offset+1] == 0xFD) {
- if (pIn[-2] * 0x100 + pIn[-1] != cd->srcSubD)
- ++numS;
- }
- ++pIn;
- inLen-=3;
- } else { /* 1 bytes */
- *pOut=dmapE22U[offset];
- ++pOut;
- *pOut=dmapE22U[offset+1];
- ++pOut;
- ++pIn;
- inLen-=2;
- }
- } else if (*pIn == 0x8F) { /* SS3 */
- if (inLen < 2) {
- if (cd->fromCcsid == 33722) /* IBM-eucJP */
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- ++pIn;
- if (*pIn < 0xA0) {
- if (cd->fromCcsid == 970 || /* IBM-eucKR */
- cd->fromCcsid == 964 || /* IBM-eucTW */
- cd->fromCcsid == 1383 || /* IBM-eucCN */
- (cd->fromCcsid == 33722 && 3 <= inLen)) /* IBM-eucJP */
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- offset=(*pIn - 0xA0);
- offset<<=1;
- if (dmapE32U[offset] == 0x00 &&
- dmapE32U[offset+1] == 0x00) { /* 0x8F + 2 bytes */
- if (inLen < 3) {
- if (cd->fromCcsid == 33722)
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- offset=(*pIn - 0xA0) * 0x60 + 0x60;
- ++pIn;
- if (*pIn < 0xA0) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-2;
- return -1;
- }
- offset+=(*pIn - 0xA0);
- offset<<=1;
- if (dmapE32U[offset] == 0x00 &&
- dmapE32U[offset+1] == 0x00) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-2;
- return -1;
- }
- *pOut=dmapE32U[offset];
- ++pOut;
- *pOut=dmapE32U[offset+1];
- ++pOut;
- if (dmapE32U[offset] == 0xFF &&
- dmapE32U[offset+1] == 0xFD) {
- if (pIn[-2] * 0x100 + pIn[-1] != cd->srcSubD)
- ++numS;
- }
- ++pIn;
- inLen-=3;
- } else { /* 0x8F + 1 bytes */
- *pOut=dmapE32U[offset];
- ++pOut;
- *pOut=dmapE32U[offset+1];
- ++pOut;
- ++pIn;
- inLen-=2;
- }
-
- } else {
- offset=*pIn;
- offset<<=1;
- if (dmapE02U[offset] == 0x00 &&
- dmapE02U[offset+1] == 0x00) { /* SS1 */
- if (inLen < 2) {
- if ((cd->fromCcsid == 33722 && (*pIn == 0xA0 || (0xA9 <= *pIn && *pIn <= 0xAF) || *pIn == 0xFF)) ||
- (cd->fromCcsid == 970 && (*pIn == 0xA0 || *pIn == 0xAD || *pIn == 0xAE || *pIn == 0xAF || *pIn == 0xFF)) ||
- (cd->fromCcsid == 964 && (*pIn == 0xA0 || (0xAA <= *pIn && *pIn <= 0xC1) || *pIn == 0xC3 || *pIn == 0xFE || *pIn == 0xFF)) ||
- (cd->fromCcsid == 1383 && (*pIn == 0xA0 || *pIn == 0xFF)))
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- if (*pIn < 0xA0) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- offset=(*pIn - 0xA0) * 0x60;
- ++pIn;
- if (*pIn < 0xA0) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- offset+=(*pIn - 0xA0);
- offset<<=1;
- if (dmapE12U[offset] == 0x00 &&
- dmapE12U[offset+1] == 0x00) { /* undefined mapping */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- *pOut=dmapE12U[offset];
- ++pOut;
- *pOut=dmapE12U[offset+1];
- ++pOut;
- if (dmapE12U[offset] == 0xFF &&
- dmapE12U[offset+1] == 0xFD) {
- if (pIn[-1] * 0x100 + pIn[0] != cd->srcSubD)
- ++numS;
- }
- ++pIn;
- inLen-=2;
- } else {
- *pOut=dmapE02U[offset];
- ++pOut;
- *pOut=dmapE02U[offset+1];
- ++pOut;
- if (dmapE02U[offset] == 0x00 &&
- dmapE02U[offset+1] == 0x1A) {
- if (*pIn != cd->srcSubS)
- ++numS;
- }
- ++pIn;
- --inLen;
- }
- }
- }
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0;
-
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_E28) {
- /* use uchar * instead of UniChar to avoid memcpy */
- register uchar * dmapE02U=(uchar *) (cd->cnv_dmap->dmapE02U);
- register uchar * dmapE12U=(uchar *) (cd->cnv_dmap->dmapE12U);
- register uchar * dmapE22U=(uchar *) (cd->cnv_dmap->dmapE22U);
- register uchar * dmapE32U=(uchar *) (cd->cnv_dmap->dmapE32U);
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register int offset;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register size_t numS=0;
- register UniChar in; /* copy part of U28 */
- register UniChar ucs2;
- while (0 < inLen) {
- if (pLastOutBuf < pOut)
- break;
- if (*pIn == 0x00) {
- *pOut=0x00;
- ++pOut;
- ++pIn;
- --inLen;
- } else {
- if (*pIn == 0x8E) { /* SS2 */
- if (inLen < 2) {
- if (cd->fromCcsid == 33722 || /* IBM-eucJP */
- cd->fromCcsid == 964) /* IBM-eucTW */
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- ++pIn;
- if (*pIn < 0xA0) {
- if (cd->fromCcsid == 964) /* IBM-eucTW */
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- offset=(*pIn - 0xA0);
- offset<<=1;
- if (dmapE22U[offset] == 0x00 &&
- dmapE22U[offset+1] == 0x00) { /* 2 bytes */
- if (inLen < 3) {
- if (cd->fromCcsid == 964) /* IBM-eucTW */
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- offset=(*pIn - 0xA0) * 0x60 + 0x60;
- ++pIn;
- if (*pIn < 0xA0) {
- if (cd->fromCcsid == 964) /* IBM-eucTW */
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-2;
- return -1;
- }
- offset+=(*pIn - 0xA0);
- offset<<=1;
- if (dmapE22U[offset] == 0x00 &&
- dmapE22U[offset+1] == 0x00) {
- if (cd->fromCcsid == 964) /* IBM-eucTW */
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-2;
- return -1;
- }
- in=dmapE22U[offset];
- in<<=8;
- in+=dmapE22U[offset+1];
- if (dmapE22U[offset] == 0xFF &&
- dmapE22U[offset+1] == 0xFD) {
- if (pIn[-2] * 0x100 + pIn[-1] != cd->srcSubD)
- ++numS;
- }
- ++pIn;
- inLen-=3;
- } else { /* 1 bytes */
- in=dmapE22U[offset];
- in<<=8;
- in+=dmapE22U[offset+1];
- ++pIn;
- inLen-=2;
- }
- } else if (*pIn == 0x8F) { /* SS3 */
- if (inLen < 2) {
- if (cd->fromCcsid == 33722) /* IBM-eucJP */
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- ++pIn;
- if (*pIn < 0xA0) {
- if (cd->fromCcsid == 970 || /* IBM-eucKR */
- cd->fromCcsid == 964 || /* IBM-eucTW */
- cd->fromCcsid == 1383 || /* IBM-eucCN */
- (cd->fromCcsid == 33722 && 3 <= inLen)) /* IBM-eucJP */
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- offset=(*pIn - 0xA0);
- offset<<=1;
- if (dmapE32U[offset] == 0x00 &&
- dmapE32U[offset+1] == 0x00) { /* 0x8F + 2 bytes */
- if (inLen < 3) {
- if (cd->fromCcsid == 33722)
- errno=EINVAL; /* 22 */
- else
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- offset=(*pIn - 0xA0) * 0x60 + 0x60;
- ++pIn;
- if (*pIn < 0xA0) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-2;
- return -1;
- }
- offset+=(*pIn - 0xA0);
- offset<<=1;
- if (dmapE32U[offset] == 0x00 &&
- dmapE32U[offset+1] == 0x00) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-2;
- return -1;
- }
- in=dmapE32U[offset];
- in<<=8;
- in+=dmapE32U[offset+1];
- if (dmapE32U[offset] == 0xFF &&
- dmapE32U[offset+1] == 0xFD) {
- if (pIn[-2] * 0x100 + pIn[-1] != cd->srcSubD)
- ++numS;
- }
- ++pIn;
- inLen-=3;
- } else { /* 0x8F + 1 bytes */
- in=dmapE32U[offset];
- in<<=8;
- in+=dmapE32U[offset+1];
- ++pIn;
- inLen-=2;
- }
-
- } else {
- offset=*pIn;
- offset<<=1;
- if (dmapE02U[offset] == 0x00 &&
- dmapE02U[offset+1] == 0x00) { /* SS1 */
- if (inLen < 2) {
- if ((cd->fromCcsid == 33722 && (*pIn == 0xA0 || (0xA9 <= *pIn && *pIn <= 0xAF) || *pIn == 0xFF)) ||
- (cd->fromCcsid == 970 && (*pIn == 0xA0 || *pIn == 0xAD || *pIn == 0xAE || *pIn == 0xAF || *pIn == 0xFF)) ||
- (cd->fromCcsid == 964 && (*pIn == 0xA0 || (0xAA <= *pIn && *pIn <= 0xC1) || *pIn == 0xC3 || *pIn == 0xFE || *pIn == 0xFF)) ||
- (cd->fromCcsid == 1383 && (*pIn == 0xA0 || *pIn == 0xFF)))
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- if (*pIn < 0xA0) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- offset=(*pIn - 0xA0) * 0x60;
- ++pIn;
- if (*pIn < 0xA0) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- offset+=(*pIn - 0xA0);
- offset<<=1;
- if (dmapE12U[offset] == 0x00 &&
- dmapE12U[offset+1] == 0x00) { /* undefined mapping */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- in=dmapE12U[offset];
- in<<=8;
- in+=dmapE12U[offset+1];
- if (dmapE12U[offset] == 0xFF &&
- dmapE12U[offset+1] == 0xFD) {
- if (pIn[-1] * 0x100 + pIn[0] != cd->srcSubD)
- ++numS;
- }
- ++pIn;
- inLen-=2;
- } else {
- in=dmapE02U[offset];
- in<<=8;
- in+=dmapE02U[offset+1];
- if (dmapE02U[offset] == 0x00 &&
- dmapE02U[offset+1] == 0x1A) {
- if (*pIn != cd->srcSubS)
- ++numS;
- }
- ++pIn;
- --inLen;
- }
- }
- ucs2=in;
- if ((in & 0xFF80) == 0x0000) { /* U28: in & 0b1111111110000000 == 0x0000 */
- *pOut=in;
- ++pOut;
- } else if ((in & 0xF800) == 0x0000) { /* in & 0b1111100000000000 == 0x0000 */
- register uchar byte;
- in>>=6;
- in&=0x001F; /* 0b0000000000011111 */
- in|=0x00C0; /* 0b0000000011000000 */
- *pOut=in;
- ++pOut;
- byte=ucs2; /* dmapD12U[offset+1]; */
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
- } else if ((in & 0xFC00) == 0xD800) {
- *pOut=0xEF;
- ++pOut;
- *pOut=0xBF;
- ++pOut;
- *pOut=0xBD;
- ++pOut;
- } else {
- register uchar byte;
- register uchar work;
- byte=(ucs2>>8); /* dmapD12U[offset]; */
- byte>>=4;
- byte|=0xE0; /* 0b11100000; */
- *pOut=byte;
- ++pOut;
-
- byte=(ucs2>>8); /* dmapD12U[offset]; */
- byte<<=2;
- work=ucs2; /* dmapD12U[offset+1]; */
- work>>=6;
- byte|=work;
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
-
- byte=ucs2; /* dmapD12U[offset+1]; */
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
- }
- /* end of U28 */
- }
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_U2E) {
- register uchar * dmapU2S=cd->cnv_dmap->dmapU2S;
- register uchar * dmapU2M2=cd->cnv_dmap->dmapU2M2 - 0x80 * 2;
- register uchar * dmapU2M3=cd->cnv_dmap->dmapU2M3 - 0x80 * 3;
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register char subS=cd->subS;
- register char * pSubD=(char *) &(cd->subD);
- register size_t numS=0;
- register size_t rc=0;
- while (0 < inLen) {
- register uint32_t in;
- if (inLen == 1) {
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- if (pLastOutBuf < pOut)
- break;
- in=pIn[0];
- in<<=8;
- in+=pIn[1];
- if (in == 0x0000) {
- *pOut=0x00;
- ++pOut;
- } else if (in < 0x100 && dmapU2S[in] != 0x0000) {
- if ((*pOut=dmapU2S[in]) == subS) {
- if (in != cd->srcSubS)
- ++numS;
- }
- ++pOut;
- } else {
- in<<=1;
- if (dmapU2M2[in] == 0x00) { /* not found in dmapU2M2 */
- in*=1.5;
- if (dmapU2M3[in] == 0x00) { /* not found in dmapU2M3*/
- *pOut=pSubD[0];
- ++pOut;
- *pOut=pSubD[1];
- ++pOut;
- ++numS;
- ++rc;
- } else {
- *pOut=dmapU2M3[in];
- ++pOut;
- *pOut=dmapU2M3[1+in];
- ++pOut;
- *pOut=dmapU2M3[2+in];
- ++pOut;
- }
- } else {
- *pOut=dmapU2M2[in];
- ++pOut;
- if (dmapU2M2[1+in] == 0x00) {
- if (*pOut == subS) {
- in>>=1;
- if (in != cd->srcSubS)
- ++numS;
- }
- } else {
- *pOut=dmapU2M2[1+in];
- ++pOut;
- if (memcmp(pOut-2, pSubD, 2) == 0) {
- in>>=1;
- if (in != cd->srcSubD) {
- ++numS;
- ++rc;
- }
- }
- }
- }
- }
- pIn+=2;
- inLen-=2;
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return rc; /* compatibility to iconv() */
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_T2E) {
- register uchar * dmapU2S=cd->cnv_dmap->dmapU2S;
- register uchar * dmapU2M2=cd->cnv_dmap->dmapU2M2 - 0x80 * 2;
- register uchar * dmapU2M3=cd->cnv_dmap->dmapU2M3 - 0x80 * 3;
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register char subS=cd->subS;
- register char * pSubD=(char *) &(cd->subD);
- register size_t numS=0;
- register size_t rc=0;
- while (0 < inLen) {
- register uint32_t in;
- if (inLen == 1) {
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen-1;
- *outBuf=pOut;
- *inBuf=pIn;
- ++numS;
- *numSub+=numS;
- return 0;
- }
- if (pLastOutBuf < pOut)
- break;
- in=pIn[0];
- in<<=8;
- in+=pIn[1];
- if (in == 0x0000) {
- *pOut=0x00;
- ++pOut;
- } else if (0xD800 <= in && in <= 0xDBFF) { /* first byte of surrogate */
- errno=EINVAL; /* 22 */
- *inBytesLeft=inLen-2;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn+2;
- ++numS;
- *numSub+=numS;
- return -1;
-
- } else if (0xDC00 <= in && in <= 0xDFFF) { /* second byte of surrogate */
- errno=EINVAL; /* 22 */
- *inBytesLeft=inLen-1;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn;
- ++numS;
- *numSub+=numS;
- return -1;
-
- } else if (in < 0x100 && dmapU2S[in] != 0x0000) {
- if ((*pOut=dmapU2S[in]) == subS) {
- if (in != cd->srcSubS)
- ++numS;
- }
- ++pOut;
- } else {
- in<<=1;
- if (dmapU2M2[in] == 0x00) { /* not found in dmapU2M2 */
- in*=1.5;
- if (dmapU2M3[in] == 0x00) { /* not found in dmapU2M3*/
- *pOut=pSubD[0];
- ++pOut;
- *pOut=pSubD[1];
- ++pOut;
- ++numS;
- ++rc;
- } else {
- *pOut=dmapU2M3[in];
- ++pOut;
- *pOut=dmapU2M3[1+in];
- ++pOut;
- *pOut=dmapU2M3[2+in];
- ++pOut;
- }
- } else {
- *pOut=dmapU2M2[in];
- ++pOut;
- if (dmapU2M2[1+in] == 0x00) {
- if (*pOut == subS) {
- in>>=1;
- if (in != cd->srcSubS)
- ++numS;
- }
- } else {
- *pOut=dmapU2M2[1+in];
- ++pOut;
- if (memcmp(pOut-2, pSubD, 2) == 0) {
- in>>=1;
- if (in != cd->srcSubD) {
- ++numS;
- ++rc;
- }
- }
- }
- }
- }
- pIn+=2;
- inLen-=2;
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_82E) {
- register uchar * dmapU2S=cd->cnv_dmap->dmapU2S;
- register uchar * dmapU2M2=cd->cnv_dmap->dmapU2M2 - 0x80 * 2;
- register uchar * dmapU2M3=cd->cnv_dmap->dmapU2M3 - 0x80 * 3;
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register char subS=cd->subS;
- register char * pSubD=(char *) &(cd->subD);
- register size_t numS=0;
- register size_t rc=0;
- while (0 < inLen) {
- register uint32_t in;
- uint32_t in2;
- if (pLastOutBuf < pOut)
- break;
- /* convert from UTF-8 to UCS-2 */
- if (*pIn == 0x00) {
- in=0x0000;
- ++pIn;
- --inLen;
- } else { /* 82U: */
- register uchar byte1=*pIn;
- if ((byte1 & 0x80) == 0x00) { /* if (byte1 & 0b10000000 == 0b00000000) { */
- /* 1 bytes sequence: 0xxxxxxx => 00000000 0xxxxxxx*/
- in=byte1;
- ++pIn;
- --inLen;
- } else if ((byte1 & 0xE0) == 0xC0) { /* (byte1 & 0b11100000 == 0b11000000) { */
- if (inLen < 2) {
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- if (byte1 == 0xC0 || byte1 == 0xC1) { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- /* 2 bytes sequence:
- 110yyyyy 10xxxxxx => 00000yyy yyxxxxxx */
- register uchar byte2;
- ++pIn;
- byte2=*pIn;
- if ((byte2 & 0xC0) == 0x80) { /* byte2 & 0b11000000 == 0b10000000) { */
- register uchar work=byte1;
- work<<=6;
- byte2&=0x3F; /* 0b00111111; */
- byte2|=work;
-
- byte1&=0x1F; /* 0b00011111; */
- byte1>>=2;
- in=byte1;
- in<<=8;
- in+=byte2;
- inLen-=2;
- ++pIn;
- } else { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- *numSub+=numS;
- return -1;
- }
- } else if ((byte1 & 0xF0) == 0xE0) { /* byte1 & 0b11110000 == 0b11100000 */
- /* 3 bytes sequence:
- 1110zzzz 10yyyyyy 10xxxxxx => zzzzyyyy yyxxxxxx */
- register uchar byte2;
- register uchar byte3;
- if (inLen < 3) {
- if (inLen == 2 && (pIn[1] & 0xC0) != 0x80)
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- ++pIn;
- byte2=*pIn;
- ++pIn;
- byte3=*pIn;
- if ((byte2 & 0xC0) != 0x80 ||
- (byte3 & 0xC0) != 0x80 ||
- (byte1 == 0xE0 && byte2 < 0xA0)) { /* invalid sequence, only 0xA0-0xBF allowed after 0xE0 */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-2;
- *numSub+=numS;
- return -1;
- }
- {
- register uchar work=byte2;
- work<<=6;
- byte3&=0x3F; /* 0b00111111; */
- byte3|=work;
-
- byte2&=0x3F; /* 0b00111111; */
- byte2>>=2;
-
- byte1<<=4;
- in=byte1 | byte2;;
- in<<=8;
- in+=byte3;
- inLen-=3;
- ++pIn;
- }
- } else if ((0xF0 <= byte1 && byte1 <= 0xF4)) { /* (bytes1 & 11111000) == 0x1110000 */
- /* 4 bytes sequence
- 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx => 110110ww wwzzzzyy 110111yy yyxxxxxx
- where uuuuu = wwww + 1 */
- register uchar byte2;
- register uchar byte3;
- register uchar byte4;
- if (inLen < 4) {
- if ((inLen >= 2 && (pIn[1] & 0xC0) != 0x80) ||
- (inLen >= 3 && (pIn[2] & 0xC0) != 0x80) ||
- (cd->toCcsid == 13488) )
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- ++pIn;
- byte2=*pIn;
- ++pIn;
- byte3=*pIn;
- ++pIn;
- byte4=*pIn;
- if ((byte2 & 0xC0) == 0x80 && /* byte2 & 0b11000000 == 0b10000000 */
- (byte3 & 0xC0) == 0x80 && /* byte3 & 0b11000000 == 0b10000000 */
- (byte4 & 0xC0) == 0x80) { /* byte4 & 0b11000000 == 0b10000000 */
- register uchar work=byte2;
- if (byte1 == 0xF0 && byte2 < 0x90) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-3;
- *numSub+=numS;
- return -1;
- /* iconv() returns 0 for 0xF4908080 and convert to 0x00
- } else if (byte1 == 0xF4 && byte2 > 0x8F) {
- errno=EINVAL;
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-3;
- *numSub+=numS;
- return -1;
- */
- }
-
- work&=0x30; /* 0b00110000; */
- work>>=4;
- byte1&=0x07; /* 0b00000111; */
- byte1<<=2;
- byte1+=work; /* uuuuu */
- --byte1; /* wwww */
-
- work=byte1 & 0x0F;
- work>>=2;
- work+=0xD8; /* 0b11011011; */
- in=work;
- in<<=8;
-
- byte1<<=6;
- byte2<<=2;
- byte2&=0x3C; /* 0b00111100; */
- work=byte3;
- work>>=4;
- work&=0x03; /* 0b00000011; */
- work|=byte1;
- work|=byte2;
- in+=work;
-
- work=byte3;
- work>>=2;
- work&=0x03; /* 0b00000011; */
- work|=0xDC; /* 0b110111xx; */
- in2=work;
- in2<<=8;
-
- byte3<<=6;
- byte4&=0x3F; /* 0b00111111; */
- byte4|=byte3;
- in2+=byte4;
- inLen-=4;
- ++pIn;
-#ifdef match_with_GBK
- if ((0xD800 == in && in2 < 0xDC80) ||
- (0xD840 == in && in2 < 0xDC80) ||
- (0xD880 == in && in2 < 0xDC80) ||
- (0xD8C0 == in && in2 < 0xDC80) ||
- (0xD900 == in && in2 < 0xDC80) ||
- (0xD940 == in && in2 < 0xDC80) ||
- (0xD980 == in && in2 < 0xDC80) ||
- (0xD9C0 == in && in2 < 0xDC80) ||
- (0xDA00 == in && in2 < 0xDC80) ||
- (0xDA40 == in && in2 < 0xDC80) ||
- (0xDA80 == in && in2 < 0xDC80) ||
- (0xDAC0 == in && in2 < 0xDC80) ||
- (0xDB00 == in && in2 < 0xDC80) ||
- (0xDB40 == in && in2 < 0xDC80) ||
- (0xDB80 == in && in2 < 0xDC80) ||
- (0xDBC0 == in && in2 < 0xDC80)) {
-#else
- if ((0xD800 <= in && in <= 0xDBFF) &&
- (0xDC00 <= in2 && in2 <= 0xDFFF)) {
-#endif
- *pOut=subS;
- ++pOut;
- ++numS;
- continue;
- }
- } else { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-3;
- *numSub+=numS;
- return -1;
- }
- } else if (0xF5 <= byte1 && byte1 <= 0xFF) { /* minic iconv() behavior */
- if (inLen < 4 ||
- (inLen >= 4 && byte1 == 0xF8 && pIn[1] < 0x90) ||
- pIn[1] < 0x80 || 0xBF < pIn[1] ||
- pIn[2] < 0x80 || 0xBF < pIn[2] ||
- pIn[3] < 0x80 || 0xBF < pIn[3] ) {
- if (inLen == 1)
- errno=EINVAL; /* 22 */
- else if (inLen == 2 && (pIn[1] & 0xC0) != 0x80)
- errno=EILSEQ; /* 116 */
- else if (inLen == 3 && ((pIn[1] & 0xC0) != 0x80 || (pIn[2] & 0xC0) != 0x80))
- errno=EILSEQ; /* 116 */
- else if (inLen >= 4 && (byte1 == 0xF8 || (pIn[1] & 0xC0) != 0x80 || (pIn[2] & 0xC0) != 0x80 || (pIn[3] & 0xC0) != 0x80))
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
-
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- } else if ((pIn[1] == 0x80 || pIn[1] == 0x90 || pIn[1] == 0xA0 || pIn[1] == 0xB0) &&
- pIn[2] < 0x82) {
- *pOut=subS; /* Though returns replacement character, which iconv() does not return. */
- ++pOut;
- ++numS;
- pIn+=4;
- inLen-=4;
- continue;
- } else {
- *pOut=pSubD[0]; /* Though returns replacement character, which iconv() does not return. */
- ++pOut;
- *pOut=pSubD[1];
- ++pOut;
- ++numS;
- pIn+=4;
- inLen-=4;
- continue;
- /* iconv() returns 0 with strange 1 byte converted values */
- }
-
- } else { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- }
- /* end of UTF-8 to UCS-2 */
- if (in == 0x0000) {
- *pOut=0x00;
- ++pOut;
- } else if (in < 0x100 && dmapU2S[in] != 0x0000) {
- if ((*pOut=dmapU2S[in]) == subS) {
- if (in != cd->srcSubS)
- ++numS;
- }
- ++pOut;
- } else {
- in<<=1;
- if (dmapU2M2[in] == 0x00) { /* not found in dmapU2M2 */
- in*=1.5;
- if (dmapU2M3[in] == 0x00) { /* not found in dmapU2M3*/
- *pOut=pSubD[0];
- ++pOut;
- *pOut=pSubD[1];
- ++pOut;
- ++numS;
- ++rc;
- } else {
- *pOut=dmapU2M3[in];
- ++pOut;
- *pOut=dmapU2M3[1+in];
- ++pOut;
- *pOut=dmapU2M3[2+in];
- ++pOut;
- }
- } else {
- *pOut=dmapU2M2[in];
- ++pOut;
- if (dmapU2M2[1+in] == 0x00) {
- if (*pOut == subS) {
- in>>=1;
- if (in != cd->srcSubS)
- ++numS;
- }
- } else {
- *pOut=dmapU2M2[1+in];
- ++pOut;
- if (memcmp(pOut-2, pSubD, 2) == 0) {
- in>>=1;
- if (in != cd->srcSubD) {
- ++numS;
- ++rc;
- }
- }
- }
- }
- }
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_S2U) {
- /* use uchar * instead of UniChar to avoid memcpy */
- register uchar * dmapD12U=(uchar *) (cd->cnv_dmap->dmapD12U);
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register int offset;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register size_t numS=0;
- while (0 < inLen) {
- if (pLastOutBuf < pOut)
- break;
- if (*pIn == 0x00) {
- *pOut=0x00;
- ++pOut;
- *pOut=0x00;
- ++pOut;
- ++pIn;
- --inLen;
- } else {
- offset=*pIn;
- offset<<=1;
- *pOut=dmapD12U[offset];
- ++pOut;
- *pOut=dmapD12U[offset+1];
- ++pOut;
- if (dmapD12U[offset] == 0x00) {
- if (dmapD12U[offset+1] == 0x1A) {
- if (*pIn != cd->srcSubS)
- ++numS;
- } else if (dmapD12U[offset+1] == 0x00) {
- pOut-=2;
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- }
- ++pIn;
- --inLen;
- }
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_S28) {
- /* use uchar * instead of UniChar to avoid memcpy */
- register uchar * dmapD12U=(uchar *) (cd->cnv_dmap->dmapD12U);
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register int offset;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register size_t numS=0;
- register UniChar in; /* copy part of U28 */
- while (0 < inLen) {
- if (pLastOutBuf < pOut)
- break;
- if (*pIn == 0x00) {
- *pOut=0x00;
- ++pOut;
- ++pIn;
- --inLen;
- } else {
- offset=*pIn;
- offset<<=1;
- in=dmapD12U[offset];
- in<<=8;
- in+=dmapD12U[offset+1];
- if ((in & 0xFF80) == 0x0000) { /* U28: in & 0b1111111110000000 == 0x0000 */
- if (in == 0x000) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- *pOut=in;
- ++pOut;
- } else if ((in & 0xF800) == 0x0000) { /* in & 0b1111100000000000 == 0x0000 */
- register uchar byte;
- in>>=6;
- in&=0x001F; /* 0b0000000000011111 */
- in|=0x00C0; /* 0b0000000011000000 */
- *pOut=in;
- ++pOut;
- byte=dmapD12U[offset+1];
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
- } else if ((in & 0xFC00) == 0xD800) { /* There should not be no surrogate character in SBCS. */
- *pOut=0xEF;
- ++pOut;
- *pOut=0xBF;
- ++pOut;
- *pOut=0xBD;
- ++pOut;
- } else {
- register uchar byte;
- register uchar work;
- byte=dmapD12U[offset];
- byte>>=4;
- byte|=0xE0; /* 0b11100000; */
- *pOut=byte;
- ++pOut;
-
- byte=dmapD12U[offset];
- byte<<=2;
- work=dmapD12U[offset+1];
- work>>=6;
- byte|=work;
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
-
- byte=dmapD12U[offset+1];
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
- }
- /* end of U28 */
- if (dmapD12U[offset] == 0x00) {
- if (dmapD12U[offset+1] == 0x1A) {
- if (*pIn != cd->srcSubS)
- ++numS;
- }
- }
- ++pIn;
- --inLen;
- }
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_U2S) {
- register uchar * dmapU2S=cd->cnv_dmap->dmapU2S;
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register char subS=cd->subS;
- register size_t numS=0;
- while (0 < inLen) {
- register uint32_t in;
- if (inLen == 1) {
- errno=EINVAL; /* 22 */
-
- *inBytesLeft=inLen;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- if (pLastOutBuf < pOut)
- break;
- in=pIn[0];
- in<<=8;
- in+=pIn[1];
- if (in == 0x0000) {
- *pOut=0x00;
- } else {
- if ((*pOut=dmapU2S[in]) == 0x00) {
- *pOut=subS;
- ++numS;
- errno=EINVAL; /* 22 */
- } else if (*pOut == subS) {
- if (in != cd->srcSubS)
- ++numS;
- }
- }
- ++pOut;
- pIn+=2;
- inLen-=2;
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return numS;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_T2S) {
- register uchar * dmapU2S=cd->cnv_dmap->dmapU2S;
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register char subS=cd->subS;
- register size_t numS=0;
- while (0 < inLen) {
- register uint32_t in;
- if (inLen == 1) {
- errno=EINVAL; /* 22 */
-
- *inBytesLeft=inLen-1;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn;
- ++numS;
- *numSub+=numS;
- return 0;
- }
- if (pLastOutBuf < pOut)
- break;
- in=pIn[0];
- in<<=8;
- in+=pIn[1];
- if (in == 0x0000) {
- *pOut=0x00;
-
- } else if (0xD800 <= in && in <= 0xDFFF) { /* 0xD800-0xDFFF, surrogate first and second values */
- if (0xDC00 <= in ) {
- errno=EINVAL; /* 22 */
- *inBytesLeft=inLen-1;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
-
- } else if (inLen < 4) {
- errno=EINVAL; /* 22 */
- *inBytesLeft=inLen-2;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn+2;
- return -1;
-
- } else {
- register uint32_t in2;
- in2=pIn[2];
- in2<<=8;
- in2+=pIn[3];
- if (0xDC00 <= in2 && in2 <= 0xDFFF) { /* second surrogate character =0xDC00 - 0xDFFF*/
- *pOut=subS;
- ++numS;
- pIn+=4;
- } else {
- errno=EINVAL; /* 22 */
- *inBytesLeft=inLen-1;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- }
- } else {
- if ((*pOut=dmapU2S[in]) == 0x00) {
- *pOut=subS;
- ++numS;
- errno=EINVAL; /* 22 */
- } else if (*pOut == subS) {
- if (in != cd->srcSubS)
- ++numS;
- }
- }
- ++pOut;
- pIn+=2;
- inLen-=2;
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_82S) {
- register uchar * dmapU2S=cd->cnv_dmap->dmapU2S;
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register char subS=cd->subS;
- register size_t numS=0;
- while (0 < inLen) {
- register uint32_t in;
- uint32_t in2; /* The second surrogate value */
- if (pLastOutBuf < pOut)
- break;
- /* convert from UTF-8 to UCS-2 */
- if (*pIn == 0x00) {
- in=0x0000;
- ++pIn;
- --inLen;
- } else { /* 82U: */
- register uchar byte1=*pIn;
- if ((byte1 & 0x80) == 0x00) { /* if (byte1 & 0b10000000 == 0b00000000) { */
- /* 1 bytes sequence: 0xxxxxxx => 00000000 0xxxxxxx*/
- in=byte1;
- ++pIn;
- --inLen;
- } else if ((byte1 & 0xE0) == 0xC0) { /* (byte1 & 0b11100000 == 0b11000000) { */
- if (inLen < 2) {
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- if (byte1 == 0xC0 || byte1 == 0xC1) { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- /* 2 bytes sequence:
- 110yyyyy 10xxxxxx => 00000yyy yyxxxxxx */
- register uchar byte2;
- ++pIn;
- byte2=*pIn;
- if ((byte2 & 0xC0) == 0x80) { /* byte2 & 0b11000000 == 0b10000000) { */
- register uchar work=byte1;
- work<<=6;
- byte2&=0x3F; /* 0b00111111; */
- byte2|=work;
-
- byte1&=0x1F; /* 0b00011111; */
- byte1>>=2;
- in=byte1;
- in<<=8;
- in+=byte2;
- inLen-=2;
- ++pIn;
- } else { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- *numSub+=numS;
- return -1;
- }
- } else if ((byte1 & 0xF0) == 0xE0) { /* byte1 & 0b11110000 == 0b11100000 */
- /* 3 bytes sequence:
- 1110zzzz 10yyyyyy 10xxxxxx => zzzzyyyy yyxxxxxx */
- register uchar byte2;
- register uchar byte3;
- if (inLen < 3) {
- if (inLen == 2 && (pIn[1] & 0xC0) != 0x80)
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- ++pIn;
- byte2=*pIn;
- ++pIn;
- byte3=*pIn;
- if ((byte2 & 0xC0) != 0x80 ||
- (byte3 & 0xC0) != 0x80 ||
- (byte1 == 0xE0 && byte2 < 0xA0)) { /* invalid sequence, only 0xA0-0xBF allowed after 0xE0 */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-2;
- *numSub+=numS;
- return -1;
- }
- {
- register uchar work=byte2;
- work<<=6;
- byte3&=0x3F; /* 0b00111111; */
- byte3|=work;
-
- byte2&=0x3F; /* 0b00111111; */
- byte2>>=2;
-
- byte1<<=4;
- in=byte1 | byte2;;
- in<<=8;
- in+=byte3;
- inLen-=3;
- ++pIn;
- }
- } else if ((0xF0 <= byte1 && byte1 <= 0xF4) || /* (bytes1 & 11111000) == 0x1110000 */
- ((byte1&=0xF7) && 0xF0 <= byte1 && byte1 <= 0xF4)) { /* minic iconv() behavior */
- /* 4 bytes sequence
- 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx => 110110ww wwzzzzyy 110111yy yyxxxxxx
- where uuuuu = wwww + 1 */
- register uchar byte2;
- register uchar byte3;
- register uchar byte4;
- if (inLen < 4) {
- if ((inLen >= 2 && (pIn[1] & 0xC0) != 0x80) ||
- (inLen >= 3 && (pIn[2] & 0xC0) != 0x80) ||
- (cd->toCcsid == 13488) )
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- ++pIn;
- byte2=*pIn;
- ++pIn;
- byte3=*pIn;
- ++pIn;
- byte4=*pIn;
- if ((byte2 & 0xC0) == 0x80 && /* byte2 & 0b11000000 == 0b10000000 */
- (byte3 & 0xC0) == 0x80 && /* byte3 & 0b11000000 == 0b10000000 */
- (byte4 & 0xC0) == 0x80) { /* byte4 & 0b11000000 == 0b10000000 */
- register uchar work=byte2;
- if (byte1 == 0xF0 && byte2 < 0x90) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-3;
- *numSub+=numS;
- return -1;
- /* iconv() returns 0 for 0xF4908080 and convert to 0x00
- } else if (byte1 == 0xF4 && byte2 > 0x8F) {
- errno=EINVAL;
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-3;
- *numSub+=numS;
- return -1;
- */
- }
-
- work&=0x30; /* 0b00110000; */
- work>>=4;
- byte1&=0x07; /* 0b00000111; */
- byte1<<=2;
- byte1+=work; /* uuuuu */
- --byte1; /* wwww */
-
- work=byte1 & 0x0F;
- work>>=2;
- work+=0xD8; /* 0b11011011; */
- in=work;
- in<<=8;
-
- byte1<<=6;
- byte2<<=2;
- byte2&=0x3C; /* 0b00111100; */
- work=byte3;
- work>>=4;
- work&=0x03; /* 0b00000011; */
- work|=byte1;
- work|=byte2;
- in+=work;
-
- work=byte3;
- work>>=2;
- work&=0x03; /* 0b00000011; */
- work|=0xDC; /* 0b110111xx; */
- in2=work;
- in2<<=8;
-
- byte3<<=6;
- byte4&=0x3F; /* 0b00111111; */
- byte4|=byte3;
- in2+=byte4;
- inLen-=4;
- ++pIn;
- } else { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-3;
- *numSub+=numS;
- return -1;
- }
- } else if ((byte1 & 0xF0) == 0xF0) { /* minic iconv() behavior */
- if (inLen < 4 ||
- pIn[1] < 0x80 || 0xBF < pIn[1] ||
- pIn[2] < 0x80 || 0xBF < pIn[2] ||
- pIn[3] < 0x80 || 0xBF < pIn[3] ) {
- if (inLen == 1)
- errno=EINVAL; /* 22 */
- else if (inLen == 2 && (pIn[1] & 0xC0) != 0x80)
- errno=EILSEQ; /* 116 */
- else if (inLen == 3 && ((pIn[1] & 0xC0) != 0x80 || (pIn[2] & 0xC0) != 0x80))
- errno=EILSEQ; /* 116 */
- else if (inLen >= 4 && ((pIn[1] & 0xC0) != 0x80 || (pIn[2] & 0xC0) != 0x80 || (pIn[3] & 0xC0) != 0x80))
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
-
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- } else {
- *pOut=subS; /* Though returns replacement character, which iconv() does not return. */
- ++pOut;
- ++numS;
- pIn+=4;
- inLen-=4;
- /* UTF-8_IBM-850 0xF0908080 : converted value does not match, iconv=0x00, dmap=0x7F
- UTF-8_IBM-850 0xF0908081 : converted value does not match, iconv=0x01, dmap=0x7F
- UTF-8_IBM-850 0xF0908082 : converted value does not match, iconv=0x02, dmap=0x7F
- UTF-8_IBM-850 0xF0908083 : converted value does not match, iconv=0x03, dmap=0x7F
- ....
- UTF-8_IBM-850 0xF09081BE : converted value does not match, iconv=0x7E, dmap=0x7F
- UTF-8_IBM-850 0xF09081BF : converted value does not match, iconv=0x1C, dmap=0x7F
- UTF-8_IBM-850 0xF09082A0 : converted value does not match, iconv=0xFF, dmap=0x7F
- UTF-8_IBM-850 0xF09082A1 : converted value does not match, iconv=0xAD, dmap=0x7F
- ....
- */
- continue;
- /* iconv() returns 0 with strange 1 byte converted values */
- }
-
- } else { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- }
- /* end of UTF-8 to UCS-2 */
- if (in == 0x0000) {
- *pOut=0x00;
- } else {
- if ((*pOut=dmapU2S[in]) == 0x00) {
- *pOut=subS;
- ++numS;
- errno=EINVAL; /* 22 */
- } else if (*pOut == subS) {
- if (in != cd->srcSubS) {
- ++numS;
- }
- }
- }
- ++pOut;
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_D2U) {
- /* use uchar * instead of UniChar to avoid memcpy */
- register uchar * dmapD12U=(uchar *) (cd->cnv_dmap->dmapD12U);
- register uchar * dmapD22U=(uchar *) (cd->cnv_dmap->dmapD22U);
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register int offset;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register size_t numS=0;
- while (0 < inLen) {
- if (pLastOutBuf < pOut)
- break;
- if (*pIn == 0x00) {
- *pOut=0x00;
- ++pOut;
- *pOut=0x00;
- ++pOut;
- ++pIn;
- --inLen;
- } else {
- offset=*pIn;
- offset<<=1;
- if (dmapD12U[offset] == 0x00 &&
- dmapD12U[offset+1] == 0x00) { /* DBCS */
- if (inLen < 2) {
- if (*pIn == 0x80 || *pIn == 0xFF ||
- (cd->fromCcsid == 943 && (*pIn == 0x85 || *pIn == 0x86 || *pIn == 0xA0 || *pIn == 0xEB || *pIn == 0xEC || *pIn == 0xEF || *pIn == 0xFD || *pIn == 0xFE)) ||
- (cd->fromCcsid == 932 && (*pIn == 0x85 || *pIn == 0x86 || *pIn == 0x87 || *pIn == 0xEB || *pIn == 0xEC || *pIn == 0xED || *pIn == 0xEE || *pIn == 0xEF)) ||
- (cd->fromCcsid == 1381 && ((0x85 <= *pIn && *pIn <= 0x8B) || (0xAA <= *pIn && *pIn <= 0xAF) || (0xF8 <= *pIn && *pIn <= 0xFE))))
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- offset-=0x100;
- ++pIn;
- offset<<=8;
- offset+=(*pIn * 2);
- if (dmapD22U[offset] == 0x00 &&
- dmapD22U[offset+1] == 0x00) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- *pOut=dmapD22U[offset];
- ++pOut;
- *pOut=dmapD22U[offset+1];
- ++pOut;
- if (dmapD22U[offset] == 0xFF &&
- dmapD22U[offset+1] == 0xFD) {
- if (pIn[-1] * 0x100 + pIn[0] != cd->srcSubD)
- ++numS;
- }
- ++pIn;
- inLen-=2;
- } else { /* SBCS */
- *pOut=dmapD12U[offset];
- ++pOut;
- *pOut=dmapD12U[offset+1];
- ++pOut;
- if (dmapD12U[offset] == 0x00 &&
- dmapD12U[offset+1] == 0x1A) {
- if (*pIn != cd->srcSubS)
- ++numS;
- }
- ++pIn;
- --inLen;
- }
- }
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_D28) {
- /* use uchar * instead of UniChar to avoid memcpy */
- register uchar * dmapD12U=(uchar *) (cd->cnv_dmap->dmapD12U);
- register uchar * dmapD22U=(uchar *) (cd->cnv_dmap->dmapD22U);
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register int offset;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register size_t numS=0;
- register UniChar in; /* copy part of U28 */
- register UniChar ucs2;
- while (0 < inLen) {
- if (pLastOutBuf < pOut)
- break;
- if (*pIn == 0x00) {
- *pOut=0x00;
- ++pOut;
- ++pIn;
- --inLen;
- } else {
- offset=*pIn;
- offset<<=1;
- if (dmapD12U[offset] == 0x00 &&
- dmapD12U[offset+1] == 0x00) { /* DBCS */
- if (inLen < 2) {
- if (*pIn == 0x80 || *pIn == 0xFF ||
- (cd->fromCcsid == 943 && (*pIn == 0x85 || *pIn == 0x86 || *pIn == 0xA0 || *pIn == 0xEB || *pIn == 0xEC || *pIn == 0xEF || *pIn == 0xFD || *pIn == 0xFE)) ||
- (cd->fromCcsid == 932 && (*pIn == 0x85 || *pIn == 0x86 || *pIn == 0x87 || *pIn == 0xEB || *pIn == 0xEC || *pIn == 0xED || *pIn == 0xEE || *pIn == 0xEF)) ||
- (cd->fromCcsid == 1381 && ((0x85 <= *pIn && *pIn <= 0x8B) || (0xAA <= *pIn && *pIn <= 0xAF) || (0xF8 <= *pIn && *pIn <= 0xFE))))
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- offset-=0x100;
- ++pIn;
- offset<<=8;
- offset+=(*pIn * 2);
- if (dmapD22U[offset] == 0x00 &&
- dmapD22U[offset+1] == 0x00) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- return -1;
- }
- in=dmapD22U[offset];
- in<<=8;
- in+=dmapD22U[offset+1];
- ucs2=in;
- if (dmapD22U[offset] == 0xFF &&
- dmapD22U[offset+1] == 0xFD) {
- if (in != cd->srcSubD)
- ++numS;
- }
- ++pIn;
- inLen-=2;
- } else { /* SBCS */
- in=dmapD12U[offset];
- in<<=8;
- in+=dmapD12U[offset+1];
- ucs2=in;
- if (dmapD12U[offset] == 0x00 &&
- dmapD12U[offset+1] == 0x1A) {
- if (in != cd->srcSubS)
- ++numS;
- }
- ++pIn;
- --inLen;
- }
- if ((in & 0xFF80) == 0x0000) { /* U28: in & 0b1111111110000000 == 0x0000 */
- *pOut=in;
- ++pOut;
- } else if ((in & 0xF800) == 0x0000) { /* in & 0b1111100000000000 == 0x0000 */
- register uchar byte;
- in>>=6;
- in&=0x001F; /* 0b0000000000011111 */
- in|=0x00C0; /* 0b0000000011000000 */
- *pOut=in;
- ++pOut;
- byte=ucs2; /* dmapD12U[offset+1]; */
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
- } else if ((in & 0xFC00) == 0xD800) { /* There should not be no surrogate character in SBCS. */
- *pOut=0xEF;
- ++pOut;
- *pOut=0xBF;
- ++pOut;
- *pOut=0xBD;
- ++pOut;
- } else {
- register uchar byte;
- register uchar work;
- byte=(ucs2>>8); /* dmapD12U[offset]; */
- byte>>=4;
- byte|=0xE0; /* 0b11100000; */
- *pOut=byte;
- ++pOut;
-
- byte=(ucs2>>8); /* dmapD12U[offset]; */
- byte<<=2;
- work=ucs2; /* dmapD12U[offset+1]; */
- work>>=6;
- byte|=work;
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
-
- byte=ucs2; /* dmapD12U[offset+1]; */
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
- }
- /* end of U28 */
- }
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_U2D) {
- register uchar * dmapU2D=cd->cnv_dmap->dmapU2D;
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register char subS=cd->subS;
- register char * pSubD=(char *) &(cd->subD);
- register size_t numS=0;
- while (0 < inLen) {
- register uint32_t in;
- if (inLen == 1) {
- errno=EINVAL; /* 22 */
-
- *inBytesLeft=inLen;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- if (pLastOutBuf < pOut)
- break;
- in=pIn[0];
- in<<=8;
- in+=pIn[1];
- if (in == 0x0000) {
- *pOut=0x00;
- ++pOut;
- } else {
- in<<=1;
- *pOut=dmapU2D[in];
- ++pOut;
- if (dmapU2D[in+1] == 0x00) { /* SBCS */
- if (*pOut == subS) {
- if (in != cd->srcSubS)
- ++numS;
- }
- } else {
- *pOut=dmapU2D[in+1];
- ++pOut;
- if (dmapU2D[in] == pSubD[0] &&
- dmapU2D[in+1] == pSubD[1]) {
- in>>=1;
- if (in != cd->srcSubD)
- ++numS;
- }
- }
- }
- pIn+=2;
- inLen-=2;
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return numS; /* to minic iconv() behavior */
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_T2D) {
- register uchar * dmapU2D=cd->cnv_dmap->dmapU2D;
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register char subS=cd->subS;
- register char * pSubD=(char *) &(cd->subD);
- register size_t numS=0;
- while (0 < inLen) {
- register uint32_t in;
- if (inLen == 1) {
- errno=EINVAL; /* 22 */
- *inBytesLeft=inLen-1;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn;
- ++numS;
- *numSub+=numS;
- return 0;
- }
- if (pLastOutBuf < pOut)
- break;
- in=pIn[0];
- in<<=8;
- in+=pIn[1];
- if (in == 0x0000) {
- *pOut=0x00;
- ++pOut;
- } else if (0xD800 <= in && in <= 0xDBFF) { /* first byte of surrogate */
- errno=EINVAL; /* 22 */
- *inBytesLeft=inLen-2;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn+2;
- ++numS;
- *numSub+=numS;
- return -1;
-
- } else if (0xDC00 <= in && in <= 0xDFFF) { /* second byte of surrogate */
- errno=EINVAL; /* 22 */
- *inBytesLeft=inLen-1;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn;
- ++numS;
- *numSub+=numS;
- return -1;
-
- } else {
- in<<=1;
- *pOut=dmapU2D[in];
- ++pOut;
- if (dmapU2D[in+1] == 0x00) { /* SBCS */
- if (*pOut == subS) {
- if (in != cd->srcSubS)
- ++numS;
- }
- } else {
- *pOut=dmapU2D[in+1];
- ++pOut;
- if (dmapU2D[in] == pSubD[0] &&
- dmapU2D[in+1] == pSubD[1]) {
- in>>=1;
- if (in != cd->srcSubD)
- ++numS;
- }
- }
- }
- pIn+=2;
- inLen-=2;
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0; /* to minic iconv() behavior */
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_82D) {
- register uchar * dmapU2D=cd->cnv_dmap->dmapU2D;
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register char subS=cd->subS;
- register char * pSubD=(char *) &(cd->subD);
- register size_t numS=0;
- while (0 < inLen) {
- register uint32_t in;
- uint32_t in2;
- if (pLastOutBuf < pOut)
- break;
- /* convert from UTF-8 to UCS-2 */
- if (*pIn == 0x00) {
- in=0x0000;
- ++pIn;
- --inLen;
- } else { /* 82U: */
- register uchar byte1=*pIn;
- if ((byte1 & 0x80) == 0x00) { /* if (byte1 & 0b10000000 == 0b00000000) { */
- /* 1 bytes sequence: 0xxxxxxx => 00000000 0xxxxxxx*/
- in=byte1;
- ++pIn;
- --inLen;
- } else if ((byte1 & 0xE0) == 0xC0) { /* (byte1 & 0b11100000 == 0b11000000) { */
- if (inLen < 2) {
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- if (byte1 == 0xC0 || byte1 == 0xC1) { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- /* 2 bytes sequence:
- 110yyyyy 10xxxxxx => 00000yyy yyxxxxxx */
- register uchar byte2;
- ++pIn;
- byte2=*pIn;
- if ((byte2 & 0xC0) == 0x80) { /* byte2 & 0b11000000 == 0b10000000) { */
- register uchar work=byte1;
- work<<=6;
- byte2&=0x3F; /* 0b00111111; */
- byte2|=work;
-
- byte1&=0x1F; /* 0b00011111; */
- byte1>>=2;
- in=byte1;
- in<<=8;
- in+=byte2;
- inLen-=2;
- ++pIn;
- } else { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- *numSub+=numS;
- return -1;
- }
- } else if ((byte1 & 0xF0) == 0xE0) { /* byte1 & 0b11110000 == 0b11100000 */
- /* 3 bytes sequence:
- 1110zzzz 10yyyyyy 10xxxxxx => zzzzyyyy yyxxxxxx */
- register uchar byte2;
- register uchar byte3;
- if (inLen < 3) {
- if (inLen == 2 && (pIn[1] & 0xC0) != 0x80)
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- ++pIn;
- byte2=*pIn;
- ++pIn;
- byte3=*pIn;
- if ((byte2 & 0xC0) != 0x80 ||
- (byte3 & 0xC0) != 0x80 ||
- (byte1 == 0xE0 && byte2 < 0xA0)) { /* invalid sequence, only 0xA0-0xBF allowed after 0xE0 */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-2;
- *numSub+=numS;
- return -1;
- }
- {
- register uchar work=byte2;
- work<<=6;
- byte3&=0x3F; /* 0b00111111; */
- byte3|=work;
-
- byte2&=0x3F; /* 0b00111111; */
- byte2>>=2;
-
- byte1<<=4;
- in=byte1 | byte2;;
- in<<=8;
- in+=byte3;
- inLen-=3;
- ++pIn;
- }
- } else if ((0xF0 <= byte1 && byte1 <= 0xF4)) { /* (bytes1 & 11111000) == 0x1110000 */
- /* 4 bytes sequence
- 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx => 110110ww wwzzzzyy 110111yy yyxxxxxx
- where uuuuu = wwww + 1 */
- register uchar byte2;
- register uchar byte3;
- register uchar byte4;
- if (inLen < 4) {
- if ((inLen >= 2 && (pIn[1] & 0xC0) != 0x80) ||
- (inLen >= 3 && (pIn[2] & 0xC0) != 0x80) ||
- (cd->toCcsid == 13488) )
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- ++pIn;
- byte2=*pIn;
- ++pIn;
- byte3=*pIn;
- ++pIn;
- byte4=*pIn;
- if ((byte2 & 0xC0) == 0x80 && /* byte2 & 0b11000000 == 0b10000000 */
- (byte3 & 0xC0) == 0x80 && /* byte3 & 0b11000000 == 0b10000000 */
- (byte4 & 0xC0) == 0x80) { /* byte4 & 0b11000000 == 0b10000000 */
- register uchar work=byte2;
- if (byte1 == 0xF0 && byte2 < 0x90) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-3;
- *numSub+=numS;
- return -1;
- /* iconv() returns 0 for 0xF4908080 and convert to 0x00
- } else if (byte1 == 0xF4 && byte2 > 0x8F) {
- errno=EINVAL;
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-3;
- *numSub+=numS;
- return -1;
- */
- }
-
- work&=0x30; /* 0b00110000; */
- work>>=4;
- byte1&=0x07; /* 0b00000111; */
- byte1<<=2;
- byte1+=work; /* uuuuu */
- --byte1; /* wwww */
-
- work=byte1 & 0x0F;
- work>>=2;
- work+=0xD8; /* 0b11011011; */
- in=work;
- in<<=8;
-
- byte1<<=6;
- byte2<<=2;
- byte2&=0x3C; /* 0b00111100; */
- work=byte3;
- work>>=4;
- work&=0x03; /* 0b00000011; */
- work|=byte1;
- work|=byte2;
- in+=work;
-
- work=byte3;
- work>>=2;
- work&=0x03; /* 0b00000011; */
- work|=0xDC; /* 0b110111xx; */
- in2=work;
- in2<<=8;
-
- byte3<<=6;
- byte4&=0x3F; /* 0b00111111; */
- byte4|=byte3;
- in2+=byte4;
- inLen-=4;
- ++pIn;
-#ifdef match_with_GBK
- if ((0xD800 == in && in2 < 0xDC80) ||
- (0xD840 == in && in2 < 0xDC80) ||
- (0xD880 == in && in2 < 0xDC80) ||
- (0xD8C0 == in && in2 < 0xDC80) ||
- (0xD900 == in && in2 < 0xDC80) ||
- (0xD940 == in && in2 < 0xDC80) ||
- (0xD980 == in && in2 < 0xDC80) ||
- (0xD9C0 == in && in2 < 0xDC80) ||
- (0xDA00 == in && in2 < 0xDC80) ||
- (0xDA40 == in && in2 < 0xDC80) ||
- (0xDA80 == in && in2 < 0xDC80) ||
- (0xDAC0 == in && in2 < 0xDC80) ||
- (0xDB00 == in && in2 < 0xDC80) ||
- (0xDB40 == in && in2 < 0xDC80) ||
- (0xDB80 == in && in2 < 0xDC80) ||
- (0xDBC0 == in && in2 < 0xDC80)) {
-#else
- if ((0xD800 <= in && in <= 0xDBFF) &&
- (0xDC00 <= in2 && in2 <= 0xDFFF)) {
-#endif
- *pOut=subS;
- ++pOut;
- ++numS;
- continue;
- }
- } else { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-3;
- *numSub+=numS;
- return -1;
- }
- } else if (0xF5 <= byte1 && byte1 <= 0xFF) { /* minic iconv() behavior */
- if (inLen < 4 ||
- (inLen >= 4 && byte1 == 0xF8 && pIn[1] < 0x90) ||
- pIn[1] < 0x80 || 0xBF < pIn[1] ||
- pIn[2] < 0x80 || 0xBF < pIn[2] ||
- pIn[3] < 0x80 || 0xBF < pIn[3] ) {
- if (inLen == 1)
- errno=EINVAL; /* 22 */
- else if (inLen == 2 && (pIn[1] & 0xC0) != 0x80)
- errno=EILSEQ; /* 116 */
- else if (inLen == 3 && ((pIn[1] & 0xC0) != 0x80 || (pIn[2] & 0xC0) != 0x80))
- errno=EILSEQ; /* 116 */
- else if (inLen >= 4 && (byte1 == 0xF8 || (pIn[1] & 0xC0) != 0x80 || (pIn[2] & 0xC0) != 0x80 || (pIn[3] & 0xC0) != 0x80))
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
-
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- } else if ((pIn[1] == 0x80 || pIn[1] == 0x90 || pIn[1] == 0xA0 || pIn[1] == 0xB0) &&
- pIn[2] < 0x82) {
- *pOut=subS; /* Though returns replacement character, which iconv() does not return. */
- ++pOut;
- ++numS;
- pIn+=4;
- inLen-=4;
- continue;
- } else {
- *pOut=pSubD[0]; /* Though returns replacement character, which iconv() does not return. */
- ++pOut;
- *pOut=pSubD[1];
- ++pOut;
- ++numS;
- pIn+=4;
- inLen-=4;
- continue;
- /* iconv() returns 0 with strange 1 byte converted values */
- }
-
- } else { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- }
- /* end of UTF-8 to UCS-2 */
- if (in == 0x0000) {
- *pOut=0x00;
- ++pOut;
- } else {
- in<<=1;
- *pOut=dmapU2D[in];
- ++pOut;
- if (dmapU2D[in+1] == 0x00) { /* SBCS */
- if (dmapU2D[in] == subS) {
- in>>=1;
- if (in != cd->srcSubS)
- ++numS;
- }
- } else {
- *pOut=dmapU2D[in+1];
- ++pOut;
- if (dmapU2D[in] == pSubD[0] &&
- dmapU2D[in+1] == pSubD[1]) {
- in>>=1;
- if (in != cd->srcSubD)
- ++numS;
- }
- }
- }
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_82U) {
- /* See http://unicode.org/versions/corrigendum1.html */
- /* convert from UTF-8 to UTF-16 can cover all conversion from UTF-8 to UCS-2 */
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- register size_t numS=0;
- while (0 < inLen) {
- if (pLastOutBuf < pOut)
- break;
- if (*pIn == 0x00) {
- *pOut=0x00;
- ++pOut;
- *pOut=0x00;
- ++pOut;
- ++pIn;
- --inLen;
- } else { /* 82U: */
- register uchar byte1=*pIn;
- if ((byte1 & 0x80) == 0x00) { /* if (byte1 & 0b10000000 == 0b00000000) { */
- /* 1 bytes sequence: 0xxxxxxx => 00000000 0xxxxxxx*/
- *pOut=0x00;
- ++pOut;
- *pOut=byte1;
- ++pOut;
- ++pIn;
- --inLen;
- } else if ((byte1 & 0xE0) == 0xC0) { /* (byte1 & 0b11100000 == 0b11000000) { */
- if (inLen < 2) {
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- if (byte1 == 0xC0 || byte1 == 0xC1) { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- /* 2 bytes sequence:
- 110yyyyy 10xxxxxx => 00000yyy yyxxxxxx */
- register uchar byte2;
- ++pIn;
- byte2=*pIn;
- if ((byte2 & 0xC0) == 0x80) { /* byte2 & 0b11000000 == 0b10000000) { */
- register uchar work=byte1;
- work<<=6;
- byte2&=0x3F; /* 0b00111111; */
- byte2|=work;
-
- byte1&=0x1F; /* 0b00011111; */
- byte1>>=2;
- *pOut=byte1;
- ++pOut;
- *pOut=byte2;
- ++pOut;
- inLen-=2;
- ++pIn;
- } else { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-1;
- *numSub+=numS;
- return -1;
- }
- } else if ((byte1 & 0xF0) == 0xE0) { /* byte1 & 0b11110000 == 0b11100000 */
- /* 3 bytes sequence:
- 1110zzzz 10yyyyyy 10xxxxxx => zzzzyyyy yyxxxxxx */
- register uchar byte2;
- register uchar byte3;
- if (inLen < 3) {
- if (inLen == 2 && (pIn[1] & 0xC0) != 0x80)
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- ++pIn;
- byte2=*pIn;
- ++pIn;
- byte3=*pIn;
- if ((byte2 & 0xC0) != 0x80 ||
- (byte3 & 0xC0) != 0x80 ||
- (byte1 == 0xE0 && byte2 < 0xA0)) { /* invalid sequence, only 0xA0-0xBF allowed after 0xE0 */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-2;
- *numSub+=numS;
- return -1;
- }
- {
- register uchar work=byte2;
- work<<=6;
- byte3&=0x3F; /* 0b00111111; */
- byte3|=work;
-
- byte2&=0x3F; /* 0b00111111; */
- byte2>>=2;
-
- byte1<<=4;
- *pOut=byte1 | byte2;;
- ++pOut;
- *pOut=byte3;
- ++pOut;
- inLen-=3;
- ++pIn;
- }
- } else if ((0xF0 <= byte1 && byte1 <= 0xF4) || /* (bytes1 & 11111000) == 0x1110000 */
- ((byte1&=0xF7) && 0xF0 <= byte1 && byte1 <= 0xF4)) { /* minic iconv() behavior */
- /* 4 bytes sequence
- 11110uuu 10uuzzzz 10yyyyyy 10xxxxxx => 110110ww wwzzzzyy 110111yy yyxxxxxx
- where uuuuu = wwww + 1 */
- register uchar byte2;
- register uchar byte3;
- register uchar byte4;
- if (inLen < 4 || cd->toCcsid == 13488) {
- if ((inLen >= 2 && (pIn[1] & 0xC0) != 0x80) ||
- (inLen >= 3 && (pIn[2] & 0xC0) != 0x80) ||
- (cd->toCcsid == 13488) )
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- ++pIn;
- byte2=*pIn;
- ++pIn;
- byte3=*pIn;
- ++pIn;
- byte4=*pIn;
- if ((byte2 & 0xC0) == 0x80 && /* byte2 & 0b11000000 == 0b10000000 */
- (byte3 & 0xC0) == 0x80 && /* byte3 & 0b11000000 == 0b10000000 */
- (byte4 & 0xC0) == 0x80) { /* byte4 & 0b11000000 == 0b10000000 */
- register uchar work=byte2;
- if (byte1 == 0xF0 && byte2 < 0x90) {
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-3;
- *numSub+=numS;
- return -1;
- } else if (byte1 == 0xF4 && byte2 > 0x8F) {
- errno=EINVAL; /* 22 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-3;
- *numSub+=numS;
- return -1;
- }
-
- work&=0x30; /* 0b00110000; */
- work>>=4;
- byte1&=0x07; /* 0b00000111; */
- byte1<<=2;
- byte1+=work; /* uuuuu */
- --byte1; /* wwww */
-
- work=byte1 & 0x0F;
- work>>=2;
- work+=0xD8; /* 0b11011011; */
- *pOut=work;
- ++pOut;
-
- byte1<<=6;
- byte2<<=2;
- byte2&=0x3C; /* 0b00111100; */
- work=byte3;
- work>>=4;
- work&=0x03; /* 0b00000011; */
- work|=byte1;
- work|=byte2;
- *pOut=work;
- ++pOut;
-
- work=byte3;
- work>>=2;
- work&=0x03; /* 0b00000011; */
- work|=0xDC; /* 0b110111xx; */
- *pOut=work;
- ++pOut;
-
- byte3<<=6;
- byte4&=0x3F; /* 0b00111111; */
- byte4|=byte3;
- *pOut=byte4;
- ++pOut;
- inLen-=4;
- ++pIn;
- } else { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn-3;
- *numSub+=numS;
- return -1;
- }
- } else if ((byte1 & 0xF0) == 0xF0) {
- if (cd->toCcsid == 13488) {
- errno=EILSEQ; /* 116 */
- } else {
- if (inLen == 1)
- errno=EINVAL; /* 22 */
- else if (inLen == 2 && (pIn[1] & 0xC0) != 0x80)
- errno=EILSEQ; /* 116 */
- else if (inLen == 3 && ((pIn[1] & 0xC0) != 0x80 || (pIn[2] & 0xC0) != 0x80))
- errno=EILSEQ; /* 116 */
- else if (inLen >= 4 && ((pIn[1] & 0xC0) != 0x80 || (pIn[2] & 0xC0) != 0x80 || (pIn[3] & 0xC0) != 0x80))
- errno=EILSEQ; /* 116 */
- else
- errno=EINVAL; /* 22 */
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
-
- } else { /* invalid sequence */
- errno=EILSEQ; /* 116 */
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return -1;
- }
- }
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- *numSub+=numS;
- return 0;
- } else if (cd->cnv_dmap->codingSchema == DMAP_U28) {
- /* See http://unicode.org/versions/corrigendum1.html */
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- // register size_t numS=0;
- while (0 < inLen) {
- register uint32_t in;
- if (inLen == 1) {
- errno=EINVAL; /* 22 */
- *inBytesLeft=inLen;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
- }
- if (pLastOutBuf < pOut)
- break;
- in=pIn[0];
- in<<=8;
- in+=pIn[1];
- if (in == 0x0000) {
- *pOut=0x00;
- ++pOut;
- } else if ((in & 0xFF80) == 0x0000) { /* U28: in & 0b1111111110000000 == 0x0000 */
- *pOut=in;
- ++pOut;
- } else if ((in & 0xF800) == 0x0000) { /* in & 0b1111100000000000 == 0x0000 */
- register uchar byte;
- in>>=6;
- in&=0x001F; /* 0b0000000000011111 */
- in|=0x00C0; /* 0b0000000011000000 */
- *pOut=in;
- ++pOut;
- byte=pIn[1];
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
- } else {
- register uchar byte;
- register uchar work;
- byte=pIn[0];
- byte>>=4;
- byte|=0xE0; /* 0b11100000; */
- *pOut=byte;
- ++pOut;
-
- byte=pIn[0];
- byte<<=2;
- work=pIn[1];
- work>>=6;
- byte|=work;
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
-
- byte=pIn[1];
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
- }
- pIn+=2;
- inLen-=2;
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- // *numSub+=numS;
- return 0;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_T28) { /* UTF-16_UTF-8 */
- /* See http://unicode.org/versions/corrigendum1.html */
- register int inLen=*inBytesLeft;
- register char * pOut=*outBuf;
- register char * pIn=*inBuf;
- register char * pLastOutBuf = *outBuf + *outBytesLeft - 1;
- // register size_t numS=0;
- while (0 < inLen) {
- register uint32_t in;
- if (inLen == 1) {
- errno=EINVAL; /* 22 */
- *inBytesLeft=0;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn;
- return 0;
- }
- if (pLastOutBuf < pOut)
- break;
- in=pIn[0];
- in<<=8;
- in+=pIn[1];
- if (in == 0x0000) {
- *pOut=0x00;
- ++pOut;
- } else if ((in & 0xFF80) == 0x0000) { /* U28: in & 0b1111111110000000 == 0x0000 */
- *pOut=in;
- ++pOut;
- } else if ((in & 0xF800) == 0x0000) { /* in & 0b1111100000000000 == 0x0000 */
- register uchar byte;
- in>>=6;
- in&=0x001F; /* 0b0000000000011111 */
- in|=0x00C0; /* 0b0000000011000000 */
- *pOut=in;
- ++pOut;
- byte=pIn[1];
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
- } else if ((in & 0xFC00) == 0xD800) { /* in & 0b1111110000000000 == 0b1101100000000000, first surrogate character */
- if (0xDC00 <= in ) {
- errno=EINVAL; /* 22 */
- *inBytesLeft=inLen-1;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
-
- } else if (inLen < 4) {
- errno=EINVAL; /* 22 */
- *inBytesLeft=inLen-2;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn+2;
- return -1;
-
- } else if ((pIn[2] & 0xFC) != 0xDC) { /* pIn[2] & 0b11111100 == 0b11011100, second surrogate character */
- errno=EINVAL; /* 22 */
- *inBytesLeft=inLen-2;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn+2;
- return -1;
-
- } else {
- register uchar byte;
- register uchar work;
- in>>=6;
- in&=0x000F; /* 0b0000000000001111 */
- byte=in; /* wwww */
- ++byte; /* uuuuu */
- work=byte; /* save uuuuu */
- byte>>=2;
- byte|=0xF0; /* 0b11110000; */
- *pOut=byte;
- ++pOut;
-
- byte=work;
- byte&=0x03; /* 0b00000011; */
- byte<<=4;
- byte|=0x80; /* 0b10000000; */
- work=pIn[1];
- work&=0x3C; /* 0b00111100; */
- work>>=2;
- byte|=work;
- *pOut=byte;
- ++pOut;
-
- byte=pIn[1];
- byte&=0x03; /* 0b00000011; */
- byte<<=4;
- byte|=0x80; /* 0b10000000; */
- work=pIn[2];
- work&=0x03; /* 0b00000011; */
- work<<=2;
- byte|=work;
- work=pIn[3];
- work>>=6;
- byte|=work;
- *pOut=byte;
- ++pOut;
-
- byte=pIn[3];
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
- pIn+=2;
- inLen-=2;
- }
- } else if ((in & 0xFC00) == 0xDC00) { /* in & 0b11111100 == 0b11011100, second surrogate character */
- errno=EINVAL; /* 22 */
- *inBytesLeft=inLen-1;
- *outBytesLeft-=(pOut-*outBuf);
- *outBuf=pOut;
- *inBuf=pIn;
- return -1;
-
- } else {
- register uchar byte;
- register uchar work;
- byte=pIn[0];
- byte>>=4;
- byte|=0xE0; /* 0b11100000; */
- *pOut=byte;
- ++pOut;
-
- byte=pIn[0];
- byte<<=2;
- work=pIn[1];
- work>>=6;
- byte|=work;
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
-
- byte=pIn[1];
- byte&=0x3F; /* 0b00111111; */
- byte|=0x80; /* 0b10000000; */
- *pOut=byte;
- ++pOut;
- }
- pIn+=2;
- inLen-=2;
- }
- *outBytesLeft-=(pOut-*outBuf);
- *inBytesLeft=inLen;
- *outBuf=pOut;
- *inBuf=pIn;
- // *numSub+=numS;
- return 0;
-
- } else if (cd->cnv_dmap->codingSchema == DMAP_U2U) { /* UTF-16_UCS-2 */
- register int inLen=*inBytesLeft;
- register int outLen=*outBytesLeft;
- if (inLen <= outLen) {
- memcpy(*outBuf, *inBuf, inLen);
- (*outBytesLeft)-=inLen;
- (*inBuf)+=inLen;
- (*outBuf)+=inLen;
- *inBytesLeft=0;
- return 0;
- }
- memcpy(*outBuf, *inBuf, outLen);
- (*outBytesLeft)=0;
- (*inBuf)+=outLen;
- (*outBuf)+=outLen;
- *inBytesLeft-=outLen;
- return (*inBytesLeft);
-
- } else {
- return -1;
- }
- return 0;
-}
-
-
-#ifdef DEBUG
-inline size_t myconv(myconv_t cd ,
- char** inBuf,
- size_t* inBytesLeft,
- char** outBuf,
- size_t* outBytesLeft,
- size_t* numSub)
-{
- if (cd->converterType == CONVERTER_ICONV) {
- return myconv_iconv(cd,inBuf,inBytesLeft,outBuf,outBytesLeft,numSub);
- } else if (cd->converterType == CONVERTER_DMAP) {
- return myconv_dmap(cd,inBuf,inBytesLeft,outBuf,outBytesLeft,numSub);
- }
- return -1;
-}
-
-inline char * converterName(int32_t type)
-{
- if (type == CONVERTER_ICONV)
- return "iconv";
- else if (type == CONVERTER_DMAP)
- return "dmap";
-
- return "?????";
-}
-#else
-#define myconv(a,b,c,d,e,f) \
-(((a)->converterType == CONVERTER_ICONV)? myconv_iconv((a),(b),(c),(d),(e),(f)): (((a)->converterType == CONVERTER_DMAP)? myconv_dmap((a),(b),(c),(d),(e),(f)): -1))
-
-
-#define converterName(a) \
-(((a) == CONVERTER_ICONV)? "iconv": ((a) == CONVERTER_DMAP)? "dmap": "?????")
-#endif
-
-void initMyconv();
-void cleanupMyconv();
-
-#endif
diff --git a/storage/ibmdb2i/db2i_rir.cc b/storage/ibmdb2i/db2i_rir.cc
deleted file mode 100644
index 091c4d98383..00000000000
--- a/storage/ibmdb2i/db2i_rir.cc
+++ /dev/null
@@ -1,686 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#include "ha_ibmdb2i.h"
-
-/* Helper function for records_in_range.
- Input: Bitmap of used key parts.
- Output: Number of used key parts. */
-
-static inline int getKeyCntFromMap(key_part_map keypart_map)
-{
- int cnt = 0;
- while (keypart_map)
- {
- keypart_map = keypart_map >> 1;
- cnt++;
- }
- return (cnt);
-}
-
-/**
- @brief
- Given a starting key and an ending key, estimate the number of rows that
- will exist between the two keys.
-
- INPUT
- inx Index to use
- min_key Min key. Is NULL if no min range
- max_key Max key. Is NULL if no max range
-
- NOTES
- min_key.flag can have one of the following values:
- HA_READ_KEY_EXACT Include the key in the range
- HA_READ_AFTER_KEY Don't include key in range
-
- max_key.flag can have one of the following values:
- HA_READ_BEFORE_KEY Don't include key in range
- HA_READ_AFTER_KEY Include all 'end_key' values in the range
-
- RETURN
- HA_POS_ERROR Error or the storage engine cannot estimate the number of rows
- 1 There are no matching keys in the given range
- n > 0 There are approximately n rows in the range
-*/
-ha_rows ha_ibmdb2i::records_in_range(uint inx,
- key_range *min_key,
- key_range *max_key)
-{
- DBUG_ENTER("ha_ibmdb2i::records_in_range");
- int rc = 0; // Return code
- ha_rows rows = 0; // Row count returned to caller of this method
- uint32 spcLen; // Length of space passed to DB2
- uint32 keyCnt; // Number of fields in the key composite
- uint32 literalCnt = 0; // Number of literals
- uint32 boundsOff; // Offset from beginning of space to range bounds
- uint32 litDefOff; // Offset from beginning of space to literal definitions
- uint32 literalsOff; // Offset from beginning of space to literal values
- uint32 cutoff = 0; // Early exit cutoff (currently not used)
- uint64 recCnt; // Row count from DB2
- uint16 rtnCode; // Return code from DB2
- Bounds* boundsPtr; // Pointer to a pair of range bounds
- Bound* boundPtr; // Pointer to a single (high or low) range bound
- LitDef* litDefPtr; // Pointer to a literal definition
- char* literalsPtr; // Pointer to the start of all literal values
- char* literalPtr; // Pointer to the start of this literal value
- char* tempPtr; // Temporary pointer
- char* tempMinPtr; // Temporary pointer into min_key
- int minKeyCnt = 0; // Number of fields in the min_key composite
- int maxKeyCnt = 0; // Number of fields in the max_key composite
- size_t tempLen = 0; // Temporary length
- uint16 DB2FieldWidth = 0; // DB2 field width
- uint32 workFieldLen = 0; // Length of workarea needed for CCSID conversions
- bool overrideInclusion; // Indicator for inclusion/exclusion
- char* endOfLiteralPtr; // Pointer to the end of this literal
- char* endOfMinPtr; // Pointer to end of min_key
- uint16 endByte = 0; // End byte of char or graphic literal (padding not included)
- bool reuseLiteral; // Indicator that hi and lo bounds use same literal
- char* minPtr = NULL; // Work pointer for traversing min_key
- char* maxPtr = NULL; // Work pointer for traversing max_key
- /*
- Handle the special case of 'x < null' anywhere in the key range. There are
- no values less than null, but return 1 so that MySQL does not assume
- the empty set for the query.
- */
- if (min_key != NULL && max_key != NULL &&
- min_key->flag == HA_READ_AFTER_KEY && max_key->flag == HA_READ_BEFORE_KEY &&
- min_key->length == max_key->length &&
- (memcmp((uchar*)min_key->key,(uchar*)max_key->key,min_key->length)==0))
- {
- DBUG_PRINT("ha_ibmdb2i::records_in_range",("Estimate 1 row for key %d; special case: < null", inx));
- DBUG_RETURN((ha_rows) 1 );
- }
- /*
- Determine the number of fields in the key composite.
- */
-
- if (min_key)
- {
- minKeyCnt = getKeyCntFromMap(min_key->keypart_map);
- minPtr = (char*)min_key->key;
- }
- if (max_key)
- {
- maxKeyCnt = getKeyCntFromMap(max_key->keypart_map);
- maxPtr = (char*)max_key->key;
- }
- keyCnt = maxKeyCnt >= minKeyCnt ? maxKeyCnt : minKeyCnt;
-
- /*
- Handle the special case where MySQL does not pass either a min or max
- key range. In this case, set the key count to 1 (knowing that there
- is at least one key field) to flow through and create one bounds structure.
- When both the min and max key ranges are nil, the bounds structure will
- specify positive and negative infinity and DB2 will estimate the total
- number of rows. */
-
- if (keyCnt == 0)
- keyCnt = 1;
-
- /*
- Allocate the space needed to pass range information to DB2. The
- space must be large enough to store the following:
- - one pair of bounds (high and low) per field in the key composite
- - one literal definition per literal value
- - the literal values
- - work area for literal CCSID conversions
- Since we don't know yet how many of these structures are needed,
- allocate enough space for the maximum that we will possibly need.
- The workarea for the literal conversion must be big enough to hold the
- largest of the DB2 key fields.
- */
- KEY& curKey = table->key_info[inx];
-
- for (int i = 0; i < keyCnt; i++)
- {
- DB2FieldWidth =
- db2Table->db2Field(curKey.key_part[i].field->field_index).getByteLengthInRecord();
- if (DB2FieldWidth > workFieldLen)
- workFieldLen = DB2FieldWidth; // Get length of largest DB2 field
- tempLen = tempLen + DB2FieldWidth; // Tally the DB2 field lengths
- }
- spcLen = (sizeof(Bounds)*keyCnt) + (sizeof(LitDef)*keyCnt*2) + (tempLen*2) + workFieldLen;
-
- ValidatedPointer<char> spcPtr(spcLen); // Pointer to space passed to DB2
- memset(spcPtr, 0, spcLen); // Clear the allocated space
- /*
- Set addressability to the various sections of the DB2 interface space.
- */
- boundsOff = 0; // Range bounds are at the start of the space
- litDefOff = sizeof(Bounds) * keyCnt; // Literal defs follow all the range bounds
- literalsOff = litDefOff + (sizeof(LitDef) * keyCnt * 2); // Literal values are last
- boundsPtr = (Bounds_t*)(void*)spcPtr; // Address first bounds structure
- tempPtr = (char*)((char*)spcPtr + litDefOff);
- litDefPtr = (LitDef_t*)tempPtr; // Address first literal definition
- tempPtr = (char*)((char*)spcPtr + literalsOff);
- literalsPtr = (char*)tempPtr; // Address start of literal values
- literalPtr = literalsPtr; // Address first literal value
- /*
- For each key part, build the low (min) and high (max) DB2 range bounds.
- If literals are specified in the MySQL range, build DB2 literal
- definitions and store the literal values for access by DB2.
-
- If no value is specified for a key part, assume infinity. Negative
- infinity will cause processing to start at the first index entry.
- Positive infinity will cause processing to end at the last index entry.
- When infinity is specified in a bound, inclusion/exclusion and position
- are ignored, and there is no literal definition or literal value for
- the bound.
-
- If the keypart value is null, the null indicator is set in the range
- bound and the other fields in the bound are ignored. When the bound is
- null, only index entries with the null value will be included in the
- estimate. If one bound is null, both bounds must be null. When the bound
- is not null, the data offset and length must be set, and the literal
- value stored for access by DB2.
- */
- for (int partsInUse = 0; partsInUse < keyCnt; ++partsInUse)
- {
- Field *field= curKey.key_part[partsInUse].field;
- overrideInclusion = false;
- reuseLiteral = false;
- endOfLiteralPtr = NULL;
- /*
- Build the low bound for the key range.
- */
- if ((partsInUse + 1) > minKeyCnt) // if no min_key info for this part
- boundsPtr->LoBound.Infinity[0] = QMY_NEG_INFINITY; // select...where 3 between x and y
- else
- {
- if ((curKey.key_part[partsInUse].null_bit) && (char*)minPtr[0])
- { // min_key is null
- if (max_key == NULL ||
- ((partsInUse + 1) > maxKeyCnt)) // select...where x='ab' and y=null and z != 'c'
- boundsPtr->LoBound.Infinity[0] = QMY_NEG_INFINITY; // select...where x not null or
- // select...where x > null
- else // max_key is not null
- {
- if (min_key->flag == HA_READ_KEY_EXACT)
- boundsPtr->LoBound.IsNull[0] = QMY_YES; // select...where x is null
- else
- {
- if ((char*)maxPtr[0])
- boundsPtr->LoBound.IsNull[0] = QMY_YES; // select...where a = null and b < 5 (max-before)
- // select...where a='a' and b is null and c !='a' (max-after)
- else
- boundsPtr->LoBound.Infinity[0] = QMY_NEG_INFINITY; // select...where x < y
- }
- } // end min_key is null
- }
- else // min_key is not null
- {
- if (literalCnt) litDefPtr = litDefPtr + 1;
- literalCnt = literalCnt + 1;
- boundsPtr->LoBound.Position = literalCnt;
- /*
- Determine inclusion or exclusion.
- */
- if (min_key->flag == HA_READ_KEY_EXACT || //select...where a like 'this%'
-
- /* An example for the following conditions is 'select...where a = 5 and b > null'. */
-
- (max_key &&
- (memcmp((uchar*)minPtr,(uchar*)maxPtr,
- curKey.key_part[partsInUse].store_length)==0)))
-
- {
- if ((min_key->flag != HA_READ_KEY_EXACT) ||
- (max_key &&
- (memcmp((uchar*)minPtr,(uchar*)maxPtr,
- curKey.key_part[partsInUse].store_length)==0)))
- overrideInclusion = true; // Need inclusion for both min and max
- }
- else
- boundsPtr->LoBound.Embodiment[0] = QMY_EXCLUSION;
- litDefPtr->FieldNbr = field->field_index + 1;
- DB2Field& db2Field = db2Table->db2Field(field->field_index);
- litDefPtr->DataType = db2Field.getType();
- /*
- Convert the literal to DB2 format
- */
- if ((field->type() != MYSQL_TYPE_BIT) && // Don't do conversion on BIT data
- (field->charset() != &my_charset_bin) && // Don't do conversion on BINARY data
- (litDefPtr->DataType == QMY_CHAR ||
- litDefPtr->DataType == QMY_VARCHAR ||
- litDefPtr->DataType == QMY_GRAPHIC ||
- litDefPtr->DataType == QMY_VARGRAPHIC))
- {
- // Most of the code is required by the considerable wrangling needed
- // to prepare partial keys for use by DB2
- // 1. UTF8 (CCSID 1208) data can be copied across unmodified if it is
- // utf8_bin. Otherwise, we need to convert the min and max
- // characters into the min and max characters employed
- // by the DB2 sort sequence. This is complicated by the fact that
- // the character widths are not always equal.
- // 2. Likewise, UCS2 (CCSID 13488) data can be copied across unmodified
- // if it is ucs2_bin or ucs2_general_ci. Otherwise, we need to
- // convert the min and max characters into the min and max characters
- // employed by the DB2 sort sequence.
- // 3. All other data will use standard iconv conversions. If an
- // unconvertible character is encountered, we assume it is the min
- // char and fill the remainder of the DB2 key with 0s. This may not
- // always be accurate, but it is probably sufficient for range
- // estimations.
- const char* keyData = minPtr+((curKey.key_part[partsInUse].null_bit)? 1 : 0);
- char* db2Data = literalPtr;
- uint16 outLen = db2Field.getByteLengthInRecord();
- uint16 inLen;
- if (litDefPtr->DataType == QMY_VARCHAR ||
- litDefPtr->DataType == QMY_VARGRAPHIC)
- {
- inLen = *(uint8*)keyData + ((*(uint8*)(keyData+1)) << 8);
- keyData += 2;
- outLen -= sizeof(uint16);
- db2Data += sizeof(uint16);
- }
- else
- {
- inLen = field->max_display_length();
- }
-
- size_t convertedBytes = 0;
- if (db2Field.getCCSID() == 1208)
- {
- DBUG_ASSERT(inLen <= outLen);
- if (strcmp(field->charset()->name, "utf8_bin"))
- {
- const char* end = keyData+inLen;
- const char* curKey = keyData;
- char* curDB2 = db2Data;
- uint32 min = field->charset()->min_sort_char;
- while ((curKey < end) && (curDB2 < db2Data+outLen-3))
- {
- my_wc_t temp;
- int len = field->charset()->cset->mb_wc(field->charset(),
- &temp,
- (const uchar*)curKey,
- (const uchar*)end);
- if (temp != min)
- {
- DBUG_ASSERT(len <= 3);
- switch (len)
- {
- case 3: *(curDB2+2) = *(curKey+2);
- case 2: *(curDB2+1) = *(curKey+1);
- case 1: *(curDB2) = *(curKey);
- }
- curDB2 += len;
- }
- else
- {
- *(curDB2++) = 0xEF;
- *(curDB2++) = 0xBF;
- *(curDB2++) = 0xBF;
- }
- curKey += len;
- }
- convertedBytes = curDB2 - db2Data;
- }
- else
- {
- memcpy(db2Data, keyData, inLen);
- convertedBytes = inLen;
- }
- rc = 0;
- }
- else if (db2Field.getCCSID() == 13488)
- {
- DBUG_ASSERT(inLen <= outLen);
- if (strcmp(field->charset()->name, "ucs2_bin") &&
- strcmp(field->charset()->name, "ucs2_general_ci"))
- {
- const char* end = keyData+inLen;
- const uint16* curKey = (uint16*)keyData;
- uint16* curDB2 = (uint16*)db2Data;
- uint16 min = field->charset()->min_sort_char;
- while (curKey < (uint16*)end)
- {
- if (*curKey != min)
- *curDB2 = *curKey;
- else
- *curDB2 = 0xFFFF;
- ++curKey;
- ++curDB2;
- }
- }
- else
- {
- memcpy(db2Data, keyData, inLen);
- }
- convertedBytes = inLen;
- rc = 0;
- }
- else
- {
- rc = convertFieldChars(toDB2,
- field->field_index,
- keyData,
- db2Data,
- inLen,
- outLen,
- &convertedBytes,
- true);
-
- if (rc == DB2I_ERR_ILL_CHAR)
- {
- // If an illegal character is encountered, we fill the remainder
- // of the key with 0x00. This was implemented as a corollary to
- // Bug#45012, though it should probably remain even after that
- // bug is fixed.
- memset(db2Data+convertedBytes, 0x00, outLen-convertedBytes);
- convertedBytes = outLen;
- rc = 0;
- }
- }
-
- if (!rc &&
- (litDefPtr->DataType == QMY_VARGRAPHIC ||
- litDefPtr->DataType == QMY_VARCHAR))
- {
- *(uint16*)(db2Data-sizeof(uint16)) =
- convertedBytes / (litDefPtr->DataType == QMY_VARGRAPHIC ? 2 : 1);
- }
-
- }
- else // Non-character fields
- {
- rc = convertMySQLtoDB2(field,
- db2Field,
- literalPtr,
- (uchar*)minPtr+((curKey.key_part[partsInUse].null_bit)? 1 : 0));
- }
-
- if (rc != 0) break;
- litDefPtr->Offset = (uint32_t)(literalPtr - literalsPtr);
- litDefPtr->Length = db2Field.getByteLengthInRecord();
- literalPtr = literalPtr + litDefPtr->Length; // Bump pointer for next literal
- }
- /* If there is a max_key value for this field, and if the max_key value is
- the same as the min_key value, then the low bound literal can be reused
- for the high bound literal. This eliminates the overhead of copying and
- converting the same value twice. */
- if (max_key && ((partsInUse + 1) <= maxKeyCnt) &&
- (memcmp((uchar*)minPtr,(uchar*)maxPtr,
- curKey.key_part[partsInUse].store_length)==0 || endOfLiteralPtr))
- reuseLiteral = true;
- minPtr += curKey.key_part[partsInUse].store_length;
- }
- /*
- Build the high bound for the key range.
- */
- if (max_key == NULL || ((partsInUse + 1) > maxKeyCnt))
- boundsPtr->HiBound.Infinity[0] = QMY_POS_INFINITY;
- else
- {
- if ((curKey.key_part[partsInUse].null_bit) && (char*)maxPtr[0])
- {
- if (min_key == NULL)
- boundsPtr->HiBound.Infinity[0] = QMY_POS_INFINITY;
- else
- boundsPtr->HiBound.IsNull[0] = QMY_YES; // select...where x is null
- }
- else // max_key field is not null
- {
- if (boundsPtr->LoBound.IsNull[0] == QMY_YES) // select where x < 10 or x is null
- {
- rc = HA_POS_ERROR;
- break;
- }
- if (!reuseLiteral)
- {
- if (literalCnt)
- litDefPtr = litDefPtr + 1;
- literalCnt = literalCnt + 1;
- litDefPtr->FieldNbr = field->field_index + 1;
- DB2Field& db2Field = db2Table->db2Field(field->field_index);
- litDefPtr->DataType = db2Field.getType();
- /*
- Convert the literal to DB2 format
- */
- if ((field->type() != MYSQL_TYPE_BIT) && // Don't do conversion on BIT data
- (field->charset() != &my_charset_bin) && // Don't do conversion on BINARY data
- (litDefPtr->DataType == QMY_CHAR ||
- litDefPtr->DataType == QMY_VARCHAR ||
- litDefPtr->DataType == QMY_GRAPHIC ||
- litDefPtr->DataType == QMY_VARGRAPHIC))
- {
- // We need to handle char fields in a special way in order to account
- // for partial keys. Refer to the note above for a description of the
- // basic design.
- char* keyData = maxPtr+((curKey.key_part[partsInUse].null_bit)? 1 : 0);
- char* db2Data = literalPtr;
- uint16 outLen = db2Field.getByteLengthInRecord();
- uint16 inLen;
- if (litDefPtr->DataType == QMY_VARCHAR ||
- litDefPtr->DataType == QMY_VARGRAPHIC)
- {
- inLen = *(uint8*)keyData + ((*(uint8*)(keyData+1)) << 8);
- keyData += 2;
- outLen -= sizeof(uint16);
- db2Data += sizeof(uint16);
- }
- else
- {
- inLen = field->max_display_length();
- }
-
- size_t convertedBytes;
- if (db2Field.getCCSID() == 1208)
- {
- if (strcmp(field->charset()->name, "utf8_bin"))
- {
- const char* end = keyData+inLen;
- const char* curKey = keyData;
- char* curDB2 = db2Data;
- uint32 max = field->charset()->max_sort_char;
- while (curKey < end && (curDB2 < db2Data+outLen-3))
- {
- my_wc_t temp;
- int len = field->charset()->cset->mb_wc(field->charset(), &temp, (const uchar*)curKey, (const uchar*)end);
- if (temp != max)
- {
- DBUG_ASSERT(len <= 3);
- switch (len)
- {
- case 3: *(curDB2+2) = *(curKey+2);
- case 2: *(curDB2+1) = *(curKey+1);
- case 1: *(curDB2) = *(curKey);
- }
- curDB2 += len;
- }
- else
- {
- *(curDB2++) = 0xE4;
- *(curDB2++) = 0xB6;
- *(curDB2++) = 0xBF;
- }
- curKey += len;
- }
- convertedBytes = curDB2 - db2Data;
- }
- else
- {
- DBUG_ASSERT(inLen <= outLen);
- memcpy(db2Data, keyData, inLen);
- convertedBytes = inLen;
- }
- rc = 0;
- }
- else if (db2Field.getCCSID() == 13488)
- {
- if (strcmp(field->charset()->name, "ucs2_bin") &&
- strcmp(field->charset()->name, "ucs2_general_ci"))
- {
- char* end = keyData+inLen;
- uint16* curKey = (uint16*)keyData;
- uint16* curDB2 = (uint16*)db2Data;
- uint16 max = field->charset()->max_sort_char;
- while (curKey < (uint16*)end)
- {
- if (*curKey != max)
- *curDB2 = *curKey;
- else
- *curDB2 = 0x4DBF;
- ++curKey;
- ++curDB2;
- }
- }
- else
- {
- memcpy(db2Data, keyData, outLen);
- }
- rc = 0;
- }
- else
- {
- size_t substituteChars = 0;
- rc = convertFieldChars(toDB2,
- field->field_index,
- keyData,
- db2Data,
- inLen,
- outLen,
- &convertedBytes,
- true,
- &substituteChars);
-
- if (rc == DB2I_ERR_ILL_CHAR)
- {
- // If an illegal character is encountered, we fill the remainder
- // of the key with 0xFF. This was implemented to work around
- // Bug#45012, though it should probably remain even after that
- // bug is fixed.
- memset(db2Data+convertedBytes, 0xFF, outLen-convertedBytes);
- rc = 0;
- }
- else if ((substituteChars &&
- (litDefPtr->DataType == QMY_VARCHAR ||
- litDefPtr->DataType == QMY_CHAR)) ||
- strcmp(field->charset()->name, "cp1251_bulgarian_ci") == 0)
- {
- // When iconv translates the max_sort_char with a substitute
- // character, we have no way to know whether this affects
- // the sort order of the key. Therefore, to be safe, when
- // we know that substitute characters have been used in a
- // single-byte string, we traverse the translated key
- // in reverse, replacing substitue characters with 0xFF, which
- // always sorts with the greatest weight in DB2 sort sequences.
- // cp1251_bulgarian_ci is also handled this way because the
- // max_sort_char is a control character which does not sort
- // equivalently in DB2.
- DBUG_ASSERT(inLen == outLen);
- char* tmpKey = keyData + inLen - 1;
- char* tmpDB2 = db2Data + outLen - 1;
- while (*tmpKey == field->charset()->max_sort_char &&
- *tmpDB2 != 0xFF)
- {
- *tmpDB2 = 0xFF;
- --tmpKey;
- --tmpDB2;
- }
- }
- }
-
- if (!rc &&
- (litDefPtr->DataType == QMY_VARGRAPHIC ||
- litDefPtr->DataType == QMY_VARCHAR))
- {
- *(uint16*)(db2Data-sizeof(uint16)) =
- outLen / (litDefPtr->DataType == QMY_VARGRAPHIC ? 2 : 1);
- }
- }
- else
- {
- rc = convertMySQLtoDB2(field,
- db2Field,
- literalPtr,
- (uchar*)maxPtr+((curKey.key_part[partsInUse].null_bit)? 1 : 0));
- }
- if (rc != 0) break;
- litDefPtr->Offset = (uint32_t)(literalPtr - literalsPtr);
- litDefPtr->Length = db2Field.getByteLengthInRecord();
- literalPtr = literalPtr + litDefPtr->Length; // Bump pointer for next literal
- }
- boundsPtr->HiBound.Position = literalCnt;
- if (max_key->flag == HA_READ_BEFORE_KEY && !overrideInclusion)
- boundsPtr->HiBound.Embodiment[0] = QMY_EXCLUSION;
- }
- maxPtr += curKey.key_part[partsInUse].store_length;
- }
- /*
- Bump to the next field in the key composite.
- */
-
- if ((partsInUse+1) < keyCnt)
- boundsPtr = boundsPtr + 1;
- }
-
- /*
- Call DB2 to estimate the number of rows in the key range.
- */
- if (rc == 0)
- {
- rc = db2i_ileBridge::getBridgeForThread()->recordsInRange((indexHandles[inx] ? indexHandles[inx] : db2Table->indexFile(inx)->getMasterDefnHandle()),
- spcPtr,
- keyCnt,
- literalCnt,
- boundsOff,
- litDefOff,
- literalsOff,
- cutoff,
- (uint32_t)(literalPtr - (char*)spcPtr),
- endByte,
- &recCnt,
- &rtnCode);
- }
- /*
- Set the row count and return.
- Beware that if this method returns a zero row count, MySQL assumes the
- result set for the query is zero; never return a zero row count.
- */
- if ((rc == 0) && (rtnCode == QMY_SUCCESS || rtnCode == QMY_EARLY_EXIT))
- {
- rows = recCnt ? (ha_rows)recCnt : 1;
- }
-
- rows = (rows > 0 ? rows : HA_POS_ERROR);
-
- setIndexReadEstimate(inx, rows);
-
- DBUG_PRINT("ha_ibmdb2i::recordsInRange",("Estimate %d rows for key %d", uint32(rows), inx));
-
- DBUG_RETURN(rows);
-}
diff --git a/storage/ibmdb2i/db2i_safeString.h b/storage/ibmdb2i/db2i_safeString.h
deleted file mode 100644
index e353316c8fc..00000000000
--- a/storage/ibmdb2i/db2i_safeString.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-
-#ifndef DB2I_SAFESTRING_H
-#define DB2I_SAFESTRING_H
-
-
-#include <my_global.h>
-#include <string.h>
-
-/**
- @class SafeString
-
- This class was designed to provide safe, but lightweight, concatenation
- operations C strings inside pre-allocated buffers.
-*/
-class SafeString
-{
-public:
- SafeString(char* buffer, size_t size) :
- allocSize(size), curPos(0), buf(buffer)
- {
- DBUG_ASSERT(size > 0);
- buf[allocSize - 1] = 0xFF; // Set an overflow indicator
- }
-
- char* ptr() { return buf; }
- operator char*() { return buf; }
-
- SafeString& strcat(const char* str)
- {
- return this->strncat(str, strlen(str));
- }
-
- SafeString& strcat(char one)
- {
- if (curPos < allocSize - 2)
- {
- buf[curPos++] = one;
- }
- buf[curPos] = 0;
-
- return *this;
- }
-
- SafeString& strncat(const char* str, size_t len)
- {
- uint64 amountToCopy = min((allocSize-1) - curPos, len);
- memcpy(buf + curPos, str, amountToCopy);
- curPos += amountToCopy;
- buf[curPos] = 0;
- return *this;
- }
-
- bool overflowed() const { return (buf[allocSize - 1] == 0);}
-
-private:
- char* buf;
- uint64 curPos;
- size_t allocSize;
-};
-
-
-#endif
diff --git a/storage/ibmdb2i/db2i_sqlStatementStream.cc b/storage/ibmdb2i/db2i_sqlStatementStream.cc
deleted file mode 100644
index 92a8b03fd00..00000000000
--- a/storage/ibmdb2i/db2i_sqlStatementStream.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#include "db2i_sqlStatementStream.h"
-#include "as400_types.h"
-
-/**
- Add a statement to the statement stream, allocating additional memory as needed.
-
- @parm stmt The statement text
- @parm length The length of the statement text
- @parm fileSortSequence The DB2 sort sequence identifier, in EBCDIC
- @parm fileSortSequenceLibrary The DB2 sort sequence library, in EBCDIC
-
- @return Reference to this object
-*/
-SqlStatementStream& SqlStatementStream::addStatementInternal(const char* stmt,
- uint32 length,
- const char* fileSortSequence,
- const char* fileSortSequenceLibrary)
-{
- uint32 storageNeeded = length + sizeof(StmtHdr_t);
- storageNeeded = (storageNeeded + 3) & ~3; // We have to be 4-byte aligned.
- if (storageNeeded > storageRemaining())
- {
- // We overallocate new storage to reduce number of times reallocation is
- // needed.
- int newSize = curSize + 2 * storageNeeded;
- DBUG_PRINT("SqlStatementStream::addStatementInternal",
- ("PERF: Had to realloc! Old size=%d. New size=%d", curSize, newSize));
- char* old_space = block;
- char* new_space = (char*)getNewSpace(newSize);
- memcpy(new_space, old_space, curSize);
- ptr = new_space + (ptr - old_space);
- curSize = newSize;
- }
-
- DBUG_ASSERT((address64_t)ptr % 4 == 0);
-
- memcpy(((StmtHdr_t*)ptr)->SrtSeqNam,
- fileSortSequence,
- sizeof(((StmtHdr_t*)ptr)->SrtSeqNam));
- memcpy(((StmtHdr_t*)ptr)->SrtSeqSch,
- fileSortSequenceLibrary,
- sizeof(((StmtHdr_t*)ptr)->SrtSeqSch));
- ((StmtHdr_t*)ptr)->Length = length;
- memcpy(ptr + sizeof(StmtHdr_t), stmt, length);
-
- ptr += storageNeeded;
- ++statements;
-
- return *this;
-}
diff --git a/storage/ibmdb2i/db2i_sqlStatementStream.h b/storage/ibmdb2i/db2i_sqlStatementStream.h
deleted file mode 100644
index 11db41a6c5d..00000000000
--- a/storage/ibmdb2i/db2i_sqlStatementStream.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-#ifndef DB2I_SQLSTATEMENTSTREAM_H
-#define DB2I_SQLSTATEMENTSTREAM_H
-
-#include "db2i_charsetSupport.h"
-#include "qmyse.h"
-
-/**
- @class SqlStatementStream
-
- This class handles building the stream of SQL statements expected by the
- QMY_EXECUTE_IMMEDIATE and QMY_PREPARE_OPEN_CURSOR APIs.
- Memory allocation is handled internally.
-*/
-class SqlStatementStream
-{
- public:
- /**
- ctor to be used when multiple strings may be appended.
- */
- SqlStatementStream(uint32 firstStringSize) : statements(0)
- {
- curSize = firstStringSize + sizeof(StmtHdr_t);
- curSize = (curSize + 3) & ~3;
- ptr = (char*) getNewSpace(curSize);
- if (ptr == NULL)
- curSize = 0;
- }
-
- /**
- ctor to be used when only a single statement will be executed.
- */
- SqlStatementStream(const String& statement) : statements(0), block(NULL), curSize(0), ptr(0)
- {
- addStatement(statement);
- }
-
- /**
- ctor to be used when only a single statement will be executed.
- */
- SqlStatementStream(const char* statement) : statements(0), block(NULL), curSize(0), ptr(0)
- {
- addStatement(statement);
- }
-
- /**
- Append an SQL statement, specifiying the DB2 sort sequence under which
- the statement should be executed. This is important for CREATE TABLE
- and CREATE INDEX statements.
- */
- SqlStatementStream& addStatement(const String& append, const char* fileSortSequence, const char* fileSortSequenceLibrary)
- {
- char sortSeqEbcdic[10];
- char sortSeqLibEbcdic[10];
-
- DBUG_ASSERT(strlen(fileSortSequence) <= 10 &&
- strlen(fileSortSequenceLibrary) <= 10);
- memset(sortSeqEbcdic, 0x40, 10);
- memset(sortSeqLibEbcdic, 0x40, 10);
- convToEbcdic(fileSortSequence, sortSeqEbcdic, strlen(fileSortSequence));
- convToEbcdic(fileSortSequenceLibrary, sortSeqLibEbcdic, strlen(fileSortSequenceLibrary));
-
- return addStatementInternal(append.ptr(), append.length(), sortSeqEbcdic, sortSeqLibEbcdic);
- }
-
- /**
- Append an SQL statement using default (*HEX) sort sequence.
- */
- SqlStatementStream& addStatement(const String& append)
- {
- const char splatHEX[] = {0x5C, 0xC8, 0xC5, 0xE7, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40}; // *HEX
- const char blanks[] = {0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40}; //
-
- return addStatementInternal(append.ptr(), append.length(), splatHEX, blanks);
- }
-
- /**
- Append an SQL statement using default (*HEX) sort sequence.
- */
- SqlStatementStream& addStatement(const char* stmt)
- {
- const char splatHEX[] = {0x5C, 0xC8, 0xC5, 0xE7, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40}; // *HEX
- const char blanks[] = {0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40}; //
-
- return addStatementInternal(stmt, strlen(stmt), splatHEX, blanks);
- }
-
- char* getPtrToData() const { return block; }
- uint32 getStatementCount() const { return statements; }
- private:
- SqlStatementStream& addStatementInternal(const char* stmt,
- uint32 length,
- const char* fileSortSequence,
- const char* fileSortSequenceLibrary);
-
- uint32 storageRemaining() const
- {
- return (block == NULL ? 0 : curSize - (ptr - block));
- }
-
- char* getNewSpace(size_t size)
- {
- allocBase = (char*)sql_alloc(size + 15);
- block = (char*)roundToQuadWordBdy(allocBase);
- return block;
- }
-
- uint32 curSize; // The size of the usable memory.
- char* allocBase; // The allocated memory (with padding for aligment)
- char* block; // The usable memory chunck (aligned for ILE)
- char* ptr; // The current position within block.
- uint32 statements; // The number of statements that have been appended.
-};
-
-#endif
-
diff --git a/storage/ibmdb2i/db2i_validatedPointer.h b/storage/ibmdb2i/db2i_validatedPointer.h
deleted file mode 100644
index c4e31d1f11b..00000000000
--- a/storage/ibmdb2i/db2i_validatedPointer.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-#ifndef DB2I_VALIDATEDPOINTER_H
-#define DB2I_VALIDATEDPOINTER_H
-
-#include "db2i_ileBridge.h"
-
-/**
- @class ValidatedPointer
- @brief Encapsulates a pointer registered for usage by the QMYSE APIs
-
- @details As a performance optimization, to prevent pointer validation each
- time a particular pointer is thunked across to ILE, QMYSE allows us to
- "register" a pointer such that it is validated once and then subsequently
- referenced on QMYSE APIs by means of a handle value. This class should be
- used to manage memory allocation/registration/unregistration of these
- pointers. Using the alloc function guarantees that the resulting storage is
- 16-byte aligned, a requirement for many pointers passed to QMYSE.
-*/
-template <class T>
-class ValidatedPointer
-{
-public:
- ValidatedPointer<T>() : address(NULL), handle(NULL) {;}
-
- ValidatedPointer<T>(size_t size)
- {
- alloc(size);
- }
-
- ValidatedPointer<T>(T* ptr)
- {
- assign(ptr);
- }
-
- operator T*()
- {
- return address;
- };
-
- operator T*() const
- {
- return address;
- };
-
- operator void*()
- {
- return address;
- };
-
- operator ILEMemHandle()
- {
- return handle;
- }
-
- void alloc(size_t size)
- {
- address = (T*)malloc_aligned(size);
- if (address)
- db2i_ileBridge::registerPtr(address, &handle);
- mallocedHere = 1;
- }
-
- void assign(T* ptr)
- {
- address = ptr;
- db2i_ileBridge::registerPtr((void*)ptr, &handle);
- mallocedHere = 0;
- }
-
- void realloc(size_t size)
- {
- dealloc();
- alloc(size);
- }
-
- void reassign(T* ptr)
- {
- dealloc();
- assign(ptr);
- }
-
- void dealloc()
- {
- if (address)
- {
- db2i_ileBridge::unregisterPtr(handle);
-
- if (mallocedHere)
- free_aligned((void*)address);
- }
- address = NULL;
- handle = 0;
- }
-
- ~ValidatedPointer()
- {
- dealloc();
- }
-
-private:
- // Disable copy ctor and assignment operator, as these would break
- // the registration guarantees provided by the class.
- ValidatedPointer& operator= (const ValidatedPointer newVal);
- ValidatedPointer(ValidatedPointer& newCopy);
-
- ILEMemHandle handle;
- T* address;
- char mallocedHere;
-};
-
-
-/**
- @class ValidatedObject
- @brief This class allows users to instantiate and register a particular
- object in a single step.
-*/
-template<class T>
-class ValidatedObject : public ValidatedPointer<T>
-{
- public:
- ValidatedObject<T>() : ValidatedPointer<T>(&value) {;}
-
- T& operator= (const T newVal) { value = newVal; return value; }
-
- private:
- T value;
-};
-#endif
diff --git a/storage/ibmdb2i/ha_ibmdb2i.cc b/storage/ibmdb2i/ha_ibmdb2i.cc
deleted file mode 100644
index f6f1e2bc568..00000000000
--- a/storage/ibmdb2i/ha_ibmdb2i.cc
+++ /dev/null
@@ -1,3374 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-
-/**
- @file ha_ibmdb2i.cc
-
- @brief
- The ha_ibmdb2i storage engine provides an interface from MySQL to IBM DB2 for i.
-
-*/
-
-#ifdef USE_PRAGMA_IMPLEMENTATION
-#pragma implementation // gcc: Class implementation
-#endif
-
-#include "ha_ibmdb2i.h"
-#include "mysql_priv.h"
-#include <mysql/plugin.h>
-#include "db2i_ileBridge.h"
-#include "db2i_charsetSupport.h"
-#include <sys/utsname.h>
-#include "db2i_safeString.h"
-
-static const char __NOT_NULL_VALUE_EBCDIC = 0xF0; // '0'
-static const char __NULL_VALUE_EBCDIC = 0xF1; // '1'
-static const char __DEFAULT_VALUE_EBCDIC = 0xC4; // 'D'
-static const char BlankASPName[19] = " ";
-static const int DEFAULT_MAX_ROWS_TO_BUFFER = 4096;
-
-static const char SAVEPOINT_PREFIX[] = {0xD4, 0xE8, 0xE2, 0xD7}; // MYSP (in EBCDIC)
-
-OSVersion osVersion;
-
-
-// ================================================================
-// ================================================================
-// System variables
-static char* ibmdb2i_rdb_name;
-static MYSQL_SYSVAR_STR(rdb_name, ibmdb2i_rdb_name,
- PLUGIN_VAR_MEMALLOC | PLUGIN_VAR_READONLY,
- "The name of the RDB to use",
- NULL,
- NULL,
- BlankASPName);
-
-static MYSQL_THDVAR_BOOL(transaction_unsafe,
- 0,
- "Disable support for commitment control",
- NULL,
- NULL,
- FALSE);
-
-static MYSQL_THDVAR_UINT(lob_alloc_size,
- 0,
- "Baseline allocation for lob read buffer",
- NULL,
- NULL,
- 2*1024*1024,
- 64*1024,
- 128*1024*1024,
- 1);
-
-static MYSQL_THDVAR_UINT(max_read_buffer_size,
- 0,
- "Maximum size of buffers used for read-ahead.",
- NULL,
- NULL,
- 1*1024*1024,
- 32*1024,
- 16*1024*1024,
- 1);
-
-static MYSQL_THDVAR_UINT(max_write_buffer_size,
- 0,
- "Maximum size of buffers used for bulk writes.",
- NULL,
- NULL,
- 8*1024*1024,
- 32*1024,
- 64*1024*1024,
- 1);
-
-static MYSQL_THDVAR_BOOL(compat_opt_time_as_duration,
- 0,
- "Control how new TIME columns should be defined in DB2. 0=time-of-day (default), 1=duration.",
- NULL,
- NULL,
- FALSE);
-
-static MYSQL_THDVAR_UINT(compat_opt_year_as_int,
- 0,
- "Control how new YEAR columns should be defined in DB2. 0=CHAR(4) (default), 1=SMALLINT.",
- NULL,
- NULL,
- 0,
- 0,
- 1,
- 1);
-
-static MYSQL_THDVAR_UINT(compat_opt_blob_cols,
- 0,
- "Control how new TEXT and BLOB columns should be defined in DB2. 0=CLOB/BLOB (default), 1=VARCHAR/VARBINARY",
- NULL,
- NULL,
- 0,
- 0,
- 1,
- 1);
-
-static MYSQL_THDVAR_UINT(compat_opt_allow_zero_date_vals,
- 0,
- "Allow substitute values to be used when storing a column with a 0000-00-00 date component. 0=No substitution (default), 1=Substitute '0001-01-01'",
- NULL,
- NULL,
- 0,
- 0,
- 1,
- 1);
-
-static MYSQL_THDVAR_BOOL(propagate_default_col_vals,
- 0,
- "Should DEFAULT column values be propagated to the DB2 table definition.",
- NULL,
- NULL,
- TRUE);
-
-static my_bool ibmdb2i_assume_exclusive_use;
-static MYSQL_SYSVAR_BOOL(assume_exclusive_use, ibmdb2i_assume_exclusive_use,
- 0,
- "Can MySQL assume that this process is the only one modifying the DB2 tables. ",
- NULL,
- NULL,
- FALSE);
-
-static MYSQL_THDVAR_BOOL(async_enabled,
- 0,
- "Should reads be done asynchronously when possible",
- NULL,
- NULL,
- TRUE);
-
-static MYSQL_THDVAR_UINT(create_index_option,
- 0,
- "Control whether additional indexes are created. 0=No (default), 1=Create additional *HEX-based index",
- NULL,
- NULL,
- 0,
- 0,
- 1,
- 1);
-
-/* static MYSQL_THDVAR_UINT(discovery_mode,
- 0,
- "Unsupported",
- NULL,
- NULL,
- 0,
- 0,
- 1,
- 1); */
-
-static uint32 ibmdb2i_system_trace;
-static MYSQL_SYSVAR_UINT(system_trace_level, ibmdb2i_system_trace,
- 0,
- "Set system tracing level",
- NULL,
- NULL,
- 0,
- 0,
- 63,
- 1);
-
-
-inline uint8 ha_ibmdb2i::getCommitLevel(THD* thd)
-{
- if (!THDVAR(thd, transaction_unsafe))
- {
- switch (thd_tx_isolation(thd))
- {
- case ISO_READ_UNCOMMITTED:
- return (accessIntent == QMY_READ_ONLY ? QMY_READ_UNCOMMITTED : QMY_REPEATABLE_READ);
- case ISO_READ_COMMITTED:
- return (accessIntent == QMY_READ_ONLY ? QMY_READ_COMMITTED : QMY_REPEATABLE_READ);
- case ISO_REPEATABLE_READ:
- return QMY_REPEATABLE_READ;
- case ISO_SERIALIZABLE:
- return QMY_SERIALIZABLE;
- }
- }
-
- return QMY_NONE;
-}
-
-inline uint8 ha_ibmdb2i::getCommitLevel()
-{
- return getCommitLevel(ha_thd());
-}
-
-//=====================================================================
-
-static handler *ibmdb2i_create_handler(handlerton *hton,
- TABLE_SHARE *table,
- MEM_ROOT *mem_root);
-static void ibmdb2i_drop_database(handlerton *hton, char* path);
-static int ibmdb2i_savepoint_set(handlerton *hton, THD* thd, void *sv);
-static int ibmdb2i_savepoint_rollback(handlerton *hton, THD* thd, void *sv);
-static int ibmdb2i_savepoint_release(handlerton *hton, THD* thd, void *sv);
-static uint ibmdb2i_alter_table_flags(uint flags);
-
-handlerton *ibmdb2i_hton;
-static bool was_ILE_inited;
-
-/* Tracks the number of open tables */
-static HASH ibmdb2i_open_tables;
-
-/* Mutex used to synchronize initialization of the hash */
-static pthread_mutex_t ibmdb2i_mutex;
-
-
-/**
- Create hash key for tracking open tables.
-*/
-
-static uchar* ibmdb2i_get_key(IBMDB2I_SHARE *share,size_t *length,
- bool not_used __attribute__((unused)))
-{
- *length=share->table_name_length;
- return (uchar*) share->table_name;
-}
-
-
-int ibmdb2i_close_connection(handlerton* hton, THD *thd)
-{
- DBUG_PRINT("ha_ibmdb2i::close_connection", ("Closing %d", thd->thread_id));
- db2i_ileBridge::getBridgeForThread(thd)->closeConnection(thd->thread_id);
- db2i_ileBridge::destroyBridgeForThread(thd);
-
- return 0;
-}
-
-
-static int ibmdb2i_init_func(void *p)
-{
- DBUG_ENTER("ibmdb2i_init_func");
-
- utsname tempName;
- uname(&tempName);
- osVersion.v = atoi(tempName.version);
- osVersion.r = atoi(tempName.release);
-
- was_ILE_inited = false;
- ibmdb2i_hton= (handlerton *)p;
- VOID(pthread_mutex_init(&ibmdb2i_mutex,MY_MUTEX_INIT_FAST));
- (void) my_hash_init(&ibmdb2i_open_tables,table_alias_charset,32,0,0,
- (my_hash_get_key) ibmdb2i_get_key,0,0);
-
- ibmdb2i_hton->state= SHOW_OPTION_YES;
- ibmdb2i_hton->create= ibmdb2i_create_handler;
- ibmdb2i_hton->drop_database= ibmdb2i_drop_database;
- ibmdb2i_hton->commit= ha_ibmdb2i::doCommit;
- ibmdb2i_hton->rollback= ha_ibmdb2i::doRollback;
- ibmdb2i_hton->savepoint_offset= 0;
- ibmdb2i_hton->savepoint_set= ibmdb2i_savepoint_set;
- ibmdb2i_hton->savepoint_rollback= ibmdb2i_savepoint_rollback;
- ibmdb2i_hton->savepoint_release= ibmdb2i_savepoint_release;
- ibmdb2i_hton->alter_table_flags=ibmdb2i_alter_table_flags;
- ibmdb2i_hton->close_connection=ibmdb2i_close_connection;
-
- int rc;
-
- rc = initCharsetSupport();
-
- if (!rc)
- rc = db2i_ileBridge::setup();
-
- if (!rc)
- {
- int nameLen = strlen(ibmdb2i_rdb_name);
- for (int i = 0; i < nameLen; ++i)
- {
- ibmdb2i_rdb_name[i] = my_toupper(system_charset_info, (uchar)ibmdb2i_rdb_name[i]);
- }
-
- rc = db2i_ileBridge::initILE(ibmdb2i_rdb_name, (uint16*)(((char*)&ibmdb2i_system_trace)+2));
- if (rc == 0)
- {
- was_ILE_inited = true;
- }
- }
-
- DBUG_RETURN(rc);
-}
-
-
-static int ibmdb2i_done_func(void *p)
-{
- int error= 0;
- DBUG_ENTER("ibmdb2i_done_func");
-
- if (ibmdb2i_open_tables.records)
- error= 1;
-
- if (was_ILE_inited)
- db2i_ileBridge::exitILE();
-
- db2i_ileBridge::takedown();
-
- doneCharsetSupport();
-
- my_hash_free(&ibmdb2i_open_tables);
- pthread_mutex_destroy(&ibmdb2i_mutex);
-
- DBUG_RETURN(0);
-}
-
-
-IBMDB2I_SHARE *ha_ibmdb2i::get_share(const char *table_name, TABLE *table)
-{
- IBMDB2I_SHARE *share;
- uint length;
- char *tmp_name;
-
- pthread_mutex_lock(&ibmdb2i_mutex);
- length=(uint) strlen(table_name);
-
- if (!(share=(IBMDB2I_SHARE*) my_hash_search(&ibmdb2i_open_tables,
- (uchar*)table_name,
- length)))
- {
- if (!(share=(IBMDB2I_SHARE *)
- my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
- &share, sizeof(*share),
- &tmp_name, length+1,
- NullS)))
- {
- pthread_mutex_unlock(&ibmdb2i_mutex);
- return NULL;
- }
-
- share->use_count=0;
- share->table_name_length=length;
- share->table_name=tmp_name;
- strmov(share->table_name,table_name);
- if (my_hash_insert(&ibmdb2i_open_tables, (uchar*) share))
- goto error;
- thr_lock_init(&share->lock);
- pthread_mutexattr_t mutexattr = MY_MUTEX_INIT_FAST;
- pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&share->mutex, &mutexattr);
-
- share->db2Table = new db2i_table(table->s, table_name);
- int32 rc = share->db2Table->initDB2Objects(table_name);
-
- if (rc)
- {
- delete share->db2Table;
- my_hash_delete(&ibmdb2i_open_tables, (uchar*) share);
- thr_lock_delete(&share->lock);
- my_errno = rc;
- goto error;
- }
-
- memset(&share->cachedStats, 0, sizeof(share->cachedStats));
- }
- share->use_count++;
- pthread_mutex_unlock(&ibmdb2i_mutex);
-
- db2Table = share->db2Table;
-
- return share;
-
-error:
- pthread_mutex_destroy(&share->mutex);
- my_free(share);
- pthread_mutex_unlock(&ibmdb2i_mutex);
-
- return NULL;
-}
-
-
-
-int ha_ibmdb2i::free_share(IBMDB2I_SHARE *share)
-{
- pthread_mutex_lock(&ibmdb2i_mutex);
- if (!--share->use_count)
- {
- delete share->db2Table;
- db2Table = NULL;
-
- my_hash_delete(&ibmdb2i_open_tables, (uchar*) share);
- thr_lock_delete(&share->lock);
- pthread_mutex_destroy(&share->mutex);
- my_free(share);
- pthread_mutex_unlock(&ibmdb2i_mutex);
- return 1;
- }
- pthread_mutex_unlock(&ibmdb2i_mutex);
-
- return 0;
-}
-
-static handler* ibmdb2i_create_handler(handlerton *hton,
- TABLE_SHARE *table,
- MEM_ROOT *mem_root)
-{
- return new (mem_root) ha_ibmdb2i(hton, table);
-}
-
-static void ibmdb2i_drop_database(handlerton *hton, char* path)
-{
- DBUG_ENTER("ha_ibmdb2i::ibmdb2i_drop_database");
- int rc = 0;
- char queryBuffer[200];
- String query(queryBuffer, sizeof(queryBuffer), system_charset_info);
- query.length(0);
- query.append(STRING_WITH_LEN(" DROP SCHEMA \""));
- query.append(path+2, strchr(path+2, '/')-(path+2));
- query.append('"');
-
- SqlStatementStream sqlStream(query);
-
- rc = db2i_ileBridge::getBridgeForThread()->execSQL(sqlStream.getPtrToData(),
- sqlStream.getStatementCount(),
- QMY_NONE,
- FALSE,
- TRUE);
- DBUG_VOID_RETURN;
-}
-
-inline static void genSavepointName(const void* sv, char* out)
-{
- *(uint32*)out = *(uint32*)SAVEPOINT_PREFIX;
- DBUG_ASSERT(sizeof(SAVEPOINT_PREFIX) == 4);
- out += sizeof(SAVEPOINT_PREFIX);
-
- longlong2str((longlong)sv, out, 10);
- while (*out)
- {
- out += 0xF0;
- ++out;
- }
-}
-
-
-/*********************************************************************
-Sets a transaction savepoint. */
-static int ibmdb2i_savepoint_set(handlerton* hton, THD* thd, void* sv)
-{
- DBUG_ENTER("ibmdb2i_savepoint_set");
- int rc = 0;
- if (!THDVAR(thd ,transaction_unsafe))
- {
- char name[64];
- genSavepointName(sv, name);
- DBUG_PRINT("ibmdb2i_savepoint_set",("Setting %s", name));
- rc = ha_ibmdb2i::doSavepointSet(thd, name);
- }
- DBUG_RETURN(rc);
-}
-
-
-/*********************************************************************
-Rollback a savepoint. */
-static int ibmdb2i_savepoint_rollback(handlerton* hton, THD* thd, void* sv)
-{
- DBUG_ENTER("ibmdb2i_savepoint_rollback");
- int rc = 0;
- if (!THDVAR(thd,transaction_unsafe))
- {
- char name[64];
- genSavepointName(sv, name);
- DBUG_PRINT("ibmdb2i_savepoint_rollback",("Rolling back %s", name));
- rc = ha_ibmdb2i::doSavepointRollback(thd, name);
- }
- DBUG_RETURN(rc);
-}
-
-
-/*********************************************************************
-Release a savepoint. */
-static int ibmdb2i_savepoint_release(handlerton* hton, THD* thd, void* sv)
-{
- DBUG_ENTER("ibmdb2i_savepoint_release");
- int rc = 0;
- if (!THDVAR(thd,transaction_unsafe))
- {
- char name[64];
- genSavepointName(sv, name);
- DBUG_PRINT("ibmdb2i_savepoint_release",("Releasing %s", name));
- rc = ha_ibmdb2i::doSavepointRelease(thd, name);
- }
- DBUG_RETURN(rc);
-}
-
-/* Thse flags allow for the online add and drop of an index via the CREATE INDEX,
- DROP INDEX, and ALTER TABLE statements. These flags indicate that MySQL is not
- required to lock the table before calling the storage engine to add or drop the
- index(s). */
-static uint ibmdb2i_alter_table_flags(uint flags)
-{
- return (HA_ONLINE_ADD_INDEX | HA_ONLINE_DROP_INDEX |
- HA_ONLINE_ADD_UNIQUE_INDEX | HA_ONLINE_DROP_UNIQUE_INDEX |
- HA_ONLINE_ADD_PK_INDEX | HA_ONLINE_DROP_PK_INDEX);
-}
-
-ha_ibmdb2i::ha_ibmdb2i(handlerton *hton, TABLE_SHARE *table_arg)
- :share(NULL), handler(hton, table_arg),
- activeHandle(0), dataHandle(0),
- activeReadBuf(NULL), activeWriteBuf(NULL),
- blobReadBuffers(NULL), accessIntent(QMY_UPDATABLE), currentRRN(0),
- releaseRowNeeded(FALSE),
- indexReadSizeEstimates(NULL),
- outstanding_start_bulk_insert(false),
- last_rnd_init_rc(0),
- last_index_init_rc(0),
- last_start_bulk_insert_rc(0),
- autoIncLockAcquired(false),
- got_auto_inc_values(false),
- next_identity_value(0),
- indexHandles(0),
- returnDupKeysImmediately(false),
- onDupUpdate(false),
- blobWriteBuffers(NULL),
- forceSingleRowRead(false)
- {
- activeReferences = 0;
- ref_length = sizeof(currentRRN);
- if (table_share && table_share->keys > 0)
- {
- indexHandles = (FILE_HANDLE*)my_malloc(table_share->keys * sizeof(FILE_HANDLE), MYF(MY_WME | MY_ZEROFILL));
- }
- clear_alloc_root(&conversionBufferMemroot);
- }
-
-
-ha_ibmdb2i::~ha_ibmdb2i()
-{
- DBUG_ASSERT(activeReferences == 0 || outstanding_start_bulk_insert);
-
- if (indexHandles)
- my_free(indexHandles);
- if (indexReadSizeEstimates)
- my_free(indexReadSizeEstimates);
-
- cleanupBuffers();
-}
-
-
-static const char *ha_ibmdb2i_exts[] = {
- FID_EXT,
- NullS
-};
-
-const char **ha_ibmdb2i::bas_ext() const
-{
- return ha_ibmdb2i_exts;
-}
-
-
-int ha_ibmdb2i::open(const char *name, int mode, uint test_if_locked)
-{
- DBUG_ENTER("ha_ibmdb2i::open");
-
- initBridge();
-
- dataHandle = bridge()->findAndRemovePreservedHandle(name, &share);
-
- if (share)
- db2Table = share->db2Table;
-
- if (!share && (!(share = get_share(name, table))))
- DBUG_RETURN(my_errno);
- thr_lock_data_init(&share->lock,&lock,NULL);
-
- info(HA_STATUS_NO_LOCK | HA_STATUS_CONST | HA_STATUS_VARIABLE);
-
-
- DBUG_RETURN(0);
-}
-
-
-
-
-int ha_ibmdb2i::close(void)
-{
- DBUG_ENTER("ha_ibmdb2i::close");
- int32 rc = 0;
- bool preserveShare = false;
-
- db2i_ileBridge* bridge = db2i_ileBridge::getBridgeForThread();
-
- if (dataHandle)
- {
- if (bridge->expectErrors(QMY_ERR_PEND_LOCKS)->deallocateFile(dataHandle, FALSE) == QMY_ERR_PEND_LOCKS)
- {
- bridge->preserveHandle(share->table_name, dataHandle, share);
- preserveShare = true;
- }
- dataHandle = 0;
- }
-
- for (int idx = 0; idx < table_share->keys; ++idx)
- {
- if (indexHandles[idx] != 0)
- {
- bridge->deallocateFile(indexHandles[idx], FALSE);
- }
- }
-
- cleanupBuffers();
-
- if (!preserveShare)
- {
- if (free_share(share))
- share = NULL;
- }
-
- DBUG_RETURN(rc);
-}
-
-
-
-int ha_ibmdb2i::write_row(uchar * buf)
-{
-
- DBUG_ENTER("ha_ibmdb2i::write_row");
-
- if (last_start_bulk_insert_rc)
- DBUG_RETURN( last_start_bulk_insert_rc );
-
- ha_statistic_increment(&SSV::ha_write_count);
- int rc = 0;
-
- bool fileHandleNeedsRelease = false;
-
- if (!activeHandle)
- {
- rc = useDataFile();
- if (rc) DBUG_RETURN(rc);
- fileHandleNeedsRelease = true;
- }
-
- if (!outstanding_start_bulk_insert)
- rc = prepWriteBuffer(1, getFileForActiveHandle());
-
- if (!rc)
- {
- if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
- table->timestamp_field->set_time();
-
- char* writeBuffer = activeWriteBuf->addRow();
- rc = prepareRowForWrite(writeBuffer,
- writeBuffer+activeWriteBuf->getRowNullOffset(),
- true);
- if (rc == 0)
- {
- // If we are doing block inserts, if the MI is supposed to generate an auto_increment
- // (i.e. identity column) value for this record, and if this is not the first record in
- // the block, then store the value (that the MI will generate for the identity column)
- // into the MySQL write buffer. We can predetermine the value because the file is locked.
-
- if ((autoIncLockAcquired) && (default_identity_value) && (got_auto_inc_values))
- {
- if (unlikely((next_identity_value - 1) ==
- maxValueForField(table->next_number_field)))
- {
- rc = QMY_ERR_MAXVALUE;
- }
- else
- {
- rc = table->next_number_field->store((longlong) next_identity_value, TRUE);
- next_identity_value = next_identity_value + incrementByValue;
- }
- }
- // If the buffer is full, or if we locked the file and this is the first or last row
- // of a blocked insert, then flush the buffer.
- if (!rc && (activeWriteBuf->endOfBuffer()) ||
- ((autoIncLockAcquired) &&
- ((!got_auto_inc_values))) ||
- (returnDupKeysImmediately))
- rc = flushWrite(activeHandle, buf);
- }
- else
- activeWriteBuf->deleteRow();
- }
-
- if (fileHandleNeedsRelease)
- releaseActiveHandle();
-
- DBUG_RETURN(rc);
-}
-
-/**
- @brief
- Helper function used by write_row and update_row to prepare the MySQL
- row for insertion into DB2.
-*/
-int ha_ibmdb2i::prepareRowForWrite(char* data, char* nulls, bool honorIdentCols)
-{
- int rc = 0;
-
- // set null map all to non nulls
- memset(nulls,__NOT_NULL_VALUE_EBCDIC, table->s->fields);
- default_identity_value = FALSE;
-
- ulong sql_mode = ha_thd()->variables.sql_mode;
-
- my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
- for (Field **field = table->field; *field && !rc; ++field)
- {
- int fieldIndex = (*field)->field_index;
- if ((*field)->Field::is_null())
- {
- nulls[fieldIndex] = __NULL_VALUE_EBCDIC;
- }
- if (honorIdentCols && ((*field)->flags & AUTO_INCREMENT_FLAG) &&
- *field == table->next_number_field)
-// && ((!autoIncLockAcquired) || (!got_auto_inc_values)))
- {
- if (sql_mode & MODE_NO_AUTO_VALUE_ON_ZERO)
- {
- if (!table->auto_increment_field_not_null)
- {
- nulls[fieldIndex] = __DEFAULT_VALUE_EBCDIC;
- default_identity_value = TRUE;
- }
- }
- else if ((*field)->val_int() == 0)
- {
- nulls[fieldIndex] = __DEFAULT_VALUE_EBCDIC;
- default_identity_value = TRUE;
- }
- }
-
- DB2Field& db2Field = db2Table->db2Field(fieldIndex);
- if (nulls[fieldIndex] == __NOT_NULL_VALUE_EBCDIC ||
- db2Field.isBlob())
- {
- rc = convertMySQLtoDB2(*field, db2Field, data + db2Field.getBufferOffset());
- }
- }
-
- if (!rc && db2Table->hasBlobs())
- rc = db2i_ileBridge::getBridgeForThread()->objectOverride(activeHandle,
- activeWriteBuf->ptr());
-
- dbug_tmp_restore_column_map(table->read_set, old_map);
-
- return rc;
-}
-
-
-
-int ha_ibmdb2i::update_row(const uchar * old_data, uchar * new_data)
-{
- DBUG_ENTER("ha_ibmdb2i::update_row");
- ha_statistic_increment(&SSV::ha_update_count);
- int rc;
-
- bool fileHandleNeedsRelease = false;
-
- if (!activeHandle)
- {
- rc = useFileByHandle(QMY_UPDATABLE, rrnAssocHandle);
- if (rc) DBUG_RETURN(rc);
- fileHandleNeedsRelease = true;
- }
-
- if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
- table->timestamp_field->set_time();
-
- char* writeBuf = activeWriteBuf->addRow();
- rc = prepareRowForWrite(writeBuf,
- writeBuf+activeWriteBuf->getRowNullOffset(),
- onDupUpdate);
-
- char* lastDupKeyNamePtr = NULL;
- uint32 lastDupKeyNameLen = 0;
-
- if (!rc)
- {
- rc = db2i_ileBridge::getBridgeForThread()->updateRow(activeHandle,
- currentRRN,
- activeWriteBuf->ptr(),
- &lastDupKeyRRN,
- &lastDupKeyNamePtr,
- &lastDupKeyNameLen);
- }
-
- if (lastDupKeyNameLen)
- {
- lastDupKeyID = getKeyFromName(lastDupKeyNamePtr, lastDupKeyNameLen);
- rrnAssocHandle = activeHandle;
- }
-
- if (fileHandleNeedsRelease)
- releaseActiveHandle();
-
- activeWriteBuf->resetAfterWrite();
-
- DBUG_RETURN(rc);
-}
-
-
-int ha_ibmdb2i::delete_row(const uchar * buf)
-{
- DBUG_ENTER("ha_ibmdb2i::delete_row");
- ha_statistic_increment(&SSV::ha_delete_count);
-
- bool needReleaseFile = false;
- int rc = 0;
-
- if (!activeHandle) // In some circumstances, MySQL comes here after
- { // closing the active handle. We need to re-open.
- rc = useFileByHandle(QMY_UPDATABLE, rrnAssocHandle);
- needReleaseFile = true;
- }
-
- if (likely(!rc))
- {
- rc = db2i_ileBridge::getBridgeForThread()->deleteRow(activeHandle,
- currentRRN);
- invalidateCachedStats();
- if (needReleaseFile)
- releaseActiveHandle();
- }
-
- DBUG_RETURN(rc);
-}
-
-
-
-int ha_ibmdb2i::index_init(uint idx, bool sorted)
-{
- DBUG_ENTER("ha_ibmdb2i::index_init");
-
- int& rc = last_index_init_rc;
- rc = 0;
-
- invalidDataFound=false;
- tweakReadSet();
-
- active_index=idx;
-
- rc = useIndexFile(idx);
-
- if (!rc)
- {
-// THD* thd = ha_thd();
-// if (accessIntent == QMY_UPDATABLE &&
-// thd_tx_isolation(thd) == ISO_REPEATABLE_READ &&
-// !THDVAR(thd, transaction_unsafe))
-// {
-// readAccessIntent = QMY_READ_ONLY;
-// }
-// else
-// {
- readAccessIntent = accessIntent;
-// }
-
- if (!rc && accessIntent != QMY_READ_ONLY)
- rc = prepWriteBuffer(1, db2Table->indexFile(idx));
-
- if (rc)
- releaseIndexFile(idx);
- }
-
- rrnAssocHandle= 0;
-
- DBUG_RETURN(rc);
-}
-
-
-
-int ha_ibmdb2i::index_read(uchar * buf, const uchar * key,
- uint key_len,
- enum ha_rkey_function find_flag)
-{
- DBUG_ENTER("ha_ibmdb2i::index_read");
-
- if (unlikely(last_index_init_rc)) DBUG_RETURN(last_index_init_rc);
-
- int rc;
-
- ha_rows estimatedRows = getIndexReadEstimate(active_index);
- rc = prepReadBuffer(estimatedRows, db2Table->indexFile(active_index), readAccessIntent);
- if (unlikely(rc)) DBUG_RETURN(rc);
-
- DBUG_ASSERT(activeReadBuf);
-
- keyBuf.allocBuf(activeReadBuf->getRowLength(),
- activeReadBuf->getRowNullOffset(),
- activeReadBuf->getRowLength());
- keyBuf.zeroBuf();
-
- char* db2KeyBufPtr = keyBuf.ptr();
- char* nullKeyMap = db2KeyBufPtr + activeReadBuf->getRowNullOffset();
-
- const uchar* keyBegin = key;
- int partsInUse;
-
- KEY& curKey = table->key_info[active_index];
-
- for (partsInUse = 0; partsInUse < curKey.key_parts, key - keyBegin < key_len; ++partsInUse)
- {
- Field* field = curKey.key_part[partsInUse].field;
- if ((curKey.key_part[partsInUse].null_bit) &&
- (char*)key[0])
- {
- if (field->flags & AUTO_INCREMENT_FLAG)
- {
- table->status = STATUS_NOT_FOUND;
- DBUG_RETURN(HA_ERR_END_OF_FILE);
- }
- else
- {
- nullKeyMap[partsInUse] = __NULL_VALUE_EBCDIC;
- }
- }
- else
- {
- nullKeyMap[partsInUse] = __NOT_NULL_VALUE_EBCDIC;
- convertMySQLtoDB2(field,
- db2Table->db2Field(field->field_index),
- db2KeyBufPtr,
- (uchar*)key+((curKey.key_part[partsInUse].null_bit)? 1 : 0) ); // + (curKey.key_parts+7) / 8);
- }
-
- db2KeyBufPtr += db2Table->db2Field(field->field_index).getByteLengthInRecord();
- key += curKey.key_part[partsInUse].store_length;
- }
-
- keyLen = db2KeyBufPtr - (char*)keyBuf.ptr();
-
- DBUG_PRINT("ha_ibmdb2i::index_read", ("find_flag: %d", find_flag));
-
- char readDirection = QMY_NEXT;
-
- switch (find_flag)
- {
- case HA_READ_AFTER_KEY:
- doInitialRead(QMY_AFTER_EQUAL, estimatedRows,
- keyBuf.ptr(), keyLen, partsInUse);
- break;
- case HA_READ_BEFORE_KEY:
- doInitialRead(QMY_BEFORE_EQUAL, estimatedRows,
- keyBuf.ptr(), keyLen, partsInUse);
- break;
- case HA_READ_KEY_OR_NEXT:
- doInitialRead(QMY_AFTER_OR_EQUAL, estimatedRows,
- keyBuf.ptr(), keyLen, partsInUse);
- break;
- case HA_READ_KEY_OR_PREV:
- DBUG_ASSERT(0); // This function is unused
- doInitialRead(QMY_BEFORE_OR_EQUAL, estimatedRows,
- keyBuf.ptr(), keyLen, partsInUse);
- break;
- case HA_READ_PREFIX_LAST_OR_PREV:
- doInitialRead(QMY_LAST_PREVIOUS, estimatedRows,
- keyBuf.ptr(), keyLen, partsInUse);
- readDirection = QMY_PREVIOUS;
- break;
- case HA_READ_PREFIX_LAST:
- doInitialRead(QMY_PREFIX_LAST, estimatedRows,
- keyBuf.ptr(), keyLen, partsInUse);
- readDirection = QMY_PREVIOUS;
- break;
- case HA_READ_KEY_EXACT:
- doInitialRead(QMY_EQUAL, estimatedRows, keyBuf.ptr(), keyLen, partsInUse);
- break;
- default:
- DBUG_ASSERT(0);
- return HA_ERR_GENERIC;
- break;
- }
-
- ha_statistic_increment(&SSV::ha_read_key_count);
- rc = readFromBuffer(buf, readDirection);
-
- table->status= (rc ? STATUS_NOT_FOUND: 0);
- DBUG_RETURN(rc);
-}
-
-
-int ha_ibmdb2i::index_next(uchar * buf)
-{
- DBUG_ENTER("ha_ibmdb2i::index_next");
- ha_statistic_increment(&SSV::ha_read_next_count);
-
- int rc = readFromBuffer(buf, QMY_NEXT);
-
- table->status= (rc ? STATUS_NOT_FOUND: 0);
- DBUG_RETURN(rc);
-}
-
-
-int ha_ibmdb2i::index_next_same(uchar *buf, const uchar *key, uint keylen)
-{
- DBUG_ENTER("ha_ibmdb2i::index_next_same");
- ha_statistic_increment(&SSV::ha_read_next_count);
-
- int rc = readFromBuffer(buf, QMY_NEXT_EQUAL);
-
- if (rc == HA_ERR_KEY_NOT_FOUND)
- {
- rc = HA_ERR_END_OF_FILE;
- }
-
- table->status= (rc ? STATUS_NOT_FOUND: 0);
- DBUG_RETURN(rc);
-}
-
-int ha_ibmdb2i::index_read_last(uchar * buf, const uchar * key, uint key_len)
-{
- DBUG_ENTER("ha_ibmdb2i::index_read_last");
- DBUG_RETURN(index_read(buf, key, key_len, HA_READ_PREFIX_LAST));
-}
-
-
-
-int ha_ibmdb2i::index_prev(uchar * buf)
-{
- DBUG_ENTER("ha_ibmdb2i::index_prev");
- ha_statistic_increment(&SSV::ha_read_prev_count);
-
- int rc = readFromBuffer(buf, QMY_PREVIOUS);
-
- table->status= (rc ? STATUS_NOT_FOUND: 0);
- DBUG_RETURN(rc);
-}
-
-
-int ha_ibmdb2i::index_first(uchar * buf)
-{
- DBUG_ENTER("ha_ibmdb2i::index_first");
-
- if (unlikely(last_index_init_rc)) DBUG_RETURN(last_index_init_rc);
-
- int rc = prepReadBuffer(DEFAULT_MAX_ROWS_TO_BUFFER,
- db2Table->indexFile(active_index),
- readAccessIntent);
-
- if (rc == 0)
- {
- doInitialRead(QMY_FIRST, DEFAULT_MAX_ROWS_TO_BUFFER);
- ha_statistic_increment(&SSV::ha_read_first_count);
- rc = readFromBuffer(buf, QMY_NEXT);
- }
-
- table->status= (rc ? STATUS_NOT_FOUND: 0);
- DBUG_RETURN(rc);
-}
-
-
-int ha_ibmdb2i::index_last(uchar * buf)
-{
- DBUG_ENTER("ha_ibmdb2i::index_last");
-
- if (unlikely(last_index_init_rc)) DBUG_RETURN(last_index_init_rc);
-
- int rc = prepReadBuffer(DEFAULT_MAX_ROWS_TO_BUFFER,
- db2Table->indexFile(active_index),
- readAccessIntent);
-
- if (rc == 0)
- {
- doInitialRead(QMY_LAST, DEFAULT_MAX_ROWS_TO_BUFFER);
- ha_statistic_increment(&SSV::ha_read_last_count);
- rc = readFromBuffer(buf, QMY_PREVIOUS);
- }
-
- table->status= (rc ? STATUS_NOT_FOUND: 0);
- DBUG_RETURN(rc);
-}
-
-
-int ha_ibmdb2i::rnd_init(bool scan)
-{
- DBUG_ENTER("ha_ibmdb2i::rnd_init");
-
- int& rc = last_rnd_init_rc;
- rc = 0;
-
- tweakReadSet();
- invalidDataFound=false;
-
- uint32 rowsToBlockOnRead;
-
- if (!scan)
- {
- rowsToBlockOnRead = 1;
- }
- else
- {
- rowsToBlockOnRead = DEFAULT_MAX_ROWS_TO_BUFFER;
- }
-
- rc = useDataFile();
-
- if (!rc)
- {
-// THD* thd = ha_thd();
-// if (accessIntent == QMY_UPDATABLE &&
-// thd_tx_isolation(thd) == ISO_REPEATABLE_READ &&
-// !THDVAR(thd, transaction_unsafe))
-// {
-// readAccessIntent = QMY_READ_ONLY;
-// }
-// else
-// {
- readAccessIntent = accessIntent;
-// }
-
- rc = prepReadBuffer(rowsToBlockOnRead, db2Table->dataFile(), readAccessIntent);
-
- if (!rc && accessIntent != QMY_READ_ONLY)
- rc = prepWriteBuffer(1, db2Table->dataFile());
-
- if (!rc && scan)
- doInitialRead(QMY_FIRST, rowsToBlockOnRead);
-
- if (rc)
- releaseDataFile();
- }
-
- rrnAssocHandle= 0;
-
- DBUG_RETURN(0);
-}
-
-int ha_ibmdb2i::rnd_end()
-{
- DBUG_ENTER("ha_ibmdb2i::rnd_end");
-
- warnIfInvalidData();
- if (likely(activeReadBuf))
- activeReadBuf->endRead();
- if (last_rnd_init_rc == 0)
- releaseActiveHandle();
- last_rnd_init_rc = 0;
- DBUG_RETURN(0);
-}
-
-
-int32 ha_ibmdb2i::mungeDB2row(uchar* record, const char* dataPtr, const char* nullMapPtr, bool skipLOBs)
-{
- DBUG_ASSERT(dataPtr);
-
- my_bitmap_map *old_write_map= dbug_tmp_use_all_columns(table, table->write_set);
- my_bitmap_map *old_read_map;
-
- if (unlikely(readAllColumns))
- old_read_map = tmp_use_all_columns(table, table->read_set);
-
- resetCharacterConversionBuffers();
-
- my_ptrdiff_t old_ptr= (my_ptrdiff_t) (record - table->record[0]);
- int fieldIndex = 0;
- for (Field **field = table->field; *field; ++field, ++fieldIndex)
- {
- if (unlikely(old_ptr))
- (*field)->move_field_offset(old_ptr);
- if (nullMapPtr[fieldIndex] == __NULL_VALUE_EBCDIC ||
- (!bitmap_is_set(table->read_set, fieldIndex)) ||
- (skipLOBs && db2Table->db2Field(fieldIndex).isBlob()))
- {
- (*field)->set_null();
- }
- else
- {
- (*field)->set_notnull();
- convertDB2toMySQL(db2Table->db2Field(fieldIndex), *field, dataPtr);
- }
- if (unlikely(old_ptr))
- (*field)->move_field_offset(-old_ptr);
-
- }
-
- if (unlikely(readAllColumns))
- tmp_restore_column_map(table->read_set, old_read_map);
- dbug_tmp_restore_column_map(table->write_set, old_write_map);
-
- return 0;
-}
-
-
-int ha_ibmdb2i::rnd_next(uchar *buf)
-{
- DBUG_ENTER("ha_ibmdb2i::rnd_next");
-
- if (unlikely(last_rnd_init_rc)) DBUG_RETURN(last_rnd_init_rc);
- ha_statistic_increment(&SSV::ha_read_rnd_next_count);
-
- int rc;
-
- rc = readFromBuffer(buf, QMY_NEXT);
-
- table->status= (rc ? STATUS_NOT_FOUND: 0);
- DBUG_RETURN(rc);
-}
-
-
-void ha_ibmdb2i::position(const uchar *record)
-{
- DBUG_ENTER("ha_ibmdb2i::position");
- my_store_ptr(ref, ref_length, currentRRN);
- DBUG_VOID_RETURN;
-}
-
-
-int ha_ibmdb2i::rnd_pos(uchar * buf, uchar *pos)
-{
- DBUG_ENTER("ha_ibmdb2i::rnd_pos");
- if (unlikely(last_rnd_init_rc)) DBUG_RETURN( last_rnd_init_rc);
- ha_statistic_increment(&SSV::ha_read_rnd_count);
-
- currentRRN = my_get_ptr(pos, ref_length);
-
- tweakReadSet();
-
- int rc = 0;
-
- if (rrnAssocHandle &&
- (activeHandle != rrnAssocHandle))
- {
- if (activeHandle) releaseActiveHandle();
- rc = useFileByHandle(QMY_UPDATABLE, rrnAssocHandle);
- }
-
- if (likely(rc == 0))
- {
- rc = prepReadBuffer(1, getFileForActiveHandle(), accessIntent);
-
- if (likely(rc == 0) && accessIntent == QMY_UPDATABLE)
- rc = prepWriteBuffer(1, getFileForActiveHandle());
-
- if (likely(rc == 0))
- {
- rc = db2i_ileBridge::getBridgeForThread()->readByRRN(activeHandle,
- activeReadBuf->ptr(),
- currentRRN,
- accessIntent,
- getCommitLevel());
-
- if (likely(rc == 0))
- {
- rrnAssocHandle = activeHandle;
- const char* readBuf = activeReadBuf->getRowN(0);
- rc = mungeDB2row(buf, readBuf, readBuf + activeReadBuf->getRowNullOffset(), false);
- releaseRowNeeded = TRUE;
- }
- }
- }
-
- DBUG_RETURN(rc);
-}
-
-
-int ha_ibmdb2i::info(uint flag)
-{
- DBUG_ENTER("ha_ibmdb2i::info");
-
- uint16 infoRequested = 0;
- ValidatedPointer<char> rowKeySpcPtr; // Space pointer passed to DB2
- uint32 rowKeySpcLen; // Length of space passed to DB2
- THD* thd = ha_thd();
- int command = thd_sql_command(thd);
-
- if (flag & HA_STATUS_AUTO)
- stats.auto_increment_value = (ulonglong) 0;
-
- if (flag & HA_STATUS_ERRKEY)
- {
- errkey = lastDupKeyID;
- my_store_ptr(dup_ref, ref_length, lastDupKeyRRN);
- }
-
- if (flag & HA_STATUS_TIME)
- {
- if ((flag & HA_STATUS_NO_LOCK) &&
- ibmdb2i_assume_exclusive_use &&
- share &&
- (share->cachedStats.isInited(lastModTime)))
- stats.update_time = share->cachedStats.getUpdateTime();
- else
- infoRequested |= lastModTime;
- }
-
- if (flag & HA_STATUS_CONST)
- {
- stats.block_size=4096;
- infoRequested |= createTime;
-
- if (table->s->keys)
- {
- infoRequested |= rowsPerKey;
- rowKeySpcLen = (table->s->keys) * MAX_DB2_KEY_PARTS * sizeof(uint64);
- rowKeySpcPtr.alloc(rowKeySpcLen);
- memset(rowKeySpcPtr, 0, rowKeySpcLen); // Clear the allocated space
- }
- }
-
- if (flag & HA_STATUS_VARIABLE)
- {
- if ((flag & HA_STATUS_NO_LOCK) &&
- (command != SQLCOM_SHOW_TABLE_STATUS) &&
- ibmdb2i_assume_exclusive_use &&
- share &&
- (share->cachedStats.isInited(rowCount | deletedRowCount | meanRowLen | ioCount)) &&
- (share->cachedStats.getRowCount() >= 2))
- {
- stats.records = share->cachedStats.getRowCount();
- stats.deleted = share->cachedStats.getDelRowCount();
- stats.mean_rec_length = share->cachedStats.getMeanLength();
- stats.data_file_length = share->cachedStats.getAugmentedDataLength();
- }
- else
- {
- infoRequested |= rowCount | deletedRowCount | meanRowLen;
- if (command == SQLCOM_SHOW_TABLE_STATUS)
- infoRequested |= objLength;
- else
- infoRequested |= ioCount;
- }
- }
-
- int rc = 0;
-
- if (infoRequested)
- {
- DBUG_PRINT("ha_ibmdb2i::info",("Retrieving fresh stats %d", flag));
-
- initBridge(thd);
- rc = bridge()->retrieveTableInfo((dataHandle ? dataHandle : db2Table->dataFile()->getMasterDefnHandle()),
- infoRequested,
- stats,
- rowKeySpcPtr);
-
- if (!rc)
- {
- if ((flag & HA_STATUS_VARIABLE) &&
- (command != SQLCOM_SHOW_TABLE_STATUS))
- stats.data_file_length = stats.data_file_length * IO_SIZE;
-
- if ((ibmdb2i_assume_exclusive_use) &&
- (share) &&
- (command != SQLCOM_SHOW_TABLE_STATUS))
- {
- if (flag & HA_STATUS_VARIABLE)
- {
- share->cachedStats.cacheRowCount(stats.records);
- share->cachedStats.cacheDelRowCount(stats.deleted);
- share->cachedStats.cacheMeanLength(stats.mean_rec_length);
- share->cachedStats.cacheAugmentedDataLength(stats.data_file_length);
- }
-
- if (flag & HA_STATUS_TIME)
- {
- share->cachedStats.cacheUpdateTime(stats.update_time);
- }
- }
-
- if (flag & HA_STATUS_CONST)
- {
- ulong i; // Loop counter for indexes
- ulong j; // Loop counter for key parts
- RowKey* rowKeyPtr; // Pointer to 'number of unique rows' array for this index
-
- rowKeyPtr = (RowKey_t*)(void*)rowKeySpcPtr; // Address first array of DB2 row counts
- for (i = 0; i < table->s->keys; i++) // Do for each index, including primary
- {
- for (j = 0; j < table->key_info[i].key_parts; j++)
- {
- table->key_info[i].rec_per_key[j]= rowKeyPtr->RowKeyArray[j];
- }
- rowKeyPtr = rowKeyPtr + 1; // Address next array of DB2 row counts
- }
- }
- }
- else if (rc == HA_ERR_LOCK_WAIT_TIMEOUT && share)
- {
- // If we couldn't retrieve the info because the object was locked,
- // we'll do our best by returning the most recently cached data.
- if ((infoRequested & rowCount) &&
- share->cachedStats.isInited(rowCount))
- stats.records = share->cachedStats.getRowCount();
- if ((infoRequested & deletedRowCount) &&
- share->cachedStats.isInited(deletedRowCount))
- stats.deleted = share->cachedStats.getDelRowCount();
- if ((infoRequested & meanRowLen) &&
- share->cachedStats.isInited(meanRowLen))
- stats.mean_rec_length = share->cachedStats.getMeanLength();
- if ((infoRequested & lastModTime) &&
- share->cachedStats.isInited(lastModTime))
- stats.update_time = share->cachedStats.getUpdateTime();
-
- rc = 0;
- }
- }
-
- DBUG_RETURN(rc);
-}
-
-
-ha_rows ha_ibmdb2i::records()
-{
- DBUG_ENTER("ha_ibmdb2i::records");
- int rc;
- rc = bridge()->retrieveTableInfo((dataHandle ? dataHandle : db2Table->dataFile()->getMasterDefnHandle()),
- rowCount,
- stats);
-
- if (unlikely(rc))
- {
- if (rc == HA_ERR_LOCK_WAIT_TIMEOUT &&
- share &&
- (share->cachedStats.isInited(rowCount)))
- DBUG_RETURN(share->cachedStats.getRowCount());
- else
- DBUG_RETURN(HA_POS_ERROR);
- }
- else if (share)
- {
- share->cachedStats.cacheRowCount(stats.records);
- }
-
- DBUG_RETURN(stats.records);
-}
-
-
-int ha_ibmdb2i::extra(enum ha_extra_function operation)
-{
- DBUG_ENTER("ha_ibmdb2i::extra");
-
- switch(operation)
- {
- // Can these first five flags be replaced by attending to HA_EXTRA_WRITE_CACHE?
- case HA_EXTRA_NO_IGNORE_DUP_KEY:
- case HA_EXTRA_WRITE_CANNOT_REPLACE:
- {
- returnDupKeysImmediately = false;
- onDupUpdate = false;
- }
- break;
- case HA_EXTRA_INSERT_WITH_UPDATE:
- {
- returnDupKeysImmediately = true;
- onDupUpdate = true;
- }
- break;
- case HA_EXTRA_IGNORE_DUP_KEY:
- case HA_EXTRA_WRITE_CAN_REPLACE:
- returnDupKeysImmediately = true;
- break;
- case HA_EXTRA_FLUSH_CACHE:
- if (outstanding_start_bulk_insert)
- finishBulkInsert();
- break;
- }
-
-
- DBUG_RETURN(0);
-}
-
-/**
- @brief
- The DB2 storage engine will ignore a MySQL generated value and will generate
- a new value in SLIC. We arbitrarily set first_value to 1, and set the
- interval to infinity for better performance on multi-row inserts.
-*/
-void ha_ibmdb2i::get_auto_increment(ulonglong offset, ulonglong increment,
- ulonglong nb_desired_values,
- ulonglong *first_value,
- ulonglong *nb_reserved_values)
-{
- DBUG_ENTER("ha_ibmdb2i::get_auto_increment");
- *first_value= 1;
- *nb_reserved_values= ULONGLONG_MAX;
-}
-
-
-
-void ha_ibmdb2i::update_create_info(HA_CREATE_INFO *create_info)
-{
- DBUG_ENTER("ha_ibmdb2i::update_create_info");
-
- if ((!(create_info->used_fields & HA_CREATE_USED_AUTO)) &&
- (table->found_next_number_field != NULL))
- {
- initBridge();
-
- create_info->auto_increment_value= 1;
-
- ha_rows rowCount = records();
-
- if (rowCount == 0)
- {
- create_info->auto_increment_value = db2Table->getStartId();
- DBUG_VOID_RETURN;
- }
- else if (rowCount == HA_POS_ERROR)
- {
- DBUG_VOID_RETURN;
- }
-
- getNextIdVal(&create_info->auto_increment_value);
- }
- DBUG_VOID_RETURN;
-}
-
-
-int ha_ibmdb2i::getNextIdVal(ulonglong *value)
-{
- DBUG_ENTER("ha_ibmdb2i::getNextIdVal");
-
- char queryBuffer[MAX_DB2_COLNAME_LENGTH + MAX_DB2_QUALIFIEDNAME_LENGTH + 64];
- strcpy(queryBuffer, " SELECT CAST(MAX( ");
- convertMySQLNameToDB2Name(table->found_next_number_field->field_name,
- strend(queryBuffer),
- MAX_DB2_COLNAME_LENGTH+1);
- strcat(queryBuffer, ") AS BIGINT) FROM ");
- db2Table->getDB2QualifiedName(strend(queryBuffer));
- DBUG_ASSERT(strlen(queryBuffer) < sizeof(queryBuffer));
-
- SqlStatementStream sqlStream(queryBuffer);
- DBUG_PRINT("ha_ibmdb2i::getNextIdVal", ("Sent to DB2: %s",queryBuffer));
-
- int rc = 0;
- FILE_HANDLE fileHandle2;
- uint32 db2RowDataLen2;
- rc = bridge()->prepOpen(sqlStream.getPtrToData(),
- &fileHandle2,
- &db2RowDataLen2);
- if (likely(rc == 0))
- {
- IOReadBuffer rowBuffer(1, db2RowDataLen2);
- rc = bridge()->read(fileHandle2,
- rowBuffer.ptr(),
- QMY_READ_ONLY,
- QMY_NONE,
- QMY_FIRST);
-
- if (likely(rc == 0))
- {
- /* This check is here for the case where the table is not empty,
- but the auto_increment starting value has been changed since
- the last record was written. */
-
- longlong maxIdVal = *(longlong*)(rowBuffer.getRowN(0));
- if ((maxIdVal + 1) > db2Table->getStartId())
- *value = maxIdVal + 1;
- else
- *value = db2Table->getStartId();
- }
-
- bridge()->deallocateFile(fileHandle2);
- }
- DBUG_RETURN(rc);
-}
-
-
-/*
- Updates index cardinalities.
-*/
-int ha_ibmdb2i::analyze(THD* thd, HA_CHECK_OPT *check_opt)
-{
- DBUG_ENTER("ha_ibmdb2i::analyze");
- info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE);
- DBUG_RETURN(0);
-}
-
-int ha_ibmdb2i::optimize(THD* thd, HA_CHECK_OPT *check_opt)
-{
- DBUG_ENTER("ha_ibmdb2i::optimize");
-
- initBridge(thd);
-
- if (unlikely(records() == 0))
- DBUG_RETURN(0); // DB2 doesn't like to reorganize a table with no data.
-
- quiesceAllFileHandles();
-
- int32 rc = bridge()->optimizeTable(db2Table->dataFile()->getMasterDefnHandle());
- info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE);
-
- DBUG_RETURN(rc);
-}
-
-
-/**
- @brief
- Determines if an ALTER TABLE is allowed to switch the storage engine
- for this table. If the table has a foreign key or is referenced by a
- foreign key, then it cannot be switched.
-*/
-bool ha_ibmdb2i::can_switch_engines(void)
-/*=================================*/
-{
- DBUG_ENTER("ha_ibmdb2i::can_switch_engines");
-
- int rc = 0;
- FILE_HANDLE queryFile = 0;
- uint32 resultRowLen;
- uint count = 0;
- bool can_switch = FALSE; // 1 if changing storage engine is allowed
-
- const char* libName = db2Table->getDB2LibName(db2i_table::ASCII_SQL);
- const char* fileName = db2Table->getDB2TableName(db2i_table::ASCII_SQL);
-
- String query(256);
- query.append(STRING_WITH_LEN(" SELECT COUNT(*) FROM SYSIBM.SQLFOREIGNKEYS WHERE ((PKTABLE_SCHEM = '"));
- query.append(libName+1, strlen(libName)-2); // Remove quotes from parent schema name
- query.append(STRING_WITH_LEN("' AND PKTABLE_NAME = '"));
- query.append(fileName+1,strlen(fileName)-2); // Remove quotes from file name
- query.append(STRING_WITH_LEN("') OR (FKTABLE_SCHEM = '"));
- query.append(libName+1,strlen(libName)-2); // Remove quotes from child schema
- query.append(STRING_WITH_LEN("' AND FKTABLE_NAME = '"));
- query.append(fileName+1,strlen(fileName)-2); // Remove quotes from child name
- query.append(STRING_WITH_LEN("'))"));
-
- SqlStatementStream sqlStream(query);
-
- rc = bridge()->prepOpen(sqlStream.getPtrToData(),
- &queryFile,
- &resultRowLen);
- if (rc == 0)
- {
- IOReadBuffer rowBuffer(1, resultRowLen);
-
- rc = bridge()->read(queryFile,
- rowBuffer.ptr(),
- QMY_READ_ONLY,
- QMY_NONE,
- QMY_FIRST);
- if (!rc)
- {
- count = *(uint*)(rowBuffer.getRowN(0));
- if (count == 0)
- can_switch = TRUE;
- }
-
- bridge()->deallocateFile(queryFile);
- }
- DBUG_RETURN(can_switch);
-}
-
-
-
-bool ha_ibmdb2i::check_if_incompatible_data(HA_CREATE_INFO *info,
- uint table_changes)
-{
- DBUG_ENTER("ha_ibmdb2i::check_if_incompatible_data");
- uint i;
- /* Check that auto_increment value and field definitions were
- not changed. */
- if ((info->used_fields & HA_CREATE_USED_AUTO &&
- info->auto_increment_value != 0) ||
- table_changes != IS_EQUAL_YES)
- DBUG_RETURN(COMPATIBLE_DATA_NO);
- /* Check if any fields were renamed. */
- for (i= 0; i < table->s->fields; i++)
- {
- Field *field= table->field[i];
- if (field->flags & FIELD_IS_RENAMED)
- {
- DBUG_PRINT("info", ("Field has been renamed, copy table"));
- DBUG_RETURN(COMPATIBLE_DATA_NO);
- }
- }
- DBUG_RETURN(COMPATIBLE_DATA_YES);
-}
-
-int ha_ibmdb2i::reset_auto_increment(ulonglong value)
- {
- DBUG_ENTER("ha_ibmdb2i::reset_auto_increment");
-
- int rc = 0;
-
- quiesceAllFileHandles();
-
- const char* libName = db2Table->getDB2LibName(db2i_table::ASCII_SQL);
- const char* fileName = db2Table->getDB2TableName(db2i_table::ASCII_SQL);
-
- String query(512);
- query.append(STRING_WITH_LEN(" ALTER TABLE "));
- query.append(libName);
- query.append('.');
- query.append(fileName);
- query.append(STRING_WITH_LEN(" ALTER COLUMN "));
- char colName[MAX_DB2_COLNAME_LENGTH+1];
- convertMySQLNameToDB2Name(table->found_next_number_field->field_name,
- colName,
- sizeof(colName));
- query.append(colName);
-
- char restart_value[22];
- CHARSET_INFO *cs= &my_charset_bin;
- uint len = (uint)(cs->cset->longlong10_to_str)(cs,restart_value,sizeof(restart_value), 10, value);
- restart_value[len] = 0;
-
- query.append(STRING_WITH_LEN(" RESTART WITH "));
- query.append(restart_value);
-
- SqlStatementStream sqlStream(query);
- DBUG_PRINT("ha_ibmdb2i::reset_auto_increment", ("Sent to DB2: %s",query.c_ptr()));
-
- rc = db2i_ileBridge::getBridgeForThread()->execSQL(sqlStream.getPtrToData(),
- sqlStream.getStatementCount(),
- QMY_NONE, //getCommitLevel(),
- FALSE,
- FALSE,
- TRUE, //FALSE,
- dataHandle);
- if (rc == 0)
- db2Table->updateStartId(value);
-
- DBUG_RETURN(rc);
-}
-
-
-/**
- @brief
- This function receives an error code that was previously set by the handler.
- It returns to MySQL the error string associated with that error.
-*/
-bool ha_ibmdb2i::get_error_message(int error, String *buf)
-{
- DBUG_ENTER("ha_ibmdb2i::get_error_message");
- if ((error >= DB2I_FIRST_ERR && error <= DB2I_LAST_ERR) ||
- (error >= QMY_ERR_MIN && error <= QMY_ERR_MAX))
- {
- db2i_ileBridge* bridge = db2i_ileBridge::getBridgeForThread(ha_thd());
- char* errMsg = bridge->getErrorStorage();
- buf->copy(errMsg, strlen(errMsg),system_charset_info);
- bridge->freeErrorStorage();
- }
- DBUG_RETURN(FALSE);
-}
-
-
-int ha_ibmdb2i::delete_all_rows()
-{
- DBUG_ENTER("ha_ibmdb2i::delete_all_rows");
- int rc = 0;
- char queryBuffer[MAX_DB2_QUALIFIEDNAME_LENGTH + 64];
- strcpy(queryBuffer, " DELETE FROM ");
- db2Table->getDB2QualifiedName(strend(queryBuffer));
- DBUG_ASSERT(strlen(queryBuffer) < sizeof(queryBuffer));
-
- SqlStatementStream sqlStream(queryBuffer);
- DBUG_PRINT("ha_ibmdb2i::delete_all_rows", ("Sent to DB2: %s",queryBuffer));
- rc = bridge()->execSQL(sqlStream.getPtrToData(),
- sqlStream.getStatementCount(),
- getCommitLevel(),
- false,
- false,
- true,
- dataHandle);
-
- /* If this method was called on behalf of a TRUNCATE TABLE statement, and if */
- /* the table has an auto_increment field, then reset the starting value for */
- /* the auto_increment field to 1.
- */
- if (rc == 0 && thd_sql_command(ha_thd()) == SQLCOM_TRUNCATE &&
- table->found_next_number_field )
- rc = reset_auto_increment(1);
-
- invalidateCachedStats();
-
- DBUG_RETURN(rc);
-}
-
-
-int ha_ibmdb2i::external_lock(THD *thd, int lock_type)
-{
- int rc = 0;
-
- DBUG_ENTER("ha_ibmdb2i::external_lock");
- DBUG_PRINT("ha_ibmdb2i::external_lock",("Lock type: %d", lock_type));
-
- if (lock_type == F_RDLCK)
- accessIntent = QMY_READ_ONLY;
- else if (lock_type == F_WRLCK)
- accessIntent = QMY_UPDATABLE;
-
- initBridge(thd);
- int command = thd_sql_command(thd);
-
- if (!THDVAR(thd,transaction_unsafe))
- {
- if (lock_type != F_UNLCK)
- {
- if (autoCommitIsOn(thd) == QMY_YES)
- {
- trans_register_ha(thd, FALSE, ibmdb2i_hton);
- }
- else
- {
- trans_register_ha(thd, TRUE, ibmdb2i_hton);
- if (likely(command != SQLCOM_CREATE_TABLE))
- {
- trans_register_ha(thd, FALSE, ibmdb2i_hton);
- bridge()->beginStmtTx();
- }
- }
- }
- }
-
- if (command == SQLCOM_LOCK_TABLES ||
- command == SQLCOM_ALTER_TABLE ||
- command == SQLCOM_UNLOCK_TABLES ||
- (accessIntent == QMY_UPDATABLE &&
- (command == SQLCOM_UPDATE ||
- command == SQLCOM_UPDATE_MULTI ||
- command == SQLCOM_DELETE ||
- command == SQLCOM_DELETE_MULTI ||
- command == SQLCOM_REPLACE ||
- command == SQLCOM_REPLACE_SELECT) &&
- getCommitLevel(thd) == QMY_NONE))
- {
- char action;
- char type;
- if (lock_type == F_UNLCK)
- {
- action = QMY_UNLOCK;
- type = accessIntent == QMY_READ_ONLY ? QMY_LSRD : QMY_LENR;
- }
- else
- {
- action = QMY_LOCK;
- type = lock_type == F_RDLCK ? QMY_LSRD : QMY_LENR;
- }
-
- DBUG_PRINT("ha_ibmdb2i::external_lock",("%socking table", action==QMY_LOCK ? "L" : "Unl"));
-
- if (!dataHandle)
- rc = db2Table->dataFile()->allocateNewInstance(&dataHandle, curConnection);
-
- rc = bridge()->lockObj(dataHandle,
- 0,
- action,
- type,
- (command == SQLCOM_LOCK_TABLES ? QMY_NO : QMY_YES));
-
- }
-
- // Cache this away so we don't have to access it on each row operation
- cachedZeroDateOption = (enum_ZeroDate)THDVAR(thd, compat_opt_allow_zero_date_vals);
-
- DBUG_RETURN(rc);
-}
-
-
-THR_LOCK_DATA **ha_ibmdb2i::store_lock(THD *thd,
- THR_LOCK_DATA **to,
- enum thr_lock_type lock_type)
-{
- if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK)
- {
- if ((lock_type >= TL_WRITE_CONCURRENT_INSERT &&
- lock_type <= TL_WRITE) && !(thd->in_lock_tables && thd_sql_command(thd) == SQLCOM_LOCK_TABLES))
- lock_type= TL_WRITE_ALLOW_WRITE;
- lock.type=lock_type;
- }
- *to++= &lock;
- return to;
-}
-
-
-int ha_ibmdb2i::delete_table(const char *name)
-{
- DBUG_ENTER("ha_ibmdb2i::delete_table");
- THD* thd = ha_thd();
- db2i_ileBridge* bridge = db2i_ileBridge::getBridgeForThread(thd);
-
- char db2Name[MAX_DB2_QUALIFIEDNAME_LENGTH];
- db2i_table::getDB2QualifiedNameFromPath(name, db2Name);
-
- String query(128);
- query.append(STRING_WITH_LEN(" DROP TABLE "));
- query.append(db2Name);
-
- if (thd_sql_command(thd) == SQLCOM_DROP_TABLE &&
- thd->lex->drop_mode == DROP_RESTRICT)
- query.append(STRING_WITH_LEN(" RESTRICT "));
- DBUG_PRINT("ha_ibmdb2i::delete_table", ("Sent to DB2: %s",query.c_ptr()));
-
- SqlStatementStream sqlStream(query);
-
- db2i_table::getDB2LibNameFromPath(name, db2Name);
- bool isTemporary = (strcmp(db2Name, DB2I_TEMP_TABLE_SCHEMA) == 0 ? TRUE : FALSE);
-
- int rc = bridge->execSQL(sqlStream.getPtrToData(),
- sqlStream.getStatementCount(),
- (isTemporary ? QMY_NONE : getCommitLevel(thd)),
- FALSE,
- FALSE,
- isTemporary);
-
- if (rc == HA_ERR_NO_SUCH_TABLE)
- {
- warning(thd, DB2I_ERR_TABLE_NOT_FOUND, name);
- rc = 0;
- }
-
- if (rc == 0)
- {
- db2i_table::deleteAssocFiles(name);
- }
-
- FILE_HANDLE savedHandle = bridge->findAndRemovePreservedHandle(name, &share);
- while (savedHandle)
- {
- bridge->deallocateFile(savedHandle, TRUE);
- DBUG_ASSERT(share);
- if (free_share(share))
- share = NULL;
- savedHandle = bridge->findAndRemovePreservedHandle(name, &share);
- }
-
- my_errno = rc;
- DBUG_RETURN(rc);
-}
-
-
-int ha_ibmdb2i::rename_table(const char * from, const char * to)
-{
- DBUG_ENTER("ha_ibmdb2i::rename_table ");
-
- char db2FromFileName[MAX_DB2_FILENAME_LENGTH + 1];
- char db2ToFileName[MAX_DB2_FILENAME_LENGTH+1];
- char db2FromLibName[MAX_DB2_SCHEMANAME_LENGTH+1];
- char db2ToLibName[MAX_DB2_SCHEMANAME_LENGTH+1];
-
- db2i_table::getDB2LibNameFromPath(from, db2FromLibName);
- db2i_table::getDB2LibNameFromPath(to, db2ToLibName);
-
- if (strcmp(db2FromLibName, db2ToLibName) != 0 )
- {
- getErrTxt(DB2I_ERR_RENAME_MOVE,from,to);
- DBUG_RETURN(DB2I_ERR_RENAME_MOVE);
- }
-
- db2i_table::getDB2FileNameFromPath(from, db2FromFileName, db2i_table::ASCII_NATIVE);
- db2i_table::getDB2FileNameFromPath(to, db2ToFileName);
-
- char escapedFromFileName[2 * MAX_DB2_FILENAME_LENGTH + 1];
-
- uint o = 0;
- uint i = 1;
- do
- {
- escapedFromFileName[o++] = db2FromFileName[i];
- if (db2FromFileName[i] == '+')
- escapedFromFileName[o++] = '+';
- } while (db2FromFileName[++i]);
- escapedFromFileName[o-1] = 0;
-
-
- int rc = 0;
-
- char queryBuffer[sizeof(db2FromLibName) + 2 * sizeof(db2FromFileName) + 256];
- SafeString selectQuery(queryBuffer, sizeof(queryBuffer));
- selectQuery.strncat(STRING_WITH_LEN("SELECT CAST(INDEX_NAME AS VARCHAR(128) CCSID 1208) FROM QSYS2.SYSINDEXES WHERE INDEX_NAME LIKE '%+_+_+_%"));
- selectQuery.strcat(escapedFromFileName);
- selectQuery.strncat(STRING_WITH_LEN("' ESCAPE '+' AND TABLE_NAME='"));
- selectQuery.strncat(db2FromFileName+1, strlen(db2FromFileName)-2);
- selectQuery.strncat(STRING_WITH_LEN("' AND TABLE_SCHEMA='"));
- selectQuery.strncat(db2FromLibName+1, strlen(db2FromLibName)-2);
- selectQuery.strcat('\'');
- DBUG_ASSERT(!selectQuery.overflowed());
-
- SqlStatementStream indexQuery(selectQuery.ptr());
-
- FILE_HANDLE queryFile = 0;
- uint32 resultRowLen;
-
- initBridge();
- rc = bridge()->prepOpen(indexQuery.getPtrToData(),
- &queryFile,
- &resultRowLen);
-
- if (unlikely(rc))
- DBUG_RETURN(rc);
-
- IOReadBuffer rowBuffer(1, resultRowLen);
-
- int tableNameLen = strlen(db2FromFileName) - 2;
-
- SqlStatementStream renameQuery(64);
- String query;
- while (rc == 0)
- {
- query.length(0);
-
- rc = bridge()->read(queryFile,
- rowBuffer.ptr(),
- QMY_READ_ONLY,
- QMY_NONE,
- QMY_NEXT);
-
- if (!rc)
- {
- const char* rowData = rowBuffer.getRowN(0);
- char indexFileName[MAX_DB2_FILENAME_LENGTH];
- memset(indexFileName, 0, sizeof(indexFileName));
-
- uint16 fileNameLen = *(uint16*)(rowData);
- strncpy(indexFileName, rowData + sizeof(uint16), fileNameLen);
-
- int bytesToRetain = fileNameLen - tableNameLen;
- if (bytesToRetain <= 0)
- /* We can't handle index names in which the MySQL index name and
- the table name together are longer than the max index name. */
- {
- getErrTxt(DB2I_ERR_INVALID_NAME,"index","*generated*");
- DBUG_RETURN(DB2I_ERR_INVALID_NAME);
- }
- char indexName[MAX_DB2_FILENAME_LENGTH];
- memset(indexName, 0, sizeof(indexName));
-
- strncpy(indexName,
- indexFileName,
- bytesToRetain);
-
- char db2IndexName[MAX_DB2_FILENAME_LENGTH+1];
-
- convertMySQLNameToDB2Name(indexFileName, db2IndexName, sizeof(db2IndexName));
-
- query.append(STRING_WITH_LEN("RENAME INDEX "));
- query.append(db2FromLibName);
- query.append('.');
- query.append(db2IndexName);
- query.append(STRING_WITH_LEN(" TO "));
- if (db2i_table::appendQualifiedIndexFileName(indexName, db2ToFileName, query, db2i_table::ASCII_SQL, typeNone) == -1)
- {
- getErrTxt(DB2I_ERR_INVALID_NAME,"index","*generated*");
- DBUG_RETURN(DB2I_ERR_INVALID_NAME );
- }
- renameQuery.addStatement(query);
- DBUG_PRINT("ha_ibmdb2i::rename_table", ("Sent to DB2: %s",query.c_ptr_safe()));
- }
- }
-
-
- if (queryFile)
- bridge()->deallocateFile(queryFile);
-
- if (rc != HA_ERR_END_OF_FILE)
- DBUG_RETURN(rc);
-
- char db2Name[MAX_DB2_QUALIFIEDNAME_LENGTH];
-
- /* Rename the table */
- query.length(0);
- query.append(STRING_WITH_LEN(" RENAME TABLE "));
- db2i_table::getDB2QualifiedNameFromPath(from, db2Name);
- query.append(db2Name);
- query.append(STRING_WITH_LEN(" TO "));
- query.append(db2ToFileName);
- DBUG_PRINT("ha_ibmdb2i::rename_table", ("Sent to DB2: %s",query.c_ptr_safe()));
- renameQuery.addStatement(query);
- rc = bridge()->execSQL(renameQuery.getPtrToData(),
- renameQuery.getStatementCount(),
- getCommitLevel());
-
- if (!rc)
- db2i_table::renameAssocFiles(from, to);
-
- DBUG_RETURN(rc);
-}
-
-
-int ha_ibmdb2i::create(const char *name, TABLE *table_arg,
- HA_CREATE_INFO *create_info)
-{
- DBUG_ENTER("ha_ibmdb2i::create");
-
- int rc;
- char fileSortSequence[11] = "*HEX";
- char fileSortSequenceLibrary[11] = "";
- char fileSortSequenceType = ' ';
- char libName[MAX_DB2_SCHEMANAME_LENGTH+1];
- char fileName[MAX_DB2_FILENAME_LENGTH+1];
- char colName[MAX_DB2_COLNAME_LENGTH+1];
- bool isTemporary;
- ulong auto_inc_value;
-
- db2i_table::getDB2LibNameFromPath(name, libName);
- db2i_table::getDB2FileNameFromPath(name, fileName);
-
- if (osVersion.v < 6)
- {
- if (strlen(libName) >
- MAX_DB2_V5R4_LIBNAME_LENGTH + (isOrdinaryIdentifier(libName) ? 2 : 0))
- {
- getErrTxt(DB2I_ERR_TOO_LONG_SCHEMA,libName, MAX_DB2_V5R4_LIBNAME_LENGTH);
- DBUG_RETURN(DB2I_ERR_TOO_LONG_SCHEMA);
- }
- }
- else if (strlen(libName) > MAX_DB2_V6R1_LIBNAME_LENGTH)
- {
- getErrTxt(DB2I_ERR_TOO_LONG_SCHEMA,libName, MAX_DB2_V6R1_LIBNAME_LENGTH);
- DBUG_RETURN(DB2I_ERR_TOO_LONG_SCHEMA);
- }
-
- String query(256);
-
- if (strcmp(libName, DB2I_TEMP_TABLE_SCHEMA))
- {
- query.append(STRING_WITH_LEN("CREATE TABLE "));
- query.append(libName);
- query.append('.');
- query.append(fileName);
- isTemporary = FALSE;
- }
- else
- {
- query.append(STRING_WITH_LEN("DECLARE GLOBAL TEMPORARY TABLE "));
- query.append(fileName);
- isTemporary = TRUE;
- }
- query.append(STRING_WITH_LEN(" ("));
-
- THD* thd = ha_thd();
- enum_TimeFormat timeFormat = (enum_TimeFormat)(THDVAR(thd, compat_opt_time_as_duration));
- enum_YearFormat yearFormat = (enum_YearFormat)(THDVAR(thd, compat_opt_year_as_int));
- enum_BlobMapping blobMapping = (enum_BlobMapping)(THDVAR(thd, compat_opt_blob_cols));
- enum_ZeroDate zeroDate = (enum_ZeroDate)(THDVAR(thd, compat_opt_allow_zero_date_vals));
- bool propagateDefaults = THDVAR(thd, propagate_default_col_vals);
-
- Field **field;
- for (field= table_arg->field; *field; field++)
- {
- if ( field != table_arg->field ) // Not the first one
- query.append(STRING_WITH_LEN(" , "));
-
- if (!convertMySQLNameToDB2Name((*field)->field_name, colName, sizeof(colName)))
- {
- getErrTxt(DB2I_ERR_INVALID_NAME,"field",(*field)->field_name);
- DBUG_RETURN(DB2I_ERR_INVALID_NAME );
- }
-
- query.append(colName);
- query.append(' ');
-
- if (rc = getFieldTypeMapping(*field,
- query,
- timeFormat,
- blobMapping,
- zeroDate,
- propagateDefaults,
- yearFormat))
- DBUG_RETURN(rc);
-
- if ( (*field)->flags & NOT_NULL_FLAG )
- {
- query.append(STRING_WITH_LEN(" NOT NULL "));
- }
- if ( (*field)->flags & AUTO_INCREMENT_FLAG )
- {
-#ifdef WITH_PARTITION_STORAGE_ENGINE
- if (table_arg->part_info)
- {
- getErrTxt(DB2I_ERR_PART_AUTOINC);
- DBUG_RETURN(DB2I_ERR_PART_AUTOINC);
- }
-#endif
- query.append(STRING_WITH_LEN(" GENERATED BY DEFAULT AS IDENTITY ") );
- if (create_info->auto_increment_value != 0)
- {
- /* Query was ALTER TABLE...AUTO_INCREMENT = x; or
- CREATE TABLE ...AUTO_INCREMENT = x; Set the starting
- value for the auto_increment column. */
- char stringValue[22];
- CHARSET_INFO *cs= &my_charset_bin;
- uint len = (uint)(cs->cset->longlong10_to_str)(cs,stringValue,sizeof(stringValue), 10, create_info->auto_increment_value);
- stringValue[len] = 0;
- query.append(STRING_WITH_LEN(" (START WITH "));
- query.append(stringValue);
-
- uint64 maxValue=maxValueForField(*field);
-
- if (maxValue)
- {
- len = (uint)(cs->cset->longlong10_to_str)(cs,stringValue,sizeof(stringValue), 10, maxValue);
- stringValue[len] = 0;
- query.append(STRING_WITH_LEN(" MAXVALUE "));
- query.append(stringValue);
- }
-
- query.append(STRING_WITH_LEN(") "));
- }
-
- }
- }
-
- String fieldDefinition(128);
-
- if (table_arg->s->primary_key != MAX_KEY && !isTemporary)
- {
- query.append(STRING_WITH_LEN(", PRIMARY KEY "));
- rc = buildIndexFieldList(fieldDefinition,
- table_arg->key_info[table_arg->s->primary_key],
- true,
- &fileSortSequenceType,
- fileSortSequence,
- fileSortSequenceLibrary);
- if (rc) DBUG_RETURN(rc);
- query.append(fieldDefinition);
- }
-
- rc = buildDB2ConstraintString(thd->lex,
- query,
- name,
- table_arg->field,
- &fileSortSequenceType,
- fileSortSequence,
- fileSortSequenceLibrary);
- if (rc) DBUG_RETURN (rc);
-
- query.append(STRING_WITH_LEN(" ) "));
-
- if (isTemporary)
- query.append(STRING_WITH_LEN(" ON COMMIT PRESERVE ROWS "));
-
- if (create_info->alias)
- generateAndAppendRCDFMT(create_info->alias, query);
- else if (((TABLE_LIST*)(thd->lex->select_lex.table_list.first))->table_name)
- generateAndAppendRCDFMT((char*)((TABLE_LIST*)(thd->lex->select_lex.table_list.first))->table_name, query);
-
- DBUG_PRINT("ha_ibmdb2i::create", ("Sent to DB2: %s",query.c_ptr()));
- SqlStatementStream sqlStream(query.length());
- sqlStream.addStatement(query,fileSortSequence,fileSortSequenceLibrary);
-
- if (table_arg->s->primary_key != MAX_KEY &&
- !isTemporary &&
- (THDVAR(thd, create_index_option)==1) &&
- (fileSortSequenceType != 'B') &&
- (fileSortSequenceType != ' '))
- {
- rc = generateShadowIndex(sqlStream,
- table_arg->key_info[table_arg->s->primary_key],
- libName,
- fileName,
- fieldDefinition);
- if (rc) DBUG_RETURN(rc);
- }
- for (uint i = 0; i < table_arg->s->keys; ++i)
- {
- if (i != table_arg->s->primary_key || isTemporary)
- {
- rc = buildCreateIndexStatement(sqlStream,
- table_arg->key_info[i],
- false,
- libName,
- fileName);
- if (rc) DBUG_RETURN (rc);
- }
- }
-
- bool noCommit = isTemporary || ((!autoCommitIsOn(thd)) && (thd_sql_command(thd) == SQLCOM_ALTER_TABLE));
-
- initBridge();
-
-// if (THDVAR(thd, discovery_mode) == 1)
-// bridge()->expectErrors(QMY_ERR_TABLE_EXISTS);
-
- rc = bridge()->execSQL(sqlStream.getPtrToData(),
- sqlStream.getStatementCount(),
- (isTemporary ? QMY_NONE : getCommitLevel(thd)),
- TRUE,
- FALSE,
- noCommit );
-
- if (unlikely(rc == QMY_ERR_MSGID) &&
- memcmp(bridge()->getErrorMsgID(), DB2I_SQL0350, 7) == 0)
- {
- my_error(ER_BLOB_USED_AS_KEY, MYF(0), "*unknown*");
- rc = ER_BLOB_USED_AS_KEY;
- }
-/* else if (unlikely(rc == QMY_ERR_TABLE_EXISTS) &&
- THDVAR(thd, discovery_mode) == 1)
- {
- db2i_table* temp = new db2i_table(table_arg->s, name);
- int32 rc = temp->fastInitForCreate(name);
- delete temp;
-
- if (!rc)
- warning(thd, DB2I_ERR_WARN_CREATE_DISCOVER);
-
- DBUG_RETURN(rc);
- }
-*/
-
- if (!rc && !isTemporary)
- {
- db2i_table* temp = new db2i_table(table_arg->s, name);
- rc = temp->fastInitForCreate(name);
- delete temp;
- if (rc)
- delete_table(name);
- }
-
- DBUG_RETURN(rc);
-}
-
-
-/**
- @brief
- Add an index on-line to a table. This method is called on behalf of
- a CREATE INDEX or ALTER TABLE statement.
- It is implemented via a composed DDL statement passed to DB2.
-*/
-int ha_ibmdb2i::add_index(TABLE *table_arg,
- KEY *key_info,
- uint num_of_keys)
-{
- DBUG_ENTER("ha_ibmdb2i::add_index");
-
- int rc;
- SqlStatementStream sqlStream(256);
- const char* libName = db2Table->getDB2LibName(db2i_table::ASCII_SQL);
- const char* fileName = db2Table->getDB2TableName(db2i_table::ASCII_SQL);
-
- quiesceAllFileHandles();
-
- uint primaryKey = MAX_KEY;
- if (table_arg->s->primary_key >= MAX_KEY && !db2Table->isTemporary())
- {
- for (int i = 0; i < num_of_keys; ++i)
- {
- if (strcmp(key_info[i].name, "PRIMARY") == 0)
- {
- primaryKey = i;
- break;
- }
- else if (primaryKey == MAX_KEY &&
- key_info[i].flags & HA_NOSAME)
- {
- primaryKey = i;
- for (int j=0 ; j < key_info[i].key_parts ;j++)
- {
- uint fieldnr= key_info[i].key_part[j].fieldnr;
- if (table_arg->s->field[fieldnr]->null_ptr ||
- table_arg->s->field[fieldnr]->key_length() !=
- key_info[i].key_part[j].length)
- {
- primaryKey = MAX_KEY;
- break;
- }
- }
- }
- }
- }
-
-
- for (int i = 0; i < num_of_keys; ++i)
- {
- KEY& curKey= key_info[i];
- rc = buildCreateIndexStatement(sqlStream,
- curKey,
- (i == primaryKey),
- libName,
- fileName);
- if (rc) DBUG_RETURN (rc);
- }
-
- rc = bridge()->execSQL(sqlStream.getPtrToData(),
- sqlStream.getStatementCount(),
- getCommitLevel(),
- FALSE,
- FALSE,
- FALSE,
- dataHandle);
-
- /* Handle the case where a unique index is being created but an error occurs
- because the file contains duplicate key values. */
- if (rc == ER_DUP_ENTRY)
- print_keydup_error(MAX_KEY,ER(ER_DUP_ENTRY_WITH_KEY_NAME));
-
- DBUG_RETURN(rc);
-}
-
-/**
- @brief
- Drop an index on-line from a table. This method is called on behalf of
- a DROP INDEX or ALTER TABLE statement.
- It is implemented via a composed DDL statement passed to DB2.
-*/
-int ha_ibmdb2i::prepare_drop_index(TABLE *table_arg,
- uint *key_num, uint num_of_keys)
-{
- DBUG_ENTER("ha_ibmdb2i::prepare_drop_index");
- int rc;
- int i = 0;
- String query(64);
- SqlStatementStream sqlStream(64 * num_of_keys);
- SqlStatementStream shadowStream(64 * num_of_keys);
-
- quiesceAllFileHandles();
-
- const char* libName = db2Table->getDB2LibName(db2i_table::ASCII_SQL);
- const char* fileName = db2Table->getDB2TableName(db2i_table::ASCII_SQL);
-
- while (i < num_of_keys)
- {
- query.length(0);
- DBUG_PRINT("info", ("ha_ibmdb2i::prepare_drop_index %u", key_num[i]));
- KEY& curKey= table_arg->key_info[key_num[i]];
- if (key_num[i] == table->s->primary_key && !db2Table->isTemporary())
- {
- query.append(STRING_WITH_LEN("ALTER TABLE "));
- query.append(libName);
- query.append(STRING_WITH_LEN("."));
- query.append(fileName);
- query.append(STRING_WITH_LEN(" DROP PRIMARY KEY"));
- }
- else
- {
- query.append(STRING_WITH_LEN("DROP INDEX "));
- query.append(libName);
- query.append(STRING_WITH_LEN("."));
- db2i_table::appendQualifiedIndexFileName(curKey.name, fileName, query);
- }
- DBUG_PRINT("ha_ibmdb2i::prepare_drop_index", ("Sent to DB2: %s",query.c_ptr_safe()));
- sqlStream.addStatement(query);
-
- query.length(0);
- query.append(STRING_WITH_LEN("DROP INDEX "));
- query.append(libName);
- query.append(STRING_WITH_LEN("."));
- db2i_table::appendQualifiedIndexFileName(curKey.name, fileName, query, db2i_table::ASCII_SQL, typeHex);
-
- DBUG_PRINT("ha_ibmdb2i::prepare_drop_index", ("Sent to DB2: %s",query.c_ptr_safe()));
- shadowStream.addStatement(query);
-
- ++i;
- }
-
- rc = bridge()->execSQL(sqlStream.getPtrToData(),
- sqlStream.getStatementCount(),
- getCommitLevel(),
- FALSE,
- FALSE,
- FALSE,
- dataHandle);
-
- if (rc == 0)
- bridge()->execSQL(shadowStream.getPtrToData(),
- shadowStream.getStatementCount(),
- getCommitLevel());
-
- DBUG_RETURN(rc);
-}
-
-
-void
-ha_ibmdb2i::unlock_row()
-{
- DBUG_ENTER("ha_ibmdb2i::unlock_row");
- DBUG_VOID_RETURN;
-}
-
-int
-ha_ibmdb2i::index_end()
-{
- DBUG_ENTER("ha_ibmdb2i::index_end");
- warnIfInvalidData();
- last_index_init_rc = 0;
- if (likely(activeReadBuf))
- activeReadBuf->endRead();
- if (likely(!last_index_init_rc))
- releaseIndexFile(active_index);
- active_index= MAX_KEY;
- DBUG_RETURN (0);
-}
-
-int ha_ibmdb2i::doCommit(handlerton *hton, THD *thd, bool all)
-{
- if (!THDVAR(thd, transaction_unsafe))
- {
- if (all || autoCommitIsOn(thd))
- {
- DBUG_PRINT("ha_ibmdb2i::doCommit",("Committing all"));
- return (db2i_ileBridge::getBridgeForThread(thd)->commitmentControl(QMY_COMMIT));
- }
- else
- {
- DBUG_PRINT("ha_ibmdb2i::doCommit",("Committing stmt"));
- return (db2i_ileBridge::getBridgeForThread(thd)->commitStmtTx());
- }
- }
-
- return (0);
-}
-
-
-int ha_ibmdb2i::doRollback(handlerton *hton, THD *thd, bool all)
-{
- if (!THDVAR(thd,transaction_unsafe))
- {
- if (all || autoCommitIsOn(thd))
- {
- DBUG_PRINT("ha_ibmdb2i::doRollback",("Rolling back all"));
- return ( db2i_ileBridge::getBridgeForThread(thd)->commitmentControl(QMY_ROLLBACK));
- }
- else
- {
- DBUG_PRINT("ha_ibmdb2i::doRollback",("Rolling back stmt"));
- return (db2i_ileBridge::getBridgeForThread(thd)->rollbackStmtTx());
- }
- }
- return (0);
-}
-
-
-void ha_ibmdb2i::start_bulk_insert(ha_rows rows)
-{
- DBUG_ENTER("ha_ibmdb2i::start_bulk_insert");
- DBUG_PRINT("ha_ibmdb2i::start_bulk_insert",("Rows hinted %d", rows));
- int rc;
- THD* thd = ha_thd();
- int command = thd_sql_command(thd);
-
- if (db2Table->hasBlobs() ||
- (command == SQLCOM_REPLACE || command == SQLCOM_REPLACE_SELECT))
- rows = 1;
- else if (rows == 0)
- rows = DEFAULT_MAX_ROWS_TO_BUFFER; // Shoot the moon
-
- // If we're doing a multi-row insert, binlogging is active, and the table has an
- // auto_increment column, then we'll attempt to lock the file while we perform a 'fast path' blocked
- // insert. If we can't get the lock, then we'll do a row-by-row 'slow path' insert instead. The reason is
- // because the MI generates the auto_increment (identity value), and if we can't lock the file,
- // then we can't predetermine what that value will be for insertion into the MySQL write buffer.
-
- if ((rows > 1) && // Multi-row insert
- (thd->options & OPTION_BIN_LOG) && // Binlogging is on
- (table->found_next_number_field)) // Table has an auto_increment column
- {
- if (!dataHandle)
- rc = db2Table->dataFile()->allocateNewInstance(&dataHandle, curConnection);
-
- rc = bridge()->lockObj(dataHandle, 1, QMY_LOCK, QMY_LEAR, QMY_YES);
- if (rc==0) // Got the lock
- {
- autoIncLockAcquired = TRUE;
- got_auto_inc_values = FALSE;
- }
- else // Didn't get the lock
- rows = 1; // No problem, but don't block inserts
- }
-
- if (activeHandle == 0)
- {
- last_start_bulk_insert_rc = useDataFile();
- if (last_start_bulk_insert_rc == 0)
- last_start_bulk_insert_rc = prepWriteBuffer(rows, db2Table->dataFile());
- }
-
- if (last_start_bulk_insert_rc == 0)
- outstanding_start_bulk_insert = true;
- else
- {
- if (autoIncLockAcquired == TRUE)
- {
- bridge()->lockObj(dataHandle, 0, QMY_UNLOCK, QMY_LEAR, QMY_YES);
- autoIncLockAcquired = FALSE;
- }
- }
-
- DBUG_VOID_RETURN;
-}
-
-
-int ha_ibmdb2i::end_bulk_insert()
-{
- DBUG_ENTER("ha_ibmdb2i::end_bulk_insert");
- int rc = 0;
-
- if (outstanding_start_bulk_insert)
- {
- rc = finishBulkInsert();
- }
-
- my_errno = rc;
-
- DBUG_RETURN(rc);
-}
-
-
-int ha_ibmdb2i::prepReadBuffer(ha_rows rowsToRead, const db2i_file* file, char intent)
-{
- DBUG_ENTER("ha_ibmdb2i::prepReadBuffer");
- DBUG_ASSERT(rowsToRead > 0);
-
- THD* thd = ha_thd();
- char cmtLvl = getCommitLevel(thd);
-
- const db2i_file::RowFormat* format;
- int rc = file->obtainRowFormat(activeHandle, intent, cmtLvl, &format);
-
- if (unlikely(rc)) DBUG_RETURN(rc);
-
- if (lobFieldsRequested())
- {
- forceSingleRowRead = true;
- rowsToRead = 1;
- }
-
- rowsToRead = min(stats.records+1,min(rowsToRead, DEFAULT_MAX_ROWS_TO_BUFFER));
-
- uint bufSize = min((format->readRowLen * rowsToRead), THDVAR(thd, max_read_buffer_size));
- multiRowReadBuf.allocBuf(format->readRowLen, format->readRowNullOffset, bufSize);
- activeReadBuf = &multiRowReadBuf;
-
- if (db2Table->hasBlobs())
- {
- if (!blobReadBuffers)
- blobReadBuffers = new BlobCollection(db2Table, THDVAR(thd, lob_alloc_size));
- rc = prepareReadBufferForLobs();
- if (rc) DBUG_RETURN(rc);
- }
-
-// if (accessIntent == QMY_UPDATABLE &&
-// thd_tx_isolation(thd) == ISO_REPEATABLE_READ &&
-// !THDVAR(thd, transaction_unsafe))
-// activeReadBuf->update(QMY_READ_ONLY, &releaseRowNeeded, QMY_REPEATABLE_READ);
-// else
- activeReadBuf->update(intent, &releaseRowNeeded, cmtLvl);
-
- DBUG_RETURN(rc);
-}
-
-
-int ha_ibmdb2i::prepWriteBuffer(ha_rows rowsToWrite, const db2i_file* file)
-{
- DBUG_ENTER("ha_ibmdb2i::prepWriteBuffer");
- DBUG_ASSERT(accessIntent == QMY_UPDATABLE && rowsToWrite > 0);
-
- const db2i_file::RowFormat* format;
- int rc = file->obtainRowFormat(activeHandle,
- QMY_UPDATABLE,
- getCommitLevel(ha_thd()),
- &format);
-
- if (unlikely(rc)) DBUG_RETURN(rc);
-
- rowsToWrite = min(rowsToWrite, DEFAULT_MAX_ROWS_TO_BUFFER);
-
- uint bufSize = min((format->writeRowLen * rowsToWrite), THDVAR(ha_thd(), max_write_buffer_size));
- multiRowWriteBuf.allocBuf(format->writeRowLen, format->writeRowNullOffset, bufSize);
- activeWriteBuf = &multiRowWriteBuf;
-
- if (!blobWriteBuffers && db2Table->hasBlobs())
- {
- blobWriteBuffers = new ValidatedPointer<char>[db2Table->getBlobCount()];
- }
- DBUG_RETURN(rc);
-}
-
-
-int ha_ibmdb2i::flushWrite(FILE_HANDLE fileHandle, uchar* buf )
-{
- DBUG_ENTER("ha_ibmdb2i::flushWrite");
- int rc;
- int64 generatedIdValue = 0;
- bool IdValueWasGenerated = FALSE;
- char* lastDupKeyNamePtr = NULL;
- uint32 lastDupKeyNameLen = 0;
- int loopCnt = 0;
- bool retry_dup = FALSE;
-
- while (loopCnt == 0 || retry_dup == TRUE)
- {
- rc = bridge()->writeRows(fileHandle,
- activeWriteBuf->ptr(),
- getCommitLevel(),
- &generatedIdValue,
- &IdValueWasGenerated,
- &lastDupKeyRRN,
- &lastDupKeyNamePtr,
- &lastDupKeyNameLen,
- &incrementByValue);
- loopCnt++;
- retry_dup = FALSE;
- invalidateCachedStats();
- if (lastDupKeyNameLen)
- {
- rrnAssocHandle = fileHandle;
-
- int command = thd_sql_command(ha_thd());
-
- if (command == SQLCOM_REPLACE ||
- command == SQLCOM_REPLACE_SELECT)
- lastDupKeyID = 0;
- else
- {
- lastDupKeyID = getKeyFromName(lastDupKeyNamePtr, lastDupKeyNameLen);
-
- if (likely(lastDupKeyID != MAX_KEY))
- {
- uint16 failedRow = activeWriteBuf->rowsWritten()+1;
-
- if (buf && (failedRow != activeWriteBuf->rowCount()))
- {
- const char* badRow = activeWriteBuf->getRowN(failedRow-1);
- bool savedReadAllColumns = readAllColumns;
- readAllColumns = true;
- mungeDB2row(buf,
- badRow,
- badRow + activeWriteBuf->getRowNullOffset(),
- true);
- readAllColumns = savedReadAllColumns;
-
- if (table->found_next_number_field)
- {
- table->next_number_field->store(next_identity_value - (incrementByValue * (activeWriteBuf->rowCount() - (failedRow - 1))));
- }
- }
-
- if (default_identity_value && // Table has ID colm and generating a value
- (!autoIncLockAcquired || !got_auto_inc_values) &&
- // Writing first or only row in block
- loopCnt == 1 && // Didn't already retry
- lastDupKeyID == table->s->next_number_index) // Autoinc column is in failed index
- {
- if (alterStartWith() == 0) // Reset next Identity value to max+1
- retry_dup = TRUE; // Rtry the write operation
- }
- }
- else
- {
- char unknownIndex[MAX_DB2_FILENAME_LENGTH+1];
- convFromEbcdic(lastDupKeyNamePtr, unknownIndex, min(lastDupKeyNameLen, MAX_DB2_FILENAME_LENGTH));
- unknownIndex[min(lastDupKeyNameLen, MAX_DB2_FILENAME_LENGTH)] = 0;
- getErrTxt(DB2I_ERR_UNKNOWN_IDX, unknownIndex);
- }
- }
- }
- }
-
- if ((rc == 0 || rc == HA_ERR_FOUND_DUPP_KEY)
- && default_identity_value && IdValueWasGenerated &&
- (!autoIncLockAcquired || !got_auto_inc_values))
- {
- /* Save the generated identity value for the MySQL last_insert_id() function. */
- insert_id_for_cur_row = generatedIdValue;
-
- /* Store the value into MySQL's buf for row-based replication
- or for an 'on duplicate key update' clause. */
- table->next_number_field->store((longlong) generatedIdValue, TRUE);
- if (autoIncLockAcquired)
- {
- got_auto_inc_values = TRUE;
- next_identity_value = generatedIdValue + incrementByValue;
- }
- }
- else
- {
- if (!autoIncLockAcquired) // Don't overlay value for first row of a block
- insert_id_for_cur_row = 0;
- }
-
-
- activeWriteBuf->resetAfterWrite();
- DBUG_RETURN(rc);
-}
-
-int ha_ibmdb2i::alterStartWith()
-{
- DBUG_ENTER("ha_ibmdb2i::alterStartWith");
- int rc = 0;
- ulonglong nextIdVal;
- if (!dataHandle)
- rc = db2Table->dataFile()->allocateNewInstance(&dataHandle, curConnection);
- if (!rc) {rc = bridge()->lockObj(dataHandle, 1, QMY_LOCK, QMY_LENR, QMY_YES);}
- if (!rc)
- {
- rc = getNextIdVal(&nextIdVal);
- if (!rc) {rc = reset_auto_increment(nextIdVal);}
- bridge()->lockObj(dataHandle, 0, QMY_UNLOCK, QMY_LENR, QMY_YES);
- }
- DBUG_RETURN(rc);
-}
-
-bool ha_ibmdb2i::lobFieldsRequested()
-{
- if (!db2Table->hasBlobs())
- {
- DBUG_PRINT("ha_ibmdb2i::lobFieldsRequested",("No LOBs"));
- return (false);
- }
-
- if (readAllColumns)
- {
- DBUG_PRINT("ha_ibmdb2i::lobFieldsRequested",("All cols requested"));
- return (true);
- }
-
- for (int i = 0; i < db2Table->getBlobCount(); ++i)
- {
- if (bitmap_is_set(table->read_set, db2Table->blobFields[i]))
- {
- DBUG_PRINT("ha_ibmdb2i::lobFieldsRequested",("LOB requested"));
- return (true);
- }
- }
-
- DBUG_PRINT("ha_ibmdb2i::lobFieldsRequested",("No LOBs requested"));
- return (false);
-}
-
-
-int ha_ibmdb2i::prepareReadBufferForLobs()
-{
- DBUG_ENTER("ha_ibmdb2i::prepareReadBufferForLobs");
- DBUG_ASSERT(db2Table->hasBlobs());
-
- uint32 activeLobFields = 0;
- DB2LobField* lobField;
- uint16 blobCount = db2Table->getBlobCount();
-
- char* readBuf = activeReadBuf->getRowN(0);
-
- for (int i = 0; i < blobCount; ++i)
- {
- int fieldID = db2Table->blobFields[i];
- DB2Field& db2Field = db2Table->db2Field(fieldID);
- lobField = db2Field.asBlobField(readBuf);
- if (readAllColumns ||
- bitmap_is_set(table->read_set, fieldID))
- {
- lobField->dataHandle = (ILEMemHandle)blobReadBuffers->getBufferPtr(fieldID);
- activeLobFields++;
- }
- else
- {
- lobField->dataHandle = NULL;
- }
- }
-
- if (activeLobFields == 0)
- {
- for (int i = 0; i < blobCount; ++i)
- {
- DB2Field& db2Field = db2Table->db2Field(db2Table->blobFields[i]);
- uint16 offset = db2Field.getBufferOffset() + db2Field.calcBlobPad();
-
- for (int r = 1; r < activeReadBuf->getRowCapacity(); ++r)
- {
- lobField = (DB2LobField*)(activeReadBuf->getRowN(r) + offset);
- lobField->dataHandle = NULL;
- }
- }
- }
-
- activeReadBuf->setRowsToProcess((activeLobFields ? 1 : activeReadBuf->getRowCapacity()));
- int rc = bridge()->objectOverride(activeHandle,
- activeReadBuf->ptr(),
- activeReadBuf->getRowLength());
- DBUG_RETURN(rc);
-}
-
-
-uint32 ha_ibmdb2i::adjustLobBuffersForRead()
-{
- DBUG_ENTER("ha_ibmdb2i::adjustLobBuffersForRead");
-
- char* readBuf = activeReadBuf->getRowN(0);
-
- for (int i = 0; i < db2Table->getBlobCount(); ++i)
- {
- DB2Field& db2Field = db2Table->db2Field(db2Table->blobFields[i]);
- DB2LobField* lobField = db2Field.asBlobField(readBuf);
- if (readAllColumns ||
- bitmap_is_set(table->read_set, db2Table->blobFields[i]))
- {
- lobField->dataHandle = (ILEMemHandle)blobReadBuffers->reallocBuffer(db2Table->blobFields[i], lobField->length);
-
- if (lobField->dataHandle == NULL)
- DBUG_RETURN(HA_ERR_OUT_OF_MEM);
- }
- else
- {
- lobField->dataHandle = 0;
- }
- }
-
- int32 rc = bridge()->objectOverride(activeHandle,
- activeReadBuf->ptr());
- DBUG_RETURN(rc);
-}
-
-
-
-int ha_ibmdb2i::reset()
-{
- DBUG_ENTER("ha_ibmdb2i::reset");
-
- if (outstanding_start_bulk_insert)
- {
- finishBulkInsert();
- }
-
- if (activeHandle != 0)
- {
- releaseActiveHandle();
- }
-
- cleanupBuffers();
-
- db2i_ileBridge::getBridgeForThread(ha_thd())->freeErrorStorage();
-
- last_rnd_init_rc = last_index_init_rc = last_start_bulk_insert_rc = 0;
-
- returnDupKeysImmediately = false;
- onDupUpdate = false;
- forceSingleRowRead = false;
-
-#ifndef DBUG_OFF
- cachedBridge=NULL;
-#endif
-
- DBUG_RETURN(0);
-}
-
-
-int32 ha_ibmdb2i::buildCreateIndexStatement(SqlStatementStream& sqlStream,
- KEY& key,
- bool isPrimary,
- const char* db2LibName,
- const char* db2FileName)
-{
- DBUG_ENTER("ha_ibmdb2i::buildCreateIndexStatement");
-
- char fileSortSequence[11] = "*HEX";
- char fileSortSequenceLibrary[11] = "";
- char fileSortSequenceType = ' ';
- String query(256);
- query.length(0);
- int rc = 0;
-
- if (isPrimary)
- {
- query.append(STRING_WITH_LEN("ALTER TABLE "));
- query.append(db2LibName);
- query.append('.');
- query.append(db2FileName);
- query.append(STRING_WITH_LEN(" ADD PRIMARY KEY "));
- }
- else
- {
- query.append(STRING_WITH_LEN("CREATE"));
-
- if (key.flags & HA_NOSAME)
- query.append(STRING_WITH_LEN(" UNIQUE WHERE NOT NULL"));
-
- query.append(STRING_WITH_LEN(" INDEX "));
-
- query.append(db2LibName);
- query.append('.');
- if (db2i_table::appendQualifiedIndexFileName(key.name, db2FileName, query))
- {
- getErrTxt(DB2I_ERR_INVALID_NAME,"index","*generated*");
- DBUG_RETURN(DB2I_ERR_INVALID_NAME );
- }
-
- query.append(STRING_WITH_LEN(" ON "));
-
- query.append(db2LibName);
- query.append('.');
- query.append(db2FileName);
- }
-
- String fieldDefinition(128);
- rc = buildIndexFieldList(fieldDefinition,
- key,
- isPrimary,
- &fileSortSequenceType,
- fileSortSequence,
- fileSortSequenceLibrary);
-
- if (rc) DBUG_RETURN(rc);
-
- query.append(fieldDefinition);
-
- if ((THDVAR(ha_thd(), create_index_option)==1) &&
- (fileSortSequenceType != 'B') &&
- (fileSortSequenceType != ' '))
- {
- rc = generateShadowIndex(sqlStream,
- key,
- db2LibName,
- db2FileName,
- fieldDefinition);
- if (rc) DBUG_RETURN(rc);
- }
-
- DBUG_PRINT("ha_ibmdb2i::buildCreateIndexStatement", ("Sent to DB2: %s",query.c_ptr_safe()));
- sqlStream.addStatement(query,fileSortSequence,fileSortSequenceLibrary);
-
- DBUG_RETURN(0);
-}
-
-/**
- Generate the SQL syntax for the list of fields to be assigned to the
- specified key. The corresponding sort sequence is also calculated.
-
- @param[out] appendHere The string to receive the generated SQL
- @param key The key to evaluate
- @param isPrimary True if this is being generated on behalf of the primary key
- @param[out] fileSortSequenceType The type of the associated sort sequence
- @param[out] fileSortSequence The name of the associated sort sequence
- @param[out] fileSortSequenceLibrary The library of the associated sort sequence
-
- @return 0 if successful; error value otherwise
-*/
-int32 ha_ibmdb2i::buildIndexFieldList(String& appendHere,
- const KEY& key,
- bool isPrimary,
- char* fileSortSequenceType,
- char* fileSortSequence,
- char* fileSortSequenceLibrary)
-{
- DBUG_ENTER("ha_ibmdb2i::buildIndexFieldList");
- appendHere.append(STRING_WITH_LEN(" ( "));
- for (int j = 0; j < key.key_parts; ++j)
- {
- char colName[MAX_DB2_COLNAME_LENGTH+1];
- if (j != 0)
- {
- appendHere.append(STRING_WITH_LEN(" , "));
- }
-
- KEY_PART_INFO& kpi = key.key_part[j];
- Field* field = kpi.field;
-
- convertMySQLNameToDB2Name(field->field_name,
- colName,
- sizeof(colName));
- appendHere.append(colName);
-
- int32 rc;
- rc = updateAssociatedSortSequence(field->charset(),
- fileSortSequenceType,
- fileSortSequence,
- fileSortSequenceLibrary);
- if (rc) DBUG_RETURN (rc);
- }
-
- appendHere.append(STRING_WITH_LEN(" ) "));
-
- DBUG_RETURN(0);
-}
-
-
-/**
- Generate an SQL statement that defines a *HEX sorted index to implement
- the ibmdb2i_create_index.
-
- @param[out] stream The stream to append the generated statement to
- @param key The key to evaluate
- @param[out] libName The library containg the table
- @param[out] fileName The DB2-compatible name of the table
- @param[out] fieldDefinition The list of the fields in the index, in SQL syntax
-
- @return 0 if successful; error value otherwise
-*/
-int32 ha_ibmdb2i::generateShadowIndex(SqlStatementStream& stream,
- const KEY& key,
- const char* libName,
- const char* fileName,
- const String& fieldDefinition)
-{
- String shadowQuery(256);
- shadowQuery.length(0);
- shadowQuery.append(STRING_WITH_LEN("CREATE INDEX "));
- shadowQuery.append(libName);
- shadowQuery.append('.');
- if (db2i_table::appendQualifiedIndexFileName(key.name, fileName, shadowQuery, db2i_table::ASCII_SQL, typeHex))
- {
- getErrTxt(DB2I_ERR_INVALID_NAME,"index","*generated*");
- return DB2I_ERR_INVALID_NAME;
- }
- shadowQuery.append(STRING_WITH_LEN(" ON "));
- shadowQuery.append(libName);
- shadowQuery.append('.');
- shadowQuery.append(fileName);
- shadowQuery.append(fieldDefinition);
- DBUG_PRINT("ha_ibmdb2i::generateShadowIndex", ("Sent to DB2: %s",shadowQuery.c_ptr_safe()));
- stream.addStatement(shadowQuery,"*HEX","QSYS");
- return 0;
-}
-
-
-void ha_ibmdb2i::doInitialRead(char orientation,
- uint32 rowsToBuffer,
- ILEMemHandle key,
- int keyLength,
- int keyParts)
-{
- DBUG_ENTER("ha_ibmdb2i::doInitialRead");
-
- if (forceSingleRowRead)
- rowsToBuffer = 1;
- else
- rowsToBuffer = min(rowsToBuffer, activeReadBuf->getRowCapacity());
-
- activeReadBuf->newReadRequest(activeHandle,
- orientation,
- rowsToBuffer,
- THDVAR(ha_thd(), async_enabled),
- key,
- keyLength,
- keyParts);
- DBUG_VOID_RETURN;
-}
-
-
-int ha_ibmdb2i::start_stmt(THD *thd, thr_lock_type lock_type)
-{
- DBUG_ENTER("ha_ibmdb2i::start_stmt");
- initBridge(thd);
- if (!THDVAR(thd, transaction_unsafe))
- {
- trans_register_ha(thd, FALSE, ibmdb2i_hton);
-
- if (!autoCommitIsOn(thd))
- {
- bridge()->beginStmtTx();
- }
- }
-
- DBUG_RETURN(0);
-}
-
-int32 ha_ibmdb2i::handleLOBReadOverflow()
-{
- DBUG_ENTER("ha_ibmdb2i::handleLOBReadOverflow");
- DBUG_ASSERT(db2Table->hasBlobs() && (activeReadBuf->getRowCapacity() == 1));
-
- int32 rc = adjustLobBuffersForRead();
-
- if (!rc)
- {
- activeReadBuf->rewind();
- rc = bridge()->expectErrors(QMY_ERR_END_OF_BLOCK)
- ->read(activeHandle,
- activeReadBuf->ptr(),
- accessIntent,
- getCommitLevel(),
- QMY_SAME);
- releaseRowNeeded = TRUE;
-
- }
- DBUG_RETURN(rc);
-}
-
-
-int32 ha_ibmdb2i::finishBulkInsert()
-{
- int32 rc = 0;
-
- if (activeWriteBuf->rowCount() && activeHandle)
- rc = flushWrite(activeHandle, table->record[0]);
-
- if (activeHandle)
- releaseActiveHandle();
-
- if (autoIncLockAcquired == TRUE)
- {
- // We could check the return code on the unlock, but beware not
- // to overlay the return code from the flushwrite or we will mask
- // duplicate key errors..
- bridge()->lockObj(dataHandle, 0, QMY_UNLOCK, QMY_LEAR, QMY_YES);
- autoIncLockAcquired = FALSE;
- }
- outstanding_start_bulk_insert = false;
- multiRowWriteBuf.freeBuf();
- last_start_bulk_insert_rc = 0;
-
- resetCharacterConversionBuffers();
-
- return rc;
-}
-
-int ha_ibmdb2i::getKeyFromName(const char* name, size_t len)
-{
- for (int i = 0; i < table_share->keys; ++i)
- {
- const char* indexName = db2Table->indexFile(i)->getDB2FileName();
- if ((strncmp(name, indexName, len) == 0) &&
- (strlen(indexName) == len))
- {
- return i;
- }
- }
- return MAX_KEY;
-}
-
-/*
-Determine the number of I/O's it takes to read through the table.
- */
-double ha_ibmdb2i::scan_time()
- {
- DBUG_ENTER("ha_ibmdb2i::scan_time");
- DBUG_RETURN(ulonglong2double((stats.data_file_length)/IO_SIZE));
- }
-
-
-/**
- Estimate the number of I/O's it takes to read a set of ranges through
- an index.
-
- @param index
- @param ranges
- @param rows
-
- @return The estimate number of I/Os
-*/
-
-double ha_ibmdb2i::read_time(uint index, uint ranges, ha_rows rows)
-{
- DBUG_ENTER("ha_ibmdb2i::read_time");
- int rc;
- uint64 idxPageCnt = 0;
- double cost;
-
- if (unlikely(rows == HA_POS_ERROR))
- DBUG_RETURN(double(rows) + ranges);
-
- rc = bridge()->retrieveIndexInfo(db2Table->indexFile(index)->getMasterDefnHandle(),
- &idxPageCnt);
- if (!rc)
- {
- if ((idxPageCnt == 1) || // Retrieving rows in requested order or
- (ranges == rows)) // 'Sweep' full records retrieval
- cost = idxPageCnt/4;
- else
- {
- uint64 totalRecords = stats.records + 1;
- double dataPageCount = stats.data_file_length/IO_SIZE;
-
- cost = (rows * dataPageCount / totalRecords) +
- min(idxPageCnt, (log_2(idxPageCnt) * ranges +
- rows * (log_2(idxPageCnt) + log_2(rows) - log_2(totalRecords))));
- }
- }
- else
- {
- cost = rows2double(ranges+rows); // Use default costing
- }
- DBUG_RETURN(cost);
-}
-
-int ha_ibmdb2i::useIndexFile(int idx)
-{
- DBUG_ENTER("ha_ibmdb2i::useIndexFile");
-
- if (activeHandle)
- releaseActiveHandle();
-
- int rc = 0;
-
- if (!indexHandles[idx])
- rc = db2Table->indexFile(idx)->allocateNewInstance(&indexHandles[idx], curConnection);
-
- if (rc == 0)
- {
- activeHandle = indexHandles[idx];
- bumpInUseCounter(1);
- }
-
- DBUG_RETURN(rc);
-}
-
-
-ulong ha_ibmdb2i::index_flags(uint inx, uint part, bool all_parts) const
-{
- return HA_READ_NEXT | HA_READ_PREV | HA_KEYREAD_ONLY | HA_READ_ORDER | HA_READ_RANGE;
-}
-
-
-static struct st_mysql_sys_var* ibmdb2i_system_variables[] = {
- MYSQL_SYSVAR(rdb_name),
- MYSQL_SYSVAR(transaction_unsafe),
- MYSQL_SYSVAR(lob_alloc_size),
- MYSQL_SYSVAR(max_read_buffer_size),
- MYSQL_SYSVAR(max_write_buffer_size),
- MYSQL_SYSVAR(async_enabled),
- MYSQL_SYSVAR(assume_exclusive_use),
- MYSQL_SYSVAR(compat_opt_blob_cols),
- MYSQL_SYSVAR(compat_opt_time_as_duration),
- MYSQL_SYSVAR(compat_opt_allow_zero_date_vals),
- MYSQL_SYSVAR(compat_opt_year_as_int),
- MYSQL_SYSVAR(propagate_default_col_vals),
- MYSQL_SYSVAR(create_index_option),
-// MYSQL_SYSVAR(discovery_mode),
- MYSQL_SYSVAR(system_trace_level),
- NULL
-};
-
-
-struct st_mysql_storage_engine ibmdb2i_storage_engine=
-{ MYSQL_HANDLERTON_INTERFACE_VERSION };
-
-mysql_declare_plugin(ibmdb2i)
-{
- MYSQL_STORAGE_ENGINE_PLUGIN,
- &ibmdb2i_storage_engine,
- "IBMDB2I",
- "The IBM development team in Rochester, Minnesota",
- "IBM DB2 for i Storage Engine",
- PLUGIN_LICENSE_GPL,
- ibmdb2i_init_func, /* Plugin Init */
- ibmdb2i_done_func, /* Plugin Deinit */
- 0x0100 /* 1.0 */,
- NULL, /* status variables */
- ibmdb2i_system_variables, /* system variables */
- NULL /* config options */
-}
-mysql_declare_plugin_end;
-maria_declare_plugin(ibmdb2i)
-{
- MYSQL_STORAGE_ENGINE_PLUGIN,
- &ibmdb2i_storage_engine,
- "IBMDB2I",
- "The IBM development team in Rochester, Minnesota",
- "IBM DB2 for i Storage Engine",
- PLUGIN_LICENSE_GPL,
- ibmdb2i_init_func, /* Plugin Init */
- ibmdb2i_done_func, /* Plugin Deinit */
- 0x0100 /* 1.0 */,
- NULL, /* status variables */
- ibmdb2i_system_variables, /* system variables */
- "1.0", /* string version */
- MariaDB_PLUGIN_MATURITY_UNKNOWN /* maturity */
-}
-maria_declare_plugin_end;
diff --git a/storage/ibmdb2i/ha_ibmdb2i.h b/storage/ibmdb2i/ha_ibmdb2i.h
deleted file mode 100644
index b2a43232f2d..00000000000
--- a/storage/ibmdb2i/ha_ibmdb2i.h
+++ /dev/null
@@ -1,822 +0,0 @@
-/*
-Licensed Materials - Property of IBM
-DB2 Storage Engine Enablement
-Copyright IBM Corporation 2007,2008
-All rights reserved
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
- (a) Redistributions of source code must retain this list of conditions, the
- copyright notice in section {d} below, and the disclaimer following this
- list of conditions.
- (b) Redistributions in binary form must reproduce this list of conditions, the
- copyright notice in section (d) below, and the disclaimer following this
- list of conditions, in the documentation and/or other materials provided
- with the distribution.
- (c) The name of IBM may not be used to endorse or promote products derived from
- this software without specific prior written permission.
- (d) The text of the required copyright notice is:
- Licensed Materials - Property of IBM
- DB2 Storage Engine Enablement
- Copyright IBM Corporation 2007,2008
- All rights reserved
-
-THIS SOFTWARE IS PROVIDED BY IBM CORPORATION "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL IBM CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-*/
-
-/** @file ha_ibmdb2i.h
-
- @brief
-
- @note
-
- @see
-*/
-
-#ifdef USE_PRAGMA_INTERFACE
-#pragma interface /* gcc class implementation */
-#endif
-
-#include "as400_types.h"
-#include "as400_protos.h"
-#include "db2i_global.h"
-#include "db2i_ileBridge.h"
-#include "builtins.h"
-#include "db2i_misc.h"
-#include "db2i_file.h"
-#include "db2i_blobCollection.h"
-#include "db2i_collationSupport.h"
-#include "db2i_validatedPointer.h"
-#include "db2i_ioBuffers.h"
-#include "db2i_errors.h"
-#include "db2i_sqlStatementStream.h"
-
-/** @brief
- IBMDB2I_SHARE is a structure that will be shared among all open handlers.
- It is used to describe the underlying table definition, and it caches
- table statistics.
-*/
-struct IBMDB2I_SHARE {
- char *table_name;
- uint table_name_length,use_count;
- pthread_mutex_t mutex;
- THR_LOCK lock;
-
- db2i_table* db2Table;
-
- class CStats
- {
- public:
- void cacheUpdateTime(time_t time)
- {update_time = time; initFlag |= lastModTime;}
- time_t getUpdateTime() const
- {return update_time;}
- void cacheRowCount(ha_rows rows)
- {records = rows; initFlag |= rowCount;}
- ha_rows getRowCount() const
- {return records;}
- void cacheDelRowCount(ha_rows rows)
- {deleted = rows; initFlag |= deletedRowCount;}
- ha_rows getDelRowCount() const
- {return deleted;}
- void cacheMeanLength(ulong len)
- {mean_rec_length = len; initFlag |= meanRowLen;}
- ulong getMeanLength()
- {return mean_rec_length;}
- void cacheAugmentedDataLength(ulong len)
- {data_file_length = len; initFlag |= ioCount;}
- ulong getAugmentedDataLength()
- {return data_file_length;}
- bool isInited(uint flags)
- {return initFlag & flags;}
- void invalidate(uint flags)
- {initFlag &= ~flags;}
-
- private:
- uint initFlag;
- time_t update_time;
- ha_rows records;
- ha_rows deleted;
- ulong mean_rec_length;
- ulong data_file_length;
- } cachedStats;
-
-};
-
-class ha_ibmdb2i: public handler
-{
- THR_LOCK_DATA lock; ///< MySQL lock
- IBMDB2I_SHARE *share; ///< Shared lock info
-
- // The record we are positioned on, together with the handle used to get
- // i.
- uint32 currentRRN;
- uint32 rrnAssocHandle;
-
- // Dup key values needed by info()
- uint32 lastDupKeyRRN;
- uint32 lastDupKeyID;
-
- bool returnDupKeysImmediately;
-
- // Dup key value need by update()
- bool onDupUpdate;
-
-
- db2i_table* db2Table;
-
- // The file handle of the PF or LF being accessed by the current operation.
- FILE_HANDLE activeHandle;
-
- // The file handle of the underlying PF
- FILE_HANDLE dataHandle;
-
- // Array of file handles belonging to the underlying LFs
- FILE_HANDLE* indexHandles;
-
- // Flag to indicate whether a call needs to be made to unlock a row when
- // a read operation has ended. DB2 will handle row unlocking as we move
- // through rows, but if an operation ends before we reach the end of a file,
- // DB2 needs to know to unlock the last row read.
- bool releaseRowNeeded;
-
- // Pointer to a definition of the layout of the row buffer for the file
- // described by activeHandle
- const db2i_file::RowFormat* activeFormat;
-
- IORowBuffer keyBuf;
- uint32 keyLen;
-
- IOWriteBuffer multiRowWriteBuf;
- IOAsyncReadBuffer multiRowReadBuf;
-
- IOAsyncReadBuffer* activeReadBuf;
- IOWriteBuffer* activeWriteBuf;
-
- BlobCollection* blobReadBuffers; // Dynamically allocated per query and used
- // to manage the buffers used for reading LOBs
- ValidatedPointer<char>* blobWriteBuffers;
-
- // Return codes are not used/honored by rnd_init and start_bulk_insert
- // so we need a way to signal the failure "downstream" to subsequent
- // functions.
- int last_rnd_init_rc;
- int last_index_init_rc;
- int last_start_bulk_insert_rc;
-
- // end_bulk_insert may get called twice for a single start_bulk_insert
- // This is our way to do cleanup only once.
- bool outstanding_start_bulk_insert;
-
- // Auto_increment 'increment by' value needed by write_row()
- uint32 incrementByValue;
- bool default_identity_value;
-
- // Flags and values used during write operations for auto_increment processing
- bool autoIncLockAcquired;
- bool got_auto_inc_values;
- uint64 next_identity_value;
-
- // The access intent indicated by the last external_locks() call.
- // May be either QMY_READ or QMY_UPDATABLE
- char accessIntent;
- char readAccessIntent;
-
- ha_rows* indexReadSizeEstimates;
-
- MEM_ROOT conversionBufferMemroot;
-
- bool forceSingleRowRead;
-
- bool readAllColumns;
-
- bool invalidDataFound;
-
- db2i_ileBridge* cachedBridge;
-
- ValidatedObject<volatile uint32> curConnection;
- uint16 activeReferences;
-
-public:
-
- ha_ibmdb2i(handlerton *hton, TABLE_SHARE *table_arg);
- ~ha_ibmdb2i();
-
- const char *table_type() const { return "IBMDB2I"; }
- const char *index_type(uint inx) { return "RADIX"; }
- const key_map *keys_to_use_for_scanning() { return &key_map_full; }
- const char **bas_ext() const;
-
- ulonglong table_flags() const
- {
- return HA_NULL_IN_KEY | HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY |
- HA_PARTIAL_COLUMN_READ |
- HA_DUPLICATE_POS | HA_NO_PREFIX_CHAR_KEYS |
- HA_HAS_RECORDS | HA_BINLOG_ROW_CAPABLE | HA_REQUIRES_KEY_COLUMNS_FOR_DELETE |
- HA_CAN_INDEX_BLOBS;
- }
-
- ulong index_flags(uint inx, uint part, bool all_parts) const;
-
-// Note that we do not implement max_supported_record_length.
-// We'll let create fail accordingly if the row is
-// too long. This allows us to hide the fact that varchars > 32K are being
-// implemented as DB2 LOBs.
-
- uint max_supported_keys() const { return 4000; }
- uint max_supported_key_parts() const { return MAX_DB2_KEY_PARTS; }
- uint max_supported_key_length() const { return 32767; }
- uint max_supported_key_part_length() const { return 32767; }
- double read_time(uint index, uint ranges, ha_rows rows);
- double scan_time();
- int open(const char *name, int mode, uint test_if_locked);
- int close(void);
- 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 idx, bool sorted);
- int index_read(uchar * buf, const uchar * key,
- uint key_len, enum ha_rkey_function find_flag);
- int index_next(uchar * buf);
- int index_read_last(uchar * buf, const uchar * key, uint key_len);
- 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(uchar *buf);
- int rnd_pos(uchar * buf, uchar *pos);
- void position(const uchar *record);
- int info(uint);
- ha_rows records();
- int extra(enum ha_extra_function operation);
- int external_lock(THD *thd, int lock_type);
- int delete_all_rows(void);
- ha_rows records_in_range(uint inx, key_range *min_key,
- key_range *max_key);
- int delete_table(const char *from);
- int rename_table(const char * from, const char * to);
- int create(const char *name, TABLE *form,
- HA_CREATE_INFO *create_info);
- int updateFrm(TABLE *table_def, File file);
- int openTableDef(TABLE *table_def);
- int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys);
- int prepare_drop_index(TABLE *table_arg, uint *key_num, uint num_of_keys);
- int final_drop_index(TABLE *table_arg) {return 0;}
- void get_auto_increment(ulonglong offset, ulonglong increment,
- ulonglong nb_desired_values,
- ulonglong *first_value,
- ulonglong *nb_reserved_values);
- int reset_auto_increment(ulonglong value);
- void restore_auto_increment(ulonglong prev_insert_id) {return;}
- void update_create_info(HA_CREATE_INFO *create_info);
- int getNextIdVal(ulonglong *value);
- int analyze(THD* thd,HA_CHECK_OPT* check_opt);
- int optimize(THD* thd, HA_CHECK_OPT* check_opt);
- bool can_switch_engines();
- void free_foreign_key_create_info(char* str);
- char* get_foreign_key_create_info();
- int get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list);
- uint referenced_by_foreign_key();
- bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes);
- virtual bool get_error_message(int error, String *buf);
-
- THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
- enum thr_lock_type lock_type);
-
- bool low_byte_first() const { return 0; }
- void unlock_row();
- int index_end();
- int reset();
- static int doCommit(handlerton *hton, THD *thd, bool all);
- static int doRollback(handlerton *hton, THD *thd, bool all);
- void start_bulk_insert(ha_rows rows);
- int end_bulk_insert();
- int start_stmt(THD *thd, thr_lock_type lock_type);
-
- void initBridge(THD* thd = NULL)
- {
- if (thd == NULL) thd = ha_thd();
- DBUG_PRINT("ha_ibmdb2i::initBridge",("Initing bridge. Conn ID=%d", thd->thread_id));
- cachedBridge = db2i_ileBridge::getBridgeForThread(thd);
- }
-
- db2i_ileBridge* bridge() {DBUG_ASSERT(cachedBridge); return cachedBridge;}
-
- static uint8 autoCommitIsOn(THD* thd)
- { return (thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN) ? QMY_NO : QMY_YES); }
-
- uint8 getCommitLevel();
- uint8 getCommitLevel(THD* thd);
-
- static int doSavepointSet(THD* thd, char* name)
- {
- return db2i_ileBridge::getBridgeForThread(thd)->savepoint(QMY_SET_SAVEPOINT,
- name);
- }
-
- static int doSavepointRollback(THD* thd, char* name)
- {
- return db2i_ileBridge::getBridgeForThread(thd)->savepoint(QMY_ROLLBACK_SAVEPOINT,
- name);
- }
-
- static int doSavepointRelease(THD* thd, char* name)
- {
- return db2i_ileBridge::getBridgeForThread(thd)->savepoint(QMY_RELEASE_SAVEPOINT,
- name);
- }
-
- // We can't guarantee that the rows we know about when this is called
- // will be the same number of rows that read returns (since DB2 activity
- // may insert additional rows). Therefore, we do as the Federated SE and
- // return the max possible.
- ha_rows estimate_rows_upper_bound()
- {
- return HA_POS_ERROR;
- }
-
-
-private:
-
- enum enum_TimeFormat
- {
- TIME_OF_DAY,
- DURATION
- };
-
- enum enum_BlobMapping
- {
- AS_BLOB,
- AS_VARCHAR
- };
-
- enum enum_ZeroDate
- {
- NO_SUBSTITUTE,
- SUBSTITUTE_0001_01_01
- };
-
- enum enum_YearFormat
- {
- CHAR4,
- SMALLINT
- };
-
- enum_ZeroDate cachedZeroDateOption;
-
- IBMDB2I_SHARE *get_share(const char *table_name, TABLE *table);
- int free_share(IBMDB2I_SHARE *share);
- int32 mungeDB2row(uchar* record, const char* dataPtr, const char* nullMapPtr, bool skipLOBs);
- int prepareRowForWrite(char* data, char* nulls, bool honorIdentCols);
- int prepareReadBufferForLobs();
- int32 prepareWriteBufferForLobs();
- uint32 adjustLobBuffersForRead();
- bool lobFieldsRequested();
- int convertFieldChars(enum_conversionDirection direction,
- uint16 fieldID,
- const char* input,
- char* output,
- size_t ilen,
- size_t olen,
- size_t* outDataLen,
- bool tacitErrors=FALSE,
- size_t* substChars=NULL);
-
- /**
- Fast integer log2 function
- */
- uint64 log_2(uint64 val)
- {
- uint64 exp = 0;
- while( (val >> exp) != 0)
- {
- exp++;
- }
- DBUG_ASSERT(exp-1 == (uint64)log2(val));
- return exp-1;
- }
-
- void bumpInUseCounter(uint16 amount)
- {
- activeReferences += amount;
- DBUG_PRINT("ha_ibmdb2i::bumpInUseCounter", ("activeReferences = %d", activeReferences));
- if (activeReferences)
- curConnection = (uint32)(ha_thd()->thread_id);
- else
- curConnection = 0;
- }
-
-
- int useDataFile()
- {
- DBUG_ENTER("ha_ibmdb2i::useDataFile");
-
- int rc = 0;
- if (!dataHandle)
- rc = db2Table->dataFile()->allocateNewInstance(&dataHandle, curConnection);
- else if (activeHandle == dataHandle)
- DBUG_RETURN(0);
-
- DBUG_ASSERT(activeHandle == 0);
-
- if (likely(rc == 0))
- {
- activeHandle = dataHandle;
- bumpInUseCounter(1);
- }
-
- DBUG_RETURN(rc);
- }
-
- void releaseAnyLockedRows()
- {
- if (releaseRowNeeded)
- {
- DBUG_PRINT("ha_ibmdb2i::releaseAnyLockedRows", ("Releasing rows"));
- db2i_ileBridge::getBridgeForThread()->rrlslck(activeHandle, accessIntent);
- releaseRowNeeded = FALSE;
- }
- }
-
-
- void releaseDataFile()
- {
- DBUG_ENTER("ha_ibmdb2i::releaseDataFile");
- releaseAnyLockedRows();
- bumpInUseCounter(-1);
- DBUG_ASSERT((volatile int)activeReferences >= 0);
- activeHandle = 0;
- DBUG_VOID_RETURN;
- }
-
- int useIndexFile(int idx);
-
- void releaseIndexFile(int idx)
- {
- DBUG_ENTER("ha_ibmdb2i::releaseIndexFile");
- releaseAnyLockedRows();
- bumpInUseCounter(-1);
- DBUG_ASSERT((volatile int)activeReferences >= 0);
- activeHandle = 0;
- DBUG_VOID_RETURN;
- }
-
- FILE_HANDLE allocateFileHandle(char* database, char* table, int* activityReference, bool hasBlobs);
-
- int updateBuffers(const db2i_file::RowFormat* format, uint rowsToRead, uint rowsToWrite);
-
- int flushWrite(FILE_HANDLE fileHandle, uchar* buf = NULL);
-
- int alterStartWith();
-
- int buildDB2ConstraintString(LEX* lex,
- String& appendHere,
- const char* database,
- Field** fields,
- char* fileSortSequenceType,
- char* fileSortSequence,
- char* fileSortSequenceLibrary);
-
- void releaseWriteBuffer();
-
- void setIndexReadEstimate(uint index, ha_rows rows)
- {
- if (!indexReadSizeEstimates)
- {
- indexReadSizeEstimates = (ha_rows*)my_malloc(sizeof(ha_rows) * table->s->keys, MYF(MY_WME | MY_ZEROFILL));
- }
- indexReadSizeEstimates[index] = rows;
- }
-
- ha_rows getIndexReadEstimate(uint index)
- {
- if (indexReadSizeEstimates)
- return max(indexReadSizeEstimates[index], 1);
-
- return 10000; // Assume index scan if no estimate exists.
- }
-
-
- void quiesceAllFileHandles()
- {
- db2i_ileBridge* bridge = db2i_ileBridge::getBridgeForThread();
- if (dataHandle)
- {
- bridge->quiesceFileInstance(dataHandle);
- }
-
- for (int idx = 0; idx < table_share->keys; ++idx)
- {
- if (indexHandles[idx] != 0)
- {
- bridge->quiesceFileInstance(indexHandles[idx]);
- }
- }
- }
-
- int32 buildCreateIndexStatement(SqlStatementStream& sqlStream,
- KEY& key,
- bool isPrimary,
- const char* db2LibName,
- const char* db2FileName);
-
- int32 buildIndexFieldList(String& appendHere,
- const KEY& key,
- bool isPrimary,
- char* fileSortSequenceType,
- char* fileSortSequence,
- char* fileSortSequenceLibrary);
-
- // Specify NULL for data when using the data pointed to by field
- int32 convertMySQLtoDB2(Field* field, const DB2Field& db2Field, char* db2Buf, const uchar* data = NULL);
-
- int32 convertDB2toMySQL(const DB2Field& db2Field, Field* field, const char* buf);
- int getFieldTypeMapping(Field* field,
- String& mapping,
- enum_TimeFormat timeFormate,
- enum_BlobMapping blobMapping,
- enum_ZeroDate zeroDateHandling,
- bool propagateDefaults,
- enum_YearFormat yearFormat);
-
- int getKeyFromName(const char* name, size_t len);
-
- void releaseActiveHandle()
- {
- if (activeHandle == dataHandle)
- releaseDataFile();
- else
- releaseIndexFile(active_index);
- }
-
-
- int32 finishBulkInsert();
-
- void doInitialRead(char orientation,
- uint32 rowsToBuffer,
- ILEMemHandle key = 0,
- int keyLength = 0,
- int keyParts = 0);
-
-
- int32 readFromBuffer(uchar* destination, char orientation)
- {
- char* row;
- int32 rc = 0;
- row = activeReadBuf->readNextRow(orientation, currentRRN);
-
- if (unlikely(!row))
- {
- rc = activeReadBuf->lastrc();
- if (rc == QMY_ERR_LOB_SPACE_TOO_SMALL)
- {
- rc = handleLOBReadOverflow();
- if (rc == 0)
- {
- DBUG_ASSERT(activeReadBuf->rowCount() == 1);
- row = activeReadBuf->readNextRow(orientation, currentRRN);
-
- if (unlikely(!row))
- rc = activeReadBuf->lastrc();
- }
- }
- }
-
- if (likely(rc == 0))
- {
- rrnAssocHandle = activeHandle;
- rc = mungeDB2row(destination, row, row+activeReadBuf->getRowNullOffset(), false);
- }
- return rc;
- }
-
- int32 handleLOBReadOverflow();
-
- char* getCharacterConversionBuffer(int fieldId, int length)
- {
- if (unlikely(!alloc_root_inited(&conversionBufferMemroot)))
- init_alloc_root(&conversionBufferMemroot, 8192, 0);
-
- return (char*)alloc_root(&conversionBufferMemroot, length);;
- }
-
- void resetCharacterConversionBuffers()
- {
- if (alloc_root_inited(&conversionBufferMemroot))
- {
- free_root(&conversionBufferMemroot, MYF(MY_MARK_BLOCKS_FREE));
- }
- }
-
- void tweakReadSet()
- {
- THD* thd = ha_thd();
- int command = thd_sql_command(thd);
- if ((command == SQLCOM_UPDATE ||
- command == SQLCOM_UPDATE_MULTI) ||
- ((command == SQLCOM_DELETE ||
- command == SQLCOM_DELETE_MULTI) &&
- thd->options & OPTION_BIN_LOG))
- readAllColumns = TRUE;
- else
- readAllColumns = FALSE;
- }
-
- /**
-
- */
- int useFileByHandle(char intent,
- FILE_HANDLE handle)
- {
- DBUG_ENTER("ha_ibmdb2i::useFileByHandle");
-
- const db2i_file* file;
- if (handle == dataHandle)
- file = db2Table->dataFile();
- else
- {
- for (uint i = 0; i < table_share->keys; ++i)
- {
- if (indexHandles[i] == handle)
- {
- file = db2Table->indexFile(i);
- active_index = i;
- }
- }
- }
-
- int rc = file->obtainRowFormat(handle, intent, getCommitLevel(), &activeFormat);
- if (likely(rc == 0))
- {
- activeHandle = handle;
- bumpInUseCounter(1);
- }
-
- DBUG_RETURN(rc);
- }
-
- const db2i_file* getFileForActiveHandle() const
- {
- if (activeHandle == dataHandle)
- return db2Table->dataFile();
- else
- for (uint i = 0; i < table_share->keys; ++i)
- if (indexHandles[i] == activeHandle)
- return db2Table->indexFile(i);
- DBUG_ASSERT(0);
- return NULL;
- }
-
- int prepReadBuffer(ha_rows rowsToRead, const db2i_file* file, char intent);
- int prepWriteBuffer(ha_rows rowsToWrite, const db2i_file* file);
-
- void invalidateCachedStats()
- {
- share->cachedStats.invalidate(rowCount | deletedRowCount | objLength |
- meanRowLen | ioCount);
- }
-
- void warnIfInvalidData()
- {
- if (unlikely(invalidDataFound))
- {
- warning(ha_thd(), DB2I_ERR_INVALID_DATA, table->alias);
- }
- }
-
- /**
- Calculate the maximum value that a particular field can hold.
-
- This is used to anticipate overflows in the auto_increment processing.
-
- @param field The Field to be analyzed
-
- @return The maximum value
- */
- static uint64 maxValueForField(const Field* field)
- {
- uint64 maxValue=0;
- switch (field->type())
- {
- case MYSQL_TYPE_TINY:
- if (((const Field_num*)field)->unsigned_flag)
- maxValue = (1 << 8) - 1;
- else
- maxValue = (1 << 7) - 1;
- break;
- case MYSQL_TYPE_SHORT:
- if (((const Field_num*)field)->unsigned_flag)
- maxValue = (1 << 16) - 1;
- else
- maxValue = (1 << 15) - 1;
- break;
- case MYSQL_TYPE_INT24:
- if (((const Field_num*)field)->unsigned_flag)
- maxValue = (1 << 24) - 1;
- else
- maxValue = (1 << 23) - 1;
- break;
- case MYSQL_TYPE_LONG:
- if (((const Field_num*)field)->unsigned_flag)
- maxValue = (1LL << 32) - 1;
- else
- maxValue = (1 << 31) - 1;
- break;
- case MYSQL_TYPE_LONGLONG:
- if (((const Field_num*)field)->unsigned_flag)
- maxValue = ~(0LL);
- else
- maxValue = 1 << 63 - 1;
- break;
- }
-
- return maxValue;
- }
-
- void cleanupBuffers()
- {
- if (blobReadBuffers)
- {
- delete blobReadBuffers;
- blobReadBuffers = NULL;
- }
- if (blobWriteBuffers)
- {
- delete[] blobWriteBuffers;
- blobWriteBuffers = NULL;
- }
- if (alloc_root_inited(&conversionBufferMemroot))
- {
- free_root(&conversionBufferMemroot, MYF(0));
- }
- }
-
-
-/**
- Generate a valid RCDFMT name based on the name of the table.
-
- The RCDFMT name is devised by munging the name of the table,
- uppercasing all ascii alpha-numeric characters and replacing all other
- characters with underscores until up to ten characters have been generated.
-
- @param tableName The name of the table, as given on the MySQL
- CREATE TABLE statement
- @param[out] query The string to receive the generated RCDFMT name
-*/
- static void generateAndAppendRCDFMT(const char* tableName, String& query)
- {
- char rcdfmt[11];
-
- // The RCDFMT name must begin with an alpha character.
- // We enforce this by skipping to the first alpha character in the table
- // name. If no alpha character exists, we use 'X' for the RCDFMT name;
-
- while (*tableName &&
- (!my_isascii(*tableName) ||
- !my_isalpha(system_charset_info, *tableName)))
- {
- tableName += my_mbcharlen(system_charset_info, *tableName);
- }
-
- if (unlikely(!(*tableName)))
- {
- rcdfmt[0]= 'X';
- rcdfmt[1]= 0;
- }
- else
- {
- int r= 0;
- while ((r < sizeof(rcdfmt)-1) && *tableName)
- {
- if (my_isascii(*tableName) &&
- my_isalnum(system_charset_info, *tableName))
- rcdfmt[r] = my_toupper(system_charset_info, *tableName);
- else
- rcdfmt[r] = '_';
-
- ++r;
- tableName += my_mbcharlen(system_charset_info, *tableName);
- }
- rcdfmt[r]= 0;
- }
- query.append(STRING_WITH_LEN(" RCDFMT "));
- query.append(rcdfmt);
- }
-
- int32 generateShadowIndex(SqlStatementStream& stream,
- const KEY& key,
- const char* libName,
- const char* fileName,
- const String& fieldDefinition);
-};
diff --git a/storage/ibmdb2i/plug.in b/storage/ibmdb2i/plug.in
deleted file mode 100644
index 0913d72aabf..00000000000
--- a/storage/ibmdb2i/plug.in
+++ /dev/null
@@ -1,12 +0,0 @@
-MYSQL_STORAGE_ENGINE([ibmdb2i], [], [IBM DB2 for i Storage Engine],
- [IBM DB2 for i Storage Engine], [max,max-no-ndb])
-MYSQL_PLUGIN_DYNAMIC([ibmdb2i], [ha_ibmdb2i.la])
-
-AC_CHECK_HEADER([qlgusr.h],
- # qlgusr.h is just one of the headers from the i5/OS PASE environment; the
- # EBCDIC headers are in /QIBM/include, and have to be converted to ASCII
- # before cpp gets to them
- [:],
- # Missing PASE environment, can't build this engine
- [mysql_plugin_ibmdb2i=no
- with_plugin_ibmdb2i=no])
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index 93665c39482..e529ecbb7a0 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
# 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 the CMakeLists for InnoDB Plugin
+# This is the CMakeLists for InnoDB
INCLUDE(CheckFunctionExists)
INCLUDE(CheckCSourceCompiles)
@@ -40,12 +40,9 @@ IF(UNIX)
ENDIF()
ENDIF()
-# Enable InnoDB's UNIV_DEBUG if MySQL's WITH_DEBUG[_FULL] is defined
-# enable when this bug is resolved:
-# Bug#54861 Additional connections not handled properly in mtr --embedded
-#IF(WITH_DEBUG)
-# ADD_DEFINITIONS("-DUNIV_DEBUG")
-#ENDIF()
+# Enable InnoDB's UNIV_DEBUG for debug builds
+SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DUNIV_DEBUG")
+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DUNIV_DEBUG")
IF(NOT MSVC)
# either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
@@ -127,9 +124,13 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
CHECK_FUNCTION_EXISTS(atomic_cas_ulong HAVE_ATOMIC_CAS_ULONG)
CHECK_FUNCTION_EXISTS(atomic_cas_32 HAVE_ATOMIC_CAS_32)
CHECK_FUNCTION_EXISTS(atomic_cas_64 HAVE_ATOMIC_CAS_64)
- CHECK_FUNCTION_EXISTS(atomic_add_long HAVE_ATOMIC_ADD_LONG)
- IF(HAVE_ATOMIC_CAS_ULONG AND HAVE_ATOMIC_CAS_32 AND
- HAVE_ATOMIC_CAS_64 AND HAVE_ATOMIC_ADD_LONG)
+ CHECK_FUNCTION_EXISTS(atomic_add_long_nv HAVE_ATOMIC_ADD_LONG_NV)
+ CHECK_FUNCTION_EXISTS(atomic_swap_uchar HAVE_ATOMIC_SWAP_UCHAR)
+ IF(HAVE_ATOMIC_CAS_ULONG AND
+ HAVE_ATOMIC_CAS_32 AND
+ HAVE_ATOMIC_CAS_64 AND
+ HAVE_ATOMIC_ADD_LONG_NV AND
+ HAVE_ATOMIC_SWAP_UCHAR)
SET(HAVE_IB_SOLARIS_ATOMICS 1)
ENDIF()
@@ -188,7 +189,7 @@ IF(SIZEOF_PTHREAD_T)
ENDIF()
IF(MSVC)
- ADD_DEFINITIONS(-DHAVE_WINDOWS_ATOMICS -DHAVE_IB_PAUSE_INSTRUCTION)
+ ADD_DEFINITIONS(-DHAVE_WINDOWS_ATOMICS)
ENDIF()
@@ -233,48 +234,25 @@ SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
os/os0file.c os/os0proc.c os/os0sync.c os/os0thread.c
page/page0cur.c page/page0page.c page/page0zip.c
que/que0que.c
- handler/ha_innodb.cc handler/handler0alter.cc handler/i_s.cc handler/mysql_addons.cc
+ handler/ha_innodb.cc handler/handler0alter.cc handler/i_s.cc
read/read0read.c
rem/rem0cmp.c rem/rem0rec.c
row/row0ext.c row/row0ins.c row/row0merge.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/srv0srv.c srv/srv0start.c
sync/sync0arr.c sync/sync0rw.c sync/sync0sync.c
- thr/thr0loc.c
trx/trx0i_s.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/ut0rbt.c ut/ut0rnd.c
- ut/ut0ut.c ut/ut0vec.c ut/ut0wqueue.c)
+ ut/ut0ut.c ut/ut0vec.c ut/ut0wqueue.c ut/ut0bh.c)
IF(WITH_INNODB)
# Legacy option
SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
ENDIF()
-
-#The plugin's CMakeLists.txt still needs to work with previous versions of MySQL.
-IF(EXISTS ${SOURCE_DIR}/storage/mysql_storage_engine.cmake)
- # Old plugin support on Windows only,
- # use tricks to force ha_innodb.dll name for DLL
- INCLUDE(${SOURCE_DIR}/storage/mysql_storage_engine.cmake)
- MYSQL_STORAGE_ENGINE(INNOBASE)
- GET_TARGET_PROPERTY(LIB_LOCATION ha_innobase LOCATION)
- IF(LIB_LOCATION)
- SET_TARGET_PROPERTIES(ha_innobase PROPERTIES OUTPUT_NAME ha_innodb)
- ENDIF()
-ELSEIF (MYSQL_VERSION_ID LESS "50137")
- # Windows only, no plugin support
- IF (NOT SOURCE_SUBLIBS)
- ADD_DEFINITIONS(-DMYSQL_SERVER)
- ADD_LIBRARY(innobase STATIC ${INNOBASE_SOURCES})
- # Require mysqld_error.h, which is built as part of the GenError
- ADD_DEPENDENCIES(innobase GenError)
- ENDIF()
-ELSE()
- # New plugin support, cross-platform , base name for shared module is "ha_innodb"
- MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE
- MODULE_ONLY
- MODULE_OUTPUT_NAME ha_innodb
- LINK_LIBRARIES ${ZLIB_LIBRARY})
-ENDIF()
+MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE
+ MODULE_ONLY
+ MODULE_OUTPUT_NAME ha_innodb
+ LINK_LIBRARIES ${ZLIB_LIBRARY})
diff --git a/storage/innobase/COPYING b/storage/innobase/COPYING
deleted file mode 100644
index 6b106e18fdb..00000000000
--- a/storage/innobase/COPYING
+++ /dev/null
@@ -1,351 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-Preamble
-========
-
-The licenses for most software are designed to take away your freedom
-to share and change it. By contrast, the GNU General Public License is
-intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
-When we speak of free software, we are referring to freedom, not price.
-Our General Public Licenses are designed to make sure that you have
-the freedom to distribute copies of free software (and charge for this
-service if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs; and that you know you can do these things.
-
-To protect your rights, we need to make restrictions that forbid anyone
-to deny you these rights or to ask you to surrender the rights. These
-restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-For example, if you distribute copies of such a program, whether gratis
-or for a fee, you must give the recipients all the rights that you
-have. You must make sure that they, too, receive or can get the source
-code. And you must show them these terms so they know their rights.
-
-We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-Finally, any free program is threatened constantly by software patents.
-We wish to avoid the danger that redistributors of a free program will
-individually obtain patent licenses, in effect making the program
-proprietary. To prevent this, we have made it clear that any patent
-must be licensed for everyone's free use or not licensed at all.
-
-The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- 0. This License applies to any program or other work which contains a
- notice placed by the copyright holder saying it may be distributed
- under the terms of this General Public License. The "Program",
- below, refers to any such program or work, and a "work based on
- the Program" means either the Program or any derivative work under
- copyright law: that is to say, a work containing the Program or a
- portion of it, either verbatim or with modifications and/or
- translated into another language. (Hereinafter, translation is
- included without limitation in the term "modification".) Each
- licensee is addressed as "you".
-
- Activities other than copying, distribution and modification are
- not covered by this License; they are outside its scope. The act
- of running the Program is not restricted, and the output from the
- Program is covered only if its contents constitute a work based on
- the Program (independent of having been made by running the
- Program). Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
- source code as you receive it, in any medium, provided that you
- conspicuously and appropriately publish on each copy an appropriate
- copyright notice and disclaimer of warranty; keep intact all the
- notices that refer to this License and to the absence of any
- warranty; and give any other recipients of the Program a copy of
- this License along with the Program.
-
- You may charge a fee for the physical act of transferring a copy,
- and you may at your option offer warranty protection in exchange
- for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
- of it, thus forming a work based on the Program, and copy and
- distribute such modifications or work under the terms of Section 1
- above, provided that you also meet all of these conditions:
-
- a. You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b. You must cause any work that you distribute or publish, that
- in whole or in part contains or is derived from the Program
- or any part thereof, to be licensed as a whole at no charge
- to all third parties under the terms of this License.
-
- c. If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display
- an announcement including an appropriate copyright notice and
- a notice that there is no warranty (or else, saying that you
- provide a warranty) and that users may redistribute the
- program under these conditions, and telling the user how to
- view a copy of this License. (Exception: if the Program
- itself is interactive but does not normally print such an
- announcement, your work based on the Program is not required
- to print an announcement.)
-
- These requirements apply to the modified work as a whole. If
- identifiable sections of that work are not derived from the
- Program, and can be reasonably considered independent and separate
- works in themselves, then this License, and its terms, do not
- apply to those sections when you distribute them as separate
- works. But when you distribute the same sections as part of a
- whole which is a work based on the Program, the distribution of
- the whole must be on the terms of this License, whose permissions
- for other licensees extend to the entire whole, and thus to each
- and every part regardless of who wrote it.
-
- Thus, it is not the intent of this section to claim rights or
- contest your rights to work written entirely by you; rather, the
- intent is to exercise the right to control the distribution of
- derivative or collective works based on the Program.
-
- In addition, mere aggregation of another work not based on the
- Program with the Program (or with a work based on the Program) on
- a volume of a storage or distribution medium does not bring the
- other work under the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
- under Section 2) in object code or executable form under the terms
- of Sections 1 and 2 above provided that you also do one of the
- following:
-
- a. Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of
- Sections 1 and 2 above on a medium customarily used for
- software interchange; or,
-
- b. Accompany it with a written offer, valid for at least three
- years, to give any third-party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a
- medium customarily used for software interchange; or,
-
- c. Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with
- such an offer, in accord with Subsection b above.)
-
- The source code for a work means the preferred form of the work for
- making modifications to it. For an executable work, complete
- source code means all the source code for all modules it contains,
- plus any associated interface definition files, plus the scripts
- used to control compilation and installation of the executable.
- However, as a special exception, the source code distributed need
- not include anything that is normally distributed (in either
- source or binary form) with the major components (compiler,
- kernel, and so on) of the operating system on which the executable
- runs, unless that component itself accompanies the executable.
-
- If distribution of executable or object code is made by offering
- access to copy from a designated place, then offering equivalent
- access to copy the source code from the same place counts as
- distribution of the source code, even though third parties are not
- compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
- except as expressly provided under this License. Any attempt
- otherwise to copy, modify, sublicense or distribute the Program is
- void, and will automatically terminate your rights under this
- License. However, parties who have received copies, or rights,
- from you under this License will not have their licenses
- terminated so long as such parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
- signed it. However, nothing else grants you permission to modify
- or distribute the Program or its derivative works. These actions
- are prohibited by law if you do not accept this License.
- Therefore, by modifying or distributing the Program (or any work
- based on the Program), you indicate your acceptance of this
- License to do so, and all its terms and conditions for copying,
- distributing or modifying the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
- Program), the recipient automatically receives a license from the
- original licensor to copy, distribute or modify the Program
- subject to these terms and conditions. You may not impose any
- further restrictions on the recipients' exercise of the rights
- granted herein. You are not responsible for enforcing compliance
- by third parties to this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
- infringement or for any other reason (not limited to patent
- issues), conditions are imposed on you (whether by court order,
- agreement or otherwise) that contradict the conditions of this
- License, they do not excuse you from the conditions of this
- License. If you cannot distribute so as to satisfy simultaneously
- your obligations under this License and any other pertinent
- obligations, then as a consequence you may not distribute the
- Program at all. For example, if a patent license would not permit
- royalty-free redistribution of the Program by all those who
- receive copies directly or indirectly through you, then the only
- way you could satisfy both it and this License would be to refrain
- entirely from distribution of the Program.
-
- If any portion of this section is held invalid or unenforceable
- under any particular circumstance, the balance of the section is
- intended to apply and the section as a whole is intended to apply
- in other circumstances.
-
- It is not the purpose of this section to induce you to infringe any
- patents or other property right claims or to contest validity of
- any such claims; this section has the sole purpose of protecting
- the integrity of the free software distribution system, which is
- implemented by public license practices. Many people have made
- generous contributions to the wide range of software distributed
- through that system in reliance on consistent application of that
- system; it is up to the author/donor to decide if he or she is
- willing to distribute software through any other system and a
- licensee cannot impose that choice.
-
- This section is intended to make thoroughly clear what is believed
- to be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
- certain countries either by patents or by copyrighted interfaces,
- the original copyright holder who places the Program under this
- License may add an explicit geographical distribution limitation
- excluding those countries, so that distribution is permitted only
- in or among countries not thus excluded. In such case, this
- License incorporates the limitation as if written in the body of
- this License.
-
- 9. The Free Software Foundation may publish revised and/or new
- versions of the General Public License from time to time. Such
- new versions will be similar in spirit to the present version, but
- may differ in detail to address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
- Program specifies a version number of this License which applies
- to it and "any later version", you have the option of following
- the terms and conditions either of that version or of any later
- version published by the Free Software Foundation. If the Program
- does not specify a version number of this License, you may choose
- any version ever published by the Free Software Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
- programs whose distribution conditions are different, write to the
- author to ask for permission. For software which is copyrighted
- by the Free Software Foundation, write to the Free Software
- Foundation; we sometimes make exceptions for this. Our decision
- will be guided by the two goals of preserving the free status of
- all derivatives of our free software and of promoting the sharing
- and reuse of software generally.
-
- NO WARRANTY
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
- WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
- LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
- WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
- NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
- QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
- SERVICING, REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
- WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
- MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
- LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
- INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
- INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
- OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
- OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-How to Apply These Terms to Your New Programs
-=============================================
-
-If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these
-terms.
-
-To do so, attach the following notices to the program. It is safest to
-attach them to the start of each source file to most effectively convey
-the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
- Copyright (C) YYYY NAME OF AUTHOR
-
- 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; either version 2 of the License, or
- (at your option) any later version.
-
- 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.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the
-appropriate parts of the General Public License. Of course, the
-commands you use may be called something other than `show w' and `show
-c'; they could even be mouse-clicks or menu items--whatever suits your
-program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- SIGNATURE OF TY COON, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library,
-you may consider it more useful to permit linking proprietary
-applications with the library. If this is what you want to do, use the
-GNU Library General Public License instead of this License.
diff --git a/storage/innobase/COPYING.Sun_Microsystems b/storage/innobase/COPYING.Sun_Microsystems
deleted file mode 100644
index 5a77ef3ab73..00000000000
--- a/storage/innobase/COPYING.Sun_Microsystems
+++ /dev/null
@@ -1,31 +0,0 @@
-Portions of this software contain modifications contributed by
-Sun Microsystems, Inc. These contributions are used with the following
-license:
-
-Copyright (c) 2009, Sun Microsystems, Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
- * Neither the name of Sun Microsystems, Inc. nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/storage/innobase/Doxyfile b/storage/innobase/Doxyfile
index 62aa7dd8abc..7cf5048fa52 100644
--- a/storage/innobase/Doxyfile
+++ b/storage/innobase/Doxyfile
@@ -565,7 +565,7 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
-EXCLUDE = ut0auxconf_*
+EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am
deleted file mode 100644
index 674b3754e8c..00000000000
--- a/storage/innobase/Makefile.am
+++ /dev/null
@@ -1,339 +0,0 @@
-# Copyright (C) 2001, 2004, 2006 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
-
-# Process this file with automake to create Makefile.in
-
-MYSQLDATAdir= $(localstatedir)
-MYSQLSHAREdir= $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-pkgplugindir= $(pkglibdir)/plugin
-INCLUDES= -I$(top_srcdir)/include -I$(top_builddir)/include \
- -I$(top_srcdir)/regex \
- -I$(srcdir)/include \
- -I$(top_srcdir)/sql \
- -I$(srcdir) @ZLIB_INCLUDES@
-
-DEFS= @DEFS@
-
-noinst_HEADERS= \
- handler/ha_innodb.h \
- handler/i_s.h \
- 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/buf0buddy.h \
- include/buf0buddy.ic \
- 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/fsp0types.h \
- include/fut0fut.h \
- include/fut0fut.ic \
- include/fut0lst.h \
- include/fut0lst.ic \
- include/ha0ha.h \
- include/ha0ha.ic \
- include/ha0storage.h \
- include/ha0storage.ic \
- include/ha_prototypes.h \
- include/handler0alter.h \
- 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 \
- 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/mysql_addons.h \
- include/os0file.h \
- include/os0file.ic \
- 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/page0zip.h \
- include/page0zip.ic \
- 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/row0ext.h \
- include/row0ext.ic \
- include/row0ins.h \
- include/row0ins.ic \
- include/row0merge.h \
- 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/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/trx0i_s.h \
- 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/ut0auxconf.h \
- include/ut0byte.h \
- include/ut0byte.ic \
- include/ut0dbg.h \
- include/ut0list.h \
- include/ut0list.ic \
- include/ut0lst.h \
- include/ut0mem.h \
- include/ut0mem.ic \
- include/ut0rbt.h \
- include/ut0rnd.h \
- include/ut0rnd.ic \
- include/ut0sort.h \
- include/ut0ut.h \
- include/ut0ut.ic \
- include/ut0vec.h \
- include/ut0vec.ic \
- include/ut0wqueue.h \
- mem/mem0dbg.c
-
-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/buf0buddy.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/ha0storage.c \
- ha/hash0hash.c \
- handler/ha_innodb.cc \
- handler/handler0alter.cc \
- handler/i_s.cc \
- handler/mysql_addons.cc \
- 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 \
- page/page0zip.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/row0ext.c \
- row/row0ins.c \
- row/row0merge.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/srv0srv.c \
- srv/srv0start.c \
- sync/sync0arr.c \
- sync/sync0rw.c \
- sync/sync0sync.c \
- thr/thr0loc.c \
- trx/trx0i_s.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/ut0rbt.c \
- ut/ut0rnd.c \
- ut/ut0ut.c \
- ut/ut0vec.c \
- ut/ut0wqueue.c
-
-libinnobase_a_CXXFLAGS= $(AM_CXXFLAGS)
-libinnobase_a_CFLAGS= $(AM_CFLAGS)
-
-EXTRA_LTLIBRARIES= ha_innodb.la
-pkgplugin_LTLIBRARIES= @plugin_innobase_shared_target@
-
-ha_innodb_la_LDFLAGS= -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
-ha_innodb_la_CXXFLAGS= -shared $(AM_CXXFLAGS) $(INNODB_DYNAMIC_CFLAGS)
-ha_innodb_la_CFLAGS= -shared $(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
-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
diff --git a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c
index cf384378edf..fb2509a62ff 100644
--- a/storage/innobase/btr/btr0btr.c
+++ b/storage/innobase/btr/btr0btr.c
@@ -42,6 +42,560 @@ Created 6/2/1994 Heikki Tuuri
#include "ibuf0ibuf.h"
#include "trx0trx.h"
+#ifdef UNIV_BLOB_DEBUG
+# include "srv0srv.h"
+# include "ut0rbt.h"
+
+/** TRUE when messages about index->blobs modification are enabled. */
+static ibool btr_blob_dbg_msg;
+
+/** Issue a message about an operation on index->blobs.
+@param op operation
+@param b the entry being subjected to the operation
+@param ctx the context of the operation */
+#define btr_blob_dbg_msg_issue(op, b, ctx) \
+ fprintf(stderr, op " %u:%u:%u->%u %s(%u,%u,%u)\n", \
+ (b)->ref_page_no, (b)->ref_heap_no, \
+ (b)->ref_field_no, (b)->blob_page_no, ctx, \
+ (b)->owner, (b)->always_owner, (b)->del)
+
+/** Insert to index->blobs a reference to an off-page column.
+@param index the index tree
+@param b the reference
+@param ctx context (for logging) */
+UNIV_INTERN
+void
+btr_blob_dbg_rbt_insert(
+/*====================*/
+ dict_index_t* index, /*!< in/out: index tree */
+ const btr_blob_dbg_t* b, /*!< in: the reference */
+ const char* ctx) /*!< in: context (for logging) */
+{
+ if (btr_blob_dbg_msg) {
+ btr_blob_dbg_msg_issue("insert", b, ctx);
+ }
+ mutex_enter(&index->blobs_mutex);
+ rbt_insert(index->blobs, b, b);
+ mutex_exit(&index->blobs_mutex);
+}
+
+/** Remove from index->blobs a reference to an off-page column.
+@param index the index tree
+@param b the reference
+@param ctx context (for logging) */
+UNIV_INTERN
+void
+btr_blob_dbg_rbt_delete(
+/*====================*/
+ dict_index_t* index, /*!< in/out: index tree */
+ const btr_blob_dbg_t* b, /*!< in: the reference */
+ const char* ctx) /*!< in: context (for logging) */
+{
+ if (btr_blob_dbg_msg) {
+ btr_blob_dbg_msg_issue("delete", b, ctx);
+ }
+ mutex_enter(&index->blobs_mutex);
+ ut_a(rbt_delete(index->blobs, b));
+ mutex_exit(&index->blobs_mutex);
+}
+
+/**************************************************************//**
+Comparator for items (btr_blob_dbg_t) in index->blobs.
+The key in index->blobs is (ref_page_no, ref_heap_no, ref_field_no).
+@return negative, 0 or positive if *a<*b, *a=*b, *a>*b */
+static
+int
+btr_blob_dbg_cmp(
+/*=============*/
+ const void* a, /*!< in: first btr_blob_dbg_t to compare */
+ const void* b) /*!< in: second btr_blob_dbg_t to compare */
+{
+ const btr_blob_dbg_t* aa = a;
+ const btr_blob_dbg_t* bb = b;
+
+ ut_ad(aa != NULL);
+ ut_ad(bb != NULL);
+
+ if (aa->ref_page_no != bb->ref_page_no) {
+ return(aa->ref_page_no < bb->ref_page_no ? -1 : 1);
+ }
+ if (aa->ref_heap_no != bb->ref_heap_no) {
+ return(aa->ref_heap_no < bb->ref_heap_no ? -1 : 1);
+ }
+ if (aa->ref_field_no != bb->ref_field_no) {
+ return(aa->ref_field_no < bb->ref_field_no ? -1 : 1);
+ }
+ return(0);
+}
+
+/**************************************************************//**
+Add a reference to an off-page column to the index->blobs map. */
+UNIV_INTERN
+void
+btr_blob_dbg_add_blob(
+/*==================*/
+ const rec_t* rec, /*!< in: clustered index record */
+ ulint field_no, /*!< in: off-page column number */
+ ulint page_no, /*!< in: start page of the column */
+ dict_index_t* index, /*!< in/out: index tree */
+ const char* ctx) /*!< in: context (for logging) */
+{
+ btr_blob_dbg_t b;
+ const page_t* page = page_align(rec);
+
+ ut_a(index->blobs);
+
+ b.blob_page_no = page_no;
+ b.ref_page_no = page_get_page_no(page);
+ b.ref_heap_no = page_rec_get_heap_no(rec);
+ b.ref_field_no = field_no;
+ ut_a(b.ref_field_no >= index->n_uniq);
+ b.always_owner = b.owner = TRUE;
+ b.del = FALSE;
+ ut_a(!rec_get_deleted_flag(rec, page_is_comp(page)));
+ btr_blob_dbg_rbt_insert(index, &b, ctx);
+}
+
+/**************************************************************//**
+Add to index->blobs any references to off-page columns from a record.
+@return number of references added */
+UNIV_INTERN
+ulint
+btr_blob_dbg_add_rec(
+/*=================*/
+ const rec_t* rec, /*!< in: record */
+ dict_index_t* index, /*!< in/out: index */
+ const ulint* offsets,/*!< in: offsets */
+ const char* ctx) /*!< in: context (for logging) */
+{
+ ulint count = 0;
+ ulint i;
+ btr_blob_dbg_t b;
+ ibool del;
+
+ ut_ad(rec_offs_validate(rec, index, offsets));
+
+ if (!rec_offs_any_extern(offsets)) {
+ return(0);
+ }
+
+ b.ref_page_no = page_get_page_no(page_align(rec));
+ b.ref_heap_no = page_rec_get_heap_no(rec);
+ del = (rec_get_deleted_flag(rec, rec_offs_comp(offsets)) != 0);
+
+ for (i = 0; i < rec_offs_n_fields(offsets); i++) {
+ if (rec_offs_nth_extern(offsets, i)) {
+ ulint len;
+ const byte* field_ref = rec_get_nth_field(
+ rec, offsets, i, &len);
+
+ ut_a(len != UNIV_SQL_NULL);
+ ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
+ field_ref += len - BTR_EXTERN_FIELD_REF_SIZE;
+
+ if (!memcmp(field_ref, field_ref_zero,
+ BTR_EXTERN_FIELD_REF_SIZE)) {
+ /* the column has not been stored yet */
+ continue;
+ }
+
+ b.ref_field_no = i;
+ b.blob_page_no = mach_read_from_4(
+ field_ref + BTR_EXTERN_PAGE_NO);
+ ut_a(b.ref_field_no >= index->n_uniq);
+ b.always_owner = b.owner
+ = !(field_ref[BTR_EXTERN_LEN]
+ & BTR_EXTERN_OWNER_FLAG);
+ b.del = del;
+
+ btr_blob_dbg_rbt_insert(index, &b, ctx);
+ count++;
+ }
+ }
+
+ return(count);
+}
+
+/**************************************************************//**
+Display the references to off-page columns.
+This function is to be called from a debugger,
+for example when a breakpoint on ut_dbg_assertion_failed is hit. */
+UNIV_INTERN
+void
+btr_blob_dbg_print(
+/*===============*/
+ const dict_index_t* index) /*!< in: index tree */
+{
+ const ib_rbt_node_t* node;
+
+ if (!index->blobs) {
+ return;
+ }
+
+ /* We intentionally do not acquire index->blobs_mutex here.
+ This function is to be called from a debugger, and the caller
+ should make sure that the index->blobs_mutex is held. */
+
+ for (node = rbt_first(index->blobs);
+ node != NULL; node = rbt_next(index->blobs, node)) {
+ const btr_blob_dbg_t* b
+ = rbt_value(btr_blob_dbg_t, node);
+ fprintf(stderr, "%u:%u:%u->%u%s%s%s\n",
+ b->ref_page_no, b->ref_heap_no, b->ref_field_no,
+ b->blob_page_no,
+ b->owner ? "" : "(disowned)",
+ b->always_owner ? "" : "(has disowned)",
+ b->del ? "(deleted)" : "");
+ }
+}
+
+/**************************************************************//**
+Remove from index->blobs any references to off-page columns from a record.
+@return number of references removed */
+UNIV_INTERN
+ulint
+btr_blob_dbg_remove_rec(
+/*====================*/
+ const rec_t* rec, /*!< in: record */
+ dict_index_t* index, /*!< in/out: index */
+ const ulint* offsets,/*!< in: offsets */
+ const char* ctx) /*!< in: context (for logging) */
+{
+ ulint i;
+ ulint count = 0;
+ btr_blob_dbg_t b;
+
+ ut_ad(rec_offs_validate(rec, index, offsets));
+
+ if (!rec_offs_any_extern(offsets)) {
+ return(0);
+ }
+
+ b.ref_page_no = page_get_page_no(page_align(rec));
+ b.ref_heap_no = page_rec_get_heap_no(rec);
+
+ for (i = 0; i < rec_offs_n_fields(offsets); i++) {
+ if (rec_offs_nth_extern(offsets, i)) {
+ ulint len;
+ const byte* field_ref = rec_get_nth_field(
+ rec, offsets, i, &len);
+
+ ut_a(len != UNIV_SQL_NULL);
+ ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
+ field_ref += len - BTR_EXTERN_FIELD_REF_SIZE;
+
+ b.ref_field_no = i;
+ b.blob_page_no = mach_read_from_4(
+ field_ref + BTR_EXTERN_PAGE_NO);
+
+ switch (b.blob_page_no) {
+ case 0:
+ /* The column has not been stored yet.
+ The BLOB pointer must be all zero.
+ There cannot be a BLOB starting at
+ page 0, because page 0 is reserved for
+ the tablespace header. */
+ ut_a(!memcmp(field_ref, field_ref_zero,
+ BTR_EXTERN_FIELD_REF_SIZE));
+ /* fall through */
+ case FIL_NULL:
+ /* the column has been freed already */
+ continue;
+ }
+
+ btr_blob_dbg_rbt_delete(index, &b, ctx);
+ count++;
+ }
+ }
+
+ return(count);
+}
+
+/**************************************************************//**
+Check that there are no references to off-page columns from or to
+the given page. Invoked when freeing or clearing a page.
+@return TRUE when no orphan references exist */
+UNIV_INTERN
+ibool
+btr_blob_dbg_is_empty(
+/*==================*/
+ dict_index_t* index, /*!< in: index */
+ ulint page_no) /*!< in: page number */
+{
+ const ib_rbt_node_t* node;
+ ibool success = TRUE;
+
+ if (!index->blobs) {
+ return(success);
+ }
+
+ mutex_enter(&index->blobs_mutex);
+
+ for (node = rbt_first(index->blobs);
+ node != NULL; node = rbt_next(index->blobs, node)) {
+ const btr_blob_dbg_t* b
+ = rbt_value(btr_blob_dbg_t, node);
+
+ if (b->ref_page_no != page_no && b->blob_page_no != page_no) {
+ continue;
+ }
+
+ fprintf(stderr,
+ "InnoDB: orphan BLOB ref%s%s%s %u:%u:%u->%u\n",
+ b->owner ? "" : "(disowned)",
+ b->always_owner ? "" : "(has disowned)",
+ b->del ? "(deleted)" : "",
+ b->ref_page_no, b->ref_heap_no, b->ref_field_no,
+ b->blob_page_no);
+
+ if (b->blob_page_no != page_no || b->owner || !b->del) {
+ success = FALSE;
+ }
+ }
+
+ mutex_exit(&index->blobs_mutex);
+ return(success);
+}
+
+/**************************************************************//**
+Count and process all references to off-page columns on a page.
+@return number of references processed */
+UNIV_INTERN
+ulint
+btr_blob_dbg_op(
+/*============*/
+ const page_t* page, /*!< in: B-tree leaf page */
+ const rec_t* rec, /*!< in: record to start from
+ (NULL to process the whole page) */
+ dict_index_t* index, /*!< in/out: index */
+ const char* ctx, /*!< in: context (for logging) */
+ const btr_blob_dbg_op_f op) /*!< in: operation on records */
+{
+ ulint count = 0;
+ mem_heap_t* heap = NULL;
+ ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ ulint* offsets = offsets_;
+ rec_offs_init(offsets_);
+
+ ut_a(fil_page_get_type(page) == FIL_PAGE_INDEX);
+ ut_a(!rec || page_align(rec) == page);
+
+ if (!index->blobs || !page_is_leaf(page)
+ || !dict_index_is_clust(index)) {
+ return(0);
+ }
+
+ if (rec == NULL) {
+ rec = page_get_infimum_rec(page);
+ }
+
+ do {
+ offsets = rec_get_offsets(rec, index, offsets,
+ ULINT_UNDEFINED, &heap);
+ count += op(rec, index, offsets, ctx);
+ rec = page_rec_get_next_const(rec);
+ } while (!page_rec_is_supremum(rec));
+
+ if (UNIV_LIKELY_NULL(heap)) {
+ mem_heap_free(heap);
+ }
+
+ return(count);
+}
+
+/**************************************************************//**
+Count and add to index->blobs any references to off-page columns
+from records on a page.
+@return number of references added */
+UNIV_INTERN
+ulint
+btr_blob_dbg_add(
+/*=============*/
+ const page_t* page, /*!< in: rewritten page */
+ dict_index_t* index, /*!< in/out: index */
+ const char* ctx) /*!< in: context (for logging) */
+{
+ btr_blob_dbg_assert_empty(index, page_get_page_no(page));
+
+ return(btr_blob_dbg_op(page, NULL, index, ctx, btr_blob_dbg_add_rec));
+}
+
+/**************************************************************//**
+Count and remove from index->blobs any references to off-page columns
+from records on a page.
+Used when reorganizing a page, before copying the records.
+@return number of references removed */
+UNIV_INTERN
+ulint
+btr_blob_dbg_remove(
+/*================*/
+ const page_t* page, /*!< in: b-tree page */
+ dict_index_t* index, /*!< in/out: index */
+ const char* ctx) /*!< in: context (for logging) */
+{
+ ulint count;
+
+ count = btr_blob_dbg_op(page, NULL, index, ctx,
+ btr_blob_dbg_remove_rec);
+
+ /* Check that no references exist. */
+ btr_blob_dbg_assert_empty(index, page_get_page_no(page));
+
+ return(count);
+}
+
+/**************************************************************//**
+Restore in index->blobs any references to off-page columns
+Used when page reorganize fails due to compressed page overflow. */
+UNIV_INTERN
+void
+btr_blob_dbg_restore(
+/*=================*/
+ const page_t* npage, /*!< in: page that failed to compress */
+ const page_t* page, /*!< in: copy of original page */
+ dict_index_t* index, /*!< in/out: index */
+ const char* ctx) /*!< in: context (for logging) */
+{
+ ulint removed;
+ ulint added;
+
+ ut_a(page_get_page_no(npage) == page_get_page_no(page));
+ ut_a(page_get_space_id(npage) == page_get_space_id(page));
+
+ removed = btr_blob_dbg_remove(npage, index, ctx);
+ added = btr_blob_dbg_add(page, index, ctx);
+ ut_a(added == removed);
+}
+
+/**************************************************************//**
+Modify the 'deleted' flag of a record. */
+UNIV_INTERN
+void
+btr_blob_dbg_set_deleted_flag(
+/*==========================*/
+ const rec_t* rec, /*!< in: record */
+ dict_index_t* index, /*!< in/out: index */
+ const ulint* offsets,/*!< in: rec_get_offs(rec, index) */
+ ibool del) /*!< in: TRUE=deleted, FALSE=exists */
+{
+ const ib_rbt_node_t* node;
+ btr_blob_dbg_t b;
+ btr_blob_dbg_t* c;
+ ulint i;
+
+ ut_ad(rec_offs_validate(rec, index, offsets));
+ ut_a(dict_index_is_clust(index));
+ ut_a(del == !!del);/* must be FALSE==0 or TRUE==1 */
+
+ if (!rec_offs_any_extern(offsets) || !index->blobs) {
+
+ return;
+ }
+
+ b.ref_page_no = page_get_page_no(page_align(rec));
+ b.ref_heap_no = page_rec_get_heap_no(rec);
+
+ for (i = 0; i < rec_offs_n_fields(offsets); i++) {
+ if (rec_offs_nth_extern(offsets, i)) {
+ ulint len;
+ const byte* field_ref = rec_get_nth_field(
+ rec, offsets, i, &len);
+
+ ut_a(len != UNIV_SQL_NULL);
+ ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
+ field_ref += len - BTR_EXTERN_FIELD_REF_SIZE;
+
+ b.ref_field_no = i;
+ b.blob_page_no = mach_read_from_4(
+ field_ref + BTR_EXTERN_PAGE_NO);
+
+ switch (b.blob_page_no) {
+ case 0:
+ ut_a(memcmp(field_ref, field_ref_zero,
+ BTR_EXTERN_FIELD_REF_SIZE));
+ /* page number 0 is for the
+ page allocation bitmap */
+ case FIL_NULL:
+ /* the column has been freed already */
+ ut_error;
+ }
+
+ mutex_enter(&index->blobs_mutex);
+ node = rbt_lookup(index->blobs, &b);
+ ut_a(node);
+
+ c = rbt_value(btr_blob_dbg_t, node);
+ /* The flag should be modified. */
+ c->del = del;
+ if (btr_blob_dbg_msg) {
+ b = *c;
+ mutex_exit(&index->blobs_mutex);
+ btr_blob_dbg_msg_issue("del_mk", &b, "");
+ } else {
+ mutex_exit(&index->blobs_mutex);
+ }
+ }
+ }
+}
+
+/**************************************************************//**
+Change the ownership of an off-page column. */
+UNIV_INTERN
+void
+btr_blob_dbg_owner(
+/*===============*/
+ const rec_t* rec, /*!< in: record */
+ dict_index_t* index, /*!< in/out: index */
+ const ulint* offsets,/*!< in: rec_get_offs(rec, index) */
+ ulint i, /*!< in: ith field in rec */
+ ibool own) /*!< in: TRUE=owned, FALSE=disowned */
+{
+ const ib_rbt_node_t* node;
+ btr_blob_dbg_t b;
+ const byte* field_ref;
+ ulint len;
+
+ ut_ad(rec_offs_validate(rec, index, offsets));
+ ut_a(rec_offs_nth_extern(offsets, i));
+
+ field_ref = rec_get_nth_field(rec, offsets, i, &len);
+ ut_a(len != UNIV_SQL_NULL);
+ ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
+ field_ref += len - BTR_EXTERN_FIELD_REF_SIZE;
+
+ b.ref_page_no = page_get_page_no(page_align(rec));
+ b.ref_heap_no = page_rec_get_heap_no(rec);
+ b.ref_field_no = i;
+ b.owner = !(field_ref[BTR_EXTERN_LEN] & BTR_EXTERN_OWNER_FLAG);
+ b.blob_page_no = mach_read_from_4(field_ref + BTR_EXTERN_PAGE_NO);
+
+ ut_a(b.owner == own);
+
+ mutex_enter(&index->blobs_mutex);
+ node = rbt_lookup(index->blobs, &b);
+ /* row_ins_clust_index_entry_by_modify() invokes
+ btr_cur_unmark_extern_fields() also for the newly inserted
+ references, which are all zero bytes until the columns are stored.
+ The node lookup must fail if and only if that is the case. */
+ ut_a(!memcmp(field_ref, field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE)
+ == !node);
+
+ if (node) {
+ btr_blob_dbg_t* c = rbt_value(btr_blob_dbg_t, node);
+ /* Some code sets ownership from TRUE to TRUE.
+ We do not allow changing ownership from FALSE to FALSE. */
+ ut_a(own || c->owner);
+
+ c->owner = own;
+ if (!own) {
+ c->always_owner = FALSE;
+ }
+ }
+
+ mutex_exit(&index->blobs_mutex);
+}
+#endif /* UNIV_BLOB_DEBUG */
+
/*
Latching strategy of the InnoDB B-tree
--------------------------------------
@@ -296,6 +850,7 @@ btr_page_create(
page_t* page = buf_block_get_frame(block);
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
+ btr_blob_dbg_assert_empty(index, buf_block_get_page_no(block));
if (UNIV_LIKELY_NULL(page_zip)) {
page_create_zip(block, index, level, mtr);
@@ -489,6 +1044,7 @@ btr_page_free_low(
modify clock */
buf_block_modify_clock_inc(block);
+ btr_blob_dbg_assert_empty(index, buf_block_get_page_no(block));
if (dict_index_is_ibuf(index)) {
@@ -603,7 +1159,6 @@ btr_page_get_father_node_ptr_func(
ulint line, /*!< in: line where called */
mtr_t* mtr) /*!< in: mtr */
{
- page_t* page;
dtuple_t* tuple;
rec_t* user_rec;
rec_t* node_ptr;
@@ -621,7 +1176,6 @@ btr_page_get_father_node_ptr_func(
level = btr_page_get_level(btr_cur_get_page(cursor), mtr);
- page = btr_cur_get_page(cursor);
user_rec = btr_cur_get_rec(cursor);
ut_a(page_rec_is_user_rec(user_rec));
tuple = dict_index_build_node_ptr(index, user_rec, 0, heap, level);
@@ -666,7 +1220,7 @@ btr_page_get_father_node_ptr_func(
" to fix the\n"
"InnoDB: corruption. If the crash happens at "
"the database startup, see\n"
- "InnoDB: " REFMAN "forcing-recovery.html about\n"
+ "InnoDB: " REFMAN "forcing-innodb-recovery.html about\n"
"InnoDB: forcing recovery. "
"Then dump + drop + reimport.\n", stderr);
@@ -776,6 +1330,14 @@ btr_create(
block = buf_page_get(space, zip_size, page_no,
RW_X_LATCH, mtr);
} else {
+#ifdef UNIV_BLOB_DEBUG
+ if ((type & DICT_CLUSTERED) && !index->blobs) {
+ mutex_create(PFS_NOT_INSTRUMENTED,
+ &index->blobs_mutex, SYNC_ANY_LATCH);
+ index->blobs = rbt_create(sizeof(btr_blob_dbg_t),
+ btr_blob_dbg_cmp);
+ }
+#endif /* UNIV_BLOB_DEBUG */
block = fseg_create(space, 0,
PAGE_HEADER + PAGE_BTR_SEG_TOP, mtr);
}
@@ -983,7 +1545,7 @@ btr_page_reorganize_low(
log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE);
#ifndef UNIV_HOTBACKUP
- temp_block = buf_block_alloc(buf_pool, 0);
+ temp_block = buf_block_alloc(buf_pool);
#else /* !UNIV_HOTBACKUP */
ut_ad(block == back_block1);
temp_block = back_block2;
@@ -1000,6 +1562,7 @@ btr_page_reorganize_low(
block->check_index_page_at_flush = TRUE;
#endif /* !UNIV_HOTBACKUP */
+ btr_blob_dbg_remove(page, index, "btr_page_reorganize");
/* Recreate the page: note that global data on page (possible
segment headers, next page-field, etc.) is preserved intact */
@@ -1028,6 +1591,8 @@ btr_page_reorganize_low(
(!page_zip_compress(page_zip, page, index, NULL))) {
/* Restore the old page and exit. */
+ btr_blob_dbg_restore(page, temp_page, index,
+ "btr_page_reorganize_compress_fail");
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
/* Check that the bytes that we skip are identical. */
@@ -1161,6 +1726,7 @@ btr_page_empty(
#endif /* UNIV_ZIP_DEBUG */
btr_search_drop_page_hash_index(block);
+ btr_blob_dbg_remove(page, index, "btr_page_empty");
/* Recreate the page: note that global data on page (possible
segment headers, next page-field, etc.) is preserved intact */
@@ -2501,6 +3067,7 @@ btr_lift_page_up(
index);
}
+ btr_blob_dbg_remove(page, index, "btr_lift_page_up");
lock_update_copy_and_discard(father_block, block);
/* Go upward to root page, decrementing levels by one. */
@@ -2762,6 +3329,7 @@ err_exit:
lock_update_merge_right(merge_block, orig_succ, block);
}
+ btr_blob_dbg_remove(page, index, "btr_compress");
mem_heap_free(heap);
if (!dict_index_is_clust(index) && page_is_leaf(merge_page)) {
@@ -2992,6 +3560,8 @@ btr_discard_page(
block);
}
+ btr_blob_dbg_remove(page, index, "btr_discard_page");
+
/* Free the file page */
btr_page_free(index, block, mtr);
diff --git a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c
index 9585cbdb942..69dd1e428e1 100644
--- a/storage/innobase/btr/btr0cur.c
+++ b/storage/innobase/btr/btr0cur.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -111,6 +111,18 @@ can be released by page reorganize, then it is reorganized */
/*--------------------------------------*/
#define BTR_BLOB_HDR_SIZE 8 /*!< Size of a BLOB
part header, in bytes */
+
+/** Estimated table level stats from sampled value.
+@param value sampled stats
+@param index index being sampled
+@param sample number of sampled rows
+@param ext_size external stored data size
+@param not_empty table not empty
+@return estimated table wide stats from sampled value */
+#define BTR_TABLE_STATS_FROM_SAMPLE(value, index, sample, ext_size, not_empty)\
+ (((value) * (ib_int64_t) index->stat_n_leaf_pages \
+ + (sample) - 1 + (ext_size) + (not_empty)) / ((sample) + (ext_size)))
+
/* @} */
#endif /* !UNIV_HOTBACKUP */
@@ -185,7 +197,7 @@ static
ulint
btr_rec_get_externally_stored_len(
/*==============================*/
- rec_t* rec, /*!< in: record */
+ const rec_t* rec, /*!< in: record */
const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
#endif /* !UNIV_HOTBACKUP */
@@ -390,7 +402,7 @@ btr_cur_search_to_nth_level(
ut_ad(level == 0 || mode == PAGE_CUR_LE);
ut_ad(dict_index_check_search_tuple(index, tuple));
- ut_ad(!dict_index_is_ibuf(index) || ibuf_inside());
+ ut_ad(!dict_index_is_ibuf(index) || ibuf_inside(mtr));
ut_ad(dtuple_check_typed(tuple));
#ifdef UNIV_DEBUG
@@ -1071,7 +1083,7 @@ btr_cur_ins_lock_and_undo(
not zero, the parameters index and thr
should be specified */
btr_cur_t* cursor, /*!< in: cursor on page after which to insert */
- const dtuple_t* entry, /*!< in: entry to insert */
+ dtuple_t* entry, /*!< in/out: entry to insert */
que_thr_t* thr, /*!< in: query thread or NULL */
mtr_t* mtr, /*!< in/out: mini-transaction */
ibool* inherit)/*!< out: TRUE if the inserted new record maybe
@@ -1744,7 +1756,7 @@ func_exit:
See if there is enough place in the page modification log to log
an update-in-place.
@return TRUE if enough place */
-static
+UNIV_INTERN
ibool
btr_cur_update_alloc_zip(
/*=====================*/
@@ -1874,7 +1886,8 @@ btr_cur_update_in_place(
NOT call it if index is secondary */
if (!dict_index_is_clust(index)
- || row_upd_changes_ord_field_binary(NULL, index, update)) {
+ || row_upd_changes_ord_field_binary(index, update, thr,
+ NULL, NULL)) {
/* Remove possible hash index pointer to this record */
btr_search_update_hash_on_delete(cursor);
@@ -1976,6 +1989,9 @@ btr_cur_optimistic_update(
heap = mem_heap_create(1024);
offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED, &heap);
+#ifdef UNIV_BLOB_NULL_DEBUG
+ ut_a(!rec_offs_any_null_extern(rec, offsets));
+#endif /* UNIV_BLOB_NULL_DEBUG */
#ifdef UNIV_DEBUG
if (btr_cur_print_record_ops && thr) {
@@ -2416,8 +2432,8 @@ make_external:
record on its page? */
was_first = page_cur_is_before_first(page_cursor);
- /* The first parameter means that no lock checking and undo logging
- is made in the insert */
+ /* Lock checks and undo logging were already performed by
+ btr_cur_upd_lock_and_undo(). */
err = btr_cur_pessimistic_insert(BTR_NO_UNDO_LOG_FLAG
| BTR_NO_LOCKING_FLAG
@@ -2626,27 +2642,24 @@ ulint
btr_cur_del_mark_set_clust_rec(
/*===========================*/
ulint flags, /*!< in: undo logging and locking flags */
- btr_cur_t* cursor, /*!< in: cursor */
+ buf_block_t* block, /*!< in/out: buffer block of the record */
+ rec_t* rec, /*!< in/out: record */
+ dict_index_t* index, /*!< in: clustered index of the record */
+ const ulint* offsets,/*!< in: rec_get_offsets(rec) */
ibool val, /*!< in: value to set */
que_thr_t* thr, /*!< in: query thread */
mtr_t* mtr) /*!< in: mtr */
{
- dict_index_t* index;
- buf_block_t* block;
roll_ptr_t roll_ptr;
ulint err;
- rec_t* rec;
page_zip_des_t* page_zip;
trx_t* trx;
- mem_heap_t* heap = NULL;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets = offsets_;
- rec_offs_init(offsets_);
- rec = btr_cur_get_rec(cursor);
- index = cursor->index;
+ ut_ad(dict_index_is_clust(index));
+ ut_ad(rec_offs_validate(rec, index, offsets));
ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table));
- offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap);
+ ut_ad(buf_block_get_frame(block) == page_align(rec));
+ ut_ad(page_is_leaf(page_align(rec)));
#ifdef UNIV_DEBUG
if (btr_cur_print_record_ops && thr) {
@@ -2658,13 +2671,12 @@ btr_cur_del_mark_set_clust_rec(
ut_ad(dict_index_is_clust(index));
ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));
- err = lock_clust_rec_modify_check_and_lock(flags,
- btr_cur_get_block(cursor),
+ err = lock_clust_rec_modify_check_and_lock(flags, block,
rec, index, offsets, thr);
if (err != DB_SUCCESS) {
- goto func_exit;
+ return(err);
}
err = trx_undo_report_row_operation(flags, TRX_UNDO_MODIFY_OP, thr,
@@ -2672,17 +2684,16 @@ btr_cur_del_mark_set_clust_rec(
&roll_ptr);
if (err != DB_SUCCESS) {
- goto func_exit;
+ return(err);
}
- block = btr_cur_get_block(cursor);
-
if (block->is_hashed) {
rw_lock_x_lock(&btr_search_latch);
}
page_zip = buf_block_get_page_zip(block);
+ btr_blob_dbg_set_deleted_flag(rec, index, offsets, val);
btr_rec_set_deleted_flag(rec, page_zip, val);
trx = thr_get_trx(thr);
@@ -2699,10 +2710,6 @@ btr_cur_del_mark_set_clust_rec(
btr_cur_del_mark_set_clust_rec_log(flags, rec, index, val, trx,
roll_ptr, mtr);
-func_exit:
- if (UNIV_LIKELY_NULL(heap)) {
- mem_heap_free(heap);
- }
return(err);
}
@@ -3248,7 +3255,7 @@ btr_estimate_n_rows_in_range_on_level(
performance with this code which is just an estimation. If we read
this many pages before reaching slot2->page_no then we estimate the
average from the pages scanned so far */
- #define N_PAGES_READ_LIMIT 10
+# define N_PAGES_READ_LIMIT 10
page_no = slot1->page_no;
level = slot1->page_level;
@@ -3260,9 +3267,14 @@ btr_estimate_n_rows_in_range_on_level(
mtr_start(&mtr);
- /* fetch the page */
- block = buf_page_get(space, zip_size, page_no, RW_S_LATCH,
- &mtr);
+ /* Fetch the page. Because we are not holding the
+ index->lock, the tree may have changed and we may be
+ attempting to read a page that is no longer part of
+ the B-tree. We pass BUF_GET_POSSIBLY_FREED in order to
+ silence a debug assertion about this. */
+ block = buf_page_get_gen(space, zip_size, page_no, RW_S_LATCH,
+ NULL, BUF_GET_POSSIBLY_FREED,
+ __FILE__, __LINE__, &mtr);
page = buf_block_get_frame(block);
@@ -3277,9 +3289,17 @@ btr_estimate_n_rows_in_range_on_level(
|| btr_page_get_level_low(page) != level) {
/* The page got reused for something else */
+ mtr_commit(&mtr);
goto inexact;
}
+ /* It is possible but highly unlikely that the page was
+ originally written by an old version of InnoDB that did
+ not initialize FIL_PAGE_TYPE on other than B-tree pages.
+ For example, this could be an almost-empty BLOB page
+ that happens to contain the magic values in the fields
+ that we checked above. */
+
n_pages_read++;
if (page_no != slot1->page_no) {
@@ -3487,9 +3507,54 @@ btr_estimate_n_rows_in_range(
}
/*******************************************************************//**
+Record the number of non_null key values in a given index for
+each n-column prefix of the index where n < dict_index_get_n_unique(index).
+The estimates are eventually stored in the array:
+index->stat_n_non_null_key_vals. */
+static
+void
+btr_record_not_null_field_in_rec(
+/*=============================*/
+ rec_t* rec, /*!< in: physical record */
+ ulint n_unique, /*!< in: dict_index_get_n_unique(index),
+ number of columns uniquely determine
+ an index entry */
+ const ulint* offsets, /*!< in: rec_get_offsets(rec, index),
+ its size could be for all fields or
+ that of "n_unique" */
+ ib_int64_t* n_not_null) /*!< in/out: array to record number of
+ not null rows for n-column prefix */
+{
+ ulint i;
+
+ ut_ad(rec_offs_n_fields(offsets) >= n_unique);
+
+ if (n_not_null == NULL) {
+ return;
+ }
+
+ for (i = 0; i < n_unique; i++) {
+ ulint rec_len;
+ byte* field;
+
+ field = rec_get_nth_field(rec, offsets, i, &rec_len);
+
+ if (rec_len != UNIV_SQL_NULL) {
+ n_not_null[i]++;
+ } else {
+ /* Break if we hit the first NULL value */
+ break;
+ }
+ }
+}
+
+/*******************************************************************//**
Estimates the number of different key values in a given index, for
each n-column prefix of the index where n <= dict_index_get_n_unique(index).
-The estimates are stored in the array index->stat_n_diff_key_vals. */
+The estimates are stored in the array index->stat_n_diff_key_vals.
+If innodb_stats_method is "nulls_ignored", we also record the number of
+non-null values for each prefix and store the estimates in
+array index->stat_n_non_null_key_vals. */
UNIV_INTERN
void
btr_estimate_number_of_different_key_vals(
@@ -3503,6 +3568,8 @@ btr_estimate_number_of_different_key_vals(
ulint matched_fields;
ulint matched_bytes;
ib_int64_t* n_diff;
+ ib_int64_t* n_not_null;
+ ibool stats_null_not_equal;
ullint n_sample_pages; /* number of pages to sample */
ulint not_empty_flag = 0;
ulint total_external_size = 0;
@@ -3511,16 +3578,43 @@ btr_estimate_number_of_different_key_vals(
ullint add_on;
mtr_t mtr;
mem_heap_t* heap = NULL;
- ulint offsets_rec_[REC_OFFS_NORMAL_SIZE];
- ulint offsets_next_rec_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets_rec = offsets_rec_;
- ulint* offsets_next_rec= offsets_next_rec_;
- rec_offs_init(offsets_rec_);
- rec_offs_init(offsets_next_rec_);
+ ulint* offsets_rec = NULL;
+ ulint* offsets_next_rec = NULL;
n_cols = dict_index_get_n_unique(index);
- n_diff = mem_zalloc((n_cols + 1) * sizeof(ib_int64_t));
+ heap = mem_heap_create((sizeof *n_diff + sizeof *n_not_null)
+ * (n_cols + 1)
+ + dict_index_get_n_fields(index)
+ * (sizeof *offsets_rec
+ + sizeof *offsets_next_rec));
+
+ n_diff = mem_heap_zalloc(heap, (n_cols + 1) * sizeof(ib_int64_t));
+
+ n_not_null = NULL;
+
+ /* Check srv_innodb_stats_method setting, and decide whether we
+ need to record non-null value and also decide if NULL is
+ considered equal (by setting stats_null_not_equal value) */
+ switch (srv_innodb_stats_method) {
+ case SRV_STATS_NULLS_IGNORED:
+ n_not_null = mem_heap_zalloc(heap, (n_cols + 1)
+ * sizeof *n_not_null);
+ /* fall through */
+
+ case SRV_STATS_NULLS_UNEQUAL:
+ /* for both SRV_STATS_NULLS_IGNORED and SRV_STATS_NULLS_UNEQUAL
+ case, we will treat NULLs as unequal value */
+ stats_null_not_equal = TRUE;
+ break;
+
+ case SRV_STATS_NULLS_EQUAL:
+ stats_null_not_equal = FALSE;
+ break;
+
+ default:
+ ut_error;
+ }
/* It makes no sense to test more pages than are contained
in the index, thus we lower the number if it is too high */
@@ -3537,7 +3631,6 @@ btr_estimate_number_of_different_key_vals(
/* We sample some pages in the index to get an estimate */
for (i = 0; i < n_sample_pages; i++) {
- rec_t* supremum;
mtr_start(&mtr);
btr_cur_open_at_rnd_pos(index, BTR_SEARCH_LEAF, &cursor, &mtr);
@@ -3550,18 +3643,25 @@ btr_estimate_number_of_different_key_vals(
page = btr_cur_get_page(&cursor);
- supremum = page_get_supremum_rec(page);
rec = page_rec_get_next(page_get_infimum_rec(page));
- if (rec != supremum) {
+ if (!page_rec_is_supremum(rec)) {
not_empty_flag = 1;
offsets_rec = rec_get_offsets(rec, index, offsets_rec,
ULINT_UNDEFINED, &heap);
+
+ if (n_not_null) {
+ btr_record_not_null_field_in_rec(
+ rec, n_cols, offsets_rec, n_not_null);
+ }
}
- while (rec != supremum) {
+ while (!page_rec_is_supremum(rec)) {
rec_t* next_rec = page_rec_get_next(rec);
- if (next_rec == supremum) {
+ if (page_rec_is_supremum(next_rec)) {
+ total_external_size +=
+ btr_rec_get_externally_stored_len(
+ rec, offsets_rec);
break;
}
@@ -3569,11 +3669,13 @@ btr_estimate_number_of_different_key_vals(
matched_bytes = 0;
offsets_next_rec = rec_get_offsets(next_rec, index,
offsets_next_rec,
- n_cols, &heap);
+ ULINT_UNDEFINED,
+ &heap);
cmp_rec_rec_with_match(rec, next_rec,
offsets_rec, offsets_next_rec,
- index, &matched_fields,
+ index, stats_null_not_equal,
+ &matched_fields,
&matched_bytes);
for (j = matched_fields + 1; j <= n_cols; j++) {
@@ -3583,6 +3685,12 @@ btr_estimate_number_of_different_key_vals(
n_diff[j]++;
}
+ if (n_not_null) {
+ btr_record_not_null_field_in_rec(
+ next_rec, n_cols, offsets_next_rec,
+ n_not_null);
+ }
+
total_external_size
+= btr_rec_get_externally_stored_len(
rec, offsets_rec);
@@ -3617,10 +3725,6 @@ btr_estimate_number_of_different_key_vals(
}
}
- offsets_rec = rec_get_offsets(rec, index, offsets_rec,
- ULINT_UNDEFINED, &heap);
- total_external_size += btr_rec_get_externally_stored_len(
- rec, offsets_rec);
mtr_commit(&mtr);
}
@@ -3632,17 +3736,11 @@ btr_estimate_number_of_different_key_vals(
also the pages used for external storage of fields (those pages are
included in index->stat_n_leaf_pages) */
- dict_index_stat_mutex_enter(index);
-
for (j = 0; j <= n_cols; j++) {
index->stat_n_diff_key_vals[j]
- = ((n_diff[j]
- * (ib_int64_t)index->stat_n_leaf_pages
- + n_sample_pages - 1
- + total_external_size
- + not_empty_flag)
- / (n_sample_pages
- + total_external_size));
+ = BTR_TABLE_STATS_FROM_SAMPLE(
+ n_diff[j], index, n_sample_pages,
+ total_external_size, not_empty_flag);
/* If the tree is small, smaller than
10 * n_sample_pages + total_external_size, then
@@ -3661,47 +3759,81 @@ btr_estimate_number_of_different_key_vals(
}
index->stat_n_diff_key_vals[j] += add_on;
- }
-
- dict_index_stat_mutex_exit(index);
- mem_free(n_diff);
- if (UNIV_LIKELY_NULL(heap)) {
- mem_heap_free(heap);
+ /* Update the stat_n_non_null_key_vals[] with our
+ sampled result. stat_n_non_null_key_vals[] is created
+ and initialized to zero in dict_index_add_to_cache(),
+ along with stat_n_diff_key_vals[] array */
+ if (n_not_null != NULL && (j < n_cols)) {
+ index->stat_n_non_null_key_vals[j] =
+ BTR_TABLE_STATS_FROM_SAMPLE(
+ n_not_null[j], index, n_sample_pages,
+ total_external_size, not_empty_flag);
+ }
}
+
+ mem_heap_free(heap);
}
/*================== EXTERNAL STORAGE OF BIG FIELDS ===================*/
/***********************************************************//**
+Gets the offset of the pointer to the externally stored part of a field.
+@return offset of the pointer to the externally stored part */
+static
+ulint
+btr_rec_get_field_ref_offs(
+/*=======================*/
+ const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
+ ulint n) /*!< in: index of the external field */
+{
+ ulint field_ref_offs;
+ ulint local_len;
+
+ ut_a(rec_offs_nth_extern(offsets, n));
+ field_ref_offs = rec_get_nth_field_offs(offsets, n, &local_len);
+ ut_a(local_len != UNIV_SQL_NULL);
+ ut_a(local_len >= BTR_EXTERN_FIELD_REF_SIZE);
+
+ return(field_ref_offs + local_len - BTR_EXTERN_FIELD_REF_SIZE);
+}
+
+/** Gets a pointer to the externally stored part of a field.
+@param rec record
+@param offsets rec_get_offsets(rec)
+@param n index of the externally stored field
+@return pointer to the externally stored part */
+#define btr_rec_get_field_ref(rec, offsets, n) \
+ ((rec) + btr_rec_get_field_ref_offs(offsets, n))
+
+/***********************************************************//**
Gets the externally stored size of a record, in units of a database page.
@return externally stored part, in units of a database page */
static
ulint
btr_rec_get_externally_stored_len(
/*==============================*/
- rec_t* rec, /*!< in: record */
+ const rec_t* rec, /*!< in: record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
{
ulint n_fields;
- byte* data;
- ulint local_len;
- ulint extern_len;
ulint total_extern_len = 0;
ulint i;
ut_ad(!rec_offs_comp(offsets) || !rec_get_node_ptr_flag(rec));
+
+ if (!rec_offs_any_extern(offsets)) {
+ return(0);
+ }
+
n_fields = rec_offs_n_fields(offsets);
for (i = 0; i < n_fields; i++) {
if (rec_offs_nth_extern(offsets, i)) {
- data = rec_get_nth_field(rec, offsets, i, &local_len);
-
- local_len -= BTR_EXTERN_FIELD_REF_SIZE;
-
- extern_len = mach_read_from_4(data + local_len
- + BTR_EXTERN_LEN + 4);
+ ulint extern_len = mach_read_from_4(
+ btr_rec_get_field_ref(rec, offsets, i)
+ + BTR_EXTERN_LEN + 4);
total_extern_len += ut_calc_align(extern_len,
UNIV_PAGE_SIZE);
@@ -3731,7 +3863,7 @@ btr_cur_set_ownership_of_extern_field(
ulint byte_val;
data = rec_get_nth_field(rec, offsets, i, &local_len);
-
+ ut_ad(rec_offs_nth_extern(offsets, i));
ut_a(local_len >= BTR_EXTERN_FIELD_REF_SIZE);
local_len -= BTR_EXTERN_FIELD_REF_SIZE;
@@ -3741,6 +3873,9 @@ btr_cur_set_ownership_of_extern_field(
if (val) {
byte_val = byte_val & (~BTR_EXTERN_OWNER_FLAG);
} else {
+#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+ ut_a(!(byte_val & BTR_EXTERN_OWNER_FLAG));
+#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
byte_val = byte_val | BTR_EXTERN_OWNER_FLAG;
}
@@ -3754,110 +3889,40 @@ btr_cur_set_ownership_of_extern_field(
} else {
mach_write_to_1(data + local_len + BTR_EXTERN_LEN, byte_val);
}
+
+ btr_blob_dbg_owner(rec, index, offsets, i, val);
}
/*******************************************************************//**
-Marks not updated extern fields as not-owned by this record. The ownership
-is transferred to the updated record which is inserted elsewhere in the
+Marks non-updated off-page fields as disowned by this record. The ownership
+must be transferred to the updated record which is inserted elsewhere in the
index tree. In purge only the owner of externally stored field is allowed
-to free the field.
-@return TRUE if BLOB ownership was transferred */
+to free the field. */
UNIV_INTERN
-ibool
-btr_cur_mark_extern_inherited_fields(
-/*=================================*/
+void
+btr_cur_disown_inherited_fields(
+/*============================*/
page_zip_des_t* page_zip,/*!< in/out: compressed page whose uncompressed
part will be updated, or NULL */
rec_t* rec, /*!< in/out: record in a clustered index */
dict_index_t* index, /*!< in: index of the page */
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
const upd_t* update, /*!< in: update vector */
- mtr_t* mtr) /*!< in: mtr, or NULL if not logged */
+ mtr_t* mtr) /*!< in/out: mini-transaction */
{
- ulint n;
- ulint j;
ulint i;
- ibool change_ownership = FALSE;
- ut_ad(rec_offs_validate(rec, NULL, offsets));
+ ut_ad(rec_offs_validate(rec, index, offsets));
ut_ad(!rec_offs_comp(offsets) || !rec_get_node_ptr_flag(rec));
+ ut_ad(rec_offs_any_extern(offsets));
+ ut_ad(mtr);
- if (!rec_offs_any_extern(offsets)) {
-
- return(FALSE);
- }
-
- n = rec_offs_n_fields(offsets);
-
- for (i = 0; i < n; i++) {
- if (rec_offs_nth_extern(offsets, i)) {
-
- /* Check it is not in updated fields */
-
- if (update) {
- for (j = 0; j < upd_get_n_fields(update);
- j++) {
- if (upd_get_nth_field(update, j)
- ->field_no == i) {
-
- goto updated;
- }
- }
- }
-
+ for (i = 0; i < rec_offs_n_fields(offsets); i++) {
+ if (rec_offs_nth_extern(offsets, i)
+ && !upd_get_field_by_field_no(update, i)) {
btr_cur_set_ownership_of_extern_field(
page_zip, rec, index, offsets, i, FALSE, mtr);
-
- change_ownership = TRUE;
-updated:
- ;
- }
- }
-
- return(change_ownership);
-}
-
-/*******************************************************************//**
-The complement of the previous function: in an update entry may inherit
-some externally stored fields from a record. We must mark them as inherited
-in entry, so that they are not freed in a rollback. */
-UNIV_INTERN
-void
-btr_cur_mark_dtuple_inherited_extern(
-/*=================================*/
- dtuple_t* entry, /*!< in/out: updated entry to be
- inserted to clustered index */
- const upd_t* update) /*!< in: update vector */
-{
- ulint i;
-
- for (i = 0; i < dtuple_get_n_fields(entry); i++) {
-
- dfield_t* dfield = dtuple_get_nth_field(entry, i);
- byte* data;
- ulint len;
- ulint j;
-
- if (!dfield_is_ext(dfield)) {
- continue;
}
-
- /* Check if it is in updated fields */
-
- for (j = 0; j < upd_get_n_fields(update); j++) {
- if (upd_get_nth_field(update, j)->field_no == i) {
-
- goto is_updated;
- }
- }
-
- data = dfield_get_data(dfield);
- len = dfield_get_len(dfield);
- data[len - BTR_EXTERN_FIELD_REF_SIZE + BTR_EXTERN_LEN]
- |= BTR_EXTERN_INHERITED_FLAG;
-
-is_updated:
- ;
}
}
@@ -3897,29 +3962,6 @@ btr_cur_unmark_extern_fields(
}
/*******************************************************************//**
-Marks all extern fields in a dtuple as owned by the record. */
-UNIV_INTERN
-void
-btr_cur_unmark_dtuple_extern_fields(
-/*================================*/
- dtuple_t* entry) /*!< in/out: clustered index entry */
-{
- ulint i;
-
- for (i = 0; i < dtuple_get_n_fields(entry); i++) {
- dfield_t* dfield = dtuple_get_nth_field(entry, i);
-
- if (dfield_is_ext(dfield)) {
- byte* data = dfield_get_data(dfield);
- ulint len = dfield_get_len(dfield);
-
- data[len - BTR_EXTERN_FIELD_REF_SIZE + BTR_EXTERN_LEN]
- &= ~BTR_EXTERN_OWNER_FLAG;
- }
- }
-}
-
-/*******************************************************************//**
Flags the data tuple fields that are marked as extern storage in the
update vector. We use this function to remember which fields we must
mark as extern storage in a record inserted for an update.
@@ -4053,13 +4095,12 @@ btr_blob_free(
&& buf_block_get_space(block) == space
&& buf_block_get_page_no(block) == page_no) {
- if (buf_LRU_free_block(&block->page, all, NULL)
- != BUF_LRU_FREED
+ if (buf_LRU_free_block(&block->page, all) != BUF_LRU_FREED
&& all && block->page.zip.data) {
/* Attempt to deallocate the uncompressed page
if the whole block cannot be deallocted. */
- buf_LRU_free_block(&block->page, FALSE, NULL);
+ buf_LRU_free_block(&block->page, FALSE);
}
}
@@ -4072,11 +4113,11 @@ Stores the fields in big_rec_vec to the tablespace and puts pointers to
them in rec. The extern flags in rec will have to be set beforehand.
The fields are stored on pages allocated from leaf node
file segment of the index tree.
-@return DB_SUCCESS or error */
+@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
UNIV_INTERN
ulint
-btr_store_big_rec_extern_fields(
-/*============================*/
+btr_store_big_rec_extern_fields_func(
+/*=================================*/
dict_index_t* index, /*!< in: index of rec; the index tree
MUST be X-latched */
buf_block_t* rec_block, /*!< in/out: block containing rec */
@@ -4085,11 +4126,17 @@ btr_store_big_rec_extern_fields(
the "external storage" flags in offsets
will not correspond to rec when
this function returns */
- big_rec_t* big_rec_vec, /*!< in: vector containing fields
+#ifdef UNIV_DEBUG
+ mtr_t* local_mtr, /*!< in: mtr containing the
+ latch to rec and to the tree */
+#endif /* UNIV_DEBUG */
+#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+ ibool update_in_place,/*! in: TRUE if the record is updated
+ in place (not delete+insert) */
+#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+ const big_rec_t*big_rec_vec) /*!< in: vector containing fields
to be stored externally */
- mtr_t* local_mtr __attribute__((unused))) /*!< in: mtr
- containing the latch to rec and to the
- tree */
+
{
ulint rec_page_no;
byte* field_ref;
@@ -4107,6 +4154,7 @@ btr_store_big_rec_extern_fields(
z_stream c_stream;
ut_ad(rec_offs_validate(rec, index, offsets));
+ ut_ad(rec_offs_any_extern(offsets));
ut_ad(mtr_memo_contains(local_mtr, dict_index_get_lock(index),
MTR_MEMO_X_LOCK));
ut_ad(mtr_memo_contains(local_mtr, rec_block, MTR_MEMO_PAGE_X_FIX));
@@ -4138,21 +4186,37 @@ btr_store_big_rec_extern_fields(
ut_a(err == Z_OK);
}
+#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+ /* All pointers to externally stored columns in the record
+ must either be zero or they must be pointers to inherited
+ columns, owned by this record or an earlier record version. */
+ for (i = 0; i < rec_offs_n_fields(offsets); i++) {
+ if (!rec_offs_nth_extern(offsets, i)) {
+ continue;
+ }
+ field_ref = btr_rec_get_field_ref(rec, offsets, i);
+
+ ut_a(!(field_ref[BTR_EXTERN_LEN] & BTR_EXTERN_OWNER_FLAG));
+ /* Either this must be an update in place,
+ or the BLOB must be inherited, or the BLOB pointer
+ must be zero (will be written in this function). */
+ ut_a(update_in_place
+ || (field_ref[BTR_EXTERN_LEN] & BTR_EXTERN_INHERITED_FLAG)
+ || !memcmp(field_ref, field_ref_zero,
+ BTR_EXTERN_FIELD_REF_SIZE));
+ }
+#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
/* We have to create a file segment to the tablespace
for each field and put the pointer to the field in rec */
for (i = 0; i < big_rec_vec->n_fields; i++) {
- ut_ad(rec_offs_nth_extern(offsets,
- big_rec_vec->fields[i].field_no));
- {
- ulint local_len;
- field_ref = rec_get_nth_field(
- rec, offsets, big_rec_vec->fields[i].field_no,
- &local_len);
- ut_a(local_len >= BTR_EXTERN_FIELD_REF_SIZE);
- local_len -= BTR_EXTERN_FIELD_REF_SIZE;
- field_ref += local_len;
- }
+ field_ref = btr_rec_get_field_ref(
+ rec, offsets, big_rec_vec->fields[i].field_no);
+#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+ /* A zero BLOB pointer should have been initially inserted. */
+ ut_a(!memcmp(field_ref, field_ref_zero,
+ BTR_EXTERN_FIELD_REF_SIZE));
+#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
extern_len = big_rec_vec->fields[i].len;
UNIV_MEM_ASSERT_RW(big_rec_vec->fields[i].data,
extern_len);
@@ -4327,6 +4391,11 @@ btr_store_big_rec_extern_fields(
}
if (prev_page_no == FIL_NULL) {
+ btr_blob_dbg_add_blob(
+ rec, big_rec_vec->fields[i]
+ .field_no, page_no, index,
+ "store");
+
mach_write_to_4(field_ref
+ BTR_EXTERN_SPACE_ID,
space_id);
@@ -4402,6 +4471,11 @@ next_zip_page:
MLOG_4BYTES, &mtr);
if (prev_page_no == FIL_NULL) {
+ btr_blob_dbg_add_blob(
+ rec, big_rec_vec->fields[i]
+ .field_no, page_no, index,
+ "store");
+
mlog_write_ulint(field_ref
+ BTR_EXTERN_SPACE_ID,
space_id,
@@ -4434,6 +4508,23 @@ next_zip_page:
mem_heap_free(heap);
}
+#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+ /* All pointers to externally stored columns in the record
+ must be valid. */
+ for (i = 0; i < rec_offs_n_fields(offsets); i++) {
+ if (!rec_offs_nth_extern(offsets, i)) {
+ continue;
+ }
+
+ field_ref = btr_rec_get_field_ref(rec, offsets, i);
+
+ /* The pointer must not be zero. */
+ ut_a(0 != memcmp(field_ref, field_ref_zero,
+ BTR_EXTERN_FIELD_REF_SIZE));
+ /* The column must not be disowned by this record. */
+ ut_a(!(field_ref[BTR_EXTERN_LEN] & BTR_EXTERN_OWNER_FLAG));
+ }
+#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
return(DB_SUCCESS);
}
@@ -4456,6 +4547,7 @@ btr_check_blob_fil_page_type(
if (UNIV_UNLIKELY(type != FIL_PAGE_TYPE_BLOB)) {
ulint flags = fil_space_get_flags(space_id);
+#ifndef UNIV_DEBUG /* Improve debug test coverage */
if (UNIV_LIKELY
((flags & DICT_TF_FORMAT_MASK) == DICT_TF_FORMAT_51)) {
/* Old versions of InnoDB did not initialize
@@ -4464,6 +4556,7 @@ btr_check_blob_fil_page_type(
a BLOB page that is in Antelope format.*/
return;
}
+#endif /* !UNIV_DEBUG */
ut_print_timestamp(stderr);
fprintf(stderr,
@@ -4513,23 +4606,13 @@ btr_free_externally_stored_field(
ulint page_no;
ulint next_page_no;
mtr_t mtr;
-#ifdef UNIV_DEBUG
+
ut_ad(mtr_memo_contains(local_mtr, dict_index_get_lock(index),
MTR_MEMO_X_LOCK));
ut_ad(mtr_memo_contains_page(local_mtr, field_ref,
MTR_MEMO_PAGE_X_FIX));
ut_ad(!rec || rec_offs_validate(rec, index, offsets));
-
- if (rec) {
- ulint local_len;
- const byte* f = rec_get_nth_field(rec, offsets,
- i, &local_len);
- ut_a(local_len >= BTR_EXTERN_FIELD_REF_SIZE);
- local_len -= BTR_EXTERN_FIELD_REF_SIZE;
- f += local_len;
- ut_ad(f == field_ref);
- }
-#endif /* UNIV_DEBUG */
+ ut_ad(!rec || field_ref == btr_rec_get_field_ref(rec, offsets, i));
if (UNIV_UNLIKELY(!memcmp(field_ref, field_ref_zero,
BTR_EXTERN_FIELD_REF_SIZE))) {
@@ -4561,6 +4644,37 @@ btr_free_externally_stored_field(
rec_zip_size = 0;
}
+#ifdef UNIV_BLOB_DEBUG
+ if (!(field_ref[BTR_EXTERN_LEN] & BTR_EXTERN_OWNER_FLAG)
+ && !((field_ref[BTR_EXTERN_LEN] & BTR_EXTERN_INHERITED_FLAG)
+ && (rb_ctx == RB_NORMAL || rb_ctx == RB_RECOVERY))) {
+ /* This off-page column will be freed.
+ Check that no references remain. */
+
+ btr_blob_dbg_t b;
+
+ b.blob_page_no = mach_read_from_4(
+ field_ref + BTR_EXTERN_PAGE_NO);
+
+ if (rec) {
+ /* Remove the reference from the record to the
+ BLOB. If the BLOB were not freed, the
+ reference would be removed when the record is
+ removed. Freeing the BLOB will overwrite the
+ BTR_EXTERN_PAGE_NO in the field_ref of the
+ record with FIL_NULL, which would make the
+ btr_blob_dbg information inconsistent with the
+ record. */
+ b.ref_page_no = page_get_page_no(page_align(rec));
+ b.ref_heap_no = page_rec_get_heap_no(rec);
+ b.ref_field_no = i;
+ btr_blob_dbg_rbt_delete(index, &b, "free");
+ }
+
+ btr_blob_dbg_assert_empty(index, b.blob_page_no);
+ }
+#endif /* UNIV_BLOB_DEBUG */
+
for (;;) {
#ifdef UNIV_SYNC_DEBUG
buf_block_t* rec_block;
@@ -4572,12 +4686,10 @@ btr_free_externally_stored_field(
#ifdef UNIV_SYNC_DEBUG
rec_block =
#endif /* UNIV_SYNC_DEBUG */
- buf_page_get(page_get_space_id(
- page_align(field_ref)),
- rec_zip_size,
- page_get_page_no(
- page_align(field_ref)),
- RW_X_LATCH, &mtr);
+ buf_page_get(page_get_space_id(page_align(field_ref)),
+ rec_zip_size,
+ page_get_page_no(page_align(field_ref)),
+ RW_X_LATCH, &mtr);
buf_block_dbg_add_level(rec_block, SYNC_NO_ORDER_CHECK);
page_no = mach_read_from_4(field_ref + BTR_EXTERN_PAGE_NO);
@@ -4694,13 +4806,8 @@ btr_rec_free_externally_stored_fields(
for (i = 0; i < n_fields; i++) {
if (rec_offs_nth_extern(offsets, i)) {
- ulint len;
- byte* data
- = rec_get_nth_field(rec, offsets, i, &len);
- ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
-
btr_free_externally_stored_field(
- index, data + len - BTR_EXTERN_FIELD_REF_SIZE,
+ index, btr_rec_get_field_ref(rec, offsets, i),
rec, offsets, page_zip, i, rb_ctx, mtr);
}
}
@@ -4812,27 +4919,45 @@ btr_copy_blob_prefix(
/*******************************************************************//**
Copies the prefix of a compressed BLOB. The clustered index record
-that points to this BLOB must be protected by a lock or a page latch. */
+that points to this BLOB must be protected by a lock or a page latch.
+@return number of bytes written to buf */
static
-void
+ulint
btr_copy_zblob_prefix(
/*==================*/
- z_stream* d_stream,/*!< in/out: the decompressing stream */
+ byte* buf, /*!< out: the externally stored part of
+ the field, or a prefix of it */
+ ulint len, /*!< in: length of buf, in bytes */
ulint zip_size,/*!< in: compressed BLOB page size */
ulint space_id,/*!< in: space id of the BLOB pages */
ulint page_no,/*!< in: page number of the first BLOB page */
ulint offset) /*!< in: offset on the first BLOB page */
{
- ulint page_type = FIL_PAGE_TYPE_ZBLOB;
+ ulint page_type = FIL_PAGE_TYPE_ZBLOB;
+ mem_heap_t* heap;
+ int err;
+ z_stream d_stream;
+
+ d_stream.next_out = buf;
+ d_stream.avail_out = len;
+ d_stream.next_in = Z_NULL;
+ d_stream.avail_in = 0;
+
+ /* Zlib inflate needs 32 kilobytes for the default
+ window size, plus a few kilobytes for small objects. */
+ heap = mem_heap_create(40000);
+ page_zip_set_alloc(&d_stream, heap);
ut_ad(ut_is_2pow(zip_size));
ut_ad(zip_size >= PAGE_ZIP_MIN_SIZE);
ut_ad(zip_size <= UNIV_PAGE_SIZE);
ut_ad(space_id);
+ err = inflateInit(&d_stream);
+ ut_a(err == Z_OK);
+
for (;;) {
buf_page_t* bpage;
- int err;
ulint next_page_no;
/* There is no latch on bpage directly. Instead,
@@ -4848,7 +4973,7 @@ btr_copy_zblob_prefix(
" compressed BLOB"
" page %lu space %lu\n",
(ulong) page_no, (ulong) space_id);
- return;
+ goto func_exit;
}
if (UNIV_UNLIKELY
@@ -4874,13 +4999,13 @@ btr_copy_zblob_prefix(
offset += 4;
}
- d_stream->next_in = bpage->zip.data + offset;
- d_stream->avail_in = zip_size - offset;
+ d_stream.next_in = bpage->zip.data + offset;
+ d_stream.avail_in = zip_size - offset;
- err = inflate(d_stream, Z_NO_FLUSH);
+ err = inflate(&d_stream, Z_NO_FLUSH);
switch (err) {
case Z_OK:
- if (!d_stream->avail_out) {
+ if (!d_stream.avail_out) {
goto end_of_blob;
}
break;
@@ -4897,13 +5022,13 @@ inflate_error:
" compressed BLOB"
" page %lu space %lu returned %d (%s)\n",
(ulong) page_no, (ulong) space_id,
- err, d_stream->msg);
+ err, d_stream.msg);
case Z_BUF_ERROR:
goto end_of_blob;
}
if (next_page_no == FIL_NULL) {
- if (!d_stream->avail_in) {
+ if (!d_stream.avail_in) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: unexpected end of"
@@ -4912,7 +5037,7 @@ inflate_error:
(ulong) page_no,
(ulong) space_id);
} else {
- err = inflate(d_stream, Z_FINISH);
+ err = inflate(&d_stream, Z_FINISH);
switch (err) {
case Z_STREAM_END:
case Z_BUF_ERROR:
@@ -4924,7 +5049,7 @@ inflate_error:
end_of_blob:
buf_page_release_zip(bpage);
- return;
+ goto func_exit;
}
buf_page_release_zip(bpage);
@@ -4936,6 +5061,12 @@ end_of_blob:
offset = FIL_PAGE_NEXT;
page_type = FIL_PAGE_TYPE_ZBLOB2;
}
+
+func_exit:
+ inflateEnd(&d_stream);
+ mem_heap_free(heap);
+ UNIV_MEM_ASSERT_RW(buf, d_stream.total_out);
+ return(d_stream.total_out);
}
/*******************************************************************//**
@@ -4961,28 +5092,8 @@ btr_copy_externally_stored_field_prefix_low(
}
if (UNIV_UNLIKELY(zip_size)) {
- int err;
- z_stream d_stream;
- mem_heap_t* heap;
-
- /* Zlib inflate needs 32 kilobytes for the default
- window size, plus a few kilobytes for small objects. */
- heap = mem_heap_create(40000);
- page_zip_set_alloc(&d_stream, heap);
-
- err = inflateInit(&d_stream);
- ut_a(err == Z_OK);
-
- d_stream.next_out = buf;
- d_stream.avail_out = len;
- d_stream.avail_in = 0;
-
- btr_copy_zblob_prefix(&d_stream, zip_size,
- space_id, page_no, offset);
- inflateEnd(&d_stream);
- mem_heap_free(heap);
- UNIV_MEM_ASSERT_RW(buf, d_stream.total_out);
- return(d_stream.total_out);
+ return(btr_copy_zblob_prefix(buf, len, zip_size,
+ space_id, page_no, offset));
} else {
return(btr_copy_blob_prefix(buf, len, space_id,
page_no, offset));
diff --git a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
index 8f5f9b839b5..93573a300e4 100644
--- a/storage/innobase/btr/btr0sea.c
+++ b/storage/innobase/btr/btr0sea.c
@@ -151,7 +151,7 @@ btr_search_check_free_space_in_heap(void)
be enough free space in the hash table. */
if (heap->free_block == NULL) {
- buf_block_t* block = buf_block_alloc(NULL, 0);
+ buf_block_t* block = buf_block_alloc(NULL);
rw_lock_x_lock(&btr_search_latch);
@@ -1213,8 +1213,8 @@ btr_search_drop_page_hash_when_freed(
having to fear a deadlock. */
block = buf_page_get_gen(space, zip_size, page_no, RW_S_LATCH, NULL,
- BUF_GET_IF_IN_POOL, __FILE__, __LINE__,
- &mtr);
+ BUF_PEEK_IF_IN_POOL, __FILE__, __LINE__,
+ &mtr);
/* Because the buffer pool mutex was released by
buf_page_peek_if_search_hashed(), it is possible that the
block was removed from the buffer pool by another thread
diff --git a/storage/innobase/buf/buf0buddy.c b/storage/innobase/buf/buf0buddy.c
index 5dc0780cbdd..75ba832c7e5 100644
--- a/storage/innobase/buf/buf0buddy.c
+++ b/storage/innobase/buf/buf0buddy.c
@@ -281,7 +281,7 @@ buf_buddy_alloc_from(
/**********************************************************************//**
Allocate a block. The thread calling this function must hold
-buf_pool->mutex and must not hold buf_pool_zip_mutex or any block->mutex.
+buf_pool->mutex and must not hold buf_pool->zip_mutex or any block->mutex.
The buf_pool->mutex may only be released and reacquired if lru != NULL.
@return allocated block, possibly NULL if lru==NULL */
UNIV_INTERN
@@ -327,7 +327,7 @@ buf_buddy_alloc_low(
/* Try replacing an uncompressed page in the buffer pool. */
buf_pool_mutex_exit(buf_pool);
- block = buf_LRU_get_free_block(buf_pool, 0);
+ block = buf_LRU_get_free_block(buf_pool);
*lru = TRUE;
buf_pool_mutex_enter(buf_pool);
diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
index ab3c1abf490..52358c52853 100644
--- a/storage/innobase/buf/buf0buf.c
+++ b/storage/innobase/buf/buf0buf.c
@@ -172,7 +172,7 @@ The chain of modified blocks (buf_pool->flush_list) contains the blocks
holding file pages that have been modified in the memory
but not written to disk yet. The block with the oldest modification
which has not yet been written to disk is at the end of the chain.
-The access to this list is protected by flush_list_mutex.
+The access to this list is protected by buf_pool->flush_list_mutex.
The chain of unmodified compressed blocks (buf_pool->zip_clean)
contains the control blocks (buf_page_t) of those compressed pages
@@ -246,8 +246,8 @@ static const int WAIT_FOR_READ = 5000;
/** Number of attemtps made to read in a page in the buffer pool */
static const ulint BUF_PAGE_READ_MAX_RETRIES = 100;
-/** The buffer buf_pool of the database */
-UNIV_INTERN buf_pool_t* buf_pool_ptr[MAX_BUFFER_POOLS];
+/** The buffer pools of the database */
+UNIV_INTERN buf_pool_t* buf_pool_ptr;
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
static ulint buf_dbg_counter = 0; /*!< This is used to insert validation
@@ -416,9 +416,9 @@ UNIV_INTERN
buf_block_t*
buf_block_alloc(
/*============*/
- buf_pool_t* buf_pool, /*!< in: buffer pool instance */
- ulint zip_size) /*!< in: compressed page size in bytes,
- or 0 if uncompressed tablespace */
+ buf_pool_t* buf_pool) /*!< in/out: buffer pool instance,
+ or NULL for round-robin selection
+ of the buffer pool */
{
buf_block_t* block;
ulint index;
@@ -431,7 +431,7 @@ buf_block_alloc(
buf_pool = buf_pool_from_array(index);
}
- block = buf_LRU_get_free_block(buf_pool, zip_size);
+ block = buf_LRU_get_free_block(buf_pool);
buf_block_set_state(block, BUF_BLOCK_MEMORY);
@@ -536,7 +536,7 @@ buf_page_is_corrupted(
"you may have copied the InnoDB\n"
"InnoDB: tablespace but not the InnoDB "
"log files. See\n"
- "InnoDB: " REFMAN "forcing-recovery.html\n"
+ "InnoDB: " REFMAN "forcing-innodb-recovery.html\n"
"InnoDB: for more information.\n",
(ulong) mach_read_from_4(read_buf
+ FIL_PAGE_OFFSET),
@@ -858,16 +858,16 @@ buf_block_init(
block->frame = frame;
- block->page.buf_pool = buf_pool;
+ block->page.buf_pool_index = buf_pool_index(buf_pool);
block->page.state = BUF_BLOCK_NOT_USED;
block->page.buf_fix_count = 0;
block->page.io_fix = BUF_IO_NONE;
block->modify_clock = 0;
-#ifdef UNIV_DEBUG_FILE_ACCESSES
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
block->page.file_page_was_freed = FALSE;
-#endif /* UNIV_DEBUG_FILE_ACCESSES */
+#endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
block->check_index_page_at_flush = FALSE;
block->index = NULL;
@@ -1233,7 +1233,7 @@ buf_pool_init_instance(
buf_pool->page_hash = hash_create(2 * buf_pool->curr_size);
buf_pool->zip_hash = hash_create(2 * buf_pool->curr_size);
-
+
buf_pool->last_printout_time = ut_time();
}
/* 2. Initialize flushing fields
@@ -1280,8 +1280,6 @@ buf_pool_free_instance(
mem_free(buf_pool->chunks);
hash_table_free(buf_pool->page_hash);
hash_table_free(buf_pool->zip_hash);
- mem_free(buf_pool);
- buf_pool = NULL;
}
/********************************************************************//**
@@ -1294,25 +1292,23 @@ buf_pool_init(
ulint total_size, /*!< in: size of the total pool in bytes */
ulint n_instances) /*!< in: number of instances */
{
- ulint i;
+ ulint i;
+ const ulint size = total_size / n_instances;
+
+ ut_ad(n_instances > 0);
+ ut_ad(n_instances <= MAX_BUFFER_POOLS);
+ ut_ad(n_instances == srv_buf_pool_instances);
/* We create an extra buffer pool instance, this instance is used
for flushing the flush lists, to keep track of n_flush for all
the buffer pools and also used as a waiting object during flushing. */
- for (i = 0; i < n_instances; i++) {
- buf_pool_t* ptr;
- ulint size;
+ buf_pool_ptr = mem_zalloc(n_instances * sizeof *buf_pool_ptr);
- ptr = mem_zalloc(sizeof(*ptr));
-
- size = total_size / n_instances;
-
- buf_pool_ptr[i] = ptr;
+ for (i = 0; i < n_instances; i++) {
+ buf_pool_t* ptr = &buf_pool_ptr[i];
if (buf_pool_init_instance(ptr, size, i) != DB_SUCCESS) {
- mem_free(buf_pool_ptr[i]);
-
/* Free all the instances created so far. */
buf_pool_free(i);
@@ -1341,8 +1337,10 @@ buf_pool_free(
for (i = 0; i < n_instances; i++) {
buf_pool_free_instance(buf_pool_from_array(i));
- buf_pool_ptr[i] = NULL;
}
+
+ mem_free(buf_pool_ptr);
+ buf_pool_ptr = NULL;
}
/********************************************************************//**
@@ -1367,11 +1365,11 @@ buf_pool_drop_hash_index_instance(
/* block->is_hashed cannot be modified
when we have an x-latch on btr_search_latch;
see the comment in buf0buf.h */
-
+
if (!block->is_hashed) {
continue;
}
-
+
/* To follow the latching order, we
have to release btr_search_latch
before acquiring block->latch. */
@@ -1380,14 +1378,14 @@ buf_pool_drop_hash_index_instance(
we must rescan all blocks, because
some may become hashed again. */
*released_search_latch = TRUE;
-
+
rw_lock_x_lock(&block->lock);
-
+
/* This should be guaranteed by the
callers, which will be holding
btr_search_enabled_mutex. */
ut_ad(!btr_search_enabled);
-
+
/* Because we did not buffer-fix the
block by calling buf_block_get_gen(),
it is possible that the block has been
@@ -1397,7 +1395,7 @@ buf_pool_drop_hash_index_instance(
block is mapped to. All we want to do
is to drop any hash entries referring
to the page. */
-
+
/* It is possible that
block->page.state != BUF_FILE_PAGE.
Even that does not matter, because
@@ -1405,18 +1403,18 @@ buf_pool_drop_hash_index_instance(
check block->is_hashed before doing
anything. block->is_hashed can only
be set on uncompressed file pages. */
-
+
btr_search_drop_page_hash_index(block);
-
+
rw_lock_x_unlock(&block->lock);
-
+
rw_lock_x_lock(&btr_search_latch);
-
+
ut_ad(!btr_search_enabled);
}
}
}
-
+
/********************************************************************//**
Drops the adaptive hash index. To prevent a livelock, this function
is only to be called while holding btr_search_latch and while
@@ -1625,7 +1623,7 @@ shrink_again:
buf_LRU_make_block_old(&block->page);
dirty++;
- } else if (buf_LRU_free_block(&block->page, TRUE, NULL)
+ } else if (buf_LRU_free_block(&block->page, TRUE)
!= BUF_LRU_FREED) {
nonfree++;
}
@@ -1882,8 +1880,8 @@ buf_pool_watch_set(
ut_ad(!bpage->in_page_hash);
ut_ad(bpage->buf_fix_count == 0);
- /* bpage is pointing to buf_pool_watch[],
- which is protected by buf_pool_mutex.
+ /* bpage is pointing to buf_pool->watch[],
+ which is protected by buf_pool->mutex.
Normally, buf_page_t objects are protected by
buf_block_t::mutex or buf_pool->zip_mutex or both. */
@@ -1992,30 +1990,30 @@ buf_pool_resize(void)
ulint min_change_size = 1048576 * srv_buf_pool_instances;
buf_pool_mutex_enter_all();
-
+
if (srv_buf_pool_old_size == srv_buf_pool_size) {
-
+
buf_pool_mutex_exit_all();
return;
} else if (srv_buf_pool_curr_size + min_change_size
> srv_buf_pool_size) {
-
+
change_size = (srv_buf_pool_curr_size - srv_buf_pool_size)
/ UNIV_PAGE_SIZE;
buf_pool_mutex_exit_all();
-
+
/* Disable adaptive hash indexes and empty the index
in order to free up memory in the buffer pool chunks. */
buf_pool_shrink(change_size);
} else if (srv_buf_pool_curr_size + min_change_size
< srv_buf_pool_size) {
-
+
/* Enlarge the buffer pool by at least one megabyte */
-
+
change_size = srv_buf_pool_size - srv_buf_pool_curr_size;
buf_pool_mutex_exit_all();
@@ -2028,10 +2026,10 @@ buf_pool_resize(void)
return;
}
-
+
buf_pool_page_hash_rebuild();
}
-
+
/****************************************************************//**
Remove the sentinel block for the watch before replacing it with a real block.
buf_page_watch_clear() or buf_page_watch_occurred() will notice that
@@ -2231,7 +2229,7 @@ buf_page_peek_if_search_hashed(
return(is_hashed);
}
-#ifdef UNIV_DEBUG_FILE_ACCESSES
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
/********************************************************************//**
Sets file_page_was_freed TRUE if the page is found in the buffer pool.
This function should be called when we free a file page and want the
@@ -2254,6 +2252,8 @@ buf_page_set_file_page_was_freed(
if (bpage) {
ut_ad(!buf_pool_watch_is_sentinel(buf_pool, bpage));
+ /* bpage->file_page_was_freed can already hold
+ when this code is invoked from dict_drop_index_tree() */
bpage->file_page_was_freed = TRUE;
}
@@ -2291,7 +2291,7 @@ buf_page_reset_file_page_was_freed(
return(bpage);
}
-#endif /* UNIV_DEBUG_FILE_ACCESSES */
+#endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
/********************************************************************//**
Get read access to a compressed page (usually of type
@@ -2316,9 +2316,6 @@ buf_page_get_zip(
unsigned access_time;
buf_pool_t* buf_pool = buf_pool_get(space, offset);
-#ifndef UNIV_LOG_DEBUG
- ut_ad(!ibuf_inside());
-#endif
buf_pool->stat.n_page_gets++;
for (;;) {
@@ -2368,8 +2365,7 @@ err_exit:
mutex_enter(block_mutex);
/* Discard the uncompressed page frame if possible. */
- if (buf_LRU_free_block(bpage, FALSE, NULL)
- == BUF_LRU_FREED) {
+ if (buf_LRU_free_block(bpage, FALSE) == BUF_LRU_FREED) {
mutex_exit(block_mutex);
goto lookup;
@@ -2393,7 +2389,7 @@ got_block:
buf_page_set_accessed_make_young(bpage, access_time);
-#ifdef UNIV_DEBUG_FILE_ACCESSES
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
ut_a(!bpage->file_page_was_freed);
#endif
@@ -2534,16 +2530,19 @@ buf_block_align_instance(
/* TODO: protect buf_pool->chunks with a mutex (it will
currently remain constant after buf_pool_init()) */
for (chunk = buf_pool->chunks, i = buf_pool->n_chunks; i--; chunk++) {
- lint offs = ptr - chunk->blocks->frame;
+ ulint offs;
- if (UNIV_UNLIKELY(offs < 0)) {
+ if (UNIV_UNLIKELY(ptr < chunk->blocks->frame)) {
continue;
}
+ /* else */
+
+ offs = ptr - chunk->blocks->frame;
offs >>= UNIV_PAGE_SIZE_SHIFT;
- if (UNIV_LIKELY((ulint) offs < chunk->size)) {
+ if (UNIV_LIKELY(offs < chunk->size)) {
buf_block_t* block = &chunk->blocks[offs];
/* The function buf_chunk_init() invokes
@@ -2720,7 +2719,7 @@ buf_page_get_gen(
ulint rw_latch,/*!< in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */
buf_block_t* guess, /*!< in: guessed block or NULL */
ulint mode, /*!< in: BUF_GET, BUF_GET_IF_IN_POOL,
- BUF_GET_NO_LATCH, or
+ BUF_PEEK_IF_IN_POOL, BUF_GET_NO_LATCH, or
BUF_GET_IF_IN_POOL_OR_WATCH */
const char* file, /*!< in: file name */
ulint line, /*!< in: line where called */
@@ -2739,15 +2738,27 @@ buf_page_get_gen(
ut_ad((rw_latch == RW_S_LATCH)
|| (rw_latch == RW_X_LATCH)
|| (rw_latch == RW_NO_LATCH));
- ut_ad((mode != BUF_GET_NO_LATCH) || (rw_latch == RW_NO_LATCH));
- ut_ad(mode == BUF_GET
- || mode == BUF_GET_IF_IN_POOL
- || mode == BUF_GET_NO_LATCH
- || mode == BUF_GET_IF_IN_POOL_OR_WATCH);
+#ifdef UNIV_DEBUG
+ switch (mode) {
+ case BUF_GET_NO_LATCH:
+ ut_ad(rw_latch == RW_NO_LATCH);
+ break;
+ case BUF_GET:
+ case BUF_GET_IF_IN_POOL:
+ case BUF_PEEK_IF_IN_POOL:
+ case BUF_GET_IF_IN_POOL_OR_WATCH:
+ case BUF_GET_POSSIBLY_FREED:
+ break;
+ default:
+ ut_error;
+ }
+#endif /* UNIV_DEBUG */
ut_ad(zip_size == fil_space_get_zip_size(space));
ut_ad(ut_is_2pow(zip_size));
#ifndef UNIV_LOG_DEBUG
- ut_ad(!ibuf_inside() || ibuf_page(space, zip_size, offset, NULL));
+ ut_ad(!ibuf_inside(mtr)
+ || ibuf_page_low(space, zip_size, offset,
+ FALSE, file, line, NULL));
#endif
buf_pool->stat.n_page_gets++;
fold = buf_page_address_fold(space, offset);
@@ -2802,6 +2813,7 @@ loop2:
buf_pool_mutex_exit(buf_pool);
if (mode == BUF_GET_IF_IN_POOL
+ || mode == BUF_PEEK_IF_IN_POOL
|| mode == BUF_GET_IF_IN_POOL_OR_WATCH) {
return(NULL);
@@ -2842,7 +2854,8 @@ got_block:
must_read = buf_block_get_io_fix(block) == BUF_IO_READ;
- if (must_read && mode == BUF_GET_IF_IN_POOL) {
+ if (must_read && (mode == BUF_GET_IF_IN_POOL
+ || mode == BUF_PEEK_IF_IN_POOL)) {
/* The page is being read to buffer pool,
but we cannot wait around for the read to
@@ -2876,7 +2889,7 @@ wait_until_unfixed:
Try again later. */
buf_pool_mutex_exit(buf_pool);
os_thread_sleep(WAIT_FOR_READ);
-
+
goto loop;
}
@@ -2884,7 +2897,7 @@ wait_until_unfixed:
buf_pool_mutex_exit(buf_pool);
mutex_exit(&buf_pool->zip_mutex);
- block = buf_LRU_get_free_block(buf_pool, 0);
+ block = buf_LRU_get_free_block(buf_pool);
ut_a(block);
buf_pool_mutex_enter(buf_pool);
@@ -2965,6 +2978,7 @@ wait_until_unfixed:
mutex_exit(&buf_pool->zip_mutex);
buf_pool->n_pend_unzip++;
+ bpage->state = BUF_BLOCK_ZIP_FREE;
buf_buddy_free(buf_pool, bpage, sizeof *bpage);
buf_pool_mutex_exit(buf_pool);
@@ -3008,9 +3022,51 @@ wait_until_unfixed:
bytes. */
UNIV_MEM_ASSERT_RW(&block->page, sizeof block->page);
#endif
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+ if ((mode == BUF_GET_IF_IN_POOL || mode == BUF_GET_IF_IN_POOL_OR_WATCH)
+ && ibuf_debug) {
+ /* Try to evict the block from the buffer pool, to use the
+ insert buffer (change buffer) as much as possible. */
- buf_block_buf_fix_inc(block, file, line);
+ if (buf_LRU_free_block(&block->page, TRUE) == BUF_LRU_FREED) {
+ mutex_exit(&block->mutex);
+ if (mode == BUF_GET_IF_IN_POOL_OR_WATCH) {
+ /* Set the watch, as it would have
+ been set if the page were not in the
+ buffer pool in the first place. */
+ block = (buf_block_t*) buf_pool_watch_set(
+ space, offset, fold);
+
+ if (UNIV_LIKELY_NULL(block)) {
+
+ /* The page entered the buffer
+ pool for some reason. Try to
+ evict it again. */
+ goto got_block;
+ }
+ }
+ buf_pool_mutex_exit(buf_pool);
+ fprintf(stderr,
+ "innodb_change_buffering_debug evict %u %u\n",
+ (unsigned) space, (unsigned) offset);
+ return(NULL);
+ } else if (buf_flush_page_try(buf_pool, block)) {
+ fprintf(stderr,
+ "innodb_change_buffering_debug flush %u %u\n",
+ (unsigned) space, (unsigned) offset);
+ guess = block;
+ goto loop;
+ }
+
+ /* Failed to evict the page; change it directly */
+ }
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+ buf_block_buf_fix_inc(block, file, line);
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
+ ut_a(mode == BUF_GET_POSSIBLY_FREED
+ || !block->page.file_page_was_freed);
+#endif
mutex_exit(&block->mutex);
/* Check if this is the first access to the page */
@@ -3019,11 +3075,9 @@ wait_until_unfixed:
buf_pool_mutex_exit(buf_pool);
- buf_page_set_accessed_make_young(&block->page, access_time);
-
-#ifdef UNIV_DEBUG_FILE_ACCESSES
- ut_a(!block->page.file_page_was_freed);
-#endif
+ if (UNIV_LIKELY(mode != BUF_PEEK_IF_IN_POOL)) {
+ buf_page_set_accessed_make_young(&block->page, access_time);
+ }
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
ut_a(++buf_dbg_counter % 5771 || buf_validate());
@@ -3072,11 +3126,12 @@ wait_until_unfixed:
mtr_memo_push(mtr, block, fix_type);
- if (!access_time) {
+ if (UNIV_LIKELY(mode != BUF_PEEK_IF_IN_POOL) && !access_time) {
/* In the case of a first access, try to apply linear
read-ahead */
- buf_read_ahead_linear(space, zip_size, offset);
+ buf_read_ahead_linear(space, zip_size, offset,
+ ibuf_inside(mtr));
}
#ifdef UNIV_IBUF_COUNT_DEBUG
@@ -3133,7 +3188,7 @@ buf_page_optimistic_get(
access_time = buf_page_is_accessed(&block->page);
buf_page_set_accessed_make_young(&block->page, access_time);
- ut_ad(!ibuf_inside()
+ ut_ad(!ibuf_inside(mtr)
|| ibuf_page(buf_block_get_space(block),
buf_block_get_zip_size(block),
buf_block_get_page_no(block), NULL));
@@ -3180,7 +3235,7 @@ buf_page_optimistic_get(
ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
-#ifdef UNIV_DEBUG_FILE_ACCESSES
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
ut_a(block->page.file_page_was_freed == FALSE);
#endif
if (UNIV_UNLIKELY(!access_time)) {
@@ -3189,7 +3244,8 @@ buf_page_optimistic_get(
buf_read_ahead_linear(buf_block_get_space(block),
buf_block_get_zip_size(block),
- buf_block_get_page_no(block));
+ buf_block_get_page_no(block),
+ ibuf_inside(mtr));
}
#ifdef UNIV_IBUF_COUNT_DEBUG
@@ -3265,7 +3321,7 @@ buf_page_get_known_nowait(
buf_pool_mutex_exit(buf_pool);
}
- ut_ad(!ibuf_inside() || (mode == BUF_KEEP_OLD));
+ ut_ad(!ibuf_inside(mtr) || mode == BUF_KEEP_OLD);
if (rw_latch == RW_S_LATCH) {
success = rw_lock_s_lock_nowait(&(block->lock),
@@ -3292,7 +3348,7 @@ buf_page_get_known_nowait(
ut_a(block->page.buf_fix_count > 0);
ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
-#ifdef UNIV_DEBUG_FILE_ACCESSES
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
ut_a(block->page.file_page_was_freed == FALSE);
#endif
@@ -3378,9 +3434,9 @@ buf_page_try_get_func(
ut_a(block->page.buf_fix_count > 0);
ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
-#ifdef UNIV_DEBUG_FILE_ACCESSES
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
ut_a(block->page.file_page_was_freed == FALSE);
-#endif /* UNIV_DEBUG_FILE_ACCESSES */
+#endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
buf_pool->stat.n_page_gets++;
@@ -3409,9 +3465,9 @@ buf_page_init_low(
bpage->newest_modification = 0;
bpage->oldest_modification = 0;
HASH_INVALIDATE(bpage, hash);
-#ifdef UNIV_DEBUG_FILE_ACCESSES
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
bpage->file_page_was_freed = FALSE;
-#endif /* UNIV_DEBUG_FILE_ACCESSES */
+#endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
}
/********************************************************************//**
@@ -3530,14 +3586,13 @@ buf_page_init_for_read(
/* It is a read-ahead within an ibuf routine */
ut_ad(!ibuf_bitmap_page(zip_size, offset));
- ut_ad(ibuf_inside());
- mtr_start(&mtr);
+ ibuf_mtr_start(&mtr);
if (!recv_no_ibuf_operations
&& !ibuf_page(space, zip_size, offset, &mtr)) {
- mtr_commit(&mtr);
+ ibuf_mtr_commit(&mtr);
return(NULL);
}
@@ -3549,7 +3604,7 @@ buf_page_init_for_read(
&& UNIV_LIKELY(!recv_recovery_is_on())) {
block = NULL;
} else {
- block = buf_LRU_get_free_block(buf_pool, 0);
+ block = buf_LRU_get_free_block(buf_pool);
ut_ad(block);
ut_ad(buf_pool_from_block(block) == buf_pool);
}
@@ -3645,7 +3700,7 @@ err_exit:
bpage = buf_buddy_alloc(buf_pool, sizeof *bpage, &lru);
/* Initialize the buf_pool pointer. */
- bpage->buf_pool = buf_pool;
+ bpage->buf_pool_index = buf_pool_index(buf_pool);
/* If buf_buddy_alloc() allocated storage from the LRU list,
it released and reacquired buf_pool->mutex. Thus, we must
@@ -3661,6 +3716,7 @@ err_exit:
/* The block was added by some other thread. */
watch_page = NULL;
+ bpage->state = BUF_BLOCK_ZIP_FREE;
buf_buddy_free(buf_pool, bpage, sizeof *bpage);
buf_buddy_free(buf_pool, data, zip_size);
@@ -3721,7 +3777,7 @@ func_exit:
if (mode == BUF_READ_IBUF_PAGES_ONLY) {
- mtr_commit(&mtr);
+ ibuf_mtr_commit(&mtr);
}
ut_ad(!bpage || buf_page_in_file(bpage));
@@ -3755,7 +3811,7 @@ buf_page_create(
ut_ad(mtr->state == MTR_ACTIVE);
ut_ad(space || !zip_size);
- free_block = buf_LRU_get_free_block(buf_pool, 0);
+ free_block = buf_LRU_get_free_block(buf_pool);
fold = buf_page_address_fold(space, offset);
@@ -3770,9 +3826,9 @@ buf_page_create(
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(ibuf_count_get(space, offset) == 0);
#endif
-#ifdef UNIV_DEBUG_FILE_ACCESSES
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
block->page.file_page_was_freed = FALSE;
-#endif /* UNIV_DEBUG_FILE_ACCESSES */
+#endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
/* Page can be found in buf_pool */
buf_pool_mutex_exit(buf_pool);
@@ -4000,7 +4056,7 @@ corrupt:
"InnoDB: TABLE to scan your"
" table for corruption.\n"
"InnoDB: See also "
- REFMAN "forcing-recovery.html\n"
+ REFMAN "forcing-innodb-recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) {
@@ -4749,29 +4805,209 @@ buf_get_modified_ratio_pct(void)
buf_get_total_list_len(&lru_len, &free_len, &flush_list_len);
ratio = (100 * flush_list_len) / (1 + lru_len + free_len);
-
+
/* 1 + is there to avoid division by zero */
return(ratio);
}
+/*******************************************************************//**
+Aggregates a pool stats information with the total buffer pool stats */
+static
+void
+buf_stats_aggregate_pool_info(
+/*==========================*/
+ buf_pool_info_t* total_info, /*!< in/out: the buffer pool
+ info to store aggregated
+ result */
+ const buf_pool_info_t* pool_info) /*!< in: individual buffer pool
+ stats info */
+{
+ ut_a(total_info && pool_info);
+
+ /* Nothing to copy if total_info is the same as pool_info */
+ if (total_info == pool_info) {
+ return;
+ }
+
+ total_info->pool_size += pool_info->pool_size;
+ total_info->lru_len += pool_info->lru_len;
+ total_info->old_lru_len += pool_info->old_lru_len;
+ total_info->free_list_len += pool_info->free_list_len;
+ total_info->flush_list_len += pool_info->flush_list_len;
+ total_info->n_pend_unzip += pool_info->n_pend_unzip;
+ total_info->n_pend_reads += pool_info->n_pend_reads;
+ total_info->n_pending_flush_lru += pool_info->n_pending_flush_lru;
+ total_info->n_pending_flush_list += pool_info->n_pending_flush_list;
+ total_info->n_pending_flush_single_page +=
+ pool_info->n_pending_flush_single_page;
+ total_info->n_pages_made_young += pool_info->n_pages_made_young;
+ total_info->n_pages_not_made_young += pool_info->n_pages_not_made_young;
+ total_info->n_pages_read += pool_info->n_pages_read;
+ total_info->n_pages_created += pool_info->n_pages_created;
+ total_info->n_pages_written += pool_info->n_pages_written;
+ total_info->n_page_gets += pool_info->n_page_gets;
+ total_info->n_ra_pages_read += pool_info->n_ra_pages_read;
+ total_info->n_ra_pages_evicted += pool_info->n_ra_pages_evicted;
+ total_info->page_made_young_rate += pool_info->page_made_young_rate;
+ total_info->page_not_made_young_rate +=
+ pool_info->page_not_made_young_rate;
+ total_info->pages_read_rate += pool_info->pages_read_rate;
+ total_info->pages_created_rate += pool_info->pages_created_rate;
+ total_info->pages_written_rate += pool_info->pages_written_rate;
+ total_info->n_page_get_delta += pool_info->n_page_get_delta;
+ total_info->page_read_delta += pool_info->page_read_delta;
+ total_info->young_making_delta += pool_info->young_making_delta;
+ total_info->not_young_making_delta += pool_info->not_young_making_delta;
+ total_info->pages_readahead_rate += pool_info->pages_readahead_rate;
+ total_info->pages_evicted_rate += pool_info->pages_evicted_rate;
+ total_info->unzip_lru_len += pool_info->unzip_lru_len;
+ total_info->io_sum += pool_info->io_sum;
+ total_info->io_cur += pool_info->io_cur;
+ total_info->unzip_sum += pool_info->unzip_sum;
+ total_info->unzip_cur += pool_info->unzip_cur;
+}
+/*******************************************************************//**
+Collect buffer pool stats information for a buffer pool. Also
+record aggregated stats if there are more than one buffer pool
+in the server */
+static
+void
+buf_stats_get_pool_info(
+/*====================*/
+ buf_pool_t* buf_pool, /*!< in: buffer pool */
+ ulint pool_id, /*!< in: buffer pool ID */
+ buf_pool_info_t* all_pool_info) /*!< in/out: buffer pool info
+ to fill */
+{
+ buf_pool_info_t* pool_info;
+ time_t current_time;
+ double time_elapsed;
+
+ /* Find appropriate pool_info to store stats for this buffer pool */
+ pool_info = &all_pool_info[pool_id];
+
+ buf_pool_mutex_enter(buf_pool);
+ buf_flush_list_mutex_enter(buf_pool);
+
+ pool_info->pool_unique_id = pool_id;
+
+ pool_info->pool_size = buf_pool->curr_size;
+
+ pool_info->lru_len = UT_LIST_GET_LEN(buf_pool->LRU);
+
+ pool_info->old_lru_len = buf_pool->LRU_old_len;
+
+ pool_info->free_list_len = UT_LIST_GET_LEN(buf_pool->free);
+
+ pool_info->flush_list_len = UT_LIST_GET_LEN(buf_pool->flush_list);
+
+ pool_info->n_pend_unzip = UT_LIST_GET_LEN(buf_pool->unzip_LRU);
+
+ pool_info->n_pend_reads = buf_pool->n_pend_reads;
+
+ pool_info->n_pending_flush_lru =
+ (buf_pool->n_flush[BUF_FLUSH_LRU]
+ + buf_pool->init_flush[BUF_FLUSH_LRU]);
+
+ pool_info->n_pending_flush_list =
+ (buf_pool->n_flush[BUF_FLUSH_LIST]
+ + buf_pool->init_flush[BUF_FLUSH_LIST]);
+
+ pool_info->n_pending_flush_single_page =
+ buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE];
+
+ buf_flush_list_mutex_exit(buf_pool);
+
+ current_time = time(NULL);
+ time_elapsed = 0.001 + difftime(current_time,
+ buf_pool->last_printout_time);
+
+ pool_info->n_pages_made_young = buf_pool->stat.n_pages_made_young;
+
+ pool_info->n_pages_not_made_young =
+ buf_pool->stat.n_pages_not_made_young;
+
+ pool_info->n_pages_read = buf_pool->stat.n_pages_read;
+
+ pool_info->n_pages_created = buf_pool->stat.n_pages_created;
+
+ pool_info->n_pages_written = buf_pool->stat.n_pages_written;
+
+ pool_info->n_page_gets = buf_pool->stat.n_page_gets;
+
+ pool_info->n_ra_pages_read = buf_pool->stat.n_ra_pages_read;
+
+ pool_info->n_ra_pages_evicted = buf_pool->stat.n_ra_pages_evicted;
+
+ pool_info->page_made_young_rate =
+ (buf_pool->stat.n_pages_made_young
+ - buf_pool->old_stat.n_pages_made_young) / time_elapsed;
+
+ pool_info->page_not_made_young_rate =
+ (buf_pool->stat.n_pages_not_made_young
+ - buf_pool->old_stat.n_pages_not_made_young) / time_elapsed;
+
+ pool_info->pages_read_rate =
+ (buf_pool->stat.n_pages_read
+ - buf_pool->old_stat.n_pages_read) / time_elapsed;
+
+ pool_info->pages_created_rate =
+ (buf_pool->stat.n_pages_created
+ - buf_pool->old_stat.n_pages_created) / time_elapsed;
+
+ pool_info->pages_written_rate =
+ (buf_pool->stat.n_pages_written
+ - buf_pool->old_stat.n_pages_written) / time_elapsed;
+
+ pool_info->n_page_get_delta = buf_pool->stat.n_page_gets
+ - buf_pool->old_stat.n_page_gets;
+
+ if (pool_info->n_page_get_delta) {
+ pool_info->page_read_delta = buf_pool->stat.n_pages_read
+ - buf_pool->old_stat.n_pages_read;
+
+ pool_info->young_making_delta =
+ buf_pool->stat.n_pages_made_young
+ - buf_pool->old_stat.n_pages_made_young;
+
+ pool_info->not_young_making_delta =
+ buf_pool->stat.n_pages_not_made_young
+ - buf_pool->old_stat.n_pages_not_made_young;
+ }
+
+ pool_info->pages_readahead_rate =
+ (buf_pool->stat.n_ra_pages_read
+ - buf_pool->old_stat.n_ra_pages_read) / time_elapsed;
+
+ pool_info->pages_evicted_rate =
+ (buf_pool->stat.n_ra_pages_evicted
+ - buf_pool->old_stat.n_ra_pages_evicted) / time_elapsed;
+
+ pool_info->unzip_lru_len = UT_LIST_GET_LEN(buf_pool->unzip_LRU);
+
+ pool_info->io_sum = buf_LRU_stat_sum.io;
+
+ pool_info->io_cur = buf_LRU_stat_cur.io;
+
+ pool_info->unzip_sum = buf_LRU_stat_sum.unzip;
+
+ pool_info->unzip_cur = buf_LRU_stat_cur.unzip;
+
+ buf_refresh_io_stats(buf_pool);
+ buf_pool_mutex_exit(buf_pool);
+}
+
/*********************************************************************//**
Prints info of the buffer i/o. */
UNIV_INTERN
void
buf_print_io_instance(
/*==================*/
- buf_pool_t* buf_pool, /*!< in: buffer pool instance */
+ buf_pool_info_t*pool_info, /*!< in: buffer pool info */
FILE* file) /*!< in/out: buffer where to print */
{
- time_t current_time;
- double time_elapsed;
- ulint n_gets_diff;
-
- ut_ad(buf_pool);
-
- buf_pool_mutex_enter(buf_pool);
- buf_flush_list_mutex_enter(buf_pool);
+ ut_ad(pool_info);
fprintf(file,
"Buffer pool size %lu\n"
@@ -4781,70 +5017,42 @@ buf_print_io_instance(
"Modified db pages %lu\n"
"Pending reads %lu\n"
"Pending writes: LRU %lu, flush list %lu, single page %lu\n",
- (ulong) buf_pool->curr_size,
- (ulong) UT_LIST_GET_LEN(buf_pool->free),
- (ulong) UT_LIST_GET_LEN(buf_pool->LRU),
- (ulong) buf_pool->LRU_old_len,
- (ulong) UT_LIST_GET_LEN(buf_pool->flush_list),
- (ulong) buf_pool->n_pend_reads,
- (ulong) buf_pool->n_flush[BUF_FLUSH_LRU]
- + buf_pool->init_flush[BUF_FLUSH_LRU],
- (ulong) buf_pool->n_flush[BUF_FLUSH_LIST]
- + buf_pool->init_flush[BUF_FLUSH_LIST],
- (ulong) buf_pool->n_flush[BUF_FLUSH_SINGLE_PAGE]);
-
- buf_flush_list_mutex_exit(buf_pool);
-
- current_time = time(NULL);
- time_elapsed = 0.001 + difftime(current_time,
- buf_pool->last_printout_time);
+ pool_info->pool_size,
+ pool_info->free_list_len,
+ pool_info->lru_len,
+ pool_info->old_lru_len,
+ pool_info->flush_list_len,
+ pool_info->n_pend_reads,
+ pool_info->n_pending_flush_lru,
+ pool_info->n_pending_flush_list,
+ pool_info->n_pending_flush_single_page);
fprintf(file,
"Pages made young %lu, not young %lu\n"
"%.2f youngs/s, %.2f non-youngs/s\n"
"Pages read %lu, created %lu, written %lu\n"
"%.2f reads/s, %.2f creates/s, %.2f writes/s\n",
- (ulong) buf_pool->stat.n_pages_made_young,
- (ulong) buf_pool->stat.n_pages_not_made_young,
- (buf_pool->stat.n_pages_made_young
- - buf_pool->old_stat.n_pages_made_young)
- / time_elapsed,
- (buf_pool->stat.n_pages_not_made_young
- - buf_pool->old_stat.n_pages_not_made_young)
- / time_elapsed,
- (ulong) buf_pool->stat.n_pages_read,
- (ulong) buf_pool->stat.n_pages_created,
- (ulong) buf_pool->stat.n_pages_written,
- (buf_pool->stat.n_pages_read
- - buf_pool->old_stat.n_pages_read)
- / time_elapsed,
- (buf_pool->stat.n_pages_created
- - buf_pool->old_stat.n_pages_created)
- / time_elapsed,
- (buf_pool->stat.n_pages_written
- - buf_pool->old_stat.n_pages_written)
- / time_elapsed);
-
- n_gets_diff = buf_pool->stat.n_page_gets
- - buf_pool->old_stat.n_page_gets;
-
- if (n_gets_diff) {
+ pool_info->n_pages_made_young,
+ pool_info->n_pages_not_made_young,
+ pool_info->page_made_young_rate,
+ pool_info->page_not_made_young_rate,
+ pool_info->n_pages_read,
+ pool_info->n_pages_created,
+ pool_info->n_pages_written,
+ pool_info->pages_read_rate,
+ pool_info->pages_created_rate,
+ pool_info->pages_written_rate);
+
+ if (pool_info->n_page_get_delta) {
fprintf(file,
"Buffer pool hit rate %lu / 1000,"
" young-making rate %lu / 1000 not %lu / 1000\n",
- (ulong)
- (1000 - ((1000 * (buf_pool->stat.n_pages_read
- - buf_pool->old_stat.n_pages_read))
- / (buf_pool->stat.n_page_gets
- - buf_pool->old_stat.n_page_gets))),
- (ulong)
- (1000 * (buf_pool->stat.n_pages_made_young
- - buf_pool->old_stat.n_pages_made_young)
- / n_gets_diff),
- (ulong)
- (1000 * (buf_pool->stat.n_pages_not_made_young
- - buf_pool->old_stat.n_pages_not_made_young)
- / n_gets_diff));
+ (ulong) (1000 - (1000 * pool_info->page_read_delta
+ / pool_info->n_page_get_delta)),
+ (ulong) (1000 * pool_info->young_making_delta
+ / pool_info->n_page_get_delta),
+ (ulong) (1000 * pool_info->not_young_making_delta
+ / pool_info->n_page_get_delta));
} else {
fputs("No buffer pool page gets since the last printout\n",
file);
@@ -4853,25 +5061,17 @@ buf_print_io_instance(
/* Statistics about read ahead algorithm */
fprintf(file, "Pages read ahead %.2f/s,"
" evicted without access %.2f/s\n",
- (buf_pool->stat.n_ra_pages_read
- - buf_pool->old_stat.n_ra_pages_read)
- / time_elapsed,
- (buf_pool->stat.n_ra_pages_evicted
- - buf_pool->old_stat.n_ra_pages_evicted)
- / time_elapsed);
+ pool_info->pages_readahead_rate,
+ pool_info->pages_evicted_rate);
/* Print some values to help us with visualizing what is
happening with LRU eviction. */
fprintf(file,
"LRU len: %lu, unzip_LRU len: %lu\n"
"I/O sum[%lu]:cur[%lu], unzip sum[%lu]:cur[%lu]\n",
- UT_LIST_GET_LEN(buf_pool->LRU),
- UT_LIST_GET_LEN(buf_pool->unzip_LRU),
- buf_LRU_stat_sum.io, buf_LRU_stat_cur.io,
- buf_LRU_stat_sum.unzip, buf_LRU_stat_cur.unzip);
-
- buf_refresh_io_stats(buf_pool);
- buf_pool_mutex_exit(buf_pool);
+ pool_info->lru_len, pool_info->unzip_lru_len,
+ pool_info->io_sum, pool_info->io_cur,
+ pool_info->unzip_sum, pool_info->unzip_cur);
}
/*********************************************************************//**
@@ -4882,14 +5082,58 @@ buf_print_io(
/*=========*/
FILE* file) /*!< in/out: buffer where to print */
{
- ulint i;
+ ulint i;
+ buf_pool_info_t* pool_info;
+ buf_pool_info_t* pool_info_total;
+
+ /* If srv_buf_pool_instances is greater than 1, allocate
+ one extra buf_pool_info_t, the last one stores
+ aggregated/total values from all pools */
+ if (srv_buf_pool_instances > 1) {
+ pool_info = (buf_pool_info_t*) mem_zalloc((
+ srv_buf_pool_instances + 1) * sizeof *pool_info);
+
+ pool_info_total = &pool_info[srv_buf_pool_instances];
+ } else {
+ ut_a(srv_buf_pool_instances == 1);
+ pool_info_total = pool_info = (buf_pool_info_t*) mem_zalloc(
+ sizeof *pool_info)
+ }
for (i = 0; i < srv_buf_pool_instances; i++) {
buf_pool_t* buf_pool;
buf_pool = buf_pool_from_array(i);
- buf_print_io_instance(buf_pool, file);
+
+ /* Fetch individual buffer pool info and calculate
+ aggregated stats along the way */
+ buf_stats_get_pool_info(buf_pool, i, pool_info);
+
+ /* If we have more than one buffer pool, store
+ the aggregated stats */
+ if (srv_buf_pool_instances > 1) {
+ buf_stats_aggregate_pool_info(pool_info_total,
+ &pool_info[i]);
+ }
}
+
+ /* Print the aggreate buffer pool info */
+ buf_print_io_instance(pool_info_total, file);
+
+ /* If there are more than one buffer pool, print each individual pool
+ info */
+ if (srv_buf_pool_instances > 1) {
+ fputs("----------------------\n"
+ "INDIVIDUAL BUFFER POOL INFO\n"
+ "----------------------\n", file);
+
+ for (i = 0; i < srv_buf_pool_instances; i++) {
+ fprintf(file, "---BUFFER POOL %lu\n", i);
+ buf_print_io_instance(&pool_info[i], file);
+ }
+ }
+
+ mem_free(pool_info);
}
/**********************************************************************//**
@@ -4944,7 +5188,7 @@ buf_all_freed(void)
return(TRUE);
}
-
+
/*********************************************************************//**
Checks that there currently are no pending i/o-operations for the buffer
pool.
diff --git a/storage/innobase/buf/buf0flu.c b/storage/innobase/buf/buf0flu.c
index 7b51fc60fcc..ebe96a82a10 100644
--- a/storage/innobase/buf/buf0flu.c
+++ b/storage/innobase/buf/buf0flu.c
@@ -88,6 +88,34 @@ ibool
buf_flush_validate_low(
/*===================*/
buf_pool_t* buf_pool); /*!< in: Buffer pool instance */
+
+/******************************************************************//**
+Validates the flush list some of the time.
+@return TRUE if ok or the check was skipped */
+static
+ibool
+buf_flush_validate_skip(
+/*====================*/
+ buf_pool_t* buf_pool) /*!< in: Buffer pool instance */
+{
+/** Try buf_flush_validate_low() every this many times */
+# define BUF_FLUSH_VALIDATE_SKIP 23
+
+ /** The buf_flush_validate_low() call skip counter.
+ Use a signed type because of the race condition below. */
+ static int buf_flush_validate_count = BUF_FLUSH_VALIDATE_SKIP;
+
+ /* There is a race condition below, but it does not matter,
+ because this call is only for heuristic purposes. We want to
+ reduce the call frequency of the costly buf_flush_validate_low()
+ check in debug builds. */
+ if (--buf_flush_validate_count > 0) {
+ return(TRUE);
+ }
+
+ buf_flush_validate_count = BUF_FLUSH_VALIDATE_SKIP;
+ return(buf_flush_validate_low(buf_pool));
+}
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
/******************************************************************//**
@@ -133,12 +161,18 @@ buf_flush_delete_from_flush_rbt(
/*============================*/
buf_page_t* bpage) /*!< in: bpage to be removed. */
{
+#ifdef UNIV_DEBUG
ibool ret = FALSE;
+#endif /* UNIV_DEBUG */
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
ut_ad(buf_flush_list_mutex_own(buf_pool));
- ret = rbt_delete(buf_pool->flush_rbt, &bpage);
+#ifdef UNIV_DEBUG
+ ret =
+#endif /* UNIV_DEBUG */
+ rbt_delete(buf_pool->flush_rbt, &bpage);
+
ut_ad(ret);
}
@@ -287,7 +321,7 @@ buf_flush_insert_into_flush_list(
}
#endif /* UNIV_DEBUG_VALGRIND */
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
- ut_a(buf_flush_validate_low(buf_pool));
+ ut_a(buf_flush_validate_skip(buf_pool));
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
buf_flush_list_mutex_exit(buf_pool);
@@ -315,7 +349,7 @@ buf_flush_insert_sorted_into_flush_list(
buf_flush_list_mutex_enter(buf_pool);
- /* The field in_LRU_list is protected by buf_pool_mutex, which
+ /* The field in_LRU_list is protected by buf_pool->mutex, which
we are not holding. However, while a block is in the flush
list, it is dirty and cannot be discarded, not from the
page_hash or from the LRU list. At most, the uncompressed
@@ -509,7 +543,7 @@ buf_flush_remove(
bpage->oldest_modification = 0;
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
- ut_a(buf_flush_validate_low(buf_pool));
+ ut_a(buf_flush_validate_skip(buf_pool));
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
buf_flush_list_mutex_exit(buf_pool);
@@ -1055,7 +1089,7 @@ buf_flush_write_block_low(
ut_ad(buf_page_in_file(bpage));
- /* We are not holding buf_pool_mutex or block_mutex here.
+ /* We are not holding buf_pool->mutex or block_mutex here.
Nevertheless, it is safe to access bpage, because it is
io_fixed and oldest_modification != 0. Thus, it cannot be
relocated in the buffer pool or removed from flush_list or
@@ -1126,6 +1160,83 @@ buf_flush_write_block_low(
}
}
+# if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/********************************************************************//**
+Writes a flushable page asynchronously from the buffer pool to a file.
+NOTE: buf_pool->mutex and block->mutex must be held upon entering this
+function, and they will be released by this function after flushing.
+This is loosely based on buf_flush_batch() and buf_flush_page().
+@return TRUE if the page was flushed and the mutexes released */
+UNIV_INTERN
+ibool
+buf_flush_page_try(
+/*===============*/
+ buf_pool_t* buf_pool, /*!< in/out: buffer pool instance */
+ buf_block_t* block) /*!< in/out: buffer control block */
+{
+ ut_ad(buf_pool_mutex_own(buf_pool));
+ ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
+ ut_ad(mutex_own(&block->mutex));
+
+ if (!buf_flush_ready_for_flush(&block->page, BUF_FLUSH_LRU)) {
+ return(FALSE);
+ }
+
+ if (buf_pool->n_flush[BUF_FLUSH_LRU] > 0
+ || buf_pool->init_flush[BUF_FLUSH_LRU]) {
+ /* There is already a flush batch of the same type running */
+ return(FALSE);
+ }
+
+ buf_pool->init_flush[BUF_FLUSH_LRU] = TRUE;
+
+ buf_page_set_io_fix(&block->page, BUF_IO_WRITE);
+
+ buf_page_set_flush_type(&block->page, BUF_FLUSH_LRU);
+
+ if (buf_pool->n_flush[BUF_FLUSH_LRU]++ == 0) {
+
+ os_event_reset(buf_pool->no_flush[BUF_FLUSH_LRU]);
+ }
+
+ /* VERY IMPORTANT:
+ Because any thread may call the LRU flush, even when owning
+ locks on pages, to avoid deadlocks, we must make sure that the
+ s-lock is acquired on the page without waiting: this is
+ accomplished because buf_flush_ready_for_flush() must hold,
+ and that requires the page not to be bufferfixed. */
+
+ rw_lock_s_lock_gen(&block->lock, BUF_IO_WRITE);
+
+ /* Note that the s-latch is acquired before releasing the
+ buf_pool mutex: this ensures that the latch is acquired
+ immediately. */
+
+ mutex_exit(&block->mutex);
+ buf_pool_mutex_exit(buf_pool);
+
+ /* Even though block is not protected by any mutex at this
+ point, it is safe to access block, because it is io_fixed and
+ oldest_modification != 0. Thus, it cannot be relocated in the
+ buffer pool or removed from flush_list or LRU_list. */
+
+ buf_flush_write_block_low(&block->page);
+
+ buf_pool_mutex_enter(buf_pool);
+ buf_pool->init_flush[BUF_FLUSH_LRU] = FALSE;
+
+ if (buf_pool->n_flush[BUF_FLUSH_LRU] == 0) {
+ /* The running flush batch has ended */
+ os_event_set(buf_pool->no_flush[BUF_FLUSH_LRU]);
+ }
+
+ buf_pool_mutex_exit(buf_pool);
+ buf_flush_buffered_writes();
+
+ return(TRUE);
+}
+# endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
/********************************************************************//**
Writes a flushable page asynchronously from the buffer pool to a file.
NOTE: in simulated aio we must call
@@ -1605,7 +1716,7 @@ buf_flush_batch(
ut_ad(flush_type == BUF_FLUSH_LRU || flush_type == BUF_FLUSH_LIST);
#ifdef UNIV_SYNC_DEBUG
ut_ad((flush_type != BUF_FLUSH_LIST)
- || sync_thread_levels_empty_gen(TRUE));
+ || sync_thread_levels_empty_except_dict());
#endif /* UNIV_SYNC_DEBUG */
buf_pool_mutex_enter(buf_pool);
@@ -2110,12 +2221,12 @@ buf_flush_validate_low(
ut_ad(bpage->in_flush_list);
- /* A page in flush_list can be in BUF_BLOCK_REMOVE_HASH
- state. This happens when a page is in the middle of
- being relocated. In that case the original descriptor
- can have this state and still be in the flush list
- waiting to acquire the flush_list_mutex to complete
- the relocation. */
+ /* A page in buf_pool->flush_list can be in
+ BUF_BLOCK_REMOVE_HASH state. This happens when a page
+ is in the middle of being relocated. In that case the
+ original descriptor can have this state and still be
+ in the flush list waiting to acquire the
+ buf_pool->flush_list_mutex to complete the relocation. */
ut_a(buf_page_in_file(bpage)
|| buf_page_get_state(bpage) == BUF_BLOCK_REMOVE_HASH);
ut_a(om > 0);
diff --git a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c
index e1d4b5081b8..64afcecfe3c 100644
--- a/storage/innobase/buf/buf0lru.c
+++ b/storage/innobase/buf/buf0lru.c
@@ -247,74 +247,78 @@ buf_LRU_drop_page_hash_for_tablespace(
sizeof(ulint) * BUF_LRU_DROP_SEARCH_HASH_SIZE);
buf_pool_mutex_enter(buf_pool);
+ num_entries = 0;
scan_again:
- num_entries = 0;
bpage = UT_LIST_GET_LAST(buf_pool->LRU);
while (bpage != NULL) {
- mutex_t* block_mutex = buf_page_get_mutex(bpage);
buf_page_t* prev_bpage;
+ ibool is_fixed;
- mutex_enter(block_mutex);
prev_bpage = UT_LIST_GET_PREV(LRU, bpage);
ut_a(buf_page_in_file(bpage));
if (buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE
|| bpage->space != id
- || bpage->buf_fix_count > 0
|| bpage->io_fix != BUF_IO_NONE) {
- /* We leave the fixed pages as is in this scan.
- To be dealt with later in the final scan. */
- mutex_exit(block_mutex);
+ /* Compressed pages are never hashed.
+ Skip blocks of other tablespaces.
+ Skip I/O-fixed blocks (to be dealt with later). */
+next_page:
+ bpage = prev_bpage;
+ continue;
+ }
+
+ mutex_enter(&((buf_block_t*) bpage)->mutex);
+ is_fixed = bpage->buf_fix_count > 0
+ || !((buf_block_t*) bpage)->is_hashed;
+ mutex_exit(&((buf_block_t*) bpage)->mutex);
+
+ if (is_fixed) {
goto next_page;
}
- if (((buf_block_t*) bpage)->is_hashed) {
+ /* Store the page number so that we can drop the hash
+ index in a batch later. */
+ page_arr[num_entries] = bpage->offset;
+ ut_a(num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE);
+ ++num_entries;
- /* Store the offset(i.e.: page_no) in the array
- so that we can drop hash index in a batch
- later. */
- page_arr[num_entries] = bpage->offset;
- mutex_exit(block_mutex);
- ut_a(num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE);
- ++num_entries;
+ if (num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE) {
+ goto next_page;
+ }
- if (num_entries < BUF_LRU_DROP_SEARCH_HASH_SIZE) {
- goto next_page;
- }
+ /* Array full. We release the buf_pool->mutex to obey
+ the latching order. */
+ buf_pool_mutex_exit(buf_pool);
- /* Array full. We release the buf_pool->mutex to
- obey the latching order. */
- buf_pool_mutex_exit(buf_pool);
+ buf_LRU_drop_page_hash_batch(
+ id, zip_size, page_arr, num_entries);
- buf_LRU_drop_page_hash_batch(
- id, zip_size, page_arr, num_entries);
+ num_entries = 0;
- num_entries = 0;
+ buf_pool_mutex_enter(buf_pool);
- buf_pool_mutex_enter(buf_pool);
- } else {
- mutex_exit(block_mutex);
- }
+ /* Note that we released the buf_pool mutex above
+ after reading the prev_bpage during processing of a
+ page_hash_batch (i.e.: when the array was full).
+ Because prev_bpage could belong to a compressed-only
+ block, it may have been relocated, and thus the
+ pointer cannot be trusted. Because bpage is of type
+ buf_block_t, it is safe to dereference.
-next_page:
- /* Note that we may have released the buf_pool mutex
- above after reading the prev_bpage during processing
- of a page_hash_batch (i.e.: when the array was full).
- This means that prev_bpage can change in LRU list.
- This is OK because this function is a 'best effort'
- to drop as many search hash entries as possible and
- it does not guarantee that ALL such entries will be
- dropped. */
- bpage = prev_bpage;
+ bpage can change in the LRU list. This is OK because
+ this function is a 'best effort' to drop as many
+ search hash entries as possible and it does not
+ guarantee that ALL such entries will be dropped. */
/* If, however, bpage has been removed from LRU list
to the free list then we should restart the scan.
bpage->state is protected by buf_pool mutex. */
- if (bpage && !buf_page_in_file(bpage)) {
- ut_a(num_entries == 0);
+ if (bpage
+ && buf_page_get_state(bpage) != BUF_BLOCK_FILE_PAGE) {
goto scan_again;
}
}
@@ -356,8 +360,8 @@ scan_again:
prev_bpage = UT_LIST_GET_PREV(LRU, bpage);
/* bpage->space and bpage->io_fix are protected by
- buf_pool_mutex and block_mutex. It is safe to check
- them while holding buf_pool_mutex only. */
+ buf_pool->mutex and block_mutex. It is safe to check
+ them while holding buf_pool->mutex only. */
if (buf_page_get_space(bpage) != id) {
/* Skip this block, as it does not belong to
@@ -403,7 +407,7 @@ scan_again:
/* Descriptors of uncompressed
blocks will not be relocated,
because we are holding the
- buf_pool_mutex. */
+ buf_pool->mutex. */
break;
case BUF_BLOCK_ZIP_PAGE:
case BUF_BLOCK_ZIP_DIRTY:
@@ -603,7 +607,7 @@ buf_LRU_free_from_unzip_LRU_list(
ut_ad(block->page.in_LRU_list);
mutex_enter(&block->mutex);
- freed = buf_LRU_free_block(&block->page, FALSE, NULL);
+ freed = buf_LRU_free_block(&block->page, FALSE);
mutex_exit(&block->mutex);
switch (freed) {
@@ -666,7 +670,7 @@ buf_LRU_free_from_common_LRU_list(
mutex_enter(block_mutex);
accessed = buf_page_is_accessed(bpage);
- freed = buf_LRU_free_block(bpage, TRUE, NULL);
+ freed = buf_LRU_free_block(bpage, TRUE);
mutex_exit(block_mutex);
switch (freed) {
@@ -858,9 +862,7 @@ UNIV_INTERN
buf_block_t*
buf_LRU_get_free_block(
/*===================*/
- buf_pool_t* buf_pool, /*!< in: buffer pool instance */
- ulint zip_size) /*!< in: compressed page size in bytes,
- or 0 if uncompressed tablespace */
+ buf_pool_t* buf_pool) /*!< in/out: buffer pool instance */
{
buf_block_t* block = NULL;
ibool freed;
@@ -936,31 +938,11 @@ loop:
/* If there is a block in the free list, take it */
block = buf_LRU_get_free_only(buf_pool);
- if (block) {
+ buf_pool_mutex_exit(buf_pool);
+ if (block) {
ut_ad(buf_pool_from_block(block) == buf_pool);
-
-#ifdef UNIV_DEBUG
- block->page.zip.m_start =
-#endif /* UNIV_DEBUG */
- block->page.zip.m_end =
- block->page.zip.m_nonempty =
- block->page.zip.n_blobs = 0;
-
- if (UNIV_UNLIKELY(zip_size)) {
- ibool lru;
- page_zip_set_size(&block->page.zip, zip_size);
-
- block->page.zip.data = buf_buddy_alloc(
- buf_pool, zip_size, &lru);
-
- UNIV_MEM_DESC(block->page.zip.data, zip_size, block);
- } else {
- page_zip_set_size(&block->page.zip, 0);
- block->page.zip.data = NULL;
- }
-
- buf_pool_mutex_exit(buf_pool);
+ memset(&block->page.zip, 0, sizeof block->page.zip);
if (started_monitor) {
srv_print_innodb_monitor = mon_value_was;
@@ -972,8 +954,6 @@ loop:
/* If no block was in the free list, search from the end of the LRU
list and try to free a block there */
- buf_pool_mutex_exit(buf_pool);
-
freed = buf_LRU_search_and_free_block(buf_pool, n_iterations);
if (freed > 0) {
@@ -1443,10 +1423,10 @@ Try to free a block. If bpage is a descriptor of a compressed-only
page, the descriptor object will be freed as well.
NOTE: If this function returns BUF_LRU_FREED, it will temporarily
-release buf_pool_mutex. Furthermore, the page frame will no longer be
+release buf_pool->mutex. Furthermore, the page frame will no longer be
accessible via bpage.
-The caller must hold buf_pool_mutex and buf_page_get_mutex(bpage) and
+The caller must hold buf_pool->mutex and buf_page_get_mutex(bpage) and
release these two mutexes after the call. No other
buf_page_get_mutex() may be held when calling this function.
@return BUF_LRU_FREED if freed, BUF_LRU_CANNOT_RELOCATE or
@@ -1456,12 +1436,8 @@ enum buf_lru_free_block_status
buf_LRU_free_block(
/*===============*/
buf_page_t* bpage, /*!< in: block to be freed */
- ibool zip, /*!< in: TRUE if should remove also the
+ ibool zip) /*!< in: TRUE if should remove also the
compressed page of an uncompressed page */
- ibool* buf_pool_mutex_released)
- /*!< in: pointer to a variable that will
- be assigned TRUE if buf_pool_mutex
- was temporarily released, or NULL */
{
buf_page_t* b = NULL;
buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
@@ -1638,10 +1614,6 @@ alloc:
b->io_fix = BUF_IO_READ;
}
- if (buf_pool_mutex_released) {
- *buf_pool_mutex_released = TRUE;
- }
-
buf_pool_mutex_exit(buf_pool);
mutex_exit(block_mutex);
@@ -1921,6 +1893,7 @@ buf_LRU_block_remove_hashed_page(
buf_pool, bpage->zip.data,
page_zip_get_size(&bpage->zip));
+ bpage->state = BUF_BLOCK_ZIP_FREE;
buf_buddy_free(buf_pool, bpage, sizeof(*bpage));
buf_pool_mutex_exit_allow(buf_pool);
@@ -2076,6 +2049,7 @@ buf_LRU_stat_update(void)
buf_LRU_stat_t* item;
buf_pool_t* buf_pool;
ibool evict_started = FALSE;
+ buf_LRU_stat_t cur_stat;
/* If we haven't started eviction yet then don't update stats. */
for (i = 0; i < srv_buf_pool_instances; i++) {
@@ -2097,12 +2071,19 @@ buf_LRU_stat_update(void)
buf_LRU_stat_arr_ind++;
buf_LRU_stat_arr_ind %= BUF_LRU_STAT_N_INTERVAL;
- /* Add the current value and subtract the obsolete entry. */
- buf_LRU_stat_sum.io += buf_LRU_stat_cur.io - item->io;
- buf_LRU_stat_sum.unzip += buf_LRU_stat_cur.unzip - item->unzip;
+ /* Add the current value and subtract the obsolete entry.
+ Since buf_LRU_stat_cur is not protected by any mutex,
+ it can be changing between adding to buf_LRU_stat_sum
+ and copying to item. Assign it to local variables to make
+ sure the same value assign to the buf_LRU_stat_sum
+ and item */
+ cur_stat = buf_LRU_stat_cur;
+
+ buf_LRU_stat_sum.io += cur_stat.io - item->io;
+ buf_LRU_stat_sum.unzip += cur_stat.unzip - item->unzip;
/* Put current entry in the array. */
- memcpy(item, &buf_LRU_stat_cur, sizeof *item);
+ memcpy(item, &cur_stat, sizeof *item);
func_exit:
/* Clear the current entry. */
diff --git a/storage/innobase/buf/buf0rea.c b/storage/innobase/buf/buf0rea.c
index 82b45172988..eeaa21ae9ef 100644
--- a/storage/innobase/buf/buf0rea.c
+++ b/storage/innobase/buf/buf0rea.c
@@ -236,10 +236,10 @@ UNIV_INTERN
ulint
buf_read_ahead_linear(
/*==================*/
- ulint space, /*!< in: space id */
- ulint zip_size,/*!< in: compressed page size in bytes, or 0 */
- ulint offset) /*!< in: page number of a page; NOTE: the current thread
- must want access to this page (see NOTE 3 above) */
+ ulint space, /*!< in: space id */
+ ulint zip_size, /*!< in: compressed page size in bytes, or 0 */
+ ulint offset, /*!< in: page number; see NOTE 3 above */
+ ibool inside_ibuf) /*!< in: TRUE if we are inside ibuf routine */
{
buf_pool_t* buf_pool = buf_pool_get(space, offset);
ib_int64_t tablespace_version;
@@ -429,11 +429,9 @@ buf_read_ahead_linear(
/* If we got this far, read-ahead can be sensible: do it */
- if (ibuf_inside()) {
- ibuf_mode = BUF_READ_IBUF_PAGES_ONLY;
- } else {
- ibuf_mode = BUF_READ_ANY_PAGE;
- }
+ ibuf_mode = inside_ibuf
+ ? BUF_READ_IBUF_PAGES_ONLY | OS_AIO_SIMULATED_WAKE_LATER
+ : BUF_READ_ANY_PAGE | OS_AIO_SIMULATED_WAKE_LATER;
count = 0;
@@ -450,7 +448,7 @@ buf_read_ahead_linear(
if (!ibuf_bitmap_page(zip_size, i)) {
count += buf_read_page_low(
&err, FALSE,
- ibuf_mode | OS_AIO_SIMULATED_WAKE_LATER,
+ ibuf_mode,
space, zip_size, FALSE, tablespace_version, i);
if (err == DB_TABLESPACE_DELETED) {
ut_print_timestamp(stderr);
@@ -520,7 +518,6 @@ buf_read_ibuf_merge_pages(
{
ulint i;
- ut_ad(!ibuf_inside());
#ifdef UNIV_IBUF_DEBUG
ut_a(n_stored < UNIV_PAGE_SIZE);
#endif
@@ -530,7 +527,7 @@ buf_read_ibuf_merge_pages(
buf_pool_t* buf_pool;
ulint zip_size = fil_space_get_zip_size(space_ids[i]);
- buf_pool = buf_pool_get(space_ids[i], space_versions[i]);
+ buf_pool = buf_pool_get(space_ids[i], page_nos[i]);
while (buf_pool->n_pend_reads
> buf_pool->curr_size / BUF_READ_AHEAD_PEND_LIMIT) {
diff --git a/storage/innobase/compile-innodb b/storage/innobase/compile-innodb
index 23e7f98e50c..988c862465d 100755
--- a/storage/innobase/compile-innodb
+++ b/storage/innobase/compile-innodb
@@ -22,4 +22,4 @@ MYSQL_ROOT="$(dirname ${0})/../.."
cd ${MYSQL_ROOT}
cmake -DWITH_INNOBASE_STORAGE_ENGINE:BOOL=ON
-make -j4
+make -j$(nproc)
diff --git a/storage/innobase/data/data0data.c b/storage/innobase/data/data0data.c
index 0ef0cfa554a..6d07fc249fa 100644
--- a/storage/innobase/data/data0data.c
+++ b/storage/innobase/data/data0data.c
@@ -585,7 +585,8 @@ dtuple_convert_big_rec(
if (dict_table_get_format(index->table) < DICT_TF_FORMAT_ZIP) {
/* up to MySQL 5.1: store a 768-byte prefix locally */
- local_len = BTR_EXTERN_FIELD_REF_SIZE + DICT_MAX_INDEX_COL_LEN;
+ local_len = BTR_EXTERN_FIELD_REF_SIZE
+ + DICT_ANTELOPE_MAX_INDEX_COL_LEN;
} else {
/* new-format table: do not store any BLOB prefix locally */
local_len = BTR_EXTERN_FIELD_REF_SIZE;
@@ -757,7 +758,10 @@ dtuple_convert_back_big_rec(
local_len -= BTR_EXTERN_FIELD_REF_SIZE;
- ut_ad(local_len <= DICT_MAX_INDEX_COL_LEN);
+ /* Only in REDUNDANT and COMPACT format, we store
+ up to DICT_ANTELOPE_MAX_INDEX_COL_LEN (768) bytes
+ locally */
+ ut_ad(local_len <= DICT_ANTELOPE_MAX_INDEX_COL_LEN);
dfield_set_data(dfield,
(char*) b->data - local_len,
diff --git a/storage/innobase/dict/dict0crea.c b/storage/innobase/dict/dict0crea.c
index 1a332ea9329..9a528d679a7 100644
--- a/storage/innobase/dict/dict0crea.c
+++ b/storage/innobase/dict/dict0crea.c
@@ -659,9 +659,9 @@ dict_create_index_tree_step(
/* printf("Created a new index tree in space %lu root page %lu\n",
index->space, index->page_no); */
- page_rec_write_index_page_no(btr_pcur_get_rec(&pcur),
- DICT_SYS_INDEXES_PAGE_NO_FIELD,
- node->page_no, &mtr);
+ page_rec_write_field(btr_pcur_get_rec(&pcur),
+ DICT_SYS_INDEXES_PAGE_NO_FIELD,
+ node->page_no, &mtr);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@@ -731,9 +731,8 @@ dict_drop_index_tree(
root_page_no); */
btr_free_root(space, zip_size, root_page_no, mtr);
- page_rec_write_index_page_no(rec,
- DICT_SYS_INDEXES_PAGE_NO_FIELD,
- FIL_NULL, mtr);
+ page_rec_write_field(rec, DICT_SYS_INDEXES_PAGE_NO_FIELD,
+ FIL_NULL, mtr);
}
/*******************************************************************//**
@@ -828,7 +827,7 @@ dict_truncate_index_tree(
appropriate field in the SYS_INDEXES record: this mini-transaction
marks the B-tree totally truncated */
- btr_page_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
+ btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
btr_free_root(space, zip_size, root_page_no, mtr);
create:
@@ -836,8 +835,8 @@ create:
in SYS_INDEXES, so that the database will not get into an
inconsistent state in case it crashes between the mtr_commit()
below and the following mtr_commit() call. */
- page_rec_write_index_page_no(rec, DICT_SYS_INDEXES_PAGE_NO_FIELD,
- FIL_NULL, mtr);
+ page_rec_write_field(rec, DICT_SYS_INDEXES_PAGE_NO_FIELD,
+ FIL_NULL, mtr);
/* We will need to commit the mini-transaction in order to avoid
deadlocks in the btr_create() call, because otherwise we would
diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
index 6c9182b1242..1e3aed92cf7 100644
--- a/storage/innobase/dict/dict0dict.c
+++ b/storage/innobase/dict/dict0dict.c
@@ -53,7 +53,7 @@ UNIV_INTERN dict_index_t* dict_ind_compact;
#include "rem0cmp.h"
#include "row0merge.h"
#include "m_ctype.h" /* my_isspace() */
-#include "ha_prototypes.h" /* innobase_strcasecmp() */
+#include "ha_prototypes.h" /* innobase_strcasecmp(), innobase_casedn_str()*/
#include <ctype.h>
@@ -74,6 +74,7 @@ UNIV_INTERN rw_lock_t dict_operation_lock;
#ifdef UNIV_PFS_RWLOCK
UNIV_INTERN mysql_pfs_key_t dict_operation_lock_key;
UNIV_INTERN mysql_pfs_key_t index_tree_rw_lock_key;
+UNIV_INTERN mysql_pfs_key_t dict_table_stats_latch_key;
#endif /* UNIV_PFS_RWLOCK */
#ifdef UNIV_PFS_MUTEX
@@ -91,9 +92,18 @@ UNIV_INTERN mysql_pfs_key_t dict_foreign_err_mutex_key;
/** Identifies generated InnoDB foreign key names */
static char dict_ibfk[] = "_ibfk_";
-/** array of mutexes protecting dict_index_t::stat_n_diff_key_vals[] */
-#define DICT_INDEX_STAT_MUTEX_SIZE 32
-mutex_t dict_index_stat_mutex[DICT_INDEX_STAT_MUTEX_SIZE];
+/** array of rw locks protecting
+dict_table_t::stat_initialized
+dict_table_t::stat_n_rows (*)
+dict_table_t::stat_clustered_index_size
+dict_table_t::stat_sum_of_other_index_sizes
+dict_table_t::stat_modified_counter (*)
+dict_table_t::indexes*::stat_n_diff_key_vals[]
+dict_table_t::indexes*::stat_index_size
+dict_table_t::indexes*::stat_n_leaf_pages
+(*) those are not always protected for performance reasons */
+#define DICT_TABLE_STATS_LATCHES_SIZE 64
+static rw_lock_t dict_table_stats_latches[DICT_TABLE_STATS_LATCHES_SIZE];
/*******************************************************************//**
Tries to find column names for the index and sets the col field of the
@@ -254,43 +264,65 @@ dict_mutex_exit_for_mysql(void)
mutex_exit(&(dict_sys->mutex));
}
-/** Get the mutex that protects index->stat_n_diff_key_vals[] */
-#define GET_INDEX_STAT_MUTEX(index) \
- (&dict_index_stat_mutex[ut_fold_ull(index->id) \
- % DICT_INDEX_STAT_MUTEX_SIZE])
+/** Get the latch that protects the stats of a given table */
+#define GET_TABLE_STATS_LATCH(table) \
+ (&dict_table_stats_latches[ut_fold_ull(table->id) \
+ % DICT_TABLE_STATS_LATCHES_SIZE])
/**********************************************************************//**
-Lock the appropriate mutex to protect index->stat_n_diff_key_vals[].
-index->id is used to pick the right mutex and it should not change
-before dict_index_stat_mutex_exit() is called on this index. */
+Lock the appropriate latch to protect a given table's statistics.
+table->id is used to pick the corresponding latch from a global array of
+latches. */
UNIV_INTERN
void
-dict_index_stat_mutex_enter(
-/*========================*/
- const dict_index_t* index) /*!< in: index */
+dict_table_stats_lock(
+/*==================*/
+ const dict_table_t* table, /*!< in: table */
+ ulint latch_mode) /*!< in: RW_S_LATCH or
+ RW_X_LATCH */
{
- ut_ad(index != NULL);
- ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
- ut_ad(index->cached);
- ut_ad(!index->to_be_dropped);
+ ut_ad(table != NULL);
+ ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
- mutex_enter(GET_INDEX_STAT_MUTEX(index));
+ switch (latch_mode) {
+ case RW_S_LATCH:
+ rw_lock_s_lock(GET_TABLE_STATS_LATCH(table));
+ break;
+ case RW_X_LATCH:
+ rw_lock_x_lock(GET_TABLE_STATS_LATCH(table));
+ break;
+ case RW_NO_LATCH:
+ /* fall through */
+ default:
+ ut_error;
+ }
}
/**********************************************************************//**
-Unlock the appropriate mutex that protects index->stat_n_diff_key_vals[]. */
+Unlock the latch that has been locked by dict_table_stats_lock() */
UNIV_INTERN
void
-dict_index_stat_mutex_exit(
-/*=======================*/
- const dict_index_t* index) /*!< in: index */
+dict_table_stats_unlock(
+/*====================*/
+ const dict_table_t* table, /*!< in: table */
+ ulint latch_mode) /*!< in: RW_S_LATCH or
+ RW_X_LATCH */
{
- ut_ad(index != NULL);
- ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
- ut_ad(index->cached);
- ut_ad(!index->to_be_dropped);
+ ut_ad(table != NULL);
+ ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
- mutex_exit(GET_INDEX_STAT_MUTEX(index));
+ switch (latch_mode) {
+ case RW_S_LATCH:
+ rw_lock_s_unlock(GET_TABLE_STATS_LATCH(table));
+ break;
+ case RW_X_LATCH:
+ rw_lock_x_unlock(GET_TABLE_STATS_LATCH(table));
+ break;
+ case RW_NO_LATCH:
+ /* fall through */
+ default:
+ ut_error;
+ }
}
/********************************************************************//**
@@ -682,9 +714,9 @@ dict_init(void)
mutex_create(dict_foreign_err_mutex_key,
&dict_foreign_err_mutex, SYNC_ANY_LATCH);
- for (i = 0; i < DICT_INDEX_STAT_MUTEX_SIZE; i++) {
- mutex_create(PFS_NOT_INSTRUMENTED,
- &dict_index_stat_mutex[i], SYNC_INDEX_TREE);
+ for (i = 0; i < DICT_TABLE_STATS_LATCHES_SIZE; i++) {
+ rw_lock_create(dict_table_stats_latch_key,
+ &dict_table_stats_latches[i], SYNC_INDEX_TREE);
}
}
@@ -715,12 +747,11 @@ dict_table_get(
mutex_exit(&(dict_sys->mutex));
if (table != NULL) {
- if (!table->stat_initialized) {
- /* If table->ibd_file_missing == TRUE, this will
- print an error message and return without doing
- anything. */
- dict_update_statistics(table);
- }
+ /* If table->ibd_file_missing == TRUE, this will
+ print an error message and return without doing
+ anything. */
+ dict_update_statistics(table, TRUE /* only update stats
+ if they have not been initialized */);
}
return(table);
@@ -917,7 +948,7 @@ dict_table_rename_in_cache(
dict_foreign_t* foreign;
dict_index_t* index;
ulint fold;
- char old_name[MAX_TABLE_NAME_LEN + 1];
+ char old_name[MAX_FULL_NAME_LEN + 1];
ut_ad(table);
ut_ad(mutex_own(&(dict_sys->mutex)));
@@ -929,7 +960,7 @@ dict_table_rename_in_cache(
ut_print_timestamp(stderr);
fprintf(stderr, "InnoDB: too long table name: '%s', "
"max length is %d\n", table->name,
- MAX_TABLE_NAME_LEN);
+ MAX_FULL_NAME_LEN);
ut_error;
}
@@ -979,11 +1010,11 @@ dict_table_rename_in_cache(
ut_fold_string(old_name), table);
if (strlen(new_name) > strlen(table->name)) {
- /* We allocate MAX_TABLE_NAME_LEN+1 bytes here to avoid
+ /* We allocate MAX_FULL_NAME_LEN + 1 bytes here to avoid
memory fragmentation, we assume a repeated calls of
ut_realloc() with the same size do not cause fragmentation */
- ut_a(strlen(new_name) <= MAX_TABLE_NAME_LEN);
- table->name = ut_realloc(table->name, MAX_TABLE_NAME_LEN + 1);
+ ut_a(strlen(new_name) <= MAX_FULL_NAME_LEN);
+ table->name = ut_realloc(table->name, MAX_FULL_NAME_LEN + 1);
}
memcpy(table->name, new_name, strlen(new_name) + 1);
@@ -1050,13 +1081,13 @@ dict_table_rename_in_cache(
/* Allocate a longer name buffer;
TODO: store buf len to save memory */
- foreign->foreign_table_name
- = mem_heap_alloc(foreign->heap,
- ut_strlen(table->name) + 1);
+ foreign->foreign_table_name = mem_heap_strdup(
+ foreign->heap, table->name);
+ dict_mem_foreign_table_name_lookup_set(foreign, TRUE);
+ } else {
+ strcpy(foreign->foreign_table_name, table->name);
+ dict_mem_foreign_table_name_lookup_set(foreign, FALSE);
}
-
- strcpy(foreign->foreign_table_name, table->name);
-
if (strchr(foreign->id, '/')) {
ulint db_len;
char* old_id;
@@ -1122,12 +1153,14 @@ dict_table_rename_in_cache(
/* Allocate a longer name buffer;
TODO: store buf len to save memory */
- foreign->referenced_table_name = mem_heap_alloc(
- foreign->heap, strlen(table->name) + 1);
+ foreign->referenced_table_name = mem_heap_strdup(
+ foreign->heap, table->name);
+ dict_mem_referenced_table_name_lookup_set(foreign, TRUE);
+ } else {
+ /* Use the same buffer */
+ strcpy(foreign->referenced_table_name, table->name);
+ dict_mem_referenced_table_name_lookup_set(foreign, FALSE);
}
-
- strcpy(foreign->referenced_table_name, table->name);
-
foreign = UT_LIST_GET_NEXT(referenced_list, foreign);
}
@@ -1319,36 +1352,63 @@ dict_index_too_big_for_undo(
ulint fixed_size
= dict_col_get_fixed_size(col,
dict_table_is_comp(table));
+ ulint max_prefix
+ = col->max_prefix;
if (fixed_size) {
/* Fixed-size columns are stored locally. */
max_size = fixed_size;
} else if (max_size <= BTR_EXTERN_FIELD_REF_SIZE * 2) {
/* Short columns are stored locally. */
- } else if (!col->ord_part) {
+ } else if (!col->ord_part
+ || (col->max_prefix
+ < (ulint) DICT_MAX_FIELD_LEN_BY_FORMAT(table))) {
/* See if col->ord_part would be set
- because of new_index. */
+ because of new_index. Also check if the new
+ index could have longer prefix on columns
+ that already had ord_part set */
ulint j;
for (j = 0; j < new_index->n_uniq; j++) {
if (dict_index_get_nth_col(
new_index, j) == col) {
+ const dict_field_t* field
+ = dict_index_get_nth_field(
+ new_index, j);
+
+ if (field->prefix_len
+ > col->max_prefix) {
+ max_prefix =
+ field->prefix_len;
+ }
goto is_ord_part;
}
}
+ if (col->ord_part) {
+ goto is_ord_part;
+ }
+
/* This is not an ordering column in any index.
Thus, it can be stored completely externally. */
max_size = BTR_EXTERN_FIELD_REF_SIZE;
} else {
+ ulint max_field_len;
is_ord_part:
+ max_field_len = DICT_MAX_FIELD_LEN_BY_FORMAT(table);
+
/* This is an ordering column in some index.
A long enough prefix must be written to the
undo log. See trx_undo_page_fetch_ext(). */
+ max_size = ut_min(max_size, max_field_len);
+
+ /* We only store the needed prefix length in undo log */
+ if (max_prefix) {
+ ut_ad(dict_table_get_format(table)
+ >= DICT_TF_FORMAT_ZIP);
- if (max_size > REC_MAX_INDEX_COL_LEN) {
- max_size = REC_MAX_INDEX_COL_LEN;
+ max_size = ut_min(max_prefix, max_size);
}
max_size += BTR_EXTERN_FIELD_REF_SIZE;
@@ -1602,15 +1662,16 @@ too_big:
/* In dtuple_convert_big_rec(), variable-length columns
that are longer than BTR_EXTERN_FIELD_REF_SIZE * 2
may be chosen for external storage. If the column appears
- in an ordering column of an index, a longer prefix of
- REC_MAX_INDEX_COL_LEN will be copied to the undo log
- by trx_undo_page_report_modify() and
+ in an ordering column of an index, a longer prefix determined
+ by dict_max_field_len_store_undo() will be copied to the undo
+ log by trx_undo_page_report_modify() and
trx_undo_page_fetch_ext(). It suffices to check the
capacity of the undo log whenever new_index includes
a column prefix on a column that may be stored externally. */
if (field->prefix_len /* prefix index */
- && !col->ord_part /* not yet ordering column */
+ && (!col->ord_part /* not yet ordering column */
+ || field->prefix_len > col->max_prefix)
&& !dict_col_get_fixed_size(col, TRUE) /* variable-length */
&& dict_col_get_max_size(col)
> BTR_EXTERN_FIELD_REF_SIZE * 2 /* long enough */) {
@@ -1627,11 +1688,17 @@ too_big:
}
undo_size_ok:
- /* Flag the ordering columns */
+ /* Flag the ordering columns and also set column max_prefix */
for (i = 0; i < n_ord; i++) {
+ const dict_field_t* field
+ = dict_index_get_nth_field(new_index, i);
+
+ field->col->ord_part = 1;
- dict_index_get_nth_field(new_index, i)->col->ord_part = 1;
+ if (field->prefix_len > field->col->max_prefix) {
+ field->col->max_prefix = field->prefix_len;
+ }
}
/* Add the new index as the last index for the table */
@@ -1655,6 +1722,12 @@ undo_size_ok:
new_index->heap,
(1 + dict_index_get_n_unique(new_index))
* sizeof(ib_int64_t));
+
+ new_index->stat_n_non_null_key_vals = mem_heap_zalloc(
+ new_index->heap,
+ (1 + dict_index_get_n_unique(new_index))
+ * sizeof(*new_index->stat_n_non_null_key_vals));
+
/* Give some sensible values to stat_n_... in case we do
not calculate statistics quickly enough */
@@ -1828,14 +1901,14 @@ dict_index_add_col(
variable-length fields, so that the extern flag can be embedded in
the length word. */
- if (field->fixed_len > DICT_MAX_INDEX_COL_LEN) {
+ if (field->fixed_len > DICT_MAX_FIXED_COL_LEN) {
field->fixed_len = 0;
}
-#if DICT_MAX_INDEX_COL_LEN != 768
+#if DICT_MAX_FIXED_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"
+# error "DICT_MAX_FIXED_COL_LEN != 768"
#endif
if (!(col->prtype & DATA_NOT_NULL)) {
@@ -2553,10 +2626,10 @@ dict_foreign_add_to_cache(
ut_ad(mutex_own(&(dict_sys->mutex)));
for_table = dict_table_check_if_in_cache_low(
- foreign->foreign_table_name);
+ foreign->foreign_table_name_lookup);
ref_table = dict_table_check_if_in_cache_low(
- foreign->referenced_table_name);
+ foreign->referenced_table_name_lookup);
ut_a(for_table || ref_table);
if (for_table) {
@@ -2673,7 +2746,7 @@ dict_scan_to(
quote = '\0';
} else if (quote) {
/* Within quotes: do nothing. */
- } else if (*ptr == '`' || *ptr == '"') {
+ } else if (*ptr == '`' || *ptr == '"' || *ptr == '\'') {
/* Starting quote: remember the quote character. */
quote = *ptr;
} else {
@@ -2985,19 +3058,25 @@ dict_scan_table_name(
memcpy(ref, database_name, database_name_len);
ref[database_name_len] = '/';
memcpy(ref + database_name_len + 1, table_name, table_name_len + 1);
-#ifndef __WIN__
- if (srv_lower_case_table_names) {
-#endif /* !__WIN__ */
- /* The table name is always put to lower case on Windows. */
+
+ /* Values; 0 = Store and compare as given; case sensitive
+ 1 = Store and compare in lower; case insensitive
+ 2 = Store as given, compare in lower; case semi-sensitive */
+ if (innobase_get_lower_case_table_names() == 2) {
innobase_casedn_str(ref);
-#ifndef __WIN__
+ *table = dict_table_get_low(ref);
+ memcpy(ref, database_name, database_name_len);
+ ref[database_name_len] = '/';
+ memcpy(ref + database_name_len + 1, table_name, table_name_len + 1);
+ } else {
+ if (innobase_get_lower_case_table_names() == 1) {
+ innobase_casedn_str(ref);
+ }
+ *table = dict_table_get_low(ref);
}
-#endif /* !__WIN__ */
*success = TRUE;
*ref_name = ref;
- *table = dict_table_get_low(ref);
-
return(ptr);
}
@@ -3453,7 +3532,7 @@ col_loop1:
start_of_latest_foreign);
mutex_exit(&dict_foreign_err_mutex);
- return(DB_CANNOT_ADD_CONSTRAINT);
+ return(DB_CHILD_NO_INDEX);
}
ptr = dict_accept(cs, ptr, "REFERENCES", &success);
@@ -3486,8 +3565,10 @@ col_loop1:
}
foreign->foreign_table = table;
- foreign->foreign_table_name = mem_heap_strdup(foreign->heap,
- table->name);
+ foreign->foreign_table_name = mem_heap_strdup(
+ foreign->heap, table->name);
+ dict_mem_foreign_table_name_lookup_set(foreign, TRUE);
+
foreign->foreign_index = index;
foreign->n_fields = (unsigned int) i;
foreign->foreign_col_names = mem_heap_alloc(foreign->heap,
@@ -3734,7 +3815,7 @@ try_find_index:
start_of_latest_foreign);
mutex_exit(&dict_foreign_err_mutex);
- return(DB_CANNOT_ADD_CONSTRAINT);
+ return(DB_PARENT_NO_INDEX);
}
} else {
ut_a(trx->check_foreigns == FALSE);
@@ -3744,8 +3825,9 @@ try_find_index:
foreign->referenced_index = index;
foreign->referenced_table = referenced_table;
- foreign->referenced_table_name
- = mem_heap_strdup(foreign->heap, referenced_table_name);
+ foreign->referenced_table_name = mem_heap_strdup(
+ foreign->heap, referenced_table_name);
+ dict_mem_referenced_table_name_lookup_set(foreign, TRUE);
foreign->referenced_col_names = mem_heap_alloc(foreign->heap,
i * sizeof(void*));
@@ -4198,15 +4280,15 @@ Calculates new estimates for table and index statistics. The statistics
are used in query optimization. */
UNIV_INTERN
void
-dict_update_statistics_low(
-/*=======================*/
+dict_update_statistics(
+/*===================*/
dict_table_t* table, /*!< in/out: table */
- ibool has_dict_mutex __attribute__((unused)))
- /*!< in: TRUE if the caller has the
- dictionary mutex */
+ ibool only_calc_if_missing_stats)/*!< in: only
+ update/recalc the stats if they have
+ not been initialized yet, otherwise
+ do nothing */
{
dict_index_t* index;
- ulint size;
ulint sum_of_index_sizes = 0;
if (table->ibd_file_missing) {
@@ -4221,14 +4303,6 @@ dict_update_statistics_low(
return;
}
- /* If we have set a high innodb_force_recovery level, do not calculate
- statistics, as a badly corrupted index can cause a crash in it. */
-
- if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
-
- return;
- }
-
/* Find out the sizes of the indexes and how many different values
for the key they approximately have */
@@ -4240,36 +4314,64 @@ dict_update_statistics_low(
return;
}
- while (index) {
- size = btr_get_size(index, BTR_TOTAL_SIZE);
+ dict_table_stats_lock(table, RW_X_LATCH);
- index->stat_index_size = size;
+ if (only_calc_if_missing_stats && table->stat_initialized) {
+ dict_table_stats_unlock(table, RW_X_LATCH);
+ return;
+ }
- sum_of_index_sizes += size;
+ do {
+ if (UNIV_LIKELY
+ (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE
+ || (srv_force_recovery < SRV_FORCE_NO_LOG_REDO
+ && dict_index_is_clust(index)))) {
+ ulint size;
+ size = btr_get_size(index, BTR_TOTAL_SIZE);
- size = btr_get_size(index, BTR_N_LEAF_PAGES);
+ index->stat_index_size = size;
- if (size == 0) {
- /* The root node of the tree is a leaf */
- size = 1;
- }
+ sum_of_index_sizes += size;
- index->stat_n_leaf_pages = size;
+ size = btr_get_size(index, BTR_N_LEAF_PAGES);
+
+ if (size == 0) {
+ /* The root node of the tree is a leaf */
+ size = 1;
+ }
+
+ index->stat_n_leaf_pages = size;
+
+ btr_estimate_number_of_different_key_vals(index);
+ } else {
+ /* If we have set a high innodb_force_recovery
+ level, do not calculate statistics, as a badly
+ corrupted index can cause a crash in it.
+ Initialize some bogus index cardinality
+ statistics, so that the data can be queried in
+ various means, also via secondary indexes. */
+ ulint i;
- btr_estimate_number_of_different_key_vals(index);
+ sum_of_index_sizes++;
+ index->stat_index_size = index->stat_n_leaf_pages = 1;
+
+ for (i = dict_index_get_n_unique(index); i; ) {
+ index->stat_n_diff_key_vals[i--] = 1;
+ }
+
+ memset(index->stat_n_non_null_key_vals, 0,
+ (1 + dict_index_get_n_unique(index))
+ * sizeof(*index->stat_n_non_null_key_vals));
+ }
index = dict_table_get_next_index(index);
- }
+ } while (index);
index = dict_table_get_first_index(table);
- dict_index_stat_mutex_enter(index);
-
table->stat_n_rows = index->stat_n_diff_key_vals[
dict_index_get_n_unique(index)];
- dict_index_stat_mutex_exit(index);
-
table->stat_clustered_index_size = index->stat_index_size;
table->stat_sum_of_other_index_sizes = sum_of_index_sizes
@@ -4278,18 +4380,8 @@ dict_update_statistics_low(
table->stat_initialized = TRUE;
table->stat_modified_counter = 0;
-}
-/*********************************************************************//**
-Calculates new estimates for table and index statistics. The statistics
-are used in query optimization. */
-UNIV_INTERN
-void
-dict_update_statistics(
-/*===================*/
- dict_table_t* table) /*!< in/out: table */
-{
- dict_update_statistics_low(table, FALSE);
+ dict_table_stats_unlock(table, RW_X_LATCH);
}
/**********************************************************************//**
@@ -4369,7 +4461,9 @@ dict_table_print_low(
ut_ad(mutex_own(&(dict_sys->mutex)));
- dict_update_statistics_low(table, TRUE);
+ dict_update_statistics(table, FALSE /* update even if initialized */);
+
+ dict_table_stats_lock(table, RW_S_LATCH);
fprintf(stderr,
"--------------------------------------\n"
@@ -4397,6 +4491,8 @@ dict_table_print_low(
index = UT_LIST_GET_NEXT(indexes, index);
}
+ dict_table_stats_unlock(table, RW_S_LATCH);
+
foreign = UT_LIST_GET_FIRST(table->foreign_list);
while (foreign != NULL) {
@@ -4445,8 +4541,6 @@ dict_index_print_low(
ut_ad(mutex_own(&(dict_sys->mutex)));
- dict_index_stat_mutex_enter(index);
-
if (index->n_user_defined_cols > 0) {
n_vals = index->stat_n_diff_key_vals[
index->n_user_defined_cols];
@@ -4454,8 +4548,6 @@ dict_index_print_low(
n_vals = index->stat_n_diff_key_vals[1];
}
- dict_index_stat_mutex_exit(index);
-
fprintf(stderr,
" INDEX: name %s, id %llu, fields %lu/%lu,"
" uniq %lu, type %lu\n"
@@ -4550,8 +4642,8 @@ dict_print_info_on_foreign_key_in_create_format(
fputs(") REFERENCES ", file);
- if (dict_tables_have_same_db(foreign->foreign_table_name,
- foreign->referenced_table_name)) {
+ if (dict_tables_have_same_db(foreign->foreign_table_name_lookup,
+ foreign->referenced_table_name_lookup)) {
/* Do not print the database name of the referenced table */
ut_print_name(file, trx, TRUE,
dict_remove_db_name(
@@ -4798,7 +4890,8 @@ void
dict_table_replace_index_in_foreign_list(
/*=====================================*/
dict_table_t* table, /*!< in/out: table */
- dict_index_t* index) /*!< in: index to be replaced */
+ dict_index_t* index, /*!< in: index to be replaced */
+ const trx_t* trx) /*!< in: transaction handle */
{
dict_foreign_t* foreign;
@@ -4809,7 +4902,13 @@ dict_table_replace_index_in_foreign_list(
if (foreign->foreign_index == index) {
dict_index_t* new_index
= dict_foreign_find_equiv_index(foreign);
- ut_a(new_index);
+
+ /* There must exist an alternative index if
+ check_foreigns (FOREIGN_KEY_CHECKS) is on,
+ since ha_innobase::prepare_drop_index had done
+ the check before we reach here. */
+
+ ut_a(new_index || !trx->check_foreigns);
foreign->foreign_index = new_index;
}
@@ -4942,8 +5041,8 @@ dict_close(void)
mem_free(dict_sys);
dict_sys = NULL;
- for (i = 0; i < DICT_INDEX_STAT_MUTEX_SIZE; i++) {
- mutex_free(&dict_index_stat_mutex[i]);
+ for (i = 0; i < DICT_TABLE_STATS_LATCHES_SIZE; i++) {
+ rw_lock_free(&dict_table_stats_latches[i]);
}
}
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/innobase/dict/dict0load.c b/storage/innobase/dict/dict0load.c
index 3caa05891b4..a76f1f93202 100644
--- a/storage/innobase/dict/dict0load.c
+++ b/storage/innobase/dict/dict0load.c
@@ -40,6 +40,7 @@ Created 4/24/1996 Heikki Tuuri
#include "rem0cmp.h"
#include "srv0start.h"
#include "srv0srv.h"
+#include "ha_prototypes.h" /* innobase_casedn_str() */
/** Following are six InnoDB system tables */
@@ -346,7 +347,8 @@ dict_process_sys_tables_rec(
/* Update statistics if DICT_TABLE_UPDATE_STATS
is set */
- dict_update_statistics_low(*table, TRUE);
+ dict_update_statistics(*table, FALSE /* update even if
+ initialized */);
}
return(NULL);
@@ -427,17 +429,19 @@ dict_process_sys_fields_rec(
mach_write_to_8(last_index_id, last_id);
err_msg = dict_load_field_low(buf, NULL, sys_field,
- pos, last_index_id, heap, rec);
+ pos, last_index_id, heap, rec, NULL, 0);
*index_id = mach_read_from_8(buf);
return(err_msg);
}
+
+#ifdef FOREIGN_NOT_USED
/********************************************************************//**
This function parses a SYS_FOREIGN record and populate a dict_foreign_t
structure with the information from the record. For detail information
-about SYS_FOREIGN fields, please refer to dict_load_foreign() function
+about SYS_FOREIGN fields, please refer to dict_load_foreign() function.
@return error message, or NULL on success */
UNIV_INTERN
const char*
@@ -465,6 +469,11 @@ dict_process_sys_foreign_rec(
err_len:
return("incorrect column length in SYS_FOREIGN");
}
+
+ /* This recieves a dict_foreign_t* that points to a stack variable.
+ So mem_heap_free(foreign->heap) is not used as elsewhere.
+ Since the heap used here is freed elsewhere, foreign->heap
+ is not assigned. */
foreign->id = mem_heap_strdupl(heap, (const char*) field, len);
rec_get_nth_field_offs_old(rec, 1/*DB_TRX_ID*/, &len);
@@ -476,6 +485,9 @@ err_len:
goto err_len;
}
+ /* The _lookup versions of the referenced and foreign table names
+ are not assigned since they are not used in this dict_foreign_t */
+
field = rec_get_nth_field_old(rec, 3/*FOR_NAME*/, &len);
if (UNIV_UNLIKELY(len < 1 || len == UNIV_SQL_NULL)) {
goto err_len;
@@ -501,6 +513,9 @@ err_len:
return(NULL);
}
+#endif /* FOREIGN_NOT_USED */
+
+#ifdef FOREIGN_NOT_USED
/********************************************************************//**
This function parses a SYS_FOREIGN_COLS record and extract necessary
information from the record and return to caller.
@@ -564,6 +579,8 @@ err_len:
return(NULL);
}
+#endif /* FOREIGN_NOT_USED */
+
/********************************************************************//**
Determine the flags of a table described in SYS_TABLES.
@return compressed page size in kilobytes; or 0 if the tablespace is
@@ -977,6 +994,9 @@ dict_load_columns(
/** Error message for a delete-marked record in dict_load_field_low() */
static const char* dict_load_field_del = "delete-marked record in SYS_FIELDS";
+static const char* dict_load_field_too_big = "column prefix exceeds maximum"
+ " limit";
+
/********************************************************************//**
Loads an index field definition from a SYS_FIELDS record to
dict_index_t.
@@ -998,7 +1018,12 @@ dict_load_field_low(
byte* last_index_id, /*!< in: last index id */
mem_heap_t* heap, /*!< in/out: memory heap
for temporary storage */
- const rec_t* rec) /*!< in: SYS_FIELDS record */
+ const rec_t* rec, /*!< in: SYS_FIELDS record */
+ char* addition_err_str,/*!< out: additional error message
+ that requires information to be
+ filled, or NULL */
+ ulint err_str_len) /*!< in: length of addition_err_str
+ in bytes */
{
const byte* field;
ulint len;
@@ -1078,6 +1103,19 @@ err_len:
goto err_len;
}
+ if (prefix_len > REC_VERSION_56_MAX_INDEX_COL_LEN) {
+ if (addition_err_str) {
+ ut_snprintf(addition_err_str, err_str_len,
+ "index field '%s' has a prefix length"
+ " of %lu bytes",
+ mem_heap_strdupl(
+ heap, (const char*) field, len),
+ (ulong) prefix_len);
+ }
+
+ return(dict_load_field_too_big);
+ }
+
if (index) {
dict_mem_index_add_field(
index, mem_heap_strdupl(heap, (const char*) field, len),
@@ -1137,14 +1175,16 @@ dict_load_fields(
btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
BTR_SEARCH_LEAF, &pcur, &mtr);
for (i = 0; i < index->n_fields; i++) {
- const char* err_msg;
+ const char* err_msg;
+ char addition_err_str[1024];
rec = btr_pcur_get_rec(&pcur);
ut_a(btr_pcur_is_on_user_rec(&pcur));
err_msg = dict_load_field_low(buf, index, NULL, NULL, NULL,
- heap, rec);
+ heap, rec, addition_err_str,
+ sizeof(addition_err_str));
if (err_msg == dict_load_field_del) {
/* There could be delete marked records in
@@ -1153,7 +1193,24 @@ dict_load_fields(
goto next_rec;
} else if (err_msg) {
- fprintf(stderr, "InnoDB: %s\n", err_msg);
+ if (err_msg == dict_load_field_too_big) {
+ fprintf(stderr, "InnoDB: Error: load index"
+ " '%s' failed.\n"
+ "InnoDB: %s,\n"
+ "InnoDB: which exceeds the"
+ " maximum limit of %lu bytes.\n"
+ "InnoDB: Please use server that"
+ " supports long index prefix\n"
+ "InnoDB: or turn on"
+ " innodb_force_recovery to load"
+ " the table\n",
+ index->name, addition_err_str,
+ (ulong) (REC_VERSION_56_MAX_INDEX_COL_LEN));
+
+ } else {
+ fprintf(stderr, "InnoDB: %s\n", err_msg);
+ }
+
error = DB_CORRUPTION;
goto func_exit;
}
@@ -1306,7 +1363,10 @@ ulint
dict_load_indexes(
/*==============*/
dict_table_t* table, /*!< in/out: table */
- mem_heap_t* heap) /*!< in: memory heap for temporary storage */
+ mem_heap_t* heap, /*!< in: memory heap for temporary storage */
+ dict_err_ignore_t ignore_err)
+ /*!< in: error to be ignored when
+ loading the index definition */
{
dict_table_t* sys_indexes;
dict_index_t* sys_index;
@@ -1389,10 +1449,22 @@ dict_load_indexes(
"InnoDB: but the index tree has been freed!\n",
index->name, table->name);
+ if (ignore_err & DICT_ERR_IGNORE_INDEX_ROOT) {
+ /* If caller can tolerate this error,
+ we will continue to load the index and
+ let caller deal with this error. However
+ mark the index and table corrupted */
+ index->corrupted = TRUE;
+ table->corrupted = TRUE;
+ fprintf(stderr,
+ "InnoDB: Index is corrupt but forcing"
+ " load into data dictionary\n");
+ } else {
corrupted:
- dict_mem_index_free(index);
- error = DB_CORRUPTION;
- goto func_exit;
+ dict_mem_index_free(index);
+ error = DB_CORRUPTION;
+ goto func_exit;
+ }
} else if (!dict_index_is_clust(index)
&& NULL == dict_table_get_first_index(table)) {
@@ -1414,7 +1486,26 @@ corrupted:
of the database server */
dict_mem_index_free(index);
} else {
- dict_load_fields(index, heap);
+ error = dict_load_fields(index, heap);
+
+ if (error != DB_SUCCESS) {
+
+ fprintf(stderr, "InnoDB: Error: load index '%s'"
+ " for table '%s' failed\n",
+ index->name, table->name);
+
+ /* If the force recovery flag is set, and
+ if the failed index is not the primary index, we
+ will continue and open other indexes */
+ if (srv_force_recovery
+ && !dict_index_is_clust(index)) {
+ error = DB_SUCCESS;
+ goto next_rec;
+ } else {
+ goto func_exit;
+ }
+ }
+
error = dict_index_add_to_cache(table, index,
index->page, FALSE);
/* The data dictionary tables should never contain
@@ -1535,7 +1626,7 @@ err_len:
"InnoDB: in InnoDB data dictionary"
" has unknown type %lx.\n",
(ulong) flags);
- return(NULL);
+ return("incorrect flags in SYS_TABLES");
}
} else {
flags = 0;
@@ -1601,7 +1692,10 @@ dict_load_table(
/*============*/
const char* name, /*!< in: table name in the
databasename/tablename format */
- ibool cached) /*!< in: TRUE=add to cache, FALSE=do not */
+ ibool cached, /*!< in: TRUE=add to cache, FALSE=do not */
+ dict_err_ignore_t ignore_err)
+ /*!< in: error to be ignored when loading
+ table and its indexes' definition */
{
dict_table_t* table;
dict_table_t* sys_tables;
@@ -1716,7 +1810,7 @@ err_exit:
mem_heap_empty(heap);
- err = dict_load_indexes(table, heap);
+ err = dict_load_indexes(table, heap, ignore_err);
/* Initialize table foreign_child value. Its value could be
changed when dict_load_foreigns() is called below */
@@ -1733,13 +1827,22 @@ err_exit:
if (err != DB_SUCCESS) {
dict_table_remove_from_cache(table);
table = NULL;
+ } else {
+ table->fk_max_recusive_level = 0;
}
- } else if (!srv_force_recovery) {
- dict_table_remove_from_cache(table);
- table = NULL;
- }
+ } else {
+ dict_index_t* index;
- table->fk_max_recusive_level = 0;
+ /* Make sure that at least the clustered index was loaded.
+ Otherwise refuse to load the table */
+ index = dict_table_get_first_index(table);
+
+ if (!srv_force_recovery || !index
+ || !dict_index_is_clust(index)) {
+ dict_table_remove_from_cache(table);
+ table = NULL;
+ }
+ }
#if 0
if (err != DB_SUCCESS && table != NULL) {
@@ -1851,7 +1954,7 @@ dict_load_table_on_id(
field = rec_get_nth_field_old(rec, 1, &len);
/* Load the table definition to memory */
table = dict_load_table(mem_heap_strdupl(heap, (char*) field, len),
- TRUE);
+ TRUE, DICT_ERR_IGNORE_NONE);
func_exit:
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@@ -1876,7 +1979,7 @@ dict_load_sys_table(
heap = mem_heap_create(1000);
- dict_load_indexes(table, heap);
+ dict_load_indexes(table, heap, DICT_ERR_IGNORE_NONE);
mem_heap_free(heap);
}
@@ -2055,12 +2158,15 @@ dict_load_foreign(
foreign->id = mem_heap_strdup(foreign->heap, id);
field = rec_get_nth_field_old(rec, 3, &len);
+
foreign->foreign_table_name = mem_heap_strdupl(
foreign->heap, (char*) field, len);
+ dict_mem_foreign_table_name_lookup_set(foreign, TRUE);
field = rec_get_nth_field_old(rec, 4, &len);
foreign->referenced_table_name = mem_heap_strdupl(
foreign->heap, (char*) field, len);
+ dict_mem_referenced_table_name_lookup_set(foreign, TRUE);
btr_pcur_close(&pcur);
mtr_commit(&mtr);
@@ -2068,7 +2174,7 @@ dict_load_foreign(
dict_load_foreign_cols(id, foreign);
ref_table = dict_table_check_if_in_cache_low(
- foreign->referenced_table_name);
+ foreign->referenced_table_name_lookup);
/* We could possibly wind up in a deep recursive calls if
we call dict_table_get_low() again here if there
@@ -2101,7 +2207,7 @@ dict_load_foreign(
have to load it so that we are able to make type comparisons
in the next function call. */
- for_table = dict_table_get_low(foreign->foreign_table_name);
+ for_table = dict_table_get_low(foreign->foreign_table_name_lookup);
if (for_table && ref_table && check_recursive) {
/* This is to record the longest chain of ancesters
@@ -2220,10 +2326,12 @@ loop:
/* Since table names in SYS_FOREIGN are stored in a case-insensitive
order, we have to check that the table name matches also in a binary
string comparison. On Unix, MySQL allows table names that only differ
- in character case. */
-
- if (0 != ut_memcmp(field, table_name, len)) {
+ in character case. If lower_case_table_names=2 then what is stored
+ may not be the same case, but the previous comparison showed that they
+ match with no-case. */
+ if ((innobase_get_lower_case_table_names() != 2)
+ && (0 != ut_memcmp(field, table_name, len))) {
goto next_rec;
}
diff --git a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c
index bbb8f810f44..982cca5a796 100644
--- a/storage/innobase/dict/dict0mem.c
+++ b/storage/innobase/dict/dict0mem.c
@@ -33,9 +33,13 @@ Created 1/8/1996 Heikki Tuuri
#include "data0type.h"
#include "mach0data.h"
#include "dict0dict.h"
+#include "ha_prototypes.h" /* innobase_casedn_str()*/
#ifndef UNIV_HOTBACKUP
# include "lock0lock.h"
#endif /* !UNIV_HOTBACKUP */
+#ifdef UNIV_BLOB_DEBUG
+# include "ut0rbt.h"
+#endif /* UNIV_BLOB_DEBUG */
#define DICT_HEAP_SIZE 100 /*!< initial memory heap size when
creating a table or index object */
@@ -228,6 +232,7 @@ dict_mem_fill_column_struct(
column->ind = (unsigned int) col_pos;
column->ord_part = 0;
+ column->max_prefix = 0;
column->mtype = (unsigned int) mtype;
column->prtype = (unsigned int) prtype;
column->len = (unsigned int) col_len;
@@ -288,6 +293,60 @@ dict_mem_foreign_create(void)
}
/**********************************************************************//**
+Sets the foreign_table_name_lookup pointer based on the value of
+lower_case_table_names. If that is 0 or 1, foreign_table_name_lookup
+will point to foreign_table_name. If 2, then another string is
+allocated from foreign->heap and set to lower case. */
+UNIV_INTERN
+void
+dict_mem_foreign_table_name_lookup_set(
+/*===================================*/
+ dict_foreign_t* foreign, /*!< in/out: foreign struct */
+ ibool do_alloc) /*!< in: is an alloc needed */
+{
+ if (innobase_get_lower_case_table_names() == 2) {
+ if (do_alloc) {
+ foreign->foreign_table_name_lookup = mem_heap_alloc(
+ foreign->heap,
+ strlen(foreign->foreign_table_name) + 1);
+ }
+ strcpy(foreign->foreign_table_name_lookup,
+ foreign->foreign_table_name);
+ innobase_casedn_str(foreign->foreign_table_name_lookup);
+ } else {
+ foreign->foreign_table_name_lookup
+ = foreign->foreign_table_name;
+ }
+}
+
+/**********************************************************************//**
+Sets the referenced_table_name_lookup pointer based on the value of
+lower_case_table_names. If that is 0 or 1, referenced_table_name_lookup
+will point to referenced_table_name. If 2, then another string is
+allocated from foreign->heap and set to lower case. */
+UNIV_INTERN
+void
+dict_mem_referenced_table_name_lookup_set(
+/*======================================*/
+ dict_foreign_t* foreign, /*!< in/out: foreign struct */
+ ibool do_alloc) /*!< in: is an alloc needed */
+{
+ if (innobase_get_lower_case_table_names() == 2) {
+ if (do_alloc) {
+ foreign->referenced_table_name_lookup = mem_heap_alloc(
+ foreign->heap,
+ strlen(foreign->referenced_table_name) + 1);
+ }
+ strcpy(foreign->referenced_table_name_lookup,
+ foreign->referenced_table_name);
+ innobase_casedn_str(foreign->referenced_table_name_lookup);
+ } else {
+ foreign->referenced_table_name_lookup
+ = foreign->referenced_table_name;
+ }
+}
+
+/**********************************************************************//**
Adds a field definition to an index. NOTE: does not take a copy
of the column name if the field is a column. The memory occupied
by the column name may be released only after publishing the index. */
@@ -324,6 +383,12 @@ dict_mem_index_free(
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
+#ifdef UNIV_BLOB_DEBUG
+ if (index->blobs) {
+ mutex_free(&index->blobs_mutex);
+ rbt_free(index->blobs);
+ }
+#endif /* UNIV_BLOB_DEBUG */
mem_heap_free(index->heap);
}
diff --git a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
index 710f0ac8603..196f4bd3f42 100644
--- a/storage/innobase/fil/fil0fil.c
+++ b/storage/innobase/fil/fil0fil.c
@@ -299,6 +299,34 @@ struct fil_system_struct {
initialized. */
static fil_system_t* fil_system = NULL;
+#ifdef UNIV_DEBUG
+/** Try fil_validate() every this many times */
+# define FIL_VALIDATE_SKIP 17
+
+/******************************************************************//**
+Checks the consistency of the tablespace cache some of the time.
+@return TRUE if ok or the check was skipped */
+static
+ibool
+fil_validate_skip(void)
+/*===================*/
+{
+ /** The fil_validate() call skip counter. Use a signed type
+ because of the race condition below. */
+ static int fil_validate_count = FIL_VALIDATE_SKIP;
+
+ /* There is a race condition below, but it does not matter,
+ because this call is only for heuristic purposes. We want to
+ reduce the call frequency of the costly fil_validate() check
+ in debug builds. */
+ if (--fil_validate_count > 0) {
+ return(TRUE);
+ }
+
+ fil_validate_count = FIL_VALIDATE_SKIP;
+ return(fil_validate());
+}
+#endif /* UNIV_DEBUG */
/********************************************************************//**
NOTE: you must call fil_mutex_enter_and_prepare_for_io() first!
@@ -339,14 +367,15 @@ fil_get_space_id_for_table(
/*******************************************************************//**
Frees a space object from the tablespace memory cache. Closes the files in
the chain but does not delete them. There must not be any pending i/o's or
-flushes on the files. */
+flushes on the files.
+@return TRUE on success */
static
ibool
fil_space_free(
/*===========*/
- /* out: TRUE if success */
- ulint id, /* in: space id */
- ibool own_mutex);/* in: TRUE if own system->mutex */
+ ulint id, /* in: space id */
+ ibool x_latched); /* in: TRUE if caller has space->latch
+ in X mode */
/********************************************************************//**
Reads data from a space to a buffer. Remember that the possible incomplete
blocks at the end of file are ignored: they are not taken into account when
@@ -827,7 +856,8 @@ fil_node_close_file(
ut_a(node->open);
ut_a(node->n_pending == 0);
ut_a(node->n_pending_flushes == 0);
- ut_a(node->modification_counter == node->flush_counter);
+ ut_a(node->modification_counter == node->flush_counter
+ || srv_fast_shutdown == 2);
ret = os_file_close(node->handle);
ut_a(ret);
@@ -1140,6 +1170,7 @@ try_again:
space = fil_space_get_by_name(name);
if (UNIV_LIKELY_NULL(space)) {
+ ibool success;
ulint namesake_id;
ut_print_timestamp(stderr);
@@ -1178,9 +1209,10 @@ try_again:
namesake_id = space->id;
- mutex_exit(&fil_system->mutex);
+ success = fil_space_free(namesake_id, FALSE);
+ ut_a(success);
- fil_space_free(namesake_id, FALSE);
+ mutex_exit(&fil_system->mutex);
goto try_again;
}
@@ -1331,15 +1363,14 @@ fil_space_free(
/*===========*/
/* out: TRUE if success */
ulint id, /* in: space id */
- ibool own_mutex) /* in: TRUE if own system->mutex */
+ ibool x_latched) /* in: TRUE if caller has space->latch
+ in X mode */
{
fil_space_t* space;
fil_space_t* namespace;
fil_node_t* fil_node;
- if (!own_mutex) {
- mutex_enter(&fil_system->mutex);
- }
+ ut_ad(mutex_own(&fil_system->mutex));
space = fil_space_get_by_id(id);
@@ -1350,8 +1381,6 @@ fil_space_free(
" from the cache but\n"
"InnoDB: it is not there.\n", (ulong) id);
- mutex_exit(&fil_system->mutex);
-
return(FALSE);
}
@@ -1386,8 +1415,8 @@ fil_space_free(
ut_a(0 == UT_LIST_GET_LEN(space->chain));
- if (!own_mutex) {
- mutex_exit(&fil_system->mutex);
+ if (x_latched) {
+ rw_lock_x_unlock(&space->latch);
}
rw_lock_free(&(space->latch));
@@ -1633,25 +1662,27 @@ fil_close_all_files(void)
/*=====================*/
{
fil_space_t* space;
- fil_node_t* node;
mutex_enter(&fil_system->mutex);
space = UT_LIST_GET_FIRST(fil_system->space_list);
while (space != NULL) {
+ fil_node_t* node;
fil_space_t* prev_space = space;
- node = UT_LIST_GET_FIRST(space->chain);
+ for (node = UT_LIST_GET_FIRST(space->chain);
+ node != NULL;
+ node = UT_LIST_GET_NEXT(chain, node)) {
- while (node != NULL) {
if (node->open) {
fil_node_close_file(node, fil_system);
}
- node = UT_LIST_GET_NEXT(chain, node);
}
+
space = UT_LIST_GET_NEXT(space_list, space);
- fil_space_free(prev_space->id, TRUE);
+
+ fil_space_free(prev_space->id, FALSE);
}
mutex_exit(&fil_system->mutex);
@@ -2271,6 +2302,19 @@ try_again:
path = mem_strdup(space->name);
mutex_exit(&fil_system->mutex);
+
+ /* Important: We rely on the data dictionary mutex to ensure
+ that a race is not possible here. It should serialize the tablespace
+ drop/free. We acquire an X latch only to avoid a race condition
+ when accessing the tablespace instance via:
+
+ fsp_get_available_space_in_free_extents().
+
+ There our main motivation is to reduce the contention on the
+ dictionary mutex. */
+
+ rw_lock_x_lock(&space->latch);
+
#ifndef UNIV_HOTBACKUP
/* Invalidate in the buffer pool all pages belonging to the
tablespace. Since we have set space->is_being_deleted = TRUE, readahead
@@ -2283,7 +2327,11 @@ try_again:
#endif
/* printf("Deleting tablespace %s id %lu\n", space->name, id); */
- success = fil_space_free(id, FALSE);
+ mutex_enter(&fil_system->mutex);
+
+ success = fil_space_free(id, TRUE);
+
+ mutex_exit(&fil_system->mutex);
if (success) {
success = os_file_delete(path);
@@ -2291,6 +2339,8 @@ try_again:
if (!success) {
success = os_file_delete_if_exists(path);
}
+ } else {
+ rw_lock_x_unlock(&space->latch);
}
if (success) {
@@ -2318,6 +2368,31 @@ try_again:
return(FALSE);
}
+/*******************************************************************//**
+Returns TRUE if a single-table tablespace is being deleted.
+@return TRUE if being deleted */
+UNIV_INTERN
+ibool
+fil_tablespace_is_being_deleted(
+/*============================*/
+ ulint id) /*!< in: space id */
+{
+ fil_space_t* space;
+ ibool is_being_deleted;
+
+ mutex_enter(&fil_system->mutex);
+
+ space = fil_space_get_by_id(id);
+
+ ut_a(space != NULL);
+
+ is_being_deleted = space->is_being_deleted;
+
+ mutex_exit(&fil_system->mutex);
+
+ return(is_being_deleted);
+}
+
#ifndef UNIV_HOTBACKUP
/*******************************************************************//**
Discards a single-table tablespace. The tablespace must be cached in the
@@ -4261,15 +4336,13 @@ fil_io(
#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
#endif
- ut_ad(fil_validate());
+ ut_ad(fil_validate_skip());
#ifndef UNIV_HOTBACKUP
# ifndef UNIV_LOG_DEBUG
/* ibuf bitmap pages must be read in the sync aio mode: */
ut_ad(recv_no_ibuf_operations || (type == OS_FILE_WRITE)
|| !ibuf_bitmap_page(zip_size, block_offset)
|| sync || is_log);
- ut_ad(!ibuf_inside() || is_log || (type == OS_FILE_WRITE)
- || ibuf_page(space_id, zip_size, block_offset, NULL));
# endif /* UNIV_LOG_DEBUG */
if (sync) {
mode = OS_AIO_SYNC;
@@ -4420,7 +4493,7 @@ fil_io(
mutex_exit(&fil_system->mutex);
- ut_ad(fil_validate());
+ ut_ad(fil_validate_skip());
}
return(DB_SUCCESS);
@@ -4444,7 +4517,7 @@ fil_aio_wait(
void* message;
ulint type;
- ut_ad(fil_validate());
+ ut_ad(fil_validate_skip());
if (srv_use_native_aio) {
srv_set_io_thread_op_info(segment, "native aio handle");
@@ -4455,8 +4528,8 @@ fil_aio_wait(
ret = os_aio_linux_handle(segment, &fil_node,
&message, &type);
#else
- ret = 0; /* Eliminate compiler warning */
ut_error;
+ ret = 0; /* Eliminate compiler warning */
#endif
} else {
srv_set_io_thread_op_info(segment, "simulated aio handle");
@@ -4466,6 +4539,10 @@ fil_aio_wait(
}
ut_a(ret);
+ if (UNIV_UNLIKELY(fil_node == NULL)) {
+ ut_ad(srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS);
+ return;
+ }
srv_set_io_thread_op_info(segment, "complete io for fil node");
@@ -4475,7 +4552,7 @@ fil_aio_wait(
mutex_exit(&fil_system->mutex);
- ut_ad(fil_validate());
+ ut_ad(fil_validate_skip());
/* Do the i/o handling */
/* IMPORTANT: since i/o handling for reads will read also the insert
@@ -4788,7 +4865,7 @@ fil_page_get_type(
return(mach_read_from_2(page + FIL_PAGE_TYPE));
}
-/********************************************************************
+/****************************************************************//**
Initializes the tablespace memory cache. */
UNIV_INTERN
void
diff --git a/storage/innobase/fsp/fsp0fsp.c b/storage/innobase/fsp/fsp0fsp.c
index 3efe147b998..3f09732a676 100644
--- a/storage/innobase/fsp/fsp0fsp.c
+++ b/storage/innobase/fsp/fsp0fsp.c
@@ -3097,13 +3097,63 @@ fsp_get_available_space_in_free_extents(
ut_ad(!mutex_own(&kernel_mutex));
+ /* The convoluted mutex acquire is to overcome latching order
+ issues: The problem is that the fil_mutex is at a lower level
+ than the tablespace latch and the buffer pool mutex. We have to
+ first prevent any operations on the file system by acquiring the
+ dictionary mutex. Then acquire the tablespace latch to obey the
+ latching order and then release the dictionary mutex. That way we
+ ensure that the tablespace instance can't be freed while we are
+ examining its contents (see fil_space_free()).
+
+ However, there is one further complication, we release the fil_mutex
+ when we need to invalidate the the pages in the buffer pool and we
+ reacquire the fil_mutex when deleting and freeing the tablespace
+ instance in fil0fil.c. Here we need to account for that situation
+ too. */
+
+ mutex_enter(&dict_sys->mutex);
+
+ /* At this stage there is no guarantee that the tablespace even
+ exists in the cache. */
+
+ if (fil_tablespace_deleted_or_being_deleted_in_mem(space, -1)) {
+
+ mutex_exit(&dict_sys->mutex);
+
+ return(ULLINT_UNDEFINED);
+ }
+
mtr_start(&mtr);
latch = fil_space_get_latch(space, &flags);
+
+ /* This should ensure that the tablespace instance can't be freed
+ by another thread. However, the tablespace pages can still be freed
+ from the buffer pool. We need to check for that again. */
+
zip_size = dict_table_flags_to_zip_size(flags);
mtr_x_lock(latch, &mtr);
+ mutex_exit(&dict_sys->mutex);
+
+ /* At this point it is possible for the tablespace to be deleted and
+ its pages removed from the buffer pool. We need to check for that
+ situation. However, the tablespace instance can't be deleted because
+ our latching above should ensure that. */
+
+ if (fil_tablespace_is_being_deleted(space)) {
+
+ mtr_commit(&mtr);
+
+ return(ULLINT_UNDEFINED);
+ }
+
+ /* From here on even if the user has dropped the tablespace, the
+ pages _must_ still exist in the buffer pool and the tablespace
+ instance _must_ be in the file system hash table. */
+
space_header = fsp_get_space_header(space, zip_size, &mtr);
size = mtr_read_ulint(space_header + FSP_SIZE, MLOG_4BYTES, &mtr);
@@ -3271,7 +3321,7 @@ fseg_free_page_low(
"InnoDB: database!\n", (ulong) page);
crash:
fputs("InnoDB: Please refer to\n"
- "InnoDB: " REFMAN "forcing-recovery.html\n"
+ "InnoDB: " REFMAN "forcing-innodb-recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
ut_error;
}
@@ -3385,9 +3435,9 @@ fseg_free_page(
fseg_free_page_low(seg_inode, space, zip_size, page, mtr);
-#ifdef UNIV_DEBUG_FILE_ACCESSES
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
buf_page_set_file_page_was_freed(space, page);
-#endif
+#endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
}
/**********************************************************************//**
@@ -3453,13 +3503,13 @@ fseg_free_extent(
fsp_free_extent(space, zip_size, page, mtr);
-#ifdef UNIV_DEBUG_FILE_ACCESSES
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
for (i = 0; i < FSP_EXTENT_SIZE; i++) {
buf_page_set_file_page_was_freed(space,
first_page_in_extent + i);
}
-#endif
+#endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
}
/**********************************************************************//**
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index c32d8fc4ae9..3561d824e81 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2000, 2010, MySQL AB & Innobase Oy. All Rights Reserved.
+Copyright (c) 2000, 2011, MySQL AB & Innobase Oy. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
@@ -32,7 +32,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/
/* TODO list for the InnoDB handler in 5.0:
- - 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
@@ -52,6 +51,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include <mysql/plugin.h>
#include <mysql/innodb_priv.h>
#include <mysql/psi/psi.h>
+#include <my_sys.h>
/** @file ha_innodb.cc */
@@ -82,7 +82,6 @@ extern "C" {
#include "fil0fil.h"
#include "trx0xa.h"
#include "row0merge.h"
-#include "thr0loc.h"
#include "dict0boot.h"
#include "ha_prototypes.h"
#include "ut0mem.h"
@@ -96,10 +95,6 @@ extern "C" {
# define MYSQL_PLUGIN_IMPORT /* nothing */
# endif /* MYSQL_PLUGIN_IMPORT */
-#if MYSQL_VERSION_ID < 50124
-bool check_global_access(THD *thd, ulong want_access);
-#endif /* MYSQL_VERSION_ID < 50124 */
-
/** to protect innobase_open_files */
static mysql_mutex_t innobase_share_mutex;
/** to force correct commit order in binlog */
@@ -171,12 +166,32 @@ 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 my_bool innobase_large_prefix = FALSE;
static char* internal_innobase_data_file_path = NULL;
static char* innodb_version_str = (char*) INNODB_VERSION_STR;
+/** Possible values for system variable "innodb_stats_method". The values
+are defined the same as its corresponding MyISAM system variable
+"myisam_stats_method"(see "myisam_stats_method_names"), for better usability */
+static const char* innodb_stats_method_names[] = {
+ "nulls_equal",
+ "nulls_unequal",
+ "nulls_ignored",
+ NullS
+};
+
+/** Used to define an enumerate type of the system variable innodb_stats_method.
+This is the same as "myisam_stats_method_typelib" */
+static TYPELIB innodb_stats_method_typelib = {
+ array_elements(innodb_stats_method_names) - 1,
+ "innodb_stats_method_typelib",
+ innodb_stats_method_names,
+ NULL
+};
+
/* The following counter is used to convey information to InnoDB
about server activity: in selects it is not sensible to call
srv_active_wake_master_thread after each fetch or search, we only do
@@ -241,7 +256,6 @@ static PSI_mutex_info all_innodb_mutexes[] = {
{&ibuf_mutex_key, "ibuf_mutex", 0},
{&ibuf_pessimistic_insert_mutex_key,
"ibuf_pessimistic_insert_mutex", 0},
- {&ios_mutex_key, "ios_mutex", 0},
{&kernel_mutex_key, "kernel_mutex", 0},
{&log_sys_mutex_key, "log_sys_mutex", 0},
# ifdef UNIV_MEM_DEBUG
@@ -249,7 +263,7 @@ static PSI_mutex_info all_innodb_mutexes[] = {
# endif /* UNIV_MEM_DEBUG */
{&mem_pool_mutex_key, "mem_pool_mutex", 0},
{&mutex_list_mutex_key, "mutex_list_mutex", 0},
- {&purge_sys_mutex_key, "purge_sys_mutex", 0},
+ {&purge_sys_bh_mutex_key, "purge_sys_bh_mutex", 0},
{&recv_sys_mutex_key, "recv_sys_mutex", 0},
{&rseg_mutex_key, "rseg_mutex", 0},
# ifdef UNIV_SYNC_DEBUG
@@ -266,7 +280,6 @@ static PSI_mutex_info all_innodb_mutexes[] = {
{&sync_thread_mutex_key, "sync_thread_mutex", 0},
# endif /* UNIV_SYNC_DEBUG */
{&trx_doublewrite_mutex_key, "trx_doublewrite_mutex", 0},
- {&thr_local_mutex_key, "thr_local_mutex", 0},
{&trx_undo_mutex_key, "trx_undo_mutex", 0}
};
# endif /* UNIV_PFS_MUTEX */
@@ -291,7 +304,8 @@ static PSI_rwlock_info all_innodb_rwlocks[] = {
{&checkpoint_lock_key, "checkpoint_lock", 0},
{&trx_i_s_cache_lock_key, "trx_i_s_cache_lock", 0},
{&trx_purge_latch_key, "trx_purge_latch", 0},
- {&index_tree_rw_lock_key, "index_tree_rw_lock", 0}
+ {&index_tree_rw_lock_key, "index_tree_rw_lock", 0},
+ {&dict_table_stats_latch_key, "dict_table_stats", 0}
};
# endif /* UNIV_PFS_RWLOCK */
@@ -674,6 +688,8 @@ static SHOW_VAR innodb_status_variables[]= {
(char*) &export_vars.innodb_rows_read, SHOW_LONG},
{"rows_updated",
(char*) &export_vars.innodb_rows_updated, SHOW_LONG},
+ {"truncated_status_writes",
+ (char*) &export_vars.innodb_truncated_status_writes, SHOW_LONG},
{NullS, NullS, SHOW_LONG}
};
@@ -889,7 +905,7 @@ int
convert_error_code_to_mysql(
/*========================*/
int error, /*!< in: InnoDB error code */
- ulint flags, /*!< in: InnoDB table flags, or 0 */
+ ulint flags, /*!< in: InnoDB table flags, or 0 */
THD* thd) /*!< in: user thread handle or NULL */
{
switch (error) {
@@ -964,6 +980,8 @@ convert_error_code_to_mysql(
return(HA_ERR_ROW_IS_REFERENCED);
case DB_CANNOT_ADD_CONSTRAINT:
+ case DB_CHILD_NO_INDEX:
+ case DB_PARENT_NO_INDEX:
return(HA_ERR_CANNOT_ADD_FOREIGN);
case DB_CANNOT_DROP_CONSTRAINT:
@@ -991,6 +1009,11 @@ convert_error_code_to_mysql(
& DICT_TF_COMPACT) / 2);
return(HA_ERR_TO_BIG_ROW);
+ case DB_TOO_BIG_INDEX_COL:
+ my_error(ER_INDEX_COLUMN_TOO_LONG, MYF(0),
+ DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags));
+ return(HA_ERR_INDEX_COL_TOO_LONG);
+
case DB_NO_SAVEPOINT:
return(HA_ERR_NO_SAVEPOINT);
@@ -1129,6 +1152,20 @@ innobase_strcasecmp(
}
/******************************************************************//**
+Strip dir name from a full path name and return only the file name
+@return file name or "null" if no file name */
+extern "C" UNIV_INTERN
+const char*
+innobase_basename(
+/*==============*/
+ const char* path_name) /*!< in: full path name */
+{
+ const char* name = base_name(path_name);
+
+ return((name) ? name : "null");
+}
+
+/******************************************************************//**
Makes all characters in a NUL-terminated UTF-8 string lower case. */
extern "C" UNIV_INTERN
void
@@ -1168,6 +1205,20 @@ innobase_get_stmt(
return(stmt->str);
}
+/**********************************************************************//**
+Get the current setting of the lower_case_table_names global parameter from
+mysqld.cc. We do a dirty read because for one there is no synchronization
+object and secondly there is little harm in doing so even if we get a torn
+read.
+@return value of lower_case_table_names */
+extern "C" UNIV_INTERN
+ulint
+innobase_get_lower_case_table_names(void)
+/*=====================================*/
+{
+ return(lower_case_table_names);
+}
+
#if defined (__WIN__) && defined (MYSQL_DYNAMIC_PLUGIN)
extern MYSQL_PLUGIN_IMPORT MY_TMPDIR mysql_tmpdir_list;
/*******************************************************************//**
@@ -1284,7 +1335,7 @@ innobase_mysql_tmpfile(void)
#ifdef _WIN32
/* Note that on Windows, the integer returned by mysql_tmpfile
- has no relation to C runtime file descriptor. Here, we need
+ has no relation to C runtime file descriptor. Here, we need
to call my_get_osfhandle to get the HANDLE and then convert it
to C runtime filedescriptor. */
{
@@ -1511,7 +1562,7 @@ Gets the InnoDB transaction handle for a MySQL handler object, creates
an InnoDB transaction struct if the corresponding MySQL thread struct still
lacks one.
@return InnoDB transaction handle */
-static
+static inline
trx_t*
check_trx_exists(
/*=============*/
@@ -1533,6 +1584,77 @@ check_trx_exists(
return(trx);
}
+/*********************************************************************//**
+Note that a transaction has been registered with MySQL.
+@return true if transaction is registered with MySQL 2PC coordinator */
+static inline
+bool
+trx_is_registered_for_2pc(
+/*=========================*/
+ const trx_t* trx) /* in: transaction */
+{
+ return(trx->is_registered == 1);
+}
+
+/*********************************************************************//**
+Note that a transaction owns the prepare_commit_mutex. */
+static inline
+void
+trx_owns_prepare_commit_mutex_set(
+/*==============================*/
+ trx_t* trx) /* in: transaction */
+{
+ ut_a(trx_is_registered_for_2pc(trx));
+ trx->owns_prepare_mutex = 1;
+}
+
+/*********************************************************************//**
+Note that a transaction has been registered with MySQL 2PC coordinator. */
+static inline
+void
+trx_register_for_2pc(
+/*==================*/
+ trx_t* trx) /* in: transaction */
+{
+ trx->is_registered = 1;
+ ut_ad(trx->owns_prepare_mutex == 0);
+}
+
+/*********************************************************************//**
+Note that a transaction has been deregistered. */
+static inline
+void
+trx_deregister_from_2pc(
+/*====================*/
+ trx_t* trx) /* in: transaction */
+{
+ trx->is_registered = 0;
+ trx->owns_prepare_mutex = 0;
+}
+
+/*********************************************************************//**
+Check whether atransaction owns the prepare_commit_mutex.
+@return true if transaction owns the prepare commit mutex */
+static inline
+bool
+trx_has_prepare_commit_mutex(
+/*=========================*/
+ const trx_t* trx) /* in: transaction */
+{
+ return(trx->owns_prepare_mutex == 1);
+}
+
+/*********************************************************************//**
+Check if transaction is started.
+@reutrn true if transaction is in state started */
+static
+bool
+trx_is_started(
+/*===========*/
+ trx_t* trx) /* in: transaction */
+{
+ return(trx->conc_state != TRX_NOT_STARTED);
+}
/*********************************************************************//**
Construct ha_innobase handler. */
@@ -1596,48 +1718,31 @@ ha_innobase::update_thd()
}
/*********************************************************************//**
-Registers that InnoDB takes part in an SQL statement, so that MySQL knows to
-roll back the statement if the statement results in an error. This MUST be
-called for every SQL statement that may be rolled back by MySQL. Calling this
-several times to register the same statement is allowed, too. */
+Registers an InnoDB transaction with the MySQL 2PC coordinator, so that
+the MySQL XA code knows to call the InnoDB prepare and commit, or rollback
+for the transaction. This MUST be called for every transaction for which
+the user may call commit or rollback. Calling this several times to register
+the same transaction is allowed, too. This function also registers the
+current SQL statement. */
static inline
void
-innobase_register_stmt(
-/*===================*/
- handlerton* hton, /*!< in: Innobase hton */
- THD* thd) /*!< in: MySQL thd (connection) object */
+innobase_register_trx(
+/*==================*/
+ handlerton* hton, /* in: Innobase handlerton */
+ THD* thd, /* in: MySQL thd (connection) object */
+ trx_t* trx) /* in: transaction to register */
{
- DBUG_ASSERT(hton == innodb_hton_ptr);
- /* Register the statement */
trans_register_ha(thd, FALSE, hton);
-}
-
-/*********************************************************************//**
-Registers an InnoDB transaction in MySQL, so that the MySQL XA code knows
-to call the InnoDB prepare and commit, or rollback for the transaction. This
-MUST be called for every transaction for which the user may call commit or
-rollback. Calling this several times to register the same transaction is
-allowed, too.
-This function also registers the current SQL statement. */
-static inline
-void
-innobase_register_trx_and_stmt(
-/*===========================*/
- handlerton *hton, /*!< in: Innobase handlerton */
- THD* thd) /*!< in: MySQL thd (connection) object */
-{
- /* NOTE that actually innobase_register_stmt() registers also
- the transaction in the AUTOCOMMIT=1 mode. */
- innobase_register_stmt(hton, thd);
+ if (!trx_is_registered_for_2pc(trx)
+ && thd_test_options(thd, 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);
}
-}
+ trx_register_for_2pc(trx);
+}
+
/* BACKGROUND INFO: HOW THE MYSQL QUERY CACHE WORKS WITH INNODB
------------------------------------------------------------
@@ -1783,14 +1888,8 @@ innobase_query_caching_of_table_permitted(
#ifdef __WIN__
innobase_casedn_str(norm_name);
#endif
- /* The call of row_search_.. will start a new transaction if it is
- not yet started */
- if (trx->active_trans == 0) {
-
- innobase_register_trx_and_stmt(innodb_hton_ptr, thd);
- trx->active_trans = 1;
- }
+ innobase_register_trx(innodb_hton_ptr, thd, trx);
if (row_search_check_if_query_cache_permitted(trx, norm_name)) {
@@ -1850,11 +1949,7 @@ innobase_convert_identifier(
FALSE=id is an UTF-8 string */
{
char nz[NAME_LEN + 1];
-#if MYSQL_VERSION_ID >= 50141
char nz2[NAME_LEN + 1 + EXPLAIN_FILENAME_MAX_EXTRA_LENGTH];
-#else /* MYSQL_VERSION_ID >= 50141 */
- char nz2[NAME_LEN + 1 + sizeof srv_mysql50_table_name_prefix];
-#endif /* MYSQL_VERSION_ID >= 50141 */
const char* s = id;
int q;
@@ -1872,13 +1967,9 @@ innobase_convert_identifier(
nz[idlen] = 0;
s = nz2;
-#if MYSQL_VERSION_ID >= 50141
idlen = explain_filename((THD*) thd, nz, nz2, sizeof nz2,
EXPLAIN_PARTITIONS_AS_COMMENT);
goto no_quote;
-#else /* MYSQL_VERSION_ID >= 50141 */
- idlen = filename_to_tablename(nz, nz2, sizeof nz2);
-#endif /* MYSQL_VERSION_ID >= 50141 */
}
/* See if the identifier needs to be quoted. */
@@ -1889,9 +1980,7 @@ innobase_convert_identifier(
}
if (q == EOF) {
-#if MYSQL_VERSION_ID >= 50141
no_quote:
-#endif /* MYSQL_VERSION_ID >= 50141 */
if (UNIV_UNLIKELY(idlen > buflen)) {
idlen = buflen;
}
@@ -2057,14 +2146,7 @@ ha_innobase::init_table_handle_for_HANDLER(void)
trx_assign_read_view(prebuilt->trx);
- /* Set the MySQL flag to mark that there is an active transaction */
-
- if (prebuilt->trx->active_trans == 0) {
-
- innobase_register_trx_and_stmt(ht, user_thd);
-
- prebuilt->trx->active_trans = 1;
- }
+ innobase_register_trx(ht, user_thd, prebuilt->trx);
/* We did the necessary inits in this function, no need to repeat them
in row_search_for_mysql */
@@ -2135,13 +2217,13 @@ innobase_init(
ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR);
-#ifdef UNIV_DEBUG
+#ifndef DBUG_OFF
static const char test_filename[] = "-@";
char test_tablename[sizeof test_filename
+ sizeof srv_mysql50_table_name_prefix];
if ((sizeof test_tablename) - 1
!= filename_to_tablename(test_filename, test_tablename,
- sizeof test_tablename)
+ sizeof test_tablename, true)
|| strncmp(test_tablename,
srv_mysql50_table_name_prefix,
sizeof srv_mysql50_table_name_prefix)
@@ -2151,7 +2233,7 @@ innobase_init(
sql_print_error("tablename encoding has been changed");
goto error;
}
-#endif /* UNIV_DEBUG */
+#endif /* DBUG_OFF */
/* Check that values don't overflow on 32-bit systems. */
if (sizeof(ulint) == 4) {
@@ -2544,11 +2626,13 @@ innobase_alter_table_flags(
/*=======================*/
uint flags)
{
- return(HA_ONLINE_ADD_INDEX_NO_WRITES
- | HA_ONLINE_DROP_INDEX_NO_WRITES
- | HA_ONLINE_ADD_UNIQUE_INDEX_NO_WRITES
- | HA_ONLINE_DROP_UNIQUE_INDEX_NO_WRITES
- | HA_ONLINE_ADD_PK_INDEX_NO_WRITES);
+ return(HA_INPLACE_ADD_INDEX_NO_READ_WRITE
+ | HA_INPLACE_ADD_INDEX_NO_WRITE
+ | HA_INPLACE_DROP_INDEX_NO_READ_WRITE
+ | HA_INPLACE_ADD_UNIQUE_INDEX_NO_READ_WRITE
+ | HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE
+ | HA_INPLACE_DROP_UNIQUE_INDEX_NO_READ_WRITE
+ | HA_INPLACE_ADD_PK_INDEX_NO_READ_WRITE);
}
/*****************************************************************//**
@@ -2559,12 +2643,10 @@ innobase_commit_low(
/*================*/
trx_t* trx) /*!< in: transaction handle */
{
- if (trx->conc_state == TRX_NOT_STARTED) {
+ if (trx_is_started(trx)) {
- return;
+ trx_commit_for_mysql(trx);
}
-
- trx_commit_for_mysql(trx);
}
/*****************************************************************//**
@@ -2577,7 +2659,7 @@ static
int
innobase_start_trx_and_assign_read_view(
/*====================================*/
- handlerton *hton, /*!< in: Innodb handlerton */
+ handlerton *hton, /*!< in: Innodb handlerton */
THD* thd) /*!< in: MySQL thread handle of the user for whom
the transaction should be committed */
{
@@ -2606,10 +2688,7 @@ innobase_start_trx_and_assign_read_view(
/* Set the MySQL flag to mark that there is an active transaction */
- if (trx->active_trans == 0) {
- innobase_register_trx_and_stmt(hton, thd);
- trx->active_trans = 1;
- }
+ innobase_register_trx(hton, current_thd, trx);
DBUG_RETURN(0);
}
@@ -2622,7 +2701,7 @@ static
int
innobase_commit(
/*============*/
- handlerton *hton, /*!< in: Innodb handlerton */
+ handlerton *hton, /*!< in: Innodb handlerton */
THD* thd, /*!< in: MySQL thread handle of the user for whom
the transaction should be committed */
bool all) /*!< in: TRUE - commit transaction
@@ -2643,29 +2722,19 @@ innobase_commit(
trx_search_latch_release_if_reserved(trx);
}
- /* The flag trx->active_trans is set to 1 in
+ /* Transaction is deregistered only in a commit or a rollback. If
+ it is deregistered we know there cannot be resources to be freed
+ and we could return immediately. For the time being, we play safe
+ and do the cleanup though there should be nothing to clean up. */
- 1. ::external_lock(),
- 2. ::start_stmt(),
- 3. innobase_query_caching_of_table_permitted(),
- 4. innobase_savepoint(),
- 5. ::init_table_handle_for_HANDLER(),
- 6. innobase_start_trx_and_assign_read_view(),
- 7. ::transactional_table_lock()
+ if (!trx_is_registered_for_2pc(trx) && trx_is_started(trx)) {
- and it is only set to 0 in a commit or a rollback. If it is 0 we know
- there cannot be resources to be freed and we could return immediately.
- For the time being, we play safe and do the cleanup though there should
- be nothing to clean up. */
-
- if (trx->active_trans == 0
- && trx->conc_state != TRX_NOT_STARTED) {
-
- sql_print_error("trx->active_trans == 0, but"
- " trx->conc_state != TRX_NOT_STARTED");
+ sql_print_error("Transaction not registered for MySQL 2PC, "
+ "but transaction is active");
}
+
if (all
- || (!thd_test_options(thd, 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 */
@@ -2720,15 +2789,15 @@ retry:
mysql_mutex_unlock(&commit_cond_m);
}
- if (trx->active_trans == 2) {
-
+ if (trx_has_prepare_commit_mutex(trx)) {
+
mysql_mutex_unlock(&prepare_commit_mutex);
- }
+ }
+
+ trx_deregister_from_2pc(trx);
/* Now do a write + flush of logs. */
trx_commit_complete_for_mysql(trx);
- trx->active_trans = 0;
-
} else {
/* We just mark the SQL statement ended and do not do a
transaction commit */
@@ -2797,10 +2866,10 @@ innobase_rollback(
row_unlock_table_autoinc_for_mysql(trx);
if (all
- || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
+ || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
error = trx_rollback_for_mysql(trx);
- trx->active_trans = 0;
+ trx_deregister_from_2pc(trx);
} else {
error = trx_rollback_last_sql_stat_for_mysql(trx);
}
@@ -2943,8 +3012,8 @@ innobase_savepoint(
innobase_release_stat_resources(trx);
- /* cannot happen outside of transaction */
- DBUG_ASSERT(trx->active_trans);
+ /* Cannot happen outside of transaction */
+ DBUG_ASSERT(trx_is_registered_for_2pc(trx));
/* TODO: use provided savepoint data area to store savepoint data */
char name[64];
@@ -2974,16 +3043,15 @@ innobase_close_connection(
ut_a(trx);
- if (trx->active_trans == 0
- && trx->conc_state != TRX_NOT_STARTED) {
+ if (!trx_is_registered_for_2pc(trx) && trx_is_started(trx)) {
- sql_print_error("trx->active_trans == 0, but"
- " trx->conc_state != TRX_NOT_STARTED");
+ sql_print_error("Transaction not registered for MySQL 2PC, "
+ "but transaction is active");
}
- if (trx->conc_state != TRX_NOT_STARTED &&
- global_system_variables.log_warnings) {
+ if (trx_is_started(trx) && global_system_variables.log_warnings) {
+
sql_print_warning(
"MySQL is closing a connection that has an active "
"InnoDB transaction. %llu row modifications will "
@@ -2993,7 +3061,6 @@ innobase_close_connection(
innobase_rollback_trx(trx);
- thr_local_free(trx->mysql_thread_id);
trx_free_for_mysql(trx);
DBUG_RETURN(0);
@@ -3887,7 +3954,11 @@ UNIV_INTERN
uint
ha_innobase::max_supported_key_part_length() const
{
- return(DICT_MAX_INDEX_COL_LEN - 1);
+ /* A table format specific index column length check will be performed
+ at ha_innobase::add_index() and row_create_index_for_mysql() */
+ return(innobase_large_prefix
+ ? REC_VERSION_56_MAX_INDEX_COL_LEN
+ : REC_ANTELOPE_MAX_INDEX_COL_LEN - 1);
}
/******************************************************************//**
@@ -4626,17 +4697,18 @@ include_field:
n_requested_fields++;
templ->col_no = i;
+ templ->clust_rec_field_no = dict_col_get_clust_pos(
+ col, clust_index);
+ ut_ad(templ->clust_rec_field_no != ULINT_UNDEFINED);
if (index == clust_index) {
- templ->rec_field_no = dict_col_get_clust_pos(
- col, index);
+ templ->rec_field_no = templ->clust_rec_field_no;
} else {
templ->rec_field_no = dict_index_get_nth_col_pos(
index, i);
- }
-
- if (templ->rec_field_no == ULINT_UNDEFINED) {
- prebuilt->need_to_access_clustered = TRUE;
+ if (templ->rec_field_no == ULINT_UNDEFINED) {
+ prebuilt->need_to_access_clustered = TRUE;
+ }
}
if (field->null_ptr) {
@@ -4686,9 +4758,7 @@ skip_field:
for (i = 0; i < n_requested_fields; i++) {
templ = prebuilt->mysql_template + i;
- templ->rec_field_no = dict_col_get_clust_pos(
- &index->table->cols[templ->col_no],
- clust_index);
+ templ->rec_field_no = templ->clust_rec_field_no;
}
}
}
@@ -4884,7 +4954,7 @@ no_commit:
/* Altering to InnoDB format */
innobase_commit(ht, user_thd, 1);
/* Note that this transaction is still active. */
- prebuilt->trx->active_trans = 1;
+ trx_register_for_2pc(prebuilt->trx);
/* We will need an IX lock on the destination table. */
prebuilt->sql_stat_start = TRUE;
} else {
@@ -4900,7 +4970,7 @@ no_commit:
locks, so they have to be acquired again. */
innobase_commit(ht, user_thd, 1);
/* Note that this transaction is still active. */
- prebuilt->trx->active_trans = 1;
+ trx_register_for_2pc(prebuilt->trx);
/* Re-acquire the table lock on the source table. */
row_lock_table_for_mysql(prebuilt, src_table, mode);
/* We will need an IX lock on the destination table. */
@@ -6198,9 +6268,16 @@ create_table_def(
DBUG_PRINT("enter", ("table_name: %s", table_name));
ut_a(trx->mysql_thd != NULL);
- if (IS_MAGIC_TABLE_AND_USER_DENIED_ACCESS(table_name,
- (THD*) trx->mysql_thd)) {
- DBUG_RETURN(HA_ERR_GENERIC);
+
+ /* MySQL does the name length check. But we do additional check
+ on the name length here */
+ if (strlen(table_name) > MAX_FULL_NAME_LEN) {
+ push_warning_printf(
+ (THD*) trx->mysql_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TABLE_NAME,
+ "InnoDB: Table Name or Database Name is too long");
+
+ DBUG_RETURN(ER_TABLE_NAME);
}
n_cols = form->s->fields;
@@ -6485,6 +6562,60 @@ create_clustered_index_when_no_primary(
}
/*****************************************************************//**
+Return a display name for the row format
+@return row format name */
+UNIV_INTERN
+const char*
+get_row_format_name(
+/*================*/
+ enum row_type row_format) /*!< in: Row Format */
+{
+ switch (row_format) {
+ case ROW_TYPE_COMPACT:
+ return("COMPACT");
+ case ROW_TYPE_COMPRESSED:
+ return("COMPRESSED");
+ case ROW_TYPE_DYNAMIC:
+ return("DYNAMIC");
+ case ROW_TYPE_REDUNDANT:
+ return("REDUNDANT");
+ case ROW_TYPE_DEFAULT:
+ return("DEFAULT");
+ case ROW_TYPE_FIXED:
+ return("FIXED");
+ case ROW_TYPE_PAGE:
+ case ROW_TYPE_NOT_USED:
+ break;
+ }
+ return("NOT USED");
+}
+
+/** If file-per-table is missing, issue warning and set ret false */
+#define CHECK_ERROR_ROW_TYPE_NEEDS_FILE_PER_TABLE \
+ if (!srv_file_per_table) { \
+ push_warning_printf( \
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN, \
+ ER_ILLEGAL_HA_CREATE_OPTION, \
+ "InnoDB: ROW_FORMAT=%s requires" \
+ " innodb_file_per_table.", \
+ get_row_format_name(row_format)); \
+ ret = FALSE; \
+ }
+
+/** If file-format is Antelope, issue warning and set ret false */
+#define CHECK_ERROR_ROW_TYPE_NEEDS_GT_ANTELOPE \
+ if (srv_file_format < DICT_TF_FORMAT_ZIP) { \
+ push_warning_printf( \
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN, \
+ ER_ILLEGAL_HA_CREATE_OPTION, \
+ "InnoDB: ROW_FORMAT=%s requires" \
+ " innodb_file_format > Antelope.", \
+ get_row_format_name(row_format)); \
+ ret = FALSE; \
+ }
+
+
+/*****************************************************************//**
Validates the create options. We may build on this function
in future. For now, it checks two specifiers:
KEY_BLOCK_SIZE and ROW_FORMAT
@@ -6499,9 +6630,9 @@ create_options_are_valid(
columns and indexes */
HA_CREATE_INFO* create_info) /*!< in: create info. */
{
- ibool kbs_specified = FALSE;
+ ibool kbs_specified = FALSE;
ibool ret = TRUE;
-
+ enum row_type row_format = form->s->row_type;
ut_ad(thd != NULL);
@@ -6513,10 +6644,8 @@ create_options_are_valid(
ut_ad(form != NULL);
ut_ad(create_info != NULL);
- /* First check if KEY_BLOCK_SIZE was specified. */
- if (create_info->key_block_size
- || (create_info->used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE)) {
-
+ /* First check if a non-zero KEY_BLOCK_SIZE was specified. */
+ if (create_info->key_block_size) {
kbs_specified = TRUE;
switch (create_info->key_block_size) {
case 1:
@@ -6524,127 +6653,70 @@ create_options_are_valid(
case 4:
case 8:
case 16:
- /* Valid value. */
- break;
- default:
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: invalid"
- " KEY_BLOCK_SIZE = %lu."
- " Valid values are"
- " [1, 2, 4, 8, 16]",
- create_info->key_block_size);
- ret = FALSE;
- }
- }
-
- /* If KEY_BLOCK_SIZE was specified, check for its
- dependencies. */
- if (kbs_specified && !srv_file_per_table) {
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: KEY_BLOCK_SIZE"
- " requires innodb_file_per_table.");
- ret = FALSE;
- }
-
- if (kbs_specified && srv_file_format < DICT_TF_FORMAT_ZIP) {
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: KEY_BLOCK_SIZE"
- " requires innodb_file_format >"
- " Antelope.");
- ret = FALSE;
- }
-
- /* Now check for ROW_FORMAT specifier. */
- if (create_info->used_fields & HA_CREATE_USED_ROW_FORMAT) {
- switch (form->s->row_type) {
- const char* row_format_name;
- case ROW_TYPE_COMPRESSED:
- case ROW_TYPE_DYNAMIC:
- row_format_name
- = form->s->row_type == ROW_TYPE_COMPRESSED
- ? "COMPRESSED"
- : "DYNAMIC";
-
- /* These two ROW_FORMATs require
- srv_file_per_table and srv_file_format */
+ /* Valid KEY_BLOCK_SIZE, check its dependencies. */
if (!srv_file_per_table) {
- push_warning_printf(
- thd,
- MYSQL_ERROR::WARN_LEVEL_WARN,
+ push_warning(
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: ROW_FORMAT=%s"
- " requires innodb_file_per_table.",
- row_format_name);
- ret = FALSE;
-
+ "InnoDB: KEY_BLOCK_SIZE requires"
+ " innodb_file_per_table.");
+ ret = FALSE;
}
-
if (srv_file_format < DICT_TF_FORMAT_ZIP) {
- push_warning_printf(
- thd,
- MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: ROW_FORMAT=%s"
- " requires innodb_file_format >"
- " Antelope.",
- row_format_name);
- ret = FALSE;
- }
-
- /* Cannot specify KEY_BLOCK_SIZE with
- ROW_FORMAT = DYNAMIC.
- However, we do allow COMPRESSED to be
- specified with KEY_BLOCK_SIZE. */
- if (kbs_specified
- && form->s->row_type == ROW_TYPE_DYNAMIC) {
- push_warning_printf(
- thd,
- MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: cannot specify"
- " ROW_FORMAT = DYNAMIC with"
- " KEY_BLOCK_SIZE.");
- ret = FALSE;
- }
-
- break;
-
- case ROW_TYPE_REDUNDANT:
- case ROW_TYPE_COMPACT:
- case ROW_TYPE_DEFAULT:
- /* Default is COMPACT. */
- row_format_name
- = form->s->row_type == ROW_TYPE_REDUNDANT
- ? "REDUNDANT"
- : "COMPACT";
-
- /* Cannot specify KEY_BLOCK_SIZE with these
- format specifiers. */
- if (kbs_specified) {
- push_warning_printf(
- thd,
- MYSQL_ERROR::WARN_LEVEL_WARN,
+ push_warning(
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: cannot specify"
- " ROW_FORMAT = %s with"
- " KEY_BLOCK_SIZE.",
- row_format_name);
+ "InnoDB: KEY_BLOCK_SIZE requires"
+ " innodb_file_format > Antelope.");
ret = FALSE;
}
-
break;
-
default:
- push_warning(thd,
- MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: invalid ROW_FORMAT specifier.");
+ push_warning_printf(
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_ILLEGAL_HA_CREATE_OPTION,
+ "InnoDB: invalid KEY_BLOCK_SIZE = %lu."
+ " Valid values are [1, 2, 4, 8, 16]",
+ create_info->key_block_size);
+ ret = FALSE;
+ break;
+ }
+ }
+
+ /* Check for a valid Innodb ROW_FORMAT specifier and
+ other incompatibilities. */
+ switch (row_format) {
+ case ROW_TYPE_COMPRESSED:
+ CHECK_ERROR_ROW_TYPE_NEEDS_FILE_PER_TABLE;
+ CHECK_ERROR_ROW_TYPE_NEEDS_GT_ANTELOPE;
+ break;
+ case ROW_TYPE_DYNAMIC:
+ CHECK_ERROR_ROW_TYPE_NEEDS_FILE_PER_TABLE;
+ CHECK_ERROR_ROW_TYPE_NEEDS_GT_ANTELOPE;
+ /* fall through since dynamic also shuns KBS */
+ case ROW_TYPE_COMPACT:
+ case ROW_TYPE_REDUNDANT:
+ if (kbs_specified) {
+ push_warning_printf(
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_ILLEGAL_HA_CREATE_OPTION,
+ "InnoDB: cannot specify ROW_FORMAT = %s"
+ " with KEY_BLOCK_SIZE.",
+ get_row_format_name(row_format));
ret = FALSE;
-
}
+ break;
+ case ROW_TYPE_DEFAULT:
+ break;
+ case ROW_TYPE_FIXED:
+ case ROW_TYPE_PAGE:
+ case ROW_TYPE_NOT_USED:
+ push_warning(
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_ILLEGAL_HA_CREATE_OPTION, \
+ "InnoDB: invalid ROW_FORMAT specifier.");
+ ret = FALSE;
+ break;
}
return(ret);
@@ -6694,7 +6766,7 @@ ha_innobase::create(
const ulint file_format = srv_file_format;
const char* stmt;
size_t stmt_len;
- enum row_type row_type;
+ enum row_type row_format;
DBUG_ENTER("ha_innobase::create");
@@ -6732,52 +6804,28 @@ ha_innobase::create(
DBUG_RETURN(HA_ERR_TO_BIG_ROW);
}
- /* Get the transaction associated with the current thd, or create one
- if not yet created */
-
- 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 */
-
- trx_search_latch_release_if_reserved(parent_trx);
-
- trx = innobase_trx_allocate(thd);
-
- if (lower_case_table_names) {
- srv_lower_case_table_names = TRUE;
- } else {
- srv_lower_case_table_names = FALSE;
- }
-
strcpy(name2, name);
normalize_table_name(norm_name, name2);
- /* Latch the InnoDB data dictionary exclusively so that no deadlocks
- or lock waits can happen in it during a table create operation.
- Drop table etc. do this latching in row0mysql.c. */
-
- row_mysql_lock_data_dictionary(trx);
-
/* Create the table definition in InnoDB */
flags = 0;
/* Validate create options if innodb_strict_mode is set. */
if (!create_options_are_valid(thd, form, create_info)) {
- error = ER_ILLEGAL_HA_CREATE_OPTION;
- goto cleanup;
+ DBUG_RETURN(ER_ILLEGAL_HA_CREATE_OPTION);
}
- if (create_info->key_block_size
- || (create_info->used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE)) {
+ if (create_info->key_block_size) {
/* Determine the page_zip.ssize corresponding to the
requested page size (key_block_size) in kilobytes. */
ulint ssize, ksize;
ulint key_block_size = create_info->key_block_size;
+ /* Set 'flags' to the correct key_block_size.
+ It will be zero if key_block_size is an invalid number.*/
for (ssize = ksize = 1; ssize <= DICT_TF_ZSSIZE_MAX;
ssize++, ksize <<= 1) {
if (key_block_size == ksize) {
@@ -6790,40 +6838,40 @@ ha_innobase::create(
}
if (!srv_file_per_table) {
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: KEY_BLOCK_SIZE"
- " requires innodb_file_per_table.");
+ push_warning(
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_ILLEGAL_HA_CREATE_OPTION,
+ "InnoDB: KEY_BLOCK_SIZE requires"
+ " innodb_file_per_table.");
flags = 0;
}
if (file_format < DICT_TF_FORMAT_ZIP) {
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: KEY_BLOCK_SIZE"
- " requires innodb_file_format >"
- " Antelope.");
+ push_warning(
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_ILLEGAL_HA_CREATE_OPTION,
+ "InnoDB: KEY_BLOCK_SIZE requires"
+ " innodb_file_format > Antelope.");
flags = 0;
}
if (!flags) {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: ignoring"
- " KEY_BLOCK_SIZE=%lu.",
- create_info->key_block_size);
+ push_warning_printf(
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_ILLEGAL_HA_CREATE_OPTION,
+ "InnoDB: ignoring KEY_BLOCK_SIZE=%lu.",
+ create_info->key_block_size);
}
}
- row_type = form->s->row_type;
+ row_format = form->s->row_type;
if (flags) {
- /* KEY_BLOCK_SIZE was specified. */
- if (!(create_info->used_fields & HA_CREATE_USED_ROW_FORMAT)) {
- /* ROW_FORMAT was not specified;
- default to ROW_FORMAT=COMPRESSED */
- row_type = ROW_TYPE_COMPRESSED;
- } else if (row_type != ROW_TYPE_COMPRESSED) {
+ /* if ROW_FORMAT is set to default,
+ automatically change it to COMPRESSED.*/
+ if (row_format == ROW_TYPE_DEFAULT) {
+ row_format = ROW_TYPE_COMPRESSED;
+ } else if (row_format != ROW_TYPE_COMPRESSED) {
/* ROW_FORMAT other than COMPRESSED
ignores KEY_BLOCK_SIZE. It does not
make sense to reject conflicting
@@ -6831,8 +6879,7 @@ ha_innobase::create(
such combinations can be obtained
with ALTER TABLE anyway. */
push_warning_printf(
- thd,
- MYSQL_ERROR::WARN_LEVEL_WARN,
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
"InnoDB: ignoring KEY_BLOCK_SIZE=%lu"
" unless ROW_FORMAT=COMPRESSED.",
@@ -6840,8 +6887,8 @@ ha_innobase::create(
flags = 0;
}
} else {
- /* No KEY_BLOCK_SIZE */
- if (row_type == ROW_TYPE_COMPRESSED) {
+ /* flags == 0 means no KEY_BLOCK_SIZE.*/
+ if (row_format == ROW_TYPE_COMPRESSED) {
/* ROW_FORMAT=COMPRESSED without
KEY_BLOCK_SIZE implies half the
maximum KEY_BLOCK_SIZE. */
@@ -6856,49 +6903,40 @@ ha_innobase::create(
}
}
- switch (row_type) {
- const char* row_format_name;
+ switch (row_format) {
case ROW_TYPE_REDUNDANT:
break;
case ROW_TYPE_COMPRESSED:
case ROW_TYPE_DYNAMIC:
- row_format_name
- = row_type == ROW_TYPE_COMPRESSED
- ? "COMPRESSED"
- : "DYNAMIC";
-
if (!srv_file_per_table) {
push_warning_printf(
- thd,
- MYSQL_ERROR::WARN_LEVEL_WARN,
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: ROW_FORMAT=%s"
- " requires innodb_file_per_table.",
- row_format_name);
+ "InnoDB: ROW_FORMAT=%s requires"
+ " innodb_file_per_table.",
+ get_row_format_name(row_format));
} else if (file_format < DICT_TF_FORMAT_ZIP) {
push_warning_printf(
- thd,
- MYSQL_ERROR::WARN_LEVEL_WARN,
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: ROW_FORMAT=%s"
- " requires innodb_file_format >"
- " Antelope.",
- row_format_name);
+ "InnoDB: ROW_FORMAT=%s requires"
+ " innodb_file_format > Antelope.",
+ get_row_format_name(row_format));
} else {
flags |= DICT_TF_COMPACT
- | (DICT_TF_FORMAT_ZIP
- << DICT_TF_FORMAT_SHIFT);
+ | (DICT_TF_FORMAT_ZIP
+ << DICT_TF_FORMAT_SHIFT);
break;
}
/* fall through */
case ROW_TYPE_NOT_USED:
case ROW_TYPE_FIXED:
- default:
- push_warning(thd,
- MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_ILLEGAL_HA_CREATE_OPTION,
- "InnoDB: assuming ROW_FORMAT=COMPACT.");
+ case ROW_TYPE_PAGE:
+ push_warning(
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_ILLEGAL_HA_CREATE_OPTION,
+ "InnoDB: assuming ROW_FORMAT=COMPACT.");
case ROW_TYPE_DEFAULT:
case ROW_TYPE_COMPACT:
flags = DICT_TF_COMPACT;
@@ -6918,16 +6956,37 @@ ha_innobase::create(
/* Check for name conflicts (with reserved name) for
any user indices to be created. */
- if (innobase_index_name_is_reserved(trx, form->key_info,
+ if (innobase_index_name_is_reserved(thd, form->key_info,
form->s->keys)) {
- error = -1;
- goto cleanup;
+ DBUG_RETURN(-1);
+ }
+
+ if (IS_MAGIC_TABLE_AND_USER_DENIED_ACCESS(norm_name, thd)) {
+ DBUG_RETURN(HA_ERR_GENERIC);
}
if (create_info->options & HA_LEX_CREATE_TMP_TABLE) {
flags |= DICT_TF2_TEMPORARY << DICT_TF2_SHIFT;
}
+ /* Get the transaction associated with the current thd, or create one
+ if not yet created */
+
+ 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 */
+
+ trx_search_latch_release_if_reserved(parent_trx);
+
+ trx = innobase_trx_allocate(thd);
+
+ /* Latch the InnoDB data dictionary exclusively so that no deadlocks
+ or lock waits can happen in it during a table create operation.
+ Drop table etc. do this latching in row0mysql.c. */
+
+ row_mysql_lock_data_dictionary(trx);
+
error = create_table_def(trx, form, norm_name,
create_info->options & HA_LEX_CREATE_TMP_TABLE ? name2 : NULL,
flags);
@@ -6964,8 +7023,8 @@ ha_innobase::create(
if (i != (uint) primary_key_no) {
- if ((error = create_index(trx, form, flags, norm_name,
- i))) {
+ if ((error = create_index(trx, form, flags,
+ norm_name, i))) {
goto cleanup;
}
}
@@ -6978,6 +7037,29 @@ ha_innobase::create(
trx, stmt, stmt_len, norm_name,
create_info->options & HA_LEX_CREATE_TMP_TABLE);
+ switch (error) {
+
+ case DB_PARENT_NO_INDEX:
+ push_warning_printf(
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ HA_ERR_CANNOT_ADD_FOREIGN,
+ "Create table '%s' with foreign key constraint"
+ " failed. There is no index in the referenced"
+ " table where the referenced columns appear"
+ " as the first columns.\n", norm_name);
+ break;
+
+ case DB_CHILD_NO_INDEX:
+ push_warning_printf(
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ HA_ERR_CANNOT_ADD_FOREIGN,
+ "Create table '%s' with foreign key constraint"
+ " failed. There is no index in the referencing"
+ " table where referencing columns appear"
+ " as the first columns.\n", norm_name);
+ break;
+ }
+
error = convert_error_code_to_mysql(error, flags, NULL);
if (error) {
@@ -7012,23 +7094,25 @@ ha_innobase::create(
setup at this stage and so we use thd. */
/* We need to copy the AUTOINC value from the old table if
- this is an ALTER TABLE or CREATE INDEX because CREATE INDEX
- does a table copy too. */
+ this is an ALTER|OPTIMIZE TABLE or CREATE INDEX because CREATE INDEX
+ does a table copy too. If query was one of :
+
+ CREATE TABLE ...AUTO_INCREMENT = x; or
+ ALTER TABLE...AUTO_INCREMENT = x; or
+ OPTIMIZE TABLE t; or
+ CREATE INDEX x on t(...);
+
+ Find out a table definition from the dictionary and get
+ the current value of the auto increment field. Set a new
+ value to the auto increment field if the value is greater
+ than the maximum value in the column. */
if (((create_info->used_fields & HA_CREATE_USED_AUTO)
|| thd_sql_command(thd) == SQLCOM_ALTER_TABLE
+ || thd_sql_command(thd) == SQLCOM_OPTIMIZE
|| thd_sql_command(thd) == SQLCOM_CREATE_INDEX)
&& create_info->auto_increment_value > 0) {
- /* Query was one of :
- CREATE TABLE ...AUTO_INCREMENT = x; or
- ALTER TABLE...AUTO_INCREMENT = x; or
- CREATE INDEX x on t(...);
- Find out a table definition from the dictionary and get
- the current value of the auto increment field. Set a new
- value to the auto increment field if the value is greater
- than the maximum value in the column. */
-
auto_inc_value = create_info->auto_increment_value;
dict_table_autoinc_lock(innobase_table);
@@ -7093,33 +7177,21 @@ Deletes all rows of an InnoDB table.
@return error number */
UNIV_INTERN
int
-ha_innobase::delete_all_rows(void)
+ha_innobase::truncate(void)
/*==============================*/
{
int error;
- DBUG_ENTER("ha_innobase::delete_all_rows");
+ DBUG_ENTER("ha_innobase::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(),
- because DELETE is transactional while TRUNCATE is not. */
- DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);
- }
-
/* Truncate the table in InnoDB */
error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx);
- if (error == DB_ERROR) {
- /* Cannot truncate; resort to ha_innobase::delete_row() */
- goto fallback;
- }
error = convert_error_code_to_mysql(error, prebuilt->table->flags,
NULL);
@@ -7169,12 +7241,6 @@ ha_innobase::delete_table(
trx = innobase_trx_allocate(thd);
- if (lower_case_table_names) {
- srv_lower_case_table_names = TRUE;
- } else {
- srv_lower_case_table_names = FALSE;
- }
-
name_len = strlen(name);
ut_a(name_len < 1000);
@@ -7296,12 +7362,6 @@ innobase_rename_table(
char* norm_to;
char* norm_from;
- if (lower_case_table_names) {
- srv_lower_case_table_names = TRUE;
- } else {
- srv_lower_case_table_names = FALSE;
- }
-
// Magic number 64 arbitrary
norm_to = (char*) my_malloc(strlen(to) + 64, MYF(0));
norm_from = (char*) my_malloc(strlen(from) + 64, MYF(0));
@@ -7536,6 +7596,7 @@ ha_innobase::estimate_rows_upper_bound(void)
dict_index_t* index;
ulonglong estimate;
ulonglong local_data_file_length;
+ ulint stat_n_leaf_pages;
DBUG_ENTER("estimate_rows_upper_bound");
@@ -7555,10 +7616,12 @@ ha_innobase::estimate_rows_upper_bound(void)
index = dict_table_get_first_index(prebuilt->table);
- ut_a(index->stat_n_leaf_pages > 0);
+ stat_n_leaf_pages = index->stat_n_leaf_pages;
+
+ ut_a(stat_n_leaf_pages > 0);
local_data_file_length =
- ((ulonglong) index->stat_n_leaf_pages) * UNIV_PAGE_SIZE;
+ ((ulonglong) stat_n_leaf_pages) * UNIV_PAGE_SIZE;
/* Calculate a minimum length for a clustered index record and from
@@ -7707,41 +7770,90 @@ innobase_get_mysql_key_number_for_index(
return(0);
}
+
+/*********************************************************************//**
+Calculate Record Per Key value. Need to exclude the NULL value if
+innodb_stats_method is set to "nulls_ignored"
+@return estimated record per key value */
+static
+ha_rows
+innodb_rec_per_key(
+/*===============*/
+ dict_index_t* index, /*!< in: dict_index_t structure */
+ ulint i, /*!< in: the column we are
+ calculating rec per key */
+ ha_rows records) /*!< in: estimated total records */
+{
+ ha_rows rec_per_key;
+
+ ut_ad(i < dict_index_get_n_unique(index));
+
+ /* Note the stat_n_diff_key_vals[] stores the diff value with
+ n-prefix indexing, so it is always stat_n_diff_key_vals[i + 1] */
+ if (index->stat_n_diff_key_vals[i + 1] == 0) {
+
+ rec_per_key = records;
+ } else if (srv_innodb_stats_method == SRV_STATS_NULLS_IGNORED) {
+ ib_int64_t num_null;
+
+ /* Number of rows with NULL value in this
+ field */
+ num_null = records - index->stat_n_non_null_key_vals[i];
+
+ /* In theory, index->stat_n_non_null_key_vals[i]
+ should always be less than the number of records.
+ Since this is statistics value, the value could
+ have slight discrepancy. But we will make sure
+ the number of null values is not a negative number. */
+ num_null = (num_null < 0) ? 0 : num_null;
+
+ /* If the number of NULL values is the same as or
+ large than that of the distinct values, we could
+ consider that the table consists mostly of NULL value.
+ Set rec_per_key to 1. */
+ if (index->stat_n_diff_key_vals[i + 1] <= num_null) {
+ rec_per_key = 1;
+ } else {
+ /* Need to exclude rows with NULL values from
+ rec_per_key calculation */
+ rec_per_key = (ha_rows)(
+ (records - num_null)
+ / (index->stat_n_diff_key_vals[i + 1]
+ - num_null));
+ }
+ } else {
+ rec_per_key = (ha_rows)
+ (records / index->stat_n_diff_key_vals[i + 1]);
+ }
+
+ return(rec_per_key);
+}
+
/*********************************************************************//**
Returns statistics information of the table to the MySQL interpreter,
in various fields of the handle object. */
UNIV_INTERN
int
-ha_innobase::info(
-/*==============*/
- uint flag) /*!< in: what information MySQL requests */
+ha_innobase::info_low(
+/*==================*/
+ uint flag, /*!< in: what information MySQL
+ requests */
+ bool called_from_analyze) /* in: TRUE if called from
+ ::analyze() */
{
dict_table_t* ib_table;
dict_index_t* index;
ha_rows rec_per_key;
ib_int64_t n_rows;
- ulong j;
- ulong i;
char path[FN_REFLEN];
os_file_stat_t stat_info;
-
DBUG_ENTER("info");
/* If we are forcing recovery at a high level, we will suppress
statistics calculation on tables, because that may crash the
server if an index is badly corrupted. */
- if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
-
- /* 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. */
@@ -7758,13 +7870,15 @@ ha_innobase::info(
ib_table = prebuilt->table;
if (flag & HA_STATUS_TIME) {
- if (innobase_stats_on_metadata) {
+ if (called_from_analyze || innobase_stats_on_metadata) {
/* In sql_show we call with this flag: update
then statistics so that they are up-to-date */
prebuilt->trx->op_info = "updating table statistics";
- dict_update_statistics(ib_table);
+ dict_update_statistics(ib_table,
+ FALSE /* update even if stats
+ are initialized */);
prebuilt->trx->op_info = "returning various info to MySQL";
}
@@ -7783,6 +7897,9 @@ ha_innobase::info(
}
if (flag & HA_STATUS_VARIABLE) {
+
+ dict_table_stats_lock(ib_table, RW_S_LATCH);
+
n_rows = ib_table->stat_n_rows;
/* Because we do not protect stat_n_rows by any mutex in a
@@ -7832,29 +7949,33 @@ ha_innobase::info(
ib_table->stat_sum_of_other_index_sizes)
* UNIV_PAGE_SIZE;
+ dict_table_stats_unlock(ib_table, RW_S_LATCH);
+
/* Since fsp_get_available_space_in_free_extents() is
acquiring latches inside InnoDB, we do not call it if we
are asked by MySQL to avoid locking. Another reason to
avoid the call is that it uses quite a lot of CPU.
- See Bug#38185.
- We do not update delete_length if no locking is requested
- so the "old" value can remain. delete_length is initialized
- to 0 in the ha_statistics' constructor. */
- if (!(flag & HA_STATUS_NO_LOCK)) {
-
- /* lock the data dictionary to avoid races with
- ibd_file_missing and tablespace_discarded */
- row_mysql_lock_data_dictionary(prebuilt->trx);
-
- /* ib_table->space must be an existent tablespace */
- if (!ib_table->ibd_file_missing
- && !ib_table->tablespace_discarded) {
-
- stats.delete_length =
- fsp_get_available_space_in_free_extents(
- ib_table->space) * 1024;
- } else {
+ See Bug#38185. */
+ if (flag & HA_STATUS_NO_LOCK
+ || !(flag & HA_STATUS_VARIABLE_EXTRA)) {
+ /* We do not update delete_length if no
+ locking is requested so the "old" value can
+ remain. delete_length is initialized to 0 in
+ the ha_statistics' constructor. Also we only
+ need delete_length to be set when
+ HA_STATUS_VARIABLE_EXTRA is set */
+ } else if (UNIV_UNLIKELY
+ (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE)) {
+ /* Avoid accessing the tablespace if
+ innodb_crash_recovery is set to a high value. */
+ stats.delete_length = 0;
+ } else {
+ ullint avail_space;
+
+ avail_space = fsp_get_available_space_in_free_extents(
+ ib_table->space);
+ if (avail_space == ULLINT_UNDEFINED) {
THD* thd;
thd = ha_thd();
@@ -7871,9 +7992,9 @@ ha_innobase::info(
ib_table->name);
stats.delete_length = 0;
+ } else {
+ stats.delete_length = avail_space * 1024;
}
-
- row_mysql_unlock_data_dictionary(prebuilt->trx);
}
stats.check_time = 0;
@@ -7886,6 +8007,7 @@ ha_innobase::info(
}
if (flag & HA_STATUS_CONST) {
+ ulong i;
/* Verify the number of index in InnoDB and MySQL
matches up. If prebuilt->clust_index_was_generated
holds, InnoDB defines GEN_CLUST_INDEX internally */
@@ -7901,7 +8023,10 @@ ha_innobase::info(
table->s->keys);
}
+ dict_table_stats_lock(ib_table, RW_S_LATCH);
+
for (i = 0; i < table->s->keys; i++) {
+ ulong j;
/* We could get index quickly through internal
index mapping with the index translation table.
The identity of index (match up index name with
@@ -7937,17 +8062,8 @@ ha_innobase::info(
break;
}
- dict_index_stat_mutex_enter(index);
-
- if (index->stat_n_diff_key_vals[j + 1] == 0) {
-
- rec_per_key = stats.records;
- } else {
- rec_per_key = (ha_rows)(stats.records /
- index->stat_n_diff_key_vals[j + 1]);
- }
-
- dict_index_stat_mutex_exit(index);
+ rec_per_key = innodb_rec_per_key(
+ index, j, stats.records);
/* Since MySQL seems to favor table scans
too much over index searches, we pretend
@@ -7965,6 +8081,13 @@ ha_innobase::info(
(ulong) rec_per_key;
}
}
+
+ dict_table_stats_unlock(ib_table, RW_S_LATCH);
+ }
+
+ if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) {
+
+ goto func_exit;
}
if (flag & HA_STATUS_ERRKEY) {
@@ -7987,11 +8110,24 @@ ha_innobase::info(
stats.auto_increment_value = innobase_peek_autoinc();
}
+func_exit:
prebuilt->trx->op_info = (char*)"";
DBUG_RETURN(0);
}
+/*********************************************************************//**
+Returns statistics information of the table to the MySQL interpreter,
+in various fields of the handle object. */
+UNIV_INTERN
+int
+ha_innobase::info(
+/*==============*/
+ uint flag) /*!< in: what information MySQL requests */
+{
+ return(info_low(flag, false /* not called from analyze */));
+}
+
/**********************************************************************//**
Updates index cardinalities of the table, based on 8 random dives into
each index tree. This does NOT calculate exact statistics on the table.
@@ -8004,7 +8140,8 @@ ha_innobase::analyze(
HA_CHECK_OPT* check_opt) /*!< in: currently ignored */
{
/* Simply call ::info() with all the flags */
- info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE);
+ info_low(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE,
+ true /* called from analyze */);
return(0);
}
@@ -8305,8 +8442,6 @@ ha_innobase::get_foreign_key_create_info(void)
flen = ftell(srv_dict_tmpfile);
if (flen < 0) {
flen = 0;
- } else if (flen > 64000 - 1) {
- flen = 64000 - 1;
}
/* allocate buffer for the string, and
@@ -8326,136 +8461,199 @@ ha_innobase::get_foreign_key_create_info(void)
}
+/***********************************************************************//**
+Maps a InnoDB foreign key constraint to a equivalent MySQL foreign key info.
+@return pointer to foreign key info */
+static
+FOREIGN_KEY_INFO*
+get_foreign_key_info(
+/*=================*/
+ THD* thd, /*!< in: user thread handle */
+ dict_foreign_t* foreign) /*!< in: foreign key constraint */
+{
+ FOREIGN_KEY_INFO f_key_info;
+ FOREIGN_KEY_INFO* pf_key_info;
+ uint i = 0;
+ ulint len;
+ char tmp_buff[NAME_LEN+1];
+ char name_buff[NAME_LEN+1];
+ const char* ptr;
+ LEX_STRING* referenced_key_name;
+ LEX_STRING* name = NULL;
+
+ ptr = dict_remove_db_name(foreign->id);
+ f_key_info.foreign_id = thd_make_lex_string(thd, 0, ptr,
+ (uint) strlen(ptr), 1);
+
+ /* Name format: database name, '/', table name, '\0' */
+
+ /* Referenced (parent) database name */
+ len = dict_get_db_name_len(foreign->referenced_table_name);
+ ut_a(len < sizeof(tmp_buff));
+ ut_memcpy(tmp_buff, foreign->referenced_table_name, len);
+ tmp_buff[len] = 0;
+
+ len = filename_to_tablename(tmp_buff, name_buff, sizeof(name_buff));
+ f_key_info.referenced_db = thd_make_lex_string(thd, 0, name_buff, len, 1);
+
+ /* Referenced (parent) table name */
+ ptr = dict_remove_db_name(foreign->referenced_table_name);
+ len = filename_to_tablename(ptr, name_buff, sizeof(name_buff));
+ f_key_info.referenced_table = thd_make_lex_string(thd, 0, name_buff, len, 1);
+
+ /* Dependent (child) database name */
+ len = dict_get_db_name_len(foreign->foreign_table_name);
+ ut_a(len < sizeof(tmp_buff));
+ ut_memcpy(tmp_buff, foreign->foreign_table_name, len);
+ tmp_buff[len] = 0;
+
+ len = filename_to_tablename(tmp_buff, name_buff, sizeof(name_buff));
+ f_key_info.foreign_db = thd_make_lex_string(thd, 0, name_buff, len, 1);
+
+ /* Dependent (child) table name */
+ ptr = dict_remove_db_name(foreign->foreign_table_name);
+ len = filename_to_tablename(ptr, name_buff, sizeof(name_buff));
+ f_key_info.foreign_table = thd_make_lex_string(thd, 0, name_buff, len, 1);
+
+ do {
+ ptr = foreign->foreign_col_names[i];
+ name = thd_make_lex_string(thd, name, ptr,
+ (uint) strlen(ptr), 1);
+ f_key_info.foreign_fields.push_back(name);
+ ptr = foreign->referenced_col_names[i];
+ name = thd_make_lex_string(thd, name, ptr,
+ (uint) strlen(ptr), 1);
+ f_key_info.referenced_fields.push_back(name);
+ } while (++i < foreign->n_fields);
+
+ if (foreign->type & DICT_FOREIGN_ON_DELETE_CASCADE) {
+ len = 7;
+ ptr = "CASCADE";
+ } else if (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL) {
+ len = 8;
+ ptr = "SET NULL";
+ } else if (foreign->type & DICT_FOREIGN_ON_DELETE_NO_ACTION) {
+ len = 9;
+ ptr = "NO ACTION";
+ } else {
+ len = 8;
+ ptr = "RESTRICT";
+ }
+
+ f_key_info.delete_method = thd_make_lex_string(thd,
+ f_key_info.delete_method,
+ ptr, len, 1);
+
+ if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE) {
+ len = 7;
+ ptr = "CASCADE";
+ } else if (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL) {
+ len = 8;
+ ptr = "SET NULL";
+ } else if (foreign->type & DICT_FOREIGN_ON_UPDATE_NO_ACTION) {
+ len = 9;
+ ptr = "NO ACTION";
+ } else {
+ len = 8;
+ ptr = "RESTRICT";
+ }
+
+ f_key_info.update_method = thd_make_lex_string(thd,
+ f_key_info.update_method,
+ ptr, len, 1);
+
+ if (foreign->referenced_index && foreign->referenced_index->name) {
+ referenced_key_name = thd_make_lex_string(thd,
+ f_key_info.referenced_key_name,
+ foreign->referenced_index->name,
+ (uint) strlen(foreign->referenced_index->name),
+ 1);
+ } else {
+ referenced_key_name = NULL;
+ }
+
+ f_key_info.referenced_key_name = referenced_key_name;
+
+ pf_key_info = (FOREIGN_KEY_INFO *) thd_memdup(thd, &f_key_info,
+ sizeof(FOREIGN_KEY_INFO));
+
+ return(pf_key_info);
+}
+
+/*******************************************************************//**
+Gets the list of foreign keys in this table.
+@return always 0, that is, always succeeds */
UNIV_INTERN
int
-ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
-{
- dict_foreign_t* foreign;
-
- DBUG_ENTER("get_foreign_key_list");
- ut_a(prebuilt != NULL);
- update_thd(ha_thd());
- prebuilt->trx->op_info = (char*)"getting list of foreign keys";
- trx_search_latch_release_if_reserved(prebuilt->trx);
- mutex_enter(&(dict_sys->mutex));
- foreign = UT_LIST_GET_FIRST(prebuilt->table->foreign_list);
-
- while (foreign != NULL) {
- uint i;
- FOREIGN_KEY_INFO f_key_info;
- LEX_STRING *name= 0;
- uint ulen;
- char uname[NAME_LEN+1]; /* Unencoded name */
- char db_name[NAME_LEN+1];
- const char *tmp_buff;
-
- tmp_buff= foreign->id;
- i= 0;
- while (tmp_buff[i] != '/')
- i++;
- tmp_buff+= i + 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 */
- i= 0;
- while (tmp_buff[i] != '/')
- {
- db_name[i]= tmp_buff[i];
- i++;
- }
- db_name[i]= 0;
- ulen= filename_to_tablename(db_name, uname, sizeof(uname));
- 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 = thd_make_lex_string(thd, 0,
- uname, ulen, 1);
-
- for (i= 0;;) {
- tmp_buff= foreign->foreign_col_names[i];
- 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 = 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;
- }
-
- ulong length;
- if (foreign->type & DICT_FOREIGN_ON_DELETE_CASCADE)
- {
- length=7;
- tmp_buff= "CASCADE";
- }
- else if (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL)
- {
- length=8;
- tmp_buff= "SET NULL";
- }
- else if (foreign->type & DICT_FOREIGN_ON_DELETE_NO_ACTION)
- {
- length=9;
- tmp_buff= "NO ACTION";
- }
- else
- {
- length=8;
- tmp_buff= "RESTRICT";
- }
- 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)
- {
- length=7;
- tmp_buff= "CASCADE";
- }
- else if (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL)
- {
- length=8;
- tmp_buff= "SET NULL";
- }
- else if (foreign->type & DICT_FOREIGN_ON_UPDATE_NO_ACTION)
- {
- length=9;
- tmp_buff= "NO ACTION";
- }
- else
- {
- length=8;
- tmp_buff= "RESTRICT";
- }
- 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 = thd_make_lex_string(
- thd, f_key_info.referenced_key_name,
- foreign->referenced_index->name,
- (uint) strlen(foreign->referenced_index->name), 1);
- }
- else
- f_key_info.referenced_key_name= 0;
-
- 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);
- }
- mutex_exit(&(dict_sys->mutex));
- prebuilt->trx->op_info = (char*)"";
+ha_innobase::get_foreign_key_list(
+/*==============================*/
+ THD* thd, /*!< in: user thread handle */
+ List<FOREIGN_KEY_INFO>* f_key_list) /*!< out: foreign key list */
+{
+ FOREIGN_KEY_INFO* pf_key_info;
+ dict_foreign_t* foreign;
+
+ ut_a(prebuilt != NULL);
+ update_thd(ha_thd());
+
+ prebuilt->trx->op_info = "getting list of foreign keys";
+
+ trx_search_latch_release_if_reserved(prebuilt->trx);
+
+ mutex_enter(&(dict_sys->mutex));
+
+ for (foreign = UT_LIST_GET_FIRST(prebuilt->table->foreign_list);
+ foreign != NULL;
+ foreign = UT_LIST_GET_NEXT(foreign_list, foreign)) {
+ pf_key_info = get_foreign_key_info(thd, foreign);
+ if (pf_key_info) {
+ f_key_list->push_back(pf_key_info);
+ }
+ }
+
+ mutex_exit(&(dict_sys->mutex));
+
+ prebuilt->trx->op_info = "";
+
+ return(0);
+}
+
+/*******************************************************************//**
+Gets the set of foreign keys where this table is the referenced table.
+@return always 0, that is, always succeeds */
+UNIV_INTERN
+int
+ha_innobase::get_parent_foreign_key_list(
+/*=====================================*/
+ THD* thd, /*!< in: user thread handle */
+ List<FOREIGN_KEY_INFO>* f_key_list) /*!< out: foreign key list */
+{
+ FOREIGN_KEY_INFO* pf_key_info;
+ dict_foreign_t* foreign;
+
+ ut_a(prebuilt != NULL);
+ update_thd(ha_thd());
+
+ prebuilt->trx->op_info = "getting list of referencing foreign keys";
+
+ trx_search_latch_release_if_reserved(prebuilt->trx);
+
+ mutex_enter(&(dict_sys->mutex));
+
+ for (foreign = UT_LIST_GET_FIRST(prebuilt->table->referenced_list);
+ foreign != NULL;
+ foreign = UT_LIST_GET_NEXT(referenced_list, foreign)) {
+ pf_key_info = get_foreign_key_info(thd, foreign);
+ if (pf_key_info) {
+ f_key_list->push_back(pf_key_info);
+ }
+ }
+
+ mutex_exit(&(dict_sys->mutex));
+
+ prebuilt->trx->op_info = "";
- DBUG_RETURN(0);
+ return(0);
}
/*****************************************************************//**
@@ -8646,39 +8844,30 @@ ha_innobase::start_stmt(
prepared for an update of a row */
prebuilt->select_lock_type = LOCK_X;
- } else {
- if (trx->isolation_level != TRX_ISO_SERIALIZABLE
- && thd_sql_command(thd) == SQLCOM_SELECT
- && lock_type == TL_READ) {
- /* For other than temporary tables, we obtain
- no lock for consistent read (plain SELECT). */
+ } else if (trx->isolation_level != TRX_ISO_SERIALIZABLE
+ && thd_sql_command(thd) == SQLCOM_SELECT
+ && lock_type == TL_READ) {
- prebuilt->select_lock_type = LOCK_NONE;
- } else {
- /* Not a consistent read: restore the
- select_lock_type value. The value of
- stored_select_lock_type was decided in:
- 1) ::store_lock(),
- 2) ::external_lock(),
- 3) ::init_table_handle_for_HANDLER(), and
- 4) ::transactional_table_lock(). */
+ /* For other than temporary tables, we obtain
+ no lock for consistent read (plain SELECT). */
- prebuilt->select_lock_type =
- prebuilt->stored_select_lock_type;
- }
- }
+ prebuilt->select_lock_type = LOCK_NONE;
+ } else {
+ /* Not a consistent read: restore the
+ select_lock_type value. The value of
+ stored_select_lock_type was decided in:
+ 1) ::store_lock(),
+ 2) ::external_lock(),
+ 3) ::init_table_handle_for_HANDLER(), and
+ 4) ::transactional_table_lock(). */
- trx->detailed_error[0] = '\0';
+ prebuilt->select_lock_type = prebuilt->stored_select_lock_type;
+ }
- /* Set the MySQL flag to mark that there is an active transaction */
- if (trx->active_trans == 0) {
+ *trx->detailed_error = 0;
- innobase_register_trx_and_stmt(ht, thd);
- trx->active_trans = 1;
- } else {
- innobase_register_stmt(ht, thd);
- }
+ innobase_register_trx(ht, thd, trx);
return(0);
}
@@ -8767,22 +8956,14 @@ ha_innobase::external_lock(
if (lock_type != F_UNLCK) {
/* MySQL is setting a new table lock */
- trx->detailed_error[0] = '\0';
+ *trx->detailed_error = 0;
- /* Set the MySQL flag to mark that there is an active
- transaction */
- if (trx->active_trans == 0) {
-
- innobase_register_trx_and_stmt(ht, thd);
- trx->active_trans = 1;
- } else if (trx->n_mysql_tables_in_use == 0) {
- innobase_register_stmt(ht, thd);
- }
+ innobase_register_trx(ht, thd, trx);
if (trx->isolation_level == TRX_ISO_SERIALIZABLE
- && prebuilt->select_lock_type == LOCK_NONE
- && thd_test_options(thd,
- OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
+ && prebuilt->select_lock_type == LOCK_NONE
+ && 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
@@ -8852,19 +9033,20 @@ ha_innobase::external_lock(
trx->mysql_n_tables_locked = 0;
prebuilt->used_in_HANDLER = FALSE;
- if (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
- if (trx->active_trans != 0) {
+ if (!thd_test_options(
+ thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
+
+ if (trx_is_started(trx)) {
innobase_commit(ht, thd, TRUE);
}
- } else {
- if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
- && trx->global_read_view) {
- /* At low transaction isolation levels we let
- each consistent read set its own snapshot */
+ } else if (trx->isolation_level <= TRX_ISO_READ_COMMITTED
+ && trx->global_read_view) {
- read_view_close_for_mysql(trx);
- }
+ /* At low transaction isolation levels we let
+ each consistent read set its own snapshot */
+
+ read_view_close_for_mysql(trx);
}
}
@@ -8933,12 +9115,7 @@ ha_innobase::transactional_table_lock(
/* MySQL is setting a new transactional table lock */
- /* Set the MySQL flag to mark that there is an active transaction */
- if (trx->active_trans == 0) {
-
- innobase_register_trx_and_stmt(ht, thd);
- trx->active_trans = 1;
- }
+ innobase_register_trx(ht, thd, trx);
if (THDVAR(thd, table_locks) && thd_in_lock_tables(thd)) {
ulint error = DB_SUCCESS;
@@ -8951,7 +9128,8 @@ ha_innobase::transactional_table_lock(
DBUG_RETURN((int) error);
}
- if (thd_test_options(thd, 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
@@ -8989,7 +9167,7 @@ innodb_show_status(
{
trx_t* trx;
static const char truncated_msg[] = "... truncated...\n";
- const long MAX_STATUS_SIZE = 64000;
+ const long MAX_STATUS_SIZE = 1048576;
ulint trx_list_start = ULINT_UNDEFINED;
ulint trx_list_end = ULINT_UNDEFINED;
@@ -9019,6 +9197,7 @@ innodb_show_status(
if (flen > MAX_STATUS_SIZE) {
usable_len = MAX_STATUS_SIZE;
+ srv_truncated_status_writes++;
} else {
usable_len = flen;
}
@@ -9112,7 +9291,8 @@ innodb_mutex_show_status(
if (mutex->count_using > 0) {
buf1len= my_snprintf(buf1, sizeof(buf1),
"%s:%s",
- mutex->cmutex_name, mutex->cfile_name);
+ mutex->cmutex_name,
+ innobase_basename(mutex->cfile_name));
buf2len= my_snprintf(buf2, sizeof(buf2),
"count=%lu, spin_waits=%lu,"
" spin_rounds=%lu, "
@@ -9142,7 +9322,8 @@ innodb_mutex_show_status(
}
#else /* UNIV_DEBUG */
buf1len= (uint) my_snprintf(buf1, sizeof(buf1), "%s:%lu",
- mutex->cfile_name, (ulong) mutex->cline);
+ innobase_basename(mutex->cfile_name),
+ (ulong) mutex->cline);
buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",
(ulong) mutex->count_os_wait);
@@ -9158,7 +9339,8 @@ innodb_mutex_show_status(
if (block_mutex) {
buf1len = (uint) my_snprintf(buf1, sizeof buf1,
"combined %s:%lu",
- block_mutex->cfile_name,
+ innobase_basename(
+ block_mutex->cfile_name),
(ulong) block_mutex->cline);
buf2len = (uint) my_snprintf(buf2, sizeof buf2,
"os_waits=%lu",
@@ -9189,7 +9371,8 @@ innodb_mutex_show_status(
}
buf1len = my_snprintf(buf1, sizeof buf1, "%s:%lu",
- lock->cfile_name, (ulong) lock->cline);
+ innobase_basename(lock->cfile_name),
+ (ulong) lock->cline);
buf2len = my_snprintf(buf2, sizeof buf2, "os_waits=%lu",
(ulong) lock->count_os_wait);
@@ -9204,7 +9387,8 @@ innodb_mutex_show_status(
if (block_lock) {
buf1len = (uint) my_snprintf(buf1, sizeof buf1,
"combined %s:%lu",
- block_lock->cfile_name,
+ innobase_basename(
+ block_lock->cfile_name),
(ulong) block_lock->cline);
buf2len = (uint) my_snprintf(buf2, sizeof buf2,
"os_waits=%lu",
@@ -9574,7 +9758,7 @@ ha_innobase::innobase_get_autoinc(
}
/*******************************************************************//**
-This function reads the global auto-inc counter. It doesn't use the
+This function reads the global auto-inc counter. It doesn't use the
AUTOINC lock even if the lock mode is set to TRADITIONAL.
@return the autoinc value */
UNIV_INTERN
@@ -9594,7 +9778,11 @@ ha_innobase::innobase_peek_autoinc(void)
auto_inc = dict_table_autoinc_read(innodb_table);
- ut_a(auto_inc > 0);
+ if (auto_inc == 0) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: AUTOINC next value generation "
+ "is disabled for '%s'\n", innodb_table->name);
+ }
dict_table_autoinc_unlock(innodb_table);
@@ -9987,19 +10175,19 @@ innobase_xa_prepare(
innobase_release_stat_resources(trx);
- if (trx->active_trans == 0 && trx->conc_state != TRX_NOT_STARTED) {
+ if (!trx_is_registered_for_2pc(trx) && trx_is_started(trx)) {
- sql_print_error("trx->active_trans == 0, but trx->conc_state != "
- "TRX_NOT_STARTED");
+ sql_print_error("Transaction not registered for MySQL 2PC, "
+ "but transaction is active");
}
if (all
- || (!thd_test_options(thd, 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 */
- ut_ad(trx->active_trans);
+ ut_ad(trx_is_registered_for_2pc(trx));
error = (int) trx_prepare_for_mysql(trx);
} else {
@@ -10023,9 +10211,10 @@ innobase_xa_prepare(
srv_active_wake_master_thread();
- if (thd_sql_command(thd) != SQLCOM_XA_PREPARE &&
- (all || !thd_test_options(thd, 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
and InnoDB must be the same. Consider the situation
@@ -10046,7 +10235,7 @@ innobase_xa_prepare(
will be between XA PREPARE and XA COMMIT, and we don't want
to block for undefined period of time. */
mysql_mutex_lock(&prepare_commit_mutex);
- trx->active_trans = 2;
+ trx_owns_prepare_commit_mutex_set(trx);
}
return(error);
@@ -10081,8 +10270,8 @@ static
int
innobase_commit_by_xid(
/*===================*/
- handlerton *hton,
- XID* xid) /*!< in: X/Open XA transaction identification */
+ handlerton* hton,
+ XID* xid) /*!< in: X/Open XA transaction identification */
{
trx_t* trx;
@@ -10092,7 +10281,7 @@ innobase_commit_by_xid(
if (trx) {
innobase_commit_low(trx);
-
+ trx_free_for_background(trx);
return(XA_OK);
} else {
return(XAER_NOTA);
@@ -10118,7 +10307,9 @@ innobase_rollback_by_xid(
trx = trx_get_trx_by_xid(xid);
if (trx) {
- return(innobase_rollback_trx(trx));
+ int ret = innobase_rollback_trx(trx);
+ trx_free_for_background(trx);
+ return(ret);
} else {
return(XAER_NOTA);
}
@@ -10751,19 +10942,19 @@ static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff)
return 0;
}
-/***********************************************************************
+/*********************************************************************//**
This function checks each index name for a table against reserved
-system default primary index name 'GEN_CLUST_INDEX'. If a name matches,
-this function pushes an warning message to the client, and returns true. */
+system default primary index name 'GEN_CLUST_INDEX'. If a name
+matches, this function pushes an warning message to the client,
+and returns true.
+@return true if the index name matches the reserved name */
extern "C" UNIV_INTERN
bool
innobase_index_name_is_reserved(
/*============================*/
- /* out: true if an index name
- matches the reserved name */
- const trx_t* trx, /* in: InnoDB transaction handle */
- const KEY* key_info, /* in: Indexes to be created */
- ulint num_of_keys) /* in: Number of indexes to
+ THD* thd, /*!< in/out: MySQL connection */
+ const KEY* key_info, /*!< in: Indexes to be created */
+ ulint num_of_keys) /*!< in: Number of indexes to
be created. */
{
const KEY* key;
@@ -10775,7 +10966,7 @@ innobase_index_name_is_reserved(
if (innobase_strcasecmp(key->name,
innobase_index_reserve_name) == 0) {
/* Push warning to mysql */
- push_warning_printf((THD*) trx->mysql_thd,
+ push_warning_printf(thd,
MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WRONG_NAME_FOR_INDEX,
"Cannot Create Index with name "
@@ -10827,16 +11018,23 @@ static MYSQL_SYSVAR_ULONG(io_capacity, srv_io_capacity,
static MYSQL_SYSVAR_ULONG(purge_batch_size, srv_purge_batch_size,
PLUGIN_VAR_OPCMDARG,
- "Number of UNDO logs to purge in one batch from the history list. "
- "Default is 20",
+ "Number of UNDO log pages to purge in one batch from the history list.",
NULL, NULL,
20, /* Default setting */
1, /* Minimum value */
5000, 0); /* Maximum value */
+static MYSQL_SYSVAR_ULONG(rollback_segments, srv_rollback_segments,
+ PLUGIN_VAR_OPCMDARG,
+ "Number of UNDO logs to use.",
+ NULL, NULL,
+ 128, /* Default setting */
+ 1, /* Minimum value */
+ TRX_SYS_N_RSEGS, 0); /* Maximum value */
+
static MYSQL_SYSVAR_ULONG(purge_threads, srv_n_purge_threads,
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
- "Purge threads can be either 0 or 1. Default is 0.",
+ "Purge threads can be either 0 or 1.",
NULL, NULL,
0, /* Default setting */
0, /* Minimum value */
@@ -10851,13 +11049,13 @@ static MYSQL_SYSVAR_ULONG(fast_shutdown, innobase_fast_shutdown,
static MYSQL_SYSVAR_BOOL(file_per_table, srv_file_per_table,
PLUGIN_VAR_NOCMDARG,
"Stores each InnoDB table to an .ibd file in the database dir.",
- NULL, NULL, TRUE);
+ NULL, NULL, FALSE);
static MYSQL_SYSVAR_STR(file_format, innobase_file_format_name,
PLUGIN_VAR_RQCMDARG,
"File format to use for new tables in .ibd files.",
innodb_file_format_name_validate,
- innodb_file_format_name_update, "Barracuda");
+ innodb_file_format_name_update, "Antelope");
/* "innobase_file_format_check" decides whether we would continue
booting the server if the file format stamped on the system
@@ -10891,6 +11089,11 @@ static MYSQL_SYSVAR_STR(flush_method, innobase_file_flush_method,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"With which method to flush data.", NULL, NULL, NULL);
+static MYSQL_SYSVAR_BOOL(large_prefix, innobase_large_prefix,
+ PLUGIN_VAR_NOCMDARG,
+ "Support large index prefix length of REC_VERSION_56_MAX_INDEX_COL_LEN (3072) bytes.",
+ NULL, NULL, FALSE);
+
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.",
@@ -11102,6 +11305,20 @@ static MYSQL_SYSVAR_STR(change_buffering, innobase_change_buffering,
innodb_change_buffering_validate,
innodb_change_buffering_update, "all");
+static MYSQL_SYSVAR_ENUM(stats_method, srv_innodb_stats_method,
+ PLUGIN_VAR_RQCMDARG,
+ "Specifies how InnoDB index statistics collection code should "
+ "treat NULLs. Possible values are NULLS_EQUAL (default), "
+ "NULLS_UNEQUAL and NULLS_IGNORED",
+ NULL, NULL, SRV_STATS_NULLS_EQUAL, &innodb_stats_method_typelib);
+
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+static MYSQL_SYSVAR_UINT(change_buffering_debug, ibuf_debug,
+ PLUGIN_VAR_RQCMDARG,
+ "Debug flags for InnoDB change buffering (0=none)",
+ NULL, NULL, 0, 0, 1, 0);
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
static MYSQL_SYSVAR_ULONG(read_ahead_threshold, srv_read_ahead_threshold,
PLUGIN_VAR_RQCMDARG,
"Number of pages that must be accessed sequentially for InnoDB to "
@@ -11130,6 +11347,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(flush_log_at_trx_commit),
MYSQL_SYSVAR(flush_method),
MYSQL_SYSVAR(force_recovery),
+ MYSQL_SYSVAR(large_prefix),
MYSQL_SYSVAR(locks_unsafe_for_binlog),
MYSQL_SYSVAR(lock_wait_timeout),
#ifdef UNIV_LOG_ARCHIVE
@@ -11151,6 +11369,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(stats_on_metadata),
MYSQL_SYSVAR(stats_sample_pages),
MYSQL_SYSVAR(adaptive_hash_index),
+ MYSQL_SYSVAR(stats_method),
MYSQL_SYSVAR(replication_delay),
MYSQL_SYSVAR(status_file),
MYSQL_SYSVAR(strict_mode),
@@ -11165,10 +11384,14 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(use_sys_malloc),
MYSQL_SYSVAR(use_native_aio),
MYSQL_SYSVAR(change_buffering),
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+ MYSQL_SYSVAR(change_buffering_debug),
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
MYSQL_SYSVAR(read_ahead_threshold),
MYSQL_SYSVAR(io_capacity),
MYSQL_SYSVAR(purge_threads),
MYSQL_SYSVAR(purge_batch_size),
+ MYSQL_SYSVAR(rollback_segments),
NULL
};
@@ -11177,7 +11400,7 @@ mysql_declare_plugin(innobase)
MYSQL_STORAGE_ENGINE_PLUGIN,
&innobase_storage_engine,
innobase_hton_name,
- "Innobase Oy",
+ plugin_author,
"Supports transactions, row-level locking, and foreign keys",
PLUGIN_LICENSE_GPL,
innobase_init, /* Plugin Init */
@@ -11193,15 +11416,7 @@ i_s_innodb_lock_waits,
i_s_innodb_cmp,
i_s_innodb_cmp_reset,
i_s_innodb_cmpmem,
-i_s_innodb_cmpmem_reset,
-i_s_innodb_sys_tables,
-i_s_innodb_sys_tablestats,
-i_s_innodb_sys_indexes,
-i_s_innodb_sys_columns,
-i_s_innodb_sys_fields,
-i_s_innodb_sys_foreign,
-i_s_innodb_sys_foreign_cols
-
+i_s_innodb_cmpmem_reset
mysql_declare_plugin_end;
/** @brief Initialize the default value of innodb_commit_concurrency.
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index 8f118199ad8..7ab91a12e81 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -109,6 +109,7 @@ class ha_innobase: public handler
ulint innobase_update_autoinc(ulonglong auto_inc);
void innobase_initialize_autoinc();
dict_index_t* innobase_get_index(uint keynr);
+ int info_low(uint flag, bool called_from_analyze);
/* Init values for the class: */
public:
@@ -178,13 +179,15 @@ class ha_innobase: public handler
void update_create_info(HA_CREATE_INFO* create_info);
int create(const char *name, register TABLE *form,
HA_CREATE_INFO *create_info);
- int delete_all_rows();
+ int truncate();
int delete_table(const char *name);
int rename_table(const char* from, const char* to);
int check(THD* thd, HA_CHECK_OPT* check_opt);
char* update_table_comment(const char* comment);
char* get_foreign_key_create_info();
int get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list);
+ int get_parent_foreign_key_list(THD *thd,
+ List<FOREIGN_KEY_INFO> *f_key_list);
bool can_switch_engines();
uint referenced_by_foreign_key();
void free_foreign_key_create_info(char* str);
@@ -212,7 +215,9 @@ class ha_innobase: public handler
bool primary_key_is_clustered();
int cmp_ref(const uchar *ref1, const uchar *ref2);
/** Fast index creation (smart ALTER TABLE) @see handler0alter.cc @{ */
- int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys);
+ int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys,
+ handler_add_index **add);
+ int final_add_index(handler_add_index *add, bool commit);
int prepare_drop_index(TABLE *table_arg, uint *key_num,
uint num_of_keys);
int final_drop_index(TABLE *table_arg);
@@ -273,14 +278,13 @@ int thd_binlog_format(const MYSQL_THD thd);
*/
void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all);
-#if MYSQL_VERSION_ID > 50140
/**
Check if binary logging is filtered for thread's current db.
@param thd Thread handle
@retval 1 the query is not filtered, 0 otherwise.
*/
bool thd_binlog_filter_ok(const MYSQL_THD thd);
-#endif /* MYSQL_VERSION_ID > 50140 */
+
/**
Check if the query may generate row changes which
may end up in the binary.
@@ -319,15 +323,14 @@ innobase_trx_allocate(
This function checks each index name for a table against reserved
system default primary index name 'GEN_CLUST_INDEX'. If a name
matches, this function pushes an warning message to the client,
-and returns true. */
+and returns true.
+@return true if the index name matches the reserved name */
extern "C"
bool
innobase_index_name_is_reserved(
/*============================*/
- /* out: true if the index name
- matches the reserved name */
- const trx_t* trx, /* in: InnoDB transaction handle */
- const KEY* key_info, /* in: Indexes to be created */
- ulint num_of_keys); /* in: Number of indexes to
+ THD* thd, /*!< in/out: MySQL connection */
+ const KEY* key_info, /*!< in: Indexes to be created */
+ ulint num_of_keys); /*!< in: Number of indexes to
be created. */
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 3744d16570c..6d5b7b4668f 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -539,7 +539,7 @@ innobase_create_key_def(
if (!new_primary && (key_info->flags & HA_NOSAME)
&& (!(key_info->flags & HA_KEY_HAS_PART_KEY_SEG))
&& row_table_got_default_clust_index(table)) {
- uint key_part = key_info->key_parts;
+ uint key_part = key_info->key_parts;
new_primary = TRUE;
@@ -595,6 +595,27 @@ innobase_create_key_def(
}
/*******************************************************************//**
+Check each index column size, make sure they do not exceed the max limit
+@return HA_ERR_INDEX_COL_TOO_LONG if index column size exceeds limit */
+static
+int
+innobase_check_column_length(
+/*=========================*/
+ const dict_table_t*table, /*!< in: table definition */
+ const KEY* key_info) /*!< in: Indexes to be created */
+{
+ ulint max_col_len = DICT_MAX_FIELD_LEN_BY_FORMAT(table);
+
+ for (ulint key_part = 0; key_part < key_info->key_parts; key_part++) {
+ if (key_info->key_part[key_part].length > max_col_len) {
+ my_error(ER_INDEX_COLUMN_TOO_LONG, MYF(0), max_col_len);
+ return(HA_ERR_INDEX_COL_TOO_LONG);
+ }
+ }
+ return(0);
+}
+
+/*******************************************************************//**
Create a temporary tablename using query id, thread id, and id
@return temporary tablename */
static
@@ -619,6 +640,18 @@ innobase_create_temporary_tablename(
return(name);
}
+class ha_innobase_add_index : public handler_add_index
+{
+public:
+ /** table where the indexes are being created */
+ dict_table_t* indexed_table;
+ ha_innobase_add_index(TABLE* table, KEY* key_info, uint num_of_keys,
+ dict_table_t* indexed_table_arg) :
+ handler_add_index(table, key_info, num_of_keys),
+ indexed_table (indexed_table_arg) {}
+ ~ha_innobase_add_index() {}
+};
+
/*******************************************************************//**
Create indexes.
@return 0 or error number */
@@ -626,12 +659,15 @@ UNIV_INTERN
int
ha_innobase::add_index(
/*===================*/
- TABLE* table, /*!< in: Table where indexes are created */
- KEY* key_info, /*!< in: Indexes to be created */
- uint num_of_keys) /*!< in: Number of indexes to be created */
+ TABLE* table, /*!< in: Table where indexes
+ are created */
+ KEY* key_info, /*!< in: Indexes
+ to be created */
+ uint num_of_keys, /*!< in: Number of indexes
+ to be created */
+ handler_add_index** add) /*!< out: context */
{
dict_index_t** index; /*!< Index to be created */
- dict_table_t* innodb_table; /*!< InnoDB table in dictionary */
dict_table_t* indexed_table; /*!< Table where indexes are created */
merge_index_def_t* index_defs; /*!< Index definitions */
mem_heap_t* heap; /*!< Heap for index definitions */
@@ -647,50 +683,57 @@ ha_innobase::add_index(
ut_a(key_info);
ut_a(num_of_keys);
+ *add = NULL;
+
if (srv_created_new_raw || srv_force_recovery) {
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
}
update_thd();
- heap = mem_heap_create(1024);
-
/* In case MySQL calls this in the middle of a SELECT query, release
possible adaptive hash latch to avoid deadlocks of threads. */
trx_search_latch_release_if_reserved(prebuilt->trx);
- trx_start_if_not_started(prebuilt->trx);
- /* Create a background transaction for the operations on
- the data dictionary tables. */
- trx = innobase_trx_allocate(user_thd);
- trx_start_if_not_started(trx);
+ /* Check if the index name is reserved. */
+ if (innobase_index_name_is_reserved(user_thd, key_info, num_of_keys)) {
+ DBUG_RETURN(-1);
+ }
- innodb_table = indexed_table
- = dict_table_get(prebuilt->table->name, FALSE);
+ indexed_table = dict_table_get(prebuilt->table->name, FALSE);
- if (UNIV_UNLIKELY(!innodb_table)) {
- error = HA_ERR_NO_SUCH_TABLE;
- goto err_exit;
+ if (UNIV_UNLIKELY(!indexed_table)) {
+ DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
}
- /* Check if the index name is reserved. */
- if (innobase_index_name_is_reserved(trx, key_info, num_of_keys)) {
- error = -1;
- } else {
- /* Check that index keys are sensible */
- error = innobase_check_index_keys(key_info, num_of_keys,
- innodb_table);
- }
+ ut_a(indexed_table == prebuilt->table);
+
+ /* Check that index keys are sensible */
+ error = innobase_check_index_keys(key_info, num_of_keys, prebuilt->table);
if (UNIV_UNLIKELY(error)) {
-err_exit:
- mem_heap_free(heap);
- trx_general_rollback_for_mysql(trx, NULL);
- trx_free_for_mysql(trx);
- trx_commit_for_mysql(prebuilt->trx);
DBUG_RETURN(error);
}
+ /* Check each index's column length to make sure they do not
+ exceed limit */
+ for (ulint i = 0; i < num_of_keys; i++) {
+ error = innobase_check_column_length(prebuilt->table,
+ &key_info[i]);
+
+ if (error) {
+ DBUG_RETURN(error);
+ }
+ }
+
+ heap = mem_heap_create(1024);
+ trx_start_if_not_started(prebuilt->trx);
+
+ /* Create a background transaction for the operations on
+ the data dictionary tables. */
+ trx = innobase_trx_allocate(user_thd);
+ trx_start_if_not_started(trx);
+
/* Create table containing all indexes to be built in this
alter table add index so that they are in the correct order
in the table. */
@@ -698,7 +741,7 @@ err_exit:
num_of_idx = num_of_keys;
index_defs = innobase_create_key_def(
- trx, innodb_table, heap, key_info, num_of_idx);
+ trx, prebuilt->table, heap, key_info, num_of_idx);
new_primary = DICT_CLUSTERED & index_defs[0].ind_type;
@@ -712,7 +755,7 @@ err_exit:
trx_set_dict_operation(trx, TRX_DICT_OP_INDEX);
/* Acquire a lock on the table before creating any indexes. */
- error = row_merge_lock_table(prebuilt->trx, innodb_table,
+ error = row_merge_lock_table(prebuilt->trx, prebuilt->table,
new_primary ? LOCK_X : LOCK_S);
if (UNIV_UNLIKELY(error != DB_SUCCESS)) {
@@ -726,7 +769,7 @@ err_exit:
row_mysql_lock_data_dictionary(trx);
dict_locked = TRUE;
- ut_d(dict_table_check_for_dup_indexes(innodb_table, FALSE));
+ ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE));
/* If a new primary key is defined for the table we need
to drop the original table and rebuild all indexes. */
@@ -734,15 +777,15 @@ err_exit:
if (UNIV_UNLIKELY(new_primary)) {
/* This transaction should be the only one
operating on the table. */
- ut_a(innodb_table->n_mysql_handles_opened == 1);
+ ut_a(prebuilt->table->n_mysql_handles_opened == 1);
char* new_table_name = innobase_create_temporary_tablename(
- heap, '1', innodb_table->name);
+ heap, '1', prebuilt->table->name);
/* Clone the table. */
trx_set_dict_operation(trx, TRX_DICT_OP_TABLE);
indexed_table = row_merge_create_temporary_table(
- new_table_name, index_defs, innodb_table, trx);
+ new_table_name, index_defs, prebuilt->table, trx);
if (!indexed_table) {
@@ -756,14 +799,19 @@ err_exit:
break;
default:
error = convert_error_code_to_mysql(
- trx->error_state, innodb_table->flags,
+ trx->error_state,
+ prebuilt->table->flags,
user_thd);
}
- ut_d(dict_table_check_for_dup_indexes(innodb_table,
+ ut_d(dict_table_check_for_dup_indexes(prebuilt->table,
FALSE));
+ mem_heap_free(heap);
+ trx_general_rollback_for_mysql(trx, NULL);
row_mysql_unlock_data_dictionary(trx);
- goto err_exit;
+ trx_free_for_mysql(trx);
+ trx_commit_for_mysql(prebuilt->trx);
+ DBUG_RETURN(error);
}
trx->table_id = indexed_table->id;
@@ -771,25 +819,19 @@ err_exit:
/* Create the indexes in SYS_INDEXES and load into dictionary. */
- for (ulint i = 0; i < num_of_idx; i++) {
+ for (num_created = 0; num_created < num_of_idx; num_created++) {
- index[i] = row_merge_create_index(trx, indexed_table,
- &index_defs[i]);
+ index[num_created] = row_merge_create_index(
+ trx, indexed_table, &index_defs[num_created]);
- if (!index[i]) {
+ if (!index[num_created]) {
error = trx->error_state;
goto error_handling;
}
-
- num_created++;
}
ut_ad(error == DB_SUCCESS);
- /* We will need to rebuild index translation table. Set
- valid index entry count in the translation table to zero */
- share->idx_trans_tbl.index_count = 0;
-
/* Commit the data dictionary transaction in order to release
the table locks on the system tables. This means that if
MySQL crashes while creating a new primary key inside
@@ -807,7 +849,7 @@ err_exit:
if (UNIV_UNLIKELY(new_primary)) {
/* A primary key is to be built. Acquire an exclusive
table lock also on the table that is being created. */
- ut_ad(indexed_table != innodb_table);
+ ut_ad(indexed_table != prebuilt->table);
error = row_merge_lock_table(prebuilt->trx, indexed_table,
LOCK_X);
@@ -821,7 +863,7 @@ err_exit:
/* Read the clustered index of the table and build indexes
based on this information using temporary files and merge sort. */
error = row_merge_build_indexes(prebuilt->trx,
- innodb_table, indexed_table,
+ prebuilt->table, indexed_table,
index, num_of_idx, table);
error_handling:
@@ -829,63 +871,15 @@ error_handling:
dictionary which were defined. */
switch (error) {
- const char* old_name;
- char* tmp_name;
case DB_SUCCESS:
ut_a(!dict_locked);
- row_mysql_lock_data_dictionary(trx);
- dict_locked = TRUE;
+ ut_d(mutex_enter(&dict_sys->mutex));
ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE));
-
- if (!new_primary) {
- error = row_merge_rename_indexes(trx, indexed_table);
-
- if (error != DB_SUCCESS) {
- row_merge_drop_indexes(trx, indexed_table,
- index, num_created);
- }
-
- goto convert_error;
- }
-
- /* If a new primary key was defined for the table and
- there was no error at this point, we can now rename
- the old table as a temporary table, rename the new
- temporary table as the old table and drop the old table. */
- old_name = innodb_table->name;
- tmp_name = innobase_create_temporary_tablename(heap, '2',
- old_name);
-
- error = row_merge_rename_tables(innodb_table, indexed_table,
- tmp_name, trx);
-
- if (error != DB_SUCCESS) {
-
- row_merge_drop_table(trx, indexed_table);
-
- switch (error) {
- case DB_TABLESPACE_ALREADY_EXISTS:
- case DB_DUPLICATE_KEY:
- innobase_convert_tablename(tmp_name);
- my_error(HA_ERR_TABLE_EXIST, MYF(0), tmp_name);
- error = HA_ERR_TABLE_EXIST;
- break;
- default:
- goto convert_error;
- }
- break;
- }
-
- trx_commit_for_mysql(prebuilt->trx);
- row_prebuilt_free(prebuilt, TRUE);
- prebuilt = row_create_prebuilt(indexed_table);
-
- indexed_table->n_mysql_handles_opened++;
-
- error = row_merge_drop_table(trx, innodb_table);
- innodb_table = indexed_table;
- goto convert_error;
+ ut_d(mutex_exit(&dict_sys->mutex));
+ *add = new ha_innobase_add_index(table, key_info, num_of_keys,
+ indexed_table);
+ break;
case DB_TOO_BIG_RECORD:
my_error(HA_ERR_TO_BIG_ROW, MYF(0));
@@ -901,7 +895,7 @@ error:
trx->error_state = DB_SUCCESS;
if (new_primary) {
- if (indexed_table != innodb_table) {
+ if (indexed_table != prebuilt->table) {
row_merge_drop_table(trx, indexed_table);
}
} else {
@@ -913,30 +907,161 @@ error:
row_merge_drop_indexes(trx, indexed_table,
index, num_created);
}
-
-convert_error:
- error = convert_error_code_to_mysql(error,
- innodb_table->flags,
- user_thd);
}
- mem_heap_free(heap);
trx_commit_for_mysql(trx);
if (prebuilt->trx) {
trx_commit_for_mysql(prebuilt->trx);
}
if (dict_locked) {
- ut_d(dict_table_check_for_dup_indexes(innodb_table, FALSE));
row_mysql_unlock_data_dictionary(trx);
}
trx_free_for_mysql(trx);
+ mem_heap_free(heap);
/* There might be work for utility threads.*/
srv_active_wake_master_thread();
- DBUG_RETURN(error);
+ DBUG_RETURN(convert_error_code_to_mysql(error, prebuilt->table->flags,
+ user_thd));
+}
+
+/*******************************************************************//**
+Finalize or undo add_index().
+@return 0 or error number */
+UNIV_INTERN
+int
+ha_innobase::final_add_index(
+/*=========================*/
+ handler_add_index* add_arg,/*!< in: context from add_index() */
+ bool commit) /*!< in: true=commit, false=rollback */
+{
+ ha_innobase_add_index* add;
+ trx_t* trx;
+ int err = 0;
+
+ DBUG_ENTER("ha_innobase::final_add_index");
+
+ ut_ad(add_arg);
+ add = static_cast<class ha_innobase_add_index*>(add_arg);
+
+ /* Create a background transaction for the operations on
+ the data dictionary tables. */
+ trx = innobase_trx_allocate(user_thd);
+ trx_start_if_not_started(trx);
+
+ /* Flag this transaction as a dictionary operation, so that
+ the data dictionary will be locked in crash recovery. */
+ trx_set_dict_operation(trx, TRX_DICT_OP_INDEX);
+
+ /* Latch the InnoDB data dictionary exclusively so that no deadlocks
+ or lock waits can happen in it during an index create operation. */
+ row_mysql_lock_data_dictionary(trx);
+
+ if (add->indexed_table != prebuilt->table) {
+ ulint error;
+
+ /* We copied the table (new_primary). */
+ if (commit) {
+ mem_heap_t* heap;
+ char* tmp_name;
+
+ heap = mem_heap_create(1024);
+
+ /* A new primary key was defined for the table
+ and there was no error at this point. We can
+ now rename the old table as a temporary table,
+ rename the new temporary table as the old
+ table and drop the old table. */
+ tmp_name = innobase_create_temporary_tablename(
+ heap, '2', prebuilt->table->name);
+
+ error = row_merge_rename_tables(
+ prebuilt->table, add->indexed_table,
+ tmp_name, trx);
+
+ switch (error) {
+ case DB_TABLESPACE_ALREADY_EXISTS:
+ case DB_DUPLICATE_KEY:
+ innobase_convert_tablename(tmp_name);
+ my_error(HA_ERR_TABLE_EXIST, MYF(0), tmp_name);
+ err = HA_ERR_TABLE_EXIST;
+ break;
+ default:
+ err = convert_error_code_to_mysql(
+ error, prebuilt->table->flags,
+ user_thd);
+ break;
+ }
+
+ mem_heap_free(heap);
+ }
+
+ if (!commit || err) {
+ error = row_merge_drop_table(trx, add->indexed_table);
+ trx_commit_for_mysql(prebuilt->trx);
+ } else {
+ dict_table_t* old_table = prebuilt->table;
+ trx_commit_for_mysql(prebuilt->trx);
+ row_prebuilt_free(prebuilt, TRUE);
+ error = row_merge_drop_table(trx, old_table);
+ add->indexed_table->n_mysql_handles_opened++;
+ prebuilt = row_create_prebuilt(add->indexed_table);
+ }
+
+ err = convert_error_code_to_mysql(
+ error, prebuilt->table->flags, user_thd);
+ } else {
+ /* We created secondary indexes (!new_primary). */
+
+ if (commit) {
+ err = convert_error_code_to_mysql(
+ row_merge_rename_indexes(trx, prebuilt->table),
+ prebuilt->table->flags, user_thd);
+ }
+
+ if (!commit || err) {
+ dict_index_t* index;
+ dict_index_t* next_index;
+
+ for (index = dict_table_get_first_index(
+ prebuilt->table);
+ index; index = next_index) {
+
+ next_index = dict_table_get_next_index(index);
+
+ if (*index->name == TEMP_INDEX_PREFIX) {
+ row_merge_drop_index(
+ index, prebuilt->table, trx);
+ }
+ }
+ }
+ }
+
+ /* If index is successfully built, we will need to rebuild index
+ translation table. Set valid index entry count in the translation
+ table to zero. */
+ if (err == 0 && commit) {
+ share->idx_trans_tbl.index_count = 0;
+ }
+
+ trx_commit_for_mysql(trx);
+ if (prebuilt->trx) {
+ trx_commit_for_mysql(prebuilt->trx);
+ }
+
+ ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE));
+ row_mysql_unlock_data_dictionary(trx);
+
+ trx_free_for_mysql(trx);
+
+ /* There might be work for utility threads.*/
+ srv_active_wake_master_thread();
+
+ delete add;
+ DBUG_RETURN(err);
}
/*******************************************************************//**
@@ -1016,12 +1141,13 @@ ha_innobase::prepare_drop_index(
index->to_be_dropped = TRUE;
}
- /* If FOREIGN_KEY_CHECK = 1 you may not drop an index defined
+ /* If FOREIGN_KEY_CHECKS = 1 you may not drop an index defined
for a foreign key constraint because InnoDB requires that both
- tables contain indexes for the constraint. Note that CREATE
- INDEX id ON table does a CREATE INDEX and DROP INDEX, and we
- can ignore here foreign keys because a new index for the
- foreign key has already been created.
+ tables contain indexes for the constraint. Such index can
+ be dropped only if FOREIGN_KEY_CHECKS is set to 0.
+ Note that CREATE INDEX id ON table does a CREATE INDEX and
+ DROP INDEX, and we can ignore here foreign keys because a
+ new index for the foreign key has already been created.
We check for the foreign key constraints after marking the
candidate indexes for deletion, because when we check for an
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index cd84b78bd9d..de5cc682078 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -36,11 +36,9 @@ Created July 18, 2007 Vasil Dimov
#include <mysql/innodb_priv.h>
extern "C" {
-#include "btr0pcur.h" /* for file sys_tables related info. */
#include "btr0types.h"
#include "buf0buddy.h" /* for i_s_cmpmem */
#include "buf0buf.h" /* for buf_pool and PAGE_ZIP_MIN_SIZE */
-#include "dict0load.h" /* for file sys_tables related info. */
#include "dict0mem.h"
#include "dict0types.h"
#include "ha_prototypes.h" /* for innobase_convert_name() */
@@ -49,8 +47,6 @@ extern "C" {
#include "trx0trx.h" /* for TRX_QUE_STATE_STR_MAX_LEN */
}
-static const char plugin_author[] = "Innobase Oy";
-
#define OK(expr) \
if ((expr) != 0) { \
DBUG_RETURN(1); \
@@ -497,8 +493,16 @@ fill_innodb_trx_from_cache(
row->trx_mysql_thread_id));
/* trx_query */
- OK(field_store_string(fields[IDX_TRX_QUERY],
- row->trx_query));
+ if (row->trx_query) {
+ /* store will do appropriate character set
+ conversion check */
+ fields[IDX_TRX_QUERY]->store(
+ row->trx_query, strlen(row->trx_query),
+ row->trx_query_cs);
+ fields[IDX_TRX_QUERY]->set_notnull();
+ } else {
+ fields[IDX_TRX_QUERY]->set_null();
+ }
/* trx_operation_state */
OK(field_store_string(fields[IDX_TRX_OPERATION_STATE],
@@ -761,16 +765,7 @@ fill_innodb_locks_from_cache(
for (i = 0; i < rows_num; i++) {
i_s_locks_row_t* row;
-
- /* note that the decoded database or table name is
- never expected to be longer than NAME_LEN;
- NAME_LEN for database name
- 2 for surrounding quotes around database name
- NAME_LEN for table name
- 2 for surrounding quotes around table name
- 1 for the separating dot (.)
- 9 for the #mysql50# prefix */
- char buf[2 * NAME_LEN + 14];
+ char buf[MAX_FULL_NAME_LEN + 1];
const char* bufend;
char lock_trx_id[TRX_ID_MAX_LEN + 1];
@@ -1062,7 +1057,7 @@ UNIV_INTERN struct st_mysql_plugin i_s_innodb_lock_waits =
/* plugin author (for SHOW PLUGINS) */
/* const char* */
- STRUCT_FLD(author, "Innobase Oy"),
+ STRUCT_FLD(author, plugin_author),
/* general descriptive text (for SHOW PLUGINS) */
/* const char* */
@@ -1784,1629 +1779,3 @@ i_s_common_deinit(
DBUG_RETURN(0);
}
-
-/* Fields of the dynamic table INFORMATION_SCHEMA.SYS_TABLES */
-static ST_FIELD_INFO innodb_sys_tables_fields_info[] =
-{
-#define SYS_TABLE_ID 0
- {STRUCT_FLD(field_name, "TABLE_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_TABLE_NAME 1
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_TABLE_FLAG 2
- {STRUCT_FLD(field_name, "FLAG"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_TABLE_NUM_COLUMN 3
- {STRUCT_FLD(field_name, "N_COLS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_TABLE_SPACE 4
- {STRUCT_FLD(field_name, "SPACE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
-};
-
-/**********************************************************************//**
-Populate information_schema.innodb_sys_tables table with information
-from SYS_TABLES.
-@return 0 on success */
-static
-int
-i_s_dict_fill_sys_tables(
-/*=====================*/
- THD* thd, /*!< in: thread */
- dict_table_t* table, /*!< in: table */
- TABLE* table_to_fill) /*!< in/out: fill this table */
-{
- Field** fields;
-
- DBUG_ENTER("i_s_dict_fill_sys_tables");
-
- fields = table_to_fill->field;
-
- OK(fields[SYS_TABLE_ID]->store(longlong(table->id), TRUE));
-
- OK(field_store_string(fields[SYS_TABLE_NAME], table->name));
-
- OK(fields[SYS_TABLE_FLAG]->store(table->flags));
-
- OK(fields[SYS_TABLE_NUM_COLUMN]->store(table->n_cols));
-
- OK(fields[SYS_TABLE_SPACE]->store(table->space));
-
- OK(schema_table_store_record(thd, table_to_fill));
-
- DBUG_RETURN(0);
-}
-/*******************************************************************//**
-Function to go through each record in SYS_TABLES table, and fill the
-information_schema.innodb_sys_tables table with related table information
-@return 0 on success */
-static
-int
-i_s_sys_tables_fill_table(
-/*======================*/
- THD* thd, /*!< in: thread */
- TABLE_LIST* tables, /*!< in/out: tables to fill */
- COND* cond) /*!< in: condition (not used) */
-{
- btr_pcur_t pcur;
- const rec_t* rec;
- mem_heap_t* heap;
- mtr_t mtr;
-
- DBUG_ENTER("i_s_sys_tables_fill_table");
-
- /* deny access to non-superusers */
- if (check_global_access(thd, PROCESS_ACL)) {
-
- DBUG_RETURN(0);
- }
-
- heap = mem_heap_create(1000);
- mutex_enter(&(dict_sys->mutex));
- mtr_start(&mtr);
-
- rec = dict_startscan_system(&pcur, &mtr, SYS_TABLES);
-
- while (rec) {
- const char* err_msg;
- dict_table_t* table_rec;
-
- /* Create and populate a dict_table_t structure with
- information from SYS_TABLES row */
- err_msg = dict_process_sys_tables_rec(
- heap, rec, &table_rec, DICT_TABLE_LOAD_FROM_RECORD);
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
-
- if (!err_msg) {
- i_s_dict_fill_sys_tables(thd, table_rec, tables->table);
- } else {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_CANT_FIND_SYSTEM_REC,
- err_msg);
- }
-
- /* Since dict_process_sys_tables_rec() is called with
- DICT_TABLE_LOAD_FROM_RECORD, the table_rec is created in
- dict_process_sys_tables_rec(), we will need to free it */
- if (table_rec) {
- dict_mem_table_free(table_rec);
- }
-
- mem_heap_empty(heap);
-
- /* Get the next record */
- mutex_enter(&dict_sys->mutex);
- mtr_start(&mtr);
- rec = dict_getnext_system(&pcur, &mtr);
- }
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
- mem_heap_free(heap);
-
- DBUG_RETURN(0);
-}
-
-/*******************************************************************//**
-Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_tables
-@return 0 on success */
-static
-int
-innodb_sys_tables_init(
-/*===================*/
- void* p) /*!< in/out: table schema object */
-{
- ST_SCHEMA_TABLE* schema;
-
- DBUG_ENTER("innodb_sys_tables_init");
-
- schema = (ST_SCHEMA_TABLE*) p;
-
- schema->fields_info = innodb_sys_tables_fields_info;
- schema->fill_table = i_s_sys_tables_fill_table;
-
- DBUG_RETURN(0);
-}
-
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_tables =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_TABLES"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_TABLES"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_tables_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
-
-/* Fields of the dynamic table INFORMATION_SCHEMA.SYS_TABLESTATS */
-static ST_FIELD_INFO innodb_sys_tablestats_fields_info[] =
-{
-#define SYS_TABLESTATS_ID 0
- {STRUCT_FLD(field_name, "TABLE_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_TABLESTATS_NAME 1
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_TABLESTATS_INIT 2
- {STRUCT_FLD(field_name, "STATS_INITIALIZED"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_TABLESTATS_NROW 3
- {STRUCT_FLD(field_name, "NUM_ROWS"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_TABLESTATS_CLUST_SIZE 4
- {STRUCT_FLD(field_name, "CLUST_INDEX_SIZE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_TABLESTATS_INDEX_SIZE 5
- {STRUCT_FLD(field_name, "OTHER_INDEX_SIZE"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_TABLESTATS_MODIFIED 6
- {STRUCT_FLD(field_name, "MODIFIED_COUNTER"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_TABLESTATS_AUTONINC 7
- {STRUCT_FLD(field_name, "AUTOINC"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_TABLESTATS_MYSQL_OPEN_HANDLE 8
- {STRUCT_FLD(field_name, "MYSQL_HANDLES_OPENED"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
-};
-
-/**********************************************************************//**
-Populate information_schema.innodb_sys_tablestats table with information
-from SYS_TABLES.
-@return 0 on success */
-static
-int
-i_s_dict_fill_sys_tablestats(
-/*=========================*/
- THD* thd, /*!< in: thread */
- dict_table_t* table, /*!< in: table */
- TABLE* table_to_fill) /*!< in/out: fill this table */
-{
- Field** fields;
-
- DBUG_ENTER("i_s_dict_fill_sys_tablestats");
-
- fields = table_to_fill->field;
-
- OK(fields[SYS_TABLESTATS_ID]->store(longlong(table->id), TRUE));
-
- OK(field_store_string(fields[SYS_TABLESTATS_NAME], table->name));
-
- if (table->stat_initialized) {
- OK(field_store_string(fields[SYS_TABLESTATS_INIT],
- "Initialized"));
- } else {
- OK(field_store_string(fields[SYS_TABLESTATS_INIT],
- "Uninitialized"));
- }
-
- OK(fields[SYS_TABLESTATS_NROW]->store(table->stat_n_rows, TRUE));
-
- OK(fields[SYS_TABLESTATS_CLUST_SIZE]->store(
- table->stat_clustered_index_size));
-
- OK(fields[SYS_TABLESTATS_INDEX_SIZE]->store(
- table->stat_sum_of_other_index_sizes));
-
- OK(fields[SYS_TABLESTATS_MODIFIED]->store(
- table->stat_modified_counter));
-
- OK(fields[SYS_TABLESTATS_AUTONINC]->store(table->autoinc, TRUE));
-
- OK(fields[SYS_TABLESTATS_MYSQL_OPEN_HANDLE]->store(
- table->n_mysql_handles_opened));
-
- OK(schema_table_store_record(thd, table_to_fill));
-
- DBUG_RETURN(0);
-}
-/*******************************************************************//**
-Function to go through each record in SYS_TABLES table, and fill the
-information_schema.innodb_sys_tablestats table with table statistics
-related information
-@return 0 on success */
-static
-int
-i_s_sys_tables_fill_table_stats(
-/*============================*/
- THD* thd, /*!< in: thread */
- TABLE_LIST* tables, /*!< in/out: tables to fill */
- COND* cond) /*!< in: condition (not used) */
-{
- btr_pcur_t pcur;
- const rec_t* rec;
- mem_heap_t* heap;
- mtr_t mtr;
-
- DBUG_ENTER("i_s_sys_tables_fill_table_stats");
-
- /* deny access to non-superusers */
- if (check_global_access(thd, PROCESS_ACL)) {
-
- DBUG_RETURN(0);
- }
-
- heap = mem_heap_create(1000);
- mutex_enter(&dict_sys->mutex);
- mtr_start(&mtr);
-
- rec = dict_startscan_system(&pcur, &mtr, SYS_TABLES);
-
- while (rec) {
- const char* err_msg;
- dict_table_t* table_rec;
-
- /* Fetch the dict_table_t structure corresponding to
- this SYS_TABLES record */
- err_msg = dict_process_sys_tables_rec(
- heap, rec, &table_rec, DICT_TABLE_LOAD_FROM_CACHE);
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
-
- if (!err_msg) {
- i_s_dict_fill_sys_tablestats(thd, table_rec,
- tables->table);
- } else {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_CANT_FIND_SYSTEM_REC,
- err_msg);
- }
-
- mem_heap_empty(heap);
-
- /* Get the next record */
- mutex_enter(&dict_sys->mutex);
- mtr_start(&mtr);
- rec = dict_getnext_system(&pcur, &mtr);
- }
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
- mem_heap_free(heap);
-
- DBUG_RETURN(0);
-}
-
-/*******************************************************************//**
-Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_tablestats
-@return 0 on success */
-static
-int
-innodb_sys_tablestats_init(
-/*=======================*/
- void* p) /*!< in/out: table schema object */
-{
- ST_SCHEMA_TABLE* schema;
-
- DBUG_ENTER("innodb_sys_tablestats_init");
-
- schema = (ST_SCHEMA_TABLE*) p;
-
- schema->fields_info = innodb_sys_tablestats_fields_info;
- schema->fill_table = i_s_sys_tables_fill_table_stats;
-
- DBUG_RETURN(0);
-}
-
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_tablestats =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_TABLESTATS"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_TABLESTATS"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_tablestats_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
-
-/* Fields of the dynamic table INFORMATION_SCHEMA.SYS_INDEXES */
-static ST_FIELD_INFO innodb_sysindex_fields_info[] =
-{
-#define SYS_INDEX_ID 0
- {STRUCT_FLD(field_name, "INDEX_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_INDEX_NAME 1
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_INDEX_TABLE_ID 2
- {STRUCT_FLD(field_name, "TABLE_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_INDEX_TYPE 3
- {STRUCT_FLD(field_name, "TYPE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_INDEX_NUM_FIELDS 4
- {STRUCT_FLD(field_name, "N_FIELDS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_INDEX_PAGE_NO 5
- {STRUCT_FLD(field_name, "PAGE_NO"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_INDEX_SPACE 6
- {STRUCT_FLD(field_name, "SPACE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
-};
-
-/**********************************************************************//**
-Function to populate the information_schema.innodb_sys_indexes table with
-collected index information
-@return 0 on success */
-static
-int
-i_s_dict_fill_sys_indexes(
-/*======================*/
- THD* thd, /*!< in: thread */
- table_id_t table_id, /*!< in: table id */
- dict_index_t* index, /*!< in: populated dict_index_t
- struct with index info */
- TABLE* table_to_fill) /*!< in/out: fill this table */
-{
- Field** fields;
-
- DBUG_ENTER("i_s_dict_fill_sys_indexes");
-
- fields = table_to_fill->field;
-
- OK(fields[SYS_INDEX_ID]->store(longlong(index->id), TRUE));
-
- OK(field_store_string(fields[SYS_INDEX_NAME], index->name));
-
- OK(fields[SYS_INDEX_TABLE_ID]->store(longlong(table_id), TRUE));
-
- OK(fields[SYS_INDEX_TYPE]->store(index->type));
-
- OK(fields[SYS_INDEX_NUM_FIELDS]->store(index->n_fields));
-
- OK(fields[SYS_INDEX_PAGE_NO]->store(index->page));
-
- OK(fields[SYS_INDEX_SPACE]->store(index->space));
-
- OK(schema_table_store_record(thd, table_to_fill));
-
- DBUG_RETURN(0);
-}
-/*******************************************************************//**
-Function to go through each record in SYS_INDEXES table, and fill the
-information_schema.innodb_sys_indexes table with related index information
-@return 0 on success */
-static
-int
-i_s_sys_indexes_fill_table(
-/*=======================*/
- THD* thd, /*!< in: thread */
- TABLE_LIST* tables, /*!< in/out: tables to fill */
- COND* cond) /*!< in: condition (not used) */
-{
- btr_pcur_t pcur;
- const rec_t* rec;
- mem_heap_t* heap;
- mtr_t mtr;
-
- DBUG_ENTER("i_s_sys_indexes_fill_table");
-
- /* deny access to non-superusers */
- if (check_global_access(thd, PROCESS_ACL)) {
-
- DBUG_RETURN(0);
- }
-
- heap = mem_heap_create(1000);
- mutex_enter(&dict_sys->mutex);
- mtr_start(&mtr);
-
- /* Start scan the SYS_INDEXES table */
- rec = dict_startscan_system(&pcur, &mtr, SYS_INDEXES);
-
- /* Process each record in the table */
- while (rec) {
- const char* err_msg;;
- table_id_t table_id;
- dict_index_t index_rec;
-
- /* Populate a dict_index_t structure with information from
- a SYS_INDEXES row */
- err_msg = dict_process_sys_indexes_rec(heap, rec, &index_rec,
- &table_id);
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
-
- if (!err_msg) {
- i_s_dict_fill_sys_indexes(thd, table_id, &index_rec,
- tables->table);
- } else {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_CANT_FIND_SYSTEM_REC,
- err_msg);
- }
-
- mem_heap_empty(heap);
-
- /* Get the next record */
- mutex_enter(&dict_sys->mutex);
- mtr_start(&mtr);
- rec = dict_getnext_system(&pcur, &mtr);
- }
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
- mem_heap_free(heap);
-
- DBUG_RETURN(0);
-}
-/*******************************************************************//**
-Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_indexes
-@return 0 on success */
-static
-int
-innodb_sys_indexes_init(
-/*====================*/
- void* p) /*!< in/out: table schema object */
-{
- ST_SCHEMA_TABLE* schema;
-
- DBUG_ENTER("innodb_sys_index_init");
-
- schema = (ST_SCHEMA_TABLE*) p;
-
- schema->fields_info = innodb_sysindex_fields_info;
- schema->fill_table = i_s_sys_indexes_fill_table;
-
- DBUG_RETURN(0);
-}
-
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_indexes =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_INDEXES"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_INDEXES"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_indexes_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
-
-/* Fields of the dynamic table INFORMATION_SCHEMA.SYS_COLUMNS */
-static ST_FIELD_INFO innodb_sys_columns_fields_info[] =
-{
-#define SYS_COLUMN_TABLE_ID 0
- {STRUCT_FLD(field_name, "TABLE_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_COLUMN_NAME 1
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_COLUMN_POSITION 2
- {STRUCT_FLD(field_name, "POS"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_COLUMN_MTYPE 3
- {STRUCT_FLD(field_name, "MTYPE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_COLUMN__PRTYPE 4
- {STRUCT_FLD(field_name, "PRTYPE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_COLUMN_COLUMN_LEN 5
- {STRUCT_FLD(field_name, "LEN"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
-};
-
-/**********************************************************************//**
-Function to populate the information_schema.innodb_sys_columns with
-related column information
-@return 0 on success */
-static
-int
-i_s_dict_fill_sys_columns(
-/*======================*/
- THD* thd, /*!< in: thread */
- table_id_t table_id, /*!< in: table ID */
- const char* col_name, /*!< in: column name */
- dict_col_t* column, /*!< in: dict_col_t struct holding
- more column information */
- TABLE* table_to_fill) /*!< in/out: fill this table */
-{
- Field** fields;
-
- DBUG_ENTER("i_s_dict_fill_sys_columns");
-
- fields = table_to_fill->field;
-
- OK(fields[SYS_COLUMN_TABLE_ID]->store(longlong(table_id), TRUE));
-
- OK(field_store_string(fields[SYS_COLUMN_NAME], col_name));
-
- OK(fields[SYS_COLUMN_POSITION]->store(column->ind));
-
- OK(fields[SYS_COLUMN_MTYPE]->store(column->mtype));
-
- OK(fields[SYS_COLUMN__PRTYPE]->store(column->prtype));
-
- OK(fields[SYS_COLUMN_COLUMN_LEN]->store(column->len));
-
- OK(schema_table_store_record(thd, table_to_fill));
-
- DBUG_RETURN(0);
-}
-/*******************************************************************//**
-Function to fill information_schema.innodb_sys_columns with information
-collected by scanning SYS_COLUMNS table.
-@return 0 on success */
-static
-int
-i_s_sys_columns_fill_table(
-/*=======================*/
- THD* thd, /*!< in: thread */
- TABLE_LIST* tables, /*!< in/out: tables to fill */
- COND* cond) /*!< in: condition (not used) */
-{
- btr_pcur_t pcur;
- const rec_t* rec;
- const char* col_name;
- mem_heap_t* heap;
- mtr_t mtr;
-
- DBUG_ENTER("i_s_sys_columns_fill_table");
-
- /* deny access to non-superusers */
- if (check_global_access(thd, PROCESS_ACL)) {
-
- DBUG_RETURN(0);
- }
-
- heap = mem_heap_create(1000);
- mutex_enter(&dict_sys->mutex);
- mtr_start(&mtr);
-
- rec = dict_startscan_system(&pcur, &mtr, SYS_COLUMNS);
-
- while (rec) {
- const char* err_msg;
- dict_col_t column_rec;
- table_id_t table_id;
-
- /* populate a dict_col_t structure with information from
- a SYS_COLUMNS row */
- err_msg = dict_process_sys_columns_rec(heap, rec, &column_rec,
- &table_id, &col_name);
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
-
- if (!err_msg) {
- i_s_dict_fill_sys_columns(thd, table_id, col_name,
- &column_rec,
- tables->table);
- } else {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_CANT_FIND_SYSTEM_REC,
- err_msg);
- }
-
- mem_heap_empty(heap);
-
- /* Get the next record */
- mutex_enter(&dict_sys->mutex);
- mtr_start(&mtr);
- rec = dict_getnext_system(&pcur, &mtr);
- }
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
- mem_heap_free(heap);
-
- DBUG_RETURN(0);
-}
-/*******************************************************************//**
-Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_columns
-@return 0 on success */
-static
-int
-innodb_sys_columns_init(
-/*====================*/
- void* p) /*!< in/out: table schema object */
-{
- ST_SCHEMA_TABLE* schema;
-
- DBUG_ENTER("innodb_sys_columns_init");
-
- schema = (ST_SCHEMA_TABLE*) p;
-
- schema->fields_info = innodb_sys_columns_fields_info;
- schema->fill_table = i_s_sys_columns_fill_table;
-
- DBUG_RETURN(0);
-}
-
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_columns =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_COLUMNS"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_COLUMNS"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_columns_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
-/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_sys_fields */
-static ST_FIELD_INFO innodb_sys_fields_fields_info[] =
-{
-#define SYS_FIELD_INDEX_ID 0
- {STRUCT_FLD(field_name, "INDEX_ID"),
- STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_FIELD_NAME 1
- {STRUCT_FLD(field_name, "NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_FIELD_POS 2
- {STRUCT_FLD(field_name, "POS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
-};
-
-/**********************************************************************//**
-Function to fill information_schema.innodb_sys_fields with information
-collected by scanning SYS_FIELDS table.
-@return 0 on success */
-static
-int
-i_s_dict_fill_sys_fields(
-/*=====================*/
- THD* thd, /*!< in: thread */
- index_id_t index_id, /*!< in: index id for the field */
- dict_field_t* field, /*!< in: table */
- ulint pos, /*!< in: Field position */
- TABLE* table_to_fill) /*!< in/out: fill this table */
-{
- Field** fields;
-
- DBUG_ENTER("i_s_dict_fill_sys_fields");
-
- fields = table_to_fill->field;
-
- OK(fields[SYS_FIELD_INDEX_ID]->store(longlong(index_id), TRUE));
-
- OK(field_store_string(fields[SYS_FIELD_NAME], field->name));
-
- OK(fields[SYS_FIELD_POS]->store(pos));
-
- OK(schema_table_store_record(thd, table_to_fill));
-
- DBUG_RETURN(0);
-}
-/*******************************************************************//**
-Function to go through each record in SYS_FIELDS table, and fill the
-information_schema.innodb_sys_fields table with related index field
-information
-@return 0 on success */
-static
-int
-i_s_sys_fields_fill_table(
-/*======================*/
- THD* thd, /*!< in: thread */
- TABLE_LIST* tables, /*!< in/out: tables to fill */
- COND* cond) /*!< in: condition (not used) */
-{
- btr_pcur_t pcur;
- const rec_t* rec;
- mem_heap_t* heap;
- index_id_t last_id;
- mtr_t mtr;
-
- DBUG_ENTER("i_s_sys_fields_fill_table");
-
- /* deny access to non-superusers */
- if (check_global_access(thd, PROCESS_ACL)) {
-
- DBUG_RETURN(0);
- }
-
- heap = mem_heap_create(1000);
- mutex_enter(&dict_sys->mutex);
- mtr_start(&mtr);
-
- /* will save last index id so that we know whether we move to
- the next index. This is used to calculate prefix length */
- last_id = 0;
-
- rec = dict_startscan_system(&pcur, &mtr, SYS_FIELDS);
-
- while (rec) {
- ulint pos;
- const char* err_msg;
- index_id_t index_id;
- dict_field_t field_rec;
-
- /* Populate a dict_field_t structure with information from
- a SYS_FIELDS row */
- err_msg = dict_process_sys_fields_rec(heap, rec, &field_rec,
- &pos, &index_id, last_id);
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
-
- if (!err_msg) {
- i_s_dict_fill_sys_fields(thd, index_id, &field_rec,
- pos, tables->table);
- last_id = index_id;
- } else {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_CANT_FIND_SYSTEM_REC,
- err_msg);
- }
-
- mem_heap_empty(heap);
-
- /* Get the next record */
- mutex_enter(&dict_sys->mutex);
- mtr_start(&mtr);
- rec = dict_getnext_system(&pcur, &mtr);
- }
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
- mem_heap_free(heap);
-
- DBUG_RETURN(0);
-}
-/*******************************************************************//**
-Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_fields
-@return 0 on success */
-static
-int
-innodb_sys_fields_init(
-/*===================*/
- void* p) /*!< in/out: table schema object */
-{
- ST_SCHEMA_TABLE* schema;
-
- DBUG_ENTER("innodb_sys_field_init");
-
- schema = (ST_SCHEMA_TABLE*) p;
-
- schema->fields_info = innodb_sys_fields_fields_info;
- schema->fill_table = i_s_sys_fields_fill_table;
-
- DBUG_RETURN(0);
-}
-
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_fields =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_FIELDS"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_FIELDS"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_fields_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
-
-/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_sys_foreign */
-static ST_FIELD_INFO innodb_sys_foreign_fields_info[] =
-{
-#define SYS_FOREIGN_ID 0
- {STRUCT_FLD(field_name, "ID"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_FOREIGN_FOR_NAME 1
- {STRUCT_FLD(field_name, "FOR_NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_FOREIGN_REF_NAME 2
- {STRUCT_FLD(field_name, "REF_NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_FOREIGN_NUM_COL 3
- {STRUCT_FLD(field_name, "N_COLS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_FOREIGN_TYPE 4
- {STRUCT_FLD(field_name, "TYPE"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
-};
-
-/**********************************************************************//**
-Function to fill information_schema.innodb_sys_foreign with information
-collected by scanning SYS_FOREIGN table.
-@return 0 on success */
-static
-int
-i_s_dict_fill_sys_foreign(
-/*======================*/
- THD* thd, /*!< in: thread */
- dict_foreign_t* foreign, /*!< in: table */
- TABLE* table_to_fill) /*!< in/out: fill this table */
-{
- Field** fields;
-
- DBUG_ENTER("i_s_dict_fill_sys_foreign");
-
- fields = table_to_fill->field;
-
- OK(field_store_string(fields[SYS_FOREIGN_ID], foreign->id));
-
- OK(field_store_string(fields[SYS_FOREIGN_FOR_NAME],
- foreign->foreign_table_name));
-
- OK(field_store_string(fields[SYS_FOREIGN_REF_NAME],
- foreign->referenced_table_name));
-
- OK(fields[SYS_FOREIGN_NUM_COL]->store(foreign->n_fields));
-
- OK(fields[SYS_FOREIGN_TYPE]->store(foreign->type));
-
- OK(schema_table_store_record(thd, table_to_fill));
-
- DBUG_RETURN(0);
-}
-/*******************************************************************//**
-Function to populate INFORMATION_SCHEMA.innodb_sys_foreign table. Loop
-through each record in SYS_FOREIGN, and extract the foreign key
-information.
-@return 0 on success */
-static
-int
-i_s_sys_foreign_fill_table(
-/*=======================*/
- THD* thd, /*!< in: thread */
- TABLE_LIST* tables, /*!< in/out: tables to fill */
- COND* cond) /*!< in: condition (not used) */
-{
- btr_pcur_t pcur;
- const rec_t* rec;
- mem_heap_t* heap;
- mtr_t mtr;
-
- DBUG_ENTER("i_s_sys_foreign_fill_table");
-
- /* deny access to non-superusers */
- if (check_global_access(thd, PROCESS_ACL)) {
-
- DBUG_RETURN(0);
- }
-
- heap = mem_heap_create(1000);
- mutex_enter(&dict_sys->mutex);
- mtr_start(&mtr);
-
- rec = dict_startscan_system(&pcur, &mtr, SYS_FOREIGN);
-
- while (rec) {
- const char* err_msg;
- dict_foreign_t foreign_rec;
-
- /* Populate a dict_foreign_t structure with information from
- a SYS_FOREIGN row */
- err_msg = dict_process_sys_foreign_rec(heap, rec, &foreign_rec);
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
-
- if (!err_msg) {
- i_s_dict_fill_sys_foreign(thd, &foreign_rec,
- tables->table);
- } else {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_CANT_FIND_SYSTEM_REC,
- err_msg);
- }
-
- mem_heap_empty(heap);
-
- /* Get the next record */
- mtr_start(&mtr);
- mutex_enter(&dict_sys->mutex);
- rec = dict_getnext_system(&pcur, &mtr);
- }
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
- mem_heap_free(heap);
-
- DBUG_RETURN(0);
-}
-/*******************************************************************//**
-Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_foreign
-@return 0 on success */
-static
-int
-innodb_sys_foreign_init(
-/*====================*/
- void* p) /*!< in/out: table schema object */
-{
- ST_SCHEMA_TABLE* schema;
-
- DBUG_ENTER("innodb_sys_foreign_init");
-
- schema = (ST_SCHEMA_TABLE*) p;
-
- schema->fields_info = innodb_sys_foreign_fields_info;
- schema->fill_table = i_s_sys_foreign_fill_table;
-
- DBUG_RETURN(0);
-}
-
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_foreign =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_FOREIGN"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_FOREIGN"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_foreign_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
-/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_sys_foreign_cols */
-static ST_FIELD_INFO innodb_sys_foreign_cols_fields_info[] =
-{
-#define SYS_FOREIGN_COL_ID 0
- {STRUCT_FLD(field_name, "ID"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_FOREIGN_COL_FOR_NAME 1
- {STRUCT_FLD(field_name, "FOR_COL_NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_FOREIGN_COL_REF_NAME 2
- {STRUCT_FLD(field_name, "REF_COL_NAME"),
- STRUCT_FLD(field_length, NAME_LEN + 1),
- STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, 0),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
-#define SYS_FOREIGN_COL_POS 3
- {STRUCT_FLD(field_name, "POS"),
- STRUCT_FLD(field_length, MY_INT32_NUM_DECIMAL_DIGITS),
- STRUCT_FLD(field_type, MYSQL_TYPE_LONG),
- STRUCT_FLD(value, 0),
- STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
- STRUCT_FLD(old_name, ""),
- STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
-
- END_OF_ST_FIELD_INFO
-};
-
-/**********************************************************************//**
-Function to fill information_schema.innodb_sys_foreign_cols with information
-collected by scanning SYS_FOREIGN_COLS table.
-@return 0 on success */
-static
-int
-i_s_dict_fill_sys_foreign_cols(
-/*==========================*/
- THD* thd, /*!< in: thread */
- const char* name, /*!< in: foreign key constraint name */
- const char* for_col_name, /*!< in: referencing column name*/
- const char* ref_col_name, /*!< in: referenced column
- name */
- ulint pos, /*!< in: column position */
- TABLE* table_to_fill) /*!< in/out: fill this table */
-{
- Field** fields;
-
- DBUG_ENTER("i_s_dict_fill_sys_foreign_cols");
-
- fields = table_to_fill->field;
-
- OK(field_store_string(fields[SYS_FOREIGN_COL_ID], name));
-
- OK(field_store_string(fields[SYS_FOREIGN_COL_FOR_NAME], for_col_name));
-
- OK(field_store_string(fields[SYS_FOREIGN_COL_REF_NAME], ref_col_name));
-
- OK(fields[SYS_FOREIGN_COL_POS]->store(pos));
-
- OK(schema_table_store_record(thd, table_to_fill));
-
- DBUG_RETURN(0);
-}
-/*******************************************************************//**
-Function to populate INFORMATION_SCHEMA.innodb_sys_foreign_cols table. Loop
-through each record in SYS_FOREIGN_COLS, and extract the foreign key column
-information and fill the INFORMATION_SCHEMA.innodb_sys_foreign_cols table.
-@return 0 on success */
-static
-int
-i_s_sys_foreign_cols_fill_table(
-/*============================*/
- THD* thd, /*!< in: thread */
- TABLE_LIST* tables, /*!< in/out: tables to fill */
- COND* cond) /*!< in: condition (not used) */
-{
- btr_pcur_t pcur;
- const rec_t* rec;
- mem_heap_t* heap;
- mtr_t mtr;
-
- DBUG_ENTER("i_s_sys_foreign_cols_fill_table");
-
- /* deny access to non-superusers */
- if (check_global_access(thd, PROCESS_ACL)) {
- DBUG_RETURN(0);
- }
-
- heap = mem_heap_create(1000);
- mutex_enter(&dict_sys->mutex);
- mtr_start(&mtr);
-
- rec = dict_startscan_system(&pcur, &mtr, SYS_FOREIGN_COLS);
-
- while (rec) {
- const char* err_msg;
- const char* name;
- const char* for_col_name;
- const char* ref_col_name;
- ulint pos;
-
- /* Extract necessary information from a SYS_FOREIGN_COLS row */
- err_msg = dict_process_sys_foreign_col_rec(
- heap, rec, &name, &for_col_name, &ref_col_name, &pos);
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
-
- if (!err_msg) {
- i_s_dict_fill_sys_foreign_cols(
- thd, name, for_col_name, ref_col_name, pos,
- tables->table);
- } else {
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_CANT_FIND_SYSTEM_REC,
- err_msg);
- }
-
- mem_heap_empty(heap);
-
- /* Get the next record */
- mutex_enter(&dict_sys->mutex);
- mtr_start(&mtr);
- rec = dict_getnext_system(&pcur, &mtr);
- }
-
- mtr_commit(&mtr);
- mutex_exit(&dict_sys->mutex);
- mem_heap_free(heap);
-
- DBUG_RETURN(0);
-}
-/*******************************************************************//**
-Bind the dynamic table INFORMATION_SCHEMA.innodb_sys_foreign_cols
-@return 0 on success */
-static
-int
-innodb_sys_foreign_cols_init(
-/*========================*/
- void* p) /*!< in/out: table schema object */
-{
- ST_SCHEMA_TABLE* schema;
-
- DBUG_ENTER("innodb_sys_foreign_cols_init");
-
- schema = (ST_SCHEMA_TABLE*) p;
-
- schema->fields_info = innodb_sys_foreign_cols_fields_info;
- schema->fill_table = i_s_sys_foreign_cols_fill_table;
-
- DBUG_RETURN(0);
-}
-
-UNIV_INTERN struct st_mysql_plugin i_s_innodb_sys_foreign_cols =
-{
- /* the plugin type (a MYSQL_XXX_PLUGIN value) */
- /* int */
- STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
-
- /* pointer to type-specific plugin descriptor */
- /* void* */
- STRUCT_FLD(info, &i_s_info),
-
- /* plugin name */
- /* const char* */
- STRUCT_FLD(name, "INNODB_SYS_FOREIGN_COLS"),
-
- /* plugin author (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(author, plugin_author),
-
- /* general descriptive text (for SHOW PLUGINS) */
- /* const char* */
- STRUCT_FLD(descr, "InnoDB SYS_FOREIGN_COLS"),
-
- /* the plugin license (PLUGIN_LICENSE_XXX) */
- /* int */
- STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
-
- /* the function to invoke when plugin is loaded */
- /* int (*)(void*); */
- STRUCT_FLD(init, innodb_sys_foreign_cols_init),
-
- /* the function to invoke when plugin is unloaded */
- /* int (*)(void*); */
- STRUCT_FLD(deinit, i_s_common_deinit),
-
- /* plugin version (for SHOW PLUGINS) */
- /* unsigned int */
- STRUCT_FLD(version, INNODB_VERSION_SHORT),
-
- /* struct st_mysql_show_var* */
- STRUCT_FLD(status_vars, NULL),
-
- /* struct st_mysql_sys_var** */
- STRUCT_FLD(system_vars, NULL),
-
- /* reserved for dependency checking */
- /* void* */
- STRUCT_FLD(__reserved1, NULL)
-};
-
diff --git a/storage/innobase/handler/i_s.h b/storage/innobase/handler/i_s.h
index 69f5ed9dad8..dc0deef119b 100644
--- a/storage/innobase/handler/i_s.h
+++ b/storage/innobase/handler/i_s.h
@@ -26,6 +26,8 @@ Created July 18, 2007 Vasil Dimov
#ifndef i_s_h
#define i_s_h
+const char plugin_author[] = "Oracle Corporation";
+
extern struct st_mysql_plugin i_s_innodb_trx;
extern struct st_mysql_plugin i_s_innodb_locks;
extern struct st_mysql_plugin i_s_innodb_lock_waits;
@@ -33,12 +35,5 @@ extern struct st_mysql_plugin i_s_innodb_cmp;
extern struct st_mysql_plugin i_s_innodb_cmp_reset;
extern struct st_mysql_plugin i_s_innodb_cmpmem;
extern struct st_mysql_plugin i_s_innodb_cmpmem_reset;
-extern struct st_mysql_plugin i_s_innodb_sys_tables;
-extern struct st_mysql_plugin i_s_innodb_sys_tablestats;
-extern struct st_mysql_plugin i_s_innodb_sys_indexes;
-extern struct st_mysql_plugin i_s_innodb_sys_columns;
-extern struct st_mysql_plugin i_s_innodb_sys_fields;
-extern struct st_mysql_plugin i_s_innodb_sys_foreign;
-extern struct st_mysql_plugin i_s_innodb_sys_foreign_cols;
#endif /* i_s_h */
diff --git a/storage/innobase/handler/mysql_addons.cc b/storage/innobase/handler/mysql_addons.cc
deleted file mode 100644
index ae6306e5db9..00000000000
--- a/storage/innobase/handler/mysql_addons.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 2007, 2009, Innobase Oy. All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
-
-*****************************************************************************/
-
-/**************************************************//**
-@file handler/mysql_addons.cc
-This file contains functions that need to be added to
-MySQL code but have not been added yet.
-
-Whenever you add a function here submit a MySQL bug
-report (feature request) with the implementation. Then
-write the bug number in the comment before the
-function in this file.
-
-When MySQL commits the function it can be deleted from
-here. In a perfect world this file exists but is empty.
-
-Created November 07, 2007 Vasil Dimov
-*******************************************************/
-
-#ifndef MYSQL_SERVER
-#define MYSQL_SERVER
-#endif /* MYSQL_SERVER */
-
-#include <sql_priv.h>
-
-#include "mysql_addons.h"
-#include "univ.i"
diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
index a048de0e884..7d94ebc6438 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.c
+++ b/storage/innobase/ibuf/ibuf0ibuf.c
@@ -44,11 +44,11 @@ Created 7/19/1997 Heikki Tuuri
#include "fsp0fsp.h"
#include "trx0sys.h"
#include "fil0fil.h"
-#include "thr0loc.h"
#include "rem0rec.h"
#include "btr0cur.h"
#include "btr0pcur.h"
#include "btr0btr.h"
+#include "row0upd.h"
#include "sync0sync.h"
#include "dict0boot.h"
#include "fut0lst.h"
@@ -192,6 +192,11 @@ access order rules. */
/** Operations that can currently be buffered. */
UNIV_INTERN ibuf_use_t ibuf_use = IBUF_USE_ALL;
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/** Flag to control insert buffer debugging. */
+UNIV_INTERN uint ibuf_debug;
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
/** The insert buffer control structure */
UNIV_INTERN ibuf_t* ibuf = NULL;
@@ -318,52 +323,43 @@ still physically like the index page even if the index would have been
dropped! So, there seems to be no problem. */
/******************************************************************//**
-Sets the flag in the current OS thread local storage denoting that it is
+Sets the flag in the current mini-transaction record indicating we're
inside an insert buffer routine. */
UNIV_INLINE
void
-ibuf_enter(void)
-/*============*/
+ibuf_enter(
+/*=======*/
+ mtr_t* mtr) /*!< in/out: mini-transaction */
{
- ibool* ptr;
-
- ptr = thr_local_get_in_ibuf_field();
-
- ut_ad(*ptr == FALSE);
-
- *ptr = TRUE;
+ ut_ad(!mtr->inside_ibuf);
+ mtr->inside_ibuf = TRUE;
}
/******************************************************************//**
-Sets the flag in the current OS thread local storage denoting that it is
+Sets the flag in the current mini-transaction record indicating we're
exiting an insert buffer routine. */
UNIV_INLINE
void
-ibuf_exit(void)
-/*===========*/
+ibuf_exit(
+/*======*/
+ mtr_t* mtr) /*!< in/out: mini-transaction */
{
- ibool* ptr;
-
- ptr = thr_local_get_in_ibuf_field();
-
- ut_ad(*ptr == TRUE);
-
- *ptr = FALSE;
+ ut_ad(mtr->inside_ibuf);
+ mtr->inside_ibuf = FALSE;
}
-/******************************************************************//**
-Returns TRUE if the current OS thread is performing an insert buffer
-routine.
-
-For instance, a read-ahead of non-ibuf pages is forbidden by threads
-that are executing an insert buffer routine.
-@return TRUE if inside an insert buffer routine */
-UNIV_INTERN
-ibool
-ibuf_inside(void)
-/*=============*/
+/**************************************************************//**
+Commits an insert buffer mini-transaction and sets the persistent
+cursor latch mode to BTR_NO_LATCHES, that is, detaches the cursor. */
+UNIV_INLINE
+void
+ibuf_btr_pcur_commit_specify_mtr(
+/*=============================*/
+ btr_pcur_t* pcur, /*!< in/out: persistent cursor */
+ mtr_t* mtr) /*!< in/out: mini-transaction */
{
- return(*thr_local_get_in_ibuf_field());
+ ut_d(ibuf_exit(mtr));
+ btr_pcur_commit_specify_mtr(pcur, mtr);
}
/******************************************************************//**
@@ -373,11 +369,11 @@ static
page_t*
ibuf_header_page_get(
/*=================*/
- mtr_t* mtr) /*!< in: mtr */
+ mtr_t* mtr) /*!< in/out: mini-transaction */
{
buf_block_t* block;
- ut_ad(!ibuf_inside());
+ ut_ad(!ibuf_inside(mtr));
block = buf_page_get(
IBUF_SPACE_ID, 0, FSP_IBUF_HEADER_PAGE_NO, RW_X_LATCH, mtr);
@@ -398,7 +394,7 @@ ibuf_tree_root_get(
buf_block_t* block;
page_t* root;
- ut_ad(ibuf_inside());
+ ut_ad(ibuf_inside(mtr));
ut_ad(mutex_own(&ibuf_mutex));
mtr_x_lock(dict_index_get_lock(ibuf->index), mtr);
@@ -541,7 +537,7 @@ ibuf_init_at_db_start(void)
fseg_n_reserved_pages(header_page + IBUF_HEADER + IBUF_TREE_SEG_HEADER,
&n_used, &mtr);
- ibuf_enter();
+ ibuf_enter(&mtr);
ut_ad(n_used >= 2);
@@ -562,9 +558,7 @@ ibuf_init_at_db_start(void)
mutex_exit(&ibuf_mutex);
ibuf->empty = (page_get_n_recs(root) == 0);
- mtr_commit(&mtr);
-
- ibuf_exit();
+ ibuf_mtr_commit(&mtr);
heap = mem_heap_create(450);
@@ -650,22 +644,49 @@ ibuf_parse_bitmap_init(
return(ptr);
}
#ifndef UNIV_HOTBACKUP
+# ifdef UNIV_DEBUG
+/** Gets the desired bits for a given page from a bitmap page.
+@param page in: bitmap page
+@param offset in: page whose bits to get
+@param zs in: compressed page size in bytes; 0 for uncompressed pages
+@param bit in: IBUF_BITMAP_FREE, IBUF_BITMAP_BUFFERED, ...
+@param mtr in: mini-transaction holding an x-latch on the bitmap page
+@return value of bits */
+# define ibuf_bitmap_page_get_bits(page, offset, zs, bit, mtr) \
+ ibuf_bitmap_page_get_bits_low(page, offset, zs, \
+ MTR_MEMO_PAGE_X_FIX, mtr, bit)
+# else /* UNIV_DEBUG */
+/** Gets the desired bits for a given page from a bitmap page.
+@param page in: bitmap page
+@param offset in: page whose bits to get
+@param zs in: compressed page size in bytes; 0 for uncompressed pages
+@param bit in: IBUF_BITMAP_FREE, IBUF_BITMAP_BUFFERED, ...
+@param mtr in: mini-transaction holding an x-latch on the bitmap page
+@return value of bits */
+# define ibuf_bitmap_page_get_bits(page, offset, zs, bit, mtr) \
+ ibuf_bitmap_page_get_bits_low(page, offset, zs, bit)
+# endif /* UNIV_DEBUG */
+
/********************************************************************//**
Gets the desired bits for a given page from a bitmap page.
@return value of bits */
UNIV_INLINE
ulint
-ibuf_bitmap_page_get_bits(
-/*======================*/
+ibuf_bitmap_page_get_bits_low(
+/*==========================*/
const page_t* page, /*!< in: bitmap page */
ulint page_no,/*!< in: page whose bits to get */
ulint zip_size,/*!< in: compressed page size in bytes;
0 for uncompressed pages */
- ulint bit, /*!< in: IBUF_BITMAP_FREE,
+#ifdef UNIV_DEBUG
+ ulint latch_type,
+ /*!< in: MTR_MEMO_PAGE_X_FIX,
+ MTR_MEMO_BUF_FIX, ... */
+ mtr_t* mtr, /*!< in: mini-transaction holding latch_type
+ on the bitmap page */
+#endif /* UNIV_DEBUG */
+ ulint bit) /*!< in: IBUF_BITMAP_FREE,
IBUF_BITMAP_BUFFERED, ... */
- mtr_t* mtr __attribute__((unused)))
- /*!< in: mtr containing an
- x-latch to the bitmap page */
{
ulint byte_offset;
ulint bit_offset;
@@ -677,7 +698,7 @@ ibuf_bitmap_page_get_bits(
# error "IBUF_BITS_PER_PAGE % 2 != 0"
#endif
ut_ad(ut_is_2pow(zip_size));
- ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX));
+ ut_ad(mtr_memo_contains_page(mtr, page, latch_type));
if (!zip_size) {
bit_offset = (page_no % UNIV_PAGE_SIZE) * IBUF_BITS_PER_PAGE
@@ -1103,21 +1124,29 @@ Must not be called when recv_no_ibuf_operations==TRUE.
@return TRUE if level 2 or level 3 page */
UNIV_INTERN
ibool
-ibuf_page(
-/*======*/
- ulint space, /*!< in: space id */
- ulint zip_size,/*!< in: compressed page size in bytes, or 0 */
- ulint page_no,/*!< in: page number */
- mtr_t* mtr) /*!< in: mtr which will contain an x-latch to the
- bitmap page if the page is not one of the fixed
- address ibuf pages, or NULL, in which case a new
- transaction is created. */
+ibuf_page_low(
+/*==========*/
+ ulint space, /*!< in: space id */
+ ulint zip_size,/*!< in: compressed page size in bytes, or 0 */
+ ulint page_no,/*!< in: page number */
+#ifdef UNIV_DEBUG
+ ibool x_latch,/*!< in: FALSE if relaxed check
+ (avoid latching the bitmap page) */
+#endif /* UNIV_DEBUG */
+ const char* file, /*!< in: file name */
+ ulint line, /*!< in: line where called */
+ mtr_t* mtr) /*!< in: mtr which will contain an
+ x-latch to the bitmap page if the page
+ is not one of the fixed address ibuf
+ pages, or NULL, in which case a new
+ transaction is created. */
{
ibool ret;
mtr_t local_mtr;
page_t* bitmap_page;
ut_ad(!recv_no_ibuf_operations);
+ ut_ad(x_latch || mtr == NULL);
if (ibuf_fixed_addr_page(space, zip_size, page_no)) {
@@ -1129,12 +1158,44 @@ ibuf_page(
ut_ad(fil_space_get_type(IBUF_SPACE_ID) == FIL_TABLESPACE);
+#ifdef UNIV_DEBUG
+ if (!x_latch) {
+ mtr_start(&local_mtr);
+
+ /* Get the bitmap page without a page latch, so that
+ we will not be violating the latching order when
+ another bitmap page has already been latched by this
+ thread. The page will be buffer-fixed, and thus it
+ cannot be removed or relocated while we are looking at
+ it. The contents of the page could change, but the
+ IBUF_BITMAP_IBUF bit that we are interested in should
+ not be modified by any other thread. Nobody should be
+ calling ibuf_add_free_page() or ibuf_remove_free_page()
+ while the page is linked to the insert buffer b-tree. */
+
+ bitmap_page = buf_block_get_frame(
+ buf_page_get_gen(
+ space, zip_size,
+ ibuf_bitmap_page_no_calc(zip_size, page_no),
+ RW_NO_LATCH, NULL, BUF_GET_NO_LATCH,
+ file, line, &local_mtr));
+
+ ret = ibuf_bitmap_page_get_bits_low(
+ bitmap_page, page_no, zip_size,
+ MTR_MEMO_BUF_FIX, &local_mtr, IBUF_BITMAP_IBUF);
+
+ mtr_commit(&local_mtr);
+ return(ret);
+ }
+#endif /* UNIV_DEBUG */
+
if (mtr == NULL) {
mtr = &local_mtr;
mtr_start(mtr);
}
- bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, mtr);
+ bitmap_page = ibuf_bitmap_get_map_page_func(space, page_no, zip_size,
+ file, line, mtr);
ret = ibuf_bitmap_page_get_bits(bitmap_page, page_no, zip_size,
IBUF_BITMAP_IBUF, mtr);
@@ -1146,19 +1207,30 @@ ibuf_page(
return(ret);
}
+#ifdef UNIV_DEBUG
+# define ibuf_rec_get_page_no(mtr,rec) ibuf_rec_get_page_no_func(mtr,rec)
+#else /* UNIV_DEBUG */
+# define ibuf_rec_get_page_no(mtr,rec) ibuf_rec_get_page_no_func(rec)
+#endif /* UNIV_DEBUG */
+
/********************************************************************//**
Returns the page number field of an ibuf record.
@return page number */
static
ulint
-ibuf_rec_get_page_no(
-/*=================*/
+ibuf_rec_get_page_no_func(
+/*======================*/
+#ifdef UNIV_DEBUG
+ mtr_t* mtr, /*!< in: mini-transaction owning rec */
+#endif /* UNIV_DEBUG */
const rec_t* rec) /*!< in: ibuf record */
{
const byte* field;
ulint len;
- ut_ad(ibuf_inside());
+ ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
+ || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
+ ut_ad(ibuf_inside(mtr));
ut_ad(rec_get_n_fields_old(rec) > 2);
field = rec_get_nth_field_old(rec, 1, &len);
@@ -1180,20 +1252,31 @@ ibuf_rec_get_page_no(
return(mach_read_from_4(field));
}
+#ifdef UNIV_DEBUG
+# define ibuf_rec_get_space(mtr,rec) ibuf_rec_get_space_func(mtr,rec)
+#else /* UNIV_DEBUG */
+# define ibuf_rec_get_space(mtr,rec) ibuf_rec_get_space_func(rec)
+#endif /* UNIV_DEBUG */
+
/********************************************************************//**
Returns the space id field of an ibuf record. For < 4.1.x format records
returns 0.
@return space id */
static
ulint
-ibuf_rec_get_space(
-/*===============*/
+ibuf_rec_get_space_func(
+/*====================*/
+#ifdef UNIV_DEBUG
+ mtr_t* mtr, /*!< in: mini-transaction owning rec */
+#endif /* UNIV_DEBUG */
const rec_t* rec) /*!< in: ibuf record */
{
const byte* field;
ulint len;
- ut_ad(ibuf_inside());
+ ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
+ || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
+ ut_ad(ibuf_inside(mtr));
ut_ad(rec_get_n_fields_old(rec) > 2);
field = rec_get_nth_field_old(rec, 1, &len);
@@ -1214,12 +1297,22 @@ ibuf_rec_get_space(
return(0);
}
+#ifdef UNIV_DEBUG
+# define ibuf_rec_get_info(mtr,rec,op,comp,info_len,counter) \
+ ibuf_rec_get_info_func(mtr,rec,op,comp,info_len,counter)
+#else /* UNIV_DEBUG */
+# define ibuf_rec_get_info(mtr,rec,op,comp,info_len,counter) \
+ ibuf_rec_get_info_func(rec,op,comp,info_len,counter)
+#endif
/****************************************************************//**
Get various information about an ibuf record in >= 4.1.x format. */
static
void
-ibuf_rec_get_info(
-/*==============*/
+ibuf_rec_get_info_func(
+/*===================*/
+#ifdef UNIV_DEBUG
+ mtr_t* mtr, /*!< in: mini-transaction owning rec */
+#endif /* UNIV_DEBUG */
const rec_t* rec, /*!< in: ibuf record */
ibuf_op_t* op, /*!< out: operation type, or NULL */
ibool* comp, /*!< out: compact flag, or NULL */
@@ -1238,7 +1331,9 @@ ibuf_rec_get_info(
ulint info_len_local;
ulint counter_local;
- ut_ad(ibuf_inside());
+ ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
+ || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
+ ut_ad(ibuf_inside(mtr));
fields = rec_get_n_fields_old(rec);
ut_a(fields > 4);
@@ -1287,22 +1382,32 @@ ibuf_rec_get_info(
}
}
+#ifdef UNIV_DEBUG
+# define ibuf_rec_get_op_type(mtr,rec) ibuf_rec_get_op_type_func(mtr,rec)
+#else /* UNIV_DEBUG */
+# define ibuf_rec_get_op_type(mtr,rec) ibuf_rec_get_op_type_func(rec)
+#endif
+
/****************************************************************//**
Returns the operation type field of an ibuf record.
@return operation type */
static
ibuf_op_t
-ibuf_rec_get_op_type(
-/*=================*/
+ibuf_rec_get_op_type_func(
+/*======================*/
+#ifdef UNIV_DEBUG
+ mtr_t* mtr, /*!< in: mini-transaction owning rec */
+#endif /* UNIV_DEBUG */
const rec_t* rec) /*!< in: ibuf record */
{
ulint len;
- const byte* field;
- ut_ad(ibuf_inside());
+ ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
+ || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
+ ut_ad(ibuf_inside(mtr));
ut_ad(rec_get_n_fields_old(rec) > 2);
- field = rec_get_nth_field_old(rec, 1, &len);
+ (void) rec_get_nth_field_old(rec, 1, &len);
if (len > 1) {
/* This is a < 4.1.x format record */
@@ -1311,7 +1416,7 @@ ibuf_rec_get_op_type(
} else {
ibuf_op_t op;
- ibuf_rec_get_info(rec, &op, NULL, NULL, NULL);
+ ibuf_rec_get_info(mtr, rec, &op, NULL, NULL, NULL);
return(op);
}
@@ -1358,12 +1463,12 @@ ibuf_add_ops(
const ulint* ops) /*!< in: operation counts */
{
+ ulint i;
+
#ifndef HAVE_ATOMIC_BUILTINS
ut_ad(mutex_own(&ibuf_mutex));
#endif /* !HAVE_ATOMIC_BUILTINS */
- ulint i;
-
for (i = 0; i < IBUF_OP_COUNT; i++) {
#ifdef HAVE_ATOMIC_BUILTINS
os_atomic_increment_ulint(&arr[i], ops[i]);
@@ -1510,6 +1615,14 @@ ibuf_build_entry_pre_4_1_x(
return(tuple);
}
+#ifdef UNIV_DEBUG
+# define ibuf_build_entry_from_ibuf_rec(mtr,ibuf_rec,heap,pindex) \
+ ibuf_build_entry_from_ibuf_rec_func(mtr,ibuf_rec,heap,pindex)
+#else /* UNIV_DEBUG */
+# define ibuf_build_entry_from_ibuf_rec(mtr,ibuf_rec,heap,pindex) \
+ ibuf_build_entry_from_ibuf_rec_func(ibuf_rec,heap,pindex)
+#endif
+
/*********************************************************************//**
Builds the entry used to
@@ -1528,8 +1641,11 @@ hold a latch to the ibuf_rec page as long as the entry is used!
@return own: entry to insert to a non-clustered index */
static
dtuple_t*
-ibuf_build_entry_from_ibuf_rec(
-/*===========================*/
+ibuf_build_entry_from_ibuf_rec_func(
+/*================================*/
+#ifdef UNIV_DEBUG
+ mtr_t* mtr, /*!< in: mini-transaction owning rec */
+#endif /* UNIV_DEBUG */
const rec_t* ibuf_rec, /*!< in: record in an insert buffer */
mem_heap_t* heap, /*!< in: heap where built */
dict_index_t** pindex) /*!< out, own: dummy index that
@@ -1546,6 +1662,10 @@ ibuf_build_entry_from_ibuf_rec(
ulint comp;
dict_index_t* index;
+ ut_ad(mtr_memo_contains_page(mtr, ibuf_rec, MTR_MEMO_PAGE_X_FIX)
+ || mtr_memo_contains_page(mtr, ibuf_rec, MTR_MEMO_PAGE_S_FIX));
+ ut_ad(ibuf_inside(mtr));
+
data = rec_get_nth_field_old(ibuf_rec, 1, &len);
if (len > 1) {
@@ -1566,7 +1686,7 @@ ibuf_build_entry_from_ibuf_rec(
types = rec_get_nth_field_old(ibuf_rec, 3, &len);
- ibuf_rec_get_info(ibuf_rec, NULL, &comp, &info_len, NULL);
+ ibuf_rec_get_info(mtr, ibuf_rec, NULL, &comp, &info_len, NULL);
index = ibuf_dummy_index_create(n_fields, comp);
@@ -1653,6 +1773,12 @@ ibuf_rec_get_size(
return(size);
}
+#ifdef UNIV_DEBUG
+# define ibuf_rec_get_volume(mtr,rec) ibuf_rec_get_volume_func(mtr,rec)
+#else /* UNIV_DEBUG */
+# define ibuf_rec_get_volume(mtr,rec) ibuf_rec_get_volume_func(rec)
+#endif
+
/********************************************************************//**
Returns the space taken by a stored non-clustered index entry if converted to
an index record.
@@ -1660,8 +1786,11 @@ an index record.
taken in the page directory */
static
ulint
-ibuf_rec_get_volume(
-/*================*/
+ibuf_rec_get_volume_func(
+/*=====================*/
+#ifdef UNIV_DEBUG
+ mtr_t* mtr, /*!< in: mini-transaction owning rec */
+#endif /* UNIV_DEBUG */
const rec_t* ibuf_rec)/*!< in: ibuf record */
{
ulint len;
@@ -1672,7 +1801,9 @@ ibuf_rec_get_volume(
ibool pre_4_1;
ulint comp;
- ut_ad(ibuf_inside());
+ ut_ad(mtr_memo_contains_page(mtr, ibuf_rec, MTR_MEMO_PAGE_X_FIX)
+ || mtr_memo_contains_page(mtr, ibuf_rec, MTR_MEMO_PAGE_S_FIX));
+ ut_ad(ibuf_inside(mtr));
ut_ad(rec_get_n_fields_old(ibuf_rec) > 2);
data = rec_get_nth_field_old(ibuf_rec, 1, &len);
@@ -1700,7 +1831,7 @@ ibuf_rec_get_volume(
types = rec_get_nth_field_old(ibuf_rec, 3, &len);
- ibuf_rec_get_info(ibuf_rec, &op, &comp, &info_len, NULL);
+ ibuf_rec_get_info(mtr, ibuf_rec, &op, &comp, &info_len, NULL);
if (op == IBUF_OP_DELETE_MARK || op == IBUF_OP_DELETE) {
/* Delete-marking a record doesn't take any
@@ -1717,7 +1848,7 @@ ibuf_rec_get_volume(
mem_heap_t* heap = mem_heap_create(500);
entry = ibuf_build_entry_from_ibuf_rec(
- ibuf_rec, heap, &dummy_index);
+ mtr, ibuf_rec, heap, &dummy_index);
volume = rec_get_converted_size(dummy_index, entry, 0);
@@ -2075,21 +2206,15 @@ ibuf_add_free_page(void)
mtr_commit(&mtr);
return(FALSE);
- }
-
- {
- buf_block_t* block;
-
- block = buf_page_get(
+ } else {
+ buf_block_t* block = buf_page_get(
IBUF_SPACE_ID, 0, page_no, RW_X_LATCH, &mtr);
-
buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW);
-
page = buf_block_get_frame(block);
}
- ibuf_enter();
+ ibuf_enter(&mtr);
mutex_enter(&ibuf_mutex);
@@ -2117,9 +2242,7 @@ ibuf_add_free_page(void)
ibuf_bitmap_page_set_bits(
bitmap_page, page_no, zip_size, IBUF_BITMAP_IBUF, TRUE, &mtr);
- mtr_commit(&mtr);
-
- ibuf_exit();
+ ibuf_mtr_commit(&mtr);
return(TRUE);
}
@@ -2151,7 +2274,7 @@ ibuf_remove_free_page(void)
header_page = ibuf_header_page_get(&mtr);
/* Prevent pessimistic inserts to insert buffer trees for a while */
- ibuf_enter();
+ ibuf_enter(&mtr);
mutex_enter(&ibuf_pessimistic_insert_mutex);
mutex_enter(&ibuf_mutex);
@@ -2160,14 +2283,12 @@ ibuf_remove_free_page(void)
mutex_exit(&ibuf_mutex);
mutex_exit(&ibuf_pessimistic_insert_mutex);
- ibuf_exit();
-
- mtr_commit(&mtr);
+ ibuf_mtr_commit(&mtr);
return;
}
- mtr_start(&mtr2);
+ ibuf_mtr_start(&mtr2);
root = ibuf_tree_root_get(&mtr2);
@@ -2180,9 +2301,8 @@ ibuf_remove_free_page(void)
because in fseg_free_page we access level 1 pages, and the root
is a level 2 page. */
- mtr_commit(&mtr2);
-
- ibuf_exit();
+ ibuf_mtr_commit(&mtr2);
+ ibuf_exit(&mtr);
/* Since pessimistic inserts were prevented, we know that the
page is still in the free list. NOTE that also deletes may take
@@ -2193,11 +2313,11 @@ ibuf_remove_free_page(void)
fseg_free_page(header_page + IBUF_HEADER + IBUF_TREE_SEG_HEADER,
IBUF_SPACE_ID, page_no, &mtr);
-#ifdef UNIV_DEBUG_FILE_ACCESSES
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
buf_page_reset_file_page_was_freed(IBUF_SPACE_ID, page_no);
-#endif
+#endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
- ibuf_enter();
+ ibuf_enter(&mtr);
mutex_enter(&ibuf_mutex);
@@ -2239,12 +2359,10 @@ ibuf_remove_free_page(void)
ibuf_bitmap_page_set_bits(
bitmap_page, page_no, zip_size, IBUF_BITMAP_IBUF, FALSE, &mtr);
-#ifdef UNIV_DEBUG_FILE_ACCESSES
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
buf_page_set_file_page_was_freed(IBUF_SPACE_ID, page_no);
-#endif
- mtr_commit(&mtr);
-
- ibuf_exit();
+#endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
+ ibuf_mtr_commit(&mtr);
}
/***********************************************************************//**
@@ -2266,8 +2384,6 @@ ibuf_free_excess_pages(void)
ut_ad(rw_lock_get_x_lock_count(
fil_space_get_latch(IBUF_SPACE_ID, NULL)) == 1);
- ut_ad(!ibuf_inside());
-
/* NOTE: We require that the thread did not own the latch before,
because then we know that we can obey the correct latching order
for ibuf latches */
@@ -2298,20 +2414,30 @@ ibuf_free_excess_pages(void)
}
}
+#ifdef UNIV_DEBUG
+# define ibuf_get_merge_page_nos(contract,rec,mtr,ids,vers,pages,n_stored) \
+ ibuf_get_merge_page_nos_func(contract,rec,mtr,ids,vers,pages,n_stored)
+#else /* UNIV_DEBUG */
+# define ibuf_get_merge_page_nos(contract,rec,mtr,ids,vers,pages,n_stored) \
+ ibuf_get_merge_page_nos_func(contract,rec,ids,vers,pages,n_stored)
+#endif /* UNIV_DEBUG */
+
/*********************************************************************//**
Reads page numbers from a leaf in an ibuf tree.
@return a lower limit for the combined volume of records which will be
merged */
static
ulint
-ibuf_get_merge_page_nos(
-/*====================*/
+ibuf_get_merge_page_nos_func(
+/*=========================*/
ibool contract,/*!< in: TRUE if this function is called to
contract the tree, FALSE if this is called
when a single page becomes full and we look
if it pays to read also nearby pages */
- rec_t* rec, /*!< in: record from which we read up and down
- in the chain of records */
+ const rec_t* rec, /*!< in: insert buffer record */
+#ifdef UNIV_DEBUG
+ mtr_t* mtr, /*!< in: mini-transaction holding rec */
+#endif /* UNIV_DEBUG */
ulint* space_ids,/*!< in/out: space id's of the pages */
ib_int64_t* space_versions,/*!< in/out: tablespace version
timestamps; used to prevent reading in old
@@ -2334,18 +2460,22 @@ ibuf_get_merge_page_nos(
ulint limit;
ulint n_pages;
+ ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
+ || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
+ ut_ad(ibuf_inside(mtr));
+
*n_stored = 0;
limit = ut_min(IBUF_MAX_N_PAGES_MERGED, buf_pool_get_curr_size() / 4);
if (page_rec_is_supremum(rec)) {
- rec = page_rec_get_prev(rec);
+ rec = page_rec_get_prev_const(rec);
}
if (page_rec_is_infimum(rec)) {
- rec = page_rec_get_next(rec);
+ rec = page_rec_get_next_const(rec);
}
if (page_rec_is_supremum(rec)) {
@@ -2353,8 +2483,8 @@ ibuf_get_merge_page_nos(
return(0);
}
- first_page_no = ibuf_rec_get_page_no(rec);
- first_space_id = ibuf_rec_get_space(rec);
+ first_page_no = ibuf_rec_get_page_no(mtr, rec);
+ first_space_id = ibuf_rec_get_space(mtr, rec);
n_pages = 0;
prev_page_no = 0;
prev_space_id = 0;
@@ -2365,8 +2495,8 @@ ibuf_get_merge_page_nos(
while (!page_rec_is_infimum(rec) && UNIV_LIKELY(n_pages < limit)) {
- rec_page_no = ibuf_rec_get_page_no(rec);
- rec_space_id = ibuf_rec_get_space(rec);
+ rec_page_no = ibuf_rec_get_page_no(mtr, rec);
+ rec_space_id = ibuf_rec_get_space(mtr, rec);
if (rec_space_id != first_space_id
|| (rec_page_no / IBUF_MERGE_AREA)
@@ -2383,10 +2513,10 @@ ibuf_get_merge_page_nos(
prev_page_no = rec_page_no;
prev_space_id = rec_space_id;
- rec = page_rec_get_prev(rec);
+ rec = page_rec_get_prev_const(rec);
}
- rec = page_rec_get_next(rec);
+ rec = page_rec_get_next_const(rec);
/* At the loop start there is no prev page; we mark this with a pair
of space id, page no (0, 0) for which there can never be entries in
@@ -2404,8 +2534,8 @@ ibuf_get_merge_page_nos(
rec_page_no = 1;
rec_space_id = 0;
} else {
- rec_page_no = ibuf_rec_get_page_no(rec);
- rec_space_id = ibuf_rec_get_space(rec);
+ rec_page_no = ibuf_rec_get_page_no(mtr, rec);
+ rec_space_id = ibuf_rec_get_space(mtr, rec);
ut_ad(rec_page_no > IBUF_TREE_ROOT_PAGE_NO);
}
@@ -2416,9 +2546,9 @@ ibuf_get_merge_page_nos(
|| rec_page_no != prev_page_no)
&& (prev_space_id != 0 || prev_page_no != 0)) {
- if ((prev_page_no == first_page_no
- && prev_space_id == first_space_id)
- || contract
+ if (contract
+ || (prev_page_no == first_page_no
+ && prev_space_id == first_space_id)
|| (volume_for_page
> ((IBUF_MERGE_THRESHOLD - 1)
* 4 * UNIV_PAGE_SIZE
@@ -2451,14 +2581,14 @@ ibuf_get_merge_page_nos(
break;
}
- rec_volume = ibuf_rec_get_volume(rec);
+ rec_volume = ibuf_rec_get_volume(mtr, rec);
volume_for_page += rec_volume;
prev_page_no = rec_page_no;
prev_space_id = rec_space_id;
- rec = page_rec_get_next(rec);
+ rec = page_rec_get_next_const(rec);
}
#ifdef UNIV_IBUF_DEBUG
@@ -2493,7 +2623,6 @@ ibuf_contract_ext(
mtr_t mtr;
*n_pages = 0;
- ut_ad(!ibuf_inside());
/* We perform a dirty read of ibuf->empty, without latching
the insert buffer root page. We trust this dirty read except
@@ -2502,29 +2631,10 @@ ibuf_contract_ext(
if (UNIV_UNLIKELY(ibuf->empty)
&& UNIV_LIKELY(!srv_shutdown_state)) {
-ibuf_is_empty:
-
-#if 0 /* TODO */
- if (srv_shutdown_state) {
- /* If the insert buffer becomes empty during
- shutdown, note it in the system tablespace. */
-
- trx_sys_set_ibuf_format(TRX_SYS_IBUF_EMPTY);
- }
-
- /* TO DO: call trx_sys_set_ibuf_format() at startup
- and whenever ibuf_use is changed to allow buffered
- delete-marking or deleting. Never downgrade the
- stamped format except when the insert buffer becomes
- empty. */
-#endif
-
return(0);
}
- mtr_start(&mtr);
-
- ibuf_enter();
+ ibuf_mtr_start(&mtr);
/* Open a cursor to a randomly chosen leaf of the tree, at a random
position within the leaf */
@@ -2543,24 +2653,21 @@ ibuf_is_empty:
ut_ad(page_get_page_no(btr_pcur_get_page(&pcur))
== FSP_IBUF_TREE_ROOT_PAGE_NO);
- ibuf_exit();
-
- mtr_commit(&mtr);
+ ibuf_mtr_commit(&mtr);
btr_pcur_close(&pcur);
- goto ibuf_is_empty;
+ return(0);
}
- sum_sizes = ibuf_get_merge_page_nos(TRUE, btr_pcur_get_rec(&pcur),
+ sum_sizes = ibuf_get_merge_page_nos(TRUE,
+ btr_pcur_get_rec(&pcur), &mtr,
space_ids, space_versions,
page_nos, n_pages);
#if 0 /* defined UNIV_IBUF_DEBUG */
fprintf(stderr, "Ibuf contract sync %lu pages %lu volume %lu\n",
sync, *n_pages, sum_sizes);
#endif
- ibuf_exit();
-
- mtr_commit(&mtr);
+ ibuf_mtr_commit(&mtr);
btr_pcur_close(&pcur);
buf_read_ibuf_merge_pages(sync, space_ids, space_versions, page_nos,
@@ -2700,6 +2807,13 @@ ibuf_get_volume_buffered_hash(
return(TRUE);
}
+#ifdef UNIV_DEBUG
+# define ibuf_get_volume_buffered_count(mtr,rec,hash,size,n_recs) \
+ ibuf_get_volume_buffered_count_func(mtr,rec,hash,size,n_recs)
+#else /* UNIV_DEBUG */
+# define ibuf_get_volume_buffered_count(mtr,rec,hash,size,n_recs) \
+ ibuf_get_volume_buffered_count_func(rec,hash,size,n_recs)
+#endif
/*********************************************************************//**
Update the estimate of the number of records on a page, and
get the space taken by merging the buffered record to the index page.
@@ -2707,8 +2821,11 @@ get the space taken by merging the buffered record to the index page.
taken in the page directory */
static
ulint
-ibuf_get_volume_buffered_count(
-/*===========================*/
+ibuf_get_volume_buffered_count_func(
+/*================================*/
+#ifdef UNIV_DEBUG
+ mtr_t* mtr, /*!< in: mini-transaction owning rec */
+#endif /* UNIV_DEBUG */
const rec_t* rec, /*!< in: insert buffer record */
ulint* hash, /*!< in/out: hash array */
ulint size, /*!< in: number of elements in hash array */
@@ -2718,9 +2835,13 @@ ibuf_get_volume_buffered_count(
ulint len;
ibuf_op_t ibuf_op;
const byte* types;
- ulint n_fields = rec_get_n_fields_old(rec);
+ ulint n_fields;
- ut_ad(ibuf_inside());
+ ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
+ || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
+ ut_ad(ibuf_inside(mtr));
+
+ n_fields = rec_get_n_fields_old(rec);
ut_ad(n_fields > 4);
n_fields -= 4;
@@ -2762,9 +2883,8 @@ ibuf_get_volume_buffered_count(
switch (ibuf_op) {
case IBUF_OP_INSERT:
- /* Inserts can be done by
- btr_cur_set_deleted_flag_for_ibuf(). Because
- delete-mark and insert operations can be pointing to
+ /* Inserts can be done by updating a delete-marked record.
+ Because delete-mark and insert operations can be pointing to
the same records, we must not count duplicates. */
case IBUF_OP_DELETE_MARK:
/* There must be a record to delete-mark.
@@ -2806,7 +2926,7 @@ get_volume_comp:
mem_heap_t* heap = mem_heap_create(500);
entry = ibuf_build_entry_from_ibuf_rec(
- rec, heap, &dummy_index);
+ mtr, rec, heap, &dummy_index);
volume = rec_get_converted_size(dummy_index, entry, 0);
@@ -2827,7 +2947,7 @@ static
ulint
ibuf_get_volume_buffered(
/*=====================*/
- btr_pcur_t* pcur, /*!< in: pcur positioned at a place in an
+ const btr_pcur_t*pcur, /*!< in: pcur positioned at a place in an
insert buffer tree where we would insert an
entry for the index page whose number is
page_no, latch mode has to be BTR_MODIFY_PREV
@@ -2837,16 +2957,17 @@ ibuf_get_volume_buffered(
lint* n_recs, /*!< in/out: minimum number of records on the
page after the buffered changes have been
applied, or NULL to disable the counting */
- mtr_t* mtr) /*!< in: mtr */
+ mtr_t* mtr) /*!< in: mini-transaction of pcur */
{
- ulint volume;
- rec_t* rec;
- page_t* page;
- ulint prev_page_no;
- page_t* prev_page;
- ulint next_page_no;
- page_t* next_page;
- ulint hash_bitmap[128 / sizeof(ulint)]; /* bitmap of buffered recs */
+ ulint volume;
+ const rec_t* rec;
+ const page_t* page;
+ ulint prev_page_no;
+ const page_t* prev_page;
+ ulint next_page_no;
+ const page_t* next_page;
+ /* bitmap of buffered recs */
+ ulint hash_bitmap[128 / sizeof(ulint)];
ut_a(trx_sys_multiple_tablespace_format);
@@ -2867,26 +2988,22 @@ ibuf_get_volume_buffered(
ut_ad(page_validate(page, ibuf->index));
if (page_rec_is_supremum(rec)) {
- rec = page_rec_get_prev(rec);
+ rec = page_rec_get_prev_const(rec);
}
- for (;;) {
- if (page_rec_is_infimum(rec)) {
-
- break;
- }
+ for (; !page_rec_is_infimum(rec);
+ rec = page_rec_get_prev_const(rec)) {
+ ut_ad(page_align(rec) == page);
- if (page_no != ibuf_rec_get_page_no(rec)
- || space != ibuf_rec_get_space(rec)) {
+ if (page_no != ibuf_rec_get_page_no(mtr, rec)
+ || space != ibuf_rec_get_space(mtr, rec)) {
goto count_later;
}
volume += ibuf_get_volume_buffered_count(
- rec, hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs);
-
- rec = page_rec_get_prev(rec);
- ut_ad(page_align(rec) == page);
+ mtr, rec,
+ hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs);
}
/* Look at the previous page */
@@ -2902,7 +3019,8 @@ ibuf_get_volume_buffered(
buf_block_t* block;
block = buf_page_get(
- IBUF_SPACE_ID, 0, prev_page_no, RW_X_LATCH, mtr);
+ IBUF_SPACE_ID, 0, prev_page_no, RW_X_LATCH,
+ mtr);
buf_block_dbg_add_level(block, SYNC_TREE_NODE);
@@ -2912,14 +3030,15 @@ ibuf_get_volume_buffered(
}
#ifdef UNIV_BTR_DEBUG
- ut_a(btr_page_get_next(prev_page, mtr)
- == page_get_page_no(page));
+ ut_a(btr_page_get_next(prev_page, mtr) == page_get_page_no(page));
#endif /* UNIV_BTR_DEBUG */
rec = page_get_supremum_rec(prev_page);
- rec = page_rec_get_prev(rec);
+ rec = page_rec_get_prev_const(rec);
+
+ for (;; rec = page_rec_get_prev_const(rec)) {
+ ut_ad(page_align(rec) == prev_page);
- for (;;) {
if (page_rec_is_infimum(rec)) {
/* We cannot go to yet a previous page, because we
@@ -2929,42 +3048,35 @@ ibuf_get_volume_buffered(
return(UNIV_PAGE_SIZE);
}
- if (page_no != ibuf_rec_get_page_no(rec)
- || space != ibuf_rec_get_space(rec)) {
+ if (page_no != ibuf_rec_get_page_no(mtr, rec)
+ || space != ibuf_rec_get_space(mtr, rec)) {
goto count_later;
}
volume += ibuf_get_volume_buffered_count(
- rec, hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs);
-
- rec = page_rec_get_prev(rec);
- ut_ad(page_align(rec) == prev_page);
+ mtr, rec,
+ hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs);
}
count_later:
rec = btr_pcur_get_rec(pcur);
if (!page_rec_is_supremum(rec)) {
- rec = page_rec_get_next(rec);
+ rec = page_rec_get_next_const(rec);
}
- for (;;) {
- if (page_rec_is_supremum(rec)) {
-
- break;
- }
-
- if (page_no != ibuf_rec_get_page_no(rec)
- || space != ibuf_rec_get_space(rec)) {
+ for (; !page_rec_is_supremum(rec);
+ rec = page_rec_get_next_const(rec)) {
+ if (page_no != ibuf_rec_get_page_no(mtr, rec)
+ || space != ibuf_rec_get_space(mtr, rec)) {
return(volume);
}
volume += ibuf_get_volume_buffered_count(
- rec, hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs);
-
- rec = page_rec_get_next(rec);
+ mtr, rec,
+ hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs);
}
/* Look at the next page */
@@ -2980,7 +3092,8 @@ count_later:
buf_block_t* block;
block = buf_page_get(
- IBUF_SPACE_ID, 0, next_page_no, RW_X_LATCH, mtr);
+ IBUF_SPACE_ID, 0, next_page_no, RW_X_LATCH,
+ mtr);
buf_block_dbg_add_level(block, SYNC_TREE_NODE);
@@ -2994,9 +3107,11 @@ count_later:
#endif /* UNIV_BTR_DEBUG */
rec = page_get_infimum_rec(next_page);
- rec = page_rec_get_next(rec);
+ rec = page_rec_get_next_const(rec);
+
+ for (;; rec = page_rec_get_next_const(rec)) {
+ ut_ad(page_align(rec) == next_page);
- for (;;) {
if (page_rec_is_supremum(rec)) {
/* We give up */
@@ -3004,17 +3119,15 @@ count_later:
return(UNIV_PAGE_SIZE);
}
- if (page_no != ibuf_rec_get_page_no(rec)
- || space != ibuf_rec_get_space(rec)) {
+ if (page_no != ibuf_rec_get_page_no(mtr, rec)
+ || space != ibuf_rec_get_space(mtr, rec)) {
return(volume);
}
volume += ibuf_get_volume_buffered_count(
- rec, hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs);
-
- rec = page_rec_get_next(rec);
- ut_ad(page_align(rec) == next_page);
+ mtr, rec,
+ hash_bitmap, UT_ARR_SIZE(hash_bitmap), n_recs);
}
}
@@ -3035,9 +3148,7 @@ ibuf_update_max_tablespace_id(void)
ut_a(!dict_table_is_comp(ibuf->index->table));
- ibuf_enter();
-
- mtr_start(&mtr);
+ ibuf_mtr_start(&mtr);
btr_pcur_open_at_index_side(
FALSE, ibuf->index, BTR_SEARCH_LEAF, &pcur, TRUE, &mtr);
@@ -3060,14 +3171,20 @@ ibuf_update_max_tablespace_id(void)
max_space_id = mach_read_from_4(field);
}
- mtr_commit(&mtr);
- ibuf_exit();
+ ibuf_mtr_commit(&mtr);
/* printf("Maximum space id in insert buffer %lu\n", max_space_id); */
fil_set_max_space_id_if_bigger(max_space_id);
}
+#ifdef UNIV_DEBUG
+# define ibuf_get_entry_counter_low(mtr,rec,space,page_no) \
+ ibuf_get_entry_counter_low_func(mtr,rec,space,page_no)
+#else /* UNIV_DEBUG */
+# define ibuf_get_entry_counter_low(mtr,rec,space,page_no) \
+ ibuf_get_entry_counter_low_func(rec,space,page_no)
+#endif
/****************************************************************//**
Helper function for ibuf_set_entry_counter. Checks if rec is for (space,
page_no), and if so, reads counter value from it and returns that + 1.
@@ -3075,8 +3192,11 @@ Otherwise, returns 0.
@return new counter value, or 0 */
static
ulint
-ibuf_get_entry_counter_low(
-/*=======================*/
+ibuf_get_entry_counter_low_func(
+/*============================*/
+#ifdef UNIV_DEBUG
+ mtr_t* mtr, /*!< in: mini-transaction of rec */
+#endif /* UNIV_DEBUG */
const rec_t* rec, /*!< in: insert buffer record */
ulint space, /*!< in: space id */
ulint page_no) /*!< in: page number */
@@ -3085,7 +3205,9 @@ ibuf_get_entry_counter_low(
const byte* field;
ulint len;
- ut_ad(ibuf_inside());
+ ut_ad(ibuf_inside(mtr));
+ ut_ad(mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_X_FIX)
+ || mtr_memo_contains_page(mtr, rec, MTR_MEMO_PAGE_S_FIX));
ut_ad(rec_get_n_fields_old(rec) > 2);
field = rec_get_nth_field_old(rec, 1, &len);
@@ -3157,12 +3279,15 @@ ibuf_set_entry_counter(
ulint counter = 0;
/* pcur points to either a user rec or to a page's infimum record. */
+ ut_ad(ibuf_inside(mtr));
+ ut_ad(mtr_memo_contains(mtr, btr_pcur_get_block(pcur),
+ MTR_MEMO_PAGE_X_FIX));
ut_ad(page_validate(btr_pcur_get_page(pcur), ibuf->index));
if (btr_pcur_is_on_user_rec(pcur)) {
counter = ibuf_get_entry_counter_low(
- btr_pcur_get_rec(pcur), space, page_no);
+ mtr, btr_pcur_get_rec(pcur), space, page_no);
if (UNIV_UNLIKELY(counter == ULINT_UNDEFINED)) {
/* The record lacks a counter field.
@@ -3218,7 +3343,7 @@ ibuf_set_entry_counter(
ut_ad(page_rec_is_user_rec(rec));
counter = ibuf_get_entry_counter_low(
- rec, space, page_no);
+ mtr, rec, space, page_no);
if (UNIV_UNLIKELY(counter == ULINT_UNDEFINED)) {
/* The record lacks a counter field.
@@ -3370,7 +3495,6 @@ ibuf_insert_low(
if (mode == BTR_MODIFY_TREE) {
for (;;) {
- ibuf_enter();
mutex_enter(&ibuf_pessimistic_insert_mutex);
mutex_enter(&ibuf_mutex);
@@ -3381,7 +3505,6 @@ ibuf_insert_low(
mutex_exit(&ibuf_mutex);
mutex_exit(&ibuf_pessimistic_insert_mutex);
- ibuf_exit();
if (UNIV_UNLIKELY(!ibuf_add_free_page())) {
@@ -3389,11 +3512,9 @@ ibuf_insert_low(
return(DB_STRONG_FAIL);
}
}
- } else {
- ibuf_enter();
}
- mtr_start(&mtr);
+ ibuf_mtr_start(&mtr);
btr_pcur_open(ibuf->index, ibuf_entry, PAGE_CUR_LE, mode, &pcur, &mtr);
ut_ad(page_validate(btr_pcur_get_page(&pcur), ibuf->index));
@@ -3448,7 +3569,7 @@ fail_exit:
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a((buffered == 0) || ibuf_count_get(space, page_no));
#endif
- mtr_start(&bitmap_mtr);
+ ibuf_mtr_start(&bitmap_mtr);
bitmap_page = ibuf_bitmap_get_map_page(space, page_no,
zip_size, &bitmap_mtr);
@@ -3469,15 +3590,15 @@ fail_exit:
if (buffered + entry_size + page_dir_calc_reserved_space(1)
> ibuf_index_page_calc_free_from_bits(zip_size, bits)) {
/* Release the bitmap page latch early. */
- mtr_commit(&bitmap_mtr);
+ ibuf_mtr_commit(&bitmap_mtr);
/* It may not fit */
do_merge = TRUE;
- ibuf_get_merge_page_nos(
- FALSE, btr_pcur_get_rec(&pcur),
- space_ids, space_versions,
- page_nos, &n_stored);
+ ibuf_get_merge_page_nos(FALSE,
+ btr_pcur_get_rec(&pcur), &mtr,
+ space_ids, space_versions,
+ page_nos, &n_stored);
goto fail_exit;
}
@@ -3490,7 +3611,7 @@ fail_exit:
&& !ibuf_set_entry_counter(ibuf_entry, space, page_no, &pcur,
mode == BTR_MODIFY_PREV, &mtr)) {
bitmap_fail:
- mtr_commit(&bitmap_mtr);
+ ibuf_mtr_commit(&bitmap_mtr);
goto fail_exit;
}
@@ -3508,7 +3629,7 @@ bitmap_fail:
&bitmap_mtr);
}
- mtr_commit(&bitmap_mtr);
+ ibuf_mtr_commit(&bitmap_mtr);
cursor = btr_pcur_get_btr_cur(&pcur);
@@ -3573,9 +3694,8 @@ func_exit:
}
#endif
- mtr_commit(&mtr);
+ ibuf_mtr_commit(&mtr);
btr_pcur_close(&pcur);
- ibuf_exit();
mem_heap_free(heap);
@@ -3749,9 +3869,80 @@ During merge, inserts to an index page a secondary index entry extracted
from the insert buffer. */
static
void
+ibuf_insert_to_index_page_low(
+/*==========================*/
+ const dtuple_t* entry, /*!< in: buffered entry to insert */
+ buf_block_t* block, /*!< in/out: index page where the buffered
+ entry should be placed */
+ dict_index_t* index, /*!< in: record descriptor */
+ mtr_t* mtr, /*!< in/out: mtr */
+ page_cur_t* page_cur)/*!< in/out: cursor positioned on the record
+ after which to insert the buffered entry */
+{
+ const page_t* page;
+ ulint space;
+ ulint page_no;
+ ulint zip_size;
+ const page_t* bitmap_page;
+ ulint old_bits;
+
+ if (UNIV_LIKELY
+ (page_cur_tuple_insert(page_cur, entry, index, 0, mtr) != NULL)) {
+ return;
+ }
+
+ /* If the record did not fit, reorganize */
+
+ btr_page_reorganize(block, index, mtr);
+ page_cur_search(block, index, entry, PAGE_CUR_LE, page_cur);
+
+ /* This time the record must fit */
+
+ if (UNIV_LIKELY
+ (page_cur_tuple_insert(page_cur, entry, index, 0, mtr) != NULL)) {
+ return;
+ }
+
+ page = buf_block_get_frame(block);
+
+ ut_print_timestamp(stderr);
+
+ fprintf(stderr,
+ " InnoDB: Error: Insert buffer insert fails;"
+ " page free %lu, dtuple size %lu\n",
+ (ulong) page_get_max_insert_size(page, 1),
+ (ulong) rec_get_converted_size(index, entry, 0));
+ fputs("InnoDB: Cannot insert index record ", stderr);
+ dtuple_print(stderr, entry);
+ fputs("\nInnoDB: The table where this index record belongs\n"
+ "InnoDB: is now probably corrupt. Please run CHECK TABLE on\n"
+ "InnoDB: that table.\n", stderr);
+
+ space = page_get_space_id(page);
+ zip_size = buf_block_get_zip_size(block);
+ page_no = page_get_page_no(page);
+
+ bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, mtr);
+ old_bits = ibuf_bitmap_page_get_bits(bitmap_page, page_no, zip_size,
+ IBUF_BITMAP_FREE, mtr);
+
+ fprintf(stderr,
+ "InnoDB: space %lu, page %lu, zip_size %lu, bitmap bits %lu\n",
+ (ulong) space, (ulong) page_no,
+ (ulong) zip_size, (ulong) old_bits);
+
+ fputs("InnoDB: Submit a detailed bug report"
+ " to http://bugs.mysql.com\n", stderr);
+}
+
+/************************************************************************
+During merge, inserts to an index page a secondary index entry extracted
+from the insert buffer. */
+static
+void
ibuf_insert_to_index_page(
/*======================*/
- dtuple_t* entry, /*!< in: buffered entry to insert */
+ const dtuple_t* entry, /*!< in: buffered entry to insert */
buf_block_t* block, /*!< in/out: index page where the buffered entry
should be placed */
dict_index_t* index, /*!< in: record descriptor */
@@ -3761,11 +3952,10 @@ ibuf_insert_to_index_page(
ulint low_match;
page_t* page = buf_block_get_frame(block);
rec_t* rec;
- page_t* bitmap_page;
- ulint old_bits;
- ut_ad(ibuf_inside());
+ ut_ad(ibuf_inside(mtr));
ut_ad(dtuple_check_typed(entry));
+ ut_ad(!buf_block_align(page)->is_hashed);
if (UNIV_UNLIKELY(dict_table_is_comp(index->table)
!= (ibool)!!page_is_comp(page))) {
@@ -3779,17 +3969,11 @@ ibuf_insert_to_index_page(
rec = page_rec_get_next(page_get_infimum_rec(page));
if (page_rec_is_supremum(rec)) {
- /* Empty pages can result from buffered delete operations.
- The first record from the free list can be used to find the
- father node. */
- rec = page_header_get_ptr(page, PAGE_FREE);
- if (UNIV_UNLIKELY(rec == NULL)) {
- fputs("InnoDB: Trying to insert a record from"
- " the insert buffer to an index page\n"
- "InnoDB: but the index page is empty!\n",
- stderr);
- goto dump;
- }
+ fputs("InnoDB: Trying to insert a record from"
+ " the insert buffer to an index page\n"
+ "InnoDB: but the index page is empty!\n",
+ stderr);
+ goto dump;
}
if (UNIV_UNLIKELY(rec_get_n_fields(rec, index)
@@ -3817,71 +4001,87 @@ dump:
low_match = page_cur_search(block, index, entry,
PAGE_CUR_LE, &page_cur);
- if (low_match == dtuple_get_n_fields(entry)) {
+ if (UNIV_UNLIKELY(low_match == dtuple_get_n_fields(entry))) {
+ mem_heap_t* heap;
+ upd_t* update;
+ ulint* offsets;
page_zip_des_t* page_zip;
rec = page_cur_get_rec(&page_cur);
- page_zip = buf_block_get_page_zip(block);
- btr_cur_set_deleted_flag_for_ibuf(rec, page_zip, FALSE, mtr);
- } else {
- rec = page_cur_tuple_insert(&page_cur, entry, index, 0, mtr);
+ /* This is based on
+ row_ins_sec_index_entry_by_modify(BTR_MODIFY_LEAF). */
+ ut_ad(rec_get_deleted_flag(rec, page_is_comp(page)));
+
+ heap = mem_heap_create(1024);
+
+ offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED,
+ &heap);
+ update = row_upd_build_sec_rec_difference_binary(
+ index, entry, rec, NULL, heap);
+
+ page_zip = buf_block_get_page_zip(block);
- if (UNIV_LIKELY(rec != NULL)) {
+ if (update->n_fields == 0) {
+ /* The records only differ in the delete-mark.
+ Clear the delete-mark, like we did before
+ Bug #56680 was fixed. */
+ btr_cur_set_deleted_flag_for_ibuf(
+ rec, page_zip, FALSE, mtr);
+updated_in_place:
+ mem_heap_free(heap);
return;
}
- /* If the record did not fit, reorganize */
-
- btr_page_reorganize(block, index, mtr);
- page_cur_search(block, index, entry, PAGE_CUR_LE, &page_cur);
+ /* Copy the info bits. Clear the delete-mark. */
+ update->info_bits = rec_get_info_bits(rec, page_is_comp(page));
+ update->info_bits &= ~REC_INFO_DELETED_FLAG;
+
+ /* We cannot invoke btr_cur_optimistic_update() here,
+ because we do not have a btr_cur_t or que_thr_t,
+ as the insert buffer merge occurs at a very low level. */
+ if (!row_upd_changes_field_size_or_external(index, offsets,
+ update)
+ && (!page_zip || btr_cur_update_alloc_zip(
+ page_zip, block, index,
+ rec_offs_size(offsets), FALSE, mtr))) {
+ /* This is the easy case. Do something similar
+ to btr_cur_update_in_place(). */
+ row_upd_rec_in_place(rec, index, offsets,
+ update, page_zip);
+ goto updated_in_place;
+ }
- /* This time the record must fit */
- if (UNIV_UNLIKELY
- (!page_cur_tuple_insert(&page_cur, entry, index,
- 0, mtr))) {
- ulint space;
- ulint page_no;
- ulint zip_size;
+ /* A collation may identify values that differ in
+ storage length.
+ Some examples (1 or 2 bytes):
+ utf8_turkish_ci: I = U+0131 LATIN SMALL LETTER DOTLESS I
+ utf8_general_ci: S = U+00DF LATIN SMALL LETTER SHARP S
+ utf8_general_ci: A = U+00E4 LATIN SMALL LETTER A WITH DIAERESIS
- ut_print_timestamp(stderr);
+ latin1_german2_ci: SS = U+00DF LATIN SMALL LETTER SHARP S
- fprintf(stderr,
- " InnoDB: Error: Insert buffer insert"
- " fails; page free %lu,"
- " dtuple size %lu\n",
- (ulong) page_get_max_insert_size(
- page, 1),
- (ulong) rec_get_converted_size(
- index, entry, 0));
- fputs("InnoDB: Cannot insert index record ",
- stderr);
- dtuple_print(stderr, entry);
- fputs("\nInnoDB: The table where"
- " this index record belongs\n"
- "InnoDB: is now probably corrupt."
- " Please run CHECK TABLE on\n"
- "InnoDB: that table.\n", stderr);
+ Examples of a character (3-byte UTF-8 sequence)
+ identified with 2 or 4 characters (1-byte UTF-8 sequences):
- space = page_get_space_id(page);
- zip_size = buf_block_get_zip_size(block);
- page_no = page_get_page_no(page);
+ utf8_unicode_ci: 'II' = U+2171 SMALL ROMAN NUMERAL TWO
+ utf8_unicode_ci: '(10)' = U+247D PARENTHESIZED NUMBER TEN
+ */
- bitmap_page = ibuf_bitmap_get_map_page(
- space, page_no, zip_size, mtr);
- old_bits = ibuf_bitmap_page_get_bits(
- bitmap_page, page_no, zip_size,
- IBUF_BITMAP_FREE, mtr);
+ /* Delete the different-length record, and insert the
+ buffered one. */
- fprintf(stderr,
- "InnoDB: space %lu, page %lu,"
- " zip_size %lu, bitmap bits %lu\n",
- (ulong) space, (ulong) page_no,
- (ulong) zip_size, (ulong) old_bits);
+ lock_rec_store_on_page_infimum(block, rec);
+ page_cur_delete_rec(&page_cur, index, offsets, mtr);
+ page_cur_move_to_prev(&page_cur);
+ mem_heap_free(heap);
- fputs("InnoDB: Submit a detailed bug report"
- " to http://bugs.mysql.com\n", stderr);
- }
+ ibuf_insert_to_index_page_low(entry, block, index, mtr,
+ &page_cur);
+ lock_rec_restore_from_page_infimum(block, rec, block);
+ } else {
+ ibuf_insert_to_index_page_low(entry, block, index, mtr,
+ &page_cur);
}
}
@@ -3900,7 +4100,7 @@ ibuf_set_del_mark(
page_cur_t page_cur;
ulint low_match;
- ut_ad(ibuf_inside());
+ ut_ad(ibuf_inside(mtr));
ut_ad(dtuple_check_typed(entry));
low_match = page_cur_search(
@@ -3913,9 +4113,32 @@ ibuf_set_del_mark(
rec = page_cur_get_rec(&page_cur);
page_zip = page_cur_get_page_zip(&page_cur);
- btr_cur_set_deleted_flag_for_ibuf(rec, page_zip, TRUE, mtr);
+ /* Delete mark the old index record. According to a
+ comment in row_upd_sec_index_entry(), it can already
+ have been delete marked if a lock wait occurred in
+ row_ins_index_entry() in a previous invocation of
+ row_upd_sec_index_entry(). */
+
+ if (UNIV_LIKELY
+ (!rec_get_deleted_flag(
+ rec, dict_table_is_comp(index->table)))) {
+ btr_cur_set_deleted_flag_for_ibuf(rec, page_zip,
+ TRUE, mtr);
+ }
} else {
- /* This can happen benignly in some situations. */
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: unable to find a record to delete-mark\n",
+ stderr);
+ fputs("InnoDB: tuple ", stderr);
+ dtuple_print(stderr, entry);
+ fputs("\n"
+ "InnoDB: record ", stderr);
+ rec_print(stderr, page_cur_get_rec(&page_cur), index);
+ putc('\n', stderr);
+ fputs("\n"
+ "InnoDB: Submit a detailed bug report"
+ " to http://bugs.mysql.com\n", stderr);
+ ut_ad(0);
}
}
@@ -3934,7 +4157,7 @@ ibuf_delete(
page_cur_t page_cur;
ulint low_match;
- ut_ad(ibuf_inside());
+ ut_ad(ibuf_inside(mtr));
ut_ad(dtuple_check_typed(entry));
low_match = page_cur_search(
@@ -3990,10 +4213,7 @@ ibuf_delete(
mem_heap_free(heap);
}
} else {
- /* This can happen benignly in some situations: either when
- we crashed at just the right time, or on database startup
- when we redo some old log entries (due to worse stored
- position granularity on disk than in memory). */
+ /* The record must have been purged already. */
}
}
@@ -4025,7 +4245,7 @@ ibuf_restore_pos(
/* The tablespace has been dropped. It is possible
that another thread has deleted the insert buffer
entry. Do not complain. */
- btr_pcur_commit_specify_mtr(pcur, mtr);
+ ibuf_btr_pcur_commit_specify_mtr(pcur, mtr);
} else {
fprintf(stderr,
"InnoDB: ERROR: Submit the output to"
@@ -4043,7 +4263,7 @@ ibuf_restore_pos(
page_rec_get_next(btr_pcur_get_rec(pcur)));
fflush(stderr);
- btr_pcur_commit_specify_mtr(pcur, mtr);
+ ibuf_btr_pcur_commit_specify_mtr(pcur, mtr);
fputs("InnoDB: Validating insert buffer tree:\n", stderr);
if (!btr_validate_index(ibuf->index, NULL)) {
@@ -4067,8 +4287,8 @@ ibool
ibuf_delete_rec(
/*============*/
ulint space, /*!< in: space id */
- ulint page_no,/*!< in: index page number where the record
- should belong */
+ ulint page_no,/*!< in: index page number that the record
+ should belong to */
btr_pcur_t* pcur, /*!< in: pcur positioned on the record to
delete, having latch mode BTR_MODIFY_LEAF */
const dtuple_t* search_tuple,
@@ -4079,10 +4299,10 @@ ibuf_delete_rec(
page_t* root;
ulint err;
- ut_ad(ibuf_inside());
+ ut_ad(ibuf_inside(mtr));
ut_ad(page_rec_is_user_rec(btr_pcur_get_rec(pcur)));
- ut_ad(ibuf_rec_get_page_no(btr_pcur_get_rec(pcur)) == page_no);
- ut_ad(ibuf_rec_get_space(btr_pcur_get_rec(pcur)) == space);
+ ut_ad(ibuf_rec_get_page_no(mtr, btr_pcur_get_rec(pcur)) == page_no);
+ ut_ad(ibuf_rec_get_space(mtr, btr_pcur_get_rec(pcur)) == space);
success = btr_cur_optimistic_delete(btr_pcur_get_btr_cur(pcur), mtr);
@@ -4115,22 +4335,22 @@ ibuf_delete_rec(
}
ut_ad(page_rec_is_user_rec(btr_pcur_get_rec(pcur)));
- ut_ad(ibuf_rec_get_page_no(btr_pcur_get_rec(pcur)) == page_no);
- ut_ad(ibuf_rec_get_space(btr_pcur_get_rec(pcur)) == space);
+ ut_ad(ibuf_rec_get_page_no(mtr, btr_pcur_get_rec(pcur)) == page_no);
+ ut_ad(ibuf_rec_get_space(mtr, btr_pcur_get_rec(pcur)) == space);
/* We have to resort to a pessimistic delete from ibuf */
btr_pcur_store_position(pcur, mtr);
+ ibuf_btr_pcur_commit_specify_mtr(pcur, mtr);
- btr_pcur_commit_specify_mtr(pcur, mtr);
-
+ ibuf_mtr_start(mtr);
mutex_enter(&ibuf_mutex);
- mtr_start(mtr);
-
if (!ibuf_restore_pos(space, page_no, search_tuple,
BTR_MODIFY_TREE, pcur, mtr)) {
mutex_exit(&ibuf_mutex);
+ ut_ad(!ibuf_inside(mtr));
+ ut_ad(mtr->state == MTR_COMMITTED);
goto func_exit;
}
@@ -4147,9 +4367,11 @@ ibuf_delete_rec(
mutex_exit(&ibuf_mutex);
ibuf->empty = (page_get_n_recs(root) == 0);
- btr_pcur_commit_specify_mtr(pcur, mtr);
+ ibuf_btr_pcur_commit_specify_mtr(pcur, mtr);
func_exit:
+ ut_ad(!ibuf_inside(mtr));
+ ut_ad(mtr->state == MTR_COMMITTED);
btr_pcur_close(pcur);
return(TRUE);
@@ -4241,18 +4463,20 @@ ibuf_merge_or_delete_for_page(
update_ibuf_bitmap = FALSE;
} else {
page_t* bitmap_page;
+ ulint bitmap_bits;
- mtr_start(&mtr);
+ ibuf_mtr_start(&mtr);
bitmap_page = ibuf_bitmap_get_map_page(
space, page_no, zip_size, &mtr);
+ bitmap_bits = ibuf_bitmap_page_get_bits(
+ bitmap_page, page_no, zip_size,
+ IBUF_BITMAP_BUFFERED, &mtr);
+
+ ibuf_mtr_commit(&mtr);
- if (!ibuf_bitmap_page_get_bits(bitmap_page, page_no,
- zip_size,
- IBUF_BITMAP_BUFFERED,
- &mtr)) {
+ if (!bitmap_bits) {
/* No inserts buffered for this page */
- mtr_commit(&mtr);
if (!tablespace_being_deleted) {
fil_decr_pending_ibuf_merges(space);
@@ -4260,7 +4484,6 @@ ibuf_merge_or_delete_for_page(
return;
}
- mtr_commit(&mtr);
}
} else if (block
&& (ibuf_fixed_addr_page(space, zip_size, page_no)
@@ -4269,11 +4492,9 @@ ibuf_merge_or_delete_for_page(
return;
}
- ibuf_enter();
-
heap = mem_heap_create(512);
- if (!trx_sys_multiple_tablespace_format) {
+ if (UNIV_UNLIKELY(!trx_sys_multiple_tablespace_format)) {
ut_a(trx_doublewrite_must_reset_space_ids);
search_tuple = ibuf_search_tuple_build(space, page_no, heap);
} else {
@@ -4300,7 +4521,7 @@ ibuf_merge_or_delete_for_page(
ut_print_timestamp(stderr);
- mtr_start(&mtr);
+ ibuf_mtr_start(&mtr);
fputs(" InnoDB: Dump of the ibuf bitmap page:\n",
stderr);
@@ -4308,8 +4529,7 @@ ibuf_merge_or_delete_for_page(
bitmap_page = ibuf_bitmap_get_map_page(space, page_no,
zip_size, &mtr);
buf_page_print(bitmap_page, 0);
-
- mtr_commit(&mtr);
+ ibuf_mtr_commit(&mtr);
fputs("\nInnoDB: Dump of the page:\n", stderr);
@@ -4340,7 +4560,7 @@ ibuf_merge_or_delete_for_page(
memset(dops, 0, sizeof(dops));
loop:
- mtr_start(&mtr);
+ ibuf_mtr_start(&mtr);
if (block) {
ibool success;
@@ -4374,8 +4594,8 @@ loop:
rec = btr_pcur_get_rec(&pcur);
/* Check if the entry is for this index page */
- if (ibuf_rec_get_page_no(rec) != page_no
- || ibuf_rec_get_space(rec) != space) {
+ if (ibuf_rec_get_page_no(&mtr, rec) != page_no
+ || ibuf_rec_get_space(&mtr, rec) != space) {
if (block) {
page_header_reset_last_insert(
@@ -4398,7 +4618,7 @@ loop:
dtuple_t* entry;
trx_id_t max_trx_id;
dict_index_t* dummy_index;
- ibuf_op_t op = ibuf_rec_get_op_type(rec);
+ ibuf_op_t op = ibuf_rec_get_op_type(&mtr, rec);
max_trx_id = page_get_max_trx_id(page_align(rec));
page_update_max_trx_id(block, page_zip, max_trx_id,
@@ -4407,7 +4627,7 @@ loop:
ut_ad(page_validate(page_align(rec), ibuf->index));
entry = ibuf_build_entry_from_ibuf_rec(
- rec, heap, &dummy_index);
+ &mtr, rec, heap, &dummy_index);
ut_ad(page_validate(block->frame, dummy_index));
@@ -4440,13 +4660,14 @@ loop:
Store and restore the cursor position. */
ut_ad(rec == btr_pcur_get_rec(&pcur));
ut_ad(page_rec_is_user_rec(rec));
- ut_ad(ibuf_rec_get_page_no(rec) == page_no);
- ut_ad(ibuf_rec_get_space(rec) == space);
+ ut_ad(ibuf_rec_get_page_no(&mtr, rec)
+ == page_no);
+ ut_ad(ibuf_rec_get_space(&mtr, rec) == space);
btr_pcur_store_position(&pcur, &mtr);
- btr_pcur_commit_specify_mtr(&pcur, &mtr);
+ ibuf_btr_pcur_commit_specify_mtr(&pcur, &mtr);
- mtr_start(&mtr);
+ ibuf_mtr_start(&mtr);
success = buf_page_get_known_nowait(
RW_X_LATCH, block,
@@ -4461,7 +4682,8 @@ loop:
BTR_MODIFY_LEAF,
&pcur, &mtr)) {
- mtr_commit(&mtr);
+ ut_ad(!ibuf_inside(&mtr));
+ ut_ad(mtr.state == MTR_COMMITTED);
mops[op]++;
ibuf_dummy_index_free(dummy_index);
goto loop;
@@ -4476,7 +4698,7 @@ loop:
ibuf_dummy_index_free(dummy_index);
} else {
- dops[ibuf_rec_get_op_type(rec)]++;
+ dops[ibuf_rec_get_op_type(&mtr, rec)]++;
}
/* Delete the record from ibuf */
@@ -4487,7 +4709,7 @@ loop:
goto loop;
} else if (btr_pcur_is_after_last_on_page(&pcur)) {
- mtr_commit(&mtr);
+ ibuf_mtr_commit(&mtr);
btr_pcur_close(&pcur);
goto loop;
@@ -4521,7 +4743,7 @@ reset_bit:
}
}
- mtr_commit(&mtr);
+ ibuf_mtr_commit(&mtr);
btr_pcur_close(&pcur);
mem_heap_free(heap);
@@ -4545,8 +4767,6 @@ reset_bit:
fil_decr_pending_ibuf_merges(space);
}
- ibuf_exit();
-
#ifdef UNIV_IBUF_COUNT_DEBUG
ut_a(ibuf_count_get(space, page_no) == 0);
#endif
@@ -4566,9 +4786,8 @@ ibuf_delete_for_discarded_space(
mem_heap_t* heap;
btr_pcur_t pcur;
dtuple_t* search_tuple;
- rec_t* ibuf_rec;
+ const rec_t* ibuf_rec;
ulint page_no;
- ibool closed;
mtr_t mtr;
/* Counts for discarded operations. */
@@ -4583,9 +4802,7 @@ ibuf_delete_for_discarded_space(
memset(dops, 0, sizeof(dops));
loop:
- ibuf_enter();
-
- mtr_start(&mtr);
+ ibuf_mtr_start(&mtr);
/* Position pcur in the insert buffer at the first entry for the
space */
@@ -4605,39 +4822,34 @@ loop:
ibuf_rec = btr_pcur_get_rec(&pcur);
/* Check if the entry is for this space */
- if (ibuf_rec_get_space(ibuf_rec) != space) {
+ if (ibuf_rec_get_space(&mtr, ibuf_rec) != space) {
goto leave_loop;
}
- page_no = ibuf_rec_get_page_no(ibuf_rec);
+ page_no = ibuf_rec_get_page_no(&mtr, ibuf_rec);
- dops[ibuf_rec_get_op_type(ibuf_rec)]++;
+ dops[ibuf_rec_get_op_type(&mtr, ibuf_rec)]++;
/* Delete the record from ibuf */
- closed = ibuf_delete_rec(space, page_no, &pcur, search_tuple,
- &mtr);
- if (closed) {
+ if (ibuf_delete_rec(space, page_no, &pcur, search_tuple,
+ &mtr)) {
/* Deletion was pessimistic and mtr was committed:
we start from the beginning again */
- ibuf_exit();
-
goto loop;
}
if (btr_pcur_is_after_last_on_page(&pcur)) {
- mtr_commit(&mtr);
+ ibuf_mtr_commit(&mtr);
btr_pcur_close(&pcur);
- ibuf_exit();
-
goto loop;
}
}
leave_loop:
- mtr_commit(&mtr);
+ ibuf_mtr_commit(&mtr);
btr_pcur_close(&pcur);
#ifdef HAVE_ATOMIC_BUILTINS
@@ -4649,8 +4861,6 @@ leave_loop:
mutex_exit(&ibuf_mutex);
#endif /* HAVE_ATOMIC_BUILTINS */
- ibuf_exit();
-
mem_heap_free(heap);
}
@@ -4666,18 +4876,15 @@ ibuf_is_empty(void)
const page_t* root;
mtr_t mtr;
- ibuf_enter();
- mtr_start(&mtr);
+ ibuf_mtr_start(&mtr);
mutex_enter(&ibuf_mutex);
root = ibuf_tree_root_get(&mtr);
mutex_exit(&ibuf_mutex);
is_empty = (page_get_n_recs(root) == 0);
- mtr_commit(&mtr);
- ibuf_exit();
-
ut_a(is_empty == ibuf->empty);
+ ibuf_mtr_commit(&mtr);
return(is_empty);
}
diff --git a/storage/innobase/include/btr0btr.h b/storage/innobase/include/btr0btr.h
index 3912f315f2a..5b3e166371d 100644
--- a/storage/innobase/include/btr0btr.h
+++ b/storage/innobase/include/btr0btr.h
@@ -92,6 +92,91 @@ insert/delete buffer when the record is not in the buffer pool. */
buffer when the record is not in the buffer pool. */
#define BTR_DELETE 8192
+#ifdef UNIV_BLOB_DEBUG
+# include "ut0rbt.h"
+/** An index->blobs entry for keeping track of off-page column references */
+struct btr_blob_dbg_struct
+{
+ unsigned blob_page_no:32; /*!< first BLOB page number */
+ unsigned ref_page_no:32; /*!< referring page number */
+ unsigned ref_heap_no:16; /*!< referring heap number */
+ unsigned ref_field_no:10; /*!< referring field number */
+ unsigned owner:1; /*!< TRUE if BLOB owner */
+ unsigned always_owner:1; /*!< TRUE if always
+ has been the BLOB owner;
+ reset to TRUE on B-tree
+ page splits and merges */
+ unsigned del:1; /*!< TRUE if currently
+ delete-marked */
+};
+
+/**************************************************************//**
+Add a reference to an off-page column to the index->blobs map. */
+UNIV_INTERN
+void
+btr_blob_dbg_add_blob(
+/*==================*/
+ const rec_t* rec, /*!< in: clustered index record */
+ ulint field_no, /*!< in: number of off-page column */
+ ulint page_no, /*!< in: start page of the column */
+ dict_index_t* index, /*!< in/out: index tree */
+ const char* ctx) /*!< in: context (for logging) */
+ __attribute__((nonnull));
+/**************************************************************//**
+Display the references to off-page columns.
+This function is to be called from a debugger,
+for example when a breakpoint on ut_dbg_assertion_failed is hit. */
+UNIV_INTERN
+void
+btr_blob_dbg_print(
+/*===============*/
+ const dict_index_t* index) /*!< in: index tree */
+ __attribute__((nonnull));
+/**************************************************************//**
+Check that there are no references to off-page columns from or to
+the given page. Invoked when freeing or clearing a page.
+@return TRUE when no orphan references exist */
+UNIV_INTERN
+ibool
+btr_blob_dbg_is_empty(
+/*==================*/
+ dict_index_t* index, /*!< in: index */
+ ulint page_no) /*!< in: page number */
+ __attribute__((nonnull, warn_unused_result));
+
+/**************************************************************//**
+Modify the 'deleted' flag of a record. */
+UNIV_INTERN
+void
+btr_blob_dbg_set_deleted_flag(
+/*==========================*/
+ const rec_t* rec, /*!< in: record */
+ dict_index_t* index, /*!< in/out: index */
+ const ulint* offsets,/*!< in: rec_get_offs(rec, index) */
+ ibool del) /*!< in: TRUE=deleted, FALSE=exists */
+ __attribute__((nonnull));
+/**************************************************************//**
+Change the ownership of an off-page column. */
+UNIV_INTERN
+void
+btr_blob_dbg_owner(
+/*===============*/
+ const rec_t* rec, /*!< in: record */
+ dict_index_t* index, /*!< in/out: index */
+ const ulint* offsets,/*!< in: rec_get_offs(rec, index) */
+ ulint i, /*!< in: ith field in rec */
+ ibool own) /*!< in: TRUE=owned, FALSE=disowned */
+ __attribute__((nonnull));
+/** Assert that there are no BLOB references to or from the given page. */
+# define btr_blob_dbg_assert_empty(index, page_no) \
+ ut_a(btr_blob_dbg_is_empty(index, page_no))
+#else /* UNIV_BLOB_DEBUG */
+# define btr_blob_dbg_add_blob(rec, field_no, page, index, ctx) ((void) 0)
+# define btr_blob_dbg_set_deleted_flag(rec, index, offsets, del)((void) 0)
+# define btr_blob_dbg_owner(rec, index, offsets, i, val) ((void) 0)
+# define btr_blob_dbg_assert_empty(index, page_no) ((void) 0)
+#endif /* UNIV_BLOB_DEBUG */
+
/**************************************************************//**
Gets the root node of a tree and x-latches it.
@return root page, x-latched */
@@ -105,26 +190,35 @@ btr_root_get(
Gets a buffer page and declares its latching order level. */
UNIV_INLINE
buf_block_t*
-btr_block_get(
-/*==========*/
- ulint space, /*!< in: space id */
- ulint zip_size, /*!< in: compressed page size in bytes
- or 0 for uncompressed pages */
- ulint page_no, /*!< in: page number */
- ulint mode, /*!< in: latch mode */
- mtr_t* mtr); /*!< in: mtr */
-/**************************************************************//**
-Gets a buffer page and declares its latching order level. */
-UNIV_INLINE
-page_t*
-btr_page_get(
-/*=========*/
- ulint space, /*!< in: space id */
- ulint zip_size, /*!< in: compressed page size in bytes
- or 0 for uncompressed pages */
- ulint page_no, /*!< in: page number */
- ulint mode, /*!< in: latch mode */
- mtr_t* mtr); /*!< in: mtr */
+btr_block_get_func(
+/*===============*/
+ ulint space, /*!< in: space id */
+ ulint zip_size, /*!< in: compressed page size in bytes
+ or 0 for uncompressed pages */
+ ulint page_no, /*!< in: page number */
+ ulint mode, /*!< in: latch mode */
+ const char* file, /*!< in: file name */
+ ulint line, /*!< in: line where called */
+ mtr_t* mtr) /*!< in/out: mtr */
+ __attribute__((nonnull));
+/** Gets a buffer page and declares its latching order level.
+@param space tablespace identifier
+@param zip_size compressed page size in bytes or 0 for uncompressed pages
+@param page_no page number
+@param mode latch mode
+@param mtr mini-transaction handle
+@return the block descriptor */
+# define btr_block_get(space,zip_size,page_no,mode,mtr) \
+ btr_block_get_func(space,zip_size,page_no,mode,__FILE__,__LINE__,mtr)
+/** Gets a buffer page and declares its latching order level.
+@param space tablespace identifier
+@param zip_size compressed page size in bytes or 0 for uncompressed pages
+@param page_no page number
+@param mode latch mode
+@param mtr mini-transaction handle
+@return the uncompressed page frame */
+# define btr_page_get(space,zip_size,page_no,mode,mtr) \
+ buf_block_get_frame(btr_block_get(space,zip_size,page_no,mode,mtr))
#endif /* !UNIV_HOTBACKUP */
/**************************************************************//**
Gets the index id field of a page.
diff --git a/storage/innobase/include/btr0btr.ic b/storage/innobase/include/btr0btr.ic
index 6c580a0bd6e..ccf41904fd0 100644
--- a/storage/innobase/include/btr0btr.ic
+++ b/storage/innobase/include/btr0btr.ic
@@ -39,18 +39,21 @@ Created 6/2/1994 Heikki Tuuri
Gets a buffer page and declares its latching order level. */
UNIV_INLINE
buf_block_t*
-btr_block_get(
-/*==========*/
- ulint space, /*!< in: space id */
- ulint zip_size, /*!< in: compressed page size in bytes
- or 0 for uncompressed pages */
- ulint page_no, /*!< in: page number */
- ulint mode, /*!< in: latch mode */
- mtr_t* mtr) /*!< in: mtr */
+btr_block_get_func(
+/*===============*/
+ ulint space, /*!< in: space id */
+ ulint zip_size, /*!< in: compressed page size in bytes
+ or 0 for uncompressed pages */
+ ulint page_no, /*!< in: page number */
+ ulint mode, /*!< in: latch mode */
+ const char* file, /*!< in: file name */
+ ulint line, /*!< in: line where called */
+ mtr_t* mtr) /*!< in/out: mtr */
{
buf_block_t* block;
- block = buf_page_get(space, zip_size, page_no, mode, mtr);
+ block = buf_page_get_gen(space, zip_size, page_no, mode,
+ NULL, BUF_GET, file, line, mtr);
if (mode != RW_NO_LATCH) {
@@ -61,23 +64,6 @@ btr_block_get(
}
/**************************************************************//**
-Gets a buffer page and declares its latching order level. */
-UNIV_INLINE
-page_t*
-btr_page_get(
-/*=========*/
- ulint space, /*!< in: space id */
- ulint zip_size, /*!< in: compressed page size in bytes
- or 0 for uncompressed pages */
- ulint page_no, /*!< in: page number */
- ulint mode, /*!< in: latch mode */
- mtr_t* mtr) /*!< in: mtr */
-{
- return(buf_block_get_frame(btr_block_get(space, zip_size, page_no,
- mode, mtr)));
-}
-
-/**************************************************************//**
Sets the index id field of a page. */
UNIV_INLINE
void
diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h
index 16a557850a3..be918439f59 100644
--- a/storage/innobase/include/btr0cur.h
+++ b/storage/innobase/include/btr0cur.h
@@ -243,6 +243,22 @@ btr_cur_pessimistic_insert(
que_thr_t* thr, /*!< in: query thread or NULL */
mtr_t* mtr); /*!< in: mtr */
/*************************************************************//**
+See if there is enough place in the page modification log to log
+an update-in-place.
+@return TRUE if enough place */
+UNIV_INTERN
+ibool
+btr_cur_update_alloc_zip(
+/*=====================*/
+ page_zip_des_t* page_zip,/*!< in/out: compressed page */
+ buf_block_t* block, /*!< in/out: buffer page */
+ dict_index_t* index, /*!< in: the index corresponding to the block */
+ ulint length, /*!< in: size needed */
+ ibool create, /*!< in: TRUE=delete-and-insert,
+ FALSE=update-in-place */
+ mtr_t* mtr) /*!< in: mini-transaction */
+ __attribute__((nonnull, warn_unused_result));
+/*************************************************************//**
Updates a record when the update causes no size changes in its fields.
@return DB_SUCCESS or error number */
UNIV_INTERN
@@ -317,10 +333,14 @@ ulint
btr_cur_del_mark_set_clust_rec(
/*===========================*/
ulint flags, /*!< in: undo logging and locking flags */
- btr_cur_t* cursor, /*!< in: cursor */
+ buf_block_t* block, /*!< in/out: buffer block of the record */
+ rec_t* rec, /*!< in/out: record */
+ dict_index_t* index, /*!< in: clustered index of the record */
+ const ulint* offsets,/*!< in: rec_get_offsets(rec) */
ibool val, /*!< in: value to set */
que_thr_t* thr, /*!< in: query thread */
- mtr_t* mtr); /*!< in: mtr */
+ mtr_t* mtr) /*!< in: mtr */
+ __attribute__((nonnull));
/***********************************************************//**
Sets a secondary index record delete mark to TRUE or FALSE.
@return DB_SUCCESS, DB_LOCK_WAIT, or error number */
@@ -446,57 +466,42 @@ btr_estimate_n_rows_in_range(
/*******************************************************************//**
Estimates the number of different key values in a given index, for
each n-column prefix of the index where n <= dict_index_get_n_unique(index).
-The estimates are stored in the array index->stat_n_diff_key_vals. */
+The estimates are stored in the array index->stat_n_diff_key_vals.
+If innodb_stats_method is nulls_ignored, we also record the number of
+non-null values for each prefix and stored the estimates in
+array index->stat_n_non_null_key_vals. */
UNIV_INTERN
void
btr_estimate_number_of_different_key_vals(
/*======================================*/
dict_index_t* index); /*!< in: index */
/*******************************************************************//**
-Marks not updated extern fields as not-owned by this record. The ownership
-is transferred to the updated record which is inserted elsewhere in the
+Marks non-updated off-page fields as disowned by this record. The ownership
+must be transferred to the updated record which is inserted elsewhere in the
index tree. In purge only the owner of externally stored field is allowed
-to free the field.
-@return TRUE if BLOB ownership was transferred */
+to free the field. */
UNIV_INTERN
-ibool
-btr_cur_mark_extern_inherited_fields(
-/*=================================*/
+void
+btr_cur_disown_inherited_fields(
+/*============================*/
page_zip_des_t* page_zip,/*!< in/out: compressed page whose uncompressed
part will be updated, or NULL */
rec_t* rec, /*!< in/out: record in a clustered index */
dict_index_t* index, /*!< in: index of the page */
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
const upd_t* update, /*!< in: update vector */
- mtr_t* mtr); /*!< in: mtr, or NULL if not logged */
-/*******************************************************************//**
-The complement of the previous function: in an update entry may inherit
-some externally stored fields from a record. We must mark them as inherited
-in entry, so that they are not freed in a rollback. */
-UNIV_INTERN
-void
-btr_cur_mark_dtuple_inherited_extern(
-/*=================================*/
- dtuple_t* entry, /*!< in/out: updated entry to be
- inserted to clustered index */
- const upd_t* update); /*!< in: update vector */
-/*******************************************************************//**
-Marks all extern fields in a dtuple as owned by the record. */
-UNIV_INTERN
-void
-btr_cur_unmark_dtuple_extern_fields(
-/*================================*/
- dtuple_t* entry); /*!< in/out: clustered index entry */
+ mtr_t* mtr) /*!< in/out: mini-transaction */
+ __attribute__((nonnull(2,3,4,5,6)));
/*******************************************************************//**
Stores the fields in big_rec_vec to the tablespace and puts pointers to
them in rec. The extern flags in rec will have to be set beforehand.
The fields are stored on pages allocated from leaf node
file segment of the index tree.
-@return DB_SUCCESS or error */
+@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
UNIV_INTERN
ulint
-btr_store_big_rec_extern_fields(
-/*============================*/
+btr_store_big_rec_extern_fields_func(
+/*=================================*/
dict_index_t* index, /*!< in: index of rec; the index tree
MUST be X-latched */
buf_block_t* rec_block, /*!< in/out: block containing rec */
@@ -505,10 +510,42 @@ btr_store_big_rec_extern_fields(
the "external storage" flags in offsets
will not correspond to rec when
this function returns */
- big_rec_t* big_rec_vec, /*!< in: vector containing fields
+#ifdef UNIV_DEBUG
+ mtr_t* local_mtr, /*!< in: mtr containing the
+ latch to rec and to the tree */
+#endif /* UNIV_DEBUG */
+#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
+ ibool update_in_place,/*! in: TRUE if the record is updated
+ in place (not delete+insert) */
+#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
+ const big_rec_t*big_rec_vec) /*!< in: vector containing fields
to be stored externally */
- mtr_t* local_mtr); /*!< in: mtr containing the latch to
- rec and to the tree */
+ __attribute__((nonnull));
+
+/** Stores the fields in big_rec_vec to the tablespace and puts pointers to
+them in rec. The extern flags in rec will have to be set beforehand.
+The fields are stored on pages allocated from leaf node
+file segment of the index tree.
+@param index in: clustered index; MUST be X-latched by mtr
+@param b in/out: block containing rec; MUST be X-latched by mtr
+@param rec in/out: clustered index record
+@param offsets in: rec_get_offsets(rec, index);
+ the "external storage" flags in offsets will not be adjusted
+@param mtr in: mini-transaction that holds x-latch on index and b
+@param upd in: TRUE if the record is updated in place (not delete+insert)
+@param big in: vector containing fields to be stored externally
+@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
+#ifdef UNIV_DEBUG
+# define btr_store_big_rec_extern_fields(index,b,rec,offsets,mtr,upd,big) \
+ btr_store_big_rec_extern_fields_func(index,b,rec,offsets,mtr,upd,big)
+#elif defined UNIV_BLOB_LIGHT_DEBUG
+# define btr_store_big_rec_extern_fields(index,b,rec,offsets,mtr,upd,big) \
+ btr_store_big_rec_extern_fields_func(index,b,rec,offsets,upd,big)
+#else
+# define btr_store_big_rec_extern_fields(index,b,rec,offsets,mtr,upd,big) \
+ btr_store_big_rec_extern_fields_func(index,b,rec,offsets,big)
+#endif
+
/*******************************************************************//**
Frees the space in an externally stored field to the file space
management if the field in data is owned the externally stored field,
diff --git a/storage/innobase/include/btr0pcur.h b/storage/innobase/include/btr0pcur.h
index 2334a266280..6c11c973fc9 100644
--- a/storage/innobase/include/btr0pcur.h
+++ b/storage/innobase/include/btr0pcur.h
@@ -150,7 +150,7 @@ UNIV_INLINE
ulint
btr_pcur_get_up_match(
/*==================*/
- btr_pcur_t* cursor); /*!< in: memory buffer for persistent cursor */
+ const btr_pcur_t* cursor); /*!< in: persistent cursor */
/**************************************************************//**
Gets the low_match value for a pcur after a search.
@return number of matched fields at the cursor or to the right if
@@ -159,7 +159,7 @@ UNIV_INLINE
ulint
btr_pcur_get_low_match(
/*===================*/
- btr_pcur_t* cursor); /*!< in: memory buffer for persistent cursor */
+ const btr_pcur_t* cursor); /*!< in: persistent cursor */
/**************************************************************//**
If mode is PAGE_CUR_G or PAGE_CUR_GE, opens a persistent cursor on the first
user record satisfying the search condition, in the case PAGE_CUR_L or
@@ -264,22 +264,6 @@ ulint
btr_pcur_get_rel_pos(
/*=================*/
const btr_pcur_t* cursor);/*!< in: persistent cursor */
-/*********************************************************//**
-Sets the mtr field for a pcur. */
-UNIV_INLINE
-void
-btr_pcur_set_mtr(
-/*=============*/
- btr_pcur_t* cursor, /*!< in: persistent cursor */
- mtr_t* mtr); /*!< in, own: mtr */
-/*********************************************************//**
-Gets the mtr field for a pcur.
-@return mtr */
-UNIV_INLINE
-mtr_t*
-btr_pcur_get_mtr(
-/*=============*/
- btr_pcur_t* cursor); /*!< in: persistent cursor */
/**************************************************************//**
Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES,
that is, the cursor becomes detached. If there have been modifications
@@ -387,10 +371,6 @@ page_cur_t*
btr_pcur_get_page_cur(
/*==================*/
const btr_pcur_t* cursor); /*!< in: persistent cursor */
-#else /* UNIV_DEBUG */
-# define btr_pcur_get_btr_cur(cursor) (&(cursor)->btr_cur)
-# define btr_pcur_get_page_cur(cursor) (&(cursor)->btr_cur.page_cur)
-#endif /* UNIV_DEBUG */
/*********************************************************//**
Returns the page of a persistent cursor.
@return pointer to the page */
@@ -398,7 +378,7 @@ UNIV_INLINE
page_t*
btr_pcur_get_page(
/*==============*/
- btr_pcur_t* cursor);/*!< in: persistent cursor */
+ const btr_pcur_t* cursor);/*!< in: persistent cursor */
/*********************************************************//**
Returns the buffer block of a persistent cursor.
@return pointer to the block */
@@ -406,7 +386,7 @@ UNIV_INLINE
buf_block_t*
btr_pcur_get_block(
/*===============*/
- btr_pcur_t* cursor);/*!< in: persistent cursor */
+ const btr_pcur_t* cursor);/*!< in: persistent cursor */
/*********************************************************//**
Returns the record of a persistent cursor.
@return pointer to the record */
@@ -414,7 +394,14 @@ UNIV_INLINE
rec_t*
btr_pcur_get_rec(
/*=============*/
- btr_pcur_t* cursor);/*!< in: persistent cursor */
+ const btr_pcur_t* cursor);/*!< in: persistent cursor */
+#else /* UNIV_DEBUG */
+# define btr_pcur_get_btr_cur(cursor) (&(cursor)->btr_cur)
+# define btr_pcur_get_page_cur(cursor) (&(cursor)->btr_cur.page_cur)
+# define btr_pcur_get_page(cursor) ((cursor)->btr_cur.page_cur.block->frame)
+# define btr_pcur_get_block(cursor) ((cursor)->btr_cur.page_cur.block)
+# define btr_pcur_get_rec(cursor) ((cursor)->btr_cur.page_cur.rec)
+#endif /* UNIV_DEBUG */
/*********************************************************//**
Checks if the persistent cursor is on a user record. */
UNIV_INLINE
@@ -517,9 +504,6 @@ struct btr_pcur_struct{
/* NOTE that the following fields may possess dynamically allocated
memory which should be freed if not needed anymore! */
- mtr_t* mtr; /*!< NULL, or this field may contain
- a mini-transaction which holds the
- latch on the cursor page */
byte* old_rec_buf; /*!< NULL, or a dynamically allocated
buffer for old_rec */
ulint buf_size; /*!< old_rec_buf size if old_rec_buf
diff --git a/storage/innobase/include/btr0pcur.ic b/storage/innobase/include/btr0pcur.ic
index 0c38797e6c5..59fdb21824b 100644
--- a/storage/innobase/include/btr0pcur.ic
+++ b/storage/innobase/include/btr0pcur.ic
@@ -42,34 +42,6 @@ btr_pcur_get_rel_pos(
return(cursor->rel_pos);
}
-/*********************************************************//**
-Sets the mtr field for a pcur. */
-UNIV_INLINE
-void
-btr_pcur_set_mtr(
-/*=============*/
- btr_pcur_t* cursor, /*!< in: persistent cursor */
- mtr_t* mtr) /*!< in, own: mtr */
-{
- ut_ad(cursor);
-
- cursor->mtr = mtr;
-}
-
-/*********************************************************//**
-Gets the mtr field for a pcur.
-@return mtr */
-UNIV_INLINE
-mtr_t*
-btr_pcur_get_mtr(
-/*=============*/
- btr_pcur_t* cursor) /*!< in: persistent cursor */
-{
- ut_ad(cursor);
-
- return(cursor->mtr);
-}
-
#ifdef UNIV_DEBUG
/*********************************************************//**
Returns the btr cursor component of a persistent cursor.
@@ -95,7 +67,7 @@ btr_pcur_get_page_cur(
{
return(btr_cur_get_page_cur(btr_pcur_get_btr_cur(cursor)));
}
-#endif /* UNIV_DEBUG */
+
/*********************************************************//**
Returns the page of a persistent cursor.
@return pointer to the page */
@@ -103,7 +75,7 @@ UNIV_INLINE
page_t*
btr_pcur_get_page(
/*==============*/
- btr_pcur_t* cursor) /*!< in: persistent cursor */
+ const btr_pcur_t* cursor) /*!< in: persistent cursor */
{
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
@@ -117,7 +89,7 @@ UNIV_INLINE
buf_block_t*
btr_pcur_get_block(
/*===============*/
- btr_pcur_t* cursor) /*!< in: persistent cursor */
+ const btr_pcur_t* cursor) /*!< in: persistent cursor */
{
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
@@ -131,13 +103,14 @@ UNIV_INLINE
rec_t*
btr_pcur_get_rec(
/*=============*/
- btr_pcur_t* cursor) /*!< in: persistent cursor */
+ const btr_pcur_t* cursor) /*!< in: persistent cursor */
{
ut_ad(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
return(btr_cur_get_rec(btr_pcur_get_btr_cur(cursor)));
}
+#endif /* UNIV_DEBUG */
/**************************************************************//**
Gets the up_match value for a pcur after a search.
@@ -147,9 +120,9 @@ UNIV_INLINE
ulint
btr_pcur_get_up_match(
/*==================*/
- btr_pcur_t* cursor) /*!< in: memory buffer for persistent cursor */
+ const btr_pcur_t* cursor) /*!< in: persistent cursor */
{
- btr_cur_t* btr_cursor;
+ const btr_cur_t* btr_cursor;
ut_ad((cursor->pos_state == BTR_PCUR_WAS_POSITIONED)
|| (cursor->pos_state == BTR_PCUR_IS_POSITIONED));
@@ -169,9 +142,9 @@ UNIV_INLINE
ulint
btr_pcur_get_low_match(
/*===================*/
- btr_pcur_t* cursor) /*!< in: memory buffer for persistent cursor */
+ const btr_pcur_t* cursor) /*!< in: persistent cursor */
{
- btr_cur_t* btr_cursor;
+ const btr_cur_t* btr_cursor;
ut_ad((cursor->pos_state == BTR_PCUR_WAS_POSITIONED)
|| (cursor->pos_state == BTR_PCUR_IS_POSITIONED));
diff --git a/storage/innobase/include/btr0types.h b/storage/innobase/include/btr0types.h
index ef4a6b04b34..07c06fb18d7 100644
--- a/storage/innobase/include/btr0types.h
+++ b/storage/innobase/include/btr0types.h
@@ -38,6 +38,131 @@ typedef struct btr_cur_struct btr_cur_t;
/** B-tree search information for the adaptive hash index */
typedef struct btr_search_struct btr_search_t;
+#ifdef UNIV_BLOB_DEBUG
+# include "buf0types.h"
+/** An index->blobs entry for keeping track of off-page column references */
+typedef struct btr_blob_dbg_struct btr_blob_dbg_t;
+
+/** Insert to index->blobs a reference to an off-page column.
+@param index the index tree
+@param b the reference
+@param ctx context (for logging) */
+UNIV_INTERN
+void
+btr_blob_dbg_rbt_insert(
+/*====================*/
+ dict_index_t* index, /*!< in/out: index tree */
+ const btr_blob_dbg_t* b, /*!< in: the reference */
+ const char* ctx) /*!< in: context (for logging) */
+ __attribute__((nonnull));
+
+/** Remove from index->blobs a reference to an off-page column.
+@param index the index tree
+@param b the reference
+@param ctx context (for logging) */
+UNIV_INTERN
+void
+btr_blob_dbg_rbt_delete(
+/*====================*/
+ dict_index_t* index, /*!< in/out: index tree */
+ const btr_blob_dbg_t* b, /*!< in: the reference */
+ const char* ctx) /*!< in: context (for logging) */
+ __attribute__((nonnull));
+
+/**************************************************************//**
+Add to index->blobs any references to off-page columns from a record.
+@return number of references added */
+UNIV_INTERN
+ulint
+btr_blob_dbg_add_rec(
+/*=================*/
+ const rec_t* rec, /*!< in: record */
+ dict_index_t* index, /*!< in/out: index */
+ const ulint* offsets,/*!< in: offsets */
+ const char* ctx) /*!< in: context (for logging) */
+ __attribute__((nonnull));
+/**************************************************************//**
+Remove from index->blobs any references to off-page columns from a record.
+@return number of references removed */
+UNIV_INTERN
+ulint
+btr_blob_dbg_remove_rec(
+/*====================*/
+ const rec_t* rec, /*!< in: record */
+ dict_index_t* index, /*!< in/out: index */
+ const ulint* offsets,/*!< in: offsets */
+ const char* ctx) /*!< in: context (for logging) */
+ __attribute__((nonnull));
+/**************************************************************//**
+Count and add to index->blobs any references to off-page columns
+from records on a page.
+@return number of references added */
+UNIV_INTERN
+ulint
+btr_blob_dbg_add(
+/*=============*/
+ const page_t* page, /*!< in: rewritten page */
+ dict_index_t* index, /*!< in/out: index */
+ const char* ctx) /*!< in: context (for logging) */
+ __attribute__((nonnull));
+/**************************************************************//**
+Count and remove from index->blobs any references to off-page columns
+from records on a page.
+Used when reorganizing a page, before copying the records.
+@return number of references removed */
+UNIV_INTERN
+ulint
+btr_blob_dbg_remove(
+/*================*/
+ const page_t* page, /*!< in: b-tree page */
+ dict_index_t* index, /*!< in/out: index */
+ const char* ctx) /*!< in: context (for logging) */
+ __attribute__((nonnull));
+/**************************************************************//**
+Restore in index->blobs any references to off-page columns
+Used when page reorganize fails due to compressed page overflow. */
+UNIV_INTERN
+void
+btr_blob_dbg_restore(
+/*=================*/
+ const page_t* npage, /*!< in: page that failed to compress */
+ const page_t* page, /*!< in: copy of original page */
+ dict_index_t* index, /*!< in/out: index */
+ const char* ctx) /*!< in: context (for logging) */
+ __attribute__((nonnull));
+
+/** Operation that processes the BLOB references of an index record
+@param[in] rec record on index page
+@param[in/out] index the index tree of the record
+@param[in] offsets rec_get_offsets(rec,index)
+@param[in] ctx context (for logging)
+@return number of BLOB references processed */
+typedef ulint (*btr_blob_dbg_op_f)
+(const rec_t* rec,dict_index_t* index,const ulint* offsets,const char* ctx);
+
+/**************************************************************//**
+Count and process all references to off-page columns on a page.
+@return number of references processed */
+UNIV_INTERN
+ulint
+btr_blob_dbg_op(
+/*============*/
+ const page_t* page, /*!< in: B-tree leaf page */
+ const rec_t* rec, /*!< in: record to start from
+ (NULL to process the whole page) */
+ dict_index_t* index, /*!< in/out: index */
+ const char* ctx, /*!< in: context (for logging) */
+ const btr_blob_dbg_op_f op) /*!< in: operation on records */
+ __attribute__((nonnull(1,3,4,5)));
+#else /* UNIV_BLOB_DEBUG */
+# define btr_blob_dbg_add_rec(rec, index, offsets, ctx) ((void) 0)
+# define btr_blob_dbg_add(page, index, ctx) ((void) 0)
+# define btr_blob_dbg_remove_rec(rec, index, offsets, ctx) ((void) 0)
+# define btr_blob_dbg_remove(page, index, ctx) ((void) 0)
+# define btr_blob_dbg_restore(npage, page, index, ctx) ((void) 0)
+# define btr_blob_dbg_op(page, rec, index, ctx, op) ((void) 0)
+#endif /* UNIV_BLOB_DEBUG */
+
/** The size of a reference to data stored on a different page.
The reference is stored at the end of the prefix of the field
in the index record. */
diff --git a/storage/innobase/include/buf0buddy.h b/storage/innobase/include/buf0buddy.h
index 03588d18197..b255d8c9351 100644
--- a/storage/innobase/include/buf0buddy.h
+++ b/storage/innobase/include/buf0buddy.h
@@ -36,7 +36,7 @@ Created December 2006 by Marko Makela
/**********************************************************************//**
Allocate a block. The thread calling this function must hold
-buf_pool->mutex and must not hold buf_pool_zip_mutex or any
+buf_pool->mutex and must not hold buf_pool->zip_mutex or any
block->mutex. The buf_pool->mutex may only be released and reacquired
if lru != NULL. This function should only be used for allocating
compressed page frames or control blocks (buf_page_t). Allocated
diff --git a/storage/innobase/include/buf0buddy.ic b/storage/innobase/include/buf0buddy.ic
index 387eacc754a..e50c33ea15a 100644
--- a/storage/innobase/include/buf0buddy.ic
+++ b/storage/innobase/include/buf0buddy.ic
@@ -35,7 +35,7 @@ Created December 2006 by Marko Makela
/**********************************************************************//**
Allocate a block. The thread calling this function must hold
-buf_pool->mutex and must not hold buf_pool_zip_mutex or any block->mutex.
+buf_pool->mutex and must not hold buf_pool->zip_mutex or any block->mutex.
The buf_pool->mutex may only be released and reacquired if lru != NULL.
@return allocated block, possibly NULL if lru==NULL */
UNIV_INTERN
@@ -86,7 +86,7 @@ buf_buddy_get_slot(
/**********************************************************************//**
Allocate a block. The thread calling this function must hold
-buf_pool->mutex and must not hold buf_pool_zip_mutex or any
+buf_pool->mutex and must not hold buf_pool->zip_mutex or any
block->mutex. The buf_pool->mutex may only be released and reacquired
if lru != NULL. This function should only be used for allocating
compressed page frames or control blocks (buf_page_t). Allocated
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index f33ef65ddf2..d83d484bace 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -41,6 +41,8 @@ Created 11/5/1995 Heikki Tuuri
/* @{ */
#define BUF_GET 10 /*!< get always */
#define BUF_GET_IF_IN_POOL 11 /*!< get if in pool */
+#define BUF_PEEK_IF_IN_POOL 12 /*!< get if in pool, do not make
+ the block young in the LRU list */
#define BUF_GET_NO_LATCH 14 /*!< get and bufferfix, but
set no latch; we have
separated this case, because
@@ -51,6 +53,9 @@ Created 11/5/1995 Heikki Tuuri
/*!< Get the page only if it's in the
buffer pool, if not then set a watch
on the page. */
+#define BUF_GET_POSSIBLY_FREED 16
+ /*!< Like BUF_GET, but do not mind
+ if the file page has been freed. */
/* @} */
/** @name Modes for buf_page_get_known_nowait */
/* @{ */
@@ -69,7 +74,7 @@ Created 11/5/1995 Heikki Tuuri
#define BUF_POOL_WATCH_SIZE 1 /*!< Maximum number of concurrent
buffer pool watches */
-extern buf_pool_t* buf_pool_ptr[MAX_BUFFER_POOLS]; /*!< The buffer pools
+extern buf_pool_t* buf_pool_ptr; /*!< The buffer pools
of the database */
#ifdef UNIV_DEBUG
extern ibool buf_debug_prints;/*!< If this is set TRUE, the program
@@ -96,7 +101,7 @@ enum buf_page_state {
BUF_BLOCK_ZIP_FREE = 0, /*!< contains a free
compressed page */
BUF_BLOCK_POOL_WATCH = 0, /*!< a sentinel for the buffer pool
- watch, element of buf_pool_watch[] */
+ watch, element of buf_pool->watch[] */
BUF_BLOCK_ZIP_PAGE, /*!< contains a clean
compressed page */
BUF_BLOCK_ZIP_DIRTY, /*!< contains a compressed
@@ -116,6 +121,76 @@ enum buf_page_state {
before putting to the free list */
};
+
+/** This structure defines information we will fetch from each buffer pool. It
+will be used to print table IO stats */
+struct buf_pool_info_struct{
+ /* General buffer pool info */
+ ulint pool_unique_id; /*!< Buffer Pool ID */
+ ulint pool_size; /*!< Buffer Pool size in pages */
+ ulint lru_len; /*!< Length of buf_pool->LRU */
+ ulint old_lru_len; /*!< buf_pool->LRU_old_len */
+ ulint free_list_len; /*!< Length of buf_pool->free list */
+ ulint flush_list_len; /*!< Length of buf_pool->flush_list */
+ ulint n_pend_unzip; /*!< buf_pool->n_pend_unzip, pages
+ pending decompress */
+ ulint n_pend_reads; /*!< buf_pool->n_pend_reads, pages
+ pending read */
+ ulint n_pending_flush_lru; /*!< Pages pending flush in LRU */
+ ulint n_pending_flush_list; /*!< Pages pending flush in FLUSH
+ LIST */
+ ulint n_pending_flush_single_page;/*!< Pages pending flush in
+ BUF_FLUSH_SINGLE_PAGE list */
+ ulint n_pages_made_young; /*!< number of pages made young */
+ ulint n_pages_not_made_young; /*!< number of pages not made young */
+ ulint n_pages_read; /*!< buf_pool->n_pages_read */
+ ulint n_pages_created; /*!< buf_pool->n_pages_created */
+ ulint n_pages_written; /*!< buf_pool->n_pages_written */
+ ulint n_page_gets; /*!< buf_pool->n_page_gets */
+ ulint n_ra_pages_read; /*!< buf_pool->n_ra_pages_read, number
+ of pages readahead */
+ ulint n_ra_pages_evicted; /*!< buf_pool->n_ra_pages_evicted,
+ number of readahead pages evicted
+ without access */
+ ulint n_page_get_delta; /*!< num of buffer pool page gets since
+ last printout */
+
+ /* Buffer pool access stats */
+ double page_made_young_rate; /*!< page made young rate in pages
+ per second */
+ double page_not_made_young_rate;/*!< page not made young rate
+ in pages per second */
+ double pages_read_rate; /*!< num of pages read per second */
+ double pages_created_rate; /*!< num of pages create per second */
+ double pages_written_rate; /*!< num of pages written per second */
+ ulint page_read_delta; /*!< num of pages read since last
+ printout */
+ ulint young_making_delta; /*!< num of pages made young since
+ last printout */
+ ulint not_young_making_delta; /*!< num of pages not make young since
+ last printout */
+
+ /* Statistics about read ahead algorithm. */
+ double pages_readahead_rate; /*!< readahead rate in pages per
+ second */
+ double pages_evicted_rate; /*!< rate of readahead page evicted
+ without access, in pages per second */
+
+ /* Stats about LRU eviction */
+ ulint unzip_lru_len; /*!< length of buf_pool->unzip_LRU
+ list */
+ /* Counters for LRU policy */
+ ulint io_sum; /*!< buf_LRU_stat_sum.io */
+ ulint io_cur; /*!< buf_LRU_stat_cur.io, num of IO
+ for current interval */
+ ulint unzip_sum; /*!< buf_LRU_stat_sum.unzip */
+ ulint unzip_cur; /*!< buf_LRU_stat_cur.unzip, num
+ pages decompressed in current
+ interval */
+};
+
+typedef struct buf_pool_info_struct buf_pool_info_t;
+
#ifndef UNIV_HOTBACKUP
/********************************************************************//**
Acquire mutex on all buffer pool instances */
@@ -206,9 +281,9 @@ UNIV_INTERN
buf_block_t*
buf_block_alloc(
/*============*/
- buf_pool_t* buf_pool, /*!< buffer pool instance */
- ulint zip_size); /*!< in: compressed page size in bytes,
- or 0 if uncompressed tablespace */
+ buf_pool_t* buf_pool); /*!< in: buffer pool instance,
+ or NULL for round-robin selection
+ of the buffer pool */
/********************************************************************//**
Frees a buffer block which does not contain a file page. */
UNIV_INLINE
@@ -326,7 +401,7 @@ buf_page_get_gen(
ulint rw_latch,/*!< in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */
buf_block_t* guess, /*!< in: guessed block or NULL */
ulint mode, /*!< in: BUF_GET, BUF_GET_IF_IN_POOL,
- BUF_GET_NO_LATCH or
+ BUF_PEEK_IF_IN_POOL, BUF_GET_NO_LATCH or
BUF_GET_IF_IN_POOL_OR_WATCH */
const char* file, /*!< in: file name */
ulint line, /*!< in: line where called */
@@ -410,7 +485,7 @@ buf_reset_check_index_page_at_flush(
/*================================*/
ulint space, /*!< in: space id */
ulint offset);/*!< in: page number */
-#ifdef UNIV_DEBUG_FILE_ACCESSES
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
/********************************************************************//**
Sets file_page_was_freed TRUE if the page is found in the buffer pool.
This function should be called when we free a file page and want the
@@ -435,7 +510,7 @@ buf_page_reset_file_page_was_freed(
/*===============================*/
ulint space, /*!< in: space id */
ulint offset); /*!< in: page number */
-#endif /* UNIV_DEBUG_FILE_ACCESSES */
+#endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
/********************************************************************//**
Reads the freed_page_clock of a buffer block.
@return freed_page_clock */
@@ -1034,6 +1109,15 @@ buf_page_address_fold(
ulint space, /*!< in: space id */
ulint offset) /*!< in: offset of the page within space */
__attribute__((const));
+/********************************************************************//**
+Calculates the index of a buffer pool to the buf_pool[] array.
+@return the position of the buffer pool in buf_pool[] */
+UNIV_INLINE
+ulint
+buf_pool_index(
+/*===========*/
+ const buf_pool_t* buf_pool) /*!< in: buffer pool */
+ __attribute__((nonnull, const));
/******************************************************************//**
Returns the buffer pool instance given a page instance
@return buf_pool */
@@ -1065,8 +1149,9 @@ Returns the buffer pool instance given its array index
UNIV_INLINE
buf_pool_t*
buf_pool_from_array(
-/*====================*/
- ulint index); /*!< in: array index to get buffer pool instance from */
+/*================*/
+ ulint index); /*!< in: array index to get
+ buffer pool instance from */
/******************************************************************//**
Returns the control block of a file page, NULL if not found.
@return block, NULL if not found */
@@ -1204,16 +1289,21 @@ struct buf_page_struct{
unsigned io_fix:2; /*!< type of pending I/O operation;
also protected by buf_pool->mutex
@see enum buf_io_fix */
- unsigned buf_fix_count:25;/*!< count of how manyfold this block
+ unsigned buf_fix_count:19;/*!< count of how manyfold this block
is currently bufferfixed */
+ unsigned buf_pool_index:6;/*!< index number of the buffer pool
+ that this block belongs to */
+# if MAX_BUFFER_POOLS > 64
+# error "MAX_BUFFER_POOLS > 64; redefine buf_pool_index:6"
+# endif
/* @} */
#endif /* !UNIV_HOTBACKUP */
page_zip_des_t zip; /*!< compressed page; zip.data
(but not the data it points to) is
- also protected by buf_pool_mutex;
+ also protected by buf_pool->mutex;
state == BUF_BLOCK_ZIP_PAGE and
zip.data == NULL means an active
- buf_pool_watch */
+ buf_pool->watch */
#ifndef UNIV_HOTBACKUP
buf_page_t* hash; /*!< node used in chaining to
buf_pool->page_hash or
@@ -1224,15 +1314,16 @@ struct buf_page_struct{
#endif /* UNIV_DEBUG */
/** @name Page flushing fields
- All these are protected by buf_pool_mutex. */
+ All these are protected by buf_pool->mutex. */
/* @{ */
UT_LIST_NODE_T(buf_page_t) list;
/*!< based on state, this is a
list node, protected either by
- buf_pool_mutex or by
- flush_list_mutex, in one of the
- following lists in buf_pool:
+ buf_pool->mutex or by
+ buf_pool->flush_list_mutex,
+ in one of the following lists in
+ buf_pool:
- BUF_BLOCK_NOT_USED: free
- BUF_BLOCK_FILE_PAGE: flush_list
@@ -1242,9 +1333,9 @@ struct buf_page_struct{
If bpage is part of flush_list
then the node pointers are
- covered by flush_list_mutex.
+ covered by buf_pool->flush_list_mutex.
Otherwise these pointers are
- protected by buf_pool_mutex.
+ protected by buf_pool->mutex.
The contents of the list node
is undefined if !in_flush_list
@@ -1256,17 +1347,18 @@ struct buf_page_struct{
#ifdef UNIV_DEBUG
ibool in_flush_list; /*!< TRUE if in buf_pool->flush_list;
- when flush_list_mutex is free, the
- following should hold: in_flush_list
+ when buf_pool->flush_list_mutex is
+ free, the following should hold:
+ in_flush_list
== (state == BUF_BLOCK_FILE_PAGE
|| state == BUF_BLOCK_ZIP_DIRTY)
Writes to this field must be
covered by both block->mutex
- and flush_list_mutex. Hence
+ and buf_pool->flush_list_mutex. Hence
reads can happen while holding
any one of the two mutexes */
ibool in_free_list; /*!< TRUE if in buf_pool->free; when
- buf_pool_mutex is free, the following
+ buf_pool->mutex is free, the following
should hold: in_free_list
== (state == BUF_BLOCK_NOT_USED) */
#endif /* UNIV_DEBUG */
@@ -1286,7 +1378,7 @@ struct buf_page_struct{
modifications are on disk.
Writes to this field must be
covered by both block->mutex
- and flush_list_mutex. Hence
+ and buf_pool->flush_list_mutex. Hence
reads can happen while holding
any one of the two mutexes */
/* @} */
@@ -1316,14 +1408,12 @@ struct buf_page_struct{
0 if the block was never accessed
in the buffer pool */
/* @} */
-# ifdef UNIV_DEBUG_FILE_ACCESSES
+# if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
ibool file_page_was_freed;
/*!< this is set to TRUE when fsp
frees a page in buffer pool */
-# endif /* UNIV_DEBUG_FILE_ACCESSES */
+# endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
#endif /* !UNIV_HOTBACKUP */
- buf_pool_t* buf_pool; /*!< buffer pool instance this
- page belongs to */
};
/** The buffer control block structure */
@@ -1661,20 +1751,13 @@ struct buf_pool_struct{
/* @} */
};
-/** mutex protecting the buffer pool struct and control blocks, except the
-read-write lock in them */
-extern mutex_t buf_pool_mutex;
-/** mutex protecting the control blocks of compressed-only pages
-(of type buf_page_t, not buf_block_t) */
-extern mutex_t buf_pool_zip_mutex;
-
-/** @name Accessors for buf_pool_mutex.
-Use these instead of accessing buf_pool_mutex directly. */
+/** @name Accessors for buf_pool->mutex.
+Use these instead of accessing buf_pool->mutex directly. */
/* @{ */
-/** Test if buf_pool_mutex is owned. */
+/** Test if a buffer pool mutex is owned. */
#define buf_pool_mutex_own(b) mutex_own(&b->mutex)
-/** Acquire the buffer pool mutex. */
+/** Acquire a buffer pool mutex. */
#define buf_pool_mutex_enter(b) do { \
ut_ad(!mutex_own(&b->zip_mutex)); \
mutex_enter(&b->mutex); \
diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic
index 713b7cb990d..e2e83de0a78 100644
--- a/storage/innobase/include/buf0buf.ic
+++ b/storage/innobase/include/buf0buf.ic
@@ -46,6 +46,48 @@ buf_pool_get_curr_size(void)
return(srv_buf_pool_curr_size);
}
+/********************************************************************//**
+Calculates the index of a buffer pool to the buf_pool[] array.
+@return the position of the buffer pool in buf_pool[] */
+UNIV_INLINE
+ulint
+buf_pool_index(
+/*===========*/
+ const buf_pool_t* buf_pool) /*!< in: buffer pool */
+{
+ ulint i = buf_pool - buf_pool_ptr;
+ ut_ad(i < MAX_BUFFER_POOLS);
+ ut_ad(i < srv_buf_pool_instances);
+ return(i);
+}
+
+/******************************************************************//**
+Returns the buffer pool instance given a page instance
+@return buf_pool */
+UNIV_INLINE
+buf_pool_t*
+buf_pool_from_bpage(
+/*================*/
+ const buf_page_t* bpage) /*!< in: buffer pool page */
+{
+ ulint i;
+ i = bpage->buf_pool_index;
+ ut_ad(i < srv_buf_pool_instances);
+ return(&buf_pool_ptr[i]);
+}
+
+/******************************************************************//**
+Returns the buffer pool instance given a block instance
+@return buf_pool */
+UNIV_INLINE
+buf_pool_t*
+buf_pool_from_block(
+/*================*/
+ const buf_block_t* block) /*!< in: block */
+{
+ return(buf_pool_from_bpage(&block->page));
+}
+
/*********************************************************************//**
Gets the current size of buffer buf_pool in pages.
@return size in pages*/
@@ -886,33 +928,6 @@ buf_block_buf_fix_dec(
}
/******************************************************************//**
-Returns the buffer pool instance given a page instance
-@return buf_pool */
-UNIV_INLINE
-buf_pool_t*
-buf_pool_from_bpage(
-/*================*/
- const buf_page_t* bpage) /*!< in: buffer pool page */
-{
- /* Every page must be in some buffer pool. */
- ut_ad(bpage->buf_pool != NULL);
-
- return(bpage->buf_pool);
-}
-
-/******************************************************************//**
-Returns the buffer pool instance given a block instance
-@return buf_pool */
-UNIV_INLINE
-buf_pool_t*
-buf_pool_from_block(
-/*================*/
- const buf_block_t* block) /*!< in: block */
-{
- return(buf_pool_from_bpage(&block->page));
-}
-
-/******************************************************************//**
Returns the buffer pool instance given space and offset of page
@return buffer pool */
UNIV_INLINE
@@ -929,7 +944,7 @@ buf_pool_get(
ignored_offset = offset >> 6; /* 2log of BUF_READ_AHEAD_AREA (64)*/
fold = buf_page_address_fold(space, ignored_offset);
index = fold % srv_buf_pool_instances;
- return buf_pool_ptr[index];
+ return(&buf_pool_ptr[index]);
}
/******************************************************************//**
@@ -939,10 +954,12 @@ UNIV_INLINE
buf_pool_t*
buf_pool_from_array(
/*================*/
- ulint index) /*!< in: array index to get
+ ulint index) /*!< in: array index to get
buffer pool instance from */
{
- return buf_pool_ptr[index];
+ ut_ad(index < MAX_BUFFER_POOLS);
+ ut_ad(index < srv_buf_pool_instances);
+ return(&buf_pool_ptr[index]);
}
/******************************************************************//**
diff --git a/storage/innobase/include/buf0flu.h b/storage/innobase/include/buf0flu.h
index 55814b6bf86..ae27f5dab0e 100644
--- a/storage/innobase/include/buf0flu.h
+++ b/storage/innobase/include/buf0flu.h
@@ -84,6 +84,21 @@ buf_flush_init_for_writing(
ib_uint64_t newest_lsn); /*!< in: newest modification lsn
to the page */
#ifndef UNIV_HOTBACKUP
+# if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/********************************************************************//**
+Writes a flushable page asynchronously from the buffer pool to a file.
+NOTE: buf_pool->mutex and block->mutex must be held upon entering this
+function, and they will be released by this function after flushing.
+This is loosely based on buf_flush_batch() and buf_flush_page().
+@return TRUE if the page was flushed and the mutexes released */
+UNIV_INTERN
+ibool
+buf_flush_page_try(
+/*===============*/
+ buf_pool_t* buf_pool, /*!< in/out: buffer pool instance */
+ buf_block_t* block) /*!< in/out: buffer control block */
+ __attribute__((nonnull, warn_unused_result));
+# endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
/*******************************************************************//**
This utility flushes dirty blocks from the end of the LRU list.
NOTE: The calling thread may own latches to pages: to avoid deadlocks,
@@ -123,7 +138,18 @@ UNIV_INTERN
void
buf_flush_wait_batch_end(
/*=====================*/
- buf_pool_t* buf_pool, /*!< buffer pool instance */
+ buf_pool_t* buf_pool, /*!< in: buffer pool instance */
+ enum buf_flush type); /*!< in: BUF_FLUSH_LRU
+ or BUF_FLUSH_LIST */
+/******************************************************************//**
+Waits until a flush batch of the given type ends. This is called by
+a thread that only wants to wait for a flush to end but doesn't do
+any flushing itself. */
+UNIV_INTERN
+void
+buf_flush_wait_batch_end_wait_only(
+/*===============================*/
+ buf_pool_t* buf_pool, /*!< in: buffer pool instance */
enum buf_flush type); /*!< in: BUF_FLUSH_LRU
or BUF_FLUSH_LIST */
/********************************************************************//**
@@ -228,8 +254,8 @@ make sure that a read-ahead batch can be read efficiently in a single
sweep). */
#define BUF_FLUSH_FREE_BLOCK_MARGIN(b) (5 + BUF_READ_AHEAD_AREA(b))
/** Extra margin to apply above BUF_FLUSH_FREE_BLOCK_MARGIN */
-#define BUF_FLUSH_EXTRA_MARGIN(b) (BUF_FLUSH_FREE_BLOCK_MARGIN(b) / 4 \
- + 100)
+#define BUF_FLUSH_EXTRA_MARGIN(b) ((BUF_FLUSH_FREE_BLOCK_MARGIN(b) / 4 \
+ + 100) / srv_buf_pool_instances)
#endif /* !UNIV_HOTBACKUP */
#ifndef UNIV_NONINL
diff --git a/storage/innobase/include/buf0lru.h b/storage/innobase/include/buf0lru.h
index 7bcec633d9c..9b150188b03 100644
--- a/storage/innobase/include/buf0lru.h
+++ b/storage/innobase/include/buf0lru.h
@@ -111,12 +111,9 @@ enum buf_lru_free_block_status
buf_LRU_free_block(
/*===============*/
buf_page_t* bpage, /*!< in: block to be freed */
- ibool zip, /*!< in: TRUE if should remove also the
+ ibool zip) /*!< in: TRUE if should remove also the
compressed page of an uncompressed page */
- ibool* buf_pool_mutex_released);
- /*!< in: pointer to a variable that will
- be assigned TRUE if buf_pool->mutex
- was temporarily released, or NULL */
+ __attribute__((nonnull));
/******************************************************************//**
Try to free a replaceable block.
@return TRUE if found and freed */
@@ -153,9 +150,8 @@ UNIV_INTERN
buf_block_t*
buf_LRU_get_free_block(
/*===================*/
- buf_pool_t* buf_pool, /*!< in: preferred buffer pool */
- ulint zip_size); /*!< in: compressed page size in bytes,
- or 0 if uncompressed tablespace */
+ buf_pool_t* buf_pool) /*!< in/out: buffer pool instance */
+ __attribute__((nonnull,warn_unused_result));
/******************************************************************//**
Puts a block back to the free list. */
diff --git a/storage/innobase/include/buf0rea.h b/storage/innobase/include/buf0rea.h
index 4a52f9dcd8d..cdf6cdba3d1 100644
--- a/storage/innobase/include/buf0rea.h
+++ b/storage/innobase/include/buf0rea.h
@@ -70,10 +70,10 @@ UNIV_INTERN
ulint
buf_read_ahead_linear(
/*==================*/
- ulint space, /*!< in: space id */
- ulint zip_size,/*!< in: compressed page size in bytes, or 0 */
- ulint offset);/*!< in: page number of a page; NOTE: the current thread
- must want access to this page (see NOTE 3 above) */
+ ulint space, /*!< in: space id */
+ ulint zip_size, /*!< in: compressed page size in bytes, or 0 */
+ ulint offset, /*!< in: page number; see NOTE 3 above */
+ ibool inside_ibuf); /*!< in: TRUE if we are inside ibuf routine */
/********************************************************************//**
Issues read requests for pages which the ibuf module wants to read in, in
order to contract the insert buffer tree. Technically, this function is like
diff --git a/storage/innobase/include/data0data.h b/storage/innobase/include/data0data.h
index 11e4027777a..f7bdd29ed90 100644
--- a/storage/innobase/include/data0data.h
+++ b/storage/innobase/include/data0data.h
@@ -154,14 +154,19 @@ dfield_dup(
dfield_t* field, /*!< in/out: data field */
mem_heap_t* heap); /*!< in: memory heap where allocated */
/*********************************************************************//**
-Tests if data length and content is equal for two dfields.
-@return TRUE if equal */
+Tests if two data fields are equal.
+If len==0, tests the data length and content for equality.
+If len>0, tests the first len bytes of the content for equality.
+@return TRUE if both fields are NULL or if they are equal */
UNIV_INLINE
ibool
dfield_datas_are_binary_equal(
/*==========================*/
const dfield_t* field1, /*!< in: field */
- const dfield_t* field2);/*!< in: field */
+ const dfield_t* field2, /*!< in: field */
+ ulint len) /*!< in: maximum prefix to compare,
+ or 0 to compare the whole field length */
+ __attribute__((nonnull, warn_unused_result));
/*********************************************************************//**
Tests if dfield data length and content is equal to the given.
@return TRUE if equal */
diff --git a/storage/innobase/include/data0data.ic b/storage/innobase/include/data0data.ic
index 2e3adf4b707..5c0f8039c80 100644
--- a/storage/innobase/include/data0data.ic
+++ b/storage/innobase/include/data0data.ic
@@ -229,20 +229,30 @@ dfield_dup(
}
/*********************************************************************//**
-Tests if data length and content is equal for two dfields.
-@return TRUE if equal */
+Tests if two data fields are equal.
+If len==0, tests the data length and content for equality.
+If len>0, tests the first len bytes of the content for equality.
+@return TRUE if both fields are NULL or if they are equal */
UNIV_INLINE
ibool
dfield_datas_are_binary_equal(
/*==========================*/
const dfield_t* field1, /*!< in: field */
- const dfield_t* field2) /*!< in: field */
+ const dfield_t* field2, /*!< in: field */
+ ulint len) /*!< in: maximum prefix to compare,
+ or 0 to compare the whole field length */
{
- ulint len;
+ ulint len2 = len;
- len = field1->len;
+ if (field1->len == UNIV_SQL_NULL || len == 0 || field1->len < len) {
+ len = field1->len;
+ }
+
+ if (field2->len == UNIV_SQL_NULL || len2 == 0 || field2->len < len2) {
+ len2 = field2->len;
+ }
- return(len == field2->len
+ return(len == len2
&& (len == UNIV_SQL_NULL
|| !memcmp(field1->data, field2->data, len)));
}
diff --git a/storage/innobase/include/data0type.h b/storage/innobase/include/data0type.h
index 850cf2e2975..d7fa0b9cd44 100644
--- a/storage/innobase/include/data0type.h
+++ b/storage/innobase/include/data0type.h
@@ -174,10 +174,13 @@ store the charset-collation number; one byte is left unused, though */
/* Pack mbminlen, mbmaxlen to mbminmaxlen. */
#define DATA_MBMINMAXLEN(mbminlen, mbmaxlen) \
((mbmaxlen) * DATA_MBMAX + (mbminlen))
-/* Get mbminlen from mbminmaxlen. */
-#define DATA_MBMINLEN(mbminmaxlen) UNIV_EXPECT(((mbminmaxlen) % DATA_MBMAX), 1)
+/* Get mbminlen from mbminmaxlen. Cast the result of UNIV_EXPECT to ulint
+because in GCC it returns a long. */
+#define DATA_MBMINLEN(mbminmaxlen) ((ulint) \
+ UNIV_EXPECT(((mbminmaxlen) % DATA_MBMAX), \
+ 1))
/* Get mbmaxlen from mbminmaxlen. */
-#define DATA_MBMAXLEN(mbminmaxlen) ((mbminmaxlen) / DATA_MBMAX)
+#define DATA_MBMAXLEN(mbminmaxlen) ((ulint) ((mbminmaxlen) / DATA_MBMAX))
#ifndef UNIV_HOTBACKUP
/*********************************************************************//**
diff --git a/storage/innobase/include/db0err.h b/storage/innobase/include/db0err.h
index 010ab32fd31..74a2354bce3 100644
--- a/storage/innobase/include/db0err.h
+++ b/storage/innobase/include/db0err.h
@@ -94,9 +94,6 @@ enum db_err {
DB_PRIMARY_KEY_IS_NULL, /* a column in the PRIMARY KEY
was found to be NULL */
- DB_FOREIGN_EXCEED_MAX_CASCADE, /* Foreign key constraint related
- cascading delete/update exceeds
- maximum allowed depth */
DB_STATS_DO_NOT_EXIST, /* an operation that requires the
persistent storage, used for recording
@@ -104,6 +101,17 @@ enum db_err {
requested but this storage does not
exist itself or the stats for a given
table do not exist */
+ DB_FOREIGN_EXCEED_MAX_CASCADE, /* Foreign key constraint related
+ cascading delete/update exceeds
+ maximum allowed depth */
+ DB_CHILD_NO_INDEX, /* the child (foreign) table does not
+ have an index that contains the
+ foreign keys as its prefix columns */
+ DB_PARENT_NO_INDEX, /* the parent table does not
+ have an index that contains the
+ foreign keys as its prefix columns */
+ DB_TOO_BIG_INDEX_COL, /* index column size exceeds maximum
+ limit */
/* The following are partial failure codes */
DB_FAIL = 1000,
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index 029cf408141..f979d0fcc96 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -136,6 +136,19 @@ dict_col_copy_type(
/*===============*/
const dict_col_t* col, /*!< in: column */
dtype_t* type); /*!< out: data type */
+/**********************************************************************//**
+Determine bytes of column prefix to be stored in the undo log. Please
+note if the table format is UNIV_FORMAT_A (< DICT_TF_FORMAT_ZIP), no prefix
+needs to be stored in the undo log.
+@return bytes of column prefix to be stored in the undo log */
+UNIV_INLINE
+ulint
+dict_max_field_len_store_undo(
+/*==========================*/
+ dict_table_t* table, /*!< in: table */
+ const dict_col_t* col); /*!< in: column which index prefix
+ is based on */
+
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
/*********************************************************************//**
@@ -345,7 +358,8 @@ void
dict_table_replace_index_in_foreign_list(
/*=====================================*/
dict_table_t* table, /*!< in/out: table */
- dict_index_t* index); /*!< in: index to be replaced */
+ dict_index_t* index, /*!< in: index to be replaced */
+ const trx_t* trx); /*!< in: transaction handle */
/*********************************************************************//**
Checks if a index is defined for a foreign key constraint. Index is a part
of a foreign key constraint if the index is referenced by foreign key
@@ -440,6 +454,18 @@ function.
@return table, NULL if not found */
UNIV_INLINE
dict_table_t*
+dict_table_get_low_ignore_err(
+/*===========================*/
+ const char* table_name, /*!< in: table name */
+ dict_err_ignore_t
+ ignore_err); /*!< in: error to be ignored when
+ loading a table definition */
+/**********************************************************************//**
+Gets a table; loads it to the dictionary cache if necessary. A low-level
+function.
+@return table, NULL if not found */
+UNIV_INLINE
+dict_table_t*
dict_table_get_low(
/*===============*/
const char* table_name); /*!< in: table name */
@@ -1080,19 +1106,13 @@ Calculates new estimates for table and index statistics. The statistics
are used in query optimization. */
UNIV_INTERN
void
-dict_update_statistics_low(
-/*=======================*/
- dict_table_t* table, /*!< in/out: table */
- ibool has_dict_mutex);/*!< in: TRUE if the caller has the
- dictionary mutex */
-/*********************************************************************//**
-Calculates new estimates for table and index statistics. The statistics
-are used in query optimization. */
-UNIV_INTERN
-void
dict_update_statistics(
/*===================*/
- dict_table_t* table); /*!< in/out: table */
+ dict_table_t* table, /*!< in/out: table */
+ ibool only_calc_if_missing_stats);/*!< in: only
+ update/recalc the stats if they have
+ not been initialized yet, otherwise
+ do nothing */
/********************************************************************//**
Reserves the dictionary system mutex for MySQL. */
UNIV_INTERN
@@ -1106,21 +1126,25 @@ void
dict_mutex_exit_for_mysql(void);
/*===========================*/
/**********************************************************************//**
-Lock the appropriate mutex to protect index->stat_n_diff_key_vals[].
-index->id is used to pick the right mutex and it should not change
-before dict_index_stat_mutex_exit() is called on this index. */
+Lock the appropriate latch to protect a given table's statistics.
+table->id is used to pick the corresponding latch from a global array of
+latches. */
UNIV_INTERN
void
-dict_index_stat_mutex_enter(
-/*========================*/
- const dict_index_t* index); /*!< in: index */
+dict_table_stats_lock(
+/*==================*/
+ const dict_table_t* table, /*!< in: table */
+ ulint latch_mode); /*!< in: RW_S_LATCH or
+ RW_X_LATCH */
/**********************************************************************//**
-Unlock the appropriate mutex that protects index->stat_n_diff_key_vals[]. */
+Unlock the latch that has been locked by dict_table_stats_lock() */
UNIV_INTERN
void
-dict_index_stat_mutex_exit(
-/*=======================*/
- const dict_index_t* index); /*!< in: index */
+dict_table_stats_unlock(
+/*====================*/
+ const dict_table_t* table, /*!< in: table */
+ ulint latch_mode); /*!< in: RW_S_LATCH or
+ RW_X_LATCH */
/********************************************************************//**
Checks if the database name in two table names is the same.
@return TRUE if same db name */
diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic
index 42f124dedfc..59811568556 100644
--- a/storage/innobase/include/dict0dict.ic
+++ b/storage/innobase/include/dict0dict.ic
@@ -828,6 +828,34 @@ dict_table_check_if_in_cache_low(
}
/**********************************************************************//**
+load a table into dictionary cache, ignore any error specified during load;
+@return table, NULL if not found */
+UNIV_INLINE
+dict_table_t*
+dict_table_get_low_ignore_err(
+/*==========================*/
+ const char* table_name, /*!< in: table name */
+ dict_err_ignore_t
+ ignore_err) /*!< in: error to be ignored when
+ loading a table definition */
+{
+ dict_table_t* table;
+
+ ut_ad(table_name);
+ ut_ad(mutex_own(&(dict_sys->mutex)));
+
+ table = dict_table_check_if_in_cache_low(table_name);
+
+ if (table == NULL) {
+ table = dict_load_table(table_name, TRUE, ignore_err);
+ }
+
+ ut_ad(!table || table->cached);
+
+ return(table);
+}
+
+/**********************************************************************//**
Gets a table; loads it to the dictionary cache if necessary. A low-level
function.
@return table, NULL if not found */
@@ -845,7 +873,7 @@ dict_table_get_low(
table = dict_table_check_if_in_cache_low(table_name);
if (table == NULL) {
- table = dict_load_table(table_name, TRUE);
+ table = dict_load_table(table_name, TRUE, DICT_ERR_IGNORE_NONE);
}
ut_ad(!table || table->cached);
@@ -883,4 +911,30 @@ dict_table_get_on_id_low(
return(table);
}
+
+/**********************************************************************//**
+Determine bytes of column prefix to be stored in the undo log. Please
+note if the table format is UNIV_FORMAT_A (< DICT_TF_FORMAT_ZIP), no prefix
+needs to be stored in the undo log.
+@return bytes of column prefix to be stored in the undo log */
+UNIV_INLINE
+ulint
+dict_max_field_len_store_undo(
+/*==========================*/
+ dict_table_t* table, /*!< in: table */
+ const dict_col_t* col) /*!< in: column which index prefix
+ is based on */
+{
+ ulint prefix_len = 0;
+
+ if (dict_table_get_format(table) >= DICT_TF_FORMAT_ZIP)
+ {
+ prefix_len = col->max_prefix
+ ? col->max_prefix
+ : DICT_MAX_FIELD_LEN_BY_FORMAT(table);
+ }
+
+ return(prefix_len);
+}
+
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/innobase/include/dict0load.h b/storage/innobase/include/dict0load.h
index f009f221f32..16177ade713 100644
--- a/storage/innobase/include/dict0load.h
+++ b/storage/innobase/include/dict0load.h
@@ -155,7 +155,12 @@ dict_load_field_low(
byte* last_index_id, /*!< in: last index id */
mem_heap_t* heap, /*!< in/out: memory heap
for temporary storage */
- const rec_t* rec); /*!< in: SYS_FIELDS record */
+ const rec_t* rec, /*!< in: SYS_FIELDS record */
+ char* addition_err_str,/*!< out: additional error message
+ that requires information to be
+ filled, or NULL */
+ ulint err_str_len); /*!< in: length of addition_err_str
+ in bytes */
/********************************************************************//**
Loads a table definition and also all its index definitions, and also
the cluster definition if the table is a member in a cluster. Also loads
@@ -170,7 +175,10 @@ dict_load_table(
/*============*/
const char* name, /*!< in: table name in the
databasename/tablename format */
- ibool cached);/*!< in: TRUE=add to cache, FALSE=do not */
+ ibool cached, /*!< in: TRUE=add to cache, FALSE=do not */
+ dict_err_ignore_t ignore_err);
+ /*!< in: error to be ignored when loading
+ table and its indexes' definition */
/***********************************************************************//**
Loads a table object based on the table id.
@return table; NULL if table does not exist */
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index ecc401066f1..3a475fa85fc 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -122,7 +122,7 @@ This could result in rescursive calls and out of stack error eventually.
DICT_FK_MAX_RECURSIVE_LOAD defines the maximum number of recursive loads,
when exceeded, the child table will not be loaded. It will be loaded when
the foreign constraint check needs to be run. */
-#define DICT_FK_MAX_RECURSIVE_LOAD 250
+#define DICT_FK_MAX_RECURSIVE_LOAD 255
/** Similarly, when tables are chained together with foreign key constraints
with on cascading delete/update clause, delete from parent table could
@@ -130,7 +130,7 @@ result in recursive cascading calls. This defines the maximum number of
such cascading deletes/updates allowed. When exceeded, the delete from
parent table will fail, and user has to drop excessive foreign constraint
before proceeds. */
-#define FK_MAX_CASCADE_DEL 300
+#define FK_MAX_CASCADE_DEL 255
/**********************************************************************//**
Creates a table memory object.
@@ -238,6 +238,30 @@ dict_foreign_t*
dict_mem_foreign_create(void);
/*=========================*/
+/**********************************************************************//**
+Sets the foreign_table_name_lookup pointer based on the value of
+lower_case_table_names. If that is 0 or 1, foreign_table_name_lookup
+will point to foreign_table_name. If 2, then another string is
+allocated from the heap and set to lower case. */
+UNIV_INTERN
+void
+dict_mem_foreign_table_name_lookup_set(
+/*===================================*/
+ dict_foreign_t* foreign, /*!< in/out: foreign struct */
+ ibool do_alloc); /*!< in: is an alloc needed */
+
+/**********************************************************************//**
+Sets the referenced_table_name_lookup pointer based on the value of
+lower_case_table_names. If that is 0 or 1, referenced_table_name_lookup
+will point to referenced_table_name. If 2, then another string is
+allocated from the heap and set to lower case. */
+UNIV_INTERN
+void
+dict_mem_referenced_table_name_lookup_set(
+/*======================================*/
+ dict_foreign_t* foreign, /*!< in/out: foreign struct */
+ ibool do_alloc); /*!< in: is an alloc needed */
+
/** Data structure for a column in a table */
struct dict_col_struct{
/*----------------------*/
@@ -278,32 +302,58 @@ struct dict_col_struct{
unsigned ord_part:1; /*!< nonzero if this column
appears in the ordering fields
of an index */
+ unsigned max_prefix:12; /*!< maximum index prefix length on
+ this column. Our current max limit is
+ 3072 for Barracuda table */
};
-/** @brief DICT_MAX_INDEX_COL_LEN is measured in bytes and is the maximum
-indexed column length (or indexed prefix length).
+/** @brief DICT_ANTELOPE_MAX_INDEX_COL_LEN is measured in bytes and
+is the maximum indexed column length (or indexed prefix length) in
+ROW_FORMAT=REDUNDANT and ROW_FORMAT=COMPACT. Also, in any format,
+any fixed-length field that is longer than this will be encoded as
+a variable-length field.
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 REC_MAX_INDEX_COL_LEN
+#define DICT_ANTELOPE_MAX_INDEX_COL_LEN REC_ANTELOPE_MAX_INDEX_COL_LEN
+
+/** Find out maximum indexed column length by its table format.
+For ROW_FORMAT=REDUNDANT and ROW_FORMAT=COMPACT, the maximum
+field length is REC_ANTELOPE_MAX_INDEX_COL_LEN - 1 (767). For new
+barracuda format, the length could be REC_VERSION_56_MAX_INDEX_COL_LEN
+(3072) bytes */
+#define DICT_MAX_FIELD_LEN_BY_FORMAT(table) \
+ ((dict_table_get_format(table) < DICT_TF_FORMAT_ZIP) \
+ ? (REC_ANTELOPE_MAX_INDEX_COL_LEN - 1) \
+ : REC_VERSION_56_MAX_INDEX_COL_LEN)
+
+#define DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags) \
+ ((((flags & DICT_TF_FORMAT_MASK) >> DICT_TF_FORMAT_SHIFT)\
+ < DICT_TF_FORMAT_ZIP) \
+ ? (REC_ANTELOPE_MAX_INDEX_COL_LEN - 1) \
+ : REC_VERSION_56_MAX_INDEX_COL_LEN)
+
+/** Defines the maximum fixed length column size */
+#define DICT_MAX_FIXED_COL_LEN DICT_ANTELOPE_MAX_INDEX_COL_LEN
/** Data structure for a field in an index */
struct dict_field_struct{
dict_col_t* col; /*!< pointer to the table column */
const char* name; /*!< name of the column */
- unsigned prefix_len:10; /*!< 0 or the length of the column
+ unsigned prefix_len:12; /*!< 0 or the length of the column
prefix in bytes in a MySQL index of
type, e.g., INDEX (textcol(25));
must be smaller than
- DICT_MAX_INDEX_COL_LEN; NOTE that
- in the UTF-8 charset, MySQL sets this
- to 3 * the prefix len in UTF-8 chars */
+ DICT_MAX_FIELD_LEN_BY_FORMAT;
+ NOTE that in the UTF-8 charset, MySQL
+ sets this to (mbmaxlen * the prefix len)
+ in UTF-8 chars */
unsigned fixed_len:10; /*!< 0 or the fixed length of the
column if smaller than
- DICT_MAX_INDEX_COL_LEN */
+ DICT_ANTELOPE_MAX_INDEX_COL_LEN */
};
/** Data structure for an index. Most fields will be
@@ -341,6 +391,8 @@ struct dict_index_struct{
/*!< TRUE if this index is marked to be
dropped in ha_innobase::prepare_drop_index(),
otherwise FALSE */
+ unsigned corrupted:1;
+ /*!< TRUE if the index object is corrupted */
dict_field_t* fields; /*!< array of field descriptions */
#ifndef UNIV_HOTBACKUP
UT_LIST_NODE_T(dict_index_t)
@@ -356,6 +408,12 @@ struct dict_index_struct{
dict_get_n_unique(index); we
periodically calculate new
estimates */
+ ib_int64_t* stat_n_non_null_key_vals;
+ /* approximate number of non-null key values
+ for this index, for each column where
+ n < dict_get_n_unique(index); This
+ is used when innodb_stats_method is
+ "nulls_ignored". */
ulint stat_index_size;
/*!< approximate index size in
database pages */
@@ -369,6 +427,13 @@ struct dict_index_struct{
index, or 0 if the index existed
when InnoDB was started up */
#endif /* !UNIV_HOTBACKUP */
+#ifdef UNIV_BLOB_DEBUG
+ mutex_t blobs_mutex;
+ /*!< mutex protecting blobs */
+ void* blobs; /*!< map of (page_no,heap_no,field_no)
+ to first_blob_page_no; protected by
+ blobs_mutex; @see btr_blob_dbg_t */
+#endif /* UNIV_BLOB_DEBUG */
#ifdef UNIV_DEBUG
ulint magic_n;/*!< magic number */
/** Value of dict_index_struct::magic_n */
@@ -393,10 +458,14 @@ struct dict_foreign_struct{
unsigned type:6; /*!< 0 or DICT_FOREIGN_ON_DELETE_CASCADE
or DICT_FOREIGN_ON_DELETE_SET_NULL */
char* foreign_table_name;/*!< foreign table name */
+ char* foreign_table_name_lookup;
+ /*!< foreign table name used for dict lookup */
dict_table_t* foreign_table; /*!< table where the foreign key is */
const char** foreign_col_names;/*!< names of the columns in the
foreign key */
char* referenced_table_name;/*!< referenced table name */
+ char* referenced_table_name_lookup;
+ /*!< referenced table name for dict lookup*/
dict_table_t* referenced_table;/*!< table where the referenced key
is */
const char** referenced_col_names;/*!< names of the referenced
@@ -457,6 +526,8 @@ struct dict_table_struct{
to the dictionary cache */
unsigned n_def:10;/*!< number of columns defined so far */
unsigned n_cols:10;/*!< number of columns */
+ unsigned corrupted:1;
+ /*!< TRUE if table is corrupted */
dict_col_t* cols; /*!< array of column descriptions */
const char* col_names;
/*!< Column names packed in a character string
diff --git a/storage/innobase/include/dict0types.h b/storage/innobase/include/dict0types.h
index 0a9edfbfe70..8cbd7cd5783 100644
--- a/storage/innobase/include/dict0types.h
+++ b/storage/innobase/include/dict0types.h
@@ -33,11 +33,6 @@ typedef struct dict_index_struct dict_index_t;
typedef struct dict_table_struct dict_table_t;
typedef struct dict_foreign_struct dict_foreign_t;
-/* A cluster object is a table object with the type field set to
-DICT_CLUSTERED */
-
-typedef dict_table_t dict_cluster_t;
-
typedef struct ind_node_struct ind_node_t;
typedef struct tab_node_struct tab_node_t;
@@ -48,4 +43,18 @@ typedef struct tab_node_struct tab_node_t;
typedef ib_id_t table_id_t;
typedef ib_id_t index_id_t;
+/** Error to ignore when we load table dictionary into memory. However,
+the table and index will be marked as "corrupted", and caller will
+be responsible to deal with corrupted table or index.
+Note: please define the IGNORE_ERR_* as bits, so their value can
+be or-ed together */
+enum dict_err_ignore {
+ DICT_ERR_IGNORE_NONE = 0, /*!< no error to ignore */
+ DICT_ERR_IGNORE_INDEX_ROOT = 1, /*!< ignore error if index root
+ page is FIL_NUL or incorrect value */
+ DICT_ERR_IGNORE_ALL = 0xFFFF /*!< ignore all errors */
+};
+
+typedef enum dict_err_ignore dict_err_ignore_t;
+
#endif
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index d7d98787bcf..3a6336f1a01 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -717,6 +717,14 @@ fil_page_get_type(
/*==============*/
const byte* page); /*!< in: file page */
+/*******************************************************************//**
+Returns TRUE if a single-table tablespace is being deleted.
+@return TRUE if being deleted */
+UNIV_INTERN
+ibool
+fil_tablespace_is_being_deleted(
+/*============================*/
+ ulint id); /*!< in: space id */
typedef struct fil_space_struct fil_space_t;
diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h
index b75002944bd..edf7a1a28c1 100644
--- a/storage/innobase/include/ha_prototypes.h
+++ b/storage/innobase/include/ha_prototypes.h
@@ -174,6 +174,15 @@ innobase_strcasecmp(
const char* b); /*!< in: second string to compare */
/******************************************************************//**
+Strip dir name from a full path name and return only its file name.
+@return file name or "null" if no file name */
+UNIV_INTERN
+const char*
+innobase_basename(
+/*==============*/
+ const char* path_name); /*!< in: full path name */
+
+/******************************************************************//**
Returns true if the thread is executing a SELECT statement.
@return true if thd is executing SELECT */
@@ -276,4 +285,15 @@ thd_set_lock_wait_time(
void* thd, /*!< in: thread handle (THD*) */
ulint value); /*!< in: time waited for the lock */
+/**********************************************************************//**
+Get the current setting of the lower_case_table_names global parameter from
+mysqld.cc. We do a dirty read because for one there is no synchronization
+object and secondly there is little harm in doing so even if we get a torn
+read.
+@return value of lower_case_table_names */
+UNIV_INTERN
+ulint
+innobase_get_lower_case_table_names(void);
+/*=====================================*/
+
#endif
diff --git a/storage/innobase/include/ibuf0ibuf.h b/storage/innobase/include/ibuf0ibuf.h
index 0f1631fde77..28c97fd609f 100644
--- a/storage/innobase/include/ibuf0ibuf.h
+++ b/storage/innobase/include/ibuf0ibuf.h
@@ -43,7 +43,7 @@ typedef enum {
IBUF_OP_DELETE = 2,
/* Number of different operation types. */
- IBUF_OP_COUNT = 3,
+ IBUF_OP_COUNT = 3
} ibuf_op_t;
/** Combinations of operations that can be buffered. Because the enum
@@ -63,6 +63,11 @@ typedef enum {
/** Operations that can currently be buffered. */
extern ibuf_use_t ibuf_use;
+#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
+/** Flag to control insert buffer debugging. */
+extern uint ibuf_debug;
+#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
+
/** The insert buffer control structure */
extern ibuf_t* ibuf;
@@ -99,6 +104,22 @@ UNIV_INTERN
void
ibuf_update_max_tablespace_id(void);
/*===============================*/
+/***************************************************************//**
+Starts an insert buffer mini-transaction. */
+UNIV_INLINE
+void
+ibuf_mtr_start(
+/*===========*/
+ mtr_t* mtr) /*!< out: mini-transaction */
+ __attribute__((nonnull));
+/***************************************************************//**
+Commits an insert buffer mini-transaction. */
+UNIV_INLINE
+void
+ibuf_mtr_commit(
+/*============*/
+ mtr_t* mtr) /*!< in/out: mini-transaction */
+ __attribute__((nonnull));
/*********************************************************************//**
Initializes an ibuf bitmap page. */
UNIV_INTERN
@@ -219,10 +240,12 @@ routine.
For instance, a read-ahead of non-ibuf pages is forbidden by threads
that are executing an insert buffer routine.
@return TRUE if inside an insert buffer routine */
-UNIV_INTERN
+UNIV_INLINE
ibool
-ibuf_inside(void);
-/*=============*/
+ibuf_inside(
+/*========*/
+ const mtr_t* mtr) /*!< in: mini-transaction */
+ __attribute__((nonnull, pure));
/***********************************************************************//**
Checks if a page address is an ibuf bitmap page (level 3 page) address.
@return TRUE if a bitmap page */
@@ -239,15 +262,44 @@ Must not be called when recv_no_ibuf_operations==TRUE.
@return TRUE if level 2 or level 3 page */
UNIV_INTERN
ibool
-ibuf_page(
-/*======*/
- ulint space, /*!< in: space id */
- ulint zip_size,/*!< in: compressed page size in bytes, or 0 */
- ulint page_no,/*!< in: page number */
- mtr_t* mtr); /*!< in: mtr which will contain an x-latch to the
- bitmap page if the page is not one of the fixed
- address ibuf pages, or NULL, in which case a new
- transaction is created. */
+ibuf_page_low(
+/*==========*/
+ ulint space, /*!< in: space id */
+ ulint zip_size,/*!< in: compressed page size in bytes, or 0 */
+ ulint page_no,/*!< in: page number */
+#ifdef UNIV_DEBUG
+ ibool x_latch,/*!< in: FALSE if relaxed check
+ (avoid latching the bitmap page) */
+#endif /* UNIV_DEBUG */
+ const char* file, /*!< in: file name */
+ ulint line, /*!< in: line where called */
+ mtr_t* mtr) /*!< in: mtr which will contain an
+ x-latch to the bitmap page if the page
+ is not one of the fixed address ibuf
+ pages, or NULL, in which case a new
+ transaction is created. */
+ __attribute__((warn_unused_result));
+#ifdef UNIV_DEBUG
+/** Checks if a page is a level 2 or 3 page in the ibuf hierarchy of
+pages. Must not be called when recv_no_ibuf_operations==TRUE.
+@param space tablespace identifier
+@param zip_size compressed page size in bytes, or 0
+@param page_no page number
+@param mtr mini-transaction or NULL
+@return TRUE if level 2 or level 3 page */
+# define ibuf_page(space, zip_size, page_no, mtr) \
+ ibuf_page_low(space, zip_size, page_no, TRUE, __FILE__, __LINE__, mtr)
+#else /* UVIV_DEBUG */
+/** Checks if a page is a level 2 or 3 page in the ibuf hierarchy of
+pages. Must not be called when recv_no_ibuf_operations==TRUE.
+@param space tablespace identifier
+@param zip_size compressed page size in bytes, or 0
+@param page_no page number
+@param mtr mini-transaction or NULL
+@return TRUE if level 2 or level 3 page */
+# define ibuf_page(space, zip_size, page_no, mtr) \
+ ibuf_page_low(space, zip_size, page_no, __FILE__, __LINE__, mtr)
+#endif /* UVIV_DEBUG */
/***********************************************************************//**
Frees excess pages from the ibuf free list. This function is called when an OS
thread calls fsp services to allocate a new file segment, or a new page to a
diff --git a/storage/innobase/include/ibuf0ibuf.ic b/storage/innobase/include/ibuf0ibuf.ic
index e3fa6e3e929..0a22667a260 100644
--- a/storage/innobase/include/ibuf0ibuf.ic
+++ b/storage/innobase/include/ibuf0ibuf.ic
@@ -37,6 +37,30 @@ buffer inserts to this page. If there is this much of free space, the
corresponding bits are set in the ibuf bitmap. */
#define IBUF_PAGE_SIZE_PER_FREE_SPACE 32
+/***************************************************************//**
+Starts an insert buffer mini-transaction. */
+UNIV_INLINE
+void
+ibuf_mtr_start(
+/*===========*/
+ mtr_t* mtr) /*!< out: mini-transaction */
+{
+ mtr_start(mtr);
+ mtr->inside_ibuf = TRUE;
+}
+/***************************************************************//**
+Commits an insert buffer mini-transaction. */
+UNIV_INLINE
+void
+ibuf_mtr_commit(
+/*============*/
+ mtr_t* mtr) /*!< in/out: mini-transaction */
+{
+ ut_ad(mtr->inside_ibuf);
+ ut_d(mtr->inside_ibuf = FALSE);
+ mtr_commit(mtr);
+}
+
/** Insert buffer struct */
struct ibuf_struct{
ulint size; /*!< current size of the ibuf index
@@ -120,6 +144,22 @@ ibuf_should_try(
return(FALSE);
}
+/******************************************************************//**
+Returns TRUE if the current OS thread is performing an insert buffer
+routine.
+
+For instance, a read-ahead of non-ibuf pages is forbidden by threads
+that are executing an insert buffer routine.
+@return TRUE if inside an insert buffer routine */
+UNIV_INLINE
+ibool
+ibuf_inside(
+/*========*/
+ const mtr_t* mtr) /*!< in: mini-transaction */
+{
+ return(mtr->inside_ibuf);
+}
+
/***********************************************************************//**
Checks if a page address is an ibuf bitmap page address.
@return TRUE if a bitmap page */
diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h
index 3eca80beda4..29fdc3bbe97 100644
--- a/storage/innobase/include/lock0lock.h
+++ b/storage/innobase/include/lock0lock.h
@@ -72,9 +72,10 @@ UNIV_INLINE
trx_t*
lock_clust_rec_some_has_impl(
/*=========================*/
- const rec_t* rec, /*!< in: user record */
- dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets);/*!< in: rec_get_offsets(rec, index) */
+ const rec_t* rec, /*!< in: user record */
+ const dict_index_t* index, /*!< in: clustered index */
+ const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ __attribute__((nonnull, warn_unused_result));
/*********************************************************************//**
Gets the heap_no of the smallest user record on a page.
@return heap_no of smallest user record, or PAGE_HEAP_NO_SUPREMUM */
diff --git a/storage/innobase/include/lock0lock.ic b/storage/innobase/include/lock0lock.ic
index 014722f51c4..1d740a5fa43 100644
--- a/storage/innobase/include/lock0lock.ic
+++ b/storage/innobase/include/lock0lock.ic
@@ -75,9 +75,9 @@ UNIV_INLINE
trx_t*
lock_clust_rec_some_has_impl(
/*=========================*/
- const rec_t* rec, /*!< in: user record */
- dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const rec_t* rec, /*!< in: user record */
+ const dict_index_t* index, /*!< in: clustered index */
+ const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
{
trx_id_t trx_id;
diff --git a/storage/innobase/include/log0log.ic b/storage/innobase/include/log0log.ic
index 1ce00fd7313..67db6695cab 100644
--- a/storage/innobase/include/log0log.ic
+++ b/storage/innobase/include/log0log.ic
@@ -435,7 +435,7 @@ log_free_check(void)
{
#ifdef UNIV_SYNC_DEBUG
- ut_ad(sync_thread_levels_empty_gen(TRUE));
+ ut_ad(sync_thread_levels_empty_except_dict());
#endif /* UNIV_SYNC_DEBUG */
if (log_sys->check_flush_or_checkpoint) {
diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic
index cbce2edc661..d214c3fe6c9 100644
--- a/storage/innobase/include/mem0mem.ic
+++ b/storage/innobase/include/mem0mem.ic
@@ -350,27 +350,27 @@ mem_heap_get_top(
ulint n) /*!< in: size of the topmost element */
{
mem_block_t* block;
- void* buf;
+ byte* buf;
ut_ad(mem_heap_check(heap));
block = UT_LIST_GET_LAST(heap->base);
- buf = (byte*)block + mem_block_get_free(block) - MEM_SPACE_NEEDED(n);
+ buf = (byte*) block + mem_block_get_free(block) - MEM_SPACE_NEEDED(n);
#ifdef UNIV_MEM_DEBUG
- ut_ad(mem_block_get_start(block) <=(ulint)((byte*)buf - (byte*)block));
+ ut_ad(mem_block_get_start(block) <= (ulint) (buf - (byte*) block));
/* In the debug version, advance buf to point at the storage which
was given to the caller in the allocation*/
- buf = (byte*)buf + MEM_FIELD_HEADER_SIZE;
+ buf += MEM_FIELD_HEADER_SIZE;
/* Check that the field lengths agree */
- ut_ad(n == (ulint)mem_field_header_get_len(buf));
+ ut_ad(n == mem_field_header_get_len(buf));
#endif
- return(buf);
+ return((void*) buf);
}
/*****************************************************************//**
diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h
index 8abca093548..5582ad63039 100644
--- a/storage/innobase/include/mtr0mtr.h
+++ b/storage/innobase/include/mtr0mtr.h
@@ -190,21 +190,21 @@ functions). The page number parameter was originally written as 0. @{ */
/* @} */
/***************************************************************//**
-Starts a mini-transaction and creates a mini-transaction handle
-and buffer in the memory buffer given by the caller.
-@return mtr buffer which also acts as the mtr handle */
+Starts a mini-transaction. */
UNIV_INLINE
-mtr_t*
+void
mtr_start(
/*======*/
- mtr_t* mtr); /*!< in: memory buffer for the mtr buffer */
+ mtr_t* mtr) /*!< out: mini-transaction */
+ __attribute__((nonnull));
/***************************************************************//**
Commits a mini-transaction. */
UNIV_INTERN
void
mtr_commit(
/*=======*/
- mtr_t* mtr); /*!< in: mini-transaction */
+ mtr_t* mtr) /*!< in/out: mini-transaction */
+ __attribute__((nonnull));
/**********************************************************//**
Sets and returns a savepoint in mtr.
@return savepoint */
@@ -378,6 +378,8 @@ struct mtr_struct{
#endif
dyn_array_t memo; /*!< memo stack for locks etc. */
dyn_array_t log; /*!< mini-transaction log */
+ ibool inside_ibuf;
+ /*!< TRUE if inside ibuf changes */
ibool modifications;
/* TRUE if the mtr made modifications to
buffer pool pages */
diff --git a/storage/innobase/include/mtr0mtr.ic b/storage/innobase/include/mtr0mtr.ic
index 18f8e87b3cf..1db4a4bd735 100644
--- a/storage/innobase/include/mtr0mtr.ic
+++ b/storage/innobase/include/mtr0mtr.ic
@@ -30,26 +30,25 @@ Created 11/26/1995 Heikki Tuuri
#include "mach0data.h"
/***************************************************************//**
-Starts a mini-transaction and creates a mini-transaction handle
-and a buffer in the memory buffer given by the caller.
-@return mtr buffer which also acts as the mtr handle */
+Starts a mini-transaction. */
UNIV_INLINE
-mtr_t*
+void
mtr_start(
/*======*/
- mtr_t* mtr) /*!< in: memory buffer for the mtr buffer */
+ mtr_t* mtr) /*!< out: mini-transaction */
{
+ UNIV_MEM_INVALID(mtr, sizeof *mtr);
+
dyn_array_create(&(mtr->memo));
dyn_array_create(&(mtr->log));
mtr->log_mode = MTR_LOG_ALL;
mtr->modifications = FALSE;
+ mtr->inside_ibuf = FALSE;
mtr->n_log_recs = 0;
ut_d(mtr->state = MTR_ACTIVE);
ut_d(mtr->magic_n = MTR_MAGIC_N);
-
- return(mtr);
}
/***************************************************//**
@@ -160,7 +159,7 @@ mtr_memo_contains(
while (offset > 0) {
offset -= sizeof(mtr_memo_slot_t);
- slot = dyn_array_get_element(memo, offset);
+ slot = (mtr_memo_slot_t*) dyn_array_get_element(memo, offset);
if ((object == slot->object) && (type == slot->type)) {
diff --git a/storage/innobase/include/mysql_addons.h b/storage/innobase/include/mysql_addons.h
deleted file mode 100644
index 17660c18710..00000000000
--- a/storage/innobase/include/mysql_addons.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 2007, 2009, Innobase Oy. All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
-
-*****************************************************************************/
-
-/**************************************************//**
-@file include/mysql_addons.h
-This file contains functions that need to be added to
-MySQL code but have not been added yet.
-
-Whenever you add a function here submit a MySQL bug
-report (feature request) with the implementation. Then
-write the bug number in the comment before the
-function in this file.
-
-When MySQL commits the function it can be deleted from
-here. In a perfect world this file exists but is empty.
-
-Created November 07, 2007 Vasil Dimov
-*******************************************************/
diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
index 6d95b280330..fb13120a481 100644
--- a/storage/innobase/include/os0file.h
+++ b/storage/innobase/include/os0file.h
@@ -373,6 +373,7 @@ typedef HANDLE os_file_dir_t; /*!< directory stream */
typedef DIR* os_file_dir_t; /*!< directory stream */
#endif
+#ifdef __WIN__
/***********************************************************************//**
Gets the operating system version. Currently works only on Windows.
@return OS_WIN95, OS_WIN31, OS_WINNT, OS_WIN2000, OS_WINXP, OS_WINVISTA,
@@ -381,6 +382,7 @@ UNIV_INTERN
ulint
os_get_os_version(void);
/*===================*/
+#endif /* __WIN__ */
#ifndef UNIV_HOTBACKUP
/****************************************************************//**
Creates the seek mutexes used in positioned reads and writes. */
diff --git a/storage/innobase/include/os0sync.h b/storage/innobase/include/os0sync.h
index ec5ccee3e27..1b98f94f641 100644
--- a/storage/innobase/include/os0sync.h
+++ b/storage/innobase/include/os0sync.h
@@ -76,6 +76,12 @@ struct os_event_struct {
/*!< list of all created events */
};
+/** Denotes an infinite delay for os_event_wait_time() */
+#define OS_SYNC_INFINITE_TIME ULINT_UNDEFINED
+
+/** Return value of os_event_wait_time() when the time is exceeded */
+#define OS_SYNC_TIME_EXCEEDED 1
+
/** Operating system mutex */
typedef struct os_mutex_struct os_mutex_str_t;
/** Operating system mutex handle */
@@ -144,10 +150,7 @@ os_event_free(
os_event_t event); /*!< in: event to free */
/**********************************************************//**
-Waits for an event object until it is in the signaled state. If
-srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS this also exits the
-waiting thread when the event becomes signaled (or immediately if the
-event is already in the signaled state).
+Waits for an event object until it is in the signaled state.
Typically, if the event has been signalled after the os_event_reset()
we'll return immediately because event->is_set == TRUE.
@@ -173,7 +176,23 @@ os_event_wait_low(
os_event_reset(). */
#define os_event_wait(event) os_event_wait_low(event, 0)
+#define os_event_wait_time(e, t) os_event_wait_time_low(event, t, 0)
+/**********************************************************//**
+Waits for an event object until it is in the signaled state or
+a timeout is exceeded. In Unix the timeout is always infinite.
+@return 0 if success, OS_SYNC_TIME_EXCEEDED if timeout was exceeded */
+UNIV_INTERN
+ulint
+os_event_wait_time_low(
+/*===================*/
+ os_event_t event, /*!< in: event to wait */
+ ulint time_in_usec, /*!< in: timeout in
+ microseconds, or
+ OS_SYNC_INFINITE_TIME */
+ ib_int64_t reset_sig_count); /*!< in: zero or the value
+ returned by previous call of
+ os_event_reset(). */
/*********************************************************//**
Creates an operating system mutex semaphore. Because these are slow, the
mutex semaphore of InnoDB itself (mutex_t) should be used where possible.
diff --git a/storage/innobase/include/os0thread.h b/storage/innobase/include/os0thread.h
index cc56e2158ee..df3cdb7728e 100644
--- a/storage/innobase/include/os0thread.h
+++ b/storage/innobase/include/os0thread.h
@@ -107,8 +107,9 @@ UNIV_INTERN
void
os_thread_exit(
/*===========*/
- void* exit_value); /*!< in: exit value; in Windows this void*
+ void* exit_value) /*!< in: exit value; in Windows this void*
is cast as a DWORD */
+ UNIV_COLD __attribute__((noreturn));
/*****************************************************************//**
Returns the thread identifier of current thread.
@return current thread identifier */
@@ -117,13 +118,6 @@ os_thread_id_t
os_thread_get_curr_id(void);
/*========================*/
/*****************************************************************//**
-Returns handle to the current thread.
-@return current thread handle */
-UNIV_INTERN
-os_thread_t
-os_thread_get_curr(void);
-/*====================*/
-/*****************************************************************//**
Advises the os to give up remainder of the thread's time slice. */
UNIV_INTERN
void
@@ -136,29 +130,6 @@ void
os_thread_sleep(
/*============*/
ulint tm); /*!< in: time in microseconds */
-/******************************************************************//**
-Gets a thread priority.
-@return priority */
-UNIV_INTERN
-ulint
-os_thread_get_priority(
-/*===================*/
- os_thread_t handle);/*!< in: OS handle to the thread */
-/******************************************************************//**
-Sets a thread priority. */
-UNIV_INTERN
-void
-os_thread_set_priority(
-/*===================*/
- os_thread_t handle, /*!< in: OS handle to the thread */
- ulint pri); /*!< in: priority: one of OS_PRIORITY_... */
-/******************************************************************//**
-Gets the last operating system error code for the calling thread.
-@return last error on Windows, 0 otherwise */
-UNIV_INTERN
-ulint
-os_thread_get_last_error(void);
-/*==========================*/
#ifndef UNIV_NONINL
#include "os0thread.ic"
diff --git a/storage/innobase/include/page0page.h b/storage/innobase/include/page0page.h
index 826fd13125d..7091d8c2707 100644
--- a/storage/innobase/include/page0page.h
+++ b/storage/innobase/include/page0page.h
@@ -618,18 +618,19 @@ rec_t*
page_rec_find_owner_rec(
/*====================*/
rec_t* rec); /*!< in: the physical record */
+#ifndef UNIV_HOTBACKUP
/***********************************************************************//**
-This is a low-level operation which is used in a database index creation
-to update the page number of a created B-tree to a data dictionary
-record. */
-UNIV_INTERN
+Write a 32-bit field in a data dictionary record. */
+UNIV_INLINE
void
-page_rec_write_index_page_no(
-/*=========================*/
- rec_t* rec, /*!< in: record to update */
+page_rec_write_field(
+/*=================*/
+ rec_t* rec, /*!< in/out: record to update */
ulint i, /*!< in: index of the field to update */
- ulint page_no,/*!< in: value to write */
- mtr_t* mtr); /*!< in: mtr */
+ ulint val, /*!< in: value to write */
+ mtr_t* mtr) /*!< in/out: mini-transaction */
+ __attribute__((nonnull));
+#endif /* !UNIV_HOTBACKUP */
/************************************************************//**
Returns the maximum combined size of records which can be inserted on top
of record heap.
@@ -952,7 +953,7 @@ UNIV_INTERN
ibool
page_rec_validate(
/*==============*/
- rec_t* rec, /*!< in: physical record */
+ const rec_t* rec, /*!< in: physical record */
const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
/***************************************************************//**
Checks that the first directory slot points to the infimum record and
@@ -972,7 +973,7 @@ UNIV_INTERN
ibool
page_simple_validate_old(
/*=====================*/
- page_t* page); /*!< in: old-style index page */
+ const page_t* page); /*!< in: index page in ROW_FORMAT=REDUNDANT */
/***************************************************************//**
This function checks the consistency of an index page when we do not
know the index. This is also resilient so that this should never crash
@@ -982,7 +983,7 @@ UNIV_INTERN
ibool
page_simple_validate_new(
/*=====================*/
- page_t* block); /*!< in: new-style index page */
+ const page_t* page); /*!< in: index page in ROW_FORMAT!=REDUNDANT */
/***************************************************************//**
This function checks the consistency of an index page.
@return TRUE if ok */
@@ -990,7 +991,7 @@ UNIV_INTERN
ibool
page_validate(
/*==========*/
- page_t* page, /*!< in: index page */
+ const page_t* page, /*!< in: index page */
dict_index_t* index); /*!< in: data dictionary index containing
the page record type definition */
/***************************************************************//**
diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic
index e9624c2360f..115cee64f8b 100644
--- a/storage/innobase/include/page0page.ic
+++ b/storage/innobase/include/page0page.ic
@@ -959,6 +959,29 @@ page_get_free_space_of_empty(
- 2 * PAGE_DIR_SLOT_SIZE));
}
+#ifndef UNIV_HOTBACKUP
+/***********************************************************************//**
+Write a 32-bit field in a data dictionary record. */
+UNIV_INLINE
+void
+page_rec_write_field(
+/*=================*/
+ rec_t* rec, /*!< in/out: record to update */
+ ulint i, /*!< in: index of the field to update */
+ ulint val, /*!< in: value to write */
+ mtr_t* mtr) /*!< in/out: mini-transaction */
+{
+ byte* data;
+ ulint len;
+
+ data = rec_get_nth_field_old(rec, i, &len);
+
+ ut_ad(len == 4);
+
+ mlog_write_ulint(data, val, MLOG_4BYTES, mtr);
+}
+#endif /* !UNIV_HOTBACKUP */
+
/************************************************************//**
Each user record on a page, and also the deleted user records in the heap
takes its size plus the fraction of the dir cell size /
diff --git a/storage/innobase/include/page0zip.h b/storage/innobase/include/page0zip.h
index 574809e5227..00c1d0516e6 100644
--- a/storage/innobase/include/page0zip.h
+++ b/storage/innobase/include/page0zip.h
@@ -420,7 +420,7 @@ page_zip_copy_recs(
const page_t* src, /*!< in: page */
dict_index_t* index, /*!< in: index of the B-tree */
mtr_t* mtr) /*!< in: mini-transaction */
- __attribute__((nonnull(1,2,3,4)));
+ __attribute__((nonnull));
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//**
diff --git a/storage/innobase/include/rem0cmp.h b/storage/innobase/include/rem0cmp.h
index 2f751a38864..a908521c9f7 100644
--- a/storage/innobase/include/rem0cmp.h
+++ b/storage/innobase/include/rem0cmp.h
@@ -165,6 +165,10 @@ cmp_rec_rec_with_match(
const ulint* offsets1,/*!< in: rec_get_offsets(rec1, index) */
const ulint* offsets2,/*!< in: rec_get_offsets(rec2, index) */
dict_index_t* index, /*!< in: data dictionary index */
+ ibool nulls_unequal,
+ /* in: TRUE if this is for index statistics
+ cardinality estimation, and innodb_stats_method
+ is "nulls_unequal" or "nulls_ignored" */
ulint* matched_fields, /*!< in/out: number of already completely
matched fields; when the function returns,
contains the value the for current
diff --git a/storage/innobase/include/rem0cmp.ic b/storage/innobase/include/rem0cmp.ic
index 39ef5f4fba3..63415fe7837 100644
--- a/storage/innobase/include/rem0cmp.ic
+++ b/storage/innobase/include/rem0cmp.ic
@@ -87,5 +87,5 @@ cmp_rec_rec(
ulint match_b = 0;
return(cmp_rec_rec_with_match(rec1, rec2, offsets1, offsets2, index,
- &match_f, &match_b));
+ FALSE, &match_f, &match_b));
}
diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h
index 53402e8d3a9..10b74d18c13 100644
--- a/storage/innobase/include/rem0rec.h
+++ b/storage/innobase/include/rem0rec.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -480,6 +480,18 @@ ulint
rec_offs_any_extern(
/*================*/
const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
+#ifdef UNIV_BLOB_NULL_DEBUG
+/******************************************************//**
+Determine if the offsets are for a record containing null BLOB pointers.
+@return first field containing a null BLOB pointer, or NULL if none found */
+UNIV_INLINE
+const byte*
+rec_offs_any_null_extern(
+/*=====================*/
+ const rec_t* rec, /*!< in: record */
+ const ulint* offsets) /*!< in: rec_get_offsets(rec) */
+ __attribute__((nonnull, warn_unused_result));
+#endif /* UNIV_BLOB_NULL_DEBUG */
/******************************************************//**
Returns nonzero if the extern bit is set in nth field of rec.
@return nonzero if externally stored */
@@ -600,6 +612,7 @@ ulint
rec_offs_size(
/*==========*/
const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
+#ifdef UNIV_DEBUG
/**********************************************************//**
Returns a pointer to the start of the record.
@return pointer to start */
@@ -607,7 +620,7 @@ UNIV_INLINE
byte*
rec_get_start(
/*==========*/
- rec_t* rec, /*!< in: pointer to record */
+ const rec_t* rec, /*!< in: pointer to record */
const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
/**********************************************************//**
Returns a pointer to the end of the record.
@@ -616,8 +629,12 @@ UNIV_INLINE
byte*
rec_get_end(
/*========*/
- rec_t* rec, /*!< in: pointer to record */
+ const rec_t* rec, /*!< in: pointer to record */
const ulint* offsets);/*!< in: array returned by rec_get_offsets() */
+#else /* UNIV_DEBUG */
+# define rec_get_start(rec, offsets) ((rec) - rec_offs_extra_size(offsets))
+# define rec_get_end(rec, offsets) ((rec) + rec_offs_data_size(offsets))
+#endif /* UNIV_DEBUG */
/***************************************************************//**
Copies a physical record to a buffer.
@return pointer to the origin of the copy */
@@ -801,13 +818,11 @@ UNIV_INTERN
void
rec_print(
/*======*/
- FILE* file, /*!< in: file where to print */
- const rec_t* rec, /*!< in: physical record */
- dict_index_t* index); /*!< in: record descriptor */
+ FILE* file, /*!< in: file where to print */
+ const rec_t* rec, /*!< in: physical record */
+ const dict_index_t* index); /*!< in: record descriptor */
#endif /* UNIV_HOTBACKUP */
-#define REC_INFO_BITS 6 /* This is single byte bit-field */
-
/* Maximum lengths for the data in a physical record if the offsets
are given in one byte (resp. two byte) format. */
#define REC_1BYTE_OFFS_LIMIT 0x7FUL
diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic
index ba306eaf27f..dc8ed515c30 100644
--- a/storage/innobase/include/rem0rec.ic
+++ b/storage/innobase/include/rem0rec.ic
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -26,6 +26,7 @@ Created 5/30/1994 Heikki Tuuri
#include "mach0data.h"
#include "ut0byte.h"
#include "dict0dict.h"
+#include "btr0types.h"
/* Compact flag ORed to the extra size returned by rec_get_offsets() */
#define REC_OFFS_COMPACT ((ulint) 1 << 31)
@@ -1087,6 +1088,44 @@ rec_offs_any_extern(
return(UNIV_UNLIKELY(*rec_offs_base(offsets) & REC_OFFS_EXTERNAL));
}
+#ifdef UNIV_BLOB_NULL_DEBUG
+/******************************************************//**
+Determine if the offsets are for a record containing null BLOB pointers.
+@return first field containing a null BLOB pointer, or NULL if none found */
+UNIV_INLINE
+const byte*
+rec_offs_any_null_extern(
+/*=====================*/
+ const rec_t* rec, /*!< in: record */
+ const ulint* offsets) /*!< in: rec_get_offsets(rec) */
+{
+ ulint i;
+ ut_ad(rec_offs_validate(rec, NULL, offsets));
+
+ if (!rec_offs_any_extern(offsets)) {
+ return(NULL);
+ }
+
+ for (i = 0; i < rec_offs_n_fields(offsets); i++) {
+ if (rec_offs_nth_extern(offsets, i)) {
+ ulint len;
+ const byte* field
+ = rec_get_nth_field(rec, offsets, i, &len);
+
+ ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
+ if (!memcmp(field + len
+ - BTR_EXTERN_FIELD_REF_SIZE,
+ field_ref_zero,
+ BTR_EXTERN_FIELD_REF_SIZE)) {
+ return(field);
+ }
+ }
+ }
+
+ return(NULL);
+}
+#endif /* UNIV_BLOB_NULL_DEBUG */
+
/******************************************************//**
Returns nonzero if the extern bit is set in nth field of rec.
@return nonzero if externally stored */
@@ -1462,6 +1501,7 @@ rec_offs_size(
return(rec_offs_data_size(offsets) + rec_offs_extra_size(offsets));
}
+#ifdef UNIV_DEBUG
/**********************************************************//**
Returns a pointer to the end of the record.
@return pointer to end */
@@ -1469,11 +1509,11 @@ UNIV_INLINE
byte*
rec_get_end(
/*========*/
- rec_t* rec, /*!< in: pointer to record */
+ const rec_t* rec, /*!< in: pointer to record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
{
ut_ad(rec_offs_validate(rec, NULL, offsets));
- return(rec + rec_offs_data_size(offsets));
+ return((rec_t*) rec + rec_offs_data_size(offsets));
}
/**********************************************************//**
@@ -1483,12 +1523,13 @@ UNIV_INLINE
byte*
rec_get_start(
/*==========*/
- rec_t* rec, /*!< in: pointer to record */
+ const rec_t* rec, /*!< in: pointer to record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
{
ut_ad(rec_offs_validate(rec, NULL, offsets));
- return(rec - rec_offs_extra_size(offsets));
+ return((rec_t*) rec - rec_offs_extra_size(offsets));
}
+#endif /* UNIV_DEBUG */
/***************************************************************//**
Copies a physical record to a buffer.
diff --git a/storage/innobase/include/rem0types.h b/storage/innobase/include/rem0types.h
index 8b84d4af233..7afd595be90 100644
--- a/storage/innobase/include/rem0types.h
+++ b/storage/innobase/include/rem0types.h
@@ -34,13 +34,21 @@ typedef byte rec_t;
#define REC_MAX_HEAP_NO (2 * 8192 - 1)
#define REC_MAX_N_OWNED (16 - 1)
-/* REC_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.
+/* REC_ANTELOPE_MAX_INDEX_COL_LEN is measured in bytes and is the maximum
+indexed field length (or indexed prefix length) for indexes on tables of
+ROW_FORMAT=REDUNDANT and ROW_FORMAT=COMPACT format.
+Before we support UTF-8 encodings with mbmaxlen = 4, a UTF-8 character
+may take at most 3 bytes. So the limit was 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.
This constant MUST NOT BE CHANGED, or the compatibility of InnoDB data
files would be at risk! */
-#define REC_MAX_INDEX_COL_LEN 768
+#define REC_ANTELOPE_MAX_INDEX_COL_LEN 768
+
+/** Maximum indexed field length for table format DICT_TF_FORMAT_ZIP and
+beyond.
+This (3072) is the maximum index row length allowed, so we cannot create index
+prefix column longer than that. */
+#define REC_VERSION_56_MAX_INDEX_COL_LEN 3072
#endif
diff --git a/storage/innobase/include/row0ext.h b/storage/innobase/include/row0ext.h
index 43d82d644e6..557da2c4a82 100644
--- a/storage/innobase/include/row0ext.h
+++ b/storage/innobase/include/row0ext.h
@@ -30,6 +30,7 @@ Created September 2006 Marko Makela
#include "row0types.h"
#include "data0types.h"
#include "mem0mem.h"
+#include "dict0types.h"
/********************************************************************//**
Creates a cache of column prefixes of externally stored columns.
@@ -43,13 +44,13 @@ row_ext_create(
in the InnoDB table object, as reported by
dict_col_get_no(); NOT relative to the records
in the clustered index */
+ ulint flags, /*!< in: table->flags */
const dtuple_t* tuple, /*!< in: data tuple containing the field
references of the externally stored
columns; must be indexed by col_no;
the clustered index record must be
covered by a lock or a page latch
to prevent deletion (rollback or purge). */
- ulint zip_size,/*!< compressed page size in bytes, or 0 */
mem_heap_t* heap); /*!< in: heap where created */
/********************************************************************//**
@@ -63,7 +64,8 @@ row_ext_lookup_ith(
const row_ext_t* ext, /*!< in/out: column prefix cache */
ulint i, /*!< in: index of ext->ext[] */
ulint* len); /*!< out: length of prefix, in bytes,
- at most REC_MAX_INDEX_COL_LEN */
+ at most the length determined by
+ DICT_MAX_FIELD_LEN_BY_FORMAT() */
/********************************************************************//**
Looks up a column prefix of an externally stored column.
@return column prefix, or NULL if the column is not stored externally,
@@ -78,13 +80,18 @@ row_ext_lookup(
dict_col_get_no(); NOT relative to the
records in the clustered index */
ulint* len); /*!< out: length of prefix, in bytes,
- at most REC_MAX_INDEX_COL_LEN */
+ at most the length determined by
+ DICT_MAX_FIELD_LEN_BY_FORMAT() */
/** Prefixes of externally stored columns */
struct row_ext_struct{
ulint n_ext; /*!< number of externally stored columns */
const ulint* ext; /*!< col_no's of externally stored columns */
byte* buf; /*!< backing store of the column prefix cache */
+ ulint max_len;/*!< maximum prefix length, it could be
+ REC_ANTELOPE_MAX_INDEX_COL_LEN or
+ REC_VERSION_56_MAX_INDEX_COL_LEN depending
+ on row format */
ulint len[1]; /*!< prefix lengths; 0 if not cached */
};
diff --git a/storage/innobase/include/row0ext.ic b/storage/innobase/include/row0ext.ic
index 82771a9312a..466046b2821 100644
--- a/storage/innobase/include/row0ext.ic
+++ b/storage/innobase/include/row0ext.ic
@@ -37,7 +37,7 @@ row_ext_lookup_ith(
const row_ext_t* ext, /*!< in/out: column prefix cache */
ulint i, /*!< in: index of ext->ext[] */
ulint* len) /*!< out: length of prefix, in bytes,
- at most REC_MAX_INDEX_COL_LEN */
+ at most ext->max_len */
{
ut_ad(ext);
ut_ad(len);
@@ -45,11 +45,14 @@ row_ext_lookup_ith(
*len = ext->len[i];
+ ut_ad(*len <= ext->max_len);
+ ut_ad(ext->max_len > 0);
+
if (UNIV_UNLIKELY(*len == 0)) {
/* The BLOB could not be fetched to the cache. */
return(field_ref_zero);
} else {
- return(ext->buf + i * REC_MAX_INDEX_COL_LEN);
+ return(ext->buf + i * ext->max_len);
}
}
@@ -67,7 +70,7 @@ row_ext_lookup(
dict_col_get_no(); NOT relative to the
records in the clustered index */
ulint* len) /*!< out: length of prefix, in bytes,
- at most REC_MAX_INDEX_COL_LEN */
+ at most ext->max_len */
{
ulint i;
diff --git a/storage/innobase/include/row0ins.h b/storage/innobase/include/row0ins.h
index 9f93565ddb7..810973e61a7 100644
--- a/storage/innobase/include/row0ins.h
+++ b/storage/innobase/include/row0ins.h
@@ -84,9 +84,10 @@ ulint
row_ins_index_entry(
/*================*/
dict_index_t* index, /*!< in: index */
- dtuple_t* entry, /*!< in: index entry to insert */
+ dtuple_t* entry, /*!< in/out: index entry to insert */
ulint n_ext, /*!< in: number of externally stored columns */
- ibool foreign,/*!< in: TRUE=check foreign key constraints */
+ ibool foreign,/*!< in: TRUE=check foreign key constraints
+ (foreign=FALSE only during CREATE INDEX) */
que_thr_t* thr); /*!< in: query thread */
/***********************************************************//**
Inserts a row to a table. This is a high-level function used in
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index d9c26a2ee3b..dd619406ab9 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -538,6 +538,10 @@ struct mysql_row_templ_struct {
Innobase record in the current index;
not defined if template_type is
ROW_MYSQL_WHOLE_ROW */
+ ulint clust_rec_field_no; /*!< field number of the column in an
+ Innobase record in the clustered index;
+ not defined if template_type is
+ ROW_MYSQL_WHOLE_ROW */
ulint mysql_col_offset; /*!< offset of the column in the MySQL
row format */
ulint mysql_col_len; /*!< length of the column in the MySQL
diff --git a/storage/innobase/include/row0row.h b/storage/innobase/include/row0row.h
index 195691a420b..75e15d67246 100644
--- a/storage/innobase/include/row0row.h
+++ b/storage/innobase/include/row0row.h
@@ -41,13 +41,24 @@ Created 4/20/1996 Heikki Tuuri
Gets the offset of the trx id field, in bytes relative to the origin of
a clustered index record.
@return offset of DATA_TRX_ID */
-UNIV_INTERN
+UNIV_INLINE
ulint
-row_get_trx_id_offset(
-/*==================*/
- const rec_t* rec, /*!< in: record */
- dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets);/*!< in: rec_get_offsets(rec, index) */
+row_get_trx_id_offset_func(
+/*=======================*/
+#ifdef UNIV_DEBUG
+ const rec_t* rec, /*!< in: record */
+#endif /* UNIV_DEBUG */
+ const dict_index_t* index, /*!< in: clustered index */
+ const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ __attribute__((nonnull, warn_unused_result));
+#ifdef UNIV_DEBUG
+# define row_get_trx_id_offset(rec, index, offsets) \
+ row_get_trx_id_offset_func(rec, index, offsets)
+#else /* UNIV_DEBUG */
+# define row_get_trx_id_offset(rec, index, offsets) \
+ row_get_trx_id_offset_func(index, offsets)
+#endif /* UNIV_DEBUG */
+
/*********************************************************************//**
Reads the trx id field from a clustered index record.
@return value of the field */
@@ -55,9 +66,10 @@ UNIV_INLINE
trx_id_t
row_get_rec_trx_id(
/*===============*/
- const rec_t* rec, /*!< in: record */
- dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets);/*!< in: rec_get_offsets(rec, index) */
+ const rec_t* rec, /*!< in: record */
+ const dict_index_t* index, /*!< in: clustered index */
+ const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ __attribute__((nonnull, warn_unused_result));
/*********************************************************************//**
Reads the roll pointer field from a clustered index record.
@return value of the field */
@@ -267,7 +279,7 @@ enum row_search_result {
secondary index leaf page was not in
the buffer pool, and the operation was
enqueued in the insert/delete buffer */
- ROW_NOT_DELETED_REF, /*!< BTR_DELETE was specified, and
+ ROW_NOT_DELETED_REF /*!< BTR_DELETE was specified, and
row_purge_poss_sec() failed */
};
diff --git a/storage/innobase/include/row0row.ic b/storage/innobase/include/row0row.ic
index 05c007641af..9d19e430e16 100644
--- a/storage/innobase/include/row0row.ic
+++ b/storage/innobase/include/row0row.ic
@@ -28,15 +28,45 @@ Created 4/20/1996 Heikki Tuuri
#include "trx0undo.h"
/*********************************************************************//**
+Gets the offset of trx id field, in bytes relative to the origin of
+a clustered index record.
+@return offset of DATA_TRX_ID */
+UNIV_INLINE
+ulint
+row_get_trx_id_offset_func(
+/*=======================*/
+#ifdef UNIV_DEBUG
+ const rec_t* rec, /*!< in: record */
+#endif /* UNIV_DEBUG */
+ const dict_index_t* index, /*!< in: clustered index */
+ const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+{
+ ulint pos;
+ ulint offset;
+ ulint len;
+
+ ut_ad(dict_index_is_clust(index));
+ ut_ad(rec_offs_validate(rec, index, offsets));
+
+ pos = dict_index_get_sys_col_pos(index, DATA_TRX_ID);
+
+ offset = rec_get_nth_field_offs(offsets, pos, &len);
+
+ ut_ad(len == DATA_TRX_ID_LEN);
+
+ return(offset);
+}
+
+/*********************************************************************//**
Reads the trx id field from a clustered index record.
@return value of the field */
UNIV_INLINE
trx_id_t
row_get_rec_trx_id(
/*===============*/
- const rec_t* rec, /*!< in: record */
- dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
+ const rec_t* rec, /*!< in: record */
+ const dict_index_t* index, /*!< in: clustered index */
+ const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
{
ulint offset;
diff --git a/storage/innobase/include/row0upd.h b/storage/innobase/include/row0upd.h
index f7bec6f7561..c275c1da78e 100644
--- a/storage/innobase/include/row0upd.h
+++ b/storage/innobase/include/row0upd.h
@@ -126,8 +126,8 @@ UNIV_INTERN
void
row_upd_index_entry_sys_field(
/*==========================*/
- const dtuple_t* entry, /*!< in: index entry, where the memory buffers
- for sys fields are already allocated:
+ dtuple_t* entry, /*!< in/out: index entry, where the memory
+ buffers for sys fields are already allocated:
the function just copies the new values to
them */
dict_index_t* index, /*!< in: clustered index */
@@ -167,8 +167,11 @@ row_upd_changes_field_size_or_external(
const upd_t* update);/*!< in: update vector */
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
-Replaces the new column values stored in the update vector to the record
-given. No field size changes are allowed. */
+Replaces the new column values stored in the update vector to the
+record given. No field size changes are allowed. This function is
+usually invoked on a clustered index. The only use case for a
+secondary index is row_ins_sec_index_entry_by_modify() or its
+counterpart in ibuf_insert_to_index_page(). */
UNIV_INTERN
void
row_upd_rec_in_place(
@@ -277,16 +280,29 @@ NOTE: we compare the fields as binary strings!
@return TRUE if update vector changes an ordering field in the index record */
UNIV_INTERN
ibool
-row_upd_changes_ord_field_binary(
-/*=============================*/
+row_upd_changes_ord_field_binary_func(
+/*==================================*/
+ dict_index_t* index, /*!< in: index of the record */
+ const upd_t* update, /*!< in: update vector for the row; NOTE: the
+ field numbers in this MUST be clustered index
+ positions! */
+#ifdef UNIV_DEBUG
+ const que_thr_t*thr, /*!< in: query thread */
+#endif /* UNIV_DEBUG */
const dtuple_t* row, /*!< in: old value of row, or NULL if the
row and the data values in update are not
known when this function is called, e.g., at
compile time */
- dict_index_t* index, /*!< in: index of the record */
- const upd_t* update);/*!< in: update vector for the row; NOTE: the
- field numbers in this MUST be clustered index
- positions! */
+ const row_ext_t*ext) /*!< NULL, or prefixes of the externally
+ stored columns in the old row */
+ __attribute__((nonnull(1,2), warn_unused_result));
+#ifdef UNIV_DEBUG
+# define row_upd_changes_ord_field_binary(index,update,thr,row,ext) \
+ row_upd_changes_ord_field_binary_func(index,update,thr,row,ext)
+#else /* UNIV_DEBUG */
+# define row_upd_changes_ord_field_binary(index,update,thr,row,ext) \
+ row_upd_changes_ord_field_binary_func(index,update,row,ext)
+#endif /* UNIV_DEBUG */
/***********************************************************//**
Checks if an update vector changes an ordering field of an index record.
This function is fast if the update vector is short or the number of ordering
@@ -459,11 +475,16 @@ struct upd_node_struct{
#define UPD_NODE_INSERT_CLUSTERED 3 /* clustered index record should be
inserted, old record is already delete
marked */
-#define UPD_NODE_UPDATE_ALL_SEC 4 /* an ordering field of the clustered
+#define UPD_NODE_INSERT_BLOB 4 /* clustered index record should be
+ inserted, old record is already
+ delete-marked; non-updated BLOBs
+ should be inherited by the new record
+ and disowned by the old record */
+#define UPD_NODE_UPDATE_ALL_SEC 5 /* an ordering field of the clustered
index record was changed, or this is
a delete operation: should update
all the secondary index records */
-#define UPD_NODE_UPDATE_SOME_SEC 5 /* secondary index entries should be
+#define UPD_NODE_UPDATE_SOME_SEC 6 /* secondary index entries should be
looked at and updated if an ordering
field changed */
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index d78c8113aee..fc9401a12f5 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2011, Innobase Oy. All Rights Reserved.
Copyright (c) 2008, 2009, Google Inc.
Copyright (c) 2009, Percona Inc.
@@ -57,14 +57,20 @@ extern const char srv_mysql50_table_name_prefix[9];
thread starts running */
extern os_event_t srv_lock_timeout_thread_event;
+/* The monitor thread waits on this event. */
+extern os_event_t srv_monitor_event;
+
+/* The lock timeout thread waits on this event. */
+extern os_event_t srv_timeout_event;
+
+/* The error monitor thread waits on this event. */
+extern os_event_t srv_error_event;
+
/* If the last data file is auto-extended, we add this many pages to it
at a time */
#define SRV_AUTO_EXTEND_INCREMENT \
(srv_auto_extend_increment * ((1024 * 1024) / UNIV_PAGE_SIZE))
-/* This is set to TRUE if the MySQL user has set it in MySQL */
-extern ibool srv_lower_case_table_names;
-
/* Mutex for locking srv_monitor_file */
extern mutex_t srv_monitor_file_mutex;
/* Temporary file for innodb monitor output */
@@ -163,6 +169,11 @@ capacity. PCT_IO(5) -> returns the number of IO operations that
is 5% of the max where max is srv_io_capacity. */
#define PCT_IO(p) ((ulong) (srv_io_capacity * ((double) p / 100.0)))
+/* The "innodb_stats_method" setting, decides how InnoDB is going
+to treat NULL value when collecting statistics. It is not defined
+as enum type because the configure option takes unsigned integer type. */
+extern ulong srv_innodb_stats_method;
+
#ifdef UNIV_LOG_ARCHIVE
extern ibool srv_log_archive_on;
extern ibool srv_archive_recovery;
@@ -225,6 +236,8 @@ extern ulong srv_thread_sleep_delay;
extern ulong srv_spin_wait_delay;
extern ibool srv_priority_boost;
+extern ulint srv_truncated_status_writes;
+
extern ulint srv_mem_pool_size;
extern ulint srv_lock_table_size;
@@ -278,9 +291,12 @@ extern ulint srv_log_waits;
/* the number of purge threads to use from the worker pool (currently 0 or 1) */
extern ulong srv_n_purge_threads;
-/* the number of records to purge in one batch */
+/* the number of pages to purge in one batch */
extern ulong srv_purge_batch_size;
+/* the number of rollback segments to use */
+extern ulong srv_rollback_segments;
+
/* variable that counts amount of data read in total (in bytes) */
extern ulint srv_data_read;
@@ -407,19 +423,24 @@ enum {
in connection with recovery */
};
+/* Alternatives for srv_innodb_stats_method, which could be changed by
+setting innodb_stats_method */
+enum srv_stats_method_name_enum {
+ SRV_STATS_NULLS_EQUAL, /* All NULL values are treated as
+ equal. This is the default setting
+ for innodb_stats_method */
+ SRV_STATS_NULLS_UNEQUAL, /* All NULL values are treated as
+ NOT equal. */
+ SRV_STATS_NULLS_IGNORED /* NULL values are ignored */
+};
+
+typedef enum srv_stats_method_name_enum srv_stats_method_name_t;
+
#ifndef UNIV_HOTBACKUP
/** Types of threads existing in the system. */
enum srv_thread_type {
- SRV_COM = 1, /**< threads serving communication and queries */
- SRV_CONSOLE, /**< thread serving console */
- SRV_WORKER, /**< threads serving parallelized queries and
+ SRV_WORKER = 0, /**< threads serving parallelized queries and
queries released from lock wait */
-#if 0
- /* Utility threads */
- SRV_BUFFER, /**< thread flushing dirty buffer blocks */
- SRV_RECOVERY, /**< threads finishing a recovery */
- SRV_INSERT, /**< thread flushing the insert buffer to disk */
-#endif
SRV_MASTER /**< the master thread, (whose type number must
be biggest) */
};
@@ -458,12 +479,13 @@ ulint
srv_get_n_threads(void);
/*===================*/
/*********************************************************************//**
-Returns the calling thread type.
-@return SRV_COM, ... */
-
-enum srv_thread_type
-srv_get_thread_type(void);
-/*=====================*/
+Check whether thread type has reserved a slot.
+@return slot number or UNDEFINED if not found*/
+UNIV_INTERN
+ulint
+srv_thread_has_reserved_slot(
+/*=========================*/
+ enum srv_thread_type type); /*!< in: thread type to check */
/*********************************************************************//**
Sets the info describing an i/o thread current state. */
UNIV_INTERN
@@ -710,11 +732,12 @@ struct export_var_struct{
ulint innodb_rows_inserted; /*!< srv_n_rows_inserted */
ulint innodb_rows_updated; /*!< srv_n_rows_updated */
ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */
+ ulint innodb_truncated_status_writes; /*!< srv_truncated_status_writes */
};
/** Thread slot in the thread table */
typedef struct srv_slot_struct srv_slot_t;
-
+
/** Thread table is an array of slots */
typedef srv_slot_t srv_table_t;
diff --git a/storage/innobase/include/sync0arr.h b/storage/innobase/include/sync0arr.h
index 5f1280f5e28..6e931346238 100644
--- a/storage/innobase/include/sync0arr.h
+++ b/storage/innobase/include/sync0arr.h
@@ -115,8 +115,11 @@ Prints warnings of long semaphore waits to stderr.
@return TRUE if fatal semaphore wait threshold was exceeded */
UNIV_INTERN
ibool
-sync_array_print_long_waits(void);
-/*=============================*/
+sync_array_print_long_waits(
+/*========================*/
+ os_thread_id_t* waiter, /*!< out: longest waiting thread */
+ const void** sema) /*!< out: longest-waited-for semaphore */
+ __attribute__((nonnull));
/********************************************************************//**
Validates the integrity of the wait array. Checks
that the number of reserved cells equals the count variable. */
diff --git a/storage/innobase/include/sync0rw.h b/storage/innobase/include/sync0rw.h
index 70471186f6d..9e5c96fa323 100644
--- a/storage/innobase/include/sync0rw.h
+++ b/storage/innobase/include/sync0rw.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -122,6 +122,7 @@ extern mysql_pfs_key_t checkpoint_lock_key;
extern mysql_pfs_key_t trx_i_s_cache_lock_key;
extern mysql_pfs_key_t trx_purge_latch_key;
extern mysql_pfs_key_t index_tree_rw_lock_key;
+extern mysql_pfs_key_t dict_table_stats_latch_key;
#endif /* UNIV_PFS_RWLOCK */
@@ -554,6 +555,7 @@ UNIV_INTERN
void
rw_lock_debug_print(
/*================*/
+ FILE* f, /*!< in: output stream */
rw_lock_debug_t* info); /*!< in: debug struct */
#endif /* UNIV_SYNC_DEBUG */
diff --git a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h
index 940e583350a..b823c9d5259 100644
--- a/storage/innobase/include/sync0sync.h
+++ b/storage/innobase/include/sync0sync.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2011, Innobase Oy. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -85,7 +85,6 @@ extern mysql_pfs_key_t hash_table_mutex_key;
extern mysql_pfs_key_t ibuf_bitmap_mutex_key;
extern mysql_pfs_key_t ibuf_mutex_key;
extern mysql_pfs_key_t ibuf_pessimistic_insert_mutex_key;
-extern mysql_pfs_key_t ios_mutex_key;
extern mysql_pfs_key_t log_sys_mutex_key;
extern mysql_pfs_key_t log_flush_order_mutex_key;
extern mysql_pfs_key_t kernel_mutex_key;
@@ -94,7 +93,7 @@ extern mysql_pfs_key_t mem_hash_mutex_key;
# endif /* UNIV_MEM_DEBUG */
extern mysql_pfs_key_t mem_pool_mutex_key;
extern mysql_pfs_key_t mutex_list_mutex_key;
-extern mysql_pfs_key_t purge_sys_mutex_key;
+extern mysql_pfs_key_t purge_sys_bh_mutex_key;
extern mysql_pfs_key_t recv_sys_mutex_key;
extern mysql_pfs_key_t rseg_mutex_key;
# ifdef UNIV_SYNC_DEBUG
@@ -111,7 +110,6 @@ extern mysql_pfs_key_t syn_arr_mutex_key;
extern mysql_pfs_key_t sync_thread_mutex_key;
# endif /* UNIV_SYNC_DEBUG */
extern mysql_pfs_key_t trx_doublewrite_mutex_key;
-extern mysql_pfs_key_t thr_local_mutex_key;
extern mysql_pfs_key_t trx_undo_mutex_key;
#endif /* UNIV_PFS_MUTEX */
@@ -415,13 +413,6 @@ sync_thread_reset_level(
/*====================*/
void* latch); /*!< in: pointer to a mutex or an rw-lock */
/******************************************************************//**
-Checks that the level array for the current thread is empty.
-@return TRUE if empty */
-UNIV_INTERN
-ibool
-sync_thread_levels_empty(void);
-/*==========================*/
-/******************************************************************//**
Checks if the level array for the current thread contains a
mutex or rw-latch at the specified level.
@return a matching latch, or NULL if not found */
@@ -432,17 +423,33 @@ sync_thread_levels_contains(
ulint level); /*!< in: latching order level
(SYNC_DICT, ...)*/
/******************************************************************//**
-Checks if the level array for the current thread is empty.
+Checks that the level array for the current thread is empty.
@return a latch, or NULL if empty except the exceptions specified below */
UNIV_INTERN
void*
sync_thread_levels_nonempty_gen(
/*============================*/
- ibool dict_mutex_allowed); /*!< in: TRUE if dictionary mutex is
- allowed to be owned by the thread,
- also purge_is_running mutex is
- allowed */
-#define sync_thread_levels_empty_gen(d) (!sync_thread_levels_nonempty_gen(d))
+ ibool dict_mutex_allowed) /*!< in: TRUE if dictionary mutex is
+ allowed to be owned by the thread */
+ __attribute__((warn_unused_result));
+/******************************************************************//**
+Checks if the level array for the current thread is empty,
+except for data dictionary latches. */
+#define sync_thread_levels_empty_except_dict() \
+ (!sync_thread_levels_nonempty_gen(TRUE))
+/******************************************************************//**
+Checks if the level array for the current thread is empty,
+except for the btr_search_latch.
+@return a latch, or NULL if empty except the exceptions specified below */
+UNIV_INTERN
+void*
+sync_thread_levels_nonempty_trx(
+/*============================*/
+ ibool has_search_latch)
+ /*!< in: TRUE if and only if the thread
+ is supposed to hold btr_search_latch */
+ __attribute__((warn_unused_result));
+
/******************************************************************//**
Gets the debug information for a reserved mutex. */
UNIV_INTERN
@@ -638,7 +645,6 @@ or row lock! */
#define SYNC_TREE_NODE_NEW 892
#define SYNC_TREE_NODE_FROM_HASH 891
#define SYNC_TREE_NODE 890
-#define SYNC_PURGE_SYS 810
#define SYNC_PURGE_LATCH 800
#define SYNC_TRX_UNDO 700
#define SYNC_RSEG 600
@@ -660,6 +666,7 @@ or row lock! */
#define SYNC_REC_LOCK 299
#define SYNC_TRX_LOCK_HEAP 298
#define SYNC_TRX_SYS_HEADER 290
+#define SYNC_PURGE_QUEUE 200
#define SYNC_LOG 170
#define SYNC_LOG_FLUSH_ORDER 147
#define SYNC_RECV 168
diff --git a/storage/innobase/include/thr0loc.h b/storage/innobase/include/thr0loc.h
deleted file mode 100644
index b7eb29f2ed0..00000000000
--- a/storage/innobase/include/thr0loc.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
-
-*****************************************************************************/
-
-/**************************************************//**
-@file include/thr0loc.h
-The thread local storage
-
-Created 10/5/1995 Heikki Tuuri
-*******************************************************/
-
-/* This module implements storage private to each thread,
-a capability useful in some situations like storing the
-OS handle to the current thread, or its priority. */
-
-#ifndef thr0loc_h
-#define thr0loc_h
-
-#include "univ.i"
-#include "os0thread.h"
-
-/****************************************************************//**
-Initializes the thread local storage module. */
-UNIV_INTERN
-void
-thr_local_init(void);
-/*================*/
- /****************************************************************//**
-Close the thread local storage module. */
-UNIV_INTERN
-void
-thr_local_close(void);
-/*=================*/
-/*******************************************************************//**
-Creates a local storage struct for the calling new thread. */
-UNIV_INTERN
-void
-thr_local_create(void);
-/*==================*/
-/*******************************************************************//**
-Frees the local storage struct for the specified thread. */
-UNIV_INTERN
-void
-thr_local_free(
-/*===========*/
- os_thread_id_t id); /*!< in: thread id */
-/*******************************************************************//**
-Gets the slot number in the thread table of a thread.
-@return slot number */
-UNIV_INTERN
-ulint
-thr_local_get_slot_no(
-/*==================*/
- os_thread_id_t id); /*!< in: thread id of the thread */
-/*******************************************************************//**
-Sets in the local storage the slot number in the thread table of a thread. */
-UNIV_INTERN
-void
-thr_local_set_slot_no(
-/*==================*/
- os_thread_id_t id, /*!< in: thread id of the thread */
- ulint slot_no);/*!< in: slot number */
-/*******************************************************************//**
-Returns pointer to the 'in_ibuf' field within the current thread local
-storage.
-@return pointer to the in_ibuf field */
-UNIV_INTERN
-ibool*
-thr_local_get_in_ibuf_field(void);
-/*=============================*/
-
-#ifndef UNIV_NONINL
-#include "thr0loc.ic"
-#endif
-
-#endif
diff --git a/storage/innobase/include/thr0loc.ic b/storage/innobase/include/thr0loc.ic
deleted file mode 100644
index ce44e512320..00000000000
--- a/storage/innobase/include/thr0loc.ic
+++ /dev/null
@@ -1,24 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
-
-*****************************************************************************/
-
-/**************************************************//**
-@file include/thr0loc.ic
-Thread local storage
-
-Created 10/4/1995 Heikki Tuuri
-*******************************************************/
diff --git a/storage/innobase/include/trx0i_s.h b/storage/innobase/include/trx0i_s.h
index 8f8b7367fb0..73896a3cb76 100644
--- a/storage/innobase/include/trx0i_s.h
+++ b/storage/innobase/include/trx0i_s.h
@@ -140,6 +140,9 @@ struct i_s_trx_row_struct {
ulint trx_mysql_thread_id; /*!< thd_get_thread_id() */
const char* trx_query; /*!< MySQL statement being
executed in the transaction */
+ struct charset_info_st* trx_query_cs;
+ /*!< charset encode the MySQL
+ statement */
const char* trx_operation_state; /*!< trx_struct::op_info */
ulint trx_tables_in_use;/*!< n_mysql_tables_in_use in
trx_struct */
diff --git a/storage/innobase/include/trx0purge.h b/storage/innobase/include/trx0purge.h
index d2730a68a78..0b83a76cab7 100644
--- a/storage/innobase/include/trx0purge.h
+++ b/storage/innobase/include/trx0purge.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Innobase Oy. All Rights Reserved.
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
@@ -68,8 +68,9 @@ Creates the global purge system control structure and inits the history
mutex. */
UNIV_INTERN
void
-trx_purge_sys_create(void);
-/*======================*/
+trx_purge_sys_create(
+/*=================*/
+ ib_bh_t* ib_bh); /*!< in/own: UNDO log min binary heap*/
/********************************************************************//**
Frees the global purge system control structure. */
UNIV_INTERN
@@ -128,20 +129,20 @@ struct trx_purge_struct{
ulint state; /*!< Purge system state */
sess_t* sess; /*!< System session running the purge
query */
- trx_t* trx; /*!< System transaction running the purge
+ trx_t* trx; /*!< System transaction running the
+ purge
query: this trx is not in the trx list
of the trx system and it never ends */
que_t* query; /*!< The query graph which will do the
parallelized purge operation */
- rw_lock_t latch; /*!< The latch protecting the purge view.
- A purge operation must acquire an
- x-latch here for the instant at which
+ rw_lock_t latch; /*!< The latch protecting the purge
+ view. A purge operation must acquire
+ an x-latch here for the instant at which
it changes the purge view: an undo
log operation can prevent this by
obtaining an s-latch here. */
read_view_t* view; /*!< The purge will not remove undo logs
which are >= this view (purge view) */
- mutex_t mutex; /*!< Mutex protecting the fields below */
ulint n_pages_handled;/*!< Approximate number of undo log
pages processed in purge */
ulint handle_limit; /*!< Target of how many pages to get
@@ -179,6 +180,11 @@ struct trx_purge_struct{
mem_heap_t* heap; /*!< Temporary storage used during a
purge: can be emptied after purge
completes */
+ /*-----------------------------*/
+ ib_bh_t* ib_bh; /*!< Binary min-heap, ordered on
+ rseg_queue_t::trx_no. It is protected
+ by the bh_mutex */
+ mutex_t bh_mutex; /*!< Mutex protecting ib_bh */
};
#define TRX_PURGE_ON 1 /* purge operation is running */
diff --git a/storage/innobase/include/trx0rseg.h b/storage/innobase/include/trx0rseg.h
index 78a7a8c4bb0..5acde05de3d 100644
--- a/storage/innobase/include/trx0rseg.h
+++ b/storage/innobase/include/trx0rseg.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Innobase Oy. All Rights Reserved.
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
@@ -113,7 +113,9 @@ void
trx_rseg_list_and_array_init(
/*=========================*/
trx_sysf_t* sys_header, /*!< in: trx system header */
+ ib_bh_t* ib_bh, /*!< in: rseg queue */
mtr_t* mtr); /*!< in: mtr */
+
/***************************************************************************
Free's an instance of the rollback segment in memory. */
UNIV_INTERN
@@ -141,9 +143,7 @@ struct trx_rseg_struct{
ulint id; /*!< rollback segment id == the index of
its slot in the trx system file copy */
mutex_t mutex; /*!< mutex protecting the fields in this
- struct except id; NOTE that the latching
- order must always be kernel mutex ->
- rseg mutex */
+ struct except id, which is constant */
ulint space; /*!< space where the rollback segment is
header is placed */
ulint zip_size;/* compressed page size of space
@@ -182,6 +182,14 @@ struct trx_rseg_struct{
memory objects */
};
+/** For prioritising the rollback segments for purge. */
+struct rseg_queue_struct {
+ trx_id_t trx_no; /*!< trx_rseg_t::last_trx_no */
+ trx_rseg_t* rseg; /*!< Rollback segment */
+};
+
+typedef struct rseg_queue_struct rseg_queue_t;
+
/* Undo log segment slot in a rollback segment header */
/*-------------------------------------------------------------*/
#define TRX_RSEG_SLOT_PAGE_NO 0 /* Page number of the header page of
diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h
index 63e3f6be934..dc0ca2285b9 100644
--- a/storage/innobase/include/trx0sys.h
+++ b/storage/innobase/include/trx0sys.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Innobase Oy. All Rights Reserved.
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
@@ -38,6 +38,7 @@ Created 3/26/1996 Heikki Tuuri
#include "mem0mem.h"
#include "sync0sync.h"
#include "ut0lst.h"
+#include "ut0bh.h"
#include "read0types.h"
#include "page0types.h"
@@ -221,13 +222,6 @@ UNIV_INLINE
trx_id_t
trx_sys_get_new_trx_id(void);
/*========================*/
-/*****************************************************************//**
-Allocates a new transaction number.
-@return new, allocated trx number */
-UNIV_INLINE
-trx_id_t
-trx_sys_get_new_trx_no(void);
-/*========================*/
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************//**
Writes a trx id to an index page. In case that the id size changes in
diff --git a/storage/innobase/include/trx0sys.ic b/storage/innobase/include/trx0sys.ic
index 385c7f4f0cc..355f118a1ec 100644
--- a/storage/innobase/include/trx0sys.ic
+++ b/storage/innobase/include/trx0sys.ic
@@ -369,16 +369,4 @@ trx_sys_get_new_trx_id(void)
return(id);
}
-/*****************************************************************//**
-Allocates a new transaction number.
-@return new, allocated trx number */
-UNIV_INLINE
-trx_id_t
-trx_sys_get_new_trx_no(void)
-/*========================*/
-{
- ut_ad(mutex_own(&kernel_mutex));
-
- return(trx_sys_get_new_trx_id());
-}
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
index 6a817ccdc8e..588ddd65e88 100644
--- a/storage/innobase/include/trx0trx.h
+++ b/storage/innobase/include/trx0trx.h
@@ -44,6 +44,9 @@ extern sess_t* trx_dummy_sess;
/** Number of transactions currently allocated for MySQL: protected by
the kernel mutex */
extern ulint trx_n_mysql_transactions;
+/** Number of transactions currently in the XA PREPARED state: protected by
+the kernel mutex */
+extern ulint trx_n_prepared;
/********************************************************************//**
Releases the search latch if trx has reserved it. */
@@ -108,6 +111,14 @@ trx_free(
/*=====*/
trx_t* trx); /*!< in, own: trx object */
/********************************************************************//**
+At shutdown, frees a transaction object that is in the PREPARED state. */
+UNIV_INTERN
+void
+trx_free_prepared(
+/*==============*/
+ trx_t* trx) /*!< in, own: trx object */
+ UNIV_COLD __attribute__((nonnull));
+/********************************************************************//**
Frees a transaction object for MySQL. */
UNIV_INTERN
void
@@ -214,12 +225,12 @@ trx_recover_for_mysql(
/*******************************************************************//**
This function is used to find one X/Open XA distributed transaction
which is in the prepared state
-@return trx or NULL */
+@return trx or NULL; on match, the trx->xid will be invalidated */
UNIV_INTERN
trx_t *
trx_get_trx_by_xid(
/*===============*/
- XID* xid); /*!< in: X/Open XA transaction identification */
+ const XID* xid); /*!< in: X/Open XA transaction identifier */
/**********************************************************************//**
If required, flushes the log to disk if we called trx_commit_for_mysql()
with trx->flush_log_later == TRUE.
@@ -470,6 +481,20 @@ struct trx_struct{
of view of concurrency control:
TRX_ACTIVE, TRX_COMMITTED_IN_MEMORY,
... */
+ /*------------------------------*/
+ /* MySQL has a transaction coordinator to coordinate two phase
+ commit between multiple storage engines and the binary log. When
+ an engine participates in a transaction, it's responsible for
+ registering itself using the trans_register_ha() API. */
+ unsigned is_registered:1;/* This flag is set to 1 after the
+ transaction has been registered with
+ the coordinator using the XA API, and
+ is set to 0 after commit or rollback. */
+ unsigned owns_prepare_mutex:1;/* 1 if owns prepare mutex, if
+ this is set to 1 then registered should
+ also be set to 1. This is used in the
+ XA code */
+ /*------------------------------*/
ulint isolation_level;/* TRX_ISO_REPEATABLE_READ, ... */
ulint check_foreigns; /* normally TRUE, but if the user
wants to suppress foreign key checks,
@@ -500,9 +525,6 @@ struct trx_struct{
in that case we must flush the log
in trx_commit_complete_for_mysql() */
ulint duplicates; /*!< TRX_DUP_IGNORE | TRX_DUP_REPLACE */
- ulint active_trans; /*!< 1 - if a transaction in MySQL
- is active. 2 - if prepare_commit_mutex
- was taken */
ulint has_search_latch;
/* TRUE if this trx has latched the
search system latch in S-mode */
@@ -558,11 +580,6 @@ struct trx_struct{
ib_int64_t mysql_log_offset;/* if MySQL binlog is used, this field
contains the end offset of the binlog
entry */
- 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
- process id's and not thread id's, we
- store the process number too */
/*------------------------------*/
ulint n_mysql_tables_in_use; /* number of Innobase tables
used in the processing of the current
diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h
index 54809f9c2d5..df16c939070 100644
--- a/storage/innobase/include/trx0undo.h
+++ b/storage/innobase/include/trx0undo.h
@@ -262,8 +262,6 @@ UNIV_INTERN
page_t*
trx_undo_set_state_at_finish(
/*=========================*/
- trx_rseg_t* rseg, /*!< in: rollback segment memory object */
- trx_t* trx, /*!< in: transaction */
trx_undo_t* undo, /*!< in: undo log memory copy */
mtr_t* mtr); /*!< in: mtr */
/******************************************************************//**
@@ -298,6 +296,15 @@ void
trx_undo_insert_cleanup(
/*====================*/
trx_t* trx); /*!< in: transaction handle */
+
+/********************************************************************//**
+At shutdown, frees the undo logs of a PREPARED transaction. */
+UNIV_INTERN
+void
+trx_undo_free_prepared(
+/*===================*/
+ trx_t* trx) /*!< in/out: PREPARED transaction */
+ UNIV_COLD __attribute__((nonnull));
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
Parses the redo log entry of an undo log page initialization.
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index 548eb446fab..21d1eb03b99 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -44,9 +44,14 @@ Created 1/20/1994 Heikki Tuuri
#include "hb_univ.i"
#endif /* UNIV_HOTBACKUP */
+/* aux macros to convert M into "123" (string) if M is defined like
+#define M 123 */
+#define _IB_TO_STR(s) #s
+#define IB_TO_STR(s) _IB_TO_STR(s)
+
#define INNODB_VERSION_MAJOR 1
#define INNODB_VERSION_MINOR 1
-#define INNODB_VERSION_BUGFIX 2
+#define INNODB_VERSION_BUGFIX 8
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
@@ -57,16 +62,14 @@ component, i.e. we show M.N.P as M.N */
#define INNODB_VERSION_SHORT \
(INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR)
-/* auxiliary macros to help creating the version as string */
-#define __INNODB_VERSION(a, b, c) (#a "." #b "." #c)
-#define _INNODB_VERSION(a, b, c) __INNODB_VERSION(a, b, c)
-
#define INNODB_VERSION_STR \
- _INNODB_VERSION(INNODB_VERSION_MAJOR, \
- INNODB_VERSION_MINOR, \
- INNODB_VERSION_BUGFIX)
+ IB_TO_STR(INNODB_VERSION_MAJOR) "." \
+ IB_TO_STR(INNODB_VERSION_MINOR) "." \
+ IB_TO_STR(INNODB_VERSION_BUGFIX)
-#define REFMAN "http://dev.mysql.com/doc/refman/5.1/en/"
+#define REFMAN "http://dev.mysql.com/doc/refman/" \
+ IB_TO_STR(MYSQL_MAJOR_VERSION) "." \
+ IB_TO_STR(MYSQL_MINOR_VERSION) "/en/"
#ifdef MYSQL_DYNAMIC_PLUGIN
/* In the dynamic plugin, redefine some externally visible symbols
@@ -78,19 +81,6 @@ the virtual method table (vtable) in GCC 3. */
# define ha_innobase ha_innodb
#endif /* MYSQL_DYNAMIC_PLUGIN */
-/* if any of the following macros is defined at this point this means
-that the code from the "right" plug.in was executed and we do not
-need to include ut0auxconf.h which would either define the same macros
-or will be empty */
-#if !defined(HAVE_IB_GCC_ATOMIC_BUILTINS) \
- && !defined(HAVE_IB_ATOMIC_PTHREAD_T_GCC) \
- && !defined(HAVE_IB_SOLARIS_ATOMICS) \
- && !defined(HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS) \
- && !defined(SIZEOF_PTHREAD_T) \
- && !defined(HAVE_IB_PAUSE_INSTRUCTION)
-# include "ut0auxconf.h"
-#endif
-
#if (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)) && !defined(MYSQL_SERVER) && !defined(__WIN__)
# undef __WIN__
# define __WIN__
@@ -194,14 +184,17 @@ command. Not tested on Windows. */
debugging without UNIV_DEBUG */
#define UNIV_BUF_DEBUG /* Enable buffer pool
debugging without UNIV_DEBUG */
+#define UNIV_BLOB_LIGHT_DEBUG /* Enable off-page column
+ debugging without UNIV_DEBUG */
+#define UNIV_BLOB_NULL_DEBUG /* Enable deep off-page
+ column debugging */
#define UNIV_DEBUG /* Enable ut_ad() assertions
and disable UNIV_INLINE */
#define UNIV_DEBUG_LOCK_VALIDATE /* Enable
ut_ad(lock_rec_validate_page())
assertions. */
-#define UNIV_DEBUG_FILE_ACCESSES /* Debug .ibd file access
- (field file_page_was_freed
- in buf_page_t) */
+#define UNIV_DEBUG_FILE_ACCESSES /* Enable freed block access
+ debugging without UNIV_DEBUG */
#define UNIV_LRU_DEBUG /* debug the buffer pool LRU */
#define UNIV_HASH_DEBUG /* debug HASH_ macros */
#define UNIV_LIST_DEBUG /* debug UT_LIST_ macros */
@@ -210,6 +203,8 @@ this will break redo log file compatibility, but it may be useful when
debugging redo log application problems. */
#define UNIV_MEM_DEBUG /* detect memory leaks etc */
#define UNIV_IBUF_DEBUG /* debug the insert buffer */
+#define UNIV_BLOB_DEBUG /* track BLOB ownership;
+assumes that no BLOBs survive server restart */
#define UNIV_IBUF_COUNT_DEBUG /* debug the insert buffer;
this limits the database to IBUF_COUNT_N_SPACES and IBUF_COUNT_N_PAGES,
and the insert buffer must be empty when the database is started */
@@ -262,8 +257,21 @@ easy way to get it to work. See http://bugs.mysql.com/bug.php?id=52263. */
#else
# define UNIV_INTERN
#endif
+#if defined __GNUC__ && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+/** Starting with GCC 4.3, the "cold" attribute is used to inform the
+compiler that a function is unlikely executed. The function is
+optimized for size rather than speed and on many targets it is placed
+into special subsection of the text section so all cold functions
+appears close together improving code locality of non-cold parts of
+program. The paths leading to call of cold functions within code are
+marked as unlikely by the branch prediction mechanism. optimize a
+rarely invoked function for size instead for speed. */
+# define UNIV_COLD __attribute__((cold))
+#else
+# define UNIV_COLD /* empty */
+#endif
-#if (!defined(UNIV_DEBUG) && !defined(UNIV_MUST_NOT_INLINE))
+#ifndef UNIV_MUST_NOT_INLINE
/* Definition for inline version */
#ifdef __WIN__
@@ -318,6 +326,18 @@ number does not include a terminating '\0'. InnoDB probably can handle
longer names internally */
#define MAX_TABLE_NAME_LEN 192
+/* The maximum length of a database name. Like MAX_TABLE_NAME_LEN this is
+the MySQL's NAME_LEN, see check_and_convert_db_name(). */
+#define MAX_DATABASE_NAME_LEN MAX_TABLE_NAME_LEN
+
+/* MAX_FULL_NAME_LEN defines the full name path including the
+database name and table name. In addition, 14 bytes is added for:
+ 2 for surrounding quotes around table name
+ 1 for the separating dot (.)
+ 9 for the #mysql50# prefix */
+#define MAX_FULL_NAME_LEN \
+ (MAX_TABLE_NAME_LEN + MAX_DATABASE_NAME_LEN + 14)
+
/*
UNIVERSAL TYPE DEFINITIONS
==========================
@@ -387,6 +407,9 @@ typedef unsigned long long int ullint;
/** The generic InnoDB system object identifier data type */
typedef ib_uint64_t ib_id_t;
+/* The 'undefined' value for a ullint */
+#define ULLINT_UNDEFINED ((ullint)(-1))
+
/* This 'ibool' type is used within Innobase. Remember that different included
headers may define 'bool' differently. Do not assume that 'bool' is a ulint! */
#define ibool ulint
@@ -436,7 +459,7 @@ it is read or written. */
/* Use sun_prefetch when compile with Sun Studio */
# define UNIV_EXPECT(expr,value) (expr)
# define UNIV_LIKELY_NULL(expr) (expr)
-# define UNIV_PREFETCH_R(addr) sun_prefetch_read_many(addr)
+# define UNIV_PREFETCH_R(addr) sun_prefetch_read_many((void*) addr)
# define UNIV_PREFETCH_RW(addr) sun_prefetch_write_many(addr)
#else
/* Dummy versions of the macros */
diff --git a/storage/innobase/include/ut0auxconf.h b/storage/innobase/include/ut0auxconf.h
deleted file mode 100644
index 16bcc308392..00000000000
--- a/storage/innobase/include/ut0auxconf.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Do not remove this file even though it is empty.
-This file is included in univ.i and will cause compilation failure
-if not present.
-A custom checks have been added in the generated
-storage/innobase/Makefile.in that is shipped with the InnoDB Plugin
-source archive. These checks eventually define some macros and put
-them in this file.
-This is a hack that has been developed in order to deploy new compile
-time checks without the need to regenerate the ./configure script that is
-distributed in the MySQL 5.1 official source archives.
-If by any chance Makefile.in and ./configure are regenerated and thus
-the hack from Makefile.in wiped away then the "real" checks from plug.in
-will take over.
-*/
diff --git a/storage/innobase/include/ut0bh.h b/storage/innobase/include/ut0bh.h
new file mode 100644
index 00000000000..1b211390283
--- /dev/null
+++ b/storage/innobase/include/ut0bh.h
@@ -0,0 +1,152 @@
+/***************************************************************************//**
+
+Copyright (c) 2011, Oracle Corpn. All Rights Reserved.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place, Suite 330, Boston, MA 02111-1307 USA
+
+*****************************************************************************/
+
+/******************************************************************//**
+@file include/ut0bh.h
+Binary min-heap interface.
+
+Created 2010-05-28 by Sunny Bains
+*******************************************************/
+
+#ifndef INNOBASE_UT0BH_H
+#define INNOBASE_UT0BH_H
+
+#include "univ.i"
+
+/** Comparison function for objects in the binary heap. */
+typedef int (*ib_bh_cmp_t)(const void* p1, const void* p2);
+
+typedef struct ib_bh_struct ib_bh_t;
+
+/**********************************************************************//**
+Get the number of elements in the binary heap.
+@return number of elements */
+UNIV_INLINE
+ulint
+ib_bh_size(
+/*=======*/
+ const ib_bh_t* ib_bh); /*!< in: instance */
+
+/**********************************************************************//**
+Test if binary heap is empty.
+@return TRUE if empty. */
+UNIV_INLINE
+ibool
+ib_bh_is_empty(
+/*===========*/
+ const ib_bh_t* ib_bh); /*!< in: instance */
+
+/**********************************************************************//**
+Test if binary heap is full.
+@return TRUE if full. */
+UNIV_INLINE
+ibool
+ib_bh_is_full(
+/*===========*/
+ const ib_bh_t* ib_bh); /*!< in: instance */
+
+/**********************************************************************//**
+Get a pointer to the element.
+@return pointer to element */
+UNIV_INLINE
+void*
+ib_bh_get(
+/*=======*/
+ ib_bh_t* ib_bh, /*!< in: instance */
+ ulint i); /*!< in: index */
+
+/**********************************************************************//**
+Copy an element to the binary heap.
+@return pointer to copied element */
+UNIV_INLINE
+void*
+ib_bh_set(
+/*======*/
+ ib_bh_t* ib_bh, /*!< in/out: instance */
+ ulint i, /*!< in: index */
+ const void* elem); /*!< in: element to add */
+
+/**********************************************************************//**
+Return the first element from the binary heap.
+@return pointer to first element or NULL if empty. */
+UNIV_INLINE
+void*
+ib_bh_first(
+/*========*/
+ ib_bh_t* ib_bh); /*!< in: instance */
+
+/**********************************************************************//**
+Return the last element from the binary heap.
+@return pointer to last element or NULL if empty. */
+UNIV_INLINE
+void*
+ib_bh_last(
+/*========*/
+ ib_bh_t* ib_bh); /*!< in/out: instance */
+
+/**********************************************************************//**
+Create a binary heap.
+@return a new binary heap */
+UNIV_INTERN
+ib_bh_t*
+ib_bh_create(
+/*=========*/
+ ib_bh_cmp_t compare, /*!< in: comparator */
+ ulint sizeof_elem, /*!< in: size of one element */
+ ulint max_elems); /*!< in: max elements allowed */
+
+/**********************************************************************//**
+Free a binary heap.
+@return a new binary heap */
+UNIV_INTERN
+void
+ib_bh_free(
+/*=======*/
+ ib_bh_t* ib_bh); /*!< in,own: instance */
+
+/**********************************************************************//**
+Add an element to the binary heap. Note: The element is copied.
+@return pointer to added element or NULL if full. */
+UNIV_INTERN
+void*
+ib_bh_push(
+/*=======*/
+ ib_bh_t* ib_bh, /*!< in/out: instance */
+ const void* elem); /*!< in: element to add */
+
+/**********************************************************************//**
+Remove the first element from the binary heap. */
+UNIV_INTERN
+void
+ib_bh_pop(
+/*======*/
+ ib_bh_t* ib_bh); /*!< in/out: instance */
+
+/** Binary heap data structure */
+struct ib_bh_struct {
+ ulint max_elems; /*!< max elements allowed */
+ ulint n_elems; /*!< current size */
+ ulint sizeof_elem; /*!< sizeof element */
+ ib_bh_cmp_t compare; /*!< comparator */
+};
+
+#ifndef UNIV_NONINL
+#include "ut0bh.ic"
+#endif
+
+#endif /* INNOBASE_UT0BH_H */
diff --git a/storage/innobase/include/ut0bh.ic b/storage/innobase/include/ut0bh.ic
new file mode 100644
index 00000000000..afbe58e7e3b
--- /dev/null
+++ b/storage/innobase/include/ut0bh.ic
@@ -0,0 +1,125 @@
+/***************************************************************************//**
+Copyright (c) 2011, Oracle Corpn. All Rights Reserved.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place, Suite 330, Boston, MA 02111-1307 USA
+
+*****************************************************************************/
+
+/******************************************************************//**
+@file include/ut0bh.ic
+Binary min-heap implementation.
+
+Created 2011-01-15 by Sunny Bains
+*******************************************************/
+
+#include "ut0bh.h"
+#include "ut0mem.h" /* For ut_memcpy() */
+
+/**********************************************************************//**
+Get the number of elements in the binary heap.
+@return number of elements */
+UNIV_INLINE
+ulint
+ib_bh_size(
+/*=======*/
+ const ib_bh_t* ib_bh) /*!< in: instance */
+{
+ return(ib_bh->n_elems);
+}
+
+/**********************************************************************//**
+Test if binary heap is empty.
+@return TRUE if empty. */
+UNIV_INLINE
+ibool
+ib_bh_is_empty(
+/*===========*/
+ const ib_bh_t* ib_bh) /*!< in: instance */
+{
+ return(ib_bh_size(ib_bh) == 0);
+}
+
+/**********************************************************************//**
+Test if binary heap is full.
+@return TRUE if full. */
+UNIV_INLINE
+ibool
+ib_bh_is_full(
+/*===========*/
+ const ib_bh_t* ib_bh) /*!< in: instance */
+{
+ return(ib_bh_size(ib_bh) >= ib_bh->max_elems);
+}
+
+/**********************************************************************//**
+Get a pointer to the element.
+@return pointer to element */
+UNIV_INLINE
+void*
+ib_bh_get(
+/*=======*/
+ ib_bh_t* ib_bh, /*!< in: instance */
+ ulint i) /*!< in: index */
+{
+ byte* ptr = (byte*) (ib_bh + 1);
+
+ ut_a(i < ib_bh_size(ib_bh));
+
+ return(ptr + (ib_bh->sizeof_elem * i));
+}
+
+/**********************************************************************//**
+Copy an element to the binary heap.
+@return pointer to copied element */
+UNIV_INLINE
+void*
+ib_bh_set(
+/*======*/
+ ib_bh_t* ib_bh, /*!< in/out: instance */
+ ulint i, /*!< in: index */
+ const void* elem) /*!< in: element to add */
+{
+ void* ptr = ib_bh_get(ib_bh, i);
+
+ ut_memcpy(ptr, elem, ib_bh->sizeof_elem);
+
+ return(ptr);
+}
+
+/**********************************************************************//**
+Return the first element from the binary heap.
+@return pointer to first element or NULL if empty. */
+UNIV_INLINE
+void*
+ib_bh_first(
+/*========*/
+ ib_bh_t* ib_bh) /*!< in: instance */
+{
+ return(ib_bh_is_empty(ib_bh) ? NULL : ib_bh_get(ib_bh, 0));
+}
+
+/**********************************************************************//**
+Return the last element from the binary heap.
+@return pointer to last element or NULL if empty. */
+UNIV_INLINE
+void*
+ib_bh_last(
+/*========*/
+ ib_bh_t* ib_bh) /*!< in/out: instance */
+{
+ return(ib_bh_is_empty(ib_bh)
+ ? NULL
+ : ib_bh_get(ib_bh, ib_bh_size(ib_bh) - 1));
+}
+
+
diff --git a/storage/innobase/include/ut0dbg.h b/storage/innobase/include/ut0dbg.h
index d7ec90db0fb..07730176d81 100644
--- a/storage/innobase/include/ut0dbg.h
+++ b/storage/innobase/include/ut0dbg.h
@@ -50,9 +50,10 @@ UNIV_INTERN
void
ut_dbg_assertion_failed(
/*====================*/
- const char* expr, /*!< in: the failed assertion */
- const char* file, /*!< in: source file containing the assertion */
- ulint line); /*!< in: line number of the assertion */
+ const char* expr, /*!< in: the failed assertion */
+ const char* file, /*!< in: source file containing the assertion */
+ ulint line) /*!< in: line number of the assertion */
+ UNIV_COLD __attribute__((nonnull(2)));
#if defined(__WIN__) || defined(__INTEL_COMPILER)
# undef UT_DBG_USE_ABORT
diff --git a/storage/innobase/include/ut0rbt.h b/storage/innobase/include/ut0rbt.h
index 7902dc91f09..e26b637ae13 100644
--- a/storage/innobase/include/ut0rbt.h
+++ b/storage/innobase/include/ut0rbt.h
@@ -53,7 +53,7 @@ Created 2007-03-20 Sunny Bains
/* Red black tree typedefs */
typedef struct ib_rbt_struct ib_rbt_t;
typedef struct ib_rbt_node_struct ib_rbt_node_t;
-// FIXME: Iterator is a better name than _bound_
+/* FIXME: Iterator is a better name than _bound_ */
typedef struct ib_rbt_bound_struct ib_rbt_bound_t;
typedef void (*ib_rbt_print_node)(const ib_rbt_node_t* node);
typedef int (*ib_rbt_compare)(const void* p1, const void* p2);
diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h
index dd59b3eba46..cad39e9a34f 100644
--- a/storage/innobase/include/ut0ut.h
+++ b/storage/innobase/include/ut0ut.h
@@ -55,24 +55,24 @@ Created 1/20/1994 Heikki Tuuri
typedef time_t ib_time_t;
#ifndef UNIV_HOTBACKUP
-#if defined(HAVE_IB_PAUSE_INSTRUCTION)
-# ifdef WIN32
- /* In the Win32 API, the x86 PAUSE instruction is executed by calling
- the YieldProcessor macro defined in WinNT.h. It is a CPU architecture-
- independent way by using YieldProcessor.*/
-# define UT_RELAX_CPU() YieldProcessor()
-# else
- /* According to the gcc info page, asm volatile means that the
- instruction has important side-effects and must not be removed.
- Also asm volatile may trigger a memory barrier (spilling all registers
- to memory). */
-# define UT_RELAX_CPU() __asm__ __volatile__ ("pause")
-# endif
+#if defined(HAVE_PAUSE_INSTRUCTION)
+ /* According to the gcc info page, asm volatile means that the
+ instruction has important side-effects and must not be removed.
+ Also asm volatile may trigger a memory barrier (spilling all registers
+ to memory). */
+# define UT_RELAX_CPU() __asm__ __volatile__ ("pause")
+#elif defined(HAVE_FAKE_PAUSE_INSTRUCTION)
+# define UT_RELAX_CPU() __asm__ __volatile__ ("rep; nop")
#elif defined(HAVE_ATOMIC_BUILTINS)
# define UT_RELAX_CPU() do { \
volatile lint volatile_var; \
os_compare_and_swap_lint(&volatile_var, 0, 1); \
} while (0)
+#elif defined(HAVE_WINDOWS_ATOMICS)
+ /* In the Win32 API, the x86 PAUSE instruction is executed by calling
+ the YieldProcessor macro defined in WinNT.h. It is a CPU architecture-
+ independent way by using YieldProcessor. */
+# define UT_RELAX_CPU() YieldProcessor()
#else
# define UT_RELAX_CPU() ((void)0) /* avoid warning for an empty statement */
#endif
@@ -275,7 +275,8 @@ UNIV_INTERN
void
ut_print_timestamp(
/*===============*/
- FILE* file); /*!< in: file where to print */
+ FILE* file) /*!< in: file where to print */
+ UNIV_COLD __attribute__((nonnull));
/**********************************************************//**
Sprintfs a timestamp to a buffer, 13..14 chars plus terminating NUL. */
UNIV_INTERN
diff --git a/storage/innobase/include/ut0vec.h b/storage/innobase/include/ut0vec.h
index a770f671cfc..0f8b955b098 100644
--- a/storage/innobase/include/ut0vec.h
+++ b/storage/innobase/include/ut0vec.h
@@ -94,6 +94,25 @@ ib_vector_get(
ulint n); /*!< in: element index to get */
/****************************************************************//**
+Get last element. The vector must not be empty.
+@return last element */
+UNIV_INLINE
+void*
+ib_vector_get_last(
+/*===============*/
+ ib_vector_t* vec); /*!< in: vector */
+
+/****************************************************************//**
+Set the n'th element. */
+UNIV_INLINE
+void
+ib_vector_set(
+/*==========*/
+ ib_vector_t* vec, /*!< in/out: vector */
+ ulint n, /*!< in: element index to set */
+ void* elem); /*!< in: data element */
+
+/****************************************************************//**
Remove the last element from the vector. */
UNIV_INLINE
void*
diff --git a/storage/innobase/include/ut0vec.ic b/storage/innobase/include/ut0vec.ic
index 02e881f9bca..34c858868ce 100644
--- a/storage/innobase/include/ut0vec.ic
+++ b/storage/innobase/include/ut0vec.ic
@@ -51,6 +51,35 @@ ib_vector_get(
}
/****************************************************************//**
+Get last element. The vector must not be empty.
+@return last element */
+UNIV_INLINE
+void*
+ib_vector_get_last(
+/*===============*/
+ ib_vector_t* vec) /*!< in: vector */
+{
+ ut_a(vec->used > 0);
+
+ return(vec->data[vec->used - 1]);
+}
+
+/****************************************************************//**
+Set the n'th element. */
+UNIV_INLINE
+void
+ib_vector_set(
+/*==========*/
+ ib_vector_t* vec, /*!< in/out: vector */
+ ulint n, /*!< in: element index to set */
+ void* elem) /*!< in: data element */
+{
+ ut_a(n < vec->used);
+
+ vec->data[n] = elem;
+}
+
+/****************************************************************//**
Remove the last element from the vector.
@return last vector element */
UNIV_INLINE
diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c
index dcfca1b6315..714107304f7 100644
--- a/storage/innobase/lock/lock0lock.c
+++ b/storage/innobase/lock/lock0lock.c
@@ -359,10 +359,8 @@ static
ibool
lock_rec_validate_page(
/*===================*/
- ulint space, /*!< in: space id */
- ulint zip_size,/*!< in: compressed page size in bytes
- or 0 for uncompressed pages */
- ulint page_no);/*!< in: page number */
+ const buf_block_t* block) /*!< in: buffer block */
+ __attribute__((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
/* The lock system */
@@ -1100,10 +1098,10 @@ lock_rec_reset_nth_bit(
Gets the first or next record lock on a page.
@return next lock, NULL if none exists */
UNIV_INLINE
-lock_t*
-lock_rec_get_next_on_page(
-/*======================*/
- lock_t* lock) /*!< in: a record lock */
+const lock_t*
+lock_rec_get_next_on_page_const(
+/*============================*/
+ const lock_t* lock) /*!< in: a record lock */
{
ulint space;
ulint page_no;
@@ -1133,6 +1131,18 @@ lock_rec_get_next_on_page(
}
/*********************************************************************//**
+Gets the first or next record lock on a page.
+@return next lock, NULL if none exists */
+UNIV_INLINE
+lock_t*
+lock_rec_get_next_on_page(
+/*======================*/
+ lock_t* lock) /*!< in: a record lock */
+{
+ return((lock_t*) lock_rec_get_next_on_page_const(lock));
+}
+
+/*********************************************************************//**
Gets the first record lock on a page, where the page is identified by its
file address.
@return first lock, NULL if none exists */
@@ -2645,9 +2655,7 @@ lock_move_reorganize_page(
mem_heap_free(heap);
#ifdef UNIV_DEBUG_LOCK_VALIDATE
- ut_ad(lock_rec_validate_page(buf_block_get_space(block),
- buf_block_get_zip_size(block),
- buf_block_get_page_no(block)));
+ ut_ad(lock_rec_validate_page(block));
#endif
}
@@ -2735,12 +2743,8 @@ lock_move_rec_list_end(
lock_mutex_exit_kernel();
#ifdef UNIV_DEBUG_LOCK_VALIDATE
- ut_ad(lock_rec_validate_page(buf_block_get_space(block),
- buf_block_get_zip_size(block),
- buf_block_get_page_no(block)));
- ut_ad(lock_rec_validate_page(buf_block_get_space(new_block),
- buf_block_get_zip_size(block),
- buf_block_get_page_no(new_block)));
+ ut_ad(lock_rec_validate_page(block));
+ ut_ad(lock_rec_validate_page(new_block));
#endif
}
@@ -2848,9 +2852,7 @@ lock_move_rec_list_start(
lock_mutex_exit_kernel();
#ifdef UNIV_DEBUG_LOCK_VALIDATE
- ut_ad(lock_rec_validate_page(buf_block_get_space(block),
- buf_block_get_zip_size(block),
- buf_block_get_page_no(block)));
+ ut_ad(lock_rec_validate_page(block));
#endif
}
@@ -3622,6 +3624,80 @@ lock_table_create(
}
/*************************************************************//**
+Pops autoinc lock requests from the transaction's autoinc_locks. We
+handle the case where there are gaps in the array and they need to
+be popped off the stack. */
+UNIV_INLINE
+void
+lock_table_pop_autoinc_locks(
+/*=========================*/
+ trx_t* trx) /*!< in/out: transaction that owns the AUTOINC locks */
+{
+ ut_ad(mutex_own(&kernel_mutex));
+ ut_ad(!ib_vector_is_empty(trx->autoinc_locks));
+
+ /* Skip any gaps, gaps are NULL lock entries in the
+ trx->autoinc_locks vector. */
+
+ do {
+ ib_vector_pop(trx->autoinc_locks);
+
+ if (ib_vector_is_empty(trx->autoinc_locks)) {
+ return;
+ }
+
+ } while (ib_vector_get_last(trx->autoinc_locks) == NULL);
+}
+
+/*************************************************************//**
+Removes an autoinc lock request from the transaction's autoinc_locks. */
+UNIV_INLINE
+void
+lock_table_remove_autoinc_lock(
+/*===========================*/
+ lock_t* lock, /*!< in: table lock */
+ trx_t* trx) /*!< in/out: transaction that owns the lock */
+{
+ lock_t* autoinc_lock;
+ lint i = ib_vector_size(trx->autoinc_locks) - 1;
+
+ ut_ad(mutex_own(&kernel_mutex));
+ ut_ad(lock_get_mode(lock) == LOCK_AUTO_INC);
+ ut_ad(lock_get_type_low(lock) & LOCK_TABLE);
+ ut_ad(!ib_vector_is_empty(trx->autoinc_locks));
+
+ /* With stored functions and procedures the user may drop
+ a table within the same "statement". This special case has
+ to be handled by deleting only those AUTOINC locks that were
+ held by the table being dropped. */
+
+ autoinc_lock = ib_vector_get(trx->autoinc_locks, i);
+
+ /* This is the default fast case. */
+
+ if (autoinc_lock == lock) {
+ lock_table_pop_autoinc_locks(trx);
+ } else {
+ /* The last element should never be NULL */
+ ut_a(autoinc_lock != NULL);
+
+ /* Handle freeing the locks from within the stack. */
+
+ while (--i >= 0) {
+ autoinc_lock = ib_vector_get(trx->autoinc_locks, i);
+
+ if (UNIV_LIKELY(autoinc_lock == lock)) {
+ ib_vector_set(trx->autoinc_locks, i, NULL);
+ return;
+ }
+ }
+
+ /* Must find the autoinc lock. */
+ ut_error;
+ }
+}
+
+/*************************************************************//**
Removes a table lock request from the queue and the trx list of locks;
this is a low-level function which does NOT check if waiting requests
can now be granted. */
@@ -3660,10 +3736,8 @@ lock_table_remove_low(
if (!lock_get_wait(lock)
&& !ib_vector_is_empty(trx->autoinc_locks)) {
- lock_t* autoinc_lock;
- autoinc_lock = ib_vector_pop(trx->autoinc_locks);
- ut_a(autoinc_lock == lock);
+ lock_table_remove_autoinc_lock(lock, trx);
}
ut_a(table->n_waiting_or_granted_auto_inc_locks > 0);
@@ -3761,17 +3835,18 @@ Checks if other transactions have an incompatible mode lock request in
the lock queue.
@return lock or NULL */
UNIV_INLINE
-lock_t*
+const lock_t*
lock_table_other_has_incompatible(
/*==============================*/
- trx_t* trx, /*!< in: transaction, or NULL if all
- transactions should be included */
- ulint wait, /*!< in: LOCK_WAIT if also waiting locks are
- taken into account, or 0 if not */
- dict_table_t* table, /*!< in: table */
- enum lock_mode mode) /*!< in: lock mode */
+ const trx_t* trx, /*!< in: transaction, or NULL if all
+ transactions should be included */
+ ulint wait, /*!< in: LOCK_WAIT if also
+ waiting locks are taken into
+ account, or 0 if not */
+ const dict_table_t* table, /*!< in: table */
+ enum lock_mode mode) /*!< in: lock mode */
{
- lock_t* lock;
+ const lock_t* lock;
ut_ad(mutex_own(&kernel_mutex));
@@ -3862,10 +3937,10 @@ static
ibool
lock_table_has_to_wait_in_queue(
/*============================*/
- lock_t* wait_lock) /*!< in: waiting table lock */
+ const lock_t* wait_lock) /*!< in: waiting table lock */
{
- dict_table_t* table;
- lock_t* lock;
+ const dict_table_t* table;
+ const lock_t* lock;
ut_ad(mutex_own(&kernel_mutex));
ut_ad(lock_get_wait(wait_lock));
@@ -4605,9 +4680,9 @@ static
ibool
lock_table_queue_validate(
/*======================*/
- dict_table_t* table) /*!< in: table */
+ const dict_table_t* table) /*!< in: table */
{
- lock_t* lock;
+ const lock_t* lock;
ut_ad(mutex_own(&kernel_mutex));
@@ -4643,7 +4718,7 @@ lock_rec_queue_validate(
/*====================*/
const buf_block_t* block, /*!< in: buffer block containing rec */
const rec_t* rec, /*!< in: record to look at */
- dict_index_t* index, /*!< in: index, or NULL if not known */
+ const dict_index_t* index, /*!< in: index, or NULL if not known */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
{
trx_t* impl_trx;
@@ -4792,46 +4867,37 @@ static
ibool
lock_rec_validate_page(
/*===================*/
- ulint space, /*!< in: space id */
- ulint zip_size,/*!< in: compressed page size in bytes
- or 0 for uncompressed pages */
- ulint page_no)/*!< in: page number */
+ const buf_block_t* block) /*!< in: buffer block */
{
- dict_index_t* index;
- buf_block_t* block;
- const page_t* page;
- lock_t* lock;
+ const lock_t* lock;
const rec_t* rec;
ulint nth_lock = 0;
ulint nth_bit = 0;
ulint i;
- mtr_t mtr;
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
rec_offs_init(offsets_);
ut_ad(!mutex_own(&kernel_mutex));
-
- mtr_start(&mtr);
-
- ut_ad(zip_size != ULINT_UNDEFINED);
- block = buf_page_get(space, zip_size, page_no, RW_X_LATCH, &mtr);
- buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
-
- page = block->frame;
+ ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
lock_mutex_enter_kernel();
loop:
- lock = lock_rec_get_first_on_page_addr(space, page_no);
+ lock = lock_rec_get_first_on_page_addr(buf_block_get_space(block),
+ buf_block_get_page_no(block));
if (!lock) {
goto function_exit;
}
+#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
+ ut_a(!block->page.file_page_was_freed);
+#endif
+
for (i = 0; i < nth_lock; i++) {
- lock = lock_rec_get_next_on_page(lock);
+ lock = lock_rec_get_next_on_page_const(lock);
if (!lock) {
goto function_exit;
@@ -4854,16 +4920,15 @@ loop:
if (i == 1 || lock_rec_get_nth_bit(lock, i)) {
- index = lock->index;
- rec = page_find_rec_with_heap_no(page, i);
+ rec = page_find_rec_with_heap_no(block->frame, i);
ut_a(rec);
- offsets = rec_get_offsets(rec, index, offsets,
+ offsets = rec_get_offsets(rec, lock->index, offsets,
ULINT_UNDEFINED, &heap);
-
+#if 0
fprintf(stderr,
- "Validating %lu %lu\n",
- (ulong) space, (ulong) page_no);
-
+ "Validating %u %u\n",
+ block->page.space, block->page.offset);
+#endif
lock_mutex_exit_kernel();
/* If this thread is holding the file space
@@ -4871,7 +4936,8 @@ loop:
check WILL break the latching order and may
cause a deadlock of threads. */
- lock_rec_queue_validate(block, rec, index, offsets);
+ lock_rec_queue_validate(block, rec, lock->index,
+ offsets);
lock_mutex_enter_kernel();
@@ -4889,8 +4955,6 @@ loop:
function_exit:
lock_mutex_exit_kernel();
- mtr_commit(&mtr);
-
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
@@ -4905,11 +4969,8 @@ ibool
lock_validate(void)
/*===============*/
{
- lock_t* lock;
- trx_t* trx;
- ib_uint64_t limit;
- ulint space;
- ulint page_no;
+ const lock_t* lock;
+ const trx_t* trx;
ulint i;
lock_mutex_enter_kernel();
@@ -4934,9 +4995,14 @@ lock_validate(void)
for (i = 0; i < hash_get_n_cells(lock_sys->rec_hash); i++) {
- limit = 0;
+ ulint space;
+ ulint page_no;
+ ib_uint64_t limit = 0;
for (;;) {
+ mtr_t mtr;
+ buf_block_t* block;
+
lock = HASH_GET_FIRST(lock_sys->rec_hash, i);
while (lock) {
@@ -4962,13 +5028,26 @@ lock_validate(void)
lock_mutex_exit_kernel();
- lock_rec_validate_page(space,
- fil_space_get_zip_size(space),
- page_no);
+ /* The lock and the block that it is referring
+ to may be freed at this point. We pass
+ BUF_GET_POSSIBLY_FREED to skip a debug check.
+ If the lock exists in lock_rec_validate_page()
+ we assert !block->page.file_page_was_freed. */
- lock_mutex_enter_kernel();
+ mtr_start(&mtr);
+ block = buf_page_get_gen(
+ space, fil_space_get_zip_size(space),
+ page_no, RW_X_LATCH, NULL,
+ BUF_GET_POSSIBLY_FREED,
+ __FILE__, __LINE__, &mtr);
+ buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
+
+ ut_ad(lock_rec_validate_page(block));
+ mtr_commit(&mtr);
+
+ limit++;
- limit = ut_ull_create(space, page_no + 1);
+ lock_mutex_enter_kernel();
}
}
diff --git a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c
index 401cede1d8f..fd2258945b6 100644
--- a/storage/innobase/log/log0log.c
+++ b/storage/innobase/log/log0log.c
@@ -3078,6 +3078,7 @@ logs_empty_and_mark_files_at_shutdown(void)
{
ib_uint64_t lsn;
ulint arch_log_no;
+ ibool server_busy;
if (srv_print_verbose_log) {
ut_print_timestamp(stderr);
@@ -3092,80 +3093,86 @@ loop:
mutex_enter(&kernel_mutex);
- /* 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. */
+ /* We need the monitor threads to stop before we proceed with
+ a shutdown. */
- if (srv_fast_shutdown < 2
- && (srv_error_monitor_active
- || srv_lock_timeout_active || srv_monitor_active)) {
+ if (srv_error_monitor_active
+ || srv_lock_timeout_active
+ || srv_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) {
-
- mutex_exit(&kernel_mutex);
+ os_event_set(srv_error_event);
+ os_event_set(srv_monitor_event);
+ os_event_set(srv_timeout_event);
goto loop;
}
- if (srv_fast_shutdown == 2) {
- /* In this fastest shutdown we do not flush the buffer pool:
- it is essentially a 'crash' of the InnoDB server. Make sure
- that the log is all flushed to disk, so that we can recover
- all committed transactions in a crash recovery. We must not
- write the lsn stamps to the data files, since at a startup
- InnoDB deduces from the stamps if the previous shutdown was
- clean. */
-
- log_buffer_flush_to_disk();
-
- return; /* We SKIP ALL THE REST !! */
- }
+ /* Check that there are no longer transactions, except for
+ PREPARED ones. 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. */
+ server_busy = trx_n_mysql_transactions > 0
+ || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared;
mutex_exit(&kernel_mutex);
- /* Check that the background threads are suspended */
-
- if (srv_is_any_background_thread_active()) {
+ if (server_busy || srv_is_any_background_thread_active()) {
goto loop;
}
- mutex_enter(&(log_sys->mutex));
-
- if (log_sys->n_pending_checkpoint_writes
+ mutex_enter(&log_sys->mutex);
+ server_busy = log_sys->n_pending_checkpoint_writes
#ifdef UNIV_LOG_ARCHIVE
- || log_sys->n_pending_archive_ios
+ || log_sys->n_pending_archive_ios
#endif /* UNIV_LOG_ARCHIVE */
- || log_sys->n_pending_writes) {
-
- mutex_exit(&(log_sys->mutex));
-
- goto loop;
- }
-
- mutex_exit(&(log_sys->mutex));
-
- if (!buf_pool_check_no_pending_io()) {
+ || log_sys->n_pending_writes;
+ mutex_exit(&log_sys->mutex);
+ if (server_busy || !buf_pool_check_no_pending_io()) {
goto loop;
}
#ifdef UNIV_LOG_ARCHIVE
log_archive_all();
#endif /* UNIV_LOG_ARCHIVE */
+ if (srv_fast_shutdown == 2) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: MySQL has requested a very fast shutdown"
+ " without flushing "
+ "the InnoDB buffer pool to data files."
+ " At the next mysqld startup "
+ "InnoDB will do a crash recovery!\n");
+
+ /* In this fastest shutdown we do not flush the buffer
+ pool: it is essentially a 'crash' of the InnoDB
+ server. Make sure that the log is all flushed to disk,
+ so that we can recover all committed transactions in a
+ crash recovery. We must not write the lsn stamps to
+ the data files, since at a startup InnoDB deduces from
+ the stamps if the previous shutdown was clean. */
+
+ log_buffer_flush_to_disk();
+
+ /* Check that the background threads stay suspended */
+ if (srv_is_any_background_thread_active()) {
+ fprintf(stderr,
+ "InnoDB: Warning: some background thread"
+ " woke up during shutdown\n");
+ goto loop;
+ }
+
+ srv_shutdown_state = SRV_SHUTDOWN_LAST_PHASE;
+ fil_close_all_files();
+ ut_a(!srv_is_any_background_thread_active());
+ return;
+ }
log_make_checkpoint_at(IB_ULONGLONG_MAX, TRUE);
- mutex_enter(&(log_sys->mutex));
+ mutex_enter(&log_sys->mutex);
lsn = log_sys->lsn;
@@ -3176,7 +3183,7 @@ loop:
#endif /* UNIV_LOG_ARCHIVE */
) {
- mutex_exit(&(log_sys->mutex));
+ mutex_exit(&log_sys->mutex);
goto loop;
}
@@ -3194,7 +3201,7 @@ loop:
log_archive_close_groups(TRUE);
#endif /* UNIV_LOG_ARCHIVE */
- mutex_exit(&(log_sys->mutex));
+ mutex_exit(&log_sys->mutex);
/* Check that the background threads stay suspended */
if (srv_is_any_background_thread_active()) {
diff --git a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
index e5b2de14f74..f9e0fecb6c6 100644
--- a/storage/innobase/log/log0recv.c
+++ b/storage/innobase/log/log0recv.c
@@ -1657,12 +1657,8 @@ recv_recover_page_func(
#ifndef UNIV_HOTBACKUP
if (modification_to_page) {
- buf_pool_t* buf_pool;
-
ut_a(block);
- buf_pool = buf_pool_from_block(block);
-
log_flush_order_mutex_enter();
buf_flush_recv_note_modification(block, start_lsn, end_lsn);
log_flush_order_mutex_exit();
@@ -2203,7 +2199,7 @@ recv_report_corrupt_log(
"InnoDB: far enough in recovery! Please run CHECK TABLE\n"
"InnoDB: on your InnoDB tables to check that they are ok!\n"
"InnoDB: If mysqld crashes after this recovery, look at\n"
- "InnoDB: " REFMAN "forcing-recovery.html\n"
+ "InnoDB: " REFMAN "forcing-innodb-recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
fflush(stderr);
diff --git a/storage/innobase/mem/mem0dbg.c b/storage/innobase/mem/mem0dbg.c
index d91e610a08a..ae43d6097a6 100644
--- a/storage/innobase/mem/mem0dbg.c
+++ b/storage/innobase/mem/mem0dbg.c
@@ -24,6 +24,8 @@ but is included in mem0mem.* !
Created 6/9/1994 Heikki Tuuri
*************************************************************************/
+#include "ha_prototypes.h"
+
#ifdef UNIV_MEM_DEBUG
# ifndef UNIV_HOTBACKUP
/* The mutex which protects in the debug version the hash table
@@ -400,7 +402,7 @@ mem_hash_remove(
fprintf(stderr,
"Memory heap or buffer freed in %s line %lu"
" did not exist.\n",
- file_name, (ulong) line);
+ innobase_basename(file_name), (ulong) line);
ut_error;
}
@@ -419,8 +421,9 @@ mem_hash_remove(
"in %s line %lu and tried to free in %s line %lu.\n"
"Hex dump of 400 bytes around memory heap"
" first block start:\n",
- node->nth_heap, node->file_name, (ulong) node->line,
- file_name, (ulong) line);
+ node->nth_heap,
+ innobase_basename(node->file_name), (ulong) node->line,
+ innobase_basename(file_name), (ulong) line);
ut_print_buf(stderr, (byte*)node->heap - 200, 400);
fputs("\nDump of the mem heap:\n", stderr);
mem_heap_validate_or_print(node->heap, NULL, TRUE, &error,
@@ -763,7 +766,8 @@ mem_validate_no_assert(void)
"Inconsistency in memory heap"
" or buffer created\n"
"in %s line %lu.\n",
- node->file_name, node->line);
+ innobase_basename(node->file_name),
+ node->line);
mutex_exit(&mem_hash_mutex);
@@ -989,7 +993,8 @@ mem_print_info_low(
fprintf(outfile,
"%lu: file %s line %lu of size %lu phys.size %lu"
" with %lu blocks, type %lu\n",
- node->nth_heap, node->file_name, node->line,
+ node->nth_heap,
+ innobase_basename(node->file_name), node->line,
allocated_mem, ph_size, n_blocks,
(node->heap)->type);
next_heap:
diff --git a/storage/innobase/mem/mem0mem.c b/storage/innobase/mem/mem0mem.c
index b5a7ddbd7b2..7727760f1cd 100644
--- a/storage/innobase/mem/mem0mem.c
+++ b/storage/innobase/mem/mem0mem.c
@@ -347,7 +347,7 @@ mem_heap_create_block(
return(NULL);
}
} else {
- buf_block = buf_block_alloc(NULL, 0);
+ buf_block = buf_block_alloc(NULL);
}
block = (mem_block_t*) buf_block->frame;
diff --git a/storage/innobase/mtr/mtr0log.c b/storage/innobase/mtr/mtr0log.c
index 04eeb4391cd..864970cef40 100644
--- a/storage/innobase/mtr/mtr0log.c
+++ b/storage/innobase/mtr/mtr0log.c
@@ -408,7 +408,7 @@ mlog_parse_string(
ptr += 2;
if (UNIV_UNLIKELY(offset >= UNIV_PAGE_SIZE)
- || UNIV_UNLIKELY(len + offset) > UNIV_PAGE_SIZE) {
+ || UNIV_UNLIKELY(len + offset > UNIV_PAGE_SIZE)) {
recv_sys->found_corrupt_log = TRUE;
return(NULL);
diff --git a/storage/innobase/mtr/mtr0mtr.c b/storage/innobase/mtr/mtr0mtr.c
index 74d04a22b86..439b429db43 100644
--- a/storage/innobase/mtr/mtr0mtr.c
+++ b/storage/innobase/mtr/mtr0mtr.c
@@ -251,6 +251,7 @@ mtr_commit(
ut_ad(mtr);
ut_ad(mtr->magic_n == MTR_MAGIC_N);
ut_ad(mtr->state == MTR_ACTIVE);
+ ut_ad(!mtr->inside_ibuf);
ut_d(mtr->state = MTR_COMMITTING);
#ifndef UNIV_HOTBACKUP
@@ -264,9 +265,20 @@ mtr_commit(
mtr_memo_pop_all(mtr);
#endif /* !UNIV_HOTBACKUP */
- ut_d(mtr->state = MTR_COMMITTED);
dyn_array_free(&(mtr->memo));
dyn_array_free(&(mtr->log));
+#ifdef UNIV_DEBUG_VALGRIND
+ /* Declare everything uninitialized except
+ mtr->start_lsn, mtr->end_lsn and mtr->state. */
+ {
+ ib_uint64_t start_lsn = mtr->start_lsn;
+ ib_uint64_t end_lsn = mtr->end_lsn;
+ UNIV_MEM_INVALID(mtr, sizeof *mtr);
+ mtr->start_lsn = start_lsn;
+ mtr->end_lsn = end_lsn;
+ }
+#endif /* UNIV_DEBUG_VALGRIND */
+ ut_d(mtr->state = MTR_COMMITTED);
}
#ifndef UNIV_HOTBACKUP
diff --git a/storage/innobase/mysql-test/patches/README b/storage/innobase/mysql-test/patches/README
deleted file mode 100644
index 122d756e9e3..00000000000
--- a/storage/innobase/mysql-test/patches/README
+++ /dev/null
@@ -1,30 +0,0 @@
-This directory contains patches that need to be applied to the MySQL
-source tree in order to get the mysql-test suite to succeed (when
-storage/innobase is replaced with this InnoDB branch). Things to keep
-in mind when adding new patches here:
-
-* The patch must be appliable from the mysql top-level source directory.
-
-* The patch filename must end in ".diff".
-
-* All patches here are expected to apply cleanly to the latest MySQL 5.1
- tree when storage/innobase is replaced with this InnoDB branch. If
- changes to either of those cause the patch to fail, then please check
- whether the patch is still needed and, if yes, adjust it so it applies
- cleanly.
-
-* If applicable, always submit the patch at http://bugs.mysql.com and
- name the file here like bug%d.diff. Once the patch is committed to
- MySQL remove the file from here.
-
-* If the patch cannot be proposed for inclusion in the MySQL source tree
- (via http://bugs.mysql.com) then add a comment at the beginning of the
- patch, explaining the problem it is solving, how it does solve it and
- why it is not applicable for inclusion in the MySQL source tree.
- Obviously this is a very bad situation and should be avoided at all
- costs, especially for files that are in the MySQL source repository
- (not in storage/innobase).
-
-* If you ever need to add a patch here that is not related to mysql-test
- suite, then please move this directory from ./mysql-test/patches to
- ./patches and remove this text.
diff --git a/storage/innobase/mysql-test/patches/index_merge_innodb-explain.diff b/storage/innobase/mysql-test/patches/index_merge_innodb-explain.diff
deleted file mode 100644
index d1ed8afc778..00000000000
--- a/storage/innobase/mysql-test/patches/index_merge_innodb-explain.diff
+++ /dev/null
@@ -1,31 +0,0 @@
-InnoDB's estimate for the index cardinality depends on a pseudo random
-number generator (it picks up random pages to sample). After an
-optimization that was made in r2625 the following EXPLAINs started
-returning a different number of rows (3 instead of 4).
-
-This patch adjusts the result file.
-
-This patch cannot be proposed to MySQL because the failures occur only
-in this tree and do not occur in the standard InnoDB 5.1. Furthermore,
-the file index_merge2.inc is used by other engines too.
-
---- mysql-test/r/index_merge_innodb.result.orig 2008-09-30 18:32:13.000000000 +0300
-+++ mysql-test/r/index_merge_innodb.result 2008-09-30 18:33:01.000000000 +0300
-@@ -111,7 +111,7 @@
- explain select count(*) from t1 where
- key1a = 2 and key1b is null and key2a = 2 and key2b is null;
- id select_type table type possible_keys key key_len ref rows Extra
--1 SIMPLE t1 index_merge i1,i2 i1,i2 10,10 NULL 4 Using intersect(i1,i2); Using where; Using index
-+1 SIMPLE t1 index_merge i1,i2 i1,i2 10,10 NULL 3 Using intersect(i1,i2); Using where; Using index
- select count(*) from t1 where
- key1a = 2 and key1b is null and key2a = 2 and key2b is null;
- count(*)
-@@ -119,7 +119,7 @@
- explain select count(*) from t1 where
- key1a = 2 and key1b is null and key3a = 2 and key3b is null;
- id select_type table type possible_keys key key_len ref rows Extra
--1 SIMPLE t1 index_merge i1,i3 i1,i3 10,10 NULL 4 Using intersect(i1,i3); Using where; Using index
-+1 SIMPLE t1 index_merge i1,i3 i1,i3 10,10 NULL 3 Using intersect(i1,i3); Using where; Using index
- select count(*) from t1 where
- key1a = 2 and key1b is null and key3a = 2 and key3b is null;
- count(*)
diff --git a/storage/innobase/mysql-test/patches/information_schema.diff b/storage/innobase/mysql-test/patches/information_schema.diff
deleted file mode 100644
index a3a21f7a08d..00000000000
--- a/storage/innobase/mysql-test/patches/information_schema.diff
+++ /dev/null
@@ -1,124 +0,0 @@
---- mysql-test/r/information_schema.result.orig 2009-01-31 03:38:50.000000000 +0200
-+++ mysql-test/r/information_schema.result 2009-01-31 07:51:58.000000000 +0200
-@@ -71,6 +71,13 @@
- TRIGGERS
- USER_PRIVILEGES
- VIEWS
-+INNODB_CMP_RESET
-+INNODB_TRX
-+INNODB_CMPMEM_RESET
-+INNODB_LOCK_WAITS
-+INNODB_CMPMEM
-+INNODB_CMP
-+INNODB_LOCKS
- columns_priv
- db
- event
-@@ -799,6 +806,8 @@
- TABLES UPDATE_TIME datetime
- TABLES CHECK_TIME datetime
- TRIGGERS CREATED datetime
-+INNODB_TRX trx_started datetime
-+INNODB_TRX trx_wait_started datetime
- event execute_at datetime
- event last_executed datetime
- event starts datetime
-@@ -852,7 +861,7 @@
- flush privileges;
- SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
- table_schema count(*)
--information_schema 28
-+information_schema 35
- mysql 22
- create table t1 (i int, j int);
- create trigger trg1 before insert on t1 for each row
-@@ -1267,6 +1276,13 @@
- TRIGGERS TRIGGER_SCHEMA
- USER_PRIVILEGES GRANTEE
- VIEWS TABLE_SCHEMA
-+INNODB_CMP_RESET page_size
-+INNODB_TRX trx_id
-+INNODB_CMPMEM_RESET page_size
-+INNODB_LOCK_WAITS requesting_trx_id
-+INNODB_CMPMEM page_size
-+INNODB_CMP page_size
-+INNODB_LOCKS lock_id
- SELECT t.table_name, c1.column_name
- FROM information_schema.tables t
- INNER JOIN
-@@ -1310,6 +1326,13 @@
- TRIGGERS TRIGGER_SCHEMA
- USER_PRIVILEGES GRANTEE
- VIEWS TABLE_SCHEMA
-+INNODB_CMP_RESET page_size
-+INNODB_TRX trx_id
-+INNODB_CMPMEM_RESET page_size
-+INNODB_LOCK_WAITS requesting_trx_id
-+INNODB_CMPMEM page_size
-+INNODB_CMP page_size
-+INNODB_LOCKS lock_id
- SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test');
- MAX(table_name)
- VIEWS
-@@ -1386,6 +1409,13 @@
- FILES information_schema.FILES 1
- GLOBAL_STATUS information_schema.GLOBAL_STATUS 1
- GLOBAL_VARIABLES information_schema.GLOBAL_VARIABLES 1
-+INNODB_CMP information_schema.INNODB_CMP 1
-+INNODB_CMPMEM information_schema.INNODB_CMPMEM 1
-+INNODB_CMPMEM_RESET information_schema.INNODB_CMPMEM_RESET 1
-+INNODB_CMP_RESET information_schema.INNODB_CMP_RESET 1
-+INNODB_LOCKS information_schema.INNODB_LOCKS 1
-+INNODB_LOCK_WAITS information_schema.INNODB_LOCK_WAITS 1
-+INNODB_TRX information_schema.INNODB_TRX 1
- KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
- PARTITIONS information_schema.PARTITIONS 1
- PLUGINS information_schema.PLUGINS 1
-diff mysql-test/r/information_schema_db.result.orig mysql-test/r/information_schema_db.result
---- mysql-test/r/information_schema_db.result.orig 2008-08-04 09:27:49.000000000 +0300
-+++ mysql-test/r/information_schema_db.result 2008-10-07 12:26:31.000000000 +0300
-@@ -33,6 +33,13 @@
- TRIGGERS
- USER_PRIVILEGES
- VIEWS
-+INNODB_CMP_RESET
-+INNODB_TRX
-+INNODB_CMPMEM_RESET
-+INNODB_LOCK_WAITS
-+INNODB_CMPMEM
-+INNODB_CMP
-+INNODB_LOCKS
- show tables from INFORMATION_SCHEMA like 'T%';
- Tables_in_information_schema (T%)
- TABLES
-diff mysql-test/r/mysqlshow.result.orig mysql-test/r/mysqlshow.result
---- mysql-test/r/mysqlshow.result.orig 2008-08-04 09:27:51.000000000 +0300
-+++ mysql-test/r/mysqlshow.result 2008-10-07 12:35:39.000000000 +0300
-@@ -107,6 +107,13 @@
- | TRIGGERS |
- | USER_PRIVILEGES |
- | VIEWS |
-+| INNODB_CMP_RESET |
-+| INNODB_TRX |
-+| INNODB_CMPMEM_RESET |
-+| INNODB_LOCK_WAITS |
-+| INNODB_CMPMEM |
-+| INNODB_CMP |
-+| INNODB_LOCKS |
- +---------------------------------------+
- Database: INFORMATION_SCHEMA
- +---------------------------------------+
-@@ -140,6 +147,13 @@
- | TRIGGERS |
- | USER_PRIVILEGES |
- | VIEWS |
-+| INNODB_CMP_RESET |
-+| INNODB_TRX |
-+| INNODB_CMPMEM_RESET |
-+| INNODB_LOCK_WAITS |
-+| INNODB_CMPMEM |
-+| INNODB_CMP |
-+| INNODB_LOCKS |
- +---------------------------------------+
- Wildcard: inf_rmation_schema
- +--------------------+
diff --git a/storage/innobase/mysql-test/patches/innodb_change_buffering_basic.diff b/storage/innobase/mysql-test/patches/innodb_change_buffering_basic.diff
deleted file mode 100644
index bfa1609a97c..00000000000
--- a/storage/innobase/mysql-test/patches/innodb_change_buffering_basic.diff
+++ /dev/null
@@ -1,60 +0,0 @@
---- mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test.orig Mon Mar 15 16:15:22 2010
-+++ mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test Fri Mar 19 01:19:09 2010
-@@ -11,8 +11,8 @@
- #
- # exists as global only
- #
----echo Valid values are 'inserts' and 'none'
--select @@global.innodb_change_buffering in ('inserts', 'none');
-+--echo Valid values are 'inserts', 'deletes', 'changes', 'purges', 'all', and 'none'
-+select @@global.innodb_change_buffering in ('inserts', 'deletes', 'changes', 'purges', 'all', 'none');
- select @@global.innodb_change_buffering;
- --error ER_INCORRECT_GLOBAL_LOCAL_VAR
- select @@session.innodb_change_buffering;
-
---- mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result.orig Mon Mar 15 16:15:22 2010
-+++ mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result Fri Mar 19 01:23:58 2010
-@@ -1,28 +1,28 @@
- SET @start_global_value = @@global.innodb_change_buffering;
- SELECT @start_global_value;
- @start_global_value
--inserts
--Valid values are 'inserts' and 'none'
--select @@global.innodb_change_buffering in ('inserts', 'none');
--@@global.innodb_change_buffering in ('inserts', 'none')
-+all
-+Valid values are 'inserts', 'deletes', 'changes', 'purges', 'all', and 'none'
-+select @@global.innodb_change_buffering in ('inserts', 'deletes', 'changes', 'purges', 'all', 'none');
-+@@global.innodb_change_buffering in ('inserts', 'deletes', 'changes', 'purges', 'all', 'none')
- 1
- select @@global.innodb_change_buffering;
- @@global.innodb_change_buffering
--inserts
-+all
- select @@session.innodb_change_buffering;
- ERROR HY000: Variable 'innodb_change_buffering' is a GLOBAL variable
- show global variables like 'innodb_change_buffering';
- Variable_name Value
--innodb_change_buffering inserts
-+innodb_change_buffering all
- show session variables like 'innodb_change_buffering';
- Variable_name Value
--innodb_change_buffering inserts
-+innodb_change_buffering all
- select * from information_schema.global_variables where variable_name='innodb_change_buffering';
- VARIABLE_NAME VARIABLE_VALUE
--INNODB_CHANGE_BUFFERING inserts
-+INNODB_CHANGE_BUFFERING all
- select * from information_schema.session_variables where variable_name='innodb_change_buffering';
- VARIABLE_NAME VARIABLE_VALUE
--INNODB_CHANGE_BUFFERING inserts
-+INNODB_CHANGE_BUFFERING all
- set global innodb_change_buffering='none';
- select @@global.innodb_change_buffering;
- @@global.innodb_change_buffering
-@@ -60,4 +60,4 @@
- SET @@global.innodb_change_buffering = @start_global_value;
- SELECT @@global.innodb_change_buffering;
- @@global.innodb_change_buffering
--inserts
-+all
diff --git a/storage/innobase/mysql-test/patches/innodb_file_per_table.diff b/storage/innobase/mysql-test/patches/innodb_file_per_table.diff
deleted file mode 100644
index 8b7ae2036c9..00000000000
--- a/storage/innobase/mysql-test/patches/innodb_file_per_table.diff
+++ /dev/null
@@ -1,47 +0,0 @@
-diff mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test.orig mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test
---- mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test.orig 2008-10-07 11:32:30.000000000 +0300
-+++ mysql-test/suite/sys_vars/t/innodb_file_per_table_basic.test 2008-10-07 11:52:14.000000000 +0300
-@@ -37,10 +37,6 @@
- # Check if Value can set #
- ####################################################################
-
----error ER_INCORRECT_GLOBAL_LOCAL_VAR
--SET @@GLOBAL.innodb_file_per_table=1;
----echo Expected error 'Read only variable'
--
- SELECT COUNT(@@GLOBAL.innodb_file_per_table);
- --echo 1 Expected
-
-@@ -52,7 +48,7 @@
- # Check if the value in GLOBAL Table matches value in variable #
- #################################################################
-
--SELECT @@GLOBAL.innodb_file_per_table = VARIABLE_VALUE
-+SELECT IF(@@GLOBAL.innodb_file_per_table,'ON','OFF') = VARIABLE_VALUE
- FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
- WHERE VARIABLE_NAME='innodb_file_per_table';
- --echo 1 Expected
-diff mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result.orig mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
---- mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result.orig 2008-10-07 11:32:02.000000000 +0300
-+++ mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result 2008-10-07 11:52:47.000000000 +0300
-@@ -4,18 +4,15 @@
- 1
- 1 Expected
- '#---------------------BS_STVARS_028_02----------------------#'
--SET @@GLOBAL.innodb_file_per_table=1;
--ERROR HY000: Variable 'innodb_file_per_table' is a read only variable
--Expected error 'Read only variable'
- SELECT COUNT(@@GLOBAL.innodb_file_per_table);
- COUNT(@@GLOBAL.innodb_file_per_table)
- 1
- 1 Expected
- '#---------------------BS_STVARS_028_03----------------------#'
--SELECT @@GLOBAL.innodb_file_per_table = VARIABLE_VALUE
-+SELECT IF(@@GLOBAL.innodb_file_per_table,'ON','OFF') = VARIABLE_VALUE
- FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
- WHERE VARIABLE_NAME='innodb_file_per_table';
--@@GLOBAL.innodb_file_per_table = VARIABLE_VALUE
-+IF(@@GLOBAL.innodb_file_per_table,'ON','OFF') = VARIABLE_VALUE
- 1
- 1 Expected
- SELECT COUNT(@@GLOBAL.innodb_file_per_table);
diff --git a/storage/innobase/mysql-test/patches/innodb_lock_wait_timeout.diff b/storage/innobase/mysql-test/patches/innodb_lock_wait_timeout.diff
deleted file mode 100644
index bc61a0f5841..00000000000
--- a/storage/innobase/mysql-test/patches/innodb_lock_wait_timeout.diff
+++ /dev/null
@@ -1,55 +0,0 @@
---- mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test.orig 2008-08-04 09:28:16.000000000 +0300
-+++ mysql-test/suite/sys_vars/t/innodb_lock_wait_timeout_basic.test 2008-10-07 11:14:15.000000000 +0300
-@@ -37,10 +37,6 @@
- # Check if Value can set #
- ####################################################################
-
----error ER_INCORRECT_GLOBAL_LOCAL_VAR
--SET @@GLOBAL.innodb_lock_wait_timeout=1;
----echo Expected error 'Read only variable'
--
- SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
- --echo 1 Expected
-
-@@ -84,13 +80,9 @@
- SELECT COUNT(@@innodb_lock_wait_timeout);
- --echo 1 Expected
-
----Error ER_INCORRECT_GLOBAL_LOCAL_VAR
- SELECT COUNT(@@local.innodb_lock_wait_timeout);
----echo Expected error 'Variable is a GLOBAL variable'
-
----Error ER_INCORRECT_GLOBAL_LOCAL_VAR
- SELECT COUNT(@@SESSION.innodb_lock_wait_timeout);
----echo Expected error 'Variable is a GLOBAL variable'
-
- SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
- --echo 1 Expected
---- mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result.orig 2008-08-04 09:27:50.000000000 +0300
-+++ mysql-test/suite/sys_vars/r/innodb_lock_wait_timeout_basic.result 2008-10-07 11:15:14.000000000 +0300
-@@ -4,9 +4,6 @@
- 1
- 1 Expected
- '#---------------------BS_STVARS_032_02----------------------#'
--SET @@GLOBAL.innodb_lock_wait_timeout=1;
--ERROR HY000: Variable 'innodb_lock_wait_timeout' is a read only variable
--Expected error 'Read only variable'
- SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
- COUNT(@@GLOBAL.innodb_lock_wait_timeout)
- 1
-@@ -39,11 +36,11 @@
- 1
- 1 Expected
- SELECT COUNT(@@local.innodb_lock_wait_timeout);
--ERROR HY000: Variable 'innodb_lock_wait_timeout' is a GLOBAL variable
--Expected error 'Variable is a GLOBAL variable'
-+COUNT(@@local.innodb_lock_wait_timeout)
-+1
- SELECT COUNT(@@SESSION.innodb_lock_wait_timeout);
--ERROR HY000: Variable 'innodb_lock_wait_timeout' is a GLOBAL variable
--Expected error 'Variable is a GLOBAL variable'
-+COUNT(@@SESSION.innodb_lock_wait_timeout)
-+1
- SELECT COUNT(@@GLOBAL.innodb_lock_wait_timeout);
- COUNT(@@GLOBAL.innodb_lock_wait_timeout)
- 1
diff --git a/storage/innobase/mysql-test/patches/innodb_thread_concurrency_basic.diff b/storage/innobase/mysql-test/patches/innodb_thread_concurrency_basic.diff
deleted file mode 100644
index 72e5457905f..00000000000
--- a/storage/innobase/mysql-test/patches/innodb_thread_concurrency_basic.diff
+++ /dev/null
@@ -1,31 +0,0 @@
---- mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result.orig 2008-12-04 18:45:52 -06:00
-+++ mysql-test/suite/sys_vars/r/innodb_thread_concurrency_basic.result 2009-02-12 02:05:48 -06:00
-@@ -1,19 +1,19 @@
- SET @global_start_value = @@global.innodb_thread_concurrency;
- SELECT @global_start_value;
- @global_start_value
--8
-+0
- '#--------------------FN_DYNVARS_046_01------------------------#'
- SET @@global.innodb_thread_concurrency = 0;
- SET @@global.innodb_thread_concurrency = DEFAULT;
- SELECT @@global.innodb_thread_concurrency;
- @@global.innodb_thread_concurrency
--8
-+0
- '#---------------------FN_DYNVARS_046_02-------------------------#'
- SET innodb_thread_concurrency = 1;
- ERROR HY000: Variable 'innodb_thread_concurrency' is a GLOBAL variable and should be set with SET GLOBAL
- SELECT @@innodb_thread_concurrency;
- @@innodb_thread_concurrency
--8
-+0
- SELECT local.innodb_thread_concurrency;
- ERROR 42S02: Unknown table 'local' in field list
- SET global innodb_thread_concurrency = 0;
-@@ -93,4 +93,4 @@
- SET @@global.innodb_thread_concurrency = @global_start_value;
- SELECT @@global.innodb_thread_concurrency;
- @@global.innodb_thread_concurrency
--8
-+0
diff --git a/storage/innobase/mysql-test/patches/partition_innodb.diff b/storage/innobase/mysql-test/patches/partition_innodb.diff
deleted file mode 100644
index 01bc073008e..00000000000
--- a/storage/innobase/mysql-test/patches/partition_innodb.diff
+++ /dev/null
@@ -1,59 +0,0 @@
-The partition_innodb test only fails if run immediately after innodb_trx_weight.
-The reason for this failure is that innodb_trx_weight creates deadlocks and
-leaves something like this in the SHOW ENGINE INNODB STATUS output:
-
- ------------------------
- LATEST DETECTED DEADLOCK
- ------------------------
- 090213 10:26:25
- *** (1) TRANSACTION:
- TRANSACTION 313, ACTIVE 0 sec, OS thread id 13644672 inserting
- mysql tables in use 1, locked 1
- LOCK WAIT 4 lock struct(s), heap size 488, 3 row lock(s)
- MySQL thread id 3, query id 36 localhost root update
-
-The regular expressions that partition_innodb is using are intended to extract
-the lock structs and row locks numbers from another part of the output:
-
- ------------
- TRANSACTIONS
- ------------
- Trx id counter 31D
- Purge done for trx's n:o < 0 undo n:o < 0
- History list length 4
- LIST OF TRANSACTIONS FOR EACH SESSION:
- ---TRANSACTION 0, not started, OS thread id 13645056
- 0 lock struct(s), heap size 488, 0 row lock(s)
- MySQL thread id 8, query id 81 localhost root
-
-In the InnoDB Plugin a transaction id is not printed as 2 consecutive
-decimal integers (as it is in InnoDB 5.1) but rather as a single
-hexadecimal integer. Thus the regular expressions somehow pick the wrong
-part of the SHOW ENGINE INNODB STATUS output.
-
-So after the regular expressions are adjusted to the InnoDB Plugin's variant
-of trx_id prinout, then they pick the expected part of the output.
-
-This patch cannot be proposed to MySQL because the failures occur only
-in this tree and do not occur in the standard InnoDB 5.1.
-
---- mysql-test/t/partition_innodb.test 2008-11-14 22:51:17 +0000
-+++ mysql-test/t/partition_innodb.test 2009-02-13 07:36:07 +0000
-@@ -27,14 +27,14 @@
-
- # grouping/referencing in replace_regex is very slow on long strings,
- # removing all before/after the interesting row before grouping/referencing
----replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
-+--replace_regex /.*---TRANSACTION [0-9A-F]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
- SHOW ENGINE InnoDB STATUS;
-
- UPDATE t1 SET data = data*2 WHERE data = 2;
-
- # grouping/referencing in replace_regex is very slow on long strings,
- # removing all before/after the interesting row before grouping/referencing
----replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
-+--replace_regex /.*---TRANSACTION [0-9A-F]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
- SHOW ENGINE InnoDB STATUS;
-
- SET @@session.tx_isolation = @old_tx_isolation;
-
diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
index 6c17ded0073..bd48d0e4b6e 100644
--- a/storage/innobase/os/os0file.c
+++ b/storage/innobase/os/os0file.c
@@ -302,6 +302,36 @@ UNIV_INTERN ulint os_n_pending_writes = 0;
/** Number of pending read operations */
UNIV_INTERN ulint os_n_pending_reads = 0;
+#ifdef UNIV_DEBUG
+/**********************************************************************//**
+Validates the consistency the aio system some of the time.
+@return TRUE if ok or the check was skipped */
+UNIV_INTERN
+ibool
+os_aio_validate_skip(void)
+/*======================*/
+{
+/** Try os_aio_validate() every this many times */
+# define OS_AIO_VALIDATE_SKIP 13
+
+ /** The os_aio_validate() call skip counter.
+ Use a signed type because of the race condition below. */
+ static int os_aio_validate_count = OS_AIO_VALIDATE_SKIP;
+
+ /* There is a race condition below, but it does not matter,
+ because this call is only for heuristic purposes. We want to
+ reduce the call frequency of the costly os_aio_validate()
+ check in debug builds. */
+ if (--os_aio_validate_count > 0) {
+ return(TRUE);
+ }
+
+ os_aio_validate_count = OS_AIO_VALIDATE_SKIP;
+ return(os_aio_validate());
+}
+#endif /* UNIV_DEBUG */
+
+#ifdef __WIN__
/***********************************************************************//**
Gets the operating system version. Currently works only on Windows.
@return OS_WIN95, OS_WIN31, OS_WINNT, OS_WIN2000, OS_WINXP, OS_WINVISTA,
@@ -311,7 +341,6 @@ ulint
os_get_os_version(void)
/*===================*/
{
-#ifdef __WIN__
OSVERSIONINFO os_info;
os_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
@@ -340,12 +369,8 @@ os_get_os_version(void)
ut_error;
return(0);
}
-#else
- ut_error;
-
- return(0);
-#endif
}
+#endif /* __WIN__ */
/***********************************************************************//**
Retrieves the last error number if an error occurs in a file io function.
@@ -1295,10 +1320,12 @@ UNIV_INTERN
void
os_file_set_nocache(
/*================*/
- int fd, /*!< in: file descriptor to alter */
- const char* file_name, /*!< in: file name, used in the
- diagnostic message */
- const char* operation_name) /*!< in: "open" or "create"; used in the
+ int fd /*!< in: file descriptor to alter */
+ __attribute__((unused)),
+ const char* file_name /*!< in: used in the diagnostic message */
+ __attribute__((unused)),
+ const char* operation_name __attribute__((unused)))
+ /*!< in: "open" or "create"; used in the
diagnostic message */
{
/* some versions of Solaris may not have DIRECTIO_ON */
@@ -2398,7 +2425,10 @@ os_file_read_func(
ulint i;
#endif /* !UNIV_HOTBACKUP */
+ /* On 64-bit Windows, ulint is 64 bits. But offset and n should be
+ no more than 32 bits. */
ut_a((offset & 0xFFFFFFFFUL) == offset);
+ ut_a((n & 0xFFFFFFFFUL) == n);
os_n_file_reads++;
os_bytes_read_since_printout += n;
@@ -2524,7 +2554,10 @@ os_file_read_no_error_handling_func(
ulint i;
#endif /* !UNIV_HOTBACKUP */
+ /* On 64-bit Windows, ulint is 64 bits. But offset and n should be
+ no more than 32 bits. */
ut_a((offset & 0xFFFFFFFFUL) == offset);
+ ut_a((n & 0xFFFFFFFFUL) == n);
os_n_file_reads++;
os_bytes_read_since_printout += n;
@@ -2656,7 +2689,10 @@ os_file_write_func(
ulint i;
#endif /* !UNIV_HOTBACKUP */
- ut_a((offset & 0xFFFFFFFF) == offset);
+ /* On 64-bit Windows, ulint is 64 bits. But offset and n should be
+ no more than 32 bits. */
+ ut_a((offset & 0xFFFFFFFFUL) == offset);
+ ut_a((n & 0xFFFFFFFFUL) == n);
os_n_file_writes++;
@@ -3619,6 +3655,10 @@ os_aio_array_reserve_slot(
ulint slots_per_seg;
ulint local_seg;
+#ifdef WIN_ASYNC_IO
+ ut_a((len & 0xFFFFFFFFUL) == len);
+#endif
+
/* No need of a mutex. Only reading constant fields */
slots_per_seg = array->n_slots / array->n_segments;
@@ -3993,7 +4033,10 @@ os_aio_func(
ut_ad(n > 0);
ut_ad(n % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(offset % OS_FILE_LOG_BLOCK_SIZE == 0);
- ut_ad(os_aio_validate());
+ ut_ad(os_aio_validate_skip());
+#ifdef WIN_ASYNC_IO
+ ut_ad((n & 0xFFFFFFFFUL) == n);
+#endif
wake_later = mode & OS_AIO_SIMULATED_WAKE_LATER;
mode = mode & (~OS_AIO_SIMULATED_WAKE_LATER);
@@ -4008,26 +4051,33 @@ os_aio_func(
Windows async i/o, Windows does not allow us to use
ordinary synchronous os_file_read etc. on the same file,
therefore we have built a special mechanism for synchronous
- wait in the Windows case. */
+ wait in the Windows case.
+ Also note that the Performance Schema instrumentation has
+ been performed by current os_aio_func()'s wrapper function
+ pfs_os_aio_func(). So we would no longer need to call
+ Performance Schema instrumented os_file_read() and
+ os_file_write(). Instead, we should use os_file_read_func()
+ and os_file_write_func() */
if (type == OS_FILE_READ) {
- return(os_file_read(file, buf, offset,
+ return(os_file_read_func(file, buf, offset,
offset_high, n));
}
ut_a(type == OS_FILE_WRITE);
- return(os_file_write(name, file, buf, offset, offset_high, n));
+ return(os_file_write_func(name, file, buf, offset,
+ offset_high, n));
}
try_again:
- if (mode == OS_AIO_NORMAL) {
- if (type == OS_FILE_READ) {
- array = os_aio_read_array;
- } else {
- array = os_aio_write_array;
- }
- } else if (mode == OS_AIO_IBUF) {
+ switch (mode) {
+ case OS_AIO_NORMAL:
+ array = (type == OS_FILE_READ)
+ ? os_aio_read_array
+ : os_aio_write_array;
+ break;
+ case OS_AIO_IBUF:
ut_ad(type == OS_FILE_READ);
/* Reduce probability of deadlock bugs in connection with ibuf:
do not let the ibuf i/o handler sleep */
@@ -4035,19 +4085,21 @@ try_again:
wake_later = FALSE;
array = os_aio_ibuf_array;
- } else if (mode == OS_AIO_LOG) {
-
+ break;
+ case OS_AIO_LOG:
array = os_aio_log_array;
- } else if (mode == OS_AIO_SYNC) {
+ break;
+ case OS_AIO_SYNC:
array = os_aio_sync_array;
#if defined(LINUX_NATIVE_AIO)
/* In Linux native AIO we don't use sync IO array. */
ut_a(!srv_use_native_aio);
#endif /* LINUX_NATIVE_AIO */
- } else {
- array = NULL; /* Eliminate compiler warning */
+ break;
+ default:
ut_error;
+ array = NULL; /* Eliminate compiler warning */
}
slot = os_aio_array_reserve_slot(type, array, message1, message2, file,
@@ -4192,7 +4244,7 @@ os_aio_windows_handle(
/* NOTE! We only access constant fields in os_aio_array. Therefore
we do not have to acquire the protecting mutex yet */
- ut_ad(os_aio_validate());
+ ut_ad(os_aio_validate_skip());
ut_ad(segment < array->n_segments);
n = array->n_slots / array->n_segments;
@@ -4210,11 +4262,17 @@ os_aio_windows_handle(
INFINITE);
}
- if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) {
- os_thread_exit(NULL);
+ os_mutex_enter(array->mutex);
+
+ if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS
+ && array->n_reserved == 0) {
+ *message1 = NULL;
+ *message2 = NULL;
+ os_mutex_exit(array->mutex);
+ return(TRUE);
}
- os_mutex_enter(array->mutex);
+ ut_a(i >= WAIT_OBJECT_0 && i <= WAIT_OBJECT_0 + n);
slot = os_aio_array_get_nth_slot(array, i + segment * n);
@@ -4269,16 +4327,18 @@ os_aio_windows_handle(
__FILE__, __LINE__);
#endif
+ ut_a((slot->len & 0xFFFFFFFFUL) == slot->len);
+
switch (slot->type) {
case OS_FILE_WRITE:
ret = WriteFile(slot->file, slot->buf,
- slot->len, &len,
+ (DWORD) slot->len, &len,
&(slot->control));
break;
case OS_FILE_READ:
ret = ReadFile(slot->file, slot->buf,
- slot->len, &len,
+ (DWORD) slot->len, &len,
&(slot->control));
break;
@@ -4358,14 +4418,6 @@ os_aio_linux_collect(
retry:
- /* Go down if we are in shutdown mode.
- In case of srv_fast_shutdown == 2, there may be pending
- IO requests but that should be OK as we essentially treat
- that as a crash of InnoDB. */
- if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) {
- os_thread_exit(NULL);
- }
-
/* Initialize the events. The timeout value is arbitrary.
We probably need to experiment with it a little. */
memset(events, 0, sizeof(*events) * seg_size);
@@ -4374,76 +4426,72 @@ retry:
ret = io_getevents(io_ctx, 1, seg_size, events, &timeout);
- /* This error handling is for any error in collecting the
- IO requests. The errors, if any, for any particular IO
- request are simply passed on to the calling routine. */
+ if (ret > 0) {
+ for (i = 0; i < ret; i++) {
+ os_aio_slot_t* slot;
+ struct iocb* control;
- /* Not enough resources! Try again. */
- if (ret == -EAGAIN) {
- goto retry;
- }
+ control = (struct iocb *)events[i].obj;
+ ut_a(control != NULL);
- /* Interrupted! I have tested the behaviour in case of an
- interrupt. If we have some completed IOs available then
- the return code will be the number of IOs. We get EINTR only
- if there are no completed IOs and we have been interrupted. */
- if (ret == -EINTR) {
- goto retry;
- }
-
- /* No pending request! Go back and check again. */
- if (ret == 0) {
- goto retry;
- }
-
- /* All other errors! should cause a trap for now. */
- if (UNIV_UNLIKELY(ret < 0)) {
- ut_print_timestamp(stderr);
- fprintf(stderr,
- " InnoDB: unexpected ret_code[%d] from"
- " io_getevents()!\n", ret);
- ut_error;
- }
+ slot = (os_aio_slot_t *) control->data;
- ut_a(ret > 0);
+ /* Some sanity checks. */
+ ut_a(slot != NULL);
+ ut_a(slot->reserved);
- for (i = 0; i < ret; i++) {
- os_aio_slot_t* slot;
- struct iocb* control;
-
- control = (struct iocb *)events[i].obj;
- ut_a(control != NULL);
+#if defined(UNIV_AIO_DEBUG)
+ fprintf(stderr,
+ "io_getevents[%c]: slot[%p] ctx[%p]"
+ " seg[%lu]\n",
+ (slot->type == OS_FILE_WRITE) ? 'w' : 'r',
+ slot, io_ctx, segment);
+#endif
- slot = (os_aio_slot_t *) control->data;
+ /* We are not scribbling previous segment. */
+ ut_a(slot->pos >= start_pos);
- /* Some sanity checks. */
- ut_a(slot != NULL);
- ut_a(slot->reserved);
+ /* We have not overstepped to next segment. */
+ ut_a(slot->pos < end_pos);
-#if defined(UNIV_AIO_DEBUG)
- fprintf(stderr,
- "io_getevents[%c]: slot[%p] ctx[%p]"
- " seg[%lu]\n",
- (slot->type == OS_FILE_WRITE) ? 'w' : 'r',
- slot, io_ctx, segment);
-#endif
+ /* Mark this request as completed. The error handling
+ will be done in the calling function. */
+ os_mutex_enter(array->mutex);
+ slot->n_bytes = events[i].res;
+ slot->ret = events[i].res2;
+ slot->io_already_done = TRUE;
+ os_mutex_exit(array->mutex);
+ }
+ return;
+ }
- /* We are not scribbling previous segment. */
- ut_a(slot->pos >= start_pos);
+ if (UNIV_UNLIKELY(srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS)) {
+ return;
+ }
- /* We have not overstepped to next segment. */
- ut_a(slot->pos < end_pos);
+ /* This error handling is for any error in collecting the
+ IO requests. The errors, if any, for any particular IO
+ request are simply passed on to the calling routine. */
- /* Mark this request as completed. The error handling
- will be done in the calling function. */
- os_mutex_enter(array->mutex);
- slot->n_bytes = events[i].res;
- slot->ret = events[i].res2;
- slot->io_already_done = TRUE;
- os_mutex_exit(array->mutex);
+ switch (ret) {
+ case -EAGAIN:
+ /* Not enough resources! Try again. */
+ case -EINTR:
+ /* Interrupted! I have tested the behaviour in case of an
+ interrupt. If we have some completed IOs available then
+ the return code will be the number of IOs. We get EINTR only
+ if there are no completed IOs and we have been interrupted. */
+ case 0:
+ /* No pending request! Go back and check again. */
+ goto retry;
}
- return;
+ /* All other errors should cause a trap for now. */
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: unexpected ret_code[%d] from io_getevents()!\n",
+ ret);
+ ut_error;
}
/**********************************************************************//**
@@ -4487,20 +4535,35 @@ os_aio_linux_handle(
/* Loop until we have found a completed request. */
for (;;) {
+ ibool any_reserved = FALSE;
os_mutex_enter(array->mutex);
for (i = 0; i < n; ++i) {
slot = os_aio_array_get_nth_slot(
- array, i + segment * n);
- if (slot->reserved && slot->io_already_done) {
+ array, i + segment * n);
+ if (!slot->reserved) {
+ continue;
+ } else if (slot->io_already_done) {
/* Something for us to work on. */
goto found;
+ } else {
+ any_reserved = TRUE;
}
}
os_mutex_exit(array->mutex);
- /* We don't have any completed request.
- Wait for some request. Note that we return
+ /* There is no completed request.
+ If there is no pending request at all,
+ and the system is being shut down, exit. */
+ if (UNIV_UNLIKELY
+ (!any_reserved
+ && srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS)) {
+ *message1 = NULL;
+ *message2 = NULL;
+ return(TRUE);
+ }
+
+ /* Wait for some request. Note that we return
from wait iff we have found a request. */
srv_set_io_thread_op_info(global_seg,
@@ -4596,6 +4659,7 @@ os_aio_simulated_handle(
byte* combined_buf;
byte* combined_buf2;
ibool ret;
+ ibool any_reserved;
ulint n;
ulint i;
@@ -4610,7 +4674,7 @@ restart:
srv_set_io_thread_op_info(global_segment,
"looking for i/o requests (a)");
- ut_ad(os_aio_validate());
+ ut_ad(os_aio_validate_skip());
ut_ad(segment < array->n_segments);
n = array->n_slots / array->n_segments;
@@ -4626,18 +4690,21 @@ restart:
goto recommended_sleep;
}
- os_mutex_enter(array->mutex);
-
srv_set_io_thread_op_info(global_segment,
"looking for i/o requests (b)");
/* Check if there is a slot for which the i/o has already been
done */
+ any_reserved = FALSE;
+
+ os_mutex_enter(array->mutex);
for (i = 0; i < n; i++) {
slot = os_aio_array_get_nth_slot(array, i + segment * n);
- if (slot->reserved && slot->io_already_done) {
+ if (!slot->reserved) {
+ continue;
+ } else if (slot->io_already_done) {
if (os_aio_print_debug) {
fprintf(stderr,
@@ -4649,9 +4716,23 @@ restart:
ret = TRUE;
goto slot_io_done;
+ } else {
+ any_reserved = TRUE;
}
}
+ /* There is no completed request.
+ If there is no pending request at all,
+ and the system is being shut down, exit. */
+ if (UNIV_UNLIKELY
+ (!any_reserved
+ && srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS)) {
+ os_mutex_exit(array->mutex);
+ *message1 = NULL;
+ *message2 = NULL;
+ return(TRUE);
+ }
+
n_consecutive = 0;
/* If there are at least 2 seconds old requests, then pick the oldest
diff --git a/storage/innobase/os/os0sync.c b/storage/innobase/os/os0sync.c
index 3c70e93aae0..41a19843812 100644
--- a/storage/innobase/os/os0sync.c
+++ b/storage/innobase/os/os0sync.c
@@ -72,6 +72,9 @@ UNIV_INTERN ulint os_event_count = 0;
UNIV_INTERN ulint os_mutex_count = 0;
UNIV_INTERN ulint os_fast_mutex_count = 0;
+/* The number of microsecnds in a second. */
+static const ulint MICROSECS_IN_A_SECOND = 1000000;
+
/* Because a mutex is embedded inside an event and there is an
event embedded inside a mutex, on free, this generates a recursive call.
This version of the free event function doesn't acquire the global lock */
@@ -122,6 +125,70 @@ os_cond_init(
}
/*********************************************************//**
+Do a timed wait on condition variable.
+@return TRUE if timed out, FALSE otherwise */
+UNIV_INLINE
+ibool
+os_cond_wait_timed(
+/*===============*/
+ os_cond_t* cond, /*!< in: condition variable. */
+ os_fast_mutex_t* mutex, /*!< in: fast mutex */
+#ifndef __WIN__
+ const struct timespec* abstime /*!< in: timeout */
+#else
+ DWORD time_in_ms /*!< in: timeout in
+ milliseconds*/
+#endif /* !__WIN__ */
+)
+{
+#ifdef __WIN__
+ BOOL ret;
+ DWORD err;
+
+ ut_a(sleep_condition_variable != NULL);
+
+ ret = sleep_condition_variable(cond, mutex, time_in_ms);
+
+ if (!ret) {
+ err = GetLastError();
+ /* From http://msdn.microsoft.com/en-us/library/ms686301%28VS.85%29.aspx,
+ "Condition variables are subject to spurious wakeups
+ (those not associated with an explicit wake) and stolen wakeups
+ (another thread manages to run before the woken thread)."
+ Check for both types of timeouts.
+ Conditions are checked by the caller.*/
+ if ((err == WAIT_TIMEOUT) || (err == ERROR_TIMEOUT)) {
+ return(TRUE);
+ }
+ }
+
+ ut_a(ret);
+
+ return(FALSE);
+#else
+ int ret;
+
+ ret = pthread_cond_timedwait(cond, mutex, abstime);
+
+ switch (ret) {
+ case 0:
+ case ETIMEDOUT:
+ /* We play it safe by checking for EINTR even though
+ according to the POSIX documentation it can't return EINTR. */
+ case EINTR:
+ break;
+
+ default:
+ fprintf(stderr, " InnoDB: pthread_cond_timedwait() returned: "
+ "%d: abstime={%lu,%lu}\n",
+ ret, (ulong) abstime->tv_sec, (ulong) abstime->tv_nsec);
+ ut_error;
+ }
+
+ return(ret == ETIMEDOUT);
+#endif
+}
+/*********************************************************//**
Wait on condition variable */
UNIV_INLINE
void
@@ -491,10 +558,7 @@ os_event_free(
}
/**********************************************************//**
-Waits for an event object until it is in the signaled state. If
-srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS this also exits the
-waiting thread when the event becomes signaled (or immediately if the
-event is already in the signaled state).
+Waits for an event object until it is in the signaled state.
Typically, if the event has been signalled after the os_event_reset()
we'll return immediately because event->is_set == TRUE.
@@ -519,8 +583,6 @@ os_event_wait_low(
returned by previous call of
os_event_reset(). */
{
- ib_int64_t old_signal_count;
-
#ifdef __WIN__
if(!srv_use_native_conditions) {
DWORD err;
@@ -533,43 +595,138 @@ os_event_wait_low(
err = WaitForSingleObject(event->handle, INFINITE);
ut_a(err == WAIT_OBJECT_0);
-
- if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) {
- os_thread_exit(NULL);
- }
return;
}
#endif
- os_fast_mutex_lock(&(event->os_mutex));
+ os_fast_mutex_lock(&event->os_mutex);
+
+ if (!reset_sig_count) {
+ reset_sig_count = event->signal_count;
+ }
+
+ while (!event->is_set && event->signal_count == reset_sig_count) {
+ os_cond_wait(&(event->cond_var), &(event->os_mutex));
- if (reset_sig_count) {
- old_signal_count = reset_sig_count;
+ /* Solaris manual said that spurious wakeups may occur: we
+ have to check if the event really has been signaled after
+ we came here to wait */
+ }
+
+ os_fast_mutex_unlock(&event->os_mutex);
+}
+
+/**********************************************************//**
+Waits for an event object until it is in the signaled state or
+a timeout is exceeded.
+@return 0 if success, OS_SYNC_TIME_EXCEEDED if timeout was exceeded */
+UNIV_INTERN
+ulint
+os_event_wait_time_low(
+/*===================*/
+ os_event_t event, /*!< in: event to wait */
+ ulint time_in_usec, /*!< in: timeout in
+ microseconds, or
+ OS_SYNC_INFINITE_TIME */
+ ib_int64_t reset_sig_count) /*!< in: zero or the value
+ returned by previous call of
+ os_event_reset(). */
+
+{
+ ibool timed_out = FALSE;
+
+#ifdef __WIN__
+ DWORD time_in_ms;
+
+ if (!srv_use_native_conditions) {
+ DWORD err;
+
+ ut_a(event);
+
+ if (time_in_usec != OS_SYNC_INFINITE_TIME) {
+ time_in_ms = time_in_usec / 1000;
+ err = WaitForSingleObject(event->handle, time_in_ms);
+ } else {
+ err = WaitForSingleObject(event->handle, INFINITE);
+ }
+
+ if (err == WAIT_OBJECT_0) {
+ return(0);
+ } else if ((err == WAIT_TIMEOUT) || (err == ERROR_TIMEOUT)) {
+ return(OS_SYNC_TIME_EXCEEDED);
+ }
+
+ ut_error;
+ /* Dummy value to eliminate compiler warning. */
+ return(42);
} else {
- old_signal_count = event->signal_count;
+ ut_a(sleep_condition_variable != NULL);
+
+ if (time_in_usec != OS_SYNC_INFINITE_TIME) {
+ time_in_ms = time_in_usec / 1000;
+ } else {
+ time_in_ms = INFINITE;
+ }
}
+#else
+ struct timespec abstime;
- for (;;) {
- if (event->is_set == TRUE
- || event->signal_count != old_signal_count) {
+ if (time_in_usec != OS_SYNC_INFINITE_TIME) {
+ struct timeval tv;
+ int ret;
+ ulint sec;
+ ulint usec;
- os_fast_mutex_unlock(&(event->os_mutex));
+ ret = ut_usectime(&sec, &usec);
+ ut_a(ret == 0);
- if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) {
+ tv.tv_sec = sec;
+ tv.tv_usec = usec;
- os_thread_exit(NULL);
- }
- /* Ok, we may return */
+ tv.tv_usec += time_in_usec;
- return;
+ if ((ulint) tv.tv_usec >= MICROSECS_IN_A_SECOND) {
+ tv.tv_sec += time_in_usec / MICROSECS_IN_A_SECOND;
+ tv.tv_usec %= MICROSECS_IN_A_SECOND;
}
- os_cond_wait(&(event->cond_var), &(event->os_mutex));
+ abstime.tv_sec = tv.tv_sec;
+ abstime.tv_nsec = tv.tv_usec * 1000;
+ } else {
+ abstime.tv_nsec = 999999999;
+ abstime.tv_sec = (time_t) ULINT_MAX;
+ }
- /* Solaris manual said that spurious wakeups may occur: we
- have to check if the event really has been signaled after
- we came here to wait */
+ ut_a(abstime.tv_nsec <= 999999999);
+
+#endif /* __WIN__ */
+
+ os_fast_mutex_lock(&event->os_mutex);
+
+ if (!reset_sig_count) {
+ reset_sig_count = event->signal_count;
}
+
+ do {
+ if (event->is_set || event->signal_count != reset_sig_count) {
+
+ break;
+ }
+
+ timed_out = os_cond_wait_timed(
+ &event->cond_var, &event->os_mutex,
+#ifndef __WIN__
+ &abstime
+#else
+ time_in_ms
+#endif /* !__WIN__ */
+ );
+
+ } while (!timed_out);
+
+ os_fast_mutex_unlock(&event->os_mutex);
+
+ return(timed_out ? OS_SYNC_TIME_EXCEEDED : 0);
}
/*********************************************************//**
diff --git a/storage/innobase/os/os0thread.c b/storage/innobase/os/os0thread.c
index adc876be5d5..12b6805d98e 100644
--- a/storage/innobase/os/os0thread.c
+++ b/storage/innobase/os/os0thread.c
@@ -220,21 +220,6 @@ os_thread_exit(
}
/*****************************************************************//**
-Returns handle to the current thread.
-@return current thread handle */
-UNIV_INTERN
-os_thread_t
-os_thread_get_curr(void)
-/*====================*/
-{
-#ifdef __WIN__
- return(GetCurrentThread());
-#else
- return(pthread_self());
-#endif
-}
-
-/*****************************************************************//**
Advises the os to give up remainder of the thread's time slice. */
UNIV_INTERN
void
@@ -274,81 +259,3 @@ os_thread_sleep(
select(0, NULL, NULL, NULL, &t);
#endif
}
-
-#ifndef UNIV_HOTBACKUP
-/******************************************************************//**
-Sets a thread priority. */
-UNIV_INTERN
-void
-os_thread_set_priority(
-/*===================*/
- os_thread_t handle, /*!< in: OS handle to the thread */
- ulint pri) /*!< in: priority */
-{
-#ifdef __WIN__
- int os_pri;
-
- if (pri == OS_THREAD_PRIORITY_BACKGROUND) {
- os_pri = THREAD_PRIORITY_BELOW_NORMAL;
- } else if (pri == OS_THREAD_PRIORITY_NORMAL) {
- os_pri = THREAD_PRIORITY_NORMAL;
- } else if (pri == OS_THREAD_PRIORITY_ABOVE_NORMAL) {
- os_pri = THREAD_PRIORITY_HIGHEST;
- } else {
- ut_error;
- }
-
- ut_a(SetThreadPriority(handle, os_pri));
-#else
- UT_NOT_USED(handle);
- UT_NOT_USED(pri);
-#endif
-}
-
-/******************************************************************//**
-Gets a thread priority.
-@return priority */
-UNIV_INTERN
-ulint
-os_thread_get_priority(
-/*===================*/
- os_thread_t handle __attribute__((unused)))
- /*!< in: OS handle to the thread */
-{
-#ifdef __WIN__
- int os_pri;
- ulint pri;
-
- os_pri = GetThreadPriority(handle);
-
- if (os_pri == THREAD_PRIORITY_BELOW_NORMAL) {
- pri = OS_THREAD_PRIORITY_BACKGROUND;
- } else if (os_pri == THREAD_PRIORITY_NORMAL) {
- pri = OS_THREAD_PRIORITY_NORMAL;
- } else if (os_pri == THREAD_PRIORITY_HIGHEST) {
- pri = OS_THREAD_PRIORITY_ABOVE_NORMAL;
- } else {
- ut_error;
- }
-
- return(pri);
-#else
- return(0);
-#endif
-}
-
-/******************************************************************//**
-Gets the last operating system error code for the calling thread.
-@return last error on Windows, 0 otherwise */
-UNIV_INTERN
-ulint
-os_thread_get_last_error(void)
-/*==========================*/
-{
-#ifdef __WIN__
- return(GetLastError());
-#else
- return(0);
-#endif
-}
-#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/innobase/page/page0cur.c b/storage/innobase/page/page0cur.c
index f10f16a7dd9..936762b986a 100644
--- a/storage/innobase/page/page0cur.c
+++ b/storage/innobase/page/page0cur.c
@@ -1149,6 +1149,8 @@ use_heap:
current_rec, index, mtr);
}
+ btr_blob_dbg_add_rec(insert_rec, index, offsets, "insert");
+
return(insert_rec);
}
@@ -1195,10 +1197,12 @@ page_cur_insert_rec_zip_reorg(
}
/* Out of space: restore the page */
+ btr_blob_dbg_remove(page, index, "insert_zip_fail");
if (!page_zip_decompress(page_zip, page, FALSE)) {
ut_error; /* Memory corrupted? */
}
ut_ad(page_validate(page, index));
+ btr_blob_dbg_add(page, index, "insert_zip_fail");
return(NULL);
}
@@ -1490,6 +1494,8 @@ use_heap:
page_zip_write_rec(page_zip, insert_rec, index, offsets, 1);
+ btr_blob_dbg_add_rec(insert_rec, index, offsets, "insert_zip_ok");
+
/* 9. Write log record of the insert */
if (UNIV_LIKELY(mtr != NULL)) {
page_cur_insert_rec_write_log(insert_rec, rec_size,
@@ -1697,6 +1703,9 @@ page_copy_rec_list_end_to_created_page(
heap_top += rec_size;
+ rec_offs_make_valid(insert_rec, index, offsets);
+ btr_blob_dbg_add_rec(insert_rec, index, offsets, "copy_end");
+
page_cur_insert_rec_write_log(insert_rec, rec_size, prev_rec,
index, mtr);
prev_rec = insert_rec;
@@ -1944,6 +1953,7 @@ page_cur_delete_rec(
page_dir_slot_set_n_owned(cur_dir_slot, page_zip, cur_n_owned - 1);
/* 6. Free the memory occupied by the record */
+ btr_blob_dbg_remove_rec(current_rec, index, offsets, "delete");
page_mem_free(page, page_zip, current_rec, index, offsets);
/* 7. Now we have decremented the number of owned records of the slot.
diff --git a/storage/innobase/page/page0page.c b/storage/innobase/page/page0page.c
index 2e785412ac9..6064d028ae1 100644
--- a/storage/innobase/page/page0page.c
+++ b/storage/innobase/page/page0page.c
@@ -166,11 +166,11 @@ static
ibool
page_dir_slot_check(
/*================*/
- page_dir_slot_t* slot) /*!< in: slot */
+ const page_dir_slot_t* slot) /*!< in: slot */
{
- page_t* page;
- ulint n_slots;
- ulint n_owned;
+ const page_t* page;
+ ulint n_slots;
+ ulint n_owned;
ut_a(slot);
@@ -685,12 +685,16 @@ page_copy_rec_list_end(
if (UNIV_UNLIKELY
(!page_zip_reorganize(new_block, index, mtr))) {
+ btr_blob_dbg_remove(new_page, index,
+ "copy_end_reorg_fail");
if (UNIV_UNLIKELY
(!page_zip_decompress(new_page_zip,
new_page, FALSE))) {
ut_error;
}
ut_ad(page_validate(new_page, index));
+ btr_blob_dbg_add(new_page, index,
+ "copy_end_reorg_fail");
return(NULL);
} else {
/* The page was reorganized:
@@ -803,12 +807,16 @@ page_copy_rec_list_start(
if (UNIV_UNLIKELY
(!page_zip_reorganize(new_block, index, mtr))) {
+ btr_blob_dbg_remove(new_page, index,
+ "copy_start_reorg_fail");
if (UNIV_UNLIKELY
(!page_zip_decompress(new_page_zip,
new_page, FALSE))) {
ut_error;
}
ut_ad(page_validate(new_page, index));
+ btr_blob_dbg_add(new_page, index,
+ "copy_start_reorg_fail");
return(NULL);
} else {
/* The page was reorganized:
@@ -1080,6 +1088,9 @@ page_delete_rec_list_end(
/* Remove the record chain segment from the record chain */
page_rec_set_next(prev_rec, page_get_supremum_rec(page));
+ btr_blob_dbg_op(page, rec, index, "delete_end",
+ btr_blob_dbg_remove_rec);
+
/* Catenate the deleted chain segment to the page free list */
page_rec_set_next(last_rec, page_header_get_ptr(page, PAGE_FREE));
@@ -1242,28 +1253,6 @@ page_move_rec_list_start(
return(TRUE);
}
-
-/***********************************************************************//**
-This is a low-level operation which is used in a database index creation
-to update the page number of a created B-tree to a data dictionary record. */
-UNIV_INTERN
-void
-page_rec_write_index_page_no(
-/*=========================*/
- rec_t* rec, /*!< in: record to update */
- ulint i, /*!< in: index of the field to update */
- ulint page_no,/*!< in: value to write */
- mtr_t* mtr) /*!< in: mtr */
-{
- byte* data;
- ulint len;
-
- data = rec_get_nth_field_old(rec, i, &len);
-
- ut_ad(len == 4);
-
- mlog_write_ulint(data, page_no, MLOG_4BYTES, mtr);
-}
#endif /* !UNIV_HOTBACKUP */
/**************************************************************//**
@@ -1792,12 +1781,12 @@ UNIV_INTERN
ibool
page_rec_validate(
/*==============*/
- rec_t* rec, /*!< in: physical record */
+ const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
{
- ulint n_owned;
- ulint heap_no;
- page_t* page;
+ ulint n_owned;
+ ulint heap_no;
+ const page_t* page;
page = page_align(rec);
ut_a(!page_is_comp(page) == !rec_offs_comp(offsets));
@@ -1878,16 +1867,16 @@ UNIV_INTERN
ibool
page_simple_validate_old(
/*=====================*/
- page_t* page) /*!< in: old-style index page */
+ const page_t* page) /*!< in: index page in ROW_FORMAT=REDUNDANT */
{
- page_dir_slot_t* slot;
- ulint slot_no;
- ulint n_slots;
- rec_t* rec;
- byte* rec_heap_top;
- ulint count;
- ulint own_count;
- ibool ret = FALSE;
+ const page_dir_slot_t* slot;
+ ulint slot_no;
+ ulint n_slots;
+ const rec_t* rec;
+ const byte* rec_heap_top;
+ ulint count;
+ ulint own_count;
+ ibool ret = FALSE;
ut_a(!page_is_comp(page));
@@ -2000,7 +1989,7 @@ page_simple_validate_old(
goto func_exit;
}
- rec = page_rec_get_next(rec);
+ rec = page_rec_get_next_const(rec);
own_count++;
}
@@ -2061,7 +2050,7 @@ page_simple_validate_old(
goto func_exit;
}
- rec = page_rec_get_next(rec);
+ rec = page_rec_get_next_const(rec);
}
if (UNIV_UNLIKELY(page_dir_get_n_heap(page) != count + 1)) {
@@ -2088,16 +2077,16 @@ UNIV_INTERN
ibool
page_simple_validate_new(
/*=====================*/
- page_t* page) /*!< in: new-style index page */
+ const page_t* page) /*!< in: index page in ROW_FORMAT!=REDUNDANT */
{
- page_dir_slot_t* slot;
- ulint slot_no;
- ulint n_slots;
- rec_t* rec;
- byte* rec_heap_top;
- ulint count;
- ulint own_count;
- ibool ret = FALSE;
+ const page_dir_slot_t* slot;
+ ulint slot_no;
+ ulint n_slots;
+ const rec_t* rec;
+ const byte* rec_heap_top;
+ ulint count;
+ ulint own_count;
+ ibool ret = FALSE;
ut_a(page_is_comp(page));
@@ -2210,7 +2199,7 @@ page_simple_validate_new(
goto func_exit;
}
- rec = page_rec_get_next(rec);
+ rec = page_rec_get_next_const(rec);
own_count++;
}
@@ -2272,7 +2261,7 @@ page_simple_validate_new(
goto func_exit;
}
- rec = page_rec_get_next(rec);
+ rec = page_rec_get_next_const(rec);
}
if (UNIV_UNLIKELY(page_dir_get_n_heap(page) != count + 1)) {
@@ -2297,26 +2286,26 @@ UNIV_INTERN
ibool
page_validate(
/*==========*/
- page_t* page, /*!< in: index page */
+ const page_t* page, /*!< in: index page */
dict_index_t* index) /*!< in: data dictionary index containing
the page record type definition */
{
- page_dir_slot_t*slot;
- mem_heap_t* heap;
- byte* buf;
- ulint count;
- ulint own_count;
- ulint rec_own_count;
- ulint slot_no;
- ulint data_size;
- rec_t* rec;
- rec_t* old_rec = NULL;
- ulint offs;
- ulint n_slots;
- ibool ret = FALSE;
- ulint i;
- ulint* offsets = NULL;
- ulint* old_offsets = NULL;
+ const page_dir_slot_t* slot;
+ mem_heap_t* heap;
+ byte* buf;
+ ulint count;
+ ulint own_count;
+ ulint rec_own_count;
+ ulint slot_no;
+ ulint data_size;
+ const rec_t* rec;
+ const rec_t* old_rec = NULL;
+ ulint offs;
+ ulint n_slots;
+ ibool ret = FALSE;
+ ulint i;
+ ulint* offsets = NULL;
+ ulint* old_offsets = NULL;
if (UNIV_UNLIKELY((ibool) !!page_is_comp(page)
!= dict_table_is_comp(index->table))) {
@@ -2471,7 +2460,7 @@ page_validate(
count++;
own_count++;
old_rec = rec;
- rec = page_rec_get_next(rec);
+ rec = page_rec_get_next_const(rec);
/* set old_offsets to offsets; recycle offsets */
{
@@ -2545,7 +2534,7 @@ n_owned_zero:
buf[offs + i] = 1;
}
- rec = page_rec_get_next(rec);
+ rec = page_rec_get_next_const(rec);
}
if (UNIV_UNLIKELY(page_dir_get_n_heap(page) != count + 1)) {
diff --git a/storage/innobase/page/page0zip.c b/storage/innobase/page/page0zip.c
index 98640a8e6fb..c92ad9dc25b 100644
--- a/storage/innobase/page/page0zip.c
+++ b/storage/innobase/page/page0zip.c
@@ -464,7 +464,7 @@ page_zip_fields_encode(
if (fixed_sum && UNIV_UNLIKELY
(fixed_sum + field->fixed_len
- > DICT_MAX_INDEX_COL_LEN)) {
+ > DICT_MAX_FIXED_COL_LEN)) {
/* Write out the length of the
preceding non-nullable fields,
to avoid exceeding the maximum
@@ -653,13 +653,13 @@ page_zip_dir_encode(
Allocate memory for zlib. */
static
void*
-page_zip_malloc(
+page_zip_zalloc(
/*============*/
void* opaque, /*!< in/out: memory heap */
uInt items, /*!< in: number of items to allocate */
uInt size) /*!< in: size of an item in bytes */
{
- return(mem_heap_alloc(opaque, items * size));
+ return(mem_heap_zalloc(opaque, items * size));
}
/**********************************************************************//**
@@ -684,7 +684,7 @@ page_zip_set_alloc(
{
z_stream* strm = stream;
- strm->zalloc = page_zip_malloc;
+ strm->zalloc = page_zip_zalloc;
strm->zfree = page_zip_free;
strm->opaque = heap;
}
@@ -2912,19 +2912,18 @@ zlib_error:
page_zip_set_alloc(&d_stream, heap);
- if (UNIV_UNLIKELY(inflateInit2(&d_stream, UNIV_PAGE_SIZE_SHIFT)
- != Z_OK)) {
- ut_error;
- }
-
d_stream.next_in = page_zip->data + PAGE_DATA;
/* Subtract the space reserved for
the page header and the end marker of the modification log. */
d_stream.avail_in = page_zip_get_size(page_zip) - (PAGE_DATA + 1);
-
d_stream.next_out = page + PAGE_ZIP_START;
d_stream.avail_out = UNIV_PAGE_SIZE - PAGE_ZIP_START;
+ if (UNIV_UNLIKELY(inflateInit2(&d_stream, UNIV_PAGE_SIZE_SHIFT)
+ != Z_OK)) {
+ ut_error;
+ }
+
/* Decode the zlib header and the index information. */
if (UNIV_UNLIKELY(inflate(&d_stream, Z_BLOCK) != Z_OK)) {
@@ -4440,7 +4439,7 @@ page_zip_reorganize(
log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE);
#ifndef UNIV_HOTBACKUP
- temp_block = buf_block_alloc(buf_pool, 0);
+ temp_block = buf_block_alloc(buf_pool);
btr_search_drop_page_hash_index(block);
block->check_index_page_at_flush = TRUE;
#else /* !UNIV_HOTBACKUP */
@@ -4452,6 +4451,8 @@ page_zip_reorganize(
/* Copy the old page to temporary space */
buf_frame_copy(temp_page, page);
+ btr_blob_dbg_remove(page, index, "zip_reorg");
+
/* Recreate the page: note that global data on page (possible
segment headers, next page-field, etc.) is preserved intact */
@@ -4510,7 +4511,7 @@ page_zip_copy_recs(
mtr_t* mtr) /*!< in: mini-transaction */
{
ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX));
- ut_ad(mtr_memo_contains_page(mtr, (page_t*) src, MTR_MEMO_PAGE_X_FIX));
+ ut_ad(mtr_memo_contains_page(mtr, src, MTR_MEMO_PAGE_X_FIX));
ut_ad(!dict_index_is_ibuf(index));
#ifdef UNIV_ZIP_DEBUG
/* The B-tree operations that call this function may set
@@ -4580,6 +4581,7 @@ page_zip_copy_recs(
#ifdef UNIV_ZIP_DEBUG
ut_a(page_zip_validate(page_zip, page));
#endif /* UNIV_ZIP_DEBUG */
+ btr_blob_dbg_add(page, index, "page_zip_copy_recs");
page_zip_compress_write_log(page_zip, page, index, mtr);
}
diff --git a/storage/innobase/plug.in b/storage/innobase/plug.in
deleted file mode 100644
index 76d18cd8dd0..00000000000
--- a/storage/innobase/plug.in
+++ /dev/null
@@ -1,233 +0,0 @@
-#
-# Copyright (c) 2006, 2010, Innobase Oy. All Rights Reserved.
-#
-# 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
-#
-
-MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
- [Transactional Tables using InnoDB], [])
-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_HEADERS(sched.h)
- AC_CHECK_SIZEOF(int, 4)
- AC_CHECK_SIZEOF(long, 4)
- AC_CHECK_SIZEOF(void*, 4)
- AC_CHECK_FUNCS(sched_yield fdatasync localtime_r)
- AC_C_BIGENDIAN
- case "$target_os" in
- lin*)
- AC_CHECK_HEADER(libaio.h,
- AC_CHECK_LIB(aio, io_setup,
- LIBS="$LIBS -laio"
- AC_DEFINE(LINUX_NATIVE_AIO, [1],
- [Linux native async I/O support]),
- AC_MSG_WARN([No Linux native async I/O])),
- AC_MSG_WARN([No Linux native async I/O]))
-
- CFLAGS="$CFLAGS -DUNIV_LINUX";;
- hpux10*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
- hp*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
- aix*)
- CFLAGS="$CFLAGS -DUNIV_AIX";;
- irix*|osf*|sysv5uw7*|openbsd*)
- CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
- *solaris*|*SunOS*)
- CFLAGS="$CFLAGS -DUNIV_SOLARIS";;
- esac
-
- INNODB_DYNAMIC_CFLAGS="-DMYSQL_DYNAMIC_PLUGIN"
-
- case "$target_cpu" in
- x86_64)
- # The AMD64 ABI forbids absolute addresses in shared libraries
- ;;
- *86)
- # Use absolute addresses on IA-32
- INNODB_DYNAMIC_CFLAGS="$INNODB_DYNAMIC_CFLAGS -prefer-non-pic"
- ;;
- esac
- AC_SUBST(INNODB_DYNAMIC_CFLAGS)
-
- AC_MSG_CHECKING(whether GCC atomic builtins are available)
- # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
- AC_TRY_RUN(
- [
- int main()
- {
- long x;
- long y;
- long res;
- char c;
-
- x = 10;
- y = 123;
- res = __sync_bool_compare_and_swap(&x, x, y);
- if (!res || x != y) {
- return(1);
- }
-
- x = 10;
- y = 123;
- res = __sync_bool_compare_and_swap(&x, x + 1, y);
- if (res || x != 10) {
- return(1);
- }
-
- x = 10;
- y = 123;
- res = __sync_add_and_fetch(&x, y);
- if (res != 123 + 10 || x != 123 + 10) {
- return(1);
- }
-
- c = 10;
- res = __sync_lock_test_and_set(&c, 123);
- if (res != 10 || c != 123) {
- return(1);
- }
-
- return(0);
- }
- ],
- [
- AC_DEFINE([HAVE_IB_GCC_ATOMIC_BUILTINS], [1],
- [GCC atomic builtins are available])
- AC_MSG_RESULT(yes)
- ],
- [
- AC_MSG_RESULT(no)
- ]
- )
-
- AC_MSG_CHECKING(whether pthread_t can be used by GCC atomic builtins)
- # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
- AC_TRY_RUN(
- [
- #include <pthread.h>
- #include <string.h>
-
- int main(int argc, char** argv) {
- pthread_t x1;
- pthread_t x2;
- pthread_t x3;
-
- memset(&x1, 0x0, sizeof(x1));
- memset(&x2, 0x0, sizeof(x2));
- memset(&x3, 0x0, sizeof(x3));
-
- __sync_bool_compare_and_swap(&x1, x2, x3);
-
- return(0);
- }
- ],
- [
- AC_DEFINE([HAVE_IB_ATOMIC_PTHREAD_T_GCC], [1],
- [pthread_t can be used by GCC atomic builtins])
- AC_MSG_RESULT(yes)
- ],
- [
- AC_MSG_RESULT(no)
- ]
- )
-
- AC_MSG_CHECKING(whether Solaris libc atomic functions are available)
- # either define HAVE_IB_SOLARIS_ATOMICS or not
- AC_CHECK_FUNCS(atomic_add_long \
- atomic_cas_32 \
- atomic_cas_64 \
- atomic_cas_ulong,
-
- AC_DEFINE([HAVE_IB_SOLARIS_ATOMICS], [1],
- [Define to 1 if Solaris libc atomic functions \
- are available])
- )
-
- AC_MSG_CHECKING(whether pthread_t can be used by Solaris libc atomic functions)
- # either define HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS or not
- AC_TRY_RUN(
- [
- #include <pthread.h>
- #include <string.h>
-
- int main(int argc, char** argv) {
- pthread_t x1;
- pthread_t x2;
- pthread_t x3;
-
- memset(&x1, 0x0, sizeof(x1));
- memset(&x2, 0x0, sizeof(x2));
- memset(&x3, 0x0, sizeof(x3));
-
- if (sizeof(pthread_t) == 4) {
-
- atomic_cas_32(&x1, x2, x3);
-
- } else if (sizeof(pthread_t) == 8) {
-
- atomic_cas_64(&x1, x2, x3);
-
- } else {
-
- return(1);
- }
-
- return(0);
- }
- ],
- [
- AC_DEFINE([HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS], [1],
- [pthread_t can be used by solaris atomics])
- AC_MSG_RESULT(yes)
- ],
- [
- AC_MSG_RESULT(no)
- ]
- )
-
- # this is needed to know which one of atomic_cas_32() or atomic_cas_64()
- # to use in the source
- AC_CHECK_SIZEOF([pthread_t], [], [#include <pthread.h>])
-
- # Check for x86 PAUSE instruction
- AC_MSG_CHECKING(for x86 PAUSE instruction)
- # We have to actually try running the test program, because of a bug
- # in Solaris on x86_64, where it wrongly reports that PAUSE is not
- # supported when trying to run an application. See
- # http://bugs.opensolaris.org/bugdatabase/printableBug.do?bug_id=6478684
- # We use ib_ prefix to avoid collisoins if this code is added to
- # mysql's configure.in.
- AC_TRY_RUN(
- [
- int main() {
- __asm__ __volatile__ ("pause");
- return(0);
- }
- ],
- [
- AC_DEFINE([HAVE_IB_PAUSE_INSTRUCTION], [1], [Does x86 PAUSE instruction exist])
- AC_MSG_RESULT(yes)
- ],
- [
- AC_MSG_RESULT(no)
- ],
- [
- AC_MSG_RESULT(no)
- ]
- )
- ])
-
-# vim: set ft=config:
diff --git a/storage/innobase/rem/rem0cmp.c b/storage/innobase/rem/rem0cmp.c
index 35b67992558..04d2c15437b 100644
--- a/storage/innobase/rem/rem0cmp.c
+++ b/storage/innobase/rem/rem0cmp.c
@@ -862,6 +862,10 @@ cmp_rec_rec_with_match(
const ulint* offsets1,/*!< in: rec_get_offsets(rec1, index) */
const ulint* offsets2,/*!< in: rec_get_offsets(rec2, index) */
dict_index_t* index, /*!< in: data dictionary index */
+ ibool nulls_unequal,
+ /* in: TRUE if this is for index statistics
+ cardinality estimation, and innodb_stats_method
+ is "nulls_unequal" or "nulls_ignored" */
ulint* matched_fields, /*!< in/out: number of already completely
matched fields; when the function returns,
contains the value the for current
@@ -961,9 +965,13 @@ cmp_rec_rec_with_match(
|| rec2_f_len == UNIV_SQL_NULL) {
if (rec1_f_len == rec2_f_len) {
-
- goto next_field;
-
+ /* This is limited to stats collection,
+ cannot use it for regular search */
+ if (nulls_unequal) {
+ ret = -1;
+ } else {
+ goto next_field;
+ }
} else if (rec2_f_len == UNIV_SQL_NULL) {
/* We define the SQL null to be the
diff --git a/storage/innobase/rem/rem0rec.c b/storage/innobase/rem/rem0rec.c
index 37ba8ca2ffe..5a96e608ab5 100644
--- a/storage/innobase/rem/rem0rec.c
+++ b/storage/innobase/rem/rem0rec.c
@@ -1174,7 +1174,7 @@ rec_convert_dtuple_to_rec_comp(
} else if (dfield_is_ext(field)) {
ut_ad(ifield->col->len >= 256
|| ifield->col->mtype == DATA_BLOB);
- ut_ad(len <= REC_MAX_INDEX_COL_LEN
+ ut_ad(len <= REC_ANTELOPE_MAX_INDEX_COL_LEN
+ BTR_EXTERN_FIELD_REF_SIZE);
*lens-- = (byte) (len >> 8) | 0xc0;
*lens-- = (byte) len;
@@ -1749,9 +1749,9 @@ UNIV_INTERN
void
rec_print(
/*======*/
- FILE* file, /*!< in: file where to print */
- const rec_t* rec, /*!< in: physical record */
- dict_index_t* index) /*!< in: record descriptor */
+ FILE* file, /*!< in: file where to print */
+ const rec_t* rec, /*!< in: physical record */
+ const dict_index_t* index) /*!< in: record descriptor */
{
ut_ad(index);
diff --git a/storage/innobase/row/row0ext.c b/storage/innobase/row/row0ext.c
index 7320f5b1dca..07e970cf485 100644
--- a/storage/innobase/row/row0ext.c
+++ b/storage/innobase/row/row0ext.c
@@ -44,8 +44,9 @@ row_ext_cache_fill(
{
const byte* field = dfield_get_data(dfield);
ulint f_len = dfield_get_len(dfield);
- byte* buf = ext->buf + i * REC_MAX_INDEX_COL_LEN;
+ byte* buf = ext->buf + i * ext->max_len;
+ ut_ad(ext->max_len > 0);
ut_ad(i < ext->n_ext);
ut_ad(dfield_is_ext(dfield));
ut_a(f_len >= BTR_EXTERN_FIELD_REF_SIZE);
@@ -56,14 +57,14 @@ row_ext_cache_fill(
/* The BLOB pointer is not set: we cannot fetch it */
ext->len[i] = 0;
} else {
- /* Fetch at most REC_MAX_INDEX_COL_LEN of the column.
+ /* Fetch at most ext->max_len of the column.
The column should be non-empty. However,
trx_rollback_or_clean_all_recovered() may try to
access a half-deleted BLOB if the server previously
crashed during the execution of
btr_free_externally_stored_field(). */
ext->len[i] = btr_copy_externally_stored_field_prefix(
- buf, REC_MAX_INDEX_COL_LEN, zip_size, field, f_len);
+ buf, ext->max_len, zip_size, field, f_len);
}
}
@@ -79,16 +80,18 @@ row_ext_create(
in the InnoDB table object, as reported by
dict_col_get_no(); NOT relative to the records
in the clustered index */
+ ulint flags, /*!< in: table->flags */
const dtuple_t* tuple, /*!< in: data tuple containing the field
references of the externally stored
columns; must be indexed by col_no;
the clustered index record must be
covered by a lock or a page latch
to prevent deletion (rollback or purge). */
- ulint zip_size,/*!< compressed page size in bytes, or 0 */
mem_heap_t* heap) /*!< in: heap where created */
{
ulint i;
+ ulint zip_size = dict_table_flags_to_zip_size(flags);
+
row_ext_t* ret = mem_heap_alloc(heap, (sizeof *ret)
+ (n_ext - 1) * sizeof ret->len);
@@ -97,10 +100,12 @@ row_ext_create(
ret->n_ext = n_ext;
ret->ext = ext;
- ret->buf = mem_heap_alloc(heap, n_ext * REC_MAX_INDEX_COL_LEN);
+ ret->max_len = DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(flags);
+
+ ret->buf = mem_heap_alloc(heap, n_ext * ret->max_len);
#ifdef UNIV_DEBUG
- memset(ret->buf, 0xaa, n_ext * REC_MAX_INDEX_COL_LEN);
- UNIV_MEM_ALLOC(ret->buf, n_ext * REC_MAX_INDEX_COL_LEN);
+ memset(ret->buf, 0xaa, n_ext * ret->max_len);
+ UNIV_MEM_ALLOC(ret->buf, n_ext * ret->max_len);
#endif
/* Fetch the BLOB prefixes */
diff --git a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c
index 8fd8c4f8532..e0414cde80d 100644
--- a/storage/innobase/row/row0ins.c
+++ b/storage/innobase/row/row0ins.c
@@ -1525,7 +1525,7 @@ row_ins_check_foreign_constraints(
if (foreign->foreign_index == index) {
if (foreign->referenced_table == NULL) {
- dict_table_get(foreign->referenced_table_name,
+ dict_table_get(foreign->referenced_table_name_lookup,
FALSE);
}
@@ -1768,7 +1768,7 @@ ulint
row_ins_duplicate_error_in_clust(
/*=============================*/
btr_cur_t* cursor, /*!< in: B-tree cursor */
- dtuple_t* entry, /*!< in: entry to insert */
+ const dtuple_t* entry, /*!< in: entry to insert */
que_thr_t* thr, /*!< in: query thread */
mtr_t* mtr) /*!< in: mtr */
{
@@ -1964,7 +1964,7 @@ row_ins_index_entry_low(
depending on whether we wish optimistic or
pessimistic descent down the index tree */
dict_index_t* index, /*!< in: index */
- dtuple_t* entry, /*!< in: index entry to insert */
+ dtuple_t* entry, /*!< in/out: index entry to insert */
ulint n_ext, /*!< in: number of externally stored columns */
que_thr_t* thr) /*!< in: query thread */
{
@@ -2122,7 +2122,7 @@ function_exit:
err = btr_store_big_rec_extern_fields(
index, btr_cur_get_block(&cursor),
- rec, offsets, big_rec, &mtr);
+ rec, offsets, &mtr, FALSE, big_rec);
if (modify) {
dtuple_big_rec_free(big_rec);
@@ -2150,9 +2150,10 @@ ulint
row_ins_index_entry(
/*================*/
dict_index_t* index, /*!< in: index */
- dtuple_t* entry, /*!< in: index entry to insert */
+ dtuple_t* entry, /*!< in/out: index entry to insert */
ulint n_ext, /*!< in: number of externally stored columns */
- ibool foreign,/*!< in: TRUE=check foreign key constraints */
+ ibool foreign,/*!< in: TRUE=check foreign key constraints
+ (foreign=FALSE only during CREATE INDEX) */
que_thr_t* thr) /*!< in: query thread */
{
ulint err;
diff --git a/storage/innobase/row/row0merge.c b/storage/innobase/row/row0merge.c
index 1b96ff50e66..5be437add5a 100644
--- a/storage/innobase/row/row0merge.c
+++ b/storage/innobase/row/row0merge.c
@@ -1929,7 +1929,6 @@ row_merge_lock_table(
sel_node_t* node;
ut_ad(trx);
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
ut_ad(mode == LOCK_X || mode == LOCK_S);
heap = mem_heap_create(512);
@@ -2042,7 +2041,7 @@ row_merge_drop_index(
/* Replace this index with another equivalent index for all
foreign key constraints on this table where this index is used */
- dict_table_replace_index_in_foreign_list(table, index);
+ dict_table_replace_index_in_foreign_list(table, index, trx);
dict_index_remove_from_cache(table, index);
trx->op_info = "";
@@ -2158,13 +2157,15 @@ row_merge_drop_temp_indexes(void)
}
/*********************************************************************//**
-Create a merge file. */
-static
-void
-row_merge_file_create(
-/*==================*/
- merge_file_t* merge_file) /*!< out: merge file structure */
+Creates temperary merge files, and if UNIV_PFS_IO defined, register
+the file descriptor with Performance Schema.
+@return File descriptor */
+UNIV_INLINE
+int
+row_merge_file_create_low(void)
+/*===========================*/
{
+ int fd;
#ifdef UNIV_PFS_IO
/* This temp file open does not go through normal
file APIs, add instrumentation to register with
@@ -2176,37 +2177,59 @@ row_merge_file_create(
"Innodb Merge Temp File",
__FILE__, __LINE__);
#endif
- merge_file->fd = innobase_mysql_tmpfile();
- merge_file->offset = 0;
- merge_file->n_rec = 0;
+ fd = innobase_mysql_tmpfile();
#ifdef UNIV_PFS_IO
- register_pfs_file_open_end(locker, merge_file->fd);
+ register_pfs_file_open_end(locker, fd);
#endif
+ return(fd);
}
-
/*********************************************************************//**
-Destroy a merge file. */
+Create a merge file. */
static
void
-row_merge_file_destroy(
-/*===================*/
+row_merge_file_create(
+/*==================*/
merge_file_t* merge_file) /*!< out: merge file structure */
{
+ merge_file->fd = row_merge_file_create_low();
+ merge_file->offset = 0;
+ merge_file->n_rec = 0;
+}
+
+/*********************************************************************//**
+Destroy a merge file. And de-register the file from Performance Schema
+if UNIV_PFS_IO is defined. */
+UNIV_INLINE
+void
+row_merge_file_destroy_low(
+/*=======================*/
+ int fd) /*!< in: merge file descriptor */
+{
#ifdef UNIV_PFS_IO
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
- register_pfs_file_io_begin(&state, locker, merge_file->fd, 0, PSI_FILE_CLOSE,
+ register_pfs_file_io_begin(&state, locker,
+ fd, 0, PSI_FILE_CLOSE,
__FILE__, __LINE__);
#endif
- if (merge_file->fd != -1) {
- close(merge_file->fd);
- merge_file->fd = -1;
- }
-
+ close(fd);
#ifdef UNIV_PFS_IO
register_pfs_file_io_end(locker, 0);
#endif
}
+/*********************************************************************//**
+Destroy a merge file. */
+static
+void
+row_merge_file_destroy(
+/*===================*/
+ merge_file_t* merge_file) /*!< out: merge file structure */
+{
+ if (merge_file->fd != -1) {
+ row_merge_file_destroy_low(merge_file->fd);
+ merge_file->fd = -1;
+ }
+}
/*********************************************************************//**
Determine the precise type of a column that is added to a tem
@@ -2364,9 +2387,8 @@ row_merge_rename_tables(
{
ulint err = DB_ERROR;
pars_info_t* info;
- char old_name[MAX_TABLE_NAME_LEN + 1];
+ char old_name[MAX_FULL_NAME_LEN + 1];
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
ut_ad(old_table != new_table);
ut_ad(mutex_own(&dict_sys->mutex));
@@ -2379,7 +2401,7 @@ row_merge_rename_tables(
ut_print_timestamp(stderr);
fprintf(stderr, "InnoDB: too long table name: '%s', "
"max length is %d\n", old_table->name,
- MAX_TABLE_NAME_LEN);
+ MAX_FULL_NAME_LEN);
ut_error;
}
@@ -2600,7 +2622,7 @@ row_merge_build_indexes(
row_merge_file_create(&merge_files[i]);
}
- tmpfd = innobase_mysql_tmpfile();
+ tmpfd = row_merge_file_create_low();
/* Reset the MySQL row buffer that is used when reporting
duplicate keys. */
@@ -2642,7 +2664,7 @@ row_merge_build_indexes(
}
func_exit:
- close(tmpfd);
+ row_merge_file_destroy_low(tmpfd);
for (i = 0; i < n_indexes; i++) {
row_merge_file_destroy(&merge_files[i]);
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index 3e155fd14e6..e1ada387729 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -503,7 +503,7 @@ row_mysql_convert_row_to_innobase(
row is used, as row may contain
pointers to this record! */
{
- mysql_row_templ_t* templ;
+ const mysql_row_templ_t*templ;
dfield_t* dfield;
ulint i;
@@ -632,7 +632,7 @@ handle_new_error:
"InnoDB: If the mysqld server crashes"
" after the startup or when\n"
"InnoDB: you dump the tables, look at\n"
- "InnoDB: " REFMAN "forcing-recovery.html"
+ "InnoDB: " REFMAN "forcing-innodb-recovery.html"
" for help.\n", stderr);
break;
case DB_FOREIGN_EXCEED_MAX_CASCADE:
@@ -930,7 +930,8 @@ row_update_statistics_if_needed(
if (counter > 2000000000
|| ((ib_int64_t)counter > 16 + table->stat_n_rows / 16)) {
- dict_update_statistics(table);
+ dict_update_statistics(table, FALSE /* update even if stats
+ are initialized */);
}
}
@@ -975,7 +976,6 @@ row_lock_table_autoinc_for_mysql(
ibool was_lock_wait;
ut_ad(trx);
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
/* If we already hold an AUTOINC lock on the table then do nothing.
Note: We peek at the value of the current owner without acquiring
@@ -1055,7 +1055,6 @@ row_lock_table_for_mysql(
ibool was_lock_wait;
ut_ad(trx);
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
trx->op_info = "setting table lock";
@@ -1129,7 +1128,6 @@ row_insert_for_mysql(
ins_node_t* node = prebuilt->ins_node;
ut_ad(trx);
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
if (prebuilt->table->ibd_file_missing) {
ut_print_timestamp(stderr);
@@ -1363,7 +1361,6 @@ row_update_for_mysql(
trx_t* trx = prebuilt->trx;
ut_ad(prebuilt && trx);
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
UT_NOT_USED(mysql_rec);
if (prebuilt->table->ibd_file_missing) {
@@ -1531,7 +1528,6 @@ row_unlock_for_mysql(
trx_t* trx = prebuilt->trx;
ut_ad(prebuilt && trx);
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
if (UNIV_UNLIKELY
(!srv_locks_unsafe_for_binlog
@@ -1833,7 +1829,6 @@ row_create_table_for_mysql(
ulint table_name_len;
ulint err;
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX));
#endif /* UNIV_SYNC_DEBUG */
@@ -1938,15 +1933,13 @@ err_exit:
err = trx->error_state;
- if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
+ switch (err) {
+ case DB_SUCCESS:
+ break;
+ case DB_OUT_OF_FILE_SPACE:
trx->error_state = DB_SUCCESS;
trx_general_rollback_for_mysql(trx, NULL);
- /* TO DO: free table? The code below will dereference
- table->name, though. */
- }
- switch (err) {
- case DB_OUT_OF_FILE_SPACE:
ut_print_timestamp(stderr);
fputs(" InnoDB: Warning: cannot create table ",
stderr);
@@ -1961,9 +1954,13 @@ err_exit:
break;
case DB_DUPLICATE_KEY:
+ default:
/* We may also get err == DB_ERROR if the .ibd file for the
table already exists */
+ trx->error_state = DB_SUCCESS;
+ trx_general_rollback_for_mysql(trx, NULL);
+ dict_mem_table_free(table);
break;
}
@@ -2000,12 +1997,12 @@ row_create_index_for_mysql(
ulint i;
ulint len;
char* table_name;
+ dict_table_t* table;
#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX));
#endif /* UNIV_SYNC_DEBUG */
ut_ad(mutex_own(&(dict_sys->mutex)));
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
trx->op_info = "creating index";
@@ -2014,6 +2011,8 @@ row_create_index_for_mysql(
que_run_threads()) and thus index->table_name is not available. */
table_name = mem_strdup(index->table_name);
+ table = dict_table_get_low(table_name);
+
trx_start_if_not_started(trx);
/* Check that the same column does not appear twice in the index.
@@ -2046,7 +2045,7 @@ row_create_index_for_mysql(
}
/* Check also that prefix_len and actual length
- < DICT_MAX_INDEX_COL_LEN */
+ is less than that from DICT_MAX_FIELD_LEN_BY_FORMAT() */
len = dict_index_get_nth_field(index, i)->prefix_len;
@@ -2054,8 +2053,9 @@ row_create_index_for_mysql(
len = ut_max(len, field_lengths[i]);
}
- if (len >= DICT_MAX_INDEX_COL_LEN) {
- err = DB_TOO_BIG_RECORD;
+ /* Column or prefix length exceeds maximum column length */
+ if (len > (ulint) DICT_MAX_FIELD_LEN_BY_FORMAT(table)) {
+ err = DB_TOO_BIG_INDEX_COL;
goto error_handling;
}
@@ -2080,6 +2080,7 @@ row_create_index_for_mysql(
que_graph_free((que_t*) que_node_get_parent(thr));
error_handling:
+
if (err != DB_SUCCESS) {
/* We have special error handling here */
@@ -2408,8 +2409,6 @@ row_discard_tablespace_for_mysql(
table->n_foreign_key_checks_running > 0, we do not allow the
discard. We also reserve the data dictionary latch. */
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
-
trx->op_info = "discarding tablespace";
trx_start_if_not_started(trx);
@@ -2568,8 +2567,6 @@ row_import_tablespace_for_mysql(
ib_uint64_t current_lsn;
ulint err = DB_SUCCESS;
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
-
trx_start_if_not_started(trx);
trx->op_info = "importing tablespace";
@@ -2753,7 +2750,6 @@ row_truncate_table_for_mysql(
redo log records on the truncated tablespace, we will assign
a new tablespace identifier to the truncated tablespace. */
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
ut_ad(table);
if (srv_created_new_raw) {
@@ -2839,15 +2835,6 @@ row_truncate_table_for_mysql(
trx->table_id = table->id;
- /* Lock all index trees for this table, as we will
- truncate the table/index and possibly change their metadata.
- All DML/DDL are blocked by table level lock, with
- a few exceptions such as queries into information schema
- about the table, MySQL could try to access index stats
- for this kind of query, we need to use index locks to
- sync up */
- dict_table_x_lock_indexes(table);
-
if (table->space && !table->dir_path_of_temp_table) {
/* Discard and create the single-table tablespace. */
ulint space = table->space;
@@ -2860,6 +2847,11 @@ row_truncate_table_for_mysql(
dict_hdr_get_new_id(NULL, NULL, &space);
+ /* Lock all index trees for this table. We must
+ do so after dict_hdr_get_new_id() to preserve
+ the latch order */
+ dict_table_x_lock_indexes(table);
+
if (space == ULINT_UNDEFINED
|| fil_create_new_single_table_tablespace(
space, table->name, FALSE, flags,
@@ -2893,6 +2885,15 @@ row_truncate_table_for_mysql(
FIL_IBD_FILE_INITIAL_SIZE, &mtr);
mtr_commit(&mtr);
}
+ } else {
+ /* Lock all index trees for this table, as we will
+ truncate the table/index and possibly change their metadata.
+ All DML/DDL are blocked by table level lock, with
+ a few exceptions such as queries into information schema
+ about the table, MySQL could try to access index stats
+ for this kind of query, we need to use index locks to
+ sync up */
+ dict_table_x_lock_indexes(table);
}
/* scan SYS_INDEXES for all indexes of the table */
@@ -2945,7 +2946,7 @@ row_truncate_table_for_mysql(
rec = btr_pcur_get_rec(&pcur);
if (root_page_no != FIL_NULL) {
- page_rec_write_index_page_no(
+ page_rec_write_field(
rec, DICT_SYS_INDEXES_PAGE_NO_FIELD,
root_page_no, &mtr);
/* We will need to commit and restart the
@@ -3011,12 +3012,12 @@ next_rec:
dict_table_change_id_in_cache(table, new_id);
}
- /* MySQL calls ha_innobase::reset_auto_increment() which does
- the same thing. */
+ /* Reset auto-increment. */
dict_table_autoinc_lock(table);
dict_table_autoinc_initialize(table, 1);
dict_table_autoinc_unlock(table);
- dict_update_statistics(table);
+ dict_update_statistics(table, FALSE /* update even if stats are
+ initialized */);
trx_commit_for_mysql(trx);
@@ -3124,7 +3125,7 @@ row_drop_table_for_mysql(
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX));
#endif /* UNIV_SYNC_DEBUG */
- table = dict_table_get_low(name);
+ table = dict_table_get_low_ignore_err(name, DICT_ERR_IGNORE_INDEX_ROOT);
if (!table) {
err = DB_TABLE_NOT_FOUND;
@@ -3157,7 +3158,7 @@ check_next_foreign:
if (foreign && trx->check_foreigns
&& !(drop_db && dict_tables_have_same_db(
- name, foreign->foreign_table_name))) {
+ name, foreign->foreign_table_name_lookup))) {
FILE* ef = dict_foreign_err_file;
/* We only allow dropping a referenced table if
@@ -3359,7 +3360,7 @@ check_next_foreign:
dict_table_remove_from_cache(table);
- if (dict_load_table(name, TRUE) != NULL) {
+ if (dict_load_table(name, TRUE, DICT_ERR_IGNORE_NONE) != NULL) {
ut_print_timestamp(stderr);
fputs(" InnoDB: Error: not able to remove table ",
stderr);
@@ -3505,7 +3506,7 @@ row_mysql_drop_temp_tables(void)
btr_pcur_store_position(&pcur, &mtr);
btr_pcur_commit_specify_mtr(&pcur, &mtr);
- table = dict_load_table(table_name, TRUE);
+ table = dict_load_table(table_name, TRUE, DICT_ERR_IGNORE_NONE);
if (table) {
row_drop_table_for_mysql(table_name, trx, FALSE);
@@ -3599,7 +3600,6 @@ row_drop_database_for_mysql(
int err = DB_SUCCESS;
ulint namelen = strlen(name);
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
ut_a(name != NULL);
ut_a(name[namelen - 1] == '/');
@@ -3769,7 +3769,6 @@ row_rename_table_for_mysql(
ibool old_is_tmp, new_is_tmp;
pars_info_t* info = NULL;
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
ut_a(old_name != NULL);
ut_a(new_name != NULL);
diff --git a/storage/innobase/row/row0purge.c b/storage/innobase/row/row0purge.c
index 031b5258e98..83e7c9e4857 100644
--- a/storage/innobase/row/row0purge.c
+++ b/storage/innobase/row/row0purge.c
@@ -489,8 +489,11 @@ Purges an update of an existing record. Also purges an update of a delete
marked record if that record contained an externally stored field. */
static
void
-row_purge_upd_exist_or_extern(
-/*==========================*/
+row_purge_upd_exist_or_extern_func(
+/*===============================*/
+#ifdef UNIV_DEBUG
+ const que_thr_t*thr, /*!< in: query thread */
+#endif /* UNIV_DEBUG */
purge_node_t* node) /*!< in: row purge node */
{
mem_heap_t* heap;
@@ -515,8 +518,8 @@ row_purge_upd_exist_or_extern(
while (node->index != NULL) {
index = node->index;
- if (row_upd_changes_ord_field_binary(NULL, node->index,
- node->update)) {
+ if (row_upd_changes_ord_field_binary(node->index, node->update,
+ thr, NULL, NULL)) {
/* Build the older version of the index entry */
entry = row_build_index_entry(node->row, NULL,
index, heap);
@@ -598,6 +601,14 @@ skip_secondaries:
}
}
+#ifdef UNIV_DEBUG
+# define row_purge_upd_exist_or_extern(thr,node) \
+ row_purge_upd_exist_or_extern_func(thr,node)
+#else /* UNIV_DEBUG */
+# define row_purge_upd_exist_or_extern(thr,node) \
+ row_purge_upd_exist_or_extern_func(node)
+#endif /* UNIV_DEBUG */
+
/***********************************************************//**
Parses the row reference and other info in a modify undo log record.
@return TRUE if purge operation required: NOTE that then the CALLER
@@ -704,47 +715,32 @@ err_exit:
/***********************************************************//**
Fetches an undo log record and does the purge for the recorded operation.
If none left, or the current purge completed, returns the control to the
-parent node, which is always a query thread node.
-@return DB_SUCCESS if operation successfully completed, else error code */
-static
-ulint
+parent node, which is always a query thread node. */
+static __attribute__((nonnull))
+void
row_purge(
/*======*/
purge_node_t* node, /*!< in: row purge node */
que_thr_t* thr) /*!< in: query thread */
{
- roll_ptr_t roll_ptr;
- ibool purge_needed;
ibool updated_extern;
- trx_t* trx;
- ut_ad(node && thr);
-
- trx = thr_get_trx(thr);
+ ut_ad(node);
+ ut_ad(thr);
- node->undo_rec = trx_purge_fetch_next_rec(&roll_ptr,
- &(node->reservation),
+ node->undo_rec = trx_purge_fetch_next_rec(&node->roll_ptr,
+ &node->reservation,
node->heap);
if (!node->undo_rec) {
/* Purge completed for this query thread */
thr->run_node = que_node_get_parent(node);
- return(DB_SUCCESS);
- }
-
- node->roll_ptr = roll_ptr;
-
- if (node->undo_rec == &trx_purge_dummy_rec) {
- purge_needed = FALSE;
- } else {
- purge_needed = row_purge_parse_undo_rec(node, &updated_extern,
- thr);
- /* If purge_needed == TRUE, we must also remember to unfreeze
- data dictionary! */
+ return;
}
- if (purge_needed) {
+ if (node->undo_rec != &trx_purge_dummy_rec
+ && row_purge_parse_undo_rec(node, &updated_extern, thr)) {
node->found_clust = FALSE;
node->index = dict_table_get_next_index(
@@ -756,14 +752,14 @@ row_purge(
} else if (updated_extern
|| node->rec_type == TRX_UNDO_UPD_EXIST_REC) {
- row_purge_upd_exist_or_extern(node);
+ row_purge_upd_exist_or_extern(thr, node);
}
if (node->found_clust) {
btr_pcur_close(&(node->pcur));
}
- row_mysql_unfreeze_data_dictionary(trx);
+ row_mysql_unfreeze_data_dictionary(thr_get_trx(thr));
}
/* Do some cleanup */
@@ -771,8 +767,6 @@ row_purge(
mem_heap_empty(node->heap);
thr->run_node = node;
-
- return(DB_SUCCESS);
}
/***********************************************************//**
@@ -786,9 +780,6 @@ row_purge_step(
que_thr_t* thr) /*!< in: query thread */
{
purge_node_t* node;
-#ifdef UNIV_DEBUG
- ulint err;
-#endif /* UNIV_DEBUG */
ut_ad(thr);
@@ -796,12 +787,7 @@ row_purge_step(
ut_ad(que_node_get_type(node) == QUE_NODE_PURGE);
-#ifdef UNIV_DEBUG
- err =
-#endif /* UNIV_DEBUG */
row_purge(node, thr);
- ut_ad(err == DB_SUCCESS);
-
return(thr);
}
diff --git a/storage/innobase/row/row0row.c b/storage/innobase/row/row0row.c
index 050b8522fa3..3bd0323ddbe 100644
--- a/storage/innobase/row/row0row.c
+++ b/storage/innobase/row/row0row.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -47,35 +47,6 @@ Created 4/20/1996 Heikki Tuuri
#include "read0read.h"
#include "ut0mem.h"
-/*********************************************************************//**
-Gets the offset of trx id field, in bytes relative to the origin of
-a clustered index record.
-@return offset of DATA_TRX_ID */
-UNIV_INTERN
-ulint
-row_get_trx_id_offset(
-/*==================*/
- const rec_t* rec __attribute__((unused)),
- /*!< in: record */
- dict_index_t* index, /*!< in: clustered index */
- const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
-{
- ulint pos;
- ulint offset;
- ulint len;
-
- ut_ad(dict_index_is_clust(index));
- ut_ad(rec_offs_validate(rec, index, offsets));
-
- pos = dict_index_get_sys_col_pos(index, DATA_TRX_ID);
-
- offset = rec_get_nth_field_offs(offsets, pos, &len);
-
- ut_ad(len == DATA_TRX_ID_LEN);
-
- return(offset);
-}
-
/*****************************************************************//**
When an insert or purge to a table is performed, this function builds
the entry to be inserted into or purged from an index on the table.
@@ -151,8 +122,6 @@ row_build_index_entry(
} else if (dfield_is_ext(dfield)) {
ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
len -= BTR_EXTERN_FIELD_REF_SIZE;
- ut_a(ind_field->prefix_len <= len
- || dict_index_is_clust(index));
}
len = dtype_get_at_most_n_mbchars(
@@ -231,6 +200,14 @@ row_build(
ut_ad(rec_offs_validate(rec, index, offsets));
}
+#if 0 && defined UNIV_BLOB_NULL_DEBUG
+ /* This one can fail in trx_rollback_active() if
+ the server crashed during an insert before the
+ btr_store_big_rec_extern_fields() did mtr_commit()
+ all BLOB pointers to the clustered index record. */
+ ut_a(!rec_offs_any_null_extern(rec, offsets));
+#endif /* 0 && UNIV_BLOB_NULL_DEBUG */
+
if (type != ROW_COPY_POINTERS) {
/* Take a copy of rec to heap */
buf = mem_heap_alloc(heap, rec_offs_size(offsets));
@@ -301,8 +278,7 @@ row_build(
ut_ad(dict_table_get_format(index->table)
< DICT_TF_FORMAT_ZIP);
} else if (j) {
- *ext = row_ext_create(j, ext_cols, row,
- dict_table_zip_size(index->table),
+ *ext = row_ext_create(j, ext_cols, index->table->flags, row,
heap);
} else {
*ext = NULL;
@@ -415,6 +391,10 @@ row_rec_to_index_entry(
rec = rec_copy(buf, rec, offsets);
/* Avoid a debug assertion in rec_offs_validate(). */
rec_offs_make_valid(rec, index, offsets);
+#ifdef UNIV_BLOB_NULL_DEBUG
+ } else {
+ ut_a(!rec_offs_any_null_extern(rec, offsets));
+#endif /* UNIV_BLOB_NULL_DEBUG */
}
entry = row_rec_to_index_entry_low(rec, index, offsets, n_ext, heap);
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index 4d874ab3940..53d0c2ec232 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -99,12 +99,26 @@ row_sel_sec_rec_is_for_blob(
ulint clust_len, /*!< in: length of clust_field */
const byte* sec_field, /*!< in: column in secondary index */
ulint sec_len, /*!< in: length of sec_field */
- ulint zip_size) /*!< in: compressed page size, or 0 */
+ dict_table_t* table) /*!< in: table */
{
ulint len;
- byte buf[DICT_MAX_INDEX_COL_LEN];
+ byte buf[REC_VERSION_56_MAX_INDEX_COL_LEN];
+ ulint zip_size = dict_table_flags_to_zip_size(table->flags);
+ ulint max_prefix_len = DICT_MAX_FIELD_LEN_BY_FORMAT(table);
+
+ ut_a(clust_len >= BTR_EXTERN_FIELD_REF_SIZE);
+
+ if (UNIV_UNLIKELY
+ (!memcmp(clust_field + clust_len - BTR_EXTERN_FIELD_REF_SIZE,
+ field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE))) {
+ /* The externally stored field was not written yet.
+ This record should only be seen by
+ recv_recovery_rollback_active() or any
+ TRX_ISO_READ_UNCOMMITTED transactions. */
+ return(FALSE);
+ }
- len = btr_copy_externally_stored_field_prefix(buf, sizeof buf,
+ len = btr_copy_externally_stored_field_prefix(buf, max_prefix_len,
zip_size,
clust_field, clust_len);
@@ -210,8 +224,7 @@ row_sel_sec_rec_is_for_clust_rec(
col->mbminmaxlen,
clust_field, clust_len,
sec_field, sec_len,
- dict_table_zip_size(
- clust_index->table))) {
+ clust_index->table)) {
goto inequal;
}
@@ -1939,7 +1952,7 @@ stop_for_a_while:
mtr_commit(&mtr);
#ifdef UNIV_SYNC_DEBUG
- ut_ad(sync_thread_levels_empty_gen(TRUE));
+ ut_ad(sync_thread_levels_empty_except_dict());
#endif /* UNIV_SYNC_DEBUG */
err = DB_SUCCESS;
goto func_exit;
@@ -1959,7 +1972,7 @@ commit_mtr_for_a_while:
mtr_has_extra_clust_latch = FALSE;
#ifdef UNIV_SYNC_DEBUG
- ut_ad(sync_thread_levels_empty_gen(TRUE));
+ ut_ad(sync_thread_levels_empty_except_dict());
#endif /* UNIV_SYNC_DEBUG */
goto table_loop;
@@ -1976,7 +1989,7 @@ lock_wait_or_error:
mtr_commit(&mtr);
#ifdef UNIV_SYNC_DEBUG
- ut_ad(sync_thread_levels_empty_gen(TRUE));
+ ut_ad(sync_thread_levels_empty_except_dict());
#endif /* UNIV_SYNC_DEBUG */
func_exit:
@@ -2667,17 +2680,17 @@ row_sel_store_mysql_rec(
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */
const rec_t* rec, /*!< in: Innobase record in the index
which was described in prebuilt's
- template; must be protected by
- a page latch */
+ template, or in the clustered index;
+ must be protected by a page latch */
+ ibool rec_clust, /*!< in: TRUE if rec is in the
+ clustered index instead of
+ prebuilt->index */
const ulint* offsets) /*!< in: array returned by
- rec_get_offsets() */
+ rec_get_offsets(rec) */
{
- mysql_row_templ_t* templ;
- mem_heap_t* extern_field_heap = NULL;
- mem_heap_t* heap;
- const byte* data;
- ulint len;
- ulint i;
+ mem_heap_t* extern_field_heap = NULL;
+ mem_heap_t* heap;
+ ulint i;
ut_ad(prebuilt->mysql_template);
ut_ad(prebuilt->default_rec);
@@ -2689,18 +2702,17 @@ row_sel_store_mysql_rec(
prebuilt->blob_heap = NULL;
}
- /* init null bytes with default values as they might be
- left uninitialized in some cases and these uninited bytes
- might be copied into mysql record buffer that leads to
- valgrind warnings */
- memcpy(mysql_rec, prebuilt->default_rec, prebuilt->null_bitmap_len);
-
for (i = 0; i < prebuilt->n_template; i++) {
- templ = prebuilt->mysql_template + i;
+ const mysql_row_templ_t*templ = prebuilt->mysql_template + i;
+ const byte* data;
+ ulint len;
+ ulint field_no;
+
+ field_no = rec_clust
+ ? templ->clust_rec_field_no : templ->rec_field_no;
- if (UNIV_UNLIKELY(rec_offs_nth_extern(offsets,
- templ->rec_field_no))) {
+ if (UNIV_UNLIKELY(rec_offs_nth_extern(offsets, field_no))) {
/* Copy an externally stored field to the temporary
heap */
@@ -2728,7 +2740,7 @@ row_sel_store_mysql_rec(
data = btr_rec_copy_externally_stored_field(
rec, offsets,
dict_table_zip_size(prebuilt->table),
- templ->rec_field_no, &len, heap);
+ field_no, &len, heap);
if (UNIV_UNLIKELY(!data)) {
/* The externally stored field
@@ -2749,8 +2761,7 @@ row_sel_store_mysql_rec(
} else {
/* Field is stored in the row. */
- data = rec_get_nth_field(rec, offsets,
- templ->rec_field_no, &len);
+ data = rec_get_nth_field(rec, offsets, field_no, &len);
if (UNIV_UNLIKELY(templ->type == DATA_BLOB)
&& len != UNIV_SQL_NULL) {
@@ -3112,7 +3123,7 @@ row_sel_pop_cached_row_for_mysql(
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct */
{
ulint i;
- mysql_row_templ_t* templ;
+ const mysql_row_templ_t*templ;
byte* cached_rec;
ut_ad(prebuilt->n_fetch_cached > 0);
ut_ad(prebuilt->mysql_prefix_len <= prebuilt->mysql_row_len);
@@ -3169,15 +3180,21 @@ ibool
row_sel_push_cache_row_for_mysql(
/*=============================*/
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct */
- const rec_t* rec, /*!< in: record to push; must
- be protected by a page latch */
- const ulint* offsets) /*!< in: rec_get_offsets() */
+ const rec_t* rec, /*!< in: record to push, in the index
+ which was described in prebuilt's
+ template, or in the clustered index;
+ must be protected by a page latch */
+ ibool rec_clust, /*!< in: TRUE if rec is in the
+ clustered index instead of
+ prebuilt->index */
+ const ulint* offsets) /*!< in: rec_get_offsets(rec) */
{
byte* buf;
ulint i;
ut_ad(prebuilt->n_fetch_cached < MYSQL_FETCH_CACHE_SIZE);
ut_ad(rec_offs_validate(rec, NULL, offsets));
+ ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets)));
ut_a(!prebuilt->templ_contains_blob);
if (prebuilt->fetch_cache[0] == NULL) {
@@ -3206,7 +3223,7 @@ row_sel_push_cache_row_for_mysql(
if (UNIV_UNLIKELY(!row_sel_store_mysql_rec(
prebuilt->fetch_cache[
prebuilt->n_fetch_cached],
- prebuilt, rec, offsets))) {
+ prebuilt, rec, rec_clust, offsets))) {
return(FALSE);
}
@@ -3354,7 +3371,6 @@ row_search_for_mysql(
rec_offs_init(offsets_);
ut_ad(index && pcur && search_tuple);
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
if (UNIV_UNLIKELY(prebuilt->table->ibd_file_missing)) {
ut_print_timestamp(stderr);
@@ -3371,11 +3387,17 @@ row_search_for_mysql(
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
+#endif /* UNIV_SYNC_DEBUG */
return(DB_ERROR);
}
if (UNIV_UNLIKELY(!prebuilt->index_usable)) {
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
+#endif /* UNIV_SYNC_DEBUG */
return(DB_MISSING_HISTORY);
}
@@ -3604,9 +3626,11 @@ row_search_for_mysql(
row_sel_try_search_shortcut_for_mysql().
The latch will not be released until
mtr_commit(&mtr). */
+ ut_ad(!rec_get_deleted_flag(rec, comp));
if (!row_sel_store_mysql_rec(buf, prebuilt,
- rec, offsets)) {
+ rec, FALSE,
+ offsets)) {
/* Only fresh inserts may contain
incomplete externally stored
columns. Pretend that such
@@ -4233,16 +4257,19 @@ no_gap_lock:
rec = old_vers;
}
- } else if (!lock_sec_rec_cons_read_sees(rec, trx->read_view)) {
+ } else {
/* We are looking into a non-clustered index,
and to get the right version of the record we
have to look also into the clustered index: this
is necessary, because we can only get the undo
information via the clustered index record. */
- ut_ad(index != clust_index);
+ ut_ad(!dict_index_is_clust(index));
- goto requires_clust_rec;
+ if (!lock_sec_rec_cons_read_sees(
+ rec, trx->read_view)) {
+ goto requires_clust_rec;
+ }
}
}
@@ -4352,19 +4379,8 @@ requires_clust_rec:
goto next_rec;
}
- if (prebuilt->need_to_access_clustered) {
-
- result_rec = clust_rec;
-
- ut_ad(rec_offs_validate(result_rec, clust_index,
- offsets));
- } else {
- /* We used 'offsets' for the clust rec, recalculate
- them for 'rec' */
- offsets = rec_get_offsets(rec, index, offsets,
- ULINT_UNDEFINED, &heap);
- result_rec = rec;
- }
+ result_rec = clust_rec;
+ ut_ad(rec_offs_validate(result_rec, clust_index, offsets));
} else {
result_rec = rec;
}
@@ -4375,6 +4391,7 @@ requires_clust_rec:
ut_ad(rec_offs_validate(result_rec,
result_rec != rec ? clust_index : index,
offsets));
+ ut_ad(!rec_get_deleted_flag(result_rec, comp));
/* At this point, the clustered index record is protected
by a page latch that was acquired when pcur was positioned.
@@ -4399,6 +4416,7 @@ requires_clust_rec:
cursor. */
if (!row_sel_push_cache_row_for_mysql(prebuilt, result_rec,
+ result_rec != rec,
offsets)) {
/* Only fresh inserts may contain incomplete
externally stored columns. Pretend that such
@@ -4416,15 +4434,31 @@ requires_clust_rec:
goto next_rec;
} else {
- if (prebuilt->template_type == ROW_MYSQL_DUMMY_TEMPLATE) {
+ if (UNIV_UNLIKELY
+ (prebuilt->template_type == ROW_MYSQL_DUMMY_TEMPLATE)) {
+ /* CHECK TABLE: fetch the row */
+
+ if (result_rec != rec
+ && !prebuilt->need_to_access_clustered) {
+ /* We used 'offsets' for the clust
+ rec, recalculate them for 'rec' */
+ offsets = rec_get_offsets(rec, index, offsets,
+ ULINT_UNDEFINED,
+ &heap);
+ result_rec = rec;
+ }
+
memcpy(buf + 4, result_rec
- rec_offs_extra_size(offsets),
rec_offs_size(offsets));
mach_write_to_4(buf,
rec_offs_extra_size(offsets) + 4);
} else {
- if (!row_sel_store_mysql_rec(buf, prebuilt,
- result_rec, offsets)) {
+ /* Returning a row to MySQL */
+
+ if (!row_sel_store_mysql_rec(buf, prebuilt, result_rec,
+ result_rec != rec,
+ offsets)) {
/* Only fresh inserts may contain
incomplete externally stored
columns. Pretend that such records do
@@ -4652,6 +4686,10 @@ func_exit:
prebuilt->row_read_type = ROW_READ_TRY_SEMI_CONSISTENT;
}
}
+
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
+#endif /* UNIV_SYNC_DEBUG */
return(err);
}
diff --git a/storage/innobase/row/row0umod.c b/storage/innobase/row/row0umod.c
index aef653b3150..2188fdeff49 100644
--- a/storage/innobase/row/row0umod.c
+++ b/storage/innobase/row/row0umod.c
@@ -173,40 +173,26 @@ row_undo_mod_remove_clust_low(
mtr_t* mtr, /*!< in: mtr */
ulint mode) /*!< in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE */
{
- btr_pcur_t* pcur;
btr_cur_t* btr_cur;
ulint err;
- ibool success;
ut_ad(node->rec_type == TRX_UNDO_UPD_DEL_REC);
- pcur = &(node->pcur);
- btr_cur = btr_pcur_get_btr_cur(pcur);
- success = btr_pcur_restore_position(mode, pcur, mtr);
+ /* Find out if the record has been purged already
+ or if we can remove it. */
- if (!success) {
+ if (!btr_pcur_restore_position(mode, &node->pcur, mtr)
+ || row_vers_must_preserve_del_marked(node->new_trx_id, mtr)) {
return(DB_SUCCESS);
}
- /* Find out if we can remove the whole clustered index record */
-
- if (node->rec_type == TRX_UNDO_UPD_DEL_REC
- && !row_vers_must_preserve_del_marked(node->new_trx_id, mtr)) {
-
- /* Ok, we can remove */
- } else {
- return(DB_SUCCESS);
- }
+ btr_cur = btr_pcur_get_btr_cur(&node->pcur);
if (mode == BTR_MODIFY_LEAF) {
- success = btr_cur_optimistic_delete(btr_cur, mtr);
-
- if (success) {
- err = DB_SUCCESS;
- } else {
- err = DB_FAIL;
- }
+ err = btr_cur_optimistic_delete(btr_cur, mtr)
+ ? DB_SUCCESS
+ : DB_FAIL;
} else {
ut_ad(mode == BTR_MODIFY_TREE);
@@ -693,19 +679,19 @@ row_undo_mod_upd_exist_sec(
while (node->index != NULL) {
index = node->index;
- if (row_upd_changes_ord_field_binary(node->row, node->index,
- node->update)) {
+ if (row_upd_changes_ord_field_binary(node->index, node->update,
+ thr,
+ node->row, node->ext)) {
/* Build the newest version of the index entry */
entry = row_build_index_entry(node->row, node->ext,
index, heap);
if (UNIV_UNLIKELY(!entry)) {
/* The server must have crashed in
- row_upd_clust_rec_by_insert(), in
- row_ins_index_entry_low() before
- btr_store_big_rec_extern_fields()
- has written the externally stored columns
- (BLOBs) of the new clustered index entry. */
+ row_upd_clust_rec_by_insert() before
+ the updated externally stored columns (BLOBs)
+ of the new clustered index entry were
+ written. */
/* The table must be in DYNAMIC or COMPRESSED
format. REDUNDANT and COMPACT formats
diff --git a/storage/innobase/row/row0upd.c b/storage/innobase/row/row0upd.c
index 9243521cf05..04b3dcb3a4a 100644
--- a/storage/innobase/row/row0upd.c
+++ b/storage/innobase/row/row0upd.c
@@ -238,7 +238,7 @@ row_upd_check_references_constraints(
foreign->n_fields))) {
if (foreign->foreign_table == NULL) {
- dict_table_get(foreign->foreign_table_name,
+ dict_table_get(foreign->foreign_table_name_lookup,
FALSE);
}
@@ -371,8 +371,8 @@ UNIV_INTERN
void
row_upd_index_entry_sys_field(
/*==========================*/
- const dtuple_t* entry, /*!< in: index entry, where the memory buffers
- for sys fields are already allocated:
+ dtuple_t* entry, /*!< in/out: index entry, where the memory
+ buffers for sys fields are already allocated:
the function just copies the new values to
them */
dict_index_t* index, /*!< in: clustered index */
@@ -466,8 +466,11 @@ row_upd_changes_field_size_or_external(
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
-Replaces the new column values stored in the update vector to the record
-given. No field size changes are allowed. */
+Replaces the new column values stored in the update vector to the
+record given. No field size changes are allowed. This function is
+usually invoked on a clustered index. The only use case for a
+secondary index is row_ins_sec_index_entry_by_modify() or its
+counterpart in ibuf_insert_to_index_page(). */
UNIV_INTERN
void
row_upd_rec_in_place(
@@ -495,14 +498,49 @@ row_upd_rec_in_place(
n_fields = upd_get_n_fields(update);
for (i = 0; i < n_fields; i++) {
+#ifdef UNIV_BLOB_DEBUG
+ btr_blob_dbg_t b;
+ const byte* field_ref = NULL;
+#endif /* UNIV_BLOB_DEBUG */
+
upd_field = upd_get_nth_field(update, i);
new_val = &(upd_field->new_val);
ut_ad(!dfield_is_ext(new_val) ==
!rec_offs_nth_extern(offsets, upd_field->field_no));
+#ifdef UNIV_BLOB_DEBUG
+ if (dfield_is_ext(new_val)) {
+ ulint len;
+ field_ref = rec_get_nth_field(rec, offsets, i, &len);
+ ut_a(len != UNIV_SQL_NULL);
+ ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
+ field_ref += len - BTR_EXTERN_FIELD_REF_SIZE;
+
+ b.ref_page_no = page_get_page_no(page_align(rec));
+ b.ref_heap_no = page_rec_get_heap_no(rec);
+ b.ref_field_no = i;
+ b.blob_page_no = mach_read_from_4(
+ field_ref + BTR_EXTERN_PAGE_NO);
+ ut_a(b.ref_field_no >= index->n_uniq);
+ btr_blob_dbg_rbt_delete(index, &b, "upd_in_place");
+ }
+#endif /* UNIV_BLOB_DEBUG */
rec_set_nth_field(rec, offsets, upd_field->field_no,
dfield_get_data(new_val),
dfield_get_len(new_val));
+
+#ifdef UNIV_BLOB_DEBUG
+ if (dfield_is_ext(new_val)) {
+ b.blob_page_no = mach_read_from_4(
+ field_ref + BTR_EXTERN_PAGE_NO);
+ b.always_owner = b.owner = !(field_ref[BTR_EXTERN_LEN]
+ & BTR_EXTERN_OWNER_FLAG);
+ b.del = rec_get_deleted_flag(
+ rec, rec_offs_comp(offsets));
+
+ btr_blob_dbg_rbt_insert(index, &b, "upd_in_place");
+ }
+#endif /* UNIV_BLOB_DEBUG */
}
if (UNIV_LIKELY_NULL(page_zip)) {
@@ -1173,8 +1211,8 @@ row_upd_replace(
}
if (n_ext_cols) {
- *ext = row_ext_create(n_ext_cols, ext_cols, row,
- dict_table_zip_size(table), heap);
+ *ext = row_ext_create(n_ext_cols, ext_cols, table->flags, row,
+ heap);
} else {
*ext = NULL;
}
@@ -1189,26 +1227,33 @@ NOTE: we compare the fields as binary strings!
@return TRUE if update vector changes an ordering field in the index record */
UNIV_INTERN
ibool
-row_upd_changes_ord_field_binary(
-/*=============================*/
+row_upd_changes_ord_field_binary_func(
+/*==================================*/
+ dict_index_t* index, /*!< in: index of the record */
+ const upd_t* update, /*!< in: update vector for the row; NOTE: the
+ field numbers in this MUST be clustered index
+ positions! */
+#ifdef UNIV_DEBUG
+ const que_thr_t*thr, /*!< in: query thread */
+#endif /* UNIV_DEBUG */
const dtuple_t* row, /*!< in: old value of row, or NULL if the
row and the data values in update are not
known when this function is called, e.g., at
compile time */
- dict_index_t* index, /*!< in: index of the record */
- const upd_t* update) /*!< in: update vector for the row; NOTE: the
- field numbers in this MUST be clustered index
- positions! */
+ const row_ext_t*ext) /*!< NULL, or prefixes of the externally
+ stored columns in the old row */
{
- ulint n_unique;
- ulint n_upd_fields;
- ulint i, j;
- dict_index_t* clust_index;
+ ulint n_unique;
+ ulint i;
+ const dict_index_t* clust_index;
- ut_ad(update && index);
+ ut_ad(index);
+ ut_ad(update);
+ ut_ad(thr);
+ ut_ad(thr->graph);
+ ut_ad(thr->graph->trx);
n_unique = dict_index_get_n_unique(index);
- n_upd_fields = upd_get_n_fields(update);
clust_index = dict_table_get_first_index(index->table);
@@ -1216,33 +1261,81 @@ row_upd_changes_ord_field_binary(
const dict_field_t* ind_field;
const dict_col_t* col;
- ulint col_pos;
ulint col_no;
+ const upd_field_t* upd_field;
+ const dfield_t* dfield;
+ dfield_t dfield_ext;
+ ulint dfield_len;
+ const byte* buf;
ind_field = dict_index_get_nth_field(index, i);
col = dict_field_get_col(ind_field);
- col_pos = dict_col_get_clust_pos(col, clust_index);
col_no = dict_col_get_no(col);
- for (j = 0; j < n_upd_fields; j++) {
+ upd_field = upd_get_field_by_field_no(
+ update, dict_col_get_clust_pos(col, clust_index));
- const upd_field_t* upd_field
- = upd_get_nth_field(update, j);
+ if (upd_field == NULL) {
+ continue;
+ }
- /* Note that if the index field is a column prefix
- then it may be that row does not contain an externally
- stored part of the column value, and we cannot compare
- the datas */
+ if (row == NULL) {
+ ut_ad(ext == NULL);
+ return(TRUE);
+ }
- if (col_pos == upd_field->field_no
- && (row == NULL
- || ind_field->prefix_len > 0
- || !dfield_datas_are_binary_equal(
- dtuple_get_nth_field(row, col_no),
- &(upd_field->new_val)))) {
+ dfield = dtuple_get_nth_field(row, col_no);
- return(TRUE);
+ /* This treatment of column prefix indexes is loosely
+ based on row_build_index_entry(). */
+
+ if (UNIV_LIKELY(ind_field->prefix_len == 0)
+ || dfield_is_null(dfield)) {
+ /* do nothing special */
+ } else if (UNIV_LIKELY_NULL(ext)) {
+ /* Silence a compiler warning without
+ silencing a Valgrind error. */
+ dfield_len = 0;
+ UNIV_MEM_INVALID(&dfield_len, sizeof dfield_len);
+ /* See if the column is stored externally. */
+ buf = row_ext_lookup(ext, col_no, &dfield_len);
+
+ ut_ad(col->ord_part);
+
+ if (UNIV_LIKELY_NULL(buf)) {
+ if (UNIV_UNLIKELY(buf == field_ref_zero)) {
+ /* The externally stored field
+ was not written yet. This
+ record should only be seen by
+ recv_recovery_rollback_active(),
+ when the server had crashed before
+ storing the field. */
+ ut_ad(thr->graph->trx->is_recovered);
+ ut_ad(trx_is_recv(thr->graph->trx));
+ return(TRUE);
+ }
+
+ goto copy_dfield;
}
+ } else if (dfield_is_ext(dfield)) {
+ dfield_len = dfield_get_len(dfield);
+ ut_a(dfield_len > BTR_EXTERN_FIELD_REF_SIZE);
+ dfield_len -= BTR_EXTERN_FIELD_REF_SIZE;
+ ut_a(dict_index_is_clust(index)
+ || ind_field->prefix_len <= dfield_len);
+ buf = dfield_get_data(dfield);
+copy_dfield:
+ ut_a(dfield_len > 0);
+ dfield_copy(&dfield_ext, dfield);
+ dfield_set_data(&dfield_ext, buf, dfield_len);
+ dfield = &dfield_ext;
+ }
+
+ if (!dfield_datas_are_binary_equal(
+ dfield, &upd_field->new_val,
+ ind_field->prefix_len)) {
+
+ return(TRUE);
}
}
@@ -1326,7 +1419,7 @@ row_upd_changes_first_fields_binary(
if (col_pos == upd_field->field_no
&& !dfield_datas_are_binary_equal(
dtuple_get_nth_field(entry, i),
- &(upd_field->new_val))) {
+ &upd_field->new_val, 0)) {
return(TRUE);
}
@@ -1593,14 +1686,99 @@ row_upd_sec_step(
ut_ad(!dict_index_is_clust(node->index));
if (node->state == UPD_NODE_UPDATE_ALL_SEC
- || row_upd_changes_ord_field_binary(node->row, node->index,
- node->update)) {
+ || row_upd_changes_ord_field_binary(node->index, node->update,
+ thr, node->row, node->ext)) {
return(row_upd_sec_index_entry(node, thr));
}
return(DB_SUCCESS);
}
+#ifdef UNIV_DEBUG
+# define row_upd_clust_rec_by_insert_inherit(rec,offsets,entry,update) \
+ row_upd_clust_rec_by_insert_inherit_func(rec,offsets,entry,update)
+#else /* UNIV_DEBUG */
+# define row_upd_clust_rec_by_insert_inherit(rec,offsets,entry,update) \
+ row_upd_clust_rec_by_insert_inherit_func(entry,update)
+#endif /* UNIV_DEBUG */
+/*******************************************************************//**
+Mark non-updated off-page columns inherited when the primary key is
+updated. We must mark them as inherited in entry, so that they are not
+freed in a rollback. A limited version of this function used to be
+called btr_cur_mark_dtuple_inherited_extern().
+@return TRUE if any columns were inherited */
+static __attribute__((warn_unused_result))
+ibool
+row_upd_clust_rec_by_insert_inherit_func(
+/*=====================================*/
+#ifdef UNIV_DEBUG
+ const rec_t* rec, /*!< in: old record, or NULL */
+ const ulint* offsets,/*!< in: rec_get_offsets(rec), or NULL */
+#endif /* UNIV_DEBUG */
+ dtuple_t* entry, /*!< in/out: updated entry to be
+ inserted into the clustered index */
+ const upd_t* update) /*!< in: update vector */
+{
+ ibool inherit = FALSE;
+ ulint i;
+
+ ut_ad(!rec == !offsets);
+ ut_ad(!rec || rec_offs_any_extern(offsets));
+
+ for (i = 0; i < dtuple_get_n_fields(entry); i++) {
+ dfield_t* dfield = dtuple_get_nth_field(entry, i);
+ byte* data;
+ ulint len;
+
+ ut_ad(!offsets
+ || !rec_offs_nth_extern(offsets, i)
+ == !dfield_is_ext(dfield)
+ || upd_get_field_by_field_no(update, i));
+ if (!dfield_is_ext(dfield)
+ || upd_get_field_by_field_no(update, i)) {
+ continue;
+ }
+
+#ifdef UNIV_DEBUG
+ if (UNIV_LIKELY(rec != NULL)) {
+ const byte* rec_data
+ = rec_get_nth_field(rec, offsets, i, &len);
+ ut_ad(len == dfield_get_len(dfield));
+ ut_ad(len != UNIV_SQL_NULL);
+ ut_ad(len >= BTR_EXTERN_FIELD_REF_SIZE);
+
+ rec_data += len - BTR_EXTERN_FIELD_REF_SIZE;
+
+ /* The pointer must not be zero. */
+ ut_ad(memcmp(rec_data, field_ref_zero,
+ BTR_EXTERN_FIELD_REF_SIZE));
+ /* The BLOB must be owned. */
+ ut_ad(!(rec_data[BTR_EXTERN_LEN]
+ & BTR_EXTERN_OWNER_FLAG));
+ }
+#endif /* UNIV_DEBUG */
+
+ len = dfield_get_len(dfield);
+ ut_a(len != UNIV_SQL_NULL);
+ ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
+ data = dfield_get_data(dfield);
+ data += len - BTR_EXTERN_FIELD_REF_SIZE;
+ /* The pointer must not be zero. */
+ ut_a(memcmp(data, field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE));
+ /* The BLOB must be owned. */
+ ut_a(!(data[BTR_EXTERN_LEN] & BTR_EXTERN_OWNER_FLAG));
+
+ data[BTR_EXTERN_LEN] |= BTR_EXTERN_INHERITED_FLAG;
+ /* The BTR_EXTERN_INHERITED_FLAG only matters in
+ rollback. Purge will always free the extern fields of
+ a delete-marked row. */
+
+ inherit = TRUE;
+ }
+
+ return(inherit);
+}
+
/***********************************************************//**
Marks the clustered index record deleted and inserts the updated version
of the record to the index. This function should be used when the ordering
@@ -1612,21 +1790,23 @@ static
ulint
row_upd_clust_rec_by_insert(
/*========================*/
- upd_node_t* node, /*!< in: row update node */
+ upd_node_t* node, /*!< in/out: row update node */
dict_index_t* index, /*!< in: clustered index of the record */
que_thr_t* thr, /*!< in: query thread */
ibool referenced,/*!< in: TRUE if index may be referenced in
a foreign key constraint */
- mtr_t* mtr) /*!< in: mtr; gets committed here */
+ mtr_t* mtr) /*!< in/out: mtr; gets committed here */
{
- mem_heap_t* heap = NULL;
+ mem_heap_t* heap;
btr_pcur_t* pcur;
btr_cur_t* btr_cur;
trx_t* trx;
dict_table_t* table;
dtuple_t* entry;
ulint err;
- ibool change_ownership = FALSE;
+ ibool change_ownership = FALSE;
+ rec_t* rec;
+ ulint* offsets = NULL;
ut_ad(node);
ut_ad(dict_index_is_clust(index));
@@ -1636,32 +1816,63 @@ row_upd_clust_rec_by_insert(
pcur = node->pcur;
btr_cur = btr_pcur_get_btr_cur(pcur);
- if (node->state != UPD_NODE_INSERT_CLUSTERED) {
- rec_t* rec;
- dict_index_t* index;
- ulint offsets_[REC_OFFS_NORMAL_SIZE];
- ulint* offsets;
- rec_offs_init(offsets_);
+ heap = mem_heap_create(1000);
- err = btr_cur_del_mark_set_clust_rec(BTR_NO_LOCKING_FLAG,
- btr_cur, TRUE, thr, mtr);
+ entry = row_build_index_entry(node->upd_row, node->upd_ext,
+ index, heap);
+ ut_a(entry);
+
+ row_upd_index_entry_sys_field(entry, index, DATA_TRX_ID, trx->id);
+
+ switch (node->state) {
+ default:
+ ut_error;
+ case UPD_NODE_INSERT_BLOB:
+ /* A lock wait occurred in row_ins_index_entry() in
+ the previous invocation of this function. Mark the
+ off-page columns in the entry inherited. */
+
+ change_ownership = row_upd_clust_rec_by_insert_inherit(
+ NULL, NULL, entry, node->update);
+ ut_a(change_ownership);
+ /* fall through */
+ case UPD_NODE_INSERT_CLUSTERED:
+ /* A lock wait occurred in row_ins_index_entry() in
+ the previous invocation of this function. */
+ break;
+ case UPD_NODE_UPDATE_CLUSTERED:
+ /* This is the first invocation of the function where
+ we update the primary key. Delete-mark the old record
+ in the clustered index and prepare to insert a new entry. */
+ rec = btr_cur_get_rec(btr_cur);
+ offsets = rec_get_offsets(rec, index, NULL,
+ ULINT_UNDEFINED, &heap);
+ ut_ad(page_rec_is_user_rec(rec));
+
+ err = btr_cur_del_mark_set_clust_rec(
+ BTR_NO_LOCKING_FLAG, btr_cur_get_block(btr_cur),
+ rec, index, offsets, TRUE, thr, mtr);
if (err != DB_SUCCESS) {
+err_exit:
mtr_commit(mtr);
+ mem_heap_free(heap);
return(err);
}
- /* Mark as not-owned the externally stored fields which the new
- row inherits from the delete marked record: purge should not
- free those externally stored fields even if the delete marked
- record is removed from the index tree, or updated. */
+ /* If the the new row inherits externally stored
+ fields (off-page columns a.k.a. BLOBs) from the
+ delete-marked old record, mark them disowned by the
+ old record and owned by the new entry. */
+
+ if (rec_offs_any_extern(offsets)) {
+ change_ownership = row_upd_clust_rec_by_insert_inherit(
+ rec, offsets, entry, node->update);
+
+ if (change_ownership) {
+ btr_pcur_store_position(pcur, mtr);
+ }
+ }
- rec = btr_cur_get_rec(btr_cur);
- index = dict_table_get_first_index(table);
- offsets = rec_get_offsets(rec, index, offsets_,
- ULINT_UNDEFINED, &heap);
- change_ownership = btr_cur_mark_extern_inherited_fields(
- btr_cur_get_page_zip(btr_cur), rec, index, offsets,
- node->update, mtr);
if (referenced) {
/* NOTE that the following call loses
the position of pcur ! */
@@ -1670,48 +1881,49 @@ row_upd_clust_rec_by_insert(
node, pcur, table, index, offsets, thr, mtr);
if (err != DB_SUCCESS) {
-
- mtr_commit(mtr);
-
- if (UNIV_LIKELY_NULL(heap)) {
- mem_heap_free(heap);
- }
-
- return(err);
+ goto err_exit;
}
}
}
mtr_commit(mtr);
- if (!heap) {
- heap = mem_heap_create(500);
- }
- node->state = UPD_NODE_INSERT_CLUSTERED;
+ err = row_ins_index_entry(index, entry,
+ node->upd_ext ? node->upd_ext->n_ext : 0,
+ TRUE, thr);
+ node->state = change_ownership
+ ? UPD_NODE_INSERT_BLOB
+ : UPD_NODE_INSERT_CLUSTERED;
- entry = row_build_index_entry(node->upd_row, node->upd_ext,
- index, heap);
- ut_a(entry);
+ if (err == DB_SUCCESS && change_ownership) {
+ /* Mark the non-updated fields disowned by the old record. */
- row_upd_index_entry_sys_field(entry, index, DATA_TRX_ID, trx->id);
+ /* NOTE: this transaction has an x-lock on the record
+ and therefore other transactions cannot modify the
+ record when we have no latch on the page. In addition,
+ we assume that other query threads of the same
+ transaction do not modify the record in the meantime.
+ Therefore we can assert that the restoration of the
+ cursor succeeds. */
- if (change_ownership) {
- /* If we return from a lock wait, for example, we may have
- extern fields marked as not-owned in entry (marked in the
- if-branch above). We must unmark them, take the ownership
- back. */
+ mtr_start(mtr);
- btr_cur_unmark_dtuple_extern_fields(entry);
+ if (!btr_pcur_restore_position(BTR_MODIFY_LEAF, pcur, mtr)) {
+ ut_error;
+ }
- /* We must mark non-updated extern fields in entry as
- inherited, so that a possible rollback will not free them. */
+ rec = btr_cur_get_rec(btr_cur);
+ offsets = rec_get_offsets(rec, index, offsets,
+ ULINT_UNDEFINED, &heap);
+ ut_ad(page_rec_is_user_rec(rec));
+
+ btr_cur_disown_inherited_fields(
+ btr_cur_get_page_zip(btr_cur),
+ rec, index, offsets, node->update, mtr);
- btr_cur_mark_dtuple_inherited_extern(entry, node->update);
+ mtr_commit(mtr);
}
- err = row_ins_index_entry(index, entry,
- node->upd_ext ? node->upd_ext->n_ext : 0,
- TRUE, thr);
mem_heap_free(heap);
return(err);
@@ -1805,7 +2017,7 @@ row_upd_clust_rec(
index, btr_cur_get_block(btr_cur), rec,
rec_get_offsets(rec, index, offsets_,
ULINT_UNDEFINED, &heap),
- big_rec, mtr);
+ mtr, TRUE, big_rec);
mtr_commit(mtr);
}
@@ -1856,8 +2068,9 @@ row_upd_del_mark_clust_rec(
/* Mark the clustered index record deleted; we do not have to check
locks, because we assume that we have an x-lock on the record */
- err = btr_cur_del_mark_set_clust_rec(BTR_NO_LOCKING_FLAG,
- btr_cur, TRUE, thr, mtr);
+ err = btr_cur_del_mark_set_clust_rec(
+ BTR_NO_LOCKING_FLAG, btr_cur_get_block(btr_cur),
+ btr_cur_get_rec(btr_cur), index, offsets, TRUE, thr, mtr);
if (err == DB_SUCCESS && referenced) {
/* NOTE that the following call loses the position of pcur ! */
@@ -2002,7 +2215,8 @@ exit_func:
row_upd_store_row(node);
- if (row_upd_changes_ord_field_binary(node->row, index, node->update)) {
+ if (row_upd_changes_ord_field_binary(index, node->update, thr,
+ node->row, node->ext)) {
/* Update causes an ordering field (ordering fields within
the B-tree) of the clustered index record to change: perform
@@ -2072,7 +2286,8 @@ row_upd(
}
if (node->state == UPD_NODE_UPDATE_CLUSTERED
- || node->state == UPD_NODE_INSERT_CLUSTERED) {
+ || node->state == UPD_NODE_INSERT_CLUSTERED
+ || node->state == UPD_NODE_INSERT_BLOB) {
log_free_check();
err = row_upd_clust_step(node, thr);
diff --git a/storage/innobase/row/row0vers.c b/storage/innobase/row/row0vers.c
index 2e12361312c..5fd7d082194 100644
--- a/storage/innobase/row/row0vers.c
+++ b/storage/innobase/row/row0vers.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -550,6 +550,11 @@ row_vers_build_for_consistent_read(
/* The view already sees this version: we can
copy it to in_heap and return */
+#ifdef UNIV_BLOB_NULL_DEBUG
+ ut_a(!rec_offs_any_null_extern(
+ version, *offsets));
+#endif /* UNIV_BLOB_NULL_DEBUG */
+
buf = mem_heap_alloc(in_heap,
rec_offs_size(*offsets));
*old_vers = rec_copy(buf, version, *offsets);
@@ -583,6 +588,10 @@ row_vers_build_for_consistent_read(
*offsets = rec_get_offsets(prev_version, index, *offsets,
ULINT_UNDEFINED, offset_heap);
+#ifdef UNIV_BLOB_NULL_DEBUG
+ ut_a(!rec_offs_any_null_extern(prev_version, *offsets));
+#endif /* UNIV_BLOB_NULL_DEBUG */
+
trx_id = row_get_rec_trx_id(prev_version, index, *offsets);
if (read_view_sees_trx_id(view, trx_id)) {
@@ -669,15 +678,23 @@ row_vers_build_for_semi_consistent_read(
mutex_enter(&kernel_mutex);
version_trx = trx_get_on_id(version_trx_id);
+ if (version_trx
+ && (version_trx->conc_state == TRX_COMMITTED_IN_MEMORY
+ || version_trx->conc_state == TRX_NOT_STARTED)) {
+
+ version_trx = NULL;
+ }
mutex_exit(&kernel_mutex);
- if (!version_trx
- || version_trx->conc_state == TRX_NOT_STARTED
- || version_trx->conc_state == TRX_COMMITTED_IN_MEMORY) {
+ if (!version_trx) {
/* We found a version that belongs to a
committed transaction: return it. */
+#ifdef UNIV_BLOB_NULL_DEBUG
+ ut_a(!rec_offs_any_null_extern(version, *offsets));
+#endif /* UNIV_BLOB_NULL_DEBUG */
+
if (rec == version) {
*old_vers = rec;
err = DB_SUCCESS;
@@ -735,6 +752,9 @@ row_vers_build_for_semi_consistent_read(
version = prev_version;
*offsets = rec_get_offsets(version, index, *offsets,
ULINT_UNDEFINED, offset_heap);
+#ifdef UNIV_BLOB_NULL_DEBUG
+ ut_a(!rec_offs_any_null_extern(version, *offsets));
+#endif /* UNIV_BLOB_NULL_DEBUG */
}/* for (;;) */
if (heap) {
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index b2da43c188b..04503d25cd4 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
@@ -66,7 +66,6 @@ Created 10/8/1995 Heikki Tuuri
#include "mem0mem.h"
#include "mem0pool.h"
#include "sync0sync.h"
-#include "thr0loc.h"
#include "que0que.h"
#include "log0recv.h"
#include "pars0pars.h"
@@ -87,10 +86,6 @@ Created 10/8/1995 Heikki Tuuri
#include "mysql/plugin.h"
#include "mysql/service_thd_wait.h"
-/* This is set to TRUE if the MySQL user has set it in MySQL; currently
-affects only FOREIGN KEY definition parsing */
-UNIV_INTERN ibool srv_lower_case_table_names = FALSE;
-
/* The following counter is incremented whenever there is some user activity
in the server */
UNIV_INTERN ulint srv_activity_count = 0;
@@ -267,12 +262,20 @@ UNIV_INTERN ulong srv_max_buf_pool_modified_pct = 75;
/* the number of purge threads to use from the worker pool (currently 0 or 1).*/
UNIV_INTERN ulong srv_n_purge_threads = 0;
-/* the number of records to purge in one batch */
+/* the number of pages to purge in one batch */
UNIV_INTERN ulong srv_purge_batch_size = 20;
+/* the number of rollback segments to use */
+UNIV_INTERN ulong srv_rollback_segments = TRX_SYS_N_RSEGS;
+
/* variable counts amount of data read in total (in bytes) */
UNIV_INTERN ulint srv_data_read = 0;
+/* Internal setting for "innodb_stats_method". Decides how InnoDB treats
+NULL value when collecting statistics. By default, it is set to
+SRV_STATS_NULLS_EQUAL(0), ie. all NULL value are treated equal */
+ulong srv_innodb_stats_method = SRV_STATS_NULLS_EQUAL;
+
/* here we count the amount of data written in total (in bytes) */
UNIV_INTERN ulint srv_data_written = 0;
@@ -424,6 +427,7 @@ UNIV_INTERN ulint srv_n_lock_wait_current_count = 0;
UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0;
UNIV_INTERN ulint srv_n_lock_max_wait_time = 0;
+UNIV_INTERN ulint srv_truncated_status_writes = 0;
/*
Set the following to 0 if you want InnoDB to write messages on
@@ -677,9 +681,7 @@ Unix.*/
/* Thread slot in the thread table */
struct srv_slot_struct{
- os_thread_id_t id; /*!< thread id */
- os_thread_t handle; /*!< thread handle */
- unsigned type:3; /*!< thread type: user, utility etc. */
+ unsigned type:1; /*!< thread type: user, utility etc. */
unsigned in_use:1; /*!< TRUE if this slot is in use */
unsigned suspended:1; /*!< TRUE if the thread is waiting
for the event of this slot */
@@ -694,6 +696,12 @@ struct srv_slot_struct{
/* Table for MySQL threads where they will be suspended to wait for locks */
UNIV_INTERN srv_slot_t* srv_mysql_table = NULL;
+UNIV_INTERN os_event_t srv_timeout_event;
+
+UNIV_INTERN os_event_t srv_monitor_event;
+
+UNIV_INTERN os_event_t srv_error_event;
+
UNIV_INTERN os_event_t srv_lock_timeout_thread_event;
UNIV_INTERN srv_sys_t* srv_sys = NULL;
@@ -780,6 +788,7 @@ srv_table_get_nth_slot(
/*===================*/
ulint index) /*!< in: index of the slot */
{
+ ut_ad(mutex_own(&kernel_mutex));
ut_a(index < OS_THREAD_MAX_N);
return(srv_sys->threads + index);
@@ -798,7 +807,7 @@ srv_get_n_threads(void)
mutex_enter(&kernel_mutex);
- for (i = SRV_COM; i < SRV_MASTER + 1; i++) {
+ for (i = 0; i < SRV_MASTER + 1; i++) {
n_threads += srv_n_threads[i];
}
@@ -808,13 +817,46 @@ srv_get_n_threads(void)
return(n_threads);
}
+#ifdef UNIV_DEBUG
/*********************************************************************//**
-Reserves a slot in the thread table for the current thread. Also creates the
-thread local storage struct for the current thread. NOTE! The server mutex
-has to be reserved by the caller!
-@return reserved slot index */
+Validates the type of a thread table slot.
+@return TRUE if ok */
static
-ulint
+ibool
+srv_thread_type_validate(
+/*=====================*/
+ enum srv_thread_type type) /*!< in: thread type */
+{
+ switch (type) {
+ case SRV_WORKER:
+ case SRV_MASTER:
+ return(TRUE);
+ }
+ ut_error;
+ return(FALSE);
+}
+#endif /* UNIV_DEBUG */
+
+/*********************************************************************//**
+Gets the type of a thread table slot.
+@return thread type */
+static
+enum srv_thread_type
+srv_slot_get_type(
+/*==============*/
+ const srv_slot_t* slot) /*!< in: thread slot */
+{
+ enum srv_thread_type type = (enum srv_thread_type) slot->type;
+ ut_ad(srv_thread_type_validate(type));
+ return(type);
+}
+
+/*********************************************************************//**
+Reserves a slot in the thread table for the current thread.
+NOTE! The server mutex has to be reserved by the caller!
+@return reserved slot */
+static
+srv_slot_t*
srv_table_reserve_slot(
/*===================*/
enum srv_thread_type type) /*!< in: type of the thread */
@@ -822,8 +864,8 @@ srv_table_reserve_slot(
srv_slot_t* slot;
ulint i;
- ut_a(type > 0);
- ut_a(type <= SRV_MASTER);
+ ut_ad(srv_thread_type_validate(type));
+ ut_ad(mutex_own(&kernel_mutex));
i = 0;
slot = srv_table_get_nth_slot(i);
@@ -833,53 +875,37 @@ srv_table_reserve_slot(
slot = srv_table_get_nth_slot(i);
}
- ut_a(slot->in_use == FALSE);
-
slot->in_use = TRUE;
slot->suspended = FALSE;
slot->type = type;
- slot->id = os_thread_get_curr_id();
- slot->handle = os_thread_get_curr();
-
- thr_local_create();
+ ut_ad(srv_slot_get_type(slot) == type);
- thr_local_set_slot_no(os_thread_get_curr_id(), i);
-
- return(i);
+ return(slot);
}
/*********************************************************************//**
Suspends the calling thread to wait for the event in its thread slot.
-NOTE! The server mutex has to be reserved by the caller!
-@return event for the calling thread to wait */
+NOTE! The server mutex has to be reserved by the caller! */
static
-os_event_t
-srv_suspend_thread(void)
-/*====================*/
+void
+srv_suspend_thread(
+/*===============*/
+ srv_slot_t* slot) /*!< in/out: thread slot */
{
- srv_slot_t* slot;
- os_event_t event;
- ulint slot_no;
enum srv_thread_type type;
ut_ad(mutex_own(&kernel_mutex));
-
- slot_no = thr_local_get_slot_no(os_thread_get_curr_id());
+ ut_ad(slot->in_use);
+ ut_ad(!slot->suspended);
if (srv_print_thread_releases) {
fprintf(stderr,
"Suspending thread %lu to slot %lu\n",
- (ulong) os_thread_get_curr_id(), (ulong) slot_no);
+ (ulong) os_thread_get_curr_id(),
+ (ulong) (slot - srv_sys->threads));
}
- slot = srv_table_get_nth_slot(slot_no);
-
- type = slot->type;
-
- ut_ad(type >= SRV_WORKER);
- ut_ad(type <= SRV_MASTER);
-
- event = slot->event;
+ type = srv_slot_get_type(slot);
slot->suspended = TRUE;
@@ -887,9 +913,7 @@ srv_suspend_thread(void)
srv_n_threads_active[type]--;
- os_event_reset(event);
-
- return(event);
+ os_event_reset(slot->event);
}
/*********************************************************************//**
@@ -908,8 +932,7 @@ srv_release_threads(
ulint i;
ulint count = 0;
- ut_ad(type >= SRV_WORKER);
- ut_ad(type <= SRV_MASTER);
+ ut_ad(srv_thread_type_validate(type));
ut_ad(n > 0);
ut_ad(mutex_own(&kernel_mutex));
@@ -917,7 +940,8 @@ srv_release_threads(
slot = srv_table_get_nth_slot(i);
- if (slot->in_use && slot->type == type && slot->suspended) {
+ if (slot->in_use && slot->suspended
+ && srv_slot_get_type(slot) == type) {
slot->suspended = FALSE;
@@ -927,10 +951,9 @@ srv_release_threads(
if (srv_print_thread_releases) {
fprintf(stderr,
- "Releasing thread %lu type %lu"
+ "Releasing thread type %lu"
" from slot %lu\n",
- (ulong) slot->id, (ulong) type,
- (ulong) i);
+ (ulong) type, (ulong) i);
}
count++;
@@ -945,31 +968,35 @@ srv_release_threads(
}
/*********************************************************************//**
-Returns the calling thread type.
-@return SRV_COM, ... */
+Check whether thread type has reserved a slot. Return the first slot that
+is found. This works because we currently have only 1 thread of each type.
+@return slot number or ULINT_UNDEFINED if not found*/
UNIV_INTERN
-enum srv_thread_type
-srv_get_thread_type(void)
-/*=====================*/
+ulint
+srv_thread_has_reserved_slot(
+/*=========================*/
+ enum srv_thread_type type) /*!< in: thread type to check */
{
- ulint slot_no;
- srv_slot_t* slot;
- enum srv_thread_type type;
+ ulint i;
+ ulint slot_no = ULINT_UNDEFINED;
+ ut_ad(srv_thread_type_validate(type));
mutex_enter(&kernel_mutex);
- slot_no = thr_local_get_slot_no(os_thread_get_curr_id());
-
- slot = srv_table_get_nth_slot(slot_no);
+ for (i = 0; i < OS_THREAD_MAX_N; i++) {
+ srv_slot_t* slot;
- type = slot->type;
+ slot = srv_table_get_nth_slot(i);
- ut_ad(type >= SRV_WORKER);
- ut_ad(type <= SRV_MASTER);
+ if (slot->in_use && slot->type == type) {
+ slot_no = i;
+ break;
+ }
+ }
mutex_exit(&kernel_mutex);
- return(type);
+ return(slot_no);
}
/*********************************************************************//**
@@ -991,26 +1018,28 @@ srv_init(void)
mutex_create(srv_innodb_monitor_mutex_key,
&srv_innodb_monitor_mutex, SYNC_NO_ORDER_CHECK);
- srv_sys->threads = mem_alloc(OS_THREAD_MAX_N * sizeof(srv_slot_t));
+ srv_sys->threads = mem_zalloc(OS_THREAD_MAX_N * sizeof(srv_slot_t));
for (i = 0; i < OS_THREAD_MAX_N; i++) {
- slot = srv_table_get_nth_slot(i);
- slot->in_use = FALSE;
- slot->type=0; /* Avoid purify errors */
+ slot = srv_sys->threads + i;
slot->event = os_event_create(NULL);
ut_a(slot->event);
}
- srv_mysql_table = mem_alloc(OS_THREAD_MAX_N * sizeof(srv_slot_t));
+ srv_mysql_table = mem_zalloc(OS_THREAD_MAX_N * sizeof(srv_slot_t));
for (i = 0; i < OS_THREAD_MAX_N; i++) {
slot = srv_mysql_table + i;
- slot->in_use = FALSE;
- slot->type = 0;
slot->event = os_event_create(NULL);
ut_a(slot->event);
}
+ srv_error_event = os_event_create(NULL);
+
+ srv_timeout_event = os_event_create(NULL);
+
+ srv_monitor_event = os_event_create(NULL);
+
srv_lock_timeout_thread_event = os_event_create(NULL);
for (i = 0; i < SRV_MASTER + 1; i++) {
@@ -1087,7 +1116,6 @@ srv_general_init(void)
os_sync_init();
sync_init();
mem_init(srv_mem_pool_size);
- thr_local_init();
}
/*======================= InnoDB Server FIFO queue =======================*/
@@ -1109,6 +1137,10 @@ srv_conc_enter_innodb(
srv_conc_slot_t* slot = NULL;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
+#endif /* UNIV_SYNC_DEBUG */
+
if (trx->mysql_thd != NULL
&& thd_is_replication_slave_thread(trx->mysql_thd)) {
@@ -1232,9 +1264,13 @@ retry:
/* Go to wait for the event; when a thread leaves InnoDB it will
release this thread */
+ ut_ad(!trx->has_search_latch);
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
+#endif /* UNIV_SYNC_DEBUG */
trx->op_info = "waiting in InnoDB queue";
- thd_wait_begin(trx->mysql_thd, THD_WAIT_ROW_TABLE_LOCK);
+ thd_wait_begin(trx->mysql_thd, THD_WAIT_USER_LOCK);
os_event_wait(slot->event);
thd_wait_end(trx->mysql_thd);
@@ -1267,6 +1303,10 @@ srv_conc_force_enter_innodb(
trx_t* trx) /*!< in: transaction object associated with the
thread */
{
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
+#endif /* UNIV_SYNC_DEBUG */
+
if (UNIV_LIKELY(!srv_thread_concurrency)) {
return;
@@ -1338,6 +1378,10 @@ srv_conc_force_exit_innodb(
if (slot != NULL) {
os_event_set(slot->event);
}
+
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
+#endif /* UNIV_SYNC_DEBUG */
}
/*********************************************************************//**
@@ -1349,6 +1393,10 @@ srv_conc_exit_innodb(
trx_t* trx) /*!< in: transaction object associated with the
thread */
{
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
+#endif /* UNIV_SYNC_DEBUG */
+
if (trx->n_tickets_to_enter_innodb > 0) {
/* We will pretend the thread is still inside InnoDB though it
now leaves the InnoDB engine. In this way we save
@@ -1446,7 +1494,7 @@ srv_table_reserve_slot_for_mysql(void)
while (slot->in_use) {
i++;
- if (i >= OS_THREAD_MAX_N) {
+ if (UNIV_UNLIKELY(i >= OS_THREAD_MAX_N)) {
ut_print_timestamp(stderr);
@@ -1465,10 +1513,9 @@ srv_table_reserve_slot_for_mysql(void)
slot = srv_mysql_table + i;
fprintf(stderr,
- "Slot %lu: thread id %lu, type %lu,"
+ "Slot %lu: thread type %lu,"
" in use %lu, susp %lu, time %lu\n",
(ulong) i,
- (ulong) os_thread_pf(slot->id),
(ulong) slot->type,
(ulong) slot->in_use,
(ulong) slot->suspended,
@@ -1485,8 +1532,6 @@ srv_table_reserve_slot_for_mysql(void)
ut_a(slot->in_use == FALSE);
slot->in_use = TRUE;
- slot->id = os_thread_get_curr_id();
- slot->handle = os_thread_get_curr();
return(slot);
}
@@ -1573,17 +1618,6 @@ srv_suspend_mysql_thread(
mutex_exit(&kernel_mutex);
- if (trx->declared_to_be_inside_innodb) {
-
- was_declared_inside_innodb = TRUE;
-
- /* We must declare this OS thread to exit InnoDB, since a
- possible other thread holding a lock which this thread waits
- for must be allowed to enter, sooner or later */
-
- srv_conc_force_exit_innodb(trx);
- }
-
had_dict_lock = trx->dict_operation_lock_mode;
switch (had_dict_lock) {
@@ -1592,6 +1626,18 @@ srv_suspend_mysql_thread(
row_mysql_unfreeze_data_dictionary(trx);
break;
case RW_X_LATCH:
+ /* There should never be a lock wait when the
+ dictionary latch is reserved in X mode. Dictionary
+ transactions should only acquire locks on dictionary
+ tables, not other tables. All access to dictionary
+ tables should be covered by dictionary
+ transactions. */
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: Error: dict X latch held in "
+ "srv_suspend_mysql_thread\n", stderr);
+ /* This should never occur. This incorrect handling
+ was added in the early development of
+ ha_innobase::add_index() in InnoDB Plugin 1.0. */
/* Release fast index creation latch */
row_mysql_unlock_data_dictionary(trx);
break;
@@ -1599,12 +1645,34 @@ srv_suspend_mysql_thread(
ut_a(trx->dict_operation_lock_mode == 0);
+ if (trx->declared_to_be_inside_innodb) {
+
+ was_declared_inside_innodb = TRUE;
+
+ /* We must declare this OS thread to exit InnoDB, since a
+ possible other thread holding a lock which this thread waits
+ for must be allowed to enter, sooner or later */
+
+ srv_conc_force_exit_innodb(trx);
+ }
+
/* Suspend this thread and wait for the event. */
- thd_wait_begin(trx->mysql_thd, THD_WAIT_ROW_TABLE_LOCK);
+ thd_wait_begin(trx->mysql_thd, THD_WAIT_ROW_LOCK);
os_event_wait(event);
thd_wait_end(trx->mysql_thd);
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
+#endif /* UNIV_SYNC_DEBUG */
+
+ if (was_declared_inside_innodb) {
+
+ /* Return back inside InnoDB */
+
+ srv_conc_force_enter_innodb(trx);
+ }
+
/* After resuming, reacquire the data dictionary latch if
necessary. */
@@ -1613,17 +1681,13 @@ srv_suspend_mysql_thread(
row_mysql_freeze_data_dictionary(trx);
break;
case RW_X_LATCH:
+ /* This should never occur. This incorrect handling
+ was added in the early development of
+ ha_innobase::add_index() in InnoDB Plugin 1.0. */
row_mysql_lock_data_dictionary(trx);
break;
}
- if (was_declared_inside_innodb) {
-
- /* Return back inside InnoDB */
-
- srv_conc_force_enter_innodb(trx);
- }
-
mutex_enter(&kernel_mutex);
/* Release the slot for others to use */
@@ -2017,6 +2081,7 @@ srv_export_innodb_status(void)
export_vars.innodb_rows_inserted = srv_n_rows_inserted;
export_vars.innodb_rows_updated = srv_n_rows_updated;
export_vars.innodb_rows_deleted = srv_n_rows_deleted;
+ export_vars.innodb_truncated_status_writes = srv_truncated_status_writes;
mutex_exit(&srv_innodb_monitor_mutex);
}
@@ -2032,6 +2097,7 @@ srv_monitor_thread(
/*!< in: a dummy parameter required by
os_thread_create */
{
+ ib_int64_t sig_count;
double time_elapsed;
time_t current_time;
time_t last_table_monitor_time;
@@ -2050,26 +2116,28 @@ srv_monitor_thread(
#endif
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);
+ srv_last_monitor_time = ut_time();
+ last_table_monitor_time = ut_time();
+ last_tablespace_monitor_time = ut_time();
+ last_monitor_time = ut_time();
mutex_skipped = 0;
last_srv_print_monitor = srv_print_innodb_monitor;
loop:
srv_monitor_active = TRUE;
/* Wake up every 5 seconds to see if we need to print
- monitor information. */
+ monitor information or if signalled at shutdown. */
- os_thread_sleep(5000000);
+ sig_count = os_event_reset(srv_monitor_event);
- current_time = time(NULL);
+ os_event_wait_time_low(srv_monitor_event, 5000000, sig_count);
+
+ current_time = ut_time();
time_elapsed = difftime(current_time, last_monitor_time);
if (time_elapsed > 15) {
- last_monitor_time = time(NULL);
+ last_monitor_time = ut_time();
if (srv_print_innodb_monitor) {
/* Reset mutex_skipped counter everytime
@@ -2113,7 +2181,7 @@ loop:
if (srv_print_innodb_tablespace_monitor
&& difftime(current_time,
last_tablespace_monitor_time) > 60) {
- last_tablespace_monitor_time = time(NULL);
+ last_tablespace_monitor_time = ut_time();
fputs("========================"
"========================\n",
@@ -2139,7 +2207,7 @@ loop:
if (srv_print_innodb_table_monitor
&& difftime(current_time, last_table_monitor_time) > 60) {
- last_table_monitor_time = time(NULL);
+ last_table_monitor_time = ut_time();
fputs("===========================================\n",
stderr);
@@ -2199,16 +2267,20 @@ srv_lock_timeout_thread(
ibool some_waits;
double wait_time;
ulint i;
+ ib_int64_t sig_count;
#ifdef UNIV_PFS_THREAD
pfs_register_thread(srv_lock_timeout_thread_key);
#endif
loop:
+
/* When someone is waiting for a lock, we wake up every second
and check if a timeout has passed for a lock wait */
- os_thread_sleep(1000000);
+ sig_count = os_event_reset(srv_timeout_event);
+
+ os_event_wait_time_low(srv_timeout_event, 1000000, sig_count);
srv_lock_timeout_active = TRUE;
@@ -2303,6 +2375,13 @@ srv_error_monitor_thread(
ulint fatal_cnt = 0;
ib_uint64_t old_lsn;
ib_uint64_t new_lsn;
+ ib_int64_t sig_count;
+ /* longest waiting thread for a semaphore */
+ os_thread_id_t waiter = os_thread_get_curr_id();
+ os_thread_id_t old_waiter = waiter;
+ /* the semaphore that is being waited for */
+ const void* sema = NULL;
+ const void* old_sema = NULL;
old_lsn = srv_start_lsn;
@@ -2356,7 +2435,8 @@ loop:
sync_arr_wake_threads_if_sema_free();
- if (sync_array_print_long_waits()) {
+ if (sync_array_print_long_waits(&waiter, &sema)
+ && sema == old_sema && os_thread_eq(waiter, old_waiter)) {
fatal_cnt++;
if (fatal_cnt > 10) {
@@ -2371,6 +2451,8 @@ loop:
}
} else {
fatal_cnt = 0;
+ old_waiter = waiter;
+ old_sema = sema;
}
/* Flush stderr so that a database user gets the output
@@ -2378,7 +2460,9 @@ loop:
fflush(stderr);
- os_thread_sleep(1000000);
+ sig_count = os_event_reset(srv_error_event);
+
+ os_event_wait_time_low(srv_error_event, 1000000, sig_count);
if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) {
@@ -2408,7 +2492,7 @@ srv_is_any_background_thread_active(void)
mutex_enter(&kernel_mutex);
- for (i = SRV_COM; i <= SRV_MASTER; ++i) {
+ for (i = 0; i <= SRV_MASTER; ++i) {
if (srv_n_threads_active[i] != 0) {
ret = TRUE;
break;
@@ -2562,7 +2646,7 @@ srv_master_thread(
os_thread_create */
{
buf_pool_stat_t buf_stat;
- os_event_t event;
+ srv_slot_t* slot;
ulint old_activity_count;
ulint n_pages_purged = 0;
ulint n_bytes_merged;
@@ -2588,10 +2672,10 @@ srv_master_thread(
srv_main_thread_process_no = os_proc_get_number();
srv_main_thread_id = os_thread_pf(os_thread_get_curr_id());
- srv_table_reserve_slot(SRV_MASTER);
-
mutex_enter(&kernel_mutex);
+ slot = srv_table_reserve_slot(SRV_MASTER);
+
srv_n_threads_active[SRV_MASTER]++;
mutex_exit(&kernel_mutex);
@@ -2622,11 +2706,28 @@ loop:
when there is database activity */
srv_last_log_flush_time = time(NULL);
- next_itr_time = ut_time_ms();
+
+ /* Sleep for 1 second on entrying the for loop below the first time. */
+ next_itr_time = ut_time_ms() + 1000;
for (i = 0; i < 10; i++) {
ulint cur_time = ut_time_ms();
+ /* ALTER TABLE in MySQL requires on Unix that the table handler
+ can drop tables lazily after there no longer are SELECT
+ queries to them. */
+
+ srv_main_thread_op_info = "doing background drop tables";
+
+ row_drop_tables_for_mysql_in_background();
+
+ srv_main_thread_op_info = "";
+
+ if (srv_fast_shutdown && srv_shutdown_state > 0) {
+
+ goto background_loop;
+ }
+
buf_get_total_stat(&buf_stat);
n_ios_old = log_sys->n_log_ios + buf_stat.n_pages_read
@@ -2635,7 +2736,8 @@ loop:
srv_main_thread_op_info = "sleeping";
srv_main_1_second_loops++;
- if (next_itr_time > cur_time) {
+ if (next_itr_time > cur_time
+ && srv_shutdown_state == SRV_SHUTDOWN_NONE) {
/* Get sleep interval in micro seconds. We use
ut_min() to avoid long sleep in case of
@@ -2649,21 +2751,6 @@ loop:
/* Each iteration should happen at 1 second interval. */
next_itr_time = ut_time_ms() + 1000;
- /* ALTER TABLE in MySQL requires on Unix that the table handler
- can drop tables lazily after there no longer are SELECT
- queries to them. */
-
- srv_main_thread_op_info = "doing background drop tables";
-
- row_drop_tables_for_mysql_in_background();
-
- srv_main_thread_op_info = "";
-
- if (srv_fast_shutdown && srv_shutdown_state > 0) {
-
- goto background_loop;
- }
-
/* Flush logs if needed */
srv_sync_log_buffer_in_background();
@@ -2841,7 +2928,9 @@ background_loop:
MySQL tries to drop a table while there are still open handles
to it and we had to put it to the background drop queue.) */
- os_thread_sleep(100000);
+ if (srv_shutdown_state == SRV_SHUTDOWN_NONE) {
+ os_thread_sleep(100000);
+ }
}
if (srv_n_purge_threads == 0) {
@@ -2974,7 +3063,7 @@ suspend_thread:
goto loop;
}
- event = srv_suspend_thread();
+ srv_suspend_thread(slot);
mutex_exit(&kernel_mutex);
@@ -2984,22 +3073,16 @@ suspend_thread:
manual also mentions this string in several places. */
srv_main_thread_op_info = "waiting for server activity";
- os_event_wait(event);
+ os_event_wait(slot->event);
if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) {
- /* This is only extra safety, the thread should exit
- already when the event wait ends */
-
os_thread_exit(NULL);
-
}
/* When there is user activity, InnoDB will set the event and the
main thread goes back to loop. */
goto loop;
-
- OS_THREAD_DUMMY_RETURN; /* Not reached, avoid compiler warning */
}
/*********************************************************************//**
@@ -3013,7 +3096,7 @@ srv_purge_thread(
required by os_thread_create */
{
srv_slot_t* slot;
- ulint slot_no = ULINT_UNDEFINED;
+ ulint retries = 0;
ulint n_total_purged = ULINT_UNDEFINED;
ut_a(srv_n_purge_threads == 1);
@@ -3029,9 +3112,7 @@ srv_purge_thread(
mutex_enter(&kernel_mutex);
- slot_no = srv_table_reserve_slot(SRV_WORKER);
-
- slot = srv_table_get_nth_slot(slot_no);
+ slot = srv_table_reserve_slot(SRV_WORKER);
++srv_n_threads_active[SRV_WORKER];
@@ -3039,7 +3120,7 @@ srv_purge_thread(
while (srv_shutdown_state != SRV_SHUTDOWN_EXIT_THREADS) {
- ulint n_pages_purged;
+ ulint n_pages_purged = 0;
/* If there are very few records to purge or the last
purge didn't purge any records then wait for activity.
@@ -3047,17 +3128,18 @@ srv_purge_thread(
because in the worst case we will end up waiting for
the next purge event. */
if (trx_sys->rseg_history_len < srv_purge_batch_size
- || n_total_purged == 0) {
-
- os_event_t event;
+ || (n_total_purged == 0
+ && retries >= TRX_SYS_N_RSEGS)) {
mutex_enter(&kernel_mutex);
- event = srv_suspend_thread();
+ srv_suspend_thread(slot);
mutex_exit(&kernel_mutex);
- os_event_wait(event);
+ os_event_wait(slot->event);
+
+ retries = 0;
}
/* Check for shutdown and whether we should do purge at all. */
@@ -3068,7 +3150,12 @@ srv_purge_thread(
break;
}
- n_total_purged = 0;
+ if (n_total_purged == 0 && retries <= TRX_SYS_N_RSEGS) {
+ ++retries;
+ } else if (n_total_purged > 0) {
+ retries = 0;
+ n_total_purged = 0;
+ }
/* Purge until there are no more records to purge and there is
no change in configuration or server state. */
@@ -3084,16 +3171,11 @@ srv_purge_thread(
mutex_enter(&kernel_mutex);
- ut_ad(srv_table_get_nth_slot(slot_no) == slot);
-
/* Decrement the active count. */
- srv_suspend_thread();
+ srv_suspend_thread(slot);
slot->in_use = FALSE;
- /* Free the thread local memory. */
- thr_local_free(os_thread_get_curr_id());
-
mutex_exit(&kernel_mutex);
#ifdef UNIV_DEBUG_THREAD_CREATION
diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
index 4da836672ec..cf11e75b8e0 100644
--- a/storage/innobase/srv/srv0start.c
+++ b/storage/innobase/srv/srv0start.c
@@ -85,7 +85,6 @@ Created 2/16/1996 Heikki Tuuri
# include "row0row.h"
# include "row0mysql.h"
# include "btr0pcur.h"
-# include "thr0loc.h"
# include "os0sync.h" /* for INNODB_RW_LOCKS_USE_ATOMICS */
# include "zlib.h" /* for ZLIB_VERSION */
@@ -120,11 +119,6 @@ UNIV_INTERN enum srv_shutdown_state srv_shutdown_state = SRV_SHUTDOWN_NONE;
/** Files comprising the system tablespace */
static os_file_t files[1000];
-/** Mutex protecting the ios count */
-static mutex_t ios_mutex;
-/** Count of I/O operations in io_handler_thread() */
-static ulint ios;
-
/** io_handler_thread parameters for thread identification */
static ulint n[SRV_MAX_N_IO_THREADS + 6];
/** io_handler_thread identifiers */
@@ -152,11 +146,6 @@ UNIV_INTERN mysql_pfs_key_t srv_master_thread_key;
UNIV_INTERN mysql_pfs_key_t srv_purge_thread_key;
#endif /* UNIV_PFS_THREAD */
-#ifdef UNIV_PFS_MUTEX
-/* Key to register ios_mutex_key with performance schema */
-UNIV_INTERN mysql_pfs_key_t ios_mutex_key;
-#endif /* UNIV_PFS_MUTEX */
-
/*********************************************************************//**
Convert a numeric string that optionally ends in G or M, to a number
containing megabytes.
@@ -477,7 +466,6 @@ io_handler_thread(
the aio array */
{
ulint segment;
- ulint i;
segment = *((ulint*)arg);
@@ -490,16 +478,10 @@ io_handler_thread(
pfs_register_thread(io_handler_thread_key);
#endif /* UNIV_PFS_THREAD */
- for (i = 0;; i++) {
+ while (srv_shutdown_state != SRV_SHUTDOWN_EXIT_THREADS) {
fil_aio_wait(segment);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
}
- thr_local_free(os_thread_get_curr_id());
-
/* We count the number of threads in os_thread_exit(). A created
thread should always use that to exit and not use return() to exit.
The thread actually never comes here because it is exited in an
@@ -1001,10 +983,6 @@ skip_size_check:
srv_data_file_is_raw_partition[i] != 0);
}
- ios = 0;
-
- mutex_create(ios_mutex_key, &ios_mutex, SYNC_NO_ORDER_CHECK);
-
return(DB_SUCCESS);
}
@@ -1047,26 +1025,35 @@ innobase_start_or_create_for_mysql(void)
on Mac OS X 10.3 or later. */
struct utsname utsname;
if (uname(&utsname)) {
- fputs("InnoDB: cannot determine Mac OS X version!\n", stderr);
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: cannot determine Mac OS X version!\n", stderr);
} else {
srv_have_fullfsync = strcmp(utsname.release, "7.") >= 0;
}
if (!srv_have_fullfsync) {
- fputs("InnoDB: On Mac OS X, fsync() may be"
- " broken on internal drives,\n"
- "InnoDB: making transactions unsafe!\n", stderr);
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: On Mac OS X, fsync() may be "
+ "broken on internal drives,\n", stderr);
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: making transactions unsafe!\n", stderr);
}
# endif /* F_FULLFSYNC */
#endif /* HAVE_DARWIN_THREADS */
if (sizeof(ulint) != sizeof(void*)) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Error: size of InnoDB's ulint is %lu, "
+ "but size of void*\n", (ulong) sizeof(ulint));
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: is %lu. The sizes should be the same "
+ "so that on a 64-bit\n",
+ (ulong) sizeof(void*));
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: size of InnoDB's ulint is %lu,"
- " but size of void* is %lu.\n"
- "InnoDB: The sizes should be the same"
- " so that on a 64-bit platform you can\n"
- "InnoDB: allocate more than 4 GB of memory.",
- (ulong)sizeof(ulint), (ulong)sizeof(void*));
+ " InnoDB: platforms you can allocate more than 4 GB "
+ "of memory.\n");
}
/* System tables are created in tablespace 0. Thus, we must
@@ -1075,53 +1062,74 @@ innobase_start_or_create_for_mysql(void)
innodb_file_per_table) until this function has returned. */
srv_file_per_table = FALSE;
#ifdef UNIV_DEBUG
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
+ " InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n");
#endif
#ifdef UNIV_IBUF_DEBUG
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n"
+ " InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n");
# ifdef UNIV_IBUF_COUNT_DEBUG
- "InnoDB: !!!!!!!! UNIV_IBUF_COUNT_DEBUG switched on !!!!!!!!!\n"
- "InnoDB: Crash recovery will fail with UNIV_IBUF_COUNT_DEBUG\n"
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: !!!!!!!! UNIV_IBUF_COUNT_DEBUG switched on "
+ "!!!!!!!!!\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Crash recovery will fail with UNIV_IBUF_COUNT_DEBUG\n");
# endif
- );
#endif
+#ifdef UNIV_BLOB_DEBUG
+ fprintf(stderr,
+ "InnoDB: !!!!!!!! UNIV_BLOB_DEBUG switched on !!!!!!!!!\n"
+ "InnoDB: Server restart may fail with UNIV_BLOB_DEBUG\n");
+#endif /* UNIV_BLOB_DEBUG */
+
#ifdef UNIV_SYNC_DEBUG
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n");
+ " InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n");
#endif
#ifdef UNIV_SEARCH_DEBUG
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n");
+ " InnoDB: !!!!!!!! UNIV_SEARCH_DEBUG switched on !!!!!!!!!\n");
#endif
#ifdef UNIV_LOG_LSN_DEBUG
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!\n");
+ " InnoDB: !!!!!!!! UNIV_LOG_LSN_DEBUG switched on !!!!!!!!!\n");
#endif /* UNIV_LOG_LSN_DEBUG */
#ifdef UNIV_MEM_DEBUG
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n");
+ " InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n");
#endif
if (UNIV_LIKELY(srv_use_sys_malloc)) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: The InnoDB memory heap is disabled\n");
+ " InnoDB: The InnoDB memory heap is disabled\n");
}
- fputs("InnoDB: " IB_ATOMICS_STARTUP_MSG
- "\nInnoDB: Compressed tables use zlib " ZLIB_VERSION
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: " IB_ATOMICS_STARTUP_MSG "\n", stderr);
+
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: Compressed tables use zlib " ZLIB_VERSION
#ifdef UNIV_ZIP_DEBUG
" with validation"
#endif /* UNIV_ZIP_DEBUG */
+ "\n" , stderr);
#ifdef UNIV_ZIP_COPY
- " and extra copying"
+ ut_print_timestamp(stderr);
+ fputs(" InnoDB: and extra copying\n", stderr);
#endif /* UNIV_ZIP_COPY */
- "\n" , stderr);
/* Since InnoDB does not currently clean up all its internal data
structures in MySQL Embedded Server Library server_end(), we
@@ -1129,13 +1137,17 @@ innobase_start_or_create_for_mysql(void)
second time during the process lifetime. */
if (srv_start_has_been_called) {
- fprintf(stderr,
- "InnoDB: Error: startup called second time"
- " during the process lifetime.\n"
- "InnoDB: In the MySQL Embedded Server Library"
- " you cannot call server_init()\n"
- "InnoDB: more than once during"
- " the process lifetime.\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: Error: startup called second time "
+ "during the process\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: lifetime. In the MySQL Embedded "
+ "Server Library you\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: cannot call server_init() more "
+ "than once during the\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: process lifetime.\n");
}
srv_start_has_been_called = TRUE;
@@ -1179,7 +1191,7 @@ innobase_start_or_create_for_mysql(void)
if (srv_use_native_aio) {
ut_print_timestamp(stderr);
fprintf(stderr,
- " InnoDB: Using Linux native AIO\n");
+ " InnoDB: Using Linux native AIO\n");
}
#else
/* Currently native AIO is supported only on windows and linux
@@ -1224,8 +1236,9 @@ innobase_start_or_create_for_mysql(void)
srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED;
#endif
} else {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Unrecognized value %s for"
+ " InnoDB: Unrecognized value %s for"
" innodb_flush_method\n",
srv_file_flush_method_str);
return(DB_ERROR);
@@ -1306,7 +1319,8 @@ innobase_start_or_create_for_mysql(void)
we'll emit a message telling the user that this parameter
is now deprecated. */
if (srv_n_file_io_threads != 4) {
- fprintf(stderr, "InnoDB: Warning:"
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: Warning:"
" innodb_file_io_threads is deprecated."
" Please use innodb_read_io_threads and"
" innodb_write_io_threads instead\n");
@@ -1318,13 +1332,16 @@ innobase_start_or_create_for_mysql(void)
ut_a(srv_n_file_io_threads <= SRV_MAX_N_IO_THREADS);
- /* TODO: Investigate if SRV_N_PENDING_IOS_PER_THREAD (32) limit
- still applies to windows. */
- if (!srv_use_native_aio) {
- io_limit = 8 * SRV_N_PENDING_IOS_PER_THREAD;
- } else {
+ io_limit = 8 * SRV_N_PENDING_IOS_PER_THREAD;
+
+ /* On Windows when using native aio the number of aio requests
+ that a thread can handle at a given time is limited to 32
+ i.e.: SRV_N_PENDING_IOS_PER_THREAD */
+# ifdef __WIN__
+ if (srv_use_native_aio) {
io_limit = SRV_N_PENDING_IOS_PER_THREAD;
}
+# endif /* __WIN__ */
os_aio_init(io_limit,
srv_n_read_io_threads,
@@ -1334,11 +1351,31 @@ innobase_start_or_create_for_mysql(void)
fil_init(srv_file_per_table ? 50000 : 5000,
srv_max_n_open_files);
+ /* Print time to initialize the buffer pool */
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Initializing buffer pool, size =");
+
+ if (srv_buf_pool_size >= 1024 * 1024 * 1024) {
+ fprintf(stderr,
+ " %.1fG\n",
+ ((double) srv_buf_pool_size) / (1024 * 1024 * 1024));
+ } else {
+ fprintf(stderr,
+ " %.1fM\n",
+ ((double) srv_buf_pool_size) / (1024 * 1024));
+ }
+
err = buf_pool_init(srv_buf_pool_size, srv_buf_pool_instances);
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Completed initialization of buffer pool\n");
+
if (err != DB_SUCCESS) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Fatal error: cannot allocate the memory"
+ " InnoDB: Fatal error: cannot allocate memory"
" for the buffer pool\n");
return(DB_ERROR);
@@ -1350,7 +1387,8 @@ innobase_start_or_create_for_mysql(void)
if (srv_buf_pool_size <= 5 * 1024 * 1024) {
- fprintf(stderr, "InnoDB: Warning: Small buffer pool size "
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: Warning: Small buffer pool size "
"(%luM), the flst_validate() debug function "
"can cause a deadlock if the buffer pool fills up.\n",
srv_buf_pool_size / 1024 / 1024);
@@ -1372,18 +1410,19 @@ innobase_start_or_create_for_mysql(void)
#ifdef UNIV_LOG_ARCHIVE
if (0 != ut_strcmp(srv_log_group_home_dirs[0], srv_arch_dir)) {
- fprintf(stderr,
- "InnoDB: Error: you must set the log group"
- " home dir in my.cnf the\n"
- "InnoDB: same as log arch dir.\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: Error: you must set the log group home dir in my.cnf\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: the same as log arch dir.\n");
return(DB_ERROR);
}
#endif /* UNIV_LOG_ARCHIVE */
if (srv_n_log_files * srv_log_file_size >= 262144) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: combined size of log files"
+ " InnoDB: Error: combined size of log files"
" must be < 4 GB\n");
return(DB_ERROR);
@@ -1394,10 +1433,13 @@ innobase_start_or_create_for_mysql(void)
for (i = 0; i < srv_n_data_files; i++) {
#ifndef __WIN__
if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Error: file size must be < 4 GB"
+ " with this MySQL binary\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: file size must be < 4 GB"
- " with this MySQL binary\n"
- "InnoDB: and operating system combination,"
+ " InnoDB: and operating system combination,"
" in some OS's < 2 GB\n");
return(DB_ERROR);
@@ -1407,8 +1449,9 @@ innobase_start_or_create_for_mysql(void)
}
if (sum_of_new_sizes < 10485760 / UNIV_PAGE_SIZE) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: tablespace size must be"
+ " InnoDB: Error: tablespace size must be"
" at least 10 MB\n");
return(DB_ERROR);
@@ -1421,19 +1464,32 @@ innobase_start_or_create_for_mysql(void)
&min_flushed_lsn, &max_flushed_lsn,
&sum_of_new_sizes);
if (err != DB_SUCCESS) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Could not open or create data files.\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: If you tried to add new data files,"
+ " and it failed here,\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Could not open or create data files.\n"
- "InnoDB: If you tried to add new data files,"
- " and it failed here,\n"
- "InnoDB: you should now edit innodb_data_file_path"
- " in my.cnf back\n"
- "InnoDB: to what it was, and remove the"
- " new ibdata files InnoDB created\n"
- "InnoDB: in this failed attempt. InnoDB only wrote"
- " those files full of\n"
- "InnoDB: zeros, but did not yet use them in any way."
- " But be careful: do not\n"
- "InnoDB: remove old data files"
+ " InnoDB: you should now edit innodb_data_file_path"
+ " in my.cnf back\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: to what it was, and remove the"
+ " new ibdata files InnoDB created\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: in this failed attempt. InnoDB only wrote"
+ " those files full of\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: zeros, but did not yet use them in any way."
+ " But be careful: do not\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: remove old data files"
" which contain your precious data!\n");
return((int) err);
@@ -1459,18 +1515,29 @@ innobase_start_or_create_for_mysql(void)
}
if ((log_opened && create_new_db)
|| (log_opened && log_created)) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Error: all log files must be"
+ " created at the same time.\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: All log files must be"
+ " created also in database creation.\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: If you want bigger or smaller"
+ " log files, shut down the\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: database and make sure there"
+ " were no errors in shutdown.\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Then delete the existing log files."
+ " Edit the .cnf file\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: all log files must be"
- " created at the same time.\n"
- "InnoDB: All log files must be"
- " created also in database creation.\n"
- "InnoDB: If you want bigger or smaller"
- " log files, shut down the\n"
- "InnoDB: database and make sure there"
- " were no errors in shutdown.\n"
- "InnoDB: Then delete the existing log files."
- " Edit the .cnf file\n"
- "InnoDB: and start the database again.\n");
+ " InnoDB: and start the database again.\n");
return(DB_ERROR);
}
@@ -1491,27 +1558,41 @@ innobase_start_or_create_for_mysql(void)
|| max_arch_log_no != min_arch_log_no
#endif /* UNIV_LOG_ARCHIVE */
) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Cannot initialize created"
+ " log files because\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: data files were not in sync"
+ " with each other\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Cannot initialize created"
- " log files because\n"
- "InnoDB: data files were not in sync"
- " with each other\n"
- "InnoDB: or the data files are corrupt.\n");
+ " InnoDB: or the data files are corrupt.\n");
return(DB_ERROR);
}
if (max_flushed_lsn < (ib_uint64_t) 1000) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Cannot initialize created"
+ " log files because\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: data files are corrupt,"
+ " or new data files were\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Cannot initialize created"
- " log files because\n"
- "InnoDB: data files are corrupt,"
- " or new data files were\n"
- "InnoDB: created when the database"
- " was started previous\n"
- "InnoDB: time but the database"
- " was not shut down\n"
- "InnoDB: normally after that.\n");
+ " InnoDB: created when the database"
+ " was started previous\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: time but the database"
+ " was not shut down\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: normally after that.\n");
return(DB_ERROR);
}
@@ -1550,8 +1631,9 @@ innobase_start_or_create_for_mysql(void)
#ifdef UNIV_LOG_ARCHIVE
} else if (srv_archive_recovery) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Starting archive"
+ " InnoDB: Starting archive"
" recovery from a backup...\n");
err = recv_recovery_from_archive_start(
min_flushed_lsn, srv_archive_recovery_limit_lsn,
@@ -1759,6 +1841,24 @@ innobase_start_or_create_for_mysql(void)
os_thread_create(&srv_purge_thread, NULL, NULL);
}
+ /* Wait for the purge and master thread to startup. */
+
+ while (srv_shutdown_state == SRV_SHUTDOWN_NONE) {
+ if (srv_thread_has_reserved_slot(SRV_MASTER) == ULINT_UNDEFINED
+ || (srv_n_purge_threads == 1
+ && srv_thread_has_reserved_slot(SRV_WORKER)
+ == ULINT_UNDEFINED)) {
+
+ ut_print_timestamp(stderr);
+ fprintf(stderr, " InnoDB: "
+ "Waiting for the background threads to "
+ "start\n");
+ os_thread_sleep(1000000);
+ } else {
+ break;
+ }
+ }
+
#ifdef UNIV_DEBUG
/* buf_debug_prints = TRUE; */
#endif /* UNIV_DEBUG */
@@ -1773,11 +1873,14 @@ innobase_start_or_create_for_mysql(void)
if (!srv_auto_extend_last_data_file
&& sum_of_data_file_sizes != tablespace_size_in_header) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Error: tablespace size"
+ " stored in header is %lu pages, but\n",
+ (ulong) tablespace_size_in_header);
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: tablespace size"
- " stored in header is %lu pages, but\n"
"InnoDB: the sum of data file sizes is %lu pages\n",
- (ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
if (srv_force_recovery == 0
@@ -1785,16 +1888,25 @@ innobase_start_or_create_for_mysql(void)
/* This is a fatal error, the tail of a tablespace is
missing */
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Cannot start InnoDB."
- " The tail of the system tablespace is\n"
- "InnoDB: missing. Have you edited"
- " innodb_data_file_path in my.cnf in an\n"
- "InnoDB: inappropriate way, removing"
- " ibdata files from there?\n"
- "InnoDB: You can set innodb_force_recovery=1"
- " in my.cnf to force\n"
- "InnoDB: a startup if you are trying"
+ " InnoDB: Cannot start InnoDB."
+ " The tail of the system tablespace is\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: missing. Have you edited"
+ " innodb_data_file_path in my.cnf in an\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: inappropriate way, removing"
+ " ibdata files from there?\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: You can set innodb_force_recovery=1"
+ " in my.cnf to force\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: a startup if you are trying"
" to recover a badly corrupt database.\n");
return(DB_ERROR);
@@ -1804,26 +1916,38 @@ innobase_start_or_create_for_mysql(void)
if (srv_auto_extend_last_data_file
&& sum_of_data_file_sizes < tablespace_size_in_header) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: tablespace size stored in header"
- " is %lu pages, but\n"
- "InnoDB: the sum of data file sizes"
+ " InnoDB: Error: tablespace size stored in header"
+ " is %lu pages, but\n",
+ (ulong) tablespace_size_in_header);
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: the sum of data file sizes"
" is only %lu pages\n",
- (ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
if (srv_force_recovery == 0) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Cannot start InnoDB. The tail of"
+ " the system tablespace is\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: missing. Have you edited"
+ " innodb_data_file_path in my.cnf in an\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: inappropriate way, removing"
+ " ibdata files from there?\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: You can set innodb_force_recovery=1"
+ " in my.cnf to force\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Cannot start InnoDB. The tail of"
- " the system tablespace is\n"
- "InnoDB: missing. Have you edited"
- " innodb_data_file_path in my.cnf in an\n"
- "InnoDB: inappropriate way, removing"
- " ibdata files from there?\n"
- "InnoDB: You can set innodb_force_recovery=1"
- " in my.cnf to force\n"
- "InnoDB: a startup if you are trying to"
+ " InnoDB: a startup if you are trying to"
" recover a badly corrupt database.\n");
return(DB_ERROR);
@@ -1834,10 +1958,13 @@ innobase_start_or_create_for_mysql(void)
os_fast_mutex_init(&srv_os_test_mutex);
if (0 != os_fast_mutex_trylock(&srv_os_test_mutex)) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: Error: pthread_mutex_trylock returns"
+ " an unexpected value on\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Error: pthread_mutex_trylock returns"
- " an unexpected value on\n"
- "InnoDB: success! Cannot continue.\n");
+ " InnoDB: success! Cannot continue.\n");
exit(1);
}
@@ -1852,14 +1979,15 @@ innobase_start_or_create_for_mysql(void)
if (srv_print_verbose_log) {
ut_print_timestamp(stderr);
fprintf(stderr,
- " InnoDB %s started; "
+ " InnoDB: %s started; "
"log sequence number %llu\n",
INNODB_VERSION_STR, srv_start_lsn);
}
if (srv_force_recovery > 0) {
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: !!! innodb_force_recovery"
+ " InnoDB: !!! innodb_force_recovery"
" is set to %lu !!!\n",
(ulong) srv_force_recovery);
}
@@ -1880,12 +2008,17 @@ innobase_start_or_create_for_mysql(void)
4.1.1. It is essential that the insert buffer is emptied
here! */
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: You are upgrading to an"
+ " InnoDB version which allows multiple\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: tablespaces. Wait that purge"
+ " and insert buffer merge run to\n");
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: You are upgrading to an"
- " InnoDB version which allows multiple\n"
- "InnoDB: tablespaces. Wait that purge"
- " and insert buffer merge run to\n"
- "InnoDB: completion...\n");
+ " InnoDB: completion...\n");
for (;;) {
os_thread_sleep(1000000);
@@ -1897,21 +2030,29 @@ innobase_start_or_create_for_mysql(void)
break;
}
}
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: Full purge and insert buffer merge"
+ " InnoDB: Full purge and insert buffer merge"
" completed.\n");
trx_sys_mark_upgraded_to_multiple_tablespaces();
+ ut_print_timestamp(stderr);
fprintf(stderr,
- "InnoDB: You have now successfully upgraded"
- " to the multiple tablespaces\n"
- "InnoDB: format. You should NOT DOWNGRADE"
- " to an earlier version of\n"
- "InnoDB: InnoDB! But if you absolutely need to"
- " downgrade, see\n"
- "InnoDB: " REFMAN "multiple-tablespaces.html\n"
- "InnoDB: for instructions.\n");
+ " InnoDB: You have now successfully upgraded"
+ " to the multiple tablespaces\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: format. You should NOT DOWNGRADE"
+ " to an earlier version of\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: InnoDB! But if you absolutely need to"
+ " downgrade, see\n");
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+ " InnoDB: " REFMAN "multiple-tablespaces.html\n"
+ " InnoDB: for instructions.\n");
}
if (srv_force_recovery == 0) {
@@ -1956,17 +2097,6 @@ innobase_shutdown_for_mysql(void)
The step 1 is the real InnoDB shutdown. The remaining steps 2 - ...
just free data structures after the shutdown. */
-
- if (srv_fast_shutdown == 2) {
- ut_print_timestamp(stderr);
- fprintf(stderr,
- " InnoDB: MySQL has requested a very fast shutdown"
- " without flushing "
- "the InnoDB buffer pool to data files."
- " At the next mysqld startup "
- "InnoDB will do a crash recovery!\n");
- }
-
logs_empty_and_mark_files_at_shutdown();
if (srv_conc_n_threads != 0) {
@@ -1981,17 +2111,9 @@ innobase_shutdown_for_mysql(void)
srv_shutdown_state = SRV_SHUTDOWN_EXIT_THREADS;
- /* In a 'very fast' shutdown, we do not need to wait for these threads
- to die; all which counts is that we flushed the log; a 'very fast'
- shutdown is essentially a crash. */
-
- if (srv_fast_shutdown == 2) {
- return(DB_SUCCESS);
- }
-
/* All threads end up waiting for certain events. Put those events
- to the signaled state. Then the threads will exit themselves in
- os_thread_event_wait(). */
+ to the signaled state. Then the threads will exit themselves after
+ os_event_wait(). */
for (i = 0; i < 1000; i++) {
/* NOTE: IF YOU CREATE THREADS IN INNODB, YOU MUST EXIT THEM
@@ -2068,7 +2190,6 @@ innobase_shutdown_for_mysql(void)
ibuf_close();
log_shutdown();
lock_sys_close();
- thr_local_close();
trx_sys_file_format_close();
trx_sys_close();
diff --git a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c
index 753ebd958ac..30caddccced 100644
--- a/storage/innobase/sync/sync0arr.c
+++ b/storage/innobase/sync/sync0arr.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -40,6 +40,7 @@ Created 9/5/1995 Heikki Tuuri
#include "os0sync.h"
#include "os0file.h"
#include "srv0srv.h"
+#include "ha_prototypes.h"
/*
WAIT ARRAY
@@ -478,8 +479,8 @@ sync_array_cell_print(
fprintf(file,
"--Thread %lu has waited at %s line %lu"
" for %.2f seconds the semaphore:\n",
- (ulong) os_thread_pf(cell->thread), cell->file,
- (ulong) cell->line,
+ (ulong) os_thread_pf(cell->thread),
+ innobase_basename(cell->file), (ulong) cell->line,
difftime(time(NULL), cell->reservation_time));
if (type == SYNC_MUTEX) {
@@ -493,7 +494,8 @@ sync_array_cell_print(
"Last time reserved in file %s line %lu, "
#endif /* UNIV_SYNC_DEBUG */
"waiters flag %lu\n",
- (void*) mutex, mutex->cfile_name, (ulong) mutex->cline,
+ (void*) mutex, innobase_basename(mutex->cfile_name),
+ (ulong) mutex->cline,
(ulong) mutex->lock_word,
#ifdef UNIV_SYNC_DEBUG
mutex->file_name, (ulong) mutex->line,
@@ -512,7 +514,7 @@ sync_array_cell_print(
fprintf(file,
" RW-latch at %p created in file %s line %lu\n",
- (void*) rwlock, rwlock->cfile_name,
+ (void*) rwlock, innobase_basename(rwlock->cfile_name),
(ulong) rwlock->cline);
writer = rw_lock_get_writer(rwlock);
if (writer != RW_LOCK_NOT_LOCKED) {
@@ -533,7 +535,7 @@ sync_array_cell_print(
(ulong) rw_lock_get_reader_count(rwlock),
(ulong) rwlock->waiters,
rwlock->lock_word,
- rwlock->last_s_file_name,
+ innobase_basename(rwlock->last_s_file_name),
(ulong) rwlock->last_s_line,
rwlock->last_x_file_name,
(ulong) rwlock->last_x_line);
@@ -590,9 +592,6 @@ sync_array_deadlock_step(
ulint depth) /*!< in: recursion depth */
{
sync_cell_t* new;
- ibool ret;
-
- depth++;
if (pass != 0) {
/* If pass != 0, then we do not know which threads are
@@ -604,7 +603,7 @@ sync_array_deadlock_step(
new = sync_array_find_thread(arr, thread);
- if (new == start) {
+ if (UNIV_UNLIKELY(new == start)) {
/* Stop running of other threads */
ut_dbg_stop_threads = TRUE;
@@ -616,11 +615,7 @@ sync_array_deadlock_step(
return(TRUE);
} else if (new) {
- ret = sync_array_detect_deadlock(arr, start, new, depth);
-
- if (ret) {
- return(TRUE);
- }
+ return(sync_array_detect_deadlock(arr, start, new, depth + 1));
}
return(FALSE);
}
@@ -721,7 +716,7 @@ print:
fprintf(stderr, "rw-lock %p ",
(void*) lock);
sync_array_cell_print(stderr, cell);
- rw_lock_debug_print(debug);
+ rw_lock_debug_print(stderr, debug);
return(TRUE);
}
}
@@ -920,8 +915,10 @@ Prints warnings of long semaphore waits to stderr.
@return TRUE if fatal semaphore wait threshold was exceeded */
UNIV_INTERN
ibool
-sync_array_print_long_waits(void)
-/*=============================*/
+sync_array_print_long_waits(
+/*========================*/
+ os_thread_id_t* waiter, /*!< out: longest waiting thread */
+ const void** sema) /*!< out: longest-waited-for semaphore */
{
sync_cell_t* cell;
ibool old_val;
@@ -929,24 +926,52 @@ sync_array_print_long_waits(void)
ulint i;
ulint fatal_timeout = srv_fatal_semaphore_wait_threshold;
ibool fatal = FALSE;
+ double longest_diff = 0;
+
+#ifdef UNIV_DEBUG_VALGRIND
+ /* Increase the timeouts if running under valgrind because it executes
+ extremely slowly. UNIV_DEBUG_VALGRIND does not necessary mean that
+ we are running under valgrind but we have no better way to tell.
+ See Bug#58432 innodb.innodb_bug56143 fails under valgrind
+ for an example */
+# define SYNC_ARRAY_TIMEOUT 2400
+ fatal_timeout *= 10;
+#else
+# define SYNC_ARRAY_TIMEOUT 240
+#endif
for (i = 0; i < sync_primary_wait_array->n_cells; i++) {
+ double diff;
+ void* wait_object;
+
cell = sync_array_get_nth_cell(sync_primary_wait_array, i);
- if (cell->wait_object != NULL && cell->waiting
- && difftime(time(NULL), cell->reservation_time) > 240) {
+ wait_object = cell->wait_object;
+
+ if (wait_object == NULL || !cell->waiting) {
+
+ continue;
+ }
+
+ diff = difftime(time(NULL), cell->reservation_time);
+
+ if (diff > SYNC_ARRAY_TIMEOUT) {
fputs("InnoDB: Warning: a long semaphore wait:\n",
stderr);
sync_array_cell_print(stderr, cell);
noticed = TRUE;
}
- if (cell->wait_object != NULL && cell->waiting
- && difftime(time(NULL), cell->reservation_time)
- > fatal_timeout) {
+ if (diff > fatal_timeout) {
fatal = TRUE;
}
+
+ if (diff > longest_diff) {
+ longest_diff = diff;
+ *sema = wait_object;
+ *waiter = cell->thread;
+ }
}
if (noticed) {
@@ -977,6 +1002,8 @@ sync_array_print_long_waits(void)
" to the standard error stream\n");
}
+#undef SYNC_ARRAY_TIMEOUT
+
return(fatal);
}
diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c
index 4dbaaa97bd9..397d505df50 100644
--- a/storage/innobase/sync/sync0rw.c
+++ b/storage/innobase/sync/sync0rw.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -39,6 +39,7 @@ Created 9/11/1995 Heikki Tuuri
#include "mem0mem.h"
#include "srv0srv.h"
#include "os0sync.h" /* for INNODB_RW_LOCKS_USE_ATOMICS */
+#include "ha_prototypes.h"
/*
IMPLEMENTATION OF THE RW_LOCK
@@ -271,6 +272,9 @@ rw_lock_create_func(
contains garbage at initialization and cannot be used for
recursive x-locking. */
lock->recursive = FALSE;
+ /* Silence Valgrind when UNIV_DEBUG_VALGRIND is not enabled. */
+ memset((void*) &lock->writer_thread, 0, sizeof lock->writer_thread);
+ UNIV_MEM_INVALID(&lock->writer_thread, sizeof lock->writer_thread);
#ifdef UNIV_SYNC_DEBUG
UT_LIST_INIT(lock->debug_list);
@@ -404,7 +408,8 @@ lock_loop:
" cfile %s cline %lu rnds %lu\n",
(ulong) os_thread_pf(os_thread_get_curr_id()),
(void*) lock,
- lock->cfile_name, (ulong) lock->cline, (ulong) i);
+ innobase_basename(lock->cfile_name),
+ (ulong) lock->cline, (ulong) i);
}
/* We try once again to obtain the lock */
@@ -439,7 +444,8 @@ lock_loop:
"Thread %lu OS wait rw-s-lock at %p"
" cfile %s cline %lu\n",
os_thread_pf(os_thread_get_curr_id()),
- (void*) lock, lock->cfile_name,
+ (void*) lock,
+ innobase_basename(lock->cfile_name),
(ulong) lock->cline);
}
@@ -661,7 +667,8 @@ lock_loop:
"Thread %lu spin wait rw-x-lock at %p"
" cfile %s cline %lu rnds %lu\n",
os_thread_pf(os_thread_get_curr_id()), (void*) lock,
- lock->cfile_name, (ulong) lock->cline, (ulong) i);
+ innobase_basename(lock->cfile_name),
+ (ulong) lock->cline, (ulong) i);
}
sync_array_reserve_cell(sync_primary_wait_array,
@@ -684,7 +691,8 @@ lock_loop:
"Thread %lu OS wait for rw-x-lock at %p"
" cfile %s cline %lu\n",
os_thread_pf(os_thread_get_curr_id()), (void*) lock,
- lock->cfile_name, (ulong) lock->cline);
+ innobase_basename(lock->cfile_name),
+ (ulong) lock->cline);
}
/* these stats may not be accurate */
@@ -936,7 +944,7 @@ rw_lock_list_print_info(
info = UT_LIST_GET_FIRST(lock->debug_list);
while (info != NULL) {
- rw_lock_debug_print(info);
+ rw_lock_debug_print(file, info);
info = UT_LIST_GET_NEXT(list, info);
}
}
@@ -984,7 +992,7 @@ rw_lock_print(
info = UT_LIST_GET_FIRST(lock->debug_list);
while (info != NULL) {
- rw_lock_debug_print(info);
+ rw_lock_debug_print(stderr, info);
info = UT_LIST_GET_NEXT(list, info);
}
}
@@ -996,28 +1004,29 @@ UNIV_INTERN
void
rw_lock_debug_print(
/*================*/
+ FILE* f, /*!< in: output stream */
rw_lock_debug_t* info) /*!< in: debug struct */
{
ulint rwt;
rwt = info->lock_type;
- fprintf(stderr, "Locked: thread %ld file %s line %ld ",
+ fprintf(f, "Locked: thread %lu file %s line %lu ",
(ulong) os_thread_pf(info->thread_id), info->file_name,
(ulong) info->line);
if (rwt == RW_LOCK_SHARED) {
- fputs("S-LOCK", stderr);
+ fputs("S-LOCK", f);
} else if (rwt == RW_LOCK_EX) {
- fputs("X-LOCK", stderr);
+ fputs("X-LOCK", f);
} else if (rwt == RW_LOCK_WAIT_EX) {
- fputs("WAIT X-LOCK", stderr);
+ fputs("WAIT X-LOCK", f);
} else {
ut_error;
}
if (info->pass != 0) {
- fprintf(stderr, " pass value %lu", (ulong) info->pass);
+ fprintf(f, " pass value %lu", (ulong) info->pass);
}
- putc('\n', stderr);
+ putc('\n', f);
}
/***************************************************************//**
diff --git a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c
index 8062d9e902e..0b56e736209 100644
--- a/storage/innobase/sync/sync0sync.c
+++ b/storage/innobase/sync/sync0sync.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2011, Innobase Oy. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
@@ -43,6 +43,7 @@ Created 9/5/1995 Heikki Tuuri
#ifdef UNIV_SYNC_DEBUG
# include "srv0start.h" /* srv_is_being_started */
#endif /* UNIV_SYNC_DEBUG */
+#include "ha_prototypes.h"
/*
REASONS FOR IMPLEMENTING THE SPIN LOCK MUTEX
@@ -188,12 +189,12 @@ UNIV_INTERN sync_array_t* sync_primary_wait_array;
/** This variable is set to TRUE when sync_init is called */
UNIV_INTERN ibool sync_initialized = FALSE;
+#ifdef UNIV_SYNC_DEBUG
/** An acquired mutex or rw-lock and its level in the latching order */
typedef struct sync_level_struct sync_level_t;
/** Mutexes or rw-locks held by a thread */
typedef struct sync_thread_struct sync_thread_t;
-#ifdef UNIV_SYNC_DEBUG
/** The latch levels currently owned by threads are stored in this data
structure; the size of this array is OS_THREAD_MAX_N */
@@ -220,24 +221,43 @@ UNIV_INTERN mysql_pfs_key_t mutex_list_mutex_key;
#ifdef UNIV_SYNC_DEBUG
/** Latching order checks start when this is set TRUE */
UNIV_INTERN ibool sync_order_checks_on = FALSE;
-#endif /* UNIV_SYNC_DEBUG */
+
+/** Number of slots reserved for each OS thread in the sync level array */
+static const ulint SYNC_THREAD_N_LEVELS = 10000;
+
+typedef struct sync_arr_struct sync_arr_t;
+
+/** Array for tracking sync levels per thread. */
+struct sync_arr_struct {
+ ulint in_use; /*!< Number of active cells */
+ ulint n_elems; /*!< Number of elements in the array */
+ ulint max_elems; /*!< Maximum elements */
+ ulint next_free; /*!< ULINT_UNDEFINED or index of next
+ free slot */
+ sync_level_t* elems; /*!< Array elements */
+};
/** Mutexes or rw-locks held by a thread */
struct sync_thread_struct{
- os_thread_id_t id; /*!< OS thread id */
- sync_level_t* levels; /*!< level array for this thread; if
- this is NULL this slot is unused */
+ os_thread_id_t id; /*!< OS thread id */
+ sync_arr_t* levels; /*!< level array for this thread; if
+ this is NULL this slot is unused */
};
-/** Number of slots reserved for each OS thread in the sync level array */
-#define SYNC_THREAD_N_LEVELS 10000
-
/** An acquired mutex or rw-lock and its level in the latching order */
struct sync_level_struct{
- void* latch; /*!< pointer to a mutex or an rw-lock; NULL means that
- the slot is empty */
- ulint level; /*!< level of the latch in the latching order */
+ void* latch; /*!< pointer to a mutex or an
+ rw-lock; NULL means that
+ the slot is empty */
+ ulint level; /*!< level of the latch in the
+ latching order. This field is
+ overloaded to serve as a node in a
+ linked list of free nodes too. When
+ latch == NULL then this will contain
+ the ordinal value of the next free
+ element */
};
+#endif /* UNIV_SYNC_DEBUG */
/******************************************************************//**
Creates, or rather, initializes a mutex object in a specified memory
@@ -524,7 +544,8 @@ spin_loop:
"Thread %lu spin wait mutex at %p"
" cfile %s cline %lu rnds %lu\n",
(ulong) os_thread_pf(os_thread_get_curr_id()), (void*) mutex,
- mutex->cfile_name, (ulong) mutex->cline, (ulong) i);
+ innobase_basename(mutex->cfile_name),
+ (ulong) mutex->cline, (ulong) i);
#endif
mutex_spin_round_count += i;
@@ -601,7 +622,8 @@ spin_loop:
fprintf(stderr,
"Thread %lu OS wait mutex at %p cfile %s cline %lu rnds %lu\n",
(ulong) os_thread_pf(os_thread_get_curr_id()), (void*) mutex,
- mutex->cfile_name, (ulong) mutex->cline, (ulong) i);
+ innobase_basename(mutex->cfile_name),
+ (ulong) mutex->cline, (ulong) i);
#endif
mutex_os_wait_count++;
@@ -745,27 +767,28 @@ mutex_n_reserved(void)
/*==================*/
{
mutex_t* mutex;
- ulint count = 0;
+ ulint count = 0;
mutex_enter(&mutex_list_mutex);
- mutex = UT_LIST_GET_FIRST(mutex_list);
+ for (mutex = UT_LIST_GET_FIRST(mutex_list);
+ mutex != NULL;
+ mutex = UT_LIST_GET_NEXT(list, mutex)) {
- while (mutex != NULL) {
if (mutex_get_lock_word(mutex) != 0) {
count++;
}
-
- mutex = UT_LIST_GET_NEXT(list, mutex);
}
mutex_exit(&mutex_list_mutex);
ut_a(count >= 1);
- return(count - 1); /* Subtract one, because this function itself
- was holding one mutex (mutex_list_mutex) */
+ /* Subtract one, because this function itself was holding
+ one mutex (mutex_list_mutex) */
+
+ return(count - 1);
}
/******************************************************************//**
@@ -781,20 +804,6 @@ sync_all_freed(void)
}
/******************************************************************//**
-Gets the value in the nth slot in the thread level arrays.
-@return pointer to thread slot */
-static
-sync_thread_t*
-sync_thread_level_arrays_get_nth(
-/*=============================*/
- ulint n) /*!< in: slot number */
-{
- ut_ad(n < OS_THREAD_MAX_N);
-
- return(sync_thread_level_arrays + n);
-}
-
-/******************************************************************//**
Looks for the thread slot for the calling thread.
@return pointer to thread slot, NULL if not found */
static
@@ -803,15 +812,15 @@ sync_thread_level_arrays_find_slot(void)
/*====================================*/
{
- sync_thread_t* slot;
- os_thread_id_t id;
ulint i;
+ os_thread_id_t id;
id = os_thread_get_curr_id();
for (i = 0; i < OS_THREAD_MAX_N; i++) {
+ sync_thread_t* slot;
- slot = sync_thread_level_arrays_get_nth(i);
+ slot = &sync_thread_level_arrays[i];
if (slot->levels && os_thread_eq(slot->id, id)) {
@@ -831,12 +840,12 @@ sync_thread_level_arrays_find_free(void)
/*====================================*/
{
- sync_thread_t* slot;
ulint i;
for (i = 0; i < OS_THREAD_MAX_N; i++) {
+ sync_thread_t* slot;
- slot = sync_thread_level_arrays_get_nth(i);
+ slot = &sync_thread_level_arrays[i];
if (slot->levels == NULL) {
@@ -848,19 +857,45 @@ sync_thread_level_arrays_find_free(void)
}
/******************************************************************//**
-Gets the value in the nth slot in the thread level array.
-@return pointer to level slot */
+Print warning. */
static
-sync_level_t*
-sync_thread_levels_get_nth(
-/*=======================*/
- sync_level_t* arr, /*!< in: pointer to level array for an OS
- thread */
- ulint n) /*!< in: slot number */
+void
+sync_print_warning(
+/*===============*/
+ const sync_level_t* slot) /*!< in: slot for which to
+ print warning */
{
- ut_ad(n < SYNC_THREAD_N_LEVELS);
+ mutex_t* mutex;
+
+ mutex = slot->latch;
- return(arr + n);
+ if (mutex->magic_n == MUTEX_MAGIC_N) {
+ fprintf(stderr,
+ "Mutex created at %s %lu\n",
+ innobase_basename(mutex->cfile_name),
+ (ulong) mutex->cline);
+
+ if (mutex_get_lock_word(mutex) != 0) {
+ ulint line;
+ const char* file_name;
+ os_thread_id_t thread_id;
+
+ mutex_get_debug_info(
+ mutex, &file_name, &line, &thread_id);
+
+ fprintf(stderr,
+ "InnoDB: Locked mutex:"
+ " addr %p thread %ld file %s line %ld\n",
+ (void*) mutex, os_thread_pf(thread_id),
+ file_name, (ulong) line);
+ } else {
+ fputs("Not locked\n", stderr);
+ }
+ } else {
+ rw_lock_t* lock = slot->latch;
+
+ rw_lock_print(lock);
+ }
}
/******************************************************************//**
@@ -871,69 +906,29 @@ static
ibool
sync_thread_levels_g(
/*=================*/
- sync_level_t* arr, /*!< in: pointer to level array for an OS
+ sync_arr_t* arr, /*!< in: pointer to level array for an OS
thread */
ulint limit, /*!< in: level limit */
ulint warn) /*!< in: TRUE=display a diagnostic message */
{
- sync_level_t* slot;
- rw_lock_t* lock;
- mutex_t* mutex;
ulint i;
- for (i = 0; i < SYNC_THREAD_N_LEVELS; i++) {
-
- slot = sync_thread_levels_get_nth(arr, i);
-
- if (slot->latch != NULL) {
- if (slot->level <= limit) {
-
- if (!warn) {
+ for (i = 0; i < arr->n_elems; i++) {
+ const sync_level_t* slot;
- return(FALSE);
- }
-
- lock = slot->latch;
- mutex = slot->latch;
+ slot = &arr->elems[i];
+ if (slot->latch != NULL && slot->level <= limit) {
+ if (warn) {
fprintf(stderr,
"InnoDB: sync levels should be"
" > %lu but a level is %lu\n",
(ulong) limit, (ulong) slot->level);
- if (mutex->magic_n == MUTEX_MAGIC_N) {
- fprintf(stderr,
- "Mutex created at %s %lu\n",
- mutex->cfile_name,
- (ulong) mutex->cline);
-
- if (mutex_get_lock_word(mutex) != 0) {
- const char* file_name;
- ulint line;
- os_thread_id_t thread_id;
-
- mutex_get_debug_info(
- mutex, &file_name,
- &line, &thread_id);
-
- fprintf(stderr,
- "InnoDB: Locked mutex:"
- " addr %p thread %ld"
- " file %s line %ld\n",
- (void*) mutex,
- os_thread_pf(
- thread_id),
- file_name,
- (ulong) line);
- } else {
- fputs("Not locked\n", stderr);
- }
- } else {
- rw_lock_print(lock);
- }
-
- return(FALSE);
+ sync_print_warning(slot);
}
+
+ return(FALSE);
}
}
@@ -942,31 +937,29 @@ sync_thread_levels_g(
/******************************************************************//**
Checks if the level value is stored in the level array.
-@return TRUE if stored */
+@return slot if found or NULL */
static
-ibool
+const sync_level_t*
sync_thread_levels_contain(
/*=======================*/
- sync_level_t* arr, /*!< in: pointer to level array for an OS
+ sync_arr_t* arr, /*!< in: pointer to level array for an OS
thread */
ulint level) /*!< in: level */
{
- sync_level_t* slot;
ulint i;
- for (i = 0; i < SYNC_THREAD_N_LEVELS; i++) {
+ for (i = 0; i < arr->n_elems; i++) {
+ const sync_level_t* slot;
- slot = sync_thread_levels_get_nth(arr, i);
+ slot = &arr->elems[i];
- if (slot->latch != NULL) {
- if (slot->level == level) {
+ if (slot->latch != NULL && slot->level == level) {
- return(TRUE);
- }
+ return(slot);
}
}
- return(FALSE);
+ return(NULL);
}
/******************************************************************//**
@@ -980,10 +973,9 @@ sync_thread_levels_contains(
ulint level) /*!< in: latching order level
(SYNC_DICT, ...)*/
{
- sync_level_t* arr;
- sync_thread_t* thread_slot;
- sync_level_t* slot;
ulint i;
+ sync_arr_t* arr;
+ sync_thread_t* thread_slot;
if (!sync_order_checks_on) {
@@ -1003,9 +995,10 @@ sync_thread_levels_contains(
arr = thread_slot->levels;
- for (i = 0; i < SYNC_THREAD_N_LEVELS; i++) {
+ for (i = 0; i < arr->n_elems; i++) {
+ sync_level_t* slot;
- slot = sync_thread_levels_get_nth(arr, i);
+ slot = &arr->elems[i];
if (slot->latch != NULL && slot->level == level) {
@@ -1027,14 +1020,11 @@ void*
sync_thread_levels_nonempty_gen(
/*============================*/
ibool dict_mutex_allowed) /*!< in: TRUE if dictionary mutex is
- allowed to be owned by the thread,
- also purge_is_running mutex is
- allowed */
+ allowed to be owned by the thread */
{
- sync_level_t* arr;
- sync_thread_t* thread_slot;
- sync_level_t* slot;
ulint i;
+ sync_arr_t* arr;
+ sync_thread_t* thread_slot;
if (!sync_order_checks_on) {
@@ -1054,9 +1044,10 @@ sync_thread_levels_nonempty_gen(
arr = thread_slot->levels;
- for (i = 0; i < SYNC_THREAD_N_LEVELS; i++) {
+ for (i = 0; i < arr->n_elems; ++i) {
+ const sync_level_t* slot;
- slot = sync_thread_levels_get_nth(arr, i);
+ slot = &arr->elems[i];
if (slot->latch != NULL
&& (!dict_mutex_allowed
@@ -1076,14 +1067,61 @@ sync_thread_levels_nonempty_gen(
}
/******************************************************************//**
-Checks that the level array for the current thread is empty.
-@return TRUE if empty */
+Checks if the level array for the current thread is empty,
+except for the btr_search_latch.
+@return a latch, or NULL if empty except the exceptions specified below */
UNIV_INTERN
-ibool
-sync_thread_levels_empty(void)
-/*==========================*/
+void*
+sync_thread_levels_nonempty_trx(
+/*============================*/
+ ibool has_search_latch)
+ /*!< in: TRUE if and only if the thread
+ is supposed to hold btr_search_latch */
{
- return(sync_thread_levels_empty_gen(FALSE));
+ ulint i;
+ sync_arr_t* arr;
+ sync_thread_t* thread_slot;
+
+ if (!sync_order_checks_on) {
+
+ return(NULL);
+ }
+
+ ut_a(!has_search_latch
+ || sync_thread_levels_contains(SYNC_SEARCH_SYS));
+
+ mutex_enter(&sync_thread_mutex);
+
+ thread_slot = sync_thread_level_arrays_find_slot();
+
+ if (thread_slot == NULL) {
+
+ mutex_exit(&sync_thread_mutex);
+
+ return(NULL);
+ }
+
+ arr = thread_slot->levels;
+
+ for (i = 0; i < arr->n_elems; ++i) {
+ const sync_level_t* slot;
+
+ slot = &arr->elems[i];
+
+ if (slot->latch != NULL
+ && (!has_search_latch
+ || slot->level != SYNC_SEARCH_SYS)) {
+
+ mutex_exit(&sync_thread_mutex);
+ ut_error;
+
+ return(slot->latch);
+ }
+ }
+
+ mutex_exit(&sync_thread_mutex);
+
+ return(NULL);
}
/******************************************************************//**
@@ -1098,10 +1136,10 @@ sync_thread_add_level(
ulint level) /*!< in: level in the latching order; if
SYNC_LEVEL_VARYING, nothing is done */
{
- sync_level_t* array;
+ ulint i;
sync_level_t* slot;
+ sync_arr_t* array;
sync_thread_t* thread_slot;
- ulint i;
if (!sync_order_checks_on) {
@@ -1126,20 +1164,23 @@ sync_thread_add_level(
thread_slot = sync_thread_level_arrays_find_slot();
if (thread_slot == NULL) {
- /* We have to allocate the level array for a new thread */
- array = ut_malloc(sizeof(sync_level_t) * SYNC_THREAD_N_LEVELS);
+ ulint sz;
- thread_slot = sync_thread_level_arrays_find_free();
+ sz = sizeof(*array)
+ + (sizeof(*array->elems) * SYNC_THREAD_N_LEVELS);
- thread_slot->id = os_thread_get_curr_id();
- thread_slot->levels = array;
+ /* We have to allocate the level array for a new thread */
+ array = calloc(sz, sizeof(char));
+ ut_a(array != NULL);
- for (i = 0; i < SYNC_THREAD_N_LEVELS; i++) {
+ array->next_free = ULINT_UNDEFINED;
+ array->max_elems = SYNC_THREAD_N_LEVELS;
+ array->elems = (sync_level_t*) &array[1];
- slot = sync_thread_levels_get_nth(array, i);
+ thread_slot = sync_thread_level_arrays_find_free();
- slot->latch = NULL;
- }
+ thread_slot->levels = array;
+ thread_slot->id = os_thread_get_curr_id();
}
array = thread_slot->levels;
@@ -1180,7 +1221,7 @@ sync_thread_add_level(
case SYNC_RSEG:
case SYNC_TRX_UNDO:
case SYNC_PURGE_LATCH:
- case SYNC_PURGE_SYS:
+ case SYNC_PURGE_QUEUE:
case SYNC_DICT_AUTOINC_MUTEX:
case SYNC_DICT_OPERATION:
case SYNC_DICT_HEADER:
@@ -1207,8 +1248,8 @@ sync_thread_add_level(
case SYNC_BUF_BLOCK:
/* Either the thread must own the buffer pool mutex
- (buf_pool_mutex), or it is allowed to latch only ONE
- buffer block (block->mutex or buf_pool_zip_mutex). */
+ (buf_pool->mutex), or it is allowed to latch only ONE
+ buffer block (block->mutex or buf_pool->zip_mutex). */
if (!sync_thread_levels_g(array, level, FALSE)) {
ut_a(sync_thread_levels_g(array, level - 1, TRUE));
ut_a(sync_thread_levels_contain(array, SYNC_BUF_POOL));
@@ -1247,10 +1288,16 @@ sync_thread_add_level(
|| sync_thread_levels_g(array, SYNC_FSP, TRUE));
break;
case SYNC_TRX_UNDO_PAGE:
+ /* Purge is allowed to read in as many UNDO pages as it likes,
+ there was a bogus rule here earlier that forced the caller to
+ acquire the purge_sys_t::mutex. The purge mutex did not really
+ protect anything because it was only ever acquired by the
+ single purge thread. The purge thread can read the UNDO pages
+ without any covering mutex. */
+
ut_a(sync_thread_levels_contain(array, SYNC_TRX_UNDO)
|| sync_thread_levels_contain(array, SYNC_RSEG)
- || sync_thread_levels_contain(array, SYNC_PURGE_SYS)
- || sync_thread_levels_g(array, SYNC_TRX_UNDO_PAGE, TRUE));
+ || sync_thread_levels_g(array, level - 1, TRUE));
break;
case SYNC_RSEG_HEADER:
ut_a(sync_thread_levels_contain(array, SYNC_RSEG));
@@ -1303,19 +1350,26 @@ sync_thread_add_level(
ut_error;
}
- for (i = 0; i < SYNC_THREAD_N_LEVELS; i++) {
+ if (array->next_free == ULINT_UNDEFINED) {
+ ut_a(array->n_elems < array->max_elems);
- slot = sync_thread_levels_get_nth(array, i);
+ i = array->n_elems++;
+ } else {
+ i = array->next_free;
+ array->next_free = array->elems[i].level;
+ }
- if (slot->latch == NULL) {
- slot->latch = latch;
- slot->level = level;
+ ut_a(i < array->n_elems);
+ ut_a(i != ULINT_UNDEFINED);
- break;
- }
- }
+ ++array->in_use;
+
+ slot = &array->elems[i];
- ut_a(i < SYNC_THREAD_N_LEVELS);
+ ut_a(slot->latch == NULL);
+
+ slot->latch = latch;
+ slot->level = level;
mutex_exit(&sync_thread_mutex);
}
@@ -1331,8 +1385,7 @@ sync_thread_reset_level(
/*====================*/
void* latch) /*!< in: pointer to a mutex or an rw-lock */
{
- sync_level_t* array;
- sync_level_t* slot;
+ sync_arr_t* array;
sync_thread_t* thread_slot;
ulint i;
@@ -1363,17 +1416,37 @@ sync_thread_reset_level(
array = thread_slot->levels;
- for (i = 0; i < SYNC_THREAD_N_LEVELS; i++) {
+ for (i = 0; i < array->n_elems; i++) {
+ sync_level_t* slot;
- slot = sync_thread_levels_get_nth(array, i);
+ slot = &array->elems[i];
- if (slot->latch == latch) {
- slot->latch = NULL;
+ if (slot->latch != latch) {
+ continue;
+ }
- mutex_exit(&sync_thread_mutex);
+ slot->latch = NULL;
- return(TRUE);
+ /* Update the free slot list. See comment in sync_level_t
+ for the level field. */
+ slot->level = array->next_free;
+ array->next_free = i;
+
+ ut_a(array->in_use >= 1);
+ --array->in_use;
+
+ /* If all cells are idle then reset the free
+ list. The assumption is that this will save
+ time when we need to scan up to n_elems. */
+
+ if (array->in_use == 0) {
+ array->n_elems = 0;
+ array->next_free = ULINT_UNDEFINED;
}
+
+ mutex_exit(&sync_thread_mutex);
+
+ return(TRUE);
}
if (((mutex_t*) latch)->magic_n != MUTEX_MAGIC_N) {
@@ -1403,11 +1476,6 @@ void
sync_init(void)
/*===========*/
{
-#ifdef UNIV_SYNC_DEBUG
- sync_thread_t* thread_slot;
- ulint i;
-#endif /* UNIV_SYNC_DEBUG */
-
ut_a(sync_initialized == FALSE);
sync_initialized = TRUE;
@@ -1421,13 +1489,10 @@ sync_init(void)
/* Create the thread latch level array where the latch levels
are stored for each OS thread */
- sync_thread_level_arrays = ut_malloc(OS_THREAD_MAX_N
- * sizeof(sync_thread_t));
- for (i = 0; i < OS_THREAD_MAX_N; i++) {
+ sync_thread_level_arrays = calloc(
+ sizeof(sync_thread_t), OS_THREAD_MAX_N);
+ ut_a(sync_thread_level_arrays != NULL);
- thread_slot = sync_thread_level_arrays_get_nth(i);
- thread_slot->levels = NULL;
- }
#endif /* UNIV_SYNC_DEBUG */
/* Init the mutex list and create the mutex to protect it. */
@@ -1454,6 +1519,34 @@ sync_init(void)
#endif /* UNIV_SYNC_DEBUG */
}
+#ifdef UNIV_SYNC_DEBUG
+/******************************************************************//**
+Frees all debug memory. */
+static
+void
+sync_thread_level_arrays_free(void)
+/*===============================*/
+
+{
+ ulint i;
+
+ for (i = 0; i < OS_THREAD_MAX_N; i++) {
+ sync_thread_t* slot;
+
+ slot = &sync_thread_level_arrays[i];
+
+ /* If this slot was allocated then free the slot memory too. */
+ if (slot->levels != NULL) {
+ free(slot->levels);
+ slot->levels = NULL;
+ }
+ }
+
+ free(sync_thread_level_arrays);
+ sync_thread_level_arrays = NULL;
+}
+#endif /* UNIV_SYNC_DEBUG */
+
/******************************************************************//**
Frees the resources in InnoDB's own synchronization data structures. Use
os_sync_free() after calling this. */
@@ -1466,17 +1559,20 @@ sync_close(void)
sync_array_free(sync_primary_wait_array);
- mutex = UT_LIST_GET_FIRST(mutex_list);
+ for (mutex = UT_LIST_GET_FIRST(mutex_list);
+ mutex != NULL;
+ /* No op */) {
- while (mutex) {
#ifdef UNIV_MEM_DEBUG
if (mutex == &mem_hash_mutex) {
mutex = UT_LIST_GET_NEXT(list, mutex);
continue;
}
#endif /* UNIV_MEM_DEBUG */
+
mutex_free(mutex);
- mutex = UT_LIST_GET_FIRST(mutex_list);
+
+ mutex = UT_LIST_GET_FIRST(mutex_list);
}
mutex_free(&mutex_list_mutex);
@@ -1485,6 +1581,8 @@ sync_close(void)
/* Switch latching order checks on in sync0sync.c */
sync_order_checks_on = FALSE;
+
+ sync_thread_level_arrays_free();
#endif /* UNIV_SYNC_DEBUG */
sync_initialized = FALSE;
diff --git a/storage/innobase/thr/thr0loc.c b/storage/innobase/thr/thr0loc.c
deleted file mode 100644
index 045ff3e9fb1..00000000000
--- a/storage/innobase/thr/thr0loc.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
-
-*****************************************************************************/
-
-/**************************************************//**
-@file thr/thr0loc.c
-The thread local storage
-
-Created 10/5/1995 Heikki Tuuri
-*******************************************************/
-
-#include "thr0loc.h"
-#ifdef UNIV_NONINL
-#include "thr0loc.ic"
-#endif
-
-#include "sync0sync.h"
-#include "hash0hash.h"
-#include "mem0mem.h"
-#include "srv0srv.h"
-
-/*
- IMPLEMENTATION OF THREAD LOCAL STORAGE
- ======================================
-
-The threads sometimes need private data which depends on the thread id.
-This is implemented as a hash table, where the hash value is calculated
-from the thread id, to prepare for a large number of threads. The hash table
-is protected by a mutex. If you need modify the program and put new data to
-the thread local storage, just add it to struct thr_local_struct in the
-header file. */
-
-/** Mutex protecting thr_local_hash */
-static mutex_t thr_local_mutex;
-
-/** The hash table. The module is not yet initialized when it is NULL. */
-static hash_table_t* thr_local_hash = NULL;
-
-/** Thread local data */
-typedef struct thr_local_struct thr_local_t;
-
-#ifdef UNIV_PFS_MUTEX
-/* Key to register the mutex with performance schema */
-UNIV_INTERN mysql_pfs_key_t thr_local_mutex_key;
-#endif /* UNIV_PFS_MUTEX */
-
-/** @brief Thread local data.
-The private data for each thread should be put to
-the structure below and the accessor functions written
-for the field. */
-struct thr_local_struct{
- os_thread_id_t id; /*!< id of the thread which owns this struct */
- os_thread_t handle; /*!< operating system handle to the thread */
- ulint slot_no;/*!< the index of the slot in the thread table
- for this thread */
- ibool in_ibuf;/*!< TRUE if the thread is doing an ibuf
- operation */
- hash_node_t hash; /*!< hash chain node */
- ulint magic_n;/*!< magic number (THR_LOCAL_MAGIC_N) */
-};
-
-/** The value of thr_local_struct::magic_n */
-#define THR_LOCAL_MAGIC_N 1231234
-
-/*******************************************************************//**
-Returns the local storage struct for a thread.
-@return local storage */
-static
-thr_local_t*
-thr_local_get(
-/*==========*/
- os_thread_id_t id) /*!< in: thread id of the thread */
-{
- thr_local_t* local;
-
-try_again:
- ut_ad(thr_local_hash);
- ut_ad(mutex_own(&thr_local_mutex));
-
- /* Look for the local struct in the hash table */
-
- local = NULL;
-
- HASH_SEARCH(hash, thr_local_hash, os_thread_pf(id),
- thr_local_t*, local,, os_thread_eq(local->id, id));
- if (local == NULL) {
- mutex_exit(&thr_local_mutex);
-
- thr_local_create();
-
- mutex_enter(&thr_local_mutex);
-
- goto try_again;
- }
-
- ut_ad(local->magic_n == THR_LOCAL_MAGIC_N);
-
- return(local);
-}
-
-/*******************************************************************//**
-Gets the slot number in the thread table of a thread.
-@return slot number */
-UNIV_INTERN
-ulint
-thr_local_get_slot_no(
-/*==================*/
- os_thread_id_t id) /*!< in: thread id of the thread */
-{
- ulint slot_no;
- thr_local_t* local;
-
- mutex_enter(&thr_local_mutex);
-
- local = thr_local_get(id);
-
- slot_no = local->slot_no;
-
- mutex_exit(&thr_local_mutex);
-
- return(slot_no);
-}
-
-/*******************************************************************//**
-Sets the slot number in the thread table of a thread. */
-UNIV_INTERN
-void
-thr_local_set_slot_no(
-/*==================*/
- os_thread_id_t id, /*!< in: thread id of the thread */
- ulint slot_no)/*!< in: slot number */
-{
- thr_local_t* local;
-
- mutex_enter(&thr_local_mutex);
-
- local = thr_local_get(id);
-
- local->slot_no = slot_no;
-
- mutex_exit(&thr_local_mutex);
-}
-
-/*******************************************************************//**
-Returns pointer to the 'in_ibuf' field within the current thread local
-storage.
-@return pointer to the in_ibuf field */
-UNIV_INTERN
-ibool*
-thr_local_get_in_ibuf_field(void)
-/*=============================*/
-{
- thr_local_t* local;
-
- mutex_enter(&thr_local_mutex);
-
- local = thr_local_get(os_thread_get_curr_id());
-
- mutex_exit(&thr_local_mutex);
-
- return(&(local->in_ibuf));
-}
-
-/*******************************************************************//**
-Creates a local storage struct for the calling new thread. */
-UNIV_INTERN
-void
-thr_local_create(void)
-/*==================*/
-{
- thr_local_t* local;
-
- if (thr_local_hash == NULL) {
- thr_local_init();
- }
-
- local = mem_alloc(sizeof(thr_local_t));
-
- local->id = os_thread_get_curr_id();
- local->handle = os_thread_get_curr();
- local->magic_n = THR_LOCAL_MAGIC_N;
-
- local->in_ibuf = FALSE;
-
- mutex_enter(&thr_local_mutex);
-
- HASH_INSERT(thr_local_t, hash, thr_local_hash,
- os_thread_pf(os_thread_get_curr_id()),
- local);
-
- mutex_exit(&thr_local_mutex);
-}
-
-/*******************************************************************//**
-Frees the local storage struct for the specified thread. */
-UNIV_INTERN
-void
-thr_local_free(
-/*===========*/
- os_thread_id_t id) /*!< in: thread id */
-{
- thr_local_t* local;
-
- mutex_enter(&thr_local_mutex);
-
- /* Look for the local struct in the hash table */
-
- HASH_SEARCH(hash, thr_local_hash, os_thread_pf(id),
- thr_local_t*, local,, os_thread_eq(local->id, id));
- if (local == NULL) {
- mutex_exit(&thr_local_mutex);
-
- return;
- }
-
- HASH_DELETE(thr_local_t, hash, thr_local_hash,
- os_thread_pf(id), local);
-
- mutex_exit(&thr_local_mutex);
-
- ut_a(local->magic_n == THR_LOCAL_MAGIC_N);
-
- mem_free(local);
-}
-
-/****************************************************************//**
-Initializes the thread local storage module. */
-UNIV_INTERN
-void
-thr_local_init(void)
-/*================*/
-{
-
- ut_a(thr_local_hash == NULL);
-
- thr_local_hash = hash_create(OS_THREAD_MAX_N + 100);
-
- mutex_create(thr_local_mutex_key,
- &thr_local_mutex, SYNC_THR_LOCAL);
-}
-
-/********************************************************************
-Close the thread local storage module. */
-UNIV_INTERN
-void
-thr_local_close(void)
-/*=================*/
-{
- ulint i;
-
- ut_a(thr_local_hash != NULL);
-
- /* Free the hash elements. We don't remove them from the table
- because we are going to destroy the table anyway. */
- for (i = 0; i < hash_get_n_cells(thr_local_hash); i++) {
- thr_local_t* local;
-
- local = HASH_GET_FIRST(thr_local_hash, i);
-
- while (local) {
- thr_local_t* prev_local = local;
-
- local = HASH_GET_NEXT(hash, prev_local);
- ut_a(prev_local->magic_n == THR_LOCAL_MAGIC_N);
- mem_free(prev_local);
- }
- }
-
- hash_table_free(thr_local_hash);
- thr_local_hash = NULL;
-}
diff --git a/storage/innobase/trx/trx0i_s.c b/storage/innobase/trx/trx0i_s.c
index 1ad074769c7..c18b747da6d 100644
--- a/storage/innobase/trx/trx0i_s.c
+++ b/storage/innobase/trx/trx0i_s.c
@@ -38,8 +38,6 @@ Created July 17, 2007 Vasil Dimov
#include <mysql/plugin.h>
-#include "mysql_addons.h"
-
#include "buf0buf.h"
#include "dict0dict.h"
#include "ha0storage.h"
@@ -417,6 +415,42 @@ table_cache_create_empty_row(
return(row);
}
+#ifdef UNIV_DEBUG
+/*******************************************************************//**
+Validates a row in the locks cache.
+@return TRUE if valid */
+static
+ibool
+i_s_locks_row_validate(
+/*===================*/
+ const i_s_locks_row_t* row) /*!< in: row to validate */
+{
+ ut_ad(row->lock_trx_id != 0);
+ ut_ad(row->lock_mode != NULL);
+ ut_ad(row->lock_type != NULL);
+ ut_ad(row->lock_table != NULL);
+ ut_ad(row->lock_table_id != 0);
+
+ if (row->lock_space == ULINT_UNDEFINED) {
+ /* table lock */
+ ut_ad(!strcmp("TABLE", row->lock_type));
+ ut_ad(row->lock_index == NULL);
+ ut_ad(row->lock_data == NULL);
+ ut_ad(row->lock_page == ULINT_UNDEFINED);
+ ut_ad(row->lock_rec == ULINT_UNDEFINED);
+ } else {
+ /* record lock */
+ ut_ad(!strcmp("RECORD", row->lock_type));
+ ut_ad(row->lock_index != NULL);
+ /* row->lock_data == NULL if buf_page_try_get() == NULL */
+ ut_ad(row->lock_page != ULINT_UNDEFINED);
+ ut_ad(row->lock_rec != ULINT_UNDEFINED);
+ }
+
+ return(TRUE);
+}
+#endif /* UNIV_DEBUG */
+
/*******************************************************************//**
Fills i_s_trx_row_t object.
If memory can not be allocated then FALSE is returned.
@@ -447,18 +481,15 @@ fill_trx_row(
row->trx_id = trx->id;
row->trx_started = (ib_time_t) trx->start_time;
row->trx_state = trx_get_que_state_str(trx);
+ row->requested_lock_row = requested_lock_row;
+ ut_ad(requested_lock_row == NULL
+ || i_s_locks_row_validate(requested_lock_row));
if (trx->wait_lock != NULL) {
-
ut_a(requested_lock_row != NULL);
-
- row->requested_lock_row = requested_lock_row;
row->trx_wait_started = (ib_time_t) trx->wait_started;
} else {
-
ut_a(requested_lock_row == NULL);
-
- row->requested_lock_row = NULL;
row->trx_wait_started = 0;
}
@@ -477,7 +508,6 @@ fill_trx_row(
stmt = innobase_get_stmt(trx->mysql_thd, &stmt_len);
if (stmt != NULL) {
-
char query[TRX_I_S_TRX_QUERY_MAX_LEN + 1];
if (stmt_len > TRX_I_S_TRX_QUERY_MAX_LEN) {
@@ -488,9 +518,11 @@ fill_trx_row(
query[stmt_len] = '\0';
row->trx_query = ha_storage_put_memlim(
- cache->storage, stmt, stmt_len + 1,
+ cache->storage, query, stmt_len + 1,
MAX_ALLOWED_FOR_STORAGE(cache));
+ row->trx_query_cs = innobase_get_charset(trx->mysql_thd);
+
if (row->trx_query == NULL) {
return(FALSE);
@@ -814,6 +846,7 @@ fill_locks_row(
row->lock_table_id = lock_get_table_id(lock);
row->hash_chain.value = row;
+ ut_ad(i_s_locks_row_validate(row));
return(TRUE);
}
@@ -834,6 +867,9 @@ fill_lock_waits_row(
relevant blocking lock
row in innodb_locks */
{
+ ut_ad(i_s_locks_row_validate(requested_lock_row));
+ ut_ad(i_s_locks_row_validate(blocking_lock_row));
+
row->requested_lock_row = requested_lock_row;
row->blocking_lock_row = blocking_lock_row;
@@ -905,6 +941,7 @@ locks_row_eq_lock(
or ULINT_UNDEFINED if the lock
is a table lock */
{
+ ut_ad(i_s_locks_row_validate(row));
#ifdef TEST_NO_LOCKS_ROW_IS_EVER_EQUAL_TO_LOCK_T
return(0);
#else
@@ -962,7 +999,7 @@ search_innodb_locks(
/* auxiliary variable */
hash_chain,
/* assertion on every traversed item */
- ,
+ ut_ad(i_s_locks_row_validate(hash_chain->value)),
/* this determines if we have found the lock */
locks_row_eq_lock(hash_chain->value, lock, heap_no));
@@ -1002,6 +1039,7 @@ add_lock_to_cache(
dst_row = search_innodb_locks(cache, lock, heap_no);
if (dst_row != NULL) {
+ ut_ad(i_s_locks_row_validate(dst_row));
return(dst_row);
}
#endif
@@ -1039,6 +1077,7 @@ add_lock_to_cache(
} /* for()-loop */
#endif
+ ut_ad(i_s_locks_row_validate(dst_row));
return(dst_row);
}
diff --git a/storage/innobase/trx/trx0purge.c b/storage/innobase/trx/trx0purge.c
index 4c787579a03..02ec9f1c072 100644
--- a/storage/innobase/trx/trx0purge.c
+++ b/storage/innobase/trx/trx0purge.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Innobase Oy. All Rights Reserved.
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
@@ -57,8 +57,8 @@ UNIV_INTERN mysql_pfs_key_t trx_purge_latch_key;
#endif /* UNIV_PFS_RWLOCK */
#ifdef UNIV_PFS_MUTEX
-/* Key to register purge_sys_mutex with performance schema */
-UNIV_INTERN mysql_pfs_key_t purge_sys_mutex_key;
+/* Key to register purge_sys_bh_mutex with performance schema */
+UNIV_INTERN mysql_pfs_key_t purge_sys_bh_mutex_key;
#endif /* UNIV_PFS_MUTEX */
/*****************************************************************//**
@@ -219,13 +219,16 @@ Creates the global purge system control structure and inits the history
mutex. */
UNIV_INTERN
void
-trx_purge_sys_create(void)
-/*======================*/
+trx_purge_sys_create(
+/*=================*/
+ ib_bh_t* ib_bh) /*!< in, own: UNDO log min binary heap */
{
ut_ad(mutex_own(&kernel_mutex));
- purge_sys = mem_alloc(sizeof(trx_purge_t));
+ purge_sys = mem_zalloc(sizeof(trx_purge_t));
+ /* Take ownership of ib_bh, we are responsible for freeing it. */
+ purge_sys->ib_bh = ib_bh;
purge_sys->state = TRX_STOP_PURGE;
purge_sys->n_pages_handled = 0;
@@ -237,8 +240,9 @@ trx_purge_sys_create(void)
rw_lock_create(trx_purge_latch_key,
&purge_sys->latch, SYNC_PURGE_LATCH);
- mutex_create(purge_sys_mutex_key,
- &purge_sys->mutex, SYNC_PURGE_SYS);
+ mutex_create(
+ purge_sys_bh_mutex_key, &purge_sys->bh_mutex,
+ SYNC_PURGE_QUEUE);
purge_sys->heap = mem_heap_create(256);
@@ -288,9 +292,12 @@ trx_purge_sys_close(void)
trx_undo_arr_free(purge_sys->arr);
rw_lock_free(&purge_sys->latch);
- mutex_free(&purge_sys->mutex);
+ mutex_free(&purge_sys->bh_mutex);
mem_heap_free(purge_sys->heap);
+
+ ib_bh_free(purge_sys->ib_bh);
+
mem_free(purge_sys);
purge_sys = NULL;
@@ -311,34 +318,31 @@ trx_purge_add_update_undo_to_history(
mtr_t* mtr) /*!< in: mtr */
{
trx_undo_t* undo;
- trx_rseg_t* rseg;
trx_rsegf_t* rseg_header;
-#ifdef UNIV_DEBUG
- trx_usegf_t* seg_header;
-#endif /* UNIV_DEBUG */
trx_ulogf_t* undo_header;
- ulint hist_size;
undo = trx->update_undo;
ut_ad(undo);
- rseg = undo->rseg;
+ ut_ad(mutex_own(&undo->rseg->mutex));
- ut_ad(mutex_own(&(rseg->mutex)));
-
- rseg_header = trx_rsegf_get(rseg->space, rseg->zip_size,
- rseg->page_no, mtr);
+ rseg_header = trx_rsegf_get(
+ undo->rseg->space, undo->rseg->zip_size, undo->rseg->page_no,
+ mtr);
undo_header = undo_page + undo->hdr_offset;
+ /* Add the log as the first in the history list */
+
+ if (undo->state != TRX_UNDO_CACHED) {
+ ulint hist_size;
#ifdef UNIV_DEBUG
- seg_header = undo_page + TRX_UNDO_SEG_HDR;
+ trx_usegf_t* seg_header = undo_page + TRX_UNDO_SEG_HDR;
#endif /* UNIV_DEBUG */
- if (undo->state != TRX_UNDO_CACHED) {
/* The undo log segment will not be reused */
- if (undo->id >= TRX_RSEG_N_SLOTS) {
+ if (UNIV_UNLIKELY(undo->id >= TRX_RSEG_N_SLOTS)) {
fprintf(stderr,
"InnoDB: Error: undo->id is %lu\n",
(ulong) undo->id);
@@ -347,42 +351,50 @@ trx_purge_add_update_undo_to_history(
trx_rsegf_set_nth_undo(rseg_header, undo->id, FIL_NULL, mtr);
- hist_size = mtr_read_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE,
- MLOG_4BYTES, mtr);
+ hist_size = mtr_read_ulint(
+ rseg_header + TRX_RSEG_HISTORY_SIZE, MLOG_4BYTES, mtr);
+
ut_ad(undo->size == flst_get_len(
seg_header + TRX_UNDO_PAGE_LIST, mtr));
- mlog_write_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE,
- hist_size + undo->size, MLOG_4BYTES, mtr);
+ mlog_write_ulint(
+ rseg_header + TRX_RSEG_HISTORY_SIZE,
+ hist_size + undo->size, MLOG_4BYTES, mtr);
}
- /* Add the log as the first in the history list */
- flst_add_first(rseg_header + TRX_RSEG_HISTORY,
- undo_header + TRX_UNDO_HISTORY_NODE, mtr);
- mutex_enter(&kernel_mutex);
- trx_sys->rseg_history_len++;
- mutex_exit(&kernel_mutex);
-
- if (!(trx_sys->rseg_history_len % srv_purge_batch_size)) {
- /* Inform the purge thread that there is work to do. */
- srv_wake_purge_thread_if_not_active();
- }
+ flst_add_first(
+ rseg_header + TRX_RSEG_HISTORY,
+ undo_header + TRX_UNDO_HISTORY_NODE, mtr);
/* Write the trx number to the undo log header */
+
mlog_write_ull(undo_header + TRX_UNDO_TRX_NO, trx->no, mtr);
+
/* Write information about delete markings to the undo log header */
if (!undo->del_marks) {
- mlog_write_ulint(undo_header + TRX_UNDO_DEL_MARKS, FALSE,
- MLOG_2BYTES, mtr);
+ mlog_write_ulint(
+ undo_header + TRX_UNDO_DEL_MARKS, FALSE,
+ MLOG_2BYTES, mtr);
}
- if (rseg->last_page_no == FIL_NULL) {
+ if (undo->rseg->last_page_no == FIL_NULL) {
+ undo->rseg->last_trx_no = trx->no;
+ undo->rseg->last_offset = undo->hdr_offset;
+ undo->rseg->last_page_no = undo->hdr_page_no;
+ undo->rseg->last_del_marks = undo->del_marks;
- rseg->last_page_no = undo->hdr_page_no;
- rseg->last_offset = undo->hdr_offset;
- rseg->last_trx_no = trx->no;
- rseg->last_del_marks = undo->del_marks;
+ /* FIXME: Add a bin heap validate function to check that
+ the rseg exists. */
+ }
+
+ mutex_enter(&kernel_mutex);
+ trx_sys->rseg_history_len++;
+ mutex_exit(&kernel_mutex);
+
+ if (!(trx_sys->rseg_history_len % srv_purge_batch_size)) {
+ /* Inform the purge thread that there is work to do. */
+ srv_wake_purge_thread_if_not_active();
}
}
@@ -411,7 +423,6 @@ trx_purge_free_segment(
/* fputs("Freeing an update undo log segment\n", stderr); */
- ut_ad(mutex_own(&(purge_sys->mutex)));
loop:
mtr_start(&mtr);
mutex_enter(&(rseg->mutex));
@@ -515,8 +526,6 @@ trx_purge_truncate_rseg_history(
mtr_t mtr;
trx_id_t undo_trx_no;
- ut_ad(mutex_own(&(purge_sys->mutex)));
-
mtr_start(&mtr);
mutex_enter(&(rseg->mutex));
@@ -609,10 +618,8 @@ trx_purge_truncate_history(void)
trx_id_t limit_trx_no;
undo_no_t limit_undo_no;
- ut_ad(mutex_own(&(purge_sys->mutex)));
-
- trx_purge_arr_get_biggest(purge_sys->arr, &limit_trx_no,
- &limit_undo_no);
+ trx_purge_arr_get_biggest(
+ purge_sys->arr, &limit_trx_no, &limit_undo_no);
if (limit_trx_no == 0) {
@@ -630,34 +637,29 @@ trx_purge_truncate_history(void)
ut_ad(limit_trx_no <= purge_sys->view->low_limit_no);
- rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);
+ for (rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);
+ rseg != NULL;
+ rseg = UT_LIST_GET_NEXT(rseg_list, rseg)) {
- while (rseg) {
- trx_purge_truncate_rseg_history(rseg, limit_trx_no,
- limit_undo_no);
- rseg = UT_LIST_GET_NEXT(rseg_list, rseg);
+ trx_purge_truncate_rseg_history(
+ rseg, limit_trx_no, limit_undo_no);
}
}
/********************************************************************//**
Does a truncate if the purge array is empty. NOTE that when this function is
-called, the caller must not have any latches on undo log pages!
-@return TRUE if array empty */
+called, the caller must not have any latches on undo log pages! */
UNIV_INLINE
-ibool
+void
trx_purge_truncate_if_arr_empty(void)
/*=================================*/
{
- ut_ad(mutex_own(&(purge_sys->mutex)));
+ static ulint count;
- if (purge_sys->arr->n_used == 0) {
+ if (!(++count % TRX_SYS_N_RSEGS) && purge_sys->arr->n_used == 0) {
trx_purge_truncate_history();
-
- return(TRUE);
}
-
- return(FALSE);
}
/***********************************************************************//**
@@ -675,8 +677,8 @@ trx_purge_rseg_get_next_history_log(
trx_id_t trx_no;
ibool del_marks;
mtr_t mtr;
-
- ut_ad(mutex_own(&(purge_sys->mutex)));
+ rseg_queue_t rseg_queue;
+ const void* ptr;
mutex_enter(&(rseg->mutex));
@@ -688,8 +690,9 @@ trx_purge_rseg_get_next_history_log(
mtr_start(&mtr);
- undo_page = trx_undo_page_get_s_latched(rseg->space, rseg->zip_size,
- rseg->last_page_no, &mtr);
+ undo_page = trx_undo_page_get_s_latched(
+ rseg->space, rseg->zip_size, rseg->last_page_no, &mtr);
+
log_hdr = undo_page + rseg->last_offset;
/* Increase the purge page count by one for every handled log */
@@ -698,6 +701,7 @@ trx_purge_rseg_get_next_history_log(
prev_log_addr = trx_purge_get_log_from_hist(
flst_get_prev_addr(log_hdr + TRX_UNDO_HISTORY_NODE, &mtr));
+
if (prev_log_addr.page == FIL_NULL) {
/* No logs left in the history list */
@@ -712,11 +716,11 @@ trx_purge_rseg_get_next_history_log(
on the MySQL mailing list on Nov 9, 2004. The fut0lst.c
file-based list was corrupt. The prev node pointer was
FIL_NULL, even though the list length was over 8 million nodes!
- We assume that purge truncates the history list in moderate
+ We assume that purge truncates the history list in large
size pieces, and if we here reach the head of the list, the
- list cannot be longer than 20 000 undo logs now. */
+ list cannot be longer than 2000 000 undo logs now. */
- if (trx_sys->rseg_history_len > 20000) {
+ if (trx_sys->rseg_history_len > 2000000) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Warning: purge reached the"
@@ -756,105 +760,150 @@ trx_purge_rseg_get_next_history_log(
rseg->last_trx_no = trx_no;
rseg->last_del_marks = del_marks;
+ rseg_queue.rseg = rseg;
+ rseg_queue.trx_no = rseg->last_trx_no;
+
+ /* Purge can also produce events, however these are already ordered
+ in the rollback segment and any user generated event will be greater
+ than the events that Purge produces. ie. Purge can never produce
+ events from an empty rollback segment. */
+
+ mutex_enter(&purge_sys->bh_mutex);
+
+ ptr = ib_bh_push(purge_sys->ib_bh, &rseg_queue);
+ ut_a(ptr != NULL);
+
+ mutex_exit(&purge_sys->bh_mutex);
+
mutex_exit(&(rseg->mutex));
}
/***********************************************************************//**
-Chooses the next undo log to purge and updates the info in purge_sys. This
-function is used to initialize purge_sys when the next record to purge is
-not known, and also to update the purge system info on the next record when
-purge has handled the whole undo log for a transaction. */
+Chooses the rollback segment with the smallest trx_id.
+@return zip_size if log is for a compressed table, ULINT_UNDEFINED if
+ no rollback segments to purge, 0 for non compressed tables. */
static
-void
-trx_purge_choose_next_log(void)
-/*===========================*/
+ulint
+trx_purge_get_rseg_with_min_trx_id(
+/*===============================*/
+ trx_purge_t* purge_sys) /*!< in/out: purge instance */
+
{
- trx_undo_rec_t* rec;
- trx_rseg_t* rseg;
- trx_rseg_t* min_rseg;
- trx_id_t min_trx_no;
- ulint space = 0; /* remove warning (??? bug ???) */
ulint zip_size = 0;
- ulint page_no = 0; /* remove warning (??? bug ???) */
- ulint offset = 0; /* remove warning (??? bug ???) */
- mtr_t mtr;
- ut_ad(mutex_own(&(purge_sys->mutex)));
- ut_ad(purge_sys->next_stored == FALSE);
+ mutex_enter(&purge_sys->bh_mutex);
- rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);
+ /* Only purge consumes events from the binary heap, user
+ threads only produce the events. */
- min_trx_no = IB_ULONGLONG_MAX;
+ if (!ib_bh_is_empty(purge_sys->ib_bh)) {
+ trx_rseg_t* rseg;
- min_rseg = NULL;
+ rseg = ((rseg_queue_t*) ib_bh_first(purge_sys->ib_bh))->rseg;
+ ib_bh_pop(purge_sys->ib_bh);
- while (rseg) {
- mutex_enter(&(rseg->mutex));
+ mutex_exit(&purge_sys->bh_mutex);
- if (rseg->last_page_no != FIL_NULL) {
+ purge_sys->rseg = rseg;
+ } else {
+ mutex_exit(&purge_sys->bh_mutex);
- if (min_rseg == NULL
- || min_trx_no > rseg->last_trx_no) {
+ purge_sys->rseg = NULL;
- min_rseg = rseg;
- min_trx_no = rseg->last_trx_no;
- space = rseg->space;
- zip_size = rseg->zip_size;
- ut_a(space == 0); /* We assume in purge of
- externally stored fields
- that space id == 0 */
- page_no = rseg->last_page_no;
- offset = rseg->last_offset;
- }
- }
+ return(ULINT_UNDEFINED);
+ }
- mutex_exit(&(rseg->mutex));
+ ut_a(purge_sys->rseg != NULL);
- rseg = UT_LIST_GET_NEXT(rseg_list, rseg);
- }
+ mutex_enter(&purge_sys->rseg->mutex);
- if (min_rseg == NULL) {
+ ut_a(purge_sys->rseg->last_page_no != FIL_NULL);
- return;
- }
+ /* We assume in purge of externally stored fields
+ that space id == 0 */
+ ut_a(purge_sys->rseg->space == 0);
- mtr_start(&mtr);
+ zip_size = purge_sys->rseg->zip_size;
- if (!min_rseg->last_del_marks) {
- /* No need to purge this log */
+ ut_a(purge_sys->purge_trx_no <= purge_sys->rseg->last_trx_no);
- rec = &trx_purge_dummy_rec;
- } else {
- rec = trx_undo_get_first_rec(space, zip_size, page_no, offset,
- RW_S_LATCH, &mtr);
- if (rec == NULL) {
- /* Undo log empty */
+ purge_sys->purge_trx_no = purge_sys->rseg->last_trx_no;
+
+ purge_sys->hdr_offset = purge_sys->rseg->last_offset;
+
+ purge_sys->hdr_page_no = purge_sys->rseg->last_page_no;
+
+ mutex_exit(&purge_sys->rseg->mutex);
+
+ return(zip_size);
+}
+
+/***********************************************************************//**
+Position the purge sys "iterator" on the undo record to use for purging. */
+static
+void
+trx_purge_read_undo_rec(
+/*====================*/
+ trx_purge_t* purge_sys, /*!< in/out: purge instance */
+ ulint zip_size) /*!< in: block size or 0 */
+{
+ ulint page_no;
+ ulint offset = 0;
+ ib_uint64_t undo_no = 0;
+
+ purge_sys->hdr_offset = purge_sys->rseg->last_offset;
+ page_no = purge_sys->hdr_page_no = purge_sys->rseg->last_page_no;
+
+ if (purge_sys->rseg->last_del_marks) {
+ mtr_t mtr;
+ trx_undo_rec_t* undo_rec;
- rec = &trx_purge_dummy_rec;
+ mtr_start(&mtr);
+
+ undo_rec = trx_undo_get_first_rec(
+ 0 /* System space id */, zip_size,
+ purge_sys->hdr_page_no,
+ purge_sys->hdr_offset, RW_S_LATCH, &mtr);
+
+ if (undo_rec != NULL) {
+ offset = page_offset(undo_rec);
+ undo_no = trx_undo_rec_get_undo_no(undo_rec);
+ page_no = page_get_page_no(page_align(undo_rec));
}
+
+ mtr_commit(&mtr);
}
+ purge_sys->offset = offset;
+ purge_sys->page_no = page_no;
+ purge_sys->purge_undo_no = undo_no;
+
purge_sys->next_stored = TRUE;
- purge_sys->rseg = min_rseg;
+}
- purge_sys->hdr_page_no = page_no;
- purge_sys->hdr_offset = offset;
+/***********************************************************************//**
+Chooses the next undo log to purge and updates the info in purge_sys. This
+function is used to initialize purge_sys when the next record to purge is
+not known, and also to update the purge system info on the next record when
+purge has handled the whole undo log for a transaction. */
+static
+void
+trx_purge_choose_next_log(void)
+/*===========================*/
+{
+ ulint zip_size;
- purge_sys->purge_trx_no = min_trx_no;
+ ut_ad(purge_sys->next_stored == FALSE);
- if (rec == &trx_purge_dummy_rec) {
+ zip_size = trx_purge_get_rseg_with_min_trx_id(purge_sys);
- purge_sys->purge_undo_no = 0;
- purge_sys->page_no = page_no;
- purge_sys->offset = 0;
- } else {
- purge_sys->purge_undo_no = trx_undo_rec_get_undo_no(rec);
+ if (purge_sys->rseg != NULL) {
- purge_sys->page_no = page_get_page_no(page_align(rec));
- purge_sys->offset = page_offset(rec);
+ trx_purge_read_undo_rec(purge_sys, zip_size);
+ } else {
+ /* There is nothing to do yet. */
+ os_thread_yield();
}
-
- mtr_commit(&mtr);
}
/***********************************************************************//**
@@ -880,7 +929,6 @@ trx_purge_get_next_rec(
ulint cmpl_info;
mtr_t mtr;
- ut_ad(mutex_own(&(purge_sys->mutex)));
ut_ad(purge_sys->next_stored);
space = purge_sys->rseg->space;
@@ -903,8 +951,8 @@ trx_purge_get_next_rec(
mtr_start(&mtr);
- undo_page = trx_undo_page_get_s_latched(space, zip_size,
- page_no, &mtr);
+ undo_page = trx_undo_page_get_s_latched(space, zip_size, page_no, &mtr);
+
rec = undo_page + offset;
rec2 = rec;
@@ -913,9 +961,9 @@ trx_purge_get_next_rec(
/* Try first to find the next record which requires a purge
operation from the same page of the same undo log */
- next_rec = trx_undo_page_get_next_rec(rec2,
- purge_sys->hdr_page_no,
- purge_sys->hdr_offset);
+ next_rec = trx_undo_page_get_next_rec(
+ rec2, purge_sys->hdr_page_no, purge_sys->hdr_offset);
+
if (next_rec == NULL) {
rec2 = trx_undo_get_next_rec(
rec2, purge_sys->hdr_page_no,
@@ -995,17 +1043,12 @@ trx_purge_fetch_next_rec(
{
trx_undo_rec_t* undo_rec;
- mutex_enter(&(purge_sys->mutex));
if (purge_sys->state == TRX_STOP_PURGE) {
trx_purge_truncate_if_arr_empty();
- mutex_exit(&(purge_sys->mutex));
-
return(NULL);
- }
-
- if (!purge_sys->next_stored) {
+ } else if (!purge_sys->next_stored) {
trx_purge_choose_next_log();
if (!purge_sys->next_stored) {
@@ -1020,8 +1063,6 @@ trx_purge_fetch_next_rec(
(ulong) purge_sys->n_pages_handled);
}
- mutex_exit(&(purge_sys->mutex));
-
return(NULL);
}
}
@@ -1032,18 +1073,12 @@ trx_purge_fetch_next_rec(
trx_purge_truncate_if_arr_empty();
- mutex_exit(&(purge_sys->mutex));
-
return(NULL);
- }
-
- if (purge_sys->purge_trx_no >= purge_sys->view->low_limit_no) {
+ } else if (purge_sys->purge_trx_no >= purge_sys->view->low_limit_no) {
purge_sys->state = TRX_STOP_PURGE;
trx_purge_truncate_if_arr_empty();
- mutex_exit(&(purge_sys->mutex));
-
return(NULL);
}
@@ -1052,12 +1087,13 @@ trx_purge_fetch_next_rec(
(ullint) purge_sys->purge_trx_no,
(ullint) purge_sys->purge_undo_no); */
- *roll_ptr = trx_undo_build_roll_ptr(FALSE, (purge_sys->rseg)->id,
- purge_sys->page_no,
- purge_sys->offset);
- *cell = trx_purge_arr_store_info(purge_sys->purge_trx_no,
- purge_sys->purge_undo_no);
+ *roll_ptr = trx_undo_build_roll_ptr(
+ FALSE, (purge_sys->rseg)->id, purge_sys->page_no,
+ purge_sys->offset);
+
+ *cell = trx_purge_arr_store_info(
+ purge_sys->purge_trx_no, purge_sys->purge_undo_no);
ut_ad(purge_sys->purge_trx_no < purge_sys->view->low_limit_no);
@@ -1066,8 +1102,6 @@ trx_purge_fetch_next_rec(
undo_rec = trx_purge_get_next_rec(heap);
- mutex_exit(&(purge_sys->mutex));
-
return(undo_rec);
}
@@ -1079,11 +1113,7 @@ trx_purge_rec_release(
/*==================*/
trx_undo_inf_t* cell) /*!< in: storage cell */
{
- mutex_enter(&(purge_sys->mutex));
-
trx_purge_arr_remove_info(cell);
-
- mutex_exit(&(purge_sys->mutex));
}
/*******************************************************************//**
@@ -1097,23 +1127,11 @@ trx_purge(
purge in one batch */
{
que_thr_t* thr;
- /* que_thr_t* thr2; */
ulint old_pages_handled;
- mutex_enter(&(purge_sys->mutex));
-
- if (purge_sys->trx->n_active_thrs > 0) {
+ ut_a(purge_sys->trx->n_active_thrs == 0);
- mutex_exit(&(purge_sys->mutex));
-
- /* Should not happen */
-
- ut_error;
-
- return(0);
- }
-
- rw_lock_x_lock(&(purge_sys->latch));
+ rw_lock_x_lock(&purge_sys->latch);
mutex_enter(&kernel_mutex);
@@ -1147,8 +1165,9 @@ trx_purge(
}
}
- purge_sys->view = read_view_oldest_copy_or_open_new(0,
- purge_sys->heap);
+ purge_sys->view = read_view_oldest_copy_or_open_new(
+ 0, purge_sys->heap);
+
mutex_exit(&kernel_mutex);
rw_lock_x_unlock(&(purge_sys->latch));
@@ -1159,7 +1178,6 @@ trx_purge(
old_pages_handled = purge_sys->n_pages_handled;
- mutex_exit(&(purge_sys->mutex));
mutex_enter(&kernel_mutex);
@@ -1167,15 +1185,8 @@ trx_purge(
ut_ad(thr);
- /* thr2 = que_fork_start_command(purge_sys->query);
-
- ut_ad(thr2); */
-
-
mutex_exit(&kernel_mutex);
- /* srv_que_task_enqueue(thr2); */
-
if (srv_print_thread_releases) {
fputs("Starting purge\n", stderr);
diff --git a/storage/innobase/trx/trx0rec.c b/storage/innobase/trx/trx0rec.c
index e7e9a008db4..70b77ace726 100644
--- a/storage/innobase/trx/trx0rec.c
+++ b/storage/innobase/trx/trx0rec.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
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
@@ -351,10 +351,10 @@ trx_undo_rec_get_col_val(
ut_ad(*orig_len >= BTR_EXTERN_FIELD_REF_SIZE);
ut_ad(*len > *orig_len);
/* @see dtuple_convert_big_rec() */
- ut_ad(*len >= BTR_EXTERN_FIELD_REF_SIZE * 2);
+ ut_ad(*len >= BTR_EXTERN_FIELD_REF_SIZE);
/* we do not have access to index->table here
ut_ad(dict_table_get_format(index->table) >= DICT_TF_FORMAT_ZIP
- || *len >= REC_MAX_INDEX_COL_LEN
+ || *len >= col->max_prefix
+ BTR_EXTERN_FIELD_REF_SIZE);
*/
@@ -456,9 +456,10 @@ static
byte*
trx_undo_page_fetch_ext(
/*====================*/
- byte* ext_buf, /*!< in: a buffer of
- REC_MAX_INDEX_COL_LEN
- + BTR_EXTERN_FIELD_REF_SIZE */
+ byte* ext_buf, /*!< in: buffer to hold the prefix
+ data and BLOB pointer */
+ ulint prefix_len, /*!< in: prefix size to store
+ in the undo log */
ulint zip_size, /*!< compressed page size in bytes,
or 0 for uncompressed BLOB */
const byte* field, /*!< in: an externally stored column */
@@ -467,7 +468,7 @@ trx_undo_page_fetch_ext(
{
/* Fetch the BLOB. */
ulint ext_len = btr_copy_externally_stored_field_prefix(
- ext_buf, REC_MAX_INDEX_COL_LEN, zip_size, field, *len);
+ ext_buf, prefix_len, zip_size, field, *len);
/* BLOBs should always be nonempty. */
ut_a(ext_len);
/* Append the BLOB pointer to the prefix. */
@@ -488,10 +489,11 @@ trx_undo_page_report_modify_ext(
byte* ptr, /*!< in: undo log position,
at least 15 bytes must be available */
byte* ext_buf, /*!< in: a buffer of
- REC_MAX_INDEX_COL_LEN
- + BTR_EXTERN_FIELD_REF_SIZE,
+ DICT_MAX_FIELD_LEN_BY_FORMAT() size,
or NULL when should not fetch
a longer prefix */
+ ulint prefix_len, /*!< prefix size to store in the
+ undo log */
ulint zip_size, /*!< compressed page size in bytes,
or 0 for uncompressed BLOB */
const byte** field, /*!< in/out: the locally stored part of
@@ -499,6 +501,8 @@ trx_undo_page_report_modify_ext(
ulint* len) /*!< in/out: length of field, in bytes */
{
if (ext_buf) {
+ ut_a(prefix_len > 0);
+
/* If an ordering column is externally stored, we will
have to store a longer prefix of the field. In this
case, write to the log a marker followed by the
@@ -507,7 +511,7 @@ trx_undo_page_report_modify_ext(
ptr += mach_write_compressed(ptr, *len);
- *field = trx_undo_page_fetch_ext(ext_buf, zip_size,
+ *field = trx_undo_page_fetch_ext(ext_buf, prefix_len, zip_size,
*field, len);
ptr += mach_write_compressed(ptr, *len);
@@ -553,7 +557,7 @@ trx_undo_page_report_modify(
ulint i;
trx_id_t trx_id;
ibool ignore_prefix = FALSE;
- byte ext_buf[REC_MAX_INDEX_COL_LEN
+ byte ext_buf[REC_VERSION_56_MAX_INDEX_COL_LEN
+ BTR_EXTERN_FIELD_REF_SIZE];
ut_a(dict_index_is_clust(index));
@@ -665,6 +669,7 @@ trx_undo_page_report_modify(
/* Save to the undo log the old values of the columns to be updated. */
if (update) {
+
if (trx_undo_left(undo_page, ptr) < 5) {
return(0);
@@ -693,13 +698,21 @@ trx_undo_page_report_modify(
}
if (rec_offs_nth_extern(offsets, pos)) {
+ const dict_col_t* col
+ = dict_index_get_nth_col(index, pos);
+ ulint prefix_len
+ = dict_max_field_len_store_undo(
+ table, col);
+
+ ut_ad(prefix_len + BTR_EXTERN_FIELD_REF_SIZE
+ <= sizeof ext_buf);
+
ptr = trx_undo_page_report_modify_ext(
ptr,
- dict_index_get_nth_col(index, pos)
- ->ord_part
+ col->ord_part
&& !ignore_prefix
- && flen < REC_MAX_INDEX_COL_LEN
- ? ext_buf : NULL,
+ && flen < REC_ANTELOPE_MAX_INDEX_COL_LEN
+ ? ext_buf : NULL, prefix_len,
dict_table_zip_size(table),
&field, &flen);
@@ -778,11 +791,20 @@ trx_undo_page_report_modify(
&flen);
if (rec_offs_nth_extern(offsets, pos)) {
+ const dict_col_t* col =
+ dict_index_get_nth_col(
+ index, pos);
+ ulint prefix_len =
+ dict_max_field_len_store_undo(
+ table, col);
+
+ ut_a(prefix_len < sizeof ext_buf);
+
ptr = trx_undo_page_report_modify_ext(
ptr,
- flen < REC_MAX_INDEX_COL_LEN
+ flen < REC_ANTELOPE_MAX_INDEX_COL_LEN
&& !ignore_prefix
- ? ext_buf : NULL,
+ ? ext_buf : NULL, prefix_len,
dict_table_zip_size(table),
&field, &flen);
} else {
@@ -1082,11 +1104,11 @@ trx_undo_rec_get_partial_row(
undo log record. */
if (!ignore_prefix && col->ord_part) {
ut_a(dfield_get_len(dfield)
- >= 2 * BTR_EXTERN_FIELD_REF_SIZE);
+ >= BTR_EXTERN_FIELD_REF_SIZE);
ut_a(dict_table_get_format(index->table)
>= DICT_TF_FORMAT_ZIP
|| dfield_get_len(dfield)
- >= REC_MAX_INDEX_COL_LEN
+ >= REC_ANTELOPE_MAX_INDEX_COL_LEN
+ BTR_EXTERN_FIELD_REF_SIZE);
}
}
@@ -1571,6 +1593,10 @@ trx_undo_prev_version_build(
return(DB_ERROR);
}
+# ifdef UNIV_BLOB_NULL_DEBUG
+ ut_a(!rec_offs_any_null_extern(rec, offsets));
+# endif /* UNIV_BLOB_NULL_DEBUG */
+
if (row_upd_changes_field_size_or_external(index, offsets, update)) {
ulint n_ext;
diff --git a/storage/innobase/trx/trx0roll.c b/storage/innobase/trx/trx0roll.c
index 876a00fb935..b55471959ce 100644
--- a/storage/innobase/trx/trx0roll.c
+++ b/storage/innobase/trx/trx0roll.c
@@ -47,8 +47,8 @@ Created 3/26/1996 Heikki Tuuri
rollback */
#define TRX_ROLL_TRUNC_THRESHOLD 1
-/** In crash recovery, the current trx to be rolled back */
-static trx_t* trx_roll_crash_recv_trx = NULL;
+/** In crash recovery, the current trx to be rolled back; NULL otherwise */
+static const trx_t* trx_roll_crash_recv_trx = NULL;
/** In crash recovery we set this to the undo n:o of the current trx to be
rolled back. Then we can print how many % the rollback has progressed. */
@@ -460,10 +460,6 @@ trx_rollback_active(
(ulong) rows_to_undo, unit);
mutex_exit(&kernel_mutex);
- trx->mysql_thread_id = os_thread_get_curr_id();
-
- trx->mysql_process_no = os_proc_get_number();
-
if (trx_get_dict_operation(trx) != TRX_DICT_OP_NONE) {
row_mysql_lock_data_dictionary(trx);
dictionary_locked = TRUE;
diff --git a/storage/innobase/trx/trx0rseg.c b/storage/innobase/trx/trx0rseg.c
index 740320f68c1..85beac8afbc 100644
--- a/storage/innobase/trx/trx0rseg.c
+++ b/storage/innobase/trx/trx0rseg.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle Corpn. All Rights Reserved.
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
@@ -50,11 +50,11 @@ trx_rseg_get_on_id(
{
trx_rseg_t* rseg;
- rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);
+ ut_a(id < TRX_SYS_N_RSEGS);
- while (rseg && rseg->id != id) {
- rseg = UT_LIST_GET_NEXT(rseg_list, rseg);
- }
+ rseg = trx_sys->rseg_array[id];
+
+ ut_a(rseg == NULL || id == rseg->id);
return(rseg);
}
@@ -181,12 +181,15 @@ static
trx_rseg_t*
trx_rseg_mem_create(
/*================*/
- ulint id, /*!< in: rollback segment id */
- ulint space, /*!< in: space where the segment placed */
- ulint zip_size, /*!< in: compressed page size in bytes
- or 0 for uncompressed pages */
- ulint page_no, /*!< in: page number of the segment header */
- mtr_t* mtr) /*!< in: mtr */
+ ulint id, /*!< in: rollback segment id */
+ ulint space, /*!< in: space where the segment
+ placed */
+ ulint zip_size, /*!< in: compressed page size in bytes
+ or 0 for uncompressed pages */
+ ulint page_no, /*!< in: page number of the segment
+ header */
+ ib_bh_t* ib_bh, /*!< in/out: rseg queue */
+ mtr_t* mtr) /*!< in: mtr */
{
ulint len;
trx_rseg_t* rseg;
@@ -225,6 +228,9 @@ trx_rseg_mem_create(
len = flst_get_len(rseg_header + TRX_RSEG_HISTORY, mtr);
if (len > 0) {
+ const void* ptr;
+ rseg_queue_t rseg_queue;
+
trx_sys->rseg_history_len += len;
node_addr = trx_purge_get_log_from_hist(
@@ -240,6 +246,17 @@ trx_rseg_mem_create(
undo_log_hdr + TRX_UNDO_TRX_NO);
rseg->last_del_marks = mtr_read_ulint(
undo_log_hdr + TRX_UNDO_DEL_MARKS, MLOG_2BYTES, mtr);
+
+ rseg_queue.rseg = rseg;
+ rseg_queue.trx_no = rseg->last_trx_no;
+
+ if (rseg->last_page_no != FIL_NULL) {
+ /* There is no need to cover this operation by the purge
+ mutex because we are still bootstrapping. */
+
+ ptr = ib_bh_push(ib_bh, &rseg_queue);
+ ut_a(ptr != NULL);
+ }
} else {
rseg->last_page_no = FIL_NULL;
}
@@ -255,6 +272,7 @@ void
trx_rseg_create_instance(
/*=====================*/
trx_sysf_t* sys_header, /*!< in: trx system header */
+ ib_bh_t* ib_bh, /*!< in/out: rseg queue */
mtr_t* mtr) /*!< in: mtr */
{
ulint i;
@@ -278,7 +296,7 @@ trx_rseg_create_instance(
zip_size = space ? fil_space_get_zip_size(space) : 0;
rseg = trx_rseg_mem_create(
- i, space, zip_size, page_no, mtr);
+ i, space, zip_size, page_no, ib_bh, mtr);
ut_a(rseg->id == i);
}
@@ -327,7 +345,8 @@ trx_rseg_create(void)
zip_size = space ? fil_space_get_zip_size(space) : 0;
rseg = trx_rseg_mem_create(
- slot_no, space, zip_size, page_no, &mtr);
+ slot_no, space, zip_size, page_no,
+ purge_sys->ib_bh, &mtr);
}
mutex_exit(&kernel_mutex);
@@ -342,13 +361,14 @@ UNIV_INTERN
void
trx_rseg_list_and_array_init(
/*=========================*/
- trx_sysf_t* sys_header, /* in: trx system header */
- mtr_t* mtr) /* in: mtr */
+ trx_sysf_t* sys_header, /*!< in: trx system header */
+ ib_bh_t* ib_bh, /*!< in: rseg queue */
+ mtr_t* mtr) /*!< in: mtr */
{
UT_LIST_INIT(trx_sys->rseg_list);
trx_sys->rseg_history_len = 0;
- trx_rseg_create_instance(sys_header, mtr);
+ trx_rseg_create_instance(sys_header, ib_bh, mtr);
}
diff --git a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
index 26498a1b712..8e595353024 100644
--- a/storage/innobase/trx/trx0sys.c
+++ b/storage/innobase/trx/trx0sys.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Innobase Oy. All Rights Reserved.
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
@@ -37,6 +37,7 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0rseg.h"
#include "trx0undo.h"
#include "srv0srv.h"
+#include "srv0start.h"
#include "trx0purge.h"
#include "log0log.h"
#include "log0recv.h"
@@ -946,6 +947,31 @@ trx_sysf_create(
}
/*****************************************************************//**
+Compare two trx_rseg_t instances on last_trx_no. */
+static
+int
+trx_rseg_compare_last_trx_no(
+/*=========================*/
+ const void* p1, /*!< in: elem to compare */
+ const void* p2) /*!< in: elem to compare */
+{
+ ib_int64_t cmp;
+
+ const rseg_queue_t* rseg_q1 = (const rseg_queue_t*) p1;
+ const rseg_queue_t* rseg_q2 = (const rseg_queue_t*) p2;
+
+ cmp = rseg_q1->trx_no - rseg_q2->trx_no;
+
+ if (cmp < 0) {
+ return(-1);
+ } else if (cmp > 0) {
+ return(1);
+ }
+
+ return(0);
+}
+
+/*****************************************************************//**
Creates and initializes the central memory structures for the transaction
system. This is called when the database is started. */
UNIV_INTERN
@@ -958,6 +984,7 @@ trx_sys_init_at_db_start(void)
const char* unit = "";
trx_t* trx;
mtr_t mtr;
+ ib_bh_t* ib_bh;
mtr_start(&mtr);
@@ -965,11 +992,19 @@ trx_sys_init_at_db_start(void)
mutex_enter(&kernel_mutex);
- trx_sys = mem_alloc(sizeof(trx_sys_t));
+ /* We create the min binary heap here and pass ownership to
+ purge when we init the purge sub-system. Purge is responsible
+ for freeing the binary heap. */
+
+ ib_bh = ib_bh_create(
+ trx_rseg_compare_last_trx_no,
+ sizeof(rseg_queue_t), TRX_SYS_N_RSEGS);
+
+ trx_sys = mem_zalloc(sizeof(*trx_sys));
sys_header = trx_sysf_get(&mtr);
- trx_rseg_list_and_array_init(sys_header, &mtr);
+ trx_rseg_list_and_array_init(sys_header, ib_bh, &mtr);
trx_sys->latest_rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);
@@ -1023,7 +1058,8 @@ trx_sys_init_at_db_start(void)
UT_LIST_INIT(trx_sys->view_list);
- trx_purge_sys_create();
+ /* Transfer ownership to purge. */
+ trx_purge_sys_create(ib_bh);
mutex_exit(&kernel_mutex);
@@ -1160,7 +1196,7 @@ trx_sys_file_format_max_check(
ut_print_timestamp(stderr);
fprintf(stderr,
- " InnoDB: highest supported file format is %s.\n",
+ " InnoDB: highest supported file format is %s.\n",
trx_sys_file_format_id_to_name(DICT_TF_FORMAT_MAX));
if (format_id > DICT_TF_FORMAT_MAX) {
@@ -1169,7 +1205,7 @@ trx_sys_file_format_max_check(
ut_print_timestamp(stderr);
fprintf(stderr,
- " InnoDB: %s: the system tablespace is in a file "
+ " InnoDB: %s: the system tablespace is in a file "
"format that this version doesn't support - %s\n",
((max_format_id <= DICT_TF_FORMAT_MAX)
? "Error" : "Warning"),
@@ -1582,10 +1618,12 @@ void
trx_sys_close(void)
/*===============*/
{
+ trx_t* trx;
trx_rseg_t* rseg;
read_view_t* view;
ut_ad(trx_sys != NULL);
+ ut_ad(srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS);
/* Check that all read views are closed except read view owned
by a purge. */
@@ -1617,6 +1655,13 @@ trx_sys_close(void)
mem_free(trx_doublewrite);
trx_doublewrite = NULL;
+ /* Only prepared transactions may be left in the system. Free them. */
+ ut_a(UT_LIST_GET_LEN(trx_sys->trx_list) == trx_n_prepared);
+
+ while ((trx = UT_LIST_GET_FIRST(trx_sys->trx_list)) != NULL) {
+ trx_free_prepared(trx);
+ }
+
/* There can't be any active transactions. */
rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);
diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
index 6ef47a8dc16..7b99b86c732 100644
--- a/storage/innobase/trx/trx0trx.c
+++ b/storage/innobase/trx/trx0trx.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Innobase Oy. All Rights Reserved.
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
@@ -38,10 +38,10 @@ Created 3/26/1996 Heikki Tuuri
#include "usr0sess.h"
#include "read0read.h"
#include "srv0srv.h"
-#include "thr0loc.h"
#include "btr0sea.h"
#include "os0proc.h"
#include "trx0xa.h"
+#include "trx0purge.h"
#include "ha_prototypes.h"
/** Dummy session used currently in MySQL interface */
@@ -50,6 +50,9 @@ UNIV_INTERN sess_t* trx_dummy_sess = NULL;
/** Number of transactions currently allocated for MySQL: protected by
the kernel mutex */
UNIV_INTERN ulint trx_n_mysql_transactions = 0;
+/** Number of transactions currently in the XA PREPARED state: protected by
+the kernel mutex */
+UNIV_INTERN ulint trx_n_prepared = 0;
#ifdef UNIV_PFS_MUTEX
/* Key to register the mutex with performance schema */
@@ -105,7 +108,11 @@ trx_create(
trx->is_purge = 0;
trx->is_recovered = 0;
trx->conc_state = TRX_NOT_STARTED;
- trx->start_time = time(NULL);
+
+ trx->is_registered = 0;
+ trx->owns_prepare_mutex = 0;
+
+ trx->start_time = ut_time();
trx->isolation_level = TRX_ISO_REPEATABLE_READ;
@@ -124,7 +131,6 @@ trx_create(
trx->table_id = 0;
trx->mysql_thd = NULL;
- trx->active_trans = 0;
trx->duplicates = 0;
trx->n_mysql_tables_in_use = 0;
@@ -211,10 +217,6 @@ trx_allocate_for_mysql(void)
mutex_exit(&kernel_mutex);
- trx->mysql_thread_id = os_thread_get_curr_id();
-
- trx->mysql_process_no = os_proc_get_number();
-
return(trx);
}
@@ -339,6 +341,60 @@ trx_free(
}
/********************************************************************//**
+At shutdown, frees a transaction object that is in the PREPARED state. */
+UNIV_INTERN
+void
+trx_free_prepared(
+/*==============*/
+ trx_t* trx) /*!< in, own: trx object */
+{
+ ut_ad(mutex_own(&kernel_mutex));
+ ut_a(trx->conc_state == TRX_PREPARED);
+ ut_a(trx->magic_n == TRX_MAGIC_N);
+
+ /* Prepared transactions are sort of active; they allow
+ ROLLBACK and COMMIT operations. Because the system does not
+ contain any other transactions than prepared transactions at
+ the shutdown stage and because a transaction cannot become
+ PREPARED while holding locks, it is safe to release the locks
+ held by PREPARED transactions here at shutdown.*/
+ lock_release_off_kernel(trx);
+
+ trx_undo_free_prepared(trx);
+
+ mutex_free(&trx->undo_mutex);
+
+ if (trx->undo_no_arr) {
+ trx_undo_arr_free(trx->undo_no_arr);
+ }
+
+ ut_a(UT_LIST_GET_LEN(trx->signals) == 0);
+ ut_a(UT_LIST_GET_LEN(trx->reply_signals) == 0);
+
+ ut_a(trx->wait_lock == NULL);
+ ut_a(UT_LIST_GET_LEN(trx->wait_thrs) == 0);
+
+ ut_a(!trx->has_search_latch);
+
+ ut_a(trx->dict_operation_lock_mode == 0);
+
+ if (trx->lock_heap) {
+ mem_heap_free(trx->lock_heap);
+ }
+
+ if (trx->global_read_view_heap) {
+ mem_heap_free(trx->global_read_view_heap);
+ }
+
+ ut_a(ib_vector_is_empty(trx->autoinc_locks));
+ ib_vector_free(trx->autoinc_locks);
+
+ UT_LIST_REMOVE(trx_list, trx_sys->trx_list, trx);
+
+ mem_free(trx);
+}
+
+/********************************************************************//**
Frees a transaction object for MySQL. */
UNIV_INTERN
void
@@ -468,6 +524,7 @@ trx_lists_init_at_db_start(void)
if (srv_force_recovery == 0) {
trx->conc_state = TRX_PREPARED;
+ trx_n_prepared++;
} else {
fprintf(stderr,
"InnoDB: Since"
@@ -544,6 +601,7 @@ trx_lists_init_at_db_start(void)
trx->conc_state
= TRX_PREPARED;
+ trx_n_prepared++;
} else {
fprintf(stderr,
"InnoDB: Since"
@@ -601,36 +659,26 @@ trx_lists_init_at_db_start(void)
/******************************************************************//**
Assigns a rollback segment to a transaction in a round-robin fashion.
-Skips the SYSTEM rollback segment if another is available.
-@return assigned rollback segment id */
+@return assigned rollback segment instance */
UNIV_INLINE
-ulint
-trx_assign_rseg(void)
-/*=================*/
+trx_rseg_t*
+trx_assign_rseg(
+/*============*/
+ ulint max_undo_logs) /*!< in: maximum number of UNDO logs to use */
{
- trx_rseg_t* rseg = trx_sys->latest_rseg;
+ trx_rseg_t* rseg = trx_sys->latest_rseg;
ut_ad(mutex_own(&kernel_mutex));
-loop:
- /* Get next rseg in a round-robin fashion */
rseg = UT_LIST_GET_NEXT(rseg_list, rseg);
- if (rseg == NULL) {
+ if (rseg == NULL || rseg->id == max_undo_logs - 1) {
rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);
}
- /* If it is the SYSTEM rollback segment, and there exist others, skip
- it */
-
- if ((rseg->id == TRX_SYS_SYSTEM_RSEG_ID)
- && (UT_LIST_GET_LEN(trx_sys->rseg_list) > 1)) {
- goto loop;
- }
-
trx_sys->latest_rseg = rseg;
- return(rseg->id);
+ return(rseg);
}
/****************************************************************//**
@@ -660,12 +708,9 @@ trx_start_low(
ut_ad(trx->conc_state != TRX_ACTIVE);
- if (rseg_id == ULINT_UNDEFINED) {
-
- rseg_id = trx_assign_rseg();
- }
+ ut_a(rseg_id == ULINT_UNDEFINED);
- rseg = trx_sys_get_nth_rseg(trx_sys, rseg_id);
+ rseg = trx_assign_rseg(srv_rollback_segments);
trx->id = trx_sys_get_new_trx_id();
@@ -716,110 +761,186 @@ trx_start(
}
/****************************************************************//**
-Commits a transaction. */
-UNIV_INTERN
+Set the transaction serialisation number. */
+static
void
-trx_commit_off_kernel(
-/*==================*/
- trx_t* trx) /*!< in: transaction */
+trx_serialisation_number_get(
+/*=========================*/
+ trx_t* trx) /*!< in: transaction */
{
- page_t* update_hdr_page;
- ib_uint64_t lsn = 0;
trx_rseg_t* rseg;
- trx_undo_t* undo;
- mtr_t mtr;
- ut_ad(mutex_own(&kernel_mutex));
+ rseg = trx->rseg;
- trx->must_flush_log_later = FALSE;
+ ut_ad(mutex_own(&rseg->mutex));
- rseg = trx->rseg;
+ mutex_enter(&kernel_mutex);
- if (trx->insert_undo != NULL || trx->update_undo != NULL) {
+ trx->no = trx_sys_get_new_trx_id();
+
+ /* If the rollack segment is not empty then the
+ new trx_t::no can't be less than any trx_t::no
+ already in the rollback segment. User threads only
+ produce events when a rollback segment is empty. */
+
+ if (rseg->last_page_no == FIL_NULL) {
+ void* ptr;
+ rseg_queue_t rseg_queue;
+
+ rseg_queue.rseg = rseg;
+ rseg_queue.trx_no = trx->no;
+
+ mutex_enter(&purge_sys->bh_mutex);
+
+ /* This is to reduce the pressure on the kernel mutex,
+ though in reality it should make very little (read no)
+ difference because this code path is only taken when the
+ rbs is empty. */
mutex_exit(&kernel_mutex);
- mtr_start(&mtr);
+ ptr = ib_bh_push(purge_sys->ib_bh, &rseg_queue);
+ ut_a(ptr);
- /* Change the undo log segment states from TRX_UNDO_ACTIVE
- to some other state: these modifications to the file data
- structure define the transaction as committed in the file
- based world, at the serialization point of the log sequence
- number lsn obtained below. */
+ mutex_exit(&purge_sys->bh_mutex);
+ } else {
+ mutex_exit(&kernel_mutex);
+ }
+}
- mutex_enter(&(rseg->mutex));
+/****************************************************************//**
+Assign the transaction its history serialisation number and write the
+update UNDO log record to the assigned rollback segment.
+@return the LSN of the UNDO log write. */
+static
+ib_uint64_t
+trx_write_serialisation_history(
+/*============================*/
+ trx_t* trx) /*!< in: transaction */
+{
+ mtr_t mtr;
+ trx_rseg_t* rseg;
- if (trx->insert_undo != NULL) {
- trx_undo_set_state_at_finish(
- rseg, trx, trx->insert_undo, &mtr);
- }
+ ut_ad(!mutex_own(&kernel_mutex));
- undo = trx->update_undo;
+ rseg = trx->rseg;
- if (undo) {
- mutex_enter(&kernel_mutex);
- trx->no = trx_sys_get_new_trx_no();
- mutex_exit(&kernel_mutex);
+ mtr_start(&mtr);
- /* It is not necessary to obtain trx->undo_mutex here
- because only a single OS thread is allowed to do the
- transaction commit for this transaction. */
+ /* Change the undo log segment states from TRX_UNDO_ACTIVE
+ to some other state: these modifications to the file data
+ structure define the transaction as committed in the file
+ based domain, at the serialization point of the log sequence
+ number lsn obtained below. */
- update_hdr_page = trx_undo_set_state_at_finish(
- rseg, trx, undo, &mtr);
+ if (trx->update_undo != NULL) {
+ page_t* undo_hdr_page;
+ trx_undo_t* undo = trx->update_undo;
- /* We have to do the cleanup for the update log while
- holding the rseg mutex because update log headers
- have to be put to the history list in the order of
- the trx number. */
+ /* We have to hold the rseg mutex because update
+ log headers have to be put to the history list in the
+ (serialisation) order of the UNDO trx number. This is
+ required for the purge in-memory data structures too. */
- trx_undo_update_cleanup(trx, update_hdr_page, &mtr);
- }
+ mutex_enter(&rseg->mutex);
- mutex_exit(&(rseg->mutex));
+ /* Assign the transaction serialisation number and also
+ update the purge min binary heap if this is the first
+ UNDO log being written to the assigned rollback segment. */
- /* Update the latest MySQL binlog name and offset info
- in trx sys header if MySQL binlogging is on or the database
- server is a MySQL replication slave */
-
- if (trx->mysql_log_file_name
- && trx->mysql_log_file_name[0] != '\0') {
- trx_sys_update_mysql_binlog_offset(
- trx->mysql_log_file_name,
- trx->mysql_log_offset,
- TRX_SYS_MYSQL_LOG_INFO, &mtr);
- trx->mysql_log_file_name = NULL;
- }
+ trx_serialisation_number_get(trx);
- /* 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
- we write the log to disk, but in the logical sense the commit
- in the file-based data structures (undo logs etc.) happens
- here.
-
- NOTE that transaction numbers, which are assigned only to
- transactions with an update undo log, do not necessarily come
- in exactly the same order as commit lsn's, if the transactions
- have different rollback segments. To get exactly the same
- order we should hold the kernel mutex up to this point,
- adding to the contention of the kernel mutex. However, if
- a transaction T2 is able to see modifications made by
- a transaction T1, T2 will always get a bigger transaction
- number and a bigger commit lsn than T1. */
+ /* It is not necessary to obtain trx->undo_mutex here
+ because only a single OS thread is allowed to do the
+ transaction commit for this transaction. */
- /*--------------*/
- mtr_commit(&mtr);
- /*--------------*/
- lsn = mtr.end_lsn;
+ undo_hdr_page = trx_undo_set_state_at_finish(undo, &mtr);
+
+ trx_undo_update_cleanup(trx, undo_hdr_page, &mtr);
+ } else {
+ mutex_enter(&rseg->mutex);
+ }
+
+ if (trx->insert_undo != NULL) {
+ trx_undo_set_state_at_finish(trx->insert_undo, &mtr);
+ }
+
+ mutex_exit(&rseg->mutex);
+
+ /* Update the latest MySQL binlog name and offset info
+ in trx sys header if MySQL binlogging is on or the database
+ server is a MySQL replication slave */
+
+ if (trx->mysql_log_file_name
+ && trx->mysql_log_file_name[0] != '\0') {
+
+ trx_sys_update_mysql_binlog_offset(
+ trx->mysql_log_file_name,
+ trx->mysql_log_offset,
+ TRX_SYS_MYSQL_LOG_INFO, &mtr);
+
+ trx->mysql_log_file_name = NULL;
+ }
+
+ /* 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
+ we write the log to disk, but in the logical sense the commit
+ in the file-based data structures (undo logs etc.) happens
+ here.
+
+ NOTE that transaction numbers, which are assigned only to
+ transactions with an update undo log, do not necessarily come
+ in exactly the same order as commit lsn's, if the transactions
+ have different rollback segments. To get exactly the same
+ order we should hold the kernel mutex up to this point,
+ adding to the contention of the kernel mutex. However, if
+ a transaction T2 is able to see modifications made by
+ a transaction T1, T2 will always get a bigger transaction
+ number and a bigger commit lsn than T1. */
+
+ /*--------------*/
+ mtr_commit(&mtr);
+ /*--------------*/
+
+ return(mtr.end_lsn);
+}
+
+/****************************************************************//**
+Commits a transaction. */
+UNIV_INTERN
+void
+trx_commit_off_kernel(
+/*==================*/
+ trx_t* trx) /*!< in: transaction */
+{
+ ib_uint64_t lsn;
+
+ ut_ad(mutex_own(&kernel_mutex));
+
+ trx->must_flush_log_later = FALSE;
+
+ /* If the transaction made any updates then we need to write the
+ UNDO logs for the updates to the assigned rollback segment. */
+
+ if (trx->insert_undo != NULL || trx->update_undo != NULL) {
+ mutex_exit(&kernel_mutex);
+
+ lsn = trx_write_serialisation_history(trx);
mutex_enter(&kernel_mutex);
+ } else {
+ lsn = 0;
}
- ut_ad(trx->conc_state == TRX_ACTIVE
- || trx->conc_state == TRX_PREPARED);
+ ut_ad(trx->conc_state == TRX_ACTIVE || trx->conc_state == TRX_PREPARED);
ut_ad(mutex_own(&kernel_mutex));
+ if (UNIV_UNLIKELY(trx->conc_state == TRX_PREPARED)) {
+ ut_a(trx_n_prepared > 0);
+ trx_n_prepared--;
+ }
+
/* The following assignment makes the transaction committed in memory
and makes its changes to data visible to other transactions.
NOTE that there is a small discrepancy from the strict formal
@@ -1668,12 +1789,6 @@ trx_print(
fprintf(f, " state %lu", (ulong) trx->conc_state);
}
-#ifdef UNIV_LINUX
- fprintf(f, ", process no %lu", trx->mysql_process_no);
-#endif
- fprintf(f, ", OS thread id %lu",
- (ulong) os_thread_pf(trx->mysql_thread_id));
-
if (*trx->op_info) {
putc(' ', f);
fputs(trx->op_info, f);
@@ -1850,6 +1965,7 @@ trx_prepare_off_kernel(
/*--------------------------------------*/
trx->conc_state = TRX_PREPARED;
+ trx_n_prepared++;
/*--------------------------------------*/
if (lsn) {
@@ -2002,18 +2118,18 @@ trx_recover_for_mysql(
/*******************************************************************//**
This function is used to find one X/Open XA distributed transaction
which is in the prepared state
-@return trx or NULL */
+@return trx or NULL; on match, the trx->xid will be invalidated */
UNIV_INTERN
trx_t*
trx_get_trx_by_xid(
/*===============*/
- XID* xid) /*!< in: X/Open XA transaction identification */
+ const XID* xid) /*!< in: X/Open XA transaction identifier */
{
trx_t* trx;
if (xid == NULL) {
- return (NULL);
+ return(NULL);
}
mutex_enter(&kernel_mutex);
@@ -2026,10 +2142,17 @@ trx_get_trx_by_xid(
of gtrid_length+bqual_length bytes should be
the same */
- if (xid->gtrid_length == trx->xid.gtrid_length
+ if (trx->is_recovered
+ && trx->conc_state == TRX_PREPARED
+ && xid->gtrid_length == trx->xid.gtrid_length
&& xid->bqual_length == trx->xid.bqual_length
&& memcmp(xid->data, trx->xid.data,
xid->gtrid_length + xid->bqual_length) == 0) {
+
+ /* Invalidate the XID, so that subsequent calls
+ will not find it. */
+ memset(&trx->xid, 0, sizeof(trx->xid));
+ trx->xid.formatID = -1;
break;
}
@@ -2038,14 +2161,5 @@ trx_get_trx_by_xid(
mutex_exit(&kernel_mutex);
- if (trx) {
- if (trx->conc_state != TRX_PREPARED) {
-
- return(NULL);
- }
-
- return(trx);
- } else {
- return(NULL);
- }
+ return(trx);
}
diff --git a/storage/innobase/trx/trx0undo.c b/storage/innobase/trx/trx0undo.c
index 9162c82e423..4cb4b7b79c5 100644
--- a/storage/innobase/trx/trx0undo.c
+++ b/storage/innobase/trx/trx0undo.c
@@ -36,6 +36,7 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0rseg.h"
#include "trx0trx.h"
#include "srv0srv.h"
+#include "srv0start.h"
#include "trx0rec.h"
#include "trx0purge.h"
@@ -1798,8 +1799,6 @@ UNIV_INTERN
page_t*
trx_undo_set_state_at_finish(
/*=========================*/
- trx_rseg_t* rseg, /*!< in: rollback segment memory object */
- trx_t* trx __attribute__((unused)), /*!< in: transaction */
trx_undo_t* undo, /*!< in: undo log memory copy */
mtr_t* mtr) /*!< in: mtr */
{
@@ -1808,10 +1807,8 @@ trx_undo_set_state_at_finish(
page_t* undo_page;
ulint state;
- ut_ad(trx);
ut_ad(undo);
ut_ad(mtr);
- ut_ad(mutex_own(&rseg->mutex));
if (undo->id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr, "InnoDB: Error: undo->id is %lu\n",
@@ -1830,19 +1827,7 @@ trx_undo_set_state_at_finish(
&& mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
< TRX_UNDO_PAGE_REUSE_LIMIT) {
- /* This is a heuristic to avoid the problem of all UNDO
- slots ending up in one of the UNDO lists. Previously if
- the server crashed with all the slots in one of the lists,
- transactions that required the slots of a different type
- would fail for lack of slots. */
-
- if (UT_LIST_GET_LEN(rseg->update_undo_list) < 500
- && UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
-
- state = TRX_UNDO_CACHED;
- } else {
- state = TRX_UNDO_TO_FREE;
- }
+ state = TRX_UNDO_CACHED;
} else if (undo->type == TRX_UNDO_INSERT) {
@@ -1991,4 +1976,28 @@ trx_undo_insert_cleanup(
mutex_exit(&(rseg->mutex));
}
+
+/********************************************************************//**
+At shutdown, frees the undo logs of a PREPARED transaction. */
+UNIV_INTERN
+void
+trx_undo_free_prepared(
+/*===================*/
+ trx_t* trx) /*!< in/out: PREPARED transaction */
+{
+ ut_ad(srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS);
+
+ if (trx->update_undo) {
+ ut_a(trx->update_undo->state == TRX_UNDO_PREPARED);
+ UT_LIST_REMOVE(undo_list, trx->rseg->update_undo_list,
+ trx->update_undo);
+ trx_undo_mem_free(trx->update_undo);
+ }
+ if (trx->insert_undo) {
+ ut_a(trx->insert_undo->state == TRX_UNDO_PREPARED);
+ UT_LIST_REMOVE(undo_list, trx->rseg->insert_undo_list,
+ trx->insert_undo);
+ trx_undo_mem_free(trx->insert_undo);
+ }
+}
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/innobase/ut/ut0auxconf_atomic_pthread_t_gcc.c b/storage/innobase/ut/ut0auxconf_atomic_pthread_t_gcc.c
deleted file mode 100644
index 30de5aa6f17..00000000000
--- a/storage/innobase/ut/ut0auxconf_atomic_pthread_t_gcc.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 2009, Innobase Oy. All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
-
-*****************************************************************************/
-
-/*****************************************************************************
-If this program compiles, then pthread_t objects can be used as arguments
-to GCC atomic builtin functions.
-
-Created March 5, 2009 Vasil Dimov
-*****************************************************************************/
-
-#include <pthread.h>
-#include <string.h>
-
-int
-main(int argc, char** argv)
-{
- pthread_t x1;
- pthread_t x2;
- pthread_t x3;
-
- memset(&x1, 0x0, sizeof(x1));
- memset(&x2, 0x0, sizeof(x2));
- memset(&x3, 0x0, sizeof(x3));
-
- __sync_bool_compare_and_swap(&x1, x2, x3);
-
- return(0);
-}
diff --git a/storage/innobase/ut/ut0auxconf_atomic_pthread_t_solaris.c b/storage/innobase/ut/ut0auxconf_atomic_pthread_t_solaris.c
deleted file mode 100644
index 310603c7503..00000000000
--- a/storage/innobase/ut/ut0auxconf_atomic_pthread_t_solaris.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 2009, Innobase Oy. All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
-
-*****************************************************************************/
-
-/*****************************************************************************
-If this program compiles and returns 0, then pthread_t objects can be used as
-arguments to Solaris libc atomic functions.
-
-Created April 18, 2009 Vasil Dimov
-*****************************************************************************/
-
-#include <pthread.h>
-#include <string.h>
-
-int
-main(int argc, char** argv)
-{
- pthread_t x1;
- pthread_t x2;
- pthread_t x3;
-
- memset(&x1, 0x0, sizeof(x1));
- memset(&x2, 0x0, sizeof(x2));
- memset(&x3, 0x0, sizeof(x3));
-
- if (sizeof(pthread_t) == 4) {
-
- atomic_cas_32(&x1, x2, x3);
-
- } else if (sizeof(pthread_t) == 8) {
-
- atomic_cas_64(&x1, x2, x3);
-
- } else {
-
- return(1);
- }
-
- return(0);
-}
diff --git a/storage/innobase/ut/ut0auxconf_have_gcc_atomics.c b/storage/innobase/ut/ut0auxconf_have_gcc_atomics.c
deleted file mode 100644
index da5c13d7d79..00000000000
--- a/storage/innobase/ut/ut0auxconf_have_gcc_atomics.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 2009, Innobase Oy. All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
-
-*****************************************************************************/
-
-/*****************************************************************************
-If this program compiles and returns 0, then GCC atomic funcions are available.
-
-Created September 12, 2009 Vasil Dimov
-*****************************************************************************/
-
-int
-main(int argc, char** argv)
-{
- long x;
- long y;
- long res;
- char c;
-
- x = 10;
- y = 123;
- res = __sync_bool_compare_and_swap(&x, x, y);
- if (!res || x != y) {
- return(1);
- }
-
- x = 10;
- y = 123;
- res = __sync_bool_compare_and_swap(&x, x + 1, y);
- if (res || x != 10) {
- return(1);
- }
-
- x = 10;
- y = 123;
- res = __sync_add_and_fetch(&x, y);
- if (res != 123 + 10 || x != 123 + 10) {
- return(1);
- }
-
- c = 10;
- res = __sync_lock_test_and_set(&c, 123);
- if (res != 10 || c != 123) {
- return(1);
- }
-
- return(0);
-}
diff --git a/storage/innobase/ut/ut0auxconf_have_solaris_atomics.c b/storage/innobase/ut/ut0auxconf_have_solaris_atomics.c
deleted file mode 100644
index 7eb704edd4b..00000000000
--- a/storage/innobase/ut/ut0auxconf_have_solaris_atomics.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 2009, Innobase Oy. All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
-
-*****************************************************************************/
-
-/*****************************************************************************
-If this program compiles, then Solaris libc atomic funcions are available.
-
-Created April 18, 2009 Vasil Dimov
-*****************************************************************************/
-#include <atomic.h>
-
-int
-main(int argc, char** argv)
-{
- ulong_t ulong = 0;
- uint32_t uint32 = 0;
- uint64_t uint64 = 0;
-
- atomic_cas_ulong(&ulong, 0, 1);
- atomic_cas_32(&uint32, 0, 1);
- atomic_cas_64(&uint64, 0, 1);
- atomic_add_long(&ulong, 0);
-
- return(0);
-}
diff --git a/storage/innobase/ut/ut0auxconf_pause.c b/storage/innobase/ut/ut0auxconf_pause.c
deleted file mode 100644
index 54d63bdd9bc..00000000000
--- a/storage/innobase/ut/ut0auxconf_pause.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 2009, Innobase Oy. All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
-
-*****************************************************************************/
-
-/*****************************************************************************
-If this program compiles and can be run and returns 0, then the pause
-instruction is available.
-
-Created Jul 21, 2009 Vasil Dimov
-*****************************************************************************/
-
-int
-main(int argc, char** argv)
-{
- __asm__ __volatile__ ("pause");
-
- return(0);
-}
diff --git a/storage/innobase/ut/ut0auxconf_sizeof_pthread_t.c b/storage/innobase/ut/ut0auxconf_sizeof_pthread_t.c
deleted file mode 100644
index 96add4526ef..00000000000
--- a/storage/innobase/ut/ut0auxconf_sizeof_pthread_t.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*****************************************************************************
-
-Copyright (c) 2009, Innobase Oy. All Rights Reserved.
-
-This program is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free Software
-Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
-
-*****************************************************************************/
-
-/*****************************************************************************
-This program should compile and when run, print a single line like:
-#define SIZEOF_PTHREAD_T %d
-
-Created April 18, 2009 Vasil Dimov
-*****************************************************************************/
-
-#include <stdio.h>
-#include <pthread.h>
-
-int
-main(int argc, char** argv)
-{
- printf("#define SIZEOF_PTHREAD_T %d\n", (int) sizeof(pthread_t));
-
- return(0);
-}
diff --git a/storage/innobase/ut/ut0bh.c b/storage/innobase/ut/ut0bh.c
new file mode 100644
index 00000000000..ae0b1aff207
--- /dev/null
+++ b/storage/innobase/ut/ut0bh.c
@@ -0,0 +1,164 @@
+/***************************************************************************//**
+Copyright (c) 2010, 2011, Oracle Corpn. All Rights Reserved.
+
+Portions of this file contain modifications contributed and copyrighted by
+Sun Microsystems, Inc. Those modifications are gratefully acknowledged and
+are described briefly in the InnoDB documentation. The contributions by
+Sun Microsystems are incorporated with their permission, and subject to the
+conditions contained in the file COPYING.Sun_Microsystems.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place, Suite 330, Boston, MA 02111-1307 USA
+
+*****************************************************************************/
+
+/******************************************************************//**
+@file ut/ut0bh.c
+Binary min-heap implementation.
+
+Created 2010-05-28 by Sunny Bains
+*******************************************************/
+
+#include "ut0bh.h"
+#include "ut0mem.h"
+
+#ifdef UNIV_NONINL
+#include "ut0bh.ic"
+#endif
+
+#include <string.h>
+
+/**********************************************************************//**
+Create a binary heap.
+@return a new binary heap */
+UNIV_INTERN
+ib_bh_t*
+ib_bh_create(
+/*=========*/
+ ib_bh_cmp_t compare, /*!< in: comparator */
+ ulint sizeof_elem, /*!< in: size of one element */
+ ulint max_elems) /*!< in: max elements allowed */
+{
+ ulint sz;
+ ib_bh_t* ib_bh;
+
+ sz = sizeof(*ib_bh) + (sizeof_elem * max_elems);
+
+ ib_bh = (ib_bh_t*) ut_malloc(sz);
+ memset(ib_bh, 0x0, sz);
+
+ ib_bh->compare = compare;
+ ib_bh->max_elems = max_elems;
+ ib_bh->sizeof_elem = sizeof_elem;
+
+ return(ib_bh);
+}
+
+/**********************************************************************//**
+Free a binary heap.
+@return a new binary heap */
+UNIV_INTERN
+void
+ib_bh_free(
+/*=======*/
+ ib_bh_t* ib_bh) /*!< in/own: instance */
+{
+ ut_free(ib_bh);
+}
+
+/**********************************************************************//**
+Add an element to the binary heap. Note: The element is copied.
+@return pointer to added element or NULL if full. */
+UNIV_INTERN
+void*
+ib_bh_push(
+/*=======*/
+ ib_bh_t* ib_bh, /*!< in/out: instance */
+ const void* elem) /*!< in: element to add */
+{
+ void* ptr;
+
+ if (ib_bh_is_full(ib_bh)) {
+ return(NULL);
+ } else if (ib_bh_is_empty(ib_bh)) {
+ ++ib_bh->n_elems;
+ return(ib_bh_set(ib_bh, 0, elem));
+ } else {
+ ulint i;
+
+ i = ib_bh->n_elems;
+
+ ++ib_bh->n_elems;
+
+ for (ptr = ib_bh_get(ib_bh, i >> 1);
+ i > 0 && ib_bh->compare(ptr, elem) > 0;
+ i >>= 1, ptr = ib_bh_get(ib_bh, i >> 1)) {
+
+ ib_bh_set(ib_bh, i, ptr);
+ }
+
+ ptr = ib_bh_set(ib_bh, i, elem);
+ }
+
+ return(ptr);
+}
+
+/**********************************************************************//**
+Remove the first element from the binary heap. */
+UNIV_INTERN
+void
+ib_bh_pop(
+/*======*/
+ ib_bh_t* ib_bh) /*!< in/out: instance */
+{
+ byte* ptr;
+ byte* last;
+ ulint parent = 0;
+
+ if (ib_bh_is_empty(ib_bh)) {
+ return;
+ } else if (ib_bh_size(ib_bh) == 1) {
+ --ib_bh->n_elems;
+ return;
+ }
+
+ last = (byte*) ib_bh_last(ib_bh);
+
+ /* Start from the child node */
+ ptr = (byte*) ib_bh_get(ib_bh, 1);
+
+ while (ptr < last) {
+ /* If the "right" child node is < "left" child node */
+ if (ib_bh->compare(ptr + ib_bh->sizeof_elem, ptr) < 0) {
+ ptr += ib_bh->sizeof_elem;
+ }
+
+ if (ib_bh->compare(last, ptr) <= 0) {
+ break;
+ }
+
+ ib_bh_set(ib_bh, parent, ptr);
+
+ parent = (ptr - (byte*) ib_bh_first(ib_bh))
+ / ib_bh->sizeof_elem;
+
+ if ((parent << 1) >= ib_bh_size(ib_bh)) {
+ break;
+ }
+
+ ptr = (byte*) ib_bh_get(ib_bh, parent << 1);
+ }
+
+ --ib_bh->n_elems;
+
+ ib_bh_set(ib_bh, parent, last);
+}
diff --git a/storage/innobase/ut/ut0dbg.c b/storage/innobase/ut/ut0dbg.c
index e79217d5b86..64fadd76d1c 100644
--- a/storage/innobase/ut/ut0dbg.c
+++ b/storage/innobase/ut/ut0dbg.c
@@ -25,6 +25,7 @@ Created 1/30/1994 Heikki Tuuri
#include "univ.i"
#include "ut0dbg.h"
+#include "ha_prototypes.h"
#if defined(__GNUC__) && (__GNUC__ > 2)
#else
@@ -55,12 +56,13 @@ ut_dbg_assertion_failed(
ut_print_timestamp(stderr);
#ifdef UNIV_HOTBACKUP
fprintf(stderr, " InnoDB: Assertion failure in file %s line %lu\n",
- file, line);
+ innobase_basename(file), line);
#else /* UNIV_HOTBACKUP */
fprintf(stderr,
" InnoDB: Assertion failure in thread %lu"
" in file %s line %lu\n",
- os_thread_pf(os_thread_get_curr_id()), file, line);
+ os_thread_pf(os_thread_get_curr_id()),
+ innobase_basename(file), line);
#endif /* UNIV_HOTBACKUP */
if (expr) {
fprintf(stderr,
@@ -74,7 +76,7 @@ ut_dbg_assertion_failed(
" or crashes, even\n"
"InnoDB: immediately after the mysqld startup, there may be\n"
"InnoDB: corruption in the InnoDB tablespace. Please refer to\n"
- "InnoDB: " REFMAN "forcing-recovery.html\n"
+ "InnoDB: " REFMAN "forcing-innodb-recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
ut_dbg_stop_threads = TRUE;
@@ -93,7 +95,8 @@ ut_dbg_stop_thread(
{
#ifndef UNIV_HOTBACKUP
fprintf(stderr, "InnoDB: Thread %lu stopped in file %s line %lu\n",
- os_thread_pf(os_thread_get_curr_id()), file, line);
+ os_thread_pf(os_thread_get_curr_id()),
+ innobase_basename(file), line);
os_thread_sleep(1000000000);
#endif /* !UNIV_HOTBACKUP */
}
diff --git a/storage/innobase/ut/ut0ut.c b/storage/innobase/ut/ut0ut.c
index 39978304696..a9c0d381e16 100644
--- a/storage/innobase/ut/ut0ut.c
+++ b/storage/innobase/ut/ut0ut.c
@@ -1,13 +1,6 @@
/*****************************************************************************
-Copyright (c) 1994, 2010, Innobase Oy. All Rights Reserved.
-Copyright (c) 2009, Sun Microsystems, Inc.
-
-Portions of this file contain modifications contributed and copyrighted by
-Sun Microsystems, Inc. Those modifications are gratefully acknowledged and
-are described briefly in the InnoDB documentation. The contributions by
-Sun Microsystems are incorporated with their permission, and subject to the
-conditions contained in the file COPYING.Sun_Microsystems.
+Copyright (c) 2011, Oracle Corpn. All Rights Reserved.
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
@@ -669,6 +662,8 @@ ut_strerr(
return("Table is being used");
case DB_TOO_BIG_RECORD:
return("Record too big");
+ case DB_TOO_BIG_INDEX_COL:
+ return("Index columns size too big");
case DB_LOCK_WAIT_TIMEOUT:
return("Lock wait timeout");
case DB_NO_REFERENCED_ROW:
@@ -693,6 +688,8 @@ ut_strerr(
return("Lock structs have exhausted the buffer pool");
case DB_FOREIGN_DUPLICATE_KEY:
return("Foreign key activated with duplicate keys");
+ case DB_FOREIGN_EXCEED_MAX_CASCADE:
+ return("Foreign key cascade delete/update exceeds max depth");
case DB_TOO_MANY_CONCURRENT_TRXS:
return("Too many concurrent transactions");
case DB_UNSUPPORTED:
@@ -713,6 +710,10 @@ ut_strerr(
return("Zip overflow");
case DB_RECORD_NOT_FOUND:
return("Record not found");
+ case DB_CHILD_NO_INDEX:
+ return("No index on referencing keys in referencing table");
+ case DB_PARENT_NO_INDEX:
+ return("No index on referenced keys in referenced table");
case DB_END_OF_INDEX:
return("End of index");
/* do not add default: in order to produce a warning if new code
diff --git a/storage/myisam/Makefile.am b/storage/myisam/Makefile.am
deleted file mode 100644
index 5d8a5e9753b..00000000000
--- a/storage/myisam/Makefile.am
+++ /dev/null
@@ -1,169 +0,0 @@
-# Copyright (C) 2000-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/sql \
- -I$(srcdir)
-WRAPLIBS=
-
-LDADD =
-
-DEFS = @DEFS@
-
-EXTRA_DIST = mi_test_all.sh mi_test_all.res CMakeLists.txt plug.in
-pkgdata_DATA =
-
-pkglib_LIBRARIES = libmyisam.a
-bin_PROGRAMS = myisamchk myisamlog myisampack myisam_ftdump
-myisamchk_DEPENDENCIES= $(LIBRARIES)
-myisamchk_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-myisamlog_DEPENDENCIES= $(LIBRARIES)
-myisamlog_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-myisampack_DEPENDENCIES=$(LIBRARIES)
-myisampack_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-noinst_PROGRAMS = mi_test1 mi_test2 mi_test3 rt_test sp_test
-noinst_HEADERS = myisamdef.h rt_index.h rt_key.h rt_mbr.h sp_defs.h \
- fulltext.h ftdefs.h ha_myisam.h mi_extrafunc.h
-mi_test1_DEPENDENCIES= $(LIBRARIES)
-mi_test1_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-mi_test2_DEPENDENCIES= $(LIBRARIES)
-mi_test2_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-mi_test3_DEPENDENCIES= $(LIBRARIES)
-mi_test3_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-myisam_ftdump_DEPENDENCIES= $(LIBRARIES)
-myisam_ftdump_LDADD = @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-rt_test_DEPENDENCIES= $(LIBRARIES)
-rt_test_LDADD = @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-sp_test_DEPENDENCIES= $(LIBRARIES)
-sp_test_LDADD = @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-libmyisam_a_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \
- mi_rnext.c mi_rnext_same.c \
- mi_search.c mi_page.c mi_key.c mi_locking.c \
- mi_rrnd.c mi_scan.c mi_cache.c \
- mi_statrec.c mi_packrec.c mi_dynrec.c \
- mi_update.c mi_write.c mi_unique.c \
- mi_delete.c \
- mi_rprev.c mi_rfirst.c mi_rlast.c mi_rsame.c \
- mi_rsamepos.c mi_panic.c mi_close.c mi_create.c\
- mi_range.c mi_dbug.c mi_checksum.c mi_log.c \
- mi_changed.c mi_static.c mi_delete_all.c \
- mi_delete_table.c mi_rename.c mi_check.c \
- mi_keycache.c mi_preload.c \
- ft_parser.c ft_stopwords.c ft_static.c \
- ft_update.c ft_boolean_search.c ft_nlq_search.c \
- sort.c ha_myisam.cc ft_myisam.c \
- rt_index.c rt_key.c rt_mbr.c rt_split.c sp_key.c
-CLEANFILES = test?.MY? FT?.MY? isam.log mi_test_all rt_test.MY? sp_test.MY?
-
-# Move to automake rules ?
-prolint:; plparse -b -u -hF1 "-width(0,0)" "-format=%f:%l:\s%t:%n\s%m" \
- "-elib(????)" "+elib(?3??)" my.lnt $(nisam_SOURCES)
-
-SUFFIXES = .sh
-
-.sh:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''bindir''@!$(bindir)!g' \
- -e 's!@''scriptdir''@!$(bindir)!g' \
- -e 's!@''prefix''@!$(prefix)!g' \
- -e 's!@''datadir''@!$(datadir)!g' \
- -e 's!@''localstatedir''@!$(localstatedir)!g' \
- -e 's!@''libexecdir''@!$(libexecdir)!g' \
- -e 's!@''CC''@!@CC@!'\
- -e 's!@''CXX''@!@CXX@!'\
- -e 's!@''GXX''@!@GXX@!'\
- -e 's!@''PERL''@!@PERL@!' \
- -e 's!@''CFLAGS''@!@SAVE_CFLAGS@!'\
- -e 's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'\
- -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\
- -e 's!@''VERSION''@!@VERSION@!' \
- -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \
- -e 's!@''COMPILATION_COMMENT''@!@COMPILATION_COMMENT@!' \
- -e 's!@''MACHINE_TYPE''@!@MACHINE_TYPE@!' \
- -e 's!@''HOSTNAME''@!@HOSTNAME@!' \
- -e 's!@''SYSTEM_TYPE''@!@SYSTEM_TYPE@!' \
- -e 's!@''CHECK_PID''@!@CHECK_PID@!' \
- -e 's!@''FIND_PROC''@!@FIND_PROC@!' \
- -e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \
- -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
- -e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \
- -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \
- -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \
- -e 's!@''sysconfdir''@!@sysconfdir@!' \
- -e 's!@''SHORT_MYSQL_INTRO''@!@SHORT_MYSQL_INTRO@!' \
- -e 's!@''SHARED_LIB_VERSION''@!@SHARED_LIB_VERSION@!' \
- -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
- -e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
- -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
- -e 's!@''PERL_DBI_VERSION''@!@PERL_DBI_VERSION@!' \
- -e 's!@''PERL_DBD_VERSION''@!@PERL_DBD_VERSION@!' \
- -e 's!@''PERL_DATA_DUMPER''@!@PERL_DATA_DUMPER@!' \
- $< > $@-t
- @CHMOD@ +x $@-t
- @MV@ $@-t $@
-
-if HAVE_DTRACE_DASH_G
-libmyisam_a_LIBADD = probes_mysql.o
-libmyisam_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers
-CLEANFILES += probes_mysql.o dtrace_files dtrace_providers
-DTRACEFILES = ha_myisam.o
-DTRACEPROVIDER = probes_mysql.d
-CLEANFILES += $(DTRACEPROVIDER) dtrace_sources
-
-dtrace_files:
- echo $(DTRACEFILES) > $@
-dtrace_providers: probes_mysql.d
- echo $(DTRACEPROVIDER) > $@
-probes_mysql.d:
- -$(RM) -f probes_mysql.d
- $(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d
- echo timestamp > dtrace_sources
-
-probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES)
- $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACEFILES) -o $@
-endif
diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c
index bf0af370838..650eb160866 100644
--- a/storage/myisam/ft_boolean_search.c
+++ b/storage/myisam/ft_boolean_search.c
@@ -92,8 +92,6 @@ static double *nwghts=_nwghts+5; /* nwghts[i] = -0.5*1.5**i */
#define FTB_FLAG_NO 4
#define FTB_FLAG_WONLY 8
-#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
-
typedef struct st_ftb_expr FTB_EXPR;
struct st_ftb_expr
{
diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c
index b0911403996..9eb8b68bf13 100644
--- a/storage/myisam/ft_stopwords.c
+++ b/storage/myisam/ft_stopwords.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2005 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
#include "ftdefs.h"
-#include "my_handler.h"
+#include "my_compare.h"
static CHARSET_INFO *ft_stopword_cs= NULL;
diff --git a/storage/myisam/ftbench/Ecompare.pl b/storage/myisam/ftbench/Ecompare.pl
index 265534e704d..2c50ae9b9ce 100755
--- a/storage/myisam/ftbench/Ecompare.pl
+++ b/storage/myisam/ftbench/Ecompare.pl
@@ -1,5 +1,20 @@
#!/usr/bin/perl
+# 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
+
# compares out-files (as created by Ereport.pl) from dir1/*.out and dir2/*.out
# for each effectiveness column computes the probability of the hypothesis
# "Both files have the same effectiveness"
diff --git a/storage/myisam/ftbench/Ecreate.pl b/storage/myisam/ftbench/Ecreate.pl
index d90a6f7a0ad..123ca729c31 100755
--- a/storage/myisam/ftbench/Ecreate.pl
+++ b/storage/myisam/ftbench/Ecreate.pl
@@ -1,5 +1,20 @@
#!/usr/bin/perl
+# 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
+
$test=shift || die "Usage $0 testname [option]";
$option=shift;
diff --git a/storage/myisam/ftbench/Ereport.pl b/storage/myisam/ftbench/Ereport.pl
index 5969304da09..2f63d7ea37a 100755
--- a/storage/myisam/ftbench/Ereport.pl
+++ b/storage/myisam/ftbench/Ereport.pl
@@ -1,5 +1,20 @@
#!/usr/bin/perl
+# 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
+
die "Use: $0 eval_output qrels_file\n" unless @ARGV==2;
open(EOUT,$eout=shift) || die "Cannot open $eout: $!";
diff --git a/storage/myisam/ftbench/ft-test-run.sh b/storage/myisam/ftbench/ft-test-run.sh
index 0908e55b400..8726c263de9 100755
--- a/storage/myisam/ftbench/ft-test-run.sh
+++ b/storage/myisam/ftbench/ft-test-run.sh
@@ -1,5 +1,22 @@
#!/bin/sh
+# Copyright (C) 2003 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
if [ ! -x ./ft-test-run.sh ] ; then
echo "Usage: ./ft-test-run.sh"
exit 1
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 2913cdc421d..3121deb66e4 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -168,10 +168,9 @@ static void mi_check_print_msg(HA_CHECK *param, const char* msg_type,
Also we likely need to lock mutex here (in both cases with protocol and
push_warning).
*/
-#ifdef THREAD
if (param->need_print_msg_lock)
mysql_mutex_lock(&param->print_msg_mutex);
-#endif
+
protocol->prepare_for_resend();
protocol->store(name, length, system_charset_info);
protocol->store(param->op_name, system_charset_info);
@@ -180,10 +179,10 @@ static void mi_check_print_msg(HA_CHECK *param, const char* msg_type,
if (protocol->write())
sql_print_error("Failed on my_net_write, writing to stderr instead: %s\n",
msgbuf);
-#ifdef THREAD
+
if (param->need_print_msg_lock)
mysql_mutex_unlock(&param->print_msg_mutex);
-#endif
+
return;
}
@@ -640,13 +639,14 @@ ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg)
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 |
- HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT),
+ HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT | HA_CAN_REPAIR),
can_enable_indexes(1)
{}
-handler *ha_myisam::clone(MEM_ROOT *mem_root)
+handler *ha_myisam::clone(const char *name, MEM_ROOT *mem_root)
{
- ha_myisam *new_handler= static_cast <ha_myisam *>(handler::clone(mem_root));
+ ha_myisam *new_handler= static_cast <ha_myisam *>(handler::clone(name,
+ mem_root));
if (new_handler)
new_handler->file->state= file->state;
return new_handler;
@@ -1530,8 +1530,6 @@ bool ha_myisam::check_and_repair(THD *thd)
{
int error=0;
int marked_crashed;
- char *old_query;
- uint old_query_length;
HA_CHECK_OPT check_opt;
DBUG_ENTER("ha_myisam::check_and_repair");
@@ -1542,10 +1540,9 @@ bool ha_myisam::check_and_repair(THD *thd)
check_opt.flags|=T_QUICK;
sql_print_warning("Checking table: '%s'",table->s->path.str);
- old_query= thd->query();
- old_query_length= thd->query_length();
+ const CSET_STRING query_backup= thd->query_string;
thd->set_query(table->s->table_name.str,
- (uint) table->s->table_name.length);
+ (uint) table->s->table_name.length, system_charset_info);
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
{
@@ -1558,7 +1555,7 @@ bool ha_myisam::check_and_repair(THD *thd)
if (repair(thd, &check_opt))
error=1;
}
- thd->set_query(old_query, old_query_length);
+ thd->set_query(query_backup);
DBUG_RETURN(error);
}
@@ -1848,6 +1845,18 @@ int ha_myisam::delete_all_rows()
return mi_delete_all_rows(file);
}
+
+/*
+ Intended to support partitioning.
+ Allows a particular partition to be truncated.
+*/
+
+int ha_myisam::truncate()
+{
+ int error= delete_all_rows();
+ return error ? error : reset_auto_increment(0);
+}
+
int ha_myisam::reset_auto_increment(ulonglong value)
{
file->s->state.auto_increment= value;
diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
index 61585013678..b5415bb0dc7 100644
--- a/storage/myisam/ha_myisam.h
+++ b/storage/myisam/ha_myisam.h
@@ -55,7 +55,7 @@ class ha_myisam: public handler
public:
ha_myisam(handlerton *hton, TABLE_SHARE *table_arg);
~ha_myisam() {}
- handler *clone(MEM_ROOT *mem_root);
+ handler *clone(const char *name, MEM_ROOT *mem_root);
const char *table_type() const { return "MyISAM"; }
const char *index_type(uint key_number);
const char **bas_ext() const;
@@ -116,6 +116,7 @@ class ha_myisam: public handler
int reset(void);
int external_lock(THD *thd, int lock_type);
int delete_all_rows(void);
+ int truncate();
int reset_auto_increment(ulonglong value);
int disable_indexes(uint mode);
int enable_indexes(uint mode);
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index a69ed41f67d..daae02e6846 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -79,7 +79,8 @@ static int sort_delete_record(MI_SORT_PARAM *sort_param);
static SORT_KEY_BLOCKS *alloc_key_blocks(HA_CHECK *param, uint blocks,
uint buffer_length);
static ha_checksum mi_byte_checksum(const uchar *buf, uint length);
-static void set_data_file_type(MI_SORT_INFO *sort_info, MYISAM_SHARE *share);
+static void set_data_file_type(SORT_INFO *sort_info, MYISAM_SHARE *share);
+static HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a);
void myisamchk_init(HA_CHECK *param)
{
@@ -98,6 +99,7 @@ void myisamchk_init(HA_CHECK *param)
param->max_record_length= LONGLONG_MAX;
param->key_cache_block_size= KEY_CACHE_BLOCK_SIZE;
param->stats_method= MI_STATS_METHOD_NULLS_NOT_EQUAL;
+ param->need_print_msg_lock= 0;
}
/* Check the status flags for the table */
@@ -1748,6 +1750,8 @@ err:
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
mi_open_datafile(info,share,name,-1))
got_error=1;
+
+ param->retry_repair= 0;
}
}
if (got_error)
@@ -2633,9 +2637,6 @@ err:
int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
const char * name, int rep_quick)
{
-#ifndef THREAD
- return mi_repair_by_sort(param, info, name, rep_quick);
-#else
int got_error;
uint i,key, total_key_length, istep;
ulong rec_length;
@@ -3125,7 +3126,6 @@ err:
share->pack.header_length=0;
}
DBUG_RETURN(got_error);
-#endif /* THREAD */
}
/* Read next record and return next key */
@@ -4747,3 +4747,4 @@ set_data_file_type(MI_SORT_INFO *sort_info, MYISAM_SHARE *share)
share->delete_record=tmp.delete_record;
}
}
+
diff --git a/storage/myisam/mi_close.c b/storage/myisam/mi_close.c
index fd10ef47968..660863d4f7c 100644
--- a/storage/myisam/mi_close.c
+++ b/storage/myisam/mi_close.c
@@ -94,7 +94,6 @@ int mi_close(register MI_INFO *info)
my_free(share->decode_trees);
my_free(share->decode_tables);
}
-#ifdef THREAD
thr_lock_delete(&share->lock);
mysql_mutex_destroy(&share->intern_lock);
{
@@ -105,7 +104,6 @@ int mi_close(register MI_INFO *info)
mysql_rwlock_destroy(&share->key_root_lock[i]);
}
}
-#endif
my_free(info->s);
}
mysql_mutex_unlock(&THR_LOCK_myisam);
diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c
index 7222542847d..3ec429535d4 100644
--- a/storage/myisam/mi_create.c
+++ b/storage/myisam/mi_create.c
@@ -829,8 +829,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
err:
mysql_mutex_unlock(&THR_LOCK_myisam);
-err_no_lock:
+err_no_lock:
save_errno=my_errno;
switch (errpos) {
case 3:
diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c
index 0817d9926ca..6d2ca5b1f8d 100644
--- a/storage/myisam/mi_delete.c
+++ b/storage/myisam/mi_delete.c
@@ -102,7 +102,7 @@ int mi_delete(MI_INFO *info,const uchar *record)
mi_sizestore(lastpos,info->lastpos);
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)
{
DBUG_PRINT("info", ("invalidator... '%s' (delete)", info->filename));
@@ -122,7 +122,6 @@ err:
}
(void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
info->update|=HA_STATE_WRITTEN; /* Buffer changed */
- allow_break(); /* Allow SIGHUP & SIGINT */
my_errno=save_errno;
if (save_errno == HA_ERR_KEY_NOT_FOUND)
{
diff --git a/storage/myisam/mi_delete_all.c b/storage/myisam/mi_delete_all.c
index 5940b927d9a..a21a2a3093a 100644
--- a/storage/myisam/mi_delete_all.c
+++ b/storage/myisam/mi_delete_all.c
@@ -67,7 +67,6 @@ int mi_delete_all_rows(MI_INFO *info)
if (share->file_map)
mi_dynmap_file(info, (my_off_t) 0);
#endif
- allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(0);
err:
@@ -75,7 +74,6 @@ err:
int save_errno=my_errno;
(void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
info->update|=HA_STATE_WRITTEN; /* Buffer changed */
- allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(my_errno=save_errno);
}
} /* mi_delete */
diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c
index 70a59a11346..aeb81d4e09c 100644
--- a/storage/myisam/mi_dynrec.c
+++ b/storage/myisam/mi_dynrec.c
@@ -39,13 +39,11 @@ static int delete_dynamic_record(MI_INFO *info,my_off_t filepos,
static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos,
uint length);
-#ifdef THREAD
/* Play it safe; We have a small stack when using threads */
#undef my_alloca
#undef my_afree
#define my_alloca(A) my_malloc((A),MYF(0))
#define my_afree(A) my_free((A))
-#endif
/* Interface function from MI_INFO */
@@ -1579,9 +1577,6 @@ int _mi_cmp_dynamic_record(register MI_INFO *info, register const uchar *record)
MI_BLOCK_INFO block_info;
DBUG_ENTER("_mi_cmp_dynamic_record");
- /* We are going to do changes; dont let anybody disturb */
- dont_break(); /* Dont allow SIGHUP or SIGINT */
-
if (info->opt_flag & WRITE_CACHE_USED)
{
info->update&= ~(HA_STATE_WRITE_AT_END | HA_STATE_EXTEND_BLOCK);
diff --git a/storage/myisam/mi_log.c b/storage/myisam/mi_log.c
index e0c66bef996..ac3aa7c149b 100644
--- a/storage/myisam/mi_log.c
+++ b/storage/myisam/mi_log.c
@@ -24,11 +24,7 @@
#endif
#undef GETPID /* For HPUX */
-#ifdef THREAD
#define GETPID() (log_type == 1 ? (long) myisam_pid : (long) my_thread_dbug_id())
-#else
-#define GETPID() myisam_pid
-#endif
/* Activate logging if flag is 1 and reset logging if flag is 0 */
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index abc731aead6..3c52016a1ba 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -291,9 +291,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
&share->state.key_root,keys*sizeof(my_off_t),
&share->state.key_del,
(share->state.header.max_block_size_index*sizeof(my_off_t)),
-#ifdef THREAD
&share->key_root_lock, sizeof(mysql_rwlock_t)*keys,
-#endif
&share->mmap_lock, sizeof(mysql_rwlock_t),
NullS))
goto err;
@@ -510,7 +508,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
my_afree(disk_cache);
mi_setup_functions(share);
share->is_log_table= FALSE;
-#ifdef THREAD
thr_lock_init(&share->lock);
mysql_mutex_init(mi_key_mutex_MYISAM_SHARE_intern_lock,
&share->intern_lock, MY_MUTEX_INIT_FAST);
@@ -541,7 +538,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
share->lock.fix_status= (void (*)(void *, void *)) mi_fix_status;
}
}
-#endif
/*
Memory mapping can only be requested after initializing intern_lock.
*/
@@ -639,9 +635,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
bzero(info.rec_buff, mi_get_rec_buff_len(&info, info.rec_buff));
*m_info=info;
-#ifdef THREAD
thr_lock_data_init(&share->lock,&m_info->lock,(void*) m_info);
-#endif
m_info->open_list.data=(void*) m_info;
myisam_open_list=list_add(myisam_open_list,&m_info->open_list);
diff --git a/storage/myisam/mi_static.c b/storage/myisam/mi_static.c
index 55967fc9001..711287ca16f 100644
--- a/storage/myisam/mi_static.c
+++ b/storage/myisam/mi_static.c
@@ -32,7 +32,7 @@ File myisam_log_file= -1;
uint myisam_quick_table_bits=9;
ulong myisam_block_size= MI_KEY_BLOCK_LENGTH; /* Best by test */
my_bool myisam_flush=0, myisam_delay_key_write=0, myisam_single_user=0;
-#if defined(THREAD) && !defined(DONT_USE_RW_LOCKS)
+#if !defined(DONT_USE_RW_LOCKS)
ulong myisam_concurrent_insert= 2;
#else
ulong myisam_concurrent_insert= 0;
diff --git a/storage/myisam/mi_statrec.c b/storage/myisam/mi_statrec.c
index f83afa3c886..bf791726aa9 100644
--- a/storage/myisam/mi_statrec.c
+++ b/storage/myisam/mi_statrec.c
@@ -114,9 +114,6 @@ int _mi_cmp_static_record(register MI_INFO *info, register const uchar *old)
{
DBUG_ENTER("_mi_cmp_static_record");
- /* We are going to do changes; dont let anybody disturb */
- dont_break(); /* Dont allow SIGHUP or SIGINT */
-
if (info->opt_flag & WRITE_CACHE_USED)
{
if (flush_io_cache(&info->rec_cache))
diff --git a/storage/myisam/mi_test_all.sh b/storage/myisam/mi_test_all.sh
index c6bc686e885..641f1cc0a35 100755
--- a/storage/myisam/mi_test_all.sh
+++ b/storage/myisam/mi_test_all.sh
@@ -1,4 +1,22 @@
#!/bin/sh
+
+# 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 Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
#
# Execute some simple basic test on MyISAM libary to check if things
# works at all.
diff --git a/storage/myisam/mi_update.c b/storage/myisam/mi_update.c
index 6d4150e5b79..2104e4c4117 100644
--- a/storage/myisam/mi_update.c
+++ b/storage/myisam/mi_update.c
@@ -179,7 +179,6 @@ int mi_update(register MI_INFO *info, const uchar *oldrec, uchar *newrec)
there is no index change there could be data change.
*/
(void) _mi_writeinfo(info, WRITEINFO_UPDATE_KEYFILE);
- allow_break(); /* Allow SIGHUP & SIGINT */
if (info->invalidator != 0)
{
DBUG_PRINT("info", ("invalidator... '%s' (update)", info->filename));
@@ -193,8 +192,8 @@ err:
save_errno=my_errno;
if (changed)
key_changed|= HA_STATE_CHANGED;
- if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_OUT_OF_MEM ||
- my_errno == HA_ERR_RECORD_FILE_FULL)
+ if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL ||
+ my_errno == HA_ERR_NULL_IN_SPATIAL || my_errno == HA_ERR_OUT_OF_MEM)
{
info->errkey= (int) i;
flag=0;
@@ -212,8 +211,9 @@ err:
{
uint new_length=_mi_make_key(info,i,new_key,newrec,pos);
uint old_length= _mi_make_key(info,i,old_key,oldrec,pos);
- if ((flag++ && _mi_ck_delete(info,i,new_key,new_length)) ||
- _mi_ck_write(info,i,old_key,old_length))
+ if ((flag++ &&
+ share->keyinfo[i].ck_delete(info, i, new_key, new_length)) ||
+ share->keyinfo[i].ck_insert(info, i, old_key, old_length))
break;
}
}
@@ -230,7 +230,6 @@ err:
err_end:
myisam_log_record(MI_LOG_UPDATE,info,newrec,info->lastpos,my_errno);
(void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
- allow_break(); /* Allow SIGHUP & SIGINT */
if (save_errno == HA_ERR_KEY_NOT_FOUND)
{
mi_print_error(info->s, HA_ERR_CRASHED);
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index 7b40a11f7c6..1c9a25f8e86 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -60,7 +60,7 @@ int mi_write(MI_INFO *info, uchar *record)
}
if (_mi_readinfo(info,F_WRLCK,1))
DBUG_RETURN(my_errno);
- dont_break(); /* Dont allow SIGHUP or SIGINT */
+
filepos= ((share->state.dellink != HA_OFFSET_ERROR &&
!info->append_insert_at_end) ?
share->state.dellink :
@@ -169,7 +169,6 @@ int mi_write(MI_INFO *info, uchar *record)
if (share->is_log_table)
mi_update_status((void*) info);
- allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(0);
err:
@@ -205,7 +204,7 @@ err:
else
{
uint key_length=_mi_make_key(info,i,buff,record,filepos);
- if (_mi_ck_delete(info,i,buff,key_length))
+ if (share->keyinfo[i].ck_delete(info, i, buff, key_length))
{
if (local_lock_tree)
mysql_rwlock_unlock(&share->key_root_lock[i]);
@@ -228,7 +227,6 @@ err2:
save_errno=my_errno;
myisam_log_record(MI_LOG_WRITE,info,record,filepos,my_errno);
(void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
- allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(my_errno=save_errno);
} /* mi_write */
diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c
index 70406203f63..e932234a998 100644
--- a/storage/myisam/myisamchk.c
+++ b/storage/myisam/myisamchk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -670,10 +670,10 @@ get_one_option(int optid,
case OPT_STATS_METHOD:
{
int method;
- enum_handler_stats_method method_conv;
- LINT_INIT(method_conv);
+ enum_mi_stats_method UNINIT_VAR(method_conv);
myisam_stats_method_str= argument;
- if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0)
+ if ((method= find_type(argument, &myisam_stats_method_typelib,
+ FIND_TYPE_BASIC)) <= 0)
{
fprintf(stderr, "Invalid value of stats_method: %s.\n", argument);
exit(1);
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index 894ec827b85..3f82d96b88b 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -18,12 +18,8 @@
#include "myisam.h" /* Structs & some defines */
#include "myisampack.h" /* packing of keys */
#include <my_tree.h>
-#ifdef THREAD
#include <my_pthread.h>
#include <thr_lock.h>
-#else
-#include <my_no_pthread.h>
-#endif
#include <mysql/psi/mysql_file.h>
/* undef map from my_nosys; We need test-if-disk full */
@@ -220,11 +216,9 @@ typedef struct st_mi_isam_share
global_changed, /* If changed since open */
not_flushed, temporary, delay_key_write, concurrent_insert;
my_bool deleting; /* we are going to delete this table */
-#ifdef THREAD
THR_LOCK lock;
mysql_mutex_t intern_lock; /* Locking for use with _locking */
mysql_rwlock_t *key_root_lock;
-#endif
my_off_t mmaped_length;
uint nonmmaped_inserts; /* counter of writing in non-mmaped
area */
@@ -304,9 +298,7 @@ struct st_myisam_info
my_bool buff_used;
index_cond_func_t index_cond_func; /* Index condition function */
void *index_cond_func_arg; /* parameter for the func */
-#ifdef THREAD
THR_LOCK_DATA lock;
-#endif
uchar *rtree_recursion_state; /* For RTREE */
int rtree_recursion_depth;
};
@@ -415,10 +407,8 @@ struct st_myisam_info
#define MI_UNIQUE_HASH_TYPE HA_KEYTYPE_ULONG_INT
#define mi_unique_store(A,B) mi_int4store((A),(B))
-#ifdef THREAD
extern mysql_mutex_t THR_LOCK_myisam;
-#endif
-#if !defined(THREAD) || defined(DONT_USE_RW_LOCKS)
+#ifdef DONT_USE_RW_LOCKS
#define mysql_rwlock_wrlock(A) {}
#define mysql_rwlock_rdlock(A) {}
#define mysql_rwlock_unlock(A) {}
@@ -730,9 +720,7 @@ int killed_ptr(HA_CHECK *param);
void mi_check_print_error(HA_CHECK *param, const char *fmt, ...);
void mi_check_print_warning(HA_CHECK *param, const char *fmt, ...);
void mi_check_print_info(HA_CHECK *param, const char *fmt, ...);
-#ifdef THREAD
pthread_handler_t thr_find_all_keys(void *arg);
-#endif
extern void mi_set_index_cond_func(MI_INFO *info, index_cond_func_t func,
void *func_arg);
int flush_blocks(HA_CHECK *param, KEY_CACHE *key_cache, File file,
diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c
index 017f7d160b6..b48e95f1171 100644
--- a/storage/myisam/myisampack.c
+++ b/storage/myisam/myisampack.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* 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
diff --git a/storage/myisam/plug.in b/storage/myisam/plug.in
deleted file mode 100644
index e92b5e56d7f..00000000000
--- a/storage/myisam/plug.in
+++ /dev/null
@@ -1,7 +0,0 @@
-dnl MYSQL_STORAGE_ENGINE(myisam,no, [MyISAM Storage Engine],
-dnl [Traditional non-transactional MySQL tables])
-dnl MYSQL_PLUGIN_DIRECTORY(myisam, [storage/myisam])
-dnl MYSQL_PLUGIN_STATIC(myisam, [libmyisam.a])
-dnl MYSQL_PLUGIN_MANDATORY(myisam) dnl Default
-dnl MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(myisam, [ha_myisam.cc])
-
diff --git a/storage/myisam/rt_index.c b/storage/myisam/rt_index.c
index 48eb48cc5e8..888d3c7e56a 100644
--- a/storage/myisam/rt_index.c
+++ b/storage/myisam/rt_index.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006 MySQL AB & Ramil Kalimullin
+/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index 903a893e779..eb462d8c23e 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -302,7 +302,6 @@ static ha_rows find_all_keys(MI_SORT_PARAM *info, uint keys,
} /* find_all_keys */
-#ifdef THREAD
/* Search after all keys and place them in a temp. file */
pthread_handler_t thr_find_all_keys(void *arg)
@@ -637,7 +636,6 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
my_free(mergebuf);
DBUG_RETURN(got_error);
}
-#endif /* THREAD */
/* Write all keys in memory to file for later merge */
diff --git a/storage/myisammrg/Makefile.am b/storage/myisammrg/Makefile.am
deleted file mode 100644
index 43dec3ae3d9..00000000000
--- a/storage/myisammrg/Makefile.am
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright (C) 2000-2002, 2005-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/sql \
- -I$(srcdir)
-WRAPLIBS=
-
-LDADD =
-
-DEFS = @DEFS@
-pkglib_LIBRARIES = libmyisammrg.a
-noinst_HEADERS = myrg_def.h ha_myisammrg.h
-noinst_LIBRARIES = libmyisammrg.a
-libmyisammrg_a_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \
- myrg_rrnd.c myrg_update.c myrg_delete.c myrg_rsame.c \
- myrg_panic.c myrg_close.c myrg_create.c myrg_static.c \
- myrg_rkey.c myrg_rfirst.c myrg_rlast.c myrg_rnext.c \
- myrg_rprev.c myrg_queue.c myrg_write.c myrg_range.c \
- ha_myisammrg.cc \
- myrg_rnext_same.c myrg_records.c
-
-
-EXTRA_DIST = CMakeLists.txt plug.in
-
-if HAVE_DTRACE_DASH_G
-libmyisammrg_a_LIBADD = probes_mysql.o
-libmyisammrg_a_DEPENDENCIES = probes_mysql.o dtrace_files dtrace_providers
-CLEANFILES = probes_mysql.o dtrace_files dtrace_providers
-DTRACEFILES = ha_myisammrg.o
-DTRACEPROVIDER = probes_mysql.d
-CLEANFILES += $(DTRACEPROVIDER) dtrace_sources
-
-dtrace_files:
- echo $(DTRACEFILES) > $@
-dtrace_providers: probes_mysql.d
- echo $(DTRACEPROVIDER) > $@
-probes_mysql.d:
- -$(RM) -f probes_mysql.d
- $(CP) $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d
- echo timestamp > dtrace_sources
-
-probes_mysql.o: $(DTRACEPROVIDER) $(DTRACEFILES)
- $(DTRACE) $(DTRACEFLAGS) -G -s $(DTRACEPROVIDER) $(DTRACEFILES) -o $@
-endif
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index ef7cd5712e8..22b4794dbde 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -480,6 +480,31 @@ int ha_myisammrg::add_children_list(void)
/* Set the expected table version, to not cause spurious re-prepare. */
child_l->set_table_ref_id(mrg_child_def->get_child_table_ref_type(),
mrg_child_def->get_child_def_version());
+ /*
+ For statements which acquire a SNW metadata lock on a parent table and
+ then later try to upgrade it to an X lock (e.g. ALTER TABLE), SNW
+ locks should be also taken on the children tables.
+
+ Otherwise we end up in a situation where the thread trying to upgrade SNW
+ to X lock on the parent also holds a SR metadata lock and a read
+ thr_lock.c lock on the child. As a result, another thread might be
+ blocked on the thr_lock.c lock for the child after successfully acquiring
+ a SR or SW metadata lock on it. If at the same time this second thread
+ has a shared metadata lock on the parent table or there is some other
+ thread which has a shared metadata lock on the parent and is waiting for
+ this second thread, we get a deadlock. This deadlock cannot be properly
+ detected by the MDL subsystem as part of the waiting happens within
+ thr_lock.c. By taking SNW locks on the child tables we ensure that any
+ thread which waits for a thread doing SNW -> X upgrade, does this within
+ the MDL subsystem and thus potential deadlocks are exposed to the deadlock
+ detector.
+
+ We don't do the same thing for SNRW locks as this would allow
+ DDL on implicitly locked underlying tables of a MERGE table.
+ */
+ if (! thd->locked_tables_mode &&
+ parent_l->mdl_request.type == MDL_SHARED_NO_WRITE)
+ child_l->mdl_request.set_type(MDL_SHARED_NO_WRITE);
/* Link TABLE_LIST object into the children list. */
if (this->children_last_l)
child_l->prev_global= this->children_last_l;
@@ -657,7 +682,7 @@ CPP_UNNAMED_NS_END
@return A cloned handler instance.
*/
-handler *ha_myisammrg::clone(MEM_ROOT *mem_root)
+handler *ha_myisammrg::clone(const char *name, MEM_ROOT *mem_root)
{
MYRG_TABLE *u_table,*newu_table;
ha_myisammrg *new_handler=
@@ -678,8 +703,8 @@ handler *ha_myisammrg::clone(MEM_ROOT *mem_root)
return NULL;
}
- if (new_handler->ha_open(table, table->s->normalized_path.str, table->db_stat,
- HA_OPEN_IGNORE_IF_LOCKED))
+ if (new_handler->ha_open(table, name, table->db_stat,
+ HA_OPEN_IGNORE_IF_LOCKED))
{
delete new_handler;
return NULL;
@@ -1202,6 +1227,22 @@ ha_rows ha_myisammrg::records_in_range(uint inx, key_range *min_key,
}
+int ha_myisammrg::truncate()
+{
+ int err= 0;
+ MYRG_TABLE *table;
+ DBUG_ENTER("ha_myisammrg::truncate");
+
+ for (table= file->open_tables; table != file->end_table; table++)
+ {
+ if ((err= mi_delete_all_rows(table->table)))
+ break;
+ }
+
+ DBUG_RETURN(err);
+}
+
+
int ha_myisammrg::info(uint flag)
{
MYMERGE_INFO mrg_info;
diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h
index c434dc28426..14734eed064 100644
--- a/storage/myisammrg/ha_myisammrg.h
+++ b/storage/myisammrg/ha_myisammrg.h
@@ -110,7 +110,7 @@ public:
int add_children_list(void);
int attach_children(void);
int detach_children(void);
- virtual handler *clone(MEM_ROOT *mem_root);
+ virtual handler *clone(const char *name, MEM_ROOT *mem_root);
int close(void);
int write_row(uchar * buf);
int update_row(const uchar * old_data, uchar * new_data);
@@ -131,6 +131,7 @@ public:
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 truncate();
int info(uint);
int reset(void);
int extra(enum ha_extra_function operation);
diff --git a/storage/myisammrg/myrg_def.h b/storage/myisammrg/myrg_def.h
index b916243be21..9bc0881b212 100644
--- a/storage/myisammrg/myrg_def.h
+++ b/storage/myisammrg/myrg_def.h
@@ -23,9 +23,7 @@
extern LIST *myrg_open_list;
-#ifdef THREAD
extern mysql_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, uchar *buf);
diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c
index 156660d00c0..ab1d9ad7f7e 100644
--- a/storage/myisammrg/myrg_open.c
+++ b/storage/myisammrg/myrg_open.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -78,7 +78,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
{
if (!strncmp(buff+1,"INSERT_METHOD=",14))
{ /* Lookup insert method */
- int tmp=find_type(buff+15,&merge_insert_method,2);
+ int tmp= find_type(buff + 15, &merge_insert_method, FIND_TYPE_BASIC);
found_merge_insert_method = (uint) (tmp >= 0 ? tmp : 0);
}
continue; /* Skip comments */
@@ -222,7 +222,7 @@ MYRG_INFO *myrg_parent_open(const char *parent_name,
int (*callback)(void*, const char*),
void *callback_param)
{
- MYRG_INFO *m_info;
+ MYRG_INFO *UNINIT_VAR(m_info);
int rc;
int errpos;
int save_errno;
@@ -274,7 +274,7 @@ MYRG_INFO *myrg_parent_open(const char *parent_name,
{
/* Compare buffer with global methods list: merge_insert_method. */
insert_method= find_type(child_name_buff + 15,
- &merge_insert_method, 2);
+ &merge_insert_method, FIND_TYPE_BASIC);
}
continue;
}
diff --git a/storage/myisammrg/plug.in b/storage/myisammrg/plug.in
deleted file mode 100644
index 1f94e07d881..00000000000
--- a/storage/myisammrg/plug.in
+++ /dev/null
@@ -1,6 +0,0 @@
-MYSQL_STORAGE_ENGINE(myisammrg,no,[MyISAM MERGE Engine],
- [Merge multiple MySQL tables into one])
-MYSQL_PLUGIN_DIRECTORY(myisammrg,[storage/myisammrg])
-MYSQL_PLUGIN_STATIC(myisammrg, [libmyisammrg.a])
-MYSQL_PLUGIN_MANDATORY(myisammrg)
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(myisammrg, [ha_myisammrg.cc])
diff --git a/storage/ndb/Makefile.am b/storage/ndb/Makefile.am
index 0da8ec136c9..835b8c83fd8 100644
--- a/storage/ndb/Makefile.am
+++ b/storage/ndb/Makefile.am
@@ -35,7 +35,7 @@ dist-hook:
done
windoze:
- for i in `find . -name 'old_dirs' -prune -o -name 'Makefile.am' -print`; \
+ for i in `find . -name 'Makefile.am' -print`; \
do make -C `dirname $$i` windoze-dsp; done
windoze-dsp:
diff --git a/storage/ndb/config/make-win-dsw.sh b/storage/ndb/config/make-win-dsw.sh
index b0613620f8a..070a3665bc0 100755
--- a/storage/ndb/config/make-win-dsw.sh
+++ b/storage/ndb/config/make-win-dsw.sh
@@ -1,3 +1,17 @@
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
cat <<EOF
Microsoft Developer Studio Workspace File, Format Version 6.00
diff --git a/storage/ndb/config/win-includes b/storage/ndb/config/win-includes
index fa5984fd25e..0d6eec83ae7 100755
--- a/storage/ndb/config/win-includes
+++ b/storage/ndb/config/win-includes
@@ -1,5 +1,20 @@
#!/bin/sh
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
dst=$1
shift
diff --git a/storage/ndb/config/win-libraries b/storage/ndb/config/win-libraries
index c7a6fb696ee..bc9275f9a7b 100755
--- a/storage/ndb/config/win-libraries
+++ b/storage/ndb/config/win-libraries
@@ -1,5 +1,20 @@
#!/bin/sh
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
dst=$1
shift
diff --git a/storage/ndb/config/win-name b/storage/ndb/config/win-name
index 036f2b9cc2e..1ceb7019d3f 100755
--- a/storage/ndb/config/win-name
+++ b/storage/ndb/config/win-name
@@ -1,5 +1,20 @@
#!/bin/sh
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
dst=$1
shift
diff --git a/storage/ndb/config/win-sources b/storage/ndb/config/win-sources
index a383bb0e613..ccf0f6b7618 100755
--- a/storage/ndb/config/win-sources
+++ b/storage/ndb/config/win-sources
@@ -1,5 +1,20 @@
#!/bin/sh
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
dst=$1
shift
diff --git a/storage/ndb/docs/Makefile.am b/storage/ndb/docs/Makefile.am
index b0166d40779..a16fa1325c3 100644
--- a/storage/ndb/docs/Makefile.am
+++ b/storage/ndb/docs/Makefile.am
@@ -14,7 +14,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
DOXYDIR = doxygen
-noinst_HEADERS = $(DOXYDIR)/predoxy.pl $(DOXYDIR)/postdoxy.pl $(DOXYDIR)/Doxyfile.ndbapi $(DOXYDIR)/Doxyfile.mgmapi $(DOXYDIR)/header.ndbapi.tex $(DOXYDIR)/header.mgmapi.tex
+noinst_HEADERS = $(DOXYDIR)/predoxy.pl $(DOXYDIR)/postdoxy.pl $(DOXYDIR)/Doxyfile.ndbapi $(DOXYDIR)/Doxyfile.mgmapi
all-local: do-check-html ndbapidoc-html mgmapidoc-html
all-pdf: do-check-pdf ndbapidoc-pdf mgmapidoc-pdf
diff --git a/storage/ndb/docs/doxygen/Doxyfile.mgmapi b/storage/ndb/docs/doxygen/Doxyfile.mgmapi
index 1e743dcb60e..59090d9dd95 100644
--- a/storage/ndb/docs/doxygen/Doxyfile.mgmapi
+++ b/storage/ndb/docs/doxygen/Doxyfile.mgmapi
@@ -1,3 +1,18 @@
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
# Doxyfile 1.2.12
# This file describes the settings to be used by the documentation system
@@ -537,7 +552,7 @@ EXTRA_PACKAGES =
# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
-LATEX_HEADER = ../doxygen/header.mgmapi.tex
+LATEX_HEADER =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
diff --git a/storage/ndb/docs/doxygen/Doxyfile.ndb b/storage/ndb/docs/doxygen/Doxyfile.ndb
index 3986a7cd17f..96365c8868f 100644
--- a/storage/ndb/docs/doxygen/Doxyfile.ndb
+++ b/storage/ndb/docs/doxygen/Doxyfile.ndb
@@ -1,3 +1,18 @@
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
# Doxyfile 1.2.14
# This file describes the settings to be used by the documentation system
diff --git a/storage/ndb/docs/doxygen/Doxyfile.ndbapi b/storage/ndb/docs/doxygen/Doxyfile.ndbapi
index da610148468..fb41b58a89f 100644
--- a/storage/ndb/docs/doxygen/Doxyfile.ndbapi
+++ b/storage/ndb/docs/doxygen/Doxyfile.ndbapi
@@ -1,3 +1,18 @@
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
# Doxyfile 1.2.12
# This file describes the settings to be used by the documentation system
@@ -537,7 +552,7 @@ EXTRA_PACKAGES =
# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
-LATEX_HEADER = ../doxygen/header.ndbapi.tex
+LATEX_HEADER =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
diff --git a/storage/ndb/docs/doxygen/Doxyfile.odbc b/storage/ndb/docs/doxygen/Doxyfile.odbc
index 262513852b7..aa0d97ffdf7 100644
--- a/storage/ndb/docs/doxygen/Doxyfile.odbc
+++ b/storage/ndb/docs/doxygen/Doxyfile.odbc
@@ -1,3 +1,18 @@
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
# Doxyfile 1.2.14
# This file describes the settings to be used by the documentation system
diff --git a/storage/ndb/docs/doxygen/header.mgmapi.tex b/storage/ndb/docs/doxygen/header.mgmapi.tex
deleted file mode 100644
index 1b55ceb15c7..00000000000
--- a/storage/ndb/docs/doxygen/header.mgmapi.tex
+++ /dev/null
@@ -1,44 +0,0 @@
-\documentclass[a4paper]{book}
-\usepackage{a4wide}
-\usepackage{makeidx}
-\usepackage{fancyhdr}
-\usepackage{graphicx}
-\usepackage{multicol}
-\usepackage{float}
-\usepackage{textcomp}
-\usepackage{alltt}
-\usepackage{times}
-\ifx\pdfoutput\undefined
-\usepackage[ps2pdf,
- pagebackref=true,
- colorlinks=true,
- linkcolor=blue
- ]{hyperref}
-\usepackage{pspicture}
-\else
-\usepackage[pdftex,
- pagebackref=true,
- colorlinks=true,
- linkcolor=blue
- ]{hyperref}
-\fi
-\usepackage{doxygen}
-\makeindex
-\setcounter{tocdepth}{1}
-\renewcommand{\footrulewidth}{0.4pt}
-\begin{document}
-\begin{titlepage}
-\vspace*{7cm}
-\begin{center}
-{\Huge NDB Cluster MGM API Guide \mbox{}\vspace{-3cm}\mbox{}\hrule\bigskip\bigskip\bigskip\bigskip\mbox{}\Huge{}}\\\vspace*{1cm}
-\begin{center}\LARGE{MySQL AB}\end{center}\hfill\bigskip\bigskip\bigskip\hrule\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip NDB Cluster Release RELEASE
-\bigskip\bigskip\bigskip\bigskip\bigskip\hfill\vspace*{0.5cm}
-{\small DATE}\\
-\end{center}
-\end{titlepage}
-\clearemptydoublepage
-\pagenumbering{roman}
-\tableofcontents
-\clearemptydoublepage
-\pagenumbering{arabic}
-
diff --git a/storage/ndb/docs/doxygen/header.ndbapi.tex b/storage/ndb/docs/doxygen/header.ndbapi.tex
deleted file mode 100644
index c37ce286ed8..00000000000
--- a/storage/ndb/docs/doxygen/header.ndbapi.tex
+++ /dev/null
@@ -1,44 +0,0 @@
-\documentclass[a4paper]{book}
-\usepackage{a4wide}
-\usepackage{makeidx}
-\usepackage{fancyhdr}
-\usepackage{graphicx}
-\usepackage{multicol}
-\usepackage{float}
-\usepackage{textcomp}
-\usepackage{alltt}
-\usepackage{times}
-\ifx\pdfoutput\undefined
-\usepackage[ps2pdf,
- pagebackref=true,
- colorlinks=true,
- linkcolor=blue
- ]{hyperref}
-\usepackage{pspicture}
-\else
-\usepackage[pdftex,
- pagebackref=true,
- colorlinks=true,
- linkcolor=blue
- ]{hyperref}
-\fi
-\usepackage{doxygen}
-\makeindex
-\setcounter{tocdepth}{1}
-\renewcommand{\footrulewidth}{0.4pt}
-\begin{document}
-\begin{titlepage}
-\vspace*{7cm}
-\begin{center}
-{\Huge NDB API Programmer's Guide \mbox{}\vspace{-3cm}\mbox{}\hrule\bigskip\bigskip\bigskip\bigskip\mbox{}\Huge{}}\\\vspace*{1cm}
-\begin{center}\LARGE{MySQL AB}\end{center}\hfill\bigskip\bigskip\bigskip\hrule\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip\bigskip NDB Cluster Release RELEASE
-\bigskip\bigskip\bigskip\bigskip\bigskip\hfill\vspace*{0.5cm}
-{\small DATE}\\
-\end{center}
-\end{titlepage}
-\clearemptydoublepage
-\pagenumbering{roman}
-\tableofcontents
-\clearemptydoublepage
-\pagenumbering{arabic}
-
diff --git a/storage/ndb/docs/doxygen/postdoxy.pl b/storage/ndb/docs/doxygen/postdoxy.pl
index 3bf54e4ff75..a8eab31d47d 100755
--- a/storage/ndb/docs/doxygen/postdoxy.pl
+++ b/storage/ndb/docs/doxygen/postdoxy.pl
@@ -1,3 +1,18 @@
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
#
# Written by Lars Thalmann, lars@mysql.com, 2003.
#
diff --git a/storage/ndb/docs/doxygen/predoxy.pl b/storage/ndb/docs/doxygen/predoxy.pl
index 3994054dcf6..553052648af 100755
--- a/storage/ndb/docs/doxygen/predoxy.pl
+++ b/storage/ndb/docs/doxygen/predoxy.pl
@@ -1,3 +1,18 @@
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
#
# Written by Lars Thalmann, lars@mysql.com, 2003.
#
diff --git a/storage/ndb/ndb_configure.m4 b/storage/ndb/ndb_configure.m4
new file mode 100644
index 00000000000..21e4627515f
--- /dev/null
+++ b/storage/ndb/ndb_configure.m4
@@ -0,0 +1,349 @@
+dnl ---------------------------------------------------------------------------
+dnl Macro: MYSQL_CHECK_NDBCLUSTER
+dnl ---------------------------------------------------------------------------
+
+# The version of NDB in this version of MySQL is currently fixed
+# and not supposed to be changed unless major changes happen in
+# storage/ndb directory.
+# NOTE! To avoid mixup with MySQL Cluster's version numbers
+# this version of NDB is set to 5.5.7 although it's basically
+# a copy of MySQL Cluster 6.2.18
+NDB_VERSION_MAJOR=5
+NDB_VERSION_MINOR=5
+NDB_VERSION_BUILD=7
+NDB_VERSION_STATUS=""
+TEST_NDBCLUSTER=""
+
+dnl for build ndb docs
+
+AC_PATH_PROG(DOXYGEN, doxygen, no)
+AC_PATH_PROG(PDFLATEX, pdflatex, no)
+AC_PATH_PROG(MAKEINDEX, makeindex, no)
+
+AC_SUBST(DOXYGEN)
+AC_SUBST(PDFLATEX)
+AC_SUBST(MAKEINDEX)
+
+
+AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
+ AC_ARG_WITH([ndb-sci],
+ AC_HELP_STRING([--with-ndb-sci=DIR],
+ [Provide MySQL with a custom location of
+ sci library. Given DIR, sci library is
+ assumed to be in $DIR/lib and header files
+ in $DIR/include.]),
+ [mysql_sci_dir=${withval}],
+ [mysql_sci_dir=""])
+
+ case "$mysql_sci_dir" in
+ "no" )
+ have_ndb_sci=no
+ AC_MSG_RESULT([-- not including sci transporter])
+ ;;
+ * )
+ 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="$mysql_sci_dir/lib/libsisci.a"
+ AC_MSG_RESULT([-- including sci transporter])
+ AC_DEFINE([NDB_SCI_TRANSPORTER], [1],
+ [Including Ndb Cluster DB sci transporter])
+ AC_SUBST(NDB_SCI_INCLUDES)
+ AC_SUBST(NDB_SCI_LIBS)
+ have_ndb_sci="yes"
+ AC_MSG_RESULT([found sci transporter in $mysql_sci_dir/{include, lib}])
+ else
+ AC_MSG_RESULT([could not find sci transporter in $mysql_sci_dir/{include, lib}])
+ fi
+ ;;
+ esac
+
+ AC_ARG_WITH([ndb-test],
+ [
+ --with-ndb-test Include the NDB Cluster ndbapi test programs],
+ [ndb_test="$withval"],
+ [ndb_test=no])
+ AC_ARG_WITH([ndb-docs],
+ [
+ --with-ndb-docs Include the NDB Cluster ndbapi and mgmapi documentation],
+ [ndb_docs="$withval"],
+ [ndb_docs=no])
+ AC_ARG_WITH([ndb-port],
+ [
+ --with-ndb-port Port for NDB Cluster management server],
+ [ndb_port="$withval"],
+ [ndb_port="default"])
+ AC_ARG_WITH([ndb-port-base],
+ [
+ --with-ndb-port-base Base port for NDB Cluster transporters],
+ [ndb_port_base="$withval"],
+ [ndb_port_base="default"])
+ AC_ARG_WITH([ndb-debug],
+ [
+ --without-ndb-debug Disable special ndb debug features],
+ [ndb_debug="$withval"],
+ [ndb_debug="default"])
+ AC_ARG_WITH([ndb-ccflags],
+ AC_HELP_STRING([--with-ndb-ccflags=CFLAGS],
+ [Extra CFLAGS for ndb compile]),
+ [ndb_ccflags=${withval}],
+ [ndb_ccflags=""])
+ AC_ARG_WITH([ndb-binlog],
+ [
+ --without-ndb-binlog Disable ndb binlog],
+ [ndb_binlog="$withval"],
+ [ndb_binlog="default"])
+
+ case "$ndb_ccflags" in
+ "yes")
+ AC_MSG_RESULT([The --ndb-ccflags option requires a parameter (passed to CC for ndb compilation)])
+ ;;
+ *)
+ ndb_cxxflags_fix="$ndb_cxxflags_fix $ndb_ccflags"
+ ;;
+ esac
+
+ AC_MSG_CHECKING([for NDB Cluster options])
+ AC_MSG_RESULT([])
+
+ have_ndb_test=no
+ case "$ndb_test" in
+ yes )
+ AC_MSG_RESULT([-- including ndbapi test programs])
+ have_ndb_test="yes"
+ ;;
+ * )
+ AC_MSG_RESULT([-- not including ndbapi test programs])
+ ;;
+ esac
+
+ have_ndb_docs=no
+ case "$ndb_docs" in
+ yes )
+ AC_MSG_RESULT([-- including ndbapi and mgmapi documentation])
+ have_ndb_docs="yes"
+ ;;
+ * )
+ AC_MSG_RESULT([-- not including ndbapi and mgmapi documentation])
+ ;;
+ esac
+
+ case "$ndb_debug" in
+ yes )
+ AC_MSG_RESULT([-- including ndb extra debug options])
+ have_ndb_debug="yes"
+ ;;
+ full )
+ AC_MSG_RESULT([-- including ndb extra extra debug options])
+ have_ndb_debug="full"
+ ;;
+ no )
+ AC_MSG_RESULT([-- not including ndb extra debug options])
+ have_ndb_debug="no"
+ ;;
+ * )
+ have_ndb_debug="default"
+ ;;
+ esac
+
+ AC_MSG_RESULT([done.])
+])
+
+AC_DEFUN([NDBCLUSTER_WORKAROUNDS], [
+
+ #workaround for Sun Forte/x86 see BUG#4681
+ case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc in
+ *solaris*-i?86-no)
+ CFLAGS="$CFLAGS -DBIG_TABLES"
+ CXXFLAGS="$CXXFLAGS -DBIG_TABLES"
+ ;;
+ *)
+ ;;
+ esac
+
+ # workaround for Sun Forte compile problem for ndb
+ case $SYSTEM_TYPE-$ac_cv_prog_gcc in
+ *solaris*-no)
+ ndb_cxxflags_fix="$ndb_cxxflags_fix -instances=static"
+ ;;
+ *)
+ ;;
+ esac
+
+ # ndb fail for whatever strange reason to link Sun Forte/x86
+ # unless using incremental linker
+ case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc-$have_ndbcluster in
+ *solaris*-i?86-no-yes)
+ CXXFLAGS="$CXXFLAGS -xildon"
+ ;;
+ *)
+ ;;
+ esac
+])
+
+AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
+
+ AC_MSG_RESULT([Using NDB Cluster])
+ with_partition="yes"
+ ndb_cxxflags_fix=""
+ TEST_NDBCLUSTER="--ndbcluster"
+
+ ndbcluster_includes="-I\$(top_builddir)/storage/ndb/include -I\$(top_srcdir)/storage/ndb/include -I\$(top_srcdir)/storage/ndb/include/ndbapi -I\$(top_srcdir)/storage/ndb/include/mgmapi"
+ ndbcluster_libs="\$(top_builddir)/storage/ndb/src/.libs/libndbclient.a"
+ ndbcluster_system_libs=""
+ ndb_mgmclient_libs="\$(top_builddir)/storage/ndb/src/mgmclient/libndbmgmclient.la"
+
+ MYSQL_CHECK_NDB_OPTIONS
+ NDBCLUSTER_WORKAROUNDS
+
+ MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"
+
+ if test "$have_ndb_debug" = "default"
+ then
+ have_ndb_debug=$with_debug
+ fi
+
+ if test "$have_ndb_debug" = "yes"
+ then
+ # Medium debug.
+ NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
+ elif test "$have_ndb_debug" = "full"
+ then
+ NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
+ else
+ # no extra ndb debug but still do asserts if debug version
+ if test "$with_debug" = "yes"
+ then
+ NDB_DEFS=""
+ else
+ NDB_DEFS="-DNDEBUG"
+ fi
+ fi
+
+ if test X"$ndb_port" = Xdefault
+ then
+ ndb_port="1186"
+ fi
+
+ have_ndb_binlog="no"
+ if test X"$ndb_binlog" = Xdefault ||
+ test X"$ndb_binlog" = Xyes
+ then
+ have_ndb_binlog="yes"
+ fi
+
+ if test X"$have_ndb_binlog" = Xyes
+ then
+ AC_DEFINE([WITH_NDB_BINLOG], [1],
+ [Including Ndb Cluster Binlog])
+ AC_MSG_RESULT([Including Ndb Cluster Binlog])
+ else
+ AC_MSG_RESULT([Not including Ndb Cluster Binlog])
+ fi
+
+ ndb_transporter_opt_objs=""
+ if test "$ac_cv_func_shmget" = "yes" &&
+ test "$ac_cv_func_shmat" = "yes" &&
+ test "$ac_cv_func_shmdt" = "yes" &&
+ test "$ac_cv_func_shmctl" = "yes" &&
+ test "$ac_cv_func_sigaction" = "yes" &&
+ test "$ac_cv_func_sigemptyset" = "yes" &&
+ test "$ac_cv_func_sigaddset" = "yes" &&
+ test "$ac_cv_func_pthread_sigmask" = "yes"
+ then
+ AC_DEFINE([NDB_SHM_TRANSPORTER], [1],
+ [Including Ndb Cluster DB shared memory transporter])
+ AC_MSG_RESULT([Including ndb shared memory transporter])
+ ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo"
+ else
+ AC_MSG_RESULT([Not including ndb shared memory transporter])
+ fi
+
+ if test X"$have_ndb_sci" = Xyes
+ then
+ ndb_transporter_opt_objs="$ndb_transporter_opt_objs SCI_Transporter.lo"
+ fi
+
+ ndb_opt_subdirs=
+ ndb_bin_am_ldflags="-static"
+ if test X"$have_ndb_test" = Xyes
+ then
+ ndb_opt_subdirs="test"
+ ndb_bin_am_ldflags=""
+ fi
+
+ if test X"$have_ndb_docs" = Xyes
+ then
+ ndb_opt_subdirs="$ndb_opt_subdirs docs"
+ 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 GNU >/dev/null 2>&1 ; then
+ NDB_LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/storage/ndb/src/libndb.ver"
+ AC_CONFIG_FILES(storage/ndb/src/libndb.ver)
+ fi
+ AC_SUBST(NDB_LD_VERSION_SCRIPT)
+
+ AC_SUBST(NDB_SHARED_LIB_MAJOR_VERSION)
+ AC_SUBST(NDB_SHARED_LIB_VERSION)
+
+
+ AC_SUBST(NDB_VERSION_MAJOR)
+ AC_SUBST(NDB_VERSION_MINOR)
+ AC_SUBST(NDB_VERSION_BUILD)
+ AC_SUBST(NDB_VERSION_STATUS)
+ AC_DEFINE_UNQUOTED([NDB_VERSION_MAJOR], [$NDB_VERSION_MAJOR],
+ [NDB major version])
+ AC_DEFINE_UNQUOTED([NDB_VERSION_MINOR], [$NDB_VERSION_MINOR],
+ [NDB minor version])
+ AC_DEFINE_UNQUOTED([NDB_VERSION_BUILD], [$NDB_VERSION_BUILD],
+ [NDB build version])
+ AC_DEFINE_UNQUOTED([NDB_VERSION_STATUS], ["$NDB_VERSION_STATUS"],
+ [NDB status version])
+
+ AC_SUBST(ndbcluster_includes)
+ AC_SUBST(ndbcluster_libs)
+ AC_SUBST(ndbcluster_system_libs)
+ AC_SUBST(ndb_mgmclient_libs)
+ AC_SUBST(NDB_SCI_LIBS)
+
+ AC_SUBST(ndb_transporter_opt_objs)
+ AC_SUBST(ndb_port)
+ AC_SUBST(ndb_bin_am_ldflags)
+ AC_SUBST(ndb_opt_subdirs)
+
+ AC_SUBST(NDB_DEFS)
+ AC_SUBST(ndb_cxxflags_fix)
+
+ NDB_SIZEOF_CHARP="$ac_cv_sizeof_charp"
+ NDB_SIZEOF_CHAR="$ac_cv_sizeof_char"
+ NDB_SIZEOF_SHORT="$ac_cv_sizeof_short"
+ NDB_SIZEOF_INT="$ac_cv_sizeof_int"
+ NDB_SIZEOF_LONG="$ac_cv_sizeof_long"
+ NDB_SIZEOF_LONG_LONG="$ac_cv_sizeof_long_long"
+ AC_SUBST([NDB_SIZEOF_CHARP])
+ AC_SUBST([NDB_SIZEOF_CHAR])
+ AC_SUBST([NDB_SIZEOF_SHORT])
+ AC_SUBST([NDB_SIZEOF_INT])
+ AC_SUBST([NDB_SIZEOF_LONG])
+ AC_SUBST([NDB_SIZEOF_LONG_LONG])
+
+ AC_CONFIG_FILES([
+ storage/ndb/include/ndb_version.h
+ storage/ndb/include/ndb_global.h
+ storage/ndb/include/ndb_types.h
+ ])
+])
+
+AC_SUBST(TEST_NDBCLUSTER)
+dnl ---------------------------------------------------------------------------
+dnl END OF MYSQL_CHECK_NDBCLUSTER SECTION
+dnl ---------------------------------------------------------------------------
diff --git a/storage/ndb/plug.in b/storage/ndb/plug.in
index 3d3349f7a8b..04e618923e4 100644
--- a/storage/ndb/plug.in
+++ b/storage/ndb/plug.in
@@ -1,3 +1,5 @@
+sinclude(storage/ndb/ndb_configure.m4)
+
MYSQL_STORAGE_ENGINE(ndbcluster, ndbcluster, [Cluster Storage Engine],
[High Availability Clustered tables],)
MYSQL_PLUGIN_DIRECTORY(ndbcluster,[storage/ndb])
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/CPC_Form.cs b/storage/ndb/src/cw/cpcc-win32/csharp/CPC_Form.cs
index ea1798c8c67..b19875b97ef 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/CPC_Form.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/CPC_Form.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
using System;
using System.Drawing;
using System.Collections;
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/Computer.cs b/storage/ndb/src/cw/cpcc-win32/csharp/Computer.cs
index 9763fac5622..5ee35e5e90e 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/Computer.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/Computer.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
using System;
using System.Drawing;
using System.Collections;
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/ComputerAddDialog.cs b/storage/ndb/src/cw/cpcc-win32/csharp/ComputerAddDialog.cs
index c01e41f3e60..506cb6777f0 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/ComputerAddDialog.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/ComputerAddDialog.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
using System;
using System.Drawing;
using System.Collections;
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/ComputerRemoveDialog.cs b/storage/ndb/src/cw/cpcc-win32/csharp/ComputerRemoveDialog.cs
index 5b4d1b56df7..a126c632ffd 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/ComputerRemoveDialog.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/ComputerRemoveDialog.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
using System;
using System.Drawing;
using System.Collections;
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/Database.cs b/storage/ndb/src/cw/cpcc-win32/csharp/Database.cs
index 39b8c160159..80a8daee2d0 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/Database.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/Database.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
using System;
using System.Drawing;
using System.Collections;
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/PanelWizard.cs b/storage/ndb/src/cw/cpcc-win32/csharp/PanelWizard.cs
index f492aa64c60..a780190f86c 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/PanelWizard.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/PanelWizard.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
//author:Arun
//date:Nov 13,2002
//Wizard using panel
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/Process.cs b/storage/ndb/src/cw/cpcc-win32/csharp/Process.cs
index c1ee1b2fe9e..eac12d4868e 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/Process.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/Process.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
using System;
using System.Drawing;
using System.Collections;
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/ProcessDefineDialog.cs b/storage/ndb/src/cw/cpcc-win32/csharp/ProcessDefineDialog.cs
index 581b8383e7c..ab8d58ed11f 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/ProcessDefineDialog.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/ProcessDefineDialog.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
using System;
using System.Drawing;
using System.Collections;
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/fileaccess/FileMgmt.cs b/storage/ndb/src/cw/cpcc-win32/csharp/fileaccess/FileMgmt.cs
index b3a2361bcb0..41929c104d0 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/fileaccess/FileMgmt.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/fileaccess/FileMgmt.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
using System;
using System.Text;
using System.Collections.Specialized;
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/simpleparser/SimpleCPCParser.cs b/storage/ndb/src/cw/cpcc-win32/csharp/simpleparser/SimpleCPCParser.cs
index b8ff2844af9..6e070875b25 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/simpleparser/SimpleCPCParser.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/simpleparser/SimpleCPCParser.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
using System;
using System.Collections;
using System.IO;
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/socketcomm/SocketComm.cs b/storage/ndb/src/cw/cpcc-win32/csharp/socketcomm/SocketComm.cs
index 2cef5d34f17..9025f122994 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/socketcomm/SocketComm.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/socketcomm/SocketComm.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
using System;
using System.Net;
using System.Net.Sockets;
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/socketcomm/myTcpClient.cs b/storage/ndb/src/cw/cpcc-win32/csharp/socketcomm/myTcpClient.cs
index 9c0d82a0b27..25d0d9947d6 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/socketcomm/myTcpClient.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/socketcomm/myTcpClient.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
using System;
using System.Net;
using System.Net.Sockets;
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/startDatabaseDlg.cs b/storage/ndb/src/cw/cpcc-win32/csharp/startDatabaseDlg.cs
index cecfcaeb0f3..4261efc8a29 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/startDatabaseDlg.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/startDatabaseDlg.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
using System;
using System.Drawing;
using System.Collections;
diff --git a/storage/ndb/src/cw/cpcc-win32/csharp/telnetclient/telnetClient.cs b/storage/ndb/src/cw/cpcc-win32/csharp/telnetclient/telnetClient.cs
index a7966947e1f..5258ad290fc 100644
--- a/storage/ndb/src/cw/cpcc-win32/csharp/telnetclient/telnetClient.cs
+++ b/storage/ndb/src/cw/cpcc-win32/csharp/telnetclient/telnetClient.cs
@@ -1,3 +1,18 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
using System;
using System.Drawing;
using System.Collections;
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Computer.cls b/storage/ndb/src/cw/cpcc-win32/vb6/Computer.cls
deleted file mode 100644
index 5b42dfeadb6..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Computer.cls
+++ /dev/null
@@ -1,20 +0,0 @@
-VERSION 1.0 CLASS
-BEGIN
- MultiUse = -1 'True
- Persistable = 0 'NotPersistable
- DataBindingBehavior = 0 'vbNone
- DataSourceBehavior = 0 'vbNone
- MTSTransactionMode = 0 'NotAnMTSObject
-END
-Attribute VB_Name = "Computer"
-Attribute VB_GlobalNameSpace = False
-Attribute VB_Creatable = True
-Attribute VB_PredeclaredId = False
-Attribute VB_Exposed = False
-Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
-Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
-Public m_ip As String
-Public m_name As String
-Public m_status As String
-Public m_processes As Collection
-
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Database.cls b/storage/ndb/src/cw/cpcc-win32/vb6/Database.cls
deleted file mode 100644
index dfb1195d910..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Database.cls
+++ /dev/null
@@ -1,18 +0,0 @@
-VERSION 1.0 CLASS
-BEGIN
- MultiUse = -1 'True
- Persistable = 0 'NotPersistable
- DataBindingBehavior = 0 'vbNone
- DataSourceBehavior = 0 'vbNone
- MTSTransactionMode = 0 'NotAnMTSObject
-END
-Attribute VB_Name = "Database_"
-Attribute VB_GlobalNameSpace = False
-Attribute VB_Creatable = True
-Attribute VB_PredeclaredId = False
-Attribute VB_Exposed = False
-Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
-Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
-Public m_name As String
-Public m_processes As Collection
-Public m_status As String
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 110.ico b/storage/ndb/src/cw/cpcc-win32/vb6/Icon 110.ico
deleted file mode 100644
index 34b85992394..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 110.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 231.ico b/storage/ndb/src/cw/cpcc-win32/vb6/Icon 231.ico
deleted file mode 100644
index fe30ff5d1e6..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 231.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 237.ico b/storage/ndb/src/cw/cpcc-win32/vb6/Icon 237.ico
deleted file mode 100644
index af0a1294f9e..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 237.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 241.ico b/storage/ndb/src/cw/cpcc-win32/vb6/Icon 241.ico
deleted file mode 100644
index e8caf6e9a73..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 241.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 242.ico b/storage/ndb/src/cw/cpcc-win32/vb6/Icon 242.ico
deleted file mode 100644
index 2deff5472bc..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 242.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 270.ico b/storage/ndb/src/cw/cpcc-win32/vb6/Icon 270.ico
deleted file mode 100644
index 9cab239de23..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 270.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 271.ico b/storage/ndb/src/cw/cpcc-win32/vb6/Icon 271.ico
deleted file mode 100644
index f05c95f74fe..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 271.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 273.ico b/storage/ndb/src/cw/cpcc-win32/vb6/Icon 273.ico
deleted file mode 100644
index 800606eda0c..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 273.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 31.ico b/storage/ndb/src/cw/cpcc-win32/vb6/Icon 31.ico
deleted file mode 100644
index a2404977771..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 31.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 337.ico b/storage/ndb/src/cw/cpcc-win32/vb6/Icon 337.ico
deleted file mode 100644
index 9dadb12cfbe..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 337.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 338.ico b/storage/ndb/src/cw/cpcc-win32/vb6/Icon 338.ico
deleted file mode 100644
index a13c80c81b4..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 338.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 339.ico b/storage/ndb/src/cw/cpcc-win32/vb6/Icon 339.ico
deleted file mode 100644
index 5eb4c06815d..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Icon 339.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/MSSCCPRJ.SCC b/storage/ndb/src/cw/cpcc-win32/vb6/MSSCCPRJ.SCC
deleted file mode 100644
index 3100640f8bd..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/MSSCCPRJ.SCC
+++ /dev/null
@@ -1,5 +0,0 @@
-[SCC]
-SCC=This is a source code control file
-[NdbCPC.vbp]
-SCC_Project_Name=this project is not under source code control
-SCC_Aux_Path=<This is an empty string for the mssccprj.scc file>
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Module1.bas b/storage/ndb/src/cw/cpcc-win32/vb6/Module1.bas
deleted file mode 100644
index ae8ed444a41..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Module1.bas
+++ /dev/null
@@ -1,233 +0,0 @@
-Attribute VB_Name = "Module1"
-Option Explicit
-Public fMainForm As frmMain
-Public g_computers As New Collection
-Public g_databases As New Collection
-
-Sub Main()
- If False Then
- Dim fLogin As New frmLogin
- fLogin.Show vbModal
- If Not fLogin.OK Then
- 'Login Failed so exit app
- End
- End If
- Unload fLogin
-
- frmSplash.Show
- frmSplash.Refresh
- End If
-
- init
-
- Set fMainForm = New frmMain
- Load fMainForm
- Unload frmSplash
-
- fMainForm.Show
-End Sub
-
-Private Sub init()
- Dim c As Computer
- Dim p As Process
-
- ' ---
- ' One node configuration
- '
- Set c = New Computer
- With c
- .m_ip = "130.100.232.31"
- .m_name = "ndb-client31"
- .m_status = "Connected"
- Set .m_processes = New Collection
- End With
- addComputer c
-
- Set p = New Process
- With p
- .m_id = "1"
- .m_name = "mgm-1"
- .m_database = "elathal"
- .m_status = "Running"
- .m_owner = "elathal"
- Set .m_computer = c
- End With
- addProcess c, p
-
- Set p = New Process
- With p
- .m_id = "2"
- .m_name = "ndb-2"
- .m_database = "elathal"
- .m_status = "Running"
- .m_owner = "elathal"
- Set .m_computer = c
- End With
- addProcess c, p
-
- Set p = New Process
- With p
- .m_id = "3"
- .m_name = "api-3"
- .m_database = "elathal"
- .m_status = "Running"
- .m_owner = "elathal"
- Set .m_computer = c
- End With
- addProcess c, p
-
- ' ---
- ' Two node configuration
- '
- Set p = New Process
- With p
- .m_id = "4"
- .m_name = "mgm-1"
- .m_database = "ejonore-2-node"
- .m_status = "Running"
- .m_owner = "ejonore"
- Set .m_computer = c
- End With
- addProcess c, p
-
- Set c = New Computer
- With c
- .m_ip = "10.0.1.1"
- .m_name = "cluster-1"
- .m_status = "Connected"
- Set .m_processes = New Collection
- End With
- addComputer c
-
- Set p = New Process
- With p
- .m_id = "1"
- .m_name = "ndb-2"
- .m_database = "ejonore-2-node"
- .m_status = "Running"
- .m_owner = "ejonore"
- Set .m_computer = c
- End With
- addProcess c, p
-
- Set c = New Computer
- With c
- .m_ip = "10.0.2.1"
- .m_name = "cluster-2"
- .m_status = "Connected"
- Set .m_processes = New Collection
- End With
- addComputer c
-
- Set p = New Process
- With p
- .m_id = "1"
- .m_name = "ndb-3"
- .m_database = "ejonore-2-node"
- .m_status = "Running"
- .m_owner = "ejonore"
- Set .m_computer = c
- End With
- addProcess c, p
-
- Set c = New Computer
- With c
- .m_ip = "10.0.3.1"
- .m_name = "cluster-3"
- .m_status = "Connected"
- Set .m_processes = New Collection
- End With
- addComputer c
-
- Set p = New Process
- With p
- .m_id = "1"
- .m_name = "api-4"
- .m_database = "ejonore-2-node"
- .m_status = "Running"
- .m_owner = "ejonore"
- Set .m_computer = c
- End With
- addProcess c, p
-
- Set c = New Computer
- With c
- .m_ip = "10.0.4.1"
- .m_name = "cluster-4"
- .m_status = "Connected"
- Set .m_processes = New Collection
- End With
- addComputer c
-
- Set p = New Process
- With p
- .m_id = "1"
- .m_name = "api-5"
- .m_database = "ejonore-2-node"
- .m_status = "Running"
- .m_owner = "ejonore"
- Set .m_computer = c
- End With
- addProcess c, p
-
- Set c = New Computer
- With c
- .m_ip = "130.100.232.5"
- .m_name = "ndbs05"
- .m_status = "Not connected"
- Set .m_processes = New Collection
- End With
- addComputer c
-
- Set c = New Computer
- With c
- .m_ip = "130.100.232.7"
- .m_name = "ndb-srv7"
- .m_status = "No contact"
- Set .m_processes = New Collection
- End With
- addComputer c
-
-End Sub
-
-Public Sub addComputer(ByRef c As Computer)
- g_computers.Add c, "_" & c.m_name
-End Sub
-
-Private Sub addProcess(ByRef c As Computer, ByRef p As Process)
- c.m_processes.Add p, "_" & p.m_id
-
- Dim cl As Database_
- If Not Exists(g_databases, "_" & p.m_database) Then
- Set cl = New Database_
- With cl
- .m_name = p.m_database
- .m_status = "Unknown"
- Set .m_processes = New Collection
- End With
- g_databases.Add cl, "_" & p.m_database
- Else
- Set cl = g_databases("_" & p.m_database)
- End If
- cl.m_processes.Add p, "_" & p.m_computer.m_name & "_" & p.m_id
-End Sub
-
-Public Function Exists(ByRef c As Collection, ByVal k As String) As Boolean
- Dim r As Boolean
- Dim o As Object
-
- r = True
-
- On Error GoTo NotFound
- Set o = c.Item(k)
- GoTo Continue
-NotFound:
- If Err.Number <> 5 Then
- Err.Raise Err.Number, Err.Source, Err.Description
- End If
-
- r = False
-Continue:
- Exists = r
-End Function
-
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/NdbCPC.vbp b/storage/ndb/src/cw/cpcc-win32/vb6/NdbCPC.vbp
deleted file mode 100644
index dc8f3780a74..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/NdbCPC.vbp
+++ /dev/null
@@ -1,49 +0,0 @@
-Type=Exe
-Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; mscomctl.ocx
-Module=Module1; Module1.bas
-Form=frmMain.frm
-Form=frmSplash.frm
-Form=frmLogin.frm
-Form=frmOptions.frm
-Form=frmAbout.frm
-Class=Computer; Computer.cls
-Class=Process; Process.cls
-Class=Database_; Database.cls
-Form=frmNewComputer.frm
-Form=frmNewDatabase3.frm
-Form=frmNewDatabase1.frm
-Form=frmNewDatabase2.frm
-IconForm="frmAbout"
-Startup="Sub Main"
-HelpFile=""
-Title="NdbCPC"
-ExeName32="NdbCPC.exe"
-Command32=""
-Name="NdbCPC"
-HelpContextID="0"
-CompatibleMode="0"
-MajorVer=1
-MinorVer=0
-RevisionVer=0
-AutoIncrementVer=0
-ServerSupportFiles=0
-VersionCompanyName="ctp"
-CompilationType=0
-OptimizationType=0
-FavorPentiumPro(tm)=0
-CodeViewDebugInfo=0
-NoAliasing=0
-BoundsCheck=0
-OverflowCheck=0
-FlPointCheck=0
-FDIVCheck=0
-UnroundedFP=0
-StartMode=0
-Unattended=0
-Retained=0
-ThreadPerObject=0
-MaxNumberOfThreads=1
-DebugStartupOption=0
-
-[MS Transaction Server]
-AutoRefresh=1
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/NdbCPC.vbw b/storage/ndb/src/cw/cpcc-win32/vb6/NdbCPC.vbw
deleted file mode 100644
index 825abbc923a..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/NdbCPC.vbw
+++ /dev/null
@@ -1,13 +0,0 @@
-Module1 = 44, 44, 577, 492,
-frmMain = 44, 44, 577, 492, , 66, 66, 599, 514, C
-frmSplash = 132, 132, 670, 576, C, 88, 88, 621, 536, C
-frmLogin = 0, 0, 538, 444, C, 110, 110, 643, 558, C
-frmOptions = 176, 176, 714, 620, C, 132, 132, 665, 580, C
-frmAbout = 132, 132, 759, 511, C, 154, 154, 687, 602, C
-Computer = 110, 110, 648, 554,
-Process = 132, 132, 670, 576, C
-Database_ = 88, 88, 626, 532, C
-frmNewComputer = 44, 44, 582, 488, , 22, 22, 390, 218, C
-frmNewDatabase3 = 0, 0, 506, 444, , 0, 0, 506, 444, C
-frmNewDatabase1 = 132, 132, 638, 550, , 154, 154, 660, 572, C
-frmNewDatabase2 = 198, 198, 704, 616, , 176, 176, 682, 594, C
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/Process.cls b/storage/ndb/src/cw/cpcc-win32/vb6/Process.cls
deleted file mode 100644
index fcb4c2cbb2c..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/Process.cls
+++ /dev/null
@@ -1,22 +0,0 @@
-VERSION 1.0 CLASS
-BEGIN
- MultiUse = -1 'True
- Persistable = 0 'NotPersistable
- DataBindingBehavior = 0 'vbNone
- DataSourceBehavior = 0 'vbNone
- MTSTransactionMode = 0 'NotAnMTSObject
-END
-Attribute VB_Name = "Process"
-Attribute VB_GlobalNameSpace = False
-Attribute VB_Creatable = True
-Attribute VB_PredeclaredId = False
-Attribute VB_Exposed = False
-Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
-Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
-Public m_computer As Computer
-Public m_id As String
-Public m_name As String
-Public m_database As String
-Public m_status As String
-Public m_owner As String
-
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/closed folder.ico b/storage/ndb/src/cw/cpcc-win32/vb6/closed folder.ico
deleted file mode 100644
index fe82350d376..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/closed folder.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/computer.ico b/storage/ndb/src/cw/cpcc-win32/vb6/computer.ico
deleted file mode 100644
index d73302d1cd5..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/computer.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/frmAbout.frm b/storage/ndb/src/cw/cpcc-win32/vb6/frmAbout.frm
deleted file mode 100644
index b842d20de21..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/frmAbout.frm
+++ /dev/null
@@ -1,245 +0,0 @@
-VERSION 5.00
-Begin VB.Form frmAbout
- BorderStyle = 3 'Fixed Dialog
- Caption = "About NdbCPC"
- ClientHeight = 3630
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 5865
- ClipControls = 0 'False
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3630
- ScaleWidth = 5865
- ShowInTaskbar = 0 'False
- StartUpPosition = 1 'CenterOwner
- Tag = "About NdbCPC"
- Begin VB.PictureBox picIcon
- AutoSize = -1 'True
- BackColor = &H00C0C0C0&
- ClipControls = 0 'False
- Height = 540
- Left = 240
- Picture = "frmAbout.frx":0000
- ScaleHeight = 480
- ScaleMode = 0 'User
- ScaleWidth = 480
- TabIndex = 2
- TabStop = 0 'False
- Top = 240
- Width = 540
- End
- Begin VB.CommandButton cmdOK
- Cancel = -1 'True
- Caption = "OK"
- Default = -1 'True
- Height = 345
- Left = 4245
- TabIndex = 0
- Tag = "OK"
- Top = 2625
- Width = 1467
- End
- Begin VB.CommandButton cmdSysInfo
- Caption = "&System Info..."
- Height = 345
- Left = 4260
- TabIndex = 1
- Tag = "&System Info..."
- Top = 3075
- Width = 1452
- End
- Begin VB.Label lblDescription
- Caption = "App Description"
- ForeColor = &H00000000&
- Height = 1170
- Left = 1050
- TabIndex = 6
- Tag = "App Description"
- Top = 1125
- Width = 4092
- End
- Begin VB.Label lblTitle
- Caption = "Application Title"
- ForeColor = &H00000000&
- Height = 480
- Left = 1050
- TabIndex = 5
- Tag = "Application Title"
- Top = 240
- Width = 4092
- End
- Begin VB.Line Line1
- BorderColor = &H00808080&
- BorderStyle = 6 'Inside Solid
- Index = 1
- X1 = 225
- X2 = 5657
- Y1 = 2430
- Y2 = 2430
- End
- Begin VB.Line Line1
- BorderColor = &H00FFFFFF&
- BorderWidth = 2
- Index = 0
- X1 = 240
- X2 = 5657
- Y1 = 2445
- Y2 = 2445
- End
- Begin VB.Label lblVersion
- Caption = "Version"
- Height = 225
- Left = 1050
- TabIndex = 4
- Tag = "Version"
- Top = 780
- Width = 4092
- End
- Begin VB.Label lblDisclaimer
- Caption = "Warning: ..."
- ForeColor = &H00000000&
- Height = 825
- Left = 255
- TabIndex = 3
- Tag = "Warning: ..."
- Top = 2625
- Width = 3870
- End
-End
-Attribute VB_Name = "frmAbout"
-Attribute VB_GlobalNameSpace = False
-Attribute VB_Creatable = False
-Attribute VB_PredeclaredId = True
-Attribute VB_Exposed = False
-' Reg Key Security Options...
-Const KEY_ALL_ACCESS = &H2003F
-
-
-' Reg Key ROOT Types...
-Const HKEY_LOCAL_MACHINE = &H80000002
-Const ERROR_SUCCESS = 0
-Const REG_SZ = 1 ' Unicode nul terminated string
-Const REG_DWORD = 4 ' 32-bit number
-
-
-Const gREGKEYSYSINFOLOC = "SOFTWARE\Microsoft\Shared Tools Location"
-Const gREGVALSYSINFOLOC = "MSINFO"
-Const gREGKEYSYSINFO = "SOFTWARE\Microsoft\Shared Tools\MSINFO"
-Const gREGVALSYSINFO = "PATH"
-
-
-Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, ByRef phkResult As Long) As Long
-Private Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, ByRef lpType As Long, ByVal lpData As String, ByRef lpcbData As Long) As Long
-Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
-
-Private Sub Form_Load()
- lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
- lblTitle.Caption = App.Title
-End Sub
-
-
-
-Private Sub cmdSysInfo_Click()
- Call StartSysInfo
-End Sub
-
-
-Private Sub cmdOK_Click()
- Unload Me
-End Sub
-
-
-Public Sub StartSysInfo()
- On Error GoTo SysInfoErr
-
-
- Dim rc As Long
- Dim SysInfoPath As String
-
-
- ' Try To Get System Info Program Path\Name From Registry...
- If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then
- ' Try To Get System Info Program Path Only From Registry...
- ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
- ' Validate Existance Of Known 32 Bit File Version
- If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then
- SysInfoPath = SysInfoPath & "\MSINFO32.EXE"
-
-
- ' Error - File Can Not Be Found...
- Else
- GoTo SysInfoErr
- End If
- ' Error - Registry Entry Can Not Be Found...
- Else
- GoTo SysInfoErr
- End If
-
-
- Call Shell(SysInfoPath, vbNormalFocus)
-
-
- Exit Sub
-SysInfoErr:
- MsgBox "System Information Is Unavailable At This Time", vbOKOnly
-End Sub
-
-
-Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean
- Dim i As Long ' Loop Counter
- Dim rc As Long ' Return Code
- Dim hKey As Long ' Handle To An Open Registry Key
- Dim hDepth As Long '
- Dim KeyValType As Long ' Data Type Of A Registry Key
- Dim tmpVal As String ' Tempory Storage For A Registry Key Value
- Dim KeyValSize As Long ' Size Of Registry Key Variable
- '------------------------------------------------------------
- ' Open RegKey Under KeyRoot {HKEY_LOCAL_MACHINE...}
- '------------------------------------------------------------
- rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) ' Open Registry Key
-
-
- If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError ' Handle Error...
-
-
- tmpVal = String$(1024, 0) ' Allocate Variable Space
- KeyValSize = 1024 ' Mark Variable Size
-
-
- '------------------------------------------------------------
- ' Retrieve Registry Key Value...
- '------------------------------------------------------------
- rc = RegQueryValueEx(hKey, SubKeyRef, 0, KeyValType, tmpVal, KeyValSize) ' Get/Create Key Value
-
-
- If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError ' Handle Errors
-
-
- tmpVal = VBA.Left(tmpVal, InStr(tmpVal, VBA.Chr(0)) - 1)
- '------------------------------------------------------------
- ' Determine Key Value Type For Conversion...
- '------------------------------------------------------------
- Select Case KeyValType ' Search Data Types...
- Case REG_SZ ' String Registry Key Data Type
- KeyVal = tmpVal ' Copy String Value
- Case REG_DWORD ' Double Word Registry Key Data Type
- For i = Len(tmpVal) To 1 Step -1 ' Convert Each Bit
- KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1))) ' Build Value Char. By Char.
- Next
- KeyVal = Format$("&h" + KeyVal) ' Convert Double Word To String
- End Select
-
-
- GetKeyValue = True ' Return Success
- rc = RegCloseKey(hKey) ' Close Registry Key
- Exit Function ' Exit
-
-
-GetKeyError: ' Cleanup After An Error Has Occured...
- KeyVal = "" ' Set Return Val To Empty String
- GetKeyValue = False ' Return Failure
- rc = RegCloseKey(hKey) ' Close Registry Key
-End Function
-
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/frmLogin.frm b/storage/ndb/src/cw/cpcc-win32/vb6/frmLogin.frm
deleted file mode 100644
index d4d663c93c2..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/frmLogin.frm
+++ /dev/null
@@ -1,119 +0,0 @@
-VERSION 5.00
-Begin VB.Form frmLogin
- BorderStyle = 3 'Fixed Dialog
- Caption = "Login"
- ClientHeight = 1590
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 3750
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1590
- ScaleWidth = 3750
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 'CenterScreen
- Tag = "Login"
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 360
- Left = 2100
- TabIndex = 5
- Tag = "Cancel"
- Top = 1020
- Width = 1140
- End
- Begin VB.CommandButton cmdOK
- Caption = "OK"
- Default = -1 'True
- Height = 360
- Left = 495
- TabIndex = 4
- Tag = "OK"
- Top = 1020
- Width = 1140
- End
- Begin VB.TextBox txtPassword
- Height = 285
- IMEMode = 3 'DISABLE
- Left = 1305
- PasswordChar = "*"
- TabIndex = 1
- Top = 525
- Width = 2325
- End
- Begin VB.TextBox txtUserName
- Height = 285
- Left = 1305
- TabIndex = 3
- Top = 135
- Width = 2325
- End
- Begin VB.Label lblLabels
- Caption = "&Password:"
- Height = 248
- Index = 1
- Left = 105
- TabIndex = 0
- Tag = "&Password:"
- Top = 540
- Width = 1080
- End
- Begin VB.Label lblLabels
- Caption = "&User Name:"
- Height = 248
- Index = 0
- Left = 105
- TabIndex = 2
- Tag = "&User Name:"
- Top = 150
- Width = 1080
- End
-End
-Attribute VB_Name = "frmLogin"
-Attribute VB_GlobalNameSpace = False
-Attribute VB_Creatable = False
-Attribute VB_PredeclaredId = True
-Attribute VB_Exposed = False
-Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
-
-
-Public OK As Boolean
-Private Sub Form_Load()
- Dim sBuffer As String
- Dim lSize As Long
-
-
- sBuffer = Space$(255)
- lSize = Len(sBuffer)
- Call GetUserName(sBuffer, lSize)
- If lSize > 0 Then
- txtUserName.Text = Left$(sBuffer, lSize)
- Else
- txtUserName.Text = vbNullString
- End If
-End Sub
-
-
-
-Private Sub cmdCancel_Click()
- OK = False
- Me.Hide
-End Sub
-
-
-Private Sub cmdOK_Click()
- 'ToDo: create test for correct password
- 'check for correct password
- If txtPassword.Text = "" Then
- OK = True
- Me.Hide
- Else
- MsgBox "Invalid Password, try again!", , "Login"
- txtPassword.SetFocus
- txtPassword.SelStart = 0
- txtPassword.SelLength = Len(txtPassword.Text)
- End If
-End Sub
-
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/frmMain.frm b/storage/ndb/src/cw/cpcc-win32/vb6/frmMain.frm
deleted file mode 100644
index a4bf5b58941..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/frmMain.frm
+++ /dev/null
@@ -1,1207 +0,0 @@
-VERSION 5.00
-Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
-Begin VB.Form frmMain
- Caption = "NdbCPC"
- ClientHeight = 5955
- ClientLeft = 2115
- ClientTop = 2250
- ClientWidth = 8880
- LinkTopic = "Form1"
- ScaleHeight = 5955
- ScaleWidth = 8880
- Begin MSComctlLib.ImageList ImageList1
- Left = 6840
- Top = 3120
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = 16777215
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 11
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":0000
- Key = "close"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":27B4
- Key = "open"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":4F68
- Key = "computer_unknown"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":5284
- Key = "computer_stopped"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":55A0
- Key = "computer_started"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":58BC
- Key = ""
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":5BD8
- Key = ""
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":5EF4
- Key = ""
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":6210
- Key = "db"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":652A
- Key = "computer"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":6844
- Key = "properties"
- EndProperty
- EndProperty
- End
- Begin VB.PictureBox picSplitter
- BackColor = &H00808080&
- BorderStyle = 0 'None
- FillColor = &H00808080&
- Height = 4800
- Left = 5400
- ScaleHeight = 2090.126
- ScaleMode = 0 'User
- ScaleWidth = 780
- TabIndex = 6
- Top = 705
- Width = 72
- Visible = 0 'False
- End
- Begin MSComctlLib.TreeView tvTreeView
- Height = 4800
- Left = 0
- TabIndex = 5
- Top = 705
- Width = 2016
- _ExtentX = 3545
- _ExtentY = 8467
- _Version = 393217
- HideSelection = 0 'False
- Indentation = 0
- LineStyle = 1
- Sorted = -1 'True
- Style = 7
- FullRowSelect = -1 'True
- ImageList = "ImageList1"
- Appearance = 1
- End
- Begin VB.PictureBox picTitles
- Align = 1 'Align Top
- Appearance = 0 'Flat
- BorderStyle = 0 'None
- ForeColor = &H80000008&
- Height = 300
- Left = 0
- ScaleHeight = 300
- ScaleWidth = 8880
- TabIndex = 2
- TabStop = 0 'False
- Top = 420
- Width = 8880
- Begin VB.Label lblTitle
- BorderStyle = 1 'Fixed Single
- Caption = " ListView:"
- Height = 270
- Index = 1
- Left = 2078
- TabIndex = 4
- Tag = " ListView:"
- Top = 12
- Width = 3216
- End
- Begin VB.Label lblTitle
- BorderStyle = 1 'Fixed Single
- Caption = " TreeView:"
- Height = 270
- Index = 0
- Left = 0
- TabIndex = 3
- Tag = " TreeView:"
- Top = 12
- Width = 2016
- End
- End
- Begin MSComctlLib.Toolbar tbToolBar
- Align = 1 'Align Top
- Height = 420
- Left = 0
- TabIndex = 1
- Top = 0
- Width = 8880
- _ExtentX = 15663
- _ExtentY = 741
- ButtonWidth = 609
- ButtonHeight = 582
- Appearance = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 5
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "Add computer"
- Object.ToolTipText = "Add computer"
- ImageKey = "computer"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "New database"
- Object.ToolTipText = "New database"
- ImageKey = "db"
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "Properties"
- Object.ToolTipText = "Properties"
- ImageKey = "properties"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.StatusBar sbStatusBar
- Align = 2 'Align Bottom
- Height = 270
- Left = 0
- TabIndex = 0
- Top = 5685
- Width = 8880
- _ExtentX = 15663
- _ExtentY = 476
- _Version = 393216
- BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
- NumPanels = 3
- BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- AutoSize = 1
- Object.Width = 10028
- Text = "Status"
- TextSave = "Status"
- EndProperty
- BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Style = 6
- AutoSize = 2
- TextSave = "2002-10-15"
- EndProperty
- BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Style = 5
- AutoSize = 2
- TextSave = "09:44"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.ListView lvProcesses
- Height = 4815
- Left = 2040
- TabIndex = 8
- Top = 720
- Width = 3255
- _ExtentX = 5741
- _ExtentY = 8493
- Sorted = -1 'True
- MultiSelect = -1 'True
- LabelWrap = -1 'True
- HideSelection = 0 'False
- AllowReorder = -1 'True
- FullRowSelect = -1 'True
- _Version = 393217
- ForeColor = -2147483640
- BackColor = -2147483643
- BorderStyle = 1
- Appearance = 1
- NumItems = 6
- BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- Key = "Id"
- Text = "Id"
- Object.Width = 2540
- EndProperty
- BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- SubItemIndex = 1
- Key = "Computer"
- Text = "Computer"
- Object.Width = 2540
- EndProperty
- BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- SubItemIndex = 2
- Key = "Database"
- Text = "Database"
- Object.Width = 2540
- EndProperty
- BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- SubItemIndex = 3
- Key = "Name"
- Text = "Name"
- Object.Width = 2540
- EndProperty
- BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- SubItemIndex = 4
- Key = "Status"
- Text = "Status"
- Object.Width = 2540
- EndProperty
- BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- SubItemIndex = 5
- Key = "Owner"
- Text = "Owner"
- Object.Width = 2540
- EndProperty
- End
- Begin MSComctlLib.ListView lvComputers
- Height = 4815
- Left = 2040
- TabIndex = 7
- Top = 720
- Width = 3255
- _ExtentX = 5741
- _ExtentY = 8493
- Sorted = -1 'True
- MultiSelect = -1 'True
- LabelWrap = -1 'True
- HideSelection = -1 'True
- AllowReorder = -1 'True
- FullRowSelect = -1 'True
- _Version = 393217
- Icons = "ImageList1"
- SmallIcons = "ImageList1"
- ForeColor = -2147483640
- BackColor = -2147483643
- BorderStyle = 1
- Appearance = 1
- NumItems = 2
- BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- Text = "Computer"
- Object.Width = 2540
- EndProperty
- BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- SubItemIndex = 1
- Text = "Status"
- Object.Width = 2540
- EndProperty
- End
- Begin MSComctlLib.ListView lvDatabases
- Height = 4815
- Left = 2040
- TabIndex = 9
- Top = 720
- Width = 3255
- _ExtentX = 5741
- _ExtentY = 8493
- View = 3
- Sorted = -1 'True
- MultiSelect = -1 'True
- LabelWrap = -1 'True
- HideSelection = -1 'True
- AllowReorder = -1 'True
- FullRowSelect = -1 'True
- _Version = 393217
- Icons = "ImageList1"
- SmallIcons = "ImageList1"
- ForeColor = -2147483640
- BackColor = -2147483643
- BorderStyle = 1
- Appearance = 1
- NumItems = 2
- BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- Key = "Database"
- Text = "Database"
- Object.Width = 2540
- EndProperty
- BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
- SubItemIndex = 1
- Key = "Status"
- Text = "Status"
- Object.Width = 2540
- EndProperty
- End
- Begin VB.Image imgSplitter
- Height = 4788
- Left = 1965
- MousePointer = 9 'Size W E
- Top = 705
- Width = 150
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFileOpen
- Caption = "&Open..."
- End
- Begin VB.Menu mnuFileFind
- Caption = "&Find"
- End
- Begin VB.Menu mnuFileBar0
- Caption = "-"
- End
- Begin VB.Menu mnuFileSendTo
- Caption = "Sen&d to"
- End
- Begin VB.Menu mnuFileBar1
- Caption = "-"
- End
- Begin VB.Menu mnuFileNew
- Caption = "&New"
- Shortcut = ^N
- End
- Begin VB.Menu mnuFileBar2
- Caption = "-"
- End
- Begin VB.Menu mnuFileDelete
- Caption = "&Delete"
- End
- Begin VB.Menu mnuFileRename
- Caption = "Rena&me"
- End
- Begin VB.Menu mnuFileProperties
- Caption = "Propert&ies"
- End
- Begin VB.Menu mnuFileBar3
- Caption = "-"
- End
- Begin VB.Menu mnuFileMRU
- Caption = ""
- Index = 1
- Visible = 0 'False
- End
- Begin VB.Menu mnuFileMRU
- Caption = ""
- Index = 2
- Visible = 0 'False
- End
- Begin VB.Menu mnuFileMRU
- Caption = ""
- Index = 3
- Visible = 0 'False
- End
- Begin VB.Menu mnuFileBar4
- Caption = "-"
- Visible = 0 'False
- End
- Begin VB.Menu mnuFileBar5
- Caption = "-"
- End
- Begin VB.Menu mnuFileClose
- Caption = "&Close"
- End
- End
- Begin VB.Menu mnuEdit
- Caption = "&Edit"
- Begin VB.Menu mnuEditUndo
- Caption = "&Undo"
- End
- Begin VB.Menu mnuEditBar0
- Caption = "-"
- End
- Begin VB.Menu mnuEditCut
- Caption = "Cu&t"
- Shortcut = ^X
- End
- Begin VB.Menu mnuEditCopy
- Caption = "&Copy"
- Shortcut = ^C
- End
- Begin VB.Menu mnuEditPaste
- Caption = "&Paste"
- Shortcut = ^V
- End
- Begin VB.Menu mnuEditPasteSpecial
- Caption = "Paste &Special..."
- End
- Begin VB.Menu mnuEditBar1
- Caption = "-"
- End
- Begin VB.Menu mnuEditSelectAll
- Caption = "Select &All"
- Shortcut = ^A
- End
- Begin VB.Menu mnuEditInvertSelection
- Caption = "&Invert Selection"
- End
- End
- Begin VB.Menu mnuView
- Caption = "&View"
- Begin VB.Menu mnuViewToolbar
- Caption = "&Toolbar"
- Checked = -1 'True
- End
- Begin VB.Menu mnuViewStatusBar
- Caption = "Status &Bar"
- Checked = -1 'True
- End
- Begin VB.Menu mnuViewBar0
- Caption = "-"
- End
- Begin VB.Menu mnuListViewMode
- Caption = "Lar&ge Icons"
- Index = 0
- End
- Begin VB.Menu mnuListViewMode
- Caption = "S&mall Icons"
- Index = 1
- End
- Begin VB.Menu mnuListViewMode
- Caption = "&List"
- Index = 2
- End
- Begin VB.Menu mnuListViewMode
- Caption = "&Details"
- Index = 3
- End
- Begin VB.Menu mnuViewBar1
- Caption = "-"
- End
- Begin VB.Menu mnuViewArrangeIcons
- Caption = "Arrange &Icons"
- End
- Begin VB.Menu mnuViewBar2
- Caption = "-"
- End
- Begin VB.Menu mnuViewRefresh
- Caption = "&Refresh"
- End
- Begin VB.Menu mnuViewOptions
- Caption = "&Options..."
- End
- Begin VB.Menu mnuViewWebBrowser
- Caption = "&Web Browser"
- End
- End
- Begin VB.Menu mnuHelp
- Caption = "&Help"
- Begin VB.Menu mnuHelpContents
- Caption = "&Contents"
- End
- Begin VB.Menu mnuHelpSearchForHelpOn
- Caption = "&Search For Help On..."
- End
- Begin VB.Menu mnuHelpBar0
- Caption = "-"
- End
- Begin VB.Menu mnuHelpAbout
- Caption = "&About "
- End
- End
- Begin VB.Menu mnuPopComputers
- Caption = ""
- Visible = 0 'False
- Begin VB.Menu mnuPopAddComputer
- Caption = "Add computer"
- End
- Begin VB.Menu mnuPop__
- Caption = "-"
- End
- Begin VB.Menu mnuPopSortComputers
- Caption = "Sorted"
- End
- End
- Begin VB.Menu mnuPopDatabases
- Caption = ""
- Visible = 0 'False
- Begin VB.Menu mnuPopNewDatabase
- Caption = "New database"
- End
- Begin VB.Menu mnuPopSortDatabases0
- Caption = "-"
- End
- Begin VB.Menu mnuPopSortDatabases
- Caption = "Sorted"
- End
- End
- Begin VB.Menu mnuPopComputer
- Caption = ""
- Visible = 0 'False
- Begin VB.Menu mnuPopComputerName
- Caption = "ComputerName"
- Enabled = 0 'False
- End
- Begin VB.Menu mnuPopComputer0
- Caption = "-"
- End
- Begin VB.Menu mnuPopConnectComputer
- Caption = "Connect"
- End
- Begin VB.Menu mnuPopDisconnectComputer
- Caption = "Disconnect"
- End
- Begin VB.Menu mnuPopRemoveComputer
- Caption = "Remove"
- End
- Begin VB.Menu mnuComputer1
- Caption = "-"
- End
- Begin VB.Menu mnuPopComputerProperties
- Caption = "Properties"
- End
- End
-End
-Attribute VB_Name = "frmMain"
-Attribute VB_GlobalNameSpace = False
-Attribute VB_Creatable = False
-Attribute VB_PredeclaredId = True
-Attribute VB_Exposed = False
-Option Explicit
-Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
-
-Dim mbMoving As Boolean
-Const sglSplitLimit = 500
-Dim m_currentNode As MSComctlLib.Node
-Dim m_currentList As ListView
-
-Dim m_currentView As Integer
-Dim m_computerWidth As Integer
-Dim m_databaseWidth As Integer
-
-Dim m_currentComputer As Computer
-Dim m_currentDatabase As Database_
-
-Private Sub Form_Load()
- tvTreeView.Nodes.Clear
- lvComputers.ListItems.Clear
- lvProcesses.ListItems.Clear
- lvDatabases.ListItems.Clear
-
- Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000)
- Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000)
- Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 6500)
- Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500)
-
- tvTreeView.Nodes.Add , tvwChild, "Computers", "Computers", 1, 2
- Dim c As Computer
- For Each c In g_computers
- addComputer c
- Next
-
- Set m_currentNode = tvTreeView.Nodes("Computers")
- Set m_currentList = lvComputers
-
- tvTreeView.Nodes.Add , tvwChild, "Databases", "Databases", 1, 2
- Dim d As Database_
- For Each d In g_databases
- AddDatabase d
- Next
-
- lvComputers.Visible = True
- lvProcesses.Visible = False
- lvDatabases.Visible = False
- lvComputers.View = lvwReport
- lvProcesses.View = lvwReport
- lvDatabases.View = lvwReport
- m_computerWidth = lvProcesses.ColumnHeaders("Computer").Width
- m_databaseWidth = lvProcesses.ColumnHeaders("Database").Width
- lvProcesses.ColumnHeaders("Id").Width = 0
-End Sub
-
-Private Sub setComputer(ByVal f_ip As String)
- Dim c As Computer
- Set c = g_computers(f_ip)
- If c Is Nothing Then
- MsgBox "Unknown computer: " & f_ip
- Exit Sub
- End If
-
- Set m_currentComputer = c
-
- lblTitle(1).Caption = "Processes defined on computer: " & c.m_name
- setProcesses c.m_processes
-
- If lvProcesses.ColumnHeaders("Computer").Width <> 0 Then
- m_computerWidth = lvProcesses.ColumnHeaders("Computer").Width
- lvProcesses.ColumnHeaders("Computer").Width = 0
- End If
-
- If lvProcesses.ColumnHeaders("Database").Width = 0 Then
- lvProcesses.ColumnHeaders("Database").Width = m_databaseWidth
- End If
-End Sub
-
-Private Sub setDatabase(ByVal f_name As String)
- Dim c As Database_
- Set c = g_databases(f_name)
- If c Is Nothing Then
- MsgBox "Unknown database: " & f_name
- Exit Sub
- End If
-
- Set m_currentDatabase = c
-
- lblTitle(1).Caption = "Processes defined for database: " & c.m_name
- setProcesses c.m_processes
-
- If lvProcesses.ColumnHeaders("Database").Width <> 0 Then
- m_databaseWidth = lvProcesses.ColumnHeaders("Database").Width
- lvProcesses.ColumnHeaders("Database").Width = 0
- End If
-
- If lvProcesses.ColumnHeaders("Computer").Width = 0 Then
- lvProcesses.ColumnHeaders("Computer").Width = m_computerWidth
- End If
-
-End Sub
-
-Private Sub setProcesses(ByRef c As Collection)
- lvProcesses.ListItems.Clear
- Dim p As Process
- For Each p In c
- Dim li As ListItem
- Set li = lvProcesses.ListItems.Add(, "_" & p.m_computer.m_name & "_" & p.m_id, p.m_id)
- li.SubItems(1) = p.m_computer.m_name
- li.SubItems(2) = p.m_database
- li.SubItems(3) = p.m_name
- li.SubItems(4) = p.m_status
- li.SubItems(5) = p.m_owner
- Next
-End Sub
-
-Public Sub addComputer(ByRef c As Computer)
- Dim icon As Integer
- Select Case c.m_status
- Case "No contact"
- icon = 4
- Case "Connected"
- icon = 5
- Case Else
- icon = 3
- End Select
-
- Dim li As ListItem
- Set li = lvComputers.ListItems.Add(, "_" & c.m_name, c.m_name, icon, icon)
- li.SubItems(1) = c.m_status
-
- tvTreeView.Nodes.Add "Computers", tvwChild, "_" & c.m_name, c.m_name, icon, icon
-End Sub
-
-Public Sub removeComputer(ByRef name As String)
- lvComputers.ListItems.Remove "_" & name
- tvTreeView.Nodes.Remove "_" & name
-
- '
- ' Check if should remove database
- Dim c As Computer
- Set c = g_computers("_" & name)
- Dim db As Database_
- Dim dbs As New Collection
- Dim p As Process
- For Each p In c.m_processes
- Set db = g_databases("_" & p.m_database)
- db.m_processes.Remove "_" & p.m_computer.m_name & "_" & p.m_id
- If Not Exists(dbs, p.m_database) Then dbs.Add db, p.m_database
- Next
-
- For Each db In dbs
- If db.m_processes.Count = 0 Then
- g_databases.Remove "_" & db.m_name
- tvTreeView.Nodes.Remove "_" & db.m_name
- End If
- Next
-
- g_computers.Remove "_" & name
-
- '
- ' Check if should remove database
-
- Dim n As MSComctlLib.Node
- Set n = tvTreeView.SelectedItem
- selectNode n
-End Sub
-
-Private Sub AddDatabase(ByRef c As Database_)
- Dim li As ListItem
- Set li = lvDatabases.ListItems.Add(, "_" & c.m_name, c.m_name, 9, 9)
- li.SubItems(1) = c.m_status
- tvTreeView.Nodes.Add "Databases", tvwChild, "_" & c.m_name, c.m_name, 9, 9
-End Sub
-
-Private Sub Form_Unload(Cancel As Integer)
- Dim i As Integer
-
-
- 'close all sub forms
- For i = Forms.Count - 1 To 1 Step -1
- Unload Forms(i)
- Next
- If Me.WindowState <> vbMinimized Then
- SaveSetting App.Title, "Settings", "MainLeft", Me.Left
- SaveSetting App.Title, "Settings", "MainTop", Me.Top
- SaveSetting App.Title, "Settings", "MainWidth", Me.Width
- SaveSetting App.Title, "Settings", "MainHeight", Me.Height
- End If
-End Sub
-
-Private Sub Form_Resize()
- On Error Resume Next
- If Me.Width < 3000 Then Me.Width = 3000
- SizeControls imgSplitter.Left
-End Sub
-
-Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- With imgSplitter
- picSplitter.Move .Left, .Top, .Width \ 2, .Height - 20
- End With
- picSplitter.Visible = True
- mbMoving = True
-End Sub
-
-Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim sglPos As Single
-
-
- If mbMoving Then
- sglPos = X + imgSplitter.Left
- If sglPos < sglSplitLimit Then
- picSplitter.Left = sglSplitLimit
- ElseIf sglPos > Me.Width - sglSplitLimit Then
- picSplitter.Left = Me.Width - sglSplitLimit
- Else
- picSplitter.Left = sglPos
- End If
- End If
-End Sub
-
-
-Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- SizeControls picSplitter.Left
- picSplitter.Visible = False
- mbMoving = False
-End Sub
-
-
-Private Sub TreeView1_DragDrop(Source As Control, X As Single, Y As Single)
- If Source = imgSplitter Then
- SizeControls X
- End If
-End Sub
-
-
-Sub SizeControls(X As Single)
- On Error Resume Next
-
- 'set the width
- If X < 1500 Then X = 1500
- If X > (Me.Width - 1500) Then X = Me.Width - 1500
- tvTreeView.Width = X
- imgSplitter.Left = X
-
- Dim t_left, t_width As Integer
- t_left = X + 40
- t_width = Me.Width - (tvTreeView.Width + 140)
-
- lblTitle(0).Width = tvTreeView.Width
- lblTitle(1).Left = t_left + 20
- lblTitle(1).Width = t_width - 40
-
-
- 'set the top
- If tbToolBar.Visible Then
- tvTreeView.Top = tbToolBar.Height + picTitles.Height
- Else
- tvTreeView.Top = picTitles.Height
- End If
-
-
- 'set the height
- If sbStatusBar.Visible Then
- tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height + sbStatusBar.Height)
- Else
- tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
- End If
-
-
- imgSplitter.Top = tvTreeView.Top
- imgSplitter.Height = tvTreeView.Height
-
- setListDimensions t_left, t_width, tvTreeView.Top, tvTreeView.Height
-End Sub
-
-Private Sub setListView(ByVal f_View As Integer)
- lvComputers.View = f_View
- lvProcesses.View = f_View
-End Sub
-
-Private Sub setListDimensions(ByVal f_Left As Integer, ByVal f_Width As Integer, ByVal f_Top As Integer, ByVal f_Height As Integer)
- With lvComputers
- .Left = f_Left
- .Width = f_Width
- .Top = f_Top
- .Height = f_Height
- End With
- With lvProcesses
- .Left = f_Left
- .Width = f_Width
- .Top = f_Top
- .Height = f_Height
- End With
- With lvDatabases
- .Left = f_Left
- .Width = f_Width
- .Top = f_Top
- .Height = f_Height
- End With
-End Sub
-
-Private Sub tbToolBar_ButtonClick(ByVal Button As MSComctlLib.Button)
- On Error Resume Next
- Select Case Button.Key
- Case "New database"
- 'ToDo: Add 'Back' button code.
- mnuPopNewDatabase_Click
- Case "Add computer"
- 'ToDo: Add 'Forward' button code.
- frmNewComputer.Show vbModal, Me
- Dim c As Computer
- For Each c In frmNewComputer.m_hosts
- addComputer c
- g_computers.Add c, "_" & c.m_name
- Next
- Case "Properties"
- mnuFileProperties_Click
- End Select
-End Sub
-
-Private Sub mnuHelpAbout_Click()
- frmAbout.Show vbModal, Me
-End Sub
-
-Private Sub mnuHelpSearchForHelpOn_Click()
- Dim nRet As Integer
-
-
- 'if there is no helpfile for this project display a message to the user
- 'you can set the HelpFile for your application in the
- 'Project Properties dialog
- If Len(App.HelpFile) = 0 Then
- MsgBox "Unable to display Help Contents. There is no Help associated with this project.", vbInformation, Me.Caption
- Else
- On Error Resume Next
- nRet = OSWinHelp(Me.hwnd, App.HelpFile, 261, 0)
- If Err Then
- MsgBox Err.Description
- End If
- End If
-
-End Sub
-
-Private Sub mnuHelpContents_Click()
- Dim nRet As Integer
-
-
- 'if there is no helpfile for this project display a message to the user
- 'you can set the HelpFile for your application in the
- 'Project Properties dialog
- If Len(App.HelpFile) = 0 Then
- MsgBox "Unable to display Help Contents. There is no Help associated with this project.", vbInformation, Me.Caption
- Else
- On Error Resume Next
- nRet = OSWinHelp(Me.hwnd, App.HelpFile, 3, 0)
- If Err Then
- MsgBox Err.Description
- End If
- End If
-
-End Sub
-
-
-Private Sub mnuViewWebBrowser_Click()
- 'ToDo: Add 'mnuViewWebBrowser_Click' code.
- MsgBox "Add 'mnuViewWebBrowser_Click' code."
-End Sub
-
-Private Sub mnuViewOptions_Click()
- frmOptions.Show vbModal, Me
-End Sub
-
-Private Sub mnuViewRefresh_Click()
- 'ToDo: Add 'mnuViewRefresh_Click' code.
- MsgBox "Add 'mnuViewRefresh_Click' code."
-End Sub
-
-
-Private Sub mnuViewStatusBar_Click()
- mnuViewStatusBar.Checked = Not mnuViewStatusBar.Checked
- sbStatusBar.Visible = mnuViewStatusBar.Checked
- SizeControls imgSplitter.Left
-End Sub
-
-Private Sub mnuViewToolbar_Click()
- mnuViewToolbar.Checked = Not mnuViewToolbar.Checked
- tbToolBar.Visible = mnuViewToolbar.Checked
- SizeControls imgSplitter.Left
-End Sub
-
-Private Sub mnuEditInvertSelection_Click()
- 'ToDo: Add 'mnuEditInvertSelection_Click' code.
- MsgBox "Add 'mnuEditInvertSelection_Click' code."
-End Sub
-
-Private Sub mnuEditSelectAll_Click()
- 'ToDo: Add 'mnuEditSelectAll_Click' code.
- MsgBox "Add 'mnuEditSelectAll_Click' code."
-End Sub
-
-Private Sub mnuEditPasteSpecial_Click()
- 'ToDo: Add 'mnuEditPasteSpecial_Click' code.
- MsgBox "Add 'mnuEditPasteSpecial_Click' code."
-End Sub
-
-Private Sub mnuEditPaste_Click()
- 'ToDo: Add 'mnuEditPaste_Click' code.
- MsgBox "Add 'mnuEditPaste_Click' code."
-End Sub
-
-Private Sub mnuEditCopy_Click()
- 'ToDo: Add 'mnuEditCopy_Click' code.
- MsgBox "Add 'mnuEditCopy_Click' code."
-End Sub
-
-Private Sub mnuEditCut_Click()
- 'ToDo: Add 'mnuEditCut_Click' code.
- MsgBox "Add 'mnuEditCut_Click' code."
-End Sub
-
-Private Sub mnuEditUndo_Click()
- 'ToDo: Add 'mnuEditUndo_Click' code.
- MsgBox "Add 'mnuEditUndo_Click' code."
-End Sub
-
-Private Sub mnuFileClose_Click()
- 'unload the form
- Unload Me
-
-End Sub
-
-Private Sub mnuFileProperties_Click()
- 'ToDo: Add 'mnuFileProperties_Click' code.
- MsgBox "Add 'mnuFileProperties_Click' code."
-End Sub
-
-Private Sub mnuFileRename_Click()
- 'ToDo: Add 'mnuFileRename_Click' code.
- MsgBox "Add 'mnuFileRename_Click' code."
-End Sub
-
-Private Sub mnuFileDelete_Click()
- 'ToDo: Add 'mnuFileDelete_Click' code.
- MsgBox "Add 'mnuFileDelete_Click' code."
-End Sub
-
-Private Sub mnuFileNew_Click()
- 'ToDo: Add 'mnuFileNew_Click' code.
- MsgBox "Add 'mnuFileNew_Click' code."
-End Sub
-
-Private Sub mnuFileSendTo_Click()
- 'ToDo: Add 'mnuFileSendTo_Click' code.
- MsgBox "Add 'mnuFileSendTo_Click' code."
-End Sub
-
-Private Sub mnuFileFind_Click()
- 'ToDo: Add 'mnuFileFind_Click' code.
- MsgBox "Add 'mnuFileFind_Click' code."
-End Sub
-
-Private Sub mnuFileOpen_Click()
- Dim sFile As String
-End Sub
-
-Private Sub mnuPopComputerProperties_Click()
- mnuFileProperties_Click
-End Sub
-
-Private Sub mnuPopNewDatabase_Click()
- frmNewDatabase1.Show vbModal, Me
- frmNewDatabase2.Show vbModal, Me
- frmNewDatabase3.Show vbModal, Me
-End Sub
-
-Private Sub mnuPopAddComputer_Click()
- frmNewComputer.Show vbModal, Me
- Dim c As Computer
- For Each c In frmNewComputer.m_hosts
- addComputer c
- g_computers.Add c, "_" & c.m_name
- Next
-End Sub
-
-Private Sub mnuPopSortComputers_Click()
- If m_currentNode.Sorted = True Then
- mnuPopSortComputers.Checked = False
- m_currentNode.Sorted = False
- Else
- mnuPopSortComputers.Checked = True
- m_currentNode.Sorted = True
- End If
-End Sub
-
-Private Sub mnuPopRemoveComputer_Click()
- Dim res As VbMsgBoxResult
- Dim str As String
- str = "Remove computer " & m_currentComputer.m_name
- res = MsgBox(str, vbOKCancel, str)
- If res = vbOK Then
- removeComputer (m_currentComputer.m_name)
- End If
-End Sub
-
-Private Sub mnuPopSortDatabases_Click()
- If m_currentNode.Sorted = True Then
- mnuPopSortDatabases.Checked = False
- m_currentNode.Sorted = False
- Else
- mnuPopSortDatabases.Checked = True
- m_currentNode.Sorted = True
- End If
-End Sub
-
-Private Sub tvTreeView_BeforeLabelEdit(Cancel As Integer)
- Cancel = True
-End Sub
-
-Private Sub tvTreeView_Collapse(ByVal Node As MSComctlLib.Node)
- 'MsgBox "tvTreeView_Collapse"
-End Sub
-
-Private Sub tvTreeView_Expand(ByVal Node As MSComctlLib.Node)
- 'MsgBox "tvTreeView_Expand"
-End Sub
-
-Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
- selectNode Node
-End Sub
-
-Private Sub tvTreeView_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- 'MsgBox "tvTreeView_MouseUp Button: " & Button & " Shift: " & Shift
- Dim Node As MSComctlLib.Node
- Dim place As Integer
-
- Set Node = tvTreeView.HitTest(X, Y)
- place = selectNode(Node)
- If Button = vbRightButton Then
- ShowPopup place
- End If
-End Sub
-
-Private Function selectNode(ByRef n As MSComctlLib.Node) As Integer
- Dim list As ListView
- Dim place As Integer
-
- If n Is Nothing Then
- If Not m_currentNode Is Nothing Then
- place = 1
- m_currentNode.Selected = False
- Else
- place = 2
- End If
- Else
- n.Selected = True
- If n.Text = "Computers" Then
- place = 3
- Set list = lvComputers
- lblTitle(1).Caption = "Computers"
- ElseIf n.Text = "Databases" Then
- place = 4
- Set list = lvDatabases
- lblTitle(1).Caption = "Databases"
- ElseIf n.Parent.Text = "Computers" Then
- place = 5
- Set list = lvProcesses
- setComputer (n.Key)
- ElseIf n.Parent.Text = "Databases" Then
- place = 6
- Set list = lvProcesses
- setDatabase (n.Key)
- End If
-
- If m_currentList.hwnd <> list.hwnd Then
- m_currentList.Visible = False
- list.Visible = True
- Set m_currentList = list
- End If
- End If
- Set m_currentNode = n
- selectNode = place
-End Function
-
-Private Sub lvComputers_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim li As ListItem
- Set li = lvComputers.HitTest(X, Y)
- If Button = vbRightButton And Not li Is Nothing Then
- Dim c As Computer
- Set m_currentComputer = g_computers(li.Key)
- ShowPopup 5
- End If
-End Sub
-
-Private Sub ShowPopup(ByVal place As Integer)
- Select Case place
- Case 3
- PopupMenu mnuPopComputers
- Case 4
- PopupMenu mnuPopDatabases
- Case 5
- mnuPopComputerName.Caption = m_currentComputer.m_name & ": " & m_currentComputer.m_status
- Select Case m_currentComputer.m_status
- Case "Connected"
- mnuPopConnectComputer.Enabled = False
- mnuPopDisconnectComputer.Enabled = True
- Case "Connecting"
- mnuPopConnectComputer.Enabled = False
- mnuPopDisconnectComputer.Enabled = True
- Case "Not connected"
- mnuPopConnectComputer.Enabled = True
- mnuPopDisconnectComputer.Enabled = False
- Case "No contact"
- mnuPopConnectComputer.Enabled = True
- mnuPopDisconnectComputer.Enabled = False
- Case Else
- mnuPopConnectComputer.Enabled = False
- mnuPopDisconnectComputer.Enabled = False
- End Select
-
- PopupMenu mnuPopComputer, , , , mnuPopComputerName
- End Select
-End Sub
-
-Private Sub lvComputers_BeforeLabelEdit(Cancel As Integer)
- Cancel = True
-End Sub
-
-Private Sub lvProcesses_BeforeLabelEdit(Cancel As Integer)
- Cancel = True
-End Sub
-
-Private Sub lvDatabases_BeforeLabelEdit(Cancel As Integer)
- Cancel = True
-End Sub
-
-Private Sub ColumnClick(ByRef list As ListView, i As Integer)
- i = i - 1
- If list.SortKey = i Then
- list.SortOrder = 1 - list.SortOrder
- Else
- list.SortKey = i
- End If
-End Sub
-
-Private Sub lvComputers_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
- ColumnClick lvComputers, ColumnHeader.Index
-End Sub
-
-Private Sub lvProcesses_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
- ColumnClick lvProcesses, ColumnHeader.Index
-End Sub
-
-Private Sub lvDatabases_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
- ColumnClick lvDatabases, ColumnHeader.Index
-End Sub
-
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewComputer.frm b/storage/ndb/src/cw/cpcc-win32/vb6/frmNewComputer.frm
deleted file mode 100644
index eae5802493c..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewComputer.frm
+++ /dev/null
@@ -1,124 +0,0 @@
-VERSION 5.00
-Begin VB.Form frmNewComputer
- Caption = "Add computer"
- ClientHeight = 1545
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 4605
- LinkTopic = "Form1"
- ScaleHeight = 1545
- ScaleWidth = 4605
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command3
- Caption = "Apply"
- Default = -1 'True
- Height = 360
- Left = 3240
- TabIndex = 4
- Tag = "OK"
- Top = 840
- Width = 1140
- End
- Begin VB.CommandButton Command2
- Caption = "Cancel"
- Height = 360
- Left = 1920
- TabIndex = 3
- Tag = "OK"
- Top = 840
- Width = 1140
- End
- Begin VB.CommandButton Command1
- Caption = "OK"
- Height = 360
- Left = 600
- TabIndex = 2
- Tag = "OK"
- Top = 840
- Width = 1140
- End
- Begin VB.TextBox Text1
- Height = 285
- Left = 1440
- TabIndex = 1
- Top = 240
- Width = 2925
- End
- Begin VB.Label lblLabels
- Caption = "Computer name:"
- Height = 255
- Index = 1
- Left = 120
- TabIndex = 0
- Tag = "&User Name:"
- Top = 240
- Width = 1440
- End
-End
-Attribute VB_Name = "frmNewComputer"
-Attribute VB_GlobalNameSpace = False
-Attribute VB_Creatable = False
-Attribute VB_PredeclaredId = True
-Attribute VB_Exposed = False
-Public m_hosts As New Collection
-
-Private Sub Form_Load()
- If m_hosts.Count > 0 Then
- For i = m_hosts.Count To 1 Step -1
- m_hosts.Remove i
- Next
- End If
-End Sub
-
-Private Sub Command1_Click()
- If Text1.Text = "" Then
- MsgBox "Invalid hostname"
- Exit Sub
- End If
-
- If Exists(g_computers, "_" & Text1.Text) Then
- MsgBox Text1.Text & " already exists"
- Exit Sub
- End If
-
- Dim c As New Computer
- With c
- .m_ip = ""
- .m_name = Text1.Text
- .m_status = "Not connected"
- Set .m_processes = New Collection
- End With
-
- m_hosts.Add c
-
- Unload Me
-End Sub
-
-Private Sub Command2_Click()
- Unload Me
-End Sub
-
-Private Sub Command3_Click()
- If Text1.Text = "" Then
- MsgBox "Invalid hostname"
- Exit Sub
- End If
-
- If Exists(g_computers, "_" & Text1.Text) Then
- MsgBox Text1.Text & " already exists"
- Exit Sub
- End If
-
- Dim c As New Computer
- With c
- .m_ip = ""
- .m_name = Text1.Text
- .m_status = "Not connected"
- Set .m_processes = New Collection
- End With
-
- m_hosts.Add c
-
- Text1.Text = ""
-End Sub
-
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewComputer.frx b/storage/ndb/src/cw/cpcc-win32/vb6/frmNewComputer.frx
deleted file mode 100644
index 593f4708db8..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewComputer.frx
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase.frx b/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase.frx
deleted file mode 100644
index b20c2b651ae..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase.frx
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase1.frm b/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase1.frm
deleted file mode 100644
index 3fa1fd4c4e8..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase1.frm
+++ /dev/null
@@ -1,187 +0,0 @@
-VERSION 5.00
-Begin VB.Form frmNewDatabase1
- BorderStyle = 5 'Sizable ToolWindow
- Caption = "Nodes"
- ClientHeight = 3000
- ClientLeft = 2850
- ClientTop = 3450
- ClientWidth = 6240
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3281.25
- ScaleMode = 0 'User
- ScaleWidth = 6359.712
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 'CenterScreen
- Begin VB.TextBox textApiNodes
- Height = 285
- Left = 2760
- TabIndex = 12
- Text = "4"
- Top = 1665
- Width = 375
- End
- Begin VB.VScrollBar VScroll1
- Height = 255
- Left = 3240
- TabIndex = 11
- Top = 1680
- Width = 135
- End
- Begin VB.OptionButton Option4
- Alignment = 1 'Right Justify
- Caption = "1"
- Height = 375
- Left = 2760
- TabIndex = 10
- Top = 1020
- Width = 375
- End
- Begin VB.OptionButton Option3
- Alignment = 1 'Right Justify
- Caption = "4"
- Height = 375
- Left = 3960
- TabIndex = 9
- Top = 360
- Width = 375
- End
- Begin VB.OptionButton Option2
- Alignment = 1 'Right Justify
- Caption = "2"
- Height = 375
- Left = 3360
- TabIndex = 8
- Top = 360
- Width = 375
- End
- Begin VB.OptionButton Option1
- Alignment = 1 'Right Justify
- Caption = "1"
- Height = 375
- Left = 2760
- TabIndex = 7
- Top = 360
- Value = -1 'True
- Width = 375
- End
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 305
- Left = 1320
- TabIndex = 3
- Top = 2400
- Width = 1140
- End
- Begin VB.CommandButton cmdFinish
- Caption = "Finish"
- Enabled = 0 'False
- Height = 305
- Left = 5040
- TabIndex = 2
- Top = 2400
- Width = 1140
- End
- Begin VB.CommandButton cmdBack
- Caption = "Back"
- Default = -1 'True
- Enabled = 0 'False
- Height = 305
- Left = 2640
- TabIndex = 0
- Top = 2400
- Width = 1140
- End
- Begin VB.CommandButton cmdNext
- Caption = "Next"
- Height = 305
- Left = 3720
- TabIndex = 1
- Top = 2400
- Width = 1140
- End
- Begin VB.Label Label3
- Caption = "No of api nodes"
- Height = 255
- Left = 240
- TabIndex = 6
- Top = 1680
- Width = 2415
- End
- Begin VB.Label Label2
- Caption = "No of management nodes"
- Height = 255
- Left = 240
- TabIndex = 5
- Top = 1080
- Width = 2415
- End
- Begin VB.Label Label1
- Caption = "No of database nodes"
- Height = 255
- Left = 240
- TabIndex = 4
- Top = 420
- Width = 2415
- End
- Begin VB.Line Line1
- BorderColor = &H80000003&
- X1 = 122.302
- X2 = 6237.41
- Y1 = 2493.75
- Y2 = 2493.75
- End
-End
-Attribute VB_Name = "frmNewDatabase1"
-Attribute VB_GlobalNameSpace = False
-Attribute VB_Creatable = False
-Attribute VB_PredeclaredId = True
-Attribute VB_Exposed = False
-Option Explicit
-
-Private Sub Form_Resize()
- If Me.Width < 6375 Then Me.Width = 6375
- cmdCancel.Left = Me.ScaleWidth - 5136 + 400
- cmdBack.Left = Me.ScaleWidth - 3897 + 400
- cmdNext.Left = Me.ScaleWidth - 2883 + 400
- cmdFinish.Left = Me.ScaleWidth - 1643 + 400
- Line1.X2 = Me.ScaleWidth - 480 + 400
-
- cmdCancel.Top = Me.ScaleHeight - 375
- cmdBack.Top = Me.ScaleHeight - 375
- cmdNext.Top = Me.ScaleHeight - 375
- cmdFinish.Top = Me.ScaleHeight - 375
- Line1.Y1 = Me.ScaleHeight - 475
- Line1.Y2 = Me.ScaleHeight - 475
-End Sub
-
-Private Sub cmdCancel_Click()
- 'set the global var to false
- 'to denote a failed login
- Unload Me
-End Sub
-
-Private Sub Option1_Click()
- Option2.Value = False
- Option3.Value = False
-End Sub
-
-Private Sub Option2_Click()
- Option1.Value = False
- Option3.Value = False
-End Sub
-
-Private Sub Option3_Click()
- Option1.Value = False
- Option2.Value = False
-End Sub
-
-Private Sub Option4_Click()
- Option4.Value = True
-End Sub
-
-Private Sub textApiNodes_Validate(Cancel As Boolean)
- 'If Not isnumber(textApiNodes.Text) Then Cancel = False
-End Sub
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase2.frm b/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase2.frm
deleted file mode 100644
index 49806a695ea..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase2.frm
+++ /dev/null
@@ -1,136 +0,0 @@
-VERSION 5.00
-Begin VB.Form frmNewDatabase2
- BorderStyle = 5 'Sizable ToolWindow
- Caption = "Computers"
- ClientHeight = 2895
- ClientLeft = 2850
- ClientTop = 3450
- ClientWidth = 6240
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3166.406
- ScaleMode = 0 'User
- ScaleWidth = 6359.712
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 'CenterScreen
- Begin VB.ComboBox Combo1
- Height = 315
- Left = 2400
- TabIndex = 7
- Text = "Combo1"
- Top = 360
- Width = 1455
- End
- Begin VB.VScrollBar VScroll2
- Height = 255
- Left = 4560
- TabIndex = 6
- Top = 375
- Width = 135
- End
- Begin VB.TextBox Text1
- Height = 285
- Left = 4080
- TabIndex = 5
- Text = "4"
- Top = 360
- Width = 375
- End
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 305
- Left = 1320
- TabIndex = 3
- Top = 2400
- Width = 1140
- End
- Begin VB.CommandButton cmdFinish
- Caption = "Finish"
- Enabled = 0 'False
- Height = 305
- Left = 5040
- TabIndex = 2
- Top = 2400
- Width = 1140
- End
- Begin VB.CommandButton cmdBack
- Caption = "Back"
- Default = -1 'True
- Enabled = 0 'False
- Height = 305
- Left = 2640
- TabIndex = 0
- Top = 2400
- Width = 1140
- End
- Begin VB.CommandButton cmdNext
- Caption = "Next"
- Height = 305
- Left = 3720
- TabIndex = 1
- Top = 2400
- Width = 1140
- End
- Begin VB.Label Label5
- Caption = "Computer"
- Height = 255
- Left = 2400
- TabIndex = 9
- Top = 0
- Width = 975
- End
- Begin VB.Label Label4
- Caption = "Node id"
- Height = 255
- Left = 4080
- TabIndex = 8
- Top = 120
- Width = 615
- End
- Begin VB.Label Label1
- Caption = "Database node 1"
- Height = 255
- Left = 240
- TabIndex = 4
- Top = 420
- Width = 2415
- End
- Begin VB.Line Line1
- BorderColor = &H80000003&
- X1 = 122.302
- X2 = 6237.41
- Y1 = 2493.75
- Y2 = 2493.75
- End
-End
-Attribute VB_Name = "frmNewDatabase2"
-Attribute VB_GlobalNameSpace = False
-Attribute VB_Creatable = False
-Attribute VB_PredeclaredId = True
-Attribute VB_Exposed = False
-Option Explicit
-
-Private Sub Form_Resize()
- If Me.Width < 6375 Then Me.Width = 6375
- cmdCancel.Left = Me.ScaleWidth - 5136 + 400
- cmdBack.Left = Me.ScaleWidth - 3897 + 400
- cmdNext.Left = Me.ScaleWidth - 2883 + 400
- cmdFinish.Left = Me.ScaleWidth - 1643 + 400
- Line1.X2 = Me.ScaleWidth - 480 + 400
-
- cmdCancel.Top = Me.ScaleHeight - 375
- cmdBack.Top = Me.ScaleHeight - 375
- cmdNext.Top = Me.ScaleHeight - 375
- cmdFinish.Top = Me.ScaleHeight - 375
- Line1.Y1 = Me.ScaleHeight - 475
- Line1.Y2 = Me.ScaleHeight - 475
-End Sub
-
-Private Sub cmdCancel_Click()
- 'set the global var to false
- 'to denote a failed login
- Unload Me
-End Sub
-
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase2.log b/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase2.log
deleted file mode 100644
index 808b21866e5..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase2.log
+++ /dev/null
@@ -1 +0,0 @@
-Line 2: The Form or MDIForm name frmNewDatabase1 is already in use; cannot load this form.
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase3.frm b/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase3.frm
deleted file mode 100644
index ba050a58a09..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/frmNewDatabase3.frm
+++ /dev/null
@@ -1,88 +0,0 @@
-VERSION 5.00
-Begin VB.Form frmNewDatabase3
- BorderStyle = 5 'Sizable ToolWindow
- Caption = "Database configuration"
- ClientHeight = 3000
- ClientLeft = 2850
- ClientTop = 3450
- ClientWidth = 6240
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3281.25
- ScaleMode = 0 'User
- ScaleWidth = 6359.712
- ShowInTaskbar = 0 'False
- StartUpPosition = 2 'CenterScreen
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 305
- Left = 1320
- TabIndex = 3
- Top = 2400
- Width = 1140
- End
- Begin VB.CommandButton cmdFinish
- Caption = "Finish"
- Enabled = 0 'False
- Height = 305
- Left = 5040
- TabIndex = 2
- Top = 2400
- Width = 1140
- End
- Begin VB.CommandButton cmdBack
- Caption = "Back"
- Default = -1 'True
- Enabled = 0 'False
- Height = 305
- Left = 2640
- TabIndex = 0
- Top = 2400
- Width = 1140
- End
- Begin VB.CommandButton cmdNext
- Caption = "Next"
- Height = 305
- Left = 3720
- TabIndex = 1
- Top = 2400
- Width = 1140
- End
- Begin VB.Line Line1
- BorderColor = &H80000003&
- X1 = 122.302
- X2 = 6237.41
- Y1 = 2493.75
- Y2 = 2493.75
- End
-End
-Attribute VB_Name = "frmNewDatabase3"
-Attribute VB_GlobalNameSpace = False
-Attribute VB_Creatable = False
-Attribute VB_PredeclaredId = True
-Attribute VB_Exposed = False
-Option Explicit
-
-Private Sub Form_Resize()
- If Me.Width < 6375 Then Me.Width = 6375
- cmdCancel.Left = Me.ScaleWidth - 5136 + 400
- cmdBack.Left = Me.ScaleWidth - 3897 + 400
- cmdNext.Left = Me.ScaleWidth - 2883 + 400
- cmdFinish.Left = Me.ScaleWidth - 1643 + 400
- Line1.X2 = Me.ScaleWidth - 480 + 400
-
- cmdCancel.Top = Me.ScaleHeight - 375
- cmdBack.Top = Me.ScaleHeight - 375
- cmdNext.Top = Me.ScaleHeight - 375
- cmdFinish.Top = Me.ScaleHeight - 375
- Line1.Y1 = Me.ScaleHeight - 475
- Line1.Y2 = Me.ScaleHeight - 475
-End Sub
-
-Private Sub cmdCancel_Click()
- 'set the global var to false
- 'to denote a failed login
- Unload Me
-End Sub
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/frmOptions.frm b/storage/ndb/src/cw/cpcc-win32/vb6/frmOptions.frm
deleted file mode 100644
index e526a35b3ec..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/frmOptions.frm
+++ /dev/null
@@ -1,231 +0,0 @@
-VERSION 5.00
-Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
-Begin VB.Form frmOptions
- BorderStyle = 3 'Fixed Dialog
- Caption = "Options"
- ClientHeight = 5040
- ClientLeft = 6600
- ClientTop = 4575
- ClientWidth = 6150
- KeyPreview = -1 'True
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5040
- ScaleWidth = 6150
- ShowInTaskbar = 0 'False
- Tag = "Options"
- Begin VB.CommandButton cmdOK
- Caption = "OK"
- Height = 375
- Left = 2490
- TabIndex = 1
- Tag = "OK"
- Top = 4455
- Width = 1095
- End
- Begin VB.CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 375
- Left = 3720
- TabIndex = 3
- Tag = "Cancel"
- Top = 4455
- Width = 1095
- End
- Begin VB.CommandButton cmdApply
- Caption = "&Apply"
- Height = 375
- Left = 4920
- TabIndex = 5
- Tag = "&Apply"
- Top = 4455
- Width = 1095
- End
- Begin VB.PictureBox picOptions
- BorderStyle = 0 'None
- Height = 3780
- Index = 3
- Left = -20000
- ScaleHeight = 3840.968
- ScaleMode = 0 'User
- ScaleWidth = 5745.64
- TabIndex = 7
- TabStop = 0 'False
- Top = 480
- Width = 5685
- Begin VB.Frame fraSample4
- Caption = "Sample 4"
- Height = 2022
- Left = 505
- TabIndex = 11
- Tag = "Sample 4"
- Top = 502
- Width = 2033
- End
- End
- Begin VB.PictureBox picOptions
- BorderStyle = 0 'None
- Height = 3780
- Index = 2
- Left = -20000
- ScaleHeight = 3840.968
- ScaleMode = 0 'User
- ScaleWidth = 5745.64
- TabIndex = 9
- TabStop = 0 'False
- Top = 480
- Width = 5685
- Begin VB.Frame fraSample3
- Caption = "Sample 3"
- Height = 2022
- Left = 406
- TabIndex = 10
- Tag = "Sample 3"
- Top = 403
- Width = 2033
- End
- End
- Begin VB.PictureBox picOptions
- BorderStyle = 0 'None
- Height = 3780
- Index = 1
- Left = -20000
- ScaleHeight = 3840.968
- ScaleMode = 0 'User
- ScaleWidth = 5745.64
- TabIndex = 6
- TabStop = 0 'False
- Top = 480
- Width = 5685
- Begin VB.Frame fraSample2
- Caption = "Sample 2"
- Height = 2022
- Left = 307
- TabIndex = 8
- Tag = "Sample 2"
- Top = 305
- Width = 2033
- End
- End
- Begin VB.PictureBox picOptions
- BorderStyle = 0 'None
- Height = 3780
- Index = 0
- Left = 210
- ScaleHeight = 3840.968
- ScaleMode = 0 'User
- ScaleWidth = 5745.64
- TabIndex = 2
- TabStop = 0 'False
- Top = 480
- Width = 5685
- Begin VB.Frame fraSample1
- Caption = "Sample 1"
- Height = 2022
- Left = 208
- TabIndex = 4
- Tag = "Sample 1"
- Top = 207
- Width = 2033
- End
- End
- Begin MSComctlLib.TabStrip tbsOptions
- Height = 4245
- Left = 105
- TabIndex = 0
- Top = 120
- Width = 5895
- _ExtentX = 10398
- _ExtentY = 7488
- _Version = 393216
- BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
- NumTabs = 4
- BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
- Caption = "Group 1"
- ImageVarType = 2
- EndProperty
- BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
- Caption = "Group 2"
- ImageVarType = 2
- EndProperty
- BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628}
- Caption = "Group 3"
- ImageVarType = 2
- EndProperty
- BeginProperty Tab4 {1EFB659A-857C-11D1-B16A-00C0F0283628}
- Caption = "Group 4"
- ImageVarType = 2
- EndProperty
- EndProperty
- End
-End
-Attribute VB_Name = "frmOptions"
-Attribute VB_GlobalNameSpace = False
-Attribute VB_Creatable = False
-Attribute VB_PredeclaredId = True
-Attribute VB_Exposed = False
-Private Sub cmdApply_Click()
- 'ToDo: Add 'cmdApply_Click' code.
- MsgBox "Apply Code goes here to set options w/o closing dialog!"
-End Sub
-
-
-Private Sub cmdCancel_Click()
- Unload Me
-End Sub
-
-
-Private Sub cmdOK_Click()
- 'ToDo: Add 'cmdOK_Click' code.
- MsgBox "Code goes here to set options and close dialog!"
- Unload Me
-End Sub
-
-
-Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
- Dim i As Integer
- i = tbsOptions.SelectedItem.Index
- 'handle ctrl+tab to move to the next tab
- If (Shift And 3) = 2 And KeyCode = vbKeyTab Then
- If i = tbsOptions.Tabs.Count Then
- 'last tab so we need to wrap to tab 1
- Set tbsOptions.SelectedItem = tbsOptions.Tabs(1)
- Else
- 'increment the tab
- Set tbsOptions.SelectedItem = tbsOptions.Tabs(i + 1)
- End If
- ElseIf (Shift And 3) = 3 And KeyCode = vbKeyTab Then
- If i = 1 Then
- 'last tab so we need to wrap to tab 1
- Set tbsOptions.SelectedItem = tbsOptions.Tabs(tbsOptions.Tabs.Count)
- Else
- 'increment the tab
- Set tbsOptions.SelectedItem = tbsOptions.Tabs(i - 1)
- End If
- End If
-End Sub
-
-
-
-
-Private Sub tbsOptions_Click()
-
-
- Dim i As Integer
- 'show and enable the selected tab's controls
- 'and hide and disable all others
- For i = 0 To tbsOptions.Tabs.Count - 1
- If i = tbsOptions.SelectedItem.Index - 1 Then
- picOptions(i).Left = 210
- picOptions(i).Enabled = True
- Else
- picOptions(i).Left = -20000
- picOptions(i).Enabled = False
- End If
- Next
-
-
-End Sub
-
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/frmSplash.frx b/storage/ndb/src/cw/cpcc-win32/vb6/frmSplash.frx
deleted file mode 100644
index fee0c5c59de..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/frmSplash.frx
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/networking.ico b/storage/ndb/src/cw/cpcc-win32/vb6/networking.ico
deleted file mode 100644
index 6bbf8022fc6..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/networking.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/cw/cpcc-win32/vb6/open folder.ico b/storage/ndb/src/cw/cpcc-win32/vb6/open folder.ico
deleted file mode 100644
index 7bb32cc83d3..00000000000
--- a/storage/ndb/src/cw/cpcc-win32/vb6/open folder.ico
+++ /dev/null
Binary files differ
diff --git a/storage/ndb/src/kernel/blocks/lgman.cpp b/storage/ndb/src/kernel/blocks/lgman.cpp
index 53cb1e113e1..7dc71e7399a 100644
--- a/storage/ndb/src/kernel/blocks/lgman.cpp
+++ b/storage/ndb/src/kernel/blocks/lgman.cpp
@@ -1,17 +1,19 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
- 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 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
+ 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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA */
#include "lgman.hpp"
#include "diskpage.hpp"
@@ -2501,7 +2503,7 @@ Lgman::init_run_undo_log(Signal* signal)
sendSignal(reference(), GSN_CONTINUEB, signal, 2, JBB);
/**
- * Insert in correct postion in list of logfile_group's
+ * Insert in correct position in list of logfile_group's
*/
Ptr<Logfile_group> pos;
for(tmp.first(pos); !pos.isNull(); tmp.next(pos))
diff --git a/storage/ndb/src/libndb.ver.in b/storage/ndb/src/libndb.ver.in
index 72bf93d196f..c7b97876d44 100644
--- a/storage/ndb/src/libndb.ver.in
+++ b/storage/ndb/src/libndb.ver.in
@@ -1,2 +1,17 @@
+# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
libndbclient_@NDB_SHARED_LIB_MAJOR_VERSION@ { global: *; };
diff --git a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
index 560a9559999..7493e5e9c89 100644
--- a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
+++ b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
@@ -702,7 +702,7 @@ load_defaults(Vector<struct my_option>& options, const char* groups[])
BaseString group_suffix;
const char *save_file = my_defaults_file;
- char *save_extra_file = my_defaults_extra_file;
+ const char *save_extra_file = my_defaults_extra_file;
const char *save_group_suffix = my_defaults_group_suffix;
if (my_defaults_file)
diff --git a/storage/ndb/test/ndbapi/slow_select.cpp b/storage/ndb/test/ndbapi/slow_select.cpp
index 8d615fa5771..21e3ce7400c 100644
--- a/storage/ndb/test/ndbapi/slow_select.cpp
+++ b/storage/ndb/test/ndbapi/slow_select.cpp
@@ -1,3 +1,17 @@
+/* Copyright (C) 2004, 2005 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include <NdbApi.hpp>
diff --git a/storage/ndb/test/ndbapi/testBitfield.cpp b/storage/ndb/test/ndbapi/testBitfield.cpp
index 41bb7b4622c..27ee870705f 100644
--- a/storage/ndb/test/ndbapi/testBitfield.cpp
+++ b/storage/ndb/test/ndbapi/testBitfield.cpp
@@ -1,3 +1,17 @@
+/* Copyright (C) 2004, 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include <ndb_opts.h>
diff --git a/storage/ndb/test/ndbapi/testLcp.cpp b/storage/ndb/test/ndbapi/testLcp.cpp
index 69789b0191f..d8bf1611dfb 100644
--- a/storage/ndb/test/ndbapi/testLcp.cpp
+++ b/storage/ndb/test/ndbapi/testLcp.cpp
@@ -1,3 +1,17 @@
+/* Copyright (C) 2004, 2005 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <NDBT.hpp>
#include <NdbApi.hpp>
diff --git a/storage/ndb/test/ndbnet/test.run b/storage/ndb/test/ndbnet/test.run
index 30042488c92..195a657aeb5 100644
--- a/storage/ndb/test/ndbnet/test.run
+++ b/storage/ndb/test/ndbnet/test.run
@@ -1,3 +1,18 @@
+# Copyright (C) 2004 MySQL AB
#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
system("printenv|sort");
diff --git a/storage/ndb/test/ndbnet/testError.run b/storage/ndb/test/ndbnet/testError.run
index 3cce489a3da..6ace2cbbd20 100644
--- a/storage/ndb/test/ndbnet/testError.run
+++ b/storage/ndb/test/ndbnet/testError.run
@@ -1,3 +1,20 @@
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
#
# file : test/ndbnet/testError.run
# usage: perl testError.run
diff --git a/storage/ndb/test/ndbnet/testMNF.run b/storage/ndb/test/ndbnet/testMNF.run
index df226cd3359..2903313f306 100644
--- a/storage/ndb/test/ndbnet/testMNF.run
+++ b/storage/ndb/test/ndbnet/testMNF.run
@@ -1,3 +1,20 @@
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
#
# file : test/ndbnet/testError.run
# usage: perl testError.run
diff --git a/storage/ndb/test/ndbnet/testNR.run b/storage/ndb/test/ndbnet/testNR.run
index 01a3d76266d..5019f597b42 100644
--- a/storage/ndb/test/ndbnet/testNR.run
+++ b/storage/ndb/test/ndbnet/testNR.run
@@ -1,4 +1,19 @@
+# Copyright (C) 2004 MySQL AB
#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
use strict;
use NDB::Run;
diff --git a/storage/ndb/test/ndbnet/testNR1.run b/storage/ndb/test/ndbnet/testNR1.run
index 8819a92c8ca..a02b487b663 100644
--- a/storage/ndb/test/ndbnet/testNR1.run
+++ b/storage/ndb/test/ndbnet/testNR1.run
@@ -1,3 +1,20 @@
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
# Node recovery killing 1 node out of 4 at the time and waiting for recover
use strict;
diff --git a/storage/ndb/test/ndbnet/testNR4.run b/storage/ndb/test/ndbnet/testNR4.run
index f7a5eef3494..378d2743145 100644
--- a/storage/ndb/test/ndbnet/testNR4.run
+++ b/storage/ndb/test/ndbnet/testNR4.run
@@ -1,3 +1,20 @@
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
# Node recovery killing 1 node out of 4 at the time and waiting for recover
use strict;
diff --git a/storage/ndb/test/ndbnet/testSRhang.run b/storage/ndb/test/ndbnet/testSRhang.run
index 8cb65a75ded..570ed897eef 100644
--- a/storage/ndb/test/ndbnet/testSRhang.run
+++ b/storage/ndb/test/ndbnet/testSRhang.run
@@ -1,4 +1,19 @@
+# Copyright (C) 2004 MySQL AB
#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
use strict;
use NDB::Run;
diff --git a/storage/ndb/test/ndbnet/testTR295.run b/storage/ndb/test/ndbnet/testTR295.run
index ce4250b60ae..df26000cbda 100644
--- a/storage/ndb/test/ndbnet/testTR295.run
+++ b/storage/ndb/test/ndbnet/testTR295.run
@@ -1,3 +1,20 @@
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
# testing TR295, kill non-master when recovering in phase 4
use strict;
diff --git a/storage/ndb/test/run-test/16node-tests.txt b/storage/ndb/test/run-test/16node-tests.txt
index 11ade56c28c..21dd67c9b4b 100644
--- a/storage/ndb/test/run-test/16node-tests.txt
+++ b/storage/ndb/test/run-test/16node-tests.txt
@@ -1,3 +1,18 @@
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
# BASIC FUNCTIONALITY
max-time: 500
cmd: testBasic
diff --git a/storage/ndb/test/run-test/atrt-analyze-result.sh b/storage/ndb/test/run-test/atrt-analyze-result.sh
index 0fa46e918ef..9a482faee86 100755
--- a/storage/ndb/test/run-test/atrt-analyze-result.sh
+++ b/storage/ndb/test/run-test/atrt-analyze-result.sh
@@ -1,5 +1,22 @@
#!/bin/sh
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
f=`find result -name 'log.out' | xargs grep "NDBT_ProgramExit: " | grep -c "Failed"`
o=`find result -name 'log.out' | xargs grep "NDBT_ProgramExit: " | grep -c "OK"`
diff --git a/storage/ndb/test/run-test/atrt-clear-result.sh b/storage/ndb/test/run-test/atrt-clear-result.sh
index 57d3d43d247..7eeb54daef3 100755
--- a/storage/ndb/test/run-test/atrt-clear-result.sh
+++ b/storage/ndb/test/run-test/atrt-clear-result.sh
@@ -1,4 +1,21 @@
#!/bin/sh
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
set -e
rm -rf result
diff --git a/storage/ndb/test/run-test/atrt-gather-result.sh b/storage/ndb/test/run-test/atrt-gather-result.sh
index f2473578b41..36989d04c07 100755
--- a/storage/ndb/test/run-test/atrt-gather-result.sh
+++ b/storage/ndb/test/run-test/atrt-gather-result.sh
@@ -1,5 +1,22 @@
#!/bin/sh
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
set -e
mkdir -p result
diff --git a/storage/ndb/test/run-test/atrt-mysql-test-run b/storage/ndb/test/run-test/atrt-mysql-test-run
index 2ebc11b0070..55afc45bef9 100755
--- a/storage/ndb/test/run-test/atrt-mysql-test-run
+++ b/storage/ndb/test/run-test/atrt-mysql-test-run
@@ -1,5 +1,22 @@
#!/bin/sh
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
set -x
p=`pwd`
cd $MYSQL_BASE_DIR/mysql-test
diff --git a/storage/ndb/test/run-test/atrt-setup.sh b/storage/ndb/test/run-test/atrt-setup.sh
index aff5d4119dc..786b1d812de 100755
--- a/storage/ndb/test/run-test/atrt-setup.sh
+++ b/storage/ndb/test/run-test/atrt-setup.sh
@@ -1,5 +1,22 @@
#!/bin/sh
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
set -e
ssh $1 mkdir -p $3
diff --git a/storage/ndb/test/run-test/atrt-testBackup b/storage/ndb/test/run-test/atrt-testBackup
index 3ed7641a42e..2ed6f70b7aa 100755
--- a/storage/ndb/test/run-test/atrt-testBackup
+++ b/storage/ndb/test/run-test/atrt-testBackup
@@ -1,5 +1,22 @@
#!/bin/sh
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
PATH=$PATH:$MYSQL_BASE_DIR/bin
export PATH
diff --git a/storage/ndb/test/run-test/basic.txt b/storage/ndb/test/run-test/basic.txt
index ec9e21359e5..69555b8c587 100644
--- a/storage/ndb/test/run-test/basic.txt
+++ b/storage/ndb/test/run-test/basic.txt
@@ -1,3 +1,18 @@
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
# BASIC FUNCTIONALITY
max-time: 500
cmd: testBasic
diff --git a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt
index 70c395fab17..84c1111bd78 100644
--- a/storage/ndb/test/run-test/daily-basic-tests.txt
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt
@@ -1,3 +1,18 @@
+# Copyright (C) 2004-2008 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
max-time: 600
cmd: atrt-testBackup
args: -n NFMaster T1
diff --git a/storage/ndb/test/run-test/daily-devel-tests.txt b/storage/ndb/test/run-test/daily-devel-tests.txt
index f73bd021440..dc17e31de6a 100644
--- a/storage/ndb/test/run-test/daily-devel-tests.txt
+++ b/storage/ndb/test/run-test/daily-devel-tests.txt
@@ -1,3 +1,18 @@
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
#
# INDEX
#
diff --git a/storage/ndb/test/run-test/make-config.sh b/storage/ndb/test/run-test/make-config.sh
index a5ea2e58ae6..3ce780f9551 100755
--- a/storage/ndb/test/run-test/make-config.sh
+++ b/storage/ndb/test/run-test/make-config.sh
@@ -1,5 +1,22 @@
#!/bin/sh
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
baseport=""
basedir=""
proc_no=1
diff --git a/storage/ndb/test/run-test/make-html-reports.sh b/storage/ndb/test/run-test/make-html-reports.sh
index 67395ceba47..dc6d1225dbe 100755
--- a/storage/ndb/test/run-test/make-html-reports.sh
+++ b/storage/ndb/test/run-test/make-html-reports.sh
@@ -1,5 +1,22 @@
#!/bin/sh
+# Copyright (C) 2004, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
src_dir=$1
run=$2
date=$3
diff --git a/storage/ndb/test/run-test/make-index.sh b/storage/ndb/test/run-test/make-index.sh
index 944f0df790b..f13ac098567 100755
--- a/storage/ndb/test/run-test/make-index.sh
+++ b/storage/ndb/test/run-test/make-index.sh
@@ -1,4 +1,22 @@
#!/bin/sh
+
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
# NAME
# make-index.sh
#
diff --git a/storage/ndb/test/run-test/ndb-autotest.sh b/storage/ndb/test/run-test/ndb-autotest.sh
index 289f1045b21..a144c7a0329 100755
--- a/storage/ndb/test/run-test/ndb-autotest.sh
+++ b/storage/ndb/test/run-test/ndb-autotest.sh
@@ -1,4 +1,22 @@
#!/bin/sh
+
+# Copyright (C) 2005, 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
#############################################################
# This script created by Jonas does the following #
# Cleans up clones and pevious builds, pulls new clones, #
diff --git a/storage/ndb/test/run-test/setup.cpp b/storage/ndb/test/run-test/setup.cpp
index 60f8285888c..fc30c998865 100644
--- a/storage/ndb/test/run-test/setup.cpp
+++ b/storage/ndb/test/run-test/setup.cpp
@@ -105,7 +105,7 @@ setup_config(atrt_config& config)
*/
for (j = 0; j<(size_t)argc; j++)
{
- if (tmp[j] == args_separator) /* skip arguments separator */
+ if (my_getopt_is_args_separator(tmp[j])) /* skip arguments separator */
continue;
for (k = 0; proc_args[k].name; k++)
{
@@ -375,7 +375,7 @@ load_options(int argc, char** argv, int type, atrt_options& opts)
* Skip the separator for arguments from config file and command
* line
*/
- if (argv[i] == args_separator)
+ if (my_getopt_is_args_separator(argv[i]))
continue;
for (size_t j = 0; f_options[j].name; j++)
{
diff --git a/storage/ndb/test/sql/test_create_drop.pl b/storage/ndb/test/sql/test_create_drop.pl
index 7f62898b3d1..eb9d5e31dc8 100644
--- a/storage/ndb/test/sql/test_create_drop.pl
+++ b/storage/ndb/test/sql/test_create_drop.pl
@@ -1,3 +1,20 @@
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
use strict;
use IO::Socket;
use DBI;
diff --git a/storage/ndb/test/sql/test_range_bounds.pl b/storage/ndb/test/sql/test_range_bounds.pl
index abe1ea28298..964847044de 100644
--- a/storage/ndb/test/sql/test_range_bounds.pl
+++ b/storage/ndb/test/sql/test_range_bounds.pl
@@ -1,3 +1,20 @@
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
#
# test range scan bounds
# give option --all to test all cases
diff --git a/storage/ndb/tools/clean-links.sh b/storage/ndb/tools/clean-links.sh
index 01820f30616..84052a619d0 100755
--- a/storage/ndb/tools/clean-links.sh
+++ b/storage/ndb/tools/clean-links.sh
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
# 1 - Dir
# 2 - Link dst
diff --git a/storage/ndb/tools/make-errors.pl b/storage/ndb/tools/make-errors.pl
index 65819209a89..ac9c7d1d58a 100644
--- a/storage/ndb/tools/make-errors.pl
+++ b/storage/ndb/tools/make-errors.pl
@@ -1,5 +1,20 @@
#! /usr/local/bin/perl
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
use strict;
use Getopt::Long;
use XML::Parser;
diff --git a/storage/ndb/tools/make-links.sh b/storage/ndb/tools/make-links.sh
index e0c4f55986e..6008406ad6a 100755
--- a/storage/ndb/tools/make-links.sh
+++ b/storage/ndb/tools/make-links.sh
@@ -1,5 +1,20 @@
#! /bin/sh
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
# 1 - Link top src
# 2 - Link dst
diff --git a/storage/ndb/tools/ndb_error_reporter b/storage/ndb/tools/ndb_error_reporter
index 7ad7a2f478a..1af3bf83469 100644
--- a/storage/ndb/tools/ndb_error_reporter
+++ b/storage/ndb/tools/ndb_error_reporter
@@ -1,5 +1,20 @@
#!/usr/bin/perl -w
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
use strict;
if(@ARGV < 1)
diff --git a/storage/ndb/tools/rgrep b/storage/ndb/tools/rgrep
index 212b068639d..b1ed4fb6f5e 100755
--- a/storage/ndb/tools/rgrep
+++ b/storage/ndb/tools/rgrep
@@ -1,5 +1,20 @@
#!/vobs/wds/swt/bin/perl
+# Copyright (C) 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
die "Usage: rgrep [-iredblLn] regexp filepat ...\n rgrep -h for help\n"
if $#ARGV < $[;
diff --git a/storage/perfschema/Makefile.am b/storage/perfschema/Makefile.am
deleted file mode 100644
index 762f5b85790..00000000000
--- a/storage/perfschema/Makefile.am
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# 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,
-# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
-
-#called from the top level Makefile
-
-SUBDIRS = . unittest
-
-MYSQLDATAdir = $(localstatedir)
-MYSQLSHAREdir = $(pkgdatadir)
-MYSQLBASEdir= $(prefix)
-MYSQLLIBdir= $(pkglibdir)
-pkgplugindir = $(pkglibdir)/plugin
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/sql \
- -I$(srcdir)
-WRAPLIBS=
-
-LDADD =
-
-DEFS = -DMYSQL_SERVER @DEFS@
-
-
-noinst_HEADERS = ha_perfschema.h pfs_engine_table.h pfs.h pfs_server.h \
- pfs_global.h pfs_instr_class.h pfs_instr.h \
- pfs_column_types.h pfs_column_values.h \
- table_setup_instruments.h table_performance_timers.h \
- table_setup_timers.h \
- table_setup_consumers.h table_events_waits.h \
- pfs_events_waits.h pfs_timer.h table_threads.h \
- table_sync_instances.h \
- table_events_waits_summary.h pfs_stat.h \
- table_ews_global_by_event_name.h table_all_instr.h \
- table_file_instances.h table_file_summary.h \
- pfs_lock.h pfs_atomic.h
-
-PSE_SOURCES = ha_perfschema.cc pfs_engine_table.cc pfs.cc pfs_server.cc \
- pfs_global.cc pfs_instr_class.cc pfs_instr.cc \
- pfs_column_values.cc \
- table_setup_instruments.cc table_performance_timers.cc \
- table_setup_timers.cc \
- table_setup_consumers.cc table_events_waits.cc \
- pfs_events_waits.cc pfs_timer.cc table_threads.cc \
- table_sync_instances.cc \
- table_events_waits_summary.cc \
- table_ews_global_by_event_name.cc table_all_instr.cc \
- table_file_instances.cc table_file_summary.cc \
- pfs_atomic.cc pfs_check.cc
-
-EXTRA_LIBRARIES = libperfschema.a
-noinst_LIBRARIES = @plugin_perfschema_static_target@
-
-libperfschema_a_SOURCES= $(PSE_SOURCES)
-
-EXTRA_DIST = plug.in CMakeLists.txt
-
-unittests = unittest
-
-test:
- perl $(top_srcdir)/unittest/unit.pl run $(unittests)
-
-test-verbose:
- HARNESS_VERBOSE=1 perl $(top_srcdir)/unittest/unit.pl run $(unittests)
-
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index b6438808869..ec063b782c1 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -246,7 +246,6 @@ int ha_perfschema::write_row(uchar *buf)
result= m_table_share->m_write_row(table, buf, table->field);
else
{
- my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0));
result= HA_ERR_WRONG_COMMAND;
}
@@ -357,12 +356,16 @@ int ha_perfschema::delete_all_rows(void)
result= m_table_share->m_delete_all_rows();
else
{
- my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0));
result= HA_ERR_WRONG_COMMAND;
}
DBUG_RETURN(result);
}
+int ha_perfschema::truncate()
+{
+ return delete_all_rows();
+}
+
THR_LOCK_DATA **ha_perfschema::store_lock(THD *thd,
THR_LOCK_DATA **to,
enum thr_lock_type lock_type)
@@ -383,7 +386,6 @@ int ha_perfschema::delete_table(const char *name)
int ha_perfschema::rename_table(const char * from, const char * to)
{
DBUG_ENTER("ha_perfschema::rename_table ");
- my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0));
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
}
@@ -408,7 +410,37 @@ int ha_perfschema::create(const char *name, TABLE *table_arg,
This is not a general purpose engine.
Failure to CREATE TABLE is the expected result.
*/
- my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0));
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
}
+void ha_perfschema::print_error(int error, myf errflag)
+{
+ switch (error)
+ {
+ case HA_ERR_TABLE_NEEDS_UPGRADE:
+ /*
+ The error message for ER_TABLE_NEEDS_UPGRADE refers to REPAIR table,
+ which does not apply to performance schema tables.
+ */
+ my_error(ER_WRONG_NATIVE_TABLE_STRUCTURE, MYF(0),
+ table_share->db.str, table_share->table_name.str);
+ break;
+ case HA_ERR_WRONG_COMMAND:
+ /*
+ The performance schema is not a general purpose storage engine,
+ some operations are not supported, by design.
+ We do not want to print "Command not supported",
+ which gives the impression that a command implementation is missing,
+ and that the failure should be considered a bug.
+ We print "Invalid performance_schema usage." instead,
+ to emphasise that the operation attempted is not meant to be legal,
+ and that the failure returned is indeed the expected result.
+ */
+ my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0));
+ break;
+ default:
+ handler::print_error(error, errflag);
+ break;
+ }
+}
+
diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h
index 2c7b45fbbf7..c0ee0827dbc 100644
--- a/storage/perfschema/ha_perfschema.h
+++ b/storage/perfschema/ha_perfschema.h
@@ -100,9 +100,6 @@ public:
double scan_time(void)
{ return 1.0; }
- double read_time(ha_rows)
- { return 1.0; }
-
int open(const char *name, int mode, uint test_if_locked);
int close(void);
@@ -127,6 +124,8 @@ public:
int delete_all_rows(void);
+ int truncate();
+
int delete_table(const char *from);
int rename_table(const char * from, const char * to);
@@ -147,6 +146,8 @@ public:
return FALSE;
}
+ virtual void print_error(int error, myf errflags);
+
private:
/** MySQL lock */
THR_LOCK_DATA m_thr_lock;
diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc
index 3b1959c98d2..38f6df3003d 100644
--- a/storage/perfschema/pfs_engine_table.cc
+++ b/storage/perfschema/pfs_engine_table.cc
@@ -232,8 +232,6 @@ int PFS_engine_table::read_row(TABLE *table,
*/
if (! m_share_ptr->m_checked)
{
- my_error(ER_WRONG_NATIVE_TABLE_STRUCTURE, MYF(0),
- PERFORMANCE_SCHEMA_str.str, m_share_ptr->m_name.str);
return HA_ERR_TABLE_NEEDS_UPGRADE;
}
@@ -279,8 +277,6 @@ int PFS_engine_table::update_row(TABLE *table,
*/
if (! m_share_ptr->m_checked)
{
- my_error(ER_WRONG_NATIVE_TABLE_STRUCTURE, MYF(0),
- PERFORMANCE_SCHEMA_str.str, m_share_ptr->m_name.str);
return HA_ERR_TABLE_NEEDS_UPGRADE;
}
@@ -351,7 +347,6 @@ int PFS_engine_table::update_row_values(TABLE *,
unsigned char *,
Field **)
{
- my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0));
return HA_ERR_WRONG_COMMAND;
}
@@ -524,9 +519,9 @@ bool pfs_show_status(handlerton *hton, THD *thd,
/*
Note about naming conventions:
- Internal buffers exposed as a table in the performance schema are named
- after the table, as in 'EVENTS_WAITS_CURRENT'
+ after the table, as in 'events_waits_current'
- Internal buffers not exposed by a table are named with parenthesis,
- as in '(PFS_MUTEX_CLASS)'.
+ as in '(pfs_mutex_class)'.
*/
if (stat != HA_ENGINE_STATUS)
DBUG_RETURN(false);
@@ -537,219 +532,219 @@ bool pfs_show_status(handlerton *hton, THD *thd,
{
switch (i){
case 0:
- name= "EVENTS_WAITS_CURRENT.ROW_SIZE";
+ name= "events_waits_current.row_size";
size= sizeof(PFS_wait_locker);
break;
case 1:
- name= "EVENTS_WAITS_CURRENT.ROW_COUNT";
+ name= "events_waits_current.row_count";
size= LOCKER_STACK_SIZE * thread_max;
break;
case 2:
- name= "EVENTS_WAITS_HISTORY.ROW_SIZE";
+ name= "events_waits_history.row_size";
size= sizeof(PFS_events_waits);
break;
case 3:
- name= "EVENTS_WAITS_HISTORY.ROW_COUNT";
+ name= "events_waits_history.row_count";
size= events_waits_history_per_thread * thread_max;
break;
case 4:
- name= "EVENTS_WAITS_HISTORY.MEMORY";
+ name= "events_waits_history.memory";
size= events_waits_history_per_thread * thread_max
* sizeof(PFS_events_waits);
total_memory+= size;
break;
case 5:
- name= "EVENTS_WAITS_HISTORY_LONG.ROW_SIZE";
+ name= "events_waits_history_long.row_size";
size= sizeof(PFS_events_waits);
break;
case 6:
- name= "EVENTS_WAITS_HISTORY_LONG.ROW_COUNT";
+ name= "events_waits_history_long.row_count";
size= events_waits_history_long_size;
break;
case 7:
- name= "EVENTS_WAITS_HISTORY_LONG.MEMORY";
+ name= "events_waits_history_long.memory";
size= events_waits_history_long_size * sizeof(PFS_events_waits);
total_memory+= size;
break;
case 8:
- name= "(PFS_MUTEX_CLASS).ROW_SIZE";
+ name= "(pfs_mutex_class).row_size";
size= sizeof(PFS_mutex_class);
break;
case 9:
- name= "(PFS_MUTEX_CLASS).ROW_COUNT";
+ name= "(pfs_mutex_class).row_count";
size= mutex_class_max;
break;
case 10:
- name= "(PFS_MUTEX_CLASS).MEMORY";
+ name= "(pfs_mutex_class).memory";
size= mutex_class_max * sizeof(PFS_mutex_class);
total_memory+= size;
break;
case 11:
- name= "(PFS_RWLOCK_CLASS).ROW_SIZE";
+ name= "(pfs_rwlock_class).row_size";
size= sizeof(PFS_rwlock_class);
break;
case 12:
- name= "(PFS_RWLOCK_CLASS).ROW_COUNT";
+ name= "(pfs_rwlock_class).row_count";
size= rwlock_class_max;
break;
case 13:
- name= "(PFS_RWLOCK_CLASS).MEMORY";
+ name= "(pfs_rwlock_class).memory";
size= rwlock_class_max * sizeof(PFS_rwlock_class);
total_memory+= size;
break;
case 14:
- name= "(PFS_COND_CLASS).ROW_SIZE";
+ name= "(pfs_cond_class).row_size";
size= sizeof(PFS_cond_class);
break;
case 15:
- name= "(PFS_COND_CLASS).ROW_COUNT";
+ name= "(pfs_cond_class).row_count";
size= cond_class_max;
break;
case 16:
- name= "(PFS_COND_CLASS).MEMORY";
+ name= "(pfs_cond_class).memory";
size= cond_class_max * sizeof(PFS_cond_class);
total_memory+= size;
break;
case 17:
- name= "(PFS_THREAD_CLASS).ROW_SIZE";
+ name= "(pfs_thread_class).row_size";
size= sizeof(PFS_thread_class);
break;
case 18:
- name= "(PFS_THREAD_CLASS).ROW_COUNT";
+ name= "(pfs_thread_class).row_count";
size= thread_class_max;
break;
case 19:
- name= "(PFS_THREAD_CLASS).MEMORY";
+ name= "(pfs_thread_class).memory";
size= thread_class_max * sizeof(PFS_thread_class);
total_memory+= size;
break;
case 20:
- name= "(PFS_FILE_CLASS).ROW_SIZE";
+ name= "(pfs_file_class).row_size";
size= sizeof(PFS_file_class);
break;
case 21:
- name= "(PFS_FILE_CLASS).ROW_COUNT";
+ name= "(pfs_file_class).row_count";
size= file_class_max;
break;
case 22:
- name= "(PFS_FILE_CLASS).MEMORY";
+ name= "(pfs_file_class).memory";
size= file_class_max * sizeof(PFS_file_class);
total_memory+= size;
break;
case 23:
- name= "MUTEX_INSTANCES.ROW_SIZE";
+ name= "mutex_instances.row_size";
size= sizeof(PFS_mutex);
break;
case 24:
- name= "MUTEX_INSTANCES.ROW_COUNT";
+ name= "mutex_instances.row_count";
size= mutex_max;
break;
case 25:
- name= "MUTEX_INSTANCES.MEMORY";
+ name= "mutex_instances.memory";
size= mutex_max * sizeof(PFS_mutex);
total_memory+= size;
break;
case 26:
- name= "RWLOCK_INSTANCES.ROW_SIZE";
+ name= "rwlock_instances.row_size";
size= sizeof(PFS_rwlock);
break;
case 27:
- name= "RWLOCK_INSTANCES.ROW_COUNT";
+ name= "rwlock_instances.row_count";
size= rwlock_max;
break;
case 28:
- name= "RWLOCK_INSTANCES.MEMORY";
+ name= "rwlock_instances.memory";
size= rwlock_max * sizeof(PFS_rwlock);
total_memory+= size;
break;
case 29:
- name= "COND_INSTANCES.ROW_SIZE";
+ name= "cond_instances.row_size";
size= sizeof(PFS_cond);
break;
case 30:
- name= "COND_INSTANCES.ROW_COUNT";
+ name= "cond_instances.row_count";
size= cond_max;
break;
case 31:
- name= "COND_INSTANCES.MEMORY";
+ name= "cond_instances.memory";
size= cond_max * sizeof(PFS_cond);
total_memory+= size;
break;
case 32:
- name= "PROCESSLIST.ROW_SIZE";
+ name= "threads.row_size";
size= sizeof(PFS_thread);
break;
case 33:
- name= "PROCESSLIST.ROW_COUNT";
+ name= "threads.row_count";
size= thread_max;
break;
case 34:
- name= "PROCESSLIST.MEMORY";
+ name= "threads.memory";
size= thread_max * sizeof(PFS_thread);
total_memory+= size;
break;
case 35:
- name= "FILE_INSTANCES.ROW_SIZE";
+ name= "file_instances.row_size";
size= sizeof(PFS_file);
break;
case 36:
- name= "FILE_INSTANCES.ROW_COUNT";
+ name= "file_instances.row_count";
size= file_max;
break;
case 37:
- name= "FILE_INSTANCES.MEMORY";
+ name= "file_instances.memory";
size= file_max * sizeof(PFS_file);
total_memory+= size;
break;
case 38:
- name= "(PFS_FILE_HANDLE).ROW_SIZE";
+ name= "(pfs_file_handle).row_size";
size= sizeof(PFS_file*);
break;
case 39:
- name= "(PFS_FILE_HANDLE).ROW_COUNT";
+ name= "(pfs_file_handle).row_count";
size= file_handle_max;
break;
case 40:
- name= "(PFS_FILE_HANDLE).MEMORY";
+ name= "(pfs_file_handle).memory";
size= file_handle_max * sizeof(PFS_file*);
total_memory+= size;
break;
case 41:
- name= "EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME.ROW_SIZE";
+ name= "events_waits_summary_by_thread_by_event_name.row_size";
size= sizeof(PFS_single_stat_chain);
break;
case 42:
- name= "EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME.ROW_COUNT";
+ name= "events_waits_summary_by_thread_by_event_name.row_count";
size= thread_max * instr_class_per_thread;
break;
case 43:
- name= "EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME.MEMORY";
+ name= "events_waits_summary_by_thread_by_event_name.memory";
size= thread_max * instr_class_per_thread * sizeof(PFS_single_stat_chain);
total_memory+= size;
break;
case 44:
- name= "(PFS_TABLE_SHARE).ROW_SIZE";
+ name= "(pfs_table_share).row_size";
size= sizeof(PFS_table_share);
break;
case 45:
- name= "(PFS_TABLE_SHARE).ROW_COUNT";
+ name= "(pfs_table_share).row_count";
size= table_share_max;
break;
case 46:
- name= "(PFS_TABLE_SHARE).MEMORY";
+ name= "(pfs_table_share).memory";
size= table_share_max * sizeof(PFS_table_share);
total_memory+= size;
break;
case 47:
- name= "(PFS_TABLE).ROW_SIZE";
+ name= "(pfs_table).row_size";
size= sizeof(PFS_table);
break;
case 48:
- name= "(PFS_TABLE).ROW_COUNT";
+ name= "(pfs_table).row_count";
size= table_max;
break;
case 49:
- name= "(PFS_TABLE).MEMORY";
+ name= "(pfs_table).memory";
size= table_max * sizeof(PFS_table);
total_memory+= size;
break;
@@ -758,7 +753,7 @@ bool pfs_show_status(handlerton *hton, THD *thd,
for aggregation in total_memory.
*/
case 50:
- name= "PERFORMANCE_SCHEMA.MEMORY";
+ name= "performance_schema.memory";
size= total_memory;
/* This will fail if something is not advertised here */
DBUG_ASSERT(size == pfs_allocated_memory);
diff --git a/storage/perfschema/pfs_global.h b/storage/perfschema/pfs_global.h
index 6050612e24c..c0c0490a380 100644
--- a/storage/perfschema/pfs_global.h
+++ b/storage/perfschema/pfs_global.h
@@ -79,5 +79,21 @@ inline uint randomized_index(const void *ptr, uint max_size)
void pfs_print_error(const char *format, ...);
+/**
+ Given an array defined as T ARRAY[MAX],
+ check that an UNSAFE pointer actually points to an element
+ within the array.
+*/
+#define SANITIZE_ARRAY_BODY(T, ARRAY, MAX, UNSAFE) \
+ intptr offset; \
+ if ((&ARRAY[0] <= UNSAFE) && \
+ (UNSAFE < &ARRAY[MAX])) \
+ { \
+ offset= ((intptr) UNSAFE - (intptr) ARRAY) % sizeof(T); \
+ if (offset == 0) \
+ return UNSAFE; \
+ } \
+ return NULL
+
#endif
diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc
index 0c7b25a03de..a09920737c8 100644
--- a/storage/perfschema/pfs_instr.cc
+++ b/storage/perfschema/pfs_instr.cc
@@ -18,9 +18,9 @@
Performance schema instruments (implementation).
*/
+#include <my_global.h>
#include <string.h>
-#include "my_global.h"
#include "my_sys.h"
#include "pfs.h"
#include "pfs_stat.h"
@@ -758,9 +758,26 @@ PFS_thread* create_thread(PFS_thread_class *klass, const void *identity,
*/
PFS_thread *sanitize_thread(PFS_thread *unsafe)
{
- if ((&thread_array[0] <= unsafe) &&
- (unsafe < &thread_array[thread_max]))
- return unsafe;
+ SANITIZE_ARRAY_BODY(PFS_thread, thread_array, thread_max, unsafe);
+}
+
+const char *sanitize_file_name(const char *unsafe)
+{
+ intptr ptr= (intptr) unsafe;
+ intptr first= (intptr) &file_array[0];
+ intptr last= (intptr) &file_array[file_max];
+
+ /* Check if unsafe points inside file_array[] */
+ if (likely((first <= ptr) && (ptr < last)))
+ {
+ /* Check if unsafe points to PFS_file::m_filename */
+ intptr offset= (ptr - first) % sizeof(PFS_file);
+ intptr valid_offset= my_offsetof(PFS_file, m_filename[0]);
+ if (likely(offset == valid_offset))
+ {
+ return unsafe;
+ }
+ }
return NULL;
}
diff --git a/storage/perfschema/pfs_instr.h b/storage/perfschema/pfs_instr.h
index 791e2cd1f8d..2f6b729628e 100644
--- a/storage/perfschema/pfs_instr.h
+++ b/storage/perfschema/pfs_instr.h
@@ -227,6 +227,7 @@ struct PFS_thread
};
PFS_thread *sanitize_thread(PFS_thread *unsafe);
+const char *sanitize_file_name(const char *unsafe);
PFS_single_stat_chain*
find_per_thread_mutex_class_wait_stat(PFS_thread *thread,
diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc
index 48547f73628..d99ca4d513c 100644
--- a/storage/perfschema/pfs_instr_class.cc
+++ b/storage/perfschema/pfs_instr_class.cc
@@ -543,15 +543,9 @@ PFS_mutex_class *find_mutex_class(PFS_sync_key key)
FIND_CLASS_BODY(key, mutex_class_allocated_count, mutex_class_array);
}
-#define SANITIZE_ARRAY_BODY(ARRAY, MAX, UNSAFE) \
- if ((&ARRAY[0] <= UNSAFE) && \
- (UNSAFE < &ARRAY[MAX])) \
- return UNSAFE; \
- return NULL
-
PFS_mutex_class *sanitize_mutex_class(PFS_mutex_class *unsafe)
{
- SANITIZE_ARRAY_BODY(mutex_class_array, mutex_class_max, unsafe);
+ SANITIZE_ARRAY_BODY(PFS_mutex_class, mutex_class_array, mutex_class_max, unsafe);
}
/**
@@ -566,7 +560,7 @@ PFS_rwlock_class *find_rwlock_class(PFS_sync_key key)
PFS_rwlock_class *sanitize_rwlock_class(PFS_rwlock_class *unsafe)
{
- SANITIZE_ARRAY_BODY(rwlock_class_array, rwlock_class_max, unsafe);
+ SANITIZE_ARRAY_BODY(PFS_rwlock_class, rwlock_class_array, rwlock_class_max, unsafe);
}
/**
@@ -581,7 +575,7 @@ PFS_cond_class *find_cond_class(PFS_sync_key key)
PFS_cond_class *sanitize_cond_class(PFS_cond_class *unsafe)
{
- SANITIZE_ARRAY_BODY(cond_class_array, cond_class_max, unsafe);
+ SANITIZE_ARRAY_BODY(PFS_cond_class, cond_class_array, cond_class_max, unsafe);
}
/**
@@ -636,7 +630,7 @@ PFS_thread_class *find_thread_class(PFS_sync_key key)
PFS_thread_class *sanitize_thread_class(PFS_thread_class *unsafe)
{
- SANITIZE_ARRAY_BODY(thread_class_array, thread_class_max, unsafe);
+ SANITIZE_ARRAY_BODY(PFS_thread_class, thread_class_array, thread_class_max, unsafe);
}
/**
@@ -687,7 +681,7 @@ PFS_file_class *find_file_class(PFS_file_key key)
PFS_file_class *sanitize_file_class(PFS_file_class *unsafe)
{
- SANITIZE_ARRAY_BODY(file_class_array, file_class_max, unsafe);
+ SANITIZE_ARRAY_BODY(PFS_file_class, file_class_array, file_class_max, unsafe);
}
/**
@@ -820,7 +814,59 @@ search:
PFS_table_share *sanitize_table_share(PFS_table_share *unsafe)
{
- SANITIZE_ARRAY_BODY(table_share_array, table_share_max, unsafe);
+ SANITIZE_ARRAY_BODY(PFS_table_share, table_share_array, table_share_max, unsafe);
+}
+
+const char *sanitize_table_schema_name(const char *unsafe)
+{
+ intptr ptr= (intptr) unsafe;
+ intptr first= (intptr) &table_share_array[0];
+ intptr last= (intptr) &table_share_array[table_share_max];
+
+ PFS_table_share dummy;
+
+ /* Check if unsafe points inside table_share_array[] */
+ if (likely((first <= ptr) && (ptr < last)))
+ {
+ intptr offset= (ptr - first) % sizeof(PFS_table_share);
+ intptr from= my_offsetof(PFS_table_share, m_key.m_hash_key);
+ intptr len= sizeof(dummy.m_key.m_hash_key);
+ /* Check if unsafe points inside PFS_table_share::m_key::m_hash_key */
+ if (likely((from <= offset) && (offset < from + len)))
+ {
+ PFS_table_share *base= (PFS_table_share*) (ptr - offset);
+ /* Check if unsafe really is the schema name */
+ if (likely(base->m_schema_name == unsafe))
+ return unsafe;
+ }
+ }
+ return NULL;
+}
+
+const char *sanitize_table_object_name(const char *unsafe)
+{
+ intptr ptr= (intptr) unsafe;
+ intptr first= (intptr) &table_share_array[0];
+ intptr last= (intptr) &table_share_array[table_share_max];
+
+ PFS_table_share dummy;
+
+ /* Check if unsafe points inside table_share_array[] */
+ if (likely((first <= ptr) && (ptr < last)))
+ {
+ intptr offset= (ptr - first) % sizeof(PFS_table_share);
+ intptr from= my_offsetof(PFS_table_share, m_key.m_hash_key);
+ intptr len= sizeof(dummy.m_key.m_hash_key);
+ /* Check if unsafe points inside PFS_table_share::m_key::m_hash_key */
+ if (likely((from <= offset) && (offset < from + len)))
+ {
+ PFS_table_share *base= (PFS_table_share*) (ptr - offset);
+ /* Check if unsafe really is the table name */
+ if (likely(base->m_table_name == unsafe))
+ return unsafe;
+ }
+ }
+ return NULL;
}
static void reset_mutex_class_waits(void)
diff --git a/storage/perfschema/pfs_instr_class.h b/storage/perfschema/pfs_instr_class.h
index bd6560dbb55..107db628226 100644
--- a/storage/perfschema/pfs_instr_class.h
+++ b/storage/perfschema/pfs_instr_class.h
@@ -222,6 +222,8 @@ PFS_thread_class *find_thread_class(PSI_thread_key key);
PFS_thread_class *sanitize_thread_class(PFS_thread_class *unsafe);
PFS_file_class *find_file_class(PSI_file_key key);
PFS_file_class *sanitize_file_class(PFS_file_class *unsafe);
+const char *sanitize_table_schema_name(const char *unsafe);
+const char *sanitize_table_object_name(const char *unsafe);
PFS_table_share *find_or_create_table_share(PFS_thread *thread,
const char *schema_name,
diff --git a/storage/perfschema/pfs_lock.h b/storage/perfschema/pfs_lock.h
index 5c74d3944ba..d253cfa4366 100644
--- a/storage/perfschema/pfs_lock.h
+++ b/storage/perfschema/pfs_lock.h
@@ -135,7 +135,25 @@ struct pfs_lock
*/
void allocated_to_free(void)
{
- DBUG_ASSERT(m_state == PFS_LOCK_ALLOCATED);
+#ifndef DBUG_OFF
+ extern volatile bool ready_to_exit;
+#endif
+
+ /*
+ If this record is not in the ALLOCATED state and the caller is trying
+ to free it, this is a bug: the caller is confused,
+ and potentially damaging data owned by another thread or object.
+ The correct assert to use here to guarantee data integrity is simply:
+ DBUG_ASSERT(m_state == PFS_LOCK_ALLOCATED);
+ Now, because of Bug#56666 (Race condition between the server main thread
+ and the kill server thread), this assert actually fails during shutdown,
+ and the failure is legitimate, on concurrent calls to mysql_*_destroy(),
+ when destroying the instrumentation of an object ... twice.
+ During shutdown this has no consequences for the performance schema,
+ so the assert is relaxed with the "|| ready_to_exit" condition as a work
+ around until Bug#56666 is fixed.
+ */
+ DBUG_ASSERT((m_state == PFS_LOCK_ALLOCATED) || ready_to_exit);
PFS_atomic::store_32(&m_state, PFS_LOCK_FREE);
}
diff --git a/storage/perfschema/plug.in b/storage/perfschema/plug.in
deleted file mode 100644
index 36a1c1e8bda..00000000000
--- a/storage/perfschema/plug.in
+++ /dev/null
@@ -1,26 +0,0 @@
-dnl -*- ksh -*-
-
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# 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,
-# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
-
-dnl This file is part of the configure scripts used by autoconf.
-
-MYSQL_STORAGE_ENGINE(perfschema,
- perfschema,
- [Performance Schema],
- [Performance Schema],
- [default,max,max-no-ndb])
-MYSQL_PLUGIN_DIRECTORY(perfschema, [storage/perfschema])
-MYSQL_PLUGIN_STATIC(perfschema, [libperfschema.a])
diff --git a/storage/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc
index d34f6fbe722..8408cc55975 100644
--- a/storage/perfschema/table_events_waits.cc
+++ b/storage/perfschema/table_events_waits.cc
@@ -118,7 +118,7 @@ table_events_waits_current::m_field_def=
PFS_engine_table_share
table_events_waits_current::m_share=
{
- { C_STRING_WITH_LEN("EVENTS_WAITS_CURRENT") },
+ { C_STRING_WITH_LEN("events_waits_current") },
&pfs_truncatable_acl,
&table_events_waits_current::create,
NULL, /* write_row */
@@ -135,7 +135,7 @@ THR_LOCK table_events_waits_history::m_table_lock;
PFS_engine_table_share
table_events_waits_history::m_share=
{
- { C_STRING_WITH_LEN("EVENTS_WAITS_HISTORY") },
+ { C_STRING_WITH_LEN("events_waits_history") },
&pfs_truncatable_acl,
&table_events_waits_history::create,
NULL, /* write_row */
@@ -152,7 +152,7 @@ THR_LOCK table_events_waits_history_long::m_table_lock;
PFS_engine_table_share
table_events_waits_history_long::m_share=
{
- { C_STRING_WITH_LEN("EVENTS_WAITS_HISTORY_LONG") },
+ { C_STRING_WITH_LEN("events_waits_history_long") },
&pfs_truncatable_acl,
&table_events_waits_history_long::create,
NULL, /* write_row */
@@ -194,6 +194,9 @@ void table_events_waits_common::make_row(bool thread_own_wait,
PFS_instr_class *safe_class;
const char *base;
const char *safe_source_file;
+ const char *safe_table_schema_name;
+ const char *safe_table_object_name;
+ const char *safe_file_name;
m_row_exists= false;
safe_thread= sanitize_thread(pfs_thread);
@@ -252,15 +255,19 @@ void table_events_waits_common::make_row(bool thread_own_wait,
m_row.m_object_type= "TABLE";
m_row.m_object_type_length= 5;
m_row.m_object_schema_length= wait->m_schema_name_length;
+ safe_table_schema_name= sanitize_table_schema_name(wait->m_schema_name);
if (unlikely((m_row.m_object_schema_length == 0) ||
- (m_row.m_object_schema_length > sizeof(m_row.m_object_schema))))
+ (m_row.m_object_schema_length > sizeof(m_row.m_object_schema)) ||
+ (safe_table_schema_name == NULL)))
return;
- memcpy(m_row.m_object_schema, wait->m_schema_name, m_row.m_object_schema_length);
+ memcpy(m_row.m_object_schema, safe_table_schema_name, m_row.m_object_schema_length);
m_row.m_object_name_length= wait->m_object_name_length;
+ safe_table_object_name= sanitize_table_object_name(wait->m_object_name);
if (unlikely((m_row.m_object_name_length == 0) ||
- (m_row.m_object_name_length > sizeof(m_row.m_object_name))))
+ (m_row.m_object_name_length > sizeof(m_row.m_object_name)) ||
+ (safe_table_object_name == NULL)))
return;
- memcpy(m_row.m_object_name, wait->m_object_name, m_row.m_object_name_length);
+ memcpy(m_row.m_object_name, safe_table_object_name, m_row.m_object_name_length);
safe_class= &global_table_class;
break;
case WAIT_CLASS_FILE:
@@ -268,10 +275,12 @@ void table_events_waits_common::make_row(bool thread_own_wait,
m_row.m_object_type_length= 4;
m_row.m_object_schema_length= 0;
m_row.m_object_name_length= wait->m_object_name_length;
+ safe_file_name= sanitize_file_name(wait->m_object_name);
if (unlikely((m_row.m_object_name_length == 0) ||
- (m_row.m_object_name_length > sizeof(m_row.m_object_name))))
+ (m_row.m_object_name_length > sizeof(m_row.m_object_name)) ||
+ (safe_file_name == NULL)))
return;
- memcpy(m_row.m_object_name, wait->m_object_name, m_row.m_object_name_length);
+ memcpy(m_row.m_object_name, safe_file_name, m_row.m_object_name_length);
safe_class= sanitize_file_class((PFS_file_class*) wait->m_class);
break;
case NO_WAIT_CLASS:
diff --git a/storage/perfschema/table_events_waits_summary.cc b/storage/perfschema/table_events_waits_summary.cc
index 435a3500f06..05f280f8521 100644
--- a/storage/perfschema/table_events_waits_summary.cc
+++ b/storage/perfschema/table_events_waits_summary.cc
@@ -74,7 +74,7 @@ table_events_waits_summary_by_thread_by_event_name::m_field_def=
PFS_engine_table_share
table_events_waits_summary_by_thread_by_event_name::m_share=
{
- { C_STRING_WITH_LEN("EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME") },
+ { C_STRING_WITH_LEN("events_waits_summary_by_thread_by_event_name") },
&pfs_truncatable_acl,
&table_events_waits_summary_by_thread_by_event_name::create,
NULL, /* write_row */
@@ -386,7 +386,7 @@ table_events_waits_summary_by_instance::m_field_def=
PFS_engine_table_share
table_events_waits_summary_by_instance::m_share=
{
- { C_STRING_WITH_LEN("EVENTS_WAITS_SUMMARY_BY_INSTANCE") },
+ { C_STRING_WITH_LEN("events_waits_summary_by_instance") },
&pfs_truncatable_acl,
&table_events_waits_summary_by_instance::create,
NULL, /* write_row */
diff --git a/storage/perfschema/table_ews_global_by_event_name.cc b/storage/perfschema/table_ews_global_by_event_name.cc
index 35e744ed96b..c983a967c4e 100644
--- a/storage/perfschema/table_ews_global_by_event_name.cc
+++ b/storage/perfschema/table_ews_global_by_event_name.cc
@@ -69,7 +69,7 @@ table_ews_global_by_event_name::m_field_def=
PFS_engine_table_share
table_ews_global_by_event_name::m_share=
{
- { C_STRING_WITH_LEN("EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME") },
+ { C_STRING_WITH_LEN("events_waits_summary_global_by_event_name") },
&pfs_truncatable_acl,
&table_ews_global_by_event_name::create,
NULL, /* write_row */
diff --git a/storage/perfschema/table_file_instances.cc b/storage/perfschema/table_file_instances.cc
index f1676421616..9ae732a0e1c 100644
--- a/storage/perfschema/table_file_instances.cc
+++ b/storage/perfschema/table_file_instances.cc
@@ -54,7 +54,7 @@ table_file_instances::m_field_def=
PFS_engine_table_share
table_file_instances::m_share=
{
- { C_STRING_WITH_LEN("FILE_INSTANCES") },
+ { C_STRING_WITH_LEN("file_instances") },
&pfs_readonly_acl,
&table_file_instances::create,
NULL, /* write_row */
diff --git a/storage/perfschema/table_file_summary.cc b/storage/perfschema/table_file_summary.cc
index f8b9e66118b..a954db7ef4e 100644
--- a/storage/perfschema/table_file_summary.cc
+++ b/storage/perfschema/table_file_summary.cc
@@ -64,7 +64,7 @@ table_file_summary_by_event_name::m_field_def=
PFS_engine_table_share
table_file_summary_by_event_name::m_share=
{
- { C_STRING_WITH_LEN("FILE_SUMMARY_BY_EVENT_NAME") },
+ { C_STRING_WITH_LEN("file_summary_by_event_name") },
&pfs_truncatable_acl,
&table_file_summary_by_event_name::create,
NULL, /* write_row */
@@ -227,7 +227,7 @@ table_file_summary_by_instance::m_field_def=
PFS_engine_table_share
table_file_summary_by_instance::m_share=
{
- { C_STRING_WITH_LEN("FILE_SUMMARY_BY_INSTANCE") },
+ { C_STRING_WITH_LEN("file_summary_by_instance") },
&pfs_truncatable_acl,
&table_file_summary_by_instance::create,
NULL, /* write_row */
diff --git a/storage/perfschema/table_performance_timers.cc b/storage/perfschema/table_performance_timers.cc
index f400e37366c..acd379bc57b 100644
--- a/storage/perfschema/table_performance_timers.cc
+++ b/storage/perfschema/table_performance_timers.cc
@@ -58,7 +58,7 @@ table_performance_timers::m_field_def=
PFS_engine_table_share
table_performance_timers::m_share=
{
- { C_STRING_WITH_LEN("PERFORMANCE_TIMERS") },
+ { C_STRING_WITH_LEN("performance_timers") },
&pfs_readonly_acl,
&table_performance_timers::create,
NULL, /* write_row */
diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc
index 3cc6a1441c1..601e0483b14 100644
--- a/storage/perfschema/table_setup_consumers.cc
+++ b/storage/perfschema/table_setup_consumers.cc
@@ -84,7 +84,7 @@ table_setup_consumers::m_field_def=
PFS_engine_table_share
table_setup_consumers::m_share=
{
- { C_STRING_WITH_LEN("SETUP_CONSUMERS") },
+ { C_STRING_WITH_LEN("setup_consumers") },
&pfs_updatable_acl,
&table_setup_consumers::create,
NULL, /* write_row */
@@ -192,7 +192,6 @@ int table_setup_consumers::update_row_values(TABLE *table,
switch(f->field_index)
{
case 0: /* NAME */
- my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0));
return HA_ERR_WRONG_COMMAND;
case 1: /* ENABLED */
{
diff --git a/storage/perfschema/table_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc
index 259ccee3c84..480c0dbc13f 100644
--- a/storage/perfschema/table_setup_instruments.cc
+++ b/storage/perfschema/table_setup_instruments.cc
@@ -54,7 +54,7 @@ table_setup_instruments::m_field_def=
PFS_engine_table_share
table_setup_instruments::m_share=
{
- { C_STRING_WITH_LEN("SETUP_INSTRUMENTS") },
+ { C_STRING_WITH_LEN("setup_instruments") },
&pfs_updatable_acl,
&table_setup_instruments::create,
NULL, /* write_row */
@@ -253,7 +253,6 @@ int table_setup_instruments::update_row_values(TABLE *table,
switch(f->field_index)
{
case 0: /* NAME */
- my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0));
return HA_ERR_WRONG_COMMAND;
case 1: /* ENABLED */
value= (enum_yes_no) get_field_enum(f);
diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc
index 8ca218913bb..f8b1bfa4fe2 100644
--- a/storage/perfschema/table_setup_timers.cc
+++ b/storage/perfschema/table_setup_timers.cc
@@ -57,7 +57,7 @@ table_setup_timers::m_field_def=
PFS_engine_table_share
table_setup_timers::m_share=
{
- { C_STRING_WITH_LEN("SETUP_TIMERS") },
+ { C_STRING_WITH_LEN("setup_timers") },
&pfs_updatable_acl,
&table_setup_timers::create,
NULL, /* write_row */
@@ -164,7 +164,6 @@ int table_setup_timers::update_row_values(TABLE *table,
switch(f->field_index)
{
case 0: /* NAME */
- my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0));
return HA_ERR_WRONG_COMMAND;
case 1: /* TIMER_NAME */
value= get_field_enum(f);
diff --git a/storage/perfschema/table_sync_instances.cc b/storage/perfschema/table_sync_instances.cc
index 82587ce493d..f2bd9fa1a28 100644
--- a/storage/perfschema/table_sync_instances.cc
+++ b/storage/perfschema/table_sync_instances.cc
@@ -55,7 +55,7 @@ table_mutex_instances::m_field_def=
PFS_engine_table_share
table_mutex_instances::m_share=
{
- { C_STRING_WITH_LEN("MUTEX_INSTANCES") },
+ { C_STRING_WITH_LEN("mutex_instances") },
&pfs_readonly_acl,
&table_mutex_instances::create,
NULL, /* write_row */
@@ -223,7 +223,7 @@ table_rwlock_instances::m_field_def=
PFS_engine_table_share
table_rwlock_instances::m_share=
{
- { C_STRING_WITH_LEN("RWLOCK_INSTANCES") },
+ { C_STRING_WITH_LEN("rwlock_instances") },
&pfs_readonly_acl,
&table_rwlock_instances::create,
NULL, /* write_row */
@@ -388,7 +388,7 @@ table_cond_instances::m_field_def=
PFS_engine_table_share
table_cond_instances::m_share=
{
- { C_STRING_WITH_LEN("COND_INSTANCES") },
+ { C_STRING_WITH_LEN("cond_instances") },
&pfs_readonly_acl,
&table_cond_instances::create,
NULL, /* write_row */
diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc
index bba7806cab9..541ba860386 100644
--- a/storage/perfschema/table_threads.cc
+++ b/storage/perfschema/table_threads.cc
@@ -34,13 +34,13 @@ static const TABLE_FIELD_TYPE field_types[]=
{ NULL, 0}
},
{
- { C_STRING_WITH_LEN("ID") },
+ { C_STRING_WITH_LEN("PROCESSLIST_ID") },
{ C_STRING_WITH_LEN("int(11)") },
{ NULL, 0}
},
{
{ C_STRING_WITH_LEN("NAME") },
- { C_STRING_WITH_LEN("varchar(64)") },
+ { C_STRING_WITH_LEN("varchar(128)") },
{ NULL, 0}
}
};
@@ -52,7 +52,7 @@ table_threads::m_field_def=
PFS_engine_table_share
table_threads::m_share=
{
- { C_STRING_WITH_LEN("THREADS") },
+ { C_STRING_WITH_LEN("threads") },
&pfs_readonly_acl,
&table_threads::create,
NULL, /* write_row */
@@ -140,7 +140,7 @@ void table_threads::make_row(PFS_thread *pfs)
}
int table_threads::read_row_values(TABLE *table,
- unsigned char *,
+ unsigned char *buf,
Field **fields,
bool read_all)
{
@@ -150,7 +150,8 @@ int table_threads::read_row_values(TABLE *table,
return HA_ERR_RECORD_DELETED;
/* Set the null bits */
- DBUG_ASSERT(table->s->null_bytes == 0);
+ DBUG_ASSERT(table->s->null_bytes == 1);
+ buf[0]= 0;
for (; (f= *fields) ; fields++)
{
@@ -161,7 +162,7 @@ int table_threads::read_row_values(TABLE *table,
case 0: /* THREAD_ID */
set_field_ulong(f, m_row.m_thread_internal_id);
break;
- case 1: /* ID */
+ case 1: /* PROCESSLIST_ID */
set_field_ulong(f, m_row.m_thread_id);
break;
case 2: /* NAME */
diff --git a/storage/perfschema/table_threads.h b/storage/perfschema/table_threads.h
index 9df323f6d82..fb239007069 100644
--- a/storage/perfschema/table_threads.h
+++ b/storage/perfschema/table_threads.h
@@ -36,7 +36,7 @@ struct row_threads
{
/** Column THREAD_ID. */
ulong m_thread_internal_id;
- /** Column ID. */
+ /** Column PROCESSLIST_ID. */
ulong m_thread_id;
/** Column NAME. */
const char *m_name;
@@ -79,7 +79,7 @@ private:
/** Current row. */
row_threads m_row;
- /** True is the current row exists. */
+ /** True if the current row exists. */
bool m_row_exists;
/** Current position. */
PFS_simple_index m_pos;
diff --git a/storage/perfschema/unittest/Makefile.am b/storage/perfschema/unittest/Makefile.am
deleted file mode 100644
index 7d82753c9e5..00000000000
--- a/storage/perfschema/unittest/Makefile.am
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright (C) 2008-2009 Sun Microsystems, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-INCLUDES = -I$(top_builddir)/include \
- -I$(top_srcdir)/include \
- -I$(top_srcdir)/include/mysql \
- -I$(top_srcdir)/regex \
- -I$(top_srcdir)/unittest/mytap \
- -I$(top_srcdir)/sql \
- -I$(top_srcdir)/storage/perfschema
-
-DEFS = -DMYSQL_SERVER @DEFS@
-
-TEST_CODE = $(top_builddir)/unittest/mytap/libmytap.a
-
-$(TEST_CODE) :
- (cd $(top_builddir)/unittest/mytap; $(MAKE))
-
-PROD_CODE = $(top_builddir)/storage/perfschema/libperfschema.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a
-
-noinst_PROGRAMS = pfs_instr_class-t pfs_instr_class-oom-t \
- pfs_instr-t pfs_instr-oom-t pfs_timer-t pfs-t
-
-pfs_t_SOURCES = pfs-t.cc stub_print_error.h
-pfs_t_LDADD = $(TEST_CODE) $(PROD_CODE)
-
-pfs_instr_class_t_SOURCES = pfs_instr_class-t.cc
-pfs_instr_class_t_LDADD = $(TEST_CODE) $(PROD_CODE)
-
-pfs_instr_class_oom_t_SOURCES = pfs_instr_class-oom-t.cc stub_pfs_global.h
-pfs_instr_class_oom_t_LDADD = $(TEST_CODE) $(PROD_CODE)
-
-pfs_instr_t_SOURCES = pfs_instr-t.cc
-pfs_instr_t_LDADD = $(TEST_CODE) $(PROD_CODE)
-
-pfs_instr_oom_t_SOURCES = pfs_instr-oom-t.cc stub_pfs_global.h
-pfs_instr_oom_t_LDADD = $(TEST_CODE) $(PROD_CODE)
-
-pfs_timer_t_SOURCES = pfs_timer-t.cc
-pfs_timer_t_LDADD = $(TEST_CODE) $(PROD_CODE)
-
-EXTRA_DIST = conf.txt CMakeLists.txt
-
diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc
index c51f358c4d8..46e02306aca 100644
--- a/storage/perfschema/unittest/pfs-t.cc
+++ b/storage/perfschema/unittest/pfs-t.cc
@@ -25,6 +25,7 @@
#include <memory.h>
#include "stub_print_error.h"
+#include "stub_server_misc.h"
/* test helpers, to simulate the setup */
@@ -1204,6 +1205,8 @@ void test_enabled()
void do_all_tests()
{
+ /* Using initialize_performance_schema(), no partial init needed. */
+
test_bootstrap();
test_bad_registration();
test_init_disabled();
diff --git a/storage/perfschema/unittest/pfs_instr-oom-t.cc b/storage/perfschema/unittest/pfs_instr-oom-t.cc
index 9a3b179aa56..a00afe8b36a 100644
--- a/storage/perfschema/unittest/pfs_instr-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc
@@ -21,6 +21,7 @@
#include <tap.h>
#include "stub_pfs_global.h"
+#include "stub_server_misc.h"
void test_oom()
{
@@ -198,7 +199,11 @@ void test_oom()
void do_all_tests()
{
+ PFS_atomic::init();
+
test_oom();
+
+ PFS_atomic::cleanup();
}
int main(int, char **)
diff --git a/storage/perfschema/unittest/pfs_instr-t.cc b/storage/perfschema/unittest/pfs_instr-t.cc
index 7dcc8cec7f8..b13135aa615 100644
--- a/storage/perfschema/unittest/pfs_instr-t.cc
+++ b/storage/perfschema/unittest/pfs_instr-t.cc
@@ -22,6 +22,8 @@
#include <memory.h>
+#include "stub_server_misc.h"
+
void test_no_instruments()
{
int rc;
@@ -398,10 +400,14 @@ void test_per_thread_wait()
void do_all_tests()
{
+ PFS_atomic::init();
+
test_no_instruments();
test_no_instances();
test_with_instances();
test_per_thread_wait();
+
+ PFS_atomic::cleanup();
}
int main(int, char **)
diff --git a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
index 20fa0f3e6ff..95dccc420d7 100644
--- a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc
@@ -20,6 +20,7 @@
#include <tap.h>
#include "stub_pfs_global.h"
+#include "stub_server_misc.h"
void test_oom()
{
@@ -46,7 +47,11 @@ void test_oom()
void do_all_tests()
{
+ PFS_atomic::init();
+
test_oom();
+
+ PFS_atomic::cleanup();
}
int main(int, char **)
diff --git a/storage/perfschema/unittest/pfs_instr_class-t.cc b/storage/perfschema/unittest/pfs_instr_class-t.cc
index c5a199727d5..ac34f082fe8 100644
--- a/storage/perfschema/unittest/pfs_instr_class-t.cc
+++ b/storage/perfschema/unittest/pfs_instr_class-t.cc
@@ -21,6 +21,8 @@
#include <pfs_global.h>
#include <tap.h>
+#include "stub_server_misc.h"
+
void test_no_registration()
{
int rc;
@@ -552,6 +554,8 @@ void test_instruments_reset()
void do_all_tests()
{
+ PFS_atomic::init();
+
test_no_registration();
test_mutex_registration();
test_rwlock_registration();
@@ -560,6 +564,8 @@ void do_all_tests()
test_file_registration();
test_table_registration();
test_instruments_reset();
+
+ PFS_atomic::cleanup();
}
int main(int, char **)
diff --git a/storage/perfschema/unittest/pfs_timer-t.cc b/storage/perfschema/unittest/pfs_timer-t.cc
index d8663c5ccda..69b554c7b31 100644
--- a/storage/perfschema/unittest/pfs_timer-t.cc
+++ b/storage/perfschema/unittest/pfs_timer-t.cc
@@ -105,7 +105,11 @@ void test_timers()
void do_all_tests()
{
+ PFS_atomic::init();
+
test_timers();
+
+ PFS_atomic::cleanup();
}
int main(int, char **)
diff --git a/storage/perfschema/unittest/stub_server_misc.h b/storage/perfschema/unittest/stub_server_misc.h
new file mode 100644
index 00000000000..17beadbb104
--- /dev/null
+++ b/storage/perfschema/unittest/stub_server_misc.h
@@ -0,0 +1,21 @@
+/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+
+ 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 */
+
+/*
+ Minimal code to be able to link a unit test.
+*/
+
+volatile bool ready_to_exit= false;
+
diff --git a/strings/CHARSET_INFO.txt b/strings/CHARSET_INFO.txt
index bb8e40025c7..6f0a810be37 100644
--- a/strings/CHARSET_INFO.txt
+++ b/strings/CHARSET_INFO.txt
@@ -208,14 +208,11 @@ charpos() - calculates the offset of the given position in the string.
Used in SQL functions LEFT(), RIGHT(), SUBSTRING(),
INSERT()
-well_formed_length()
- - finds the length of correctly formed multi-byte beginning.
- Used in INSERTs to cut a beginning of the given string
- which is
- a) "well formed" according to the given character set.
+well_formed_len()
+ - returns length of a given multi-byte string in bytes
+ Used in INSERTs to shorten the given string so it
+ a) is "well formed" according to the given character set
b) can fit into the given data type
- Terminates the string in the good position, taking in account
- multi-byte character boundaries.
lengthsp() - returns the length of the given string without trailing spaces.
diff --git a/strings/Makefile.am b/strings/Makefile.am
deleted file mode 100644
index a8732720e10..00000000000
--- a/strings/Makefile.am
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright (C) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-# This file is public domain and comes with NO WARRANTY of any kind
-
-#
-# Note that the string library is built with #define THREAD,
-# which by default cause all the thread related code (my_pthread.h)
-# and therefore the associated instrumentation (mysql/psi/mysql_thread.h)
-# to be used.
-# Since the string code itself is not instrumented, we use
-# #define DISABLE_MYSQL_THREAD_H here to avoid unneeded dependencies.
-#
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -DDISABLE_MYSQL_THREAD_H
-pkglib_LIBRARIES = libmystrings.a
-
-# Exact one of ASSEMBLER_X
-if ASSEMBLER_x86
-ASRCS = strings-x86.s longlong2str-x86.s my_strtoll10-x86.s
-CSRCS = bfill.c bmove.c bchange.c strxnmov.c int2str.c str2int.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c longlong2str_asm.c my_strchr.c dtoa.c strmov.c strmov_overlapp.c
-else
-#no assembler
-ASRCS =
-# These file MUST all be on the same line!! Otherwise automake
-# generats a very broken makefile
-CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bchange.c strxnmov.c int2str.c str2int.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c dtoa.c strmov_overlapp.c
-endif
-
-libmystrings_a_SOURCES = $(ASRCS) $(CSRCS)
-noinst_PROGRAMS = conf_to_src
-CLEANFILES = str_test uctypedump test_decimal
-# Default charset definitions
-EXTRA_DIST = ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-win1250ch.c \
- ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-utf8.c \
- ctype-ucs2.c ctype-uca.c ctype-tis620.c ctype-ujis.c \
- xml.c decimal.c strto.c strings-x86.s \
- longlong2str.c longlong2str-x86.s longlong2str_asm.c \
- my_strtoll10.c my_strtoll10-x86.s \
- strxmov.c bmove_upp.c strappend.c strcont.c strend.c \
- strfill.c strcend.c is_prefix.c strstr.c \
- strmake.c strnmov.c strmov.c strnlen.c \
- t_ctype.h my_strchr.c CMakeLists.txt \
- CHARSET_INFO.txt strmov_overlapp.c
-
-libmystrings_a_LIBADD=
-conf_to_src_SOURCES = conf_to_src.c xml.c ctype.c
-conf_to_src_LDADD=
-#force static linking of conf_to_src - essential when linking against
-#custom installation of libc
-conf_to_src_LDFLAGS= @NOINST_LDFLAGS@
-
-# This is because the dependency tracking misses @FOO@ vars in sources.
-#strtoull.o: @CHARSET_OBJS@
-
-
-FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @NOINST_LDFLAGS@
-
-str_test: str_test.c $(pkglib_LIBRARIES)
- $(LINK) $(FLAGS) -DMAIN $(INCLUDES) $(srcdir)/str_test.c $(LDADD) $(pkglib_LIBRARIES)
-
-uctypedump: uctypedump.c
- $(LINK) $(INCLUDES) $(srcdir)/uctypedump.c
-
-test_decimal$(EXEEXT): decimal.c $(pkglib_LIBRARIES)
- $(CP) $(srcdir)/decimal.c ./test_decimal.c
- $(LINK) $(FLAGS) -DMAIN ./test_decimal.c $(LDADD) $(pkglib_LIBRARIES)
- $(RM) -f ./test_decimal.c
diff --git a/strings/bchange.c b/strings/bchange.c
index 0b2c62019b5..45eabacb767 100644
--- a/strings/bchange.c
+++ b/strings/bchange.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/bfill.c b/strings/bfill.c
deleted file mode 100644
index ccc063f59e3..00000000000
--- a/strings/bfill.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (C) 2002 MySQL AB
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; version 2
- of the License.
-
- This library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA */
-
-/* File : bfill.c
- Author : Richard A. O'Keefe.
- Michael Widenius; ifdef MC68000
- Updated: 23 April 1984
- Defines: bfill()
-
- bfill(dst, len, fill) moves "len" fill characters to "dst".
- Thus to set a buffer to 80 spaces, do bfill(buff, 80, ' ').
-*/
-
-#include <my_global.h>
-#include "m_string.h"
-
-#if !defined(bfill) && !defined(HAVE_BFILL)
-
-void bfill(dst, len, fill)
-register byte *dst;
-register uint len;
-register pchar fill;
-{
- while (len-- != 0) *dst++ = fill;
-}
-
-#endif
diff --git a/strings/bmove.c b/strings/bmove.c
deleted file mode 100644
index 0aa825558ca..00000000000
--- a/strings/bmove.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 2002 MySQL AB
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; version 2
- of the License.
-
- This library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA */
-
-/* File : bmove.c
- Author : Richard A. O'Keefe.
- Michael Widenius; ifdef MC68000
- Updated: 23 April 1984
- Defines: bmove()
-
- bmove(dst, src, len) moves exactly "len" bytes from the source "src"
- to the destination "dst". It does not check for NUL characters as
- strncpy() and strnmov() do. Thus if your C compiler doesn't support
- structure assignment, you can simulate it with
- bmove(&to, &from, sizeof from);
- The standard 4.2bsd routine for this purpose is bcopy. But as bcopy
- has its first two arguments the other way around you may find this a
- bit easier to get right.
- No value is returned.
-*/
-
-#include <my_global.h>
-#include "m_string.h"
-
-#if !defined(HAVE_BMOVE) && !defined(bmove)
-
-void bmove(dst, src, len)
-register char *dst;
-register const char *src;
-register uint len;
-{
- while (len-- != 0) *dst++ = *src++;
-}
-
-#endif
diff --git a/strings/bmove_upp.c b/strings/bmove_upp.c
index 05e786837f4..d466b69face 100644
--- a/strings/bmove_upp.c
+++ b/strings/bmove_upp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c
index d7321d3a691..3217d1a4aa6 100644
--- a/strings/conf_to_src.c
+++ b/strings/conf_to_src.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -251,7 +251,7 @@ static void
fprint_copyright(FILE *file)
{
fprintf(file,
-"/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n"
+"/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.\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"
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index 691513ec92c..b093aa6b080 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c
index b67da6f5794..9738d1068b8 100644
--- a/strings/ctype-bin.c
+++ b/strings/ctype-bin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp.
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c
index 7d6874b6ebd..c7b01450779 100644
--- a/strings/ctype-cp932.c
+++ b/strings/ctype-cp932.c
@@ -1,5 +1,4 @@
-
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c
index 81a5322d706..f0078a38bf0 100644
--- a/strings/ctype-czech.c
+++ b/strings/ctype-czech.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index 1e3279a93ad..5a6c2cb07d5 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c
index 2d5743070cb..edf29dc327b 100644
--- a/strings/ctype-eucjpms.c
+++ b/strings/ctype-eucjpms.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp.
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c
index 3e30931f579..57f900888a2 100644
--- a/strings/ctype-extra.c
+++ b/strings/ctype-extra.c
@@ -6,7 +6,7 @@
./conf_to_src ../sql/share/charsets/ > FILE
*/
-/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -1040,7 +1040,7 @@ static const uint16 to_uni_cp1251_bulgarian_ci[] = {
0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021,
-0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
+0x20AC,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F,
0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7,
@@ -1730,7 +1730,7 @@ static const uint16 to_uni_cp1251_ukrainian_ci[] = {
0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021,
-0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
+0x20AC,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F,
0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7,
@@ -3762,7 +3762,7 @@ static const uint16 to_uni_cp1251_bin[] = {
0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021,
-0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
+0x20AC,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F,
0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7,
@@ -3877,7 +3877,7 @@ static const uint16 to_uni_cp1251_general_ci[] = {
0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021,
-0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
+0x20AC,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F,
0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7,
@@ -3992,7 +3992,7 @@ static const uint16 to_uni_cp1251_general_cs[] = {
0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F,
0x0402,0x0403,0x201A,0x0453,0x201E,0x2026,0x2020,0x2021,
-0x0000,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
+0x20AC,0x2030,0x0409,0x2039,0x040A,0x040C,0x040B,0x040F,
0x0452,0x2018,0x2019,0x201C,0x201D,0x2022,0x2013,0x2014,
0x0000,0x2122,0x0459,0x203A,0x045A,0x045C,0x045B,0x045F,
0x00A0,0x040E,0x045E,0x0408,0x00A4,0x0490,0x00A6,0x00A7,
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index a327b5d0cf4..940284c535a 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index 01241e99624..0c5f67e206b 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c
index ae2590cddd5..4eba876a08f 100644
--- a/strings/ctype-latin1.c
+++ b/strings/ctype-latin1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index 76af3ef2cdf..8d864dfaad5 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -636,7 +636,7 @@ static void pad_max_char(CHARSET_INFO *cs, char *str, char *end)
DBUG_ASSERT(buflen > 0);
do
{
- if ((str + buflen) < end)
+ if ((str + buflen) <= end)
{
/* Enough space for the characer */
memcpy(str, buf, buflen);
@@ -683,7 +683,6 @@ my_bool my_like_range_mb(CHARSET_INFO *cs,
char *min_end= min_str + res_length;
char *max_end= max_str + res_length;
size_t maxcharlen= res_length / cs->mbmaxlen;
- my_bool have_contractions= my_uca_have_contractions(cs);
for (; ptr != end && min_str != min_end && maxcharlen ; maxcharlen--)
{
@@ -751,8 +750,8 @@ fill_max_and_min:
'ab\min\min\min\min' and 'ab\max\max\max\max'.
*/
- if (have_contractions && ptr + 1 < end &&
- my_uca_can_be_contraction_head(cs, (uchar) *ptr))
+ if (contraction_flags && ptr + 1 < end &&
+ contraction_flags[(uchar) *ptr])
{
/* Ptr[0] is a contraction head. */
@@ -774,8 +773,8 @@ fill_max_and_min:
is not a contraction, then we put only ptr[0],
and continue with ptr[1] on the next loop.
*/
- if (my_uca_can_be_contraction_tail(cs, (uchar) ptr[1]) &&
- my_uca_contraction2_weight(cs, (uchar) ptr[0], (uchar) ptr[1]))
+ if (contraction_flags[(uchar) ptr[1]] &&
+ cs->contractions[(*ptr-0x40)*0x40 + ptr[1] - 0x40])
{
/* Contraction found */
if (maxcharlen == 1 || min_str + 1 >= min_end)
@@ -801,6 +800,192 @@ fill_max_and_min:
}
+/**
+ Calculate min_str and max_str that ranges a LIKE string.
+ Generic function, currently used for ucs2, utf16, utf32,
+ but should be suitable for any other character sets with
+ cs->min_sort_char and cs->max_sort_char represented in
+ Unicode code points.
+
+ @param cs Character set and collation pointer
+ @param ptr Pointer to LIKE pattern.
+ @param ptr_length Length of LIKE pattern.
+ @param escape Escape character pattern, typically '\'.
+ @param w_one 'One character' pattern, typically '_'.
+ @param w_many 'Many characters' pattern, typically '%'.
+ @param res_length Length of min_str and max_str.
+
+ @param[out] min_str Smallest string that ranges LIKE.
+ @param[out] max_str Largest string that ranges LIKE.
+ @param[out] min_len Length of min_str
+ @param[out] max_len Length of max_str
+
+ @return Optimization status.
+ @retval FALSE if LIKE pattern can be optimized
+ @rerval TRUE if LIKE can't be optimized.
+*/
+my_bool
+my_like_range_generic(CHARSET_INFO *cs,
+ 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;
+ const char *min_org= min_str;
+ const char *max_org= max_str;
+ char *min_end= min_str + res_length;
+ char *max_end= max_str + res_length;
+ size_t charlen= res_length / cs->mbmaxlen;
+ size_t res_length_diff;
+ my_bool have_contractions= my_cs_have_contractions(cs);
+
+ for ( ; charlen > 0; charlen--)
+ {
+ my_wc_t wc, wc2;
+ int res;
+ if ((res= cs->cset->mb_wc(cs, &wc, (uchar*) ptr, (uchar*) end)) <= 0)
+ {
+ if (res == MY_CS_ILSEQ) /* Bad sequence */
+ return TRUE; /* min_length and max_length are not important */
+ break; /* End of the string */
+ }
+ ptr+= res;
+
+ if (wc == (my_wc_t) escape)
+ {
+ if ((res= cs->cset->mb_wc(cs, &wc, (uchar*) ptr, (uchar*) end)) <= 0)
+ {
+ if (res == MY_CS_ILSEQ)
+ return TRUE; /* min_length and max_length are not important */
+ /*
+ End of the string: Escape is the last character.
+ Put escape as a normal character.
+ We'll will leave the loop on the next iteration.
+ */
+ }
+ else
+ ptr+= res;
+
+ /* Put escape character to min_str and max_str */
+ if ((res= cs->cset->wc_mb(cs, wc,
+ (uchar*) min_str, (uchar*) min_end)) <= 0)
+ goto pad_set_lengths; /* No space */
+ min_str+= res;
+
+ if ((res= cs->cset->wc_mb(cs, wc,
+ (uchar*) max_str, (uchar*) max_end)) <= 0)
+ goto pad_set_lengths; /* No space */
+ max_str+= res;
+ continue;
+ }
+ else if (wc == (my_wc_t) w_one)
+ {
+ if ((res= cs->cset->wc_mb(cs, cs->min_sort_char,
+ (uchar*) min_str, (uchar*) min_end)) <= 0)
+ goto pad_set_lengths;
+ min_str+= res;
+
+ if ((res= cs->cset->wc_mb(cs, cs->max_sort_char,
+ (uchar*) max_str, (uchar*) max_end)) <= 0)
+ goto pad_set_lengths;
+ max_str+= res;
+ continue;
+ }
+ else if (wc == (my_wc_t) w_many)
+ {
+ /*
+ Calculate length of keys:
+ a\min\min... is the smallest possible string
+ a\max\max... is the biggest possible string
+ */
+ *min_length= ((cs->state & MY_CS_BINSORT) ?
+ (size_t) (min_str - min_org) :
+ res_length);
+ *max_length= res_length;
+ goto pad_min_max;
+ }
+
+ if (have_contractions &&
+ my_cs_can_be_contraction_head(cs, wc) &&
+ (res= cs->cset->mb_wc(cs, &wc2, (uchar*) ptr, (uchar*) end)) > 0)
+ {
+ uint16 *weight;
+ if ((wc2 == (my_wc_t) w_one || wc2 == (my_wc_t) w_many))
+ {
+ /* Contraction head followed by a wildcard */
+ *min_length= *max_length= res_length;
+ goto pad_min_max;
+ }
+
+ if (my_cs_can_be_contraction_tail(cs, wc2) &&
+ (weight= my_cs_contraction2_weight(cs, wc, wc2)) && weight[0])
+ {
+ /* Contraction found */
+ if (charlen == 1)
+ {
+ /* contraction does not fit to result */
+ *min_length= *max_length= res_length;
+ goto pad_min_max;
+ }
+
+ ptr+= res;
+ charlen--;
+
+ /* Put contraction head */
+ if ((res= cs->cset->wc_mb(cs, wc,
+ (uchar*) min_str, (uchar*) min_end)) <= 0)
+ goto pad_set_lengths;
+ min_str+= res;
+
+ if ((res= cs->cset->wc_mb(cs, wc,
+ (uchar*) max_str, (uchar*) max_end)) <= 0)
+ goto pad_set_lengths;
+ max_str+= res;
+ wc= wc2; /* Prepare to put contraction tail */
+ }
+ }
+
+ /* Normal character, or contraction tail */
+ if ((res= cs->cset->wc_mb(cs, wc,
+ (uchar*) min_str, (uchar*) min_end)) <= 0)
+ goto pad_set_lengths;
+ min_str+= res;
+ if ((res= cs->cset->wc_mb(cs, wc,
+ (uchar*) max_str, (uchar*) max_end)) <= 0)
+ goto pad_set_lengths;
+ max_str+= res;
+ }
+
+pad_set_lengths:
+ *min_length= (size_t) (min_str - min_org);
+ *max_length= (size_t) (max_str - max_org);
+
+pad_min_max:
+ /*
+ Fill up max_str and min_str to res_length.
+ fill() cannot set incomplete characters and
+ requires that "length" argument is divisible to mbminlen.
+ Make sure to call fill() with proper "length" argument.
+ */
+ res_length_diff= res_length % cs->mbminlen;
+ cs->cset->fill(cs, min_str, min_end - min_str - res_length_diff,
+ cs->min_sort_char);
+ cs->cset->fill(cs, max_str, max_end - max_str - res_length_diff,
+ cs->max_sort_char);
+
+ /* In case of incomplete characters set the remainder to 0x00's */
+ if (res_length_diff)
+ {
+ /* Example: odd res_length for ucs2 */
+ memset(min_end - res_length_diff, 0, res_length_diff);
+ memset(max_end - res_length_diff, 0, res_length_diff);
+ }
+ return FALSE;
+}
+
+
int
my_wildcmp_mb_bin(CHARSET_INFO *cs,
const char *str,const char *str_end,
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 6c1dcb7481e..3507bd279eb 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index 2b51ae6416f..7e06fe828ff 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index 29ec013849c..f62c2619e1f 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2003 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index fcef2c68967..a8b12e13e39 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -36,11 +36,6 @@
#include "m_ctype.h"
-#define MY_UCA_CNT_FLAG_SIZE 4096
-#define MY_UCA_CNT_FLAG_MASK 4095
-#define MY_UCA_CNT_HEAD 1
-#define MY_UCA_CNT_TAIL 2
-
#ifdef HAVE_UCA_COLLATIONS
#define MY_UCA_NPAGES 256
@@ -6770,7 +6765,7 @@ typedef struct my_uca_scanner_st
const uchar *send; /* End of the input string */
const uchar *uca_length;
const uint16 * const *uca_weight;
- const MY_CONTRACTIONS *contractions;
+ uint16 *contractions;
uint16 implicit[2];
int page;
int code;
@@ -6790,80 +6785,6 @@ typedef struct my_uca_scanner_handler_st
static const uint16 nochar[]= {0,0};
-/********** Helper functions to handle contraction ************/
-
-
-/**
- Mark a character as a contraction part
-
- @cs Pointer to CHARSET_INFO data
- @wc Unicode code point
- @flag flag: "is contraction head", "is contraction tail"
-*/
-
-static void
-my_uca_add_contraction_flag(CHARSET_INFO *cs, my_wc_t wc, int flag)
-{
- cs->contractions->flags[wc & MY_UCA_CNT_FLAG_MASK]|= flag;
-}
-
-
-/**
- Add a new contraction into contraction list
-
- @cs Pointer to CHARSET_INFO data
- @wc Unicode code points of the characters
- @len Number of characters
-
- @return New contraction
- @retval Pointer to a newly added contraction
-*/
-
-static MY_CONTRACTION *
-my_uca_add_contraction(struct charset_info_st *cs,
- my_wc_t *wc, int len __attribute__((unused)))
-{
- MY_CONTRACTIONS *list= (MY_CONTRACTIONS*) cs->contractions;
- MY_CONTRACTION *next= &list->item[list->nitems];
- DBUG_ASSERT(len == 2); /* We currently support only contraction2 */
- next->ch[0]= wc[0];
- next->ch[1]= wc[1];
- list->nitems++;
- return next;
-}
-
-
-/**
- Allocate and initialize memory for contraction list and flags
-
- @cs Pointer to CHARSET_INFO data
- @alloc Memory allocation function (typically points to my_alloc_once)
- @n Number of contractions
-
- @return Error code
- @retval 0 - memory allocated successfully
- @retval 1 - not enough memory
-*/
-
-static my_bool
-my_uca_alloc_contractions(struct charset_info_st *cs,
- void *(*alloc)(size_t), size_t n)
-{
- uint size= n * sizeof(MY_CONTRACTION);
- MY_CONTRACTIONS *contractions;
-
- if (!(cs->contractions= contractions= (*alloc)(sizeof(MY_CONTRACTIONS))))
- return 1;
- bzero(contractions, sizeof(MY_CONTRACTIONS));
- if (!(contractions->item= (*alloc)(size)) ||
- !(contractions->flags= (char*) (*alloc)(MY_UCA_CNT_FLAG_SIZE)))
- return 1;
- bzero(contractions->item, size);
- bzero(contractions->flags, MY_UCA_CNT_FLAG_SIZE);
- return 0;
-}
-
-
#ifdef HAVE_CHARSET_ucs2
/*
Initialize collation weight scanner
@@ -6883,7 +6804,7 @@ my_uca_alloc_contractions(struct charset_info_st *cs,
*/
static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner,
- CHARSET_INFO *cs,
+ CHARSET_INFO *cs __attribute__((unused)),
const uchar *str, size_t length)
{
scanner->wbeg= nochar;
@@ -6894,7 +6815,6 @@ static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner,
scanner->uca_length= cs->sort_order;
scanner->uca_weight= cs->sort_order_big;
scanner->contractions= cs->contractions;
- scanner->cs= cs;
return;
}
@@ -6983,23 +6903,18 @@ static int my_uca_scanner_next_ucs2(my_uca_scanner *scanner)
if (scanner->contractions && (scanner->sbeg <= scanner->send))
{
- my_wc_t wc1= ((scanner->page << 8) | scanner->code);
+ int cweight;
- if (my_uca_can_be_contraction_head(scanner->cs, wc1))
- {
- const uint16 *cweight;
- my_wc_t wc2= (((my_wc_t) scanner->sbeg[0]) << 8) | scanner->sbeg[1];
- if (my_uca_can_be_contraction_tail(scanner->cs, wc2) &&
- (cweight= my_uca_contraction2_weight(scanner->cs,
- scanner->code,
- scanner->sbeg[1])))
+ if (!scanner->page && !scanner->sbeg[0] &&
+ (scanner->sbeg[1] > 0x40) && (scanner->sbeg[1] < 0x80) &&
+ (scanner->code > 0x40) && (scanner->code < 0x80) &&
+ (cweight= scanner->contractions[(scanner->code-0x40)*0x40+scanner->sbeg[1]-0x40]))
{
scanner->implicit[0]= 0;
scanner->wbeg= scanner->implicit;
scanner->sbeg+=2;
- return *cweight;
+ return cweight;
}
- }
}
if (!ucaw[scanner->page])
@@ -7091,22 +7006,23 @@ static int my_uca_scanner_next_any(my_uca_scanner *scanner)
scanner->code= wc & 0xFF;
}
- if (my_uca_have_contractions(scanner->cs) &&
- my_uca_can_be_contraction_head(scanner->cs, wc))
+ if (scanner->contractions && !scanner->page &&
+ (scanner->code > 0x40) && (scanner->code < 0x80))
{
- my_wc_t wc2;
- const uint16 *cweight;
+ uint page1, code1, cweight;
- if (((mb_len= scanner->cs->cset->mb_wc(scanner->cs, &wc2,
+ if (((mb_len= scanner->cs->cset->mb_wc(scanner->cs, &wc,
scanner->sbeg,
scanner->send)) >=0) &&
- my_uca_can_be_contraction_tail(scanner->cs, wc2) &&
- (cweight= my_uca_contraction2_weight(scanner->cs, wc, wc2)))
+ (!(page1= (wc >> 8))) &&
+ ((code1= (wc & 0xFF)) > 0x40) &&
+ (code1 < 0x80) &&
+ (cweight= scanner->contractions[(scanner->code-0x40)*0x40 + code1-0x40]))
{
scanner->implicit[0]= 0;
scanner->wbeg= scanner->implicit;
scanner->sbeg+= mb_len;
- return *cweight;
+ return cweight;
}
}
@@ -7145,31 +7061,6 @@ static my_uca_scanner_handler my_any_uca_scanner_handler=
-/**
- Helper function:
- Find address of weights of the given character.
-
- @weights UCA weight array
- @lengths UCA length array
- @ch character Unicode code point
-
- @return Weight array
- @retval pointer to weight array for the given character,
- or NULL if this page does not have implicit weights.
-*/
-
-static inline const uint16 *
-my_char_weight_addr(CHARSET_INFO *cs, uint wc)
-{
- uint page= (wc >> 8);
- uint ofst= wc & 0xFF;
- return (cs->sort_order_big[page] ?
- cs->sort_order_big[page] + ofst * cs->sort_order[page] :
- 0);
-}
-
-
-
/*
Compares two strings according to the collation
@@ -7846,8 +7737,8 @@ ex:
typedef struct my_coll_rule_item_st
{
- my_wc_t base; /* Base character */
- my_wc_t curr[2]; /* Current character */
+ uint base; /* Base character */
+ uint curr[2]; /* Current character */
int diff[3]; /* Primary, Secondary and Tertiary difference */
} MY_COLL_RULE;
@@ -8002,7 +7893,6 @@ static my_bool create_tailoring(struct charset_info_st *cs,
void *(*alloc)(size_t))
{
MY_COLL_RULE rule[MY_MAX_COLL_RULE];
- MY_COLL_RULE *r, *rfirst, *rlast;
char errstr[128];
uchar *newlengths;
uint16 **newweights;
@@ -8027,9 +7917,6 @@ static my_bool create_tailoring(struct charset_info_st *cs,
return 1;
}
- rfirst= rule;
- rlast= rule + rc;
-
if (!cs->caseinfo)
cs->caseinfo= my_unicase_default;
@@ -8113,21 +8000,44 @@ static my_bool create_tailoring(struct charset_info_st *cs,
/* Now process contractions */
if (ncontractions)
{
- if (my_uca_alloc_contractions(cs, alloc, ncontractions))
- return 1;
- for (r= rfirst; r < rlast; r++)
+ /*
+ 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++)
{
- uint16 *to;
- if (r->curr[1]) /* Contraction */
+ if (rule[i].curr[1])
{
- /* Mark both letters as "is contraction part" */
- my_uca_add_contraction_flag(cs, r->curr[0], MY_UCA_CNT_HEAD);
- my_uca_add_contraction_flag(cs, r->curr[1], MY_UCA_CNT_TAIL);
- to= my_uca_add_contraction(cs, r->curr, 2)->weight;
- /* Copy weight from the reset character */
- to[0]= my_char_weight_addr(cs, r->base)[0];
- /* Apply primary difference */
- to[0]+= r->diff[0];
+ uint pageb= (rule[i].base >> 8) & 0xFF;
+ uint chb= rule[i].base & 0xFF;
+ uint16 *offsb= defweights[pageb] + chb*deflengths[pageb];
+ uint offsc;
+
+ if (offsb[1] ||
+ rule[i].curr[0] < 0x40 || rule[i].curr[0] > 0x7f ||
+ rule[i].curr[1] < 0x40 || rule[i].curr[1] > 0x7f)
+ {
+ /*
+ TODO: add error reporting;
+ We support only basic latin letters contractions at this point.
+ Also, We don't support contractions with weight longer than one.
+ Otherwise, we'd need much more memory.
+ */
+ return 1;
+ }
+ offsc= (rule[i].curr[0]-0x40)*0x40+(rule[i].curr[1]-0x40);
+
+ /* 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;
}
}
}
@@ -8229,7 +8139,7 @@ MY_COLLATION_HANDLER my_collation_ucs2_uca_handler =
my_strnncollsp_ucs2_uca,
my_strnxfrm_ucs2_uca,
my_strnxfrmlen_simple,
- my_like_range_ucs2,
+ my_like_range_generic,
my_wildcmp_uca,
NULL,
my_instr_mb,
@@ -9593,7 +9503,7 @@ struct charset_info_st my_charset_utf8_sinhala_uca_ci=
8, /* strxfrm_multiply */
1, /* caseup_multiply */
1, /* casedn_multiply */
- 3, /* mbminlen */
+ 1, /* mbminlen */
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
@@ -10330,7 +10240,7 @@ MY_COLLATION_HANDLER my_collation_utf32_uca_handler =
my_strnncollsp_any_uca,
my_strnxfrm_any_uca,
my_strnxfrmlen_simple,
- my_like_range_utf32,
+ my_like_range_generic,
my_wildcmp_uca,
NULL,
my_instr_mb,
@@ -11028,7 +10938,7 @@ MY_COLLATION_HANDLER my_collation_utf16_uca_handler =
my_strnncollsp_any_uca,
my_strnxfrm_any_uca,
my_strnxfrmlen_simple,
- my_like_range_utf16,
+ my_like_range_generic,
my_wildcmp_uca,
NULL,
my_instr_mb,
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index e9c69c628da..64652bf6d36 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -903,7 +903,8 @@ static void
my_fill_mb2(CHARSET_INFO *cs __attribute__((unused)),
char *s, size_t l, int fill)
{
- for ( ; l >= 2; s[0]= 0, s[1]= fill, s+= 2, l-= 2);
+ DBUG_ASSERT(fill <= 0xFFFF);
+ for ( ; l >= 2; s[0]= (fill >> 8), s[1]= (fill & 0xFF), s+= 2, l-= 2);
}
@@ -1205,12 +1206,10 @@ my_strnncoll_utf16(CHARSET_INFO *cs,
my_bool t_is_prefix)
{
int s_res, t_res;
- my_wc_t s_wc,t_wc;
+ my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const uchar *se= s + slen;
const uchar *te= t + tlen;
MY_UNICASE_INFO *const *uni_plane= cs->caseinfo;
- LINT_INIT(s_wc);
- LINT_INIT(t_wc);
while (s < se && t < te)
{
@@ -1271,11 +1270,9 @@ my_strnncollsp_utf16(CHARSET_INFO *cs,
my_bool diff_if_only_endspace_difference)
{
int res;
- my_wc_t s_wc, t_wc;
+ my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const uchar *se= s + slen, *te= t + tlen;
MY_UNICASE_INFO *const *uni_plane= cs->caseinfo;
- LINT_INIT(s_wc);
- LINT_INIT(t_wc);
DBUG_ASSERT((slen % 2) == 0);
DBUG_ASSERT((tlen % 2) == 0);
@@ -1451,17 +1448,15 @@ my_strnncoll_utf16_bin(CHARSET_INFO *cs,
my_bool t_is_prefix)
{
int s_res,t_res;
- my_wc_t s_wc,t_wc;
+ my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const uchar *se=s+slen;
const uchar *te=t+tlen;
- LINT_INIT(s_wc);
- LINT_INIT(t_wc);
while ( s < se && t < te )
{
s_res= my_utf16_uni(cs,&s_wc, s, se);
t_res= my_utf16_uni(cs,&t_wc, t, te);
-
+
if (s_res <= 0 || t_res <= 0)
{
/* Incorrect string, compare by char value */
@@ -1469,9 +1464,9 @@ my_strnncoll_utf16_bin(CHARSET_INFO *cs,
}
if (s_wc != t_wc)
{
- return my_bincmp(s, s + s_res, t, t + t_res);
+ return s_wc > t_wc ? 1 : -1;
}
-
+
s+= s_res;
t+= t_res;
}
@@ -1486,10 +1481,8 @@ my_strnncollsp_utf16_bin(CHARSET_INFO *cs,
my_bool diff_if_only_endspace_difference)
{
int res;
- my_wc_t s_wc, t_wc;
+ my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
const uchar *se= s + slen, *te= t + tlen;
- LINT_INIT(s_wc);
- LINT_INIT(t_wc);
DBUG_ASSERT((slen % 2) == 0);
DBUG_ASSERT((tlen % 2) == 0);
@@ -1511,7 +1504,7 @@ my_strnncollsp_utf16_bin(CHARSET_INFO *cs,
if (s_wc != t_wc)
{
- return my_bincmp(s, s + s_res, t, t + t_res);
+ return s_wc > t_wc ? 1 : -1;
}
s+= s_res;
@@ -1571,98 +1564,6 @@ my_hash_sort_utf16_bin(CHARSET_INFO *cs __attribute__((unused)),
}
-/**
- Calculate min_str and max_str that ranges a LIKE string.
-
- @param ptr Pointer to LIKE pattern.
- @param ptr_length Length of LIKE pattern.
- @param escape Escape character in LIKE. (Normally '\').
- All escape characters should be removed
- from min_str and max_str.
- @param res_length Length of min_str and max_str.
- @param min_str Smallest case sensitive string that ranges LIKE.
- Should be space padded to res_length.
- @param max_str Largest case sensitive string that ranges LIKE.
- Normally padded with the biggest character sort value.
-
- @return Optimization status.
- @retval FALSE if LIKE pattern can be optimized
- @rerval TRUE if LIKE can't be optimized.
-*/
-
-my_bool
-my_like_range_utf16(CHARSET_INFO *cs,
- 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;
- char *min_end=min_str+res_length;
- size_t charlen= res_length / cs->mbmaxlen;
-
- for ( ; ptr + 1 < end && min_str + 1 < min_end && charlen > 0
- ; ptr+=2, charlen--)
- {
- if (ptr[0] == '\0' && ptr[1] == escape && ptr + 1 < end)
- {
- ptr+=2; /* Skip escape */
- *min_str++= *max_str++ = ptr[0];
- *min_str++= *max_str++ = ptr[1];
- continue;
- }
- if (ptr[0] == '\0' && ptr[1] == w_one) /* '_' in SQL */
- {
- *min_str++= (char) (cs->min_sort_char >> 8);
- *min_str++= (char) (cs->min_sort_char & 255);
- *max_str++= (char) (cs->max_sort_char >> 8);
- *max_str++= (char) (cs->max_sort_char & 255);
- continue;
- }
- if (ptr[0] == '\0' && ptr[1] == w_many) /* '%' in SQL */
- {
- /*
- 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) ? (size_t) (min_str - min_org) :
- res_length);
- *max_length= res_length;
- do {
- *min_str++ = 0;
- *min_str++ = 0;
- *max_str++ = (char) (cs->max_sort_char >> 8);
- *max_str++ = (char) (cs->max_sort_char & 255);
- } while (min_str + 1 < min_end);
- return FALSE;
- }
- *min_str++= *max_str++ = ptr[0];
- *min_str++= *max_str++ = ptr[1];
- }
-
- /* Temporary fix for handling w_one at end of string (key compression) */
- {
- char *tmp;
- for (tmp= min_str ; tmp-1 > min_org && tmp[-1] == '\0' && tmp[-2]=='\0';)
- {
- *--tmp=' ';
- *--tmp='\0';
- }
- }
-
- *min_length= *max_length = (size_t) (min_str - min_org);
- while (min_str + 1 < min_end)
- {
- *min_str++ = *max_str++ = '\0';
- *min_str++ = *max_str++ = ' '; /* Because if key compression */
- }
- return FALSE;
-}
-
-
static MY_COLLATION_HANDLER my_collation_utf16_general_ci_handler =
{
NULL, /* init */
@@ -1670,7 +1571,7 @@ static MY_COLLATION_HANDLER my_collation_utf16_general_ci_handler =
my_strnncollsp_utf16,
my_strnxfrm_unicode,
my_strnxfrmlen_simple,
- my_like_range_utf16,
+ my_like_range_generic,
my_wildcmp_utf16_ci,
my_strcasecmp_mb2_or_mb4,
my_instr_mb,
@@ -1686,7 +1587,7 @@ static MY_COLLATION_HANDLER my_collation_utf16_bin_handler =
my_strnncollsp_utf16_bin,
my_strnxfrm_unicode_full_bin,
my_strnxfrmlen_unicode_full_bin,
- my_like_range_utf16,
+ my_like_range_generic,
my_wildcmp_utf16_bin,
my_strcasecmp_mb2_or_mb4,
my_instr_mb,
@@ -2559,113 +2460,6 @@ my_strnncollsp_utf32_bin(CHARSET_INFO *cs __attribute__((unused)),
}
-/**
- Calculate min_str and max_str that ranges a LIKE string.
-
- @param ptr Pointer to LIKE pattern.
- @param ptr_length Length of LIKE pattern.
- @param escape Escape character in LIKE. (Normally '\').
- All escape characters should be removed
- from min_str and max_str.
- @param res_length Length of min_str and max_str.
- @param min_str Smallest case sensitive string that ranges LIKE.
- Should be space padded to res_length.
- @param max_str Largest case sensitive string that ranges LIKE.
- Normally padded with the biggest character sort value.
-
- @return Optimization status.
- @retval FALSE if LIKE pattern can be optimized
- @rerval TRUE if LIKE can't be optimized.
-*/
-
-my_bool
-my_like_range_utf32(CHARSET_INFO *cs,
- 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;
- char *min_end= min_str + res_length;
- char *max_end= max_str + res_length;
- size_t charlen= res_length / cs->mbmaxlen;
-
- DBUG_ASSERT((res_length % 4) == 0);
-
- for ( ; charlen > 0; ptr+= 4, charlen--)
- {
- my_wc_t wc;
- int res;
- if ((res= my_utf32_uni(cs, &wc, (uchar*) ptr, (uchar*) end)) < 0)
- {
- my_fill_utf32(cs, min_str, min_end - min_str, cs->min_sort_char);
- my_fill_utf32(cs, max_str, min_end - min_str, cs->max_sort_char);
- /* min_length and max_legnth are not important */
- return TRUE;
- }
-
- if (wc == (my_wc_t) escape)
- {
- ptr+= 4; /* Skip escape */
- if ((res= my_utf32_uni(cs, &wc, (uchar*) ptr, (uchar*) end)) < 0)
- {
- my_fill_utf32(cs, min_str, min_end - min_str, cs->min_sort_char);
- my_fill_utf32(cs, max_str, max_end - min_str, cs->max_sort_char);
- /* min_length and max_length are not important */
- return TRUE;
- }
- if (my_uni_utf32(cs, wc, (uchar*) min_str, (uchar*) min_end) != 4 ||
- my_uni_utf32(cs, wc, (uchar*) max_str, (uchar*) max_end) != 4)
- goto pad_set_lengths;
- *min_str++= 4;
- *max_str++= 4;
- continue;
- }
-
- if (wc == (my_wc_t) w_one)
- {
- if (my_uni_utf32(cs, cs->min_sort_char, (uchar*) min_str, (uchar*) min_end) != 4 ||
- my_uni_utf32(cs, cs->max_sort_char, (uchar*) max_str, (uchar*) max_end) != 4)
- goto pad_set_lengths;
- min_str+= 4;
- max_str+= 4;
- continue;
- }
-
- if (wc == (my_wc_t) w_many)
- {
- /*
- 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) ?
- (size_t) (min_str - min_org) :
- res_length);
- *max_length= res_length;
- goto pad_min_max;
- }
-
- /* Normal character */
- if (my_uni_utf32(cs, wc, (uchar*) min_str, (uchar*) min_end) != 4 ||
- my_uni_utf32(cs, wc, (uchar*) max_str, (uchar*) max_end) != 4)
- goto pad_set_lengths;
- min_str+= 4;
- max_str+= 4;
- }
-
-pad_set_lengths:
- *min_length= *max_length= (size_t) (min_str - min_org);
-
-pad_min_max:
- my_fill_utf32(cs, min_str, min_end - min_str, cs->min_sort_char);
- my_fill_utf32(cs, max_str, max_end - max_str, cs->max_sort_char);
- return FALSE;
-}
-
-
static size_t
my_scan_utf32(CHARSET_INFO *cs,
const char *str, const char *end, int sequence_type)
@@ -2697,7 +2491,7 @@ static MY_COLLATION_HANDLER my_collation_utf32_general_ci_handler =
my_strnncollsp_utf32,
my_strnxfrm_unicode,
my_strnxfrmlen_utf32,
- my_like_range_utf32,
+ my_like_range_generic,
my_wildcmp_utf32_ci,
my_strcasecmp_mb2_or_mb4,
my_instr_mb,
@@ -2713,7 +2507,7 @@ static MY_COLLATION_HANDLER my_collation_utf32_bin_handler =
my_strnncollsp_utf32_bin,
my_strnxfrm_unicode_full_bin,
my_strnxfrmlen_unicode_full_bin,
- my_like_range_utf32,
+ my_like_range_generic,
my_wildcmp_utf32_bin,
my_strcasecmp_mb2_or_mb4,
my_instr_mb,
@@ -2899,7 +2693,10 @@ static int my_uni_ucs2(CHARSET_INFO *cs __attribute__((unused)) ,
{
if ( r+2 > e )
return MY_CS_TOOSMALL2;
-
+
+ if (wc > 0xFFFF) /* UCS2 does not support characters outside BMP */
+ return MY_CS_ILUNI;
+
r[0]= (uchar) (wc >> 8);
r[1]= (uchar) (wc & 0xFF);
return 2;
@@ -3261,129 +3058,6 @@ void my_hash_sort_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
}
-static inline my_wc_t
-ucs2_to_wc(const uchar *ptr)
-{
- return (((uint) ptr[0]) << 8) + ptr[1];
-}
-
-
-/*
-** Calculate min_str and max_str that ranges a LIKE string.
-** Arguments:
-** ptr Pointer to LIKE string.
-** ptr_length Length of LIKE string.
-** escape Escape character in LIKE. (Normally '\').
-** All escape characters should be removed from min_str and max_str
-** res_length Length of min_str and max_str.
-** min_str Smallest case sensitive string that ranges LIKE.
-** Should be space padded to res_length.
-** max_str Largest case sensitive string that ranges LIKE.
-** Normally padded with the biggest character sort value.
-**
-** The function should return 0 if ok and 1 if the LIKE string can't be
-** optimized !
-*/
-
-my_bool my_like_range_ucs2(CHARSET_INFO *cs,
- 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;
- char *min_end=min_str+res_length;
- size_t charlen= res_length / cs->mbmaxlen;
- my_bool have_contractions= my_uca_have_contractions(cs);
-
- for ( ; ptr + 1 < end && min_str + 1 < min_end && charlen > 0
- ; ptr+=2, charlen--)
- {
- my_wc_t wc;
- if (ptr[0] == '\0' && ptr[1] == escape && ptr + 1 < end)
- {
- ptr+=2; /* Skip escape */
- *min_str++= *max_str++ = ptr[0];
- *min_str++= *max_str++ = ptr[1];
- continue;
- }
- if (ptr[0] == '\0' && ptr[1] == w_one) /* '_' in SQL */
- {
- *min_str++= (char) (cs->min_sort_char >> 8);
- *min_str++= (char) (cs->min_sort_char & 255);
- *max_str++= (char) (cs->max_sort_char >> 8);
- *max_str++= (char) (cs->max_sort_char & 255);
- continue;
- }
- 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) ? (size_t) (min_str - min_org) :
- res_length);
- *max_length= res_length;
- do {
- *min_str++ = 0;
- *min_str++ = 0;
- *max_str++ = (char) (cs->max_sort_char >> 8);
- *max_str++ = (char) (cs->max_sort_char & 255);
- } while (min_str + 1 < min_end);
- return 0;
- }
-
- if (have_contractions && ptr + 3 < end &&
- my_uca_can_be_contraction_head(cs, (wc= ucs2_to_wc((uchar*) ptr))))
- {
- my_wc_t wc2;
- /* 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 (my_uca_can_be_contraction_tail(cs, (wc2= ucs2_to_wc((uchar*) ptr + 2))) &&
- my_uca_contraction2_weight(cs, wc , wc2))
- {
- /* 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];
- }
-
- *min_length= *max_length = (size_t) (min_str - min_org);
- while (min_str + 1 < min_end)
- {
- *min_str++ = *max_str++ = '\0';
- *min_str++ = *max_str++ = ' '; /* Because if key compression */
- }
- return 0;
-}
-
-
-
static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler =
{
NULL, /* init */
@@ -3391,7 +3065,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler =
my_strnncollsp_ucs2,
my_strnxfrm_unicode,
my_strnxfrmlen_simple,
- my_like_range_ucs2,
+ my_like_range_generic,
my_wildcmp_ucs2_ci,
my_strcasecmp_mb2_or_mb4,
my_instr_mb,
@@ -3407,7 +3081,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler =
my_strnncollsp_ucs2_bin,
my_strnxfrm_unicode,
my_strnxfrmlen_simple,
- my_like_range_ucs2,
+ my_like_range_generic,
my_wildcmp_ucs2_bin,
my_strcasecmp_mb2_or_mb4,
my_instr_mb,
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index 0f6cf990701..5ef752412d6 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp.
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 4b0265693b6..729d9c41a54 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -1965,17 +1965,6 @@ my_strnxfrm_unicode_full_bin(CHARSET_INFO *cs,
if ((res= cs->cset->mb_wc(cs, &wc, src, se)) <= 0)
break;
src+= res;
- if (cs->mbminlen == 2) /* utf16_bin */
- {
- /*
- Reorder code points to weights as follows:
- U+0000..U+D7FF -> [00][00][00]..[00][D7][FF] BMP part #1
- U+10000..U+10FFFF -> [01][00][00]..[10][FF][FF] Supplementary
- U+E000..U+FFFF -> [20][E0][00]..[20][FF][FF] BMP part #2
- */
- if (wc >= 0xE000 && wc <= 0xFFFF)
- wc+= 0x200000;
- }
*dst++= (uchar) (wc >> 16);
*dst++= (uchar) ((wc >> 8) & 0xFF);
*dst++= (uchar) (wc & 0xFF);
diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c
index ba61a3bbeea..9a6d21567ed 100644
--- a/strings/ctype-win1250ch.c
+++ b/strings/ctype-win1250ch.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/ctype.c b/strings/ctype.c
index 873255ad0d8..338ed75198a 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/decimal.c b/strings/decimal.c
index d606bebf152..6e0edf6a513 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,8 +13,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#line 18 "decimal.c"
-
/*
=======================================================================
NOTE: this library implements SQL standard "exact numeric" type
@@ -250,7 +248,7 @@ void max_decimal(int precision, int frac, decimal_t *to)
}
-static dec1 *remove_leading_zeroes(decimal_t *from, int *intg_result)
+static dec1 *remove_leading_zeroes(const decimal_t *from, int *intg_result)
{
int intg= from->intg, i;
dec1 *buf0= from->buf;
@@ -314,8 +312,8 @@ int decimal_actual_fraction(decimal_t *from)
from - value to convert
to - points to buffer where string representation
should be stored
- *to_len - in: size of to buffer
- out: length of the actually written string
+ *to_len - in: size of to buffer (incl. terminating '\0')
+ out: length of the actually written string (excl. '\0')
fixed_precision - 0 if representation can be variable length and
fixed_decimals will not be checked in this case.
Put number as with fixed point position with this
@@ -328,10 +326,11 @@ int decimal_actual_fraction(decimal_t *from)
E_DEC_OK/E_DEC_TRUNCATED/E_DEC_OVERFLOW
*/
-int decimal2string(decimal_t *from, char *to, int *to_len,
+int decimal2string(const decimal_t *from, char *to, int *to_len,
int fixed_precision, int fixed_decimals,
char filler)
{
+ /* {intg_len, frac_len} output widths; {intg, frac} places in input */
int len, intg, frac= from->frac, i, intg_len, frac_len, fill;
/* number digits before decimal point */
int fixed_intg= (fixed_precision ?
@@ -944,7 +943,7 @@ fatal_error:
E_DEC_OK/E_DEC_OVERFLOW/E_DEC_TRUNCATED
*/
-int decimal2double(decimal_t *from, double *to)
+int decimal2double(const decimal_t *from, double *to)
{
char strbuf[FLOATING_POINT_BUFFER], *end;
int len= sizeof(strbuf);
@@ -1463,7 +1462,7 @@ int decimal_bin_size(int precision, int scale)
*/
int
-decimal_round(decimal_t *from, decimal_t *to, int scale,
+decimal_round(const decimal_t *from, decimal_t *to, int scale,
decimal_round_mode mode)
{
int frac0=scale>0 ? ROUND_UP(scale) : scale/DIG_PER_DEC1,
@@ -1697,7 +1696,7 @@ int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, int param)
return -1; /* shut up the warning */
}
-static int do_add(decimal_t *from1, decimal_t *from2, decimal_t *to)
+static int do_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to)
{
int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg),
frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac),
@@ -1779,7 +1778,7 @@ static int do_add(decimal_t *from1, decimal_t *from2, decimal_t *to)
/* to=from1-from2.
if to==0, return -1/0/+1 - the result of the comparison */
-static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
+static int do_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to)
{
int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg),
frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac);
@@ -1849,7 +1848,7 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
/* ensure that always from1 > from2 (and intg1 >= intg2) */
if (carry)
{
- swap_variables(decimal_t *,from1,from1);
+ swap_variables(const decimal_t *, from1, from2);
swap_variables(dec1 *,start1, start2);
swap_variables(int,intg1,intg2);
swap_variables(int,frac1,frac2);
@@ -1915,35 +1914,35 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
return error;
}
-int decimal_intg(decimal_t *from)
+int decimal_intg(const decimal_t *from)
{
int res;
remove_leading_zeroes(from, &res);
return res;
}
-int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to)
+int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to)
{
if (likely(from1->sign == from2->sign))
return do_add(from1, from2, to);
return do_sub(from1, from2, to);
}
-int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
+int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to)
{
if (likely(from1->sign == from2->sign))
return do_sub(from1, from2, to);
return do_add(from1, from2, to);
}
-int decimal_cmp(decimal_t *from1, decimal_t *from2)
+int decimal_cmp(const decimal_t *from1, const decimal_t *from2)
{
if (likely(from1->sign == from2->sign))
return do_sub(from1, from2, 0);
return from1->sign > from2->sign ? -1 : 1;
}
-int decimal_is_zero(decimal_t *from)
+int decimal_is_zero(const decimal_t *from)
{
dec1 *buf1=from->buf,
*end=buf1+ROUND_UP(from->intg)+ROUND_UP(from->frac);
@@ -1974,7 +1973,7 @@ int decimal_is_zero(decimal_t *from)
XXX if this library is to be used with huge numbers of thousands of
digits, fast multiplication must be implemented.
*/
-int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to)
+int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to)
{
int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg),
frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac),
@@ -2098,8 +2097,8 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to)
changed to malloc (or at least fallback to malloc if alloca() fails)
but then, decimal_mul() should be rewritten too :(
*/
-static int do_div_mod(decimal_t *from1, decimal_t *from2,
- decimal_t *to, decimal_t *mod, int scale_incr)
+static int do_div_mod(const decimal_t *from1, const decimal_t *from2,
+ decimal_t *to, decimal_t *mod, int scale_incr)
{
int frac1=ROUND_UP(from1->frac)*DIG_PER_DEC1, prec1=from1->intg+frac1,
frac2=ROUND_UP(from2->frac)*DIG_PER_DEC1, prec2=from2->intg+frac2,
@@ -2184,9 +2183,12 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2,
}
buf0=to->buf;
stop0=buf0+intg0+frac0;
+ DBUG_ASSERT(stop0 <= &to->buf[to->len]);
if (likely(div_mod))
- while (dintg++ < 0)
+ while (dintg++ < 0 && buf0 < &to->buf[to->len])
+ {
*buf0++=0;
+ }
len1=(i=ROUND_UP(prec1))+ROUND_UP(2*frac2+scale_incr+1) + 1;
set_if_bigger(len1, 3);
@@ -2358,7 +2360,8 @@ done:
*/
int
-decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, int scale_incr)
+decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to,
+ int scale_incr)
{
return do_div_mod(from1, from2, to, 0, scale_incr);
}
@@ -2390,7 +2393,7 @@ decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, int scale_incr)
thus, there's no requirement for M or N to be integers
*/
-int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to)
+int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to)
{
return do_div_mod(from1, from2, 0, to, 0);
}
diff --git a/strings/do_ctype.c b/strings/do_ctype.c
index f87d55b6251..9bdbd3d27eb 100644
--- a/strings/do_ctype.c
+++ b/strings/do_ctype.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/dtoa.c b/strings/dtoa.c
index d64c420b499..59aa056df9c 100644
--- a/strings/dtoa.c
+++ b/strings/dtoa.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007 MySQL AB
+/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
diff --git a/strings/dump_map.c b/strings/dump_map.c
index e2b8b7db077..60bd91541c4 100644
--- a/strings/dump_map.c
+++ b/strings/dump_map.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2004 MySQL AB
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/int2str.c b/strings/int2str.c
index 63cda79d23b..d292594e1d9 100644
--- a/strings/int2str.c
+++ b/strings/int2str.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/is_prefix.c b/strings/is_prefix.c
index 451cd468b7e..370927a24cd 100644
--- a/strings/is_prefix.c
+++ b/strings/is_prefix.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/llstr.c b/strings/llstr.c
index 678f8b05f39..1ad798397b7 100644
--- a/strings/llstr.c
+++ b/strings/llstr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/longlong2str-x86.s b/strings/longlong2str-x86.s
deleted file mode 100644
index 3de43a96e78..00000000000
--- a/strings/longlong2str-x86.s
+++ /dev/null
@@ -1,216 +0,0 @@
-# Copyright (C) 2000 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
-
-# Optimized longlong2str function for Intel 80x86 (gcc/gas syntax)
-# Some set sequences are optimized for pentuimpro II
-
- .file "longlong2str-x86.s"
- .version "1.02"
-
-.text
- .align 4
-
-.globl longlong2str_with_dig_vector
- .type longlong2str_with_dig_vector,@function
-
-longlong2str_with_dig_vector:
- subl $80,%esp # Temporary buffer for up to 64 radix-2 digits
- pushl %ebp
- pushl %esi
- pushl %edi
- pushl %ebx
- movl 100(%esp),%esi # esi = Lower part of val
- movl 112(%esp),%ebx # ebx = Radix
- movl 104(%esp),%ebp # ebp = Higher part of val
- movl 108(%esp),%edi # edi = dst
-
- testl %ebx,%ebx
- jge .L144 # Radix was positive
- negl %ebx # Change radix to positive
- testl %ebp,%ebp # Test if given value is negative
- jge .L144
- movb $45,(%edi) # Add sign
- incl %edi # Change sign of val
- negl %esi
- adcl $0,%ebp
- negl %ebp
-
-.L144: # Test that radix is between 2 and 36
- movl %ebx, %eax
- addl $-2,%eax # Test that radix is between 2 and 36
- cmpl $34,%eax
- ja .Lerror # Radix was not in range
-
- leal 92(%esp),%ecx # End of buffer
- movl %edi, 108(%esp) # Store possible modified dest
- movl 116(%esp), %edi # dig_vec_upper
- testl %ebp,%ebp # Test if value > 0xFFFFFFFF
- jne .Llongdiv
- cmpl %ebx, %esi # Test if <= radix, for easy loop
- movl %esi, %eax # Value in eax (for Llow)
- jae .Llow
-
- # Value is one digit (negative or positive)
- movb (%eax,%edi),%bl
- movl 108(%esp),%edi # get dst
- movb %bl,(%edi)
- incl %edi # End null here
- jmp .L10_end
-
-.Llongdiv:
- # Value in ebp:esi. div the high part by the radix,
- # then div remainder + low part by the radix.
- movl %ebp,%eax # edx=0,eax=high(from ebp)
- xorl %edx,%edx
- decl %ecx
- divl %ebx
- movl %eax,%ebp # edx=result of last, eax=low(from esi)
- movl %esi,%eax
- divl %ebx
- movl %eax,%esi # ebp:esi = quotient
- movb (%edx,%edi),%dl # Store result number in temporary buffer
- testl %ebp,%ebp
- movb %dl,(%ecx) # store value in buff
- ja .Llongdiv # (Higher part of val still > 0)
-
- .align 4
-.Llow: # Do rest with integer precision
- # Value in 0:eax. div 0 + low part by the radix.
- xorl %edx,%edx
- decl %ecx
- divl %ebx
- movb (%edx,%edi),%dl # bh is always zero as ebx=radix < 36
- testl %eax,%eax
- movb %dl,(%ecx)
- jne .Llow
-
-.L160:
- movl 108(%esp),%edi # get dst
-
-.Lcopy_end:
- leal 92(%esp),%esi # End of buffer
-.Lmov: # mov temporary buffer to result (%ecx -> %edi)
- movb (%ecx), %al
- movb %al, (%edi)
- incl %ecx
- incl %edi
- cmpl %ecx,%esi
- jne .Lmov
-
-.L10_end:
- movl %edi,%eax # Pointer to end null
- movb $0,(%edi) # Store the end null
-
-.L165:
- popl %ebx
- popl %edi
- popl %esi
- popl %ebp
- addl $80,%esp
- ret
-
-.Lerror:
- xorl %eax,%eax # Wrong radix
- jmp .L165
-
-.Lfe3:
- .size longlong2str_with_dig_vector,.Lfe3-longlong2str_with_dig_vector
-
-#
-# This is almost equal to the above, except that we can do the final
-# loop much more efficient
-#
-
- .align 4
-
-.globl longlong10_to_str
- .type longlong10_to_str,@function
-longlong10_to_str:
- subl $80,%esp
- pushl %ebp
- pushl %esi
- pushl %edi
- pushl %ebx
- movl 100(%esp),%esi # Lower part of val
- movl 104(%esp),%ebp # Higher part of val
- movl 108(%esp),%edi # get dst
- movl 112(%esp),%ebx # Radix (10 or -10)
- testl %ebx,%ebx
- jge .L10_10 # Positive radix
-
- negl %ebx # Change radix to positive (= 10)
-
- testl %ebp,%ebp # Test if negative value
- jge .L10_10
- movb $45,(%edi) # Add sign
- incl %edi
- negl %esi # Change sign of val (ebp:esi)
- adcl $0,%ebp
- negl %ebp
-
-.L10_10:
- leal 92(%esp),%ecx # End of buffer
- testl %ebp,%ebp # Test if value > 0xFFFFFFFF
- jne .L10_longdiv
- cmpl $10, %esi # Test if <= radix, for easy loop
- movl %esi, %ebx # Value in eax (for L10_low)
- jae .L10_low
-
- # Value is one digit (negative or positive)
- addb $48, %bl
- movb %bl,(%edi)
- incl %edi
- jmp .L10_end
- .align 4
-
-.L10_longdiv:
- # val is stored in in ebp:esi
- movl %ebp,%eax # High part of value
- xorl %edx,%edx
- divl %ebx # Divide by 10
- movl %eax,%ebp
- movl %esi,%eax
- divl %ebx # Divide by 10
- decl %ecx
- movl %eax,%esi # quotent in ebp:esi
- addl $48,%edx # Convert to ascii
- movb %dl,(%ecx) # store value in buff
-
-.L10_30:
- testl %ebp,%ebp
- ja .L10_longdiv
- movl %esi,%ebx # Move val to %ebx
-
-.L10_low:
- # The following code uses some tricks to change division by 10 to
- # multiplication and shifts
- movl $0xcccccccd,%esi
-
-.L10_40: # Divide %ebx with 10
- movl %ebx,%eax
- mull %esi
- decl %ecx
- shrl $3,%edx
- leal (%edx,%edx,4),%eax
- addl %eax,%eax
- subb %al,%bl # %bl now contains val % 10
- addb $48,%bl
- movb %bl,(%ecx)
- movl %edx,%ebx
- testl %ebx,%ebx
- jne .L10_40
- jmp .Lcopy_end # Shared end with longlong2str
-
-.L10end:
- .size longlong10_to_str,.L10end-longlong10_to_str
diff --git a/strings/longlong2str.c b/strings/longlong2str.c
index 641ae0955d3..21027a0ee9a 100644
--- a/strings/longlong2str.c
+++ b/strings/longlong2str.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/longlong2str_asm.c b/strings/longlong2str_asm.c
deleted file mode 100644
index e5628043da6..00000000000
--- a/strings/longlong2str_asm.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2000 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 */
-
-/*
- Wrapper for longlong2str.s
-
- We need this because the assembler code can't access the local variable
- _dig_vector in a portable manner.
-*/
-
-#include <my_global.h>
-#include "m_string.h"
-
-extern char *longlong2str_with_dig_vector(longlong val,char *dst,int radix,
- const char *dig_vector);
-
-char *ll2str(longlong val,char *dst,int radix, int upcase)
-{
- return longlong2str_with_dig_vector(val, dst, radix,
- upcase ? _dig_vec_upper : _dig_vec_lower);
-}
diff --git a/strings/my_strchr.c b/strings/my_strchr.c
index 6724bf39ff2..35f39d563c5 100644
--- a/strings/my_strchr.c
+++ b/strings/my_strchr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -13,6 +13,45 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <my_global.h>
+#include "m_string.h"
+#include "m_ctype.h"
+
+#define NEQ(A, B) ((A) != (B))
+#define EQU(A, B) ((A) == (B))
+
+/**
+ Macro for the body of the string scanning.
+
+ @param CS The character set of the string
+ @param STR Pointer to beginning of string
+ @param END Pointer to one-after-end of string
+ @param ACC Pointer to beginning of accept (or reject) string
+ @param LEN Length of accept (or reject) string
+ @param CMP is a function-like for doing the comparison of two characters.
+ */
+
+#define SCAN_STRING(CS, STR, END, ACC, LEN, CMP) \
+ do { \
+ uint mbl; \
+ const char *ptr_str, *ptr_acc; \
+ const char *acc_end= (ACC) + (LEN); \
+ for (ptr_str= (STR) ; ptr_str < (END) ; ptr_str+= mbl) \
+ { \
+ mbl= my_mbcharlen((CS), *(uchar*)ptr_str); \
+ if (mbl < 2) \
+ { \
+ DBUG_ASSERT(mbl == 1); \
+ for (ptr_acc= (ACC) ; ptr_acc < acc_end ; ++ptr_acc) \
+ if (CMP(*ptr_acc, *ptr_str)) \
+ goto end; \
+ } \
+ } \
+end: \
+ return (size_t) (ptr_str - (STR)); \
+ } while (0)
+
+
/*
my_strchr(cs, str, end, c) returns a pointer to the first place in
str where c (1-byte character) occurs, or NULL if c does not occur
@@ -21,11 +60,6 @@
frequently.
*/
-#include <my_global.h>
-#include "m_string.h"
-#include "m_ctype.h"
-
-
char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
pchar c)
{
@@ -45,3 +79,26 @@ char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
return(0);
}
+/**
+ Calculate the length of the initial segment of 'str' which consists
+ entirely of characters not in 'reject'.
+
+ @note The reject string points to single-byte characters so it is
+ only possible to find the first occurrence of a single-byte
+ character. Multi-byte characters in 'str' are treated as not
+ matching any character in the reject string.
+
+ @todo should be moved to CHARSET_INFO if it's going to be called
+ frequently.
+
+ @internal The implementation builds on the assumption that 'str' is long,
+ while 'reject' is short. So it compares each character in string
+ with the characters in 'reject' in a tight loop over the characters
+ in 'reject'.
+*/
+
+size_t my_strcspn(CHARSET_INFO *cs, const char *str, const char *str_end,
+ const char *reject)
+{
+ SCAN_STRING(cs, str, str_end, reject, strlen(reject), EQU);
+}
diff --git a/strings/my_strtoll10-x86.s b/strings/my_strtoll10-x86.s
deleted file mode 100644
index f73428de7de..00000000000
--- a/strings/my_strtoll10-x86.s
+++ /dev/null
@@ -1,418 +0,0 @@
-# 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
-
-# Implemention of my_strtoll(): Converting a string to a 64 bit integer.
-# For documentation, check my_strtoll.c
-
- .file "my_strtoll10-x86.s"
- .version "01.02"
-
-.text
- .align 4
-
-.globl my_strtoll10
- .type my_strtoll10,@function
-
-
- # Used stack variables
- # ebp-4 dummy for storing endptr if endptr = 0
- # ebp-8 First 9 digits of return values
- # ebp-12 Pointer to first digit of second part
- # ebp-16 Store lowest 2 digits
- # ebp-20 != 0 if value was negative
- # ebp-24 High max value
- # ebp-28 Middle max value
- # ebp-32 Low max value
- # ebp-36 Temp value
-
- # esi Pointer to input string
- # ebx End of string
-
-my_strtoll10:
- pushl %ebp
- movl %esp,%ebp
- subl $48,%esp
- pushl %esi
- pushl %edi
- pushl %ebx
- movl 8(%ebp),%esi # esi= nptr
- movl 16(%ebp),%ecx # ecx= error (Will be overwritten later)
- movl 12(%ebp),%eax # eax= endptr
- cmpl $0,%eax # if (endptr)
- je .L110
-
-# Fixed length string
- movl (%eax),%ebx # bx= end-of-string
- .p2align 4,,7
-.L100:
- cmpl %ebx,%esi
- je .Lno_conv
- movb (%esi), %al # al= next byte
- incl %esi
- cmpb $32,%al # Skip space
- je .L100
- cmpb $9,%al # Skip tab
- je .L100
- jmp .L130
-
-# String that ends with \0
-
-.L110:
- leal -4(%ebp),%edi
- movl %edi,12(%ebp) # endptr= &dummy, for easier end check
- .p2align 4,,7
-.L120:
- movb (%esi), %al # al= next byte
- incl %esi
- cmpb $32,%al
- je .L120
- cmpb $9,%al
- je .L120
- testb %al,%al # Test if we found end \0
- je .Lno_conv
- leal 65535(%esi),%ebx # ebx = end-of-string
-
-.L130:
- cmpb $45,%al # Test if '-'
- jne .Lpositive
-
- # negative number
- movl $-1,(%ecx) # error = -1 (mark that number is negative)
- movl $1,-20(%ebp) # negative= 1
- movl $92233720,-24(%ebp)
- movl $368547758,-28(%ebp)
- movl $8,-32(%ebp)
- jmp .L460
-
- .p2align 4,,7
-.Lpositive:
- movl $0,(%ecx) # error=0
- movl $0,-20(%ebp) # negative= 0
- movl $184467440,-24(%ebp)
- movl $737095516,-28(%ebp)
- movl $15,-32(%ebp)
- cmpb $43,%al # Check if '+'
- jne .L462
-
-.L460:
- cmpl %ebx,%esi # Check if overflow
- je .Lno_conv
- movb (%esi), %al # al= next byte after sign
- incl %esi
-
- # Remove pre zero to be able to handle a lot of pre-zero
-.L462:
- cmpb $48,%al
- jne .L475 # Number doesn't start with 0
- decl %esi
- .p2align 4,,7
-
- # Skip pre zeros
-.L481:
- incl %esi # Skip processed byte
- cmpl %ebx,%esi
- je .Lms_return_zero
- cmpb (%esi),%al # Test if next byte is also zero
- je .L481
- leal 9(%esi),%ecx # ecx = end-of-current-part
- xorl %edi,%edi # Store first 9 digits in edi
- jmp .L482
- .p2align 4,,7
-
- # Check if first char is a valid number
-.L475:
- addb $-48,%al
- cmpb $9,%al
- ja .Lno_conv
-.L477:
- movzbl %al,%edi # edi = first digit
- leal 8(%esi),%ecx # ecx = end-of-current-part
-
- # Handle first 8/9 digits and store them in edi
-.L482:
- cmpl %ebx,%ecx
- jbe .L522
- movl %ebx,%ecx # ecx = min(end-of-current-part, end-of-string)
- jmp .L522
-
- .p2align 4,,7
-.L488:
- movb (%esi), %al # al= next byte
- incl %esi
- addb $-48,%al
- cmpb $9,%al
- ja .Lend_i_dec_esi
-
- # Calculate edi= edi*10 + al
- leal (%edi,%edi,4),%edx
- movzbl %al,%eax
- leal (%eax,%edx,2),%edi
-.L522:
- cmpl %ecx,%esi # If more digits at this level
- jne .L488
- cmpl %ebx,%esi # If end of string
- je .Lend_i
-
- movl %edi,-8(%ebp) # Store first 9 digits
- movl %esi,-12(%ebp) # store pos to first digit of second part
-
- # Calculate next 9 digits and store them in edi
-
- xorl %edi,%edi
- leal 9(%esi),%ecx # ecx= end-of-current-part
- movl %ecx,-36(%ebp) # Store max length
- cmpl %ebx,%ecx
- jbe .L498
- movl %ebx,%ecx # ecx = min(end-of-current-part, end-of-string)
-
- .p2align 4,,7
-.L498:
- movb (%esi), %al # al= next byte
- incl %esi
- addb $-48,%al
- cmpb $9,%al
- ja .Lend_i_and_j_decl_esi
-
- # Calculate edi= edi*10 + al
- leal (%edi,%edi,4),%edx
- movzbl %al,%eax
- leal (%eax,%edx,2),%edi
-
- cmpl %ecx,%esi # If end of current part
- jne .L498
- cmpl %ebx,%esi # If end of string
- jne .L500
- cmpl -36(%ebp),%esi # Test if string is less than 18 digits
- jne .Lend_i_and_j
-.L499:
- movl $1000000000,%eax
- jmp .Lgot_factor # 18 digit string
-
- # Handle the possible next to last digit and store in ecx
-.L500:
- movb (%esi),%al
- addb $-48,%al
- cmpb $9,%al
- ja .L499 # 18 digit string
-
- incl %esi
- movzbl %al,%ecx
- cmpl %ebx,%esi # If end of string
- je .Lend4
-
- movb (%esi),%al # Read last digit
- addb $-48,%al
- cmpb $9,%al
- ja .Lend4
-
- # ecx= ecx*10 + al
- leal (%ecx,%ecx,4),%edx
- movzbl %al,%eax
- leal (%eax,%edx,2),%ecx
-
- movl 12(%ebp),%eax # eax = endptr
- incl %esi
- movl %esi,(%eax) # *endptr = end-of-string
- cmpl %ebx,%esi
- je .L505 # At end of string
-
- movb (%esi),%al # check if extra digits
- addb $-48,%al
- cmpb $9,%al
- jbe .Loverflow
-
- # At this point we have:
- # -8(%ebp) First 9 digits
- # edi Next 9 digits
- # ecx Last 2 digits
- # *endpos end-of-string
-
-.L505: # Check that we are not going to get overflow for unsigned long long
- movl -8(%ebp),%eax # First 9 digits
- cmpl -24(%ebp),%eax
- ja .Loverflow
- jne .L507
- cmpl -28(%ebp),%edi
- ja .Loverflow
- jne .L507
- cmpl -32(%ebp),%ecx
- ja .Loverflow
-
-.L507:
- movl %edi,-4(%ebp) # Save middle bytes
- movl %ecx,%esi # esi = 2 last digits
- movl $1215752192,%ecx # %ecx= lower_32_bits(100000000000)
- mull %ecx
- imull $23,-8(%ebp),%ecx
- movl $0,-36(%ebp)
- movl %eax,%ebx
- imull $1215752192,-36(%ebp),%eax
- movl %edx,%edi
- addl %ecx,%edi
- addl %eax,%edi # Temp in edi:ebx
-
- movl $100,%eax # j= j*100
- mull -4(%ebp)
- addl %ebx,%eax # edx:eax+= edi:ebx
- adcl %edi,%edx
- addl %esi,%eax
- adcl $0,%edx
- jmp .Lms_return
-
-.Loverflow:
- # When we come here, *endptr is already updated
-
- movl 16(%ebp),%edx # edx= error
- movl $34,(%edx) # *error = 34
- movl $-1,%eax
- movl %eax,%edx
- cmpl $0,-20(%ebp) # If negative
- je .Lms_return
- xor %eax,%eax # edx:eax = LONGLONG_LMIN
- movl $-2147483648,%edx
- jmp .Lms_return
-
- # Return value that is in %edi as long long
- .p2align 4,,7
-.Lend_i_dec_esi:
- decl %esi # Fix so that it points at last digit
-.Lend_i:
- xorl %edx,%edx
- movl %edi,%eax
- cmpl $0,-20(%ebp)
- je .Lreturn_save_endptr # Positive number
- negl %eax
- cltd # Neg result in edx:eax
- jmp .Lreturn_save_endptr
-
- # Return value (%ebp-8) * lfactor[(uint) (edx-start)] + edi
- .p2align 4,,7
-.Lend_i_and_j_decl_esi:
- decl %esi # Fix so that it points at last digit
-.Lend_i_and_j:
- movl %esi,%ecx
- subl -12(%ebp),%ecx # ecx= number of digits in second part
-
- # Calculate %eax= 10 ** %cl, where %cl <= 8
- # With an array one could do this with:
- # movl 10_factor_table(,%ecx,4),%eax
- # We calculate the table here to avoid problems in
- # position independent code (gcc -pic)
-
- cmpb $3,%cl
- ja .L4_to_8
- movl $1000, %eax
- je .Lgot_factor # %cl=3, eax= 1000
- movl $10, %eax
- cmpb $1,%cl # %cl is here 0 - 2
- je .Lgot_factor # %cl=1, eax= 10
- movl $100, %eax
- ja .Lgot_factor # %cl=2, eax=100
- movl $1, %eax
- jmp .Lgot_factor # %cl=0, eax=1
-
-.L4_to_8: # %cl is here 4-8
- cmpb $5,%cl
- movl $100000, %eax
- je .Lgot_factor # %cl=5, eax=100000
- movl $10000, %eax
- jbe .Lgot_factor # %cl=4, eax=10000
- movl $10000000, %eax
- cmpb $7,%cl
- je .Lgot_factor # %cl=7, eax=10000000
- movl $100000000, %eax
- ja .Lgot_factor # %cl=8, eax=100000000
- movl $1000000, %eax # %cl=6, eax=1000000
-
- # Return -8(%ebp) * %eax + edi
- .p2align 4,,7
-.Lgot_factor:
- mull -8(%ebp)
- addl %edi,%eax
- adcl $0,%edx
- cmpl $0,-20(%ebp) # if negative
- je .Lreturn_save_endptr
- negl %eax # Neg edx:%eax
- adcl $0,%edx
- negl %edx
- jmp .Lreturn_save_endptr
-
- # Return -8(%ebp) * $10000000000 + edi*10 + ecx
- .p2align 4,,7
-.Lend4:
- movl %ecx,-16(%ebp) # store lowest digits
- movl 12(%ebp),%ebx
- movl %esi,(%ebx) # *endpos = end-of-string
- movl -8(%ebp),%eax # First 9 digits
- movl $1410065408,%ecx # ecx= lower_32_bits(10000000000)
- mull %ecx
- movl $0,-36(%ebp)
- movl %eax,%ebx # Store lowest 32 byte from multiplication
- imull $1410065408,-36(%ebp),%eax
- movl -8(%ebp),%ecx # First 9 digits
- movl %edx,%esi
- addl %ecx,%ecx
- addl %ecx,%esi
- addl %eax,%esi # %esi:%ebx now has -8(%ebp) * $10000000000
-
- movl $10,%eax # Calc edi*10
- mull %edi
- addl %ebx,%eax # And add to result
- adcl %esi,%edx
- addl -16(%ebp),%eax # Add lowest digit
- adcl $0,%edx
- cmpl $0,-20(%ebp) # if negative
- je .Lms_return
-
- cmpl $-2147483648,%edx # Test if too big signed integer
- ja .Loverflow
- jne .L516
- testl %eax,%eax
- ja .Loverflow
-
-.L516:
- negl %eax
- adcl $0,%edx
- negl %edx
- jmp .Lms_return
-
- .p2align 4,,7
-.Lno_conv: # Not a legal number
- movl 16(%ebp),%eax
- movl $33,(%eax) # error= edom
-
-.Lms_return_zero:
- xorl %eax,%eax # Return zero
- xorl %edx,%edx
-
- .p2align 4,,7
-.Lreturn_save_endptr:
- movl 12(%ebp),%ecx # endptr= end-of-string
- movl %esi,(%ecx) # *endptr= end-of-string
-
-.Lms_return:
- popl %ebx
- popl %edi
- popl %esi
- movl %ebp,%esp
- popl %ebp
- ret
-
-.my_strtoll10_end:
- .size my_strtoll10,.my_strtoll10_end-my_strtoll10
- .comm res,240,32
- .comm end_ptr,120,32
- .comm error,120,32
- .ident "Monty"
diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c
index b9fc4b4be8e..5263abb335c 100644
--- a/strings/my_strtoll10.c
+++ b/strings/my_strtoll10.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 MySQL AB
+/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
index 1284203f739..9f425a1db4d 100644
--- a/strings/my_vsnprintf.c
+++ b/strings/my_vsnprintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -513,7 +513,7 @@ start:
arg_count= max(arg_count, arg_index);
goto start;
}
- DBUG_ASSERT(0);
+
return 0;
}
diff --git a/strings/str2int.c b/strings/str2int.c
index c4a4c07eeff..7cf49982d76 100644
--- a/strings/str2int.c
+++ b/strings/str2int.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/str_alloc.c b/strings/str_alloc.c
index 615ad1ba1e2..fdf32b8ee15 100644
--- a/strings/str_alloc.c
+++ b/strings/str_alloc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/str_test.c b/strings/str_test.c
deleted file mode 100644
index ce23b2c3588..00000000000
--- a/strings/str_test.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/* Copyright (C) 2000-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 */
-
-/* Test of all stringfunktions that is coded in assembler */
-
-#include <my_global.h>
-#include <stdarg.h>
-#include "m_string.h"
-
-#define F_LEN 8
-#define F_CHAR 'A'
-#define F_FILL 'B'
-#define T_LEN 15
-#define T_CHAR 'D'
-#define T_FILL 'E'
-#define F_PREFILL '0'
-#define T_PREFILL '1'
-
-static char from_buff[100],to_buff[100];
-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,char * b1,char * b2,int length,
- pchar fill, pchar prefill);
-
-static int my_test(int a)
-{
- return a ? 1 : 0;
-}
-
-int main(void)
-{
- static char v1[]="Monty",v2[]="on",v3[]="Montys",v4[]="ty",v5[]="gr",
- v6[]="hohohoo",v7[]="hohoo",v8[]="hohooo",v9[]="t",
- cont[]="qwet";
- errors=tests=0;
- init_strings();
-
- test_arg("bcmp(from,to,5)",(long) my_test(bcmp(from,to,5)),1L);
- test_arg("bcmp(from,from,5)",(long) bcmp(from,from,5),0L);
-
- test_arg("bcmp(from,to,0)",(long) bcmp(from,to,0),0L);
- test_arg("strend(from)",(long) strend(from),(long) from+F_LEN);
- test_arg("strchr(v1,'M')",(long) strchr(v1,'M'),(long) v1);
- test_arg("strchr(v1,'y')",(long) strchr(v1,'y'),(long) v1+4);
- test_arg("strchr(v1,'x')",(long) strchr(v1,'x'),0L);
- test_arg("strcont(v1,cont)",(long) strcont(v1,cont),(long) v1+3);
- test_arg("strcont(v1,v2)",(long) strcont(v1,v2),(long) v1+1);
- test_arg("strcont(v1,v5)",(long) strcont(v1,v5),0L);
- test_arg("is_prefix(v3,v1)",(long) is_prefix(v3,v1),1L);
- test_arg("is_prefix(v1,v3)",(long) is_prefix(v1,v3),0L);
- test_arg("is_prefix(v3,v4)",(long) is_prefix(v3,v4),0L);
- test_arg("strstr(v1,v1)",(long) strstr(v1,v1),(long) v1);
- test_arg("strstr(v1,v2)",(long) strstr(v1,v2),(long) v1+1);
- test_arg("strstr(v1,v4)",(long) strstr(v1,v4),(long) v1+3);
- test_arg("strstr(v6,v7)",(long) strstr(v6,v7),(long) v6+2);
- test_arg("strstr(v1,v9)",(long) strstr(v1,v9),(long) v1+3);
- test_arg("strstr(v1,v3)",(long) strstr(v1,v3),0L);
- test_arg("strstr(v1,v5)",(long) strstr(v1,v5),0L);
- test_arg("strstr(v6,v8)",(long) strstr(v6,v8),0L);
-
- test_arg("strlen(from)",(long) strlen(from),(long) F_LEN);
- test_arg("strlen(\"\")",(long) strlen(""),0L);
-#ifdef HAVE_STRNLEN
- test_arg("strnlen(from,3)",(long) strnlen(from,3),3L);
- test_arg("strnlen(from,0)",(long) strnlen(from,0),0L);
- test_arg("strnlen(from,1000)",(long) strnlen(from,1000),(long) F_LEN);
-#endif
-
- test_strarg("bfill(to,4,' ')",(bfill(to,4,' '),0L),INT_MAX32,4,' ',0,0);
- test_strarg("bfill(from,0,' ')",(bfill(from,0,' '),0L),INT_MAX32,0,0);
- test_strarg("bzero(to,3)",(bzero(to,3),0L),INT_MAX32,3,0,0,0);
- test_strarg("bzero(to,0)",(bzero(to,0),0L),INT_MAX32,0,0);
- test_strarg("bmove(to,from,4)",(bmove(to,from,4),0L),INT_MAX32,4,F_CHAR,
- 0,0);
- test_strarg("bmove(to,from,0)",(bmove(to,from,0),0L),INT_MAX32,0,0);
- test_strarg("bmove_upp(to+6,from+6,3)",(bmove_upp(to+6,from+6,3),0L),INT_MAX32,
- 3,T_CHAR,3,F_CHAR,0,0);
- test_strarg("bmove_upp(to,from,0)",(bmove_upp(to,from,0),0L),INT_MAX32,0,0);
- test_strarg("bmove_align(to,from,8)",(bmove_align(to,from,8),0L),INT_MAX32,
- 8,F_CHAR,0,0);
- test_strarg("strappend(to,3,' ')",(strappend(to,3,' '),0L),INT_MAX32,
- 3,T_CHAR,1,0,T_LEN-4,T_CHAR,1,0,0,0);
- test_strarg("strappend(to,T_LEN+5,' ')",(strappend(to,T_LEN+5,' '),0L),INT_MAX32,
- T_LEN,T_CHAR,5,' ',1,0,0,0);
- test_strarg("strcat(to,from)",strcat(to,from),to,T_LEN,T_CHAR,
- F_LEN,F_CHAR,1,0,0,0);
- test_strarg("strcat(to,\"\")",strcat(to,""),INT_MAX32,0,0);
- test_strarg("strfill(to,4,' ')",strfill(to,4,' '),to+4,4,' ',1,0,0,0);
- test_strarg("strfill(from,0,' ')",strfill(from,0,' '),from,0,1,0,0);
- test_strarg("strmake(to,from,4)",strmake(to,from,4),to+4,4,F_CHAR,
- 1,0,0,0);
- test_strarg("strmake(to,from,0)",strmake(to,from,0),to+0,1,0,0,0);
- test_strarg("strmov(to,from)",strmov(to,from),to+F_LEN,F_LEN,F_CHAR,0,0);
- test_strarg("strmov(to,\"\")",strmov(to,""),to,1,0,0,0);
- test_strarg("strnmov(to,from,2)",strnmov(to,from,2),to+2,2,F_CHAR,0,0);
- test_strarg("strnmov(to,from,F_LEN+5)",strnmov(to,from,F_LEN+5),to+F_LEN,
- F_LEN,F_CHAR,1,0,0,0);
- test_strarg("strnmov(to,\"\",2)",strnmov(to,"",2),to,1,0,0,0);
- test_strarg("strxmov(to,from,\"!!\",NullS)",strxmov(to,from,"!!",NullS),to+F_LEN+2,F_LEN,F_CHAR,2,'!',0,0,0);
- test_strarg("strxmov(to,NullS)",strxmov(to,NullS),to,1,0,0,0);
- test_strarg("strxmov(to,from,from,from,from,from,'!!',from,NullS)",strxmov(to,from,from,from,from,from,"!!",from,NullS),to+F_LEN*6+2,F_LEN,F_CHAR,F_LEN,F_CHAR,F_LEN,F_CHAR,F_LEN,F_CHAR,F_LEN,F_CHAR,2,'!',F_LEN,F_CHAR,1,0,0,0);
-
- test_strarg("strxnmov(to,100,from,\"!!\",NullS)",strxnmov(to,100,from,"!!",NullS),to+F_LEN+2,F_LEN,F_CHAR,2,'!',0,0,0);
- test_strarg("strxnmov(to,2,NullS)",strxnmov(to,2,NullS),to,1,0,0,0);
- test_strarg("strxnmov(to,100,from,from,from,from,from,'!!',from,NullS)",strxnmov(to,100,from,from,from,from,from,"!!",from,NullS),to+F_LEN*6+2,F_LEN,F_CHAR,F_LEN,F_CHAR,F_LEN,F_CHAR,F_LEN,F_CHAR,F_LEN,F_CHAR,2,'!',F_LEN,F_CHAR,1,0,0,0);
- test_strarg("strxnmov(to,2,\"!!!\",NullS)",strxnmov(to,2,"!!!",NullS),to+2,2,'!',0,0,0);
- test_strarg("strxnmov(to,2,\"!!\",NullS)",strxnmov(to,2,"!!","xx",NullS),to+2,2,'!',0,0,0);
- test_strarg("strxnmov(to,2,\"!\",\"x\",\"y\",NullS)",strxnmov(to,2,"!","x","y",NullS),to+2,1,'!',1,'x',0,0,0);
-
- test_strarg("bchange(to,2,from,4,6)",(bchange(to,2,from,4,6),0L),INT_MAX32,
- 4,F_CHAR,2,T_CHAR,0,0);
-
- printf("tests: %d errors: %d\n",tests,errors);
- if (errors)
- fputs("--- Some functions doesn't work!! Fix them\n",stderr);
- return(errors > 0);
-} /* main */
-
-
- /* Init strings */
-
-void init_strings(void)
-{
- reg1 int i;
- reg2 char *pos;
-
- from=from_buff+3; to=to_buff+3;
-
- pos=from_buff; *pos++= F_FILL; *pos++=F_FILL; *pos++=F_PREFILL;
- for (i=0 ; i < F_LEN ; i++)
- *pos++=F_CHAR;
- *pos++=0;
- for (i=0; i<50 ; i++)
- *pos++= F_FILL;
-
- pos=to_buff; *pos++= T_FILL; *pos++=T_FILL; *pos++=T_PREFILL;
- for (i=0 ; i < T_LEN ; i++)
- *pos++=T_CHAR;
- *pos++=0;
- for (i=0; i<50 ; i++)
- *pos++= T_FILL;
-} /* init_strings */
-
-
- /* Test that function return rigth value */
-
-void test_arg(const char *message, long int func_value, long int value)
-{
- tests++;
- printf("testing '%s'\n",message);
- if (func_value != value)
- {
- printf("func: '%s' = %ld Should be: %ld\n",message,func_value,value);
- errors++;
- }
-} /* test_arg */
-
- /* Test function return value and from and to arrays */
-
-static int test_strarg(const char *message,...)
-{
- long func_value,value;
- int error,length;
- char chr,cmp_buff[100],*pos,*pos2;
- va_list pvar;
-
- tests++;
- va_start(pvar,message);
- func_value=va_arg(pvar,long);
- value=va_arg(pvar,long);
-
- printf("testing '%s'\n",message);
- if (func_value != value && value != INT_MAX32)
- {
- printf("func: '%s' = %ld Should be: %ld\n",message,func_value,value);
- errors++;
- }
- pos= cmp_buff;
- while ((length = va_arg(pvar, int)) != 0)
- {
- chr= (char) (va_arg(pvar, int));
- while (length--)
- *pos++=chr;
- }
- pos2=to+ (int)(pos-cmp_buff);
- while (pos <= cmp_buff+T_LEN)
- *pos++= *pos2++;
- if (compare_buff(message,to,cmp_buff,(int) (pos-cmp_buff),T_FILL,T_PREFILL))
- {
- init_strings();
- va_end(pvar);
- return 1;
- }
-
- pos= cmp_buff;
- while ((length = va_arg(pvar, int)) != 0)
- {
- chr= (char) (va_arg(pvar, int));
- while (length--)
- *pos++=chr;
- }
- pos2=from+ (int)(pos-cmp_buff);
- while (pos <= cmp_buff+F_LEN)
- *pos++= *pos2++;
- error=compare_buff(message,from,cmp_buff,(int) (pos-cmp_buff),F_FILL,F_PREFILL);
- init_strings();
- va_end(pvar);
- return (error != 0);
-} /* test_strarg */
-
-
- /* test if function made right value */
-
-int compare_buff(const char *message, char * b1, char * b2, int length,
- pchar fill, pchar prefill)
-{
- int i,error=0;
-
- if (bcmp(b1,b2,length))
- {
- errors++;
- printf("func: '%s' Buffers differ\nIs: ",message);
- for (i=0 ; i<length ; i++)
- printf("%3d ",b1[i]);
- printf("\nShould be: ");
- for (i=0 ; i<length ; i++)
- printf("%3d ",b2[i]);
- puts("");
- }
- else if (b1[-1] != prefill || b1[-2] != fill || b1[-3] != fill)
- {
- printf("func: '%s' Chars before buffer is changed\n",message);
- errors++;
- error=1;
- }
- else if (b1[length] != fill || b1[length+1] != fill)
- {
- printf("func: '%s' Chars after buffer is changed\n",message);
- errors++;
- error=1;
- }
- return error;
-} /* compare_buff */
-
- /* These are here to be loaded and examined */
-
-extern void dummy_functions(void);
-
-void dummy_functions(void)
-{
- (void) memchr(from,'a',5);
- (void) memcmp(from,to,5);
- (void) memcpy(from,to,5);
- (void) memset(from,' ',5);
- (void) strcmp(from,to);
- (void) strcpy(from,to);
- (void) strstr(from,to);
- (void) strrchr(from,'a');
- return;
-}
diff --git a/strings/strappend.c b/strings/strappend.c
index bb926f74665..e81a4d4301e 100644
--- a/strings/strappend.c
+++ b/strings/strappend.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/strcend.c b/strings/strcend.c
index e08ad2b1e75..c48f695cfd6 100644
--- a/strings/strcend.c
+++ b/strings/strcend.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/strcont.c b/strings/strcont.c
index 5a518a3550f..ddf8f2c838f 100644
--- a/strings/strcont.c
+++ b/strings/strcont.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/strend.c b/strings/strend.c
index d70a5d648d5..c38502bd55c 100644
--- a/strings/strend.c
+++ b/strings/strend.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
diff --git a/strings/strfill.c b/strings/strfill.c
index 4b1fe67b206..12d227f5805 100644
--- a/strings/strfill.c
+++ b/strings/strfill.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/strings-x86.s b/strings/strings-x86.s
deleted file mode 100644
index 4872c566685..00000000000
--- a/strings/strings-x86.s
+++ /dev/null
@@ -1,393 +0,0 @@
-# Copyright (C) 2000 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
-
-# Optimized string functions Intel 80x86 (gcc/gas syntax)
-
- .file "strings.s"
- .version "1.00"
-
-.text
-
-# Move a alligned, not overlapped, by (long) divided memory area
-# Args: to,from,length
-
-.globl bmove_align
- .type bmove_align,@function
-bmove_align:
- movl %edi,%edx
- push %esi
- movl 4(%esp),%edi # to
- movl 8(%esp),%esi # from
- movl 12(%esp),%ecx # length
- addw $3,%cx # fix if not divisible with long
- shrw $2,%cx
- jz .ba_20
- .p2align 4,,7
-.ba_10:
- movl -4(%esi,%ecx),%eax
- movl %eax,-4(%edi,%ecx)
- decl %ecx
- jnz .ba_10
-.ba_20: pop %esi
- movl %edx,%edi
- ret
-
-.bmove_align_end:
- .size bmove_align,.bmove_align_end-bmove_align
-
- # Move a string from higher to lower
- # Arg from_end+1,to_end+1,length
-
-.globl bmove_upp
- .type bmove_upp,@function
-bmove_upp:
- movl %edi,%edx # Remember %edi
- push %esi
- movl 8(%esp),%edi # dst
- movl 16(%esp),%ecx # length
- movl 12(%esp),%esi # source
- test %ecx,%ecx
- jz .bu_20
- subl %ecx,%esi # To start of strings
- subl %ecx,%edi
-
- .p2align 4,,7
-.bu_10: movb -1(%esi,%ecx),%al
- movb %al,-1(%edi,%ecx)
- decl %ecx
- jnz .bu_10
-.bu_20: pop %esi
- movl %edx,%edi
- ret
-
-.bmove_upp_end:
- .size bmove_upp,.bmove_upp_end-bmove_upp
-
- # Append fillchars to string
- # Args: dest,len,fill
-
-.globl strappend
- .type strappend,@function
-strappend:
- pushl %edi
- movl 8(%esp),%edi # Memory pointer
- movl 12(%esp),%ecx # Length
- clrl %eax # Find end of string
- repne
- scasb
- jnz sa_99 # String to long, shorten it
- movzb 16(%esp),%eax # Fillchar
- decl %edi # Point at end null
- incl %ecx # rep made one dec for null-char
-
- movb %al,%ah # (2) Set up a 32 bit pattern.
- movw %ax,%dx # (2)
- shll $16,%eax # (3)
- movw %dx,%ax # (2) %eax has the 32 bit pattern.
-
- movl %ecx,%edx # (2) Save the count of bytes.
- shrl $2,%ecx # (2) Number of dwords.
- rep
- stosl # (5 + 5n)
- movb $3,%cl # (2)
- and %edx,%ecx # (2) Fill in the odd bytes
- rep
- stosb # Move last bytes if any
-
-sa_99: movb $0,(%edi) # End of string
- popl %edi
- ret
-.strappend_end:
- .size strappend,.strappend_end-strappend
-
- # Find if string contains any char in another string
- # Arg: str,set
- # Ret: Pointer to first found char in str
-
-.globl strcont
- .type strcont,@function
-strcont:
- movl %edi,%edx
- pushl %esi
- movl 8(%esp),%esi # str
- movl 12(%esp),%ecx # set
- clrb %ah # For endtest
- jmp sc_60
-
-sc_10: scasb
- jz sc_fo # Found char
-sc_20: cmp (%edi),%ah # Test if null
- jnz sc_10 # Not end of set yet
- incl %esi # Next char in str
-sc_60: movl %ecx,%edi # %edi = Set
- movb (%esi),%al # Test if this char exist
- andb %al,%al
- jnz sc_20 # Not end of string
- clrl %esi # Return Null
-sc_fo: movl %esi,%eax # Char found here
- movl %edx,%edi # Restore
- popl %esi
- ret
-.strcont_end:
- .size strcont,.strcont_end-strcont
-
- # Find end of string
- # Arg: str
- # ret: Pointer to end null
-
-.globl strend
- .type strend,@function
-strend:
- movl %edi,%edx # Save
- movl 4(%esp),%edi # str
- clrl %eax # Find end of string
- movl %eax,%ecx
- decl %ecx # ECX = -1
- repne
- scasb
- movl %edi,%eax
- decl %eax # End of string
- movl %edx,%edi # Restore
- ret
-.strend_end:
- .size strend,.strend_end-strend
-
- # Make a string with len fill-chars and endnull
- # Args: dest,len,fill
- # Ret: dest+len
-
-.globl strfill
- .type strfill,@function
-strfill:
- pushl %edi
- movl 8(%esp),%edi # Memory pointer
- movl 12(%esp),%ecx # Length
- movzb 16(%esp),%eax # Fill
-
- movb %al,%ah # (2) Set up a 32 bit pattern
- movw %ax,%dx # (2)
- shll $16,%eax # (3)
- movw %dx,%ax # (2) %eax has the 32 bit pattern.
-
- movl %ecx,%edx # (2) Save the count of bytes.
- shrl $2,%ecx # (2) Number of dwords.
- rep
- stosl # (5 + 5n)
- movb $3,%cl # (2)
- and %edx,%ecx # (2) Fill in the odd bytes
- rep
- stosb # Move last bytes if any
-
- movb %cl,(%edi) # End NULL
- movl %edi,%eax # End i %eax
- popl %edi
- ret
-.strfill_end:
- .size strfill,.strfill_end-strfill
-
-
- # Find a char in or end of a string
- # Arg: str,char
- # Ret: pointer to found char or NullS
-
-.globl strcend
- .type strcend,@function
-strcend:
- movl %edi,%edx
- movl 4(%esp),%edi # str
- movb 8(%esp),%ah # search
- clrb %al # for scasb to find end
-
-se_10: cmpb (%edi),%ah
- jz se_20 # Found char
- scasb
- jnz se_10 # Not end
- dec %edi # Not found, point at end of string
-se_20: movl %edi,%eax
- movl %edx,%edi # Restore
- ret
-.strcend_end:
- .size strcend,.strcend_end-strcend
-
- # Test if string has a given suffix
-
-.globl is_prefix
- .type is_prefix,@function
-is_prefix:
- movl %edi,%edx # Save %edi
- pushl %esi # and %esi
- movl 12(%esp),%esi # get suffix
- movl 8(%esp),%edi # s1
- movl $1,%eax # Ok and zero-test
-ip_10: cmpb (%esi),%ah
- jz suf_ok # End of string/ found suffix
- cmpsb # Compare strings
- jz ip_10 # Same, possible prefix
- xor %eax,%eax # Not suffix
-suf_ok: popl %esi
- movl %edx,%edi
- ret
-.is_prefix_end:
- .size is_prefix,.is_prefix_end-is_prefix
-
- # Find a substring in string
- # Arg: str,search
-
-.globl strstr
- .type strstr,@function
-
-strstr:
- pushl %edi
- pushl %esi
- movl 12(%esp),%esi # str
- movl 16(%esp),%edi # search
- movl %edi,%ecx
- incl %ecx # %ecx = search+1
- movb (%edi),%ah # %ah = First char in search
- jmp sf_10
-
-sf_00: movl %edx,%esi # si = Current str-pos
-sf_10: movb (%esi),%al # Test if this char exist
- andb %al,%al
- jz sf_90 # End of string, didn't find search
- incl %esi
- cmpb %al,%ah
- jnz sf_10 # Didn't find first char, continue
- movl %esi,%edx # Save str-pos in %edx
- movl %ecx,%edi
-sf_20: cmpb $0,(%edi)
- jz sf_fo # Found substring
- cmpsb
- jz sf_20 # Char ok
- jmp sf_00 # Next str-pos
-
-sf_90: movl $1,%edx # Return Null
-sf_fo: movl %edx,%eax # Char found here
- decl %eax # Pointed one after
- popl %esi
- popl %edi
- ret
-.strstr_end:
- .size strstr,.strstr_end-strstr
-
- # Make a string of len length from another string
- # Arg: dst,src,length
- # ret: end of dst
-
-.globl strmake
- .type strmake,@function
-
-strmake:
- pushl %edi
- pushl %esi
- mov 12(%esp),%edi # dst
- movl $0,%edx
- movl 20(%esp),%ecx # length
- movl 16(%esp),%esi # src
- cmpl %edx,%ecx
- jz sm_90
-sm_00: movb (%esi,%edx),%al
- cmpb $0,%al
- jz sm_90
- movb %al,(%edi,%edx)
- incl %edx
- cmpl %edx,%ecx
- jnz sm_00
-sm_90: movb $0,(%edi,%edx)
-sm_99: lea (%edi,%edx),%eax # Return pointer to end null
- pop %esi
- pop %edi
- ret
-.strmake_end:
- .size strmake,.strmake_end-strmake
-
- # Move a string with max len chars
- # arg: dst,src,len
- # ret: pos to first null or dst+len
-
-.globl strnmov
- .type strnmov,@function
-strnmov:
- pushl %edi
- pushl %esi
- movl 12(%esp),%edi # dst
- movl 16(%esp),%esi # src
- movl 20(%esp),%ecx # Length of memory-area
- jecxz snm_99 # Nothing to do
- clrb %al # For test of end-null
-
-snm_10: cmpb (%esi),%al # Next char to move
- movsb # move arg
- jz snm_20 # last char, fill with null
- loop snm_10 # Continue moving
- incl %edi # Point two after last
-snm_20: decl %edi # Point at first null (or last+1)
-snm_99: movl %edi,%eax # Pointer at last char
- popl %esi
- popl %edi
- ret
-.strnmov_end:
- .size strnmov,.strnmov_end-strnmov
-
-
-.globl strmov
- .type strmov,@function
-strmov:
- movl %esi,%ecx # Save old %esi and %edi
- movl %edi,%edx
- movl 8(%esp),%esi # get source pointer (s2)
- movl 4(%esp),%edi # %edi -> s1
-smo_10: movb (%esi),%al
- movsb # move arg
- andb %al,%al
- jnz smo_10 # Not last
- movl %edi,%eax
- dec %eax
- movl %ecx,%esi # Restore
- movl %edx,%edi
- ret
-.strmov_end:
- .size strmov,.strmov_end-strmov
-
-.globl strxmov
- .type strxmov,@function
-strxmov:
- movl %ebx,%edx # Save %ebx, %esi and %edi
- mov %esi,%ecx
- push %edi
- leal 8(%esp),%ebx # Get destination
- movl (%ebx),%edi
- xorb %al,%al
- jmp next_str # Handle source ebx+4
-
-start_str:
- movsb
- cmpb -1(%edi),%al
- jne start_str
- decl %edi # Don't copy last null
-
-next_str:
- addl $4,%ebx
- movl (%ebx),%esi
- orl %esi,%esi
- jne start_str
- movb %al,0(%edi) # Force last to ASCII 0
-
- movl %edi,%eax # Return ptr to ASCII 0
- pop %edi # Restore registers
- movl %ecx,%esi
- movl %edx,%ebx
- ret
-.strxmov_end:
- .size strxmov,.strxmov_end-strxmov
diff --git a/strings/strmake.c b/strings/strmake.c
index 56bd3a8f084..500d739f8dd 100644
--- a/strings/strmake.c
+++ b/strings/strmake.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/strmov.c b/strings/strmov.c
index 849c5812401..19f12efceb9 100644
--- a/strings/strmov.c
+++ b/strings/strmov.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/strnlen.c b/strings/strnlen.c
index 826cd5ae5dd..7c8f3c4a54e 100644
--- a/strings/strnlen.c
+++ b/strings/strnlen.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/strnmov.c b/strings/strnmov.c
index 7e26877637b..a826233bb17 100644
--- a/strings/strnmov.c
+++ b/strings/strnmov.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/strstr.c b/strings/strstr.c
deleted file mode 100644
index a5b50d12043..00000000000
--- a/strings/strstr.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright (C) 2002 MySQL AB
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; version 2
- of the License.
-
- This library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA */
-
-/* File : strstr.c
- Author : Monty
- Updated: 1986.11.24
- Defines: strstr()
-
- strstr(src, pat) looks for an instance of pat in src. pat is not a
- regex(3) pattern, it is a literal string which must be matched exactly.
- The result is a pointer to the first character of the located instance,
- or NullS if pat does not occur in src.
-
-*/
-
-#include <my_global.h>
-#include "m_string.h"
-
-#ifndef HAVE_STRSTR
-
-char *strstr(register const char *str,const char *search)
-{
- register char *i,*j;
- register char first= *search;
-
-skip:
- while (*str != '\0') {
- if (*str++ == first) {
- i=(char*) str; j=(char*) search+1;
- while (*j)
- if (*i++ != *j++) goto skip;
- return ((char*) str-1);
- }
- }
- return ((char*) 0);
-} /* strstr */
-
-#endif
diff --git a/strings/strto.c b/strings/strto.c
deleted file mode 100644
index fcb0d800b81..00000000000
--- a/strings/strto.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/* Copyright (C) 2000 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 */
-
-/*
- strtol,strtoul,strtoll,strtoull
- convert string to long, unsigned long, long long or unsigned long long.
- strtoxx(char *src,char **ptr,int base)
- converts the string pointed to by src to an long of appropriate long and
- returnes it. It skips leading spaces and tabs (but not newlines, formfeeds,
- backspaces), then it accepts an optional sign and a sequence of digits
- in the specified radix.
- If the value of ptr is not (char **)NULL, a pointer to the character
- terminating the scan is returned in the location pointed to by ptr.
- Trailing spaces will NOT be skipped.
-
- If an error is detected, the result will be LONG_MIN, 0 or LONG_MAX,
- (or LONGLONG..) and errno will be set to
- EDOM if there are no digits
- ERANGE if the result would overflow.
- the ptr will be set to src.
- This file is based on the strtol from the the GNU C Library.
- it can be compiled with the UNSIGNED and/or LONGLONG flag set
-*/
-
-
-#if !defined(_global_h) || !defined(_m_string_h)
-# error Calling file must include 'my_global.h' and 'm_string.h'
- /* see 'strtoll.c' and 'strtoull.c' for the reasons */
-#endif
-
-#include "m_ctype.h"
-#include "my_sys.h" /* defines errno */
-#include <errno.h>
-
-#undef strtoull
-#undef strtoll
-#undef strtoul
-#undef strtol
-#ifdef USE_LONGLONG
-#define UTYPE_MAX (~(ulonglong) 0)
-#define TYPE_MIN LONGLONG_MIN
-#define TYPE_MAX LONGLONG_MAX
-#define longtype longlong
-#define ulongtype ulonglong
-#ifdef USE_UNSIGNED
-#define function ulongtype strtoull
-#else
-#define function longtype strtoll
-#endif
-#else
-#define UTYPE_MAX (ulong) ~0L
-#define TYPE_MIN LONG_MIN
-#define TYPE_MAX LONG_MAX
-#define longtype long
-#define ulongtype unsigned long
-#ifdef USE_UNSIGNED
-#define function ulongtype strtoul
-#else
-#define function longtype strtol
-#endif
-#endif
-
-
-/* Convert NPTR to an `unsigned long int' or `long int' in base BASE.
- If BASE is 0 the base is determined by the presence of a leading
- zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal.
- If BASE is < 2 or > 36, it is reset to 10.
- If ENDPTR is not NULL, a pointer to the character after the last
- one converted is stored in *ENDPTR. */
-
-
-function (const char *nptr,char **endptr,int base)
-{
- int negative;
- register ulongtype cutoff;
- register unsigned int cutlim;
- register ulongtype i;
- register const char *s;
- register uchar c;
- const char *save;
- int overflow;
-
- if (base < 0 || base == 1 || base > 36)
- base = 10;
-
- s = nptr;
-
- /* Skip white space. */
- while (my_isspace(&my_charset_latin1, *s))
- ++s;
- if (*s == '\0')
- {
- goto noconv;
- }
-
- /* Check for a sign. */
- negative= 0;
- if (*s == '-')
- {
- negative = 1;
- ++s;
- }
- else if (*s == '+')
- {
- ++s;
- }
-
-
- if (base == 16 && s[0] == '0' && my_toupper (&my_charset_latin1, s[1]) == 'X')
- s += 2;
-
- /* If BASE is zero, figure it out ourselves. */
- if (base == 0)
- {
- if (*s == '0')
- {
- if (my_toupper (&my_charset_latin1, s[1]) == 'X')
- {
- s += 2;
- base = 16;
- }
- else
- base = 8;
- }
- else
- base = 10;
- }
-
- /* Save the pointer so we can check later if anything happened. */
- save = s;
-
- cutoff = UTYPE_MAX / (unsigned long int) base;
- cutlim = (uint) (UTYPE_MAX % (unsigned long int) base);
-
- overflow = 0;
- i = 0;
- for (c = *s; c != '\0'; c = *++s)
- {
- if (my_isdigit (&my_charset_latin1, c))
- c -= '0';
- else if (my_isalpha (&my_charset_latin1, c))
- c = my_toupper (&my_charset_latin1, c) - 'A' + 10;
- else
- break;
- if (c >= base)
- break;
- /* Check for overflow. */
- if (i > cutoff || (i == cutoff && c > cutlim))
- overflow = 1;
- else
- {
- i *= (ulongtype) base;
- i += c;
- }
- }
-
- /* Check if anything actually happened. */
- if (s == save)
- goto noconv;
-
- /* Store in ENDPTR the address of one character
- past the last character we converted. */
- if (endptr != NULL)
- *endptr = (char *) s;
-
-#ifndef USE_UNSIGNED
- /* Check for a value that is within the range of
- `unsigned long int', but outside the range of `long int'. */
- if (negative)
- {
- if (i > (ulongtype) TYPE_MIN)
- overflow = 1;
- }
- else if (i > (ulongtype) TYPE_MAX)
- overflow = 1;
-#endif
-
- if (overflow)
- {
- my_errno=ERANGE;
-#ifdef USE_UNSIGNED
- return UTYPE_MAX;
-#else
- return negative ? TYPE_MIN : TYPE_MAX;
-#endif
- }
-
- /* Return the result of the appropriate sign. */
- return (negative ? -((longtype) i) : (longtype) i);
-
-noconv:
- /* There was no number to convert. */
- my_errno=EDOM;
- if (endptr != NULL)
- *endptr = (char *) nptr;
- return 0L;
-}
diff --git a/strings/strtol.c b/strings/strtol.c
deleted file mode 100644
index 2f0a5286ee9..00000000000
--- a/strings/strtol.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (C) 2000 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* This implements strtol() if needed */
-
-/*
- These includes are mandatory because they check for type sizes and
- functions, especially they handle tricks for Tru64 where 'long' is
- 64 bit already and our 'longlong' is just a 'long'.
- */
-#include <my_global.h>
-#include <m_string.h>
-
-#if !defined(HAVE_STRTOL) && !defined(__WIN__)
-#include "strto.c"
-#endif
diff --git a/strings/strtoll.c b/strings/strtoll.c
deleted file mode 100644
index cfb6fbd75ee..00000000000
--- a/strings/strtoll.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (C) 2000 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* This implements strtoll() if needed */
-
-
-/*
- These includes are mandatory because they check for type sizes and
- functions, especially they handle tricks for Tru64 where 'long' is
- 64 bit already and our 'longlong' is just a 'long'.
- This solves a problem on Tru64 where the C99 compiler has a prototype
- for 'strtoll()' but no implementation, see "6.1 New C99 library functions"
- in file '/usr/share/doclib/cc.dtk/release_notes.txt'.
- */
-#include <my_global.h>
-#include <m_string.h>
-
-#if !defined(HAVE_STRTOLL) && defined(HAVE_LONG_LONG)
-#define USE_LONGLONG
-#include "strto.c"
-#endif
diff --git a/strings/strtoul.c b/strings/strtoul.c
deleted file mode 100644
index df5c46c220f..00000000000
--- a/strings/strtoul.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Copyright (C) 2000 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* This implements strtol() if needed */
-
-/*
- These includes are mandatory because they check for type sizes and
- functions, especially they handle tricks for Tru64 where 'long' is
- 64 bit already and our 'longlong' is just a 'long'.
- */
-#include <my_global.h>
-#include <m_string.h>
-
-#if !defined(HAVE_STRTOUL)
-#define USE_UNSIGNED
-#include "strto.c"
-#endif
diff --git a/strings/strtoull.c b/strings/strtoull.c
deleted file mode 100644
index 94bf6904f8d..00000000000
--- a/strings/strtoull.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 2000 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/* This implements strtoull() if needed */
-
-
-/*
- These includes are mandatory because they check for type sizes and
- functions, especially they handle tricks for Tru64 where 'long' is
- 64 bit already and our 'longlong' is just a 'long'.
- This solves a problem on Tru64 where the C99 compiler has a prototype
- for 'strtoull()' but no implementation, see "6.1 New C99 library functions"
- in file '/usr/share/doclib/cc.dtk/release_notes.txt'.
- */
-#include <my_global.h>
-#include <m_string.h>
-
-#if !defined(HAVE_STRTOULL) && defined(HAVE_LONG_LONG)
-#define USE_UNSIGNED
-#define USE_LONGLONG
-#include "strto.c"
-#endif
diff --git a/strings/strxmov.c b/strings/strxmov.c
index d5d81fd9274..815a4cbeaad 100644
--- a/strings/strxmov.c
+++ b/strings/strxmov.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
diff --git a/strings/strxnmov.c b/strings/strxnmov.c
index 16469be6e45..dac6eab5d63 100644
--- a/strings/strxnmov.c
+++ b/strings/strxnmov.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 MySQL AB
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
diff --git a/strings/uca-dump.c b/strings/uca-dump.c
index 774e940c7da..3ba78163c2f 100644
--- a/strings/uca-dump.c
+++ b/strings/uca-dump.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/uctypedump.c b/strings/uctypedump.c
index 2e484604fd3..5b902843ee1 100644
--- a/strings/uctypedump.c
+++ b/strings/uctypedump.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/utr11-dump.c b/strings/utr11-dump.c
index a15f63025f4..adbbdda1169 100644
--- a/strings/utr11-dump.c
+++ b/strings/utr11-dump.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 MySQL AB
+/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
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
diff --git a/strings/xml.c b/strings/xml.c
index 14da69e088a..abe40810a97 100644
--- a/strings/xml.c
+++ b/strings/xml.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -106,6 +106,13 @@ static void my_xml_norm_text(MY_XML_ATTR *a)
}
+static inline my_bool
+my_xml_parser_prefix_cmp(MY_XML_PARSER *p, const char *s, size_t slen)
+{
+ return (p->cur + slen > p->end) || memcmp(p->cur, s, slen);
+}
+
+
static int my_xml_scan(MY_XML_PARSER *p,MY_XML_ATTR *a)
{
int lex;
@@ -123,16 +130,20 @@ static int my_xml_scan(MY_XML_PARSER *p,MY_XML_ATTR *a)
a->beg=p->cur;
a->end=p->cur;
- if ((p->end - p->cur > 3) && !bcmp((uchar*) p->cur, (uchar*) "<!--",4))
+ if (!my_xml_parser_prefix_cmp(p, C_STRING_WITH_LEN("<!--")))
{
- for (; (p->cur < p->end) && bcmp((uchar*) p->cur, (uchar*) "-->", 3); p->cur++)
- {}
- if (!bcmp((uchar*) p->cur, (uchar*) "-->", 3))
- p->cur+=3;
+ for (; p->cur < p->end; p->cur++)
+ {
+ if (!my_xml_parser_prefix_cmp(p, C_STRING_WITH_LEN("-->")))
+ {
+ p->cur+= 3;
+ break;
+ }
+ }
a->end=p->cur;
lex=MY_XML_COMMENT;
}
- else if (!bcmp((uchar*) p->cur, (uchar*) "<![CDATA[",9))
+ else if (!my_xml_parser_prefix_cmp(p, C_STRING_WITH_LEN("<![CDATA[")))
{
p->cur+= 9;
for (; p->cur < p->end - 2 ; p->cur++)
@@ -154,11 +165,16 @@ static int my_xml_scan(MY_XML_PARSER *p,MY_XML_ATTR *a)
}
else if ( (p->cur[0] == '"') || (p->cur[0] == '\'') )
{
+ /*
+ "string" or 'string' found.
+ Scan until the closing quote/doublequote, or until the END-OF-INPUT.
+ */
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++;
+ if (p->cur < p->end) /* Closing quote or doublequote has been found */
+ p->cur++;
a->beg++;
if (!(p->flags & MY_XML_FLAG_SKIP_TEXT_NORMALIZATION))
my_xml_norm_text(a);
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
index ef676c8ee2a..f8a65e75d4d 100644
--- a/support-files/CMakeLists.txt
+++ b/support-files/CMakeLists.txt
@@ -14,7 +14,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
IF(WIN32)
- SET(localstatedir "C:\\mysql\\data")
+ SET(localstatedir "C:\\\\mysql\\\\data\\\\")
SET(ini_file_extension "ini")
ELSE()
SET(localstatedir "${MYSQL_DATADIR}")
@@ -48,25 +48,23 @@ FOREACH(inifile my-huge my-innodb-heavy-4G my-large my-medium my-small)
ENDFOREACH()
IF(UNIX)
- # XXX: again, used elsewhere (scripts/), should be standardised in
- # XXX: install_layout.cmake
- IF(INSTALL_LAYOUT MATCHES "STANDALONE")
- SET(prefix ".")
- ELSE()
- SET(prefix ${CMAKE_INSTALL_PREFIX})
- ENDIF()
-
+ SET(prefix ${CMAKE_INSTALL_PREFIX})
FOREACH(script mysqld_multi.server mysql-log-rotate binary-configure
config.medium.ini config.small.ini config.huge.ini ndb-config-2-node.ini)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${script}.sh
${CMAKE_CURRENT_BINARY_DIR}/${script} @ONLY )
+ IF(script MATCHES ".ini")
+ SET(comp IniFiles)
+ ELSE()
+ SET(comp Server_Scripts)
+ ENDIF()
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${script}
- DESTINATION ${inst_location}
+ DESTINATION ${inst_location} COMPONENT ${comp}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ENDFOREACH()
IF(INSTALL_SUPPORTFILESDIR)
- INSTALL(FILES magic DESTINATION ${inst_location})
+ INSTALL(FILES magic DESTINATION ${inst_location} COMPONENT SupportFiles)
ENDIF()
INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
@@ -83,7 +81,7 @@ IF(UNIX)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql.server.sh
${CMAKE_CURRENT_BINARY_DIR}/mysql.server @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql.server
- DESTINATION ${inst_location}
+ DESTINATION ${inst_location} COMPONENT SupportFiles
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ENDIF()
diff --git a/support-files/MacOSX/Description.plist.sh b/support-files/MacOSX/Description.plist.sh
index 03212dfdeff..a41e5891ecc 100644
--- a/support-files/MacOSX/Description.plist.sh
+++ b/support-files/MacOSX/Description.plist.sh
@@ -1,5 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!--
+ 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
+-->
<plist version="1.0">
<dict>
<key>IFPkgDescriptionDeleteWarning</key>
diff --git a/support-files/MacOSX/Info.plist.sh b/support-files/MacOSX/Info.plist.sh
index 7df9c5ac710..c6ec1edeac4 100644
--- a/support-files/MacOSX/Info.plist.sh
+++ b/support-files/MacOSX/Info.plist.sh
@@ -1,5 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!--
+ Copyright (C) 2003, 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-->
<plist version="1.0">
<dict>
<key>CFBundleGetInfoString</key>
diff --git a/support-files/MacOSX/Makefile.am b/support-files/MacOSX/Makefile.am
deleted file mode 100644
index 7d4384a2a56..00000000000
--- a/support-files/MacOSX/Makefile.am
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright (C) 2003-2006 MySQL AB
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-## Process this file with automake to create Makefile.in
-
-EXTRA_DIST = Info.plist.sh \
- Description.plist.sh \
- StartupParameters.plist.sh \
- postflight.sh \
- preflight.sh \
- ReadMe.txt \
- MySQLCOM \
- StartupItem.Description.plist \
- StartupItem.Info.plist \
- StartupItem.postinstall
-
-noinst_DATA = Info.plist \
- Description.plist \
- StartupParameters.plist \
- postflight \
- preflight
-
-CLEANFILES = Info.plist \
- Description.plist \
- StartupParameters.plist \
- postflight \
- preflight
-
-SUFFIXES = .sh
-
-.sh:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''prefix''@!$(prefix)!g' \
- -e 's!@''VERSION''@!@VERSION@!' \
- -e 's!@''MYSQL_NUMERIC_VERSION''@!@MYSQL_NUMERIC_VERSION@!' \
- -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \
- -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \
- $< > $@-t
- @MV@ $@-t $@
diff --git a/support-files/MacOSX/MySQLCOM b/support-files/MacOSX/MySQLCOM
index 9be5edb56f7..4d55fb44ec0 100755
--- a/support-files/MacOSX/MySQLCOM
+++ b/support-files/MacOSX/MySQLCOM
@@ -1,4 +1,20 @@
#!/bin/sh
+
+# Copyright (C) 2003, 2004 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
#
# /Library/StartupItems/MySQLCOM/MySQLCOM
#
diff --git a/support-files/MacOSX/StartupItem.Description.plist b/support-files/MacOSX/StartupItem.Description.plist
index e8ceb1ee062..1e0d975e0f2 100644
--- a/support-files/MacOSX/StartupItem.Description.plist
+++ b/support-files/MacOSX/StartupItem.Description.plist
@@ -1,5 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!--
+ Copyright (C) 2003, 2004 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+-->
<plist version="1.0">
<dict>
<key>IFPkgDescriptionDeleteWarning</key>
diff --git a/support-files/MacOSX/StartupItem.Info.plist b/support-files/MacOSX/StartupItem.Info.plist
index f403fbe7e84..7e348c4adec 100644
--- a/support-files/MacOSX/StartupItem.Info.plist
+++ b/support-files/MacOSX/StartupItem.Info.plist
@@ -1,5 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!--
+ 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
+-->
<plist version="1.0">
<dict>
<key>CFBundleGetInfoString</key>
diff --git a/support-files/MacOSX/StartupItem.postinstall b/support-files/MacOSX/StartupItem.postinstall
index f6f6f46f211..ddbd9732a5c 100755
--- a/support-files/MacOSX/StartupItem.postinstall
+++ b/support-files/MacOSX/StartupItem.postinstall
@@ -1,4 +1,20 @@
#!/bin/sh
+
+# 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
+
#
# postinstall script for the MySQL Startup Item Installation package
#
diff --git a/support-files/MacOSX/StartupParameters.plist.sh b/support-files/MacOSX/StartupParameters.plist.sh
index f5620c73f5f..35bc5a4f647 100644
--- a/support-files/MacOSX/StartupParameters.plist.sh
+++ b/support-files/MacOSX/StartupParameters.plist.sh
@@ -1,5 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!--
+ 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
+-->
<plist version="1.0">
<dict>
<key>Description</key>
diff --git a/support-files/MacOSX/mwar-wrapper b/support-files/MacOSX/mwar-wrapper
index 4bc5153e7ef..53624931b3b 100755
--- a/support-files/MacOSX/mwar-wrapper
+++ b/support-files/MacOSX/mwar-wrapper
@@ -1,5 +1,20 @@
#!/bin/sh
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
# This script can only create a library, not take it apart
# again to AR files
diff --git a/support-files/MacOSX/mwcc-wrapper b/support-files/MacOSX/mwcc-wrapper
index 914578aca1d..162b2e24479 100755
--- a/support-files/MacOSX/mwcc-wrapper
+++ b/support-files/MacOSX/mwcc-wrapper
@@ -1,5 +1,20 @@
#!/bin/sh
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
if [ -z "$CWINSTALL" ] ; then
echo "ERROR: You need to source 'mwvars' to set CWINSTALL and other variables"
exit 1
diff --git a/support-files/MacOSX/postflight.sh b/support-files/MacOSX/postflight.sh
index 451eb65e0d7..1e55c542c89 100644
--- a/support-files/MacOSX/postflight.sh
+++ b/support-files/MacOSX/postflight.sh
@@ -1,4 +1,22 @@
#!/bin/sh
+
+# Copyright (C) 2003, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
#
# postflight - this script will be executed after the MySQL PKG
# installation has been performed.
diff --git a/support-files/MacOSX/preflight.sh b/support-files/MacOSX/preflight.sh
index 700d0640a9e..a214008cf52 100644
--- a/support-files/MacOSX/preflight.sh
+++ b/support-files/MacOSX/preflight.sh
@@ -1,4 +1,22 @@
#!/bin/sh
+
+# Copyright (C) 2003, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
#
# preflight - this script will be executed before the MySQL PKG
# installation will be performed.
diff --git a/support-files/Makefile.am b/support-files/Makefile.am
deleted file mode 100644
index b75d31e9e1a..00000000000
--- a/support-files/Makefile.am
+++ /dev/null
@@ -1,133 +0,0 @@
-# Copyright (C) 2000-2006 MySQL AB, 2008-2010 Sun Microsystems, Inc.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-## Process this file with automake to create Makefile.in
-
-EXTRA_DIST = mysql.spec.sh \
- my-small.cnf.sh \
- my-medium.cnf.sh \
- my-large.cnf.sh \
- my-huge.cnf.sh \
- my-innodb-heavy-4G.cnf.sh \
- mysql-log-rotate.sh \
- mysql.server.sh \
- mysqld_multi.server.sh \
- config.huge.ini.sh \
- config.medium.ini.sh \
- config.small.ini.sh \
- binary-configure.sh \
- magic mysql.m4 \
- MySQL-shared-compat.spec.sh \
- ndb-config-2-node.ini.sh \
- compiler_warnings.supp \
- dtrace \
- CMakeLists.txt
-
-SUBDIRS = MacOSX RHEL4-SElinux
-
-# 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 \
- config.huge.ini \
- config.medium.ini \
- config.small.ini \
- my-innodb-heavy-4G.cnf \
- mysql-log-rotate \
- binary-configure \
- ndb-config-2-node.ini
-
-pkgsupp_SCRIPTS = mysql.server \
- mysqld_multi.server \
- binary-configure \
- mysql-log-rotate
-
-aclocaldir = $(datadir)/aclocal
-aclocal_DATA = mysql.m4
-
-noinst_DATA = mysql-@VERSION@.spec \
- MySQL-shared-compat.spec
-
-CLEANFILES = my-small.cnf \
- my-medium.cnf \
- my-large.cnf \
- my-huge.cnf \
- config.huge.ini \
- config.medium.ini \
- config.small.ini \
- my-innodb-heavy-4G.cnf \
- mysql.spec \
- mysql-@VERSION@.spec \
- mysql-log-rotate \
- mysql.server \
- mysqld_multi.server \
- binary-configure \
- MySQL-shared-compat.spec \
- ndb-config-2-node.ini
-
-mysql-@VERSION@.spec: mysql.spec
- rm -f $@
- cp mysql.spec $@
-
-SUFFIXES = .sh
-
-.sh:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''bindir''@!$(bindir)!g' \
- -e 's!@''sbindir''@!$(sbindir)!g' \
- -e 's!@''scriptdir''@!$(bindir)!g' \
- -e 's!@''prefix''@!$(prefix)!g' \
- -e 's!@''datadir''@!$(datadir)!g' \
- -e 's!@''localstatedir''@!$(localstatedir)!g' \
- -e 's!@''libexecdir''@!$(libexecdir)!g' \
- -e 's!@''CC''@!@CC@!'\
- -e 's!@''CXX''@!@CXX@!'\
- -e 's!@''GXX''@!@GXX@!'\
- -e 's!@''PERL''@!@PERL@!' \
- -e 's!@''CFLAGS''@!@SAVE_CFLAGS@!'\
- -e 's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'\
- -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\
- -e 's!@''VERSION''@!@VERSION@!' \
- -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \
- -e 's!@''COMPILATION_COMMENT''@!@COMPILATION_COMMENT@!' \
- -e 's!@''MACHINE_TYPE''@!@MACHINE_TYPE@!' \
- -e 's!@''HOSTNAME''@!@HOSTNAME@!' \
- -e 's!@''SYSTEM_TYPE''@!@SYSTEM_TYPE@!' \
- -e 's!@''CHECK_PID''@!@CHECK_PID@!' \
- -e 's!@''FIND_PROC''@!@FIND_PROC@!' \
- -e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \
- -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
- -e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \
- -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \
- -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \
- -e 's!@''sysconfdir''@!@sysconfdir@!' \
- -e 's!@''SHORT_MYSQL_INTRO''@!@SHORT_MYSQL_INTRO@!' \
- -e 's!@''SHARED_LIB_VERSION''@!@SHARED_LIB_VERSION@!' \
- -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
- -e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
- -e 's!@''MYSQL_U_SCORE_VERSION''@!@MYSQL_U_SCORE_VERSION@!' \
- -e 's!@''MYSQL_COPYRIGHT_YEAR''@!@MYSQL_COPYRIGHT_YEAR@!' \
- -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
- -e 's!@''PERL_DBI_VERSION''@!@PERL_DBI_VERSION@!' \
- -e 's!@''PERL_DBD_VERSION''@!@PERL_DBD_VERSION@!' \
- -e 's!@''PERL_DATA_DUMPER''@!@PERL_DATA_DUMPER@!' \
- $< > $@-t
- @MV@ $@-t $@
diff --git a/support-files/MySQL-shared-compat.spec.sh b/support-files/MySQL-shared-compat.spec.sh
index 72654a22d87..b8b27863b3d 100644
--- a/support-files/MySQL-shared-compat.spec.sh
+++ b/support-files/MySQL-shared-compat.spec.sh
@@ -27,7 +27,7 @@
#
# Change this to match the version of the shared libs you want to include
#
-%define version_cur @MYSQL_U_SCORE_VERSION@
+%define version_cur @MYSQL_RPM_VERSION@
%define version41 4.1.17
%define version40 4.0.26
%define version3 3.23.58
diff --git a/support-files/RHEL4-SElinux/Makefile.am b/support-files/RHEL4-SElinux/Makefile.am
deleted file mode 100644
index d2143a5285c..00000000000
--- a/support-files/RHEL4-SElinux/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2000-2001, 2003-2006 MySQL AB
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-## Process this file with automake to create Makefile.in
-
-EXTRA_DIST = mysql.fc mysql.te
diff --git a/support-files/RHEL4-SElinux/mysql.fc b/support-files/RHEL4-SElinux/mysql.fc
index 0db0ccf6e68..b44795e6f8c 100644
--- a/support-files/RHEL4-SElinux/mysql.fc
+++ b/support-files/RHEL4-SElinux/mysql.fc
@@ -1,3 +1,18 @@
+# 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
+
# MySQL Database Server
#
diff --git a/support-files/RHEL4-SElinux/mysql.te b/support-files/RHEL4-SElinux/mysql.te
index b050fa7b1a6..922389305ea 100644
--- a/support-files/RHEL4-SElinux/mysql.te
+++ b/support-files/RHEL4-SElinux/mysql.te
@@ -1,3 +1,17 @@
+# 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
policy_module(mysql,1.0.0)
diff --git a/support-files/SCO/INSTALL.sh b/support-files/SCO/INSTALL.sh
deleted file mode 100755
index 979f33f3f06..00000000000
--- a/support-files/SCO/INSTALL.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-# search & check GNU patch
-PATCH="gpatch"
-$PATCH --version || PATCH="patch"
-$PATCH --version || exit
-
-
-if /usr/bin/test ! -e PKG/stamp-pre ; then
- grep VERSION configure | head -1 | sed 's/VERSION=//' > ./PKG/version
- touch PKG/stamp-pre
-fi
-
-if /usr/bin/test ! -e PKG/stamp-patch ; then
- ${PATCH} -p0 < ./PKG/patch
- touch PKG/stamp-patch
-fi
-
-if /usr/bin/test ! -e PKG/stamp-compile ; then
-sh ./PKG/compile.sh ujis
-touch PKG/stamp-compile
-
-sh ./PKG/doc.sh ujis
-
-fi
-
-
-cd PKG
-sh mkpkg.sh ujis
diff --git a/support-files/SCO/compile.sh b/support-files/SCO/compile.sh
deleted file mode 100644
index 5281ccde02d..00000000000
--- a/support-files/SCO/compile.sh
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/bin/sh
-# GNU ncurses
-
-# search & check GNU make
-GMAKE="gmake"
-$GMAKE --version || GMAKE="make"
-$GMAKE --version || exit
-
-MAKE=$GMAKE
-export MAKE
-
-CC=gcc
-CFLAGS="-O6 -fomit-frame-pointer"
-CXX=gcc
-CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti"
-# LDFLAGS="-static"
-LD=gcc
-
-export CC
-export CXX
-export LD
-export CFLAGS
-export CXXFLAGS
-# export LDFLAGS
-# Solaris don't have libpthread.a.
-
-if [ "x$1" = "x" ]; then
- echo " please set character set"
- exit
-fi
-
-CHAR="$1"
-case "$1" in
- [uU]*)
- CHAR=ujis
- ;;
- [sS]*)
- CHAR=sjis
- ;;
-esac
-
-#---------------
-P=`pwd`
-
-if [ -f Makefile ] ; then
- ${GMAKE} distclean
-fi
-
-for i in bin sbin include man share/doc/mysql mysql-data
-do
- /usr/bin/mkdir -p PKG/tmp-${CHAR}/usr/local/${i}
-done
-/usr/bin/mkdir -p PKG/tmp-${CHAR}/etc/init.d
-
-#----------------------------
-./configure \
- --prefix=/usr/local \
- --libexecdir=/usr/local/sbin \
- --sbindir=/usr/local/sbin \
- --localstatedir=/usr/local/mysql-data \
- --with-charset=${CHAR} \
- --with-extra-charsets=all \
- --with-raid \
- --without-docs \
- --without-bench \
- --without-perl \
- --with-gcc \
- --with-mysqld-ldflags="-static" \
- --with-client-ldflags="-static" \
- --with-named-curses-libs=/usr/local/lib/libncurses.a \
- --with-mysqld-user=mysql
-
-# --with-berkeley-db-includes=/usr/local/include/db3 \
-# --with-berkeley-db-libs=/usr/local/lib/libdb3.a \
-# --with-low-memory
-
-${GMAKE}
-${GMAKE} install DESTDIR=${P}/PKG/tmp-${CHAR}
-
-v=`grep '^SHARED_LIB_VERSION' configure.in | sed 's@SHARED_LIB_VERSION@@' | sed -e 's@=@@' -e 's@:@ @g' | awk '{print $1}'`
-km="libmysqlclient.so.$v"
-export km
-
-(cd ${P}/PKG/tmp-${CHAR}/usr/local/lib/mysql/ ; \
- for i in libmysqlclient* ; do \
- if /usr/bin/test ! -L $i ; then \
- mv $i ../ ; ln -sf ../$i ; \
- fi ; \
- done ; \
- k=`ls libmysqlclient.so.*.*.*` ; \
- cd .. ; \
- if /usr/bin/test ! -z libmysqlclient.so ; then \
- ln -sf $k libmysqlclient.so ;
- fi ; \
- if /usr/bin/test ! -z $km ; then \
- ln -sf $k $km ;
- fi ; \
-)
-
-#
-(cd ${P}/PKG/tmp-${CHAR}/usr/local/bin ; strip * )
-(cd ${P}/PKG/tmp-${CHAR}/usr/local/sbin ; strip * )
diff --git a/support-files/SCO/doc.sh b/support-files/SCO/doc.sh
deleted file mode 100644
index 9ef17166a6f..00000000000
--- a/support-files/SCO/doc.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-CHAR="$1"
-case "$1" in
- [uU]*)
- CHAR=ujis
- ;;
- [sS]*)
- CHAR=sjis
- ;;
-esac
-
-cp -r Docs/* PKG/tmp-${CHAR}/usr/local/share/doc/mysql/
-cp INSTALL-SOURCE* COPYING* MIRRORS README* PKG/tmp-${CHAR}/usr/local/share/doc/mysql/
-
-cd PKG/tmp-${CHAR}/usr/local/share/doc/mysql/
-gzip *.txt *.texi *.info *.pdf
diff --git a/support-files/SCO/mkpkg.sh b/support-files/SCO/mkpkg.sh
deleted file mode 100644
index 5a38113138d..00000000000
--- a/support-files/SCO/mkpkg.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-
-if [ "x$1" = "x" ]; then
- echo " please set charset"
- exit
-fi
-
-CHAR="$1"
-case "$1" in
- [uU]*)
- CHAR=ujis ; CH=uj
- ;;
- [sS]*)
- CHAR=sjis ; CH=sj
- ;;
-esac
-
-#-------------------
-DIR=`pwd`
-
-VERSION=`cat version`
-
-T=`uname -p`
-
-sed -e "s/@CHAR1@/${CH}/" \
- -e "s/@CHAR2@/${CHAR}/" \
- -e "s/@VERSION@/${VERSION}/" \
- -e "s/@TYPE@/${T}/" \
- pkginfo.ini > pkginfo.${CHAR}
-
-sed -e "s,@DIR@,${DIR},g" \
- -e "s,@PKGINFO@,${DIR}/pkginfo.${CHAR}," \
- prototype.ini > prototype.${CHAR}
-
-INIT="tmp-${CHAR}/etc/init.d/mysql"
-cp ../support-files/mysql.server $INIT
-chmod 755 $INIT
-
-(cd tmp-${CHAR}; \
-chown root etc usr ; \
-chgrp sys etc usr ;\
-chmod 755 usr etc; \
-chgrp sys etc/init.d ; \
-chmod 755 etc/init.d ; \
-find . -print|pkgproto >> ../prototype.${CHAR})
-
-pkgmk -o -f prototype.${CHAR} -r ${DIR}/tmp-${CHAR}
diff --git a/support-files/SCO/patch b/support-files/SCO/patch
deleted file mode 100644
index 373eb8518c6..00000000000
--- a/support-files/SCO/patch
+++ /dev/null
@@ -1,96 +0,0 @@
---- scripts/safe_mysqld.sh.orig Sat Sep 2 17:28:26 2000
-+++ scripts/safe_mysqld.sh Sat Sep 2 17:31:19 2000
-@@ -89,10 +89,10 @@
-
-
- NOHUP_NICENESS=`nohup nice`
--if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice --1 echo foo > /dev/null 2>&1; then
-+if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice -1 echo foo > /dev/null 2>&1; then
- NOHUP_NICENESS="nohup"
- else
-- NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup"
-+ NOHUP_NICENESS="nice -$NOHUP_NICENESS nohup"
- fi
-
- export MYSQL_UNIX_PORT
-@@ -163,7 +163,8 @@
- # The only thing is ps x => redhat 5 gives warnings when using ps -x.
- # kill -9 is used or the process won't react on the kill.
- numofproces=`ps xa | grep -v "grep" | grep -c $ledir/mysqld`
-- echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log
-+ echo | tee -a $err_log
-+ echo "Number of processes running now: $numofproces" | tee -a $err_log
- I=1
- while test "$I" -le "$numofproces"
- do
-@@ -185,4 +186,6 @@
- echo "`date +'%y%m%d %H:%M:%S mysqld restarted'`" | tee -a $err_log
- done
-
--echo -e "`date +'%y%m%d %H:%M:%S mysqld ended\n'`" | tee -a $err_log
-+echo | tee -a $err_log
-+echo "`date +'%y%m%d %H:%M:%S mysqld ended'`" | tee -a $err_log
-+echo | tee -a $err_log
---- support-files/mysql.server.sh.orig Sat Sep 2 17:35:56 2000
-+++ support-files/mysql.server.sh Sat Sep 2 17:36:35 2000
-@@ -23,6 +23,9 @@
- mysql_daemon_user=@MYSQLD_USER@
- export PATH
-
-+## your options...
-+OPT=""
-+
- mode=$1
-
- if test -w / # determine if we should look at the root config file
-@@ -82,8 +85,9 @@
- then
- # Give extra arguments to mysqld with the my.cnf file. This script may
- # be overwritten at next upgrade.
-- $bindir/safe_mysqld \
-- --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file --log=$log_file &
-+ $bindir/safe_mysqld $OPT \
-+ --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file &
-+# --log=$log_file &
- else
- echo "Can't execute $bindir/safe_mysqld"
- fi
---- configure.orig Sat Sep 2 17:54:03 2000
-+++ configure Sat Sep 2 17:54:18 2000
-@@ -202,7 +202,7 @@
- --with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
- croat czech danish dec8 dos estonia euc_kr gb2312 gbk
- german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
-- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
-+ latin1 latin2 swe7 usa7 win1250 win1251ukr
- ujis sjis tis620; default is latin1)"
- ac_help="$ac_help
- --with-extra-charsets=cs1,cs2
-@@ -8843,7 +8843,7 @@
-
- # Choose a character set
-
--CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
-+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
- DEFAULT_CHARSET=latin1
-
- # Check whether --with-charset or --without-charset was given.
---- configure.in.orig Sat Sep 2 17:53:57 2000
-+++ configure.in Sat Sep 2 17:54:36 2000
-@@ -1517,14 +1517,14 @@
- dnl or other special handling, you must also create
- dnl strings/ctype-$charset_name.c
-
--CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620"
-+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620"
- DEFAULT_CHARSET=latin1
-
- AC_ARG_WITH(charset,
- [ --with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257
- croat czech danish dec8 dos estonia euc_kr gb2312 gbk
- german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr
-- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr
-+ latin1 latin2 swe7 usa7 win1250 win1251ukr
- ujis sjis tis620; default is latin1)],
- [default_charset="$withval"],
- [default_charset="$DEFAULT_CHARSET"])
diff --git a/support-files/SCO/pkginfo.ini b/support-files/SCO/pkginfo.ini
deleted file mode 100644
index 13b8b6adb09..00000000000
--- a/support-files/SCO/pkginfo.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-PKG=MySQL
-NAME=MySQL
-ARCH=@TYPE@
-VERSION=@VERSION@
-CATEGORY=utility
-VENDOR=TcX DataKonsult AB, Detron HB and MySQL AB
-BASEDIR=/
-CLASSES=none
diff --git a/support-files/SCO/postinstall b/support-files/SCO/postinstall
deleted file mode 100644
index 2e199b9af82..00000000000
--- a/support-files/SCO/postinstall
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin
-LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
-export PATH
-export LD_LIBRARY_PATH
-
-D0="/usr/local/mysql-data"
-D="${D0}/mysql"
-
-DOFIX=0
-
-if /usr/bin/test ! -f ${D}/tables_priv.frm -a -d ${D} ; then
- DOFIX=1
-fi
-
-if [ ! -d ${D} ]; then
- DOFIX=2
- /usr/local/bin/mysql_install_db
-fi
-
- chown -R mysql $D0
- chgrp -R mysql $D0
-
-if /usr/bin/test $DOFIX -eq 1 ; then
- /etc/init.d/mysql start
- /usr/local/bin/mysql_fix_privilege_tables
-else
- /etc/init.d/mysql start || true
-fi
diff --git a/support-files/SCO/preinstall b/support-files/SCO/preinstall
deleted file mode 100644
index c1175561a99..00000000000
--- a/support-files/SCO/preinstall
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin
-LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
-export PATH
-export LD_LIBRARY_PATH
-
-if /usr/bin/test -x /etc/init.d/mysql ; then
- /etc/init.d/mysql stop || true
-fi
-
-#----- user check
-P=`grep mysql /etc/passwd`
-G=`grep mysql /etc/group`
-
-if /usr/bin/test "x$G" = "x" ; then
- /usr/sbin/groupadd mysql
-fi
-if /usr/bin/test "x$P" = "x" ; then
- /usr/sbin/useradd -g mysql -d /usr/local/mysql-data -s /bin/false mysql
-fi
diff --git a/support-files/SCO/preremove b/support-files/SCO/preremove
deleted file mode 100644
index a89648431c1..00000000000
--- a/support-files/SCO/preremove
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin
-LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
-export PATH
-export LD_LIBRARY_PATH
-
-pid=`/usr/bin/ps -e | /usr/bin/grep mysqld | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
-[ "$pid" != "" ] && /usr/local/bin/mysqladmin shutdown
-
-#---
-#/usr/ucb/echo -n "Remove DATA Directory (All data expire) [Y/N]? "
-#read I
-I=No
-
-case "$I" in
-Y*|y*)
- /usr/ucb/echo -n "Removing MySQL DATA ALL..."
- rm -rf /usr/local/mysql-data
- echo "done."
- ;;
-*)
- echo "not purge DATA directory"
- ;;
-esac;
diff --git a/support-files/SCO/prototype.ini b/support-files/SCO/prototype.ini
deleted file mode 100644
index ca88bb67a90..00000000000
--- a/support-files/SCO/prototype.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-i pkginfo=@PKGINFO@
-i postinstall=@DIR@/postinstall
-i preinstall=@DIR@/preinstall
-i preremove=@DIR@/preremove
diff --git a/support-files/SCO/version b/support-files/SCO/version
deleted file mode 100644
index f9dc296b71b..00000000000
--- a/support-files/SCO/version
+++ /dev/null
@@ -1 +0,0 @@
-3.23.23-beta
diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp
index 3025fdf5f5d..2e3a878cd73 100644
--- a/support-files/compiler_warnings.supp
+++ b/support-files/compiler_warnings.supp
@@ -1,3 +1,18 @@
+# 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
+
#
# This file contains compiler warnings that can
# be ignored for various reasons.
diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh
index a6bf70b6f83..378a1df67aa 100644
--- a/support-files/my-huge.cnf.sh
+++ b/support-files/my-huge.cnf.sh
@@ -3,11 +3,11 @@
# This is for a large system with memory of 1G-2G where the system runs mainly
# MySQL.
#
-# You can copy this file to
-# /etc/my.cnf to set global options,
-# mysql-data-dir/my.cnf to set server-specific options (in this
-# installation this directory is @localstatedir@) or
-# ~/.my.cnf to set user-specific options.
+# MySQL programs look for option files in a set of
+# locations which depend on the deployment platform.
+# You can copy this option file to one of those
+# locations. For information about these locations, see:
+# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
@@ -113,14 +113,10 @@ server-id = 1
# binary logging format - mixed recommended
#binlog_format=mixed
-# Point the following paths to different dedicated disks
-#tmpdir = /tmp/
-#log-bin = /path-to-dedicated-directory/hostname
-
# Uncomment the following if you are using InnoDB tables
-#innodb_data_home_dir = @localstatedir@/
+#innodb_data_home_dir = @localstatedir@
#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
-#innodb_log_group_home_dir = @localstatedir@/
+#innodb_log_group_home_dir = @localstatedir@
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 384M
diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh
index 90eab6b7cbe..f39ed58c190 100644
--- a/support-files/my-innodb-heavy-4G.cnf.sh
+++ b/support-files/my-innodb-heavy-4G.cnf.sh
@@ -8,10 +8,11 @@
# running mostly MySQL using InnoDB only tables and performing complex
# queries with few connections.
#
-# You can copy this file to /etc/my.cnf to set global options,
-# mysql-data-dir/my.cnf to set server-specific options
-# (@localstatedir@ for this installation) or to
-# ~/.my.cnf to set user-specific options.
+# MySQL programs look for option files in a set of
+# locations which depend on the deployment platform.
+# You can copy this option file to one of those
+# locations. For information about these locations, see:
+# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
@@ -232,15 +233,6 @@ slow_query_log
# currently measures time with second accuracy only).
long_query_time = 2
-# The directory used by MySQL for storing temporary files. For example,
-# it is used to perform disk based large sorts, as well as for internal
-# and explicit temporary tables. It might be good to put it on a
-# swapfs/tmpfs filesystem, if you do not create very large temporary
-# files. Alternatively you can put it on dedicated disk. You can
-# specify multiple paths here by separating them by ";" - they will then
-# be used in a round-robin fashion.
-#tmpdir = /tmp
-
# *** Replication related settings
diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh
index 92839b8fc2c..79d43407cda 100644
--- a/support-files/my-large.cnf.sh
+++ b/support-files/my-large.cnf.sh
@@ -3,11 +3,11 @@
# This is for a large system with memory = 512M where the system runs mainly
# MySQL.
#
-# You can copy this file to
-# /etc/my.cnf to set global options,
-# mysql-data-dir/my.cnf to set server-specific options (in this
-# installation this directory is @localstatedir@) or
-# ~/.my.cnf to set user-specific options.
+# MySQL programs look for option files in a set of
+# locations which depend on the deployment platform.
+# You can copy this option file to one of those
+# locations. For information about these locations, see:
+# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
@@ -113,14 +113,10 @@ server-id = 1
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin
-# Point the following paths to different dedicated disks
-#tmpdir = /tmp/
-#log-bin = /path-to-dedicated-directory/hostname
-
# Uncomment the following if you are using InnoDB tables
-#innodb_data_home_dir = @localstatedir@/
+#innodb_data_home_dir = @localstatedir@
#innodb_data_file_path = ibdata1:10M:autoextend
-#innodb_log_group_home_dir = @localstatedir@/
+#innodb_log_group_home_dir = @localstatedir@
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 256M
diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh
index b219d02a7be..4ec245e88b9 100644
--- a/support-files/my-medium.cnf.sh
+++ b/support-files/my-medium.cnf.sh
@@ -4,11 +4,11 @@
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
-# You can copy this file to
-# /etc/my.cnf to set global options,
-# mysql-data-dir/my.cnf to set server-specific options (in this
-# installation this directory is @localstatedir@) or
-# ~/.my.cnf to set user-specific options.
+# MySQL programs look for option files in a set of
+# locations which depend on the deployment platform.
+# You can copy this option file to one of those
+# locations. For information about these locations, see:
+# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
@@ -111,14 +111,10 @@ server-id = 1
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin
-# Point the following paths to different dedicated disks
-#tmpdir = /tmp/
-#log-bin = /path-to-dedicated-directory/hostname
-
# Uncomment the following if you are using InnoDB tables
-#innodb_data_home_dir = @localstatedir@/
+#innodb_data_home_dir = @localstatedir@
#innodb_data_file_path = ibdata1:10M:autoextend
-#innodb_log_group_home_dir = @localstatedir@/
+#innodb_log_group_home_dir = @localstatedir@
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh
index 99274cd1306..8c78072c0a7 100644
--- a/support-files/my-small.cnf.sh
+++ b/support-files/my-small.cnf.sh
@@ -4,11 +4,11 @@
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
-# You can copy this file to
-# /etc/my.cnf to set global options,
-# mysql-data-dir/my.cnf to set server-specific options (in this
-# installation this directory is @localstatedir@) or
-# ~/.my.cnf to set user-specific options.
+# MySQL programs look for option files in a set of
+# locations which depend on the deployment platform.
+# You can copy this option file to one of those
+# locations. For information about these locations, see:
+# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
@@ -59,9 +59,9 @@ server-id = 1
#binlog_direct_non_transactional_updates=TRUE
# Uncomment the following if you are using InnoDB tables
-#innodb_data_home_dir = @localstatedir@/
+#innodb_data_home_dir = @localstatedir@
#innodb_data_file_path = ibdata1:10M:autoextend
-#innodb_log_group_home_dir = @localstatedir@/
+#innodb_log_group_home_dir = @localstatedir@
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index b17948fb75c..7e9e8faae46 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -1,4 +1,4 @@
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@@ -211,7 +211,6 @@
%define license_files_server %{src_dir}/LICENSE.mysql
%define license_type Commercial
%else
-%define license_files_devel %{src_dir}/EXCEPTIONS-CLIENT
%define license_files_server %{src_dir}/COPYING %{src_dir}/README
%define license_type GPL
%endif
@@ -223,7 +222,7 @@
Name: MySQL%{product_suffix}
Summary: MySQL: a very fast and reliable SQL database server
Group: Applications/Databases
-Version: @MYSQL_U_SCORE_VERSION@
+Version: @MYSQL_RPM_VERSION@
Release: %{release}%{?distro_releasetag:.%{distro_releasetag}}
Distribution: %{distro_description}
License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Use is subject to license terms. Under %{license_type} license as shown in the Description field.
@@ -335,6 +334,7 @@ For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
%package -n MySQL-shared%{product_suffix}
Summary: MySQL - Shared libraries
Group: Applications/Databases
+Provides: mysql-shared
Obsoletes: MySQL-shared-community
%description -n MySQL-shared%{product_suffix}
@@ -398,6 +398,7 @@ export CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}}
export CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:-${CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti}}
export LDFLAGS=${MYSQL_BUILD_LDFLAGS:-${LDFLAGS:-}}
export CMAKE=${MYSQL_BUILD_CMAKE:-${CMAKE:-cmake}}
+export MAKE_JFLAG=${MYSQL_BUILD_MAKE_JFLAG:-}
# Build debug mysqld and libmysqld.a
mkdir debug
@@ -425,7 +426,7 @@ mkdir debug
-DCOMPILATION_COMMENT="%{compilation_comment_debug}" \
-DMYSQL_SERVER_SUFFIX="%{server_suffix}"
echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG
- make VERBOSE=1
+ make ${MAKE_JFLAG} VERBOSE=1
)
# Build full release
mkdir release
@@ -440,7 +441,7 @@ mkdir release
-DCOMPILATION_COMMENT="%{compilation_comment_release}" \
-DMYSQL_SERVER_SUFFIX="%{server_suffix}"
echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG
- make VERBOSE=1
+ make ${MAKE_JFLAG} VERBOSE=1
)
# Use the build root for temporary storage of the shared libraries.
@@ -522,10 +523,27 @@ rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
##############################################################################
%pre -n MySQL-server%{product_suffix}
+# This is the code running at the beginning of a RPM upgrade action,
+# before replacing the old files with the new ones.
# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
-mysql_datadir=%{mysqldatadir}
+# There are users who deviate from the default file system layout.
+# Check local settings to support them.
+if [ -x %{_bindir}/my_print_defaults ]
+then
+ mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
+ PID_FILE_PATT=`%{_bindir}/my_print_defaults server mysqld | grep '^--pid-file=' | sed -n 's/--pid-file=//p'`
+fi
+if [ -z "$mysql_datadir" ]
+then
+ mysql_datadir=%{mysqldatadir}
+fi
+if [ -z "$PID_FILE_PATT" ]
+then
+ PID_FILE_PATT="$mysql_datadir/*.pid"
+fi
+
# Check if we can safely upgrade. An upgrade is only safe if it's from one
# of our RPMs in the same version family.
@@ -600,7 +618,7 @@ fi
# We assume that if there is exactly one ".pid" file,
# it contains the valid PID of a running MySQL server.
-NR_PID_FILES=`ls $mysql_datadir/*.pid 2>/dev/null | wc -l`
+NR_PID_FILES=`ls $PID_FILE_PATT 2>/dev/null | wc -l`
case $NR_PID_FILES in
0 ) SERVER_TO_START='' ;; # No "*.pid" file == no running server
1 ) SERVER_TO_START='true' ;;
@@ -622,8 +640,8 @@ if [ -f $STATUS_FILE ]; then
echo "before repeating the MySQL upgrade."
exit 1
elif [ -n "$SEVERAL_PID_FILES" ] ; then
- echo "Your MySQL directory '$mysql_datadir' has more than one PID file:"
- ls -ld $mysql_datadir/*.pid
+ echo "You have more than one PID file:"
+ ls -ld $PID_FILE_PATT
echo "Please check which one (if any) corresponds to a running server"
echo "and delete all others before repeating the MySQL upgrade."
exit 1
@@ -648,17 +666,17 @@ if [ -d $mysql_datadir ] ; then
if [ -n "$SERVER_TO_START" ] ; then
# There is only one PID file, race possibility ignored
echo "PID file:" >> $STATUS_FILE
- ls -l $mysql_datadir/*.pid >> $STATUS_FILE
- cat $mysql_datadir/*.pid >> $STATUS_FILE
+ ls -l $PID_FILE_PATT >> $STATUS_FILE
+ cat $PID_FILE_PATT >> $STATUS_FILE
echo >> $STATUS_FILE
echo "Server process:" >> $STATUS_FILE
- ps -fp `cat $mysql_datadir/*.pid` >> $STATUS_FILE
+ ps -fp `cat $PID_FILE_PATT` >> $STATUS_FILE
echo >> $STATUS_FILE
echo "SERVER_TO_START=$SERVER_TO_START" >> $STATUS_FILE
else
# Take a note we checked it ...
echo "PID file:" >> $STATUS_FILE
- ls -l $mysql_datadir/*.pid >> $STATUS_FILE 2>&1
+ ls -l $PID_FILE_PATT >> $STATUS_FILE 2>&1
fi
fi
@@ -673,10 +691,22 @@ if [ -x %{_sysconfdir}/init.d/mysql ] ; then
fi
%post -n MySQL-server%{product_suffix}
+# This is the code running at the end of a RPM install or upgrade action,
+# after the (new) files have been written.
# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
-mysql_datadir=%{mysqldatadir}
+# There are users who deviate from the default file system layout.
+# Check local settings to support them.
+if [ -x %{_bindir}/my_print_defaults ]
+then
+ mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
+fi
+if [ -z "$mysql_datadir" ]
+then
+ mysql_datadir=%{mysqldatadir}
+fi
+
NEW_VERSION=%{mysql_version}-%{release}
STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER
@@ -854,7 +884,17 @@ fi
# http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s02.html
# For all details of this code, see the "pre" and "post" sections.
-mysql_datadir=%{mysqldatadir}
+# There are users who deviate from the default file system layout.
+# Check local settings to support them.
+if [ -x %{_bindir}/my_print_defaults ]
+then
+ mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
+fi
+if [ -z "$mysql_datadir" ]
+then
+ mysql_datadir=%{mysqldatadir}
+fi
+
NEW_VERSION=%{mysql_version}-%{release}
STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST # Note the difference!
STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY
@@ -907,6 +947,8 @@ echo "=====" >> $STATUS_HISTORY
%doc %{license_files_server}
%endif
%doc %{src_dir}/Docs/ChangeLog
+%doc %{src_dir}/Docs/INFO_SRC*
+%doc release/Docs/INFO_BIN*
%doc release/support-files/my-*.cnf
%doc %attr(644, root, root) %{_infodir}/mysql.info*
@@ -974,11 +1016,23 @@ echo "=====" >> $STATUS_HISTORY
%attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so
%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/auth.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_master.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_slave.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so
%if %{WITH_TCMALLOC}
%attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target}
@@ -1024,9 +1078,6 @@ echo "=====" >> $STATUS_HISTORY
# ----------------------------------------------------------------------------
%files -n MySQL-devel%{product_suffix} -f optional-files-devel
%defattr(-, root, root, 0755)
-%if %{defined license_files_devel}
-%doc %{license_files_devel}
-%endif
%doc %attr(644, root, man) %{_mandir}/man1/comp_err.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_config.1*
%attr(755, root, root) %{_bindir}/mysql_config
@@ -1075,6 +1126,31 @@ echo "=====" >> $STATUS_HISTORY
# merging BK trees)
##############################################################################
%changelog
+* Thu Feb 09 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Fix bug#56581: If an installation deviates from the default file locations
+ ("datadir" and "pid-file"), the mechanism to detect a running server (on upgrade)
+ should still work, and use these locations.
+ The problem was that the fix for bug#27072 did not check for local settings.
+
+* Mon Jan 31 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Install the new "manifest" files: "INFO_SRC" and "INFO_BIN".
+
+* Tue Nov 23 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
+
+- EXCEPTIONS-CLIENT has been deleted, remove it from here too
+- Support MYSQL_BUILD_MAKE_JFLAG environment variable for passing
+ a '-j' argument to make.
+
+* Mon Nov 1 2010 Georgi Kodinov <georgi.godinov@oracle.com>
+
+- Added test authentication (WL#1054) plugin binaries
+
+* Wed Oct 6 2010 Georgi Kodinov <georgi.godinov@oracle.com>
+
+- Added example external authentication (WL#1054) plugin binaries
+
* Wed Aug 11 2010 Joerg Bruehe <joerg.bruehe@oracle.com>
- With a recent spec file cleanup, names have changed: A "-community" part was dropped.
diff --git a/tests/Makefile.am b/tests/Makefile.am
deleted file mode 100644
index ca4a2a4e986..00000000000
--- a/tests/Makefile.am
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright (C) 2000-2006 MySQL AB
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; version 2
-# of the License.
-#
-# This library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
-
-## Process this file with automake to create Makefile.in
-
-
-if THREAD_SAFE_CLIENT
-LIBMYSQLCLIENT_LA = $(top_builddir)/libmysql_r/libmysqlclient_r.la
-else
-LIBMYSQLCLIENT_LA = $(top_builddir)/libmysql/libmysqlclient.la
-endif
-
-EXTRA_DIST = auto_increment.res auto_increment.tst \
- function.res function.tst lock_test.pl lock_test.res \
- export.pl big_record.pl \
- fork2_test.pl fork_big.pl \
- insert_and_repair.pl \
- grant.pl grant.res test_delayed_insert.pl \
- pmail.pl mail_to_db.pl table_types.pl \
- myisam-big-rows.tst \
- CMakeLists.txt
-
-bin_PROGRAMS = mysql_client_test
-noinst_PROGRAMS = insert_test select_test thread_test bug25714
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
- $(openssl_includes)
-LIBS = @CLIENT_LIBS@
-LDADD = @CLIENT_EXTRA_LDFLAGS@ \
- $(LIBMYSQLCLIENT_LA)
-
-mysql_client_test_LDADD= $(LDADD) $(CXXLDFLAGS)
-mysql_client_test_SOURCES= mysql_client_test.c\
- $(top_srcdir)/mysys/my_memmem.c
-
-insert_test_SOURCES= insert_test.c
-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 = -DMYSQL_CLIENT_NO_THREADS
-
-thread_test.o: thread_test.c
- $(COMPILE) -c $(INCLUDES) $<
diff --git a/tests/big_record.pl b/tests/big_record.pl
index cd80488581a..ceedb6f114a 100755
--- a/tests/big_record.pl
+++ b/tests/big_record.pl
@@ -1,5 +1,20 @@
#!/usr/bin/perl
+# Copyright (C) 2000, 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
+
# This is a test with stores big records in a blob.
# Note that for the default test the mysql server should have been
# started with at least 'mysqld --max_allowed_packet=30M' and you should have
diff --git a/tests/drop_test.pl b/tests/drop_test.pl
index 9dcadf45c2e..272c4029e0f 100755
--- a/tests/drop_test.pl
+++ b/tests/drop_test.pl
@@ -1,4 +1,20 @@
#!/usr/bin/perl -w
+
+# Copyright (C) 2000 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
#
# This is a test with uses processes to insert, select and drop tables.
#
diff --git a/tests/export.pl b/tests/export.pl
index 29f0d1af8ff..d543ede8697 100755
--- a/tests/export.pl
+++ b/tests/export.pl
@@ -1,5 +1,20 @@
#!/usr/bin/perl
+# Copyright (C) 2000, 2001 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
# This is a test with uses two processes to a database.
# The other inserts records in two tables, the other does a lot of joins
# on these.
diff --git a/tests/fork2_test.pl b/tests/fork2_test.pl
index 19fab5a67d6..64e3e060b09 100755
--- a/tests/fork2_test.pl
+++ b/tests/fork2_test.pl
@@ -1,5 +1,20 @@
#!/usr/bin/perl -w
+# Copyright (C) 2000, 2001 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
# This is a test with uses 5 processes to insert, update and select from
# two tables.
# One inserts records in the tables, one updates some record in it and
diff --git a/tests/fork_big.pl b/tests/fork_big.pl
index 5c4f11b00e2..a674f7f7164 100755
--- a/tests/fork_big.pl
+++ b/tests/fork_big.pl
@@ -1,4 +1,20 @@
#!/usr/bin/perl -w
+
+# Copyright (C) 2001 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
#
# This is a test with uses many processes to test a MySQL server.
#
diff --git a/tests/fork_big2.pl b/tests/fork_big2.pl
index f22aeaa6713..77b6f305ef5 100644
--- a/tests/fork_big2.pl
+++ b/tests/fork_big2.pl
@@ -1,4 +1,20 @@
#!/usr/bin/perl -w
+
+# Copyright (C) 2002, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
#
# This is a test with uses many processes to test a MySQL server.
#
diff --git a/tests/grant.pl b/tests/grant.pl
index 4f2bd1a61cb..368ce0b3254 100755
--- a/tests/grant.pl
+++ b/tests/grant.pl
@@ -1,4 +1,20 @@
#!/usr/bin/perl
+
+# Copyright (C) 2000, 2005 MySQL AB, 2009 Sun Microsystems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# 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
+
#
# Testing of grants.
# Note that this will delete all table and column grants !
diff --git a/tests/index_corrupt.pl b/tests/index_corrupt.pl
index 19bf54f5d11..fa4c8151277 100755
--- a/tests/index_corrupt.pl
+++ b/tests/index_corrupt.pl
@@ -1,4 +1,20 @@
#!/usr/bin/perl -w
+
+# Copyright (C) 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
#
# This is a test for a key cache bug (bug #10167)
# To expose the bug mysqld should be started with --key-buffer-size=64K
diff --git a/tests/insert_and_repair.pl b/tests/insert_and_repair.pl
index 1c7186bb651..00ab20f051b 100755
--- a/tests/insert_and_repair.pl
+++ b/tests/insert_and_repair.pl
@@ -1,4 +1,20 @@
#!/usr/bin/perl -w
+
+# Copyright (C) 2000, 2001 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
#
# This is a test of insert and repair/check.
#
diff --git a/tests/lock_test.pl b/tests/lock_test.pl
index 5daeeddad8e..a40bec681f6 100755
--- a/tests/lock_test.pl
+++ b/tests/lock_test.pl
@@ -1,5 +1,20 @@
#!/usr/bin/perl
+# Copyright (C) 2000 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
# This is a test with uses two processes to a database.
# The other inserts records in two tables, the other does a lot of joins
# on these.
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 042ca7b4d95..f3943814cb2 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003-2004 MySQL AB
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,6 +35,7 @@
#include <mysqld_error.h>
#include <my_handler.h>
#include <sql_common.h>
+#include <mysql/client_plugin.h>
#define VER "2.1"
#define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */
@@ -62,6 +63,7 @@ static unsigned int test_count= 0;
static unsigned int opt_count= 0;
static unsigned int iter_count= 0;
static my_bool have_innodb= FALSE;
+static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static const char *opt_basedir= "./";
static const char *opt_vardir= "mysql-test/var";
@@ -248,6 +250,11 @@ static MYSQL *mysql_client_init(MYSQL* con)
if (res && shared_memory_base_name)
mysql_options(res, MYSQL_SHARED_MEMORY_BASE_NAME, shared_memory_base_name);
#endif
+ if (opt_plugin_dir && *opt_plugin_dir)
+ mysql_options(res, MYSQL_PLUGIN_DIR, opt_plugin_dir);
+
+ if (opt_default_auth && *opt_default_auth)
+ mysql_options(res, MYSQL_DEFAULT_AUTH, opt_default_auth);
return res;
}
@@ -329,6 +336,11 @@ static MYSQL* client_connect(ulong flag, uint protocol, my_bool auto_reconnect)
/* enable local infile, in non-binary builds often disabled by default */
mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(mysql, MYSQL_OPT_PROTOCOL, &protocol);
+ if (opt_plugin_dir && *opt_plugin_dir)
+ mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
+
+ if (opt_default_auth && *opt_default_auth)
+ mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
if (!(mysql_real_connect(mysql, opt_host, opt_user,
opt_password, opt_db ? opt_db:"test", opt_port,
@@ -2108,6 +2120,255 @@ static void test_wl4435_2()
}
+#define WL4435_TEST(sql_type, sql_value, \
+ c_api_in_type, c_api_out_type, \
+ c_type, c_type_ext, \
+ printf_args, assert_condition) \
+\
+ do { \
+ int rc; \
+ MYSQL_STMT *ps; \
+ MYSQL_BIND psp; \
+ MYSQL_RES *rs_metadata; \
+ MYSQL_FIELD *fields; \
+ c_type pspv c_type_ext; \
+ my_bool psp_null; \
+ \
+ bzero(&pspv, sizeof (pspv)); \
+ \
+ rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS p1"); \
+ myquery(rc); \
+ \
+ rc= mysql_query(mysql, \
+ "CREATE PROCEDURE p1(OUT v " sql_type ") SET v = " sql_value ";"); \
+ myquery(rc); \
+ \
+ ps = mysql_simple_prepare(mysql, "CALL p1(?)"); \
+ check_stmt(ps); \
+ \
+ bzero(&psp, sizeof (psp)); \
+ psp.buffer_type= c_api_in_type; \
+ psp.is_null= &psp_null; \
+ psp.buffer= (char *) &pspv; \
+ psp.buffer_length= sizeof (psp); \
+ \
+ rc= mysql_stmt_bind_param(ps, &psp); \
+ check_execute(ps, rc); \
+ \
+ rc= mysql_stmt_execute(ps); \
+ check_execute(ps, rc); \
+ \
+ DIE_UNLESS(mysql->server_status & SERVER_PS_OUT_PARAMS); \
+ DIE_UNLESS(mysql_stmt_field_count(ps) == 1); \
+ \
+ rs_metadata= mysql_stmt_result_metadata(ps); \
+ fields= mysql_fetch_fields(rs_metadata); \
+ \
+ rc= mysql_stmt_bind_result(ps, &psp); \
+ check_execute(ps, rc); \
+ \
+ rc= mysql_stmt_fetch(ps); \
+ DIE_UNLESS(rc == 0); \
+ \
+ DIE_UNLESS(fields[0].type == c_api_out_type); \
+ printf printf_args; \
+ printf("; in type: %d; out type: %d\n", \
+ (int) c_api_in_type, (int) c_api_out_type); \
+ \
+ rc= mysql_stmt_fetch(ps); \
+ DIE_UNLESS(rc == MYSQL_NO_DATA); \
+ \
+ rc= mysql_stmt_next_result(ps); \
+ DIE_UNLESS(rc == 0); \
+ \
+ mysql_stmt_free_result(ps); \
+ mysql_stmt_close(ps); \
+ \
+ DIE_UNLESS(assert_condition); \
+ \
+ } while (0)
+
+static void test_wl4435_3()
+{
+ char tmp[255];
+
+ puts("");
+
+ // The following types are not supported:
+ // - ENUM
+ // - SET
+ //
+ // The following types are supported but can not be used for
+ // OUT-parameters:
+ // - MEDIUMINT;
+ // - BIT(..);
+ //
+ // The problem is that those types are not supported for IN-parameters,
+ // and OUT-parameters should be bound as IN-parameters before execution.
+ //
+ // The following types should not be used:
+ // - MYSQL_TYPE_YEAR (use MYSQL_TYPE_SHORT instead);
+ // - MYSQL_TYPE_TINY_BLOB, MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_LONG_BLOB
+ // (use MYSQL_TYPE_BLOB instead);
+
+ WL4435_TEST("TINYINT", "127",
+ MYSQL_TYPE_TINY, MYSQL_TYPE_TINY,
+ char, ,
+ (" - TINYINT / char / MYSQL_TYPE_TINY:\t\t\t %d", (int) pspv),
+ pspv == 127);
+
+ WL4435_TEST("SMALLINT", "32767",
+ MYSQL_TYPE_SHORT, MYSQL_TYPE_SHORT,
+ short, ,
+ (" - SMALLINT / short / MYSQL_TYPE_SHORT:\t\t %d", (int) pspv),
+ pspv == 32767);
+
+ WL4435_TEST("INT", "2147483647",
+ MYSQL_TYPE_LONG, MYSQL_TYPE_LONG,
+ int, ,
+ (" - INT / int / MYSQL_TYPE_LONG:\t\t\t %d", pspv),
+ pspv == 2147483647l);
+
+ WL4435_TEST("BIGINT", "9223372036854775807",
+ MYSQL_TYPE_LONGLONG, MYSQL_TYPE_LONGLONG,
+ long long, ,
+ (" - BIGINT / long long / MYSQL_TYPE_LONGLONG:\t\t %lld", pspv),
+ pspv == 9223372036854775807ll);
+
+ WL4435_TEST("TIMESTAMP", "'2007-11-18 15:01:02'",
+ MYSQL_TYPE_TIMESTAMP, MYSQL_TYPE_TIMESTAMP,
+ MYSQL_TIME, ,
+ (" - TIMESTAMP / MYSQL_TIME / MYSQL_TYPE_TIMESTAMP:\t "
+ "%.4d-%.2d-%.2d %.2d:%.2d:%.2d",
+ (int) pspv.year, (int) pspv.month, (int) pspv.day,
+ (int) pspv.hour, (int) pspv.minute, (int) pspv.second),
+ pspv.year == 2007 && pspv.month == 11 && pspv.day == 18 &&
+ pspv.hour == 15 && pspv.minute == 1 && pspv.second == 2);
+
+ WL4435_TEST("DATETIME", "'1234-11-12 12:34:59'",
+ MYSQL_TYPE_DATETIME, MYSQL_TYPE_DATETIME,
+ MYSQL_TIME, ,
+ (" - DATETIME / MYSQL_TIME / MYSQL_TYPE_DATETIME:\t "
+ "%.4d-%.2d-%.2d %.2d:%.2d:%.2d",
+ (int) pspv.year, (int) pspv.month, (int) pspv.day,
+ (int) pspv.hour, (int) pspv.minute, (int) pspv.second),
+ pspv.year == 1234 && pspv.month == 11 && pspv.day == 12 &&
+ pspv.hour == 12 && pspv.minute == 34 && pspv.second == 59);
+
+ WL4435_TEST("TIME", "'123:45:01'",
+ MYSQL_TYPE_TIME, MYSQL_TYPE_TIME,
+ MYSQL_TIME, ,
+ (" - TIME / MYSQL_TIME / MYSQL_TYPE_TIME:\t\t "
+ "%.3d:%.2d:%.2d",
+ (int) pspv.hour, (int) pspv.minute, (int) pspv.second),
+ pspv.hour == 123 && pspv.minute == 45 && pspv.second == 1);
+
+ WL4435_TEST("DATE", "'1234-11-12'",
+ MYSQL_TYPE_DATE, MYSQL_TYPE_DATE,
+ MYSQL_TIME, ,
+ (" - DATE / MYSQL_TIME / MYSQL_TYPE_DATE:\t\t "
+ "%.4d-%.2d-%.2d",
+ (int) pspv.year, (int) pspv.month, (int) pspv.day),
+ pspv.year == 1234 && pspv.month == 11 && pspv.day == 12);
+
+ WL4435_TEST("YEAR", "'2010'",
+ MYSQL_TYPE_SHORT, MYSQL_TYPE_YEAR,
+ short, ,
+ (" - YEAR / short / MYSQL_TYPE_SHORT:\t\t\t %.4d", (int) pspv),
+ pspv == 2010);
+
+ WL4435_TEST("FLOAT(7, 4)", "123.4567",
+ MYSQL_TYPE_FLOAT, MYSQL_TYPE_FLOAT,
+ float, ,
+ (" - FLOAT / float / MYSQL_TYPE_FLOAT:\t\t\t %g", (double) pspv),
+ pspv - 123.4567 < 0.0001);
+
+ WL4435_TEST("DOUBLE(8, 5)", "123.45678",
+ MYSQL_TYPE_DOUBLE, MYSQL_TYPE_DOUBLE,
+ double, ,
+ (" - DOUBLE / double / MYSQL_TYPE_DOUBLE:\t\t %g", (double) pspv),
+ pspv - 123.45678 < 0.00001);
+
+ WL4435_TEST("DECIMAL(9, 6)", "123.456789",
+ MYSQL_TYPE_NEWDECIMAL, MYSQL_TYPE_NEWDECIMAL,
+ char, [255],
+ (" - DECIMAL / char[] / MYSQL_TYPE_NEWDECIMAL:\t\t '%s'", (char *) pspv),
+ !strcmp(pspv, "123.456789"));
+
+ WL4435_TEST("CHAR(32)", "REPEAT('C', 16)",
+ MYSQL_TYPE_STRING, MYSQL_TYPE_STRING,
+ char, [255],
+ (" - CHAR(32) / char[] / MYSQL_TYPE_STRING:\t\t '%s'", (char *) pspv),
+ !strcmp(pspv, "CCCCCCCCCCCCCCCC"));
+
+ WL4435_TEST("VARCHAR(32)", "REPEAT('V', 16)",
+ MYSQL_TYPE_VAR_STRING, MYSQL_TYPE_VAR_STRING,
+ char, [255],
+ (" - VARCHAR(32) / char[] / MYSQL_TYPE_VAR_STRING:\t '%s'", (char *) pspv),
+ !strcmp(pspv, "VVVVVVVVVVVVVVVV"));
+
+ WL4435_TEST("TINYTEXT", "REPEAT('t', 16)",
+ MYSQL_TYPE_TINY_BLOB, MYSQL_TYPE_BLOB,
+ char, [255],
+ (" - TINYTEXT / char[] / MYSQL_TYPE_TINY_BLOB:\t\t '%s'", (char *) pspv),
+ !strcmp(pspv, "tttttttttttttttt"));
+
+ WL4435_TEST("TEXT", "REPEAT('t', 16)",
+ MYSQL_TYPE_BLOB, MYSQL_TYPE_BLOB,
+ char, [255],
+ (" - TEXT / char[] / MYSQL_TYPE_BLOB:\t\t\t '%s'", (char *) pspv),
+ !strcmp(pspv, "tttttttttttttttt"));
+
+ WL4435_TEST("MEDIUMTEXT", "REPEAT('t', 16)",
+ MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_BLOB,
+ char, [255],
+ (" - MEDIUMTEXT / char[] / MYSQL_TYPE_MEDIUM_BLOB:\t '%s'", (char *) pspv),
+ !strcmp(pspv, "tttttttttttttttt"));
+
+ WL4435_TEST("LONGTEXT", "REPEAT('t', 16)",
+ MYSQL_TYPE_LONG_BLOB, MYSQL_TYPE_BLOB,
+ char, [255],
+ (" - LONGTEXT / char[] / MYSQL_TYPE_LONG_BLOB:\t\t '%s'", (char *) pspv),
+ !strcmp(pspv, "tttttttttttttttt"));
+
+ WL4435_TEST("BINARY(32)", "REPEAT('\1', 16)",
+ MYSQL_TYPE_STRING, MYSQL_TYPE_STRING,
+ char, [255],
+ (" - BINARY(32) / char[] / MYSQL_TYPE_STRING:\t\t '%s'", (char *) pspv),
+ memset(tmp, 1, 16) && !memcmp(tmp, pspv, 16));
+
+ WL4435_TEST("VARBINARY(32)", "REPEAT('\1', 16)",
+ MYSQL_TYPE_VAR_STRING, MYSQL_TYPE_VAR_STRING,
+ char, [255],
+ (" - VARBINARY(32) / char[] / MYSQL_TYPE_VAR_STRING:\t '%s'", (char *) pspv),
+ memset(tmp, 1, 16) && !memcmp(tmp, pspv, 16));
+
+ WL4435_TEST("TINYBLOB", "REPEAT('\2', 16)",
+ MYSQL_TYPE_TINY_BLOB, MYSQL_TYPE_BLOB,
+ char, [255],
+ (" - TINYBLOB / char[] / MYSQL_TYPE_TINY_BLOB:\t\t '%s'", (char *) pspv),
+ memset(tmp, 2, 16) && !memcmp(tmp, pspv, 16));
+
+ WL4435_TEST("BLOB", "REPEAT('\2', 16)",
+ MYSQL_TYPE_BLOB, MYSQL_TYPE_BLOB,
+ char, [255],
+ (" - BLOB / char[] / MYSQL_TYPE_BLOB:\t\t\t '%s'", (char *) pspv),
+ memset(tmp, 2, 16) && !memcmp(tmp, pspv, 16));
+
+ WL4435_TEST("MEDIUMBLOB", "REPEAT('\2', 16)",
+ MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_BLOB,
+ char, [255],
+ (" - MEDIUMBLOB / char[] / MYSQL_TYPE_MEDIUM_BLOB:\t '%s'", (char *) pspv),
+ memset(tmp, 2, 16) && !memcmp(tmp, pspv, 16));
+
+ WL4435_TEST("LONGBLOB", "REPEAT('\2', 16)",
+ MYSQL_TYPE_LONG_BLOB, MYSQL_TYPE_BLOB,
+ char, [255],
+ (" - LONGBLOB / char[] / MYSQL_TYPE_LONG_BLOB:\t\t '%s'", (char *) pspv),
+ memset(tmp, 2, 16) && !memcmp(tmp, pspv, 16));
+}
+
+
/* Test simple prepare field results */
static void test_prepare_field_result()
@@ -15473,8 +15734,11 @@ static void test_bug13488()
check_execute(stmt1, rc);
if (!opt_silent)
- printf("data is: %s", (f1 == 1 && f2 == 1 && f3 == 2)?"OK":
- "wrong");
+ {
+ printf("data: f1: %d; f2: %d; f3: %d\n", f1, f2, f3);
+ printf("data is: %s\n",
+ (f1 == 1 && f2 == 1 && f3 == 2) ? "OK" : "wrong");
+ }
DIE_UNLESS(f1 == 1 && f2 == 1 && f3 == 2);
rc= mysql_query(mysql, "drop table t1, t2");
myquery(rc);
@@ -19083,6 +19347,72 @@ static void test_bug47485()
/*
+ Bug#58036 client utf32, utf16, ucs2 should be disallowed, they crash server
+*/
+static void test_bug58036()
+{
+ MYSQL *conn;
+ DBUG_ENTER("test_bug47485");
+ myheader("test_bug58036");
+
+ /* Part1: try to connect with ucs2 client character set */
+ conn= mysql_client_init(NULL);
+ mysql_options(conn, MYSQL_SET_CHARSET_NAME, "ucs2");
+ if (mysql_real_connect(conn, opt_host, opt_user,
+ opt_password, opt_db ? opt_db : "test",
+ opt_port, opt_unix_socket, 0))
+ {
+ if (!opt_silent)
+ printf("mysql_real_connect() succeeded (failure expected)\n");
+ mysql_close(conn);
+ DIE("");
+ }
+
+ if (!opt_silent)
+ printf("Got mysql_real_connect() error (expected): %s (%d)\n",
+ mysql_error(conn), mysql_errno(conn));
+ DIE_UNLESS(mysql_errno(conn) == ER_WRONG_VALUE_FOR_VAR);
+ mysql_close(conn);
+
+
+ /*
+ Part2:
+ - connect with latin1
+ - then change client character set to ucs2
+ - then try mysql_change_user()
+ */
+ conn= mysql_client_init(NULL);
+ mysql_options(conn, MYSQL_SET_CHARSET_NAME, "latin1");
+ if (!mysql_real_connect(conn, opt_host, opt_user,
+ opt_password, opt_db ? opt_db : "test",
+ opt_port, opt_unix_socket, 0))
+ {
+ if (!opt_silent)
+ printf("mysql_real_connect() failed: %s (%d)\n",
+ mysql_error(conn), mysql_errno(conn));
+ mysql_close(conn);
+ DIE("");
+ }
+
+ mysql_options(conn, MYSQL_SET_CHARSET_NAME, "ucs2");
+ if (!mysql_change_user(conn, opt_user, opt_password, NULL))
+ {
+ if (!opt_silent)
+ printf("mysql_change_user() succedded, error expected!");
+ mysql_close(conn);
+ DIE("");
+ }
+
+ if (!opt_silent)
+ printf("Got mysql_change_user() error (expected): %s (%d)\n",
+ mysql_error(conn), mysql_errno(conn));
+ mysql_close(conn);
+
+ DBUG_VOID_RETURN;
+}
+
+
+/*
Bug#49972: Crash in prepared statements.
The following case lead to a server crash:
@@ -19104,7 +19434,7 @@ static void test_bug49972()
my_bool is_null;
DBUG_ENTER("test_bug49972");
- myheader("test_49972");
+ myheader("test_bug49972");
rc= mysql_query(mysql, "DROP FUNCTION IF EXISTS f1");
myquery(rc);
@@ -19191,6 +19521,192 @@ static void test_bug49972()
DBUG_VOID_RETURN;
}
+
+/*
+ Bug #56976: Severe Denial Of Service in prepared statements
+*/
+static void test_bug56976()
+{
+ MYSQL_STMT *stmt;
+ MYSQL_BIND bind[1];
+ int rc;
+ const char* query = "SELECT LENGTH(?)";
+ char *long_buffer;
+ unsigned long i, packet_len = 256 * 1024L;
+ unsigned long dos_len = 2 * 1024 * 1024L;
+
+ DBUG_ENTER("test_bug56976");
+ myheader("test_bug56976");
+
+ stmt= mysql_stmt_init(mysql);
+ check_stmt(stmt);
+
+ rc= mysql_stmt_prepare(stmt, query, strlen(query));
+ check_execute(stmt, rc);
+
+ memset(bind, 0, sizeof(bind));
+ bind[0].buffer_type = MYSQL_TYPE_TINY_BLOB;
+
+ rc= mysql_stmt_bind_param(stmt, bind);
+ check_execute(stmt, rc);
+
+ long_buffer= (char*) my_malloc(packet_len, MYF(0));
+ DIE_UNLESS(long_buffer);
+
+ memset(long_buffer, 'a', packet_len);
+
+ for (i= 0; i < dos_len / packet_len; i++)
+ {
+ rc= mysql_stmt_send_long_data(stmt, 0, long_buffer, packet_len);
+ check_execute(stmt, rc);
+ }
+
+ my_free(long_buffer);
+ rc= mysql_stmt_execute(stmt);
+
+ DIE_UNLESS(rc && mysql_stmt_errno(stmt) == ER_UNKNOWN_ERROR);
+
+ mysql_stmt_close(stmt);
+
+ DBUG_VOID_RETURN;
+}
+
+
+/**
+ Bug#57058 SERVER_QUERY_WAS_SLOW not wired up.
+*/
+
+static void test_bug57058()
+{
+ MYSQL_RES *res;
+ int rc;
+
+ DBUG_ENTER("test_bug57058");
+ myheader("test_bug57058");
+
+ rc= mysql_query(mysql, "set @@session.long_query_time=0.1");
+ myquery(rc);
+
+ DIE_UNLESS(!(mysql->server_status & SERVER_QUERY_WAS_SLOW));
+
+ rc= mysql_query(mysql, "select sleep(1)");
+ myquery(rc);
+
+ /*
+ Important: the flag is sent in the last EOF packet of
+ the query, the one which ends the result. Read the
+ result to see the "slow" status.
+ */
+ res= mysql_store_result(mysql);
+
+ DIE_UNLESS(mysql->server_status & SERVER_QUERY_WAS_SLOW);
+
+ mysql_free_result(res);
+
+ rc= mysql_query(mysql, "set @@session.long_query_time=default");
+ myquery(rc);
+
+ DBUG_VOID_RETURN;
+}
+
+
+/**
+ Bug#11766854: 60075: MYSQL_LOAD_CLIENT_PLUGIN DOESN'T CLEAR ERROR
+*/
+
+static void test_bug11766854()
+{
+ struct st_mysql_client_plugin *plugin;
+
+ DBUG_ENTER("test_bug11766854");
+ myheader("test_bug11766854");
+
+ plugin= mysql_load_plugin(mysql, "foo", -1, 0);
+ DIE_UNLESS(plugin == 0);
+
+ plugin= mysql_load_plugin(mysql, "qa_auth_client", -1, 0);
+ DIE_UNLESS(plugin != 0);
+ DIE_IF(mysql_errno(mysql));
+
+ DBUG_VOID_RETURN;
+}
+
+/**
+ Bug#12337762: 60075: MYSQL_LIST_FIELDS() RETURNS WRONG CHARSET FOR
+ CHAR/VARCHAR/TEXT COLUMNS IN VIEWS
+*/
+static void test_bug12337762()
+{
+ int rc,i=0;
+ MYSQL_RES *result;
+ MYSQL_FIELD *field;
+ unsigned int tab_charsetnr[3]= {0};
+
+ DBUG_ENTER("test_bug12337762");
+ myheader("test_bug12337762");
+
+ /*
+ Creating table with specific charset.
+ */
+ rc= mysql_query(mysql, "drop table if exists charset_tab");
+ rc= mysql_query(mysql, "create table charset_tab("\
+ "txt1 varchar(32) character set Latin1,"\
+ "txt2 varchar(32) character set Latin1 collate latin1_bin,"\
+ "txt3 varchar(32) character set utf8 collate utf8_bin"\
+ ")");
+
+ DIE_UNLESS(rc == 0);
+ DIE_IF(mysql_errno(mysql));
+
+ /*
+ Creating view from table created earlier.
+ */
+ rc= mysql_query(mysql, "drop view if exists charset_view");
+ rc= mysql_query(mysql, "create view charset_view as "\
+ "select * from charset_tab;");
+ DIE_UNLESS(rc == 0);
+ DIE_IF(mysql_errno(mysql));
+
+ /*
+ Checking field information for table.
+ */
+ result= mysql_list_fields(mysql, "charset_tab", NULL);
+ DIE_IF(mysql_errno(mysql));
+ i=0;
+ while((field= mysql_fetch_field(result)))
+ {
+ printf("field name %s\n", field->name);
+ printf("field table %s\n", field->table);
+ printf("field type %d\n", field->type);
+ printf("field charset %d\n", field->charsetnr);
+ tab_charsetnr[i++]= field->charsetnr;
+ printf("\n");
+ }
+ mysql_free_result(result);
+
+ /*
+ Checking field information for view.
+ */
+ result= mysql_list_fields(mysql, "charset_view", NULL);
+ DIE_IF(mysql_errno(mysql));
+ i=0;
+ while((field= mysql_fetch_field(result)))
+ {
+ printf("field name %s\n", field->name);
+ printf("field table %s\n", field->table);
+ printf("field type %d\n", field->type);
+ printf("field charset %d\n", field->charsetnr);
+ printf("\n");
+ /*
+ charset value for field must be same for both, view and table.
+ */
+ DIE_UNLESS(field->charsetnr == tab_charsetnr[i++]);
+ }
+ mysql_free_result(result);
+
+ DBUG_VOID_RETURN;
+}
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -19248,6 +19764,12 @@ static struct my_option client_test_long_options[] =
{"getopt-ll-test", 'g', "Option for testing bug in getopt library",
&opt_getopt_ll_test, &opt_getopt_ll_test, 0,
GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0},
+ {"plugin_dir", 0, "Directory for client-side plugins.",
+ &opt_plugin_dir, &opt_plugin_dir, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"default_auth", 0, "Default authentication client-side plugin to use.",
+ &opt_default_auth, &opt_default_auth, 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}
};
@@ -19511,6 +20033,7 @@ static struct my_tests_st my_tests[]= {
{ "test_wl4284_1", test_wl4284_1 },
{ "test_wl4435", test_wl4435 },
{ "test_wl4435_2", test_wl4435_2 },
+ { "test_wl4435_3", test_wl4435_3 },
{ "test_bug38486", test_bug38486 },
{ "test_bug33831", test_bug33831 },
{ "test_bug40365", test_bug40365 },
@@ -19522,6 +20045,11 @@ static struct my_tests_st my_tests[]= {
{ "test_bug42373", test_bug42373 },
{ "test_bug54041", test_bug54041 },
{ "test_bug47485", test_bug47485 },
+ { "test_bug58036", test_bug58036 },
+ { "test_bug57058", test_bug57058 },
+ { "test_bug56976", test_bug56976 },
+ { "test_bug11766854", test_bug11766854 },
+ { "test_bug12337762", test_bug12337762 },
{ 0, 0 }
};
@@ -19662,29 +20190,29 @@ int main(int argc, char **argv)
if (!argc)
{
for (fptr= my_tests; fptr->name; fptr++)
- (*fptr->function)();
+ (*fptr->function)();
}
else
{
for ( ; *argv ; argv++)
{
- for (fptr= my_tests; fptr->name; fptr++)
- {
- if (!strcmp(fptr->name, *argv))
- {
- (*fptr->function)();
- break;
- }
- }
- if (!fptr->name)
- {
- fprintf(stderr, "\n\nGiven test not found: '%s'\n", *argv);
- fprintf(stderr, "See legal test names with %s -T\n\nAborting!\n",
- my_progname);
- client_disconnect(mysql, 1);
- free_defaults(defaults_argv);
- exit(1);
- }
+ for (fptr= my_tests; fptr->name; fptr++)
+ {
+ if (!strcmp(fptr->name, *argv))
+ {
+ (*fptr->function)();
+ break;
+ }
+ }
+ if (!fptr->name)
+ {
+ fprintf(stderr, "\n\nGiven test not found: '%s'\n", *argv);
+ fprintf(stderr, "See legal test names with %s -T\n\nAborting!\n",
+ my_progname);
+ client_disconnect(mysql, 1);
+ free_defaults(defaults_argv);
+ exit(1);
+ }
}
}
diff --git a/tests/pmail.pl b/tests/pmail.pl
index 02d5d60ac0f..38905832069 100755
--- a/tests/pmail.pl
+++ b/tests/pmail.pl
@@ -1,4 +1,20 @@
#!/usr/bin/perl -w
+
+# Copyright (C) 2000, 2005 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
#
# Prints mails to standard output
#
diff --git a/tests/rename_test.pl b/tests/rename_test.pl
index edf3216a62f..23fc33c9095 100755
--- a/tests/rename_test.pl
+++ b/tests/rename_test.pl
@@ -1,4 +1,20 @@
#!/usr/bin/perl -w
+
+# Copyright (C) 2000, 2001 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
#
# This is a test with uses processes to insert, select and drop tables.
#
diff --git a/tests/table_types.pl b/tests/table_types.pl
index 4dbcdcb975c..23d26215abe 100755
--- a/tests/table_types.pl
+++ b/tests/table_types.pl
@@ -1,5 +1,19 @@
#!/usr/bin/perl
-#
+
+# Copyright (C) 2000, 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
use DBI;
use Benchmark;
diff --git a/tests/test_delayed_insert.pl b/tests/test_delayed_insert.pl
index c7a8f0ca4b7..5046c4fb580 100755
--- a/tests/test_delayed_insert.pl
+++ b/tests/test_delayed_insert.pl
@@ -1,5 +1,20 @@
#!/usr/bin/perl -w
+# Copyright (C) 2000, 2001 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
# This is a test for INSERT DELAYED
#
diff --git a/tests/thread_test.c b/tests/thread_test.c
index c243a3a7321..4edfe59772c 100644
--- a/tests/thread_test.c
+++ b/tests/thread_test.c
@@ -15,15 +15,6 @@
#include <my_global.h>
-#ifndef THREAD
-
-int main(int argc __attribute__((unused)), char **argv __attribute__((unused)))
-{
- printf("This test must be compiled with multithread support to work\n");
- exit(1);
-}
-#else
-
#include <my_sys.h>
#include <my_pthread.h>
#include "mysql.h"
@@ -254,4 +245,3 @@ int main(int argc, char **argv)
return 0; /* Keep some compilers happy */
}
-#endif /* THREAD */
diff --git a/tests/truncate.pl b/tests/truncate.pl
index 57b50cf96b6..85e826fd4cd 100755
--- a/tests/truncate.pl
+++ b/tests/truncate.pl
@@ -1,4 +1,20 @@
#!/usr/bin/perl -w
+
+# Copyright (C) 2002 MySQL AB
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
#
# This is a test with uses many processes to test a MySQL server.
#
diff --git a/unittest/Makefile.am b/unittest/Makefile.am
deleted file mode 100644
index 01d27eb8cd2..00000000000
--- a/unittest/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-SUBDIRS = mytap . mysys examples strings
-
-EXTRA_DIST = unit.pl
-CLEANFILES = unit
-
-unittests = mytap mysys strings @mysql_se_unittest_dirs@ @mysql_pg_unittest_dirs@ ../dbug
-
-test:
- perl unit.pl run $(unittests)
-
-test-verbose:
- HARNESS_VERBOSE=1 perl unit.pl run $(unittests)
diff --git a/unittest/examples/Makefile.am b/unittest/examples/Makefile.am
deleted file mode 100644
index 3e64c7ceddc..00000000000
--- a/unittest/examples/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (C) 2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-AM_CPPFLAGS = -I$(srcdir) -I$(top_builddir)/include \
- -I$(top_srcdir)/unittest/mytap -I$(top_srcdir)/include
-
-AM_LDFLAGS = -L$(top_builddir)/unittest/mytap
-
-LDADD = -lmytap
-
-# We omit core-t here, since it will always fail.
-noinst_PROGRAMS = simple-t skip-t todo-t skip_all-t no_plan-t
diff --git a/unittest/examples/skip-t.c b/unittest/examples/skip-t.c
index 092353fcc48..c8c910b31ff 100644
--- a/unittest/examples/skip-t.c
+++ b/unittest/examples/skip-t.c
@@ -18,11 +18,11 @@
int main() {
plan(4);
- ok(1, NULL);
- ok(1, NULL);
+ ok1(1);
+ ok1(1);
SKIP_BLOCK_IF(1, 2, "Example of skipping a few test points in a test") {
- ok(1, NULL);
- ok(1, NULL);
+ ok1(1);
+ ok1(1);
}
return exit_status();
}
diff --git a/unittest/examples/skip_all-t.c b/unittest/examples/skip_all-t.c
index 11c1ef13276..3751642293b 100644
--- a/unittest/examples/skip_all-t.c
+++ b/unittest/examples/skip_all-t.c
@@ -31,9 +31,9 @@ int main() {
if (!has_feature())
skip_all("Example of skipping an entire test");
plan(4);
- ok(1, NULL);
- ok(1, NULL);
- ok(1, NULL);
- ok(1, NULL);
+ ok1(1);
+ ok1(1);
+ ok1(1);
+ ok1(1);
return exit_status();
}
diff --git a/unittest/examples/todo-t.c b/unittest/examples/todo-t.c
index 027d6d6b65e..67bea51965c 100644
--- a/unittest/examples/todo-t.c
+++ b/unittest/examples/todo-t.c
@@ -21,15 +21,15 @@
int main()
{
plan(4);
- ok(1, NULL);
- ok(1, NULL);
+ ok1(1);
+ ok1(1);
/*
Tests in the todo region is expected to fail. If they don't,
something is strange.
*/
todo_start("Need to fix these");
- ok(0, NULL);
- ok(0, NULL);
+ ok1(0);
+ ok1(0);
todo_end();
return exit_status();
}
diff --git a/unittest/mysys/CMakeLists.txt b/unittest/mysys/CMakeLists.txt
index f23a5addba0..7bf046162c5 100644
--- a/unittest/mysys/CMakeLists.txt
+++ b/unittest/mysys/CMakeLists.txt
@@ -22,7 +22,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
MACRO (MY_ADD_TEST name)
ADD_EXECUTABLE(${name}-t ${name}-t.c)
- TARGET_LINK_LIBRARIES(${name}-t mytap mysys)
+ TARGET_LINK_LIBRARIES(${name}-t mytap mysys strings)
ADD_TEST(${name} ${name}-t)
ENDMACRO()
diff --git a/unittest/mysys/Makefile.am b/unittest/mysys/Makefile.am
deleted file mode 100644
index ab7f16f3713..00000000000
--- a/unittest/mysys/Makefile.am
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2009 Sun Microsystems, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-INCLUDES = @ZLIB_INCLUDES@ -I$(top_builddir)/include \
- -I$(top_srcdir)/include -I$(top_srcdir)/unittest/mytap
-
-noinst_HEADERS = thr_template.c
-
-noinst_HEADERS = thr_template.c
-
-LDADD = $(top_builddir)/unittest/mytap/libmytap.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a
-
-noinst_PROGRAMS = bitmap-t base64-t lf-t my_rdtsc-t my_vsnprintf-t my_malloc-t
-
-if NEED_THREAD
-# my_atomic-t is used to check thread functions, so it is safe to
-# ignore the file in non-threaded builds.
-# In fact, it will not compile without thread support.
-noinst_PROGRAMS += my_atomic-t waiting_threads-t
-endif
-
-EXTRA_DIST = CMakeLists.txt
diff --git a/unittest/mysys/bitmap-t.c b/unittest/mysys/bitmap-t.c
index 0bd21b63430..a9ea7927db3 100644
--- a/unittest/mysys/bitmap-t.c
+++ b/unittest/mysys/bitmap-t.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@@ -24,6 +24,8 @@
#include <tap.h>
#include <m_string.h>
+#define MAX_TESTED_BITMAP_SIZE 1024
+
uint get_rand_bit(uint bitsize)
{
return (rand() % bitsize);
@@ -75,12 +77,6 @@ error2:
return TRUE;
}
-my_bool test_operators(MY_BITMAP *map __attribute__((unused)),
- uint bitsize __attribute__((unused)))
-{
- return FALSE;
-}
-
my_bool test_get_all_bits(MY_BITMAP *map, uint bitsize)
{
uint i;
@@ -129,8 +125,8 @@ my_bool test_compare_operators(MY_BITMAP *map, uint bitsize)
uint no_loops= bitsize > 128 ? 128 : bitsize;
MY_BITMAP map2_obj, map3_obj;
MY_BITMAP *map2= &map2_obj, *map3= &map3_obj;
- uint32 map2buf[1024];
- uint32 map3buf[1024];
+ uint32 map2buf[MAX_TESTED_BITMAP_SIZE];
+ uint32 map3buf[MAX_TESTED_BITMAP_SIZE];
bitmap_init(&map2_obj, map2buf, bitsize, FALSE);
bitmap_init(&map3_obj, map3buf, bitsize, FALSE);
bitmap_clear_all(map2);
@@ -257,8 +253,21 @@ error2:
my_bool test_get_first_bit(MY_BITMAP *map, uint bitsize)
{
- uint i, test_bit;
+ uint i, test_bit= 0;
uint no_loops= bitsize > 128 ? 128 : bitsize;
+
+ bitmap_set_all(map);
+ for (i=0; i < bitsize; i++)
+ bitmap_clear_bit(map, i);
+ if (bitmap_get_first_set(map) != MY_BIT_NONE)
+ goto error1;
+ bitmap_clear_all(map);
+ for (i=0; i < bitsize; i++)
+ bitmap_set_bit(map, i);
+ if (bitmap_get_first(map) != MY_BIT_NONE)
+ goto error2;
+ bitmap_clear_all(map);
+
for (i=0; i < no_loops; i++)
{
test_bit=get_rand_bit(bitsize);
@@ -321,6 +330,24 @@ my_bool test_prefix(MY_BITMAP *map, uint bitsize)
goto error3;
bitmap_clear_all(map);
}
+ for (i=0; i < bitsize; i++)
+ {
+ if (bitmap_is_prefix(map, i + 1))
+ goto error4;
+ bitmap_set_bit(map, i);
+ if (!bitmap_is_prefix(map, i + 1))
+ goto error5;
+ test_bit=get_rand_bit(bitsize);
+ bitmap_set_bit(map, test_bit);
+ if (test_bit <= i && !bitmap_is_prefix(map, i + 1))
+ goto error5;
+ else if (test_bit > i)
+ {
+ if (bitmap_is_prefix(map, i + 1))
+ goto error4;
+ bitmap_clear_bit(map, test_bit);
+ }
+ }
return FALSE;
error1:
diag("prefix1 error bitsize = %u, prefix_size = %u", bitsize,test_bit);
@@ -331,13 +358,127 @@ error2:
error3:
diag("prefix3 error bitsize = %u, prefix_size = %u", bitsize,test_bit);
return TRUE;
+error4:
+ diag("prefix4 error bitsize = %u, i = %u", bitsize,i);
+ return TRUE;
+error5:
+ diag("prefix5 error bitsize = %u, i = %u", bitsize,i);
+ return TRUE;
}
+my_bool test_compare(MY_BITMAP *map, uint bitsize)
+{
+ MY_BITMAP map2;
+ uint32 map2buf[MAX_TESTED_BITMAP_SIZE];
+ uint i, test_bit;
+ uint no_loops= bitsize > 128 ? 128 : bitsize;
+ if (bitmap_init(&map2, map2buf, bitsize, FALSE))
+ {
+ diag("init error for bitsize %d", bitsize);
+ return TRUE;
+ }
+ /* Test all 4 possible combinations of set/unset bits. */
+ for (i=0; i < no_loops; i++)
+ {
+ test_bit=get_rand_bit(bitsize);
+ bitmap_clear_bit(map, test_bit);
+ bitmap_clear_bit(&map2, test_bit);
+ if (!bitmap_is_subset(map, &map2))
+ goto error_is_subset;
+ bitmap_set_bit(map, test_bit);
+ if (bitmap_is_subset(map, &map2))
+ goto error_is_subset;
+ bitmap_set_bit(&map2, test_bit);
+ if (!bitmap_is_subset(map, &map2))
+ goto error_is_subset;
+ bitmap_clear_bit(map, test_bit);
+ if (!bitmap_is_subset(map, &map2))
+ goto error_is_subset;
+ /* Note that test_bit is not cleared i map2. */
+ }
+ bitmap_clear_all(map);
+ bitmap_clear_all(&map2);
+ /* Test all 4 possible combinations of set/unset bits. */
+ for (i=0; i < no_loops; i++)
+ {
+ test_bit=get_rand_bit(bitsize);
+ if (bitmap_is_overlapping(map, &map2))
+ goto error_is_overlapping;
+ bitmap_set_bit(map, test_bit);
+ if (bitmap_is_overlapping(map, &map2))
+ goto error_is_overlapping;
+ bitmap_set_bit(&map2, test_bit);
+ if (!bitmap_is_overlapping(map, &map2))
+ goto error_is_overlapping;
+ bitmap_clear_bit(map, test_bit);
+ if (bitmap_is_overlapping(map, &map2))
+ goto error_is_overlapping;
+ bitmap_clear_bit(&map2, test_bit);
+ /* Note that test_bit is not cleared i map2. */
+ }
+ return FALSE;
+error_is_subset:
+ diag("is_subset error bitsize = %u", bitsize);
+ return TRUE;
+error_is_overlapping:
+ diag("is_overlapping error bitsize = %u", bitsize);
+ return TRUE;
+}
+
+my_bool test_intersect(MY_BITMAP *map, uint bitsize)
+{
+ uint bitsize2 = 1 + get_rand_bit(MAX_TESTED_BITMAP_SIZE - 1);
+ MY_BITMAP map2;
+ uint32 map2buf[MAX_TESTED_BITMAP_SIZE];
+ uint i, test_bit1, test_bit2, test_bit3;
+ if (bitmap_init(&map2, map2buf, bitsize2, FALSE))
+ {
+ diag("init error for bitsize %d", bitsize2);
+ return TRUE;
+ }
+ test_bit1= get_rand_bit(bitsize);
+ test_bit2= get_rand_bit(bitsize);
+ bitmap_set_bit(map, test_bit1);
+ bitmap_set_bit(map, test_bit2);
+ test_bit3= get_rand_bit(bitsize2);
+ bitmap_set_bit(&map2, test_bit3);
+ if (test_bit2 < bitsize2)
+ bitmap_set_bit(&map2, test_bit2);
+
+ bitmap_intersect(map, &map2);
+ if (test_bit2 < bitsize2)
+ {
+ if (!bitmap_is_set(map, test_bit2))
+ goto error;
+ bitmap_clear_bit(map, test_bit2);
+ }
+ if (test_bit1 == test_bit3)
+ {
+ if (!bitmap_is_set(map, test_bit1))
+ goto error;
+ bitmap_clear_bit(map, test_bit1);
+ }
+ if (!bitmap_is_clear_all(map))
+ goto error;
+
+ bitmap_set_all(map);
+ bitmap_set_all(&map2);
+ for (i=0; i < bitsize2; i++)
+ bitmap_clear_bit(&map2, i);
+ bitmap_intersect(map, &map2);
+ if (!bitmap_is_clear_all(map))
+ goto error;
+ return FALSE;
+error:
+ diag("intersect error bitsize = %u, bit1 = %u, bit2 = %u, bit3 = %u",
+ bitsize, test_bit1, test_bit2, test_bit3);
+ return TRUE;
+}
my_bool do_test(uint bitsize)
{
MY_BITMAP map;
- uint32 buf[1024];
+ uint32 buf[MAX_TESTED_BITMAP_SIZE];
if (bitmap_init(&map, buf, bitsize, FALSE))
{
diag("init error for bitsize %d", bitsize);
@@ -349,9 +490,6 @@ my_bool do_test(uint bitsize)
if (test_flip_bit(&map,bitsize))
goto error;
bitmap_clear_all(&map);
- if (test_operators(&map,bitsize))
- goto error;
- bitmap_clear_all(&map);
if (test_get_all_bits(&map, bitsize))
goto error;
bitmap_clear_all(&map);
@@ -366,8 +504,15 @@ my_bool do_test(uint bitsize)
bitmap_clear_all(&map);
if (test_get_next_bit(&map,bitsize))
goto error;
+ bitmap_clear_all(&map);
if (test_prefix(&map,bitsize))
goto error;
+ bitmap_clear_all(&map);
+ if (test_compare(&map,bitsize))
+ goto error;
+ bitmap_clear_all(&map);
+ if (test_intersect(&map,bitsize))
+ goto error;
return FALSE;
error:
return TRUE;
@@ -377,7 +522,7 @@ int main()
{
int i;
int const min_size = 1;
- int const max_size = 1024;
+ int const max_size = MAX_TESTED_BITMAP_SIZE;
MY_INIT("bitmap-t");
plan(max_size - min_size);
diff --git a/unittest/mysys/lf-t.c b/unittest/mysys/lf-t.c
index 61b7ae08cf5..c04ef358abe 100644
--- a/unittest/mysys/lf-t.c
+++ b/unittest/mysys/lf-t.c
@@ -27,6 +27,8 @@ int32 inserts= 0, N;
LF_ALLOCATOR lf_allocator;
LF_HASH lf_hash;
+int with_my_thread_init=0;
+
/*
pin allocator - alloc and release an element in a loop
*/
@@ -36,7 +38,8 @@ pthread_handler_t test_lf_pinbox(void *arg)
int32 x= 0;
LF_PINS *pins;
- my_thread_init();
+ if (with_my_thread_init)
+ my_thread_init();
pins= lf_pinbox_get_pins(&lf_allocator.pinbox);
@@ -49,7 +52,10 @@ pthread_handler_t test_lf_pinbox(void *arg)
pthread_mutex_lock(&mutex);
if (!--running_threads) pthread_cond_signal(&cond);
pthread_mutex_unlock(&mutex);
- my_thread_end();
+
+ if (with_my_thread_init)
+ my_thread_end();
+
return 0;
}
@@ -68,7 +74,8 @@ pthread_handler_t test_lf_alloc(void *arg)
int32 x,y= 0;
LF_PINS *pins;
- my_thread_init();
+ if (with_my_thread_init)
+ my_thread_init();
pins= lf_alloc_get_pins(&lf_allocator);
@@ -101,7 +108,9 @@ pthread_handler_t test_lf_alloc(void *arg)
}
if (!--running_threads) pthread_cond_signal(&cond);
pthread_mutex_unlock(&mutex);
- my_thread_end();
+
+ if (with_my_thread_init)
+ my_thread_end();
return 0;
}
@@ -112,7 +121,8 @@ pthread_handler_t test_lf_hash(void *arg)
int32 x,y,z,sum= 0, ins= 0;
LF_PINS *pins;
- my_thread_init();
+ if (with_my_thread_init)
+ my_thread_init();
pins= lf_hash_get_pins(&lf_hash);
@@ -152,14 +162,15 @@ pthread_handler_t test_lf_hash(void *arg)
}
if (!--running_threads) pthread_cond_signal(&cond);
pthread_mutex_unlock(&mutex);
- my_thread_end();
+ if (with_my_thread_init)
+ my_thread_end();
return 0;
}
void do_tests()
{
- plan(4);
+ plan(7);
lf_alloc_init(&lf_allocator, sizeof(TLA), offsetof(TLA, not_used));
lf_hash_init(&lf_hash, sizeof(int), LF_HASH_UNIQUE, 0, sizeof(int), 0,
@@ -168,9 +179,15 @@ void do_tests()
bad= my_atomic_initialize();
ok(!bad, "my_atomic_initialize() returned %d", bad);
- test_concurrently("lf_pinbox", test_lf_pinbox, N= THREADS, CYCLES);
- test_concurrently("lf_alloc", test_lf_alloc, N= THREADS, CYCLES);
- test_concurrently("lf_hash", test_lf_hash, N= THREADS, CYCLES/10);
+ with_my_thread_init= 1;
+ test_concurrently("lf_pinbox (with my_thread_init)", test_lf_pinbox, N= THREADS, CYCLES);
+ test_concurrently("lf_alloc (with my_thread_init)", test_lf_alloc, N= THREADS, CYCLES);
+ test_concurrently("lf_hash (with my_thread_init)", test_lf_hash, N= THREADS, CYCLES/10);
+
+ with_my_thread_init= 0;
+ test_concurrently("lf_pinbox (without my_thread_init)", test_lf_pinbox, N= THREADS, CYCLES);
+ test_concurrently("lf_alloc (without my_thread_init)", test_lf_alloc, N= THREADS, CYCLES);
+ test_concurrently("lf_hash (without my_thread_init)", test_lf_hash, N= THREADS, CYCLES/10);
lf_hash_destroy(&lf_hash);
lf_alloc_destroy(&lf_allocator);
diff --git a/unittest/mysys/my_vsnprintf-t.c b/unittest/mysys/my_vsnprintf-t.c
index e7f37774f85..7f93f5bb195 100644
--- a/unittest/mysys/my_vsnprintf-t.c
+++ b/unittest/mysys/my_vsnprintf-t.c
@@ -110,8 +110,11 @@ int main(void)
test1("Positional arguments octal: <7777>",
"Positional arguments octal: <%1$o>", 07777);
+ /* Can't use int arguments, as they may be different size from pointers */
+
test1("Padding and %p <0x12> <0x034> <0x0000ab> < 0xcd>",
- "Padding and %%p <%04p> <%05p> <%08p> <%8p>", 0x12, 0x34, 0xab, 0xcd);
+ "Padding and %%p <%04p> <%05p> <%08p> <%8p>",
+ (void*) 0x12, (void*) 0x34, (void*) 0xab, (void*) 0xcd);
test1("F with a width (ignored) and precision: <12.34568>",
"F with a width (ignored) and precision: <%10.5f>", 12.3456789);
diff --git a/unittest/mytap/Makefile.am b/unittest/mytap/Makefile.am
deleted file mode 100644
index d36dc25d0b5..00000000000
--- a/unittest/mytap/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-AM_CPPFLAGS = -I$(top_srcdir)/include
-
-noinst_LIBRARIES = libmytap.a
-noinst_HEADERS = tap.h
-
-libmytap_a_SOURCES = tap.c
-
-EXTRA_DIST = CMakeLists.txt
-
-SUBDIRS = . t
diff --git a/unittest/mytap/t/Makefile.am b/unittest/mytap/t/Makefile.am
deleted file mode 100644
index bce72a88c05..00000000000
--- a/unittest/mytap/t/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright (C) 2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-AM_CPPFLAGS = -I$(srcdir) -I$(top_builddir)/include -I$(srcdir)/.. -I$(top_srcdir)/include
-
-AM_LDFLAGS = -L$(top_builddir)/unittest/mytap
-
-LDADD = -lmytap
-
-noinst_PROGRAMS = basic-t
diff --git a/unittest/mytap/t/basic-t.c b/unittest/mytap/t/basic-t.c
index c0ceb5bf190..b588521d192 100644
--- a/unittest/mytap/t/basic-t.c
+++ b/unittest/mytap/t/basic-t.c
@@ -22,7 +22,7 @@ int main() {
plan(5);
ok(1 == 1, "testing basic functions");
ok(2 == 2, " ");
- ok(3 == 3, NULL);
+ ok1(3 == 3);
if (1 == 1)
skip(2, "Sensa fragoli");
else {
diff --git a/unittest/mytap/tap.c b/unittest/mytap/tap.c
index 7facb23e7e3..f7a6d881421 100644
--- a/unittest/mytap/tap.c
+++ b/unittest/mytap/tap.c
@@ -244,6 +244,23 @@ ok(int pass, char const *fmt, ...)
emit_endl();
}
+void
+ok1(int const pass)
+{
+ va_list ap;
+
+ memset(&ap, 0, sizeof(ap));
+
+ if (!pass && *g_test.todo == '\0')
+ ++g_test.failed;
+
+ vemit_tap(pass, NULL, ap);
+
+ if (*g_test.todo != '\0')
+ emit_dir("todo", g_test.todo);
+
+ emit_endl();
+}
void
skip(int how_many, char const *fmt, ...)
diff --git a/unittest/mytap/tap.h b/unittest/mytap/tap.h
index 69b1d1e46c4..535db3e6c6c 100644
--- a/unittest/mytap/tap.h
+++ b/unittest/mytap/tap.h
@@ -121,8 +121,8 @@ void plan(int count);
@endcode
@param pass Zero if the test failed, non-zero if it passed.
- @param fmt Format string in printf() format. NULL is allowed, in
- which case nothing is printed.
+ @param fmt Format string in printf() format. NULL is not allowed,
+ use ok1() in this case.
*/
void ok(int pass, char const *fmt, ...)
@@ -130,6 +130,17 @@ void ok(int pass, char const *fmt, ...)
/**
+ Report test result as a TAP line.
+
+ Same as ok() but does not take a message to be printed.
+
+ @param pass Zero if the test failed, non-zero if it passed.
+*/
+
+void ok1(int const pass);
+
+
+/**
Skip a determined number of tests.
Function to print that <em>how_many</em> tests have been skipped.
diff --git a/unittest/strings/Makefile.am b/unittest/strings/Makefile.am
deleted file mode 100644
index 5b18d89f58e..00000000000
--- a/unittest/strings/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2000, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# 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
-
-AM_CPPFLAGS = @ZLIB_INCLUDES@ -I$(top_builddir)/include
-AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_srcdir)/unittest/mytap
-
-LDADD = $(top_builddir)/unittest/mytap/libmytap.a \
- $(top_builddir)/mysys/libmysys.a \
- $(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/strings/libmystrings.a
-
-noinst_PROGRAMS = strings-t
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/unittest/unit.pl b/unittest/unit.pl
index a1aab376fdf..f5f5d21f988 100644
--- a/unittest/unit.pl
+++ b/unittest/unit.pl
@@ -14,7 +14,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-use Test::Harness;
use File::Find;
use Getopt::Long;
@@ -38,9 +37,10 @@ unit - Run unit tests in directory
my $big= $ENV{'MYTAP_CONFIG'} eq 'big';
+my $opt_verbose;
my $result = GetOptions (
"big!" => \$big,
- "verbose!" => \$Test::Harness::verbose,
+ "verbose!" => \$opt_verbose,
);
$ENV{'MYTAP_CONFIG'} = $big ? 'big' : '';
@@ -60,6 +60,19 @@ Run all unit tests in the current directory and all subdirectories.
=cut
+BEGIN {
+ # Test::Harness have been extensively rewritten in newer perl
+ # versions and is now just a backward compatibility wrapper
+ # (with a bug causing the HARNESS_PERL_SWITCHES to be mangled)
+ # Prefer to use TAP::Harness directly if available
+ if (eval "use TAP::Harness; 1") {
+ eval 'sub NEW_HARNESS { 1 }';
+ warn "using TAP::Harness";
+ } else {
+ eval "use Test::Harness; 1" or die "couldn't find Test::Harness!";
+ eval 'sub NEW_HARNESS { 0 }';
+ }
+}
sub _find_test_files (@) {
my @dirs = @_;
@@ -102,8 +115,19 @@ sub run_cmd (@) {
if (@files > 0) {
# Removing the first './' from the file names
foreach (@files) { s!^\./!! }
- $ENV{'HARNESS_PERL_SWITCHES'} .= ' -e "exec @ARGV"';
- runtests @files;
+
+ if (NEW_HARNESS())
+ {
+ my %args = ( exec => [ ], verbosity => $opt_verbose );
+ my $harness = TAP::Harness->new( \%args );
+ $harness->runtests(@files);
+ }
+ else
+ {
+ $ENV{'HARNESS_VERBOSE'} = $opt_verbose;
+ $ENV{'HARNESS_PERL_SWITCHES'} .= ' -e "exec @ARGV"';
+ runtests(@files);
+ }
}
}
diff --git a/vio/Makefile.am b/vio/Makefile.am
deleted file mode 100644
index c70af1008cd..00000000000
--- a/vio/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (C) 2000-2003, 2005, 2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
- $(openssl_includes)
-LDADD = @CLIENT_EXTRA_LDFLAGS@ $(openssl_libs) $(yassl_libs)
-pkglib_LIBRARIES = libvio.a
-
-noinst_HEADERS = vio_priv.h
-
-libvio_a_SOURCES = vio.c viosocket.c viossl.c viosslfactories.c
-
-EXTRA_DIST= CMakeLists.txt
diff --git a/vio/test-ssl.c b/vio/test-ssl.c
index 1e846727d00..4d158ae83f7 100644
--- a/vio/test-ssl.c
+++ b/vio/test-ssl.c
@@ -59,6 +59,9 @@ main(int argc, char** argv)
struct st_VioSSLFd* ssl_acceptor= 0;
struct st_VioSSLFd* ssl_connector= 0;
Vio* client_vio=0, *server_vio=0;
+ enum enum_ssl_init_error ssl_init_error;
+ unsigned long ssl_error;
+
MY_INIT(argv[0]);
DBUG_PROCESS(argv[0]);
DBUG_PUSH(default_dbug_option);
@@ -91,16 +94,16 @@ main(int argc, char** argv)
ssl_acceptor = new_VioSSLAcceptorFd(server_key, server_cert, ca_file,
ca_path, cipher);
ssl_connector = new_VioSSLConnectorFd(client_key, client_cert, ca_file,
- ca_path, cipher);
+ ca_path, cipher, &ssl_init_error);
client_vio = (struct st_vio*)my_malloc(sizeof(struct st_vio),MYF(0));
client_vio->sd = sv[0];
client_vio->vioblocking(client_vio, 0, &unused);
- sslconnect(ssl_connector,client_vio,60L);
+ sslconnect(ssl_connector,client_vio,60L,&ssl_error);
server_vio = (struct st_vio*)my_malloc(sizeof(struct st_vio),MYF(0));
server_vio->sd = sv[1];
server_vio->vioblocking(client_vio, 0, &unused);
- sslaccept(ssl_acceptor,server_vio,60L);
+ sslaccept(ssl_acceptor,server_vio,60L, &ssl_error);
printf("Socketpair: %d , %d\n", client_vio->sd, server_vio->sd);
diff --git a/vio/test-sslclient.c b/vio/test-sslclient.c
index 643dcbf2c8e..9d8a741e313 100644
--- a/vio/test-sslclient.c
+++ b/vio/test-sslclient.c
@@ -50,6 +50,9 @@ main( int argc __attribute__((unused)),
Vio* client_vio=0;
int err;
char xbuf[100]="Ohohhhhoh1234";
+ enum enum_ssl_init_error ssl_init_error;
+ unsigned long ssl_error;
+
MY_INIT(argv[0]);
DBUG_PROCESS(argv[0]);
DBUG_PUSH(default_dbug_option);
@@ -60,7 +63,8 @@ main( int argc __attribute__((unused)),
if (ca_path!=0)
printf("CApath : %s\n", ca_path);
- ssl_connector = new_VioSSLConnectorFd(client_key, client_cert, ca_file, ca_path, cipher);
+ ssl_connector = new_VioSSLConnectorFd(client_key, client_cert, ca_file, ca_path, cipher,
+ &ssl_init_error);
if(!ssl_connector) {
fatal_error("client:new_VioSSLConnectorFd failed");
}
@@ -81,7 +85,7 @@ main( int argc __attribute__((unused)),
/* ----------------------------------------------- */
/* Now we have TCP conncetion. Start SSL negotiation. */
read(client_vio->sd,xbuf, sizeof(xbuf));
- sslconnect(ssl_connector,client_vio,60L);
+ sslconnect(ssl_connector,client_vio,60L,&ssl_error);
err = vio_read(client_vio,xbuf, sizeof(xbuf));
if (err<=0) {
my_free(ssl_connector);
diff --git a/vio/test-sslserver.c b/vio/test-sslserver.c
index 3123a4def2c..35cfa26bd00 100644
--- a/vio/test-sslserver.c
+++ b/vio/test-sslserver.c
@@ -52,6 +52,7 @@ do_ssl_stuff( TH_ARGS* args)
const char* s = "Huhuhuhuuu";
Vio* server_vio;
int err;
+ unsigned long ssl_error;
DBUG_ENTER("do_ssl_stuff");
server_vio = vio_new(args->sd, VIO_TYPE_TCPIP, TRUE);
@@ -60,7 +61,7 @@ do_ssl_stuff( TH_ARGS* args)
/* TCP connection is ready. Do server side SSL. */
err = write(server_vio->sd,(uchar*)s, strlen(s));
- sslaccept(args->ssl_acceptor,server_vio,60L);
+ sslaccept(args->ssl_acceptor,server_vio,60L,&ssl_error);
err = server_vio->write(server_vio,(uchar*)s, strlen(s));
DBUG_VOID_RETURN;
}
diff --git a/vio/viosocket.c b/vio/viosocket.c
index 163eb279d45..daa5e6602c8 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -1,17 +1,19 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
- 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 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
+ 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 */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA */
/*
Note that we can't have assertion on file descriptors; The reason for
@@ -22,6 +24,10 @@
#include "vio_priv.h"
+#ifdef FIONREAD_IN_SYS_FILIO
+# include <sys/filio.h>
+#endif
+
int vio_errno(Vio *vio __attribute__((unused)))
{
return socket_errno; /* On Win32 this mapped to WSAGetLastError() */
@@ -583,13 +589,13 @@ static my_bool socket_poll_read(my_socket sd, uint timeout)
static my_bool socket_peek_read(Vio *vio, uint *bytes)
{
-#ifdef __WIN__
+#if defined(_WIN32)
int len;
if (ioctlsocket(vio->sd, FIONREAD, &len))
return TRUE;
*bytes= len;
return FALSE;
-#elif FIONREAD_IN_SYS_IOCTL
+#elif defined(FIONREAD_IN_SYS_IOCTL) || defined(FIONREAD_IN_SYS_FILIO)
int len;
if (ioctl(vio->sd, FIONREAD, &len) < 0)
return TRUE;
@@ -861,7 +867,7 @@ size_t vio_read_shared_memory(Vio * vio, uchar* buf, size_t size)
{
size_t length;
size_t remain_local;
- char *current_postion;
+ char *current_position;
HANDLE events[2];
DBUG_ENTER("vio_read_shared_memory");
@@ -869,7 +875,7 @@ size_t vio_read_shared_memory(Vio * vio, uchar* buf, size_t size)
size));
remain_local = size;
- current_postion=buf;
+ current_position=buf;
events[0]= vio->event_server_wrote;
events[1]= vio->event_conn_closed;
@@ -903,11 +909,11 @@ size_t vio_read_shared_memory(Vio * vio, uchar* buf, size_t size)
if (length > remain_local)
length = remain_local;
- memcpy(current_postion,vio->shared_memory_pos,length);
+ memcpy(current_position,vio->shared_memory_pos,length);
vio->shared_memory_remain-=length;
vio->shared_memory_pos+=length;
- current_postion+=length;
+ current_position+=length;
remain_local-=length;
if (!vio->shared_memory_remain)
@@ -927,7 +933,7 @@ size_t vio_write_shared_memory(Vio * vio, const uchar* buf, size_t size)
{
size_t length, remain, sz;
HANDLE pos;
- const uchar *current_postion;
+ const uchar *current_position;
HANDLE events[2];
DBUG_ENTER("vio_write_shared_memory");
@@ -935,7 +941,7 @@ size_t vio_write_shared_memory(Vio * vio, const uchar* buf, size_t size)
size));
remain = size;
- current_postion = buf;
+ current_position = buf;
events[0]= vio->event_server_read;
events[1]= vio->event_conn_closed;
@@ -953,9 +959,9 @@ size_t vio_write_shared_memory(Vio * vio, const uchar* buf, size_t size)
int4store(vio->handle_map,sz);
pos = vio->handle_map + 4;
- memcpy(pos,current_postion,sz);
+ memcpy(pos,current_position,sz);
remain-=sz;
- current_postion+=sz;
+ current_position+=sz;
if (!SetEvent(vio->event_client_wrote))
DBUG_RETURN((size_t) -1);
}
@@ -1060,6 +1066,34 @@ ssize_t vio_pending(Vio *vio)
/**
+ Checks if the error code, returned by vio_getnameinfo(), means it was the
+ "No-name" error.
+
+ Windows-specific note: getnameinfo() returns WSANO_DATA instead of
+ EAI_NODATA or EAI_NONAME when no reverse mapping is available at the host
+ (i.e. Windows can't get hostname by IP-address). This error should be
+ treated as EAI_NONAME.
+
+ @return if the error code is actually EAI_NONAME.
+ @retval true if the error code is EAI_NONAME.
+ @retval false otherwise.
+*/
+
+my_bool vio_is_no_name_error(int err_code)
+{
+#ifdef _WIN32
+
+ return err_code == WSANO_DATA || err_code == EAI_NONAME;
+
+#else
+
+ return err_code == EAI_NONAME;
+
+#endif
+}
+
+
+/**
This is a wrapper for the system getnameinfo(), because different OS
differ in the getnameinfo() implementation:
- Solaris 10 requires that the 2nd argument (salen) must match the
diff --git a/vio/viossl.c b/vio/viossl.c
index 6a479c779cb..ab1f217748d 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -24,6 +24,8 @@
#ifdef HAVE_OPENSSL
+#ifndef DBUG_OFF
+
static void
report_errors(SSL* ssl)
{
@@ -31,9 +33,7 @@ report_errors(SSL* ssl)
const char *file;
const char *data;
int line, flags;
-#ifndef DBUG_OFF
char buf[512];
-#endif
DBUG_ENTER("report_errors");
@@ -56,6 +56,8 @@ report_errors(SSL* ssl)
DBUG_VOID_RETURN;
}
+#endif
+
size_t vio_ssl_read(Vio *vio, uchar* buf, size_t size)
{
@@ -149,8 +151,9 @@ void vio_ssl_delete(Vio *vio)
static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
- int (*connect_accept_func)(SSL*), char *error_string)
+ int (*connect_accept_func)(SSL*), unsigned long *errptr)
{
+ int r;
SSL *ssl;
my_bool unused;
my_bool was_blocking;
@@ -166,8 +169,7 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
if (!(ssl= SSL_new(ptr->ssl_context)))
{
DBUG_PRINT("error", ("SSL_new failure"));
- report_errors(ssl);
- strmov(error_string, "SSL_new failed");
+ *errptr= ERR_get_error();
vio_blocking(vio, was_blocking, &unused);
DBUG_RETURN(1);
}
@@ -176,11 +178,10 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout);
SSL_set_fd(ssl, vio->sd);
- if (connect_accept_func(ssl) < 1)
+ if ((r= connect_accept_func(ssl)) < 1)
{
DBUG_PRINT("error", ("SSL_connect/accept failure"));
- report_errors(ssl);
- ERR_error_string(SSL_get_error(ssl, 0), error_string);
+ *errptr= SSL_get_error(ssl, r);
SSL_free(ssl);
vio_blocking(vio, was_blocking, &unused);
DBUG_RETURN(1);
@@ -228,19 +229,17 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
}
-int sslaccept(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
- char *error_string)
+int sslaccept(struct st_VioSSLFd *ptr, Vio *vio, long timeout, unsigned long *errptr)
{
DBUG_ENTER("sslaccept");
- DBUG_RETURN(ssl_do(ptr, vio, timeout, SSL_accept, error_string));
+ DBUG_RETURN(ssl_do(ptr, vio, timeout, SSL_accept, errptr));
}
-int sslconnect(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
- char *error_string)
+int sslconnect(struct st_VioSSLFd *ptr, Vio *vio, long timeout, unsigned long *errptr)
{
DBUG_ENTER("sslconnect");
- DBUG_RETURN(ssl_do(ptr, vio, timeout, SSL_connect, error_string));
+ DBUG_RETURN(ssl_do(ptr, vio, timeout, SSL_connect, errptr));
}
diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c
index 4971dec37fb..4f4dd5758ba 100644
--- a/vio/viosslfactories.c
+++ b/vio/viosslfactories.c
@@ -165,7 +165,7 @@ static struct st_VioSSLFd *
new_VioSSLFd(const char *key_file, const char *cert_file,
const char *ca_file, const char *ca_path,
const char *cipher, SSL_METHOD *method,
- enum enum_ssl_init_error* error)
+ enum enum_ssl_init_error *error)
{
DH *dh;
struct st_VioSSLFd *ssl_fd;
@@ -249,11 +249,10 @@ new_VioSSLFd(const char *key_file, const char *cert_file,
struct st_VioSSLFd *
new_VioSSLConnectorFd(const char *key_file, const char *cert_file,
const char *ca_file, const char *ca_path,
- const char *cipher)
+ const char *cipher, enum enum_ssl_init_error* error)
{
struct st_VioSSLFd *ssl_fd;
int verify= SSL_VERIFY_PEER;
- enum enum_ssl_init_error dummy;
/*
Turn off verification of servers certificate if both
@@ -263,7 +262,7 @@ new_VioSSLConnectorFd(const char *key_file, const char *cert_file,
verify= SSL_VERIFY_NONE;
if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file,
- ca_path, cipher, TLSv1_client_method(), &dummy)))
+ ca_path, cipher, TLSv1_client_method(), error)))
{
return 0;
}
diff --git a/vio/viotest-ssl.c b/vio/viotest-ssl.c
index 5c68e861d2a..90489b46605 100644
--- a/vio/viotest-ssl.c
+++ b/vio/viotest-ssl.c
@@ -60,6 +60,9 @@ int main(int argc, char **argv)
struct st_VioSSLConnectorFd* ssl_connector=0;
Vio* client_vio=0;
Vio* server_vio=0;
+ enum enum_ssl_init_error ssl_init_error;
+ unsigned long ssl_error;
+
MY_INIT(argv[0]);
DBUG_PROCESS(argv[0]);
DBUG_PUSH(default_dbug_option);
@@ -92,14 +95,14 @@ int main(int argc, char **argv)
ssl_acceptor = new_VioSSLAcceptorFd(server_key, server_cert, ca_file,
ca_path);
ssl_connector = new_VioSSLConnectorFd(client_key, client_cert, ca_file,
- ca_path);
+ ca_path, &ssl_init_error);
client_vio = (Vio*)my_malloc(sizeof(struct st_vio),MYF(0));
client_vio->sd = sv[0];
- sslconnect(ssl_connector,client_vio);
+ sslconnect(ssl_connector,client_vio,&ssl_error);
server_vio = (Vio*)my_malloc(sizeof(struct st_vio),MYF(0));
server_vio->sd = sv[1];
- sslaccept(ssl_acceptor,server_vio);
+ sslaccept(ssl_acceptor,server_vio,&ssl_error);
printf("Socketpair: %d , %d\n", client_vio->sd, server_vio->sd);
diff --git a/win/Makefile.am b/win/Makefile.am
deleted file mode 100644
index 5b71b7342a9..00000000000
--- a/win/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (C) 2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-## Process this file with automake to create Makefile.in
-EXTRA_DIST = build-vs71.bat build-vs8.bat build-vs8_x64.bat build-vs9.bat \
- build-vs9_x64.bat configure.js README mysql_manifest.cmake \
- create_manifest.js create_def_file.js
diff --git a/win/README b/win/README
deleted file mode 100644
index 63923a6d7e2..00000000000
--- a/win/README
+++ /dev/null
@@ -1,102 +0,0 @@
-Windows building readme
-======================================
-
-----------------IMPORTANT----------------------------
-This readme outlines the instructions for building
-MySQL for Windows staring from version 5.1.
-This readme does not apply to MySQL versions 5.0
-or ealier.
------------------------------------------------------
-
-The Windows build system uses a tool named CMake to generate build files for
-a variety of project systems. This tool is combined with a set of jscript
-files to enable building of MySQL for Windows directly out of a bk clone.
-The steps required are below.
-
-Step 1:
--------
-
-Install a Windows C++ compiler. If you don't have one, you can use
-the free compiler "Visual C++ 2005 express edition", which from Cmake
-point of view is same as Visual studio 8:
-http://msdn.microsoft.com/vstudio/express/
-
-Step 2
-------
-Download and install CMake. It can be downloaded from http://www.cmake.org.
-Once it is installed, modify your path to make sure you can execute
-the cmake binary.
-
-Step 3
-------
-Download and install bison for Windows. It can be downloaded from
-http://gnuwin32.sourceforge.net/packages/bison.htm. Please download using
-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.
-
-(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)
-
-Step 4
-------
-Clone your bk tree to any location you like.
-
-Step 5
-------
-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
- WITH_ARCHIVE_STORAGE_ENGINE
- WITH_BLACKHOLE_STORAGE_ENGINE
- WITH_EXAMPLE_STORAGE_ENGINE
- WITH_FEDERATED_STORAGE_ENGINE
- __NT__ Enable named pipe support
- WITHOUT_ATOMICS Do not use atomic instructions
- MYSQL_SERVER_SUFFIX=<suffix> Server suffix, default none
- COMPILATION_COMMENT=<comment> Server comment, default "Source distribution"
- 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. (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 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.
-
-We will support building with nmake in the near future.
-
-Step 7
-------
-From the root of your bk clone, start your build.
-
-For Visual Studio, execute mysql.sln. This will start the IDE
-and you can click the build solution menu option.
-
-Current issues
---------------
-1. After changing configuration (eg. adding or removing a storage engine), it
-may be necessary to clean the build tree to remove any stale objects.
-
-2. To use Visual C++ Express Edition you also need to install the Platform SDK.
-Please see this link: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
-At step 5 you only need to add the libraries advapi32.lib and user32.lib to
-the file "corewin_express.vsprops" in order to avoid link errors.
diff --git a/win/build-nmake-x64.bat b/win/build-nmake-x64.bat
deleted file mode 100644
index f73574ac8de..00000000000
--- a/win/build-nmake-x64.bat
+++ /dev/null
@@ -1,21 +0,0 @@
-@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
deleted file mode 100644
index 89505c08313..00000000000
--- a/win/build-nmake.bat
+++ /dev/null
@@ -1,21 +0,0 @@
-@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/build-vs71.bat b/win/build-vs71.bat
deleted file mode 100755
index 159b1ec97d1..00000000000
--- a/win/build-vs71.bat
+++ /dev/null
@@ -1,22 +0,0 @@
-@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\vs71cache.txt cmakecache.txt
-cmake -G "Visual Studio 7 .NET 2003"
-copy cmakecache.txt win\vs71cache.txt
-
diff --git a/win/build-vs8.bat b/win/build-vs8.bat
deleted file mode 100755
index ff0eeb0a8cb..00000000000
--- a/win/build-vs8.bat
+++ /dev/null
@@ -1,21 +0,0 @@
-@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\vs8cache.txt cmakecache.txt
-cmake -G "Visual Studio 8 2005"
-copy cmakecache.txt win\vs8cache.txt
diff --git a/win/build-vs8_x64.bat b/win/build-vs8_x64.bat
deleted file mode 100755
index bc13e01d742..00000000000
--- a/win/build-vs8_x64.bat
+++ /dev/null
@@ -1,21 +0,0 @@
-@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\vs8cache.txt cmakecache.txt
-cmake -G "Visual Studio 8 2005 Win64"
-copy cmakecache.txt win\vs8cache.txt
diff --git a/win/build-vs9.bat b/win/build-vs9.bat
deleted file mode 100644
index 09f1e343013..00000000000
--- a/win/build-vs9.bat
+++ /dev/null
@@ -1,18 +0,0 @@
-@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
-cmake -G "Visual Studio 9 2008"
-
diff --git a/win/build-vs9_x64.bat b/win/build-vs9_x64.bat
deleted file mode 100644
index 61c7253132d..00000000000
--- a/win/build-vs9_x64.bat
+++ /dev/null
@@ -1,18 +0,0 @@
-@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
-cmake -G "Visual Studio 9 2008 Win64"
-
diff --git a/win/configure.js b/win/configure.js
deleted file mode 100644
index b9996d52591..00000000000
--- a/win/configure.js
+++ /dev/null
@@ -1,346 +0,0 @@
-// Configure.js
-//
-// Copyright (C) 2006 MySQL AB
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; version 2 of the License.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-ForReading = 1;
-ForWriting = 2;
-ForAppending = 8;
-
-try
-{
- var fso = new ActiveXObject("Scripting.FileSystemObject");
-
- var args = WScript.Arguments
-
- // read in the Unix configure.in file
- var configureInTS = fso.OpenTextFile("configure.in", ForReading);
- var configureIn = configureInTS.ReadAll();
- configureInTS.Close();
- var default_comment = "Source distribution";
- var default_port = GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT");
- var actual_port = 0;
- var with_maria_tmp_tables = -1;
-
- var configfile = fso.CreateTextFile("win\\configure.data", true);
- for (i=0; i < args.Count(); i++)
- {
- var parts = args.Item(i).split('=');
- switch (parts[0])
- {
- case "CYBOZU":
- case "EMBED_MANIFESTS":
- case "EXTRA_DEBUG":
- case "WITH_EMBEDDED_SERVER":
- case "WITHOUT_ATOMICS":
- configfile.WriteLine("SET (" + args.Item(i) + " TRUE CACHE BOOL \"\")");
- break;
- case "WITH_ARIA_STORAGE_ENGINE":
- configfile.WriteLine("SET (" + args.Item(i) + " TRUE CACHE BOOL \"\")");
- if(with_maria_tmp_tables == -1)
- {
- with_maria_tmp_tables = 1;
- }
- break;
- case "WITH_ARIA_TMP_TABLES":
- with_maria_tmp_tables = ( parts.length == 1 ||
- parts[1] == "YES" || parts[1] == "TRUE");
- break;
- case "WITHOUT_ARIA_TEMP_TABLES":
- with_maria_tmp_tables = 0;
- break;
- case "MYSQL_SERVER_SUFFIX":
- case "MYSQLD_EXE_SUFFIX":
- configfile.WriteLine("SET (" + parts[0] + " \""
- + parts[1] + "\" CACHE STRING \"\")");
- break;
- case "COMPILATION_COMMENT":
- default_comment = parts[1];
- break;
- case "MYSQL_TCP_PORT":
- actual_port = parts[1];
- break;
- }
- }
- if (with_maria_tmp_tables == 1)
- {
- configfile.WriteLine("SET (WITH_ARIA_TMP_TABLES TRUE CACHE BOOL \"\")");
- }
- if (actual_port == 0)
- {
- // if we actually defaulted (as opposed to the pathological case of
- // --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
- // happen if whole batch of servers was built from a script), set
- // the default to zero to indicate that; we don't lose information
- // that way, because 0 obviously indicates that we can get the
- // default value from MYSQL_TCP_PORT. this seems really evil, but
- // testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
- // a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
- // intend it to mean "use the default, in fact, look up a good default
- // from /etc/services if you can", but really, really meant 3306 when
- // they passed in 3306. When they pass in a specific value, let them
- // have it; don't second guess user and think we know better, this will
- // just make people cross. this makes the the logic work like this
- // (which is complicated enough):
- //
- // - if a port was set during build, use that as a default.
- //
- // - otherwise, try to look up a port in /etc/services; if that fails,
- // use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306)
- //
- // - allow the MYSQL_TCP_PORT environment variable to override that.
- //
- // - allow command-line parameters to override all of the above.
- //
- // the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js,
- // so don't mess with that.
- actual_port = default_port;
- default_port = 0;
- }
-
- configfile.WriteLine("SET (COMPILATION_COMMENT \"" +
- default_comment + "\" CACHE STRING \"\" )");
-
- configfile.WriteLine("SET (PROTOCOL_VERSION \"" +
- GetValue(configureIn, "PROTOCOL_VERSION") + "\" CACHE STRING \"\")");
- configfile.WriteLine("SET (DOT_FRM_VERSION \"" +
- GetValue(configureIn, "DOT_FRM_VERSION") + "\" CACHE STRING \"\")");
- configfile.WriteLine("SET (MYSQL_TCP_PORT_DEFAULT \"" + default_port + "\" CACHE STRING \"\")");
- configfile.WriteLine("SET (MYSQL_TCP_PORT \"" + actual_port + "\" CACHE STRING \"\")");
- configfile.WriteLine("SET (MYSQL_UNIX_ADDR \"" +
- GetValue(configureIn, "MYSQL_UNIX_ADDR_DEFAULT") + "\" CACHE STRING \"\")");
- var version = GetVersion(configureIn);
- configfile.WriteLine("SET (VERSION \"" + version + "\" CACHE STRING \"\")");
- configfile.WriteLine("SET (MYSQL_BASE_VERSION \"" +
- GetBaseVersion(version) + "\" CACHE STRING \"\")");
- configfile.WriteLine("SET (MYSQL_VERSION_ID \"" +
- GetVersionId(version) + "\" CACHE STRING \"\")");
- var engineOptions = ParsePlugins();
- for (option in engineOptions)
- {
- configfile.WriteLine("SET(" + engineOptions[option] + " TRUE CACHE BOOL \"\")");
- }
- configfile.Close();
-
- fso = null;
-
- WScript.Echo("done!");
-}
-catch (e)
-{
- WScript.Echo("Error: " + e.description);
-}
-
-function GetValue(str, key)
-{
- var pos = str.indexOf(key+'=');
- if (pos == -1) return null;
- pos += key.length + 1;
- var end = str.indexOf("\n", pos);
- if (str.charAt(pos) == "\"")
- pos++;
- if (str.charAt(end-1) == "\"")
- end--;
- return str.substring(pos, end);
-}
-
-function GetVersion(str)
-{
- var key = "AC_INIT([MariaDB Server], [";
- var key2 = "AM_INIT_AUTOMAKE(mariadb, ";
- var key_len = key.length;
- var pos = str.indexOf(key);
- if (pos == -1)
- {
- pos = str.indexOf(key2);
- key_len= key2.length;
- }
- if (pos == -1) return null;
- pos += key_len;
- var end = str.indexOf("]", pos);
- if (end == -1) return null;
- return str.substring(pos, end);
-}
-
-function GetBaseVersion(version)
-{
- var dot = version.indexOf(".");
- if (dot == -1) return null;
- dot = version.indexOf(".", dot+1);
- if (dot == -1) dot = version.length;
- return version.substring(0, dot);
-}
-
-function GetVersionId(version)
-{
- var dot = version.indexOf(".");
- if (dot == -1) return null;
- var major = parseInt(version.substring(0, dot), 10);
-
- dot++;
- var nextdot = version.indexOf(".", dot);
- if (nextdot == -1) return null;
- var minor = parseInt(version.substring(dot, nextdot), 10);
- dot = nextdot+1;
-
- var stop = version.indexOf("-", dot);
- if (stop == -1) stop = version.length;
- var build = parseInt(version.substring(dot, stop), 10);
-
- var id = major;
- if (minor < 10)
- id += '0';
- id += minor;
- if (build < 10)
- id += '0';
- id += build;
- return id;
-}
-
-function PluginConfig(isGroup, include)
-{
- this.isGroup = isGroup;
- this.include = include;
-}
-
-
-// Parse command line arguments specific to plugins (aka storage engines).
-//
-// --with-plugin-PLUGIN, --with-plugins=group, --with-plugins=PLUGIN[,PLUGIN...]
-// --without-plugin-PLUGIN is supported.
-//
-// Legacy option WITH_<PLUGIN>_STORAGE_ENGINE is supported as well.
-// The function returns string array with elements like WITH_SOME_STORAGE_ENGINE
-// or WITHOUT_SOME_STORAGE_ENGINE.
-//
-// This function handles groups, for example effect of specifying --with-plugins=max
-// is the same as --with-plugins==archive,federated,falcon,innobase...
-
-function ParsePlugins()
-{
-
- var config = new Array();
-
- config["DEFAULT"] = new PluginConfig(true,true);
-
- // Parse command line parameters
- for (i=0; i< WScript.Arguments.length;i++)
- {
- var option = WScript.Arguments.Item(i);
- var match = /WITH_(\w+)_STORAGE_ENGINE/.exec(option);
- if (match == null)
- match = /--with-plugin-(\w+)/.exec(option);
- if (match != null)
- {
- config[match[1].toUpperCase()] = new PluginConfig(false,true);
- continue;
- }
-
- match = /WITHOUT_(\w+)_STORAGE_ENGINE/.exec(option);
- if (match == null)
- match = /--without-plugin-(\w+)/.exec(option);
-
- if (match != null)
- {
- config[match[1].toUpperCase()] =
- new PluginConfig(false,false);
- continue;
- }
-
- match = /--with-plugins=([\w,\-_]+)/.exec(option);
- if(match != null)
- {
-
- var plugins = match[1].split(",");
- for(var key in plugins)
- {
- config[plugins[key].toUpperCase()] =
- new PluginConfig(null,true);
- }
- continue;
- }
- match = /--without-plugins=([\w,\-_]+)/.exec(option);
- if(match != null)
- {
- var plugins = match[1].split(",");
- for(var key in plugins)
- config[plugins[key].toUpperCase()] =
- new PluginConfig(null, false);
- continue;
- }
- }
-
- // Read plugin definitions, find out groups plugins belong to.
- var fc = new Enumerator(fso.GetFolder("storage").SubFolders);
- for (;!fc.atEnd(); fc.moveNext())
- {
- var subfolder = fc.item();
- var name = subfolder.name.toUpperCase();
-
- // Handle case where storage engine was already specified by name in
- // --with-plugins or --without-plugins.
- if (config[name] != undefined)
- {
- config[name].isGroup = false;
- continue;
- }
- config[name] = new PluginConfig(false,null);
-
- // Handle groups. For each plugin, find out which group it belongs to
- // If this group was specified on command line for inclusion/exclusion,
- // then include/exclude the plugin.
- filename = subfolder +"\\plug.in";
- if (fso.FileExists(filename))
- {
- var content = fso.OpenTextFile(filename, ForReading).ReadAll();
- var match =
- /MYSQL_STORAGE_ENGINE([ ]*)[\(]([^\)]+)[\)]/.exec(content);
- if (match== null)
- continue;
- match = /\[[\w,\-_]+\][\s]?\)/.exec(match[0]);
- if (match == null)
- continue;
- groups = match[0].split(/[\,\(\)\[\] ]/);
- for (var key in groups)
- {
- var group = groups[key].toUpperCase();
- if (config[group] != undefined)
- {
- config[group].isGroup = true;
- if (config[group].include != null)
- {
- config[name].include = config[group].include;
- break;
- }
- }
- }
- }
- }
-
- var arr = new Array();
- for(key in config)
- {
- var eng = config[key];
- if(eng.isGroup != undefined && !eng.isGroup && eng.include != undefined)
- {
- if (fso.FolderExists("storage\\"+key) || key=="PARTITION")
- {
- arr[arr.length] = eng.include?
- "WITH_"+key+"_STORAGE_ENGINE":"WITHOUT_"+key+"_STORAGE_ENGINE";
- }
- }
- }
- return arr;
-}
diff --git a/win/create_manifest.js b/win/create_manifest.js
deleted file mode 100755
index dbdd83588c5..00000000000
--- a/win/create_manifest.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- manifest.js - Writes a custom XML manifest for each executable/library
- 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.
- exe_level - Application execution level.
- [asInvoker|highestAvailable|requireAdministrator]
- outfile - Final destination where mainfest will be written.
-
- Example:
- cscript manifest.js name=mysql version=5.0.32 arch=X86 type=win32
- exe_level=asInvoker outfile=out.xml
-*/
-
-try
-{
- var args = WScript.Arguments
- for (i=0; i < args.Count(); i++)
- {
- var parts = args.Item(i).split('=');
- switch (parts[0])
- {
- case "name":
- var app_name= parts[1];
- break;
- case "version":
- 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);
- var fourth_element= 0;
- if(app_version.match(/[a-z]$/)) {
- fourth_element+= (1 + app_version.charCodeAt(end-1) - "a".charCodeAt(0));
- app_version= app_version.substring(0,--end);
- }
- if(app_version.match(/sp[1-9]$/)) {
- fourth_element+= 100*(app_version.charCodeAt(end-1) - "0".charCodeAt(0));
- app_version= app_version.substring(0, end-3);
- end-= 3;
- }
- app_version+= "." + fourth_element;
- break;
- case "arch":
- var app_arch= parts[1];
- break;
- case "exe_level":
- var app_exe_level= parts[1];
- break;
- case "outfile":
- var manifest_file= parts[1];
- break;
- default:
- WScript.echo("Invalid argument supplied.");
- }
- }
- 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";
- manifest_xml+= "<assembly xmlns=\'urn:schemas-microsoft-com:asm.v1\'";
- manifest_xml+= " manifestVersion=\'1.0\'>\r\n";
- // Application Information
- manifest_xml+= "\t<assemblyIdentity name=\'" + app_name + "\'";
- manifest_xml+= " version=\'" + app_version + "\'";
- manifest_xml+= " processorArchitecture=\'" + app_arch + "\'";
- 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";
- manifest_xml+= "<requestedExecutionLevel level=\'" + app_exe_level + "\'";
- manifest_xml+= " uiAccess=\'false\'/>\r\n";
- manifest_xml+= "\t\t\t</requestedPrivileges>\r\n\t\t</security>\r\n";
- manifest_xml+= "\t</trustInfo>\r\n</assembly>\r\n";
-
- // Write the valid XML to it's final destination.
- var outfileXML = WScript.CreateObject("Msxml2.DOMDocument.3.0");
- outfileXML.async = false;
- if (!outfileXML.loadXML(manifest_xml))
- {
- WScript.Echo(manifest_xml);
- throw new Error(2, "Invalid XML");
- }
- outfileXML.save(manifest_file);
-
- WScript.Echo("Success, created custom manifest!");
- WScript.Quit(0);
-}
-catch (e)
-{
- WScript.Echo("Error: " + e.description);
- WScript.Quit(1);
-}
diff --git a/win/mysql_manifest.cmake b/win/mysql_manifest.cmake
deleted file mode 100644
index 611553d68ac..00000000000
--- a/win/mysql_manifest.cmake
+++ /dev/null
@@ -1,21 +0,0 @@
-
-# - MYSQL_EMBED_MANIFEST(target_name required_privs)
-# Create a manifest for target_name. Set the execution level to require_privs
-#
-# NOTE. PROCESSOR_ARCH must be defined before this MACRO is called.
-
-MACRO(MYSQL_EMBED_MANIFEST _target_name _required_privs)
- ADD_CUSTOM_COMMAND(
- TARGET ${_target_name}
- PRE_LINK
- COMMAND cscript.exe
- 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 -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/Makefile.am b/zlib/Makefile.am
deleted file mode 100644
index 277f6445a85..00000000000
--- a/zlib/Makefile.am
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2004-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-# Process this file with automake to create Makefile.in
-
-INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include
-
-LIBS= $(NON_THREADED_LIBS)
-
-pkglib_LTLIBRARIES = libz.la
-noinst_LTLIBRARIES = libzlt.la
-
-libz_la_LDFLAGS = -static
-
-noinst_HEADERS = crc32.h deflate.h inffast.h inffixed.h inflate.h \
- inftrees.h trees.h zconf.h zlib.h zutil.h
-
-libz_la_SOURCES = adler32.c compress.c crc32.c deflate.c gzio.c \
- infback.c inffast.c inflate.c inftrees.c trees.c \
- uncompr.c zutil.c
-libzlt_la_SOURCES = $(libz_la_SOURCES)
-
-EXTRA_DIST= README FAQ INDEX ChangeLog algorithm.txt zlib.3 CMakeLists.txt